summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex')
-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/acronym/acronym.dtx155
-rw-r--r--Master/texmf-dist/source/latex/acronym/acronym.ins4
-rw-r--r--Master/texmf-dist/source/latex/animate/animate.tex55
-rw-r--r--Master/texmf-dist/source/latex/animate/files/pstmetronome.tex233
-rw-r--r--Master/texmf-dist/source/latex/babel/babel.dtx2795
-rw-r--r--Master/texmf-dist/source/latex/babel/babel.ins66
-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/beamertheme-gotham/gotham.dtx8842
-rw-r--r--Master/texmf-dist/source/latex/beamertheme-gotham/gotham.ins75
-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/biblatex-oxref/Makefile4
-rw-r--r--Master/texmf-dist/source/latex/biblatex-oxref/oxref.dtx1023
-rw-r--r--Master/texmf-dist/source/latex/biblatex-oxref/oxref.ins1
-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/cs-techrep/cs-techrep.dtx93
-rw-r--r--Master/texmf-dist/source/latex/cs-techrep/cs-techrep.ins2
-rw-r--r--Master/texmf-dist/source/latex/csthm/csthm.dtx238
-rw-r--r--Master/texmf-dist/source/latex/csthm/csthm.ins (renamed from Master/texmf-dist/source/latex/isosafety/isosafety.ins)57
-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.dtx784
-rw-r--r--Master/texmf-dist/source/latex/edmac/edmac.drv40
-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/fmtcount/fmtcount.dtx746
-rw-r--r--Master/texmf-dist/source/latex/fmtcount/fmtcount.ins10
-rw-r--r--Master/texmf-dist/source/latex/framedsyntax/FramedSyntax.dtx930
-rw-r--r--Master/texmf-dist/source/latex/fvextra/fvextra.dtx715
-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.dtx180
-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/iaria-lite/iaria-lite.dtx66
-rw-r--r--Master/texmf-dist/source/latex/iaria-lite/iaria-lite.ins2
-rw-r--r--Master/texmf-dist/source/latex/iaria/iaria.dtx91
-rw-r--r--Master/texmf-dist/source/latex/iaria/iaria.ins2
-rw-r--r--Master/texmf-dist/source/latex/isosafety/isosafety.dtx143
-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/jlreq/Makefile94
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/expl3.dtx13
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3basics.dtx9
-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.dtx18
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3color.dtx32
-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.dtx48
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3expan.dtx6
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3file.dtx14
-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.dtx24
-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.dtx20
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3prg.dtx4
-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.dtx4
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3seq.dtx5
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3skip.dtx9
-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.dtx7
-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.dtx15
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx17
-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/listings/listings.dtx149
-rw-r--r--Master/texmf-dist/source/latex/listings/lstdrvrs.dtx6
-rw-r--r--Master/texmf-dist/source/latex/listings/lstdrvrs.ins2
-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/minted/Makefile38
-rw-r--r--Master/texmf-dist/source/latex/minted/minted.dtx5241
-rw-r--r--Master/texmf-dist/source/latex/minted/minted.ins19
-rw-r--r--Master/texmf-dist/source/latex/mlacls/mla.dtx76
-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/naive-ebnf/naive-ebnf.dtx21
-rw-r--r--Master/texmf-dist/source/latex/nfssext-cfr/nfssext-cfr.dtx3341
-rw-r--r--Master/texmf-dist/source/latex/nfssext-cfr/nfssext-cfr.ins111
-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.dtx86
-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.dtx4
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-choice.dtx29
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-pushbutton.dtx8
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-radiobutton.dtx4
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-textfield.dtx2
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx12
-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.dtx227
-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.dtx18
-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/pdfpages/pdfpages.dtx21
-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.dtx30710
-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.dtx190
-rw-r--r--Master/texmf-dist/source/latex/reptheorem/reptheorem.ins6
-rw-r--r--Master/texmf-dist/source/latex/rub-kunstgeschichte/rub-kunstgeschichte.dtx401
-rw-r--r--Master/texmf-dist/source/latex/scrhack/scrhack-2023-07-07.dtx2057
-rw-r--r--Master/texmf-dist/source/latex/scrhack/scrhack.dtx991
-rw-r--r--Master/texmf-dist/source/latex/se2thesis/se2colors.dtx2
-rw-r--r--Master/texmf-dist/source/latex/se2thesis/se2fonts.dtx8
-rw-r--r--Master/texmf-dist/source/latex/se2thesis/se2packages.dtx4
-rw-r--r--Master/texmf-dist/source/latex/se2thesis/se2thesis.dtx102
-rw-r--r--Master/texmf-dist/source/latex/sidenotes/sidenotes.dtx246
-rw-r--r--Master/texmf-dist/source/latex/sidenotes/sidenotes.ins4
-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-compound.dtx1
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx9
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx51
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx5
-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.dtx1162
-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/tableof/tableof.dtx165
-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.dtx107
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx41
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx16
-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.dtx6
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx10
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx4
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx5
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx448
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx10
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx18
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx275
-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/ucph-revy/ucph-revy.dtx78
-rw-r--r--Master/texmf-dist/source/latex/udiss/udiss.dtx4143
-rw-r--r--Master/texmf-dist/source/latex/udiss/udiss.ins75
-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/useclass/useclass.dtx16
-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/verifycommand/verifycommand.dtx711
-rw-r--r--Master/texmf-dist/source/latex/xcolor/xcolor.dtx62
-rw-r--r--Master/texmf-dist/source/latex/zref-clever/zref-clever.dtx604
-rw-r--r--Master/texmf-dist/source/latex/zugferd/zugferd.dtx2285
-rw-r--r--Master/texmf-dist/source/latex/zugferd/zugferd.ins19
295 files changed, 67294 insertions, 46596 deletions
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/acronym/acronym.dtx b/Master/texmf-dist/source/latex/acronym/acronym.dtx
index f7d8e8eabd2..b332333810d 100644
--- a/Master/texmf-dist/source/latex/acronym/acronym.dtx
+++ b/Master/texmf-dist/source/latex/acronym/acronym.dtx
@@ -2,7 +2,7 @@
%
% Doc-Source file to use with LaTeX2e
%
-% Copyright 1994-2020 by Tobias Oetiker (tobi@oetiker.ch) and many Contributors.
+% Copyright 1994-2024 by Tobias Oetiker (tobi@oetiker.ch) and many Contributors.
% All rights reserved.
%
% This work may be distributed and/or modified under the conditions of
@@ -35,7 +35,7 @@
%</driver>
% \fi
%
-% \CheckSum{1526}
+% \CheckSum{1634}
%
%% \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
@@ -82,6 +82,8 @@
% \DoNotIndex{\textbf, \textsf, \textsmaller, \textsuperscript, \the}
% \DoNotIndex{\usepackage}
%
+% \changes{v1.49}{2024/03/30}{Chris Landis adds noforwardlinks option and fixes targets for forward links to acs/acl/etc.-only use}
+% \changes{v1.48}{2021/10/09}{Bruno Le Floch corrected capitalization of acronyms with a custom plural form.}
% \changes{v1.47}{2020/04/10}{Tobi Oetiker and Marcus Meeßen \cmd{hskip} Fixed several bugs in macros that use capitalisation, a bug were the output depends on the position of the list of acronyms, and a bug were nested hyperlinks could cause errors.}
% \changes{v1.46}{2020/03/13}{Tobi Oetiker \cmd{hskip} Fixed miss merge}
% \changes{v1.45}{2020/03/13}{Marcus Meeßen \cmd{hskip} Fixed hyperref and "missing aux" regressions.}
@@ -265,7 +267,7 @@
%
% \DescribeMacro{\acsp}
% Works in the same way as \cmd{\acs}, but makes the short
-% form into a plural.
+% form into a plural.
%
% \DescribeMacro{\aclp}
% Works in the same way as \cmd{\acl}, but makes the long form
@@ -284,6 +286,14 @@
% Works in the same way as \cmd{\acfi}, but starts the long form with an
% upper case letter.
%
+% \DescribeMacro{\acfip}
+% Works in the same way as \cmd{\acfi}, but makes the short and long
+% forms into plurals.
+%
+% \DescribeMacro{\Acfip}
+% Works in the same way as \cmd{\acfip}, but starts the long form with
+% an upper case letter.
+%
% \DescribeMacro{\acused}
% Marks an acronym as used, as if it had been called with \cmd{\ac},
% but without printing anything. This means that in the future only the
@@ -302,11 +312,11 @@
% Example: |\acl{lox}/\acl{lh2} (\acsu{lox}/\acsu{lh2})|
%
% \DescribeMacro{\iac}
-% Works in the same way as the \cmd{\ac} command but prefixes it with
+% Works in the same way as the \cmd{\ac} command but prefixes it with
% an appropriate indefinite article.
%
% \DescribeMacro{\Iac}
-% Works in the same way as the \cmd{\ac} command but prefixes it with
+% Works in the same way as the \cmd{\ac} command but prefixes it with
% an appropriate upper case indefinite article.
%
% \DescribeMacro{\...*}
@@ -316,8 +326,9 @@
% not show up.\\
% \cmd{\ac*}, \cmd{\Ac*}, \cmd{\acs*}, \cmd{\acl*}, \cmd{\Acl*}, \cmd{\acf*},
% \cmd{\Acf*}, \cmd{\acp*}, \cmd{\Acp*}, \cmd{\acsp*}, \cmd{\aclp*}, \cmd{\Aclp*},
-% \cmd{\acfp*}, \cmd{\Acfp*}, \cmd{\acfi*}, \cmd{\Acfi*}, \cmd{\acsu*},
-% \cmd{\aclu*}, \cmd{\Aclu*}, \cmd{\iac*} and \cmd{\Iac*}.
+% \cmd{\acfp*}, \cmd{\Acfp*}, \cmd{\acfi*}, \cmd{\Acfi*}, \cmd{\acfip*},
+% \cmd{\Acfip*}, \cmd{\acsu*}, \cmd{\aclu*}, \cmd{\Aclu*}, \cmd{\iac*},
+% and \cmd{\Iac*}.
%
% \subsection{Customization}
%
@@ -451,7 +462,7 @@
% that the latter makes the acronym definition stored in the |.aux|
% file. Therefore, the acronym becomes available from start-up in
% the next run.
-%
+%
% Note that all the acronym definitions made by \cmd{\acro} in the
% |acronym| environment are also similarly added to the |.aux|
% file.
@@ -459,8 +470,8 @@
% \subsubsection{Non standard indefinite articles}
%
% Sometimes the indefinite article of an acronym differs between its
-% short form and its long form, for example ``a Federal Bureau of
-% Investigation (FBI) agent'' and ``an FBI agent''. To deal with this,
+% short form and its long form, for example ``a Federal Bureau of
+% Investigation (FBI) agent'' and ``an FBI agent''. To deal with this,
% the package provides the following three commands
% \DescribeMacro{\newacroindefinite}
% \DescribeMacro{\acrodefindefinite}
@@ -479,7 +490,7 @@
% the acronym definition in the |.aux| file, so that the acronym
% exception is available at the next run from start-up.
%
-% When using \cmd{\iac} and \cmd{\Iac} without first defining an
+% When using \cmd{\iac} and \cmd{\Iac} without first defining an
% article, the default article is ``a''.
%
% \subsubsection{Non standard and foreign plural forms}
@@ -538,7 +549,7 @@
% exception is available at the next run from start-up. When the
% optional short form is not provided, the acronym name plus an `s'
% is used.
-%
+%
% Plural exceptions are never reported in tables of acronyms.
%
%
@@ -682,8 +693,8 @@ blocks to be tested separately. The latter are commonly indicated as
% First we test that we got the right format and name the package.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{acronym}[2020/04/17
- v1.47
+\ProvidesPackage{acronym}[2024/03/30
+ v1.49
Support for acronyms (Tobias Oetiker)]
\RequirePackage{suffix,xstring}
% \end{macrocode}
@@ -706,7 +717,7 @@ blocks to be tested separately. The latter are commonly indicated as
% \end{macro}
%
% \begin{macro}{\ifAC@nohyperlinks}
-% If hyperref is loaded, all acronyms will link to their glossary entry.
+% If hyperref is loaded, all acronyms will link to their glossary entry and the glossary entries to the first in-text use.
% With the option |nohyperlinks| these links can be suppressed.
% \begin{macrocode}
\newif\ifAC@nohyperlinks
@@ -717,6 +728,18 @@ blocks to be tested separately. The latter are commonly indicated as
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\ifAC@noforwardlinks}
+% If hyperref is loaded and the |nohyperlinks| option is not selected,
+% the option |noforwardlinks| suppresses the links from the glossary entries to the in-text use.
+% \begin{macrocode}
+\newif\ifAC@noforwardlinks
+\AC@noforwardlinksfalse
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareOption{noforwardlinks}{\AC@noforwardlinkstrue}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\ifAC@noacroprefix}
% With the |noacroprefix| option the acronym commands are not prefixed. This
% reproduces the old behavior of version <1.43, but can cause collisions
@@ -852,7 +875,7 @@ blocks to be tested separately. The latter are commonly indicated as
% is being set to the maximum. Otherwise, the default penalty is one level below
% the maximum, meaning that most of the times, by default, the line will not get
% broken.
-%
+%
% \begin{macrocode}
\ifAC@nolinebreak
\def\AC@linebreakpenalty{4}
@@ -889,7 +912,7 @@ blocks to be tested separately. The latter are commonly indicated as
\AtBeginDocument{%
\@ifpackageloaded{hyperref}
{\let\AC@hyperlink=\hyperlink
- \let\AC@hyperref=\hyperref
+ \ifAC@noforwardlinks\else\let\AC@hyperref=\hyperref\fi
\newcommand*\AC@raisedhypertarget[2]{%
\Hy@raisedlink{\hypertarget{#1}{}}#2}%
\let\AC@hypertarget=\AC@raisedhypertarget
@@ -959,6 +982,8 @@ blocks to be tested separately. The latter are commonly indicated as
\def\Acp#1{\AChy@call{#1}\@Acp}%
\def\acfi#1{\AChy@call{#1}\AChy@acf}%
\def\Acfi#1{\AChy@call{#1}\AChy@Acf}%
+ \def\acfip#1{\AChy@call{#1}\AChy@acfp}%
+ \def\Acfip#1{\AChy@call{#1}\AChy@Acfp}%
\let\acsu\acs
\let\aclu\acl
\let\Aclu\Acl
@@ -1078,13 +1103,20 @@ blocks to be tested separately. The latter are commonly indicated as
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\@firstupper}
+% \begin{macro}{\@firstupper,\@firstupper@maybe}
% Internal commands for making a first letter upper case.
% \begin{macrocode}
\newcommand{\@firstupper}[1]{%
\StrSplit{#1}{1}{\head}{\tail}%
\MakeUppercase\head\tail%
}
+\newcommand{\@firstupper@maybe}{%
+ \ifAC@upper
+ \expandafter\@firstupper
+ \else
+ \expandafter\@firstofone
+ \fi
+}
% \end{macrocode}
% \end{macro}
%
@@ -1153,7 +1185,7 @@ blocks to be tested separately. The latter are commonly indicated as
%
%
% \begin{environment}{AC@deflist}
-% In standard mode, the acronym - list is formatted with a description
+% In standard mode, the acronym list is formatted with a description
% environment. If an optional argument is passed to the acronym
% environment, the list is formatted as a AC@deflist, which needs the
% longest appearing acronym as parameter. If the option 'nolist' is selected
@@ -1198,7 +1230,7 @@ blocks to be tested separately. The latter are commonly indicated as
%
% \begin{macro}{\acro}
% Acronyms can be defined with the user command \cmd{\acro}
-% in side the |acronym| environment.
+% inside the |acronym| environment.
%
% \begin{macrocode}
\newenvironment{acronym}[1][1]{%
@@ -1390,7 +1422,7 @@ blocks to be tested separately. The latter are commonly indicated as
\@bsphack
\protected@write\@auxout{}{\string\newacroplural{#1}{#2}}%
\@esphack
-}
+}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1419,11 +1451,11 @@ blocks to be tested separately. The latter are commonly indicated as
{\string\newacroplural{#1}[\string\AC@hyperlink{#1}{\AC@acs{#1}}]{#2}}%
\@esphack
}
-% \end{macrocode}
+% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
-%
+%
%
% \begin{macro}{\AC@aclp}
% \begin{macro}{\AC@Aclp}
@@ -1433,7 +1465,7 @@ blocks to be tested separately. The latter are commonly indicated as
% \begin{macrocode}
\newcommand*\AC@aclp[1]{%
\ifcsname fn@#1@PL\endcsname
- \csname fn@#1@PL\endcsname
+ \@firstupper@maybe{\csname fn@#1@PL\endcsname}%
\else
\AC@acl{#1}s%
\fi
@@ -1492,11 +1524,7 @@ blocks to be tested separately. The latter are commonly indicated as
\PackageWarning{acronym}{Acronym `#3' is not defined}%
\textbf{#3!}%
\else
- \ifAC@upper
- \@firstupper{\expandafter#2#1}%
- \else
- \expandafter#2#1%
- \fi
+ \@firstupper@maybe{\expandafter#2#1}%
\fi
}
% \end{macrocode}
@@ -1542,7 +1570,7 @@ blocks to be tested separately. The latter are commonly indicated as
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\@acs}[1]{%
- \acsfont{\AC@acs{#1}}%
+ \acsfont{\AC@placelabel@part{#1}\AC@acs{#1}}%
%% having a footnote on acs sort of defeats the purpose
%% \ifAC@footnote
%% \footnote{\AC@acl{#1}{}}%
@@ -1569,12 +1597,12 @@ blocks to be tested separately. The latter are commonly indicated as
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\@acl}[1]{%
- \AC@acl{#1}%
+ \AC@placelabel@part{#1}\AC@acl{#1}%
\ifAC@starred\else\AC@logged{#1}\fi}
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\@Acl}[1]{%
- \AC@Acl{#1}%
+ \AC@placelabel@part{#1}\AC@Acl{#1}%
\ifAC@starred\else\AC@logged{#1}\fi}
% \end{macrocode}
% \end{macro}
@@ -1657,6 +1685,12 @@ blocks to be tested separately. The latter are commonly indicated as
\let\AC@undonewlabel\@gobble
\fi
}%
+\newcommand*\AC@placelabel@part[1]{%
+ \expandafter\ifx\csname AC@\AC@prefix#1\endcsname\AC@used
+ \else
+ {\AC@phantomsection\@verridelabel{acro:#1}}%
+ \fi
+}%
\newcommand*\AC@placelabel[1]{%
\expandafter\ifx\csname AC@\AC@prefix#1\endcsname\AC@used
\else
@@ -1802,12 +1836,12 @@ blocks to be tested separately. The latter are commonly indicated as
\newcommand*{\@iaci}[1]{%
\ifcsname fn@#1@IL\endcsname
\ifAC@dua
- \csname fn@#1@IL\endcsname%
+ \@firstupper@maybe{\csname fn@#1@IL\endcsname}%
\else
\expandafter\ifx\csname AC@\AC@prefix#1\endcsname\AC@used%
\csname fn@#1@IS\endcsname%
\else
- \csname fn@#1@IL\endcsname%
+ \@firstupper@maybe{\csname fn@#1@IL\endcsname}%
\fi
\fi
\else
@@ -1846,7 +1880,7 @@ blocks to be tested separately. The latter are commonly indicated as
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\@acsp}[1]{%
- \acsfont{\AC@acsp{#1}}%
+ \acsfont{\AC@placelabel@part{#1}\AC@acsp{#1}}%
\ifAC@starred\else\AC@logged{#1}\fi}
% \end{macrocode}
% \end{macro}
@@ -1869,12 +1903,12 @@ blocks to be tested separately. The latter are commonly indicated as
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\@aclp}[1]{%
- \AC@aclp{#1}%
+ \AC@placelabel@part{#1}\AC@aclp{#1}%
\ifAC@starred\else\AC@logged{#1}\fi}
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\@Aclp}[1]{%
- \AC@Aclp{#1}%
+ \AC@placelabel@part{#1}\AC@Aclp{#1}%
\ifAC@starred\else\AC@logged{#1}\fi}
% \end{macrocode}
% \end{macro}
@@ -2038,6 +2072,53 @@ blocks to be tested separately. The latter are commonly indicated as
% \end{macro}
% \end{macro}
%
+%
+% \begin{macro}{\acfip}
+% \begin{macro}{\acfipa}
+% \begin{macro}{\Acfip}
+% \begin{macro}{\Acfipa}
+% The plural of the full name is printed in italics and the plural of
+% the acronym is printed in upshape.
+% The optional variable determines the penalty for a line break.
+% \begin{macrocode}
+\newcommand*{\acfip}{\AC@starredfalse\protect\acfipa}%
+\WithSuffix\newcommand\acfip*{\AC@starredtrue\protect\acfipa}%
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*{\Acfip}{\AC@starredfalse\protect\Acfipa}%
+\WithSuffix\newcommand\Acfip*{\AC@starredtrue\protect\Acfipa}%
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand{\acfipa}[2][\AC@linebreakpenalty]{%
+ \texorpdfstring{\protect\@acfip[#1]{#2}}{{\AC@aclp{#2}} (#2)}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand{\Acfipa}[2][\AC@linebreakpenalty]{%
+ \texorpdfstring{\protect\@Acfip[#1]{#2}}{{\AC@Aclp{#2}} (#2)}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*{\@acfip}[2][\AC@linebreakpenalty]{%
+ \acffont{%
+ \AC@placelabel{#2}{\itshape\AC@aclp{#2}}%
+ \nolinebreak[#1] %
+ \acfsfont{(\acsfont{\AC@acsp{#2}})}%
+ }%
+ \ifAC@starred\else\AC@logged{#2}\fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*{\@Acfip}[2][\AC@linebreakpenalty]{%
+ \acffont{%
+ \AC@placelabel{#2}{\itshape\AC@Aclp{#2}}%
+ \nolinebreak[#1] %
+ \acfsfont{(\acsfont{\AC@acsp{#2}})}%
+ }%
+ \ifAC@starred\else\AC@logged{#2}\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\acused}
% Marks the acronym as used. Don't confuse this with
% \cmd{\acronymused}!
diff --git a/Master/texmf-dist/source/latex/acronym/acronym.ins b/Master/texmf-dist/source/latex/acronym/acronym.ins
index 9dc36c5ac1c..960366ec2f4 100644
--- a/Master/texmf-dist/source/latex/acronym/acronym.ins
+++ b/Master/texmf-dist/source/latex/acronym/acronym.ins
@@ -4,7 +4,7 @@
%% driver files from the doc files in this package when run through
%% LaTeX or TeX.
%%
-%% Copyright 1995--2020 by Tobias Oetiker (tobi@oetiker.ch)
+%% Copyright 1995--2021 by Tobias Oetiker (tobi@oetiker.ch)
%% and individual authors listed elsewhere
%% in this file.
%% All rights reserved.
@@ -31,7 +31,7 @@
\keepsilent
\preamble
- Copyright 1995--2020 by Tobias Oetiker (tobi@oetiker.ch)
+ Copyright 1995--2021 by Tobias Oetiker (tobi@oetiker.ch)
and individual authors listed elsewhere.
All rights reserved.
diff --git a/Master/texmf-dist/source/latex/animate/animate.tex b/Master/texmf-dist/source/latex/animate/animate.tex
index cc952856e73..9cc30bf2eb3 100644
--- a/Master/texmf-dist/source/latex/animate/animate.tex
+++ b/Master/texmf-dist/source/latex/animate/animate.tex
@@ -62,7 +62,7 @@
{\itshape\normalsize}}
\makeatother
-\def\keywords{include portable PDF animation SVG animation animated PDF animated SVG dvisvgm html TeX4ht web animating embed animated graphics LaTeX pdfLaTeX LuaLaTeX PSTricks pgf TikZ LaTeX-picture MetaPost inline graphics vector graphics animated GIF LaTeX dvips ps2pdf dvipdfmx XeLaTeX JavaScript Acrobat Reader KDE Okular PDF-XChange Foxit Reader Firefox Chrome Chromium}
+\def\keywords{include portable PDF animation SVG animation animated PDF animated SVG dvisvgm html TeX4ht Web animating embed animated graphics LaTeX pdfLaTeX LuaLaTeX PSTricks pgf TikZ LaTeX-picture MetaPost inline graphics vector graphics animated GIF LaTeX dvips ps2pdf dvipdfmx XeLaTeX JavaScript Acrobat Reader KDE Okular PDF-XChange Foxit Reader PDF.js Firefox Chrome Chromium}
\hypersetup{
pdftitle={The animate Package},
pdfsubject={Documentation},
@@ -94,7 +94,7 @@
\def\@anim@sanitizeColon{}\def\@anim@sanitizeJS{}\def\@anim@endsanitize{}
\expandafter\parsedate\animVersion\relax %set current date to package date
\makeatother
-\author{Alexander Grahn \animategraphics[autoplay,loop,height=1.8ex,nomouse]{8}{bye_}{0}{3}\protect\footnote{Animated GIF taken from \href{http://www.phpBB.com}{phpBB} forum software and burst into a set of EPS files using \href{http://www.imagemagick.org}{ImageMagick} before embedding.}%
+\author{Alexander Grahn \animategraphics[autoplay,loop,height=1.8ex,nomouse]{8}{bye_}{0}{3}\protect\footnote{Animated GIF taken from \href{http://www.phpBB.com}{phpBB} forum software and burst into a set of EPS files using \href{http://www.imagemagick.org}{ImageMagick} before embedding.}% \protect\footnote{Animation examples in this document have all been built with the `\texttt{method=widget}' option to make them work in PDF.js, Mozilla's PDF viewer built into the Firefox Web browser.}%
%\space\protect\footnote{Animations may run slowly if viewed in the Acrobat Reader browser plugin.}%
\\[1ex]\url{https://gitlab.com/agrahn/animate}}
\maketitle
@@ -111,12 +111,32 @@
\tableofcontents
%\newpage
-\section{Introduction}
+\section{Introduction}\label{sect:intro}
This package provides an interface for creating PDF and SVG files with animated content from sets of graphics or image files, from inline graphics, such as \LaTeX-picture, PSTricks or pgf/TikZ generated pictures, or just from typeset text. Unlike standard movie/video formats, package `animate' allows for animating vector graphics. The result is roughly similar to the SWF (Flash) format, although not as space-efficient.
Package `animate' supports the usual workflows for making PDF, i.\,e. pdf\LaTeX{}, Lua\-\LaTeX{}, \LaTeX{} $\rightarrow$ \verb+dvips+ $\rightarrow$ \verb+ps2pdf+/Distiller and \pXepLaTeX{} $\rightarrow$ \verb+(x)dvipdfmx+. For animated SVG, it supports the \verb+dvisvgm+ driver. The DVI/XDV used as input for \verb+dvisvgm+ can be generated with \LaTeX{}, Lua\LaTeX{} (in DVI mode with command `\verb+dvilualatex+') and \XeLaTeX{} (with option `\verb+--no-pdf+').
-PDF files with animations can be viewed in Acrobat Reader (except on mobile devices), KDE Okular, PDF-XChange and Foxit Reader.
+PDF files with animations can be viewed in Acrobat Reader (except on mobile devices), KDE Okular, PDF-XChange, Foxit Reader, PDF.js (Firefox' built-in PDF viewer and extension for Chromium-based Web browsers). To view a local PDF file in the Web browser, open it by right-click in a file explorer or by starting the Web browser on the command-line, passing the PDF file name as its argument. The full-screen mode, also known as Presentation Mode in PDF.js, can be reached via the \raisebox{0.5\depth}{{\fboxsep=3pt\colorbox{lightgray}{\texttt{\large>>}}}} button at the right end of the toolbar. The PDF.js extension for Chromium/Chrome/Edge can be installed from
+
+\makebox[\linewidth][l]{\href{https://chromewebstore.google.com/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm}{\nolinkurl{https://chromewebstore.google.com/detail/pdf-viewer/}}}\\
+\makebox[\linewidth][r]{\href{https://chromewebstore.google.com/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm}{\nolinkurl{oemmndcbldboiebfnladdacbdfmadadm}}}
+
+For animations to play in the Chromium extension, JavaScript needs to be enabled in the settings:
+
+\makebox[\linewidth][l]{\url{chrome://extensions/?id=oemmndcbldboiebfnladdacbdfmadadm} $\rightarrow$}\\
+\makebox[\linewidth][r]{Extension options $\rightarrow$ Enable active content (JavaScript) in PDFs}
+
+Viewing of local files also needs to be enabled in Chromium-based browsers:
+
+\makebox[\linewidth][l]{\url{chrome://extensions/?id=oemmndcbldboiebfnladdacbdfmadadm} $\rightarrow$}\\
+\makebox[\linewidth][r]{Allow access to file URLs}
+
+%Note that option `\texttt{method=widget}' must be set to produce animations that are compatible with PDF.js.
+%PDF files with animations can be viewed in Acrobat Reader (except on mobile devices), KDE Okular, PDF-XChange, Foxit Reader, PDF.js (as Firefox built-in PDF viewer, or in other Web browsers via URL). The most recent release of PDF.js can be accessed online in a Web browser (Firefox, Chromium, Chrome, Edge, ...) via the following URL:
+%
+%\url{https://mozilla.github.io/pdf.js/web/viewer.html?file=}
+%
+%Then, to open a local PDF file in PDF.js, click \raisebox{0.5\depth}{{\fboxsep=3pt\colorbox{lightgray}{\texttt{\large>>}}}} at the right end of its tool bar. In the `Tools' menu, click on `Open'. Note that option `\texttt{method=widget}' must be set to produce animations that are compatible with PDF.js.
Animated SVG produced by means of \LaTeX{} and \verb+dvisvgm+ are self-sufficient files that can be embedded into HTML using the \verb+<object>+ tag or opened directly in a Web browser, such as Chromium or Firefox. Also, presentations, such as `beamer'-class documents, with embedded animations can be exported to SVG instead of PDF and viewed in a Web browser. SVG-capable Web browsers are standard on many platforms and operating systems and thus make SVG a very portable file format. A \LaTeX{} package for embedding video and audio into SVG is also available\cite{media4svg}.
@@ -131,16 +151,15 @@ The user interacts with the animation through optional animation controls or usi
\item pdf\TeX{}, version $\ge1.40$, or Lua\TeX{}, version $\ge0.95$, for direct PDF output
\item Ghostscript, version $\ge9.15$, or Adobe Distiller for PS to PDF conversion
\item \verb+dvipdfmx+ for DVI to PDF conversion
-\item dvipdfmx, version $\ge 20190503$, for DVI to PDF conversion
-\item \verb+dvisvgm+ for DVI to SVG conversion (also requires Ghostscript)
-\item PDF: Acrobat Reader, KDE Okular, PDF-XChange, Foxit Reader
+\item \verb+dvisvgm+ for DVI to SVG conversion (also requires Ghostscript and MuPDF)
+\item PDF: Acrobat Reader, KDE Okular, PDF-XChange, Foxit Reader, Firefox, version $\ge130$, PDF.js, version $\ge4.4.168$
\item SVG: Chromium-based browsers for best performance
\end{trivlist}
\section{Installation}
Unzip the file \href{http://mirrors.ctan.org/install/macros/latex/contrib/animate.tds.zip}{`animate.tds.zip'} into the local TDS root directory which can be found by running `\verb+kpsewhich -var-value TEXMFLOCAL+' on the command line.
-After installation, update the filename database by running `\verb+texhash+' on the command line.
+After installation, update the file name database by running `\verb+texhash+' on the command line.
\TeX-Live and MiK\TeX{} users should run the package manager of their system for installation.
@@ -388,11 +407,11 @@ With `\verb+draft+' the animation is not embedded. Instead, a box with the exact
\begin{verbatim}
nomouse
\end{verbatim}
-Animation widget will not respond to mouse clicks. Unless the JavaScript interface, Sect.~\ref{sect:api}, p.~\pageref{sect:api}, is used to control the animation, it is recommended to also set at least one of the `\verb+autoplay+' or `\verb+controls+' options.
+Animation widget will not respond to mouse clicks. Unless the JavaScript interface, Section~\ref{sect:api}, p.~\pageref{sect:api}, is used to control the animation, it is recommended to also set at least one of the `\verb+autoplay+' or `\verb+controls+' options.
\begin{verbatim}
method=icon | widget | ocg
-\end{verbatim}
-The package implements three different animation methods. The `\verb+icon+' method is the default method and usually gives the best performance in terms of animation frame rate. `\verb+widget+' and `\verb+ocg+' are alternative animation methods. In rare cases (standalone animations without animation controls) method `\verb+ocg+' may lead to a better animation performance than the other two. Moreover, it allows overlaying animations with other typeset material, that is, playing animations in the page background.
+\end{verbatim}\hypertarget{method}{}%
+The package implements three different animation methods. The `\verb+icon+' method usually gives the best performance in terms of animation frame rate in Acrobat Reader. However, the `\verb+widget+' method is now set by default because it extends the range of supporting viewers. Beginning with version 130, Firefox renders functional animations too. The PDF viewer bundled with Firefox, PDF.js, is also available as an extension for Chrome and releated browsers, see Section~\ref{sect:intro}. In rare cases, such as standalone animations without animation controls, the alternative `\verb+ocg+' method may lead to a better animation performance than the other two. Also, `\verb+ocg+' allows an animation to be overlaid with other typeset material, that is, it can play in the page background. However, support is limited to Acrobat Reader and Okular.
\begin{verbatim}
measure
\end{verbatim}
@@ -468,7 +487,7 @@ frame No. & timeline file & transparency stack\\\hline\hline
\end{tabular}
\end{table}
-Figures~\ref{fig:taylor} and \ref{fig:lorenz} in Sect.~\ref{sect:examples} are animation examples with a single transparency stack.
+Figures~\ref{fig:taylor} and \ref{fig:lorenz} in Section~\ref{sect:examples} are animation examples with a single transparency stack.
\myparagraph*{Grouping objects into layers (= sub-stacks) using `{\tt;}'}
Due to the stack-like nature of the animation, the position of a transparency specification in the timeline file determines its \emph{depth} level in relation to other transparencies. The timeline file is processed line by line and from left to right. In a single-stack animation, the stack is strictly built from the bottom up, such that earlier transparencies are overprinted by more recent ones. This may turn out to be inconvenient in certain situations. For example, it might be desirable to change the background image in the middle of an animation without affecting objects that are located in the foreground. For this purpose, transparency specifications can be grouped into layers (sub-stacks) using the semicolon (\verb+;+) as a separator. New transparencies can now be put on top of the individual sub-stacks. After a line of the timeline file has been processed, the global stack is built by placing the sub-stacks on top of the other. Again, the left-to-right rule applies when determining the height of the sub-stacks in relation to each other within the global stack.
@@ -505,7 +524,7 @@ frame No. & timeline file & transparency stack\\\hline\hline
%
%Note that \emph{without} setting up two layers, that is, by replacing the semicolons with commas, the foreground objects (transparencies 2 through 99) which have been added during the first 49 frames would be overprinted by the new background image, transparency 1, from frame 50 onward.
-See the second animation, Fig.~\ref{fig:scarab}, in Sect.~\ref{sect:examples} for a working example that makes use of the timeline and the layer concept.
+See the second animation, Fig.~\ref{fig:scarab}, in Section~\ref{sect:examples} for a working example that makes use of the timeline and the layer concept.
\myparagraph*{Associate JavaScript actions with animation frames}\label{sect:jsfield}
The optional fourth field \verb+<JavaScript>+ in a frame specification takes JavaScript code to be executed upon display of that frame. This could be used, for instance, to play a sound that was embedded using the `media9' \LaTeX{} package \cite{media9} or to execute JavaScript methods of the animation object. A non-trivial example is looping over a sub-range of frames which can be programmed by setting the `\verb+frameNum+' property of the animation object. See Section~\ref{sect:api} for details of the animation programming interface.
@@ -601,7 +620,7 @@ Also, the programming interface can be used to create custom buttons for playbac
]{\fbox{Goto 6th frame}}
\end{lstlisting}
-\clearpage
+%\clearpage
\section{Examples}
\subsection{Animations from sets of files, using {\tt\textbackslash animategraphics}}\label{sect:examples}
Animations in this section are made from graphics files that were prepared with \MP. Run `\verb+mpost --tex=latex+' on the files ending in `.mp' in the `files' directory to generate the graphics files. Both examples make use of the `\verb+timeline+' option to reduce the resulting PDF file size.
@@ -1375,7 +1394,7 @@ The following code may serve as a template for generating standalone animated SV
%
\end{document}
\end{lstlisting}
-Note that when animating external graphics with \verb+\animategraphics+, only PDF and PostScript (EPS, PS, MPS) files are converted to inline SVG code; files in other formats (SVG, PNG, JPEG) remain external and must be bundled with the final SVG output. Thus, for obtaining self-contained SVG, it is recommended to convert PNG, JPEG and SVG files to PDF or PostScript first. Also note that PostScript files must have all required fonts embedded. This is not always the case for \MP-generated PostScript. Here, embedding of fonts is ensured by putting `\verb+prologues := 3;+' into the header of the \MP{} input.
+Note that when animating external graphics with \verb+\animategraphics+, only PDF and PostScript (EPS, PS, MPS) files are converted to inline SVG code; files in other formats (SVG, PNG, JPEG) remain external and must be bundled with the final SVG output. Thus, for obtaining self-contained SVG, it is recommended to convert PNG, JPEG and SVG files to PostScript or PDF first. Also note that PostScript files must have all required fonts embedded. This is not always the case for \MP-generated PostScript. Here, embedding of fonts is ensured by putting `\verb+prologues := 3;+' into the header of the \MP{} input. If PDF is chosen as file format for input graphics, the conversion utility `\verb+mutool+' must be present on the system. It is installed as part of the MuPDF (\url{https://mupdf.com}) package.
Use one of
\begin{verbatim}
@@ -1469,7 +1488,7 @@ In \TeX4ht documents, the whole \verb+<object>...</object>+ tag can be inserted
\item PDFs with animations cannot be embedded (via {\tt\string\includegraphics},\\ {\tt\string\includepdf}) into other documents as the animation capability gets lost.
- \item Animations should not be placed on \emph{multilayered} slides, also known as overlays, created with presentation making classes such as Beamer or Powerdot. Those document classes turn overlays into separate PDF pages and re-insert the animation on every page thus produced. The animations are independent from each other and do not share the current playing state, such as frame number, playing speed and direction. Therefore, put animations on flat slides only; slides without animations may still have overlays, of course. On \href{https://tex.stackexchange.com/a/385209}{\TeX.SE}~\cite{texsx}, a method is suggested for placing an animation on a slide with overlays. It makes use of the programming interface introduced in Sect.~\ref{sect:api}, p.~\pageref{sect:api}.
+ \item Animations should not be placed on \emph{multilayered} slides, also known as overlays, created with presentation making classes such as Beamer or Powerdot. Those document classes turn overlays into separate PDF pages and re-insert the animation on every page thus produced. The animations are independent from each other and do not share the current playing state, such as frame number, playing speed and direction. Therefore, put animations on flat slides only; slides without animations may still have overlays, of course. On \href{https://tex.stackexchange.com/a/385209}{\TeX.SE}~\cite{texsx}, a method is suggested for placing an animation on a slide with overlays. It makes use of the programming interface introduced in Section~\ref{sect:api}, p.~\pageref{sect:api}.
\end{itemize}
\section{Acknowledgements}
@@ -1477,14 +1496,14 @@ I would like to thank François Lafont who discovered quite a few bugs and made
%\enlargethispage{4ex}
\begin{thebibliography}{8}
-\bibitem{chupin} Chupin, M.: \emph{Syracuse MetaPost/Animations.} URL: \href{http://melusine.eu.org/syracuse/metapost/animations/chupin/?idsec=scara}{\texttt{http://melusine.eu.org/}} \href{http://melusine.eu.org/syracuse/metapost/animations/chupin/?idsec=scara}{\texttt{syracuse/metapost/animations/chupin/?idsec=scara}}
+\bibitem{chupin} Chupin, M.: \emph{Syracuse MetaPost/Animations.} URL: \href{http://melusine.eu.org/syracuse/metapost/animations/chupin/?idsec=scara}{\nolinkurl{http://melusine.eu.org/}} \href{http://melusine.eu.org/syracuse/metapost/animations/chupin/?idsec=scara}{\nolinkurl{syracuse/metapost/animations/chupin/?idsec=scara}}
\bibitem{dvisvgm} \emph{dvisvgm: A fast DVI to SVG converter} URL: \url{http://dvisvgm.de}
\bibitem{gilg05} Gilg, J.: PDF-Animationen. In: \emph{Die \TeX nische Kom\"odie}, Issue 4, 2005, pp.~30--37
\bibitem{hol} Holeček, J.; Sojka, P.: Animations in pdf\TeX-generated PDF. In: \emph{\TeX, XML, and Digital Typography}, Springer, 2004, pp.~179--191. doi:10.1007/978-3-540-27773-6\textunderscore14
\bibitem{luque12} Luque, M.: \emph{PSTricks : applications.} URL: \url{http://pstricks.blogspot.com}
\bibitem{media4svg} \emph{The media4svg Package}. URL: \url{http://www.ctan.org/pkg/media4svg}
\bibitem{media9} \emph{The media9 Package}. URL: \url{http://www.ctan.org/pkg/media9}
-\bibitem{texsx} \emph{Beamer: animate package and overlay}. URL: \href{https://tex.stackexchange.com/a/385209}{\texttt{https://tex.stackexchange.com}}\\ \href{https://tex.stackexchange.com/a/385209}{\texttt{/a/385209}}
+\bibitem{texsx} \emph{Beamer: animate package and overlay}. URL: \href{https://tex.stackexchange.com/a/385209}{\nolinkurl{https://tex.stackexchange.com}}\\ \href{https://tex.stackexchange.com/a/385209}{\nolinkurl{/a/385209}}
\end{thebibliography}
\end{document}
diff --git a/Master/texmf-dist/source/latex/animate/files/pstmetronome.tex b/Master/texmf-dist/source/latex/animate/files/pstmetronome.tex
deleted file mode 100644
index e13bd4a0da3..00000000000
--- a/Master/texmf-dist/source/latex/animate/files/pstmetronome.tex
+++ /dev/null
@@ -1,233 +0,0 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% animated metronome
-% this code is based to 99.9 percent on the work by Manuel Luque
-% (pstricks.blogspot.com)
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\makeatletter
-\pst@addfams{pst-metronome}
-\define@key[psset]{pst-metronome}{theta0}{\def\psk@oscmetronomethetai{#1 }}
-\psset[pst-metronome]{theta0=45} % position initiale du metronome
-\define@key[psset]{pst-metronome}{M}{\def\psk@oscmetronometM{#1 }}
-\psset[pst-metronome]{M=25} % masse du disque en g
-\define@key[psset]{pst-metronome}{m}{\def\psk@oscmetronometm{#1 }}
-\psset[pst-metronome]{m=6} % masse du curseur en g
-\define@key[psset]{pst-metronome}{r}{\def\psk@oscmetronomer{#1 }}
-\psset[pst-metronome]{r=1} % rayon du disque en cm
-\define@key[psset]{pst-metronome}{x}{\def\psk@oscmetronomex{#1 }}
-\psset[pst-metronome]{x=8.4} % position du curseur en cm par rapport à l'axe
-\define@key[psset]{pst-metronome}{d}{\def\psk@oscmetronomed{#1 }}
-\psset[pst-metronome]{d=3.2} % distance de l'axe au centre du disque en cm
-\define@key[psset]{pst-metronome}{dt}{\def\psk@oscmetronomedt{#1 }}
-\psset[pst-metronome]{dt=0.01} % pas pour RK4
-\define@key[psset]{pst-metronome}{nT}{\def\psk@oscmetronomenT{#1 }}
-\psset[pst-metronome]{nT=1} % nombre de périodes représentées
-%---- calculer theta(t) et thetapoint(t) --------
-\def\psmetronome{\pst@object{psmetronome}}
-\def\psmetronome@i{%
-\begingroup%
-\use@par%
- \begin@SpecialObj%
- \pstVerb{%
- /deg2rad {180 div 3.14159 mul} def
- /rad2deg {180 mul 3.14159 div} def
- /gp 9.8 def % pesanteur
- /radius \psk@oscmetronomer 1e-2 mul def % en m
- /OA \psk@oscmetronomed 1e-2 mul def % distance de l'axe au centre du disque en m
- /xC \psk@oscmetronomex 1e-2 mul def % position du curseur en m par rapport à l'axe
- /theta0 \psk@oscmetronomethetai def % en degrés
- /theta0rad theta0 deg2rad def % en radians
- /Md \psk@oscmetronometM 1e-3 mul def % en kg
- /mc \psk@oscmetronometm 1e-3 mul def % en kg
- /dt \psk@oscmetronomedt def
- /nT \psk@oscmetronomenT def
- % moment d'inertie du métronome
- % J=1/2M*R^2+M*a^2+m*x^2
- /Ji {0.5 Md mul radius dup mul mul Md OA dup mul mul add mc xC dup mul mul add} def
- /AT {4
- Ji
- gp Md OA mul mc xC mul sub mul
- div
- sqrt
- mul} def
- % Pour le calcul de la période
- % coefficients de l'approximation polynômiale du calcul
- % de l'intégrale elliptique
-% coefficient pour le calcul de l'intégrale elliptique
- /m0 theta0 2 div sin def
- /m1 {1 m0 dup mul sub} def
- /m2 {m1 dup mul} def
- /m3 {m2 m1 mul} def
- /m4 {m2 dup mul} def
- /m_1 {1 m1 div} def
- /EllipticK {
- 0.5
- 0.12498593597 m1 mul add
- 0.06880248576 m2 mul add
- 0.03328355376 m3 mul add
- 0.00441787012 m4 mul add
- m_1 ln mul
- 1.38629436112 add
- 0.09666344259 m1 mul add
- 0.03590092383 m2 mul add
- 0.03742563713 m3 mul add
- 0.01451196212 m4 mul add
- } def
-/Tm {AT EllipticK mul} def
-% tableau des valeurs de theta(t)
- /W 0 def % vitesse angulaire
- /theta theta0 def
- /oscillateur {sin gp Md OA mul mc xC mul sub mul neg mul Ji div} def
- /j1 {W dt mul} def
- /k1 {theta oscillateur dt mul} def
- /j2 {W k1 2 div add dt mul} def
- /k2 {theta j1 2 div rad2deg add oscillateur dt mul} def
- /j3 {W k2 2 div add dt mul} def
- /k3 {theta j2 2 div rad2deg add oscillateur dt mul} def
- /j4 {W k3 add dt mul} def
- /k4 {theta j3 rad2deg add oscillateur dt mul} def
- /theta2 {theta j1 rad2deg 2 j2 rad2deg j3 rad2deg add mul add j4 rad2deg add 6 div add} def
-/tabTheta [ % pour l'animation
- 0 theta0 % date angle
-dt dt Tm nT mul{ %
- theta2 %
- /W2 W k1 2 k2 k3 add mul add k4 add 6 div add def
- /theta theta2 def
- /W W2 def
- } for
- ] def
-/Nvaleurs tabTheta length 2 div cvi def
- /W 0 def % vitesse angulaire
- /theta theta0 def
-/tabThetaGraph [ % pour le graphique theta(t)
- 0 theta0 % date angle
-0 dt Tm nT mul { % pop
- theta2 % 180 div 3.14159 mul
- /W2 W k1 2 k2 k3 add mul add k4 add 6 div add def
- /theta theta2 def
- /W W2 def
- } for
- ] def
- /W 0 def % vitesse angulaire
- /theta theta0 def
-/tabThetaPoint [ % pour le graphique thetapoint(t)
- 0 0 % date angle
-dt dt Tm nT mul { % pop
-% theta2 % 180 div 3.14159 mul
- /W2 W k1 2 k2 k3 add mul add k4 add 6 div add def
- W2
- /theta theta2 def
- /W W2 def
- } for
- ] def
-/tabXOSC [ % oscillations par min en fonction de x
-0.5 0.1 12 {/xc exch def
- /xC xc 1e-2 mul def
- xc 60 Tm div % cvi
- } for
- ] def
-/tabXbattements [ % battements par min en fonction de x
-3 0.1 12 {/xc exch def
- /xC xc 1e-2 mul def
- xc 60 Tm div 2 mul % cvi
- } for
- ] def
-% graduation T --> x
-/tabXT [ % [T,x]
- 40 1 220 {/batt exch def % battements
- /Tmetronome2 120 batt div dup mul def
- /A1 16 mc mul EllipticK dup mul mul def
- /B1 gp Tmetronome2 mul mc mul def
- /C1 gp Md mul OA mul Tmetronome2 mul neg
- 8 Md mul radius dup mul mul 16 Md mul OA dup mul mul add EllipticK dup mul mul add def
- /Delta B1 dup mul 4 A1 mul C1 mul sub sqrt def
- /xC1 B1 neg Delta sub 2 div A1 div def
- /xC2 B1 neg Delta add 2 div A1 div def
- xC2 0 ge {/posC xC2 def}{/posC xC1 def} ifelse
- batt posC 1e2 mul
- } for
- ] def
-/xT { % pour une valeur particulière battement -> position du curseur
- /batt exch def
- /Tmetronome2 120 batt div dup mul def
- /A1 16 mc mul EllipticK dup mul mul def
- /B1 gp Tmetronome2 mul mc mul def
- /C1 gp Md mul OA mul Tmetronome2 mul neg
- 8 Md mul radius dup mul mul 16 Md mul OA dup mul mul add EllipticK dup mul mul add def
- /Delta B1 dup mul 4 A1 mul C1 mul sub sqrt def
- /xC1 B1 neg Delta sub 2 div A1 div def
- /xC2 B1 neg Delta add 2 div A1 div def
- xC2 0 ge {/posC xC2 def}{/posC xC1 def} ifelse
- posC 1e2 mul
- } def
-/xC \psk@oscmetronomex 1e-2 mul def % position du curseur en m par rapport à l'axe
-/Tm {AT EllipticK mul} def
- }%
- \end@SpecialObj%
-\endgroup}
-%
-\def\psmetronomeA{\pst@object{psmetronomeA}}
-\def\psmetronomeA@i{%
-\begingroup%
-\use@par%
- \begin@SpecialObj%
- \pstVerb{%
- /radius \psk@oscmetronomer 1e-2 mul def % en m
- /OA \psk@oscmetronomed 1e-2 mul def % distance de l'axe au centre du disque en m
- /xC \psk@oscmetronomex 1e-2 mul def % position du curseur en m par rapport à l'axe
- }%
-\psframe[fillstyle=solid](! -0.075 \psk@oscmetronomed neg)(0.075,13)
-\pscircle[fillstyle=solid,fillcolor={[rgb]{0.75 0.75 0.75}}](! 0 \psk@oscmetronomed neg){!radius 1e2 mul}
-\pscircle[fillstyle=solid,linewidth=0.05](0,0){0.15}
-\pscircle*[linecolor=red](0,0){0.05}
-% curseur
-\pspolygon[fillstyle=solid](! -0.25 \psk@oscmetronomex 0.5 sub)(! -0.5 \psk@oscmetronomex 0.5 add)(!-0.075 \psk@oscmetronomex 0.5 add)(!-0.075 \psk@oscmetronomex 0.5 sub)
-\pspolygon[fillstyle=solid](! 0.25 \psk@oscmetronomex 0.5 sub)(! 0.5 \psk@oscmetronomex 0.5 add)(!0.075 \psk@oscmetronomex 0.5 add)(!0.075 \psk@oscmetronomex 0.5 sub)
-\pspolygon[fillstyle=solid,fillcolor=gray](! -0.25 \psk@oscmetronomex 0.5 sub)(! -0.3 \psk@oscmetronomex 0.3 sub)(! -0.075 \psk@oscmetronomex 0.3 sub)(!-0.075 \psk@oscmetronomex 0.3 add)(!0.075 \psk@oscmetronomex 0.3 add)(!0.075 \psk@oscmetronomex 0.3 sub)(!0.3 \psk@oscmetronomex 0.3 sub)(!0.25 \psk@oscmetronomex 0.5 sub)
-\pscircle[fillstyle=solid](!-0.125 \psk@oscmetronomex 0.4 sub){0.08}
-\pscircle[fillstyle=solid](!0.125 \psk@oscmetronomex 0.4 sub){0.08}
-% fin curseur
-{\psset{linecolor=red}
-\psline(!-.1 \psk@oscmetronomex)(!0.1 \psk@oscmetronomex)\psline(!0 \psk@oscmetronomex 0.1 sub)(!0 \psk@oscmetronomex 0.1 add)
-\psline(! -.1 \psk@oscmetronomed neg)(!0.1 \psk@oscmetronomed neg)\psline(! 0 \psk@oscmetronomed neg 0.1 sub)(!0 \psk@oscmetronomed neg 0.1 add)}
-\pnode(!0 \psk@oscmetronomex){C}% curseur
-\pnode(! 0 \psk@oscmetronomed neg){D}% disque
-%\pstextpath[c](0,-2ex){\psarcn[linestyle=none](D){1}{180}{0}}{\small\textsf{\textbf{m e t r o n o m e}}}
-%\pstextpath[c](0,1ex){\psarc[linestyle=none](D){1}{180}{0}}{\small\textsf{\textbf{P S t r i c k s}}}
- \end@SpecialObj%
-\endgroup}
-\psmetronome%
-\pstVerb{/tabTempos [40 42 44 46 48 50 52 54 46 58 60 63 66 69 72 76 80 84 88 92 96 100 104 108 112 116 120 126 132 138 144 152 160 168 176 184 192 200 208] def}%
-
-\def\metronomebody{%
- \pspolygon[fillstyle=solid,linewidth=2\pslinewidth,linearc=0.5,fillcolor=yellow!30](-5,-4.5)(5,-4.5)(1,14)(-1,14)
- \psline(1.2,4.5)(1.2,12.5)
- \psline(-1.2,4.5)(-1.2,12.5)
- \multido{\i=0+2}{20}{%
- \pstVerb{/BATT tabTempos \i\space get def}
- \psline[linecolor=red](!1.2 BATT xT)(!0.7 BATT xT)
- \uput[r](!0.7 BATT xT){\psPrintValue[PSfont=Helvetica,fontscale=6]{BATT}}
- }%
- \multido{\i=1+2}{19}{%
- \pstVerb{/BATT tabTempos \i\space get def}
- \psline[linecolor=red](!-1.2 BATT xT)(!-0.7 BATT xT)
- \uput[r](!-1.3 BATT xT){\psPrintValue[PSfont=Helvetica,fontscale=6]{BATT}}}%
- \rput(!0 40 xT){\textsf{\tiny GRAVE}}%
- \rput(!0 46 xT){\textsf{\tiny LARGO}}%
- \rput(!0 52 xT){\textsf{\tiny LENTO}}%
- \rput(!0 58 xT){\textsf{\tiny ADAGIO}}%
- \rput(!0 60 xT){\textsf{\tiny LARGETTO}}%
- \rput(!0 66 xT){\textsf{\tiny ANDANTE}}%
- \rput(!0 76 xT){\textsf{\tiny ANDANTINO}}%
- \rput(!0 84 xT){\textsf{\tiny MODERATO}}%
- \rput(!0 108 xT){\textsf{\tiny ALLEGRETTO}}%
- \rput(!0 132 xT){\textsf{\tiny ALLEGRO}}%
- \rput(!0 160 xT){\textsf{\tiny VIVACE}}%
- \rput(!0 184 xT){\textsf{\tiny PRESTO}}%
- \rput(!0 200 xT){\textsf{\tiny PRESTISSIMO}}%
-}
-
-\def\pendulum#1{%
- \pstVerb{/iA #1\space def /date tabTheta iA get def /Theta tabTheta iA 1 add get def}%
- \rput{!Theta}{\psmetronomeA}%
-}
-\makeatother
diff --git a/Master/texmf-dist/source/latex/babel/babel.dtx b/Master/texmf-dist/source/latex/babel/babel.dtx
index 6b6da6ed7cf..9c41d0ed27f 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/09/18 v24.10 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,10 @@
\def\args#1{%
\def\bbl@tempa{#1}%
\ifx\bbl@tempa\@empty\else#1\vskip1ex\fi\ignorespaces}
-\begingroup % Changes to ltxdoc
+% Changes to doc.sty (add <<...>> syntax)
+\def\Module#1{%
+ \mod@math@codes$\langle${\color{thered}$\mathsf{#1}$}$\rangle$}
+\begingroup
\catcode`\<\active
\catcode`\>\active
\gdef\check@plus@etc{%
@@ -174,8 +185,8 @@
\fi\fi\fi
\bbl@next}
\gdef\var@module#1#2#3>>{%
- $\langle$\pm@module#2#3>$\rangle$%
- \ifx*#2\ $\equiv$\fi}
+ $\langle$\pm@module#2#3>$\rangle$%
+ \ifx*#2\ $\equiv$\fi}
\endgroup
\renewcommand*\l@section[2]{%
\ifnum \c@tocdepth >\z@
@@ -199,9 +210,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}
@@ -275,6 +284,19 @@ guide focuses on internationalization and localization with \LaTeX{}
and \pdftex, \xetex{} and \luatex{} with the \babel{} package. There
are also some notes on its use with e-Plain and pdf-Plain \TeX.
+\item[\sffamily\color{messages}I only need learn the most basic
+features.] The first subsections (1.1-1.3) describe the traditional way
+of loading a language (with |ldf| files), which is usually all you need.
+The alternative way based on |ini| files, which complements the
+previous one (it does \textit{not} replace it, although it is still
+necessary in some languages), is described below; go to \ref{inifiles}.
+
+\item[\sffamily\color{messages}I don’t like manuals. I prefer sample
+ files.] This manual contains lots of examples and tips, but in GitHub
+ there are many
+ \href{https://github.com/latex3/babel/tree/master/samples}{sample
+ files}.
+
\item[\sffamily\color{messages}What if I’m interested only in the
latest changes?] Changes and new features with relation to version 3.8
are highlighted with \New{X.XX}\hspace{-.5em}
@@ -306,19 +328,6 @@ maintained separately
\item[\sffamily\color{messages}How can I contribute a new
language?] See section \ref{contribute} for contributing a language.
-\item[\sffamily\color{messages}I only need learn the most basic
-features.] The first subsections (1.1-1.3) describe the traditional way
-of loading a language (with |ldf| files), which is usually all you need.
-The alternative way based on |ini| files, which complements the
-previous one (it does \textit{not} replace it, although it is still
-necessary in some languages), is described below; go to \ref{inifiles}.
-
-\item[\sffamily\color{messages}I don’t like manuals. I prefer sample
- files.] This manual contains lots of examples and tips, but in GitHub
- there are many
- \href{https://github.com/latex3/babel/tree/master/samples}{sample
- files}.
-
\item[\sffamily\color{messages}Where is the code?]
Run |lualatex --jobname=babel-code \let\babelcode\relax\input{babel.dtx}|.
\end{description}
@@ -651,6 +660,100 @@ _\foreignlanguage{spanish}{Español}_.
for |lubakatanga|). See section \ref{bcp47} for further details.
\end{note}
+\subsection{Languages supported by \babel{} with \textsf{ldf} files}
+
+(To be updated.) In the following table most of the languages supported
+by \babel{} with and |.ldf| file are listed, together with the names of
+the option which you can load \babel\ with for each language. Note this
+list is open and the current options may be different. It does not
+include |ini| files (see below). Except in a few cases (eg, |ngerman|,
+|serbianc|, |acadian|) names are those of the Unicode CLDR (or based on
+them).
+
+\begin{description}
+\itemsep=-\parskip
+\sffamily
+\item[Afrikaans] afrikaans
+\item[Azerbaijani] azerbaijani
+\item[Basque] basque
+\item[Breton] breton
+\item[Bulgarian] bulgarian
+\item[Catalan] catalan
+\item[Croatian] croatian
+\item[Czech] czech
+\item[Danish] danish
+\item[Dutch] dutch
+\item[English] english, american (\textit{preferred to} USenglish), british (\textit{preferred to}
+ UKenglish), canadian, australian, newzealand
+\item[Esperanto] esperanto
+\item[Estonian] estonian
+\item[Finnish] finnish
+\item[French] french, acadian
+\item[Galician] galician
+\item[German] ngerman, naustrian, german, austrian
+\item[Greek] greek, polutonikogreek
+\item[Hebrew] hebrew
+\item[Icelandic] icelandic
+\item[Indonesian] indonesian
+\item[Interlingua] interlingua
+\item[Irish Gaelic] irish
+\item[Italian] italian
+\item[Latin] latin
+\item[Lower Sorbian] lowersorbian
+\item[Malay] malay (\textit{preferred to} melayu)
+\item[Northern Sami] northernsami
+\item[Norwegian] norsk, nynorsk
+\item[Polish] polish
+\item[Portuguese] portuguese, brazilian
+\item[Romanian] romanian
+\item[Russian] russian
+\item[Scottish Gaelic] scottishgaelic (\textit{preferred to} scottish)
+\item[Spanish] spanish
+\item[Slovakian] slovak
+\item[Slovenian] slovene
+\item[Swedish] swedish
+\item[Serbian] serbian
+\item[Turkish] turkish
+\item[Ukrainian] ukrainian
+\item[Upper Sorbian] uppersorbian
+\item[Welsh] welsh
+\end{description}
+
+There are more languages not listed above, including \textsf{hindi,
+thai, thaicjk, latvian, turkmen, magyar, mongolian, romansh,
+lithuanian, spanglish, vietnamese, japanese, pinyin, arabic, farsi,
+ibygreek, bgreek, serbianc, frenchle, ethiop} and \textsf{friulan}.
+
+\begin{note}
+ There are also some deprecated names (a few has been even removed):
+ \textsf{frenchb} or \textsf{francais}, as well as \textsf{canadien}
+ (\textsf{french}), \textsf{germanb} (\textsf{german}),
+ \textsf{bahasa}, \textsf{indon} or \textsf{bahasai}
+ (\textsf{indonesian}), \textsf{lsorbian} (\textsf{lowersorbian}),
+ \textsf{bahasam} (\textsf{malay}), \textsf{portuges}
+ (\textsf{portuguese}), \textsf{brazil} (\textsf{brazilian}),
+ \textsf{russianb} (\textsf{russian}), \textsf{usorbian}
+ (\textsf{uppersorbian}), \textsf{vietnam} (\textsf{vietnamese}),
+ \textsf{samin} (\textsf{northernsami}), \textsf{ukraineb}
+ (\textsf{ukrainian}). Deprecated names come in many cases from the
+ times when they had to be shortened to 8 characters.
+\end{note}
+
+Most of them work out of the box, but some may require extra fonts,
+encoding files, a preprocessor or even a complete framework (like
+\textsf{CJK} or \textsf{luatexja}). For example, if you have got the
+\textsf{velthuis/devnag} package, you can create a file with extension
+|.dn|:
+\begin{verbatim}
+\documentclass{article}
+\usepackage[hindi]{babel}
+\begin{document}
+{\dn devaanaa.m priya.h}
+\end{document}
+\end{verbatim}
+Then you preprocess it with |devnag| \m{file}, which creates
+\m{file}|.tex|; you can then typeset the latter with \LaTeX.
+
\subsection{Modifiers}
\New{3.9c} The basic behavior of some languages can be modified when
@@ -682,7 +785,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 +893,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 +994,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 +1177,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 +1189,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 +1309,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 +1332,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 +1565,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 +1605,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 +1622,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 +1689,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 +2422,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 +2538,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 +2933,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
@@ -3042,26 +3166,28 @@ page on the news for 3.76 in the \babel{} site for further details.
\subsection{Accessing language info}
-\Describe{\languagename}{}
-The control sequence |\languagename| contains the name of the
-current language.
+\Describe{\localename}{}
+\DescribeOther{\mainlocalename}
+\DescribeOther{\languagename}
+\New{29.10} The control sequence |\localename| contains the name of the current
+locale. This is now the recommended way to retrieve the current
+language. In addtion, |\mainlocalename| contains the main language.
+
+|\languagename| is still used internally, but it is now discouraged at
+the user level.
\begin{warning}
- Due to some internal inconsistencies in catcodes, it should
- \textit{not} be used to test its value. Use \textsf{iflang}, by
- Heiko Oberdiek.
+ Due to a bug, which lead to some internal inconsistencies in
+ catcodes, |\languagename| should \textit{not} be used to test which
+ is the current language. Rely on |\localename| or, if you still need
+ |\languagename| for some reason, on \textsf{iflang}, by Heiko Oberdiek.
\end{warning}
\Describe{\iflanguage}{\marg{language}\marg{true}\marg{false}}
-If more than one language is used, it might be necessary to know which
-language is active at a specific time. This can be checked by a call
-to |\iflanguage|, but note here ``language'' is used in the \TeX{}
-sense, as a set of hyphenation patterns, and \textit{not} as its
-\textsf{babel} name. This macro takes three arguments. The first
-argument is the name of a language; the second and third arguments are
-the actions to take if the result of the test is true or false
-respectively.
+Here ``language'' is used in the \TeX{} sense, as a set of hyphenation
+patterns, and \textit{not} as its \textsf{babel} name. The first
+argument is the name of a language.
\Describe{\localeinfo}{%
\colorbox{thegrey}{\ttfamily\hskip-.2em*\hskip-.2em}{\marg{field}}}
@@ -3072,8 +3198,6 @@ expandable, and the available fields are:
\begin{description}
\itemsep=-\parskip
\item[|name.english|] as provided by the Unicode CLDR.
-%%% \item[|name.locale|] is the equivalent of |\languagename|. Not yet
-%%% activated because the bug in \languagename is far from trivial.
\item[|tag.ini|] is the tag of the |ini| file (the way this
file is identified in its name).
\item[|tag.bcp47|] is the full BCP 47 tag (see the warning below). This
@@ -3256,7 +3380,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}
@@ -3270,8 +3394,16 @@ font encodings are the same, like in Unicode based engines.
\begin{note}
Using |\babelhyphenation| with Southeast Asian scripts is mostly
pointless. But with |\babelpatterns| (below) you may fine-tune line
- breaking (only \luatex). Even if there are no patterns for the
- language, you can add at least some typical cases.
+ breaking (only \luatex). For example:
+\begingroup
+\catcode`@=13
+\def@#1@{{\fontspec{Loma}#1}}
+\begin{verbatim}
+\babelpatterns[thai]{@ศึก@2@ษา@}
+\end{verbatim}
+\endgroup
+ Even if there are no patterns for the language, you can add at least
+ some typical cases.
\end{note}
\begin{note}
@@ -3281,21 +3413,6 @@ font encodings are the same, like in Unicode based engines.
fully set up and an error can be raised.
\end{note}
-\Describe{\begin\menv{hyphenrules}}{\marg{language}\Eenv{hyphenrules}}
-
-The environment \Lenv{hyphenrules} can be used to select \emph{only} the
-hyphenation rules to be used (it can be used as command, too). This can
-for instance be used to select ‘nohyphenation’, provided that in
-\file{language.dat} the ‘language’ \textsf{nohyphenation} is defined by
-loading \file{zerohyph.tex}. It deactivates language shorthands, too
-(but not user shorthands).
-
-Except for these simple uses, |hyphenrules| is deprecated and
-|otherlanguage*| (the starred version) is preferred, because the former
-does not take into account possible changes in encodings of characters
-like, say, |'| done by some languages (eg, \textsf{italian},
-\textsf{french}, \textsf{ukrainian}).
-
\Describe{\babelpatterns}{\texttt{[}\langlist\texttt{]}%
\marg{patterns}}
@@ -3309,7 +3426,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.
@@ -3347,6 +3464,46 @@ range |U+0300|--|U+0367| (which contains combining chars)’. An
alternative to a transform is |\babelpatterns|.
\end{note}
+\Describe{\babelhyphenmins}{%
+ \colorbox{thegrey}{\ttfamily\hskip-.2em*\hskip-.2em}%
+ \texttt{[}\langlist\texttt{]}%
+ \marg{left}\marg{right}\oarg{hyphenationmin}}
+
+\New{24.10} See the news page for the rationale for this commands. It
+sets the corresponding values for the given languages (all languages
+without the optional argument). With the star, the values are also
+applied immediately (the optional argument and the star are currently
+incompatible). The optional argument is available only in \luatex.
+\begin{example}
+You are typesetting a book with wide lines and want to limit the
+number of hyphens in all languages:
+\begin{verbatim}
+ \babelhyphenmins{3}{4}
+\end{verbatim}
+But there are also some 3-column text and you want to be more flexible:
+\begin{verbatim}
+ \begin{multicols}{3}
+ \babelhyphenmins*{2}{3}
+ ...
+ \end{multicols}
+\end{verbatim}
+\end{example}
+
+\Describe{\begin\menv{hyphenrules}}{\marg{language}\Eenv{hyphenrules}}
+
+The environment \Lenv{hyphenrules} can be used to select \emph{only} the
+hyphenation rules to be used (it can be used as command, too). This can
+for instance be used to select ‘nohyphenation’, provided that in
+\file{language.dat} the ‘language’ \textsf{nohyphenation} is defined by
+loading \file{zerohyph.tex}. It deactivates language shorthands, too
+(but not user shorthands).
+
+Except for these simple uses, |hyphenrules| is deprecated and
+|otherlanguage*| (the starred version) is preferred, because the former
+does not take into account possible changes in encodings of characters
+like, say, |'| done by some languages (eg, \textsf{italian},
+\textsf{french}, \textsf{ukrainian}).
+
\subsection{Transforms}
\label{transforms}
@@ -3392,8 +3549,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 +3801,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 +4070,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 +4181,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 +4391,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 +4431,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 +4453,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 +4499,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|:
@@ -4346,99 +4515,6 @@ requiring a command to switch the language. Its default value is
|toc,lof,lot|, but you may redefine it with |\renewcommand| (it's up
to you to make sure no toc type is duplicated).
-\subsection{Languages supported by \babel{} with \textsf{ldf} files}
-
-In the following table most of the languages supported by \babel{} with
-and |.ldf| file are listed, together with the names of the option which
-you can load \babel\ with for each language. Note this list is open and
-the current options may be different. It does not include |ini| files
-(see below). Except in a few cases (eg, |ngerman|, |serbianc|,
-|acadian|) names are those of the Unicode CLDR (or based on them).
-
-\begin{description}
-\itemsep=-\parskip
-\sffamily
-\item[Afrikaans] afrikaans
-\item[Azerbaijani] azerbaijani
-\item[Basque] basque
-\item[Breton] breton
-\item[Bulgarian] bulgarian
-\item[Catalan] catalan
-\item[Croatian] croatian
-\item[Czech] czech
-\item[Danish] danish
-\item[Dutch] dutch
-\item[English] english, american (\textit{preferred to} USenglish), british (\textit{preferred to}
- UKenglish), canadian, australian, newzealand
-\item[Esperanto] esperanto
-\item[Estonian] estonian
-\item[Finnish] finnish
-\item[French] french, acadian
-\item[Galician] galician
-\item[German] ngerman, naustrian, german, austrian
-\item[Greek] greek, polutonikogreek
-\item[Hebrew] hebrew
-\item[Icelandic] icelandic
-\item[Indonesian] indonesian
-\item[Interlingua] interlingua
-\item[Irish Gaelic] irish
-\item[Italian] italian
-\item[Latin] latin
-\item[Lower Sorbian] lowersorbian
-\item[Malay] malay (\textit{preferred to} melayu)
-\item[Northern Sami] northernsami
-\item[Norwegian] norsk, nynorsk
-\item[Polish] polish
-\item[Portuguese] portuguese, brazilian
-\item[Romanian] romanian
-\item[Russian] russian
-\item[Scottish Gaelic] scottishgaelic (\textit{preferred to} scottish)
-\item[Spanish] spanish
-\item[Slovakian] slovak
-\item[Slovenian] slovene
-\item[Swedish] swedish
-\item[Serbian] serbian
-\item[Turkish] turkish
-\item[Ukrainian] ukrainian
-\item[Upper Sorbian] uppersorbian
-\item[Welsh] welsh
-\end{description}
-
-There are more languages not listed above, including \textsf{hindi,
-thai, thaicjk, latvian, turkmen, magyar, mongolian, romansh,
-lithuanian, spanglish, vietnamese, japanese, pinyin, arabic, farsi,
-ibygreek, bgreek, serbianc, frenchle, ethiop} and \textsf{friulan}.
-
-\begin{note}
- There are also some deprecated names (a few has been even removed):
- \textsf{frenchb} or \textsf{francais}, as well as \textsf{canadien}
- (\textsf{french}), \textsf{germanb} (\textsf{german}),
- \textsf{bahasa}, \textsf{indon} or \textsf{bahasai}
- (\textsf{indonesian}), \textsf{lsorbian} (\textsf{lowersorbian}),
- \textsf{bahasam} (\textsf{malay}), \textsf{portuges}
- (\textsf{portuguese}), \textsf{brazil} (\textsf{brazilian}),
- \textsf{russianb} (\textsf{russian}), \textsf{usorbian}
- (\textsf{uppersorbian}), \textsf{vietnam} (\textsf{vietnamese}),
- \textsf{samin} (\textsf{northernsami}), \textsf{ukraineb}
- (\textsf{ukrainian}). Deprecated names come in many cases from the
- times when they had to be shortened to 8 characters.
-\end{note}
-
-Most of them work out of the box, but some may require extra fonts,
-encoding files, a preprocessor or even a complete framework (like
-\textsf{CJK} or \textsf{luatexja}). For example, if you have got the
-\textsf{velthuis/devnag} package, you can create a file with extension
-|.dn|:
-\begin{verbatim}
-\documentclass{article}
-\usepackage[hindi]{babel}
-\begin{document}
-{\dn devaanaa.m priya.h}
-\end{document}
-\end{verbatim}
-Then you preprocess it with |devnag| \m{file}, which creates
-\m{file}|.tex|; you can then typeset the latter with \LaTeX.
-
\subsection{Unicode character properties in \luatex}
\New{3.32} Part of the \babel{} job is to apply Unicode rules to some
@@ -4460,7 +4536,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}
@@ -4577,38 +4653,6 @@ some languages (kerning and spacing). Ligatures can be disabled.
\item[zhspacing] Spacing for CJK documents in \xetex.
\end{description}
-\subsection{Current and future work}
-
-The current work is focused on the so-called complex scripts in \luatex{}.
-In 8-bit engines, \babel{} provided a basic support for bidi text as
-part of the style for Hebrew, but it is somewhat unsatisfactory and
-internally replaces some hardwired commands by other hardwired commands
-(generic changes would be much better).
-
-Useful additions would be, for example, time, currency, addresses and
-personal names.\footnote{See for example POSIX, ISO 14652 and the
-Unicode Common Locale Data Repository (CLDR). Those systems, however,
-have limited application to \TeX\ because their aim is just to display
-information and not fine typesetting.}. But that is the easy
-part, because they don't require modifying the \LaTeX{} internals.
-Calendars (Arabic, Persian, Indic, etc.) are under study.
-
-Also interesting are differences in the sentence structure or related
-to it. For example, in Basque the number precedes the name (including
-chapters), in Hungarian ``from (1)'' is ``(1)-b\H{o}l'', but ``from
-(3)'' is ``(3)-b\'{o}l'', in Spanish an item labelled
-``3.$^{\textrm{\scriptsize o}}$'' may be referred to as either
-``\'{\i}tem 3.$^{\textrm{\scriptsize o}}$'' or
-``3.$^{\textrm{\scriptsize er}}$ \'{\i}tem'', and so on.
-
-An option to manage bidirectional document layout in \luatex{} (lists,
-footnotes, etc.) is almost finished, but \xetex{} required more work.
-Unfortunately, proper support for \xetex{} requires patching somehow
-lots of macros and packages (and some issues related to |\special|s
-remain, like color and hyperlinks), so \babel{} resorts to the
-\textsf{bidi} package (by Vafa Khalighi). See the \babel{} repository
-for a small example (|xe-bidi|).
-
\subsection{Tentative and experimental code}
See the code section for |\foreignlanguage*| (a new starred
@@ -4696,7 +4740,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 +4790,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 +4804,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 +4826,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 +4851,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 +4860,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 +4906,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 +5285,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 +5386,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 +5396,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 +5448,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 +5464,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 +5478,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 +5512,14 @@ wouldn’t exist.
% \section{Tools}
%
% \begin{macrocode}
-%<<version=24.6>>
-%<<date=2024/06/02>>
+%<<version=24.10>>
+%<<date=2024/09/18>>
% \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 +5553,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 +5568,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 +5613,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 +5639,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 +5670,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 +5747,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 +5834,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 +5847,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 +5913,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 +5936,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 +5984,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 +6036,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 +6063,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}
@@ -6048,7 +6075,7 @@ wouldn’t exist.
#1\ifx\@empty#2\else,\bbl@afterfi\bbl@tempb#2\fi}%
\def\bbl@tempe#1=#2\@@{%
\bbl@csarg\edef{mod@#1}{\bbl@tempb#2}}
-\def\bbl@tempd#1.#2\@nnil{% TODO. Refactor lists?
+\def\bbl@tempd#1.#2\@nnil{%
\ifx\@empty#2%
\edef\bbl@tempc{\ifx\bbl@tempc\@empty\else\bbl@tempc,\fi#1}%
\else
@@ -6057,10 +6084,10 @@ wouldn’t exist.
\edef\bbl@tempc{%
\ifx\bbl@tempc\@empty\else\bbl@tempc,\fi#1.\bbl@tempb#2}%
\else
- \in@{$modifiers$}{$#1$}% TODO. Allow spaces.
+ \in@{$modifiers$}{$#1$}%
\ifin@
\bbl@tempe#2\@@
- \else
+ \else
\in@{=}{#1}%
\ifin@
\edef\bbl@tempc{\ifx\bbl@tempc\@empty\else\bbl@tempc,\fi#1.#2}%
@@ -6090,12 +6117,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 +6171,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 +6194,7 @@ wouldn’t exist.
\bbl@replace\bbl@opt@provide{;}{,}%
\fi}
\fi
-%
+%
% \end{macrocode}
%
% \subsection{Conditional loading of shorthands}
@@ -6199,8 +6225,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{%
@@ -6296,7 +6321,7 @@ wouldn’t exist.
\endinput\fi % Same line!
<@Make sure ProvidesFile is defined@>
\ProvidesFile{babel.def}[<@date@> v<@version@> Babel common definitions]
-\ifx\AtBeginDocument\@undefined % TODO. change test.
+\ifx\AtBeginDocument\@undefined
<@Emulate LaTeX@>
\fi
<@Basic macros@>
@@ -6348,19 +6373,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 +6416,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 +6435,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,29 +6444,30 @@ 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}
\let\bbl@initoload\relax
-%<-core>
+%</package|core>
+%<*package>
\def\bbl@provide@locale{%
\ifx\babelprovide\@undefined
\bbl@error{base-on-the-fly}{}{}{}%
\fi
- \let\bbl@auxname\languagename % Still necessary. TODO
+ \let\bbl@auxname\languagename % Still necessary.
\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
@@ -6464,10 +6489,11 @@ wouldn’t exist.
{\bbl@exp{\\\babelprovide[\bbl@autoload@options]{\languagename}}}%
{}%
\fi}
-%<+core>
+%</package>
+%<*package|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 +6512,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 +6548,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 +6592,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 +6601,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 +6612,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 +6634,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 +6678,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.
@@ -6681,30 +6707,8 @@ wouldn’t exist.
% \begin{macrocode}
\def\BabelContentsFiles{toc,lof,lot}
\def\bbl@set@language#1{% from selectlanguage, pop@
- % The old buggy way. Preserved for compatibility.
- \edef\languagename{%
- \ifnum\escapechar=\expandafter`\string#1\@empty
- \else\string#1\@empty\fi}%
- \ifcat\relax\noexpand#1%
- \expandafter\ifx\csname date\languagename\endcsname\relax
- \edef\languagename{#1}%
- \let\localename\languagename
- \else
- \bbl@info{Using '\string\language' instead of 'language' is\\%
- deprecated. If what you want is to use a\\%
- macro containing the actual locale, make\\%
- sure it does not not match any language.\\%
- Reported}%
- \ifx\scantokens\@undefined
- \def\localename{??}%
- \else
- \scantokens\expandafter{\expandafter
- \def\expandafter\localename\expandafter{\languagename}}%
- \fi
- \fi
- \else
- \def\localename{#1}% This one has the correct catcodes
- \fi
+ % The old buggy way. Preserved for compatibility, but simplified
+ \edef\languagename{\expandafter\string#1\@empty}%
\select@language{\languagename}%
% write to auxs
\expandafter\ifx\csname date\languagename\endcsname\relax\else
@@ -6723,16 +6727,22 @@ wouldn’t exist.
%
\newif\ifbbl@bcpallowed
\bbl@bcpallowedfalse
-\def\select@language#1{% from set@, babel@aux
+%
+\def\select@language#1{% from set@, babel@aux, babel@toc
\ifx\bbl@selectorname\@empty
\def\bbl@selectorname{select}%
- % set hymap
\fi
+ % set hymap
\ifnum\bbl@hymapsel=\@cclv\chardef\bbl@hymapsel4\relax\fi
- % set name
+ % set name (when coming from babel@aux)
\edef\languagename{#1}%
\bbl@fixname\languagename
- % TODO. name@map must be here?
+ % define \localename when coming from set@, with a trick
+ \ifx\scantokens\@undefined
+ \def\localename{??}%
+ \else
+ \bbl@exp{\\\scantokens{\def\\\localename{\languagename}\\\noexpand}\relax}%
+ \fi
\bbl@provide@locale
\bbl@iflanguage\languagename{%
\let\bbl@select@type\z@
@@ -6740,12 +6750,12 @@ wouldn’t exist.
\def\babel@aux#1#2{%
\select@language{#1}%
\bbl@foreach\BabelContentsFiles{% \relax -> don't assume vertical mode
- \@writefile{##1}{\babel@toc{#1}{#2}\relax}}}% TODO - plain?
+ \@writefile{##1}{\babel@toc{#1}{#2}\relax}}}%
\def\babel@toc#1#2{%
\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 +6782,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 +6813,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
@@ -6843,6 +6853,12 @@ wouldn’t exist.
\ifin@\else\bbl@xin@{/k}{/\bbl@tempa}\fi % only kashida
\ifin@\else\bbl@xin@{/p}{/\bbl@tempa}\fi % padding (eg, Tibetan)
\ifin@\else\bbl@xin@{/v}{/\bbl@tempa}\fi % variable font
+ % hyphenation - save mins
+ \babel@savevariable\lefthyphenmin
+ \babel@savevariable\righthyphenmin
+ \ifnum\bbl@engine=\@ne
+ \babel@savevariable\hyphenationmin
+ \fi
\ifin@
% unhyphenated/kashida/elongated/padding = allow stretching
\language\l@unhyphenated
@@ -6854,16 +6870,18 @@ wouldn’t exist.
% other = select patterns
\bbl@patterns{#1}%
\fi
- % hyphenation - mins
- \babel@savevariable\lefthyphenmin
- \babel@savevariable\righthyphenmin
+ % hyphenation - set mins
\expandafter\ifx\csname #1hyphenmins\endcsname\relax
\set@hyphenmins\tw@\thr@@\relax
+ \@nameuse{bbl@hyphenmins@}%
\else
\expandafter\expandafter\expandafter\set@hyphenmins
\csname #1hyphenmins\endcsname\relax
\fi
- % reset selector name
+ \@nameuse{bbl@hyphenmins@}%
+ \@nameuse{bbl@hyphenmins@\languagename}%
+ \@nameuse{bbl@hyphenatmin@}%
+ \@nameuse{bbl@hyphenatmin@\languagename}%
\let\bbl@selectorname\@empty}
% \end{macrocode}
%
@@ -6984,11 +7002,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
@@ -7004,6 +7025,7 @@ wouldn’t exist.
\bbl@usedategroupfalse
\fi
\bbl@fixname\languagename
+ \let\localename\languagename
% TODO. name@map here?
\bbl@provide@locale
\bbl@iflanguage\languagename{%
@@ -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,19 +7622,19 @@ 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
+\def\bbl@afterldf#1{%
\bbl@afterlang
\let\bbl@afterlang\relax
\let\BabelModifiers\relax
@@ -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,30 +7659,35 @@ 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{%
\def\bbl@main@language{#1}%
- \let\languagename\bbl@main@language % TODO. Set localename
+ \let\languagename\bbl@main@language
+ \let\localename\bbl@main@language
+ \let\mainlocalename\bbl@main@language
\bbl@id@assign
\bbl@patterns{\languagename}}
% \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|.
+%
+% 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,12 +7695,13 @@ 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}%
-%<-core>
+%</package|core>
+%<*package>
\ifx\bbl@normalsf\@empty
\ifnum\sfcode`\.=\@m
\let\normalsfcodes\frenchspacing
@@ -7683,24 +7711,27 @@ wouldn’t exist.
\else
\let\normalsfcodes\bbl@normalsf
\fi
-%<+core>
+%</package>
+%<*package|core>
\ifbbl@single % must go after the line above.
\renewcommand\selectlanguage[1]{}%
\renewcommand\foreignlanguage[2]{#2}%
\global\let\babel@aux\@gobbletwo % Also as flag
\fi}
-%<-core>
+%</package|core>
+%<*package>
\AddToHook{begindocument/before}{%
\let\bbl@normalsf\normalsfcodes
\let\normalsfcodes\relax} % Hack, to delay the setting
-%<+core>
+%</package>%
+%<*package|core>
\ifcase\bbl@engine\or
- \AtBeginDocument{\pagedir\bodydir} % TODO - a better place
+ \AtBeginDocument{\pagedir\bodydir}
\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 +7747,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 +7777,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 +7800,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 +7841,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 +7854,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 +7867,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 +7885,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 +7907,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 +7930,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 +7962,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 +7980,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 +7991,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 +8006,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 +8022,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 +8032,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 +8049,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,21 +8071,20 @@ 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
-\bbl@ifunset{ifincsname}% TODO. Ugly. Correct? Only Plain?
+\bbl@ifunset{ifincsname}%
{\gdef\active@prefix#1{%
\ifx\protect\@typeset@protect
\else
@@ -8086,29 +8113,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 +8145,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 +8167,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 +8180,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 +8239,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,34 +8255,33 @@ 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}
-\def\language@group{english} % TODO. I don't like defaults
+\def\language@group{english}
\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 +8299,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 +8334,29 @@ 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.
%
-% 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 +8373,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 +8397,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 +8443,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 +8486,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 +8517,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 +8536,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 +8557,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 +8614,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 +8643,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 +8670,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 +8693,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 +8711,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 +8777,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 +8829,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 +8866,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 +8899,35 @@ wouldn’t exist.
\fi}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\bbl@allowhyphens}
+% \begin{macro}{\babelhyphenmins}
+%
+% Only \LaTeX (basically because it’s defined with a \LaTeX{} tool).
+%
+% \begin{macrocode}
+\ifx\NewDocumentCommand\@undefined\else
+ \NewDocumentCommand\babelhyphenmins{sommo}{%
+ \IfNoValueTF{#2}%
+ {\protected@edef\bbl@hyphenmins@{\set@hyphenmins{#3}{#4}}%
+ \IfValueT{#5}{%
+ \protected@edef\bbl@hyphenatmin@{\hyphenationmin=#5\relax}}%
+ \IfBooleanT{#1}{%
+ \lefthyphenmin=#3\relax
+ \righthyphenmin=#4\relax
+ \IfValueT{#5}{\hyphenationmin=#5\relax}}}%
+ {\edef\bbl@tempb{\zap@space#2 \@empty}%
+ \bbl@for\bbl@tempa\bbl@tempb{%
+ \@namedef{bbl@hyphenmins@\bbl@tempa}{\set@hyphenmins{#3}{#4}}%
+ \IfValueT{#5}{%
+ \@namedef{bbl@hyphenatmin@\bbl@tempa}{\hyphenationmin=#5\relax}}}%
+ \IfBooleanT{#1}{\bbl@error{hyphenmins-args}{}{}{}}}}
+\fi
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\bbl@allowhyphens}
%
% This macro makes hyphenation possible. Basically its definition
% is nothing more than |\nobreak| |\hskip| \texttt{0pt plus
@@ -8893,7 +8940,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 +8982,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 +8993,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 +9014,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 +9190,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
@@ -9211,7 +9258,7 @@ wouldn’t exist.
\csname\bbl@LC\expandafter\endcsname\expandafter{\BabelString}}}
% \end{macrocode}
%
-% A little auxiliary command sets the string. TODO: Formerly used with
+% A little auxiliary command sets the string. Formerly used with
% casing. Very likely no longer necessary, although it’s used in
% |\setlocalecaption|.
%
@@ -9285,9 +9332,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 +9375,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{%
@@ -9345,7 +9392,7 @@ wouldn’t exist.
% separates these two steps.
%
% \begin{macrocode}
-\newcommand\setlocalecaption{% TODO. Catch typos.
+\newcommand\setlocalecaption{%
\@ifstar\bbl@setcaption@s\bbl@setcaption@x}
\def\bbl@setcaption@x#1#2#3{% language caption-name string
\bbl@trim@def\bbl@tempa{#2}%
@@ -9360,7 +9407,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 +9432,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>}}%
{}}%
@@ -9399,12 +9446,11 @@ wouldn’t exist.
\bbl@toglobal\bbl@captionslist
\fi
\fi}
-% \def\bbl@setcaption@s#1#2#3{} % TODO. Not yet implemented (w/o 'name')
% \end{macrocode}
%
% \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 +9462,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 +9475,7 @@ wouldn’t exist.
\endgroup}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \subsection{Making glyphs available}
%
@@ -9439,7 +9485,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 +9506,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 +9517,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 +9578,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 +9613,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 +9633,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 +9643,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 +9678,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 +9688,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 +9736,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 +9764,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 +9779,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 +9794,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 +9826,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 +9840,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 +9867,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 +9876,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}
@@ -9875,7 +9918,8 @@ wouldn’t exist.
% \begin{macrocode}
\bbl@trace{Bidi layout}
\providecommand\IfBabelLayout[3]{#3}%
-%<-core>
+%</package|core>
+%<*package>
\newcommand\BabelPatchSection[1]{%
\@ifundefined{#1}{}{%
\bbl@exp{\let\<bbl@ss@#1>\<#1>}%
@@ -9909,11 +9953,12 @@ wouldn’t exist.
\select@language@x{\bbl@main@language}}}{}
\IfBabelLayout{captions}%
{\BabelPatchSection{caption}}{}
-%<+core>
+%</package>
+%<*package|core>
% \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 +10012,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@
@@ -10014,7 +10059,7 @@ wouldn’t exist.
{}%
\let\bbl@KVP@date\@empty
\fi
- \let\bbl@KVP@captions@@\bbl@KVP@captions % TODO. A dirty hack
+ \let\bbl@KVP@captions@@\bbl@KVP@captions
\ifx\bbl@KVP@captions\@nnil
\let\bbl@KVP@captions\bbl@KVP@import
\fi
@@ -10109,7 +10154,6 @@ wouldn’t exist.
\fi
\bbl@exp{\\\bbl@add\\\bbl@starthyphens
{\\\bbl@patterns@lua{\languagename}}}%
- % TODO - error/warning if no script
\directlua{
if Babel.script_blocks['\bbl@cl{sbcp}'] then
Babel.loc_to_scr[\the\localeid] = Babel.script_blocks['\bbl@cl{sbcp}']
@@ -10180,7 +10224,7 @@ wouldn’t exist.
\bbl@csarg\edef{intsp@#2}{\bbl@KVP@intraspace}%
\fi
\bbl@provide@intraspace
- % == Line breaking: CJK quotes == TODO -> @extras
+ % == Line breaking: CJK quotes ==
\ifcase\bbl@engine\or
\bbl@xin@{/c}{/\bbl@cl{lnbrk}}%
\ifin@
@@ -10416,7 +10460,7 @@ wouldn’t exist.
% Load the basic parameters (ids, typography, counters, and a few
% more), while captions and dates are left out. But it may happen some
% data has been loaded before automatically, so we first discard the
-% saved values. (TODO. But preserving previous values would be useful.)
+% saved values.
%
% \begin{macrocode}
\def\bbl@load@basic#1{%
@@ -10425,7 +10469,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 +10498,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 +10565,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 +10666,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 +10709,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 +10720,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 +10757,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 +10812,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 +10925,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 +10966,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 +11015,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 +11206,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 +11302,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 +11456,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 +11473,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 +11488,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 +11530,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 +11555,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 +11589,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 +11599,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 +11613,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 +11766,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 +11809,7 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \begin{macro}{\ref}
% \begin{macro}{\pageref}
@@ -11801,8 +11846,8 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@citex}
%
@@ -11859,7 +11904,7 @@ wouldn’t exist.
}{}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \begin{macro}{\nocite}
%
@@ -11871,7 +11916,7 @@ wouldn’t exist.
\@safe@activestrue\org@nocite{#1}\@safe@activesfalse}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \begin{macro}{\bibcite}
%
@@ -11894,7 +11939,7 @@ wouldn’t exist.
\bibcite}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \begin{macro}{\bbl@bibcite}
%
@@ -11906,7 +11951,7 @@ wouldn’t exist.
\org@bibcite{#1}{\@safe@activesfalse#2}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \begin{macro}{\bbl@cite@choice}
%
@@ -11930,7 +11975,7 @@ wouldn’t exist.
\AtBeginDocument{\bbl@cite@choice}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@bibitem}
%
@@ -11948,7 +11993,7 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \subsection{Marks}
%
@@ -11988,19 +12033,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 +12069,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 +12082,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 +12129,7 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \subsubsection{\pkg{varioref}}
%
@@ -12092,7 +12137,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 +12172,9 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \subsubsection{\pkg{hhline}}
%
@@ -12155,11 +12200,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 +12232,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 +12285,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 +12332,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 +12344,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 +12407,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 +12419,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
@@ -12411,12 +12457,14 @@ wouldn’t exist.
% \end{macrocode}
%
% Now come the macros used to set the direction when a language is
-% switched. First the (mostly) common macros.
+% switched. Testing are based on script names, because it’s the user
+% interface (including |language| and |script| in |\babelprovide|.
+% First the (mostly) common macros.
%
% \begin{macrocode}
\bbl@trace{Macros to switch the text direction}
\def\bbl@alscripts{,Arabic,Syriac,Thaana,}
-\def\bbl@rscripts{% TODO. Base on codes ??
+\def\bbl@rscripts{%
,Imperial Aramaic,Avestan,Cypriot,Hatran,Hebrew,%
Old Hungarian,Lydian,Mandaean,Manichaean,%
Meroitic Cursive,Meroitic,Old North Arabian,%
@@ -12453,9 +12501,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 +12574,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 +12629,7 @@ wouldn’t exist.
\@empty}}
\fi
% \end{macrocode}%
-% \end{macro}
+% \end{macro}
%
% \subsection{Language options}
%
@@ -12676,7 +12721,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 +12762,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 +12788,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 +12864,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 +12899,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.
%
@@ -12946,19 +12991,19 @@ wouldn’t exist.
{This macro is available only in LuaLaTeX and XeLaTeX.}%
{Consider switching to these engines.}
\bbl@errmessage{only-lua}
- {This macro is available only in LuaLaTeX.}%
+ {This macro is available only in LuaLaTeX}%
{Consider switching to that engine.}
\bbl@errmessage{unknown-provide-key}
{Unknown key '#1' in \string\babelprovide}%
{See the manual for valid keys}%
\bbl@errmessage{unknown-mapfont}
{Option '\bbl@KVP@mapfont' unknown for\\%
- mapfont. Use 'direction'.}%
+ mapfont. Use 'direction'}%
{See the manual for details.}
\bbl@errmessage{no-ini-file}
{There is no ini file for the requested language\\%
(#1: \languagename). Perhaps you misspelled it or your\\%
- installation is not complete.}%
+ installation is not complete}%
{Fix the name or reinstall babel.}
\bbl@errmessage{digits-is-reserved}
{The counter name 'digits' is reserved for mapping\\%
@@ -12966,7 +13011,7 @@ wouldn’t exist.
{Use another name.}
\bbl@errmessage{limit-two-digits}
{Currently two-digit years are restricted to the\\
- range 0-9999.}%
+ range 0-9999}%
{There is little you can do. Sorry.}
\bbl@errmessage{alphabetic-too-large}
{Alphabetic numeral too large (#1)}%
@@ -12978,20 +13023,20 @@ wouldn’t exist.
{See the manual for details.}
\bbl@errmessage{unknown-ini-field}
{Unknown field '#1' in \string\BCPdata.\\%
- Perhaps you misspelled it.}%
+ Perhaps you misspelled it}%
{See the manual for details.}
\bbl@errmessage{unknown-locale-key}
{Unknown key for locale '#2':\\%
#3\\%
- \string#1 will be set to \relax}%
+ \string#1 will be set to \string\relax}%
{Perhaps you misspelled it.}%
\bbl@errmessage{adjust-only-vertical}
{Currently, #1 related features can be adjusted only\\%
- in the main vertical list.}%
+ in the main vertical list}%
{Maybe things change in the future, but this is what it is.}
\bbl@errmessage{layout-only-vertical}
{Currently, layout related features can be adjusted only\\%
- in vertical mode.}%
+ in vertical mode}%
{Maybe things change in the future, but this is what it is.}
\bbl@errmessage{bidi-only-lua}
{The bidi method 'basic' is available only in\\%
@@ -13021,11 +13066,11 @@ wouldn’t exist.
{See the manual for further info}
\bbl@errmessage{unknown-interchar}
{'#1' for '\languagename' cannot be enabled.\\%
- Maybe there is a typo.}%
+ Maybe there is a typo}%
{See the manual for further details.}
\bbl@errmessage{unknown-interchar-b}
{'#1' for '\languagename' cannot be disabled.\\%
- Maybe there is a typo.}%
+ Maybe there is a typo}%
{See the manual for further details.}
\bbl@errmessage{charproperty-only-vertical}
{\string\babelcharproperty\space can be used only in\\%
@@ -13060,15 +13105,19 @@ wouldn’t exist.
{The '#1' ldf style doesn't work with #2,\\%
but you can use the ini locale instead.\\%
Try adding 'provide=*' to the option list. You may\\%
- also want to set 'bidi=' to some value.}%
+ also want to set 'bidi=' to some value}%
+ {See the manual for further details.}
+\bbl@errmessage{hyphenmins-args}
+ {\string\babelhyphenmins\ accepts either the optional\\%
+ argument or the star, but not both at the same time}%
{See the manual for further details.}
%</errors>
%<*patterns>
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \section{Loading hyphenation patterns}
%
@@ -13090,13 +13139,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 +13156,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 +13193,7 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \begin{macro}{\process@language}
%
@@ -13324,15 +13372,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 +13415,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 +13446,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 +13457,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 +13476,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 +13502,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 +13518,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 +13686,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 +13849,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 +13963,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 +13979,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 +13991,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 +14085,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 +14213,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 +14361,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 +14382,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 +14546,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 +14580,7 @@ end
#2}}}%
\fi}}
% \end{macrocode}
-% \end{macro}
+% \end{macro}
%
% \subsection{Southeast Asian scripts}
%
@@ -14563,7 +14593,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 +14631,7 @@ end
}}
\begingroup
\catcode`\%=12
-\catcode`\&=14
+\catcode`\&=14
\catcode`\'=12
\catcode`\~=12
\gdef\bbl@seaintraspace{&
@@ -14638,7 +14668,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 +14681,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 +14727,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 +14745,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 +14777,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 +14861,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 +14882,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 +15048,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 +15066,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 +15109,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 +15136,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 +15248,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 +15308,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 +15328,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 +15354,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 +15371,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 +15451,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 +15493,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 +15545,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 +15572,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 +15587,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 +15666,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 +15910,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 +15950,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 +15977,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 +16017,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 +16123,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 +16154,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 +16238,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 +16295,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 +16311,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 +16359,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 +16372,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 +16516,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 +16527,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 +16548,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 +16626,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 +16650,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 +16689,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 +16800,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 +16844,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 +23035,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 +23150,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 +23159,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 +23295,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 +23317,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 +23352,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 +23361,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 +23432,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 +23489,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 +23505,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 +23671,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 +23704,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 +23728,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 +23751,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 +23811,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 +23863,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 +23965,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 +24024,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 +24038,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 +24052,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 +24106,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 +24599,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 +24609,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 +24788,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 +24863,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 +24883,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 +24895,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 +24909,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 +24977,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 +24997,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 +25032,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 +25075,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 +25199,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 +25210,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 +25233,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 +25270,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..e9ab76ac2f0 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/09/18}
\def\batchfile{babel.ins}
\input docstrip.tex
@@ -105,32 +105,6 @@
\expandafter\gdef\csname #1Var\endcsname{#2}%
\fi}
-% The following is somewhat hackish, but it does the job for babel, and
-% must be used in the following way: <-name> starts a block to be
-% ignored if 'name' is active, and <+name> ends the block (in this
-% order). Used to exclude some parts from babel.def. With the original
-% definitions, some code goes 'visually' in comments/documentation, but
-% with this change they are in the real code. However, it must be
-% considered temporal, because the solution must be to reorganize the
-% code.
-
-\let\bblMinus\minusOption
-\def\minusOption-#1>#2\endLine{%
- \global\let\bblactivefiles\activefiles
- \def\tempa{}%
- \def\do##1##2##3{%
- \def\tempb{#1}\def\tempc{##2}%
- \ifx\tempb\tempc\else
- \expandafter\def\expandafter\tempa\expandafter{%
- \tempa\do##1{##2}##3}%
- \fi}%
- \activefiles
- \let\activefiles\tempa}
-
-\let\bblPlus\plusOption
-\def\plusOption+#1>#2\endLine{%
- \let\activefiles\bblactivefiles}
-
% Preambles
\declarepreamble\mainpreamble
@@ -179,11 +153,30 @@
\file{bplain.tex}{\from{babel.dtx}{bplain}}
\file{blplain.tex}{\from{babel.dtx}{blplain}}
}
+
+% MakeIndex style files
+
+\usedir{makeindex/babel}
+
+\generate{\file{bbind.ist}{\from{bbidxglo.dtx}{idx}}
+ \file{bbglo.ist}{\from{bbidxglo.dtx}{glo}}}
+
+% lua code
+
+\def\MetaPrefix{--}
+\usepreamble\luapreamble
+\nopostamble
+\generate{\file{babel-transforms.lua}{\from{babel.dtx}{transforms}}}
+\generate{\file{babel-data-bidi.lua}{\from{babel.dtx}{bididata}}}
+\generate{\file{babel-data-cjk.lua}{\from{babel.dtx}{cjkdata}}}
+\generate{\file{babel-bidi-basic-r.lua}{\from{babel.dtx}{basic-r}}}
+\generate{\file{babel-bidi-basic.lua}{\from{babel.dtx}{basic}}}
-% compatibility files
+% Compatibility files
\let\minusOption\bblMinus
\let\plusOption\bblPlus
+
\def\compatfile#1{\file{#1.sty}{\from{bbcompat.dtx}{styfile,#1}}}
\generate{%
@@ -246,23 +239,6 @@
\compatfile{bahasam}
}
-% MakeIndex style files
-
-\usedir{makeindex/babel}
-
-\generate{\file{bbind.ist}{\from{bbidxglo.dtx}{idx}}
- \file{bbglo.ist}{\from{bbidxglo.dtx}{glo}}}
-
-% lua code
-
-\def\MetaPrefix{--}
-\usepreamble\luapreamble
-\nopostamble
-\generate{\file{babel-transforms.lua}{\from{babel.dtx}{transforms}}}
-\generate{\file{babel-data-bidi.lua}{\from{babel.dtx}{bididata}}}
-\generate{\file{babel-data-cjk.lua}{\from{babel.dtx}{cjkdata}}}
-\generate{\file{babel-bidi-basic-r.lua}{\from{babel.dtx}{basic-r}}}
-\generate{\file{babel-bidi-basic.lua}{\from{babel.dtx}{basic}}}
\Msg{***********************************************************}
\Msg{*}
diff --git a/Master/texmf-dist/source/latex/babel/bbcompat.dtx b/Master/texmf-dist/source/latex/babel/bbcompat.dtx
index e4d9db47084..c7323d52c94 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/09/18 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..fad681601bb 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/beamertheme-gotham/gotham.dtx b/Master/texmf-dist/source/latex/beamertheme-gotham/gotham.dtx
new file mode 100644
index 00000000000..969a4792576
--- /dev/null
+++ b/Master/texmf-dist/source/latex/beamertheme-gotham/gotham.dtx
@@ -0,0 +1,8842 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2023-20** by Romain NOEL <romainoel@free.fr>
+% -----------------------------------------------------------
+%
+% 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.
+%
+% \fi
+%
+% \iffalse
+%<*driver>
+\ProvidesFile{gotham.dtx}
+%</driver>
+%<*internal>
+\input expl3-generic \relax
+%</internal>
+%<class>\NeedsTeXFormat{LaTeX3e}
+%<package>\ProvidesExplPackage{beamerthemegotham}{2024/09/20}{1.1.0.b}{A modern, minimal-ish, versatile and extendable yet robust theme for Beamer}
+%<author>Romain NOEL</author>
+%<maintainer>Romain NOEL</maintainer>
+%<url>https://gitlab.com/RomainNOEL/beamertheme-gotham</url>
+%<desc>
+% A modern, minimal-ish, versatile and extendable yet robust theme for Beamer. It uses l3build system to both build and verify (Test-Driven Development) the delivered code.
+% </desc>
+%
+%<*driver>
+\documentclass{l3doc}
+ \usepackage[T1]{fontenc}
+ \usepackage{pdfpages}
+ \usepackage{standalone}
+ % \usepackage{gotham}
+ % \usepackage{readprov}
+ % \ReadPackageInfos{beamerthemegotham}
+ \edef\GothamVersion{v1.1.0.b} %{\fileversion}
+ \edef\GothamDate{2024-09-20} %{\filedate}
+
+ \usepackage{parskip}
+ \usepackage{setspace}
+ \usepackage{xspace}
+ \onehalfspacing
+
+ \usepackage{xcolor}
+ \definecolor{tPrim}{HTML}{00707F} % Green-Blue
+ \definecolor{tSec}{HTML}{5FA4B0} % Green-Blue light
+ \definecolor{tAccent}{HTML}{F07F3C} % Orange
+ \definecolor{tGrey}{HTML}{E6E6E1} % Grey-Beige
+
+ % \usepackage{fancyvrb}
+ \usepackage{listings}
+ \lstset{%
+ language=[LaTeX]{TeX},
+ basicstyle=\ttfamily,
+ keywordstyle=\color{tPrim}\bfseries,
+ commentstyle=\color{tSec},
+ stringstyle=\color{tSec},
+ backgroundcolor=\color{white},
+ numbers=none,
+ numberstyle=\tiny\ttfamily,
+ stepnumber=2,
+ showspaces=false,
+ showstringspaces=false,
+ showtabs=false,
+ frame=none,
+ framerule=1pt,
+ tabsize=2,
+ rulesep=5em,
+ captionpos=b,
+ breaklines=true,
+ breakatwhitespace=false,
+ framexleftmargin=0em,
+ framexrightmargin=0em,
+ xleftmargin=0em,
+ xrightmargin=0em,
+ aboveskip=1em,
+ belowskip=1em,
+ morekeywords={usetheme,institute,maketitle,@gotham@titleformat,%
+ plain,gothamset,setbeamercolor,defbeamertemplate},
+ }
+ \lstMakeShortInline|
+
+ \usepackage{hyperref}
+
+ \setlength{\fboxsep}{0pt}%
+ \usepackage{subcaption} % For subfigures
+ \usepackage{cleveref} % for references
+
+ \providecommand{\defopt}[1]{default: #1}%{\underline{#1}}
+ % \DescribeGothamOption{optionName}{possible values}{default value}{descrption}
+ \newenvironment{DescribeGothamOption}[3]{
+ \DescribeOption{#1} % from l3doc
+ \begin{minipage}[t]{\textwidth}
+ \textit{\textbf{\textcolor{tSec}{#2}}}\dotfill\,\defopt{#3}\par
+ \begingroup
+ \vspace{0.5em}
+ }{
+ \par
+ \endgroup
+ \end{minipage}
+ }
+
+
+ %% =====================================================================
+ \title{\textsc{Gotham}\\ A modern, minimal-ish, versatile and extendable theme for Beamer}
+ \author{Romain NOEL \\ \url{romainoel@free.fr}}
+ \date{\GothamVersion~---~\GothamDate}
+
+ \providecommand{\themename}{\textbf{\textsc{Gotham}}\xspace}
+
+ %% =====================================================================
+
+
+ %% l3doc commands
+ \EnableCrossrefs
+ \CodelineIndex
+ \RecordChanges
+\begin{document}
+\input{gotham-doc.tex}
+ \clearpage
+%\section{A simple example}
+% \includepdf[pages=-,
+% pagecommand=\section{A simple example},
+% width=0.7\textwidth]
+% {gotham-exampleSimple.pdf}
+\section{Commands description for users}
+ \EnableDocumentation
+ \DisableImplementation
+ \DocInput{\jobname.dtx}
+ \newpage
+\section{Package implementation for developers}
+ \EnableImplementation
+ \DisableDocumentation
+ \GetFileInfo{\jobname.sty}
+ \DocInput{\jobname.dtx}
+ \PrintChanges
+\end{document}
+%</driver>
+%
+%<*devImpl>
+\documentclass{l3doc}
+ \usepackage[T1]{fontenc}
+ \usepackage{pdfpages}
+ \usepackage{standalone}
+ %\usepackage{gotham}
+ \providecommand{\defopt}[1]{\underline{#1}}
+ % l3doc commands
+ \EnableCrossrefs
+ \CodelineIndex
+ \RecordChanges
+\begin{document}
+\section{Commands description for users}
+ \EnableImplementation
+ \DisableDocumentation
+ \DocInput{gotham.dtx}
+\end{document}
+%</devImpl>
+%
+%
+%<*userCmd>
+\documentclass{l3doc}
+ \usepackage[T1]{fontenc}
+ \usepackage{pdfpages}
+ \usepackage{standalone}
+ %\usepackage{gotham}
+ \providecommand{\defopt}[1]{\underline{#1}}
+ % l3doc commands
+ \EnableCrossrefs
+ \CodelineIndex
+ \RecordChanges
+\begin{document}
+\section{Package implementation for developers}
+ \EnableDocumentation
+ \DisableImplementation
+ \DocInput{gotham.dtx}
+\end{document}
+%</userCmd>
+%
+% \fi
+%
+%
+%\begin{implementation}
+% \begin{macrocode}
+%<*font>
+\ProvidesExplPackage{beamerfontthemegotham}{2024/09/20}{1.1.0.b}{gotham font theme}
+\RequirePackage{expl3}
+\RequirePackage{xparse}
+\RequirePackage{etoolbox}
+\RequirePackage{ifxetex}
+\RequirePackage{ifluatex}
+% \end{macrocode}
+% \end{implementation}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%% FONT %%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% \begin{implementation}
+% \begin{variable}{font messages}
+% Definition of the messages that are used and reused by font theme.
+% \changes{v0.2.0}{2024/01/25}{New}
+% \begin{macrocode}
+\msg_new:nnn { gotham } { font-not-found }
+{
+ Could~not~find~font~'#1'.\c_space_tl
+}
+
+\msg_new:nnn { gotham } { fonts-not-available }
+{
+ No~suitable~fonts~found.~Using~fallback~fonts.
+}
+
+\msg_new:nnn { gotham } { compiler-xe-or-lua }
+{
+ You~need~to~compile~with~XeLaTeX~or~LuaLaTeX~to~use~the~Fira~fonts.
+}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{variable}{\g_gotham_fontsnotfound_int:n}
+% Counter for the number of font not found.
+% \begin{macrocode}
+\int_new:N \g_gotham_fontsnotfound_int
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\checkfont:n}
+% \begin{arguments}
+% \item Name of the font.
+% \end{arguments}
+% Command to check if one font exist.
+% \TestFiles{gotham-test-035}
+% \TestMissing{a isolated unit test would be nice.}
+% \begin{macrocode}
+\cs_new_protected:Nn \checkfont:n
+{
+ \fontspec_font_if_exist:nF { #1 }
+ {
+ % false: check with regular postfix.
+ \fontspec_font_if_exist:nF { #1~Regular }
+ {
+ % false: raise a warning and increment the number of font not found.
+ \int_incr:N \g_gotham_fontsnotfound_int
+ \msg_warning:nnn { gotham } { font-not-found } { #1 }
+ }
+ }
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\iffontsavailable}
+% \begin{syntax}
+% \cs{iffontsavailable} \marg{list of fonts' names} \marg{True code} \marg{False code}
+% \end{syntax}
+% If all fonts in \marg{list of fonts' names} are font then \marg{True code} is executed else \marg{False code}.
+% \end{function}
+% \end{documentation}
+% \begin{implementation}
+% \begin{function}{\iffontsavailable}
+% Command to check if a list of font is available.
+% \TestFiles{gotham-test-035}
+% \TestMissing{a isolated unit test would be nice.}
+% \begin{macrocode}
+\newcommand{\iffontsavailable}[3]
+{
+ \int_zero:N \g_gotham_fontsnotfound_int
+ \clist_map_function:nN { #1 } \checkfont:n
+ \int_compare:nTF { \g_gotham_fontsnotfound_int = 0 }
+ {% True
+ #2
+ }{% False
+ #3
+ }
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{Load fonts if available}
+% If fontspec is loadable (ie. if xelatex or lualatex), then load available fonts, otherwise raise a warning and go on.
+% \UnitTested
+% \TestFiles{gotham-test-035}
+% \begin{macrocode}
+\ifboolexpr{bool~{xetex}~or~bool~{luatex}}{
+ % if fontspec loaded pass option otherwise load fontspec.
+ \@ifpackageloaded{fontspec}{
+ \PassOptionsToPackage{no-math}{fontspec}
+ }{
+ \RequirePackage[no-math]{fontspec}
+ }
+ %
+ % We search for regular, italic, light, light italic,fonts under the default |Fira Sans| names.
+ \iffontsavailable{FiraSans-Light.otf,
+ FiraSans-LightItalic.otf,
+ FiraSans-Regular.otf,
+ FiraSans-Italic.otf}
+ {
+ \setsansfont[ItalicFont={FiraSans-LightItalic.otf},
+ BoldFont={FiraSans-Regular.otf},
+ BoldItalicFont={FiraSans-Italic.otf}]
+ {FiraSans-Light.otf}
+ }{
+ % If this fails, the suffix OT --- used by some Linux distributions --- will be tried.
+ \iffontsavailable{FiraSans~Light~OT,
+ FiraSans~LightItalic~OT,
+ FiraSans~Regular~OT,
+ FiraSans~Italic~OT}
+ {
+ \setsansfont[ItalicFont={Fira~Sans~LightItalic~OT},
+ BoldFont={Fira~Sans~Regular~OT},
+ BoldItalicFont={Fira~Sans~Italic~OT}]
+ {Fira~Sans~Light~OT}
+ }{
+ % If this also fails, a warning will be displayed and the standard fonts will be used.
+ \msg_warning:nn { gotham } { fonts-not-available }%
+ }
+ }
+ %
+ % We search for regular, mono, and mono bold fonts under the default |Fira Mono| names.
+ \iffontsavailable{FiraMono-Medium.otf, FiraMono-Bold.otf}{
+ \setmonofont[BoldFont={FiraMono-Medium.otf}]{FiraMono-Bold.otf}
+ }{
+ % If this fails, the suffix OT --- used by some Linux distributions --- will be tried.
+ \iffontsavailable{Fira~Mono~Medium~OT, Fira~Mono~Bold~OT}{
+ \setmonofont[BoldFont={Fira~Mono~Medium~OT}]{Fira~Mono~Bold~OT}
+ }{
+ % If this also fails, a warning will be displayed and the standard fonts will be used.
+ \msg_warning:nn { gotham } { fonts-not-available }
+ }
+ }
+ %
+ % Add a feature for numbers in tables.
+ \AtBeginEnvironment{tabular}{
+ \addfontfeature{Numbers={Monospaced}}
+ }
+}{
+ % If compiled with pdf\LaTeX{}, then apply a dirty patch (that will not do the job but suppress warnings) and raise a warning.
+ \msg_warning:nn { gotham } { compiler-xe-or-lua }
+ \DeclareFontShape{OT1}{cmss}{bx}{sc}{<-> cmbcsc10}{}
+ \DeclareFontShape{OT1}{cmss}{bx}{it}{<->sub*cmss/m/sl}{}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\setbeamerfont{title}, general font definitions}
+% Set all needed font environment variables:shape, size, series.
+% Remark: Case is missing.
+% \UnitTested
+% \TestFiles{gotham-test-035, gotham-test-036}
+% \TestMissing{block, caption, description, bibio}
+% \begin{macrocode}
+\setbeamerfont{title}{size=\Large, series=\bfseries}
+\setbeamerfont*{subtitle}{size=\large}
+\setbeamerfont{author}{size=\small}
+\setbeamerfont{date}{size=\small}
+
+\setbeamerfont{section~title}{size=\Large, series=\bfseries}
+\setbeamerfont{subsection~title}{size=\large, series=\bfseries}
+\setbeamerfont{subsubsection~title}{size=\normalsize, series=\bfseries}
+
+\setbeamerfont{frametitle}{size=\large, series=\bfseries}
+\setbeamerfont{frametitleToc}{size=\LARGE, series=\bfseries}
+\setbeamerfont{frametitleSection}{size*={60}{1}, series=\bfseries}
+
+\setbeamerfont{block~title}{size=\normalsize, series=\bfseries}
+\setbeamerfont{block~title~alerted}{size=\normalsize, series=\bfseries}
+\setbeamerfont{caption}{size=\small}
+\setbeamerfont{caption~name}{series=\bfseries}
+\setbeamerfont{description~item}{series=\bfseries}
+\setbeamerfont{page~number~in~head/foot}{size=\scriptsize}
+
+\setbeamerfont{bibliography~entry~author}{size=\normalsize, series=\normalfont}
+\setbeamerfont{bibliography~entry~title}{size=\normalsize, series=\bfseries}
+\setbeamerfont{bibliography~entry~location}{size=\normalsize, series=\normalfont}
+\setbeamerfont{bibliography~entry~note}{size=\small, series=\normalfont}
+\setbeamerfont{standout}{size=\Large, series=\bfseries}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\__gotham_title_format:n, titles formats}
+% Pre-hooks that will be inserted to control case format of titles in addition with the fonts set.
+% \TestFiles{gotham-test-035, gotham-test-036}
+% \TestMissing{format of framesubtitle, part and subsection are not tested (and not working) yet.}
+% \begin{macrocode}
+\def\gotham@titleformat#1{#1}
+\def\gotham@subtitleformat#1{#1}
+\def\gotham@parttitleformat#1{#1}
+\def\gotham@sectiontitleformat#1{#1}
+\def\gotham@subsectiontitleformat#1{#1}
+\def\gotham@frametitleformat#1{#1}
+\def\gotham@framesubtitleformat#1{#1}
+% IF ONE DAY: I can patch beamer with expl3, I will use the following commands instead.
+% %% \cs_new:Npn \__gotham_unchanged:n #1 {#1}
+% %% \cs_new:Npn \__gotham_title_format:n #1 {#1}
+% %% \cs_new:Npn \__gotham_subtitle_format:n #1 {#1}
+% %% \cs_new:Npn \__gotham_part_title_format:n #1 {#1}
+% %% \cs_new:Npn \__gotham_section_title_format:n #1 {#1}
+% %% \cs_new:Npn \__gotham_subsection_title_format:n #1 {#1}
+% %% \cs_new:Npn \__gotham_frametitle_format:n #1 {#1}
+% %% \cs_new:Npn \__gotham_framesubtitle_format:n #1 {#1}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\beamer@title,\beamer@subtitle,\sectionentry}
+% Since, case feature is not available in |setbeamerfont|; to make the uppercase, lowercase and title-case 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}.
+% Remark: patchcmd from etoolbox (or other), is not compatible with expl3.
+% \UnitTested
+% \TestFiles{gotham-test-035, gotham-test-036}
+% \TestMissing{format of framesubtitle, part and subsection are not tested (and not working) yet.}
+% \begin{macrocode}
+\ExplSyntaxOff
+\patchcmd{\beamer@title}
+ {\def\inserttitle{#2}}
+ {\def\inserttitle{\gotham@titleformat{#2}}}
+ % {\def\inserttitle{ \__gotham_title_format:n{#2} }}
+ {}
+ {\PackageError{beamerfontthemegotham}{Patching~title~failed}\@ehc}
+\patchcmd{\beamer@subtitle}
+ {\def\insertsubtitle{#2}}
+ {\def\insertsubtitle{{\gotham@subtitleformat{#2}}}}
+ % {\def\insertsubtitle{ \__gotham_subtitle_format:n{#2} }}
+ {}
+ {\PackageError{beamerfontthemegotham}{Patching~subtitle~failed}\@ehc}
+\patchcmd{\sectionentry} % beamerbasenavigation.sty l.335
+ {\def\insertsectionhead{#2}}
+ {\def\insertsectionhead{\gotham@sectiontitleformat{#2}}}
+ {}
+ {\PackageError{beamerfontthemegotham}{Patching~section~title~failed}\@ehc}%
+%
+%% NOT WORKING YET!
+%% \patchcmd{\subsectionentry} % beamerbasenavigation.sty l.384
+%% {\def\insertsubsectionhead{##5}}
+%% {\def\insertsubsectionhead{\gotham@subsectiontitleformat{##5}}}
+%% {}
+%% {\PackageError{beamerfontthemegotham}{Patching~subsection~title~failed}\@ehc}%
+%
+\@tempswafalse
+\patchcmd{\beamer@section} % beamerbasesection.sty l. 209
+ {\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{#1}}}
+ {\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{\gotham@sectiontitleformat{#1}}}}
+ % \__gotham_section_title_format:n{#2}
+ {\@tempswatrue}
+ {}
+\patchcmd{\beamer@section} % beamerbasesection.sty l. 209
+ {\edef\insertsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{\unexpanded{#1}}}}
+ {\edef\insertsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{\noexpand\gotham@sectiontitleformat{\unexpanded{#1}}}}}
+ % \exp_not:N \__gotham_section_title_format:n {#1}
+ {\@tempswatrue}
+ {}
+\if@tempswa\else
+ {\PackageError{beamerfontthemegotham}{Patching~section~title~failed}\@ehc}
+\fi
+\@tempswafalse
+%
+%% NOT WORKING YET !
+%% \patchcmd{\beamer@subsection} % beamerbasesection.sty l. 209
+%% {\def\insertsubsectionhead{\hyperlink{Navigation\the\c@page}{#1}}}
+%% {\def\insertsubsectionhead{\hyperlink{Navigation\the\c@page}\gotham@subsectiontitleformat{#1}}}
+%% % \__gotham_subsection_title_format:n{#2}
+%% {\@tempswatrue}
+%% {}
+%% \patchcmd{\beamer@subsection} % beamerbasesection.sty l. 209
+%% {\protected@edef\insertsubsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{#1}}}
+%% {\protected@edef\insertsubsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{\noexpand\gotham@subsectiontitleformat{#1}}}}
+%% % \exp_not:N \__gotham_subsection_title_format:n {#1}
+%% {\@tempswatrue}
+%% {}
+%% \if@tempswa\else
+%% {\PackageError{beamerfontthemegotham}{Patching~subsection~title~failed}\@ehc}
+%% \fi%
+%% \@tempswafalse
+%
+%
+% Similarly, to make the |\MakeLowercase| and |\MakeUppercase| macros work in the frame title we have to patch |\beamer@@frametitle|.
+\providecommand{\beamer@insertframetitlecontinuation}{
+ \usebeamertemplate*{frametitle~continuation}
+}
+\patchcmd{\beamer@@frametitle} % beamerbaselocalstructure.sty l. 32
+ {\gdef\insertframetitle{{%
+ #2%
+ \ifnum\beamer@autobreakcount>0
+ \relax{}\space%
+ \beamer@insertframetitlecontinuation%
+ \fi%
+ }}%
+ }
+ {\gdef\insertframetitle{{%
+ \gotham@frametitleformat{#2}%
+ % \__gotham_frametitle_format:n {#2}
+ \ifnum\beamer@autobreakcount>0
+ \relax{}\space%
+ \beamer@insertframetitlecontinuation%
+ \fi%
+ }}%
+ }
+ {}
+ {\PackageWarning{beamerfontthemegotham}{Patching~frametitle~failed}\@ehc}
+%
+%% NOT WORKING YET !
+%% \patchcmd{\framesubtitle} % beamerbaselocalstructure.sty l.55
+%% {\only#2{\ifblank{#1}{}{\gdef\insertframesubtitle{{#1}}\beamer@aftersubtitle}}}
+%% {\only{#2}{\ifblank{#1}{}{\gdef\insertframesubtitle{{#1}}\beamer@aftersubtitle}}}
+%% {}
+%% {\PackageWarning{beamerfontthemegotham}{Patching~framesubtitle~failed}\@ehc}
+%
+\ExplSyntaxOn
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\usefonttheme}
+% \begin{syntax}
+% \cs{usefonttheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{title format} = \oarg{\defopt{textregular} \textbar lower \textbar upper \textbar titlecase}
+% \meta{title shape} = \oarg{\defopt{textregular} \textbar smallcaps \textbar italic}
+% \meta{subtitle format} = \oarg{\defopt{textregular} \textbar lower \textbar upper \textbar titlecase}
+% \meta{subtitle shape} = \oarg{\defopt{textregular} \textbar smallcaps \textbar italic}
+% \meta{frametitle format} = \oarg{\defopt{textregular} \textbar lower \textbar upper \textbar titlecase}
+% \meta{frametitle shape} = \oarg{\defopt{textregular} \textbar smallcaps \textbar italic}
+% \meta{framesubtitle format} = \oarg{\defopt{textregular} \textbar lower \textbar upper \textbar titlecase}
+% \meta{framesubtitle shape} = \oarg{\defopt{textregular} \textbar smallcaps \textbar italic}
+% \meta{part format} = \oarg{\defopt{textregular} \textbar lower \textbar upper \textbar titlecase}
+% \meta{part shape} = \oarg{\defopt{textregular} \textbar smallcaps \textbar italic}
+% \meta{section format} = \oarg{\defopt{textregular} \textbar lower \textbar upper \textbar titlecase}
+% \meta{section shape} = \oarg{\defopt{textregular} \textbar smallcaps \textbar italic}
+% \meta{subsection format} = \oarg{\defopt{textregular} \textbar lower \textbar upper \textbar titlecase}
+% \meta{subsection shape} = \oarg{\defopt{textregular} \textbar smallcaps \textbar italic}
+% \end{syntax}
+% The 'package' (usefonttheme) options can control both shape and format of title (of the presentation), subtitle, part title, section title, subsection title, frametitle and framesubtitle.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{font key -- interface}
+% Controls the format and shape of the title (of the presentation), subtitle, part title, section title, subsection title, frametitle and framesubtitle.
+% \UnitTested
+% \TestFiles{gotham-test-035, gotham-test-036}
+% \TestMissing{format of framesubtitle, part and subsection are not tested (and not working) yet.}
+% \begin{macrocode}
+\keys_define:nn { gotham / font }
+{
+ % format title
+ format~title .choice:,
+ format~title .usage:n = { general },
+ format~title .default:n = { regular },
+ format~title / regular .code:n =
+ {
+ \let\gotham@titleformat\@empty
+ % \cs_set_eq:NN \__gotham_title_format:n \__gotham_unchanged:n
+ },
+ format~title / lower .code:n =
+ {
+ \let\gotham@titleformat \text_lowercase:n %\lowercase
+ % \cs_set_eq:NN \__gotham_title_format:n \text_lowercase:n
+ \PackageWarning{ gotham } { Be~aware~that~format~title=lower~can~lead~to~problems. }
+ },
+ format~title / upper .code:n =
+ {
+ \let\gotham@titleformat \text_uppercase:n %\uppercase
+ % \cs_set_eq:NN \__gotham_title_format:n \text_uppercase:n
+ \PackageWarning{ gotham } { Be~aware~that~format~title=upper~can~lead~to~problems. }
+ },
+ format~title / titlecase .code:n =
+ {
+ \let\gotham@titleformat \text_titlecase_all:n %\MakeTitlecase
+ % \cs_set_eq:NN \__gotham_title_format:n \text_titlecase_all:n
+ \PackageWarning{ gotham } { Be~aware~that~format~title=titlecase~can~lead~to~problems. }
+ },
+ format~title / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'\l_keys_value_tl'~is~unknown~for~the~(known)~option~'\l_keys_key_tl',~so~being~ignored. }{helping~message: format~title / unknown } },
+}
+\keys_define:nn { gotham / font }
+{
+ % shape title
+ shape~title .choice:,
+ shape~title .usage:n = { general },
+ shape~title .default:n = { regular },
+ shape~title / regular .code:n =
+ {
+ \setbeamerfont{title}{shape=\normalfont}
+ },
+ shape~title / smallcaps .code:n =
+ {
+ \setbeamerfont{title}{shape=\scshape}
+ },
+ shape~title / italic .code:n =
+ {
+ \setbeamerfont{title}{shape=\itshape}
+ },
+ shape~title / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'\l_keys_value_tl'~is~unknown~for~the~(known)~option~'\l_keys_key_tl',~so~being~ignored. }{helping~message: shape~title / unknown} },
+}
+
+\keys_define:nn { gotham / font }
+{
+ % format subtitle
+ format~subtitle .choice:,
+ format~subtitle .usage:n = { general },
+ format~subtitle .default:n = { regular },
+ format~subtitle / regular .code:n =
+ {
+ \let\gotham@subtitleformat\@empty
+ % \cs_set_eq:NN \__gotham_subtitle_format:n \__gotham_unchanged:n
+ },
+ format~subtitle / lower .code:n =
+ {
+ \let\gotham@subtitleformat \text_lowercase:n %\lowercase
+ % \cs_set_eq:NN \__gotham_subtitle_format:n \text_lowercase:n
+ \PackageWarning{ gotham } { Be~aware~that~format~subtitle=lower~can~lead~to~problems. }
+ },
+ format~subtitle / upper .code:n =
+ {
+ \let\gotham@subtitleformat \text_uppercase:n %\uppercase
+ \cs_set_eq:NN \__gotham_subtitle_format:n \text_uppercase:n
+ \PackageWarning{ gotham } { Be~aware~that~format~subtitle=upper~can~lead~to~problems. }
+ },
+ format~subtitle / titlecase .code:n =
+ {
+ \let\gotham@subtitleformat \text_titlecase_all:n %\MakeTitlecase
+ % \cs_set_eq:NN \__gotham_subtitle_format:n \text_titlecase_all:n %\MakeTitlecase
+ \PackageWarning{ gotham } { Be~aware~that~format~subtitle=titlecase~can~lead~to~problems. }
+ },
+ format~subtitle / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'\l_keys_value_tl'~is~unknown~for~the~(known)~option~'\l_keys_key_tl',~so~being~ignored. }{helping~message: format~subtitle / unknown} },
+}
+\keys_define:nn { gotham / font }
+{
+ % shape subtitle
+ shape~subtitle .choice:,
+ shape~subtitle .usage:n = { general },
+ shape~subtitle .default:n = { regular },
+ shape~subtitle / regular .code:n =
+ {
+ \setbeamerfont{subtitle}{shape=\normalfont}
+ },
+ shape~subtitle / smallcaps .code:n =
+ {
+ \setbeamerfont{subtitle}{shape=\scshape}
+ },
+ shape~subtitle / italic .code:n =
+ {
+ \setbeamerfont{subtitle}{shape=\itshape}
+ },
+ shape~subtitle / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'\l_keys_value_tl'~is~unknown~for~the~(known)~option~'\l_keys_key_tl',~so~being~ignored. }{helping~message: shape~subtitle / unknown} },
+}
+
+\keys_define:nn { gotham / font }
+{
+ % format frametitle
+ format~frametitle .choice:,
+ format~frametitle .usage:n = { general },
+ format~frametitle .default:n = { regular },
+ format~frametitle / regular .code:n =
+ {
+ \let\gotham@frametitleformat\@empty
+ % \cs_set_eq:NN \__gotham_frametitle_format:n \__gotham_unchanged:n
+ },
+ format~frametitle / lower .code:n =
+ {
+ \let\gotham@frametitleformat \text_lowercase:n %\lowercase
+ % \cs_set_eq:NN \__gotham_frametitle_format:n \text_lowercase:n
+ \PackageWarning{ gotham } { Be~aware~that~format~frametitle=lower~can~lead~to~problems. }
+ },
+ format~frametitle / upper .code:n =
+ {
+ \let\gotham@frametitleformat \text_uppercase:n %\uppercase
+ % \cs_set_eq:NN \__gotham_frametitle_format:n \text_uppercase:n
+ \PackageWarning{ gotham } { Be~aware~that~format~frametitle=upper~can~lead~to~problems. }
+ },
+ format~frametitle / titlecase .code:n =
+ {
+ \let\gotham@frametitleformat \text_titlecase_all:n %\Maketitlecase
+ % \cs_set_eq:NN \__gotham_frametitle_format:n \text_titlecase_all:n %\MakeTitlecase
+ \PackageWarning{ gotham } { Be~aware~that~format~frametitle=titlecase~can~lead~to~problems. }
+ },
+ format~frametitle / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'\l_keys_value_tl'~is~unknown~for~the~(known)~option~'\l_keys_key_tl',~so~being~ignored. }{helping~message: format~frametitle / unknown} },
+}
+\keys_define:nn { gotham / font }
+{
+ % shape frametitle
+ shape~frametitle .choice:,
+ shape~frametitle .usage:n = { general },
+ shape~frametitle .default:n = { regular },
+ shape~frametitle / regular .code:n =
+ {
+ \setbeamerfont{frametitle}{shape=\normalfont}
+ },
+ shape~frametitle / smallcaps .code:n =
+ {
+ \setbeamerfont{frametitle}{shape=\scshape}
+ },
+ shape~frametitle / italic .code:n =
+ {
+ \setbeamerfont{frametitle}{shape=\itshape}
+ },
+ shape~frametitle / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'\l_keys_value_tl'~is~unknown~for~the~(known)~option~'\l_keys_key_tl',~so~being~ignored. }{helping~message: shape~frametitle / unknown} },
+}
+
+\keys_define:nn { gotham / font }
+{
+ % format framesubtitle
+ format~framesubtitle .choice:,
+ format~framesubtitle .usage:n = { general },
+ format~framesubtitle .default:n = { regular },
+ format~framesubtitle / regular .code:n =
+ {
+ \let\gotham@framesubtitleformat\@empty
+ % \cs_set_eq:NN \__gotham_framesubtitle_format:n \__gotham_unchanged:n
+ },
+ format~framesubtitle / lower .code:n =
+ {
+ \let\gotham@framesubtitleformat \text_lowercase:n %\lowercase
+ % \cs_set_eq:NN \__gotham_framesubtitle_format:n \text_lowercase:n
+ \PackageWarning{ gotham } { Be~aware~that~format~framesubtitle=lower~can~lead~to~problems. }
+ },
+ format~framesubtitle / upper .code:n =
+ {
+ \let\gotham@framesubtitleformat \text_uppercase:n %\uppercase
+ % \cs_set_eq:NN \__gotham_framesubtitle_format:n \text_uppercase:n
+ \PackageWarning{ gotham } { Be~aware~that~format~framesubtitle=upper~can~lead~to~problems. }
+ },
+ format~framesubtitle / titlecase .code:n =
+ {
+ \let\gotham@framesubtitleformat \text_titlecase_all:n %\Maketitlecase
+ % \cs_set_eq:NN \__gotham_framesubtitle_format:n \text_titlecase_all:n %\Maketitlecase
+ \PackageWarning{ gotham } { Be~aware~that~format~framesubtitle=titlecase~can~lead~to~problems. }
+ },
+ format~framesubtitle / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'\l_keys_value_tl'~is~unknown~for~the~(known)~option~'\l_keys_key_tl',~so~being~ignored. }{helping~message: format~framesubtitle / unknown} },
+}
+\keys_define:nn { gotham / font }
+{
+ % shape framesubtitle
+ shape~framesubtitle .choice:,
+ shape~framesubtitle .usage:n = { general },
+ shape~framesubtitle .default:n = { regular },
+ shape~framesubtitle / regular .code:n =
+ {
+ \setbeamerfont{framesubtitle}{shape=\normalfont}
+ },
+ shape~framesubtitle / smallcaps .code:n =
+ {
+ \setbeamerfont{framesubtitle}{shape=\scshape}
+ },
+ shape~framesubtitle / italic .code:n =
+ {
+ \setbeamerfont{framesubtitle}{shape=\itshape}
+ },
+ shape~framesubtitle / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'\l_keys_value_tl'~is~unknown~for~the~(known)~option~'\l_keys_key_tl',~so~being~ignored. }{helping~message: shape~framesubtitle / unknown} },
+}
+
+\keys_define:nn { gotham / font }
+{
+ % format part
+ format~part .choice:,
+ format~part .usage:n = { general },
+ format~part .default:n = { regular },
+ format~part / regular .code:n =
+ {
+ \let\gotham@parttitleformat\@empty
+ % \cs_set_eq:NN \__gotham_part_title_format:n \text_titlecase:n
+ },
+ format~part / lower .code:n =
+ {
+ \let\gotham@parttitleformat \text_lowercase:n %\lowercase
+ % \cs_set_eq:NN \__gotham_part_title_format:n \text_lowercase:n
+ \PackageWarning{ gotham } { Be~aware~that~format~part=lower~can~lead~to~problems. }
+ },
+ format~part / upper .code:n =
+ {
+ \let\gotham@parttitleformat \text_uppercase:n %\uppercase
+ % \cs_set_eq:NN \__gotham_part_title_format:n \text_uppercase:n
+ \PackageWarning{ gotham } { Be~aware~that~format~part=upper~can~lead~to~problems. }
+ },
+ format~part / titlecase .code:n =
+ {
+ \let\gotham@parttitleformat\text_titlecase_all:n %\Maketitlecase
+ % \cs_set_eq:NN \__gotham_part_title_format:n \text_titlecase:n
+ \PackageWarning{ gotham } { Be~aware~that~format~part=titlecase~can~lead~to~problems. }
+ },
+ format~part / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'\l_keys_value_tl'~is~unknown~for~the~(known)~option~'\l_keys_key_tl',~so~being~ignored. }{helping~message: format~part / unknown} },
+}
+\keys_define:nn { gotham / font }
+{
+ % shape part
+ shape~part .choice:,
+ shape~part .usage:n = { general },
+ shape~part .default:n = { regular },
+ shape~part / regular .code:n =
+ {
+ \setbeamerfont{part~title}{shape=\normalfont}
+ },
+ shape~part / smallcaps .code:n =
+ {
+ \setbeamerfont{part~title}{shape=\scshape}
+ },
+ shape~part / italic .code:n =
+ {
+ \setbeamerfont{part~title}{shape=\itshape}
+ },
+ shape~part / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'\l_keys_value_tl'~is~unknown~for~the~(known)~option~'\l_keys_key_tl',~so~being~ignored. }{helping~message: shape~part / unknown} },
+}
+
+\keys_define:nn { gotham / font }
+{
+ % format section
+ format~section .choice:,
+ format~section .usage:n = { general },
+ format~section .default:n = { regular },
+ format~section / regular .code:n =
+ {
+ \let\gotham@sectiontitleformat\@empty
+ % \cs_set_eq:NN \__gotham_section_title_format:n \__gotham_unchanged:n
+ },
+ format~section / lower .code:n =
+ {
+ \let\gotham@sectiontitleformat \text_lowercase:n %\lowercase
+ % \cs_set_eq:NN \__gotham_section_title_format:n \text_lowercase:n
+ \PackageWarning{ gotham } { Be~aware~that~format~section=lower~can~lead~to~problems. }
+ },
+ format~section / upper .code:n =
+ {
+ \let\gotham@sectiontitleformat \text_uppercase:n %\uppercase
+ % \cs_set_eq:NN \__gotham_section_title_format:n \text_uppercase:n
+ \PackageWarning{ gotham } { Be~aware~that~format~section=upper~can~lead~to~problems. }
+ },
+ format~section / titlecase .code:n =
+ {
+ \let\gotham@sectiontitleformat \text_titlecase_all:n %\Maketitlecase
+ % \cs_set_eq:NN \__gotham_section_title_format:n \text_titlecase_all:n
+ \PackageWarning{ gotham } { Be~aware~that~format~section=titlecase~can~lead~to~problems. }
+ },
+ format~section / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'\l_keys_value_tl'~is~unknown~for~the~(known)~option~'\l_keys_key_tl',~so~being~ignored. }{helping~message: format~section / unknown} },
+}
+\keys_define:nn { gotham / font }
+{
+ % shape section
+ shape~section .choice:,
+ shape~section .usage:n = { general },
+ shape~section .default:n = { regular },
+ shape~section / regular .code:n =
+ {
+ \setbeamerfont{section~title}{shape=\normalfont}
+ },
+ shape~section / smallcaps .code:n =
+ {
+ \setbeamerfont{section~title}{shape=\scshape}
+ },
+ shape~section / italic .code:n =
+ {
+ \setbeamerfont{section~title}{shape=\itshape}
+ },
+ shape~section / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'\l_keys_value_tl'~is~unknown~for~the~(known)~option~'\l_keys_key_tl',~so~being~ignored. }{helping~message: shape~section / unknown} },
+}
+
+\keys_define:nn { gotham / font }
+{
+ % format subsection
+ format~subsection .choice:,
+ format~subsection .usage:n = { general },
+ format~subsection .default:n = { regular },
+ format~subsection / regular .code:n =
+ {
+ \let\gotham@subsectiontitleformat\@empty
+ % \cs_set_eq:NN \__gotham_subsection_title_format:n \__gotham_unchanged:n
+ },
+ format~subsection / lower .code:n =
+ {
+ \let\gotham@subsectiontitleformat \text_lowercase:n %\lowercase
+ % \cs_set_eq:NN \__gotham_subsection_title_format:n \text_lowercase:n
+ \PackageWarning{ gotham } { Be~aware~that~format~subsection=lower~can~lead~to~problems. }
+ },
+ format~subsection / upper .code:n =
+ {
+ \let\gotham@subsectiontitleformat \text_uppercase:n %\uppercase
+ % \cs_set_eq:NN \__gotham_subsection_title_format:n \text_uppercase:n
+ \PackageWarning{ gotham } { Be~aware~that~format~subsection=upper~can~lead~to~problems. }
+ },
+ format~subsection / titlecase .code:n =
+ {
+ \let\gotham@subsectiontitleformat\text_titlecase_all:n %\Maketitlecase
+ % \cs_set_eq:NN \__gotham_subsection_title_format:n \text_titlecase_all:n
+ \PackageWarning{ gotham } { Be~aware~that~format~subsection=titlecase~can~lead~to~problems. }
+ },
+ format~subsection / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'\l_keys_value_tl'~is~unknown~for~the~(known)~option~'\l_keys_key_tl',~so~being~ignored. }{helping~message: format~subsection / unknown} },
+}
+\keys_define:nn { gotham / font }
+{
+ % shape subsection
+ shape~subsection .choice:,
+ shape~subsection .usage:n = { general },
+ shape~subsection .default:n = { regular },
+ shape~subsection / regular .code:n =
+ {
+ \setbeamerfont{subsection~title}{shape=\normalfont}
+ },
+ shape~subsection / smallcaps .code:n =
+ {
+ \setbeamerfont{subsection~title}{shape=\scshape}
+ },
+ shape~subsection / italic .code:n =
+ {
+ \setbeamerfont{subsection~title}{shape=\itshape}
+ },
+ shape~subsection / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'\l_keys_value_tl'~is~unknown~for~the~(known)~option~'\l_keys_key_tl',~so~being~ignored. }{helping~message: shape~subsection / unknown} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{Default font keys}
+% Apply default key options.
+% \UnitTested
+% \TestFiles{gotham-test-035}
+% \begin{macrocode}
+% when no value is given, default is called.
+\keys_set:nn { gotham / font } {
+ format~title, shape~title,
+ format~subtitle, shape~subtitle,
+ format~frametitle, shape~frametitle,
+ format~framesubtitle, shape~framesubtitle,
+ format~part, shape~part,
+ format~section, shape~section,
+ format~subsection, shape~subsection,
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{Process font keys}
+% Process package options.
+% \UnitTested
+% \TestFiles{gotham-test-035}
+% \begin{macrocode}
+\ProcessKeyOptions[ gotham / font ]
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+%
+% \begin{implementation}
+% \begin{macrocode}
+%\endinput
+%</font>
+% \end{macrocode}
+% \end{implementation}
+%
+%
+% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+%
+%\begin{implementation}
+% \begin{macrocode}
+%<*color>
+\ProvidesExplPackage{beamercolorthemegotham}{2024/09/20}{1.1.0.b}{Gotham color theme}
+\RequirePackage{expl3}
+\RequirePackage{xparse}
+\RequirePackage{xcolor}
+% \end{macrocode}
+% \end{implementation}
+%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%% COLOR %%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \begin{implementation}
+% \begin{variable}{\definecolor[named]{gAnthracite}, colors definition}
+% Definition of the Gotham colors.
+% \begin{macrocode}
+\definecolor[named]{gLightOrange}{HTML}{EB811B}
+\definecolor[named]{gLightGreen}{HTML}{14B03D}
+\definecolor[named]{gDeepBlue}{RGB}{42, 42, 255}
+\definecolor[named]{gDeepYellOr}{RGB}{255, 204, 0}
+\definecolor[named]{gAnthracite}{HTML}{2d3e50}
+\definecolor[named]{gLightTeal}{RGB}{172, 195, 210}
+\definecolor[named]{gPaleYell}{RGB}{255, 255, 240}
+\definecolor[named]{gDarkBlack}{gray}{0.1}
+\definecolor[named]{gDarkGrey}{gray}{0.25}
+\definecolor[named]{gMidGrey}{gray}{0.5}
+\definecolor[named]{gLightGrey}{gray}{0.9}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{variable}{\colorlet{colorPale}, set gotham palette colors}
+% \begin{syntax}
+% \cs{colorlet} \marg{colorPale} \marg{gPaleYell}
+% \cs{colorlet} \marg{colorDark} \marg{gDarkBlack}
+% \cs{colorlet} \marg{colorA} \marg{gAnthracite}
+% \cs{colorlet} \marg{colorAreversed} \marg{gLightTeal}
+% \cs{colorlet} \marg{colorB} \marg{gMidGrey}
+% \cs{colorlet} \marg{colorC} \marg{gDeepYellOr}
+% \cs{colorlet} \marg{colorD} \marg{gLightOrange}
+% \cs{colorlet} \marg{colorE} \marg{gLightGreen}
+% \end{syntax}
+% Setup the colors use for presentations:
+% \begin{itemize}
+% \item |colorPale| is used for BG in light mode
+% \item |colorDark| is used for FG in light mode
+% \item |colorA| is used for frametitle and standout BG in light mode
+% \item |colorAreversed| is used for frametitle and standout BG in dark mode
+% \item |colorB| is used for progress bar and blocks BG
+% \item |colorC| is used for progress bar FG
+% \item |colorD| is used for alert FG/BG depending on the block mode
+% \item |colorE| is used for example FG/BG depending on the block mode
+% \end{itemize}
+% \end{variable}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{variable}{\colorlet{colorPale}, set gotham palette colors}
+% A set Gotham palette: a list of color variables easily adapted.
+% \begin{macrocode}
+% Define the color palette
+\@ifundefined{\string\color@colorAreversed}{
+ % default colorset.
+ \colorlet{colorPale}{gPaleYell} % BG in light/normal mode
+ \colorlet{colorDark}{gDarkBlack} % FG in light/normal mode
+ \colorlet{colorA}{gAnthracite} % frametitle, standin.out,
+ \colorlet{colorAreversed}{gLightTeal} % frametitle, standin.in,
+ \colorlet{colorB}{gMidGrey} % gray BG : progress bar, blocks
+ \colorlet{colorC}{gDeepYellOr} % progress bar
+ \colorlet{colorD}{gLightOrange} % alert
+ \colorlet{colorE}{gLightGreen} % example
+}{
+ % else nothing to do, colors are already defined.
+}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\__gotham_color_set_style_anthracite:}
+% Command to activate anthracite colorset.
+% \TestFiles{gotham-test-1037}
+% \begin{macrocode}
+\cs_new_protected:Nn \__gotham_color_set_style_anthracite:{
+ \colorlet{colorPale}{gPaleYell} % BG in light/normal mode
+ \colorlet{colorDark}{gDarkBlack} % FG in light/normal mode
+ \colorlet{colorA}{gAnthracite} % frametitle, standin.out,
+ \colorlet{colorAreversed}{gLightTeal} % frametitle, standin.in,
+ \colorlet{colorB}{gMidGrey} % gray BG : progress bar, blocks
+ \colorlet{colorC}{gDeepYellOr} % progress bar
+ \colorlet{colorD}{gLightOrange} % alert
+ \colorlet{colorE}{gLightGreen} % example
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\__gotham_color_set_style_red:}
+% Command to activate red colorset.
+% \TestFiles{gotham-test-1037}
+% \begin{macrocode}
+\cs_new_protected:Nn \__gotham_color_set_style_red:{
+ \colorlet{colorPale}{gPaleYell} % BG in light/normal mode
+ \colorlet{colorDark}{gDarkBlack} % FG in light/normal mode
+ \colorlet{colorA}{red} % frametitle, standin.out,
+ \colorlet{colorAreversed}{gLightTeal} % frametitle, standin.in,
+ \colorlet{colorB}{gMidGrey} % gray BG : progress bar, blocks
+ \colorlet{colorC}{gDeepYellOr} % progress bar
+ \colorlet{colorD}{gLightOrange} % alert
+ \colorlet{colorE}{gLightGreen} % example
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{variable}{\colorlet{colorBG}{colorPale}, set functional colors}
+% \begin{syntax}
+% \cs{colorlet} \marg{colorBG} \marg{colorPale}
+% \cs{colorlet} \marg{colorFG} \marg{colorDark}
+% \cs{colorlet} \marg{colorFrametitle} \marg{colorA}
+% \cs{colorlet} \marg{colorStandout} \marg{colorA}
+% \cs{colorlet} \marg{colorStandin} \marg{colorA}
+% \cs{colorlet} \marg{colorTitlepage} \marg{colorA}
+% \cs{colorlet} \marg{colorFiligrane} \marg{colorB}
+% \cs{colorlet} \marg{colorBackElement} \marg{colorB}
+% \cs{colorlet} \marg{colorProgBar} \marg{colorC}
+% \cs{colorlet} \marg{colorAlert} \marg{colorD}
+% \cs{colorlet} \marg{colorExample} \marg{colorE}
+% \end{syntax}
+% Setup the default color aliases used in the presentation theme definitions.
+% These aliases are partly redefined by dark/light/transparent modes.
+% \end{variable}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{variable}{\colorlet{colorBG}{colorPale}, set functional colors}
+% A set of variable easily adapted.
+% \begin{macrocode}
+% Define the color palette
+\colorlet{colorBG}{colorPale}
+\colorlet{colorFG}{colorDark}
+\colorlet{colorFrametitle}{colorA}
+\colorlet{colorStandout}{colorA}
+\colorlet{colorStandin}{colorPale}
+\colorlet{colorTitlepage}{colorA}
+\colorlet{colorFiligrane}{colorB}
+\colorlet{colorBackElement}{colorB}
+\colorlet{colorProgBar}{colorC}
+\colorlet{colorAlert}{colorD}
+\colorlet{colorExample}{colorE}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{variable}{\providebool{darkBG}, \providebool{transparentBG}}
+% Variable to track color setup.
+% \begin{macrocode}
+% \providebool{reversedColor}
+% \boolfalse{reversedColor}
+\providebool{darkBG}
+\boolfalse{darkBG}
+\providebool{transparentBG}
+\booltrue{transparentBG}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\__gotham_color_set_darkBG:}
+% Command to activate dark mode
+% \TestFiles{gotham-test-037}
+% \begin{macrocode}
+\cs_new_protected:Nn \__gotham_color_set_darkBG:{
+ \setbeamercolor{normal~text}{%
+ fg=colorBG,
+ bg=colorFG,
+ }%
+ \usebeamercolor[fg]{normal~text}%
+ \booltrue{darkBG}%
+ \boolfalse{transparentBG}
+ \colorlet{colorFrametitle}{colorAreversed}
+ \colorlet{colorStandout}{colorAreversed}
+ \colorlet{colorStandin}{colorFG}
+ \colorlet{colorTitlepage}{colorAreversed}
+ % dark
+ \setbeamercolor{palette~primary}{% reversed color compared to normal text
+ use=normal~text,
+ fg=normal~text.bg,
+ bg=normal~text.fg
+ }
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\__gotham_color_set_lightBG:}
+% Command to activate light background.
+% \TestFiles{gotham-test-037}
+% \begin{macrocode}
+\cs_new_protected:Nn \__gotham_color_set_lightBG:{
+ \setbeamercolor{normal~text}{
+ fg=colorFG,
+ bg=colorBG
+ }
+ \usebeamercolor[fg]{normal~text}
+ \boolfalse{darkBG}
+ \boolfalse{transparentBG}
+ \colorlet{colorFrametitle}{colorA}
+ \colorlet{colorStandout}{colorA}
+ \colorlet{colorStandin}{colorBG}
+ \colorlet{colorTitlepage}{colorA}
+ % light
+ \setbeamercolor{palette~primary}{
+ % reversed color compared to normal text
+ use=normal~text,
+ fg=normal~text.bg,
+ bg=normal~text.fg
+ }
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\__gotham_color_set_transparentBG:}
+% Command to activate transparent background.
+% \TestFiles{gotham-test-037}
+% \begin{macrocode}
+% \newcommand{\gotham@colors@transparent}{
+\cs_new_protected:Nn \__gotham_color_set_transparentBG:{
+ \setbeamercolor{normal~text}{
+ fg=colorFG,
+ bg=,
+ }
+ \usebeamercolor[fg]{normal~text}
+ \boolfalse{darkBG}
+ \booltrue{transparentBG}
+ \colorlet{colorFrametitle}{colorA}
+ \colorlet{colorStandout}{colorA}
+ {\usebeamercolor[bg]{normal~text}\colorlet{colorStandin}{bg}}% this is not working because the colorlet is not kept outside of the {} environment...
+ % \usebeamercolor{normal~text} % reset % NOT working neither
+ \colorlet{colorStandin}{colorBG} % since the two previous lines are not working, let define it like light-bg
+ \colorlet{colorTitlepage}{colorA}
+ % like light background.
+ \setbeamercolor{palette~primary}{
+ % reversed color compared to normal text
+ use=normal~text,
+ fg=colorBG,
+ bg=normal~text.fg
+ }
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\__gotham_color_set_transparent_block:}
+% Command to activate transparent block.
+% \TestFiles{gotham-test-037}
+% \begin{macrocode}
+\cs_new_protected:Nn \__gotham_color_set_transparent_block:{
+ \setbeamercolor{block~title}{
+ use=normal~text,
+ fg=normal~text.fg,
+ bg=
+ }
+ \setbeamercolor{block~body}{
+ bg=
+ }
+ \setbeamercolor{alerted~text}{
+ fg=colorAlert
+ }
+ \setbeamercolor{example~text}{
+ fg=colorExample
+ }
+ \setbeamercolor{block~title~example}{
+ use={block~title, example~text},
+ bg=block~title.bg,
+ fg=example~text.fg
+ }
+ \setbeamercolor{block~title~alerted}{
+ use={block~title, alerted~text},
+ bg=block~title.bg,
+ fg=alerted~text.fg
+ }
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\__gotham_color_set_fill_block:}
+% Command to activate fill block.
+% \TestFiles{gotham-test-037}
+% \begin{macrocode}
+\cs_new_protected:Nn \__gotham_color_set_fill_block:{
+ \setbeamercolor{block~title}{
+ fg=colorBackElement!10!normal~text.fg,
+ bg=colorBackElement!135!fg
+ }
+ \setbeamercolor{block~body}{
+ use={block~title, normal~text},
+ bg=block~title.bg!50!normal~text.bg
+ }
+ \setbeamercolor{alerted~text}{
+ fg=colorAlert
+ }
+ \setbeamercolor{example~text}{
+ fg=colorExample
+ }
+ \setbeamercolor{block~title~example}{
+ use={block~title, example~text},
+ bg=block~title.bg,
+ fg=example~text.fg
+ }
+ \setbeamercolor{block~title~alerted}{
+ use={block~title, alerted~text},
+ bg=block~title.bg,
+ fg=alerted~text.fg
+ }
+}% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\__gotham_color_set_native_block:}
+% Command to activate native block.
+% \TestFiles{gotham-test-037}
+% \begin{macrocode}
+\cs_new_protected:Nn \__gotham_color_set_native_block:{
+ \setbeamercolor{block~title}{
+ fg=colorPale,
+ bg=colorBackElement!90!fg
+ }
+ \setbeamercolor{block~body}{
+ use={block~title, normal~text},
+ bg=block~title.bg!50!normal~text.bg
+ }
+ \setbeamercolor{alerted~text}{
+ fg=colorAlert
+ }
+ % With native block, we have to let alerted text with a visible color (not pale) to keep alert visible (cf test-1005).
+ % So, we have to create an extra color: alertedBlock~text.
+ \setbeamercolor{alertedBlock~text}{
+ fg=colorPale
+ }
+ \setbeamercolor{example~text}{
+ fg=colorPale
+ }
+ \setbeamercolor{block~title~alerted}{
+ use={block~title, alertedBlock~text},
+ bg=colorAlert,
+ fg=alertedBlock~text.fg
+ }
+ \setbeamercolor{block~title~example}{
+ use={block~title, example~text},
+ bg=colorExample,
+ fg=example~text.fg
+ }
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{Gotham color adaptation}
+% Set colors variable from Gotham color setup that needs specific adaptation, i.e. |structure| as mentioned in Beamer documentation and |progress bar| since it is a new feature.
+% \UnitTested
+% \TestFiles{gotham-test-037}
+% \begin{macrocode}
+\setbeamercolor{structure}{use=normal~text, fg=normal~text.fg}
+\setbeamercolor{progress~bar}{
+ use=alerted~text,
+ fg=colorProgBar,
+ bg=alerted~text.fg!50!black!30
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{Usual color env}
+% Set colors variable from Gotham color setup.
+% The titles and structural elements (e.g. |itemize| bullets) are set in the same color as |normal text|.
+% This would ideally done by setting |normal text| as a parent style, which we do to set |titlelike|, but this doesn't work for |structure| as its foreground is set explicitly in |beamercolorthemedefault.sty|.
+% \UnitTested
+% \TestFiles{gotham-test-037}
+% \begin{macrocode}
+\setbeamercolor{titlelike}{use=normal~text, parent=normal~text}
+\setbeamercolor{author}{use=normal~text, parent=normal~text}
+\setbeamercolor{date}{use=normal~text, parent=normal~text}
+\setbeamercolor{institute}{use=normal~text, parent=normal~text}
+\setbeamercolor{frametitle}{
+ use=palette~primary,
+ parent=palette~primary,
+ bg=colorFrametitle
+}
+% The Gotham inner or outer themes optionally display progress bars in various locations.
+% Their color is set by |progress bar| but the two different kinds can be customized separately.
+% The horizontal rule on the title page is also set based on the progress bar color and can be customized with |title separator|.
+\setbeamercolor{title~separator}{
+ use=progress~bar,
+ parent=progress~bar
+}
+\setbeamercolor{progress~bar~in~head/foot}{%
+ use=progress~bar,
+ parent=progress~bar
+}
+\setbeamercolor{progress~bar~in~part~page}{
+ use=progress~bar,
+ parent=progress~bar
+}
+\setbeamercolor{progress~bar~in~section~page}{
+ use=progress~bar,
+ parent=progress~bar
+}
+\setbeamercolor{progress~bar~in~splitvert}{
+ use=progress~bar,
+ parent=progress~bar
+}
+% \setbeamercolor{progress~bar~in~subsection~page}{
+% use=progress~bar,
+% parent=progress~bar
+% }
+% \setbeamercolor{progress~bar~in~subsubsection~page}{
+% use=progress~bar,
+% parent=progress~bar
+% }
+%
+% Blocks
+\setbeamercolor{block~body~alerted}{use=block~body, parent=block~body}
+\setbeamercolor{block~body~example}{use=block~body, parent=block~body}
+%
+% Footnote
+\setbeamercolor{footnote}{fg=normal~text.fg!90}
+\setbeamercolor{footnote~mark}{fg=.}
+%
+% Bibliography
+%
+% We also reset the bibliography colors in order to pick up the surrounding colors at the time of use.
+% This prevents us having to set the correct color in normal and standout mode.
+% \setbeamercolor{bibliography entry author}{fg=, bg=}
+% \setbeamercolor{bibliography entry title}{fg=, bg=}
+% \setbeamercolor{bibliography entry location}{fg=, bg=}
+% \setbeamercolor{bibliography entry note}{fg=, bg=}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{new color environments}
+% Set up colors for the the new beamer environment used by the theme.
+% \UnitTested
+% \TestFiles{gotham-test-037}
+% \begin{macrocode}
+\setbeamercolor{frametitleSection}{use=primary~palette, bg=, fg=primary~palette.bg}
+\setbeamercolor{standout}{use=primary~palette, bg=colorStandout, fg=primary~palette.bg}
+\setbeamercolor{standin}{use=normal~text, bg=colorStandin, fg=normal~text.fg}
+
+\setbeamercolor{section~in~toc}{use=normal~text, parent=normal~text,}
+\setbeamercolor{subsection~in~toc}{use=normal~text, parent=normal~text,}
+\setbeamercolor{subsubsection~in~toc}{use=normal~text, parent=normal~text,}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\usecolortheme}
+% \begin{syntax}
+% \cs{usecolortheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{background} = \oarg{\defopt{transparent} \textbar light \textbar dark}
+% \meta{block} = \oarg{\defopt{native} \textbar fill \textbar transparent}
+% \meta{colorset} = \oarg{\defopt{anthracite} \textbar red }
+% \end{syntax}
+% The 'package' (usecolortheme) options can control color mode (dark, ligh or transparent background) and the block (native or fill or transparent).
+% Block environments such as |theorem| and |example| have no background color by default.
+% The option |block=fill| sets a background color based on the background and foreground of |normal text|.
+% The option |block=transparent| reverts the block environments to an empty background, which can be useful if changing colors mid-presentation.
+% The option |colorset=red| changes the colorset used to define a color theme.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{color key -- interface}
+% Controls the background mode (dark, ligh or transparent background) and the block (fill or transparent) and colorset (anthracite, red, blue, green, etc).
+% \UnitTested
+% \TestFiles{gotham-test-037}
+% \begin{macrocode}
+\keys_define:nn { gotham / color }
+{
+ % block
+ block .choice:,
+ block .usage:n = { general },
+ block .default:n = { native },
+ block / native .code:n = { \__gotham_color_set_native_block: },
+ block / transparent .code:n = { \__gotham_color_set_transparent_block: },
+ block / fill .code:n = { \__gotham_color_set_fill_block: },
+ block / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'\l_keys_value_tl'~is~unknown~for~the~(known)~option~'\l_keys_key_tl',~so~being~ignored. }{helping~message: block / unknown} },
+}
+
+\keys_define:nn { gotham / color }
+{
+ % background
+ background .choice:,
+ background .usage:n = { general },
+ background .default:n = { transparent },
+ background / transparent .code:n = { \__gotham_color_set_transparentBG: },
+ background / light .code:n = { \__gotham_color_set_lightBG: },
+ background / dark .code:n = { \__gotham_color_set_darkBG: },
+ background / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'\l_keys_value_tl'~is~unknown~for~the~(known)~option~'\l_keys_key_tl',~so~being~ignored. }{helping~message: background / unknown} },
+}
+
+\keys_define:nn { gotham / color }
+{
+ % colorset
+ colorset .choice:,
+ colorset .usage:n = { general },
+ colorset .default:n = { anthracite },
+ colorset / anthracite .code:n = { \__gotham_color_set_style_anthracite: },
+ colorset / red .code:n = { \__gotham_color_set_style_red: },
+ % colorset / blue .code:n = { },
+ % colorset / green .code:n = { },
+ % colorset / orange .code:n = { },
+ % colorset / teal .code:n = { },
+ colorset / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'\l_keys_value_tl'~is~unknown~for~the~(known)~option~'\l_keys_key_tl',~so~being~ignored. }{helping~message: colorset / unknown} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{Default color keys}
+% Apply default key options.
+% \UnitTested
+% \TestFiles{gotham-test-037}
+% \begin{macrocode}
+% when no value is given, default is called.
+\keys_set:nn { gotham / color } { background, block, colorset }
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{Process color keys}
+% Process package options.
+% \UnitTested
+% \TestFiles{gotham-test-037}
+% \begin{macrocode}
+\ProcessKeyOptions[ gotham / color ]
+\mode<all>
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+%
+%
+% \begin{implementation}
+% \begin{macrocode}
+%\endinput
+%</color>
+% \end{macrocode}
+% \end{implementation}
+%
+% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+%
+%
+%\begin{implementation}
+% \begin{macrocode}
+%<*inner>
+\ProvidesExplPackage{beamerinnerthemegotham}{2024/09/20}{1.1.0.b}{gotham inner theme}
+\RequirePackage{expl3}
+\RequirePackage{xparse}
+\RequirePackage{calc}
+\RequirePackage{tikz}
+% \end{macrocode}
+% \end{implementation}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%% INNER %%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \begin{implementation}
+% A |beamer| inner theme dictates the style of the frame elements traditionally set in the ``body'' of each slide. These include:
+% \begin{itemize}
+% \item title page;
+% \item backgrounds;
+% \item standin/out;
+% \item part, section etc, pages;
+% \item table of content pages (including for sections...);
+% \item environement elements: \begin{itemize}
+% \item itemize, enumerate, and description environments;
+% \item block environments including theorems and proofs;
+% \item figures and tables; and
+% \item footnotes and plain text.
+% \end{itemize}
+% \end{itemize}
+% \end{implementation}
+%
+%
+
+%%% Titlepage %%%
+%%%%%%%%%%%%%%%%%%%
+%
+% \begin{implementation}
+% \begin{macro}{Compitibility mode for colors}
+% FROM COLOR THEME: useful to provide this recall when the inner theme is loaded without the color theme.
+% \begin{macrocode}
+\@ifundefined{\string\color@colorProgBar}{
+ \providebool{darkBG} \boolfalse{darkBG}
+ \providebool{transparentBG} \booltrue{transparentBG}
+ \colorlet{colorBG}{white}
+ \colorlet{colorFG}{black}
+ \colorlet{colorFrametitle}{purple}
+ \colorlet{colorStandout}{purple}
+ \colorlet{colorStandin}{purple}
+ \colorlet{colorTitlepage}{purple}
+ \colorlet{colorFiligrane}{gray}
+ \colorlet{colorBackElement}{gray}
+ \colorlet{colorProgBar}{orange}
+ \colorlet{colorAlert}{red}
+ \colorlet{colorExample}{green}
+ \colorlet{colorFrametitle}{purple}
+ \colorlet{colorTitlepage}{purple}
+ \setbeamercolor{progress~bar}{
+ use=alerted~text,
+ fg=colorProgBar,
+ bg=alerted~text.fg!50!black!30
+ }
+ \setbeamercolor{progress~bar~in~head/foot}{%
+ use=progress~bar,
+ parent=progress~bar
+ }
+ \setbeamercolor{progress~bar~in~part~page}{
+ use=progress~bar,
+ parent=progress~bar
+ }
+ \setbeamercolor{progress~bar~in~section~page}{
+ use=progress~bar,
+ parent=progress~bar
+ }
+ \setbeamercolor{progress~bar~in~splitvert}{
+ use=progress~bar,
+ parent=progress~bar
+ }
+ \setbeamercolor{frametitleSection}{use=primary~palette, bg=, fg=primary~palette.bg}
+ \setbeamercolor{standout}{use=primary~palette, bg=colorStandout, fg=primary~palette.bg}
+ \setbeamercolor{standin}{use=normal~text, bg=colorStandin, fg=normal~text.fg}
+ \setbeamercolor{section~in~toc}{use=normal~text, parent=normal~text,}
+ \setbeamercolor{subsection~in~toc}{use=normal~text, parent=normal~text,}
+ \setbeamercolor{subsubsection~in~toc}{use=normal~text, parent=normal~text,}
+}{
+ % else the colors are defined: this is fine.
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\maketitle,\titlepage}
+% Normal people should use |\maketitle| or |\titlepage| instead of using the |title page| beamer template directly.
+% Beamer already defines these macros, but we patch them here to make the title page |[plain]| by default, remove |\@thanks|, and ensure the title frame number doesn't count.
+% Inserts the title frame, or causes the current frame to use the |title page| template.
+% \UnitTested
+% \TestFiles{gotham-test-038}
+% \begin{macrocode}
+\def\maketitle{
+ \ifbeamer@inframe
+ \titlepage
+ \else
+ \frame[plain, noframenumbering]{\titlepage}
+ \fi
+}
+\def\titlepage{
+ \usebeamertemplate{title~page}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{title~graphic}{gotham}}
+% Definition of elements templates that will be used in titlepage.
+% \UnitTested
+% \TestFiles{gotham-test-038}
+% \begin{macrocode}
+\defbeamertemplate*{title~graphic}{gotham}{
+ % \vbox to 0pt {% %%%%% MODIFIED !
+ \vbox{
+ % \vspace*{2em} %%%%% COMMENT ADDED !
+ \inserttitlegraphic
+ }
+ \nointerlineskip
+}
+\defbeamertemplate*{title}{gotham}{
+ %\raggedright% %%%%% COMMENT ADDED !
+ \linespread{1.0}
+ \inserttitle
+ \par
+ \vspace*{0.5em}
+}
+\defbeamertemplate*{subtitle}{gotham}{
+ %\raggedright% %%%%% COMMENT ADDED !
+ \insertsubtitle
+ \par
+ \vspace*{0.5em}
+}
+\defbeamertemplate*{author}{gotham}{
+ \vspace*{1.em}
+ \insertauthor
+ \par
+ \vspace*{0.25em}
+}
+\defbeamertemplate*{date}{gotham}{
+ \insertdate
+ \par
+}
+\defbeamertemplate*{institute}{gotham}{
+ \vspace*{3mm}
+ \insertinstitute
+ \par
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{variable}{\l__gotham_titleseparator_width_dim, \l__gotham_titleseparator_height_dim, \l__gotham_title_width_dim, \l__gotham_subtitle_width_dim, \l__gotham_title_max_width_dim}
+% Define the new lengths that will be used for titlepage templates.
+% \begin{macrocode}
+\dim_new:N \l__gotham_titleseparator_width_dim
+\dim_set:Nn \l__gotham_titleseparator_width_dim {\textwidth}
+\dim_new:N \l__gotham_titleseparator_height_dim
+\dim_set:Nn \l__gotham_titleseparator_height_dim {2pt}
+% \newlength{\titlewidth}
+% \newlength{\subtitlewidth}
+% \newlength{\maxwidth}
+\dim_new:N \l__gotham_title_width_dim
+\dim_new:N \l__gotham_subtitle_width_dim
+\dim_new:N \l__gotham_title_max_width_dim
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{variable}{\defbeamertemplate*{title~separator}{gotham}}
+% Define a new template for ``line'' displayed on some titlepage templates.
+% \begin{macrocode}
+\defbeamertemplate*{title~separator}{gotham}{
+ \begin{tikzpicture}
+ % \fill[fg] (0,0) rectangle (\gotham@titleseparator@linewidth, \gotham@titleseparator@lineheight);
+ \fill[fg] (0,0) rectangle
+ (\dim_use:N \l__gotham_titleseparator_width_dim,
+ \dim_use:N \l__gotham_titleseparator_height_dim);
+ \end{tikzpicture}
+ \par
+}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{variable}{\gothamtitlepagelogo}
+% The command to insert the institute logo on title page.
+% This command is left empty by default, to be redefined by users
+% \end{variable}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{variable}{\gothamtitlepagelogo}
+% \UnitTested
+% \TestFiles{gotham-test-038}
+% \begin{macrocode}
+\providecommand{\gothamtitlepagelogo}{}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{variable}{\gothamtitlepagebg}
+% The command to insert the background title page
+% This command is left empty by default, to be redefined by users
+% \end{variable}
+% \end{documentation}
+%%%%%
+% \begin{implementation}
+% \begin{variable}{\gothamtitlepagebg}
+% \UnitTested
+% \TestFiles{gotham-test-038}
+% \begin{macrocode}
+\providecommand{\gothamtitlepagebg}{}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{title~page}{gotham~normal}}
+% Template for the normal gotham title page.
+% Each element is only typeset if it is defined by the user.
+% If |\subtitle| is empty, for example, it won't leave a blank space on the title slide.
+% \UnitTested
+% \TestFiles{gotham-test-038}
+% \begin{macrocode}
+
+% Beamer's definition of |\insertauthor| is always nonempty, so we have to test another macro initialized by |\author{...}| to see if the user has defined an author.
+% This solution was suggested by Sam Carter in an answer to \href{https://tex.stackexchange.com/questions/241306/}{this Stack Exchange question}.
+
+\defbeamertemplate{title~page}{gotham~normal}{
+ \ifx\insertframetitle\@empty\else\vspace*{-3em}\fi
+ \begin{picture}(0,0)
+ % The text: title, author, institute, etc.
+ \put(-30,-125){\noindent
+ \fcolorbox{normal~text.bg}{normal~text.bg}{
+ \begin{minipage}[b][\paperheight]{\paperwidth}
+ \parbox[c][0pt][c]{0pt}{\gothamtitlepagebg}
+ \centering
+ \vfill
+ \ifx\inserttitle\@empty\else\usebeamertemplate*{title}\fi
+ \ifx\insertsubtitle\@empty\else\usebeamertemplate*{subtitle}\fi
+ \usebeamertemplate*{title~separator}
+ % from above patch
+ \expandafter\ifblank\expandafter{\beamer@andstripped}{
+ % empty author
+ \vspace*{1.em}
+ }{
+ \usebeamertemplate*{author}
+ }
+ % \ifx\insertauthor\empty Empty~Author\else TT \fi
+ \ifx\insertdate\@empty\else\usebeamertemplate*{date}\fi
+ \ifx\insertinstitute\@empty\else{\parbox{0.9\textwidth}{\raggedright\usebeamertemplate*{institute}} }\fi
+ \vfill
+ \vbox{}
+ \end{minipage}
+ }
+ % end third argument of fcolorobx
+ }
+
+ % the institute logo on title page
+ \put(234,-120){
+ \gothamtitlepagelogo
+ }
+
+ % the extra logos on title page (\inserttitlegraphic)
+ \put(-27,-123){
+ \noindent\vbox{
+ \begin{minipage}[b][0.96\paperheight]{0.899\textwidth}
+ \ifx\inserttitlegraphic\@empty\else\usebeamertemplate*{title~graphic}\fi
+ \end{minipage}
+ }
+ }
+ \end{picture}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{title~page}{gotham~reversed}}
+% With a similarly layout to gotham normal, but this template inverses the background and foreground colors compared to the color mode chose (dark, light or transparent).
+% \UnitTested
+% \TestFiles{gotham-test-038}
+% \begin{macrocode}
+\defbeamertemplate{title~page}{gotham~reversed}{
+ \begin{picture}(0,0)
+ % The background picture
+ \put(-28,-128){\gothamtitlepagebg}
+
+ % The text: title, author, institute, etc.
+ \put(-4,-125){\noindent
+ % \fcolorbox{declared-color-frame}{declared-color-background}{text}
+ \ifbool{darkBG}{
+ % Dark true
+ \setbeamercolor{normal~text}{fg=colorFG, }
+ \fcolorbox{colorPale}{colorPale}% reversed
+ }{
+ % Light
+ \setbeamercolor{normal~text}{fg=colorBG, }
+ \fcolorbox{colorTitlepage}{colorTitlepage}% reversed
+ }% end if
+ {
+ % begin third argument of fcolorobx
+ %\fcolorbox{normal~text.fg}{normal~text.fg}{
+ \begin{minipage}[b][\paperheight]{\textwidth}
+ \centering
+ \vfill
+ \ifx\inserttitle\@empty\else\usebeamertemplate*{title}\fi
+ \ifx\insertsubtitle\@empty\else\usebeamertemplate*{subtitle}\fi
+ \usebeamertemplate*{title~separator}
+ \expandafter\ifblank\expandafter{\beamer@andstripped}{
+ % empty author
+ \vspace*{1.em}
+ }{
+ \usebeamertemplate*{author}
+ }
+ \ifx\insertdate\@empty\else\usebeamertemplate*{date}\fi
+ \ifx\insertinstitute\@empty\else{\parbox{0.9\textwidth}{\raggedright\usebeamertemplate*{institute}} }\fi
+ \vfill
+ \vbox{}
+ \end{minipage}
+ }
+ % end third argument of fcolorobx
+ }
+
+ % the institute logo on title page
+ \put(234,-120){
+ \gothamtitlepagelogo
+ }
+
+ % the extra logos on title page (\inserttitlegraphic)
+ \put(-27,-123){
+ \noindent\vbox{
+ \begin{minipage}[b][0.96\paperheight]{0.899\textwidth}
+ \ifx\inserttitlegraphic\@empty\else\usebeamertemplate*{title~graphic}\fi
+ \end{minipage}
+ }
+ }
+ \end{picture}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+% \begin{implementation}
+% \begin{macro}{defbeamertemplate{title~page}{gotham~dividedpic}}
+% This title page template is inspired from \url{https://github.com/LukasPietzschmann/awesome-beamer}
+% \UnitTested
+% \TestFiles{gotham-test-038}
+% \begin{macrocode}
+\defbeamertemplate{title~page}{gotham~dividedpic}{
+ \long\def\tmpEmpty{}
+ \def\titlecontent{\usebeamerfont{title}\usebeamercolor[fg]{title}\inserttitle}
+ \def\subtitlecontent{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle}
+ \settowidth\l__gotham_title_width_dim\titlecontent
+ \settowidth\l__gotham_subtitle_width_dim\subtitlecontent
+ \setlength\l__gotham_title_max_width_dim{\ifdim\l__gotham_title_width_dim>\l__gotham_subtitle_width_dim\l__gotham_title_width_dim\else\l__gotham_subtitle_width_dim\fi}
+ % \thispagestyle{navigation@titlepage}
+ \begin{minipage}{.55\textwidth}
+ \raggedright
+ \titlecontent\\
+ \subtitlecontent\\
+ % \textcolor{accent}{\rule{\ifdim\l__gotham_title_max_width_dim<.55\textwidth\l__gotham_title_max_width_dim\else.55\textwidth\fi}{\smile@linewidth}}\\[2em]
+ \textcolor{colorProgBar}{\rule{\ifdim\l__gotham_title_max_width_dim<.55\textwidth\l__gotham_title_max_width_dim\else.55\textwidth\fi}{\dim_use:N \l__gotham_titleseparator_height_dim}}\\[2em]
+ \usebeamerfont{author}\usebeamercolor[fg]{author}
+ \insertauthor\\
+ % \ifx\insertauthor\empty\else
+ \expandafter\ifblank\expandafter{\beamer@andstripped}{
+ % empty author
+ \vspace*{1.em}
+ }{
+ \usebeamerfont{author}\usebeamercolor[fg]{author}
+ \insertshortauthor
+ \vspace{2em}
+ }
+ % \fi
+ \ifx\insertinstitute\@empty\else{
+ \usebeamertemplate*{institute}\vspace{2em}
+ }\fi
+ \insertdate
+ \end{minipage}
+
+ % \ifdefined\@background
+ \begin{tikzpicture}[remember~picture, overlay]
+ \clip (current~page.south~east)
+ -- (current~page.north~east)
+ -- ++(-5.1, 0)
+ -- ++(-3, -\paperheight)
+ -- cycle;
+
+ \ifx\gothamtitlepagebg\tmpEmpty
+ \fill[
+ % path~fading=title~page~picture~fading,
+ % left~color=\ifbool{darkBG}{colorDark!200}{colorPale!100},
+ right~color=colorTitlepage!100,%\ifbool{darkBG}{colorPale!100}{colorDark!100},
+ % fading~angle=-15,
+ ]
+ (current~page.south~east)
+ rectangle
+ ++(\dimexpr-0.55\paperwidth, \dimexpr\paperheight+1cm);
+ \else
+ \node[
+ anchor=south~east,
+ inner~sep=0,
+ outer~sep=0
+ ] at (current~page.south~east) {
+ % \includegraphics[height=\paperheight]{\@background}
+ \gothamtitlepagebg
+ };
+ \fi
+ \end{tikzpicture}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+% \begin{implementation}
+% \begin{macro}{defbeamertemplate{title~page}{gotham~splitvert}}
+% This title page template is inspired from \url{https://github.com/pcafrica/focus-beamertheme}
+% \UnitTested
+% \TestFiles{gotham-test-038}
+% \begin{macrocode}
+\defbeamertemplate{title~page}{gotham~splitvert}{
+ % \IfEmpty{\insertframetitle}{
+ \ifx\beamer@frametitle\@empty
+ \vspace*{-0.5\paperheight}
+ \else %}{
+ \vspace*{-0.63\paperheight}
+ \fi %}
+ {
+ \usebeamercolor{frametitle}\colorlet{gotham@@tempColor}{bg}%
+ \begin{tikzpicture}[overlay, remember~picture]
+ \fill[color=gotham@@tempColor] (current~page.north~west) rectangle ([shift = {(0, -0.45\paperheight)}] current~page.north~east);
+ \end{tikzpicture}
+ }
+
+ % \vspace*{-1.65\baselineskip}
+ \begin{minipage}[b][0.35\paperheight]{\textwidth}
+ % \vspace{\baselineskip}
+ \usebeamerfont{title}
+ \usebeamercolor[fg]{frametitle}
+ \inserttitle
+ \end{minipage}
+
+ \newline
+ \begin{minipage}[t][0.1\paperheight]{\textwidth}
+ \usebeamerfont{subtitle}
+ \usebeamercolor[fg]{frametitle}
+ \insertsubtitle
+ \end{minipage}
+
+ % Set the title graphic in a zero-height box, so that
+ % the position of other elements is not affected.
+ \ifx\inserttitlegraphic\@empty\else
+ \newline
+ \vspace*{-1.65\baselineskip}
+ % {\vfuzz=9999pt\vbox~to~0pt {
+ {\parbox[c][0pt][c]{\textwidth}{
+ \raggedleft
+ \inserttitlegraphic
+ % \usebeamertemplate*{title~graphic}
+ }}
+ \fi
+
+ % \ifx\insertauthor\empty\else
+ \expandafter\ifblank\expandafter{\beamer@andstripped}{
+ % empty author
+ \vspace*{1.em}
+ }{
+ \newline
+ \begin{minipage}[t]{\textwidth}
+ % \usebeamercolor{normal~text}
+ % \usebeamerfont{author}
+ % \insertauthor
+ \vspace*{-1.5\baselineskip}
+ \usebeamertemplate*{author}
+ \end{minipage}
+ }
+ % \fi
+
+ \ifx\insertinstitute\@empty\else
+ \newline
+ \vspace*{-1.65\baselineskip}
+ \begin{minipage}[t]{\textwidth}
+ % \usebeamerfont{institute}
+ % \insertinstitute
+ \usebeamertemplate*{institute}
+ \end{minipage}
+ \fi
+
+ \ifx\insertdate\@empty\else
+ \newline
+ \begin{minipage}[t]{\textwidth}
+ \vspace*{2.65\baselineskip}
+ % \usebeamerfont{date}
+ % \insertdate
+ \usebeamertemplate*{date}
+ \end{minipage}
+ \vspace*{-3.15\baselineskip}
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+% \begin{documentation}
+% \begin{function}{\__gotham_set_template:nn}
+% \begin{syntax}
+% \cs{__gotham_set_template:nn} \marg{element} \marg{option}
+% \end{syntax}
+% Function that test if a beamertemplate with the given element and option name exists. If it exists then it is set (applied), otherwise an error is raised.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{function}{\__gotham_set_template:nn}
+% \begin{arguments}
+% \item element name (from beamer doc) in other word, the name the template category
+% \item prefined option (from beamer doc)
+% \end{arguments}
+% Function to set a beamertemplate with an option if it exists, otherwise an error is raised.
+% Unfortunatly, (as far as I know) it not possible to test if the element name exists independtly from the prefined option.
+% \TestFiles{gotham-test-038}
+% \begin{macrocode}
+\cs_if_exist:NTF \__gotham_set_template:nn {}{
+ % If it doesn't exist, then create it.
+
+ % Define the command to set template if it exists.
+ \cs_new_protected:Nn \__gotham_set_template:nn
+ {
+ \cs_if_exist:cTF {beamer@@tmpop@#1@#2} {
+ \setbeamertemplate{#1}[#2]
+ }{
+ \PackageError{beamerinnerthemegotham}
+ {The~beamer~template~named~'#1'~with~the~option~'#2'~does~not~exist}
+ {helping~message unknown setbeamertemplate option}
+ }
+ }
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\useinnertheme}
+% \begin{syntax}
+% \cs{useinnertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{title page} = \oarg{\defopt{gotham normal} \textbar gotham splitvert \textbar gotham dividedpic \textbar gotham reversed}
+% \end{syntax}
+% The 'package' (useinnertheme) options can set different title page templates.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{inner key -- interface}
+% Controls for the title page templates.
+% \UnitTested
+% \TestFiles{gotham-test-038}
+% \begin{macrocode}
+\keys_define:nn { gotham / inner }
+{
+ % title~page
+ title~page .usage:n = { general },
+ title~page .default:n = { gotham~normal },
+ title~page .code:n = { \__gotham_set_template:nn{title~page}{#1} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+
+%% Backgrounds %%%
+%%%%%%%%%%%%%%%%%%
+
+% \begin{implementation}
+% \begin{macrocode}
+% Background lengths
+% \newlength{\imageBGoffset}
+% \setlength{\imageBGoffset}{\paperwidth}
+% \addtolength{\imageBGoffset}{-8.5mm}
+% \end{macrocode}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{variable}{\l__gotham_template_name_prop}
+% Dictionary/map of template elements and predefined option according to the context.
+% Naming convention: template/What/Who, i.e. Name: key=background~canvas/watermark, value = gotham~draft
+% \end{variable}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{variable}{\l__gotham_template_name_prop}
+% Dictionary/map of template elements and predefined option according to the context.
+% Naming convention: template/What/Who, i.e. Name: key=background~canvas/watermark, value = gotham~draft
+% \begin{macrocode}
+\prop_if_exist:NTF \l__gotham_template_name_prop
+{}{
+ % if not defined than define it.
+ \prop_new:N \l__gotham_template_name_prop
+}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+
+% \begin{documentation}
+% \begin{function}{\defbeamertemplate{background}{name}{def}}
+% \begin{syntax}
+% \cs{defbeamertemplate} \marg{background canvas} \marg{chosen name} \marg{definition}
+% \end{syntax}
+% The |background canvas| and the |background| beamer templates can be redifined by users if wanted/needed.
+% By default these templates are empty (except the color in background canvas when it not transparent).
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{background~canvas}{empty}{def}}
+% empty background canvas that contains color, that can be used to reset background.
+% \UnitTested
+% \TestFiles{gotham-test-038}
+% \begin{macrocode}
+\defbeamertemplate{background~canvas}{empty}{% empty background style has a color.
+ % \ifbeamercolorempty[bg]{background}{}{\color{bg}\vrule width\paperwidth height\paperheight}% copied beamer default here
+ \hspace*{28pt}
+ \begin{beamercolorbox}[wd=\paperwidth,
+ ht=\paperheight,
+ ]{background}
+ % nothing to write, only a background color
+ \end{beamercolorbox}
+}%
+\defbeamertemplate{background}{empty}{}%
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{background}{watermark/gotham~draft}{def}}
+% Background that contains a watermakr stamp with the word: DRAFT.
+% \UnitTested
+% \TestFiles{gotham-test-038}
+% \begin{macrocode}
+\defbeamertemplate{background}{watermark/gotham~draft}{
+ \begin{tikzpicture}[overlay,remember~picture]
+ \node[color=red, opacity=0.3, scale=5, rotate=45] at ([shift={(0,0)}]current~page.center) {DRAFT};
+ \end{tikzpicture}
+}
+% Add the template to the prop (dictionary)
+\prop_put:Nnn \l__gotham_template_name_prop {background/watermark} {gotham~draft}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\__gotham_add_beamerframe_key:n}
+% \begin{arguments}
+% \item Name of the option to add, this name should also correspond to the name of the environment followed by the suffix 'env'.
+% \end{arguments}
+% Function to add an option of a frame using an environment.
+% For example, if the name 'optionA' is the argument given to the function, an frame option named 'optionA' will be added, and this option will surround the frame with the environment named 'optionAenv'.
+% So, the environment 'optionA' must have been declared before.
+% \TestFiles{gotham-test-038}
+% \begin{macrocode}
+\seq_if_exist:NTF \l__gotham_frameoption_tmp_seq {}{
+ % Define the sequence of frameoptions environments to close
+ \seq_new:N \l__gotham_frameoption_tmp_seq
+}
+
+\cs_if_exist:NTF \__gotham_add_beamerframe_key:n {}{
+ % if it doesn't exist, then create it.
+
+ % Define the command to add frameoptions
+ \cs_new_protected:Nn \__gotham_add_beamerframe_key:n {
+ \define@key{beamerframe}{ #1 }[true]{
+ \begin{#1env}
+ \seq_put_left:Nn \l__gotham_frameoption_tmp_seq { \end{#1env} }
+ }
+ }
+
+ % At the end of frames close the opened environments.
+ \apptocmd{\beamer@reseteecodes}{
+ % Join elements in the queue without separator then output the result
+ \seq_use:Nn \l__gotham_frameoption_tmp_seq {}
+ % clear working queue
+ \seq_clear:N \l__gotham_frameoption_tmp_seq
+ }{}{}
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[noBGC]}
+% Add a frame option |noBGC| to display an empty background canvas.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[noBCG]}
+% Add a frame option |noBGC| to display an empty background canvas.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-038}
+% \begin{macrocode}
+
+\newenvironment{noBGCenv}{
+ \setbeamertemplate{background~canvas}[empty]
+}{}
+\__gotham_add_beamerframe_key:n {noBGC}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{variable}{\l_gotham_defaultWatermark}
+% Boolean to triggering if watermark should be displayed by default (without giving the frame option).
+% The variable is |false| by default.
+% \end{variable}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\l_gotham_defaultWatermark}
+% Boolean variable to display the watermark by default (or not).
+% \UnitTested
+% \TestFiles{gotham-test-038}
+% \begin{macrocode}
+\bool_new:N \l_gotham_defaultWatermark
+\bool_set_false:N \l_gotham_defaultWatermark
+% At every new frame, reset the options to default (unless some options/keys are given)
+\BeforeBeginEnvironment{frame}{
+ \bool_if:NTF \l_gotham_defaultWatermark {
+ \setbeamertemplate{background}[watermark/\prop_item:Nn \l__gotham_template_name_prop {background/watermark}]
+ }{% false
+ \setbeamertemplate{background}[empty]
+ }
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[watermark]}
+% Add a frame option |watermark| to display watermark in background.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[watermark]}
+% Add a frame option |watermark| to display an empty background canvas.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-038}
+% \begin{macrocode}
+% bool to trigger the add of watermark in background
+\newenvironment{watermarkenv}{
+ \setbeamertemplate{background}[
+ watermark/\prop_item:Nn \l__gotham_template_name_prop {background/watermark}
+ ]
+}{}
+\__gotham_add_beamerframe_key:n {watermark}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[nowatermark]}
+% Add a frame option |nowatermark| to do not display nowatermark in background.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[nowatermark]}
+% Add a frame option |nowatermark| to do not display an empty background canvas.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-038}
+% \begin{macrocode}
+% bool to trigger the add of nowatermark in background
+\newenvironment{nowatermarkenv}{
+ \setbeamertemplate{background}[empty]
+}{}
+\__gotham_add_beamerframe_key:n {nowatermark}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{variable}{\l__gotham_tmpa_seq, \l__gotham_tmpa_tl, \l__gotham_tmpb_tl}
+% tmp variables
+% \begin{macrocode}
+\seq_if_exist:NTF \l__gotham_tmpa_seq
+{}{
+ % sequence
+ \seq_new:N \l__gotham_tmpa_seq
+}
+\tl_if_exist:NTF \l__gotham_tmpa_tl
+{}{
+ % token list A
+ \tl_new:N \l__gotham_tmpa_tl
+}
+\tl_if_exist:NTF \l__gotham_tmpb_tl
+{}{
+ % token list B
+ \tl_new:N \l__gotham_tmpb_tl
+}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\__gotham_set_prop_template:nn}
+% \begin{arguments}
+% \item element name (from beamer doc) in other word, the name the template category
+% \item prefined option (from beamer doc)
+% \end{arguments}
+% Function that store in a map the name a template use later.
+% The following naming convention is used: Template/What/Who~Name: watermark/gotham~draft.
+% The means for example that if a beamer template is defined using
+% |\defbeamertemplate{background}{watermark/gotham~draft}{...}|,
+% then the function has to be call using
+% |\__gotham_set_prop_template{background/watermark}{gotham~draft}|,
+% that will filled internally the map using the l3 command
+% |\prop_put:Nnn \l__gotham_template_name_prop {background/watermark}{gotham~draft}|.
+% If the template name given as input does not exist, an error is raised.
+% \TestFiles{gotham-test-039}
+% \begin{macrocode}
+\cs_if_exist:NTF \__gotham_set_prop_template:nn {}{
+ % if it doesn't exist, then create it.
+ \cs_new_protected:Nn \__gotham_set_prop_template:nn
+ {
+ % Check if the first argument contains a /
+ \tl_if_in:nnTF { #1 } { / }
+ {
+ % Split the first around the /
+ \seq_set_split:Nnn \l__gotham_tmpa_seq { / } { #1 }
+ \tl_set:Nn \l__gotham_tmpa_tl { \seq_item:Nn \l__gotham_tmpa_seq { 1 } }
+ \tl_set:Nn \l__gotham_tmpb_tl { \seq_item:Nn \l__gotham_tmpa_seq { 2 } }
+ % Check if template exist
+ \cs_if_exist:cTF {beamer@@tmpop@\exp_not:V \l__gotham_tmpa_tl @\exp_not:V \l__gotham_tmpb_tl /#2} {
+ % set the value in the map, so it can be called later.
+ \prop_put:Nnn \l__gotham_template_name_prop {#1} {#2}
+ % \setbeamertemplate{#1}[#2]
+ }{
+ \PackageError{beamerthemegotham}
+ {The~beamer~template~named~'\l__gotham_tmpa_tl'~with~the~option~'\l__gotham_tmpb_tl/#2'~does~not~exist}
+ {helping~message}
+ }
+ }{% false -> error
+ \PackageError{beamerthemegotham}
+ {%
+ When~using~'\c_backslash_str\cs_to_str:N \__gotham_set_prop_template'~the~first~argument~should~contain~a~'/'~to~respect~the~naming~convention~used~(Template/what/Who~name),~but~you~gave~'#1'.~
+ As~example:~if~'\c_backslash_str defbeamertemplate{background}{watermark/gotham~draft}'...,~then~use~'\c_backslash_str\cs_to_str:N \__gotham_set_prop_template{background/watermark}{gotham~draft}'
+ }{helping~message}
+ }
+ }
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\useinnertheme}
+% \begin{syntax}
+% \cs{useinnertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{watermark default} = \oarg{\defopt{off} \textbar on }
+% \meta{watermark template} = \oarg{\defopt{gotham draft} \textbar ...}
+% \end{syntax}
+% The 'package' (useinnertheme) options can control |background| (and |background canvas|) templates according to situations.
+% Block environments such as |theorem| and |example| have no background color by default.
+% The option |watermark default=on| can enable the |watermark template| on every frame; but it can still be turned off for specific frames when using the frame option |nowatermark|.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{inner key -- interface}
+% Controls the inner settings for background and watermark).
+% \UnitTested
+% \TestFiles{gotham-test-037}
+% \begin{macrocode}
+\keys_define:nn { gotham / inner }{
+ % watermark template
+ watermark~template .usage:n = { general },
+ watermark~template .default:n = { gotham~draft },
+ watermark~template .code:n = { \__gotham_set_prop_template:nn{background/watermark}{#1} },
+}
+\keys_define:nn { gotham / inner }{
+ % watermark default
+ watermark~default .choice:,
+ watermark~default .usage:n = { general },
+ watermark~default .default:n = { false },
+
+ watermark~default / true .code:n = { \bool_set_true:N \l_gotham_defaultWatermark },
+ watermark~default / on .code:n = { \bool_set_true:N \l_gotham_defaultWatermark },
+ watermark~default / enable .code:n = { \bool_set_true:N \l_gotham_defaultWatermark },
+
+ watermark~default / false .code:n = { \bool_set_false:N \l_gotham_defaultWatermark },
+ watermark~default / off .code:n = { \bool_set_false:N \l_gotham_defaultWatermark },
+ watermark~default / disable .code:n = { \bool_set_false:N \l_gotham_defaultWatermark },
+
+ watermark~default / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'watermark~default',~so~being~ignored. }{helping~message: watermark~default / unknown} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+%%%% Stand IN/OUT %%%%
+%%%%%%%%%%%%%%%%%%%%%%%%
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[c]}
+% Add a frame option |c| for enhanced vertically centered text in the frame.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[c]}
+% Add a frame option |c| for improved vertically centered text in the frame.
+% By default, Beamer frames offer the |c| option to \textit{almost} vertically center the text, but the placement is a little too high.
+% To fix this, we redefine the |c| option to equalize |\beamer@frametopskip| and |\beamer@framebottomskip|.
+% This solution was suggested by Enrico Gregorio in an answer to \href{http://tex.stackexchange.com/questions/247826/}{this Stack Exchange question}.
+% \UnitTested
+% \TestFiles{gotham-test-039}
+% \begin{macrocode}
+\define@key{beamerframe}{c}[true]{
+ \beamer@frametopskip=0pt~plus~1fill\relax
+ \beamer@framebottomskip=0pt~plus~1fill\relax
+ \beamer@frametopskipautobreak=0pt~plus~.4\paperheight\relax
+ \beamer@framebottomskipautobreak=0pt~plus~.6\paperheight\relax
+ \def\beamer@initfirstlineunskip{}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{background~canvas}{standout/gotham}}
+% Definition of the background canvas template used by the standout frame of gotham theme.
+% \UnitTested
+% \TestFiles{gotham-test-040}
+% \begin{macrocode}
+\defbeamertemplate{background~canvas}{standout/gotham}{
+ % copied from beamer default
+ \ifbeamercolorempty[bg]{standout}{
+ % if the background standout color is transparent, do nothing.
+ }{
+ \usebeamercolor[bg]{standout}\color{bg}
+ \vrule~width\paperwidth~height\paperheight
+ }
+}
+% Add the template to the prop (dictionary) of background template to use according to the situation
+\prop_put:Nnn \l__gotham_template_name_prop {background~canvas/standout} {gotham}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{standout}{gotham}}
+% Definition of the standout template used by the standout frame of gotham theme.
+% This includes background canvas template, fonts and colors.
+% \UnitTested
+% \TestFiles{gotham-test-040}
+% \begin{macrocode}
+\defbeamertemplate*{standout}{gotham}{%
+ %
+ % \setkeys{beamerframe}{c}
+ % \setkeys{beamerframe}{noframenumbering}
+ % \centering
+
+ \setbeamertemplate{background~canvas}[standout/\prop_item:Nn \l__gotham_template_name_prop {background~canvas/standout}]
+ % \usebeamertemplate{background~canvas}%[standout/gotham]
+ \usebeamerfont{standout}
+ % if the background color is switched, then change foreground (font) color.
+ \ifbeamercolorempty[bg]{palette~primary}{
+ %true : empty background (transparent)
+ \setbeamercolor{background~canvas}{
+ use=palette~primary,
+ bg=palette~primary.fg
+ }
+ }{
+ %false : background not empty (dark or light)
+ \setbeamercolor{background~canvas}{
+ use=palette~primary,
+ bg=palette~primary.bg
+ }
+ }
+ \setbeamercolor{local~structure}{
+ fg=palette~primary.bg
+ }
+ \usebeamercolor[fg]{palette~primary}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[standout]}
+% Add a frame option |standout| to display the standout frame template.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[standout]}
+% Add a frame option |standout| to display the standout frame template.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-040}
+% \begin{macrocode}
+\newenvironment{standoutenv}{
+ \usebeamertemplate{standout}
+}{}
+\__gotham_add_beamerframe_key:n {standout}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{background~canvas}{standin/gotham}}
+% Definition of the background canvas template used by the standin frame of gotham theme.
+% \UnitTested
+% \TestFiles{gotham-test-040}
+% \begin{macrocode}
+\defbeamertemplate{background~canvas}{standin/gotham}{
+ \ifbeamercolorempty[bg]{standin}{
+ % if the background standin color is transparent, do nothing.
+ }{
+ % Uncomment this if-condition to have a 'light' background in 'transparent' color-mode.
+ \ifbool{transparentBG}{
+ % \color{} is not possible so, it is better to do nothing for transparent bg than creating a transparent vrule.
+ }{
+ \usebeamercolor[bg]{standin}\color{bg}
+ \vrule~width\paperwidth~height\paperheight
+ }
+ }
+}
+% Add the template to the prop (dictionary) of background template to use according to the situation
+\prop_put:Nnn \l__gotham_template_name_prop {background~canvas/standin} {gotham}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{standout}{gotham}}
+% Definition of the standout template used by the standout frame of gotham theme.
+% This includes background canvas template, fonts and colors.
+% \UnitTested
+% \TestFiles{gotham-test-040}
+% \begin{macrocode}
+\defbeamertemplate*{standin}{gotham}{
+ %
+ % \setkeys{beamerframe}{c}
+ % \setkeys{beamerframe}{noframenumbering}
+ % \centering
+ \setbeamertemplate{background~canvas}[standin/\prop_item:Nn \l__gotham_template_name_prop {background~canvas/standin}]
+ % \usebeamertemplate{background~canvas}%[standin/gotham]
+ \usebeamerfont{standin}
+ %
+ % Uncomment this if-condition to have a 'light' frametitle in 'transparent' color-mode.
+ % \ifbeamercolorempty[bg]{normal~text}{
+ % %true : empty background (transparent)
+ % \setbeamercolor{frametitle}{
+ % use=normal~text,
+ % bg=colorBG,
+ % fg=normal~text.fg
+ % }
+ % }{
+ % false
+ \setbeamercolor{frametitle}{
+ use=normal~text,
+ bg=normal~text.bg,
+ fg=normal~text.fg
+ }
+ % }
+ % \setbeamercolor{frametitle}{
+ % use=normal~text,
+ % bg=normal~text.bg,
+ % fg=normal~text.fg
+ % }
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[standin]}
+% Add a frame option |standin| to display the standin frame template.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[standin]}
+% Add a frame option |standin| to display the standin frame template.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-040}
+% \begin{macrocode}
+\newenvironment{standinenv}{
+ \usebeamertemplate{standin}
+}{}
+\__gotham_add_beamerframe_key:n {standin}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\useinnertheme}
+% \begin{syntax}
+% \cs{useinnertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{standin template} = \oarg{\defopt{gotham} \textbar ...}
+% \meta{standout template} = \oarg{\defopt{gotham} \textbar ...}
+% \end{syntax}
+% The 'package' (useinnertheme) options can control |standout| (and |standin|) templates.
+% These templates are activated when giving the frame option |\begin{frame}[standin]| and |standout|.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{inner key -- interface}
+% Controls the inner settings for standout and standin.
+% \UnitTested
+% \TestFiles{gotham-test-037}
+% \begin{macrocode}
+\keys_define:nn { gotham / inner }
+{
+ % standout template
+ standout~template .usage:n = { general },
+ standout~template .default:n = { gotham },
+ standout~template .code:n = { \__gotham_set_prop_template:nn{background~canvas/standout}{#1} },
+}
+\keys_define:nn { gotham / inner }
+{
+ % standin template
+ standin~template .usage:n = { general },
+ standin~template .default:n = { gotham },
+ standin~template .code:n = { \__gotham_set_prop_template:nn{background~canvas/standin}{#1} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+%%%% Sections %%%%
+%%%%%%%%%%%%%%%%%%%%%%%
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[part]}
+% Add a frame option |part| to display the part frame template.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[part]}
+% Add a frame option |part| to display the part frame template.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-041}
+% \begin{macrocode}
+\bool_new:N \l_gotham_partframe
+\bool_set_false:N \l_gotham_partframe
+\define@key{beamerframe}{part}[true]{
+ \bool_set_true:N \l_gotham_partframe
+ \begingroup
+ \usebeamertemplate{part~frame}
+}
+\apptocmd{\beamer@reseteecodes}{
+ \bool_if:NTF \l_gotham_partframe {
+ \endgroup
+ \bool_set_false:N \l_gotham_partframe
+ }{}
+}{}{}
+% \define@key{beamerframe}{part}[true]{
+% \thispagestyle{navigation@part}
+% }
+% \def\ps@navigation@part{
+% \usebeamertemplate{part~frame}
+% \@nameuse{ps@navigation}
+% }
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[section]}
+% Add a frame option |section| to display the section frame template.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[section]}
+% Add a frame option |section| to display the section frame template.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-041}
+% \begin{macrocode}
+\bool_new:N \l_gotham_sectionframe
+\bool_set_false:N \l_gotham_sectionframe
+\define@key{beamerframe}{section}[true]{
+ \bool_set_true:N \l_gotham_sectionframe
+ \begingroup
+ \usebeamertemplate{section~frame}
+}
+\apptocmd{\beamer@reseteecodes}{
+ \bool_if:NTF \l_gotham_sectionframe {
+ \endgroup
+ \bool_set_false:N \l_gotham_sectionframe
+ }{}
+}{}{}
+% \define@key{beamerframe}{section}[true]{
+% \thispagestyle{navigation@section}
+% }
+% \def\ps@navigation@section{
+% \usebeamertemplate{section~frame}
+% \@nameuse{ps@navigation}
+% }
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[subsection]}
+% Add a frame option |subsection| to display the subsection frame template.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[subsection]}
+% Add a frame option |subsection| to display the subsection frame template.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-041}
+% \begin{macrocode}
+\bool_new:N \l_gotham_subsectionframe
+\bool_set_false:N \l_gotham_subsectionframe
+\define@key{beamerframe}{subsec}[true]{
+ \bool_set_true:N \l_gotham_subsectionframe
+ \begingroup
+ \usebeamertemplate{subsection~frame}
+}
+\apptocmd{\beamer@reseteecodes}{
+ \bool_if:NTF \l_gotham_subsectionframe {
+ \endgroup
+ \bool_set_false:N \l_gotham_subsectionframe
+ }{}
+}{}{}
+% \define@key{beamerframe}{subsec}[true]{
+% \thispagestyle{navigation@subsec}
+% }
+% \def\ps@navigation@subsec{
+% \usebeamertemplate{subsection~frame}
+% \@nameuse{ps@navigation}
+% }
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[subsubsection]}
+% Add a frame option |subsubsection| to display the subsubsection frame template.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[subsubsection]}
+% Add a frame option |subsubsection| to display the subsubsection frame template.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-041}
+% \begin{macrocode}
+\bool_new:N \l_gotham_subsubsectionframe
+\bool_set_false:N \l_gotham_subsubsectionframe
+\define@key{beamerframe}{subsubsec}[true]{
+ \bool_set_true:N \l_gotham_subsubsectionframe
+ \begingroup
+ \usebeamertemplate{subsubsection~frame}
+}
+\apptocmd{\beamer@reseteecodes}{
+ \bool_if:NTF \l_gotham_subsubsectionframe {
+ \endgroup
+ \bool_set_false:N \l_gotham_subsubsectionframe
+ }{}
+}{}{}
+% \define@key{beamerframe}{subsubsec}[true]{
+% \thispagestyle{navigation@subsubsec}
+% }
+% \def\ps@navigation@subsubsec{
+% \usebeamertemplate{subsubsection~frame}
+% \@nameuse{ps@navigation}
+% }
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{variable}{\partContentName, \secContentName, \subsecContentName}
+% Commands containing the 'table of contents' title for part, section and subection (if theses ToC frames are enabled).
+% An option for subsubsection is not useful (at least up to understanding of the moment) because we do not display frame with the content of a subsubsection since it is the small unity we are working with.
+% \end{variable}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{variable}{\providebool{partContent}, \partContentName}
+% Boolean variable to enable the table of contents of the part, and the command containing the 'table of contents' title.
+% \begin{macrocode}
+% repeated from BeamerExtra
+\providebool{partContent}
+\booltrue{partContent}
+\providecommand{\partContentName}{Part~content}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+% \begin{implementation}
+% \begin{variable}{\providebool{secContent}, \secContentName}
+% Boolean variable to enable the table of contents of the section, and the command containing the 'table of contents' title.
+% \begin{macrocode}
+\providebool{sectionContent}
+\booltrue{sectionContent}
+\providecommand{\secContentName}{Section~content}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+% \begin{implementation}
+% \begin{variable}{\providebool{subsectionContent}, \subsecContentName}
+% Boolean variable to enable the table of contents of the subsection, and the command containing the 'table of contents' title.
+% \begin{macrocode}
+\providebool{subsectionContent}
+\booltrue{subsectionContent}
+\providecommand{\subsecContentName}{Subsection~content}
+% Subsubsection is not useful (at least up to understanding of the moment) because we do not display frame with the content of a subsubsection since it is the small unity we are working with.
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{part~title}{gotham}, \defbeamertemplate{section~title}{gotham}, \defbeamertemplate{subsection~title}{gotham}, \defbeamertemplate{subsection~title}{gotham}}
+% Definitions of templates controling how will appear the name/title of the parts, sections, subsections and subsubsections.
+% \UnitTested
+% \TestFiles{gotham-test-041}
+% \begin{macrocode}
+\def\partname{\translate{Part}}
+\defbeamertemplate*{part~title}{gotham}{
+ \usebeamercolor[fg]{part~title}
+ \usebeamerfont{part~title}
+ \partname \ \insertromanpartnumber
+ \\[1.75ex]
+ \insertpart
+}
+\defbeamertemplate*{section~title}{gotham}{
+ \usebeamercolor[fg]{section~title}
+ \usebeamerfont{section~title}
+ \insertsectionnumber.~
+ \insertsectionhead
+}
+\defbeamertemplate*{subsection~title}{gotham}{
+ \usebeamercolor[fg]{subsection~title}
+ \usebeamerfont{subsection~title}
+ \insertsectionnumber.\insertsubsectionnumber.~
+ \insertsubsectionhead
+}
+\def\subsubsectionname{\translate{Subsubsection}}
+\def\insertsubsubsectionnumber{\arabic{subsubsection}}
+\def\subsubsectionpage{\usebeamertemplate*{subsubsection~page}}
+\defbeamertemplate*{subsubsection~title}{gotham}{
+ \usebeamercolor[fg]{subsubsection~title}
+ \usebeamerfont{subsubsection~title}
+ \insertsectionnumber.\insertsubsectionnumber.\insertsubsubsectionnumber.~
+ \insertsubsubsectionhead
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\__gotham_inner_disable_partpage:, \__gotham_inner_enable_partpage:}
+% Commands to disable or enable the display of a 'part page' frame at the begining of every new part.
+% It replaces the |\newcommand{\gotham@disablepartpage}| and | \newcommand{\gotham@enablepartpage}|
+% \TestFiles{gotham-test-041}
+% \begin{macrocode}
+\cs_new_protected:Nn \__gotham_inner_disable_partpage:
+{
+ \AtBeginPart{
+ % intentionally empty
+ }
+}
+
+\cs_new_protected:Nn \__gotham_inner_enable_partpage:
+{
+ \AtBeginPart{
+ \ifbeamer@inframe
+ \partpage
+ \else
+ \frame[c, noframenumbering, part]{\partpage}
+ \fi
+
+ \ifbool{partContent}{
+ % true
+ \begin{frame}[noframenumbering, tocpart]
+ \frametitle{\partContentName}
+ \tableofcontents[part=\thepart]
+ \end{frame}
+ }{
+ % else empty
+ }
+ }
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\__gotham_inner_disable_sectionpage:, \__gotham_inner_enable_sectionpage:}
+% Commands to disable or enable the display of a 'section page' frame at the begining of every new section.
+% It replaces the |\newcommand{\gotham@disablesectionpage}| and | \newcommand{\gotham@enablesectionpage}|
+% \TestFiles{gotham-test-041}
+% \begin{macrocode}
+\cs_new_protected:Nn \__gotham_inner_disable_sectionpage:
+{
+ \AtBeginSection{
+ % intentionally empty
+ }
+}
+
+\cs_new_protected:Nn \__gotham_inner_enable_sectionpage:
+{
+ \AtBeginSection{
+ \ifbeamer@inframe
+ \sectionpage
+ \else
+ \frame[c, noframenumbering, section]{\sectionpage}
+ \fi
+
+ \ifbool{sectionContent}{
+ % true
+ \begin{frame}[noframenumbering, tocsec]
+ \frametitle{\secContentName}
+ {\tableofcontents[currentsection, currentsubsection,
+ hideothersubsections,
+ sectionstyle=show/shaded,
+ ]
+ }
+ \end{frame}
+ }{
+ % else empty
+ }
+ }
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\__gotham_inner_disable_subsectionpage:, \__gotham_inner_enable_subsectionpage:}
+% Commands to disable or enable the display of a 'subsection page' frame at the begining of every new subsection.
+% It replaces the |\newcommand{\gotham@disablesubsectionpage}| and | \newcommand{\gotham@enablesubsectionpage}|
+% \TestFiles{gotham-test-041}
+% \begin{macrocode}
+\cs_new_protected:Nn \__gotham_inner_disable_subsectionpage:
+{
+ \AtBeginSubsection{
+ % intentionally empty
+ }
+}
+
+\cs_new_protected:Nn \__gotham_inner_enable_subsectionpage:
+{
+ \AtBeginSubsection{
+ \ifbeamer@inframe
+ \subsectionpage
+ \else
+ \frame[c, noframenumbering, subsec]{\subsectionpage}
+ \fi
+
+ \ifbool{subsectionContent}{
+ % true
+ \begin{frame}[noframenumbering, tocsubsec]
+ \frametitle{\subsecContentName}
+ {\tableofcontents[currentsection, currentsubsection,
+ %currentsubsubsection,
+ hideothersubsections,
+ sectionstyle=show/shaded,
+ subsectionstyle=show/shaded/hide,
+ subsubsectionstyle=show/show/hide,
+ ]
+ }
+ \end{frame}
+ }{
+ % else empty
+ }
+ }
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\__gotham_inner_disable_subsubsectionpage:, \__gotham_inner_enable_subsubsectionpage:}
+% Commands to disable or enable the display of a 'subsubsection page' frame at the begining of every new subsubsection.
+% It replaces the |\newcommand{\gotham@disablesubsubsectionpage}| and | \newcommand{\gotham@enablesubsubsectionpage}|
+% \TestFiles{gotham-test-041}
+% \begin{macrocode}
+\cs_new_protected:Nn \__gotham_inner_disable_subsubsectionpage:
+{
+ \AtBeginSubsubsection{
+ % intentionally empty
+ }
+}
+
+\cs_new_protected:Nn \__gotham_inner_enable_subsubsectionpage:
+{
+ \AtBeginSubsubsection{
+ \ifbeamer@inframe
+ \subsubsectionpage
+ \else
+ \frame[c, noframenumbering, subsubsec]{\subsubsectionpage}
+ \fi
+ }
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{variable}{\gotham@progressonsectionpage@linewidth}
+% Variables used to defined the progress bar in section pages.
+% If the vertical size of the bar want to be changed, the command |\setlength{\gotham@progressonsectionpage@linewidth}{<0.4pt>}| can be used.
+% \end{variable}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{variable}{\gotham@progressonsectionpage@linewidth}
+% Variables used to defined the progress bar in section pages.
+% \begin{macrocode}
+% horizontal size of the bar (used internally and set to |\textwidth|.
+\newlength{\gotham@progressonsectionpage}
+% vertical size of the bar
+\newlength{\gotham@progressonsectionpage@linewidth}
+\setlength{\gotham@progressonsectionpage@linewidth}{3pt}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{progress~bar~in~section~page}{empty}, \defbeamertemplate{progress~bar~in~section~page}{display}}
+% Templates to disable or enable the display of the progress bar in section pages.
+% \UnitTested
+% \TestFiles{gotham-test-041}
+% \begin{macrocode}
+\defbeamertemplate{progress~bar~in~section~page}{empty}{
+ \vspace{\gotham@progressonsectionpage@linewidth+1ex}
+}
+
+\def\inserttotalframenumber{100}
+\defbeamertemplate{progress~bar~in~section~page}{display}{
+ \setlength{\gotham@progressonsectionpage}{
+ \textwidth * \ratio{\insertframenumber~pt}{\inserttotalframenumber~pt}
+ }
+ \begin{tikzpicture}
+ \fill[bg] (0,0) rectangle (\textwidth, \gotham@progressonsectionpage@linewidth);
+ \fill[fg] (0,0) rectangle (\gotham@progressonsectionpage, \gotham@progressonsectionpage@linewidth);
+ \end{tikzpicture}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{variable}{\sectionhoffset}
+% length controlling the horizontal offset of the (section title + progress bar) block.
+% Can be useful when extra stuff want to be display on sides of the block.
+% The default value is 0.
+% \end{variable}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{variable}{\sectionhoffset}
+% length controlling the horizontal offset of the (section title + progress bar) block.
+% \begin{macrocode}
+\newlength{\sectionhoffset}
+\setlength{\sectionhoffset}{0pt}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate*{part|section|subsection|subsubsection~page}{progressbar/simple}}
+% Template of part \textbar section \textbar subsection \textbar subsubsection pages shared by 'progressbar' and 'simple' style.
+% These pages contain what is inside the part \textbar section \textbar subsection \textbar subsubsection frame (without background and frametitle).
+% \UnitTested
+% \TestFiles{gotham-test-041}
+% \begin{macrocode}
+\defbeamertemplate{part~page}{progressbar/simple}{
+ %\frametitle{toto section}
+ \centering
+ \hspace*{\sectionhoffset}
+ \begin{minipage}{22em}
+ % \raggedright
+ \centering
+ \usebeamertemplate*{part~title}\\[-1ex]
+ \usebeamertemplate*{progress~bar~in~section~page}
+ \par
+ \end{minipage}
+ \par
+ \vspace{\baselineskip}
+}
+\defbeamertemplate{section~page}{progressbar/simple}{
+ %\frametitle{toto section}
+ \centering
+ \hspace*{\sectionhoffset}
+ \begin{minipage}{22em}
+ \raggedright
+ \usebeamertemplate*{section~title}\\[-1ex]
+ \usebeamertemplate*{progress~bar~in~section~page}
+ \par
+ \end{minipage}
+ \par
+ \vspace{\baselineskip}
+}
+\defbeamertemplate{subsection~page}{progressbar/simple}{
+ %\frametitle{toto section}
+ \centering
+ \hspace*{\sectionhoffset}
+ \begin{minipage}{22em}
+ \raggedright
+ \usebeamertemplate*{section~title}\\[-1ex]
+ \usebeamertemplate*{progress~bar~in~section~page}
+ \par
+ \usebeamertemplate*{subsection~title}
+ \end{minipage}
+ \par
+ \vspace{\baselineskip}
+}
+\defbeamertemplate{subsubsection~page}{progressbar/simple}{
+ % \frametitle{toto section}
+ \centering
+ \hspace*{\sectionhoffset}
+ \begin{minipage}{22em}
+ \raggedright
+ \usebeamertemplate*{section~title}\\[-1ex]
+ \usebeamertemplate*{progress~bar~in~section~page}
+ \par
+ \usebeamertemplate*{subsection~title}
+ \par
+ \usebeamertemplate*{subsubsection~title}
+ \end{minipage}
+ \par
+ \vspace{\baselineskip}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{background~canvas}{part|section|subsection|subsubsection/gotham}}
+% Background canvas template of part \textbar section \textbar subsection \textbar subsubsection pages.
+% \UnitTested
+% \TestFiles{gotham-test-041}
+% \begin{macrocode}
+\defbeamertemplate{background~canvas}{part/gotham}{
+ \ifbeamercolorempty[bg]{normal~text}{}{\color{bg}\vrule width\paperwidth height\paperheight}
+}
+\defbeamertemplate{background~canvas}{section/gotham}{
+ \setbeamertemplate{background~canvas}[part/gotham]
+ \usebeamertemplate{background~canvas}
+}
+\defbeamertemplate{background~canvas}{subsection/gotham}{
+ \setbeamertemplate{background~canvas}[part/gotham]
+ \usebeamertemplate{background~canvas}
+}
+\defbeamertemplate{background~canvas}{subsubsection/gotham}{
+ \setbeamertemplate{background~canvas}[part/gotham]
+ \usebeamertemplate{background~canvas}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{part|section|subsection|subsubsection~frame}{gotham~simple}}
+% Template for part \textbar section \textbar subsection \textbar subsubsection frames with 'gotham simple' style.
+% \UnitTested
+% \TestFiles{gotham-test-041}
+% \begin{macrocode}
+\defbeamertemplate{part~frame}{gotham~simple}{
+ \setbeamertemplate{background~canvas}[part/gotham]
+ \setbeamercolor{frametitle}{
+ use={frametitleSection, normal~text},
+ bg=frametitleSection.fg,
+ fg=normal~text.fg
+ }
+ \setbeamertemplate{progress~bar~in~section~page}[empty]
+ \setbeamertemplate{part~page}[progressbar/simple]
+ % \usebeamertemplate*{part~page}% activated automatically
+}
+
+\defbeamertemplate{section~frame}{gotham~simple}{
+ \setbeamertemplate{background~canvas}[section/gotham]
+ \setbeamercolor{frametitle}{
+ use={frametitleSection, normal~text},
+ bg=frametitleSection.fg,
+ fg=normal~text.fg
+ }
+ \setbeamertemplate{progress~bar~in~section~page}[empty]
+ \setbeamertemplate{section~page}[progressbar/simple]
+ % \usebeamertemplate*{section~page}% activated automatically
+}
+
+\defbeamertemplate{subsection~frame}{gotham~simple}{
+ \setbeamertemplate{background~canvas}[subsection/gotham]
+ \setbeamercolor{frametitle}{
+ use={frametitleSection, normal~text},
+ bg=frametitleSection.fg,
+ fg=normal~text.fg
+ }
+ \setbeamertemplate{progress~bar~in~section~page}[empty]
+ \setbeamertemplate{subsection~page}[progressbar/simple]
+ % \usebeamertemplate*{subsection~page}% activated automatically
+}
+
+\defbeamertemplate{subsubsection~frame}{gotham~simple}{
+ \setbeamertemplate{background~canvas}[subsubsection/gotham]
+ \setbeamercolor{frametitle}{
+ use={frametitleSection, normal~text},
+ bg=frametitleSection.fg,
+ fg=normal~text.fg
+ }
+ \setbeamertemplate{progress~bar~in~section~page}[empty]
+ \setbeamertemplate{subsubsection~page}[progressbar/simple]
+ % \usebeamertemplate*{subsubsection~page}% activated automatically
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{part|section|subsection|subsubsection~frame}{gotham~progressbar}}
+% Template for part \textbar section \textbar subsection \textbar subsubsection frames with 'gotham progressbar' style.
+% \UnitTested
+% \TestFiles{gotham-test-041}
+% \begin{macrocode}
+\defbeamertemplate{part~frame}{gotham~progressbar}{
+ \setbeamertemplate{background~canvas}[part/gotham]
+ \setbeamercolor{frametitle}{
+ use={frametitleSection, normal~text},
+ bg=frametitleSection.fg,
+ fg=normal~text.fg
+ }
+ \setbeamertemplate{progress~bar~in~section~page}[display]
+ \setbeamertemplate{part~page}[progressbar/simple]
+ % \usebeamertemplate*{part~page}% activated automatically
+}
+
+\defbeamertemplate{section~frame}{gotham~progressbar}{
+ \setbeamertemplate{background~canvas}[section/gotham]
+ \setbeamercolor{frametitle}{
+ use={frametitleSection, normal~text},
+ bg=frametitleSection.fg,
+ fg=normal~text.fg
+ }
+ \setbeamertemplate{progress~bar~in~section~page}[display]
+ \setbeamertemplate{section~page}[progressbar/simple]
+ % \usebeamertemplate*{section~page}% activated automatically
+}
+
+\defbeamertemplate{subsection~frame}{gotham~progressbar}{
+ \setbeamertemplate{background~canvas}[subsection/gotham]
+ \setbeamercolor{frametitle}{
+ use={frametitleSection, normal~text},
+ bg=frametitleSection.fg,
+ fg=normal~text.fg
+ }
+ \setbeamertemplate{progress~bar~in~section~page}[display]
+ \setbeamertemplate{subsection~page}[progressbar/simple]
+ % \usebeamertemplate*{subsection~page}% activated automatically
+}
+
+\defbeamertemplate{subsubsection~frame}{gotham~progressbar}{
+ \setbeamertemplate{background~canvas}[subsubsection/gotham]
+ \setbeamercolor{frametitle}{
+ use={frametitleSection, normal~text},
+ bg=frametitleSection.fg,
+ fg=normal~text.fg
+ }
+ \setbeamertemplate{progress~bar~in~section~page}[display]
+ \setbeamertemplate{subsubsection~page}[progressbar/simple]
+ % \usebeamertemplate*{subsubsection~page}% activated automatically
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate*{progress~bar~in~splitvert}{empty|dispay}}
+% Internal template to display or disable (empty) the progressbar used in 'splitvert' (split vertically) style.
+% \UnitTested
+% \TestFiles{gotham-test-041}
+% \begin{macrocode}
+\defbeamertemplate{progress~bar~in~splitvert}{empty}{
+ \vspace{-0.5ex}
+}
+
+\defbeamertemplate*{progress~bar~in~splitvert}{display}{
+ % \nointerlineskip
+ \setlength{\gotham@progressonsectionpage}{
+ \paperwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}
+ }
+ \begin{tikzpicture}
+ \fill[bg] (0,0) rectangle (\paperwidth, \gotham@progressonsectionpage@linewidth);
+ \fill[fg] (0,0) rectangle (\gotham@progressonsectionpage, \gotham@progressonsectionpage@linewidth);
+ \end{tikzpicture}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{part|section|subsection|subsubsection page}{gotham splitvert progressbar/simple}, \defbeamertemplate{part|section|subsection|subsubsection frame}{gotham splitvert progressbar}, \defbeamertemplate{part|section|subsection|subsubsection frame}{gotham splitvert simple}}
+% Templates for part \textbar section \textbar subsection \textbar subsubsection pages that are common for 'gotham splitvert progressbar' and 'gotham splitvert simple' styles (which implies part \textbar section \textbar subsection \textbar subsubsection frames).
+% \UnitTested
+% \TestFiles{gotham-test-041}
+% \begin{macrocode}
+% Part page splitvert.
+\defbeamertemplate{part~page}{gotham~splitvert~progressbar/simple}{
+ % \frametitle{part!}
+ % \IfEmpty{\insertframetitle}{
+ \ifx\beamer@frametitle\@empty
+ \vspace*{-0.05\paperheight}
+ \else %}{
+ \vspace*{-0.165\paperheight}
+ \fi %}
+ {
+ \usebeamercolor{frametitle}\colorlet{gotham@@tempColor}{bg}
+ \begin{tikzpicture}[overlay, remember~picture]
+ \fill[color=gotham@@tempColor] (current~page.north~west) rectangle ([shift = {(0, -0.45\paperheight)}] current~page.north~east);
+ \end{tikzpicture}
+ }
+
+ % \hspace*{\sectionhoffset}
+ \begin{minipage}[b][0.45\paperheight]{\textwidth}
+ \centering
+ \usebeamertemplate*{part~title}
+ \end{minipage}
+ \\[-0.1\baselineskip]
+ \hspace*{-1.0cm}\noindent
+ \usebeamertemplate*{progress~bar~in~splitvert}
+
+ \newline
+ \begin{minipage}[t][0.5\paperheight]{\textwidth}
+ % \vspace{0.5\baselineskip}
+ % \usebeamerfont{subsection~ttitle}
+ % \usebeamercolor[bg]{frametitle}
+ % empty
+ \end{minipage}
+}
+\defbeamertemplate{part~frame}{gotham~splitvert~progressbar}{
+ \setbeamertemplate{background~canvas}[part/gotham]
+ % \setbeamercolor{frametitle}{}
+ % \setlength{\sectionhoffset}{1cm}
+ \setbeamercolor{part~title}{use=frametitle, fg=frametitle.fg}
+ \setbeamertemplate{progress~bar~in~splitvert}[display]
+ \setbeamertemplate{part~page}[gotham~splitvert~progressbar/simple]
+ % \usebeamertemplate*{part~page}% activated automatically
+}
+\defbeamertemplate{part~frame}{gotham~splitvert~simple}{
+ \setbeamertemplate{background~canvas}[part/gotham]
+ % \setbeamercolor{frametitle}{}
+ % \setlength{\sectionhoffset}{1cm}
+ \setbeamercolor{part~title}{use=frametitle, fg=frametitle.fg}
+ \setbeamertemplate{progress~bar~in~splitvert}[empty]
+ \setbeamertemplate{part~page}[gotham~splitvert~progressbar/simple]
+ % \usebeamertemplate*{part~page}% activated automatically
+}
+
+% Section page splitvert.
+\defbeamertemplate{section~page}{gotham~splitvert~progressbar/simple}{
+ % \frametitle{section!}
+ % \IfEmpty{\insertframetitle}{
+ \ifx\beamer@frametitle\@empty
+ \vspace*{-0.05\paperheight}
+ \else %}{
+ \vspace*{-0.165\paperheight}
+ \fi %}
+ {
+ \usebeamercolor{frametitle}\colorlet{gotham@@tempColor}{bg}
+ \begin{tikzpicture}[overlay, remember~picture]
+ \fill[color=gotham@@tempColor] (current~page.north~west) rectangle ([shift = {(0, -0.45\paperheight)}] current~page.north~east);
+ \end{tikzpicture}
+ }
+
+ \hspace*{\sectionhoffset}
+ \begin{minipage}[b][0.45\paperheight]{\textwidth}
+ \usebeamertemplate*{section~title}
+ \end{minipage}
+ \\[-0.1\baselineskip]
+ \hspace*{-1.0cm}\noindent
+ \usebeamertemplate*{progress~bar~in~splitvert}
+
+ \newline
+ \hspace*{\sectionhoffset}
+ \begin{minipage}[t][0.5\paperheight]{\textwidth}
+ % \vspace{0.5\baselineskip}
+ \usebeamerfont{subsection~title}
+ \usebeamercolor[bg]{frametitle}
+ % empty
+ \end{minipage}
+}
+\defbeamertemplate{section~frame}{gotham~splitvert~progressbar}{
+ \setbeamertemplate{background~canvas}[section/gotham]
+ % \setbeamercolor{frametitle}{}
+ \setlength{\sectionhoffset}{1cm}
+ \setbeamercolor{section~title}{use=frametitle, fg=frametitle.fg}
+ \setbeamertemplate{progress~bar~in~splitvert}[display]
+ \setbeamertemplate{section~page}[gotham~splitvert~progressbar/simple]
+ % \usebeamertemplate*{section~page}% activated automatically
+}
+\defbeamertemplate{section~frame}{gotham~splitvert~simple}{
+ \setbeamertemplate{background~canvas}[section/gotham]
+ % \setbeamercolor{frametitle}{}
+ \setlength{\sectionhoffset}{1cm}
+ \setbeamercolor{section~title}{use=frametitle, fg=frametitle.fg}
+ \setbeamertemplate{progress~bar~in~splitvert}[empty]
+ \setbeamertemplate{section~page}[gotham~splitvert~progressbar/simple]
+ % \usebeamertemplate*{section~page}% activated automatically
+}
+
+% Subsection page splitvert.
+\defbeamertemplate{subsection~page}{gotham~splitvert~progressbar/simple}{
+ % \frametitle{subsection!}
+ % \IfEmpty{\insertframetitle}{
+ \ifx\beamer@frametitle\@empty
+ \vspace*{-0.05\paperheight}
+ \else %}{
+ \vspace*{-0.165\paperheight}
+ \fi %}
+ {
+ \usebeamercolor{frametitle}\colorlet{gotham@@tempColor}{bg}
+ \begin{tikzpicture}[overlay, remember~picture]
+ \fill[color=gotham@@tempColor] (current~page.north~west) rectangle ([shift = {(0, -0.45\paperheight)}] current~page.north~east);
+ \end{tikzpicture}
+ }
+
+ \hspace*{\sectionhoffset}
+ \begin{minipage}[b][0.45\paperheight]{\textwidth}
+ \usebeamertemplate*{section~title}
+ \end{minipage}
+ \\[-0.1\baselineskip]
+ \hspace*{-1.0cm}\noindent
+ \usebeamertemplate*{progress~bar~in~splitvert}
+
+ \newline
+ \hspace*{\sectionhoffset}
+ \begin{minipage}[t][0.5\paperheight]{\textwidth}
+ % \vspace{0.5\baselineskip}
+ \usebeamerfont{subsection~title}
+ \usebeamercolor[bg]{frametitle}
+ \usebeamertemplate*{subsection~title}
+ % \par
+ % \vspace{1em}%phantom subsection
+ \end{minipage}
+}
+\defbeamertemplate{subsection~frame}{gotham~splitvert~progressbar}{
+ \setbeamertemplate{background~canvas}[subsection/gotham]
+ % \setbeamercolor{frametitle}{}
+ \setlength{\sectionhoffset}{1cm}
+ \setbeamercolor{section~title}{use=frametitle, fg=frametitle.fg}
+ \setbeamercolor{subsection~title}{use=frametitle, fg=frametitle.bg}
+ \setbeamertemplate{progress~bar~in~splitvert}[display]
+ \setbeamertemplate{subsection~page}[gotham~splitvert~progressbar/simple]
+ % \usebeamertemplate*{subsection~page}% activated automatically
+}
+\defbeamertemplate{subsection~frame}{gotham~splitvert~simple}{
+ \setbeamertemplate{background~canvas}[subsection/gotham]
+ % \setbeamercolor{frametitle}{}
+ \setlength{\sectionhoffset}{1cm}
+ \setbeamercolor{section~title}{use=frametitle, fg=frametitle.fg}
+ \setbeamercolor{subsection~title}{use=frametitle, fg=frametitle.bg}
+ \setbeamertemplate{progress~bar~in~splitvert}[empty]
+ \setbeamertemplate{subsection~page}[gotham~splitvert~progressbar/simple]
+ % \usebeamertemplate*{subsection~page}% activated automatically
+}
+
+% Subsubection page splitvert.
+\defbeamertemplate{subsubsection~page}{gotham~splitvert~progressbar/simple}{
+ % \frametitle{subsubsection!}
+ % \IfEmpty{\insertframetitle}{
+ \ifx\beamer@frametitle\@empty
+ \vspace*{-0.05\paperheight}
+ \else %}{
+ \vspace*{-0.165\paperheight}
+ \fi %}
+ {
+ \usebeamercolor{frametitle}\colorlet{gotham@@tempColor}{bg}
+ \begin{tikzpicture}[overlay, remember~picture]
+ \fill[color=gotham@@tempColor] (current~page.north~west) rectangle ([shift = {(0, -0.45\paperheight)}] current~page.north~east);
+ \end{tikzpicture}
+ }
+
+ \hspace*{\sectionhoffset}
+ \begin{minipage}[b][0.45\paperheight]{\textwidth}
+ \usebeamertemplate*{section~title}
+ \end{minipage}
+ \\[-0.1\baselineskip]
+ \hspace*{-1.0cm}\noindent
+ \usebeamertemplate*{progress~bar~in~splitvert}
+
+ \newline
+ \hspace*{\sectionhoffset}
+ \begin{minipage}[t][0.5\paperheight]{\textwidth}
+ % \vspace{0.5\baselineskip}
+ \usebeamerfont{subsubsection~title}
+ \usebeamercolor[bg]{frametitle}
+ \usebeamertemplate*{subsection~title}
+ \par
+ \usebeamertemplate*{subsubsection~title}
+ \end{minipage}
+}
+\defbeamertemplate{subsubsection~frame}{gotham~splitvert~progressbar}{
+ \setbeamertemplate{background~canvas}[subsubsection/gotham]
+ % \setbeamercolor{frametitle}{}
+ \setlength{\sectionhoffset}{1cm}
+ \setbeamercolor{section~title}{use=frametitle, fg=frametitle.fg}
+ \setbeamercolor{subsection~title}{use=frametitle, fg=frametitle.bg}
+ \setbeamercolor{subsubsection~title}{use=frametitle, fg=frametitle.bg}
+ \setbeamertemplate{progress~bar~in~splitvert}[display]
+ \setbeamertemplate{subsubsection~page}[gotham~splitvert~progressbar/simple]
+ % \usebeamertemplate*{subsubsection~page}% activated automatically
+}
+\defbeamertemplate{subsubsection~frame}{gotham~splitvert~simple}{
+ \setbeamertemplate{background~canvas}[subsubsection/gotham]
+ % \setbeamercolor{frametitle}{}
+ \setlength{\sectionhoffset}{1cm}
+ \setbeamercolor{section~title}{use=frametitle, fg=frametitle.fg}
+ \setbeamercolor{subsection~title}{use=frametitle, fg=frametitle.bg}
+ \setbeamercolor{subsubsection~title}{use=frametitle, fg=frametitle.bg}
+ \setbeamertemplate{progress~bar~in~splitvert}[empty]
+ \setbeamertemplate{subsubsection~page}[gotham~splitvert~progressbar/simple]
+ % \usebeamertemplate*{subsubsection~page}% activated automatically
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{part|section|subsection|subsubsection page}{gotham progressvert}, \defbeamertemplate{part|section|subsection|subsubsection frame}{gotham progressvert}}
+% Templates for part \textbar section \textbar subsection \textbar subsubsection pages for 'gotham progressvert'.
+% \UnitTested
+% \TestFiles{gotham-test-041}
+% \begin{macrocode}
+
+% Part page progressvert.
+\defbeamertemplate{part~page}{gotham~progressvert}{
+ % \frametitle{part!}
+ % \IfEmpty{\insertframetitle}{
+ \ifx\beamer@frametitle\@empty
+ \vspace*{-0.05\paperheight}
+ \else %}{
+ \vspace*{-0.165\paperheight}
+ \fi %}
+ \setlength{\gotham@progressonsectionpage}{
+ \paperheight * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}
+ }
+ {
+ \usebeamercolor{frametitle}\colorlet{gotham@@tempColor}{bg}
+ \colorlet{gotham@@tempColorB}{fg}
+ \begin{tikzpicture}[overlay, remember~picture]
+ \fill[color=gotham@@tempColor]
+ ([shift={(0,0)}] current~page.north~west) --
+ ([shift={(0,-\gotham@progressonsectionpage)}] current~page.north~west) --
+ ([shift={(0,-\gotham@progressonsectionpage)}] current~page.north~east) --
+ ([shift={(0,0)}] current~page.north~east)
+ --cycle;
+ \node[color=gotham@@tempColorB, align=left, text~width=0.8\textwidth] at ([shift={(\sectionhoffset,0)}] current~page.center) {
+ {\usebeamerfont{part~title}
+ \partname \ \insertromanpartnumber
+ \\[1.75ex]
+ \insertpart
+ }
+ };
+
+ \clip
+ ([shift={(0,0)}] current~page.south~west) --
+ ([shift={(0,\paperheight-\gotham@progressonsectionpage)}] current~page.south~west) --
+ ([shift={(0,\paperheight-\gotham@progressonsectionpage)}] current~page.south~east) --
+ ([shift={(0,0)}] current~page.south~east)
+ --cycle;
+
+ \fill[color=gotham@@tempColorB]
+ ([shift={(0,0)}]current~page.south~west) --
+ ([shift={(0,\paperheight-\gotham@progressonsectionpage)}] current~page.south~west) --
+ ([shift={(0,\paperheight-\gotham@progressonsectionpage)}] current~page.south~east) --
+ ([shift={(0,0)}] current~page.south~east)
+ --cycle;
+ \node[color=gotham@@tempColor, align=left, text~width=0.8\textwidth] at ([shift={(\sectionhoffset,0)}] current~page.center) {
+ {\usebeamerfont{part~title}
+ \partname \ \insertromanpartnumber
+ \\
+ \insertpart
+ }
+ };
+ \end{tikzpicture}
+ }
+}
+\defbeamertemplate{part~frame}{gotham~progressvert}{
+ \setbeamertemplate{background~canvas}[part/gotham]
+ % \setbeamercolor{frametitle}{}
+ \setlength{\sectionhoffset}{1cm}
+ % \setbeamercolor{section~title}{use=frametitle, fg=frametitle.bg}
+ % \setbeamercolor{subsection~title}{use=frametitle, fg=frametitle.bg}
+ % \setbeamercolor{part~title}{use=frametitle, fg=frametitle.bg}
+ % \setbeamertemplate{progress~bar~in~splitvert}[display]
+ \setbeamertemplate{part~page}[gotham~progressvert]
+ % \usebeamertemplate*{section~page}% activated automatically
+}
+
+% Section page progressvert.
+\defbeamertemplate{section~page}{gotham~progressvert}{
+ % \frametitle{section!}
+ % \IfEmpty{\insertframetitle}{
+ \ifx\beamer@frametitle\@empty
+ \vspace*{-0.05\paperheight}
+ \else %}{
+ \vspace*{-0.165\paperheight}
+ \fi %}
+ \setlength{\gotham@progressonsectionpage}{
+ \paperheight * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}
+ }
+ {
+ \usebeamercolor{frametitle}\colorlet{gotham@@tempColor}{bg}
+ \colorlet{gotham@@tempColorB}{fg}
+ \begin{tikzpicture}[overlay, remember~picture]
+ \fill[color=gotham@@tempColor]
+ ([shift={(0,0)}] current~page.north~west) --
+ ([shift={(0,-\gotham@progressonsectionpage)}] current~page.north~west) --
+ ([shift={(0,-\gotham@progressonsectionpage)}] current~page.north~east) --
+ ([shift={(0,0)}] current~page.north~east)
+ --cycle;
+ \node[color=gotham@@tempColorB, align=left, text~width=0.8\textwidth] at ([shift={(\sectionhoffset,0)}] current~page.center) {
+ {\usebeamerfont{section~title}
+ \insertsectionnumber.~
+ \insertsectionhead}
+ };
+
+ \clip
+ ([shift={(0,0)}] current~page.south~west) --
+ ([shift={(0,\paperheight-\gotham@progressonsectionpage)}] current~page.south~west) --
+ ([shift={(0,\paperheight-\gotham@progressonsectionpage)}] current~page.south~east) --
+ ([shift={(0,0)}] current~page.south~east)
+ --cycle;
+
+ \fill[color=gotham@@tempColorB]
+ ([shift={(0,0)}]current~page.south~west) --
+ ([shift={(0,\paperheight-\gotham@progressonsectionpage)}] current~page.south~west) --
+ ([shift={(0,\paperheight-\gotham@progressonsectionpage)}] current~page.south~east) --
+ ([shift={(0,0)}] current~page.south~east)
+ --cycle;
+ \node[color=gotham@@tempColor, align=left, text~width=0.8\textwidth] at ([shift={(\sectionhoffset,0)}] current~page.center) {
+ {\usebeamerfont{section~title}
+ \insertsectionnumber.~
+ \insertsectionhead}
+ };
+ \end{tikzpicture}
+ }
+}
+\defbeamertemplate{section~frame}{gotham~progressvert}{
+ \setbeamertemplate{background~canvas}[section/gotham]
+ % \setbeamercolor{frametitle}{}
+ \setlength{\sectionhoffset}{1cm}
+ % \setbeamercolor{section~title}{use=frametitle, fg=frametitle.bg}
+ % \setbeamercolor{subsection~title}{use=frametitle, fg=frametitle.bg}
+ % \setbeamercolor{section~title}{use=frametitle, fg=frametitle.bg}
+ % \setbeamertemplate{progress~bar~in~splitvert}[display]
+ \setbeamertemplate{section~page}[gotham~progressvert]
+ % \usebeamertemplate*{section~page}% activated automatically
+}
+
+% Subection page progressvert.
+\defbeamertemplate{subsection~page}{gotham~progressvert}{
+ % \frametitle{subsection!}
+ % \IfEmpty{\insertframetitle}{
+ \ifx\beamer@frametitle\@empty
+ \vspace*{-0.05\paperheight}
+ \else %}{
+ \vspace*{-0.165\paperheight}
+ \fi %}
+ \setlength{\gotham@progressonsectionpage}{
+ \paperheight * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}
+ }
+ {
+ \usebeamercolor{frametitle}\colorlet{gotham@@tempColor}{bg}
+ \colorlet{gotham@@tempColorB}{fg}
+ \begin{tikzpicture}[overlay, remember~picture]
+ \fill[color=gotham@@tempColor]
+ ([shift={(0,0)}] current~page.north~west) --
+ ([shift={(0,-\gotham@progressonsectionpage)}] current~page.north~west) --
+ ([shift={(0,-\gotham@progressonsectionpage)}] current~page.north~east) --
+ ([shift={(0,0)}] current~page.north~east)
+ --cycle;
+ \node[color=gotham@@tempColorB, align=left, text~width=0.8\textwidth] at ([shift={(\sectionhoffset,0)}] current~page.center) {
+ {\usebeamerfont{section~title}
+ \insertsectionnumber.~
+ \insertsectionhead}
+ \\
+ {\usebeamerfont{subsection~title}
+ \insertsectionnumber.\insertsubsectionnumber.~
+ \insertsubsectionhead}
+ };
+
+ \clip
+ ([shift={(0,0)}] current~page.south~west) --
+ ([shift={(0,\paperheight-\gotham@progressonsectionpage)}] current~page.south~west) --
+ ([shift={(0,\paperheight-\gotham@progressonsectionpage)}] current~page.south~east) --
+ ([shift={(0,0)}] current~page.south~east)
+ --cycle;
+
+ \fill[color=gotham@@tempColorB]
+ ([shift={(0,0)}]current~page.south~west) --
+ ([shift={(0,\paperheight-\gotham@progressonsectionpage)}] current~page.south~west) --
+ ([shift={(0,\paperheight-\gotham@progressonsectionpage)}] current~page.south~east) --
+ ([shift={(0,0)}] current~page.south~east)
+ --cycle;
+ \node[color=gotham@@tempColor, align=left, text~width=0.8\textwidth] at ([shift={(\sectionhoffset,0)}] current~page.center) {
+ {\usebeamerfont{section~title}
+ \insertsectionnumber.~
+ \insertsectionhead}
+ \\
+ {\usebeamerfont{subsection~title}
+ \insertsectionnumber.\insertsubsectionnumber.~
+ \insertsubsectionhead}
+ };
+ \end{tikzpicture}
+ }
+}
+\defbeamertemplate{subsection~frame}{gotham~progressvert}{
+ \setbeamertemplate{background~canvas}[subsection/gotham]
+ % \setbeamercolor{frametitle}{}
+ \setlength{\sectionhoffset}{1cm}
+ % \setbeamercolor{section~title}{use=frametitle, fg=frametitle.bg}
+ % \setbeamercolor{subsection~title}{use=frametitle, fg=frametitle.bg}
+ % \setbeamercolor{subsection~title}{use=frametitle, fg=frametitle.bg}
+ % \setbeamertemplate{progress~bar~in~splitvert}[display]
+ \setbeamertemplate{subsection~page}[gotham~progressvert]
+ % \usebeamertemplate*{subsection~page}% activated automatically
+}
+
+% Subsubection page progressvert.
+\defbeamertemplate{subsubsection~page}{gotham~progressvert}{
+ % \frametitle{subsubsection!}
+ % \IfEmpty{\insertframetitle}{
+ \ifx\beamer@frametitle\@empty
+ \vspace*{-0.05\paperheight}
+ \else %}{
+ \vspace*{-0.165\paperheight}
+ \fi %}
+ \setlength{\gotham@progressonsectionpage}{
+ \paperheight * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}
+ }
+ {
+ \usebeamercolor{frametitle}\colorlet{gotham@@tempColor}{bg}
+ \colorlet{gotham@@tempColorB}{fg}
+ \begin{tikzpicture}[overlay, remember~picture]
+ \fill[color=gotham@@tempColor]
+ ([shift={(0,0)}] current~page.north~west) --
+ ([shift={(0,-\gotham@progressonsectionpage)}] current~page.north~west) --
+ ([shift={(0,-\gotham@progressonsectionpage)}] current~page.north~east) --
+ ([shift={(0,0)}] current~page.north~east)
+ --cycle;
+ \node[color=gotham@@tempColorB, align=left, text~width=0.8\textwidth] at ([shift={(\sectionhoffset,0)}] current~page.center) {
+ {\usebeamerfont{section~title}
+ \insertsectionnumber.~
+ \insertsectionhead}
+ \\
+ {\usebeamerfont{subsection~title}
+ \insertsectionnumber.\insertsubsectionnumber.~
+ \insertsubsectionhead}
+ \\
+ {\usebeamerfont{subsubsection~title}
+ \insertsectionnumber.\insertsubsectionnumber.\insertsubsubsectionnumber.~
+ \insertsubsubsectionhead}
+ };
+
+ \clip
+ ([shift={(0,0)}] current~page.south~west) --
+ ([shift={(0,\paperheight-\gotham@progressonsectionpage)}] current~page.south~west) --
+ ([shift={(0,\paperheight-\gotham@progressonsectionpage)}] current~page.south~east) --
+ ([shift={(0,0)}] current~page.south~east)
+ --cycle;
+
+ \fill[color=gotham@@tempColorB]
+ ([shift={(0,0)}]current~page.south~west) --
+ ([shift={(0,\paperheight-\gotham@progressonsectionpage)}] current~page.south~west) --
+ ([shift={(0,\paperheight-\gotham@progressonsectionpage)}] current~page.south~east) --
+ ([shift={(0,0)}] current~page.south~east)
+ --cycle;
+ \node[color=gotham@@tempColor, align=left, text~width=0.8\textwidth] at ([shift={(\sectionhoffset,0)}] current~page.center) {
+ {\usebeamerfont{section~title}
+ \insertsectionnumber.~
+ \insertsectionhead}
+ \\
+ {\usebeamerfont{subsection~title}
+ \insertsectionnumber.\insertsubsectionnumber.~
+ \insertsubsectionhead}
+ \\
+ {\usebeamerfont{subsubsection~title}
+ \insertsectionnumber.\insertsubsectionnumber.\insertsubsubsectionnumber.~
+ \insertsubsubsectionhead}
+ };
+ \end{tikzpicture}
+ }
+}
+\defbeamertemplate{subsubsection~frame}{gotham~progressvert}{
+ \setbeamertemplate{background~canvas}[subsubsection/gotham]
+ % \setbeamercolor{frametitle}{}
+ \setlength{\sectionhoffset}{1cm}
+ % \setbeamercolor{section~title}{use=frametitle, fg=frametitle.bg}
+ % \setbeamercolor{subsection~title}{use=frametitle, fg=frametitle.bg}
+ % \setbeamercolor{subsubsection~title}{use=frametitle, fg=frametitle.bg}
+ % \setbeamertemplate{progress~bar~in~splitvert}[display]
+ \setbeamertemplate{subsubsection~page}[gotham~progressvert]
+ % \usebeamertemplate*{subsubsection~page}% activated automatically
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+% \begin{documentation}
+% \begin{function}{\useinnertheme}
+% \begin{syntax}
+% \cs{useinnertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{partframe template} = \oarg{\defopt{gotham progressbar} \textbar gotham simple \textbar gotham splitvert progressbar \textbar gotham splitvert simple \textbar gotham progressvert \textbar ...}
+% \meta{partframe default} = \oarg{\defopt{on} \textbar off}
+% \meta{sectionframe template} = \oarg{\defopt{gotham progressbar} \textbar gotham simple \textbar gotham splitvert progressbar \textbar gotham splitvert simple \textbar gotham progressvert \textbar ...}
+% \meta{sectionframe default} = \oarg{\defopt{on} \textbar off}
+% \meta{subsectionframe template} = \oarg{\defopt{gotham progressbar} \textbar gotham simple \textbar gotham splitvert progressbar \textbar gotham splitvert simple \textbar gotham progressvert \textbar ...}
+% \meta{subsectionframe default} = \oarg{\defopt{on} \textbar off}
+% \meta{subsubframe template} = \oarg{\defopt{gotham progressbar} \textbar gotham simple \textbar gotham splitvert progressbar \textbar gotham splitvert simple \textbar gotham progressvert \textbar ...}
+% \meta{subsubframe default} = \oarg{\defopt{on} \textbar off}
+% \end{syntax}
+% The 'package' (useinnertheme) options can control |partframe templates| (or |sectionframe|, |subsectionframe| and |subsubsectionframe| respectively), which define the style of the partframe (or |sectionframe|, |subsectionframe| and |subsubsectionframe| respectively) displayed at every new beginning of sectioning.
+% These templates can be disabled (or re-enabled) by default using the option |partframe default| (or |sectionframe|, |subsectionframe| and |subsubsectionframe| respectively).
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{inner key -- interface}
+% Controls the inner settings for partframe (or |sectionframe|, |subsectionframe| and |subsubsectionframe| respectively) and standin.
+% \UnitTested
+% \TestFiles{gotham-test-041}
+% \begin{macrocode}
+\keys_define:nn { gotham / inner }{
+ % partframe template
+ partframe~template .usage:n = { general },
+ partframe~template .default:n = { gotham~progressbar },
+ partframe~template .code:n = { \__gotham_set_template:nn{part~frame}{#1} }
+}
+\keys_define:nn { gotham / inner }
+{
+ % partframe default
+ partframe~default .choice:,
+ partframe~default .usage:n = { general },
+ partframe~default .default:n = { true },
+
+ partframe~default / true .code:n = { \__gotham_inner_enable_partpage: },
+ partframe~default / on .code:n = { \__gotham_inner_enable_partpage: },
+ partframe~default / enable .code:n = { \__gotham_inner_enable_partpage: },
+
+ partframe~default / false .code:n = { \__gotham_inner_disable_partpage: },
+ partframe~default / off .code:n = { \__gotham_inner_disable_partpage: },
+ partframe~default / disable .code:n = { \__gotham_inner_disable_partpage: },
+
+ partframe~default / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'partframe~default',~so~being~ignored. }{helping~message: partframe~default / unknown} },
+}
+
+\keys_define:nn { gotham / inner }{
+ % sectionframe template
+ sectionframe~template .usage:n = { general },
+ sectionframe~template .default:n = { gotham~progressbar },
+ sectionframe~template .code:n = { \__gotham_set_template:nn{section~frame}{#1} }
+}
+\keys_define:nn { gotham / inner }
+{
+ % sectionframe default
+ sectionframe~default .choice:,
+ sectionframe~default .usage:n = { general },
+ sectionframe~default .default:n = { true },
+
+ sectionframe~default / true .code:n = { \__gotham_inner_enable_sectionpage: },
+ sectionframe~default / on .code:n = { \__gotham_inner_enable_sectionpage: },
+ sectionframe~default / enable .code:n = { \__gotham_inner_enable_sectionpage: },
+
+ sectionframe~default / false .code:n = { \__gotham_inner_disable_sectionpage: },
+ sectionframe~default / off .code:n = { \__gotham_inner_disable_sectionpage: },
+ sectionframe~default / disable .code:n = { \__gotham_inner_disable_sectionpage: },
+
+ sectionframe~default / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'sectionframe~default',~so~being~ignored. }{helping~message: sectionframe~default / unknown} },
+}
+
+\keys_define:nn { gotham / inner }{
+ % subsectionframe template
+ subsectionframe~template .usage:n = { general },
+ subsectionframe~template .default:n = { gotham~progressbar },
+ subsectionframe~template .code:n = { \__gotham_set_template:nn{subsection~frame}{#1} }
+}
+\keys_define:nn { gotham / inner }
+{
+ % subsectionframe default
+ subsectionframe~default .choice:,
+ subsectionframe~default .usage:n = { general },
+ subsectionframe~default .default:n = { true },
+
+ subsectionframe~default / true .code:n = { \__gotham_inner_enable_subsectionpage: },
+ subsectionframe~default / on .code:n = { \__gotham_inner_enable_subsectionpage: },
+ subsectionframe~default / enable .code:n = { \__gotham_inner_enable_subsectionpage: },
+
+ subsectionframe~default / false .code:n = { \__gotham_inner_disable_subsectionpage: },
+ subsectionframe~default / off .code:n = { \__gotham_inner_disable_subsectionpage: },
+ subsectionframe~default / disable .code:n = { \__gotham_inner_disable_subsectionpage: },
+
+ subsectionframe~default / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'subsectionframe~default',~so~being~ignored. }{helping~message: subsectionframe~default / unknown} },
+}
+
+\keys_define:nn { gotham / inner }{
+ % subsubsectionframe template
+ subsubsectionframe~template .usage:n = { general },
+ subsubsectionframe~template .default:n = { gotham~progressbar },
+ subsubsectionframe~template .code:n = { \__gotham_set_template:nn{subsubsection~frame}{#1} }
+}
+\keys_define:nn { gotham / inner }
+{
+ % subsubsectionframe default
+ subsubsectionframe~default .choice:,
+ subsubsectionframe~default .usage:n = { general },
+ subsubsectionframe~default .default:n = { true },
+
+ subsubsectionframe~default / true .code:n = { \__gotham_inner_enable_subsubsectionpage: },
+ subsubsectionframe~default / on .code:n = { \__gotham_inner_enable_subsubsectionpage: },
+ subsubsectionframe~default / enable .code:n = { \__gotham_inner_enable_subsubsectionpage: },
+
+ subsubsectionframe~default / false .code:n = { \__gotham_inner_disable_subsubsectionpage: },
+ subsubsectionframe~default / off .code:n = { \__gotham_inner_disable_subsubsectionpage: },
+ subsubsectionframe~default / disable .code:n = { \__gotham_inner_disable_subsubsectionpage: },
+
+ subsubsectionframe~default / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'subsubsectionframe~default',~so~being~ignored. }{helping~message: subsubsectionframe~default / unknown} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+%%%% Table of Content %%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% \begin{implementation}
+% \begin{macro}{\tikzset{section~number/.style={}} }
+% Definition of how sections, subsections and subsubsections' numbers will appear in 'gotham bullet' style for tables of contents.
+% \UnitTested
+% \TestFiles{gotham-test-042}
+% \begin{macrocode}
+\tikzset{section~number/.style={
+ circle,
+ fill=colorAlert,
+ minimum~size=0.4em,
+ text=colorAlert!10,
+ inner~sep=1.5pt,
+ },
+ section/.style={
+ draw=none,
+ rectangle,
+ minimum~height=1em,
+ minimum~width=0.8\textwidth,
+ text~width=0.8\textwidth,
+ text=fg,
+ align=left
+ },
+ subsection~number/.style={
+ circle,
+ fill=colorBackElement!50,
+ inner~sep=0pt,
+ minimum~size=0.15cm,
+ },
+ subsection/.style={
+ draw=none,
+ rectangle,
+ minimum~height=1em,
+ minimum~width=0.8\textwidth,
+ text~width=0.8\textwidth,
+ text=fg!80,
+ align=left
+ },
+ subsubsection~number/.style={
+ circle,
+ fill=colorBackElement!50,
+ inner~sep=0pt,
+ minimum~size=0.06cm,
+ },
+ subsubsection/.style={
+ draw=none,
+ rectangle,
+ minimum~height=1em,
+ minimum~width=0.8\textwidth,
+ text~width=0.8\textwidth,
+ text=fg!80,
+ align=left
+ },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{section~in~toc}{gotham~bullet}}
+% Template definitions for |gotham bullet| style of ToC that appear in section \textbar subsection \textbar subsubsection frame.
+% \UnitTested
+% \TestFiles{gotham-test-042}
+% \begin{macrocode}
+\defbeamertemplate{section~in~toc}{gotham~bullet}{
+ \hspace*{0.4cm}\tikz[baseline=-0.5ex]\node[section~number]{\textbf{\small\inserttocsectionnumber}};
+ \ \tikz[baseline=-0.5ex]\node[section]{\usebeamerfont*{toc~title} \inserttocsection};\\[-0.35cm]
+ \hspace*{1.13cm}{\usebeamercolor*[fg]{footer} \rule{0.6\paperwidth}{0.2pt}\\\nointerlineskip}
+}
+\defbeamertemplate{subsection~in~toc}{gotham~bullet}{
+ \hspace*{0.53cm}\tikz[baseline=-0.5ex]\node[subsection~number]{};
+ \hspace*{0.5cm}\tikz[baseline=-0.5ex]\node[subsection]{\usebeamerfont*{toc~subtitle}\inserttocsubsection};\\[-0.2cm]
+}
+\defbeamertemplate{subsubsection~in~toc}{gotham~bullet}{
+ \hspace*{0.58cm}\tikz[baseline=-0.5ex]\node[subsubsection~number]{};
+ \hspace*{0.69cm}\tikz[baseline=-0.5ex]\node[subsubsection]{\usebeamerfont*{toc~subtitle}\inserttocsubsubsection};\\[-0.2cm]
+}
+% Shaded for sections already done in the presentation.
+\defbeamertemplate{section~in~toc~shaded}{gotham~bullet}{
+ \hspace*{0.4cm}\tikz[baseline=-0.5ex]\node[section~number, fill=colorBackElement!40, text=background]{\usebeamerfont*{toc~subtitle}\textbf{\inserttocsectionnumber}};
+ \ \tikz[baseline=-0.5ex]\node[section, text=colorExample!20]{\usebeamerfont*{toc~title} \inserttocsection};\\[-0.35cm]
+ \hspace*{1.3cm}{\usebeamercolor*[fg]{footer} \rule{0.6\paperwidth}{0.2pt}\\\nointerlineskip}
+}
+\defbeamertemplate{subsection~in~toc~shaded}{gotham~bullet}{
+ \hspace*{0.55cm}\tikz[baseline=-0.5ex]\node[subsection~number,fill=colorBackElement!20]{};
+ \hspace*{0.5cm}\tikz[baseline=-0.5ex]\node[subsection, text=colorBackElement!20]{};\\[-0.2cm]
+}
+\defbeamertemplate{subsubsection~in~toc~shaded}{gotham~bullet}{
+ \hspace*{0.58cm}\tikz[baseline=-0.5ex]\node[subsubsection~number,fill=colorBackElement!20]{};
+ \hspace*{0.69cm}\tikz[baseline=-0.5ex]\node[subsubsection,text=colorBackElement!20]{\usebeamerfont*{toc~subtitle}\inserttocsubsubsection};\\[-0.2cm]
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{section~in~toc}{gotham~bullet}}
+% Template definitions for |gotham simple| style of ToC that appear in section \textbar subsection \textbar subsubsection frame.
+% \UnitTested
+% \TestFiles{gotham-test-042}
+% \begin{macrocode}
+\defbeamertemplate{part~in~toc}{gotham~simple}{
+ {{\inserttocpartnumber}.}~\inserttocpart
+ \\
+}
+\defbeamertemplate{section~in~toc}{gotham~simple}{
+ {{\inserttocsectionnumber}.}~\inserttocsection
+ \\
+}
+\defbeamertemplate{subsection~in~toc}{gotham~simple}{
+ \quad{{\inserttocsectionnumber}.\inserttocsubsectionnumber.}~\inserttocsubsection%
+ \\
+}
+\defbeamertemplate{subsubsection~in~toc}{gotham~simple}{
+ \qquad{{\inserttocsectionnumber}.\inserttocsubsectionnumber.\inserttocsubsubsectionnumber.}~\inserttocsubsubsection
+ \\
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{background~canvas}{toc/gotham~simple}, \defbeamertemplate{toc~page}{gotham~simple|bullet}}
+% Definition of toc page style named gotham simple and gotham bullet, used for table of content pages.
+% Both are using a dedicated background canvas.
+% \UnitTested
+% \TestFiles{gotham-test-042}
+% \begin{macrocode}
+\defbeamertemplate{background~canvas}{toc/gotham~simple}{
+ \ifbeamercolorempty[bg]{standin}{}{
+ \color{bg}\vrule width\paperwidth height\paperheight
+ }
+}
+\defbeamertemplate{toc~page}{gotham~simple}{
+ \setbeamertemplate{part~in~toc}[gotham~simple]
+ \setbeamertemplate{section~in~toc}[gotham~simple]
+ \setbeamertemplate{subsection~in~toc}[gotham~simple]
+ \setbeamertemplate{subsubsection~in~toc}[gotham~simple]
+ \setbeamertemplate{background~canvas}[toc/gotham~simple]
+}
+\defbeamertemplate{toc~page}{gotham~bullet}{
+ \setbeamertemplate{part~in~toc}[gotham~bullet]
+ \setbeamertemplate{section~in~toc}[gotham~bullet]
+ \setbeamertemplate{subsection~in~toc}[gotham~bullet]
+ \setbeamertemplate{subsubsection~in~toc}[gotham~bullet]
+ \setbeamertemplate{background~canvas}[toc/gotham~simple]
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[toc]}
+% Add a frame option |toc| to display the toc frame template.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[toc]}
+% Add a frame option |toc| to display the toc frame template.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-042}
+% \begin{macrocode}
+\newenvironment{tocenv}{
+ \usebeamertemplate{toc~page}
+}{}
+\__gotham_add_beamerframe_key:n {toc}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{background~canvas}{toc~part|section|subsection~gotham}}
+% Defintion of the background canvas used by the toc in part\,\textbar\,section\,\textbar\,subsection.
+% \UnitTested
+% \TestFiles{gotham-test-042}
+% \begin{macrocode}
+\defbeamertemplate{background~canvas}{toc~part~gotham}{
+ \ifbeamercolorempty[bg]{normal~text}{}{\color{bg}\vrule width\paperwidth height\paperheight}
+}
+\defbeamertemplate{background~canvas}{toc~section~gotham}{
+ \ifbeamercolorempty[bg]{normal~text}{}{\color{bg}\vrule width\paperwidth height\paperheight}
+}
+\defbeamertemplate{background~canvas}{toc~subsection~gotham}{
+ \ifbeamercolorempty[bg]{normal~text}{}{\color{bg}\vrule width\paperwidth height\paperheight}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{toc~part~frame}{gotham~simple}}
+% Definition of the toc in part\,\textbar\,section\,\textbar\,subsection templates for gotham simple style.
+% \UnitTested
+% \TestFiles{gotham-test-042}
+% \begin{macrocode}
+\defbeamertemplate{toc~part~frame}{gotham~simple}{
+ \setbeamertemplate{part~in~toc}[gotham~simple]
+ \setbeamertemplate{section~in~toc}[gotham~simple]
+ \setbeamertemplate{subsection~in~toc}[gotham~simple]
+ \setbeamertemplate{subsubsection~in~toc}[gotham~simple]
+ \setbeamertemplate{background~canvas}[toc~part~gotham]
+ \setbeamertemplate{frametitle}[toc~gotham]
+ % \usebeamertemplate*{part~page}% already included
+}
+\defbeamertemplate{toc~section~frame}{gotham~simple}{
+ \setbeamertemplate{part~in~toc}[gotham~simple]
+ \setbeamertemplate{section~in~toc}[gotham~simple]
+ \setbeamertemplate{subsection~in~toc}[gotham~simple]
+ \setbeamertemplate{subsubsection~in~toc}[gotham~simple]
+ \setbeamertemplate{background~canvas}[toc~section~gotham]
+ \setbeamertemplate{frametitle}[toc~gotham]%
+ % \usebeamertemplate*{section~page}% already included
+}
+\defbeamertemplate{toc~subsection~frame}{gotham~simple}{
+ \setbeamertemplate{part~in~toc}[gotham~simple]
+ \setbeamertemplate{section~in~toc}[gotham~simple]
+ \setbeamertemplate{subsection~in~toc}[gotham~simple]
+ \setbeamertemplate{subsubsection~in~toc}[gotham~simple]
+ \setbeamertemplate{background~canvas}[toc~subsection~gotham]
+ \setbeamertemplate{frametitle}[toc~gotham]
+ % \usebeamertemplate*{subsection~page}% already included
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{toc~part~frame}{gotham~bullet}}
+% Definition of the toc in part\,\textbar\,section\,\textbar\,subsection templates for gotham bullet style.
+% \UnitTested
+% \TestFiles{gotham-test-042}
+% \begin{macrocode}
+\defbeamertemplate{toc~part~frame}{gotham~bullet}{
+ \setbeamertemplate{part~in~toc}[gotham~bullet]
+ \setbeamertemplate{section~in~toc}[gotham~bullet]
+ \setbeamertemplate{subsection~in~toc}[gotham~bullet]
+ \setbeamertemplate{subsubsection~in~toc}[gotham~bullet]
+ \setbeamertemplate{background~canvas}[toc~part~gotham]
+ \setbeamertemplate{frametitle}[toc~gotham]
+ % \usebeamertemplate*{part~page}% already included
+}
+\defbeamertemplate{toc~section~frame}{gotham~bullet}{
+ \setbeamertemplate{part~in~toc}[gotham~bullet]
+ \setbeamertemplate{section~in~toc}[gotham~bullet]
+ \setbeamertemplate{subsection~in~toc}[gotham~bullet]
+ \setbeamertemplate{subsubsection~in~toc}[gotham~bullet]
+ \setbeamertemplate{background~canvas}[toc~section~gotham]
+ \setbeamertemplate{frametitle}[toc~gotham]%
+ % \usebeamertemplate*{section~page}% already included
+}
+\defbeamertemplate{toc~subsection~frame}{gotham~bullet}{
+ \setbeamertemplate{part~in~toc}[gotham~bullet]
+ \setbeamertemplate{section~in~toc}[gotham~bullet]
+ \setbeamertemplate{subsection~in~toc}[gotham~bullet]
+ \setbeamertemplate{subsubsection~in~toc}[gotham~bullet]
+ \setbeamertemplate{background~canvas}[toc~subsection~gotham]
+ \setbeamertemplate{frametitle}[toc~gotham]
+ % \usebeamertemplate*{subsection~page}% already included
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[tocpart]}
+% Add a frame option |tocpart| to display the tocpart frame template.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[tocpart]}
+% Add a frame option |tocpart| to display the tocpart frame template.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-042}
+% \begin{macrocode}
+\bool_new:N \l_gotham_tocpartframe
+\bool_set_false:N \l_gotham_tocpartframe
+\define@key{beamerframe}{tocpart}[true]{
+ \bool_set_true:N \l_gotham_tocpartframe
+ \begingroup
+ \usebeamertemplate{toc~part~frame}
+}
+\apptocmd{\beamer@reseteecodes}{
+ \bool_if:NTF \l_gotham_tocpartframe {
+ \endgroup
+ \bool_set_false:N \l_gotham_tocpartframe
+ }{}
+}{}{}
+% \define@key{beamerframe}{tocpart}[true]{
+% \thispagestyle{navigation@tocpart}
+% }
+% \def\ps@navigation@tocpart{
+% \usebeamertemplate{toc~part~frame}
+% \@nameuse{ps@navigation}
+% }
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[tocsec]}
+% Add a frame option |tocsec| to display the tocsec frame template.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[tocsec]}
+% Add a frame option |tocsec| to display the tocsec frame template.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-042}
+% \begin{macrocode}
+\bool_new:N \l_gotham_tocsectionframe
+\bool_set_false:N \l_gotham_tocsectionframe
+\define@key{beamerframe}{tocsec}[true]{
+ \bool_set_true:N \l_gotham_tocsectionframe
+ \begingroup
+ \usebeamertemplate{toc~section~frame}
+}
+\apptocmd{\beamer@reseteecodes}{
+ \bool_if:NTF \l_gotham_tocsectionframe {
+ \endgroup
+ \bool_set_false:N \l_gotham_tocsectionframe
+ }{}
+}{}{}
+% \define@key{beamerframe}{tocsec}[true]{
+% \thispagestyle{navigation@tocsec}
+% }
+% \def\ps@navigation@tocsec{
+% \usebeamertemplate{toc~section~frame}
+% \@nameuse{ps@navigation}
+% }
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[tocsubsec]}
+% Add a frame option |tocsubsec| to display the tocsubsec frame template.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[tocsubsec]}
+% Add a frame option |tocsubsec| to display the tocsubsec frame template.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-042}
+% \begin{macrocode}
+\bool_new:N \l_gotham_tocsubsectionframe
+\bool_set_false:N \l_gotham_tocsubsectionframe
+\define@key{beamerframe}{tocsubsec}[true]{
+ \bool_set_true:N \l_gotham_tocsubsectionframe
+ \begingroup
+ \usebeamertemplate{toc~subsection~frame}
+}
+\apptocmd{\beamer@reseteecodes}{
+ \bool_if:NTF \l_gotham_tocsubsectionframe {
+ \endgroup
+ \bool_set_false:N \l_gotham_tocsubsectionframe
+ }{}
+}{}{}
+% \define@key{beamerframe}{tocsubsec}[true]{
+% \thispagestyle{navigation@tocsubsec}
+% }
+% \def\ps@navigation@tocsubsec{
+% \usebeamertemplate{toc~subsection~frame}
+% \@nameuse{ps@navigation}
+% }
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[tocsubsubsec]}
+% Add a frame option |tocsubsubsec| to display the tocsubsubsec frame template.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[tocsubsubsec]}
+% Add a frame option |tocsubsubsec| to display the tocsubsubsec frame template.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-042}
+% \begin{macrocode}
+\bool_new:N \l_gotham_tocsubsubsectionframe
+\bool_set_false:N \l_gotham_tocsubsubsectionframe
+\define@key{beamerframe}{tocsubsubsec}[true]{
+ \bool_set_true:N \l_gotham_tocsubsubsectionframe
+ \begingroup
+ \usebeamertemplate{toc~subsubsection~frame}
+}
+\apptocmd{\beamer@reseteecodes}{
+ \bool_if:NTF \l_gotham_tocsubsubsectionframe {
+ \endgroup
+ \bool_set_false:N \l_gotham_tocsubsubsectionframe
+ }{}
+}{}{}
+% \define@key{beamerframe}{tocsubsubsec}[true]{
+% \thispagestyle{navigation@tocsubsubsec}
+% }
+% \def\ps@navigation@tocsubsubsec{
+% \usebeamertemplate{toc~subsubsection~frame}
+% \@nameuse{ps@navigation}
+% }
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\useinnertheme}
+% \begin{syntax}
+% \cs{useinnertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{tocframe template} = \oarg{\defopt{gotham bullet} \textbar gotham simple \textbar ...}
+% \meta{parttocframe template default} = \oarg{\defopt{gotham simple} \textbar gotham bullet}
+% \meta{parttocframe default} = \oarg{\defopt{on} \textbar off}
+% \meta{sectocframe template default} = \oarg{\defopt{gotham simple} \textbar gotham bullet}
+% \meta{sectocframe default} = \oarg{\defopt{on} \textbar off}
+% \meta{subsectocframe template default} = \oarg{\defopt{gotham simple} \textbar gotham bullet}
+% \meta{subsectocframe default} = \oarg{\defopt{on} \textbar off}
+% \end{syntax}
+% The 'package' (useinnertheme) options can control |parttocframe templates| (or |sectocframe| and |subsectocframe| respectively), which define the style of the table of content for partframe (or |sectionframe|, and |subsectionframe| respectively) displayed at every new beginning of sectioning.
+% These templates can be disabled (or re-enabled) by default using the option |parttocframe default| (or |sectocframe| and |subssectocframe| respectively).
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{inner key -- interface}
+% Controls the inner settings for |parttocframe| (or |sectocframe|, |subsectocframe| respectively).
+% \UnitTested
+% \TestFiles{gotham-test-041}
+% \begin{macrocode}
+\keys_define:nn { gotham / inner }
+{
+ % TOC style
+ tocframe~template .usage:n = { general },
+ tocframe~template .default:n = { gotham~bullet },
+ tocframe~template .code:n = { \__gotham_set_template:nn{toc~page}{#1} }
+}
+
+\keys_define:nn { gotham / inner }{
+ % parttocframe template
+ parttocframe~template .usage:n = { general },
+ parttocframe~template .default:n = { gotham~simple },
+ parttocframe~template .code:n = { \__gotham_set_template:nn{toc~part~frame}{#1} }
+}
+\keys_define:nn { gotham / inner }
+{
+ % parttocframe default
+ parttocframe~default .choice:,
+ parttocframe~default .usage:n = { general },
+ parttocframe~default .default:n = { true },
+
+ parttocframe~default / true .code:n = { \booltrue{partContent} },
+ parttocframe~default / on .code:n = { \booltrue{partContent} },
+ parttocframe~default / enable .code:n = { \booltrue{partContent} },
+
+ parttocframe~default / false .code:n = { \boolfalse{partContent} },
+ parttocframe~default / off .code:n = { \boolfalse{partContent} },
+ parttocframe~default / disable .code:n = { \boolfalse{partContent} },
+
+ parttocframe~default / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'parttocframe~default',~so~being~ignored. }{helping~message: parttocframe~default / unknown} },
+}
+
+\keys_define:nn { gotham / inner }{
+ % sectiontocframe template
+ sectiontocframe~template .usage:n = { general },
+ sectiontocframe~template .default:n = { gotham~simple },
+ sectiontocframe~template .code:n = { \__gotham_set_template:nn{toc~section~frame}{#1} }
+}
+\keys_define:nn { gotham / inner }
+{
+ % sectiontocframe default
+ sectiontocframe~default .choice:,
+ sectiontocframe~default .usage:n = { general },
+ sectiontocframe~default .default:n = { true },
+
+ sectiontocframe~default / true .code:n = { \booltrue{sectionContent} },
+ sectiontocframe~default / on .code:n = { \booltrue{sectionContent} },
+ sectiontocframe~default / enable .code:n = { \booltrue{sectionContent} },
+
+ sectiontocframe~default / false .code:n = { \boolfalse{sectionContent} },
+ sectiontocframe~default / off .code:n = { \boolfalse{sectionContent} },
+ sectiontocframe~default / disable .code:n = { \boolfalse{sectionContent} },
+
+ sectiontocframe~default / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'sectiontocframe~default',~so~being~ignored. }{helping~message: sectiontocframe~default / unknown} },
+}
+
+\keys_define:nn { gotham / inner }{
+ % subsectiontocframe template
+ subsectiontocframe~template .usage:n = { general },
+ subsectiontocframe~template .default:n = { gotham~simple },
+ subsectiontocframe~template .code:n = { \__gotham_set_template:nn{toc~subsection~frame}{#1} }
+}
+\keys_define:nn { gotham / inner }
+{
+ % subsectiontocframe default
+ subsectiontocframe~default .choice:,
+ subsectiontocframe~default .usage:n = { general },
+ subsectiontocframe~default .default:n = { true },
+
+ subsectiontocframe~default / true .code:n = { \booltrue{subsectionContent} },
+ subsectiontocframe~default / on .code:n = { \booltrue{subsectionContent} },
+ subsectiontocframe~default / enable .code:n = { \booltrue{subsectionContent} },
+
+ subsectiontocframe~default / false .code:n = { \boolfalse{subsectionContent} },
+ subsectiontocframe~default / off .code:n = { \boolfalse{subsectionContent} },
+ subsectiontocframe~default / disable .code:n = { \boolfalse{subsectionContent} },
+
+ subsectiontocframe~default / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'subsectiontocframe~default',~so~being~ignored. }{helping~message: subsectiontocframe~default / unknown} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+%% Environments styles %%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% \begin{implementation}
+% \begin{variable}{\gotham@blocksep, \gotham@blockadjust}
+% |blocksep| and |blockadjust| lengths used in |\gotham@block| definition.
+% While |gotham@strut| is a command to ensure verticale spacing equivalent to a line.
+% \begin{macrocode}
+\newlength{\gotham@blocksep}
+\newlength{\gotham@blockadjust}
+\setlength{\gotham@blocksep}{0.75ex}
+\setlength{\gotham@blockadjust}{0.25ex}
+\providecommand{\gotham@strut}{
+ \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz (/)}
+}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{variable}{\gotham@parskip, \linespread}
+% length parskip defined by gotham and the linespread are adjusted.
+% \begin{macrocode}
+ \newlength{\gotham@parskip}
+ \setlength{\gotham@parskip}{0.5em}
+ \setlength{\parskip}{\gotham@parskip}
+ \linespread{1.15}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\newcommand{\gotham@block}[1]}
+% The three different block environments differ only in their colours.
+% Rather than repeat the essentially the same template three times, we use the auxiliary macro |\gotham@block| to define all three templates.
+% \UnitTested
+% \TestFiles{gotham-test-043}
+% \begin{macrocode}
+\newcommand{\gotham@block}[1]{
+ \par\vskip\medskipamount
+ \setlength{\parskip}{0pt}
+
+ % If a background color is defined for the block title or body, we need to add a little bit of padding to the corresponding box.
+ % Ideally, this would be accomplished by setting |colsep=0.75ex|, which is intended to add ``color separation space'' only when the box has a colored background.
+ % Unfortunately, |colsep| also adds this separation if the background color is inherited, even if the inherited color is actually empty.
+ % (The technical reason for this boils down to the fact that the |\ifx| directive does not expand macros.)
+ %
+ % To achieve the correct spacing for |alertblock|s and |exampleblock|s as well as for normal blocks, we have to begin the |beamercolorbox| differently based on whether |block title| has an empty background.
+ %
+ % If the |block title| background is empty, or the user has explicitly removed the background from (e.g.) |block title alerted|, we just need to set a rightskip for a nice ragged-right block title.
+ \ifbeamercolorempty[bg]{block~title#1}{%
+ \begin{beamercolorbox}[rightskip=0pt~plus~4em]{block~title#1}
+ }{
+ \ifbeamercolorempty[bg]{block~title}{
+ \begin{beamercolorbox}[rightskip=0pt~plus~4em]{block~title#1}
+ }
+ % Otherwise, if the |block title| has a background, we set the padding based on |\gotham@blockskip|.
+ % However, we have to visually compensate for the |\gotham@strut| added to the block title (see below) by subtracting |\gotham@blockadjust| from the top and bottom padding.
+ %
+ {
+ \begin{beamercolorbox}[
+ sep=\dimexpr\gotham@blocksep-\gotham@blockadjust\relax,
+ leftskip=\gotham@blockadjust,
+ rightskip=\dimexpr\gotham@blockadjust~plus~4em\relax,
+ ]{block~title#1}
+ }
+ }
+ % We can now set the contents of the |block title|.
+ % The zero-width but positive-height box |\gotham@strut| ensures that the block title box has a consistent height, even if it lacks punctuation, ascenders, or descenders.
+ %
+ \usebeamerfont*{block~title#1}
+ \gotham@strut
+ \insertblocktitle
+ \gotham@strut
+ \end{beamercolorbox}
+ % Next, we typeset the |block body|.
+ % This the code is similar to, but simpler than, the |block title| code since we don't need to adjust for any struts.
+ \nointerlineskip
+ \ifbeamercolorempty[bg]{block~body#1}{
+ \begin{beamercolorbox}[vmode]{block~body#1}
+ }{
+ \ifbeamercolorempty[bg]{block~body}{
+ \begin{beamercolorbox}[vmode]{block~body#1}
+ }{
+ \begin{beamercolorbox}[sep=\gotham@blocksep, vmode]{block~body#1}
+ \vspace{-\gotham@parskip}
+ }
+ }
+ \usebeamerfont{block~body#1}
+ \setlength{\parskip}{\gotham@parskip}
+}
+% This concludes the auxiliary macro |\gotham@block|.
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{block}, \begin{alertblock}, \begin{exampleblock}}
+% Three boxed environment are defined by default: |block|, |alertblock| and |exampleblock|.
+% The style of blocks can be changed using |\setbeamertemplate{blocks}[rounded][shadow=true]|.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{block~begin}{gotham}}
+% We could define the block beamer templates using the auxiliary macro |\gotham@block|....
+% Yet, following the precious advice from Sam Carter \url{https://github.com/jolars/moloch/issues/6}, we should keep beamer blocks.
+% But of course, one can go back to metropolis style using the commented lines here.
+% \UnitTested
+% \TestFiles{gotham-test-043}
+% \begin{macrocode}
+% \defbeamertemplate*{block~begin}{gotham}{\gotham@block{}}
+% \defbeamertemplate*{block~alerted~begin}{gotham}{\gotham@block{~alerted}}
+% \defbeamertemplate*{block~example~begin}{gotham}{\gotham@block{~example}}
+% \defbeamertemplate*{block~end}{gotham}{\end{beamercolorbox}\vspace*{0.2ex}}
+% \defbeamertemplate*{block~alerted~end}{gotham}{\end{beamercolorbox}\vspace*{0.2ex}}
+% \defbeamertemplate*{block~example~end}{gotham}{\end{beamercolorbox}\vspace*{0.2ex}}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{itemize}}
+% Three level of itemize environment are defined by default with decreasing size: |circle|, |triangle| and |square|.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{block~begin}{gotham}}
+% We define the block beamer templates using the auxiliary macro |\gotham@block|.
+% \UnitTested
+% \TestFiles{gotham-test-043}
+% \begin{macrocode}
+\defbeamertemplate*{itemize~item}{gotham}{%\textbullet}
+ \Large
+ \setbeamertemplate{itemize~item}[circle]
+ \usebeamertemplate{itemize~item}
+}
+\defbeamertemplate*{itemize~subitem}{gotham}{%$\blacktriangleright$
+ \scriptsize
+ \setbeamertemplate{itemize~subitem}[triangle]
+ \usebeamertemplate{itemize~subitem}
+}
+\defbeamertemplate*{itemize~subsubitem}{gotham}{%square or -
+ \Tiny
+ $\blacksquare$ % \textbf{-}
+ % \setbeamertemplate{itemize~subsubitem}[square]
+ % \usebeamertemplate{itemize~subsubitem} % not working because the size of the square is hardcoded.
+}
+
+%% TRY: enumitem package, enumitem and beamer are incompatible.
+% \setitemize{label=\usebeamerfont*{itemize~item}
+% \usebeamercolor[fg]{itemize~item}
+% \usebeamertemplate{itemize~item}}
+%% I tried to redefine everything to make them compatible, but it breaks the [alert] environment... So, I gave up.
+
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\defbeamertemplate{caption}, \defbeamertemplate{footnote}}
+% Gotham defines float captions with a numbered style and footnotes with traditional style (color can be tuned with |\setbeamercolor{footnote}|).
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{caption}, \defbeamertemplate{footnote}}
+% Templates definitions for caption and footnote.
+% \TestMissing{explanation}
+% \UnitTested
+% \TestFiles{gotham-test-043}
+% \begin{macrocode}
+\defbeamertemplate*{caption~label~separator}{gotham}{:~}
+\setbeamertemplate{caption}[numbered]
+\defbeamertemplate*{footnote}{gotham}{
+ \parindent~0em\noindent
+ \raggedright
+ \usebeamercolor{footnote}\hbox~to~0.8em{\hfil\insertfootnotemark}\insertfootnotetext\par
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{Default inner keys}
+% Apply default key options.
+% \UnitTested
+% \TestFiles{gotham-test-043}
+% \begin{macrocode}
+% when no value is given, default is called.
+\keys_set:nn { gotham / inner } {
+ title~page,
+ watermark~template, watermark~default,
+ standout~template, standin~template,
+ partframe~template, partframe~default,
+ sectionframe~template, sectionframe~default,
+ subsectionframe~template, subsectionframe~default,
+ subsubsectionframe~template, subsubsectionframe~default,
+ tocframe~template,
+ parttocframe~template, parttocframe~default,
+ sectiontocframe~template, sectiontocframe~default,
+ subsectiontocframe~template, subsectiontocframe~default,
+ % subsubsectiontocframe~template, subsubsectiontocframe~default,
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{Process inner keys}
+% Process package options.
+% \UnitTested
+% \TestFiles{gotham-test-043}
+% \begin{macrocode}
+\ProcessKeyOptions[ gotham / inner ]
+% \mode<all>
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+% \begin{implementation}
+% \begin{macrocode}
+%\endinput
+%</inner>
+% \end{macrocode}
+% \end{implementation}
+%
+%
+% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+%
+%
+%\begin{implementation}
+% \begin{macrocode}
+%<*outer>
+\ProvidesExplPackage{beamerouterthemegotham}{2024/09/20}{1.1.0.b}{gotham outer theme}
+\RequirePackage{expl3}
+\RequirePackage{xfp}
+\RequirePackage{calc}
+\RequirePackage{tikz}
+% \end{macrocode}
+% \end{implementation}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%% OUTER %%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%
+% \begin{implementation}
+% \begin{macro}{Compitibility mode for colors}
+% FROM COLOR THEME: useful to provide this recall when the inner theme is loaded without the color theme.
+% \begin{macrocode}
+\@ifundefined{\string\color@colorProgBar}{
+ \providebool{darkBG} \boolfalse{darkBG}
+ \providebool{transparentBG} \booltrue{transparentBG}
+ \colorlet{colorBG}{white}
+ \colorlet{colorFG}{black}
+ \colorlet{colorFrametitle}{purple}
+ \colorlet{colorStandout}{purple}
+ \colorlet{colorStandin}{purple}
+ \colorlet{colorTitlepage}{purple}
+ \colorlet{colorFiligrane}{gray}
+ \colorlet{colorBackElement}{gray}
+ \colorlet{colorProgBar}{orange}
+ \colorlet{colorAlert}{red}
+ \colorlet{colorExample}{green}
+ \colorlet{colorFrametitle}{purple}
+ \colorlet{colorTitlepage}{purple}
+ \setbeamercolor{progress~bar}{
+ use=alerted~text,
+ fg=colorProgBar,
+ bg=alerted~text.fg!50!black!30
+ }
+ \setbeamercolor{progress~bar~in~head/foot}{%
+ use=progress~bar,
+ parent=progress~bar
+ }
+ \setbeamercolor{progress~bar~in~part~page}{
+ use=progress~bar,
+ parent=progress~bar
+ }
+ \setbeamercolor{progress~bar~in~section~page}{
+ use=progress~bar,
+ parent=progress~bar
+ }
+ \setbeamercolor{progress~bar~in~splitvert}{
+ use=progress~bar,
+ parent=progress~bar
+ }
+ \setbeamercolor{frametitleSection}{use=primary~palette, bg=, fg=primary~palette.bg}
+ \setbeamercolor{standout}{use=primary~palette, bg=colorStandout, fg=primary~palette.bg}
+ \setbeamercolor{standin}{use=normal~text, bg=colorStandin, fg=normal~text.fg}
+ \setbeamercolor{section~in~toc}{use=normal~text, parent=normal~text,}
+ \setbeamercolor{subsection~in~toc}{use=normal~text, parent=normal~text,}
+ \setbeamercolor{subsubsection~in~toc}{use=normal~text, parent=normal~text,}
+}{
+ % else the colors are defined: this is fine.
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{variable}{\l__gotham_template_name_prop}
+% Dictionary/map of template elements and predefined option according to the context.
+% Naming convention: template/What/Who, i.e. Name: key=background~canvas/watermark, value = gotham~draft
+% \end{variable}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{variable}{\l__gotham_template_name_prop}
+% Dictionary/map of template elements and predefined option according to the context.
+% Naming convention: template/What/Who, i.e. Name: key=background~canvas/watermark, value = gotham~draft
+% \begin{macrocode}
+\prop_if_exist:NTF \l__gotham_template_name_prop
+{}{
+ % if not defined than define it.
+ \prop_new:N \l__gotham_template_name_prop
+}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{variable}{\l__gotham_tmpa_seq, \l__gotham_tmpa_tl, \l__gotham_tmpb_tl}
+% tmp variables
+% \begin{macrocode}
+\seq_if_exist:NTF \l__gotham_tmpa_seq
+{}{
+ % sequence
+ \seq_new:N \l__gotham_tmpa_seq
+}
+\tl_if_exist:NTF \l__gotham_tmpa_tl
+{}{
+ % token list A
+ \tl_new:N \l__gotham_tmpa_tl
+}
+\tl_if_exist:NTF \l__gotham_tmpb_tl
+{}{
+ % token list B
+ \tl_new:N \l__gotham_tmpb_tl
+}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\__gotham_set_prop_template:nn}
+% \begin{arguments}
+% \item element name (from beamer doc) in other word, the name the template category
+% \item prefined option (from beamer doc)
+% \end{arguments}
+% Function that store in a map the name a template use later.
+% The following naming convention is used: Template/What/Who~Name: watermark/gotham~draft.
+% The means for example that if a beamer template is defined using
+% |\defbeamertemplate{background}{watermark/gotham~draft}{...}|,
+% then the function has to be call using
+% |\__gotham_set_prop_template{background/watermark}{gotham~draft}|,
+% that will filled internally the map using the l3 command
+% |\prop_put:Nnn \l__gotham_template_name_prop {background/watermark}{gotham~draft}|.
+% If the template name given as input does not exist, an error is raised.
+% \TestFiles{gotham-test-044}
+% \begin{macrocode}
+\cs_if_exist:NTF \__gotham_set_prop_template:nn {}{
+ % if it doesn't exist, then create it.
+ \cs_new_protected:Nn \__gotham_set_prop_template:nn
+ {
+ % Check if the first argument contains a /
+ \tl_if_in:nnTF { #1 } { / }
+ {
+ % Split the first around the /
+ \seq_set_split:Nnn \l__gotham_tmpa_seq { / } { #1 }
+ \tl_set:Nn \l__gotham_tmpa_tl { \seq_item:Nn \l__gotham_tmpa_seq { 1 } }
+ \tl_set:Nn \l__gotham_tmpb_tl { \seq_item:Nn \l__gotham_tmpa_seq { 2 } }
+ % Check if template exist
+ \cs_if_exist:cTF {beamer@@tmpop@\exp_not:V \l__gotham_tmpa_tl @\exp_not:V \l__gotham_tmpb_tl /#2} {
+ % set the value in the map, so it can be called later.
+ \prop_put:Nnn \l__gotham_template_name_prop {#1} {#2}
+ % \setbeamertemplate{#1}[#2]
+ }{
+ \PackageError{beamerthemegotham}
+ {The~beamer~template~named~'\l__gotham_tmpa_tl'~with~the~option~'\l__gotham_tmpb_tl/#2'~does~not~exist}
+ {helping~message}
+ }
+ }{% false -> error
+ \PackageError{beamerthemegotham}
+ {
+ When~using~'\c_backslash_str\cs_to_str:N \__gotham_set_prop_template'~the~first~argument~should~contain~a~'/'~to~respect~the~naming~convention~used~(Template/what/Who~name),~but~you~gave~'#1'.~
+ As~example:~if~'\c_backslash_str defbeamertemplate{background}{watermark/gotham~draft}'...,~then~use~'\c_backslash_str\cs_to_str:N \__gotham_set_prop_template{background/watermark}{gotham~draft}'
+ }{helping~message}
+ }
+ }
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\__gotham_add_beamerframe_key:n}
+% \begin{arguments}
+% \item Name of the option to add, this name should also correspond to the name of the environment followed by the suffix 'env'.
+% \end{arguments}
+% Function to add an option of a frame using an environment.
+% For example, if the name 'optionA' is the argument given to the function, an frame option named 'optionA' will be added, and this option will surround the frame with the environment named 'optionAenv'.
+% So, the environment 'optionA' must have been declared before.
+% \TestFiles{gotham-test-038}
+% \begin{macrocode}
+\seq_if_exist:NTF \l__gotham_frameoption_tmp_seq {}{
+ % Define the sequence of frameoptions environments to close
+ \seq_new:N \l__gotham_frameoption_tmp_seq
+}
+
+\cs_if_exist:NTF \__gotham_add_beamerframe_key:n {}{
+ % if it doesn't exist, then create it.
+
+ % Define the command to add frameoptions
+ \cs_new_protected:Nn \__gotham_add_beamerframe_key:n {
+ \define@key{beamerframe}{ #1 }[true]{
+ \begin{#1env}
+ \seq_put_left:Nn \l__gotham_frameoption_tmp_seq { \end{#1env} }
+ }
+ }
+
+ % At the end of frames close the opened environments.
+ \apptocmd{\beamer@reseteecodes}{
+ % Join elements in the queue without separator then output the result
+ \seq_use:Nn \l__gotham_frameoption_tmp_seq {}
+ % clear working queue
+ \seq_clear:N \l__gotham_frameoption_tmp_seq
+ }{}{}
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\__gotham_set_template:nn}
+% \begin{syntax}
+% \cs{__gotham_set_template:nn} \marg{element} \marg{option}
+% \end{syntax}
+% Function that test if a beamertemplate with the given element and option name exists. If it exists then it is set (applied), otherwise an error is raised.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{function}{\__gotham_set_template:nn}
+% \begin{arguments}
+% \item element name (from beamer doc) in other word, the name the template category
+% \item prefined option (from beamer doc)
+% \end{arguments}
+% Function to set a beamertemplate with an option if it exists, otherwise an error is raised.
+% Unfortunatly, (as far as I know) it not possible to test if the element name exists independtly from the prefined option.
+% \TestFiles{gotham-test-038}
+% \begin{macrocode}
+\cs_if_exist:NTF \__gotham_set_template:nn {}{
+ % If it doesn't exist, then create it.
+
+ % Define the command to set template if it exists.
+ \cs_new_protected:Nn \__gotham_set_template:nn
+ {
+ \cs_if_exist:cTF {beamer@@tmpop@#1@#2} {
+ \setbeamertemplate{#1}[#2]
+ }{
+ \PackageError{beamerinnerthemegotham}
+ {The~beamer~template~named~'#1'~with~the~option~'#2'~does~not~exist}
+ {helping~message unknown setbeamertemplate option}
+ }
+ }
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+
+%%% Sidebars %%%
+%%%%%%%%%%%%%%%%
+
+% \begin{documentation}
+% \begin{variable}{\sidebarRightHOffset, \sidebarLeftHOffset}
+% Length controling the horizontal offset in order to position |\gothamRightFiligrane| (respectively |\gothamLeftFiligrane|) when using the default sidebar canvas (right and left) from gotham.
+% \end{variable}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{variable}{\sidebarRightHOffset, \sidebarLeftHOffset}
+% lengths between borders (right and left) and the commands (|\gothamRightFiligrane| and |\gothamleftFiligrane|) used inside |\setbeamertemplate{sidebar~canvas~right}[default/gotham~filigrane]| (left respectively).
+% \UnitTested
+% \TestFiles{gotham-test-044}
+% \begin{macrocode}
+% sidebar lengths
+\newlength{\sidebarRightHOffset}
+\setlength{\sidebarRightHOffset}{-2.5ex}
+\newlength{\sidebarLeftHOffset}
+\setlength{\sidebarLeftHOffset}{+0.5ex}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\gothamRightFiligrane, \gothamLeftFiligrane}
+% Commands used internally by |\setbeamertemplate{sidebar~canvas~right}[default/gotham~filigrane]| (left respectively), that are empty by default.
+% But these commands can be simply redefined to custom watermarks (filigrane) in sidebars.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\gothamRightFiligrane, \gothamLeftFiligrane}
+% Commands used internally by |\setbeamertemplate{sidebar~canvas~right}[default/gotham~filigrane]| (left respectively), that are empty by default.
+% But these commands can be simply redefined to custom watermarks (filigrane) in sidebars.
+% \UnitTested
+% \TestFiles{gotham-test-044}
+% \begin{macrocode}
+% Command to add filigrane/edging in sidebar
+\newcommand{\gothamRightFiligrane}{
+ % left empty intentionally
+ % \rotatebox{90}{gotham right filigrane pattern}
+
+}
+\newcommand{\gothamLeftFiligrane}{
+ % left empty intentionally
+ % \rotatebox{-90}{\hspace*{5em} gotham left filigrane pattern}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{sidebar~canvas~right}{}, \defbeamertemplate{sidebar~canvas~left}{}}
+% Definitions of |\defbeamertemplate{sidebar~canvas~right}| (respectively |\defbeamertemplate{sidebar~canvas~left}|) that are used by gotham by default.
+% \UnitTested
+% \TestFiles{gotham-test-044}
+% \begin{macrocode}
+\defbeamertemplate{sidebar~right}{default/beamer}{
+ \vfill
+ \llap{\insertlogo\hskip0.1cm}
+ \vskip2pt
+ \llap{\usebeamertemplate***{navigation~symbols}\hskip0.1cm}
+ \vskip2pt
+}
+\defbeamertemplate{sidebar~right}{default/empty}{}
+\defbeamertemplate{sidebar~canvas~right}{default/empty}{}
+\defbeamertemplate{sidebar~canvas~right}{default/gotham~filigrane}{
+ % pull to the left otherwise, the filigrane is outside of the frame.
+ \hspace*{\sidebarRightHOffset}
+ \gothamRightFiligrane
+}
+\defbeamertemplate{sidebar~left}{default/empty}{}
+\defbeamertemplate{sidebar~canvas~left}{default/empty}{}
+\defbeamertemplate{sidebar~canvas~left}{default/gotham~filigrane}{
+ \hspace*{\sidebarLeftHOffset}
+ \gothamLeftFiligrane
+}
+% Add the template to the prop (dictionary) of background template to use according to the situation
+\prop_put:Nnn \l__gotham_template_name_prop {sidebar~canvas~left/default} {gotham~filigrane}
+\prop_put:Nnn \l__gotham_template_name_prop {sidebar~canvas~right/default} {gotham~filigrane}
+\prop_put:Nnn \l__gotham_template_name_prop {sidebar~left/default} {empty}
+\prop_put:Nnn \l__gotham_template_name_prop {sidebar~right/default} {beamer}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{variable}{\l_gotham_defaultEdging}
+% Boolean to triggering if edging should be displayed by default (without giving the frame option).
+% The variable is |false| by default.
+% \end{variable}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\l_gotham_defaultEdging}
+% Boolean variable to display the edging by default (or not).
+% \UnitTested
+% \TestFiles{gotham-test-044}
+% \begin{macrocode}
+\bool_new:N \l_gotham_defaultEdging
+\bool_set_false:N \l_gotham_defaultEdging
+% At every new frame, reset the options to default (unless some options/keys are given)
+\BeforeBeginEnvironment{frame}{
+ \bool_if:NTF \l_gotham_defaultEdging {
+ \setbeamertemplate{sidebar~canvas~left}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~canvas~left/default}]
+ \setbeamertemplate{sidebar~canvas~right}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~canvas~right/default}]
+ }{
+ % false
+ \setbeamertemplate{sidebar~canvas~left}[default/empty]
+ \setbeamertemplate{sidebar~canvas~right}[default/empty]
+ }
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[edging]}
+% Add a frame option |edging| to display edging in sidebar canvas.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[edging]}
+% Add a frame option |edging| to display an empty sidebar canvas canvas.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-044}
+% \begin{macrocode}
+% bool to trigger the add of edging in sidebar canvas
+\newenvironment{edgingenv}{
+ \setbeamertemplate{sidebar~canvas~left}[
+ default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~canvas~left/default}
+ ]
+ \setbeamertemplate{sidebar~canvas~right}[
+ default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~canvas~right/default}
+ ]
+}{}
+\__gotham_add_beamerframe_key:n {edging}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[noedging]}
+% Add a frame option |noedging| to do not display noedging in sidebar canvas.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[noedging]}
+% Add a frame option |noedging| to do not display an empty sidebar canvas canvas.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-044}
+% \begin{macrocode}
+% bool to trigger the add of noedging in sidebar canvas
+\newenvironment{noedgingenv}{
+ \setbeamertemplate{sidebar~canvas~left}[default/empty]
+ \setbeamertemplate{sidebar~canvas~right}[default/empty]
+}{}
+\__gotham_add_beamerframe_key:n {noedging}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\useoutertheme}
+% \begin{syntax}
+% \cs{useoutertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{edging default} = \oarg{\defopt{off} \textbar on }
+% \meta{sidebar canvas left template} = \oarg{\defopt{gotham} \textbar ...}
+% \meta{sidebar canvas right template} = \oarg{\defopt{gotham filigrane} \textbar empty \textbar ...}
+% \end{syntax}
+% The 'package' (useoutertheme) options can control |sidebar canvas right| (and |sidebar canvas left|) templates.
+% These templates are activated when giving the frame option |\begin{frame}[edging]|.
+% The option |edging default=on| can enable the |sidebar canvas right| (and |sidebar canvas left|) templates on every frame; but it can still be turned off for specific frames when using the frame option |noedging|.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{outer key -- interface}
+% Controls the outer settings for sidebar canvas right and sidebar canvas left.
+% \UnitTested
+% \TestFiles{gotham-test-044}
+% \begin{macrocode}
+\keys_define:nn { gotham / outer }
+{
+ % sidebar~canvas~right template
+ sidebar~canvas~right~template .usage:n = { general },
+ sidebar~canvas~right~template .default:n = { gotham~filigrane },
+ sidebar~canvas~right~template .code:n = { \__gotham_set_prop_template:nn{sidebar~canvas~right/default}{#1} },
+}
+\keys_define:nn { gotham / outer }
+{
+ % sidebar~canvas~left template
+ sidebar~canvas~left~template .usage:n = { general },
+ sidebar~canvas~left~template .default:n = { gotham~filigrane },
+ sidebar~canvas~left~template .code:n = { \__gotham_set_prop_template:nn{sidebar~canvas~left/default}{#1} },
+}
+\keys_define:nn { gotham / outer }{
+ % edging default
+ edging~default .choice:,
+ edging~default .usage:n = { general },
+ edging~default .default:n = { false },
+
+ edging~default / true .code:n = { \bool_set_true:N \l_gotham_defaultEdging },
+ edging~default / on .code:n = { \bool_set_true:N \l_gotham_defaultEdging },
+ edging~default / enable .code:n = { \bool_set_true:N \l_gotham_defaultEdging },
+
+ edging~default / false .code:n = { \bool_set_false:N \l_gotham_defaultEdging },
+ edging~default / off .code:n = { \bool_set_false:N \l_gotham_defaultEdging },
+ edging~default / disable .code:n = { \bool_set_false:N \l_gotham_defaultEdging },
+
+ edging~default / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'edging~default',~so~being~ignored. }{helping~message: edging~default / unknown} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+%%% Navigation \& Logo %%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% \begin{documentation}
+% \begin{function}{\defbeamertemplate{navigation~symbols}{empty} }
+% By default the navigation symbols are disable.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate*{navigation~symbols}{empty} }
+% Apply the empty navigation symbol template by default.
+% \UnitTested
+% \TestFiles{gotham-test-045}
+% \begin{macrocode}
+\defbeamertemplate*{navigation~symbols}{empty}{}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\defbeamertemplate{navigation~symbols}{default} }
+% Navigation symbols can be turned on using |\setbeamertemplate{navigation symbols}[default]|.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{navigation~symbols}{horizontal} }
+% From Beamer default theme.
+% \UnitTested
+% \TestFiles{gotham-test-045}
+% \begin{macrocode}
+% \setbeamertemplate{navigation~symbols}[vertical]
+% \setbeamertemplate{navigation~symbols}[only~frame~symbol]
+% \setbeamertemplate{navigation~symbols}[default]% = horizontal
+% \defbeamertemplate{navigation~symbols}{horizontal}{
+% \usebeamercolor[fg]{navigation~symbols}
+% \insertslidenavigationsymbol
+% \insertframenavigationsymbol
+% \insertsubsectionnavigationsymbol
+% \insertsectionnavigationsymbol
+% \insertdocnavigationsymbol
+% \insertbackfindforwardnavigationsymbol
+% }
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{logo}{empty}}
+% Template used sometimes to have no logo on specific frames.
+% \UnitTested
+% \TestFiles{gotham-test-045}
+% \begin{macrocode}
+\defbeamertemplate{logo}{empty}{}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[nologo]}
+% Add a frame option |nologo|, if you do not want your logo to be displayed.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[nologo]}
+% Add a frame option |nologo|, if you do not want your logo to be displayed.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-045}
+% \begin{macrocode}
+% bool to trigger the add of nologo action on frame.
+\newenvironment{nologoenv}{
+ \setbeamertemplate{logo}[empty]
+}{}
+\__gotham_add_beamerframe_key:n {nologo}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+%%% Headline \& Frametitle %%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%% Headline %%%
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{headline}{default/gotham}}
+% The headline template is empty by default by can be changed when using progress bar or the current section.
+% \UnitTested
+% \TestFiles{gotham-test-046, gotham-test-046b, gotham-test-047}
+% \begin{macrocode}
+\defbeamertemplate{headline}{default/gotham}{}
+\prop_put:Nnn \l__gotham_template_name_prop {headline/default} {gotham}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{headline}{default/gotham~section}}
+% The headline template used to print the current section name and subection.
+% This template is used with |circlehead| progress bar
+% \UnitTested
+% \TestFiles{gotham-test-046, gotham-test-046b, gotham-test-047}
+% \begin{macrocode}
+\defbeamertemplate{headline}{default/gotham~section}{
+ \begin{beamercolorbox}[wd=1.0\paperwidth, ht=2.5ex, dp=1.4ex, left]{headfoot}
+ \usebeamerfont{section~in~head/foot}\hspace*{3.5ex}
+ \usebeamertemplate{section~in~head/foot}
+ \end{beamercolorbox}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+%%% Frametitle %%%
+
+% \begin{documentation}
+% \begin{variable}{\gotham@frametitle@toppadding, \gotham@frametitle@bottompadding, \gotham@frametitle@leftpadding, \gotham@frametitle@rightpadding}
+% Dimensions controlling the top, bottom, left and right padding in the frametitle.
+% \end{variable}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{variable}{\gotham@frametitle@toppadding, \gotham@frametitle@bottompadding, \gotham@frametitle@leftpadding, \gotham@frametitle@rightpadding}
+% Dimensions of lengths used in the frametitle: top, bottom, left and right padding.
+% All of them are equal to 2.2ex by default.
+% \begin{macrocode}
+\newlength{\gotham@frametitle@toppadding}
+\setlength{\gotham@frametitle@toppadding}{2.2ex}
+\newlength{\gotham@frametitle@bottompadding}
+\setlength{\gotham@frametitle@bottompadding}{2.2ex}
+\newlength{\gotham@frametitle@leftpadding}
+\setlength{\gotham@frametitle@leftpadding}{2.2ex}
+\newlength{\gotham@frametitle@rightpadding}
+\setlength{\gotham@frametitle@rightpadding}{2.2ex}
+% \gotham@strut from inner
+\providecommand{\gotham@strut}{
+ \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz (/)}
+}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\gotham@frametitlestrut@start, \gotham@frametitlestrut@end}
+% Commands used to control the space over and under the title in frametitle.
+% \UnitTested
+% \TestFiles{gotham-test-046, gotham-test-046b, gotham-test-047}
+% \begin{macrocode}
+\newcommand{\gotham@frametitlestrut@start}{
+ \rule{0pt}{\gotham@frametitle@toppadding +
+ \totalheightof{
+ \ifcsdef{gotham@frametitleformat}{\gotham@frametitleformat{X}}{X}
+ }
+ }
+}
+\newcommand{\gotham@frametitlestrut@end}{
+ \rule[-\gotham@frametitle@bottompadding]{0pt}{\gotham@frametitle@bottompadding}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\gothamInstituteLogoSquare[height]}
+% \begin{syntax}
+% \cs{height} \oarg{height of the logo use in inclugraphics (4ex by default)}
+% \end{syntax}
+% Command to set the image logo to include.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{function}{\gothamInstituteLogoSquare[height] \defbeamertemplate{includeLogo}{default/gotham~square}}
+% \begin{syntax}
+% \cs{gothamInstituteLogoSquare} \oarg{height}
+% \end{syntax}
+% Command to include the desired logo and a template used to add it to the frametitle.
+% For example your can do |\renewcommand{\gothamInstituteLogoSquare}[1][4ex]{\includegraphics[height=#1]{gotham-logo.pdf}}|.
+% \TestFiles{gotham-test-046, gotham-test-047}
+% \begin{macrocode}
+\newcommand{\gothamInstituteLogoSquare}[1][4ex]{
+ %\includegraphics[height=#1]{gotham-logo.pdf}
+}
+\defbeamertemplate{includeLogo}{default/gotham~square}{
+ \gothamInstituteLogoSquare
+}
+\prop_put:Nnn \l__gotham_template_name_prop {includeLogo/default} {gotham~square}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{includeLogo}{default/gotham~circle}}
+% Template used in frametitle when the option |progress bar= circlehead| is activated.
+% \UnitTested
+% \TestFiles{gotham-test-046b}
+% \begin{macrocode}
+\defbeamertemplate{includeLogo}{default/gotham~circle}{
+ \gothamProgressCircle
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{includeLogo}{default/gotham~circle}}
+% Template to make sure the logo will remain centered and to do not change the height of the line when included.
+% This template is used to include logo in frametitle.
+% \UnitTested
+% \TestFiles{gotham-test-046b}
+% \begin{macrocode}
+\defbeamertemplate{instituteLogo}{default/gotham}{
+ % \raisebox{lift}[height][depth]{text}
+ \raisebox{0pt}[0pt][0pt]{
+ \raisebox{.5\fontcharht\font`E-0.5\height}{
+ % \setbeamertemplate{}[]
+ \setbeamertemplate{includeLogo}[default/\prop_item:Nn \l__gotham_template_name_prop {includeLogo/default}]
+ \usebeamertemplate{includeLogo}
+ }
+ }
+}
+\prop_put:Nnn \l__gotham_template_name_prop {instituteLogo/default} {gotham}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\gothamFrameSubtitleSep}
+% Command that can be redefined to control the separator between the title of the frame and its subtitle.
+% For example if a default Beamer style is desired, one can use |\renewcommand{\gothamFrameSubtitleSep}{\\[-.42em]}|.
+% By default it is a hyphen.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{function}{\gothamFrameSubtitleSep}
+% Hyphen used as separator between title of the frame and its subtitle (within frametitle template).
+% \TestFiles{ gotham-test-047}
+% \begin{macrocode}
+\newcommand{\gothamFrameSubtitleSep}{
+ % \\[-.42em] % if newline (as default Beamer)
+ % or if same line with a -- separator.
+ \ ---~
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{variable}{\gothamFramesubtitleStrutend}
+% Variable vertical length used to adapte the bottom padding when a subtitle is given.
+% \end{variable}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{variable}{\gothamFramesubtitleStrutend}
+% Length used in |vspace| at the end of framesubtitle.
+% \begin{macrocode}
+\newlength{\gothamFramesubtitleStrutend}
+\setlength{\gothamFramesubtitleStrutend}{0pt}
+% \setlength{\gothamFramesubtitleStrutend}{-1.25ex} %% When \newcommand{\gothamFrameSubtitleSep}{\\[-.42em]}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{frametitle}{default/gotham~subsameline}}
+% Template for frametitle include subtitle on the same line and a logo a flushed left.
+% \UnitTested
+% \TestFiles{gotham-test-047}
+% \begin{macrocode}
+\defbeamertemplate{frametitle}{default/gotham~subsameline}{
+ \nointerlineskip
+ \begin{beamercolorbox}[
+ wd=\paperwidth,
+ sep=0pt,
+ leftskip=\gotham@frametitle@leftpadding,
+ rightskip=\gotham@frametitle@rightpadding,
+ ]{frametitle}
+ \gotham@frametitlestrut@start
+ \insertframetitle
+ \ifx\insertframesubtitle\@empty
+ %% if subtitle to the frame is empty
+ \else
+ %% if not empty: add subtitle
+ {\usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\gothamFrameSubtitleSep \insertframesubtitle}
+ \vspace*{\gothamFramesubtitleStrutend}
+ \fi
+ \nolinebreak
+ %% Add logo
+ \hfill{
+ \setbeamertemplate{instituteLogo}[default/\prop_item:Nn \l__gotham_template_name_prop {instituteLogo/default}]
+ \usebeamertemplate{instituteLogo}
+ }
+ \gotham@frametitlestrut@end
+ \end{beamercolorbox}
+}
+\prop_put:Nnn \l__gotham_template_name_prop {frametitle/default} {gotham~subsameline}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{framesubtitle}{default/gotham~subnewline}}
+% Template for framesubtitle include subtitle on the same line and a logo a flushed left.
+% \UnitTested
+% \TestFiles{gotham-test-047}
+% \begin{macrocode}
+\dim_new:N \l__gotham_framesubtitle_subnewline_strutend_dim
+\defbeamertemplate{framesubtitle}{default/gotham~subnewline}{
+ \nointerlineskip
+ \begin{beamercolorbox}[
+ wd=\paperwidth,
+ sep=0pt,
+ leftskip=\gotham@frametitle@leftpadding,
+ rightskip=\gotham@frametitle@rightpadding,
+ ]{frametitle}
+ % put the subtitle in a raisebox to have no influence on the result.
+ \raisebox{0pt}[0pt][0pt]{
+ \raisebox{-0.3ex}{
+ { \usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\insertframesubtitle}
+ }
+ }
+ % add 1ex to take into account the subtitle height.
+ \dim_set:Nn \l__gotham_framesubtitle_subnewline_strutend_dim {1.ex+\gothamFramesubtitleStrutend}
+ \vspace{\l__gotham_framesubtitle_subnewline_strutend_dim}
+ \end{beamercolorbox}
+}
+\prop_put:Nnn \l__gotham_template_name_prop {framesubtitle/default} {gotham~subnewline}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{framesubtitle}{default/gotham~subnewline}}
+% Template for frametitle and a logo a flushed left then the subtitle on a new line.
+% \UnitTested
+% \TestFiles{gotham-test-047}
+% \begin{macrocode}
+\defbeamertemplate{frametitle}{default/gotham~subnewline}{
+ \nointerlineskip
+ \begin{beamercolorbox}[
+ wd=\paperwidth,
+ sep=0pt,
+ leftskip=\gotham@frametitle@leftpadding,
+ rightskip=\gotham@frametitle@rightpadding,
+ ]{frametitle}
+ \gotham@frametitlestrut@start
+ \insertframetitle
+ \nolinebreak
+ \hfill{
+ \setbeamertemplate{instituteLogo}[default/\prop_item:Nn \l__gotham_template_name_prop {instituteLogo/default}]
+ \usebeamertemplate{instituteLogo}
+ }
+ \gotham@frametitlestrut@end
+ \end{beamercolorbox}
+ %% End of the frametitle box, start then use the subtitle template if needed.
+ \ifx\insertframesubtitle\@empty
+ %% if subtitle to the frame is not empty
+ \else
+ % reduce vertical space to have a 1pt overlap, so no white line appears with vectorial viewers.
+ \vspace*{-1pt}
+ % add the subtitle
+ \setbeamertemplate{framesubtitle}[default/\prop_item:Nn \l__gotham_template_name_prop {framesubtitle/default}]
+ % \setbeamertemplate{framesubtitle}%[framesubtitle/default]
+ \usebeamertemplate{framesubtitle}
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\useoutertheme}
+% \begin{syntax}
+% \cs{useoutertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{frametitle template} = \oarg{\defopt{gotham subsameline} \textbar gotham subnewline \textbar ... }
+% \meta{framesubtitle template} = \oarg{\defopt{gotham subnewline} \textbar ...}
+% \end{syntax}
+% The 'package' (useoutertheme) options can control |frametitle| (and |framesubtitle|) templates.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{outer key -- interface}
+% Controls the outer settings for frametitle and framesubtitle.
+% \UnitTested
+% \TestFiles{gotham-test-047}
+% \begin{macrocode}
+\keys_define:nn { gotham / outer }{
+ % frametitle template
+ frametitle~template .usage:n = { general },
+ frametitle~template .default:n = { gotham~subsameline },
+ frametitle~template .code:n = {
+ \__gotham_set_prop_template:nn{frametitle/default}{#1}
+ \setbeamertemplate{frametitle}[default/\prop_item:Nn \l__gotham_template_name_prop {frametitle/default}]
+ }
+}
+\keys_define:nn { gotham / outer }{
+ % frametitle template
+ framesubtitle~template .usage:n = { general },
+ framesubtitle~template .default:n = { gotham~subnewline },
+ framesubtitle~template .code:n = {
+ \__gotham_set_prop_template:nn{framesubtitle/default}{#1}
+ \setbeamertemplate{framesubtitle}[default/\prop_item:Nn \l__gotham_template_name_prop {framesubtitle/default}]
+ }
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+%%% Continuation %%%
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{frametitle~continuation}{default/beamer}}
+% Template for numerotation of frametitle when a frame are continuing on sevral pages (allowed with the beamer option |allowframebreaks|).
+% Beamer theme (by default) is using roman number with uppercase.
+% \UnitTested
+% \TestFiles{gotham-test-047}
+% \begin{macrocode}
+\defbeamertemplate{frametitle~continuation}{default/beamer}{
+ \usebeamerfont{frametitle}
+ {
+ \MakeUppercase{\romannumeral \insertcontinuationcount}
+ }
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{frametitle~continuation}{default/tot}}
+% Template for numerotation of frametitle when a frame are continuing on sevral pages (allowed with the beamer option |allowframebreaks|).
+% This template is using arabic number slash over the total number of page for this frame.
+% \UnitTested
+% \TestFiles{gotham-test-047}
+% \begin{macrocode}
+\defbeamertemplate{frametitle~continuation}{default/tot}{
+ \usebeamerfont{frametitle}
+ {
+ \textmd{%
+ [\insertcontinuationcount
+ \,/\,%
+ \the\numexpr\beamer@endpageofframe+1-\beamer@startpageofframe
+ ]%
+ }%
+ }
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{frametitle~continuation}{default/gotham}}
+% Template for numerotation of frametitle when a frame are continuing on sevral pages (allowed with the beamer option |allowframebreaks|).
+% Gotham theme (by default) is using roman number with lowercase.
+% \UnitTested
+% \TestFiles{gotham-test-047}
+% \begin{macrocode}
+\defbeamertemplate{frametitle~continuation}{default/gotham}{
+ \usebeamerfont{frametitle}
+ {
+ %\small
+ (\romannumeral \insertcontinuationcount)
+ }
+}
+\prop_put:Nnn \l__gotham_template_name_prop {frametitle~continuation/default} {gotham}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\useoutertheme}
+% \begin{syntax}
+% \cs{useoutertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{frametitle continuation template} = \oarg{\defopt{gotham} \textbar tot \textbar beamer \textbar ... }
+% \end{syntax}
+% The 'package' (useoutertheme) options can control |frametitle continuation| templates.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{outer key -- interface}
+% Controls the outer settings for frametitle continuation.
+% \UnitTested
+% \TestFiles{gotham-test-047}
+% \begin{macrocode}
+\keys_define:nn { gotham / outer }{
+ % frametitle template
+ frametitle~continuation~template .usage:n = { general },
+ frametitle~continuation~template .default:n = { gotham },
+ frametitle~continuation~template .code:n = {
+ \__gotham_set_prop_template:nn{frametitle~continuation/default}{#1}
+ \setbeamertemplate{frametitle~continuation}[default/\prop_item:Nn \l__gotham_template_name_prop {frametitle~continuation/default}]
+ }
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+%%% Footer \& Footline %%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%% Footline %%%
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{footline}{empty}}
+% Empty footline template used when the option nofootline is given.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate{footline}{empty}{}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[nofootline]}
+% Add a frame option |nofootline| to do not display nofootline.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[nofootline]}
+% Add a frame option |nofootline| to do not display an empty footline.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+% bool to trigger the add of nofootline in frame.
+\newenvironment{nofootlineenv}{
+ \setbeamertemplate{footline}[empty]
+}{}
+\__gotham_add_beamerframe_key:n {nofootline}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{variable}{\gothamFootlineOffset, \gothamFootlineHeight, \gothamFootlineDepth}
+% Lengths controlling the position of |footline|.
+% |\gothamFootlineOffset| is controlling space between to bottom of the text (or the footnote) and the footline.
+% |\gothamFootlineOffset| is by default -0.5ex, to have more space in the frame but if the footer is not really used, the space can be even more optimized using |\setlength{\gothamFootlineOffset}{-2.0ex}|.
+% Obviously, it can be back to "normal" setting it to 0pt.
+% |\gothamFootlineHeight| and |\gothamFootlineDepth| are controlling the heigth of the footline and the position of the text within.
+% \end{variable}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{variable}{\gothamFootlineOffset, \gothamFootlineHeight, \gothamFootlineDepth}
+% Lengths used in |footline| template.
+% \begin{macrocode}
+% Footline lengths
+% space between to bottom of the text (or the footnote) and the footline
+\newlength{\gothamFootlineOffset}
+\setlength{\gothamFootlineOffset}{-0.5ex}
+
+\newlength{\gothamFootlineHeight}
+\setlength{\gothamFootlineHeight}{1.5ex}
+\newlength{\gothamFootlineDepth}
+\setlength{\gothamFootlineDepth}{0.1ex}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate*{footline}{default/gotham}}
+% Template that is activate by default since this footline is relatively generic.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate*{footline}{default/gotham}{
+ % new line to adjust the footline position.
+ \vspace*{\gothamFootlineOffset}
+ \begin{beamercolorbox}[
+ wd=\textwidth,
+ sep=0pt,
+ leftskip=3ex,
+ rightskip=3ex,
+ ht={\gothamFootlineHeight},
+ dp={\gothamFootlineDepth},
+ ]{footline}
+ \usebeamerfont{page number in head/foot}
+ \ifbeamertemplateempty{frame~footer}{
+ %executed if empty
+ \hfill \ \gotham@strut
+ }{
+ %⟨executed otherwise⟩
+ \usebeamertemplate*{frame~footer}
+ }
+ \hspace{\gothamRightFooterPadding}
+ {\usebeamertemplate{page~number~in~head/foot}}~
+ \end{beamercolorbox}
+}
+\prop_put:Nnn \l__gotham_template_name_prop {footline/default} {gotham}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+%%% Footer %%%
+
+% \begin{documentation}
+% \begin{variable}{\gothamLeftFooterPadding, \gothamRightFooterPadding, \gothamFooterHOffset}
+% Lengths controlling the position of |footer|.
+% |\gothamFooterHOffset| is controlling the horizontal space between the footer and the bottom of the page (or the progressbar).
+% |\gothamLeftFooterPadding| and |\gothamLeftFooterPadding| are controlling the space between the left and right side of the footer and the border of the page.
+% \end{variable}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{variable}{\gothamLeftFooterPadding, \gothamRightFooterPadding, \gothamFooterHOffset}
+% Lengths used in |footer| template for positioning left right and bottom.
+% \begin{macrocode}
+\newlength{\gothamLeftFooterPadding}
+\setlength{\gothamLeftFooterPadding}{2.0ex}
+\newlength{\gothamRightFooterPadding}
+\setlength{\gothamRightFooterPadding}{3.5ex}
+\newlength{\gothamFooterHOffset}
+\setlength{\gothamFooterHOffset}{0pt}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{frame~footer}{none}}
+% Footer template used when nothing is put as footer but it will create undesired results.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate{frame~footer}{none}{}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{frame~footer}{empty}}
+% Footer template used when |nofooter| option is given and it presevers spacing to have nice results.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate{frame~footer}{empty}{
+ \hspace{\gothamLeftFooterPadding}
+ \hfill \
+ \gotham@strut
+ % decrease space between progress bar and footer
+ \vspace*{\gothamFooterHOffset}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[nofooter]}
+% Add a frame option |nofooter| to do not display nofooter.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[nofooter]}
+% Add a frame option |nofooter| to do not display an empty footer.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+% bool to trigger the add of nofooter in frame.
+\newenvironment{nofooterenv}{
+ \setbeamertemplate{frame~footer}[empty]
+}{}
+\__gotham_add_beamerframe_key:n {nofooter}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{variable}{\l_gotham_defaultRotateFooter}
+% Boolean to triggering if rotated footer should be displayed by default (without giving the frame option).
+% The variable is |false| by default.
+% \end{variable}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\l_gotham_defaultRotateFooter}
+% Boolean variable to display the rotated footer by default (or not).
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\bool_new:N \l_gotham_defaultRotateFooter
+\bool_set_false:N \l_gotham_defaultRotateFooter
+\bool_new:N \l_gotham_RotateFooter
+\bool_set_false:N \l_gotham_RotateFooter
+% At every new frame, reset the options to default (unless some options/keys are given)
+\BeforeBeginEnvironment{frame}{
+ \bool_if:NTF \l_gotham_defaultRotateFooter {
+ \bool_set_true:N \l_gotham_RotateFooter
+ }{% false
+ \bool_set_false:N \l_gotham_RotateFooter
+ }
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[rotateFooter]}
+% Add a frame option |rotateFooter| to display rotated footer.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[rotateFooter]}
+% Add a frame option |rotateFooter| to display a rotated footer.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+% bool to trigger
+% Capture new options/keys for frames
+\define@key{beamerframe}{rotateFooter}[true]{
+ \bool_set_true:N \l_gotham_RotateFooter
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\begin{frame}[noRotateFooter]}
+% Add a frame option |noRotateFooter| to display a none-RotateFooter.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{macro}{\begin{frame}[noRotateFooter]}
+% Add a frame option |noRotateFooter| to display a none-rotated footer.
+% To do it, we must add a global boolean variable, capture the option at the begin of the frame and patch the end of the frame.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+% Capture new options/keys for frames
+\define@key{beamerframe}{noRotateFooter}[true]{
+ \bool_set_false:N \l_gotham_RotateFooter
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\useoutertheme}
+% \begin{syntax}
+% \cs{useoutertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{rotateFooter default} = \oarg{\defopt{off} \textbar on }
+% \end{syntax}
+% The option |rotateFooter default=on| can enable the rotation of the footer on every frame; but it can all be turned on for specific frames when using the frame option |\begin{frame}[rotateFooter]|.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{outer key -- interface}
+% Controls the outer settings for sidebar canvas right and sidebar canvas left.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\keys_define:nn { gotham / outer }{
+ % rotateFooter default
+ rotateFooter~default .choice:,
+ rotateFooter~default .usage:n = { general },
+ rotateFooter~default .default:n = { false },
+
+ rotateFooter~default / true .code:n = { \bool_set_true:N \l_gotham_defaultRotateFooter },
+ rotateFooter~default / on .code:n = { \bool_set_true:N \l_gotham_defaultRotateFooter },
+ rotateFooter~default / enable .code:n = { \bool_set_true:N \l_gotham_defaultRotateFooter },
+
+ rotateFooter~default / false .code:n = { \bool_set_false:N \l_gotham_defaultRotateFooter },
+ rotateFooter~default / off .code:n = { \bool_set_false:N \l_gotham_defaultRotateFooter },
+ rotateFooter~default / disable .code:n = { \bool_set_false:N \l_gotham_defaultRotateFooter },
+
+ rotateFooter~default / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'rotateFooter~default',~so~being~ignored. }{helping~message: rotateFooter~default / unknown} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{variable}{\gothamFootlineRuleLeftPadding, \gothamFootlineRuleHeight, \gothamFootlineRuleLength, \gothamHposLeftRotFooter, \gothamHposRightRotFooter, \gothamVposLeftRotFooter, \gothamVposRightRotFooter}
+% Lengths controlling the position of |footer|.
+% |\gothamFootlineRuleLeftPadding| is controlling the horizontal space between the left border of the page and the left side of the rule.
+% |\gothamFootlineRuleHeight| is controlling the height of the rule use to delimit the footer.
+% |\gothamFootlineRuleLength| is controlling the length of the rule use to delimit the footer.
+% |\gothamHposLeftRotFooter| is controlling the horizontal positioning of the left part of the rotatated footer.
+% |\gothamHposRightRotFooter| is controlling the horizontal positioning of the right part of the rotatated footer.
+% |\gothamVposLeftRotFooter| is controlling the vertical positioning of the left part of the rotatated footer.
+% |\gothamVposRightRotFooter| is controlling the vertical positioning of the right part of the rotatated footer.
+%
+% \end{variable}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{variable}{\gothamFootlineRuleLeftPadding, \gothamFootlineRuleHeight, \gothamFootlineRuleLength, \gothamHposLeftRotFooter, \gothamHposRightRotFooter, \gothamVposLeftRotFooter, \gothamVposRightRotFooter}
+% Lengths used in |footer| template.
+% \begin{macrocode}
+\newlength{\gothamFootlineRuleLeftPadding}
+\newlength{\gothamFootlineRuleHeight}
+\newlength{\gothamFootlineRuleLength}
+\setlength{\gothamFootlineRuleLeftPadding}{7mm}
+\setlength{\gothamFootlineRuleHeight}{0.0pt}
+% \setlength{\gothamFootlineRuleHeight}{0.5pt} % This is nice also but have a cleaner default, I turned it to 0.
+\setlength{\gothamFootlineRuleLength}{15mm}
+
+\newlength{\gothamHposLeftRotFooter}
+\newlength{\gothamHposRightRotFooter}
+\newlength{\gothamVposLeftRotFooter}
+% horizontal position (in picture env) for the rotated footer.
+\newlength{\gothamVposRightRotFooter}
+
+\setlength{\gothamHposLeftRotFooter}{-7pt}
+\setlength{\gothamHposRightRotFooter}{2pt}
+\setlength{\gothamVposLeftRotFooter}{15pt}
+\setlength{\gothamVposRightRotFooter}{15pt}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{variable}{\hlenRightRotFooter, \hlenLeftRotFooter}
+% Temporary variables for the horizontal length of the rotated footer
+% \begin{macrocode}
+% Not used yet because I need to have a latex3 settowidth equivalent.
+% I will maybe take inspiration from https://tex.stackexchange.com/questions/492367/does-expl3-have-alternative-to-settowidth-and-settoheight
+% \dim_new:N \l__gotham_HLen_rightRotFooter_dim
+% \dim_new:N \l__gotham_HLen_leftRotFooter_dim
+\newlength{\hlenRightRotFooter}
+\newlength{\hlenLeftRotFooter}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{frame~footer}{default/gotham}}
+% Template for frame footer used by gotham, allowing a rotated footer.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate{frame~footer}{default/gotham}{
+ % add a ruler but wihtout affecting the dimensions of the footline
+ \vbox to 0pt{
+ % Vertical stretch to ensure proper spacing
+ \vss
+ \hbox to 0pt{
+ \hspace*{\gothamFootlineRuleLeftPadding}
+ \usebeamercolor{frametitle}
+ \color{frametitle.bg}
+ \rule{\gothamFootlineRuleLength}{\gothamFootlineRuleHeight}
+ \vspace*{
+ \dimexpr \gothamFootlineHeight -0.25em\relax
+ }
+ % Horizontal stretch to ensure proper spacing
+ \hss
+ }
+ }
+ \hspace{\gothamLeftFooterPadding}
+ \settowidth{\hlenLeftRotFooter}{\hspace{-\gothamLeftFooterPadding}}
+ \addtolength{\hlenLeftRotFooter}{\gothamHposLeftRotFooter}
+ % \ifbool{rotateFooter}{
+ \bool_if:NTF \l_gotham_RotateFooter {
+ % rotateFooter true
+ \begin{picture}(0,0)(0,0)
+ \put(\hlenLeftRotFooter,\gothamVposLeftRotFooter){\rotatebox{90}{\insertshortdate}}
+ \end{picture}
+ }{
+ % rotateFooter false
+ \insertshortdate
+ }
+ \hfill \
+ \hfill \ \insertshorttitle
+ % make sure that the vertical space is constant: strut.
+ \gotham@strut
+ \hfill \
+ \hfill \
+ % \ifbool{rotateFooter}{
+ \bool_if:NTF \l_gotham_RotateFooter {
+ % rotateFooter true
+ \settowidth{\hlenRightRotFooter}{\hspace{\gothamRightFooterPadding}\usebeamertemplate{page~number~in~head/foot}}
+ \addtolength{\hlenRightRotFooter}{\gothamHposRightRotFooter}
+ \begin{picture}(0,0)(0,0)
+ \put(\hlenRightRotFooter,\gothamVposRightRotFooter){\rotatebox{90}{\insertshortauthor}}
+ \end{picture}
+ }{
+ % rotateFooter false
+ \insertshortauthor
+ %\hspace{-7em}
+ }
+ % decrease space between progress bar and footer
+ \vspace*{\gothamFooterHOffset}
+}
+\prop_put:Nnn \l__gotham_template_name_prop {frame~footer/default} {gotham}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\useoutertheme}
+% \begin{syntax}
+% \cs{useoutertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{footer template} = \oarg{\defopt{gotham} \textbar ... }
+% \end{syntax}
+% The option |footer template| can which template to use as a footer.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{outer key -- interface}
+% Controls the outer settings for footer template.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\keys_define:nn { gotham / outer }{
+ % footer template
+ footer~template .usage:n = { general },
+ footer~template .default:n = { gotham },
+ footer~template .code:n = {
+ \__gotham_set_prop_template:nn{frame~footer/default}{#1}
+ \setbeamertemplate{frame~footer}[
+ default/\prop_item:Nn \l__gotham_template_name_prop {frame~footer/default}
+ ]
+ }
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+%%% Numbering %%%
+%%%%%%%%%%%%%%%%%
+
+% \begin{implementation}
+% \begin{macro}{\inserttotalframenumber}
+% We defined the number of total frame, if not defined or equal to 0 because of the first compilation, we set it to avoid arthimetical errors
+% \UnitTested
+% \TestFiles{gotham-test-046}
+% \begin{macrocode}
+%
+\def\inserttotalframenumber{100}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{page~number~in~head/foot}{none}}
+% Template to do not numbering the current frame.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate{page~number~in~head/foot}{none}{ }
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{variable}{\gothamCircleNumberingVshift, \gothamCircleNumberingHshift}
+% Variable lengths controling the vertical and horizontal positioning of the |circle| numbering template.
+% \end{variable}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{variable}{\gothamCircleNumberingVshift, \gothamCircleNumberingHshift}
+% Length used in |raisebox| and |hspace| in |circle| frame numbering.
+% \begin{macrocode}
+\newlength{\gothamCircleNumberingVshift}
+\setlength{\gothamCircleNumberingVshift}{1.4mm}
+\newlength{\gothamCircleNumberingHshift}
+\setlength{\gothamCircleNumberingHshift}{2.6mm}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{page~number~in~head/foot}{circle}}
+% Template to add, in a circle, the number of the current frame over (slash) the total number of frames.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate{page~number~in~head/foot}{circle}{
+ % horizontal space between the circle and the right part of the footer (email).
+ \hspace{+2em}
+ % \raisebox{lift}[height][depth]{text} => lift here = vertical space between the bottom of the page (or the progress bar) and the center of the circle
+ \raisebox{\gothamCircleNumberingVshift}[0pt][0pt]{
+ \begin{tikzpicture}[remember~picture, overlay]
+ \coordinate (circleCenter);
+
+ \usebeamercolor{frametitle}
+
+ \draw[fill, color=frametitle.bg] (circleCenter) circle (6mm);
+ \draw[fill, color=frametitle.fg] (circleCenter) circle (5mm);
+ \node[color=frametitle.bg] at (circleCenter)
+ {\small$^{\insertframenumber}\negmedspace/\negthinspace\sb{\inserttotalframenumber}$}
+ ;
+ \end{tikzpicture}
+ % horizontal space between the right border of the page and the center of the circle.
+ \hspace{\gothamCircleNumberingHshift}
+ }
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\useoutertheme}
+% \begin{syntax}
+% \cs{useoutertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{numbering} = \oarg{\defopt{none} \textbar framenumber \textbar totalframenumber \textbar appendixframenumber \textbar pagenumber \textbar totalpagenumber \textbar circle \textbar ... }
+% \meta{framesubtitle template} = \oarg{\defopt{gotham subnewline} \textbar ...}
+% \end{syntax}
+% The 'package' (useoutertheme) options can control |frame numbering| templates used in |footer| template.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{outer key -- interface}
+% Controls the outer settings for frame numbering.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\keys_define:nn { gotham / outer }{
+ % numbering
+ numbering .choice:,
+ numbering .usage:n = { general },
+ numbering .default:n = { none },
+
+ % \__gotham_set_template:nn{title~page}{#1}
+ numbering / none .code:n = { \setbeamertemplate{page~number~in~head/foot}[none] },
+ numbering / framenumber .code:n = { \setbeamertemplate{page~number~in~head/foot}[framenumber] },
+ numbering / totalframenumber .code:n = {\setbeamertemplate{page~number~in~head/foot}[totalframenumber] },
+ numbering / appendixframenumber .code:n = {\setbeamertemplate{page~number~in~head/foot}[appendixframenumber] },
+ numbering / pagenumber .code:n = { \setbeamertemplate{page~number~in~head/foot}[pagenumber] },
+ numbering / totalpagenumber .code:n = {\setbeamertemplate{page~number~in~head/foot}[totalpagenumber] },
+ numbering / circle .code:n = {\setbeamertemplate{page~number~in~head/foot}[circle] },
+
+ numbering / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'numbering',~so~being~ignored. }{helping~message} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+%%% MiniFrames \& Progress bar %%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%% MiniFrames %%%
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{section~in~head/foot}{default/beamer}}
+% Template control how the section appears by default when sections are add to the headline or footline.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate{section~in~head/foot}{default/beamer}{
+ \insertsectionhead
+}
+\defbeamertemplate{section~in~head/foot~shaded}{default/beamer}{
+ \color{fg!50!bg}\usebeamertemplate{section~in~head/foot}
+}
+
+% \defbeamertemplate{includeLogo}{default/gotham~square}{
+\prop_put:Nnn \l__gotham_template_name_prop {section~in~head/foot~shaded/default} {beamer}
+% \defbeamertemplate{includeLogo}{default/gotham~square}{
+\prop_put:Nnn \l__gotham_template_name_prop {section~in~head/foot/default} {beamer}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{section~in~head/foot}{default/gotham~secSubsec}}
+% Template for section and subsection in headline.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate{section~in~head/foot}{default/gotham~secSubsec}{
+ \insertsectionhead
+ \ifx\insertsubsection\empty\else
+ \ifdefempty{\subsecname}{\relax}{
+ \ \textbar\ \insertsubsectionhead
+ }
+ \fi
+}
+\defbeamertemplate{section~in~head/foot~shaded}{default/gotham~secSubsec}{
+ \insertsectionhead
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{section~in~head/foot}{default/empty}}
+% Empty template for section in headline, compensating the height of a line.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate{section~in~head/foot}{default/empty}{
+ \vspace{3.875ex}
+}
+\defbeamertemplate{section~in~head/foot~shaded}{default/empty}{
+ \vspace{3.875ex}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{variable}{\gotham@temp@heightFrametitle, \gotham@temp@PaperheightFrametitle}
+% Temporary length variables to compute the height of the frametitle and the height of the paper minus the frametitle.
+% \begin{macrocode}
+\newlength{\gotham@temp@heightFrametitle}
+\newlength{\gotham@temp@PaperheightFrametitle}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate*{mini~nav~progress~head/foot left right}{gotham~miniframes~theme}}
+% Template to insert the navigation bar (using miniframes) that can be added to headline (or footline) left sidebar or righ sidebar.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate*{mini~nav~progress~head/foot}{gotham~miniframes~theme}
+{
+ %,ht=1.75ex,dp=2.75ex
+ \begin{beamercolorbox}[ignorebg]{section~in~head/foot}
+ \hfuzz=\paperwidth
+ \insertnavigation{\paperwidth}
+ % \dohead
+ \vspace{0.05cm}
+ \end{beamercolorbox}
+}
+\defbeamertemplate*{mini~nav~progress~left}{gotham~miniframes~theme}
+{
+ \settoheight{\gotham@temp@heightFrametitle}{\gotham@strut}
+ \addtolength{\gotham@temp@heightFrametitle}{\gotham@frametitle@toppadding+\gotham@frametitle@bottompadding+\gothamProgressHeadFootLineheight}
+
+ \setlength{\gotham@temp@PaperheightFrametitle}{\paperheight-\gotham@temp@heightFrametitle-\gothamFootlineHeight-\gothamFootlineDepth-\gothamProgressHeadFootLineheight}
+
+ \vspace{-0.6\paperheight}
+ \rotatebox{90}{
+ %,ht=1.75ex,dp=2.75ex
+ \begin{beamercolorbox}[ignorebg]{section~in~head/foot}
+ \hfuzz=\gotham@temp@PaperheightFrametitle
+ \insertnavigation{\gotham@temp@PaperheightFrametitle}
+ % \dohead
+ % \vspace{0.05cm}
+ \end{beamercolorbox}
+ }
+}
+\defbeamertemplate*{mini~nav~progress~right}{gotham~miniframes~theme}
+{
+ \settoheight{\gotham@temp@heightFrametitle}{\gotham@strut}
+ \addtolength{\gotham@temp@heightFrametitle}{\gotham@frametitle@toppadding+\gotham@frametitle@bottompadding+\gothamProgressHeadFootLineheight}
+
+ \setlength{\gotham@temp@PaperheightFrametitle}{\paperheight-\gotham@temp@heightFrametitle-\gothamFootlineHeight-\gothamFootlineDepth-\gothamProgressHeadFootLineheight}
+
+ \vspace{\gotham@temp@heightFrametitle}
+ \hspace{-2.3em}
+ \rotatebox{-90}{
+ %,ht=1.75ex,dp=2.75ex
+ \begin{beamercolorbox}[ignorebg]{section~in~head/foot}
+ \hfuzz=\gotham@temp@PaperheightFrametitle
+ \insertnavigation{\gotham@temp@PaperheightFrametitle}
+ % \dohead
+ % \vspace{0.05cm}
+ \end{beamercolorbox}
+ }
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+%% Select the bullets shape
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{mini~frame}{gotham~box}}
+% Template to add a new shape for miniframes |gotham box|.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate{mini~frame}{gotham~box}
+{
+ \begin{pgfpicture}{0pt}{0pt}{.1cm}{.1cm}
+ \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{0.1cm}{0.1cm}}
+ \pgfusepath{fill,stroke}
+ \end{pgfpicture}
+}[action]{
+ \setbeamersize{mini~frame~size=.14cm, mini~frame~offset=.05cm}
+}
+%
+\defbeamertemplate{mini~frame~in~current~subsection}{gotham~box}
+{
+ \begin{pgfpicture}{0pt}{0pt}{.1cm}{.1cm}
+ \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{0.1cm}{0.1cm}}
+ \pgfusepath{stroke}
+ \end{pgfpicture}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{mini~frame}{gotham~minibox}}
+% Template to add a new shape for miniframes |gotham minibox|.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate{mini~frame}{gotham~minibox}
+{
+ \begin{pgfpicture}{0pt}{0pt}{.05cm}{.05cm}
+ \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{0.05cm}{0.05cm}}
+ \pgfusepath{fill,stroke}
+ \end{pgfpicture}
+}[action]{
+ \setbeamersize{mini~frame~size=.08cm, mini~frame~offset=.05cm}
+}
+%
+\defbeamertemplate{mini~frame~in~current~subsection}{gotham~minibox}
+{
+ \begin{pgfpicture}{0pt}{0pt}{.05cm}{.05cm}
+ \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{0.05cm}{0.05cm}}
+ \pgfusepath{stroke}
+ \end{pgfpicture}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{mini~frame}{gotham~minibullet}}
+% Template to add a new shape for miniframes |gotham minibullet|.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate{mini~frame}{gotham~minibullet}
+{
+ \beamer@xelatex@fixminiframes
+ \begin{pgfpicture}{0pt}{0pt}{0.05cm}{0.05cm}
+ \pgfpathcircle{\pgfpoint{0.03cm}{0.03cm}}{0.03cm}
+ \pgfusepath{fill,stroke}
+ \end{pgfpicture}
+}[action]{
+ \setbeamersize{mini~frame~size=.09cm, mini~frame~offset=.05cm}
+}
+%
+\defbeamertemplate{mini~frame~in~current~subsection}{gotham~minibullet}
+{
+ \beamer@xelatex@fixminiframes
+ \begin{pgfpicture}{0pt}{0pt}{0.05cm}{0.05cm}
+ \pgfpathcircle{\pgfpoint{0.03cm}{0.03cm}}{0.03cm}
+ \pgfusepath{stroke}
+ \end{pgfpicture}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\useoutertheme}
+% \begin{syntax}
+% \cs{useoutertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{mini frames shape} = \oarg{\defopt{gotham minibullet} \textbar default (bullet from beamer) \textbar tick \textbar box \textbar gotham box \textbar gotham minibox \textbar ... }
+% \meta{framesubtitle template} = \oarg{\defopt{gotham subnewline} \textbar ...}
+% \end{syntax}
+% The 'package' (useoutertheme) options can control |frame numbering| templates used in |footer| template.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{outer key -- interface}
+% Controls the outer settings for mini frames shape template.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\keys_define:nn { gotham / outer }{
+ %% mini~frames~shape
+ % mini~frames~shape .choice:,
+ mini~frames~shape .usage:n = { general },
+ mini~frames~shape .default:n = { gotham~minibullet },
+ % \__gotham_set_template:nn{title~page}{#1}
+ mini~frames~shape .code:n = {
+ % \__gotham_set_template:nn{mini~frames}{#1}% This can not work since this is an alias, so go back to normal
+ \setbeamertemplate{mini~frames}[#1]
+ },
+ % mini~frames~shape / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'numbering',~so~being~ignored. }{helping~message} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate*{miniframe~home}}
+% Template to adapt Beamer to the internal modification brought by Gotham: differientiation between slide to come and those done, idem for section, subsection...
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate*{miniframe~home}{beamer}{
+ % $\equiv$
+}
+\defbeamertemplate*{miniframe~current~slide}{beamer}{
+ \usebeamertemplate{mini~frame}
+}
+\defbeamertemplate*{miniframe~done~current~section}{beamer}{
+ \usebeamertemplate{mini~frame~in~current~subsection}
+}
+\defbeamertemplate*{miniframe~todo~current~section}{beamer}{
+ \usebeamertemplate{mini~frame~in~current~subsection}
+}
+\defbeamertemplate*{miniframe~done~other~section}{beamer}{
+ \usebeamertemplate{mini~frame~in~other~subsection}
+}
+\defbeamertemplate*{miniframe~todo~other~section}{beamer}{
+ \usebeamertemplate{mini~frame~in~other~subsection}
+}
+% Templates about should appear sectioning in mini frame.
+% \defbeamertemplate*{miniframe~part}{beamer}{}
+\defbeamertemplate*{miniframe~section~current}{beamer}{}
+\defbeamertemplate*{miniframe~section~done}{beamer}{}
+\defbeamertemplate*{miniframe~section~todo}{beamer}{}
+\defbeamertemplate*{miniframe~subsection~current}{beamer}{}
+\defbeamertemplate*{miniframe~subsection~todo}{beamer}{}
+\defbeamertemplate*{miniframe~subsection~done}{beamer}{}
+% \defbeamertemplate*{miniframe~subsubsection}{beamer}{}
+\defbeamertemplate*{miniframe~section~done~in~other~section}{default}[1][50]
+{
+ \color{fg!#1!bg}\usebeamertemplate{miniframe~section~done}
+}
+\defbeamertemplate*{miniframe~section~todo~in~other~section}{default}[1][50]
+{
+ \color{fg!#1!bg}\usebeamertemplate{miniframe~section~todo}
+}
+\defbeamertemplate*{miniframe~subsection~done~in~other~section}{default}[1][50]
+{
+ \color{fg!#1!bg}\usebeamertemplate{miniframe~subsection~done}
+}
+\defbeamertemplate*{miniframe~subsection~todo~in~other~section}{default}[1][50]
+{
+ \color{fg!#1!bg}\usebeamertemplate{miniframe~subsection~todo}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{miniframe~home}{gotham~mini}}
+% Templates for miniframes using a Gotham style inspired by a miniaturization than the one from Beamer.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate{miniframe~home}{gotham~mini}{
+ \resizebox{0.85\beamer@boxsize}{\beamer@boxsize}{$\equiv$}
+ % \scalebox{0.5}[0.95]{$\equiv$}
+}
+\defbeamertemplate{miniframe~current~slide}{gotham~mini}{
+ \usebeamercolor[fg]{alerted~text}
+ \usebeamertemplate{mini~frame}
+}
+\defbeamertemplate{miniframe~done~current~section}{gotham~mini}{
+ \usebeamertemplate{mini~frame}
+}
+\defbeamertemplate{miniframe~todo~current~section}{gotham~mini}{
+ \usebeamertemplate{mini~frame~in~current~subsection}
+}
+\defbeamertemplate{miniframe~done~other~section}{gotham~mini}[1][50]{
+ \color{fg!#1!bg}\usebeamertemplate{mini~frame}
+}
+\defbeamertemplate{miniframe~todo~other~section}{gotham~mini}[1][50]{
+ \color{fg!#1!bg}\usebeamertemplate{mini~frame~in~other~subsection}
+}
+% Templates about should appear sectioning in mini frame.
+% \defbeamertemplate{miniframe~part}{gotham~mini}[1][]{
+% p
+% }
+\defbeamertemplate{miniframe~section~current}{gotham~mini}{
+ \fontsize{3pt}{0pt}\selectfont
+ % \color{blue}
+ \tl_use:N \l__gotham_minif_tmpa_tl
+ \hspace{1.pt}
+}
+\defbeamertemplate{miniframe~section~done}{gotham~mini}{
+ \fontsize{3pt}{0pt}\selectfont
+ % \color{green}
+ \tl_use:N \l__gotham_minif_tmpa_tl
+ \hspace{1.pt}
+}
+\defbeamertemplate{miniframe~section~todo}{gotham~mini}{
+ \fontsize{3pt}{0pt}\selectfont
+ % \color{red}
+ \tl_use:N \l__gotham_minif_tmpa_tl
+ \hspace{1.pt}
+}
+\defbeamertemplate{miniframe~subsection~current}{gotham~mini}{
+ \usebeamercolor[fg]{alerted~text}
+ \hspace{-0.15pt}
+ \resizebox{\beamer@boxsize}{!}{\hspace{-0.75pt}$\blacklozenge$}
+}
+\defbeamertemplate{miniframe~subsection~todo}{gotham~mini}{
+ \hspace{-0.15pt}
+ \resizebox{\beamer@boxsize}{!}{\hspace{-0.75pt}$\lozenge$}
+}
+\defbeamertemplate{miniframe~subsection~done}{gotham~mini}{
+ \hspace{-0.15pt}
+ \resizebox{\beamer@boxsize}{!}{\hspace{-0.75pt}$\blacklozenge$}
+}
+% \defbeamertemplate{miniframe~subsubsection}{gotham~mini}{
+% d
+% }
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{miniframe~home}{gotham~nano}}
+% Template for Gotham mini frame style using even less space.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate{miniframe~home}{gotham~nano}{
+ % \resizebox{\beamer@boxsize}{!}{$\equiv$}
+ \scalebox{0.5}[0.95]{$\equiv$}
+}
+\defbeamertemplate{miniframe~current~slide}{gotham~nano}{
+ o
+}
+\defbeamertemplate{miniframe~done~current~section}{gotham~nano}{
+ x
+}
+\defbeamertemplate{miniframe~todo~current~section}{gotham~nano}{
+ $\cdot$
+}
+\defbeamertemplate{miniframe~done~other~section}{gotham~nano}{
+ x
+}
+\defbeamertemplate{miniframe~todo~other~section}{gotham~nano}{
+ $\cdot$
+}
+% Templates about should appear sectioning in mini frame.
+% \defbeamertemplate{miniframe~part}{gotham~nano}[1][]{
+% p
+% }
+\defbeamertemplate{miniframe~section~current}{gotham~nano}{
+ \tl_use:N \l__gotham_minif_tmpa_tl
+}
+\defbeamertemplate{miniframe~section~done}{gotham~nano}{
+ \tl_use:N \l__gotham_minif_tmpa_tl
+}
+\defbeamertemplate{miniframe~section~todo}{gotham~nano}{
+ \tl_use:N \l__gotham_minif_tmpa_tl
+}
+\defbeamertemplate{miniframe~subsection~current}{gotham~nano}{
+ \usebeamercolor[fg]{alerted~text}$\diamond$
+}
+\defbeamertemplate{miniframe~subsection~todo}{gotham~nano}{
+ $\diamond$
+}
+\defbeamertemplate{miniframe~subsection~done}{gotham~nano}{
+ $\diamond$
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplateparent{mini~frames~bundle}}
+% Define a parent template to set the 6 templates at once.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplateparent{mini~frames~bundle}
+{ miniframe~home, miniframe~current~slide,
+ miniframe~done~current~section, miniframe~todo~current~section, miniframe~done~other~section, miniframe~todo~other~section,
+ miniframe~section~current, miniframe~section~done, miniframe~section~todo,
+ miniframe~subsection~current, miniframe~subsection~done, miniframe~subsection~todo,
+}{}
+%\setbeamertemplate{mini~frames~bundle}[gotham~mini]%[beamer]%[gotham~nano]%
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\useoutertheme}
+% \begin{syntax}
+% \cs{useoutertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{mini frames bundle} = \oarg{\defopt{gotham minibullet} \textbar default (bullet from beamer) \textbar tick \textbar box \textbar gotham box \textbar gotham minibox \textbar ... }
+% \meta{framesubtitle template} = \oarg{\defopt{gotham subnewline} \textbar ...}
+% \end{syntax}
+% The 'package' (useoutertheme) options can control |mini frame| templates.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{outer key -- interface}
+% Controls the outer settings for mini frames bundle template.
+% \UnitTested
+% \TestFiles{gotham-test-050}
+% \begin{macrocode}
+\keys_define:nn { gotham / outer }{
+ %% mini~frames~bundle
+ % mini~frames~bundle .choice:,
+ mini~frames~bundle .usage:n = { general },
+ mini~frames~bundle .default:n = { gotham~mini },
+ % \__gotham_set_template:nn{title~page}{#1}
+ mini~frames~bundle .code:n = {
+ % \__gotham_set_template:nn{mini~frames}{#1}% This can not work since this is an alias, so go back to normal
+ \setbeamertemplate{mini~frames~bundle}[#1]
+ },
+ % mini~frames~bundle / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'numbering',~so~being~ignored. }{helping~message} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+%%% MiniFrames Navigation %%%
+
+% \begin{documentation}
+% \begin{function}{\useoutertheme}
+% \begin{syntax}
+% \cs{useoutertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{mini frames compress} = \oarg{\defopt{on} \textbar off }
+% \end{syntax}
+% The 'package' (useoutertheme) options can control |compress| option in mini frames.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{outer key -- interface}
+% Controls the outer settings for mini frames compress template.
+% \UnitTested
+% \TestFiles{gotham-test-050}
+% \begin{macrocode}
+\keys_define:nn { gotham / outer }{
+ % mini~frames~compress default
+ mini~frames~compress .choice:,
+ mini~frames~compress .usage:n = { general },
+ mini~frames~compress .default:n = { true },
+
+ mini~frames~compress / true .code:n = { \beamer@compresstrue },
+ mini~frames~compress / on .code:n = { \beamer@compresstrue },
+ mini~frames~compress / enable .code:n = { \beamer@compresstrue },
+
+ mini~frames~compress / false .code:n = { \beamer@compressfalse },
+ mini~frames~compress / off .code:n = { \beamer@compressfalse },
+ mini~frames~compress / disable .code:n = { \beamer@compressfalse },
+
+ mini~frames~compress / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'mini~frames~compress',~so~being~ignored. }{helping~message: mini~frames~compress / unknown} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{variable}{\l__gotham_minif_tmpa_tl, \gotham@temp@MiniframeSubsecDim, \gotham@temp@lastSec}
+% Temporary variables used for the store dimension of the miniframe subsection, check if the last section treated and the pass the value of the section to the section template.
+% \begin{macrocode}
+\newlength{\gotham@temp@MiniframeSubsecDim}
+\newlength{\gotham@temp@MiniframeSecDim}
+\def\gotham@temp@lastSec{-1}
+\tl_new:N \l__gotham_minif_tmpa_tl
+\tl_new:N \l__gotham_minif_tmpb_tl
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\renewcommand{\slideentry}}
+% Redefinition of the slideentry command from Beamer in order to add home page symbol, section symbol, subsection symbol to come and done.
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+% definition from Beamerbasenavigation.sty
+% \def\slideentry#1#2#3#4#5#6{%
+\renewcommand{\slideentry}[6]{%
+ %section number, subsection number, slide number, first/last frame, page number, part number
+ \ifnum#6=\c@part\ifnum#3>0%\ifnum#6=\c@part\ifnum#1>0\ifnum#3>0 MODIF
+ \ifbeamer@compress%
+ \advance\beamer@xpos by1\relax%
+ \else%
+ \ifnum#2=0%
+ \beamer@ypos@offset=1\relax%
+ \fi%
+ \beamer@xpos=#3\relax%
+ \beamer@ypos=#2\relax%
+ \advance\beamer@ypos by \beamer@ypos@offset\relax%
+ \fi%
+ %% Add section number and subsection symbol to miniframes.
+ %% MODIF below, inspired from https://tex.stackexchange.com/questions/722523
+ \ifnum#3=1%\c@subsectionslide=#3 % if =1, so it has been reset => new section or subsection
+ \ifnum#1>0\ifnum#2<2% => there no subsection in this section.
+ \ifnum\gotham@temp@lastSec=#1%
+ % this means, that we already went through: there no subsec, then the first subsec has been defined.
+ \else%
+ \tl_set:Nn \l__gotham_minif_tmpa_tl {#1}
+ \settowidth{\gotham@temp@MiniframeSecDim}{\usebeamertemplate{miniframe~section~current}}%
+ % \addtolength{\gotham@temp@MiniframeSecDim}{1.5pt}
+ \hbox to 0pt{%
+ \beamer@tempdim=-\beamer@vboxoffset%
+ \advance\beamer@tempdim by-\beamer@boxsize%
+ \multiply\beamer@tempdim by\beamer@ypos%
+ \advance\beamer@tempdim by -.05cm%
+ \raise\beamer@tempdim\hbox{%
+ \beamer@tempdim=\beamer@boxsize%
+ \multiply\beamer@tempdim by\beamer@xpos%
+ \advance\beamer@tempdim by -\beamer@boxsize%
+ \advance\beamer@tempdim by -\gotham@temp@MiniframeSecDim% NEW
+ \advance\beamer@tempdim by 1pt%
+ \kern\beamer@tempdim%
+ \global\beamer@section@min@dim\beamer@tempdim%
+ \hbox{\beamer@link(#4){%
+ % \usebeamertemplate{miniframe~section}%
+ % if not first page then check if it is the current section.
+ \ifnum\c@section=#1%
+ % check if it is the current slide
+ \ifnum\c@subsectionslide=#3%
+ \usebeamertemplate{miniframe~section~current}
+ \else%
+ \ifnum\c@subsectionslide<#3
+ \usebeamertemplate{miniframe~section~todo}
+ \else%
+ \usebeamertemplate{miniframe~section~done}
+ \fi%
+ \fi%
+ \else% \ifnum\c@section=#1%
+ \ifnum\c@section<#1
+ \usebeamertemplate{miniframe~section~todo~in~other~section}
+ \else%
+ \usebeamertemplate{miniframe~section~done~in~other~section}
+ \fi%
+ \fi% \ifnum\c@section=#1
+ }}%
+ }%
+ }%
+ \def\gotham@temp@lastSec{#1}%
+ \fi%
+ \fi\fi%
+ \ifnum#2>0%
+ % Check if the miniframe subsection template is empty
+ \ifbeamertemplateempty{miniframe~subsection~current}{
+ % do nothing
+ }{
+ \tl_set:Nn \l__gotham_minif_tmpb_tl {#2}
+ \settowidth{\gotham@temp@MiniframeSubsecDim}{}%\usebeamertemplate{miniframe~subsection~current}}%
+ \addtolength{\gotham@temp@MiniframeSubsecDim}{+1.\beamer@boxsize}%
+ \advance\beamer@xpos by1\relax%
+ \hbox to 0pt{%
+ \beamer@tempdim=-\beamer@vboxoffset%
+ \advance\beamer@tempdim by-\beamer@boxsize%
+ \multiply\beamer@tempdim by\beamer@ypos%
+ \advance\beamer@tempdim by -.05cm%
+ \raise\beamer@tempdim\hbox{%
+ \beamer@tempdim=\beamer@boxsize%
+ \multiply\beamer@tempdim by\beamer@xpos%
+ \advance\beamer@tempdim by -\beamer@boxsize%
+ \advance\beamer@tempdim by -\gotham@temp@MiniframeSubsecDim% NEW
+ \advance\beamer@tempdim by 1pt%
+ \kern\beamer@tempdim%
+ \global\beamer@section@min@dim\beamer@tempdim%
+ \hbox{\beamer@link(#4){%
+ % \usebeamertemplate{miniframe~subsection~current}%
+ % if not first page then check if it is the current section.
+ \ifnum\c@section=#1%
+ % check if it is the current subsection
+ \ifnum\c@subsection=#2%
+ % check if it is the current slide
+ \ifnum\c@subsectionslide=#3%
+ \usebeamertemplate{miniframe~subsection~current}
+ \else%
+ \ifnum\c@subsectionslide<#3
+ \usebeamertemplate{miniframe~subsection~todo}
+ \else%
+ \usebeamertemplate{miniframe~subsection~done}
+ \fi%
+ \fi%
+ \else% \ifnum\c@subsection=#2%
+ \ifnum\c@subsection<#2
+ \usebeamertemplate{miniframe~subsection~todo}
+ \else%
+ \usebeamertemplate{miniframe~subsection~done}
+ \fi%
+ \fi% \ifnum\c@subsection=#2%
+ \else% \ifnum\c@section=#1%
+ \ifnum\c@section<#1
+ \usebeamertemplate{miniframe~subsection~todo~in~other~section}
+ \else%
+ \usebeamertemplate{miniframe~subsection~done~in~other~section}
+ \fi%
+ \fi% \ifnum\c@section=#1
+ }}% \hbox{\beamer@link
+ }% raisebox
+ }% hbox
+ }% end if template empty
+ \fi% \ifnum#2>0
+ \else
+ \ifbeamer@compress%
+ % \advance\beamer@xpos by1\relax%
+ \else%
+ \ifbeamertemplateempty{miniframe~subsection~current}{
+ % NEW
+ % do nothing
+ }{
+ \advance\beamer@xpos by 1\relax%
+ }
+ \fi%
+ \fi% \ifnum#3=1
+
+ %% end of modif to add section number and subsection symbol.
+ \hbox to 0pt{%
+ \beamer@tempdim=-\beamer@vboxoffset%
+ \advance\beamer@tempdim by-\beamer@boxsize%
+ \multiply\beamer@tempdim by\beamer@ypos%
+ \advance\beamer@tempdim by -.05cm%
+ \raise\beamer@tempdim\hbox{%
+ \beamer@tempdim=\beamer@boxsize%
+ \multiply\beamer@tempdim by\beamer@xpos%
+ \advance\beamer@tempdim by -\beamer@boxsize%
+ \advance\beamer@tempdim by 1pt%
+ \kern\beamer@tempdim
+ \global\beamer@section@min@dim\beamer@tempdim
+ \hbox{\beamer@link(#4){%
+ \usebeamerfont{mini~frame}%
+ % \ifnum\c@section=#1%
+ % \ifnum\c@subsection=#2%
+ % \usebeamercolor[fg]{mini~frame}%
+ % \ifnum\c@subsectionslide=#3%
+ % \usebeamertemplate{mini~frame}%\beamer@minislidehilight%
+ % \else%
+ % \usebeamertemplate{mini~frame~in~current~subsection}%\beamer@minisliderowhilight%
+ % \fi%
+ % \else%
+ % \usebeamercolor{mini~frame}%
+ % %\color{fg!50!bg}%
+ % \usebeamertemplate{mini~frame~in~other~subsection}%\beamer@minislide%
+ % \fi%
+ % \else%
+ % \usebeamercolor{mini~frame}%
+ % %\color{fg!50!bg}%
+ % \usebeamertemplate{mini~frame~in~other~subsection}%\beamer@minislide%
+ % \fi%
+ %%
+ %% CHANGE FROM HERE: I rewrote this part.
+ % If first page (ie. 1/1)
+ \def\gotham@temp@i{1/1}
+ \def\gotham@temp@ii{#4}
+ \ifx\gotham@temp@i\gotham@temp@ii
+ % If first page (ie. title page) then apply a special mini frame
+ \usebeamertemplate{miniframe~home}
+ \else
+ % if not first page then check if it is the current section.
+ \ifnum\c@section=#1%
+ % check if it is the current subsection
+ \ifnum\c@subsection=#2%
+ \usebeamercolor[fg]{mini~frame}%
+ % check if it is the current slide
+ \ifnum\c@subsectionslide=#3%
+ \usebeamertemplate{miniframe~current~slide}
+ % \usebeamertemplate{mini~frame}% \beamer@minislidehilight%
+ \else%
+ % \usebeamertemplate{mini~frame~in~current~subsection}% \beamer@minisliderowhilight%
+ \ifnum\c@subsectionslide<#3
+ \usebeamertemplate{miniframe~todo~current~section}
+ \else%
+ \usebeamertemplate{miniframe~done~current~section}
+ \fi%
+ \fi%
+ \else% \ifnum\c@subsection=#2%
+ \usebeamercolor{mini~frame}%
+ % \usebeamertemplate{mini~frame~in~other~subsection}% \beamer@minislide%
+ \ifnum\c@subsection<#2
+ \usebeamertemplate{miniframe~todo~other~section}
+ \else%
+ \usebeamertemplate{miniframe~done~other~section}
+ \fi%
+ \fi% \ifnum\c@subsection=#2%
+ \else% \ifnum\c@section=#1%
+ \usebeamercolor{mini~frame}%
+ % \usebeamertemplate{mini~frame~in~other~subsection}% \beamer@minislide%
+ \ifnum\c@section<#1
+ \usebeamertemplate{miniframe~todo~other~section}
+ \else%
+ \usebeamertemplate{miniframe~done~other~section}
+ \fi%
+ \fi% \ifnum\c@section=#1
+ \fi% \ifx\gotham@temp@i\gotham@temp@ii
+ }}}\hskip-10cm plus 1fil%
+ }\fi% \ifnum#1>0\ifnum#3>0%
+ \else% \ifnum#6=\c@part
+ \fakeslideentry{#1}{#2}{#3}{#4}{#5}{#6}%
+ \fi\ignorespaces%
+ % \def\gotham@temp@lastSec{-1}%
+}%
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{variable}{gothamZerosectionframes}
+% Boolean variable to flag if they are frame in a zeroth section.
+% This variable helps to adapt the spreading of |mini frames nav| bar.
+% This variable is automatically set if the spread is set correctly at the beginning of the presention.
+% If the spreading or the mini frame nav is disable at the zeroth section then reactivated latter, it might create unwanted spreading.
+% In such situation the variable has to be set manually to correct the spreading.
+% \end{variable}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{variable}{gothamZerosectionframes}
+% Boolean variable to flag if they are frame in a zeroth section.
+% \begin{macrocode}
+\providebool{gothamZerosectionframes}
+\boolfalse{gothamZerosectionframes}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\insertnavigation,\sectionentry}
+% Patches for |\insertnavigation| and |\sectionentry| to be able to adapt with spreading values.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\providecommand{\gothamInsertNavlength}{
+ % spreading by default
+ \ifbool{gothamZerosectionframes}{
+ %true
+ % spreading
+ \hskip-0.5ex~plus~1fill
+ }{
+ %false
+ \hskip-1.875ex~plus-1fill
+ }%
+}
+\providecommand{\gothamPatchInsertNav}{
+ % Don't patch for now
+ \box\beamer@sectionbox\hfil\hskip.3cm
+}
+\providecommand{\gothamPatchSectionentry}{
+ % Don't patch for now
+ \hskip1.875ex~plus~1fill
+}
+\providecommand{\gothamPatchSectionbox}{
+ % Don't patch for now
+ \ht\beamer@sectionbox=1.875ex
+ \dp\beamer@sectionbox=0.75ex
+}
+\ExplSyntaxOff
+ % To let the 0-th section appear.
+ \patchcmd{\insertnavigation}{\hskip-1.875ex plus-1fill}{%
+ \ifnum\value{section}=0%
+ \ifnum\value{framenumber}>0%
+ \hskip-0ex%
+ \global\booltrue{gothamZerosectionframes}%
+ \fi\fi%
+ \gothamInsertNavlength%
+ }{}{}
+ %% Remove hfill between sections => flush right bullet bar, if not corrected.
+ \patchcmd{\sectionentry}{\hskip1.875ex plus 1fill}{\gothamPatchSectionentry}{}{}
+ %% Centering the bullet bar
+ \patchcmd{\insertnavigation}{\box\beamer@sectionbox\hfil\hskip.3cm}{\gothamPatchInsertNav}{}{}
+ % Patch size of sectionbox
+ \patchcmd{\insertnavigation}{\ht\beamer@sectionbox=1.875ex%
+ \dp\beamer@sectionbox=0.75ex%
+ }{
+ \gothamPatchSectionbox
+ }{}{}
+ \patchcmd{\sectionentry}{\ht\beamer@sectionbox=1.875ex%
+ \dp\beamer@sectionbox=0.75ex%
+ }{
+ \gothamPatchSectionbox
+ }{}{}
+\ExplSyntaxOn
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\useoutertheme}
+% \begin{syntax}
+% \cs{useoutertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{mini frames nav spreading} = \oarg{\defopt{centering} \textbar spreading \textbar left \textbar right }
+% \end{syntax}
+% The 'package' (useoutertheme) options can control spreading of the mini frames navigation.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{outer key -- interface}
+% Controls the outer settings for mini frames navigation spreading.
+% \UnitTested
+% \TestFiles{gotham-test-051}
+% \begin{macrocode}
+\keys_define:nn { gotham / outer }{
+ % mini~frames~nav~spreading default
+ mini~frames~nav~spreading .choice:,
+ mini~frames~nav~spreading .usage:n = { general },
+ mini~frames~nav~spreading .default:n = { spreading },
+
+ mini~frames~nav~spreading / spreading .code:n = {
+ %
+ \renewcommand{\gothamInsertNavlength}{
+ \ifbool{gothamZerosectionframes}{
+ %true
+ % spreading
+ \hskip-0.5ex
+ }{
+ %false
+ \hskip-1.875ex~plus-1fill
+ }%
+ }
+ % No other patch needed, but renewcommand if it has been modified previously.
+ \renewcommand{\gothamPatchInsertNav}{
+ % Don't patch for now
+ \box\beamer@sectionbox\hfil\hskip.3cm
+ }
+ \renewcommand{\gothamPatchSectionentry}{
+ % Don't patch for now
+ \hskip1.875ex~plus~1fill
+ }
+ },
+ mini~frames~nav~spreading / centering .code:n = {
+ %
+ \renewcommand{\gothamInsertNavlength}{
+ \ifbool{gothamZerosectionframes}{
+ %true
+ % centering +patch sectionenty +patch insertnav @sectionbox
+ \hskip-0.5ex~plus~1fill
+ }{
+ %false
+ % \patchcmd{\insertnavigation}{\hskip-1.875ex plus-1fill}{\hfill}{}{}
+ \hfill
+ }%
+ }
+ % Centering the bullet bar
+ % \patchcmd{\insertnavigation}{\box\beamer@sectionbox\hfil\hskip.3cm}{ \box\beamer@sectionbox\hfill\hskip.3cm}{}{}
+ \renewcommand{\gothamPatchInsertNav}{
+ \box\beamer@sectionbox\hfill\hskip.3cm
+ }
+ %% Remove hfill between sections => flush right bullet bar, if not corrected.
+ % \patchcmd{\sectionentry}{\hskip1.875ex plus 1fill}{\hskip 3.5ex}{}{}
+ \renewcommand{\gothamPatchSectionentry}{
+ \hskip~3.5ex
+ }
+ },
+ mini~frames~nav~spreading / left .code:n = {
+ %
+ \renewcommand{\gothamInsertNavlength}{
+ \ifbool{gothamZerosectionframes}{
+ %true
+ % flush left +patch sectionenty
+ \hskip-0.5ex
+ }{
+ %false
+ % no patch
+ \hskip-1.875ex plus-1fill
+ }%
+ }
+ % Centering the bullet bar : NO
+ % no patch
+ \renewcommand{\gothamPatchInsertNav}{
+ \box\beamer@sectionbox\hfil\hskip.3cm
+ }
+ %% Remove hfill between sections => flush right bullet bar, if not corrected.
+ % \patchcmd{\sectionentry}{\hskip1.875ex plus 1fill}{\hskip 3.5ex}{}{}
+ \renewcommand{\gothamPatchSectionentry}{
+ \hskip~3.5ex
+ }
+ },
+ mini~frames~nav~spreading / right .code:n = {
+ %
+ \renewcommand{\gothamInsertNavlength}{
+ \ifbool{gothamZerosectionframes}{
+ %true
+ % flush right +patch sectionenty
+ \hskip-0.5ex~plus~1fill
+ }{
+ %false
+ % no patch
+ \hskip-1.875ex plus-1fill
+ }%
+ }
+ % Centering the bullet bar : NO
+ % no patch
+ \renewcommand{\gothamPatchInsertNav}{
+ \box\beamer@sectionbox\hfil\hskip.3cm
+ }
+ %% Remove hfill between sections => flush right bullet bar, if not corrected.
+ % \patchcmd{\sectionentry}{\hskip1.875ex plus 1fill}{\hskip 3.5ex}{}{}
+ \renewcommand{\gothamPatchSectionentry}{
+ \hskip~3.5ex
+ }
+ },
+ mini~frames~nav~spreading / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'mini~frames~nav~spreading',~so~being~ignored. }{helping~message: mini~frames~nav~spreading / unknown} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\useoutertheme}
+% \begin{syntax}
+% \cs{useoutertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{mini frames nav sectioning} = \oarg{\defopt{on} \textbar off }
+% \end{syntax}
+% The 'package' (useoutertheme) options can control navigation sectioning option in mini frames.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{outer key -- interface}
+% Controls the outer settings for mini frames navigation sectioning template.
+% \UnitTested
+% \TestFiles{gotham-test-051}
+% \begin{macrocode}
+\keys_define:nn { gotham / outer }{
+ % mini~frames~nav~sectioning default
+ mini~frames~nav~sectioning .choice:,
+ mini~frames~nav~sectioning .usage:n = { general },
+ mini~frames~nav~sectioning .default:n = { secsubsection },
+
+ mini~frames~nav~sectioning / none .code:n = {
+ %
+ \__gotham_set_template:nn{section~in~head/foot~shaded}{default/empty}
+ \__gotham_set_template:nn{section~in~head/foot}{default/empty}
+ \renewcommand{\gothamPatchSectionbox}{
+ % patch to set section box height to 0.
+ \ht\beamer@sectionbox=0pt
+ \dp\beamer@sectionbox=0pt
+ }
+ },
+ mini~frames~nav~sectioning / section .code:n = {
+ %
+ \__gotham_set_template:nn{section~in~head/foot~shaded}{default} %from Beamer
+ \__gotham_set_template:nn{section~in~head/foot}{default} %from Beamer
+ },
+ mini~frames~nav~sectioning / secsubsection .code:n = {
+ %
+ \__gotham_set_template:nn{section~in~head/foot~shaded}{default/gotham~secSubsec}
+ \__gotham_set_template:nn{section~in~head/foot}{default/gotham~secSubsec}
+ },
+
+ mini~frames~nav~sectioning / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'mini~frames~nav~sectioning',~so~being~ignored. }{helping~message: mini~frames~nav~sectioning / unknown} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\useoutertheme}
+% \begin{syntax}
+% \cs{useoutertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{mini frames nav position} = \oarg{\defopt{none} \textbar head \textbar foot \textbar left \textbar right}
+% \end{syntax}
+% The 'package' (useoutertheme) options can control navigation position option in mini frames.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{outer key -- interface}
+% Controls the outer settings for mini frames navigation position template.
+% \UnitTested
+% \TestFiles{gotham-test-051}
+% \begin{macrocode}
+\tl_new:N \l__gotham_out_tmp_mfnposi_tl
+\keys_define:nn { gotham / outer }{
+ % mini~frames~nav~position default
+ mini~frames~nav~position .choice:,
+ mini~frames~nav~position .usage:n = { general },
+ mini~frames~nav~position .default:n = { none },
+
+ mini~frames~nav~position / none .code:n = {
+ %
+ % reset if it has modified by another progressbar strategy
+ % \__gotham_set_prop_template:nn{sidebar~canvas~right/default}{#1}
+ \tl_set:Nn \l__gotham_out_tmp_mfnposi_tl {none}
+
+ % head
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {head} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{headline}[default/\prop_item:Nn \l__gotham_template_name_prop {headline/default}]
+ }
+ % frametitle
+ % \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {frametitle} {
+ % % True: nothing to do it is already occupied.
+ % }{
+ % \setbeamertemplate{frametitle}[default/\prop_item:Nn \l__gotham_template_name_prop {frametitle/default}]
+ % }
+ % foot
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {footline} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{footline}[default/\prop_item:Nn \l__gotham_template_name_prop {footline/default}]
+ }
+ % left
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {left} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~left}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~left/default}]
+ }
+ % right
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {right} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~right}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~right/default}]
+ }
+ },
+ mini~frames~nav~position / head .code:n = {
+ %
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {head} {
+ % True: nothing to do it is already done.
+ }{
+ % False : remember that choice in order to do not apply it several time and add to beamer template.
+ \tl_set:Nn \l__gotham_out_tmp_mfnposi_tl {head}
+
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {head} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{headline}[default/\prop_item:Nn \l__gotham_template_name_prop {headline/default}]
+ }
+ % \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {frametitle} {
+ % % True: nothing to do it is already occupied.
+ % }{
+ % \setbeamertemplate{frametitle}[default/\prop_item:Nn \l__gotham_template_name_prop {frametitle/default}]
+ % }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {footline} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{footline}[default/\prop_item:Nn \l__gotham_template_name_prop {footline/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {left} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~left}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~left/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {right} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~right}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~right/default}]
+ }
+
+ %
+ \addtobeamertemplate{headline}{}{
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {head} {
+ \usebeamertemplate*{mini~nav~progress~head/foot}
+ }{}
+ }
+ }
+ },
+ mini~frames~nav~position / foot .code:n = {
+ %
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {foot} {
+ % True: nothing to do it is already done.
+ }{
+ % False : remember that choice in order to do not apply it several time and add to beamer template.
+ \tl_set:Nn \l__gotham_out_tmp_mfnposi_tl {foot}
+
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {head} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{headline}[default/\prop_item:Nn \l__gotham_template_name_prop {headline/default}]
+ }
+ % \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {frametitle} {
+ % % True: nothing to do it is already occupied.
+ % }{
+ % \setbeamertemplate{frametitle}[default/\prop_item:Nn \l__gotham_template_name_prop {frametitle/default}]
+ % }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {footline} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{footline}[default/\prop_item:Nn \l__gotham_template_name_prop {footline/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {left} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~left}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~left/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {right} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~right}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~right/default}]
+ }
+
+ \addtobeamertemplate{footline}{}{
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {foot} {
+ \usebeamertemplate*{mini~nav~progress~head/foot}
+ }{}
+ }
+ }
+ },
+ mini~frames~nav~position / left .code:n = {
+ %
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {left} {
+ % True: nothing to do it is already done.
+ }{
+ % False : remember that choice in order to do not apply it several time and add to beamer template.
+ \tl_set:Nn \l__gotham_out_tmp_mfnposi_tl {left}
+
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {head} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{headline}[default/\prop_item:Nn \l__gotham_template_name_prop {headline/default}]
+ }
+ % \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {frametitle} {
+ % % True: nothing to do it is already occupied.
+ % }{
+ % \setbeamertemplate{frametitle}[default/\prop_item:Nn \l__gotham_template_name_prop {frametitle/default}]
+ % }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {footline} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{footline}[default/\prop_item:Nn \l__gotham_template_name_prop {footline/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {left} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~left}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~left/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {right} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~right}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~right/default}]
+ }
+
+ %
+ \addtobeamertemplate{sidebar~left}{}{
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {left} {
+ \usebeamertemplate*{mini~nav~progress~left}
+ }{}
+ }
+ }
+ },
+ mini~frames~nav~position / right .code:n = {
+ %
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {right} {
+ % True: nothing to do it is already done.
+ }{
+ % False : remember that choice in order to do not apply it several time and add to beamer template.
+ \tl_set:Nn \l__gotham_out_tmp_mfnposi_tl {right}
+
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {head} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{headline}[default/\prop_item:Nn \l__gotham_template_name_prop {headline/default}]
+ }
+ % \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {frametitle} {
+ % % True: nothing to do it is already occupied.
+ % }{
+ % \setbeamertemplate{frametitle}[default/\prop_item:Nn \l__gotham_template_name_prop {frametitle/default}]
+ % }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {footline} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{footline}[default/\prop_item:Nn \l__gotham_template_name_prop {footline/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {left} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~left}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~left/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {right} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~right}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~right/default}]
+ }
+
+ %
+ \addtobeamertemplate{sidebar~right}{}{
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {right} {
+ \usebeamertemplate*{mini~nav~progress~right}
+ }{}
+ }
+ }
+ },
+
+ mini~frames~nav~position / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'mini~frames~nav~position',~so~being~ignored. }{helping~message: mini~frames~nav~position / unknown} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+%%% Progress bar %%%
+
+% \begin{documentation}
+% \begin{variable}{\gothamProgressHeadFootLineheight}
+% Variable vertical length defining the height of the progressbar.
+% \end{variable}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{variable}{\gothamProgressHeadFootLineheight}
+% Lengths used in tikz rectangle.
+% \begin{macrocode}
+\newlength{\gotham@progressinheadfoot}
+\newlength{\gothamProgressHeadFootLineheight}
+\setlength{\gothamProgressHeadFootLineheight}{1.2ex}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{variable}{\l_gotham_ProgCircleMoving_bool, \l_gotham_progbar_advancement_tlbr_bool, \l_gotham_pmfn_bool}
+% Boolean variables controlling the direction of progression and if the current frame number is moving with the progression.
+% \end{variable}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{variable}{\l_gotham_ProgCircleMoving_bool, \l_gotham_progbar_advancement_tlbr_bool, \l_gotham_pmfn_bool}
+% Boolean variables controlling the direction of progression and if the current frame number is moving with the progression and if the miniframes navigation should be printed inside the progress bar.
+% \begin{macrocode}
+\bool_new:N \l_gotham_ProgCircleMoving_bool
+\bool_set_true:N \l_gotham_ProgCircleMoving_bool
+
+\bool_new:N \l_gotham_progbar_advancement_tlbr_bool
+\bool_set_true:N \l_gotham_progbar_advancement_tlbr_bool
+
+\bool_new:N \l_gotham_pmfn_bool
+\bool_set_false:N \l_gotham_pmfn_bool
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\__gotham_rectangle_box_progressbar:n}
+% \begin{arguments}
+% \item |width| of the progress bar.
+% \end{arguments}
+% Command to draw a rectangular progress bar that can go from left to right or the opposite and that can include a navigation miniframes bar.
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+% #1: 'linewidth'
+\cs_new_protected:Npn \__gotham_rectangle_box_progressbar:n #1
+{
+ %
+ \setlength{\gotham@progressinheadfoot}{
+ #1 * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}
+ }
+
+ %
+ \begin{beamercolorbox}[wd=#1]{progress~bar~in~head/foot}
+ \begin{tikzpicture}
+ \usebeamercolor{progress~bar~in~head/foot}
+
+ % gray rectangle in the background.
+ \fill[color=progress~bar~in~head/foot.bg]
+ (0pt, 0pt) rectangle ++ (#1, \gothamProgressHeadFootLineheight)
+ ;
+
+ \bool_if:NTF \l_gotham_progbar_advancement_tlbr_bool {
+ % from left to right
+ % orange rectangle progressing
+ \fill[color=progress~bar~in~head/foot.fg]
+ (0pt, 0pt) rectangle ++ (\gotham@progressinheadfoot, \gothamProgressHeadFootLineheight)
+ ;
+ }{
+ % from right to left
+ % orange rectangle progressing
+ \fill[color=progress~bar~in~head/foot.fg]
+ (#1, \gothamProgressHeadFootLineheight) rectangle ++ (-\gotham@progressinheadfoot, -\gothamProgressHeadFootLineheight)
+ ;
+ }
+
+ \bool_if:NTF \l_gotham_pmfn_bool {
+ % progress miniframes navigation is on.
+ \node at (#1/2, \gothamProgressHeadFootLineheight/2)
+ [text~height=0.1pt, text~depth=0.05pt, inner~sep=0pt] %draw=red,
+ {
+ \usebeamercolor[fg]{normal~text}
+ % \fontsize{3.5pt}{0pt}\selectfont
+ \raisebox{0.5\gothamProgressHeadFootLineheight+1.4pt}[0pt][0pt]{
+ %\dohead
+ \hfuzz=#1
+ \insertnavigation{#1}
+ }
+ }
+ ;
+ }{
+ % false
+ % nothing to do since progress miniframes navigation is off.
+ }
+ \end{tikzpicture}
+ \end{beamercolorbox}
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{progress~bar~in~head/foot}{gotham~rectangle}}
+% template displaying the progress bar in head, frametitle or footline.
+% \UnitTested
+% \TestFiles{gotham-test-046, gotham-test-046b, gotham-test-047, gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate{progress~bar~in~head/foot}{gotham~rectangle}{
+ \nointerlineskip
+ \__gotham_rectangle_box_progressbar:n {\paperwidth}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{progress~bar~in~left/right}{gotham~rectangle}}
+% template displaying the progress bar in left or right.
+% \UnitTested
+% \TestFiles{gotham-test-046, gotham-test-046b, gotham-test-047,gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate{progress~bar~in~left}{gotham~rectangle}{
+ \nointerlineskip
+
+ \settoheight{\gotham@temp@heightFrametitle}{\gotham@strut}
+ \addtolength{\gotham@temp@heightFrametitle}{\gotham@frametitle@toppadding+\gotham@frametitle@bottompadding+\gothamProgressHeadFootLineheight}
+
+ \setlength{\gotham@temp@PaperheightFrametitle}{\paperheight-\gotham@temp@heightFrametitle-\gothamFootlineHeight-\gothamFootlineDepth-0.25\baselineskip}
+
+ \vspace{0.12275\paperheight}
+ \rotatebox{90}{
+ \__gotham_rectangle_box_progressbar:n {\gotham@temp@PaperheightFrametitle}
+ }
+}
+\defbeamertemplate{progress~bar~in~right}{gotham~rectangle}{
+ \nointerlineskip
+
+ \settoheight{\gotham@temp@heightFrametitle}{\gotham@strut}
+ \addtolength{\gotham@temp@heightFrametitle}{\gotham@frametitle@toppadding+\gotham@frametitle@bottompadding+\gothamProgressHeadFootLineheight}
+
+ \setlength{\gotham@temp@PaperheightFrametitle}{\paperheight-\gotham@temp@heightFrametitle-\gothamFootlineHeight-\gothamFootlineDepth-0.25\baselineskip}
+
+ \hspace{-\gothamProgressHeadFootLineheight}
+ \vspace{\gotham@temp@heightFrametitle-27.75pt}
+ \rotatebox{-90}{
+ \__gotham_rectangle_box_progressbar:n {\gotham@temp@PaperheightFrametitle}
+ }
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\__gotham_rounded_box_progressbar:nnnn}
+% \begin{arguments}
+% \item |width| Name of the option to add, this name should also correspond to the name of the environment followed by the suffix 'env'.
+% \item |ratio progressbar/extra command|
+% \item |colorbox name|
+% \item |extra command|
+% \end{arguments}
+% Command to draw a rounded box progress bar that can go from left to right or the opposite and that can include a navigation miniframes bar.
+% The fourth argument is a command to control what to display at the right side of the rounded box.
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+% #1: 'linewidth'
+% #2: ratio of the progress bar
+% #3: colorbox name
+% #4: command for percent of progress
+\cs_new_protected:Npn \__gotham_rounded_box_progressbar:nnnn #1#2#3#4
+{
+ \setlength{\gotham@progressinheadfoot}{
+ #2#1 * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}
+ }
+
+ % 1.035\gothamProgressHeadFootLineheight is to include the border inside the box.
+ \begin{beamercolorbox}[wd=#1, ht=1.035\gothamProgressHeadFootLineheight]{#3}
+ \;\hfill
+ %\tikzexternaldisable%
+ \begin{tikzpicture}[rounded~corners=0.5\gothamProgressHeadFootLineheight, very~thin]
+ \usebeamercolor{progress~bar~in~head/foot}
+
+ % gray rectangle in the background.
+ \shade[top~color=progress~bar~in~head/foot.bg!65, bottom~color=progress~bar~in~head/foot.bg!65, middle~color=progress~bar~in~head/foot.bg]
+ (0pt, 0pt) rectangle ++ (#2#1, \gothamProgressHeadFootLineheight)
+ ;
+
+ \bool_if:NTF \l_gotham_progbar_advancement_tlbr_bool {
+ % from left to right
+ % orange rectangle progressing
+ \shade[draw=progress~bar~in~head/foot.fg, top~color=progress~bar~in~head/foot.fg!70, bottom~color=progress~bar~in~head/foot.fg!70, middle~color=progress~bar~in~head/foot.fg]
+ (0pt, 0pt) rectangle ++ (\gotham@progressinheadfoot, \gothamProgressHeadFootLineheight)
+ ;
+ }{
+ % from right to left
+ % orange rectangle progressing
+ \shade[draw=progress~bar~in~head/foot.fg, top~color=progress~bar~in~head/foot.fg!70, bottom~color=progress~bar~in~head/foot.fg!70, middle~color=progress~bar~in~head/foot.fg]
+ (#2#1, \gothamProgressHeadFootLineheight) rectangle ++ (-\gotham@progressinheadfoot, -\gothamProgressHeadFootLineheight)
+ ;
+ }
+
+ \bool_if:NTF \l_gotham_pmfn_bool {
+ % progress miniframes navigation is on.
+ \node at (#2#1/2, \gothamProgressHeadFootLineheight/2)
+ [text~height=0.1pt, text~depth=0.05pt, inner~sep=0pt] %draw=red,
+ {
+ \usebeamercolor[fg]{normal~text}
+ % \fontsize{3.5pt}{0pt}\selectfont
+ \raisebox{0.5\gothamProgressHeadFootLineheight+1.4pt}[0pt][0pt]{
+ \hfuzz=#2#1
+ %\dohead
+ \insertnavigation{#2#1}
+ }
+ }
+ ;
+ }{
+ % false
+ % nothing to do since progress miniframes navigation is off.
+ }
+ \end{tikzpicture}
+ #4
+ \hfill \;
+ \end{beamercolorbox}
+}
+% \cs_generate_variant:Nn \__gotham_rounded_box_progressbar:nnnn { Nnnn }
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{progress~bar~in~head/foot}{gotham~rounded~box}}
+% template displaying the progress bar in head, frametitle or footline.
+% \UnitTested
+% \TestFiles{gotham-test-046, gotham-test-046b, gotham-test-047,gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate{progress~bar~in~head/foot}{gotham~rounded~box}{
+ \nointerlineskip
+ \__gotham_rounded_box_progressbar:nnnn {\paperwidth}{0.93}{footline}{
+ \hfill
+ \raisebox{0.5\gothamProgressHeadFootLineheight-1.75pt}[0pt][0pt]{
+ \fontsize{5pt}{0pt}\selectfont
+ \usebeamercolor[fg]{normal~text}
+ \fp_eval:n {round(\insertframenumber*100/\inserttotalframenumber,0)}\,\%
+ }
+ }
+ % \__gotham_rounded_box_progressbar:nnnn {\paperwidth}{0.53}{progress~bar~in~head/foot}{}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{\defbeamertemplate{progress~bar~in~left/right}{gotham~rounded~box}}
+% template displaying the progress bar in left or right sidebar.
+% \UnitTested
+% \TestFiles{gotham-test-046, gotham-test-046b, gotham-test-047,gotham-test-048}
+% \begin{macrocode}
+\defbeamertemplate{progress~bar~in~left}{gotham~rounded~box}{
+ \nointerlineskip
+
+ \settoheight{\gotham@temp@heightFrametitle}{\gotham@strut}
+ \addtolength{\gotham@temp@heightFrametitle}{\gotham@frametitle@toppadding+\gotham@frametitle@bottompadding+\gothamProgressHeadFootLineheight}
+
+ \setlength{\gotham@temp@PaperheightFrametitle}{\paperheight-\gotham@temp@heightFrametitle-\gothamFootlineHeight-\gothamFootlineDepth-0.25\baselineskip}
+
+ \vspace{0.12275\paperheight}
+ % \hspace{\gothamProgressHeadFootLineheight}
+ \rotatebox{90}{
+ \__gotham_rounded_box_progressbar:nnnn {\gotham@temp@PaperheightFrametitle}{0.89}{footline}{
+ \hfill
+ \raisebox{0.5\gothamProgressHeadFootLineheight-1.75pt}[0pt][0pt]{
+ \fontsize{5pt}{0pt}\selectfont
+ \fp_eval:n {round(\insertframenumber*100/\inserttotalframenumber,0)}\,\%
+ }
+ }
+ }
+}
+\defbeamertemplate{progress~bar~in~right}{gotham~rounded~box}{
+ \nointerlineskip
+
+ \settoheight{\gotham@temp@heightFrametitle}{\gotham@strut}
+ \addtolength{\gotham@temp@heightFrametitle}{\gotham@frametitle@toppadding+\gotham@frametitle@bottompadding+\gothamProgressHeadFootLineheight}
+
+ \setlength{\gotham@temp@PaperheightFrametitle}{\paperheight-\gotham@temp@heightFrametitle-\gothamFootlineHeight-\gothamFootlineDepth-0.25\baselineskip}
+
+ \hspace{-\gothamProgressHeadFootLineheight-0.2pt}
+ \vspace{\gotham@temp@heightFrametitle-27.75pt}
+ \rotatebox{-90}{
+ \__gotham_rounded_box_progressbar:nnnn {\gotham@temp@PaperheightFrametitle}{0.89}{footline}{
+ \hfill
+ \raisebox{0.5\gothamProgressHeadFootLineheight-1.75pt}[0pt][0pt]{
+ \fontsize{5pt}{0pt}\selectfont
+ \fp_eval:n {round(\insertframenumber*100/\inserttotalframenumber,0)}\,\%
+ }
+ }
+ }
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{variable}{\gothamProgressCircHeight, \gothamCounterCircleRadius, \gothamProgressCircBorderWidth}
+% Lengths controlling the aspect of |progress circle|.
+% |\gothamProgressCircHeight| is controlling the inner height of the circle (related to its diameter).
+% |\gothamCounterCircleRadius| is controlling the size of the counter circle containing the frame number.
+% |\gothamProgressCircBorderWidth| is controlling width of the progress circle.
+% \end{variable}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{variable}{\gothamProgressCircHeight, \gothamCounterCircleRadius, \gothamProgressCircBorderWidth}
+% Lengths used in tikz rectangle.
+% \begin{macrocode}
+%the height of the header is 1.8 times the lineheight of the frame title
+\newlength{\gothamProgressCircHeight}
+\setlength{\gothamProgressCircHeight}{1.8\baselineskip}
+%\setlength{\gothamProgressCircHeight}{2\baselineskip}
+\newlength{\gothamCounterCircleRadius}
+\setlength{\gothamCounterCircleRadius}{1.12ex}
+% width of the border
+\newlength{\gothamProgressCircBorderWidth}
+\setlength{\gothamProgressCircBorderWidth}{1.65mm}
+
+%% Induced length used internally, but can still be tuned manually by inspired people.
+% radius of the logo
+\newlength{\gothamProgressCircLogoRadius}
+\setlength{\gothamProgressCircLogoRadius}{1.2\gothamProgressCircHeight/2}
+% inner radius of border of the logo frame
+\newlength{\gothamProgressCircLogoInnerRadius}
+\setlength{\gothamProgressCircLogoInnerRadius}{1.1\gothamProgressCircLogoRadius}
+% radius of the outer border of the logo frame
+\newlength{\gothamProgressCircLogoOuterRadius}
+\setlength{\gothamProgressCircLogoOuterRadius}{\gothamProgressCircLogoInnerRadius+\gothamProgressCircBorderWidth}
+% radius of the counters
+\newlength{\gothamCounterRadius}
+\setlength{\gothamCounterRadius}{\gothamProgressCircLogoInnerRadius/2+\gothamProgressCircLogoOuterRadius/2}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{variable}{\l_gotham_ratio_progresscircle_fp, \l_gotham_angle_counterradius_fp}
+% angle ratio of the progress in degree and angle of the counter circle intercepted by the half of the border.
+% \begin{macrocode}
+% \fp_new:N \l_gotham_ratio_progress_fp
+\fp_new:N \l_gotham_ratio_progresscircle_fp
+% the angle token by the counter radius
+\fp_new:N \l_gotham_angle_counterradius_fp
+% requires xfp for asind
+\fp_set:Nn \l_gotham_angle_counterradius_fp {
+ \fpeval{ 2* asind (\gothamCounterCircleRadius / (2*\gothamCounterRadius)) }
+}
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\gothamInstituteLogoCircle[#1]}
+% \begin{syntax}
+% \cs{gothamInstituteLogoCircle} \oarg{height (4ex)}
+% \end{syntax}
+% Command that have to be redefined in order to include your circular logo.
+% For example your can do |\renewcommand{\gothamInstituteLogoCircle}[1][4ex]{\includegraphics[height=#1]{gotham-logo.pdf}}|.
+% \end{function}
+% \end{documentation}
+%%%%%%
+% \begin{implementation}
+% \begin{function}{\gothamInstituteLogoCircle[#1]}
+% \begin{arguments}
+% \item |height| of the picture
+% \end{arguments}
+% Command to be redefined by users.
+% \TestFiles{ gotham-test-046b}
+% \begin{macrocode}
+\newcommand{\gothamInstituteLogoCircle}[1][4ex]{
+ \includegraphics[height=#1]{gotham-logo.pdf}
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{function}{\gothamProgressCircle}
+% Internal command plotting the circle progress and that is used internal in the instituteLogo template within the frametitle template.
+% \TestFiles{ gotham-test-046b}
+% \begin{macrocode}
+\newcommand{\gothamProgressCircle}{
+ % \tikzexternaldisable
+ \begin{tikzpicture}[remember~picture,overlay]
+ % Load colors
+ \usebeamercolor{standin}
+ \usebeamercolor{frametitle}
+ \usebeamercolor{progress~bar~in~head/foot}
+
+ % Define center
+ \coordinate (localCenter);
+ % draw the outer circle
+ \fill[fill=progress~bar~in~head/foot.bg] (localCenter) circle (\gothamProgressCircLogoOuterRadius);
+ % draw the inner circle
+ \fill[fill=frametitle.bg] (localCenter) circle (\gothamProgressCircLogoInnerRadius);
+ \node at (localCenter) {\gothamInstituteLogoCircle[1.9\gothamProgressCircLogoRadius]};
+
+ %% draw progress circle/bar
+ \bool_if:NTF \l_gotham_ProgCircleMoving_bool {
+ % the circular counter with a moving counter
+
+ %% compute the angle for the progress circle
+ \bool_if:NTF \l_gotham_progbar_advancement_tlbr_bool {
+ \fp_set:Nn \l_gotham_ratio_progresscircle_fp {-(360)*\insertframenumber/\inserttotalframenumber }
+ }{
+ %\else% clockwise rotation
+ \fp_set:Nn \l_gotham_ratio_progresscircle_fp {(360)*(\insertframenumber/\inserttotalframenumber)}
+ }
+ %\fi
+
+ % draw the arc progress bar
+ \draw[
+ color=progress~bar~in~head/foot.fg,
+ line~width=0.6*\gothamProgressCircBorderWidth
+ ]
+ (localCenter)
+ ++
+ ([
+ xshift=\gothamCounterRadius
+ ]localCenter)
+ arc[
+ radius=\gothamCounterRadius,
+ start~angle=0,
+ end~angle={\fp_eval:n \l_gotham_ratio_progresscircle_fp}
+ ]
+ ;
+
+ % draw a point at the beginning of the progress circle
+ \fill[fill=frametitle.bg]
+ ([
+ xshift={\gothamCounterRadius}
+ ]localCenter.center)
+ circle (0.3*\gothamProgressCircBorderWidth)
+ ;
+ % place the current frame number
+ \node[
+ % fill=standin.bg, draw=progress~bar~in~head/foot.bg, thick, circle, minimum~width={\gothamCounterCircleRadius}, text~width={0pt}
+ ]
+ (pagenumframe) at (
+ [rotate=
+ {\fp_eval:n {\l_gotham_ratio_progresscircle_fp}},
+ xshift=\gothamCounterRadius
+ ]localCenter) {}
+ ;
+ \filldraw[
+ draw=progress~bar~in~head/foot.bg,
+ fill=standin.bg,
+ thick,
+ ]
+ (pagenumframe) circle (\gothamCounterCircleRadius)
+ ;
+ % place the frame number in another node to avoid unwanted rescaling.
+ \node[at=(pagenumframe.center), anchor=center] {
+ {\usebeamercolor[fg]{standin}\tiny\insertframenumber}
+ };
+ }{
+ %\else gothamProgCircleMoving
+ % the circular counter with a fixed counter
+
+ %% compute the angle for the progress circle
+ \bool_if:NTF \l_gotham_progbar_advancement_tlbr_bool {
+ \fp_set:Nn \l_gotham_ratio_progresscircle_fp {-(360-2\l_gotham_angle_counterradius_fp)*\insertframenumber/\inserttotalframenumber -\l_gotham_angle_counterradius_fp}
+ }{
+ %\else% clockwise rotation
+ \fp_set:Nn \l_gotham_ratio_progresscircle_fp {(360-2\l_gotham_angle_counterradius_fp)*(\insertframenumber/\inserttotalframenumber) +\l_gotham_angle_counterradius_fp}
+ }
+ %\fi
+
+ % draw the arc progress bar
+ \draw[
+ color=progress~bar~in~head/foot.fg,
+ line~width=0.6*\gothamProgressCircBorderWidth
+ ]
+ (localCenter)
+ ++
+ ([rotate={\fp_eval:n {\l_gotham_angle_counterradius_fp}},
+ xshift=\gothamCounterRadius
+ ]localCenter)
+ arc[
+ radius=\gothamCounterRadius,
+ start~angle={\fp_eval:n \l_gotham_angle_counterradius_fp},
+ end~angle={\fp_eval:n \l_gotham_ratio_progresscircle_fp}
+ ]
+ ;
+
+ % draw a point at the end of the progress circle
+ \fill[fill=frametitle.bg]
+ ([
+ rotate={\fp_eval:n {\l_gotham_ratio_progresscircle_fp}}, xshift={\gothamCounterRadius}
+ ]localCenter.center)
+ circle (0.3*\gothamProgressCircBorderWidth)
+ ;
+ % place the total number of frames
+ \node[] (leftick)
+ at ([xshift={\gothamProgressCircLogoOuterRadius+1.25ex}]localCenter) {}
+ ;
+ %% draw a line ticks
+ \draw[
+ color=frametitle.fg,
+ fill=frametitle.fg,
+ ]
+ ([xshift=\gothamProgressCircLogoOuterRadius,yshift={-0.05ex}] localCenter)
+ rectangle ([yshift={0.05ex}] leftick)
+ ;
+ \node[ at=(leftick), anchor=west, inner~sep = 1pt,]
+ {\usebeamercolor[fg]{frametitle}\tiny\inserttotalframenumber}
+ ;
+ % place the current frame number
+ \node[
+ % fill=standin.bg, draw=progress~bar~in~head/foot.bg, thick, circle, minimum~width={\gothamCounterCircleRadius}, text~width={0pt}
+ ]
+ (pagenumframe) at ([xshift=\gothamCounterRadius]localCenter) {}
+ ;
+ \filldraw[
+ draw=progress~bar~in~head/foot.bg,
+ fill=standin.bg,
+ thick,
+ ]
+ (pagenumframe) circle (\gothamCounterCircleRadius)
+ ;
+ % place the frame number in another node to avoid unwanted rescaling.
+ \node[at=(pagenumframe.center), anchor=center] {
+ {\usebeamercolor[fg]{standin}\tiny\insertframenumber}
+ };
+ }
+ %\fi gothamProgCircleMoving
+ \end{tikzpicture}
+ \bool_if:NTF \l_gotham_ProgCircleMoving_bool {
+ % nothing
+ \hspace{\gothamProgressCircLogoOuterRadius+0.75ex}
+ }{
+ % else
+ % extra space to compensate the total number of frame
+ \hspace{\gothamProgressCircLogoOuterRadius+3ex}
+ }
+ % \tikzexternalenable
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\useoutertheme}
+% \begin{syntax}
+% \cs{useoutertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{progressbar~position} = \oarg{\defopt{foot} \textbar none \textbar head \textbar circlehead \textbar ... }
+% \end{syntax}
+% The 'package' (useoutertheme) options can control |progress bar| templates that be placed in the head (over the frametitle), frametitle (under it), below the footer or the circlehead (around the logo in the frametitle).
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{outer key -- interface}
+% Controls the outer settings for progress bar.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+% token list to remember what is the current state
+\tl_new:N \l__gotham_out_tmp_pbar_tl
+\keys_define:nn { gotham / outer }{
+ % progressbar~position default
+ progressbar~position .choice:,
+ progressbar~position .usage:n = { general },
+ progressbar~position .default:n = { none },
+
+ progressbar~position / none .code:n = {
+ % reset if it has modified by another progressbar~position strategy
+ % \__gotham_set_prop_template:nn{sidebar~canvas~right/default}{#1}
+ \tl_set:Nn \l__gotham_out_tmp_pbar_tl {none}
+
+ % head
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {head} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{headline}[default/\prop_item:Nn \l__gotham_template_name_prop {headline/default}]
+ }
+ % frametitle
+ % \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {frametitle} {
+ % % True: nothing to do it is already occupied.
+ % }{
+ \setbeamertemplate{frametitle}[default/\prop_item:Nn \l__gotham_template_name_prop {frametitle/default}]
+ % }
+ % foot
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {foot} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{footline}[default/\prop_item:Nn \l__gotham_template_name_prop {footline/default}]
+ }
+ % left
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {left} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~left}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~left/default}]
+ }
+ % right
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {right} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~right}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~right/default}]
+ }
+
+ % logo
+ \__gotham_set_prop_template:nn{includeLogo/default}{gotham~square}
+ % section in head
+ \setbeamertemplate{section~in~head/foot~shaded}[default/\prop_item:Nn \l__gotham_template_name_prop {section~in~head/foot~shaded/default}]
+ \setbeamertemplate{section~in~head/foot}[default/\prop_item:Nn \l__gotham_template_name_prop {section~in~head/foot/default}]
+ },
+ progressbar~position / head .code:n = {
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {head} {
+ % True: nothing to do it is already done.
+ } {
+ % False : remember that choice in order to do not apply it several time and add to beamer template.
+ \tl_set:Nn \l__gotham_out_tmp_pbar_tl {head}
+
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {head} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{headline}[default/\prop_item:Nn \l__gotham_template_name_prop {headline/default}]
+ }
+ % \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {frametitle} {
+ % % True: nothing to do it is already occupied.
+ % }{
+ \setbeamertemplate{frametitle}[default/\prop_item:Nn \l__gotham_template_name_prop {frametitle/default}]
+ % }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {foot} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{footline}[default/\prop_item:Nn \l__gotham_template_name_prop {footline/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {left} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~left}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~left/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {right} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~right}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~right/default}]
+ }
+
+ %
+ \addtobeamertemplate{headline}{}{
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {head} {
+ \usebeamertemplate*{progress~bar~in~head/foot}
+ }{}
+ }
+ }
+ },
+ progressbar~position / frametitle .code:n = {
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {frametitle} {
+ % True: nothing to do it is already done.
+ } {
+ % False : remember that choice in order to do not apply it several time and add to beamer template.
+ \tl_set:Nn \l__gotham_out_tmp_pbar_tl {frametitle}
+
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {head} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{headline}[default/\prop_item:Nn \l__gotham_template_name_prop {headline/default}]
+ }
+ % \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {frametitle} {
+ % % True: nothing to do it is already occupied.
+ % }{
+ \setbeamertemplate{frametitle}[default/\prop_item:Nn \l__gotham_template_name_prop {frametitle/default}]
+ % }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {foot} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{footline}[default/\prop_item:Nn \l__gotham_template_name_prop {footline/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {left} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~left}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~left/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {right} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~right}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~right/default}]
+ }
+
+ %
+ \addtobeamertemplate{frametitle}{}{
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {frametitle} {
+ \usebeamertemplate*{progress~bar~in~head/foot}
+ }{}
+ }
+ }
+ },
+ progressbar~position / foot .code:n = {
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {footline} {
+ % True: nothing to do it is already done.
+ } {
+ % False : remember that choice in order to do not apply it several time and add to beamer template.
+ \tl_set:Nn \l__gotham_out_tmp_pbar_tl {footline}
+
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {head} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{headline}[default/\prop_item:Nn \l__gotham_template_name_prop {headline/default}]
+ }
+ % \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {frametitle} {
+ % % True: nothing to do it is already occupied.
+ % }{
+ \setbeamertemplate{frametitle}[default/\prop_item:Nn \l__gotham_template_name_prop {frametitle/default}]
+ % }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {foot} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{footline}[default/\prop_item:Nn \l__gotham_template_name_prop {footline/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {left} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~left}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~left/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {right} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~right}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~right/default}]
+ }
+
+ %
+ \addtobeamertemplate{footline}{}{
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {footline} {
+ \usebeamertemplate*{progress~bar~in~head/foot}
+ }{}
+ }
+ }
+ },
+ progressbar~position / circlehead .code:n = {
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {circlehead} {
+ % True: nothing to do it is already done.
+ } {
+ % False : remember that choice in order to do not apply it several time and add to beamer template.
+ \tl_set:Nn \l__gotham_out_tmp_pbar_tl {circlehead}
+
+ %
+ %%%\prop_put:Nnn \l__gotham_template_name_SAVE_prop {includeLogo/default} {gotham~square} % not needed after all.
+ \__gotham_set_prop_template:nn{includeLogo/default}{gotham~circle}
+ \__gotham_set_template:nn{section~in~head/foot~shaded}{default/gotham~secSubsec}
+ \__gotham_set_template:nn{section~in~head/foot}{default/gotham~secSubsec}
+ % \__gotham_set_template:nn{headline}{default/gotham~section}
+ % \setbeamertemplate{headline}[default/gotham~section]
+
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {head} {
+ % True: it is already occupied, so let's emulate the gotham section
+ \addtobeamertemplate{headline}{}{
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {circlehead} {
+ \begin{beamercolorbox}[wd=1.0\paperwidth, ht=2.5ex, dp=1.4ex, left]{headfoot}
+ \usebeamerfont{section~in~head/foot}\hspace*{3.5ex}
+ \usebeamertemplate{section~in~head/foot}
+ \end{beamercolorbox}
+ }{}
+ }
+ }{
+ % \setbeamertemplate{headline}[default/\prop_item:Nn \l__gotham_template_name_prop {headline/default}]
+ \__gotham_set_template:nn{headline}{default/gotham~section}
+ }
+ % \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {frametitle} {
+ % % True: nothing to do it is already occupied.
+ % }{
+ \setbeamertemplate{frametitle}[default/\prop_item:Nn \l__gotham_template_name_prop {frametitle/default}]
+ % }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {foot} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{footline}[default/\prop_item:Nn \l__gotham_template_name_prop {footline/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {left} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~left}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~left/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {right} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~right}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~right/default}]
+ }
+ }
+ },
+ progressbar~position / left .code:n = {
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {left} {
+ % True: nothing to do it is already done.
+ } {
+ % False : remember that choice in order to do not apply it several time and add to beamer template.
+ \tl_set:Nn \l__gotham_out_tmp_pbar_tl {left}
+
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {head} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{headline}[default/\prop_item:Nn \l__gotham_template_name_prop {headline/default}]
+ }
+ % \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {frametitle} {
+ % % True: nothing to do it is already occupied.
+ % }{
+ \setbeamertemplate{frametitle}[default/\prop_item:Nn \l__gotham_template_name_prop {frametitle/default}]
+ % }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {foot} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{footline}[default/\prop_item:Nn \l__gotham_template_name_prop {footline/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {left} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~left}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~left/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {right} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~right}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~right/default}]
+ }
+
+ %
+ \addtobeamertemplate{sidebar~left}{}{
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {left} {
+ \usebeamertemplate*{progress~bar~in~left}
+ }{}
+ }
+ }
+ },
+ progressbar~position / right .code:n = {
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {right} {
+ % True: nothing to do it is already done.
+ } {
+ % False : remember that choice in order to do not apply it several time and add to beamer template.
+ \tl_set:Nn \l__gotham_out_tmp_pbar_tl {right}
+
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {head} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{headline}[default/\prop_item:Nn \l__gotham_template_name_prop {headline/default}]
+ }
+ % \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {frametitle} {
+ % % True: nothing to do it is already occupied.
+ % }{
+ \setbeamertemplate{frametitle}[default/\prop_item:Nn \l__gotham_template_name_prop {frametitle/default}]
+ % }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {foot} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{footline}[default/\prop_item:Nn \l__gotham_template_name_prop {footline/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {left} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~left}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~left/default}]
+ }
+ \tl_if_eq:VnTF \l__gotham_out_tmp_mfnposi_tl {right} {
+ % True: nothing to do it is already occupied.
+ }{
+ \setbeamertemplate{sidebar~right}[default/\prop_item:Nn \l__gotham_template_name_prop {sidebar~right/default}]
+ }
+
+ %
+ \addtobeamertemplate{sidebar~right}{}{
+ \tl_if_eq:VnTF \l__gotham_out_tmp_pbar_tl {right} {
+ \usebeamertemplate*{progress~bar~in~right}
+ }{}
+ }
+ }
+ },
+
+ progressbar~position / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'progressbar~position',~so~being~ignored. }{helping~message: progressbar~position / unknown} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\useoutertheme}
+% \begin{syntax}
+% \cs{useoutertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{progressbar style} = \oarg{\defopt{rectangle} \textbar rounded box \textbar moving circle \textbar fixed circle }
+% \end{syntax}
+% The 'package' (useoutertheme) options can control |progress bar style| templates that .
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{outer key -- interface}
+% Controls the outer settings for progress bar style.
+% \UnitTested
+% \TestFiles{gotham-test-049}
+% \begin{macrocode}
+% token list to remember what is the current state
+\keys_define:nn { gotham / outer }{
+ % progressbar~style default
+ progressbar~style .choice:,
+ progressbar~style .usage:n = { general },
+ progressbar~style .default:n = { rectangle },
+
+ progressbar~style / rectangle .code:n = {
+ %
+ % \defbeamertemplate*{progress~bar~in~head/foot}{gotham~rectangle}
+ \__gotham_set_template:nn{progress~bar~in~head/foot}{gotham~rectangle}
+ \__gotham_set_template:nn{progress~bar~in~left}{gotham~rectangle}
+ \__gotham_set_template:nn{progress~bar~in~right}{gotham~rectangle}
+ },
+
+ progressbar~style / rounded~box .code:n = {
+ %
+ \__gotham_set_template:nn{progress~bar~in~head/foot}{gotham~rounded~box}
+ \__gotham_set_template:nn{progress~bar~in~left}{gotham~rounded~box}
+ \__gotham_set_template:nn{progress~bar~in~right}{gotham~rounded~box}
+ },
+
+ progressbar~style / moving~circle .code:n = {
+ %
+ \bool_set_true:N \l_gotham_ProgCircleMoving_bool
+ },
+
+ progressbar~style / fixed~circle .code:n = {
+ %
+ \bool_set_false:N \l_gotham_ProgCircleMoving_bool
+ },
+
+ progressbar~style / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'progressbar~style',~so~being~ignored. }{helping~message: progressbar~style / unknown} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\useoutertheme}
+% \begin{syntax}
+% \cs{useoutertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{progressbar~advancement} = \oarg{\defopt{tlbr} \textbar brlt }
+% \end{syntax}
+% The 'package' (useoutertheme) options can control |progress bar| advandement: tlbr) from top left corner to the bottom and right or brlt) from the bottom right to the left and top.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{outer key -- interface}
+% Controls the outer settings for progress bar style.
+% \UnitTested
+% \TestFiles{gotham-test-049}
+% \begin{macrocode}
+% token list to remember what is the current state
+\keys_define:nn { gotham / outer }{
+ % progressbar~advancement default
+ progressbar~advancement .choice:,
+ progressbar~advancement .usage:n = { general },
+ progressbar~advancement .default:n = { tlbr },
+
+ progressbar~advancement / tlbr .code:n = {
+ %
+ \bool_set_true:N \l_gotham_progbar_advancement_tlbr_bool
+ },
+ progressbar~advancement / TLBR .code:n = {
+ %
+ \bool_set_true:N \l_gotham_progbar_advancement_tlbr_bool
+ },
+
+ progressbar~advancement / brlt .code:n = {
+ %
+ \bool_set_false:N \l_gotham_progbar_advancement_tlbr_bool
+ },
+ progressbar~advancement / BRLT .code:n = {
+ %
+ \bool_set_false:N \l_gotham_progbar_advancement_tlbr_bool
+ },
+
+ progressbar~advancement / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'progressbar~advancement',~so~being~ignored. }{helping~message: progressbar~advancement / unknown} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{documentation}
+% \begin{function}{\useoutertheme}
+% \begin{syntax}
+% \cs{useoutertheme}\oarg{option1=value1, ...}\marg{gotham}
+% \textrm{where the options are (default marked as} \defopt{default}\textrm{):}
+% \meta{progressbar mfn} = \oarg{\defopt{off} \textbar on }
+% \end{syntax}
+% The 'package' (useoutertheme) options can control if the progress bar includes a miniframe navigation.
+% \end{function}
+% \end{documentation}
+%%%%
+% \begin{implementation}
+% \begin{macro}{outer key -- interface}
+% Controls the outer settings for progress bar style.
+% \UnitTested
+% \TestFiles{gotham-test-049}
+% \begin{macrocode}
+% token list to remember what is the current state
+\keys_define:nn { gotham / outer }{
+ % progressbar~mfn default
+ progressbar~mfn .choice:,
+ progressbar~mfn .usage:n = { general },
+ progressbar~mfn .default:n = { off },
+
+ progressbar~mfn / true .code:n = {
+ \bool_set_true:N \l_gotham_pmfn_bool
+
+ \__gotham_set_template:nn{section~in~head/foot~shaded}{default/empty}
+ \__gotham_set_template:nn{section~in~head/foot}{default/empty}
+ \renewcommand{\gothamPatchSectionbox}{
+ % patch to set section box height to 0.
+ \ht\beamer@sectionbox=0.ex
+ \dp\beamer@sectionbox=0.ex
+ }
+ },
+ progressbar~mfn / on .code:n = {
+ \bool_set_true:N \l_gotham_pmfn_bool
+
+ \__gotham_set_template:nn{section~in~head/foot~shaded}{default/empty}
+ \__gotham_set_template:nn{section~in~head/foot}{default/empty}
+ \renewcommand{\gothamPatchSectionbox}{
+ % patch to set section box height to 0.
+ \ht\beamer@sectionbox=0.ex
+ \dp\beamer@sectionbox=0.ex
+ }
+ },
+ progressbar~mfn / enable .code:n = {
+ \bool_set_true:N \l_gotham_pmfn_bool
+
+ \__gotham_set_template:nn{section~in~head/foot~shaded}{default/empty}
+ \__gotham_set_template:nn{section~in~head/foot}{default/empty}
+ \renewcommand{\gothamPatchSectionbox}{
+ % patch to set section box height to 0.
+ \ht\beamer@sectionbox=0.ex
+ \dp\beamer@sectionbox=0.ex
+ }
+ },
+
+ progressbar~mfn / false .code:n = { \bool_set_false:N \l_gotham_pmfn_bool },
+ progressbar~mfn / off .code:n = { \bool_set_false:N \l_gotham_pmfn_bool },
+ progressbar~mfn / disable .code:n = { \bool_set_false:N \l_gotham_pmfn_bool },
+
+ progressbar~mfn / unknown .code:n = { \PackageWarning{ gotham } { The~choice~'#1'~is~unknown~for~the~(known)~option~'progressbar~mfn',~so~being~ignored. }{helping~message: progressbar~mfn / unknown} },
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% \begin{implementation}
+% \begin{macro}{Default outer keys}
+% Apply default key options.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+% when no value is given, default is called.
+\keys_set:nn { gotham / outer } {
+ sidebar~canvas~right~template, sidebar~canvas~left~template,
+ edging~default,
+ frametitle~template, framesubtitle~template, frametitle~continuation~template,
+ numbering,
+ rotateFooter~default,
+ footer~template,
+ mini~frames~shape, mini~frames~bundle,
+ mini~frames~compress,
+ mini~frames~nav~spreading,
+ mini~frames~nav~sectioning,
+ mini~frames~nav~position,
+ progressbar~position, progressbar~style, progressbar~advancement, progressbar~mfn,
+}
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+% \begin{implementation}
+% \begin{macro}{Process outer keys}
+% Process package options.
+% \UnitTested
+% \TestFiles{gotham-test-048}
+% \begin{macrocode}
+\ProcessKeyOptions[ gotham / outer ]
+% \mode<all>
+% \end{macrocode}
+% \end{macro}
+% \end{implementation}
+
+%
+%
+% \begin{implementation}
+% \begin{macrocode}
+%\endinput
+%</outer>
+% \end{macrocode}
+% \end{implementation}
+%
+% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+%
+%
+%\begin{implementation}
+% \begin{macrocode}
+%<*package>
+\RequirePackage{expl3}
+\RequirePackage{xparse}
+% \RequirePackage{ifxetex}
+% \RequirePackage{ifluatex}
+% \RequirePackage{etoolbox}
+% \RequirePackage{xcolor}
+% \RequirePackage{tikz}
+% \RequirePackage{calc} % I think I can remove it with a bit of work
+% \RequirePackage{xfp}
+% \end{macrocode}
+% \end{implementation}
+%
+% \begin{implementation}
+% \begin{macrocode}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%% PACKAGE %%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%
+%
+\providecommand\ifratio[3]{%
+ \ifnum#1=169%
+ \ifdim\beamer@paperwidth=16.00cm\relax%
+ \ifdim\beamer@paperheight=9.00cm\relax%
+ #2%
+ \else%
+ #3%
+ \fi%
+ \else%
+ #3%
+ \fi%
+ \else%
+ \ifnum#1=43%
+ \ifdim\beamer@paperwidth=12.80cm\relax%
+ \ifdim\beamer@paperheight=9.60cm\relax%
+ #2%
+ \else%
+ #3%
+ \fi%
+ \else%
+ #3%
+ \fi%
+ \fi%
+ \fi%
+}
+\providecommand\ifscreenratio[2]{%
+ \ifdim\beamer@paperwidth=16.00cm\relax%
+ \ifdim\beamer@paperheight=9.00cm\relax%
+ #1%
+ \fi%
+ \fi%
+ \ifdim\beamer@paperwidth=12.80cm\relax%
+ \ifdim\beamer@paperheight=9.60cm\relax%
+ #2%
+ \fi%
+ \fi%
+}
+% \end{macrocode}
+% \end{implementation}
+%
+% Most options are passed off to the component sub-packages.
+% \begin{implementation}
+% \begin{macrocode}
+
+%
+\usefonttheme{gotham}
+\usecolortheme{gotham}
+\useinnertheme{gotham}
+\useoutertheme{gotham}
+%
+%
+%
+
+%%%%% Setting keys %%%%%
+
+% set new counter for how many time the lookup is used
+\int_new:N \l_gotham_lookup_cnt
+\int_set:Nn \l_gotham_lookup_cnt {0}
+
+\seq_const_from_clist:Nn \c__gotham_load_submodules_seq { font, color, inner, outer }
+
+\cs_new_protected:Npn \__gotham_lookup_keymodules:nn #1#2
+{
+ \int_incr:N \l_gotham_lookup_cnt
+ % \int_show:n \l_gotham_lookup_cnt
+
+ % if lookup counter is lower than the number of submodules-1 [before it was +1, not completely clear to me], do nothing (let the other submodules do their job), otherwise lookup in the submodules
+ \if_int_compare:w \l_gotham_lookup_cnt < 2
+ %true : do nothing
+ \else:
+ % \int_show:n \l_gotham_lookup_cnt
+ \seq_map_inline:Nn \c__gotham_load_submodules_seq
+ {
+ \keys_if_exist:nnT { gotham / ##1 } {#1}
+ {
+ % missing feature in l3keys, we have no better way to detect an omitted value, so we have to guess that all empty values are in fact omitted values.
+ \tl_if_empty:nTF {#2}
+ { \keys_set:nn { gotham / ##1 } { #1 } }
+ { \keys_set:nn { gotham / ##1 } { #1 = {#2} } }
+ \prg_break:
+ }
+ }
+ \msg_error:nnn { gotham } { unknown-key } {#1}
+ \prg_break_point:
+ \fi:
+}
+\cs_generate_variant:Nn \__gotham_lookup_keymodules:nn { Vn }
+\msg_new:nnn { gotham } { unknown-key } { Unknown~ key~ #1~ encountered. }
+
+% Property list for all groups.
+\prop_new:N \l__gotham_all_all_user_keys_prop
+\prop_const_from_keyval:Nn \c__gotham_all_pkg_keys_prop {}
+
+\keys_define:nn { gotham / all / all }
+{
+ unknown .code:n =
+ {\__gotham_lookup_keymodules:Vn \l_keys_key_str {#1}}
+}
+
+% Set default keys/options from keyval
+% \__gotham_set_default_from_keyval: variant, keyval, group command
+\cs_new_protected:Npn \__gotham_set_default_from_keyval:nnn #1 #2 #3
+{ %%
+ % Check if keyvalues have been given.
+ \tl_if_novalue:nTF {#2}
+ { % no user keys given so _user_keys_prop is taking pkg prop
+ \prop_set_eq:cc { l__gotham_#3_#1_user_keys_prop } { c__gotham_#3_pkg_keys_prop }
+ }{ % user key given and put it in prop
+ \prop_put_from_keyval:cn { l__gotham_#3_#1_user_keys_prop } {#2}
+ }% end if
+ %
+ % xx
+ \__gotham_set_default_auxi:cnn { l__gotham_#3_#1_user_keys_prop } {#1} {#3}
+ %
+ % xx
+ \keys_set:nn { gotham/#3/#1 } { default }
+}
+%
+% prop-key-val, variant, group command
+\cs_new_protected:Npn \__gotham_set_default_auxi:Nnn #1 #2 #3
+{
+ \__gotham_set_default_auxii:fnn { \prop_to_keyval:N #1 } {#2} {#3}
+}
+\cs_generate_variant:Nn \__gotham_set_default_auxi:Nnn { c }
+%
+% key-val, variant, group command
+\cs_new_protected:Npn \__gotham_set_default_auxii:nnn #1 #2 #3
+{
+ \keys_define:nn { gotham/#3/#2 } { default .meta:n = {#1} }
+}
+\cs_generate_variant:Nn \__gotham_set_default_auxii:nnn { f }
+%
+%
+% (re)set keys/options by default for a group of commands.
+% \gothamset m:options:#1
+\DeclareDocumentCommand{\gothamset}{ m }
+{
+ \__gotham_set_default_from_keyval:nnn { all } {#1} { all }
+ \keys_set:nn { gotham/all/all } { default }
+}
+
+\def\gotham@plaintitleformat#1{#1}
+\newcommand{\mreducelistspacing}{\vspace{-\topsep}}
+
+\ProcessOptionsBeamer
+\keys_define:nn { gotham / font }
+{
+ unknown .code:n =
+ {\__gotham_lookup_keymodules:Vn \l_keys_key_str {#1}}
+}
+\keys_define:nn { gotham / color }
+{
+ unknown .code:n =
+ {\__gotham_lookup_keymodules:Vn \l_keys_key_str {#1}}
+}
+\keys_define:nn { gotham / inner }
+{
+ unknown .code:n =
+ {\__gotham_lookup_keymodules:Vn \l_keys_key_str {#1}}
+}
+\keys_define:nn { gotham / outer }
+{
+ unknown .code:n =
+ {\__gotham_lookup_keymodules:Vn \l_keys_key_str {#1}}
+}
+
+\ProcessKeyOptions[ gotham / font ]
+\ProcessKeyOptions[ gotham / color ]
+\ProcessKeyOptions[ gotham / inner ]
+\ProcessKeyOptions[ gotham / outer ]
+
+%
+% \end{macrocode}
+% \end{implementation}
+%
+% \begin{implementation}
+% \begin{macrocode}
+%\endinput
+%</package>
+% \end{macrocode}
+% \end{implementation}
+%
+%
+\endinput
+%
+% \Finale
diff --git a/Master/texmf-dist/source/latex/beamertheme-gotham/gotham.ins b/Master/texmf-dist/source/latex/beamertheme-gotham/gotham.ins
new file mode 100644
index 00000000000..6bccc22ba97
--- /dev/null
+++ b/Master/texmf-dist/source/latex/beamertheme-gotham/gotham.ins
@@ -0,0 +1,75 @@
+%%
+%% Copyright (C) 2008 by Romain NOËL <romainoel@free.fr>
+%%
+%% 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.
+%%
+
+\input docstrip.tex
+\keepsilent
+\askforoverwritefalse
+\preamble
+
+Copyright (C) 2023-20** by Romain NOËL <romainoel@free.fr>
+
+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 Romain NOËL.
+Contributors: Romain NOËL (2023-20**)
+
+\endpreamble
+
+\postamble
+
+Adapted from classic "A model .dtx file" by Joseph Wright
+https://www.texdev.net/2009/10/06/a-model-dtx-file/
+\endpostamble
+
+\usedir{tex/latex/gotham}
+\generate{
+ \file{beamerthemegotham.sty}{\from{gotham.dtx}{package}}%
+ \file{beamerfontthemegotham.sty}{\from{gotham.dtx}{font}}%
+ \file{beamercolorthemegotham.sty}{\from{gotham.dtx}{color}}%
+ \file{beamerinnerthemegotham.sty}{\from{gotham.dtx}{inner}}%
+ \file{beamerouterthemegotham.sty}{\from{gotham.dtx}{outer}}%
+ \nopreamble\nopostamble
+ \file{gotham-user-cmds.tex}{\from{gotham.dtx}{userCmd}}%
+ \file{gotham-dev-impl.tex}{\from{gotham.dtx}{devImpl}}%
+}
+
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* file into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* beamercolorthemegotham.sty *}
+\Msg{* beamerfontthemegotham.sty *}
+\Msg{* beamerinnerthemegotham.sty *}
+\Msg{* beamerouterthemegotham.sty *}
+\Msg{* beamerthemegotham.sty *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file gotham.dtx *}
+\Msg{* through LaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{*************************************************************}
+
+\endbatchfile \ No newline at end of file
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/biblatex-oxref/Makefile b/Master/texmf-dist/source/latex/biblatex-oxref/Makefile
index c51927feb8b..c3e48e3484c 100644
--- a/Master/texmf-dist/source/latex/biblatex-oxref/Makefile
+++ b/Master/texmf-dist/source/latex/biblatex-oxref/Makefile
@@ -3,8 +3,8 @@ PFX = biblatex-
STY1 = oxnotes
STYS = oxnotes oxyear oxnum oxalph
VARS = ibid note inote trad1 trad2 trad3
-LANGS = american british english spanish
-LANGX = spanish
+LANGS = american british english spanish polish
+LANGX = spanish polish
TESTS = $(STYS) $(foreach sty, $(STYS), $(LANGX:%=%-$(sty)))
AUX = aux,bbl,bcf,blg,doc,fdb_latexmk,fls,glo,gls,hd,idx,ilg,ind,listing,log,nav,out,run.xml,snm,synctex.gz,toc,vrb
SHELL = bash
diff --git a/Master/texmf-dist/source/latex/biblatex-oxref/oxref.dtx b/Master/texmf-dist/source/latex/biblatex-oxref/oxref.dtx
index 8c8c94d432f..18bf56b8985 100644
--- a/Master/texmf-dist/source/latex/biblatex-oxref/oxref.dtx
+++ b/Master/texmf-dist/source/latex/biblatex-oxref/oxref.dtx
@@ -1,6 +1,6 @@
% \iffalse
%<*internal|bbx|cbx|dbx|lbx|doc>
-\def\Version{2023/11/23 v3.2}
+\def\Version{2024/08/26 v3.3}
%</internal|bbx|cbx|dbx|lbx|doc>
%<*internal>
\iffalse
@@ -87,6 +87,10 @@
\ProvidesFile{spanish-oxref.lbx}
[\Version\space Spanish conventions required by the biblatex-oxref styles]
%</lbx&es>
+%<*lbx&pl>
+\ProvidesFile{polish-oxref.lbx}
+ [\Version\space Polish conventions required by the biblatex-oxref styles]
+%</lbx&pl>
%<*doc&n>
\ProvidesFile{oxnotes-doc.tex}
[\Version\space Footnote-based biblatex style inspired by the Oxford Guide to Style]
@@ -220,6 +224,7 @@ Copyright (C) 2016–2023 Alex Ball
\file{british-\jobname.lbx}{\from{\jobname.dtx}{lbx,gb}}
\file{english-\jobname.lbx}{\from{\jobname.dtx}{lbx,en}}
\file{spanish-\jobname.lbx}{\from{\jobname.dtx}{lbx,es}}
+ \file{polish-\jobname.lbx}{\from{\jobname.dtx}{lbx,pl}}
\file{oxnotes-doc.tex}{\from{\jobname.dtx}{doc,n}}
\file{oxnum-doc.tex}{\from{\jobname.dtx}{doc,m}}
\file{oxalph-doc.tex}{\from{\jobname.dtx}{doc,a}}
@@ -659,18 +664,24 @@ Copyright (C) 2016–2023 Alex Ball
\newcounter{elementcount}
\newcommand{\commaorandlist}[1]{%
+ % Counting up
\renewcommand*{\do}[1]{\stepcounter{elementcount}}%
\dolistloop{#1}%
\ifnumgreater{\value{elementcount}}{2}{%
- \def\finaland{, and }%
+ \def\thisfinaland{,\space and\space}%
}{%
- \def\finaland{ and }%
+ \def\thisfinaland{\space and\space}%
}%
+ % Counting back down
\renewcommand*{\do}[1]{%
- \ifnumequal{\value{elementcount}}{1}{%
- ##1%
+ \ifnumgreater{\value{elementcount}}{2}{% antipenultimate or earlier
+ ##1,\space
}{%
- \ifnumequal{\value{elementcount}}{2}{#1\finaland}{##1, }%
+ \ifnumequal{\value{elementcount}}{2}{% penultimate
+ ##1\thisfinaland
+ }{% last
+ ##1%
+ }%
}%
\addtocounter{elementcount}{-1}%
}%
@@ -678,6 +689,7 @@ Copyright (C) 2016–2023 Alex Ball
\author{Alex Ball}
\listadd\thetranslators{Bruno Maltras}
+\listadd\thetranslators{Sebastian Wasiuta}
\date{\printdateTeX{\filedate}}
\begin{document}
\thispagestyle{empty}
@@ -799,7 +811,7 @@ UNIX-like systems:
oxnotes-trad1.cbx, oxnotes-trad2.cbx, oxnotes-trad3.cbx, oxyear.cbx,
oxnum.cbx, oxalph.cbx
- american-oxref.lbx, british-oxref.lbx, english-oxref.lbx,
- spanish-oxref.lbx
+ spanish-oxref.lbx, polish.lbx
- oxnotes.dbx, oxnotes-ibid.dbx, oxnotes-note.dbx, oxnotes-inote.dbx,
oxnotes-trad1.dbx, oxnotes-trad2.dbx, oxnotes-trad3.dbx, oxyear.dbx,
oxnum.dbx, oxalph.dbx
@@ -842,7 +854,8 @@ first two steps.
american-oxref.lbx,
british-oxref.lbx,
english-oxref.lbx,
- spanish-oxref.lbx
+ spanish-oxref.lbx,
+ polish-oxref.lbx,
oxalph.bbx,
oxalph.cbx,
oxalph.dbx,
@@ -1663,9 +1676,12 @@ This can be set globally or on a per-type or per-entry basis.
\section{Works in foreign languages}
-If you used a foreign language work, you might want to recommend a good translation.
+If you used a work in a different language from the one in which you are currently writing,
+you might want to recommend a good translation into the latter language.
-\tip{Add the translation in \code{related}, and set \code{relatedtype} to \code{translationas}.}
+\tip{Add the translation in \code{related}, and set \code{relatedtype} to \code{translationas}.
+ The localized bibstring reflects the current localization language:
+ \enquote{English translation}, \enquote{traducido espa\~nol}, and so on.}
\begin{bibexbox}
%<n|m><NHR \S18.2.5*>
@@ -1691,7 +1707,8 @@ If you used a foreign language work, you might want to recommend a good translat
\end{Verbatim}
\end{bibexbox}
-\tip{To specify the translator up front, set the \code{relatedtype} to \code{bytranslator} instead.}
+\tip{To specify the translator up front, or to recommend a translation into a third language,
+ set the \code{relatedtype} to \code{bytranslator} instead.}
\begin{bibexbox}
%<n|m><NHR \S18.2.14>
@@ -7770,6 +7787,7 @@ rather than \pkg[biblatex]{oxref}.}
\newcommand*{\uscasetitlepunct}{\addcomma\space}
\renewcommand*{\relateddelim}{\addsemicolon\space}
\DeclareDelimFormat{revsdnamedelim}{\addcomma}
+\DeclareDelimFormat[pair]{revsdnamedelim}{}
\DeclareDelimFormat{authortypedelim}{\addspace}
\DeclareDelimFormat{editortypedelim}{\addspace}
\DeclareDelimFormat{translatortypedelim}{\addspace}
@@ -7846,7 +7864,7 @@ rather than \pkg[biblatex]{oxref}.}
and
test {\ifdefvoid{#2}}%
}{}{%
- \printdelim{revsdnamedelim}}%
+ \printdelim{revsdnamepunct}}%
\ifdefvoid{#5}{}{\iftoggle{blx@ox@nametitle}{\bibnamedelimd\mkbibnametitle{#5}\isdot}{}}%
\ifdefvoid{#2}{}{\bibnamedelimd\mkbibnamegiven{#2}\isdot}%
}{%
@@ -7861,7 +7879,7 @@ rather than \pkg[biblatex]{oxref}.}
and
test {\ifdefvoid{#3}}%
}{}{%
- \printdelim{revsdnamedelim}}%
+ \printdelim{revsdnamepunct}}%
\ifdefvoid{#5}{}{\iftoggle{blx@ox@nametitle}{\bibnamedelimd\mkbibnametitle{#5}\isdot}{}}%
\ifdefvoid{#2}{}{\bibnamedelimd\mkbibnamegiven{#2}\isdot}%
\ifdefvoid{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}}}
@@ -7871,9 +7889,22 @@ rather than \pkg[biblatex]{oxref}.}
% the bibliography, but in natural order in citations. We implement this, along
% with the case changing option, in the following name format. We also add a
% second hash for checking if names (e.g.\@ |author| and |authoraddon|) are the
-% same.
+% same. We only need |name:revsdelim| on the first item, and only if it will be
+% followed by something else.
%
% \begin{macrocode}
+\renewbibmacro*{name:revsdelim}{%
+ \ifboolexpr{
+ (
+ test {\ifnumequal{\value{liststop}}{1}}
+ and
+ test \ifmorenames
+ )
+ or
+ test {\ifnumequal{\value{liststop}}{2}}
+ }
+ {\printdelim{revsdnamedelim}}
+ {}}
\def\blx@ox@lasthash{}
\DeclareNameFormat{bib-family-given/cite-given-family}{%
\iffieldannotation{inferred}{\ifnumequal{\value{listcount}}{1}{\bibopenbracket}{}}{}%
@@ -7918,13 +7949,22 @@ rather than \pkg[biblatex]{oxref}.}
\renewcommand*{\mkbibnametitle}[1]{##1}%
}{}%
\ifboolexpe{%
- test {\ifnumgreater{\value{listcount}}{1}}
- or (
+ test {\ifnumequal{\value{listcount}}{\@ne}}
+ and
+ (
+ test {\ifnumless{\value{listcount}}{\value{liststop}}}
+ or
+ test {\ifnumgreater{\value{listtotal}}{\value{maxnames}}}
+ or
+ test {\ifandothers{\currentname}}
+ )
+ and not
+ (
test {\ifdefvoid\namepartgiven}
and
test {\ifdefvoid\namepartprefix}
)
- }{}{\usebibmacro{name:revsdelim}}%
+ }{\usebibmacro{name:revsdelim}}{}%
}{%
% \end{macrocode}
%
@@ -7967,6 +8007,10 @@ rather than \pkg[biblatex]{oxref}.}
\savefield{hash}{\blx@ox@lasthash}%
}%
\ifitemannotation{inferred}{\bibclosebracket}{}%
+ \ifitemannotation{variant}{%
+ \global\settoggle{blx@ox@variantname}{true}%
+ }{%
+ \global\settoggle{blx@ox@variantname}{false}}%
\usebibmacro{name:andothers}%
\iffieldannotation{inferred}{%
\ifboolexpr{
@@ -8012,7 +8056,9 @@ rather than \pkg[biblatex]{oxref}.}
\usebibmacro{name:andothers}}
% \end{macrocode}
%
-% We do likewise for the regular |family-given| format.
+% We do likewise for the regular |family-given| format. Also, we only want to
+% use the |name:revsdelim| on the last name in the list if it will be followed
+% by \enquote{et al.}.
%
% \begin{macrocode}
\DeclareNameFormat{family-given}{%
@@ -8035,13 +8081,20 @@ rather than \pkg[biblatex]{oxref}.}
}{%
\global\settoggle{blx@ox@variantname}{false}}%
\ifboolexpe{%
- test {\ifnumgreater{\value{listcount}}{1}}
- or (
+ (
+ test {\ifnumless{\value{listcount}}{\value{liststop}}}
+ or
+ test {\ifnumgreater{\value{listtotal}}{\value{maxnames}}}
+ or
+ test {\ifandothers{\currentname}}
+ )
+ and not
+ (
test {\ifdefvoid\namepartgiven}
and
test {\ifdefvoid\namepartprefix}
)
- }{}{\usebibmacro{name:revsdelim}}%
+ }{\usebibmacro{name:revsdelim}}{}%
\usebibmacro{name:andothers}}
% \end{macrocode}
%
@@ -8068,21 +8121,46 @@ rather than \pkg[biblatex]{oxref}.}
\DeclareFieldFormat{namevariant}{\mkbibparens{\bibstring{equals}\space #1}}
% \end{macrocode}
%
-% We provide an alternative method that uses new name fields |authoraddon| and
-% |editoraddon|. To do this, we define a bibmacro that reimplements the loopcode
-% logic of \cs{printnames}, but operates on two name lists simultaneously; we use
-% saveboxes to extract the hashes, and only print the alternative name if it has
-% a different hash. The same technique is used by \textsf{oxyear} below to pair
-% up names with the short form used in references, so this bibmacro is written
-% to handle both cases.
+% We have two use cases for a bibmacro that reimplements the loopcode logic of
+% \cs{printnames}, but operates on two name lists simultaneously. One is to
+% support the new name fields |authoraddon| and |editoraddon|; the other is to
+% pair up names with the short form used in references, as required by
+% \textsf{oxyear} below.
+%
+% We need to do this in a way that doesn't break the patterns used for
+% configuring and adapting the punctuation that delimits the list items, so the
+% |namepair:delim| macro does the same as |name:delim| but instead of reading
+% the current counters, takes two extra arguments (in addition to the current name):
+% the number of the current name pair and the total number of name pairs.
+% The regular |finallistdelim| delimiter format looks up the value of the
+% |liststop| counter, so we need to give it the right value.
+%
+% \begin{macrocode}
+\newbibmacro*{namepair:delim}[3]{%
+ \ifnumgreater{#2}{\@ne}{%
+ \ifnumless{#2}{#3}{%
+ \printdelim{multinamedelim}%
+ }{%
+ \ifnumgreater{#3}{\c@maxnames}{%
+ \c@liststop\c@minnames
+ }{%
+ \c@liststop#3}%
+ \lbx@finalnamedelim{#1}}%
+ }{}}
+% \end{macrocode}
%
% The |namepairs| bibmacro takes two arguments: the data fields holding the main
-% name and alternative name respectively.
+% name and alternative name respectively. When rendering the names, we use
+% saveboxes to extract the hashes, and only print the alternative name if it has
+% a different hash. In this case, we also switch to the \enquote{pair}
+% delimiter context, where the |revsdnamedelim| (if any) is suppressed.
%
% \begin{macrocode}
+\DeclareFieldFormat{expanded}{\mkbibparens{#1}}
\newcounter{namepairs}
\newsavebox{\blx@ox@namebox}
\newsavebox{\blx@ox@altnamebox}
+\newtoggle{blx@ox@thispairvariant}%
\newbibmacro*{namepairs}[2]{%
\setcounter{namepairs}{0}%
\savebibmacro{name:andothers}%
@@ -8106,21 +8184,19 @@ rather than \pkg[biblatex]{oxref}.}
)
}{%
\stepcounter{namepairs}%
- \ifnumgreater{\value{namepairs}}{1}{%
- \ifnumequal{\value{#1}}{2}{%
- \setunit*{\addspace\bibstring{and}\addspace}%
- }{%
- \ifnumequal{\value{namepairs}}{\value{#1}}{%
- \setunit*{\addcomma\space\bibstring{and}\addspace}%
- }{%
- \setunit*{\addcomma\space}%
- }%
- }%
- }{}%
\savebox{\blx@ox@namebox}{%
\printnames[#1][\value{namepairs}-\value{namepairs}]{#1}%
}%
\let\blx@ox@firsthash=\blx@ox@lasthash
+ \savebox{\blx@ox@altnamebox}{%
+ \printnames[#1][\value{namepairs}-\value{namepairs}]{#2}%
+ }%
+ \let\blx@ox@secondhash=\blx@ox@lasthash
+ \iftoggle{blx@ox@variantname}{%
+ \toggletrue{blx@ox@thispairvariant}%
+ }{%
+ \togglefalse{blx@ox@thispairvariant}%
+ }%
% \end{macrocode}
%
% This is the part intended for |authoraddon| and |editoraddon|. Note that it
@@ -8128,20 +8204,28 @@ rather than \pkg[biblatex]{oxref}.}
%
% \begin{macrocode}
\IfEndWith{#2}{addon}{%
- \savebox{\blx@ox@altnamebox}{%
- \printnames[by#1][\value{namepairs}-\value{namepairs}]{#2}%
- }%
- \let\blx@ox@secondhash=\blx@ox@lasthash
+ \usebibmacro{namepair:delim}%
+ {\unhbox\blx@ox@namebox}{\value{namepairs}}{\value{#1}}%
\ifdefstrequal{\blx@ox@firsthash}{\blx@ox@secondhash}{%
- \unhbox\blx@ox@namebox
+ \hbox{}\unhbox\blx@ox@namebox
}{%
- \unhbox\blx@ox@namebox\addspace
- \iftoggle{blx@ox@variantname}{%
+ \iftoggle{blx@ox@thispairvariant}{%
\ifbibliography{%
- \printtext[namevariant]{\printnames[#1][\value{namepairs}-\value{namepairs}]{#2}}%
- }{}%
+ \delimcontext{pair}%
+ \printnames[#1][\value{namepairs}-\value{namepairs}]{#1}%
+ \setunit{\addspace}%
+ \printtext[namevariant]{%
+ \printnames[#1][\value{namepairs}-\value{namepairs}]{#2}}%
+ }{%
+ \hbox{}\unhbox\blx@ox@namebox
+ }%
}{%
- \printtext[nameaddon]{\unhbox\blx@ox@altnamebox}%
+ \delimcontext{pair}%
+ \printnames[#1][\value{namepairs}-\value{namepairs}]{#1}%
+ \setunit{\addspace}%
+ \printtext[nameaddon]{%
+ \printnames[#1][\value{namepairs}-\value{namepairs}]{#2}%
+ }%
}%
}%
% \end{macrocode}
@@ -8152,15 +8236,19 @@ rather than \pkg[biblatex]{oxref}.}
%
% \begin{macrocode}
}{%
- \savebox{\blx@ox@altnamebox}{%
- \printnames[#1][\value{namepairs}-\value{namepairs}]{#2}%
- }%
- \let\blx@ox@secondhash=\blx@ox@lasthash
\ifdefstrequal{\blx@ox@firsthash}{\blx@ox@secondhash}{%
- \unhbox\blx@ox@namebox
+ \usebibmacro{namepair:delim}%
+ {\unhbox\blx@ox@namebox}{\value{namepairs}}{\value{#1}}%
+ \hbox{}\unhbox\blx@ox@namebox
}{%
- \unhbox\blx@ox@altnamebox
- \addspace\mkbibparens{\unhbox\blx@ox@namebox}%
+ \usebibmacro{namepair:delim}%
+ {\unhbox\blx@ox@altnamebox}{\value{namepairs}}{\value{#1}}%
+ \delimcontext{pair}%
+ \printnames[#1][\value{namepairs}-\value{namepairs}]{#2}%
+ \setunit{\addspace}%
+ \printtext[expanded]{%
+ \printnames[#1][\value{namepairs}-\value{namepairs}]{#1}%
+ }%
}%
}%
}%
@@ -8725,7 +8813,7 @@ rather than \pkg[biblatex]{oxref}.}
\DeclareFieldFormat{pages}{%
\iffieldundef{bookpagination}%
{\mkcomprange{#1}}%
- {\mkcomprange[{\mkpageprefix[bookpagination]}]{#1}}%
+ {\mkpageprefix[bookpagination][\mkcomprange]{#1}}%
}
% \end{macrocode}
%
@@ -8735,7 +8823,7 @@ rather than \pkg[biblatex]{oxref}.}
\DeclareFieldFormat{postnote}{%
\iffieldundef{pagination}%
{\mkcomprange{#1}}%
- {\mkcomprange[{\mkpageprefix}]{#1}}%
+ {\mkpageprefix[pagination][\mkcomprange]{#1}}%
}
% \end{macrocode}
@@ -9299,6 +9387,7 @@ rather than \pkg[biblatex]{oxref}.}
% considered on request.
%
% \begin{macrocode}
+\newcommand*{\mkvolroman}[1]{\Rn{#1}}
\DeclareFieldFormat[book,mvbook,bookinbook,inbook,suppbook,%
collection,mvcollection,incollection,suppcollection,%
proceedings,mvproceedings,inproceedings,%
@@ -9306,11 +9395,11 @@ reference,mvreference,inreference]{volume}{%
\IfSubStr{#1}{-}{%
\StrCount{#1}{-}[\blx@ox@dashnum]%
\StrBefore{#1}{-}[\blx@ox@volnum]%
- \expandafter\ifinteger\blx@ox@volnum{\Rn{\blx@ox@volnum}}{\blx@ox@volnum}\bibrangedash
+ \expandafter\ifinteger\blx@ox@volnum{\mkvolroman{\blx@ox@volnum}}{\blx@ox@volnum}\bibrangedash
\StrBehind[\blx@ox@dashnum]{#1}{-}[\blx@ox@volnum]%
- \expandafter\ifinteger\blx@ox@volnum{\Rn{\blx@ox@volnum}}{\blx@ox@volnum}%
+ \expandafter\ifinteger\blx@ox@volnum{\mkvolroman{\blx@ox@volnum}}{\blx@ox@volnum}%
}{%
- \ifinteger{#1}{\Rn{#1}}{#1}}}
+ \ifinteger{#1}{\mkvolroman{#1}}{#1}}}
% \end{macrocode}
%
% Where a multi-volume work is more like a series, the volume number and
@@ -9377,6 +9466,37 @@ reference,mvreference,inreference]{volume}{%
{Valid values are 'in' and 'out'.}}}}
% \end{macrocode}
%
+% If there are the same number of locations and publishers, and there are more
+% than one pair, we print them pairwaise rather than in two separate lists. In
+% order to do this while retaining the normal mechanisms for punctuating the
+% list, we need a |listpair:delim| macro similar to |namepair:delim| (above)
+% that uses the generic list punctuation. Again, the three arguments are the
+% item being printed, the number of the current item pair and the total number
+% of item pairs.
+%
+% \begin{macrocode}
+\newbibmacro*{listpair:delim}[3]{%
+ \ifnumgreater{#2}{\@ne}{%
+ \ifnumless{#2}{#3}{%
+ \printdelim{multilistdelim}%
+ }{%
+ \c@liststop#3%
+ \lbx@finallistdelim{#1}}%
+ }{}}
+% \end{macrocode}
+%
+% We use this as the basis of a list format that will be applied to the location
+% element of a location--publisher pair.
+%
+% \begin{macrocode}
+\newcounter{locpubpairs}
+\DeclareListFormat{locpub}{%
+ \usebibmacro{listpair:delim}%
+ {#1}{\value{locpubpairs}}{\value{location}}%
+ #1\isdot
+}
+% \end{macrocode}
+%
% When citing both the first and a later edition, the first one comes
% first, and the later one comes after a semicolon. As per standard
% \pkg{biblatex}, the elements of a single edition are separated by commas
@@ -9385,7 +9505,7 @@ reference,mvreference,inreference]{volume}{%
% origpublisher is also specified.
%
% \begin{macrocode}
-\newcounter{locpubpairs}
+\newsavebox{\blx@ox@locbox}
\newbibmacro*{edition+publisher+location+date}{%
\printlist{origlocation}%
\iflistundef{origpublisher}%
@@ -9406,10 +9526,11 @@ reference,mvreference,inreference]{volume}{%
\setunit*{\addcomma\space}%
% \end{macrocode}
%
-% If there are the same number of locations and publishers, and there
-% are more than one pair, we print them pairwaise rather than in two
+% As mentioned, if there are the same number of locations and publishers, and
+% there are more than one pair, we print them pairwaise rather than in two
% separate lists. This uses the same principle as the |namepairs| bibmacro,
-% but does not have the list truncation apparatus.
+% but does not have the list truncation apparatus. This time we use a savebox
+% just for efficiency.
%
% \begin{macrocode}
\ifboolexpr{%
@@ -9424,19 +9545,8 @@ reference,mvreference,inreference]{volume}{%
test {\ifnumcomp{\value{locpubpairs}}{<}{\value{publisher}}}
}{%
\stepcounter{locpubpairs}%
- \ifnumcomp{\value{locpubpairs}}{>}{1}{%
- \ifnumequal{\value{publisher}}{2}{%
- \setunit*{\addspace\bibstring{and}\addspace}%
- }{%
- \ifnumequal{\value{locpubpairs}}{\value{publisher}}{%
- \setunit*{\addcomma\space\bibstring{and}\addspace}%
- }{%
- \setunit*{\addcomma\space}%
- }%
- }%
- }{}%
- \printlist[][\value{locpubpairs}-\value{locpubpairs}]{location}%
- \setunit*{\addcolon\space}%
+ \printlist[locpub][\value{locpubpairs}-\value{locpubpairs}]{location}%
+ \setunit{\addcolon\space}%
\printlist[][\value{locpubpairs}-\value{locpubpairs}]{publisher}%
}%
\restorebibmacro{list:andothers}%
@@ -11383,7 +11493,11 @@ reference,mvreference,inreference]{volume}{%
\setcounter{blx@tmpcnt}{\value{listcount}}%
\addtocounter{blx@tmpcnt}{1}%
\ifnumequal{\value{blx@tmpcnt}}{\value{listtotal}}{%
- #1\space\bibstring{and}\addspace
+ \ifnumgreater{\value{listtotal}}{2}{%
+ #1\finalandcomma\space\bibstring{and}\addspace
+ }{%
+ #1\space\bibstring{and}\addspace
+ }
}{%
#1\addcomma\space}}}%
@@ -14256,11 +14370,6 @@ reference,mvreference,inreference]{volume}{%
% \code{authoraddon} has not been provided.
%
% \begin{macrocode}
-\xpatchbibmacro{namepairs}{%
- \printnames[by#1]%
-}{%
- \printnames[#1]%
-}{}{\wlog{WARNING: biblatex-oxref (oxyear) failed to patch namepairs}}
\xpatchbibmacro{author+altauthor}{%
\printnames{author}%
}{%
@@ -15085,7 +15194,7 @@ reference,mvreference,inreference]{volume}{%
\InheritBibliographyExtras{english}
\DeclareBibliographyExtras{%
\def\finalandcomma{\addcomma}%
- \def\blx@ox@langbibstring#1#2{#1\addspace\bibstring{#2}}%
+ \def\blx@ox@langbibstring#1#2{#1\setunit*{\addspace}\bibstring{#2}}%
}
\UndeclareBibliographyExtras{%
\def\blx@ox@langbibstring#1#2{\bibstring{#2}}%
@@ -15296,11 +15405,11 @@ reference,mvreference,inreference]{volume}{%
byreviser = {{revised by}{rev\adddot}},
byreviewer = {{reviewed by}{rev\adddot}},
bycollaborator = {{in collaboration with}{in collab\adddotspace with}},
- bytranslator = {{translated \lbx@lfromlang\ by}{trans\adddot\ \lbx@sfromlang}},
+ bytranslator = {{translated by}{trans\adddot}},
bycommentator = {{commented by}{comm\adddot}},
byannotator = {{annotated by}{annot\adddot}},
- byeditortr = {{edited and translated \lbx@lfromlang\ by}%
- {ed\adddotspace and trans\adddot\ \lbx@sfromlang}},
+ byeditortr = {{edited and translated by}%
+ {ed\adddotspace and trans\adddot}},
byeditorco = {{edited and commented by}%
{ed\adddotspace and comm\adddot}},
byeditoran = {{edited and annotated by}%
@@ -15311,16 +15420,16 @@ reference,mvreference,inreference]{volume}{%
{ed.\adddotspace with foreword}},
byeditoraf = {{edited, with an afterword, by}%
{ed.\adddotspace with afterword}},
- byeditortrco = {{edited, translated \lbx@lfromlang\finalandcomma\ and commented by}%
- {ed.,\addabbrvspace trans\adddot\ \lbx@sfromlang\finalandcomma\ and comm\adddot}},
- byeditortran = {{edited, translated \lbx@lfromlang\finalandcomma\ and annotated by}%
- {ed.,\addabbrvspace trans\adddot\ \lbx@sfromlang\finalandcomma\ and annot\adddot}},
- byeditortrin = {{edited and translated \lbx@lfromlang, with an introduction, by}%
- {with introduction, ed\adddotspace and trans\adddot\ \lbx@sfromlang}},
- byeditortrfo = {{edited and translated \lbx@lfromlang, with a foreword, by}%
- {with foreword, ed\adddotspace and trans\adddot\ \lbx@sfromlang}},
- byeditortraf = {{edited and translated \lbx@lfromlang, with an afterword, by}%
- {with afterword, ed\adddotspace and trans\adddot\ \lbx@sfromlang}},
+ byeditortrco = {{edited, translated\finalandcomma\ and commented by}%
+ {ed.,\addabbrvspace trans\adddot\finalandcomma\ and comm\adddot}},
+ byeditortran = {{edited, translated\finalandcomma\ and annotated by}%
+ {ed.,\addabbrvspace trans\adddot\finalandcomma\ and annot\adddot}},
+ byeditortrin = {{edited and translated, with an introduction, by}%
+ {with introduction, ed\adddotspace and trans\adddot}},
+ byeditortrfo = {{edited and translated, with a foreword, by}%
+ {with foreword, ed\adddotspace and trans\adddot}},
+ byeditortraf = {{edited and translated, with an afterword, by}%
+ {with afterword, ed\adddotspace and trans\adddot}},
byeditorcoin = {{edited and commented, with an introduction, by}%
{with introduction, ed\adddotspace and comm\adddot}},
byeditorcofo = {{edited and commented, with a foreword, by}%
@@ -15333,47 +15442,46 @@ reference,mvreference,inreference]{volume}{%
{with foreword, ed\adddotspace and annot\adddot}},
byeditoranaf = {{edited and annotated, with an afterword, by}%
{with afterword, ed\adddotspace and annot\adddot}},
- byeditortrcoin = {{edited, translated \lbx@lfromlang\finalandcomma\ and commented, with an introduction, by}%
- {with introduction, ed.,\addabbrvspace trans\adddot\ \lbx@sfromlang\finalandcomma\ and comm\adddot}},
- byeditortrcofo = {{edited, translated \lbx@lfromlang\finalandcomma\ and commented, with a foreword, by}%
- {with foreword, ed.,\addabbrvspace trans\adddot\ \lbx@sfromlang\finalandcomma\ and comm\adddot}},
- byeditortrcoaf = {{edited, translated \lbx@lfromlang\finalandcomma\ and commented, with an afterword, by}%
- {with afterword, ed.,\addabbrvspace trans\adddot\ \lbx@sfromlang\finalandcomma\ and comm\adddot}},
- byeditortranin = {{edited, translated \lbx@lfromlang\finalandcomma\ and annotated, with an introduction, by}%
- {with introduction, ed.,\addabbrvspace trans\adddot\ \lbx@sfromlang\finalandcomma\ and annot\adddot}},
- byeditortranfo = {{edited, translated \lbx@lfromlang\finalandcomma\ and annotated, with a foreword, by}%
- {with foreword, ed.,\addabbrvspace trans\adddot\ \lbx@sfromlang\finalandcomma\ and annot\adddot}},
- byeditortranaf = {{edited, translated \lbx@lfromlang\finalandcomma\ and annotated, with an afterword, by}%
- {with afterword, ed.,\addabbrvspace trans\adddot\ \lbx@sfromlang\finalandcomma\ and annot\adddot}},
- bytranslatorco = {{translated \lbx@lfromlang\ and commented by}%
- {trans\adddot\ \lbx@sfromlang\ and comm\adddot}},
- bytranslatoran = {{translated \lbx@lfromlang\ and annotated by}%
- {trans\adddot\ \lbx@sfromlang\ and annot\adddot}},
- bytranslatorin = {{translated \lbx@lfromlang, with an introduction, by}%
- {trans\adddot\ \lbx@sfromlang\ with introduction}},
- bytranslatorfo = {{translated \lbx@lfromlang, with a foreword, by}%
- {trans\adddot\ \lbx@sfromlang\ with foreword}},
- bytranslatoraf = {{translated \lbx@lfromlang, with an afterword, by}%
- {trans\adddot\ \lbx@sfromlang\ with afterword}},
- bytranslatorcoin = {{translated \lbx@lfromlang\ and commented, with an introduction, by}%
- {with introduction, trans\adddot\ \lbx@sfromlang\ and comm\adddot}},
- bytranslatorcofo = {{translated \lbx@lfromlang\ and commented, with a foreword, by}%
- {with foreword, trans\adddot\ \lbx@sfromlang\ and comm\adddot}},
- bytranslatorcoaf = {{translated \lbx@lfromlang\ and commented, with an afterword, by}%
- {with afterword, trans\adddot\ \lbx@sfromlang\ and comm\adddot}},
- bytranslatoranin = {{translated \lbx@lfromlang\ and annotated, with an introduction, by}%
- {with introduction, trans\adddot\ \lbx@sfromlang\ and annot\adddot}},
- bytranslatoranfo = {{translated \lbx@lfromlang\ and annotated, with a foreword, by}%
- {with foreword, trans\adddot\ \lbx@sfromlang\ and annot\adddot}},
- bytranslatoranaf = {{translated \lbx@lfromlang\ and annotated, with an afterword, by}%
- {with afterword, trans\adddot\ \lbx@sfromlang\ and annot\adddot}},
+ byeditortrcoin = {{edited, translated\finalandcomma\ and commented, with an introduction, by}%
+ {with introduction, ed.,\addabbrvspace trans\adddot\finalandcomma\ and comm\adddot}},
+ byeditortrcofo = {{edited, translated\finalandcomma\ and commented, with a foreword, by}%
+ {with foreword, ed.,\addabbrvspace trans\adddot\finalandcomma\ and comm\adddot}},
+ byeditortrcoaf = {{edited, translated\finalandcomma\ and commented, with an afterword, by}%
+ {with afterword, ed.,\addabbrvspace trans\adddot\finalandcomma\ and comm\adddot}},
+ byeditortranin = {{edited, translated\finalandcomma\ and annotated, with an introduction, by}%
+ {with introduction, ed.,\addabbrvspace trans\adddot\finalandcomma\ and annot\adddot}},
+ byeditortranfo = {{edited, translated\finalandcomma\ and annotated, with a foreword, by}%
+ {with foreword, ed.,\addabbrvspace trans\adddot\finalandcomma\ and annot\adddot}},
+ byeditortranaf = {{edited, translated\finalandcomma\ and annotated, with an afterword, by}%
+ {with afterword, ed.,\addabbrvspace trans\adddot\finalandcomma\ and annot\adddot}},
+ bytranslatorco = {{translated and commented by}%
+ {trans\adddotspace and comm\adddot}},
+ bytranslatoran = {{translated and annotated by}%
+ {trans\adddotspace and annot\adddot}},
+ bytranslatorin = {{translated, with an introduction, by}%
+ {trans\adddotspace with introduction}},
+ bytranslatorfo = {{translated, with a foreword, by}%
+ {trans\adddotspace with foreword}},
+ bytranslatoraf = {{translated, with an afterword, by}%
+ {trans\adddotspace with afterword}},
+ bytranslatorcoin = {{translated and commented, with an introduction, by}%
+ {with introduction, trans\adddotspace and comm\adddot}},
+ bytranslatorcofo = {{translated and commented, with a foreword, by}%
+ {with foreword, trans\adddotspace and comm\adddot}},
+ bytranslatorcoaf = {{translated and commented, with an afterword, by}%
+ {with afterword, trans\adddotspace and comm\adddot}},
+ bytranslatoranin = {{translated and annotated, with an introduction, by}%
+ {with introduction, trans\adddotspace and annot\adddot}},
+ bytranslatoranfo = {{translated and annotated, with a foreword, by}%
+ {with foreword, trans\adddotspace and annot\adddot}},
+ bytranslatoranaf = {{translated and annotated, with an afterword, by}%
+ {with afterword, trans\adddotspace and annot\adddot}},
% \end{macrocode}
%
% The roles expressed as objects and terms for supplementary material
% are not abbreviated.
%
% \begin{macrocode}
- withintroduction = {{with an introduction by}{with an introduction by}},
withcommentator = {{with a commentary by}{with a commentary by}},
withannotator = {{with annotations by}{with annotations by}},
withintroduction = {{with an introduction by}{with an introduction by}},
@@ -15428,8 +15536,10 @@ reference,mvreference,inreference]{volume}{%
% Languages are abbreviated.
%
% \begin{macrocode}
- langamerican = {{English}{Eng\adddot}},
- langbrazilian = {{Brazilian}{Braz\adddot}},
+ langamerican = {{American English}{Amer\adddotspace Eng\adddot}},
+ langbasque = {{Basque}{Basq\adddot}},
+ langbrazilian = {{Brazilian Portuguese}{Braz\adddotspace Port\adddot}},
+ langbulgarian = {{Bulgarian}{Bulg\adddot}},
langcatalan = {{Catalan}{Catal\adddot}},
langcroatian = {{Croatian}{Croat\adddot}},
langczech = {{Czech}{Czech}},
@@ -15439,17 +15549,28 @@ reference,mvreference,inreference]{volume}{%
langestonian = {{Estonian}{Eston\adddot}},
langfinnish = {{Finnish}{Finn\adddot}},
langfrench = {{French}{Fr\adddot}},
+ langgalician = {{Galician}{Galic\adddot}},
langgerman = {{German}{Ger\adddot}},
langgreek = {{Greek}{Gr\adddot}},
+ langhungarian = {{Hungarian}{Hung\adddot}},
langitalian = {{Italian}{It\adddot}},
+ langjapanese = {{Japanese}{Jap\adddot}},
langlatin = {{Latin}{Lat\adddot}},
+ langlatvian = {{Latvian}{Latv\adddot}},
+ langlithuanian = {{Lithuanian}{Lith\adddot}},
+ langmarathi = {{Marathi}{Mar\adddot}},
langnorwegian = {{Norwegian}{Norw\adddot}},
langpolish = {{Polish}{Pol\adddot}},
langportuguese = {{Portuguese}{Port\adddot}},
+ langromanian = {{Romanian}{Rom\adddot}},
langrussian = {{Russian}{Russ\adddot}},
+ langserbian = {{Serbian}{Serb\adddot}},
+ langslovak = {{Slovak}{Slovak}},
langslovene = {{Slovene}{Slov\adddot}},
langspanish = {{Spanish}{Sp\adddot}},
langswedish = {{Swedish}{Swed\adddot}},
+ langturkish = {{Turkish}{Turk\adddot}},
+ langukrainian = {{Ukrainian}{Ukr\adddot}},
}
% \end{macrocode}
%
@@ -15742,11 +15863,11 @@ reference,mvreference,inreference]{volume}{%
byfounder = {{fundado por}{fund\adddotspace}},
bycontinuator = {{continuado por}{cont\adddotspace}},
bycollaborator = {{colaboraci\'on de}{col\adddotspace de}},
- bytranslator = {{traducido \lbx@lfromlang\ por}{trad\adddotspace \lbx@sfromlang}},
+ bytranslator = {{traducido por}{trad\adddotspace}},
bycommentator = {{comentado por}{com\adddotspace}},
byannotator = {{anotado por}{anot\adddotspace}},
- byeditortr = {{editado y traducido \lbx@lfromlang\ por}%
- {ed\adddotspace y trad\adddotspace \lbx@sfromlang}},
+ byeditortr = {{editado y traducido por}%
+ {ed\adddotspace y trad\adddotspace}},
byeditorco = {{editado y comentado por}%
{ed\adddotspace y com\adddotspace }},
byeditoran = {{edici\'on y notas de}%
@@ -15757,16 +15878,16 @@ reference,mvreference,inreference]{volume}{%
{ed\adddotspace y pr\'ol\adddotspace}},
byeditoraf = {{edici\'on y ep\'ilogo de}%
{ed\adddotspace y ep\'il\adddotspace}},
- byeditortrco = {{editado, traducido \lbx@lfromlang\ y comentado por}%
- {ed.,\addabbrvspace trad\adddotspace \lbx@sfromlang\ y com\adddotspace}},
- byeditortran = {{edici\'on, traducci\'on \lbx@lfromlang\ y notas de}%
- {ed.,\addabbrvspace trad\adddotspace \lbx@sfromlang\ y not\adddotspace}},
- byeditortrin = {{edici\'on, traducci\'on \lbx@lfromlang\ e introducci\'on de}%
- {ed.,\addabbrvspace trad\adddotspace \lbx@sfromlang\ e intr\adddotspace}},
- byeditortrfo = {{edici\'on, traducci\'on \lbx@lfromlang\ y pr\'ologo de}%
- {ed.,\addabbrvspace trad\adddotspace \lbx@sfromlang\ y pr\'ol\adddotspace}},
- byeditortraf = {{editado, traducido \lbx@lfromlang\ y epilogado}%
- {ed.,\addabbrvspace trad\adddotspace \lbx@sfromlang\ y ep\'il\adddotspace}},
+ byeditortrco = {{editado, traducido y comentado por}%
+ {ed.,\addabbrvspace trad\adddotspace y com\adddotspace}},
+ byeditortran = {{edici\'on, traducci\'on y notas de}%
+ {ed.,\addabbrvspace trad\adddotspace y not\adddotspace}},
+ byeditortrin = {{edici\'on, traducci\'on e introducci\'on de}%
+ {ed.,\addabbrvspace trad\adddotspace e intr\adddotspace}},
+ byeditortrfo = {{edici\'on, traducci\'on y pr\'ologo de}%
+ {ed.,\addabbrvspace trad\adddotspace y pr\'ol\adddotspace}},
+ byeditortraf = {{editado, traducido y epilogado}%
+ {ed.,\addabbrvspace trad\adddotspace y ep\'il\adddotspace}},
byeditorcoin = {{editado, comentado e introducido}%
{ed.,\addabbrvspace com\adddotspace e intr\adddotspace}},
byeditorcofo = {{edici\'on, comentarios y pr\'ologo de}%
@@ -15779,40 +15900,40 @@ reference,mvreference,inreference]{volume}{%
{ed.,\addabbrvspace anot\adddotspace y pr\'ol\adddotspace}},
byeditoranaf = {{edici\'on, notas y ep\'ilogo de}%
{ed.,\addabbrvspace anot\adddotspace y ep\'il\adddotspace}},
- byeditortrcoin = {{edici\'on, traducci\'on \lbx@lfromlang, comentarios e introducci\'on de}%
- {ed.,\addabbrvspace trad\adddotspace \lbx@sfromlang, com\adddotspace e intr\adddotspace}},
- byeditortrcofo = {{edici\'on, traducci\'on \lbx@lfromlang, comentarios y pr\'ologo de}%
- {ed.,\addabbrvspace trad\adddotspace \lbx@sfromlang, com\adddotspace y pr\'ol\adddotspace}},
- byeditortrcoaf = {{edici\'on, traducci\'on \lbx@lfromlang, comentarios y ep\'ilogo de}%
- {ed.,\addabbrvspace trad\adddotspace \lbx@sfromlang, com\adddotspace y ep\'il\adddotspace}},
- byeditortranin = {{edici\'on, traducci\'on \lbx@lfromlang, notas e introducci\'on de}%
- {ed.,\addabbrvspace trad\adddotspace \lbx@sfromlang, anot\adddotspace e intr\adddotspace}},
- byeditortranfo = {{edici\'on, traducci\'on \lbx@lfromlang, notas y pr\'ologo de}%
- {ed.,\addabbrvspace trad\adddotspace \lbx@sfromlang, anot\adddotspace y pr\'ol\adddotspace}},
- byeditortranaf = {{edici\'on, traducci\'on \lbx@lfromlang, notas y ep\'ilogo de}%
- {ed.,\addabbrvspace trad\adddotspace \lbx@sfromlang, anot\adddotspace y ep\'il\adddotspace}},
- bytranslatorco = {{traducci\'on \lbx@lfromlang\ y comentarios de}%
- {trad\adddotspace \lbx@sfromlang\ y com\adddotspace}},
- bytranslatoran = {{traducci\'on \lbx@lfromlang\ y notas de}%
- {trad\adddotspace \lbx@sfromlang\ y not\adddotspace}},
- bytranslatorin = {{traducci\'on \lbx@lfromlang\ e introducci\'on de}%
- {trad\adddotspace \lbx@sfromlang\ e introd\adddotspace}},
- bytranslatorfo = {{traducci\'on \lbx@lfromlang\ y pr\'ologo de}%
- {trad\adddotspace \lbx@sfromlang\ y pr\'ol\adddotspace}},
- bytranslatoraf = {{traducci\'on \lbx@lfromlang\ y ep\'ilogo de}%
- {trad\adddotspace \lbx@sfromlang\ y ep\'il\adddotspace}},
- bytranslatorcoin = {{traducci\'on \lbx@lfromlang, comentarios e introducci\'on de}%
- {trad\adddotspace \lbx@sfromlang, com\adddotspace e intr\adddotspace}},
- bytranslatorcofo = {{traducci\'on \lbx@lfromlang, comentarios y pr\'ologo de}%
- {trad\adddotspace \lbx@sfromlang, com\adddotspace y pr\'ol\adddotspace}},
- bytranslatorcoaf = {{traducci\'on \lbx@lfromlang, comentarios y ep\'ilogo de}%
- {trad\adddotspace \lbx@sfromlang, com\adddotspace y ep\'il\adddotspace}},
- bytranslatoranin = {{traducci\'on \lbx@lfromlang, notas e introducci\'on de}%
- {trad\adddotspace \lbx@sfromlang, anot\adddotspace e intr\adddotspace}},
- bytranslatoranfo = {{traducci\'on \lbx@lfromlang, notas y pr\'ologo}%
- {trad\adddotspace \lbx@sfromlang, anot\adddotspace y pr\'ol\adddotspace}},
- bytranslatoranaf = {{traducci\'on \lbx@lfromlang, notas y ep\'ilogo}%
- {trad\adddotspace \lbx@sfromlang, anot\adddotspace y ep\'il\adddotspace}},
+ byeditortrcoin = {{edici\'on, traducci\'on, comentarios e introducci\'on de}%
+ {ed.,\addabbrvspace trad.,\addabbrvspace com\adddotspace e intr\adddotspace}},
+ byeditortrcofo = {{edici\'on, traducci\'on, comentarios y pr\'ologo de}%
+ {ed.,\addabbrvspace trad.,\addabbrvspace com\adddotspace y pr\'ol\adddotspace}},
+ byeditortrcoaf = {{edici\'on, traducci\'on, comentarios y ep\'ilogo de}%
+ {ed.,\addabbrvspace trad.,\addabbrvspace com\adddotspace y ep\'il\adddotspace}},
+ byeditortranin = {{edici\'on, traducci\'on, notas e introducci\'on de}%
+ {ed.,\addabbrvspace trad.,\addabbrvspace anot\adddotspace e intr\adddotspace}},
+ byeditortranfo = {{edici\'on, traducci\'on, notas y pr\'ologo de}%
+ {ed.,\addabbrvspace trad.,\addabbrvspace anot\adddotspace y pr\'ol\adddotspace}},
+ byeditortranaf = {{edici\'on, traducci\'on, notas y ep\'ilogo de}%
+ {ed.,\addabbrvspace trad.,\addabbrvspace anot\adddotspace y ep\'il\adddotspace}},
+ bytranslatorco = {{traducci\'on y comentarios de}%
+ {trad\adddotspace y com\adddotspace}},
+ bytranslatoran = {{traducci\'on y notas de}%
+ {trad\adddotspace y not\adddotspace}},
+ bytranslatorin = {{traducci\'on e introducci\'on de}%
+ {trad\adddotspace e introd\adddotspace}},
+ bytranslatorfo = {{traducci\'on y pr\'ologo de}%
+ {trad\adddotspace y pr\'ol\adddotspace}},
+ bytranslatoraf = {{traducci\'on y ep\'ilogo de}%
+ {trad\adddotspace y ep\'il\adddotspace}},
+ bytranslatorcoin = {{traducci\'on, comentarios e introducci\'on de}%
+ {trad.,\addabbrvspace com\adddotspace e intr\adddotspace}},
+ bytranslatorcofo = {{traducci\'on, comentarios y pr\'ologo de}%
+ {trad.,\addabbrvspace com\adddotspace y pr\'ol\adddotspace}},
+ bytranslatorcoaf = {{traducci\'on, comentarios y ep\'ilogo de}%
+ {trad.,\addabbrvspace com\adddotspace y ep\'il\adddotspace}},
+ bytranslatoranin = {{traducci\'on, notas e introducci\'on de}%
+ {trad.,\addabbrvspace anot\adddotspace e intr\adddotspace}},
+ bytranslatoranfo = {{traducci\'on, notas y pr\'ologo}%
+ {trad.,\addabbrvspace anot\adddotspace y pr\'ol\adddotspace}},
+ bytranslatoranaf = {{traducci\'on, notas y ep\'ilogo}%
+ {trad.,\addabbrvspace anot\adddotspace y ep\'il\adddotspace}},
% \end{macrocode}
%
% The roles expressed as objects and terms for supplementary material
@@ -15848,6 +15969,14 @@ reference,mvreference,inreference]{volume}{%
% for shorthands and \enquote{at} to cite a page within a range.
%
% \begin{macrocode}
+ idem = {{idem}{id\adddot}},
+ idemsm = {{idem}{id\adddot}},
+ idemsf = {{eadem}{ead\adddot}},
+ idemsn = {{idem}{id\adddot}},
+ idempm = {{eidem}{eid\adddot}},
+ idempf = {{eaedem}{eaed\adddot}},
+ idempn = {{eadem}{ead\adddot}},
+ idempp = {{eidem}{eid\adddot}},
citedas = {{en adelante}{en adelante}},
thiscite = {{en}{en}},
% \end{macrocode}
@@ -15855,50 +15984,510 @@ reference,mvreference,inreference]{volume}{%
% Languages are abbreviated.
%
% \begin{macrocode}
- langamerican = {{ingl\'es americano}{ing\adddotspace amer\adddotspace}},
- langbrazilian = {{brasile\~no}{por\adddotspace bras\adddotspace}},
- langbulgarian = {{b\'ulgaro}{bul\adddotspace}},
- langcatalan = {{catal\'an}{cat\adddotspace}},
- langcroatian = {{croata}{hrv\adddotspace}},
- langczech = {{checo}{ces\adddotspace}},
- langdanish = {{dan\'es}{dan\adddotspace}},
- langdutch = {{neerland\'es}{nld\adddotspace}},
- langenglish = {{ingl\'es}{ing\adddotspace}},
- langestonian = {{estonio}{est\adddotspace}},
- langfinnish = {{fin\'es}{fin\adddotspace}},
- langfrench = {{franc\'es}{fra\adddotspace}},
- langgalician = {{gallego}{glg\adddotspace}},
- langgerman = {{alem\'an}{ale\adddotspace}},
- langgreek = {{griego}{gr\adddotspace}},
- langhungarian = {{h\'ungaro}{hun\adddotspace}},
- langitalian = {{italiano}{ita\adddotspace}},
- langjapanese = {{japon\'es}{jap\adddotspace}},
- langlatin = {{lat\'in}{lat\adddotspace}},
- langlatvian = {{lituano}{lit\adddotspace}},
- langnorwegian = {{noruego}{nor\adddotspace}},
- langpolish = {{polaco}{pol\adddotspace}},
- langportuguese = {{portugu\'es}{port\adddotspace}},
- langrussian = {{ruso}{rus\adddotspace}},
- langserbian = {{serbio}{srp\adddotspace}},
- langslovak = {{eslovaco}{slk\adddotspace}},
- langslovene = {{esloveno}{slv\adddotspace}},
- langspanish = {{espa\~nol}{esp\adddotspace}},
+ langamerican = {{ingl\'es americano}{ing\adddotspace amer\adddot}},
+ langbasque = {{vasco}{vasc\adddot}},
+ langbrazilian = {{portugu\'es brasile\~no}{por\adddotspace bras\adddot}},
+ langbulgarian = {{b\'ulgaro}{bul\adddot}},
+ langcatalan = {{catal\'an}{cat\adddot}},
+ langcroatian = {{croata}{hrv\adddot}},
+ langczech = {{checo}{ces\adddot}},
+ langdanish = {{dan\'es}{dan\adddot}},
+ langdutch = {{neerland\'es}{nld\adddot}},
+ langenglish = {{ingl\'es}{ing\adddot}},
+ langestonian = {{estonio}{est\adddot}},
+ langfinnish = {{fin\'es}{fin\adddot}},
+ langfrench = {{franc\'es}{fra\adddot}},
+ langgalician = {{gallego}{glg\adddot}},
+ langgerman = {{alem\'an}{ale\adddot}},
+ langgreek = {{griego}{gr\adddot}},
+ langhungarian = {{h\'ungaro}{hun\adddot}},
+ langitalian = {{italiano}{ita\adddot}},
+ langjapanese = {{japon\'es}{jap\adddot}},
+ langlatin = {{lat\'in}{lat\adddot}},
+ langlatvian = {{let\'on}{let\adddot}},
+ langlithuanian = {{lituano}{lit\adddot}},
+ langmarathi = {{marathi}{mar\adddot}},
+ langnorwegian = {{noruego}{nor\adddot}},
+ langpolish = {{polaco}{pol\adddot}},
+ langportuguese = {{portugu\'es}{port\adddot}},
+ langrussian = {{ruso}{rus\adddot}},
+ langserbian = {{serbio}{srp\adddot}},
+ langslovak = {{eslovaco}{slk\adddot}},
+ langslovene = {{esloveno}{slv\adddot}},
+ langspanish = {{espa\~nol}{esp\adddot}},
langswedish = {{sueco}{sueco}},
- langukrainian = {{ucraniano}{ucr\adddotspace}},
+ langturkish = {{turco}{turco}},
+ langukrainian = {{ucraniano}{ucr\adddot}},
}
% \end{macrocode}
%
% \iffalse %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%</es>
+%<*pl>
+% \fi %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \section{Polish: polish-oxref.lbx}
+%
+% \setcounter{FancyVerbLine}{19}
+%
+% Thanks to Sebastian Wasiuta for contributing these translations and extras.
+%
+% We load the standard language-specific punctuation and date formatting.
+%
+% \begin{macrocode}
+\InheritBibliographyExtras{polish}
+% \end{macrocode}
+%
+% Here are some additional specific settings we need.
+%
+% There is no comma after forenames in the inverted position.
+%
+% \begin{macrocode}
+\DeclareBibliographyExtras{%
+ \DeclareDelimFormat{revsdnamedelim}{}%
+% \end{macrocode}
+%
+% We need to use the right case for month names in treaty execution dates.
+%
+% \begin{macrocode}
+ \savecommand\makebbx@dateii
+ \def\makebbx@dateii#1#2#3{%
+ \blx@imc@stripzeros{#3}~\lbx@pl@mkbibmonth{#2}%
+ \space
+ #1}%
+% \end{macrocode}
+%
+% Volume numbers are expressed in uppercase Roman numerals.
+%
+% \begin{macrocode}
+ \savecommand\mkvolroman
+ \renewcommand*{\mkvolroman}[1]{\RN{#1}}%
+% \end{macrocode}
+%
+% There is no compression of years.
+%
+% \begin{macrocode}
+ \savecommand\blx@ox@compyear
+ \renewcommand*{\blx@ox@compyear}[2]{#2}%
+% \end{macrocode}
+%
+% There is no compression of pagination ranges.
+%
+% \begin{macrocode}
+ \savefieldformat{pages}%
+ \DeclareFieldFormat{pages}{%
+ \iffieldundef{bookpagination}%
+ {\mknormrange{#1}}%
+ {\mkpageprefix[bookpagination][\mknormrange]{#1}}%
+ }%
+ \savefieldformat{postnote}%
+ \DeclareFieldFormat{postnote}{%
+ \iffieldundef{pagination}%
+ {\mknormrange{#1}}%
+ {\mkpageprefix[pagination][\mknormrange]{#1}}%
+ }%
+% \end{macrocode}
+%
+% We flip the word order when specifying the edition.
+%
+% \begin{macrocode}
+ \savefieldformat{edition}%
+ \DeclareFieldFormat{edition}{%
+ \ifinteger{#1}
+ {\bibstring{edition}~\mkbibordedition{#1}}
+ {\ifbibstring{#1}{\bibstring{#1}}{#1\isdot}}}%
+}
+% \end{macrocode}
+%
+% Lastly we add code to undo these changes before switching to another language.
+%
+% \begin{macrocode}
+\UndeclareBibliographyExtras{%
+ \DeclareDelimFormat{revsdnamedelim}{\addcomma}%
+ \restorecommand\makebbx@dateii
+ \restorecommand\mkvolroman
+ \restorecommand\blx@ox@compyear
+ \restorefieldformat{pages}%
+ \restorefieldformat{postnote}%
+ \restorefieldformat{edition}%
+}
+% \end{macrocode}
+%
+% We load the standard set of localization strings, then add our
+% adjustments.
+%
+% \begin{macrocode}
+\DeclareBibliographyStrings{%
+ inherit = {polish},
+% \end{macrocode}
+%
+% These are new strings defined by \pkg[biblatex]{oxref}:
+%
+% \begin{itemize}
+% \item Roles expressed as functions
+% \end{itemize}
+%
+% \begin{macrocode}
+ director = {{re\.{z}yser}{re\.{z}\adddot}},
+ directors = {{re\.{z}yserzy}{re\.{z}\adddot}},
+ performer = {{wykonawca}{wyk\adddot}},
+ performers = {{wykonawcy}{wyk\adddot}},
+ reader = {{czytelnik}{czytelnik}},
+ readers = {{czytelnicy}{czytelnicy}},
+ conductor = {{dyrygent}{dyr\adddot}},
+ conductors = {{dyrygenci}{dyr\adddot}},
+ serieseditor = {{redaktor serii}{red\adddotspace serii}},
+ serieseditors = {{redaktor serii}{red\adddotspace serii}},
+ holder = {{w\l a\'{s}ciciel}{w\l a\'{s}ciciel}},
+ holders = {{w\l a\'{s}ciciele}{w\l a\'{s}ciciele}},
+ editorcm = {{redaktor i~kompilator}{red\adddotspace i~kompilator}},
+ editorcms = {{redaktorzy i~kompilatorzy}{red\adddotspace i~kompilatorzy}},
+% \end{macrocode}
+%
+% \begin{itemize}
+% \item Roles expressed as actions
+% \end{itemize}
+%
+% \begin{macrocode}
+ byperformer = {{wykonawca}{wyk\adddot}},
+ bydirector = {{re\.{z}yseria}{re\.{z}\adddot}},
+ byreader = {{czyta}{czyta}},
+ byconductor = {{kieruje}{kier\adddot}},
+ byserieseditor = {{redakcja}{red\adddot}},
+ byholder = {{w~posiadaniu}{w~posiadaniu}},
+ byeditorcm = {{redakcja i~opracowanie}{red\adddotspace i~oprac\adddot}},
+% \end{macrocode}
+%
+% \begin{itemize}
+% \item Publication details
+% \end{itemize}
+%
+% \begin{macrocode}
+ facsimile = {{wydanie faksymile}{wyd\adddotspace faksymile}},
+ revised = {{wydanie poprawione}{wyd\adddotspace popr\adddot}},
+ revisedenlarged = {{wydanie poprawione i~rozszerzone}{wyd\adddotspace popr\addotspace i~rozszerz\adddot}},
+ revisedreprint = {{przedruk poprawiony}{przedr\adddotspace popr\adddot}},
+ suppto = {{dodatek do}{dod\adddotspace do}},
+ equals = {{=}{=}},
+ original = {{oryginalny}{oryg\adddot}},
+ amendedby = {{zmienione przez}{zmien\adddotspace przez}},
+% \end{macrocode}
+%
+% \begin{itemize}
+% \item Publication state
+% \end{itemize}
+%
+% \begin{macrocode}
+ inpressin = {{z\l o\.{z}one do}{z\l o\.{z}one do}},
+% \end{macrocode}
+%
+% \begin{itemize}
+% \item Pagination
+% \end{itemize}
+%
+% \begin{macrocode}
+ book = {{ksi\k{e}ga}{ks\adddot}},
+ books = {{ksi\k{e}gi}{ks\adddot}},
+ canto = {{pie\'{s}\'{n}}{pie\'{s}\'{n}}},
+ cantos = {{pie\'{s}ni}{pie\'{s}ni}},
+ stanza = {{zwrotka}{zwr\adddot}},
+ stanzas = {{zwrotki}{zwr\adddot}},
+ act = {{akt}{a\adddot}},
+ acts = {{akty}{aa\adddot}},
+ scene = {{scena}{sc\adddot}},
+ scenes = {{sceny}{sc\adddot}},
+ folio = {{karta}{k\adddot}},
+ folios = {{karty}{kk\adddot}},
+ article = {{artyku\l }{art\adddot}},
+ articles = {{artyku\l y}{art\adddot}},
+ clause = {{klauzula}{klauz\adddot}},
+ clauses = {{klauzule}{klauz\adddot}},
+ regulation = {{rozporz\k{a}dzenie}{rozp\adddot}},
+ regulations = {{rozporz\k{a}dzenia}{rozp\adddot}},
+ rule = {{przepis}{przep\adddot}},
+ rules = {{przepisy}{przep\adddot}},
+ booktotal = {{ksi\k{e}ga}{ks\adddot}},
+ booktotals = {{ksi\k{e}gi}{ks\adddot}},
+ cantototal = {{pie\'{s}\'{n}}{pie\'{s}\'{n}}},
+ cantototals = {{pie\'{s}ni}{pie\'{s}ni}},
+ stanzatotal = {{zwrotka}{zwr\adddot}},
+ stanzatotals = {{zwrotki}{zwr\adddot}},
+ acttotal = {{akt}{a\adddot}},
+ acttotals = {{akty}{aa\adddot}},
+ scenetotal = {{scena}{sc\adddot}},
+ scenetotals = {{sceny}{sc\adddot}},
+ foliototal = {{karta}{k\adddot}},
+ foliototals = {{karty}{kk\adddot}},
+ articletotal = {{artyku\l }{art\adddot}},
+ articletotals = {{artyku\l y}{art\adddot}},
+ clausetotal = {{klauzula}{klauz\adddot}},
+ clausetotals = {{klauzule}{klauz\adddot}},
+ regulationtotal = {{rozporz\k{a}dzenie}{rozp\adddot}},
+ regulationtotals = {{rozporz\k{a}dzenia}{rozp\adddot}},
+ ruletotal = {{przepis}{przep\adddot}},
+ ruletotals = {{przepisy}{przep\adddot}},
+% \end{macrocode}
+%
+% \begin{itemize}
+% \item Types
+% \end{itemize}
+%
+% \begin{macrocode}
+ facebook = {{wpis na Facebooku}{wpis na Facebooku}},
+ tweet = {{wpis na Twitterze}{wpis na Twitterze}},
+ podcast = {{podcast}{podcast}},
+ clip = {{wideo}{wideo}},
+ webcast = {{webcast}{webcast}},
+ poster = {{plakat}{plakat}},
+% \end{macrocode}
+%
+% \begin{itemize}
+% \item Miscellaneous
+% \end{itemize}
+%
+% \begin{macrocode}
+ nolocation = {{bez miejsca}{b\adddot m\adddot}},
+ modified = {{ostatnio zmodyfikowany}{ostatnio zmodyf\adddot}},
+ recorded = {{nagrane}{nagr\adddot}},
+ uploaded = {{za\l adowane}{za\l ad\adddot}},
+ filed = {{wniesione}{wniesione}},
+ issued = {{wydany}{wyd\adddot}},
+% \end{macrocode}
+%
+% \begin{itemize}
+% \item Labels
+% \end{itemize}
+%
+% \begin{macrocode}
+ anon = {{Anonim}{Anon\adddot}},
+ pseudo = {{Pseudo-}{Ps\adddot-}},
+ urldown = {{pobrane}{pobrane}},
+% \end{macrocode}
+%
+% \begin{itemize}
+% \item Country names, patents, and patent requests,
+% \end{itemize}
+%
+% \begin{macrocode}
+ countryjp = {{Japonia}{JP}},
+ patentjp = {{japo\'{n}ski patent}{jap\adddotspace pat\adddot}},
+ patreqjp = {{japo\'{n}ski wniosek patentowy}{jap\adddotspace wniosek pat\adddot}},
+% \end{macrocode}
+%
+% \begin{itemize}
+% \item These are borrowed from other styles.
+% \end{itemize}
+%
+% \begin{macrocode}
+ 1column = {{jedna kolumna}{1\addnbspace kol\adddot}},
+ 2column = {{dwie kolumny}{2\addnbspace kol\adddot}},
+ inflayer = {{warstwa ni\.{z}sza}{warstwa ni\.{z}sza}},
+ suplayer = {{warstwa wy\.{z}sza}{warstwa wy\.{z}sza}},
+ paper = {{gazeta}{gazeta}},
+ papyrus = {{papirus}{papirus}},
+ parchment = {{pergamin}{pergamin}},
+ eucase = {{sprawa}{sprawa}},
+ eujoinedcases = {{po\l \k{a}czone sprawy}{po\l \k{a}czone sprawy}},
+ commissiondecision = {{decyzja komisji}{decyzja komisji}},
+ application = {{wniosek}{wniosek}},
+ order = {{polecenie}{polecenie}},
+ bill = {{rachunek}{rachunek}},
+ draft = {{projekt}{proj\adddot}},
+ opened = {{przed\l o\.{z}one do podpisu}{przed\l\adddotspace do podp\adddot}},
+ signed = {{podpisane}{podpisane}},
+ adopted = {{przyj\k{e}te}{przyj\k{e}te}},
+ inforce = {{wesz\l o w~\.{z}ycie}{wesz\l o w~\.{z}ycie}},
+% \end{macrocode}
+%
+% The rest of these strings are overrides for the standard ones.
+%
+% \begin{macrocode}
+ byeditor = {{redakcja}{red\adddot}},
+ bycompiler = {{opracowanie}{oprac\adddot}},
+ byfounder = {{za\l o\.{z}one przez}{za\l o\.{z}\adddotspace przez}},
+ bycontinuator = {{kontynuowane przez}{kont\adddotspace przez}},
+ byredactor = {{redakcja}{red\adddot}},
+ byreviser = {{poprawki}{popr\adddot}},
+ byreviewer = {{recenzja}{rec\adddot}},
+ bycollaborator = {{we wsp\'{o}\l pracy z}{we wsp\'{o}\l pr\adddotspace z}},
+ bytranslator = {{t\l umaczenie}{t\l um\adddot}},
+ bycommentator = {{komentarz}{kom\adddot}},
+ byannotator = {{obja\'{s}nienia}{obja\'{s}n\adddot}},
+ byeditortr = {{redakcja i~t\l umaczenie}%
+ {red\adddotspace i~t\l um\adddot}},
+ byeditorco = {{redakcja i~komentarz}%
+ {red\adddotspace i~kom\adddot}},
+ byeditoran = {{redakcja i~obja\'{s}nienia}%
+ {red\adddotspace i~obja\'{s}n\adddot}},
+ byeditorin = {{redakcja i~wst\k{e}p}%
+ {red\adddotspace i~wst\k{e}p}},
+ byeditorfo = {{redakcja i~przedmowa}%
+ {red\adddotspace i~przedm\adddot}},
+ byeditoraf = {{redakcja i~pos\l owie}%
+ {red\adddotspace i~pos\l \adddot}},
+ byeditortrco = {{redakcja, t\l umaczenie i~komentarz}%
+ {red.,\addabbrvspace t\l um.,\addabbrvspace kom\adddot}},
+ byeditortran = {{redakcja, t\l umaczenie i~obja\'{s}nienia}%
+ {red.,\addabbrvspace t\l um.,\addabbrvspace obja\'{s}n\adddot}},
+ byeditortrin = {{redakcja, t\l umaczenie, wst\k{e}p}%
+ {red.,\addabbrvspace t\l um.,\addabbrvspace wst\k{e}p}},
+ byeditortrfo = {{redakcja, t\l umaczenie, przedmowa}%
+ {red.,\addabbrvspace t\l um.,\addabbrvspace przedm\adddot}},
+ byeditortraf = {{redakcja, t\l umaczenie, pos\l \adddot}%
+ {red.,\addabbrvspace t\l um.,\addabbrvspace pos\l \adddot}},
+ byeditorcoin = {{redakcja, komentarz, wst\k{e}p}%
+ {red.,\addabbrvspace kom.,\addabbrvspace wst\k{e}p}},
+ byeditorcofo = {{redakcja, komentarz i~przedmowa}%
+ {red.,\addabbrvspace kom.,\addabbrvspace przedm\adddot}},
+ byeditorcoaf = {{redakcja, komentarz, pos\l owie}%
+ {red.,\addabbrvspace kom.,\addabbrvspace pos\l \adddot}},
+ byeditoranin = {{redakcja, obja\'{s}nienia, wst\k{e}p}%
+ {red.,\addabbrvspace obja\'{s}n.,\addabbrvspace wst\k{e}p}},
+ byeditoranfo = {{redakcja, obja\'{s}nienia, przedmowa}%
+ {red.,\addabbrvspace obja\'{s}n.,\addabbrvspace przedm\adddot}},
+ byeditoranaf = {{redakcja, obja\'{s}nienia, pos\l owie}%
+ {red.,\addabbrvspace obja\'{s}n.,\addabbrvspace pos\l \adddot}},
+ byeditortrcoin = {{redakcja, t\l umaczenie, komentarz, wst\k{e}p}%
+ {red.,\addabbrvspace t\l um.,\addabbrvspace kom.,\addabbrvspace wst\k{e}p}},
+ byeditortrcofo = {{redakcja, t\l umaczenie, komentarz, przedmowa}%
+ {red.,\addabbrvspace t\l um.,\addabbrvspace kom.,\addabbrvspace przedm\adddot}},
+ byeditortrcoaf = {{redakcja, t\l umaczenie, komentarz, pos\l owie}%
+ {red.,\addabbrvspace t\l um.,\addabbrvspace kom.,\addabbrvspace pos\l \adddot}},
+ byeditortranin = {{redakcja, t\l umaczenie, obja\'{s}nienia, wst\k{e}p}%
+ {red.,\addabbrvspace t\l um.,\addabbrvspace obja\'{s}n.,\addabbrvspace wst\k{e}p}},
+ byeditortranfo = {{redakcja, t\l umaczenie, obja\'{s}nienia, przedmowa}%
+ {red.,\addabbrvspace t\l um.,\addabbrvspace obja\'{s}n.,\addabbrvspace przedm\adddot}},
+ byeditortranaf = {{redakcja, t\l umaczenie, obja\'{s}nienia, pos\l owie}%
+ {red.,\addabbrvspace t\l um.,\addabbrvspace obja\'{s}n.,\addabbrvspace pos\l \adddot}},
+ bytranslatorco = {{t\l umaczenie i~komentarz}%
+ {t\l um\adddotspace i~kom\adddot}},
+ bytranslatoran = {{t\l umaczenie i~obja\'{s}nienia}%
+ {t\l um\adddotspace i~obja\'{s}n\adddot}},
+ bytranslatorin = {{t\l umaczenie i~wst\k{e}p}%
+ {t\l um.,\addabbrvspace wst\k{e}p}},
+ bytranslatorfo = {{t\l umaczenie i~przedmowa}%
+ {t\l um.,\addabbrvspace przedm\adddot}},
+ bytranslatoraf = {{t\l umaczenie i~pos\l owie}%
+ {t\l um.,\addabbrvspace pos\l \adddot}},
+ bytranslatorcoin = {{t\l umaczenie, komentarz i~wst\k{e}p}%
+ {t\l um.,\addabbrvspace kom.,\addabbrvspace wst\k{e}p}},
+ bytranslatorcofo = {{t\l umaczenie, komentarz i~przedmowa}%
+ {t\l um.,\addabbrvspace kom.,\addabbrvspace przedm\adddot}},
+ bytranslatorcoaf = {{t\l umaczenie, komentarz i~pos\l owie}%
+ {t\l um.,\addabbrvspace kom.,\addabbrvspace pos\l \adddot}},
+ bytranslatoranin = {{t\l umaczenie, obja\'{s}nienia i~wst\k{e}p}%
+ {t\l um.,\addabbrvspace obja\'{s}n.,\addabbrvspace wst\k{e}p}},
+ bytranslatoranfo = {{t\l umaczenie, obja\'{s}nienia i~przedmowa}%
+ {t\l um.,\addabbrvspace obja\'{s}n.,\addabbrvspace przedm\adddot}},
+ bytranslatoranaf = {{t\l umaczenie, obja\'{s}nienia i~pos\l owie}%
+ {t\l um.,\addabbrvspace obja\'{s}n.,\addabbrvspace pos\l \adddot}},
+% \end{macrocode}
+%
+% The roles expressed as objects and terms for supplementary material
+% are not abbreviated.
+%
+% \begin{macrocode}
+ withcommentator = {{komentarz}{komentarz}},
+ withannotator = {{obja\'{s}nienia}{obja\'{s}nienia}},
+ withintroduction = {{wst\k{e}p}{wst\k{e}p}},
+ withforeword = {{przedmowa}{przedmowa}},
+ withafterword = {{pos\l owie}{pos\l owie}},
+ introduction = {{wst\k{e}p}{wst\k{e}p}},
+% \end{macrocode}
+%
+% The translations and abbreviations for some publication details are different.
+%
+% \begin{macrocode}
+ newseries = {{nowa seria}{nowa seria}},
+ oldseries = {{dawna seria}{dawna seria}},
+ edition = {{wydanie}{wyd\adddot}},
+ reviewof = {{recenzja}{rec\adddot}},
+ reprintfrom = {{przedruk z}{przedr\adddotspace z}},
+ translationas = {{t\l umaczenie polskie}{t\l um\adddotspace pol\adddotspace}},
+ origpubin = {{pierwodruk w}{pierwodr\adddotspace w}},
+% \end{macrocode}
+%
+% We use a different translation for \enquote{paragraph}.
+%
+% \begin{macrocode}
+ paragraph = {{ust\k{e}p}{ust\adddot}},
+ paragraphs = {{ust\k{e}py}{ust\adddot}},
+% \end{macrocode}
+%
+% \emph{New Hart's Rules} uses \enquote{accessed} for URL dates.
+%
+% \begin{macrocode}
+ urlseen = {{dost\k{e}p}{dost\k{e}p}},
+% \end{macrocode}
+%
+% Scholarly citation terms are abbreviated. Oxford style is to use \enquote{henceforth}
+% for shorthands and \enquote{at} to cite a page within a range.
+%
+% \begin{macrocode}
+ idem = {{idem}{id\adddot}},
+ idemsm = {{idem}{id\adddot}},
+ idemsf = {{eadem}{ead\adddot}},
+ idemsn = {{idem}{id\adddot}},
+ idempm = {{eidem}{eid\adddot}},
+ idempf = {{eaedem}{eaed\adddot}},
+ idempn = {{eadem}{ead\adddot}},
+ idempp = {{eidem}{eid\adddot}},
+ citedas = {{dalej}{dalej}},
+ thiscite = {{na}{na}},
+% \end{macrocode}
+%
+% Languages are abbreviated.
+%
+% \begin{macrocode}
+ langamerican = {{ameryka\'{n}ski angielski}{amer\adddotspace ang\adddot}},
+ langbasque = {{baskijski}{bask\adddot}},
+ langbrazilian = {{brazylijski portugalski}{braz\adddot port\adddot}},
+ langbulgarian = {{bu\l garski}{bu\l g\adddot}},
+ langcatalan = {{katalo\'{n}ski}{katal\adddot}},
+ langcroatian = {{chorwacki}{chorw\adddot}},
+ langczech = {{czeski}{czeski}},
+ langdanish = {{du\'{n}ski}{du\'{n}\adddot}},
+ langdutch = {{holenderski}{holend\adddot}},
+ langenglish = {{angielski}{ang\adddot}},
+ langestonian = {{esto\'{n}ski}{est\adddot}},
+ langfinnish = {{fi\'{n}ski}{fi\'{n}\adddot}},
+ langfrench = {{francuski}{fr\adddot}},
+ langgalician = {{galicyjski}{galic\adddot}},
+ langgerman = {{niemiecki}{niem\adddot}},
+ langgreek = {{grecki}{gr\adddot}},
+ langhungarian = {{w\k{e}gierski}{w\k{e}g\adddot}},
+ langitalian = {{w\l oski}{w\l \adddot}},
+ langjapanese = {{japo\'{n}ski}{jap\adddot}},
+ langlatin = {{\l aci\'{n}ski}{\l ac\adddot}},
+ langlatvian = {{\l otewski}{\l ot\adddot}},
+ langlithuanian = {{litewski}{lit\adddot}},
+ langmarathi = {{marathi}{mar\adddot}},
+ langnorwegian = {{norweski}{norw\adddot}},
+ langpolish = {{polski}{pol\adddot}},
+ langportuguese = {{portugalski}{port\adddot}},
+ langromanian = {{rumu\'{n}ski}{rum\adddot}},
+ langrussian = {{rosyjski}{ros\adddot}},
+ langserbian = {{serbski}{serb\adddot}},
+ langslovak = {{s\l owacki}{s\l c\adddot}},
+ langslovene = {{s\l owe\'{n}ski}{s\l owe\'{n}\adddot}},
+ langspanish = {{hiszpa\'{n}ski}{hiszp\adddot}},
+ langswedish = {{szwedzki}{szw\adddot}},
+ langturkish = {{turecki}{tur\adddot}},
+ langukrainian = {{ukrai\'{n}ski}{ukr\adddot}},
+}
+% \end{macrocode}
+%
+% \iffalse %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%</pl>
% \fi %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \section{Other languages}
%
-% Currently \pkg[biblatex]{oxref} only supports English (British and American)
-% and Spanish explicitly, but if there is demand more languages may be added. If
-% you would like to contribute support for your language, a list of the
-% non-standard bibliography strings requiring definition may be found in
-% section~\ref{sec:setup}.
+% Currently \pkg[biblatex]{oxref} only supports English (British and American),
+% Spanish, and Polish explicitly,
+% but if there is demand more languages may be added. If you would like to
+% contribute support for your language, a list of the non-standard bibliography
+% strings requiring definition may be found in section~\ref{sec:setup}.
%
% \iffalse %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%</lbx>
diff --git a/Master/texmf-dist/source/latex/biblatex-oxref/oxref.ins b/Master/texmf-dist/source/latex/biblatex-oxref/oxref.ins
index 4f699685dd6..c3b536e4445 100644
--- a/Master/texmf-dist/source/latex/biblatex-oxref/oxref.ins
+++ b/Master/texmf-dist/source/latex/biblatex-oxref/oxref.ins
@@ -77,6 +77,7 @@ Copyright (C) 2016–2023 Alex Ball
\file{british-\jobname.lbx}{\from{\jobname.dtx}{lbx,gb}}
\file{english-\jobname.lbx}{\from{\jobname.dtx}{lbx,en}}
\file{spanish-\jobname.lbx}{\from{\jobname.dtx}{lbx,es}}
+ \file{polish-\jobname.lbx}{\from{\jobname.dtx}{lbx,pl}}
\file{oxnotes-doc.tex}{\from{\jobname.dtx}{doc,n}}
\file{oxnum-doc.tex}{\from{\jobname.dtx}{doc,m}}
\file{oxalph-doc.tex}{\from{\jobname.dtx}{doc,a}}
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/cs-techrep/cs-techrep.dtx b/Master/texmf-dist/source/latex/cs-techrep/cs-techrep.dtx
index 35775ca1075..ccc3475664d 100644
--- a/Master/texmf-dist/source/latex/cs-techrep/cs-techrep.dtx
+++ b/Master/texmf-dist/source/latex/cs-techrep/cs-techrep.dtx
@@ -1,16 +1,16 @@
%\iffalse
% cs-techrep.dtx generated using makedtx version 1.2 (c) Nicola Talbot
% Command line args:
-% -preamble "Copyright 2023-2024 Christoph P. Neumann 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 any later version. The latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2008 or later. This work has the LPPL maintenance status maintained. The Current Maintainer of this work is Christoph P. Neumann. "
-% -setambles ".*=>\nopreamble"
-% -author "Christoph P. Neumann "
-% -dir "src"
-% -src "(_cpn_copyIntoExamplesFolder_cls.cmd|cs-techrep.cls)=>\1"
% -doc "doc/cs-techrep.tex"
+% -author "Christoph P. Neumann "
+% -setambles ".*=>\nopreamble"
% -date "2023-2024"
+% -dir "src"
% -macrocode ".*"
+% -preamble "Copyright 2023-2024 Christoph P. Neumann 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 any later version. The latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2008 or later. This work has the LPPL maintenance status maintained. The Current Maintainer of this work is Christoph P. Neumann. "
+% -src "(_cpn_copyIntoExamplesFolder_cls.cmd|cs-techrep.cls)=>\1"
% cs-techrep
-% Created on 2024/4/10 18:14
+% Created on 2024/9/14 21:40
%\fi
%\iffalse
%<*package>
@@ -56,7 +56,7 @@
%\title{\textsf{cs-techrep}\\
%Technical Reports in Computer Science and Software Engineering}
%\author{Christoph P.\ Neumann \texttt{$<$cyberpetaneuron@gmail.com$>$}}
-%\date{Version 0.2}
+%\date{Version 0.4}
%\maketitle
%\PrintChanges
%
@@ -117,14 +117,33 @@
%This package provides the documentclass \texttt{cs-techrep}. The documentclass
%supports the following options:
%
-%
%\begin{itemize}
%\item |conference| Passed to IEEEtran
%\item |a4paper| Passed to IEEEtran
-%\item |flushend| Activate flushend package
-%\item |pbalance| Activate pbalance package
+%\item |subfig| Loads subfig package with custom style settings
+%\item |subcaption| Loads subcaption package with custom style settings
+%\item |flushend| Activate flushend package (compatible with arXiv build process)
+%\item |pbalance| Activate pbalance package (incompatible with arXiv build process)
%\end{itemize}
%
+%A Remark about two-column document balancing on the last page:
+%The flushend package is recommended, because it works within the arXiv automated build process.
+%However, flushend has a major incampatibility with package lineno, which is, e.\,g., transitively loaded by package mindflow.
+%Thus, in case when flushend does not have any effect, check whether one of your packages loads lineno.
+%Usually you are stuck with your packages and, thus, will instead be forced to switch from flushend to pbalance.
+%Please be aware that pbalance works great and has high compatibility, but unfortunately it will not have any effect within the arXiv automated build process.
+%In case of both, a somehow needed lineno package and an intended arXiv upload, I recommend to do without two-column balancing on the last page and just to stay away from both flushend and pbalance, in order to ensure that your paper is layouted identically in any initial publication and a later arXiv upload.
+%I hope this remark proves helpful, it took me some nerve to find out.
+%
+%There is also another important difference between flushend and pbalance: the handling of footnotes on the last page.
+%Flushend provides a decent result, but the result of pbalance is incomprehensible.
+%I strongly recommend avoiding footnotes on the last page.
+%If you absolutely need footnotes on the last page, consider staying away from two-column balancing on the last page.
+%
+%About subfigures:
+%Both well-known packages subfig and subcaption can be used.
+%However, they are not compatible with each other and we can either load one or the other.
+%The document class provides options to load them for you with some customized style settings.
%
%\section{Requirements}
%
@@ -142,6 +161,7 @@
%\item cleveref
%\item csquotes
%\item diagbox
+%\item doclicense
%\item etoolbox
%\item extdash
%\item flushend
@@ -164,6 +184,7 @@
%\item pdflscape
%\item siunitx
%\item stfloats
+%\item subcaption
%\item subfig
%\item tcolorbox
%\item times
@@ -222,13 +243,25 @@ pause% \end{macrocode}
\NeedsTeXFormat{LaTeX2e}
% Provide the name of your document class, the date it was last updated, and a comment about what it's used for
-\ProvidesClass{cs-techrep}[2024/04/10 Technical Reports in Computer Science and Software Engineering v0.2]
+\ProvidesClass{cs-techrep}[2024/09/16 Technical Reports in Computer Science and Software Engineering v0.4]
% Define marker counter for options (counter are global in latex):
+\newcounter{cstechrep@subfigtracker}
+\newcounter{cstechrep@subcaptiontracker}
\newcounter{cstechrep@pbalancetracker}
\newcounter{cstechrep@flushendtracker}
% Declare options:
+
+\DeclareOption{subfig}{
+ \setcounter{cstechrep@subfigtracker}{1}
+ \typeout{cs-techrep class: subfig option is set (use subfloat command).}
+}
+\DeclareOption{subcaption}{
+ \setcounter{cstechrep@subcaptiontracker}{1}
+ \typeout{cs-techrep class: subcaption option is set (use subfigure command).}
+}
+
\DeclareOption{onecolumn}{\OptionNotUsed} % IEEE option onecolumn will be ignored
\DeclareOption{pbalance}{
@@ -268,7 +301,7 @@ pause% \end{macrocode}
\DefcstechrepVar{Department} % e.g., Department of Electrical Engineering, Media and Computer Science
\DefcstechrepVar{Institution} % e.g., Ostbayerische Technische Hochschule Amberg-Weiden
\DefcstechrepVar{Address} % e.g., Amberg, Germany
-\DefcstechrepVar{Series} % e.g., Technical Reports
+\DefcstechrepVar{Type} % e.g., Technical Report
\DefcstechrepVar{Year} % e.g., 2023
\DefcstechrepVar{Title}
\DefcstechrepVar{Month} % e.g., 6 (for June)
@@ -355,7 +388,7 @@ pause% \end{macrocode}
\RequirePackage[cmyk, table]{xcolor}
-\RequirePackage[nolist]{acronym}
+\RequirePackage[nolist,smaller]{acronym}
% Code Listings
\RequirePackage{listings}
@@ -456,7 +489,7 @@ pause% \end{macrocode}
\RequirePackage{booktabs}
% Extended enumerate, such as \begin{compactenum}
-\RequirePackage{paralist}
+\RequirePackage[alwaysadjust]{paralist}
% Read: Is there a disadvantage to using natbib=true with biblatex?
% https://tex.stackexchange.com/questions/149313/is-there-a-disadvantage-to-using-natbib-true-with-biblatex
@@ -490,6 +523,7 @@ pause% \end{macrocode}
autolang=other
]{biblatex}
+% Due to applied option defernumbers=true:
% Prevent citations in the references are being numbered as '0' in ArXiv
% https://tex.stackexchange.com/questions/463556/all-the-citations-in-the-references-are-being-numbered-as-0-in-arxiv-while-upl
\makeatletter
@@ -636,9 +670,9 @@ pause% \end{macrocode}
\RequirePackage{pdflscape}
\RequirePackage{afterpage}
-% Allows to hyphenate a word that contains a dash:
-% https://stackoverflow.com/questions/2193307/how-do-i-get-latex-to-hyphenate-a-word-that-contains-a-dash
-\RequirePackage[shortcuts]{extdash} % Use \-/ for a breakable dash that does not prevent the remainer of the word to be hyphenated
+% requires, e.g., \PassOptionsToPackage{
+% type=CC,modifier=by,version=4.0}{doclicense} before \documentclass
+\RequirePackage[hyperxmp=false,lang=English]{doclicense}
% Improve wrapping of URLs - hint by http://tex.stackexchange.com/a/10419/9075
\makeatletter
@@ -651,7 +685,9 @@ pause% \end{macrocode}
\begin{minipage}{0.8\textwidth}
\centering
% Creative Commons / Open Access:
- \href{https://creativecommons.org/licenses/by/4.0/}{\ccby{} This work is licensed under a Creative Commons Attribution 4.0 International (CC BY 4.0) License.}
+ %\href{https://creativecommons.org/licenses/by/4.0/}{\ccby{} This work is %licensed under a Creative Commons Attribution 4.0 International (CC BY 4.0) %License.}
+ % License based on doclicense package:
+ \href{\doclicenseURL}{\doclicenseIcon{} This work is licensed under a \doclicenseLongNameRef{} (\doclicenseNameRef{}) license.}
% Citation advice:
\\Please cite as: \fullcite{selfref}.
\end{minipage}
@@ -683,7 +719,18 @@ pause% \end{macrocode}
\cstechrepAddress
}}
-\IEEEspecialpapernotice{\cstechrepSeries: \cstechrepNumber, \citemonth{selfref} \cstechrepYear}
+\IEEEspecialpapernotice{\cstechrepType: \cstechrepNumber, \citemonth{selfref} \cstechrepYear}
+
+% subfigure captions with parentheses and footnotesize:
+\ifnum\value{cstechrep@subfigtracker}=1
+ \typeout{cs-techrep class: load subfig package (use subfloat command).}
+ \RequirePackage[caption=false,font=footnotesize]{subfig}
+\fi
+\ifnum\value{cstechrep@subcaptiontracker}=1
+ \typeout{cs-techrep class: load subcaption package (use subfigure command).}
+ \RequirePackage{subcaption}
+ \captionsetup[subfigure]{labelformat=parens,font=footnotesize}
+\fi
% Balance/level columns at the last page / in bibliography
% DISCLAIMER: No solution is a 100%/perfect one!
@@ -699,6 +746,14 @@ pause% \end{macrocode}
\RequirePackage{flushend}
\fi
+% ========================================================
+% Packages that need to be loaded last:
+
+% Allows to hyphenate a word that contains a dash:
+% https://stackoverflow.com/questions/2193307/how-do-i-get-latex-to-hyphenate-a-word-that-contains-a-dash
+\RequirePackage[shortcuts]{extdash} % Use \-/ for a breakable dash that does not prevent the remainer of the word to be hyphenated
+% ========================================================
+
% Finally, we'll use \endinput to indicate that LaTeX can stop reading this file. LaTeX will ignore anything after this line.
\endinput
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/cs-techrep/cs-techrep.ins b/Master/texmf-dist/source/latex/cs-techrep/cs-techrep.ins
index 0fc58684641..51ed4016002 100644
--- a/Master/texmf-dist/source/latex/cs-techrep/cs-techrep.ins
+++ b/Master/texmf-dist/source/latex/cs-techrep/cs-techrep.ins
@@ -1,4 +1,4 @@
-% cs-techrep.ins generated using makedtx version 1.2 2024/4/10 18:14
+% cs-techrep.ins generated using makedtx version 1.2 2024/9/14 21:40
\input docstrip
\preamble
diff --git a/Master/texmf-dist/source/latex/csthm/csthm.dtx b/Master/texmf-dist/source/latex/csthm/csthm.dtx
new file mode 100644
index 00000000000..5c059b35230
--- /dev/null
+++ b/Master/texmf-dist/source/latex/csthm/csthm.dtx
@@ -0,0 +1,238 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2024 by Agni Datta <agnidatta.org@gmail.com>
+%
+% 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 2008/05/04 or later.
+%
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Agni Datta.
+%
+% This work consists of the files csthm.dtx and csthm.ins
+% and the derived file csthm.sty.
+%
+% \fi
+%
+% \iffalse
+%<*driver>
+\ProvidesFile{csthm.dtx}
+%</driver>
+%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+%<package>\ProvidesPackage{csthm}
+%<*package>
+ [2024/08/31 v1.2 Theorem Environments for Computer Science]
+%</package>
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{csthm}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\begin{document}
+\DocInput{csthm.dtx}
+\PrintChanges
+\PrintIndex
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{0}
+%
+% \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 \~}
+%
+%
+% \changes{v1.0}{2024/08/31}{Initial version}
+% \changes{v1.1}{2024/08/31}{Added cleveref support}
+% \changes{v1.2}{2024/08/31}{Improved documentation and code structure}
+%
+% \DoNotIndex{\newcommand,\newenvironment}
+%
+% \providecommand*{\url}{\texttt}
+% \GetFileInfo{csthm.dtx}
+% \title{The \textsf{csthm} package}
+% \author{Agni Datta \\ \url{agnidatta.org@gmail.com}}
+% \date{\filedate}
+%
+% \maketitle
+%
+% \section{Introduction}
+%
+% This package provides customized theorem-like environments specifically designed for computer science documents. It offers a set of pre-defined theorem styles and environments to streamline the creation of theorems, definitions, remarks, and other common structures in computer science papers and documents.
+%
+% \section{Usage}
+%
+% Load the package with:
+% \begin{verbatim}
+% \usepackage{csthm}
+% \end{verbatim}
+%
+% To use the package with cleveref support:
+% \begin{verbatim}
+% \usepackage[cleveref]{csthm}
+% \end{verbatim}
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% Package options
+\newif\if@csthm@loadcleveref
+\DeclareOption{cleveref}{\@csthm@loadclevereftrue}
+\ProcessOptions\relax
+
+% Required packages
+\RequirePackage{amsmath}
+\RequirePackage{amssymb}
+\RequirePackage{amsthm}
+\RequirePackage{enumitem}
+\RequirePackage{thmtools}
+
+% Conditionally load cleveref if the option is set and hyperref is loaded
+\if@csthm@loadcleveref
+\AtBeginDocument{%
+ \@ifpackageloaded{hyperref}{%
+ \RequirePackage{cleveref}
+ }{%
+ \PackageWarning{csthm}{The 'cleveref' option was set, but 'hyperref' is not loaded. Skipping 'cleveref' loading.}
+ }%
+}
+\fi
+
+% Define theorem styles
+\declaretheoremstyle[
+ spaceabove=\topsep,
+ spacebelow=\topsep,
+ headfont=\scshape,
+ notefont=\scshape,
+ bodyfont=\normalfont,
+ postheadspace=5pt,
+ numberwithin=section,
+ qed=$\scriptstyle\star$,
+ headpunct={.}
+]{thmstyle}
+
+\declaretheoremstyle[
+ spaceabove=\topsep,
+ spacebelow=\topsep,
+ headfont=\bfseries,
+ notefont=\bfseries,
+ bodyfont=\normalfont,
+ postheadspace=5pt,
+ numberwithin=section,
+ qed=$\scriptstyle\maltese$,
+ headpunct={.}
+]{defstyle}
+
+\declaretheoremstyle[
+ spaceabove=\topsep,
+ spacebelow=\topsep,
+ headfont=\itshape,
+ notefont=\itshape,
+ bodyfont=\normalfont,
+ postheadspace=5pt,
+ numberwithin=section,
+ qed=$\scriptstyle\maltese$,
+ headpunct={.}
+]{remarkstyle}
+
+\declaretheoremstyle[
+ spaceabove=\topsep,
+ spacebelow=\topsep,
+ headfont=\sffamily\scshape,
+ notefont=\sffamily\scshape,
+ bodyfont=\normalfont\sffamily,
+ postheadspace=5pt,
+ numberwithin=section,
+ qed=$\scriptstyle\maltese$,
+ headpunct={.}
+]{hltstyle}
+
+% Define theorem environments
+\declaretheorem[style=thmstyle,name=Theorem]{theorem}
+\declaretheorem[style=defstyle,sibling=theorem]{fact}
+\declaretheorem[style=thmstyle,sibling=theorem]{assumption}
+\declaretheorem[style=thmstyle,sibling=theorem]{claim}
+\declaretheorem[style=thmstyle,sibling=theorem]{conjecture}
+\declaretheorem[style=thmstyle,sibling=theorem]{corollary}
+\declaretheorem[style=thmstyle,sibling=theorem]{lemma}
+\declaretheorem[style=thmstyle,sibling=theorem]{property}
+\declaretheorem[style=thmstyle,sibling=theorem]{proposition}
+
+% Define definition environments
+\declaretheorem[style=defstyle,sibling=theorem]{definition}
+\declaretheorem[style=defstyle,sibling=theorem]{example}
+\declaretheorem[style=defstyle,sibling=theorem]{exercise}
+\declaretheorem[style=defstyle,sibling=theorem]{problem}
+\declaretheorem[style=defstyle,sibling=theorem]{question}
+
+% Define remark environments
+\declaretheorem[style=remarkstyle,sibling=theorem]{note}
+\declaretheorem[style=remarkstyle,sibling=theorem]{remark}
+\declaretheorem[style=remarkstyle,sibling=theorem]{solution}
+
+% Define highlight environments
+\declaretheorem[style=hltstyle,name=Important]{important}
+\declaretheorem[style=hltstyle]{highlight}
+\declaretheorem[style=hltstyle]{keypoint}
+
+% Define case environment
+\newlist{caseList}{enumerate}{1}
+\setlist[caseList]{label=\textbf{Case~\arabic*:},leftmargin=*}
+
+\NewDocumentEnvironment{case}{O{}}{%
+ \begin{caseList}[#1]%
+ }{%
+ \end{caseList}%
+}
+
+% Define axiom environment
+\newlist{axiomList}{enumerate}{1}
+\setlist[axiomList]{label=\textbf{Axiom~\Alph*:}, leftmargin=*}
+
+\NewDocumentEnvironment{axiom}{O{}}{%
+ \begin{axiomList}[#1]%
+ }{%
+ \end{axiomList}%
+}
+
+% Custom QED symbol
+\renewcommand\qedsymbol{$\scriptstyle\blacksquare$}
+
+% Define accent color (customizable by the user)
+\providecommand{\accentcolor}{black}
+
+% Package documentation commands
+\providecommand{\csthmpkg}{\textsf{csthm}}
+\providecommand{\email}[1]{\href{mailto:#1}{\texttt{#1}}}
+
+% User-level commands for customization
+\newcommand{\setaccentcolor}[1]{\renewcommand{\accentcolor}{#1}}
+%</package>
+% \end{macrocode}
+%
+% \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/csthm/csthm.ins
index f7563b4ab15..02d0c9ea131 100644
--- a/Master/texmf-dist/source/latex/isosafety/isosafety.ins
+++ b/Master/texmf-dist/source/latex/csthm/csthm.ins
@@ -1,56 +1,55 @@
%%
-%% Copyright (C) 2023 by BenSt099
+%% Copyright (C) 2024 by Agni Datta <agnidatta.org@gmail.com>
%%
%% 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
+%% 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.
+%%
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008/05/04 or later.
%%
\input docstrip.tex
\keepsilent
-\usedir{tex/latex/isosafety}
+\usedir{tex/latex/csthm}
\preamble
This is a generated file.
-Copyright (C) 2023 by BenSt099
+Copyright (C) 2024 by Agni Datta <agnidatta.org@gmail.com>
This file may be distributed and/or modified under the conditions of
-the LaTeX Project Public License, either version 1.3 of this license
+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.
+and version 1.3c or later is part of all distributions of LaTeX
+version 2008/05/04 or later.
\endpreamble
-\generate{\file{isosafety.sty}{\from{isosafety.dtx}{package}}}
+\generate{\file{csthm.sty}{\from{csthm.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
+\Msg{************************************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* file into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* csthm.sty *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file csthm.dtx *}
+\Msg{* through LaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{************************************************************************}
+
+\endbatchfile \ No newline at end of file
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 8bdec3e16d8..87629837bbd 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/20}{2024cg}
+\ProvidesExplClass{easybook}{2024/10/02}{2024ed}
{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,19 +301,16 @@
%</class>
%<*package>
\RequirePackage{etoolbox}
-\ProvidesExplPackage{easybase}{2024/06/20}{2024cg}
+\ProvidesExplPackage{easybase}{2024/10/02}{2024ed}
{Easily typesetting Chinese theses or books}
\cs_generate_variant:Nn \dim_set:Nn { NV }
\cs_generate_variant:Nn \dim_sign:n { V }
\cs_generate_variant:Nn \int_to_arabic:n { v }
\cs_generate_variant:Nn \msg_warning:nnn { nnV }
-\cs_generate_variant:Nn \prop_set_from_keyval:Nn { NV }
\cs_generate_variant:Nn \skip_set:Nn { NV }
-\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 \tl_if_novalue:nF { V }
\cs_set_protected:Npn \ctex_define:nn #1
@@ -326,12 +324,7 @@
{ \AddToHook{cmd/#1/before}{#2} }
\cs_new_protected:Npn \eb_appto_cmd:nn #1#2
{ \AddToHook{cmd/#1/after}{#2} }
-\cs_new_protected:Npn \eb_at_begin_environment:nn #1#2
- {
- \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 +364,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 +379,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
@@ -400,9 +397,13 @@
floatpage .bool_set:N = \l__eb_float_page_bool,
floatpage .default:n = true,
floatpage .initial:n = false,
- theorem .bool_set:N = \l__eb_theorem_support_bool,
- theorem .default:n = true,
- theorem .initial:n = true,
+ theorem .choices:nn =
+ { thmtools,keytheorems,false }
+ { \tl_set:Nn \l__eb_theorem_support_tl {#1} },
+ theorem .value_required:n = true,
+ theorem/true .meta:n = { theorem = thmtools },
+ theorem .default:n = thmtools,
+ theorem .initial:n = thmtools,
paper .code:n = \eb_put_geometry:n {#1},
paper .initial:n = a4paper,
class .choice:,
@@ -411,13 +412,15 @@
{
\bool_set_true:N \l__eb_class_mode_book_bool
\eb_put_geometry:n { twoside }
+ \booltrue{@titlepage}
},
class/article .code:n =
{
\bool_set_false:N \l__eb_class_mode_book_bool
\eb_put_geometry:n { twoside = false }
+ \boolfalse{@titlepage}
},
- class .initial:n = book,
+ class .initial:x = \ifbool{@titlepage}{book}{article},
book .meta:n = { class = book },
article .meta:n = { class = article },
unknown .code:n = \clist_gput_right:NV \g__eb_ctex_options_clist \CurrentOption
@@ -447,16 +450,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 +507,6 @@
\ebloadpackage
{
[text]{spbmark},
- [normalem]{ulem},
[{shortlabels,inline}]{enumitem},
chemformula,siunitx,pifont,
geometry,marginnote,
@@ -698,18 +700,18 @@
}
\cs_set:Npn \markdouble #1 { \markboth{#1}{\ifbool{@twoside}{#1}{}} }
-\cs_new:Npn \eb@level@markdouble #1#2
+\cs_new_protected:Npn \eb@level@markdouble #1#2
{ \markdouble{\use:c { eb@mark@#1@whole }{#2}} }
-\cs_new:Npn \eb@level@markright #1#2
+\cs_new_protected:Npn \eb@level@markright #1#2
{ \markright{\use:c { eb@mark@#1@whole }{#2}} }
\cs_gset:Npn \chaptermark #1 { \eb@level@markdouble{chapter}{#1} }
-\cs_gset:Npn \sectionmark #1
+\cs_gset:Npx \sectionmark #1
{
\bool_if:NTF \l__eb_class_mode_book_bool
{ \eb@level@markright{section}{#1} }
{ \eb@level@markdouble{section}{#1} }
}
-\cs_gset:Npn \subsectionmark #1
+\cs_gset:Npx \subsectionmark #1
{
\bool_if:NF \l__eb_class_mode_book_bool
{ \eb@level@markright{subsection}{#1} }
@@ -801,25 +803,14 @@
\UseFntSymbsList{empty}
\cs_set_eq:NN \DefineFntSymbols \SetFntSymbsList
\cs_set_eq:NN \setfntsymbol \UseFntSymbsList
-\cs_new:Npn \eb_int_format_trans:NN #1
- {
- \str_case:nn {#1}
- {
- { A } { \int_to_Alph:n }
- { a } { \int_to_alph:n }
- { 1 } { \int_to_arabic:n }
- { I } { \int_to_Roman:n }
- { i } { \int_to_roman:n }
- { c } { \exp_args:NV \zhnumber }
- { s } { \eb_int_to_symbols:n }
- }
- }
+\tl_new:N \l__eb_fnmarktext_tmpa_tl
+\tl_new:N \l__eb_fnmarktext_tmpb_tl
\cs_new_protected:Npn \eb_fnmarktext_normal_label_set:Nn #1#2
{
- \tl_set:Nn \l__eb_fnmarktext_number_type_tl {#2}
+ \tl_set:Nn \l__eb_fnmarktext_tmpa_tl {#2}
\cs_set:Npx #1
{
- \str_case:VnT \l__eb_fnmarktext_number_type_tl
+ \str_case:VnT \l__eb_fnmarktext_tmpa_tl
{
{ plain }
{ \exp_not:N \int_use:N }
@@ -836,29 +827,59 @@
}
\cs_set_eq:NN \thedownfootnote \thefootnote
}
+\cs_generate_variant:Nn \msg_warning:nnnn { nnnV }
+\cs_new:Npn \eb_footnote_int_trans:n #1
+ {
+ \prop_item:Nn \l__eb_int_trans_cmds_prop {#1}
+ \exp_not:N \c@footnote
+ }
+\prop_set_from_keyval:Nn \l__eb_int_trans_cmds_prop
+ {
+ A = \exp_not:N \int_to_Alph:n,
+ a = \exp_not:N \int_to_alph:n,
+ 1 = \exp_not:N \int_to_arabic:n,
+ I = \exp_not:N \int_to_Roman:n,
+ i = \exp_not:N \int_to_roman:n,
+ c = \exp_not:n { \exp_args:NV \zhnumber },
+ s = \exp_not:N \eb_int_to_symbols:n
+ }
\cs_new_protected:Npn \eb_fnmarktext_short_label_set:Nn #1#2
{
- \tl_set:Nn \l__eb_fnmarktext_short_tokens_tl {#2}
+ \tl_set:Nn \l__eb_fnmarktext_tmpb_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} }
- \l__eb_fnmarktext_short_tokens_tl
- \seq_map_break:
+ { \c{eb_footnote_int_trans:n}\0 }
+ \l__eb_fnmarktext_tmpb_tl
+ \cs_set:Npx #1 { \l__eb_fnmarktext_tmpb_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 +912,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,68 +959,105 @@
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} }
\str_case:VnT \l__eb_fnt_parent_counter_tl
{
{ part } { \counterwithin*{footnote}{part} }
- { page } { \counterwithin*{footnote}{page} }
+ { page }
+ {
+ \RequirePackage{zref-perpage}
+ \zmakeperpage{footnote}
+ }
}
{ \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 +1080,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 }
@@ -1061,7 +1118,7 @@
\eb_patch_cmd:Nnn #1
{ \reset@font }
{
- \setspread{\eb@spread@footnote}
+ \usestretch{\eb@spread@footnote}
\eb@font@footnote
}
}
@@ -1071,12 +1128,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 +1372,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 +1394,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 +1431,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 +1440,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 +1482,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 +1566,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 +1631,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 +1654,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
@@ -1610,6 +1702,7 @@
\tl_set:cn { ttll@#2 } {#1}
}
\contentsuse{lstlisting}{lol}
+\cs_set:Npn \hytoclink #1 { \Hy@toclinkstart #1\Hy@toclinkend }
\seq_put_left:Nn \c__ctex_headings_seq { chapter }
\seq_put_right:Nn \c__ctex_headings_seq { table }
\seq_put_right:Nn \c__ctex_headings_seq { figure }
@@ -1657,13 +1750,13 @@
{
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
{ \IfBooleanTF{##3}{\use:n}{\contentspush} }
{ \use:n }
- { ##1\tl_use:c { l__eb_toc_##2_after_tl } }
+ { \hytoclink{##1}\tl_use:c { l__eb_toc_##2_after_tl } }
},
tocafter = \hspace{1em},
tocsep = .—,
@@ -1728,7 +1821,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 +1838,7 @@
}
}
}
+\cs_set:Npn \cdottocrule { \tocrule{\textperiodcentered} }
\ctex_define:nn { toc }
{
lolskip .skip_set:N = \eb@toc@lol@skip,
@@ -1771,8 +1865,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
@@ -1782,24 +1875,30 @@
\group_begin:
\makeatletter
\file_if_exist_input:n { \jobname.#1 }
- \UseHookWithArguments{starttoc/after}{1}{#1}
+ \AddToHook{enddocument/afterlastpage}
+ {\UseHookWithArguments{starttoc/after}{1}{#1}}
\boolfalse{@nobreak}
\group_end:
}
{ \eb@starttoc{#1} }
}
-\AddToHook{enddocument/afterlastpage}
+\cs_set_protected:Npn \AssignPartialExt #1#2
{
- \IfHookEmptyTF{starttoc/after}{}
- {\iow_now:Nn \@mainaux { \RemoveFromHook{starttoc/after}[aux] }}
+ \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 +1922,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 +1949,7 @@
{
tocformat = \addvspace{1pc}\sffamily,
tocindent = 0pt,
- tocrule = \tocrule{$\cdot$}[\bfseries],
+ tocrule = \cdottocrule[\bfseries],
tocline = \CTEXnumberline{#1}#2
},
section =
@@ -1861,17 +1959,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 +2027,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 +2049,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} }
@@ -1967,26 +2065,53 @@
}
\cs_set_eq:NN \addtosubfont \ebaddtofont
+\cs_new_protected:Npn \usestretch #1
+ {
+ \edef\baselinestretch{#1}
+ \@currsize
+ }
+\cs_set_eq:NN \setspread \usestretch
+\cs_new_protected:Npn \restore@usespace
+ {
+ \par
+ \vskip\parskip
+ \vskip\baselineskip
+ \endgroup
+ \vskip -\parskip
+ \vskip -\baselineskip
+ }
+\NewDocumentEnvironment{usespace}{m+b}
+ {
+ \par
+ \begingroup
+ \usestretch{#1}#2
+ \restore@usespace
+ }{}
+\msg_new:nnn { easybase } { invalid-spread }
+ {
+ The~line~spacing~factor~option~'#1'~is~invalid. \\
+ Please~use~the~'usespace'~environment~to~set~the~line~spacing.
+ }
+\cs_new_protected:Npn \eb_invalid_spread_warning:
+ { \msg_warning:nnV { easybase } { invalid-spread } \l_keys_key_str }
\ctex_define:nn { space }
{
- linespread .code:n = \setspread{#1},
- tabspread .fp_set:N = \l__eb_spread_table_fp,
- tabspread .initial:n = 1.2,
- mathspread .tl_set:N = \eb@spread@math,
- mathspread .initial:n = 1.2,
+ linespread .code:n = \usestretch{#1},
+ tabspread .code:n = \eb_invalid_spread_warning:,
+ mathspread .code:n = \eb_invalid_spread_warning:,
fntspread .code:n =
{
\tl_set:Nn \eb@spread@footnote {#1}
\group_begin:
\footnotesize
- \setspread{\eb@spread@footnote}
+ \usestretch{\eb@spread@footnote}
\exp_args:NNNo \group_end:
\dim_set:Nn \footnotesep { \dim_use:N \box_ht:N \strutbox }
},
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},
@@ -1995,8 +2120,8 @@
caption-spread .initial:n = 1.2,
everyspread .meta:n =
{
- linespread = {#1},tabspread = {#1},mathspread = {#1},
- caption-spread = {#1},fntspread = {#1}
+ linespread = {#1},caption-spread = {#1},
+ fntspread = {#1}
},
abovedisplayskip .code:n =
{ \AfterPreamble{\skip_set:Nn \abovedisplayskip {#1}} },
@@ -2015,23 +2140,39 @@
\tl_if_eq:NnT \l__ctex_scheme_tl { chinese }
{
\fp_compare:nNnTF { \l__ctex_line_spread_fp } = { 1.3 }
- {
- \ctex_set:nn { space }
- { linespread = 1.354,tabspread = 1.354 }
- }
- {
- \ctex_set:nn { space }
- { linespread = \fp_use:N \l__ctex_line_spread_fp }
- }
+ { \usestretch{1.354} }
+ { \usestretch{\fp_use:N \l__ctex_line_spread_fp} }
}
\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}
{
- \setspread{\fp_use:c { l__eb_spread_caption_#1_fp }}
+ \usestretch{\fp_use:c { l__eb_spread_caption_#1_fp }}
\tl_use:c { l__eb_font_caption_#1_tl }
}
}
@@ -2045,15 +2186,12 @@
}
\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}
\captionsetup[table][bi-second]{name = Table}
}
-\eb_at_begin_environment:nn
- { tabular,tabularx,longtable }
- { \setspread{\fp_use:N \l__eb_spread_table_fp} }
\UseTblrLibrary{booktabs}
\bool_if:NF \l__eb_float_page_bool
@@ -2204,21 +2342,46 @@
\tl_clear:N \l__eb_eqsymb_intro_tl
\ignorespaces
}
-\bool_if:NT \l__eb_theorem_support_bool
+\cs_new:Npn \eb_tl_exist_noempty:cT #1#2
+ { \tl_if_exist:cT {#1} { \tl_if_empty:cF {#1} {#2} } }
+\cs_new:Npn \eb_undefine_counter:n #1
+ {
+ \cs_undefine:c { c@#1 }
+ \cs_undefine:c { the#1 }
+ \exp_args:Nc \providecommand { c@@ckpt }{}
+ \@removefromreset{#1}{@ckpt}
+ }
+\ProvideDocumentCommand{\declarecounter}{mo}
+ {
+ \eb_undefine_counter:n {#1}
+ \IfValueTF{#2}{\newcounter{#1}[#2]}{\newcounter{#1}}
+ }
+\cs_new_protected:Npn \eb_theorem_load_thmtools:
{
\RequirePackage{amsthm,thmtools}
\cs_set_eq:NN \eb@declaretheoremstyle@save \declaretheoremstyle
\cs_set_eq:NN \eb@declaretheorem@save \declaretheorem
- \RenewDocumentCommand{\declaretheoremstyle}{O{}mO{}}
- {\eb@declaretheoremstyle@save[#1,#3]{#2}}
- \RenewDocumentCommand{\declaretheorem}{O{}mO{}}
+ \RenewDocumentCommand{\declaretheoremstyle}{+O{}m+O{}}
+ {\eb@declaretheoremstyle@save[##1,##3]{##2}}
+ \RenewDocumentCommand{\declaretheorem}{+O{}m+O{}}
{
- \eb@declaretheorem@save[style = default,#1,#3]{#2}
- \settheoremtocline{#2}
+ \cs_undefine:c {##2}
+ \eb_undefine_counter:n {##2}
+ \eb_tl_exist_noempty:cT { g__eb_thmt_##2_parent_tl }
{
- \listnumberline{#2}
+ \exp_args:Nnv \@removefromreset {##2}
+ { g__eb_thmt_##2_parent_tl }
+ }
+ \eb@declaretheorem@save[style = default,##1,##3]{##2}
+ \tl_gset:cV { g__eb_thmt_##2_parent_tl } \thmt@parent
+ \settheoremtocline{##2}
+ {
+ \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 }
{
@@ -2236,14 +2399,13 @@
bodyfont = \normalfont,
postheadspace = 1em
]
- \theoremstyle{default}
- \cs_undefine:N \proof
\DeclareFloatList{theorem}{loe}
- \AllotPartialExt{loe}{ple}
+ \AssignPartialExt{loe}{ple}
\eb_preto_cmd:nn { listoftheorems }
{
\group_begin:
- \def\contentsline #1 {\use:c { thmt@contentsline@#1 }{#1}}
+ \let\thmt@contentsline\contentsline
+ \def\contentsline ##1 {\use:c { thmt@contentsline@##1 }{##1}}
}
\eb_appto_cmd:nn { listoftheorems } { \group_end: }
\eb_preto_cmd:nn { @chapter }
@@ -2255,21 +2417,34 @@
\def\thmtname{\thmt@thmname}
\def\thmtenvname{\thmt@envname}
\def\thmtnote{\thmt@shortoptarg}
- \def\thmtformatoptarg #1 {#1}
- \def\thmtifname #1#2 {\ifbool{thmt@isstarred}{#2}{#1}}
- \def\thmtifnote #1#2
+ \def\thmtformatoptarg ##1 {##1}
+ \def\thmtifname ##1##2 {\ifbool{thmt@isstarred}{##2}{##1}}
+ \def\thmtifnote ##1##2
{
\tl_if_empty:NTF \thmt@shortoptarg
- {#2}
- { \protect\thmtformatoptarg{#1} }
+ {##2}
+ { \protect\thmtformatoptarg{##1} }
}
\NewDocumentCommand{\settheoremtocline}{smm}
{
- \IfBooleanT{#1}{\def\thmt@contentslineIgnore{\thmt@contentsline}}
- \cs_set:cpn { ll@#2 } { \@bsphack #3\@esphack }
+ \IfBooleanT{##1}{\def\thmt@contentslineIgnore{\thmt@contentsline}}
+ \cs_set:cpn { ll@##2 } { \@bsphack ##3\@esphack }
}
}
-
+\cs_new_protected:Npn \eb_theorem_load_keytheorems:
+ {
+ \RequirePackage{keytheorems}
+ \DeclareFloatList{theorem}{thlist}
+ \AssignPartialExt{thlist}{ple}
+ }
+\str_case:VnT \l__eb_theorem_support_tl
+ {
+ { thmtools }
+ { \eb_theorem_load_thmtools: }
+ { keytheorems }
+ { \eb_theorem_load_keytheorems: }
+ }
+ { \cs_undefine:N \proof }
\setchemformula
{
math-scripts = false,
@@ -2288,30 +2463,6 @@
group-digits = none
}
}{}
-\eb_at_begin_environment:nn
- {
- array,matrix,pmatrix,bmatrix,Bmatrix,vmatrix,Vmatrix,
- matrix*,pmatrix*,bmatrix*,Bmatrix*,vmatrix*,Vmatrix*,
- cases,cases*,dcases,dcases*,rcases,rcases*,drcases,drcases*,
- aligned,alignedat,gathered,multlined,lgathered,rgathered
- }
- { \setspread{\eb@spread@math} }
-\clist_map_inline:nn
- { \start@gather,\start@align,\start@multline }
- {
- \eb_patch_cmd:Nnn #1
- { \collect@body }
- {
- \setspread{\eb@spread@math}
- \collect@body
- }
- }
-\eb_patch_cmd:Nnn \gather@split
- { \spread@equation }
- {
- \setspread{\eb@spread@math}
- \spread@equation
- }
\ctex_at_end_package:nn { unicode-math }
{ \msg_redirect_module:nnn { unicode-math } { warning } { info } }
\ctex_at_end_package:nn { tcolorbox }
@@ -2332,7 +2483,6 @@
bititle .initial:n = Bibliography,
unknown .code:n = \eb_msg_deprecated_option:n { bib }
}
-
\cs_new_protected:Npn \eb_bibtex_natbib_set:
{
\RequirePackage[sort&compress]{natbib}
@@ -2350,7 +2500,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 +2548,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
@@ -2615,6 +2765,8 @@
lstlistingname = 代码,
listtheoremname = 定理清单
}
+ \ctex_at_end_package:nn { keytheorems }
+ { \keytheoremlistset{title = 定理清单} }
}
{
\keys_set_known:nn { ctex }
@@ -2623,17 +2775,109 @@
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}
+ \let\footnote\thanks
+ }
+ {}
+ \bgroup\LARGE\@title\par\egroup
+ \notbool{@titlepage}{\vskip 1.5em}{\vskip 3em}
+ \bgroup\large
+ \begin{tabular}[t]{c}
+ \@author
+ \end{tabular}\par\egroup
+ \notbool{@titlepage}{\vskip 0.75em}{\vskip 1.5em}
+ \bgroup\large\@date\par\egroup
+ \notbool{@titlepage}{\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/20}{2024cg}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2024/10/02}{2024ed}
{Customization of tcolorbox for easybook}
\cs_set_protected:Npn \addtotcbstyle #1#2
{ \tcbset{#1/.append~style = {#2}} }
\cs_set_protected:Npn \deftcbstyle #1#2
{ \tcbset{#1/.style = {#2}} }
-\cs_new_protected:Npn \tcbappstyle
- { \@ifstar{\deftcbstyle}{\addtotcbstyle} }
\deftcbstyle{tc-easyboxi}
{
diff --git a/Master/texmf-dist/source/latex/edmac/edmac.drv b/Master/texmf-dist/source/latex/edmac/edmac.drv
deleted file mode 100644
index 3ba89614313..00000000000
--- a/Master/texmf-dist/source/latex/edmac/edmac.drv
+++ /dev/null
@@ -1,40 +0,0 @@
-% c:\edmac\edmac.doc
-% \documentstyle[a4,doc]{article}
-\documentclass[a4paper]{article}
-\usepackage{doc}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% commands to do 'LaTeX Manual-like' examples
-% Thanks to John Warbrick, Plymouth, 1988.
-\newlength{\egwidth}\setlength{\egwidth}{0.42\textwidth}
-\newenvironment{eg}%
-{\begin{list}{}{\setlength{\leftmargin}{0.05\textwidth}%
-\setlength{\rightmargin}{\leftmargin}}\item[]\small}%
-{\end{list}}
-\newenvironment{egbox}%
-{\begin{minipage}[t]{\egwidth}}%
-{\end{minipage}}
-\newcommand{\egstart}{\begin{eg}\begin{egbox}}
-\newcommand{\egmid}{\end{egbox}\hfill\begin{egbox}}
-\newcommand{\egend}{\end{egbox}\end{eg}}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%\addtolength{\evensidemargin}{-0.43in}
-% \setcounter{page}{1} % ltugboat sets it to 1001, which annoys Makeindex.
-% \SelfDocumenting % the only other reference to ltugboat.sty
-% \DisableCrossrefs % Say \DisableCrossrefs if the index is ready
-\EnableCrossrefs
-%
-\MakeShortVerb{\"} % defined in newdoc.sty, so you can say
- % "\macro" instead of \verb|\macro|
-
-\pagestyle{headings}
-%\parindent 0pt
-%\parskip 1.5ex
-
-% \OnlyDescription
- \PageIndex
-%\CodelineIndex
-
-\begin{document}
- \DocInput{edmac.doc}
-\end{document}
-
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/fmtcount/fmtcount.dtx b/Master/texmf-dist/source/latex/fmtcount/fmtcount.dtx
index 0525133f838..4f1bdf81666 100644
--- a/Master/texmf-dist/source/latex/fmtcount/fmtcount.dtx
+++ b/Master/texmf-dist/source/latex/fmtcount/fmtcount.dtx
@@ -3,9 +3,9 @@
% Command line args:
% -src "(.+)\.(sty|def)$=>\1.\2"
% -doc "fmtcount-manual.tex"
-% -author "Nicola Talbot and Vincent Belache"
+% -author "Nicola Talbot and Vincent Belaïche"
% fmtcount
-% Created on 2020/2/24 20:03
+% Created on 2024/8/31 14:57
%\fi
%\iffalse
%<*package>
@@ -28,7 +28,7 @@
%\fi
% \iffalse
% Doc-Source file to use with LaTeX2e
-% Copyright (C) 2020 Nicola Talbot and Vincent Belache, all rights reserved.
+% Copyright (C) 2024 Nicola Talbot and Vincent Belaïche, all rights reserved.
% \fi
% \iffalse
%<*driver>
@@ -77,7 +77,7 @@
pdftitle={fmtcount.sty: Displaying the Values of LaTeX Counters},
pdfkeywords={LaTeX,counter}]{hyperref}
-\CheckSum{10315}
+\CheckSum{10834}
\doxitem{Option}{option}{options}
@@ -104,7 +104,7 @@
% \url{www.dickimaw-books.com}
% \and
% Vincent Bela\"iche}
-% \date{2020-02-24 (version 3.07)\relax
+% \date{2024-08-31 (version 3.08)\relax
%}
% \maketitle
% \tableofcontents
@@ -1184,6 +1184,414 @@
%\fi
%\iffalse
% \begin{macrocode}
+%<*fc-dutch.def>
+% \end{macrocode}
+%\fi
+% \subsubsection{fc-dutch.def}
+% Dutch definitions, initially added by Erik Nijenhuis.
+% \begin{macrocode}
+\ProvidesFCLanguage{dutch}[2024/01/27]%
+% \end{macrocode}
+% Define macro that converts a number or count register (first
+% argument) to an ordinal, and stores the result in the
+% second argument, which should be a control sequence.
+% \begin{macrocode}
+\newcommand{\@ordinalMdutch}[2]{\edef#2{\number#1\relax.}}%
+\global\let\@ordinalMdutch\@ordinalMdutch
+% \end{macrocode}
+% Like English, there is no gender difference in Dutch,
+% so make feminine and neuter the same as the masculine.
+% \begin{macrocode}
+\global\let\@ordinalFdutch\@ordinalMdutch
+\global\let\@ordinalNdutch\@ordinalMdutch
+% \end{macrocode}
+% Define the macro that prints the value of a \TeX\ count register
+% as text. To make it easier, break it up into units, teens and
+% tens. First, the units: the argument should be between 0 and 9
+% inclusive.
+% \begin{macrocode}
+\newcommand*\@@unitstringdutch[1]{%
+ \ifcase#1%
+ nul%
+ \or een% één and \'e\'en not working atm
+ \or twee%
+ \or drie%
+ \or vier%
+ \or vijf%
+ \or zes%
+ \or zeven%
+ \or acht%
+ \or negen%
+ \fi
+}%
+\global\let\@@unitstringdutch\@@unitstringdutch
+% \end{macrocode}
+% Next the tens, again the argument should be between 0 and 9
+% inclusive.
+% \begin{macrocode}
+\global\let\@@unitstringdutch\@@unitstringdutch
+\newcommand*\@@tenstringdutch[1]{%
+ \ifcase#1%
+ \or tien%
+ \or twintig%
+ \or dertig%
+ \or veertig%
+ \or vijftig%
+ \or zestig%
+ \or zeventig%
+ \or tachtig%
+ \or negentig%
+ \or honderd%
+ \fi
+}%
+\global\let\@@tenstringdutch\@@tenstringdutch
+% \end{macrocode}
+% Finally the teens, again the argument should be between 0 and 9
+% inclusive.
+% \begin{macrocode}
+\newcommand*\@@teenstringdutch[1]{%
+ \ifcase#1%
+ tien%
+ \or elf%
+ \or twaalf%
+ \or dertien%
+ \or veertien%
+ \or vijftien%
+ \or zestien%
+ \or zeventien%
+ \or achttien%
+ \or negentien%
+ \fi
+}%
+\global\let\@@teenstringdutch\@@teenstringdutch
+% \end{macrocode}
+% Hunderd and thousand:
+% \begin{macrocode}
+\providecommand*{\honderd}{honderd}%
+\providecommand*{\duizend}{duizend}%
+\global\let\honderd\honderd
+\global\let\duizend\duizend
+% \end{macrocode}
+% The numberstring implementation:
+% \begin{macrocode}
+\newcommand*\@@numberstringdutch[2]{%
+ \ifnum#1>99999\relax
+ \PackageError{fmtcount}{Out of range}%
+ {This macro only works for values less than 100000}%
+ \else
+ \ifnum#1<0\relax
+ \PackageError{fmtcount}{Negative numbers not permitted}%
+ {This macro does not work for negative numbers, however
+ you can try typing "minus" first, and then pass the modulus of
+ this number}%
+ \fi
+ \fi
+ \def#2{}%
+ \@strctr=#1\relax \divide\@strctr by 1000\relax
+ \ifnum\@strctr>1\relax
+ \@@numberunderhundreddutch{\@strctr}{#2}%
+ \appto#2{duizend}%
+ \else
+ \ifnum\@strctr=1\relax
+ \eappto#2{\duizend}%
+ \fi
+ \fi
+ \@strctr=#1\relax
+ \@FCmodulo{\@strctr}{1000}%
+ \divide\@strctr by 100\relax
+ \ifnum\@strctr>1\relax
+ \eappto#2{\@unitstring{\@strctr}honderd}%
+ \else
+ \ifnum\@strctr=1\relax
+ \ifnum#1>1000\relax
+ \appto#2{honderd}%
+ \else
+ \eappto#2{\honderd}%
+ \fi
+ \fi
+ \fi
+ \@strctr=#1\relax
+ \@FCmodulo{\@strctr}{100}%
+ \ifnum#1=0\relax
+ \def#2{null}%
+ \else
+ \ifnum\@strctr=1\relax
+ \appto#2{een}% één and \'e\'en not working atm
+ \else
+ \@@numberunderhundreddutch{\@strctr}{#2}%
+ \fi
+ \fi
+}%
+\global\let\@@numberstringdutch\@@numberstringdutch
+% \end{macrocode}
+% All lower case version, the second argument must be a control
+% sequence.
+% \begin{macrocode}
+\newcommand*{\@numberstringMdutch}[2]{%
+ \let\@unitstring=\@@unitstringdutch%
+ \let\@teenstring=\@@teenstringdutch%
+ \let\@tenstring=\@@tenstringdutch%
+ \def\@hundred{honderd}\def\@thousand{duizend}%
+ \@@numberstringdutch{#1}{#2}%
+}%
+\global\let\@numberstringMdutch\@numberstringMdutch
+% \end{macrocode}
+% There is no gender in Dutch, so make feminine and neuter the
+% same
+% as the masculine.
+% \begin{macrocode}
+\global\let\@numberstringFdutch=\@numberstringMdutch
+\global\let\@numberstringNdutch=\@numberstringMdutch
+% \end{macrocode}
+% This version makes the first letter of each word an uppercase
+% character (except ``and''). The second argument must be a control
+% sequence.
+% \begin{macrocode}
+\newcommand*{\@NumberstringMdutch}[2]{%
+ \@numberstringMdutch{#1}{\@@num@str}%
+ \edef#2{\noexpand\MakeUppercase\expandonce\@@num@str}%
+}%
+\global\let\@NumberstringMdutch\@NumberstringMdutch
+% \end{macrocode}
+% There is no gender in Dutch, so make feminine and neuter the
+% same
+% as the masculine.
+% \begin{macrocode}
+\global\let\@NumberstringFdutch=\@NumberstringMdutch
+\global\let\@NumberstringNdutch=\@NumberstringMdutch
+% \end{macrocode}
+% Define a macro that produces an ordinal as a string. Again, break
+% it up into units, teens and tens. First the units:
+% \begin{macrocode}
+\newcommand*\@@unitthstringdutch[1]{%
+ \ifcase#1%
+ nulde%
+ \or eerste% éérste and \'e\'erste not working atm
+ \or tweede%
+ \or derde%
+ \or vierde%
+ \or vijfde%
+ \or zesde%
+ \or zevende%
+ \or achtste%
+ \or negende%
+ \fi
+}%
+\global\let\@@unitthstringdutch\@@unitthstringdutch
+% \end{macrocode}
+% Next the tens:
+% \begin{macrocode}
+\newcommand*\@@tenthstringdutch[1]{%
+ \ifcase#1%
+ \or tiende%
+ \or twintigste%
+ \or dertigste%
+ \or veertigste%
+ \or vijftigste%
+ \or zestigste%
+ \or zeventigste%
+ \or tachtigste%
+ \or negentigste%
+ \fi
+}%
+\global\let\@@tenthstringdutch\@@tenthstringdutch
+% \end{macrocode}
+% The teens:
+% \begin{macrocode}
+\newcommand*\@@teenthstringdutch[1]{%
+ \ifcase#1%
+ tiende%
+ \or elfde%
+ \or twaalfde%
+ \or dertiende%
+ \or veertiende%
+ \or vijftiende%
+ \or zestiende%
+ \or zeventiende%
+ \or achttiende%
+ \or negentiende%
+ \fi
+}%
+\global\let\@@teenthstringdutch\@@teenthstringdutch
+% \end{macrocode}
+% The ordinalstring implementation:
+% \begin{macrocode}
+\newcommand*\@@ordinalstringdutch[2]{%
+ \@orgargctr=#1\relax
+ \ifnum\@orgargctr>99999\relax
+ \PackageError{fmtcount}{Out of range}%
+ {This macro only works for values less than 100000}%
+ \else
+ \ifnum\@orgargctr<0\relax
+ \PackageError{fmtcount}{Negative numbers not permitted}%
+ {This macro does not work for negative numbers, however
+ you can try typing "minus" first, and then pass the modulus of
+ this number}%
+ \fi
+ \fi
+ \def#2{}%
+ \@strctr=\@orgargctr\divide\@strctr by 1000\relax
+ \ifnum\@strctr>1\relax
+ \@@numberunderhundreddutch{\@strctr}{#2}%
+ \@tmpstrctr=\@orgargctr\@FCmodulo{\@tmpstrctr}{1000}%
+ \ifnum\@tmpstrctr=0\relax
+ \eappto#2{\@thousandth}%
+ \else
+ \appto#2{duizend}%
+ \fi
+ \else
+ \ifnum\@strctr=1\relax
+ \ifnum\@orgargctr=1000\relax
+ \eappto#2{\@thousandth}%
+ \else
+ \eappto#2{\duizend}%
+ \fi
+ \fi
+ \fi
+ \@strctr=\@orgargctr%
+ \@FCmodulo{\@strctr}{1000}%
+ \divide\@strctr by 100\relax
+ \ifnum\@strctr>1\relax
+ \@tmpstrctr=\@orgargctr \@FCmodulo{\@tmpstrctr}{100}%
+ \ifnum\@tmpstrctr=0\relax
+ \ifnum\@strctr=1\relax
+ \eappto#2{\@hundredth}%
+ \else
+ \eappto#2{\@unitstring{\@strctr}\@hundredth}%
+ \fi
+ \else
+ \eappto#2{\@unitstring{\@strctr}honderd}%
+ \fi
+ \else
+ \ifnum\@strctr=1\relax
+ \@tmpstrctr=\@orgargctr \@FCmodulo{\@tmpstrctr}{100}%
+ \ifnum\@tmpstrctr=0\relax
+ \eappto#2{\@hundredth}%
+ \else
+ \ifnum\@orgargctr>1000\relax
+ \appto#2{honderd}%
+ \else
+ \eappto#2{\honderd}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \@strctr=\@orgargctr%
+ \@FCmodulo{\@strctr}{100}%
+ \ifthenelse{\@strctr=0 \and \@orgargctr>0 }{}{%
+ \@@numberunderhundredthdutch{\@strctr}{#2}%
+ }%
+}%
+\global\let\@@ordinalstringdutch\@@ordinalstringdutch
+% \end{macrocode}
+% All lower case version. Again, the second argument must be a
+% control sequence in which the resulting text is stored.
+% \begin{macrocode}
+\newcommand*{\@ordinalstringMdutch}[2]{%
+ \let\@unitthstring=\@@unitthstringdutch%
+ \let\@teenthstring=\@@teenthstringdutch%
+ \let\@tenthstring=\@@tenthstringdutch%
+ \let\@unitstring=\@@unitstringdutch%
+ \let\@teenstring=\@@teenstringdutch%
+ \let\@tenstring=\@@tenstringdutch%
+ \def\@thousandth{duizendste}%
+ \def\@hundredth{honderdste}%
+ \@@ordinalstringdutch{#1}{#2}%
+}%
+\global\let\@ordinalstringMdutch\@ordinalstringMdutch
+% \end{macrocode}
+% No gender in Dutch, so make feminine and neuter same as
+% masculine:
+% \begin{macrocode}
+\global\let\@ordinalstringFdutch=\@ordinalstringMdutch
+\global\let\@ordinalstringNdutch=\@ordinalstringMdutch
+% \end{macrocode}
+% First letter of each word in upper case:
+% \begin{macrocode}
+\newcommand*{\@OrdinalstringMdutch}[2]{%
+ \@ordinalstringMdutch{#1}{\@@num@str}%
+ \def\@hundred{Honderd}\def\@thousand{Duizend}%
+ \def\@hundredth{Honderdste}\def\@thousandth{Duizendste}%
+ \edef#2{\noexpand\MakeUppercase\expandonce\@@num@str}%
+}%
+\global\let\@OrdinalstringMdutch\@OrdinalstringMdutch
+% \end{macrocode}
+% No gender in Dutch, so make feminine and neuter same as
+% masculine:
+% \begin{macrocode}
+\global\let\@OrdinalstringFdutch=\@OrdinalstringMdutch
+\global\let\@OrdinalstringNdutch=\@OrdinalstringMdutch
+% \end{macrocode}
+% For numbers under hunderd:
+% \begin{macrocode}
+\newcommand*{\@@numberunderhundreddutch}[2]{%
+ \ifnum#1<10\relax
+ \ifnum#1>0\relax
+ \eappto#2{\@unitstring{#1}}%
+ \fi
+ \else
+ \@tmpstrctr=#1\relax
+ \@FCmodulo{\@tmpstrctr}{10}%
+ \ifnum#1<20\relax
+ \eappto#2{\@teenstring{\@tmpstrctr}}%
+ \else
+ \ifnum\@tmpstrctr=0\relax
+ \else
+% \end{macrocode}
+% For digits ending with an `e', a trema gets added for \cs{@andname}.
+% Take for example drieëntwintig or tweeënveertig.
+% \begin{macrocode}
+ \ifnum\@tmpstrctr=2\relax\def\@andname{ën}%
+ \else\ifnum\@tmpstrctr=3\relax\def\@andname{ën}%
+ \else\def\@andname{en}%
+ \fi\fi%
+ \eappto#2{\@unitstring{\@tmpstrctr}\@andname}%
+ \fi
+ \@tmpstrctr=#1\relax
+ \divide\@tmpstrctr by 10\relax
+ \eappto#2{\@tenstring{\@tmpstrctr}}%
+ \fi
+ \fi
+}%
+\global\let\@@numberunderhundreddutch\@@numberunderhundreddutch
+\newcommand*{\@@numberunderhundredthdutch}[2]{%
+ \ifnum#1<10\relax
+ \eappto#2{\@unitthstring{#1}}%
+ \else
+ \@tmpstrctr=#1\relax
+ \@FCmodulo{\@tmpstrctr}{10}%
+ \ifnum#1<20\relax
+ \eappto#2{\@teenthstring{\@tmpstrctr}}%
+ \else
+ \ifnum\@tmpstrctr=0\relax
+ \else
+% \end{macrocode}
+% Again, for digits ending with an `e', a trema gets added for \cs{@andname} (drieëntwintig or tweeënveertig).
+% \begin{macrocode}
+ \ifnum\@tmpstrctr=2\relax\def\@andname{ën}%
+ \else\ifnum\@tmpstrctr=3\relax\def\@andname{ën}%
+ \else\def\@andname{en}%
+ \fi\fi%
+ \eappto#2{\@unitstring{\@tmpstrctr}\@andname}%
+ \fi
+ \@tmpstrctr=#1\relax
+ \divide\@tmpstrctr by 10\relax
+ \eappto#2{\@tenthstring{\@tmpstrctr}}%
+ \fi
+ \fi
+}%
+\global\let\@@numberunderhundredthdutch\@@numberunderhundredthdutch
+% \end{macrocode}
+\iffalse Local variables: \fi
+\iffalse mode: docTeX \fi
+\iffalse End: \fi
+%\iffalse
+% \begin{macrocode}
+%</fc-dutch.def>
+% \end{macrocode}
+%\fi
+%\iffalse
+% \begin{macrocode}
%<*fc-english.def>
% \end{macrocode}
%\fi
@@ -1804,7 +2212,7 @@ this number}%
% \subsubsection{fc-french.def}
% Definitions for French.
% \begin{macrocode}
-\ProvidesFCLanguage{french}[2020/02/24]%
+\ProvidesFCLanguage{french}[2017/06/15]%
% \end{macrocode}
% Package \styfmt{fcprefix} is needed to format the prefix \meta{$n$}
% in \meta{$n$}illion or \meta{$n$}illiard. Big numbers were
@@ -3659,7 +4067,7 @@ z\'ero%
\or zwei%
\or drei%
\or vier%
- \or f\"unf%
+ \or fünf%
\or sechs%
\or sieben%
\or acht%
@@ -3674,9 +4082,9 @@ z\'ero%
\ifcase#1%
\or zehn%
\or zwanzig%
- \or drei{\ss}ig%
+ \or dreißig%
\or vierzig%
- \or f\"unfzig%
+ \or fünfzig%
\or sechzig%
\or siebzig%
\or achtzig%
@@ -3686,9 +4094,9 @@ z\'ero%
}%
\global\let\@@tenstringgerman\@@tenstringgerman
% \end{macrocode}
-% |\einhundert| is set to |einhundert| by default, user can
+% \cs{einhundert} is set to |einhundert| by default, user can
% redefine this command to just |hundert| if required, similarly
-% for |\eintausend|.
+% for \cs{eintausend}.
% \begin{macrocode}
\providecommand*{\einhundert}{einhundert}%
\providecommand*{\eintausend}{eintausend}%
@@ -3701,10 +4109,10 @@ z\'ero%
\ifcase#1%
zehn%
\or elf%
- \or zw\"olf%
+ \or zwölf%
\or dreizehn%
\or vierzehn%
- \or f\"unfzehn%
+ \or fünfzehn%
\or sechzehn%
\or siebzehn%
\or achtzehn%
@@ -3822,7 +4230,7 @@ z\'ero%
% it is easier to split it into units, tens and teens.
% Units:
%\changes{2.0}{2012-09-25}{fixed spelling mistake (correction
-%provided by Dominik Wa\ss enhoven)}
+%provided by Dominik Waß enhoven)}
% \begin{macrocode}
\newcommand*\@@unitthstringMgerman[1]{%
\ifcase#1%
@@ -3831,7 +4239,7 @@ z\'ero%
\or zweiter%
\or dritter%
\or vierter%
- \or f\"unfter%
+ \or fünfter%
\or sechster%
\or siebter%
\or achter%
@@ -3846,9 +4254,9 @@ z\'ero%
\ifcase#1%
\or zehnter%
\or zwanzigster%
- \or drei{\ss}igster%
+ \or dreißigster%
\or vierzigster%
- \or f\"unfzigster%
+ \or fünfzigster%
\or sechzigster%
\or siebzigster%
\or achtzigster%
@@ -3863,10 +4271,10 @@ z\'ero%
\ifcase#1%
zehnter%
\or elfter%
- \or zw\"olfter%
+ \or zwölfter%
\or dreizehnter%
\or vierzehnter%
- \or f\"unfzehnter%
+ \or fünfzehnter%
\or sechzehnter%
\or siebzehnter%
\or achtzehnter%
@@ -3884,7 +4292,7 @@ z\'ero%
\or zweite%
\or dritte%
\or vierte%
- \or f\"unfte%
+ \or fünfte%
\or sechste%
\or siebte%
\or achte%
@@ -3899,9 +4307,9 @@ z\'ero%
\ifcase#1%
\or zehnte%
\or zwanzigste%
- \or drei{\ss}igste%
+ \or dreißigste%
\or vierzigste%
- \or f\"unfzigste%
+ \or fünfzigste%
\or sechzigste%
\or siebzigste%
\or achtzigste%
@@ -3916,10 +4324,10 @@ z\'ero%
\ifcase#1%
zehnte%
\or elfte%
- \or zw\"olfte%
+ \or zwölfte%
\or dreizehnte%
\or vierzehnte%
- \or f\"unfzehnte%
+ \or fünfzehnte%
\or sechzehnte%
\or siebzehnte%
\or achtzehnte%
@@ -3939,7 +4347,7 @@ z\'ero%
\or zweites%
\or drittes%
\or viertes%
- \or f\"unftes%
+ \or fünftes%
\or sechstes%
\or siebtes%
\or achtes%
@@ -3954,9 +4362,9 @@ z\'ero%
\ifcase#1%
\or zehntes%
\or zwanzigstes%
- \or drei{\ss}igstes%
+ \or dreißigstes%
\or vierzigstes%
- \or f\"unfzigstes%
+ \or fünfzigstes%
\or sechzigstes%
\or siebzigstes%
\or achtzigstes%
@@ -3971,10 +4379,10 @@ z\'ero%
\ifcase#1%
zehntes%
\or elftes%
- \or zw\"olftes%
+ \or zwölftes%
\or dreizehntes%
\or vierzehntes%
- \or f\"unfzehntes%
+ \or fünfzehntes%
\or sechzehntes%
\or siebzehntes%
\or achtzehntes%
@@ -4257,42 +4665,79 @@ z\'ero%
\RequirePackage{itnumpar}
\newcommand{\@numberstringMitalian}[2]{%
- \edef#2{\noexpand\printnumeroinparole{#1}}%
+ \begingroup
+ \def\np@oa{o}%
+ \count@=#1
+ \edef\@tempa{\def\noexpand#2{\@numeroinparole{\count@}}}%
+ \expandafter
+ \endgroup\@tempa
}
\global\let\@numberstringMitalian\@numberstringMitalian
\newcommand{\@numberstringFitalian}[2]{%
- \edef#2{\noexpand\printnumeroinparole{#1}}}
+ \begingroup
+ \def\np@oa{a}%
+ \count@=#1
+ \edef\@tempa{\def\noexpand#2{\@numeroinparole{\count@}}}%
+ \expandafter
+ \endgroup\@tempa
+}
\global\let\@numberstringFitalian\@numberstringFitalian
\newcommand{\@NumberstringMitalian}[2]{%
- \edef#2{\noexpand\printNumeroinparole{#1}}%
+ \begingroup
+ \def\np@oa{o}%
+ \count@=#1
+ \edef\@tempa{\def\noexpand#2{\@Numeroinparole{\count@}}}%
+ \expandafter
+ \endgroup\@tempa
}
\global\let\@NumberstringMitalian\@NumberstringMitalian
\newcommand{\@NumberstringFitalian}[2]{%
- \edef#2{\noexpand\printNumeroinparole{#1}}%
+ \begingroup
+ \def\np@oa{a}%
+ \count@=#1
+ \edef\@tempa{\def\noexpand#2{\@Numeroinparole{\count@}}}%
+ \expandafter
+ \endgroup\@tempa
}
\global\let\@NumberstringFitalian\@NumberstringFitalian
\newcommand{\@ordinalstringMitalian}[2]{%
- \edef#2{\noexpand\printordinalem{#1}}%
+ \begingroup
+ \count@=#1
+ \edef\@tempa{\def\noexpand#2{\@ordinalem{\count@}}}%
+ \expandafter
+ \endgroup\@tempa
}
\global\let\@ordinalstringMitalian\@ordinalstringMitalian
\newcommand{\@ordinalstringFitalian}[2]{%
- \edef#2{\noexpand\printordinalef{#1}}%
+ \begingroup
+ \count@=#1
+ \edef\@tempa{\def\noexpand#2{\@ordinalef{\count@}}}%
+ \expandafter
+ \endgroup\@tempa
}
\global\let\@ordinalstringFitalian\@ordinalstringFitalian
\newcommand{\@OrdinalstringMitalian}[2]{%
- \edef#2{\noexpand\printOrdinalem{#1}}%
+ \begingroup
+ \count@=#1
+ \edef\@tempa{\def\noexpand#2{\@Ordinalem{\count@}}}%
+ \expandafter
+ \endgroup\@tempa
}
\global\let\@OrdinalstringMitalian\@OrdinalstringMitalian
\newcommand{\@OrdinalstringFitalian}[2]{%
- \edef#2{\noexpand\printOrdinalef{#1}}%
+ \begingroup
+ \count@=#1
+ \edef\@tempa{\def\noexpand#2{\@Ordinalef{\count@}}}%
+ \expandafter
+ \endgroup\@tempa
}
\global\let\@OrdinalstringFitalian\@OrdinalstringFitalian
@@ -5348,7 +5793,7 @@ this number}%
\or trece%
\or catorce%
\or quince%
- \or diecis\'eis%
+ \or dieciséis%
\or diecisiete%
\or dieciocho%
\or diecinueve%
@@ -5362,11 +5807,11 @@ this number}%
\ifcase#1\relax
veinte%
\or veintiuno%
- \or veintid\'os%
- \or veintitr\'es%
+ \or veintidós%
+ \or veintitrés%
\or veinticuatro%
\or veinticinco%
- \or veintis\'eis%
+ \or veintiséis%
\or veintisiete%
\or veintiocho%
\or veintinueve%
@@ -5380,11 +5825,11 @@ this number}%
\ifcase#1\relax
veinte%
\or veintiuna%
- \or veintid\'os%
- \or veintitr\'es%
+ \or veintidós%
+ \or veintitrés%
\or veinticuatro%
\or veinticinco%
- \or veintis\'eis%
+ \or veintiséis%
\or veintisiete%
\or veintiocho%
\or veintinueve%
@@ -5492,7 +5937,7 @@ this number}%
\or Trece%
\or Catorce%
\or Quince%
- \or Diecis\'eis%
+ \or Dieciséis%
\or Diecisiete%
\or Dieciocho%
\or Diecinueve%
@@ -5506,11 +5951,11 @@ this number}%
\ifcase#1\relax
Veinte%
\or Veintiuno%
- \or Veintid\'os%
- \or Veintitr\'es%
+ \or Veintidós%
+ \or Veintitrés%
\or Veinticuatro%
\or Veinticinco%
- \or Veintis\'eis%
+ \or Veintiséis%
\or Veintisiete%
\or Veintiocho%
\or Veintinueve%
@@ -5524,11 +5969,11 @@ this number}%
\ifcase#1\relax
Veinte%
\or Veintiuna%
- \or Veintid\'os%
- \or Veintitr\'es%
+ \or Veintidós%
+ \or Veintitrés%
\or Veinticuatro%
\or Veinticinco%
- \or Veintis\'eis%
+ \or Veintiséis%
\or Veintisiete%
\or Veintiocho%
\or Veintinueve%
@@ -5657,7 +6102,7 @@ this number}%
\let\@teenthstring=\@@teenthstringspanish
\let\@tenthstring=\@@tenthstringspanish
\let\@hundredthstring=\@@hundredthstringspanish
- \def\@thousandth{mil\'esimo}%
+ \def\@thousandth{milésimo}%
\@@ordinalstringspanish{#1}{#2}%
}%
\global\let\@ordinalstringMspanish\@ordinalstringMspanish
@@ -5670,7 +6115,7 @@ this number}%
\let\@teenthstring=\@@teenthstringFspanish
\let\@tenthstring=\@@tenthstringFspanish
\let\@hundredthstring=\@@hundredthstringFspanish
- \def\@thousandth{mil\'esima}%
+ \def\@thousandth{milésima}%
\@@ordinalstringspanish{#1}{#2}%
}%
\global\let\@ordinalstringFspanish\@ordinalstringFspanish
@@ -5687,7 +6132,7 @@ this number}%
\let\@teenthstring=\@@Teenthstringspanish
\let\@tenthstring=\@@Tenthstringspanish
\let\@hundredthstring=\@@Hundredthstringspanish
- \def\@thousandth{Mil\'esimo}%
+ \def\@thousandth{Milésimo}%
\@@ordinalstringspanish{#1}{#2}%
}
\global\let\@OrdinalstringMspanish\@OrdinalstringMspanish
@@ -5700,7 +6145,7 @@ this number}%
\let\@teenthstring=\@@TeenthstringFspanish
\let\@tenthstring=\@@TenthstringFspanish
\let\@hundredthstring=\@@HundredthstringFspanish
- \def\@thousandth{Mil\'esima}%
+ \def\@thousandth{Milésima}%
\@@ordinalstringspanish{#1}{#2}%
}%
\global\let\@OrdinalstringFspanish\@OrdinalstringFspanish
@@ -5722,7 +6167,7 @@ this number}%
\or cuarto%
\or quinto%
\or sexto%
- \or s\'eptimo%
+ \or séptimo%
\or octavo%
\or noveno%
\fi
@@ -5733,15 +6178,15 @@ this number}%
% \begin{macrocode}
\newcommand*\@@tenthstringspanish[1]{%
\ifcase#1\relax
- \or d\'ecimo%
- \or vig\'esimo%
- \or trig\'esimo%
- \or cuadrag\'esimo%
- \or quincuag\'esimo%
- \or sexag\'esimo%
- \or septuag\'esimo%
- \or octog\'esimo%
- \or nonag\'esimo%
+ \or décimo%
+ \or vigésimo%
+ \or trigésimo%
+ \or cuadragésimo%
+ \or quincuagésimo%
+ \or sexagésimo%
+ \or septuagésimo%
+ \or octogésimo%
+ \or nonagésimo%
\fi
}%
\global\let\@@tenthstringspanish\@@tenthstringspanish
@@ -5750,14 +6195,14 @@ this number}%
% \begin{macrocode}
\newcommand*\@@teenthstringspanish[1]{%
\ifcase#1\relax
- d\'ecimo%
- \or und\'ecimo%
- \or duod\'ecimo%
+ décimo%
+ \or undécimo%
+ \or duodécimo%
\or decimotercero%
\or decimocuarto%
\or decimoquinto%
\or decimosexto%
- \or decimos\'eptimo%
+ \or decimoséptimo%
\or decimoctavo%
\or decimonoveno%
\fi
@@ -5768,15 +6213,15 @@ this number}%
% \begin{macrocode}
\newcommand*\@@hundredthstringspanish[1]{%
\ifcase#1\relax
- \or cent\'esimo%
- \or ducent\'esimo%
- \or tricent\'esimo%
- \or cuadringent\'esimo%
- \or quingent\'esimo%
- \or sexcent\'esimo%
- \or septing\'esimo%
- \or octingent\'esimo%
- \or noningent\'esimo%
+ \or centésimo%
+ \or ducentésimo%
+ \or tricentésimo%
+ \or cuadringentésimo%
+ \or quingentésimo%
+ \or sexcentésimo%
+ \or septingésimo%
+ \or octingentésimo%
+ \or noningentésimo%
\fi
}%
\global\let\@@hundredthstringspanish\@@hundredthstringspanish
@@ -5792,7 +6237,7 @@ this number}%
\or cuarta%
\or quinta%
\or sexta%
- \or s\'eptima%
+ \or séptima%
\or octava%
\or novena%
\fi
@@ -5803,15 +6248,15 @@ this number}%
% \begin{macrocode}
\newcommand*\@@tenthstringFspanish[1]{%
\ifcase#1\relax
- \or d\'ecima%
- \or vig\'esima%
- \or trig\'esima%
- \or cuadrag\'esima%
- \or quincuag\'esima%
- \or sexag\'esima%
- \or septuag\'esima%
- \or octog\'esima%
- \or nonag\'esima%
+ \or décima%
+ \or vigésima%
+ \or trigésima%
+ \or cuadragésima%
+ \or quincuagésima%
+ \or sexagésima%
+ \or septuagésima%
+ \or octogésima%
+ \or nonagésima%
\fi
}%
\global\let\@@tenthstringFspanish\@@tenthstringFspanish
@@ -5820,14 +6265,14 @@ this number}%
% \begin{macrocode}
\newcommand*\@@teenthstringFspanish[1]{%
\ifcase#1\relax
- d\'ecima%
- \or und\'ecima%
- \or duod\'ecima%
+ décima%
+ \or undécima%
+ \or duodécima%
\or decimotercera%
\or decimocuarta%
\or decimoquinta%
\or decimosexta%
- \or decimos\'eptima%
+ \or decimoséptima%
\or decimoctava%
\or decimonovena%
\fi
@@ -5838,15 +6283,15 @@ this number}%
% \begin{macrocode}
\newcommand*\@@hundredthstringFspanish[1]{%
\ifcase#1\relax
- \or cent\'esima%
- \or ducent\'esima%
- \or tricent\'esima%
- \or cuadringent\'esima%
- \or quingent\'esima%
- \or sexcent\'esima%
- \or septing\'esima%
- \or octingent\'esima%
- \or noningent\'esima%
+ \or centésima%
+ \or ducentésima%
+ \or tricentésima%
+ \or cuadringentésima%
+ \or quingentésima%
+ \or sexcentésima%
+ \or septingésima%
+ \or octingentésima%
+ \or noningentésima%
\fi
}%
\global\let\@@hundredthstringFspanish\@@hundredthstringFspanish
@@ -5862,7 +6307,7 @@ this number}%
\or Cuarto%
\or Quinto%
\or Sexto%
- \or S\'eptimo%
+ \or Séptimo%
\or Octavo%
\or Noveno%
\fi
@@ -5873,15 +6318,15 @@ this number}%
% \begin{macrocode}
\newcommand*\@@Tenthstringspanish[1]{%
\ifcase#1\relax
- \or D\'ecimo%
- \or Vig\'esimo%
- \or Trig\'esimo%
- \or Cuadrag\'esimo%
- \or Quincuag\'esimo%
- \or Sexag\'esimo%
- \or Septuag\'esimo%
- \or Octog\'esimo%
- \or Nonag\'esimo%
+ \or Décimo%
+ \or Vigésimo%
+ \or Trigésimo%
+ \or Cuadragésimo%
+ \or Quincuagésimo%
+ \or Sexagésimo%
+ \or Septuagésimo%
+ \or Octogésimo%
+ \or Nonagésimo%
\fi
}%
\global\let\@@Tenthstringspanish\@@Tenthstringspanish
@@ -5890,14 +6335,14 @@ this number}%
% \begin{macrocode}
\newcommand*\@@Teenthstringspanish[1]{%
\ifcase#1\relax
- D\'ecimo%
- \or Und\'ecimo%
- \or Duod\'ecimo%
+ Décimo%
+ \or Undécimo%
+ \or Duodécimo%
\or Decimotercero%
\or Decimocuarto%
\or Decimoquinto%
\or Decimosexto%
- \or Decimos\'eptimo%
+ \or Decimoséptimo%
\or Decimoctavo%
\or Decimonoveno%
\fi
@@ -5908,15 +6353,15 @@ this number}%
% \begin{macrocode}
\newcommand*\@@Hundredthstringspanish[1]{%
\ifcase#1\relax
- \or Cent\'esimo%
- \or Ducent\'esimo%
- \or Tricent\'esimo%
- \or Cuadringent\'esimo%
- \or Quingent\'esimo%
- \or Sexcent\'esimo%
- \or Septing\'esimo%
- \or Octingent\'esimo%
- \or Noningent\'esimo%
+ \or Centésimo%
+ \or Ducentésimo%
+ \or Tricentésimo%
+ \or Cuadringentésimo%
+ \or Quingentésimo%
+ \or Sexcentésimo%
+ \or Septingésimo%
+ \or Octingentésimo%
+ \or Noningentésimo%
\fi
}%
\global\let\@@Hundredthstringspanish\@@Hundredthstringspanish
@@ -5932,7 +6377,7 @@ this number}%
\or Cuarta%
\or Quinta%
\or Sexta%
- \or S\'eptima%
+ \or Séptima%
\or Octava%
\or Novena%
\fi
@@ -5943,15 +6388,15 @@ this number}%
% \begin{macrocode}
\newcommand*\@@TenthstringFspanish[1]{%
\ifcase#1\relax
- \or D\'ecima%
- \or Vig\'esima%
- \or Trig\'esima%
- \or Cuadrag\'esima%
- \or Quincuag\'esima%
- \or Sexag\'esima%
- \or Septuag\'esima%
- \or Octog\'esima%
- \or Nonag\'esima%
+ \or Décima%
+ \or Vigésima%
+ \or Trigésima%
+ \or Cuadragésima%
+ \or Quincuagésima%
+ \or Sexagésima%
+ \or Septuagésima%
+ \or Octogésima%
+ \or Nonagésima%
\fi
}%
\global\let\@@TenthstringFspanish\@@TenthstringFspanish
@@ -5960,14 +6405,14 @@ this number}%
% \begin{macrocode}
\newcommand*\@@TeenthstringFspanish[1]{%
\ifcase#1\relax
- D\'ecima%
- \or Und\'ecima%
- \or Duod\'ecima%
+ Décima%
+ \or Undécima%
+ \or Duodécima%
\or Decimotercera%
\or Decimocuarta%
\or Decimoquinta%
\or Decimosexta%
- \or Decimos\'eptima%
+ \or Decimoséptima%
\or Decimoctava%
\or Decimonovena%
\fi
@@ -5978,15 +6423,15 @@ this number}%
% \begin{macrocode}
\newcommand*\@@HundredthstringFspanish[1]{%
\ifcase#1\relax
- \or Cent\'esima%
- \or Ducent\'esima%
- \or Tricent\'esima%
- \or Cuadringent\'esima%
- \or Quingent\'esima%
- \or Sexcent\'esima%
- \or Septing\'esima%
- \or Octingent\'esima%
- \or Noningent\'esima%
+ \or Centésima%
+ \or Ducentésima%
+ \or Tricentésima%
+ \or Cuadringentésima%
+ \or Quingentésima%
+ \or Sexcentésima%
+ \or Septingésima%
+ \or Octingentésima%
+ \or Noningentésima%
\fi
}%
\global\let\@@HundredthstringFspanish\@@HundredthstringFspanish
@@ -7486,7 +7931,7 @@ this number}%
% This section deals with the code for |fmtcount.sty|
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{fmtcount}[2020/01/30 v3.07]
+\ProvidesPackage{fmtcount}[2024/08/31 v3.08]
\RequirePackage{ifthen}
% \end{macrocode}
% \changes{3.01}{2014/12/03}{Use \styfmt{xkeyval} instead of \styfmt{keyval}, so that we do not get in trouble
@@ -7660,7 +8105,8 @@ german,%
germanb,%
ngerman,%
ngermanb,%
-italian}
+italian,%
+dutch}
% \end{macrocode}
%\end{macro}
%\begin{macro}{\fc@iterate@on@languages}
@@ -9102,7 +9548,7 @@ italian}
\protect\@numberstringM{#1}{\@fc@numstr}%
}%
}%
- \MakeUppercase{\@fc@numstr}%
+ \protect\MakeUppercase{\@fc@numstr}%
}%
}
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/fmtcount/fmtcount.ins b/Master/texmf-dist/source/latex/fmtcount/fmtcount.ins
index 1c31d8f0aa0..f1e5ccdbdbe 100644
--- a/Master/texmf-dist/source/latex/fmtcount/fmtcount.ins
+++ b/Master/texmf-dist/source/latex/fmtcount/fmtcount.ins
@@ -1,10 +1,10 @@
-% fmtcount.ins generated using makedtx version 1.2 2020/2/24 20:03
+% fmtcount.ins generated using makedtx version 1.2 2024/8/31 14:57
\input docstrip
\preamble
fmtcount.dtx
- Copyright 2020 Nicola Talbot and Vincent Belache
+ Copyright 2024 Nicola Talbot and Vincent Belaïche
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
@@ -16,9 +16,9 @@
This work has the LPPL maintenance status `maintained'.
- The Current Maintainer of this work is Nicola Talbot and Vincent Belache.
+ The Current Maintainer of this work is Nicola Talbot and Vincent Belaïche.
- This work consists of the files fmtcount.dtx and fmtcount.ins and the derived files fc-american.def, fc-brazilian.def, fc-british.def, fc-english.def, fc-francais.def, fc-french.def, fc-frenchb.def, fc-german.def, fc-germanb.def, fc-italian.def, fc-ngerman.def, fc-ngermanb.def, fc-portuges.def, fc-portuguese.def, fc-spanish.def, fc-UKenglish.def, fc-USenglish.def, fcnumparser.sty, fcprefix.sty, fmtcount.sty.
+ This work consists of the files fmtcount.dtx and fmtcount.ins and the derived files fc-american.def, fc-brazilian.def, fc-british.def, fc-dutch.def, fc-english.def, fc-francais.def, fc-french.def, fc-frenchb.def, fc-german.def, fc-germanb.def, fc-italian.def, fc-ngerman.def, fc-ngermanb.def, fc-portuges.def, fc-portuguese.def, fc-spanish.def, fc-UKenglish.def, fc-USenglish.def, fcnumparser.sty, fcprefix.sty, fmtcount.sty.
\endpreamble
@@ -30,6 +30,8 @@
\usepostamble\defaultpostamble\from{fmtcount.dtx}{fc-brazilian.def,package}}
\file{fc-british.def}{\usepreamble\defaultpreamble
\usepostamble\defaultpostamble\from{fmtcount.dtx}{fc-british.def,package}}
+\file{fc-dutch.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{fmtcount.dtx}{fc-dutch.def,package}}
\file{fc-english.def}{\usepreamble\defaultpreamble
\usepostamble\defaultpostamble\from{fmtcount.dtx}{fc-english.def,package}}
\file{fc-francais.def}{\usepreamble\defaultpreamble
diff --git a/Master/texmf-dist/source/latex/framedsyntax/FramedSyntax.dtx b/Master/texmf-dist/source/latex/framedsyntax/FramedSyntax.dtx
new file mode 100644
index 00000000000..7a7fba17b3e
--- /dev/null
+++ b/Master/texmf-dist/source/latex/framedsyntax/FramedSyntax.dtx
@@ -0,0 +1,930 @@
+% \iffalse
+% !TEX encoding = UTF-8 Unicode
+%<*internal>
+\begingroup
+\input docstrip.tex
+\keepsilent
+\preamble
+
+ Copyright (C) 2024 Claudio Beccari all rights reserved.
+
+ Distributable under the LaTeX Project Public License,
+ version 1.3c or higher (your choice). The latest version of
+ this license is at: http://www.latex-project.org/lppl.txt
+
+\endpreamble
+\postamble
+This Work has the status of `maintained'
+
+The Current Maintainer is Claudio Beccari
+
+This work consists of this file FramedSyntax.dtx,
+and the derived files FramedSyntax.sty and FramedSyntax.pdf.
+\endpostamble
+
+\askforoverwritefalse
+
+\generate{\file{FramedSyntax.sty}{\from{FramedSyntax.dtx}{package}}}
+
+\def\tmpa{plain}
+\ifx\tmpa\fmtname\endgroup\expandafter\bye\fi
+\endgroup
+%</internal>
+% \fi
+%
+% \iffalse
+%<*driver>
+\ProvidesFile{FramedSyntax.dtx}%
+%</driver>
+%<package>\NeedsTeXFormat{LaTeX2e}[2019/01/01]
+%<package>\ProvidesPackage{FramedSyntax}%
+ [2024-09-04 v.0.2.8 Typeset command syntax within a special frame]
+%<*driver>
+\documentclass{ltxdoc}\errorcontextlines=100
+\hfuzz 10pt
+\usepackage[utf8]{inputenc}% not really necessary
+\usepackage{lmodern}% scalable fonts
+\usepackage{mflogo}
+\usepackage{multicol, amsmath, fancyvrb, graphicx, verbatim}
+\usepackage{etoolbox, enumitem, xspace, xcolor, FramedSyntax
+}
+%
+\providecommand*\diff{\mathop{}\!\mathrm{d}}
+\providecommand\file{}
+\renewcommand*\file[1]{{\normalfont\texttt{#1}}}
+\providecommand\prog{}
+\renewcommand*\prog[1]{{\normalfont\texttt{#1}}}
+\providecommand\conta{}
+\renewcommand*\conta[1]{\texttt{\slshape#1}}
+\providecommand\cs{}
+\renewcommand\cs[1]{{\normalfont\texttt{\char92#1}}}
+\renewcommand\meta[1]{{\normalfont\textlangle\textit{#1}\textrangle}}
+\renewcommand\marg[1]{\texttt{\{\meta{#1}\}}}
+\providecommand\Marg{}
+\renewcommand*\Marg[1]{\texttt{\{#1\}}}
+\providecommand\oarg{}
+\renewcommand*\oarg[1]{\texttt{[\meta{#1}]}}
+\providecommand\Oarg{}
+\renewcommand*\Oarg[1]{\texttt{[#1]}}
+\providecommand\aarg{}
+\renewcommand*\aarg[1]{\texttt{<\meta{#1}>}}
+\providecommand\Aarg{}
+\renewcommand*\Aarg[1]{\texttt{<#1>}}
+\providecommand\parg{}
+\renewcommand*\parg[1]{\texttt{(\meta{#1})}}
+\providecommand\Parg{}
+\renewcommand*\Parg[1]{\texttt{(#1)}}
+\providecommand\pack{}
+\renewcommand*\pack[1]{{\textsf{#1}}}
+\let\class\pack
+\providecommand\opt{}
+\renewcommand*\opt[1]{{\normalfont\textsl{#1}}}\let\opz\opt
+\providecommand\env{}
+\renewcommand*\env[1]{{\normalfont\textit{\bfseries#1}}}\let\amb\env
+
+\providecommand\TB{\mbox{\normalfont\slshape TUGboat}\xspace}
+
+\definecolor{verdeguit}{rgb}{0, 0.40, 0}
+\def\GuIT{\mbox{\color{verdeguit}\def\I{\textcolor{black}{I}}%
+ \fontfamily{lmr}\fontseries{m}\fontshape{sc}\selectfont
+g\raisebox{-0.715ex}{\kern-0.26em u}\kern-0.13em\I\kern-0.14em t}\xspace}
+\RequirePackage{etoolbox}
+
+\makeatletter
+
+\AfterEndPreamble{%
+\DeclareRobustCommand{\TeX}{T\kern-.1667em
+ \lower.5ex\hbox{E}\kern-.125emX\@\xspace}% \TeX
+\DeclareRobustCommand{\LaTeX}{L\kern-.36em%
+ {\sbox\z@ T%
+ \vbox to\ht\z@{\hbox{\check@mathfonts
+ \fontsize\sf@size\z@
+ \math@fontsfalse\selectfont
+ A}%
+ \vss}%
+ }%
+ \kern-.15em\TeX
+ }%
+\DeclareRobustCommand{\LaTeXe}{L\kern-.36em%
+ {\sbox\z@ T%
+ \vbox to\ht\z@{\hbox{\check@mathfonts
+ \fontsize\sf@size\z@
+ \math@fontsfalse\selectfont
+ A}%
+ \vss}%
+ }%
+ \kern-.15em\TeX\kern-0.3em$_{\textstyle\mathrm{2e}}$
+ }%
+}
+\makeatother
+
+\DeclareRobustCommand*\TeXLive{\TeX\ Live\xspace}
+\DeclareRobustCommand*\MikTeX{Mik\TeX}
+\DeclareRobustCommand*\MacTeX{Mac\TeX}
+\DeclareRobustCommand*\pdfLaTeX{pdf\/\LaTeX}
+\DeclareRobustCommand*\LuaLaTeX{Lua\LaTeX}
+\DeclareRobustCommand*\XeLaTeX{X\ifdim\fontdimen1\font=0pt
+ \kern-0.15em\fi\lower.5ex\hbox{\rotatebox[origin=c]{180}{E}}%
+ \ifdim\fontdimen1\font=0pt\kern-0.15em\else\kern-0.275em\fi
+ \LaTeX}
+\DeclareRobustCommand*\TikZ{Ti\emph{k}Z\xspace}
+
+%\unless\ifcsname Gr@phGrid\endcsname
+%\let\originalGraphGrid\GraphGrid
+%\RenewDocumentCommand\GraphGrid{r() d()}{%
+%\IfValueTF{#1}{\put(#1){\originalGraphGrid(#2)}}%
+% {\put(0,0){\originalGraphGrid(#2)}}}\fi
+
+\begin{document}\errorcontextlines=100
+\GetFileInfo{FramedSyntax.dtx}
+\title{The \textsf{FramedSyntax} package}
+\author{Claudio Beccari\\[1ex]\texttt{claudio.beccari(at)gmail.com}}
+\date{Version \fileversion~--~Last revised \filedate.}
+\maketitle
+\columnseprule=0.4pt
+\begin{multicols}{2}
+ \tableofcontents
+ \end{multicols}
+ \DocInput{FramedSyntax.dtx}
+\end{document}
+%</driver>
+% \fi
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \section*{Preface}
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% The \pack{FramedSyntax} package contains the necessary code to
+% implement a framed block of text that is emphasised compared to
+% the normal text. I found this technique very handy for writing
+% the documented \TeX files that describe the new packages that
+% I create, and the user manuals of those packages. As a member
+% of the Italian Tug I also wrote a number of thematic guides for
+% the Italian users; they seem to appreciate that the syntax of
+% \LaTeX, classes and packages are written with these framed
+% emphasised blocks, clearly emerging form the surrounding text.
+%
+% This is why I would like to share my package with the other
+% \TeX users. May be they would like to use the same approach.
+% I perfectly know that there are other packages and classes to
+% write down documented \TeX files, such as those that
+% traditionally have a \file{.dtx} file extension. Some of them
+% are really powerful; I wonder why I keep using the
+% \pack{docstrip.tex} file and the \class{ltxdoc} class to write
+% down my documented \TeX files. The first simplest answer is
+% “Because I am used to it”. The second is “Because I don't like
+% to use too powerful packages, such as, for example,
+% \pack{tikz}”; this package is a beautiful one, extremely
+% powerful, but it is memory consuming, and computer blocking
+% due to exhausted \TeX working memory occurred to me more often
+% than I could stand.
+%
+% Dear User: if you do not like the name \pack{FramedSyntax}
+% downloaded with a full and updated TeX System installation,
+% copy this file to your local \texttt{texmf} directory, and
+% change the file name to another name that fits your
+% preferences. Never change the names of the \TeX System files
+% even if you have the administrator privileges. In any case,
+% since this work was inspired by a style file of mine written
+% in Italian, this package already contains an alias
+% \amb{Sintassi} environment with the Italian name.
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\section{What the \pack{FramedSyntax.sty} package can do}
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% The user can use this package and can specify the package
+% options; these include the colours
+% of the frame, the text, the background; the frame thickness and
+% colour; the frame-text gap; the text font family, series,
+% shape, and size. These settings can be global or local,
+% therefore you can select some of these settings for specific
+% syntax instances.
+%
+% Most often than not, you'll be using the default text fonts for
+% the whole document. Please do not use the old Computer Modern
+% fonts; they are not scalable, but may be chosen at a discrete
+% set of sizes. The Latin Modern ones are stepwise continuously
+% scalable, thanks to the scalable optical sizes they are built
+% with. Other fonts, such as the Times, the Palatino, the
+% Libertinus ones, and many others are continuously scalable
+% over wide ranges.
+%
+% While describing and commenting the code, you will read more
+% detailed comments on such font issues.
+%
+% In general the syntax frame fills up the whole \cs{textwidth};
+% in reality it should fill up the current \cs{linewidth};
+% within a list this frame will be shorter and indented as the
+% list text.
+%
+% This framed syntax box will not split across a page break;
+% matter of facts, the next section example height is too large
+% to fit in the page, and a large white vertical space filled
+% this page, in order to have the framed box completely in within
+% the next section. If you need long framed texts, you should
+% preferably use the \pack{tcolorbox} package (which relies on
+% the extremely powerful \pack{tikz} one) and performs much
+% better than my simple package, in particular it can split its
+% boxes across page breaks.
+%
+% Warning: This small package does similar things as the
+% \pack{wrapfig2} package, but such packages are not supposed
+% to interfere with each other.
+%
+% \begin{FramedSyntax}
+% \texttt{\% !TEX TS-program = } \meta{LaTeX based compiler}
+% \texttt{\% !TEX encoding = UTF-8 Unicode}
+% ~
+% \cs{documentclass}\oarg{options}\marg{class}
+% \dots\ \meta{Packages}
+% \cs{usepackage}\oarg{key=value options}\Marg{FramedSyntax}
+% \dots\ \meta{Other packages}
+% ~
+% \cs{begin}\Marg{document}
+% \dots\ \meta{A part of document body}
+% \cs{begin}\Marg{FramedSyntax}
+% \dots\ \meta{Some syntax lines}
+% \cs{end}\Marg{FramedSyntax}
+% \dots\ \meta{Further document body}
+% ~
+% \cs{end}\Marg{document}
+% \end{FramedSyntax}
+%
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\section{Usage example}
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% The above framed syntax box contains a sample for using
+% this package.\footnote{You may notice that the framed box width
+% is a little shorter than the \cs{linewidth}, exactly 10\,pt
+% shorter. This happens with this particular documentation class
+% \class{ltxdoc}: I was not able to find the cause, but
+% several tests with other classes proved to perform as
+% expected.}
+%
+% In order to use this package a user should use this syntax.
+% The above elementary example was done with the following
+% source code.
+%\begin{Verbatim}[gobble=1]
+% \begin{FramedSyntax}
+% \texttt{\% !TEX TS-program = } \meta{LaTeX based compiler}
+% \texttt{\% !TEX encoding = UTF-8 Unicode}
+% ~
+% \cs{documentclass}\oarg{options}\marg{class}
+% \dots\ \meta{Packages}
+% \cs{usepackage}\oarg{key=value options}\Marg{FramedSyntax}
+% \dots\ \meta{Other packages}
+% ~
+% \cs{begin}\Marg{document}
+% \dots\ \meta{A part of document body}
+% \cs{begin}\Marg{FramedSyntax}
+% \dots\ \meta{Some syntax lines}
+% \cs{end}\Marg{FramedSyntax}
+% \dots\ \meta{Further document body}
+% ~
+% \cs{end}\Marg{document}
+% \end{FramedSyntax}
+%\end{Verbatim}
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\section{Indexing}
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% The syntax macros can send their arguments to an \file{.idx}
+% file. If package \pack{imakeidx} is loaded in the preamble
+% and the \cs{makeindex} macro (with its own options) is used
+% to activate the indexing process, the index is created
+% without the need of manually running the necessary programs
+% to transform the information collected into the \file{.idx}
+% to the proper code into the \file{.ind} file.
+%
+% For example the following source code
+%\begin{Verbatim}[gobble=1]
+% % !TEX TS-program = pdflatex
+% % !TEX encoding = UTF-8 Unicode
+% \documentclass[12pt]{article}
+% \usepackage{imakeidx}\makeindex
+% \usepackage{FramedSyntax}
+% \usepackage{kantlipsum}
+%
+% \begin{document}
+% \kant[1]
+% \begin{FramedSyntax}
+% \cs{Large}
+% \end{FramedSyntax}
+%
+% \kant[2-3]
+% \begin{FramedSyntax}
+% \cs{small}
+% \end{FramedSyntax}
+%
+% \kant[4]
+%
+% \printindex
+%
+% \end{document}
+%\end{Verbatim}
+% produces a three page article containing dummy test,
+% with a framed syntax box in each page. Both framed commands,
+% introduced by means of the \cs{cs} command, are listed in the
+% third page, correctly pointung to page~1 end page~2.
+% Users are suggested to copy the above short code, save it in a
+% testing \file{.tex} file, and compile it with \prog{pdfLaTeX};
+% with just one run the file gets compiled together with its
+% index.
+%
+% \CheckSum{650}
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\StopEventually{}
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\section{The documented code}
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Here the package code is defined and commented.
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\subsection{The necessary packages}
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%\pack{FramedSyntax} relies on a number of other packages;
+% they are the following:
+% \begin{macrocode}
+\IfPackageLoadedF{pict2e}{\RequirePackage{pict2e}}
+\IfPackageLoadedF{etoolbox}{\RequirePackage{etoolbox}}
+\IfPackageLoadedF{xkeyval}{\RequirePackage{xkeyval}}
+\IfPackageLoadedF{xcolor}{\RequirePackage{xcolor}}
+%
+% \end{macrocode}
+% The last three packages are loadeed for obvious reasons, since
+% they are connected to \LaTeX programming and the package
+% specific functionalities.
+% May be the most puzzling one is \pack{pict2e}; it is loaded in
+% order to use its low level commands used to draw the frame
+% with rounded corners, i.e. the lines and the corner arcs;
+% they can be coloured and their thickness may be specified;
+% they form closed paths that can be stroked in a specific
+% colour or filled with another specific colour.
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\subsection{The syntax macros}
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% These numerous commands are used to typeset in a specific
+% style the command arguments, the files, classes, packages,
+% options names; commands, and so on. If in any source file
+% indexing is active, each command sends the relevant information
+% to the \file{.idx} file.
+%
+% All package internal commands have names that are prefixed with
+% the string \texttt{FS}, so as to avoid conflicts with similar
+% named commands defined by other classes or packages. These are
+% not user commands, they are only for internal use. At the
+% beginning of the \amb{FramedSyntax} environment all user
+% commands (that users input without this prefix) will be let to
+% the internal commands, so that no interference exists and
+% no clash errors take place.
+%
+% Notice the non prefixed names: \cs{marg} and \cs{Marg} (and
+% its siblings): with the lower case initial letter the
+% syntax \emph{mandatory} argument is printed in italics
+% surrounded by angle brackets; with an uppercase initial letter
+% the syntax \emph{mandatory} argument is printed in teletype
+% and is not surrounded by angle brackets.
+% Similarly syntax \emph{optional} arguments are typeset within
+% square brackets but the initial letter case specifies the
+% difference between an argument to be entered by the user,
+% and an argument with a specific value.
+%
+% Since initially I wrote the package for myself, some unusual
+% object names are spelled in mixed languages: for example it is
+% evident that \texttt{marg} stands for \emph{mandatory
+% argument} without any language mixture; the Italian word
+% \texttt{stile} evidently stands for the English word
+% \emph{style}; similarly \texttt{allineamento} stands for
+% \emph{alignement}; \texttt{numeristyle} is in mixed languages
+% but obviously it stands for \emph{numbers style}; possibly the
+% only one, that may puzzle a non Italian user, is the word
+% \texttt{chiave} that stands for \emph{key}.
+%
+% Entries for a possible index are already created in such a way
+% as to use the correct language for the index in Italian or the
+% index in English. Should another user prefer to create the
+% index in a different language, such a user is free to redefine
+% in his/her document the indexing macros defined in this
+% package>
+% \begin{macrocode}
+\providecommand*\FSmeta[1]{\textnormal{$\langle$\textit{#1}$\rangle$}}
+\providecommand*\FSmarg[1]%
+ {\textnormal{\texttt{\char123}\FSmeta{#1}\texttt{\char125}}}
+\providecommand*\FSoarg[1]{\textnormal{\texttt{[}\FSmeta{#1}\texttt{]}}}
+\providecommand*\FSArg[1]{\textnormal{\texttt{\{#1\}}}}
+\let\FSMarg\FSArg
+\providecommand*\FSOarg[1]{\textnormal{\texttt{[#1]}}}
+\def\GT@splitargs#1,#2!{\def\@tempA{#1}\def\@tempB{#2}}
+\providecommand\FSgarg[1]{\textnormal{\GT@splitargs#1!\%
+ \texttt{(}\FSmeta{\@tempA}\texttt{,}\FSmeta{\@tempB}\texttt{)}}}
+\providecommand*\FScomando[1]{\textnormal{\texttt{\string#1}}}
+\providecommand*{\FScs}[1]%
+{\textnormal{\texttt{\char92#1}\index{#1@\texttt{\char92#1}|textsc}}}
+\let\FScsindex\FScs
+%
+\providecommand*\SFSambiente[2]{%
+\FScomando{\begin}\FSmarg{#1}\FSoarg{#2}\,\dots
+ \FScomando{\end}\FSmarg{#1}}
+\providecommand*\DFSambiente[3]{%
+ \FScomando{\begin}\FSmarg{#1}\FSoarg{#2}\FSoarg{#3}\,\dots
+ \FScomando{\end}\FSmarg{#1}}
+\providecommand*\BFSambiente[1]{\FScomando{\begin}\FSmarg{#1}}
+\providecommand*\EFSambiente[1]{\FScomando{\end}\FSmarg{#1}}
+\IfPackageLoadedF{cfr-lm}{\let\texttm\texttt \let\texttv\texttt}
+%
+\DeclareRobustCommand*\FSambstyle[1]{%
+ {\normalfont\textsf{\slshape#1}}}
+\DeclareRobustCommand*\FSclassstyle[1]{%
+ {\normalfont\texttv{\itshape#1}}}
+\DeclareRobustCommand*\FSfilestyle[1]{%
+ {\normalfont\texttm{\texttt{#1}}}}
+\DeclareRobustCommand*\FSpackstyle[1]{%
+ {\normalfont\texttm{\ifbool{PDFTeX}{\textit}{\itshape}{#1}}}}%
+\DeclareRobustCommand*\FSprogstyle[1]{{\normalfont\textsf{#1}}}
+\DeclareRobustCommand*\FSprog[1]{\FSprogstyle{#1}%
+\iflanguage{english}{\index{program!#1@\FSprogstyle{#1}|textsc}}%
+ {\index{programma!#1@\FSprogstyle{#1}|textsc}}}%
+\DeclareRobustCommand*\FSpack[1]{\FSpackstyle{#1}%
+\iflanguage{english}{\index{package!#1@\FSpackstyle{#1}|textsc}}%
+ {\index{pacchetto!#1@\FSpackstyle{#1}|textsc}}}
+\DeclareRobustCommand*\FSclass[1]{\FSclassstyle{#1}%
+ \iflanguage{english}{\index{class!#1@\FSclassstyle{#1}|textsc}}%
+ {\index{classe!#1@\FSclassstyle{#1}|textsc}}}%
+\DeclareRobustCommand*\file[1]{\FSfilestyle{#1}%
+ \index{file!#1@\FSfilestyle{#1}|textsc}}%
+\DeclareRobustCommand*\FSamb[1]{\FSambstyle{#1}%
+ \iflanguage{english}%
+ {\index{environment!#1@\FSambstyle{#1}|textsc}}%
+ {\index{ambiente!#1@\FSambstyle{#1}|textsc}}}%
+\DeclareRobustCommand*\FSopzstyle[1]{%
+ {\normalfont\textsf{\slshape{#1}}}}%
+\DeclareRobustCommand*\FScontastyle[1]{{\normalfont\texttm{#1}}}
+\DeclareRobustCommand*\FSstilestyle[1]{{\normalfont\texttm{#1}}}
+\DeclareRobustCommand*\FSnumeristyle[1]{{\normalfont\texttm{#1}}}
+\DeclareRobustCommand*\FSumisurastyle[1]{{\normalfont\texttm{#1}}}
+\DeclareRobustCommand*\FSchiavestyle[1]{{\normalfont\texttm{#1}}}
+\DeclareRobustCommand*\FSdescrittorestyle[1]{{\normalfont\texttm{#1}}}
+\DeclareRobustCommand*\FSposizionestyle[1]{{\normalfont\texttm{#1}}}
+\DeclareRobustCommand*\FSallineamentostyle[1]{{\normalfont\texttm{#1}}}
+%
+\DeclareRobustCommand*\FSopz[1]{\opzstyle{#1}%
+ \iflanguage{english}{\index{option!#1@\FSopzstyle{#1}|textsc}}%
+ {\index{opzione!#1@\opzstyle{#1}|textsc}}}%
+\DeclareRobustCommand*\FSconta[1]{\Fcontastyle{#1}%
+ \iflanguage{english}{\index{counter!#1@\FScontastyle{#1}|textsc}}%
+ {\index{contatore!#1@\FScontastyle{#1}|textsc}}}
+\DeclareRobustCommand*\FSstile[1]{\FSstilestyle{#1}%
+ \iflanguage{english}{\index{page style!#1@\FSstilestyle{#1}|textsc}}%
+ {\index{stile della pagina!#1@\FSstilestyle{#1}|textsc}}}
+\DeclareRobustCommand*\FSnumeri[1]{\FSnumeristyle{#1}%
+ \iflanguage{english}{\index{numbering!#1@\FSnumeristyle{#1}|textsc}}%
+ {\index{numerazione!#1@\FSnumeristyle{#1}|textsc}}}
+\DeclareRobustCommand*\FSumisura[1]{\FSumisurastyle{#1}%
+ \iflanguage{english}{measuring unit!#1@\FSumisurastyle{#1}|textsc}%
+ {\index{unità di misura!#1@\FSumisurastyle{#1}|textsc}}}
+\DeclareRobustCommand*\FSchiave[1]{\FSchiavestyle{#1}%
+ \iflanguage{english}{\index{key!#1@\FSchiavestyle{#1}|textsc}}%
+ {\index{chiave!#1@\chiavestyle{#1}|textsc}}}
+\DeclareRobustCommand*\FSdescrittore[1]{\FSdescrittorestyle{#1}%
+ \iflanguage{english}%
+ {\index{column descriptor!#1@\FSdescrittorestyle{#1}|textsc}}%
+ {\index{descrittore di colonna!#1@\FSdescrittorestyle{#1}|textsc}}}
+\DeclareRobustCommand*\FSposizione[1]{\FSposizionestyle{#1}%
+ \iflanguage{english}%
+ {\index{floating object position!#1@\FSposizionestyle{#1}|textsc}}%
+ {\index{posizione degli oggetti flottanti!#1@\FSposizionestyle{#1}|textsc}}}%
+\DeclareRobustCommand*\FSallineamento[1]{FS\allineamentostyle{#1}%
+ \iflanguage{english}%
+ {\index{allignment code!#1@\FSallineamentostyle{#1}|textsc}}%
+ {\index{codice di allineamento!#1@\FSallineamentostyle{#1}|textsc}}}
+%
+% \end{macrocode}
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\subsection{Register and colour definitions}
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Here we define some length and dimension registers.
+% They will be used by the local commands and environments.
+% Length \cs{insertwidth} might be already defined, therefore we
+% test this possibility.
+% \begin{macrocode}
+\newlength\SIfrthick
+\newlength\SIfrgap
+\newlength\SIfrwidth
+\newlength\SIfrheight
+\ifcsdef{insertwidth}{}{\newlength\insertwidth}
+\newlength\SIXR \newlength\SIYD
+\newlength\SIXL \newlength\SIYU
+\newdimen\radius
+\newdimen\framewidth
+
+\definecolor{SIbackground}{rgb}{0.95,0.95,0.95}
+\definecolor{SIframe}{rgb}{0.1,0.1,0.1}
+\definecolor{SItext}{rgb}{0,0,0}
+
+% \end{macrocode}
+% The default background color is a very light gray; the default
+% frame colour is a very dark gray; the default text colour is
+% just black. Such colours are deemed suitable for the
+% application of the framed syntax box, but when necessary users
+% can use the \cs{textcolor} command to emphasise specific
+% phrases.
+%
+% As it can be seen, these colours are defined by means of the
+% colour defining macros of the \pack{xcolor} package.
+% They define some default colours; but the next commands
+% redefine them at the user choice; actually the user shall
+% specify some \textit{key = value} options to the main syntax
+% environment.
+% \begin{macrocode}
+\def\SetSIbgd#1{\colorlet{SIbackground}{#1}}
+\def\SetSIfrm#1{\colorlet{SIframe}{#1}}
+\def\SetSItxt#1{\colorlet{SItext}{#1}}
+
+% \end{macrocode}
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\subsection{Option settings}
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% The next code is the strength of the package; the definition
+% of the option settings. They form an option family defined by
+% the angle brackets delimited string \texttt{sintassi}.
+% Therefore they cannot be redefined by any other class or
+% package unless the above family name is used.
+% \begin{macrocode}
+\DeclareOptionX<sintassi>{fboxrule}[1pt]{\fboxrule=#1}
+\DeclareOptionX<sintassi>{fboxsep}[1ex]{\fboxsep=#1}
+\DeclareOptionX<sintassi>{framecolor}[SIframe]{\SetSIfrm{#1}}
+\DeclareOptionX<sintassi>{backgroundcolor}[SIbackground]{\SetSIbgd{#1}}
+\DeclareOptionX<sintassi>{fontstyle}[\normalfont]{#1}
+\DeclareOptionX<sintassi>{radius}[\fboxsep]{\radius=#1}
+\DeclareOptionX<sintassi>{insertionwidth}[\linewidth]{\insertwidth=#1}
+
+\DeclareOptionX*{%
+ \packageWarning{FramedSyntax}{`\CurrentOption' ignored}%
+}
+
+% \end{macrocode}
+% Notice that the option defining macro \cs{DeclareOptionX}
+% is created by the \pack{keyvalue} package in a simplified way,
+% so as to imitate the \LaTeXe syntax.
+%
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\subsection{Activate all options}
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% With just two macros we activate all options of family
+% \texttt{sintassi}
+% \begin{macrocode}
+\ExecuteOptionsX<sintassi>{%
+ fboxrule,
+ fboxsep,
+ framecolor,
+ backgroundcolor,
+ fontstyle,
+ radius,
+ insertionwidth
+}
+\ProcessOptionsX*\relax
+
+% \end{macrocode}
+%
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsection{A couple of useful local macros}
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% The following macros are generally useful for the end users;
+% the first one provides a simple means to scale the font size
+% to any specified integer or fractional value. It comes useful
+% when a line contained in a framed syntax box is too long and
+% gets broken at the end of the box measure. According where the
+% line is broken there are two ways to correct the source file:
+%\begin{itemize}
+%\item
+% the user choses the best point where to break the line,
+% inserts an explicit comment character (|\%|)
+% at the end of the broken line and inserts a horizontal space
+% at the beginning of the remaining part of the broken line.
+%\item
+% At the beginning of the environment body the user may insert a
+% \cs{setfontsize} selecting the specific font size at a smaller
+% integer or fractional value than the normal text size.
+%\end{itemize}
+% This \cs{setfontsize} macro accepts two different syntaxes in
+% order to reach the same result: For example:
+%
+%\verb|\setfontsize{9.5}[1.1]|\par
+%\verb|\setfontsize[1.1]{9.5}|
+%
+% In any case the base line skip value is optional and its
+% default value is 1.2 times the font size. Actually the
+% optional value is not the base line skip value, but it is
+% the \cs{linestretch} value, i.e. the ratio between the desired
+% base line skip and the font size.
+%
+% The second macro exploits the \pack{etoolbox} functionalities
+% to define a user macro that activates an internal native \TeX
+% macro protected by a |%| character.
+% \begin{macrocode}
+\providecommand\setfontsize{}
+\RenewDocumentCommand\setfontsize{O{1.2} m O{#1}}{%
+ \fontsize{#2}{\fpeval{#1*#2}}\selectfont}
+
+\providecommand\strippt{}
+\renewcommand\strippt[1]{\csuse{strip@pt}#1}
+
+% \end{macrocode}
+%
+%
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsection{The framed box requires several settings}
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% The following macro \cs{framedbox} in a certain sense is the
+% heart of the whole construction of the \amb{FramedSyntax}
+% environment. It requires 5 arguments, four mandatory ones and
+% one optional. In order they are as follows
+% \begin{enumerate}
+% \item[\texttt{\#1}]
+% mandatory: the width of the box/
+%
+% \item[\texttt{\#2}]
+% mandatory: the thickness of the frame.
+%
+% \item[\texttt{\#3}]
+% mandatory: the gap width between the frame and the contents
+% of the box.
+%
+% \item[\texttt{\#4}]
+% optional: the radius of curvature of the box corners.
+%
+% \item[\texttt{\#5}]
+% mandatory: the text to be included within the framed box
+% \end{enumerate}
+% Although the corner radius may be chosen, it is suggested to
+% avoid specifying this optional parameter; its default value
+% equals the gap width; if the frame thickness is zero, macro
+% avoids tracing a frame with an invisible line.
+% \begin{macrocode}
+\providecommand\framedbox{}
+\RenewDocumentCommand\framedbox{m m m O{#3} m}{%
+\bgroup
+ \dimen2=#1\relax
+ \dimen0=\dimexpr#1-(#2+#3)*2\relax
+ \setbox0\hbox{\parbox{\dimen0}{#5}}%
+ \SIfrthick=#2\relax
+ \SIXR=\dimexpr\wd0/2\relax \SIXL=-\SIXR\relax
+ \SIYU=\dimexpr(\ht0+\dp0)/2\relax \SIYD=-\SIYU\relax
+ \dimen4=#1\relax % box total width
+ \dimen6=\dimexpr\ht0+\dp0+(#2+#3)*2\relax% box total height
+ \dimen8=#4\relax % corner arc radius
+ \edef\SIbase{\strippt{\dimen4}}
+ \edef\SIalt{\strippt{\dimen6}}
+ \edef\SIxoff{\strippt{\dimexpr0.5\dimen4}}
+ \edef\SIyoff{\strippt{\dimexpr0.5\dimen6}}
+ \unitlength=1pt
+ \begin{picture}(\SIbase,\SIalt)(-\SIxoff,-\SIyoff)
+ \Frame*{\dimen4}{\dimen6}{\dimen8}%
+ \ifdim\SIfrthick>0pt\Frame{\dimen4}{\dimen6}{\dimen8}\fi
+ \put(0,0){\makebox(0,0){\box0}}%
+ \end{picture}
+\egroup
+\ignorespaces}
+
+% \end{macrocode}
+%
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsection{The frame}
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% The actual frame path may be filled with colour; the frame
+% border may be coloured with its own specified colour; such
+% colours are established by the FramedSyntax environment
+% options or by the global options.
+%
+% The \cs{Frame} command requires four parameters already
+% computed by the \cs{framedbox} command; in any case they are
+% the following:
+% \begin{enumerate}
+% \item[\texttt{\#1}]
+% optional: a boolean asterisk; if the asterisk is missing the
+% frame contour is drawn with its colour \texttt{SIframe}; if
+% the asterisk is present the contour is not drawn, but the
+% framed box is filled with the \texttt{SIbackground} colour.
+% \item[\texttt{\#2}]
+% mandatory: overall box width.
+% \item[\texttt{\#3}]
+% mandatory: total box height.
+% \item[\texttt{\#4}]
+% mandatory: the corner arc radius.
+% \end{enumerate}
+%
+% The following code contains the low level \pack{pict2e}
+% commands to draw lines to form a closed path to be stroked or
+% colour filled. They do not form a \pack{pict2e} \cs{oval},
+% although the contour is similar, because the default \cs{oval}
+% cannot be filled.
+% \begin{macrocode}
+ \providecommand\Frame{}
+ \RenewDocumentCommand\Frame{s m m m}{%
+ \bgroup
+ \SIXR=\dimexpr#2/2\relax \SIXL=-\SIXR%
+ \SIYU=\dimexpr#3/2\relax \SIYD=-\SIYU%
+ \IfBooleanTF{#1}{\linethickness{0pt}\color{SIbackground}}%
+ {\linethickness{\SIfrthick}\color{SIframe}}%
+ \moveto(\SIXR,\SIYD+#4)%
+ \circlearc{\SIXR-#4}{\SIYU-#4}{#4}{0}{90}%
+ \circlearc{\SIXL+#4}{\SIYU-#4}{#4}{90}{180}%
+ \circlearc{\SIXL+#4}{\SIYD+#4}{#4}{180}{270}%
+ \circlearc{\SIXR-#4}{\SIYD+#4}{#4}{270}{360}%
+ \closepath
+ \IfBooleanTF{#1}{\fillpath}{\strokepath}%
+ \egroup\ignorespaces}
+
+% \end{macrocode}
+
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsection{Filling the frame with the syntax text}
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% We are almost at the end. Here we define another macro to put
+% the syntax text inside the frame over the background
+% colour. The next command \cs{includeframedtext} provides the
+% necessary arguments to be passed to the lower level command
+% \cs{framedbox}; the arguments are the following:
+% \begin{enumerate}
+% \item[\texttt{\#1}]
+% optional: box width; default value \cs{insertwidth}, which is
+% the actual boxed text width; if it is larger than
+% \cs{linewidth} it is reduced to this value; in this case
+% users should revise they source code in order to fix this
+% little problem.
+% \item[\texttt{\#2}]
+% mandatory: the syntax text to be framed.
+% \item[\texttt{\#3}]
+% optional: the local \textit{key = value} options.
+% \end{enumerate}
+%
+% The code is the following.
+% \begin{macrocode}
+\providecommand\includeframedtext{}
+\RenewDocumentCommand\includeframedtext{O{\insertwidth} m O{}}%
+{\bgroup
+ \ExecuteOptionsX<sintassi>{#3}%
+ \ifdimgreater{\insertwidth}{\linewidth}{\insertwidth=\linewidth}{}%
+ \framedbox{\insertwidth}{\fboxrule}{\fboxsep}[\radius]{#2}%
+\egroup}
+
+% \end{macrocode}
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsection{The user environment}
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Originally this environmente was named \amb{Sintassi}, but in
+% this package we name it \amb{FramedSintax}. The opening
+% statement is very long, because it must contain all the
+% \cs{let} commands that allow the user to use the command names
+% without the \texttt{FS} prefix; such \cs{let} equivalences are
+% local because the \texttt{FS} prefixes were introduced only to
+% avoid clashes with possible definitions of the same names with
+% other purposes.
+%
+% But besides these numerous equivalences, this environment
+% \amb{FramedSyntax} determines the necessary parameters to pass
+% to the service macros
+%
+% The environment requires just two optional arguments.
+% \begin{enumerate}
+% \item[\texttt{\#1}]
+% optional: the font size. The default value is the current
+% font size. This size should be specified only when the syntax
+% lines are marginally longer than the available measure and
+% they get broken close to their natural length. Please,
+% remember that in order to have this size specification work
+% properly, it is necessary to use continuously scalable fonts.
+% This command will not have any useful effect with the original
+% \TeX default Computer Modern fonts; Latin Modern fonts, on
+% the contrary, work very well.
+% \item[\texttt{\#2}]
+% optional: \textit{key = value} options that locally override
+% the global default ones or those that possibly were
+% specified by the user when loading this package.
+% \end{enumerate}
+% \begin{macrocode}
+\ProvideDocumentEnvironment{FramedSyntax}{}{}{}
+\RenewDocumentEnvironment{FramedSyntax}{o D(){}}
+{% environment opening commands
+\IfValueT{#1}{\setfontsize{#1}}% font size setting
+\ExecuteOptionsX<sintassi>{#2}% key = value options
+ \ifdimgreater{\insertwidth}{\linewidth}% width corrrection
+ {\insertwidth=\linewidth}{}%
+\framewidth=\insertwidth
+%
+\let\meta\FSmeta \let\marg\FSmarg \let\oarg\FSoarg
+\let\Arg\FSArg \let\Marg\FSMarg \let\Oarg\FSOarg
+\let\garg\FSgarg \let\comando\FScomando \let\cs\FScs
+\let\csindex\FScs \let\Sambiente\SFSambiente
+\let\Dambiente\DFSambiente
+\let\Bambiente\BFSambiente \let\Eambiente\EFSambiente
+\let\amb\FSamb \let\ambstyle\FSambstyle
+\let\class\FSclass \let\classstyle\FSclassstyle
+\let\file\FSfile \let\filestyle\FSfilestyle
+\let\pack\FSpack \let\packstyle\FSpackstyle
+\let\prog\FSprog \let\progstyle\FSprogstyle
+\let\opz\FSopz \let\opzstyle\FSopzstyle
+\let\conta\FSconta \let\contastyle\FScontastyle
+\let\stile\FSstile \let\stilestyle\FSstilestyle
+\let\numeri\FSnumeri \let\numerystyle\FSnumeristyle
+\let\umisura\FSumisura \let\umisurastyle\FSumisurastyle
+\let\chiave\FSchiave \let\chiavestyle\FSchiavestyle
+\let\descrittore\FSdescrittore
+ \let\descrittorestyle\FSDescrittorestyle
+\let\posizione\FSposizione \let\posizionestyle\FSposizionestyle
+\let\allineamento\FSallineamento
+ \let\allineamentostyle\FSallineamentostyle
+
+%
+\begin{lrbox}{2}% open the necessary boxes
+\begin{minipage}{%
+ \dimexpr\framewidth-2\fboxrule-2\fboxsep}\obeylines
+}{% environment closing commands
+\end{minipage}\end{lrbox}% close the above boxes
+\begin{flushleft}% set the syntax thext flush left
+\includeframedtext{\box2}[#2]
+\end{flushleft}}%
+
+% \end{macrocode}
+%
+%
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsection%{Backwards compatibility environment \amb{Sintassi}}
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% As said in the Preface, this package was inspired by a
+% \file{.sty} file of mine written in Italian; I might conserve
+% my older file but, since it is not so safe against macro
+% definition clashes, in the several document source files I
+% wrote with the previous implementation. I am going to change
+% the name of the imported file, but I will conserve the
+% multitude of instances of the old environment name, by an
+% alias defined in this package.
+% \begin{macrocode}
+\NewDocumentEnvironment{Sintassi}{o D(){}}%
+ {\begin{FramedSyntax}[#1](#2)}{\end{FramedSyntax}}
+% \end{macrocode}
+%.
+%
+%\iffalse
+%<*package>
+%\fi
+%
+% \begin{center}\color{red}\fontsize{50}{50}\selectfont
+% Enjoy \LaTeX
+%\end{center}
+%\iffalse
+%</package>
+%\fi
+% \Finale
+
+\endinput
+
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/Master/texmf-dist/source/latex/fvextra/fvextra.dtx b/Master/texmf-dist/source/latex/fvextra/fvextra.dtx
index e4182b6f882..ae05d4e6a91 100644
--- a/Master/texmf-dist/source/latex/fvextra/fvextra.dtx
+++ b/Master/texmf-dist/source/latex/fvextra/fvextra.dtx
@@ -26,7 +26,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{fvextra}
%<*package>
- [2024/05/16 v1.7.0 fvextra - extensions and patches for fancyvrb]
+ [2024/09/14 v1.8.0 fvextra - extensions and patches for fancyvrb]
%</package>
%
%<*driver>
@@ -111,6 +111,10 @@
\AtBeginDocument{\let|\pipe@active@verbatim}
\endgroup
+\renewenvironment{verbatim}%
+ {\VerbatimEnvironment\begin{Verbatim}[gobble=1]}%
+ {\end{Verbatim}}
+
\newcommand{\todo}[1]{}
%\newcommand{\todo}[1]{\textcolor{red}{TO~DO: \scantokens{#1}}}
@@ -134,6 +138,48 @@
\def\theCodelineNo{\textcolor{DarkGreen}{\sffamily\scriptsize{\arabic{CodelineNo}}}}
+\renewenvironment{macro}{\macro@custom@arg}{}
+\def\macro@custom@arg{%
+ \begingroup\makeatletter\macro@custom@arg@i}
+\def\macro@custom@arg@i#1{%
+ \makeatother
+ \par\noindent
+ \ifstrempty{#1}%
+ {~\par}%
+ {\ttfamily\color{DarkGreen}\hspace*{-0.5in}%
+ \macro@custom@arg@split#1,\FV@Sentinel\par}%
+ \endgroup}
+\def\macro@custom@arg@spacegobble#1{#1}
+\def\macro@custom@arg@split#1,#2\FV@Sentinel{%
+ \expandafter\string\macro@custom@arg@spacegobble#1%
+ \if\relax\detokenize{#2}\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {}{\\\hspace*{-0.5in}\macro@custom@arg@split#2\FV@Sentinel}}
+
+\renewenvironment{environment}{\env@custom@arg}{}
+\def\env@custom@arg{%
+ \begingroup\makeatletter\env@custom@arg@i}
+\def\env@custom@arg@i#1{%
+ \makeatother
+ \ifstrempty{#1}%
+ {~\par}%
+ {\ttfamily\color{DarkGreen}\hspace*{-0.5in}%
+ \env@custom@arg@split#1,\FV@Sentinel\par}%
+ \endgroup}
+\def\env@custom@arg@spacegobble#1{#1}
+\def\env@custom@arg@split#1,#2\FV@Sentinel{%
+ \env@custom@arg@spacegobble#1{\textrm{ \textit{(env.)}}}%
+ \if\relax\detokenize{#2}\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {}{\\\hspace*{-0.5in}\env@custom@arg@split#2\FV@Sentinel}}
+
+
\let\orig@footnote\footnote
\renewcommand{\footnote}{%
\begingroup
@@ -147,25 +193,28 @@
\orig@footnote{\scantokens{#1}}}
-\def\fvextraprintopt#1(#2) (#3){%
+\def\fvextra@optionlist@printopt#1(#2) (#3){%
\vspace{0.1in}%
\leavevmode%
- \marginpar{\raggedleft\texttt{\small\textcolor{DarkGreen}{#1}}\ }%
+ \marginpar{\raggedleft\texttt{\textcolor{DarkGreen}{\small #1}}\ }%
\kern-\parindent\textsf{(#2)}\hfill(default: \texttt{#3})\\}
\newenvironment{optionlist}%
- {%
- ~\par\vspace{-14pt}%
+ {~\par\vspace{-14pt}%
\def\pipechar{|}
\let\|\pipechar
- \newcommand*\fvextranext{}%
+ \newcommand*\fvextra@optionlist@next{}%
+ \let\item@orig\item
\renewcommand*\item[1][]{%
- \fvextranext%
- \renewcommand*\fvextranext{\par}%
- \fvextraprintopt##1%
- \ignorespaces}}
- {%
- \par}
+ \ifdefstring{\@currenvir}{optionlist}%
+ {\fvextra@optionlist@next%
+ \renewcommand*\fvextra@optionlist@next{\par}%
+ \fvextra@optionlist@printopt##1%
+ \ignorespaces}%
+ {\ifstrempty{##1}%
+ {\vspace{-4pt}\item@orig}
+ {\vspace{-4pt}\item@orig[##1]}}}}
+ {\par}
\newenvironment{example}
@@ -290,7 +339,7 @@
%\hrule
%\vspace{2ex}
%\noindent\begin{minipage}{\linewidth}
-%\begin{Verbatim}[gobble=1]
+%\begin{verbatim}
%---
%header-includes:
% - |
@@ -301,7 +350,7 @@
% breaklines, breaknonspaceingroup, breakanywhere}
% ```
%---
-%\end{Verbatim}
+%\end{verbatim}
%\end{minipage}
%\vspace{2ex}
%\hrule
@@ -317,6 +366,50 @@
%
% \begin{optionlist}
%
+% \item[backgroundcolor (string) (none)]
+% Background color behind commands and environments. This is only a basic, lightweight implementation of background colors using |\colorbox|. For more control of background colors, consider \href{https://ctan.org/pkg/tcolorbox}{\pkg{tcolorbox}} or a similar package, or a custom background color implementation.
+%
+% Background colors are implemented with |\colorbox|, which prevents line breaking for |\Verb|, |\UseVerb|, and |\EscVerb|. Background colors are only compatible with \fvextra's reimplemented |\Verb| and |\UseVerb| (|extra=true|).
+%
+% See |backgroundcolorvphantom| to customize the height of the background for each line of text, especially for |\Verb|, |\EscVerb|, and |BVerbatim|.
+%
+% When |backgroundcolor| is used with |Verbatim| with a |frame|, it may be necessary to adjust |framesep| and |fillcolor| depending on the desired result. |backgroundcolorpadding| provides a shortcut for this.
+%
+%
+% \item[backgroundcolorpadding (length) (none)]
+% Padding when |backgroundcolor| is set. For |\Verb|, |\UseVerb|, |\EscVerb|, and |BVerbatim|, this sets |\fboxsep| for the |\colorbox| that is used to create the background color. For |Verbatim|, \fancyvrb's frame options are used instead, particularly |framesep| and |fillcolor|.
+%
+% For |Verbatim|, this amounts to a shortcut for a combination of frame-related settings that provide padding when there is a background color. This is only intended for cases with |frame=none| or |frame=single|. In other cases, it may be better to modify the \fancyvrb\ frame settings directly, and it may be necessary to modify the \fancyvrb\ internals to obtain padding on all sides.
+%
+% For |Verbatim|, if |frame=single|, then this is equivalent to the following settings:
+% \begin{itemize}
+% \item |framesep=|\meta{\texttt{backgroundcolorpadding}}
+% \item |fillcolor=\FancyVerbBackgroundColor|
+% \end{itemize}
+%
+% For |Verbatim|, if |frame| has any value other than |single|, then this is equivalent to the following settings:
+% \begin{itemize}
+% \item |frame=single|
+% \item |framerule=0pt|
+% \item |rulecolor=\FancyVerbBackgroundColor|
+% \item |framesep=|\meta{\texttt{backgroundcolorpadding}}
+% \item |fillcolor=\FancyVerbBackgroundColor|
+% \end{itemize}
+%
+%
+% \item[backgroundcolorvphantom (macro) (\Verb{\vphantom{\"Apgjy}})]
+% |\vphantom| or similar macro such as |\strut| that is inserted at the beginning of each line of text using |backgroundcolor|. This allows the height of the background for each line of text to be customized, especially for |\Verb|, |\EscVerb|, and |BVerbatim|. |backgroundcolorvphantom| will typically have no effect on |Verbatim|-based environments unless it is set to a size larger than |\strut|.
+%
+% \item[bgcolor (string) (none)]
+% Alias for |backgroundcolor|.
+%
+% \item[bgcolorpadding (length) (none)]
+% Alias for |backgroundcolorpadding|.
+%
+% \item[bgcolorvphantom (macro) (\Verb{\vphantom{\"Apgjy}})]
+% Alias for |backgroundcolorvphantom|.
+%
+%
% \item[beameroverlays (boolean) (false)]
% Give the |<| and |>| characters their normal text meanings, so that \pkg{beamer} overlays of the form |\only<1>{...}| will work. Note that something like |commandchars=\\\{\}| is required separately to enable macros. This is not incorporated in the |beameroverlays| option because essentially arbitrary command characters could be used; only the |<| and |>| characters are hard-coded for overlays.
%
@@ -522,6 +615,10 @@
% Set the color of visible tabs. By default (|none|), they take the color of their surroundings.
%
%
+% \item[vargsingleline (boolean) (false)]
+% This determines whether \fvextra's |\Verb| and |\SaveVerb| take multi-line (but not multi-paragraph) verbatim arguments, or if they instead require arguments to be on a single line like the original \fancyvrb\ commands.
+%
+%
% \end{optionlist}
%
%
@@ -585,6 +682,8 @@
%
% The new \cmd{\Verb} works as expected (with a few limitations) inside other commands. It even works in movable arguments (for example, in \cmd{\section}), and is compatible with \pkg{hyperref} for generating PDF strings (for example, PDF bookmarks). The \fancyvrb\ definition did work inside some other commands, but essentially functioned as \cmd{\texttt} in that context.
%
+% By default, \cmd{\Verb} takes a multi-line (but not multi-paragraph) verbatim argument. To restore the \fancyvrb\ behavior of requiring a single-line argument, set |vargsingleline=true|.
+%
% \cmd{\Verb} is compatible with |breaklines| and the relevant line-breaking options.
%
% Like the original \fancyvrb\ implementation, the new \cmd{\Verb} can be starred (|\Verb*|) and accepts optional arguments. While \fancyvrb's starred command |\Verb*| is a shortcut for |showspaces|, \fvextra's |\Verb*| is a shortcut for both |showspaces| and |showtabs|. This is more similar to the current behavior of \LaTeX's \Verb{\verb*}, except that \Verb{\verb*} converts tabs into visible spaces instead of displaying them as visible tabs.
@@ -611,6 +710,8 @@
%
% \cmd{\SaveVerb} is reimplemented so that it is equivalent to the reimplemented \cmd{\Verb}. Like the new \cmd{\Verb}, it accepts \meta{text} delimited by a pair of curly braces |{...}|. It supports \cmd{\fvinlineset}. It also adds support for the new |retokenize| option for \cmd{\UseVerb}.
%
+% By default, \cmd{\SaveVerb} takes a multi-line (but not multi-paragraph) verbatim argument. To restore the \fancyvrb\ behavior of requiring a single-line argument, set |vargsingleline=true|.
+%
%
% \subsection{\cmd{\UseVerb}}
%
@@ -814,12 +915,20 @@
% \subsection{\cmd{\VerbatimInsertBuffer}}
% \DescribeMacro{\VerbatimInsertBuffer\oarg{options}}
%
-% This inserts an existing buffer created by |VerbatimBuffer| as a |Verbatim| environment. It customizes |Verbatim| internals to function with a buffer in a command context. See the |VerbatimBuffer| documentation for an example of usage.
+% This inserts an existing buffer created by |VerbatimBuffer| as a verbatim environment. The |Verbatim| environment is used by default, but this can be customized by setting |insertenvname|. |\VerbatimInsertBuffer| modifies |Verbatim| and |BVerbatim| internals to function with a buffer in a command context. See the |VerbatimBuffer| documentation for an example of usage.
%
% Options related to catcodes cause the buffer to be retokenized during typesetting. That is, the \fancyvrb\ options used for |\VerbatimInsertBuffer| are not restricted by those that were in effect when |VerbatimBuffer| originally created the buffer, so long as the buffer contains a complete representation of the original |VerbatimBuffer| environment contents.
%
% |\VerbatimInsertBuffer| is not implemented using the typical \fancyvrb\ command and environment implementation styles, so it is not compatible with |\RecustomVerbatimCommand| or |\RecustomVerbatimEnvironment|.
%
+% ~\par
+% \noindent Options defined specifically for \cmd{\VerbatimInsertBuffer}:
+%
+% \begin{optionlist}
+% \item[insertenvname (string) (Verbatim)]
+% This is the name of the verbatim environment used for inserting the buffer. |insertenvname| can be any |Verbatim|- or |BVerbatim|-based environment. Environments defined with |\CustomVerbatimEnvironment| and |\RecustomVerbatimEnvironment| are supported. User-implemented environments that serve as wrappers around |Verbatim| or |BVerbatim| should typically be compatible so long as they accept \pkg{fancyvrb}/\pkg{fvextra} optional arguments in the same way as |Verbatim| and |BVerbatim|.
+% \end{optionlist}
+%
%
% \subsection{\cmd{\VerbatimClearBuffer}}
% \DescribeMacro{\VerbatimClearBuffer\oarg{options}}
@@ -885,6 +994,17 @@
% The symbol inserted pre-break for breaks inserted by |breakanywhere|. This does not apply to breaks inserted next to spaces; see |spacebreak|.
%
%
+% \item[breakanywhereinlinestretch (length) (\meta{none})]
+% Stretch glue to insert at potential |breakanywhere| break locations in inline contexts, to give better line widths and avoid overfull |\hbox|. This allows the spacing between adjacent non-space characters to stretch, so it should not be used when column alignment is important. For typical line lengths, values between |0.01em| and |0.02em| should be sufficient to provide a cumulative stretch per line that is equal to or greater than the width of one character.
+%
+% This is typically not needed in cases where an overfull |\hbox| only overflows by tiny amount, perhaps a fraction of a pt. In those cases, the overfull |\hbox| could be ignored, |\hfuzz| could be set to 1pt or 2pt to suppress tiny overfull |\hbox| warnings, or |breakanywheresymbolpre| might be redefined to adjust spacing.
+%
+% Implementation: Before each |breakanywhere| break location, this inserts the following sequence of macros:
+%\begin{verbatim}
+%\nobreak\hspace{0pt plus \FV@breaknonspaceinlinestretch}
+%\end{verbatim}
+%
+%
% \item[breakanywheresymbolpost (string) (\meta{none})]
% The symbol inserted post-break for breaks inserted by |breakanywhere|. This does not apply to breaks inserted next to spaces; see |spacebreak|.
%
@@ -931,7 +1051,11 @@
%
%
% \item[breaklines (boolean) (false)]
-% Automatically break long lines. When a line is broken, the result must fit on a single page. There is no support for breaking a line across multiple pages.\footnote{Following the implementation in \pkg{fancyvrb}, each line is typeset within an |\hbox|, so page breaks are not possible.}
+% Automatically break long lines.
+%
+% \textbf{Limitations for verbatim environments/block text}, such as |Verbatim|: When a line is broken, the result must fit on a single page. There is no support for breaking a line across multiple pages.\footnote{Following the implementation in \pkg{fancyvrb}, each line is typeset within an |\hbox|, so page breaks are not possible.}
+%
+% \textbf{Limitations for verbatim commands/inline text}, such as |\Verb|: When a line break is inserted, the text may still overflow into the margin or cause an overfull |\hbox|, depending on hyphenation settings and various penalties related to line breaks. It may be possible to avoid this by allowing additional break locations with |breakbefore|, |breakafter|, or |breakanywhere|. Small overfull |\hbox| warnings can be suppressed by setting |\hfuzz| to a larger value, for example setting it to |2pt| instead of the default |0.1pt|. It is also possible to combine |breakanywhere| with |breakanywhereinlinestretch| to allow flexible spacing between adjacent non-space characters. In cases where it is better to break before the margin rather than overflowing into the margin, consider setting |\emergencystretch|.
%
% By default, automatic breaks occur at spaces (even when |showspaces=true|). Use |breakanywhere| to enable breaking anywhere; use |breakbefore| and |breakafter| for more fine-tuned breaking.
%
@@ -980,6 +1104,12 @@
% |breaknonspaceingroup| allows non-space breaks to be inserted within groups. This option should only be used when |commandchars| is including \LaTeX\ commands that do not take optional arguments and only take mandatory arguments that are typeset. Something like |\textit{text}| is fine, but |\textcolor{red}{text}| is not because one of the mandatory arguments is not typeset but rather provides a setting. For more complex commands, it is typically better to redefine them to insert breaks in appropriate locations using |\FancyVerbBreakStart...\FancyVerbBreakStop|.
%
%
+% \item[breakpreferspaces (boolean) (true)]
+% This determines whether line breaks are preferentially inserted at normal spaces (|breakcollapsespaces=true|, |showspaces=false|) rather than at other locations allowed by |breakbefore|, |breakafter|, or |breakanywhere|.
+%
+% Using |breakpreferspaces=false| with |breakanywhere=true| will typically result in all broken segments of a line going all the way to the right margin.
+%
+%
% \item[breaksymbol (string) (breaksymbolleft)]
% Alias for |breaksymbolleft|.
%
@@ -1369,6 +1499,9 @@
% \item[formatcom* (macro) (\meta{empty})]
% \fancyvrb's |formatcom| is used to execute commands before verbatim text. It overwrites any existing |formatcom|. |formatcom*| appends changes to existing settings.
%
+% \item[listparameters (macro) (\meta{empty})]
+% Set list-related lengths to modify spacing around lines of code. For example, |listparameters=\setlength{\topsep}{0pt}| will remove space before and after a |Verbatim| environment.
+%
% \end{optionlist}
%
%
@@ -1506,7 +1639,7 @@
%
% There are two contexts in which sentinels may be needed. In delimited macro arguments, such as |\def\macro#1\sentinel{...}|, a sentinel is needed as the delimiter. Because the delimiting macro need not be defined, special delimiting macros need not be created for this case. The important thing is to ensure that the macro name is sufficiently unique to avoid collisions. Typically, using \cmd{\makeatletter} to allow something like \cmd{\@sentinel} will be sufficient. For added security, additional characters can be given catcode 11, to allow things like \cmd{\@sent!nel}.
%
-% The other context for sentinels is in scanning through a sequence of tokens that is delimited by a sentinel, and using \cmd{\ifx} comparisons to identify the sentinel and stop scanning. In this case, using an undefined macro is risky. Under normal conditions, the sequence of tokens could contain an undefined macro due to mistyping. In some \fvextra\ applications, the tokens will have been incorrectly tokenized under a normal catcode regime, and need to be retokenized as verbatim, in which case undefined macros must be expected. Thus, a sentinel macro whose expansion is resistent to collisions is needed.
+% The other context for sentinels is in scanning through a sequence of tokens that is delimited by a sentinel, and using \cmd{\ifx} comparisons to identify the sentinel and stop scanning. In this case, using an undefined macro is risky. Under normal conditions, the sequence of tokens could contain an undefined macro due to mistyping. In some \fvextra\ applications, the tokens will have been incorrectly tokenized under a normal catcode regime, and need to be retokenized as verbatim, in which case undefined macros must be expected. Thus, a sentinel macro whose expansion is resistant to collisions is needed.
%
% \begin{macro}{\FV@<Sentinel>}
% This is the standard default \fvextra\ delimited-macro sentinel. It is used with \cmd{\makeatletter} by changing |<| and |>| to catcode 11. The |<| and |>| add an extra level of collision resistance. Because it is undefined, it is \emph{only} appropriate for use in delimited macro arguments.
@@ -1820,12 +1953,14 @@
% \end{macro}
%
%
-% \begin{macro}{\FVExtraReadVArg}
-% Read a verbatim argument that is bounded by two identical characters or by paired curly braces. This uses the \cmd{\outer} |^^M| with \cmd{\FV@EOL} trick from \fancyvrb\ to prevent runaway arguments. An \cmd{\outer} |^^C| is used to prevent |^^C| from being part of arguments, so that it can be used later as a sentinel if retokenization is needed. |^^B| is handled in the same manner for symmetry with later usage, though technically it is not used as a sentinel so this is not strictly necessary. Alternate |UTF| macros, defined later, are invoked when under pdfTeX with \pkg{inputenc} using UTF-8.
+% \begin{macro}{\FVExtraReadVArg,\FVExtraReadVArgSingleLine}
+% Read a verbatim argument that is bounded by two identical characters or by paired curly braces. There are two variants: one reads a multi-line (but not multi-paragraph) argument, while the other restricts the argument to a single line via the \cmd{\outer} |^^M| trick from \fancyvrb. An \cmd{\outer} |^^C| is used to prevent |^^C| from being part of arguments, so that it can be used later as a sentinel if retokenization is needed. |^^B| is handled in the same manner for symmetry with later usage, though technically it is not used as a sentinel so this is not strictly necessary. Alternate |UTF| macros, defined later, are invoked when under pdfTeX with \pkg{inputenc} using UTF-8.
%
% The lookahead for the type of delimiting character is done under a verbatim catcode regime, except that the space catcode is preserved and curly braces are given their normal catcodes. This provides consistency with any \cmd{\FVExtra@ifnextcharVArg} or \cmd{\FVExtra@ifstarVArg} that may have been used previously, allows characters like |#| and |%| to be used as delimiters when the verbatim argument is read outside any other commands (untokenized), and allows paired curly braces to serve as delimiters. Any additional command-specific catcode modifications should only be applied to the argument after it has been read, since they do not apply to the delimiters.
%
% Once the delimiter lookahead is complete, catcodes revert to full verbatim, and are then modified appropriately given the type of delimiter. The space and tab must be \cmd{\active} to be preserved correctly when the verbatim argument is not inside any other commands (otherwise, they collapse into single spaces).
+%
+% Note that |\FVExtraReadVArg| will interpret a line break as a catcode 10 space, not as an |\active| space. Depending on usage, the argument may need to be processed with |\FVExtraDetokenizeVArg| and |\FVExtraRetokenizeVArg| to fix this.
% \begin{macrocode}
\def\FVExtraReadVArg#1{%
\begingroup
@@ -1840,6 +1975,34 @@
\FV@OuterDefSTXEmpty
\catcode`\^^C=\active
\FV@OuterDefETXEmpty
+ \begingroup
+ \catcode`\ =\FV@TmpSpaceCat\relax
+ \catcode`\{=1
+ \catcode`\}=2
+ \@ifnextchar\bgroup
+ {\endgroup
+ \catcode`\{=1
+ \catcode`\}=2
+ \catcode`\ =\active
+ \catcode`\^^I=\active
+ \FV@ReadVArg@Group{#1}}%
+ {\endgroup
+ \catcode`\ =\active
+ \catcode`\^^I=\active
+ \FV@ReadVArg@Char{#1}}}
+\def\FVExtraReadVArgSingleLine#1{%
+ \begingroup
+ \ifFV@pdfTeXinputenc
+ \ifdefstring{\inputencodingname}{utf8}%
+ {\let\FV@ReadVArg@Char\FV@ReadVArg@Char@UTF}%
+ {}%
+ \fi
+ \edef\FV@TmpSpaceCat{\the\catcode` }%
+ \let\do\@makeother\FVExtraDoSpecials
+ \catcode`\^^B=\active
+ \FV@OuterDefSTXEmpty
+ \catcode`\^^C=\active
+ \FV@OuterDefETXEmpty
\catcode`\^^M=\active
\FV@OuterDefEOLEmpty
\begingroup
@@ -1852,20 +2015,20 @@
\catcode`\}=2
\catcode`\ =\active
\catcode`\^^I=\active
- \FV@ReadVArg@Group{#1}\FV@EOL}%
+ \FV@ReadVArg@Group{#1}}%
{\endgroup
\catcode`\ =\active
\catcode`\^^I=\active
- \FV@ReadVArg@Char{#1}\FV@EOL}}
+ \FV@ReadVArg@Char{#1}}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\FV@ReadVArg@Group}
% The argument is read under the verbatim catcode regime already in place from \cmd{\FVExtraReadVArg}. The \cmd{\endgroup} returns to prior catcodes. Any command-specific catcodes can be applied later via \cmd{\scantokens}. Using them here in reading the argument would have no effect as far as later processing with \cmd{\scantokens} is concerned, unless the argument were read outside any other commands and additional characters were given catcodes 1 or 2 (like the curly braces). That scenario is not allowed because it makes reading the argument overly dependent on the argument content. (Technically, reading the argument is already dependent on the argument content in the sense that the argument cannot contain unescaped unpaired curly braces, given that it is delimited by curly braces.)
% \begin{macrocode}
-\def\FV@ReadVArg@Group#1#2#3{%
+\def\FV@ReadVArg@Group#1#2{%
\endgroup
- #1{#3}}
+ #1{#2}}
% \end{macrocode}
% \end{macro}
%
@@ -1874,9 +2037,9 @@
%
% It would be possible to read the argument using any command-specific catcode settings, but that would result in different behavior depending on whether the argument is already tokenized, and would make reading the argument overly dependent on the argument content.
% \begin{macrocode}
-\def\FV@ReadVArg@Char#1#2#3{%
+\def\FV@ReadVArg@Char#1#2{%
\expandafter\expandafter\expandafter
- \if\expandafter\expandafter\expandafter\relax\expandafter\@gobble\detokenize{#3}\relax
+ \if\expandafter\expandafter\expandafter\relax\expandafter\@gobble\detokenize{#2}\relax
\expandafter\@gobble
\else
\expandafter\@firstofone
@@ -1884,10 +2047,10 @@
{\PackageError{fvextra}%
{Verbatim delimiters must be single characters, not commands}%
{Try a different delimiter}}%
- \def\FV@ReadVArg@Char@i##1##2##3#3{%
+ \def\FV@ReadVArg@Char@i##1##2#2{%
\endgroup
- ##1{##3}}%
- \FV@ReadVArg@Char@i{#1}\FV@EOL}%
+ ##1{##2}}%
+ \FV@ReadVArg@Char@i{#1}}%
% \end{macrocode}
% \end{macro}
%
@@ -1902,9 +2065,9 @@
% \begin{macro}{\FV@ReadVArg@Char@UTF}
% This is a variant of \cmd{\FV@ReadVArg@Char} that allows non-ASCII codepoints as delimiters under the pdfTeX engine with \pkg{inputenc} using UTF-8. Under pdfTeX, non-ASCII codepoints must be handled as a sequence of bytes rather than as a single entity. \cmd{\FV@ReadVArg@Char} is automatically \cmd{\let} to this version when appropriate. This uses the \cmd{\FV@U8:<byte>} macros for working with \pkg{inputenc}'s UTF-8.
% \begin{macrocode}
-\def\FV@ReadVArg@Char@UTF#1#2#3{%
+\def\FV@ReadVArg@Char@UTF#1#2{%
\expandafter\expandafter\expandafter
- \if\expandafter\expandafter\expandafter\relax\expandafter\@gobble\detokenize{#3}\relax
+ \if\expandafter\expandafter\expandafter\relax\expandafter\@gobble\detokenize{#2}\relax
\expandafter\@gobble
\else
\expandafter\@firstofone
@@ -1912,23 +2075,23 @@
{\PackageError{fvextra}%
{Verbatim delimiters must be single characters, not commands}%
{Try a different delimiter}}%
- \ifcsname FV@U8:\detokenize{#3}\endcsname
+ \ifcsname FV@U8:\detokenize{#2}\endcsname
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
{\def\FV@UTF@octets@after##1{\FV@ReadVArg@Char@UTF@i{#1}{##1}}%
- \csname FV@U8:\detokenize{#3}\endcsname#3}%
- {\FV@ReadVArg@Char@UTF@i{#1}{#3}}}
+ \csname FV@U8:\detokenize{#2}\endcsname#2}%
+ {\FV@ReadVArg@Char@UTF@i{#1}{#2}}}
% \end{macrocode}
%
% \begin{macro}{\FV@ReadVArg@Char@UTF@i}
% \begin{macrocode}
\def\FV@ReadVArg@Char@UTF@i#1#2{%
- \def\FV@ReadVArg@Char@i##1##2##3#2{%
+ \def\FV@ReadVArg@Char@i##1##2#2{%
\endgroup
- ##1{##3}}%
- \FV@ReadVArg@Char@i{#1}\FV@EOL}%
+ ##1{##2}}%
+ \FV@ReadVArg@Char@i{#1}}%
% \end{macrocode}
% \end{macro}
%
@@ -1939,6 +2102,18 @@
% \end{macro}
%
%
+% \begin{macro}{vargsingleline}
+% This determines whether |\Verb| and |\SaveVerb| use |\FVExtraReadVArg| or |\FVExtraReadVArgSingleLine| to read their arguments. It has no effect on |\EscVerb|, since that does not use special tokenization.
+% \begin{macrocode}
+\newbool{FV@vargsingleline}
+\define@booleankey{FV}{vargsingleline}%
+ {\booltrue{FV@vargsingleline}}
+ {\boolfalse{FV@vargsingleline}}
+\fvset{vargsingleline=false}
+% \end{macrocode}
+% \end{macro}
+%
+%
%
%
% \subsubsection{Reading and protecting arguments in expansion-only contexts}
@@ -2926,7 +3101,7 @@
% \end{macro}
%
%
-% \paragraph{Detokenize as if the original source were tokenized verbatim, except for backslash escapes of non-catcode 11 characters, then convert to PDF string}
+% \paragraph{Detokenize as if the original source were tokenized verbatim, except for backslash escapes of non-catcode 11 characters, then convert to PDF string}\hfill\\
%
% \begin{macro}{\FVExtraPDFStringEscapedVerbatimDetokenize}
% This is identical to \cmd{\FVExtraEscapedVerbatimDetokenize}, except that the output is converted to a valid PDF string. All spaces are represented with the octal escape \cmd{\040} to prevent adjacent spaces from being merged. There is no alternate implementation for restricting escapes to ASCII symbols and punctuation. Typically, this would be used in an expansion-only context to create something like bookmarks, while \cmd{\FVExtraEscapedVerbatimDetokenize} (potentially with escape restrictions) would be used in parallel to generate whatever is actually typeset. Escape errors can be handled in generating what is typeset.
@@ -2962,7 +3137,7 @@
% \end{macro}
%
% \begin{macro}{\FV@PDFStrEscVDetok@ScanCont}
-% This is modified to use |\040| for the space. In the unescaped case, using a normal space here is fine, but in the escaped case, the preceeding or following token could be an escaped space.
+% This is modified to use |\040| for the space. In the unescaped case, using a normal space here is fine, but in the escaped case, the preceding or following token could be an escaped space.
% \begin{macrocode}
\begingroup
\catcode`\!=0\relax
@@ -3058,7 +3233,7 @@
% \end{macro}
%
% \begin{macro}{\FV@PDFStrEscVDetok@ScanTokenNoSpace}
-% This was modifed to add \cmd{\FVExtraPDFStringEscapeChar}
+% This was modified to add \cmd{\FVExtraPDFStringEscapeChar}
% \begin{macrocode}
\gdef\FV@PDFStrEscVDetok@ScanTokenNoSpace#1#2^^C{%
\if\relax\detokenize{#2}\relax
@@ -3250,8 +3425,7 @@
% \subsection{Hooks}
%
%
-% \begin{macro}{\FV@FormattingPrep@PreHook}
-% \begin{macro}{\FV@FormattingPrep@PostHook}
+% \begin{macro}{\FV@FormattingPrep@PreHook,\FV@FormattingPrep@PostHook}
% These are hooks for extending |\FV@FormattingPrep|. |\FV@FormattingPrep| is inside a group, before the beginning of processing, so it is a good place to add extension code. These hooks are used for such things as tweaking math mode behavior and preparing for |breakbefore| and |breakafter|. The |PreHook| should typically be used, unless \pkg{fancyvrb}'s font settings, whitespace setup, and active character definitions are needed for extension code.
% \begin{macrocode}
\let\FV@FormattingPrep@PreHook\@empty
@@ -3260,7 +3434,6 @@
\expandafter\FV@FormattingPrep@PreHook\FV@FormattingPrep\FV@FormattingPrep@PostHook}
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
%
% \begin{macro}{\FV@PygmentsHook}
@@ -3326,7 +3499,8 @@
% \begin{macro}{\FV@UseInlineKeyValues}
% \begin{macrocode}
\def\FV@UseInlineKeyValues{%
- \expandafter\fvset\expandafter{\FV@InlineKeyValues}}
+ \expandafter\fvset\expandafter{\FV@InlineKeyValues}%
+ \FV@ApplyBreakAnywhereInlineStretch}
% \end{macrocode}
% \end{macro}
%
@@ -3432,7 +3606,10 @@
% \begin{macrocode}
\def\FVC@Verb@Extra@i{%
\begingroup
- \FVExtraReadVArg{%
+ \ifbool{FV@vargsingleline}%
+ {\let\FV@Reader\FVExtraReadVArgSingleLine}%
+ {\let\FV@Reader\FVExtraReadVArg}%
+ \FV@Reader{%
\FV@UseInlineKeyValues\FV@UseKeyValues\FV@FormattingPrep
\FVExtraDetokenizeVArg{%
\FVExtraRetokenizeVArg{\FVC@Verb@Extra@ii}{\FV@CatCodes}}}}
@@ -3440,15 +3617,26 @@
% \end{macro}
%
% \begin{macro}{\FVC@Verb@Extra@ii}
+% |breaklines| is only applied when there is no background color, since |\colorbox| prevents line breaks.
% \begin{macrocode}
\def\FVC@Verb@Extra@ii#1{%
- \ifFV@breaklines
+ \ifx\FancyVerbBackgroundColor\relax
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
- {\FV@InsertBreaks{\FancyVerbFormatInline}{#1}}%
- {\mbox{#1}}%
+ {\ifbool{FV@breaklines}%
+ {\FV@InsertBreaks{\FancyVerbFormatInline}{#1}}%
+ {\mbox{\FancyVerbFormatInline{#1}}}}%
+ {\setlength{\FV@TmpLength}{\fboxsep}%
+ \ifx\FancyVerbBackgroundColorPadding\relax
+ \setlength{\fboxsep}{0pt}%
+ \else
+ \setlength{\fboxsep}{\FancyVerbBackgroundColorPadding}%
+ \fi
+ \colorbox{\FancyVerbBackgroundColor}{%
+ \setlength{\fboxsep}{\FV@TmpLength}%
+ \FancyVerbBackgroundColorVPhantom\FancyVerbFormatInline{#1}}}%
\endgroup}
% \end{macrocode}
% \end{macro}
@@ -3488,7 +3676,10 @@
\@namedef{FV@SV@#1}{}%
\@namedef{FV@SVRaw@#1}{}%
\begingroup
- \FVExtraReadVArg{%
+ \ifbool{FV@vargsingleline}%
+ {\let\FV@Reader\FVExtraReadVArgSingleLine}%
+ {\let\FV@Reader\FVExtraReadVArg}%
+ \FV@Reader{%
\FVC@SaveVerb@Extra@i{#1}}}
% \end{macrocode}
% \end{macro}
@@ -3591,15 +3782,7 @@
%
% \begin{macro}{\FV@UseVerb@Extra}
% \begin{macrocode}
-\def\FV@UseVerb@Extra#1{%
- \ifFV@breaklines
- \expandafter\@firstoftwo
- \else
- \expandafter\@secondoftwo
- \fi
- {\FV@InsertBreaks{\FancyVerbFormatInline}{#1}}%
- {\mbox{#1}}%
- \endgroup}
+\let\FV@UseVerb@Extra\FVC@Verb@Extra@ii
% \end{macrocode}
% \end{macro}
%
@@ -3654,15 +3837,7 @@
%
% \begin{macro}{\FVC@EscVerb@ii}
% \begin{macrocode}
-\def\FVC@EscVerb@ii#1{%
- \ifFV@breaklines
- \expandafter\@firstoftwo
- \else
- \expandafter\@secondoftwo
- \fi
- {\FV@InsertBreaks{\FancyVerbFormatInline}{#1}}%
- {\mbox{#1}}%
- \endgroup}
+\let\FVC@EscVerb@ii\FVC@Verb@Extra@ii
% \end{macrocode}
% \end{macro}
%
@@ -3805,7 +3980,7 @@
% \end{macro}
%
%
-% \begin{macro}{writer, \FV@Writer}
+% \begin{macro}{writer,\FV@Writer}
% Define writer macro that processes each line before writing.
% \begin{macrocode}
\define@key{FV}{writer}{%
@@ -3820,7 +3995,7 @@
% \begin{macro}{VerbatimWrite}
% The environment implementation follows standard \fancyvrb\ environment style.
%
-% A special write counter is used to track line numbers while avoiding incrementing the regular counter that is used for typeset code. Some macros do nothing with the default |writer|, but are needed to enable \fancyvrb\ options when a custom |writer| is used in conjuction with optional environment arguments. These include |\FancyVerbDefineActive|, |\FancyVerbFormatCom|, and |\FV@DefineTabOut|.
+% A special write counter is used to track line numbers while avoiding incrementing the regular counter that is used for typeset code. Some macros do nothing with the default |writer|, but are needed to enable \fancyvrb\ options when a custom |writer| is used in conjunction with optional environment arguments. These include |\FancyVerbDefineActive|, |\FancyVerbFormatCom|, and |\FV@DefineTabOut|.
% \begin{macrocode}
\newcounter{FancyVerbWriteLine}
\def\VerbatimWrite{%
@@ -3858,7 +4033,7 @@
%
% By default, all \fancyvrb\ options except for |VerbatimBuffer|-specific options are ignored. This can be customized on a per-environment basis via environment optional arguments.
%
-% \begin{macro}{afterbuffer, \FV@afterbuffer}
+% \begin{macro}{afterbuffer,\FV@afterbuffer}
% Macro that is inserted after the last line of the environment is buffered, immediately before the environment ends.
% \begin{macrocode}
\define@key{FV}{afterbuffer}{%
@@ -3874,7 +4049,7 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{bufferer, \FV@Bufferer, \FancyVerbDefaultBufferer}
+% \begin{macro}{bufferer,\FV@Bufferer,\FancyVerbDefaultBufferer}
% This is the macro that adds lines to the buffer. The default is designed to create a truly verbatim buffer via |\detokenize|.
% \begin{macrocode}
\define@key{FV}{bufferer}{%
@@ -3931,7 +4106,7 @@
% \begin{macro}{VerbatimBuffer}
% The environment implementation follows standard \fancyvrb\ environment style.
%
-% A special buffer counter is used to track line numbers while avoiding incrementing the regular counter that is used for typeset code. Some macros do nothing with the default |bufferer|, but are needed to enable \fancyvrb\ options when a custom |bufferer| is used in conjuction with optional environment arguments. These include |\FancyVerbDefineActive| and |\FancyVerbFormatCom|. Since counters are global, the exact location of the |\setcounter| commands at the end of the environment relative to |\begingroup...\endgroup| is not important.
+% A special buffer counter is used to track line numbers while avoiding incrementing the regular counter that is used for typeset code. Some macros do nothing with the default |bufferer|, but are needed to enable \fancyvrb\ options when a custom |bufferer| is used in conjunction with optional environment arguments. These include |\FancyVerbDefineActive| and |\FancyVerbFormatCom|. Since counters are global, the exact location of the |\setcounter| commands at the end of the environment relative to |\begingroup...\endgroup| is not important.
% \begin{macrocode}
\newcounter{FancyVerbBufferLine}
\newcounter{FV@oldbufferlength}
@@ -3997,53 +4172,77 @@
%
%
% \subsubsection{\cmd{\VerbatimInsertBuffer}}
-% \begin{macro}{\VerbatimInsertBuffer}
-% This inserts an existing buffer created by |VerbatimBuffer| as a |Verbatim| environment. It customizes |Verbatim| internals to function with a buffer in a command context.
+% \begin{macro}{\VerbatimInsertBuffer, insertenvname}
+% This inserts an existing buffer created with |VerbatimBuffer| as a verbatim environment. By default, the inserted environment is |Verbatim|; this can be modified with the option |insertenvname| to any |Verbatim|- or |BVerbatim|-based environment, or any environment with a compatible implementation. The |Verbatim| and |BVerbatim| internals are customized to function with a buffer in a command context.
+%
+% Notes on the implementation of |\VerbatimInsertBuffer@i|:
+% \begin{itemize}
+% \item The active |^^M| allows a verbatim environment to read optional arguments in the usual way, without requiring modifications to argument-reading macros.
+% \item The |\begingroup\fvset{#1}\global\let\FV@CurrentVerbatimInsertEnvName...| is used to extract any |insertenvname| setting from optional arguments. Most optional arguments apply to the verbatim environment or to the customized verbatim internals that are invoked within it. However, |insertenvname| is needed earlier to determine which verbatim environment is in use. It is not possible simply to use |\fvset{#1}| before the verbatim environment to apply all settings, because that would conflict with the precedence of option processing in |\FV@Environment|.
+% \end{itemize}
% \begin{macrocode}
-\newcommand{\VerbatimInsertBuffer}[1][]{%
- \begingroup
+\define@key{FV}{insertenvname}{%
+ \def\FV@VerbatimInsertEnvName{#1}}
+\fvset{insertenvname=Verbatim}
+\def\FV@Environment@InsertBuffer#1#2{%
\def\FV@KeyValues{#1}%
- \def\FV@Scan{%
- \FV@CatCodes
- \xdef\FV@EnvironName{Verbatim}%
- \ifnum\expandafter\value\expandafter{\FV@bufferlengthname}=\z@\relax
- \PackageError{fvextra}%
- {Buffer length counter \FV@bufferlengthname\space is invalid or zero}%
- {}%
- \let\FV@GetLine\relax
+ \FV@GetKeyValues{\@nameuse{FVB@#2}}}
+\def\FV@Scan@InsertBuffer{%
+ \FV@CatCodes
+ \xdef\FV@EnvironName{\FV@VerbatimInsertEnvName}%
+ \ifnum\expandafter\value\expandafter{\FV@bufferlengthname}=\z@\relax
+ \PackageError{fvextra}%
+ {Buffer length counter \FV@bufferlengthname\space is invalid or zero}%
+ {}%
+ \let\FV@GetLine\relax
+ \fi
+ \FV@BeginScanning}%
+\def\VerbatimInsertBuffer@def@FV@Line#1{%
+ \FVExtraRetokenizeVArg{\def\FV@Line}{}{#1}}
+\def\FancyVerbGetLine@VerbatimInsertBuffer{%
+ \ifnum\value{FancyVerbBufferIndex}>%
+ \expandafter\value\expandafter{\FV@bufferlengthname}\relax
+ \global\let\FV@EnvironName\relax
+ \let\next\relax
+ \else
+ \ifcsname\FancyVerbBufferLineName\arabic{FancyVerbBufferIndex}\endcsname
+ \expandafter\let\expandafter\FV@Line@Buffer
+ \csname\FancyVerbBufferLineName\arabic{FancyVerbBufferIndex}\endcsname
+ \expandafter\VerbatimInsertBuffer@def@FV@Line\expandafter{\FV@Line@Buffer}%
+ \def\next{\FV@PreProcessLine\FV@GetLine}%
+ \stepcounter{FancyVerbBufferIndex}%
+ \else
+ \def\next{%
+ \PackageError{fvextra}%
+ {Buffer with line macro named
+ "\FancyVerbBufferLineName\arabic{FancyVerbBufferIndex}" does not exist}%
+ {Check bufferlinename, bufferlengthname, and globalbuffer settings}%
+ }%
\fi
- \FV@GetLine}%
+ \fi
+ \next}
+\newcommand{\VerbatimInsertBuffer}[1][]{%
+ \begingroup
+ \let\FV@Scan\FV@Scan@InsertBuffer
\let\FV@CheckScan\relax
+ \let\FV@Environment\FV@Environment@InsertBuffer
+ \let\FancyVerbGetLine\FancyVerbGetLine@VerbatimInsertBuffer
\setcounter{FancyVerbBufferIndex}{1}%
- \def\VerbatimInsertBuffer@def@FV@Line##1{%
- \FVExtraRetokenizeVArg{\def\FV@Line}{}{##1}}
- \def\FancyVerbGetLine{%
- \ifnum\value{FancyVerbBufferIndex}>%
- \expandafter\value\expandafter{\FV@bufferlengthname}\relax
- \global\let\FV@EnvironName\relax
- \let\next\relax
- \else
- \ifcsname\FancyVerbBufferLineName\arabic{FancyVerbBufferIndex}\endcsname
- \expandafter\let\expandafter\FV@Line@Buffer
- \csname\FancyVerbBufferLineName\arabic{FancyVerbBufferIndex}\endcsname
- \expandafter\VerbatimInsertBuffer@def@FV@Line\expandafter{\FV@Line@Buffer}%
- \def\next{\FV@PreProcessLine\FV@GetLine}%
- \stepcounter{FancyVerbBufferIndex}%
- \else
- \def\next{%
- \PackageError{fvextra}%
- {Buffer with line macro named
- "\FancyVerbBufferLineName\arabic{FancyVerbBufferIndex}" does not exist}%
- {Check bufferlinename, bufferlengthname, and globalbuffer settings}%
- }%
- \fi
- \fi
- \next}%
- \FVB@Verbatim
- \FVE@Verbatim
+ \VerbatimInsertBuffer@i{#1}%
\setcounter{FancyVerbBufferIndex}{0}%
\endgroup
\@doendpe}
+\begingroup
+\catcode`\^^M=\active
+\gdef\VerbatimInsertBuffer@i#1{%
+ \begingroup%
+ \fvset{#1}%
+ \global\let\FV@CurrentVerbatimInsertEnvName\FV@VerbatimInsertEnvName%
+ \endgroup%
+ \csname \FV@CurrentVerbatimInsertEnvName\endcsname[#1]^^M%
+ \csname end\FV@CurrentVerbatimInsertEnvName\endcsname%
+ \global\let\FV@CurrentVerbatimInsertEnvName\FV@Undefined}%
+\endgroup
% \end{macrocode}
% \end{macro}
%
@@ -4714,7 +4913,7 @@
%
%
% \begin{macro}{\FV@ListProcessLine@NoBreak}
-% Redefined |\FV@ListProcessLine| in which |\FancyVerbFormatText| is added and tab handling is explicit. The |@NoBreak| suffix is added because |\FV@ListProcessLine| will be |\let| to either this macro or to |\FV@ListProcessLine@Break| depending on whether line breaking is enabled.
+% Redefined |\FV@ListProcessLine| in which |bgcolor| support is added, |\FancyVerbFormatText| is added, and tab handling is explicit. The |@NoBreak| suffix is added because |\FV@ListProcessLine| will be |\let| to either this macro or to |\FV@ListProcessLine@Break| depending on whether line breaking is enabled.
% \begin{macrocode}
\def\FV@ListProcessLine@NoBreak#1{%
\hbox to \hsize{%
@@ -4722,9 +4921,10 @@
\hbox to \linewidth{%
\FV@LeftListNumber
\FV@LeftListFrame
- \FancyVerbFormatLine{%
- \FancyVerbHighlightLine{%
- \FV@ObeyTabs{\FancyVerbFormatText{#1}}}}\hss
+ \FV@BGColor@List{%
+ \FancyVerbFormatLine{%
+ \FancyVerbHighlightLine{%
+ \FV@ObeyTabs{\FancyVerbFormatText{#1}}}}}\hss
\FV@RightListFrame
\FV@RightListNumber}%
\hss}}
@@ -4737,6 +4937,10 @@
% \begin{macrocode}
\def\FV@BProcessLine#1{%
\hbox{\FancyVerbFormatLine{%
+ \ifx\FancyVerbBackgroundColor\relax
+ \else
+ \expandafter\FancyVerbBackgroundColorVPhantom
+ \fi
\FancyVerbHighlightLine{%
\FV@ObeyTabs{\FancyVerbFormatText{#1}}}}}}
% \end{macrocode}
@@ -4964,6 +5168,194 @@
%
%
%
+% \subsubsection{Background color}
+% \label{sec:impl:extensions:bgcolor}
+%
+% Define an option |backgroundcolor| that provides a basic implementation of a background color behind commands and environments. \pkg{tcolorbox} or a similar package should be used for more sophisticated background colors.
+% \begin{macro}{backgroundcolor,bgcolor,\FancyVerbBackgroundColor}
+% \begin{macrocode}
+\define@key{FV}{backgroundcolor}{%
+ \def\FancyVerbBackgroundColor{#1}%
+ \ifx\FancyVerbBackgroundColor\FV@None
+ \let\FancyVerbBackgroundColor\relax
+ \else\ifx\FancyVerbBackgroundColor\@empty
+ \let\FancyVerbBackgroundColor\relax
+ \fi\fi}%
+\fvset{backgroundcolor=none}
+\define@key{FV}{bgcolor}{%
+ \fvset{backgroundcolor=#1}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{backgroundcolorvphantom,bgcolorvphantom,\FancyVerbBackgroundColorVPhantom}
+% \begin{macrocode}
+\define@key{FV}{backgroundcolorvphantom}{%
+ \def\FancyVerbBackgroundColorVPhantom{#1}%
+ \ifx\FancyVerbBackgroundColorVPhantom\FV@None
+ \let\FancyVerbBackgroundColorVPhantom\relax
+ \else\ifx\FancyVerbBackgroundColorVPhantom\@empty
+ \let\FancyVerbBackgroundColorVPhantom\relax
+ \fi\fi}
+\fvset{backgroundcolorvphantom=\vphantom{\"Apgjy}}
+\define@key{FV}{bgcolorvphantom}{%
+ \fvset{backgroundcolorvphantom=#1}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{backgroundcolorpadding, bgcolorpadding, \FancyVerbBackgroundColorPadding}
+% \begin{macrocode}
+\let\FancyVerbBackgroundColorPadding\relax
+\def\FV@backgroundcolorpadding@none@framenotsingle{%
+ \fvset{frame=none,framerule,rulecolor=none}}
+\def\FV@backgroundcolorpadding@dim@framenotsingle{%
+ \fvset{frame=single,framerule=0pt,rulecolor=\FancyVerbBackgroundColor}}
+\define@key{FV}{backgroundcolorpadding}{%
+ \def\FancyVerbBackgroundColorPadding{#1}%
+ \ifx\FancyVerbBackgroundColorPadding\FV@None
+ \let\FancyVerbBackgroundColorPadding\relax
+ \else\ifx\FancyVerbBackgroundColorPadding\@empty
+ \let\FancyVerbBackgroundColorPadding\relax
+ \fi\fi
+ \let\FV@Next\relax
+ \ifx\FancyVerbBackgroundColorPadding\relax
+ \ifx\FV@BeginListFrame\FV@BeginListFrame@Single
+ \else
+ \let\FV@Next\FV@backgroundcolorpadding@none@framenotsingle
+ \fi
+ \ifx\FV@LeftListFrame\FV@LeftListFrame@Single
+ \else
+ \let\FV@Next\FV@backgroundcolorpadding@none@framenotsingle
+ \fi
+ \ifx\FV@RightListFrame\FV@RightListFrame@Single
+ \else
+ \let\FV@Next\FV@backgroundcolorpadding@none@framenotsingle
+ \fi
+ \ifx\FV@EndListFrame\FV@EndListFrame@Single
+ \else
+ \let\FV@Next\FV@backgroundcolorpadding@none@framenotsingle
+ \fi
+ \FV@Next
+ \fvset{framesep,fillcolor=none}%
+ \else
+ \ifx\FV@BeginListFrame\FV@BeginListFrame@Single
+ \else
+ \let\FV@Next\FV@backgroundcolorpadding@dim@framenotsingle
+ \fi
+ \ifx\FV@LeftListFrame\FV@LeftListFrame@Single
+ \else
+ \let\FV@Next\FV@backgroundcolorpadding@dim@framenotsingle
+ \fi
+ \ifx\FV@RightListFrame\FV@RightListFrame@Single
+ \else
+ \let\FV@Next\FV@backgroundcolorpadding@dim@framenotsingle
+ \fi
+ \ifx\FV@EndListFrame\FV@EndListFrame@Single
+ \else
+ \let\FV@Next\FV@backgroundcolorpadding@dim@framenotsingle
+ \fi
+ \FV@Next
+ \fvset{framesep=#1,fillcolor=\FancyVerbBackgroundColor}%
+ \fi}
+\define@key{FV}{bgcolorpadding}{\fvset{backgroundcolorpadding=#1}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\FV@BGColor@List}
+% Background color for environments based on |Verbatim|. Puts each line in a colorbox. The |\FancyVerbBackgroundColorVPhantom| will not have any effect in this case, unless it is larger than |\strut|.
+% \begin{macrocode}
+\def\FV@BGColor@List#1{%
+ \ifx\FancyVerbBackgroundColor\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {#1}%
+ {\setlength{\FV@TmpLength}{\fboxsep}%
+ \setlength{\fboxsep}{0pt}%
+ \colorbox{\FancyVerbBackgroundColor}{%
+ \setlength{\fboxsep}{\FV@TmpLength}%
+ \rlap{\FancyVerbBackgroundColorVPhantom\strut#1}%
+ \hspace{\linewidth}%
+ \ifx\FV@RightListFrame\relax\else
+ \hspace{-\FV@FrameSep}%
+ \hspace{-\FV@FrameRule}%
+ \fi
+ \ifx\FV@LeftListFrame\relax\else
+ \hspace{-\FV@FrameSep}%
+ \hspace{-\FV@FrameRule}%
+ \fi}%
+ \hss}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\FV@BVerbatimBegin,\FV@BVerbatimEnd}
+% Reimplementation of |BVerbatim| macros to support |bgcolor|. Much of this follows the implementation of |SaveVerbatim| and |\BUseVerbatim|.
+%
+% Key values, formatting, and tabs must be configured immediately in the |bgcolor| case, so that the background color and other settings are available. |\FV@UseKeyValues| can be invoked multiple times, but that doesn't cause any issues since |\FV@UseKeyValues| applies keys and then redefines |\FV@KeyValues| to empty.
+%
+% The definition of |\FV@BProcessLine| already accounts for |\FancyVerbBackgroundColorVPhantom|.
+% \begin{macrocode}
+\let\FV@BVerbatimBegin@NoBGColor\FV@BVerbatimBegin
+\let\FV@BVerbatimEnd@NoBGColor\FV@BVerbatimEnd
+\def\FV@BVerbatimBegin{%
+ \begingroup
+ \FV@UseKeyValues
+ \FV@FormattingPrep
+ \let\FV@FormattingPrep\relax
+ \FV@ObeyTabsInit
+ \let\FV@ObeyTabsInit\relax
+ \ifx\FancyVerbBackgroundColor\relax
+ \expandafter\FV@BVerbatimBegin@NoBGColor
+ \else
+ \expandafter\FV@BVerbatimBegin@BGColor
+ \fi}
+\def\FV@BVerbatimEnd{%
+ \ifx\FancyVerbBackgroundColor\relax
+ \expandafter\FV@BVerbatimEnd@NoBGColor
+ \else
+ \expandafter\FV@BVerbatimEnd@BGColor
+ \fi
+ \endgroup}
+\def\FV@BVerbatimBegin@BGColor{%
+ \gdef\FV@TheVerbatim{}%
+ \ifx\FV@boxwidth\relax
+ \gdef\FV@boxwidth@tmp{0pt}%
+ \def\FV@ProcessLine##1{%
+ \sbox{\FV@LineBox}{\FV@BProcessLine{##1}}%
+ \ifdim\wd\FV@LineBox>\FV@boxwidth@tmp\relax
+ \xdef\FV@boxwidth@tmp{\the\wd\FV@LineBox}%
+ \fi
+ \expandafter\gdef\expandafter\FV@TheVerbatim\expandafter{%
+ \FV@TheVerbatim\FV@ProcessLine{##1}}}%
+ \else
+ \def\FV@ProcessLine##1{%
+ \expandafter\gdef\expandafter\FV@TheVerbatim\expandafter{%
+ \FV@TheVerbatim\FV@ProcessLine{##1}}}%
+ \fi}
+\def\FV@BVerbatimEnd@BGColor{%
+ \ifx\FV@boxwidth\relax
+ \let\FV@boxwidth\FV@boxwidth@tmp
+ \global\let\FV@boxwidth@tmp\FV@Undefined
+ \fi
+ \setlength{\FV@TmpLength}{\fboxsep}%
+ \ifx\FancyVerbBackgroundColorPadding\relax
+ \setlength{\fboxsep}{0pt}%
+ \else
+ \setlength{\fboxsep}{\FancyVerbBackgroundColorPadding}%
+ \fi
+ \colorbox{\FancyVerbBackgroundColor}{%
+ \setlength{\fboxsep}{\FV@TmpLength}%
+ \FV@BVerbatimBegin@NoBGColor\FV@TheVerbatim\FV@BVerbatimEnd@NoBGColor}%
+ \gdef\FV@TheVerbatim{}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
% \subsubsection{Line highlighting or emphasis}
% \label{sec:impl:extensions:highlighting}
%
@@ -5139,6 +5531,32 @@
% \end{macro}
%
%
+% \begin{macro}{\FV@StepLineNo@Patch@HighlightLine}
+% Patch |\FV@StepLineNo| so that when |numberblanklines=false|, blank lines won't be highlighted. If the previous line is at the end of a highlighted range, then |\let| |\FV@HighlightLine:<n>| to |\FV@Undefined| to prevent further highlighting. Otherwise, leave everything as-is since the blank line(s) are within a highlighted range.
+% \begin{macrocode}
+\def\FV@StepLineNo@Patch@HighlightLine{%
+ \ifcsname FV@HighlightLine:\number\c@FancyVerbLine\endcsname
+ \@tempcnta=\c@FancyVerbLine
+ \advance\@tempcnta\@ne
+ \ifcsname FV@HighlightLine:\number\@tempcnta\endcsname
+ \else
+ \expandafter\let
+ \csname FV@HighlightLine:\number\c@FancyVerbLine\endcsname\FV@Undefined
+ \fi
+ \fi}
+\patchcmd{\FV@StepLineNo}%
+ {\ifx\FV@Line\empty}%
+ {\ifx\FV@Line\empty\FV@StepLineNo@Patch@HighlightLine}%
+ {}%
+ {\PackageError{fvextra}%
+ {Failed to patch \string\FV@StepLineNo\ to make highlightlines
+ compatible with numberblanklines}%
+ {Failed to patch \string\FV@StepLineNo\ to make highlightlines
+ compatible with numberblanklines}}
+% \end{macrocode}
+% \end{macro}
+%
+%
%
%
% \subsection{Line breaking}
@@ -5350,6 +5768,7 @@
%
%
% We need macros that contain the logic for typesetting the break symbols. By default, the symbol macros contain everything regarding the symbol and its typesetting, while these macros contain pure logic. The symbols should be wrapped in braces so that formatting commands (for example, |\tiny|) don't escape.
+%
% \begin{macro}{\FancyVerbBreakSymbolLeftLogic}
% The left break symbol should only appear with continuation lines. Note that |linenumber| here refers to local line numbering for the broken line, \emph{not} line numbering for all lines in the environment being typeset.
% \begin{macrocode}
@@ -5421,6 +5840,30 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{breakanywhereinlinestretch,\FV@breakanywhereinlinestretch,\FV@ApplyBreakAnywhereInlineStretch}
+% Stretch glue to insert at potential |breakanywhere| break locations in inline contexts, to give better line widths and avoid overfull |\hbox|.
+%
+% |\FV@UseInlineKeyValues| invokes |\FV@ApplyBreakAnywhereInlineStretch| to redefine |\FancyVerbBreakAnywhereBreak| locally.
+% \begin{macrocode}
+\define@key{FV}{breakanywhereinlinestretch}{%
+ \def\FV@breakanywhereinlinestretch{#1}%
+ \ifx\FV@breakanywhereinlinestretch\FV@None
+ \let\FV@breakanywhereinlinestretch\relax
+ \else\ifx\FV@breakanywhereinlinestretch\@empty
+ \let\FV@breakanywhereinlinestretch\relax
+ \fi\fi}
+\fvset{breakanywhereinlinestretch=none}
+\def\FV@ApplyBreakAnywhereInlineStretch{%
+ \ifx\FV@breakanywhereinlinestretch\relax
+ \else
+ \let\FancyVerbBreakAnywhereBreak@Orig\FancyVerbBreakAnywhereBreak
+ \def\FancyVerbBreakAnywhereBreak{%
+ \nobreak\hspace{0pt plus \FV@breakanywhereinlinestretch}%
+ \FancyVerbBreakAnywhereBreak@Orig}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
%
% \begin{macro}{\FV@BreakBefore}
% Allow line breaking (almost) anywhere, but only before specified characters.
@@ -5452,7 +5895,7 @@
% \end{macro}
%
% \begin{macro}{\FV@BreakBeforePrep}
-% We need a way to break before characters if and only if they have been specified as breaking characters. It would be possible to do that via a nested conditional, but that would be messy. It is much simpler to create an empty macro whose name contains the character, and test for the existence of this macro. This needs to be done inside a |\begingroup...\endgroup| so that the macros do not have to be cleaned up manually. A good place to do this is in |\FV@FormattingPrep|, which is inside a group and before processing starts. The macro is added to |\FV@FormattingPrep@PreHook|, which contains \fvextra\ exntensions to |\FV@FormattingPrep|, after |\FV@BreakAfterPrep| is defined below.
+% We need a way to break before characters if and only if they have been specified as breaking characters. It would be possible to do that via a nested conditional, but that would be messy. It is much simpler to create an empty macro whose name contains the character, and test for the existence of this macro. This needs to be done inside a |\begingroup...\endgroup| so that the macros do not have to be cleaned up manually. A good place to do this is in |\FV@FormattingPrep|, which is inside a group and before processing starts. The macro is added to |\FV@FormattingPrep@PreHook|, which contains \fvextra\ extensions to |\FV@FormattingPrep|, after |\FV@BreakAfterPrep| is defined below.
%
% The procedure here is a bit roundabout. We need to use |\FV@EscChars| to handle character escapes, but the character redefinitions need to be kept local, requiring that we work within a |\begingroup...\endgroup|. So we loop through the breaking tokens and assemble a macro that will itself define character macros. Only this defining macro is declared global, and it contains \emph{expanded} characters so that there is no longer any dependence on |\FV@EscChars|.
%
@@ -5683,9 +6126,29 @@
% \end{macro}
%
%
+% \begin{macro}{breakpreferspaces,\FV@BreakHyphenation}
+% Adjust hyphenation settings for |breaklines|.
+%
+% When |breakbefore|, |breakafter|, or |breakanywhere| are in use, |\finalhyphendemerits=0| prevents the final ``word'' on a line from being put into a line segment by itself after line breaking. Otherwise, \TeX\ tries to avoid a line break (hyphenation) within a ``word'' on the penultimate line segment, and may accomplish this by introducing an unnecessary line break at the space before the last ``word.''
+%
+% |breakpreferspaces| (|\linepenalty|) determines whether line breaks are preferentially inserted at normal spaces (|breakcollapsespaces=true|, |showspaces=false|) rather than at other locations allowed by |breakbefore|, |breakafter|, or |breakanywhere|.
+% \begin{macrocode}
+\newbool{FV@breakpreferspaces}
+\booltrue{FV@breakpreferspaces}
+\define@booleankey{FV}{breakpreferspaces}%
+ {\booltrue{FV@breakpreferspaces}}%
+ {\boolfalse{FV@breakpreferspaces}}
+\def\FV@BreakHyphenation{%
+ \finalhyphendemerits=0\relax
+ \ifbool{FV@breakpreferspaces}{}{\linepenalty=\@M\relax}}
+\g@addto@macro\FV@FormattingPrep@PreHook{\FV@BreakHyphenation}
+% \end{macrocode}
+% \end{macro}
+%
+%
% \subsubsection{Line breaking implementation}
%
-% \paragraph{Helper macros}
+% \paragraph{Helper macros}\hfill\\
%
% \begin{macro}{\FV@LineBox}
% A box for saving a line of text, so that its dimensions may be determined and thus we may figure out if it needs line breaking.
@@ -5791,7 +6254,7 @@
% \begin{macro}{\FV@BreakBufferStart}
% Create a new buffer, either at the beginning of scanning or during recursion. The single mandatory argument is the macro for handling tokens, which is |\let| to |\FV@Break@Token|. An intermediate |\FV@BreakBufferStart@i| is used to optimize |\ifx| comparisons for |\FV@BreakBufferStart| during scanning.
%
-% For recursion, |\FV@BreakBuffer<n>| and |\FV@Break@Token<n>| store the state (buffer and token handling macro) immediately prior to recusion with depth |<n>|.
+% For recursion, |\FV@BreakBuffer<n>| and |\FV@Break@Token<n>| store the state (buffer and token handling macro) immediately prior to recursion with depth |<n>|.
% \begin{macrocode}
\def\FV@BreakBufferStart{%
\FV@BreakBufferStart@i}
@@ -6461,7 +6924,7 @@
%
%
%
-% \paragraph{Line processing before scanning}
+% \paragraph{Line processing before scanning}\hfill\\
%
% \begin{macro}{\FV@makeLineNumber}
% The \pkg{lineno} package is used for formatting wrapped lines and inserting break symbols. We need a version of \pkg{lineno}'s |\makeLineNumber| that is adapted for our purposes. This is adapted directly from the example |\makeLineNumber| that is given in the \pkg{lineno} documentation under the discussion of internal line numbers. The |\FV@SetLineBreakLast| is needed to determine the internal line number of the last segment of the broken line, so that we can disable the right-hand break symbol on this segment. When a right-hand break symbol is in use, a line of code will be processed twice: once to determine the last internal line number, and once to use this information only to insert right-hand break symbols on the appropriate lines. During the second run, |\FV@SetLineBreakLast| is disabled by |\let|ting it to |\relax|.
@@ -6588,8 +7051,9 @@
\FV@SaveLineBox{#1}}%
\FV@LeftListNumber
\FV@LeftListFrame
- \FancyVerbFormatLine{%
- \FancyVerbHighlightLine{\usebox{\FV@LineBox}}}%
+ \FV@BGColor@List{%
+ \FancyVerbFormatLine{%
+ \FancyVerbHighlightLine{\usebox{\FV@LineBox}}}}%
\FV@RightListFrame
\FV@RightListNumber
\ifx\FV@Tab\FV@TrueTab@UseWidth
@@ -6600,10 +7064,11 @@
\let\FancyVerbBreakStop\relax
\FV@LeftListNumber
\FV@LeftListFrame
- \FancyVerbFormatLine{%
- \FancyVerbHighlightLine{%
- \parbox[t]{\FV@LineWidth}{%
- \noindent\strut\FV@ObeyTabs{\FancyVerbFormatText{#1}}\strut}}}%
+ \FV@BGColor@List{%
+ \FancyVerbFormatLine{%
+ \FancyVerbHighlightLine{%
+ \parbox[t]{\FV@LineWidth}{%
+ \noindent\strut\FV@ObeyTabs{\FancyVerbFormatText{#1}}\strut}}}}%
\FV@RightListFrame
\FV@RightListNumber
\fi}%
@@ -6791,7 +7256,7 @@
%
% In the |breakbytoken| cases, an |\hbox| is used to prevent breaks within the macro (breaks could occur at spaces even without |\FancyVerbBreakStart|). The |breakbytokenanywhere| case is similar but a little tricky. |\FV@BreakByTokenAnywhereHook|, which is inside |\FV@SaveLineBox| where line breaking occurs, is used to define |\FV@BreakByTokenAnywhereBreak| so that it will ``do nothing'' the first time it is used and on subsequent invocations become |\FancyVerbBreakByTokenAnywhereBreak|. Because the hook is within the |internallinenumbers*| environment, the redefinition doesn't escape, and the default global definition of |\FV@BreakByTokenAnywhereBreak| as |\relax| is not affected. We don't want the actual break to appear before the first Pygments macro in case it might cause a spurious break after leading whitespace. But we must have breaks \emph{before} Pygments macros because otherwise lookahead would be necessary.
%
-% An intermediate variable |\FV@PYG| is defined to avoid problems in case |#1|$=$|#2|. There is also a check for a non-existant |#2| (|\PYG|\meta{style\_name} may not be created until a later compile in the \pkg{pythontex} case); if |#2| does not exist, fall back to |#1|. For the existance check, |\ifx...\relax| must be used instead of |\ifcsname|, because |#2| will be a macro, and will typically be created with |\csname...\endcsname| which will |\let| the macro to |\relax| if it doesn't already exist.
+% An intermediate variable |\FV@PYG| is defined to avoid problems in case |#1|$=$|#2|. There is also a check for a non-existent |#2| (|\PYG|\meta{style\_name} may not be created until a later compile in the \pkg{pythontex} case); if |#2| does not exist, fall back to |#1|. For the existence check, |\ifx...\relax| must be used instead of |\ifcsname|, because |#2| will be a macro, and will typically be created with |\csname...\endcsname| which will |\let| the macro to |\relax| if it doesn't already exist.
%
% |\FV@PYG@Redefed| is |\let| to the Pygments macro that appears literally (after redefinition), so that it can be detected elsewhere to allow for special processing, such as in |breakautoindent|.
% \begin{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..a37fc045208 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-09-03 v3.4.1.3 Class for Horizon Europe (R)IA proposals]
%</class>
%
%<*driver>
@@ -50,7 +50,7 @@
%</driver>
% \fi
%
-% \CheckSum{1506}
+% \CheckSum{1521}
%
% \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,32 @@
%
% 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.3 (2024-09-03)] Fixed a bug where the person-months in
+% Table 3.1a were doubled.
+% \item[v3.4.1.2 (2024-09-03)] Fixed a bug where the column totals in
+% Table 3.1f were doubled.
+% \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 +623,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}
@@ -692,7 +732,7 @@
& #2 & \getPnum{#3} & #3 & %
\@ifundefined{@wpTotalPersonMonths\arabic{@wp#1num}}%
{\textbf{??}}%
- {\disptoken{@wpTotalPersonMonths\arabic{@wp#1num}}}%
+ {\fpeval{\disptoken{@wpTotalPersonMonths\arabic{@wp#1num}}/2}}%
& #4 & #5}}%
\@esphack
\ifthenelse{\arabic{@wp#1num}=1}{}{\bigskip}
@@ -1072,7 +1112,7 @@
\whiledo{\value{@secolumn}<\value{@wpcount}}{%
\stepcounter{@secolumn}%
\edef\serowtemp{\serowtemp&\fpeval{round(\csname %
- @wpPersonMonths\arabic{@secolumn}\endcsname,0)}}%
+ @wpPersonMonths\arabic{@secolumn}\endcsname/2,0)}}%
\@bsphack
\protected@write\@auxout{}%
{\string\expandafter\string\expandafter\string\expandafter%
@@ -1081,7 +1121,7 @@
\arabic{@secolumn}},0)}}}%
\@esphack
}
- \serowtemp & \fpeval{round(\setotalpm,0)} \\
+ \serowtemp & \fpeval{round(\setotalpm/2,0)} \\
\hline
\end{xltabular}
\end{center}
@@ -1459,7 +1499,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 +1513,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 +2028,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 +2412,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 +2493,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 +2509,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 +2521,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/iaria-lite/iaria-lite.dtx b/Master/texmf-dist/source/latex/iaria-lite/iaria-lite.dtx
index 3bc6f34d288..c6d98a9f1eb 100644
--- a/Master/texmf-dist/source/latex/iaria-lite/iaria-lite.dtx
+++ b/Master/texmf-dist/source/latex/iaria-lite/iaria-lite.dtx
@@ -1,16 +1,16 @@
%\iffalse
% iaria-lite.dtx generated using makedtx version 1.2 (c) Nicola Talbot
% Command line args:
-% -dir "src"
% -preamble "Copyright 2023-2024 Christoph P. Neumann 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 any later version. The latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2008 or later. This work has the LPPL maintenance status maintained. The Current Maintainer of this work is Christoph P. Neumann. "
% -macrocode ".*"
% -setambles ".*=>\nopreamble"
-% -doc "doc/iaria-lite.tex"
% -src "(_cpn_copyIntoExamplesFolder_cls.cmd|iaria-lite.cls)=>\1"
-% -author "Christoph P. Neumann "
% -date "2024-2024"
+% -dir "src"
+% -author "Christoph P. Neumann "
+% -doc "doc/iaria-lite.tex"
% iaria-lite
-% Created on 2024/4/10 18:20
+% Created on 2024/9/14 21:27
%\fi
%\iffalse
%<*package>
@@ -56,7 +56,7 @@
%\title{\textsf{iaria-lite}\\
% An Unofficial IARIA LaTeX Class (Lite Version)}
%\author{Christoph P.\ Neumann \texttt{$<$cyberpetaneuron@gmail.com$>$}}
-%\date{Version 0.2}
+%\date{Version 0.4}
%\maketitle
%\PrintChanges
%
@@ -122,14 +122,34 @@
%This package provides the documentclass \texttt{iaria-lite}. The documentclass
%supports the following options:
%
-%
%\begin{itemize}
%\item |conference| Passed to IEEEtran
%\item |a4paper| Passed to IEEEtran
-%\item |flushend| Activate flushend package
-%\item |pbalance| Activate pbalance package
+%\item |subfig| Loads subfig package with IARIA style settings
+%\item |subcaption| Loads subcaption package with IARIA style settings
+%\item |flushend| Activate flushend package (compatible with arXiv build process)
+%\item |pbalance| Activate pbalance package (incompatible with arXiv build process)
%\end{itemize}
%
+%A Remark about two-column document balancing on the last page:
+%The flushend package is recommended, because it works within the arXiv automated build process.
+%However, flushend has a major incampatibility with package lineno, which is, e.\,g., transitively loaded by package mindflow.
+%Thus, in case when flushend does not have any effect, check whether one of your packages loads lineno.
+%Usually you are stuck with your packages and, thus, will instead be forced to switch from flushend to pbalance.
+%Please be aware that pbalance works great and has high compatibility, but unfortunately it will not have any effect within the arXiv automated build process.
+%In case of both, a somehow needed lineno package and an intended arXiv upload, I recommend to do without two-column balancing on the last page and just to stay away from both flushend and pbalance, in order to ensure that your paper is layouted identically in IARIA submission and arXiv upload.
+%I hope this remark proves helpful, it took me some nerve to find out.
+%
+%There is also another important difference between flushend and pbalance: the handling of footnotes on the last page.
+%Flushend provides a decent result, but the result of pbalance is incomprehensible.
+%I strongly recommend avoiding footnotes on the last page.
+%If you absolutely need footnotes on the last page, consider staying away from two-column balancing on the last page.
+%
+%About subfigures:
+%Both well-known packages subfig and subcaption can be used.
+%However, they are not compatible with each other and we can either load one or the other.
+%Both require dedicated style settings to be compatible with IARIA formatting rules.
+%Thus, the document class provides options to load them for you with correct settings.
%
%\section{Requirements}
%
@@ -144,6 +164,8 @@
%\item hyperref
%\item orcidlink
%\item pbalance
+%\item subcaption
+%\item subfig
%\item times
%\item url
%\item xcolor
@@ -198,13 +220,25 @@ pause% \end{macrocode}
\NeedsTeXFormat{LaTeX2e}
% Provide the name of your document class, the date it was last updated, and a comment about what it's used for
-\ProvidesClass{iaria-lite}[2024/04/10 unofficial IARIA-lite conference template v0.2]
+\ProvidesClass{iaria-lite}[2024/09/16 unofficial IARIA-lite conference template v0.4]
% Define marker counter for options (counter are global in latex):
+\newcounter{iaria@subfigtracker}
+\newcounter{iaria@subcaptiontracker}
\newcounter{iaria@pbalancetracker}
\newcounter{iaria@flushendtracker}
% Declare options:
+
+\DeclareOption{subfig}{
+ \setcounter{iaria@subfigtracker}{1}
+ \typeout{iaria class: subfig option is set (use subfloat command).}
+}
+\DeclareOption{subcaption}{
+ \setcounter{iaria@subcaptiontracker}{1}
+ \typeout{iaria class: subcaption option is set (use subfigure command).}
+}
+
\DeclareOption{onecolumn}{\OptionNotUsed} % IEEE option onecolumn will be ignored
\DeclareOption{pbalance}{
@@ -274,9 +308,6 @@ pause% \end{macrocode}
\crcr}
\makeatother
-% IARIA subfigure captions require this:
-\RequirePackage[caption=false,font=footnotesize]{subfig}
-
% IARIA requires to bring the table caption in the same line of "Table I"
\usepackage{etoolbox}
\makeatletter
@@ -287,6 +318,17 @@ pause% \end{macrocode}
{}
\makeatother
+% IARIA subfigure captions require parentheses and footnotesize:
+\ifnum\value{iaria@subfigtracker}=1
+ \typeout{iaria class: load subfig package (use subfloat command).}
+ \RequirePackage[caption=false,font=footnotesize]{subfig}
+\fi
+\ifnum\value{iaria@subcaptiontracker}=1
+ \typeout{iaria class: load subcaption package (use subfigure command).}
+ \RequirePackage{subcaption}
+ \captionsetup[subfigure]{labelformat=parens,font=footnotesize}
+\fi
+
% Balance/level columns at the last page / in bibliography
% DISCLAIMER: No solution is a 100%/perfect one!
% Mainstream option: pbalance (see https://ctan.org/pkg/pbalance)
diff --git a/Master/texmf-dist/source/latex/iaria-lite/iaria-lite.ins b/Master/texmf-dist/source/latex/iaria-lite/iaria-lite.ins
index 5f61f6cac0f..84f0e6507f9 100644
--- a/Master/texmf-dist/source/latex/iaria-lite/iaria-lite.ins
+++ b/Master/texmf-dist/source/latex/iaria-lite/iaria-lite.ins
@@ -1,4 +1,4 @@
-% iaria-lite.ins generated using makedtx version 1.2 2024/4/10 18:20
+% iaria-lite.ins generated using makedtx version 1.2 2024/9/14 21:27
\input docstrip
\preamble
diff --git a/Master/texmf-dist/source/latex/iaria/iaria.dtx b/Master/texmf-dist/source/latex/iaria/iaria.dtx
index bc091c3b839..e9e8b446444 100644
--- a/Master/texmf-dist/source/latex/iaria/iaria.dtx
+++ b/Master/texmf-dist/source/latex/iaria/iaria.dtx
@@ -1,16 +1,16 @@
%\iffalse
% iaria.dtx generated using makedtx version 1.2 (c) Nicola Talbot
% Command line args:
-% -author "Christoph P. Neumann "
-% -dir "src"
+% -setambles ".*=>\nopreamble"
% -src "(_cpn_copyIntoExamplesFolder_cls.cmd|iaria.cls)=>\1"
% -preamble "Copyright 2023-2024 Christoph P. Neumann 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 any later version. The latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2008 or later. This work has the LPPL maintenance status maintained. The Current Maintainer of this work is Christoph P. Neumann. "
+% -author "Christoph P. Neumann "
+% -macrocode ".*"
% -date "2023-2024"
+% -dir "src"
% -doc "doc/iaria.tex"
-% -macrocode ".*"
-% -setambles ".*=>\nopreamble"
% iaria
-% Created on 2024/4/10 18:20
+% Created on 2024/9/14 21:35
%\fi
%\iffalse
%<*package>
@@ -56,7 +56,7 @@
%\title{\textsf{iaria}\\
%An Unofficial IARIA LaTeX Class}
%\author{Christoph P.\ Neumann \texttt{$<$cyberpetaneuron@gmail.com$>$}}
-%\date{Version 0.2}
+%\date{Version 0.4}
%\maketitle
%\PrintChanges
%
@@ -104,7 +104,7 @@
%
%\section{Templates}
%
-%For a quick start the \textsf{iaria-lite} distribution contains document
+%For a quick start the \textsf{iaria} distribution contains document
%templates.
%The templates can be found in the \texttt{iaria-example-neumann.zip} file.
%
@@ -114,14 +114,35 @@
%This package provides the documentclass \texttt{iaria}. The documentclass
%supports the following options:
%
-%
%\begin{itemize}
%\item |conference| Passed to IEEEtran
%\item |a4paper| Passed to IEEEtran
-%\item |flushend| Activate flushend package
-%\item |pbalance| Activate pbalance package
+%\item |subfig| Loads subfig package with IARIA style settings
+%\item |subcaption| Loads subcaption package with IARIA style settings
+%\item |flushend| Activate flushend package (compatible with arXiv build process)
+%\item |pbalance| Activate pbalance package (incompatible with arXiv build process)
%\end{itemize}
%
+%A Remark about two-column document balancing on the last page:
+%The flushend package is recommended, because it works within the arXiv automated build process.
+%However, flushend has a major incampatibility with package lineno, which is, e.\,g., transitively loaded by package mindflow.
+%Thus, in case when flushend does not have any effect, check whether one of your packages loads lineno.
+%Usually you are stuck with your packages and, thus, will instead be forced to switch from flushend to pbalance.
+%Please be aware that pbalance works great and has high compatibility, but unfortunately it will not have any effect within the arXiv automated build process.
+%In case of both, a somehow needed lineno package and an intended arXiv upload, I recommend to do without two-column balancing on the last page and just to stay away from both flushend and pbalance, in order to ensure that your paper is layouted identically in IARIA submission and arXiv upload.
+%I hope this remark proves helpful, it took me some nerve to find out.
+%
+%There is also another important difference between flushend and pbalance: the handling of footnotes on the last page.
+%Flushend provides a decent result, but the result of pbalance is incomprehensible.
+%I strongly recommend avoiding footnotes on the last page.
+%If you absolutely need footnotes on the last page, consider staying away from two-column balancing on the last page.
+%
+%About subfigures:
+%Both well-known packages subfig and subcaption can be used.
+%However, they are not compatible with each other and we can either load one or the other.
+%Both require dedicated style settings to be compatible with IARIA formatting rules.
+%Thus, the document class provides options to load them for you with correct settings.
+%
%\section{Requirements}
%
%We instrument several other \LaTeX\ packages for different purposes,
@@ -138,6 +159,8 @@
%\item inputenc
%\item orcidlink
%\item pbalance
+%\item subcaption
+%\item subfig
%\item times
%\item url
%\item xcolor
@@ -206,13 +229,25 @@ pause% \end{macrocode}
\NeedsTeXFormat{LaTeX2e}
% Provide the name of your document class, the date it was last updated, and a comment about what it's used for
-\ProvidesClass{iaria}[2024/04/10 unofficial IARIA conference template v0.2]
+\ProvidesClass{iaria}[2024/09/16 unofficial IARIA conference template v0.4]
% Define marker counter for options (counter are global in latex):
+\newcounter{iaria@subfigtracker}
+\newcounter{iaria@subcaptiontracker}
\newcounter{iaria@pbalancetracker}
\newcounter{iaria@flushendtracker}
% Declare options:
+
+\DeclareOption{subfig}{
+ \setcounter{iaria@subfigtracker}{1}
+ \typeout{iaria class: subfig option is set (use subfloat command).}
+}
+\DeclareOption{subcaption}{
+ \setcounter{iaria@subcaptiontracker}{1}
+ \typeout{iaria class: subcaption option is set (use subfigure command).}
+}
+
\DeclareOption{onecolumn}{\OptionNotUsed} % IEEE option onecolumn will be ignored
\DeclareOption{pbalance}{
@@ -259,7 +294,15 @@ pause% \end{macrocode}
% Diferring from IEEE, IARIA requires
% in bibliography: 6+ authors as first author et al.
% in \citeauthor: any case of et al. with just first author et al.
-\RequirePackage[style=ieee, backend=biber, url=false, hyperref, maxnames=5, minnames=1, maxcitenames=2, mincitenames=1]{biblatex}
+\RequirePackage[defernumbers=true,style=ieee, backend=biber, url=false, hyperref, maxnames=5, minnames=1, maxcitenames=2, mincitenames=1]{biblatex}
+
+% Due to applied option defernumbers=true:
+% Prevent citations in the references are being numbered as '0' in ArXiv
+% https://tex.stackexchange.com/questions/463556/all-the-citations-in-the-references-are-being-numbered-as-0-in-arxiv-while-upl
+\makeatletter
+\let\blx@rerun@biber\relax
+\makeatother
+
\renewcommand*{\bibfont}{\small}
% Diferring from IEEE, IARIA requires, for ONLINE entries, no point but a comma between author and title:
@@ -332,9 +375,6 @@ pause% \end{macrocode}
\crcr}
\makeatother
-% IARIA subfigure captions require this:
-\RequirePackage[caption=false,font=footnotesize]{subfig}
-
% IARIA requires to bring the table caption in the same line of "Table I"
\usepackage{etoolbox}
\makeatletter
@@ -345,9 +385,16 @@ pause% \end{macrocode}
{}
\makeatother
-% Allows to hyphenate a word that contains a dash:
-% https://stackoverflow.com/questions/2193307/how-do-i-get-latex-to-hyphenate-a-word-that-contains-a-dash
-\RequirePackage[shortcuts]{extdash} % Use \-/ for a breakable dash that does not prevent the remainer of the word to be hyphenated
+% IARIA subfigure captions require parentheses and footnotesize:
+\ifnum\value{iaria@subfigtracker}=1
+ \typeout{iaria class: load subfig package (use subfloat command).}
+ \RequirePackage[caption=false,font=footnotesize]{subfig}
+\fi
+\ifnum\value{iaria@subcaptiontracker}=1
+ \typeout{iaria class: load subcaption package (use subfigure command).}
+ \RequirePackage{subcaption}
+ \captionsetup[subfigure]{labelformat=parens,font=footnotesize}
+\fi
% Balance/level columns at the last page / in bibliography
% DISCLAIMER: No solution is a 100%/perfect one!
@@ -363,6 +410,14 @@ pause% \end{macrocode}
\RequirePackage{flushend}
\fi
+% ========================================================
+% Packages with recommendation to load them last:
+
+% Allows to hyphenate a word that contains a dash:
+% https://stackoverflow.com/questions/2193307/how-do-i-get-latex-to-hyphenate-a-word-that-contains-a-dash
+\RequirePackage[shortcuts]{extdash} % Use \-/ for a breakable dash that does not prevent the remainer of the word to be hyphenated
+% ========================================================
+
% Finally, we'll use \endinput to indicate that LaTeX can stop reading this file. LaTeX will ignore anything after this line.
\endinput
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/iaria/iaria.ins b/Master/texmf-dist/source/latex/iaria/iaria.ins
index 846e42400dc..4bc3d864b88 100644
--- a/Master/texmf-dist/source/latex/iaria/iaria.ins
+++ b/Master/texmf-dist/source/latex/iaria/iaria.ins
@@ -1,4 +1,4 @@
-% iaria.ins generated using makedtx version 1.2 2024/4/10 18:20
+% iaria.ins generated using makedtx version 1.2 2024/9/14 21:35
\input docstrip
\preamble
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/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/jlreq/Makefile b/Master/texmf-dist/source/latex/jlreq/Makefile
index ed84b713364..9a615ebc0a8 100644
--- a/Master/texmf-dist/source/latex/jlreq/Makefile
+++ b/Master/texmf-dist/source/latex/jlreq/Makefile
@@ -1,51 +1,53 @@
TEXMF:=$(shell kpsewhich -var-value=TEXMFHOME)
MAKEJVFCNF:=$(shell ls -R $(shell kpsewhich --var-value=TEXMFDIST)/fonts/source | awk '/:$$/{sub(/:$$/,"");f=$$0} tolower($$0) ~ /makejvf-upjpn\.cnf$$/{print f"/"$$0}' | head -n 1)
-.PHONY: all jfm doc latexdoc pdfdoc htmldoc jfm-install cls-install sty-install install tds uninstall jfmclean docclean clean
-
-all: jfm
-
-jfm: \
- jfm-jlreqv.lua jfm-jlreqv-jidori.lua \
- jlreq.tfm bjlreq.tfm zjlreq.tfm bzjlreq.tfm \
- jlreq.vf bjlreq.vf zjlreq.vf bzjlreq.vf \
- ujlreq.tfm ubjlreq.tfm uzjlreq.tfm ubzjlreq.tfm \
+VFS = jlreq.vf bjlreq.vf zjlreq.vf bzjlreq.vf \
ujlreq.vf ubjlreq.vf uzjlreq.vf ubzjlreq.vf \
- ujlreq-q.tfm ubjlreq-q.tfm uzjlreq-q.tfm ubzjlreq-q.tfm \
ujlreq-q.vf ubjlreq-q.vf uzjlreq-q.vf ubzjlreq-q.vf \
- jlreqg.tfm bjlreqg.tfm zjlreqg.tfm bzjlreqg.tfm \
jlreqg.vf bjlreqg.vf zjlreqg.vf bzjlreqg.vf \
- ujlreqg.tfm ubjlreqg.tfm uzjlreqg.tfm ubzjlreqg.tfm \
ujlreqg.vf ubjlreqg.vf uzjlreqg.vf ubzjlreqg.vf \
- ujlreqg-q.tfm ubjlreqg-q.tfm uzjlreqg-q.tfm ubzjlreqg-q.tfm \
ujlreqg-q.vf ubjlreqg-q.vf uzjlreqg-q.vf ubzjlreqg-q.vf \
- jlreq-v.tfm bjlreq-v.tfm zjlreq-v.tfm bzjlreq-v.tfm \
jlreq-v.vf bjlreq-v.vf zjlreq-v.vf bzjlreq-v.vf \
- ujlreq-v.tfm ubjlreq-v.tfm uzjlreq-v.tfm ubzjlreq-v.tfm \
ujlreq-v.vf ubjlreq-v.vf uzjlreq-v.vf ubzjlreq-v.vf \
- jlreqg-v.tfm bjlreqg-v.tfm zjlreqg-v.tfm bzjlreqg-v.tfm \
jlreqg-v.vf bjlreqg-v.vf zjlreqg-v.vf bzjlreqg-v.vf \
- ujlreqg-v.tfm ubjlreqg-v.tfm uzjlreqg-v.tfm ubzjlreqg-v.tfm \
ujlreqg-v.vf ubjlreqg-v.vf uzjlreqg-v.vf ubzjlreqg-v.vf \
jlreq-jidori.tfm jlreq-jidori.vf jlreqg-jidori.tfm jlreqg-jidori.vf \
jlreq-v-jidori.tfm jlreq-v-jidori.vf jlreqg-v-jidori.tfm jlreqg-v-jidori.vf \
ujlreq-jidori.tfm ujlreq-jidori.vf ujlreqg-jidori.tfm ujlreqg-jidori.vf \
ujlreq-jidori-q.tfm ujlreq-jidori-q.vf ujlreqg-jidori-q.tfm ujlreqg-jidori-q.vf \
ujlreq-v-jidori.tfm ujlreq-v-jidori.vf ujlreqg-v-jidori.tfm ujlreqg-v-jidori.vf
+
+TFMS = jlreq.tfm bjlreq.tfm zjlreq.tfm bzjlreq.tfm \
+ ujlreq.tfm ubjlreq.tfm uzjlreq.tfm ubzjlreq.tfm \
+ ujlreq-q.tfm ubjlreq-q.tfm uzjlreq-q.tfm ubzjlreq-q.tfm \
+ jlreqg.tfm bjlreqg.tfm zjlreqg.tfm bzjlreqg.tfm \
+ ujlreqg.tfm ubjlreqg.tfm uzjlreqg.tfm ubzjlreqg.tfm \
+ ujlreqg-q.tfm ubjlreqg-q.tfm uzjlreqg-q.tfm ubzjlreqg-q.tfm \
+ jlreq-v.tfm bjlreq-v.tfm zjlreq-v.tfm bzjlreq-v.tfm \
+ ujlreq-v.tfm ubjlreq-v.tfm uzjlreq-v.tfm ubzjlreq-v.tfm \
+ jlreqg-v.tfm bjlreqg-v.tfm zjlreqg-v.tfm bzjlreqg-v.tfm \
+ ujlreqg-v.tfm ubjlreqg-v.tfm uzjlreqg-v.tfm ubzjlreqg-v.tfm
+
+
+.PHONY: all jfm doc latexdoc pdfdoc htmldoc jfm-install cls-install sty-install install tds uninstall jfmclean docclean clean
+
+all: jfm
+
+jfm: jfm-jlreqv.lua jfm-jlreqv-jidori.lua $(VFS) $(TFMS)
rm -f rml.tfm rmlv.tfm gbm.tfm gbmv.tfm uprml-h.tfm uprml-hq.tfm upgbm-h.tfm upgbm-hq.tfm uprml-v.tfm uprml-vq.tfm upgbm-v.tfm upgbm-vq.tfm
# .pl
-u%-v.pl: jfm-%v-pl.lua luajfm2pl.lua
+ujlreq-v.pl ubjlreq-v.pl uzjlreq-v.pl ubzjlreq-v.pl: u%-v.pl: jfm-%v-pl.lua luajfm2pl.lua
texlua luajfm2pl.lua $*v-pl $@
-%-v.pl: jfm-%v-pl.lua luajfm2pl.lua
+jlreq-v.pl bjlreq-v.pl zjlreq-v.pl bzjlreq-v.pl: %-v.pl: jfm-%v-pl.lua luajfm2pl.lua
texlua luajfm2pl.lua --noutf $*v-pl $@
-u%.pl: jfm-%-pl.lua luajfm2pl.lua
+ujlreq.pl ubjlreq.pl uzjlreq.pl ubzjlreq.pl: u%.pl: jfm-%-pl.lua luajfm2pl.lua
texlua luajfm2pl.lua $*-pl $@
-%.pl: jfm-%-pl.lua luajfm2pl.lua
+jlreq.pl bjlreq.pl zjlreq.pl bzjlreq.pl: %.pl: jfm-%-pl.lua luajfm2pl.lua
texlua luajfm2pl.lua --noutf $*-pl $@
jlreq-jidori.pl: jfm-jlreq-jidori-pl.lua
@@ -62,34 +64,34 @@ ujlreq-v-jidori.pl: jfm-jlreqv-jidori-pl.lua
# .vf
-u%g-q.vf: u%g-q.tfm
+ujlreqg-q.vf ubjlreqg-q.vf uzjlreqg-q.vf ubzjlreqg-q.vf: %.vf: %.tfm
makejvf -i -u jisq $< upgbm-hq.tfm
-u%-q.vf: u%-q.tfm
+ujlreq-q.vf ubjlreq-q.vf uzjlreq-q.vf ubzjlreq-q.vf: %.vf: %.tfm
makejvf -i -u jisq $< uprml-hq.tfm
-u%g-v.vf: u%g-v.tfm
+ujlreqg-v.vf ubjlreqg-v.vf uzjlreqg-v.vf ubzjlreqg-v.vf: %.vf: %.tfm
makejvf -i -u custom -t ${MAKEJVFCNF} $< upgbm-v.tfm
-u%g.vf: u%g.tfm u%g-q.tfm
- makejvf -i -u custom -t ${MAKEJVFCNF} -H -U u$*g-q $< upgbm-h.tfm
+ujlreqg.vf ubjlreqg.vf uzjlreqg.vf ubzjlreqg.vf: %.vf: %.tfm %-q.tfm
+ makejvf -i -u custom -t ${MAKEJVFCNF} -H -U $*-q $< upgbm-h.tfm
-%g-v.vf: %g-v.tfm
+jlreqg-v.vf bjlreqg-v.vf zjlreqg-v.vf bzjlreqg-v.vf: %.vf: %.tfm
makejvf -i $< gbmv.tfm
-%g.vf: %g.tfm
+jlreqg.vf bjlreqg.vf zjlreqg.vf bzjlreqg.vf: %.vf: %.tfm
makejvf -i $< gbm.tfm
-u%-v.vf: u%-v.tfm
+ujlreq-v.vf ubjlreq-v.vf uzjlreq-v.vf ubzjlreq-v.vf: %.vf: %.tfm
makejvf -i -u custom -t ${MAKEJVFCNF} $< uprml-v.tfm
-%-v.vf: %-v.tfm
+jlreq-v.vf bjlreq-v.vf zjlreq-v.vf bzjlreq-v.vf: %.vf: %.tfm
makejvf -i $< rmlv.tfm
-u%.vf: u%.tfm u%-q.tfm
- makejvf -i -u custom -t ${MAKEJVFCNF} -H -U u$*-q $< uprml-h.tfm
+ujlreq.vf ubjlreq.vf uzjlreq.vf ubzjlreq.vf: %.vf: %.tfm %-q.tfm
+ makejvf -i -u custom -t ${MAKEJVFCNF} -H -U $*-q $< uprml-h.tfm
-%.vf: %.tfm
+jlreq.vf bjlreq.vf zjlreq.vf bzjlreq.vf: %.vf: %.tfm
makejvf -i $< rml.tfm
jlreq-jidori.vf: jlreq-jidori.tfm
@@ -124,28 +126,28 @@ ujlreqg-v-jidori.vf: ujlreqg-v-jidori.tfm
# .tfm
-u%-q.tfm: u%.pl
+ujlreq-q.tfm ubjlreq-q.tfm uzjlreq-q.tfm ubzjlreq-q.tfm: %-q.tfm: %.pl
uppltotf -kanji=uptex $< $@
-u%g-q.tfm: u%-q.tfm
+ujlreqg-q.tfm ubjlreqg-q.tfm uzjlreqg-q.tfm ubzjlreqg-q.tfm: %g-q.tfm: %-q.tfm
cp $< $@
-%g-v.tfm: %-v.tfm
+jlreqg-v.tfm bjlreqg-v.tfm zjlreqg-v.tfm bzjlreqg-v.tfm ujlreqg-v.tfm ubjlreqg-v.tfm uzjlreqg-v.tfm ubzjlreqg-v.tfm: %g-v.tfm: %-v.tfm
cp $< $@
-%g.tfm: %.tfm
+jlreqg.tfm bjlreqg.tfm zjlreqg.tfm bzjlreqg.tfm ujlreqg.tfm ubjlreqg.tfm uzjlreqg.tfm ubzjlreqg.tfm: %g.tfm: %.tfm
cp $< $@
-u%.tfm: u%.pl
+ujlreq.tfm ubjlreq.tfm uzjlreq.tfm ubzjlreq.tfm ujlreq-v.tfm ubjlreq-v.tfm uzjlreq-v.tfm ubzjlreq-v.tfm: %.tfm: %.pl
uppltotf -kanji=uptex $< $@
-%.tfm: %.pl
+jlreq.tfm bjlreq.tfm zjlreq.tfm bzjlreq.tfm jlreq-v.tfm bjlreq-v.tfm zjlreq-v.tfm bzjlreq-v.tfm: %.tfm: %.pl
ppltotf -kanji=utf8 $< $@
-ujlreq%-jidori.tfm: ujlreq%-jidori.pl
+ujlreq-jidori.tfm ujlreq-v-jidori.tfm: %.tfm: %.pl
uppltotf -kanji=uptex $< $@
-jlreq%-jidori.tfm: jlreq%-jidori.pl
+jlreq-jidori.tfm jlreq-v-jidori.tfm: %.tfm: %.pl
ppltotf -kanji=utf8 $< $@
ujlreqg-jidori.tfm: ujlreq-jidori.tfm
@@ -202,9 +204,9 @@ jlreq-trimmarks.html: jlreq-trimmarks.md README-template.html
jfm-install: jfm
mkdir -p ${TEXMF}/fonts/tfm/public/jlreq
- install *.tfm ${TEXMF}/fonts/tfm/public/jlreq
+ install ${TFMS} ${TEXMF}/fonts/tfm/public/jlreq
mkdir -p ${TEXMF}/fonts/vf/public/jlreq
- install *.vf ${TEXMF}/fonts/vf/public/jlreq
+ install ${VFS} ${TEXMF}/fonts/vf/public/jlreq
mkdir -p ${TEXMF}/tex/luatex/jlreq
install jfm-jlreqv.lua jfm-jlreq.lua jfm-jlreq-jidori.lua jfm-jlreqv-jidori.lua ${TEXMF}/tex/luatex/jlreq
@@ -222,9 +224,9 @@ install: jfm-install cls-install sty-install
tds: jfm jlreq.cls README.md README-ja.md LICENSE jlreq.html jlreq-ja.html jlreq-trimmarks.html jlreq-trimmarks-ja.html jlreq.pdf jlreq-ja.pdf
mkdir -p ./tds/fonts/tfm/public/jlreq
- cp -f *.tfm ./tds/fonts/tfm/public/jlreq
+ cp -f ${TFMS} ./tds/fonts/tfm/public/jlreq
mkdir -p ./tds/fonts/vf/public/jlreq
- cp -f *.vf ./tds/fonts/vf/public/jlreq
+ cp -f ${VFS} ./tds/fonts/vf/public/jlreq
mkdir -p ./tds/tex/luatex/jlreq
cp jfm-jlreq.lua ./tds/tex/luatex/jlreq
cp jfm-jlreqv.lua ./tds/tex/luatex/jlreq
@@ -261,7 +263,7 @@ uninstall:
rm -rf ${TEXMF}/tex/latex/jlreq
jfmclean:
- rm -f *jlreq*.tfm *jlreq*.pl *jlreq*.vf
+ rm -f *jlreq*.pl ${VFS} ${TFMS}
rm -f jfm-jlreqv.lua
rm -f jfm-*jlreq*-pl.lua
rm -f jfm-jlreqv-jidori.lua
diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx
index 4b4e61d3c8b..2842da27d17 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-09-10}%
%<*driver>
\documentclass[full]{l3doc}
\usepackage{graphicx}
@@ -51,7 +51,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-09-10}
%
% \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..48a4371d98f 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-09-10}
%
% \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/l3kernel/l3bitset.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bitset.dtx
index 4559b56fd3a..6c7dddd9c06 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-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx
index 861f0bb5a62..3a2d2c24771 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-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
index 808d22da232..7ee8f93e2e0 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-09-10}
%
% \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..7fbab7c75a4 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-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx
index 5adb01cffb6..8f2da5d0291 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-09-10}
%
% \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: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..be982e324a0 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-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3color.dtx b/Master/texmf-dist/source/latex/l3kernel/l3color.dtx
index b56fb9e0ac2..0fafd8ef24a 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-09-10}
%
% \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/l3kernel/l3debug.dtx b/Master/texmf-dist/source/latex/l3kernel/l3debug.dtx
index 21e6747a844..496004c34b7 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-09-10}
%
% \maketitle
%
@@ -69,7 +69,7 @@
%
% Standard file identification.
% \begin{macrocode}
-\ProvidesExplFile{l3debug.def}{2024-05-27}{}{L3 Debugging support}
+\ProvidesExplFile{l3debug.def}{2024-09-10}{}{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..8f36b2075f4 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-09-10}
%
% \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..9268f85744c 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-09-10}{}
{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-09-10}
% \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 }
@@ -2529,7 +2540,7 @@ and all files in that bundle must be distributed together.
\cs_new_protected:Npn \@@_function_typeset_stop:
{
\par
- \dim_set:Nn \prevdepth { \box_dp:N \l_@@_descr_coffin }
+ \dim_set:Nn \prevdepth { \coffin_dp:N \l_@@_descr_coffin }
\allowbreak
}
% \end{macrocode}
@@ -2594,7 +2605,7 @@ and all files in that bundle must be distributed together.
\dim_zero:N \l_@@_trial_width_dim
\hcoffin_set:Nn \l_@@_functions_coffin { \@@_typeset_functions: }
\dim_set:Nn \l_@@_trial_width_dim
- { \box_wd:N \l_@@_functions_coffin }
+ { \coffin_wd:N \l_@@_functions_coffin }
\bool_set:Nn \l_@@_long_name_bool
{ \dim_compare_p:nNn \l_@@_trial_width_dim > \marginparwidth }
}
@@ -2643,7 +2654,7 @@ and all files in that bundle must be distributed together.
\coffin_join:NnnNnnnn
\l_@@_output_coffin {l} {b}
\l_@@_descr_coffin {l} {t}
- {0.75\marginparwidth + \marginparsep} {-\medskipamount}
+ {\marginparwidth + \marginparsep} {-\medskipamount}
\coffin_typeset:Nnnnn \l_@@_output_coffin
{\l_@@_descr_coffin-l} {\l_@@_descr_coffin-t}
{0pt} {0pt}
@@ -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}
@@ -2840,7 +2849,7 @@ and all files in that bundle must be distributed together.
{
\textwidth
\bool_if:NT \l_@@_long_name_bool
- { + 0.75 \marginparwidth - \l_@@_trial_width_dim }
+ { + \marginparwidth - \l_@@_trial_width_dim }
}
\hbox_gset:Nw \g_@@_syntax_box
\small \ttfamily
@@ -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/l3kernel/l3docstrip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx
index fecb228324e..c7664dbcce5 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-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx
index d13578bde1b..376d19bf7e8 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-09-10}
%
% \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/l3kernel/l3file.dtx b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
index 546222711e1..b08d59abcea 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-09-10}
%
% \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}
@@ -844,11 +846,11 @@
% \file_compare_timestamp:VNV
% }
% \begin{syntax}
-% \cs{file_compare_timestamp_p:nNn} \Arg{file-1} \meta{comparator} \Arg{file-2}
-% \cs{file_compare_timestamp:nNnTF} \Arg{file-1} \meta{comparator} \Arg{file-2} \Arg{true code} \Arg{false code}
+% \cs{file_compare_timestamp_p:nNn} \Arg{file-1} \meta{relation} \Arg{file-2}
+% \cs{file_compare_timestamp:nNnTF} \Arg{file-1} \meta{relation} \Arg{file-2} \Arg{true code} \Arg{false code}
% \end{syntax}
% Compares the file stamps on the two \meta{files} as indicated by
-% the \meta{comparator}, and inserts either the \meta{true code}
+% the \meta{relation}, and inserts either the \meta{true code}
% or \meta{false case} as required. A file which is not found
% is treated as older than any file which is found. This allows for
% example the construct
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx
index 88e726df354..5b1794b3ad3 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-09-10}
%
% \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..e7a618d5989 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-09-10}
% \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..aeab9952104 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-09-10}
%
% \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..9056f9e3ffd 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-09-10}
%
% \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..cc0112bf035 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-09-10}
%
% \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..4ef3b85c075 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-09-10}
%
% \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..4ebbbb3f09e 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-09-10}
%
% \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..13753cbde4b 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-09-10}
%
% \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..0ab92fb5ff9 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-09-10}
%
% \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..fb9a07fbec1 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-09-10}
%
% \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..7832c587922 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-09-10}
%
% \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..1ea74e51dd9 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-09-10}
%
% \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..cb3e2e2655c 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-09-10}
%
% \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..b73d27a304f 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-09-10}
% \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..d9c9db60712 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-09-10}
%
% \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..4e0d024d4f7 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-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx
index d273b057eab..ef02d0f816b 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-09-10}
%
% \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..8ce29ecaf86 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-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx
index 45050964ded..0d9b0137def 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-09-10}
%
% \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}
@@ -426,7 +411,8 @@
% \end{syntax}
% This function evaluates the \meta{test int expr} and
% compares this in turn to each of the
-% \meta{int expr cases}. If the two are equal then the
+% \meta{int expr case}s until a match is found.
+% If the two are equal then the
% associated \meta{code} is left in the input stream
% and other cases are discarded. If any of the
% cases are matched, the \meta{true code} is also inserted into the
@@ -445,6 +431,10 @@
% { No idea! }
% \end{verbatim}
% leaves \enquote{\texttt{Medium}} in the input stream.
+% Since evaluation of the test expressions stops at the first
+% successful case, the order of possible matches should normally
+% be that the most likely are earlier: this will reduce the average
+% steps required to complete expansion.
% \end{function}
%
% \begin{function}[EXP,pTF]{\int_if_even:n, \int_if_odd:n}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx
index aa49275e78c..0320579e941 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-09-10}
%
% \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..ab126347835 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-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
index 13772d17817..4535a6e8455 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-09-10}
%
% \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..06827eb5db7 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-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
index eb10d5aecce..9c1cabc9bd1 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-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
index e901b07c063..5d1d0a5becd 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-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx
index 5cdd1361e37..7dec3ca0911 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-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3pdf.dtx b/Master/texmf-dist/source/latex/l3kernel/l3pdf.dtx
index 55f49476e3d..4d90b326cf3 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-09-10}
%
% \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
@@ -192,11 +192,11 @@
%
% \begin{function}[pTF, EXP, added = 2021-02-10]{\pdf_version_compare:Nn}
% \begin{syntax}
-% \cs{pdf_version_compare_p:Nn} \meta{comparator} \Arg{version}
-% \cs{pdf_version_compare:NnTF} \meta{comparator} \Arg{version} \Arg{true code} \Arg{false code}
+% \cs{pdf_version_compare_p:Nn} \meta{relation} \Arg{version}
+% \cs{pdf_version_compare:NnTF} \meta{relation} \Arg{version} \Arg{true code} \Arg{false code}
% \end{syntax}
% Compares the version of the PDF being created with the \meta{version}
-% string specified, using the \meta{comparator}. Either the \meta{true code}
+% string specified, using the \meta{relation}. Either the \meta{true code}
% or \meta{false code} will be left in the output stream.
% \end{function}
%
@@ -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..a5d6db84552 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-09-10}
%
% \maketitle
%
@@ -664,7 +664,7 @@
% ~~\Arg{true code}
% ~~\Arg{false code}
% \end{syntax}
-% Evaluates in turn each of the \meta{boolean expression cases} until
+% Evaluates in turn each of the \meta{boolean expression case}s until
% the first one that evaluates to \texttt{true}.
% The \meta{code} associated to this first case is left in the input
% stream, followed by the \meta{true code}, and other cases are
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
index 21b8d03dd69..7a0e76cc54f 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-09-10}
%
% \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..409efd6b7bd 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-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx
index 6ca9c8eeed9..cad89611016 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-09-10}
%
% \maketitle
%
@@ -643,7 +643,7 @@
% \end{syntax}
% Determines which of the \meta{regular expressions} matches at the
% earliest point in the \meta{token list}, and leaves the
-% corresponding \meta{code_i} followed by the \meta{true code} in the
+% corresponding \meta{code} followed by the \meta{true code} in the
% input stream. If several \meta{regex} match starting at the same
% point, then the first one in the list is selected and the others are
% discarded. If none of the \meta{regex} match, the \meta{false code}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx
index 38fc9471a90..f998531c348 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-09-10}
%
% \maketitle
%
@@ -747,7 +747,7 @@
% Applies \meta{inline function} to every \meta{item} stored
% within the \meta{seq~var_2}. The \meta{inline function} should
% consist of code which will receive the \meta{item} as |#1|.
-% The sequence resulting applying \meta{inline function} to each
+% The sequence resulting from applying \meta{inline function} to each
% \meta{item} is assigned to \meta{seq~var_1}.
% \begin{texnote}
% Contrarily to other mapping functions, \cs{seq_map_break:} cannot
@@ -2409,6 +2409,7 @@
\exp_after:wN \@@_map_pairwise_function:wNw #2 \s_@@_stop #3
#1 { ? \prg_break: } { }
\prg_break_point:
+ \prg_break_point:Nn \seq_map_break: { }
}
\cs_new:Npn \@@_map_pairwise_function:wNw \s_@@ #1 \s_@@_stop #2
{
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
index 6e96b41326a..07ccb471fcd 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-09-10}
%
% \maketitle
%
@@ -277,7 +277,8 @@
% \end{syntax}
% This function evaluates the \meta{test dim expr} and
% compares this in turn to each of the
-% \meta{dim expr cases}. If the two are equal then the
+% \meta{dim expr case}s until a match is found.
+% If the two are equal then the
% associated \meta{code} is left in the input stream
% and other cases are discarded. If any of the
% cases are matched, the \meta{true code} is also inserted into the
@@ -297,6 +298,10 @@
% { No idea! }
% \end{verbatim}
% leaves \enquote{\texttt{Medium}} in the input stream.
+% Since evaluation of the test expressions stops at the first
+% successful case, the order of possible matches should normally
+% be that the most likely are earlier: this will reduce the average
+% steps required to complete expansion.
% \end{function}
%
% \section{Dimension expression loops}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx
index 47cebcad255..1d4580f640c 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-09-10}
%
% \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..cde36b4e60d 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-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx
index f4f7b94b884..8ac612d1b61 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-09-10}
%
% \maketitle
%
@@ -303,7 +303,8 @@
% ~~\Arg{false code}
% \end{syntax}
% Compares the \meta{test string} in turn with each
-% of the \meta{string case}s (all token lists are converted to strings).
+% of the \meta{string case}s until a match is found
+% (all token lists are converted to strings).
% If the two are equal (as described for
% \cs{str_if_eq:nnTF}) then the associated \meta{code} is left in the
% input stream and other cases are discarded. If any of the
@@ -757,7 +758,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..0fcfa9f9156 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-09-10}
%
% \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..60b92198b54 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-09-10}
%
% \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..ed95ff2d343 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-09-10}
%
% \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..f568063a21a 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-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3text.dtx b/Master/texmf-dist/source/latex/l3kernel/l3text.dtx
index bcfd15cb62b..3f771d31376 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-09-10}
%
% \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..4ae3f120d50 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-09-10}
%
% \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..e058e2be472 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-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
index 71d68d532cf..f6f0e19f66b 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-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
index 03bf46b1016..23b7e24b07a 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-09-10}
%
% \maketitle
%
@@ -660,7 +660,10 @@
% \cs{token_if_long_macro_p:N} \meta{token} \\
% \cs{token_if_long_macro:NTF} \meta{token} \Arg{true code} \Arg{false code}
% \end{syntax}
-% Tests if the \meta{token} is a long macro.
+% Tests if the \meta{token} is a long macro with no other prefix; to
+% test for a macro that is both long and protected, use
+% \cs[index = token_if_protected_long_macro:NTF]^^A
+% {token_if_protected_long_macro:N(TF)}.
% \end{function}
%
% \begin{function}[EXP,pTF, updated=2012-01-20]{\token_if_protected_macro:N}
@@ -668,8 +671,10 @@
% \cs{token_if_protected_macro_p:N} \meta{token} \\
% \cs{token_if_protected_macro:NTF} \meta{token} \Arg{true code} \Arg{false code}
% \end{syntax}
-% Tests if the \meta{token} is a protected macro: for a macro which
-% is both protected and long this returns \texttt{false}.
+% Tests if the \meta{token} is a protected macro with no other prefix; to
+% test for a macro that is both protected and long, use
+% \cs[index = token_if_protected_long_macro:NTF]^^A
+% {token_if_protected_long_macro:N(TF)}.
% \end{function}
%
% \begin{function}[EXP,pTF, updated=2012-01-20]{\token_if_protected_long_macro:N}
@@ -776,7 +781,7 @@
% ~~\Arg{false code}
% \end{syntax}
% This function compares the \meta{test token} in turn with each of
-% the \meta{token cases}. If the two are equal (as described for
+% the \meta{token case}s. If the two are equal (as described for
% \cs{token_if_eq_catcode:NNTF}, \cs{token_if_eq_charcode:NNTF} and
% \cs{token_if_eq_meaning:NNTF}, respectively) then the associated
% \meta{code} is left in the input stream and other cases are
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx b/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx
index 179817d4900..b824a1f0a05 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-09-10}
%
% \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/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/listings/listings.dtx b/Master/texmf-dist/source/latex/listings/listings.dtx
index 525ba1a4aec..bd1e84342b1 100644
--- a/Master/texmf-dist/source/latex/listings/listings.dtx
+++ b/Master/texmf-dist/source/latex/listings/listings.dtx
@@ -46,6 +46,7 @@
\usepackage{mdframed} % frames for external files
\usepackage{moreverb} % writing external files
\usepackage{xcolor} % because of coloring the background
+\usepackage{tablefootnote} % because of \tablefootnote
\makeindex
@@ -135,7 +136,7 @@
% Hoffmann became the maintainer of the \packagename{listings}
% package in 2013; see the Preface for details.}~ %
% \textless\lstemail\textgreater}
-% \date{2024/05/25\enspace\enspace Version 1.10b\ \box\abstractbox}
+% \date{2024/09/23\enspace\enspace Version 1.10c\ \box\abstractbox}
% \def\lstemail{\href{mailto:j.hoffmann@fh-aachen.de}{\texttt{j.hoffmann(at)fh-aachen.de}}}
% \ifhyper
% \hypersetup{pdftitle=The Listings Package,
@@ -2723,7 +2724,7 @@
% \texttt{last} continues the numbering of the most recent listing and
% \meta{number} sets it to the (logical) number.
%
-% \item[1.0] \rkeyname{name}|=|\meta{name}
+% \item[1.0,{{}}] \rkeyname{name}|=|\meta{name}
%
% names a listing. Displayed environment-listings with the same name
% share a line counter if |firstnumber=auto| is in effect.
@@ -4825,22 +4826,29 @@
% Usually you will use |#1| as \meta{value}.
%
% \item[1.0] \cs{lstKV@SwitchCases}\marg{value}\\
-% |{|\meta{string 1}|&|\meta{execute 1}|\\|\\
-% | |\meta{string 2}|&|\meta{execute 2}|\\|\\
+% |{|\meta{string 1}|:|\meta{execute 1}|\\|\\
+% | |\meta{string 2}|:|\meta{execute 2}|\\|\\
% \hbox to 3em{\hfill\vdots}\\
-% | |\meta{string $n$}|&|\meta{execute $n$}|}|\marg{else}
+% | |\meta{string $n$}|;|\meta{execute $n$}|}|\marg{else}
%
% Either execute \meta{else} or the \meta{value} matching part.
%
-% This implementation of C. Heinz has a problem\label{gAmpersand}, if
-% the listing is part of a tabular environment as found out by
-% \lsthelper{Nasser~M.~Abbasi}{2016/05/25}{possible bug in listings
-% package}. \lsthelper{David~Carlisle}{2016/05/25}{%
+% This implementation is based on a hint of \lsthelper{David~Carlisle}{2016/05/25}{%
% http://tex.stackexchange.com/questions/311383/^^A
% adding-frame-none-to-lstlisting-options-in-lstdefinestyle^^A
-% -gives-error-with-tabu}
-% gave a hint how to avoid this problem and so the separator |&| is
-% replaced by |:|.
+% -gives-error-with-tabu} to avoid the problem of the original
+% implementation of C. Heinz\label{gAmpersand}:
+% \begin{quote}
+% \cs{lstKV@SwitchCases}\marg{value}\\
+% |{|\meta{string 1}|&|\meta{execute 1}|\\|\\
+% | |\meta{string 2}|&|\meta{execute 2}|\\|\\
+% \hbox to 3em{\hfill\vdots}\\
+% | |\meta{string $n$}|&|\meta{execute $n$}|}|\marg{else}
+% \end{quote}
+% The problem arose when the listing was part of a tabular
+% environment, as found out by
+% \lsthelper{Nasser~M.~Abbasi}{2016/05/25}{possible bug in listings
+% package}.
%
% \item[0.20] |\lstKV@TwoArg|\marg{value}\marg{subdefinition}
% \item[0.20] |\lstKV@ThreeArg|\marg{value}\marg{subdefinition}
@@ -4967,8 +4975,13 @@
% \lsttabspace |\lst@KCSmode| &
% \ldots~a keyword comment which can be terminated by a semicolon only.
% \\
-% \aspectname{html}\lsttabspace |\lst@insidemode| &
+% \aspectname{html}\lsttabspace |\lst@htmlmode| &
% Active if we are between \texttt{<} and \texttt{>}.
+%
+% Previous documentations used the mode name |\lst@insidemode| at this
+% place, but the name |\lst@insidemode| isn't referenced in any documentation
+% and so it is now (from v1.10c on) assumed as an overseen
+% documentation error.
% \\
% \aspectname{make}\lsttabspace |\lst@makemode| &
% Used to indicate a keyword.
@@ -5986,7 +5999,7 @@
% \part{Implementation}
%
%
-% \CheckSum{12435}
+% \CheckSum{12443}
%^^A
%^^A Don't index TeX-primitives.
%^^A
@@ -6130,8 +6143,8 @@
% All files will have same date and version.
% \begin{macrocode}
%<*kernel|misc|doc>
-\def\filedate{2024/05/25}
-\def\fileversion{1.10b}
+\def\filedate{2024/09/23}
+\def\fileversion{1.10c}
%</kernel|misc|doc>
% \end{macrocode}
% What we need and who we are.
@@ -8918,9 +8931,16 @@
% \begin{macrocode}
\def\lst@UM#1{\csname\@lst @um#1@\endcsname}
% \end{macrocode}
-% And all remaining standard characters.
+% And all remaining standard characters. \lsthelper{Peter
+% Cock}{2024/09/18}{Upright double-quotes in LaTeX listings}
+% pointed to the discussion in
+% \url{https://tex.stackexchange.com/questions/166790/how-can-i-get-straight-double-quotes-in-listings}
+% about the lack of support for upright double quotes which are now
+% implemented by the lines below.
% \begin{macrocode}
\lst@CCPutMacro
+ \lst@ProcessOther {"22}{\lst@ifupquote \textquotedbl
+ \else \char34\relax \fi}
\lst@ProcessOther {"23}\#
\lst@ProcessLetter{"24}\textdollar
\lst@ProcessOther {"25}\%
@@ -12654,7 +12674,9 @@
% \subsection{Line numbers}
%
% \begin{aspect}{labels}
-% \lsthelper{Rolf~Niepraschk}{1997/04/24}{line numbers} asked for line numbers.
+% \lsthelper{Rolf~Niepraschk}{1997/04/24}{line numbers} asked for line
+% number, the relevant keys and `\textit{data}' commands are described in
+% section \ref{rLineNumbers}, here is their implementation.
% \begin{macrocode}
%<*misc>
\lst@BeginAspect{labels}
@@ -12673,26 +12695,31 @@
right:\def\lst@PlaceNumber{\rlap{\normalfont
\kern\linewidth \kern\lst@numbersep
\lst@numberstyle{\thelstnumber}}}%
- }{\PackageError{Listings}{Numbers #1 unknown}\@ehc}}
+ }{\PackageError{Listings}{value `#1' for keyword `numbers' not supported}\@ehc}}
% \end{macrocode}
% \end{lstkey}
%
+% \begin{lstkey}{stepnumber}
+% \begin{lstkey}{numberfirstline}
% \begin{lstkey}{numberstyle}
% \begin{lstkey}{numbersep}
-% \begin{lstkey}{stepnumber}
% \begin{lstkey}{numberblanklines}
-% \begin{lstkey}{numberfirstline}
% Definition of the keys.
% \begin{macrocode}
+\lst@Key{stepnumber}{1}{\def\lst@stepnumber{#1\relax}}
+\lst@Key{numberfirstline}{f}[t]{\lstKV@SetIf{#1}\lst@ifnumberfirstline}
\lst@Key{numberstyle}{}{\def\lst@numberstyle{#1}}
\lst@Key{numbersep}{10pt}{\def\lst@numbersep{#1}}
-\lst@Key{stepnumber}{1}{\def\lst@stepnumber{#1\relax}}
+\lst@Key{numberblanklines}{true}[t]
+ {\lstKV@SetIf{#1}\lst@ifnumberblanklines}
+% \end{macrocode}
+% If we use the `empty' style, the listing must start at line 1, so:
+% \begin{macrocode}
\lst@AddToHook{EmptyStyle}{\let\lst@stepnumber\@ne}
% \end{macrocode}
+% Later on we use this to prevent numbering of the first line for a second
+% time.
% \begin{macrocode}
-\lst@Key{numberblanklines}{true}[t]
- {\lstKV@SetIf{#1}\lst@ifnumberblanklines}
-\lst@Key{numberfirstline}{f}[t]{\lstKV@SetIf{#1}\lst@ifnumberfirstline}
\gdef\lst@numberfirstlinefalse{\let\lst@ifnumberfirstline\iffalse}
% \end{macrocode}
% \end{lstkey}
@@ -12721,6 +12748,9 @@
% \end{macrocode}
% \end{lstkey}
%
+% The key |name| is defined in section \ref{sec:list-listings}, the data
+% command |\thelstnumber| below on page \pageref{iTheLstNumber}.
+%
% \begin{macro}{\lst@SetFirstNumber}
% \begin{macro}{\lst@SaveFirstNumber}
% \lsthelper{Boris~Veytsman}{1998/03/25}{continue line numbering: a.c b.c a.c}
@@ -12749,7 +12779,9 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\thelstnumber}
% \begin{macro}{\c@lstnumber}
+% \label{iTheLstNumber}%
% This counter keeps the current label number. We use it as current label to
% make line numbers referenced by |\ref|. This was proposed by
% \lsthelper{Boris~Veytsman}{1998/03/25}{make line numbers referenced via
@@ -12805,6 +12837,7 @@
.\thelstnumber}}
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\lst@skipnumbers}
% There are more things to do. We calculate how many lines must skip their
@@ -13879,12 +13912,21 @@
% \end{macrocode}
% Further parsing is done by |lst@GLI@|, the argument is |#1--\@nil| that
% is the first element of the list augmented by a sentinel. This
-% argument is parsed with the template |#1-#2-#3\@nil|. A linerange given
-% as e.\,g. `|12-21|' leads to the argument |12-21--\@nil|, so it is parsed
-% as \#1\(\leftarrow\) |12|, \#2\(\leftarrow\)|21|, and \#3\(\leftarrow\)|-|.
+% argument is parsed with the template |#1-#2-#3\@nil|.
+%
% \begin{macrocode}
\def\lst@GLI@#1-#2-#3\@nil{%
% \end{macrocode}
+% A linerange given as e.\,g. `|12-21|' leads to the argument
+% |12-21--\@nil|, so it is parsed as \#1\(\leftarrow\) |12|,
+% \#2\(\leftarrow\)|21|, and \#3\(\leftarrow\)|-|.
+%
+% Otherwise it is possible to define a range by arbitrary linerange markers
+% like `|start-end|' which leads to the argument
+% |12-21--\@nil|, so it is parsed as \#1\(\leftarrow\) |12|,
+% \#2\(\leftarrow\)|21|, and \#3\(\leftarrow\)|-|.
+
+
% First we test, if the linerange starts with a number (consisting of -, 1,
% 2, 3, \ldots) or an arbitrary linerange marker. If a linerange starts
% erroneously with a `|-|' character, the argument \#1 isn't set and so the
@@ -13897,23 +13939,23 @@
\ifx\@empty#1\@empty
\let\lst@firstline\@ne
\else
- \def\lst@firstline{#1\relax}%
+ \def\lst@firstline{#1\relax}
\fi
% \end{macrocode}
% Now we know the starting number of the linerange. \#3 isn't set with a
% linerange consisting of a single number, in all other cases \#2 defines
% the last line (explicitly or implicitly).
% \begin{macrocode}
- \ifx\@empty#3\@empty%
- \def\lst@lastline{9999999\relax}%
+ \ifx\@empty#3\@empty
+ \def\lst@lastline{9999999\relax}
\ifx\@empty#2\@empty
- \let\lst@lastline\lst@firstline%
+ \let\lst@lastline\lst@firstline
\fi
\else%
\ifx\@empty#2\@empty
\def\lst@lastline{9999999\relax}
\else % doesn't happen(?)
- \def\lst@lastline{#2\relax}%
+ \def\lst@lastline{#2\relax}
\fi
\fi
}%
@@ -13922,7 +13964,7 @@
% 9999999. This prevents (almost) anything from being printed for now.
% \begin{macrocode}
{%
- \def\lst@firstline{9999999\relax}%
+ \def\lst@firstline{9999999\relax}
\let\lst@lastline\lst@firstline
% \end{macrocode}
% We add the prefixes and suffixes to the markers.
@@ -14017,10 +14059,10 @@
\ifnum\@tempcnta=\z@ \else
\lst@nololtrue
\advance\@tempcnta\lst@advancenumber
- \edef\lst@firstnumber{\the\@tempcnta\relax}%
- \fi%
- \fi%
- }%
+ \edef\lst@firstnumber{\the\@tempcnta\relax}
+ \fi
+ \fi
+ }
}
\def\lst@InitLstNumber{%
\global\c@lstnumber\lst@firstnumber
@@ -14366,7 +14408,8 @@
% \begin{macro}{\lst@HRefStepCounter}
% This macro sets the listing number to a negative value since the user
% shouldn't refer to such a listing. If the \packagename{hyperref} package
-% is present, we use `lstlisting' (argument from above) to hyperref to.
+% is present, we use `lstlisting.' (argument from above) concatenated with
+% the current (negative) number to hyperref to.
% The groups have been added to prevent other packages (namely
% \packagename{tabularx}) from reading the locally changed counter
% and writing it back globally. Thanks to \lsthelper{Michael~Niedermair}
@@ -14374,14 +14417,17 @@
% this localization led to another bug, see |\theHlstnumber|.
% \begin{macrocode}
\def\lst@HRefStepCounter#1{%
- \begingroup
- \c@lstlisting\lst@neglisting
- \advance\c@lstlisting\m@ne \xdef\lst@neglisting{\the\c@lstlisting}%
- \ifx\hyper@refstepcounter\@undefined\else
- \hyper@refstepcounter{#1}%
- \fi
- \endgroup}
-\gdef\lst@neglisting{\z@}% init
+ \begingroup
+ \c@lstlisting\lst@neglisting
+ \advance\c@lstlisting\m@ne \xdef\lst@neglisting{\the\c@lstlisting}%
+ \ifx\hyper@refstepcounter\@undefined\else
+ \hyper@refstepcounter{#1}%
+ \fi
+ \endgroup
+}
+\gdef\lst@neglisting{\z@}% init, \z@ can be used both for 0pt and 0,
+ % remember: _neg_ative number, but no
+ % counter!
% \end{macrocode}
% \end{macro}
%
@@ -14776,7 +14822,8 @@
% \end{macro}
%
%
-% \subsection{List of listings}
+% \subsection{List of listings}%
+% \label{sec:list-listings}
%
% \begin{lstkey}{name}
% \begin{macro}{\lstname}
@@ -15781,7 +15828,7 @@
\ifalgorithmicpkg \RequirePackage{algorithmic}\fi
\iflgrind \RequirePackage{lgrind}\fi
\RequirePackage{nameref}
-\RequirePackage{url}
+\RequirePackage{xurl} % allow URL breaks
\renewcommand\ref{\protect\T@ref}
\renewcommand\pageref{\protect\T@pageref}
% \end{macrocode}
@@ -17336,6 +17383,10 @@
% \item[1.10] from 2024/02/15 on
% \item usage of |tocbasic| if loaded to improve compatibility with
% KOMA-Script and also enhance functionality.
+% \item differentiate between Python 2 and Python 3
+% \item add initial support for Scala 3.0
+% \item made |\lstinline{...}| work in tabular cells
+% \item implemented upright double-quotes
% \end{itemize}
% \endgroup
%
diff --git a/Master/texmf-dist/source/latex/listings/lstdrvrs.dtx b/Master/texmf-dist/source/latex/listings/lstdrvrs.dtx
index 8541b7a0b93..25c197c9d55 100644
--- a/Master/texmf-dist/source/latex/listings/lstdrvrs.dtx
+++ b/Master/texmf-dist/source/latex/listings/lstdrvrs.dtx
@@ -33,7 +33,7 @@
% \title{Language, Style and Format drivers\\ for \textsf{Listings}\\
% {\large by Carsten Heinz and individual authors:}}
% \author{\InputIfFileExists{lstdrvrs.tmp}{}{}}
-% \date{2024/05/25\enspace\enspace Version 1.10b\ \box\abstractbox}
+% \date{2024/09/23\enspace\enspace Version 1.10c\ \box\abstractbox}
%
% \ifhyper
% \hypersetup{pdftitle={Language, Style and Format drivers for the
@@ -138,7 +138,7 @@
% \endgroup
% We mainly define default dialects.
% \begin{macrocode}
-\ProvidesFile{listings.cfg}[2024/05/25 1.10b listings configuration]
+\ProvidesFile{listings.cfg}[2024/09/23 1.10c listings configuration]
\def\lstlanguagefiles
{lstlang0.sty,lstlang1.sty,lstlang2.sty,lstlang3.sty}
\lstset{defaultdialect=[R/3 6.10]ABAP,
@@ -187,7 +187,7 @@
%<+lua-prf>\ProvidesFile{listings-lua.prf}
%<+python-prf>\ProvidesFile{listings-python.prf}
%<+rexx-prf>\ProvidesFile{listings-rexx.prf}
-%<-config> [2024/05/25 1.10b listings language file]
+%<-config> [2024/09/23 1.10c listings language file]
% \end{macrocode}
%
%
diff --git a/Master/texmf-dist/source/latex/listings/lstdrvrs.ins b/Master/texmf-dist/source/latex/listings/lstdrvrs.ins
index 132c16c112c..8489196fe19 100644
--- a/Master/texmf-dist/source/latex/listings/lstdrvrs.ins
+++ b/Master/texmf-dist/source/latex/listings/lstdrvrs.ins
@@ -57,7 +57,7 @@
}
\endbatchfile
- [2024/05/25 1.10b listings language file]
+ [2024/09/23 1.10c listings language file]
\endinput
%%
%% End of file `lstdrvrs.ins'.
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'entre 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 dj 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 faon 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 obsolte
-%% (pas sr si 100%, mais en tout cas l'exemple avec \mathbf{-} n'a plus
-%% de problme.
-% \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 dcembre 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 mme 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}.)
-
-% obsolte 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.
-% obsolte 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 dj 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 plutt 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 dj 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 problme 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 rduis --- 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 rfrence 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 reste |2015/09/22| (date de |1.4a|) au lieu de quelque
+% de release est reste |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 assure 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 considrais 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/minted/Makefile b/Master/texmf-dist/source/latex/minted/Makefile
deleted file mode 100644
index ae199e79d50..00000000000
--- a/Master/texmf-dist/source/latex/minted/Makefile
+++ /dev/null
@@ -1,38 +0,0 @@
-TEXFLAGS = -e '$$pdflatex=q/pdflatex %O -shell-escape %S/' -pdf
-LATEXMK = latexmk
-
-PACKAGE = minted.dtx \
- minted.ins \
- minted.pdf \
- README \
- Makefile
-
-.PHONY: minted all doc dist clean cleanall
-
-minted: minted.sty
-
-doc: minted.pdf
-
-all: minted doc
-
-minted.sty: minted.ins minted.dtx
- tex minted.ins
-
-minted.pdf: minted.sty minted.gls minted.dtx
- $(LATEXMK) $(TEXFLAGS) minted.dtx
-
-minted.gls: minted.glo
- makeindex -s gglo.ist -o minted.gls minted.glo
-
-minted.glo: minted.dtx minted.sty
- $(LATEXMK) $(TEXFLAGS) minted.dtx
-
-dist: $(PACKAGE)
- @$(RM) minted.zip
- @zip minted-$(shell grep '^\\ProvidesPackage' < minted.sty | grep -o '\<v[[:digit:]]*\.[[:digit:]]*\>').zip $(PACKAGE)
-
-clean:
- @$(RM) *.aux *.log *.out *.toc *.fdb_latexmk *.ilg *.glo *.gls *.lol
-
-cleanall: clean
- @$(RM) minted.sty minted.zip
diff --git a/Master/texmf-dist/source/latex/minted/minted.dtx b/Master/texmf-dist/source/latex/minted/minted.dtx
index d1a0d3c2d9e..b0c75e1769e 100644
--- a/Master/texmf-dist/source/latex/minted/minted.dtx
+++ b/Master/texmf-dist/source/latex/minted/minted.dtx
@@ -1,18 +1,15 @@
% \iffalse meta-comment
%
-% Copyright (C) 2013-2023 by Geoffrey M. Poore <gpoore@gmail.com>
+% Copyright (C) 2013-2024 by Geoffrey M. Poore <gpoore@gmail.com>
% Copyright (C) 2010-2011 by Konrad Rudolph <konrad_rudolph@madrat.net>
-% ---------------------------------------------------------------------------
+% --------------------------------------------------------------------------
% 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
-% 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.
-%
-% Additionally, the project may be distributed under the terms of the 3-Clause
-% ("New") BSD license: http://opensource.org/licenses/BSD-3-Clause.
+% 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'.
%
@@ -21,7 +18,6 @@
% This work consists of the files minted.dtx and minted.ins
% and the derived file minted.sty.
%
-%
% \fi
%
% \iffalse
@@ -31,30 +27,31 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{minted}
%<*package>
- [2023/12/18 v2.9 Yet another Pygments shim for LaTeX]
+ [2024/09/22 v3.0.0 Yet another Pygments shim for LaTeX]
%</package>
%<*driver>
\documentclass{ltxdoc}
-\EnableCrossrefs
-%\CodelineIndex
-%\DisableCrossrefs
-%\RecordChanges
-%\OnlyDescription
+\DisableCrossrefs
+^^A\EnableCrossrefs
+^^A\CodelineIndex
+^^A\RecordChanges
+^^A\OnlyDescription
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
+\usepackage{fourier}
\usepackage{dingbat}
\usepackage{microtype}
\usepackage[svgnames]{xcolor}
-\usepackage{textcomp}
-\usepackage[cache, langlinenos]{minted}
+\usepackage{graphicx}
+\usepackage[lexerlinenos, highlightmode=immediate]{minted}
+\setminted{literatecomment=\%, autogobble}
\usepackage{calc}
-\usepackage{environ}
-\usepackage{graphicx}
\usepackage{multicol}
-\usepackage{hyperref}
+\usepackage[hyperindex]{hyperref}
+\usepackage{cleveref}
\newcommand{\env}[1]{\texttt{#1}}
@@ -95,28 +92,11 @@
\def\FV@SV@pipe@active@verbatim{%
\FV@Gobble
\expandafter\FV@ProcessLine\expandafter{#1}}%
- %\let\FV@BeginVBox\relax
- %\let\FV@EndVBox\relax
- %\def\FV@BProcessLine##1{\FancyVerbFormatLine{##1}}%
\BUseVerbatim{pipe@active@verbatim}%
\endgroup}
\AtBeginDocument{\let|\pipe@active@verbatim}
\endgroup
-\newcommand{\changestext}{}
-\NewEnviron{changelog}[2]{%
- \g@addto@macro\changestext{\item[#1] (#2) \begin{itemize}}%
- \expandafter\g@addto@macro\expandafter\changestext\expandafter{\BODY}%
- \g@addto@macro\changestext{\end{itemize}}%
-}
-\newcommand{\PrintChangelog}{%
- \section{Changelog}%
- \label{sec:changelog}
- \begin{description}%
- \changestext
- \end{description}%
-}
-
\def\MacroFont{%
\fontencoding\encodingdefault%
\fontfamily\ttdefault%
@@ -125,13 +105,55 @@
\small}
\definecolor{minted@mint}{HTML}{0B610B}
-\definecolor{minted@samplebg}{HTML}{F0F0E0}
\colorlet{minted@linkcolor}{minted@mint}
-%
+
\def\PrintDescribeMacro#1{\strut \MacroFont\textcolor{minted@linkcolor}{\string #1\ }}
\let\PrintDescribeEnv\PrintDescribeMacro
\let\PrintMacroName\PrintDescribeMacro
\let\PrintEnvName\PrintDescribeEnv
+
+\renewenvironment{macro}{\macro@custom@arg}{}
+\def\macro@custom@arg{%
+ \begingroup\makeatletter\macro@custom@arg@i}
+\def\macro@custom@arg@i#1{%
+ \makeatother
+ \par\noindent
+ \ifstrempty{#1}%
+ {~\par}%
+ {\ttfamily\color{minted@mint}\hspace*{-0.5in}%
+ \macro@custom@arg@split#1,\FV@Sentinel\par}%
+ \endgroup}
+\def\macro@custom@arg@spacegobble#1{#1}
+\def\macro@custom@arg@split#1,#2\FV@Sentinel{%
+ \expandafter\string\macro@custom@arg@spacegobble#1%
+ \if\relax\detokenize{#2}\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {}{\\\hspace*{-0.5in}\macro@custom@arg@split#2\FV@Sentinel}}
+
+\renewenvironment{environment}{\env@custom@arg}{}
+\def\env@custom@arg{%
+ \begingroup\makeatletter\env@custom@arg@i}
+\def\env@custom@arg@i#1{%
+ \makeatother
+ \ifstrempty{#1}%
+ {~\par}%
+ {\ttfamily\color{minted@mint}\hspace*{-0.5in}%
+ \env@custom@arg@split#1,\FV@Sentinel\par}%
+ \endgroup}
+\def\env@custom@arg@spacegobble#1{#1}
+\def\env@custom@arg@split#1,#2\FV@Sentinel{%
+ \env@custom@arg@spacegobble#1{\textrm{ \textit{(env.)}}}%
+ \if\relax\detokenize{#2}\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {}{\\\hspace*{-0.5in}\env@custom@arg@split#2\FV@Sentinel}}
+
+
\def\theCodelineNo{\textcolor{minted@linkcolor}{\sffamily\footnotesize\oldstylenums{\arabic{CodelineNo}}}}
%
\hypersetup{
@@ -141,35 +163,56 @@
colorlinks=true,
allcolors=minted@linkcolor,
}
-%
-% Shamelessly stolen from http://blog.karssen.org/2009/11/15/a-latex-example-environment/
+
+\newenvironment{mintedminted}%
+ {\VerbatimEnvironment
+ \begin{minted}}%
+ {\end{minted}}
+
+
\newenvironment{example}
{\VerbatimEnvironment
- \begin{VerbatimOut}[gobble=3]{example.out}}
+ \begin{VerbatimOut}[gobble=1]{example.out}}
{\end{VerbatimOut}%
- \vspace{1ex}%
\setlength{\parindent}{0pt}%
- \fbox{\begin{minipage}{0.5\linewidth}%
+ \vspace{1em}%
+ \fbox{%
+ \vspace{1ex}%
+ \begin{minipage}{0.5\linewidth-2em-\fboxsep}%
\inputminted[resetmargins]{latex}{example.out}%
- \end{minipage}%
- \hspace{0.05\linewidth}%
- \begin{minipage}{0.45\linewidth-2\fboxsep}%
+ \end{minipage}%
+ \hspace{2em}\vrule\hspace{2em}%
+ \begin{minipage}{0.5\linewidth-2em-\fboxsep}%
\input{example.out}%
- \end{minipage}%
- \vspace{1ex}}}
+ \end{minipage}%
+ \vspace{1ex}}%
+ \vspace{1em}}
+
+
+\begingroup
+\catcode`\^^M=\active%
+\gdef\longexample@i#1{%
+ \def\longexample@arg{#1}%
+ \begin{VerbatimOut}[gobble=1]{example.out}^^M}%
+\endgroup
\newenvironment{longexample}
- {\VerbatimEnvironment
- \begin{VerbatimOut}[gobble=3]{example.out}}
- {\end{VerbatimOut}%
- \vspace{1ex}%
- \setlength{\parindent}{0pt}%
- \fbox{\begin{minipage}{\linewidth-2\fboxsep}%
- \inputminted[resetmargins]{latex}{example.out}%
- ~\hrulefill~
- \input{example.out}%
- \end{minipage}%
- \vspace{1ex}}}
+ {\VerbatimEnvironment
+ \FVExtraReadOArgBeforeVEnv{\longexample@i}}
+ {\end{VerbatimOut}%
+ \vspace{1em}%
+ \setlength{\parindent}{0pt}%
+ \fbox{
+ \vspace{1ex}%
+ \begin{minipage}{\linewidth-2\fboxsep}%
+ \inputminted[resetmargins]{latex}{example.out}%
+ ~\hrulefill~
+ \expandafter\fvset\expandafter{\longexample@arg}%
+ \input{example.out}%
+ \end{minipage}%
+ \vspace{1ex}}%
+ \vspace{1em}}
+
\def\minted@printopt#1(#2) (#3){%
\vspace{0.1in}%
@@ -178,322 +221,80 @@
\kern-\parindent\textsf{(#2)}\hfill(default: \texttt{#3})\\}
\newenvironment{optionlist}%
- {%
- ~\par\vspace{-14pt}%
+ {~\par\vspace{-14pt}%
\def\pipechar{|}
\let\|\pipechar
\newcommand*\mintednext{}%
+ \let\item@orig\item
\renewcommand*\item[1][]{%
- \mintednext%
- \renewcommand*\mintednext{\par}%
- \minted@printopt##1%
- \ignorespaces}}
- {%
- \par}
+ \ifdefstring{\@currenvir}{optionlist}%
+ {\mintednext%
+ \renewcommand*\mintednext{\par}%
+ \minted@printopt##1%
+ \ignorespaces}%
+ {\ifstrempty{##1}%
+ {\vspace{-4pt}\item@orig}
+ {\vspace{-4pt}\item@orig[##1]}}}}
+ {\par}
\edef\hashchar{\string#}
+
+
+\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{3em}}
+\renewcommand*\l@subsubsection{\@dottedtocline{3}{4.5em}{3.8em}}
+
+
\makeatother
-\newcommand{\hide}[1]{}
-\setlength{\parindent}{0pt}
-\addtolength{\parskip}{0.5\baselineskip}
-\def\warn{\textcolor{red}{\large\textbf{\textsf{WARNING}}}}
+
+\newenvironment{mintedexample}%
+ {\VerbatimEnvironment
+ \begin{minted}}%
+ {\end{minted}}
\begin{document}
\DocInput{minted.dtx}
-% \PrintIndex
+% ^^A\PrintIndex
\end{document}
%</driver>
% \fi
%
-% \CheckSum{2572}
-%
-% \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 \~}
-%
-%
-%
-%
-% \begin{changelog}{v2.9}{2023/12/18}
-% \item This is expected to be the last release of \pkg{minted} v2.x. If so, it will then become the new package \Verb{minted2} for backward compatibility.
-% \item Added new option \Verb{ignorelexererrors}. When lexer errors are shown in highlighted output (default), they are typically displayed as red boxes that surround the relevant text. When lexer errors are ignored, the literal text that caused lexer errors is shown but there is no indication that it caused errors (\#374).
-% \item There is now a warning if \pkg{fvextra} version is less than 1.5.
-% \end{changelog}
-%
-% \begin{changelog}{v2.8}{2023/09/12}
-% \item Under non-Windows operating systems, detect executables with \Verb{command -v} rather than \Verb{which} to provide better cross-platform support (\#345).
-% \item Added new package option \Verb{inputlanglinenos}. This extends the existing \Verb{langlinenos} to cover \Verb{\inputminted} as well (\#361).
-% \item Improved and updated Pygments documentation (\#339).
-% \item Improved \Verb{\mintinline} documentation to address packages that redefine \Verb{\section} (\#368).
-% \item Added support for \texpkg{fvextra} options \texttt{breakafterinrun} and \texttt{breakbeforeinrun} (\#358). In \texpkg{fvextra} version 1.5, \texttt{breakaftergroup} and \texttt{breakbeforegroup} were renamed to \texttt{breakafterinrun} and \texttt{breakbeforeinrun} to avoid naming ambiguity with new options. The old options \texttt{breakaftergroup} and \texttt{breakbeforegroup} are no longer supported.
-% \item Added \texttt{DEPENDS.txt} (\#331).
-% \item Removed unnecessary dependency on \texpkg{calc} package (\#313).
-% \item Added documentation in FAQ about copy and paste limitations (\#302).
-% \item Added note on \texttt{text} lexer to documentation (\#274).
-% \end{changelog}
-%
-%
-% \begin{changelog}{v2.7}{2022/12/12}
-% \item Reimplemented \texttt{\string\mintinline} to use \texttt{fvextra}'s argument reading and processing macros, and to use \texttt{fvextra}'s \texttt{\string\Verb} internally. \texttt{\string\mintinline} now works with all line breaking options supported by \texttt{fvextra}'s \texttt{\string\Verb}, including \texttt{breakanywhere} (\#329, \#340). It now gives better results when used inside other commands, since it uses \texttt{fvextra}'s retokenization macros. It is now compatible with \texttt{hyperref} for PDF strings such as bookmarks.
-% \item Reimplemented \texttt{\string\newmintinline} based on new \texttt{\string\mintinline}.
-% \item Reimplemented \texttt{\string\mint} to use \texttt{fvextra}'s argument reading and processing macros. It now gives better results when used inside other commands, since it uses \texttt{fvextra}'s retokenization macros. Fixed a bug that caused a continued paragraph after \texttt{\string\mint} to be indented (\#218).
-% \item Reimplemented \texttt{\string\newmint} based on new \texttt{\string\mint}. Commands created with \texttt{\string\newmint} can now use curly braces as delimiters, just like \texttt{\string\mint} (\#254).
-% \item Settings passed to \Verb{pygmentize} as command-line options are now quoted. This prevents \Verb{escapeinside} characters from being interpreted as special shell characters (\#179, \#262).
-% \item Fixed bug with \texttt{autogobble} that produced incorrect dedent when using \texttt{lastline} with the lines beyond \texttt{lastline} having less indentation than the selected range (\#326).
-% \item Fixed unintended line breaks after hyphens under LuaTeX (\#263).
-% \item Added warning to documentation of \Verb{\inputminted} regarding filenames and shell command execution (\#338).
-% \end{changelog}
-%
-%
-% \begin{changelog}{v2.6}{2021/12/24}
-% \item \texttt{autogobble} automatically uses \texttt{python} or \texttt{python3} executables, depending on availability, instead of requiring \texttt{python}. A custom executable can be specified by redefining \texttt{\string\MintedPython} (\#277, \#287).
-% \item Fixed \texttt{autogobble} compatibility with \texttt{fancyvrb} 4.0+ (\#315, \#316).
-% \item Pygments style names may now contain arbitrary non-whitespace characters. Previously, style names containing digits and some punctuation characters were incompatible (\#210, \#294, \#299, \#317). Pygments macros are now only defined just before use locally within \texttt{minted} commands and environments, rather than globally. Pygments macros now always use a \texttt{\string\PYG} prefix regardless of style, rather than a prefix of the form \texttt{\string\PYG<style>} (for example, what was previously \texttt{\string\PYGdefault} is now simply \texttt{\string\PYG}).
-% \item Removed Python-based MD5 hashing for XeTeX, which was necessary before XeTeX added \texttt{\string\mdfivesum} in 2017.
-% \item The default for \texttt{stripnl} is now \texttt{false}, so that original code is preserved exactly by default (\#198).
-% \item Added support for \texttt{fontencoding} option from \texttt{fvextra} (\#208).
-% \item Added note to FAQ about getting \texttt{texi2pdf} to work with \texttt{minted} given \texttt{texi2pdf}'s assumptions about temp files (\#186).
-% \item Reimplemented \texttt{bgcolor} option to be compatible with \texttt{color} package.
-% \end{changelog}
-%
-%
-% \begin{changelog}{v2.5}{2017/07/19}
-% \item The default placement for the \texttt{listing} float is now \texttt{tbp} instead of \texttt{h}, to parallel \texttt{figure} and \texttt{table} and also avoid warnings caused by \texttt{h} (\#165). The documentation now contains information about changing default placement. The \texttt{float} package is no longer loaded when the \texttt{newfloat} package option is used.
-% \item Added support for \texttt{*nchars} options from \texttt{fvextra} v1.3 that allow setting \texttt{breaklines}-related indentation in terms of a number of characters, rather than as a fixed dimension.
-% \item Fixed incompatibility with \texttt{babel magyar} (\#158).
-% \item Added support for \texttt{beamer} overlays with \texttt{beameroverlays} option (\#155).
-% \item Comments in the Pygments \LaTeX\ style files no longer appear as literal text when \texttt{minted} is used in \texttt{.dtx} files (\#161).
-% \item \texttt{autogobble} now works with package option \texttt{kpsewhich} (\#151). Under Windows, the \texttt{kpsewhich} option no longer requires PowerShell.
-% \item Fixed a bug that prevented \texttt{finalizecache} from working with \texttt{outputdir} (\#149).
-% \item Fixed a bug with \texttt{firstline} and \texttt{lastline} that prevented them from working with the \texttt{minted} environment (\#145).
-% \item Added note on \texttt{breqn} conflicts to FAQ (\#163).
-% \end{changelog}
-%
-%
-% \begin{changelog}{v2.4.1}{2016/10/31}
-% \item Single quotation marks in \texttt{\string\jobname} are now replaced with underscores in \texttt{\string\minted@jobname} to prevent quoting errors (\#137).
-% \item The \texttt{autogobble} option now takes \texttt{firstline} and \texttt{lastline} into account (\#130).
-% \item Fixed \texttt{numberblanklines}, which had been lost in the transition to v2.0+ (\#135).
-% \end{changelog}
-%
-%
-% \begin{changelog}{v2.4}{2016/07/20}
-% \item Line breaking and all associated options are now completely delegated to \texttt{fvextra}.
-% \item Fixed a bug from v2.2 that could cause the first command or environment to vanish when \texttt{cache=false} (related to work on \texttt{\string\MintedPygmentize}).
-% \end{changelog}
-%
-%
-% \begin{changelog}{v2.3}{2016/07/14}
-% \item The \texttt{fvextra} package is now required. \texttt{fvextra} extends and patches \texttt{fancyvrb}, and includes improved versions of \texttt{fancyvrb} extensions that were formerly in \texttt{minted}.
-% \item As part of \texttt{fvextra}, the \texttt{upquote} package is always loaded. \texttt{fvextra} brings the new option \texttt{curlyquotes}, which allows curly single quotation marks instead of the literal backtick and typewriter single quotation mark produced by \texttt{upquote}. This allows the default \texttt{upquote} behavior to be disabled when desired.
-% \item Thanks to \texttt{fvextra}, the options \texttt{breakbefore}, \texttt{breakafter}, and \texttt{breakanywhere} are now compatible with non-ASCII characters under pdfTeX (\#123).
-% \item Thanks to \texttt{fvextra}, \texttt{obeytabs} no longer causes lines in multi-line comments or strings to vanish (\#88), and is now compatible with \texttt{breaklines} (\#99). \texttt{obeytabs} will now always give correct results with tabs used for indentation. However, tab stops are not guaranteed to be correct for tabs in the midst of text.
-% \item \texttt{fvextra} brings the new options \texttt{space}, \texttt{spacecolor}, \texttt{tab}, and \texttt{tabcolor} that allow these characters and their colors to be redefined (\#98). The tab may now be redefined to a flexible-width character such as \texttt{\string\rightarrowfill}. The visible tab will now always be black by default, instead of changing colors depending on whether it is part of indentation for a multiline string or comment.
-% \item \texttt{fvextra} brings the new options \texttt{highlightcolor} and \texttt{highlightlines}, which allow single lines or ranges of lines to be highlighted based on line number (\#124).
-% \item \texttt{fvextra} brings the new options \texttt{numberfirstline}, \texttt{stepnumberfromfirst}, and \texttt{stepnumberoffsetvalues} that provide better control over line numbering when \texttt{stepnumber} is not 1.
-% \item Fixed a bug from v2.2.2 that prevented \texttt{upquote} from working.
-% \end{changelog}
-%
-%
-% \begin{changelog}{v2.2.2}{2016/06/21}
-% \item Fixed a bug introduced in v2.2 that prevented setting the Pygments style in the preamble. Style definitions are now more compatible with using \texttt{\string\MintedPygmentize} to call a custom \texttt{pygmentize}.
-% \end{changelog}
-%
-%
-% \begin{changelog}{v2.2.1}{2016/06/15}
-% \item The \texttt{shellesc} package is loaded before \texttt{ifplatform} and other packages that might invoke \texttt{\string\write18} (\#112).
-% \item When caching is enabled, XeTeX uses the new \texttt{\string\mdfivesum} macro from TeX Live 2016 to hash cache content, rather than using \texttt{\string\ShellEscape} with Python to perform hashing.
-% \end{changelog}
-%
-%
-% \begin{changelog}{v2.2}{2016/06/08}
-% \item All uses of \texttt{\string\ShellEscape} (\texttt{\string\write18}) no longer wrap file names and paths with double quotes. This allows a cache directory to be specified relative to a user's home directory, for example, \texttt{\string~/minted\_cache}. \texttt{cachedir} and \texttt{outputdir} paths containing spaces will now require explicit quoting of the parts of the paths that contain spaces, since \texttt{minted} no longer supplies quoting. See the updated documentation for examples (\#89).
-% \item Added \texttt{breakbefore}, \texttt{breakbeforegroup}, \texttt{breakbeforesymbolpre}, and \texttt{breakbeforesymbolpost}. These parallel \texttt{breakafter*}. It is possible to use \texttt{breakbefore} and \texttt{breakafter} for the same character, so long as \texttt{breakbeforegroup} and \texttt{breakaftergroup} have the same setting (\#117).
-% \item Added package options \texttt{finalizecache} and \texttt{frozencache}. These allow the cache to be prepared for (\texttt{finalizecache}) and then used (\texttt{frozencache}) in an environment in which \texttt{-shell-escape}, Python, and/or Pygments are not available. Note that this only works if \texttt{minted} content does not need to be modified, and if no settings that depend on Pygments or Python need to be changed (\#113).
-% \item Style names containing hyphens and underscores (\texttt{paraiso-light}, \texttt{paraiso-dark}, \texttt{algol\_nu}) now work (\#111).
-% \item The \texttt{shellesc} package is now loaded, when available, for compatibility with LuaTeX 0.87+ (TeX Live 2016+, etc.). \texttt{\string\ShellEscape} is now used everywhere instead of \texttt{\string\immediate\string\write18}. If \texttt{shellesc} is not available, then a \texttt{\string\ShellEscape} macro is created. When \texttt{shellesc} is loaded, there is a check for versions before v0.01c to patch a bug in v0.01b (present in TeX Live 2015) (\#112).
-% \item The \texttt{bgcolor} option now uses the \texttt{snugshade*} environment from the \texttt{framed} package, so \texttt{bgcolor} is now compatible with page breaks. When \texttt{bgcolor} is in use, immediately preceding text will no longer push the \texttt{minted} environment into the margin, and there is now adequate spacing from surrounding text (\#121).
-% \item Added missing support for \texttt{fancyvrb}'s \texttt{labelposition} (\#102).
-% \item Improved fix for TikZ externalization, thanks to Patrick Vogt (\#73).
-% \item Fixed \texttt{breakautoindent}; it was disabled in version 2.1 due to a bug in \texttt{breakanywhere}.
-% \item Properly fixed handling of \texttt{\string\MintedPygmentize} (\#62).
-% \item Added note on incompatibility of \texttt{breaklines} and \texttt{obeytabs} options. Trying to use these together will now result in a package error (\#99). Added note on issues with \texttt{obeytabs} and multiline comments (\#88). Due to the various \texttt{obeytabs} issues, the docs now discourage using \texttt{obeytabs}.
-% \item Added note to FAQ on \texttt{fancybox} and \texttt{fancyvrb} conflict (\#87).
-% \item Added note to docs on the need for \texttt{\string\VerbatimEnvironment} in environment definitions based on \texttt{minted} environments.
-% \end{changelog}
-%
-%
-% \begin{changelog}{v2.1}{2015/09/09}
-% \item Changing the highlighting style now no longer involves re-highlighing code. Style may be changed with almost no overhead.
-% \item Improved control of automatic line breaks. New option \texttt{breakanywhere} allows line breaks anywhere when \texttt{breaklines=true}. The pre-break and post-break symbols for these types of breaks may be set with \texttt{breakanywheresymbolpre} and \texttt{breakanywheresymbolpost} (\#79). New option \texttt{breakafter} allows specifying characters after which line breaks are allowed. Breaks between adjacent, identical characters may be controlled with \texttt{breakaftergroup}. The pre-break and post-break symbols for these types of breaks may be set with \texttt{breakaftersymbolpre} and \texttt{breakaftersymbolpost}.
-% \item \texttt{breakbytoken} now only breaks lines between tokens that are separated by spaces, matching the documentation. The new option \texttt{breakbytokenanywhere} allows for breaking between tokens that are immediately adjacent. Fixed a bug in \texttt{\string\mintinline} that produced a following linebreak when \texttt{\string\mintinline} was the first thing in a paragraph and \texttt{breakbytoken} was true (\#77).
-% \item Fixed a bug in draft mode option handling for \texttt{\string\inputminted} (\#75).
-% \item Fixed a bug with \texttt{\string\MintedPygmentize} when a custom \texttt{pygmentize} was specified and there was no \texttt{pygmentize} on the default path (\#62).
-% \item Added note to docs on caching large numbers of code blocks under OS~X (\#78).
-% \item Added discussion of current limitations of \texttt{texcomments} (\#66) and \texttt{escapeinside} (\#70).
-% \item PGF/Ti\textit{k}Z externalization is automatically detected and supported (\#73).
-% \item The package is now compatible with \LaTeX\ files whose names contain spaces (\#85).
-% \end{changelog}
-%
-%
-% \begin{changelog}{v2.0}{2015/01/31}
-% \item Added the compatibility package \texttt{minted1}, which provides the \texpkg{minted} 1.7 code. This may be loaded when 1.7 compatibility is required. This package works with other packages that \texttt{\string\RequirePackage\{minted\}}, so long as it is loaded first.
-% \item Moved all old \texttt{\string\changes} into \texttt{changelog}.
-% \end{changelog}
-%
-%
-% \begin{changelog}{Development releases for 2.0}{2014--January 2015}
-% \item Caching is now on by default.
-% \item Fixed a bug that prevented compiling under Windows when file names contained commas.
-% \item Added \texttt{breaksymbolleft}, \texttt{breaksymbolsepleft}, \texttt{breaksymbolindentleft}, \texttt{breaksymbolright}, \texttt{breaksymbolsepright}, and \texttt{breaksymbolindentright} options. \texttt{breaksymbol}, \texttt{breaksymbolsep}, and \texttt{breaksymbolindent} are now aliases for the correspondent \texttt{*left} options.
-% \item Added \texttt{kpsewhich} package option. This uses \texttt{kpsewhich} to locate the files that are to be highlighted. This provides compatibility with build tools like \texttt{texi2pdf} that function by modifying \texttt{TEXINPUTS} (\#25).
-% \item Fixed a bug that prevented \texttt{\string\inputminted} from working with \texttt{outputdir}.
-% \item Added informative error messages when Pygments output is missing.
-% \item Added \texttt{final} package option (opposite of \texttt{draft}).
-% \item Renamed the default cache directory to \texttt{\_minted-<jobname>} (replaced leading period with underscore). The leading period caused the cache directory to be hidden on many systems, which was a potential source of confusion.
-% \item \texttt{breaklines} and \texttt{breakbytoken} now work with \texttt{\string\mintinline} (\#31).
-% \item \texttt{bgcolor} may now be set through \texttt{\string\setminted} and \texttt{\string\setmintedinline}.
-% \item When math is enabled via \texttt{texcomments}, \texttt{mathescape}, or \texttt{escapeinside}, space characters now behave as in normal math by vanishing, instead of appearing as literal spaces. Math need no longer be specially formatted to avoid undesired spaces.
-% \item In default value of \texttt{\string\listoflistingscaption}, capitalized ``Listings'' so that capitalization is consistent with default values for other lists (figures, tables, algorithms, etc.).
-% \item Added \texttt{newfloat} package option that creates the \texttt{listing} environment using \texttt{newfloat} rather than \texttt{float}, thus providing better compatibility with the \texttt{caption} package (\#12).
-% \item Added support for Pygments option \texttt{stripall}.
-% \item Added \texttt{breakbytoken} option that prevents \texttt{breaklines} from breaking lines within Pygments tokens.
-% \item \texttt{\string\mintinline} uses a \texttt{\string\colorbox} when \texttt{bgcolor} is set, to give more reasonable behavior (\#57).
-% \item For PHP, \texttt{\string\mintinline} automatically begins with \texttt{startinline=true} (\#23).
-% \item Fixed a bug that threw off line numbering in \texttt{minted} when \texttt{langlinenos=false} and \texttt{firstnumber=last}. Fixed a bug in \texttt{\string\mintinline} that threw off subsequent line numbering when \texttt{langlinenos=false} and \texttt{firstnumber=last}.
-% \item Improved behavior of \texttt{\string\mint} and \texttt{\string\mintinline} in \texttt{draft} mode.
-% \item The \texttt{\string\mint} command now has the additional capability to take code delimited by paired curly braces \texttt{\{\}}.
-% \item It is now possible to set options only for \texttt{\string\mintinline} using the new \texttt{\string\setmintedinline} command. Inline options override options specified via \texttt{\string\setminted}.
-% \item Completely rewrote option handling. \texpkg{fancyvrb} options are now handled on the \LaTeX\ side directly, rather than being passed to Pygments and then returned. This makes caching more efficient, since code is no longer rehighlighted just because \texpkg{fancyvrb} options changed.
-% \item Fixed buffer size error caused by using \texttt{cache} with a very large number of files (\#61).
-% \item Fixed \texttt{autogobble} bug that caused failure under some operating systems.
-% \item Added support for \texttt{escapeinside} (requires Pygments 2.0+; \#38).
-% \item Fixed issues with XeTeX and caching (\#40).
-% \item The \texttt{upquote} package now works correctly with single quotes when using Pygments 1.6+ (\#34).
-% \item Fixed caching incompatibility with Linux and OS X under xelatex (\#18 and \#42).
-% \item Fixed \texttt{autogobble} incompatibility with Linux and OS X.
-% \item \texttt{\string\mintinline} and derived commands are now robust, via \texttt{\string\newrobustcmd} from \texttt{etoolbox}.
-% \item Unused styles are now cleaned up when caching.
-% \item Fixed a bug that could interfere with caching (\#24).
-% \item Added \texttt{draft} package option (\#39). This typesets all code using \texttt{fancyvrb}; Pygments is not used. This trades syntax highlighting for maximum speed in compiling.
-% \item Added automatic line breaking with \texttt{breaklines} and related options (\#1).
-% \item Fixed a bug with boolean options that needed a False argument to cooperate with \texttt{\string\setminted} (\#48).
-% \end{changelog}
-%
-% \begin{changelog}{v2.0-alpha3}{2013/12/21}
-% \item Added \texttt{autogobble} option. This sends code through Python's \texttt{textwrap.dedent()} to remove common leading whitespace.
-% \item Added package option \texttt{cachedir}. This allows the directory in which cached content is saved to be specified.
-% \item Added package option \texttt{outputdir}. This allows an output directory for temporary files to be specified, so that the package can work with LaTeX's \texttt{-output-directory} command-line option.
-% \item The \texttt{kvoptions} package is now required. It is needed to process key-value package options, such as the new \texttt{cachedir} option.
-% \item Many small improvements, including better handling of paths under Windows and improved key system.
-% \end{changelog}
-%
-% \begin{changelog}{v2.0-alpha2}{2013/08/21}
-% \item \texttt{\string\DeleteFile} now only deletes files if they do indeed exist. This eliminates warning messages due to missing files.
-% \item Fixed a bug in the definition of \texttt{\string\DeleteFile} for non-Windows systems.
-% \item Added support for Pygments option \texttt{stripnl}.
-% \item Settings macros that were previously defined globally are now defined locally, so that \texttt{\string\setminted} may be confined by \texttt{\string\begingroup...\string\endgroup} as expected.
-% \item Macro definitions for a given style are now loaded only once per document, rather than once per command/environment. This works even without caching.
-% \item A custom script/executable may now be substituted for \texttt{pygmentize} by redefining \texttt{\string\MintedPygmentize}.
-% \end{changelog}
-%
-%
-% \begin{changelog}{v2.0alpha}{2013/07/30}
-% \item Added the package option \texttt{cache}. This significantly increases compilation speed by caching old output. For example, compiling the documentation is around 5x faster.
-% \item New inline command \texttt{\string\mintinline}. Custom versions can be created via \texttt{\string\newmintinline}. The command works inside other commands (for example, footnotes) in most situations, so long as the percent and hash characters are avoided.
-% \item The new \texttt{\string\setminted} command allows options to be specified at the document and language levels.
-% \item All extended characters (Unicode, etc.) supported by \texttt{inputenc} now work under the pdfTeX engine. This involved using \texttt{\string\detokenize} on everything prior to saving.
-% \item New package option \texttt{langlinenos} allows line numbering to pick up where it left off for a given language when \texttt{firstnumber=last}.
-% \item New options, including \texttt{style}, \texttt{encoding}, \texttt{outencoding}, \texttt{codetagify}, \texttt{keywordcase}, \texttt{texcomments} (same as \texttt{texcl}), \texttt{python3} (for the \texttt{PythonConsoleLexer}), and \texttt{numbers}.
-% \item \texttt{\string\usemintedstyle} now takes an optional argument to specify the style for a particular language, and works anywhere in the document.
-% \item \texttt{xcolor} is only loaded if \texttt{color} isn't, preventing potential package clashes.
-% \end{changelog}
-%
-%
-% \begin{changelog}{1.7}{2011/09/17}
-% \item Options for float placement added [2011/09/12]
-% \item Fixed \texttt{tabsize} option [2011/08/30]
-% \item More robust detection of the \texttt{-shell-escape} option [2011/01/21]
-% \item Added the \texttt{label} option [2011/01/04]
-% \item Installation instructions added [2010/03/16]
-% \item Minimal working example added [2010/03/16]
-% \item Added PHP-specific options [2010/03/14]
-% \item Removed unportable flag from Unix shell command [2010/02/16]
-% \end{changelog}
-%
-%
-% \begin{changelog}{1.6}{2010/01/31}
-% \item Added font-related options [2010/01/27]
-% \item Windows support added [2010/01/27]
-% \item Added command shortcuts [2010/01/22]
-% \item Simpler versioning scheme [2010/01/22]
-% \end{changelog}
-%
-%
-% \begin{changelog}{0.1.5}{2010/01/13}
-% \item Added \texttt{fillcolor} option [2010/01/10]
-% \item Added float support [2010/01/10]
-% \item Fixed \texttt{firstnumber} option [2010/01/10]
-% \item Removed \texttt{caption} option [2010/01/10]
-% \end{changelog}
-%
-%
-% \begin{changelog}{0.0.4}{2010/01/08}
-% \item Initial version [2010/01/08]
-% \end{changelog}
-%
-%
-% %\DoNotIndex{\newcommand,\newenvironment}
-% %\DoNotIndex{\#,\$,\%,\&,\@,\\,\{,\},\^,\_,\~,\ }
-% %\DoNotIndex{\@ne}
-% %\DoNotIndex{\advance,\begingroup,\catcode,\closein}
-% %\DoNotIndex{\closeout,\day,\def,\edef,\else,\empty,\endgroup}
-% %\DoNotIndex{\begin,\end,\bgroup,\egroup}
-% %\DoNotIndex{\@namedef,\@nameuse,=,\csname,\endcsname}
+%
+% ^^A\DoNotIndex{\newcommand,\newenvironment}
+% ^^A\DoNotIndex{\#,\$,\%,\&,\@,\\,\{,\},\^,\_,\~,\ }
+% ^^A\DoNotIndex{\@ne}
+% ^^A\DoNotIndex{\advance,\begingroup,\catcode,\closein}
+% ^^A\DoNotIndex{\closeout,\day,\def,\edef,\else,\empty,\endgroup}
+% ^^A\DoNotIndex{\begin,\end,\bgroup,\egroup}
+% ^^A\DoNotIndex{\@namedef,\@nameuse,=,\csname,\endcsname}
%
%
% \GetFileInfo{minted.sty}
%
-% \newcommand{\texpkg}[1]{\textsf{#1}}
+% \newcommand{\texpkg}[1]{\textsf{\detokenize{#1}}}
+% \newcommand{\pypkg}[1]{\textsf{\detokenize{#1}}}
+% \newcommand{\mintedpkg}{\texpkg{minted}}
% \newcommand{\app}[1]{\textsf{#1}}
%
-% \title{The \textcolor{minted@mint}{\texpkg{minted}} package:\\Highlighted source code in \LaTeX}
+% \title{The \textcolor{minted@mint}{\mintedpkg} package:\\Highlighted source code in \LaTeX}
% \author{Geoffrey M.\ Poore \\ \url{gpoore@gmail.com} \\ \href{https://github.com/gpoore/minted}{\texttt{github.com/gpoore/minted}} \\ ~\\ Originally created and maintained (2009--2013) by \\ Konrad Rudolph}
% \date{\fileversion~from \filedate}
%
% \maketitle
%
% \begin{abstract}
-% \noindent\texpkg{minted} is a package that facilitates expressive syntax highlighting
-% using the powerful \app{Pygments} library. The package also provides options to
-% customize the highlighted source code output.
+% \noindent\mintedpkg\ provides syntax highlighting using the \href{https://pygments.org/}{Pygments} library. It also provides options for customizing the highlighted source code output, including features implemented in Python such as selecting snippets of code with regular expressions.
%
% \vspace{0.5in}
-% \noindent\textbf{Development status:} \pkg{minted} version 3.0 is now under development, thanks to a \href{https://tug.org/tc/devfund/grants.html}{\TeX\ Development Fund grant} from the \href{https://tug.org/}{\TeX\ Users Group}. This will bring a new Python executable that replaces |pygmentize|. The new executable will be compatible with restricted shell escape, so no more |-shell-escape| with associated security vulnerabilities. The new executable will also make it possible to extend \pkg{minted} using Python, not just \LaTeX\ macros. This will bring official support for custom lexers, allow including snippets of external files based on regular expressions, and make possible a number of other improvements and bugfixes. For compatibility purposes, the final version of \pkg{minted} v2.x will be released as the compatibility package \pkg{minted2}. Initial beta versions of minted v3.0 are expected by early 2024. A final minted v3.x release including all planned features is expected before the end of summer 2024.
+% \noindent The original development of \mintedpkg\ version 3 was funded by a \href{https://tug.org/tc/devfund/grants.html}{\TeX\ Development Fund grant} from the \href{https://tug.org/}{\TeX\ Users Group} in 2023.
% \end{abstract}
%
% \vspace{0.5in}
%
% \subsection*{License}
-% \href{http://www.latex-project.org/lppl.txt}{LaTeX Project Public License (LPPL)} version 1.3.
-%
-% Additionally, the project may be distributed under the terms of the 3-Clause
-% (``New'') BSD license: \url{http://opensource.org/licenses/BSD-3-Clause}.
+% \href{https://www.latex-project.org/lppl.txt}{LaTeX Project Public License (LPPL)} version 1.3c.
%
% \pagebreak
%
@@ -510,162 +311,186 @@
%
%
%
-% \texpkg{minted} is a package that allows formatting source code in \LaTeX.
-% For example:
-% \begin{VerbatimOut}[gobble=1]{minted.doc.out}
-% \begin{minted}{<language>}
-% <code>
-% \end{minted}
-% \end{VerbatimOut}
-% \inputminted[gobble=2,frame=lines]{latex}{minted.doc.out}
-%
-% will highlight a piece of code in a chosen language.
-% The appearance can be customized with a number of options and color schemes.
-%
-% Unlike some other packages, most notably \texpkg{listings}, \texpkg{minted} requires
-% the installation of additional software, \app{Pygments}.
-% This may seem like a disadvantage, but there are also significant advantages.
-%
-% \app{Pygments} provides superior syntax highlighting compared to conventional packages.
-% For example, \texpkg{listings} basically only highlights strings, comments and keywords.
-% \app{Pygments}, on the other hand, can be completely customized to highlight any kind of token the
-% source language might support.
-% This might include special formatting sequences inside strings, numbers, different kinds of
-% identifiers and exotic constructs such as HTML tags.
+% \mintedpkg\ provides syntax highlighting using the \href{https://pygments.org/}{Pygments} library. The general strategy is to wrap code in a command or environment that captures it verbatim, like this:
+%\begin{mintedexample}[frame=single]{latex}
+%\begin{minted}{<language>}
+%<code>
+%\end{minted}
+%\end{mintedexample}
%
-% Some languages make this especially desirable.
-% Consider the following Ruby code as an extreme, but at the same time typical, example:
+% Then the code is passed to Python, highlighted with Pygments, and passed back to \LaTeX\ for inclusion in the document. Here is an example with Ruby code, showing the \LaTeX\ source and then the highlighted output:
%
-% \begin{minted}[gobble=3]{ruby}
+% \begin{example}
+% \begin{minted}{ruby}
% class Foo
% def init
% pi = Math::PI
-% @var = "Pi is approx. #{pi}"
+% @var = "Pi = #{pi}..."
% end
% end
% \end{minted}
+% \end{example}
%
-% Here we have four different colors for identifiers (five, if you count keywords) and escapes from
-% inside strings, none of which pose a problem for \app{Pygments}.
-%
-% Additionally, installing \app{Pygments} is actually incredibly easy (see the next section).
+% Because \mintedpkg\ uses Pygments and other Python software, it can provide more highlighting features than are practical in syntax highlighting packages like \href{ https://ctan.org/pkg/listings}{\texpkg{listings}} that are implemented purely in \LaTeX. In the past, this reliance on external software brought several disadvantages, including a requirement for separately installing Pygments. As of \mintedpkg\ version 3, all Python software including Pygments is bundled with the \LaTeX\ package when it is installed with a \TeX\ package manager, and no dependencies must be installed separately.
%
%
% \section{Installation}
%
-% \subsection{Prerequisites}
+% \subsection{Package manager}
%
-% \app{Pygments} is written in Python, so make sure that you have Python 2.6 or later installed on your system. This may be easily checked from the command line:
+% Installation will typically be simpler and faster using your \TeX\ distribution's package manager. Start your package manager's graphical user interface, or use the relevant command below:
+% \begin{itemize}
+% \item TeX Live: |tlmgr install minted|
+% \item MiKTeX: |mpm --admin --install=minted|
+% \end{itemize}
+% When the \mintedpkg\ package is installed, it includes the |latexminted| Python executable and all required Python libraries including Pygments. For these to function correctly, Python 3.8+ must be installed and on |PATH| when the |latexminted| executable runs.
%
-% \begin{Verbatim}[gobble=3,commandchars=\\\{\}]
-% \$ python --version
-% Python 2.7.5
-% \end{Verbatim}
+% Note that if you plan to use Pygments plugin packages, you will need to install the \pypkg{latexminted} Python package and dependencies including Pygments within a Python installation. The Python libraries installed by a \TeX\ package manager within a \TeX\ installation are not compatible with plugin packages. After installing \pypkg{latexminted} within a Python installation, make sure that its |latexminted| executable has precedence on |PATH|.
%
-% If you don't have Python installed, you can download it from the \href{http://www.python.org/download/}{Python website} or
-% use your operating system's package manager.
+% The \mintedpkg\ package has the \LaTeX\ package dependencies listed below. Depending on your \TeX\ distribution and configuration, these may be installed automatically when \mintedpkg\ is installed.
+% \begin{multicols}{4}
+% \begin{itemize}
+% \setlength{\itemsep}{0pt}
+% \setlength{\parskip}{0pt}
+% \setlength{\parsep}{0pt}
+% \item \texpkg{catchfile}
+% \item \texpkg{etoolbox}
+% \item \texpkg{float}
+% \item \texpkg{fvextra}
+% \item \texpkg{latex2pydata}
+% \item \texpkg{newfloat}
+% \item \texpkg{pdftexcmds}
+% \item \texpkg{pgfkeys}
+% \item \texpkg{pgfopts}
+% \item \texpkg{shellesc}
+% \item \texpkg{xcolor}
+% \end{itemize}
+% \end{multicols}
%
-% Some Python distributions include \texpkg{Pygments} (see some of the options under ``Alternative Implementations'' on the Python site). Otherwise, you will need to install \texpkg{Pygments} manually. This may be done by installing \href{http://pypi.python.org/pypi/setuptools}{\app{setuptools}}, which facilitates the distribution of Python applications. You can then install \app{Pygments} using the following command:
-% \begin{Verbatim}[gobble=3,commandchars=\\\{\}]
-% \$ sudo easy_install Pygments
-% \end{Verbatim}
-% Under Windows, you will not need the |sudo|, but may need to run the command prompt as administrator. \texpkg{Pygments} may also be installed with |pip|:
-% \begin{Verbatim}[gobble=3,commandchars=\\\{\}]
-% \$ pip install Pygments
-% \end{Verbatim}
%
-% If you already have \app{Pygments} installed, be aware that the latest version is recommended (at least 1.4 or later). Some features, such as |escapeinside|, will only work with 2.0+. \texpkg{minted} may work with versions as early as 1.2, but there are no guarantees.
+% \subsection{Manual installation}
%
+% \mintedpkg\ source files are available at \href{https://github.com/gpoore/minted}{|github.com/gpoore/minted|}. There is also \href{https://ctan.org/pkg/minted}{|ctan.org/pkg/minted|}.
%
-% \subsection{Required packages}
+% Install |minted.sty| (and |minted2.sty| and |minted1.sty| if desired) within your \TeX\ installation. For TeX Live, it may be best to put style files under |TEXMFLOCAL|, which can be located by running |kpsewhich --var-value TEXMFLOCAL|. For example, you might put the files in |<texlive>/<year>/texmf-local/tex/latex/local/minted|. For further details, consult your \TeX\ distribution's documentation, or an online guide such as \href{https://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages}{\Verb{en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages}} or \href{https://texfaq.org/}{\Verb|texfaq.org|}. After installing the |.sty| files, make \TeX\ aware of the new files by running |texhash| or |mktexlsr| (TeX Live), or |initexmf --update-fndb| (MiKTeX).
%
-% \texpkg{minted} requires that the following packages be available and reasonably up to date on your system. All of these ship with recent \TeX\ distributions.
+% Next, install the Python side of the package. Python 3.8+ is required. There are two options: Install the \pypkg{latexminted} package and dependencies within a Python installation (typically easier, and required for compatibility with Pygments plugin packages), or install them within your \TeX\ installation.
%
-% \begin{multicols}{3}
-% \begingroup
-% \setlength\parskip{0pt}
-% \setlength\topsep{0pt}
-% \begin{list}{\textrm{\labelitemi}}{\ttfamily}
-% \item keyval
-% \item kvoptions
-% \item fancyvrb
-% \item fvextra
-% \item upquote
-% \item float
-% \item ifthen
-% \item calc
-% \item ifplatform
-% \item pdftexcmds
-% \item etoolbox
-% \item xstring
-% \item xcolor
-% \item lineno
-% \item framed
-% \item shellesc (for luatex 0.87+)
-% \item catchfile
-%
-% ~
-% \end{list}
-% \endgroup
-% \end{multicols}
+% Note that if you are only using the \texpkg{minted2} package for backward compatibility with \mintedpkg\ version 2, you do not need \pypkg{latexminted}. \texpkg{minted2} only requires the Pygments package, which can be installed with something like |pip install pygments|, |conda install anaconda::pygments|, or |brew install pygments|, depending on your operating system and Python distribution. You may need to modify the command depending on system versus user installation and depending on virtual environments.
%
+% \subsubsection{Option 1 (recommended): Install \pypkg{latexminted} within Python installation}
%
-% \subsection{Installing \texpkg{minted}}
-% \label{sec:installing:installing}
+% If your Python distribution is compatible with \href{https://pypi.org/}{The Python Package Index (PyPI)}, this can be accomplished by running |pip install latexminted|. This will install \pypkg{latexminted} plus all dependencies including Pygments. You may need to modify the command depending on whether you want a system or user (|--user|) installation, depending on whether you are using virtual environments, and depending on whether something like |pip3| is needed instead of |pip|.
%
-% You can probably install \texpkg{minted} with your \TeX\ distribution's package manager. Otherwise, or if you want the absolute latest version, you can install it manually by following the directions below.
+% If you cannot or do not wish to use PyPI via |pip|, install the following packages manually or from other sources.
+% \begin{itemize}
+% \setlength{\itemsep}{0pt}
+% \setlength{\parskip}{0pt}
+% \setlength{\parsep}{0pt}
+% \item \pypkg{latexminted}: \url{https://pypi.org/project/latexminted/}
+% \item \pypkg{latexrestricted}: \url{https://pypi.org/project/latexrestricted/}
+% \item \pypkg{latex2pydata}: \url{https://pypi.org/project/latex2pydata/}
+% \item Pygments: \url{https://pypi.org/project/Pygments/}
+% \end{itemize}
%
-% You may download |minted.sty| from the
-% \href{https://github.com/gpoore/minted}{project's homepage}. We have to install the file so that \TeX\ is able to find it.
-% In order to do that, please refer to the
-% \href{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=inst-wlcf}{\TeX{} FAQ}.
-% If you just want to experiment with the latest version, you could locate your current |minted.sty| in your \TeX\ installation and replace it with the latest version. Or you could just put the latest |minted.sty| in the same directory as the file you wish to use it with.
+% \subsubsection{Option 2: Install \pypkg{latexminted} within \TeX\ installation}
%
+% This approach is more involved and essentially replicates the process that is performed automatically when using a \TeX\ package manager.
%
-% \section{Basic usage}
+% Install the |latexminted.py| executable within your \TeX\ installation. (It is part of the \mintedpkg\ \LaTeX\ package, separate from the \pypkg{latexminted} Python package.) This should typically be within a |scripts| directory. When TeX Live installs \mintedpkg\ with its package manager, this is something like |<texlive>/<year>/texmf-dist/scripts/minted|.
%
-% \subsection{Preliminary}
-% \label{sec:basic:preliminary}
+% Download Python wheels (|*.whl|) for the following Python packages, and place them in the same location as |latexminted.py|.
+% \begin{itemize}
+% \setlength{\itemsep}{0pt}
+% \setlength{\parskip}{0pt}
+% \setlength{\parsep}{0pt}
+% \item \pypkg{latexminted}: \url{https://pypi.org/project/latexminted/}
+% \item \pypkg{latexrestricted}: \url{https://pypi.org/project/latexrestricted/}
+% \item \pypkg{latex2pydata}: \url{https://pypi.org/project/latex2pydata/}
+% \item Pygments: \url{https://pypi.org/project/Pygments/}
+% \end{itemize}
%
-% Since \texpkg{minted} makes calls to the outside world (that is, \app{Pygments}), you need to tell the
-% \LaTeX{} processor about this by passing it the |-shell-escape| option or it won't allow such calls.
-% In effect, instead of calling the processor like this:
-% \begin{Verbatim}[gobble=3,commandchars=\\\{\}]
-% \$ latex input
-% \end{Verbatim}
+% Under non-Windows operating systems, create a symlink called |latexminted| in the \TeX\ binary directory or another appropriate location that points to |latexminted.py|. When TeX Live installs \mintedpkg\ with its package manager, this is something like |<texlive>/<year>/bin/<architecture>|.
%
-% you need to call it like this:
+% Under Windows, a launcher executable for |latexminted.py| needs to be created. When TeX Live installs \mintedpkg\ with its package manager, it creates a copy of |runscript.exe| named |latexminted.exe| within the \TeX\ binary directory, which is something like |<texlive>/<year>/bin/windows|.
%
-% \begin{Verbatim}[gobble=3,commandchars=\\\{\}]
-% \$ latex -shell-escape input
-% \end{Verbatim}
%
-% The same holds for other processors, such as |pdflatex| or |xelatex|.
%
-% You should be aware that using |-shell-escape| allows \LaTeX\ to run potentially arbitrary commands on your system. It is probably best to use |-shell-escape| only when you need it, and to use it only with documents from trusted sources.
+% \section{Migrating from \mintedpkg\ version 2}
%
+% \mintedpkg\ version 3 is a complete rewrite from version 2.9. A brief summary of changes is provided below. For full details, see |CHANGELOG_MINTED_LATEX_PACKAGE.md|.
%
-% \subsubsection*{Working with OS X}
+% \subsubsection*{Backward compatibility}
%
-% If you are using \texpkg{minted} with some versions/configurations of OS X, and are using caching with a large number of code blocks ($>256$), you may receive an error like
-%\begin{Verbatim}
-%OSError: [Errno 24] Too many open files:
-%\end{Verbatim}
-% This is due to the way files are handled by the operating system, combined with the way that caching works. To resolve this, you may use the OS X commands |launchctl limit maxfiles| or |ulimit -n| to increase the number of files that may be used.
+% The new \texpkg{minted2} package provides the features of \texpkg{minted} version 2.9, the final release before version 3. No additional version 2 releases are planned; no changes to the \texpkg{minted2} package are expected.
+%
+%
+% \subsubsection*{New features and changes}
+%
+% \begin{itemize}
+% \item Version 3 uses a new \mintedpkg-specific Python executable called |latexminted| to perform syntax highlighting. This executable is specifically designed to meet the security requirements for restricted shell escape programs. Once it has passed a security review and is accepted by \TeX\ distributions, it will be possible to highlight code without |-shell-escape| and its attendant security vulnerabilities.
+%
+% Syntax highlighting is still performed with Pygments, but the |pygmentize| executable included with Pygments is no longer used.
+%
+% When \mintedpkg\ is installed with a \TeX\ package manager, the new |latexminted| executable and all Python libraries including Pygments are installed within the \TeX\ installation. A separate step to install Pygments is no longer necessary.
+%
+% \item Temporary files are no longer created unless code needs to be highlighted. There is a new naming scheme for temporary files and for cache files.
+%
+% \item New package options: |debug| (additional debug info during compilation), |highlightmode| (modify when code is highlighted for faster compilation), |placeholder| (insert a placeholder instead of code), and |verbatim| (insert verbatim approximation of code).
+%
+% \item Renamed package options |langlinenos| to |lexerlinenos| and |inputlanglinenos| to |inputlexerlinenos|. The old names are still supported.
+%
+% \item |bgcolor| now uses the new |bgcolor| option from \texpkg{fvextra} v1.8. Because |bgcolor| now introduces no additional whitespace or padding, existing documents may require some modification. Added new option |bgcolorpadding| for modifying padding in background color regions. Added new option |bgcolorvphantom| for setting height of background color in inline contexts. When more sophisticated background colors are needed, \texpkg{tcolorbox} or a similar package should be used.
+%
+% \item The default cache directory name is now |_minted|. All files within a directory now share the same cache, instead of having separate per-document caches. Document-specific caching as in |minted| version 2 can be restored using the package option |cachedir|.
+%
+% \item |\newminted| now creates an environment that takes an optional argument consisting of options, instead of taking no argument.
+%
+% \item File encoding changes: The new |latexminted| executable assumes that \LaTeX\ output files are UTF-8, and saves highlighted code as UTF-8. That is, LaTeX should be configured so that everything is UTF-8. The |encoding| option now defaults to UTF-8. It is only used in decoding files for |\inputminted| and commands based on it. The |outencoding| option is no longer supported.
+%
+% \item Added new options for including ranges of code based on literal string delimiters or regular expressions: |rangestartstring|, |rangestartafterstring|, |rangestopstring|, |rangestopbeforestring|, |rangeregex|.
+%
+% \item There is now support for custom lexers in standalone Python files. See the documentation for the new |.latexminted_config| configuration files for details.
+%
+% \item Several package options are no longer supported and result in errors or warnings. The package options |finalizecache|, |outputdir|, and |kpsewhich| are no longer needed given new \mintedpkg\ version 3 capabilities. The package options |draft| and |final| no longer have any effect and will soon be removed altogether. The new package options |placeholder| and |verbatim| are available in cases where using highlighted code should be completely avoided.
+% \end{itemize}
+%
+%
+%
+% \section{Basic usage}
+%
+% \subsection{The \Verb{latexminted} Python executable and shell escape}
+%
+% The \mintedpkg\ package operates by passing code to the |latexminted| Python executable, which performs syntax highlighting and then returns the highlighted code in \LaTeX\ format.
+%
+% Currently, |latexminted| requires special permission to run. \LaTeX\ must be called with the |-shell-escape| option (TeX Live) or the |-enable-write18| option (MiKTeX). Note that using |-shell-escape| or |-enable-write18| allows \LaTeX\ to run potentially arbitrary commands on your system. These should only be used when necessary, with documents from trusted sources.
%
+% |latexminted| is designed to be compatible with the security requirements for restricted shell escape. Once |latexminted| finishes the security review for restricted shell escape executables, it will function automatically without |-shell-escape| or |-enable-write18|, so long as the default restricted shell escape has not been disabled. It is possible to benefit from these enhanced security capabilities immediately and avoid the need for |-shell-escape| or |-enable-write18| by manually designating |latexminted| as a trusted executable.
+% \begin{itemize}
+% \item TeX Live: Copy the variable |shell_escape_commands| from the distribution |texmf.cnf| (something like |<texlive>/<yr>/texmf-dist/web2c/texmf.cnf|) into the user |texmf.cnf| (something like |<texlive>/<yr>/texmf.cnf|), and then add |latexminted| to the |shell_escape_commands| list. The location of the |texmf.cnf| files can be determined by running |kpsewhich -all texmf.cnf|. Note that under Windows, this only works when |latexminted| is installed within a TeX Live installation; it is not compatible with |latexminted| being installed in a Python installation.
+% \item MiKTeX: Add a line |AllowedShellCommands[] = latexminted| to the existing list of allowed commands in |miktex.ini|. You may want to modify the user-scoped configuration instead of the system-wide configuration. See the \href{https://docs.miktex.org/manual/miktex.ini.html}{MiKTeX documentation} for more details, particularly |initexmf --edit-config-file| and |initexmf --set-config-value|.
+% \end{itemize}
+%
+% For the |latexminted| Python executable to correctly inherit security settings from \LaTeX, there are requirements for system configuration when multiple \TeX\ installations are present.
+% \begin{itemize}
+% \item With MiKTeX on systems with multiple MiKTeX installations, the desired MiKTeX installation must be the first MiKTeX installation on |PATH|.
+% \item With TeX Live on Windows systems with multiple TeX Live installations, the desired TeX Live installation must be the first TeX Live installation on |PATH|.
+% \end{itemize}
+% See the \href{https://github.com/gpoore/latexrestricted}{\pypkg{latexrestricted}} documentation for details.
%
%
% \subsection{A minimal complete example}
%
-% The following file |minimal.tex| shows the basic usage of \texpkg{minted}.
+% The following file |minimal.tex| shows the basic usage of \mintedpkg.
%
% \begin{VerbatimOut}[gobble=1]{minted.doc.out}
% \documentclass{article}
%
% \usepackage{minted}
+% \usepackage[svgnames]{xcolor}
%
% \begin{document}
-% \begin{minted}{c}
+% \begin{minted}[bgcolor=Beige, bgcolorpadding=0.5em]{c}
% int main() {
% printf("hello, world");
% return 0;
@@ -673,55 +498,47 @@
% \end{minted}
% \end{document}
% \end{VerbatimOut}
-% \inputminted[gobble=2,frame=lines]{latex}{minted.doc.out}
-%
-% By compiling the source file like this:
+% \inputminted[frame=single]{latex}{minted.doc.out}
%
-% \begin{Verbatim}[gobble=3,commandchars=\\\{\}]
-% \$ pdflatex -shell-escape minimal
-% \end{Verbatim}
+% This document can be compiled by running ``|pdflatex -shell-escape minimal|''
+% to produce the following output in |minimal.pdf|:
%
-% we end up with the following output in |minimal.pdf|:
-%
-% \hfill
-% \colorbox{minted@samplebg}{\begin{minipage}{0.6\textwidth}
-% \inputminted[firstline=7,lastline=10]{c}{minted.doc.out}
-% \end{minipage}}
-% \hfill\hfill
+% \begin{center}
+% \begin{minipage}{0.6\textwidth}
+% \inputminted[rangeregex=\^\\s*int.+?\\\}, rangeregexdotall=true, rangeregexmultiline=true, bgcolor=Beige, bgcolorpadding=0.5em]{c}{minted.doc.out}
+% \end{minipage}
+% \end{center}
%
%
% \subsection{Formatting source code}
%
% \DescribeEnv{minted}
-% Using \texpkg{minted} is straightforward. For example, to highlight some Python source code we might use
-% the following code snippet (result on the right):
+% The |minted| environment highlights a block of code:
%
% \begin{example}
-% \begin{minted}{python}
-% def boring(args = None):
-% pass
-% \end{minted}
+% \begin{minted}{python}
+% def boring(args = None):
+% pass
+% \end{minted}
% \end{example}
%
-% Optionally, the environment accepts a number of options in |key=value| notation, which are described
-% in more detail below.
+% The environment accepts a number of optional arguments in |key=value| notation. These are described in \cref{sec:options:macro}.
%
-% To use \texpkg{minted} with a language that is not supported by Pygments, or simply to disable highlighting, set the language to |text|: |\begin{minted}{text}|.
+% To use \mintedpkg\ with a language that is not supported by Pygments, or simply to disable highlighting, set the language to |text|: |\begin{minted}{text}|.
%
%
% \DescribeMacro{\mint}
-% For a single line of source code, you can alternatively use a shorthand notation:
+% For a single line of source code, you can use |\mint| as a shorthand for |minted|:
%
% \begin{example}
-% \mint{python}|import this|
+% \mint{python}/import this/
% \end{example}
%
% This typesets a single line of code using a command rather than an environment, so it saves a little typing, but its output is equivalent to that of the |minted| environment.
%
% The code is delimited by a pair of identical characters, similar to how |\verb| works. The complete syntax is \cmd\mint\oarg{options}\marg{language}\meta{delim}\meta{code}\meta{delim},
% where the code delimiter can be almost any punctuation character.
-% The \meta{code} may also be delimited with matched curly braces |{}|, so long as \meta{code} itself does not contain unmatched curly braces.
-% Again, this command supports a number of options described below.
+% The \meta{code} may also be delimited with paired curly braces |{}|, so long as \meta{code} itself does not contain unpaired curly braces.
%
% Note that the |\mint| command \textbf{is not for inline use}. Rather, it is a shortcut for |minted| when only a single line of code is present. The |\mintinline| command is provided for inline use.
%
@@ -730,73 +547,61 @@
% Code can be typeset inline:
%
% \begin{example}
-% X\mintinline{python}{print(x**2)}X
+% \mintinline{py}{print("Hello!")}
% \end{example}
%
% The syntax is \cmd\mintinline\oarg{options}\marg{language}\meta{delim}\meta{code}\meta{delim}. The delimiters can be a single repeated character, just like for \cmd{\verb}. They can also be a pair of curly braces, |{}|. Curly braces are required when \cmd{\mintinline} is used in a movable argument, such as in a \cmd{\section}.
%
-% Unlike \cmd{\verb}, \cmd{\mintinline} can usually be used inside other commands. The main exception is when the code contains the percent \texttt{\%} or hash \texttt{\#} characters, or unmatched curly braces. For example, \cmd{\mintinline} typically works in \cmd{\footnote} and \cmd{\section}! Note that some document classes or packages, such as \texpkg{memoir}, redefine \cmd{\section} or have options that modify it in ways that are incompatible with \cmd{\mintinline}. If you use \cmd{\mintinline} inside \cmd{\section} or otherwise in a movable argument, you should experiment to make sure it is compatible with your document configuration. You may also want to consider \texpkg{fvextra}'s \cmd{\Verb} or \cmd{\EscVerb} as an alternative.
+% Unlike \cmd{\verb}, \cmd{\mintinline} can usually be used inside other commands. The main exception is when the code contains the percent \texttt{\%} or hash \texttt{\#} characters, or unpaired curly braces. For example, \cmd{\mintinline} typically works in \cmd{\footnote} and \cmd{\section}! Note that some document classes or packages, such as \texpkg{memoir}, redefine \cmd{\section} or have options that modify it in ways that are incompatible with \cmd{\mintinline}. If you use \cmd{\mintinline} inside \cmd{\section} or otherwise in a movable argument, you should experiment to make sure it is compatible with your document configuration. You may also want to consider \texpkg{fvextra}'s \cmd{\Verb} or \cmd{\EscVerb} as an alternative.
%
% The code typesetting for \cmd{\mintinline} is based on \texpkg{fvextra}'s \cmd{\Verb}. See the \href{https://github.com/gpoore/fvextra/}{\texpkg{fvextra} documentation on \cmd{\Verb}} for additional details about functionality and limitations.
%
% \DescribeMacro{\inputminted}
-% Finally, there's the |\inputminted| command to read and format whole files.
+% Finally, there's the |\inputminted| command to input external files.
% Its syntax is \cmd\inputminted\oarg{options}\marg{language}\marg{filename}.
%
-% \warn: \meta{filename} is used to generate a shell command for highlighing the file. Due to limitations in the design of \texpkg{minted} and limitations with TeX as a programming language, there is currently no escaping or sanitization of the filename as part of this process. Providing a malformed filename can execute arbitrary system commands. For example, providing ``|file.txt; touch file2.txt|'' as \meta{filename} could highlight one file while subsequently creating a new file. (Issue \href{https://github.com/gpoore/minted/issues/338}{\#338}.)
-%
%
% \subsection{Using different styles}
%
% \DescribeMacro{\usemintedstyle}
-% Instead of using the default style you may choose another stylesheet provided by \app{Pygments}. This may be done via the following:
%
-% \mint[frame=lines]{latex}/\usemintedstyle{name}/
-%
-% The full syntax is \cmd\usemintedstyle\oarg{language}\marg{style}. The style may be set for the document as a whole (no language specified), or only for a particular language. Note that the style may also be set via \cmd\setminted\ and via the optional argument for each command and environment.\footnote{Version 2.0 added the optional language argument and removed the restriction that the command be used in the preamble.}
+% \DescribeMacro{\setminted}
+% Instead of using the default highlighting style you may choose another style provided by Pygments. There are two equivalent ways to do this:
%
-% Highlighting styles with examples can be viewed online at \href{https://pygments.org/styles/}{pygments.org/styles}. It is possible to preview your code with different styles using the online demo at \href{http://pygments.org/demo/}{pygments.org/demo}. Available styles can also be listed by executing the following command on the command line:
+% \begin{minted}{latex}
+% \usemintedstyle{name}
+% \setminted{style=name}
+% \end{minted}
%
-% \begin{Verbatim}[gobble=3,commandchars=\\\{\}]
-% \$ pygmentize -L styles
-% \end{Verbatim}
+% The |\setminted| approach has the advantage that other \mintedpkg\ options are accepted as well; |\usemintedstyle| is restricted to style modifications. The full syntax is \cmd\usemintedstyle\oarg{language}\marg{style} and \cmd\setminted\oarg{language}\marg{key=value}. The style may be set for the document as a whole (no language specified), or only for a particular language. Note that the style may also be set via the optional argument for each command and environment.
%
+% Highlighting styles with examples are at \href{https://pygments.org/styles/}{pygments.org/styles}. It is possible to preview your code with different styles using the online demo at \href{https://pygments.org/demo/}{pygments.org/demo}. Available styles can also be listed by running the command |pygmentize -L styles|.
%
-% Creating your own styles is also easy. Just follow the instructions provided on the
-% \href{http://pygments.org/docs/styles/#creating-own-styles}{\texpkg{Pygments} website}.
+% It is also possible to create your own styles. See the instructions on the
+% \href{https://pygments.org/docs/styles/#creating-own-styles}{\texpkg{Pygments} website}.
+% \mintedpkg\ only supports style names that match the regular expression |^[0-9A-Za-z_-]+$|.
%
%
% \subsection{Supported languages}
%
-% \app{Pygments} supports hundreds of different programming languages, template languages, and other markup languages. To see an exhaustive list of the currently supported languages, use the command
+% Pygments supports hundreds of different programming languages, template languages, and other markup languages. The list of currently supported languages is at \href{https://pygments.org/docs/lexers/}{pygments.org/docs/lexers/}. You can also run |pygmentize -L lexers|.
%
-% \begin{Verbatim}[gobble=3,commandchars=\\\{\}]
-% \$ pygmentize -L lexers
-% \end{Verbatim}
%
%
% \section{Floating listings}\label{sec:float}
%
% \DescribeEnv{listing}
-% \texpkg{minted} provides the |listing| environment to wrap around a source code block. This puts the code into a floating box, with the default placement |tbp| like figures and tables. You can also provide a |\caption| and a |\label| for such a listing in the usual way (that is, as for the |figure| and |table| environments):
-% \begin{VerbatimOut}[gobble=1]{minted.doc.out}
-% \begin{listing}[H]
-% \mint{cl}/(car (cons 1 '(2)))/
-% \caption{Example of a listing.}
-% \label{lst:example}
-% \end{listing}
-%
-% Listing \ref{lst:example} contains an example of a listing.
-% \end{VerbatimOut}
-% \inputminted[gobble=2,frame=lines]{latex}{minted.doc.out}
+% \mintedpkg\ provides a |listing| environment that can be used to wrap code blocks. This puts the code in a floating box similar to a figure or table, with default placement |tbp|. You can also provide a |\caption| and a |\label|:
%
-% will yield:
+% \begin{longexample}
+% \begin{listing}[H]
+% \mint{cl}/(car (cons 1 '(2)))/
+% \caption{Example of a listing.}
+% \label{lst:example}
+% \end{listing}
%
-% \hfill
-% \colorbox{minted@samplebg}{\begin{minipage}{0.6\textwidth}
-% \input{minted.doc.out}
-% \end{minipage}}
-% \hfill\hfill
+% Listing \ref{lst:example} contains an example of a listing.
+% \end{longexample}
%
% The default |listing| placement can be modified easily. When the package option |newfloat=false| (default), the \texpkg{float} package is used to create the |listing| environment. Placement can be modified by redefining |\fps@listing|. For example,
%\begin{verbatim}
@@ -818,7 +623,7 @@
% \end{example}
%
% \subsection*{Customizing the \texttt{listing} environment}
-% By default, the |listing| environment is created using the \texpkg{float} package. In that case, the |\listingscaption| and |\listoflistingscaption| macros described below may be used to customize the caption and list of listings. If \texpkg{minted} is loaded with the |newfloat| option, then the |listing| environment will be created with the more powerful \href{http://www.ctan.org/pkg/newfloat}{\texpkg{newfloat}} package instead. \texpkg{newfloat} is part of \href{http://www.ctan.org/pkg/caption}{\texpkg{caption}}, which provides many options for customizing captions.
+% By default, the |listing| environment is created using the \texpkg{float} package. In that case, the |\listingscaption| and |\listoflistingscaption| macros described below may be used to customize the caption and list of listings. If \mintedpkg\ is loaded with the |newfloat| option, then the |listing| environment will be created with the more powerful \href{https://www.ctan.org/pkg/newfloat}{\texpkg{newfloat}} package instead. \texpkg{newfloat} is part of \href{https://www.ctan.org/pkg/caption}{\texpkg{caption}}, which provides many options for customizing captions.
%
% When \texpkg{newfloat} is used to create the |listing| environment, customization should be achieved using \texpkg{newfloat}'s |\SetupFloatingEnvironment| command. For example, the string ``Listing'' in the caption could be changed to ``Program code'' using
%\begin{verbatim}
@@ -830,155 +635,189 @@
% Refer to the \texpkg{newfloat} and \texpkg{caption} documentation for additional information.
%
% \DescribeMacro{\listingscaption}
-% (Only applies when package option |newfloat| is not used.) The string ``Listing'' in a listing's caption can be changed.
-% To do this, simply redefine the macro |\listingscaption|, for example:
+% This allows the string ``Listing'' in a listing's caption to be customized. It only applies when package option |newfloat=false|. For example:
%
-% \mint[frame=lines]{latex}/\renewcommand{\listingscaption}{Program code}/
+%\begin{verbatim}
+%\renewcommand{\listingscaption}{Program code}
+%\end{verbatim}
%
% \DescribeMacro{\listoflistingscaption}
-% (Only applies when package option |newfloat| is not used.) Likewise, the caption of the listings list, ``List of Listings,'' can be changed by redefining
-% |\listoflistingscaption|:
+% This allows the caption of the listings list, ``List of Listings,'' to be customized. It only applies when package option |newfloat=false|. For example:
%
-% \mint[frame=lines]{latex}/\renewcommand{\listoflistingscaption}{List of Program Code}/
+%\begin{verbatim}
+%\renewcommand{\listoflistingscaption}{List of Program Code}
+%\end{verbatim}
%
%
-% \section{Options}
%
+% \section{Configuration}
%
%
-% \subsection{Package options}
+% \subsection{\mintedpkg\ config file \Verb{.latexminted_config}}
%
-% \DescribeMacro{chapter}
-% To control how \LaTeX{} counts the |listing| floats, you can pass either the
-% |section| or |chapter| option when loading the \texpkg{minted} package.
-% For example, the following will cause listings to be counted by chapter:
+% Several \mintedpkg\ settings with security implications can be customized with a config file |.latexminted_config|. This config file is loaded by the |latexminted| Python executable when it runs.
%
-% \mint[frame=lines]{latex}/\usepackage[chapter]{minted}/
+% The |latexminted| Python executable looks for |.latexminted_config| files in the following locations:
+% \begin{itemize}
+% \item User home directory, as found by Python's \href{https://docs.python.org/3/library/pathlib.html#pathlib.Path.home}{|pathlib.Path.home()|}.
+% \item |TEXMFHOME|. With MiKTeX on systems with multiple MiKTeX installations, this will be the |TEXMFHOME| from the first MiKTeX installation on |PATH|. With TeX Live on Windows systems with multiple TeX Live installations, this will be the |TEXMFHOME| from the first TeX Live installation on |PATH|. In all other cases, |TEXMFHOME| will correspond to the currently active \TeX\ installation. See the \href{https://github.com/gpoore/latexrestricted}{\pypkg{latexrestricted}} documentation for details. \pypkg{latexrestricted} is used by the |latexminted| Python executable to retrieve the value of |TEXMFHOME|.
+% \item The current \TeX\ working directory. Note that |enable_cwd_config| must be set |true| in the |.latexminted_config| in the user home directory or in the |TEXMFHOME| directory to enable this; |.latexminted_config| in the current \TeX\ working directory is not enabled by default for security reasons. Even when a config file in the current \TeX\ working directory is enabled, it cannot be used to modify certain security-related settings.
+% \end{itemize}
%
+% Overall configuration is derived by merging all config files, with later files in the list above having precedence over earlier files. Boolean and string values are overwritten by later config files. Collection values (currently only sets derived from lists) are merged with earlier values.
+%
+% The |.latexminted_config| file may be in Python literal format (dicts and lists of strings and bools), JSON, or TOML (requires Python 3.11+). It must be encoded as UTF-8.
%
-% \DescribeMacro{cache=\meta{boolean} (default:~true)}
-% \texpkg{minted} works by saving code to a temporary file, highlighting the code via \app{Pygments} and saving the output to another temporary file, and inputting the output into the \LaTeX\ document. This process can become quite slow if there are several chunks of code to highlight. To avoid this, the package provides a |cache| option. This is on by default.
%
-% The |cache| option creates a directory |_minted-|\meta{jobname} in the document's root directory (this may be customized with the |cachedir| option).\footnote{The directory is actually named using a ``sanitized'' copy of \meta{jobname}, in which spaces and asterisks have been replaced by underscores, and double quotation marks have been stripped. If the file name contains spaces, \texttt{\string\jobname} will contain a quote-wrapped name, except under older versions of MiKTeX which used the name with spaces replaced by asterisks. Using a ``sanitized'' \meta{jobname} is simpler than accomodating the various escaping conventions.} Files of highlighted code are stored in this directory, so that the code will not have to be highlighted again in the future. In most cases, caching will significantly speed up document compilation.
+% \subsubsection*{Config settings}
%
-% Cached files that are no longer in use are automatically deleted.\footnote{This depends on the main auxiliary file not being deleted or becoming corrupted. If that happens, you could simply delete the cache directory and start over.}
+% \begin{description}
+% \item[{\Verb/security: dict[str, str | bool]/}] These settings relate to |latexminted| security. They can only be set in |.latexminted_config| in the user home directory or in |TEXMFHOME|. They cannot be set in |.latexminted_config| in the current \TeX\ working directory.
+% \begin{description}
+% \item[\Verb|enable_cwd_config: bool = False|] Load a |.latexminted_config| file from the current \TeX\ working directory if it exists. This is disabled by default because the config file can enable |custom_lexers|, which is equivalent to arbitrary code execution.
+% \item[\Verb/file_path_analysis: "resolve" | "string" = "resolve"/] This specifies how |latexminted| determines whether files are readable and writable. Relative file paths are always treated as being relative to the current \TeX\ working directory.
%
+% With |resolve|, any symlinks in file paths are resolved with the file system before paths are compared with permitted \LaTeX\ read/write locations. Arbitrary relative paths including ``|..|'' are allowed so long as the final location is permitted.
%
-% \DescribeMacro{cachedir=\meta{directory} (def:~\_minted-\meta{jobname})}
-% This allows the directory in which cached files are stored to be specified. Paths should use forward slashes, even under Windows.
+% With |string|, paths are analyzed as strings in comparing them with permitted \LaTeX\ read/write locations. This follows the approach taken in \TeX's file system security. Paths cannot contain ``|..|'' to access a parent directory, even if the parent directory is a valid location. Because symlinks are not resolved with the file system, it is possible to access locations outside permitted \LaTeX\ read/write locations, if the permitted locations contain symlinks to elsewhere.
%
-% Special characters must be escaped. For example, |cachedir=~/mintedcache| would not work because the tilde |~| would be converted into the \LaTeX\ commands for a non-breaking space, rather than being treated literally. Instead, use |\string~/mintedcache|, |\detokenize{~/mintedcache}|, or an equivalent solution.
+% \item[{\Verb|permitted_pathext_file_extensions: list[str]|}] As a security measure under Windows, \LaTeX\ cannot write files with file extensions in |PATHEXT|, such as |.bat| and |.exe|. This setting allows |latexminted| to write files with the specified file extensions, overriding \LaTeX\ security. File extensions should be in the form ``|.<ext>|'', for example, ``|.bat|''. This setting is used in extracting source code from \LaTeX\ documents and saving it in standalone source files.
%
-% Paths may contain spaces, but only if the entire \meta{directory} is wrapped in curly braces |{}|, and only if the spaces are quoted. For example,
+% When these file extensions are enabled for writing, as a security measure |latexminted| will only allow them to be created in \textbf{subdirectories} of the current \TeX\ working directory, |TEXMFOUTPUT|, and |TEXMF_OUTPUT_DIRECTORY|. These files cannot be created directly under the \TeX\ working directory, |TEXMFOUTPUT|, and |TEXMF_OUTPUT_DIRECTORY| because those locations are more likely to be used as a working directory in a shell, and thus writing executable files in those locations would increase the risk of accidental code execution.
+% \end{description}
+%
+% \item[{\Verb/custom_lexers: dict[str, str | list[str]]/}] This is a mapping of custom lexer file names to SHA256 hashes. Only custom lexers with these file names and the corresponding hashes are permitted. Lists of hashes are allowed to permit multiple versions of a lexer with a given file name. All other custom lexers are prohibited, because loading custom lexers is equivalent to arbitrary code execution. For example:
+%\begin{verbatim}
+%"custom_lexers": {
+% "mylexer.py": "<sha256>"
+%}
+%\end{verbatim}
+%
+% By default, it is assumed that custom lexer files implement a class |CustomLexer|. This can be modified by including the lexer class name with the file name, separated by a colon, when the lexer is used. For example:
+%
+%\begin{verbatim}
+%\inputminted{./<path>/mylexer.py:LexerClass}{<file>}
+%\end{verbatim}
+%
+% Note that |custom_lexers| only applies to custom lexers in standalone Python files. Lexers that are installed within Python as plugin packages work automatically with Pygments and do not need to be enabled separately. However, in that case it is necessary to install \pypkg{latexminted} and Pygments within a Python installation. When \TeX\ package managers install \pypkg{latexminted} and Pygments within a \TeX\ installation, these are not compatible with Pygments plugin packages.
+% \end{description}
+%
+%
+% \subsection{macOS compatibility}
+% \label{sec:configuration:macos}
+%
+% If you are using \mintedpkg\ with some versions/configurations of macOS, and are using caching with a large number of code blocks ($>256$), you may receive a Python error during syntax highlighting that looks like this:
%\begin{Verbatim}
-%cachedir = {\detokenize{~/"minted cache"/"with spaces"}}
+%OSError: [Errno 24] Too many open files:
%\end{Verbatim}
+% This is due to the way files are handled by the operating system, combined with the way that caching works. To resolve this, you may use one of the following commands to increase the number of files that may be used:
+% \begin{itemize}
+% \item |launchctl limit maxfiles|
+% \item |ulimit -n|
+% \end{itemize}
%
-% Note that the cache directory is relative to the |outputdir|, if an |outputdir| is specified.
%
+% \section{Options}
%
-% \DescribeMacro{finalizecache=\meta{boolean} (default:~false)}
-% In some cases, it may be desirable to use \texpkg{minted} in an environment in which |-shell-escape| is not allowed. A document might be submitted to a publisher or preprint server or used with an online service that does not support |-shell-escape|. This is possible as long as \texpkg{minted} content does not need to be modified.
%
-% Compiling with the |finalizecache| option prepares the cache for use in an environment without |-shell-escape|.\footnote{Ordinarily, cache files are named using an MD5 hash of highlighting settings and highlighted text. \texttt{finalizecache} renames cache files using a \texttt{listing<number>.pygtex} scheme. This makes it simpler to match up document content and cache files, and is also necessary for the XeTeX engine since prior to TeX Live 2016 it lacked the built-in MD5 capabilities that pdfTeX and LuaTeX have.} Once this has been done, the |finalizecache| option may be swapped for the |frozencache| option, which will then use the frozen (static) cache in the future, without needing |-shell-escape|.
%
+% \subsection{Package options}
%
-% \DescribeMacro{fontencoding=\meta{encoding} (default:~\meta{doc~encoding})}
-% Set font encoding used for typesetting code.
+% \DescribeMacro{chapter}
+% To control how \LaTeX{} counts the |listing| floats, you can pass either the
+% |chapter| or |section| option when loading the \mintedpkg\ package.
+% For example, the following will cause listings to be counted by chapter:
%
-% For example, |fontencoding=T1|.
+% \begin{minted}{latex}
+% \usepackage[chapter]{minted}
+% \end{minted}
%
-% \DescribeMacro{frozencache=\meta{boolean} (default:~false)}
-% Use a frozen (static) cache created with the |finalizecache| option. When |frozencache| is on, |-shell-escape| is not needed, and Python and Pygments are not required. In addition, any external files accessed through |\inputminted| are no longer necessary.
%
-% \textbf{This option must be used with care. A document \emph{must} be in final form, as far as \texpkg{minted} is concerned, \emph{before} \texttt{frozencache} is turned on, and the document \emph{must} have been compiled with \texttt{finalizecache}. When this option is on, \texpkg{minted} content cannot be modified, except by editing the cache files directly. Changing any \texpkg{minted} settings that require Pygments or Python is not possible. If \texpkg{minted} content is incorrectly modified after \texttt{frozencache} is turned on, \texpkg{minted} \emph{cannot} detect the modification.}
+% \DescribeMacro{cache=\meta{boolean} (default:~true)}
+% \mintedpkg\ works by saving code to a temporary file, highlighting it with Pygments, and then passing the result back to \LaTeX\ for inclusion in the document. This process can become quite slow if there are several chunks of code to highlight. To avoid this, the package provides a |cache| option. This is on by default.
%
-% If you are using |frozencache|, and want to verify that \texpkg{minted} settings or content have not been modified in an invalid fashion, you can test the cache using the following procedure.
-% \begin{enumerate}
-% \item Obtain a copy of the cache used with |frozencache|.
-% \item Compile the document in an environment that supports |-shell-escape|, with |finalizecache=true| and |frozencache=false|. This essentially regenerates the frozen (static) cache.
-% \item Compare the original cache with the newly generated cache. Under Linux and OS X, you could use |diff|; under Windows, you probably want |fc|. If \texpkg{minted} content and settings have not been modified in an invalid fashion, all files will be identical (assuming that compatible versions of Pygments are used for both caches).
-% \end{enumerate}
+% The |cache| option creates a directory |_minted| in the document's root directory (this may be customized with the |cachedir| option). Files of highlighted code are stored in this directory, so that the code will not have to be highlighted again in the future. Cache files that are no longer used are automatically deleted. In most cases, caching will significantly speed up document compilation.
%
%
-% \DescribeMacro{draft=\meta{boolean} (default:~false)}
-% This uses \texpkg{fancyvrb} alone for all typesetting; \app{Pygments} is not used. This trades syntax highlighting and some other \app{minted} features for faster compiling. Performance should be essentially the same as using \texpkg{fancyvrb} directly; no external temporary files are used. Note that if you are not changing much code between compiles, the difference in performance between caching and draft mode may be minimal. Also note that |draft| settings are typically inherited from the document class.
+% \DescribeMacro{cachedir=\meta{directory} (default:~\_minted)}
+% This allows the directory in which cache files are stored to be customized. Paths should use forward slashes, even under Windows. Special characters must be escaped with |\string| or |\detokenize|.
%
-% Draft mode does not support |autogobble|. Regular |gobble|, |linenos|, and most other options not related to syntax highlighting will still function in draft mode.
+% Note that the cache directory is relative to |-output-directory| or equivalently the |TEXMF_OUTPUT_DIRECTORY| environment variable, if that is set.
%
-% Documents can usually be compiled without shell escape in draft mode. The \texpkg{ifplatform} package may issue a warning about limited functionality due to shell escape being disabled, but this may be ignored in almost all cases. (Shell escape is only really required if you have an unusual system configuration such that the |\ifwindows| macro must fall back to using shell escape to determine the system. See the \texpkg{ifplatform} documentation for more details: \url{http://www.ctan.org/pkg/ifplatform}.)
%
-% If the |cache| option is set, then all existing cache files will be kept while draft mode is on. This allows caching to be used intermitently with draft mode without requiring that the cache be completely recreated each time. Automatic cleanup of cached files will resume as soon as draft mode is turned off. (This assumes that the auxiliary file has not been deleted in the meantime; it contains the cache history and allows automatic cleanup of unused files.)
+% \DescribeMacro{debug=\meta{boolean} (default:~false)}
+% Provide additional information for aid in debugging. This keeps temp files that are used in generating highlighted code and also writes additional information to the log.
%
%
-% \DescribeMacro{final=\meta{boolean} (default:~true)}
-% This is the opposite of |draft|; it is equivalent to |draft=false|. Again, note that |draft| and |final| settings are typically inherited from the document class.
+% \DescribeMacro{frozencache=\meta{boolean} (default:~false)}
+% Use a frozen (static) cache. When |frozencache=true|, Python and Pygments are not required, and any external files accessed through |\inputminted| are no longer necessary. If a cache file is missing, an error will be reported and there will be no attempt to generate the missing cache file.
%
+% When using |frozencache| with |-output-directory|, the |cachedir| package option should be used to specify a full relative path to the cache (for example, |cachedir=./<output_directory>/_minted|).
%
-% \DescribeMacro{inputlanglinenos=\meta{boolean} (default:~false)}
-% This enables |langlinenos| and causes it to apply to |\inputminted| (and custom commands based on it) in addition to |minted| environments and |\mint| commands (and custom environments/commands based on them).
%
-% The regular |langlinenos| option treats all code within a document's |.tex| files as having one set of line numbering per language, and then treats each inputted source file as having its own separate numbering. |inputlanglinenos| defines a single numbering per language, regardless of where code originates.
+% \DescribeMacro{highlightmode=\meta{string} (default:~fastfirst)}
+% Determines when code is highlighted.
%
+% The default is |fastfirst|. If a cache for the document exists, then code is highlighted immediately. If a cache for the document does not exist, then typeset a placeholder instead of code and highlight all code at the end of the document. This will require a second compile before code is typeset, but because all code is highlighted at once, there is less overhead and the total time required can be significantly less for documents that include many code snippets.
%
-% \DescribeMacro{kpsewhich=\meta{boolean} (default:~false)}
-% This option uses |kpsewhich| to locate files that are to be highlighted. Some build tools such as |texi2pdf| function by modifying |TEXINPUTS|; in some cases, users may customize |TEXINPUTS| as well. The |kpsewhich| option allows \texpkg{minted} to work with such configurations.
+% The alternatives are |fast| (always highlight at end of document, requiring a second compile) and |immediate| (always highlight immediately, so no second compile is needed). |immediate| should be used when typesetting code in external temp files that are overwritten during compilation.
%
-% This option may add a noticeable amount of overhead on some systems, or with some system configurations.
+% When code is highlighted at the end of the document with |fast| or |fastfirst|, any error and warning messages will refer to a location at the end of the document rather than the original code location, since highlighting occurred at the end of the document. In this case, messages are supplemented with original \LaTeX\ source file names and line numbers to aid in debugging.
%
-% This option does \emph{not} make \texpkg{minted} work with the |-output-directory| and |-aux-directory| command-line options for \LaTeX. For those, see the |outputdir| package option.
%
+% \DescribeMacro{inputlexerlinenos=\meta{boolean} (default:~false)}
+% This enables |lexerlinenos| and causes it to apply to |\inputminted| (and custom commands based on it) in addition to |minted| environments and |\mint| commands (and custom environments/commands based on them).
%
-% \DescribeMacro{langlinenos=\meta{boolean} (default:~false)}
-% This allows all |minted| environments and |\mint| commands (and custom environments/commands based on them) for a given language to share line numbering when |firstnumber=last|, so that each subsequent command/environment has line numbering that continues from the previous one. This does not apply to |\inputminted| (and custom commands based on it); see the package option |inputlanglinenos| for that.
+% The regular |lexerlinenos| option treats all code within a document's |.tex| files as having one set of line numbering per language, and then treats each inputted source file as having its own separate numbering. |inputlexerlinenos| defines a single numbering per lexer, regardless of where code originates.
%
-% \texpkg{minted} uses the \texpkg{fancyvrb} package behind the scenes for the code typesetting. \texpkg{fancyvrb} provides an option |firstnumber| that allows the starting line number of an environment to be specified. For convenience, there is an option |firstnumber=last| that allows line numbering to pick up where it left off. The |langlinenos| option makes |firstnumber| work for each language individually with all |minted| and |\mint| usages. For example, consider the code and output below.
%
-% \begin{VerbatimOut}[gobble=1]{minted.doc.out}
-% \begin{minted}[linenos]{python}
-% def f(x):
-% return x**2
-% \end{minted}
+% \DescribeMacro{lexerlinenos=\meta{boolean} (default:~false)}
+% This allows all |minted| environments and |\mint| commands (and custom environments/commands based on them) for a given lexer (language) to share line numbering when |firstnumber=last|, so that each subsequent command/environment has line numbering that continues from the previous one. This does not apply to |\inputminted| (and custom commands based on it); see the package option |inputlexerlinenos| for that.
%
-% \begin{minted}[linenos]{ruby}
-% def func
-% puts "message"
-% end
-% \end{minted}
+% \mintedpkg\ uses the \texpkg{fancyvrb} package behind the scenes for the code typesetting. \texpkg{fancyvrb} provides an option |firstnumber| that allows the starting line number of an environment to be specified. For convenience, there is an option |firstnumber=last| that allows line numbering to pick up where it left off. The |lexerlinenos| option makes |firstnumber| work for each lexer (language) individually with all |minted| and |\mint| usages. For example, consider the code and output below.
%
-% \begin{minted}[linenos, firstnumber=last]{python}
-% def g(x):
-% return 2*x
-% \end{minted}
-% \end{VerbatimOut}
-% \inputminted[frame=single, rulecolor=minted@linkcolor]{latex}{minted.doc.out}
-% \hfill
-% \colorbox{minted@samplebg}{\begin{minipage}{0.6\textwidth}
-% \input{minted.doc.out}
-% \end{minipage}}
-% \hfill\hfill
+% \begin{longexample}[xleftmargin=1em]
+% \begin{minted}[linenos]{python}
+% def f(x):
+% return x**2
+% \end{minted}
%
-% Without the |langlinenos| option, the line numbering in the second Python environment would not pick up where the first Python environment left off. Rather, it would pick up with the Ruby line numbering.
+% \begin{minted}[linenos]{ruby}
+% def func
+% puts "message"
+% end
+% \end{minted}
+%
+% \begin{minted}[linenos, firstnumber=last]{python}
+% def g(x):
+% return 2*x
+% \end{minted}
+% \end{longexample}
+%
+% Without the |lexerlinenos| option, the line numbering in the second Python environment would not pick up where the first Python environment left off. Rather, it would pick up with the Ruby line numbering.
%
%
% \DescribeMacro{newfloat=\meta{boolean} (default:~false)}
% By default, the |listing| environment is created using the \texpkg{float} package. The |newfloat| option creates the environment using \texpkg{newfloat} instead. This provides better integration with the \texpkg{caption} package.
%
%
-% \DescribeMacro{outputdir=\meta{directory} (default:~\meta{none})}
-% The |-output-directory| and |-aux-directory| (MiKTeX) command-line options for \LaTeX\ cause problems for \texpkg{minted}, because the \texpkg{minted} temporary files are saved in |<outputdir>|, but \texpkg{minted} still looks for them in the document root directory. There is no way to access the value of the command-line option so that \texpkg{minted} can automatically look in the right place. But it is possible to allow the output directory to be specified manually as a package option.
-%
-% The output directory should be specified using an absolute path or a path relative to the document root directory. Paths should use forward slashes, even under Windows. Special characters must be escaped, while spaces require quoting and need the entire \meta{directory} to be wrapped in curly braces |{}|. See |cachedir| above for examples of escaping and quoting.
+% \DescribeMacro{placeholder=\meta{boolean} (default:~false)}
+% Instead of typesetting code, insert a placeholder. This is enabled automatically when working with PGF/TikZ externalization.
%
%
% \DescribeMacro{section}
% To control how \LaTeX{} counts the |listing| floats, you can pass either the
-% |section| or |chapter| option when loading the \texpkg{minted} package.
+% |section| or |chapter| option when loading the \mintedpkg\ package.
%
%
-% \subsection{Macro option usage}
+% \DescribeMacro{verbatim=\meta{boolean} (default:~false)}
+% Instead of highlighting code, attempt to typeset it verbatim without using the |latexminted| Python executable. This is not guaranteed to be an accurate representation of the code, since some features such as |autogobble| require Python.
%
-% All \texpkg{minted} highlighting commands accept the same set of options.
+%
+% \subsection{Setting options for commands and environments}
+% \label{sec:options:macro}
+%
+% All \mintedpkg\ highlighting commands and environment accept the same set of options.
% Options are specified as a comma-separated list of |key=value| pairs.
% For example, we can specify that the lines should be numbered:
%
@@ -994,8 +833,6 @@
% \end{example}
%
% An option value of |true| may also be omitted entirely (including the ``|=|'').
-% To customize the display of the line numbers further, override the |\theFancyVerbLine| command.
-% Consult the \texpkg{fancyvrb} documentation for details.
%
% |\mint| accepts the same options:
%
@@ -1006,7 +843,7 @@
% Here's another example: we want to use the \LaTeX{} math mode inside comments:
%
% \begin{example}
-% \begin{minted}[mathescape]{python}
+% \begin{minted}[mathescape]{py}
% # Returns $\sum_{i=1}^{n}i$
% def sum_from_one_to(n):
% r = range(1, n + 1)
@@ -1016,36 +853,38 @@
%
% To make your \LaTeX{} code more readable you might want to indent the code inside a |minted|
% environment.
-% The option |gobble| removes these unnecessary whitespace characters from the output. There is also an |autogobble| option that detects the length of this whitespace automatically.
+% The option |gobble| removes a specified number of characters from the output. There is also an |autogobble| option that automatically removes indentation (dedents code).
%
+% \begingroup
+% \setminted{autogobble=false}
% \begin{example}
-% \begin{minted}[gobble=2,
-% showspaces]{python}
+% \begin{minted}[showspaces]{py}
% def boring(args = None):
% pass
-% \end{minted}
+% \end{minted}
%
-% versus
+% versus
%
-% \begin{minted}[showspaces]{python}
+% \begin{minted}[gobble=4,
+% showspaces]{py}
% def boring(args = None):
% pass
-% \end{minted}
+% \end{minted}
% \end{example}
+% \endgroup
%
% \DescribeMacro{\setminted}
-% You may wish to set options for the document as a whole, or for an entire language. This is possible via \cmd\setminted\oarg{language}\marg{key=value,...}. Language-specific options override document-wide options. Individual command and environment options override language-specific options.
+% You may wish to set options for the document as a whole, or for an entire lexer (language). This is possible via \cmd\setminted\oarg{lexer}\marg{key=value,...}. Lexer-specific options override document-wide options. Individual command and environment options override lexer-specific options.
%
% \DescribeMacro{\setmintedinline}
-% You may wish to set separate options for \cmd\mintinline, either for the document as a whole or for a specific language. This is possible via \cmd\setmintedinline. The syntax is
-% \cmd\setmintedinline\oarg{language}\marg{key=value,...}. Language-specific options override document-wide options. Individual command options override language-specific options. All settings specified with \cmd\setmintedinline\ override those set with \cmd\setminted. That is, inline settings always have a higher precedence than general settings.
+% You may wish to set separate options for \cmd\mintinline, either for the document as a whole or for a specific lexer (language). This is possible via \cmd\setmintedinline. The syntax is
+% \cmd\setmintedinline\oarg{lexer}\marg{key=value,...}. Lexer-specific options override document-wide options. Individual command options override lexer-specific options. All settings specified with \cmd\setmintedinline\ override those set with \cmd\setminted. That is, inline settings always have a higher precedence than general settings.
%
-% \subsection{Available options}
+% \subsection{Command and environment options}
%
% \newcommand\appliesto[1]{\textsf{[For #1 only]}}
%
-% Following is a full list of available options.
-% For more detailed option descriptions please refer to the \texpkg{fancyvrb} and \app{Pygments} documentation.
+% Following is a full list of available options. Several options are simply passed on to Pygments, \texpkg{fancyvrb}, and \texpkg{fvextra} for processing. In those cases, more details may be in the documentation for those software packages.
%
% \begin{optionlist}
% \item[autogobble (boolean) (false)]
@@ -1053,52 +892,41 @@
%
% \begin{example}
% ...text.
-% \begin{minted}[autogobble]{python}
+% \begin{minted}[autogobble]{py}
% def f(x):
% return x**2
% \end{minted}
% \end{example}
%
+% When |autogobble| and |gobble| are used together, the effect is cumulative. First |autogobble| removes all common indentation, and then |gobble| is applied.
+%
+% |autogobble| and |gobble| operate on code before the highlighting process begins (before lexing), treating the code purely as text. Meanwhile, |gobblefilter| operates on the token stream generated by a lexer. If the removed characters are simply indentation coming from how the code was entered within \LaTeX, then |autogobble| and |gobble| should typically be preferred. If the removed characters are syntactically significant, then |gobblefilter| may be better. Which approach is preferable may also depend on the implementation details of the lexer.
+%
% \item[baselinestretch (dimension) (\meta{document default})]
-% Value to use as for baselinestretch inside the listing.
+% Value to use for baselinestretch inside the listing.
%
%
% \item[beameroverlays (boolean) (false)]
% Give the |<| and |>| characters their normal text meanings when used with |escapeinside| and |texcomments|, so that \texpkg{beamer} overlays of the form |\only<1>{...}| will work.
%
%
-% \item[bgcolor (string) (\meta{none})]
-% Background color of the listing. Be aware that this option has several limitations (described below); see ``Framing alternatives'' below for more powerful alternatives.
+% \item[bgcolor (string) (none)]
+% Background color behind commands and environments. This is only a basic, lightweight implementation of background colors using |\colorbox|. For more control of background colors, consider \href{https://ctan.org/pkg/tcolorbox}{\pkg{tcolorbox}} or a similar package, or a custom background color implementation.
%
-% The value of this option must \emph{not} be a color command. Instead, it must be a color \emph{name}, given as a string, of a previously-defined color:
+% |bgcolor| prevents line breaks for |\mintinline|. If you want to use \texttt{\string\setminted} to set background colors, and only want background colors on \texttt{minted} and \texttt{\string\mint}, you may use \texttt{\string\setmintedinline\{bgcolor=none\}} to turn off the coloring for inline commands.
+%
+% The value of this option must \emph{not} be a color command. Instead, it must be a color \emph{name}, given as a string, of a previously-defined color:
%
% \begin{example}
-% \definecolor{bg}{rgb}{0.95,0.95,0.95}
-% \begin{minted}[bgcolor=bg]{php}
-% <?php
-% echo "Hello, $x";
-% ?>
-% \end{minted}
+% \definecolor{bg}{rgb}{.9, .9, .9}
+% \begin{minted}[bgcolor=bg]{php}
+% <?php
+% echo "Hello, $x";
+% ?>
+% \end{minted}
% \end{example}
%
-% This option puts \texttt{minted} environments and \texttt{\string\mint} commands in a \texttt{snugshade*} environment from the \texpkg{framed} package, which supports breaks across pages. (Prior to \texpkg{minted} 2.2, a \texttt{minipage} was used, which prevented page breaks and gave undesirable spacing from surrounding text.) Be aware that if \texttt{bgcolor} is used with \texttt{breaklines=true}, and a line break occurs just before a page break, then text may extend below the colored background in some instances. It is best to use a more advanced framing package in those cases; see ``Framing alternatives'' below.
-%
-% This option puts \texttt{\string\mintinline} inside a \texttt{\string\colorbox}, which \textbf{does not allow line breaks}. If you want to use \texttt{\string\setminted} to set background colors, and only want background colors on \texttt{minted} and \texttt{\string\mint}, you may use \texttt{\string\setmintedinline\{bgcolor=\{\}\}} to turn off the coloring for inline commands.
-%
-% ~
-%
-% \textbf{Framing alternatives}
-%
-% If you want more reliable and advanced options for background colors and framing, you should consider a more advanced framing package such as \texpkg{mdframed} or \texpkg{tcolorbox}. It is easy to add framing to \texpkg{minted} commands and environments using the \texpkg{etoolbox} package, which is automatically loaded by \texpkg{minted}. For example, using \texpkg{mdframed}:
-%\begin{Verbatim}
-%\BeforeBeginEnvironment{minted}{\begin{mdframed}}
-%\AfterEndEnvironment{minted}{\end{mdframed}}
-%\end{Verbatim}
-% Some framing packages also provide built-in commands for such purposes. For example, \texpkg{mdframed} provides a \texttt{\string\surroundwithmdframed} command, which could be used to add a frame to all \texttt{minted} environments:
-%\begin{Verbatim}
-%\surroundwithmdframed{minted}
-%\end{Verbatim}
-% \texpkg{tcolorbox} even provides a built-in framing environment with \texpkg{minted} support. Simply use \texttt{\string\tcbuselibrary\{minted\}} in the preamble, and then put code within a \texttt{tcblisting} environment:
+% As an alternative to |bgcolor|, \texpkg{tcolorbox} provides a built-in framing environment with \mintedpkg\ support. Simply use \texttt{\string\tcbuselibrary\{minted\}} in the preamble, and then put code within a \texttt{tcblisting} environment:
%\begin{Verbatim}
%\begin{tcblisting}{<tcb options>,
% minted language=<language>,
@@ -1110,6 +938,14 @@
% \texpkg{tcolorbox} provides other commands and environments for fine-tuning listing appearance and for working with external code files.
%
%
+% \item[bgcolorpadding (length) (none)]
+% Padding when |bgcolor| is set. For inline commands and for environments based on |BVerbatim|, this sets |\fboxsep| for the |\colorbox| that is used to create the background color. For environments based on |Verbatim|, \texpkg{fancyvrb}'s frame options are used instead, particularly |framesep| and |fillcolor|. See the \texpkg{fvextra} documentation for implementation details.
+%
+%
+% \item[bgcolorvphantom (macro) (\Verb{\vphantom{\"Apgjy}})]
+% |\vphantom| or similar macro such as |\strut| that is inserted at the beginning of each line of code using |bgcolor|. This allows the height of the background for each line of code to be customized. This is primarily useful for customizing the background for |\mintinline| and other inline code. It will typically have no effect on |minted| environments and other block code unless it is set to a size larger than |\strut|.
+%
+%
% \item[breakafter (string) (\meta{none})]
% Break lines after specified characters, not just at spaces, when \texttt{breaklines=true}.
%
@@ -1126,12 +962,14 @@
% \item[breakafterinrun] (boolean) (true)
% When \texttt{breakafter} is used, group all adjacent identical characters together, and only allow a break after the last character. When \texttt{breakbefore} and \texttt{breakafter} are used for the same character, \texttt{breakbeforeinrun} and \texttt{breakafterinrun} must both have the same setting.
%
-% \item[breakaftersymbolpre (string) (\string\,\string\footnotesize\string\ensuremath\{\_\string\rfloor\}, \,\footnotesize\ensuremath{_\rfloor})]
-% The symbol inserted pre-break for breaks inserted by \texttt{breakafter}.
%
% \item[breakaftersymbolpost (string) (\meta{none})]
% The symbol inserted post-break for breaks inserted by \texttt{breakafter}.
%
+% \item[breakaftersymbolpre (string) (\string\,\string\footnotesize\string\ensuremath\{\_\string\rfloor\}, \,\footnotesize\ensuremath{_\rfloor})]
+% The symbol inserted pre-break for breaks inserted by \texttt{breakafter}.
+%
+%
% \item[breakanywhere (boolean) (false)]
% Break lines anywhere, not just at spaces, when \texttt{breaklines=true}.
%
@@ -1144,12 +982,20 @@
% \end{longexample}
% \endgroup
%
-% \item[breakanywheresymbolpre (string) (\string\,\string\footnotesize\string\ensuremath\{\_\string\rfloor\}, \,\footnotesize\ensuremath{_\rfloor})]
-% The symbol inserted pre-break for breaks inserted by \texttt{breakanywhere}.
+% \item[breakanywhereinlinestretch (length) (\meta{none})]
+% Stretch glue to insert at potential |breakanywhere| break locations in inline contexts, to give better line widths and avoid overfull |\hbox|. This allows the spacing between adjacent non-space characters to stretch, so it should not be used when column alignment is important. For typical line lengths, values between |0.01em| and |0.02em| should be sufficient to provide a cumulative stretch per line that is equal to or greater than the width of one character.
+%
+% This is typically not needed in cases where an overfull |\hbox| only overflows by tiny amount, perhaps a fraction of a pt. In those cases, the overfull |\hbox| could be ignored, |\hfuzz| could be set to 1pt or 2pt to suppress tiny overfull |\hbox| warnings, or |breakanywheresymbolpre| might be redefined to adjust spacing.
+%
%
% \item[breakanywheresymbolpost (string) (\meta{none})]
% The symbol inserted post-break for breaks inserted by \texttt{breakanywhere}.
%
+%
+% \item[breakanywheresymbolpre (string) (\string\,\string\footnotesize\string\ensuremath\{\_\string\rfloor\}, \,\footnotesize\ensuremath{_\rfloor})]
+% The symbol inserted pre-break for breaks inserted by \texttt{breakanywhere}.
+%
+%
% \item[breakautoindent (boolean) (true)]
% When a line is broken, automatically indent the continuation lines to the indentation level of the first line. When \texttt{breakautoindent} and \texttt{breakindent} are used together, the indentations add. This indentation is combined with \texttt{breaksymbolindentleft} to give the total actual left indentation. Does not apply to \texttt{\string\mintinline}.
%
@@ -1169,22 +1015,29 @@
% \item[breakbeforeinrun] (boolean) (true)
% When \texttt{breakbefore} is used, group all adjacent identical characters together, and only allow a break before the first character. When \texttt{breakbefore} and \texttt{breakafter} are used for the same character, \texttt{breakbeforeinrun} and \texttt{breakafterinrun} must both have the same setting.
%
-% \item[breakbeforesymbolpre (string) (\string\,\string\footnotesize\string\ensuremath\{\_\string\rfloor\}, \,\footnotesize\ensuremath{_\rfloor})]
-% The symbol inserted pre-break for breaks inserted by \texttt{breakbefore}.
%
% \item[breakbeforesymbolpost (string) (\meta{none})]
% The symbol inserted post-break for breaks inserted by \texttt{breakbefore}.
%
+%
+% \item[breakbeforesymbolpre (string) (\string\,\string\footnotesize\string\ensuremath\{\_\string\rfloor\}, \,\footnotesize\ensuremath{_\rfloor})]
+% The symbol inserted pre-break for breaks inserted by \texttt{breakbefore}.
+%
+%
% \item[breakbytoken (boolean) (false)]
% Only break lines at locations that are not within tokens; prevent tokens from being split by line breaks. By default, \texttt{breaklines} causes line breaking at the space nearest the margin. While this minimizes the number of line breaks that are necessary, it can be inconvenient if a break occurs in the middle of a string or similar token.
%
-% This is not compatible with \texttt{draft} mode. A complete list of Pygments tokens is available at \url{http://pygments.org/docs/tokens/}. If the breaks provided by \texttt{breakbytoken} occur in unexpected locations, it may indicate a bug or shortcoming in the Pygments lexer for the language.
+% This does not allow line breaks between immediately adjacent tokens; for that, see |breakbytokenanywhere|.
+%
+% A complete list of Pygments tokens is available at \href{https://pygments.org/docs/tokens}{pygments.org/docs/tokens}. If the breaks provided by \texttt{breakbytoken} occur in unexpected locations, it may indicate a bug or shortcoming in the Pygments lexer for the language.
%
% \item[breakbytokenanywhere (boolean) (false)]
% Like \texttt{breakbytoken}, but also allows line breaks between immediately adjacent tokens, not just between tokens that are separated by spaces. Using \texttt{breakbytokenanywhere} with \texttt{breakanywhere} is redundant.
%
% \item[breakindent (dimension) (\meta{breakindentnchars})]
-% When a line is broken, indent the continuation lines by this amount. When |breakautoindent| and |breakindent| are used together, the indentations add. This indentation is combined with |breaksymbolindentleft| to give the total actual left indentation.
+% When a line is broken, indent the continuation lines by this amount.
+%
+% When |breakautoindent| and |breakindent| are used together, the indentations add. This indentation is combined with |breaksymbolindentleft| to give the total actual left indentation.
%
% Does not apply to \texttt{\string\mintinline}.
%
@@ -1194,11 +1047,11 @@
% \item[breaklines (boolean) (false)]
% Automatically break long lines in \texttt{minted} environments and \texttt{\string\mint} commands, and wrap longer lines in \texttt{\string\mintinline}.
%
-% By default, automatic breaks occur at space characters. Use \texttt{breakanywhere} to enable breaking anywhere; use \texttt{breakbytoken}, \texttt{breakbytokenanywhere}, \texttt{breakbefore}, and \texttt{breakafter} for more fine-tuned breaking. Using \texttt{escapeinside} to escape to \LaTeX\ and then insert a manual break is also an option. For example, use \texttt{escapeinside=||}, and then insert \texttt{|\textbackslash\textbackslash|} at the appropriate point. (Note that \texttt{escapeinside} does not work within strings.)
+% By default, automatic breaks occur at space characters. Use \texttt{breakanywhere} to enable breaking anywhere; use \texttt{breakbytoken}, \texttt{breakbytokenanywhere}, \texttt{breakbefore}, and \texttt{breakafter} for more fine-tuned breaking. Using \texttt{escapeinside} to escape to \LaTeX\ and then insert a manual break is also an option. For example, use \Verb{escapeinside=||}, and then insert \Verb{|\\|} at the appropriate point. (Note that \texttt{escapeinside} does not work within strings.)
%
% \begin{example}
% ...text.
-% \begin{minted}[breaklines]{python}
+% \begin{minted}[breaklines]{py}
% def f(x):
% return 'Some text ' + str(x)
% \end{minted}
@@ -1226,27 +1079,15 @@
% \end{longexample}
% \endgroup
%
-% Automatic line breaks are limited with \app{Pygments} styles that use a colored background behind large chunks of text. This coloring is accomplished with \texttt{\string\colorbox}, which cannot break across lines. It may be possible to create an alternative to \texttt{\string\colorbox} that supports line breaks, perhaps with \texpkg{TikZ}, but the author is unaware of a satisfactory solution. The only current alternative is to redefine \texttt{\string\colorbox} so that it does nothing. For example,
+% Automatic line breaks are limited with Pygments styles that use a colored background behind large chunks of text. This coloring is accomplished with \texttt{\string\colorbox}, which cannot break across lines. It may be possible to create an alternative to \texttt{\string\colorbox} that supports line breaks, perhaps with \texpkg{TikZ}, but the author is unaware of a satisfactory solution. The only current alternative is to redefine \texttt{\string\colorbox} so that it does nothing. For example,
%\begin{Verbatim}
%\AtBeginEnvironment{minted}{\renewcommand{\colorbox}[3][]{#3}}
%\end{Verbatim}
% uses the \texpkg{etoolbox} package to redefine \texttt{\string\colorbox} within all \texttt{minted} environments.
%
-% Automatic line breaks will not work with \texttt{showspaces=true} unless you use \texttt{breakanywhere} or \texttt{breakafter=\string\space}.
-%
% \item[breaksymbol (string) (breaksymbolleft)]
% Alias for \texttt{breaksymbolleft}.
%
-% \item[breaksymbolleft (string) (\string\tiny\string\ensuremath\{\string\hookrightarrow\}, {\tiny\ensuremath{\hookrightarrow}})]
-% The symbol used at the beginning (left) of continuation lines when \texttt{breaklines=true}. To have no symbol, simply set \texttt{breaksymbolleft} to an empty string (``\texttt{=,}'' or ``\texttt{=\{\}}''). The symbol is wrapped within curly braces \texttt{\{\}} when used, so there is no danger of formatting commands such as \texttt{\string\tiny} ``escaping.''
-%
-% The \texttt{\string\hookrightarrow} and \texttt{\string\hookleftarrow} may be further customized by the use of the \texttt{\string\rotatebox} command provided by \texpkg{graphicx}. Additional arrow-type symbols that may be useful are available in the \texpkg{dingbat} (\texttt{\string\carriagereturn}) and \texpkg{mnsymbol} (hook and curve arrows) packages, among others.
-%
-% Does not apply to \texttt{\string\mintinline}.
-%
-% \item[breaksymbolright (string) (\meta{none})]
-% The symbol used at breaks (right) when \texttt{breaklines=true}. Does not appear at the end of the very last segment of a broken line.
-%
%
% \item[breaksymbolindent (dimension) (\meta{breaksymbolindentleftnchars})]
% Alias for |breaksymbolindentleft|.
@@ -1270,6 +1111,17 @@
% This allows |breaksymbolindentright| to be specified as an integer number of characters rather than as a dimension (assumes a fixed-width font).
%
%
+% \item[breaksymbolleft (string) (\string\tiny\string\ensuremath\{\string\hookrightarrow\}, {\tiny\ensuremath{\hookrightarrow}})]
+% The symbol used at the beginning (left) of continuation lines when \texttt{breaklines=true}. To have no symbol, simply set \texttt{breaksymbolleft} to an empty string (``\texttt{=,}'' or ``\texttt{=\{\}}''). The symbol is wrapped within curly braces \texttt{\{\}} when used, so there is no danger of formatting commands such as \texttt{\string\tiny} ``escaping.''
+%
+% The \texttt{\string\hookrightarrow} and \texttt{\string\hookleftarrow} may be further customized by the use of the \texttt{\string\rotatebox} command provided by \texpkg{graphicx}. Additional arrow-type symbols that may be useful are available in the \texpkg{dingbat} (\texttt{\string\carriagereturn}) and \texpkg{mnsymbol} (hook and curve arrows) packages, among others.
+%
+% Does not apply to \texttt{\string\mintinline}.
+%
+% \item[breaksymbolright (string) (\meta{none})]
+% The symbol used at breaks (right) when \texttt{breaklines=true}. Does not appear at the end of the very last segment of a broken line.
+%
+%
% \item[breaksymbolsep (dimension) (\meta{breaksymbolsepleftnchars})]
% Alias for |breaksymbolsepleft|.
%
@@ -1291,23 +1143,45 @@
% Allows |breaksymbolsepright| to be specified as an integer number of characters rather than as a dimension (assumes a fixed-width font).
%
%
-% \item[codetagify (list of strings) (\textrm{highlight \texttt{XXX}, \texttt{TODO}, \texttt{BUG}, and \texttt{NOTE}})]
-% Highlight special code tags in comments and docstrings.
+% \item[codetagify (single macro or backslash-escaped string) (XXX,TODO,FIXME,BUG,NOTE)]
+% Highlight special code tags in comments and docstrings.
+%
+% The value must be a list of strings, either comma-delimited or space-delimited. The value must be a single macro that gives the desired text when fully expanded, or a string that is interpreted literally except that backslash escapes of ASCII punctuation characters are allowed to give the literal characters (``|\\|'' for backslash, ``|\#|'' for ``|#|'', and so on).
%
% \item[curlyquotes (boolean) (false)]
% By default, the backtick \texttt{\textasciigrave} and typewriter single quotation mark \texttt{\textquotesingle} always appear literally, instead of becoming the left and right curly single quotation marks \texttt{`'}. This option allows these characters to be replaced by the curly quotation marks when that is desirable.
%
-% \item[encoding (string) (\meta{system-specific})]
-% Sets the file encoding that \app{Pygments} expects. See also |outencoding|.
-% \item[escapeinside (string) (\meta{none})]
-% Escape to \LaTeX\ between the two characters specified in \texttt{\string(string\string)}. All code between the two characters will be interpreted as \LaTeX\ and typeset accordingly. This allows for additional formatting. The escape characters need not be identical. Special \LaTeX\ characters must be escaped when they are used as the escape characters (for example, \texttt{escapeinside=\textbackslash\#\textbackslash\%}). Requires \app{Pygments} 2.0+.
%
-% \textbf{Escaping does not work inside strings and comments (for comments, there is \texttt{texcomments}). As of Pygments 2.0.2, this means that escaping is ``fragile'' with some lexers.} Due to the way that Pygments implements \texttt{escapeinside}, any ``escaped'' \LaTeX\ code that resembles a string or comment for the current lexer may break \texttt{escapeinside}. There is a \href{https://bitbucket.org/birkenfeld/pygments-main/issue/1118}{Pygments issue} for this case. Additional details and a limited workaround for some scenarios are available on the \href{https://github.com/gpoore/minted/issues/70#issuecomment-111729930}{\texpkg{minted} GitHub site}.
+% \item[encoding (string) (UTF-8)]
+% File encoding used by |\inputminted| and derived commands when reading files.
+%
+%
+% \item[envname (string) (\textrm{\texttt{Verbatim}, or \texttt{VerbEnv} for inline})]
+% This is the name of the environment that wraps typeset code. By default, it is |Verbatim| in block contexts and |VerbEnv| in inline contexts (|\setminted| versus |\setmintedinline|). This is compatible with \texpkg{fancyvrb}'s |BVerbatim|.
+%
+% There are two requirements for using a custom environment other than |Verbatim| and |BVerbatim| in block contexts:
+% \begin{itemize}
+% \item For |minted| and |\mint| support, the custom environment must be created with \texpkg{fancyvrb}'s |\DefineVerbatimEnvironment| or otherwise defined in a manner compatible with \texpkg{fancyvrb}'s environment implementation conventions.
+% \item For |\inputminted| support, a corresponding |\|\meta{envname}|Insert| command must be defined, using \texpkg{fancyvrb}'s |\CustomVerbatimCommand| or otherwise following \texpkg{fancyvrb} command conventions. For example, using a custom variant of |BVerbatim| involves creating both a custom environment as well as a corresponding variant of |\BVerbatimInput|.
+% \end{itemize}
+%
+% There is currently only limited support for using an environment other than |VerbEnv| in inline contexts. If an environment other than |VerbEnv| is specified, it will be used for highlighted code, but will not be used if code is typeset verbatim instead or if highlighting fails and a verbatim fallback is needed. In both of those cases, |\Verb| is currently used.
+%
+% Note that |envname| is the name of the environment that wraps typeset code, but it is \emph{not} the name of the environment that literally appears in highlighted code output. Highlighted code output uses the |MintedVerbatim| environment by default, and then |MintedVerbatim| is redefined based on |envname|. This allows a single cache file to be used in multiple contexts. The name of the environment that literally appears in highlighted code output can be modified with |literalenvname|, but there should be few if any situations where that is actually necessary.
+%
+%
+% \item[escapeinside (single macro or backslash-escaped two-character string) (\meta{none})]
+% Escape to \LaTeX\ between the two characters specified. All code between the two characters will be interpreted as \LaTeX\ and typeset accordingly. This allows for additional formatting. The escape characters need not be identical.
+%
+% The value must be a single macro that gives the desired text when fully expanded, or a string that is interpreted literally except that backslash escapes of ASCII punctuation characters are allowed to give the literal characters (``|\\|'' for backslash, ``|\#|'' for ``|#|'', and so on). Special \LaTeX\ characters must be escaped when they are used as the escape characters (for example, \texttt{escapeinside=\textbackslash\#\textbackslash\%}).
+%
+% \textbf{Escaping does not work inside strings and comments (for comments, there is \texttt{texcomments}). Escaping is ``fragile'' with some lexers.} Due to the way that Pygments implements \texttt{escapeinside}, any ``escaped'' \LaTeX\ code that resembles a string or comment for the current lexer may break \texttt{escapeinside}. There is a \href{https://github.com/pygments/pygments/issues/825}{Pygments issue} for this case. Additional details and a limited workaround for some scenarios are available on the \href{https://github.com/gpoore/minted/issues/70#issuecomment-111729930}{\mintedpkg\ GitHub site}.
%
% \begingroup ^^A Need to prevent active "|" from causing problems
% \catcode`\|=11
% \begin{example}
-% \begin{minted}[escapeinside=||]{py}
+% \setminted{escapeinside=||}
+% \begin{minted}{py}
% def f(x):
% y = x|\colorbox{green}{**}|2
% return y
@@ -1315,33 +1189,57 @@
% \end{example}
% \endgroup
%
-% \textbf{Note that when math is used inside escapes, any active characters beyond those that are normally active in verbatim can cause problems.} Any package that relies on special active characters in math mode (for example, \texpkg{icomma}) will produce errors along the lines of \texttt{TeX capacity exceeded} and \texttt{\string\leavevmode \string\kern \string\z@}. This may be fixed by modifying \texttt{\string\@noligs}, as described at \url{http://tex.stackexchange.com/questions/223876}.
+% \textbf{Note that when math is used inside escapes, any active characters beyond those that are normally active in verbatim can cause problems.} Any package that relies on special active characters in math mode (for example, \texpkg{icomma}) will produce errors along the lines of ``\texttt{TeX capacity exceeded}'' and ``\texttt{\string\leavevmode \string\kern \string\z@}''. This may be fixed by modifying \texttt{\string\@noligs}, as described at \url{https://tex.stackexchange.com/questions/223876}.
% \item[firstline (integer) (1)]
% The first line to be shown.
% All lines before that line are ignored and do not appear in the output.
% \item[firstnumber (auto \| last \| integer) (auto = 1)]
% Line number of the first line.
+%
+%
+% \item [fontencoding (font encoding) (\meta{doc~encoding})]
+% Set font encoding used for typesetting code. For example, |fontencoding=T1|.
+%
+%
% \item[fontfamily (family name) (tt)]
% The font family to use.
% |tt|, |courier| and |helvetica| are pre-defined.
-% \item[fontseries (series name) (auto \textrm{-- the same as the current font})]
+%
+%
+% \item[fontseries (series name) (auto\textrm{ -- the same as the current font})]
% The font series to use.
-% \item[fontsize (font size) (auto \textrm{-- the same as the current font})]
-% The size of the font to use, as a size command, e.g. |\footnotesize|.
-% \item[fontshape (font shape) (auto \textrm{-- the same as the current font})]
+%
+%
+% \item[fontshape (font shape) (auto\textrm{ -- the same as the current font})]
% The font shape to use.
+%
+%
+% \item[fontsize (font size) (auto\textrm{ -- the same as the current font})]
+% The size of the font to use, as a size command, e.g. |\footnotesize|.
+%
+%
% \item[formatcom (command) (\meta{none})]
% A format to execute before printing verbatim text.
% \item[frame (none \| leftline \| topline \| bottomline \| lines \| single) (none)]
-% The type of frame to put around the source code listing.
+% The type of frame to put around the source code listing. For more sophisticated framing, consider \texpkg{tcolorbox}.
% \item[framerule (dimension) (0.4pt)]
% Width of the frame.
% \item[framesep (dimension) (\cmd\fboxsep)]
% Distance between frame and content.
% \item[funcnamehighlighting (boolean) (true)] \appliesto{PHP}
% If |true|, highlights built-in function names.
-% \item[gobble (integer) (0)]
-% Remove the first $n$ characters from each input line.
+% \item[gobble (integer) (0)]
+% Remove the first $n$ characters from each input line.
+%
+% When |autogobble| and |gobble| are used together, the effect is cumulative. First |autogobble| removes all common indentation, and then |gobble| is applied.
+%
+% |autogobble| and |gobble| operate on code before the highlighting process begins (before lexing), treating the code purely as text. Meanwhile, |gobblefilter| operates on the token stream generated by a lexer. If the removed characters are simply indentation coming from how the code was entered within \LaTeX, then |autogobble| and |gobble| should typically be preferred. If the removed characters are syntactically significant, then |gobblefilter| may be better. Which approach is preferable may also depend on the implementation details of the lexer.
+%
+% \item[gobblefilter (integer) (0)]
+% Remove the first $n$ characters from each input line, using the Pygments gobble filter.
+%
+% |autogobble| and |gobble| operate on code before the highlighting process begins (before lexing), treating the code purely as text. Meanwhile, |gobblefilter| operates on the token stream generated by a lexer. If the removed characters are simply indentation coming from how the code was entered within \LaTeX, then |autogobble| and |gobble| should typically be preferred. If the removed characters are syntactically significant, then |gobblefilter| may be better. Which approach is preferable may also depend on the implementation details of the lexer.
+%
%
% \item[highlightcolor (string) (LightCyan)]
% Set the color used for |highlightlines|, using a predefined color name from \texpkg{color} or \texpkg{xcolor}, or a color defined via |\definecolor|.
@@ -1353,15 +1251,31 @@
% The highlighting color can be customized with |highlightcolor|.
%
%
-% \item[keywordcase] (string) (lower)
-% Changes capitalization of keywords. Takes |lower|, |upper|, or |capitalize|.
+% \item[ignorelexererrors (boolean) (false)]
+% When lexer errors are shown in highlighted output (default), they are typically displayed as red boxes that surround the relevant text. When lexer errors are ignored, the literal text that caused lexer errors is shown but there is no indication that it caused errors.
+%
+% \begin{longexample}
+% \begin{minted}{python}
+% variable = !!!
+% \end{minted}
+% \end{longexample}
+%
+% \begin{longexample}
+% \begin{minted}[ignorelexererrors=true]{python}
+% variable = !!!
+% \end{minted}
+% \end{longexample}
+%
+%
+% \item[keywordcase (lower \| upper \| capitalize \| none) (none)]
+% Changes capitalization of keywords.
% \item[label (string) (\emph{empty})]
% Add a label to the top, the bottom or both of the frames around the code.
% See the \texpkg{fancyvrb} documentation for more information and examples.
% \emph{Note:} This does \emph{not} add a |\label| to the current listing.
% To achieve that, use a floating environment (section \ref{sec:float}) instead.
% \item[labelposition (none \| topline \| bottomline \| all) (topline, all, \textrm{or} none)]
-% Position where to print the label (see above; default: |topline| if one label is defined, |all| if two are defined, |none| else).
+% Location for the label. Default: |topline| if one label is defined, |all| if two are defined, |none| otherwise.
% See the \texpkg{fancyvrb} documentation for more information.
% \item[lastline (integer) (\meta{last line of input})]
% The last line to be shown.
@@ -1370,9 +1284,11 @@
% In order to customize the display style of line numbers, you need to redefine the |\theFancyVerbLine| macro:
%
% \begin{example}
-% \renewcommand{\theFancyVerbLine}{\sffamily
-% \textcolor[rgb]{0.5,0.5,1.0}{\scriptsize
-% \oldstylenums{\arabic{FancyVerbLine}}}}
+% \renewcommand{\theFancyVerbLine}{%
+% \sffamily
+% \textcolor[rgb]{0.5,0.5,1.0}{%
+% \scriptsize\oldstylenums{%
+% \arabic{FancyVerbLine}}}}
%
% \begin{minted}[linenos,
% firstnumber=11]{python}
@@ -1384,49 +1300,112 @@
% \end{minted}
% \end{example}
%
-% \item[numberfirstline (boolean) (false)]
-% Always number the first line, regardless of |stepnumber|.
+%
+% \item[listparameters (macro) (\meta{empty})]
+% \texpkg{fancyvrb} option for setting list-related lengths to modify spacing around lines of code. For example, |listparameters=\setlength{\topsep}{0pt}| will remove space before and after a |minted| environment.
+%
+%
+% \item[literalenvname (string) (MintedVerbatim)]
+% This is the name of the environment that literally appears in highlighted code output as a wrapper around the code. It is redefined to be equivalent to |envname|. There should be few if any situations where modifying |literalenvname| rather than |envname| is actually necessary.
+%
+%
+% \item[literatecomment (single macro or backslash-escaped string) (\meta{none})]
+% This is for compatibility with literate programming formats, such as the |.dtx| format commonly used for writing \LaTeX\ packages. If all lines of code begin with \meta{literatecomment}, then \meta{literatecomment} is removed from the beginning of all lines. For example, for |.dtx|, |literatecomment=\%|.
+%
+% The value must be a single macro that gives the desired text when fully expanded, or a string that is interpreted literally except that backslash escapes of ASCII punctuation characters are allowed to give the literal characters (``|\\|'' for backslash, ``|\#|'' for ``|#|'', and so on).
%
%
-% \item[numbers (left \| right \| both \| none) (none)]
-% Essentially the same as |linenos|, except the side on which the numbers appear may be specified.
% \item[mathescape (boolean) (false)]
% Enable \LaTeX{} math mode inside comments.
% Usage as in package \texpkg{listings}.
% See the note under \texttt{escapeinside} regarding math and ligatures.
+%
+%
% \item[numberblanklines (boolean) (true)]
% Enables or disables numbering of blank lines.
+%
+%
+% \item[numberfirstline (boolean) (false)]
+% Always number the first line, regardless of |stepnumber|.
+%
+%
+% \item[numbers (left \| right \| both \| none) (none)]
+% Essentially the same as |linenos|, except the side on which the numbers appear may be specified.
+%
+%
% \item[numbersep (dimension) (12pt)]
% Gap between numbers and start of line.
% \item[obeytabs (boolean) (false)]
-% Treat tabs as tabs instead of converting them to spaces---that is, expand them to tab stops determined by |tabsize|. \textcolor{DarkRed}{\textbf{While this will correctly expand tabs within leading indentation, usually it will not correctly expand tabs that are preceded by anything other than spaces or other tabs. It should be avoided in those case.}}
+% Treat tabs as tabs instead of converting them to spaces---that is, expand them to tab stops determined by |tabsize|. \textbf{While this will correctly expand tabs within leading indentation, usually it will not correctly expand tabs that are preceded by anything other than spaces or other tabs. It should be avoided in those case.}
%
-% \item[outencoding (string) (\meta{system-specific})]
-% Sets the file encoding that \app{Pygments} uses for highlighted output. Overrides any encoding previously set via |encoding|.
-% \item[python3 (boolean) (false)] \appliesto{PythonConsoleLexer}
+% \item[python3 (boolean) (true)] \appliesto{PythonConsoleLexer}
% Specifies whether Python 3 highlighting is applied.
+%
+%
+% \item[rangeregex (single macro or backslash-escaped string) (\meta{none})]
+% Select code that matches this regular expression.
+%
+% The value must be a single macro that gives the desired text when fully expanded, or a string that is interpreted literally except that backslash escapes of ASCII punctuation characters are allowed to give the literal characters (``|\\|'' for backslash, ``|\#|'' for ``|#|'', and so on).
+%
+% If line numbers are displayed, they are based on the range of code that is selected; code that is discarded in selecting the range is not considered in calculating line numbers.
+%
+%
+% \item[rangeregexmatchnumber (integer) (1)]
+% If there are multiple non-overlapping matches for |rangeregex|, this determines which is used.
+%
+%
+% \item[rangeregexdotall (boolean) (false)]
+% ``|.|'' matches any character including the newline.
+%
+%
+% \item[rangeregexmultiline (boolean) (false)]
+% ``|^|'' and ``|$|'' match at internal newlines, not just at the start/end of the string.
+%
+%
+% \item[rangestartafterstring (single macro or backslash-escaped string) (\meta{none})]
+% Select code starting immediately after this string.
+%
+% The value must be a single macro that gives the desired text when fully expanded, or a string that is interpreted literally except that backslash escapes of ASCII punctuation characters are allowed to give the literal characters (``|\\|'' for backslash, ``|\#|'' for ``|#|'', and so on).
+%
+% If line numbers are displayed, they are based on the range of code that is selected; code that is discarded in selecting the range is not considered in calculating line numbers.
+%
+%
+% \item[rangestartstring (single macro or backslash-escaped string) (\meta{none})]
+% Select code starting with this string.
+%
+% The value must be a single macro that gives the desired text when fully expanded, or a string that is interpreted literally except that backslash escapes of ASCII punctuation characters are allowed to give the literal characters (``|\\|'' for backslash, ``|\#|'' for ``|#|'', and so on).
+%
+% If line numbers are displayed, they are based on the range of code that is selected; code that is discarded in selecting the range is not considered in calculating line numbers.
+%
+%
+% \item[rangestopbeforestring (single macro or backslash-escaped string) (\meta{none})]
+% Select code ending immediately before this string.
+%
+% The value must be a single macro that gives the desired text when fully expanded, or a string that is interpreted literally except that backslash escapes of ASCII punctuation characters are allowed to give the literal characters (``|\\|'' for backslash, ``|\#|'' for ``|#|'', and so on).
+%
+% If line numbers are displayed, they are based on the range of code that is selected; code that is discarded in selecting the range is not considered in calculating line numbers.
+%
+%
+% \item [rangestopstring (single macro or backslash-escaped string) (\meta{none})]
+% Select code ending with this string.
+%
+% The value must be a single macro that gives the desired text when fully expanded, or a string that is interpreted literally except that backslash escapes of ASCII punctuation characters are allowed to give the literal characters (``|\\|'' for backslash, ``|\#|'' for ``|#|'', and so on).
+%
+% If line numbers are displayed, they are based on the range of code that is selected; code that is discarded in selecting the range is not considered in calculating line numbers.
+%
+%
% \item[resetmargins (boolean) (false)]
% Resets the left margin inside other environments.
% \item[rulecolor (color command) (black)]
% The color of the frame.
% \item[samepage (boolean) (false)]
% Forces the whole listing to appear on the same page, even if it doesn't fit.
-% \item[ignorelexererrors (boolean) (false)]
-% When lexer errors are shown in highlighted output (default), they are typically displayed as red boxes that surround the relevant text. When lexer errors are ignored, the literal text that caused lexer errors is shown but there is no indication that it caused errors.
%
-% \begin{longexample}
-% \begin{minted}{python}
-% variable = !!!
-% \end{minted}
-% \end{longexample}
%
-% \begin{longexample}
-% \begin{minted}[ignorelexererrors=true]{python}
-% variable = !!!
-% \end{minted}
-% \end{longexample}
% \item[showspaces (boolean) (false)]
% Enables visible spaces: \verb*/visible spaces/.
+%
+%
% \item[showtabs (boolean) (false)]
% Enables visible tabs---only works in combination with |obeytabs|.
%
@@ -1441,8 +1420,8 @@
%
% \item[startinline (boolean) (false)] \appliesto{PHP}
% Specifies that the code starts in PHP mode, i.e., leading |<?php| is omitted.
-% \item[style] (string) (\meta{default})
-% Sets the stylesheet used by \app{Pygments}.
+%
+%
% \item[stepnumber (integer) (1)]
% Interval at which line numbers appear.
%
@@ -1461,6 +1440,10 @@
% Strip leading and trailing newlines from the input.
%
%
+% \item[style] (string) (\meta{default})
+% Sets the stylesheet used by Pygments.
+%
+%
% \item[tab (macro) ({\rmfamily\texpkg{fancyvrb}'s} \string\FancyVerbTab, \FancyVerbTab)]
% Redefine the visible tab character. Note that this is only used if |showtabs=true|. |\rightarrowfill|, \hbox to 2em{\rightarrowfill}, may be a nice alternative.
%
@@ -1477,7 +1460,7 @@
% \item[texcomments (boolean) (false)]
% Enables \LaTeX{} code inside comments. The newer name for |texcl|. See the note under |escapeinside| regarding math and ligatures.
%
-% As of Pygments 2.0.2, \texttt{texcomments} fails with multiline C/C++ preprocessor directives, and may fail in some other circumstances. This is because preprocessor directives are \href{http://pygments.org/docs/tokens/}{tokenized as \texttt{Comment.Preproc}}, so \texttt{texcomments} causes preprocessor directives to be treated as literal \LaTeX\ code. \href{https://bitbucket.org/birkenfeld/pygments-main/issue/1086/wrong-processing-of-in-c-c-macros-if-is}{An issue has been opened} at the Pygments site; additional details are also available on the \href{https://github.com/gpoore/minted/issues/66}{\texpkg{minted} GitHub site}.
+% \texttt{texcomments} fails with multiline C/C++ preprocessor directives, and may fail in some other circumstances. This is because preprocessor directives are \href{https://pygments.org/docs/tokens/}{tokenized as \texttt{Comment.Preproc}}, so \texttt{texcomments} causes preprocessor directives to be treated as literal \LaTeX\ code. \href{https://github.com/pygments/pygments/issues/793}{An issue has been opened} at the Pygments site; additional details are also available on the \href{https://github.com/gpoore/minted/issues/66}{\mintedpkg\ GitHub site}.
% \item[xleftmargin (dimension) (0)]
% Indentation to add before the listing.
% \item[xrightmargin (dimension) (0)]
@@ -1490,116 +1473,102 @@
%
% \section{Defining shortcuts}
%
-% Large documents with a lot of listings will nonetheless use the same source language and the
-% same set of options for most listings.
-% Always specifying all options is redundant, a lot to type and makes performing changes hard.
-%
-% One option is to use \cmd\setminted, but even then you must still specify the language each time.
-%
-% \texpkg{minted} therefore defines a set of commands that lets you define shortcuts for the highlighting commands.
-% Each shortcut is specific for one programming language.
+% Large documents with many listings may use the same lexer and the same set of options for most listings. \mintedpkg\ therefore defines a set of commands that lets you define shortcuts for the highlighting commands and environments. Each shortcut is specific to one lexer.
%
% \DescribeMacro{\newminted}
% |\newminted| defines a new alias for the |minted| environment:
%
+% \begingroup
+% \setminted{autogobble=false}
% \begin{example}
-% \newminted{cpp}{gobble=2,linenos}
-%
-% \begin{cppcode}
-% template <typename T>
-% T id(T value) {
-% return value;
-% }
-% \end{cppcode}
+% \newminted{cpp}{gobble=2,linenos}
+%
+% \begin{cppcode}
+% template <typename T>
+% T id(T value) {
+% return value;
+% }
+% \end{cppcode}
% \end{example}
+% \endgroup
%
% If you want to provide extra options on the fly, or override existing default options, you can do that, too:
%
+% \begingroup
+% \setminted{autogobble=false}
% \begin{example}
-% \newminted{cpp}{gobble=2,linenos}
+% \newminted{cpp}{gobble=2,linenos}
%
-% \begin{cppcode*}{linenos=false,
-% frame=single}
-% int const answer = 42;
-% \end{cppcode*}
+% \begin{cppcode}[linenos=false,
+% frame=single]
+% int const answer = 42;
+% \end{cppcode}
% \end{example}
+% \endgroup
%
-% Notice the star ``|*|'' behind the environment name---due to restrictions in \texpkg{fancyvrb}'s handling
-% of options, it is necessary to provide a \emph{separate} environment that accepts options, and the options
-% are \emph{not} optional on the starred version of the environment.
-%
-% The default name of the environment is \meta{language}|code|.
-% If this name clashes with another environment or if you want to choose an own name for another reason, you may
-% do so by specifying it as the first argument: \cmd\newminted\oarg{environment name}\marg{language}\marg{options}.
+% The default name of the environment is \meta{lexer}|code|.
+% If this name clashes with another environment or if you want to choose a different name, you can use an optional argument: \cmd\newminted\oarg{environment name}\marg{lexer}\marg{options}.
%
-% Like normal \texpkg{minted} environments, environments created with |\newminted| may be used within other environment definitions. Since the \texpkg{minted} environments use \texpkg{fancyvrb} internally, any environment based on them must include the \texpkg{fancyvrb} command |\VerbatimEnvironment|. This allows \texpkg{fancyvrb} to determine the name of the environment that is being defined, and correctly find its end. It is best to include this command at the beginning of the definition. For example,
+% Like normal \mintedpkg\ environments, environments created with |\newminted| may be used within other environment definitions. Since the \mintedpkg\ environments use \texpkg{fancyvrb} internally, any environment based on them must include the \texpkg{fancyvrb} command |\VerbatimEnvironment|. This allows \texpkg{fancyvrb} to determine the name of the environment that is being defined, and correctly find its end. It is best to include this command at the beginning of the definition. For example,
%\begin{Verbatim}
%\newminted{cpp}{gobble=2,linenos}
%\newenvironment{env}{\VerbatimEnvironment\begin{cppcode}}{\end{cppcode}}
%\end{Verbatim}
%
% \DescribeMacro{\newmint}
-% The above macro only defines shortcuts for the |minted| environment.
-% The main reason is that the short command form |\mint| often needs different options---at the very least, it
-% will generally not use the |gobble| option.
-% A shortcut for |\mint| is defined using \cmd\newmint\oarg{macro name}\marg{language}\marg{options}.
+% A shortcut for |\mint| is defined using \cmd\newmint\oarg{macro name}\marg{lexer}\marg{options}.
% The arguments and usage are identical to |\newminted|.
-% If no \meta{macro name} is specified, \meta{language} is used.
+% If no \meta{macro name} is specified, \meta{lexer} is used.
%
% \begin{example}
% \newmint{perl}{showspaces}
-%
% \perl/my $foo = $bar;/
% \end{example}
%
%
% \DescribeMacro{\newmintinline}
-% This creates custom versions of \cmd\mintinline. The syntax is the same as that for \cmd\newmint: \cmd\newmintinline\oarg{macro~name}\marg{language}\marg{options}. If a \meta{macro~name} is not specified, then the created macro is called |\|\meta{language}|inline|.
+% This creates custom versions of \cmd\mintinline. The syntax is the same as that for \cmd\newmint: \cmd\newmintinline\oarg{macro~name}\marg{lexer}\marg{options}. If a \meta{macro~name} is not specified, then the created macro is called \meta{lexer}|inline|.
%
% \begin{example}
% \newmintinline{perl}{showspaces}
-%
-% X\perlinline/my $foo = $bar;/X
+% \perlinline/my $foo = $bar;/
% \end{example}
%
% \DescribeMacro{\newmintedfile}
% This creates custom versions of \cmd\inputminted. The syntax is
% \begin{center}
-% \cmd\newmintedfile\oarg{macro~name}\marg{language}\marg{options}
+% \cmd\newmintedfile\oarg{macro~name}\marg{lexer}\marg{options}
% \end{center}
-% If no \meta{macro name} is given, then the macro is called |\|\meta{language}|file|.
+% If no \meta{macro name} is given, then the macro is called \meta{lexer}|file|.
%
%
%
% \section{FAQ and Troubleshooting}
%
-% In some cases, \texpkg{minted} may not give the desired result due to other document settings that it cannot control, or due to limitations in \LaTeX\ or the PDF format. Common issues are described below, with workarounds or solutions. You may also wish to search \href{http://tex.stackexchange.com/}{tex.stackexchange.com} or ask a question there, if you are working with \texpkg{minted} in a non-typical context.
+% In some cases, \mintedpkg\ may not give the desired result due to other document settings that it cannot control, or due to limitations in \LaTeX\ or the PDF format. Common issues are described below, with workarounds or solutions. You may also wish to search \href{https://tex.stackexchange.com/}{tex.stackexchange.com} or ask a question there, if you are working with \mintedpkg\ in a non-typical context.
%
% \begin{itemize}
-% \item \textbf{I can't copy and paste code out of a PDF created with \texpkg{minted}. The line numbers also get copied, or whitespace is lost, or something else happens that makes the code incorrect.} There is no known method that always guarantees correct copy and paste for code in a PDF. This does not depend on whether \texpkg{minted} is used. You may want to search \href{http://tex.stackexchange.com/}{tex.stackexchange.com} to find current approaches (and their limitations). You may also want to consider using \href{https://ctan.org/pkg/attachfile}{\texpkg{attachfile}} or a similar package to bundle source code files as part of your PDF.
-% \item \textbf{There are intermittent ``I can't write on file'' errors.} This can be caused by using \texpkg{minted} in a directory that is synchronized with Dropbox or a similar file syncing program. These programs can try to sync \texpkg{minted}'s temporary files while it still needs to be able to modify them. The solution is to turn off file syncing or use a directory that is not synced.
-% \item \textbf{I receive a ``Font Warning: Some font shapes were not available'' message, or bold or italic seem to be missing.} This is due to a limitation in the font that is currently in use for typesetting code. In some cases, the default font shapes that \LaTeX\ substitutes are perfectly adequate, and the warning may be ignored. In other cases, the font substitutions may not clearly indicate bold or italic text, and you will want to switch to a different font. See The \LaTeX\ Font Catalogue's section on \href{http://www.tug.dk/FontCatalogue/typewriterfonts.html}{Typewriter Fonts} for alternatives. If you like the default \LaTeX\ fonts, the \texpkg{lmodern} package is a good place to start. The \texpkg{beramono} and \texpkg{courier} packages may also be good options.
-% \item \textbf{I receive a ``Too many open files'' error under OS X when using caching.} See the note on OS X under Section~\ref{sec:basic:preliminary}.
-% \item \textbf{TeXShop can't find \texttt{pygmentize}.} You may need to create a symlink. See \url{https://tex.stackexchange.com/questions/279214}.
-% \item \textbf{Weird things happen when I use the \texpkg{fancybox} package.} \texpkg{fancybox} conflicts with \texpkg{fancyvrb}, which \texpkg{minted} uses internally. When using \texpkg{fancybox}, make sure that it is loaded before \texpkg{minted} (or before \texpkg{fancyvrb}, if \texpkg{fancyvrb} is not loaded by \texpkg{minted}).
-% \item \textbf{When I use \texpkg{minted} with KOMA-Script document classes, I get warnings about \texttt{\string\float@addtolists}.} \texpkg{minted} uses the \texpkg{float} package to produce floated listings, but this conflicts with the way KOMA-Script does floats. Load the package \texpkg{scrhack} to resolve the conflict. Or use \texpkg{minted}'s |newfloat| package option.
+% \item \textbf{I can't copy and paste code out of a PDF created with \mintedpkg. The line numbers also get copied, or whitespace is lost, or something else happens that makes the code incorrect.} There is no known method that always guarantees correct copy and paste for code in a PDF. This does not depend on whether \mintedpkg\ is used. You may want to search \href{https://tex.stackexchange.com/}{tex.stackexchange.com} to find current approaches (and their limitations). You may also want to consider using \href{https://ctan.org/pkg/attachfile}{\texpkg{attachfile}} or a similar package to bundle source code files as part of your PDF.
+% \item \textbf{There are intermittent ``I can't write on file'' errors.} This can be caused by using \mintedpkg\ in a directory that is synchronized with Dropbox or a similar file syncing program. These programs can try to sync \mintedpkg's temporary files while it still needs to be able to modify them. The solution is to turn off file syncing or use a directory that is not synced.
+% \item \textbf{I receive a ``Font Warning: Some font shapes were not available'' message, or bold or italic seem to be missing.} This is due to a limitation in the font that is currently in use for typesetting code. In some cases, the default font shapes that \LaTeX\ substitutes are perfectly adequate, and the warning may be ignored. In other cases, the font substitutions may not clearly indicate bold or italic text, and you will want to switch to a different font. See The \LaTeX\ Font Catalogue's section on \href{https://www.tug.org/FontCatalogue/typewriterfonts.html}{Typewriter Fonts} for alternatives. If you like the default \LaTeX\ fonts, the \texpkg{lmodern} package is a good place to start. The \texpkg{beramono} and \texpkg{courier} packages may also be good options.
+% \item \textbf{I receive a ``Too many open files'' error under macOS when using caching.} See the note on macOS under Section~\ref{sec:configuration:macos}.
+% \item \textbf{Weird things happen when I use the \texpkg{fancybox} package.} \texpkg{fancybox} conflicts with \texpkg{fancyvrb}, which \mintedpkg\ uses internally. When using \texpkg{fancybox}, make sure that it is loaded before \mintedpkg\ (or before \texpkg{fancyvrb}, if \texpkg{fancyvrb} is not loaded by \mintedpkg).
+% \item \textbf{When I use \mintedpkg\ with KOMA-Script document classes, I get warnings about \texttt{\string\float@addtolists}.} \mintedpkg\ uses the \texpkg{float} package to produce floated listings, but this conflicts with the way KOMA-Script does floats. Load the package \texpkg{scrhack} to resolve the conflict. Or use \mintedpkg's |newfloat| package option.
% \item \textbf{Tilde characters \texttt{\string~} are raised, almost like superscripts.}
% This is a font issue. You need a different font encoding, possibly with a different font. Try |\usepackage[T1]{fontenc}|, perhaps with |\usepackage{lmodern}|, or something similar.
%
% \item \textbf{I'm getting errors with math, something like \texttt{TeX capacity exceeded} and \texttt{\string\leavevmode \string\kern \string\z@}.} This is due to ligatures being disabled within verbatim content. See the note under |escapeinside|.
%
-% \item \textbf{With \texttt{mathescape} and the \texpkg{breqn} package (or another special math package), the document never finishes compiling or there are other unexpected results.} Some math packages like \texpkg{breqn} give certain characters like the comma special meanings in math mode. These can conflict with \texpkg{minted}. In the \texpkg{breqn} and comma case, this can be fixed by redefining the comma within |minted| environments:
+% \item \textbf{With \texttt{mathescape} and the \texpkg{breqn} package (or another special math package), the document never finishes compiling or there are other unexpected results.} Some math packages like \texpkg{breqn} give certain characters like the comma special meanings in math mode. These can conflict with \mintedpkg. In the \texpkg{breqn} and comma case, this can be fixed by redefining the comma within |minted| environments:
%\begin{verbatim}
%\AtBeginEnvironment{minted}{\catcode`\,=12\mathcode`\,="613B}
%\end{verbatim}
%Other packages/special characters may need their own modifications.
%
-% \item \textbf{I'm getting errors with Beamer.} Due to how Beamer treats verbatim content, you may need to use either the |fragile| or |fragile=singleslide| options for frames that contain \texpkg{minted} commands and environments. |fragile=singleslide| works best, but it disables overlays. |fragile| works by saving the contents of each frame to a temp file and then reusing them. This approach allows overlays, but will break if you have the string |\end{frame}| at the beginning of a line (for example, in a |minted| environment). To work around that, you can indent the content of the environment (so that the |\end{frame}| is preceded by one or more spaces) and then use the |gobble| or |autogobble| options to remove the indentation.
-%
-% \item \textbf{Tabs are eaten by Beamer.} This is due to \href{https://bitbucket.org/rivanvx/beamer/issue/310/tab-characters-in-listings-lost-when-using}{a bug in Beamer's treatment of verbatim content}. Upgrade Beamer or use the linked patch. Otherwise, try |fragile=singleslide| if you don't need overlays, or consider using \cmd\inputminted\ or converting the tabs into spaces.
+% \item \textbf{I'm getting errors with Beamer.} Due to how Beamer treats verbatim content, you may need to use either the |fragile| or |fragile=singleslide| options for frames that contain \mintedpkg\ commands and environments. |fragile=singleslide| works best, but it disables overlays. |fragile| works by saving the contents of each frame to a temp file and then reusing them. This approach allows overlays, but will break if you have the string |\end{frame}| at the beginning of a line (for example, in a |minted| environment). To work around that, you can indent the content of the environment (so that the |\end{frame}| is preceded by one or more spaces) and then use the |gobble| or |autogobble| options to remove the indentation.
%
-% \item \textbf{I'm trying to create several new \texpkg{minted} commands/environments, and want them all to have the same settings. I'm saving the settings in a macro and then using the macro when defining the commands/environments. But it's failing.}
-% This is due to the way that \texpkg{keyval} works (\texpkg{minted} uses it to manage options). Arguments are not expanded. See \href{http://tex.stackexchange.com/questions/13563/building-keyval-arguments-using-a-macro/13564#13564}{this} and \href{http://tex.stackexchange.com/questions/145363/why-does-includegraphics-varone-vartwo-not-compile/145366#145366}{this} for more information. It is still possible to do what you want; you just need to expand the options macro before passing it to the commands that create the new commands/environments. An example is shown below. The |\expandafter| is the vital part.
+% \item \textbf{I'm trying to create several new \mintedpkg\ commands/environments, and want them all to have the same settings. I'm saving the settings in a macro and then using the macro when defining the commands/environments. But it's failing.}
+% This is due to the way that key-value processing operates. See \href{https://tex.stackexchange.com/questions/13563/building-keyval-arguments-using-a-macro/13564#13564}{this} and \href{https://tex.stackexchange.com/questions/145363/why-does-includegraphics-varone-vartwo-not-compile/145366#145366}{this} for more information. It is still possible to do what you want; you just need to expand the options macro before passing it to the commands that create the new commands/environments. An example is shown below. The |\expandafter| is the vital part.
%\begin{verbatim}
%\def\args{linenos,frame=single,fontsize=\footnotesize,style=bw}
%
@@ -1622,7 +1591,7 @@
%\commandthatdoesnotlikeverbatim{Text \usebox{\mybox}}
%\end{verbatim}
%
-% \item \textbf{Extended characters do not work inside \texpkg{minted} commands and environments, even when the \texpkg{inputenc} package is used.}
+% \item \textbf{Extended characters do not work inside \mintedpkg\ commands and environments, even when the \texpkg{inputenc} package is used.}
% Version 2.0 adds support for extended characters under the pdfTeX engine. But if you need characters that are not supported by \texpkg{inputenc}, you should use the XeTeX or LuaTeX engines instead.
%
% \item \textbf{The \texpkg{polyglossia} package is doing undesirable things to code. (For example, adding extra space around colons in French.)} You may need to put your code within |\begin{english}...\end{english}|. This may done for all |minted| environments using \texpkg{etoolbox} in the preamble:
@@ -1633,29 +1602,23 @@
% \end{verbatim}
%
% \item \begin{sloppypar} \textbf{Tabs are being turned into the character sequence \texttt{\string^\string^I}}.
-% This happens when you use XeLaTeX. You need to use the |-8bit| command-line option so that tabs may be written correctly to temporary files. See \url{http://tex.stackexchange.com/questions/58732/how-to-output-a-tabulation-into-a-file} for more on XeLaTeX's handling of tab characters. \end{sloppypar}
+% This happens when you use XeLaTeX. You need to use the |-8bit| command-line option so that tabs may be written correctly to temporary files. See \url{https://tex.stackexchange.com/questions/58732/how-to-output-a-tabulation-into-a-file} for more on XeLaTeX's handling of tab characters. \end{sloppypar}
%
-% \item \textbf{The \texpkg{caption} package produces an error when \texttt{\string\captionof} and other commands are used in combination with \texpkg{minted}.}
-% Load the \texpkg{caption} package with the option |compatibility=false|. Or better yet, use \texpkg{minted}'s |newfloat| package option, which provides better \texpkg{caption} compatibility.
+% \item \textbf{The \texpkg{caption} package produces an error when \texttt{\string\captionof} and other commands are used in combination with \mintedpkg.}
+% Load the \texpkg{caption} package with the option |compatibility=false|. Or better yet, use \mintedpkg's |newfloat| package option, which provides better \texpkg{caption} compatibility.
%
% \item \textbf{I need a listing environment that supports page breaks.} The built-in listing environment is a standard float; it doesn't support page breaks. You will probably want to define a new environment for long floats. For example,
%\begin{verbatim}
%\usepackage{caption}
%\newenvironment{longlisting}{\captionsetup{type=listing}}{}
%\end{verbatim}
-% With the \texpkg{caption} package, it is best to use \texpkg{minted}'s |newfloat| package option. See \url{http://tex.stackexchange.com/a/53540/10742} for more on |listing| environments with page breaks.
+% With the \texpkg{caption} package, it is best to use \mintedpkg's |newfloat| package option. See \url{https://tex.stackexchange.com/a/53540/10742} for more on |listing| environments with page breaks.
%
-% \item \textbf{I want to use a custom script/executable to access Pygments, rather than |pygmentize|.} Redefine |\MintedPygmentize|:
-%\begin{verbatim}
-%\renewcommand{\MintedPygmentize}{...}
-%\end{verbatim}
+% \item \textbf{I want to use the command-line option \texttt{-output-directory}, or MiKTeX's \texttt{-aux-directory}, but am getting errors.} With TeX Live 2024+, this should work automatically. Otherwise, set the environment variable |TEXMF_OUTPUT_DIRECTORY| to the desired location.
%
-% \item \textbf{I want to use the command-line option \texttt{-output-directory}, or MiKTeX's \texttt{-aux-directory}, but am getting errors.} Use the package option |outputdir| to specify the location of the output directory. Unfortunately, there is no way for \texpkg{minted} to detect the output directory automatically.
-%
-% \item \textbf{I want extended characters in frame labels, but am getting errors.} This can happen with \texpkg{minted} <2.0 and Python 2.7, due to a \href{https://bitbucket.org/birkenfeld/pygments-main/issue/801/python-2-fails-to-detect-terminal-encoding}{terminal encoding issue with Pygments}. It should work with any version of Python with \texpkg{minted} 2.0+, which processes labels internally and does not send them to Python.
% \item \textbf{\texttt{minted} environments have extra vertical space inside \texttt{tabular}.} It is possible to \href{https://github.com/gpoore/minted/issues/82}{create a custom environment} that eliminates the extra space. However, a general solution that behaves as expected in the presence of adjacent text remains to be found.
-% \item \textbf{I'm receiving a warning from \texttt{lineno.sty} that ``Command \texttt{\string\@parboxrestore} has changed.''} This can happen when \texpkg{minted} is loaded after \texpkg{csquotes}. Try loading \texpkg{minted} first. If you receive this message when you are not using \texpkg{csquotes}, you may want to experiment with the order of loading packages and might also open an issue.
-% \item \textbf{I'm using \app{texi2pdf}, and getting ``Cannot stat'' errors from \app{tar}}: This is due to the way that \app{texi2pdf} handles temporary files. \texpkg{minted} automatically cleans up its temporary files, but \app{texi2pdf} assumes that any temporary file that is ever created will still exist at the end of the run, so it tries to access the files that \texpkg{minted} has deleted. It's possible to disable minted's temp file cleanup by adding |\renewcommand{\DeleteFile}[2][]{}| after the |\usepackage{minted}|.
+% \item \textbf{I'm receiving a warning from \texttt{lineno.sty} that ``Command \texttt{\string\@parboxrestore} has changed.''} This can happen when \mintedpkg\ is loaded after \texpkg{csquotes}. Try loading \mintedpkg\ first. If you receive this message when you are not using \texpkg{csquotes}, you may want to experiment with the order of loading packages and might also open an issue.
+% \item \textbf{I'm using \app{texi2pdf}, and getting ``Cannot stat'' errors from \app{tar}}: This is due to the way that \app{texi2pdf} handles temporary files. \mintedpkg\ automatically cleans up its temporary files, but \app{texi2pdf} assumes that any temporary file that is ever created will still exist at the end of the run, so it tries to access the files that \mintedpkg\ has deleted. It's possible to disable minted's temp file cleanup by adding |\renewcommand{\DeleteFile}[2][]{}| after the |\usepackage{minted}|.
% \end{itemize}
%
%
@@ -1665,7 +1628,9 @@
%
% \textbf{Konrad Rudolph:} Special thanks to Philipp Stephani and the rest of the guys from \texttt{comp.text.tex} and \texttt{tex.stackexchange.com}.
%
-% \textbf{Geoffrey Poore:}
+% ~\par
+%
+% \noindent\textbf{Geoffrey Poore:}
% \begin{itemize}
% \item Thanks to Marco Daniel for the code on \url{tex.stackexchange.com} that inspired automatic line breaking.
% \item Thanks to Patrick Vogt for improving TikZ externalization compatibility.
@@ -1673,9 +1638,7 @@
% \item Thanks to \textsf{@jfbu} for suggestions and discussion regarding support for arbitrary Pygments style names (\#210, \#294, \#299, \#317), and for debugging assistance.
% \end{itemize}
%
-% \PrintChangelog
-%
-% \StopEventually{} %\StopEventually{\PrintIndex}
+% \StopEventually{} ^^A\StopEventually{\PrintIndex}
%
%
% \section{Implementation}
@@ -1685,1684 +1648,2140 @@
% \fi
%
%
+%
% \subsection{Required packages}
-% Load required packages. For compatibility reasons, most old functionality should be supported with the original set of packages. More recently added packages, such as |etoolbox| and |xstring|, should only be used for new features when possible. |shellesc| must be loaded before any packages that invoke |\write18|, since it is possible that they haven't yet been patched to work with LuaTeX 0.87+.
-% \begin{macrocode}
-\RequirePackage{keyval}
-\RequirePackage{kvoptions}
-\RequirePackage{fvextra}[2022/11/30]
-\RequirePackage{ifthen}
-\IfFileExists{shellesc.sty}
- {\RequirePackage{shellesc}
- \@ifpackagelater{shellesc}{2016/04/29}
- {}
- {\protected\def\ShellEscape{\immediate\write18 }}}
- {\protected\def\ShellEscape{\immediate\write18 }}
-\RequirePackage{ifplatform}
-\RequirePackage{pdftexcmds}
-\RequirePackage{etoolbox}
-\RequirePackage{xstring}
-\RequirePackage{lineno}
-\RequirePackage{framed}
+%
+%
+% \begin{macrocode}
\RequirePackage{catchfile}
+\RequirePackage{etoolbox}
+\RequirePackage{fvextra}[2024/09/05]
+\RequirePackage{latex2pydata}[2024/05/16]
+\RequirePackage{pdftexcmds}
+\RequirePackage{pgfkeys}
+\RequirePackage{pgfopts}
+\RequirePackage{shellesc}
% \end{macrocode}
%
% Make sure that either |color| or |xcolor| is loaded by the beginning of the document.
% \begin{macrocode}
\AtEndPreamble{%
- \@ifpackageloaded{color}{}{%
- \@ifpackageloaded{xcolor}{}{\RequirePackage{xcolor}}}%
-}
+ \IfPackageLoadedTF{color}%
+ {}%
+ {\IfPackageLoadedTF{xcolor}{}{\RequirePackage{xcolor}}}}
% \end{macrocode}
%
%
%
-% \subsection{Package options}
+% \subsection{Exception handling}
%
-% \begin{macro}{\minted@float@within}
%
-% Define an option that controls the section numbering of the |listing| float.
+% \begin{macro}{\minted@error}
+% \begin{macrocode}
+\def\minted@error#1{\PackageError{minted}{#1}{}}
+% \end{macrocode}
+% \end{macro}
%
+% \begin{macro}{\minted@fatalerror}
+% |\batchmode\read -1 to \minted@fatalerror@exitnow| forces an immediate exit with ``\Verb[breaklines]{! Emergency stop [...] cannot \read from terminal in nonstop modes}.''
% \begin{macrocode}
-\DeclareVoidOption{chapter}{\def\minted@float@within{chapter}}
-\DeclareVoidOption{section}{\def\minted@float@within{section}}
+\def\minted@fatalerror#1{%
+ \minted@error{#1}%
+ \batchmode\read -1 to \minted@fatalerror@exitnow}
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\minted@warning}
+% \begin{macrocode}
+\def\minted@warning#1{\PackageWarning{minted}{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \subsection{Python executable and minimum supported version}
%
-% \begin{macro}{newfloat}
%
-% Define an option to use \texpkg{newfloat} rather than \texpkg{float} to create a floated |listing| environment.
+% \begin{macro}{\MintedExecutable}
+% Name of \mintedpkg\ Python executable.
+% \begin{macrocode}
+\edef\MintedExecutable{\detokenize{latexminted}}
+% \end{macrocode}
+% \end{macro}
+%
%
+% \begin{macro}{\minted@executable@minversion}
% \begin{macrocode}
-\DeclareBoolOption{newfloat}
+\edef\minted@executable@minversion{\detokenize{0.1.0}}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{cache}
-% Define an option that determines whether highlighted content is cached. We use a boolean to keep track of its state.
+% \begin{macro}{\minted@executable@minmajor,\minted@executable@minminor,\minted@executable@minpatch}
% \begin{macrocode}
-\DeclareBoolOption[true]{cache}
+\def\minted@executable@setminversioncomponents{%
+ \expandafter\minted@executable@setminversioncomponents@i
+ \minted@executable@minversion\relax}
+\begingroup
+\catcode`\.=12
+\gdef\minted@executable@setminversioncomponents@i#1.#2.#3\relax{%
+ \def\minted@executable@minmajor{#1}%
+ \def\minted@executable@minminor{#2}%
+ \def\minted@executable@minpatch{#3}}
+\endgroup
+\minted@executable@setminversioncomponents
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\minted@jobname}
-% At various points, temporary files and directories will need to be named after the main |.tex| file. The typical way to do this is to use |\jobname|. However, if the file name contains spaces, then |\jobname| will contain the name wrapped in quotes (older versions of MiKTeX replace spaces with asterisks instead, and \texttt{XeTeX} apparently \href{http://tex.stackexchange.com/a/93829/10742}{allows double quotes within file names}, in which case names are wrapped in single quotes). While that is perfectly fine for working with \LaTeX\ internally, it causes problems with |\write18|, since quotes will end up in unwanted locations in shell commands. It would be possible to strip the wrapping quotation marks when they are present, and maintain any spaces in the file name. But it is simplest to create a ``sanitized'' version of |\jobname| in which spaces and asterisks are replaced by underscores, and double quotes are stripped. Single quotes are also replaced, since they can cause quoted string errors, or become double quotes in the process of being passed to the system through |\write18|.
+% \begin{macro}{\minted@executable@version}
% \begin{macrocode}
-\StrSubstitute{\jobname}{ }{_}[\minted@jobname]
-\StrSubstitute{\minted@jobname}{*}{_}[\minted@jobname]
-\StrSubstitute{\minted@jobname}{"}{}[\minted@jobname]
-\StrSubstitute{\minted@jobname}{'}{_}[\minted@jobname]
+\let\minted@executable@version\relax
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\minted@cachedir}
-% Set the directory in which cached content is saved. The default uses a |minted-| prefix followed by the sanitized |\minted@jobname|.
+% \begin{macro}{minted@executable@exists}
% \begin{macrocode}
-\newcommand{\minted@cachedir}{\detokenize{_}minted-\minted@jobname}
-\let\minted@cachedir@windows\minted@cachedir
-\define@key{minted}{cachedir}{%
- \@namedef{minted@cachedir}{#1}%
- \StrSubstitute{\minted@cachedir}{/}{\@backslashchar}[\minted@cachedir@windows]}
+\newbool{minted@executable@exists}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{finalizecache}
-% Define an option that switches the naming of cache files from an MD5-based system to a |listing<number>| scheme. Compiling with this option is a prerequisite to turning on |frozencache|.
+% \begin{macro}{minted@executable@issupported}
% \begin{macrocode}
-\DeclareBoolOption{finalizecache}
+\newbool{minted@executable@issupported}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{frozencache}
-% Define an option that uses a fixed set of cache files, using |listing<number>| file naming with |\write18| disabled. This is convenient for working with a document in an environment in which |\write18| support is disabled and \texpkg{minted} content does not need to be modified.
+%
+% \subsection{Timestamp}
+%
+%
+% Timestamp for current compile. This could eventually be simplified to use |\c_sys_timestamp_str| for all engines; that macro is in \texpkg{l3kernel} from 2023-08-29.
+%
+% \begin{macro}{\minted@timestamp}
% \begin{macrocode}
-\DeclareBoolOption{frozencache}
+\begingroup
+\catcode`\-=12
+\catcode`\+=12
+\catcode`\:=12
+\def\minted@creationdatetotimestamp#1{%
+ \expandafter\minted@creationdatetotimestamp@i#1-\relax}
+\def\minted@creationdatetotimestamp@i#1:#2-#3\relax{%
+ \minted@creationdatetotimestamp@ii#2+\relax}
+\def\minted@creationdatetotimestamp@ii#1+#2\relax{%
+ #1}
+\expandafter\ifx\csname pdftexversion\endcsname\relax
+\else
+ \xdef\minted@timestamp{\minted@creationdatetotimestamp{\pdfcreationdate}}
+\fi
+\expandafter\ifx\csname XeTeXrevision\endcsname\relax
+\else
+ \xdef\minted@timestamp{\minted@creationdatetotimestamp{\creationdate}}
+\fi
+\expandafter\ifx\csname directlua\endcsname\relax
+\else
+ \xdef\minted@timestamp{\minted@creationdatetotimestamp{\pdffeedback creationdate}}
+\fi
+\endgroup
+\ifcsname minted@timestamp\endcsname
+\else
+ \begingroup
+ \newcounter{minted@timestamp@hr}
+ \newcounter{minted@timestamp@min}
+ \setcounter{minted@timestamp@min}{\number\time}
+ \loop\unless\ifnum\value{minted@timestamp@min}<60\relax
+ \addtocounter{minted@timestamp@hr}{1}
+ \addtocounter{minted@timestamp@min}{-60}
+ \repeat
+ \xdef\minted@timestamp{%
+ \the\year
+ \ifnum\month<10 0\fi\the\month
+ \ifnum\day<10 0\fi\the\day
+ \ifnum\value{minted@timestamp@hr}<10 0\fi\theminted@timestamp@hr
+ \ifnum\value{minted@timestamp@min}<10 0\fi\theminted@timestamp@min}
+ \endgroup
+\fi
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\minted@outputdir}
-% The |-output-directory| command-line option for \LaTeX\ causes problems for \texpkg{minted}, because the \texpkg{minted} temporary files are saved in the output directory, but \texpkg{minted} still looks for them in the document root directory. There is no way to access the value of the command-line option. But it is possible to allow the output directory to be specified manually as a package option. A trailing slash is automatically appended to the |outputdir|, so that it may be directly joined to |cachedir|. This may be redundant if the user-supplied value already ends with a slash, but doubled slashes are ignored under *nix and Windows, so it isn't a problem.
+%
+% \subsection{Jobname MD5 and derived file names}
+%
+%
+% \begin{macro}{\MintedJobnameMdfive}
+% MD5 hash of |\jobname|. If |\jobname| contains spaces so that \LaTeX\ inserts wrapping quotes (\href{https://tex.stackexchange.com/a/93829/10742}{single} or double) within |\jobname|, these quotes are stripped, so that only the stem (basename without file extension) of the file path is hashed. This makes it simple to calculate the hash externally outside of \LaTeX.
+%
+% |\MintedJobnameMdfive| is used for creating temp files rather than |\jobname| to avoid shell escaping issues. Under restricted shell escape, shell commands are quoted and escaped by \LaTeX\ itself, so using |\jobname| would work correctly in most cases. However, when full shell escape is enabled, no command escaping is performed by \LaTeX, so \mintedpkg\ would have to quote/escape |\jobname| in a platform-specific manner. (See for example \href{https://github.com/TeX-Live/texlive-source/blob/e47512fcb293e2390b609bce612449d579efc230/texk/web2c/doc/web2c.info#L1573}{\Verb{web2c.info}} and \href{https://github.com/TeX-Live/texlive-source/blob/e47512fcb293e2390b609bce612449d579efc230/texk/web2c/lib/texmfmp.c#L228}{\Verb{texmfmp.c}} in the TeX Live source for shell escape implementation details.) It is simpler to avoid escaping issues altogether, including edge cases in the restricted shell escape scenario, by using an MD5 hash that is guaranteed to consist only of ASCII alphanumeric characters.
% \begin{macrocode}
-\let\minted@outputdir\@empty
-\let\minted@outputdir@windows\@empty
-\define@key{minted}{outputdir}{%
- \@namedef{minted@outputdir}{#1/}%
- \StrSubstitute{\minted@outputdir}{/}%
- {\@backslashchar}[\minted@outputdir@windows]}
+\begingroup
+\catcode`\"=12
+\catcode`\'=12
+\gdef\minted@setjobnamemdfive#1#2\FV@Sentinel{%
+ \ifx#1"\relax
+ \let\minted@next\minted@setjobnamemdfive@dquoted
+ \else\ifx#1'\relax
+ \let\minted@next\minted@setjobnamemdfive@squoted
+ \else
+ \let\minted@next\minted@setjobnamemdfive@uquoted
+ \fi\fi
+ \minted@next#1#2\FV@Sentinel}
+\gdef\minted@setjobnamemdfive@dquoted#1#2\FV@Sentinel{%
+ \minted@setjobnamemdfive@dquoted@i#2"\FV@Sentinel}
+\gdef\minted@setjobnamemdfive@dquoted@i#1"#2\FV@Sentinel{%
+ \if\relax\detokenize{#2}\relax
+ \edef\MintedJobnameMdfive{\pdf@mdfivesum{\jobname}}%
+ \else\if\relax\detokenize\expandafter{\@gobble#2}\relax
+ \edef\MintedJobnameMdfive{\pdf@mdfivesum{#1}}%
+ \else
+ \edef\MintedJobnameMdfive{\pdf@mdfivesum{\jobname}}%
+ \fi\fi}
+\gdef\minted@setjobnamemdfive@squoted#1#2\FV@Sentinel{%
+ \minted@setjobnamemdfive@squoted@i#2'\FV@Sentinel}
+\gdef\minted@setjobnamemdfive@squoted@i#1'#2\FV@Sentinel{%
+ \if\relax\detokenize{#2}\relax
+ \edef\MintedJobnameMdfive{\pdf@mdfivesum{\jobname}}%
+ \else\if\relax\detokenize\expandafter{\@gobble#2}\relax
+ \edef\MintedJobnameMdfive{\pdf@mdfivesum{#1}}%
+ \else
+ \edef\MintedJobnameMdfive{\pdf@mdfivesum{\jobname}}%
+ \fi\fi}
+\gdef\minted@setjobnamemdfive@uquoted#1\FV@Sentinel{%
+ \edef\MintedJobnameMdfive{\pdf@mdfivesum{#1}}}
+\endgroup
+\expandafter\minted@setjobnamemdfive\jobname\FV@Sentinel
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{inputlanglinenos}
-% Enable |langlinenos| and make it apply to |\inputminted|.
+%
+% \begin{macro}{\MintedCacheIndexFilename}
+% Index file in cache. Used to detect whether cache exists.
% \begin{macrocode}
-\DeclareBoolOption{inputlanglinenos}
+\edef\MintedCacheIndexFilename{%
+ \detokenize{_}\MintedJobnameMdfive\detokenize{.index.minted}}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{kpsewhich}
-% Define an option that invokes |kpsewhich| to locate the files that are to be |pygmentize|d. This isn't done by default to avoid the extra overhead, but can be useful with some build tools such as |texi2pdf| that rely on modifying |TEXINPUTS|.
+% \begin{macro}{\MintedConfigFilename}
+% File containing config info such as Python executable version. Written by the Python side, read by the \LaTeX\ side, and then immediately deleted.
% \begin{macrocode}
-\DeclareBoolOption{kpsewhich}
+\edef\MintedConfigFilename{%
+ \detokenize{_}\MintedJobnameMdfive\detokenize{.config.minted}}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{langlinenos}
-% Define an option that makes all |minted| environments and |\mint| commands for a given language share cumulative line numbering (if |firstnumber=last|).
+% \begin{macro}{\MintedDataFilename}
+% Temp file for data. Written by the \LaTeX\ side, read by the Python side. Frequently overwritten, so only cleaned up at the end of the compile.
% \begin{macrocode}
-\DeclareBoolOption{langlinenos}
+\edef\MintedDataFilename{%
+ \detokenize{_}\MintedJobnameMdfive\detokenize{.data.minted}}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{draft}
-% Define an option that allows \texpkg{fancyvrb} to do all typesetting directly, without using \app{Pygments}. This trades syntax highlighting for speed. Note that in many cases, the difference in performance between caching and draft mode will be minimal. Also note that draft settings may be inherited from the document class.
+% \begin{macro}{\MintedErrlogFilename}
+% Log file created when the Python side encounters an unexpected error that it is not designed to report to the \LaTeX\ side.
% \begin{macrocode}
-\DeclareBoolOption{draft}
+\edef\MintedErrlogFilename{%
+ \detokenize{_}\MintedJobnameMdfive\detokenize{.errlog.minted}}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{final}
-% Define a |final| option that is the opposite of |draft|, since many packages do this.
+%
+% \begin{macro}{\MintedMessageFilename}
+% Messages from the Python side to the LaTeX side. Deleted immediately after reading.
% \begin{macrocode}
-\DeclareComplementaryOption{final}{draft}
+\edef\MintedMessageFilename{%
+ \detokenize{_}\MintedJobnameMdfive\detokenize{.message.minted}}
% \end{macrocode}
% \end{macro}
%
%
-% Process package options. Proceed with everything that immediately relies upon them. If PGF/Ti\textit{k}Z externalization is in use, switch on |draft| mode and turn off |cache|. Externalization involves compiling the \emph{entire} document; all parts not related to the current image are ``silently thrown away.'' \texpkg{minted} needs to cooperate with that by not writing any temp files or creating any directories. Two checks are done for externalization. The first, using |\tikzifexternalizing|, works if externalization is set before \texpkg{minted} is loaded. The second, using |\tikzexternalrealjob|, works if externalization is set after \texpkg{minted} is loaded.
%
+% \subsection{Package options}
+%
+%
+% \begin{macro}{\minted@pgfopts}
% \begin{macrocode}
-\ProcessKeyvalOptions*
-\ifthenelse{\boolean{minted@newfloat}}{\RequirePackage{newfloat}}{\RequirePackage{float}}
-\ifcsname tikzifexternalizing\endcsname
- \tikzifexternalizing{\minted@drafttrue\minted@cachefalse}{}
-\else
- \ifcsname tikzexternalrealjob\endcsname
- \minted@drafttrue
- \minted@cachefalse
- \else
- \fi
-\fi
-\ifthenelse{\boolean{minted@finalizecache}}%
- {\ifthenelse{\boolean{minted@frozencache}}%
- {\PackageError{minted}%
- {Options "finalizecache" and "frozencache" are not compatible}%
- {Options "finalizecache" and "frozencache" are not compatible}}%
- {}}%
- {}
-\ifthenelse{\boolean{minted@cache}}%
- {\ifthenelse{\boolean{minted@frozencache}}%
- {}%
- {\AtEndOfPackage{\ProvideDirectory{\minted@outputdir\minted@cachedir}}}}%
- {}
+\def\minted@pgfopts#1{%
+ \pgfkeys{/minted/pkg/.cd,#1}}
% \end{macrocode}
+% \end{macro}
%
%
+% \subsubsection{Package option definitions}
%
-% \subsection{Input, caching, and temp files}
%
-% \begin{macro}{\minted@input}
-% We need a wrapper for |\input|. In most cases, |\input| failure will be due to attempts to use |\inputminted| with files that don't exist, but we also want to give informative error messages when |outputdir| is needed or incompatible build tools are used.
+% \begin{macro}{\minted@float@within}
+% Control the section numbering of the |listing| float.
% \begin{macrocode}
-\newcommand{\minted@input}[1]{%
- \IfFileExists{#1}%
- {\input{#1}}%
- {\PackageError{minted}{Missing Pygments output; \string\inputminted\space
- was^^Jprobably given a file that does not exist--otherwise, you may need
- ^^Jthe outputdir package option, or may be using an incompatible build
- tool,^^Jor may be using frozencache with a missing file}%
- {This could be caused by using -output-directory or -aux-directory
- ^^Jwithout setting minted's outputdir, or by using a build tool that
- ^^Jchanges paths in ways minted cannot detect,
- ^^Jor using frozencache with a missing file.}}%
+\minted@pgfopts{
+ chapter/.code=\def\minted@float@within{chapter},
+ chapter/.value forbidden,
+ section/.code=\def\minted@float@within{section},
+ section/.value forbidden,
}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\minted@infile}
-% Define a default name for files of highlighted content that are brought it. Caching will redefine this. We start out with the default, non-caching value.
+% \begin{macro}{minted@newfloat}
+% Use \texpkg{newfloat} rather than \texpkg{float} to create a floating |listing| environment.
% \begin{macrocode}
-\newcommand{\minted@infile}{\minted@jobname.out.pyg}
+\newbool{minted@newfloat}
+\minted@pgfopts{
+ newfloat/.is if=minted@newfloat,
+}
% \end{macrocode}
% \end{macro}
%
%
-% We need a way to track the cache files that are created, and delete those that are not in use. This is accomplished by creating a comma-delimited list of cache files and saving this list to the |.aux| file so that it may be accessed on subsequent runs. During subsequent runs, this list is compared against the cache files that are actually used, and unused files are deleted. Cache file names are created with MD5 hashes of highlighting settings and file contents, with a |.pygtex| extension, so they never contain commas. Thus comma-delimiting the list of file names doesn't introduce a potential for errors.
-%
-% \begin{macro}{\minted@cachelist}
-% This is a list of the current cache files.
+% \begin{macro}{minted@debug}
+% Keep temp files for aid in debugging.
% \begin{macrocode}
-\newcommand{\minted@cachelist}{}
+\newbool{minted@debug}
+\minted@pgfopts{
+ debug/.is if=minted@debug,
+}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\minted@addcachefile}
-% This adds a file to the list of cache files. It also creates a macro involving the hash, so that the current usage of the hash can be easily checked by seeing if the macro exists. The list of cache files must be created with built-in linebreaks, so that when it is written to the |.aux| file, it won't all be on one line and thereby risk buffer errors.
+%
+% \begin{macro}{minted@cache}
+% Determine whether highlighted content is cached.
% \begin{macrocode}
-\newcommand{\minted@addcachefile}[1]{%
- \expandafter\long\expandafter\gdef\expandafter\minted@cachelist\expandafter{%
- \minted@cachelist,^^J%
- \space\space#1}%
- \expandafter\gdef\csname minted@cached@#1\endcsname{}%
+\newbool{minted@cache}
+\booltrue{minted@cache}
+\minted@pgfopts{
+ cache/.is if=minted@cache,
}
% \end{macrocode}
% \end{macro}
%
-%
-% \begin{macro}{\minted@savecachelist}
-%
-% We need to be able to save the list of cache files to the |.aux| file, so that we can reload it on the next run.
+% \begin{macro}{\minted@cachedir}
+% Set the directory in which cached content is saved.
% \begin{macrocode}
-\newcommand{\minted@savecachelist}{%
- \ifdefempty{\minted@cachelist}{}{%
- \immediate\write\@mainaux{%
- \string\gdef\string\minted@oldcachelist\string{%
- \minted@cachelist\string}}%
- }%
+\edef\minted@cachedir{\detokenize{_minted}}
+\minted@pgfopts{
+ cachedir/.estore in=\minted@cachedir,
}
% \end{macrocode}
% \end{macro}
%
-%
-% \begin{macro}{\minted@cleancache}
-% Clean up old cache files that are no longer in use.
+% \begin{macro}{minted@frozencache}
+% When a cache file is missing, raise an error instead of attempting to update the cache. This is intended for editing a document with a pre-existing cache in an environment in which |\ShellEscape| support is disabled or the \mintedpkg\ executable is not available.
% \begin{macrocode}
-\newcommand{\minted@cleancache}{%
- \ifcsname minted@oldcachelist\endcsname
- \def\do##1{%
- \ifthenelse{\equal{##1}{}}{}{%
- \ifcsname minted@cached@##1\endcsname\else
- \DeleteFile[\minted@outputdir\minted@cachedir]{##1}%
- \fi
- }%
- }%
- \expandafter\docsvlist\expandafter{\minted@oldcachelist}%
- \else
- \fi
+\newbool{minted@frozencache}
+\minted@pgfopts{
+ frozencache/.is if=minted@frozencache,
}
% \end{macrocode}
% \end{macro}
%
%
-% At the end of the document, save the list of cache files and clean the cache. If in draft mode, don't clean up the cache and save the old cache file list for next time. This allows draft mode to be switched on and off without requiring that all highlighted content be regenerated. The saving and cleaning operations may be called without conditionals, since their definitions already contain all necessary checks for their correct operation.
+% \begin{macro}{minted@lexerlinenos}
+% Make all |minted| environments and |\mint| commands for a given lexer share cumulative line numbering (if |firstnumber=last|). |langlinenos| is for backward compatility with \mintedpkg\ v2.
% \begin{macrocode}
-\ifthenelse{\boolean{minted@draft}}%
- {\AtEndDocument{%
- \ifcsname minted@oldcachelist\endcsname
- \StrSubstitute{\minted@oldcachelist}{,}{,^^J }[\minted@cachelist]
- \minted@savecachelist
- \fi}}%
- {\ifthenelse{\boolean{minted@frozencache}}%
- {\AtEndDocument{%
- \ifcsname minted@oldcachelist\endcsname
- \StrSubstitute{\minted@oldcachelist}{,}{,^^J }[\minted@cachelist]
- \minted@savecachelist
- \fi}}%
- {\AtEndDocument{%
- \minted@savecachelist
- \minted@cleancache}}}%
+\newbool{minted@lexerlinenos}
+\minted@pgfopts{
+ lexerlinenos/.is if=minted@lexerlinenos,
+ langlinenos/.is if=minted@lexerlinenos,
+}
% \end{macrocode}
+% \end{macro}
%
+% \begin{macro}{minted@inputlexerlinenos}
+% Enable |lexerlinenos| and make it apply to |\inputminted|. |inputlanglinenos| is for backward compatility with \mintedpkg\ v2.
+% \begin{macrocode}
+\newbool{minted@inputlexerlinenos}
+\minted@pgfopts{
+ inputlexerlinenos/.is if=minted@inputlexerlinenos,
+ inputlanglinenos/.is if=minted@inputlexerlinenos,
+}
+% \end{macrocode}
+% \end{macro}
%
%
-% \subsection{OS interaction}
-%
-% We need system-dependent macros for communicating with the ``outside world.''
-%
-% \begin{macro}{\DeleteFile}
-%
-% Delete a file. Define conditionally in case an equivalent macro has already been defined.
+% \begin{macro}{minted@placeholder,\minted@insertplaceholder}
+% Cause all commands and environments to insert a placeholder rather than typesetting code. This functionality is primarily intended for use with PGF/Ti\textit{k}Z externalization, when all non-PGF/Ti\textit{k}Z features should be disabled.
+% \begin{macrocode}
+\newbool{minted@placeholder}
+\minted@pgfopts{
+ placeholder/.is if=minted@placeholder,
+}
+\gdef\minted@insertplaceholder{%
+ \ifbool{minted@isinline}%
+ {\begingroup
+ \fvset{extra=true}\Verb[formatcom=\color{red}\bfseries]{<MINTED>}%
+ \endgroup}%
+ {\begingroup
+ \par\noindent
+ \fvset{extra=true}\Verb[formatcom=\color{red}\bfseries]{<MINTED>}%
+ \par
+ \endgroup}}%
+% \end{macrocode}
+% \end{macro}
%
+% \begin{macro}{minted@verbatim}
+% Typeset all code verbatim using \texpkg{fancyvrb}; do not use Python at all.
% \begin{macrocode}
-\ifwindows
- \providecommand{\DeleteFile}[2][]{%
- \ifthenelse{\equal{#1}{}}%
- {\IfFileExists{#2}{\ShellEscape{del #2}}{}}%
- {\IfFileExists{#1/#2}{%
- \StrSubstitute{#1}{/}{\@backslashchar}[\minted@windir]
- \ShellEscape{del \minted@windir\@backslashchar #2}}{}}}
-\else
- \providecommand{\DeleteFile}[2][]{%
- \ifthenelse{\equal{#1}{}}%
- {\IfFileExists{#2}{\ShellEscape{rm #2}}{}}%
- {\IfFileExists{#1/#2}{\ShellEscape{rm #1/#2}}{}}}
-\fi
+\newbool{minted@verbatim}
+\minted@pgfopts{
+ verbatim/.is if=minted@verbatim,
+}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\ProvideDirectory}
+% \begin{macro}{\minted@highlightmode@init,\minted@fasthighlightmode@checkstart,\minted@fasthighlightmode@checkend}
+% Determine whether highlighting is performed immediately or at the end of the compile. Immediately means more overhead during the compile, but no second compile is required. Highlighting at the end of the compile means a second compile is required, but also makes highlighing much faster since there is only a single |\ShellEscape|.
%
-% We need to be able to create a directory, if it doesn't already exist. This is primarily for storing cached highlighted content.
+% |\minted@highlightmode@init| is invoked within |\minted@detectconfig| if the Python executable is available and enabled. For the |fastfirst| case, |\minted@highlightmode@init| requires the |\minted@cachepath| that is set within |\minted@detectconfig|.
%
+% |\minted@fasthighlightmode@checkend| is invoked |\AfterEndDocument| with |\minted@clean|; the |\AtEndDocument| is created with the definition of |\minted@clean| so that everything is in the correct order.
% \begin{macrocode}
-\ifwindows
- \newcommand{\ProvideDirectory}[1]{%
- \StrSubstitute{#1}{/}{\@backslashchar}[\minted@windir]
- \ShellEscape{if not exist \minted@windir\space mkdir \minted@windir}}
-\else
- \newcommand{\ProvideDirectory}[1]{%
- \ShellEscape{mkdir -p #1}}
-\fi
+\newbool{minted@fasthighlightmode}
+\newbool{minted@fasthighlightmode@open}
+\minted@pgfopts{
+ highlightmode/.is choice,
+ highlightmode/fast/.code=
+ \let\minted@highlightmode@init\minted@highlightmode@init@fast,
+ highlightmode/fastfirst/.code=
+ \let\minted@highlightmode@init\minted@highlightmode@init@fastfirst,
+ highlightmode/immediate/.code=
+ \let\minted@highlightmode@init\minted@highlightmode@init@immediate,
+}
+\def\minted@highlightmode@init@fast{%
+ \global\booltrue{minted@fasthighlightmode}}
+\def\minted@highlightmode@init@fastfirst{%
+ \IfFileExists{\minted@cachepath\MintedCacheIndexFilename}%
+ {\global\boolfalse{minted@fasthighlightmode}}
+ {\global\booltrue{minted@fasthighlightmode}}}
+\def\minted@highlightmode@init@immediate{%
+ \global\boolfalse{minted@fasthighlightmode}}
+\let\minted@highlightmode@init\minted@highlightmode@init@fastfirst
+\def\minted@fasthighlightmode@checkstart{%
+ \ifbool{minted@fasthighlightmode}%
+ {\pydatawritelistopen
+ \global\booltrue{minted@fasthighlightmode@open}}%
+ {}%
+ \global\let\minted@fasthighlightmode@checkstart\relax}
+\def\minted@fasthighlightmode@checkend{%
+ \ifbool{minted@fasthighlightmode@open}%
+ {\pydatasetfilename{\MintedDataFilename}%
+ \pydatawritelistclose
+ \pydataclosefilename{\MintedDataFilename}%
+ \global\boolfalse{minted@fasthighlightmode@open}%
+ \global\boolfalse{minted@fasthighlightmode}%
+ \begingroup
+ \minted@exec@batch
+ \ifx\minted@exec@warning\relax
+ \else
+ \expandafter\minted@exec@warning
+ \fi
+ \ifx\minted@exec@error\relax
+ \else
+ \expandafter\minted@exec@error
+ \fi
+ \endgroup
+ \global\boolfalse{minted@canexec}}%
+ {}%
+ \global\let\minted@fasthighlightmode@checkend\relax}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\TestAppExists}
%
-% Determine whether a given application exists.
+% \subsubsection{Package options that are no longer supported or deprecated}
%
-% Usage is a bit roundabout, but has been retained for backward compatibility. At some point, it may be worth replacing this with something using \verb`\@@input"|<command>"`. That would require MiKTeX users to |--enable-pipes|, however, which would make things a little more complicated. If Windows XP compatibility is ever no longer required, the |where| command could be used instead of the approach for Windows.
%
-% To test whether an application exists, use the following code:
+% \paragraph{finalizecache}
+% Old, no longer needed option from \mintedpkg\ v2.
+% \begin{macrocode}
+\minted@pgfopts{
+ finalizecache/.code=\minted@error{%
+ Package option "finalizecache" is no longer needed with minted v3+},
+}
+% \end{macrocode}
%
-% \begin{Verbatim}
-%\TestAppExists{appname}
-%\ifthenelse{\boolean{AppExists}}{app exists}{app doesn't exist}
-% \end{Verbatim}
%
+% \paragraph{kpsewhich}
+% Old, no longer needed option from \mintedpkg\ v2.
% \begin{macrocode}
-\newboolean{AppExists}
-\newread\minted@appexistsfile
-\newcommand{\TestAppExists}[1]{%
- \ifwindows
+\minted@pgfopts{
+ kpsewhich/.code=\minted@error{%
+ Package option "kpsewhich" is no longer needed with minted v3+},
+}
% \end{macrocode}
%
-% On Windows, we need to use path expansion and write the result to a file.
-% If the application doesn't exist, the file will be empty (except for a newline);
-% otherwise, it will contain the full path of the application.
%
+% \paragraph{outputdir}
+% Old, no longer needed option from \mintedpkg\ v2.
+%
+% The empty |\minted@outputdir| is for backward compatibility with packages that depend on \mintedpkg\ v2 internals.
% \begin{macrocode}
- \DeleteFile{\minted@jobname.aex}%
- \ShellEscape{for \string^\@percentchar i in (#1.exe #1.bat #1.cmd)
- do set > \minted@jobname.aex <nul: /p
- x=\string^\@percentchar \string~$PATH:i>> \minted@jobname.aex}%
- %$ <- balance syntax highlighting
- \immediate\openin\minted@appexistsfile\minted@jobname.aex
- \expandafter\def\expandafter\@tmp@cr\expandafter{\the\endlinechar}%
- \endlinechar=-1\relax
- \readline\minted@appexistsfile to \minted@apppathifexists
- \endlinechar=\@tmp@cr
- \ifthenelse{\equal{\minted@apppathifexists}{}}%
- {\AppExistsfalse}%
- {\AppExiststrue}%
- \immediate\closein\minted@appexistsfile
- \DeleteFile{\minted@jobname.aex}%
- \else
+\minted@pgfopts{
+ outputdir/.code=\minted@error{%
+ Package option "outputdir" is no longer needed with minted v3+;
+ the output directory is automatically detected for TeX Live 2024+,
+ and the environment variable \detokenize{TEXMF_OUTPUT_DIRECTORY}
+ can be set manually in other cases},
+}
+\def\minted@outputdir{}
% \end{macrocode}
%
-% On Unix-like systems, we do a straightforward |which| test and create a file upon success, whose existence we can then check.
%
+% \paragraph{draft}
+% Old, no longer supported option from \mintedpkg\ v2. Improvements in caching combined with the new \mintedpkg\ v3 package options |placeholder| and |verbatim| provide better alternatives.
% \begin{macrocode}
- \ShellEscape{command -v #1 && touch \minted@jobname.aex}%
- \IfFileExists{\minted@jobname.aex}%
- {\AppExiststrue
- \DeleteFile{\minted@jobname.aex}}%
- {\AppExistsfalse}%
- \fi
+\minted@pgfopts{
+ draft/.code=\minted@warning{%
+ Package option "draft" no longer has any effect with minted v3+},
}
% \end{macrocode}
-% \end{macro}
%
+% \paragraph{final}
+% Old, no longer supported option from \mintedpkg\ v2. Improvements in caching combined with the new \mintedpkg\ v3 package options |placeholder| and |verbatim| provide better alternatives.
+% \begin{macrocode}
+\minted@pgfopts{
+ final/.code=\minted@warning{%
+ Package option "final" no longer has any effect with minted v3+},
+}
+% \end{macrocode}
%
-% \subsection{Option processing}
%
-% Option processing is somewhat involved, because we want to be able to define options at various levels of hierarchy: individual command/environment, language, global (document). And once those options are defined, we need to go through the hierarchy in a defined order of precedence to determine which option to apply. As if that wasn't complicated enough, some options need to be sent to Pygments, some need to be sent to \texpkg{fancyvrb}, and some need to be processed within \texpkg{minted} itself.
%
-% To begin with, we need macros for storing lists of options that will later be passed via the command line to Pygments (|optlistcl|). These are defined at the global (|cl@g|), language (|cl@lang|), and command or environment (|cl@cmd|) levels, so that settings can be specified at various levels of hierarchy. The language macro is actually a placeholder. The current language will be tracked using |\minted@lang|. Each individual language will create a |\minted@optlistcl@lang|\meta{language} macro. |\minted@optlistcl@lang| may be |\let| to this macro as convenient; otherwise, the general language macro merely serves as a placeholder.
+% \subsubsection{Package option processing}
%
-% The global- and language-level lists also have an |inline| (|i|) variant. This allows different settings to be applied in inline settings. An inline variant is not needed at the command/environment level, since at that level settings would not be present unless they were supposed to be applied.
%
-% \begin{macro}{\minted@optlistcl@g}
% \begin{macrocode}
-\newcommand{\minted@optlistcl@g}{}
+\ProcessPgfOptions{/minted/pkg}
+\ifbool{minted@cache}{}{\def\minted@cachedir{}}%
+\ifbool{minted@newfloat}{\RequirePackage{newfloat}}{\RequirePackage{float}}
+\ifcsname tikzifexternalizing\endcsname
+ \ifx\tikzifexternalizing\relax
+ \else
+ \tikzifexternalizing{\booltrue{minted@placeholder}}{}
+ \fi
+\fi
% \end{macrocode}
-% \end{macro}
%
-% \begin{macro}{\minted@optlistcl@g@i}
+%
+%
+% \subsection{Util}
+%
+%
+% \begin{macro}{\minted@styleprefix}
+% Prefix for generating Pygments style names.
% \begin{macrocode}
-\newcommand{\minted@optlistcl@g@i}{}
+\def\minted@styleprefix{PYG}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\minted@lang}
+%
+% \begin{macro}{minted@tmpcnt}
+% Temp counter.
% \begin{macrocode}
-\let\minted@lang\@empty
+\newcounter{minted@tmpcnt}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\minted@optlistcl@lang}
+%
+% \begin{macro}{\minted@forcsvlist}
+% Wrapper for \texpkg{etoolbox} |\forcsvlist|. Syntax: |\minted@forcsvlist|\marg{handler}\marg{listmacro}.
% \begin{macrocode}
-\newcommand{\minted@optlistcl@lang}{}
+\def\minted@forcsvlist#1#2{%
+ \if\relax\detokenize\expandafter{\@gobble#2}\relax
+ \expandafter\minted@forcsvlist@exp
+ \else
+ \expandafter\minted@forcsvlist@i
+ \fi
+ {#2}{#1}}
+\def\minted@forcsvlist@exp#1#2{%
+ \expandafter\minted@forcsvlist@i\expandafter{#1}{#2}}
+\def\minted@forcsvlist@i#1#2{%
+ \forcsvlist{#2}{#1}}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\minted@optlistcl@lang@i}
+%
+% \begin{macro}{\minted@apptoprovidecs}
% \begin{macrocode}
-\newcommand{\minted@optlistcl@lang@i}{}
+\def\minted@apptoprovidecs#1#2{%
+ \ifcsname#1\endcsname
+ \else
+ \expandafter\def\csname#1\endcsname{}%
+ \fi
+ \expandafter\let\expandafter\minted@tmp\csname#1\endcsname
+ \expandafter\def\expandafter\minted@tmp\expandafter{\minted@tmp#2}%
+ \expandafter\let\csname#1\endcsname\minted@tmp}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\minted@optlistcl@cmd}
+%
+% \begin{macro}{\minted@const@pgfkeysnovalue}
% \begin{macrocode}
-\newcommand{\minted@optlistcl@cmd}{}
+\def\minted@const@pgfkeysnovalue{\pgfkeysnovalue}
% \end{macrocode}
% \end{macro}
%
-% We also need macros for storing lists of options that will later be passed to \texpkg{fancyvrb} (|optlistfv|). As before, these exist at the global (|fv@g|), language (|fv@lang|), and command or environment (|fv@cmd|) levels. Pygments accepts \texpkg{fancyvrb} options, but in almost all cases, these options may be applied via |\fvset| rather than via running Pygments. This is significantly more efficient when caching is turned on, since it allows formatting changes to be applied without having to re-highlight the code.
%
-% \begin{macro}{\minted@optlistfv@g}
+% \begin{macro}{\minted@ensureatletter}
% \begin{macrocode}
-\newcommand{\minted@optlistfv@g}{}
+\def\minted@ensureatletter#1{%
+ \edef\minted@tmpatcat{\the\catcode`\@}%
+ \catcode`\@=11\relax
+ #1%
+ \catcode`\@=\minted@tmpatcat\relax}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\minted@optlistfv@g@i}
+%
+%
+% \subsubsection{Check whether a string matches the regex \Verb{^[0-9A-Za-z_-]+$}}
+%
+% These macros are used to restrict possible names of highlighting styles on the \LaTeX\ side.
+%
+% \begin{macro}{\minted@is\detokenize{<char_category><codepoint_decimal>}}
+% Create macros used in determining whether a given character is part of a specified set of characters.
% \begin{macrocode}
-\newcommand{\minted@optlistfv@g@i}{}
+% [0-9]
+\setcounter{minted@tmpcnt}{48}
+\loop\unless\ifnum\value{minted@tmpcnt}>57\relax
+ \expandafter\let\csname minted@isnum\arabic{minted@tmpcnt}\endcsname\relax
+ \expandafter\let\csname minted@isalphanum\arabic{minted@tmpcnt}\endcsname\relax
+ \expandafter\let
+ \csname minted@isalphanumhyphenunderscore\arabic{minted@tmpcnt}\endcsname\relax
+ \stepcounter{minted@tmpcnt}
+\repeat
+% [A-Z]
+\setcounter{minted@tmpcnt}{65}
+\loop\unless\ifnum\value{minted@tmpcnt}>90\relax
+ \expandafter\let\csname minted@isalpha\arabic{minted@tmpcnt}\endcsname\relax
+ \expandafter\let\csname minted@isalphanum\arabic{minted@tmpcnt}\endcsname\relax
+ \expandafter\let
+ \csname minted@isalphanumhyphenunderscore\arabic{minted@tmpcnt}\endcsname\relax
+ \stepcounter{minted@tmpcnt}
+\repeat
+% [a-z]
+\setcounter{minted@tmpcnt}{97}
+\loop\unless\ifnum\value{minted@tmpcnt}>122\relax
+ \expandafter\let\csname minted@isalpha\arabic{minted@tmpcnt}\endcsname\relax
+ \expandafter\let\csname minted@isalphanum\arabic{minted@tmpcnt}\endcsname\relax
+ \expandafter\let
+ \csname minted@isalphanumhyphenunderscore\arabic{minted@tmpcnt}\endcsname\relax
+ \stepcounter{minted@tmpcnt}
+\repeat
+% [-]
+\expandafter\let\csname minted@isalphanumhyphenunderscore45\endcsname\relax
+% [_]
+\expandafter\let\csname minted@isalphanumhyphenunderscore95\endcsname\relax
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\minted@optlistfv@lang}
+%
+% \begin{macro}{\minted@ifalphanumhyphenunderscore}
+% Conditional based on whether first argument is ASCII alphanumeric, hyphen, or underscore.
% \begin{macrocode}
-\newcommand{\minted@optlistfv@lang}{}
+\def\minted@ifalphanumhyphenunderscore#1#2#3{%
+ \if\relax\detokenize{#1}\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {#3}%
+ {\expandafter\minted@ifalphanumhyphenunderscore@i\detokenize{#1}\FV@Sentinel{#2}{#3}}}
+\def\minted@ifalphanumhyphenunderscore@i#1#2\FV@Sentinel{%
+ \if\relax#2\relax
+ \expandafter\minted@ifalphanumhyphenunderscore@iii
+ \else
+ \expandafter\minted@ifalphanumhyphenunderscore@ii
+ \fi
+ #1#2\FV@Sentinel}
+\def\minted@ifalphanumhyphenunderscore@ii#1#2\FV@Sentinel{%
+ \ifcsname minted@isalphanumhyphenunderscore\number`#1\endcsname
+ \expandafter\minted@ifalphanumhyphenunderscore@i
+ \else
+ \expandafter\minted@ifalphanumhyphenunderscore@false
+ \fi
+ #2\FV@Sentinel}
+\def\minted@ifalphanumhyphenunderscore@iii#1\FV@Sentinel{%
+ \ifcsname minted@isalphanumhyphenunderscore\number`#1\endcsname
+ \expandafter\minted@ifalphanumhyphenunderscore@true
+ \else
+ \expandafter\minted@ifalphanumhyphenunderscore@false
+ \fi
+ \FV@Sentinel}
+\def\minted@ifalphanumhyphenunderscore@true\FV@Sentinel#1#2{#1}
+\def\minted@ifalphanumhyphenunderscore@false#1\FV@Sentinel#2#3{#3}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\minted@optlistfv@lang@i}
+%
+%
+% \subsection{State}
+%
+%
+% \begin{macro}{\minted@lexer}
+% Current lexer (language). Should be the empty macro if not set; it is used within |\ifcsname...\endcsname| to check for the existence of lexer-specific settings macros.
% \begin{macrocode}
-\newcommand{\minted@optlistfv@lang@i}{}
+\let\minted@lexer\@empty
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\minted@optlistfv@cmd}
+%
+% \begin{macro}{minted@isinline}
+% Whether in command or environment.
% \begin{macrocode}
-\newcommand{\minted@optlistfv@cmd}{}
+\newbool{minted@isinline}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\minted@configlang}
%
-% We need a way to check whether a language has had all its option list macros created. This generally occurs in a context where |\minted@lang| needs to be set. So we create a macro that does both at once. If the language list macros do not exist, we create them globally to simplify future operations.
+% \begin{macro}{minted@tmpcodebufferlength}
+% Length of buffer in which code to be highlighted is stored.
% \begin{macrocode}
-\newcommand{\minted@configlang}[1]{%
- \def\minted@lang{#1}%
- \ifcsname minted@optlistcl@lang\minted@lang\endcsname\else
- \expandafter\gdef\csname minted@optlistcl@lang\minted@lang\endcsname{}%
- \fi
- \ifcsname minted@optlistcl@lang\minted@lang @i\endcsname\else
- \expandafter\gdef\csname minted@optlistcl@lang\minted@lang @i\endcsname{}%
- \fi
- \ifcsname minted@optlistfv@lang\minted@lang\endcsname\else
- \expandafter\gdef\csname minted@optlistfv@lang\minted@lang\endcsname{}%
- \fi
- \ifcsname minted@optlistfv@lang\minted@lang @i\endcsname\else
- \expandafter\gdef\csname minted@optlistfv@lang\minted@lang @i\endcsname{}%
- \fi
-}
+\newcounter{minted@tmpcodebufferlength}
% \end{macrocode}
% \end{macro}
%
-% We need a way to define options in bulk at the global, language, and command levels. How this is done will depend on the type of option. The keys created are grouped by level: |minted@opt@g|, |minted@opt@lang|, and |minted@opt@cmd|, plus inline variants. The language-level key groupings use |\minted@lang| internally, so we don't need to duplicate the internals for different languages. The key groupings are independent of whether a given option relates to Pygments, \texpkg{fancyvrb}, etc. Organization by level is the only thing that is important here, since keys are applied in a hierarchical fashion. Key values are stored in macros of the form |\minted@opt@|\meta{level}|:|\meta{key}, so that they may be retrieved later. In practice, these key macros will generally not be used directly (hence the colon in the name). Rather, the hierarchy of macros will be traversed until an existing macro is found.
%
-% \begin{macro}{\minted@def@optcl}
%
-% Define a generic option that will be passed to the command line. Options are given in a |{key}{value}| format that is transformed into |key=value| and then passed to |pygmentize|. This allows |value| to be easily stored in a separate macro for later access. This is useful, for example, in separately accessing the value of |encoding| for performing |autogobble|.
+% \subsection{Calling \mintedpkg\ executable}
%
-% If a |key| option is specified without |=value|, the default is assumed. Options are automatically created at all levels.
%
-% Options are added to the option lists in such a way that they will be detokenized. This is necessary since they will ultimately be used in |\write18|.
+% \begin{macro}{minted@canexec}
% \begin{macrocode}
-\ifwindows
- \newcommand{\minted@optlistcl@quote}[2]{%
- \detokenize{#1="#2"}}
-\else
- \newcommand{\minted@optlistcl@quote}[2]{%
- \detokenize{#1='#2'}}
+\newbool{minted@canexec}
+\booltrue{minted@canexec}
+\ifnum\csname c_sys_shell_escape_int\endcsname=0\relax
+ \boolfalse{minted@canexec}
\fi
-\newcommand{\minted@addto@optlistcl}[3]{%
- \expandafter\def\expandafter#1\expandafter{#1%
- \minted@optlistcl@quote{#2}{#3}\space}}
-\newcommand{\minted@addto@optlistcl@lang}[3]{%
- \expandafter\let\expandafter\minted@tmp\csname #1\endcsname
- \expandafter\def\expandafter\minted@tmp\expandafter{\minted@tmp%
- \minted@optlistcl@quote{#2}{#3}\space}%
- \expandafter\let\csname #1\endcsname\minted@tmp}
-\newcommand{\minted@def@optcl}[4][]{%
- \ifthenelse{\equal{#1}{}}%
- {\define@key{minted@opt@g}{#2}{%
- \minted@addto@optlistcl{\minted@optlistcl@g}{#3}{#4}%
- \@namedef{minted@opt@g:#2}{#4}}%
- \define@key{minted@opt@g@i}{#2}{%
- \minted@addto@optlistcl{\minted@optlistcl@g@i}{#3}{#4}%
- \@namedef{minted@opt@g@i:#2}{#4}}%
- \define@key{minted@opt@lang}{#2}{%
- \minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang}{#3}{#4}%
- \@namedef{minted@opt@lang\minted@lang:#2}{#4}}%
- \define@key{minted@opt@lang@i}{#2}{%
- \minted@addto@optlistcl@lang{%
- minted@optlistcl@lang\minted@lang @i}{#3}{#4}%
- \@namedef{minted@opt@lang\minted@lang @i:#2}{#4}}%
- \define@key{minted@opt@cmd}{#2}{%
- \minted@addto@optlistcl{\minted@optlistcl@cmd}{#3}{#4}%
- \@namedef{minted@opt@cmd:#2}{#4}}}%
- {\define@key{minted@opt@g}{#2}[#1]{%
- \minted@addto@optlistcl{\minted@optlistcl@g}{#3}{#4}%
- \@namedef{minted@opt@g:#2}{#4}}%
- \define@key{minted@opt@g@i}{#2}[#1]{%
- \minted@addto@optlistcl{\minted@optlistcl@g@i}{#3}{#4}%
- \@namedef{minted@opt@g@i:#2}{#4}}%
- \define@key{minted@opt@lang}{#2}[#1]{%
- \minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang}{#3}{#4}%
- \@namedef{minted@opt@lang\minted@lang:#2}{#4}}%
- \define@key{minted@opt@lang@i}{#2}[#1]{%
- \minted@addto@optlistcl@lang{%
- minted@optlistcl@lang\minted@lang @i}{#3}{#4}%
- \@namedef{minted@opt@lang\minted@lang @i:#2}{#4}}%
- \define@key{minted@opt@cmd}{#2}[#1]{%
- \minted@addto@optlistcl{\minted@optlistcl@cmd}{#3}{#4}%
- \@namedef{minted@opt@cmd:#2}{#4}}}%
-}
+\ifbool{minted@frozencache}{\boolfalse{minted@canexec}}{}
+\ifbool{minted@placeholder}{\boolfalse{minted@canexec}}{}
+\ifbool{minted@verbatim}{\boolfalse{minted@canexec}}{}
% \end{macrocode}
% \end{macro}
%
-% This covers the typical options that must be passed to Pygments. But some, particularly |escapeinside|, need more work. Since their arguments may contain escaped characters, expansion rather than detokenization is needed. Getting expansion to work as desired in a |\write18| context requires the redefinition of some characters.
%
-% \begin{macro}{\minted@escape}
-% Process (possibly backslash-escaped) characters into a form that will work correctly under expansion for use in |\write18|. This assumes that only punctuation characters are escaped. (Otherwise, trailing spaces from |\detokenize| would need to be stripped.) This is currently only used for |escapeinside|.
+% \begin{macro}{\minted@ShellEscapeMaybeMessages,\minted@ShellEscapeNoMessages}
% \begin{macrocode}
-\begingroup
-\catcode`\!=0
-!catcode`!\=12
-!gdef!minted@escape#1{%
- !expandafter!minted@escape@i!detokenize{#1}\!FV@Sentinel}
-!gdef!minted@escape@i#1\#2!FV@Sentinel{%
- !if!relax!detokenize{#2}!relax
- !expandafter!@firstoftwo
- !else
- !expandafter!@secondoftwo
- !fi
- {#1!minted@escape@end\#2!FV@Sentinel}
- {#1!minted@escape@esc\#2!FV@Sentinel}}
-!gdef!minted@escape@end#1!FV@Sentinel{}
-!gdef!minted@escape@esc\#1#2!FV@Sentinel{%
- #1!minted@escape@i#2!FV@Sentinel}
-!endgroup
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{macro}{\minted@def@optcl@e}
-% Now to define options that involve backslash escapes.
-% \begin{macrocode}
-\newcommand{\minted@addto@optlistcl@e}[3]{%
- \edef\minted@tmp{\minted@escape{#3}}%
- \expandafter\minted@addto@optlistcl@e@i\expandafter{\minted@tmp}{#1}{#2}}
-\def\minted@addto@optlistcl@e@i#1#2#3{%
- \expandafter\def\expandafter#2\expandafter{#2\minted@optlistcl@quote{#3}{#1}\space}}
-\newcommand{\minted@addto@optlistcl@lang@e}[3]{%
- \edef\minted@tmp{\minted@escape{#3}}%
- \expandafter\minted@addto@optlistcl@lang@e@i\expandafter{\minted@tmp}{#1}{#2}}
-\def\minted@addto@optlistcl@lang@e@i#1#2#3{%
- \expandafter\let\expandafter\minted@tmp\csname #2\endcsname
- \expandafter\def\expandafter\minted@tmp\expandafter{\minted@tmp\minted@optlistcl@quote{#3}{#1}\space}%
- \expandafter\let\csname #2\endcsname\minted@tmp}
-\newcommand{\minted@def@optcl@e}[4][]{%
- \ifthenelse{\equal{#1}{}}%
- {\define@key{minted@opt@g}{#2}{%
- \minted@addto@optlistcl@e{\minted@optlistcl@g}{#3}{#4}%
- \@namedef{minted@opt@g:#2}{#4}}%
- \define@key{minted@opt@g@i}{#2}{%
- \minted@addto@optlistcl@e{\minted@optlistcl@g@i}{#3}{#4}%
- \@namedef{minted@opt@g@i:#2}{#4}}%
- \define@key{minted@opt@lang}{#2}{%
- \minted@addto@optlistcl@lang@e{minted@optlistcl@lang\minted@lang}{#3}{#4}%
- \@namedef{minted@opt@lang\minted@lang:#2}{#4}}%
- \define@key{minted@opt@lang@i}{#2}{%
- \minted@addto@optlistcl@lang@e{%
- minted@optlistcl@lang\minted@lang @i}{#3}{#4}%
- \@namedef{minted@opt@lang\minted@lang @i:#2}{#4}}%
- \define@key{minted@opt@cmd}{#2}{%
- \minted@addto@optlistcl@e{\minted@optlistcl@cmd}{#3}{#4}%
- \@namedef{minted@opt@cmd:#2}{#4}}}%
- {\define@key{minted@opt@g}{#2}[#1]{%
- \minted@addto@optlistcl@e{\minted@optlistcl@g}{#3}{#4}%
- \@namedef{minted@opt@g:#2}{#4}}%
- \define@key{minted@opt@g@i}{#2}[#1]{%
- \minted@addto@optlistcl@e{\minted@optlistcl@g@i}{#3}{#4}%
- \@namedef{minted@opt@g@i:#2}{#4}}%
- \define@key{minted@opt@lang}{#2}[#1]{%
- \minted@addto@optlistcl@lang@e{minted@optlistcl@lang\minted@lang}{#3}{#4}%
- \@namedef{minted@opt@lang\minted@lang:#2}{#4}}%
- \define@key{minted@opt@lang@i}{#2}[#1]{%
- \minted@addto@optlistcl@lang@e{%
- minted@optlistcl@lang\minted@lang @i}{#3}{#4}%
- \@namedef{minted@opt@lang\minted@lang @i:#2}{#4}}%
- \define@key{minted@opt@cmd}{#2}[#1]{%
- \minted@addto@optlistcl@e{\minted@optlistcl@cmd}{#3}{#4}%
- \@namedef{minted@opt@cmd:#2}{#4}}}%
-}
+\def\minted@ShellEscapeMaybeMessages#1{%
+ \let\minted@exec@warning\relax
+ \let\minted@exec@error\relax
+ \ifbool{minted@canexec}{\ShellEscape{#1}\minted@inputexecmessages}{}}
+\def\minted@ShellEscapeNoMessages#1{%
+ \ifbool{minted@canexec}{\ShellEscape{#1}}{}}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\minted@def@optcl@switch}
-%
-% Define a switch or boolean option that is passed to Pygments, which is |true| when no value is specified.
-% \begin{macrocode}
-\newcommand{\minted@def@optcl@switch}[2]{%
- \define@booleankey{minted@opt@g}{#1}%
- {\minted@addto@optlistcl{\minted@optlistcl@g}{#2}{True}%
- \@namedef{minted@opt@g:#1}{true}}
- {\minted@addto@optlistcl{\minted@optlistcl@g}{#2}{False}%
- \@namedef{minted@opt@g:#1}{false}}
- \define@booleankey{minted@opt@g@i}{#1}%
- {\minted@addto@optlistcl{\minted@optlistcl@g@i}{#2}{True}%
- \@namedef{minted@opt@g@i:#1}{true}}
- {\minted@addto@optlistcl{\minted@optlistcl@g@i}{#2}{False}%
- \@namedef{minted@opt@g@i:#1}{false}}
- \define@booleankey{minted@opt@lang}{#1}%
- {\minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang}{#2}{True}%
- \@namedef{minted@opt@lang\minted@lang:#1}{true}}
- {\minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang}{#2}{False}%
- \@namedef{minted@opt@lang\minted@lang:#1}{false}}
- \define@booleankey{minted@opt@lang@i}{#1}%
- {\minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang @i}{#2}{True}%
- \@namedef{minted@opt@lang\minted@lang @i:#1}{true}}
- {\minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang @i}{#2}{False}%
- \@namedef{minted@opt@lang\minted@lang @i:#1}{false}}
- \define@booleankey{minted@opt@cmd}{#1}%
- {\minted@addto@optlistcl{\minted@optlistcl@cmd}{#2}{True}%
- \@namedef{minted@opt@cmd:#1}{true}}
- {\minted@addto@optlistcl{\minted@optlistcl@cmd}{#2}{False}%
- \@namedef{minted@opt@cmd:#1}{false}}
-}
+% \begin{macro}{\minted@execarg@debug,\minted@execarg@timestamp}
+% \begin{macrocode}
+\def\minted@execarg@debug{%
+ \ifbool{minted@debug}{\detokenize{ --debug }}{}}
+\def\minted@execarg@timestamp{%
+ \detokenize{ --timestamp }\minted@timestamp\detokenize{ }}
% \end{macrocode}
% \end{macro}
%
-% Now that all the machinery for Pygments options is in place, we can move on to \texpkg{fancyvrb} options.
-%
-% \begin{macro}{\minted@def@optfv}
-%
-% Define \texpkg{fancyvrb} options. The |#1={##1}| is needed because any braces enclosing the argument (|##1|) will be stripped during the initial capture, and they need to be reinserted before \texpkg{fancyvrb} gets the argument and sends it through another \texpkg{keyval} processing step. If there were no braces initially, adding them here doesn't hurt, since they are just stripped off again during processing.
-% \begin{macrocode}
-\newcommand{\minted@def@optfv}[1]{%
- \define@key{minted@opt@g}{#1}{%
- \expandafter\def\expandafter\minted@optlistfv@g\expandafter{%
- \minted@optlistfv@g#1={##1},}%
- \@namedef{minted@opt@g:#1}{##1}}
- \define@key{minted@opt@g@i}{#1}{%
- \expandafter\def\expandafter\minted@optlistfv@g@i\expandafter{%
- \minted@optlistfv@g@i#1={##1},}%
- \@namedef{minted@opt@g@i:#1}{##1}}
- \define@key{minted@opt@lang}{#1}{%
- \expandafter\let\expandafter\minted@tmp%
- \csname minted@optlistfv@lang\minted@lang\endcsname
- \expandafter\def\expandafter\minted@tmp\expandafter{%
- \minted@tmp#1={##1},}%
- \expandafter\let\csname minted@optlistfv@lang\minted@lang\endcsname%
- \minted@tmp
- \@namedef{minted@opt@lang\minted@lang:#1}{##1}}
- \define@key{minted@opt@lang@i}{#1}{%
- \expandafter\let\expandafter\minted@tmp%
- \csname minted@optlistfv@lang\minted@lang @i\endcsname
- \expandafter\def\expandafter\minted@tmp\expandafter{%
- \minted@tmp#1={##1},}%
- \expandafter\let\csname minted@optlistfv@lang\minted@lang @i\endcsname%
- \minted@tmp
- \@namedef{minted@opt@lang\minted@lang @i:#1}{##1}}
- \define@key{minted@opt@cmd}{#1}{%
- \expandafter\def\expandafter\minted@optlistfv@cmd\expandafter{%
- \minted@optlistfv@cmd#1={##1},}%
- \@namedef{minted@opt@cmd:#1}{##1}}
-}
+%
+% \begin{macro}{\minted@exec@cleanfile}
+% Clean (delete) a temp file in all locations where it might be expected to exist. Only files under the working directory, |TEXMFOUTPUT|, or |TEXMF_OUTPUT_DIRECTORY| can be cleaned, and only if their names match the regex
+%\begin{verbatim}
+%[0-9a-zA-Z_-]+\.(?:config|data|errlog|highlight|message|style)\.minted
+%\end{verbatim}
+% The identifier immediately before the |.minted| file extension describes the role of the file. Files ending with |.errlog.minted| are not automatically cleaned up at the end of a compile, but are deleted at the beginning as part of config detection.
+% \begin{macrocode}
+\def\minted@exec@cleanfile#1{%
+ \minted@ShellEscapeNoMessages{%
+ \MintedExecutable\detokenize{ cleanfile }\minted@execarg@debug#1}}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\minted@def@optfv@switch}
-%
-% Define \texpkg{fancyvrb} boolean options.
-% \begin{macrocode}
-\newcommand{\minted@def@optfv@switch}[1]{%
- \define@booleankey{minted@opt@g}{#1}%
- {\expandafter\def\expandafter\minted@optlistfv@g\expandafter{%
- \minted@optlistfv@g#1=true,}%
- \@namedef{minted@opt@g:#1}{true}}%
- {\expandafter\def\expandafter\minted@optlistfv@g\expandafter{%
- \minted@optlistfv@g#1=false,}%
- \@namedef{minted@opt@g:#1}{false}}%
- \define@booleankey{minted@opt@g@i}{#1}%
- {\expandafter\def\expandafter\minted@optlistfv@g@i\expandafter{%
- \minted@optlistfv@g@i#1=true,}%
- \@namedef{minted@opt@g@i:#1}{true}}%
- {\expandafter\def\expandafter\minted@optlistfv@g@i\expandafter{%
- \minted@optlistfv@g@i#1=false,}%
- \@namedef{minted@opt@g@i:#1}{false}}%
- \define@booleankey{minted@opt@lang}{#1}%
- {\expandafter\let\expandafter\minted@tmp%
- \csname minted@optlistfv@lang\minted@lang\endcsname
- \expandafter\def\expandafter\minted@tmp\expandafter{%
- \minted@tmp#1=true,}%
- \expandafter\let\csname minted@optlistfv@lang\minted@lang\endcsname%
- \minted@tmp
- \@namedef{minted@opt@lang\minted@lang:#1}{true}}%
- {\expandafter\let\expandafter\minted@tmp%
- \csname minted@optlistfv@lang\minted@lang\endcsname
- \expandafter\def\expandafter\minted@tmp\expandafter{%
- \minted@tmp#1=false,}%
- \expandafter\let\csname minted@optlistfv@lang\minted@lang\endcsname%
- \minted@tmp
- \@namedef{minted@opt@lang\minted@lang:#1}{false}}%
- \define@booleankey{minted@opt@lang@i}{#1}%
- {\expandafter\let\expandafter\minted@tmp%
- \csname minted@optlistfv@lang\minted@lang @i\endcsname
- \expandafter\def\expandafter\minted@tmp\expandafter{%
- \minted@tmp#1=true,}%
- \expandafter\let\csname minted@optlistfv@lang\minted@lang @i\endcsname%
- \minted@tmp
- \@namedef{minted@opt@lang\minted@lang @i:#1}{true}}%
- {\expandafter\let\expandafter\minted@tmp%
- \csname minted@optlistfv@lang\minted@lang @i\endcsname
- \expandafter\def\expandafter\minted@tmp\expandafter{%
- \minted@tmp#1=false,}%
- \expandafter\let\csname minted@optlistfv@lang\minted@lang @i\endcsname%
- \minted@tmp
- \@namedef{minted@opt@lang\minted@lang @i:#1}{false}}%
- \define@booleankey{minted@opt@cmd}{#1}%
- {\expandafter\def\expandafter\minted@optlistfv@cmd\expandafter{%
- \minted@optlistfv@cmd#1=true,}%
- \@namedef{minted@opt@cmd:#1}{true}}%
- {\expandafter\def\expandafter\minted@optlistfv@cmd\expandafter{%
- \minted@optlistfv@cmd#1=false,}%
- \@namedef{minted@opt@cmd:#1}{false}}%
-}
+%
+% \begin{macro}{\minted@inputexecmessages}
+% If temp file containing warning and/or error messages exists, |\input| and then delete.
+% \begin{macrocode}
+\def\minted@inputexecmessages{%
+ \minted@ensureatletter{\InputIfFileExists{\MintedMessageFilename}{}{}}}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{minted@isinline}
-% In resolving value precedence when actually using values, we need a way to determine whether we are in an inline context. This is accomplished via a boolean that is set at the beginning of inline commands.
+%
+% \begin{macro}{\minted@exec@batch}
+% Run in batch mode, for |highlightmode=fast| or |highlightmode=fastfirst|.
% \begin{macrocode}
-\newboolean{minted@isinline}
+\def\minted@exec@batch{%
+ \minted@ShellEscapeMaybeMessages{%
+ \MintedExecutable
+ \detokenize{ batch }\minted@execarg@timestamp\minted@execarg@debug
+ \MintedJobnameMdfive}}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\minted@fvset}
-% We will need a way to actually use the lists of stored \texpkg{fancyvrb} options later on.
+%
+% \begin{macro}{\minted@exec@config}
+% Detect configuration.
% \begin{macrocode}
-\newcommand{\minted@fvset}{%
- \expandafter\fvset\expandafter{\minted@optlistfv@g}%
- \expandafter\let\expandafter\minted@tmp%
- \csname minted@optlistfv@lang\minted@lang\endcsname
- \expandafter\fvset\expandafter{\minted@tmp}%
- \ifthenelse{\boolean{minted@isinline}}%
- {\expandafter\fvset\expandafter{\minted@optlistfv@g@i}%
- \expandafter\let\expandafter\minted@tmp%
- \csname minted@optlistfv@lang\minted@lang @i\endcsname
- \expandafter\fvset\expandafter{\minted@tmp}}%
- {}%
- \expandafter\fvset\expandafter{\minted@optlistfv@cmd}%
-}
+\def\minted@exec@config{%
+ \minted@ShellEscapeMaybeMessages{%
+ \MintedExecutable
+ \detokenize{ config }\minted@execarg@timestamp\minted@execarg@debug
+ \MintedJobnameMdfive}}
% \end{macrocode}
% \end{macro}
%
%
-% We need a way to define \texpkg{minted}-specific options at multiple levels of hierarchy, as well as a way to retrieve these options. As with previous types of options, values are stored in macros of the form |\minted@opt@|\meta{level}|:|\meta{key}, since they are not meant to be accessed directly.
-%
-% The order of precedence is |cmd|, |lang@i|, |g@i|, |lang|, |g|. A value specified at the command or environment level should override other settings. In its absence, a value specified for an inline command should override other settings, if we are indeed in an inline context. Otherwise, language settings take precedence over global settings.
-%
-% Before actually creating the option-definition macro, we need a few helper macros.
-%
+% \begin{macro}{\minted@exec@styledef}
+% Create style definition.
+% \begin{macrocode}
+\def\minted@exec@styledef{%
+ \minted@ShellEscapeMaybeMessages{%
+ \MintedExecutable
+ \detokenize{ styledef }\minted@execarg@timestamp\minted@execarg@debug
+ \MintedJobnameMdfive}}
+% \end{macrocode}
+% \end{macro}
%
-% \begin{macro}{\minted@def@opt}
-% Finally, on to the actual option definitions for \texpkg{minted}-specific options.
%
-% Usage: |\minted@def@opt[|\meta{initial global value}|]{|\meta{key name}|}|
+% \begin{macro}{\minted@exec@highlight}
+% Highlight code.
% \begin{macrocode}
-\newcommand{\minted@def@opt}[2][]{%
- \define@key{minted@opt@g}{#2}{%
- \@namedef{minted@opt@g:#2}{##1}}
- \define@key{minted@opt@g@i}{#2}{%
- \@namedef{minted@opt@g@i:#2}{##1}}
- \define@key{minted@opt@lang}{#2}{%
- \@namedef{minted@opt@lang\minted@lang:#2}{##1}}
- \define@key{minted@opt@lang@i}{#2}{%
- \@namedef{minted@opt@lang\minted@lang @i:#2}{##1}}
- \define@key{minted@opt@cmd}{#2}{%
- \@namedef{minted@opt@cmd:#2}{##1}}
- \ifstrempty{#1}{}{\@namedef{minted@opt@g:#2}{#1}}%
-}
+\def\minted@exec@highlight{%
+ \minted@ShellEscapeMaybeMessages{%
+ \MintedExecutable
+ \detokenize{ highlight }\minted@execarg@timestamp\minted@execarg@debug
+ \MintedJobnameMdfive}}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\minted@def@opt@detok}
-% Same as |\minted@def@opt|, except wraps argument in |\detokenize|.
+% \begin{macro}{\minted@exec@clean}
+% Clean output directory and cache.
% \begin{macrocode}
-\newcommand{\minted@def@opt@detok}[2][]{%
- \define@key{minted@opt@g}{#2}{%
- \@namedef{minted@opt@g:#2}{\detokenize{##1}}}
- \define@key{minted@opt@g@i}{#2}{%
- \@namedef{minted@opt@g@i:#2}{\detokenize{##1}}}
- \define@key{minted@opt@lang}{#2}{%
- \@namedef{minted@opt@lang\minted@lang:#2}{\detokenize{##1}}}
- \define@key{minted@opt@lang@i}{#2}{%
- \@namedef{minted@opt@lang\minted@lang @i:#2}{\detokenize{##1}}}
- \define@key{minted@opt@cmd}{#2}{%
- \@namedef{minted@opt@cmd:#2}{\detokenize{##1}}}
- \ifstrempty{#1}{}{\@namedef{minted@opt@g:#2}{\detokenize{#1}}}%
-}
+\def\minted@exec@clean{%
+ \minted@ShellEscapeNoMessages{%
+ \MintedExecutable
+ \detokenize{ clean }\minted@execarg@timestamp\minted@execarg@debug
+ \MintedJobnameMdfive}}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\minted@generate@PYGdef}
-% Generate Pygments style definition with |pygmentize| if a cached version does not exist. Load the style definition into a global macro of the form
-%\begin{Verbatim}
-%\csname minted@PYGdef@<style>\endcsname
-%\end{Verbatim}
-% to allow styles to be defined later. Styles are not defined globally to avoid naming issues with style names that involve punctuation characters and numbers. Rather, styles are redefined upon every use (within groups), and all styles use macros with a |\PYG| prefix.
%
-% Takes a single argument that is the detokenized style name. Getting the detokenized style name here requires expansion (|\edef|) in an earlier macro (currently |\minted@defstyle|) to convert |\minted@get@opt{style}{default}| into detokenized text. The |style| value is always wrapped in |\detokenize| when it is set, so expansion automatically detokenizes. Detokenization can be important depending on active characters. Expansion is important because the style name may be used with caching, so we need the current value retrieved by |\minted@get@opt|, not the value at the end of the document when cache data is written to the |.aux| file.
+% \subsection{Config detection}
%
-% Certain catcodes are required when loading Pygments style definitions from file.
-% \begin{itemize}
-% \item At sign |@| would be handled by the |\makeatletter| within the Pygments style definition if the style was brought in via |\input|, but |\makeatletter| doesn't affect tokenization with the |catchfile| approach.
-% \item Percent |%| may not have its normal meaning within a |.dtx| file.
-% \item Backtick |`| is made active by some \texpkg{babel} package options, such as |magyar|.
-% \end{itemize}
-% |\endlinechar| also requires special handling to avoid introducing unwanted spaces.
%
-% The |\ifx\PYG\relax| tests detect outdated style definitions from \texpkg{minted} <2.6 and replace them when possible, and also detect missing styles. Before \texpkg{minted} 2.6, style macros used a |\PYG<style>| prefix and were defined globally. Starting with 2.6, styles are redefined upon every use (within groups), and all styles use macros with a |\PYG| prefix. This allows more robust treatment of style names that involve punctuation characters and numbers.
+% \begin{macro}{minted@diddetectconfig}
% \begin{macrocode}
-\newcommand{\minted@generate@PYGdef}[1]{%
- \ifthenelse{\boolean{minted@cache}}%
- {\def\minted@pygstylepath@load{\minted@outputdir\minted@cachedir/#1.pygstyle}%
- \minted@addcachefile{#1.pygstyle}}%
- {\def\minted@pygstylepath@load{\minted@outputdir\minted@jobname.out.pyg}}%
- \ifwindows
- \StrSubstitute{\minted@pygstylepath@load}%
- {/}{\@backslashchar}[\minted@pygstylepath@save]%
- \else
- \let\minted@pygstylepath@save\minted@pygstylepath@load
- \fi
- \IfFileExists{\minted@pygstylepath@load}%
+\newbool{minted@diddetectconfig}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\minted@detectconfig}
+% When the |minted@canexec| bool is defined, it is set false if shell escape is completely disabled (|\c_sys_shell_escape_int=0|) or if execution is disabled by package options, so those cases don't need to be handled here.
+%
+% If the Python executable is available, then it will create a |.config.minted| file to notify the \LaTeX\ side that it is present. This |.config.minted| file always contains a timestamp |\minted@executable@timestamp|, which is the timestamp passed directly to the executable as a command-line option. If the executable finds a |.data.minted| file, then it will extract the timestamp from this file and save it in the |.config.minted| file as |\minted@config@timestamp|; otherwise, the |.config.minted| file will not contain this timestamp. When \LaTeX\ loads the |.config.minted| file, the presence and values of these timestamps is used to determine whether the executable is present and whether the correct |.data.minted| file was located by the executable.
+% \begin{macrocode}
+\def\minted@detectconfig{%
+ \ifbool{minted@diddetectconfig}%
{}%
- {\ifthenelse{\boolean{minted@frozencache}}%
- {\PackageError{minted}%
- {Missing style definition for #1 with frozencache}%
- {Missing style definition for #1 with frozencache}}%
- {}%
- \ShellEscape{%
- \MintedPygmentize\space -S #1 -f latex -P commandprefix=PYG
- > \minted@pygstylepath@save
- }%
- }%
- \CatchFileDef{\minted@tmp@filecontents}%
- {\minted@pygstylepath@load}{\catcode`@=11\catcode`\%=14\catcode``=12\endlinechar=-1}%
- \begingroup
- \let\PYG\relax
- \minted@tmp@filecontents
- \ifx\PYG\relax
- \ifthenelse{\boolean{minted@frozencache}}%
- {\PackageError{minted}%
- {Outdated style definition for #1 with frozencache}%
- {Outdated style definition for #1 with frozencache}}%
- {}%
- \ShellEscape{%
- \MintedPygmentize\space -S #1 -f latex -P commandprefix=PYG
- > \minted@pygstylepath@save
- }%
- \CatchFileDef{\minted@tmp@filecontents}%
- {\minted@pygstylepath@load}{\catcode`@=11\catcode`\%=14\catcode``=12\endlinechar=-1}%
- \minted@tmp@filecontents
- \ifx\PYG\relax
- \PackageError{minted}%
- {Cannot find Pygments style #1}%
- {Cannot find Pygments style #1}%
+ {\ifx\minted@cachedir\@empty
+ \gdef\minted@cachepath{}%
+ \else
+ \gdef\minted@cachepath{\minted@cachedir/}%
\fi
+ \ifbool{minted@canexec}{\begingroup\minted@detectconfig@i\endgroup}{}%
+ \global\booltrue{minted@diddetectconfig}}}
+\def\minted@detectconfig@i{%
+ \global\let\minted@executable@version\relax
+ \global\let\minted@executable@timestamp\relax
+ \global\let\minted@config@timestamp\relax
+ \pydatasetfilename{\MintedDataFilename}%
+ \pydatawritedictopen
+ \pydatawritekeyvalue{command}{config}%
+ \pydatawritekeyedefvalue{jobname}{\jobname}%
+ \pydatawritekeyedefvalue{timestamp}{\minted@timestamp}%
+ \pydatawritekeyedefvalue{cachedir}{\minted@cachedir}%
+ \pydatawritedictclose
+ \pydataclosefilename{\MintedDataFilename}%
+ \minted@exec@config
+ \minted@ensureatletter{%
+ \InputIfFileExists{\MintedConfigFilename}{}{}}%
+ \ifx\minted@executable@version\relax
+ \expandafter\minted@detectconfig@noexecutable
+ \else
+ \expandafter\minted@detectconfig@ii
+ \fi}
+\def\minted@detectconfig@noexecutable{%
+ \global\boolfalse{minted@canexec}%
+ \ifnum\csname c_sys_shell_escape_int\endcsname=1\relax
+ \minted@error{minted v3+ executable is not installed or is not added to PATH}%
+ \else
+ \minted@error{minted v3+ executable is not installed, is not added to PATH,
+ or is not permitted with restricted shell escape}%
+ \fi}
+\def\minted@detectconfig@ii{%
+ \ifx\minted@timestamp\minted@config@timestamp
+ \expandafter\minted@detectconfig@iii
+ \else
+ \expandafter\minted@detectconfig@wrongtimestamp
+ \fi}
+\def\minted@detectconfig@wrongtimestamp{%
+ \ifx\minted@timestamp\minted@executable@timestamp
+ \minted@exec@cleanfile{\MintedConfigFilename}%
+ \global\boolfalse{minted@canexec}%
+ \minted@error{minted v3 Python executable could not find output directory;
+ upgrade to TeX distribution that supports \detokenize{TEXMF_OUTPUT_DIRECTORY}
+ or set environment variable \detokenize{TEXMF_OUTPUT_DIRECTORY} manually)}%
+ \else
+ \expandafter\minted@detectconfig@noexecutable
+ \fi}
+\def\minted@detectconfig@iii{%
+ \minted@exec@cleanfile{\MintedConfigFilename}%
+ \ifx\minted@exec@warning\relax
+ \else
+ \expandafter\minted@exec@warning
\fi
- \expandafter\global\expandafter\let\csname minted@PYGdef@#1\endcsname%
- \minted@tmp@filecontents
- \endgroup
-}
+ \ifx\minted@exec@error\relax
+ \expandafter\minted@detectconfig@iv
+ \else
+ \expandafter\minted@detectconfig@error
+ \fi}
+\def\minted@detectconfig@error{%
+ \global\boolfalse{minted@canexec}%
+ \minted@exec@error}
+\def\minted@detectconfig@iv{%
+ \expandafter\minted@detectconfig@v\minted@executable@version\relax}
+\begingroup
+\catcode`\.=12
+\gdef\minted@detectconfig@v#1.#2.#3\relax{%
+ \def\minted@executable@major{#1}%
+ \def\minted@executable@minor{#2}%
+ \def\minted@executable@patch{#3}%
+ \minted@detectconfig@vi}
+\endgroup
+\def\minted@detectconfig@vi{%
+ \ifnum\minted@executable@major>\minted@executable@minmajor\relax
+ \global\booltrue{minted@executable@issupported}%
+ \else\ifnum\minted@executable@major=\minted@executable@minmajor\relax
+ \ifnum\minted@executable@minor>\minted@executable@minminor\relax
+ \global\booltrue{minted@executable@issupported}%
+ \else\ifnum\minted@executable@minor=\minted@executable@minminor\relax
+ \ifnum\minted@executable@patch<\minted@executable@minpatch\relax
+ \else
+ \global\booltrue{minted@executable@issupported}%
+ \fi
+ \fi\fi
+ \fi\fi
+ \ifbool{minted@executable@issupported}%
+ {\ifx\minted@config@cachepath\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {\global\boolfalse{minted@canexec}%
+ \minted@error{minted Python executable returned incomplete configuration data;
+ this may indicate a bug in minted or file corruption}}%
+ {\global\let\minted@cachepath\minted@config@cachepath
+ \minted@highlightmode@init}}%
+ {\global\boolfalse{minted@canexec}%
+ \minted@error{minted Python executable is version \minted@executable@version,
+ but version \minted@executable@minversion+ is required}}}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\minted@defstyle}
-% Define Pygments style macros. These are defined locally rather than globally, and redefined upon every use. Patch single quote macro if needed.
+%
+% \subsection{Options}
+%
+%
+% \subsubsection{Option processing}
+%
+% \begin{macro}{\minted@optcats,\minted@optkeyslist@<optcat>}
+% Option categories, along with lists of keys for each.
+% \begin{itemize}
+% \item |fv|: Passed on to \texpkg{fancyvrb}. Options are stored in scope-specific lists, rather than in individual per-option macros.
+% \item |py|: Passed to Python. Options are stored in scope-specific, individual per-option macros. Some of these are passed to \texpkg{fancyvrb} when the Python executable isn't available or is disabled.
+% \item |tex|: Processed in \LaTeX. Options are stored in scope-specific, individual per-option macros.
+% \end{itemize}
% \begin{macrocode}
-\newcommand{\minted@defstyle}[1]{%
- \edef\minted@style{#1}%
- \ifcsname minted@PYGdef@\minted@style\endcsname\else
- \expandafter\minted@generate@PYGdef\expandafter{\minted@style}%
- \fi
- \csname minted@PYGdef@\minted@style\endcsname
- \minted@patch@PYGZsq
- \minted@patch@PYGZhy
- \ifthenelse{\equal{\minted@get@opt{ignorelexererrors}{true}}{true}}%
- {\let\PYG@tok@err\relax}{}}
-\ifthenelse{\boolean{minted@draft}}{\renewcommand{\minted@defstyle}[1]{}}{}
+\begingroup
+\catcode`\,=12
+\gdef\minted@optcats{fv,py,tex}
+\endgroup
+\def\minted@do#1{\expandafter\def\csname minted@optkeyslist@#1\endcsname{}}
+\minted@forcsvlist{\minted@do}{\minted@optcats}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\minted@patch@PYGZsq}
-% The single quote macro from \texpkg{Pygments} 1.6+ needs to be patched if the \texpkg{upquote} package is in use. Patching is done when the default style is created. Patching is only attempted if the macro exists, so that there is a graceful fallback in the event of a custom \texpkg{Pygments} stylesheet.
+% \begin{macro}{\minted@optscopes,\minted@optscopes@onlyblock}
+% Scopes for options. |cmd| scope is the scope of a single command or environment.
% \begin{macrocode}
-\newcommand{\minted@patch@PYGZsq}{%
- \ifcsname PYGZsq\endcsname
- \expandafter\ifdefstring\expandafter{\csname PYGZsq\endcsname}{\char`\'}%
- {\minted@patch@PYGZsq@i}%
- {}%
- \fi
-}
\begingroup
-\catcode`\'=\active
-\gdef\minted@patch@PYGZsq@i{\gdef\PYGZsq{'}}
+\catcode`\,=12
+\gdef\minted@optscopes{global,lexer,globalinline,lexerinline,cmd}
+\gdef\minted@optscopes@onlyblock{global,lexer,cmd}
\endgroup
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\minted@patch@PYGZhy}
-% Redefine the hyphen under LuaTeX to prevent unintended line breaks.
+% \begin{macro}{\minted@iflexerscope}
% \begin{macrocode}
-\newcommand{\minted@patch@PYGZhy}{%
- \ifcsname PYGZhy\endcsname
- \expandafter\ifdefstring\expandafter{\csname PYGZhy\endcsname}{\char`\-}%
- {\def\PYGZhy{\mbox{-}}}%
- {}%
+\let\minted@iflexerscope@lexer\relax
+\let\minted@iflexerscope@lexerinline\relax
+\def\minted@iflexerscope#1#2#3{%
+ \ifcsname minted@iflexerscope@#1\endcsname
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
\fi
-}
+ {#2}{#3}}
% \end{macrocode}
% \end{macro}
%
%
+% \begin{macro}{\mintedpgfkeyscreate}
+% Core macro for defining options.
%
-% \begin{macro}{\minted@def@opt@switch}
-% And we need a switch version.
-%
-% It would be possible to create a special version of |\minted@get@opt| to work with these, but that would be redundant. During the key processing, any values other than |true| and |false| are filtered out. So when using |\minted@get@opt| later, we know that that part has already been taken care of, and we can just use something like |\ifthenelse{\equal{\minted@get@opt{<opt>}{<default>}}{true}}{...}{...}|. Of course, there is the possibility that a default value has not been set, but |\minted@def@opt@switch| sets a global default of |false| to avoid this. And as usual, Pygments values shouldn't be used without considering whether |\minted@get@opt| needs a fallback value.
+% Syntax: |\mintedpgfkeyscreate|\oarg{processor}\marg{option category}\marg{key(=value)? list}.
+% \begin{itemize}
+% \item Optional \meta{processor} is a macro that processes \meta{value}. It can take two forms.
+% \begin{enumerate}
+% \item It can take a single argument. In this case, it is used to wrap \meta{value}: |\processor|\marg{value}. It is not invoked until \meta{value} wrapped in \meta{processor} is actually used.
+% \item It can take two arguments. The first is the \meta{csname} that the processed \meta{value} should be stored in, and the second is \meta{value}. In this case, \meta{processor} is invoked immediately and stores the processed \meta{value} in \meta{csname}. See |\minted@opthandler@deforrestrictedescape| for an example of implementing this sort of \meta{processor}.
+% \end{enumerate}
+% \meta{processor} is only supported for |py| and |tex| options.
+% \item \meta{option category} is |fv| (for \texpkg{fancyvrb}), |py| (Python side of \mintedpkg), or |tex| (\LaTeX\ side of \mintedpkg).
+% \item If only \meta{key} is given, then \meta{value} defaults to |\pgfkeysnovalue|. In that case, options are defined so that they can be used in the future, but they are ignored until an explicit \meta{value} is provided later. |fv| options are typically defined only with \meta{key}. |py| and |tex| options are currently required to have an initial \meta{value}. If a \meta{key} is given an initial \meta{value} when it is defined, then that \meta{value} is stored for the \meta{key} in the |global| scope. When an initial value is needed for a different scope such as |lexer| or |inline|, |\pgfkeys| is used directly (|\setminted| and |\setmintedinline| don't yet exist).
+% \item |py| only: A default value for \meta{key} (value used when only \meta{key} is given without a value) can be specified with the syntax |key<default>=value|. Default values for |fv| options are already defined in \texpkg{fancyvrb}, and currently the few |tex| options are the sort that always need an explicit value for clarity.
+% \end{itemize}
% \begin{macrocode}
-\newcommand{\minted@def@opt@switch}[2][false]{%
- \define@booleankey{minted@opt@g}{#2}%
- {\@namedef{minted@opt@g:#2}{true}}%
- {\@namedef{minted@opt@g:#2}{false}}
- \define@booleankey{minted@opt@g@i}{#2}%
- {\@namedef{minted@opt@g@i:#2}{true}}%
- {\@namedef{minted@opt@g@i:#2}{false}}
- \define@booleankey{minted@opt@lang}{#2}%
- {\@namedef{minted@opt@lang\minted@lang:#2}{true}}%
- {\@namedef{minted@opt@lang\minted@lang:#2}{false}}
- \define@booleankey{minted@opt@lang@i}{#2}%
- {\@namedef{minted@opt@lang\minted@lang @i:#2}{true}}%
- {\@namedef{minted@opt@lang\minted@lang @i:#2}{false}}
- \define@booleankey{minted@opt@cmd}{#2}%
- {\@namedef{minted@opt@cmd:#2}{true}}%
- {\@namedef{minted@opt@cmd:#2}{false}}%
- \@namedef{minted@opt@g:#2}{#1}%
-}
+\def\minted@addoptkey#1#2{%
+ \ifcsname minted@optkeyslist@#1\endcsname
+ \else
+ \minted@fatalerror{Defining options under category "#1" is not supported}%
+ \fi
+ \expandafter\let\expandafter\minted@tmp\csname minted@optkeyslist@#1\endcsname
+ \ifx\minted@tmp\@empty
+ \def\minted@tmp{#2}%
+ \else
+ \expandafter\def\expandafter\minted@tmp\expandafter{\minted@tmp,#2}%
+ \fi
+ \expandafter\let\csname minted@optkeyslist@#1\endcsname\minted@tmp}
+\newcommand*{\mintedpgfkeyscreate}[3][]{%
+ \mintedpgfkeyscreate@i{#1}{#2}{#3}}
+\begingroup
+\catcode`\==12
+\gdef\mintedpgfkeyscreate@i#1#2#3{%
+ \def\minted@do##1{%
+ \minted@do@i##1=\FV@Sentinel}%
+ \def\minted@do@i##1=##2\FV@Sentinel{%
+ \minted@do@ii##1<>\FV@Sentinel}%
+ \def\minted@do@ii##1<##2>##3\FV@Sentinel{%
+ \minted@addoptkey{#2}{##1}}%
+ \minted@forcsvlist{\minted@do}{#3}%
+ \csname minted@pgfkeyscreate@#2\endcsname{#1}{#3}}
+\endgroup
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\minted@get@opt}
-% We need a way to traverse the hierarchy of values for a given key and return the current value that has precedence. In doing this, we need to specify a default value to use if no value is found. When working with \texpkg{minted}-specific values, there should generally be a default value; in those cases, an empty default may be supplied. But the macro should also work with Pygments settings, which are stored in macros of the same form and will sometimes need to be accessed (for example, |encoding|). In the Pygments case, there may very well be no default values on the \LaTeX\ side, because we are falling back on Pygments' own built-in defaults. There is no need to duplicate those when very few Pygments values are ever needed; it is simpler to specify the default fallback when accessing the macro value.
+% \begin{macro}{\minted@pgfkeyscreate@fv,\minted@fvoptlist@<scope>(@<lexer>)?,\minted@usefvopts,\minted@usefvoptsnopy}
+% Syntax: |\minted@pgfkeyscreate@fv|\marg{key(=value)? list}.
+%
+% Options are stored in scope-specific lists. They are applied by passing these lists to |\fvset|. Individual option values are not retrievable.
%
-% From a programming perspective, the default argument value needs to be mandatory, so that |\minted@get@opt| can be fully expandable. This significantly simplifies accessing options.
+% The |\begingroup\fvset{...}\endgroup| checks \texpkg{fancyvrb} options at definition time so that any errors are caught immediately instead of when the options are used later elsewhere.
+%
+% |\minted@usefvopts| applies options via |\fvset|. |\minted@useadditionalfvoptsnopy| applies additional options that are usually handled on the Python side and is intended for situations where Python is not available or is not used, such as purely verbatim typesetting.
% \begin{macrocode}
-\def\minted@get@opt#1#2{%
- \ifcsname minted@opt@cmd:#1\endcsname
- \csname minted@opt@cmd:#1\endcsname
+\def\minted@pgfkeyscreate@fv#1#2{%
+ \if\relax\detokenize{#1}\relax
\else
- \ifminted@isinline
- \ifcsname minted@opt@lang\minted@lang @i:#1\endcsname
- \csname minted@opt@lang\minted@lang @i:#1\endcsname
- \else
- \ifcsname minted@opt@g@i:#1\endcsname
- \csname minted@opt@g@i:#1\endcsname
+ \minted@fatalerror{Processor macros are not supported in defining fancyvrb options}%
+ \fi
+ \minted@forcsvlist{\minted@pgfkeycreate@fv}{#2}}
+\begingroup
+\catcode`\==12
+\gdef\minted@pgfkeycreate@fv#1{%
+ \minted@pgfkeycreate@fv@i#1=\FV@Sentinel}
+\gdef\minted@pgfkeycreate@fv@i#1=#2\FV@Sentinel{%
+ \if\relax\detokenize{#2}\relax
+ \expandafter\minted@pgfkeycreate@fv@ii
+ \else
+ \expandafter\minted@pgfkeycreate@fv@iii
+ \fi
+ {#1}#2\FV@Sentinel}
+\gdef\minted@pgfkeycreate@fv@ii#1\FV@Sentinel{%
+ \minted@pgfkeycreate@fv@iv{#1}{\minted@const@pgfkeysnovalue}}
+\gdef\minted@pgfkeycreate@fv@iii#1#2=\FV@Sentinel{%
+ \minted@pgfkeycreate@fv@iv{#1}{#2}}
+\endgroup
+\def\minted@pgfkeycreate@fv@iv#1#2{%
+ \def\minted@do##1{%
+ \minted@iflexerscope{##1}%
+ {\minted@do@i{##1}{@\minted@lexer}}%
+ {\minted@do@i{##1}{}}}%
+ \def\minted@do@i##1##2{%
+ \pgfkeys{%
+ /minted/##1/.cd,
+ #1/.code=
+ \def\minted@tmp{####1}%
+ \ifx\minted@tmp\minted@const@pgfkeysnovalue
+ \begingroup\fvset{#1}\endgroup
+ \minted@apptoprovidecs{minted@fvoptlist@##1##2}{#1,}%
\else
- \ifcsname minted@opt@lang\minted@lang:#1\endcsname
- \csname minted@opt@lang\minted@lang:#1\endcsname
+ \begingroup\fvset{#1=####1}\endgroup
+ \minted@apptoprovidecs{minted@fvoptlist@##1##2}{#1=####1,}%
+ \fi,
+ }%
+ }%
+ \minted@forcsvlist{\minted@do}{\minted@optscopes}%
+ \ifx\minted@const@pgfkeysnovalue#2\relax
+ \else
+ \pgfkeys{%
+ /minted/global/.cd,
+ #1=#2,
+ }%
+ \fi}
+\def\minted@usefvopts{%
+ \ifbool{minted@isinline}%
+ {\minted@forcsvlist{\minted@usefvopts@do}{\minted@optscopes}}%
+ {\minted@forcsvlist{\minted@usefvopts@do}{\minted@optscopes@onlyblock}}}
+\def\minted@usefvopts@do#1{%
+ \minted@iflexerscope{#1}%
+ {\ifcsname minted@fvoptlist@#1@\minted@lexer\endcsname
+ \expandafter
+ \let\expandafter\minted@tmp\csname minted@fvoptlist@#1@\minted@lexer\endcsname
+ \expandafter\fvset\expandafter{\minted@tmp}%
+ \fi}%
+ {\ifcsname minted@fvoptlist@#1\endcsname
+ \expandafter
+ \let\expandafter\minted@tmp\csname minted@fvoptlist@#1\endcsname
+ \expandafter\fvset\expandafter{\minted@tmp}%
+ \fi}}
+\def\minted@useadditionalfvoptsnopy{%
+ \edef\minted@tmp{\mintedpyoptvalueof{gobble}}%
+ \ifx\minted@tmp\minted@const@pgfkeysnovalue
+ \else
+ \expandafter\minted@useadditionalfvoptsnopy@fvsetvk
+ \expandafter{\minted@tmp}{gobble}%
+ \fi
+ \edef\minted@tmp{\mintedpyoptvalueof{mathescape}}%
+ \ifx\minted@tmp\minted@const@pgfkeysnovalue
+ \else
+ \expandafter\minted@useadditionalfvoptsnopy@fvsetvk
+ \expandafter{\minted@tmp}{mathescape}%
+ \fi}
+\def\minted@useadditionalfvoptsnopy@fvsetvk#1#2{%
+ \fvset{#2=#1}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\minted@pgfkeyscreate@py,\mintedpyoptvalueof}
+% Syntax: |\minted@pgfkeyscreate@py|\marg{processor}\marg{key(<default>)?=initial value list}.
+%
+% Currently, initial values are required. The key processing macros are written to handle the possibility of optional initial values: If no initial value is set, use |\pgfkeysnovalue|, which is skipped in passing data to the Python side to invoke defaults.
+%
+% |\mintedpyoptvalueof| is used for retrieving values via |\edef|.
+% \begin{macrocode}
+\def\minted@pgfkeyscreate@py#1#2{%
+ \minted@forcsvlist{\minted@pgfkeycreate@py{#1}}{#2}}
+\begingroup
+\catcode`\==12
+\catcode`\<=12
+\catcode`\>=12
+\gdef\minted@pgfkeycreate@py#1#2{%
+ \minted@pgfkeycreate@py@i{#1}#2=\FV@Sentinel}
+\gdef\minted@pgfkeycreate@py@i#1#2=#3\FV@Sentinel{%
+ \if\relax\detokenize{#3}\relax
+ \expandafter\minted@pgfkeycreate@py@ii
+ \else
+ \expandafter\minted@pgfkeycreate@py@iii
+ \fi
+ {#1}{#2}#3\FV@Sentinel}
+\gdef\minted@pgfkeycreate@py@ii#1#2\FV@Sentinel{%
+ \minted@pgfkeycreate@py@iv{#1}{\pgfkeysnovalue}#2<>\FV@Sentinel}
+\gdef\minted@pgfkeycreate@py@iii#1#2#3=\FV@Sentinel{%
+ \minted@pgfkeycreate@py@iv{#1}{#3}#2<>\FV@Sentinel}
+\gdef\minted@pgfkeycreate@py@iv#1#2#3<#4>#5\FV@Sentinel{%
+ \if\relax\detokenize{#4}\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {\minted@pgfkeycreate@py@v{#1}{#3}{#2}{\minted@const@pgfkeysnovalue}}%
+ {\minted@pgfkeycreate@py@v{#1}{#3}{#2}{#4}}}
+\endgroup
+\def\minted@pgfkeycreate@py@v#1#2#3#4{%
+ \def\minted@do##1{%
+ \minted@iflexerscope{##1}%
+ {\minted@do@i{##1}{@\minted@lexer}}%
+ {\minted@do@i{##1}{}}}
+ \def\minted@do@i##1##2{%
+ \if\relax\detokenize{#1}\relax
+ \pgfkeys{%
+ /minted/##1/.cd,
+ #2/.code=\expandafter\def\csname minted@pyopt@##1##2@#2\endcsname{####1},
+ }%
+ \else
+ \pgfkeys{%
+ /minted/##1/.cd,
+ #2/.code=
+ \def\minted@tmp{####1}%
+ \ifx\minted@tmp\minted@const@pgfkeysnovalue
+ \expandafter\let\csname minted@pyopt@##1##2@#2\endcsname\minted@tmp
+ \else\ifcsname minted@opthandler@immediate@\string#1\endcsname
+ #1{minted@pyopt@##1##2@#2}{####1}%
\else
- \ifcsname minted@opt@g:#1\endcsname
- \csname minted@opt@g:#1\endcsname
- \else
- #2%
- \fi
- \fi
- \fi
- \fi
+ \expandafter\def\csname minted@pyopt@##1##2@#2\endcsname{#1{####1}}%
+ \fi\fi,
+ }%
+ \fi
+ \ifx\minted@const@pgfkeysnovalue#4\relax
+ \pgfkeys{%
+ /minted/##1/.cd,
+ #2/.value required,
+ }%
\else
- \ifcsname minted@opt@lang\minted@lang:#1\endcsname
- \csname minted@opt@lang\minted@lang:#1\endcsname
- \else
- \ifcsname minted@opt@g:#1\endcsname
- \csname minted@opt@g:#1\endcsname
- \else
- #2%
- \fi
- \fi
+ \pgfkeys{%
+ /minted/##1/.cd,
+ #2/.default=#4,
+ }%
\fi
- \fi
-}%
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \noindent Actual option definitions. Some of these must be defined conditionally depending on whether we are in |draft| mode; in |draft| mode, we need to emulate Pygments functionality with \LaTeX, particularly with \texpkg{fancyvrb}, when possible. For example, gobbling must be performed by Pygments when |draft| is off, but when |draft| is on, \texpkg{fancyvrb} can perform gobbling.
-%
-% Lexers.
-% \begin{macrocode}
-\minted@def@optcl{encoding}{-P encoding}{#1}
-\minted@def@optcl{outencoding}{-P outencoding}{#1}
-\minted@def@optcl@e{escapeinside}{-P escapeinside}{#1}
-\minted@def@optcl@switch{stripnl}{-P stripnl}
-\minted@def@optcl@switch{stripall}{-P stripall}
-% Python console
-\minted@def@optcl@switch{python3}{-P python3}
-% PHP
-\minted@def@optcl@switch{funcnamehighlighting}{-P funcnamehighlighting}
-\minted@def@optcl@switch{startinline}{-P startinline}
-% \end{macrocode}
-%
-% Filters.
-% \begin{macrocode}
-\ifthenelse{\boolean{minted@draft}}%
- {\minted@def@optfv{gobble}}%
- {\minted@def@optcl{gobble}{-F gobble:n}{#1}}
-\minted@def@optcl{codetagify}{-F codetagify:codetags}{#1}
-\minted@def@optcl{keywordcase}{-F keywordcase:case}{#1}
-% \end{macrocode}
-%
-% \LaTeX\ formatter.
-% \begin{macrocode}
-\minted@def@optcl@switch{texcl}{-P texcomments}
-\minted@def@optcl@switch{texcomments}{-P texcomments}
-\minted@def@optcl@switch{mathescape}{-P mathescape}
-\minted@def@optfv@switch{linenos}
-\minted@def@opt@detok{style}
-% \end{macrocode}
-%
-% \texpkg{fancyvrb} and \texpkg{fvextra} options.
-% \begin{macrocode}
-\minted@def@optfv{frame}
-\minted@def@optfv{framesep}
-\minted@def@optfv{framerule}
-\minted@def@optfv{rulecolor}
-\minted@def@optfv{numbersep}
-\minted@def@optfv{numbers}
-\minted@def@optfv{firstnumber}
-\minted@def@optfv{stepnumber}
-\minted@def@optfv{firstline}
-\minted@def@optfv{lastline}
-\minted@def@optfv{baselinestretch}
-\minted@def@optfv{xleftmargin}
-\minted@def@optfv{xrightmargin}
-\minted@def@optfv{fillcolor}
-\minted@def@optfv{tabsize}
-\minted@def@optfv{fontfamily}
-\minted@def@optfv{fontsize}
-\minted@def@optfv{fontshape}
-\minted@def@optfv{fontseries}
-\minted@def@optfv{formatcom}
-\minted@def@optfv{label}
-\minted@def@optfv{labelposition}
-\minted@def@optfv{highlightlines}
-\minted@def@optfv{highlightcolor}
-\minted@def@optfv{space}
-\minted@def@optfv{spacecolor}
-\minted@def@optfv{tab}
-\minted@def@optfv{tabcolor}
-\minted@def@optfv{highlightcolor}
-\minted@def@optfv@switch{beameroverlays}
-\minted@def@optfv@switch{curlyquotes}
-\minted@def@optfv@switch{numberfirstline}
-\minted@def@optfv@switch{numberblanklines}
-\minted@def@optfv@switch{stepnumberfromfirst}
-\minted@def@optfv@switch{stepnumberoffsetvalues}
-\minted@def@optfv@switch{showspaces}
-\minted@def@optfv@switch{resetmargins}
-\minted@def@optfv@switch{samepage}
-\minted@def@optfv@switch{showtabs}
-\minted@def@optfv@switch{obeytabs}
-\minted@def@optfv@switch{breaklines}
-\minted@def@optfv@switch{breakbytoken}
-\minted@def@optfv@switch{breakbytokenanywhere}
-\minted@def@optfv{breakindent}
-\minted@def@optfv{breakindentnchars}
-\minted@def@optfv@switch{breakautoindent}
-\minted@def@optfv{breaksymbol}
-\minted@def@optfv{breaksymbolsep}
-\minted@def@optfv{breaksymbolsepnchars}
-\minted@def@optfv{breaksymbolindent}
-\minted@def@optfv{breaksymbolindentnchars}
-\minted@def@optfv{breaksymbolleft}
-\minted@def@optfv{breaksymbolsepleft}
-\minted@def@optfv{breaksymbolsepleftnchars}
-\minted@def@optfv{breaksymbolindentleft}
-\minted@def@optfv{breaksymbolindentleftnchars}
-\minted@def@optfv{breaksymbolright}
-\minted@def@optfv{breaksymbolsepright}
-\minted@def@optfv{breaksymbolseprightnchars}
-\minted@def@optfv{breaksymbolindentright}
-\minted@def@optfv{breaksymbolindentrightnchars}
-\minted@def@optfv{breakbefore}
-\minted@def@optfv{breakbeforesymbolpre}
-\minted@def@optfv{breakbeforesymbolpost}
-\minted@def@optfv@switch{breakbeforeinrun}
-\minted@def@optfv{breakafter}
-\minted@def@optfv@switch{breakafterinrun}
-\minted@def@optfv{breakaftersymbolpre}
-\minted@def@optfv{breakaftersymbolpost}
-\minted@def@optfv@switch{breakanywhere}
-\minted@def@optfv{breakanywheresymbolpre}
-\minted@def@optfv{breakanywheresymbolpost}
-\minted@def@optfv{fontencoding}
-% \end{macrocode}
-%
-% Finally, options specific to \texpkg{minted}.
-%
-% |bgcolor|. The original, |minipage|- and |\colorbox|-based solution was replaced with a |framed|-based solution in version 2.2. A dedicated framing package will often be preferable.
-% \begin{macrocode}
-\minted@def@opt{bgcolor}
-% \end{macrocode}
-%
-% Autogobble. We create an option that governs when Python's |textwrap.dedent()| is used to autogobble code.
-% \begin{macrocode}
-\minted@def@opt@switch{autogobble}
-% \end{macrocode}
-%
-% Whether lexer errors are shown.
-% \begin{macrocode}
-\minted@def@opt@switch{ignorelexererrors}
-% \end{macrocode}
-%
-% \begin{macro}{\minted@encoding}
-% When working with encoding, we will need access to the current encoding. That may be done via |\minted@get@opt|, but it is more convenient to go ahead and define a shortcut with an appropriate default
-% \begin{macrocode}
-\newcommand{\minted@encoding}{\minted@get@opt{encoding}{UTF8}}
-% \end{macrocode}
-% \end{macro}
-%
-%
-%
-%
-% \subsection{Internal helpers}
-%
-% \begin{environment}{minted@snugshade*}
-% Define a custom version of \texpkg{framed}'s |snugshade*| that takes a color as argument. This avoids the need to redefine |shadecolor|.
-% \begin{macrocode}
-\newenvironment{minted@snugshade*}[1]{%
- \def\FrameCommand##1{\hskip\@totalleftmargin
- \colorbox{#1}{##1}%
- \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
- \MakeFramed{\advance\hsize-\width
- \@totalleftmargin\z@ \linewidth\hsize
- \advance\labelsep\fboxsep
- \@setminipage}%
- }{\par\unskip\@minipagefalse\endMakeFramed}
+ }%
+ \minted@forcsvlist{\minted@do}{\minted@optscopes}%
+ \pgfkeys{%
+ /minted/global/.cd,
+ #2=#3,
+ }}
+\def\mintedpyoptvalueof#1{%
+ \ifbool{minted@isinline}%
+ {\minted@pyoptvalueof@inline{#1}}%
+ {\minted@pyoptvalueof@block{#1}}}
+\def\minted@pyoptvalueof@inline#1{%
+ \ifcsname minted@pyopt@cmd@#1\endcsname
+ \unexpanded\expandafter\expandafter\expandafter{%
+ \csname minted@pyopt@cmd@#1\endcsname}%
+ \else\ifcsname minted@pyopt@lexerinline@\minted@lexer @#1\endcsname
+ \unexpanded\expandafter\expandafter\expandafter{%
+ \csname minted@pyopt@lexerinline@\minted@lexer @#1\endcsname}%
+ \else\ifcsname minted@pyopt@globalinline@#1\endcsname
+ \unexpanded\expandafter\expandafter\expandafter{%
+ \csname minted@pyopt@globalinline@#1\endcsname}%
+ \else\ifcsname minted@pyopt@lexer@\minted@lexer @#1\endcsname
+ \unexpanded\expandafter\expandafter\expandafter{%
+ \csname minted@pyopt@lexer@\minted@lexer @#1\endcsname}%
+ \else
+ \unexpanded\expandafter\expandafter\expandafter{%
+ \csname minted@pyopt@global@#1\endcsname}%
+ \fi\fi\fi\fi}
+\def\minted@pyoptvalueof@block#1{%
+ \ifcsname minted@pyopt@cmd@#1\endcsname
+ \unexpanded\expandafter\expandafter\expandafter{%
+ \csname minted@pyopt@cmd@#1\endcsname}%
+ \else\ifcsname minted@pyopt@lexer@\minted@lexer @#1\endcsname
+ \unexpanded\expandafter\expandafter\expandafter{%
+ \csname minted@pyopt@lexer@\minted@lexer @#1\endcsname}%
+ \else
+ \unexpanded\expandafter\expandafter\expandafter{%
+ \csname minted@pyopt@global@#1\endcsname}%
+ \fi\fi}
% \end{macrocode}
-% \end{environment}
+% \end{macro}
%
%
-% \begin{environment}{\minted@bgbox}
+% \begin{macro}{\minted@pgfkeyscreate@tex,\mintedtexoptvalueof,\minted@usetexoptsnonpygments}
+% Syntax: |\minted@pgfkeyscreate@tex|\marg{processor}\marg{key=initial value list}.
%
-% Define an environment that may be wrapped around a |minted| environment to assign a background color. This is retained as a holdover from version 1.0. In most cases, it is probably better to use a dedicated framing package, such as \texpkg{tcolorbox} or \texpkg{mdframed}.
+% Currently, initial values are required. The key processing macros are written to handle the possibility of optional initial values: If no initial value is set, use |\pgfkeysnovalue|.
%
-% First, we need to define a new save box.
+% |\mintedtexoptvalueof| is used for retrieving values via |\edef|.
%
+% |\minted@usetexoptsnonpygments| applies the |tex| options that aren't used by Pygments. It is initially empty and is redefined after |tex| options are defined. Unlike the |\minted@usefvopts| case, it isn't possible to simply loop through all defined options; more specialized per-option handling is required, since some options are handled in separate Pygments-related macros and there is no equivalent of |\fvset|.
% \begin{macrocode}
-\newsavebox{\minted@bgbox}
+\def\minted@pgfkeyscreate@tex#1#2{%
+ \minted@forcsvlist{\minted@pgfkeycreate@tex{#1}}{#2}}
+\begingroup
+\catcode`\==12
+\gdef\minted@pgfkeycreate@tex#1#2{%
+ \minted@pgfkeycreate@tex@i{#1}#2=\FV@Sentinel}
+\gdef\minted@pgfkeycreate@tex@i#1#2=#3\FV@Sentinel{%
+ \if\relax\detokenize{#3}\relax
+ \expandafter\minted@pgfkeycreate@tex@ii
+ \else
+ \expandafter\minted@pgfkeycreate@tex@iii
+ \fi
+ {#1}{#2}#3\FV@Sentinel}
+\gdef\minted@pgfkeycreate@tex@ii#1#2\FV@Sentinel{%
+ \minted@pgfkeycreate@tex@iv{#1}{#2}{\pgfkeysnovalue}}
+\gdef\minted@pgfkeycreate@tex@iii#1#2#3=\FV@Sentinel{%
+ \minted@pgfkeycreate@tex@iv{#1}{#2}{#3}}
+\endgroup
+\def\minted@pgfkeycreate@tex@iv#1#2#3{%
+ \def\minted@do##1{%
+ \minted@iflexerscope{##1}%
+ {\minted@do@i{##1}{@\minted@lexer}}%
+ {\minted@do@i{##1}{}}}
+ \def\minted@do@i##1##2{%
+ \if\relax\detokenize{#1}\relax
+ \pgfkeys{%
+ /minted/##1/.cd,
+ #2/.code=\expandafter\def\csname minted@texopt@##1##2@#2\endcsname{####1},
+ #2/.value required,
+ }%
+ \else
+ \pgfkeys{%
+ /minted/##1/.cd,
+ #2/.code=
+ \def\minted@tmp{####1}%
+ \ifx\minted@tmp\minted@const@pgfkeysnovalue
+ \expandafter\let\csname minted@texopt@##1##2@#2\endcsname\minted@tmp
+ \else\ifcsname minted@opthandler@immediate@\string#1\endcsname
+ #1{minted@texopt@##1##2@#2}{####1}%
+ \else
+ \expandafter\def\csname minted@texopt@##1##2@#2\endcsname{#1{####1}}%
+ \fi\fi,
+ #2/.value required,
+ }%
+ \fi
+ }%
+ \minted@forcsvlist{\minted@do}{\minted@optscopes}%
+ \pgfkeys{%
+ /minted/global/.cd,
+ #2=#3,
+ }}
+\def\mintedtexoptvalueof#1{%
+ \ifbool{minted@isinline}%
+ {\minted@texoptvalueof@inline{#1}}%
+ {\minted@texoptvalueof@block{#1}}}
+\def\minted@texoptvalueof@inline#1{%
+ \ifcsname minted@texopt@cmd@#1\endcsname
+ \unexpanded\expandafter\expandafter\expandafter{%
+ \csname minted@texopt@cmd@#1\endcsname}%
+ \else\ifcsname minted@texopt@lexerinline@\minted@lexer @#1\endcsname
+ \unexpanded\expandafter\expandafter\expandafter{%
+ \csname minted@texopt@lexerinline@\minted@lexer @#1\endcsname}%
+ \else\ifcsname minted@texopt@globalinline@#1\endcsname
+ \unexpanded\expandafter\expandafter\expandafter{%
+ \csname minted@texopt@globalinline@#1\endcsname}%
+ \else\ifcsname minted@texopt@lexer@\minted@lexer @#1\endcsname
+ \unexpanded\expandafter\expandafter\expandafter{%
+ \csname minted@texopt@lexer@\minted@lexer @#1\endcsname}%
+ \else
+ \unexpanded\expandafter\expandafter\expandafter{%
+ \csname minted@texopt@global@#1\endcsname}%
+ \fi\fi\fi\fi}
+\def\minted@texoptvalueof@block#1{%
+ \ifcsname minted@texopt@cmd@#1\endcsname
+ \unexpanded\expandafter\expandafter\expandafter{%
+ \csname minted@texopt@cmd@#1\endcsname}%
+ \else\ifcsname minted@texopt@lexer@\minted@lexer @#1\endcsname
+ \unexpanded\expandafter\expandafter\expandafter{%
+ \csname minted@texopt@lexer@\minted@lexer @#1\endcsname}%
+ \else
+ \unexpanded\expandafter\expandafter\expandafter{%
+ \csname minted@texopt@global@#1\endcsname}%
+ \fi\fi}
+\def\minted@usetexoptsnonpygments{}
% \end{macrocode}
+% \end{macro}
%
-% Now we can define the environment that applies a background color. Prior to \texpkg{minted} 2.2, this involved a |minipage|. However, that approach was problematic because it did not allow linebreaks, would be pushed into the margin by immediately preceding text, and had very different whitespace separation from preceding and following text compared to no background color. In version 2.2, this was replaced with an approach based on \texpkg{framed}. |\FV@NumberSep| is adjusted by |\fboxsep| to ensure that line numbers remain in the same location in the margin regardless of whether |bgcolor| is used.
%
-% \begin{macrocode}
-\newenvironment{minted@colorbg}[1]{%
- \setlength{\OuterFrameSep}{0pt}%
- \let\minted@tmp\FV@NumberSep
- \edef\FV@NumberSep{%
- \the\numexpr\dimexpr\minted@tmp+\number\fboxsep\relax sp\relax}%
- \medskip
- \begin{minted@snugshade*}{#1}}
- {\end{minted@snugshade*}%
- \medskip\noindent}
-% \end{macrocode}
-% \end{environment}
+%
+% \subsubsection{Option handlers}
%
%
-% \begin{macro}{\minted@code}
-% Create a file handle for saving code (and anything else that must be written to temp files).
+% \begin{macro}{\minted@opthandler@deforrestrictedescape}
+% Syntax: |\minted@opthandler@deforrestrictedescape|\marg{csname}\marg{value}. \meta{value} is processed and then the result is stored in \meta{csname}.
+%
+% Leave \meta{value} unchanged if a single macro. Otherwise process it with |\FVExtraDetokenizeREscVArg|, which performs backslash escapes but restricted to ASCII symbols and punctuation. This guarantees exact output (no issues with spaces due to detokenizing alphabetical control sequences).
+%
+% The |\minted@opthandler@immediate@<macro_name>| tells option processing to invoke the macro immediately, instead of simply storing it as a value wrapper that will only be invoked when the value is used. This provides immediate error messages in the event of invalid escapes. |\FVExtraDetokenizeREscVArg| is not fully expandable, so waiting to invoke it later when \meta{value} is expanded (|\edef|) isn't an option.
% \begin{macrocode}
-\newwrite\minted@code
+\def\minted@opthandler@deforrestrictedescape#1#2{%
+ \if\relax\detokenize{#2}\relax
+ \expandafter\def\csname#1\endcsname{#2}%
+ \else\if\relax\detokenize\expandafter{\@gobble#2}\relax
+ \ifcat\relax\noexpand#2%
+ \expandafter\expandafter\expandafter\minted@opthandler@deforrestrictedescape@i
+ \expandafter\@gobble\string#2\FV@Sentinel{#1}{#2}%
+ \else
+ \FVExtraDetokenizeREscVArg{\expandafter\def\csname#1\endcsname}{#2}%
+ \fi
+ \else
+ \FVExtraDetokenizeREscVArg{\expandafter\def\csname#1\endcsname}{#2}%
+ \fi\fi}
+\def\minted@opthandler@deforrestrictedescape@i#1#2\FV@Sentinel#3#4{%
+ \ifcsname minted@isalpha\number`#1\endcsname
+ \expandafter\def\csname#3\endcsname{#4}%
+ \else
+ \FVExtraDetokenizeREscVArg{\expandafter\def\csname#3\endcsname}{#4}%
+ \fi}
+\expandafter\let\csname
+ minted@opthandler@immediate@\string\minted@opthandler@deforrestrictedescape
+ \endcsname\relax
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\minted@savecode}
%
-% Save code to be pygmentized to a file.
+% \subsubsection{Option definitions}
+%
+%
+% \paragraph{\texpkg{fancyvrb}}
+% \begin{itemize}
+% \item |tabcolor|: Visible tabs should have a specified color so that they don't change colors when used to indent multiline strings or comments.
+% \end{itemize}
% \begin{macrocode}
-\newcommand{\minted@savecode}[1]{
- \immediate\openout\minted@code\minted@jobname.pyg\relax
- \immediate\write\minted@code{\expandafter\detokenize\expandafter{#1}}%
- \immediate\closeout\minted@code}
+\mintedpgfkeyscreate{fv}{
+ baselinestretch,
+ beameroverlays,
+ backgroundcolor,
+ backgroundcolorvphantom,
+ bgcolor,
+ bgcolorpadding,
+ bgcolorvphantom,
+ breakafter,
+ breakafterinrun,
+ breakaftersymbolpost,
+ breakaftersymbolpre,
+ breakanywhere,
+ breakanywhereinlinestretch,
+ breakanywheresymbolpost,
+ breakanywheresymbolpre,
+ breakautoindent,
+ breakbefore,
+ breakbeforeinrun,
+ breakbeforesymbolpost,
+ breakbeforesymbolpre,
+ breakbytoken,
+ breakbytokenanywhere,
+ breakindent,
+ breakindentnchars,
+ breaklines,
+ breaksymbol,
+ breaksymbolindent,
+ breaksymbolindentleft,
+ breaksymbolindentleftnchars,
+ breaksymbolindentnchars,
+ breaksymbolindentright,
+ breaksymbolindentrightnchars,
+ breaksymbolleft,
+ breaksymbolright,
+ breaksymbolsep,
+ breaksymbolsepleft,
+ breaksymbolsepleftnchars,
+ breaksymbolsepnchars,
+ breaksymbolsepright,
+ breaksymbolseprightnchars,
+ curlyquotes,
+ fillcolor,
+ firstline,
+ firstnumber,
+ fontencoding,
+ fontfamily,
+ fontseries,
+ fontshape,
+ fontsize,
+ formatcom,
+ frame,
+ framerule,
+ framesep,
+ highlightcolor,
+ highlightlines,
+ label,
+ labelposition,
+ lastline,
+ linenos,
+ listparameters,
+ numberblanklines,
+ numberfirstline,
+ numbers,
+ numbersep,
+ obeytabs,
+ resetmargins,
+ rulecolor,
+ samepage,
+ showspaces,
+ showtabs,
+ space,
+ spacecolor,
+ stepnumber,
+ stepnumberfromfirst,
+ stepnumberoffsetvalues,
+ tab,
+ tabcolor=black,
+ tabsize,
+ xleftmargin,
+ xrightmargin,
+}
% \end{macrocode}
-% \end{macro}
%
+% \paragraph{\mintedpkg\ (passed to Python)}
+% \begin{itemize}
+% \item PHP should use |startinline| for |\mintinline|.
+% \end{itemize}
+% \begin{macrocode}
+\mintedpgfkeyscreate{py}{
+ autogobble<true>=false,
+ encoding=utf8,
+ funcnamehighlighting<true>=true,
+ gobble=0,
+ gobblefilter=0,
+ keywordcase=none,
+ literalenvname=MintedVerbatim,
+ mathescape<true>=false,
+ python3<true>=true,
+ rangeregexmatchnumber=1,
+ rangeregexdotall<true>=false,
+ rangeregexmultiline<true>=false,
+ startinline<true>=false,
+ stripall<true>=false,
+ stripnl<true>=false,
+ texcl<true>=false,
+ texcomments<true>=false,
+}
+\mintedpgfkeyscreate[\minted@opthandler@deforrestrictedescape]{py}{
+ codetagify=,
+ escapeinside=,
+ literatecomment=,
+ rangestartstring=,
+ rangestartafterstring=,
+ rangestopstring=,
+ rangestopbeforestring=,
+ rangeregex=,
+}
+\let\minted@tmplexer\minted@lexer
+\def\minted@lexer{php}
+\pgfkeys{
+ /minted/lexerinline/.cd,
+ startinline=true,
+}
+\let\minted@lexer\minted@tmplexer
+% \end{macrocode}
%
-% \begin{macro}{minted@FancyVerbLineTemp}
-% At various points, we will need a temporary counter for storing and then restoring the value of |FancyVerbLine|. When using the |langlinenos| option, we need to store the current value of |FancyVerbLine|, then set |FancyVerbLine| to the current value of a language-specific counter, and finally restore |FancyVerbLine| to its initial value after the current chunk of code has been typeset. In patching |VerbatimOut|, we need to prevent |FancyVerbLine| from being incremented during the write process.
+% \paragraph{\mintedpkg\ (kept in \LaTeX)}
+% \begin{itemize}
+% \item The |\minted@def@optcl| is for backward compatibility with versions of \texpkg{tcolorbox} that used this to define an |envname| option under \mintedpkg\ v2.
+% \end{itemize}
% \begin{macrocode}
-\newcounter{minted@FancyVerbLineTemp}
+\mintedpgfkeyscreate{tex}{
+ envname=Verbatim,
+ ignorelexererrors=false,
+ style=default,
+}
+\pgfkeys{
+ /minted/globalinline/.cd,
+ envname=VerbEnv,
+}
+\expandafter\def\expandafter\minted@usetexoptsnonpygments\expandafter{%
+ \minted@usetexoptsnonpygments
+ \edef\minted@literalenvname{\mintedpyoptvalueof{literalenvname}}%
+ \edef\minted@envname{\mintedtexoptvalueof{envname}}%
+ \expandafter\def\expandafter\minted@literalenv\expandafter{%
+ \csname \minted@literalenvname\endcsname}%
+ \expandafter\def\expandafter\minted@endliteralenv\expandafter{%
+ \csname end\minted@literalenvname\endcsname}%
+ \expandafter\expandafter\expandafter
+ \let\expandafter\minted@literalenv\csname \minted@envname\endcsname
+ \expandafter\expandafter\expandafter
+ \let\expandafter\minted@endliteralenv\csname end\minted@envname\endcsname}%
+\ifcsname minted@def@optcl\endcsname
+ \ifx\minted@def@optcl\relax
+ \let\minted@def@optcl\minted@undefined
+ \fi
+\fi
+\providecommand{\minted@def@optcl}[4][]{%
+ \minted@warning{Macro \string\minted@def@optcl\space is deprecated with minted v3
+ and no longer has any effect}}
% \end{macrocode}
-% \end{macro}
%
%
-% \begin{macro}{\minted@FVB@VerbatimOut}
-% We need a custom version of \texpkg{fancyvrb}'s |\FVB@VerbatimOut| that supports Unicode (everything written to file is |\detokenized|). We also need to prevent the value of |FancyVerbLine| from being incorrectly incremented.
+%
+% \subsection{Caching, styles, and highlighting}
+%
+%
+%
+% \subsubsection{Cache management}
+%
+%
+% \begin{macro}{\minted@addcachefilename,\minted@cachefile<n>}
+% Track cache files that are used, so that unused files can be removed.
% \begin{macrocode}
-\newcommand{\minted@write@detok}[1]{%
- \immediate\write\FV@OutFile{\detokenize{#1}}}
-\newcommand{\minted@FVB@VerbatimOut}[1]{%
- \setcounter{minted@FancyVerbLineTemp}{\value{FancyVerbLine}}%
- \@bsphack
- \begingroup
- \FV@UseKeyValues
- \FV@DefineWhiteSpace
- \def\FV@Space{\space}%
- \FV@DefineTabOut
- \let\FV@ProcessLine\minted@write@detok
- \immediate\openout\FV@OutFile #1\relax
- \let\FV@FontScanPrep\relax
- \let\@noligs\relax
- \FV@Scan}
+\newcounter{minted@numcachefiles}
+\def\minted@addcachefilename#1{%
+ \ifbool{minted@canexec}%
+ {\stepcounter{minted@numcachefiles}%
+ \expandafter
+ \xdef\csname minted@cachefile\arabic{minted@numcachefiles}\endcsname{#1}}%
+ {}}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\minted@FVE@VerbatimOut}
-% Likewise, we need a custom version of |\FVE@VerbatimOut| that completes the protection of |FancyVerbLine| from being incremented.
+%
+% \begin{macro}{\minted@clean}
+% If the Python executable is available and was used, clean up temp files. If a cache is in use, also update the cache index and remove unused cache files.
+%
+% Only create a |.data.minted| file if there is a cache list to save. Otherwise, no file is needed.
+%
+% Runs |\AfterEndDocument| so that all typesetting is complete, and thus the cache list is complete. |\minted@fasthighlightmode@checkend| is placed within the same |\AfterEndDocument| to guarantee correct ordering.
+%
% \begin{macrocode}
-\newcommand{\minted@FVE@VerbatimOut}{%
- \immediate\closeout\FV@OutFile\endgroup\@esphack
- \setcounter{FancyVerbLine}{\value{minted@FancyVerbLineTemp}}}%
+\def\minted@clean{%
+ \ifbool{minted@canexec}%
+ {\ifbool{minted@diddetectconfig}{\minted@clean@i}{}}%
+ {}}
+\def\minted@clean@i{%
+ \ifnum\value{minted@numcachefiles}>0\relax
+ \expandafter\minted@savecachelist
+ \fi
+ \ifbool{minted@fasthighlightmode}%
+ {}%
+ {\minted@exec@clean
+ \global\boolfalse{minted@canexec}}}
+\def\minted@savecachelist{%
+ \pydatasetfilename{\MintedDataFilename}%
+ \minted@fasthighlightmode@checkstart
+ \pydatawritedictopen
+ \pydatawritekeyvalue{command}{clean}%
+ \pydatawritekeyedefvalue{jobname}{\jobname}%
+ \pydatawritekeyedefvalue{timestamp}{\minted@timestamp}%
+ \pydatawritekeyedefvalue{cachepath}{\minted@cachepath}%
+ \pydatawritekey{cachefiles}%
+ \pydatawritemlvaluestart
+ \pydatawritemlvalueline{[}%
+ \setcounter{minted@tmpcnt}{1}%
+ \loop\unless\ifnum\value{minted@tmpcnt}>\value{minted@numcachefiles}\relax
+ \expandafter\minted@savecachelist@writecachefile\expandafter{%
+ \csname minted@cachefile\arabic{minted@tmpcnt}\endcsname}%
+ \expandafter\global\expandafter
+ \let\csname minted@cachefile\arabic{minted@tmpcnt}\endcsname\minted@undefined
+ \stepcounter{minted@tmpcnt}%
+ \repeat
+ \setcounter{minted@numcachefiles}{0}%
+ \pydatawritemlvalueline{]}%
+ \pydatawritemlvalueend
+ \pydatawritedictclose
+ \ifbool{minted@fasthighlightmode}{}{\pydataclosefilename{\MintedDataFilename}}}
+\begingroup
+\catcode`\"=12
+\catcode`\,=12
+\gdef\minted@savecachelist@writecachefile#1{%
+ \expandafter\pydatawritemlvalueline\expandafter{\expandafter"#1",}}
+\endgroup
+\AfterEndDocument{%
+ \minted@clean
+ \minted@fasthighlightmode@checkend}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\MintedPygmentize}
-% We need a way to customize the executable/script that is called to perform highlighting. Typically, we will want |pygmentize|. But advanced users might wish to use a custom Python script instead. The command is only defined if it does not exist. In general, the command should be |\renewcommand|ed after the package is loaded, but this way, it will work if defined before \texpkg{minted} is loaded.
+%
+% \subsubsection{Style definitions}
+%
+%
+% \begin{macro}{\minted@patch@PygmentsStyledef}
+% The macros generated by Pygments must be patched: the single quote macro is redefined for \texpkg{upquote} compatibility, and the hyphen is redefined to prevent unintended line breaks under LuaTeX.
% \begin{macrocode}
-\ifcsname MintedPygmentize\endcsname\else
- \newcommand{\MintedPygmentize}{pygmentize}
-\fi
+\def\minted@patch@PygmentsZsq{%
+ \ifcsname\minted@styleprefix Zsq\endcsname
+ \ifcsstring{\minted@styleprefix Zsq}{\char`\'}{\minted@patch@PygmentsZsq@i}{}%
+ \fi}
+\begingroup
+\catcode`\'=\active
+\gdef\minted@patch@PygmentsZsq@i{\def\PYGZsq{'}}
+\endgroup
+\def\minted@patch@PygmentsZhy{%
+ \ifcsname\minted@styleprefix Zhy\endcsname
+ \ifcsstring{\minted@styleprefix Zhy}{\char`\-}{\def\PYGZhy{\mbox{-}}}{}%
+ \fi}
+\def\minted@patch@ignorelexererrors{%
+ \edef\minted@tmp{\mintedtexoptvalueof{ignorelexererrors}}%
+ \ifdefstring{\minted@tmp}{true}%
+ {\expandafter\let\csname\minted@styleprefix @tok@err\endcsname\relax}%
+ {}}
+\def\minted@patch@PygmentsStyledef{%
+ \minted@patch@PygmentsZsq
+ \minted@patch@PygmentsZhy
+ \minted@patch@ignorelexererrors}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{minted@pygmentizecounter}
-% We need a counter to keep track of how many files have been pygmentized. This is primarily used with |finalizecache| for naming cache files sequentially in |listing<number>.pygtex| form.
+% \begin{macro}{\minted@VerbatimPygments}
+% Enable \texpkg{fancyvrb} features for Pygments macros.
% \begin{macrocode}
-\newcounter{minted@pygmentizecounter}
+\def\minted@VerbatimPygments{%
+ \expandafter\minted@VerbatimPygments@i\expandafter{%
+ \csname\minted@styleprefix\endcsname}}
+\def\minted@VerbatimPygments@i#1{%
+ \VerbatimPygments{#1}{#1}}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\MintedPython}
-% Python executable to be used for |autogobble|.
+% \begin{macro}{\minted@standardcatcodes}
+% Set standard catcodes. Used before |\input| of style definitions and in reading the optional argument of environments that wrap Pygments output.
% \begin{macrocode}
-\ifwindows
- \newcommand{\MintedPython}{python}
-\else
- \newcommand{\MintedPython}{python3}
-\fi
+\def\minted@standardcatcodes{%
+ \catcode`\\=0
+ \catcode`\{=1
+ \catcode`\}=2
+ \catcode`\#=6
+ \catcode`\ =10
+ \catcode`\@=11
+ \catcode`\`=12
+ \catcode`\==12
+ \catcode`\+=12
+ \catcode`\.=12
+ \catcode`\,=12
+ \catcode`\[=12
+ \catcode`\]=12
+ \catcode`\%=14}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\minted@check@MintedPython}
-% Check that |\MintedPython| is a valid executable before use. Swap |python| for |python3| and vice versa depending on what is available.
+% \begin{macro}{\minted@defstyle}
+% Define highlighting style macros.
% \begin{macrocode}
-\newcommand{\minted@check@MintedPython}{%
- \ifcsname minted@MintedPython@\MintedPython\endcsname
+\def\minted@defstyle{%
+ \edef\minted@tmp{\mintedtexoptvalueof{style}}%
+ \expandafter\minted@defstyle@i\expandafter{\minted@tmp}}
+\def\minted@defstyle@i#1{%
+ \minted@ifalphanumhyphenunderscore{#1}%
+ {\minted@defstyle@ii{#1}}%
+ {\minted@error{Highlighting style is set to "#1" but only style names with
+ alphanumeric characters, hyphens, and underscores are supported;
+ falling back to default style}%
+ \minted@defstyle@ii{default}}}
+\def\minted@defstyle@ii#1{%
+ \ifcsname minted@styledef@#1\endcsname
+ \expandafter\@firstoftwo
\else
- \let\minted@altpython\minted@undefined
- \ifdefstring{\MintedPython}{python}{\def\minted@altpython{python3}}{}%
- \ifdefstring{\MintedPython}{python3}{\def\minted@altpython{python}}{}%
- \ifx\minted@altpython\minted@undefined\relax
- \TestAppExists{\MintedPython}%
- \ifAppExists
- \expandafter\global\expandafter\let%
- \csname minted@MintedPython@\MintedPython\endcsname\relax
- \else
- \PackageError{minted}%
- {Failed to find Python executable \MintedPython;
- check Python installation (including PATH),
- or redefine \string\MintedPython}%
- {Failed to find Python executable \MintedPython;
- check Python installation (including PATH),
- or redefine \string\MintedPython}%
- \fi
- \else
- \ifcsname minted@MintedPython@\minted@altpython\endcsname
- \let\MintedPython\minted@altpython
- \else
- \TestAppExists{\MintedPython}%
- \ifAppExists
- \expandafter\global\expandafter\let%
- \csname minted@MintedPython@\MintedPython\endcsname\relax
- \else
- \TestAppExists{\minted@altpython}%
- \ifAppExists
- \expandafter\global\expandafter\let%
- \csname minted@MintedPython@\minted@altpython\endcsname\relax
- \let\MintedPython\minted@altpython
- \else
- \PackageError{minted}%
- {Failed to find Python executables python or python3;
- check Python installation (including PATH),
- or redefine \string\MintedPython}%
- {Failed to find Python executables python or python3;
- check Python installation (including PATH),
- or redefine \string\MintedPython}%
- \fi
- \fi
- \fi
- \fi
+ \expandafter\@secondoftwo
\fi
-}
+ {\csname minted@styledef@#1\endcsname
+ \minted@patch@PygmentsStyledef
+ \minted@VerbatimPygments}%
+ {\minted@defstyle@load{#1}}}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\minted@pygmentize}
-%
-% Pygmentize a file (default: |\minted@outputdir\minted@jobname.pyg|) using the options provided.
-%
-% Unfortunately, the logic for caching is a little complex due to operations that are OS- and engine-dependent.
-%
-% The name of cached files is the result of concatenating the md5 of the code and the md5 of the command. This results in a filename that is longer than ideal (64 characters plus path and extension). Unfortunately, this is the only robust approach that is possible using the built-in pdfTeX hashing capabilities.\footnote{It would be possible to use only the cache of the code, but that approach breaks down as soon as the code is used multiple times with different options. While that may seem unlikely in practice, it occurs in this documentation and may be expected to occur in other docs.} LuaTeX could do better, by hashing the command and code together. The Python script that provides XeTeX capabilities simply runs both the command and the code through a single sha1 hasher, but has the additional overhead of the |\write18| call and Python execution.
-%
-% One potential concern is that caching should also keep track of the command from which code originates. What if identical code is highlighted with identical settings in both the |minted| environment and |\mintinline| command? In both cases, what is actually saved by Pygments is identical. The difference in final appearance is due to how the environment and command treat the Pygments output.
-%
-% \textbf{This macro must always be checked carefully whenever it is modified.} Under no circumstances should |#1| be written to or opened by Python in write mode. When |\inputminted| is used, |#1| will be an external file that is brought in for highlighting, so it must be left intact.
-%
-% At the very beginning, a check is performed to make sure that style macros exist. This must be done before the highlighted content is generated, so that temp file names can be shared without accidental overwriting. Styles are generated here, rather than when a style is set, so that creating the style macros is done as late as possible in case a custom |pygmentize| is in use via |\MintedPygmentize|.
+% \begin{macro}{\minted@defstyle@load}
+% Certain catcodes are required when loading Pygments style definitions from file.
+% \begin{itemize}
+% \item At sign |@| would be handled by the |\makeatletter| within the Pygments style definition if the style were brought in via |\input|, but |\makeatletter| doesn't affect tokenization with the |catchfile| approach.
+% \item Percent |%| may not have its normal meaning within a |.dtx| file.
+% \item Backtick |`| is made active by some \texpkg{babel} package options, such as |magyar|.
+% \item Catcodes for other symbolic/non-alphanumeric characters may (probably rarely) not have their normal definitions.
+% \end{itemize}
+% |\endlinechar| also requires special handling to avoid introducing unwanted spaces.
%
+% The |\begingroup...\endgroup| around |\minted@exec@styledef| and associated messages is necessary to prevent errors related to the message file. If a style does not exist, then the Python executable will create a |_<hash>.message.minted| file, which is brought in via |\InputIfFileExists| and generates an error message. After this, there is an attempt to load the default style. If the default style needs to be generated, then |\InputIfFileExists| will attempt to bring in a |_<hash>.message.minted| file regardless of whether it exists, unless it is wrapped in the |\begingroup...\endgroup|.
% \begin{macrocode}
-\ifwindows
- \def\minted@opt@quote#1{\detokenize{"#1"}}
-\else
- \def\minted@opt@quote#1{\detokenize{'#1'}}
-\fi
-\newcommand{\minted@pygmentize}[2][\minted@outputdir\minted@jobname.pyg]{%
- \minted@defstyle{\minted@get@opt{style}{default}}%
- \stepcounter{minted@pygmentizecounter}%
- \ifthenelse{\equal{\minted@get@opt{autogobble}{false}}{true}}%
- {\def\minted@codefile{\minted@outputdir\minted@jobname.pyg}}%
- {\def\minted@codefile{#1}}%
- \ifthenelse{\boolean{minted@isinline}}%
- {\def\minted@optlistcl@inlines{%
- \minted@optlistcl@g@i
- \csname minted@optlistcl@lang\minted@lang @i\endcsname}}%
- {\let\minted@optlistcl@inlines\@empty}%
- \def\minted@cmd{%
- \ifminted@kpsewhich
- \ifwindows
- \detokenize{for /f "usebackq tokens=*"}\space\@percentchar\detokenize{a in (`kpsewhich}\space\minted@codefile\detokenize{`) do}\space
- \fi
+\def\minted@catchfiledef#1#2{%
+ \CatchFileDef{#1}{#2}{\minted@standardcatcodes\endlinechar=-1}}
+\def\minted@defstyle@load#1{%
+ \minted@detectconfig
+ \ifbool{minted@cache}%
+ {\edef\minted@styledeffilename{#1\detokenize{.style.minted}}%
+ \edef\minted@styledeffilepath{\minted@cachepath\minted@styledeffilename}%
+ \IfFileExists{\minted@styledeffilepath}%
+ {\minted@defstyle@input{#1}}%
+ {\ifbool{minted@canexec}%
+ {\minted@defstyle@generate{#1}}%
+ {\minted@error{Missing definition for highlighting style "#1" (minted executable
+ is unavailable or disabled); attempting to substitute fallback style}%
+ \minted@defstyle@fallback{#1}}}}%
+ {\edef\minted@styledeffilename{%
+ \detokenize{_}\MintedJobnameMdfive\detokenize{.style.minted}}%
+ \let\minted@styledeffilepath\minted@styledeffilename
+ \ifbool{minted@canexec}%
+ {\minted@defstyle@generate{#1}}%
+ {\minted@error{Missing definition for highlighting style "#1" (minted executable
+ is unavailable or disabled); attempting to substitute fallback style}%
+ \minted@defstyle@fallback{#1}}}}
+\def\minted@defstyle@input#1{%
+ \begingroup
+ \minted@catchfiledef{\minted@tmp}{\minted@styledeffilepath}%
+ \minted@tmp
+ \ifcsname\minted@styleprefix\endcsname
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {\expandafter\global\expandafter\let\csname minted@styledef@#1\endcsname\minted@tmp
+ \endgroup
+ \ifbool{minted@cache}{\minted@addcachefilename{\minted@styledeffilename}}{}%
+ \csname minted@styledef@#1\endcsname
+ \minted@patch@PygmentsStyledef
+ \minted@VerbatimPygments}%
+ {\endgroup
+ \ifbool{minted@canexec}%
+ {\minted@warning{Invalid or corrupted style definition file
+ "\minted@styledeffilename"; attempting to regenerate}%
+ \minted@defstyle@generate{#1}}%
+ {\minted@error{Invalid or corrupted style definition file
+ "\minted@styledeffilename"; attempting to substitute fallback style
+ (minted executable is unavailable or disabled)}%
+ \minted@defstyle@fallback{#1}}}}
+\def\minted@defstyle@generate#1{%
+ \pydatasetfilename{\MintedDataFilename}%
+ \minted@fasthighlightmode@checkstart
+ \pydatawritedictopen
+ \pydatawritekeyvalue{command}{styledef}%
+ \pydatawritekeyedefvalue{jobname}{\jobname}%
+ \pydatawritekeyedefvalue{timestamp}{\minted@timestamp}%
+ \pydatawritekeyedefvalue{currentfilepath}{\CurrentFilePath}%
+ \pydatawritekeyedefvalue{currentfile}{\CurrentFile}%
+ \pydatawritekeyedefvalue{inputlineno}{\the\inputlineno}%
+ \pydatawritekeyedefvalue{cachepath}{\minted@cachepath}%
+ \pydatawritekeyedefvalue{styledeffilename}{\minted@styledeffilename}%
+ \pydatawritekeyvalue{style}{#1}%
+ \pydatawritekeyedefvalue{commandprefix}{\minted@styleprefix}%
+ \pydatawritedictclose
+ \ifbool{minted@fasthighlightmode}%
+ {\minted@defstyle@fallback{#1}}%
+ {\pydataclosefilename{\MintedDataFilename}%
+ \begingroup
+ \minted@exec@styledef
+ \ifx\minted@exec@warning\relax
+ \else
+ \expandafter\minted@exec@warning
\fi
- \MintedPygmentize\space -l \minted@opt@quote{#2}
- -f latex -P commandprefix=PYG -F tokenmerge
- \minted@optlistcl@g \csname minted@optlistcl@lang\minted@lang\endcsname
- \minted@optlistcl@inlines
- \minted@optlistcl@cmd -o \minted@outputdir\minted@infile\space
- \ifminted@kpsewhich
- \ifwindows
- \@percentchar\detokenize{a}%
- \else
- \detokenize{`}kpsewhich \minted@codefile\space
- \detokenize{||} \minted@codefile\detokenize{`}%
- \fi
+ \ifx\minted@exec@error\relax
+ \expandafter\minted@defstyle@generate@i
\else
- \minted@codefile
- \fi}%
- % For debugging, uncomment: %%%%
- % \immediate\typeout{\minted@cmd}%
- % %%%%
- \ifthenelse{\boolean{minted@cache}}%
- {%
- \ifminted@frozencache
- \else
- \ifthenelse{\equal{\minted@get@opt{autogobble}{false}}{true}}%
- {\edef\minted@hash{%
- \pdf@filemdfivesum{#1}%
- \pdf@mdfivesum{\minted@cmd\space%
- autogobble(\the\numexpr\FancyVerbStartNum\relax-%
- \the\numexpr\FancyVerbStopNum\relax)}}}%
- {\edef\minted@hash{%
- \pdf@filemdfivesum{#1}%
- \pdf@mdfivesum{\minted@cmd}}}%
- \edef\minted@infile{\minted@cachedir/\minted@hash.pygtex}%
- \IfFileExists{\minted@infile}{}{%
- \ifthenelse{\equal{\minted@get@opt{autogobble}{false}}{true}}{%
- \minted@autogobble{#1}}{}%
- \ShellEscape{\minted@cmd}}%
- \fi
- \ifthenelse{\boolean{minted@finalizecache}}%
- {%
- \edef\minted@cachefilename{listing\arabic{minted@pygmentizecounter}.pygtex}%
- \edef\minted@actualinfile{\minted@cachedir/\minted@cachefilename}%
- \ifwindows
- \StrSubstitute{\minted@infile}{/}{\@backslashchar}[\minted@infile@windows]
- \StrSubstitute{\minted@actualinfile}{/}{\@backslashchar}[\minted@actualinfile@windows]
- \ShellEscape{move /y \minted@outputdir\minted@infile@windows\space\minted@outputdir\minted@actualinfile@windows}%
- \else
- \ShellEscape{mv -f \minted@outputdir\minted@infile\space\minted@outputdir\minted@actualinfile}%
- \fi
- \let\minted@infile\minted@actualinfile
- \expandafter\minted@addcachefile\expandafter{\minted@cachefilename}%
- }%
- {\ifthenelse{\boolean{minted@frozencache}}%
- {%
- \edef\minted@cachefilename{listing\arabic{minted@pygmentizecounter}.pygtex}%
- \edef\minted@infile{\minted@cachedir/\minted@cachefilename}%
- \expandafter\minted@addcachefile\expandafter{\minted@cachefilename}}%
- {\expandafter\minted@addcachefile\expandafter{\minted@hash.pygtex}}%
- }%
- \minted@inputpyg}%
- {%
- \ifthenelse{\equal{\minted@get@opt{autogobble}{false}}{true}}{%
- \minted@autogobble{#1}}{}%
- \ShellEscape{\minted@cmd}%
- \minted@inputpyg}%
-}
+ \expandafter\minted@defstyle@generate@error
+ \fi
+ {#1}}}
+\def\minted@defstyle@generate@i#1{%
+ \endgroup
+ \begingroup
+ \minted@catchfiledef{\minted@tmp}{\minted@styledeffilepath}%
+ \minted@tmp
+ \ifcsname\minted@styleprefix\endcsname
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {\expandafter\global\expandafter\let\csname minted@styledef@#1\endcsname\minted@tmp
+ \endgroup
+ \ifbool{minted@cache}{\minted@addcachefilename{\minted@styledeffilename}}{}%
+ \csname minted@styledef@#1\endcsname
+ \minted@patch@PygmentsStyledef
+ \minted@VerbatimPygments}%
+ {\endgroup
+ \minted@error{Failed to create style definition file "\minted@styledeffilename"
+ (no error message, see "\MintedErrlogFilename" if it exists);
+ attempting to substitute fallback style}%
+ \minted@defstyle@fallback{#1}}}
+\def\minted@defstyle@generate@error#1{%
+ \minted@exec@error
+ \endgroup
+ \minted@defstyle@fallback{#1}}
+\def\minted@defstyle@fallback#1{%
+ \ifstrequal{#1}{default}%
+ {\expandafter\global\expandafter
+ \let\csname minted@styledef@default\endcsname\minted@styledeffallback}%
+ {\ifcsname minted@styledef@default\endcsname
+ \else
+ \minted@defstyle@load{default}%
+ \fi
+ \expandafter\let\expandafter\minted@tmp\csname minted@styledef@default\endcsname
+ \expandafter\global\expandafter\let\csname minted@styledef@#1\endcsname\minted@tmp}}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\minted@autogobble}
-% Remove common leading whitespace.
+% \begin{macro}{\minted@styledeffallback}
+% Basic style definition to make |.highlight.minted| cache files usable if no styles exist, not even the default style, and no styles can be generated.
% \begin{macrocode}
-\def\minted@autogobble#1{%
- \edef\minted@argone@esc{#1}%
- \StrSubstitute{\minted@argone@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted@argone@esc]%
- \StrSubstitute{\minted@argone@esc}{"}{\@backslashchar"}[\minted@argone@esc]%
- \edef\minted@tmpfname@esc{\minted@outputdir\minted@jobname}%
- \StrSubstitute{\minted@tmpfname@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted@tmpfname@esc]%
- \StrSubstitute{\minted@tmpfname@esc}{"}{\@backslashchar"}[\minted@tmpfname@esc]%
- %Need a version of open() that supports encoding under Python 2
- \minted@check@MintedPython
- \edef\minted@autogobblecmd{%
- \ifminted@kpsewhich
- \ifwindows
- \detokenize{for /f "usebackq tokens=*" }\@percentchar\detokenize{a in (`kpsewhich} #1\detokenize{`) do}\space
- \fi
- \fi
- \MintedPython\detokenize{ -c "import sys; import os;
- import textwrap;
- from io import open;
- fname = }%
- \ifminted@kpsewhich
- \detokenize{sys.argv[1];}\space
- \else
- \detokenize{os.path.expanduser(os.path.expandvars(\"}\minted@argone@esc\detokenize{\"));}\space
- \fi
- \detokenize{f = open(fname, \"r\", encoding=\"}\minted@encoding\detokenize{\") if os.path.isfile(fname) else None;
- t = f.readlines() if f is not None else None;
- t_opt = t if t is not None else [];
- f.close() if f is not None else None;
- tmpfname = os.path.expanduser(os.path.expandvars(\"}\minted@tmpfname@esc.pyg\detokenize{\"));
- f = open(tmpfname, \"w\", encoding=\"}\minted@encoding\detokenize{\") if t is not None else None;
- fvstartnum = }\the\numexpr\FancyVerbStartNum\detokenize{;
- fvstopnum = }\the\numexpr\FancyVerbStopNum\detokenize{;
- s = max(0, fvstartnum-1);
- e = max(s, fvstopnum) if fvstopnum > 0 else len(t_opt);
- [f.write(textwrap.dedent(\"\".join(x))) for x in (t_opt[0:s], t_opt[s:e], t_opt[e:]) if x and t is not None];
- f.close() if t is not None else os.remove(tmpfname);"}%
- \ifminted@kpsewhich
- \ifwindows
- \space\@percentchar\detokenize{a}%
- \else
- \space\detokenize{`}kpsewhich #1\space\detokenize{||} #1\detokenize{`}%
- \fi
- \fi
- }%
- \ShellEscape{\minted@autogobblecmd}%
-}
+\def\minted@styledeffallback{%
+ \expandafter\def\csname\minted@styleprefix\endcsname##1##2{##2}%
+ \expandafter\def\csname\minted@styleprefix Zbs\endcsname{\char`\\}%
+ \expandafter\def\csname\minted@styleprefix Zus\endcsname{\char`\_}%
+ \expandafter\def\csname\minted@styleprefix Zob\endcsname{\char`\{}%
+ \expandafter\def\csname\minted@styleprefix Zcb\endcsname{\char`\}}%
+ \expandafter\def\csname\minted@styleprefix Zca\endcsname{\char`\^}%
+ \expandafter\def\csname\minted@styleprefix Zam\endcsname{\char`\&}%
+ \expandafter\def\csname\minted@styleprefix Zlt\endcsname{\char`\<}%
+ \expandafter\def\csname\minted@styleprefix Zgt\endcsname{\char`\>}%
+ \expandafter\def\csname\minted@styleprefix Zsh\endcsname{\char`\#}%
+ \expandafter\def\csname\minted@styleprefix Zpc\endcsname{\char`\%}%
+ \expandafter\def\csname\minted@styleprefix Zdl\endcsname{\char`\$}%
+ \expandafter\def\csname\minted@styleprefix Zhy\endcsname{\char`\-}%
+ \expandafter\def\csname\minted@styleprefix Zsq\endcsname{\char`\'}%
+ \expandafter\def\csname\minted@styleprefix Zdq\endcsname{\char`\"}%
+ \expandafter\def\csname\minted@styleprefix Zti\endcsname{\char`\~}%
+ \minted@patch@PygmentsStyledef
+ \minted@VerbatimPygments}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\minted@inputpyg}
-% For increased clarity, the actual |\input| process is separated out into its own macro.
%
-% At the last possible moment, |\PYG| is |\let| to |\PYG|\meta{style} and redefined to used appropriate line breaking via |\VerbatimPygments| from \texpkg{fvextra}.
+% \subsubsection{Lexer-specific line numbering}
+%
%
-% The |bgcolor| option needs to be dealt with in different ways depending on whether we are using |\mintinline|. It is simplest to apply this option here, so that the macro redefinitions may be local and thus do not need to be manually reset later.
+% \begin{macro}{minted@FancyVerbLineTemp}
+% Temporary counter for storing and then restoring the value of |FancyVerbLine|. When using the |lexerlinenos| option, we need to store the current value of |FancyVerbLine|, then set |FancyVerbLine| to the current value of a lexer-specific counter, and finally restore |FancyVerbLine| to its initial value after the current chunk of code has been typeset.
% \begin{macrocode}
-\newcommand{\minted@inputpyg}{%
- \VerbatimPygments{\PYG}{\PYG}%
- \ifthenelse{\boolean{minted@isinline}}%
- {\ifthenelse{\equal{\minted@get@opt{breaklines}{false}}{true}}%
- {\let\FV@BeginVBox\relax
- \let\FV@EndVBox\relax
- \def\FV@BProcessLine##1{\FancyVerbFormatLine{##1}}%
- \minted@inputpyg@inline}%
- {\minted@inputpyg@inline}}%
- {\minted@inputpyg@block}%
-}
-\def\minted@inputpyg@inline{%
- \ifthenelse{\equal{\minted@get@opt{bgcolor}{}}{}}%
- {\minted@input{\minted@outputdir\minted@infile}}%
- {\colorbox{\minted@get@opt{bgcolor}{}}{%
- \minted@input{\minted@outputdir\minted@infile}}}%
-}
-\def\minted@inputpyg@block{%
- \ifthenelse{\equal{\minted@get@opt{bgcolor}{}}{}}%
- {\minted@input{\minted@outputdir\minted@infile}}%
- {\begin{minted@colorbg}{\minted@get@opt{bgcolor}{}}%
- \minted@input{\minted@outputdir\minted@infile}%
- \end{minted@colorbg}}}
+\newcounter{minted@FancyVerbLineTemp}
% \end{macrocode}
% \end{macro}
%
-%
-% We need a way to have line counters on a per-language basis.
-%
-% \begin{macro}{\minted@langlinenoson}
+% \begin{macro}{\minted@lexerlinenoson,\minted@lexerlinenosoff,\minted@inputlexerlinenoson,\minted@inputlexerlinenosoff}
+% Line counters on a per-lexer basis for |minted| and |\mintinline|; line counters on a per-lexer basis for |\inputminted|.
% \begin{macrocode}
-\newcommand{\minted@langlinenoson}{%
- \ifcsname c@minted@lang\minted@lang\endcsname\else
- \newcounter{minted@lang\minted@lang}%
+\def\minted@lexerlinenoson{%
+ \ifcsname c@minted@lexer\minted@lexer\endcsname
+ \else
+ \newcounter{minted@lexer\minted@lexer}%
\fi
\setcounter{minted@FancyVerbLineTemp}{\value{FancyVerbLine}}%
- \setcounter{FancyVerbLine}{\value{minted@lang\minted@lang}}%
-}
+ \setcounter{FancyVerbLine}{\value{minted@lexer\minted@lexer}}}
+\def\minted@lexerlinenosoff{%
+ \setcounter{minted@lexer\minted@lexer}{\value{FancyVerbLine}}%
+ \setcounter{FancyVerbLine}{\value{minted@FancyVerbLineTemp}}}
+\ifbool{minted@inputlexerlinenos}%
+ {\let\minted@inputlexerlinenoson\minted@lexerlinenoson
+ \let\minted@inputlexerlinenosoff\minted@lexerlinenosoff}%
+ {\let\minted@inputlexerlinenoson\relax
+ \let\minted@inputlexerlinenosoff\relax
+ \ifbool{minted@lexerlinenos}
+ {}%
+ {\let\minted@lexerlinenoson\relax
+ \let\minted@lexerlinenosoff\relax}}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\minted@langlinenosoff}
%
+% \begin{macro}{\minted@codewrapper}
+% Wrapper around typeset code. |\minted@inputfilepath| will exist when the code is brought in from an external file.
% \begin{macrocode}
-\newcommand{\minted@langlinenosoff}{%
- \setcounter{minted@lang\minted@lang}{\value{FancyVerbLine}}%
- \setcounter{FancyVerbLine}{\value{minted@FancyVerbLineTemp}}%
-}
+\def\minted@codewrapper#1{%
+ \ifcsname minted@inputfilepath\endcsname
+ \minted@inputlexerlinenoson
+ \else
+ \minted@lexerlinenoson
+ \fi
+ #1%
+ \ifcsname minted@inputfilepath\endcsname
+ \minted@inputlexerlinenosoff
+ \else
+ \minted@lexerlinenosoff
+ \fi}
% \end{macrocode}
% \end{macro}
%
%
-% Disable the language-specific settings if the package option isn't used.
-% \begin{macrocode}
-\ifbool{minted@langlinenos}{}{%
- \ifbool{minted@inputlanglinenos}{}{%
- \let\minted@langlinenoson\relax
- \let\minted@langlinenosoff\relax
- }
-}
-% \end{macrocode}
%
-% \begin{macro}{\minted@inputlanglinenoson}
-% \begin{macro}{\minted@inputlanglinenosoff}
-% Language-specific settings that apply to |\inputminted| in addition to |minted| and |\mintinline|.
+% \subsubsection{Highlighting code}
+%
+%
+% \begin{macro}{\minted@highlight,\minted@highlightinputfile}
+% Highlight code previously stored in buffer |minted@tmpdatabuffer|, or code in an external file.
+%
+% |\minted@defstyle| will invoke |\minted@detectconfig| the first time a style is loaded, so no separate |\minted@detectconfig| is needed.
+%
+% The default |\minted@highlight@fallback| inserts a placeholder. Typically commands/environments will redefine the fallback locally to inserted a verbatim approximation of code that could not be highlighted.
+%
+% Python-related options are buffered/written under a |pyopt| namespace. This prevents the possibility of naming collisions between options and other data that must be passed to Python.
+%
+% Some data such as |jobname|, |timestamp|, and |cachepath| should be written to file, but not used in hashing because otherwise it would unnecessarily make the cache files dependent on irrelevant data.
% \begin{macrocode}
-\ifbool{minted@inputlanglinenos}%
- {\def\minted@inputlanglinenoson{\minted@langlinenoson}%
- \def\minted@inputlanglinenosoff{\minted@langlinenosoff}}%
- {\let\minted@inputlanglinenoson\relax
- \let\minted@inputlanglinenosoff\relax}
+\def\minted@debug@input{%
+ \ifbool{minted@debug}%
+ {\immediate\typeout{%
+ minted debug: \string\input\space at
+ \ifx\CurrentFile\@empty\else\CurrentFile\space\fi line \the\inputlineno}}%
+ {}}
+\def\minted@highlight{%
+ \minted@defstyle
+ \pydatasetbuffername{minted@tmpdatabuffer}%
+ \pydatabufferkeyvalue{command}{highlight}%
+ \pydatabufferkey{code}%
+ \pydatabuffermlvaluestart
+ \setcounter{minted@tmpcnt}{1}%
+ \loop\unless\ifnum\value{minted@tmpcnt}>\value{minted@tmpcodebufferlength}\relax
+ \expandafter\let\expandafter
+ \minted@tmp\csname minted@tmpcodebufferline\arabic{minted@tmpcnt}\endcsname
+ \expandafter\pydatabuffermlvalueline\expandafter{\minted@tmp}%
+ \stepcounter{minted@tmpcnt}%
+ \repeat
+ \pydatabuffermlvalueend
+ \minted@highlight@i}
+\def\minted@highlightinputfile{%
+ \minted@defstyle
+ \edef\minted@inputfilemdfivesum{\pdf@filemdfivesum{\minted@inputfilepath}}%
+ \ifx\minted@inputfilemdfivesum\@empty
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {\minted@error{Cannot find input file "\minted@inputfilepath"; inserting placeholder}%
+ \minted@insertplaceholder}%
+ {\pydatasetbuffername{minted@tmpdatabuffer}%
+ \pydatabufferkeyvalue{command}{highlight}%
+ \pydatabufferkeyedefvalue{inputfilepath}{\minted@inputfilepath}%
+ \pydatabufferkeyedefvalue{inputfilemdfivesum}{\minted@inputfilemdfivesum}%
+ \minted@highlight@i}}
+\def\minted@def@FV@GetKeyValues@standardcatcodes{%
+ \let\minted@FV@GetKeyValues@orig\FV@GetKeyValues
+ \def\FV@GetKeyValues##1{%
+ \begingroup
+ \minted@standardcatcodes
+ \minted@FV@GetKeyValues@i{##1}}%
+ \def\minted@FV@GetKeyValues@i##1[##2]{%
+ \endgroup
+ \let\FV@GetKeyValues\minted@FV@GetKeyValues@orig
+ \let\minted@FV@GetKeyValues@i\minted@undefined
+ \FV@GetKeyValues{##1}[##2]}}
+\def\minted@highlight@i{%
+ \pydatabufferkeyedefvalue{pyopt.lexer}{\minted@lexer}%
+ \pydatabufferkeyedefvalue{pyopt.commandprefix}{\minted@styleprefix}%
+ \minted@forcsvlist{\minted@highlight@bufferpykeys}{\minted@optkeyslist@py}%
+ \ifbool{minted@cache}%
+ {\edef\minted@highlightfilename{\pydatabuffermdfivesum\detokenize{.highlight.minted}}%
+ \edef\minted@highlightfilepath{\minted@cachepath\minted@highlightfilename}%
+ \IfFileExists{\minted@highlightfilepath}%
+ {\minted@codewrapper{%
+ \minted@def@FV@GetKeyValues@standardcatcodes
+ \minted@debug@input
+ \input{\minted@highlightfilepath}}%
+ \minted@addcachefilename{\minted@highlightfilename}}%
+ {\ifbool{minted@canexec}%
+ {\minted@highlight@create}%
+ {\minted@error{Cannot highlight code (minted executable is unavailable or
+ disabled); attempting to typeset without highlighting}%
+ \minted@highlight@fallback}}}%
+ {\edef\minted@highlightfilename{%
+ \detokenize{_}\MintedJobnameMdfive\detokenize{.highlight.minted}}%
+ \let\minted@highlightfilepath\minted@highlightfilename
+ \ifbool{minted@canexec}%
+ {\minted@highlight@create}%
+ {\minted@error{Cannot highlight code (minted executable is unavailable or
+ disabled); attempting to typeset without highlighting}%
+ \minted@highlight@fallback}}%
+ \pydataclearbuffername{minted@tmpdatabuffer}}
+\def\minted@highlight@bufferpykeys#1{%
+ \edef\minted@tmp{\mintedpyoptvalueof{#1}}%
+ \ifx\minted@tmp\minted@const@pgfkeysnovalue
+ \else
+ \pydatabufferkeyedefvalue{pyopt.#1}{\minted@tmp}%
+ \fi}
+\def\minted@highlight@create{%
+ \pydatasetfilename{\MintedDataFilename}%
+ \minted@fasthighlightmode@checkstart
+ \pydatawritedictopen
+ \pydatawritebuffer
+ \pydatawritekeyedefvalue{jobname}{\jobname}%
+ \pydatawritekeyedefvalue{timestamp}{\minted@timestamp}%
+ \pydatawritekeyedefvalue{currentfilepath}{\CurrentFilePath}%
+ \pydatawritekeyedefvalue{currentfile}{\CurrentFile}%
+ \pydatawritekeyedefvalue{inputlineno}{\the\inputlineno}%
+ \pydatawritekeyedefvalue{cachepath}{\minted@cachepath}%
+ \pydatawritekeyedefvalue{highlightfilename}{\minted@highlightfilename}%
+ \pydatawritedictclose
+ \ifbool{minted@fasthighlightmode}%
+ {\minted@insertplaceholder}%
+ {\pydataclosefilename{\MintedDataFilename}%
+ \begingroup
+ \minted@exec@highlight
+ \IfFileExists{\minted@highlightfilepath}%
+ {\ifx\minted@exec@warning\relax
+ \else
+ \expandafter\minted@exec@warning
+ \fi
+ \ifx\minted@exec@error\relax
+ \else
+ \expandafter\minted@exec@error
+ \fi
+ \endgroup
+ \minted@codewrapper{%
+ \minted@def@FV@GetKeyValues@standardcatcodes
+ \minted@debug@input
+ \input{\minted@highlightfilepath}}%
+ \ifbool{minted@cache}{\minted@addcachefilename{\minted@highlightfilename}}{}}%
+ {\ifx\minted@exec@warning\relax
+ \else
+ \expandafter\minted@exec@warning
+ \fi
+ \ifx\minted@exec@error\relax
+ \minted@error{Minted executable failed during syntax highlighting
+ but returned no error message (see if "\MintedErrlogFilename" exists)}%
+ \else
+ \expandafter\minted@exec@error
+ \fi
+ \endgroup
+ \minted@highlight@fallback}}}
+\def\minted@highlight@fallback{%
+ \minted@insertplaceholder}
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
%
%
% \subsection{Public API}
%
+%
% \begin{macro}{\setminted}
-% Set global or language-level options.
+% Set global or lexer-level options.
% \begin{macrocode}
\newcommand{\setminted}[2][]{%
- \ifthenelse{\equal{#1}{}}%
- {\setkeys{minted@opt@g}{#2}}%
- {\minted@configlang{#1}%
- \setkeys{minted@opt@lang}{#2}}}
+ \ifstrempty{#1}%
+ {\pgfkeys{/minted/global/.cd,#2}}%
+ {\let\minted@tmplexer\minted@lexer
+ \edef\minted@lexer{#1}%
+ \pgfkeys{/minted/lexer/.cd,#2}%
+ \let\minted@lexer\minted@tmplexer}}
% \end{macrocode}
% \end{macro}
%
+%
% \begin{macro}{\setmintedinline}
-% Set global or language-level options, but only for inline (|\mintinline|) content. These settings will override the corresponding |\setminted| settings.
+% Set global or lexer-level options, but only for inline (|\mintinline|) content. These settings will override the corresponding |\setminted| settings.
% \begin{macrocode}
\newcommand{\setmintedinline}[2][]{%
- \ifthenelse{\equal{#1}{}}%
- {\setkeys{minted@opt@g@i}{#2}}%
- {\minted@configlang{#1}%
- \setkeys{minted@opt@lang@i}{#2}}}
+ \ifstrempty{#1}%
+ {\pgfkeys{/minted/globalinline/.cd,#2}}%
+ {\let\minted@tmplexer\minted@lexer
+ \edef\minted@lexer{#1}%
+ \pgfkeys{/minted/lexerinline/.cd,#2}%
+ \let\minted@lexer\minted@tmplexer}}
% \end{macrocode}
% \end{macro}
%
-% Now that the settings macros exist, we go ahead and create any needed defaults.
-%
-% PHP should use |startinline| for |\mintinline|. Visible tabs should have a specified color so that they don't change colors when used to indent multiline strings or comments. Leading/trailing empty lines should be preserved by default.
-% \begin{macrocode}
-\setmintedinline[php]{startinline=true}
-\setminted{tabcolor=black}
-\setminted{stripnl=false}
-% \end{macrocode}
%
% \begin{macro}{\usemintedstyle}
-%
-% Set style. This is a holdover from version 1, since |\setminted| can now accomplish this, and a hierarchy of style settings are now possible.
+% Set style. This is a holdover from \mintedpkg\ v1, before |\setminted| could be used to set the style.
% \begin{macrocode}
\newcommand{\usemintedstyle}[2][]{\setminted[#1]{style=#2}}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\minted@defwhitespace@retok}
-% The |\mint| and |\mintinline| commands need to be able to retokenize the code they collect, particularly in |draft| mode. Retokenizeation involves expansion combined with |\scantokens|, with active space and tab characters. The active characters need to expand to the appropriate \texpkg{fancyvrb} macros, but the macros themselves should not be expanded. We need a macro that will accomplish the appropriate definitions.
-% \begin{macrocode}
-\begingroup
-\catcode`\ =\active
-\catcode`\^^I=\active
-\gdef\minted@defwhitespace@retok{\def {\noexpand\FV@Space}\def^^I{\noexpand\FV@Tab}}%
-\endgroup
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{macro}{\minted@writecmdcode}
-% The |\mintinline| and |\mint| commands will need to write the code they capture to a temporary file for highlighting. It will be convenient to be able to accomplish this via a simple macro, since that makes it simpler to deal with any expansion of what is to be written. This isn't needed for the |minted| environment, because the (patched) |VerbatimOut| is used.
-% \begin{macrocode}
-\newcommand{\minted@writecmdcode}[1]{%
- \immediate\openout\minted@code\minted@jobname.pyg\relax
- \immediate\write\minted@code{\detokenize{#1}}%
- \immediate\closeout\minted@code}
-% \end{macrocode}
-% \end{macro}
-%
-%
% \begin{macro}{\mintinline}
% Define an inline command. This is modeled after the reimplemented |\Verb| from \texpkg{fvextra}. See the \texpkg{fvextra} documentation for details about expansion handling, argument reading, and (re)tokenization.
%
-% Pygments emits code wrapped in a |Verbatim| environment. Getting the inline command to work correctly requires redefining |Verbatim| to be \texpkg{fvextra}'s |VerbEnv| temporarily.
-%
% Everything needs to be within a |\begingroup...\endgroup| to prevent settings from escaping.
%
-% In the case of |draft| mode, \texpkg{fvextra}'s |\Verb| is used directly.
+% |\RobustMintInlineProcess@verbatim| doesn't need an explicit |\FVExtraRetokenizeVArg| step because this is done when the code is inserted into |\Verb|.
% \begin{macrocode}
\def\mintinline{%
\FVExtraRobustCommand\RobustMintInline\FVExtraUnexpandedReadStarOArgMArgBVArg}
@@ -3372,37 +3791,56 @@
\ifbool{FVExtraRobustCommandExpanded}%
{\@ifnextchar\bgroup
{\FVExtraReadVArg{\RobustMintInlineProcess{#1}{#2}}}%
- {\PackageError{minted}%
- {Inline delimiters must be paired curly braces in this context}%
- {Use curly braces as delimiters}}}%
+ {\minted@error{Inline delimiters must be paired curly braces in this context}}}%
{\FVExtraReadVArg{\RobustMintInlineProcess{#1}{#2}}}}
-\def\RobustMintInlineProcess#1#2#3{%
+\def\RobustMintInlineProcess@highlight#1#2#3{%
\begingroup
- \setboolean{minted@isinline}{true}%
- \minted@configlang{#2}%
- \setkeys{minted@opt@cmd}{#1}%
- \minted@fvset
- \RobustMintInlineProcess@i{#3}}
-\ifthenelse{\boolean{minted@draft}}%
- {\def\RobustMintInlineProcess@i#1{%
- \fvset{extra=true}%
- \Verb{#1}%
- \endgroup}}%
- {\def\RobustMintInlineProcess@i#1{%
- \FVExtraDetokenizeVArg{%
- \FVExtraRetokenizeVArg{\RobustMintInlineProcess@ii}{\FV@CatCodes}}{#1}}
- \def\RobustMintInlineProcess@ii#1{%
- \minted@writecmdcode{#1}%
- \let\Verbatim\VerbEnv
- \let\endVerbatim\endVerbEnv
- \expandafter\minted@pygmentize\expandafter{\minted@lang}%
- \endgroup}}
+ \booltrue{minted@isinline}%
+ \ifstrempty{#1}{}{\pgfkeys{/minted/cmd/.cd,#1}}%
+ \edef\minted@lexer{#2}%
+ \minted@usefvopts
+ \minted@usetexoptsnonpygments
+ \FVExtraDetokenizeVArg{%
+ \FVExtraRetokenizeVArg{\RobustMintInlineProcess@highlight@i}{\FV@CatCodes}}{#3}}
+\def\RobustMintInlineProcess@highlight@i#1{%
+ \expandafter\def\csname minted@tmpcodebufferline1\endcsname{#1}%
+ \setcounter{minted@tmpcodebufferlength}{1}%
+ \let\minted@highlight@fallback\RobustMintInlineProcess@highlight@fallback
+ \minted@highlight
+ \setcounter{minted@tmpcodebufferlength}{0}%
+ \endgroup}
+\def\RobustMintInlineProcess@highlight@fallback{%
+ \minted@useadditionalfvoptsnopy
+ \fvset{extra=true}%
+ \minted@codewrapper{%
+ \expandafter\let\expandafter\minted@tmp\csname minted@tmpcodebufferline1\endcsname
+ \expandafter\Verb\expandafter{\minted@tmp}}}
+\def\RobustMintInlineProcess@placeholder#1#2#3{%
+ \begingroup
+ \booltrue{minted@isinline}%
+ \minted@insertplaceholder
+ \endgroup}
+\def\RobustMintInlineProcess@verbatim#1#2#3{%
+ \begingroup
+ \booltrue{minted@isinline}%
+ \ifstrempty{#1}{}{\pgfkeys{/minted/cmd/.cd,#1}}%
+ \edef\minted@lexer{#2}%
+ \minted@usefvopts
+ \minted@useadditionalfvoptsnopy
+ \minted@usetexoptsnonpygments
+ \fvset{extra=true}%
+ \minted@codewrapper{\Verb{#3}}%
+ \endgroup}
+\ifbool{minted@placeholder}%
+ {\let\RobustMintInlineProcess\RobustMintInlineProcess@placeholder}%
+ {\ifbool{minted@verbatim}%
+ {\let\RobustMintInlineProcess\RobustMintInlineProcess@verbatim}%
+ {\let\RobustMintInlineProcess\RobustMintInlineProcess@highlight}}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\mint}
-%
% Highlight a single line of code. This is essentially a shortcut for the \env{minted} environment when there is only a single line of code. The implementation follows \cmd{\mintinline} for argument reading and processing, but then typesets the code as an environment rather than command. The \cmd{\@doendpe} ensures proper paragraph indentation for following text (immediately following text with no intervening blank lines does not begin a new paragraph).
% \begin{macrocode}
\def\mint{%
@@ -3413,161 +3851,202 @@
\ifbool{FVExtraRobustCommandExpanded}%
{\@ifnextchar\bgroup
{\FVExtraReadVArg{\RobustMintProcess{#1}{#2}}}%
- {\PackageError{minted}%
- {Delimiters must be paired curly braces in this context}%
- {Use curly braces as delimiters}}}%
+ {\minted@error{Delimiters must be paired curly braces in this context}}}%
{\FVExtraReadVArg{\RobustMintProcess{#1}{#2}}}}
-\def\RobustMintProcess#1#2#3{%
+\def\RobustMintProcess@highlight#1#2#3{%
\begingroup
- \minted@configlang{#2}%
- \setkeys{minted@opt@cmd}{#1}%
- \minted@fvset
- \RobustMintProcess@i{#3}}
-\begingroup
-\catcode`\^^M=\active%
-\catcode`\<=1%
-\catcode`\>=2%
-\catcode`\{=12%
-\catcode`\}=12%
-\catcode`\!=0%
-\catcode`\\=12%
-!ifthenelse<!boolean<minted@draft>>%
- <!gdef!RobustMintProcess@i#1<%
- !FVExtraDetokenizeVArg<%
- !FVExtraRetokenizeVArg<!RobustMintProcess@ii><!FV@CatCodes>><#1>>%
- !gdef!RobustMintProcess@ii#1<%
- !minted@langlinenoson%
- !scantokens<%
- \begin{Verbatim}
- #1
- \end{Verbatim}
- !noexpand>%
- !minted@langlinenosoff%
- !endgroup!@doendpe>>%
- <!gdef!RobustMintProcess@i#1<%
- !FVExtraDetokenizeVArg<%
- !FVExtraRetokenizeVArg<!RobustMintProcess@ii><!FV@CatCodes>><#1>>%
- !gdef!RobustMintProcess@ii#1<%
- !minted@writecmdcode<#1>%
- !minted@langlinenoson%
- !expandafter!minted@pygmentize!expandafter<!minted@lang>%
- !minted@langlinenosoff%
- !endgroup!@doendpe>>%
-!endgroup
+ \ifstrempty{#1}{}{\pgfkeys{/minted/cmd/.cd,#1}}%
+ \edef\minted@lexer{#2}%
+ \minted@usefvopts
+ \minted@usetexoptsnonpygments
+ \FVExtraDetokenizeVArg{%
+ \FVExtraRetokenizeVArg{\RobustMintProcess@highlight@i}{\FV@CatCodes}}{#3}}
+\def\RobustMintProcess@highlight@i#1{%
+ \expandafter\def\csname minted@tmpcodebufferline1\endcsname{#1}%
+ \setcounter{minted@tmpcodebufferlength}{1}%
+ \let\minted@highlight@fallback\RobustMintProcess@highlight@fallback
+ \minted@highlight
+ \setcounter{minted@tmpcodebufferlength}{0}%
+ \endgroup}
+\def\RobustMintProcess@highlight@fallback{%
+ \minted@useadditionalfvoptsnopy
+ \minted@codewrapper{%
+ \VerbatimInsertBuffer[buffername=minted@tmpcodebuffer,insertenvname=\minted@envname]}}
+\def\RobustMintProcess@placeholder#1#2#3{%
+ \minted@insertplaceholder}
+\def\RobustMintProcess@verbatim#1#2#3{%
+ \begingroup
+ \ifstrempty{#1}{}{\pgfkeys{/minted/cmd/.cd,#1}}%
+ \edef\minted@lexer{#2}%
+ \minted@usefvopts
+ \minted@useadditionalfvoptsnopy
+ \minted@usetexoptsnonpygments
+ \FVExtraDetokenizeVArg{%
+ \FVExtraRetokenizeVArg{\RobustMintProcess@verbatim@i}{\FV@CatCodes}}{#3}}
+\def\RobustMintProcess@verbatim@i#1{%
+ \expandafter\def\csname minted@tmpcodebufferline1\endcsname{#1}%
+ \setcounter{minted@tmpcodebufferlength}{1}%
+ \minted@codewrapper{%
+ \VerbatimInsertBuffer[buffername=minted@tmpcodebuffer,insertenvname=\minted@envname]}%
+ \setcounter{minted@tmpcodebufferlength}{0}%
+ \endgroup}
+\ifbool{minted@placeholder}%
+ {\let\RobustMintProcess\RobustMintProcess@placeholder}%
+ {\ifbool{minted@verbatim}%
+ {\let\RobustMintProcess\RobustMintProcess@verbatim}%
+ {\let\RobustMintProcess\RobustMintProcess@highlight}}
% \end{macrocode}
% \end{macro}
%
%
% \begin{environment}{minted}
-%
% Highlight a longer piece of code inside a verbatim environment.
% \begin{macrocode}
-\ifthenelse{\boolean{minted@draft}}%
- {\newenvironment{minted}[2][]
- {\VerbatimEnvironment
- \minted@configlang{#2}%
- \setkeys{minted@opt@cmd}{#1}%
- \minted@fvset
- \minted@langlinenoson
- \begin{Verbatim}}%
- {\end{Verbatim}%
- \minted@langlinenosoff}}%
- {\newenvironment{minted}[2][]
- {\VerbatimEnvironment
- \let\FVB@VerbatimOut\minted@FVB@VerbatimOut
- \let\FVE@VerbatimOut\minted@FVE@VerbatimOut
- \minted@configlang{#2}%
- \setkeys{minted@opt@cmd}{#1}%
- \minted@fvset
- \begin{VerbatimOut}[codes={\catcode`\^^I=12},firstline,lastline]{\minted@jobname.pyg}}%
- {\end{VerbatimOut}%
- \minted@langlinenoson
- \expandafter\minted@pygmentize\expandafter{\minted@lang}%
- \minted@langlinenosoff}}
+\newenvironment{minted}[2][]%
+ {\VerbatimEnvironment
+ \MintedBegin{#1}{#2}}%
+ {\MintedEnd}
+\def\MintedBegin@highlight#1#2{%
+ \ifstrempty{#1}{}{\pgfkeys{/minted/cmd/.cd,#1}}%
+ \edef\minted@lexer{#2}%
+ \minted@usefvopts
+ \minted@usetexoptsnonpygments
+ \begin{VerbatimBuffer}[buffername=minted@tmpcodebuffer,globalbuffer=true]}
+\def\MintedEnd@highlight{%
+ \end{VerbatimBuffer}%
+ \let\minted@highlight@fallback\MintedEnv@highlight@fallback
+ \minted@highlight
+ \VerbatimClearBuffer[buffername=minted@tmpcodebuffer]}
+\def\MintedEnv@highlight@fallback{%
+ \minted@useadditionalfvoptsnopy
+ \minted@codewrapper{%
+ \VerbatimInsertBuffer[buffername=minted@tmpcodebuffer,insertenvname=\minted@envname]}}
+\def\MintedBegin@placeholder#1#2{%
+ \begin{VerbatimBuffer}[buffername=minted@tmpcodebuffer]}
+\def\MintedEnd@placeholder{%
+ \end{VerbatimBuffer}%
+ \minted@insertplaceholder}
+\def\MintedBegin@verbatim#1#2{%
+ \ifstrempty{#1}{}{\pgfkeys{/minted/cmd/.cd,#1}}%
+ \edef\minted@lexer{#2}%
+ \minted@usefvopts
+ \minted@useadditionalfvoptsnopy
+ \minted@usetexoptsnonpygments
+ \begin{\minted@envname}}
+\def\MintedEnd@verbatim{%
+ \end{\minted@envname}}
+\ifbool{minted@placeholder}%
+ {\let\MintedBegin\MintedBegin@placeholder
+ \let\MintedEnd\MintedEnd@placeholder}%
+ {\ifbool{minted@verbatim}%
+ {\let\MintedBegin\MintedBegin@verbatim
+ \let\MintedEnd\MintedEnd@verbatim}%
+ {\let\MintedBegin\MintedBegin@highlight
+ \let\MintedEnd\MintedEnd@highlight}}
% \end{macrocode}
% \end{environment}
%
-% \begin{macro}{\inputminted}
%
+% \begin{macro}{\inputminted}
% Highlight an external source file.
% \begin{macrocode}
-\ifthenelse{\boolean{minted@draft}}%
- {\newcommand{\inputminted}[3][]{%
- \begingroup
- \minted@configlang{#2}%
- \setkeys{minted@opt@cmd}{#1}%
- \minted@fvset
- \minted@inputlanglinenoson
- \VerbatimInput{#3}%
- \minted@inputlanglinenosoff
- \endgroup}}%
- {\newcommand{\inputminted}[3][]{%
- \begingroup
- \minted@configlang{#2}%
- \setkeys{minted@opt@cmd}{#1}%
- \minted@fvset
- \minted@inputlanglinenoson
- \minted@pygmentize[#3]{#2}%
- \minted@inputlanglinenosoff
- \endgroup}}
+\def\minted@readinputmintedargs#1#{%
+ \minted@readinputmintedargs@i{#1}}
+\def\minted@readinputmintedargs@i#1#2#3{%
+ \FVExtraAlwaysUnexpanded{\minted@readinputmintedargs#1{#2}{#3}}}
+\FVExtrapdfstringdefDisableCommands{%
+ \makeatletter
+ \def\minted@readinputmintedargs@i#1#2#3{%
+ \detokenize{<input from file "}#3\detokenize{">}}%
+ \makeatother}
+\def\inputminted{%
+ \FVExtraRobustCommand\RobustInputMinted\minted@readinputmintedargs}
+\FVExtrapdfstringdefDisableCommands{%
+ \def\RobustInputMinted{}}
+\newrobustcmd{\RobustInputMinted}[3][]{%
+ \RobustInputMintedProcess{#1}{#2}{#3}}
+\def\RobustInputMintedProcess@highlight#1#2#3{%
+ \begingroup
+ \ifstrempty{#1}{}{\pgfkeys{/minted/cmd/.cd,#1}}%
+ \edef\minted@lexer{#2}%
+ \edef\minted@inputfilepath{#3}%
+ \minted@usefvopts
+ \minted@usetexoptsnonpygments
+ \let\minted@highlight@fallback\RobustInputMintedProcess@highlight@fallback
+ \minted@highlightinputfile
+ \endgroup}
+\def\RobustInputMintedProcess@highlight@fallback{%
+ \minted@useadditionalfvoptsnopy
+ \minted@codewrapper{%
+ \csname\minted@envname Input\endcsname{\minted@inputfilepath}}}
+\def\RobustInputMintedProcess@placeholder#1#2#3{%
+ \minted@insertplaceholder}
+\def\RobustInputMintedProcess@verbatim#1#2#3{%
+ \begingroup
+ \ifstrempty{#1}{}{\pgfkeys{/minted/cmd/.cd,#1}}%
+ \edef\minted@lexer{#2}%
+ \edef\minted@inputfilepath{#3}%
+ \minted@usefvopts
+ \minted@useadditionalfvoptsnopy
+ \minted@usetexoptsnonpygments
+ \minted@codewrapper{%
+ \csname\minted@envname Input\endcsname{\minted@inputfilepath}}%
+ \endgroup}
+\ifbool{minted@placeholder}%
+ {\let\RobustInputMintedProcess\RobustInputMintedProcess@placeholder}%
+ {\ifbool{minted@verbatim}%
+ {\let\RobustInputMintedProcess\RobustInputMintedProcess@verbatim}%
+ {\let\RobustInputMintedProcess\RobustInputMintedProcess@highlight}}
% \end{macrocode}
% \end{macro}
%
%
+%
% \subsection{Command shortcuts}
%
-% We allow the user to define shortcuts for the highlighting commands.
+% Allow the user to define shortcuts for the highlighting commands.
%
% \begin{macro}{\newminted}
-%
% Define a new language-specific alias for the |minted| environment.
%
-% \begin{macrocode}
-\newcommand{\newminted}[3][]{
-% \end{macrocode}
-%
-% First, we look whether a custom environment name was given as the first
-% optional argument.
-% If that's not the case, construct it from the language name (append ``|code|'').
-%
-% \begin{macrocode}
- \ifthenelse{\equal{#1}{}}
- {\def\minted@envname{#2code}}
- {\def\minted@envname{#1}}
-% \end{macrocode}
-%
-% Now, we define two environments.
-% The first takes no further arguments.
-% The second, starred version, takes an extra argument that specifies option
-% overrides.
+% The starred |*| version of the environment takes a mandatory argument containing options. It is retained for backward compatibility purposes with \mintedpkg\ v1 and v2. \mintedpkg\ v3 added support for an optional argument to the standard environment, so the starred version is no longer necessary.
%
+% The |^^M| is needed because |\FVExtraReadOArgBeforeVEnv| strips a following |^^M| (basically the newline), but \texpkg{fancyvrb} environments expect |^^M| before the start of environment contents.
% \begin{macrocode}
- \newenvironment{\minted@envname}
- {\VerbatimEnvironment
- \begin{minted}[#3]{#2}}
- {\end{minted}}
- \newenvironment{\minted@envname *}[1]
- {\VerbatimEnvironment\begin{minted}[#3,##1]{#2}}
- {\end{minted}}}
+\newcommand{\newminted}[3][]{%
+ \ifstrempty{#1}%
+ {\newminted@i{#2code}{#2}{#3}}%
+ {\newminted@i{#1}{#2}{#3}}}
+\begingroup
+\catcode`\^^M=\active%
+\gdef\newminted@i#1#2#3{%
+ \expandafter\def\csname#1@i\endcsname##1{%
+ \begin{minted}[#3,##1]{#2}^^M}%
+ \newenvironment{#1}%
+ {\VerbatimEnvironment%
+ \FVExtraReadOArgBeforeVEnv{\csname#1@i\endcsname}}%
+ {\end{minted}}%
+ \newenvironment{#1*}[1]%
+ {\VerbatimEnvironment%
+ \begin{minted}[#3,##1]{#2}}%
+ {\end{minted}}}%
+\endgroup
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\newmint}
-%
% Define a new language-specific alias for the |\mint| short form.
% \begin{macrocode}
\newcommand{\newmint}[3][]{%
- \if\relax\detokenize{#1}\relax
- \def\minted@shortname{#2}%
- \else
- \def\minted@shortname{#1}%
- \fi
- \expandafter\newmint@i\expandafter{\minted@shortname}{#2}{#3}}
+ \ifstrempty{#1}%
+ {\edef\minted@tmp{#2}}%
+ {\edef\minted@tmp{#1}}
+ \expandafter\newmint@i\expandafter{\minted@tmp}{#2}{#3}}
\def\newmint@i#1#2#3{%
\expandafter\newcommand\csname#1\endcsname{%
\expandafter\FVExtraRobustCommand\csname RobustNewMint#1\endcsname
- \FVExtraUnexpandedReadStarOArgBVArg}%
+ \FVExtraUnexpandedReadStarOArgBVArg}%
\FVExtrapdfstringdefDisableCommands{%
\expandafter\def\csname RobustNewMint#1\endcsname{}}%
\expandafter\newrobustcmd\csname RobustNewMint#1\endcsname{%
@@ -3576,9 +4055,7 @@
\ifbool{FVExtraRobustCommandExpanded}%
{\@ifnextchar\bgroup
{\FVExtraReadVArg{\csname RobustNewMint#1@ii\endcsname{##1}}}%
- {\PackageError{minted}%
- {Delimiters must be paired curly braces in this context}%
- {Use curly braces as delimiters}}}%
+ {\minted@error{Delimiters must be paired curly braces in this context}}}%
{\FVExtraReadVArg{\csname RobustNewMint#1@ii\endcsname{##1}}}}
\expandafter\def\csname RobustNewMint#1@ii\endcsname##1##2{%
\RobustMintProcess{#3,##1}{#2}{##2}}}
@@ -3587,23 +4064,30 @@
%
%
% \begin{macro}{\newmintedfile}
-%
% Define a new language-specific alias for |\inputminted|.
% \begin{macrocode}
-\newcommand{\newmintedfile}[3][]{
-% \end{macrocode}
-% Here, the default macro name (if none is provided) appends ``|file|'' to the language name.
-% \begin{macrocode}
- \ifthenelse{\equal{#1}{}}
- {\def\minted@shortname{#2file}}
- {\def\minted@shortname{#1}}
-% \end{macrocode}
-%
-% \dots and define the macro.
-%
-% \begin{macrocode}
- \expandafter\newcommand\csname\minted@shortname\endcsname[2][]{
- \inputminted[#3,##1]{#2}{##2}}}
+\def\minted@readnewmintedfileargs#1#{%
+ \minted@readnewmintedfileargs@i{#1}}
+\def\minted@readnewmintedfileargs@i#1#2{%
+ \FVExtraAlwaysUnexpanded{\minted@readnewmintedfileargs#1{#2}}}
+\FVExtrapdfstringdefDisableCommands{%
+ \makeatletter
+ \def\minted@readnewmintedfileargs@i#1#2{%
+ \detokenize{<input from file "}#2\detokenize{">}}%
+ \makeatother}
+\newcommand{\newmintedfile}[3][]{%
+ \ifstrempty{#1}%
+ {\edef\minted@tmp{#2file}}%
+ {\edef\minted@tmp{#1}}%
+ \expandafter\newmintedfile@i\expandafter{\minted@tmp}{#2}{#3}}
+\def\newmintedfile@i#1#2#3{%
+ \expandafter\newcommand\csname#1\endcsname{%
+ \expandafter\FVExtraRobustCommand\csname RobustNewMintedFile#1\endcsname
+ \minted@readnewmintedfileargs}%
+ \FVExtrapdfstringdefDisableCommands{%
+ \expandafter\def\csname RobustNewMintedFile#1\endcsname{}}%
+ \expandafter\newrobustcmd\csname RobustNewMintedFile#1\endcsname[2][]{%
+ \RobustInputMintedProcess{#3,##1}{#2}{##2}}}
% \end{macrocode}
% \end{macro}
%
@@ -3612,16 +4096,14 @@
% Define an alias for |\mintinline|.
% \begin{macrocode}
\newcommand{\newmintinline}[3][]{%
- \if\relax\detokenize{#1}\relax
- \def\minted@shortname{#2inline}%
- \else
- \def\minted@shortname{#1}%
- \fi
- \expandafter\newmintinline@i\expandafter{\minted@shortname}{#2}{#3}}
+ \ifstrempty{#1}%
+ {\edef\minted@tmp{#2inline}}%
+ {\edef\minted@tmp{#1}}%
+ \expandafter\newmintinline@i\expandafter{\minted@tmp}{#2}{#3}}
\def\newmintinline@i#1#2#3{%
\expandafter\newcommand\csname#1\endcsname{%
\expandafter\FVExtraRobustCommand\csname RobustNewMintInline#1\endcsname
- \FVExtraUnexpandedReadStarOArgBVArg}%
+ \FVExtraUnexpandedReadStarOArgBVArg}%
\FVExtrapdfstringdefDisableCommands{%
\expandafter\def\csname RobustNewMintInline#1\endcsname{}}%
\expandafter\newrobustcmd\csname RobustNewMintInline#1\endcsname{%
@@ -3630,9 +4112,7 @@
\ifbool{FVExtraRobustCommandExpanded}%
{\@ifnextchar\bgroup
{\FVExtraReadVArg{\csname RobustNewMintInline#1@ii\endcsname{##1}}}%
- {\PackageError{minted}%
- {Inline delimiters must be paired curly braces in this context}%
- {Use curly braces as delimiters}}}%
+ {\minted@error{Inline delimiters must be paired curly braces in this context}}}%
{\FVExtraReadVArg{\csname RobustNewMintInline#1@ii\endcsname{##1}}}}
\expandafter\def\csname RobustNewMintInline#1@ii\endcsname##1##2{%
\RobustMintInlineProcess{#3,##1}{#2}{##2}}}
@@ -3640,22 +4120,22 @@
% \end{macro}
%
%
+%
% \subsection{Float support}
%
-% \begin{environment}{listing}
%
+% \begin{environment}{listing}
% Define a new floating environment to use for floated listings. This is defined conditionally based on the |newfloat| package option.
-%
% \begin{macrocode}
-\ifthenelse{\boolean{minted@newfloat}}%
+\ifbool{minted@newfloat}%
{\@ifundefined{minted@float@within}%
- {\DeclareFloatingEnvironment[fileext=lol,placement=tbp]{listing}}%
- {\def\minted@tmp#1{%
- \DeclareFloatingEnvironment[fileext=lol,placement=tbp, within=#1]{listing}}%
- \expandafter\minted@tmp\expandafter{\minted@float@within}}}%
+ {\DeclareFloatingEnvironment[fileext=lol,placement=tbp]{listing}}%
+ {\def\minted@tmp#1{%
+ \DeclareFloatingEnvironment[fileext=lol,placement=tbp,within=#1]{listing}}%
+ \expandafter\minted@tmp\expandafter{\minted@float@within}}}%
{\@ifundefined{minted@float@within}%
- {\newfloat{listing}{tbp}{lol}}%
- {\newfloat{listing}{tbp}{lol}[\minted@float@within]}}
+ {\newfloat{listing}{tbp}{lol}}%
+ {\newfloat{listing}{tbp}{lol}[\minted@float@within]}}
% \end{macrocode}
% \end{environment}
%
@@ -3665,36 +4145,29 @@
% \end{macrocode}
%
% \begin{macro}{\listingcaption}
-%
% The name that is displayed before each individual listings caption and its number.
% The macro |\listingscaption| can be redefined by the user.
-%
% \begin{macrocode}
\newcommand{\listingscaption}{Listing}
% \end{macrocode}
%
% The following definition should not be changed by the user.
-%
% \begin{macrocode}
\floatname{listing}{\listingscaption}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\listoflistingscaption}
-%
% The caption that is displayed for the list of listings.
-%
% \begin{macrocode}
\newcommand{\listoflistingscaption}{List of Listings}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\listoflistings}
-%
% Used to produce a list of listings (like |\listoffigures| etc.).
% This may well clash with other packages (for example, \texpkg{listings}) but we choose to ignore this
% since these two packages shouldn't be used together in the first place.
-%
% \begin{macrocode}
\providecommand{\listoflistings}{\listof{listing}{\listoflistingscaption}}
% \end{macrocode}
@@ -3705,323 +4178,11 @@
\fi
% \end{macrocode}
%
-% \subsection{Epilogue}
-%
-% Check whether LaTeX was invoked with |-shell-escape| option, set the default style, and make sure |pygmentize| exists. Checking for |pygmentize| must wait until the end of the preamble, in case it is specified via |\MintedPygmentize| (which would typically be after the package is loaded).
-%
-% \begin{macrocode}
-\AtEndOfPackage{%
- \ifthenelse{\boolean{minted@draft}}%
- {}%
- {%
- \ifthenelse{\boolean{minted@frozencache}}{}{%
- \ifnum\pdf@shellescape=1\relax\else
- \PackageError{minted}%
- {You must invoke LaTeX with the
- -shell-escape flag}%
- {Pass the -shell-escape flag to LaTeX. Refer to the minted.sty
- documentation for more information.}%
- \fi}%
- }%
-}
-\AtEndPreamble{%
- \ifthenelse{\boolean{minted@draft}}%
- {}%
- {%
- \ifthenelse{\boolean{minted@frozencache}}{}{%
- \TestAppExists{\MintedPygmentize}%
- \ifAppExists\else
- \PackageError{minted}%
- {You must have `pygmentize' installed
- to use this package}%
- {Refer to the installation instructions in the minted
- documentation for more information.}%
- \fi}%
- }%
-}
-% \end{macrocode}
-%
-%
-%
-% \subsection{Final cleanup}
-%
-% Clean up temp files. What actually needs to be done depends on caching and engine.
-% \begin{macrocode}
-\AfterEndDocument{%
- \ifthenelse{\boolean{minted@draft}}%
- {}%
- {\ifthenelse{\boolean{minted@frozencache}}%
- {}
- {\ifx\XeTeXinterchartoks\minted@undefined
- \else
- \DeleteFile[\minted@outputdir]{\minted@jobname.mintedcmd}%
- \DeleteFile[\minted@outputdir]{\minted@jobname.mintedmd5}%
- \fi
- \DeleteFile[\minted@outputdir]{\minted@jobname.pyg}%
- \DeleteFile[\minted@outputdir]{\minted@jobname.out.pyg}%
- }%
- }%
-}
-% \end{macrocode}
%
% \iffalse
%</package>
% \fi
%
%
-%
-% \section{Implementation of compatibility package}
-% \setcounter{CodelineNo}{0}
-%
-% \iffalse
-%<*packageone>
-% \fi
-%
-% \texpkg{minted} version 2 is designed to be completely compatible with version 1.7. All of the same options and commands still exist. As far as most users are concerned, the only difference should be the new commands and options.
-%
-% However, \texpkg{minted} 2 does require some additional packages compared to \texpkg{minted} 1.7. More importantly, since \texpkg{minted} 2 has almost completely new internal code, user code that accessed the internals of 1.7 will generally not work with 2.0, at least not without some modification. For these reasons, a copy of \texpkg{minted} 1.7 is supplied as the package \texpkg{minted1}. This is intended \emph{only} for compatibility cases when using the current version is too inconvenient.
-%
-% The code in \texpkg{minted1} is an exact copy of \texpkg{minted} version 1.7, except for two things: (1) the package has been renamed, and (2) code has been added that allows \texpkg{minted1} to act as (impersonate) \texpkg{minted}, so that it can cooperate with other packages that require \texpkg{minted} to be loaded.\footnote{The approach used for doing this is described at \url{http://tex.stackexchange.com/a/39418/10742}.} When \texpkg{minted1} is used, it must be loaded \emph{before} any other packages that would require \texpkg{minted}.
-%
-% All modifications to the original \texpkg{minted} 1.7 source are indicated with comments. All original code that has been replaced has been commented out rather than deleted. Any future modifications of \texpkg{minted1} should \emph{only} be for the purpose of allowing it to serve better as a drop-in compatibility substitute for the current release of \texpkg{minted}.
-%
-% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}
-%%%% Begin minted1 modification
-%%\ProvidesPackage{minted}[2011/09/17 v1.7 Yet another Pygments shim for LaTeX]
-\ProvidesPackage{minted1}[2015/01/31 v1.0 minted 1.7 compatibility package]
-%%%% End minted1 modification
-\RequirePackage{keyval}
-\RequirePackage{fancyvrb}
-\RequirePackage{xcolor}
-\RequirePackage{float}
-\RequirePackage{ifthen}
-%%%% Begin minted1 modification
-\newboolean{mintedone@mintedloaded}
-\@ifpackageloaded{minted}%
- {\setboolean{mintedone@mintedloaded}{true}%
- \PackageError{minted1}{The package "minted1" may not be loaded after
- ^^J"minted" has already been loaded--load "minted1" only for "minted"
- ^^Jversion 1.7 compatibility}%
- {Load "minted1" only when "minted" version 1.7 compatibility is required}}%
- {}
-\ifmintedone@mintedloaded\else
-\@namedef{ver@minted.sty}{2011/09/17 v1.7 Yet another Pygments shim for LaTeX}
-\expandafter\let\expandafter\minted@tmp\csname opt@minted1.sty\endcsname
-\expandafter\let\csname opt@minted.sty\endcsname\minted@tmp
-\let\minted@tmp\relax
-%%%% End minted1 modification
-\RequirePackage{calc}
-\RequirePackage{ifplatform}
-\DeclareOption{chapter}{\def\minted@float@within{chapter}}
-\DeclareOption{section}{\def\minted@float@within{section}}
-\ProcessOptions\relax
-\ifwindows
- \providecommand\DeleteFile[1]{\immediate\write18{del #1}}
-\else
- \providecommand\DeleteFile[1]{\immediate\write18{rm #1}}
-\fi
-\newboolean{AppExists}
-\newcommand\TestAppExists[1]{
- \ifwindows
- \DeleteFile{\jobname.aex}
- \immediate\write18{for \string^\@percentchar i in (#1.exe #1.bat #1.cmd)
- do set >\jobname.aex <nul: /p x=\string^\@percentchar \string~$PATH:i>>\jobname.aex} %$
- \newread\@appexistsfile
- \immediate\openin\@appexistsfile\jobname.aex
- \expandafter\def\expandafter\@tmp@cr\expandafter{\the\endlinechar}
- \endlinechar=-1\relax
- \readline\@appexistsfile to \@apppathifexists
- \endlinechar=\@tmp@cr
- \ifthenelse{\equal{\@apppathifexists}{}}
- {\AppExistsfalse}
- {\AppExiststrue}
- \immediate\closein\@appexistsfile
- \DeleteFile{\jobname.aex}
-\immediate\typeout{file deleted}
- \else
- \immediate\write18{which #1 && touch \jobname.aex}
- \IfFileExists{\jobname.aex}
- {\AppExiststrue
- \DeleteFile{\jobname.aex}}
- {\AppExistsfalse}
- \fi}
-\newcommand\minted@resetoptions{}
-\newcommand\minted@defopt[1]{
- \expandafter\def\expandafter\minted@resetoptions\expandafter{%
- \minted@resetoptions
- \@namedef{minted@opt@#1}{}}}
-\newcommand\minted@opt[1]{
- \expandafter\detokenize%
- \expandafter\expandafter\expandafter{\csname minted@opt@#1\endcsname}}
-\newcommand\minted@define@opt[3][]{
- \minted@defopt{#2}
- \ifthenelse{\equal{#1}{}}{
- \define@key{minted@opt}{#2}{\@namedef{minted@opt@#2}{#3}}}
- {\define@key{minted@opt}{#2}[#1]{\@namedef{minted@opt@#2}{#3}}}}
-\newcommand\minted@define@switch[3][]{
- \minted@defopt{#2}
- \define@booleankey{minted@opt}{#2}
- {\@namedef{minted@opt@#2}{#3}}
- {\@namedef{minted@opt@#2}{#1}}}
-\minted@defopt{extra}
-\newcommand\minted@define@extra[1]{
- \define@key{minted@opt}{#1}{
- \expandafter\def\expandafter\minted@opt@extra\expandafter{%
- \minted@opt@extra,#1=##1}}}
-\newcommand\minted@define@extra@switch[1]{
- \define@booleankey{minted@opt}{#1}
- {\expandafter\def\expandafter\minted@opt@extra\expandafter{%
- \minted@opt@extra,#1}}
- {\expandafter\def\expandafter\minted@opt@extra\expandafter{%
- \minted@opt@extra,#1=false}}}
-\minted@define@switch{texcl}{-P texcomments}
-\minted@define@switch{mathescape}{-P mathescape}
-\minted@define@switch{linenos}{-P linenos}
-\minted@define@switch{startinline}{-P startinline}
-\minted@define@switch[-P funcnamehighlighting=False]%
- {funcnamehighlighting}{-P funcnamehighlighting}
-\minted@define@opt{gobble}{-F gobble:n=#1}
-\minted@define@opt{bgcolor}{#1}
-\minted@define@extra{frame}
-\minted@define@extra{framesep}
-\minted@define@extra{framerule}
-\minted@define@extra{rulecolor}
-\minted@define@extra{numbersep}
-\minted@define@extra{firstnumber}
-\minted@define@extra{stepnumber}
-\minted@define@extra{firstline}
-\minted@define@extra{lastline}
-\minted@define@extra{baselinestretch}
-\minted@define@extra{xleftmargin}
-\minted@define@extra{xrightmargin}
-\minted@define@extra{fillcolor}
-\minted@define@extra{tabsize}
-\minted@define@extra{fontfamily}
-\minted@define@extra{fontsize}
-\minted@define@extra{fontshape}
-\minted@define@extra{fontseries}
-\minted@define@extra{formatcom}
-\minted@define@extra{label}
-\minted@define@extra@switch{numberblanklines}
-\minted@define@extra@switch{showspaces}
-\minted@define@extra@switch{resetmargins}
-\minted@define@extra@switch{samepage}
-\minted@define@extra@switch{showtabs}
-\minted@define@extra@switch{obeytabs}
-\newsavebox{\minted@bgbox}
-\newenvironment{minted@colorbg}[1]{
- \def\minted@bgcol{#1}
- \noindent
- \begin{lrbox}{\minted@bgbox}
- \begin{minipage}{\linewidth-2\fboxsep}}
- {\end{minipage}
- \end{lrbox}%
- \colorbox{\minted@bgcol}{\usebox{\minted@bgbox}}}
-\newwrite\minted@code
-\newcommand\minted@savecode[1]{
- \immediate\openout\minted@code\jobname.pyg
- \immediate\write\minted@code{#1}
- \immediate\closeout\minted@code}
-\newcommand\minted@pygmentize[2][\jobname.pyg]{
- \def\minted@cmd{pygmentize -l #2 -f latex -F tokenmerge
- \minted@opt{gobble} \minted@opt{texcl} \minted@opt{mathescape}
- \minted@opt{startinline} \minted@opt{funcnamehighlighting}
- \minted@opt{linenos} -P "verboptions=\minted@opt{extra}"
- -o \jobname.out.pyg #1}
- \immediate\write18{\minted@cmd}
- % For debugging, uncomment:
- %\immediate\typeout{\minted@cmd}
- \ifthenelse{\equal{\minted@opt@bgcolor}{}}
- {}
- {\begin{minted@colorbg}{\minted@opt@bgcolor}}
- \input{\jobname.out.pyg}
- \ifthenelse{\equal{\minted@opt@bgcolor}{}}
- {}
- {\end{minted@colorbg}}
- \DeleteFile{\jobname.out.pyg}}
-\newcommand\minted@usedefaultstyle{\usemintedstyle{default}}
-\newcommand\usemintedstyle[1]{
- \renewcommand\minted@usedefaultstyle{}
- \immediate\write18{pygmentize -S #1 -f latex > \jobname.pyg}
- \input{\jobname.pyg}}
-\newcommand\mint[3][]{
- \DefineShortVerb{#3}
- \minted@resetoptions
- \setkeys{minted@opt}{#1}
- \SaveVerb[aftersave={
- \UndefineShortVerb{#3}
- \minted@savecode{\FV@SV@minted@verb}
- \minted@pygmentize{#2}
- \DeleteFile{\jobname.pyg}}]{minted@verb}#3}
-\newcommand\minted@proglang[1]{}
-\newenvironment{minted}[2][]
- {\VerbatimEnvironment
- \renewcommand{\minted@proglang}[1]{#2}
- \minted@resetoptions
- \setkeys{minted@opt}{#1}
- \begin{VerbatimOut}[codes={\catcode`\^^I=12}]{\jobname.pyg}}%
- {\end{VerbatimOut}
- \minted@pygmentize{\minted@proglang{}}
- \DeleteFile{\jobname.pyg}}
-\newcommand\inputminted[3][]{
- \minted@resetoptions
- \setkeys{minted@opt}{#1}
- \minted@pygmentize[#3]{#2}}
-\newcommand\newminted[3][]{
- \ifthenelse{\equal{#1}{}}
- {\def\minted@envname{#2code}}
- {\def\minted@envname{#1}}
- \newenvironment{\minted@envname}
- {\VerbatimEnvironment\begin{minted}[#3]{#2}}
- {\end{minted}}
- \newenvironment{\minted@envname *}[1]
- {\VerbatimEnvironment\begin{minted}[#3,##1]{#2}}
- {\end{minted}}}
-\newcommand\newmint[3][]{
- \ifthenelse{\equal{#1}{}}
- {\def\minted@shortname{#2}}
- {\def\minted@shortname{#1}}
- \expandafter\newcommand\csname\minted@shortname\endcsname[2][]{
- \mint[#3,##1]{#2}##2}}
-\newcommand\newmintedfile[3][]{
- \ifthenelse{\equal{#1}{}}
- {\def\minted@shortname{#2file}}
- {\def\minted@shortname{#1}}
- \expandafter\newcommand\csname\minted@shortname\endcsname[2][]{
- \inputminted[#3,##1]{#2}{##2}}}
-\@ifundefined{minted@float@within}
- {\newfloat{listing}{h}{lol}}
- {\newfloat{listing}{h}{lol}[\minted@float@within]}
-\newcommand\listingscaption{Listing}
-\floatname{listing}{\listingscaption}
-\newcommand\listoflistingscaption{List of listings}
-\providecommand\listoflistings{\listof{listing}{\listoflistingscaption}}
-\AtBeginDocument{
- \minted@usedefaultstyle}
-\AtEndOfPackage{
- \ifnum\pdf@shellescape=1\relax\else
- \PackageError{minted}
- {You must invoke LaTeX with the
- -shell-escape flag}
- {Pass the -shell-escape flag to LaTeX. Refer to the minted.sty
- documentation for more information.}\fi
- \TestAppExists{pygmentize}
- \ifAppExists\else
- \PackageError{minted}
- {You must have `pygmentize' installed
- to use this package}
- {Refer to the installation instructions in the minted
- documentation for more information.}
- \fi}
-%%%% Begin minted1 modification
-\fi
-%%%% End minted1 modification
-% \end{macrocode}
-% \iffalse
-%</packageone>
-% \fi
-%
% \Finale
\endinput
-
diff --git a/Master/texmf-dist/source/latex/minted/minted.ins b/Master/texmf-dist/source/latex/minted/minted.ins
index 2b5da824ca9..61f72c6b0ad 100644
--- a/Master/texmf-dist/source/latex/minted/minted.ins
+++ b/Master/texmf-dist/source/latex/minted/minted.ins
@@ -3,19 +3,17 @@
\askforoverwritefalse
\preamble
-Copyright 2013--2022 Geoffrey M. Poore
-Copyright 2010--2011 Konrad Rudolph
+Copyright (C) 2013-2024 by Geoffrey M. Poore <gpoore@gmail.com>
+Copyright (C) 2010-2011 by Konrad Rudolph <konrad_rudolph@madrat.net>
+--------------------------------------------------------------------------
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
- 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.
-
-Additionally, the project may be distributed under the terms of the new BSD
-license.
+ 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'.
@@ -23,14 +21,13 @@ The Current Maintainer of this work is Geoffrey Poore.
This work consists of the files minted.dtx and minted.ins
and the derived file minted.sty.
+
\endpreamble
\usedir{tex/latex/minted}
\generate{%
\file{minted.sty}{\from{minted.dtx}{package}}%
- \file{minted1.sty}{\from{minted.dtx}{packageone}}%
}
\endbatchfile
-% vim: ft=tex
diff --git a/Master/texmf-dist/source/latex/mlacls/mla.dtx b/Master/texmf-dist/source/latex/mlacls/mla.dtx
index 807a073ed1c..b957b75bbb6 100644
--- a/Master/texmf-dist/source/latex/mlacls/mla.dtx
+++ b/Master/texmf-dist/source/latex/mlacls/mla.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright 2019 Seth Price.
+% Copyright 2019 Seth M. Price.
%
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
@@ -27,7 +27,7 @@
%<mla>\NeedsTeXFormat{LaTeX2e}
%<mla>\ProvidesClass{mla}
%<*mla>
- [2021/09/14 v1.0 MLA Paper Class]
+ [2024/09/13 v1.1 MLA Paper Class]
%</mla>
%<*driver>
@@ -80,7 +80,11 @@
\addbibresource{mla.bib}
%% Just thought it'd be cool to use `acro'
-\usepackage{acro}
+%% (though v3.6 seems to have broken everything)
+\ExplSyntaxOn
+\prop_new:N \l__acro_foreign_format_prop
+\ExplSyntaxOff
+\usepackage{acro2}
\DeclareAcronym{US}{short=US,long=United States}
\DeclareAcronym{MLA}{short=MLA,long=Modern Language Association}
\DeclareAcronym{CTAN}{short=CTAN,
@@ -109,11 +113,12 @@
\usepackage{microtype}
%% Fancy PDF
-\usepackage[hidelinks]{hyperref}
+\usepackage[numbered]{hypdoc}
\hypersetup{
+ hidelinks,
pdfinfo={
Title=The MLA class,
- Author=Seth Price,
+ Author=Seth M. Price,
Creator=LaTeX
}
}
@@ -131,7 +136,7 @@
%
% \fi
%
-% \CheckSum{401}
+% \CheckSum{430}
%
% \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
@@ -151,7 +156,7 @@
%
% \title{The \Dcls{mla} class\thanks{This document corresponds to
% \Dcls{mla}~\fileversion, dated \filedate.}}
-% \author{Seth Price \\ \href{mailto:\myemail}{\texttt{\myemail}}}
+% \author{Seth M.\ Price \\ \href{mailto:\myemail}{\texttt{\myemail}}}
% \date{\today}
%
% \maketitle
@@ -241,6 +246,7 @@
% \begin{macro}{\MLA@pageheader}
% \begin{macro}{\MLA@plainheadings}
% \begin{macro}{\MLA@fullpage}
+% \begin{macro}{\MLA@times}
% The following are true/false switches to toggle certain features.
%
% \begin{macrocode}
@@ -254,6 +260,7 @@
\newif\ifMLA@pageheader
\newif\ifMLA@plainheadings
\newif\ifMLA@fullpage
+\newif\ifMLA@times
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -265,6 +272,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \section{Options}
% \label{sec:options}
@@ -297,7 +305,7 @@
\DeclareOption{mla8alt}{\MLA@sevenfalse\MLA@eightfalse\MLA@eightalttrue}
% \end{macrocode}
%
-% For those who do not plan on using figures and/or footnotes,
+% For those who do not plan on using figures and/or endnotes,
% some time (and dependency disk space) might be saved by using the
% \Dopt{nofigures} and/or \Dopt{nonotes} options, as they are enabled
% by default.
@@ -352,6 +360,16 @@
\DeclareOption{fullpage}{\MLA@fullpagetrue}
% \end{macrocode}
%
+% \changes{v1.1}{2024/02/04}{Added \Dopt{notimes} option to not set Times New
+% Roman as the font}
+% For professors that do not require Times New Roman as the font, the
+% \Dopt{notimes} option may be used to keep the default font. This allows
+% maintaining \LaTeX{}'s default font if desired.
+% \begin{macrocode}
+\MLA@timestrue
+\DeclareOption{notimes}{\MLA@timesfalse}
+% \end{macrocode}
+%
% \subsection{Processing}
% \label{sec:processing}
%
@@ -397,7 +415,6 @@
\RequirePackage{fancyhdr}
\RequirePackage{fullpage}
\RequirePackage{ragged2e}
-\RequirePackage{newtxtext}
\RequirePackage{titlesec}
\RequirePackage{xstring}
% \end{macrocode}
@@ -454,6 +471,14 @@
\fi
% \end{macrocode}
%
+% And the \Dpkg{newtxtext} package can be disabled with \Dopt{notimes}.
+%
+% \begin{macrocode}
+\ifMLA@times
+ \RequirePackage{newtxtext}
+\fi
+% \end{macrocode}
+%
% The \Dpkg{microtype} package is loaded if the \Dopt{microtype}
% option is specified.
%
@@ -477,11 +502,12 @@
% \subsection{Font}
% \label{sec:font}
%
-% The \Dpkg{newtxtext} package was already loaded in
-% section~\ref{sec:loading_packages},
-% and the font was set to 12pt when loading the \Dcls{article} class
+% The font size was set to 12pt when loading the \Dcls{article} class
% in section~\ref{sec:initial_code}.
-% This should be metric-compatible with the infamous Times New Roman,
+% Unless the option \Dopt{notimes} was specified,
+% the \Dpkg{newtxtext} package will have been loaded in
+% section~\ref{sec:loading_packages},
+% which should be metric-compatible with the infamous Times New Roman,
% the \foreign{de facto} standard of the
% \ac{MLA} format\footnote{According to the popular, oft-referenced
% \ac{OWL}: \citeurl{owlmla}.}.
@@ -837,6 +863,28 @@
% \end{environment}
% \end{environment}
%
+% \changes{v1.1}{2024/09/12}{Modify footnotes to be more in-style}
+% \subsection{Footnotes}
+% \label{sec:footnotes}
+%
+% Footnotes are styled similarly to endnotes (see section \ref{sec:endnotes}),
+% but in smaller text, and glued to the bottom of the page.
+%
+% \begin{macrocode}
+\addtolength{\skip\footins}{1pc}
+\renewcommand{\footnoterule}{%
+ \vfill
+ \kern -3pt\hrule width 0.4\columnwidth
+ \vskip 6pt
+}
+\renewcommand{\@makefnmark}{\@thefnmark}
+\renewcommand{\@makefntext}[1]{%
+ \leftskip 0.5in
+ \parindent -0.5in
+ \@makefnmark.~#1
+}
+% \end{macrocode}
+%
% \subsection{Block quotation}
% \label{sec:block_quoatation}
%
@@ -1015,6 +1063,8 @@
\fi
% \end{macrocode}
%
+% See section \ref{sec:footnotes} for footnotes.
+%
% \subsubsection{Bibliography}
% \label{sec:bibliography}
%
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/naive-ebnf/naive-ebnf.dtx b/Master/texmf-dist/source/latex/naive-ebnf/naive-ebnf.dtx
index 6886393d883..0a7b7e39bd8 100644
--- a/Master/texmf-dist/source/latex/naive-ebnf/naive-ebnf.dtx
+++ b/Master/texmf-dist/source/latex/naive-ebnf/naive-ebnf.dtx
@@ -50,7 +50,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{naive-ebnf}
%<*package>
-[2023-08-11 0.0.15 EBNF in Plain Text]
+[2024/09/06 0.0.16 EBNF in Plain Text]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -113,6 +113,7 @@
% \item |[...]| denotes an optional substitution;
% \item |{...}| denotes a zero or more times repetition;
% \item |{...}+| denotes one or more times repetition;
+% \item \texttt{\char`\|\char`\|\char`\|} denotes an indent at the beginning of the string.
% \item \texttt{\char`\|\char`\|} denotes an indented vertical bar at the beginning of the string.
% \end{itemize}
@@ -235,6 +236,22 @@
% \end{document}
% \end{docshot}
+
+% The \texttt{\char`\|\char`\|\char`\|} character allows indenting the text on a new line, allowing breaking long expressions:
+% \docshotOptions{firstline=5,lastline=11}
+% \begin{docshot}
+% \documentclass{minimal}
+% \usepackage[T1]{fontenc}
+% \usepackage{naive-ebnf}
+% \begin{document}
+% \begin{ebnf}
+% <x> := "beginning" \\
+% ||| ( <y> | <z> ) \\
+% ||| "ending" \\
+% \end{ebnf}
+% \end{document}
+% \end{docshot}
+
% \section{Package Options}
% It's possible to configure the behavior of the package with the help of a few package options:
@@ -407,6 +424,8 @@
{ >([^\s]) } {\\textgreater{}\1} \ebnf_tmp%
\regex_replace_all:nnN
{ ([^\s])'([^\s]) } {\1\\textquotesingle{}\2} \ebnf_tmp%
+ \regex_replace_all:nnN { \|\|\| }%
+ {\c{makebox}[#1][r]{ }} \ebnf_tmp%
\regex_replace_all:nnN
{ ([^\s])\|([^\s]) } {\1\\textbar{}\2} \ebnf_tmp%
%
diff --git a/Master/texmf-dist/source/latex/nfssext-cfr/nfssext-cfr.dtx b/Master/texmf-dist/source/latex/nfssext-cfr/nfssext-cfr.dtx
new file mode 100644
index 00000000000..919fb67b5f2
--- /dev/null
+++ b/Master/texmf-dist/source/latex/nfssext-cfr/nfssext-cfr.dtx
@@ -0,0 +1,3341 @@
+% \iffalse meta-comment
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% nfssext-cfr.dtx
+% Additions and changes Copyright (C) 2008-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 nfssext-cfr.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}
+% ^^A \def\MakePrivateLetters{\makeatletter\ExplSyntaxOn\endlinechar13}
+% ^^A \def\MyMakePrivateLetters{\makeatletter\ExplSyntaxOn\endlinechar13}
+\ExplSyntaxOn
+% ^^A sylwad yannisl: https://tex.stackexchange.com/questions/723293/how-can-i-get-automatic-code-indexing-of-expl3-in-ltxdoc/723294#comment1799661_723294
+% ^^A \ExplSyntaxOn \cs_gset:Npn \MakePrivateLetters { \char_set_catcode_letter:N \@ \char_set_catcode_letter:N _ \char_set_catcode_letter:N \: } \ExplSyntaxOff`
+\cs_new_nopar:Npn \MyMakePrivateLetters
+{
+ \char_set_catcode_letter:N \@
+ \char_set_catcode_letter:N _
+ \char_set_catcode_letter:N \:
+}
+\ExplSyntaxOff
+\ProvidesFileSVN{$Id: nfssext-cfr.dtx 10456 2024-10-03 01:19:12Z cfrees $}[v1.1 \revinfo][\filebase DTX: Extended font selection for NFSS and NNFSS]
+\DefineFileInfoSVN[nfssext-cfr]
+\documentclass[10pt,british]{ltxdoc}
+% l3doc loads fancyvrb
+% fancyvrb overwrites svn-prov's macros without warning
+% restore \fileversion \filerev in case we're using l3doc
+\GetFileInfoSVN{nfssext-cfr}
+\usepackage[debug]{nfssext-cfr}
+\usepackage[rm={prop,osf},sf={prop,osf},tt={mono,tab,lf}]{cfr-lm}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\DoNotIndex{\verb,\ProvidesPackageSVN,\NeedsTeXFormat,\ProcessKeyOptions}
+\usepackage{babel}
+\usepackage{fancyhdr}
+% \usepackage[plain]{fancyref}
+\usepackage{fixfoot}
+\usepackage{array}
+\usepackage{tabularx}
+\usepackage{longtable}
+\usepackage{booktabs}
+\usepackage{multirow}
+\usepackage[inline]{enumitem}
+\usepackage[referable]{threeparttablex}
+\makeatletter
+\def\TPT@measurement{% ateb David Carlisle: https://tex.stackexchange.com/a/370691/
+ \ifdim\wd\@tempboxb<\TPTminimum
+ \hsize \TPTminimum
+ \else
+ \hsize\wd\@tempboxb
+ \fi
+ \xdef\TPT@hsize{\hsize\the\hsize \noexpand\@parboxrestore}\TPT@hsize
+ \ifx\TPT@docapt\@undefined\else
+ \TPT@docapt \vskip.2\baselineskip
+ \fi \par
+ \dimen@\dp\@tempboxb % new
+ \box\@tempboxb
+ \ifvmode \prevdepth\dimen@ \fi% was \z@ not \dimen@
+}
+\renewlist{tablenotes}{enumerate}{1}
+\setlist[tablenotes]{label=\tnote{\sffamily\alph*},ref=\alph*,itemsep=\z@,topsep=\z@skip,partopsep=\z@skip,parsep=\z@,itemindent=\z@,labelindent=\tabcolsep,labelsep=.2em,leftmargin=*,align=left,before={\unskip\medskip\rmfamily\lstyle\footnotesize}}
+\makeatother
+\usepackage{xcolor}
+\usepackage{xurl}
+\urlstyle{sf}
+\usepackage{microtype}
+%^^A \usepackage[a4paper,headheight=14pt,marginparwidth=45mm,hmarginratio=4:1,vscale=.8,hscale=.7,verbose]{geometry} % use 14pt for 11pt text, 15pt for 12pt text
+%^^A \usepackage[a4paper,headheight=14pt,vscale=.8,hscale=.7,verbose,showframe]{geometry} % use 14pt for 11pt text, 15pt for 12pt text
+%^^A \usepackage[verbose,showframe,marginparwidth=130pt,a4paper,includemp,hscale=0.8]{geometry}
+% addaswyd o chronos.tex
+\newlength\tewadjust
+\newlength\chronosdoctemplgth
+\AddToHook {begindocument/after}[.]
+{%
+ \setlength\tewadjust{\marginparwidth+\marginparsep-\paperwidth+\textwidth+\oddsidemargin+1in}%
+ \setlength\chronosdoctemplgth{0pt}%
+}
+\usepackage{csquotes}
+\MakeAutoQuote{‘}{’}
+\MakeAutoQuote*{“}{”}
+\usepackage{caption}
+\DeclareCaptionFont{lf}{\sffamily\lstyle}
+\captionsetup[table]{labelfont=lf}
+% sicrhau hyperindex=false: llwytho CYN bookmark
+\usepackage{hypdoc}% ateb Ulrike Fischer: https://tex.stackexchange.com/a/695555/
+\usepackage{bookmark}
+\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}
+\NewDocElement[%
+ idxtype=pkg.,
+ idxgroup=,
+ printtype=\textit{pkg.},
+]{Pkg}{package}
+\NewDocElement[%
+ printtype=\textdagger,
+ idxtype=,
+ idxgroup=,
+ macrolike,
+]{DMacro}{dmacro}
+\NewDocumentCommand \val { m }
+{%
+ {\ttfamily =\,\meta{#1}}%
+}
+\ExplSyntaxOn
+\NewDocumentCommand \vals { m }
+{
+ {
+ \ttfamily = \,
+ \clist_use:nn { #1 } { \textbar }
+ }
+}
+\keys_define:nn { clm / doc }
+{
+ unknown .code:n = {
+ \cs_if_free:cT { \l_keys_key_str }
+ {
+ \tl_gset:cn { \l_keys_key_str } { #1 }
+ }
+ },
+}
+\NewDocumentCommand \clmdocset { +m }
+{
+ \keys_set:nn { clm / doc } { #1 }
+}
+\ExplSyntaxOff
+\clmdocset{%
+ bug={\href{https://codeberg.org/cfr/nfssext/issues}{\textsc{bugtracker}}},
+ codeberg={\href{https://codeberg.org/cfr/nfssext}{\textsc{codeberg}}},
+ github={\href{https://github.com/cfr42/nfssext}{\textsc{github}}},
+ ctan={\href{https://ctan.org/}{\textsc{ctan}}},
+}
+\AddToHook {env/threeparttable/begin} {\typeout{Bagpuss}\sffamily}
+\usepackage{cleveref}
+\newcommand*{\gust}{\textsc{Gust}}
+\newcommand*{\lpack}[1]{\textsf{#1}}
+\newcommand*{\fgroup}[1]{\textsf{#1}}
+\newcommand*{\fname}[1]{\textsf{#1}}
+\newcommand*{\file}[1]{\texttt{#1}}
+\newcommand*{\mail}[1]{\texttt{#1}}
+% \newcommand*{\pkg}[1]{\mbox{\textsf{#1}}}
+\newcommand* \nfss {\textsc{nfss}}
+\newcommand* \nnfss {\textsc{nnfss}}
+\newcommand* \svn {\textsc{svn}}
+\title{\filebase}
+\author{Clea F. Rees\thanks{%
+ Bug tracker:
+ \href{https://codeberg.org/cfr/nfssext/issues}{\url{codeberg.org/cfr/nfssext/issues}}
+ \textbar{} Code:
+ \href{https://codeberg.org/cfr/nfssext}{\url{codeberg.org/cfr/nfssext}}
+ \textbar{} Mirror:
+ \href{https://github.com/cfr42/nfssext}{\url{github.com/cfr42/nfssext}}%
+}}
+% \date{\fileversion~\filetoday}
+\date{\fileversion~\filedate}
+\pagestyle{fancy}
+\fancyhf{}
+\def\exfsdocffont{\itshape\plstyle\footnotesize}
+\def\exfsdochfont{\itshape\plstyle}
+%^^A \fancyhf[rh]{\itshape\plstyle\leftmark}
+%^^A \fancyhf[lh]{\sffamily\plstyle\leftmark}
+\fancyhf[rh]{\exfsdochfont\thepage}
+\fancyhf[rf]{\exfsdocffont\fileversion}
+% ^^A \fancyhf[rh]{\itshape\filetoday}
+% ^^A \fancyhf[ch]{\itshape Support for Latin Modern}
+% ^^A\fancyhf[lf]{\itshape\fileversion}
+%^^A \fancyhf[cf]{\itshape\plstyle--- \thepage~/~\lastpage{} ---}
+% ref. fancyhdr (or see tc3 ref'd there?)
+\renewcommand \sectionmark[1]{\markboth{\thesection{} #1}{}}
+\renewcommand \subsectionmark[1]{\markright{\arabic{subsection} #1}}
+\ExplSyntaxOn
+\fancyhf[lh]{\exfsdochfont\rlap{\nouppercase{\leftmark}}\skip_horizontal:n { \g__exfs_doc_offset_dim }\nouppercase{\rightmark}}
+%^^A \fancyhf[lf]{\exfsdocffont\rlap{\filebase}\skip_horizontal:n { \g__exfs_doc_offset_dim }\fileversion }
+\fancyhf[lf]{\exfsdocffont\filebase }
+\hook_gput_code:nnn {shipout/lastpage} {.}
+{
+ \property_record:nn {t:lastpage}{abspage,page,pagenum}
+}
+\cs_new_protected_nopar:Npn \lastpage
+{
+ \property_ref:nn {t:lastpage}{page}
+}
+\cs_new_eq:NN \OrigMakePrivateLetters \MakePrivateLetters
+\dim_new:N \g__exfs_doc_offset_dim
+\hook_gput_code:nnn { begindocument } {.}
+{
+ \dim_gset:Nn \g__exfs_doc_offset_dim { \marginparwidth + \marginparsep }
+ \fancyheadoffset[lh,lf]{ \g__exfs_doc_offset_dim }
+}
+\ExplSyntaxOff
+\makeatletter
+\def\@xobeysp{\leavevmode\penalty100\ }
+\makeatother
+\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}
+\begin{document}
+\let\MakePrivateLetters\MyMakePrivateLetters
+\DocInput{\filename}
+\end{document}
+%</driver>
+% \fi
+%
+% \changes{2008-10-26}{2008/10/26}{First public release as part of \lpack{cfr-lm}.}
+% \changes{2008-12-22}{2008/12/22}{Updated version released standalone.}
+% \changes{\svn 6140}{2017/03/28}{%
+% Fixes a bug which prevented \cs{tmstyle} and \cs{tvstyle} working correctly if the current font was not a serif family.
+% (Especially problematic in Beamer where \cs{normalfont} cannot be used as a workaround, but annoying elsewhere.)}
+%
+% \changes{\svn 6140}{2017/03/28}{%
+% Provides something a bit closer to real documentation.%
+% }
+%
+% \maketitle\thispagestyle{empty}
+% \pdfinfo{%
+% /Creator (TeX)
+% /Producer (pdfTeX)
+% /Author (Clea F.\ Rees)
+% /Title (nfssext-cfr)
+% /Subject (TeX)
+% /Keywords (TeX,LaTeX,Clea,Rees)}
+% \pdfcatalog{%
+% /URL ()
+% /PageMode /UseOutlines}
+% \setlength{\parindent}{0pt}
+% \setlength{\parskip}{0.5em}
+%
+%
+% \begin{abstract}
+%
+% \noindent \lpack{nfssext-cfr} is an extension and modification of Philipp Lehman's \lpack{nfssext} which provides extended font selection commands modelled on those provided by \LaTeXe{}.
+% Given an appropriate font configuration, \lpack{nfssext-cfr} enables users to change the weight, width, shape and style of font as easily as they can select bold, italic or typewriter.
+% For instance, the package makes it trivial to use proportional, hanging figures in the body of the text, proportional, lining figures in captions and headers and tabular, lining figures in tables.
+% An extensive choice of commands are provided to access a wide variety of weights, widths, shapes and styles from the more common (e.g.~semi-bold or condensed) to the less common (e.g.~‘outline’ and right or upright italic).
+% Comprehensive support is provided for ‘swash’ and ‘alternate’ styles.
+% These are implemented as families rather than shapes to support fonts which offer multiple swash shapes (e.g.~small-caps, italic and upright) or alternate styles.
+% These may be used to provide effective access to fancy ligatures, end-of-word swashes etc.\ without sacrificing the range of characters provided by \textsc{t1}.
+%
+% The package is not primarily intended for direct use by end-users, but is designed rather to facilitate the creation of more sophisticated font support packages.
+% End-users may nonetheless find the package useful, subject to the constraints explained in this document.
+% Moreover, end-users may wish to pass options to the package on newer kernels, if loading font support packages which have not been updated for changes to font selection\footnote{‘Kernel’ refers to the \LaTeX{} kernel in this context and should not be confused with your system kernel.}.
+%
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \listoftables
+%
+% \section{Introduction}\label{sec:intro}
+%
+%
+% The package was originally a fairly simple extension of Philipp Lehman's \lpack{nfssext}\@.
+% \lpack{nfssext} provides commands which enable one to specify font features not covered by the New Font Selection Scheme (\nfss).
+% The package developed according to the needs of particular fonts I configured for \LaTeX{} and, in a few cases, my dissatisfaction with the original commands.
+%
+% In adapting the package for the (New) New Font Selection Scheme\footnote{%
+% Officially, there is no such designation, but I have to call it something.
+% Throughout this document and packages which depend upon it, I use this term to refer to the font selection features introduced into \LaTeX{} in 2020.%
+% } (\nnfss), I have tried to balance \begin{enumerate*}[label=(\roman*)]\item backwards compatibility\footnote{%
+% Note that 100\% backwards compatibility cannot be implemented on current \LaTeX{} kernels.%
+% } for users loading updated font support packages, \item backwards compatibility for users loading packages which haven't been updated and \item compatibility with the new features of \nnfss{}\end{enumerate*}.
+% I have also tried to account for the common case in which documents use combinations of fonts from different packages, each of which may or may not load \lpack{nfssext-cfr} and may or may not have been updated for \nnfss{}.
+% This has inevitably required some compromises and there are certainly places where I would do things differently if starting from scratch.
+%
+% While I don't recommend installing this version of \lpack{nfssext-cfr} on an older system, the package should continue to work more-or-less as it always did on older kernels.
+% To achieve this, the package is split into a main file, \file{nfssext-cfr.sty}, which provides common code and figures out whether to load code for \nfss{} (\file{nfssext-cfr-nfss.sty}) or \nnfss{} (\file{nfssext-sty-nnfss.sty}).
+% \file{nfssext-cfr-nfss.sty} is essentially what was \file{nfssext-cfr.sty} minus the code retained in the latter.
+%
+% Unfortunately, tt is impossible to ensure 100\% backwards compatibility with recent \LaTeX{} kernels.
+% By default, \lpack{nfssext-cfr} tries to interfere as little as possible with the kernel, even at the cost of backwards compatibility.
+% If \texttt{compat} is enabled, however, the package does its best to enable backwards compatible behaviour, at the cost of the new functionality provided by the kernel.
+%
+% \lpack{nfssext-cfr} does not eschew interference with the kernel at all costs.
+% Even without \texttt{compat} it patches or replaces some kernel code because some things just don't work sensibly\footnote{%
+% This is true in two main places.
+% The first is the kernel's initialisation of series at the start of the document.
+% This overwrites the default \texttt{bf} series according to the font family name rather than the font name.
+% This means that virtual fonts which depend on Computer or Latin Modern are not handled correctly and, because this code is delayed, the problem cannot be corrected by setting things up appropriately earlier.
+%
+% The second is the implementation of ‘swash’ which is by far the most problematic of the changes and one of the most difficult to navigate.
+% It isn't clear to me how seriously the kernel's definition is intended to be, but I have chosen to overwrite the kernel code here.}.
+%
+% \begin{center}
+% \fbox{%
+% \begin{minipage}{.9\linewidth}
+% \textbf{All font-support code should be updated to use \texttt{compat=false} when loading \lpack{nfssext-cfr}.}
+% The changes in \nnfss{} \textbf{require} changes to code based on Philipp Lehman's Font Installation Guide.
+% \end{minipage}}
+% \end{center}
+%
+% \section{Macros}\label{sec:macros}
+%
+% \Cref{tab:smr,tab:srr,tab:wds,tab:wghts,tab:figs,tab:gen,tab:shapes} include macros supplied by the original \lpack{nfssext} and additions available with \lpack{nfssext-cfr}.
+% Macros in \cref{tab:wds,tab:wghts,tab:shapes} should work with any font definition files which more-or-less adhere to \nfss/\nnfss.
+% This should, theoretically, be all font packages but, in practice, things are rarely so simple.
+% Macros in \cref{tab:figs,tab:gen} will work only with fonts named strictly according to the Berry naming scheme.
+%
+% In \cref{tab:wghts,tab:wds,tab:gen,tab:figs,tab:shapes}, the third column lists the default letter codes for various font features.
+% If the defaults are changed, the macros will try to do something different.
+%
+% A \texttt{+} indicates that the macro will attempt to merge the addition into the current font's family name, series or shape.
+% For example, if the current font uses oldstyle figures, the \texttt{+2} indicates that \cs{pstyle} will attempt to select a font with figures which are both proportional and oldstyle.
+%
+% A \texttt{-} indicates that the macro will attempt to subtract from the current font's family name, series or shape.
+% For example, if the current font uses oldstyle figures, the \texttt{-2} indicates that \cs{tstyle} will attempt to select a font with figures which are both tabular and oldstyle.
+%
+% A comma-separated list indicates consecutive additions and/or subtraction.
+%
+% If no \texttt{+-} is used, the macro tries to select a font with the given feature without merging.
+% For example \cs{sistyle} tries to switch to \texttt{si} shape regardless of the current font shape.
+%
+% A \texttt{--} indicates that the macro will try to clear all relevant letter codes from the current font's family name, series or shape.
+% For example, \cs{regwidth} tries to switch to a series with no letter codes indicating non-standard widths in its name.
+%
+% Additions, subtractions and clearances operate on font family names, series or shapes, as appropriate.
+% In general, macros with \texttt{style} in their names operate on family names; those with \texttt{shape} operate on shape codes\footnote{But \textbf{not} \cs{swshape}!}; and those with \texttt{width} or \texttt{weight} operate on series codes.
+%
+% The letter codes correspond to those specified by the \nfss{} specification, unless the specification does not include the relevant feature.
+% In the latter case, I tried to choose something sensible i.e.~something which made sense to me at the time.
+% These choices are not always those specified by the \nnfss{} specification, since sense and sensibility are sometimes in the eye of the encoder.
+%
+% \newcolumntype{T}{>{\ttfamily\tlstyle\arraybackslash}l}
+% \newcolumntype{F}{>{\rmfamily\arraybackslash}l}
+% \newcolumntype{R}{>{\rmfamily\arraybackslash}X}
+% \begin{table}
+% \centering
+% \begin{threeparttable}
+% \caption{Standard (kernel) macros (re)defined}\label{tab:smr}
+% \begin{tabular}{lF}
+% \toprule
+% \cs{swshape}\tnotex{tn:sw-exists}\tnotex{tn:swshape-refs}\DescribeMacro[noprint]{\swshape} & redefined on new kernels\tnotex{tn:sw} \\
+% & defined on old kernels \\
+% \cs{itshape}\DescribeMacro[noprint]{\itshape} & old kernels only\\
+% \cs{scshape}\DescribeMacro[noprint]{\scshape} & old kernels only\\
+% \cs{upshape}\DescribeMacro[noprint]{\upshape} & old kernels only\\
+% \bottomrule
+% \end{tabular}
+% \begin{tablenotes}
+% \item\label{tn:sw-exists}Defined only by newer kernels.
+% \item\label{tn:swshape-refs}See \cref{tab:gen,tab:shapes} and text.
+% \item\label{tn:sw}Definition depends on kernel, \texttt{force} and \texttt{compat}.
+% \end{tablenotes}
+% \end{threeparttable}
+% \end{table}
+% \begin{table}
+% \centering
+% \caption{Standard (kernel) font change rules redefined}\label{tab:srr}
+% \begin{tabular}{TTF}
+% \toprule
+% \multicolumn{2}{c}{Shape} & \\
+% \multicolumn{1}{c}{Current} & \multicolumn{1}{c}{Requested} & \multicolumn{1}{c}{\sffamily Applied when?} \\
+% \midrule
+% it & sc & \texttt{compat} \& \nnfss{} only \\
+% sl & sc & \texttt{compat} \& \nnfss{} only \\
+% sc & it & \texttt{compat} \& \nnfss{} only \\
+% sc & sl & \texttt{compat} \& \nnfss{} only \\
+% scsl & it & \texttt{compat} \& \nnfss{} only \\
+% \bottomrule
+% \end{tabular}
+% \end{table}
+% \begin{table}
+% \centering
+% \begin{threeparttable}
+% \caption{Family switches: general}\label{tab:gen}
+% \begin{tabularx}\linewidth{llTR}
+% \toprule
+% \multicolumn{2}{c}{Macros} & \multicolumn{1}{c}{} & \\
+% \multicolumn{1}{c}{Text Command} & \multicolumn{1}{c}{Switch} & \multicolumn{1}{c}{Family Code} & \sffamily Style \\
+% \midrule
+% \cs{textti}\DescribeMacro[noprint]{\textti} & \cs{tistyle}\DescribeMacro[noprint]{\tistyle} & +d & titling/display\\
+% \cs{textlt}\tnotex{tn:cf-textlg}\DescribeMacro[noprint]{\textlt} & \cs{ltstyle}\tnotex{tn:cf-lgweight}\DescribeMacro[noprint]{\ltstyle} & +l & light if separate family \\
+% \cs{textof}\DescribeMacro[noprint]{\textof} & \cs{ofstyle}\DescribeMacro[noprint]{\ofstyle} & +l & open-face (or outline or blank) style\\
+% \cs{textalt}\DescribeMacro[noprint]{\textalt} & \cs{altstyle}\DescribeMacro[noprint]{\altstyle} & +a & alternative style\\
+% \cs{textreg}\DescribeMacro[noprint]{\textreg} & \cs{regstyle}\DescribeMacro[noprint]{\regstyle} & -- & regular style\\
+% \cs{emboss}\DescribeMacro[noprint]{\emboss} & \cs{embossstyle}\DescribeMacro[noprint]{\embossstyle} & +e & ‘embossed’ style \\
+% \cs{textorn}\DescribeMacro[noprint]{\textorn} & \cs{ornamentalstyle}\DescribeMacro[noprint]{\ornamentalstyle} & +p & decorative initials etc.\\
+% \cs{ornament}\DescribeMacro[noprint]{\ornament} & \\
+% \cs{textqt}\DescribeMacro[noprint]{\textqt} & \cs{qtstyle}\DescribeMacro[noprint]{\qtstyle} & +q & quotation style\\
+% \cs{textsh}\DescribeMacro[noprint]{\textsh} & \cs{shstyle}\DescribeMacro[noprint]{\shstyle} & +h & shadowed style\\
+% \cs{texttm}\DescribeMacro[noprint]{\texttm} & \cs{tmstyle}\DescribeMacro[noprint]{\tmstyle} & -s,-v,+t & monowidth typewriter\\
+% \cs{texttv}\DescribeMacro[noprint]{\texttv} & \cs{tvstyle}\DescribeMacro[noprint]{\tvstyle} & -s,-t,+v & variable width typewriter\\
+% \cs{textswash}\DescribeMacro[noprint]{\textswash} & \cs{swashstyle}\tnotex{tn:cf-swstyle}\DescribeMacro[noprint]{\swashstyle} & +w & swash \\
+% \cs{textsw}\tnotex{tn:swshape-not}\DescribeMacro[noprint]{\textsw} & \cs{swshape}\tnotex{tn:swshape-not}\DescribeMacro[noprint]{\swshape} && ‘find a route to swash’ \\
+% \bottomrule
+% \end{tabularx}
+% \begin{tablenotes}
+% \item\label{tn:cf-textlg}Cf.\ \cs{textlg} in \cref{tab:wghts}.
+% \item\label{tn:cf-lgweight}Cf.\ \cs{lgweight} in \cref{tab:wghts}.
+% \item\label{tn:cf-swstyle}Cf.\ \cs{swstyle} in \cref{tab:shapes}.
+% \item\label{tn:swshape-not}Effect is kernel and option dependent, but potentially changes family and/or shape.
+% ‘Tries to find a route to swash.’
+% See text for an explanation of what, why and when.
+% See \cref{sec:imp} for details of how.
+% \end{tablenotes}
+% \end{threeparttable}
+% \end{table}
+% \begin{table}
+% \centering
+% \begin{threeparttable}
+% \caption{Family switches: figures}\label{tab:figs}
+% \begin{tabular}{llTF}
+% \toprule
+% \multicolumn{2}{c}{Macros} & \multicolumn{1}{c}{} & \\
+% \multicolumn{1}{c}{Text Command} & \multicolumn{1}{c}{Switch} & \multicolumn{1}{c}{Family Code} & \sffamily Style of Figures \\
+% \midrule
+% \cs{textln}\tnotex{tn:orig}\DescribeMacro[noprint]{\textln} & \cs{lnstyle}\tnotex{tn:orig}\DescribeMacro[noprint]{\lnstyle} & -- & lining (cf.~\cs{lstyle} below)\\
+% \cs{textos}\tnotex{tn:orig}\DescribeMacro[noprint]{\textos} & \cs{osstyle}\tnotex{tn:orig}\DescribeMacro[noprint]{\osstyle} & j & oldstyle (cf.~\cs{ostyle} below)\\
+% \cs{textinf}\DescribeMacro[noprint]{\textinf} & \cs{infstyle}\DescribeMacro[noprint]{\infstyle} & 0 & inferior \\
+% & \cs{instyle}\DescribeMacro[noprint]{\instyle} & & \\
+% \textcolor{gray}{\cs{textin}\tnotex{tn:textin-dep}}\DescribeDMacro[noprint]{\textin} & & & \textcolor{gray}{if \lpack{hyperref} is not loaded} \\
+% \cs{textsu}\DescribeMacro[noprint]{\textsu} & \cs{sustyle}\DescribeMacro[noprint]{\sustyle} & 1 & superior \\
+% \cs{textl}\tnotex{tn:new}\DescribeMacro[noprint]{\textl} & \cs{lstyle}\tnotex{tn:new}\DescribeMacro[noprint]{\lstyle} & -j & lining (cf.~\cs{lnstyle} above)\\
+% \cs{texto}\tnotex{tn:new}\DescribeMacro[noprint]{\texto} & \cs{ostyle}\tnotex{tn:new}\DescribeMacro[noprint]{\ostyle} & +j & oldstyle (cf.~\cs{osstyle} above)\\
+% \cs{textp}\tnotex{tn:new}\DescribeMacro[noprint]{\textp} & \cs{pstyle}\tnotex{tn:new}\DescribeMacro[noprint]{\pstyle} & +2 & proportional \\
+% \cs{textt}\tnotex{tn:new}\DescribeMacro[noprint]{\textt} & \cs{tstyle}\tnotex{tn:new}\DescribeMacro[noprint]{\tstyle} & -2 & tabular \\
+% \cs{textpl}\tnotex{tn:both}\DescribeMacro[noprint]{\textpl} & \cs{plstyle}\tnotex{tn:both}\DescribeMacro[noprint]{\plstyle} & -j,+2 & proportional lining \\
+% \cs{textpo}\tnotex{tn:both}\DescribeMacro[noprint]{\textpo} & \cs{postyle}\tnotex{tn:both}\DescribeMacro[noprint]{\postyle} & +2j & proportional oldstyle \\
+% \cs{texttl}\tnotex{tn:both}\DescribeMacro[noprint]{\texttl} & \cs{tlstyle}\tnotex{tn:both}\DescribeMacro[noprint]{\tlstyle} & -j,-2 & tabular lining \\
+% \cs{textto}\tnotex{tn:both}\DescribeMacro[noprint]{\textto} & \cs{tostyle}\tnotex{tn:both}\DescribeMacro[noprint]{\tostyle} & +j,-2 & tabular oldstyle \\
+% \bottomrule
+% \end{tabular}
+% \begin{tablenotes}
+% \item\label{tn:orig}This macro is the original \lpack{nfssext} command.
+% The result is independent of the current style of figures.
+% \item\label{tn:textin-dep}Deprecated.
+% \item\label{tn:new}This macro changes precisely one aspect of the current figure style.
+% That is, the result depends on the current style of figures.
+% \item\label{tn:both}This macro ensures a specific fully-specified figure style.
+% \end{tablenotes}
+% \end{threeparttable}
+% \end{table}
+% \begin{table}
+% \centering
+% \begin{threeparttable}
+% \caption{Shape switches}\label{tab:shapes}
+% \begin{tabular}{llTF}
+% \toprule
+% \multicolumn{2}{c}{Macros} & \multicolumn{1}{c}{} & \\
+% \multicolumn{1}{c}{Text Command} & \multicolumn{1}{c}{Switch} & \multicolumn{1}{c}{Shape Code} & \sffamily Shape \\
+% \midrule
+% -- & \cs{scolshape}\DescribeMacro[noprint]{\scolshape} & scol & outline small-caps \\
+% \cs{textol}\DescribeMacro[noprint]{\textol} & \cs{olshape}\DescribeMacro[noprint]{\olshape} & ol & outline\\
+% \cs{textsi}\DescribeMacro[noprint]{\textsi} & \cs{sishape}\DescribeMacro[noprint]{\sishape} & si & italic small-caps\\
+% \cs{textu}\DescribeMacro[noprint]{\textu} & \cs{ushape}\DescribeMacro[noprint]{\ushape} & u & ?? \\
+% \cs{textscu}\DescribeMacro[noprint]{\textscu} & \cs{scushape}\DescribeMacro[noprint]{\scushape} & su & ?? \\
+% \cs{textui}\DescribeMacro[noprint]{\textui} & \cs{uishape}\DescribeMacro[noprint]{\uishape} & ui & upright italic\\
+% \cs{textri}\DescribeMacro[noprint]{\textri} & \cs{rishape}\DescribeMacro[noprint]{\rishape} & ri & reverse italic\\
+% \cs{textdf}\DescribeMacro[noprint]{\textdf} & \cs{dfshape}\DescribeMacro[noprint]{\dfshape} & n & default shape\\
+% -- & \cs{swstyle}\tnotex{tn:cf-swashstyle}\DescribeMacro[noprint]{\swstyle} & +w,it & swash family \emph{and} shape \\
+% \cs{textsw}\tnotex{tn:cf-textswash}\tnotex{tn:cf-swshape-not-shape}\DescribeMacro[noprint]{\textsw} & \cs{swshape}\tnotex{tn:cf-swshape-not-shape}\DescribeMacro[noprint]{\swshape} && ‘find a route to swash’ \\
+% \bottomrule
+% \end{tabular}
+% \begin{tablenotes}
+% \item\label{tn:cf-textswash}Cf.~\cs{textswash} in \cref{tab:gen}.
+% \item\label{tn:cf-swashstyle}Cf.~\cs{swashstyle} in \cref{tab:gen}.
+% \item\label{tn:cf-swshape-not-shape}Definition is kernel and option dependent, but probably doesn't (just) change shape.
+% See \cref{tab:gen} for sketch and text for details.
+% \end{tablenotes}
+% \end{threeparttable}
+% \end{table}
+% \begin{table}
+% \centering
+% \caption{Series switches: widths}\label{tab:wds}
+% \begin{tabular}{llTF}
+% \toprule
+% \multicolumn{2}{c}{Macros} & \multicolumn{1}{c}{} & \\
+% \multicolumn{1}{c}{Text Command} & \multicolumn{1}{c}{Switch} & \multicolumn{1}{c}{Series Code} & \sffamily Width \\
+% \midrule
+% \cs{textnw}\DescribeMacro[noprint]{\textnw} & \cs{nwwidth}\DescribeMacro[noprint]{\nwwidth} & +c & narrow \\
+% \cs{textcd}\DescribeMacro[noprint]{\textcd} & \cs{cdwidth}\DescribeMacro[noprint]{\cdwidth} & +c & compact \\
+% \cs{textec}\DescribeMacro[noprint]{\textec} & \cs{ecwidth}\DescribeMacro[noprint]{\ecwidth} & +ec & extra compact \\
+% \cs{textuc}\DescribeMacro[noprint]{\textuc} & \cs{ucwidth}\DescribeMacro[noprint]{\ucwidth} & +uc & ultra compact \\
+% -- & \cs{mdwidth}\DescribeMacro[noprint]{\mdwidth} & +?m & medium \\
+% \cs{textet}\DescribeMacro[noprint]{\textet} & \cs{etwidth}\DescribeMacro[noprint]{\etwidth} & +x & extended \\
+% \cs{textep}\DescribeMacro[noprint]{\textep} & \cs{epwidth}\DescribeMacro[noprint]{\epwidth} & +x & expanded \\
+% \cs{textex}\DescribeMacro[noprint]{\textex} & \cs{exwidth}\DescribeMacro[noprint]{\exwidth} & +ex & extra expanded \\
+% \cs{textux}\DescribeMacro[noprint]{\textux} & \cs{uxwidth}\DescribeMacro[noprint]{\uxwidth} & +ux & ultra expanded \\
+% \cs{textrw}\DescribeMacro[noprint]{\textrw} & \cs{regwidth}\DescribeMacro[noprint]{\regwidth} & -- & regular \\
+% \bottomrule
+% \end{tabular}
+% \end{table}
+% \begin{table}
+% \centering
+% \begin{threeparttable}
+% \caption{Series switches: weights}\label{tab:wghts}
+% \begin{tabular}{llTF}
+% \toprule
+% \multicolumn{2}{c}{Macros} & \multicolumn{1}{c}{} & \\
+% \multicolumn{1}{c}{Text Command} & \multicolumn{1}{c}{Switch} & \multicolumn{1}{c}{Series Code} & Weight \\
+% \midrule
+% -- & \cs{mdweight}\DescribeMacro[noprint]{\mdweight} & +m? & medium \\
+% \cs{textmb}\DescribeMacro[noprint]{\textmb} & \cs{mbweight}\DescribeMacro[noprint]{\mbweight} & +mb & medium-bold \\
+% \cs{textdb}\DescribeMacro[noprint]{\textdb} & \cs{dbweight}\DescribeMacro[noprint]{\dbweight} & +db & demi-bold \\
+% \cs{textsb}\DescribeMacro[noprint]{\textsb} & \cs{sbweight}\DescribeMacro[noprint]{\sbweight} & +sb & semi-bold \\
+% \cs{textbd}\DescribeMacro[noprint]{\textbd} & \cs{bdweight}\DescribeMacro[noprint]{\bdweight} & +b & bold \\
+% & \cs{bfweight}\DescribeMacro[noprint]{\bfweight} & & \\
+% \cs{texteb}\DescribeMacro[noprint]{\texteb} & \cs{ebweight}\DescribeMacro[noprint]{\ebweight} & +eb & extra-bold \\
+% \cs{textub}\DescribeMacro[noprint]{\textub} & \cs{ubweight}\DescribeMacro[noprint]{\ubweight} & +ub & ultra-bold \\
+% \cs{textlg}\tnotex{tn:cf-textlt}\DescribeMacro[noprint]{\textlg} & \cs{lgweight}\tnotex{tn:cf-ltstyle}\DescribeMacro[noprint]{\lgweight} & +l & light when weight \\
+% \cs{textel}\DescribeMacro[noprint]{\textel} & \cs{elweight}\DescribeMacro[noprint]{\elweight} & +el & extra-light \\
+% \cs{textul}\DescribeMacro[noprint]{\textul} & \cs{ulweight}\DescribeMacro[noprint]{\ulweight} & +ul & ultra-light \\
+% \bottomrule
+% \end{tabular}
+% \begin{tablenotes}
+% \item\label{tn:cf-textlt}Cf.\ \cs{textlt} in \cref{tab:gen}.
+% \item\label{tn:cf-ltstyle}Cf.\ \cs{ltstyle} in \cref{tab:gen}.
+% \end{tablenotes}
+% \end{threeparttable}
+% \end{table}
+%
+% One further macro is available, though it has no effect on older kernels.
+%
+% \DescribeMacro{\nfssextset}\marg{key-value list}
+%
+% Package options (see \cref{sec:nkern} may also be specified after loading either in the preamble (\texttt{compat} and \texttt{force}) or at any time (\texttt{debug}).
+% This enables users to set options after some other package loads \lpack{nfssext-cfr} and allows additional information to be printed to the console and/or logged on local basis.
+%
+% \iffalse
+%^^A \section{Applications}
+%^^A
+%^^A \lpack{nfssext-cfr} may be used by any font support package which supports fonts named according to the Berry scheme and uses compatible settings in its font definition files.
+%^^A
+%^^A In general, the package does little or nothing to extend support for arbitrary fonts.
+%^^A If your favourite font's support package doesn't do what you want, it is highly unlikely loading this package will help.
+%^^A There is usually no reason to load the package in documents, because any package requiring it should explicitly load it as a dependency.
+%^^A
+%^^A However, due to complications resulting from recent changes to \LaTeX's \nfss{} in \nnfss, those using current (or even moderately recent) versions of \LaTeX{} \emph{may} need to pass the package options as explained below.
+%^^A
+%^^A Furthermore, \lpack{nfssext-cfr} may be useful if you are using a font support package which provides an option to load, say, light and semi-bold in place of regular/medium and bold.
+%^^A If the package does not allow you to use more than two weights in a single document, loading \lpack{nfssext-cfr} should allow you to access the otherwise inaccessible weights.
+%^^A
+%^^A The same principle works for widths: if the package allows you to choose between, say, condensed and regular width at load time, but doesn't provide commands to switch in the document itself, \lpack{nfssext-cfr} may enable you to access the full range of widths.
+%^^A
+%^^A The same would apply to a package which offered, say, a choice of standard, reverse and/or upright italics, but did not allow you to switch between them.
+%^^A I'm not aware of any such package, but \lpack{nfssext-cfr} could be useful if such exists.
+%^^A
+%^^A However, this principle does \textbf{not} extend to the style of figures, use of swash or choice of alternate ligatures etc\@.
+%^^A If your preferred font support package offers you a choice of proportional/tabular and/or hanging/lining figures, but provides no means to switch between them, \lpack{nfssext-cfr} is unlikely to help unless the package happens to use Berry naming\footnote{%
+%^^A Most packages don't.
+%^^A In particular, packages which use \texttt{autoinst} do not generally use Berry names.}.
+%^^A
+% \fi
+%
+%
+% \section{Newer \LaTeX{} Kernels}\label{sec:nkern}
+%
+% The package tests for the presence of \cs{init@series@setup}.
+% If this exists, it loads a newer version of the package.
+% \lpack{nfssext-cfr} supports three options, but these are only effective if the newer code (for \nnfss) is loaded.
+% All three are booleans, initially false and default to true if used without specifying a value\footnote{%
+% ‘Default’ and ‘initial’ follow the usage in \file{l3interface.pdf}, \lpack{l3keys2e} and \file{clsguide.pdf}.
+% If you are familiar with \lpack{pgfkeys}, the terms have the same meaning there.
+% Basically, the ‘initial’ value is what you get if you don't specify the option at all when loading the package, while the ‘default’ is what you get if you specify the option without specifying a value.
+%
+% ‘Scope’ is used in the standard sense applicable to \LaTeXe{} class and package options.
+% That is, it indicates whether the option may be used only when loading the package, at any point in the preamble or also in the document.%
+% }.
+% The third option is described in \cref{sec:trafferth}.
+%
+% \DescribeOpt{force}\vals{true,false}
+%
+% Default: \texttt{true}
+%
+% Initial: \texttt{false}
+%
+% Scope: preamble
+%
+% You can force the old code to be loaded using the package option \texttt{force} or \texttt{force=true}.
+% Note, however, that the old version will not work as advertised on newer kernels because \LaTeX{} will overwrite some of the package's definitions at the end of the preamble.
+%
+% \DescribeOpt{compat}\vals{true,false}
+%
+% Default: \texttt{true}
+%
+% Initial: \texttt{false}
+%
+% Scope: preamble
+%
+% In contrast, \texttt{compat} or \texttt{compat=true} will activate code which tries to partially replicate the original \lpack{nfssext-cfr}'s behaviour.
+% This is far from unproblematic.
+% In particular, it will partly break features of the current \nfss{} for other fonts.
+%
+% If your document relies exclusively on text fonts supported by this package and none of the support for those fonts has been updated, compilation should produce a more satisfactory result than otherwise.
+% If, however, your document relies partly on text fonts not supported by this package or the support for those fonts has been updated in the ‘wrong’ way, compilation may produce a less satisfactory result.
+% There is no general rule here: whether the option helps or hinders things depends entirely on the fonts, the support for those fonts and the specific contents of your document.
+%
+% The main areas known to be problematic are
+% \begin{enumerate}
+% \item\label{enum:si} italic small-capitals (but oblique small-capitals should be mostly unaffected);
+% \item\label{enum:swash} swash;
+% \item\label{enum:it} transitions between small-caps, italic, oblique, italic small-caps, oblique small-caps, upright italic, right italic and upright;
+% \item\label{enum:swshape} any transition involving swash where shape is involved;
+% \item\label{enum:m} medium weight fonts where width is non-standard e.g.~medium condensed, medium ultra condensed etc.;
+% \item\label{enum:mb} medium bold weight in any context.
+% \end{enumerate}
+% \ref{enum:si}--\ref{enum:swshape} can be worked around at the document level, with some inconvenience.
+% Subject to the caveats above, the \texttt{compat} option may avoid at least some of these inconveniences.
+%
+% \ref{enum:m} and \ref{enum:mb} cannot be worked around at the document level.
+% Nor does \lpack{nfssext-cfr} make any attempt to mitigate these two issues.
+% Doing so would involve too much interference with current \nnfss{}.
+% This means that \ref{enum:m} and \ref{enum:mb} can be addressed only in the support files for the fonts affected.
+% Neither \texttt{compat} nor \texttt{force} makes any attempt to change this.
+%
+% Maximum backwards compatibility requires changes to the font support files \emph{and} \texttt{compat=false}, but some documents may still require (hopefully minor) changes.
+%
+% \subsection{Required Changes to Font Support Files}\label{subsec:fsf}
+%
+% \textbf{In all cases, additional changes to font substitution rules may be needed to prevent multiple substitutions by the same font, since these seem to cause problems.}
+%
+% \begin{description}
+% \item[italic small-caps] The problem here is that \lpack{nfssext} encoded italic small-caps as shape \texttt{si}, whereas the kernel has plumped for \texttt{scit}.
+% It does support \texttt{scsl} (although it does not distinguish oblique from italic), but not \texttt{si}.
+% This issue can be more-or-less dealt with by support files for fonts, but some issues arise at the document level concerning transitions (below).
+%
+% Ideally, \texttt{scit} should be substituted wherever font definition files specify the shape \texttt{si}.
+% \texttt{scit} should then be defined as a (silent) substitution for \texttt{si}.
+% However, it \emph{should} be sufficient to define \texttt{si} as a substitute for \texttt{scit}.
+%
+% Fonts which provide oblique small-caps, but not italic, should specify \texttt{scsl} as a (silent) substitution for \texttt{scit} and \texttt{scit} for \texttt{si} (or \emph{vice-versa}).
+% The kernel supports \texttt{scsl} out-of-the-box, together with the substitution for \texttt{scit}, but the changes should make support for \cs{textsi} and \cs{sishape} more robust.
+% \item[transitions] \textbf{No additional changes are recommended to support files which load \lpack{nfssext-cfr}.}
+% Provided \texttt{fd} files are updated as explained above, no further adjustments should be required to enable correct font selection during transitions involving italic, oblique, small-caps, upright italic, reverse italic etc\@.
+%
+% \item[swash] \textbf{No changes are recommended for swash to font definition files for packages which load \lpack{nfssext-cfr}.}
+% If loading \lpack{nfssext-cfr}, the recommendation is to \textbf{ignore} the kernel's implementation because it cannot be made to work correctly with any family which provides swash for multiple shapes e.g.~both upright and italic or small-caps and upper/lower case\footnote{%
+% The issue here is that the kernel considers swash to be a \emph{shape}, whereas \lpack{nfssext} only \emph{called} it a shape.
+% The underlying code treated it as a \emph{style} requiring a change of font \emph{family}.
+% The shape was always (potentially switched to) italic (\texttt{it}).
+% \lpack{nfssext-cfr} offered a second version of swash, which treats it as a family possibly requiring a change of shape, but the shape is typically italic or upright, as opposed to being specific to swash.
+%
+% To make things worse, not all fonts \emph{can} be setup in the way the kernel assumes because some fonts provide swash characters in a variety of shapes (upright and italic, for example).
+% Moreover, it is common to encode additional ligatures, for example, as swash, even though this is not accurate, in order to provide \emph{some} mechanism for accessing them within a traditional 8-bit font setup.%
+% }.
+%
+% \item[swshape] \textbf{No changes for swash are recommended for \texttt{sty} files in packages which load \lpack{nfssext-cfr}.}
+%
+% \lpack{nfssext-cfr-nfss} contains the original \lpack{nfssext} definition of \cs{swshape} and \cs{textsw}.
+% This is used on newer kernels only if \texttt{force} is used, in which case the code is largely broken.
+%
+% \lpack{nfssext-cfr-nnfss} contains both the original definition and a replacement.
+% The former is used only if \texttt{compat} is selected; otherwise, the latter is used on kernels supporting \nnfss.
+% The new definition tries to figure out which of the three possible implementations, if any, to use and behaves accordingly.
+% \textbf{The kernel definition is overwritten regardless.}
+% \texttt{compat} determines only \emph{what} overwrites the kernel's.
+% \item[medium] Any line of a font definition file which codes a series of two or more letters including \texttt{m} must be changed to delete the \texttt{m}.
+% For example, \texttt{\{mc\}} \textrightarrow{} \texttt{\{c\}}, \texttt{\{muc\}} \textrightarrow{} \texttt{\{uc\}} etc\@.
+% \textbf{It is NOT sufficient to substitute such series using rules.}
+% The changes \textbf{must} be made in the primary definitions of the font families.
+% \item[mb] I've chosen to make \cs{mbweight} an alias for \cs{sbweight}.
+% Hopefully no font family supports both.
+% Provided that's not the case, \texttt{mb} should be changed to \cs{sb} in all affected font definition files.
+% \textbf{It is NOT sufficient to substitute \texttt{mb} for \texttt{sb} using a rule.}
+% The change \textbf{must} be made in the definition of the family.
+% \end{description}
+%
+%
+% \section{Older \LaTeX{} Kernels}\label{sec:okern}
+%
+% This is the code base \lpack{nfssext} was written for.
+% \lpack{nfssext-cfr} extended that code.
+%
+% To the best of my knowledge, the code used with older \LaTeX{} kernels works as expected.
+% This means it is fully compatible with the Font Installation Guide and that things like \texttt{\textbackslash scshape \textbackslash itshape} will produce italic small-caps, as expected.
+% This code is also --- again to the best of my knowledge --- fully compatible with all features of \nfss{} with the single exception of code supporting medium weight, condensed width fonts which erroneously uses \texttt{mc} rather than \texttt{c}.
+%
+% Italic small-caps is assumed to be coded as \texttt{si}.
+% Oblique small-caps is assumed to be coded as \texttt{scsl}.
+%
+% If a set of fonts provides a swash \emph{family}, it is assumed the fonts are named in accordance with the Berry scheme.
+% \cs{textswash}, \cs{swshape}, \cs{swashstyle} and/or \cs{swstyle} can then be used to access this family.
+%
+% The difference between \cs{swashstyle} and \cs{swstyle} is that the former tries to merge any swash family with the current one, whereas the latter does not.
+% So, if a font set provides swash for two widths of font, say, and you've changed widths, \cs{swashstyle} will try to find a swash character without altering the width, whereas \cs{swstyle} will first switch to the base font, resetting the width.
+% On the other hand, if the font only provides swash in the standard width, say, and you've changed widths, \cs{swashstyle} will fail to switch to swash, whereas \cs{swstyle} will succeed.
+% Packages which include swash families should, therefore, advise users which command(s) to use.
+%
+% \cs{textswash} is the text font command for \cs{swashstyle}.
+% \cs{textsw} is the text font command for \cs{swshape}.
+%
+% \cs{swshape} first tries \cs{swstyle} before changing the shape to \cs{swshapedefault}.
+% By default, this is \cs{itdefault} because swash families are often coded as italic, but this is obviously font-dependant.
+%
+% \section{Bugs, Non-Bugs \& Debugging}\label{sec:trafferth}
+%
+% The actual effect of any macro depends on any changes made to the defaults for various font features, the current font and, of course, what is available.
+%
+%^^A For example, \cs{itdefault} is intended to be the name of italic shape and is used by the redefined \cs{itshape} supplied by this package for older kernels.
+%^^A By default, \cs{itdefault} is \texttt{it}.
+%^^A However, if you change that to, say, \texttt{sl}, then \cs{itshape} will use \texttt{sl} instead.
+%^^A Note that changing \cs{itdefault} will have no effect on newer kernels.
+%^^A
+%^^A Moreover, if the current shape is small-caps, \cs{itshape} will attempt to merge the default italic shape with the small-caps on older kernels.
+%^^A That is, it will try to select small-caps italic, if possible, before resorting to plain italic.
+%^^A On newer kernels, this attempt is builtin for a limited range of shape and series changes.
+%^^A
+% The macros operating on family names are almost entirely reliant on font names adhering strictly to the Karl Berry schema.
+% This includes the stipulation that multiple variants be listed in alphabetical order.
+% These macros cannot be used with fonts named in any other way.
+%
+%^^A Although font definition files \emph{should} adhere to the series and shape codes specified by \nfss{}, some do not.
+%^^A In particular, some newer packages prepared with \texttt{autoinst} use descriptive, but non-standard, codes.
+%^^A While these work fine if the packages provide comprehensive access to the series and shapes they support, they otherwise require bespoke solutions if extensions are required.
+%^^A
+%^^A Provided font definition files do adhere to the standard encoding conventions, however, macros for changing weight, width and shape in \lpack{nfssext-cfr} should work fine on newer kernels (\nnfss).
+% On older kernels (\nfss), changes to weight and width should work and most shapes should be supported, but italic small-caps is assumed to be coded as \texttt{si} on these kernels, so you may need something like
+% \iffalse
+%<*verb>
+% \fi
+% \begin{verbatim}
+\renewcommand*{\sidefault}{scit}% or scsl or whatever
+% \end{verbatim}
+% \iffalse
+%</verb>
+% \fi
+% On newer kernels, italic small-caps should be encoded as explained above and \cs{sishape}/\cs{textsi} should work out-of-the-box with packages which use any of \texttt{si}, \texttt{scit} or \texttt{scsl}.
+%
+% If a macro's attempt to enable or disable a font feature fails, a warning will generally be written to the console, but the code tries hard not to trigger errors.
+% If an attempt triggers an error, that's a bug, so please let me know.
+% If an attempt triggers a warning, please note that there may be no bug at all and, if there is a bug, it is probably not in this package\footnote{%
+% To be clear, there certainly are bugs.
+% It is just statistically unlikely that any given warning is caused by one.}
+%
+% \DescribeOpt{debug}\vals{true,false}
+%
+% Default: \texttt{true}
+%
+% Initial: \texttt{false}
+%
+% Scope: general
+%
+% You can get a bit more information printed to the console about what's happening using this option on newer kernels.
+% Some of the same information can also be found in the log.
+%
+% \changes{v6140}{2017-03-28}{%
+% Extend documentation somewhat.}
+%
+% \changes{2010-07-17}{2015-06-19}{%
+% There should be no changes for the end user except that in certain cases it is possible that line-breaks may be altered if \lpack{microtype} is in use due to the enhanced support included for variant font families.}
+%
+% \MaybeStop{%
+% \PrintChanges
+% \setcounter{IndexColumns}{2}%
+% \PrintIndex
+% }
+%
+% \section{Implementation}\label{sec:imp}
+%
+% You do not need to read the remainder of this document in order to install or use the package.
+%
+% \subsection{Main package file}\label{subsec:main}
+%
+% This used to be the complete package.
+% Now it is mostly responsible for processing options, figuring out which kernel we're on and implementing the small amount of code shared between the implementations for \nfss{} and \nnfss{}.
+%
+% \iffalse
+%<*sty>
+% \fi
+% \begin{package}{nfssext-cfr}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{svn-prov}
+\ProvidesPackageSVN[\filebase.sty]{$Id: nfssext-cfr.dtx 10456 2024-10-03 01:19:12Z cfrees $}[v1.1 \revinfo{} extensions for NFSS and NNFSS; based on 2003/03/14 v1.2 Experimental NFSS Extensions]
+\DefineFileInfoSVN
+% \end{macrocode}
+% ^^A Paid â defnyddio \GetFileInfoSVN*/\GetFileInfoSVN{} yn y fan hon!!
+%
+%
+% \changes{v0.0}{2020-2024}{Update for \nnfss.}
+%
+% \changes{v1.0}{2024-09-16}{%
+% So \lpack{nfssext-cfr} merging is now limited to family, weight and width.}
+%^^A I *could* use font change rules for weight and width - this would make sense if I could be confident of catching all cases *and* it didn't cause problems ....
+%^^A the real problem is, I don't know what I'm supposed to avoid ....
+%
+% \changes{v1.0}{2024-09-16}{%
+% Behaviour depends on kernel version and options.
+% On newer kernels, quite conservative/less compatible by default.
+% Fully compatible on older kernels.}
+%
+% \changes{v1.0}{2024-09-16}{Split \file{nfssext-cfr.sty} into \file{nfssext-cfr\{,-nfss,-nnfss\}.sty}.}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \begin{macro}{\if@nfssextcfr@digonnew}
+% \mbox{ }
+% \begin{macrocode}
+\newif\if@nfssextcfr@digonnew
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\@nfssextcfr@digonnewtrue
+% \end{macrocode}
+% Copied verbatim, excepting format and modulo package/module name from Joseph Wright's \file{siunitx.sty} under LPPL
+% \begin{macrocode}
+\@ifundefined{ExplLoaderFileDate}{%
+ \IfFileExists{expl3.sty}{%
+ \RequirePackage{expl3}%
+ }{%
+ \RequirePackage{nfssext-cfr-nfss}%
+ \@nfssextcfr@digonnewfalse
+ }%
+}{}
+\if@nfssextcfr@digonnew
+% \end{macrocode}
+% Almost verbatim from \file{siunitx.sty}
+% \begin{macrocode}
+ \@ifl@t@r\ExplLoaderFileDate{2022-02-24}{%
+ }{%
+ \RequirePackage{nfssext-cfr-nfss}%
+ \@nfssextcfr@digonnewfalse
+ }%
+\fi
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\if@nfssextcfr@digonnew
+% \end{macrocode}
+% BEGIN expl pkg option setup
+% \begin{macrocode}
+ \newif\ifexfs@debug
+ \ExplSyntaxOn
+ \prop_gput:Nnn \g_msg_module_name_prop { nfssext-cfr } { exfs }
+ \keys_define:nn { exfs }
+ {
+% \end{macrocode}
+% \begin{option}{compat}
+% \changes{v1.0}{2024-09-16}{%
+% Add option \texttt{compat}.
+% More aggressive/backwards compatible with \texttt{compat}.}
+% \begin{macro}{\g__exfs_compat_bool}
+% Compatibility option.
+% \begin{macrocode}
+ compat .bool_gset:N = \g__exfs_compat_bool,
+ compat .default:n = true,
+ compat .initial:n = false,
+ compat .usage:n = preamble,
+% \end{macrocode}
+% \end{macro}
+% \end{option}
+% \begin{option}{debug}
+% Turns info messages into warnings for testing purposes and possibly provides additional information.
+% \changes{v1.0}{2024-09-16}{%
+% Add option \texttt{debug}.}
+% \begin{macrocode}
+ debug .legacy_if_gset:n = exfs@debug,
+ debug .initial:n = false,
+ debug .default:n = true,
+% \end{macrocode}
+% \end{option}
+% \begin{option}{force}
+% \changes{v1.0}{2024-09-16}{%
+% Add option \texttt{force}.
+% Load old file/incompatible with \texttt{force}.}
+% \begin{macro}{\g__exfs_force_bool}
+% Force loading of code for \nfss{} even on newer kernels.
+% \begin{macrocode}
+ force .bool_gset:N = \g__exfs_force_bool,
+ force .default:n = true,
+ force .initial:n = false,
+ force .usage:n = preamble,
+% \end{macrocode}
+% \end{macro}
+% \end{option}
+% \begin{macrocode}
+ }
+% \end{macrocode}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Joseph Wright: from \file{siunitx.sty} ; \url{https://chat.stackexchange.com/transcript/message/64327823#64327823}
+% \begin{macrocode}
+ \providecommand \IfFormatAtLeastTF { \@ifl@t@r \fmtversion }
+ \IfFormatAtLeastTF { 2022-06-01 }
+ {
+ \ProcessKeyOptions [ exfs ]
+ }{
+ \RequirePackage { l3keys2e }
+ \ProcessKeysOptions { exfs }
+% \end{macrocode}
+% \begin{macro}{\ProcessKeyOptions}
+% \mbox{ }
+% \begin{macrocode}
+ \NewDocumentCommand \ProcessKeyOptions { o }
+ {
+ \IfValueTF { #1 } { \ProcessKeysOptions { #1 } }
+ { \PackageError{nfssext-cfr}{
+ Optional~argument~mandatory~on~kernels~this~old.\MessageBreak
+ Please~specify~the~module~whose~keys~should~be~processed
+ }{
+ \protect\ProcessKeyOptions~only~passes~keys~to~
+ \protect\ProcessKeyOptions\MessageBreak
+ on~older~kernels~for~the~convenience~of~package~authors.~
+ Since~\protect\ProcessKeysOptions\MessageBreak
+ takes~an~argument,~the~optional~argument~to~
+ \protect\ProcessKeyOptions~is~required
+ }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ }
+ \IfFormatAtLeastTF { 2020-10-01 }{
+ }{
+ \RequirePackage { xparse }
+% \end{macrocode}
+% \begin{macro}{\ExpandArgs}
+% \mbox{ }
+% \begin{macrocode}
+ \providecommand \ExpandArgs [1]
+ { \cs_if_exist_use:c { exp_args:N #1 } }
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ }
+% \end{macrocode}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% END expl pkg option setup
+%
+% BEGIN cfr-added: bifurcate
+%
+% We test for the presence of \cs{init@series@setup} in order to determine whether to load code for \nnfss{} or \nfss.
+% If \texttt{force} is set, we load for \nfss{} regardless.
+% \begin{macrocode}
+ \RequirePackage{etoolbox}
+ \msg_new:nnn { nfssext-cfr } { compat }
+ {
+ You ~ or ~ a ~ font-support ~ package ~ have ~ loaded ~ me ~ ( line ~ \msg_line_number: ) ~ with ~ the ~ compat ~ option. ~
+ This ~ means ~ the ~ package ~ may ~ require ~ updating. ~
+ Update ~ the ~ package ~ if ~ necessary ~ and ~ use ~ compat=false ~ when ~ loading ~ me.
+ }
+ \msg_new:nnn { nfssext-cfr } { force }
+ {
+ You ~ or ~ a ~ font-support ~ package ~ have ~ loaded ~ me ~ ( line ~ \msg_line_number: ) ~ with ~ the ~ force ~ option. ~
+ This ~ is ~ a ~ desperate ~ measure ~ of ~ last ~ resort. ~
+ **Breakage ~ is ~ expected.**
+ }
+ \hook_gput_code:nnn { begindocument/before } { . }
+ {
+ \cs_if_exist:NTF \init@series@setup
+ {
+ \bool_if:NTF \g__exfs_force_bool
+ {
+ \msg_warning:nn { nfssext-cfr } { force }
+ \RequirePackage {nfssext-cfr-nfss}
+ }{
+ \bool_if:NT \g__exfs_compat_bool
+ {
+ \msg_warning:nn { nfssext-cfr } { compat }
+ }
+ \RequirePackage {nfssext-cfr-nnfss}
+ }
+ }{% achosiad heb broblemau - diolch byth!
+ \RequirePackage {nfssext-cfr-nfss}
+ }
+ }
+% \end{macrocode}
+% \begin{macro}{\__exfs_set:n}
+% \begin{macrocode}
+ \cs_new_protected_nopar:Nn \__exfs_set:n
+ {
+ \keys_set:nn { exfs } { #1 }
+ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\nfssextset}
+% Allow setting of options later in preamble or in document.
+% This is intended to enable debugging to be toggled locally.
+% \begin{macrocode}
+ \cs_set_eq:NN \nfssextset \__exfs_set:n
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ \ExplSyntaxOff
+% \end{macrocode}
+% END added
+% \begin{macro}{\DeclareTextOrnament,\ornament}
+% These are unmodified from \lpack{nfssext}.
+% I'm not aware of any \ctan{} packages using these and they have not been tested for compatibility with \nnfss{}, though I can't see any patently obvious problems.
+% \begin{macrocode}
+ \newcommand*{\DeclareTextOrnament}[7]{%
+ \expandafter\def\csname#1@orn\@roman#2\endcsname{#3/#4/#5/#6/#7}}
+ \begingroup
+ \catcode`\/=12
+ \gdef\exfs@split@orndef#1/#2/#3/#4/#5\@nil{%
+ \def\f@encoding{#1}%
+ \def\f@family{#2}%
+ \def\f@series{#3}%
+ \def\f@shape{#4}%
+ \def\exfs@tempa{#5}}
+ \endgroup
+ \def\exfs@base@family{\expandafter\exfs@get@base\f@family\@nil}
+ \DeclareRobustCommand{\ornament}[1]{%
+ \expandafter\ifx\csname\exfs@base@family @orn\@roman#1\endcsname\relax
+ \PackageWarning{nfssext}{%
+ Ornament #1 undefined for font family '\exfs@base@family'\MessageBreak
+ Setting debug mark}%
+ \rule{1ex}{1ex}%
+ \else
+ \begingroup
+ \edef\exfs@tempb{\csname\exfs@base@family @orn\@roman#1\endcsname}%
+ \expandafter\expandafter\expandafter\exfs@split@orndef
+ \expandafter\string\exfs@tempb\@nil
+ \selectfont\char\exfs@tempa
+ \endgroup
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\nfssextcfr@MT@Hook,\Microtype@Hook}
+% BEGIN add \lpack{microtype} hooks
+% Partly from \lpack{microtype} docs; partly from \lpack{MinionPro} package
+% \changes{2010-07-17}{2015/06/19}{%
+% Add \lpack{microtype} support for variants.}
+% \begin{macrocode}
+\def\nfssextcfr@MT@Hook{%
+% \end{macrocode}
+%^^A \DeclareMicrotypeVariants{x,j,w,a,d,0,1}% this is the default declaration according to the docs
+%^^A \DeclareMicrotypeVariants*{2,e,h,l}% this should *append* the variants (what do I use 'f' for? better take it out...)
+% \begin{macrocode}
+ \DeclareMicrotypeVariants*{2,2d,2dj,2j,dj,e,h,l}% is this necessary or would the previous line be enough?
+ }
+ \@ifpackageloaded{microtype}{%
+ \PackageWarning{nfssext-cfr}{%
+ You have loaded me (or a font support package which loads me)\MessageBreak
+ after loading microtype, but microtype should be loaded after\MessageBreak
+ all font defaults have been setup}%
+ \nfssextcfr@MT@Hook
+ }{%
+ \@ifundefined{Microtype@Hook}{%
+ \let\Microtype@Hook\nfssextcfr@MT@Hook
+ }{% MinionPro has \global before this
+ \g@addto@macro\Microtype@Hook{\nfssextcfr@MT@Hook}%
+ }%
+ }
+% \end{macrocode}
+% \end{macro}
+% \changes{v1.1}{2024-10-03}{Fix grouping cock up.}
+% \begin{macrocode}
+\fi
+% END
+% \end{macrocode}
+% \end{package}
+% \iffalse
+%</sty>
+% \fi
+%
+% \subsection{NNFSS}\label{subsec:sty-nnfss}
+%
+%
+% This code was written for the \emph{current} (New) New Font Selection Scheme (2020--).
+% It should not generally be loaded on older kernels.
+%
+%
+% \iffalse
+%<*sty-nnfss>
+% \fi
+% \begin{package}{nfssext-cfr-nnfss}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{svn-prov}
+\ProvidesPackageSVN[\filebase-nnfss.sty]{$Id: nfssext-cfr.dtx 10456 2024-10-03 01:19:12Z cfrees $}[v1.1 \revinfo{} extended New New Font Selection Scheme (NNFSS) based on 2003/03/14 v1.2 Experimental NFSS Extensions]
+\DefineFileInfoSVN
+% \end{macrocode}
+% ^^A Paid â defnyddio \GetFileInfoSVN*/\GetFileInfoSVN{} yn y fan hon!!
+% END added
+% \begin{macro}{\exfs@tempa,\exfs@tempb,\exfs@tempf}
+% Scratch variables.
+% \begin{macrocode}
+\newcommand*{\exfs@tempa}{}
+\newcommand*{\exfs@tempb}{}
+% \end{macrocode}
+%:end-added
+% BEGIN added (cfr): extra variable (\cs{exfs@tempf})
+% \begin{macrocode}
+\newcommand*{\exfs@tempf}{}
+% \end{macrocode}
+% \end{macro}
+% We want to track cases where missing fonts get defined into existence.
+% To do this we define an additional macro each time \cs{wrong@fontshape} is called.
+% This is based on two proposals by Max Chernoff, but the implementation is different.
+% \begin{macrocode}
+\ExplSyntaxOn
+\hook_gput_code:nnn { cmd/wrong@fontshape/before } { . }
+{
+ \global\expandafter\expandafter\expandafter\let
+ \expandafter \csname exfs@fake@ \curr@fontshape\endcsname\relax
+}
+\ExplSyntaxOff
+% \end{macrocode}
+% \begin{macro}{\exfs@info}
+% Custom logging
+% \begin{macrocode}
+\newcommand \exfs@info[2][nfssext-cfr]{%
+ \ifexfs@debug
+ \PackageWarning{#1}{Info: #2}%
+ \else
+ \PackageInfo{#1}{#2}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% END added
+%
+% \begin{macro}{\exfs@normalise}
+% BEGIN added (cfr): normalise
+% \begin{macrocode}
+\newcommand* \exfs@normalise[1]{%
+ \ifcsname exfs@fake@\curr@fontshape\endcsname
+ \exfs@info{Current font '\curr@fontshape' is fake.\MessageBreak
+ Normalising}%
+ \expandafter\csname f@#1\endcsname{\csname #1default\endcsname}\selectfont
+ \ifcsname exfs@fake@\curr@fontshape\endcsname
+ \f@series{\seriesdefault}\f@shape{\shapedefault}\selectfont
+ \ifcsname exfs@fake@\curr@fontshape\endcsname
+% \end{macrocode}
+% This might happen, I think, if we're in a swash family or specialist encoding
+% where the default series and shape aren't available.
+% All bets are off here so try to bale out as gracefully as we can.
+% \begin{macrocode}
+ \normalfont
+ \ifcsname exfs@fake@\curr@fontshape\endcsname
+% \end{macrocode}
+% This definitely oughtn't to happen, though - things are really screwed up at
+% this point - so error.
+% \begin{macrocode}
+ \PackageError{nfssext-cfr}{Default font appears to be fake!\MessageBreak
+ Switch \textbackslash normalfont yielded '\curr@fontshape'}
+ {This is highly unlikely, so the bug is probably in the phenomena\MessageBreak
+ rather than the noumena}%
+ \fi
+ \fi
+ \fi
+ \exfs@info{Normalised to '\curr@fontshape'}%
+ \else
+ \exfs@info{Current font '\curr@fontshape' appears real}%
+ \fi
+}
+% \end{macrocode}
+% END added
+% \end{macro}
+%
+% \begin{macro}{\exfs@try@family}
+% Modified from \lpack{nfssext}?
+% Or modified from older \lpack{nfssext-cfr}?
+% \begin{macrocode}
+\newcommand*{\exfs@try@family}[2][]{%
+ \let\exfs@tempa\relax
+% \end{macrocode}
+% END added
+%
+% trans: group is requisite here else \LaTeX{} thinks the family real regardless
+% \begin{macrocode}
+ \begingroup % fel arall, bydd latex yn credu bod y family yn go iawn beth bynnag
+% \end{macrocode}
+% (o leiaf bydd latex yn dweud felly)
+% \begin{macrocode}
+ \exfs@info{Trying Font family '\f@encoding/#2'}%
+ \fontfamily{#2}\try@load@fontshape
+% \end{macrocode}
+% \cs{curr@fontshape} holds the target shape - not the current one - after an unsuccessful attempt to load **family** with \cs{try@load@fontshape}.
+% This won't work for series/shape as \cs{curr@fontshape} holds the current one in that case
+% \begin{macrocode}
+ \expandafter\ifx\csname\curr@fontshape\endcsname\relax
+ \edef\exfs@tempa{#1}%
+ \ifx\exfs@tempa\@empty
+ \PackageWarning{nfssext}{%
+ Font family '\f@encoding/#2' not available\MessageBreak
+ Ignoring font switch}%
+ \else
+ \exfs@info[nfssext]{%
+ Font family '\f@encoding/#2' not available\MessageBreak
+ Font family '\f@encoding/#1' tried instead}%
+ \exfs@try@family{#1}%
+ \fi
+ \else
+ \exfs@info{Loading font family '\f@encoding/#2'}%
+ \gdef\exfs@tempa{\fontfamily{#2}\selectfont}%
+ \fi
+ \endgroup
+ \exfs@tempa}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\exfs@try@series}
+% BEGIN added (cfr)
+% \begin{macrocode}
+\newcommand*{\exfs@try@series}[2][]{%
+% \end{macrocode}
+% We don't hand instructions to the kernel unless we know they'll succeed b/c the results are too unpredictable under \nnfss.
+%
+% Changing directly only produces usable results for series defined in the 'table' of font changes.
+% But using higher level kernel interfaces for tests doesn't work because spurious fonts get defined, which only seem to exist.
+% Theoretically, we might as well use the existing kernel's macros since we're already damned by reliance on internals anyway.
+% But then everything needs disentangling.
+% So it's easier to just adapt previous tests, even though it partially duplicates what the kernel does.
+% (But it isn't the mess swash is \dots).
+% \begin{macrocode}
+ \let\exfs@targetseries\relax
+ \edef\exfs@tempa{#2}%
+ \ifx\f@series\exfs@tempa\relax
+ \exfs@info{Current (\f@series) matches target (#2) series.\MessageBreak
+ Ignoring font switch}%
+ \else
+ \begingroup
+ \exfs@normalise{series}%
+ \edef\exfs@tempa{\f@encoding/\f@family/#2/\f@shape}%
+ \ifcsname \exfs@tempa\endcsname
+ \exfs@info{Switching series: \f@series\space -> #2}%
+ \gdef\exfs@targetseries{\fontseries{#2}\selectfont}%
+ \else
+ \edef\exfs@reserved{#1}%
+ \ifx\exfs@reserved\@empty
+ \PackageWarning{nfssext-cfr}{%
+ Font series '\f@encoding/\f@family/#2/\f@shape' not available\MessageBreak
+ Ignoring font change}%
+ \else
+ \PackageWarning{nfssext-cfr}{%
+ Font series '\f@encoding/\f@family/#2/\f@shape' not available\MessageBreak
+ Trying '\f@encoding/\f@family/#1/\f@shape'}%
+ \exfs@try@series{#1}%
+ \fi
+ \fi
+ \endgroup
+ \exfs@targetseries
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%^^A \newcommand*{\exfs@try@shape}[2][]{%
+%^^A Shapes are where the real problems start ....
+%^^A \let\exfs@targetshape\relax
+%^^A \edef\exfs@tempa{#2}%
+%^^A \ifx\f@shape\exfs@tempa\relax
+%^^A \\exfs@info{Current (\f@shape) matches target (#2) shape.\MessageBreak
+%^^A Ignoring font switch}%
+%^^A \else
+%^^A \begingroup
+%^^A \edef\exfs@tempa{\f@encoding/\f@family/\f@series/#2}%
+%^^A \ifcsname \exfs@tempa\endcsname
+%^^A \exfs@info{Switching shape: \f@shape\space -> #2}%
+%^^A \gdef\exfs@targetshape{\fontshape{#2}\selectfont}%
+%^^A \else
+%^^A \begingroup
+%^^A \exfs@normalise{shape}%
+%^^A \ifcsname \exfs@tempa\endcsname
+%^^A \exfs@info{Switching shape: \f@shape\space -> #2}%
+%^^A \gdef\exfs@targetshape{\exfs@normalise{shape}\fontshape{#2}\selectfont}%
+%^^A \endgroup
+%^^A \else
+%^^A \edef\exfs@reserved{#1}%
+%^^A \ifx\exfs@reserved\@empty
+%^^A \PackageWarning{nfssext-cfr}{%
+%^^A Font shape '\f@encoding/\f@family/\f@series/#2' not available\MessageBreak
+%^^A Ignoring font change}%
+%^^A \else
+%^^A \PackageWarning{nfssext-cfr}{%
+%^^A Font shape '\f@encoding/\f@family/\f@series/#2' not available\MessageBreak
+%^^A Trying '\f@encoding/\f@family/\f@series/#1'}%
+%^^A \exfs@try@shape{#1}%
+%^^A \fi
+%^^A \fi
+%^^A \fi
+%^^A \fi
+%^^A \endgroup
+%^^A \exfs@targetshape
+%^^A \fi}
+% \begin{macro}{\exfs@try@shapeshift}
+% Attempt to leverage kernel's mechanism.
+% \begin{macrocode}
+\def\exfs@try@shapeshift#1{%
+ \edef\exfs@targetshape{\csname #1default\endcsname}%
+ \ifx\f@shape\exfs@targetshape\relax
+ \exfs@info{Current (\f@shape) matches target (#1) shape.\MessageBreak
+ Ignoring font switch}%
+ \else
+ \not@math@alphabet\edef\exfs@targetshape\relax
+ \exfs@info{\f@shape\space -> \exfs@targetshape\MessageBreak
+ Trying \f@encoding/\f@family/\f@series/\exfs@targetshape}%
+% \end{macrocode}
+% We \emph{do} want the kernel's substitution mechanism here?
+% \begin{macrocode}
+ \fontshape{\exfs@targetshape}\selectfont
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\exfs@swshape}
+% Switching to swash is now far more complicated with (I presume) the attendant overhead, but the kernel's approach just won't work here\footnote{%
+% Implementing swash as a \emph{shape} isn't workable for fonts I've packaged, so I've made no attempt to follow the kernel here as I do for small-caps italic etc\@.
+% We're back to the single axis/multiple aspect problem which \nfss{} created by ignoring small-caps/italic and width/weight combinations.
+% It may, in fact, be wrong-headed to follow the kernel \emph{at all} here.
+% Perhaps it would be better to just provide the original implementation and some compatibility option for people who also need swash shapes in the same document?%
+% }.
+% This will become \cs{swshape} if \texttt{compat} isn't enabled.
+% \begin{macrocode}
+\newcommand* \exfs@swshape{%
+ \let\exfs@targetsw\relax
+ \begingroup % angen neu beidio? angen - bendant!
+% \end{macrocode}
+% Try kernel or configured default first so we get swash from current family etc.\ if available
+% \begin{macrocode}
+ \edef\exfs@tempa{\f@encoding/\f@family/\f@series/\swdefault}%
+ \edef\exfs@tempa@fake{exfs@fake@\exfs@tempa}%
+ \ifcsname \exfs@tempa\endcsname
+ \ifcsname exfs@fake@\exfs@tempa\endcsname
+ \exfs@swfamily
+ \else
+ \gdef\exfs@targetsw{\fontshape{\swdefault}\selectfont}% kernel
+ \fi
+ \else
+ \exfs@swfamily
+ \fi
+ \endgroup
+ \ifx\exfs@targetsw\relax
+ \PackageWarning{nfssext-cfr}{%
+ Cannot find any route to swash.\MessageBreak
+ Are you sure one is available?}%
+ \else
+ \exfs@targetsw
+ \exfs@info{Switch to swash resulted in '\curr@fontshape'}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\exfs@swfamily}
+% This is the guts of \cs{exfs@swshape}.
+% \begin{macrocode}
+\newcommand* \exfs@swfamily{%
+ \let\exfs@targetsw\relax
+ \begingroup
+% \end{macrocode}
+% ^^A \expandafter\ifx\csname\curr@fontshape\endcsname\relax
+% Try \lpack{nfssext-cfr} family switch \& our default or configured
+% \begin{macrocode}
+ \let\exfs@tempa\f@family
+ \exfs@merge@families{w}%
+ \ifx\exfs@tempa\f@family % try merge with current shape
+% \end{macrocode}
+% Try switching to upright etc.\ first
+% \begin{macrocode}
+ \fontshape{n}%
+ \exfs@merge@families{w}% up & merge
+ \if\exfs@tempa\f@family
+% \end{macrocode}
+% Try switching to \cs{swshapedefault}{} first
+% \begin{macrocode}
+ \fontshape\swshapedefault
+ \exfs@merge@families{w}% up & nfssext-cfr default/configured
+ \if\exfs@tempa\f@family
+% \end{macrocode}
+% Use \lpack{nfssext} family switch \& default or configured
+% \begin{macrocode}
+ \exf@try@family{\expandafter\exfs@get@base\f@family\@nil w}% nfssext switch
+ \if\exfs@tempa\f@family % nfssext switch
+ \fontshape\swshapedefault\exfs@try@family{%
+ \expandafter\exfs@get@base\f@family\@nil w}% nfssext switch & shape
+ \if\exfs@tempa\f@family
+ \relax % rhodd y ffidl yn y to (give up)
+ \else
+ \gdef\exfs@targetsw{%
+ \fontshape\swshapedefault\expandafter\fontfamily{%
+ \exfs@get@base\f@family\@nil w}\selectfont
+ }% nfssext switch & shape
+ \fi % nfssext switch & shape
+ \else
+ \gdef\exfs@targetsw{\expandafter\fontfamily{%
+ \exfs@get@base\f@family\@nil w}\selectfont
+ }% nfssext switch
+ \fi % nfssext switch
+ \else
+ \gdef\exfs@targetsw{%
+ \fontshape\swshapedefault\exfs@merge@families{w}%
+ }% up & nfssext-cfr default/configured
+ \fi % up & nfssext-cfr default/configured
+ \else
+ \gdef\exfs@targetsw{%
+ \fontshape{n}\exfs@merge@families{w}%
+ }% up & merge
+ \fi % up & merge
+ \else
+ \gdef\exfs@targetsw{\exfs@merge@families{w}}% merge with current shape
+ \fi % merge with current shape
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% END added
+%
+% \begin{macro}{\exfs@get@base,\exfs@get@variants,\exfs@next,\exfs@shift,\exfs@first,\exfs@part,\exfs@second}
+% Utlities
+% \begin{macrocode}
+\def\exfs@get@base#1#2#3#4\@nil{#1#2#3}
+% \end{macrocode}
+% BEGIN added (cfr): more \cs{exfs@} commands (\texttt{get@variants}, \texttt{next}, \texttt{shift}, \texttt{first}, \texttt{part}, \texttt{second})
+% \begin{macrocode}
+\def\exfs@get@variants#1#2#3#4\@nil{#4}
+\def\exfs@next#1#2\@nil{#1}
+\def\exfs@shift#1#2\@nil{#2}
+\def\exfs@first#1#2\@nil{#1}
+\def\exfs@part#1#2\@nil{#2}
+\def\exfs@second#1#2#3\@nil{#2}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\exfs@series@splitter}
+% Common method for dealing with weight and width.
+% \changes{v1.0}{2024-09-16}{%
+% Rewritten as kernel no longer supports erroneous \texttt{m}.}
+% \begin{macrocode}
+\def\exfs@series@splitter#1{%
+ \edef\exfs@weight{\expandafter\exfs@first#1\@nil}%
+ \edef\exfs@width{\expandafter\exfs@shift#1\@nil}%
+% \end{macrocode}
+% Two char width only or two char weight
+% \begin{macrocode}
+ \if\exfs@weight u\exfs@check@cx{u}%
+ \else\if\exfs@weight e\exfs@check@cx{e}%
+ \else\if\exfs@weight s\exfs@check@cx{s}%
+ \else\if\exfs@weight d\exfs@check@cx{d}%
+ \else\ifx\exfs@width\@empty % m dealt with elsewhere
+% \end{macrocode}
+% Single character width
+% \begin{macrocode}
+ \if\exfs@weight c\def\exfs@width{c}\let\exfs@weight\@empty
+ \else\if\exfs@weight x\def\exfs@width{x}\let\exfs@weight\@empty
+ \fi\fi
+ \fi\fi\fi\fi\fi
+ \exfs@info{#1 -> \exfs@weight:\exfs@width;}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\exfs@check@cx}
+% Auxiliary for \cs{exfs@check@cx}
+% \begin{macrocode}
+\def\exfs@check@cx#1{%
+ \edef\exfs@tempa{\expandafter\exfs@first\exfs@width\@nil}%
+ \if\exfs@tempa c\edef\exfs@width{#1c}\let\exfs@weight\@empty
+ \else\if\exfs@tempa x\edef\exfs@width{#1x}\let\exfs@weight\@empty
+ \else\edef\exfs@weighta{%
+ \exfs@weight\exfs@tempa
+ }\let\exfs@weight\exfs@weighta
+ \edef\exfs@widtha{%
+ \expandafter\exfs@shift\exfs@width\@nil
+ }\let\exfs@width\exfs@widtha
+ \fi\fi
+}
+% \end{macrocode}
+% \end{macro}
+% END added
+%
+% \begin{macro}{\lnstyle,\osstyle,\infstyle,\instyle,\sustyle,\swstyle}
+% Unmodified from \lpack{nfssext}.
+% Anniffiniedig -> undefined in the kernel.
+% \begin{macrocode}
+\DeclareRobustCommand{\lnstyle}{%% anniffiniedig
+ \not@math@alphabet\lnstyle\relax
+ \exfs@try@family[\expandafter\exfs@get@base\f@family\@nil]%
+ {\expandafter\exfs@get@base\f@family\@nil x}}
+\DeclareRobustCommand{\osstyle}{%% anniffiniedig
+ \not@math@alphabet\osstyle\relax
+ \exfs@try@family{\expandafter\exfs@get@base\f@family\@nil j}}
+\DeclareRobustCommand{\infstyle}{%% anniffiniedig
+ \not@math@alphabet\infstyle\relax
+ \exfs@try@family{\expandafter\exfs@get@base\f@family\@nil 0}}
+\let\instyle\infstyle
+\DeclareRobustCommand{\sustyle}{%% anniffiniedig
+ \not@math@alphabet\sustyle\relax
+ \exfs@try@family{\expandafter\exfs@get@base\f@family\@nil 1}}
+\DeclareRobustCommand{\swstyle}{%% anniffiniedig
+ \not@math@alphabet\swstyle\relax
+ \exfs@try@family{\expandafter\exfs@get@base\f@family\@nil w}}
+% \end{macrocode}
+% \end{macro}
+% BEGIN added (cfr) - merge families.
+%
+% \nnfss{} (unsurprisingly) does nothing here, so this is unproblematic.
+% The following depends **absolutely** on **complete** adherence to berry names.
+%
+% \begin{macro}{\ifexfs@added,\exfs@merge@families}
+% \cs{exfs@merge@families} is used in the macros recommended for switching the style of figures, activating swash and other variants etc.
+% \begin{macrocode}
+\newif\ifexfs@added
+\newcommand*\exfs@merge@families[1]{%
+ \edef\exfs@vartomerge{#1}%
+ \edef\exfs@variants{\expandafter\exfs@get@variants\f@family\@nil}%
+ \exfs@info{Trying to merge variants #1 and \exfs@variants}%
+ \edef\tempo{2j}%
+ \let\exfs@tempq\@empty
+ \def\exfs@tempg{}%
+ \exfs@addedfalse
+% \end{macrocode}
+% Check whether there are variants - if not just use the requested addition.
+% \begin{macrocode}
+ \ifx\exfs@variants\@empty
+ \edef\exfs@tempq{\exfs@vartomerge}%
+ \exfs@addedtrue
+ \else
+ \gdef\set{0,1,2,a,d,e,f,h,j,l,p,q,s,t,v,w}% these are the variants to consider - the order here and in the font name is crucial
+ \ifx\tempo\exfs@vartomerge
+ \@for \xx:=\set \do {%
+% \end{macrocode}
+% Check whether there are variants left - if not set the ‘next variant’ to empty
+% \begin{macrocode}
+ \ifx\exfs@variants\@empty
+ \let\exfs@nextvariant\@empty
+ \else
+% \end{macrocode}
+% O/w get the next variant
+% \begin{macrocode}
+ \edef\exfs@nextvariant{\expandafter\exfs@next\exfs@variants\@nil}%
+ \fi
+% \end{macrocode}
+%^^A \edef\tempt{2}%
+%^^A \edef\tempj{j}%
+% If the next variant is 2 or j, ignore it
+% \begin{macrocode}
+ \if\exfs@nextvariant 2%
+ \edef\exfs@variants{\expandafter\exfs@shift\exfs@variants\@nil}%
+ \fi
+ \if\exfs@nextvariant j% if the next variant is j, ignore it
+ \edef\exfs@variants{\expandafter\exfs@shift\exfs@variants\@nil}%
+ \fi
+% \end{macrocode}
+% See if the current value is either 2 or j and add it if so and if needed
+% \begin{macrocode}
+ \if\xx 2%
+ \edef\exfs@tempg{\exfs@tempg\xx}%
+ \else
+ \if\xx j% if the current value is j, we're done
+ \edef\exfs@tempq{\exfs@tempg\xx\exfs@variants}%
+ \let\exfs@variants\@empty
+ \exfs@addedtrue
+ \else
+% \end{macrocode}
+% o/w see if the current value matches the next variant
+% \begin{macrocode}
+ \ifx\xx\exfs@nextvariant
+ \edef\exfs@tempg{\exfs@tempg\xx}%
+ \edef\exfs@variants{\expandafter\exfs@shift\exfs@variants\@nil}%
+ \fi
+ \fi
+ \fi
+ }%
+ \else
+ \@for \xx:=\set \do {%
+% \end{macrocode}
+% Check whether there are variants left and, if not, add the addition if needed
+% \begin{macrocode}
+ \ifx\exfs@variants\@empty
+ \ifexfs@added
+ \else
+ \edef\exfs@tempq{\exfs@tempg\exfs@vartomerge}%
+ \exfs@addedtrue
+ \fi
+ \else
+% \end{macrocode}
+% o/w get the next variant
+% \begin{macrocode}
+ \edef\exfs@nextvariant{\expandafter\exfs@next\exfs@variants\@nil}%
+% \end{macrocode}
+% If the new token equals the next variant, combine whatever is saved in \cs{exfs@tempg} with whatever remains in \cs{exfs@variants}
+% \begin{macrocode}
+ \ifx\exfs@nextvariant\exfs@vartomerge
+ \edef\exfs@tempq{\exfs@tempg\exfs@variants}%
+ \exfs@addedtrue
+ \let\exfs@variants\@empty
+ \else
+% \end{macrocode}
+% o/w, if the current value matches the requested addition, add it in
+% \begin{macrocode}
+ \ifx\exfs@vartomerge\xx
+ \edef\exfs@tempq{\exfs@tempg\xx\exfs@variants}%
+ \exfs@addedtrue
+ \let\exfs@variants\@empty
+ \else
+% \end{macrocode}
+% o/w, if the current value matches the next variant, shift
+% \begin{macrocode}
+ \ifx\exfs@nextvariant\xx
+ \edef\exfs@tempg{\exfs@tempg\xx}%
+ \edef\exfs@variants{\expandafter\exfs@shift\exfs@variants\@nil}%
+ \fi
+ \fi
+ \fi
+ \fi
+ }%
+ \fi
+ \fi
+ \ifx\exfs@tempq\@empty
+ \PackageError{nfssext-cfr}{Something is wrong here. Ignoring font switching command.}{}%
+ \else
+ \exfs@try@family{\expandafter\exfs@get@base\f@family\@nil \exfs@tempq}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pstyle,\ostyle,\postyle}
+% Commands for switching to proportional and/or oldstyle figures.
+% Compare \cs{ostyle} with \lpack{nfssext}'s \cs{osstyle} above.
+% These macros (and the block which follows) all require merging Berry names but not unmerging.
+% \begin{macrocode}
+\DeclareRobustCommand{\pstyle}{%% anniffiniedig proportional figures
+ \not@math@alphabet\pstyle\relax
+ \exfs@merge@families{2}}
+\DeclareRobustCommand{\ostyle}{%% anniffiniedig oldstyle figures (cf. original osstyle above)
+ \not@math@alphabet\ostyle\relax
+ \exfs@merge@families{j}}
+% \end{macrocode}
+% Combined command for proportional oldstyle
+% \begin{macrocode}
+\DeclareRobustCommand{\postyle}{%% anniffiniedig
+ \not@math@alphabet\postyle\relax
+ \exfs@merge@families{2j}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\tistyle,\ltstyle,\ofstyle,\altstyle,\regstyle,\embossstyle,\ornamentalstyle,\swashstyle,\shstyle,\qtstyle}
+% \changes{2010-07-17}{2015/06/19}{Improve \cs{ofstyle}.}
+% These macros again require merging, but not unmerging, names.
+% \begin{macrocode}
+\DeclareRobustCommand{\tistyle}{%% anniffiniedig titling/display
+ \not@math@alphabet\tistyle\relax
+ \exfs@merge@families{d}}
+% \end{macrocode}
+% Note that this command is for use when the light version is a separate family rather than a weight variant (e.g.\ when you've got light, light bold etc.\ as well as regular weights)
+% \begin{macrocode}
+\DeclareRobustCommand{\ltstyle}{%% anniffiniedig
+ \not@math@alphabet\ltstyle\relax
+ \exfs@merge@families{l}}
+% \end{macrocode}
+% Let's hope there aren't any fonts with a light family *and* an outline/openface/blank version
+% \begin{macrocode}
+\DeclareRobustCommand{\ofstyle}{%% anniffiniedig
+ \not@math@alphabet\ofstyle\relax
+ \exfs@merge@families{l}}
+\DeclareRobustCommand{\altstyle}{%% anniffiniedig alternative style
+ \not@math@alphabet\altstyle\relax
+ \exfs@merge@families{a}}
+\DeclareRobustCommand{\regstyle}{%% anniffiniedig 'regular' style
+ \not@math@alphabet\regstyle\relax
+ \exfs@try@family{\expandafter\exfs@get@base\f@family\@nil}}
+\DeclareRobustCommand{\embossstyle}{%% anniffiniedig
+ \not@math@alphabet\embossstyle\relax
+ \exfs@merge@families{e}}
+\DeclareRobustCommand{\ornamentalstyle}{%% anniffiniedig intended primarily for decorative initial fonts etc.
+ \not@math@alphabet\ornamentalstyle\relax
+ \exfs@merge@families{p}}
+\DeclareRobustCommand{\qtstyle}{%% anniffiniedig quotation style (assumes sans)
+ \not@math@alphabet\qtstyle\relax
+ \sffamily
+ \exfs@merge@families{q}}
+\DeclareRobustCommand{\shstyle}{%% anniffiniedig
+ \not@math@alphabet\shstyle\relax
+ \exfs@merge@families{h}}
+\DeclareRobustCommand{\swashstyle}{%% anniffiniedig an attempt to improve on \swstyle
+ \not@math@alphabet\swashstyle\relax
+ \exfs@merge@families{w}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\tmstyle,\tvstyle}
+% \changes{v6140}{2017-03-28}{Modify \cs{tmstyle} and \cs{tvstyle} to unmerge sans and other typewriter before merging appropriate variant.}
+% Macros to switch between monowidth and variable typewriter.
+% These need to unmerge before merging.
+% We need to unmerge sans as well as the other kind of typewriter.
+% \begin{macrocode}
+\DeclareRobustCommand{\tmstyle}{%% anniffiniedig monowidth typewriter
+ \not@math@alphabet\tmstyle\relax
+ \exfs@unmerge@families{s}%
+ \exfs@unmerge@families{v}%
+ \exfs@merge@families{t}}
+\DeclareRobustCommand{\tvstyle}{%% anniffiniedig variable width typewriter
+ \not@math@alphabet\tvstyle\relax
+ \exfs@unmerge@families{s}%
+ \exfs@unmerge@families{t}%
+ \exfs@merge@families{v}}
+% \end{macrocode}
+% \end{macro}
+% BEGIN added (cfr) - unmerge families
+%
+% \begin{macro}{\ifexfs@take,\exfs@unmergefamilies}
+% Define the macro needed to do the unmerges.
+% \begin{macrocode}
+\newif\ifexfs@take
+\newcommand*\exfs@unmerge@families[1]{%
+ \edef\exfs@tempf{#1}%
+ \edef\tempa{\expandafter\exfs@get@variants\f@family\@nil}%
+ \let\exfs@tempq\@empty
+ \edef\exfs@tempg{}%
+ \exfs@taketrue
+% \end{macrocode}
+% Check whether there are variants - if not do nothing
+% \begin{macrocode}
+ \ifx\tempa\@empty
+ \edef\exfs@tempq{}%
+ \else
+% \end{macrocode}
+% o/w go through the variants to find the one to delete
+% \begin{macrocode}
+ \loop
+% \end{macrocode}
+% Get the next variant
+% \begin{macrocode}
+ \edef\exfs@tempn{\expandafter\exfs@next\tempa\@nil}%
+% \end{macrocode}
+% See if the next variant is the thing we seek and, if so, eliminate it
+% \begin{macrocode}
+ \ifx\exfs@tempf\exfs@tempn
+ \edef\tempa{\expandafter\exfs@shift\tempa\@nil}%
+ \edef\exfs@tempq{\exfs@tempg\tempa}%
+ \exfs@takefalse
+% \end{macrocode}
+% o/w save the next variant and move on if any variants remain
+% \begin{macrocode}
+ \else
+ \edef\exfs@tempg{\exfs@tempg\exfs@tempn}%
+ \edef\tempa{\expandafter\exfs@shift\tempa\@nil}%
+ \ifx\tempa\@empty% if there are no variants left, we're done
+ \edef\exfs@tempq{\exfs@tempg}%
+ \exfs@takefalse
+ \fi
+ \fi
+ \ifexfs@take % \fi yn \repeat
+ \repeat
+ \fi
+ \exfs@try@family{\expandafter\exfs@get@base\f@family\@nil \exfs@tempq}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\tstyle,\lstyle}
+% These are simple unmerges, with no merging necessary.
+% \begin{macrocode}
+\DeclareRobustCommand{\tstyle}{%% anniffiniedig tabular figures
+ \not@math@alphabet\tstyle\relax
+ \exfs@unmerge@families{2}}
+\DeclareRobustCommand{\lstyle}{%% anniffiniedig lining figures (cf. command above)
+ \not@math@alphabet\lstyle\relax
+ \exfs@unmerge@families{j}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\tlstyle,\plstyle,\tostyle}
+% Simple combinations for combined figure styles.
+%
+% Make a combined command for tabular lining
+% \begin{macrocode}
+\DeclareRobustCommand{\tlstyle}{%% anniffiniedig
+ \lstyle\tstyle}
+% \end{macrocode}
+% Proportional lining
+% \begin{macrocode}
+\DeclareRobustCommand{\plstyle}{%% anniffiniedig
+ \lstyle\pstyle}
+% \end{macrocode}
+% Tabular oldstyle {?!}
+% \begin{macrocode}
+\DeclareRobustCommand{\tostyle}{%% anniffiniedig
+ \ostyle\tstyle}
+% \end{macrocode}
+% \end{macro}
+% END added
+%
+% \begin{macro}{\sidefault,\sishape}
+% \texttt{si} is italic sc\footnote{%
+% That is, italic small-caps \emph{was} \texttt{si}.
+% These days, things are more complicated \dots.%
+% }.
+% We use the original definition for the default and then set up rules for font shape changes which try \texttt{scit} and \texttt{scsl} before falling back to \texttt{si}.
+% \begin{macrocode}
+\newcommand*{\sidefault}{si}% anniffiniedig
+% \end{macrocode}
+% Well i brofi \texttt{si} \& yna \texttt{scit} ond wn i ddim sut i wneud hon gyda'r stwff newydd \dots{}.
+% I was going to deprecate the \texttt{si} macros, but the truth is they are much nicer than having to combine macros for those cases when you really do want precisely italic small-caps.
+% They are also much more robust than somebody trying to force things with \cs{fontshape}\marg{si}\cs{selectfont}, so, on reflection, it seems better to retain the interface, even if the implementation isn't as straightforward as I'd like.
+% \begin{macrocode}
+\DeclareRobustCommand{\sishape}{%
+ \exfs@try@shapeshift{si}}
+% \end{macrocode}
+% \end{macro}
+% Kernel virtuals: ulc upper/lower case up upright.
+% \lpack{nfssext} virtuals? or \lpack{nfssext-cfr} virtuals? or?
+% It would be better to try \texttt{si}, \texttt{scit} and \texttt{scsl}, but that doesn't seem possible
+% \begin{macrocode}
+\DeclareFontShapeChangeRule {n}{si}{scit}{scsl}% current; request (& trydedd); dewisiad cyntaf; ail ddewisiad
+\DeclareFontShapeChangeRule {it}{si}{scit}{scsl}
+\DeclareFontShapeChangeRule {sl}{si}{scit}{scsl}
+\DeclareFontShapeChangeRule {sc}{si}{scit}{scsl}
+% \end{macrocode}
+% Current shape is si => font support hasn't been updated
+% \begin{macrocode}
+\DeclareFontShapeChangeRule {si}{sc} {si} {}
+\DeclareFontShapeChangeRule {si}{it} {si} {}
+\DeclareFontShapeChangeRule {si}{sl} {scsl} {si}
+\DeclareFontShapeChangeRule {si}{scit} {scit} {si}% rhag ofn?!
+\DeclareFontShapeChangeRule {si}{ulc} {it} {}
+\DeclareFontShapeChangeRule {si}{up}{sc}{}
+% \end{macrocode}
+%^^A \DeclareFontShapeChangeRule {si}{u} {it} {}
+%^^A \DeclareFontShapeChangeRule {si}{su}{sc}{}
+% \begin{macrocode}
+\ExplSyntaxOn
+% \end{macrocode}
+% The need for overwriting can be avoided by changing the \file{.fd} files, but \texttt{compat} supports packages I don't know about\footnote{%
+% Or haven't published?
+% I haven't actually tried it with those.%
+% } \dots
+% \changes{v1.0}{2024-09-16}{%
+% Conditionally override kernel rules affecting switches to upright/small-caps.italic etc.}
+% \begin{macrocode}
+\bool_if:NT \g__exfs_compat_bool
+{
+ \DeclareFontShapeChangeRule {it}{sc}{si}{scsl}
+ \DeclareFontShapeChangeRule{sl}{sc}{scsl}{si}
+% \end{macrocode}
+% Gofyn am italic etc\@. \textbar{} Ask about italic etc\@.
+% Sylwadau tebygol yma \dots{} \textbar{} Like comments here \dots{}
+% \begin{macrocode}
+ \DeclareFontShapeChangeRule {sc}{it} {si} {scsl}
+ \DeclareFontShapeChangeRule {sc}{sl} {scsl} {si}
+ \DeclareFontShapeChangeRule {scsl}{it} {si} {scsl}
+}
+\ExplSyntaxOff
+% \end{macrocode}
+%^^A Ddylai'r rhai hwn ddim yn defnyddio \texttt{scit}/\texttt{scsl} yn lle \textt{si}?
+%^^A Pam \texttt{si}??
+%^^A \verb|^| Wel, maen nhw'n gwneud felly eisoes??!!
+% \changes{v1.0}{2024-09-16}{%
+% Unconditionally add a bunch of shape change rules for shapes unsupported by the kernel - I don't *think* these should be problematic: if the current or requested shape is unsupported by the kernel, surely it can't be problematic to support that shape?}
+% \begin{macrocode}
+\DeclareFontShapeChangeRule {ui}{sc}{scit}{scsl}
+\DeclareFontShapeChangeRule {ui}{scsl}{scsl}{scit}
+\DeclareFontShapeChangeRule {ui}{it}{it}{ui}
+\DeclareFontShapeChangeRule {ui}{ri}{ri}{ui}
+\DeclareFontShapeChangeRule {ui}{up}{n}{}
+\DeclareFontShapeChangeRule {ui}{ulc}{ui}{}
+% \end{macrocode}
+%^^A \DeclareFontShapeChangeRule {ui}{u}{n}{}
+%^^A \DeclareFontShapeChangeRule {ui}{su}{sc}{}
+% \begin{macrocode}
+\DeclareFontShapeChangeRule {ri}{sc}{scit}{scsl}
+\DeclareFontShapeChangeRule {ri}{scsl}{scsl}{scit}
+\DeclareFontShapeChangeRule {ri}{it}{it}{ri}
+\DeclareFontShapeChangeRule {ri}{ui}{ui}{ri}
+% \end{macrocode}
+% Kernel virtuals: \texttt{ulc} upper/lower case up upright
+% \begin{macrocode}
+\DeclareFontShapeChangeRule {ri}{up}{n}{}
+\DeclareFontShapeChangeRule {ri}{ulc}{ri}{}
+% \end{macrocode}
+% nfssext virtuals? or nfssext-cfr virtuals? or?
+%^^A \DeclareFontShapeChangeRule {ri}{u}{n}{}
+%^^A \DeclareFontShapeChangeRule {ri}{su}{sc}{}
+%^^A \DeclareFontShapeChangeRule {sc}{ri}{scit}{scsl}
+%^^A \DeclareFontShapeChangeRule {scsl}{ri}{scsl}{scit}
+%^^A \DeclareFontShapeChangeRule {it}{ri}{ri}{it}
+%^^A \DeclareFontShapeChangeRule {ui}{ri}{ri}{it}
+%^^A \DeclareFontShapeChangeRule {n}{ri}{ri}{it}
+%^^A \DeclareFontShapeChangeRule {sl}{ri}{ri}{it}
+% \begin{macrocode}
+\DeclareFontShapeChangeRule {ol} {sc} {scol} {} % <- seiliedig ar nfssext-cfr-nfss.sty \scshape
+\DeclareFontShapeChangeRule {ol} {ulc} {ol} {}
+\DeclareFontShapeChangeRule {ol} {up} {ol} {}
+% \end{macrocode}
+%^^A \DeclareFontShapeChangeRule {ol} {u} {ol} {}
+%^^A \DeclareFontShapeChangeRule {ol} {su} {scol} {}
+% \begin{macrocode}
+\DeclareFontShapeChangeRule {scol} {sc} {scol} {}
+\DeclareFontShapeChangeRule {scol} {ulc} {ol} {}
+\DeclareFontShapeChangeRule {scol} {up} {scol} {}
+% \end{macrocode}
+% \iffalse
+%^^A \DeclareFontShapeChangeRule {scol} {u} {scol} {}
+%^^A \DeclareFontShapeChangeRule {scol} {su} {scol} {}
+%^^A \DeclareFontShapeChangeRule {sc} {sc} {sc} {} % <- ??
+% \fi
+% \begin{macrocode}
+\DeclareFontShapeChangeRule {u}{sc}{su}{} % <- seiliedig ar nfssext-cfr-nfss.sty \scshape
+\DeclareFontShapeChangeRule {su}{ulc}{u}{}
+\DeclareFontShapeChangeRule {sc}{u}{su}{}
+\DeclareFontShapeChangeRule {su}{u}{su}{}
+\DeclareFontShapeChangeRule {su}{sc}{su}{}
+% \end{macrocode}
+%^^A \DeclareFontShapeChangeRule {u} {ulc} {u} {} % <- ??
+%^^A \DeclareFontShapeChangeRule {u} {up} {u} {} % <- ??
+%^^A \DeclareFontShapeChangeRule {su} {sc} {su} {} % <- ??
+%^^A \DeclareFontShapeChangeRule {su} {ulc} {u} {} % <- ??
+%^^A \DeclareFontShapeChangeRule {su} {up} {u} {} % <- ??
+% BEGIN added (cfr)
+%
+% cfr: is this how outline shapes should be handled?
+% \begin{macro}{\oldefault,\olshape,\scoldefault,\scolshape}
+% Outline
+% \begin{macrocode}
+\newcommand*{\oldefault}{ol}% anniffiniedig
+\DeclareRobustCommand{\olshape}{%% anniffiniedig
+ \exfs@try@shapeshift{ol}}
+\newcommand*{\scoldefault}{scol}% anniffiniedig
+\DeclareRobustCommand{\scolshape}{%% anniffiniedig
+ \exfs@try@shapeshift{scol}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\udefault,\ushape,\scudefault,\scushape}
+% Underlined??
+%^^A\DeclareRobustCommand{\olshape}{%
+%^^A \not@math@alphabet\olshape\relax
+%^^A \exfs@merge@shape{\oldefault}{\scdefault}{\scoldefault}}
+% Fudge <- ??
+% \begin{macrocode}
+\newcommand*{\udefault}{u}% anniffiniedig
+\DeclareRobustCommand{\ushape}{%% anniffiniedig
+ \exfs@try@shapeshift{u}}
+\newcommand*{\scudefault}{su}% anniffiniedig
+\DeclareRobustCommand{\scushape}{%% anniffiniedig
+ \exfs@try@shapeshift{scu}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\uidefault,\uishape,\ridefault,\rishape}
+% Upright and reverse italic
+% \begin{macrocode}
+\newcommand*{\uidefault}{ui}% anniffiniedig
+\DeclareRobustCommand{\uishape}{% anniffiniedig
+ \exfs@try@shapeshift{ui}}
+% \end{macrocode}
+% Can i do this for reverse italic?
+% \begin{macrocode}
+\newcommand*{\ridefault}{ri}% anniffiniedig
+\DeclareRobustCommand{\rishape}{% anniffiniedig
+ \exfs@try@shapeshift{ri}}
+% \end{macrocode}
+% \end{macro}
+% END added
+%^^A \newcommand*{\exfs@merge@shape}[3]{%
+%^^A \edef\exfs@tempa{#1}%
+%^^A \edef\exfs@tempb{#2}%
+%^^A \ifx\f@shape\exfs@tempb
+%^^A \expandafter\ifx\csname\f@encoding/\f@family/\f@series/#3\endcsname\relax
+%^^A \else
+%^^A \edef\exfs@tempa{#3}%
+%^^A \fi
+%^^A \fi
+%^^A \fontshape{\exfs@tempa}\selectfont}
+% BEGIN added (cfr) - merge width changes into series
+%^^A \newcommand*{\exfs@font@width}{% ??
+%^^A \edef\exfs@tempf{\expandafter\exfs@first\f@series\@nil }%
+%^^A \edef\exfs@temppart{\expandafter\exfs@part\f@series\@nil }%
+%^^A \ifx\exfs@temppart\@empty
+%^^A \def\exfs@width{}
+%^^A \else
+%^^A \edef\exfs@temps{\expandafter\exfs@second\f@series\@nil }%
+%^^A \ifx\exfs@temps{b}
+%^^A \edef\exfs@width{\expandafter\exfs@part\exfs@temps\@nil }%
+%^^A \else
+%^^A \ifx\exfs@temps{l}
+%^^A \edef\exfs@width{\expandafter\exfs@part\exfs@temps\@nil }%
+%^^A \else
+%^^A \edef\exfs@width{\exfs@temppart}%
+%^^A \fi
+%^^A \fi
+%^^A \fi
+%^^A \exfs@width
+%^^A }
+%
+% \begin{macro}{\exfs@merge@width}
+% Previously dependent on incorrect series names.
+% \changes{v1.0}{2024-09-16}{Do not depend on incorrect series names, which are no longer supported.}
+% \begin{macrocode}
+\newcommand*{\exfs@merge@width}[1]{%
+% \end{macrocode}
+%^^A \edef\exfs@temph{#1}%
+%^^A \edef\exfs@tempf{\expandafter\exfs@first\f@series\@nil }%
+%^^A \edef\exfs@temppart{\expandafter\exfs@part\f@series\@nil }%
+%^^A \def\tempb{b}%
+%^^A \def\templ{l}%
+% cfr-added
+%
+% Dibynnodd y côd gwreiddiol ar *mc* etc. \& r'odd hynny'n anghywir
+%
+% Instead of merging or unmerging cyclically, which means keeping track of everything, we split the current series (which requires some juggling, but hopefully less) and use the results.
+% \begin{macrocode}
+ \exfs@series@splitter{\f@series}%
+ \edef\exfs@temph{#1}%
+ \if\exfs@temph m\ifx\exfs@weight\@empty\else\let\exfs@temph\@empty\fi\fi
+ \if\exfs@weight m\ifx\exfs@temph\@empty\else\let\exfs@weight\@empty\fi\fi
+ \edef\exfs@series{\exfs@weight\exfs@temph}%
+% \end{macrocode}
+% end cfr-added
+%^^A \ifx\exfs@tempf\tempm\edef\exfs@tempf{}\fi %
+%^^A \ifx\exfs@temppart\@empty
+%^^A \def\exfs@series{\expandafter\exfs@tempf\exfs@temph}%
+%^^A \else
+%^^A \edef\exfs@temps{\expandafter\exfs@second\f@series\@nil }%
+%^^A \ifx\exfs@temps\tempb
+%^^A \def\exfs@series{\expandafter\exfs@tempf\exfs@temps\exfs@temph}%
+%^^A \else
+%^^A \ifx\exfs@temps\templ
+%^^A \def\exfs@series{\expandafter\exfs@tempf\exfs@temps\exfs@temph}%
+%^^A \else
+%^^A \def\exfs@series{\expandafter\exfs@tempf\exfs@temph}%
+%^^A \fi
+%^^A \fi
+%^^A \fi
+%^^A \edef\tempy{\exfs@series}\show\tempy
+% \begin{macrocode}
+ \exfs@info{Trying \exfs@series}%
+ \exfs@try@series{\exfs@series}}
+% \end{macrocode}
+% \end{macro}
+%^^A \fontseries\exfs@series\selectfont}
+%^^A \newcommand*{\exfs@unmerge@width}{%
+%^^A \edef\exfs@tempf{\expandafter\exfs@first\f@series\@nil }%
+%^^A \edef\exfs@temppart{\expandafter\exfs@part\f@series\@nil }%
+%^^A \def\tempb{b}%
+%^^A \def\templ{l}%
+%^^A \def\tempe{}%
+%^^A \ifx\exfs@temppart\@empty
+%^^A \def\exfs@series{\expandafter\exfs@tempf}%
+%^^A \else
+%^^A \edef\exfs@temps{\expandafter\exfs@second\f@series\@nil }%
+%^^A \ifx\exfs@temps\tempb
+%^^A \def\exfs@series{\expandafter\exfs@tempf\exfs@temps}%
+%^^A \else
+%^^A \ifx\exfs@temps\templ
+%^^A \def\exfs@series{\expandafter\exfs@tempf\exfs@temps}%
+%^^A \else
+%^^A \def\exfs@series{\expandafter\exfs@tempf}%
+%^^A \fi
+%^^A \fi
+%^^A \fi
+%^^A \ifx\tempe\exfs@series\def\exfs@series{m}\fi % angen efaillai?
+%^^A \exfs@try@series{\exfs@series}}
+% \begin{macro}{\regwidth}
+% ‘Regular’ width requires conditionally adding ‘m’.
+% \begin{macrocode}
+\DeclareRobustCommand{\regwidth}{%% anniffiniedig
+ \not@math@alphabet\regwidth\relax
+% \end{macrocode}
+% cfr altered
+% \begin{macrocode}
+ \exfs@merge@width{m}}
+% \end{macrocode}
+%^^A \exfs@unmerge@width}
+% \end{macro}
+% \begin{macro}{\nwdefault,\nwwidth,\cddefault,\cdwidth,\ecdefault,\ecwidth,\ucdefault,\ucwidth}
+% Condensed widths.
+% \begin{macrocode}
+\newcommand*{\nwdefault}{c}% anniffiniedig
+\DeclareRobustCommand{\nwwidth}{%% anniffiniedig ond rheolau
+ \not@math@alphabet\nwwidth\relax
+ \exfs@merge@width{\nwdefault}}% neu \exfs@try@series ?
+\newcommand*{\cddefault}{c}% anniffiniedig
+\DeclareRobustCommand{\cdwidth}{% anniffiniedig ond rheolau
+ \not@math@alphabet\cdwidth\relax
+ \exfs@merge@width{\cddefault}}% neu \exfs@try@series ?
+\newcommand*{\ecdefault}{ec}% anniffiniedig
+\DeclareRobustCommand{\ecwidth}{%% anniffiniedig ond rheolau
+ \not@math@alphabet\ecwidth\relax
+ \exfs@merge@width{\ecdefault}}% neu \exfs@try@series ?
+\newcommand*{\ucdefault}{uc}% anniffiniedig
+\DeclareRobustCommand{\ucwidth}{%% anniffiniedig
+ \not@math@alphabet\ucwidth\relax
+ \exfs@merge@width{\ucdefault}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\etdefault,\etwidth,\epdefault,\epwidth,\exdefault,\exwidth,\uxdefault,\uxwidth}
+% Extended/expanded widths.
+% \begin{macrocode}
+\newcommand*{\etdefault}{x}% anniffiniedig
+\DeclareRobustCommand{\etwidth}{%% anniffiniedig
+ \not@math@alphabet\etwidth\relax
+ \exfs@merge@width{\etdefault}}% neu \exfs@try@series ?
+\newcommand*{\epdefault}{x}% anniffiniedig
+\DeclareRobustCommand{\epwidth}{%% anniffiniedig ond rheolau
+ \not@math@alphabet\epwidth\relax
+ \exfs@merge@width{\epdefault}}% neu \exfs@try@series ?
+\newcommand*{\exdefault}{ex}% anniffiniedig
+\DeclareRobustCommand{\exwidth}{%% anniffiniedig
+ \not@math@alphabet\exwidth\relax
+ \exfs@merge@width{\exdefault}}
+\newcommand*{\uxdefault}{ux}% anniffiniedig
+\DeclareRobustCommand{\uxwidth}{%% anniffiniedig
+ \not@math@alphabet\uxwidth\relax
+ \exfs@merge@width{\uxdefault}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\mdwdefault,\mdwidth}
+% Medium.
+% \begin{macrocode}
+\newcommand*\mdwdefault{m}
+\DeclareRobustCommand{\mdwidth}{%% anniffiniedig
+ \not@math@alphabet\mdwidth\relax
+ \exfs@merge@width{\mdwdefault}}
+% \end{macrocode}
+% \end{macro}
+% Posibl ond bydda i'n colli achosion yn siwr.
+% \textbar{} Possible but I'd lose cases for sure.
+% Hefyd hoffwn i ddim dyfalu pa rheolau y bydden nhw eu dewis.
+% \textbar{} Also I wouldn't like to guess which rules they'll choose.
+%^^A \DeclareFontSeriesChangeRule {bc}{ux}{bux}{bc}
+%^^A \DeclareFontSeriesChangeRule {bx}{ux}{bux}{bx}
+%^^A \DeclareFontSeriesChangeRule {b}{ux} {bux} {b}
+%^^A \DeclareFontSeriesChangeRule {c}{ux}{ux}{m}
+%^^A \DeclareFontSeriesChangeRule {ebc}{ux}{ebux}{}
+%^^A \DeclareFontSeriesChangeRule {ec}{ux}{ux}{m}
+%^^A \DeclareFontSeriesChangeRule {sc}{ux}{ux}{m}
+%^^A \DeclareFontSeriesChangeRule {ebx}{ux}{ebux}{ebx}
+%^^A \DeclareFontSeriesChangeRule {eb}{ux}{ebux}{}
+%^^A \DeclareFontSeriesChangeRule {elc}{ux}{elux}{}
+%^^A \DeclareFontSeriesChangeRule {elx}{ux}{elux}{elx}
+%^^A \DeclareFontSeriesChangeRule {el}{ux}{elux}{}
+%^^A \DeclareFontSeriesChangeRule {lc}{ux}{lux}{}
+%^^A \DeclareFontSeriesChangeRule {lx}{ux}{lux}{lx}
+%^^A \DeclareFontSeriesChangeRule {l}{ux} {lux} {l}
+%^^A \DeclareFontSeriesChangeRule {m}{ux} {ux} {m}
+%^^A \DeclareFontSeriesChangeRule {sbc}{ux}{sbux}{}
+%^^A \DeclareFontSeriesChangeRule {sbx}{ux}{sbux}{sbx}
+%^^A \DeclareFontSeriesChangeRule {sb}{ux} {sbux} {}
+%^^A \DeclareFontSeriesChangeRule {slc}{ux}{slux}{}
+%^^A \DeclareFontSeriesChangeRule {sl}{ux}{slux}{}
+%^^A \DeclareFontSeriesChangeRule {ubc}{ux}{ubux}{}
+%^^A \DeclareFontSeriesChangeRule {ubx}{ux}{ubux}{ubx}
+%^^A \DeclareFontSeriesChangeRule {ub}{ux}{ubux}{}
+%^^A \DeclareFontSeriesChangeRule {ulc}{ux}{ulux}{}
+%^^A \DeclareFontSeriesChangeRule {ulx}{ux}{ulux}{ulx}
+%^^A \DeclareFontSeriesChangeRule {ul}{x}{ulx}{}
+%^^A \DeclareFontSeriesChangeRule {x}{ul}{ulx}{}
+%^^A \DeclareFontSeriesChangeRule {ux}{m?}{ux}{}
+%^^A \DeclareFontSeriesChangeRule {ux}{?m}{m}{}
+%
+% BEGIN added (cfr) merge weight changes into series
+%
+% \begin{macro}{\exfs@merge@weight}
+% The pay off for setting up series splitting is that we can reuse the method here and, as in the case of width, the definition is greatly simplified\footnote{%
+% At least if you don't look at the splitter code.}.
+% \begin{macrocode}
+\newcommand*{\exfs@merge@weight}[1]{%
+ \exfs@series@splitter{\f@series}%
+% \end{macrocode}
+% Save current series so we can test for change
+% \begin{macrocode}
+ \let\exfs@tempg\f@series
+ \def\exfs@temph{#1}%
+ \if\exfs@temph m\relax
+ \ifx\exfs@width\@empty\relax
+ \else
+ \let\exfs@temph\@empty
+ \fi
+ \fi
+ \edef\exfs@series{\exfs@temph\exfs@width}%
+ \ifx\exfs@temph\exfs@series
+ \exfs@info{Trying \exfs@series}%
+ \exfs@try@series{\exfs@series}%
+ \else
+ \exfs@info{Trying \exfs@series, favouring \exfs@weight}%
+ \exfs@try@series[\exfs@weight]{\exfs@series}% assume user wants to change weight even if this changes back to the default width
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%^^A Meddwl bod y côd hwn yn dibynnu ar y problem 'm' eto
+%^^A Ond alla i ddim jest ychwanegu un
+%^^A \edef\exfs@tempg{#1}%
+%^^A \edef\exfs@tempf{\expandafter\exfs@first\f@series\@nil }%
+%^^A \edef\exfs@temppart{\expandafter\exfs@part\f@series\@nil }%
+%^^A \def\templ{l}%
+%^^A \def\tempb{b}%
+%^^A Case when there's no second part, so the single character must be the weight and should be replaced
+%^^A \ifx\exfs@temppart\@empty
+%^^A \def\exfs@series{\expandafter\exfs@tempg}%
+%^^A %:case when there's a second part
+%^^A \else
+%^^A %:get first character of second part
+%^^A \edef\exfs@temps{\expandafter\exfs@second\f@series\@nil }%
+%^^A \edef\exfs@tempw{\expandafter\exfs@part\exfs@temps\@nil }%
+%^^A %:is the first character b? if so, it is part of the weight and should be replaced
+%^^A \ifx\exfs@temps\tempb
+%^^A \def\exfs@series{\expandafter\exfs@tempg\exfs@tempw}%
+%^^A \else
+%^^A %:is the first character l? if so, it is part of the weight and should be replaced
+%^^A \ifx\exfs@temps\templ
+%^^A \def\exfs@series{\expandafter\exfs@tempg\exfs@tempw}%
+%^^A \else
+%^^A %:o/w the first character is part of the width and should be retained
+%^^A \def\exfs@series{\expandafter\exfs@tempg\exfs@temppart}%
+%^^A \fi
+%^^A \fi
+%^^A \fi
+%^^A %\fontseries\exfs@series\selectfont}
+%^^A \ifx\exfs@tempg\exfs@series
+%^^A \exfs@try@series{\exfs@series}%
+%^^A \else
+%^^A \exfs@try@series[\exfs@tempg]{\exfs@series}% assume user wants to change weight even if this changes back to the default width
+%^^A \fi}
+% \begin{macro}{\mbdefault,\mbweight,\bddefault,\bfweight,\bdweight}
+% Ref.: \file{sources2e.pdf} and/or stripped code in \path{base}.
+%
+% The annotation ‘anniffiniedig’ indicates the macro is \emph{not} defined by the kernel as of 2024.
+% The addition ‘ond rheolau’ means there are nonetheless relevant rules.
+% The comment ‘dim byd i'w gael eu wneud yma’ indicates that defining the default is now sufficient and no additional font switch or text command is required.
+% \begin{macrocode}
+\newcommand*{\mbdefault}{sb}% dim byd i'w gael ei wneud yma
+\DeclareRobustCommand{\mbweight}{%% anniffiniedig
+ \not@math@alphabet\mbweight\relax
+ \exfs@merge@weight{\mbdefault}}
+\newcommand*{\bddefault}{b}% dim byd i'w gael ei wneud yma
+\DeclareRobustCommand{\bfweight}{%% anniffiniedig
+ \not@math@alphabet\bfweight\relax
+ \exfs@merge@weight{\bddefault}}
+\DeclareRobustCommand{\bdweight}{%% anniffiniedig
+ \not@math@alphabet\bdweight\relax
+ \exfs@merge@weight{\bddefault}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\mwdefault,\mdweight}
+% Regular, medium, default are all irregular, exceptional, fraught.
+% \begin{macrocode}
+\newcommand*\mwdefault{m}
+\DeclareRobustCommand{\mdweight}{%% anniffiniedig
+ \not@math@alphabet\mdweight\relax
+ \exfs@merge@weight{\mwdefault}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\dbdefault,\dbweight,\sbdefault,\sbweight,\ebdefault,\ebweight,\ubdefault,\ubweight}
+% \changes{v1.0}{2024-09-16}{%
+% Make \cs{mbdefault} sb (duplicating \cs{sbdefault}) as I can't come up with anything better.}
+% Heavy weights.
+% \begin{macrocode}
+\newcommand*{\dbdefault}{db}% anniffiniedig
+\DeclareRobustCommand{\dbweight}{%% anniffiniedig
+ \not@math@alphabet\dbweight\relax
+ \exfs@merge@weight{\dbdefault}}
+\newcommand*{\sbdefault}{sb}% anniffiniedig
+\DeclareRobustCommand{\sbweight}{%% anniffiniedig ond rheolau
+ \not@math@alphabet\sbweight\relax
+ \exfs@merge@weight{\sbdefault}}% neu \exfs@try@series ?
+\newcommand*{\ebdefault}{eb}% anniffiniedig
+\DeclareRobustCommand{\ebweight}{%% anniffiniedig ond rheolau
+ \not@math@alphabet\ebweight\relax
+ \exfs@merge@weight{\ebdefault}}% neu \exfs@try@series ?
+\newcommand*{\ubdefault}{ub}% anniffiniedig
+\DeclareRobustCommand{\ubweight}{%% anniffiniedig ond rheolau
+ \not@math@alphabet\ubweight\relax
+ \exfs@merge@weight{\ubdefault}}% neu \exfs@try@series ?
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\lgdefault,\lgweight,\eldefault,\elweight,\uldefault,\ulweight}
+% Light weights.
+% \begin{macrocode}
+\newcommand*{\lgdefault}{l}% anniffiniedig
+% \end{macrocode}
+% Note - use this if light is a variant weight, rather than a separate family
+% \begin{macrocode}
+\DeclareRobustCommand{\lgweight}{%% anniffiniedig ond rheolau
+ \not@math@alphabet\lgweight\relax
+ \exfs@merge@weight{\lgdefault}}% neu \exfs@try@series ?
+\newcommand*{\eldefault}{el}% anniffiniedig
+\DeclareRobustCommand{\elweight}{%% anniffiniedig ond rheolau
+ \not@math@alphabet\elweight\relax
+ \exfs@merge@weight{\eldefault}}% neu \exfs@try@series ?
+\newcommand*{\uldefault}{ul}% anniffiniedig
+\DeclareRobustCommand{\ulweight}{%% anniffiniedig ond rheolau
+ \not@math@alphabet\ulweight\relax
+ \exfs@merge@weight{\uldefault}}% neu \exfs@try@series ?
+% \end{macrocode}
+% \end{macro}
+% END added
+%^^A \DeclareRobustCommand{\itshape}{%
+%^^A \not@math@alphabet\itshape\mathit
+%^^A \exfs@merge@shape{\itdefault}{\scdefault}{\sidefault}}
+% Original
+%^^A\DeclareRobustCommand{\scshape}{%
+%^^A \not@math@alphabet\scshape\relax
+%^^A \exfs@merge@shape{\scdefault}{\itdefault}{\sidefault}}
+%^^A BEGIN cfr-altered: \scshape
+%^^A \DeclareRobustCommand{\scshape}{%
+%^^A \not@math@alphabet\scshape\relax
+%^^A \def\tempu{u}%
+%^^A \def\tempo{ol}%
+%^^A \ifx\f@shape\tempu
+%^^A \exfs@merge@shape{\scdefault}{\udefault}{\scudefault}%
+%^^A \else
+%^^A \ifx\f@shape\tempo
+%^^A \exfs@merge@shape{\scdefault}{\oldefault}{\scoldefault}%
+%^^A \else
+%^^A \exfs@merge@shape{\scdefault}{\itdefault}{\sidefault}%
+%^^A \fi
+%^^A \fi}
+%^^A END end-altered
+%^^A \DeclareRobustCommand{\upshape}{%
+%^^A \not@math@alphabet\upshape\relax
+%^^A \exfs@merge@shape{\updefault}{\sidefault}{\scdefault}}
+% \begin{macro}{\dfshape}
+% Something simpler.
+% \begin{macrocode}
+\let\dfshape\normalshape
+% \end{macrocode}
+% \end{macro}
+%^^A \DeclareRobustCommand{\dfshape}{%
+%^^A \not@math@alphabet\dfshape\relax
+%^^A \fontshape\shapedefault\selectfont}
+% \begin{macro}{\swashapedefault}
+% cfr: be' i wneud am hwn?
+% \begin{macrocode}
+\newcommand*{\swshapedefault}{\itdefault}
+% \end{macrocode}
+% \end{macro}
+% \LaTeX{} ddim yn cynnwys \cs{swstyle} felly \dots?
+% \textbar{} \LaTeX{} doesn't include \cs{swstyle} so \dots?
+% \begin{macrocode}
+\ExplSyntaxOn
+\hook_gput_code:nnn {begindocument}{.}
+{% compatibility with original nfss \swshape
+% \end{macrocode}
+% Note this doesn't affect \cs{swashstyle} or \cs{textswash}
+% \begin{macro}{\swshape}
+% \changes{v1.0}{2024-09-16}{%
+% Conditionally overwrite \cs{swshape} to take account of default setting.
+% This is not for any package I know of on \ctan, but the original code used \cs{textsw}.%
+% }%
+% Conditional definition.
+% We overwrite the kernel's definition either way.
+% The \texttt{compat} option determines only with what we overwrite it.
+% \begin{macrocode}
+ \bool_if:NTF \g__exfs_compat_bool
+ {
+ \DeclareRobustCommand{\swshape}
+ {
+ \not@math@alphabet\swshape\relax
+ \swstyle\fontshape\swshapedefault\selectfont
+ }
+ \PackageWarning{nfssext-cfr}{
+ Overwriting ~ kernel ~ definition ~ of ~ \swshape \space (compat)
+ }
+ }{
+ \DeclareRobustCommand \swshape
+ {
+ \not@math@alphabet\swshape\relax
+ \exfs@swshape
+ }
+ \PackageWarning{nfssext-cfr}{
+ Overwriting ~ kernel ~ definition ~ of ~ \swshape \space (new)
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\textin}
+% Conditional definition.
+% \begin{macrocode}
+ \@ifpackageloaded{hyperref}{
+ \hook_gput_code:nnn { cmd/textin/before } { . }
+ {
+ \exfs@info{
+ Note ~ that ~ '\protect\textin' ~ is ~ defined ~ by ~ hyperref.\MessageBreak
+ Use ~ for ~ inferior ~ digits ~ will ~ yield ~ an\MessageBreak
+ undefined ~ command ~ error ~ in ~ document ~ font ~ encodings.\MessageBreak
+ Use ~ '\protect\textinf' ~ to ~ access ~ inferior ~ digits
+ }
+ }
+ }{
+ \DeclareTextFontCommand{\textin}{\infstyle}
+ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+}
+\ExplSyntaxOff
+% \end{macrocode}
+% \begin{macro}{\textln,\textos,\textinf,\textsu,\textsi,\textdf}
+% The annotation ‘anniffiniedig’ indicates the macro is \emph{not} defined by the kernel as of 2024.
+% \begin{macrocode}
+\DeclareTextFontCommand{\textln}{\lnstyle}% anniffiniedig
+\DeclareTextFontCommand{\textos}{\osstyle}% anniffiniedig
+\DeclareTextFontCommand{\textinf}{\infstyle}% anniffiniedig
+\DeclareTextFontCommand{\textsu}{\sustyle}% anniffiniedig
+\DeclareTextFontCommand{\textsi}{\sishape}% anniffiniedig
+\DeclareTextFontCommand{\textdf}{\dfshape}% anniffiniedig
+% \end{macrocode}
+% \end{macro}
+% \cs{textsw} is already defined on newer kernels with essentially the same meaning as \lpack{nfssext} originally gave it, so we remove the definition here.
+% However, the redefinition of \cs{swshape} means \cs{textsw} is effectively redefined, so the kernel definition is only technically retained.
+%
+% BEGIN added (cfr)
+%
+% \begin{macro}{\textti,\textlt,\textof,\textalt,\textreg,\emboss,\textorn,\textqt,\textsh,\texttm,\texttv}
+% Families
+% \begin{macrocode}
+\DeclareTextFontCommand{\textti}{\tistyle}% anniffiniedig
+\DeclareTextFontCommand{\textlt}{\ltstyle}% anniffiniedig
+\DeclareTextFontCommand{\textof}{\ofstyle}% anniffiniedig % open-face (or outline or blank) style
+\DeclareTextFontCommand{\textalt}{\altstyle}% anniffiniedig % alternative style
+\DeclareTextFontCommand{\textreg}{\regstyle}% anniffiniedig % `regular' style
+\DeclareTextFontCommand{\emboss}{\embossstyle}% anniffiniedig
+\DeclareTextFontCommand{\textorn}{\ornamentalstyle}% anniffiniedig % intended primarily for decorative initials etc.
+\DeclareTextFontCommand{\textqt}{\qtstyle}% anniffiniedig
+\DeclareTextFontCommand{\textsh}{\shstyle}% anniffiniedig % shadowed style
+\DeclareTextFontCommand{\texttm}{\tmstyle}% anniffiniedig
+\DeclareTextFontCommand{\texttv}{\tvstyle}% anniffiniedig
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\textl,\texto,\textp,\textt,\textpl,\textpo,\texttl,\textto}
+% Families - figures
+% \begin{macrocode}
+\DeclareTextFontCommand{\textl}{\lstyle}% anniffiniedig
+\DeclareTextFontCommand{\texto}{\ostyle}% anniffiniedig
+\DeclareTextFontCommand{\textp}{\pstyle}% anniffiniedig
+\DeclareTextFontCommand{\textt}{\tstyle}% anniffiniedig
+\DeclareTextFontCommand{\textpl}{\plstyle}% anniffiniedig
+\DeclareTextFontCommand{\textpo}{\postyle}% anniffiniedig
+\DeclareTextFontCommand{\texttl}{\tlstyle}% anniffiniedig
+\DeclareTextFontCommand{\textto}{\tostyle}% anniffiniedig
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\textol,\textswash,\textu,\textscu,\textui,\textri}
+% Shapes
+% \begin{macrocode}
+\DeclareTextFontCommand{\textol}{\olshape}% anniffiniedig % outline
+\DeclareTextFontCommand{\textswash}{\swashstyle}% anniffiniedig % an attempt to improve on \textsw
+\DeclareTextFontCommand{\textu}{\ushape}% anniffiniedig % be' yw hwn?! <_ underlined?
+\DeclareTextFontCommand{\textscu}{\scushape}% anniffiniedig
+\DeclareTextFontCommand{\textui}{\uishape}% anniffiniedig % upright italic
+\DeclareTextFontCommand{\textri}{\rishape}% anniffiniedig % reverse italic
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\textnw,\textcd,\textec,\textuc,\textet,\textep,\textex,\textux,\textrw}
+% Widths
+% \begin{macrocode}
+\DeclareTextFontCommand{\textnw}{\nwwidth}% anniffiniedig
+\DeclareTextFontCommand{\textcd}{\cdwidth}% anniffiniedig
+\DeclareTextFontCommand{\textec}{\ecwidth}% anniffiniedig
+\DeclareTextFontCommand{\textuc}{\ucwidth}% anniffiniedig
+\DeclareTextFontCommand{\textet}{\etwidth}% anniffiniedig
+\DeclareTextFontCommand{\textep}{\epwidth}% anniffiniedig
+\DeclareTextFontCommand{\textex}{\exwidth}% anniffiniedig
+\DeclareTextFontCommand{\textux}{\uxwidth}% anniffiniedig
+\DeclareTextFontCommand{\textrw}{\regwidth}% anniffiniedig
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\textmb,\textdb,\textbd,\textsb,\texteb,\textub,\textlg,\textel,\textul}
+% Weights
+% \begin{macrocode}
+\DeclareTextFontCommand{\textmb}{\mbweight}% anniffiniedig
+\DeclareTextFontCommand{\textdb}{\dbweight}% anniffiniedig
+\DeclareTextFontCommand{\textbd}{\bdweight}% new?
+\DeclareTextFontCommand{\textsb}{\sbweight}% anniffiniedig
+\DeclareTextFontCommand{\texteb}{\ebweight}% anniffiniedig
+\DeclareTextFontCommand{\textub}{\ubweight}% anniffiniedig
+\DeclareTextFontCommand{\textlg}{\lgweight}% anniffiniedig
+\DeclareTextFontCommand{\textel}{\elweight}% anniffiniedig
+\DeclareTextFontCommand{\textul}{\ulweight}% anniffiniedig
+% \end{macrocode}
+% \end{macro}
+% END added
+%
+% BEGIN patch font initialisation for Latin Modern
+%
+% Stop redefinition of bold if using Latin Modern as \texttt{clm}.
+% Kernel default only blocks redefinition for \texttt{lm}.
+% Don't rely on \lpack{cfr-lm} internal macros as they may change without notice \dots{}.
+% We don't need Dunhill, though, because it doesn't have bold of any kind.
+% \lpack{cfr-lm} doesn't support using Quotation Sans as default or using e.g.~serif as default sans, but there's nothing to stop somebody doing that so follow the kernel here even though it makes for a massive list\footnote{%
+% I know this will go off the page when typeset, but I have no idea whether I can safely insert line breaks into the patch and I shall scream if I break this again. (Pun fully intended.)%
+% }.
+% \begin{macrocode}
+\patchcmd{\init@series@setup}{cmr,cmss,cmtt,lcmss,lcmtt,lmr,lmss,lmtt}{cmr,cmss,cmtt,lcmss,lcmtt,lmr,lmss,lmtt,clm,clm2,clm2j,clmj,clm2js,clm2s,clmjs,clms,clm2jt,clm2t,clmjt,clmt,clm2jv,clm2v,clmjv,clmv,clm2jqs,clm2qs,clmjqs,clmqs}{%
+ \PackageWarning{nfssext-cfr}{%
+ Patching font initialisation macro for serif.%
+ }%
+}{%
+ \PackageWarning{nfssext-cfr}{%
+ Failed to patch font initialisation macro for serif.%
+ }%
+}
+\patchcmd{\init@series@setup}{{cmr,cmss,cmtt,lcmss,lcmtt,lmr,lmss,lmtt}}{{cmr,cmss,cmtt,lcmss,lcmtt,lmr,lmss,lmtt,clm,clm2,clm2j,clmj,clm2js,clm2s,clmjs,clms,clm2jt,clm2t,clmjt,clmt,clm2jv,clm2v,clmjv,clmv,clm2jqs,clm2qs,clmjqs,clmqs}}{%
+ \PackageWarning{nfssext-cfr}{%
+ Patching font initialisation macro for sans.%
+ }%
+}{%
+ \PackageWarning{nfssext-cfr}{%
+ Failed to patch font initialisation macro for sans.%
+ }%
+}
+\patchcmd{\init@series@setup}{{cmr,cmss,cmtt,lcmss,lcmtt,lmr,lmss,lmtt}}{{cmr,cmss,cmtt,lcmss,lcmtt,lmr,lmss,lmtt,clm,clm2,clm2j,clmj,clm2js,clm2s,clmjs,clms,clm2jt,clm2t,clmjt,clmt,clm2jv,clm2v,clmjv,clmv,clm2jqs,clm2qs,clmjqs,clmqs}}{%
+ \PackageWarning{nfssext-cfr}{%
+ Patching font initialisation macro for typewriter.%
+ }%
+}{%
+ \PackageWarning{nfssext-cfr}{%
+ Failed to patch font initialisation macro for typewriter.%
+ }%
+}
+% \end{macrocode}
+% END
+% \end{package}
+% \iffalse
+%</sty-nnfss>
+% \fi
+%
+% \subsection{NFSS}\label{subsec:sty-nfss}
+%
+% This code was written for the \emph{old} New Font Selection Scheme (\nfss).
+% It should not generally be loaded on current or recent kernels.
+%
+% \iffalse
+%<*sty-nfss>
+% \fi
+% \begin{package}{nfssext-cfr-nfss}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{svn-prov}
+\ProvidesPackageSVN[\filebase-nfss.sty]{$Id: nfssext-cfr.dtx 10456 2024-10-03 01:19:12Z cfrees $}[v1.1 \revinfo{} specially mangled by cfr; based on 2003/03/14 v1.2 Experimental NFSS Extensions; for old NFSS]
+\DefineFileInfoSVN
+% \end{macrocode}
+% ^^A Paid â defnyddio \GetFileInfoSVN*/\GetFileInfoSVN{} yn y fan hon!!
+%:cfr-added: use ifthen
+% \begin{macrocode}
+\RequirePackage{ifthen}
+% \end{macrocode}
+%:end-added
+% \begin{macro}{\exfs@tempa,\exfs@tempb,\exfs@tempf}
+% \begin{macrocode}
+\newcommand*{\exfs@tempa}{}
+\newcommand*{\exfs@tempb}{}
+% \end{macrocode}
+%:cfr-added: extra variable (\cs{exfs@tempf})
+% \begin{macrocode}
+\newcommand*{\exfs@tempf}{}
+% \end{macrocode}
+% \end{macro}
+%:end-added
+% \begin{macro}{\exfs@try@family}
+% \mbox{ }
+% \begin{macrocode}
+\newcommand*{\exfs@try@family}[2][]{%
+ \let\exfs@tempa\relax
+ \begingroup
+ \fontfamily{#2}\try@load@fontshape
+ \expandafter\ifx\csname\curr@fontshape\endcsname\relax
+ \edef\exfs@tempa{#1}%
+ \ifx\exfs@tempa\@empty
+ \PackageWarning{nfssext}{%
+ Font family '\f@encoding/#2' not available\MessageBreak
+ Ignoring font switch}%
+ \else
+ \PackageInfo{nfssext}{%
+ Font family '\f@encoding/#2' not available\MessageBreak
+ Font family '\f@encoding/#1' tried instead}%
+ \exfs@try@family{#1}%
+ \fi
+ \else
+ \gdef\exfs@tempa{\fontfamily{#2}\selectfont}%
+ \fi
+ \endgroup
+ \exfs@tempa}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\exfs@try@series}
+%:cfr-added \cs{exfs@try@series}
+% \begin{macrocode}
+\newcommand*{\exfs@try@series}[2][]{%
+ \let\exfs@tempa\relax
+ \begingroup
+ \fontseries{#2}\try@load@fontshape
+ \expandafter\ifx\csname\curr@fontshape\endcsname\relax
+ \edef\exfs@tempa{#1}%
+ \ifx\exfs@tempa\@empty
+ \PackageWarning{nfssext-cfr}{%
+ Font series '\f@encoding/\f@family/#2' not available\MessageBreak
+ Ignoring font switch}%
+ \else
+ \PackageInfo{nfssext-cfr}{%
+ Font family '\f@encoding/\f@family/#2' not available\MessageBreak
+ Font family '\f@encoding/\f@family/#1' tried instead}%
+ \exfs@try@series{#1}%
+ \fi
+ \else
+ \gdef\exfs@tempa{\fontseries{#2}\selectfont}%
+ \fi
+ \endgroup
+ \exfs@tempa
+}
+% \end{macrocode}
+%:end-added
+% \end{macro}
+% \begin{macro}{\exfs@get@base,\exfs@get@variants,\exfs@next,\exfs@shift,\exfs@first,\exfs@part,\exfs@second}
+% \mbox{ }
+% \begin{macrocode}
+\def\exfs@get@base#1#2#3#4\@nil{#1#2#3}
+% \end{macrocode}
+%:cfr-added:more \cs{exfs@} commands (get@variants, next, shift, first, part, second)
+% \begin{macrocode}
+\def\exfs@get@variants#1#2#3#4\@nil{#4}
+\def\exfs@next#1#2\@nil{#1}
+\def\exfs@shift#1#2\@nil{#2}
+\def\exfs@first#1#2\@nil{#1}
+\def\exfs@part#1#2\@nil{#2}
+\def\exfs@second#1#2#3\@nil{#2}
+% \end{macrocode}
+%:end-added
+% \end{macro}
+% \begin{macro}{\lnstyle,\osstyle,\infstyle,\instyle,\sustyle,\swstyle}
+% \mbox{ }
+% \begin{macrocode}
+\DeclareRobustCommand{\lnstyle}{%
+ \not@math@alphabet\lnstyle\relax
+ \exfs@try@family[\expandafter\exfs@get@base\f@family\@nil]%
+ {\expandafter\exfs@get@base\f@family\@nil x}%
+}
+\DeclareRobustCommand{\osstyle}{%
+ \not@math@alphabet\osstyle\relax
+ \exfs@try@family{\expandafter\exfs@get@base\f@family\@nil j}}
+\DeclareRobustCommand{\instyle}{%
+ \not@math@alphabet\instyle\relax
+ \exfs@try@family{\expandafter\exfs@get@base\f@family\@nil 0}}
+\DeclareRobustCommand{\sustyle}{%
+ \not@math@alphabet\sustyle\relax
+ \exfs@try@family{\expandafter\exfs@get@base\f@family\@nil 1}}
+\DeclareRobustCommand{\swstyle}{%
+ \not@math@alphabet\swstyle\relax
+ \exfs@try@family{\expandafter\exfs@get@base\f@family\@nil w}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\exfs@merge@families}
+%:cfr-added - merge families
+% \begin{macrocode}
+\newcommand*\exfs@merge@families[1]{%
+ \edef\exfs@tempf{#1}%
+ \edef\tempa{\expandafter\exfs@get@variants\f@family\@nil}%
+ \edef\tempo{2j}%
+ \let\exfs@tempq\@empty
+ \def\exfs@tempg{}%
+ \newif\ifadded
+ \addedfalse
+% \end{macrocode}
+% check whether there are variants - if not just use the requested addition
+% \begin{macrocode}
+ \ifx\tempa\@empty
+ \edef\exfs@tempq{\exfs@tempf}%
+ \addedtrue
+ \else
+ \gdef\set{0,1,2,a,d,e,f,h,j,l,p,q,s,t,v,w}% these are the variants to consider - the order here and in the font name is crucial
+ \ifx\tempo\exfs@tempf
+ \@for \xx:=\set \do {%
+% \end{macrocode}
+% check whether there are variants left - if not set the ‘next variant’ to empty
+% \begin{macrocode}
+ \ifx\tempa\@empty
+ \let\exfs@tempn\@empty
+ \else
+% \end{macrocode}
+% o/w get the next variant
+% \begin{macrocode}
+ \edef\exfs@tempn{\expandafter\exfs@next\tempa\@nil}%
+ \fi
+ \edef\tempt{2}%
+ \edef\tempj{j}%
+% \end{macrocode}
+% if the next variant is 2 or j, ignore it
+% \begin{macrocode}
+ \ifx\exfs@tempn\tempt
+ \edef\tempa{\expandafter\exfs@shift\tempa\@nil}%
+ \fi
+ \ifx\exfs@tempn\tempj % if the next variant is j, ignore it
+ \edef\tempa{\expandafter\exfs@shift\tempa\@nil}%
+ \fi
+% \end{macrocode}
+% see if the current value is either 2 or j and add it if so and if needed
+% \begin{macrocode}
+ \ifx\tempt\xx
+ \edef\exfs@tempg{\exfs@tempg\xx}%
+ \else
+ \ifx\tempj\xx % if the current value is j, we're done
+ \edef\exfs@tempq{\exfs@tempg\xx\tempa}%
+ \let\tempa\@empty
+ \addedtrue
+ \else
+% \end{macrocode}
+% o/w see if the current value matches the next variant
+% \begin{macrocode}
+ \ifx\xx\exfs@tempn
+ \edef\exfs@tempg{\exfs@tempg\xx}%
+ \edef\tempa{\expandafter\exfs@shift\tempa\@nil}%
+ \fi
+ \fi
+ \fi
+ }%
+ \else
+ \@for \xx:=\set \do {%
+% \end{macrocode}
+% check whether there are variants left and, if not, add the addition if needed
+% \begin{macrocode}
+ \ifx\tempa\@empty
+ \ifadded
+ \else
+ \edef\exfs@tempq{\exfs@tempg\exfs@tempf}%
+ \addedtrue
+ \fi
+ \else
+% \end{macrocode}
+% o/w get the next variant
+% \begin{macrocode}
+ \edef\exfs@tempn{\expandafter\exfs@next\tempa\@nil}%
+% \end{macrocode}
+% if the new token equals the next variant, combine whatever is saved in \cs{exfs@tempg} with whatever remains in \cs{tempa}
+% \begin{macrocode}
+ \ifx\exfs@tempn\exfs@tempf
+ \edef\exfs@tempq{\exfs@tempg\tempa}%
+ \addedtrue
+ \let\tempa\@empty
+ \else
+% \end{macrocode}
+% o/w, if the current value matches the requested addition, add it in
+% \begin{macrocode}
+ \ifx\exfs@tempf\xx
+ \edef\exfs@tempq{\exfs@tempg\xx\tempa}%
+ \addedtrue
+ \let\tempa\@empty
+ \else
+% \end{macrocode}
+% o/w, if the current value matches the next variant, shift
+% \begin{macrocode}
+ \ifx\exfs@tempn\xx
+ \edef\exfs@tempg{\exfs@tempg\xx}%
+ \edef\tempa{\expandafter\exfs@shift\tempa\@nil}%
+ \fi
+ \fi
+ \fi
+ \fi
+ }%
+ \fi
+ \fi
+ \ifx\exfs@tempq\@empty
+ \PackageError{nfssext-cfr}{Something is wrong here. Ignoring font switching command.}{}%
+ \else
+ \exfs@try@family{\expandafter\exfs@get@base\f@family\@nil \exfs@tempq}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pstyle,\ostyle,\postyle,\tistyle}
+% \begin{macrocode}
+\DeclareRobustCommand{\pstyle}{% proportional figures
+ \not@math@alphabet\pstyle\relax
+ \exfs@merge@families{2}}
+\DeclareRobustCommand{\tistyle}{% titling/display
+ \not@math@alphabet\tistyle\relax
+ \exfs@merge@families{d}}
+\DeclareRobustCommand{\ostyle}{% oldstyle figures (cf. original osstyle above)
+ \not@math@alphabet\ostyle\relax
+ \exfs@merge@families{j}}
+% \end{macrocode}
+% combined command for proportional oldstyle
+% \begin{macrocode}
+\DeclareRobustCommand{\postyle}{%
+ \not@math@alphabet\postyle\relax
+ \exfs@merge@families{2j}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltstyle,\ofstyle,\altstyle,\regstyle,\embossstyle,\ornamentalstyle,\swashstyle,\shstyle,\qtstyle}
+%note that this command is for use when the light version is a separate family rather than a weight variant (e.g. when you've got light, light bold etc. as well as regular weights)
+% \begin{macrocode}
+\DeclareRobustCommand{\ltstyle}{%
+ \not@math@alphabet\ltstyle\relax
+ \exfs@merge@families{l}}
+% \end{macrocode}
+%let's hope there aren't any fonts with a light family *and* an outline/openface/blank version
+% \begin{macrocode}
+\DeclareRobustCommand{\ofstyle}{%
+ \not@math@alphabet\ofstyle\relax
+ \exfs@merge@families{l}}
+\DeclareRobustCommand{\altstyle}{% alternative style
+ \not@math@alphabet\altstyle\relax
+ \exfs@merge@families{a}}
+\DeclareRobustCommand{\regstyle}{% ``regular'' style
+ \not@math@alphabet\regstyle\relax
+ \exfs@try@family{\expandafter\exfs@get@base\f@family\@nil}}
+\DeclareRobustCommand{\embossstyle}{%
+ \not@math@alphabet\embossstyle\relax
+ \exfs@merge@families{e}}
+\DeclareRobustCommand{\ornamentalstyle}{% intended primarily for decorative initial fonts etc.
+ \not@math@alphabet\ornamentalstyle\relax
+ \exfs@merge@families{p}}
+\DeclareRobustCommand{\qtstyle}{% quotation style (assumes sans)
+ \not@math@alphabet\qtstyle\relax
+ \sffamily
+ \exfs@merge@families{q}}
+\DeclareRobustCommand{\shstyle}{%
+ \not@math@alphabet\shstyle\relax
+ \exfs@merge@families{h}}
+\DeclareRobustCommand{\swashstyle}{% an attempt to improve on \swstyle
+ \not@math@alphabet\swashstyle\relax
+ \exfs@merge@families{w}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\tmstyle,\tvstyle}
+% Macros to switch between monowidth and variable typewriter.
+% These need to unmerge before merging.
+% We need to unmerge sans as well as the other kind of typewriter.
+% \begin{macrocode}
+\DeclareRobustCommand{\tmstyle}{% monowidth typewriter
+ \not@math@alphabet\tmstyle\relax
+ \exfs@unmerge@families{s}%
+ \exfs@unmerge@families{v}%
+ \exfs@merge@families{t}}
+\DeclareRobustCommand{\tvstyle}{% variable width typewriter
+ \not@math@alphabet\tvstyle\relax
+ \exfs@unmerge@families{s}%
+ \exfs@unmerge@families{t}%
+ \exfs@merge@families{v}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\exfs@unmerge@families}
+%:cfr-added - unmerge families
+% \begin{macrocode}
+\newcounter{taken}%
+\newcommand*\exfs@unmerge@families[1]{%
+ \edef\exfs@tempf{#1}%
+ \edef\tempa{\expandafter\exfs@get@variants\f@family\@nil}%
+ \let\exfs@tempq\@empty
+ \edef\exfs@tempg{}%
+ \setcounter{taken}{0}%
+% \end{macrocode}
+% check whether there are variants - if not do nothing
+% \begin{macrocode}
+ \ifx\tempa\@empty
+ \edef\exfs@tempq{}%
+ \else
+% \end{macrocode}
+% o/w go through the variants to find the one to delete
+% \begin{macrocode}
+ \whiledo{\value{taken}<1}{%
+% \end{macrocode}
+% get the next variant
+% \begin{macrocode}
+ \edef\exfs@tempn{\expandafter\exfs@next\tempa\@nil}%
+% \end{macrocode}
+% see if the next variant is the thing we seek and, if so, eliminate it
+% \begin{macrocode}
+ \ifx\exfs@tempf\exfs@tempn
+ \edef\tempa{\expandafter\exfs@shift\tempa\@nil}%
+ \edef\exfs@tempq{\exfs@tempg\tempa}%
+ \stepcounter{taken}%
+% \end{macrocode}
+% o/w save the next variant and move on if any variants remain
+% \begin{macrocode}
+ \else
+ \edef\exfs@tempg{\exfs@tempg\exfs@tempn}%
+ \edef\tempa{\expandafter\exfs@shift\tempa\@nil}%
+ \ifx\tempa\@empty% if there are no variants left, we're done
+ \edef\exfs@tempq{\exfs@tempg}%
+ \stepcounter{taken}%
+ \fi
+ \fi
+ }%
+ \fi
+ \exfs@try@family{\expandafter\exfs@get@base\f@family\@nil \exfs@tempq}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\tstyle,\lstyle}
+% \mbox{ }
+% \begin{macrocode}
+\DeclareRobustCommand{\tstyle}{% tabular figures
+ \not@math@alphabet\tstyle\relax
+ \exfs@unmerge@families{2}}
+\DeclareRobustCommand{\lstyle}{% lining figures (cf. command above)
+ \not@math@alphabet\lstyle\relax
+ \exfs@unmerge@families{j}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\tlstyle,\plstyle,\tostyle}
+% make a combined command for tabular lining
+% \begin{macrocode}
+\DeclareRobustCommand{\tlstyle}{%
+ \lstyle\tstyle}
+% \end{macrocode}
+% proportional lining
+% \begin{macrocode}
+\DeclareRobustCommand{\plstyle}{%
+ \lstyle\pstyle}
+% \end{macrocode}
+% tabular oldstyle {?!}
+% \begin{macrocode}
+\DeclareRobustCommand{\tostyle}{%
+ \ostyle\tstyle}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\sidefault,\sishape}
+%:end-added % si is italic sc
+% \begin{macrocode}
+\newcommand*{\sidefault}{si}
+\DeclareRobustCommand{\sishape}{%
+ \not@math@alphabet\sishape\relax
+ \fontshape\sidefault\selectfont}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\oldefault,\olshape,\scoldefault,\scolshape}
+%:cfr-added - is this how outline shapes should be handled?
+% \begin{macrocode}
+\newcommand*{\oldefault}{ol}
+\DeclareRobustCommand{\olshape}{%
+ \not@math@alphabet\olshape\relax
+ \fontshape\oldefault\selectfont}
+\newcommand*{\scoldefault}{scol}
+\DeclareRobustCommand{\scolshape}{%
+ \not@math@alphabet\scolshape\relax
+ \fontshape\scoldefault\selectfont}
+% \end{macrocode}
+%^^A\DeclareRobustCommand{\olshape}{%
+%^^A \not@math@alphabet\olshape\relax
+%^^A \exfs@merge@shape{\oldefault}{\scdefault}{\scoldefault}}
+% \end{macro}
+% \begin{macro}{\udefault,\ushape,\scudefault,\scushape}
+%:fudge
+% \begin{macrocode}
+\newcommand*{\udefault}{u}
+\DeclareRobustCommand{\ushape}{%
+ \not@math@alphabet\ushape\relax
+ \fontshape\udefault\selectfont}
+\newcommand*{\scudefault}{su}
+\DeclareRobustCommand{\scushape}{%
+ \not@math@alphabet\scushape\relax
+ \fontshape\scudefault\selectfont}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\uidefault,\uishape,\ridefault,\rishape}
+%:upright italic
+% \begin{macrocode}
+\newcommand*{\uidefault}{ui}
+\DeclareRobustCommand{\uishape}{%
+ \not@math@alphabet\uishape\relax
+ \fontshape\uidefault\selectfont}
+% \end{macrocode}
+%:can i do this for reverse italic?
+% \begin{macrocode}
+\newcommand*{\ridefault}{ri}
+\DeclareRobustCommand{\rishape}{%
+ \not@math@alphabet\rishape\relax
+ \fontshape\ridefault\selectfont}
+% \end{macrocode}
+% \end{macro}
+%:end-added
+% \begin{macro}{\exfs@merge@shape}
+% \mbox{ }
+% \begin{macrocode}
+\newcommand*{\exfs@merge@shape}[3]{%
+ \edef\exfs@tempa{#1}%
+ \edef\exfs@tempb{#2}%
+ \ifx\f@shape\exfs@tempb
+ \expandafter\ifx\csname\f@encoding/\f@family/\f@series/#3\endcsname\relax
+ \else
+ \edef\exfs@tempa{#3}%
+ \fi
+ \fi
+ \fontshape{\exfs@tempa}\selectfont}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\exfs@font@width}
+%:cfr-added - merge width changes into series
+% \begin{macrocode}
+\newcommand*{\exfs@font@width}{%
+ \edef\exfs@tempf{\expandafter\exfs@first\f@series\@nil }%
+ \edef\exfs@temppart{\expandafter\exfs@part\f@series\@nil }%
+ \ifx\exfs@temppart\@empty
+ \def\exfs@width{}
+ \else
+ \edef\exfs@temps{\expandafter\exfs@second\f@series\@nil }%
+ \ifx\exfs@temps{b}
+ \edef\exfs@width{\expandafter\exfs@part\exfs@temps\@nil }%
+ \else
+ \ifx\exfs@temps{l}
+ \edef\exfs@width{\expandafter\exfs@part\exfs@temps\@nil }%
+ \else
+ \edef\exfs@width{\exfs@temppart}%
+ \fi
+ \fi
+ \fi
+ \exfs@width
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\exfs@merge@width}
+% \mbox{ }
+% \begin{macrocode}
+\newcommand*{\exfs@merge@width}[1]{%
+ \edef\exfs@temph{#1}%
+ \edef\exfs@tempf{\expandafter\exfs@first\f@series\@nil }%
+ \edef\exfs@temppart{\expandafter\exfs@part\f@series\@nil }%
+ \def\tempb{b}%
+ \def\templ{l}%
+ \ifx\exfs@temppart\@empty
+ \def\exfs@series{\expandafter\exfs@tempf\exfs@temph}%
+ \else
+ \edef\exfs@temps{\expandafter\exfs@second\f@series\@nil }%
+ \ifx\exfs@temps\tempb
+ \def\exfs@series{\expandafter\exfs@tempf\exfs@temps\exfs@temph}%
+ \else
+ \ifx\exfs@temps\templ
+ \def\exfs@series{\expandafter\exfs@tempf\exfs@temps\exfs@temph}%
+ \else
+ \def\exfs@series{\expandafter\exfs@tempf\exfs@temph}%
+ \fi
+ \fi
+ \fi
+ \exfs@try@series{\exfs@series}%
+}
+%^^A \fontseries\exfs@series\selectfont}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\exfs@unmerge@width}
+% \mbox{ }
+% \begin{macrocode}
+\newcommand*{\exfs@unmerge@width}{%
+ \edef\exfs@tempf{\expandafter\exfs@first\f@series\@nil }%
+ \edef\exfs@temppart{\expandafter\exfs@part\f@series\@nil }%
+ \def\tempb{b}%
+ \def\templ{l}%
+ \ifx\exfs@temppart\@empty
+ \def\exfs@series{\expandafter\exfs@tempf}%
+ \else
+ \edef\exfs@temps{\expandafter\exfs@second\f@series\@nil }%
+ \ifx\exfs@temps\tempb
+ \def\exfs@series{\expandafter\exfs@tempf\exfs@temps}%
+ \else
+ \ifx\exfs@temps\templ
+ \def\exfs@series{\expandafter\exfs@tempf\exfs@temps}%
+ \else
+ \def\exfs@series{\expandafter\exfs@tempf}%
+ \fi
+ \fi
+ \fi
+ \exfs@try@series{\exfs@series}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\regwidth}
+% \mbox{ }
+% \begin{macrocode}
+\DeclareRobustCommand{\regwidth}{%
+ \not@math@alphabet\regwidth\relax
+ \exfs@unmerge@width}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\nwdefault,\nwwidth,\cddefault,\cdwidth,\ecdefault,\ecwidth,\ucdefault,\ucwidth}
+% \mbox{ }
+% \begin{macrocode}
+\newcommand*{\nwdefault}{c}
+\DeclareRobustCommand{\nwwidth}{%
+ \not@math@alphabet\nwwidth\relax
+ \exfs@merge@width{\nwdefault}}
+\newcommand*{\cddefault}{c}
+\DeclareRobustCommand{\cdwidth}{%
+ \not@math@alphabet\cdwidth\relax
+ \exfs@merge@width{\cddefault}}
+\newcommand*{\ecdefault}{ec}
+\DeclareRobustCommand{\ecwidth}{%
+ \not@math@alphabet\ecwidth\relax
+ \exfs@merge@width{\ecdefault}}
+\newcommand*{\ucdefault}{uc}
+\DeclareRobustCommand{\ucwidth}{%
+ \not@math@alphabet\ucwidth\relax
+ \exfs@merge@width{\ucdefault}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\etdefault,\etwidth,\epdefault,\epwidth,\exdefault,\exwidth,\uxdefault,\uxwidth}
+% \mbox{ }
+% \begin{macrocode}
+\newcommand*{\etdefault}{x}
+\DeclareRobustCommand{\etwidth}{%
+ \not@math@alphabet\etwidth\relax
+ \exfs@merge@width{\etdefault}}
+\newcommand*{\epdefault}{x}
+\DeclareRobustCommand{\epwidth}{%
+ \not@math@alphabet\epwidth\relax
+ \exfs@merge@width{\epdefault}}
+\newcommand*{\exdefault}{ex}
+\DeclareRobustCommand{\exwidth}{%
+ \not@math@alphabet\exwidth\relax
+ \exfs@merge@width{\exdefault}}
+\newcommand*{\uxdefault}{ux}
+\DeclareRobustCommand{\uxwidth}{%
+ \not@math@alphabet\uxwidth\relax
+ \exfs@merge@width{\uxdefault}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\exfs@merge@weight}
+%:cfr-added merge weight changes into series
+% \begin{macrocode}
+\newcommand*{\exfs@merge@weight}[1]{%
+ \edef\exfs@tempg{#1}%
+ \edef\exfs@tempf{\expandafter\exfs@first\f@series\@nil }%
+ \edef\exfs@temppart{\expandafter\exfs@part\f@series\@nil }%
+ \def\templ{l}%
+ \def\tempb{b}%
+% \end{macrocode}
+% :case when there's no second part, so the single character must be the weight and should be replaced
+% \begin{macrocode}
+ \ifx\exfs@temppart\@empty
+ \def\exfs@series{\expandafter\exfs@tempg}%
+% \end{macrocode}
+% :case when there's a second part
+% \begin{macrocode}
+ \else
+% \end{macrocode}
+% :get first character of second part
+% \begin{macrocode}
+ \edef\exfs@temps{\expandafter\exfs@second\f@series\@nil }%
+ \edef\exfs@tempw{\expandafter\exfs@part\exfs@temps\@nil }%
+% \end{macrocode}
+% :is the first character b? if so, it is part of the weight and should be replaced
+% \begin{macrocode}
+ \ifx\exfs@temps\tempb
+ \def\exfs@series{\expandafter\exfs@tempg\exfs@tempw}%
+ \else
+% \end{macrocode}
+% :is the first character l? if so, it is part of the weight and should be replaced
+% \begin{macrocode}
+ \ifx\exfs@temps\templ
+ \def\exfs@series{\expandafter\exfs@tempg\exfs@tempw}%
+ \else
+% \end{macrocode}
+% :o/w the first character is part of the width and should be retained
+% \begin{macrocode}
+ \def\exfs@series{\expandafter\exfs@tempg\exfs@temppart}%
+ \fi
+ \fi
+ \fi
+% \end{macrocode}
+%^^A \fontseries\exfs@series\selectfont}
+% \begin{macrocode}
+ \ifx\exfs@tempg\exfs@series
+ \exfs@try@series{\exfs@series}%
+ \else
+ \exfs@try@series[\exfs@tempg]{\exfs@series}% assume user wants to change weight even if this changes back to the default width
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\mbdefault,\mbweight,\bddefault,\bfweight,\bdweight}
+% \begin{macrocode}
+\newcommand*{\mbdefault}{mb}
+\DeclareRobustCommand{\mbweight}{%
+ \not@math@alphabet\mbweight\relax
+ \exfs@merge@weight{\mbdefault}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\dbdefault,\dbweight,\sbdefault,\sbweight,\ebdefault,\ebweight,\ubdefault,\ubweight}
+% Heavy weights.
+% \begin{macrocode}
+\newcommand*{\dbdefault}{db}
+\DeclareRobustCommand{\dbweight}{%
+ \not@math@alphabet\dbweight\relax
+ \exfs@merge@weight{\dbdefault}}
+\newcommand*{\sbdefault}{sb}
+\DeclareRobustCommand{\sbweight}{%
+ \not@math@alphabet\sbweight\relax
+ \exfs@merge@weight{\sbdefault}}
+\newcommand*{\ebdefault}{eb}
+\DeclareRobustCommand{\ebweight}{%
+ \not@math@alphabet\ebweight\relax
+ \exfs@merge@weight{\ebdefault}}
+\newcommand*{\ubdefault}{ub}
+\DeclareRobustCommand{\ubweight}{%
+ \not@math@alphabet\ubweight\relax
+ \exfs@merge@weight{\ubdefault}}
+\newcommand*{\lgdefault}{l}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\lgdefault,\lgweight,\eldefault,\elweight,\uldefault,\ulweight}
+%note - use this if light is a variant weight, rather than a separate family
+% \begin{macrocode}
+\DeclareRobustCommand{\lgweight}{%
+ \not@math@alphabet\lgweight\relax
+ \exfs@merge@weight{\lgdefault}}
+\newcommand*{\eldefault}{el}
+\DeclareRobustCommand{\elweight}{%
+ \not@math@alphabet\elweight\relax
+ \exfs@merge@weight{\eldefault}}
+\newcommand*{\uldefault}{ul}
+\DeclareRobustCommand{\ulweight}{%
+ \not@math@alphabet\ulweight\relax
+ \exfs@merge@weight{\uldefault}}
+% \end{macrocode}
+% \end{macro}
+%:end-added
+% \begin{macro}{\itshape,\scshape,\upshape,\dfshape}
+% redefinition
+% \begin{macrocode}
+\DeclareRobustCommand{\itshape}{%
+ \not@math@alphabet\itshape\mathit
+ \exfs@merge@shape{\itdefault}{\scdefault}{\sidefault}}
+% \end{macrocode}
+% original
+%^^A\DeclareRobustCommand{\scshape}{%
+%^^A \not@math@alphabet\scshape\relax
+%^^A \exfs@merge@shape{\scdefault}{\itdefault}{\sidefault}}
+%:cfr-altered: \cs{scshape}
+% \begin{macrocode}
+\DeclareRobustCommand{\scshape}{%
+ \not@math@alphabet\scshape\relax
+ \def\tempu{u}%
+ \def\tempo{ol}%
+ \ifx\f@shape\tempu
+ \exfs@merge@shape{\scdefault}{\udefault}{\scudefault}%
+ \else
+ \ifx\f@shape\tempo
+ \exfs@merge@shape{\scdefault}{\oldefault}{\scoldefault}%
+ \else
+ \exfs@merge@shape{\scdefault}{\itdefault}{\sidefault}%
+ \fi
+ \fi
+}
+% \end{macrocode}
+%:end-altered
+% \begin{macrocode}
+\DeclareRobustCommand{\upshape}{%
+ \not@math@alphabet\upshape\relax
+ \exfs@merge@shape{\updefault}{\sidefault}{\scdefault}}
+\DeclareRobustCommand{\dfshape}{%
+ \not@math@alphabet\dfshape\relax
+ \fontshape\shapedefault\selectfont}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\swashapedefault,\swshape}
+% \begin{macrocode}
+\newcommand*{\swshapedefault}{\itdefault}
+\DeclareRobustCommand{\swshape}{%
+ \not@math@alphabet\swshape\relax
+ \swstyle\fontshape\swshapedefault\selectfont}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\textln,\textos,\textin,\textsu,\textsi,\textdf,\textsw}
+% \mbox{ }
+% \begin{macrocode}
+\DeclareTextFontCommand{\textln}{\lnstyle}
+\DeclareTextFontCommand{\textos}{\osstyle}
+\DeclareTextFontCommand{\textin}{\instyle}
+\DeclareTextFontCommand{\textsu}{\sustyle}
+\DeclareTextFontCommand{\textsi}{\sishape}
+\DeclareTextFontCommand{\textdf}{\dfshape}
+\DeclareTextFontCommand{\textsw}{\swshape}
+% \end{macrocode}
+% \end{macro}
+%:cfr-added
+% \begin{macro}{\textti,\textlt,\textof,\textalt,\textreg,\emboss,\textorn,\textqt,\textsh,\texttm,\texttv}
+% Families
+% \begin{macrocode}
+\DeclareTextFontCommand{\textti}{\tistyle}
+\DeclareTextFontCommand{\textlt}{\ltstyle}
+\DeclareTextFontCommand{\textof}{\ofstyle} % open-face (or outline or blank) style
+\DeclareTextFontCommand{\textalt}{\altstyle} % alternative style
+\DeclareTextFontCommand{\textreg}{\regstyle} % ``regular'' style
+\DeclareTextFontCommand{\emboss}{\embossstyle}
+\DeclareTextFontCommand{\textorn}{\ornamentalstyle} % intended primarily for decorative initials etc.
+\DeclareTextFontCommand{\textqt}{\qtstyle}
+\DeclareTextFontCommand{\textsh}{\shstyle} % shadowed style
+\DeclareTextFontCommand{\texttm}{\tmstyle}
+\DeclareTextFontCommand{\texttv}{\tvstyle}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\textl,\texto,\textp,\textt,\textpl,\textpo,\texttl,\textto}
+% Families - figures
+% \begin{macrocode}
+\DeclareTextFontCommand{\textl}{\lstyle}
+\DeclareTextFontCommand{\texto}{\ostyle}
+\DeclareTextFontCommand{\textp}{\pstyle}
+\DeclareTextFontCommand{\textt}{\tstyle}
+\DeclareTextFontCommand{\textpl}{\plstyle}
+\DeclareTextFontCommand{\textpo}{\postyle}
+\DeclareTextFontCommand{\texttl}{\tlstyle}
+\DeclareTextFontCommand{\textto}{\tostyle}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\textol,\textswash,\textu,\textscu,\textui,\textri}
+% Shapes
+% \begin{macrocode}
+\DeclareTextFontCommand{\textol}{\olshape} % outline
+\DeclareTextFontCommand{\textswash}{\swashstyle} % an attempt to improve on \textsw
+\DeclareTextFontCommand{\textu}{\ushape}
+\DeclareTextFontCommand{\textscu}{\scushape}
+\DeclareTextFontCommand{\textui}{\uishape} % upright italic
+\DeclareTextFontCommand{\textri}{\rishape} % reverse italic
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\textnw,\textcd,\textec,\textuc,\textet,\textep,\textex,\textux,\textrw}
+% Widths
+% \begin{macrocode}
+\DeclareTextFontCommand{\textnw}{\nwwidth}
+\DeclareTextFontCommand{\textcd}{\cdwidth}
+\DeclareTextFontCommand{\textec}{\ecwidth}
+\DeclareTextFontCommand{\textuc}{\ucwidth}
+\DeclareTextFontCommand{\textet}{\etwidth}
+\DeclareTextFontCommand{\textep}{\epwidth}
+\DeclareTextFontCommand{\textex}{\exwidth}
+\DeclareTextFontCommand{\textux}{\uxwidth}
+\DeclareTextFontCommand{\textrw}{\regwidth}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\textmb,\textdb,\textbd,\textsb,\texteb,\textub,\textlg,\textel,\textul}
+% Weights
+% \begin{macrocode}
+\DeclareTextFontCommand{\textmb}{\mbweight}
+\DeclareTextFontCommand{\textdb}{\dbweight}
+\DeclareTextFontCommand{\textsb}{\sbweight}
+\DeclareTextFontCommand{\texteb}{\ebweight}
+\DeclareTextFontCommand{\textub}{\ubweight}
+\DeclareTextFontCommand{\textlg}{\lgweight}
+\DeclareTextFontCommand{\textel}{\elweight}
+\DeclareTextFontCommand{\textul}{\ulweight}
+% \end{macrocode}
+% \end{macro}
+%end-added
+% \end{package}
+% \iffalse
+%</sty-nfss>
+% \fi
+%
+%
+%\Finale
diff --git a/Master/texmf-dist/source/latex/nfssext-cfr/nfssext-cfr.ins b/Master/texmf-dist/source/latex/nfssext-cfr/nfssext-cfr.ins
new file mode 100644
index 00000000000..bd6ac1448b4
--- /dev/null
+++ b/Master/texmf-dist/source/latex/nfssext-cfr/nfssext-cfr.ins
@@ -0,0 +1,111 @@
+%% $Id: nfssext-cfr.ins 10335 2024-09-10 16:13:03Z cfrees $
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% nfssext-cfr.ins
+%% Additions and changes Copyright (C) 2008-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 nfssext-cfr.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/nfssext-cfr}
+
+\declarepreamble\safonol
+Copyright (C) 2008-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
+nfssext-cfr. You may however distribute the package nfssext-cfr without
+such generated files.
+
+This work consists of all files listed in manifest.txt.
+\endpreamble
+
+\def\baseFileName{nfssext.sty}
+\def\basePkgName{The Font Installation Guide}
+\def\basePkgArk{fontinstallationguide}
+\def\basePkgAuthor{Philipp Lehman}
+% \def\preChanges{%
+% - One thing or another.}
+\def\targType{The file }
+\def\targPkg{nfssext-cfr}
+
+\declarepreamble\derpreamble
+Additions and changes Copyright (C) 2008-2024 Clea F. Rees.
+Code from \basePkgArk Copyright (C) 2002-2004 \basePkgAuthor (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.
+
+
+\targType \outFileName is a derived work under the terms of the LPPL.
+It is based on version 1.2 of \baseFileName which is supplied with
+\basePkgName by \basePkgAuthor. A copy of \basePkgName, including an
+unmodified version of \baseFileName is available from
+ https://tug.ctan.org/pkg/\basePkgArk.
+\baseFileName is part of the included archive figuide-examples.tar.gz
+which consists of examples and templates released under the LPPL.
+\baseFileName is included in the files for tutorials 3, 5 and 6.
+
+The main modifications made to this file are described in \targPkg.dtx.
+\endpreamble
+
+\askonceonly
+
+\usepreamble\safonol
+
+\generate{%
+ \usepreamble\derpreamble
+ \file{nfssext-cfr.sty}{\from{nfssext-cfr.dtx}{sty}}
+ \file{nfssext-cfr-nfss.sty}{\from{nfssext-cfr.dtx}{sty-nfss}}
+ \file{nfssext-cfr-nnfss.sty}{\from{nfssext-cfr.dtx}{sty-nnfss}}
+ % \file{??.tex}{\from{nfssext-cfr.dtx}{??}}
+ % \usepreamble\derpreamble
+ % \file{other.etx}{\from{nfssext-cfr.dtx}{other}}
+}
+
+
+\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..d4335140f5e 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.96m, released 2024-09-29}
%
% \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:
%
@@ -211,7 +211,7 @@
%
% \item |pdflang| is deprecated. Instead \cs{DocumentMetadata} should be used:
% \begin{verbatim}
-% \cs{DocumentMetadata}{lang=de-DE}
+% \DocumentMetadata{lang=de-DE}
% \end{verbatim}
%
% The value can be retrieved as |document/lang|.
@@ -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-09-29 v0.96m %
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
@@ -1467,7 +1467,7 @@
%\tl_set:cn {@#1}{#2}
\AddToDocumentProperties[hyperref]{#1}{#2}
}
-\cs_generate_variant:Nn \@@_store_metadata:nn {en,ne,ee}
+\cs_generate_variant:Nn \@@_store_metadata:nn {en,ne,ee,no,eo}
% \end{macrocode}
% \subsection{citecolor}
% cite is a link context. So we define a hook, and the keys in terms of this hook.
@@ -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}
{
@@ -1578,6 +1588,7 @@
% \begin{variable}
% {
% \l_@@_tmpa_tl,
+% \l_@@_tmpb_tl,
% \l_@@_tmpa_seq,
% \l_@@_tmpa_int,
% \l_@@_tmpa_box,
@@ -1586,6 +1597,7 @@
% \begin{macrocode}
\box_new:N \l_@@_tmpa_box
\tl_new:N \l_@@_tmpa_tl
+\tl_new:N \l_@@_tmpb_tl
\seq_new:N \l_@@_tmpa_seq
\int_new:N \l_@@_tmpa_int
\str_new:N \l_@@_tmpa_str
@@ -1939,6 +1951,7 @@
{
\@@_text_pdfstring:noN { #1 }{ \l_@@_text_enc_info_print_tl } #2
}
+\cs_generate_variant:Nn \@@_text_pdfstring_info:nN {eN,oN}
% \end{macrocode}
% \end{macro}
%
@@ -2188,7 +2201,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}
@@ -3945,16 +3958,20 @@
% but we allow to set an empty value.
% If the value begin with an optional argument, we assume a multilanguage clist and
% use only the first value.
+% The values are expanded with \cs{text_expand:n}
% \begin{macrocode}
\regex_new:N\l_@@_optlang_regex
\regex_set:Nn\l_@@_optlang_regex {\A\[([A-Za-z\-]+)\](.*)}
+\cs_generate_variant:Nn\clist_item:nn{on}
\cs_new_protected:Npn \@@_setup_info_key:nn #1 #2
{
\keys_define:nn { hyp }
{
pdf#1 .code:n =
{
- \tl_if_blank:nTF {##1}
+ \tl_set:Ne\l_@@_tmpa_tl {\text_expand:n{##1}}
+ \@@_store_metadata:no {pdf#1}{\l_@@_tmpa_tl}
+ \tl_if_empty:NTF \l_@@_tmpa_tl
{
\str_case:nnF { #1 }
{
@@ -3974,45 +3991,44 @@
}
}
{
- \tl_set:Ne\l_@@_tmpa_tl {\clist_item:nn{##1}{1}}
+ \tl_set:Ne\l_@@_tmpb_tl {\clist_item:on{\l_@@_tmpa_tl}{1}}
\exp_args:NNV
- \regex_extract_once:NnN \l_@@_optlang_regex \l_@@_tmpa_tl\l_@@_tmpa_seq
+ \regex_extract_once:NnN \l_@@_optlang_regex \l_@@_tmpb_tl\l_@@_tmpa_seq
\seq_if_empty:NTF\l_@@_tmpa_seq
{
- \@@_text_pdfstring_info:nN {##1}\l_@@_tmpa_str
+ \@@_text_pdfstring_info:oN {\l_@@_tmpa_tl}\l_@@_tmpa_str
}
- {
- \exp_args:Ne
- \@@_text_pdfstring_info:nN {\seq_item:Nn \l_@@_tmpa_seq{3}}\l_@@_tmpa_str
+ {
+ \@@_text_pdfstring_info:eN {\seq_item:Nn \l_@@_tmpa_seq{3}}\l_@@_tmpa_str
}
\str_if_eq:VnF\l_@@_tmpa_str{<FEFF>}
{
\pdfmanagement_add:nne {Info}{#2}{\l_@@_tmpa_str}
}
- }
- \@@_store_metadata:nn {pdf#1}{##1}
+ }
}
}
\keys_define:nn { hyp / info }
{
#2 .code:n =
{
+ \tl_set:Ne\l_@@_tmpa_tl {\text_expand:n{##1}}
+ \@@_store_metadata:eo {pdf\str_lowercase:n{#1}}{\l_@@_tmpa_tl}
\tl_if_blank:nTF {##1}
{
\pdfmanagement_remove:nn {Info}{#2}
}
{
- \@@_text_pdfstring_info:nN {##1}\l_@@_tmpa_str
+ \@@_text_pdfstring_info:oN {\l_@@_tmpa_tl}\l_@@_tmpa_str
\str_if_eq:VnF\l_@@_tmpa_str{<FEFF>}
{
\pdfmanagement_add:nne {Info}{#2}{\l_@@_tmpa_str}
}
- }
- \exp_args:Ne \@@_store_metadata:nn {pdf\str_lowercase:n{#1}}{##1}
+ }
}
,unknown .code:n =
- {
- \@@_text_pdfstring_info:nN {##1}\l_@@_tmpa_str
+ {
+ \@@_text_pdfstring_info:eN {##1}\l_@@_tmpa_str
\str_if_eq:VnF\l_@@_tmpa_str{<FEFF>}
{
\exp_args:Nno
@@ -5204,7 +5220,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..cf42a6e22c3 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.96m, released 2024-09-29}
%
% \maketitle
%
@@ -56,32 +56,32 @@
% \begin{macrocode}
%<drivers>\ProvidesExplFile
%<*dvipdfmx>
- {l3backend-testphase-dvipdfmx.def}{2024-05-23}{}
+ {l3backend-testphase-dvipdfmx.def}{2024-09-29}{}
{LaTeX~PDF~management~testphase~bundle~backend~support: dvipdfmx}
%</dvipdfmx>
%<*dvips>
- {l3backend-testphase-dvips.def}{2024-05-23}{}
+ {l3backend-testphase-dvips.def}{2024-09-29}{}
{LaTeX~PDF~management~testphase~bundle~backend~support: dvips}
%</dvips>
%<*dvisvgm>
- {l3backend-testphase-dvisvgm.def}{2024-05-23}{}
+ {l3backend-testphase-dvisvgm.def}{2024-09-29}{}
{LaTeX~PDF~management~testphase~bundle~backend~support: dvisvgm}
%</dvisvgm>
%<*luatex>
- {l3backend-testphase-luatex.def}{2024-05-23}{}
+ {l3backend-testphase-luatex.def}{2024-09-29}{}
{LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (LuaTeX)}
%</luatex>
%<*pdftex>
- {l3backend-testphase-pdftex.def}{2024-05-23}{}
+ {l3backend-testphase-pdftex.def}{2024-09-29}{}
{LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (pdfTeX)}
%</pdftex>
%<*xdvipdfmx>
- {l3backend-testphase-xetex.def}{2024-05-23}{}
+ {l3backend-testphase-xetex.def}{2024-09-29}{}
{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..83c96ff5f8a 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.96m, released 2024-09-29}
%
% \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-09-29}{0.96m}
{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..78a7b74bbbc 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.96m, released 2024-09-29}
%
% \maketitle
% \begin{documentation}
@@ -208,7 +208,7 @@
% \begin{macrocode}
%<@@=pdfdict>
%<*header>
-\ProvidesExplPackage{l3pdfdict}{2024-05-23}{0.96i}
+\ProvidesExplPackage{l3pdfdict}{2024-09-29}{0.96m}
{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..07c598c9a51 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.96m, released 2024-09-29}
%
% \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..bc66577913e 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.96m, released 2024-09-29}
%
% \maketitle
% \begin{documentation}
@@ -380,7 +380,7 @@
% checked.
% User appearances should have two versions and follow the naming
% module/\meta{name}/Yes and module/\meta{name}/Off.
-% \begin{macro}
+% \begin{macro}[int]
% {
% \@@_checkbox_default_appearances:,
% pdffield/checkbox/default/Yes,
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..609438b81a9 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.96m, released 2024-09-29}
%
% \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}
@@ -149,6 +152,14 @@
% \end{syntax}
% This allows to set default keys for a choice field.
% \end{function}
+
+% \begin{function}{type}
+% \begin{syntax}
+% |type| = \texttt{combo}\verb+|+\texttt{combo-edit}\verb+|+\texttt{list}
+% \end{syntax}
+% This key is a choice key that allows to set the three types.
+% \end{function}
+
%
% \begin{function}{name,T}
% \begin{syntax}
@@ -443,7 +454,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..ac3f39bc1d1 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.96m, released 2024-09-29}
%
% \maketitle
% \begin{documentation}
@@ -100,9 +100,9 @@
%^^A \group_end:%
% \bigskip
% \subsection{Commands}
-% \begin{function}{\pdffield_push:n}
+% \begin{function}{\pdffield_pushbutton:n}
% \begin{syntax}
-% \cs{pdffield_push:n}\Arg{key val list}
+% \cs{pdffield_pushbutton:n}\Arg{key val list}
% \end{syntax}
% This creates a pushbutton. Unlike radio buttons and checkboxes pushbuttons
% don't change their state and they don't store or represent a value.
@@ -422,7 +422,7 @@
% \subsection{Appearances}
% The default appearances are a rectangular frame with some text.
%
-% \begin{macro}
+% \begin{macro}[int]
% {
% \@@_pushbutton_default_appearances:,
% pdffield/pushbutton/default-n,
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..d8a3e52f96a 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.96m, released 2024-09-29}
%
% \maketitle
% \begin{documentation}
@@ -610,7 +610,7 @@
% Every appearance should have two versions and follow the naming
% module/\meta{name}/Yes and module/\meta{name}/Off.
%
-% \begin{macro}
+% \begin{macro}[int]
% {
% \@@_radio_default_appearances:,
% pdffield/radio/default/Yes,
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..3100f6efc47 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.96m, released 2024-09-29}
%
% \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..f26b603c8f3 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.96m, released 2024-09-29}
%
% \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-09-29}{0.96m}%
{form fields}
% \end{macrocode}
% \subsection{hyperref specific command}
@@ -2014,7 +2014,7 @@
% PV = pagevisible, PI = pageinvisible
% \begin{macro}
% {
-% AA/Fo,onfocus, AA/Bl,onblur, AA/D,onmousedown, AA/U,onmouseup,
+% AA/*,AA/Fo,onfocus, AA/Bl,onblur, AA/D,onmousedown, AA/U,onmouseup,
% AA/E,onenter, AA/X,onexit, AA/PO,pageopen, AA/PC,pageclose,
% AA/PV,pagevisible, AA/PI,pageinvisible
% }
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx
index 205dcfd7ba8..431b72ff24f 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.96m, released 2024-09-29}
%
% \maketitle
% \begin{documentation}
@@ -398,9 +398,9 @@
%
% \begin{macrocode}
%<*header>
-\ProvidesExplPackage{l3pdffile}{2024-05-23}{0.96i}
+\ProvidesExplPackage{l3pdffile}{2024-09-29}{0.96m}
{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..146c33cacdc 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.96m, released 2024-09-29}
%
% \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-09-29}{0.96m}
{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..2fa800134ca 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.96m, released 2024-09-29}
%
% \maketitle
% \begin{documentation}
@@ -190,6 +190,8 @@
% a test for at least the PDF-format will be added in future.
% \item[|Catalog_no_OCProperties|] don't add |/OCProperties| to the catalog
% {\em l3pdfmeta removes this entry at the end of the document}
+% \item[|Catalog_OCProperties_no_AS|]
+% do not use |/AS| optional content configuration dictionary.
% \item[|Catalog_EmbeddedFiles|] ensure that an |EmbeddedFiles| name tree is
% in the catalog. This is required for PDF/A-4f.
% \item[|annot_widget_no_AA|] (rule 6.6.2-1)
@@ -205,6 +207,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 +438,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.
@@ -588,7 +594,8 @@
% \begin{syntax}
% \cs{pdfmeta_xmp_xmlns_new:nn}\Arg{prefix}\Arg{uri}
% \end{syntax}
-% With this command a xmlns name space can be added.
+% With this command a xmlns name space can be added. The \meta{uri}
+% argument is expanded, a hash can be input with |\c_hash_str|.
% \end{function}
%
% With the two following commands PDF declarations can be added to the XMP metadata
@@ -600,7 +607,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}
%
@@ -618,6 +625,38 @@
% If \cs{pdfmeta_xmp_add_declaration:nnnnn} is used twice with the same \meta{uri}
% argument the |claimData| are concatenated. There is no check if the |claimData| are identical.
% \end{function}
+%
+% The following two commands can be used to extend the schema declarations in
+% the XMP metadata. This is for example needed to implement a standard like ZUGferd/Factur X
+% for invoices. A schema declaration should be added only once but as this task
+% is probably not needed frequently only light guards are there to avoid duplicated entries.
+%
+% \begin{function}{\pdfmeta_xmp_schema_new:nnn}
+% \begin{syntax}
+% \cs{pdfmeta_xmp_schema_new:nnn}\Arg{text}\Arg{prefix}\Arg{uri}
+% \end{syntax}
+% \meta{text} is some string describing the schema, e.g. |PDF/A~Identification~Schema|,
+% \meta{prefix} is the unique prefix used by the schema. This prefix
+% must be declared first with |\pdfmeta_xmp_xmlns_new:nn|. If a schema with this prefix
+% has already been declared, it will currently be ignored with a warning.
+% The \meta{uri} is expanded, so a
+% hash can for example be given as |\c_hash_str|.
+% \end{function}
+
+% \begin{function}{\pdfmeta_xmp_property_new:nnnnn}
+% \begin{syntax}
+% \cs{pdfmeta_xmp_property_new:nnnnn}\Arg{schema prefix}\Arg{name}\Arg{type}\Arg{category}\Arg{description}
+% \end{syntax}
+% If the new property already exists in the schema
+% (as identified by the combination of \meta{schema prefix}
+% and \meta{name} the property is silently ignore.
+% \meta{schema prefix} is the prefix declared with the previous command.
+% schema, e.g. |PDF/A~Identification~Schema|,
+% \meta{name} is a short string that identifies the property, e.g. |xmpMM| or |year|. It must be
+% unique in the properties of a schema. \meta{type} is e.g. |URI| or |Integer| or |Text|,
+% \meta{category} is e.g. |internal| or |external|, \meta{description} is a free description string.
+% \end{function}
+%
% \end{documentation}
%
% \begin{implementation}
@@ -627,7 +666,7 @@
% \begin{macrocode}
%<@@=pdfmeta>
%<*header>
-\ProvidesExplPackage{l3pdfmeta}{2024-05-23}{0.96i}
+\ProvidesExplPackage{l3pdfmeta}{2024-09-29}{0.96m}
{PDF-Standards---LaTeX PDF management testphase bundle}
%</header>
% \end{macrocode}
@@ -814,7 +853,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}
@@ -881,7 +922,10 @@
%
%===============
% Rule 6.1.13-1 CosDocument, isOptionalContentPresent == false
- ,Catalog_no_OCProperties =
+ ,Catalog_no_OCProperties =
+ % Rule 6.9-4 The AS key shall not appear in any optional content configuration dictionary.
+ % actually only starting with A-2 but doesn't harm here either
+ ,Catalog_OCProperties_no_AS=
%===============
% Rule 6.6.1-1: PDAction, S == "GoTo" || S == "GoToR" || S == "Thread"
% || S == "URI" || S == "Named" || S == "SubmitForm"
@@ -930,7 +974,14 @@
{ 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}{}
+% OCG layers are allowed (with restrictions)
+\prop_gremove:cn
+ { g_@@_standard_pdf/A-2B_prop }
+ { Catalog_no_OCProperties }
+
+ %A-2u ==============
\prop_new:c { g_@@_standard_pdf/A-2U_prop }
\prop_gset_eq:cc
{ g_@@_standard_pdf/A-2U_prop }
@@ -1015,7 +1066,8 @@
{ g_@@_standard_pdf/A-4_prop }{conformance}
\prop_gremove:cn
{ g_@@_standard_pdf/A-4_prop }{max_pdf_version}
-
+\prop_gremove:cn
+ { g_@@_standard_pdf/A-4_prop }{Catalog_OCProperties_no_AS}
%A-4f ==============
\prop_new:c { g_@@_standard_pdf/A-4F_prop }
\prop_gset_eq:cc
@@ -1177,7 +1229,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 +1382,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 +1406,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:,
@@ -1404,7 +1471,8 @@
% \end{macrocode}
% \subsection{Messages}
% \begin{macrocode}
-\msg_new:nnn{pdfmeta}{namespace-defined}{The~xmlns~namespace~`#1`~is~already~declared}
+\msg_new:nnn{pdfmeta}{xmp-defined}{The~XMP~#1~`#2`~is~already~declared}
+\msg_new:nnn{pdfmeta}{xmp-undefined}{The~XMP~#1~`#2`~is~undefined}
\msg_new:nnn{pdfmeta}{colorprofile-undefined}{The~colorprofile~`#1`~is~unknown}
% \end{macrocode}
% \subsection{Some helper commands}
@@ -1531,7 +1599,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 +1610,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
@@ -1936,7 +2004,7 @@
\prop_new:N \g_@@_xmp_xmlns_prop
% \end{macrocode}
% \end{variable}
-% \begin{macro}{\@@_xmp_xmlns_new:nn,\@@_xmp_xmlns_new:ne}
+% \begin{macro}{\@@_xmp_xmlns_new:nn}
% \begin{macrocode}
\cs_new_protected:Npn \@@_xmp_xmlns_new:nn #1 #2
{
@@ -1946,7 +2014,6 @@
\@@_xmp_indent:n{4} xmlns:\exp_not:n{#1="#2"}
}
}
-\cs_generate_variant:Nn \@@_xmp_xmlns_new:nn {ne}
% \end{macrocode}
% \end{macro}
% Now we fill the data. The list is more or less the same as in hyperxmp
@@ -1957,7 +2024,7 @@
\@@_xmp_xmlns_new:nn {photoshop}{http://ns.adobe.com/photoshop/1.0/}
\@@_xmp_xmlns_new:nn {xmp} {http://ns.adobe.com/xap/1.0/}
\@@_xmp_xmlns_new:nn {xmpMM} {http://ns.adobe.com/xap/1.0/mm/}
-\@@_xmp_xmlns_new:ne {stEvt}
+\@@_xmp_xmlns_new:nn {stEvt}
{http://ns.adobe.com/xap/1.0/sType/ResourceEvent\c_hash_str}
\@@_xmp_xmlns_new:nn {pdfaid} {http://www.aiim.org/pdfa/ns/id/}
\@@_xmp_xmlns_new:nn {pdfuaid} {http://www.aiim.org/pdfua/ns/id/}
@@ -1966,13 +2033,13 @@
\@@_xmp_xmlns_new:nn {prism} {http://prismstandard.org/namespaces/basic/3.0/}
%\@@_xmp_xmlns_new:nn {jav} {http://www.niso.org/schemas/jav/1.0/}
%\@@_xmp_xmlns_new:nn {xmpTPg} {http://ns.adobe.com/xap/1.0/t/pg/}
-\@@_xmp_xmlns_new:ne {stFnt} {http://ns.adobe.com/xap/1.0/sType/Font\c_hash_str}
+\@@_xmp_xmlns_new:nn {stFnt} {http://ns.adobe.com/xap/1.0/sType/Font\c_hash_str}
\@@_xmp_xmlns_new:nn {Iptc4xmpCore}{http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/}
\@@_xmp_xmlns_new:nn {pdfaExtension}{http://www.aiim.org/pdfa/ns/extension/}
-\@@_xmp_xmlns_new:ne {pdfaSchema}{http://www.aiim.org/pdfa/ns/schema\c_hash_str}
-\@@_xmp_xmlns_new:ne {pdfaProperty}{http://www.aiim.org/pdfa/ns/property\c_hash_str}
-\@@_xmp_xmlns_new:ne {pdfaType} {http://www.aiim.org/pdfa/ns/type\c_hash_str}
-\@@_xmp_xmlns_new:ne {pdfaField}{http://www.aiim.org/pdfa/ns/field\c_hash_str}
+\@@_xmp_xmlns_new:nn {pdfaSchema}{http://www.aiim.org/pdfa/ns/schema\c_hash_str}
+\@@_xmp_xmlns_new:nn {pdfaProperty}{http://www.aiim.org/pdfa/ns/property\c_hash_str}
+\@@_xmp_xmlns_new:nn {pdfaType} {http://www.aiim.org/pdfa/ns/type\c_hash_str}
+\@@_xmp_xmlns_new:nn {pdfaField}{http://www.aiim.org/pdfa/ns/field\c_hash_str}
% \end{macrocode}
% \subsection{Building the chunks: Extensions}
@@ -1999,42 +2066,61 @@
\cs_new_protected:Npn \@@_xmp_schema_new:nnn #1 #2 #3
%#1 name #2 prefix, #3 text
{
- \seq_put_right:Nn \l_@@_xmp_schema_seq { #2 }
- \tl_new:c { g_@@_xmp_schema_#2_tl }
- \tl_new:c { g_@@_xmp_schema_#2_properties_tl }
- \tl_gput_right:cn { g_@@_xmp_schema_#2_tl }
+ \tl_if_exist:cTF { g_@@_xmp_schema_#2_tl }
{
- \@@_xmp_add_packet_open_attr:nnn{rdf}{li}{rdf:parseType="Resource"}
- \@@_xmp_add_packet_line:nnn {pdfaSchema}{schema}{#1}
- \@@_xmp_add_packet_line:nnn {pdfaSchema}{prefix}{#2}
- \@@_xmp_add_packet_line:nnn {pdfaSchema}{namespaceURI}{#3}
- \@@_xmp_add_packet_open:nn {pdfaSchema}{property}
- \@@_xmp_add_packet_open:nn{rdf}{Seq}
- \tl_use:c { g_@@_xmp_schema_#2_properties_tl }
- \@@_xmp_add_packet_close:nn{rdf}{Seq}
- \@@_xmp_add_packet_close:nn {pdfaSchema}{property}
- \cs_if_exist_use:c {@@_xmp_schema_#2_additions:}
- \@@_xmp_add_packet_close:nn{rdf}{li}
+ \msg_warning:nnnn{pdfmeta}{xmp-defined}{schema}{#2}
}
+ {
+ \seq_put_right:Nn \l_@@_xmp_schema_seq { #2 }
+ \tl_new:c { g_@@_xmp_schema_#2_tl }
+ \tl_new:c { g_@@_xmp_schema_#2_properties_tl }
+ \tl_gput_right:cn { g_@@_xmp_schema_#2_tl }
+ {
+ \@@_xmp_add_packet_open_attr:nnn{rdf}{li}{rdf:parseType="Resource"}
+ \@@_xmp_add_packet_line:nnn {pdfaSchema}{schema}{#1}
+ \@@_xmp_add_packet_line:nnn {pdfaSchema}{prefix}{#2}
+ \@@_xmp_add_packet_line:nnn {pdfaSchema}{namespaceURI}{#3}
+ \@@_xmp_add_packet_open:nn {pdfaSchema}{property}
+ \@@_xmp_add_packet_open:nn{rdf}{Seq}
+ \tl_use:c { g_@@_xmp_schema_#2_properties_tl }
+ \@@_xmp_add_packet_close:nn{rdf}{Seq}
+ \@@_xmp_add_packet_close:nn {pdfaSchema}{property}
+ \cs_if_exist_use:c {@@_xmp_schema_#2_additions:}
+ \@@_xmp_add_packet_close:nn{rdf}{li}
+ }
+ }
}
% \end{macrocode}
% \end{macro}
-
-% \begin{macro}{\@@_xmp_property_new:nnn}
+%
+%
+%
+% \begin{macro}{\@@_xmp_property_new:nnnnn}
% This adds a property to a schema.
% \begin{macrocode}
+\prop_new:N\g_@@_xmp_schema_property_prop
\cs_new_protected:Npn \@@_xmp_property_new:nnnnn #1 #2 #3 #4 #5 %
%#1 schema #2 name, #3 type, #4 category #5 description
{
- \tl_gput_right:cn { g_@@_xmp_schema_#1_properties_tl }
+ \tl_if_exist:cTF { g_@@_xmp_schema_#1_properties_tl }
+ {
+ \prop_get:NeNF \g_@@_xmp_schema_property_prop {#1:#2}\l_@@_tmpa_tl
+ {
+ \prop_gput:Nee \g_@@_xmp_schema_property_prop {#1:#2}{#3}
+ \tl_gput_right:cn { g_@@_xmp_schema_#1_properties_tl }
+ {
+ \@@_xmp_add_packet_open:nn {rdf}{li~rdf:parseType="Resource"}
+ \@@_xmp_add_packet_line:nnn {pdfaProperty}{name}{#2}
+ \@@_xmp_add_packet_line:nnn {pdfaProperty}{valueType}{#3}
+ \@@_xmp_add_packet_line:nnn {pdfaProperty}{category}{#4}
+ \@@_xmp_add_packet_line:nnn {pdfaProperty}{description}{#5}
+ \@@_xmp_add_packet_close:nn{rdf}{li}
+ }
+ }
+ }
{
- \@@_xmp_add_packet_open:nn {rdf}{li~rdf:parseType="Resource"}
- \@@_xmp_add_packet_line:nnn {pdfaProperty}{name}{#2}
- \@@_xmp_add_packet_line:nnn {pdfaProperty}{valueType}{#3}
- \@@_xmp_add_packet_line:nnn {pdfaProperty}{category}{#4}
- \@@_xmp_add_packet_line:nnn {pdfaProperty}{description}{#5}
- \@@_xmp_add_packet_close:nn{rdf}{li}
- }
+ \msg_warning:nnnn{pdfmeta}{xmp-undefined}{schema}{#1}
+ }
}
% \end{macrocode}
% \end{macro}
@@ -2091,7 +2177,7 @@
% \item[pdfaid] properties part and conformance are declared by hyperxmp, but
% no here as already in http://www.aiim.org/pdfa/ns/id/. But we declare
% year so that it can be used also with older A-standards.
-% \begin{macro}{pdfaid~(schema)}
+% \begin{macro}[no-user-doc]{pdfaid~(schema)}
% \begin{macrocode}
\@@_xmp_schema_new:nnn
{PDF/A~Identification~Schema}
@@ -2103,11 +2189,17 @@
{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
% \enquote{part} and \enquote{rev}.
-% \begin{macro}{pdfuaid~(schema)}
+% \begin{macro}[no-user-doc]{pdfuaid~(schema)}
% \begin{macrocode}
\@@_xmp_schema_new:nnn
{PDF/UA~Universal~Accessibility~Schema}
@@ -2134,7 +2226,7 @@
%
% \item[pdfxid] we set this so that we
% can add the pdf/X version for pdf/X-4 and higher
-% \begin{macro}{pdfxid~(schema)}
+% \begin{macro}[no-user-doc]{pdfxid~(schema)}
% \begin{macrocode}
\@@_xmp_schema_new:nnn
{PDF/X~ID~Schema}
@@ -2150,7 +2242,7 @@
% \end{macro}
%\item[Prism]
-% \begin{macro}{prism~(schema)}
+% \begin{macro}[no-user-doc]{prism~(schema)}
% \begin{macrocode}
\@@_xmp_schema_new:nnn
{PRISM~Basic~Metadata}
@@ -2249,6 +2341,7 @@
% \end{macrocode}
% \end{macro}
% \item[iptc]
+% \begin{macro}[no-user-doc]{iptc (schema)}
% \begin{macrocode}
\@@_xmp_schema_new:nnn
{IPTC~Core~Schema}
@@ -2296,6 +2389,7 @@
\@@_xmp_add_packet_close:nn{pdfaSchema}{valueType}
}
% \end{macrocode}
+% \end{macro}
% \item[jav]: currently ignored
%
% \item[declarations] The PDF Declarations mechanism allows creation and
@@ -2304,7 +2398,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.)
%
@@ -2312,7 +2406,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_xmp_schema_enable_pdfd:
{
- \@@_xmp_xmlns_new:ne {pdfd}{http://pdfa.org/declarations/}
+ \@@_xmp_xmlns_new:nn {pdfd}{http://pdfa.org/declarations/}
\@@_xmp_schema_new:nnn
{PDF~Declarations~Schema}
{pdfd}
@@ -2382,8 +2476,8 @@
% \subsubsection{pdf}
% This builds pdf related the data with the (prefix \enquote{pdf}).
%
-% \begin{macro}{\@@_xmp_build_pdf:}
-% \begin{macro}{
+% \begin{macro}[int]{\@@_xmp_build_pdf:}
+% \begin{macro}[int]{
% Producer/pdfproducer,
% PDFversion}
% \begin{macrocode}
@@ -2411,8 +2505,8 @@
% \subsubsection{xmp}
% This builds the data with the (prefix \enquote{xmp}).
%
-% \begin{macro}{\@@_xmp_build_xmp:}
-% \begin{macro}{
+% \begin{macro}[int]{\@@_xmp_build_xmp:}
+% \begin{macro}[int]{
% CreatorTool/pdfcreator,
% BaseUrl/baseurl}
% \begin{macrocode}
@@ -2606,8 +2700,8 @@
%
% \subsection{Rest of dublin Core data}
%
-% \begin{macro}{\@@_xmp_build_dc:}
-% \begin{macro}{
+% \begin{macro}[int]{\@@_xmp_build_dc:}
+% \begin{macro}[int]{
% dc:creator/pdfauthor,
% dc:subject/pdfkeywords,
% dc:type/pdftype,
@@ -2786,8 +2880,8 @@
% \end{macro}
%
% \subsection{Prism}
-% \begin{macro}{\@@_xmp_build_prism:}
-% \begin{macro}
+% \begin{macro}[int]{\@@_xmp_build_prism:}
+% \begin{macro}[int]
% {
% complianceProfile,
% prism:subtitle/pdfsubtitle,
@@ -2932,11 +3026,22 @@
\cs_new_protected:Npn \pdfmeta_xmp_xmlns_new:nn #1 #2
{
\prop_if_in:NnTF \g_@@_xmp_xmlns_prop {#1}
- {\msg_warning:nnn{pdfmeta}{namespace-defined}{#1}}
+ {\msg_warning:nnnn{pdfmeta}{xmp-defined}{xmlns~namespace}{#1}}
{\@@_xmp_xmlns_new:nn {#1}{#2}}
}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\pdfmeta_xmp_schema_new:nnn}
+% \begin{macrocode}
+\cs_set_eq:NN \pdfmeta_xmp_schema_new:nnn \@@_xmp_schema_new:nnn
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pdfmeta_xmp_property_new:nnnnn}
+% \begin{macrocode}
+\cs_set_eq:NN \pdfmeta_xmp_property_new:nnnnn \@@_xmp_property_new:nnnnn
+% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\pdfmeta_xmp_add_declaration:n,\pdfmeta_xmp_add_declaration:e}
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx
index cc0f14d81b5..4d9e6d8c3f3 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.96m, released 2024-09-29}
%
% \maketitle
% \begin{documentation}
@@ -235,7 +235,7 @@
%
% \begin{macrocode}
%<*header>
-\ProvidesExplPackage{l3pdftools}{2024-05-23}{0.96i}
+\ProvidesExplPackage{l3pdftools}{2024-09-29}{0.96m}
{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..c7be91e4b29 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.96m, released 2024-09-29}
%
% \maketitle
% \begin{documentation}
@@ -132,7 +132,7 @@
% \begin{macrocode}
%<@@=pdf>
%<*header>
-\ProvidesExplPackage{l3pdfxform}{2024-05-23}{0.96i}
+\ProvidesExplPackage{l3pdfxform}{2024-09-29}{0.96m}
{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..9b5758abd47 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.96m, released 2024-09-29}
%
% \maketitle
% \begin{documentation}
@@ -197,11 +197,12 @@
% stream. The \meta{token list variable} is assigned locally.
% \end{function}
%
-% \begin{function}{\ShowDocumentProperties}
+% \begin{function}{\ShowDocumentProperties,\LogDocumentProperties}
% \begin{syntax}
-% \cs{ShowDocumentProperties}
+% \cs{ShowDocumentProperties}\\
+% \cs{LogDocumentProperties}
% \end{syntax}
-% This show the current content of the container.
+% This shows/logs the current content of the container.
% \end{function}
%
% \begin{thebibliography}{9}
@@ -220,7 +221,7 @@
% \begin{macrocode}
%<@@=pdfmanagement>
%<*header>
-\ProvidesExplPackage{ltdocinit}{2024-05-23}{0.96i}
+\ProvidesExplPackage{ltdocinit}{2024-09-29}{0.96m}
{Initialize document metadata}
%</header>
% \end{macrocode}
@@ -324,6 +325,13 @@
\prop_map_function:NN \g_@@_documentproperties_prop \msg_show_item:nn
}
}
+\NewDocumentCommand\LogDocumentProperties {}
+ {
+ \msg_log:nne {pdfmanagement}{show-properties}
+ {
+ \prop_map_function:NN \g_@@_documentproperties_prop \msg_show_item:nn
+ }
+ }
% \end{macrocode}
% \end{macro}
% \begin{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..8e0b8eff42e 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.96m, released 2024-09-29}
%
% \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-09-29}{0.96m}
{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..327acd613e4 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.96m, released 2024-09-29}
%
% \maketitle
% \begin{documentation}
@@ -394,7 +394,7 @@
% \begin{macrocode}
%<@@=pdf>
%<*package>
-\ProvidesExplPackage{pdfmanagement-testphase}{2024-05-23}{0.96i}
+\ProvidesExplPackage{pdfmanagement-testphase}{2024-09-29}{0.96m}
{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-09-29}{0.96m}
{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/pdfpages/pdfpages.dtx b/Master/texmf-dist/source/latex/pdfpages/pdfpages.dtx
index 5b41ae68c4f..ca9ccd8b462 100644
--- a/Master/texmf-dist/source/latex/pdfpages/pdfpages.dtx
+++ b/Master/texmf-dist/source/latex/pdfpages/pdfpages.dtx
@@ -27,12 +27,12 @@
%<*dtx>
\makeatletter
%</dtx>
-\def\AM@fileversion{v0.6a}
+\def\AM@fileversion{v0.6b}
\def\AM@Git@Date@process$#1: #2 #3${\AM@Git@Date@process@i#2\END}
\def\AM@Git@Date@process@i#1-#2-#3\END{\def\AM@Git@Date{#1/#2/#3}}
\def\AM@Git@SHA@process$#1: #2${\def\AM@Git@SHA{#2}}
-\AM@Git@Date@process$Date: 2024-05-29 13:40:24 +0200 $
-\AM@Git@SHA@process$SHA-1: 8248eea896cba74c6d712bddc3e4ae8d4c403081 $
+\AM@Git@Date@process$Date: 2024-08-20 15:16:01 +0200 $
+\AM@Git@SHA@process$SHA-1: 8cc873330fc0863d9d32e017e64c98d9f04f579d $
%</!(example1,example2,example3,installer)>
%
%
@@ -3838,10 +3838,10 @@
% \begin{macrocode}
\def\AM@getpagecount{%
\expandafter\filename@parse\expandafter{\AM@currentdocname}%
- \edef\type@ext{%
- \noexpand\lowercase{%
- \noexpand\def\noexpand\type@ext{.\filename@ext}}}%
- \type@ext
+ \begingroup\edef\x{%
+ \lowercase{\endgroup
+ \def\noexpand\type@ext{\expandafter\scantokens\expandafter{\filename@ext\noexpand}}}}%
+ \x
\ifx\type@ext\AM@pdf@ext
\ifdefined\subfix
\let\AM@import@path\@empty
@@ -3859,7 +3859,7 @@
\def\AM@pagecount{1}%
\fi
}
-\def\AM@pdf@ext{.pdf}
+\def\AM@pdf@ext{pdf}
% \end{macrocode}
% |\XeTeXversion| has changed from time to time: 0.997, 0.997-dev,
% 0.998.1
@@ -4902,6 +4902,11 @@
% with |subfiles.sty|.
% \end{itemize}
%
+% \subsection*{2024/08/20 v0.6b}
+% \begin{itemize}
+% \item Make |\includepdf[pages=-]{\detokenize{file.pdf}}| work in xelatex.
+% \end{itemize}
+%
% \Finale
%
% \iffalse
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
deleted file mode 100644
index 09cac66703d..00000000000
--- a/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx
+++ /dev/null
@@ -1,30710 +0,0 @@
-%\iffalse
-% polyglossia.dtx generated using mkpolyglossiadtx.pl
-% (derived from makedtx.pl version 1.49 (c) Nicola Talbot)
-%
-% To extract the files, use xetex polyglossia.dtx or luatex polyglossia.dtx
-%
-%<*internal>
-\iffalse
-%</internal>
-%<*README>
-# THE POLYGLOSSIA PACKAGE v2.1
-## Multilingual typesetting with XeLaTeX and LuaLaTeX
-
-This package provides an alternative to Babel for users of XeLaTeX and LuaLaTeX.
-This version includes support for over 80 different languages, some of which in
-different regional or national varieties, or using a different writing system.
-
-Polyglossia makes it possible to automate the following tasks:
-
-* Loading the appropriate hyphenation patterns.
-* Setting the script and language tags of the current font (if possible and
- available), using the package fontspec.
-* Switching to a font assigned by the user to a particular script or language.
-* Adjusting some typographical conventions in function of the current language
- (such as afterindent, frenchindent, spaces before or after punctuation marks,
- etc.).
-* Redefining the document strings (like “chapter”, “figure”, “bibliography”).
-* Adapting the formatting of dates (for non-gregorian calendars via external
- packages bundled with polyglossia: currently the Hebrew, Islamic and Farsi
- calendars are supported).
-* For languages that have their own numeration system, modifying the formatting
- of numbers appropriately.
-* Ensuring the proper directionality if the document contains languages
- written from right to left (via the packages bidi and luabidi, available
- separately).
-
-# LICENCE
-
-Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2024 Arthur Reutenauer,
-Copyright (c) 2019-2023 Bastien Roucariès, 2019-2024 Jürgen Spitzmüller, 2023-2024 Udi Fogiel
-
-Except where otherwise noted, Polyglossia is placed under the terms of the MIT licence
-(https://opensource.org/licenses/MIT).
-
-# BUGS
-
-If you run into a bug, or suspect you do, or you have a request or comment, please
-use the GitHub issue tracker: http://github.com/reutenauer/polyglossia/issues
-
-This is more efficient than contacting the maintainer by email as it allows us
-to track the issues and follow progress.
-%</README>
-%<*internal>
-\fi
-%</internal>
-%
-%<*internal>
-\begingroup
-%</internal>
-%<*batchfile>
-\input docstrip.tex
-\keepsilent
-\let\MetaPrefix\relax
-\preamble
- ____________________________
-
- The polyglossia package
- (C) 2008–2010 François Charette
- (C) 2011–2024 Arthur Reutenauer
- (C) 2013 Elie Roux
- (C) 2019 Bastien Roucariès
- (C) 2019–2024 Jürgen Spitzmüller
- License information appended
-
-
-\endpreamble
-\postamble
-
- Copyright (C) 2024 by Arthur Reutenauer <arthur 'dot' reutenauer 'at' normalesup 'dot' org>
-
- 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'.
-
- The Current Maintainer of this work is Arthur Reutenauer.
-
-
-\endpostamble
-\let\MetaPrefix\DoubleperCent
-\askforoverwritefalse
-\generate{\file{polyglossia.sty}{\from{polyglossia.dtx}{polyglossia.sty}}}
-\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-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}}}
-\generate{\file{polyglossia-tibt.lua}{\from{polyglossia.dtx}{polyglossia-tibt.lua}}}
-\generate{\file{polyglossia.lua}{\from{polyglossia.dtx}{polyglossia.lua}}}
-\generate{\file{babel-hebrewalph.def}{\from{polyglossia.dtx}{babel-hebrewalph.def}}}
-\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-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}}}
-\generate{\file{gloss-afrikaans.ldf}{\from{polyglossia.dtx}{gloss-afrikaans.ldf}}}
-\generate{\file{gloss-albanian.ldf}{\from{polyglossia.dtx}{gloss-albanian.ldf}}}
-\generate{\file{gloss-am.ldf}{\from{polyglossia.dtx}{gloss-am.ldf}}}
-\generate{\file{gloss-american.ldf}{\from{polyglossia.dtx}{gloss-american.ldf}}}
-\generate{\file{gloss-amharic.ldf}{\from{polyglossia.dtx}{gloss-amharic.ldf}}}
-\generate{\file{gloss-apd.ldf}{\from{polyglossia.dtx}{gloss-apd.ldf}}}
-\generate{\file{gloss-ar-IQ.ldf}{\from{polyglossia.dtx}{gloss-ar-IQ.ldf}}}
-\generate{\file{gloss-ar-JO.ldf}{\from{polyglossia.dtx}{gloss-ar-JO.ldf}}}
-\generate{\file{gloss-ar-LB.ldf}{\from{polyglossia.dtx}{gloss-ar-LB.ldf}}}
-\generate{\file{gloss-ar-MR.ldf}{\from{polyglossia.dtx}{gloss-ar-MR.ldf}}}
-\generate{\file{gloss-ar-PS.ldf}{\from{polyglossia.dtx}{gloss-ar-PS.ldf}}}
-\generate{\file{gloss-ar-SY.ldf}{\from{polyglossia.dtx}{gloss-ar-SY.ldf}}}
-\generate{\file{gloss-ar-YE.ldf}{\from{polyglossia.dtx}{gloss-ar-YE.ldf}}}
-\generate{\file{gloss-ar.ldf}{\from{polyglossia.dtx}{gloss-ar.ldf}}}
-\generate{\file{gloss-arabic.ldf}{\from{polyglossia.dtx}{gloss-arabic.ldf}}}
-\generate{\file{gloss-armenian.ldf}{\from{polyglossia.dtx}{gloss-armenian.ldf}}}
-\generate{\file{gloss-arq.ldf}{\from{polyglossia.dtx}{gloss-arq.ldf}}}
-\generate{\file{gloss-ary.ldf}{\from{polyglossia.dtx}{gloss-ary.ldf}}}
-\generate{\file{gloss-arz.ldf}{\from{polyglossia.dtx}{gloss-arz.ldf}}}
-\generate{\file{gloss-ast.ldf}{\from{polyglossia.dtx}{gloss-ast.ldf}}}
-\generate{\file{gloss-asturian.ldf}{\from{polyglossia.dtx}{gloss-asturian.ldf}}}
-\generate{\file{gloss-australian.ldf}{\from{polyglossia.dtx}{gloss-australian.ldf}}}
-\generate{\file{gloss-austrian.ldf}{\from{polyglossia.dtx}{gloss-austrian.ldf}}}
-\generate{\file{gloss-ayl.ldf}{\from{polyglossia.dtx}{gloss-ayl.ldf}}}
-\generate{\file{gloss-bahasa.ldf}{\from{polyglossia.dtx}{gloss-bahasa.ldf}}}
-\generate{\file{gloss-bahasai.ldf}{\from{polyglossia.dtx}{gloss-bahasai.ldf}}}
-\generate{\file{gloss-bahasam.ldf}{\from{polyglossia.dtx}{gloss-bahasam.ldf}}}
-\generate{\file{gloss-basque.ldf}{\from{polyglossia.dtx}{gloss-basque.ldf}}}
-\generate{\file{gloss-be-tarask.ldf}{\from{polyglossia.dtx}{gloss-be-tarask.ldf}}}
-\generate{\file{gloss-be.ldf}{\from{polyglossia.dtx}{gloss-be.ldf}}}
-\generate{\file{gloss-belarusian.ldf}{\from{polyglossia.dtx}{gloss-belarusian.ldf}}}
-\generate{\file{gloss-bengali.ldf}{\from{polyglossia.dtx}{gloss-bengali.ldf}}}
-\generate{\file{gloss-bg.ldf}{\from{polyglossia.dtx}{gloss-bg.ldf}}}
-\generate{\file{gloss-bn.ldf}{\from{polyglossia.dtx}{gloss-bn.ldf}}}
-\generate{\file{gloss-bo.ldf}{\from{polyglossia.dtx}{gloss-bo.ldf}}}
-\generate{\file{gloss-bosnian.ldf}{\from{polyglossia.dtx}{gloss-bosnian.ldf}}}
-\generate{\file{gloss-br.ldf}{\from{polyglossia.dtx}{gloss-br.ldf}}}
-\generate{\file{gloss-brazil.ldf}{\from{polyglossia.dtx}{gloss-brazil.ldf}}}
-\generate{\file{gloss-breton.ldf}{\from{polyglossia.dtx}{gloss-breton.ldf}}}
-\generate{\file{gloss-british.ldf}{\from{polyglossia.dtx}{gloss-british.ldf}}}
-\generate{\file{gloss-bs.ldf}{\from{polyglossia.dtx}{gloss-bs.ldf}}}
-\generate{\file{gloss-bulgarian.ldf}{\from{polyglossia.dtx}{gloss-bulgarian.ldf}}}
-\generate{\file{gloss-ca.ldf}{\from{polyglossia.dtx}{gloss-ca.ldf}}}
-\generate{\file{gloss-canadian.ldf}{\from{polyglossia.dtx}{gloss-canadian.ldf}}}
-\generate{\file{gloss-canadien.ldf}{\from{polyglossia.dtx}{gloss-canadien.ldf}}}
-\generate{\file{gloss-catalan.ldf}{\from{polyglossia.dtx}{gloss-catalan.ldf}}}
-\generate{\file{gloss-chinese.ldf}{\from{polyglossia.dtx}{gloss-chinese.ldf}}}
-\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-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}}}
-\generate{\file{gloss-cy.ldf}{\from{polyglossia.dtx}{gloss-cy.ldf}}}
-\generate{\file{gloss-cz.ldf}{\from{polyglossia.dtx}{gloss-cz.ldf}}}
-\generate{\file{gloss-czech.ldf}{\from{polyglossia.dtx}{gloss-czech.ldf}}}
-\generate{\file{gloss-da.ldf}{\from{polyglossia.dtx}{gloss-da.ldf}}}
-\generate{\file{gloss-danish.ldf}{\from{polyglossia.dtx}{gloss-danish.ldf}}}
-\generate{\file{gloss-de-AT-1901.ldf}{\from{polyglossia.dtx}{gloss-de-AT-1901.ldf}}}
-\generate{\file{gloss-de-AT-1996.ldf}{\from{polyglossia.dtx}{gloss-de-AT-1996.ldf}}}
-\generate{\file{gloss-de-AT.ldf}{\from{polyglossia.dtx}{gloss-de-AT.ldf}}}
-\generate{\file{gloss-de-CH-1901.ldf}{\from{polyglossia.dtx}{gloss-de-CH-1901.ldf}}}
-\generate{\file{gloss-de-CH-1996.ldf}{\from{polyglossia.dtx}{gloss-de-CH-1996.ldf}}}
-\generate{\file{gloss-de-CH.ldf}{\from{polyglossia.dtx}{gloss-de-CH.ldf}}}
-\generate{\file{gloss-de-DE-1901.ldf}{\from{polyglossia.dtx}{gloss-de-DE-1901.ldf}}}
-\generate{\file{gloss-de-DE-1996.ldf}{\from{polyglossia.dtx}{gloss-de-DE-1996.ldf}}}
-\generate{\file{gloss-de-DE.ldf}{\from{polyglossia.dtx}{gloss-de-DE.ldf}}}
-\generate{\file{gloss-de-Latf-AT-1901.ldf}{\from{polyglossia.dtx}{gloss-de-Latf-AT-1901.ldf}}}
-\generate{\file{gloss-de-Latf-AT-1996.ldf}{\from{polyglossia.dtx}{gloss-de-Latf-AT-1996.ldf}}}
-\generate{\file{gloss-de-Latf-AT.ldf}{\from{polyglossia.dtx}{gloss-de-Latf-AT.ldf}}}
-\generate{\file{gloss-de-Latf-CH-1901.ldf}{\from{polyglossia.dtx}{gloss-de-Latf-CH-1901.ldf}}}
-\generate{\file{gloss-de-Latf-CH-1996.ldf}{\from{polyglossia.dtx}{gloss-de-Latf-CH-1996.ldf}}}
-\generate{\file{gloss-de-Latf-CH.ldf}{\from{polyglossia.dtx}{gloss-de-Latf-CH.ldf}}}
-\generate{\file{gloss-de-Latf-DE-1901.ldf}{\from{polyglossia.dtx}{gloss-de-Latf-DE-1901.ldf}}}
-\generate{\file{gloss-de-Latf-DE-1996.ldf}{\from{polyglossia.dtx}{gloss-de-Latf-DE-1996.ldf}}}
-\generate{\file{gloss-de-Latf-DE.ldf}{\from{polyglossia.dtx}{gloss-de-Latf-DE.ldf}}}
-\generate{\file{gloss-de-Latf.ldf}{\from{polyglossia.dtx}{gloss-de-Latf.ldf}}}
-\generate{\file{gloss-de.ldf}{\from{polyglossia.dtx}{gloss-de.ldf}}}
-\generate{\file{gloss-divehi.ldf}{\from{polyglossia.dtx}{gloss-divehi.ldf}}}
-\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-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}}}
-\generate{\file{gloss-en-AU.ldf}{\from{polyglossia.dtx}{gloss-en-AU.ldf}}}
-\generate{\file{gloss-en-CA.ldf}{\from{polyglossia.dtx}{gloss-en-CA.ldf}}}
-\generate{\file{gloss-en-GB.ldf}{\from{polyglossia.dtx}{gloss-en-GB.ldf}}}
-\generate{\file{gloss-en-NZ.ldf}{\from{polyglossia.dtx}{gloss-en-NZ.ldf}}}
-\generate{\file{gloss-en-US.ldf}{\from{polyglossia.dtx}{gloss-en-US.ldf}}}
-\generate{\file{gloss-en.ldf}{\from{polyglossia.dtx}{gloss-en.ldf}}}
-\generate{\file{gloss-english.ldf}{\from{polyglossia.dtx}{gloss-english.ldf}}}
-\generate{\file{gloss-eo.ldf}{\from{polyglossia.dtx}{gloss-eo.ldf}}}
-\generate{\file{gloss-es-ES.ldf}{\from{polyglossia.dtx}{gloss-es-ES.ldf}}}
-\generate{\file{gloss-es-MX.ldf}{\from{polyglossia.dtx}{gloss-es-MX.ldf}}}
-\generate{\file{gloss-es.ldf}{\from{polyglossia.dtx}{gloss-es.ldf}}}
-\generate{\file{gloss-esperanto.ldf}{\from{polyglossia.dtx}{gloss-esperanto.ldf}}}
-\generate{\file{gloss-estonian.ldf}{\from{polyglossia.dtx}{gloss-estonian.ldf}}}
-\generate{\file{gloss-et.ldf}{\from{polyglossia.dtx}{gloss-et.ldf}}}
-\generate{\file{gloss-eu.ldf}{\from{polyglossia.dtx}{gloss-eu.ldf}}}
-\generate{\file{gloss-fa.ldf}{\from{polyglossia.dtx}{gloss-fa.ldf}}}
-\generate{\file{gloss-farsi.ldf}{\from{polyglossia.dtx}{gloss-farsi.ldf}}}
-\generate{\file{gloss-fi.ldf}{\from{polyglossia.dtx}{gloss-fi.ldf}}}
-\generate{\file{gloss-finnish.ldf}{\from{polyglossia.dtx}{gloss-finnish.ldf}}}
-\generate{\file{gloss-fr-CA-u-sd-canb.ldf}{\from{polyglossia.dtx}{gloss-fr-CA-u-sd-canb.ldf}}}
-\generate{\file{gloss-fr-CA.ldf}{\from{polyglossia.dtx}{gloss-fr-CA.ldf}}}
-\generate{\file{gloss-fr-CH.ldf}{\from{polyglossia.dtx}{gloss-fr-CH.ldf}}}
-\generate{\file{gloss-fr-FR.ldf}{\from{polyglossia.dtx}{gloss-fr-FR.ldf}}}
-\generate{\file{gloss-fr.ldf}{\from{polyglossia.dtx}{gloss-fr.ldf}}}
-\generate{\file{gloss-french.ldf}{\from{polyglossia.dtx}{gloss-french.ldf}}}
-\generate{\file{gloss-friulan.ldf}{\from{polyglossia.dtx}{gloss-friulan.ldf}}}
-\generate{\file{gloss-friulian.ldf}{\from{polyglossia.dtx}{gloss-friulian.ldf}}}
-\generate{\file{gloss-fur.ldf}{\from{polyglossia.dtx}{gloss-fur.ldf}}}
-\generate{\file{gloss-ga.ldf}{\from{polyglossia.dtx}{gloss-ga.ldf}}}
-\generate{\file{gloss-gaelic.ldf}{\from{polyglossia.dtx}{gloss-gaelic.ldf}}}
-\generate{\file{gloss-galician.ldf}{\from{polyglossia.dtx}{gloss-galician.ldf}}}
-\generate{\file{gloss-gd.ldf}{\from{polyglossia.dtx}{gloss-gd.ldf}}}
-\generate{\file{gloss-georgian.ldf}{\from{polyglossia.dtx}{gloss-georgian.ldf}}}
-\generate{\file{gloss-german.ldf}{\from{polyglossia.dtx}{gloss-german.ldf}}}
-\generate{\file{gloss-germanb.ldf}{\from{polyglossia.dtx}{gloss-germanb.ldf}}}
-\generate{\file{gloss-gl.ldf}{\from{polyglossia.dtx}{gloss-gl.ldf}}}
-\generate{\file{gloss-grc.ldf}{\from{polyglossia.dtx}{gloss-grc.ldf}}}
-\generate{\file{gloss-greek.ldf}{\from{polyglossia.dtx}{gloss-greek.ldf}}}
-\generate{\file{gloss-he.ldf}{\from{polyglossia.dtx}{gloss-he.ldf}}}
-\generate{\file{gloss-hebrew.ldf}{\from{polyglossia.dtx}{gloss-hebrew.ldf}}}
-\generate{\file{gloss-hi.ldf}{\from{polyglossia.dtx}{gloss-hi.ldf}}}
-\generate{\file{gloss-hindi.ldf}{\from{polyglossia.dtx}{gloss-hindi.ldf}}}
-\generate{\file{gloss-hr.ldf}{\from{polyglossia.dtx}{gloss-hr.ldf}}}
-\generate{\file{gloss-hsb.ldf}{\from{polyglossia.dtx}{gloss-hsb.ldf}}}
-\generate{\file{gloss-hu.ldf}{\from{polyglossia.dtx}{gloss-hu.ldf}}}
-\generate{\file{gloss-hungarian.ldf}{\from{polyglossia.dtx}{gloss-hungarian.ldf}}}
-\generate{\file{gloss-hy.ldf}{\from{polyglossia.dtx}{gloss-hy.ldf}}}
-\generate{\file{gloss-ia.ldf}{\from{polyglossia.dtx}{gloss-ia.ldf}}}
-\generate{\file{gloss-icelandic.ldf}{\from{polyglossia.dtx}{gloss-icelandic.ldf}}}
-\generate{\file{gloss-id.ldf}{\from{polyglossia.dtx}{gloss-id.ldf}}}
-\generate{\file{gloss-interlingua.ldf}{\from{polyglossia.dtx}{gloss-interlingua.ldf}}}
-\generate{\file{gloss-irish.ldf}{\from{polyglossia.dtx}{gloss-irish.ldf}}}
-\generate{\file{gloss-is.ldf}{\from{polyglossia.dtx}{gloss-is.ldf}}}
-\generate{\file{gloss-it.ldf}{\from{polyglossia.dtx}{gloss-it.ldf}}}
-\generate{\file{gloss-italian.ldf}{\from{polyglossia.dtx}{gloss-italian.ldf}}}
-\generate{\file{gloss-ja.ldf}{\from{polyglossia.dtx}{gloss-ja.ldf}}}
-\generate{\file{gloss-japanese.ldf}{\from{polyglossia.dtx}{gloss-japanese.ldf}}}
-\generate{\file{gloss-ka.ldf}{\from{polyglossia.dtx}{gloss-ka.ldf}}}
-\generate{\file{gloss-kannada.ldf}{\from{polyglossia.dtx}{gloss-kannada.ldf}}}
-\generate{\file{gloss-khmer.ldf}{\from{polyglossia.dtx}{gloss-khmer.ldf}}}
-\generate{\file{gloss-km.ldf}{\from{polyglossia.dtx}{gloss-km.ldf}}}
-\generate{\file{gloss-kmr-Arab.ldf}{\from{polyglossia.dtx}{gloss-kmr-Arab.ldf}}}
-\generate{\file{gloss-kmr-Latn.ldf}{\from{polyglossia.dtx}{gloss-kmr-Latn.ldf}}}
-\generate{\file{gloss-kmr.ldf}{\from{polyglossia.dtx}{gloss-kmr.ldf}}}
-\generate{\file{gloss-kn.ldf}{\from{polyglossia.dtx}{gloss-kn.ldf}}}
-\generate{\file{gloss-ko.ldf}{\from{polyglossia.dtx}{gloss-ko.ldf}}}
-\generate{\file{gloss-korean.ldf}{\from{polyglossia.dtx}{gloss-korean.ldf}}}
-\generate{\file{gloss-ku-Arab.ldf}{\from{polyglossia.dtx}{gloss-ku-Arab.ldf}}}
-\generate{\file{gloss-ku-Latn.ldf}{\from{polyglossia.dtx}{gloss-ku-Latn.ldf}}}
-\generate{\file{gloss-ku.ldf}{\from{polyglossia.dtx}{gloss-ku.ldf}}}
-\generate{\file{gloss-kurdish.ldf}{\from{polyglossia.dtx}{gloss-kurdish.ldf}}}
-\generate{\file{gloss-kurmanji.ldf}{\from{polyglossia.dtx}{gloss-kurmanji.ldf}}}
-\generate{\file{gloss-la-x-classic.ldf}{\from{polyglossia.dtx}{gloss-la-x-classic.ldf}}}
-\generate{\file{gloss-la-x-ecclesia.ldf}{\from{polyglossia.dtx}{gloss-la-x-ecclesia.ldf}}}
-\generate{\file{gloss-la-x-medieval.ldf}{\from{polyglossia.dtx}{gloss-la-x-medieval.ldf}}}
-\generate{\file{gloss-la.ldf}{\from{polyglossia.dtx}{gloss-la.ldf}}}
-\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}}}
-\generate{\file{gloss-lowersorbian.ldf}{\from{polyglossia.dtx}{gloss-lowersorbian.ldf}}}
-\generate{\file{gloss-lsorbian.ldf}{\from{polyglossia.dtx}{gloss-lsorbian.ldf}}}
-\generate{\file{gloss-lt.ldf}{\from{polyglossia.dtx}{gloss-lt.ldf}}}
-\generate{\file{gloss-lv.ldf}{\from{polyglossia.dtx}{gloss-lv.ldf}}}
-\generate{\file{gloss-macedonian.ldf}{\from{polyglossia.dtx}{gloss-macedonian.ldf}}}
-\generate{\file{gloss-magyar.ldf}{\from{polyglossia.dtx}{gloss-magyar.ldf}}}
-\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-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}}}
-\generate{\file{gloss-mongolian.ldf}{\from{polyglossia.dtx}{gloss-mongolian.ldf}}}
-\generate{\file{gloss-mr.ldf}{\from{polyglossia.dtx}{gloss-mr.ldf}}}
-\generate{\file{gloss-naustrian.ldf}{\from{polyglossia.dtx}{gloss-naustrian.ldf}}}
-\generate{\file{gloss-nb.ldf}{\from{polyglossia.dtx}{gloss-nb.ldf}}}
-\generate{\file{gloss-newzealand.ldf}{\from{polyglossia.dtx}{gloss-newzealand.ldf}}}
-\generate{\file{gloss-ngerman.ldf}{\from{polyglossia.dtx}{gloss-ngerman.ldf}}}
-\generate{\file{gloss-nko.ldf}{\from{polyglossia.dtx}{gloss-nko.ldf}}}
-\generate{\file{gloss-norsk.ldf}{\from{polyglossia.dtx}{gloss-norsk.ldf}}}
-\generate{\file{gloss-norwegian.ldf}{\from{polyglossia.dtx}{gloss-norwegian.ldf}}}
-\generate{\file{gloss-nswissgerman.ldf}{\from{polyglossia.dtx}{gloss-nswissgerman.ldf}}}
-\generate{\file{gloss-nynorsk.ldf}{\from{polyglossia.dtx}{gloss-nynorsk.ldf}}}
-\generate{\file{gloss-occitan.ldf}{\from{polyglossia.dtx}{gloss-occitan.ldf}}}
-\generate{\file{gloss-odia.ldf}{\from{polyglossia.dtx}{gloss-odia.ldf}}}
-\generate{\file{gloss-or.ldf}{\from{polyglossia.dtx}{gloss-or.ldf}}}
-\generate{\file{gloss-pa.ldf}{\from{polyglossia.dtx}{gloss-pa.ldf}}}
-\generate{\file{gloss-persian.ldf}{\from{polyglossia.dtx}{gloss-persian.ldf}}}
-\generate{\file{gloss-piedmontese.ldf}{\from{polyglossia.dtx}{gloss-piedmontese.ldf}}}
-\generate{\file{gloss-polish.ldf}{\from{polyglossia.dtx}{gloss-polish.ldf}}}
-\generate{\file{gloss-polutonikogreek.ldf}{\from{polyglossia.dtx}{gloss-polutonikogreek.ldf}}}
-\generate{\file{gloss-portuges.ldf}{\from{polyglossia.dtx}{gloss-portuges.ldf}}}
-\generate{\file{gloss-portuguese.ldf}{\from{polyglossia.dtx}{gloss-portuguese.ldf}}}
-\generate{\file{gloss-punjabi.ldf}{\from{polyglossia.dtx}{gloss-punjabi.ldf}}}
-\generate{\file{gloss-romanian.ldf}{\from{polyglossia.dtx}{gloss-romanian.ldf}}}
-\generate{\file{gloss-romansh.ldf}{\from{polyglossia.dtx}{gloss-romansh.ldf}}}
-\generate{\file{gloss-russian.ldf}{\from{polyglossia.dtx}{gloss-russian.ldf}}}
-\generate{\file{gloss-sami.ldf}{\from{polyglossia.dtx}{gloss-sami.ldf}}}
-\generate{\file{gloss-samin.ldf}{\from{polyglossia.dtx}{gloss-samin.ldf}}}
-\generate{\file{gloss-sanskrit.ldf}{\from{polyglossia.dtx}{gloss-sanskrit.ldf}}}
-\generate{\file{gloss-scottish.ldf}{\from{polyglossia.dtx}{gloss-scottish.ldf}}}
-\generate{\file{gloss-serbian.ldf}{\from{polyglossia.dtx}{gloss-serbian.ldf}}}
-\generate{\file{gloss-serbianc.ldf}{\from{polyglossia.dtx}{gloss-serbianc.ldf}}}
-\generate{\file{gloss-slovak.ldf}{\from{polyglossia.dtx}{gloss-slovak.ldf}}}
-\generate{\file{gloss-slovene.ldf}{\from{polyglossia.dtx}{gloss-slovene.ldf}}}
-\generate{\file{gloss-slovenian.ldf}{\from{polyglossia.dtx}{gloss-slovenian.ldf}}}
-\generate{\file{gloss-sorbian.ldf}{\from{polyglossia.dtx}{gloss-sorbian.ldf}}}
-\generate{\file{gloss-spanish.ldf}{\from{polyglossia.dtx}{gloss-spanish.ldf}}}
-\generate{\file{gloss-spanishmx.ldf}{\from{polyglossia.dtx}{gloss-spanishmx.ldf}}}
-\generate{\file{gloss-swedish.ldf}{\from{polyglossia.dtx}{gloss-swedish.ldf}}}
-\generate{\file{gloss-swissgerman.ldf}{\from{polyglossia.dtx}{gloss-swissgerman.ldf}}}
-\generate{\file{gloss-syriac.ldf}{\from{polyglossia.dtx}{gloss-syriac.ldf}}}
-\generate{\file{gloss-tamil.ldf}{\from{polyglossia.dtx}{gloss-tamil.ldf}}}
-\generate{\file{gloss-telugu.ldf}{\from{polyglossia.dtx}{gloss-telugu.ldf}}}
-\generate{\file{gloss-thai.ldf}{\from{polyglossia.dtx}{gloss-thai.ldf}}}
-\generate{\file{gloss-tibetan.ldf}{\from{polyglossia.dtx}{gloss-tibetan.ldf}}}
-\generate{\file{gloss-turkish.ldf}{\from{polyglossia.dtx}{gloss-turkish.ldf}}}
-\generate{\file{gloss-turkmen.ldf}{\from{polyglossia.dtx}{gloss-turkmen.ldf}}}
-\generate{\file{gloss-ug.ldf}{\from{polyglossia.dtx}{gloss-ug.ldf}}}
-\generate{\file{gloss-ukrainian.ldf}{\from{polyglossia.dtx}{gloss-ukrainian.ldf}}}
-\generate{\file{gloss-uppersorbian.ldf}{\from{polyglossia.dtx}{gloss-uppersorbian.ldf}}}
-\generate{\file{gloss-urdu.ldf}{\from{polyglossia.dtx}{gloss-urdu.ldf}}}
-\generate{\file{gloss-usorbian.ldf}{\from{polyglossia.dtx}{gloss-usorbian.ldf}}}
-\generate{\file{gloss-uyghur.ldf}{\from{polyglossia.dtx}{gloss-uyghur.ldf}}}
-\generate{\file{gloss-vietnamese.ldf}{\from{polyglossia.dtx}{gloss-vietnamese.ldf}}}
-\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-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}}}
-\generate{\file{polyglossia-tibt.lua}{\from{polyglossia.dtx}{polyglossia-tibt.lua}}}
-\generate{\file{polyglossia.lua}{\from{polyglossia.dtx}{polyglossia.lua}}}
-\let\MetaPrefix\DoubleperCent
-%</batchfile>
-%<batchfile>\endbatchfile
-%<*internal>
-\generate{\file{polyglossia.ins}{\from{polyglossia.dtx}{batchfile}}}
-\nopreamble\nopostamble
-\generate{\file{examples.tex}{\from{polyglossia.dtx}{examples.tex}}}
-\generate{\file{example-arabic.tex}{\from{polyglossia.dtx}{example-arabic.tex}}}
-\generate{\file{example-thai.tex}{\from{polyglossia.dtx}{example-thai.tex}}}
-\generate{\file{README.md}{\from{polyglossia.dtx}{README}}}
-\endgroup
-%</internal>
-%
-%<*driver>
-% !TeX spellcheck = en_US
-% !TeX TS-program = xelatex
-\documentclass[11pt,nohyperref]{ltxdoc}
-\usepackage{xcolor}
-\usepackage{xspace,fancyvrb,longtable,booktabs}
-\usepackage[neverdecrease]{paralist}
-\usepackage[format=hang,labelfont=bf,labelsep=period]{caption}
-\definecolor{xpgblue}{rgb}{0.02,0.04,0.48}
-\definecolor{lightblue}{rgb}{0.61,.8,.8}
-\definecolor{xpgred}{rgb}{0.65,0.04,0.07}
-\usepackage[
- unicode=true,
- bookmarks=true,
- colorlinks=true,
- linkcolor=xpgblue,
- urlcolor=xpgblue,
- citecolor=xpgblue,
- hyperindex=false,
- hyperfootnotes=false,
- pdftitle={Polyglossia: Modern multilingual typesetting with XeLaTeX and LuaLaTeX},
- pdfauthor={F Charette, A Reutenauer, U Fogiel, B Roucariès, J Spitzmüller},
- pdfkeywords={xetex, xelatex, luatex, lualatex, multilingual, babel, hyphenation}
- ]{hyperref}
-\usepackage{array}
-\usepackage{metalogo}
-\let\XeTeX\undefined
-\let\XeLaTeX\undefined
-\usepackage[babelshorthands]{polyglossia}
-\usepackage{farsical}
-%
-% Languages we need in the documentation. See below for fonts
-\setmainlanguage[variant=british,ordinalmonthday=false]{english}
-\setotherlanguages{arabic,armenian,hebrew,syriac,greek,russian,serbian,catalan,georgian,chinese}
-\usepackage[protrusion,nopatch=footnote]{microtype}
-\renewcommand\MacroFont{\footnotesize\color{xpgblue}\ttfamily}
-% Customizable version of \DescribeMacro (e.g. if macro is too long)
-\newcommand*\DescribeMacroCust[2]{%
- \let\origMacroFont\MacroFont%
- \renewcommand\MacroFont{\footnotesize\color{xpgblue}\ttfamily#1}%
- \DescribeMacro{#2}%
- \let\MacroFont\origMacroFont%
-}
-\newcommand*\Cmd[1]{\cmd{#1}\DescribeMacro{#1}\xspace}
-\newcommand*\pkg[1]{\textsf{\color{xpgblue}#1}}
-\newcommand*\file[1]{\texttt{\color{xpgblue}#1}}
-\newcommand*\TR[1]{\textcolor{xpgred}{#1}}
-\newcommand*\TX[1]{\hyperref[#1]{\textcolor{xpgred}{#1}}}
-\newcommand*\TA[1]{\textsc{\color{xpgblue}#1}}
-\newcommand*\link[1]{\href{#1}{#1}}
-\renewcommand*\meta[1]{\texttt{⟨#1⟩}}
-\newcommand*\TXI[1]{\href{https://github.com/reutenauer/polyglossia/issues/#1}{\textcolor{xpgred}{\##1}}}
-\newcommand*\TXP[1]{\href{https://github.com/reutenauer/polyglossia/pull/#1}{\textcolor{xpgred}{\##1}}}
-\def\eg{\textit{e.g.,}\xspace}
-\def\ie{\textit{i.e.,}\xspace}
-\def\ca{\textit{ca.}\@\xspace}
-\def\Eg{\textit{E.g.,}\xspace}
-\def\Ie{\textit{I.e.,}\xspace}
-\def\etc{\@ifnextchar.{\textit{etc}}{\textit{etc.}\@\xspace}}
-
-%
-%% Commands for documenting options
-%
-\newcommand*\xpgoption[1]{\textcolor{xpgblue}{\ttfamily\bfseries #1}}
-\newcommand*\xpgvalue[1]{\texttt{#1}}
-\newcommand*\xpgpresetvalue[1]{\texttt{\textit{#1}}}
-\newcommand*\xpgdefaultvalue[1]{\texttt{*#1}}
-
-% arguments: #1 version number, #2 key name, #3 footnote, #4 possible values
-\NewDocumentCommand\xpgchoicekey{omom}{%
- \xpgoption{#2}\IfValueT{#3}{\footnote{#3}}%
- \IfValueT{#1}{\new{#1}} \xpgvalue{=} #4\par%
-}
-
-% arguments: #1 version number, #2 key name, #3 footnote
-\NewDocumentCommand\xpgboolkey{omo}{\xpgchoicekey[#1]{#2}[#3]{\xpgdefaultvalue{true} or \xpgvalue{false}}}
-\NewDocumentCommand\xpgboolkeytrue{omo}{\xpgchoicekey[#1]{#2}[#3]{\xpgdefaultvalue{\xpgpresetvalue{true}} or \xpgvalue{false}}}
-\NewDocumentCommand\xpgboolkeyfalse{omo}{\xpgchoicekey[#1]{#2}[#3]{\xpgdefaultvalue{true} or \xpgpresetvalue{false}}}
-
-% arguments: #1 version number, #2 key name, #3 default code
-\NewDocumentCommand\xpgcodekey{omv}{%
- \xpgoption{#2}\IfValueT{#1}{\new{#1}}
- \xpgvalue{=} \meta{code} (default value: \texttt{#3})\par%
-}
-
-% arguments: #1 version number, #2 key name, #3 value type, #4 default value
-\NewDocumentCommand\xpgoptkey{ommo}{%
- \xpgoption{#2}\IfValueT{#1}{\new{#1}}
- \xpgvalue{=} \meta{#3} (default value: \texttt{#4})\par%
-}
-
-%% Sidenotes << copied from fontspec.dtx
-\newcommand\new[1]{%
- \edef\thisversion{v#1}%
- \ifhmode\unskip~\fi{\ifx\thisversion\fileversion\color{blue}\else\color[gray]{0.5}\fi
- $\leftarrow$}%
- \marginpar{\centering
- \small\ifx\thisversion\fileversion\color{blue}\else\color[gray]{0.5}\fi
- \textsf{v#1}}}
-\newcommand\displaycmd[2]{%
- \\\DescribeMacro{#2}\centerline{\cmd{#1}}}
-\renewenvironment{itemize}{\begin{compactitem}[\char"2023]}%[{\fontspec{DejaVu Sans}\char"25BB}]}%
- {\end{compactitem}}
-\renewenvironment{enumerate}{\begin{compactenum}}{\end{compactenum}}
-\newenvironment{shorthands}{%
- \begin{list}{}%
- {\settowidth{\labelwidth}{MM}%
- \setlength{\leftmargin}{\labelwidth}%
- \addtolength{\leftmargin}{\labelsep}%
- \renewcommand{\makelabel}[1]{##1\hfil}}}%
- {\end{list}}
-
-% This is to prevent page breaks too short after subsections
-\def\condbreak#1{%
- \vskip 0pt plus #1\pagebreak[3]\vskip 0pt plus -#1\relax}
-\pretocmd{\subsection}{\condbreak{2\baselineskip}}{}{}
-
-%
-% Fonts
-% We try to use fonts that are shipped with TeXLive
-% (see #478)
-%
-%% fontspec declarations:
-% Main font: Package libertine (Linux Libertine and Biolinum Mono)
-\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 dejavu-otf
-\newfontfamily\armenianfont[Script=Armenian,Scale=MatchLowercase]{DejaVuSans}
-\newfontfamily\georgianfont[Scale=MatchLowercase]{DejaVuSerif}
-% Package amiri
-\newfontfamily\arabicfont[Script=Arabic]{Amiri-Regular}
-% 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
-% https://bethmardutho.org/meltho/ (Meltho Fonts Package)
-\newfontfamily\syriacfont[Script=Syriac]{Serto Jerusalem}
-% Our decorative title: package gfscomplutum
-\newfontfamily\xpgtitlefont[Scale=1.4, LetterSpace=30]{GFSPolyglot.otf}
-% Package noto, notoCJKsc
-\newfontfamily\chinesefont{Noto Serif CJK SC}[Script=CJK]
-
-\linespread{1.05}
-\frenchspacing
-\EnableCrossrefs
-\CodelineIndex
-\RecordChanges
-% COMMENT THE NEXT LINE TO INCLUDE THE CODE
-\AtBeginDocument{\OnlyDescription}
-
-
-\begin{document}
-\ifxetex
- \DocInput{polyglossia.dtx}
-\fi
-\end{document}
-%</driver>
-%
-% \fi
-%
-% \errorcontextlines=999
-% \makeatletter
-%
-% \hyphenation{Kha-li-ghi Reu-ten-auer new-zea-land}
-% \GetFileInfo{polyglossia.sty}
-%
-% \title{{\textgreek{\xpgtitlefont\color{lightblue}\MakeUppercase{Πολυγλωσσία}}}
-% \\[16pt]
-% \color{xpgblue}Polyglossia: Modern multilingual typesetting with \XeLaTeX\ and \LuaLaTeX}
-% \author{\TA{François Charette} \and \TA{Arthur Reutenauer}\thanks{Current maintainer}
-% \and \TA{Udi Fogiel} \and \TA{Bastien Roucariès} \and \TA{Jürgen Spitzmüller}}
-% \date{\filedate \qquad \fileversion\thanks{Please report bugs to \url{http://github.com/reutenauer/polyglossia/issues}}\\
-% \footnotesize (\textsc{pdf} file generated on \today)}
-%
-% \maketitle
-% \tableofcontents
-%
-% \condbreak{4\baselineskip}
-%
-%
-% \DeleteShortVerb{\|}
-% \MakeShortVerb{\¦}
-%
-% ^^A\begin{abstract}
-% ^^ABlablabla
-% ^^A\end{abstract}
-%
-%
-% \section{Introduction}
-%
-% \pkg{Polyglossia} is a package for facilitating multilingual typesetting with
-% \XeLaTeX\ and \LuaLaTeX. Basically, it
-% can be used as an alternative to \pkg{babel} for performing the following
-% tasks automatically:
-%
-% \begin{enumerate}
-% \item Loading the appropriate hyphenation patterns.
-% \item Setting the script and language tags of the current font (if possible and
-% available), via the package \pkg{fontspec}.
-% \item Switching to a font assigned by the user to a particular script or language.
-% \item Adjusting some typographical conventions according to the current language
-% (such as afterindent, frenchindent, spaces before or after punctuation marks,
-% etc.).
-% \item Redefining all document strings (like “chapter”, “figure”, “bibliography”).
-% \item Adapting the formatting of dates (for non-Gregorian calendars via external
-% packages bundled with polyglossia: currently the Hebrew, Islamic and Farsi
-% calendars are supported).
-% \item For languages that have their own numbering system, modifying the formatting
-% of numbers appropriately (this also includes redefining the alphabetic sequence
-% for non-Latin alphabets).\footnote{%
-% This is done by bundled sub-packages such as \pkg{arabicnumbers}.}
-% \item Ensuring proper directionality if the document contains languages
-% that are written from right to left (via the package \pkg{bidi},
-% available separately).
-% \end{enumerate}
-% ^^A
-% Several features of \pkg{babel} that do not make sense in the \XeTeX\ world (like font
-% encodings, shorthands, etc.) are not supported.
-% Generally speaking, \pkg{polyglossia} aims to remain as compatible as possible
-% with the fundamental features of \pkg{babel} while being cleaner, light-weight,
-% and modern. The package \pkg{antomega} has been very beneficial in our attempt to
-% reach this objective.
-%
-% \paragraph{Requirements} The current version of \pkg{polyglossia} makes use of some convenient
-% macros defined in the \pkg{etoolbox} package by \TA{Philipp Lehmann} and \TA{Joseph Wright}.
-% Being designed for \XeLaTeX\ and \LuaLaTeX, it obviously also relies on \pkg{fontspec} by
-% \TA{Will Robertson}. For languages written from right to left, it needs the package \pkg{bidi}
-% (for \XeTeX) or \pkg{luabidi} (for \LuaTeX) by \TA{Vafa Khalighi} (\textarabic{وفا خليقي}) and
-% the \pkg{bidi-tex GitHub Organisation}.
-% Polyglossia also bundles three packages for calendaric computations (\pkg{hebrewcal},
-% \pkg{hijrical}, and \pkg{farsical}).
-%
-%
-% \section{Setting up multilingual documents}
-%
-% \subsection{Activating languages}
-%
-% The default language of a document is specified by means of the command
-% \displaycmd{\setdefaultlanguage\oarg{options}\marg{lang}}{\setdefaultlanguage}
-% (or, equivalently, \Cmd\setmainlanguage).
-% Secondary languages are specified with
-% \displaycmd{\setotherlanguage\oarg{options}\marg{lang}.}{\setotherlanguage}
-% All these commands allow you to set language-specific options.\footnote{%
-% Section~\ref{specific} documents these options for the respective languages.}
-% It is also possible to load a series of secondary languages at once (but without options)
-% using
-% \displaycmd{\setotherlanguages\marg{lang1⟩,⟨lang2⟩,⟨lang3⟩,⟨…}.}{\setotherlanguages}
-% ^^A
-% All language-specific options can be modified locally by means of the
-% language-switching commands described in section \ref{languageswitching}.
-%
-% \paragraph{Note} In general, it is advisable to activate the languages \emph{after} all
-% packages have been loaded. This is particularly important if you use right-to-left scripts
-% or languages with babel shorthands.
-%
-%
-% \subsection{Supported languages}
-%
-% Table~\ref{tab:lang} lists all languages currently supported.
-% Those in \TR{red} have specific options and/or commands
-% that are explained in section \ref{specific} below.
-%
-% \begin{table}[ht]\centering
-% \caption{\label{tab:lang}Languages currently supported in \pkg{polyglossia}}
-% ^^A Produced with tools/insert-language-list.rb -- JS, 2023-11-06
-% \begin{tabular}{lllll}
-% \toprule
-% \TX{afrikaans} & danish & icelandic & nko & \TX{sorbian}\\
-% albanian & divehi & interlingua & \TX{norwegian} & \TX{spanish}\\
-% amharic & \TX{dutch} & \TX{italian} & occitan & swedish \\
-% \TX{arabic} & \TX{english} & japanese & \TX{odia} & \TX{syriac}\\
-% \TX{armenian} & \TX{esperanto} & kannada & \TX{persian} & tamil \\
-% asturian & estonian & khmer & piedmontese & telugu \\
-% basque & \TX{finnish} & \TX{korean} & \TX{polish} & \TX{thai} \\
-% \TX{belarusian} & \TX{french} & \TX{kurdish} & \TX{portuguese} & \TX{tibetan}\\
-% \TX{bengali} & friulian & \TX{lao} & \TX{punjabi} & turkish \\
-% bosnian & \TX{gaelic} & \TX{latin} & romanian & turkmen \\
-% breton & galician & latvian & romansh & \TX{ukrainian}\\
-% bulgarian & \TX{georgian} & lithuanian & \TX{russian} & \TX{urdu} \\
-% \TX{catalan} & \TX{german} & macedonian & \TX{sami} & \TX{uyghur}\\
-% \TX{chinese} & \TX{greek} & \TX{malay} & \TX{sanskrit} & vietnamese\\
-% coptic & \TX{hebrew} & malayalam & \TX{serbian} & \TX{welsh}\\
-% \TX{croatian} & \TX{hindi} & \TX{marathi} & \TX{slovak} & \\
-% \TX{czech} & \TX{hungarian} & \TX{mongolian} & \TX{slovenian} & \\
-% \bottomrule
-% \end{tabular}
-%
-% \end{table}
-%
-% \paragraph{Version Notes} The support for Amharic\new{1.0.1} should be considered an experimental attempt to
-% port the package \pkg{ethiop}; feedback is welcome.
-% Version 1.1.1\new{1.1.1} added support for Asturian, %\footnote{ Provided by Kevin Godby and Xuacu Saturio.},
-% Lithuanian, %\footnote{ Provided by Kevin Godby and Paulius Sladkevičius.},
-% and Urdu. %\footnote{ Provided by Kamal Abdali.}
-% ^^A
-% Version 1.2\new{1.2.0} introduced Armenian, Occitan, Bengali,
-% Lao, Malayalam, Marathi, Tamil, Telugu, and Turkmen.\footnote{%
-% See acknowledgements at the end for due credit to the various contributors.}
-% Version 1.43\new{1.43} brought basic support for Japanese (this
-% is considered experimental, feedback is appreciated).
-% In version 1.45\new{1.45}, support for Kurdish and Mongolian as well as some new
-% variants (Canadian French and English) have been added. Furthermore, for consistency reasons, some language have
-% been renamed (\emph{farsi}\textrightarrow\emph{persian}, \emph{friulan}\textrightarrow\emph{friulian},
-% \emph{magyar}\textrightarrow\emph{hungarian}, \emph{portuges}\textrightarrow\emph{portuguese},
-% \emph{samin}\textrightarrow\emph{sami}) or merged (\emph{bahasai}\slash\emph{bahasam}\textrightarrow\emph{malay},
-% \emph{brazil}\slash\emph{portuges}\textrightarrow\emph{portuguese},
-% \emph{lsorbian}\slash\emph{usorbian}\textrightarrow\emph{sorbian},
-% \emph{irish}\slash\emph{scottish}\textrightarrow\emph{gaelic},
-% \emph{norsk}\slash\emph{nynorsk}\textrightarrow\emph{norwegian}). The old names are still supported for backwards
-% compatibility reasons.
-% Version 1.46\new{1.46} introduces support for Afrikaans, Belarusian, Bosnian and Georgian.
-% Version 1.52\new{1.52} introduces support for Uyghur.
-% Version 1.59\new{1.59} adds support for (simplified and traditional) Chinese and for Punjabi.
-% Version 1.66\new{1.66} introduces support for Odia.
-%
-%
-% \subsection{Relation to and use of Babel language names}\label{sec:babelnames}
-%
-% If you are familiar with the \pkg{babel} package, you will note that \pkg{polyglossia}'s language naming
-% slightly differs. Whereas \pkg{babel} has a unique name for each language variety (\eg\emph{american} and \emph{british}),
-% \pkg{polyglossia} differentiates language varieties via language options (\eg \emph{english}, ¦variant=american¦).
-%
-% Furthermore, \pkg{babel} sometimes uses abbreviated language names (\eg\emph{bahasam} for Bahasa Malayu) as well
-% as endonyms, \ie language names coming from the designated languages (such as \emph{bahasa}, \emph{canadien} or \emph{magyar}).
-% As opposed to this, \pkg{polyglossia} always uses spelled-out (lower-cased) English language names.
-% Please refer to table~\ref{tab:bbllang} for the differing language names in both packages.
-%
-% \begin{table}
-% \caption{\label{tab:bbllang}Babel-polyglossia language name matching}
-%
-% \begin{minipage}[t]{1\columnwidth}
-% \small\centering
-% \begin{tabular}{lll}
-% \toprule
-% \textbf{Babel name} & \textbf{Polyglossia name} & \textbf{Polyglossia options}\tabularnewline
-% \midrule
-% acadian & french & variant=acadian \\
-% american & english & variant=american [\emph{default}] \\
-% australian & english & variant=australian \\
-% austrian & german & variant=austrian, spelling=old \\
-% bahasa & malay & variant=indonesian [\emph{default}] \\
-% bahasam & malay & variant=malaysian \\
-% brazil & portuguese & variant=brazilian \\
-% british & english & variant=british \\
-% canadian & english & variant=canadian \\
-% canadien & french & variant=canadian \\
-% classiclatin & latin & variant=classic \\
-% farsi & persian & \\
-% ecclesiasticlatin & latin & variant=ecclesiastic \\
-% friulan & friulian & \\
-% german\footnote{Due to the name conflict only available in \pkg{polyglossia} as \emph{germanb} (which is a \pkg{babel} synonym).}
-% & german & spelling=old \\
-% irish & gaelic & variant=irish [\emph{default}] \\
-% kurmanji & kurdish & variant=kurmanji \\
-% lowersorbian & sorbian & variant=lower \\
-% magyar & hungarian & \\
-% medievallatin & latin & variant=medieval \\
-% naustrian & german & variant=austrian \\
-% newzealand & english & variant=newzealand \\
-% ngerman & german & variant=german [\emph{default}] \\
-% norsk & norwegian & variant=bokmal \\
-% nswissgerman & german & variant=swiss \\
-% nynorsk & norwegian & variant=nynorsk [\emph{default}] \\
-% polutonikogreek & greek & variant=polytonic \\
-% portuges & portuguese & variant=portuguese [\emph{default}] \\
-% samin & sami & \\
-% scottish & gaelic & variant=scottish \\
-% serbianc & serbian & script=Cyrillic \\
-% slovene & slovenian & \\
-% spanishmx & spanish & variant=mexican \\
-% swissgerman & german & variant=swiss, spelling=old \\
-% uppersorbian & sorbian & variant=upper [\emph{default}] \\
-% \bottomrule
-% \end{tabular}
-% \end{minipage}
-%
-% \end{table}
-%
-% For convenience reasons, \pkg{polyglossia} also supports the use of babel names\new{1.46} (for the few justified
-% exceptions, please refer to the notes in table~\ref{tab:bbllang}).
-% The babel names listed in table~\ref{tab:bbllang} can be used instead of the corresponding polyglossia
-% name\slash options in \cmd\setdefaultlanguage\ and \cmd\setotherlanguage\ as well as in the \pkg{polyglossia} and
-% \pkg{babel} language switching commands\slash environments documented in section~\ref{sec:langcmds} and
-% \ref{sec:babelcmds} (\eg \cmd\textaustrian\ is synonymous to ¦\textgerman[variant=austrian,spelling=old]¦).
-% However, unless you have special reasons, we strongly encourage you to use the \pkg{polyglossia} names.
-%
-%
-% \subsection{Using IETF language tags}\label{sec:langtags}
-%
-% \pkg{Polyglossia}\new{1.47} also supports the use of language tags that conform to the IETF BCP-47
-% \emph{Best Current Practice}.\footnote{Please refer to \url{https://tools.ietf.org/html/bcp47} and
-% \url{https://en.wikipedia.org/wiki/IETF_language_tag} for details.}
-% Thus, you can use tags such as ¦en-GB¦ (for British English) or ¦de-AT-1901¦ (for Austrian German, old spelling)
-% in \cmd\setdefaultlanguage\ and \cmd\setotherlanguage\ as well as in the language switching command
-% \cmd{\textlang\marg{tag}}, the environment \cmd{\begin\{lang\}\marg{tag}} \ldots\ \cmd{\end\{lang\}} and the \pkg{babel}
-% language switching commands\slash environments documented in section~\ref{sec:babelcmds}.
-% Table~\ref{tab:BCP47-polyglossia} lists the currently supported tags.
-%
-% \bgroup\small\addfontfeatures{Numbers={Monospaced,Lining}}
-% \begin{longtable}[c]{ll>{\raggedright}p{6cm}}
-% \caption{\label{tab:BCP47-polyglossia}BCP47-polyglossia language name matching}\tabularnewline
-% \toprule
-% \textbf{BCP-47 tag} & \textbf{Polyglossia name} & \textbf{Polyglossia options}\tabularnewline
-% \midrule
-% \endfirsthead
-% \caption[]{BCP47-polyglossia language name matching (\emph{continued})}\tabularnewline
-% \toprule
-% \textbf{BCP-47 tag} & \textbf{Polyglossia name} & \textbf{Polyglossia options}\tabularnewline
-% \midrule
-% \endhead
-% aeb & arabic & locale=tunisia \tabularnewline
-% af & afrikaans & \tabularnewline
-% afb & arabic & locale=default \tabularnewline
-% am & amharic & \tabularnewline
-% apd & arabic & locale=default \tabularnewline
-% ar & arabic & \tabularnewline
-% ar-IQ & arabic & locale=mashriq \tabularnewline
-% ar-JO & arabic & locale=mashriq \tabularnewline
-% ar-LB & arabic & locale=mashriq \tabularnewline
-% ar-MR & arabic & locale=mauritania \tabularnewline
-% ar-PS & arabic & locale=mashriq \tabularnewline
-% ar-SY & arabic & locale=mashriq \tabularnewline
-% ar-YE & arabic & locale=default \tabularnewline
-% arq & arabic & locale=algeria \tabularnewline
-% ary & arabic & locale=morocco \tabularnewline
-% arz & arabic & locale=default \tabularnewline
-% ast & asturian & \tabularnewline
-% ayl & arabic & locale=libya \tabularnewline
-% be & belarusian & \tabularnewline
-% be-tarask & belarusian & spelling=classic \tabularnewline
-% bg & bulgarian & \tabularnewline
-% bn & bengali & \tabularnewline
-% bo & tibetan & \tabularnewline
-% br & breton & \tabularnewline
-% bs & bosnian & \tabularnewline
-% ca & catalan & \tabularnewline
-% ckb & kurdish & variant=sorani [\emph{default}] \tabularnewline
-% ckb-Arab & kurdish & variant=sorani, script=Arabic [\emph{default}] \tabularnewline
-% ckb-Latn & kurdish & variant=sorani, script=Latin \tabularnewline
-% cop & coptic & \tabularnewline
-% cy & welsh & \tabularnewline
-% cz & czech & \tabularnewline
-% da & danish & \tabularnewline
-% de & german & \tabularnewline
-% de-AT & german & variant=austrian, spelling=new \tabularnewline
-% de-AT-1901 & german & variant=austrian, spelling=old \tabularnewline
-% de-AT-1996 & german & variant=austrian, spelling=new \tabularnewline
-% de-CH & german & variant=swiss, spelling=new \tabularnewline
-% de-CH-1901 & german & variant=swiss, spelling=old \tabularnewline
-% de-CH-1996 & german & variant=swiss, spelling=new \tabularnewline
-% de-DE & german & variant=german, spelling=new \tabularnewline
-% de-DE-1901 & german & variant=german, spelling=old \tabularnewline
-% de-DE-1996 & german & variant=german, spelling=new [\emph{default}] \tabularnewline
-% de-Latf & german & script=blackletter \tabularnewline
-% de-Latf-AT & german & variant=austrian, spelling=new, script=blackletter \tabularnewline
-% de-Latf-AT-1901 & german & variant=austrian, spelling=old, script=blackletter \tabularnewline
-% de-Latf-AT-1996 & german & variant=austrian, spelling=new, script=blackletter \tabularnewline
-% de-Latf-CH & german & variant=swiss, spelling=new, script=blackletter \tabularnewline
-% de-Latf-CH-1901 & german & variant=swiss, spelling=old, script=blackletter \tabularnewline
-% de-Latf-CH-1996 & german & variant=swiss, spelling=new, script=blackletter \tabularnewline
-% de-Latf-DE & german & variant=german, spelling=new, script=blackletter \tabularnewline
-% de-Latf-DE-1901 & german & variant=german, spelling=old, script=blackletter \tabularnewline
-% de-Latf-DE-1996 & german & variant=german, spelling=new, script=blackletter \tabularnewline
-% dsb & sorbian & variant=lower \tabularnewline
-% dv & divehi & \tabularnewline
-% el & greek & \tabularnewline
-% el-monoton & greek & variant=monotonic [\emph{default}] \tabularnewline
-% el-polyton & greek & varant=polytonic \tabularnewline
-% en & english & \tabularnewline
-% en-AU & english & variant=australian \tabularnewline
-% en-CA & english & variant=canadian \tabularnewline
-% en-GB & english & variant=british \tabularnewline
-% en-NZ & english & variant=newzealand \tabularnewline
-% en-US & english & variant=us [\emph{default}] \tabularnewline
-% eo & esperanto & \tabularnewline
-% es & spanish & \tabularnewline
-% es-ES & spanish & variant=spanish [\emph{default}] \tabularnewline
-% es-MX & spanish & variant=mexican \tabularnewline
-% et & estonian & \tabularnewline
-% eu & basque & \tabularnewline
-% fa & persian & \tabularnewline
-% fi & finnish & \tabularnewline
-% fr & french & \tabularnewline
-% fr-CA & french & variant=canadian \tabularnewline
-% fr-CA-u-sd-canb & french & variant=acadian \tabularnewline
-% fr-CH & french & variant=swiss \tabularnewline
-% fr-FR & french & variant=french [\emph{default}] \tabularnewline
-% fur & friulian & \tabularnewline
-% ga & gaelic & variant=irish [\emph{default}] \tabularnewline
-% gd & gaelic & variant=scottish \tabularnewline
-% gl & galician & \tabularnewline
-% grc & greek & variant=ancient \tabularnewline
-% he & hebrew & \tabularnewline
-% hi & hindi & \tabularnewline
-% hr & croatian & \tabularnewline
-% hsb & sorbian & variant=upper [\emph{default}] \tabularnewline
-% hu & hungarian & \tabularnewline
-% hy & armenian & \tabularnewline
-% ia & interlingua & \tabularnewline
-% id & malay & variant=indonesian \tabularnewline
-% is & icelandic & \tabularnewline
-% it & italian & \tabularnewline
-% ja & japanese & \tabularnewline
-% ka & georgian & \tabularnewline
-% km & khmer & \tabularnewline
-% kmr & kurdish & variant=kurmanji \tabularnewline
-% kmr-Arab & kurdish & variant=kurmanji, script=Arabic \tabularnewline
-% kmr-Latn & kurdish & variant=kurmanji, script=Latin \tabularnewline
-% kn & kannada & \tabularnewline
-% ko & korean & \tabularnewline
-% ku & kurdish & \tabularnewline
-% ku-Arab & kurdish & script=Arabic \tabularnewline
-% ku-Latn & kurdish & script=Latin \tabularnewline
-% la & latin & \tabularnewline
-% la-x-classic & latin & variant=classic \tabularnewline
-% la-x-ecclesia & latin & variant=ecclesiastic \tabularnewline
-% la-x-medieval & latin & variant=medieval \tabularnewline
-% lo & lao & \tabularnewline
-% lt & lithuanian & \tabularnewline
-% lv & latvian & \tabularnewline
-% mk & macedonian & \tabularnewline
-% ml & malayalam & \tabularnewline
-% mn & mongolian & \tabularnewline
-% mr & marathi & \tabularnewline
-% nb & norwegian & variant=bokmal \tabularnewline
-% nko & nko & \tabularnewline
-% nl & dutch & \tabularnewline
-% nn & norwegian & variant=nynorsk [\emph{default}] \tabularnewline
-% oc & occitan & \tabularnewline
-% or & odia & changecounternumbering=false, numerals=Devanagari [\emph{default}] \tabularnewline
-% pa & punjabi & numerals=gurmukhi \tabularnewline
-% pl & polish & \tabularnewline
-% pms & piedmontese & \tabularnewline
-% pt & portuguese & \tabularnewline
-% pt-BR & portuguese & variant=brazilian \tabularnewline
-% pt-PT & portuguese & variant=portuguese [\emph{default}] \tabularnewline
-% rm & romansh & \tabularnewline
-% ro & romanian & \tabularnewline
-% ru & russian & \tabularnewline
-% ru-luna1918 & russian & spelling=modern [\emph{default}] \tabularnewline
-% ru-petr1708 & russian & spelling=old \tabularnewline
-% sa & sanskrit & \tabularnewline
-% sa-Beng & sanskrit & script=Bengali \tabularnewline
-% sa-Deva & sanskrit & script=Devanagari [\emph{default}] \tabularnewline
-% sa-Gujr & sanskrit & script=Gujarati \tabularnewline
-% sa-Knda & sanskrit & script=Kannada \tabularnewline
-% sa-Mlym & sanskrit & script=Malayalam \tabularnewline
-% sa-Telu & sanskrit & script=Telugu \tabularnewline
-% se & sami & \tabularnewline
-% sk & slovak & \tabularnewline
-% sl & slovenian & \tabularnewline
-% sq & albanian & \tabularnewline
-% sr & serbian & \tabularnewline
-% sr-Cyrl & serbian & script=Cyrillic \tabularnewline
-% sr-Latn & serbian & script=Latin [\emph{default}] \tabularnewline
-% sv & swedish & \tabularnewline
-% syr & syriac & \tabularnewline
-% ta & tamil & \tabularnewline
-% te & telugu & \tabularnewline
-% th & thai & \tabularnewline
-% tk & turkmen & \tabularnewline
-% tr & turkish & \tabularnewline
-% ug & uyghur & \tabularnewline
-% uk & ukrainian & \tabularnewline
-% ur & urdu & \tabularnewline
-% vi & vietnamese & \tabularnewline
-% zh & chinese & \tabularnewline
-% zh-CN & chinese & variant=simplified [\emph{default}] \tabularnewline
-% zh-TW & chinese & variant=traditional \tabularnewline
-% zsm & malay & variant=malaysian [\emph{default}] \tabularnewline
-% \bottomrule
-% \end{longtable}
-% \egroup
-%
-% \subsection{Global options}
-%
-% \pkg{Polyglossia} can be loaded with the following global package options:
-%
-% \begin{itemize}
-% \item \xpgboolkeyfalse[1.1.1]{babelshorthands}
-% Globally activates \pkg{babel} shorthands whenever available.
-% Please refer to sec.~\ref{shorthands} for details.
-%
-% \item \xpgboolkeyfalse{localmarks} redefines the internal \LaTeX\ macros \cmd\markboth\ and
-% \cmd\markright\ to the effect that the header text is explicitly set in the currently
-% active language (\ie wrapped into \cmd\foreignlanguage\{\meta{lang}\}\{\meta{\ldots}\}).
-%
-% In earlier versions of \pkg{polyglossia},\new{1.2.0} this
-% option was enabled by default, but we now realize that it causes more problems
-% than it helps (since it breaks if a package or class redefines \cmd\markboth\ or
-% \cmd\markright), so it is now disabled by default. For backwards compatibility, the
-% option \xpgoption{nolocalmarks} which used to switch off the previous default, and
-% now equals the default, is still available.
-%
-% \item \xpgoptkey[1.50]{luatexrenderer}{renderer}[Harfbuzz] determines which font renderer is used
-% with \LuaTeX\ output. The correct font renderer is essential particularly for non-Latin scripts.
-% By default, \pkg{polyglossia} uses the \xpgvalue{Harfbuzz} renderer that has been introduced to
-% \LuaTeX\ in 2019 (\TeX Live 2020), as this gives the best results generally. If you want to use
-% a different renderer, you can specify this here (or individually for specific fonts via the optional
-% argument of the font selection commands). Please refer to the \pkg{fontspec} manual for supported
-% values and for details on how to change the renderer for individual fonts.\\
-% \xpgoption{luatexrenderer=none} disables \pkg{polyglossia}'s automatic renderer setting.
-%
-% \item \xpgboolkeytrue{verbose} determines whether info messages and (some of the) warnings issued
-% by \LaTeX, \pkg{fontspec} and \pkg{polyglossia} are output.
-% \end{itemize}
-%
-% \subsection{Shorthands}\label{shorthands}
-%
-% \pkg{Babel} has introduced the nifty feature of \enquote{shorthands} for some of the languages
-% it supports.
-% Shorthands make use of active characters to provide quick access to glyphs and formatting
-% peculiarities that are common in a respective language (\eg ¦"a¦ for German umlaut ⟨ä⟩ in case
-% this is not available on your keyboard).
-% \pkg{Polyglossia} has adopted this feature, we call it \emph{babelshorthands}.
-%
-% Shorthands need to be activated for the respective language, or can be activated globally, via
-% the boolean option \xpgoption{babelshorthands} (either passed globally when loading \pkg{polyglossia}
-% or to a specific language when loading it).
-%
-% Shorthands are implemented currently for Afrikaans, Belarusian, Catalan, Croatian,
-% Czech, Dutch, Finnish, Georgian, German, Italian, Latin, Mongolian, Occitan,
-% Piedmontese, Polish, Portuguese, Russian, Slovak, and Ukrainian, and their number and function
-% differs between these languages. Please refer to the respective language descriptions (sec.~\ref{specific})
-% for detailed elaborations.
-%
-% If you want to re-use the shorthands defined for a specific language in a different language,
-% you can do so by using in preamble:\new{2.0}
-% \displaycmd{\inheritbabelshorthands\marg{source language}\marg{target language}}{\inheritbabelshorthands}
-% in order to input and activate the shorthands defined for the \meta{source language} in
-% the \meta{target language}. Both languages will be loaded as \enquote{other} languages if they have not
-% been loaded yet. If one of the languages does not exist, or if the \meta{source language} does not provide any
-% shorthands, you will get an error message.
-%
-% Note, also, that you can only use \cmd{\inheritbabelshorthands} once per language. Subsequent
-% calls will overwrite previous ones (and also the shorthand that might be defined for a
-% \meta{target language} in the first place).
-%
-% If you want to enable the shorthands of a specific language inline, also when the language itself
-% is not active (but loaded in the preamble), you can do so by means of\new{2.0}
-% \displaycmd{\usebabelshorthands\marg{language}}{\usebabelshorthands}
-% The effect of this is local to groups. If you want to disable any active shorthands, you can use
-% ¦\usebabelshorthands{none}¦.
-%
-% \section{Language-switching commands}\label{languageswitching}
-%
-% \subsection{Recommended commands}\label{sec:langcmds}
-% For each activated language the command
-% \cmd{\text\meta{lang}\oarg{options}\marg{…}} \DescribeMacro{\text\meta{lang}}
-% (as well as the synonymous \DescribeMacro{\textlang}%
-% \cmd{\textlang\oarg{options}\marg{lang}\marg{…}}\new{1.46})
-% becomes available for short insertions of text in that language.
-%
-% For example ¦\textrussian{\today}¦ and ¦\textlang{russian}{\today}¦ yield \textrussian{\today}
-% The commands switch to the correct hyphenation patterns, they activate
-% some extra features for the selected language (such as extra spacing before
-% punctuation in French), and they translate the date when using \cmd\today.
-% They do not, however, translate so-called \textit{caption strings}, \ie
-% ``chapter'', ``figure'' etc., to the local language (these remain in the currently active `outer'
-% language).
-%
-% The\DescribeEnv{\meta{lang}}\ environment \meta{lang}, which is also available for any activated language
-% (as well as the equivalent \DescribeMacro{lang}%
-% \cmd{\begin\{lang\}\oarg{options}\marg{lang}} \dots{} \cmd{\end\{lang\}}\new{1.47}),
-% is meant for longer passages of text. It behaves slightly different than the \cmd{\text\meta{lang}} and
-% \cmd\textlang\ commands: It does everything the latter do, but additionally, the caption strings
-% are translated as well, and the language is also passed to auxiliary files, the table of contents
-% and the lists of figures/tables.
-% Like the commands, the environment provides the possibility of setting language options locally.
-% For instance the following allows us to quote the beginning
-% of Homer’s \textit{Iliad}:
-%
-% \begin{Verbatim}[formatcom=\color{xpgblue}]
-% \begin{quote}
-% \begin{greek}[variant=ancient]
-% μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος οὐλομένην, ἣ μυρί' Ἀχαιοῖς
-% ἄλγε' ἔθηκε, πολλὰς δ' ἰφθίμους ψυχὰς Ἄϊδι προί̈αψεν ἡρώων,
-% αὐτοὺς δὲ ἑλώρια τεῦχε κύνεσσιν οἰωνοῖσί τε πᾶσι, Διὸς δ'
-% ἐτελείετο βουλή, ἐξ οὗ δὴ τὰ πρῶτα διαστήτην ἐρίσαντε Ἀτρεί̈δης
-% τε ἄναξ ἀνδρῶν καὶ δῖος Ἀχιλλεύς.
-% \end{greek}
-% \end{quote}
-% \end{Verbatim}
-%
-% \vspace{-.5\baselineskip}
-%
-% \begin{quote}
-% \begin{greek}[variant=ancient]
-% μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος οὐλομένην, ἣ μυρί' Ἀχαιοῖς ἄλγε' ἔθηκε,
-% πολλὰς δ' ἰφθίμους ψυχὰς Ἄϊδι προί̈αψεν ἡρώων, αὐτοὺς δὲ ἑλώρια τεῦχε κύνεσσιν
-% οἰωνοῖσί τε πᾶσι, Διὸς δ' ἐτελείετο βουλή, ἐξ οὗ δὴ τὰ πρῶτα διαστήτην ἐρίσαντε
-% Ἀτρεί̈δης τε ἄναξ ἀνδρῶν καὶ δῖος Ἀχιλλεύς.
-% \end{greek}
-% \end{quote}
-%
-% \noindent\DescribeEnv{Arabic} Note that for Arabic one cannot use the environment ¦arabic¦,
-% as \cmd\arabic\ is defined internally by \LaTeX. In this case
-% we need to use the environment ¦Arabic¦ instead.
-%
-% \subsection{Babel commands}\label{sec:babelcmds}
-% Some macros defined in \pkg{babel}’s \file{hyphen.cfg} (and thus usually
-% compiled into the \XeLaTeX\ and \LuaLaTeX\ format) are redefined, but keep a
-% similar behaviour.
-% \begin{itemize}
-% \item \DescribeMacro{\selectlanguage}\cmd{\selectlanguage\oarg{options}\marg{lang}}
-% \item \DescribeMacro{\foreignlanguage}\cmd{\foreignlanguage\oarg{options}\marg{lang}\marg{…}}
-% \item \DescribeEnv{otherlanguage}\cmd{\begin\{otherlanguage\}\oarg{options}\marg{lang}} \dots{} \cmd{\end\{otherlanguage\}}
-% \item \DescribeEnv{otherlanguage*}\cmd{\begin\{otherlanguage*\}\oarg{options}\marg{lang}} \dots{} \cmd{\end\{otherlanguage*\}}
-% \item \DescribeEnv{hyphenrules}\cmd{\begin\{hyphenrules\}\oarg{options}\marg{lang}} \dots{} \cmd{\end\{hyphenrules\}}\new{1.50}
-% \end{itemize}
-% ^^A
-% \cmd\selectlanguage\marg{lang} and the ¦otherlanguage¦ environment are identical to the
-% \meta{lang} environment, except that \cmd\selectlanguage\marg{lang}
-% does not need to be explicitly closed. The command \cmd\foreinlanguage\marg{lang}\marg{…} and the ¦otherlanguage*¦
-% environment are identical with the use of the \cmd\text\meta{lang} or \cmd\textlang\ command, with the one
-% notable exception that they do not translate the date with \cmd\today.
-%
-% The \meta{hyphenrules} environment only switches the hyphenation patterns to the one associated with the language \meta{lang}
-% (or the language variety as specified via \meta{options}). It does no further language-specific change.
-%
-% Since the \XeLaTeX\ and \LuaLaTeX\ format incorporate \pkg{babel}’s \file{hyphen.cfg},
-% the low-level commands for hyphenation and language switching defined there are in principal also accessible.
-% Note, however, that the availability of such low-level commands is not guaranteed, as \file{hyphen.cfg}, which is
-% out of \pkg{polyglossia}'s control, is (or at least has been) subject to regular change.
-%
-% \subsection{Other commands}
-% The following commands are probably of lesser interest to the end user, but
-% ought to be mentioned here.
-% \begin{itemize}
-% \item \DescribeMacro{\selectbackgroundlanguage}\cmd{\selectbackgroundlanguage\marg{lang}}:
-% this selects the global font setup and the numbering definitions for the default language.
-%
-% \item \DescribeMacro{\resetdefaultlanguage}\cmd{\resetdefaultlanguage\oarg{options}\marg{lang}} (experimental):
-% Switches the default language
-% to another one in the middle of a document: \textit{this may have adverse effects}!
-%
-% \item \Cmd\normalfontlatin: in an environment where \cmd\normalfont\ has been redefined
-% to a non-latin script, this will reset to the font defined with \cmd\setmainfont\ etc.
-% In a similar vein, it is possible to use \Cmd\rmfamilylatin, \Cmd\sffamilylatin,
-% and \Cmd\ttfamilylatin.
-%
-% \item \DescribeMacro{\latinalph}\cmd{\latinalph\marg{counter}}: Representation of counter as a lower-case letter:
-% 1 = a, 2 = b, etc.
-%
-% \item \DescribeMacro{\latinAlph}\cmd{\latinAlph\marg{counter}}: Representation of counter as a upper-case letter:
-% 1 = A, 2 = B, etc.
-% \end{itemize}
-%
-%
-% \subsection{Setting up alias commands}
-%
-% By means of the macro\new{1.46}
-% \displaycmd{\setlanguagealias\oarg{options}\marg{language}\marg{alias}}{\setlanguagealias}
-% you can define alias commands for specific language (variants). \Eg
-%
-% \begin{quote}
-% \begin{verbatim}
-% \setlanguagealias[variant=austrian]{german}{AT}
-% \end{verbatim}
-% \end{quote}
-% ^^A
-% will define a command \cmd{\textAT} as well as an environment ¦{AT}¦ which will link towards
-% the command ¦\textgerman[variant=austrian]¦ and the environment ¦{german}[variant=austrian]¦,
-% respectively. The aliases can also be used in the language switching commands described in
-% section~\ref{sec:langcmds} and \ref{sec:babelcmds}.
-% Note, though, that the usual restrictions for command names apply, so something such as
-% ¦de-AT¦ or ¦de_AT¦ will not work since ¦-¦ and ¦_¦ are not allowed in command names (the same
-% holds true for any non-ASCII character and for digits).
-%
-% For the latter case, and for the case where an alias would clash with an existing command
-% (\eg ¦\fi¦) or a \cmd{\text\meta{\ldots}} command (\eg \cmd\textit), a starred version \Cmd{\setlanguagealias*}
-% is provided which does neither define a \cmd{\text\meta{alias}} command nor an \meta{alias} environment,
-% but which will set up the alias for everything else, including \cmd{\textlang\marg{alias}}
-% and \cmd{\begin\{lang\}\marg{alias}}.
-%
-% \pkg{Polyglossia} comes with some aliases predefined, namely aliases for \pkg{babel} language names
-% (see sec.~\ref{sec:babelnames}) and for IETF BCP-47 language tags (the latter via \cmd{\setlanguagealias*};
-% see sec.~\ref{sec:langtags}).
-%
-% \section{Font setup}
-%
-% With 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}.
-% 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
-% (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.
-%
-% If a specific sans serif or monospace (`teletype') font is needed for a particular script or language,
-% it can be defined by means of \new{1.2.0}
-% \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
-% 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.
-%
-% \section{Adapting hyphenation}
-%
-% \subsection{Hyphenation exceptions}
-%
-% \TeX\ provides the command \cmd\hyphenation\marg{exceptions} to globally define hyphenation exceptions
-% which override the hyphenation patterns for specified words. The command takes as argument a space-separated
-% list of words where hyphenation points are marked by a dash (if no dash is used, the respective word is not
-% hyphenated at all):
-% \begin{quote}
-% \begin{minipage}{.7\textwidth}
-% \begin{verbatim}
-% \hyphenation{%
-% po-ly-glos-sia
-% LaTeX
-% }
-% \end{verbatim}
-% \end{minipage}
-% \end{quote}
-% ^^A
-% These exceptions, however, apply to all languages. In addition to this, \pkg{polyglossia} provides
-% the command\new{1.45}
-% \displaycmd{\pghyphenation\oarg{options}\marg{lang}\marg{exceptions}}{\pghyphenation}
-% which can be used to define exceptions that only apply to a specific language or language variant,
-% respectively.
-%
-% \subsection{Hyphenation thresholds}
-%
-% \pkg{Polyglossia} sets reasonable defaults for the hyphenation thresholds of each language,
-% \ie the number of characters that must at least be there at the beginning or end of a
-% word before it is hyphenated (\cmd\lefthyphenmin\ and \cmd\righthyphenmin\ in \TeX).
-% For instance, with English, this threshold is 2 at the beginning (`left') and 3 at the end (`right'),
-% so a word will not be hyphenated within the first two characters at the beginning and the last three
-% characters at the end.
-%
-% To change this value, \pkg{polyglossia} provides the command\new{1.50}
-% \displaycmd{\setlanghyphenmins\oarg{options}\marg{lang}\marg{l}\marg{r}}{\setlanghyphenmins}
-% ^^A
-% where \meta{lang} is to be replaced with the respective language name or alias, \meta{options}
-% can be used to delimit the modification to a particular variety (\eg via \texttt{variant} or \texttt{spelling}),
-% \meta{l} with the left threshold value (\eg \texttt{3}), and \meta{r} with the right
-% one (\eg \verb|\setlanghyphenmins[spelling=old]{german}{4}{4}|).
-% This setting can be changed repeatedly in the preamble and the document body.
-% It applies to all subsequent text in the respective language (variety), but only after the
-% next language switch.
-%
-% \subsection{Hyphenation disabling}
-%
-% In some very specific contexts (such as music score creation), \TeX\ hyphenation
-% is something to avoid completely as it may cause troubles.
-% \pkg{Polyglossia} provides two functions: \Cmd\disablehyphenation\ and \Cmd\enablehyphenation.
-% Note that if you select a new language while hyphenation is disabled, it will remain disabled.
-% If you re-enable it, the hyphenation patterns of the currently selected language
-% will be activated.
-%
-% \section{Language-specific options and commands}\label{specific}
-%
-% This section gives a list of all languages for which options and end-user
-% commands are defined. Note the following conventions:
-% \begin{itemize}
-% \item The preset value of each option (\ie the setting that applies by default,
-% if the option is not explicitly set) is given in \xpgpresetvalue{italics}.
-% \item If an option key may be used without a value, the value that applies
-% for value-less keys is marked by a preceding \xpgdefaultvalue{asterisk}.
-% \end{itemize}
-% For instance, \texttt{babelshorthands = *true} or \texttt{\textit{false}} means that
-% \xpgvalue{babelshorthands} is \xpgvalue{false} by default in the respective language,
-% and that passing \xpgvalue{babelshorthands} (without value) is equivalent to passing
-% \xpgvalue{babelshorthands=true}.
-%
-% \subsection{afrikaans}\label{afrikaans}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgboolkeyfalse[1.1.1]{babelshorthands}
-% If this is turned on, the following shorthands defined for fine-tuning hyphenation and
-% micro-typography of Afrikaans words are activated:
-% \begin{shorthands}
-% \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
-% in the hyphenation patterns (as opposed to \cmd\- in default \TeX).
-% \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
-% cases where the hyphen should stick at the following syllable.
-% \item[¦"|¦] disables a ligature at this position.
-% \item[¦""¦] allows for a line break at this position (without hyphenation sign).
-% \item[¦"/¦] a slash that allows for a subsequent line break. As opposed to \cmd\slash,
-% hyphenation at the breakpoints preset in the hyphenation patterns is still allowed.
-% \end{shorthands}
-% \end{itemize}
-%
-% \subsection{arabic}\label{arabic}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{calendar}{\xpgpresetvalue{gregorian} or \xpgvalue{islamic} (= \xpgvalue{hijri})}
-% \item \xpgoptkey{hijricorrection}{integer}[0]
-% If \xpgvalue{calendar=hijri} or \xpgvalue{calendar=islamic} is selected, \cmd{\today} will output the date
-% according to the lunar Islamic (Hijra) calendar. This option allows to shift the day of the output with respect
-% to the current date. Both positive and negative integer values are allowed (negative decrease the day value).
-% This corresponds to the optional argument of the \cmd{\Hijritoday} command which can be used to output Hijri
-% dates irrespective of the \xpgvalue{calendar} option (see sec.~\ref{sec:hijrical}).
-% \item \xpgchoicekey{locale}{\xpgpresetvalue{default}, \xpgvalue{mashriq}, \xpgvalue{libya},
-% \xpgvalue{algeria}, \xpgvalue{tunisia}, \xpgvalue{morocco}, \xpgvalue{mauritania}}
-% This setting influences the spelling of the month names for the Gregorian calendar,
-% as well as the form of the numerals (unless overridden by the following option). Recommended settings are
-% \xpgvalue{default} for Egypt, Sudan, Yemen and the Gulf states, and \xpgvalue{mashriq} for Iraq, Syria,
-% Jordan, Lebanon and Palestine.
-% \item \xpgchoicekey{numerals}{\xpgpresetvalue{mashriq} (=~\xpgvalue{eastern}\new{1.63}) or \xpgvalue{maghrib}
-% (=~\xpgvalue{western}\new{1.63})}
-% Use Eastern Arabic (a.k.a.\ Indic-Arabic) numerals (\xpgvalue{mashriq} or \xpgvalue{eastern}) or Western numerals
-% (\xpgvalue{maghrib} or \xpgvalue{western}).
-% The latter is the default when \xpgvalue{locale=algeria}, \xpgvalue{tunisia}, or \xpgvalue{morocco}, the former
-% is the default with all other Arabic locales.
-% \item \xpgcodekey[1.63]{sectionsep}¦.¦
-% This option allows to customize the separator between chapters, sections, and subsections (a dot by default),
-% \eg \xpgoption{sectionsep=-}.
-% This might be useful particularly with \xpgoption{numerals=mashriq} or \xpgoption{eastern}, as the dot looks
-% too similar to the zero in many fonts.
-% \item \xpgboolkeyfalse[1.50]{abjadalph}
-% Set this to true if you want the alphabetic counters to be output using \cmd\abjadalph\ rather than \cmd\abjad.
-% Note that this limits the counter scope to 28 (see \cmd\abjadalph\ below).
-% \item \xpgboolkeyfalse[1.0.3]{abjadjimnotail}
-% Set this to true if you want the \textit{abjad} form of the number three to be \textarabic{ج‍} – as in the manuscript
-% tradition – instead of the modern usage \textarabic{ج}.
-% \end{itemize}
-% \paragraph*{Commands:}
-% \begin{itemize}
-% \item \Cmd\abjad outputs Arabic \textit{abjad} numbers according to the Mashriq varieties.
-% Example: ¦\abjad{1863}¦ yields \textarabic{\abjad{1863}}.
-% \item \Cmd\abjadmaghribi outputs Arabic \textit{abjad} numbers according to the Maghrib varieties.
-% Example: ¦\abjadmaghribi{1863}¦ yields \textarabic{\abjadmaghribi{1863}}.
-% \item \Cmd\abjadalph\new{1.50} steps through the Arabic alphabet, thus it can only be used up to 28.
-% Example: ¦\textarabic{\abjadalph{18}}¦ yields \textarabic{\abjadalph{18}}.
-% \item \Cmd\aemph to emphasize text with \cmd\overline.\new{1.2.0}
-% ¦\textarabic{\aemph{اب}}¦ yields \textarabic{\aemph{اب}}.
-% This command is also available for Farsi, Urdu, etc.
-% \end{itemize}
-%
-% \subsection{armenian}\label{armenian}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey[1.45]{variant}{\xpgvalue{eastern} or \xpgpresetvalue{western}}
-% \item \xpgchoicekey[1.45]{numerals}{\xpgvalue{armenian} or \xpgpresetvalue{arabic}}
-% \item \xpgboolkeyfalse[1.63]{capitalyiwn}
-% If this is set to true, \cmd{\MakeUppercase} will upcase the ligature of letters ech and yiwn to capital
-% ech and yiwn. This conforms to the output outside Armenian language selection.
-% By default (and with this option set to \xpgvalue{false}), \cmd{\MakeUppercase} upcases the ech and yiwn
-% ligature to capital ech and \emph{vew}, adhering to Armenian reformed spelling regulations.
-% Note that this feature requires \LaTeX\ kernel 2023/06 at least.
-% \end{itemize}
-%
-% \subsection[belarusian]{belarusian\new{1.46}}\label{belarusian}
-%
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgboolkeyfalse{babelshorthands}
-% If this is turned on, the following shorthands are activated:
-% \begin{shorthands}
-% \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
-% in the hyphenation patterns (as opposed to \cmd\-).
-% \item[¦"=¦] adds an explicit hyphen with a breakpoint, allowing for hyphenation at the
-% other points preset in the hyphenation patterns (as opposed to plain ¦-¦).
-% \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
-% cases where the hyphen should stick at the following syllable.
-% \item[¦"|¦] disables a ligature at this position.
-% \item[¦""¦] allows for a line break at this position (without hyphenation sign).
-% \item[¦",¦] thinspace for initials with a breakpoint in following surname.
-% \item[¦"‘¦] for German left double quotes (looks like ,,).
-% \item[¦"’¦] for German right double quotes (looks like “).
-% \item[¦"<¦] for French left double quotes (looks like <<).
-% \item[¦">¦] for French right double quotes (looks like >>).
-% \end{shorthands}
-%
-% There are also three shorthands for the Cyrillic dash (\textrussian{тире}), which is shorter than the
-% emdash but longer than the endash (namely 0.8\,em).
-% Note that, since it is not covered by unicode, this character is faked by telescoping two endashes:
-% \begin{shorthands}
-% \item[¦"---¦] Cyrillic dash for the use in normal text. This requires preceding space
-% in input (trailing space is optional) and prints with a non-breakable thin space before
-% and after the dash.
-% \item[¦"--\textasciitilde¦] Cyrillic dash for the use in compound names (surnames).
-% As opposed to ¦"---¦ this removes any space before and after the dash.
-% \item[¦"--*¦] Cyrillic dash for denoting direct speech. This adds a larger space after
-% the dash. Space before the dash is output as is.
-% \end{shorthands}
-% \item \xpgchoicekey{numerals}{\xpgpresetvalue{arabic}, \xpgvalue{cyrillic-alph} or \xpgvalue{cyrillic-trad}}
-% Uses either Arabic numerals or Cyrillic alphanumerical numbering. The two Cyrillic variants differ as follows:
-% \begin{itemize}
-% \item \xpgvalue{cyrillic-alph} steps through the Cyrillic alphabet. Thus it can only be used up to 30.
-% \item \xpgvalue{cyrillic-trad} (= \xpgvalue{cyrillic}) uses a traditional Cyrillic alphanumeric system.%
-% \footnote{See \url{https://en.wikipedia.org/wiki/Cyrillic_numerals}.}
-% It supports numbers up to 999\,999.
-% \end{itemize}
-% \item \xpgchoicekey{spelling}{\xpgpresetvalue{modern} or \xpgvalue{classic} (= \xpgvalue{tarask})}
-% With ¦spelling=classic¦, captions and dates adhere to the Taraškievica (or
-% Belarusian classical) orthography rather than the standard orthography.
-% \end{itemize}
-%
-% \condbreak{\baselineskip}
-% \paragraph*{Commands:}
-% \begin{itemize}
-% \item \Cmd\Asbuk: produces uppercased Cyrillic alphanumerals, for environments such as ¦enumerate¦.
-% It steps through the Cyrillic alphabet and thus it can only be used up to 30.
-% The command takes a counter as argument, \eg ¦\textbelarusian{\Asbuk{page}}¦ produces \textrussian{\Asbuk{page}}.
-% \item \Cmd\asbuk: same as \cmd\Asbuk\ but in lowercase.
-% \item \Cmd\AsbukTrad: same as \cmd\Asbuk\ but using the traditional Cyrillic alphanumeric numbering which supports
-% numbers up to 999\,999.\\
-% \Eg ¦\textbelarusian{\AsbukTrad{page}}¦ produces \textrussian{\AsbukTrad{page}}.
-% \item \Cmd\asbukTrad: same as \cmd\AsbukTrad\ but in lowercase.
-% \end{itemize}
-%
-% \subsection[bengali]{bengali\new{1.2.0}}\label{bengali}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{numerals}{\xpgvalue{western}, \xpgvalue{bengali}, or \xpgpresetvalue{devanagari}}
-% \item \xpgboolkeyfalse{changecounternumbering}
-% Use specified numerals for headings and page numbers.
-% \end{itemize}
-%
-% \subsection{catalan}\label{catalan}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgboolkeyfalse[1.1.1]{babelshorthands}
-% Activates the shorthands \texttt{"l} and \texttt{"L} to type geminated l or L.
-% \end{itemize}
-%
-% \paragraph*{Commands:}
-% \begin{itemize}
-% \item \Cmd{\l.l} and \Cmd{\L.L}\new{1.1.1} can be used to type a geminated l, as in \textit{co\l.laborar},
-% similar to \pkg{babel} (the glyph U+00B7 MIDDLE DOT is used as a geminating sign).
-% \end{itemize}
-%
-% \subsection[chinese]{chinese\new{1.59}}\label{chinese}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{variant}{\xpgpresetvalue{simplified} (= \xpgvalue{cn}), or \xpgvalue{traditional} (= \xpgvalue{tw})}
-% \item \xpgchoicekey{numerals}{\xpgpresetvalue{arabic} or \xpgvalue{chinese}}
-% Uses either Arabic numerals or Chinese ideographic numbering.
-% \end{itemize}
-% \paragraph*{Commands:}
-% \begin{itemize}
-% \item \Cmd\chinesenumeral (see section \ref{abjad}).
-% \end{itemize}
-%
-% \subsection{croatian}\label{croatian}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgboolkeyfalse[1.47]{babelshorthands}
-% If this is turned on, the following shorthands for fine-tuning hyphenation and micro-typography
-% of Croatian words are activated.
-% \begin{shorthands}
-% \item[¦"|¦] disables a ligature at this position.
-% \item[¦"=¦] for an explicit hyphen with a breakpoint, allowing for hyphenation at the
-% other points preset in the hyphenation patterns (as opposed to plain ¦-¦).
-% \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
-% cases where the hyphen should stick at the following syllable.
-% \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
-% in the hyphenation patterns (as opposed to \cmd\-).
-% \item[¦""¦] allows for a line break at this position (without hyphenation sign).
-% \item[¦"/¦] a slash that allows for a subsequent line break. As opposed to \cmd\slash, hyphenation
-% at the breakpoints preset in the hyphenation patterns is still allowed.
-% \end{shorthands}
-% Furthermore, the following shorthands generate easy access to Croatian digraphs:
-% \begin{shorthands}
-% \item[¦"dz¦] Generates the digraph \charifavailable{01C6}{dž}\ if the font provides it. If not,
-% the two consecutive glyphs are output mimicking the digraph. Also available for
-% ¦"Dz¦ (\charifavailable{01C5}{Dž}) and ¦"DZ¦ (\charifavailable{01C4}{DŽ}).
-% \item[¦"lj¦] Generates the digraph \charifavailable{01C9}{lj}\ if the font provides it. If not,
-% the two consecutive glyphs are output mimicking the digraph. Also available for
-% ¦"Lj¦ (\charifavailable{01C8}{Lj}) and ¦"LJ¦ (\charifavailable{01C7}{LJ}).
-% \item[¦"nj¦] Generates the digraph \charifavailable{01CC}{nj}\ if the font provides it. If not,
-% the two consecutive glyphs are output mimicking the digraph. Also available for
-% ¦"Nj¦ (\charifavailable{01CB}{Nj}) and ¦"NJ¦ (\charifavailable{01CA}{NJ}).
-% \end{shorthands}
-%
-% Finally, there are also four shorthands for quotation marks:
-% \begin{shorthands}
-% \item[¦"`¦] for Croatian left double quotes („).
-% \item[¦"'¦] for Croatian right double quotes (”).
-% \item[¦">¦] for Croatian left guillemets (»).
-% \item[¦"<¦] for Croatian right guillemets («).
-% \end{shorthands}
-% \item \xpgboolkeyfalse[1.47]{disabledigraphs}[Up to version 1.53, the option was
-% called \xpgvalue{disableligatures}. The old option is kept for backwards compatibility,
-% but the use is discouraged.] If this is \xpgvalue{true}, all Croatian digraphs
-% (such as \charifavailable{01C6}{dž}) will be replaced by the two consecutive letters,
-% which is the most common way of typesetting them in Croatian. This can be useful if
-% the Unicode digraphs in your font are broken (if the font does not have them,
-% they are automatically mimicked by the two consecutive glyphs).
-% \item \xpgboolkeytrue[1.53]{localalph}
-% If \xpgvalue{true}, alphanumeric counters will use a locally established version which excludes
-% the characters \meta{q}, \meta{w}, \meta{x} and \meta{y} from alphabetic counting.
-% Obviously this limits the counting range to 22.
-% \item \xpgboolkeytrue[1.51]{splithyphens}
-% According to Croatian typesetting conventions, if a word with a hard hyphen (such as
-% \emph{hrvatsko-engleski}) is hyphenated at this hyphen, a second hyphenation character is to be
-% inserted at the beginning of the line that follows the hyphenation (\emph{hrvatsko-/-engleski}).
-% By default, this is done automatically (if you are using \LuaTeX, the \pkg{luavlna} package is
-% loaded to achieve this).
-% Set this option to ¦false¦ to disable the feature.
-% \end{itemize}
-%
-% \subsection{czech}\label{czech}
-%
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgboolkeyfalse[1.45]{babelshorthands}
-% If this is turned on, the following shorthands for Czech are activated:
-% \begin{shorthands}
-% \item[¦"=¦] for an explicit hyphen sign which is repeated at the beginning
-% of the next line when hyphenated, as common in Czech typesetting
-% (only needed with ¦splithyphens=false¦).
-% \item[¦"‘¦] for Czech left double quotes („).
-% \item[¦"’¦] for Czech right double quotes (“).
-% \item[¦">¦] for Czech left double guillemets (»).
-% \item[¦"<¦] for Czech right double guillemets («).
-% \end{shorthands}
-% \item \xpgboolkeytrue[1.45]{splithyphens}
-% According to Czech typesetting conventions, if a word with a hard hyphen (such as \emph{je-li})
-% is hyphenated at this hyphen, a second hyphenation character is to be inserted at the beginning
-% of the line that follows the hyphenation (\emph{je-/-li}).
-% By default, this is done automatically\new{1.46} (if you are using \LuaTeX, the \pkg{luavlna} package is
-% loaded to achieve this).
-% Set this option to ¦false¦ to disable the feature.
-% \item \xpgboolkeytrue[1.45]{vlna}
-% According to Czech typesetting conventions, single-letter words (non-syllable prepositions)
-% must not occur at line ends.
-% \pkg{Polyglossia} takes care of this automatically by default\new{1.46} (if you are using \LuaTeX, the
-% \pkg{luavlna} package is loaded to achieve this).
-% Set this option to ¦false¦ to disable the feature.
-% \end{itemize}
-%
-% \subsection{dutch}\label{dutch}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgboolkeytrue[1.63]{tremahyphenation}
-% Following Dutch orthography, words with tremata (such as \emph{geëxecuteerd}) lose the trema on hyphenation
-% before the trematized letter (\emph{ge-executeerd}). This is achieved by \pkg{polyglossia} by making those
-% letters active. If you set this option to false, this mechanism is deactivated (and the hyphenation wrong,
-% but you can still use the babelshorthands mentioned below).
-% \item \xpgboolkeyfalse[1.1.1]{babelshorthands}
-% If this is turned on, the following shorthands defined for fine-tuning hyphenation and
-% micro-typography of Dutch words are activated:
-% \begin{shorthands}
-% \item[¦"a¦]\new{1.63} an \meta{ä} (a with trema) which is hyphenated as \meta{-a} as required by the Dutch standards.
-% Also implemented for the other vowels (e, i, o, u), both lower and uppercase.
-% \item[¦"y¦]\new{1.63} the \ij\ ligature.
-% \item[¦"Y¦]\new{1.63} the \IJ\ ligature.
-% \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
-% in the hyphenation patterns (as opposed to \cmd\- in default \TeX).
-% \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
-% cases where the hyphen should stick at the following syllable.
-% \item[¦"|¦] disables a ligature at this position.
-% \item[¦""¦] allows for a line break at this position (without hyphenation sign).
-% \item[¦"/¦] a slash that allows for a subsequent line break. As opposed to \cmd\slash,
-% hyphenation at the breakpoints preset in the hyphenation patterns is still allowed.
-% \end{shorthands}
-% In addition, the macro \Cmd\- is redefined to allow hyphens in the rest of the word (equivalent to ¦"-¦).
-% \end{itemize}
-%
-% \subsection{english}\label{english}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{variant}{\xpgpresetvalue{american} (= \xpgvalue{us}), \xpgvalue{usmax} (same as \xpgvalue{american} but with additional hyphenation patterns),
-% \xpgvalue{british} (= \xpgvalue{uk}), \xpgvalue{australian}, \xpgvalue{canadian}\new{1.45}, or \xpgvalue{newzealand}}
-% \item \xpgboolkeyfalse{ordinalmonthday}
-% The default value is true for \xpgvalue{variant=british}.
-% \end{itemize}
-%
-% \subsection{esperanto}\label{esperanto}
-% \paragraph*{Commands:}
-% \begin{itemize}
-% \item \Cmd\hodiau\ and \Cmd\hodiaun are special forms of \cmd\today. The former produces the date in Esperanto
-% preceded by the article (\emph{la}), which is the most common date format.
-% The latter produces the same date format in accusative case.
-% \end{itemize}
-%
-% \subsection{finnish}\label{finnish}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgboolkeyfalse[1.45]{babelshorthands}
-% If this is turned on, the following shorthands for fine-tuning hyphenation
-% and micro-typography of Finnish words are activated:
-% \begin{shorthands}
-% \item[¦"-¦] adds an explicit hyphen without a breakpoint, allowing for hyphenation at the
-% other points preset in the hyphenation patterns. Useful for
-% cases where the hyphen should stick at the following syllable
-% (\eg ¦pakastekaapit ja "-arkut¦).
-% \item[\texttt{"=}] for a hyphen sign without a breakpoint that does also remove all other
-% breakpoints in the word (as opposed to ¦"-¦).
-% \item[\texttt{"\textasciitilde}] functionally equivalent to ¦"-¦ (provided for backwards
-% compatibility reasons).
-% \item[¦"|¦] disables a ligature at this position.
-% \item[¦""¦] allows for a line break at this position (without hyphenation sign).
-% \item[¦"/¦] a slash that allows for a subsequent line break. As opposed to \cmd\slash,
-% hyphenation at the breakpoints preset in the hyphenation patterns is still allowed.
-% \end{shorthands}
-% \item \xpgchoicekey[2.0]{hyphens}{\xpgpresetvalue{default}, \xpgvalue{babel}, \xpgvalue{school}}
-% Hyphenation in Finnish is peculiar since there are many rather long words. In order to select a suitable
-% hyphenation pattern, three different options are provided:
-% \begin{itemize}
-% \item The \xpgvalue{default} patterns as used by \LaTeX\ are rather strict and try to prevent hyphenation
-% at points which are valid but considered sub-optimal from an ortho-typographic point of view
-% (\eg hyphenation between two vowels), with the drawback that simple words are sometimes not being
-% hyphenated at points where this would be valid, and lines might become unevenly spaced.
-% \item The \pkg{babel} support for Finnish by default tweaks some hyphenation-related values
-% (such as \cmd\hyphenpenalty) for Finnish. If you want to replicate this with \pkg{polyglossia},
-% select \xpgvalue{babel} (this still uses the default patterns).
-% \item The \xpgvalue{school} setting, finally, employs alternative (experimental) hyphenation patterns
-% rather than the default Finnish patterns. These (so-called `School') patterns allow hyphenation at
-% all valid points, including hyphenation points that are considered sub-optimal from an
-% ortho-typographic point of view.\footnote{This equals the previous boolean option \xpgoption{schoolhyphens},
-% which is still supported for backwards compatibility.}
-% See \url{https://github.com/hyphenation/basic-finnish} for details.
-% \end{itemize}
-% \end{itemize}
-%
-% \subsection{french}\label{french}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{variant}{\xpgpresetvalue{french}, \xpgvalue{canadian}, \xpgvalue{acadian}\new{1.45} or \xpgvalue{swiss}\new{1.47}}
-% Currently, the only difference between the four variants is that \xpgvalue{swiss}
-% uses \xpgvalue{thincolonspace=true} by default since this conforms to the Swiss
-% conventions.
-% \item \xpgboolkeytrue{autospacing}
-% One of the most distinct features of French typography is the addition of
-% extra spacing around punctuation and quotation marks (guillemets). By
-% default, polyglossia adds these spaces automatically, so you don't need
-% to enter them. This options allows you to switch this feature off
-% globally.
-% \item \xpgboolkeyfalse[1.46]{thincolonspace}
-% With \xpgvalue{variant=swiss}, the default value is \xpgvalue{true}. If \xpgvalue{false}, a full
-% (non-breaking) interword space is inserted before a colon. If \xpgvalue{true}, a
-% thinner space -- as before \texttt{;}, \texttt{!}, and \texttt{?} -- is
-% used. Note that this option must be set after the ¦variant¦ option.
-% \item \xpgboolkeytrue{autospaceguillemets}[Up to version 1.44, the option was
-% called \xpgvalue{automaticspacesaroundguillemets}. For backwards compatibility
-% reasons, the more verbose old option is still supported.]
-% If you only want to disable the automatic addition of spacing after
-% opening and before closing guillemets (and not at punctuation), set this
-% to \textit{false}. Note that the more general option \textit{autospacing}
-% overrides this.
-% \item \xpgboolkeyfalse[1.45]{autospacetypewriter}[Babel's syntax \xpgvalue{OriginalTypewriter}
-% is also supported.]
-% By default, automatic spacing is disabled in typewriter font. If this is
-% enabled, spacing in typewriter context is the same as with roman and sans
-% serif font, depending on the \xpgvalue{autospacing} and
-% \xpgvalue{autospaceguillemets} settings (note that this was the default up
-% to v.~1.44).
-% \item \xpgboolkeyfalse{frenchfootnote}
-% If \xpgvalue{true}, footnotes start with a non-superscripted number
-% followed by a dot, as common in French typography. Note that this might
-% interfere with the specific footnote handling of classes or packages.
-% Also note that this option is only functional (by design) if French is
-% the main language.
-% \item \xpgboolkeyfalse[1.46]{frenchitemlabels}
-% If \textit{true}, itemize item labels use em-dashes throughout, as common
-% in French typography. Note that this option is only functional (by
-% design) if French is the main language. Also, it might interfere with
-% list packages such as \pkg{enumitem}.
-% \item \xpgboolkeytrue[1.51]{frenchpart}
-% By default, \pkg{polyglossia} modifies part headings to match French conventions
-% (\emph{Première partie} rather than \emph{Partie I}). Next to the standard classes,
-% specifics of \pkg{KOMA-script}, \pkg{memoir} and the \pkg{titlesec} package are
-% taken into account. With other classes or packages, redefinition might fail if these
-% have particular part settings.
-% In such case, or if you don't want the redefinition, you can switch off the feature
-% by passing \textit{false} to this option.
-% \item \xpgcodekey[1.46]{itemlabels}¦\textemdash¦
-% If \emph{frenchitemlabels} is true, you can customize here the used item
-% label of all levels.
-% \item \xpgcodekey[1.46]{itemlabeli}¦\textemdash¦
-% If \emph{frenchitemlabels} is true, you can customize here the used item
-% label of the first level.
-% \item \xpgcodekey[1.46]{itemlabelii}¦\textemdash¦
-% If \emph{frenchitemlabels} is true, you can customize here the used item
-% label of the second level.
-% \item \xpgcodekey[1.46]{itemlabeliii}¦\textemdash¦
-% If \emph{frenchitemlabels} is true, you can customize here the used item
-% label of the third level.
-% \item \xpgcodekey[1.46]{itemlabeliv}¦\textemdash¦
-% If \emph{frenchitemlabels} is true, you can customize here the used item
-% label of the fourth level.
-% \end{itemize}
-% \paragraph*{Commands:}
-% \begin{itemize}
-% \item \Cmd\NoAutoSpacing\new{1.45} disables automatic spacing around punctuation and quotation marks in all following text. The command can also be used locally if braces are used for grouping: ¦{\NoAutoSpacing foo:bar}¦
-% \item \Cmd\AutoSpacing\new{1.45} enables automatic spacing around punctuation and quotation marks in all following text. The command can also be used locally if braces are used for grouping: ¦{\AutoSpacing regarde!}¦
-% \end{itemize}
-%
-% \subsection[gaelic]{gaelic\new{1.45}}\label{gaelic}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{variant}{\xpgpresetvalue{irish} or \xpgvalue{scottish}}
-% \end{itemize}
-%
-% \subsection[georgian]{georgian\new{1.46}}\label{georgian}
-%
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgboolkeyfalse{babelshorthands}
-% If this is turned on, the following shorthands are activated:
-% \begin{shorthands}
-% \item[¦"-¦] adds a hyphenation point that does still allow for
-% hyphenation at the points preset in the hyphenation patterns (as opposed to \cmd\-).
-% \item[¦"=¦] adds an explicit hyphen with a breakpoint, allowing for hyphenation at the
-% other points preset in the hyphenation patterns (as opposed to plain ¦-¦).
-% \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
-% cases where the hyphen should stick at the following syllable.
-% \item[¦"|¦] disables a ligature at this position.
-% \item[¦""¦] allows for a line break at this position (without hyphenation sign).
-% \item[¦",¦] thinspace for initials with a breakpoint in following surname.
-% \item[¦"‘¦] for German-style left double quotes (looks like ,,).
-% \item[¦"’¦] for German-style right double quotes (looks like “).
-% \item[¦"<¦] for French-style left double quotes (looks like <<).
-% \item[¦">¦] for French-style right double quotes (looks like >>).
-% \end{shorthands}
-%
-% There are also three shorthands for the Cyrillic dash (\textrussian{тире}), which is shorter than the
-% emdash but longer than the endash (namely 0.8\,em).
-% Note that, since it is not covered by unicode, this character is faked by telescoping two endashes:
-% \begin{shorthands}
-% \item[¦"---¦] Cyrillic dash for the use in normal text. This requires preceding space
-% in input (trailing space is optional) and prints with a non-breakable thin space before
-% and after the dash.
-% \item[¦"--\textasciitilde¦] Cyrillic dash for the use in compound names (surnames).
-% As opposed to ¦"---¦ this removes any space before and after the dash.
-% \item[¦"--*¦] Cyrillic dash for denoting direct speech. This adds a larger space after
-% the dash. Space before the dash is output as is.
-% \end{shorthands}
-% \item \xpgchoicekey{numerals}{\xpgpresetvalue{arabic} or \xpgvalue{georgian}}
-% Uses either Arabic numerals or Georgian alphanumerical numbering.
-% \item \xpgboolkeyfalse{oldmonthnames}
-% Uses traditional Georgian month names.
-% \end{itemize}
-%
-% \subsection{german}\label{german}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{variant}{\xpgpresetvalue{german}, austrian, or swiss\new{1.33.4}}
-% Setting \xpgvalue{variant=austrian} or \xpgvalue{variant=swiss} uses some lexical variants.
-% With \xpgvalue{spelling=old}, \xpgvalue{variant=swiss} furthermore loads specific hyphenation
-% patterns.
-% \item \xpgchoicekey{spelling}{\xpgpresetvalue{new} (= \xpgvalue{1996}) or \xpgvalue{old} (= \xpgvalue{1901})}
-% Indicates whether hyphenation patterns for traditional (1901) or reformed
-% (1996) orthography should be used. The latter is the default.
-% \item \xpgboolkeyfalse[1.63]{capitaleszett}
-% If this is set to true, \cmd{\MakeUppercase} will upcase the eszett character ⟨ß⟩ to the
-% capital counterpart ⟨\charifavailable{1E9E}{SS}⟩ that has been introduced to Unicode in 2008 and
-% standardized in German regulations in 2017, rather than ⟨SS⟩. Note that this feature requires
-% \LaTeX\ kernel 2023/06 at least and a font that contains the respective glyph.
-% \item \xpgchoicekey[1.2.0]{script}{\xpgpresetvalue{latin} or \xpgvalue{blackletter}\new{1.46} (= \xpgvalue{fraktur})}
-% Setting ¦script=blackletter¦ adapts the captions for typesetting German in blackletter type, using the `long s' ⟨ſ\kern1.5pt⟩
-% where appropriate.
-% \item \xpgboolkeyfalse[1.0.3]{babelshorthands}
-% If this is turned on, all shorthands defined in \pkg{babel}
-% for fine-tuning hyphenation and micro-typography of German words are activated.
-% \begin{shorthands}
-% \item[¦"ck¦] for ¦ck¦ to be hyphenated as ¦k-k¦ (1901 spelling).
-% \item[¦"ff¦] for ¦ff¦ to be hyphenated as ¦ff-f¦ (1901 spelling); this is also available
-% for the letters l, m, n, p, r and t.
-% \item[¦"|¦] disables a ligature at this position (\eg ¦Auf"|lage¦).
-% \item[¦"=¦] for an explicit hyphen with a breakpoint, allowing for hyphenation at the
-% other points preset in the hyphenation patterns (as opposed to plain ¦-¦).
-% \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
-% cases where the hyphen should stick at the following syllable, \eg ¦bergauf und "~ab¦.
-% \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
-% in the hyphenation patterns (as opposed to \cmd\-).
-% \item[¦""¦] allows for a line break at this position (without hyphenation sign);
-% \eg ¦(pseudo"~)""wissenschaftlich¦.
-% \item[¦"/¦] a slash that allows for a subsequent line break. As opposed to \cmd\slash, hyphenation at the breakpoints
-% preset in the hyphenation patterns is still allowed.
-% \item[¦"*¦]\new{2.0} An asterisk which assures the word can still be hyphenated at its defined breakpoints.
-% Useful if you want to employ gender-sensitive writing (,gender star`).
-% Similar shorthands are available for the alternative gender-sensitive spellings, ¦":¦ and ¦"_¦.
-% \item[¦"x¦]\new{2.0} Inserts a gender mark which assures the word can still be hyphenated at its defined breakpoints.
-% This is predefined to ¦*¦ but can be globally redefined by redefining the macro \cmd\mkgender\ (see below).
-% \end{shorthands}
-%
-% There are also four shorthands for quotation signs:
-% \begin{shorthands}
-% \item[¦"`¦] for German-style left double quotes („)
-% \item[¦"'¦] for German-style right double quotes (“)
-% \item[¦"<¦] for French-style left double quotes («)
-% \item[¦">¦] for French-style right double quotes (»).
-% \end{shorthands}
-% \end{itemize}
-% \paragraph*{Commands:}
-% \begin{itemize}
-% \item \Cmd\mkgender\new{2.0} Defines which gender mark is output by the babelshorthand ¦"x¦.
-% Predefined to ¦\def\mkgender{*}¦.
-% \end{itemize}
-%
-% \subsection{greek}\label{greek}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{variant}{\xpgpresetvalue{monotonic} (= \xpgvalue{mono}), \xpgvalue{polytonic} (= \xpgvalue{poly}), or \xpgvalue{ancient}}
-% \item \xpgchoicekey{numerals}{\xpgpresetvalue{greek} or \xpgvalue{arabic}}
-% \item \xpgboolkeyfalse[1.63]{capitaliota}
-% If this is set to true, \cmd{\MakeUppercase} will upcase the \emph{ypogegrammeni} (subscript muted iota) to capital iota.
-% By default (and with this option set to \xpgvalue{false}), \cmd{\MakeUppercase} retains the subscript versions.
-% Note that this feature requires \LaTeX\ kernel 2023/06 at least.
-% \end{itemize}
-% \paragraph*{Commands:}
-% \begin{itemize}
-% \item \Cmd\Greeknumeral (= \Cmd\Greeknumber) and \Cmd\greeknumeral (= \Cmd\greeknumber) \ (see section \ref{abjad}).
-% \item The command \Cmd\atticnumeral (= \Cmd\atticnum) (activated with
-% the option ¦attic=true¦), displays numbers using the acrophonic
-% numbering system (defined in the Unicode range
-% \textsf{U+10140–U+10174}).\footnote{ %
-% See the documentation of the \pkg{xgreek} package for more details.}
-% \end{itemize}
-%
-% \subsection{hebrew}\label{hebrew}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{numerals}{\xpgvalue{hebrew} or \xpgpresetvalue{arabic}}
-% \item \xpgchoicekey{calendar}{\xpgvalue{hebrew} or \xpgpresetvalue{gregorian}}
-% \item \xpgboolkeyfalse{marcheshvan}
-% If \xpgvalue{true}, the second month of the civil year will be output as
-% \texthebrew{מרחשון} (Marcheshvan) rather than \texthebrew{חשון} (Heshvan),
-% which is the default.
-% \item \xpgboolkeyfalse[1.57]{fullyear} causes years from the current millennium to be printed with the thousands digit
-% (he-tav-shin-samekh-gimel). Without this option, thousands are not printed for the current millennium.
-% \item \xpgchoicekey[1.57]{transliteration}{\xpgvalue{academy} or \xpgpresetvalue{alt}} With value \xpgvalue{academy}, transliteration
-% follows the recommendations of the Hebrew Language Academy. The default (\xpgvalue{alt}) uses the received settings of
-% \pkg{babel} (\pkg{hebcal}) and \pkg{polyglossia} (\pkg{hebrewcal}).
-% \end{itemize}
-% \paragraph*{Commands:}
-% \begin{itemize}
-% \item \Cmd\hebrewnumeral\ (= \Cmd\hebrewalph) (see section \ref{abjad}).
-% \item \Cmd\aemph (see section \ref{arabic}).
-% \end{itemize}
-%
-% \subsection[hindi]{hindi\new{1.2.0}}\label{hindi}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{numerals}{\xpgvalue{western} or \xpgpresetvalue{devanagari}}
-% \end{itemize}
-%
-% \subsection{hungarian}\label{hungarian}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey[1.46]{swapstrings}{\xpgdefaultvalue{\xpgpresetvalue{all}},
-% \xpgvalue{captions}, \xpgvalue{headings}, \xpgvalue{headers}, \xpgvalue{hheaders}, or \xpgvalue{none}}
-% In Hungarian, some caption strings need to be in a different order than in other languages
-% (\eg \emph{1. fejezet} instead of \emph{Chapter 1}). By default, \pkg{polyglossia} tries hard to
-% provide the correct order for different classes and packages (standard classes, \pkg{KOMA-script},
-% \pkg{memoir}, and \pkg{titlesec} package should work, as well as \pkg{fancyhdr} and \pkg{caption}).
-% However, since the definition of these strings is not standardized, the redefinitions might not work
-% and even interfere badly if you use specific classes or packages that redefine the respective strings
-% themselves. In this case, you can disable some or all changes.
-% The possibilities are:
-% \begin{itemize}
-% \item ¦all¦: Redefine figure and table captions, part and chapter headings, and running headers (=~default setting)
-% \item ¦captions¦: Redefine figure and table captions only
-% \item ¦headings¦: Redefine part and chapter headings only
-% \item ¦headers¦: Redefine running headers only
-% \item ¦hheaders¦: Redefine part and chapter headings as well as running headers
-% \item ¦none¦: Do not redefine anything
-% \end{itemize}
-% \item \xpgboolkeytrue[1.58]{forceheadingpunctuation}
-% Section numbers always have a trailing punctuation in Hungarian (as in \emph{1.1.} as opposed to \emph{1.1}).
-% For compatibility reasons, the default option is \xpgvalue{false}, thus \textsf{polyglossia}
-% does not touch heading punctuation, so this will be whatever the class or a package determines.
-% Set this option to \xpgvalue{true},
-% and \textsf{polyglossia} appends a period after the section counters,
-% and adjusts the header punctuation (as in \emph{1. fejezet.} as opposed to \emph{1. fejezet}).
-% \end{itemize}
-% \paragraph*{Commands:}
-% \begin{itemize}
-% \item \Cmd\ontoday\ (= \Cmd\ondatehungarian): special form of \cmd\today\ which produces a slightly different
-% date format as used in prepositional phrases (such as ‘on February 10th’) in Hungarian.
-% \end{itemize}
-%
-% \subsection{italian}\label{italian}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgboolkeyfalse[1.2.0cc]{babelshorthands}% TODO: check version
-% Activates the ¦"¦ character as a switch to perform etymological
-% hyphenation when followed by a letter. Furthermore, the following shorthands are activated:
-% \begin{shorthands}
-% \item[¦""¦] double raised open quotes (the Italian keyboard misses the backtick).
-% \item[¦"<¦] open guillemet (looks like <<).
-% \item[¦">¦] closing guillemet (looks like >>).
-% \item[¦"/¦] a slash that allows for a subsequent line break. As opposed to \cmd\slash,
-% hyphenation at the breakpoints preset in the hyphenation patterns is still allowed.
-% \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
-% in the hyphenation patterns (as opposed to \cmd\-).
-% \end{shorthands}
-% \end{itemize}
-%
-% \subsection[korean]{korean\new{1.40.0}}\label{korean}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{variant}{\xpgpresetvalue{plain}, \xpgvalue{classic}, or \xpgvalue{modern}}
-% These variants control spacing before/after CJK punctuations.
-% \begin{itemize}
-% \item ¦plain¦: Do nothing
-% \item ¦classic¦: Suitable for text with no interword spaces.
-% This option forces CJK punctuations to half-width, and
-% inserts half-width glue around them.
-% \item ¦modern¦: Suitable for text with interword spaces.
-% This option forces CJK punctuations to half-width, and
-% inserts small (half of interword space) glue around them.
-% \end{itemize}
-% \item \xpgchoicekey{captions}{\xpgpresetvalue{hangul} or \xpgvalue{hanja}}
-% \item \xpgchoicekey[1.47]{swapstrings}{\xpgdefaultvalue{\xpgpresetvalue{all}},
-% \xpgvalue{headers}, \xpgvalue{headings}, or \xpgvalue{none}}
-% With this option, Korean-style part and chapter headings, and
-% running headers are available.
-% It is similar to Hungarian (see \ref{hungarian}) except that
-% figure and table captions are not touched.
-% \begin{itemize}
-% \item ¦all¦: Redefine part and chapter headings, and running headers
-% (=~default setting)
-% \item ¦headings¦: Redefine part and chapter headings only
-% \item ¦headers¦: Redefine running headers only
-% \item ¦none¦: Do not redefine anything
-% \end{itemize}
-% \end{itemize}
-%
-% \subsection[kurdish]{kurdish\new{1.45}}\label{kurdish}
-%
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{variant}{\xpgvalue{kurmanji} or \xpgpresetvalue{sorani}}
-% \item \xpgchoicekey{script}{\xpgvalue{arabic} or \xpgvalue{latin}}
-% Defaults are \xpgvalue{arabic} for Sorani and \xpgvalue{latin} for Kurmanji.
-% \item \xpgchoicekey{numerals}{\xpgvalue{western} or \xpgvalue{eastern}}
-% Defaults are \xpgvalue{western} for Latin and \xpgvalue{eastern} for Arabic script, depending
-% on the selection above.
-% \item \xpgcodekey[1.63]{sectionsep}¦.¦
-% This option allows to customize the separator between chapters, sections, and subsections (a dot by default),
-% \eg \xpgoption{sectionsep=-}.
-% This might be useful particularly with \xpgoption{numerals=eastern}, as the dot looks too similar to the zero
-% in many fonts.
-% \item \xpgboolkeyfalse{abjadjimnotail}
-% Set this to true if you want the \textit{abjad} form of the number three to
-% be \textarabic{ج‍} – as in the manuscript tradition – instead of the
-% modern usage \textarabic{ج}.
-% ^^A \item \xpgchoicekey{locale}{} (not yet implemented)
-% ^^A \item \xpgchoicekey{calendar}{} (not yet implemented)
-% \end{itemize}
-% \condbreak{2\baselineskip}
-% \paragraph*{Commands:}
-% \begin{itemize}
-% \item \Cmd\ontoday: special form of \cmd\today\ which produces a slightly different
-% date format as used in prepositional phrases (as in ‘on February 10th’). Only available for Latin script.
-% \item \Cmd\abjad (see section \ref{abjad})
-% \item \Cmd\aemph (see section \ref{arabic})
-% \end{itemize}
-%
-% \subsection[lao]{lao\new{1.2.0}}\label{lao}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{numerals}{\xpgvalue{lao} or \xpgpresetvalue{arabic}}
-% \end{itemize}
-%
-% \subsection{latin}\label{latin}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{variant}{\xpgvalue{classic}, \xpgvalue{medieval}, \xpgpresetvalue{modern}, or \xpgvalue{ecclesiastic}\new{1.46}}
-% These variants refer to different spelling conventions. The \xpgvalue{classic}
-% and the \xpgvalue{medieval} variant do not use the letters \emph{U} and
-% \emph{v}, but only \emph{V} and \emph{u}. This concerns predefined terms like
-% month names as well as the behaviour of the \cmd\MakeUppercase\ and the
-% \cmd\MakeLowercase\ command. The ¦medieval¦ and the
-% ¦ecclesiastic¦ variant use the ligatures \emph{\ae} and \emph{\oe}.
-% See table \ref{tab:latin-spelling} for examples.
-%
-% Furthermore, the \xpgvalue{ecclesiastic} variant takes care for a punctuation
-% spacing similar to French, but with smaller spaces, as provided for
-% PDF\TeX\ by the \pkg{ecclesiastic} package.
-% \begin{table}
-% \centering
-% \caption{\label{tab:latin-spelling}Spelling differences between the Latin
-% language variants.\newline The capitalization of month names and the use of
-% \emph{i/j} may be affected by the \xpgvalue{capitalizemonth} and the
-% \xpgvalue{usej} option.}
-% \begin{tabular}{llll}
-% \toprule
-% \textbf{classic} & \textbf{medieval} & \textbf{modern} & \textbf{ecclesiastic} \\
-% \midrule
-% Ianuarii & Ianuarii & Ianuarii & ianuarii \\
-% Nouembris & Nouembris & Novembris & novembris \\
-% Praefatio & Præfatio & Praefatio & Præfatio \\
-% \addlinespace\multicolumn{4}{@{}l}{\cmd{\MakeUppercase\{Iulius\}} yields:} \\
-% IVLIVS & IVLIVS & IULIUS & IULIUS \\
-% \bottomrule
-% \end{tabular}
-% \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
-% 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
-% ¦hyphenation¦ option if the default style does not fit your needs.
-% Note that the liturgical hyphenation patterns are the default of none of the
-% language variants. To use them, you have to say
-% \xpgvalue{hyphenation=liturgical} in any case.
-% \begin{table}
-% \caption{\label{tab:latin-hyphenation}Latin default hyphenation styles}
-% \centering
-% \begin{tabular}{ll}
-% \toprule
-% \textbf{Language variant} & \textbf{Default hyphenation style} \\
-% \midrule
-% classic & classic \\
-% medieval & modern \\
-% modern & modern \\
-% ecclesiastic & modern \\
-% \bottomrule
-% \end{tabular}
-% \end{table}
-% \item \xpgboolkeyfalse[1.46]{ecclesiasticfootnotes}
-% Use footnotes as provided by the \pkg{ecclesiastic} package, which typesets
-% footnotes with ordinary instead of superior numbers and without indentation.
-% As many ecclesiastic documents and liturgical books use footnotes that are
-% very similar to the ordinary \LaTeX\ ones, we do not use this footnote style
-% as default even for the ¦ecclesiastic¦ variant.
-%
-% Note that this option is only possible if Latin is the main language of your
-% document.
-% \item \xpgboolkeyfalse[1.46]{usej}
-% Use \emph{J/j} in predefined terms. The letter \emph{j} is not of ancient
-% origin. In early modern times, it was used to distinguish the consonantic
-% \emph{i} from the vocalic~\emph{i}. Nowadays, the use of \emph{j} has
-% disappeared from most Latin publications. So ¦false¦ is the default
-% value for all four language variants. Use this option if you prefer
-% \emph{Januarii} and \emph{Maji} to \emph{Ianuarii} and \emph{Maii}.
-% \item \xpgboolkey[1.46]{capitalizemonth}
-% Capitalize the month name when printing dates (using the \cmd\today\
-% command). Traditionally, month names are capitalized. However, in recent
-% liturgical books they are lowercase. So ¦true¦ is the default value for
-% the variants ¦classic¦, ¦medieval¦, and ¦modern¦,
-% whereas ¦false¦ is the default value for the ¦ecclesiastic¦
-% variant.
-% \item \xpgboolkeyfalse{babelshorthands}
-% Enable the following shorthands inherited from \pkg{babel-latin} and the
-% \pkg{ecclesiastic} package.
-% \begin{shorthands}
-% \item[¦"<¦] for « (left guillemet)
-% \item[¦">¦] for » (right guillemet)
-% \item[¦"¦] If no other shorthand applies, ¦"¦ before any letter
-% character defines an optional break point allowing further break points
-% within the same word (as opposed to the \cmd\- command).
-% \item[¦"|¦] the same as ¦"¦, but also possible before non-letter
-% characters
-% \item[¦'a¦] for á (a with acute), also available for é, í, ó, ú, ý, ǽ, and
-% \'œ
-% \item[¦'A¦] for Á (A with acute), also available for É, Í, Ó, Ú, \'V, Ý, Ǽ,
-% and \'Œ
-% \end{shorthands}
-% The following shorthands are only available for the ¦medieval¦ and the
-% ¦ecclesiastic¦ variant.
-% \begin{shorthands}
-% \item[¦"ae¦] for æ (ae ligature), also available for œ
-% \item[¦"Ae¦] for Æ (AE ligature), also available for Œ
-% \item[¦"AE¦] for Æ (AE ligature), also available for Œ
-% \item[¦'ae¦] for ǽ (ae ligature with acute), also available for \'œ
-% \item[¦'Ae¦] for Ǽ (AE ligature with acute), also available for \'Œ
-% \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
-% those provided by \pkg{babel-latin} using the ¦withprosodicmarks¦
-% modifier.
-% Note that the active ¦=¦ character used for macrons will cause problems with
-% commands using \texttt{key=value} interfaces, such as the command
-% ¦\includegraphics[scale=2]{...}¦. Use \cmd{\shorthandoff\{=\}} before
-% such commands (and \cmd{\shorthandon\{=\}} thereafter) within every
-% environment with prosodic shorthands enabled.
-%
-% The following shorthands are available.
-% \begin{shorthands}
-% \item[¦=a¦] for ā (a with macron), also available for ē, ī, ō, ū, and ȳ
-% \item[¦=A¦] for Ā (A with macron), also available for Ē, Ī, Ō, Ū, V̄, and Ȳ.
-% Note that a macron above the letter V is only displayed if your font
-% supports the Unicode character ¦0304¦ (\emph{combining macron}).
-% \item[¦=ae¦] for a͞e (ae diphthong with macron, for the ¦classic¦ and
-% the ¦modern¦ variant) or ǣ (ae ligature with macron, for the ¦medieval¦
-% and the ¦ecclesiastic¦ variant), respectively; also available for a͞u,
-% e͞u, and o͞e/œ̄. Note that macrons above diphthongs are only displayed if
-% your font supports the Unicode character ¦035E¦ (\emph{combining double
-% macron}).
-% \item[¦=Ae¦] for A͞e (Ae diphthong with macron, for the ¦classic¦ and
-% the ¦modern¦ variant) or Ǣ (AE ligature with macron, for the ¦medieval¦
-% and the ¦ecclesiastic¦ variant), respectively; also available for A͞u,
-% E͞u, and O͞e/Œ̄.
-% \item[¦=AE¦] for A͞E (AE diphthong with macron, for the ¦classic¦ and
-% the ¦modern¦ variant) or Ǣ (AE ligature with macron, for the ¦medieval¦
-% and the ¦ecclesiastic¦ variant), respectively; also available for A͞U,
-% E͞U, and O͞E/Œ̄.
-% \item[¦\textasciicircum a¦] for ă (a with breve), also available for ĕ, ĭ,
-% ŏ, ŭ, and y̆. Note that a breve above the letter y is only displayed if
-% your font supports the Unicode character ¦0306¦ (\emph{combining
-% breve}).
-% \item[¦\textasciicircum A¦] Ă (A with breve), also available for Ĕ, Ĭ, Ŏ,
-% Ŭ, V̆, and Y̆. Note that breves above the letters V and Y are only displayed
-% if your font supports the Unicode character ¦0306¦ (\emph{combining
-% breve}).
-% \end{shorthands}
-% \end{itemize}
-%
-% \subsection{malay}\label{malay}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey[1.45]{variant}{\xpgvalue{indonesian} or \xpgpresetvalue{malaysian}}
-% \end{itemize}
-%
-% \subsection{marathi}\label{marathi}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{numerals}{\xpgpresetvalue{devanagari} or \xpgvalue{western}}
-% \end{itemize}
-%
-% \subsection[mongolian]{mongolian\new{1.45}}\label{mongolian}
-% Currently, only the Khalkha variety in Cyrillic script is supported.
-%
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgboolkeyfalse{babelshorthands}
-% If this is turned on, the following shorthands are activated:
-% \begin{shorthands}
-% \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
-% in the hyphenation patterns (as opposed to \cmd\-).
-% \item[¦"=¦] adds an explicit hyphen with a breakpoint, allowing for hyphenation at the
-% other points preset in the hyphenation patterns (as opposed to plain ¦-¦).
-% \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
-% cases where the hyphen should stick at the following syllable.
-% \item[¦"|¦] disables a ligature at this position.
-% \item[¦""¦] allows for a line break at this position (without hyphenation sign).
-% \item[¦",¦] thinspace for initials with a breakpoint in following surname.
-% \item[¦"‘¦] for German-style left double quotes (looks like ,,).
-% \item[¦"’¦] for German-style right double quotes (looks like “).
-% \item[¦"<¦] for French-style left double quotes (looks like <<).
-% \item[¦">¦] for French-style right double quotes (looks like >>).
-% \end{shorthands}
-%
-% There are also three shorthands for the Cyrillic dash (\textrussian{тире}), which is shorter than the
-% emdash but longer than the endash (namely 0.8\,em).
-% Note that, since it is not covered by unicode, this character is faked by telescoping two endashes:
-% \begin{shorthands}
-% \item[¦"---¦] Cyrillic dash for the use in normal text. This requires preceding space
-% in input (trailing space is optional) and prints with a non-breakable thin space before
-% and after the dash.
-% \item[¦"--\textasciitilde¦] Cyrillic dash for the use in compound names (surnames).
-% As opposed to ¦"---¦ this removes any space before and after the dash.
-% \item[¦"--*¦] Cyrillic dash for denoting direct speech. This adds a larger space after
-% the dash. Space before the dash is output as is.
-% \end{shorthands}
-% \item \xpgchoicekey{numerals}{\xpgpresetvalue{arabic}, \xpgvalue{cyrillic-alph} or \xpgvalue{cyrillic-trad}}
-% Uses either Arabic numerals or Cyrillic alphanumerical numbering. The two Cyrillic variants differ as follows:
-% \begin{itemize}
-% \item \xpgvalue{cyrillic-alph} steps through the Cyrillic alphabet. Thus it can only be used up to 30.
-% \item \xpgvalue{cyrillic-trad} (= \xpgvalue{cyrillic}) uses a traditional Cyrillic alphanumeric system.%
-% \footnote{See \url{https://en.wikipedia.org/wiki/Cyrillic_numerals}.}
-% It supports numbers up to 999\,999.
-% \end{itemize}
-% \end{itemize}
-% ^^A
-% \paragraph*{Commands:}
-% \begin{itemize}
-% \item \Cmd\Asbuk: produces uppercased Cyrillic alphanumerals, for environments such as ¦enumerate¦.
-% It steps through the Cyrillic alphabet and thus it can only be used up to 30.
-% The command takes a counter as argument, \eg ¦\textmongolian{\Asbuk{section}}¦ produces \textrussian{\Asbuk{section}}.
-% \item \Cmd\asbuk: same as \cmd\Asbuk\ but in lowercase.
-% \item \Cmd\AsbukTrad: same as \cmd\Asbuk\ but using the traditional Cyrillic alphanumeric numbering which supports
-% numbers up to 999\,999.\\
-% \Eg ¦\textmongolian{\AsbukTrad{section}}¦ produces \textrussian{\AsbukTrad{section}}.
-% \item \Cmd\asbukTrad: same as \cmd\AsbukTrad\ but in lowercase.
-% \end{itemize}
-%
-% \subsection{norwegian}\label{norwegian}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey[1.45]{variant}{\xpgvalue{bokmal} or \xpgpresetvalue{nynorsk}}
-% \end{itemize}
-%
-% \subsection[odia]{odia\new{1.66}}\label{odia}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{numerals}{\xpgvalue{western}, \xpgpresetvalue{devanagari}, or \xpgvalue{odia}}
-% \item \xpgboolkeyfalse{changecounternumbering}
-% Use specified numerals for headings and page numbers.
-% \end{itemize}
-%
-% \subsection{persian}\label{persian}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{numerals}{\xpgvalue{western} or \xpgpresetvalue{eastern}}
-% \item \xpgcodekey[1.63]{sectionsep}¦.¦
-% This option allows to customize the separator between chapters, sections, and subsections (a dot by default),
-% \eg \xpgoption{sectionsep=-}.
-% This might be useful particularly with \xpgoption{numerals=eastern}, as the dot looks too similar to the zero
-% in many fonts.
-% \item \xpgboolkeyfalse[1.0.3]{abjadjimnotail}
-% Set this to \xpgvalue{true} if you want the \textit{abjad} form of the number three to
-% be \textarabic{ج‍} – as in the manuscript tradition – instead of the
-% modern usage \textarabic{ج}.
-% ^^A \item \xpgchoicekey{locale}{} (not yet implemented)
-% ^^A \item \xpgchoicekey{calendar}{} (not yet implemented)
-% \end{itemize}
-% \paragraph*{Commands:}
-% \begin{itemize}
-% \item \Cmd\abjad (see section \ref{abjad})
-% \item \Cmd\aemph (see section \ref{arabic}).
-% \end{itemize}
-%
-% \subsection{polish}\label{polish}
-%
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgboolkeyfalse[1.55]{babelshorthands}
-% If this is turned on, the following shorthands for Polish are activated:
-% \begin{shorthands}
-% \item[¦"=¦] for an explicit hyphen sign which is repeated at the beginning
-% of the next line when hyphenated, as common in Polish typesetting
-% (also if ¦splithyphens=false¦). Unlike plain ¦-¦, this also allows
-% for hyphenation at the other points preset in the hyphenation patterns.
-% \item[¦"|¦] disables a ligature at this position.
-% \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
-% cases where the hyphen should stick at the following syllable.
-% \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
-% in the hyphenation patterns (as opposed to \cmd\-).
-% \item[¦""¦] allows for a line break at this position (without hyphenation sign).
-% \item[¦"/¦] a slash that allows for a subsequent line break. As opposed to \cmd\slash, hyphenation at the breakpoints
-% preset in the hyphenation patterns is still allowed.
-% \item[¦"`¦] for Polish left double quotes (looks like ,,).
-% \item[¦"'¦] for Polish right double quotes (looks like '').
-% \item[¦"<¦] for French left double guillemets (looks like << -- used in Polish as second level quotes).
-% \item[¦">¦] for French right double guillemets (looks like >>).
-% \end{shorthands}
-% \item \xpgboolkeytrue[1.55]{splithyphens}
-% According to Polish typesetting conventions, if a word with a hard hyphen (such as \emph{czerwono-złote})
-% is hyphenated at this hyphen, a second hyphenation character is to be inserted at the beginning
-% of the line that follows the hyphenation (\emph{czerwono-/-złote}).
-% By default, this is done automatically (if you are using \LuaTeX, the \pkg{luavlna} package is
-% loaded to achieve this).
-% Set this option to ¦false¦ to disable the feature.
-% \item \xpgboolkeytrue[1.55]{vlna}
-% According to Polish typesetting conventions, single-letter words (non-syllable prepositions)
-% must not occur at line ends.
-% \pkg{Polyglossia} takes care of this automatically by default (if you are using \LuaTeX, the
-% \pkg{luavlna} package is loaded to achieve this).
-% Set this option to ¦false¦ to disable the feature.
-% \end{itemize}
-%
-% \subsection{portuguese}\label{portuguese}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey[1.45]{variant}{\xpgvalue{brazilian} or \xpgpresetvalue{portuguese}}
-% \item \xpgboolkeyfalse[1.54]{babelshorthands}
-% If this is turned on, the following shorthands for fine-tuning hyphenation and micro-typography
-% of Portuguese words are activated.
-% \begin{shorthands}
-% \item[¦"|¦] disables a ligature at this position.
-% \item[¦"=¦] for an explicit hyphen sign which is repeated at the beginning
-% of the next line when hyphenated, as common in Portuguese typesetting
-% (also if ¦splithyphens=false¦). Unlike plain ¦-¦, this also allows
-% for hyphenation at the other points preset in the hyphenation patterns.
-% \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
-% cases where the hyphen should stick at the following syllable.
-% \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
-% in the hyphenation patterns (as opposed to \cmd\-).
-% \item[¦""¦] allows for a line break at this position (without hyphenation sign).
-% \item[¦"/¦] a slash that allows for a subsequent line break. As opposed to \cmd\slash, hyphenation
-% at the breakpoints preset in the hyphenation patterns is still allowed.
-% \item[¦"<¦] for French left guillemets («).
-% \item[¦">¦] for French right guillemets (»).
-% \end{shorthands}
-% \item \xpgboolkeytrue[1.54]{splithyphens}
-% According to Portuguese typesetting conventions, if a word with a hard hyphen (such as
-% \emph{pára-brisas}) is hyphenated at this hyphen, a second hyphenation character is to be
-% inserted at the beginning of the line that follows the hyphenation (\emph{pára-/-brisas}).
-% By default, this is done automatically (if you are using \LuaTeX, the \pkg{luavlna} package is
-% loaded to achieve this).
-% Set this option to ¦false¦ to disable the feature.
-% \end{itemize}
-%
-% \subsection[punjabi]{punjabi\new{1.59}}\label{punjabi}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{numerals}{\xpgvalue{western} or \xpgpresetvalue{gurmukhi}}
-% \end{itemize}
-%
-% \subsection{russian}\label{russian}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgboolkeyfalse{babelshorthands}
-% If this is turned on, the following shorthands are activated:
-% \begin{shorthands}
-% \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
-% in the hyphenation patterns (as opposed to \cmd\-).
-% \item[¦"=¦] adds an explicit hyphen with a breakpoint, allowing for hyphenation at the
-% other points preset in the hyphenation patterns (as opposed to plain ¦-¦).
-% \item[\texttt{"\textasciitilde}] adds an explicit hyphen without a breakpoint. Useful for
-% cases where the hyphen should stick at the following syllable.
-% \item[¦"|¦] disables a ligature at this position.
-% \item[¦""¦] allows for a line break at this position (without hyphenation sign).
-% \end{shorthands}
-%
-% There are also three shorthands for the Cyrillic dash (\textrussian{тире}), which is shorter than the
-% emdash but longer than the endash (namely 0.8\,em).
-% Note that, since it is not covered by unicode, this character is faked by telescoping two endashes:
-% \begin{shorthands}
-% \item[¦"---¦] Cyrillic dash for the use in normal text. This requires preceding space
-% in input (trailing space is optional) and prints with a non-breakable thin space before
-% and after the dash.
-% \item[¦"--\textasciitilde¦] Cyrillic dash for the use in compound names (surnames).
-% As opposed to ¦"---¦ this removes any space before and after the dash.
-% \item[¦"--*¦] Cyrillic dash for denoting direct speech. This adds a larger space after
-% the dash. Space before the dash is output as is.
-% ^^A These are commented out in gloss-russian
-% ^^A \item[¦",¦] thinspace for initials with a breakpoint in following surname.
-% ^^A \item[¦"‘¦] for German left double quotes (looks like ,,).
-% ^^A \item[¦"’¦] for German right double quotes (looks like “).
-% ^^A \item[¦"<¦] for French left double quotes (looks like <<).
-% ^^A \item[¦">¦] for French right double quotes (looks like >>).
-% \end{shorthands}
-% \item \xpgboolkeytrue[1.50]{forceheadingpunctuation}
-% By default, chapter and section numbers always have a trailing punctuation in Russian
-% (as in \emph{1.1.} as opposed to \emph{1.1}). If this option is set to \xpgvalue{false}, \textsf{polyglossia}
-% will not touch heading punctuation, so this will be whatever the class or a package determines.
-% \item \xpgboolkeytrue[1.46]{indentfirst}
-% By default, all paragraphs are indented in Russian, also those after a
-% chapter or section heading. If this option is \xpgvalue{false}, the latter paragraphs
-% are not indented, as normal in \LaTeX.
-% \item \xpgboolkeytrue[1.52]{mathfunctions}
-% By default, some specific math macros are defined for Russian (see below). In order to prevent command
-% clashes (\eg with the \pkg{chemformula} package), you can switch these definitions off by passing \xpgvalue{false}
-% to this option.
-% \item \xpgchoicekey{spelling}{\xpgpresetvalue{modern} or \xpgvalue{old}}
-% This option is for captions and date only, not for hyphenation.
-% \item \xpgchoicekey{numerals}{\xpgpresetvalue{arabic}, \xpgvalue{cyrillic-alph} or \xpgvalue{cyrillic-trad}}
-% Uses either Arabic numerals or Cyrillic alphanumerical numbering. The two Cyrillic variants differ as follows:
-% \begin{itemize}
-% \item \xpgvalue{cyrillic-alph} steps through the Cyrillic alphabet. Thus it can only be used up to 30.
-% \item \xpgvalue{cyrillic-trad} (= \xpgvalue{cyrillic}) uses a traditional Cyrillic alphanumeric system.%
-% \footnote{See \url{https://en.wikipedia.org/wiki/Cyrillic_numerals}.}
-% It supports numbers up to 999\,999.
-% \end{itemize}
-% \end{itemize}
-% ^^A
-% \paragraph*{Commands:}
-% \begin{itemize}
-% \item \Cmd\Asbuk: produces uppercased Cyrillic alphanumerals, for environments such as ¦enumerate¦.
-% It steps through the Cyrillic alphabet and thus it can only be used up to 30.
-% The command takes a counter as argument, \eg ¦\textrussian{\Asbuk{section}}¦ produces \textrussian{\Asbuk{section}}.
-% \item \Cmd\asbuk: same as \cmd\Asbuk\ but in lowercase.
-% \item \Cmd\AsbukTrad: same as \cmd\Asbuk\ but using the traditional Cyrillic alphanumeric numbering which supports
-% numbers up to 999\,999.\\
-% \Eg ¦\textrussian{\AsbukTrad{page}}¦ produces \textrussian{\AsbukTrad{page}}.
-% \item \Cmd\asbukTrad: same as \cmd\AsbukTrad\ but in lowercase.
-% \end{itemize}
-% If the \xpgoption{mathfunctions} option is \xpgvalue{true}, loading Russian defines a few macros than can be used
-% independently of the current language. These are nine macros to be used in math mode to type the names of
-% trigonometric functions common for Russian documents: \cmd\sh , \cmd\ch , \cmd\tg , \cmd\ctg , \cmd\arctg ,
-% \cmd\arcctg , \cmd\th , \cmd\cth , and \cmd\cosec . Cyrillic letters in math mode can be typed with
-% the aid of text commands such as \cmd\textbf , \cmd\textsf , \cmd\textit , \cmd\texttt , etc.
-% The macros \cmd\Prob , \cmd\Variance , \cmd\NOD , \cmd\nod , \cmd\NOK , \cmd\nok , \cmd\Proj\ print some rare
-% Russian mathematical symbols.
-%
-% \subsection[sami]{sami\new{1.45}}\label{sami}
-% Currently support for Sami is limited to Northern Sami.
-%
-% \subsection{sanskrit}\label{sanskrit}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey[1.0.2]{script}{\xpgpresetvalue{devanagari}, \xpgvalue{gujarati},
-% \xpgvalue{malayalam}, \xpgvalue{bengali}, \xpgvalue{kannada}, \xpgvalue{telugu}, \xpgvalue{latin}}
-% The value is passed to \pkg{fontspec} should the respective
-% \cmd{\⟨script⟩font} not be defined. This can be useful if you typeset Sanskrit
-% texts in scripts other than Devanagari.
-% \item \xpgchoicekey[1.45]{numerals}{\xpgpresetvalue{devanagari} or \xpgvalue{western}}
-% \end{itemize}
-%
-% \subsection{serbian}\label{serbian}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey[1.63]{variant}{\xpgpresetvalue{ekavian} or \xpgvalue{ijekavian}}
-% With \xpgvalue{ijekavian}, the different spelling is reflected in some caption strings.
-% \item \xpgchoicekey{script}{\xpgpresetvalue{cyrillic} or \xpgvalue{latin}}
-% \item \xpgboolkeyfalse[1.63]{datei}
-% If this is \xpgvalue{true}, the sixth and seventh month of the year are written in the date
-% with the trailing \meta{i} or \meta{и} (\ie \emph{juni}, \emph{juli} or \emph{јуни}, \emph{јули}
-% rather than \emph{jun}, \emph{jul} or \emph{јун}, \emph{јул}).
-% \item \xpgboolkeytrue[1.54]{splithyphens}
-% According to Serbian typesetting conventions, if a word with a hard hyphen (such as
-% \emph{калцијум-карбонат}) is hyphenated at this hyphen, a second hyphenation character is to be
-% inserted at the beginning of the line that follows the hyphenation (\emph{калцијум-/-карбонат}).
-% By default, this is done automatically (if you are using \LuaTeX, the \pkg{luavlna} package is
-% loaded to achieve this).
-% Set this option to ¦false¦ to disable the feature.
-% \item \xpgchoicekey{numerals}{\xpgpresetvalue{arabic}, \xpgvalue{cyrillic-alph} or \xpgvalue{cyrillic-trad}}
-% Uses either Arabic numerals or Cyrillic alphanumerical numbering. The two Cyrillic variants differ as follows:
-% \begin{itemize}
-% \item \xpgvalue{cyrillic-alph} steps through the Cyrillic alphabet. Thus it can only be used up to 30.
-% \item \xpgvalue{cyrillic-trad} (= \xpgvalue{cyrillic}) uses a traditional Cyrillic alphanumeric system.%
-% \footnote{See \url{https://en.wikipedia.org/wiki/Cyrillic_numerals}.}
-% It supports numbers up to 999\,999.
-% \end{itemize}
-% \end{itemize}
-% ^^A
-% \paragraph*{Commands:}
-% \begin{itemize}
-% \item \Cmd\Asbuk: produces uppercased Cyrillic alphanumerals, for environments such as ¦enumerate¦.
-% It steps through the Cyrillic alphabet and thus it can only be used up to 30.
-% The command takes a counter as argument, \eg ¦\textserbian{\Asbuk{section}}¦ produces \textrussian{\Asbuk{section}}.
-% \item \Cmd\asbuk: same as \cmd\Asbuk\ but in lowercase.
-% \item \Cmd\AsbukTrad: same as \cmd\Asbuk\ but using the traditional Cyrillic alphanumeric numbering which supports
-% numbers up to 999\,999.\\
-% \Eg ¦\textserbian{\AsbukTrad{page}}¦ produces \textrussian{\AsbukTrad{page}}.
-% \item \Cmd\asbukTrad: same as \cmd\AsbukTrad\ but in lowercase.
-% \item \Cmd{\today*}: as opposed to the unstarred counterpart, this does not end the date with a punctuation.
-% \item \Cmd{\todayGen}: outputs the date with months in genitive inflection. This form is suggested when the date
-% is integrated into a sentence (as opposed to a standalone date statement). The starred form \Cmd{\todayGen*}
-% omits the trailing punctuation.
-% \item \Cmd{\todayArabic}: outputs the date with months in Arabic number. The starred form \Cmd{\todayArabic*} omits
-% the trailing punctuation.
-% \item \Cmd{\todayRoman}: outputs the date with months in Roman number. The starred form \Cmd{\todayRoman*} omits
-% the trailing punctuation.
-% \end{itemize}
-%
-%
-% \subsection{slovak}\label{slovak}
-%
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgboolkeyfalse[1.46]{babelshorthands}
-% If this is turned on, the following shorthands for Slovak are activated:
-% \begin{shorthands}
-% \item[¦"=¦] for an explicit hyphen sign which is repeated at the beginning
-% of the next line when hyphenated, as common in Slovak typesetting
-% (also if ¦splithyphens=false¦). Unlike plain ¦-¦, this also allows
-% for hyphenation at the other points preset in the hyphenation patterns.
-% \item[¦"|¦] disables a ligature at this position.
-% \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
-% cases where the hyphen should stick at the following syllable.
-% \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
-% in the hyphenation patterns (as opposed to \cmd\-).
-% \item[¦""¦] allows for a line break at this position (without hyphenation sign).
-% \item[¦"/¦] a slash that allows for a subsequent line break. As opposed to \cmd\slash, hyphenation at the breakpoints
-% preset in the hyphenation patterns is still allowed.
-% \item[¦"‘¦] for Slovak left double quotes (looks like ,,).
-% \item[¦"’¦] for Slovak right double quotes (looks like “).
-% \item[¦">¦] for Slovak left double guillemets (looks like >>).
-% \item[¦"<¦] for Slovak right double guillemets (looks like <<).
-% \end{shorthands}
-% \item \xpgboolkeytrue[1.46]{splithyphens}
-% According to Slovak typesetting conventions, if a word with a hard hyphen (such as \emph{je-li})
-% is hyphenated at this hyphen, a second hyphenation character is to be inserted at the beginning
-% of the line that follows the hyphenation (\emph{je-/-li}).
-% By default, this is done automatically (if you are using \LuaTeX, the \pkg{luavlna} package is
-% loaded to achieve this).
-% Set this option to ¦false¦ to disable the feature.
-% \item \xpgboolkeytrue[1.46]{vlna}
-% According to Slovak typesetting conventions, single-letter words (non-syllable prepositions)
-% must not occur at line ends.
-% \pkg{Polyglossia} takes care of this automatically by default (if you are using \LuaTeX, the
-% \pkg{luavlna} package is loaded to achieve this).
-% Set this option to ¦false¦ to disable the feature.
-% \end{itemize}
-%
-% \subsection{slovenian}\label{slovenian}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgboolkeyfalse{localalph}
-% If \xpgvalue{true}, alphanumeric counters will use a localized version including characters with caron
-% (\emph{a, b, c, č, d, \ldots}) and excluding the characters \meta{q}, \meta{w}, \meta{x} and \meta{y}
-% from alphabetic counting.
-% \end{itemize}
-%
-% \subsection{sorbian}\label{sorbian}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey[1.45]{variant}{\xpgvalue{lower} or \xpgpresetvalue{upper}}
-% \item \xpgboolkeyfalse[1.45]{olddate}
-% If \xpgvalue{true}, \cmd\today\ will use traditional Sorbian month names (\ie it will be
-% synonymous to \cmd\oldtoday\ below).
-% \end{itemize}
-% \paragraph*{Commands:}
-% \begin{itemize}
-% \item \Cmd\oldtoday: outputs the current date using traditional Sorbian month names, even if
-% \xpgvalue{olddate} is \xpgvalue{false}.
-% \end{itemize}
-%
-% \subsection{spanish}\label{spanish}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey[1.46]{variant}{\xpgpresetvalue{spanish} or \xpgvalue{mexican}}
-% \item \xpgchoicekey[1.46]{spanishoperators}{\xpgdefaultvalue{all}, \xpgvalue{accented},
-% \xpgvalue{spaced}, \xpgvalue{none}, or \xpgpresetvalue{false}}
-% Determines of and how math operators are localized to Spanish.
-% \begin{itemize}
-% \item ¦accented¦ causes some math operators to use accents where usual in Spanish (\emph{lím},
-% \emph{lím\,sup}, \emph{lím\,inf}, \emph{máx}, \emph{mín}, \emph{ínf}, \emph{mód}).
-% \item ¦spaced¦ causes some math operators to use spaces where usual in Spanish (\emph{arc\,cos},
-% \emph{arc\,sen}, \emph{arc\,tg}).
-% \item ¦all¦ activates ¦accented¦ and ¦spaced¦ and furthermore provides Spanish localizations of
-% \cmd\sin\ (\emph{sen}), \cmd\tan\ (\emph{tg}), \cmd\sinh\ (\emph{senh}), and \cmd\tanh\ (\emph{tgh}).
-% \item ¦none¦ does no localization at all (default setting).
-% \end{itemize}
-% \end{itemize}
-% \paragraph*{\color{black}Commands:}\new{1.46}
-% \begin{itemize}
-% \item \Cmd\arcsen: alias to \cmd\arcsin\ (\pkg{babel} compatibility)
-% \item \Cmd\arctg: alias to \cmd\arctan\ (\pkg{babel} compatibility)
-% \item \Cmd\sen: alias to \cmd\sin\ (\pkg{babel} compatibility)
-% \item \Cmd\senh: alias to \cmd\sinh\ (\pkg{babel} compatibility)
-% \item \Cmd\tg: alias to \cmd\tan\ (\pkg{babel} compatibility)
-% \item \Cmd\tgh: alias to \cmd\tanh\ (\pkg{babel} compatibility)
-% \item \Cmd\spanishoperator: allows you to define further localized operators. For instance, ¦\spanishoperator{cotg}¦
-% defines a command \cmd\cotg\ that outputs \emph{cotg} in math. The optional argument of the command lets you specify the
-% spelling, if needed, \eg ¦\spanishoperator[arc\,ctg]{arcctg}¦.
-% \end{itemize}
-%
-% \subsection{syriac}\label{syriac}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey[1.0.1]{numerals}{\xpgpresetvalue{western} (\ie 1234567890), \xpgvalue{eastern}
-% (for which the Oriental Arabic numerals are used: \textarabic{١٢٣٤٥٦٧٨٩٠}), or
-% \xpgvalue{abjad}}
-% \item \xpgcodekey[1.63]{sectionsep}¦.¦
-% This option allows to customize the separator between chapters, sections, and subsections (a dot by default),
-% \eg \xpgoption{sectionsep=-}.
-% This might be useful particularly with \xpgoption{numerals=eastern}, as the dot looks too similar to the zero
-% in many fonts.
-% \end{itemize}
-% \paragraph*{Commands:}
-% \begin{itemize}
-% \item \Cmd\abjadsyriac (see section \ref{abjad})
-% \item \Cmd\aemph (see section \ref{arabic}).
-% \end{itemize}
-%
-% \subsection{thai}\label{thai}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{numerals}{\xpgvalue{thai} or \xpgpresetvalue{arabic}}
-% \end{itemize}
-% ^^A
-% To insert word breaks, you need to use an external processor.
-% See the documentation to \pkg{thai-latex} and the file \file{testthai.tex}
-% that comes with this package.
-%
-% \subsection{tibetan}\label{tibetan}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{numerals}{\xpgvalue{tibetan} or \xpgpresetvalue{arabic}}
-% \end{itemize}
-%
-% \subsection{ukrainian}\label{ukrainian}
-%
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgboolkeyfalse{babelshorthands}
-% If this is turned on, the following shorthands are activated:
-% \begin{shorthands}
-% \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
-% in the hyphenation patterns (as opposed to \cmd\-).
-% \item[¦"=¦] adds an explicit hyphen with a breakpoint, allowing for hyphenation at the
-% other points preset in the hyphenation patterns (as opposed to plain ¦-¦).
-% \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
-% cases where the hyphen should stick at the following syllable.
-% \item[¦"|¦] disables a ligature at this position.
-% \item[¦""¦] allows for a line break at this position (without hyphenation sign).
-% ^^A These are commented out in gloss-ukrainian
-% ^^A \item[¦",¦] thinspace for initials with a breakpoint in following surname.
-% ^^A \item[¦"‘¦] for German left double quotes (looks like ,,).
-% ^^A \item[¦"’¦] for German right double quotes (looks like “).
-% ^^A \item[¦"<¦] for French left double quotes (looks like <<).
-% ^^A \item[¦">¦] for French right double quotes (looks like >>).
-% \end{shorthands}
-%
-% There are also three shorthands for the Cyrillic dash (\textrussian{тире}), which is shorter than the
-% emdash but longer than the endash (namely 0.8\,em).
-% Note that, since it is not covered by unicode, this character is faked by telescoping two endashes:
-% \begin{shorthands}
-% \item[¦"---¦] Cyrillic dash for the use in normal text. This requires preceding space
-% in input (trailing space is optional) and prints with a non-breakable thin space before
-% and after the dash.
-% \item[¦"--\textasciitilde¦] Cyrillic dash for the use in compound names (surnames).
-% As opposed to ¦"---¦ this removes any space before and after the dash.
-% \item[¦"--*¦] Cyrillic dash for denoting direct speech. This adds a larger space after
-% the dash. Space before the dash is output as is.
-% \end{shorthands}
-% \item \xpgboolkeytrue[1.52]{mathfunctions}
-% By default, some specific math macros are defined for Ukrainian (see below). In order to prevent command
-% clashes (\eg with the \pkg{chemformula} package), you can switch these definitions off by passing \xpgvalue{false}
-% to this option.
-% \item \xpgchoicekey{numerals}{\xpgpresetvalue{arabic}, \xpgvalue{cyrillic-alph} or \xpgvalue{cyrillic-trad}}
-% Uses either Arabic numerals or Cyrillic alphanumerical numbering. The two Cyrillic variants differ as follows:
-% \begin{itemize}
-% \item \xpgvalue{cyrillic-alph} steps through the Cyrillic alphabet. Thus it can only be used up to 30.
-% \item \xpgvalue{cyrillic-trad} (= \xpgvalue{cyrillic}) uses a traditional Cyrillic alphanumeric system.%
-% \footnote{See \url{https://en.wikipedia.org/wiki/Cyrillic_numerals}.}
-% It supports numbers up to 999\,999.
-% \end{itemize}
-% \end{itemize}
-% ^^A
-% \paragraph*{Commands:}
-% \begin{itemize}
-% \item \Cmd\Asbuk: produces uppercased Cyrillic alphanumerals, for environments such as ¦enumerate¦.
-% It steps through the Cyrillic alphabet and thus it can only be used up to 30.
-% The command takes a counter as argument, \eg ¦\textukrainian{\Asbuk{section}}¦ produces \textrussian{\Asbuk{section}}.
-% \item \Cmd\asbuk: same as \cmd\Asbuk\ but in lowercase.
-% \item \Cmd\AsbukTrad: same as \cmd\Asbuk\ but using the traditional Cyrillic alphanumeric numbering which supports
-% numbers up to 999\,999.\\
-% \Eg ¦\textukrainian{\AsbukTrad{page}}¦ produces \textrussian{\AsbukTrad{page}}.
-% \item \Cmd\asbukTrad: same as \cmd\AsbukTrad\ but in lowercase.
-% \end{itemize}
-% ^^A
-% If the \xpgoption{mathfunctions} option is \xpgvalue{true}, loading Ukrainian defines a few macros than can be used
-% independently of the current language. These are nine macros to be used in math mode to type the names of
-% trigonometric functions common for Ukrainian documents: \cmd\sh , \cmd\ch , \cmd\tg , \cmd\ctg , \cmd\arctg ,
-% \cmd\arcctg , \cmd\th , \cmd\cth , and \cmd\cosec . Cyrillic letters in math mode can be typed with
-% the aid of text commands such as \cmd\textbf , \cmd\textsf , \cmd\textit , \cmd\texttt , etc.
-% The macros \cmd\Prob , \cmd\Variance , \cmd\NOD , \cmd\nod , \cmd\NOK , \cmd\nok , \cmd\NSD , \cmd\nsd , \cmd\NSK ,
-% \cmd\nsk , \cmd\Proj\ print some rare
-% Ukrainian mathematical symbols.
-%
-% \subsection{urdu}\label{urdu}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{calendar}{\xpgpresetvalue{gregorian} or \xpgvalue{hijri}}
-% \item \xpgoptkey{hijricorrection}{integer}[0]
-% If \xpgvalue{calendar=hijri} is selected, \cmd{\today} will output the date
-% according to the lunar Islamic (Hijra) calendar. This option allows to shift the day of the output with respect
-% to the current date. Both positive and negative integer values are allowed (negative decrease the day value).
-% This corresponds to the optional argument of the \cmd{\Hijritoday} command which can be used to output Hijri
-% dates irrespective of the \xpgvalue{calendar} option (see sec.~\ref{sec:hijrical}).
-% \item \xpgchoicekey{numerals}{\xpgvalue{western} or \xpgpresetvalue{eastern}}
-% \item \xpgcodekey[1.63]{sectionsep}¦.¦
-% This option allows to customize the separator between chapters, sections, and subsections (a dot by default),
-% \eg \xpgoption{sectionsep=-}.
-% This might be useful particularly with \xpgoption{numerals=eastern}, as the dot looks too similar to the zero
-% in many fonts.
-% \item \xpgboolkeyfalse{abjadjimnotail}
-% Set this to \xpgvalue{true} if you want the \textit{abjad} form of the number three to
-% be \textarabic{ج‍} – as in the manuscript tradition – instead of the
-% modern usage \textarabic{ج}.
-% \end{itemize}
-%
-% \subsection{uyghur}\label{uyghur}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey[1.53]{chapterformat}{\xpgdefaultvalue{\xpgpresetvalue{ordinal}},
-% \xpgvalue{roman}, \xpgvalue{arabic}}
-% In Uyghur, chapter and part headings usually use ordinals rather than numbers. Alternatively Roman numbers
-% are common as well. By default, \pkg{polyglossia} uses ordinals.
-% This option allows to change this. Choices are:
-% \begin{itemize}
-% \item ¦ordinal¦: Use ordinals for chapter and part headings (=~default setting)
-% \item ¦roman¦: Use Roman numbering for chapter and part heading.
-% \item ¦arabic¦: Use Arabic numbering for chapter and part heading (=~LaTeX default).
-% \end{itemize}
-% Note that this option only works if \xpgoption{swapstrings} is set to \xpgvalue{all}, \xpgvalue{headings} or
-% \xpgvalue{hheaders}. The caveats for that options (see below) apply.
-% \item \xpgchoicekey[1.53]{swapstrings}{\xpgdefaultvalue{\xpgpresetvalue{all}},
-% \xpgvalue{captions}, \xpgvalue{headings}, \xpgvalue{headers}, \xpgvalue{hheaders}, or \xpgvalue{none}}
-% In Uyghur, table and figure caption strings need to be in a different order and format than in other languages.
-% By default, \pkg{polyglossia} provides the correct for different classes and packages (standard classes, \pkg{KOMA-script},
-% \pkg{memoir}, and \pkg{titlesec} package should work, as well as \pkg{fancyhdr} and \pkg{caption}).
-% However, since the definition of these strings is not standardized, the redefinitions might not work
-% and even interfere badly if you use specific classes or packages that redefine the respective strings
-% themselves. In this case, you can disable some or all changes.
-% The possibilities are:
-% \begin{itemize}
-% \item ¦all¦: Redefine figure and table captions, part and chapter headings, and running headers (=~default setting)
-% \item ¦captions¦: Redefine figure and table captions only
-% \item ¦headings¦: Redefine part and chapter headings only
-% \item ¦headers¦: Redefine running headers only
-% \item ¦hheaders¦: Redefine part and chapter headings as well as running headers
-% \item ¦none¦: Do not redefine anything
-% \end{itemize}
-% \end{itemize}
-% ^^A
-% \paragraph*{Commands:}
-% \begin{itemize}
-% \item \Cmd\uyghurordinal: outputs Uyghur ordinals. Supported input: integer numbers in the range of 1--100.
-% \item \Cmd\uyghurord: same as \cmd\uyghurordinal\ but with counter as input (\eg ¦\textuyghur{\uyghurord{page}}¦).
-% \end{itemize}
-%
-% \subsection{welsh}\label{welsh}
-% \paragraph*{Options:}
-% \begin{itemize}
-% \item \xpgchoicekey{date}{\xpgvalue{long} or \xpgpresetvalue{short}}
-% \end{itemize}
-%
-%
-% \section{Modifying or extending captions, date formats and language settings}
-%
-% \pkg{Polyglossia} uses the following macros to define language-specific captions
-% (\ie strings such as ``chapter''), date formats and additional language settings
-% (\meta{lang} is to be replaces with the respective language name):
-%
-% \begin{itemize}
-% \item \Cmd{\captions\meta{lang}} stores definitions of caption strings
-% (such as, in the case of English, ¦\def\chaptername{Chapter}¦)
-% \item \Cmd{\date\meta{lang}} stores definitions of date formats (usually redefinitions
-% of \cmd\today, in some cases also definitions of additional date commands)
-% \item \Cmd{\blockextras@\meta{lang}} stores macros that are to be executed when the language
-% \meta{lang} is activated via \cmd\selectlanguage\ command or the \meta{lang} environment
-% \item \Cmd{\inlineextras@\meta{lang}} stores macros that are to be executed when the language
-% \meta{lang} is activated locally via \cmd\text\meta{lang} command
-% \item \Cmd{\noextras@\meta{lang}} stores macros that are to be executed when the language
-% \meta{lang} is closed
-% \end{itemize}
-% ^^A
-% In order to redefine internal macros, we recommend to use the command \cmd\gappto.
-% For compatibility with \pkg{babel} the command \cmd\addto\ is also available
-% to the same effect. For instance, to change the \cmd\chaptername\ for language ¦lingua¦,
-% you can do this:
-% \begin{verbatim}
-% \gappto\captionslingua{\def\chaptername{Caput}}
-% \end{verbatim}
-% ^^A
-% Note that this needs to be done after the respective language has been loaded with
-% \cmd\setmainlanguage\ or \cmd\setotherlanguage.
-%
-% Specifically for package authors, analogous commands are provided which are only executed
-% if a specific language \emph{variety} is used. As opposed to the macros above, these refer
-% to babel names. Other than that, the function is identical:
-%
-% \begin{itemize}
-% \item \Cmd{\captions@bbl@\meta{babelname}}
-% \item \Cmd{\date@bbl@\meta{babelname}}
-% \item \Cmd{\blockextras@bbl@\meta{babelname}}
-% \item \Cmd{\inlineextras@bbl@\meta{babelname}}
-% \item \Cmd{\noextras@bbl@\meta{babelname}}
-% \end{itemize}
-% ^^A
-% By default, these macros are undefined. If they are defined (\eg by an external package),
-% they will be executed after their respective \meta{lang} counterpart and thus can be used to
-% overwrite definitions of the former. Again, use \cmd\gappto\ to define\slash modify these macros.
-% For instance, to add a new caption \cmd\footnotename\ to the Swiss variety of German (babel name
-% ¦nswissgerman¦), you can do this:
-% \begin{verbatim}
-% \gappto\captions@bbl@nswissgerman{\def\footnotename{Fussnote}}
-% \end{verbatim}
-% ^^A
-% If you do this in a document preamble rather than in a package, you need to embrace the redefinition
-% by \cmd\makeatletter\ and \cmd\makeatother\ due to the ¦@¦ in the macro names.
-%
-% Finally, as soon as the language has been switched (either inline or as a block), \pkg{polyglossia}
-% executes the (by default empty) hook
-% \begin{itemize}
-% \item \cmd{\polyglossia@language@switched}\DescribeMacroCust{\scriptsize}{\polyglossia@language@switched}
-% \end{itemize}
-% to which you can append arbitrary code (via \cmd\gappto) that should be executed if (a particular)
-% language is being activated. This is done before any of the above
-% macros are issued (so you can still alter them), but at a point where \cmd\languagename, \cmd\babelname\
-% and \cmd\languageid\ are already set, so you can condition on specific languages in your code.
-% This hook is particularly provided for package authors.
-%
-% \section{Script-specific numbering}
-%
-% Languages and scripts have specific numbering conventions. Some use decimal digits
-% (\eg Arabic numerals), some use alphabetic or alphanumerical notation (\eg Roman numbering).
-% In some cases, different conventions are available (\eg Mashriq or Maghrib numbering
-% in Arabic script, Arabic or Hebrew [=~alphanumeric] numbering in Hebrew).
-%
-% If the latter is the case, \pkg{polyglossia} provides language options which allow you to select
-% or switch to the suitable convention. With the appropriate language option set, \pkg{polyglossia}
-% will automatically convert the output of internal \LaTeX\ counters to their
-% localized forms, for instance to display page, chapter and section numbers.
-%
-% For manual input of numbers, macros are provided. These convert Arabic numeric input to the respective
-% local decimal digit (see sec.~\ref{sec:decdigit}), alphanumeric representation (see sec.~\ref{abjad})
-% or whatever is appropriate (see sec.~\ref{sec:localnumber}). The possibilities are described in turn.
-%
-% \subsection{General localization of numbering}\label{sec:localnumber}
-%
-% As of 1.45,\new{1.45} \pkg{polyglossia} provides a generic macro \Cmd\localnumeral\ which converts numbers
-% to the current local form (which might be script-specific decimal digit, an alphabetic numbering or something else).
-% For instance in an Arabic environment
-% ¦\localnumeral{42}¦ yields \textarabic{\localnumeral{42}}, whereas in an Hebrew environment, it
-% results in \texthebrew[numerals=hebrew]{\localnumeral{42}} with ¦numerals=hebrew¦, and \texthebrew{\localnumeral{42}}
-% with ¦numerals=arabic¦. Note that, as opposed to the various ¦digits¦ macros (described in sec.~\ref{sec:decdigit}),
-% the argument of \cmd\localnumeral\ must consist of numbers only.
-%
-% For\new{1.45} the conversion of counters, the starred version \Cmd{\localnumeral*} is provided. This takes a counter as argument.
-% For instance in an Arabic environment ¦\localnumeral*{page}¦ yields \textarabic{\localnumeral*{page}}.
-%
-% For scripts with alphanumeric numbering, the variants \Cmd{\Localnumeral} and \Cmd{\Localnumeral*} provide the uppercased
-% versions.\medskip
-%
-% \noindent All these macros provide the following options:
-%
-% \begin{itemize}
-% \item \DescribeMacro{[lang=]}\xpgchoicekey{lang}{\xpgpresetvalue{local}, \xpgvalue{main},
-% or \xpgvalue{\meta{language}}}
-% Output number in the local form of the currently active language for
-% ¦local¦, the main language of the document for ¦main¦, and any (loaded)
-% language for \meta{language} (\eg ¦\localnumeral[lang=arabic]{42}}¦).
-% \end{itemize}
-%
-% \subsection{Non-Western decimal digits}\label{sec:decdigit}
-%
-% In addition\new{1.1.1} to the generic macros described above, \pkg{polyglossia} provides language-specific conversion macros
-% which can be used if the generic ones do not suit the need.\footnote{%
-% A third method are so-called TECKit fontmappings.
-% Those can be activated with the \pkg{fontspec} ¦Mapping¦ option,
-% using ¦arabicdigits¦, ¦farsidigits¦ or ¦thaidigits¦.
-% For instance if \cmd\arabicfont\ is defined with the option ¦Mapping=arabicdigits¦,
-% typing \cmd{\textarabic\{2010\}} results in \textarabic{٢٠١٠}. Note that this method has some drawbacks, though,
-% for instance when the value of a counter has to be written and read from auxiliary files.
-% So please use this with care.}
-% The macros have the form \cmd{\⟨script⟩digits}. They convert Arabic numerical input and leave every other input untouched.
-% In an Arabic context, for instance, ¦\arabicdigits{9182/738543-X}¦ yields \textarabic{\arabicdigits{9182/738543-X}}.
-%
-% Currently, the following macros are provided:
-%
-% \begin{itemize}
-% \item \Cmd\arabicdigits
-% \item \Cmd\bengalidigits
-% \item \Cmd\devanagaridigits
-% \item \Cmd\farsidigits
-% \item \Cmd\gurmukhidigits
-% \item \Cmd\kannadadigits
-% \item \Cmd\khmerdigits
-% \item \Cmd\laodigits
-% \item \Cmd\nkodigits
-% \item \Cmd\odiadigits
-% \item \Cmd\thaidigits
-% \item \Cmd\tibetandigits
-% \end{itemize}
-%
-%
-% \subsection{Non-Latin alphabetic numbering}\label{abjad}
-%
-% For languages which use special (non-Latin) alphanumerical notation\footnote{%
-% For instance, see \url{http://en.wikipedia.org/wiki/Greek_numerals},
-% \url{http://en.wikipedia.org/wiki/Abjad_numerals},
-% \url{http://en.wikipedia.org/wiki/Hebrew_numerals},
-% and \url{http://en.wikipedia.org/wiki/Syriac_alphabet}.}, dedicated macros are provided.
-%
-% They work in a similar way than the \cmd{\⟨script⟩digits} macros described above: They take Arabic numerical input
-% and output the respective value in the local alphabetic numbering scheme (most of these macros are equivalent
-% to \cmd\localnumeral\ and \cmd\Localnumeral\ in the respective context).
-%
-% The following macros are provided:
-%
-% \begin{itemize}
-% \item \Cmd\abjad outputs Arabic \textit{abjad} numbers according to the Mashriq varieties.
-% Example: ¦\abjad{1863}¦ yields \textarabic{\abjad{1863}}.
-%
-% \item \Cmd\abjadmaghribi outputs Arabic \textit{abjad} numbers according to the Maghrib varieties.
-% Example: ¦\abjadmaghribi{1863}¦ yields \textarabic{\abjadmaghribi{1863}}.
-%
-% \item \Cmd\abjadsyriac outputs Syriac abjad numerals.\footnote{%
-% A fine guide to numerals in Syriac can be found at \link{http://www.garzo.co.uk/documents/syriac-numerals.pdf}.}\\
-% Example: ¦\abjadsyriac{463}¦ yields \textsyriac{\abjadsyriac{463}}.
-%
-% \item \Cmd\armeniannumeral produces Armenian alphabetic numbering.
-% Example: ¦\armeniannumeral{1863}¦ yields \textarmenian{\armeniannumeral{1863}}.
-%
-% \item \Cmd\belarusiannumeral produces Belarusian numbering, with uppercased variant (for alphanumerical variant) via \Cmd\Belarusiannumeral.
-% Depending on the ¦numerals¦ option in the Belarusian language selection, this is either Arabic digit or Cyrillic
-% alphanumercial output.\\
-% Example: With ¦numerals=latin¦ ¦\belarusiannumeral{19}¦ yields \textrussian{\russiannumeral{19}},
-% with ¦numerals=cyrillic-trad¦ ¦\belarusiannumeral{19}¦ results in \textrussian[numerals=cyrillic-trad]{\russiannumeral{19}},\\
-% with ¦numerals=cyrillic-alph¦ ¦\belarusiannumeral{19}¦ results in \textrussian[numerals=cyrillic-alph]{\russiannumeral{19}}.
-%
-% \item \Cmd\chinesenumeral produces Chinese numbering which, depending on the ¦numerals¦ option in the Chinese language selection,
-% produces is either Arabic digit or Chinese ideographic output.\\
-% Example: With ¦numerals=arabic¦ ¦\chinesenumeral{753}¦ yields \textchinese[numerals=arabic]{\chinesenumeral{753}},
-% with ¦numerals=chinese¦ ¦\chinesenumeral{753}¦ results in \textchinese[numerals=chinese]{\chinesenumeral{753}}.
-%
-% \item \Cmd\georgiannumeral produces Georgian alphabetic numbering.\\
-% Example: ¦\georgiannumeral{1863}¦ yields \textgeorgian{\georgiannumeral{1863}}.
-%
-% \item \Cmd\greeknumeral produces Greek alphabetic numbering, \Cmd\Greeknumeral outputs uppercased variants.
-% Example: ¦\greeknumeral{1863}¦ yields \textgreek{\greeknumeral{1863}},
-% ¦\Greeknumeral{1863}¦ results in \textgreek{\Greeknumeral{1863}}.
-%
-% \item \Cmd\hebrewnumeral, \Cmd\Hebrewnumeral and \Cmd\Hebrewnumeralfinal produce variants of Hebrew alphanumeric numerals.
-% The commands behave identical as in \pkg{babel}: \cmd\hebrewnumeral\ outputs the numbers without any decoration at all,
-% \cmd\Hebrewnumeral\ adds \textit{gereshayim} before the last letter, and \cmd\Hebrewnumeralfinal\ uses in addition the final
-% forms of Hebrew letters.
-% Examples:
-% ¦\hebrewnumeral{1750}¦ yields \texthebrew{\hebrewnumeral{1750}},
-% ¦\Hebrewnumeral{1750}¦ yields \texthebrew{\Hebrewnumeral{1750}},
-% and ¦\Hebrewnumeralfinal{1750}¦ yields \texthebrew{\Hebrewnumeralfinal{1750}}.
-%
-% \item \Cmd\mongoliannumeral produces Mongolian numbering, with uppercased variant (for alphanumerical variant) via \Cmd\Mongoliannumeral.
-% Depending on the ¦numerals¦ option in the Mongolian language selection, this is either Arabic digit or Cyrillic
-% alphanumercial output.\\
-% Example: With ¦numerals=latin¦ ¦\mongoliannumeral{19}¦ yields \textrussian{\russiannumeral{19}},
-% with ¦numerals=cyrillic-trad¦ ¦\mongoliannumeral{19}¦ results in \textrussian[numerals=cyrillic-trad]{\russiannumeral{19}},\\
-% with ¦numerals=cyrillic-alph¦ ¦\mongoliannumeral{19}¦ results in \textrussian[numerals=cyrillic-alph]{\russiannumeral{19}}.
-%
-% \item \Cmd\punjabinumeral produces Punjabi numbering, depending on the setting of the ¦numerals¦ option in the Punjabi language
-% selection, this is either Gurmukhi or Arabic (Western).
-%
-% \item \Cmd\russiannumeral produces Russian numbering, with uppercased variant (for alphanumerical variant) via \Cmd\Russiannumeral.
-% Depending on the ¦numerals¦ option in the Russian language selection, this is either Arabic digit or Cyrillic
-% alphanumercial output.\\
-% Example: With ¦numerals=latin¦ ¦\russiannumeral{19}¦ yields \textrussian{\russiannumeral{19}},
-% with ¦numerals=cyrillic-trad¦ ¦\russiannumeral{19}¦ results in \textrussian[numerals=cyrillic-trad]{\russiannumeral{19}},\\
-% with ¦numerals=cyrillic-alph¦ ¦\russiannumeral{19}¦ results in \textrussian[numerals=cyrillic-alph]{\russiannumeral{19}}.
-%
-% \item \Cmd\serbiannumeral produces Serbian numbering, with uppercased variant (for alphanumerical variant) via \Cmd\Serbiannumeral.
-% Depending on the ¦numerals¦ option in the Serbian language selection, this is either Arabic digit or Cyrillic
-% alphanumercial output.\\
-% Example: With ¦numerals=latin¦ ¦\serbiannumeral{19}¦ yields \textrussian{\serbiannumeral{19}},
-% with ¦numerals=cyrillic-trad¦ ¦\serbiannumeral{19}¦ results in \textrussian[numerals=cyrillic-trad]{\serbiannumeral{19}},\\
-% with ¦numerals=cyrillic-alph¦ ¦\serbiannumeral{19}¦ results in \textrussian[numerals=cyrillic-alph]{\serbiannumeral{19}}.
-%
-% \item \Cmd\ukrainiannumeral produces Ukrainian numbering, with uppercased variant (for alphanumerical variant) via \Cmd\Ukrainiannumeral.
-% Depending on the ¦numerals¦ option in the Ukrainian language selection, this is either Arabic digit or Cyrillic
-% alphanumercial output.\\
-% Example: With ¦numerals=latin¦ ¦\ukrainiannumeral{19}¦ yields \textrussian{\russiannumeral{19}},
-% with ¦numerals=cyrillic-trad¦ ¦\ukrainiannumeral{19}¦ results in \textrussian[numerals=cyrillic-trad]{\russiannumeral{19}},\\
-% with ¦numerals=cyrillic-alph¦ ¦\ukrainiannumeral{19}¦ results in \textrussian[numerals=cyrillic-alph]{\russiannumeral{19}}.
-% \end{itemize}
-%
-%
-% \section{Footnotes in right-to-left context}
-%
-% With languages that use right-to-left scripts, footnote apparatuses are usually placed at the right side of the page bottom.
-% Consequently, the footnote rule also is to be placed right. Things get more tricky, though, if right-to-left and left-to-right
-% scripts are mixed. Then you might want to put the footnotes on some pages left, on some right, or even mix positions on a page.
-% Thus, footnote handling in right-to-left context sometimes needs manual intervention. This is described in what follows.
-%
-% \subsection{Horizontal footnote position}
-%
-% When right-to-left languages are used, the \cmd\footnote\ command becomes sensitive to the text directionality. The footnote is
-% always placed on the side that is currently the origin of direction: on the left side of the page in LTR paragraphs and
-% on the right in RTL paragraphs.
-%
-% For cases where this is not desired, two additional footnote commands are provided: \Cmd\RTLfootnote and \Cmd\LTRfootnote.
-% \cmd\LTRfootnote\ always places the footnote on the left side, notwithstanding the current
-% directionality. Likewise, \cmd\RTLfootnote\ always places it on the right side. Like \cmd\footnote, \cmd\RTLfootnote\
-% and \cmd\LTRfootnote\ provide an optional argument to customize the number.
-%
-%
-% \subsection{Footnote rule length and position}
-%
-% The default placement of the footnote rule differs in \XeTeX\ and \LuaTeX\ output (this is due to differences in the \textsf{bidi}
-% and \textsf{luabidi} packages). With \XeTeX, footnote rules are always placed left, which is often wrong in RTL context.
-% With \LuaTeX, by contrast, the rule is placed always right if the main language is a right-to-left language, and always left
-% if the main language is a left-to-right language, which is the right thing in many cases.
-%
-% In both cases, you can change the default behavior as follows:
-% \begin{itemize}
-% \item Put \Cmd\leftfootnoterule in the preamble to have all rules left-aligned.
-% \item Put \Cmd\rightfootnoterule in the preamble to have all rules right-aligned.
-% \item Put \Cmd\autofootnoterule in the preamble to have automatic placement depending on the context (see below for elaboration).
-% \item Put \Cmd\textwidthfootnoterule in the preamble to have a rule that spans the whole text width.
-% \end{itemize}
-% With \cmd\autofootnoterule, the first footnote on the current page determines the placement. Note that this automatic can fail with
-% footnotes at page boundaries that differ in directionality from the first footnote on the page. You can work around such cases by switching to \cmd\rightfootnoterule\ or \cmd\leftfootnoterule\ on these pages.
-%
-% Note also that the rule switches might interfere in bad ways with packages or classes that redefine footnotes themselves. This is also the reason
-% why \cmd\autofootnoterule\ is not used by default.
-%
-%
-% \section{Calendars}
-%
-% \subsection{Hebrew calendar (hebrewcal.sty)}
-% The package \file{hebrewcal.sty} is almost a verbatim copy of \file{hebcal.sty}
-% that comes with \pkg{babel}.
-% The command \Cmd\Hebrewtoday\ formats the current date in the Hebrew calendar
-% (depending of the current writing direction this will automatically set either
-% in Hebrew script or in roman transliteration).
-%
-% \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}
-% (Cambridge University Press, 2001).\label{reingold}}
-% It provides two macros for the end-user.
-% The command
-% \displaycmd{\HijriFromGregorian\marg{year}\marg{month}\marg{day}}{\HijriFromGregorian}
-% sets the counters ¦Hijriday¦, ¦Hijrimonth¦ and ¦Hijriyear¦.
-% \Cmd\Hijritoday\ formats the Hijri date for the current day.
-% This command is now locale-aware\new{1.1.1}: its output will differ depending on the
-% currently active language. Presently \pkg{polyglossia}’s language definition files
-% for Arabic, Farsi, Urdu, Turkish and Malay provide a localized version of \cmd\Hijritoday.
-% If the formatting macro for the current language is undefined, the Hijri date will be formatted
-% in Arabic or in roman transliteration, depending of the current writing direction.
-% You can define a new format or redefine one with the command
-% \displaycmd{\DefineHijriDateFormat\marg{lang}\marg{code}.}{\DefineHijriDateFormat}
-%
-% The command \cmd\Hijritoday\ also accepts an optional argument to add or subtract a correction
-% (in days) to the date computed by the arithmetical algorithm.\footnote{ %
-% The Islamic calendar is indeed a purely lunar calendar based on the observation
-% of the first visibility of the lunar crescent at the beginning of the lunar month,
-% so there can be differences between different localities, as well as between
-% civil and religious authorities.}
-% For instance if \cmd\Hijritoday\ yields the date “7 Rajab 1429” (which is the date that was
-% displayed on the front page of \href{http://www.aljazeera.net}{aljazeera.net} on
-% 11th July 2008), ¦\Hijritoday[1]¦ would rather print “8 Rajab 1429” (the date
-% indicated the same day on the site \href{http://www.gulfnews.com}{gulfnews.com}).
-%
-% \subsection{Farsi (jalālī) calendar (farsical.sty)}
-% This package is an almost verbatim copy of ¦Arabiftoday.sty¦ (in the \pkg{Arabi} package),
-% itself a slight modification of ¦ftoday.sty¦ in Farsi\TeX.\footnote{ %
-% One day we may rewrite \pkg{farsical} from scratch using the algorithm in
-% Reingold \& Gershowitz (ref.~n.\,\ref{reingold}).}
-% Here we have renamed the command \cmd\ftoday\ to
-% \Cmd\Jalalitoday.
-% Example: today is \Jalalitoday.
-%
-%
-% \section{Auxiliary commands}
-%
-% The macro\new{1.47} \displaycmd{\charifavailable\marg{char code}\marg{substitution}}{\charifavailable} checks whether
-% the character with the specified \meta{char code} (\ie unicode utf-16 code without preceding ¦0x¦) exists in
-% the current font. If so, the character is printed, if not, the \meta{substitution} is printed.
-%
-% Example: ¦\charifavailable{1E9E}{SS}¦ prints the capital version of the German letter ⟨ß⟩ if available
-% (\ie \charifavailable{1E9E}{SS}), else it prints the substitution digraph SS.
-%
-% With the test\new{1.66} \displaycmd{\IfCharIsAvailableTF\marg{char code}\marg{true condition}\marg{false condition}}{\IfCharIsAvailableTF}
-% you can test for the availability of a character and execute different code depending whether or not this is the case
-% (this replaces the undocument internal command \cmd{\xpg@if@char@available}).
-%
-%
-% \section{Accessing language information}\label{sec:langinfo}
-%
-% The following is specifically relevant to package authors who need information about the languages in use
-% and the details of the respective locale.
-% In order to get such information, the recommended way is to use the \Cmd{\BCPdata\marg{type}}\new{1.61}
-% command to get (parts of) the BCP-47 language tag. This command is used by the \LaTeX\ kernel as of 6/2023,
-% and the syntax is standardized at least between \pkg{babel} and \pkg{polyglossia}.
-%
-% \cmd\BCPdata\ supports the following \marg{type} arguments:
-% \begin{itemize}
-% \item \xpgoption{language} The language subtag (\eg \texttt{de})
-% \item \xpgoption{region} The region subtag (\eg \texttt{AT})
-% \item \xpgoption{script} The script subtag (\eg \texttt{Latn})
-% \item \xpgoption{variant} The variant subtag (\eg \texttt{1901} for German old spelling)
-% \item \xpgoption{extension.t} The subtag indicating transformation between languages or scripts
-% (\eg \texttt{ja} as in \texttt{en-t-ja}: English transformed to Japanese)
-% \item \xpgoption{extension.u} The subtag indicating additional locale information (\eg \texttt{nu-latn} as in \texttt{ar-u-nu-latn}:
-% Arabic with Latin Numbering)
-% \item \xpgoption{extension.x} The private usespace subtag (\eg \texttt{classic} as in \texttt{la-x-classic} for classic Latin)
-% \item \xpgoption{casing} is a special semantic value which returns whatever is considered suitable
-% for casing commands such as \cmd\MakeUppercase. In many cases, this is identical to \texttt{language} but
-% it could also be something more specific such as \texttt{el-x-iota} or \texttt{ckb-Latn} if this is
-% needed for proper casing. Note that this information is retrieved by the \LaTeX\ kernel for casing as
-% of 06/2023.
-% \item \xpgoption{tag} returns the registered full tag (identical to \cmd\languageid\ below). This however omits
-% certain subtags if these are considered obvious (\eg for German, only \texttt{de-DE} is returned, although
-% script [\texttt{Latn}] and variant [\texttt{1996}] are defined as well).
-% \end{itemize}
-% If a subtag is not defined for a given language, an empty string is returned.
-%
-% The values above return information for the language currently in use. If you need to access information for the
-% main language of the document, prepend \xpgoption{main.} to the respective argument (\eg \xpgoption{main.language}). This works
-% for all supported arguments.
-%
-% Next to \cmd\BCPdata, \pkg{polyglossia} provides the following legacy macros which are partly unique to \pkg{polyglossia},
-% partly re-implementations of legacy \pkg{babel} commands:
-%
-% \begin{itemize}
-% \item \Cmd\languagename\ stores the currently active (polyglossia) language name.
-% \item \Cmd\mainlanguagename\ stores the (polyglossia) language name of the main document language.
-% \item \Cmd\languagevariant\ stores the language variant if set. The macro is empty if no variant has been set.
-% \item \Cmd\mainlanguagevariant\ stores the language variant of the main document language if set.
-% The macro is empty if no variant has been set.
-% \item \Cmd\babelname\ stores the corresponding name of the currently active language (variant) in \pkg{babel}.
-% This might not only be useful if you want to support both \pkg{babel} and \pkg{polyglossia}, but also
-% since this name is unique for a given language variety (\eg ngerman, german, swissgerman etc.).
-% Note that this macro is also defined for languages that are not supported in \pkg{babel}. In that
-% case, they are equal to the polyglossia language name.
-% \item \Cmd\mainbabelname\ analogously stores the name of document's main language (variant) in \pkg{babel}.
-% \item \Cmd{\languageid\marg{type}}\new{1.47} stores the identifier tag of the current language. Currently supported \meta{types}:
-% \begin{itemize}
-% \item ¦bcp-47¦ (alias ¦bcp47¦): IETF BCP-47 language identifier
-% \end{itemize}
-% \item \Cmd{\mainlanguageid\marg{type}}\new{1.47} stores identifier tag of the main language. Currently supported \meta{types}:
-% see \cmd\languageid.
-% \end{itemize}
-% \bigskip
-%
-% \noindent If you want to have a full list of loaded languages/variants, use the following macros:
-% \begin{itemize}
-% \item \Cmd{\xpg@loaded}\ stores a comma-separated list of all loaded languages (polyglossia name)
-% \item \Cmd{\xpg@vloaded}\ stores a comma-separated list of all loaded variants
-% \item \Cmd{\xpg@bloaded}\ stores a comma-separated list of \pkg{babel} names of all language variants
-% \item \Cmd{\xpg@bcp@loaded}\new{1.47}\ stores a comma-separated list of the BCP-47 IDs of all language variants
-% \end{itemize}
-% \bigskip
-%
-% \noindent Whether a language is loaded can be tested by
-% \displaycmd{\iflanguageloaded\marg{lang}\marg{true}\marg{false}}{\iflanguageloaded}
-% where \texttt{\meta{lang}} is a \pkg{polyglossia} language name, by
-% \displaycmd{\ifbabellanguageloaded\marg{lang}\marg{true}\marg{false}}{\ifbabellanguageloaded}
-% where \texttt{\meta{lang}} is a \pkg{babel} language name (see table~\ref{tab:bbllang} on p.~\pageref{tab:bbllang}), or by\new{1.47}
-% \displaycmd{\iflanguageidloaded\marg{type}\marg{id}\marg{true}\marg{false}}{\iflanguageidloaded}
-% where \meta{type} is a supported language id type (such as ¦bcp-47¦) and \meta{id} is a language id
-% (such as ¦en-US¦; see table~\ref{tab:BCP47-polyglossia} on p.~\pageref{tab:BCP47-polyglossia}).
-% \bigskip
-%
-% \noindent Finally, if you want to know whether a specific language option has been set, you can use\new{1.47}
-% \displaycmd{\iflanguageoption\marg{lang}\marg{key}\marg{value}\marg{true}\marg{false}}{\iflanguageoption}
-%
-%
-% \section{Revision history}
-%
-% \bgroup\footnotesize
-%
-% \subsection*{2.1 (2024/03/07)}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Make \cmd{\foreignlanguage} \cmd{\long} again (\TXI{622}).
-% \item Fix \texttt{otherlanguage*} environment (\TXI{622}).
-% \end{itemize}
-%
-% \subsection*{2.0 (2024/02/17)}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Fix error with undefined property list that unhides with
-% \pkg{l3kernel} version 2024-02-13 (\TXI{626}).
-% \item Fix \xpgoption{frenchfootnote} option (\TXI{620}).
-% \item The error message on improper font setting is now
-% correct if the main script is non-Latin, for
-% non-Roman fonts (\TXI{571}), and specifically for
-% the CJK case (\TXI{621}).
-% \item Fix expansion of localnumeral (\TXI{622}).
-% \end{itemize}
-%
-% \subsubsection*{New Features}
-% \begin{itemize}
-% \item Add \cmd{\inheritbabelshorthands} (\TXI{604}).
-% \item Add \cmd{\usebabelshorthands}.
-% \item Add shorthands for German gender-sensitive writing.
-% \item Implement \pkg{babel}-style hyphenation for Finnish.
-% \end{itemize}
-%
-% \subsubsection*{Documentation improvements}
-% \begin{itemize}
-% \item Fix documentation of Finnish shorthands (\TXI{623}).
-% \end{itemize}
-%
-% \subsubsection*{Internal work}
-% \begin{itemize}
-% \item The package code has been subjected to a major rewrite.
-% Code has been cleaned up, and in general, \pkg{polyglossia}
-% more consistently employs \pkg{latex3} now. Note that this is
-% an ongoing and yet unfinished project that will continue over
-% the next releases.
-% \end{itemize}
-%
-%
-% \subsection*{1.66 (2023/12/11)}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Fix OpenType language and script tags in Chinese (\TXI{606}).
-% \item Fix resetting of language specifications at the end of a local font
-% set with \pkg{babel} legacy means (\cmd{\foreignlanguage} or \texttt{otherlanguage*}
-% environment) (\TXI{607}).
-% \item Fix lowercasing of \cmd{\textlang}'s first mandatory argument.
-% Now the casing does not change (language tag was lower-cased always) (\TXI{608}).
-% \item Add missing BCP-47 alias for Khmer (\TXI{611}).
-% \item Stop \cmd{\charifavailable} from looking ahead for more numbers or gobbling a space (\TXI{613}).
-% \end{itemize}
-%
-% \subsubsection*{New Features}
-% \begin{itemize}
-% \item Add support for Odia, provided by \TA{Avisek Jena} and \TA{Ashok Das}.
-% \item New auxiliary package ¦odiadigits¦
-% \item Add auxiliary command \cmd{\IfCharIsAvailableTF} to complement \cmd{\charifavailable}.
-% \end{itemize}
-%
-% \subsection*{1.65 (2023/10/01)}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Fix spurious space in Hebrew captions (\TXP{601}).
-% \item Fix resetting of language specifications at end of inline switch
-% (\TXI{603}).
-% \end{itemize}
-%
-% \subsubsection*{Documentation improvements}
-% \begin{itemize}
-% \item Refer to \cmd{\greeknumeral} and \cmd{\Greeknumeral} rather than to
-% the synonyms \cmd{\greeknumber} and \cmd{\Greeknumber} (\TXI{602}).
-% \end{itemize}
-%
-%
-% \subsection*{1.64 (2023/07/21)}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Fix conflict of \pkg{soul} with \xpgoption{splithyphens} on \XeLaTeX\ (\TXI{600}).
-% \end{itemize}
-%
-% \subsection*{1.63 (2023/06/10)}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Language options are now lowercased before they are handled. This fixes errors when
-% using the options in \cmd{\MakeUppercase} context (\eg in headings).
-% \item Fix casing value for medieval Latin (this concerns ⟨u⟩ and ⟨V⟩ casing).
-% \item Remove hacks in some gloss files where \cmd\MakeUppercase\ has been redefined to a no-op
-% since the respective scripts do not have uppercasing. As \cmd\MakeUppercase\ is now locale-aware,
-% these hacks are no longer needed. This concerns Arabic, Divehi, Hebrew, Hindi, Kurdish,
-% Persian, Punjabi, Syriac, and Urdu.
-% \item Fix Eastern (Mashriq) Arabic numbering direction with \LuaLaTeX\ for Arabic, Kurdish, Persian,
-% Syriac, and Urdu (amends previous fix to \TXI{213}).
-% \item French \xpgoption{variant=acadian} refers to the Canadian French subvariety as spoken in the Acadian
-% region (as opposed to Quebec French). To differentiate it we now use a dedicated subtag
-% which can also be used to access the language (\texttt{fr-CA-u-sd-canb}).
-% Note that Quebec French is currently connected with \texttt{fr-CA}, not the more specific
-% \texttt{fr-CA-u-sd-caqc}, although the u extension is returned if requested via \cmd\BCPdata.
-% In practice, the Canadian subvarieties of French are identical currently, anyway.
-% \item Do not blindly de-activate the quote character in languages that provide shorthands if the
-% shorthands are not used. This allows to activate the character with other packages such as
-% \pkg{csquotes} (\TXI{592}).
-% \item Do not flood the \LaTeX\ hooks with redundant French itemlabels and footnote settings (\TXI{593}).
-% \item Fix Korean patching of part format with hyperref (\TXP{595}).
-% \item Make Hebrew numerals expandable (\TXP{596}).
-% \item Avoid superfluous writing of language switches to aux file (\TXI{593}).
-% \end{itemize}
-%
-% \subsubsection*{New features}
-% \begin{itemize}
-% \item New option \xpgoption{capitalyiwn} for Armenian.
-% \item New option \xpgoption{capitaleszett} for German.
-% \item New option \xpgoption{capitaliota} for Greek.
-% \item New option \xpgoption{datei} for Serbian.
-% \item New option \xpgoption{sectionsep} for Arabic, Kurdish, Persian,
-% Syriac, and Urdu (\TXI{589}).
-% \item Add aliases \xpgvalue{eastern} (=~\xpgvalue{mashriq}) and \xpgvalue{western} (=~\xpgvalue{maghrib})
-% to Arabic \xpgoption{numerals}.
-% \item New date commands \cmd{\today*}, \cmd{\todayGen}, \cmd{\todayArabic}, and \cmd{\todayRoman} (all with
-% starred counterparts) for Serbian (\TXI{524}).
-% \item Implement basic support for \xpgoption{variant=ijekavian} in Serbian.
-% \item Dutch now hyphenates properly on letters with tremata. The new option, \xpgoption{tremahyphenation},
-% is provided to opt-out this feature.
-% \item Add shorthands ¦"a¦, ¦"e¦, ¦"i¦, ¦"o¦, ¦"u¦, ¦"A¦, ¦"E¦, ¦"I¦, ¦"O¦, ¦"U¦, ¦"y¦, and ¦"Y¦ to Dutch.
-% \end{itemize}
-%
-% \subsubsection*{Interface changes}
-% \begin{itemize}
-% \item All language options are now lowercase by default (though the mechanism is case-insensitive anyway).
-% Changes cover Kurdish, Sanskrit, Serbian.
-% \end{itemize}
-%
-% \subsection*{1.62 (2023/04/22)}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item \cmd\BCPdata\ was not fully expandable as required. Now it is.
-% \end{itemize}
-%
-% \subsection*{1.61 (2023/04/16)}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Properly reset fonts on change to Latin-script other language (\TXI{580})
-% \item Turn ¦^¦ shorthand off in aux file for Latin (\TXI{582})
-% \item Fix stacking of nested languages and resulting bug in TOC language assignment (\TXI{585})
-% \item Fix ¦\greeknumeral{6}¦ (\TXI{587})
-% \item Fix (re)setting of scripts in inline language commands.
-% \end{itemize}
-%
-% \subsubsection*{New features}
-% \begin{itemize}
-% \item Introduce \cmd\BCPdata, a standardized way to gather localization information
-% (see sec.~\ref{sec:langinfo}).
-% \end{itemize}
-%
-% \subsection*{1.60 (2023/02/11)}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Remove stray \texttt{U+FEFF} glyphs in gloss files (\TXI{574})
-% \item Fix vertical whitespace in captions (\TXI{575})
-% \item Fix whitespace in dutch with shorthands.
-% \end{itemize}
-%
-% \subsection*{1.59 (2022/11/29)}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Do not error, but warn, after language change due to non-updated aux file (\TXI{565}).
-% \item Fix catcode issue for Latin (\TXI{566}).
-% \item Improve error message with missing fonts (\TXI{571})
-% \end{itemize}
-%
-% \subsubsection*{New features}
-% \begin{itemize}
-% \item Add support for (simplified and traditional) Chinese (\TXI{65}, provided by \TA{Takuji Tanaka}).
-% \item Add support for Punjabi (\TXP{572}), provided by \TA{Arvinder Singh}.
-% \end{itemize}
-%
-% \subsection*{1.58 (2022/10/26)}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item The option \xpgoption{forceheadingpunctuation} is introduced
-% for correct running headers in Hungarian documents (\TXI{557}).
-% \item Fix language setting in list of figure and table if captions float to different
-% language areas (\TXI{542}).
-% \item Make Croatian digraphs robust (\TXI{552}).
-% \item Fix definition of some Finnish shorthands (\TXI{554}).
-% \item Re-fix Hungarian patching of parts with hyperref (\TXI{555}).
-% \item Correct running headers in Hungarian documents (\TXI{557}).
-% \item Fix option expansion issue (\TXI{559}).
-% \end{itemize}
-%
-% \subsection*{1.57 (2022/07/18)}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Fix passing of macros to \cmd\setmainlanguage\ and \cmd\setotherlanguage\ (\TXI{543}).
-% \item Fix ¦otherlanguage*¦ environment with bidi text (\TXP{544}).
-% \item Re-fix patching of French part headings with hyperref (\TXI{546}).
-% \item Fix Latin prosodic shorthand issues (\TXI{547}, \href{https://github.com/latex3/babel/issues/126}{Babel/\#126},
-% \href{https://github.com/latex3/babel/issues/129}{Babel/\#129}).
-% \end{itemize}
-%
-% \subsubsection*{New features}
-% \begin{itemize}
-% \item New option \xpgoption{transliteration} to Hebrew and hebrewcal (\TXI{540}).
-% \item New option \xpgoption{fullyear} to Hebrew.
-% \end{itemize}
-%
-% \subsection*{1.56 (2022/04/20)}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Fix English setup via aliases (\TXI{539}).
-% \end{itemize}
-%
-%
-% \subsection*{1.55a (2022/04/10)}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Fix \cmd\foreignlanguage\ command (\TXI{538}).
-% \end{itemize}
-%
-% \subsection*{1.55 (2022/04/09)}
-%
-% \subsubsection*{New features}
-% \begin{itemize}
-% \item New option \xpgoption{splithyphens} and \xpgoption{vlna} for Polish (\TXI{535}).
-% \item Add \xpgoption{babelshorthands} to Polish.
-% \end{itemize}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Add missing \texttt{gloss-latex.lde} file to release (\TXI{537}).
-% \end{itemize}
-%
-% \subsection*{1.54 (2022/03/27)}
-%
-% \subsubsection*{New features}
-% \begin{itemize}
-% \item New option \xpgoption{splithyphens} for Serbian (\TXI{496}) and Portuguese (\TXI{534}).
-% \item Add \xpgoption{babelshorthands} to Portuguese.
-% \item Add \xpgoption{schoolhyphens} option to Finnish (\TXI{525}).
-% \end{itemize}
-%
-% \subsubsection*{Interface and defaults changes}
-% \begin{itemize}
-% \item Rename \xpgoption{disableligatures} to \xpgoption{disabledigraphs} for Croatian (\TXI{497}, \TXP{500}).
-% \item Fix output with \xpgoption{numerals=cyrillic-alph} (part of \TXI{503}).
-% \item Standardize February and November in Indonesian according to the Great Dictionary of the Indonesian Language
-% of the Language Center (\emph{Kamus Besar Bahasa Indonesia}) (\TXP{526}).
-% \end{itemize}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Fix robustification of font family switches (\TXI{428}).
-% \item Preserve font family switches across languages (\TXI{519}).
-% \item Fix \TeX\ dash ligatures with \xpgoption{splithyphens} (\TXI{502}).
-% \item Prevent \emph{missing hyphenmins value} \LaTeX\ error with unknown languages (\TXI{513}).
-% \item Fix global \xpgoption{babelshorthands}, \xpgoption{localmarks} and \xpgoption{verbose}
-% options (\TXI{515}).
-% \item Fix Latin shorthands (\TXI{516}).
-% \item Remove spurious space in Bosnian date (\TXP{528}).
-% \item Fix \cmd\languagevariant\ and \cmd\mainlanguagevariant\ macros (\TXI{530}, \TXI{531}).
-% \item Make \cmd\iflanguageloaded\ and friends work in preamble (\TXI{532}).
-% \item Fix deactivation of shorthands (\TXI{320}).
-% \item Fix deactivation of numerals.
-% \item Update deprecated \LaTeX\ hooks (\TXI{523}).
-% \item Fix \xpgoption{luatexrenderer} option which was not considered appropriately (\TXI{533}).
-% \item Turn warning about \texttt{totalhyphenmin} to info, which is more appropriate (\TXI{111}).
-% \end{itemize}
-%
-% \subsubsection*{Documentation improvements}
-% \begin{itemize}
-% \item Document in this manual where to report bugs (\TXI{512}).
-% \end{itemize}
-%
-%
-% \subsection*{1.53 (2021/04/12)}
-%
-% \subsubsection*{New features}
-% \begin{itemize}
-% \item New option \xpgoption{localalph} for Croatian (\TXI{486}).
-% \item Use ordinals in part and chapter headings. A new option \xpgoption{chapterformat} has been
-% added to disable this or change format to Roman numbering (\TXI{479}).
-% \item New command \cmd\uyghurordinal\ and \cmd\uyghurord\ to produce Uyghur ordinals from 1--100.
-% \end{itemize}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Fix typo in Uyghur language definition file (\TXI{479}).
-% \item Fix Uyghur date format (\TXI{479}).
-% \item Fix Uyghur caption format and add \xpgoption{swapstrings} option (\TXI{479}).
-% \item Add overlooked digraphs in Croatian (\TXP{484}).
-% \item Fix typo in Serbian ¦\thepart¦ (\TXP{485}).
-% \item Fix part modifications in Hungarian with \pkg{hyperref} (\TXI{493}).
-% \end{itemize}
-%
-% \subsection*{1.52 (2021/03/16)}
-%
-% \subsubsection*{New features}
-% \begin{itemize}
-% \item Adaptations to \LaTeX\ 2021/05/01 pre-release 2 for Korean (\TXI{477}).
-% \item Add support for Uyghur (\TXI{475}).
-% \item New option \xpgoption{mathfunctions} for Russian and Ukrainian allows to disable the definitions
-% of math macros that might clash with other packages (\TXI{465}).
-% \item Support LaTeX's new NFSS hooks (\TXI{471}).
-% \end{itemize}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Fix French part modifications with \pkg{hyperref} (\TXI{469}).
-% \item Fix markup of French ¦\see¦ and ¦\alsoname¦ (\TXI{468}).
-% \end{itemize}
-%
-% \subsection*{1.51 (2020/12/08)}
-%
-% \subsubsection*{New features}
-% \begin{itemize}
-% \item New option \xpgoption{frenchpart} for French (\TXI{458}).
-% \item New option \xpgoption{splithyphens} for Croatian (\TXI{454}).
-% \end{itemize}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Use new LaTeX core hooks rather than \pkg{filehook} package. This fixes
-% a recent breakage of \pkg{filehook} with other external packages (\TXI{453}).
-% \item Remove very old code that pretends \pkg{polyglossia} is \pkg{babel} (\TXI{455}).
-% \item Fix spelling of Albanian contentsname (\TXI{456}).
-% \item Fix part heading modification in French (\TXI{458}).
-% \item Fix extra space in Hebrew (\TXI{459}).
-% \item Register main polyglossia language earlier (\TXI{461}).
-% \item Allow for hyphenations in words following opening guillemet in French with XeTeX (\TXI{462}).
-% \end{itemize}
-%
-%
-% \subsection*{1.50a (2020/10/15)}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Assure ¦\autodot¦ is defined with ¦\KOMAScript¦ in Russian.
-% \end{itemize}
-%
-% \subsection*{1.50 (2020/10/09)}
-%
-% \subsubsection*{New features}
-% \begin{itemize}
-% \item Polyglossia now uses the Harfbuzz renderer by default with LuaTeX
-% output. This brings LuaTeX on par with XeTeX for all scripts (\TXI{337}).
-% The renderer can be changed via the new global \xpgoption{luatexrenderer} option.
-% \item The (previously inadvertently working) ¦hyphenrules¦ environment that ceased
-% to work after a recent \pkg{babel} update is back and now officially supported.
-% The environment now also supports language options and aliases (\TXI{427}).
-% \item New command ¦\setlanghyphenmins¦ to adapt hyphenation thresholds of languages
-% and varieties.
-% \item New command ¦\abjadalph¦ for Arabic with corresponding option (\TXI{431}).
-% \item Replace consecutive glues around punctuation by the correct amount of space
-% with lualatex for French, ecclesiastic Latin, and Sanskrit (\TXI{437}).
-% \end{itemize}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Remove warning about missing Brazil patterns (\TXI{404}).
-% \item Fix incompatibility with recent \pkg{babel} release (\TXI{408}).
-% \item Fixed some spellings in Marathi (\TXI{409}).
-% \item Fix spacing of geminating dot in Catalan (\TXI{410}).
-% \item Fix incompatibility of Marathi with \pkg{beamer}.
-% \item Correct ¦\partname¦ in Hindi (\TXI{416}).
-% \item Updates and improvements to Kurdish (\TXI{418}).
-% \item Only activate shorthand character if \xpgoption{babelshorthands} is \xpgvalue{true} (\TXI{421}).
-% \item Fix whitespace issue in Czech and Slovak with \xpgvalue{vlna=true} (\TXI{423}).
-% \item Fix whitespace issue in Danish (\TXI{424}).
-% \item Fix catcode conflicts that might occur in language definition files
-% f.\,ex.\ when loaded from a LaTeX3 class (\TXI{67}, \TXI{425}).
-% \item Robustify font family switches (\TXI{428}).
-% \item Fix whitespace issue in Russian \xpgoption{indentfirst} option (\TXI{433}).
-% \item In Russian, \xpgoption{indentfirst} is now again default (\TXI{434}).
-% \item Fix LaTeX error with arabic numbering in Ukrainian (\TXI{440}).
-% \item Fix directionality after Hebrew decimal numbers (\TXI{441}).
-% \item Fix ¦babelname¦ of Latin Serbian (\TXI{442}).
-% \item Fix recording of secondary languages in ¦\xpg@bloaded¦ and ¦\xpg@bcp@loaded¦
-% lists (\TXI{443}).
-% \item Simplify and robustify section heading modification in Russian
-% and introduce option \xpgoption{forceheadingpunctuation} (\TXI{444}).
-% \item Fix Cyrillic dash (via babelshorthand ¦"---¦) when TeX ligatures
-% are disabled (\TXI{445}).
-% \item Fix problem with large character indices in Lua module for punctuation
-% spacing
-% \end{itemize}
-%
-% \subsubsection*{Interface and defaults changes}
-% \begin{itemize}
-% \item Polyglossia now uses the Harfbuzz renderer by default with LuaTeX
-% output. See new features section.
-% \end{itemize}
-%
-% \subsubsection*{Build fixes}
-% \begin{itemize}
-% \item Fix an embarrassing bug in the dtx build script which was the reason for an utterly
-% incomplete ¦polyglossia.dtx¦ file (\TXI{420}).
-% \end{itemize}
-%
-% \subsubsection*{Documentation improvements}
-% \begin{itemize}
-% \item Document how to change ¦\lefthyphenmin¦ and ¦\righthyphenmin¦ for a language
-% (\TXI{435}).
-% \end{itemize}
-%
-%
-% \subsection*{1.49 (2020/04/08)}
-%
-% \subsubsection*{New features}
-% \begin{itemize}
-% \item Add hook ¦\polyglossia@language@switched¦ to the external package interface (\TXI{398}).
-% \item Real fix for \TXI{400}, that wasn’t properly taken care of in 1.48.
-% \end{itemize}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Fix compilation error with some \xpgoption{swapstring} options in Hungarian (\TXI{373}).
-% \item Fix whitespace problem in Greek language.
-% \end{itemize}
-%
-% \subsubsection*{Interface and defaults changes}
-% \begin{itemize}
-% \item Changed Finnish caption for ``Table of Contents'' to ``Sisällys'' (\TXI{403}).
-% \end{itemize}
-%
-%
-% \subsection*{1.48 (2020/03/25)}
-%
-% \begin{itemize}
-% \item No new features
-% \end{itemize}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Fix use of Hebrew with LuaLaTeX (\TXI{389}).
-% \item Do not overwrite footnote redefinitions of other packages
-% with Latin and French (\TXI{391}).
-% \item Fix Serbian cyrillic numerals code (\TXI{392}).
-% \item Fix \xpgoption{[no]localmarks} option, whose logic was swapped (part of \TXI{395}).
-% \item Protect \xpgoption{localmarks} function against uppercased language names (part of \TXI{395}).
-% \item Fix buggy redefinition of ¦\@markright¦ with option localmarks (\TXI{396}).
-% \item Fix incompatibility between Latin and unicode-math (\TXI{394}).
-% \item Make (undocumented) ¦\defineshorthand¦ command (imported from babel) work.
-% \item Fix usage of \xpgoption{localmarks} option without value.
-% \item Emergency fixes for bugs caused by updates in \pkg{babel}’s ¦switch.def¦ (\TXI{399} and \TXI{400}).
-% \end{itemize}
-%
-% \subsubsection*{Interface and defaults changes}
-% \begin{itemize}
-% \item Use private macros in keyval choice keys (\TXI{390}).
-% \end{itemize}
-%
-% \subsection*{1.47 (2020/01/29)}
-%
-% \subsubsection*{New features}
-% \begin{itemize}
-% \item IETF BCP-47 compliant language tags can now be used for loading and switching
-% languages alternatively to language names (\TXI{226}).
-% \item New commands ¦\languageid{<type>}¦ and ¦\mainlanguageid{<type>}¦.
-% \item New test ¦\iflanguageidloaded¦.
-% \item New list ¦\xpg@bcp@loaded¦.
-% \item New environment ¦{lang}{<lang>}¦ (this is equivalent to ¦{<lang>}¦, but also available with
-% ¦\setlanguagealias*¦ which does not define dedicated alias environments).
-% \item New gloss option ¦totalhyphenmin¦ (corresponds to LuaTeX's ¦\hyphenationmin¦) (\TXI{111}).
-% \item New test ¦\iflanguageoption{<lang>}{<key>}{<val>}¦ (\TXI{364}).
-% \item Restore simple alphabetic numbering for ¦\asbuk¦ and ¦\Asbuk¦ in Belarusian, Mongolian,
-% Russian, Serbian, and Ukrainian (\TXI{377}).
-% \item New command ¦\AsbukTrad¦ and ¦\asbukTrad¦ for Belarusian, Mongolian, Russian, Serbian,
-% and Ukrainian which uses traditional alphanumerical numbering.
-% \item New numerals option ¦cyrillic-trad¦ and ¦cyrillic-alph¦ to differentiate simple
-% alphabetic and traditional alphanumerical Cyrillic numbering.
-% \item ¦\selectbackgroundlanguage¦ and ¦\resetdefaultlanguage¦ now also support language
-% aliases.
-% \item New macro ¦\charifavailable{<char code>}{<substitution>}¦.
-% \item Add French language variant ¦swiss¦.
-% \item Implement \xpgoption{babelshorthands} for Croatian.
-% \item Implement ¦\localnumeral¦ for Japanese.
-% \end{itemize}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Fix font family issue in headers (\TXI{355}).
-% \item Fix whitespace issues in ¦\text<lang>¦ (\TXI{356}).
-% \item Fix option-less ¦\babelname¦ in multi-variant languages (\TXI{357}).
-% \item Fix some spacing inconsistencies with French, Latin, and Sanskrit (\TXI{358}).
-% \item Fix issues with \xpgoption{babelshorthands} and \pkg{graphics} package (\TXI{368}).
-% \item Fix some captions and improve numbering in Marathi (\TXI{370}).
-% \item Fix Hungarian \xpgoption{swapstrings} feature (\TXI{373}).
-% \item Fix lua punctuation code problem (\TXI{374}).
-% \item Fix Bengali changecounternumbering option (\TXI{381}).
-% \item Fix whitespace issue in Japanese (\TXI{387}).
-% \item Fix ¦\text<lang>¦ command with multiple paragraphs.
-% \item Actually implement documented german spelling variant ¦1996¦ (= ¦new¦).
-% \item Fix Slovenian \xpgoption{localalph} option.
-% \item Fix Czech and Slovak \xpgoption{splithyphens} with typewriter fonts.
-% \item ¦farsical.sty¦: fix spacing issue with some month names.
-% \item Fix directionalty of numbers in Hebrew with XeTeX.
-% \item Improve interoperatability with \pkg{biblatex} (some language variants did not work yet).
-% \end{itemize}
-%
-% \subsubsection*{Interface and defaults changes}
-% \begin{itemize}
-% \item Some boolean options had ¦false¦ value by default, which meant if you passed
-% them without value, the logic was reversed. This has been changed, leading to
-% change of behavior should you have used one of these options without value (\TXI{363}).
-% Concerned are the following options:
-% \begin{itemize}
-% \item \xpgoption{babelshorthands} in language Belarusian, Mongolian, Ukrainian, and Russian
-% (now \xpgoption{babelshorthands} equals \xpgoption{babelshorthand=true}, no longer \xpgoption{babelshorthands=false}).
-% \item \xpgoption{localalph} in language Slovenian (\xpgoption{localalph} now equals \xpgoption{localalph=true}).
-% \item \xpgoption{fullyear} in package \pkg{hebrewcal} (\xpgoption{fullyear} now equals \xpgoption{fullyear=true}).
-% \end{itemize}
-% \item The option \xpgoption{latesthyphen} in language German is deprecated. \XeTeX\ and \LuaTeX\ nowadays
-% always use the latest German hyphens.
-% \item The command ¦\setlanguagealias*¦ (introduced in v1.46) does no longer define
-% dedicated alias environments.
-% \item The babelnames for Latin variants are now changed to ¦classiclatin¦, ¦ecclesiasticlatin¦
-% and ¦medievallatin¦. This is how the hyphenation patterns and \pkg{babel} ¦\extras¦ are named, even
-% though the variants can currently be selected in \pkg{babel} only via appended ``dot modifier''.
-% \item In accordance with the respective \pkg{l3kernel} change, ¦\str_lower_case:n¦ has been renamed to
-% ¦\str_lowercase:n¦ where used in ¦polyglossia.sty¦. Thus \pkg{polyglossia} 1.47 requires \pkg{l3kernel}
-% 2020-01-12 at least.
-% \end{itemize}
-%
-% \subsection*{1.46 (2019/11/15)}
-%
-% \subsubsection*{New features}
-% \begin{itemize}
-% \item Add option \xpgoption{indentfirst} to Russian (\TXI{78}).
-% \item Add options to set and customize French-style itemize item labels to French (\TXI{89}).
-% \item \pkg{Polyglossia} now decodes all supported \pkg{babel} language names in ¦\setdefaultlanguage¦,
-% ¦\setotherlanguage¦ and the language switching commands (\TXI{112}, \TXI{132}).
-% \item Add optional localized math operators to Spanish (\TXI{123}).
-% \item Swap section headings in Hungarian (\TXI{344}). New option \xpgoption{swapstrings} provides control
-% over this.
-% \item Introduce macro ¦\setlanguagealias¦ and ¦\setlanguagealias*¦.
-% \item Introduce language switching command ¦\textlang{lang}{...}¦ (these are equivalent to ¦\text<lang>¦,
-% but also available with ¦\setlanguagealias*¦ which does not define ¦\text<alias>¦).
-% \item Add support for Afrikaans.
-% \item Add support for Belarusian.
-% \item Add support for Bosnian.
-% \item Add support for Georgian.
-% \item Add Spanish variant ¦mexican¦.
-% \item Add babelshorthands as well as options \xpgoption{splithyphens} and \xpgoption{vlna} to Slovak.
-% \item Add Latin language variant ¦ecclesiastic¦.
-% \item Add Latin language options ¦capitalizemonth¦, ¦ecclesiasticfootnotes¦, ¦hyphenation¦,
-% ¦prosodicshorthands¦, and ¦usej¦.
-% \item Add Latin shorthands for «, », æ, Æ, œ, and Œ.
-% \item Add French language option \xpgoption{thincolonspace}.
-% \end{itemize}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Fix problems with fragile font settings (\TXI{24}).
-% \item Fix clash of French punctuation spacing with the \pkg{soul} package (\TXI{52}).
-% \item Re-enable the possibility to pass a macro as main argument to ¦\setmainlanguage¦ and
-% ¦\setotherlanguage¦ (\TXI{331}).
-% \item Fix detection of default ¦\languagevariant¦ (\TXI{332}).
-% \item Fix LaTeX error with undefined hyphenation pattern (\TXI{346}).
-% \item Fix some babel shorthand issues by updating the shorthand code from recent \pkg{babel}.
-% \item Fix some problems with French and Latin auto-spacing (\TXI{345}, \TXI{352}).
-% \item Fix an \pkg{expl3} declaration (\TXI{348}).
-% \end{itemize}
-%
-% \subsubsection*{Interface and defaults changes}
-% \begin{itemize}
-% \item The sub-package ¦cyrillicnumbers.sty¦ has been renamed to
-% ¦xpg-cyrillicnumbers.sty¦ (per TeXLive request).
-% \item In Russian, all paragraphs are now indented by default, as common in Russian typography.
-% The behavior can be opted out by \xpgoption{indentfirst=false}.
-% \item In Czech, \xpgoption{splithyphens} and \xpgoption{lvna} are enabled by default.
-% Also, the option does now work as well with LuaTeX.
-% \item Changed option name ¦fraktur¦ to ¦blackletter¦ in German (the former is still available
-% as an alias).
-% \item In French, high punctuation characters and guillemets are spaced by half an interword
-% space now instead of a ¦\thinspace¦ (cf. \TXI{345}).
-% \end{itemize}
-%
-% \subsection*{1.45 (2019/10/27)}
-%
-% \subsubsection*{New features}
-% \begin{itemize}
-% \item Introduce a framework for external packages to access language variants. This fixes,
-% among other things, long-standing problems in the interaction of \pkg{biblatex} and \pkg{polyglossia}.
-% \item Add new macros ¦\languagevariant¦ and ¦\mainlanguagevariant¦ as well as ¦\babelname¦ and ¦\mainbabelname¦
-% for package authors to access language information.
-% \item Add new test ¦\iflanguageloaded{<language>}{<true>}{<false>}¦ where <language>
-% can be a \pkg{polyglossia} or \pkg{babel} language name.
-% \item Add new macros ¦\localnumeral,¦ ¦\localnumeral*,¦ ¦\Localnumeral¦ and
-% ¦\Localnumeral*¦ that convert Arabic digitals to the local number scheme.
-% \item Add new macro ¦\pghyphenation¦ to add language-specific hyphenation exceptions (\TXI{18}).
-% \item Add support form (Khalkha \& Cyrillic) Mongolian in line with \pkg{babel-mongolian} (\TXI{23}).
-% \item Add option \xpgoption{splithyphens} and \xpgoption{vlna} to Czech (XeTeX only; for LuaTeX, use the package
-% \pkg{luavlna} to get these features) (\TXI{32}).
-% \item Add support for Kurdish, both Kurmanji and Sorani (\TXI{277}).
-% \item Implement proper Cyrillic (alphanumeric) numbering (\TXI{285}).
-% \item Add new language ¦friulian¦.
-% This deprecates ¦friulan¦ (which is still supported for backwards compatibility).
-% \item Add new language ¦malay¦ with variants ¦indonesian¦ and ¦malaysian¦.
-% This deprecates ¦bahasai¦ and ¦bahasam¦ (which are still supported for
-% backwards compatibility).
-% \item Add new language ¦gaelic¦ with variants ¦irish¦ and ¦scottish¦.
-% This deprecates ¦irish¦ and ¦scottish¦ as own \pkg{polyglossia} languages (which
-% are still supported for backwards compatibility).
-% \item Add new language ¦hungarian¦.
-% This deprecates ¦magyar¦ (which is still supported for backwards compatibility).
-% \item Add new language ¦sorbian¦ with variants ¦lower¦ and ¦upper¦.
-% This deprecates ¦lsorbian¦ and ¦usorbian¦ (which are still supported for
-% backwards compatibility).
-% \item Add new language ¦portuguese¦ with variants ¦portuguese¦ and ¦brazilian¦.
-% This deprecates ¦brazil¦ and ¦portuges¦ (which are still supported for
-% backwards compatibility).
-% \item Add new language ¦norwegian¦ with variants ¦nynorsk¦ and ¦bokmal¦.
-% This deprecates ¦nynorsk¦ and ¦norsk¦ (which are still supported for
-% backwards compatibility).
-% \item Add new language ¦persian¦.
-% This deprecates ¦farsi¦ (which is still supported for backwards compatibility).
-% \item Add new language ¦sami¦. Currently only Northern Sami is supported.
-% This deprecates ¦samin¦ (which is still supported for backwards compatibility).
-% \item ¦gloss-serbian¦: add \xpgoption{numerals=cyrillic} option. Add ¦\asbuk¦ and ¦\Asbuk¦ (\TXI{285}).
-% \item Implement basic support for (French) ¦canadien¦ and (English) ¦canadian¦ (\TXI{22}).
-% \item Improve support for Armenian (\TXI{79}): Add captions, Eastern month names
-% (accessible via variant=eastern) and Armenian alphabetic numbering
-% (via \xpgoption{numerals=armenian} and ¦\armenicnumeral¦).
-% \item Add french option \xpgoption{autospacing} and commands ¦\AutoSpacing,¦ ¦\NoAutoSpacing¦
-% This allows to switch off autospacing globally or locally (\TXI{113}).
-% \item Fixup ¦\normalfont¦ (\TXI{203}).
-% \item Fix directionality issues in mixed RTL/LTR paragraphs (\TXI{204}).
-% \item Implement \xpgoption{babelshorthands} for Finnish (\TXI{212}) and Czech.
-% \item Implement access to current language via Lua (\TXI{243}).
-% \item Introduce french option option \xpgoption{autospacetypewriter}
-% alias \xpgoption{OriginalTypewriter}.
-% \item Support ¦\aemph¦ with lualatex
-% \item Rename \xpgoption{automaticspacesaroundguillemets} to \xpgoption{autospaceguillemets}
-% The old option is kept for backwards compatibility.
-% \end{itemize}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Fix equation number in Arabic and Farsi (\TXI{7}).
-% \item Simplify and document Hebrew \xpgoption{marcheshvan} option (\TXI{16}).
-% \item Fix hyphenation of Greek with LuaTeX (\TXI{55}).
-% \item Fix N'ko date format (\TXI{63}).
-% \item Disable the extras of a language when a nested language starts (\TXI{66}, \TXI{169}).
-% \item Properly implement Bengali numbers (\TXI{69}, \TXI{184}).
-% \item Fix conflicts with other packages caused by premature shorthand activation
-% in preamble (\TXI{81}, \TXI{200}).
-% \item Fix kerning in math with French (\TXI{92}).
-% \item Fix expansion issue in Hebrew (\TXI{93}).
-% \item Fix numbering expansion issue in Greek (\TXI{110}).
-% \item Postpone ¦\disablehyphenation¦ in preamble until after setting of
-% document language (\TXI{125}).
-% \item Postpone the assignment of defaultfamily to ¦\AtBeginDocument¦,
-% thus do not overwrite ¦\familydefault¦ redefinitions in the preamble (\TXI{127}).
-% \item Reset number settings when switching language (\TXI{133}).
-% \item Hebrew: Properly store ¦\MakeUppercase¦ for later restoration (\TXI{152}).
-% \item Fix whitespace issue in ¦\datewelsh¦ (\TXI{158}).
-% \item When switching language, set the language/script specific font families (\TXI{164}).
-% \item Correct some Bengali captions (\TXI{165}).
-% \item Fix documentation of Serbian (\TXI{168}).
-% \item Reset ucl codes in Latin only if the respective variant is used (\TXI{172}).
-% \item Fix ¦\disablehyphenation¦ with LuaTeX (\TXI{187}).
-% \item Fix typos in Hindi captions (\TXI{202}).
-% \item Pass language options to the aux files (\TXI{205}).
-% \item Rewrite and fix English variant handling (\TXI{208}).
-% \item Define magyar caption formats in ¦\blockextras¦ and undef them in ¦\noextras¦ (\TXI{209}).
-% \item Ensure proper direction with arabic digits in Arabic and Farsi (\TXI{213}).
-% \item Fix ¦\linespread¦ with Korean (\TXI{218}).
-% \item Define Russian caption before key allocation (\TXI{219}).
-% \item Register current language in \pkg{polyglossia} lua module after selection (\TXI{234}).
-% \item Fix \pkg{babel} language switching commands (\TXI{239}):
-% ¦\foreignlanguage¦ and the starred ¦otherlanguage*¦ environment are not
-% supposed to change dates.
-% \item Fix French spacing leaking beyond French (\TXI{270}).
-% \item Redefine font families for French only if language is loaded (\TXI{270}).
-% \item ¦gloss-russian¦:
-% \begin{itemize}
-% \item Check whether command exist before redefining (\TXI{280}).
-% \item Fix some whitespace issues.
-% \end{itemize}
-% \item Fix and simplify ¦\frenchfootnote¦ definition (\TXI{294}).
-% \item Fix footnote numbering in Farsi.
-% \item Fix Latin footnotes in Arabic documents.
-% \item Set the correct main direction with \pkg{luabidi}.
-% \item Fix \xpgoption{autospaceguillemets} option in French.
-% \item Fix grouping in ¦gloss-danish.ldf¦.
-% \item Properly store ¦\MakeUppercase¦ and ¦\@arabic¦ for later restoration.
-% \end{itemize}
-%
-% \subsubsection*{Documentation}
-% \begin{itemize}
-% \item Add documentation about footnotes in RTL context
-% \item Document Tibetan numerals option (\TXI{109}).
-% \item Improve ¦\frenchfootnote¦ documentation.
-% \item Mention Japanese support in the docs.
-% \end{itemize}
-%
-% \subsection*{1.44 (2019/04/04)}
-% \begin{itemize}
-% \item Correction to Russian language file, by \TA{Maksim Zholudev} (commit d2f383e).
-% \item Added Macedonian language file, by \TA{Stefan Zlatinov} (commit cd379e1).
-% \end{itemize}
-%
-% \subsection*{1.43 (2019/03/05)}
-% \begin{itemize}
-% \item Correction to Hindi language file, by \TA{Zdenĕk Wagner}.
-% \end{itemize}
-%
-% \subsection*{1.42.5 (2017/04/13)}
-% \begin{itemize}
-% \item Many changes to the French language file, by \TA{Maïeul Rouquette}.
-% \end{itemize}
-%
-% \subsection*{1.42.4 (February, March 2016)}
-% \begin{itemize}
-% \item Remedial actions for the \pkg{babel} changes.
-% \item Fixed side effect of pull request \TXI{122} (see commit d2a34ff).
-% \item Added automatic Josa selection, variant, and captions options to Korean, by \TA{Dohyun Kim} (pull request \TXI{128}).
-% \item Updated ¦gloss-occitan¦ from CTAN.
-% \end{itemize}
-%
-% \subsection*{18-01-2016}
-% \begin{itemize}
-% \item Fixed issue \TXI{124} (minor typo in ¦polyglossia-frpt.lua¦)
-% \item Merged pull request \TXI{117} for more French guillemet spacing
-% \item Merged pull request \TXI{121} to add ¦\bbl@loaded¦; fixes issue \TXI{120}
-% \item Merged pull request \TXI{122} that build on \TXI{121}
-% \item Merged pull request \TXI{116} for French (spacing around guillemets)
-% \item Fixed issue \TXI{115} (spurious spaces in Arabic)
-% \end{itemize}
-%
-% \subsection*{19-08-2015}
-% \begin{itemize}
-% \item Fixed issue \TXI{107} for Marathi (labels and month names)
-% \end{itemize}
-%
-% \subsection*{1.42.0 (2015/08/06)}
-% \begin{itemize}
-% \item Add Bengali digits package, and option to reset all numbering functions.
-% \item Add ¦long¦ option for Welsh date.
-% \item Add local alphabet in Slovenian, for enumerations and such.
-% \item Fix long-standing bug with Welsh: date should use ordinals.
-% \item Fix for Latin with LuaTeX: all variants had same problems as Classic.
-% \item Fixed error with British variant of English and LuaTeX (issue \TXI{86}).
-% \end{itemize}
-%
-% \subsection*{1.41.0 (2015/07/16)}
-% \begin{itemize}
-% \item Added support for Khmer, by \TA{Say Ol} (private email)
-% \end{itemize}
-%
-% \subsection*{1.40.1 (2015/07/14)}
-% \begin{itemize}
-% \item Bugfix for Korean, by \TA{Dohyun Kim} (pull request \TXI{103})
-% \end{itemize}
-%
-% \subsection*{1.40.0 (2015/07/07)}
-% \begin{itemize}
-% \item ¦gloss-korean.ldf¦ contributed by \TA{Dohyun Kim} (pull request \TXI{102})
-% \end{itemize}
-%
-% \subsection*{1.33.7 (2015/07/04)}
-% \begin{itemize}
-% \item Release to CTAN, no code change
-% \item Fixed extraneous space in code for Swiss German (pull request \TXI{101})
-% \item Fixed a typo in Ukrainian alphabet, for ¦\Asbuk¦ (pull request \TXI{99})
-% \item Fix for Classic Latin: load patterns for LuaTeX
-% \item Made ¦\rmfamily¦, ¦\sffamily¦ and ¦\ttfamily¦ robust again
-% \item Merged fix for Hebrew date format, by \TA{Guy Rutenberg} (pull request \TXI{94})
-% \item Merged fix for spurious space, by \TA{Caleb McKennan} (pull request \TXI{91})
-% \item Merged pull request \TXI{84} by \TA{Élie Roux} for Tibetan
-% \item Added support for Swiss German (pull request \TXI{75})
-% \item Added commands ¦\Asbuk¦ and ¦\asbuk¦ for Ukrainian (pull request \TXI{76}), similar to Russian
-% \item Documented changes to Latin from last year.
-% \item Be friendlier to right-to-left languages with LuaTeX
-% \item Enhanced Latin support by \TA{Claudio Beccari}
-% \end{itemize}
-%
-% \subsection*{1.33.6 (2015/05/15)}
-% \begin{itemize}
-% \item Introduce a ¦classical¦ and ¦medieval¦ variant of Latin
-% \item Add ¦\asbuk¦ and ¦\Asbuk¦ for Ukrainian (after their Russian counterpart)
-% \item Fix a number of bugs
-% \end{itemize}
-%
-% \subsection*{1.33.5 (2014/05/21)}
-% \begin{itemize}
-% \item Option to disable hyphenation entirely, by \TA{Élie Roux}
-% \item Fix spurious spaces in gloss-russian.ldf, by \TA{Oleg Domanov}
-% \item Support for the Austrian variant of German, by \TA{Jürgen Spitzmüller}
-% \item Changes to the Croatian translations, by \TA{Ivan Kokan}
-% \item Correction to the Lithuanian translations, by \TA{Ignas Anikevičius}
-% \end{itemize}
-%
-% \subsection*{1.33.4 (2013/06/27)}
-% \begin{itemize}
-% \item Emergency release for a bug introduced in ¦babelsh.def¦
-% \end{itemize}
-%
-% \subsection*{1.33.3 (2013/05/28)}
-% \begin{itemize}
-% \item Changed formatting of some error messages (emergency fixes for TeX Live 2013)
-% \end{itemize}
-%
-% \subsection*{1.33.2 (2013/05/26)}
-% \begin{itemize}
-% \item Added ¦\disablehyphenation¦ and ¦\enablehyphenation¦, contributed by
-% \TA{Élie Roux}.
-% \item Fixed bug related to package inclusion. \pkg{Polyglossia} would break if
-% we loaded ¦breqn.sty¦, and then called ¦\setmainlanguage{english}¦, this
-% is no longer the case.
-% \item Removed spurious space introduced by ¦\captionswedish¦.
-% \end{itemize}
-%
-% \subsection*{1.33.1 (2013/05/23)}
-% \begin{itemize}
-% \item Editorial changes to the documentation
-% \item Hunted and documented bugs
-% \end{itemize}
-%
-% \subsection*{1.33.0 (2013/05/20)}
-% \begin{itemize}
-% \item Added support for N’Ko.
-% \item Bugfixes for LuaTeX
-% \item More work in progress on Bidi in LuaTeX.
-% \end{itemize}
-%
-% \subsection*{1.32.0 (2013/05/15)}
-% \begin{itemize}
-% \item Transitional version to support right-to-left languages with LuaTeX.
-% \end{itemize}
-%
-% \subsection*{1.31 (2013/05/10) / 1.3 (2013/05/11)}
-% \begin{itemize}
-% \item Several bugfixes.
-% \item Sync with \pkg{babel} 3.9.
-% \item Consolidated support for LuaTeX for all languages but the ones using
-% South and South-East Asian scripts, and languages written from right
-% to left. Many thanks to \TA{Élie Roux} for his help.
-% \item Added support for Tibetan, contributed by \TA{Élie Roux} (end of lines are experimental).
-% \end{itemize}
-%
-% \subsection*{1.30 (2012/08/06)}
-% \begin{itemize}
-% \item Added support for LuaTeX. Many languages don’t work yet. Please be patient.
-% \end{itemize}
-%
-% \subsection*{1.2.0e (2012/04/28)}
-% \begin{itemize}
-% \item Fixed a number of outstanding and not very interesting bugs.
-% \item Added gloss files for Romansh and Friulan, contributed by \TA{Claudio Beccari}.
-% \end{itemize}
-%
-% \subsection*{1.2.0d (2012/01/12)}
-% \begin{itemize}
-% \item Removed ¦\makeatletter¦ and ¦\makeother¦ from gloss files entirely.
-% \end{itemize}
-%
-% \subsection*{1.2.0c (2011/10/12) [First update by Arthur Reutenauer]}
-% \begin{itemize}
-% \item Update to ¦gloss-italian.ldf¦ by \TA{Claudio Beccari}, incorporating changes
-% by \TA{Enrico Gregorio}.
-% \item Conclude every gloss file with ¦\makeatother¦ to match the initial
-% ¦\makeatletter¦. (Not necessary from a technical point of vue, because of one
-% of the changes by Enrico reported below, but I like it better that way :-)
-% \item Conclude ¦polyglossia.sty¦ with ¦\ExplSyntaxOff¦ to match the initial
-% ¦\ExplSyntaxOn¦.
-% \item Added gloss file for Kannada, contributed by \TA{Aravinda VK} and others.
-% \item Corrections to the gloss-dutch.ldf thanks to \TA{Wouter Bolsterlee}.
-% \item Several patches by \TA{Enrico Gregorio}, fixing long-standing bugs.
-% From the git log:
-% \begin{itemize}
-% \item Deleted setup for right-to-left writing direction, see \url{http://tug.org/pipermail/xetex/2011-April/020319.html}
-% \item Changed three appearances of ¦\newcommand¦ to ¦\newrobustcmd,¦ as the commands needs to be protected.
-% Bug reported by \TA{kamensky}.
-% \item Corrected ¦\datepolish¦ as suggested by \TA{Piotr Kempa}
-% \item Changed ¦\lccode"¦ into ¦\lccode\string",¦ because it might come into action at wrong times when ¦"¦ is active
-% \item Changed definition of key ¦\xpg@setup¦, as ¦\@tmpfirst¦ and ¦\@tmpsecond¦ were not expanded, causing dependence
-% of ¦\lefthyphenmin¦ and ¦\righthyphenmin¦ to the last loaded language.
-% Raised by \TA{Vadim Rodionov} on the XeTeX mailing list.
-% \item Deleted ¦\bgroup¦ and ¦\egroup¦ tokens from the definition of ¦otherlanguage*¦; they serve no purpose
-% (we are already inside an environment) and conflict with \pkg{csquotes}. Noticed by \TA{P. Lehman}.
-% \item Changed the calls of \verb|\input| to ¦\xpg@input¦, which inputs the required file and resets the catcode
-% of ¦@¦ to the same value as it had before the input. Since each ¦.ldf¦ file starts with ¦\makeatletter¦,
-% the old behaviour would leave a category 11 @, which is wrong.
-% \item Added ¦\csuse{date#2}¦ to the definition of ¦otherlanguage*¦.
-% \end{itemize}
-% \end{itemize}
-%
-% \subsection*{1.2.0b (2011/10/03) [Update by Philipp Stephani]}
-% \begin{itemize}
-% \item Load \pkg{xkeyval} package explicitly since newer versions
-% of \pkg{fontspec} don't load it any more.
-% \end{itemize}
-%
-% \subsection*{1.2.0a (2010/07/27) [Last update by François Charette]}
-% \begin{itemize}
-% \item Initialize ¦\fontfamily¦ acc to value of ¦\familydefault¦
-% (Fixes a bug when using \pkg{polyglossia} with beamer)
-% \item Remove spurious space in def of ¦\dateenglish¦
-% \item Add missing English variant ¦american¦
-% \item Serbian: fix date format and captions (Latin+Cyrillic)
-% \item Fix ¦\atticnumeral¦ in ¦gloss-greek¦
-% \item Small improvements and fixes in documentation
-% \end{itemize}
-%
-%
-% \subsection*{1.2.0 (2010/07/15)}
-% \begin{itemize}
-% \item Adapted for \pkg{fontspec} 2.0 (will not work with earlier versions!)
-% \item Implementation of a ¦\PolyglossiaSetup¦ interface
-% that simplifies writing ¦gloss-*.ldf¦ files
-% \item Many internal enhancements and refactoring
-% (including a patch by \TA{Dirk Ulrich})
-% \item Improved automatic font setup when ¦\<lang>font¦ is not defined
-% \item New environment \texttt{otherlanguage*} (equivalent to ¦\foreignlanguage¦
-% (\TA{Enrico Gregorio})
-% \item Bugfix to prevent bogus expansion of ¦\{rm,sf,tt}family¦ even in aux files (\TA{Enrico Gregorio})
-% \item New gloss files for Armenian, Bengali, Occitan, Bengali, Lao,
-% Malayalam, Marathi, Tamil, Telugu, and Turkmen.
-% \item New auxiliary packages ¦devanagaridigits¦ and ¦bengalidigits¦
-% \item \pkg{hijrical} no longer loads \pkg{bidi} and checks for incompatible \pkg{l3calc}
-% \item Add \pkg{babel} shorthands for Russian (based on a patch by \TA{Vladimir Lomov})
-% \item Fix ¦\fnum@{table,figure}¦ for Lithuanian
-% \item Various improvements in ¦gloss-russian¦ (provided by \TA{Vladimir Lomov} and
-% others)
-% \item Corrected captions for Bahasai, Lithuanian, Russian, Croatian
-% \item Add option \xpgoption{indentfirst=true} for Spanish, Croatian and other languages
-% (\xpgoption{indentfirst} was previously named \xpgoption{frenchindent})
-% \item New option \xpgoption{script} for German: Setting \xpgoption{script=fraktur} modifies the
-% captions for typesetting in Fraktur.
-% \item New command ¦\aemph¦ for Arabic, Farsi, Urdu, etc. to mark emphasis through
-% overlining.
-% \item Package option \xpgoption{nolocalmarks} is now true by default: to activate it the
-% option \xpgoption{localmarks} must be passed instead.
-% \item Loading languages à la \pkg{babel} as package options is no longer possible (this
-% feature was deprecated since v1.1.0).
-% \end{itemize}
-%
-% \subsection*{1.1.1 (2010/03/23)}
-% \begin{itemize}
-% \item Bugfix for French: explicit spaces before/after double punctuation
-% signs (Par exemple : les grands « espaces » du Canada !) are
-% now replaced by the appropriate non-breaking spaces, as in \pkg{babel}.
-% \item Bugfix for font switching mechanism within Latin script
-% (pending a complete re-implemen\-tation in v1.2):
-% the font shape and series are no longer reset when switching language.
-% \item New macros for non-Western decimal digits
-% (instead of fontmappings)
-% \item New gloss files for Asturian, Lithuanian and Urdu
-% \item ¦hijrical.sty¦ is now locale-aware: ¦\hijritoday¦ is
-% formatted differently in Arabic, Farsi, Urdu, Turkish
-% and Bahasa Indonesia.
-% \item Enable \xpgoption{babelshorthands} for Dutch
-% \item Add missing macro ¦\allowhyphens¦
-% \item Add global option \xpgoption{babelshorthands}
-% \item Support Catalan geminated l
-% \item Bugfix when declaring more than one pkg option
-% \item Protect ¦\reset@font¦
-% \item Add missing requirement \pkg{makecmds}
-% \item Bugfix for smallcaps in captions
-% \item Typo for ¦ccname¦ in Hebrew
-% \item Add option \xpgoption{numerals} to ¦gloss-russian¦
-% \item Provide ¦\newXeTeXintercharclass¦ when undefined
-% \item Bugfix for Russian ¦\alph¦
-% \item Remove superfluous level of ¦{}¦ in definition of ¦\markright¦
-% \item Bugfix for ¦\datecatalan¦
-% \item Change ¦hyphenmins¦ for Sanskrit
-% \end{itemize}
-%
-% \subsection*{1.1.0b (2009/11/22)}
-% \begin{itemize}
-% \item Modify ¦\hyphenmins¦ for Sanskrit (\TA{Yves Codet})
-% \item Bugfixes for Serbian and Bulgarian (\TA{Enrico Gregorio})
-% \end{itemize}
-%
-% \subsection*{1.1.0a (2009/11/22)}
-% \begin{itemize}
-% \item Bugfix for interchar tokens
-% \end{itemize}
-%
-% \subsection*{1.1.0 (2009/11/20)}
-% \begin{itemize}
-% \item Use ¦\newXeTeXintercharclass¦ (thanks to \TA{Enrico Gregorio})
-% \item Fixed implementation of shorthands for German (\pkg{babel} code in file ¦babelsh.def¦)
-% \item Arabic (\TA{Khaled Hosny}):
-% \begin{itemize}
-% \item Fix abjad form for 3 and 5 and add option ¦\abjadjimnotail¦
-% \item bugfix for ¦\arabicnumber¦
-% \item make Gregorian calendar the default
-% \item fixed typos in the sample text
-% \end{itemize}
-% \item Turkish (\TA{S. Ö. Yıldız}):
-% \begin{itemize}
-% \item fix white-space before : and !
-% \item also check if the font specified TRK for language
-% \item added missing Turkish translation of ``Glossary''
-% \end{itemize}
-% \item Suppress ¦nopattern¦ warning for non-hyphenated scripts
-% \item Changed U+0163 to U+021B for Romanian (\TA{Elie Roux})
-% \item Stylistic fixes and use macro ¦\xpg@option¦ for package options (\TA{E. Gregorio})
-% \item Fix month names in Dutch (\TA{A. Ledda})
-% \item Add Brazilian translation for ``glossary''
-% \item Remove spurious space generated by ¦gloss-spanish¦
-% \item Fix ¦ldf¦ file for brazilian
-% \item Various improvements in the code communicated by \TA{E. Gregorio}:
-% \begin{itemize}
-% \item remove superfluous ¦\protect\language¦
-% \item change default language from ¦0¦ to ¦\l@nohyphenation=255¦
-% \item localize ¦lccode¦ handling of apostrophe in French; add it to Italian
-% \end{itemize}
-% \item Fix ¦frenchspacing¦ for Vietnamese
-% \item Other minor bugfixes
-% \end{itemize}
-%
-% \subsection*{1.0.2 (2009/01/27)}
-% \begin{itemize}
-% \item Captions corrected in Hebrew, Russian and Spanish
-% \item Removed all ¦\text<lang>¦ wrappers within caption definitions
-% \item Improved compatibility with \pkg{babel}
-% \item New option \xpgoption{babelshorthands} for German
-% \item New option \xpgoption{Script} for Sanskrit
-% \end{itemize}
-%
-% \subsection*{1.0.1 (2008/07/31)}
-% \begin{itemize}
-% \item Improved documentation (added sections on font setup and numeration mappings)
-% \item Improvements and bug fixes for English and German
-% \item Bugfix in ¦gloss-syriac.ldf¦ (spurious space after ¦\textsyriac{...}¦)
-% \item Extended the scope of ¦\syriacabjad¦
-% \item Added ¦gloss-amharic.ldf¦ (ported from ¦ethiop.ldf¦ in the package \pkg{ethiop})
-% \end{itemize}
-%
-% \subsection*{1.0 (2008/07/13)}
-% \begin{itemize}
-% \item Initial release on CTAN.
-% \end{itemize}
-% \egroup
-%
-% \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
-% 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}
-% (\pkg{arabi}), and \TA{Vafa Khalighi} (\pkg{xepersian} and \pkg{bidi}).
-% The work of \TA{Mojca Miklavec} and \TA{Arthur Reutenauer} on hyphenation patterns with their package
-% \pkg{hyph-utf8} is of course invaluable. I should also thank other
-% individuals for their assistance in supporting specific languages: \TA{Yves Codet}
-% (Sanskrit), \TA{Zdenĕk Wagner} (Hindi), \TA{Mikhal Oren} (Hebrew), \TA{Sergey Astanin} (Russian),
-% \TA{Khaled Hosny} (Arabic), \TA{Sertaç Ö. Yıldız} (Turkish), \TA{Kamal Abdali} (Urdu),
-% and several other members of the \XeTeX\ user community, notably \TA{Enrico Gregorio}, who
-% has sent me many useful suggestions and corrections and contributed the \cmd\newXeTeXintercharclass\
-% mechanism in xelatex.ini which is now used by polyglossia.
-% More recently, \TA{Kevin Godby} of the \href{http://ubuntu-manual.org}{Ubuntu Manual} project has
-% contributed very useful feedback, bug hunting and, with the help of translators,
-% new language definition files for Asturian, Lithuanian, Occitan, Bengali, Malayalam, Marathi, Tamil, and Telugu.
-% It is particularly heartening to realize that this package is used to typeset a widely-read
-% document in dozens of different languages!
-% Support for Lao was also added thanks to \TA{Brian Wilson}.
-% I also thank \TA{Alan Munn} for kindly proof-reading the penultimate version of this documentation.
-% And of course my gratitude also goes to \TA{Jonathan Kew}, the formidable author of \XeTeX!
-%
-% \section{More acknowledgements (by the current development team)}
-% Many thanks to all the people who have contributed bugfixes and new features to \pkg{polyglossia}
-% 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{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},
-% \TA{Osman Tursun}, \TA{Keno Wehr}, \TA{Dominik Wujastyk}, \TA{Sertaç Ö. Yıldız}, \TA{Andrey Zgarbul}, \TA{Maksim Zholudev},
-% \TA{Yan Zhou}, and \TA{Stefan Zlatinov}.
-% Their respective contributions can be identified from the contributor statistics on
-% \href{https://github.com/reutenauer/polyglossia/graphs/contributors}{GitHub}.
-%
-% Among the ones who sent contributions directly to us we would like to especially thank
-% \TA{Claudio Beccari}, the indefatigable champion of Romance languages, and beyond! Furthermore,
-% kudos go to \TA{Moritz Wemheuer} (of \pkg{biblatex}) who has helped a lot to improve \pkg{polyglossia} interaction
-% with \pkg{biblatex} and \pkg{csquotes}.
-%
-% Not at least, we are very grateful for all bug reports and feature enhancement requests we received from
-% the numerous users we cannot list all here (but again, you can find all names on \href{https://github.com/reutenauer/polyglossia/issues?utf8=%E2%9C%93&q=is%3Aissue}{GitHub}).
-% Please go on with that, you are keeping \pkg{polyglossia} running!
-%
-%
-%
-%
-% \StopEventually{}
-% \section{Implementation}
-% \iffalse
-%<*polyglossia.sty>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia.sty}
-% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesExplPackage
- {polyglossia} {2024/03/07} {v2.1}
- {Modern multilingual typesetting with XeLaTeX and LuaLaTeX}
-
-\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
- \ProvideDocumentCommand \texorpdfstring { m m } { #1 } % dummy command if hyperref is not loaded
-}
-
-%% when no patterns are available, we use \l@nohyphenation, assigned to 255
-%% (suggestion by Enrico Gregorio)
-%% \l@nohyphenation is defined in polyglossia.lua
-\sys_if_engine_luatex:TF
- {
- \RequirePackage{luatexbase} % already included by fontspec, but needed here
- \RequireLuaModule{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
-\cs_if_exist:cTF { e@alloc@intercharclass@top }
- { \let\xpg@boundaryclass=\e@alloc@intercharclass@top }
- { \chardef\xpg@boundaryclass=\@cclv }
-
-% Useful for getting list of loaded languages and variants. Like babel's bbl@loaded
-% all language loaded
-\seq_new:N \__xpg_langs_loaded
-% list of loaded languages (polyglossia name)
-\clist_new:N \xpg@loaded
-% list of loaded variants
-\clist_new:N \xpg@vloaded
-% list of loaded languages (babel name)
-\clist_new:N \xpg@bloaded
-% list of loaded languages (bcp-47 id)
-\clist_new:N \xpg@bcp@loaded
-
-% output counter as lower-case latin letter
-\DeclareExpandableDocumentCommand \latinalph { m }
-{
- \exp_args:Nc \latin@alph {c@#1}
-}
-% output counter as upper-case latin letter
-\DeclareExpandableDocumentCommand \latinAlph { m }
-{
- \exp_args:Nc \latin@Alph {c@#1}
-}
-
-%% Internal hooks
-% select language hook
-\cs_new_nopar:Nn \__xpg_at_begin_document_selectlanguage: {}
-% \disablehyphenation hook
-\cs_new_nopar:Nn \__xpg_at_begin_document_hyphenation: {}
-
-% hook to be executed at begin of document
-\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
- % push to C language gloss
- \let\polyglossia@Clang@@arabic\@arabic
- \let\polyglossia@Clang@arabic\arabic
-
- \xpg_initial_setup:
- % apply \familydefault changes
- \xpg@set@familydefault
-}
-
-\AddToHook{begindocument}{
- \__xpg_at_begin_document:
-}
-
-% The following needs to go after any \AtBeginDocument (also of packages
-% 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}{
- % 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
- % If hyphenation disabling has been requested in preamble, do it now
- \__xpg_at_begin_document_hyphenation:
-}
-
-%% custom message macros
-\providecommand*{\xpg@error}[1]{
- \PackageError{polyglossia}{#1}{}
-}
-
-\providecommand*{\xpg@warning}[1]{
- \PackageWarning{polyglossia}{#1}
-}
-
-\providecommand*{\xpg@info}[1]{
- \PackageInfo{polyglossia}
- {#1\@gobble}
-} %% the \@gobble is to prevent displaying the line nr
-
-%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}
-
-\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
- }
-
-\def\xpg@ill@value#1#2{
- \xpg@warning{Illegal~ value~ (#1)~ for~ #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}
- {
- \xpg@error{language~ #1~ is~ not~ loaded.~ Please~ load~ it~ before~ using~ it.}
- }
-}
-
-\msg_new:nnn { polyglossia } { languagenotloaded }
-{
- The~ language~ #1~ is~ not~ loaded.~ You~ should~ load~ it.
-}
-\msg_redirect_name:nnn { polyglossia } { languagenotloaded } { critical }
-
-\msg_new:nnn { polyglossia } { languagenolongerloaded }
-{
- The~ language~ #1~ is~ no~ longer~ loaded.~ Please~ rerun~ LaTeX.
-}
-\msg_redirect_name:nnn { polyglossia } { languagenolongerloaded } { warning }
-
-\msg_new:nnn { polyglossia } { unknownlocalnumeral }
-{
- Unknown~ key~ "#1"~ in~ \string\localnumeral.
-}
-
-\msg_new:nnn { polyglossia } { localnumeralemptyvalue }
-{
- Keys~ of~ \string\localnumeral~ must~ have~ value.
-}
-
-
-%% 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 }
- }
-}
-\cs_generate_variant:Nn \__xpg_use_or_warn:N {c}
-
-
-%% 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}}}
-
-%% Used by the language definitions files for right-to-left languages
-\NewDocumentCommand \RequireBidi {}
-{
- \sys_if_engine_luatex:TF
- {\ifx\@onlypreamble\@notprerr\else\RequirePackage{luabidi}\fi}
- {\ifx\@onlypreamble\@notprerr\else\RequirePackage{bidi}\fi}
-}
-
-% if #1 is LR run #2 else #3
-\prg_set_conditional:Nnn \__xpg_if_LR_str:n {p, T, F, TF}
-{
- \str_case_e:nnF{#1}{
- {LR}{\prg_return_true:}
- {RL}{\prg_return_false:}
- }
- {
- \xpg@error{Unknown~ direction~#1}
- \prg_return_false:
- }
-}
-\prg_generate_conditional_variant:Nnn \__xpg_if_LR_str:n {e} {p, T, F, TF}
-
-% (lua)bidi commands to change directionality for paragraphs
-% and inline text.
-% overwritten with correct package
-\cs_new_nopar:Nn \__xpg_set_par_direction:n
-{
- \__xpg_if_LR_str:nF {#1}
- {
- \xpg@error{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!}
- }
-}
-\AddToHook{package/bidi/after}{
- \cs_gset_nopar:Nn \__xpg_set_par_direction:n
- {
- \__xpg_if_LR_str:nTF{#1}
- {
- \setLR
- }
- {
- \setRL
- }
- }
- \cs_gset_nopar:Nn \__xpg_set_text_direction:n
- {
- \__xpg_if_LR_str:nTF{#1}
- {
- \LRE
- }
- {
- \RLE
- }
- }
-}
-\AddToHook{package/luabidi/after}{
- \cs_gset_nopar:Nn \__xpg_set_par_direction:n
- {
- \__xpg_if_LR_str:nTF{#1}
- {
- \setLR
- }
- {
- \setRL
- }
- }
- \cs_gset_nopar:Nn \__xpg_set_text_direction:n
- {
- \__xpg_if_LR_str:nTF{#1}
- {
- \LRE
- }
- {
- \RLE
- }
- }
-}
-
-% emulate \RTLmain
-\sys_if_engine_luatex:TF
- { \cs_new_nopar:Nn \__xpg_setRTLmain: { \setRTLmain } }
- { \cs_new_nopar:Nn \__xpg_setRTLmain: { \@RTLmaintrue\setnonlatin } }
-
-%% compatibility with babel
-\let\addto\gappto % gappto is defined in etoolbox
-
-%% NEW EXPERIMENTAL 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.)
-%% 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
-%% hyphenmins : the hyphenmins for this language (comma-sep list of two integers)
-%% frenchspacing : boolean
-%% indentfirst : boolean
-%% fontsetup : boolean
-%% 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]{
- \__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?
- % here we do the fontsetup:
- \__xpg_auto_setupfont:n { #1 }
- %% TODO? \toggletrue{#1@setup@done}
- % register base alias
- \xpg_language_alias { #1 } { #1 }
-}
-
-% Adjust language key setting after initial setup.
-% Principally any key can be altered this way.
-% The command is mainly used in gloss file where
-% different options (variant, script, etc.) result
-% in different babel names, bcp47 specification,
-% or OpenType language or script tags.
-\DeclareDocumentCommand \SetLanguageKeys { m m }
-{
- \clist_map_inline:nn { #1 } { \keys_set:nn { polyglossia / ##1 } { #2 } }
-}
-
-
-% 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}
- % for each hyphen in the set until we find one that works
- \clist_map_inline:Nn \l_tmpa_clist {
- \ifbool{havehyphen}{}{
- % check if language hyphenname is defined
- \__xpg_check_if_exist_l@:nF{#1}{
- % if not, first consider nohyphenation
- \str_if_eq:nnTF{##1}{nohyphenation}
- {
- \cs_gset_eq:cc{l@#1}{l@##1}
- \global\booltrue{havehyphen}
- }{
- % then test if hyphenation is defined
- \xpg@ifdefined{##1}{
- % test if language hyphenation is nohyphenation
- \cs_if_eq:cNF{l@#1}{\l@nohyphenation}{\global\booltrue{havehyphen}}{%
- % 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}
- }
- }{}
- }
- }
- }
- }
- % 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
- }
- }
- \csdef{#1@language}{
- \polyglossia@setup@language@patterns{#1}
- }
- % setup hyphenmins
- \clist_set:Ne \l_tmpa_clist
- { \prop_item:Nn \g_xpg_langsetup_prop {#1 / hyphenmins} }
- \cs_if_eq:cNF {l@#1} \l@nohyphenation
- {
- \use:x
- {
- \exp_not:N \setlocalhyphenmins {#1}
- { \clist_item:Nn \l_tmpa_clist {1} }
- { \clist_item:Nn \l_tmpa_clist {2} }
- }
- }
-}
-
-\newcommand*\polyglossia@setup@language@patterns[1]{
- \bool_if:NTF \g__xpg_hyphenation_disabled_bool
- {
- \tl_gset:Ne \g__xpg_lastlanguage_tl {\the\csname l@#1\endcsname}
- }{
- % first, test if \l@#1 exists
- % without that, \csname l@#1\endcsname will be defined as \relax
- \cs_if_exist:cTF {l@#1}
- {
- \cs_if_eq:cNTF {l@#1} \l@nohyphenation
- {
- \language=\l@nohyphenation
- }
- {
- \xpg@set@hyphenation@patterns{#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}
- }
- }
-}
-
-\prop_new:N \g_xpg_langsetup_prop
-
-\cs_new_protected:Npn \__xpg_keys_define_lang:n #1
-{
- \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}
- {\tl_if_empty:nF{##1}{\str_lowercase:n{##1}}}
- },
- #1 / script
- .value_required:n = true,
- #1 / script
- .initial:n = latin,
- % the opentype script tag
- #1 / scripttag
- .code:n = {\prop_gput:Nnn{\g_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}},
- #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}},
- #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}},
- #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}},
- #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}},
- #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}},
- #1 / bcp47-script
- .value_required:n = true,
- #1 / bcp47-script
- .initial:n = {},
- % the BCP-47 variant tag
- #1 / bcp47-variant
- .code:n = {\prop_gput:Nnn{\g_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}},
- #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}},
- #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}},
- #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}},
- #1 / bcp47-casing
- .value_required:n = false,
- #1 / bcp47-casing
- .initial:n = {},
- % hyphennames
- #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 {,}}
- },
- #1 / hyphennames
- .value_required:n = true,
- #1 / hyphennames
- .initial:x = {\c_empty_clist},
- % direction
- #1 / direction
- . code:n = {
- \str_case_e:nnTF{##1}{
- {LR}{}
- {RL}{\RequireBidi}
- }
- {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/direction}{##1}}
- {\xpg@error{Unknown~ direction~ "##1"~ for~ language~ "#1"}}
- },
- #1 / direction
- .value_required:n = true,
- #1 / direction
- .initial:n = {LR},
- % minimal left and right hyphenation minima using
- #1 / hyphenmins
- .code:n = {
- % check syntax
- \int_compare:nNnF { \clist_count:n {##1} } = {2}
- {\xpg@error{hypenmins~should~be~a~list~of~two~entries,~got~"##1"}}
- % set prop
- \prop_gput:Nnn \g_xpg_langsetup_prop {#1/hyphenmins} {##1}
- },
- #1 / hyphenmins
- .value_required:n = true,
- #1 / hyphenmins
- .initial:n = {2,3},
- % minimal length for hyphenation (LuaTeX only)
- #1 / totalhyphenmin
- .code:n = {
- % check syntax
- \int_compare:nNnF { \clist_count:n {##1} } = {1}
- {\xpg@error{totalhyphenhypenmin~should~be~a~single~entry,~got~"##1"}}
- % set prop
- \prop_gput:Nnn \g_xpg_langsetup_prop {#1/totalhyphenmin} {##1}
- },
- #1 / totalhyphenmin
- .value_required:n = false,
- % frenchspacing
- #1 / frenchspacing .bool_gset:c = g__xpg_#1_fs_bool ,
- #1 / frenchspacing .default:n = true ,
- #1 / frenchspacing .initial:n = false ,
- % indent first line
- #1 / indentfirst .bool_gset:c = g__xpg_#1_if_bool ,
- #1 / indentfirst .default:n = true ,
- #1 / indentfirst .initial:n = false ,
- % fontsetup
- #1 / fontsetup .bool_gset:c = g__xpg_#1_fontsetup_bool ,
- #1 / fontsetup .default:n = true ,
- #1 / fontsetup .initial:n = false ,
- % environment name
- #1 / envname
- .code:n = {
- \prop_gput:Nnn{\g_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}
- },
- #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}
- },
- #1 / localnumeral.value_required:n = true,
- #1 / localnumeral.initial:n = {polyglossia@C@localnumeral},
- % uppercased
- #1 / Localnumeral
- . code:n = {
- \prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/Localnumeral}{##1}
- },
- #1 / Localnumeral.value_required:n = true,
- #1 / Localnumeral.initial:n = {polyglossia@C@localnumeral},
- % environment define command (by default create the environment)
- #1 / DefineCommandsCmd
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/DefineCommandsCmd}{##1}},
- #1 / DefineCommandsCmd
- .value_required:n = true,
- #1 / DefineCommandsCmd
- .initial:n = {xpg_define_language_commands:e}
- }
-}
-
-% TODO move to C module
-\newcommand*{\polyglossia@C@localnumeral}[2]{
- \polyglossia@Clang@@arabic{#2}
-}
-
-\cs_new:Npn \__xpg_localnumeral_parse:nn #1 #2
- {
- \str_if_eq:eeF { #1 } { lang } { \msg_error:nnn { polyglossia } { unknownlocalnumeral } { #1 } }
- \exp_args:Ne \str_case:nnF { #2 }
- {
- { local } { }
- { main } { \foreignlanguage { \mainlanguagename } }
- }
- { \foreignlanguage { #2 } }
- }
-
-\cs_new:Npn \__xpg_localnumeral:nnn #1 #2 #3
- {
- \use:e
- {
- \keyval_parse:nnn
- { \msg_error:nnn { polyglossia } { localnumeralemptyvalue } }
- {
- \__xpg_localnumeral_parse:nn
- } { #2 }
- }
- { \use:c { \prop_item:Ne \g_xpg_langsetup_prop
- { \languagename / #3 } } { } { #1 } }
- }
-
-\NewExpandableDocumentCommand \localnumeral { s O{ lang=local } m }
- {
- \IfBooleanTF { #1 }
- {
- \exp_args:Nc \__xpg_localnumeral:nnn { c@#3 } { #2 } { localnumeral }
- }
- {
- \__xpg_localnumeral:nnn { #3 } { #2 } { localnumeral }
- }
- }
-
-\NewExpandableDocumentCommand \Localnumeral { s O{ lang=local } m }
- {
- \IfBooleanTF { #1 }
- {
- \exp_args:Nc \__xpg_localnumeral:nnn { c@#3 } { #2 } { Localnumeral }
- }
- {
- \__xpg_localnumeral:nnn { #3 } { #2 } { Localnumeral }
- }
- }
-
-\cs_new_nopar:Npn \__xpg_french_spacing:n #1
- {
- \bool_if:cTF { g__xpg_#1_fs_bool }
- { \frenchspacing } { \nonfrenchspacing }
- }
-
-\cs_new_nopar:Npn \__xpg_indent_first:n #1
- {
- \bool_if:cTF { g__xpg_#1_if_bool }
- { \french@indent } { \nofrench@indent }
- }
-
-\cs_new:Nn \__xpg_lang_set_par_direction:n
-{
- \prop_get:NeNTF \g_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}
- }
-}
-
-
-\cs_new:Nn \__xpg_lang_set_text_direction:nn
-{
- \prop_get:NeNTF \g_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}
- }
-}
-
-\tl_new:N \g__xpg_lastlanguage_tl
-\tl_set:Nn \g__xpg_lastlanguage_tl { 0 }
-
-% Track whether hyphenation is disabled
-\bool_new:N \g__xpg_hyphenation_disabled_bool
-
-\DeclareDocumentCommand \disablehyphenation {}
-{
- \bool_if:NTF \g_xpg_main_lang_set_bool
- {
- \__xpg_disable_hyphenation:
- }
- {
- % we have to postpone the execution until the main language
- % has been set (#125).
- \cs_gset_nopar:Nn \__xpg_at_begin_document_hyphenation: {
- \__xpg_disable_hyphenation:
- }
- }
-}
-
-\cs_new:Nn \__xpg_disable_hyphenation:
-{
- \bool_if:NF \g__xpg_hyphenation_disabled_bool
- {
- \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.
- % "nohyphenation" is not listed in language.dat.lua.
- \language=\l@nohyphenation
- }
-}
-
-\DeclareDocumentCommand \enablehyphenation {}
-{
- \bool_if:NT \g__xpg_hyphenation_disabled_bool
- {
- \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}}
- }
- {
- \xpg@info{Skipping~ automatic~ font~ setup~ for~ language~ #1}
- }
-}
-
-
-% add fontfeature Language=#2 to langtag #1
-% do nothing if #1 or #2 is empty
-\cs_new:Nn \__xpg_add_font_feature_language:nn
-{
- \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~
- (Language="#2"~ to~ langtag~ "#1")}
- }
- {
- \str_if_eq:nnTF{#2}{Turkish}{
- \fontspec_if_language:nTF {TRK}
- {
- \addfontfeature{Language=Turkish}
- }
- {
- \fontspec_if_language:nTF {TUR}
- {
- \addfontfeature{Language=Turkish}
- }{}
- }
- }{
- \fontspec_if_language:nTF{#1}
- {
- \addfontfeature{Language=#2}
- }
- {}
- }
- }
-}
-\cs_generate_variant:Nn \__xpg_add_font_feature_language:nn { on , no, oo , Vn, nV, VV , xn, nx, xx}
-
-% add fontfeature Script=#2 to scripttag #1
-% do nothing if #1 or #2 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
- (Script="#3"~ to~ scripttag~ "#2")}
- }
- {
- \fontspec_if_script:nTF{#2}
- {\addfontfeature{Script=#3}}
- {
- \tl_set:Nn \xpg_ffamily_tl {}
- \tl_set:Nn \xpg_ffamilysh_tl { #1 }
- \str_if_eq:nnT { #1 } { rm }
- {
- \tl_set:Nn \xpg_ffamily_tl { roman }
- \tl_set:Nn \xpg_ffamilysh_tl {}
- }
- \str_if_eq:nnT { #1 } { sf }
- {
- \tl_set:Nn \xpg_ffamily_tl { sans~ serif }
- }
- \str_if_eq:nnT { #1 } { tt }
- {
- \tl_set:Nn \xpg_ffamily_tl { monospace }
- }
- % Strip font family name for error message
- % Courtesy of egreg, https://tex.stackexchange.com/a/613996
- \str_set:Nx \xpg_fname_str { \fontname\font }
- % Remove all after :
- \regex_replace_once:nnN { \:.* } { } \xpg_fname_str
- % ... and all after /
- \regex_replace_once:nnN { /.* } { } \xpg_fname_str
- % ... and brackets
- \regex_replace_once:nnN { \[ } { } \xpg_fname_str
- \regex_replace_once:nnN { \] } { } \xpg_fname_str
- % ... and extensions
- \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
- }
- }
- }
-}
-\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
-}
-
-\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}
- {
- \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}
- {
- \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}}
- }
- \def\familytype{tt}
- }
- \endgroup
-}
-
-%%% END OF PolyglossiaSetup
-
-%% ensure localization of \markright and \markboth commands
-%%% THIS IS NOW DISABLED BY DEFAULT
-\cs_new_nopar:Nn \__xpg_local_marks:n { }
-\cs_new_nopar:Nn \__xpg_enable_local_marks:
-{
- \xpg@info{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
- }
- }
-}
-
-%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.}
- \PolyglossiaSetup{#1}{hyphenmins={2,3},hyphennames={#1},fontsetup=true}
- % the above amounts to:
- %\ifcsundef{l@#1}%
- % {\expandafter\adddialect\csname l@#1\endcsname\l@nohyphenation\relax}%
- % {\setlocalhyphenmins{#1}{2}{3}}%
- %\csdef{#1@language}{\language=\csname l@#1\endcsname}%
-}
-
-\newcommand{\xpg@input}[1]{
- % Store catcode of @ before making at letter
- \chardef\xpg@saved@at@catcode\catcode`\@
- \makeatletter
- \input{#1}
- % restore former @ catcode
- \catcode`\@=\xpg@saved@at@catcode
-}
-
-% try to load a language file
-\cs_new:Nn \__xpg_load_lang_definition:nn {
- \file_if_exist:nTF{gloss-#2.ldf}
- {
- % Temporarily force catcode of ~ to 13 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}
- % restore former ~ catcode
- \xpg@restore@tilde@catcode
- }
- {
- \xpg@nogloss{#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}
- \seq_if_in:NeF \__xpg_langs_loaded {#1}
- {
- % 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}
- {#1/DefineCommandsCmd}}
- {#1}
- }
- }
- \__xpg_register_language:nn{}{#1}
- \seq_gput_right:Nn \__xpg_langs_loaded {#1}
-}
-
-\prop_new: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{} }
- {
- \otherlanguage [ ##1 ] { #1 }
- }
- {
- \endotherlanguage
- }
- \exp_args:Nc \NewDocumentCommand {text#1} { O{} m }
- {
- \__xpg_textlanguage:een{##1}{#1}{##2}
- }
- }
-}
-\cs_generate_variant:Nn \xpg_define_language_commands:n {e}
-
-
-% resolve alias property #1 lang #2 item
-\cs_new:Nn \xpg_alias_prop_item:nn {
- \prop_if_in:NeTF \__xpg_alias {#1/#2}
- {
- \prop_item:Ne \__xpg_alias {#1/#2}
- }
- {
- \prop_if_in:NeTF \__xpg_alias {#1/target}
- {
- % 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}
- }
- % load alias by recursion
- {
- \xpg_alias_prop_item:ee { \prop_item:Ne \__xpg_alias {#1/target} } {#2}
- }
- }
- {
- % empty
- }
- }
-}
-\cs_generate_variant:Nn \xpg_alias_prop_item:nn {en, ne, ee}
-
-% add option #2 to list of option of language #1
-\cs_new:Nn \xpg_alias_add_to_option_i:nn
-{
- \tl_if_blank:eTF {#2}
- {
- \xpg_alias_prop_item:nn {#1}{options}
- }
- {
- \tl_if_blank:eTF { \xpg_alias_prop_item:nn {#1}{options} }
- {
- #2
- }
- {
- \xpg_alias_prop_item:nn {#1}{options},#2
- }
- }
-}
-
-
-% get base language
-\cs_new:Nn \xpg_alias_base_lang:n
- {
- \prop_item:Ne \__xpg_alias {#1/target}
- }
-\cs_generate_variant:Nn \xpg_alias_base_lang:n {e}
-
-\keys_define:nn { polyglossia/alias }
-{
- % babelname\l_tmpa_prop
- babelname .prop_put:N = \__xpg_language_alias_prop,
- % bcp47
- bcp47 .prop_put:N = \__xpg_language_alias_prop,
- % variant
- variant .prop_put:N = \__xpg_language_alias_prop,
-}
-
-
-
-% provide way to define alias environment and command
-% #1 () variant
-% #2 [] option (not yet without variant and bcp47 name)
-% #3 language
-% #4 () babel name
-% #5 [] bcp47 name
-% #6 alias
-\DeclareDocumentCommand \xpg_language_alias { D(){} O{} m D(){} O{} m}
-{
- \prop_gremove:Nn \__xpg_alias {#6/target}
- \prop_gremove:Nn \__xpg_alias {#6/options}
- \prop_gremove:Nn \__xpg_alias {#6/bcp47}
- \prop_gremove:Nn \__xpg_alias {#6/babelname}
- \prop_gremove:Nn \__xpg_alias {#6/variant}
- \prop_gput:Nee \__xpg_alias {#6/target} {#3}
- \tl_if_blank:eF {#1}
- {
- \prop_gput:Nee \__xpg_alias {#6/variant} {#1}
- }
- \tl_if_blank:eF {#5}
- {
- \prop_gput:Nee \__xpg_alias {#6/bcp47} {#5}
- }
- \tl_if_blank:eF {#4}
- {
- \prop_gput:Nee \__xpg_alias {#6/babelname} {#1}
- }
- \tl_if_blank:eF {#2}
- {
- \prop_gput:Nee \__xpg_alias {#6/options} {#2}
- }
-}
-
-
-% provide way to define alias environment and command
-% \setlanguagealias[<options>]{<language>}{<alias>}
-\DeclareDocumentCommand \setlanguagealias {s O{} m m}
-{
- % The starred version does not define commands and environments
- \IfBooleanF {#1}
- {
- \exp_args:Nc \DeclareDocumentCommand {text#4} { O{} m }
- {
- \__xpg_textlanguage:een {##1} {#4} {##2}
- }
- \DeclareDocumentEnvironment { #4 } { }
- {
- \otherlanguage { #4 }
- }
- {
- \endotherlanguage
- }
- }
- \tl_clear_new:N \__xpg_alias_option_tl
- \prop_clear_new:N \__xpg_language_alias_prop
- \keys_set_known:nnN{polyglossia/alias} {#2} \__xpg_alias_option_tl
- \xpg_language_alias
- (\prop_item:Nn \__xpg_language_alias_prop {variant})
- % TODO not yet [\__xpg_alias_option_tl]
- [#2]
- {#3}
- (\prop_item:Nn \__xpg_language_alias_prop {babelname})
- [\prop_item:Nn \__xpg_language_alias_prop {bcp47}]
- {#4}
-}
-
-\cs_new:Nn \__xpg_register_language:nn
-{
- \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}
- % register babelname
- \prop_get:NeN \g_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
- \clist_if_in:NeF \xpg@bcp@loaded {\l_tmpa_tl}{
- \clist_gput_right:Ne \xpg@bcp@loaded {\l_tmpa_tl}
- }
-}
-
-\DeclareDocumentCommand \setdefaultlanguage { O{} m }
-{
- % latex is an internal language, so do not record
- \str_if_eq:eeF{#2}{latex}
- {
- \clist_if_in:NeF \xpg@loaded {\xpg_alias_base_lang:n{##2}}{
- \clist_gput_right:Ne \xpg@loaded {\xpg_alias_base_lang:n{##2}}
- }
- }
- \seq_if_in:NeF \__xpg_langs_loaded {#2}
- {
- \__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}
- {#2/DefineCommandsCmd}}
- {#2}
- }
- \seq_gput_right:Ne \__xpg_langs_loaded {#2}
- }
- \exp_args:Nee \__xpg_set_default_language:nn {\xpg_alias_add_to_option_i:nn{#2}{#1}}
- {\xpg_alias_base_lang:n{#2}}
-}
-
-
-\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}
- %% 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_setRTLmain:
- }
- \cs_gset_nopar:Nn \__xpg_at_begin_document_selectlanguage: {
- \selectbackgroundlanguage{#2}
- \selectlanguage[#1]{#2}%
- }
- \xpg@info{Default~ language~ is~ #2}
- \polyglossia@set@language@name[#1]{#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
-
-% Returns the language ID of the current language
-% Currently supported: bcp-47
-\DeclareDocumentCommand \languageid {m}
-{
- \str_case:nnF {#1}
- {
- {bcp-47} { \csuse{bcp47.tag} }
- {bcp47} { \csuse{bcp47.tag} }
- }
- {
- \xpg@error{Invalid~ \string\languageid\space argument:~ #1}
- }
-}
-
-% Returns the language ID of the main language
-% Currently supported: bcp-47
-\DeclareDocumentCommand \mainlanguageid {m}
-{
- \str_case:nnF {#1}
- {
- {bcp-47} { \csuse{bcp47.main.tag} }
- {bcp47} { \csuse{bcp47.main.tag} }
- }
- {
- \xpg@error{Invalid~ \string\mainlanguageid\space argument:~ #1}
- }
-}
-% Kernel command to access to BCP-47 data.
-% Shared interface with babel.
-% We support:
-% * language (e.g., de)
-% * region (e.g., AT)
-% * script (e.g., Latn)
-% * variant (e.g., 1901)
-% * extension-t (transformation, e.g., en-t-ja)
-% * extension-u (additional locale information, e.g., ar-u-nu-latn)
-% * extension-x (e.g., classic for la-x-classic)
-% * casing (whatever is suitable for \MakeUppercase and friends,
-% usually alias to language but could also be something
-% like el-x-iota or ckb-Latn)
-% * tag (the registered full tag)
-% and main.* variants thereof
-% See https://github.com/latex3/latex2e/issues/1035
-\DeclareExpandableDocumentCommand \BCPdata {m}
-{
- \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}
- }%
-}
-
-
-\newcommand*{\resetdefaultlanguage}[2][]{
- \__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}%
- % 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}}
- {
- \@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}
-}
-
-% This saves the normalfont for the latin script since we may change normalfont in other scripts
-\let\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{
- \tl_if_empty:NF{\g__fontspec_nfss_enc_tl}{\fontencoding{\g__fontspec_nfss_enc_tl}}
- \fontfamily\rmdefault
- \ifdefined\UseHook\UseHook{rmfamily}\fi
- \selectfont
-}
-\DeclareRobustCommand\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
- \selectfont
-}
-\DeclareRobustCommand\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
- \selectfont
-}
-
-\def\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}}
-}
-
-% 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
- % This (re-)saves the normalfont for the latin script since we may
- % change normalfont in other scripts
- \let\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
- \@afterindenttrue
-}
-\def\nofrench@indent{
- \let\@afterindentfalse\@@fterindentfalse
- \@afterindentfalse
-}
-
-\DeclareDocumentCommand \selectbackgroundlanguage { m }
-{
- \__xpg_select_background_language:n {\xpg_alias_base_lang:n{#1}}
-}
-
-\cs_new:Nn \__xpg_select_background_language:n
-{
- \str_if_eq:eeTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/lcscript}}{latin}
- {}
- {\xpg@set@normalfont{#1}}
- \csuse{#1@globalnumbers}
-}
-\cs_generate_variant:Nn \__xpg_select_background_language:n {e}
-% Declare secondary language #2 with language options #1
-\DeclareDocumentCommand \setotherlanguage { O{} m }
-{
- \seq_if_in:NeF \__xpg_langs_loaded {#2}
- {
- \__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}
- {#2/DefineCommandsCmd}}
- {#2}
- }
- \__xpg_set_otherlanguage:ee {\xpg_alias_add_to_option_i:nn{#2}{#1}}
- {\xpg_alias_base_lang:n{#2}}
- \seq_gput_right:Ne \__xpg_langs_loaded {#2}
- }
-}
-
-\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???
- \bool_if:NTF \g__xpg_hyphenation_disabled_bool
- {
- \tl_gset:Ne \g__xpg_lastlanguage_tl {\z@}
- }{
- \language=\z@
- }
- \lefthyphenmin=\tw@
- \righthyphenmin=\thr@@}
-
-\cs_set:Nn \xpg_initial_setup:
-{
- \xpg_common_language:
-}
-
-
-% Alias to \text<lang>, but more suitable
-% for specific (esp. tag-based) aliases
-% where \text<alias> would cause clashes
-% (e.g., \textit)
-\newcommand\textlang[3][]{
- \__xpg_textlanguage:een {#1} {#2} {#3}
-}
-
-% prevent the language tag in \textlang
-% (second argument) from being affected
-% 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}
- \__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
-{
- \xpg@str@lowercase{\xpg@tmp@opts}{#2}
- \exp_args:Nne \setkeys{#1}{\xpg@tmp@opts}
-}
-
-% joint code of \foreignlanguage, otherlanguage*
-% and \text<lang>
-% #1 option
-% #2 language
-\cs_new:Nn \xpg_otherlanguage:nn
-{
- \xpg_error_if_lang_not_loaded:n{#2}
- \__xpg_set_keys:nn{#2}{#1}
- \polyglossia@setforeignlanguage[#1]{#2}
- % Hook for external packages such as biblatex
- \polyglossia@language@switched
- % buggy restoration heure
- \csuse{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
-% used in captions
-\newcommand{\setforeignlanguage}[2][]
-{
- \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}
-}
-
-% internal wrapper for foreign language
-% #1 option
-% #2 alias
-% #3 base lang
-% #4 text
-\cs_new:Nn \__xpg_foreignlanguage:nnnn
-{
- \tl_if_blank:nTF {#3}
- {
- \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}
-
-
-% 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:
- }
-
-% internal wrapper
-% #1 option
-% #2 alias
-% #3 base lang
-\cs_new:Nn \__xpg_otherlanguage:nnn
-{
- \tl_if_blank:nTF {#3}
- {
- \msg_show:nnn { polyglossia } { languagenotloaded } {#2}
- }{
- \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!
- }
-}
-\cs_generate_variant:Nn \__xpg_otherlanguage:nnn { eee }
-
-% use by \text<lang> and \textlang. Equivalent to \foreignlanguage,
-% except that dates are localized.
-% #1: option
-% #2: alias
-% #3: text
-\cs_new:Nn \__xpg_textlanguage:nnn
-{
- \__xpg_textlanguage:nnen {#1} {#2} {\xpg_alias_base_lang:n{#2}} {#3}
-}
-\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
-% #2: alias
-% #3: base language
-% #4: text
-\cs_new:Nn \__xpg_textlanguage:nnnn
-{
- \tl_if_blank:nTF {#3}
- {
- \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}
- % 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}
- \hyphenation{#3}
- \egroup
-}
-
-
-% Hook that other package authors can use
-% (for instance biblatex):
-% Do not rename!
-\newcommand*{\xpg@hook@setlanguage}{}
-
-\def\xpg@pop@language@i#1#2{
- \xpg@set@language@aux[#1]{#2}
- \xpg@hook@setlanguage
- \let\emp@langname\@undefined}
-
-\DeclareDocumentCommand \selectlanguage {s O{} m}
- {
- \tl_if_blank:eTF {\xpg_alias_base_lang:n{#3}}
- {
- \IfBooleanTF { #1 }
- { \msg_show:nnn { polyglossia } { languagenolongerloaded } {#3} }
- { \msg_show:nnn { polyglossia } { languagenotloaded } {#3} }
- }{
- \__xpg_select_language:nee {#1}
- { \xpg_alias_add_to_option_i:nn{#3}{#2} }
- { \xpg_alias_base_lang:n{#3} }
- }
- }
-
-\cs_new:Nn \__xpg_select_language:nnn
-{
- % Register the language options
- \__xpg_set_language_options:nnn {#3} {#2} {@xpg@set@langvariant}
- \IfBooleanTF { #1 } % The starred variant does not write to the aux
- {
- \xpg@set@language@nonaux[#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}
- }
- \__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
-{
- \tl_if_blank:nF {#2}
- {
- % 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}
- }
-}
-
-% 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}
-}
-
-% 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}
-}
-
-
-\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:}
- {
- \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:
- }
-}
-
-% 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}{
- \clist_if_in:NeTF \xpg@loaded{#1}{#2}{#3}
- }
-}
-
-% Same for babellanguage is loaded
-\DeclareDocumentCommand \ifbabellanguageloaded { m m m }
-{
- \AddToHook{begindocument/end}{
- \clist_if_in:NeTF \xpg@bloaded{#1}{#2}{#3}
- }
-}
-
-% Same for languageid
-\DeclareDocumentCommand \iflanguageidloaded { m m m m }
-{
- \AddToHook{begindocument/end}{
- \str_case:nnTF {#1}
- {
- {bcp-47} { \clist_if_in:NeTF \xpg@bcp@loaded{#2}{#3}{#4} }
- {bcp47} { \clist_if_in:NeTF \xpg@bcp@loaded{#2}{#3}{#4} }
- }
- {}
- {
- \xpg@error{Invalid~ \string\iflanguageidloaded\space argument:~ #1}
- }
- }%
-}
-
-% Check if the current font has a given glyph
-\prg_new_conditional:Npnn \__xpg_if_char:N #1 { TF }
- {
- \iffontchar\font\int_from_hex:n { #1 }~
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-
-% Test if a char (by char code) is available in the current font
-% and print it, if so, otherwise print the replacement #2
-\NewExpandableDocumentCommand \charifavailable { m m }
- {
- \exp_args:Nno \__xpg_if_char:NTF { #1 } { \Uchar"#1 } { #2 }
- }
-
-% Test if a char (by char code) is available in the current font
-% if so, do #2, else do #3
-\NewExpandableDocumentCommand \IfCharIsAvailableTF { m m m }
- {
- \__xpg_if_char:NTF { #1 } { #2 } { #3 }
- }
-
-
-\newcommand*{\xpg@set@language@nonaux}[2][]{
- \@select@language[#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}
- % Write to the aux
- \xpg@set@language@only@aux[#1]{#2}
-}
-
-\newcommand*{\xpg@set@language@only@aux}[2][]{
- % Write to the aux (toc files)
- \if@filesw
- \addtocontents{toc}{\selectlanguage*[#1]{#2}}
- \fi
-}
-
-\AtBeginDocument{
- \if@filesw
- \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}{
- \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 }
- {
- \bool_lazy_and:nnTF
- { \cs_if_exist_p:c { l@#1 } }
- { ! (\cs_if_eq_p:cc { l@#1 } { l@nohyphenation }) }
- { \prg_return_true: }
- { \prg_return_false: }
- }
-
-\def\polyglossia@luatex@load@lang#1{
- % 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}
- {
- \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]{
- % With luatex, we first need to define \l@#1.
- \sys_if_engine_luatex:T
- {
- \polyglossia@luatex@load@lang{#1}
- }
- \__xpg_check_if_exist_l@:nTF{#1}{#2}{#3}
-}
-
-% 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]{
- \sys_if_engine_luatex:T
- {
- \ifcsdef{bbl@hyphendata@#1}{}{
- \global\@namedef{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} }
- \language=\csname l@#1\endcsname
-}
-
-\newcommand*\@select@language[2][]{
- % hook for compatibility with biblatex
- \select@language{#2}
- \xpg@set@bbl@hyphendata{\the\language}
- \xpg_initial_setup:
- \select@@language[#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}%
- % 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}%
- \__xpg_indent_first:n { #2 }
- \csuse{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}
- }
-
-% 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{}
-
-% Hook for external packages such as biblatex
-% do not rename!
-\def\polyglossia@language@switched{}
-
-% remove all custumization 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)
- \cs_if_exist_use:c{noextras@bbl@\babelname}
-}
-
-% Common code for `\select@language' and `\foreignlanguage'.
-\newcommand{\select@@language}[2][]{%
- % 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:eF{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/direction}}
- {\setnonlatin} % LTR -> RTL
- }
- {
- \__xpg_if_LR_str:eT{\prop_item:Nn{\g_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_use_or_warn:c{#2@language}
- \cs_if_exist_use:c{#2@numbers}
- \use@localhyphenmins[#1]{#2}
- \__xpg_french_spacing:n { #2 }
-}
-
-
-\let\xpg@pop@language\relax
-
-%
-% 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}
-}
-
-\cs_generate_variant:Nn \__xpg_stack_language:nn {nx}
-
-\cs_new:Nn \__xpg_unstack_language:n
-{
- \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}
- {
- \clist_put_right:Nn \l_xpg_current_options {##1=##2}
- }
- % 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}
- }
-}
-
-% \setlanghyphenmins[options]{lang}{l}{r}
-\newcommand*\setlanghyphenmins[4][]{%
- % 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}
- % 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
-}
-
-% \use@localhypenmins[options]{lang}
-\newcommand*\use@localhyphenmins[2][]{
- \bgroup
- \xpg_error_if_lang_not_loaded:n{#2}
- \__xpg_set_keys:nn{#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}{}
- {
- \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{
- % Set \totalhyphenmin if specified
- \prop_get:NeNTF \g_xpg_langsetup_prop {#2/totalhyphenmin} \l_tmpa_tl
- {
- \xpg@info{totalhyphenmin: '\l_tmpa_tl'}
- \expandafter\hyphenationmin \l_tmpa_tl
- }
- {}
- }
-}
-
-% Babel previously compiled in hyphenrules into the kernel (via hyphen.cfg)
-% but this is no longer the case. In any case, we roll our own one now
-% and possibly overwrite babel's.
-% As opposed to the one inherited from switch.def/babel, our environment
-% supports language options and aliases.
-\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}}
- % Register the language options
- \__xpg_set_language_options:nnn {\xpg@tmp@lang} {\xpg@tmp@opts} {@xpg@set@langvariant}
- % Now switch patterns
- \__xpg_use_or_warn:c{\use:c{xpg@tmp@lang}@language}
- % And activate hyphenmins
- \use@localhyphenmins[\xpg@tmp@opts]{\xpg@tmp@lang}
- }
- { }
-
-\AddToHook{begindocument/before}{
- \IfPackageLoadedTF{bidi}{
- \providecommand*{\aemph}[1]{$\overline{\hboxR{#1}}$}
- }{}
- \IfPackageLoadedTF{luabidi}{
- \providecommand*{\aemph}[1]{$\overline{\hbox{\RL{#1}}}$}
- }{}
-}
-
-
-% keys for main package
-\keys_define:nn { polyglossia } {
- verbose
- .bool_set:N = \g_xpg_verbose_bool,
- verbose
- .default:n = true,
- % compatibility
- quiet
- .meta:n = { verbose = false },
-
- localmarks
- .bool_set:N = \g_xpg_localmarks_bool,
- localmarks
- .default:n = true,
- % compatibility
- nolocalmarks
- .meta:n = { localmarks = false },
-
- babelshorthands
- .legacy_if_set:n = system@babelshorthands, % compatibility
- babelshorthands
- .default:n = true,
-
- luatexrenderer
- .str_set:N = \g_xpg_luatex_renderer_str,
- luatexrenderer
- .value_required:n = true,
-}
-
-\keys_set:nn { polyglossia } {
- localmarks = false,
- verbose = true,
- babelshorthands = false,
- luatexrenderer = Harfbuzz
-}
-
-% load by default latex
-\setmainlanguage{latex}
-% then process key in order to overwrite
-\ProcessKeyOptions[polyglossia]
-
-% Set the LuaTeX renderer. As opposed to fontspec, we use Harfbuzz by default.
-% This can be changed via the luatexrenderer package option.
-\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}
- \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:nT \g_xpg_localmarks_bool {
- \__xpg_enable_local_marks:
-}
-
-% Control shorthand (de-)activation
-% This checks that the shorthand char is only deactivated
-% if we have activated it ourselves and hence keeps
-% activation of other packages if no shorthands are used.
-\seq_new:N \g__xpg_active_shorthands_seq
-
-\DeclareDocumentCommand \xpg@activate@shorthands { O{"} }
-{
- \seq_if_in:NnF \g__xpg_active_shorthands_seq { #1 }
- {
- \bbl@activate{#1}
- \seq_gpush:Nn \g__xpg_active_shorthands_seq { #1 }
- }
-}
-
-\DeclareDocumentCommand \xpg@deactivate@shorthands { O{"} }
-{
- \seq_if_in:NnT \g__xpg_active_shorthands_seq { #1 }
- {
- \cs_if_exist:cT{initiate@active@char}{\bbl@deactivate{#1}}
- \seq_remove_all:Nn \g__xpg_active_shorthands_seq {#1}
- }
-}
-
-% Inherit shorthands in other languages
-\NewDocumentCommand \inheritbabelshorthands { m m }
-{
- \AddToHook{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~
- \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~
- \string\inheritbabelshorthands,~ does~ not~ exist } }
- }
- % Test whether the requested shorthands exist
- \bool_if_exist:NF \l__xpg_no_shorthands_bool
- { \bool_new:N \l__xpg_no_shorthands_bool }
- \cs_if_exist:cF { \l__xpg_tmpa_lang_tl @shorthands }
- { \bool_set_true:N \l__xpg_no_shorthands_bool }
- \cs_if_exist:cF { no\l__xpg_tmpa_lang_tl @shorthands }
- { \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 }
- }
- % If so, apply:
- \bool_if:nF { \l__xpg_no_shorthands_bool }
- {
- \exp_args:Ncc \addto { blockextras@\l__xpg_tmpb_lang_tl } { \l__xpg_tmpa_lang_tl @shorthands }
- \exp_args:Ncc \addto { inlineextras@\l__xpg_tmpb_lang_tl } { \l__xpg_tmpa_lang_tl @shorthands }
- \exp_args:Ncc \addto { noextras@\l__xpg_tmpb_lang_tl } { no\l__xpg_tmpa_lang_tl @shorthands }
- }
- }
-}
-
-% Activate shorthands of a (loaded) language inline
-\NewDocumentCommand \usebabelshorthands { m }
-{
- \str_if_eq:nnTF { #1 } { none }
- {
- % "none" deactivates any shorthands
- \languageshorthands{none}
- }
- {
- \tl_set:Nn \l__xpg_tmpa_lang_tl { \xpg_alias_base_lang:n{#1} }
- \iflanguageloaded{\l__xpg_tmpa_lang_tl}{
- \use:c{\l__xpg_tmpa_lang_tl @shorthands}
- }{
- \xpg@error{ Language~ #1,~ requested~ in~
- \string\startbabelshorthands,~ is~ not~ loaded }
- }
- }
-}
-
-% \end{macrocode}
-% \iffalse
-%</polyglossia.sty>
-%<*farsical.sty>
-% \fi
-% \clearpage
-%
-% \subsection{farsical.sty}
-% \begin{macrocode}
-\ProvidesPackage{farsical}
- [2019/12/12 v0.2 %
- Farsi (jalali) calendar]
-\ifluatex\RequirePackage{luabidi}\else\RequirePackage{bidi}\fi
-\RequirePackage{calc,arabicnumbers}
-
-%TODO - rewrite completely using calc
-%% - use Reingold & Dershowitz ME
-%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Modified from Arabiftoday.sty which is part of the Arabi package:
-%%% Copyright (C) 2006 Youssef Jabri
-%%% itself a modification of the code in the FarsiTeX system:
-%%% Copyright (C) 1996 Hassan Abolhassani
-%%% Copyright (C) 1996-2001 Roozbeh Pournader <roozbeh@sharif.edu>
-%%% Copyright (C) 2000-2001 Behdad Esfahbod <behdad@bamdad.org>
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\newif\ifJALALI@leap \newif\ifJALALI@kabiseh
-\newcount\JALALI@i \newcount\JALALI@y \newcount\JALALI@m \newcount\JALALI@d
-\newcount\JALALI@latini \newcount\JALALI@farsii
-\newcount\JALALI@latinii \newcount\JALALI@farsiii
-\newcount\JALALI@latiniii \newcount\JALALI@farsiiii
-\newcount\JALALI@latiniv \newcount\JALALI@farsiiv
-\newcount\JALALI@latinv \newcount\JALALI@farsiv
-\newcount\JALALI@latinvi \newcount\JALALI@farsivi
-\newcount\JALALI@latinvii \newcount\JALALI@farsivii
-\newcount\JALALI@latinviii \newcount\JALALI@farsiviii
-\newcount\JALALI@latinix \newcount\JALALI@farsiix
-\newcount\JALALI@latinx \newcount\JALALI@farsix
-\newcount\JALALI@latinxi \newcount\JALALI@farsixi
-\newcount\JALALI@latinxii \newcount\JALALI@farsixii
- \newcount\JALALI@farsixiii
-
-\newcount\JALALI@temp
-\newcount\JALALI@temptwo
-\newcount\JALALI@tempthree
-\newcount\JALALI@yModHundred
-\newcount\JALALI@thirtytwo
-\newcount\JALALI@dn
-\newcount\JALALI@sn
-\newcount\JALALI@mminusone
-
-% \ftoday renamed to \Jalalitoday - FC
-\def\Jalalitoday{%
-\JALALI@y=\year \JALALI@m=\month \JALALI@d=\day
-%
-\JALALI@temp=\JALALI@y
-\divide\JALALI@temp by 100\relax
-\multiply\JALALI@temp by 100\relax
-\JALALI@yModHundred=\JALALI@y
-\advance\JALALI@yModHundred by -\JALALI@temp\relax
-%
-\ifodd\JALALI@yModHundred
- \JALALI@leapfalse
-\else
- \JALALI@temp=\JALALI@yModHundred
- \divide\JALALI@temp by 2\relax
- \ifodd\JALALI@temp\JALALI@leapfalse
- \else
- \ifnum\JALALI@yModHundred=0%
- \JALALI@temp=\JALALI@y
- \divide\JALALI@temp by 400\relax
- \multiply\JALALI@temp by 400\relax
- \ifnum\JALALI@y=\JALALI@temp\JALALI@leaptrue\else\JALALI@leapfalse\fi
- \else\JALALI@leaptrue
- \fi
- \fi
-\fi
-%
-\JALALI@latini=31\relax
-\ifJALALI@leap
- \JALALI@latinii = 29\relax
-\else
- \JALALI@latinii = 28\relax
-\fi
-\JALALI@latiniii = 31\relax
-\JALALI@latiniv = 30\relax
-\JALALI@latinv = 31\relax
-\JALALI@latinvi = 30\relax
-\JALALI@latinvii = 31\relax
-\JALALI@latinviii = 31\relax
-\JALALI@latinix = 30\relax
-\JALALI@latinx = 31\relax
-\JALALI@latinxi = 30\relax
-\JALALI@latinxii = 31\relax
-%
-\JALALI@thirtytwo=32\relax
-%
-\JALALI@temp=\JALALI@y
-\advance\JALALI@temp by -17\relax
-\JALALI@temptwo=\JALALI@temp
-\divide\JALALI@temptwo by 33\relax
-\multiply\JALALI@temptwo by 33\relax
-\advance\JALALI@temp by -\JALALI@temptwo
-\ifnum\JALALI@temp=\JALALI@thirtytwo\JALALI@kabisehfalse
-\else
- \JALALI@temptwo=\JALALI@temp
- \divide\JALALI@temptwo by 4\relax
- \multiply\JALALI@temptwo by 4\relax
- \advance\JALALI@temp by -\JALALI@temptwo
- \ifnum\JALALI@temp=\z@\JALALI@kabisehtrue\else\JALALI@kabisehfalse\fi
-\fi
-%
-% --BE
-% In fact farsii is equal to the Leap years from a fixed year to the last
-% year minus the Kabise years from a fixed year to the last year plus a const.
-%
-\JALALI@tempthree=\JALALI@y % Number of Leap years
-\advance\JALALI@tempthree by -1
-\JALALI@temp=\JALALI@tempthree % T := (MY-1) div 4
-\divide\JALALI@temp by 4\relax
-\JALALI@temptwo=\JALALI@tempthree % T := T - ((MY-1) div 100)
-\divide\JALALI@temptwo by 100\relax
-\advance\JALALI@temp by -\JALALI@temptwo
-\JALALI@temptwo=\JALALI@tempthree % T := T + ((MY-1) div 400)
-\divide\JALALI@temptwo by 400\relax
-\advance\JALALI@temp by \JALALI@temptwo
-\advance\JALALI@tempthree by -611 % Number of Kabise years
-\JALALI@temptwo=\JALALI@tempthree % T := T - ((SY+10) div 33) * 8
-\divide\JALALI@temptwo by 33\relax
-\multiply\JALALI@temptwo by 8\relax
-\advance\JALALI@temp by -\JALALI@temptwo
-\JALALI@temptwo=\JALALI@tempthree %
-\divide\JALALI@temptwo by 33\relax
-\multiply\JALALI@temptwo by 33\relax
-\advance\JALALI@tempthree by -\JALALI@temptwo
-\ifnum\JALALI@tempthree=32\advance\JALALI@temp by 1\fi % if (SY+10) mod 33=32 then Inc(T);
-\divide\JALALI@tempthree by 4\relax % T := T - ((SY+10) mod 33) div 4
-\advance\JALALI@temp by -\JALALI@tempthree
-\advance\JALALI@temp by -137 % T := T - 137 Adjust the value
-\JALALI@farsii=31
-\advance\JALALI@farsii by -\JALALI@temp % now 31 - T is the farsii
-%
-\JALALI@farsiii = 30\relax
-\ifJALALI@kabiseh
- \JALALI@farsiiii = 30\relax
-\else
- \JALALI@farsiiii = 29\relax
-\fi
-\JALALI@farsiiv = 31\relax
-\JALALI@farsiv = 31\relax
-\JALALI@farsivi = 31\relax
-\JALALI@farsivii = 31\relax
-\JALALI@farsiviii= 31\relax
-\JALALI@farsiix = 31\relax
-\JALALI@farsix = 30\relax
-\JALALI@farsixi = 30\relax
-\JALALI@farsixii = 30\relax
-\JALALI@farsixiii= 30\relax
-%
-\JALALI@dn= 0\relax
-\JALALI@sn= 0\relax
-\JALALI@mminusone=\JALALI@m
-\advance\JALALI@mminusone by -1\relax
-%
-\JALALI@i=0\relax
-\ifnum\JALALI@i < \JALALI@mminusone
-\loop
-\advance \JALALI@i by 1\relax
-\advance\JALALI@dn by \csname JALALI@latin\romannumeral\the\JALALI@i\endcsname
-\ifnum\JALALI@i<\JALALI@mminusone \repeat
-\fi
-\advance \JALALI@dn by \JALALI@d
-%
-\JALALI@i=1\relax
-\JALALI@sn = \JALALI@farsii
-\ifnum \JALALI@sn<\JALALI@dn
-\loop
-\advance \JALALI@i by 1\relax
-\advance\JALALI@sn by \csname JALALI@farsi\romannumeral\the\JALALI@i\endcsname
-\ifnum \JALALI@sn<\JALALI@dn \repeat
-\fi
-\ifnum \JALALI@i < 4
- \JALALI@m = 9 \advance\JALALI@m by \JALALI@i
- \advance \JALALI@y by -622\relax
-\else
- \JALALI@m = \JALALI@i \advance \JALALI@m by -3\relax
- \advance \JALALI@y by -621\relax
-\fi
-\advance\JALALI@sn by -\csname JALALI@farsi\romannumeral\the\JALALI@i%
-\endcsname
-\ifnum\JALALI@i = 1
- \JALALI@d = \JALALI@dn \advance \JALALI@d by 30 \advance\JALALI@d by -\JALALI@farsii
-\else
- \JALALI@d = \JALALI@dn \advance \JALALI@d by -\JALALI@sn
-\fi
-%% DATE FORMATTING
-\if@RTL{\farsidigits{\number\JALALI@d}\space%
-\Jalalimonth{\JALALI@m}\space\farsidigits{\number\JALALI@y}}%
-\else
-\number\JALALI@d\space\JalalimonthEnglish{\JALALI@m}%
-\space\number\JALALI@y%
-\fi}
-%%%
-\def\Jalalimonth#1{\ifcase#1\or فروردین\or
-اردیبهشت\or خرداد\or تیر\or مرداد\or شهریور%
-\or مهر\or آبان\or آذر\or دی\or بهمن\or اسفند%
-\fi}
-\def\JalalimonthEnglish#1{\ifcase#1%
-\or Farvardīn\or Ordībehesht\or Khordād\or Tīr%
-\or Mordād\or Shahrīvar\or Mihr\or Ābān\or Āzar%
-\or Dai\or Bahman\or Esfand\fi}
-% \end{macrocode}
-% \iffalse
-%</farsical.sty>
-%<*hebrewcal.sty>
-% \fi
-% \clearpage
-%
-% \subsection{hebrewcal.sty}
-% \begin{macrocode}
-\ProvidesPackage{hebrewcal}
- [2022/07/18 v2.8 %
- Hebrew calendar for polyglossia (adapted from hebcal.sty in Babel)]
-
-\RequirePackage{iftex}
-\ifluatex
- \RequirePackage{luabidi}
-\else
- \RequirePackage{bidi}
-\fi
-
-%% TODO rewrite this on the basis of Reingold & Dershowitz
-%% on the model of hijrical (using calc)
-
-\@ifundefined{@Remainder}{\input{cal-util.def}}{}
-
-%
-% OPTIONS
-%
-\RequirePackage{xkeyval}
-
-% marcheshvan=true|false
-\define@boolkey{hebrewcal}[@xpg@hebrew@]{marcheshvan}[true]{}
-
-% fullyear=true|false
-\define@boolkey{hebrewcal}[@xpg@hebrew@]{fullyear}[true]{}
-
-% transliteration=academy|alt
-\newif\if@hebrewcal@academytrans
-\@hebrewcal@academytransfalse
-\define@choicekey*+{hebrewcal}{transliteration}[\hcal@val\hcal@nr]{academy,alt}[alt]{%
- \ifcase\hcal@nr\relax
- % academy:
- \@hebrewcal@academytranstrue
- \or
- % alt:
- \@hebrewcal@academytransfalse
- \fi
- \PackageInfo{hebrewcal}{Setting transliteration=\hcal@val}%
-}{%
- \PackageWarning{hebrewcal}{Unknown transliteration option `#1'}%
-}
-
-% Process
-\ProcessOptionsX*<hebrewcal>
-%%
-%% END OPTIONS
-
-\newcount\hebrewday \newcount\hebrewmonth \newcount\hebrewyear
-\def\hebrewdate#1#2#3{%
- \HebrewFromGregorian{#1}{#2}{#3}%
- {\hebrewday}{\hebrewmonth}{\hebrewyear}%
- \if@RTL
- \@FormatForHebrew{\hebrewday}{\hebrewmonth}{\hebrewyear}%
- \else
- \@FormatForEnglish{\hebrewday}{\hebrewmonth}{\hebrewyear}%
- \fi}
-\def\hebrewtoday{\hebrewdate{\day}{\month}{\year}}
-% The command name is capitalised in the doc, and this is consistent
-% with other names such as \Hijritoday and \Jalalitoday.
-\let\Hebrewtoday=\hebrewtoday
-\def\hebrewsetreg{%
- \HebrewFromGregorian{\day}{\month}{\year}%
- {\hebrewday}{\hebrewmonth}{\hebrewyear}}
-\def\HebrewYearName#1{{%
- \@tempcnta=#1\divide\@tempcnta by 1000\multiply\@tempcnta by 1000
- \ifnum#1=\@tempcnta\relax % divisible by 1000: disambiguate
- \Hebrewnumeral{#1}\ (לפ"ג)%
- \else % not divisible by 1000
- \ifnum#1<1000\relax % first millennium: disambiguate
- \Hebrewnumeral{#1}\ (לפ"ג)%
- \else
- \ifnum#1<5000
- \Hebrewnumeral{#1}%
- \else
- \ifnum#1<6000 % current millenium, print without thousands
- \@tempcnta=#1\relax
- \if@xpg@hebrew@fullyear\else\advance\@tempcnta by -5000\fi
- \Hebrewnumeral{\@tempcnta}%
- \else % #1>6000
- \Hebrewnumeral{#1}%
- \fi
- \fi
- \fi
- \fi}}
-\def\HebrewMonthName#1#2{%
- \ifnum #1 = 7
- \@CheckLeapHebrewYear{#2}%
- \if@HebrewLeap אדר\ ב'%
- \else אדר%
- \fi
- \else
- \ifcase#1
- % nothing for 0
- \or תשרי%
- \or\if@xpg@hebrew@marcheshvan מרחשון\else חשון\fi
- \or כסלו%
- \or טבת%
- \or שבט%
- \or אדר\ א'%
- \or אדר\ ב'%
- \or ניסן%
- \or אייר%
- \or סיון%
- \or תמוז%
- \or אב%
- \or אלול%
- \fi
- \fi}
-\def\@FormatForHebrew#1#2#3{%
- \Hebrewnumeral{#1}~ב\HebrewMonthName{#2}{#3}~%
- \HebrewYearName{#3}}
-\def\HebrewMonthNameInEnglish#1#2{%
- \ifnum #1 = 7
- \@CheckLeapHebrewYear{#2}%
- \if@HebrewLeap Adar II\else Adar\fi
- \else
- \ifcase #1
- % nothing for 0
- \or \if@hebrewcal@academytrans Tishri \else Tishrei \fi
- \or
- \if@hebrewcal@academytrans%
- \if@xpg@hebrew@marcheshvan Marẖeshvan\else Heshvan\fi
- \else
- \if@xpg@hebrew@marcheshvan Marcheshvan\else Heshvan\fi
- \fi
- \or Kislev
- \or \if@hebrewcal@academytrans Tevet \else Tebeth \fi
- \or \if@hebrewcal@academytrans Shvat \else Shebat \fi
- \or Adar I%
- \or Adar II%
- \or Nisan%
- \or \if@hebrewcal@academytrans Iyyar \else Iyar \fi
- \or Sivan%
- \or Tammuz%
- \or \if@hebrewcal@academytrans Av \else Ab \fi
- \or Elul%
- \fi
- \fi}
-\def\@FormatForEnglish#1#2#3{%
- \HebrewMonthNameInEnglish{#2}{#3} \number#1,\ \number#3}
-\newcount\@common
-\newif\if@HebrewLeap
-\def\@CheckLeapHebrewYear#1{%
- {%
- \countdef\tmpa = 0 % \tmpa==\count0
- \countdef\tmpb = 1 % \tmpb==\count1
- \tmpa = #1
- \multiply \tmpa by 7
- \advance \tmpa by 1
- \@Remainder{\tmpa}{19}{\tmpb}%
- \ifnum \tmpb < 7 % \tmpb = (7*year+1)%19
- \global\@HebrewLeaptrue
- \else
- \global\@HebrewLeapfalse
- \fi}}
-\def\@HebrewElapsedMonths#1#2{%
- {%
- \countdef\tmpa = 0 % \tmpa==\count0
- \countdef\tmpb = 1 % \tmpb==\count1
- \countdef\tmpc = 2 % \tmpc==\count2
- \tmpa = #1
- \advance \tmpa by -1
- #2 = \tmpa % #2 = \tmpa = year-1
- \divide #2 by 19 % Number of complete Meton cycles
- \multiply #2 by 235 % #2 = 235*((year-1)/19)
- \@Remainder{\tmpa}{19}{\tmpb}% \tmpa = years%19-years this cycle
- \tmpc = \tmpb
- \multiply \tmpb by 12
- \advance #2 by \tmpb % add regular months this cycle
- \multiply \tmpc by 7
- \advance \tmpc by 1
- \divide \tmpc by 19 % \tmpc = (1+7*((year-1)%19))/19 -
- \advance #2 by \tmpc % add leap months
- \global\@common = #2}%
- #2 = \@common}
-\def\@HebrewElapsedDays#1#2{%
- {%
- \countdef\tmpa = 0 % \tmpa==\count0
- \countdef\tmpb = 1 % \tmpb==\count1
- \countdef\tmpc = 2 % \tmpc==\count2
- \@HebrewElapsedMonths{#1}{#2}%
- \tmpa = #2
- \multiply \tmpa by 13753
- \advance \tmpa by 5604 % \tmpa=MonthsElapsed*13758 + 5604
- \@Remainder{\tmpa}{25920}{\tmpc}% \tmpc == ConjunctionParts
- \divide \tmpa by 25920
- \multiply #2 by 29
- \advance #2 by 1
- \advance #2 by \tmpa % #2 = 1 + MonthsElapsed*29 +
- \@Remainder{#2}{7}{\tmpa}% % \tmpa == DayOfWeek
- \ifnum \tmpc < 19440
- \ifnum \tmpc < 9924
- \else % New moon at 9 h. 204 p. or later
- \ifnum \tmpa = 2 % on Tuesday ...
- \@CheckLeapHebrewYear{#1}% of a common year
- \if@HebrewLeap
- \else
- \advance #2 by 1
- \fi
- \fi
- \fi
- \ifnum \tmpc < 16789
- \else % New moon at 15 h. 589 p. or later
- \ifnum \tmpa = 1 % on Monday ...
- \advance #1 by -1
- \@CheckLeapHebrewYear{#1}% at the end of leap year
- \if@HebrewLeap
- \advance #2 by 1
- \fi
- \fi
- \fi
- \else
- \advance #2 by 1 % new moon at or after midday
- \fi
- \@Remainder{#2}{7}{\tmpa}% % \tmpa == DayOfWeek
- \ifnum \tmpa = 0 % if Sunday ...
- \advance #2 by 1
- \else %
- \ifnum \tmpa = 3 % Wednesday ...
- \advance #2 by 1
- \else
- \ifnum \tmpa = 5 % or Friday
- \advance #2 by 1
- \fi
- \fi
- \fi
- \global\@common = #2}%
- #2 = \@common}
-\def\@DaysInHebrewYear#1#2{%
- {%
- \countdef\tmpe = 12 % \tmpe==\count12
- \@HebrewElapsedDays{#1}{\tmpe}%
- \advance #1 by 1
- \@HebrewElapsedDays{#1}{#2}%
- \advance #2 by -\tmpe
- \global\@common = #2}%
- #2 = \@common}
-\def\@HebrewDaysInPriorMonths#1#2#3{%
- {%
- \countdef\tmpf= 14 % \tmpf==\count14
- #3 = \ifcase #1 % Days in prior month of regular year
- 0 \or % no month number 0
- 0 \or % Tishri
- 30 \or % Heshvan
- 59 \or % Kislev
- 89 \or % Tevet
- 118 \or % Shvat
- 148 \or % Adar I
- 148 \or % Adar II
- 177 \or % Nisan
- 207 \or % Iyyar
- 236 \or % Sivan
- 266 \or % Tammuz
- 295 \or % Av
- 325 \or % Elul
- 400 % Dummy
- \fi
- \@CheckLeapHebrewYear{#2}%
- \if@HebrewLeap % in leap year
- \ifnum #1 > 6 % if month after Adar I
- \advance #3 by 30 % add 30 days
- \fi
- \fi
- \@DaysInHebrewYear{#2}{\tmpf}%
- \ifnum #1 > 3
- \ifnum \tmpf = 353
- \advance #3 by -1
- \fi % Short Kislev
- \ifnum \tmpf = 383
- \advance #3 by -1
- \fi
- \fi
- \ifnum #1 > 2
- \ifnum \tmpf = 355
- \advance #3 by 1
- \fi % Long Heshvan
- \ifnum \tmpf = 385
- \advance #3 by 1
- \fi
- \fi
- \global\@common = #3}%
- #3 = \@common}
-\def\@FixedFromHebrew#1#2#3#4{%
- {%
- #4 = #1
- \@HebrewDaysInPriorMonths{#2}{#3}{#1}%
- \advance #4 by #1 % Add days in prior months this year
- \@HebrewElapsedDays{#3}{#1}%
- \advance #4 by #1 % Add days in prior years
- \advance #4 by -1373429 % Subtract days before Gregorian
- \global\@common = #4}% % 01.01.0001
- #4 = \@common}
-\def\@GregorianDaysInPriorMonths#1#2#3{%
- {%
- #3 = \ifcase #1
- 0 \or % no month number 0
- 0 \or
- 31 \or
- 59 \or
- 90 \or
- 120 \or
- 151 \or
- 181 \or
- 212 \or
- 243 \or
- 273 \or
- 304 \or
- 334
- \fi
- \@CheckIfGregorianLeap{#2}%
- \if@GregorianLeap
- \ifnum #1 > 2 % if month after February
- \advance #3 by 1 % add leap day
- \fi
- \fi
- \global\@common = #3}%
- #3 = \@common}
-\def\@GregorianDaysInPriorYears#1#2{%
- {%
- \countdef\tmpc = 4 % \tmpc==\count4
- \countdef\tmpb = 2 % \tmpb==\count2
- \tmpb = #1
- \advance \tmpb by -1
- \tmpc = \tmpb % \tmpc = \tmpb = year-1
- \multiply \tmpc by 365 % Days in prior years =
- #2 = \tmpc % = 365*(year-1) ...
- \tmpc = \tmpb
- \divide \tmpc by 4 % \tmpc = (year-1)/4
- \advance #2 by \tmpc % ... plus Julian leap days ...
- \tmpc = \tmpb
- \divide \tmpc by 100 % \tmpc = (year-1)/100
- \advance #2 by -\tmpc % ... minus century years ...
- \tmpc = \tmpb
- \divide \tmpc by 400 % \tmpc = (year-1)/400
- \advance #2 by \tmpc % ... plus 4-century years.
- \global\@common = #2}%
- #2 = \@common}
-\def\@AbsoluteFromGregorian#1#2#3#4{%
- {%
- \countdef\tmpd = 0 % \tmpd==\count0
- #4 = #1 % days so far this month
- \@GregorianDaysInPriorMonths{#2}{#3}{\tmpd}%
- \advance #4 by \tmpd % add days in prior months
- \@GregorianDaysInPriorYears{#3}{\tmpd}%
- \advance #4 by \tmpd % add days in prior years
- \global\@common = #4}%
- #4 = \@common}
-\def\HebrewFromGregorian#1#2#3#4#5#6{%
- {%
- \countdef\tmpx= 17 % \tmpx==\count17
- \countdef\tmpy= 18 % \tmpy==\count18
- \countdef\tmpz= 19 % \tmpz==\count19
- #6 = #3
- \global\advance #6 by 3761 % approximation from above
- \@AbsoluteFromGregorian{#1}{#2}{#3}{#4}%
- \tmpz = 1 \tmpy = 1
- \@FixedFromHebrew{\tmpz}{\tmpy}{#6}{\tmpx}%
- \ifnum \tmpx > #4
- \global\advance #6 by -1 % Hyear = Gyear + 3760
- \@FixedFromHebrew{\tmpz}{\tmpy}{#6}{\tmpx}%
- \fi
- \advance #4 by -\tmpx % Days in this year
- \advance #4 by 1
- #5 = #4
- \divide #5 by 30 % Approximation for month from below
- \loop % Search for month
- \@HebrewDaysInPriorMonths{#5}{#6}{\tmpx}%
- \ifnum \tmpx < #4
- \advance #5 by 1
- \tmpy = \tmpx
- \repeat
- \global\advance #5 by -1
- \global\advance #4 by -\tmpy
- }%
-}
-
-% \end{macrocode}
-% \iffalse
-%</hebrewcal.sty>
-%<*hijrical.sty>
-% \fi
-% \clearpage
-%
-% \subsection{hijrical.sty}
-% \begin{macrocode}
-\ProvidesPackage{hijrical}
- [2010/07/12 v0.2 %
- Islamic calendar]
-\RequirePackage{calc}
-\RequirePackage{arabicnumbers}
-\@ifpackageloaded{bidi}{}{\newif\if@RTL\@RTLfalse}
-\@ifpackageloaded{l3calc}{\PackageError{hijrical}{\MessageBreak
-Package l3calc is loaded, which replaces the functionality of
-calc. Computation of Hijri dates will not work properly with
-% FIXME by Arthur: François couldn’t possibly mean ‘l3calc’ on the
-% following line :-) Find out if he meant ‘calc’.
-l3calc! The latest version of expl3 on CTAN no longer loads
-l3calc. Please update expl3!
-}{}}{}
-
-\@ifundefined{@Remainder}{\input{cal-util.def}}{}
-
-%% The following functions are straightforward implementation
-%% of Reingold & Dershowitz, Calendrical Calculations, The Millenium Edition
-%%
-
-\def\@FixedFromHijri#1#2#3#4{% year,month,day,counter
-\@ifundefined{c@#4}{\newcounter{#4}}{}%
-\setcounter{tmpA}{#2/2}% see errata of Reingold+Dershowitz
-%\message{tmpA is \thetmpA}%
-\setcounter{tmpB}{(3+11*#1)/30}%
-%\message{tmpB is \thetmpB}%
-\setcounter{#4}{227014+(#1-1)*354+\value{tmpB}+(29*(#2-1))+\value{tmpA}+#3}%
-}
-
-\newcounter{Hijriday}\newcounter{Hijrimonth}\newcounter{Hijriyear}
-
-\def\HijriFromGregorian#1#2#3{% year,month,day
-\@FixedFromGregorian{#1}{#2}{#3}{RDdate}%
-\setcounter{Hijriyear}{(30*(\value{RDdate}-227015)+10646)/10631}%
-\@FixedFromHijri{\value{Hijriyear}}{1}{1}{tmpx}%
-%\message{tmpx is \thetmpx}%
-\setcounter{tmpB}{\value{RDdate}-\value{tmpx}}%
-%\message{tmpB is \thetmpB}%
-\setcounter{Hijrimonth}{((11*\value{tmpB})+330)/325}%
-\@FixedFromHijri{\value{Hijriyear}}{\value{Hijrimonth}}{1}{tmpy}%
-%\message{tmpy is \thetmpy}%
-\setcounter{Hijriday}{1+\value{RDdate}-\value{tmpy}}%
-}
-
-%\HijriFromGregorian{\year}{\month}{\day}%
-
-%\def\PlainHijritoday{%
-%\theHijriday.\theHijrimonth.\theHijriyear}
-
-\def\Hijridate#1#2#3{%
- \HijriFromGregorian{#1}{#2}{#3}%
- \FormatHijriDate}
-
-% added option \Hijritoday[n] (default 0) for adjusting the date + n days
-\@ifundefined{@hijri@correction}{\gdef\@hijri@correction{0}}{}
-\newcommand\Hijritoday[1][\@hijri@correction]{%
- \@ifundefined{c@adj@day}{\global\newcounter{adj@day}}{}%
- \setcounter{adj@day}{\the\day+#1}%
- \Hijridate{\year}{\month}{\value{adj@day}}}
-%\def\Hijritoday{\Hijridate{\year}{\month}{\day}}
-\let\hijritoday=\Hijritoday
-%FIXME necessary?
-%\def\Hijrisetreg{%
-% \HijriFromGregorian{\year}{\month}{\day}}
-
-\def\HijriMonthTranslit#1{\ifcase#1\or Muḥarram\or Ṣafar\or Rabīʿ I\or Rabīʿ II\or%
-Jumādā I\or Jumādā II\or Rajab\or Shaʿbān\or Ramaḍān\or%
-Shawwāl\or Dhū ’l-Qaʿda\or Dhū ’l-Ḥijja\fi}
-
-\def\HijriMonthArabic#1{\ifcase#1\or محرم\or صفر\or ربيع الأول\or ربيع الآخر\or%
-جمادى الأولى\or جمادى الآخرة\or رجب\or شعبان\or رمضان\or%
-شوال\or ذو القعدة\or ذو الحجة\fi}
-
-%% This macro is now locale-aware!
-\def\FormatHijriDate{%
- \@ifundefined{FormatHijriDate@\languagename}%
- {\if@RTL\FormatHijriDate@defaultRTL\else\FormatHijriDate@defaultLTR\fi}%
- {\csname FormatHijriDate@\languagename\endcsname}}
-
-\newcommand\DefineFormatHijriDate[2]{%
- \@namedef{FormatHijriDate@#1}{#2}}
-
-% we provide this as a reasonable default.
-% Further definitions are in polyglossia’s language definition files.
-\DefineFormatHijriDate{defaultRTL}{\@ensure@RTL{%
-\arabicdigits{\value{Hijriday}}\space\HijriMonthArabic{\value{Hijrimonth}}\space\arabicdigits{\value{Hijriyear}}}}
-
-\DefineFormatHijriDate{defaultLTR}{%
-\number\value{Hijriday}\space\HijriMonthTranslit{\value{Hijrimonth}}\space\number\value{Hijriyear}}
-% \end{macrocode}
-% \iffalse
-%</hijrical.sty>
-%<*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>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-korean.lua}
-% \begin{macrocode}
---
--- polyglossia-korean.lua
--- part of polyglossia v2.1 -- 2024/03/07
---
-
-local glyph_id = node.id"glyph"
-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"
-
---
--- attr_korean: variant = plain (0), classic (1), modern (2)
---
-local attr_korean = luatexbase.attributes["xpg@attr@korean"]
-local attr_josa = luatexbase.attributes["xpg@attr@autojosa"]
-
---
--- characters after which linebreak is not allowed
---
-local nobr_after = {
- [0x28] = 1, -- ( LEFT PARENTHESIS
- [0x3C] = 1, -- < LESS-THAN SIGN
- [0x5B] = 1, -- [ LEFT SQUARE BRACKET
- [0x60] = 1, -- ` GRAVE ACCENT
- [0x7B] = 1, -- { LEFT CURLY BRACKET
- [0xAB] = 1, -- « LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
- [0x2018] = 1, -- ‘ LEFT SINGLE QUOTATION MARK
- [0x201C] = 1, -- “ LEFT DOUBLE QUOTATION MARK
- [0x2329] = 1, -- 〈 LEFT-POINTING ANGLE BRACKET
- [0x3008] = 1, -- 〈 LEFT ANGLE BRACKET
- [0x300A] = 1, -- 《 LEFT DOUBLE ANGLE BRACKET
- [0x300C] = 1, -- 「 LEFT CORNER BRACKET
- [0x300E] = 1, -- 『 LEFT WHITE CORNER BRACKET
- [0x3010] = 1, -- 【 LEFT BLACK LENTICULAR BRACKET
- [0x3014] = 1, -- 〔 LEFT TORTOISE SHELL BRACKET
- [0x3016] = 1, -- 〖 LEFT WHITE LENTICULAR BRACKET
- [0x3018] = 1, -- 〘 LEFT WHITE TORTOISE SHELL BRACKET
- [0x301A] = 1, -- 〚 LEFT WHITE SQUARE BRACKET
- [0x301D] = 1, -- 〝 REVERSED DOUBLE PRIME QUOTATION MARK
- [0xFE17] = 1, -- ︗ PRESENTATION FORM FOR VERTICAL LEFT WHITE LENTICULAR BRACKET
- [0xFE35] = 1, -- ︵ PRESENTATION FORM FOR VERTICAL LEFT PARENTHESIS
- [0xFE37] = 1, -- ︷ PRESENTATION FORM FOR VERTICAL LEFT CURLY BRACKET
- [0xFE39] = 1, -- ︹ PRESENTATION FORM FOR VERTICAL LEFT TORTOISE SHELL BRACKET
- [0xFE3B] = 1, -- ︻ PRESENTATION FORM FOR VERTICAL LEFT BLACK LENTICULAR BRACKET
- [0xFE3D] = 1, -- ︽ PRESENTATION FORM FOR VERTICAL LEFT DOUBLE ANGLE BRACKET
- [0xFE3F] = 1, -- ︿ PRESENTATION FORM FOR VERTICAL LEFT ANGLE BRACKET
- [0xFE41] = 1, -- ﹁ PRESENTATION FORM FOR VERTICAL LEFT CORNER BRACKET
- [0xFE43] = 1, -- ﹃ PRESENTATION FORM FOR VERTICAL LEFT WHITE CORNER BRACKET
- [0xFE47] = 1, -- ﹇ PRESENTATION FORM FOR VERTICAL LEFT SQUARE BRACKET
- [0xFE59] = 1, -- ﹙ SMALL LEFT PARENTHESIS
- [0xFE5B] = 1, -- ﹛ SMALL LEFT CURLY BRACKET
- [0xFE5D] = 1, -- ﹝ SMALL LEFT TORTOISE SHELL BRACKET
- [0xFF08] = 1, -- ( FULLWIDTH LEFT PARENTHESIS
- [0xFF3B] = 1, -- [ FULLWIDTH LEFT SQUARE BRACKET
- [0xFF5B] = 1, -- { FULLWIDTH LEFT CURLY BRACKET
- [0xFF5F] = 1, -- ⦅ FULLWIDTH LEFT WHITE PARENTHESIS
- [0xFF62] = 1, -- 「 HALFWIDTH LEFT CORNER BRACKET
-}
-
---
--- characters before which linebreak is not allowed
--- (currently, not much differences among the followings)
--- 1: normal chars
--- 2: hangul jamo vowels and trailing consonants
--- 3: kana small letters
--- 0: dashes (supress visible spacing)
---
-local nobr_before = setmetatable({
- [0x21] = 1, -- ! EXCLAMATION MARK
- [0x22] = 1, -- " QUOTATION MARK
- [0x27] = 1, -- ' APOSTROPHE
- [0x29] = 1, -- ) RIGHT PARENTHESIS
- [0x2C] = 1, -- , COMMA
- [0x2D] = 0, -- - HYPHEN-MINUS
- [0x2E] = 1, -- . FULL STOP
- [0x2F] = 0, -- / SOLIDUS
- [0x3A] = 0, -- : COLON
- [0x3B] = 1, -- ; SEMICOLON
- [0x3E] = 1, -- > GREATER-THAN SIGN
- [0x3F] = 1, -- ? QUESTION MARK
- [0x5C] = 0, -- \ REVERSE SOLIDUS
- [0x5D] = 1, -- ] RIGHT SQUARE BRACKET
- [0x7D] = 1, -- } RIGHT CURLY BRACKET
- [0x7E] = 0, -- ~ TILDE
- [0xB7] = 1, -- · MIDDLE DOT
- [0xBB] = 1, -- » RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
- [0x2013] = 0, -- – EN DASH
- [0x2014] = 0, -- — EM DASH
- [0x2015] = 1, -- ― HORIZONTAL BAR
- [0x2019] = 1, -- ’ RIGHT SINGLE QUOTATION MARK
- [0x201D] = 1, -- ” RIGHT DOUBLE QUOTATION MARK
- [0x2025] = 1, -- ‥ TWO DOT LEADER
- [0x2026] = 1, -- … HORIZONTAL ELLIPSIS
- [0x232A] = 1, -- 〉 RIGHT-POINTING ANGLE BRACKET
- [0x3001] = 1, -- 、 IDEOGRAPHIC COMMA
- [0x3002] = 1, -- 。 IDEOGRAPHIC FULL STOP
- [0x3005] = 1, -- 々 IDEOGRAPHIC ITERATION MARK
- [0x3009] = 1, -- 〉 RIGHT ANGLE BRACKET
- [0x300B] = 1, -- 》 RIGHT DOUBLE ANGLE BRACKET
- [0x300D] = 1, -- 」 RIGHT CORNER BRACKET
- [0x300F] = 1, -- 』 RIGHT WHITE CORNER BRACKET
- [0x3011] = 1, -- 】 RIGHT BLACK LENTICULAR BRACKET
- [0x3015] = 1, -- 〕 RIGHT TORTOISE SHELL BRACKET
- [0x3017] = 1, -- 〗 RIGHT WHITE LENTICULAR BRACKET
- [0x3019] = 1, -- 〙 RIGHT WHITE TORTOISE SHELL BRACKET
- [0x301B] = 1, -- 〛 RIGHT WHITE SQUARE BRACKET
- [0x301C] = 1, -- 〜 WAVE DASH
- [0x301E] = 1, -- 〞 DOUBLE PRIME QUOTATION MARK
- [0x301F] = 1, -- 〟 LOW DOUBLE PRIME QUOTATION MARK
- [0x3035] = 1, -- 〵 VERTICAL KANA REPEAT MARK LOWER HALF
- [0x303B] = 1, -- 〻 VERTICAL IDEOGRAPHIC ITERATION MARK
- [0x303C] = 1, -- 〼 MASU MARK
- [0x3041] = 3, -- ぁ HIRAGANA LETTER SMALL A
- [0x3043] = 3, -- ぃ HIRAGANA LETTER SMALL I
- [0x3045] = 3, -- ぅ HIRAGANA LETTER SMALL U
- [0x3047] = 3, -- ぇ HIRAGANA LETTER SMALL E
- [0x3049] = 3, -- ぉ HIRAGANA LETTER SMALL O
- [0x3063] = 3, -- っ HIRAGANA LETTER SMALL TU
- [0x3083] = 3, -- ゃ HIRAGANA LETTER SMALL YA
- [0x3085] = 3, -- ゅ HIRAGANA LETTER SMALL YU
- [0x3087] = 3, -- ょ HIRAGANA LETTER SMALL YO
- [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
- [0x309D] = 1, -- ゝ HIRAGANA ITERATION MARK
- [0x309E] = 1, -- ゞ HIRAGANA VOICED ITERATION MARK
- [0x30A0] = 1, -- ゠ KATAKANA-HIRAGANA DOUBLE HYPHEN
- [0x30A1] = 3, -- ァ KATAKANA LETTER SMALL A
- [0x30A3] = 3, -- ィ KATAKANA LETTER SMALL I
- [0x30A5] = 3, -- ゥ KATAKANA LETTER SMALL U
- [0x30A7] = 3, -- ェ KATAKANA LETTER SMALL E
- [0x30A9] = 3, -- ォ KATAKANA LETTER SMALL O
- [0x30C3] = 3, -- ッ KATAKANA LETTER SMALL TU
- [0x30E3] = 3, -- ャ KATAKANA LETTER SMALL YA
- [0x30E5] = 3, -- ュ KATAKANA LETTER SMALL YU
- [0x30E7] = 3, -- ョ KATAKANA LETTER SMALL YO
- [0x30EE] = 3, -- ヮ KATAKANA LETTER SMALL WA
- [0x30F5] = 3, -- ヵ KATAKANA LETTER SMALL KA
- [0x30F6] = 3, -- ヶ KATAKANA LETTER SMALL KE
- [0x30FB] = 1, -- ・ KATAKANA MIDDLE DOT
- [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
- [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
- [0xFE3C] = 1, -- ︼ PRESENTATION FORM FOR VERTICAL RIGHT BLACK LENTICULAR BRACKET
- [0xFE3E] = 1, -- ︾ PRESENTATION FORM FOR VERTICAL RIGHT DOUBLE ANGLE BRACKET
- [0xFE40] = 1, -- ﹀ PRESENTATION FORM FOR VERTICAL RIGHT ANGLE BRACKET
- [0xFE42] = 1, -- ﹂ PRESENTATION FORM FOR VERTICAL RIGHT CORNER BRACKET
- [0xFE44] = 1, -- ﹄ PRESENTATION FORM FOR VERTICAL RIGHT WHITE CORNER BRACKET
- [0xFE48] = 1, -- ﹈ PRESENTATION FORM FOR VERTICAL RIGHT SQUARE BRACKET
- [0xFE5A] = 1, -- ﹚ SMALL RIGHT PARENTHESIS
- [0xFE5C] = 1, -- ﹜ SMALL RIGHT CURLY BRACKET
- [0xFE5E] = 1, -- ﹞ SMALL RIGHT TORTOISE SHELL BRACKET
- [0xFF01] = 1, -- ! FULLWIDTH EXCLAMATION MARK
- [0xFF09] = 1, -- ) FULLWIDTH RIGHT PARENTHESIS
- [0xFF0C] = 1, -- , FULLWIDTH COMMA
- [0xFF0E] = 1, -- . FULLWIDTH FULL STOP
- [0xFF1A] = 1, -- : FULLWIDTH COLON
- [0xFF1B] = 1, -- ; FULLWIDTH SEMICOLON
- [0xFF1F] = 1, -- ? FULLWIDTH QUESTION MARK
- [0xFF3D] = 1, -- ] FULLWIDTH RIGHT SQUARE BRACKET
- [0xFF5D] = 1, -- } FULLWIDTH RIGHT CURLY BRACKET
- [0xFF60] = 1, -- ⦆ FULLWIDTH RIGHT WHITE PARENTHESIS
- [0xFF61] = 1, -- 。 HALFWIDTH IDEOGRAPHIC FULL STOP
- [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
-}, { __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 >= 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 >= 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
- end
-})
-
---
--- whether 'c' is a cjk character
---
-local function is_cjk (c)
- return c >= 0xAC00 and c <= 0xD7FF
- or c >= 0x1100 and c <= 0x11FF
- or c >= 0xA960 and c <= 0xA97F
- or c >= 0x2E80 and c <= 0x9FFF
- or c >= 0xF900 and c <= 0xFAFF
- or c >= 0xFE10 and c <= 0xFE1F
- or c >= 0xFE30 and c <= 0xFE6F
- or c >= 0xFF00 and c <= 0xFFEF
- or c >= 0x1F100 and c <= 0x1F2FF
- or c >= 0x20000 and c <= 0x2FA1F
- or nobr_after[c] and c > 0x2014
- or nobr_before[c] and c > 0x2014
-end
-
---
--- classify cjk characters
--- 1: openings
--- 2: closings
--- 3: centered chars
--- 4: full stops
--- 5: ellipses
--- 6: exclamation and question marks
--- 0: all others
---
-local charclass = setmetatable({
- [0x2018] = 1, [0x201C] = 1, [0x2329] = 1, [0x3008] = 1,
- [0x300A] = 1, [0x300C] = 1, [0x300E] = 1, [0x3010] = 1,
- [0x3014] = 1, [0x3016] = 1, [0x3018] = 1, [0x301A] = 1,
- [0x301D] = 1, [0xFE17] = 1, [0xFE35] = 1, [0xFE37] = 1,
- [0xFE39] = 1, [0xFE3B] = 1, [0xFE3D] = 1, [0xFE3F] = 1,
- [0xFE41] = 1, [0xFE43] = 1, [0xFE47] = 1, [0xFF08] = 1,
- [0xFF3B] = 1, [0xFF5B] = 1, [0xFF5F] = 1, [0xFF62] = 1,
- [0x2019] = 2, [0x201D] = 2, [0x232A] = 2, [0x3001] = 2,
- [0x3009] = 2, [0x300B] = 2, [0x300D] = 2, [0x300F] = 2,
- [0x3011] = 2, [0x3015] = 2, [0x3017] = 2, [0x3019] = 2,
- [0x301B] = 2, [0x301E] = 2, [0x301F] = 2, [0xFE10] = 2,
- [0xFE11] = 2, [0xFE18] = 2, [0xFE36] = 2, [0xFE38] = 2,
- [0xFE3A] = 2, [0xFE3C] = 2, [0xFE3E] = 2, [0xFE40] = 2,
- [0xFE42] = 2, [0xFE44] = 2, [0xFE48] = 2, [0xFF09] = 2,
- [0xFF0C] = 2, [0xFF3D] = 2, [0xFF5D] = 2, [0xFF60] = 2,
- [0xFF63] = 2, [0xFF64] = 2, [0x00B7] = 3, [0x30FB] = 3,
- [0xFF1A] = 3, [0xFF1B] = 3, [0xFF65] = 3, [0x3002] = 4,
- [0xFE12] = 4, [0xFF0E] = 4, [0xFF61] = 4, [0x2015] = 5,
- [0x2025] = 5, [0x2026] = 5, [0xFE19] = 5, [0xFE30] = 5,
- [0xFE31] = 5, [0xFE15] = 6, [0xFE16] = 6, [0xFF01] = 6,
- [0xFF1F] = 6,
-}, { __index = function() return 0 end })
-
---
--- table for spacing between char classes
--- 1 stands for 0.5*fontsize when variant=classic
---
-local intercharclass = { [0] =
- { [0] = nil, {1,1}, nil, {.5,.5} },
- { [0] = nil, nil, nil, {.5,.5} },
- { [0] = {1,1}, {1,1}, nil, {.5,.5}, nil, {1,1}, {1,1} },
- { [0] = {.5,.5},{.5,.5},{.5,.5},{1,.5}, {.5,.5},{.5,.5},{.5,.5} },
- { [0] = {1,0}, {1,0}, nil, {1.5,.5},nil, {1,0}, {1,0} },
- { [0] = nil, {1,1}, nil, {.5,.5} },
- { [0] = {1,1}, {1,1}, nil, {.5,.5} },
-}
-
---
--- get a new penalty node
---
-local function get_new_penalty (p)
- local penalty = node.new("penalty")
- penalty.penalty = p
- return penalty
-end
-
---
--- get a new glue node
---
-local function get_new_glue (...)
- local glue = node.new("glue")
- node.setglue(glue, ...)
- return glue
-end
-
---
--- return 0.5*fontsize of given fontid
--- space: true if variant=modern; then 0.5*interword_space
---
-local function get_font_size (fid, space)
- local size = font.getparameters(fid)
- if space then
- size = size and size.space or 196608
- else
- size = size and size.quad or 655360
- end
- return size/2
-end
-
---
--- charclass 1 thru 4 will be packed in \hbox to 0.5em{\hss? curr \hss?}
--- when variant=classic/modern
---
-local function glyph_to_box (head, curr, class)
- local g, h = curr
- local size = get_font_size(g.font)
- head, curr = node.remove(head, curr)
- g.next, g.prev = nil, nil
- local hss = get_new_glue(0, 65536, 65536, 2, 2)
- if class == 1 then
- h, hss.next, g.prev = hss, g, hss
- elseif class == 2 or class == 4 then
- h, g.next, hss.prev = g, hss, g
- else
- local hss2 = node.copy(hss)
- h, hss.next, g.prev, g.next, hss2.prev = hss, g, hss, hss2, g
- end
- h = nodes.simple_font_handler(h)
- local box = node.hpack(h, size, "exactly")
- if curr then
- head, curr = node.insert_before(head, curr, box)
- else
- head, curr = node.insert_after(head, node.tail(head), box)
- end
- return head, curr
-end
-
---
--- insert spacing defined as charclass[a][b] between a and b
--- f: fontid
--- var: variant = plain, classic, modern
--- cc: charclass of current char
--- nc: charclass of next char
--- nobr: linebreak is not allowed
---
-local function insert_cjk_penalty_glue (head, curr, f, var, cc, nc, nobr)
- if nobr or cc == 1 or nc > 1 then
- local penalty = get_new_penalty(10000)
- head, curr = node.insert_after(head, curr, penalty)
- end
- local factor = get_font_size(f, var == 2)
- local t = intercharclass[cc][nc]
- local glue = get_new_glue(t[1]*factor, nil, t[2]*factor)
- head, curr = node.insert_after(head, curr, glue)
- return head, curr
-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)
---
-local function insert_penalty_glue (head, curr, f, var, x)
- if var ~= 1 then
- local penalty = get_new_penalty(50)
- head, curr = node.insert_after(head, curr, penalty)
- end
- local size, glue = get_font_size(f, x and var == 2)
- if x then
- glue = get_new_glue(size/2, size/4, size/8)
- else
- glue = get_new_glue(0, size/10, size/50)
- end
- head, curr = node.insert_after(head, curr, glue)
- return head, curr
-end
-
---
--- main process for linebreak and inter-character spacing
--- lb: true if pre_linebreak_filter
---
-local function korean_break (head, lb)
- local curr = head
- while curr do
- if curr.id == glyph_id then
- local var = node.has_attribute(curr, attr_korean)
- if var then
- local c, f = curr.char or 0, curr.font or 0
- local cc, cjkc = charclass[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 n = next.char or 0
- local nc = charclass[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
- 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)
-
- -- or under pre_linebreak_filter
- elseif lb then
- head, curr = insert_penalty_glue(head, curr, f, var)
- end
- end
- end
- end
- end
- end
- curr = curr.next
- end
- return head
-end
-
---
--- process for reordering hangul tone marks (U+302E, U+302F)
--- some hangul fonts (eg. Noto CJK) are so designed that hangul tone marks
--- should be moved to the first position of a syllable.
--- Currently, this functionality is not provided by luaotfload.
---
-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
- local f = font.getfont(curr.font) or font.fonts[curr.font]
- if f and f.hb then -- harfbuzz do the right thing
- tone = nil
- else
- local c, wd = curr.char or 0, curr.width or 0
- if (c == 0x302E or c == 0x302F) and wd > 0 then
- tone = curr
- elseif tone and not nobr_before[c] then
- head = node.remove(head, tone)
- tone.next, tone.prev = nil, nil
- head, curr = node.insert_before(head, curr, tone)
- tone = nil
- end
- end
- end
- curr = curr.prev
- end
- return head
-end
-
---
--- automatic josa selection
---
-local josa_table = {
- -- consonant ㄹ, vowel, other consonants
- [0xAC00] = {0xC774, 0xAC00, 0xC774}, -- 가 => 이, 가, 이
- [0xC740] = {0xC740, 0xB294, 0xC740}, -- 은 => 은, 는, 은
- [0xC744] = {0xC744, 0xB97C, 0xC744}, -- 을 => 을, 를, 을
- [0xC640] = {0xACFC, 0xC640, 0xACFC}, -- 와 => 과, 와, 과
- [0xC73C] = {nil, nil, 0xC73C}, -- 으(로) => , , 으
- [0xC774] = {0xC774, nil, 0xC774}, -- 이(라) => 이, , 이
-}
-
---
--- helper function for number-like characters
---
-local function josa_char_num (t, c)
- c = c % 10 + 0x30
- return t[c] or 2
-end
-
---
--- decide josa selection
---
-local josa_code = setmetatable({
- [0x30] = 3, [0x31] = 1, [0x33] = 3, [0x36] = 3, [0x37] = 1,
- [0x38] = 1, [0x4C] = 1, [0x4D] = 3, [0x4E] = 3, [0x6C] = 1,
- [0x6D] = 3, [0x6E] = 3, [0xFB02] = 1, [0xFB04] = 1,
-},{ __index = function(t,c)
- if c >= 0xAC00 and c <= 0xD7A3 then
- c = (c - 0xAC00) % 28 + 0x11A7
- end
- if c >= 0x11A8 and c <= 0x11FF then
- if c == 0x11AF then return 1 end
- return 3
- end
- if c >= 0xD7CB and c <= 0xD7FB then return 3 end
- if c >= 0x2170 and c <= 0x217F then c = c - 0x10 end
- if c >= 0x2160 and c <= 0x216F then
- if c >= 0x216C then return 3 end
- return josa_char_num(t, c - 0x215F)
- end
- if c >= 0x2460 and c <= 0x2473 then return josa_char_num(t, c - 0x245F) end
- if c >= 0x2474 and c <= 0x2487 then return josa_char_num(t, c - 0x2473) end
- if c >= 0x2488 and c <= 0x249B then return josa_char_num(t, c - 0x2487) end
- if c >= 0x249C and c <= 0x24B5 then return t[c - 0x249C + 0x61] or 2 end
- if c >= 0x24B6 and c <= 0x24CF then return t[c - 0x24B6 + 0x61] or 2 end
- if c >= 0x24D0 and c <= 0x24E9 then return t[c - 0x24D0 + 0x61] or 2 end
- if c >= 0x3131 and c <= 0x318E then
- if c == 0x3139 then return 1 end
- if c >= 0x314F and c <= 0x3163 or c >= 0x3187 then return 2 end
- return 3
- end
- if c >= 0x3260 and c <= 0x327E then c = c - 0x60 end
- if c >= 0x3200 and c <= 0x321E then
- if c == 0x3203 then return 1 end
- if c >= 0x320E then return 2 end
- return 3
- end
- if c >= 0xFF10 and c <= 0xFF19 then return josa_char_num(t, c - 0xFF10) end
- if c >= 0xFF21 and c <= 0xFF3A then return t[c - 0xFF21 + 0x61] or 2 end
- if c >= 0xFF41 and c <= 0xFF5A then return t[c - 0xFF41 + 0x61] or 2 end
- return 2
- end
-})
-
---
--- obtain char that comes just before the josa
---
-local function get_prev_char (p)
- while p do
- if p.id == glyph_id then
- local pc = p.char or 0
- if not nobr_after[pc] then
- if not nobr_before[pc] or nobr_before[pc] >= 2 then
- return pc
- end
- end
- elseif p.id == hbox_id or p.id == vbox_id then
- local pc = get_prev_char(node.slide(p.head))
- if pc then return pc end
- end
- p = p.prev
- end
-end
-
---
--- main process of josa selection
---
-local function auto_josa (head)
- local curr, tofree = head, {}
- while curr do
- if curr.id == glyph_id then
- local josa = node.has_attribute(curr, attr_josa)
- if josa then
- local cc = curr.char or 0
- if josa == 0 then
- josa = josa_code[get_prev_char(curr.prev) or 0x30]
- end
- if cc == 0xC774 then
- local n = curr.next
- if n and n.char and n.char >= 0xAC00 and n.char <= 0xD7A3 then
- else
- cc = 0xAC00
- end
- end
- local new = josa_table[cc]
- if new then
- cc = new[josa]
- if cc then
- curr.char = cc
- else
- head = node.remove(head, curr)
- table.insert(tofree, curr)
- end
- end
- node.unset_attribute(curr, attr_josa)
- end
- end
- curr = curr.next
- end
- for _,v in ipairs(tofree) do node.free(v) end
- return head
-end
-
---
--- now register to luatex callbacks
--- 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)
- 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
- 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")
-
--- vim:ft=lua:tw=0:sw=4:ts=4:expandtab
-% \end{macrocode}
-% \iffalse
-%</polyglossia-korean.lua>
-%<*polyglossia-latin.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-latin.lua}
-% \begin{macrocode}
---
--- polyglossia-latin.lua
--- part of polyglossia v2.1 -- 2024/03/07
---
-
-require('polyglossia-punct')
-
--- For ecclesiastic Latin (and sometimes for Italian) a very small space is
--- used for the punctuation. The ecclesiastic package uses a space of
--- 0.3\fontdimen2, where \fontdimen2 is a interword space, which is typically
--- between 1/4 and 1/3 of a quad. We choose a half of a \thinspace here.
-local hairspace = 0.08333 -- 1/12
-
-local function space_left(char)
- polyglossia.add_left_spaced_character('latin', char, hairspace, 'quad')
-end
-
-local function space_right(char)
- polyglossia.add_right_spaced_character('latin', char, hairspace, 'quad')
-end
-
-polyglossia.clear_spaced_characters('latin')
-space_left('!')
-space_left('?')
-space_left('‼')
-space_left('⁇')
-space_left('⁈')
-space_left('⁉')
-space_left('‽') -- U+203D (interrobang)
-space_left(':')
-space_left(';')
-space_left('»')
-space_left('›')
-space_right('«')
-space_right('‹')
-
-local function activate_latin_punct()
- polyglossia.activate_punct('latin')
-end
-
-local function deactivate_latin_punct()
- polyglossia.deactivate_punct()
-end
-
-polyglossia.activate_latin_punct = activate_latin_punct
-polyglossia.deactivate_latin_punct = deactivate_latin_punct
-% \end{macrocode}
-% \iffalse
-%</polyglossia-latin.lua>
-%<*polyglossia-punct.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-punct.lua}
-% \begin{macrocode}
---
--- polyglossia-punct.lua
--- part of polyglossia v2.1 -- 2024/03/07
---
-
-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 new_attribute = luatexbase.new_attribute
-
-local node = node
-
-local insert_node_before = node.insert_before
-local insert_node_after = node.insert_after
-local remove_node = node.remove
-local has_attribute = node.has_attribute
-local node_copy = node.copy
-local new_node = node.new
-local end_of_math = node.end_of_math
-local getnext = node.getnext
-local getprev = node.getprev
-
--- node types according to node.types()
-local glue_code = node.id"glue"
-local glyph_code = node.id"glyph"
-local penalty_code = node.id"penalty"
-local kern_code = node.id"kern"
-local math_code = node.id"math"
-
--- we need some node subtypes
-local userkern = 1
-local userskip = 0
-local removable_skip = {
- [0] = true, -- userskip
- [13] = true, -- spaceskip
- [14] = true, -- xspaceskip
-}
-
--- we make a new node, so that we can copy it later on
-local kern_node = new_node(kern_code)
-kern_node.subtype = userkern -- this kern can be removed later on
-
-local function get_kern_node(dim)
- local n = node_copy(kern_node)
- n.kern = dim
- return n
-end
-
-local glue_node = new_node(glue_code)
-glue_node.subtype = userskip
-
-local function get_glue_node(dim, stretch, shrink)
- local n = node_copy(glue_node)
- n.width = dim
- n.stretch = stretch
- n.shrink = shrink
- return n
-end
-
-local penalty_node = new_node(penalty_code)
-penalty_node.penalty = 10000
-
-local function get_penalty_node()
- return node_copy(penalty_node)
-end
-
--- all possible space characters according to section 6.2 of the Unicode Standard
--- https://www.unicode.org/versions/Unicode12.0.0/ch06.pdf
-local space_chars = {
- [0x20] = true, -- space
- [0xA0] = true, -- no-break space
- [0x1680] = true, -- ogham space mark
- [0x2000] = true, -- en quad
- [0x2001] = true, -- em quad
- [0x2002] = true, -- en space
- [0x2003] = true, -- em space
- [0x2004] = true, -- three-per-em-space
- [0x2005] = true, -- four-per-em space
- [0x2006] = true, -- six-per-em space
- [0x2007] = true, -- figure space
- [0x2008] = true, -- punctuation space
- [0x2009] = true, -- thin space
- [0x200A] = true, -- hair space
- [0x202F] = true, -- narrow no-break space
- [0x205F] = true, -- medium mathematical space
- [0x3000] = true -- ideographic space
-}
-
--- all left bracket characters, referenced by their Unicode slot
-local left_bracket_chars = {
- [0x28] = true, -- left parenthesis
- [0x5B] = true, -- left square bracket
- [0x7B] = true, -- left curly bracket
- [0x27E8] = true -- mathematical left angle bracket
-}
-
--- all right bracket characters, referenced by their Unicode slot
-local right_bracket_chars = {
- [0x29] = true, -- right parenthesis
- [0x5D] = true, -- right square bracket
- [0x7D] = true, -- right curly bracket
- [0x27E9] = true -- mathematical right angle bracket
-}
-
--- question and exclamation marks, referenced by their Unicode slot
-local question_exclamation_chars = {
- [0x21] = true, -- exclamation mark !
- [0x3F] = true, -- question mark ?
- [0x203C] = true, -- double exclamation mark ‼
- [0x203D] = true, -- interrobang ‽
- [0x2047] = true, -- double question mark ⁇
- [0x2048] = true, -- question exclamation mark ⁈
- [0x2049] = true -- exclamation question mark ⁉
-}
-
--- from nodes-tst.lua, adapted
-local function somespace(n)
- if n then
- local id, subtype = n.id, n.subtype
- if id == glue_code then
- -- it is dangerous to remove all the type of glue
- return removable_skip[subtype]
- elseif id == kern_code then
- -- remove only user's kern
- return subtype == userkern
- elseif id == glyph_code then
- return space_chars[n.char]
- end
- end
-end
-
-local function someleftbracket(n)
- if n then
- local id = n.id
- if id == glyph_code then
- return left_bracket_chars[n.char]
- end
- end
-end
-
-local function somerightbracket(n)
- if n then
- local id = n.id
- if id == glyph_code then
- return right_bracket_chars[n.char]
- end
- end
-end
-
-local function question_exclamation_sequence(n1, n2)
- if n1 and n2 then
- local id1 = n1.id
- local id2 = n2.id
- if id1 == glyph_code and id2 == glyph_code then
- return question_exclamation_chars[n1.char] and question_exclamation_chars[n2.char]
- end
- end
-end
-
--- idem
-local function somepenalty(n, value)
- if n then
- local id = n.id
- if id == penalty_code then
- if value then
- return n.penalty == value
- else
- return true
- end
- end
- end
-end
-
-local punct_attr = new_attribute("polyglossia_punct")
-
-local lang_id = {}
-local lang_counter = 0
-local left_space = {}
-local right_space = {}
-
-local function ensure_lang_id(lang)
- if not lang_id[lang] then
- lang_counter = lang_counter + 1
- lang_id[lang] = lang_counter
- end
- return lang_id[lang]
-end
-
-local function clear_spaced_characters(lang)
- local id = ensure_lang_id(lang)
- left_space[id] = {}
- right_space[id] = {}
-end
-
-local function illegal_unit(unit)
- if unit then
- texio.write_nl('Illegal spacing unit "'..unit..'".')
- else
- texio.write_nl('Spacing unit is a nil value.')
- end
-end
-
-local function add_left_spaced_character(lang, char, kern, unit, rubber)
--- The parameter kern is a number meant as a fraction of the unit.
--- The unit can be "quad" (1em) or "space" (interword space).
--- The parameter rubber is a Boolean value indicating if the inserted space is
--- stretchable and shrinkable (only relevant if the unit is "space").
- local id = ensure_lang_id(lang)
- if unit == "quad" or unit == "space" then
- left_space[id][char] = {}
- left_space[id][char]["kern"] = kern
- left_space[id][char]["unit"] = unit
- left_space[id][char]["rubber"] = rubber
- else
- illegal_unit(unit)
- end
-end
-
-local function add_right_spaced_character(lang, char, kern, unit, rubber)
- local id = ensure_lang_id(lang)
- if unit == "quad" or unit == "space" then
- right_space[id][char] = {}
- right_space[id][char]["kern"] = kern
- right_space[id][char]["unit"] = unit
- right_space[id][char]["rubber"] = rubber
- else
- illegal_unit(unit)
- end
-end
-
--- from typo-spa.lua, adapted
-local function process(head)
- local current = head
- while current do
- local id = current.id
- if id == glyph_code then
- local attr = has_attribute(current, punct_attr)
- if attr then
- local char, leftspace, rightspace
- if current.char <= 0x10FFFF then -- greater values may cause problems with utf8.char
- char = utf8.char(current.char)
- leftspace = left_space[attr][char]
- rightspace = right_space[attr][char]
- end
- if leftspace or rightspace then
- local fontparameters = fonts.hashes.parameters[current.font]
- local unit, stretch, shrink, spacing_node
- if leftspace and fontparameters then
- local prev = getprev(current)
- local space_exception = false
- if prev then
- -- do not add space after left (opening) bracket and between question/exclamation marks
- space_exception = someleftbracket(prev) or question_exclamation_sequence(prev, current)
- -- TODO: there is a question here: do we override a preceding space or not?...
- while somespace(prev) do
- head = remove_node(head, prev)
- prev = getprev(current)
- end
- if somepenalty(prev, 10000) then
- head = remove_node(head, prev)
- end
- end
- if leftspace.unit == "quad" then
- unit = fontparameters.quad
- spacing_node = get_kern_node(leftspace.kern*unit)
- elseif leftspace.unit == "space" then
- unit = fontparameters.space
- if leftspace.rubber then
- stretch = leftspace.kern*fontparameters.space_stretch
- shrink = leftspace.kern*fontparameters.space_shrink
- spacing_node = get_glue_node(leftspace.kern*unit, stretch, shrink)
- head = insert_node_before(head, current, get_penalty_node())
- else
- spacing_node = get_kern_node(leftspace.kern*unit)
- end
- end
- if not space_exception then
- head = insert_node_before(head, current, spacing_node)
- end
- end
- if rightspace and fontparameters then
- local next = getnext(current)
- local space_exception = false
- if next then
- -- do not add space before right (closing) bracket
- space_exception = somerightbracket(next)
- local nextnext = getnext(next)
- if somepenalty(next, 10000) and somespace(nextnext) then
- head, next = remove_node(head, next)
- end
- while somespace(next) do
- head, next = remove_node(head, next)
- end
- end
- if rightspace.unit == "quad" then
- unit = fontparameters.quad
- spacing_node = get_kern_node(rightspace.kern*unit)
- elseif rightspace.unit == "space" then
- unit = fontparameters.space
- if rightspace.rubber then
- stretch = rightspace.kern*fontparameters.space_stretch
- shrink = rightspace.kern*fontparameters.space_shrink
- spacing_node = get_glue_node(rightspace.kern*unit, stretch, shrink)
- if not space_exception then
- head, current = insert_node_after(head, current, get_penalty_node())
- end
- else
- spacing_node = get_kern_node(rightspace.kern*unit)
- end
- end
- if not space_exception then
- head, current = insert_node_after(head, current, spacing_node)
- end
- end
- end
- end
- elseif id == math_code then
- -- warning: this is a feature of luatex > 0.76
- current = end_of_math(current) -- weird, can return nil .. no math end?
- end
- current = getnext(current) -- no error even if current is nil
- end
- return head
-end
-
-local function activate(lang)
- local id = ensure_lang_id(lang)
- -- We set the punctuation attribute to a language id here. This is
- -- 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
-
-local function deactivate()
- tex.setattribute(punct_attr, -0x7FFFFFFF) -- this value means "unset"
- -- Though it would make compilation slightly faster, it is not possible to
- -- safely uncomment the following lines. Imagine the following case: you
- -- start a paragraph by some spaced punctuation text, then, in the same
- -- paragraph, you change the language to something else, and thus call the
- -- following lines. This means that, at the end of the paragraph, the
- -- function won't be in the callback, so the beginning of the paragraph
- -- won't be processed by it.
- -- if priority_in_callback(callback_name, "polyglossia-punct.process") then
- -- remove_from_callback(callback_name, "polyglossia-punct.process")
- -- end
-end
-
-polyglossia.activate_punct = activate
-polyglossia.deactivate_punct = deactivate
-polyglossia.add_left_spaced_character = add_left_spaced_character
-polyglossia.add_right_spaced_character = add_right_spaced_character
-polyglossia.clear_spaced_characters = clear_spaced_characters
-% \end{macrocode}
-% \iffalse
-%</polyglossia-punct.lua>
-%<*polyglossia-sanskrit.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-sanskrit.lua}
-% \begin{macrocode}
---
--- polyglossia-sanskrit.lua
--- part of polyglossia v2.1 -- 2024/03/07
---
-
-require('polyglossia-punct')
-
--- How do we now, in Lua, what a \thinspace is? In the LaTeX source (latex.ltx)
--- it is defined as:
--- \def\thinspace{\leavevmode@ifvmode\kern .16667em }
--- I see no way of seeing if it has been overriden or not. So we stick to this
--- value.
-local thinspace = 0.16667 -- 1/6
-
-local function space_left(char)
- polyglossia.add_left_spaced_character('sanskrit', char, thinspace, 'quad')
-end
-
-polyglossia.clear_spaced_characters('sanskrit')
-space_left('!')
-space_left('?')
-space_left('‼')
-space_left('⁇')
-space_left('⁈')
-space_left('⁉')
-space_left('‽') -- U+203D (interrobang)
-space_left(':')
-space_left(';')
-space_left('।') -- danda, U+0964
-space_left('॥') -- double danda, U+0965
-
-local function activate_sanskrit_punct()
- polyglossia.activate_punct('sanskrit')
-end
-
-local function deactivate_sanskrit_punct()
- polyglossia.deactivate_punct()
-end
-
-polyglossia.activate_sanskrit_punct = activate_sanskrit_punct
-polyglossia.deactivate_sanskrit_punct = deactivate_sanskrit_punct
-% \end{macrocode}
-% \iffalse
-%</polyglossia-sanskrit.lua>
-%<*polyglossia-tibt.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-tibt.lua}
-% \begin{macrocode}
---
--- polyglossia-tibt.lua
--- part of polyglossia v2.1 -- 2024/03/07
---
-
-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 next, type = next, type
-
-local nodes, fonts, node = nodes, fonts, node
-
-local nodecodes = nodes.nodecodes --- <= preloaded node.types()
-
-local insert_node_before = node.insert_before
-local insert_node_after = node.insert_after
-local remove_node = nodes.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 end_of_math = function (n)
- for n in traverse_nodes(math_code, n.next) do
- return n
- end
- end
-end
-
--- node types as of April 2013
-local glyph_code = nodecodes.glyph
-local penalty_code = nodecodes.penalty
-local kern_code = nodecodes.kern
-
--- we make a new node, so that we can copy it later on
-local penalty_node = node.new(penalty_code)
-penalty_node.penalty = 50 -- corresponds to the penalty LaTeX sets at explicit hyphens
-
-local function get_penalty_node()
- return copy_node(penalty_node)
-end
-
-local xpgtibtattr = luatexbase.attributes['xpg@tibteol']
-
-local tsheg = unicode.utf8.byte('་')
-
--- from typo-spa.lua
-local function process(head)
- local start = head
- -- head is always begin of par (whatsit), so we have at least two prev nodes
- -- penalty followed by glue
- while start do
- local id = start.id
- if id == glyph_code then
- local attr = has_attribute(start, xpgtibtattr)
- if attr and attr > 0 then
- if start.char == tsheg then
- if start.next then
- insert_node_after(head,start,get_penalty_node())
- end
- 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
- start = start.next
- end
- end
- return head
-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
-end
-
-local function desactivate()
- if priority_in_callback (callback_name, "polyglossia-tibt.process") then
- remove_from_callback(callback_name, "polyglossia-tibt.process")
- end
-end
-
-polyglossia.activate_tibt_eol = activate
-polyglossia.desactivate_tibt_eol = desactivate
-% \end{macrocode}
-% \iffalse
-%</polyglossia-tibt.lua>
-%<*polyglossia.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia.lua}
-% \begin{macrocode}
---
--- polyglossia.lua
--- part of polyglossia v2.1 -- 2024/03/07
---
-
-local module_name = "polyglossia"
-local polyglossia_module = {
- name = module_name,
- version = 1.3,
- date = "2013/05/11",
- description = "Polyglossia",
- author = "Elie Roux",
- copyright = "Elie Roux",
- license = "CC0"
-}
-
-luatexbase.provides_module(polyglossia_module)
-
-local log_info = function(message, ...)
- luatexbase.module_info(module_name, message:format(...))
-end
-local log_warn = function(message, ...)
- luatexbase.module_warning(module_name, message:format(...))
-end
-
-polyglossia = polyglossia or {}
-local polyglossia = polyglossia
-
-local function load_tibt_eol()
- require('polyglossia-tibt')
-end
-
--- predefined l@nohyphenation or LuaTeX's maximum value for \language
-local nohyphid = luatexbase.registernumber'l@nohyphenation' or 16383
-token.set_char('l@nohyphenation', nohyphid)
-
--- key `nohyphenation` is for .sty file when possibly undefined l@nohyphenation
-local newloader_loaded_languages = { nohyphenation = nohyphid }
-
-local newloader_available_languages = require'language.dat.lua'
--- Suggestion by Dohyun Kim on #129
-local t = { }
-for k, v in pairs(newloader_available_languages) do
- t[k] = v
- for _, vv in pairs(v.synonyms) do
- t[vv] = v
- end
-end
-newloader_available_languages = t
-
--- LaTeX's language register is \count19
-local lang_register = 19
-
--- New hyphenation pattern loader: use language.dat.lua directly and the language identifiers
-local function newloader(langentry)
- local loaded_language = newloader_loaded_languages[langentry]
- if loaded_language then
- local langid = lang.id(loaded_language)
- log_info('Language %s already loaded; id is %i', langentry, langid)
- return langid
- else
- local langdata = newloader_available_languages[langentry]
- if langdata then
-
- local special = langdata.special
- if special then
- -- language0 (USenglish) is already included in the format
- if special == 'language0' then
- return 0
-
- -- disabled language should not be used for utf-8 text
- elseif special:find'^disabled:' then
- log_warn('Hyphenation of language %s %s', langentry, special)
- return nohyphid
- end
- end
-
- -- language info will be written into the .log file
- local s = { "Language data for " .. langentry }
- for k, v in pairs(langdata) do
- if type(v) == 'table' then -- for 'synonyms'
- s[#s+1] = k .. "\t" .. table.concat(v,',')
- else
- s[#s+1] = k .. "\t" .. tostring(v)
- end
- end
- log_info(table.concat(s,"\n"))
-
- --
- -- LaTeX's \newlanguage increases language register (count19),
- -- whereas LuaTeX's lang.new() increases its own language id.
- -- So when a user has declared, say, \newlanguage\lang@xyz, then
- -- these two numbers do not match each other. If we do not consider
- -- this possible situation, our newloader() function will
- -- unfortunately overwrite the language \lang@xyz.
- --
- -- Threfore 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
- -- overwrite our language object.
- --
- -- get next \newlanguage allocation number
- local langcnt = tex.count[lang_register] + 1
- -- get new lang object
- local langobject = lang.new()
- local langid = lang.id(langobject)
- -- get bigger one between \newlanguage and new lang obj id
- local newlangid = math.max(langcnt, langid)
- -- set language register for possible \newlanguage
- tex.setcount('global', lang_register, newlangid)
- -- get new lang object if needeed
- if langid ~= newlangid then
- langobject = lang.new(newlangid)
- end
-
- -- load hyphenation patterns and exceptions
- for _,v in ipairs{ 'patterns', 'hyphenation' } do
- local data = langdata[v]
- if data and data ~= '' then
- -- cope with comma separated list, such as serbian
- for _,vv in ipairs(data:explode',+') do
- local filepath = kpse.find_file(vv)
- if filepath then
- local fh = io.open(filepath)
- lang[v](langobject, fh:read'a')
- fh:close()
- else
- log_warn('Hyphenation file %s not found', vv)
- end
- end
- end
- end
-
- newloader_loaded_languages[langentry] = langobject
-
- log_info('Language %s was not yet loaded; created with id %i',
- langentry, newlangid)
- return newlangid
- else
- log_warn('Language %s not found in language.dat.lua', langentry)
- return nohyphid
- end
- end
-end
-
-polyglossia.load_tibt_eol = load_tibt_eol
-polyglossia.newloader = newloader
-polyglossia.newloader_loaded_languages = newloader_loaded_languages
-% \end{macrocode}
-% \iffalse
-%</polyglossia.lua>
-%<*babel-hebrewalph.def>
-% \fi
-% \clearpage
-%
-% \subsection{babel-hebrewalph.def}
-% \begin{macrocode}
-\ProvidesFile{babel-hebrewalph.def}
- [2023/06/01 %
- Expandable definitions for Hebrew numerals]
-
-\newcommand*\hebrewnumeral[1]{%
- \expandafter\@hebrew@numeral\expandafter{\the\numexpr#1}%
-}
-\newcommand*\Hebrewnumeral[1]{%
- \expandafter\@Hebrew@numeral\expandafter{\the\numexpr#1}%
-}
-\newcommand*\Hebrewnumeralfinal[1]{%
- \expandafter\@Hebrew@numeralfinal\expandafter{\the\numexpr#1}%
-}
-
-\newcommand*\hebrew@div@trancate[2]{%
- \ifnum\numexpr #1 - #2*\numexpr #1/#2\relax<0
- \the\numexpr #1/#2 -1\relax\else\the\numexpr #1/#2\relax\fi
-}
-
-\newcommand*\@hebrew@@numeral[2]{%
- \ifnum#1<\z@\space\xpg@warning{Illegal value (#1) for Hebrew numeral}%
- \else
- \ifnum #1<1000
- \gim@nomil{#1}{#2}%
- \else
- \hebrewnumeral{\hebrew@div@trancate{#1}{1000}}׳%
- \expandafter\gim@nomil\expandafter{\the\numexpr #1 - 1000*\hebrew@div@trancate{#1}{1000}}{#2}%
- \fi
- \fi
-}
-
-\newcommand*\@hebrew@numeral[1]{\@hebrew@@numeral{#1}{0}}
-\newcommand*\@Hebrew@numeral[1]{\@hebrew@@numeral{#1}{1}}
-\newcommand*\@Hebrew@numeralfinal[1]{\@hebrew@@numeral{#1}{2}}
-
-\newcommand*\hebrew@alph@zero{}
-\newcommand*\gim@nomil[2]{%
- \ifcase\hebrew@div@trancate{#1}{100} % print nothing if no hundreds
- \or ק\ifnum #2>0\ifnum #1=100 ׳\fi\fi
- \or ר\ifnum #2>0\ifnum #1=200 ׳\fi\fi
- \or ש\ifnum #2>0\ifnum #1=300 ׳\fi\fi
- \or ת\ifnum #2>0\ifnum #1=400 ׳\fi\fi
- \or ת\ifnum #2>0\ifnum #1=500 ״\fi\fi ק%
- \or ת\ifnum #2>0\ifnum #1=600 ״\fi\fi ר%
- \or ת\ifnum #2>0\ifnum #1=700 ״\fi\fi ש%
- \or ת\ifnum #2>0\ifnum #1=800 ״\fi\fi ת%
- \or תת\ifnum #2>0\ifnum #1=900 ״\fi\fi ק%
- \fi
- \ifnum \the\numexpr #1 - 100*\hebrew@div@trancate{#1}{100} = 16
- \ifnum #2>0 ט״ז\else טז\fi% tet-zayin
- \else\ifnum \the\numexpr #1 - 100*\hebrew@div@trancate{#1}{100} = 15
- \ifnum #2>0 ט״ו\else טו\fi% tet-vav
- \else
- \ifcase\expandafter\hebrew@div@trancate\expandafter{\the\numexpr #1 - 100*\hebrew@div@trancate{#1}{100}}{10} % print nothing if no tens
- \or \ifnum \the\numexpr #1 - 10*\hebrew@div@trancate{#1}{10}>0 י\else\ifnum #2>0\ifnum #1=10 י׳\else ״י\fi\else י\fi\fi
- \or \ifnum \the\numexpr #1 - 10*\hebrew@div@trancate{#1}{10}>0 כ\else\ifnum #2>0\ifnum #1>20 ״\fi\fi\if #22ך\else כ\fi\ifnum #2>0\ifnum #1=20 ׳\fi\fi\fi
- \or \ifnum \the\numexpr #1 - 10*\hebrew@div@trancate{#1}{10}>0 ל\else\ifnum #2>0\ifnum #1=30 ל׳\else ״ל\fi\else ל\fi\fi
- \or \ifnum \the\numexpr #1 - 10*\hebrew@div@trancate{#1}{10}>0 מ\else\ifnum #2>0\ifnum #1>40 ״\fi\fi\if #22ם\else מ\fi\ifnum #2>0\ifnum #1=40 ׳\fi\fi\fi
- \or \ifnum \the\numexpr #1 - 10*\hebrew@div@trancate{#1}{10}>0 נ\else\ifnum #2>0\ifnum #1>50 ״\fi\fi\if #22ן\else נ\fi\ifnum #2>0\ifnum #1=50 ׳\fi\fi\fi
- \or \ifnum \the\numexpr #1 - 10*\hebrew@div@trancate{#1}{10}>0 ס\else\ifnum #2>0\ifnum #1=60 ס׳\else ״ס\fi\else ס\fi\fi
- \or \ifnum \the\numexpr #1 - 10*\hebrew@div@trancate{#1}{10}>0 ע\else\ifnum #2>0\ifnum #1=70 ע׳\else ״ע\fi\else ע\fi\fi
- \or \ifnum \the\numexpr #1 - 10*\hebrew@div@trancate{#1}{10}>0 פ\else\ifnum #2>0\ifnum #1>80 ״\fi\fi\if #22ף\else פ\fi\ifnum #2>0\ifnum #1=80 ׳\fi\fi\fi
- \or \ifnum \the\numexpr #1 - 10*\hebrew@div@trancate{#1}{10}>0 צ\else\ifnum #2>0\ifnum #1>90 ״\fi\fi\if #22ץ\else צ\fi\ifnum #2>0\ifnum #1=90 ׳\fi\fi\fi
- \fi
- \ifcase\the\numexpr #1 - 10*\hebrew@div@trancate{#1}{10}
- \hebrew@alph@zero % empty but can be defined if desired
- \or \ifnum #2>0\ifnum #1=1 א׳\else ״א\fi\else א\fi
- \or \ifnum #2>0\ifnum #1=2 ב׳\else ״ב\fi\else ב\fi
- \or \ifnum #2>0\ifnum #1=3 ג׳\else ״ג\fi\else ג\fi
- \or \ifnum #2>0\ifnum #1=4 ד׳\else ״ד\fi\else ד\fi
- \or \ifnum #2>0\ifnum #1=5 ה׳\else ״ה\fi\else ה\fi
- \or \ifnum #2>0\ifnum #1=6 ו׳\else ״ו\fi\else ו\fi
- \or \ifnum #2>0\ifnum #1=7 ז׳\else ״ז\fi\else ז\fi
- \or \ifnum #2>0\ifnum #1=8 ח׳\else ״ח\fi\else ח\fi
- \or \ifnum #2>0\ifnum #1=9 ט׳\else ״ט\fi\else ט\fi
- \fi\fi\fi
-}
-
-\newcommand*\Alphfinal[1]{\expandafter\@Alphfinal\csname c@#1\endcsname}
-\newcommand*\@Alphfinal[1]{\Hebrewnumeralfinal{#1}}
-
-% \end{macrocode}
-% \iffalse
-%</babel-hebrewalph.def>
-%<*babelsh.def>
-% \fi
-% \clearpage
-%
-% \subsection{babelsh.def}
-% \begin{macrocode}
-\ifx\initiate@active@char\@undefined
-\else
- \bbl@afterfi\endinput
-\fi
-\ProvidesFile{babelsh.def}
- [2022/06/21 %
- Babel common definitions for shorthands^^J
- Taken verbatim from babel files (2022/06/06 v3.76)]
-%
-% ------------------------------------------------------------------------------
-%
-% lines 52 to 56 from babel.sty
-%
-% ------------------------------------------------------------------------------
-%
-\def\bbl@error#1#2{%
- \begingroup
- \def\\{\MessageBreak}%
- \PackageError{babel}{#1}{#2}%
- \endgroup}
-%
-% ------------------------------------------------------------------------------
-%
-% lines 69 to 73 from babel.sty
-%
-% ------------------------------------------------------------------------------
-%
-\def\bbl@info#1{%
- \begingroup
- \def\\{\MessageBreak}%
- \PackageInfo{babel}{#1}%
- \endgroup}
-%
-% ------------------------------------------------------------------------------
-%
-% lines 75 to 80 from babel.sty
-%
-% ------------------------------------------------------------------------------
-%
-\def\bbl@stripslash{\expandafter\@gobble\string}
-\def\bbl@add#1#2{%
- \bbl@ifunset{\bbl@stripslash#1}%
- {\def#1{#2}}%
- {\expandafter\def\expandafter#1\expandafter{#1#2}}}
-\def\bbl@xin@{\@expandtwoargs\in@}
-%
-% ------------------------------------------------------------------------------
-%
-% line 97 to 98 from babel.sty
-%
-% ------------------------------------------------------------------------------
-%
-\long\def\bbl@afterelse#1\else#2\fi{\fi#1}
-\long\def\bbl@afterfi#1\fi{\fi#1}
-%
-% ------------------------------------------------------------------------------
-%
-% line 376 from babel.sty
-%
-% ------------------------------------------------------------------------------
-%
-\let\bbl@opt@shorthands\@nnil
-%
-% ------------------------------------------------------------------------------
-%
-% lines 414 to 435 from babel.sty
-%
-% ------------------------------------------------------------------------------
-%
-\def\bbl@sh@string#1{%
- \ifx#1\@empty\else
- \ifx#1t\string~%
- \else\ifx#1c\string,%
- \else\string#1%
- \fi\fi
- \expandafter\bbl@sh@string
- \fi}
-\ifx\bbl@opt@shorthands\@nnil
- \def\bbl@ifshorthand#1#2#3{#2}%
-\else\ifx\bbl@opt@shorthands\@empty
- \def\bbl@ifshorthand#1#2#3{#3}%
-\else
- \def\bbl@ifshorthand#1{%
- \bbl@xin@{\string#1}{\bbl@opt@shorthands}%
- \ifin@
- \expandafter\@firstoftwo
- \else
- \expandafter\@secondoftwo
- \fi}
- \edef\bbl@opt@shorthands{%
- \expandafter\bbl@sh@string\bbl@opt@shorthands\@empty}%
-%
-% ------------------------------------------------------------------------------
-%
-% line 440 from babel.sty
-%
-% ------------------------------------------------------------------------------
-%
-\fi\fi
-%
-% ------------------------------------------------------------------------------
-%
-% lines 387 to 406 from babel.def
-%
-% ------------------------------------------------------------------------------
-%
-\let\bbl@opt@shorthands\@nnil
-\def\bbl@ifshorthand#1#2#3{#2}%
-\let\bbl@language@opts\@empty
-\ifx\babeloptionstrings\@undefined
- \let\bbl@opt@strings\@nnil
-\else
- \let\bbl@opt@strings\babeloptionstrings
-\fi
-\def\BabelStringsDefault{generic}
-\def\bbl@tempa{normal}
-\ifx\babeloptionmath\bbl@tempa
- \def\bbl@mathnormal{\noexpand\textormath}
-\fi
-\def\AfterBabelLanguage#1#2{}
-\ifx\BabelModifiers\@undefined\let\BabelModifiers\relax\fi
-\let\bbl@afterlang\relax
-\def\bbl@opt@safe{BR}
-\ifx\@uclclist\@undefined\let\@uclclist\@empty\fi
-\ifx\bbl@trace\@undefined\def\bbl@trace#1{}\fi
-\expandafter\newif\csname ifbbl@single\endcsname
-%
-% ------------------------------------------------------------------------------
-%
-% line 938 from babel.def
-%
-% ------------------------------------------------------------------------------
-%
-\def\bbl@csarg#1#2{\expandafter#1\csname bbl@#2\endcsname}%
-%
-% ------------------------------------------------------------------------------
-%
-% lines 941 to 947 from babel.def
-%
-% ------------------------------------------------------------------------------
-%
-\def\bbl@loop#1#2#3{\bbl@@loop#1{#3}#2,\@nnil,}
-\def\bbl@loopx#1#2{\expandafter\bbl@loop\expandafter#1\expandafter{#2}}
-\def\bbl@@loop#1#2#3,{%
- \ifx\@nnil#3\relax\else
- \def#1{#3}#2\bbl@afterfi\bbl@@loop#1{#2}%
- \fi}
-\def\bbl@for#1#2#3{\bbl@loopx#1{#2}{\ifx#1\@empty\else#3\fi}}
-%
-% ------------------------------------------------------------------------------
-%
-% lines 956 to 965 from babel.def
-%
-% ------------------------------------------------------------------------------
-%
-\def\bbl@exp#1{%
- \begingroup
- \let\\\noexpand
- \let\<\bbl@exp@en
- \let\[\bbl@exp@ue
- \edef\bbl@exp@aux{\endgroup#1}%
- \bbl@exp@aux}
-\def\bbl@exp@en#1>{\expandafter\noexpand\csname#1\endcsname}%
-\def\bbl@exp@ue#1]{%
- \unexpanded\expandafter\expandafter\expandafter{\csname#1\endcsname}}%
-%
-% ------------------------------------------------------------------------------
-%
-% lines 979 to 998 from babel.def
-%
-% ------------------------------------------------------------------------------
-%
-\begingroup
- \gdef\bbl@ifunset#1{%
- \expandafter\ifx\csname#1\endcsname\relax
- \expandafter\@firstoftwo
- \else
- \expandafter\@secondoftwo
- \fi}
- \bbl@ifunset{ifcsname}% TODO. A better test?
- {}%
- {\gdef\bbl@ifunset#1{%
- \ifcsname#1\endcsname
- \expandafter\ifx\csname#1\endcsname\relax
- \bbl@afterelse\expandafter\@firstoftwo
- \else
- \bbl@afterfi\expandafter\@secondoftwo
- \fi
- \else
- \expandafter\@firstoftwo
- \fi}}
-\endgroup
-%
-% ------------------------------------------------------------------------------
-%
-% lines 1075 to 1084 from babel.def
-%
-% ------------------------------------------------------------------------------
-%
-\chardef\bbl@engine=%
- \ifx\directlua\@undefined
- \ifx\XeTeXinputencoding\@undefined
- \z@
- \else
- \tw@
- \fi
- \else
- \@ne
- \fi
-%
-% ------------------------------------------------------------------------------
-%
-% lines 1152 to 1155 from babel.def
-%
-% ------------------------------------------------------------------------------
-%
-\def\bbl@withactive#1#2{%
- \begingroup
- \lccode`~=`#2\relax
- \lowercase{\endgroup#1~}}
-%
-% ------------------------------------------------------------------------------
-%
-% line 1185 from babel.def
-%
-% NOTE: In order to avoid importing more unneeded definitions, this macro
-% does nothing for us.
-%
-% ------------------------------------------------------------------------------
-%
-\def\bbl@usehooks#1#2{}
-%
-% ------------------------------------------------------------------------------
-%
-% lines 1348 to 1463 from babel.def
-%
-% ------------------------------------------------------------------------------
-%
-\def\bbl@add@special#1{% 1:a macro like \", \?, etc.
- \bbl@add\dospecials{\do#1}% test @sanitize = \relax, for back. compat.
- \bbl@ifunset{@sanitize}{}{\bbl@add\@sanitize{\@makeother#1}}%
- \ifx\nfss@catcodes\@undefined\else % TODO - same for above
- \begingroup
- \catcode`#1\active
- \nfss@catcodes
- \ifnum\catcode`#1=\active
- \endgroup
- \bbl@add\nfss@catcodes{\@makeother#1}%
- \else
- \endgroup
- \fi
- \fi}
-\def\bbl@remove@special#1{%
- \begingroup
- \def\x##1##2{\ifnum`#1=`##2\noexpand\@empty
- \else\noexpand##1\noexpand##2\fi}%
- \def\do{\x\do}%
- \def\@makeother{\x\@makeother}%
- \edef\x{\endgroup
- \def\noexpand\dospecials{\dospecials}%
- \expandafter\ifx\csname @sanitize\endcsname\relax\else
- \def\noexpand\@sanitize{\@sanitize}%
- \fi}%
- \x}
-\def\bbl@active@def#1#2#3#4{%
- \@namedef{#3#1}{%
- \expandafter\ifx\csname#2@sh@#1@\endcsname\relax
- \bbl@afterelse\bbl@sh@select#2#1{#3@arg#1}{#4#1}%
- \else
- \bbl@afterfi\csname#2@sh@#1@\endcsname
- \fi}%
- \long\@namedef{#3@arg#1}##1{%
- \expandafter\ifx\csname#2@sh@#1@\string##1@\endcsname\relax
- \bbl@afterelse\csname#4#1\endcsname##1%
- \else
- \bbl@afterfi\csname#2@sh@#1@\string##1@\endcsname
- \fi}}%
-\def\initiate@active@char#1{%
- \bbl@ifunset{active@char\string#1}%
- {\bbl@withactive
- {\expandafter\@initiate@active@char\expandafter}#1\string#1#1}%
- {}}
-\def\@initiate@active@char#1#2#3{%
- \bbl@csarg\edef{oricat@#2}{\catcode`#2=\the\catcode`#2\relax}%
- \ifx#1\@undefined
- \bbl@csarg\def{oridef@#2}{\def#1{\active@prefix#1\@undefined}}%
- \else
- \bbl@csarg\let{oridef@@#2}#1%
- \bbl@csarg\edef{oridef@#2}{%
- \let\noexpand#1%
- \expandafter\noexpand\csname bbl@oridef@@#2\endcsname}%
- \fi
- \ifx#1#3\relax
- \expandafter\let\csname normal@char#2\endcsname#3%
- \else
- \bbl@info{Making #2 an active character}%
- \ifnum\mathcode`#2=\ifodd\bbl@engine"1000000 \else"8000 \fi
- \@namedef{normal@char#2}{%
- \textormath{#3}{\csname bbl@oridef@@#2\endcsname}}%
- \else
- \@namedef{normal@char#2}{#3}%
- \fi
- \bbl@restoreactive{#2}%
- \AtBeginDocument{%
- \catcode`#2\active
- \if@filesw
- \immediate\write\@mainaux{\catcode`\string#2\active}%
- \fi}%
- \expandafter\bbl@add@special\csname#2\endcsname
- \catcode`#2\active
- \fi
- \let\bbl@tempa\@firstoftwo
- \if\string^#2%
- \def\bbl@tempa{\noexpand\textormath}%
- \else
- \ifx\bbl@mathnormal\@undefined\else
- \let\bbl@tempa\bbl@mathnormal
- \fi
- \fi
- \expandafter\edef\csname active@char#2\endcsname{%
- \bbl@tempa
- {\noexpand\if@safe@actives
- \noexpand\expandafter
- \expandafter\noexpand\csname normal@char#2\endcsname
- \noexpand\else
- \noexpand\expandafter
- \expandafter\noexpand\csname bbl@doactive#2\endcsname
- \noexpand\fi}%
- {\expandafter\noexpand\csname normal@char#2\endcsname}}%
- \bbl@csarg\edef{doactive#2}{%
- \expandafter\noexpand\csname user@active#2\endcsname}%
- \bbl@csarg\edef{active@#2}{%
- \noexpand\active@prefix\noexpand#1%
- \expandafter\noexpand\csname active@char#2\endcsname}%
- \bbl@csarg\edef{normal@#2}{%
- \noexpand\active@prefix\noexpand#1%
- \expandafter\noexpand\csname normal@char#2\endcsname}%
- \expandafter\let\expandafter#1\csname bbl@normal@#2\endcsname
- \bbl@active@def#2\user@group{user@active}{language@active}%
- \bbl@active@def#2\language@group{language@active}{system@active}%
- \bbl@active@def#2\system@group{system@active}{normal@char}%
- \expandafter\edef\csname\user@group @sh@#2@@\endcsname
- {\expandafter\noexpand\csname normal@char#2\endcsname}%
- \expandafter\edef\csname\user@group @sh@#2@\string\protect@\endcsname
- {\expandafter\noexpand\csname user@active#2\endcsname}%
- \if\string'#2%
- \let\prim@s\bbl@prim@s
- \let\active@math@prime#1%
- \fi
- \bbl@usehooks{initiateactive}{{#1}{#2}{#3}}}
-\@ifpackagewith{babel}{KeepShorthandsActive}%
- {\let\bbl@restoreactive\@gobble}%
- {\def\bbl@restoreactive#1{%
- \bbl@exp{%
-%
-% ------------------------------------------------------------------------------
-%
-% lines 1466 to 1516 from babel.def
-%
-% ------------------------------------------------------------------------------
-%
- \\\AtEndOfPackage
- {\catcode`#1=\the\catcode`#1\relax}}}%
- \AtEndOfPackage{\let\bbl@restoreactive\@gobble}}
-\def\bbl@sh@select#1#2{%
- \expandafter\ifx\csname#1@sh@#2@sel\endcsname\relax
- \bbl@afterelse\bbl@scndcs
- \else
- \bbl@afterfi\csname#1@sh@#2@sel\endcsname
- \fi}
-\begingroup
-\bbl@ifunset{ifincsname}% TODO. Ugly. Correct? Only Plain?
- {\gdef\active@prefix#1{%
- \ifx\protect\@typeset@protect
- \else
- \ifx\protect\@unexpandable@protect
- \noexpand#1%
- \else
- \protect#1%
- \fi
- \expandafter\@gobble
- \fi}}
- {\gdef\active@prefix#1{%
- \ifincsname
- \string#1%
- \expandafter\@gobble
- \else
- \ifx\protect\@typeset@protect
- \else
- \ifx\protect\@unexpandable@protect
- \noexpand#1%
- \else
- \protect#1%
- \fi
- \expandafter\expandafter\expandafter\@gobble
- \fi
- \fi}}
-\endgroup
-\newif\if@safe@actives
-\@safe@activesfalse
-\def\bbl@restore@actives{\if@safe@actives\@safe@activesfalse\fi}
-\chardef\bbl@activated\z@
-\def\bbl@activate#1{%
- \chardef\bbl@activated\@ne
- \bbl@withactive{\expandafter\let\expandafter}#1%
- \csname bbl@active@\string#1\endcsname}
-\def\bbl@deactivate#1{%
- \chardef\bbl@activated\tw@
- \bbl@withactive{\expandafter\let\expandafter}#1%
- \csname bbl@normal@\string#1\endcsname}
-\def\bbl@firstcs#1#2{\csname#1\endcsname}
-\def\bbl@scndcs#1#2{\csname#2\endcsname}
-%
-% ------------------------------------------------------------------------------
-%
-% lines 1525 to 1702 from babel.def
-%
-% ------------------------------------------------------------------------------
-%
-\def\declare@shorthand#1#2{\@decl@short{#1}#2\@nil}
-\def\@decl@short#1#2#3\@nil#4{%
- \def\bbl@tempa{#3}%
- \ifx\bbl@tempa\@empty
- \expandafter\let\csname #1@sh@\string#2@sel\endcsname\bbl@scndcs
- \bbl@ifunset{#1@sh@\string#2@}{}%
- {\def\bbl@tempa{#4}%
- \expandafter\ifx\csname#1@sh@\string#2@\endcsname\bbl@tempa
- \else
- \bbl@info
- {Redefining #1 shorthand \string#2\\%
- in language \CurrentOption}%
- \fi}%
- \@namedef{#1@sh@\string#2@}{#4}%
- \else
- \expandafter\let\csname #1@sh@\string#2@sel\endcsname\bbl@firstcs
- \bbl@ifunset{#1@sh@\string#2@\string#3@}{}%
- {\def\bbl@tempa{#4}%
- \expandafter\ifx\csname#1@sh@\string#2@\string#3@\endcsname\bbl@tempa
- \else
- \bbl@info
- {Redefining #1 shorthand \string#2\string#3\\%
- in language \CurrentOption}%
- \fi}%
- \@namedef{#1@sh@\string#2@\string#3@}{#4}%
- \fi}
-\def\textormath{%
- \ifmmode
- \expandafter\@secondoftwo
- \else
- \expandafter\@firstoftwo
- \fi}
-\def\user@group{user}
-\def\language@group{english} % TODO. I don't like defaults
-\def\system@group{system}
-\def\useshorthands{%
- \@ifstar\bbl@usesh@s{\bbl@usesh@x{}}}
-\def\bbl@usesh@s#1{%
- \bbl@usesh@x
- {\AddBabelHook{babel-sh-\string#1}{afterextras}{\bbl@activate{#1}}}%
- {#1}}
-\def\bbl@usesh@x#1#2{%
- \bbl@ifshorthand{#2}%
- {\def\user@group{user}%
- \initiate@active@char{#2}%
- #1%
- \bbl@activate{#2}}%
- {\bbl@error
- {I can't declare a shorthand turned off (\string#2)}
- {Sorry, but you can't use shorthands which have been\\%
- turned off in the package options}}}
-\def\user@language@group{user@\language@group}
-\def\bbl@set@user@generic#1#2{%
- \bbl@ifunset{user@generic@active#1}%
- {\bbl@active@def#1\user@language@group{user@active}{user@generic@active}%
- \bbl@active@def#1\user@group{user@generic@active}{language@active}%
- \expandafter\edef\csname#2@sh@#1@@\endcsname{%
- \expandafter\noexpand\csname normal@char#1\endcsname}%
- \expandafter\edef\csname#2@sh@#1@\string\protect@\endcsname{%
- \expandafter\noexpand\csname user@active#1\endcsname}}%
- \@empty}
-\newcommand\defineshorthand[3][user]{%
- \edef\bbl@tempa{\zap@space#1 \@empty}%
- \bbl@for\bbl@tempb\bbl@tempa{%
- \if*\expandafter\@car\bbl@tempb\@nil
- \edef\bbl@tempb{user@\expandafter\@gobble\bbl@tempb}%
- \@expandtwoargs
- \bbl@set@user@generic{\expandafter\string\@car#2\@nil}\bbl@tempb
- \fi
- \declare@shorthand{\bbl@tempb}{#2}{#3}}}
-\def\languageshorthands#1{\def\language@group{#1}}
-\def\aliasshorthand#1#2{%
- \bbl@ifshorthand{#2}%
- {\expandafter\ifx\csname active@char\string#2\endcsname\relax
- \ifx\document\@notprerr
- \@notshorthand{#2}%
- \else
- \initiate@active@char{#2}%
- \expandafter\let\csname active@char\string#2\expandafter\endcsname
- \csname active@char\string#1\endcsname
- \expandafter\let\csname normal@char\string#2\expandafter\endcsname
- \csname normal@char\string#1\endcsname
- \bbl@activate{#2}%
- \fi
- \fi}%
- {\bbl@error
- {Cannot declare a shorthand turned off (\string#2)}
- {Sorry, but you cannot use shorthands which have been\\%
- turned off in the package options}}}
-\def\@notshorthand#1{%
- \bbl@error{%
- The character '\string #1' should be made a shorthand character;\\%
- add the command \string\useshorthands\string{#1\string} to
- the preamble.\\%
- I will ignore your instruction}%
- {You may proceed, but expect unexpected results}}
-\newcommand*\shorthandon[1]{\bbl@switch@sh\@ne#1\@nnil}
-\DeclareRobustCommand*\shorthandoff{%
- \@ifstar{\bbl@shorthandoff\tw@}{\bbl@shorthandoff\z@}}
-\def\bbl@shorthandoff#1#2{\bbl@switch@sh#1#2\@nnil}
-\def\bbl@switch@sh#1#2{%
- \ifx#2\@nnil\else
- \bbl@ifunset{bbl@active@\string#2}%
- {\bbl@error
- {I can't switch '\string#2' on or off--not a shorthand}%
- {This character is not a shorthand. Maybe you made\\%
- a typing mistake? I will ignore your instruction.}}%
- {\ifcase#1% off, on, off*
- \catcode`#212\relax
- \or
- \catcode`#2\active
- \bbl@ifunset{bbl@shdef@\string#2}%
- {}%
- {\bbl@withactive{\expandafter\let\expandafter}#2%
- \csname bbl@shdef@\string#2\endcsname
- \bbl@csarg\let{shdef@\string#2}\relax}%
- \ifcase\bbl@activated\or
- \bbl@activate{#2}%
- \else
- \bbl@deactivate{#2}%
- \fi
- \or
- \bbl@ifunset{bbl@shdef@\string#2}%
- {\bbl@withactive{\bbl@csarg\let{shdef@\string#2}}#2}%
- {}%
- \csname bbl@oricat@\string#2\endcsname
- \csname bbl@oridef@\string#2\endcsname
- \fi}%
- \bbl@afterfi\bbl@switch@sh#1%
- \fi}
-\def\babelshorthand{\active@prefix\babelshorthand\bbl@putsh}
-\def\bbl@putsh#1{%
- \bbl@ifunset{bbl@active@\string#1}%
- {\bbl@putsh@i#1\@empty\@nnil}%
- {\csname bbl@active@\string#1\endcsname}}
-\def\bbl@putsh@i#1#2\@nnil{%
- \csname\language@group @sh@\string#1@%
- \ifx\@empty#2\else\string#2@\fi\endcsname}
-\ifx\bbl@opt@shorthands\@nnil\else
- \let\bbl@s@initiate@active@char\initiate@active@char
- \def\initiate@active@char#1{%
- \bbl@ifshorthand{#1}{\bbl@s@initiate@active@char{#1}}{}}
- \let\bbl@s@switch@sh\bbl@switch@sh
- \def\bbl@switch@sh#1#2{%
- \ifx#2\@nnil\else
- \bbl@afterfi
- \bbl@ifshorthand{#2}{\bbl@s@switch@sh#1{#2}}{\bbl@switch@sh#1}%
- \fi}
- \let\bbl@s@activate\bbl@activate
- \def\bbl@activate#1{%
- \bbl@ifshorthand{#1}{\bbl@s@activate{#1}}{}}
- \let\bbl@s@deactivate\bbl@deactivate
- \def\bbl@deactivate#1{%
- \bbl@ifshorthand{#1}{\bbl@s@deactivate{#1}}{}}
-\fi
-\newcommand\ifbabelshorthand[3]{\bbl@ifunset{bbl@active@\string#1}{#3}{#2}}
-\def\bbl@prim@s{%
- \prime\futurelet\@let@token\bbl@pr@m@s}
-\def\bbl@if@primes#1#2{%
- \ifx#1\@let@token
- \expandafter\@firstoftwo
- \else\ifx#2\@let@token
- \bbl@afterelse\expandafter\@firstoftwo
- \else
- \bbl@afterfi\expandafter\@secondoftwo
- \fi\fi}
-\begingroup
- \catcode`\^=7 \catcode`\*=\active \lccode`\*=`\^
- \catcode`\'=12 \catcode`\"=\active \lccode`\"=`\'
- \lowercase{%
- \gdef\bbl@pr@m@s{%
- \bbl@if@primes"'%
- \pr@@@s
- {\bbl@if@primes*^\pr@@@t\egroup}}}
-\endgroup
-\initiate@active@char{~}
-\declare@shorthand{system}{~}{\leavevmode\nobreak\ }
-\bbl@activate{~}
-%
-% ------------------------------------------------------------------------------
-%
-% lines 1863 to 1900 from babel.def
-%
-% ------------------------------------------------------------------------------
-%
-\def\bbl@allowhyphens{\ifvmode\else\nobreak\hskip\z@skip\fi}
-\def\bbl@t@one{T1}
-\def\allowhyphens{\ifx\cf@encoding\bbl@t@one\else\bbl@allowhyphens\fi}
-\newcommand\babelnullhyphen{\char\hyphenchar\font}
-\def\babelhyphen{\active@prefix\babelhyphen\bbl@hyphen}
-\def\bbl@hyphen{%
- \@ifstar{\bbl@hyphen@i @}{\bbl@hyphen@i\@empty}}
-\def\bbl@hyphen@i#1#2{%
- \bbl@ifunset{bbl@hy@#1#2\@empty}%
- {\csname bbl@#1usehyphen\endcsname{\discretionary{#2}{}{#2}}}%
- {\csname bbl@hy@#1#2\@empty\endcsname}}
-\def\bbl@usehyphen#1{%
- \leavevmode
- \ifdim\lastskip>\z@\mbox{#1}\else\nobreak#1\fi
- \nobreak\hskip\z@skip}
-\def\bbl@@usehyphen#1{%
- \leavevmode\ifdim\lastskip>\z@\mbox{#1}\else#1\fi}
-\def\bbl@hyphenchar{%
- \ifnum\hyphenchar\font=\m@ne
- \babelnullhyphen
- \else
- \char\hyphenchar\font
- \fi}
-\def\bbl@hy@soft{\bbl@usehyphen{\discretionary{\bbl@hyphenchar}{}{}}}
-\def\bbl@hy@@soft{\bbl@@usehyphen{\discretionary{\bbl@hyphenchar}{}{}}}
-\def\bbl@hy@hard{\bbl@usehyphen\bbl@hyphenchar}
-\def\bbl@hy@@hard{\bbl@@usehyphen\bbl@hyphenchar}
-\def\bbl@hy@nobreak{\bbl@usehyphen{\mbox{\bbl@hyphenchar}}}
-\def\bbl@hy@@nobreak{\mbox{\bbl@hyphenchar}}
-\def\bbl@hy@repeat{%
- \bbl@usehyphen{%
- \discretionary{\bbl@hyphenchar}{\bbl@hyphenchar}{\bbl@hyphenchar}}}
-\def\bbl@hy@@repeat{%
- \bbl@@usehyphen{%
- \discretionary{\bbl@hyphenchar}{\bbl@hyphenchar}{\bbl@hyphenchar}}}
-\def\bbl@hy@empty{\hskip\z@skip}
-\def\bbl@hy@@empty{\discretionary{}{}{}}
-\def\bbl@disc#1#2{\nobreak\discretionary{#2-}{}{#1}\bbl@allowhyphens}
-%
-% ------------------------------------------------------------------------------
-%
-% end of the code copied from babel files
-%
-% ------------------------------------------------------------------------------
-%
-\def\bbl@disc@german#1#2{%
- \nobreak\discretionary{#2-}{}{#1}}
-% \end{macrocode}
-% \iffalse
-%</babelsh.def>
-%<*cal-util.def>
-% \fi
-% \clearpage
-%
-% \subsection{cal-util.def}
-% \begin{macrocode}
-%%%%%%%%%%%%% cal-util.def %%%%%%%%%%%%%%%%
-% Macros shared by hijrical and hebrewcal %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% the following is adapted from hebcal.sty in babel
-\def\@Remainder#1#2#3{%
- #3 = #1% % c = a
- \divide #3 by #2% % c = a/b
- \multiply #3 by -#2% % c = -b(a/b)
- \advance #3 by #1}% % c = a - b(a/b)
-\newif\if@Divisible
-\def\@CheckIfDivisible#1#2{%
- {%
- \countdef\tmpx=0% % temporary variable
- \@Remainder{#1}{#2}{\tmpx}%
- \ifnum\tmpx=0%
- \global\@Divisibletrue%
- \else%
- \global\@Divisiblefalse%
- \fi}}
-\newif\if@GregorianLeap
-\def\@CheckIfGregorianLeap#1{%
- {%
- \@CheckIfDivisible{#1}{4}%
- \if@Divisible%
- \@CheckIfDivisible{#1}{100}%
- \if@Divisible%
- \@CheckIfDivisible{#1}{400}%
- \if@Divisible%
- \global\@GregorianLeaptrue%
- \else%
- \global\@GregorianLeapfalse%
- \fi%
- \else%
- \global\@GregorianLeaptrue%
- \fi%
- \else%
- \global\@GregorianLeapfalse%
- \fi%
- }}
-%%
-
-\newcounter{tmpA}\newcounter{tmpB}
-\newcounter{tmpC}\newcounter{tmpD}
-\newcounter{tmpE}\newcounter{tmpF}
-
-
-%% This is an algorithm from Reingold & Dershowitz,
-%% Calendrical Calculations, The Millenium Edition
-%%
-\def\@FixedFromGregorian#1#2#3#4{%
- \setcounter{tmpA}{(#1-1)*365}%
- \setcounter{tmpB}{(#1-1)/4}%
- \setcounter{tmpC}{(#1-1)/100}%
- \setcounter{tmpD}{(#1-1)/400}%
- \setcounter{tmpE}{(367*#2-362)/12}%
- \ifnum#2<3%
- \setcounter{tmpF}{0}%
- \else%
- \@CheckIfGregorianLeap{#1}%
- \if@GregorianLeap%
- \setcounter{tmpF}{-1}%
- \else%
- \setcounter{tmpF}{-2}%
- \fi%
- \fi%
- \@ifundefined{c@#4}{\global\newcounter{#4}}{}%
- \setcounter{#4}{\value{tmpA}+\value{tmpB}-\value{tmpC}+\value{tmpD}+\value{tmpE}+\value{tmpF}+#3}%
-}
-% \end{macrocode}
-% \iffalse
-%</cal-util.def>
-%<*xgreek-fixes.def>
-% \fi
-% \clearpage
-%
-% \subsection{xgreek-fixes.def}
-% \begin{macrocode}
-% the following fixes are taken verbatim from xgreek.sty:
-% \message{Package `xgreek' version 3.0.1 by Apostolos Syropoulos}
-\global\lccode"0370="0371 \global\uccode"0370="0370
-\global\lccode"0371="0371 \global\uccode"0371="0370
-\global\lccode"0372="0373 \global\uccode"0372="0372
-\global\lccode"0373="0373 \global\uccode"0373="0372
-\global\lccode"0376="0377 \global\uccode"0376="0376
-\global\lccode"0377="0377 \global\uccode"0377="0376
-\global\lccode"03FD="037B \global\uccode"03FD="03FD
-\global\lccode"037B="037B \global\uccode"037B="03FD
-\global\lccode"03FE="037C \global\uccode"03FE="03FE
-\global\lccode"037C="037C \global\uccode"037C="03FE
-\global\lccode"03FF="037D \global\uccode"03FF="03FF
-\global\lccode"037D="037D \global\uccode"037D="03FF
-\global\lccode"0386="03AC \global\uccode"0386="0391
-\global\lccode"0388="03AD \global\uccode"0388="0395
-\global\lccode"0389="03AC \global\uccode"0389="0397
-\global\lccode"038A="03AF \global\uccode"038A="0399
-\global\lccode"038C="03CC \global\uccode"038C="039F
-\global\lccode"038E="03CD \global\uccode"038E="03A5
-\global\lccode"038F="03CE \global\uccode"038F="03A9
-\global\lccode"0390="0390 \global\uccode"0390="03AA
-\global\lccode"0391="03B1 \global\uccode"0391="0391
-\global\lccode"0392="03B2 \global\uccode"0392="0392
-\global\lccode"0393="03B3 \global\uccode"0393="0393
-\global\lccode"0394="03B4 \global\uccode"0394="0394
-\global\lccode"0395="03B5 \global\uccode"0395="0395
-\global\lccode"0396="03B6 \global\uccode"0396="0396
-\global\lccode"0397="03B7 \global\uccode"0397="0397
-\global\lccode"0398="03B8 \global\uccode"0398="0398
-\global\lccode"0399="03B9 \global\uccode"0399="0399
-\global\lccode"039A="03BA \global\uccode"039A="039A
-\global\lccode"039B="03BB \global\uccode"039B="039B
-\global\lccode"039C="03BC \global\uccode"039C="039C
-\global\lccode"039D="03BD \global\uccode"039D="039D
-\global\lccode"039E="03BE \global\uccode"039E="039E
-\global\lccode"039F="03BF \global\uccode"039F="039F
-\global\lccode"03A0="03C0 \global\uccode"03A0="03A0
-\global\lccode"03A1="03C1 \global\uccode"03A1="03A1
-\global\lccode"03A3="03C3 \global\uccode"03A3="03A3
-\global\lccode"03A4="03C4 \global\uccode"03A4="03A4
-\global\lccode"03A5="03C5 \global\uccode"03A5="03A5
-\global\lccode"03A6="03C6 \global\uccode"03A6="03A6
-\global\lccode"03A7="03C7 \global\uccode"03A7="03A7
-\global\lccode"03A8="03C8 \global\uccode"03A8="03A8
-\global\lccode"03A9="03C9 \global\uccode"03A9="03A9
-\global\lccode"03AA="03CA \global\uccode"03AA="03AA
-\global\lccode"03AB="03CB \global\uccode"03AB="03AB
-\global\lccode"03AC="03AC \global\uccode"03AC="0391
-\global\lccode"03AD="03AD \global\uccode"03AD="0395
-\global\lccode"03AE="03AE \global\uccode"03AE="0397
-\global\lccode"03AF="03AF \global\uccode"03AF="0399
-\global\lccode"03B0="03B0 \global\uccode"03B0="03AB
-\global\lccode"03B1="03B1 \global\uccode"03B1="0391
-\global\lccode"03B2="03B2 \global\uccode"03B2="0392
-\global\lccode"03B3="03B3 \global\uccode"03B3="0393
-\global\lccode"03B4="03B4 \global\uccode"03B4="0394
-\global\lccode"03B5="03B5 \global\uccode"03B5="0395
-\global\lccode"03B6="03B6 \global\uccode"03B6="0396
-\global\lccode"03B7="03B7 \global\uccode"03B7="0397
-\global\lccode"03B8="03B8 \global\uccode"03B8="0398
-\global\lccode"03B9="03B9 \global\uccode"03B9="0399
-\global\lccode"03BA="03BA \global\uccode"03BA="039A
-\global\lccode"03BB="03BB \global\uccode"03BB="039B
-\global\lccode"03BC="03BC \global\uccode"03BC="039C
-\global\lccode"03BD="03BD \global\uccode"03BD="039D
-\global\lccode"03BE="03BE \global\uccode"03BE="039E
-\global\lccode"03BF="03BF \global\uccode"03BF="039F
-\global\lccode"03C0="03C0 \global\uccode"03C0="03A0
-\global\lccode"03C1="03C1 \global\uccode"03C1="03A1
-\global\lccode"03C2="03C2 \global\uccode"03C2="03A3
-\global\lccode"03C3="03C3 \global\uccode"03C3="03A3
-\global\lccode"03C4="03C4 \global\uccode"03C4="03A4
-\global\lccode"03C5="03C5 \global\uccode"03C5="03A5
-\global\lccode"03C6="03C6 \global\uccode"03C6="03A6
-\global\lccode"03C7="03C7 \global\uccode"03C7="03A7
-\global\lccode"03C8="03C8 \global\uccode"03C8="03A8
-\global\lccode"03C9="03C9 \global\uccode"03C9="03A9
-\global\lccode"03CA="03CA \global\uccode"03CA="03AA
-\global\lccode"03CB="03CB \global\uccode"03CB="03AB
-\global\lccode"03CC="03CC \global\uccode"03CC="039F
-\global\lccode"03CD="03CD \global\uccode"03CD="03A5
-\global\lccode"03CE="03CE \global\uccode"03CE="03A9
-\global\lccode"03D0="03D0 \global\uccode"03D0="0392
-\global\lccode"03D1="03D1 \global\uccode"03D1="0398
-\global\lccode"03D2="03C5 \global\uccode"03D2="03A5
-\global\lccode"03D3="03CD \global\uccode"03D3="03A5
-\global\lccode"03D4="03CB \global\uccode"03D4="03AB
-\global\lccode"03D5="03C6 \global\uccode"03D5="03A6
-\global\lccode"03D6="03C0 \global\uccode"03D6="03A0
-\global\lccode"03DA="03DB \global\uccode"03DA="03DA
-\global\lccode"03DB="03DB \global\uccode"03DB="03DA
-\global\lccode"03DC="03DD \global\uccode"03DC="03DC
-\global\lccode"03DD="03DD \global\uccode"03DD="03DC
-\global\lccode"03DE="03DF \global\uccode"03DE="03DE
-\global\lccode"03DF="03DF \global\uccode"03DF="03DE
-\global\lccode"03E0="03E1 \global\uccode"03E0="03E0
-\global\lccode"03E1="03E1 \global\uccode"03E1="03E0
-\global\lccode"03F0="03BA \global\uccode"03F0="039A
-\global\lccode"03F1="03C1 \global\uccode"03F1="03A1
-\global\lccode"03F2="03F2 \global\uccode"03F2="03F9
-\global\lccode"03F9="03F2 \global\uccode"03F9="03F9
-\global\lccode"1F00="1F00 \global\uccode"1F00="0391
-\global\lccode"1F01="1F01 \global\uccode"1F01="0391
-\global\lccode"1F02="1F02 \global\uccode"1F02="0391
-\global\lccode"1F03="1F03 \global\uccode"1F03="0391
-\global\lccode"1F04="1F04 \global\uccode"1F04="0391
-\global\lccode"1F05="1F05 \global\uccode"1F05="0391
-\global\lccode"1F06="1F06 \global\uccode"1F06="0391
-\global\lccode"1F07="1F07 \global\uccode"1F07="0391
-\global\lccode"1F08="1F00 \global\uccode"1F08="0391
-\global\lccode"1F09="1F01 \global\uccode"1F09="0391
-\global\lccode"1F0A="1F02 \global\uccode"1F0A="0391
-\global\lccode"1F0B="1F03 \global\uccode"1F0B="0391
-\global\lccode"1F0C="1F04 \global\uccode"1F0C="0391
-\global\lccode"1F0D="1F05 \global\uccode"1F0D="0391
-\global\lccode"1F0E="1F06 \global\uccode"1F0E="0391
-\global\lccode"1F0F="1F07 \global\uccode"1F0F="0391
-\global\lccode"1F10="1F10 \global\uccode"1F10="0395
-\global\lccode"1F11="1F11 \global\uccode"1F11="0395
-\global\lccode"1F12="1F12 \global\uccode"1F12="0395
-\global\lccode"1F13="1F13 \global\uccode"1F13="0395
-\global\lccode"1F14="1F14 \global\uccode"1F14="0395
-\global\lccode"1F15="1F15 \global\uccode"1F15="0395
-\global\lccode"1F18="1F10 \global\uccode"1F18="0395
-\global\lccode"1F19="1F11 \global\uccode"1F19="0395
-\global\lccode"1F1A="1F12 \global\uccode"1F1A="0395
-\global\lccode"1F1B="1F13 \global\uccode"1F1B="0395
-\global\lccode"1F1C="1F14 \global\uccode"1F1C="0395
-\global\lccode"1F1D="1F15 \global\uccode"1F1D="0395
-\global\lccode"1F20="1F20 \global\uccode"1F20="0397
-\global\lccode"1F21="1F21 \global\uccode"1F21="0397
-\global\lccode"1F22="1F22 \global\uccode"1F22="0397
-\global\lccode"1F23="1F23 \global\uccode"1F23="0397
-\global\lccode"1F24="1F24 \global\uccode"1F24="0397
-\global\lccode"1F25="1F25 \global\uccode"1F25="0397
-\global\lccode"1F26="1F26 \global\uccode"1F26="0397
-\global\lccode"1F27="1F27 \global\uccode"1F27="0397
-\global\lccode"1F28="1F20 \global\uccode"1F28="0397
-\global\lccode"1F29="1F21 \global\uccode"1F29="0397
-\global\lccode"1F2A="1F22 \global\uccode"1F2A="0397
-\global\lccode"1F2B="1F23 \global\uccode"1F2B="0397
-\global\lccode"1F2C="1F24 \global\uccode"1F2C="0397
-\global\lccode"1F2D="1F25 \global\uccode"1F2D="0397
-\global\lccode"1F2E="1F26 \global\uccode"1F2E="0397
-\global\lccode"1F2F="1F27 \global\uccode"1F2F="0397
-\global\lccode"1F30="1F30 \global\uccode"1F30="0399
-\global\lccode"1F31="1F31 \global\uccode"1F31="0399
-\global\lccode"1F32="1F32 \global\uccode"1F32="0399
-\global\lccode"1F33="1F33 \global\uccode"1F33="0399
-\global\lccode"1F34="1F34 \global\uccode"1F34="0399
-\global\lccode"1F35="1F35 \global\uccode"1F35="0399
-\global\lccode"1F36="1F36 \global\uccode"1F36="0399
-\global\lccode"1F37="1F37 \global\uccode"1F37="0399
-\global\lccode"1F38="1F30 \global\uccode"1F38="0399
-\global\lccode"1F39="1F31 \global\uccode"1F39="0399
-\global\lccode"1F3A="1F32 \global\uccode"1F3A="0399
-\global\lccode"1F3B="1F33 \global\uccode"1F3B="0399
-\global\lccode"1F3C="1F34 \global\uccode"1F3C="0399
-\global\lccode"1F3D="1F35 \global\uccode"1F3D="0399
-\global\lccode"1F3E="1F36 \global\uccode"1F3E="0399
-\global\lccode"1F3F="1F37 \global\uccode"1F3F="0399
-\global\lccode"1F40="1F40 \global\uccode"1F40="039F
-\global\lccode"1F41="1F41 \global\uccode"1F41="039F
-\global\lccode"1F42="1F42 \global\uccode"1F42="039F
-\global\lccode"1F43="1F43 \global\uccode"1F43="039F
-\global\lccode"1F44="1F44 \global\uccode"1F44="039F
-\global\lccode"1F45="1F45 \global\uccode"1F45="039F
-\global\lccode"1F48="1F40 \global\uccode"1F48="039F
-\global\lccode"1F49="1F41 \global\uccode"1F49="039F
-\global\lccode"1F4A="1F42 \global\uccode"1F4A="039F
-\global\lccode"1F4B="1F43 \global\uccode"1F4B="039F
-\global\lccode"1F4C="1F44 \global\uccode"1F4C="039F
-\global\lccode"1F4D="1F45 \global\uccode"1F4D="039F
-\global\lccode"1F50="1F50 \global\uccode"1F50="03A5
-\global\lccode"1F51="1F51 \global\uccode"1F51="03A5
-\global\lccode"1F52="1F52 \global\uccode"1F52="03A5
-\global\lccode"1F53="1F53 \global\uccode"1F53="03A5
-\global\lccode"1F54="1F54 \global\uccode"1F54="03A5
-\global\lccode"1F55="1F55 \global\uccode"1F55="03A5
-\global\lccode"1F56="1F56 \global\uccode"1F56="03A5
-\global\lccode"1F57="1F57 \global\uccode"1F57="03A5
-\global\lccode"1F59="1F51 \global\uccode"1F59="03A5
-\global\lccode"1F5B="1F53 \global\uccode"1F5B="03A5
-\global\lccode"1F5D="1F55 \global\uccode"1F5D="03A5
-\global\lccode"1F5F="1F57 \global\uccode"1F5F="03A5
-\global\lccode"1F60="1F60 \global\uccode"1F60="03A9
-\global\lccode"1F61="1F61 \global\uccode"1F61="03A9
-\global\lccode"1F62="1F62 \global\uccode"1F62="03A9
-\global\lccode"1F63="1F63 \global\uccode"1F63="03A9
-\global\lccode"1F64="1F64 \global\uccode"1F64="03A9
-\global\lccode"1F65="1F65 \global\uccode"1F65="03A9
-\global\lccode"1F66="1F66 \global\uccode"1F66="03A9
-\global\lccode"1F67="1F67 \global\uccode"1F67="03A9
-\global\lccode"1F68="1F60 \global\uccode"1F68="03A9
-\global\lccode"1F69="1F61 \global\uccode"1F69="03A9
-\global\lccode"1F6A="1F62 \global\uccode"1F6A="03A9
-\global\lccode"1F6B="1F63 \global\uccode"1F6B="03A9
-\global\lccode"1F6C="1F64 \global\uccode"1F6C="03A9
-\global\lccode"1F6D="1F65 \global\uccode"1F6D="03A9
-\global\lccode"1F6E="1F66 \global\uccode"1F6E="03A9
-\global\lccode"1F6F="1F67 \global\uccode"1F6F="03A9
-\global\lccode"1F70="1F70 \global\uccode"1F70="0391
-\global\lccode"1F71="1F71 \global\uccode"1F71="0391
-\global\lccode"1F72="1F72 \global\uccode"1F72="0395
-\global\lccode"1F73="1F73 \global\uccode"1F73="0395
-\global\lccode"1F74="1F74 \global\uccode"1F74="0397
-\global\lccode"1F75="1F75 \global\uccode"1F75="0397
-\global\lccode"1F76="1F76 \global\uccode"1F76="0399
-\global\lccode"1F77="1F77 \global\uccode"1F77="0399
-\global\lccode"1F78="1F78 \global\uccode"1F78="039F
-\global\lccode"1F79="1F79 \global\uccode"1F79="039F
-\global\lccode"1F7A="1F7A \global\uccode"1F7A="03A5
-\global\lccode"1F7B="1F7B \global\uccode"1F7B="03A5
-\global\lccode"1F7C="1F7C \global\uccode"1F7C="03A9
-\global\lccode"1F7D="1F7D \global\uccode"1F7D="03A9
-\global\lccode"1F80="1F80 \global\uccode"1F80="1FBC
-\global\lccode"1F81="1F81 \global\uccode"1F81="1FBC
-\global\lccode"1F82="1F82 \global\uccode"1F82="1FBC
-\global\lccode"1F83="1F83 \global\uccode"1F83="1FBC
-\global\lccode"1F84="1F84 \global\uccode"1F84="1FBC
-\global\lccode"1F85="1F85 \global\uccode"1F85="1FBC
-\global\lccode"1F86="1F86 \global\uccode"1F86="1FBC
-\global\lccode"1F87="1F87 \global\uccode"1F87="1FBC
-\global\lccode"1F88="1F80 \global\uccode"1F88="1FBC
-\global\lccode"1F89="1F81 \global\uccode"1F89="1FBC
-\global\lccode"1F8A="1F82 \global\uccode"1F8A="1FBC
-\global\lccode"1F8B="1F83 \global\uccode"1F8B="1FBC
-\global\lccode"1F8C="1F84 \global\uccode"1F8C="1FBC
-\global\lccode"1F8D="1F85 \global\uccode"1F8D="1FBC
-\global\lccode"1F8E="1F86 \global\uccode"1F8E="1FBC
-\global\lccode"1F8F="1F87 \global\uccode"1F8F="1FBC
-\global\lccode"1F90="1F90 \global\uccode"1F90="1FCC
-\global\lccode"1F91="1F91 \global\uccode"1F91="1FCC
-\global\lccode"1F92="1F92 \global\uccode"1F92="1FCC
-\global\lccode"1F93="1F93 \global\uccode"1F93="1FCC
-\global\lccode"1F94="1F94 \global\uccode"1F94="1FCC
-\global\lccode"1F95="1F95 \global\uccode"1F95="1FCC
-\global\lccode"1F96="1F96 \global\uccode"1F96="1FCC
-\global\lccode"1F97="1F97 \global\uccode"1F97="1FCC
-\global\lccode"1F98="1F90 \global\uccode"1F98="1FCC
-\global\lccode"1F99="1F91 \global\uccode"1F99="1FCC
-\global\lccode"1F9A="1F92 \global\uccode"1F9A="1FCC
-\global\lccode"1F9B="1F93 \global\uccode"1F9B="1FCC
-\global\lccode"1F9C="1F94 \global\uccode"1F9C="1FCC
-\global\lccode"1F9D="1F95 \global\uccode"1F9D="1FCC
-\global\lccode"1F9E="1F96 \global\uccode"1F9E="1FCC
-\global\lccode"1F9F="1F97 \global\uccode"1F9F="1FCC
-\global\lccode"1FA0="1FA0 \global\uccode"1FA0="1FFC
-\global\lccode"1FA1="1FA1 \global\uccode"1FA1="1FFC
-\global\lccode"1FA2="1FA2 \global\uccode"1FA2="1FFC
-\global\lccode"1FA3="1FA3 \global\uccode"1FA3="1FFC
-\global\lccode"1FA4="1FA4 \global\uccode"1FA4="1FFC
-\global\lccode"1FA5="1FA5 \global\uccode"1FA5="1FFC
-\global\lccode"1FA6="1FA6 \global\uccode"1FA6="1FFC
-\global\lccode"1FA7="1FA7 \global\uccode"1FA7="1FFC
-\global\lccode"1FA8="1FA0 \global\uccode"1FA8="1FFC
-\global\lccode"1FA9="1FA1 \global\uccode"1FA9="1FFC
-\global\lccode"1FAA="1FA2 \global\uccode"1FAA="1FFC
-\global\lccode"1FAB="1FA3 \global\uccode"1FAB="1FFC
-\global\lccode"1FAC="1FA4 \global\uccode"1FAC="1FFC
-\global\lccode"1FAD="1FA5 \global\uccode"1FAD="1FFC
-\global\lccode"1FAE="1FA6 \global\uccode"1FAE="1FFC
-\global\lccode"1FAF="1FA7 \global\uccode"1FAF="1FFC
-\global\lccode"1FB0="1FB0 \global\uccode"1FB0="1FB8
-\global\lccode"1FB1="1FB1 \global\uccode"1FB1="1FB9
-\global\lccode"1FB2="1FB2 \global\uccode"1FB2="1FBC
-\global\lccode"1FB3="1FB3 \global\uccode"1FB3="1FBC
-\global\lccode"1FB4="1FB4 \global\uccode"1FB4="1FBC
-\global\lccode"1FB6="1FB6 \global\uccode"1FB6="0391
-\global\lccode"1FB7="1FB7 \global\uccode"1FB7="1FBC
-\global\lccode"1FB8="1FB0 \global\uccode"1FB8="1FB8
-\global\lccode"1FB9="1FB1 \global\uccode"1FB9="1FB9
-\global\lccode"1FBA="1F70 \global\uccode"1FBA="0391
-\global\lccode"1FBB="1F71 \global\uccode"1FBB="0391
-\global\lccode"1FBC="1FB3 \global\uccode"1FBC="1FBC
-\global\lccode"1FBD="1FBD \global\uccode"1FBD="1FBD
-\global\lccode"1FC2="1FC2 \global\uccode"1FC2="1FCC
-\global\lccode"1FC3="1FC3 \global\uccode"1FC3="1FCC
-\global\lccode"1FC4="1FC4 \global\uccode"1FC4="1FCC
-\global\lccode"1FC6="1FC6 \global\uccode"1FC6="0397
-\global\lccode"1FC7="1FC7 \global\uccode"1FC7="1FCC
-\global\lccode"1FC8="1F72 \global\uccode"1FC8="0395
-\global\lccode"1FC9="1F73 \global\uccode"1FC9="0395
-\global\lccode"1FCA="1F74 \global\uccode"1FCA="0397
-\global\lccode"1FCB="1F75 \global\uccode"1FCB="0397
-\global\lccode"1FCC="1FC3 \global\uccode"1FCC="1FCC
-\global\lccode"1FD0="1FD0 \global\uccode"1FD0="1FD8
-\global\lccode"1FD1="1FD1 \global\uccode"1FD1="1FD9
-\global\lccode"1FD2="1FD2 \global\uccode"1FD2="03AA
-\global\lccode"1FD3="1FD3 \global\uccode"1FD3="03AA
-\global\lccode"1FD6="1FD6 \global\uccode"1FD6="0399
-\global\lccode"1FD7="1FD7 \global\uccode"1FD7="03AA
-\global\lccode"1FD8="1FD0 \global\uccode"1FD8="1FD8
-\global\lccode"1FD9="1FD1 \global\uccode"1FD9="1FD9
-\global\lccode"1FDA="1F76 \global\uccode"1FDA="0399
-\global\lccode"1FDB="1F77 \global\uccode"1FDB="0399
-\global\lccode"1FE0="1FE0 \global\uccode"1FE0="1FE8
-\global\lccode"1FE1="1FE1 \global\uccode"1FE1="1FE9
-\global\lccode"1FE2="1FE2 \global\uccode"1FE2="03AB
-\global\lccode"1FE3="1FE3 \global\uccode"1FE3="03AB
-\global\lccode"1FE4="1FE4 \global\uccode"1FE4="03A1
-\global\lccode"1FE5="1FE5 \global\uccode"1FE5="03A1
-\global\lccode"1FE6="1FE6 \global\uccode"1FE6="03A5
-\global\lccode"1FE7="1FE7 \global\uccode"1FE7="03AB
-\global\lccode"1FE8="1FE0 \global\uccode"1FE8="1FE8
-\global\lccode"1FE9="1FE1 \global\uccode"1FE9="1FE9
-\global\lccode"1FEA="1F7A \global\uccode"1FEA="03A5
-\global\lccode"1FEB="1F7B \global\uccode"1FEB="03A5
-\global\lccode"1FEC="1FE5 \global\uccode"1FEC="1FEC
-\global\lccode"1FF2="1FF2 \global\uccode"1FF2="1FFC
-\global\lccode"1FF3="1FF3 \global\uccode"1FF3="1FFC
-\global\lccode"1FF4="1FF4 \global\uccode"1FF4="1FFC
-\global\lccode"1FF6="1FF6 \global\uccode"1FF6="03A9
-\global\lccode"1FF7="1FF7 \global\uccode"1FF7="1FFC
-\global\lccode"1FF8="1F78 \global\uccode"1FF8="039F
-\global\lccode"1FF9="1F79 \global\uccode"1FF9="039F
-\global\lccode"1FFA="1F7C \global\uccode"1FFA="03A9
-\global\lccode"1FFB="1F7D \global\uccode"1FFB="03A9
-\global\lccode"1FFC="1FF3 \global\uccode"1FFC="1FFC
-% \end{macrocode}
-% \iffalse
-%</xgreek-fixes.def>
-%<*gloss-acadien.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-acadien.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-acadien.ldf}[polyglossia: module for Canadian (Acadian) French]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{french}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-acadien.ldf>
-%<*gloss-aeb.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-aeb.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-aeb.ldf}[polyglossia: module for aeb (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{arabic}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-aeb.ldf>
-%<*gloss-af.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-af.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-af.ldf}[polyglossia: module for af (Afrikaans)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{afrikaans}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-af.ldf>
-%<*gloss-afb.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-afb.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-afb.ldf}[polyglossia: module for afb (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{arabic}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-afb.ldf>
-%<*gloss-afrikaans.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-afrikaans.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-afrikaans.ldf}[polyglossia: module for Afrikaans]
-
-\PolyglossiaSetup{afrikaans}{
- bcp47=af,
- bcp47-language=af,
- bcp47-script=Latn,
- hyphennames={afrikaans,dutch},
- hyphenmins={2,2},
- langtag=AFK,
- frenchspacing=true,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{afrikaans}{af}
-
-\define@boolkey{afrikaans}[afrikaans@]{babelshorthands}[true]{}
-
-% Register default options
-\xpg@initialize@gloss@options{afrikaans}{babelshorthands=false}
-
-\ifsystem@babelshorthands
- \setkeys{afrikaans}{babelshorthands=true}
-\else
- \setkeys{afrikaans}{babelshorthands=false}
-\fi
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
-
-\def\afrikaans@shorthands{%
- \xpg@activate@shorthands%
- \def\language@group{afrikaans}%
- \declare@shorthand{afrikaans}{"-}{\nobreak-\bbl@allowhyphens}
- \declare@shorthand{afrikaans}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
- \declare@shorthand{afrikaans}{"|}{%
- \textormath{\discretionary{-}{}{\kern.03em}}{}}
- \declare@shorthand{afrikaans}{""}{\hskip\z@skip}
- \declare@shorthand{afrikaans}{"/}{\textormath
- {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}%
- \def\-{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}%
-}
-
-\def\noafrikaans@shorthands{%
- \xpg@deactivate@shorthands%
-}
-
-\def\captionsafrikaans{%
- \def\prefacename{Voorwoord}%
- \def\refname{Verwysings}%
- \def\abstractname{Samevatting}%
- \def\bibname{Bibliografie}%
- \def\chaptername{Hoofstuk}%
- \def\appendixname{Bylae}%
- \def\contentsname{Inhoudsopgawe}%
- \def\listfigurename{Lys van figure}%
- \def\listtablename{Lys van tabelle}%
- \def\indexname{Inhoud}%
- \def\figurename{Figuur}%
- \def\tablename{Tabel}%
- \def\partname{Deel}%
- \def\enclname{Bylae(n)}%
- \def\ccname{a.\,a.}%
- \def\headtoname{Aan}%
- \def\pagename{Bladsy}%
- \def\seename{sien}%
- \def\alsoname{sien ook}%
- \def\proofname{Bewys}%
-% \def\glossaryname{}%
-}
-
-\def\dateafrikaans{%
- \def\today{\number\day~\ifcase\month\or
- Januarie\or Februarie\or Maart\or April\or Mei\or Junie\or
- Julie\or Augustus\or September\or Oktober\or November\or
- Desember\fi
- \space \number\year}%
-}
-
-\def\noextras@afrikaans{%
- \ifafrikaans@babelshorthands\noafrikaans@shorthands\fi%
-}
-
-\def\blockextras@afrikaans{%
- \ifafrikaans@babelshorthands\afrikaans@shorthands\else\noafrikaans@shorthands\fi%
-}
-
-\def\inlineextras@afrikaans{%
- \ifafrikaans@babelshorthands\afrikaans@shorthands\else\noafrikaans@shorthands\fi%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-afrikaans.ldf>
-%<*gloss-albanian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-albanian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-albanian.ldf}[polyglossia: module for Albanian]
-
-\PolyglossiaSetup{albanian}{
- bcp47=sq,
- bcp47-language=sq,
- bcp47-script=Latn,
- hyphennames={albanian},
- langtag=SQI,
- hyphenmins={2,2},
- indentfirst=true,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{albanian}{sq}
-
-\def\captionsalbanian{%
- \def\refname{Referencat}%
- \def\abstractname{Përmbledhja}%
- \def\bibname{Bibliografia}%
- \def\prefacename{Parathenia}%
- \def\chaptername{Kapitulli}%
- \def\appendixname{Shtesa}%
- \def\contentsname{Përmbajtja}%
- \def\listfigurename{Figurat}%
- \def\listtablename{Tabelat}%
- \def\indexname{Indeksi}%
- \def\figurename{Figura}%
- \def\tablename{Tabela}%
- %\def\thepart{}%
- \def\partname{Pjesa}%
- \def\pagename{Faqe}%
- \def\seename{shiko}%
- \def\alsoname{shiko dhe}%
- %\def\enclname{}%
- %\def\ccname{}%
- %\def\headtoname{}%
- \def\proofname{Vërtetim}%
- \def\glossaryname{Përhasja e Fjalëve}%
- }
-\def\datealbanian{%
- \def\today{{\number\day~\ifcase\month\or
- Janar\or Shkurt\or Mars\or Prill\or Maj\or
- Qershor\or Korrik\or Gusht\or Shtator\or Tetor\or Nëntor\or
- Dhjetor\fi \space \number\year}}}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-albanian.ldf>
-%<*gloss-am.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-am.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-am.ldf}[polyglossia: module for am (Amharic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{amharic}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-am.ldf>
-%<*gloss-american.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-american.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-american.ldf}[polyglossia: module for American English]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{english}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-american.ldf>
-%<*gloss-amharic.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-amharic.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-amharic.ldf}[polyglossia: module for Amharic]
-\PolyglossiaSetup{amharic}{
- bcp47=am,
- bcp47-language=am,
- bcp47-script=Ethi,
- script=Ethiopic,
- scripttag=ethi,
- langtag=AMH,
- hyphennames={amharic,nohyphenation},
- %hyphenmins={2,2},
- fontsetup=true,
- %TODO localalph=ethnum
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{amharic}{am}
-
-\def\captionsamharic{%
- \def\refname{የነሥ ጹሁፍ ምንጭ}%
- \def\abstractname{አኅጽተሮ ጽሁፍ}%
- \def\bibname{ቢዋ መጽሃፍት}%
- \def\prefacename{መቅድም}%
- \def\chaptername{ክፍል}%
- \def\appendixname{መድበል}%
- \def\contentsname{ይዘት}%
- \def\listfigurename{የሥዕችሎ ማውጫ}%
- \def\listtablename{የሰንጠዥረ ማውጫ}%
- \def\indexname{ምህጻር ቃል}%
- \def\figurename{ሥዕል}%
- \def\tablename{ሰንጠረዥ}%
- %\def\thepart{}%
- \def\partname{ንዑስ ክፍል}%
- \def\pagename{ገጽ}%
- \def\seename{ይመልከቱ}%
- \def\alsoname{ይህምን ይመልከቱ}%
- \def\enclname{አባሪዎች}%
- \def\ccname{ግልባጭ}%
- \def\headtoname{ለ}%
- \def\proofname{ማረጋገጫ}%
- %\def\glossaryname{<++>}%
- }
-
-\newcommand{\eth@monthname}[1]{\ifcase#1\or
- መስከረም\or
- ጥቅምት\or
- ህዳር\or
- ታህሳስ\or
- ጥር\or
- የካቲት\or
- መጋቢት\or
- ሚያዝያ\or
- ግንቦት\or
- ሰኔ\or
- ሐምሌ\or
- ነሐሴ\or
- ጰጉሜን\fi
-}
-\newcount\ethcnt@temp
-\newcount\ethcnt@modtemp
-\newcount\ethcnt@leap
-\newcount\ethcnt@yminone
-\newcount\ethcnt@days
-\newcount\ethcnt@jdn
-\newcount\ethcnt@cycle
-\newcount\ethcnt@ethdays
-\newcount\ethcnt@ethyear
-\newcount\ethcnt@ethmonth
-\newcount\ethcnt@ethday
-\newcommand{\eth@modulo}[2]{%
- \ethcnt@modtemp=#1%
- \divide\ethcnt@modtemp by #2%
- \multiply\ethcnt@modtemp by #2%
- \advance#1 by -\ethcnt@modtemp
-}
-\def\dateamharic{%
- \def\today{{%
- \ethcnt@yminone=\year
- \advance\ethcnt@yminone by -1
- \ethcnt@leap=\year
- \divide\ethcnt@leap by 4
- \ethcnt@temp=\ethcnt@yminone
- \divide\ethcnt@temp by 4
- \advance\ethcnt@leap by -\ethcnt@temp
- \ethcnt@temp=\year
- \divide\ethcnt@temp by 100
- \advance\ethcnt@leap by -\ethcnt@temp
- \ethcnt@temp=\ethcnt@yminone
- \divide\ethcnt@temp by 100
- \advance\ethcnt@leap by \ethcnt@temp
- \ethcnt@temp=\year
- \divide\ethcnt@temp by 400
- \advance\ethcnt@leap by \ethcnt@temp
- \ethcnt@temp=\ethcnt@yminone
- \divide\ethcnt@temp by 400
- \advance\ethcnt@leap by -\ethcnt@temp
- \ifnum\month<3
- \ethcnt@days=\month
- \advance\ethcnt@days by -1
- \multiply\ethcnt@days by 31
- \advance\ethcnt@days by \day
- \advance\ethcnt@days by -1
- \else
- \ethcnt@days=\month
- \advance\ethcnt@days by -1
- \multiply\ethcnt@days by 30
- \advance\ethcnt@days by \day
- \advance\ethcnt@days by \ethcnt@leap
- \advance\ethcnt@days by -3
- \ethcnt@temp=\month
- \multiply\ethcnt@temp by 3
- \advance\ethcnt@temp by -2
- \divide\ethcnt@temp by 5
- \advance\ethcnt@days by \ethcnt@temp
- \fi
- \ethcnt@jdn=\ethcnt@days
- \advance\ethcnt@jdn by 1721426
- \ethcnt@temp=\ethcnt@yminone
- \multiply\ethcnt@temp by 365
- \advance\ethcnt@jdn by \ethcnt@temp
- \ethcnt@temp=\ethcnt@yminone
- \divide\ethcnt@temp by 4
- \advance\ethcnt@jdn by \ethcnt@temp
- \ethcnt@temp=\ethcnt@yminone
- \divide\ethcnt@temp by 100
- \advance\ethcnt@jdn by -\ethcnt@temp
- \ethcnt@temp=\ethcnt@yminone
- \divide\ethcnt@temp by 400
- \advance\ethcnt@jdn by \ethcnt@temp
- \ethcnt@cycle=\ethcnt@jdn
- \advance\ethcnt@cycle by -1723856
- \eth@modulo{\ethcnt@cycle}{1461}%
- \ethcnt@ethdays=\ethcnt@cycle
- \eth@modulo{\ethcnt@ethdays}{365}%
- \ethcnt@temp=\ethcnt@cycle
- \divide\ethcnt@temp by 1460
- \multiply\ethcnt@temp by 365
- \advance\ethcnt@ethdays by \ethcnt@temp
- \ethcnt@ethyear=\ethcnt@jdn
- \advance\ethcnt@ethyear by -1723856
- \divide\ethcnt@ethyear by 1461
- \multiply\ethcnt@ethyear by 4
- \ethcnt@temp=\ethcnt@cycle
- \divide\ethcnt@temp by 365
- \advance\ethcnt@ethyear by \ethcnt@temp
- \divide\ethcnt@cycle by 1460
- \advance\ethcnt@ethyear by -\ethcnt@cycle
- \ethcnt@ethmonth=\ethcnt@ethdays
- \divide\ethcnt@ethmonth by 30
- \advance\ethcnt@ethmonth by 1
- \ethcnt@ethday=\ethcnt@ethdays
- \eth@modulo{\ethcnt@ethday}{30}%
- \advance\ethcnt@ethday by 1%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- \eth@monthname{\ethcnt@ethmonth}\relax\space%
- \number\ethcnt@ethday\relax\space%
- \number\ethcnt@ethyear%
- }}%
-}
-
-\def\ethiop#1{\expandafter\@ethiop\csname c@#1\endcsname}
-\def\@ethiop#1{{%
- \ifnum#1<1\relax\ethnum@err{#1}%
- \else\ifnum#1<10\relax\expandafter\ethnum@one\number #1%
- \else\ifnum#1<100\relax\expandafter\ethnum@two\number #1%
- \else\ifnum#1<1000\relax\expandafter\ethnum@three\number #1%
- \else\ifnum#1<10000\relax\expandafter\ethnum@four\number #1%
- \else\ifnum#1<100000\relax\expandafter\ethnum@five\number #1%
- \else\ifnum#1<1000000\relax\expandafter\ethnum@six\number #1%
- \else%
- \ethnum@err%
- \number#1%
- \fi\fi\fi\fi\fi\fi\fi%
-}}
-\let\ethnum\@ethiop
-\newcommand{\ethnum@tens}[1]{%
- \ifcase#1\or ፲\or ፳\or ፴%
- \or ፵\or ፶\or ፷%
- \or ፸\or ፹\or ፺\fi%
-}%
-\newcommand{\ethnum@one}[1]{%
- \ifcase#1\or ፩\or ፪\or ፫%
- \or ፬\or ፭\or ፮%
- \or ፯\or ፰\or ፱\fi%
-}%
-\newcommand{\ethnum@two}[1]{%
- \ethnum@tens#1%
- \ethnum@one%
-}
-\newcommand{\ethnum@three}[1]{%
- \ifnum#1>1\relax\ethnum@one#1\fi%
- \ifnum#1>0\relax ፻\fi%
- \ethnum@two%
-}
-\newcommand{\ethnum@four}[1]{%
- \ethnum@tens#1%
- \ifnum#1>0\relax ፻\fi%
- \ethnum@three%
-}
-\newcommand{\ethnum@five}[1]{%
- \ifnum#1>1\relax\ethnum@one#1\fi%
- \ifnum#1>0\relax ፼\fi%
- \ethnum@four%
-}
-\newcommand{\ethnum@six}[1]{%
- \ethnum@tens#1%
- \ifnum#1>0\relax ፼\fi%
- \ethnum@five%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-amharic.ldf>
-%<*gloss-apd.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-apd.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-apd.ldf}[polyglossia: module for apd (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{arabic}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-apd.ldf>
-%<*gloss-ar-IQ.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ar-IQ.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ar-IQ.ldf}[polyglossia: module for ar-IQ (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{arabic}
-
-\SetLanguageKeys{arabic}{bcp47=ar-IQ,bcp47-language=ar,bcp47-region=IQ}%
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ar-IQ.ldf>
-%<*gloss-ar-JO.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ar-JO.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ar-JO.ldf}[polyglossia: module for ar-JO (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{arabic}
-
-\SetLanguageKeys{arabic}{bcp47=ar-JO,bcp47-language=ar,bcp47-region=JO}%
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ar-JO.ldf>
-%<*gloss-ar-LB.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ar-LB.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ar-LB.ldf}[polyglossia: module for ar-LB (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{arabic}
-
-\SetLanguageKeys{arabic}{bcp47=ar-LB,bcp47-language=ar,bcp47-region=LB}%
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ar-LB.ldf>
-%<*gloss-ar-MR.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ar-MR.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ar-MR.ldf}[polyglossia: module for ar-MR (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{arabic}
-
-\SetLanguageKeys{arabic}{bcp47=ar-MR,bcp47-language=ar,bcp47-region=MR}%
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ar-MR.ldf>
-%<*gloss-ar-PS.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ar-PS.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ar-PS.ldf}[polyglossia: module for ar-PS (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{arabic}
-
-\SetLanguageKeys{arabic}{bcp47=ar-PS,bcp47-language=ar,bcp47-region=PS}%
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ar-PS.ldf>
-%<*gloss-ar-SY.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ar-SY.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ar-SY.ldf}[polyglossia: module for ar-SY (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{arabic}
-
-\SetLanguageKeys{arabic}{bcp47=ar-SY,bcp47-language=ar,bcp47-region=SY}%
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ar-SY.ldf>
-%<*gloss-ar-YE.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ar-YE.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ar-YE.ldf}[polyglossia: module for ar-YE (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{arabic}
-
-\SetLanguageKeys{arabic}{bcp47=ar-YE,bcp47-language=ar,bcp47-region=YE}%
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ar-YE.ldf>
-%<*gloss-ar.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ar.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ar.ldf}[polyglossia: module for ar (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{arabic}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ar.ldf>
-%<*gloss-arabic.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-arabic.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-arabic.ldf}[polyglossia: module for Arabic]
-\RequireBidi
-\RequirePackage{arabicnumbers}
-\RequirePackage{hijrical}
-
-\PolyglossiaSetup{arabic}{
- bcp47=ar,
- bcp47-language=ar,
- bcp47-script=Arab,
- bcp47-region=YE,
- script=Arabic,
- direction=RL,
- langtag=ARA,
- scripttag=arab,
- hyphennames={nohyphenation},
- fontsetup=true,
- envname=Arabic,
- localnumeral=arabicnumerals
- %TODO localalph={abjad,abjad}
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{arabic}{ar}
-\setlanguagealias*[locale=mashriq]{arabic}{ar-IQ}
-\setlanguagealias*[locale=default]{arabic}{ar-YE}
-\setlanguagealias*[locale=mashriq]{arabic}{ar-LB}
-\setlanguagealias*[locale=mashriq]{arabic}{ar-JO}
-\setlanguagealias*[locale=default]{arabic}{afb}
-\setlanguagealias*[locale=mauritania]{arabic}{ar-MR}
-\setlanguagealias*[locale=default]{arabic}{arz}
-\setlanguagealias*[locale=morocco]{arabic}{ary}
-\setlanguagealias*[locale=algeria]{arabic}{arq}
-\setlanguagealias*[locale=tunisia]{arabic}{aeb}
-\setlanguagealias*[locale=mashriq]{arabic}{ar-SY}
-\setlanguagealias*[locale=libya]{arabic}{ayl}
-\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}%
-}
-
-% Register default options
-\xpg@initialize@gloss@options{arabic}{locale=default,calendar=gregorian,numerals=mashriq,hijricorrection=0,abjadjimnotail=false}
-% Register alias options
-\xpg@set@alias@values{arabic}{calendar}{islamic}{hijri}
-
-\def\arabicgregmonth@default#1{\ifcase#1%
- % Egypt, Sudan, Yemen and Golf states
- \or يناير\or فبراير\or مارس\or أبريل\or مايو\or يونيو\or يوليو\or أغسطس\or سبتمبر\or أكتوبر\or نوفمبر\or ديسمبر\fi}
-\def\arabicgregmonth@mashriq#1{\ifcase#1%
- % Iraq Syria Jordan Lebanon Palestine
- \or كانون الثاني\or شباط\or آذار\or نيسان\or أيار\or حزيران\or تموز\or آب\or أيلول\or تشرين الأول\or تشرين الثاني\or كانون الأول\fi}
-\def\arabicgregmonth@libya#1{\ifcase#1%
- %Lybia «تعرف في ليبيا بأسماء عربية وضعها معمر القذافي ترمز إلى فصول السنة وبعض الشخصيات التاريخية» (ar.wikipedia.org)
- \or أي النار\or النوار\or الربيع\or الطير\or الماء\or الصيف\or ناصر\or هانيبال\or الفاتح\or التمور\or الحرث\or الكانون\fi}
-\def\arabicgregmonth@morocco#1{\ifcase#1%
- \or يناير\or فبراير\or مارس\or أبريل\or ماي\or يونيو\or يوليوز\or غشت\or شتنبر\or أكتوبر\or نونبر\or دجنبر\fi}
-\def\arabicgregmonth@algeria#1{\ifcase#1%
- % Tunisia and Algeria
- \or جانفي\or فيفري\or مارس\or أفريل\or ماي\or جوان\or جويلية\or أوت\or سبتمبر\or أكتوبر\or نوفمبر\or ديسمبر\fi}
-\let\arabicgregmonth@tunisia\arabicgregmonth@algeria
-\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}}
-
-%\Hijritoday is now locale-aware and will format the date with this macro:
-\DefineFormatHijriDate{arabic}{\@ensure@RTL{\arabicnumber{\value{Hijriday}}%
- \space\HijriMonthArabic{\value{Hijrimonth}}\space\arabicnumber{\value{Hijriyear}}}}
-
-\def\captionsarabic{%
- \def\prefacename{\@ensure@RTL{مدخل}}%
- \def\refname{\@ensure@RTL{المراجع}}%
- \def\abstractname{\@ensure@RTL{ملخص}}%
- \def\bibname{\@ensure@RTL{المصادر}}%
- \def\chaptername{\@ensure@RTL{باب}}%
- \def\appendixname{\@ensure@RTL{الملاحق}}%
- \def\contentsname{\@ensure@RTL{المحتويات}}%
- %\def\contentsname{\@ensure@RTL{الفهرس}}%
- \def\listfigurename{\@ensure@RTL{قائمة الأشكال}}%
- \def\listtablename{\@ensure@RTL{قائمة الجداول}}%
- \def\indexname{\@ensure@RTL{الفهرس}}%
- \def\figurename{\@ensure@RTL{شكل}}%
- \def\tablename{\@ensure@RTL{جدول}}%
- \def\partname{\@ensure@RTL{القسم}}%
- \def\enclname{\@ensure@RTL{المرفقات}}%<-- Needs translation
- \def\ccname{\@ensure@RTL{نسخة ل‬}}% <<
- \def\headtoname{\@ensure@RTL{إلى}}%<-- Needs translation
- \def\pagename{\@ensure@RTL{صفحة}}%
- \def\seename{\@ensure@RTL{راجع}}%\alefhamza\nun\za\ra
- \def\alsoname{\@ensure@RTL{راجع أيضًا}}%<<\alefhamza\nun\za\ra
- \def\proofname{\@ensure@RTL{برهان}}%
- \def\glossaryname{\@ensure@RTL{قاموس}}%<<
-}
-\def\datearabic{%
- \def\today{%
- \if@hijrical%
- \Hijritoday[\arabic@hijri@correction]%
- \else%
- \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%
- \space\number\day,\space\number\year}%
- \fi%
- \fi}}
-
-% Use \providecommand here as the ldf file might
-% be reloaded via aeb (BCP).
-\providecommand{\arabicnumerals}[2]{\arabicnumber{#2}}
-
-\def\arabicnumber#1{%
- \ifeastern@numerals
- \@ensure@LTR{\arabicdigits{\number#1}}%
- \else
- \number#1%
- \fi}
-
-\def\@ornatebracearabic#1{\RL{\char"FD3F\@arabic#1\char"FD3E}}
-\def\@ornatebracealph#1{\RL{\char"FD3F\@alph#1\char"FD3E}}
-
-\def\abjadalph#1{\expandafter\arabic@abjad@alph{\number#1}}
-
-% This is a poor man's Arabic alphanumeric. It just uses the alphabet and
-% thus ends at 28.
-\def\arabic@abjad@alph#1{\ifcase#1%
- \or ا\or ب\or\abjad@three\or د\or و\or ه‍\or ز%
- \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%
-}
-
-
-\def\abjadmaghribi#1{%
-\ifnum#1>1999\xpg@ill@value{#1}{abjad}%
-\else
- \ifnum#1<\z@\space\xpg@ill@value{#1}{abjad}%
- \else
- \ifnum#1<10\expandafter\abj@num@i\number#1%
- \else
- \ifnum#1<100\expandafter\abj@maghribi@num@ii\number#1%
- \else
- \ifnum#1<\@m\expandafter\abj@maghribi@num@iii\number#1%
- \else
- \ifnum#1<\@M\expandafter\abj@maghribi@num@iv\number#1%
- \fi
- \fi
- \fi
- \fi
- \fi
-\fi
-}
-
-%maghribi س -> ص ص -> ض ش -> س ض -> ظ ظ -> غ غ -> ش
-\def\abj@maghribi@num@ii#1{%
- \ifcase#1\or ي\or ك\or ل\or م\or ن%
- \or ص\or ع\or ف\or ض\fi
- \ifnum#1=\z@\abjad@zero\fi\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}
-\def\abj@maghribi@num@iv#1{%
- \ifcase#1\or ش\fi
- \ifnum#1=\z@\fi\abj@maghribi@num@iii}
-
-\def\arabic@numbers{%
- \ifarabic@abjadalph
- \let\@alph\abjadalph%
- \let\@Alph\abjadalph%
- \else
- \let\@alph\abjad%
- \let\@Alph\abjad%
- \fi
-}
-
-\def\noarabic@numbers{%
- \let\@alph\latin@alph%
- \let\@Alph\latin@Alph%
-}
-
-% Store original definition
-\let\xpg@save@arabic\@arabic
-
-\def\arabic@globalnumbers{%
- \let\@arabic\arabicnumber%
- \renewcommand\thefootnote{\localnumeral*{footnote}}%
- \renewcommand\theequation{\localnumeral*{equation}}%
-}
-
-\def\noarabic@globalnumbers{%
- \let\@arabic\xpg@save@arabic%
-}
-
-\def\arabic@xetex@capsformat{%
- \let\xpg@save@sepmark\@SepMark%
- \SepMark{\xpg@sepmark}
-}
-
-\def\noarabic@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
- \SepMark{\xpg@save@sepmark}
- }{}%
-}
-
-\def\arabic@luatex@capsformat{%
- %
- % change chapter and part headings
- \ifarabic@customsep
- \ifcsdef{chapter}{%
- \let\xpg@save@thesection\thesection%
- \renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
- \let\xpg@save@theequation\theequation%
- \renewcommand*\theequation{%
- \ifnum \c@chapter>\z@ \thechapter\xpg@sepmark\fi\@arabic\c@equation}
- \let\xpg@save@thefigure\thefigure%
- \renewcommand*\thefigure{%
- \ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@figure}
- \let\xpg@save@thetable\thetable%
- \renewcommand*\thetable{%
- \ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
- \let\xpg@save@thesubsection\thesubsection%
- \renewcommand\thesubsection
- {\thesection\xpg@sepmark\@arabic\c@subsection}
- \let\xpg@save@thesubsubsection\thesubsubsection%
- \renewcommand\thesubsubsection{\thesubsection\xpg@sepmark\@arabic\c@subsubsection}
- \let\xpg@save@theparagraph\theparagraph%
- \renewcommand\theparagraph
- {\thesubsubsection\xpg@sepmark\@arabic\c@paragraph}
- \let\xpg@save@thesubparagraph\thesubparagraph%
- \renewcommand\thesubparagraph{\theparagraph\xpg@sepmark\@arabic\c@subparagraph}
- \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%
- }{}%
-}
-
-\def\blockextras@arabic{%
- \ifarabic@customsep
- \ifxetex
- \arabic@xetex@capsformat
- \else
- \arabic@luatex@capsformat
- \fi
- \fi
-}
-%
-\def\noextras@arabic{%
- \ifarabic@customsep
- \ifxetex
- \noarabic@xetex@capsformat
- \else
- \noarabic@luatex@capsformat
- \fi
- \fi
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-arabic.ldf>
-%<*gloss-armenian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-armenian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-armenian.ldf}[polyglossia: module for Armenian]
-
-\PolyglossiaSetup{armenian}{
- bcp47=hy,
- bcp47-language=hy,
- bcp47-script=Armn,
- bcp47-region=AM,
- script=Armenian,
- scripttag=armn,
- langtag=HYE,
- hyphennames={armenian},
- hyphenmins={2,2},
- fontsetup=true,
- localnumeral=armeniannumerals
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{armenian}{hy}
-
-\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
-}
-
-% Register default options
-\xpg@initialize@gloss@options{armenian}{numerals=armenian,variant=western}
-
-% Taken from ArmTeX. Audit!
-\def\captionsarmenian{%
- \def\refname{Հղումներ}%
- \def\abstractname{Սեղմագիր}%
- \def\bibname{Գրականություն}%
- \def\prefacename{Նախաբան}%
- \def\chaptername{Գլուխ}%
- \def\appendixname{Հավելված}%
- \def\contentsname{Բովանդակություն}%
- \def\listfigurename{Նկարների ցանկ}%
- \def\listtablename{Աղյուսակների ցանկ}%
- \def\indexname{Առարկայական ցանկ}%
- \def\figurename{Նկար}%
- \def\tablename{Աղյուսակ}%
- \def\partname{Մաս}%
- \def\pagename{էջ}%
- \def\seename{տե՛ս}%
- \def\alsoname{տե՛ս նաեւ}%
- \def\enclname{Կից՝}%
- \def\ccname{Կրկնօրինակը՝}%
-% The \headtoname is empty: the typesetter should use the dative (trakan
-% holov) of the recipient's name.
- \def\headtoname{}%
- \def\proofname{Ապացույց}%
- \def\glossaryname{Տերմինների ցանկ}%
-}
-
-\def\date@western@armenian{%
- \def\today{\ifcase\month\or
- Յունուար\or
- Փետրուար\or
- Մարտ\or
- Ապրիլ\or
- Մայիս\or
- Յունիս\or
- Յուլիս\or
- Օգոստոս\or
- Սեպտեմբեր\or
- Հոկտեմբեր\or
- Նոյեմբեր\or
- Դեկտեմբեր\fi
- \number\day,\space\number\year}%
-}
-
-\def\date@eastern@armenian{%
- \def\today{\ifcase\month\or
- Հունվար\or
- Փետրվար\or
- Մարտ\or
- Ապրիլ\or
- Մայիս\or
- Հունիս\or
- Հուլիս\or
- Օգոստոս\or
- Սեպտեմբեր\or
- Հոկտեմբեր\or
- Նոյեմբեր\or
- Դեկտեմբեր\fi
- \number\day,\space\number\year}%
-}
-
-\def\datearmenian{%
- \if@eastern@armenian
- \date@eastern@armenian%
- \else
- \date@western@armenian%
- \fi
-}
-
-\newcommand{\armeniannumerals}[2]{%
- \if@armenian@numerals
- \armeniannumber{#2}%
- \else
- #2%
- \fi%
-}
-
-\def\armenian@numbers{%
- \if@armenian@numerals
- \def\armenian@alph##1{\expandafter\armeniannumeral\expandafter{\the##1}}%
- \let\@alph\armenian@alph%
- \fi%
-}
-
-\def\noarmenian@numbers{%
- \let\@alph\latin@alph%
- \let\armenian@alph\@undefined%
-}
-
-\def\armenian@globalnumbers{%
- \if@armenian@numerals
- \let\@arabic\armeniannumber%
- \renewcommand\thefootnote{\localnumeral*{footnote}}%
- \renewcommand\theequation{\localnumeral*{equation}}%
- \fi
-}
-
-% Store original definition
-\let\xpg@save@arabic\@arabic
-
-\def\noarmenian@globalnumbers{
- \let\@arabic\xpg@save@arabic%
-}
-
-\protected\def\armeniannumber#1{\expandafter\@armeniannumber\expandafter{\number#1}}
-\def\@armeniannumber#1{%
- \ifnum#1<\@ne\space\arm@ill@value{#1}%
- \else
- \ifnum#1<10\expandafter\arm@num@i\number#1%
- \else
- \ifnum#1<100\expandafter\arm@num@ii\number#1%
- \else
- \ifnum#1<\@m\expandafter\arm@num@iii\number#1%
- \else
- \ifnum#1<\@M\expandafter\arm@num@iv\number#1%
- \else
- \space\arm@ill@value{#1}%
- \fi
- \fi
- \fi
- \fi
- \fi
-}
-
-\let\armeniannumeral=\armeniannumber
-\def\arm@num@i#1{%
- \ifcase#1\or Ա\or Բ\or Գ\or Դ\or Ե\or Զ\or Է\or Ը\or Թ\fi}
-\def\arm@num@ii#1{%
- \ifcase#1\or Ժ\or Ի\or Լ\or Խ\or Ծ\or Կ\or Հ\or Ձ\or Ղ\fi
- \arm@num@i}
-\def\arm@num@iii#1{%
- \ifcase#1\or Ճ\or Մ\or Յ\or Ն\or Շ\or Ո\or Չ\or Պ\or Ջ\fi
- \arm@num@ii}
-\def\arm@num@iv#1{%
- \ifcase#1\or Ռ\or Ս\or Վ\or Տ\or Ր\or Ց\or Ւ\or Փ\or Ք\fi
- \arm@num@iii}
-\def\arm@ill@value#1{\xpg@warning{Illegal value (#1) for Armenian numeral}[$#1$]}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-armenian.ldf>
-%<*gloss-arq.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-arq.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-arq.ldf}[polyglossia: module for arq (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{arabic}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-arq.ldf>
-%<*gloss-ary.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ary.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ary.ldf}[polyglossia: module for ary (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{arabic}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ary.ldf>
-%<*gloss-arz.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-arz.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-arz.ldf}[polyglossia: module for arz (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{arabic}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-arz.ldf>
-%<*gloss-ast.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ast.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ast.ldf}[polyglossia: module for ast (Asturian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{asturian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ast.ldf>
-%<*gloss-asturian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-asturian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-% Translated by Xuacu <xuacusk8 at gmail dot com>
-% Contributed by Kevin Godby <godbyk at gmail dot com>
-%
-\ProvidesFile{gloss-asturian.ldf}[polyglossia: module for Asturian]
-\PolyglossiaSetup{asturian}{
- bcp47=ast,
- bcp47-language=ast,
- bcp47-script=Latn,
- hyphennames={asturian,catalan},
- hyphenmins={2,2},
- langtag=AST,
- frenchspacing=true,
- indentfirst=true,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{asturian}{ast}
-
-\def\captionsasturian{%
- \def\prefacename{Entamu}%
- \def\refname{Referencies}%
- \def\abstractname{Sumariu}%
- \def\bibname{Bibliografía}%
- \def\chaptername{Capítulu}%
- \def\appendixname{Apéndiz}%
- \def\contentsname{Conteníu}%
- \def\listfigurename{Llista de figures}%
- \def\listtablename{Llista de tables}%
- \def\indexname{Índiz}%
- \def\figurename{Figura}%
- \def\tablename{Tabla}%
- \def\partname{Parte}%
- \def\enclname{incl.}%
- \def\ccname{cc}%
- \def\headtoname{Pa}%
- \def\pagename{Páxina}%
- \def\seename{ver}%
- \def\alsoname{ver tamién}%
- \def\proofname{Demostración}%
- \def\glossaryname{Glosariu}%
- }
-\def\dateasturian{%
- \def\today{\number\day~\ifcase\month\or
- de~xineru\or de~febreru\or de~marzu\or d'abril\or de~mayu\or de~xunu\or
- de~xunetu\or d'agostu\or de~setiembre\or d'ochobre\or de~payares\or
- d'avientu\fi\space de~\number\year}%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-asturian.ldf>
-%<*gloss-australian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-australian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-australian.ldf}[polyglossia: module for Australian English]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{english}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-australian.ldf>
-%<*gloss-austrian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-austrian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-austrian.ldf}[polyglossia: module for Austrian German (old spelling)]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{german}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-austrian.ldf>
-%<*gloss-ayl.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ayl.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ayl.ldf}[polyglossia: module for ayl (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{arabic}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ayl.ldf>
-%<*gloss-bahasa.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-bahasa.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-bahasa.ldf}[polyglossia: module for Bahasa Indonesia]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{malay}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-bahasa.ldf>
-%<*gloss-bahasai.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-bahasai.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-bahasai.ldf>
-%<*gloss-bahasam.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-bahasam.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-bahasam.ldf>
-%<*gloss-basque.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-basque.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-basque.ldf}[polyglossia: module for Basque]
-\PolyglossiaSetup{basque}{
- bcp47=eu,
- bcp47-language=eu,
- bcp47-region=ES,
- bcp47-script=Latn,
- hyphennames={basque},
- hyphenmins={2,2},
- langtag=EUQ,
- indentfirst=true,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{basque}{eu}
-
-\def\captionsbasque{%
- \def\refname{Erreferentziak}%
- \def\abstractname{Laburpena}%
- \def\bibname{Bibliografia}%
- \def\prefacename{Hitzaurrea}%
- \def\chaptername{Kapitulua}%
- \def\appendixname{Eranskina}%
- \def\contentsname{Gaien Aurkibidea}%
- \def\listfigurename{Irudien Zerrenda}%
- \def\listtablename{Taulen Zerrenda}%
- \def\indexname{Kontzeptuen Aurkibidea}%
- \def\figurename{Irudia}%
- \def\tablename{Taula}%
- \def\thepart{}%
- \def\partname{Atala}%
- \def\pagename{Orria}%
- \def\seename{Ikusi}%
- \def\alsoname{Ikusi, halaber}%
- \def\enclname{Erantsia}%
- \def\ccname{Kopia}%
- \def\headtoname{Nori}%
- \def\proofname{Frogapena}%
- \def\glossaryname{Glosarioa}%
- }
-\def\datebasque{%
- \def\today{\number\year.eko\space\ifcase\month\or
- urtarrilaren\or otsailaren\or martxoaren\or apirilaren\or
- maiatzaren\or ekainaren\or uztailaren\or abuztuaren\or
- irailaren\or urriaren\or azaroaren\or
- abenduaren\fi~\number\day}}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-basque.ldf>
-%<*gloss-be-tarask.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-be-tarask.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-be-tarask.ldf}[polyglossia: module for be-tarask (Belarusian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{belarusian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-be-tarask.ldf>
-%<*gloss-be.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-be.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-be.ldf}[polyglossia: module for be (Belarusian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{belarusian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-be.ldf>
-%<*gloss-belarusian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-belarusian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-belarusian.ldf}[polyglossia: module for Belarusian]
-
-\RequirePackage{xpg-cyrillicnumbers}
-
-\PolyglossiaSetup{belarusian}{
- bcp47=be,
- bcp47-language=be,
- bcp47-region=BY,
- bcp47-variant=1959acad,
- bcp47-script=Cyrl,
- script=Cyrillic,
- scripttag=cyrl,
- langtag=BEL,
- hyphennames={belarusian},
- hyphenmins={2,2},
- frenchspacing=true,
- fontsetup,
- localnumeral=belarusiannumerals,
- Localnumeral=Belarusiannumerals
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*[spelling=classic]{belarusian}{be-tarask}
-\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]{}
-
-% Register default options
-\xpg@initialize@gloss@options{belarusian}{babelshorthands=false,numerals=arabic,spelling=modern}
-% Register alias options
-\xpg@set@alias@values{belarusian}{spelling}{classic}{tarask}
-
-\ifsystem@babelshorthands
- \setkeys{belarusian}{babelshorthands=true}
-\else
- \setkeys{belarusian}{babelshorthands=false}
-\fi
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
-
-\def\belarusian@shorthands{%
- \xpg@activate@shorthands%
- \def\language@group{belarusian}%
- \declare@shorthand{belarusian}{"`}{„}%
- \declare@shorthand{belarusian}{"'}{“}%
- \declare@shorthand{belarusian}{"<}{«}%
- \declare@shorthand{belarusian}{">}{»}%
- \declare@shorthand{belarusian}{""}{\hskip\z@skip}%
- \declare@shorthand{belarusian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
- \declare@shorthand{belarusian}{"=}{\nobreak-\hskip\z@skip}%
- \declare@shorthand{belarusian}{"|}{\textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}%
- \declare@shorthand{belarusian}{"-}{%
- \def\belarusian@sh@tmp{%
- \if\belarusian@sh@next-\expandafter\belarusian@sh@emdash%
- \else\expandafter\belarusian@sh@hyphen\fi%
- }%
- \futurelet\belarusian@sh@next\belarusian@sh@tmp%
- }%
- \def\belarusian@sh@hyphen{%
- \nobreak\-\bbl@allowhyphens}%
- \def\belarusian@sh@emdash##1##2{\cdash-##1##2}%
- \def\cdash##1##2##3{\def\tempx@{##3}%
- \def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
- \ifx\tempx@\tempa@\@Acdash\else
- \ifx\tempx@\tempb@\@Bcdash\else
- \ifx\tempx@\tempc@\@Ccdash\else
- \errmessage{Wrong usage of cdash}\fi\fi\fi}%
- \def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
- \cyrdash\hskip.2em\ignorespaces}%
- \def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
- \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%
- \def\@Ccdash{\leavevmode
- \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
- \ifx\cyrdash\undefined
- \def\cyrdash{\hbox to.8em{\textendash\hss\textendash}}%
- \fi
- \declare@shorthand{belarusian}{",}{\nobreak\hskip.2em\ignorespaces}%
-}
-
-\def\nobelarusian@shorthands{%
- \xpg@deactivate@shorthands%
-}
-
-% Taken from babel-belarusian
-\def\captionsbelarusian@modern{%
- \def\prefacename{Прадмова}%
- \def\refname{Спіс літаратуры}%
- \def\abstractname{Анатацыя}%
- \def\bibname{Літаратура}%
- \def\chaptername{Глава}%
- \def\appendixname{Дадатак}%
- \def\contentsname{Змест}%
- \def\listfigurename{Спіс ілюстрацый}%
- \def\listtablename{Спіс табліц}%
- \def\indexname{Прадметны паказальнік}%
- \def\authorname{Паказальнік імён}%
- \def\figurename{Рыс.}%
- \def\tablename{Табліца}%
- \def\partname{Частка}%
- \def\enclname{укл.}%
- \def\ccname{зых.}%
- \def\headtoname{вх.}%
- \def\pagename{с.}%
- \def\seename{гл.}%
- \def\alsoname{гл.\ таксама}%
- \def\proofname{Доказ}%
- \def\glossaryname{Слоўнік тэрмінаў}%
- \def\acronymname{Абрэвіятуры}%
- \def\lstlistingname{Лістынг}%
- \def\lstlistlistingname{Лістынгі}%
- \def\notesname{Нататкі}%
-}
-
-\def\captionsbelarusian@tarask{%
- \def\prefacename{Прадмова}%
- \def\refname{Сьпіс літаратуры}%
- \def\abstractname{Анатацыя}%
- \def\bibname{Літаратура}%
- \def\chaptername{Глава}%
- \def\appendixname{Дадатак}%
- \def\contentsname{Зьмест}%
- \let\tocname=\contentsname
- \def\listfigurename{Сьпіс ілюстрацый}%
- \def\listtablename{Сьпіс табліц}%
- \def\indexname{Прадметны паказальнік}%
- \def\authorname{Паказальнік імён}%
- \def\figurename{Рыс.}%
- \def\tablename{Табліца}%
- \def\partname{Частка}%
- \def\enclname{укл.}%
- \def\ccname{зых.}%
- \def\headtoname{вх.}%
- \def\pagename{с.}%
- \def\seename{гл.}%
- \def\alsoname{гл.\ таксама}%
- \def\proofname{Доказ}%
- \def\glossaryname{Слоўнік тэрмінаў}%
- \def\acronymname{Абрэвіятуры}%
- \def\lstlistingname{Лістынг}%
- \def\lstlistlistingname{Лістынгі}%
- \def\nomname{Азначэньні}%
- \def\notesname{Нататкі}%
-}
-
-\def\captionsbelarusian{%
- \csuse{captionsbelarusian@\belarusian@spelling}%
-}
-
-\def\datebelarusian@modern{%
- \def\today{\number\day~\ifcase\month\or
- студзеня\or
- лютага\or
- сакавіка\or
- красавіка\or
- мая\or
- чэрвеня\or
- ліпеня\or
- жніўня\or
- верасня\or
- кастрычніка\or
- лістапада\or
- снежня\fi
- \space \number\year~г.}%
-}
-
-\def\datebelarusian@tarask{%
- \def\today{\number\day~\ifcase\month\or%
- студзеня\or
- лютага\or
- сакавіка\or
- красавіка\or
- траўня\or
- чэрвеня\or
- ліпеня\or
- жніўня\or
- верасьня\or
- кастрычніка\or
- лістапада\or
- сьнежня\fi%
- \space \number\year~г.}%
-}
-
-\def\datebelarusian{%
- \csuse{datebelarusian@\belarusian@spelling}%
-}
-
-% Use \providecommand here as the ldf file might
-% be reloaded via be-tarask (BCP).
-\providecommand{\belarusiannumerals}[2]{\belarusiannumber{#2}}
-\providecommand{\Belarusiannumerals}[2]{\Belarusiannumber{#2}}
-
-\def\belarusiannumber#1{%
- \ifcyrillic@numerals
- \ifcyrillic@asbuk@numerals
- \belarusian@asbuk@alph{#1}%
- \else
- \cyr@alph{#1}%
- \fi
- \else
- \number#1%
- \fi%
-}
-
-\def\Belarusiannumber#1{%
- \ifcyrillic@numerals
- \ifcyrillic@asbuk@numerals
- \belarusian@asbuk@Alph{#1}%
- \else
- \cyr@Alph{#1}%
- \fi
- \else
- \number#1%
- \fi%
-}
-
-\let\belarusiannumeral=\belarusiannumber
-\let\Belarusiannumeral=\Belarusiannumber
-
-\def\Asbuk#1{\expandafter\belarusian@asbuk@Alph\csname c@#1\endcsname}
-\def\asbuk#1{\expandafter\belarusian@asbuk@alph\csname c@#1\endcsname}
-
-\def\AsbukTrad#1{\expandafter\cyr@Alph\csname c@#1\endcsname}
-\def\asbukTrad#1{\expandafter\cyr@alph\csname c@#1\endcsname}
-
-
-% This is a poor man's cyrillic alphanumeric. It just uses the alphabet and
-% thus ends at 30.
-\def\belarusian@asbuk@Alph#1{\ifcase#1\or
- А\or Б\or В\or Г\or Д\or Е\or Ж\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}{belarusian@asbuk@Alph}\fi%
-}
-
-\def\belarusian@asbuk@alph#1{\ifcase#1\or
- а\or б\or в\or г\or д\or е\or ж\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}{belarusian@asbuk@alph}\fi%
-}
-
-\def\belarusian@numbers{%
- \let\latin@alph\@alph
- \let\latin@Alph\@Alph
- \ifcyrillic@numerals%
- \def\belarusian@alph##1{\expandafter\belarusiannumeral\expandafter{\the##1}}%
- \def\belarusian@Alph##1{\expandafter\belarusiannumeral\expandafter{\the##1}}%
- \let\@alph\belarusian@alph%
- \let\@Alph\belarusian@Alph%
- \fi
-}
-
-\def\nobelarusian@numbers{%
- \let\@alph\latin@alph%
- \let\@Alph\latin@Alph%
-}
-
-\def\noextras@belarusian{%
- \ifcyrillic@numerals\nobelarusian@numbers\fi%
- \ifbelarusian@babelshorthands\nobelarusian@shorthands\fi%
-}
-
-\def\blockextras@belarusian{%
- \ifcyrillic@numerals\belarusian@numbers\else\nobelarusian@numbers\fi%
- \ifbelarusian@babelshorthands\belarusian@shorthands\else\nobelarusian@shorthands\fi%
-}
-
-\def\inlineextras@belarusian{%
- \ifbelarusian@babelshorthands\belarusian@shorthands\else\nobelarusian@shorthands\fi%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-belarusian.ldf>
-%<*gloss-bengali.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-bengali.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-% Translations provided by সাজেদুর রহিম জোয়ারদার <toshazed@gmail.com>
-% TODO implement Bengali calendar
-
-\ProvidesFile{gloss-bengali.ldf}[polyglossia: module for Bengali]
-
-\RequirePackage{devanagaridigits}
-\RequirePackage{bengalidigits}
-
-\PolyglossiaSetup{bengali}{
- bcp47=bn,
- bcp47-language=bn,
- bcp47-script=Beng,
- script=Bengali,
- scripttag=beng,
- langtag=BEN,
- hyphennames={bengali},
- hyphenmins={2,2},%CHECK
- fontsetup=true,
- localnumeral=bengalinumerals
- %TODO nouppercase=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{bengali}{bn}
-
-\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]{}
-
-% Register default options
-\xpg@initialize@gloss@options{bengali}{changecounternumbering=false,numerals=Devanagari}
-
-\def\captionsbengali{%
- \def\refname{তথ্যসূত্রসমূহ}%
- \def\abstractname{সারসংক্ষেপ}%
- \def\bibname{তথ্যবিবরণ}%
- \def\prefacename{পূর্বকথা}%
- \def\chaptername{অধ্যায়}%
- \def\appendixname{পরিশিষ্ট}%
- \def\contentsname{সূচীপত্র}%
- \def\listfigurename{ছবি/নকশা সমূহের তালিকা}%
- \def\listtablename{তালিকাসারণী}%
- \def\indexname{সূচক/নির্দেশক}%
- \def\figurename{চিত্র}%
- \def\tablename{সারণী}%
- %\def\thepart{}% TODO
- \def\partname{খন্ড}%
- \def\pagename{পৃষ্ঠা}%
- \def\seename{দেখুন}%
- \def\alsoname{আরও দেখুন}%
- \def\enclname{সংযুক্তি}%
- \def\ccname{অনুলিপি}%
- \def\headtoname{প্রতি}%
- \def\proofname{প্রমাণ}%
- \def\glossaryname{পরিভাষার শব্দসম্ভার}%
-}
-\def\datebengali{%
- \def\bengalimonth{%
- \ifcase\month\or
- জানুয়ারি\or
- ফেব্রুয়ারি\or
- মার্চ\or
- এপ্রিল\or
- মে\or
- জুন\or
- জুলাই\or
- আগস্ট\or
- সেপ্টেম্বর\or
- অক্টোবর\or
- নভেম্বর\or
- ডিসেম্বর\fi}%
- \def\today{\bengalinumber\day\space\bengalimonth\space\bengalinumber\year}%
-}
-
-\newcommand{\bengalinumerals}[2]{\bengalinumber{#2}}
-
-\def\bengalinumber#1{%
- \ifbengali@devanagari@numerals
- \devanagaridigits{\number#1}%
- \else
- \ifbengali@bengali@numerals
- \bengalidigits{\number#1}%
- \else % Assumed Western
- \number#1%
- \fi
- \fi%
-}
-
-% Backwards compatibility. This command was never documented, but
-% some people might use it nevertheless (see #381).
-% This takes a counter.
-\newcommand\bengalinumeral[1]{\localnumeral*[lang=bengali]{#1}}
-
-\def\bengali@globalnumbers{%
- \ifbengali@changecounternumbering
- \let\@arabic\bengalinumber%
- \renewcommand\thefootnote{\localnumeral*{footnote}}%
- \fi
-}
-
-% Store original definition
-\let\xpg@save@arabic\@arabic
-
-\def\nobengali@globalnumbers{%
- \let\@arabic\xpg@save@arabic%
-}
-
-\def\blockextras@bengali{\extras@bengali}
-\def\inlineextras@bengali{\extras@bengali}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-bengali.ldf>
-%<*gloss-bg.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-bg.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-bg.ldf}[polyglossia: module for bg (Bulgarian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{bulgarian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-bg.ldf>
-%<*gloss-bn.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-bn.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-bn.ldf}[polyglossia: module for bn (Bengali)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{bengali}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-bn.ldf>
-%<*gloss-bo.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-bo.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-bo.ldf}[polyglossia: module for bo (Tibetan)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{tibetan}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-bo.ldf>
-%<*gloss-bosnian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-bosnian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-bosnian.ldf}[polyglossia: module for Bosnian]
-
-\PolyglossiaSetup{bosnian}{
- bcp47=bs,
- bcp47-language=bs,
- bcp47-region=BA,
- bcp47-script=Latn,
- bcp47-casing=bs-Latn,
- langtag=BOS,
- hyphennames={bosnian,croatian},
- hyphenmins={2,2}, % adapted from gloss-croatian
- frenchspacing=true, % adapted from gloss-croatian
- indentfirst=false, % adapted from gloss-croatian
- fontsetup=true
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{bosnian}{bs}
-
-% TODO: Add script=Cyrillic
-
-% from babel-bosnian
-\def\captionsbosnian{%
- \def\prefacename{Predgovor}%
- \def\refname{Literatura}%
- \def\abstractname{Sažetak}%
- \def\bibname{Bibliografija}%
- \def\chaptername{Poglavlje}%
- \def\appendixname{Dodatak}%
- \def\contentsname{Sadržaj}%
- \def\listfigurename{Popis slika}%
- \def\listtablename{Popis tablica}%
- \def\indexname{Indeks}%
- \def\figurename{Slika}%
- \def\tablename{Tablica}%
- \def\partname{Dio}%
- \def\enclname{Prilozi}%
- \def\ccname{Kopija}%
- \def\headtoname{Prima}%
- \def\pagename{Stranica}%
- \def\seename{Vidjeti}%
- \def\alsoname{Također vidjeti}%
- \def\proofname{Dokaz}%
- \def\glossaryname{Rječnik}%
-}
-
-\def\datebosnian{%
- \def\today{\number\day.~\ifcase\month\or
- januar\or februar\or mart\or april\or maj\or
- juni\or juli\or august\or septembar\or oktobar\or novembar\or
- decembar\fi \space \number\year.}%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-bosnian.ldf>
-%<*gloss-br.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-br.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-br.ldf}[polyglossia: module for br (Breton)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{breton}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-br.ldf>
-%<*gloss-brazil.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-brazil.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-brazil.ldf}[polyglossia: module for Brazilian Portuguese]
-
-% We only provide this gloss for backwards compatibility. The name
-% 'brazil' was selected in accordance with babel.
-% Since brazil is a variety of portuguese, we use 'portuguese' now.
-
-\xpg@load@master@language{portuguese}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-brazil.ldf>
-%<*gloss-breton.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-breton.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-breton.ldf}[polyglossia: module for Breton]
-\PolyglossiaSetup{breton}{
- bcp47=br,
- bcp47-language=br,
- bcp47-region=FR,
- bcp47-script=Latn,
- hyphennames={breton},
- hyphenmins={2,2},
- langtag=BRE,
- frenchspacing=true,
- indentfirst=true,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{breton}{br}
-
-\ifluatex
- % TODO
-\else
- \newXeTeXintercharclass\breton@punctthin % ! ? ;
- \newXeTeXintercharclass\breton@punctthick % :
-\fi
-
-\def\breton@punctthinspace{{\unskip\thinspace}}
-\def\breton@punctthickspace{{\unskip\nobreakspace}}
-
-\def\breton@punctuation{%
- \ifluatex
- % TODO
- \else
- \XeTeXinterchartokenstate=1%
- \XeTeXcharclass `\! \breton@punctthin
- \XeTeXcharclass `\? \breton@punctthin
- \XeTeXcharclass `\; \breton@punctthin
- \XeTeXcharclass `\: \breton@punctthick
- \XeTeXinterchartoks \z@ \breton@punctthin = \breton@punctthinspace
- \XeTeXinterchartoks \z@ \breton@punctthick = \breton@punctthickspace
- \fi
-}
-
-\def\nobreton@punctuation{%
- \ifluatex
- % TODO
- \else
- \XeTeXcharclass `\! \z@
- \XeTeXcharclass `\? \z@
- \XeTeXcharclass `\; \z@
- \XeTeXcharclass `\: \z@
- \XeTeXinterchartokenstate=0%
- \fi
-}
-
-
-\def\captionsbreton{%
- \def\refname{Daveennoù}%
- \def\abstractname{Dvierrañ}%
- \def\bibname{Lennadurezh}%
- \def\prefacename{Rakskrid}%
- \def\chaptername{Pennad}%
- \def\appendixname{Stagadenn}%
- \def\contentsname{Taolenn}%
- \def\listfigurename{Listenn ar Figurennoù}%
- \def\listtablename{Listenn an taolennoù}%
- \def\indexname{Meneger}%
- \def\figurename{Figurenn}%
- \def\tablename{Taolenn}%
- \def\thepart{}%
- \def\partname{Lodenn}%
- \def\pagename{Pajenn}%
- \def\seename{Gwelout}%
- \def\alsoname{Gwelout ivez}%
- \def\enclname{Dielloù kevret}%
- \def\ccname{Eilskrid da}%
- \def\headtoname{evit}%
- \def\proofname{Proof}%
- \def\glossaryname{Glossary}%
- }
-\def\datebreton{%
- \def\today{\ifnum\day=1\relax 1\/\textsuperscript{añ}\else
- \number\day\fi \space a\space viz\space\ifcase\month\or
- Genver\or C'hwevrer\or Meurzh\or Ebrel\or Mae\or Mezheven\or
- Gouere\or Eost\or Gwengolo\or Here\or Du\or Kerzu\fi
- \space\number\year}}
-
-\def\noextras@breton{%
- \nobreton@punctuation%
- }
-
-\def\blockextras@breton{%
- \breton@punctuation%
- }
-
-\def\inlineextras@breton{%
- \breton@punctuation%
- }
-
-% \end{macrocode}
-% \iffalse
-%</gloss-breton.ldf>
-%<*gloss-british.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-british.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-british.ldf}[polyglossia: module for British English]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{english}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-british.ldf>
-%<*gloss-bs.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-bs.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-bs.ldf}[polyglossia: module for bs (Bosnian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{bosnian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-bs.ldf>
-%<*gloss-bulgarian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-bulgarian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-bulgarian.ldf}[polyglossia: module for Bulgarian]
-\PolyglossiaSetup{bulgarian}{
- bcp47=bg,
- bcp47-language=bg,
- bcp47-region=BG,
- bcp47-script=Cyrl,
- script=Cyrillic,
- scripttag=cyrl,
- langtag=BGR,
- hyphennames={bulgarian},
- hyphenmins={2,2},
- frenchspacing=true,
- fontsetup
- %TODO localalph=bulgarian@alph
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{bulgarian}{bg}
-
-\def\bulgarian@Alph#1{%
- \ifcase#1\or
- А\or Б\or В\or Г\or Д\or Е\or Ж\or
- З\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}{bulgarian@Alph}\fi}%
-
-\def\bulgarian@alph#1{%
- \ifcase#1\or
- а\or б\or в\or г\or д\or е\or ж\or
- з\or и\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}{bulgarian@alph}\fi}%
-
-\def\bulgarian@numbers{%
- \let\@Alph\bulgarian@Alph%
- \let\@alph\bulgarian@alph%
- }
-
-\def\nobulgarian@numbers{%
- \let\@Alph\latin@Alph%
- \let\@alph\latin@alph%
-}
-
-\def\captionsbulgarian{%
- \def\refname{Литература}%
- \def\abstractname{Абстракт}%
- \def\bibname{Библиография}%
- \def\prefacename{Предговор}%
- \def\chaptername{Глава}%
- \def\appendixname{Приложение}%
- \def\contentsname{Съдържание}%
- \def\listfigurename{Списък на фигурите}%
- \def\listtablename{Списък на таблиците}%
- \def\indexname{Азбучен указател}%
- \def\figurename{Фигура}%
- \def\tablename{Таблица}%
- %\def\thepart{}%
- %\def\partname{}%
- \def\pagename{Стр.}%
- \def\seename{вж.}%
- \def\alsoname{вж.\ също и}%
- \def\enclname{Приложения}%
- \def\ccname{копия}%
- %\def\headtoname{}%
- \def\proofname{Proof}%
- \def\glossaryname{Glossary}%
-}
-
-\def\datebulgarian{%
- \def\today{\number\day~\ifcase\month\or
- януари\or
- февруари\or
- март\or
- април\or
- май\or
- юни\or
- юли\or
- август\or
- септември\or
- октомври\or
- ноември\or
- декември\fi%
- \ \number\year~г.}%
- \def\month@Roman{\expandafter\@Roman\month}%
- \def\todayRoman{\number\day.\,\month@Roman.\,\number\year~г.}%
- }
-
-% \end{macrocode}
-% \iffalse
-%</gloss-bulgarian.ldf>
-%<*gloss-ca.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ca.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ca.ldf}[polyglossia: module for ca (Catalan)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{catalan}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ca.ldf>
-%<*gloss-canadian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-canadian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-canadian.ldf}[polyglossia: module for Canadian English]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{english}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-canadian.ldf>
-%<*gloss-canadien.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-canadien.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-canadien.ldf}[polyglossia: module for Canadian French]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{french}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-canadien.ldf>
-%<*gloss-catalan.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-catalan.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-catalan.ldf}[polyglossia: module for Catalan]
-\PolyglossiaSetup{catalan}{
- bcp47=ca,
- bcp47-language=ca,
- bcp47-script=Latn,
- hyphennames={catalan},
- hyphenmins={2,2},
- langtag=CAT,
- frenchspacing=true,
- indentfirst=true,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{catalan}{ca}
-
-\define@boolkey{catalan}[catalan@]{babelshorthands}[true]{}
-\ifsystem@babelshorthands
- \setkeys{catalan}{babelshorthands=true}
-\else
- \setkeys{catalan}{babelshorthands=false}
-\fi
-
-% Register default options
-\xpg@initialize@gloss@options{catalan}{babelshorthands=false}
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
-
-%%% adapted from Babel's catalan.ldf
-\newdimen\leftllkern \newdimen\rightllkern \newdimen\raiselldim
-
-% we check if char · exists, and use it instead of raised dot:
-\def\xpg@raiseddot{%
- \charifavailable{00B7}{\raise\raiselldim\hbox{.}}%
-}
-
-\def\lgem{%
- \ifmmode
- \csname normal@char\string"\endcsname l%
- \else
- \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt%
- \setbox0\hbox{l}%
- \IfCharIsAvailableTF{00B7}%
- {\setbox2\hbox{\char"00B7}\setbox1\hbox{l}}%
- {\setbox2\hbox{.}\setbox1\hbox{l\/}}%
- \setbox3\hbox{.}%
- \advance\raiselldim by \the\fontdimen5\the\font%
- \advance\raiselldim by -\ht2%
- \leftllkern=-.25\wd0%
- \advance\leftllkern by \wd1%
- \advance\leftllkern by -\wd0%
- \advance\leftllkern by -0.5\wd2%
- \advance\leftllkern by 0.5\wd3%
- \rightllkern=-.25\wd0%
- \advance\rightllkern by -\wd1%
- \advance\rightllkern by \wd0%
- \advance\rightllkern by -0.5\wd2%
- \advance\rightllkern by 0.5\wd3%
- \allowhyphens\discretionary{l-}{l}%
- {\hbox{l}\kern\leftllkern\xpg@raiseddot%
- \kern\rightllkern\hbox{l}}\allowhyphens
- \fi
-}
-
-\def\Lgem{%
- \ifmmode
- \csname normal@char\string"\endcsname L%
- \else
- \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt%
- \setbox0\hbox{L}%
- \IfCharIsAvailableTF{00B7}%
- {\setbox2\hbox{\char"00B7}\setbox1\hbox{L}}%
- {\setbox2\hbox{.}\setbox1\hbox{L\/}}%
- \setbox3\hbox{.}%
- \advance\raiselldim by .5\ht0%
- \advance\raiselldim by -.5\ht2%
- \leftllkern=-.125\wd0%
- \advance\leftllkern by \wd1%
- \advance\leftllkern by -\wd0%
- \advance\leftllkern by -0.5\wd2%
- \advance\leftllkern by 0.5\wd3%
- \rightllkern=-\wd0%
- \divide\rightllkern by 6%
- \advance\rightllkern by -\wd1%
- \advance\rightllkern by \wd0%
- \advance\rightllkern by -0.5\wd2%
- \advance\rightllkern by 0.5\wd3%
- \allowhyphens\discretionary{L-}{L}%
- {\hbox{L}\kern\leftllkern\xpg@raiseddot%
- \kern\rightllkern\hbox{L}}\allowhyphens
- \fi
-}
-
-\AtBeginDocument{%
- \let\lslash\l
- \let\Lslash\L
- \DeclareRobustCommand\l{\@ifnextchar.\bbl@l{\@ifnextchar·\bbl@l\lslash}}
- \DeclareRobustCommand\L{\@ifnextchar.\bbl@L{\@ifnextchar·\bbl@L\Lslash}}}
-\def\bbl@l#1#2{\lgem}
-\def\bbl@L#1#2{\Lgem}
-
-\def\catalan@shorthands{%
- \xpg@activate@shorthands%
- \def\language@group{catalan}%
- \declare@shorthand{catalan}{"l}{\lgem{}}
- \declare@shorthand{catalan}{"L}{\Lgem{}}
-}
-
-\def\nocatalan@shorthands{%
- \xpg@deactivate@shorthands%
-}
-
-\def\captionscatalan{%
- \def\refname{Referències}%
- \def\abstractname{Resum}%
- \def\bibname{Bibliografia}%
- \def\prefacename{Pròleg}%
- \def\chaptername{Capítol}%
- \def\appendixname{Apèndix}%
- \def\contentsname{Índex}%
- \def\listfigurename{Índex de figures}%
- \def\listtablename{Índex de taules}%
- \def\indexname{Índex alfabètic}%
- \def\figurename{Figura}%
- \def\tablename{Taula}%
- %\def\thepart{}%
- \def\partname{Part}%
- \def\pagename{Pàgina}%
- \def\seename{Vegeu}%
- \def\alsoname{Vegeu també}%
- \def\enclname{Adjunt}%
- \def\ccname{Còpies a}%
- \def\headtoname{A}%
- \def\proofname{Demostració}%
- \def\glossaryname{Glossari}%
- }
-\def\datecatalan{%
- \def\today{\number\day~\ifcase\month\or
- de gener\or de febrer\or de març\or d'abril\or de maig\or
- de juny\or de juliol\or d'agost\or de setembre\or d'octubre\or
- de novembre\or de desembre\fi
- \space de~\number\year}}
-
-\def\noextras@catalan{%
- \ifcatalan@babelshorthands\nocatalan@shorthands\fi%
-}
-
-\def\blockextras@catalan{%
- \ifcatalan@babelshorthands\catalan@shorthands\else\nocatalan@shorthands\fi%
-}
-
-\def\inlineextras@catalan{%
- \ifcatalan@babelshorthands\catalan@shorthands\else\nocatalan@shorthands\fi%
-}
-% \end{macrocode}
-% \iffalse
-%</gloss-catalan.ldf>
-%<*gloss-chinese.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-chinese.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-chinese.ldf}[polyglossia: module for Chinese]
-
-\PolyglossiaSetup{chinese}{
- bcp47=zh,
- bcp47-language=zh,
- bcp47-region=CN,
- bcp47-script=Hans,
- script=CJK,
- scripttag=hani,
- language={Chinese Simplified},
- langtag=ZHS,
- hyphennames={nohyphenation},
- frenchspacing=false,
- fontsetup=true,
- localnumeral=chinesenumerals
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{chinese}{zh}
-\setlanguagealias*[variant=simplified]{chinese}{zh-CN}
-\setlanguagealias*[variant=traditional]{chinese}{zh-TW}
-
-\providebool{chinese@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}%
- }%
-}
-
-
-\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'}}
-
-% Register default options
-\xpg@initialize@gloss@options{chinese}{variant=cn,numerals=arabic}
-%\xpg@initialize@gloss@options{chinese}{variant=tw,numerals=arabic}
-% Register alias options
-\xpg@set@alias@values{chinese}{variant}{cn}{simplified}
-\xpg@set@alias@values{chinese}{variant}{tw}{traditional}
-
-
-\def\chinese@capsformat{%
- \def\@seccntformat##1{%
- \csname pre##1\endcsname%
- \csname the##1\endcsname%
- \csname post##1\endcsname%
- }%
- \ifchinese@traditional
- \def\postsection{節\space}%
- \def\postsubsection{節\space}%
- \def\postsubsubsection{節\space}%
- \else
- \def\postsection{节\space}%
- \def\postsubsection{节\space}%
- \def\postsubsubsection{节\space}%
- \fi
- \def\presection{第}%
- \def\presubsection{第}%
- \def\presubsubsection{第}%
-}
-
-\def\captionschinese{%
- \ifchinese@traditional
- \captions@chinese@traditional
- \else
- \captions@chinese@simplified
- \fi
-}
-
-\def\captions@chinese@traditional{%
- \def\contentsname{目錄}%
- \def\listfigurename{插圖}%
- \def\listtablename{表格}%
- \def\figurename{圖}%
- \def\tablename{表}%
- \def\abstractname{摘要}%
- \def\prefacename{前言}%
- \def\indexname{索引}%
- \def\bibname{參考文獻}%
- \def\appendixname{附錄}%
- \def\proofname{證明}%
- \def\refname{參考文獻}%
- \def\partname##1##2{第##1##2 部分}%
- \def\chaptername##1##2{第##1##2 章}%
- \def\pagename##1##2{第##1##2 頁}%
- \def\seename{參照}%
- \def\alsoname{參照}%
- \def\enclname{附件}%
- \def\ccname{抄送}%
- \def\headtoname{收件人}%
- \def\\glossaryname{詞彙表}%
-}
-\def\captions@chinese@simplified{%
- \def\contentsname{目录}%
- \def\listfigurename{插图}%
- \def\listtablename{表格}%
- \def\figurename{图}%
- \def\tablename{表}%
- \def\abstractname{摘要}%
- \def\prefacename{前言}%
- \def\indexname{索引}%
- \def\bibname{参考文献}%
- \def\appendixname{附录}%
- \def\proofname{证明}%
- \def\refname{参考文献}%
- \def\partname##1##2{第##1##2 部分}%
- \def\chaptername##1##2{第##1##2 章}%
- \def\pagename##1##2{第##1##2 页}%
- \def\seename{参照}%
- \def\alsoname{参照}%
- \def\enclname{附件}%
- \def\ccname{抄送}%
- \def\headtoname{收件人}%
- \def\\glossaryname{词汇表}%
-}
-
-\newcount\c@TempJNum%
-
-\def\@ChineseDigit#1{%
- \ifcase#1\or 一\or 二\or 三\or 四\or 五\or%
- 六\or 七\or 八\or 九\or 十\or%
- 十一\or 十二\or 十三\or 十四\or 十五\or%
- 十六\or 十七\or 十八\or 十九\or 二十\or%
- 二十一\or 二十二\or 二十三\or 二十四\or 二十五\or%
- 二十六\or 二十七\or 二十八\or 二十九\or 三十\or%
- 三十一\or 三十二\or 三十三\or 三十四\or 三十五\or%
- 三十六\or 三十七\or 三十八\or 三十九\or 四十\or%
- 四十一\or 四十二\or 四十三\or 四十四\or 四十五\or%
- 四十六\or 四十七\or 四十八\or 四十九\or 五十\or%
- 五十一\or 五十二\or 五十三\or 五十四\or 五十五\or%
- 五十六\or 五十七\or 五十八\or 五十九\or 六十\or%
- 六十一\or 六十二\or 六十三\or 六十四\or 六十五\or%
- 六十六\or 六十七\or 六十八\or 六十九\or 七十\or%
- 七十一\or 七十二\or 七十三\or 七十四\or 七十五\or%
- 七十六\or 七十七\or 七十八\or 七十九\or 八十\or%
- 八十一\or 八十二\or 八十三\or 八十四\or 八十五\or%
- 八十六\or 八十七\or 八十八\or 八十九\or 九十\or%
- 九十一\or 九十二\or 九十三\or 九十四\or 九十五\or%
- 九十六\or 九十七\or 九十八\or 九十九%
- \else
- \@ctrerr%
- \fi\relax%
-}
-
-\def\@ChineseNum#1{%
- \c@TempJNum=#1\divide\c@TempJNum by 1000\relax%
- \ifnum\c@TempJNum=\z@\c@TempJNum=#1%
- \divide\c@TempJNum by 100\relax%
- \ifnum\c@TempJNum=\z@\@ChineseDigit{#1}\relax%
- \else
- \ifcase\c@TempJNum\or 百\or 二百\or 三百\or 四百\or 五百\or
- 六百\or 七百\or 八百\or 九百%
- \fi
- \c@TempJNum=#1\divide\c@TempJNum by 100\multiply\c@TempJNum by -100\advance\c@TempJNum#1\@ChineseDigit\c@TempJNum\relax%
- \fi%
- \else
- \ifcase\c@TempJNum\or 千\or 二千\or 三千\or 四千\or 五千\or
- 六千\or 七千\or 八千\or 九千%
- \fi
- \c@TempJNum=#1\divide\c@TempJNum by 1000\multiply\c@TempJNum by -1000\advance\c@TempJNum#1\divide\c@TempJNum by 100\relax%
- \ifnum\c@TempJNum=\z@\c@TempJNum=#1%
- \divide\c@TempJNum by 100\multiply\c@TempJNum by -100\advance\c@TempJNum#1\@ChineseDigit\c@TempJNum\relax%
- \else
- \ifcase\c@TempJNum\or 百\or 二百\or 三百\or 四百\or 五百\or
- 六百\or 七百\or 八百\or 九百%
- \fi
- \c@TempJNum=#1\divide\c@TempJNum by 100\multiply\c@TempJNum by -100\advance\c@TempJNum#1\@ChineseDigit\c@TempJNum\relax%
- \fi
- \fi
-}
-
-\def\@chinesenumber#1{%
- \@tempcnta=#1%
- \ifnum\@tempcnta=\z@{〇}%
- \else
- \ifnum\@tempcnta<\z@{負}%
- \multiply\@tempcnta by -1%
- \fi
- \@tempcntb=\@tempcnta\divide\@tempcntb by 10000\relax%
- \ifnum\@tempcntb=\z@\@ChineseNum%
- \@tempcnta%
- \else
- \@tempcntb=\@tempcnta\divide\@tempcntb by 100000000\relax%
- \ifnum\@tempcntb=\z@\@tempcntb=\@tempcnta%
- \divide\@tempcntb by 10000%
- \@ChineseNum\@tempcntb{万}\@tempcntb=\@tempcnta%
- \divide\@tempcntb by 10000\multiply\@tempcntb by -10000%
- \advance\@tempcntb\@tempcnta\relax\@ChineseNum\@tempcntb%
- \else
- \@ChineseNum\@tempcntb{億}\@tempcntb=\@tempcnta%
- \divide\@tempcntb by 100000000\multiply\@tempcntb by -100000000%
- \advance\@tempcntb\@tempcnta\divide\@tempcntb by 10000\relax%
- \ifnum\@tempcntb=\z@%
- \else
- \@ChineseNum\@tempcntb{万}%
- \fi
- \@tempcntb=\@tempcnta\divide\@tempcntb by 10000%
- \multiply\@tempcntb by -10000\advance\@tempcntb\@tempcnta%
- \@ChineseNum\@tempcntb%
- \fi
- \fi
- \fi
-}
-
-
-\newcommand{\chinesenumerals}[2]{\chinesenumber{#2}}
-
-\def\chinesenumber#1{%
- \ifchinese@numerals
- \@chinesenumber{\number#1}%
- \else
- \number#1%
- \fi}
-
-\let\chinesenumeral=\chinesenumber
-
-\def\datechinese{%
- \def\today{%
- \ifchinese@numerals
- \@chinesenumber{\number\year}%
- \else
- \number\year\,%
- \fi
- {年}%
- \ifchinese@numerals
- \@chinesenumber{\number\month}%
- \else
- \,\number\month\,%
- \fi
- {月}%
- \ifchinese@numerals
- \@chinesenumber{\number\day}%
- \else
- \,\number\day\,%
- \fi
- {日}%
- }%
-}
-
-\def\noextras@chinese{%
- \chinese@capsformat%
-}
-
-\def\blockextras@chinese{%
- \chinese@capsformat%
-}
-
-\def\inlineextras@chinese{%
- \chinese@capsformat%
-}
-% Based on contributions of Toru Inagaki, Norio Iwase, François Charette
-
-% \end{macrocode}
-% \iffalse
-%</gloss-chinese.ldf>
-%<*gloss-ckb-Arab.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ckb-Arab.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ckb-Arab.ldf}[polyglossia: module for ckb-Arab (Kurdish)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{kurdish}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ckb-Arab.ldf>
-%<*gloss-ckb-Latn.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ckb-Latn.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ckb-Latn.ldf}[polyglossia: module for ckb-Latn (Kurdish)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{kurdish}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ckb-Latn.ldf>
-%<*gloss-ckb.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ckb.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ckb.ldf}[polyglossia: module for ckb (Kurdish)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{kurdish}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ckb.ldf>
-%<*gloss-cop.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-cop.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-cop.ldf}[polyglossia: module for cop (Coptic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{coptic}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-cop.ldf>
-%<*gloss-coptic.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-coptic.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-coptic.ldf}[polyglossia: module for Coptic]
-\PolyglossiaSetup{coptic}{
- bcp47=cop,
- bcp47-language=cop,
- bcp47-region=CN,
- bcp47-script=Copt,
- script=Coptic,
- scripttag=copt,
- langtag=COP,
- hyphennames={coptic},
- hyphenmins={2,2},
- fontsetup=true
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{coptic}{cop}
-
-%\def\captionscoptic{%
-% \def\refname{<++>}%
-% \def\abstractname{<++>}%
-% \def\bibname{<++>}%
-% \def\prefacename{<++>}%
-% \def\chaptername{<++>}%
-% \def\appendixname{<++>}%
-% \def\contentsname{<++>}%
-% \def\listfigurename{<++>}%
-% \def\listtablename{<++>}%
-% \def\indexname{<++>}%
-% \def\figurename{<++>}%
-% \def\tablename{<++>}%
-% \def\thepart{}%
-% \def\partname{<++>}%
-% \def\pagename{<++>}%
-% \def\seename{<++>}%
-% \def\alsoname{<++>}%
-% \def\enclname{<++>}%
-% \def\ccname{<++>}%
-% \def\headtoname{<++>}%
-% \def\proofname{<++>}%
-% \def\glossaryname{<++>}%
-% }
-%\def\datecoptic{%
-% \def\today{<++>}%
-% }
-
-% \end{macrocode}
-% \iffalse
-%</gloss-coptic.ldf>
-%<*gloss-croatian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-croatian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-croatian.ldf}[polyglossia: module for Croatian]
-\PolyglossiaSetup{croatian}{
- bcp47=hr,
- bcp47-language=hr,
- bcp47-script=Latn,
- langtag=HRV,
- hyphennames={croatian},
- hyphenmins={2,2}, % aligned with https://ctan.org/pkg/hrhyph patterns and http://lebesgue.math.hr/~nenad/Diplomski/Maja_Ribaric_2011.pdf
- frenchspacing=true, % recommendation from Damir Bralić
- indentfirst=false, % recommendation from Damir Bralić
- fontsetup=true
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{croatian}{hr}
-
-\ifluatex
- \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]{}
-
-% Register default options
-\xpg@initialize@gloss@options{croatian}{babelshorthands=false,disabledigraphs=false,
- splithyphens=true,localalph=true}
-
-\ifsystem@babelshorthands
- \setkeys{croatian}{babelshorthands=true}
-\else
- \setkeys{croatian}{babelshorthands=false}
-\fi
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
-
-\let\xpg@hyphen@char-
-\def\croatian@@splhyphen#1{%
- \def\croatian@sh@tmp{%
- \ifx\croatian@sh@next\xpg@hyphen@char#1%
- \else\expandafter\croatian@@@splhyphen{#1}\fi%
- }%
- \futurelet\croatian@sh@next\croatian@sh@tmp%
-}
-
-\def\croatian@@@splhyphen#1{%
- \ifnum\hyphenchar \font>0%
- \kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}%
- \nobreak\hskip\z@%
- \else%
- #1%
- \fi%
-}
-
-\def\croatian@splhyphen{%
- \croatian@@splhyphen{-}%
-}
-
-\def\croatian@shorthands{%
- \xpg@activate@shorthands%
- \def\language@group{croatian}%
- \declare@shorthand{croatian}{"=}{\penalty\@M-\hskip\z@skip}%
- \declare@shorthand{croatian}{""}{\hskip\z@skip}%
- \declare@shorthand{croatian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
- \declare@shorthand{croatian}{"-}{\nobreak\-\bbl@allowhyphens}%
- \declare@shorthand{croatian}{"|}{%
- \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
- \bbl@allowhyphens}{}%
- }%
- \declare@shorthand{croatian}{"/}{\textormath
- {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}%
- \declare@shorthand{croatian}{"`}{„}%
- \declare@shorthand{croatian}{"'}{”}%
- \declare@shorthand{croatian}{"<}{«}%
- \declare@shorthand{croatian}{">}{»}%
- \declare@shorthand{croatian}{"D}{\xpg@hr@digraph{D}}%
- \declare@shorthand{croatian}{"d}{\xpg@hr@digraph{d}}%
- \declare@shorthand{croatian}{"L}{\xpg@hr@digraph{L}}%
- \declare@shorthand{croatian}{"l}{\xpg@hr@digraph{l}}%
- \declare@shorthand{croatian}{"N}{\xpg@hr@digraph{N}}%
- \declare@shorthand{croatian}{"n}{\xpg@hr@digraph{n}}%
-}
-
-\def\nocroatian@shorthands{%
- \xpg@deactivate@shorthands%
-}
-
-\ifxetex
- % splithyphens
- \newXeTeXintercharclass\croatian@hyphen % -
- \newXeTeXintercharclass\croatian@nonsyllabicpreposition%
-\fi
-
-\def\croatian@hyphens{%
- \ifluatex
- \AfterPreamble{\enablesplithyphens{croatian}}%
- \else
- \XeTeXinterchartokenstate=1
- \XeTeXcharclass `\- \croatian@hyphen
- \XeTeXinterchartoks \z@ \croatian@hyphen = {\croatian@@splhyphen}% "-" -> "\croatian@@splhyphen-"
- % necessary if used together with vlna:
- \XeTeXinterchartoks \croatian@nonsyllabicpreposition \croatian@hyphen = {\croatian@@splhyphen}% "-" -> "\croatian@@splhyphen-"
- \fi%
-}
-
-\def\nocroatian@hyphens{%
- \ifluatex
- \AfterPreamble{\disablesplithyphens{croatian}}%
- \else
- \XeTeXcharclass `\- \z@
- \fi%
-}
-
-\newcommand*\hr@charifavailable[3]{%
- \ifcroatian@disabledigraphs% no notion of digraphs at all
- \bgroup#3\egroup%
- \else% digraph...
- \charifavailable{#1}{#2}% ... either a Unicode original or a mimic of one
- \fi%
-}
-
-% Provide croatian digraphs if available in current font
-\protected\def\xpg@hr@digraph#1#2{%
- \bgroup%
- % 1. DŽ, Dž and dž
- \ifx#1D%
- \ifx#2Z\relax%
- \hr@charifavailable{01C4}{D\nobreak Ž}{DŽ}%
- \else%
- \ifx#2z\relax
- \hr@charifavailable{01C5}{D\nobreak ž}{Dž}%
- \else
- D#2%
- \fi%
- \fi%
- \fi%
- \ifx#1d%
- \ifx#2z\relax
- \hr@charifavailable{01C6}{d\nobreak ž}{dž}%
- \else
- d#2%
- \fi%
- \fi%
- % 2. LJ, Lj and lj
- \ifx#1L%
- \ifx#2J\relax%
- \hr@charifavailable{01C7}{L\nobreak J}{LJ}%
- \else%
- \ifx#2j\relax
- \hr@charifavailable{01C8}{L\nobreak j}{Lj}%
- \else
- L#2%
- \fi%
- \fi%
- \fi%
- \ifx#1l%
- \ifx#2j\relax
- \hr@charifavailable{01C9}{l\nobreak j}{lj}%
- \else
- l#2%
- \fi%
- \fi%
- % 2. NJ, Nj and nj
- \ifx#1N%
- \ifx#2J\relax%
- \hr@charifavailable{01CA}{N\nobreak J}{NJ}%
- \else%
- \ifx#2j\relax
- \hr@charifavailable{01CB}{N\nobreak j}{Nj}%
- \else
- N#2%
- \fi%
- \fi%
- \fi%
- \ifx#1n%
- \ifx#2j\relax
- \hr@charifavailable{01CC}{n\nobreak j}{nj}%
- \else
- n#2%
- \fi%
- \fi%
- \egroup%
-}
-
-\def\captionscroatian{%
- \def\prefacename{Predgovor}%
- \def\refname{Literatura}%
- \def\abstractname{Sažetak}%
- \def\bibname{Bibliografija}%
- \def\chaptername{Poglav\xpg@hr@digraph{l}{j}e}%
- \def\appendixname{Dodatak}%
- \def\contentsname{Sadržaj}%
- \def\listfigurename{Popis slika}%
- \def\listtablename{Popis tablica}%
- \def\indexname{Kazalo}%
- \def\figurename{Slika}%
- \def\tablename{Tablica}%
- \def\partname{Dio}%
- \def\enclname{Prilozi}%
- \def\ccname{Kopija}%
- \def\headtoname{Prima}%
- \def\pagename{Stranica}%
- \def\seename{Vidjeti}%
- \def\alsoname{Također vidjeti}%
- \def\proofname{Dokaz}%
- \def\glossaryname{Pojmovnik}%
-}
-
-\def\datecroatian{%
- \def\today{\number\day.~\ifcase\month\or
- siječ\xpg@hr@digraph{n}{j}a\or ve\xpg@hr@digraph{l}{j}ače\or
- ožujka\or trav\xpg@hr@digraph{n}{j}a\or svib\xpg@hr@digraph{n}{j}a\or
- lip\xpg@hr@digraph{n}{j}a\or srp\xpg@hr@digraph{n}{j}a\or
- kolovoza\or rujna\or listopada\or studenoga\or prosinca\fi \space \number\year.}%
-}
-
-\def\croatian@@alph#1{%
- \ifcase#1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or l\or
- m\or n\or o\or p\or r\or s\or t\or u\or v\or z\else#1\fi
-}
-\def\croatian@@Alph#1{%
- \ifcase#1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\or
- M\or N\or O\or P\or R\or S\or T\or U\or V\or Z\else#1\fi
-}
-
-\def\croatian@alph#1{\expandafter\croatian@@alph\csname c@#1\endcsname}
-\def\croatian@Alph#1{\expandafter\croatian@@Alph\csname c@#1\endcsname}
-
-\def\noextras@croatian{%
- \ifcroatian@babelshorthands\nocroatian@shorthands\fi%
- \nocroatian@hyphens%
- \let\alph\latinalph\let\Alph\latinAlph%
-}
-
-\def\blockextras@croatian{%
- \ifcroatian@babelshorthands\croatian@shorthands\else\nocroatian@shorthands\fi%
- \ifcroatian@splithyphens\croatian@hyphens\else\nocroatian@hyphens\fi%
- \ifcroatian@localalph\let\alph\croatian@alph\let\Alph\croatian@Alph\fi%
-}
-
-\def\inlineextras@croatian{%
- \ifcroatian@babelshorthands\croatian@shorthands\else\nocroatian@shorthands\fi%
- \ifcroatian@splithyphens\croatian@hyphens\else\nocroatian@hyphens\fi%
- \ifcroatian@localalph\let\alph\croatian@alph\let\Alph\croatian@Alph\fi%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-croatian.ldf>
-%<*gloss-cy.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-cy.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-cy.ldf}[polyglossia: module for cy (Welsh)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{welsh}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-cy.ldf>
-%<*gloss-cz.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-cz.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-cz.ldf}[polyglossia: module for cz (Czech)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{czech}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-cz.ldf>
-%<*gloss-czech.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-czech.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-czech.ldf}[polyglossia: module for Czech]
-
-\PolyglossiaSetup{czech}{
- bcp47=cz,
- bcp47-language=cz,
- bcp47-region=CZ,
- bcp47-script=Latn,
- hyphennames={czech},
- hyphenmins={2,2},
- langtag=CSY,
- frenchspacing=true,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{czech}{cz}
-
-\ifluatex
- \RequirePackage{luavlna}
-\fi
-
-\define@boolkey{czech}[czech@]{babelshorthands}[true]{}
-
-\define@boolkey{czech}[czech@]{splithyphens}[true]{}
-
-\define@boolkey{czech}[czech@]{vlna}[true]{}
-
-% Register default options
-\xpg@initialize@gloss@options{czech}{babelshorthands=false,splithyphens=true,vlna=true}
-
-\ifsystem@babelshorthands
- \setkeys{czech}{babelshorthands=true}
-\else
- \setkeys{czech}{babelshorthands=false}
-\fi
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
-
-\def\czech@@splithyphen#1{%
- \def\czech@sh@tmp{%
- \if\czech@sh@next-#1%
- \else\expandafter\czech@@@splithyphen{#1}\fi%
- }%
- \futurelet\czech@sh@next\czech@sh@tmp%
-}
-
-\def\czech@@@splithyphen#1{%
- \ifnum\hyphenchar \font>0%
- \kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}%
- \nobreak\hskip\z@%
- \else%
- #1%
- \fi%
-}
-
-\def\czech@splithyphen{%
- \czech@@splithyphen{-}%
-}
-
-\def\czech@shorthands{%
- \xpg@activate@shorthands%
- \def\language@group{czech}%
- \declare@shorthand{czech}{"=}{\czech@splithyphen}%
- \declare@shorthand{czech}{"`}{„}%
- \declare@shorthand{czech}{"'}{“}%
- \declare@shorthand{czech}{"<}{«}%
- \declare@shorthand{czech}{">}{»}%
-}
-
-\def\noczech@shorthands{%
- \xpg@deactivate@shorthands%
-}
-
-\ifxetex
- % splithyphens
- \newXeTeXintercharclass\czech@hyphen % -
- % vlna
- \newXeTeXintercharclass\czech@openpunctuation
- \newXeTeXintercharclass\czech@nonsyllabicpreposition
- \ifdefined\e@alloc@intercharclass@top
- \chardef\czech@boundary=\e@alloc@intercharclass@top
- \else
- \ifdefined\XeTeXinterwordspaceshaping
- \chardef\czech@boundary=4095 %
- \def\newXeTeXintercharclass{%
- \e@alloc\XeTeXcharclass\chardef
- \xe@alloc@intercharclass\m@ne\@ucharclass@boundary}%
- \else
- \chardef\czech@boundary=255
- \fi
- \fi
-\fi
-
-\def\czech@hyphens{%
- \ifluatex
- \AfterPreamble{\enablesplithyphens{czech}}%
- \else
- \XeTeXinterchartokenstate=1
- \XeTeXcharclass `\- \czech@hyphen
- \XeTeXinterchartoks \z@ \czech@hyphen = {\czech@@splithyphen}% "-" -> "\czech@@splithyphen-"
- % necessary if used together with vlna:
- \XeTeXinterchartoks \czech@nonsyllabicpreposition \czech@hyphen = {\czech@@splithyphen}% "-" -> "\czech@@splithyphen-"
- \fi%
-}
-
-\def\noczech@hyphens{%
- \ifluatex
- \AfterPreamble{\disablesplithyphens{czech}}%
- \else
- \XeTeXcharclass `\- \z@
- \fi%
-}
-
-% Add nonbreakable space after single-letter word to
-% prevent them to land at the end of a line
-% vlna code taken and adapted from xevlna.sty
-\ifxetex
- \def\czech@nointerchartoks{\let\czech@interchartoks\czech@PreCSpreposition}%
- \def\czech@PreCSpreposition{%
- \def\next{}%
- \ifnum\catcode`\ =10 % nothing will be done in verbatim
- \ifmmode % nothing in math
- \else
- \let\czech@interchartoks\czech@nointerchartoks
- \let\next\czech@ExamineCSpreposition
- \fi\fi
- \next%
- }%
- \def\czech@ExamineCSpreposition #1{#1\futurelet\next\czech@ProcessCSpreposition}%
- \def\czech@ProcessCSpreposition{\ifx\next\czech@XeTeXspace\nobreak\fi}%
- \futurelet\czech@XeTeXspace{ }\czech@nointerchartoks
-\fi
-
-\def\czech@vlna{%
- \ifluatex
- \preventsingleon
- \else
- % Code taken and adapted from xevlna.sty
- \XeTeXinterchartokenstate=1
- \XeTeXcharclass `\( \czech@openpunctuation
- \XeTeXcharclass `\[ \czech@openpunctuation
- \XeTeXcharclass `\„ \czech@openpunctuation
- \XeTeXcharclass `\» \czech@openpunctuation
- \XeTeXcharclass `\K \czech@nonsyllabicpreposition
- \XeTeXcharclass `\k \czech@nonsyllabicpreposition
- \XeTeXcharclass `\S \czech@nonsyllabicpreposition
- \XeTeXcharclass `\s \czech@nonsyllabicpreposition
- \XeTeXcharclass `\V \czech@nonsyllabicpreposition
- \XeTeXcharclass `\v \czech@nonsyllabicpreposition
- \XeTeXcharclass `\Z \czech@nonsyllabicpreposition
- \XeTeXcharclass `\z \czech@nonsyllabicpreposition
- \XeTeXcharclass `\O \czech@nonsyllabicpreposition
- \XeTeXcharclass `\o \czech@nonsyllabicpreposition
- \XeTeXcharclass `\U \czech@nonsyllabicpreposition
- \XeTeXcharclass `\u \czech@nonsyllabicpreposition
- \XeTeXcharclass `\A \czech@nonsyllabicpreposition
- \XeTeXcharclass `\a \czech@nonsyllabicpreposition
- \XeTeXcharclass `\I \czech@nonsyllabicpreposition
- \XeTeXcharclass `\i \czech@nonsyllabicpreposition
- \XeTeXinterchartoks \czech@boundary \czech@nonsyllabicpreposition {\czech@interchartoks}%
- \XeTeXinterchartoks \czech@openpunctuation \czech@nonsyllabicpreposition {\czech@interchartoks}%
- \fi
-}
-
-\def\noczech@vlna{%
- \ifluatex
- \preventsingleoff
- \else
- \XeTeXcharclass`\(\z@
- \XeTeXcharclass`\[\z@
- \XeTeXcharclass`\„\z@
- \XeTeXcharclass`\»\z@
- \XeTeXcharclass`\K\z@
- \XeTeXcharclass`\k\z@
- \XeTeXcharclass`\S\z@
- \XeTeXcharclass`\s\z@
- \XeTeXcharclass`\V\z@
- \XeTeXcharclass`\v\z@
- \XeTeXcharclass`\Z\z@
- \XeTeXcharclass`\z\z@
- \XeTeXcharclass`\O\z@
- \XeTeXcharclass`\o\z@
- \XeTeXcharclass`\U\z@
- \XeTeXcharclass`\u\z@
- \XeTeXcharclass`\A\z@
- \XeTeXcharclass`\a\z@
- \XeTeXcharclass`\I\z@
- \XeTeXcharclass`\i\z@
- \fi
-}
-
-
-\def\captionsczech{%
- \def\refname{Reference}%
- \def\abstractname{Abstrakt}%
- \def\bibname{Literatura}%
- \def\prefacename{Předmluva}%
- \def\chaptername{Kapitola}%
- \def\appendixname{Dodatek}%
- \def\contentsname{Obsah}%
- \def\listfigurename{Seznam obrázků}%
- \def\listtablename{Seznam tabulek}%
- \def\indexname{Index}%
- \def\figurename{Obrázek}%
- \def\tablename{Tabulka}%
- %\def\thepart{}%
- \def\partname{Část}%
- \def\pagename{Strana}%
- \def\seename{viz}%
- \def\alsoname{viz}%
- \def\enclname{Příloha}%
- \def\ccname{Na vědomí:}%
- \def\headtoname{Komu}%
- \def\proofname{Důkaz}%
- \def\glossaryname{Slovník}%was Glosář
-}
-
-\def\dateczech{%
- \def\today{\number\day.~\ifcase\month\or
- ledna\or února\or března\or dubna\or května\or
- června\or července\or srpna\or září\or
- října\or listopadu\or prosince\fi
- \space \number\year}%
-}
-
-\def\noextras@czech{%
- \ifczech@babelshorthands\noczech@shorthands\fi%
- \noczech@hyphens%
- \noczech@vlna%
- \ifxetex\XeTeXinterchartokenstate=0\fi%
-}
-
-\def\blockextras@czech{%
- \ifczech@babelshorthands\czech@shorthands\else\noczech@shorthands\fi%
- \ifczech@vlna\czech@vlna\else\noczech@vlna\fi%
- \ifczech@splithyphens\czech@hyphens\else\noczech@hyphens\fi%
-}
-
-\def\inlineextras@czech{%
- \ifczech@babelshorthands\czech@shorthands\else\noczech@shorthands\fi%
- \ifczech@vlna\czech@vlna\else\noczech@vlna\fi%
- \ifczech@splithyphens\czech@hyphens\else\noczech@hyphens\fi%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-czech.ldf>
-%<*gloss-da.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-da.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-da.ldf}[polyglossia: module for da (Danish)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{danish}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-da.ldf>
-%<*gloss-danish.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-danish.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-danish.ldf}[polyglossia: module for Danish]
-\PolyglossiaSetup{danish}{
- bcp47=da,
- bcp47-language=da,
- bcp47-script=Latn,
- hyphennames={danish},
- hyphenmins={2,3},
- langtag=DAN,
- frenchspacing=true,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{danish}{da}
-
-\def\captionsdanish{%
- \def\prefacename{Forord}%
- \def\refname{Litteratur}%
- \def\abstractname{Resumé}%
- \def\bibname{Litteratur}%
- \def\chaptername{Kapitel}%
- \def\appendixname{Bilag}%
- \def\contentsname{Indhold}%
- \def\listfigurename{Figurer}%
- \def\listtablename{Tabeller}%
- \def\indexname{Indeks}%
- \def\figurename{Figur}%
- \def\tablename{Tabel}%
- \def\partname{Del}%
- \def\enclname{Vedlagt}%
- \def\ccname{Kopi til}% or Kopi sendt til
- \def\headtoname{Til}% in letter
- \def\pagename{Side}%
- \def\seename{Se}%
- \def\alsoname{Se også}%
- \def\proofname{Bevis}%
- \def\glossaryname{Gloseliste}%
-}
-
-\def\datedanish{%
- \def\today{\number\day.~\ifcase\month\or
- januar\or februar\or marts\or april\or maj\or juni\or
- juli\or august\or september\or oktober\or november\or december\fi
- \space\number\year}%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-danish.ldf>
-%<*gloss-de-AT-1901.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de-AT-1901.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de-AT-1901.ldf>
-%<*gloss-de-AT-1996.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de-AT-1996.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de-AT-1996.ldf>
-%<*gloss-de-AT.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de-AT.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de-AT.ldf>
-%<*gloss-de-CH-1901.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de-CH-1901.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de-CH-1901.ldf>
-%<*gloss-de-CH-1996.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de-CH-1996.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de-CH-1996.ldf>
-%<*gloss-de-CH.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de-CH.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de-CH.ldf>
-%<*gloss-de-DE-1901.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de-DE-1901.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de-DE-1901.ldf>
-%<*gloss-de-DE-1996.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de-DE-1996.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de-DE-1996.ldf>
-%<*gloss-de-DE.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de-DE.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de-DE.ldf>
-%<*gloss-de-Latf-AT-1901.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de-Latf-AT-1901.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de-Latf-AT-1901.ldf>
-%<*gloss-de-Latf-AT-1996.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de-Latf-AT-1996.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de-Latf-AT-1996.ldf>
-%<*gloss-de-Latf-AT.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de-Latf-AT.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de-Latf-AT.ldf>
-%<*gloss-de-Latf-CH-1901.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de-Latf-CH-1901.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de-Latf-CH-1901.ldf>
-%<*gloss-de-Latf-CH-1996.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de-Latf-CH-1996.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de-Latf-CH-1996.ldf>
-%<*gloss-de-Latf-CH.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de-Latf-CH.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de-Latf-CH.ldf>
-%<*gloss-de-Latf-DE-1901.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de-Latf-DE-1901.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de-Latf-DE-1901.ldf>
-%<*gloss-de-Latf-DE-1996.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de-Latf-DE-1996.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de-Latf-DE-1996.ldf>
-%<*gloss-de-Latf-DE.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de-Latf-DE.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de-Latf-DE.ldf>
-%<*gloss-de-Latf.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de-Latf.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-de-Latf.ldf}[polyglossia: module for de-Latf (German)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{german}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de-Latf.ldf>
-%<*gloss-de.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-de.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-de.ldf}[polyglossia: module for de (German)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{german}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-de.ldf>
-%<*gloss-divehi.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-divehi.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-divehi.ldf}[polyglossia: module for Divehi]
-
-\RequireBidi
-\PolyglossiaSetup{divehi}{
- bcp47=dv,
- bcp47-language=dv,
- bcp47-script=Thaa,
- script=Thaana,
- scripttag=thaa,
- langtag=DIV,% TODO Support DHV as well?
- direction=RL,
- hyphennames={nohyphenation},
- fontsetup=true
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{divehi}{dv}
-
-%\def\captionsdivehi{%
-% \def\refname{<++>}%
-% \def\abstractname{<++>}%
-% \def\bibname{<++>}%
-% \def\prefacename{<++>}%
-% \def\chaptername{<++>}%
-% \def\appendixname{<++>}%
-% \def\contentsname{<++>}%
-% \def\listfigurename{<++>}%
-% \def\listtablename{<++>}%
-% \def\indexname{<++>}%
-% \def\figurename{<++>}%
-% \def\tablename{<++>}%
-% \def\thepart{}%
-% \def\partname{<++>}%
-% \def\pagename{<++>}%
-% \def\seename{<++>}%
-% \def\alsoname{<++>}%
-% \def\enclname{<++>}%
-% \def\ccname{<++>}%
-% \def\headtoname{<++>}%
-% \def\proofname{<++>}%
-% \def\glossaryname{<++>}%
-% }
-%\def\datedivehi{\def\today{<++>}}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-divehi.ldf>
-%<*gloss-dsb.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-dsb.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-dsb.ldf}[polyglossia: module for dsb (Sorbian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{sorbian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-dsb.ldf>
-%<*gloss-dutch.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-dutch.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-dutch.ldf}[polyglossia: module for Dutch]
-\PolyglossiaSetup{dutch}{
- bcp47=nl,
- bcp47-language=nl,
- bcp47-script=Latn,
- hyphennames={dutch},
- hyphenmins={2,2},
- langtag=NLD,
- frenchspacing=true,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{dutch}{nl}
-
-\define@boolkey{dutch}[dutch@]{babelshorthands}[true]{}
-
-\define@boolkey{dutch}[dutch@]{tremahyphenation}[true]{}
-
-% Register default options
-\xpg@initialize@gloss@options{dutch}{babelshorthands=false,tremahyphenation=true}
-
-\ifsystem@babelshorthands
- \setkeys{dutch}{babelshorthands=true}
-\else
- \setkeys{dutch}{babelshorthands=false}
-\fi
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
-
-\def\xpg@trema#1{\allowhyphens\discretionary{-}{#1}{\"{#1}}\allowhyphens}
-
-\def\xpg@itrema{%
- \textormath{\allowhyphens\discretionary{-}{i}{\"{\i}}\allowhyphens}%
- {\ddot \imath}%
-}
-
-\def\xpg@imtrema{%
- \textormath{\allowhyphens\discretionary{-}{I}{\"{I}}\allowhyphens}%
- {\ddot I}%
-}
-
-\def\dutch@shorthands{%
- \xpg@activate@shorthands%
- \def\language@group{dutch}%
- \declare@shorthand{dutch}{"a}{\textormath{\xpg@trema{a}}{\ddot a}}%
- \declare@shorthand{dutch}{"e}{\textormath{\xpg@trema{e}}{\ddot e}}%
- \declare@shorthand{dutch}{"i}{\xpg@itrema}%
- \declare@shorthand{dutch}{"o}{\textormath{\xpg@trema{o}}{\ddot o}}%
- \declare@shorthand{dutch}{"u}{\textormath{\xpg@trema{u}}{\ddot u}}%
- \declare@shorthand{dutch}{"A}{\textormath{\xpg@trema{A}}{\ddot A}}%
- \declare@shorthand{dutch}{"E}{\textormath{\xpg@trema{E}}{\ddot E}}%
- \declare@shorthand{dutch}{"I}{\xpg@imtrema}%
- \declare@shorthand{dutch}{"O}{\textormath{\xpg@trema{O}}{\ddot O}}%
- \declare@shorthand{dutch}{"U}{\textormath{\xpg@trema{U}}{\ddot U}}%
- \declare@shorthand{dutch}{"y}{\textormath{\ij{}}{\ddot y}}%
- \declare@shorthand{dutch}{"Y}{\textormath{\IJ{}}{\ddot Y}}%
- \declare@shorthand{dutch}{"-}{\nobreak-\bbl@allowhyphens}%
- \declare@shorthand{dutch}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
- \declare@shorthand{dutch}{"|}{%
- \textormath{\discretionary{-}{}{\kern.03em}}{}}%
- \declare@shorthand{dutch}{""}{\hskip\z@skip}%
- \declare@shorthand{dutch}{"/}{\textormath
- {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}%
- \def\-{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}%
-}
-
-\def\nodutch@shorthands{%
- \xpg@deactivate@shorthands%
- \def\-{\discretionary{-}{}{}}% << original def in latex.ltx
-}
-
-%
-% Support proper hyphenation of tremata: after hyphenation,
-% the trema is omitted, e.g. geëxecuteerd > ge-executeerd
-% We support this by making the respective letters active.
-%
-% Save catcodes of trema characters for later restorage
-\chardef\xpg@saved@auml@catcode\catcode`ä
-\chardef\xpg@saved@euml@catcode\catcode`ë
-\chardef\xpg@saved@iuml@catcode\catcode`ï
-\chardef\xpg@saved@ouml@catcode\catcode`ö
-\chardef\xpg@saved@uuml@catcode\catcode`ü
-\chardef\xpg@saved@Auml@catcode\catcode`Ä
-\chardef\xpg@saved@Euml@catcode\catcode`Ë
-\chardef\xpg@saved@Iuml@catcode\catcode`Ï
-\chardef\xpg@saved@Ouml@catcode\catcode`Ö
-\chardef\xpg@saved@Uuml@catcode\catcode`Ü
-
-% activate trema characters
-\def\dutch@@tremahyph{%
- \catcode`ä = \active
- \catcode`ë = \active
- \catcode`ï = \active
- \catcode`ö = \active
- \catcode`ü = \active
- \catcode`Ä = \active
- \catcode`Ë = \active
- \catcode`Ï = \active
- \catcode`Ö = \active
- \catcode`Ü = \active
-}
-
-% restore previous catcode of trema characters
-\def\nodutch@@tremahyph{%
- \catcode`ä = \xpg@saved@auml@catcode
- \catcode`ë = \xpg@saved@euml@catcode
- \catcode`ï = \xpg@saved@iuml@catcode
- \catcode`ö = \xpg@saved@ouml@catcode
- \catcode`ü = \xpg@saved@uuml@catcode
- \catcode`Ä = \xpg@saved@Auml@catcode
- \catcode`Ë = \xpg@saved@Euml@catcode
- \catcode`Ï = \xpg@saved@Iuml@catcode
- \catcode`Ö = \xpg@saved@Ouml@catcode
- \catcode`Ü = \xpg@saved@Uuml@catcode
-}
-
-\bgroup
-\dutch@@tremahyph
-\gdef\dutch@tremahyph{%
- \dutch@@tremahyph%
- \def ä{\textormath{\xpg@trema{a}}{\ddot a}}%
- \def ë{\textormath{\xpg@trema{e}}{\ddot e}}%
- \def ï{\textormath{\xpg@trema{i}}{\ddot i}}%
- \def ö{\textormath{\xpg@trema{o}}{\ddot o}}%
- \def ü{\textormath{\xpg@trema{u}}{\ddot u}}%
- \def Ä{\textormath{\xpg@trema{A}}{\ddot A}}%
- \def Ë{\textormath{\xpg@trema{E}}{\ddot E}}%
- \def Ï{\textormath{\xpg@trema{I}}{\ddot I}}%
- \def Ö{\textormath{\xpg@trema{O}}{\ddot O}}%
- \def Ü{\textormath{\xpg@trema{U}}{\ddot U}}%
-}
-
-\gdef\nodutch@tremahyph{%
- \let ä\relax%
- \let ë\relax%
- \let ï\relax%
- \let ö\relax%
- \let ü\relax%
- \let Ä\relax%
- \let Ë\relax%
- \let Ï\relax%
- \let Ö\relax%
- \let Ü\relax%
- \nodutch@@tremahyph%
-}
-\egroup
-
-\def\captionsdutch{%
- \def\prefacename{Voorwoord}%
- \def\refname{Referenties}%
- \def\abstractname{Samenvatting}%
- \def\bibname{Bibliografie}%
- \def\chaptername{Hoofdstuk}%
- \def\appendixname{Bijlage}%
- \def\contentsname{Inhoudsopgave}%
- \def\listfigurename{Lijst van figuren}%
- \def\listtablename{Lijst van tabellen}%
- \def\indexname{Index}%
- \def\figurename{Figuur}%
- \def\tablename{Tabel}%
- \def\partname{Deel}%
- \def\enclname{Bijlage(n)}%
- \def\ccname{cc}%
- \def\headtoname{Aan}%
- \def\pagename{Pagina}%
- \def\seename{zie}%
- \def\alsoname{zie ook}%
- \def\proofname{Bewijs}%
- \def\glossaryname{Verklarende woordenlijst}%
-}
-
-\def\datedutch{%
- \def\today{\number\day~\ifcase\month%
- \or januari\or februari\or maart\or april\or mei\or juni\or
- juli\or augustus\or september\or oktober\or november\or
- december\fi
- \space \number\year}%
-}
-
-\def\noextras@dutch{%
- \ifdutch@babelshorthands\nodutch@shorthands\fi%
- \ifdutch@tremahyphenation\nodutch@tremahyph\fi%
-}
-
-\def\blockextras@dutch{%
- \ifdutch@babelshorthands\dutch@shorthands\else\nodutch@shorthands\fi%
- \ifdutch@tremahyphenation\dutch@tremahyph\else\nodutch@tremahyph\fi%
-}
-
-\def\inlineextras@dutch{%
- \ifdutch@babelshorthands\dutch@shorthands\else\nodutch@shorthands\fi%
- \ifdutch@tremahyphenation\dutch@tremahyph\else\nodutch@tremahyph\fi%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-dutch.ldf>
-%<*gloss-dv.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-dv.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-dv.ldf}[polyglossia: module for dv (Divehi)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{divehi}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-dv.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)
-%
-\ProvidesFile{gloss-el-monoton.ldf}[polyglossia: module for el-monoton (Greek)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{greek}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-el-monoton.ldf>
-%<*gloss-el-polyton.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-el-polyton.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-el-polyton.ldf}[polyglossia: module for el-polyton (Greek)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{greek}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-el-polyton.ldf>
-%<*gloss-el.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-el.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-el.ldf}[polyglossia: module for el (Greek)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{greek}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-el.ldf>
-%<*gloss-en-AU.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-en-AU.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-en-AU.ldf>
-%<*gloss-en-CA.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-en-CA.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-en-CA.ldf}[polyglossia: module for en-CA (Canadan English)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{english}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-en-CA.ldf>
-%<*gloss-en-GB.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-en-GB.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-en-GB.ldf>
-%<*gloss-en-NZ.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-en-NZ.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-en-NZ.ldf>
-%<*gloss-en-US.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-en-US.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-en-US.ldf>
-%<*gloss-en.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-en.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-en.ldf}[polyglossia: module for en (English)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{english}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-en.ldf>
-%<*gloss-english.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-english.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-english.ldf}[polyglossia: module for English]
-
-\PolyglossiaSetup{english}{
- bcp47=en-US,
- bcp47-language=en,
- bcp47-region=US,
- bcp47-script=Latn,
- hyphennames={english,american,usenglish,USenglish},
- hyphenmins={2,3},
- langtag=ENG,
- fontsetup=true,
- babelname=english
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{english}{en}
-\setlanguagealias*[variant=australian]{english}{en-AU}
-\setlanguagealias*[variant=canadian]{english}{en-CA}
-\setlanguagealias*[variant=british]{english}{en-GB}
-\setlanguagealias*[variant=newzealand]{english}{en-NZ}
-\setlanguagealias*[variant=us]{english}{en-US}
-
-
-% Babel aliases
-\setlanguagealias[variant=us]{english}{american}
-\setlanguagealias[variant=australian]{english}{australian}
-\setlanguagealias[variant=british]{english}{british}
-\setlanguagealias[variant=canadian]{english}{canadian}
-\setlanguagealias[variant=newzealand]{english}{newzealand}
-
-\providebool{british@hyphen}
-\providebool{english@ordinalmonthday}
-\providebool{british@dateformat}
-
-% US English (\l@english) is default
-% Initialize its settings
-\def\english@variant{english}
-\british@hyphenfalse
-\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
- % 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}{}%
- {\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%
- }%
- \def\english@variant{usenglishmax}%
- \or
- % australian:
- % These use the british hyphenation patterns
- % but date formats without ordinals
- \british@hyphentrue
- \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%
- \or
- % newzealand:
- % These use the british hyphenation patterns
- % but date formats without ordinals
- \british@hyphentrue
- \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%
- \or
- % canadian:
- % This is currently equivalent to usenglish (as in babel)
- \british@hyphenfalse
- \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%
- \fi
- \ifbritish@hyphen
- \xpg@ifdefined{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%
- }%
- \def\english@variant{ukenglish}%
- \fi
-}{\xpg@warning{Unknown English variant `#1'}}
-
-% Register default options
-\xpg@initialize@gloss@options{english}{variant=us,ordinalmonthday=false}
-% Register alias options
-\xpg@set@alias@values{english}{variant}{us}{american}
-\xpg@set@alias@values{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}{}{}
- }%
-\fi
-
-\def\english@language{%
- \polyglossia@setup@language@patterns{\english@variant}%
-}%
-
-\def\captionsenglish{%
- \def\prefacename{Preface}%
- \def\refname{References}%
- \def\abstractname{Abstract}%
- \def\bibname{Bibliography}%
- \def\chaptername{Chapter}%
- \def\appendixname{Appendix}%
- \def\contentsname{Contents}%
- \def\listfigurename{List of Figures}%
- \def\listtablename{List of Tables}%
- \def\indexname{Index}%
- \def\figurename{Figure}%
- \def\tablename{Table}%
- \def\partname{Part}%
- \def\enclname{encl}%
- \def\ccname{cc}%
- \def\headtoname{To}%
- \def\pagename{Page}%
- \def\seename{see}%
- \def\alsoname{see also}%
- \def\proofname{Proof}%
-}
-
-\def\dateenglish{%
- \def\english@day{%
- \ifenglish@ordinalmonthday
- \ifcase\day\or
- 1st\or 2nd\or 3rd\or 4th\or 5th\or
- 6th\or 7th\or 8th\or 9th\or 10th\or
- 11th\or 12th\or 13th\or 14th\or 15th\or
- 16th\or 17th\or 18th\or 19th\or 20th\or
- 21st\or 22nd\or 23rd\or 24th\or 25th\or
- 26th\or 27th\or 28th\or 29th\or 30th\or
- 31st\fi
- \else\number\day\fi}%
- \def\english@month{\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}%
- \def\today{%
- \ifbritish@dateformat
- \english@day\space\english@month\space\number\year
- \else
- \english@month\space\english@day,\space\number\year
- \fi}%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-english.ldf>
-%<*gloss-eo.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-eo.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-eo.ldf}[polyglossia: module for eo (Esperanto)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{esperanto}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-eo.ldf>
-%<*gloss-es-ES.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-es-ES.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-es-ES.ldf>
-%<*gloss-es-MX.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-es-MX.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-es-MX.ldf>
-%<*gloss-es.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-es.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-es.ldf}[polyglossia: module for es (Spanish)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{spanish}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-es.ldf>
-%<*gloss-esperanto.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-esperanto.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-esperanto.ldf}[polyglossia: module for Esperanto]
-\PolyglossiaSetup{esperanto}{
- bcp47=eo,
- bcp47-language=eo,
- bcp47-script=Latn,
- hyphennames={esperanto},
- hyphenmins={2,2},
- langtag=NTO,
- fontsetup=true,
- %TODO localalph={esperanto@alph,esperanto@Alph}
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{esperanto}{eo}
-
-\def\captionsesperanto{%
- \def\refname{Citaĵoj}%
- \def\abstractname{Resumo}%
- \def\bibname{Bibliografio}%
- \def\prefacename{Antaŭparolo}%
- \def\chaptername{Ĉapitro}%
- \def\appendixname{Apendico}%
- \def\contentsname{Enhavo}%
- \def\listfigurename{Listo de figuroj}%
- \def\listtablename{Listo de tabeloj}%
- \def\indexname{Indekso}%
- \def\figurename{Figuro}%
- \def\tablename{Tabelo}%
- %\def\thepart{}%
- %\def\partname{}%
- \def\pagename{Paĝo}%
- \def\seename{vidu}%
- \def\alsoname{Parto}%
- \def\enclname{Aldono(j)}%
- \def\ccname{Kopie al}%
- \def\headtoname{Al}%
- \def\proofname{Pruvo}%
- \def\glossaryname{Glosaro}%
- }
-\def\dateesperanto{%
- \def\today{\number\day{–a}~de~\ifcase\month\or
- januaro\or februaro\or marto\or aprilo\or majo\or junio\or
- julio\or aŭgusto\or septembro\or oktobro\or novembro\or
- decembro\fi,\space \number\year}%
- \def\hodiau{la \today}%
- \def\hodiaun{la \number\day{–an}~de~\ifcase\month\or
- januaro\or februaro\or marto\or aprilo\or majo\or junio\or
- julio\or aŭgusto\or septembro\or oktobro\or novembro\or
- decembro\fi, \space \number\year}%
- }
-\def\esperanto@alph#1{%
- \ifcase#1\or a\or b\or c\or ĉ\or d\or e\or f\or g\or ĝ\or
- h\or ĥ\or i\or j\or ĵ\or k\or l\or m\or n\or o\or
- p\or r\or s\or ŝ\or t\or u\or ŭ\or v\or z\else\xpg@ill@value{#1}{esperanto@alph}\fi}%
-\def\esperanto@Alph#1{%
- \ifcase#1\or A\or B\or C\or Ĉ\or D\or E\or F\or G\or Ĝ\or
- H\or Ĥ\or I\or J\or Ĵ\or K\or L\or M\or N\or O\or
- P\or R\or S\or Ŝ\or T\or U\or Ŭ\or V\or Z\else\xpg@ill@value{#1}{esperanto@Alph}\fi}%
-
-\def\esperanto@numbers{%
- \let\@Alph\esperanto@Alph%
- \let\@alph\esperanto@alph%
- }
-
-\def\noesperanto@numbers{%
- \let\@Alph\latin@Alph%
- \let\@alph\latin@alph%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-esperanto.ldf>
-%<*gloss-estonian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-estonian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-estonian.ldf}[polyglossia: module for Estonian]
-\PolyglossiaSetup{estonian}{
- bcp47=et,
- bcp47-language=et,
- bcp47-region=EE,
- bcp47-script=Latn,
- hyphennames={estonian},
- hyphenmins={2,2},
- langtag=ETI,
- frenchspacing=true,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{estonian}{et}
-
-\def\captionsestonian{%
- \def\refname{Viited}%
- \def\abstractname{Kokkuvõte}%
- \def\bibname{Kirjandus}%
- \def\prefacename{Sissejuhatus}%
- \def\chaptername{Peatükk}%
- \def\appendixname{Lisa}%
- \def\contentsname{Sisukord}%
- \def\listfigurename{Joonised}%
- \def\listtablename{Tabelid}%
- \def\indexname{Indeks}%
- \def\figurename{Joonis}%
- \def\tablename{Tabel}%
- %\def\thepart{}%
- \def\partname{Osa}%
- \def\pagename{Lk.}%
- \def\seename{vt.}%
- \def\alsoname{vt. ka}%
- \def\enclname{Lisa(d)}%
- \def\ccname{Koopia(d)}%
- %\def\headtoname{}%
- \def\proofname{Korrektuur}%
- \def\glossaryname{Glossary}% <-- need translation
- }
-\def\dateestonian{%
- \def\today{\number\day.\space\ifcase\month\or
- jaanuar\or veebruar\or märts\or aprill\or mai\or juuni\or
- juuli\or august\or september\or oktoober\or november\or
- detsember\fi\space\number\year.\space a.}}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-estonian.ldf>
-%<*gloss-et.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-et.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-et.ldf}[polyglossia: module for et (Estonian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{estonian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-et.ldf>
-%<*gloss-eu.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-eu.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-eu.ldf}[polyglossia: module for eu (Basque)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{basque}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-eu.ldf>
-%<*gloss-fa.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-fa.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-fa.ldf}[polyglossia: module for fa (Persian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{persian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-fa.ldf>
-%<*gloss-farsi.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-farsi.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-farsi.ldf>
-%<*gloss-fi.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-fi.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-fi.ldf}[polyglossia: module for fi (Finnish)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{finnish}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-fi.ldf>
-%<*gloss-finnish.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-finnish.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-finnish.ldf}[polyglossia: module for Finnish]
-\PolyglossiaSetup{finnish}{
- bcp47=fi,
- bcp47-language=fi,
- bcp47-region=FI,
- bcp47-script=Latn,
- hyphennames={finnish},
- hyphenmins={2,2},
- langtag=FIN,
- frenchspacing=true,
- fontsetup=true,
-}
-
-% 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
-}
-
-% Register default options
-\xpg@initialize@gloss@options{finnish}{babelshorthands=false,hyphens=default}
-
-\ifsystem@babelshorthands
- \setkeys{finnish}{babelshorthands=true}
-\else
- \setkeys{finnish}{babelshorthands=false}
-\fi
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
-
-\def\finnish@shorthands{%
- \xpg@activate@shorthands%
- \def\language@group{finnish}%
- \declare@shorthand{finnish}{"-}{\nobreak-\bbl@allowhyphens}
- \declare@shorthand{finnish}{"|}{\textormath{\penalty\@M\discretionary{-}{}{\kern.03em}}{}}%
- \declare@shorthand{finnish}{""}{\hskip\z@skip}%
- \declare@shorthand{finnish}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
- \declare@shorthand{finnish}{"=}{\hbox{-}\bbl@allowhyphens}%
- \declare@shorthand{finnish}{"/}{\textormath
- {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}%
-}
-
-\def\nofinnish@shorthands{%
- \xpg@deactivate@shorthands%
-}
-
-\def\captionsfinnish{%
- \def\refname{Viitteet}%
- \def\abstractname{Tiivistelmä}%
- \def\bibname{Kirjallisuutta}%
- \def\prefacename{Esipuhe}%
- \def\chaptername{Luku}%
- \def\appendixname{Liite}%
- \def\contentsname{Sisällys}%
- \def\listfigurename{Kuvat}%
- \def\listtablename{Taulukot}%
- \def\indexname{Hakemisto}%
- \def\figurename{Kuva}%
- \def\tablename{Taulukko}%
- %\def\thepart{}%
- \def\partname{Osa}%
- \def\pagename{Sivu}%
- \def\seename{katso}%
- \def\alsoname{katso myös}%
- \def\enclname{Liitteet}%
- \def\ccname{Jakelu}%
- \def\headtoname{Vastaanottaja}%
- \def\proofname{Todistus}%
- \def\glossaryname{Sanasto}%
-}
-
-\def\finnish@language{%
- \if@finnish@schoolhyphens
- \xpg@ifdefined{schoolfinnish}{%
- \polyglossia@setup@language@patterns{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}%
- }%
- \else
- \polyglossia@setup@language@patterns{finnish}%
- \fi
-}
-
-% activate babel-style hyphen settings if requested
-\AtBeginDocument{%
- \if@finnish@babelhyphens
- \let\xpg@save@hyphenpenalty\hyphenpenalty%
- \let\xpg@save@exhyphenpenalty\exhyphenpenalty%
- \let\xpg@save@doublehyphendemerits\doublehyphendemerits%
- \let\xpg@save@finalhyphendemerits\finalhyphendemerits%
- \addto\blockextras@finnish{%
- \hyphenpenalty=30%
- \exhyphenpenalty=30%
- \doublehyphendemerits=5000%
- \finalhyphendemerits=5000%
- }%
- \addto\noextras@finnish{%
- \let\hyphenpenalty\xpg@save@hyphenpenalty%
- \let\exhyphenpenalty\xpg@save@exhyphenpenalty%
- \let\doublehyphendemerits\xpg@save@doublehyphendemerits%
- \let\finalhyphendemerits\xpg@save@finalhyphendemerits%
- }%
- \fi
-}
-
-\def\datefinnish{%
- \def\today{\number\day.~\ifcase\month\or
- tammikuuta\or helmikuuta\or maaliskuuta\or huhtikuuta\or
- toukokuuta\or kesäkuuta\or heinäkuuta\or elokuuta\or
- syyskuuta\or lokakuuta\or marraskuuta\or joulukuuta\fi
- \space\number\year}}
-
-\def\noextras@finnish{%
- \iffinnish@babelshorthands\nofinnish@shorthands\fi%
-}
-
-\def\blockextras@finnish{%
- \iffinnish@babelshorthands\finnish@shorthands\else\nofinnish@shorthands\fi%
-}
-
-\def\inlineextras@finnish{%
- \iffinnish@babelshorthands\finnish@shorthands\else\nofinnish@shorthands\fi%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-finnish.ldf>
-%<*gloss-fr-CA-u-sd-canb.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-fr-CA-u-sd-canb.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-fr-CA-u-sd-canb.ldf>
-%<*gloss-fr-CA.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-fr-CA.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-fr-CA.ldf>
-%<*gloss-fr-CH.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-fr-CH.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-fr-CH.ldf>
-%<*gloss-fr-FR.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-fr-FR.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-fr-FR.ldf>
-%<*gloss-fr.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-fr.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-fr.ldf}[polyglossia: module for fr (French)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{french}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-fr.ldf>
-%<*gloss-french.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-french.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-french.ldf}[polyglossia: module for French]
-
-\PolyglossiaSetup{french}{%
- bcp47=fr-FR,
- bcp47-language=fr,
- bcp47-region=FR,
- bcp47-script=Latn,
- language=French,
- script=Latin,
- langtag=FRA,
- hyphennames={french,francais},
- frenchspacing=true,
- indentfirst=true,
- hyphenmins={2,2},
- fontsetup=true}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{french}{fr}
-\setlanguagealias*[variant=french]{french}{fr-FR}
-\setlanguagealias*[variant=acadian]{french}{fr-CA-u-sd-canb}
-\setlanguagealias*[variant=canadian]{french}{fr-CA}
-\setlanguagealias*[variant=swiss]{french}{fr-CH}
-
-% Babel aliases
-\setlanguagealias[variant=acadian]{french}{acadian}
-\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}%
-}%
-
-\ifluatex
- \directlua{require('polyglossia-french')}%
-\else
- \newXeTeXintercharclass\french@openbrackets % ( [ {
- \newXeTeXintercharclass\french@closebrackets % ) ] }
- \newXeTeXintercharclass\french@questionexclamation % ! ? et autres
- \newXeTeXintercharclass\french@punctthin % ; (et :)
- \newXeTeXintercharclass\french@punctthick % :
- \newXeTeXintercharclass\french@punctguillstart % « ‹
- \newXeTeXintercharclass\french@punctguillend % » ›
-\fi
-
-\def\xpg@unskip{\ifhmode\ifdim\lastskip>\z@\unskip\fi\fi}
-
-% Save original footnote definition
-% Do this at the end of the preamble to catch other
-% packages' footnote changes (#391)
-\AtEndPreamble{%
- \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}
-}
-
-\define@boolkey{french}[french@]{frenchitemlabels}[true]{}
-
-% Register default options
-\xpg@initialize@gloss@options{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}
-
-
-\def\french@fontsetup{%
- \unless\iffrench@autospacetypewriter
- \let\ttfamily\french@ttfamilyFB
- \fi
-}
-
-
-\def\nofrench@fontsetup{%
- \let\ttfamily\french@ttfamilyORI
-}
-
-\def\xpg@french@thinsp{\kern 0.5\fontdimen2\font\nobreak\hskip\z@skip}
-
-\def\french@punctuation{%
- \lccode"2019="2019
- \ifluatex
- \iffrench@thincolonspace
- \iffrench@autospaceguillemets
- \directlua{polyglossia.activate_french_punct(true, true)}%
- \else
- \directlua{polyglossia.activate_french_punct(true, false)}%
- \fi
- \else
- \iffrench@autospaceguillemets
- \directlua{polyglossia.activate_french_punct(false, true)}%
- \else
- \directlua{polyglossia.activate_french_punct(false, false)}%
- \fi
- \fi
- \else
- \XeTeXinterchartokenstate=1
- \XeTeXcharclass `\! \french@questionexclamation
- \XeTeXcharclass `\? \french@questionexclamation
- \XeTeXcharclass `\‼ \french@questionexclamation
- \XeTeXcharclass `\⁇ \french@questionexclamation
- \XeTeXcharclass `\⁈ \french@questionexclamation
- \XeTeXcharclass `\⁉ \french@questionexclamation
- \XeTeXcharclass `\‽ \french@questionexclamation % U+203D (interrobang)
- \XeTeXcharclass `\; \french@punctthin
- \iffrench@thincolonspace
- \XeTeXcharclass `\: \french@punctthin
- \else
- \XeTeXcharclass `\: \french@punctthick
- \fi
- \XeTeXcharclass `\« \french@punctguillstart
- \XeTeXcharclass `\» \french@punctguillend
- \XeTeXcharclass `\‹ \french@punctguillstart
- \XeTeXcharclass `\› \french@punctguillend
- \XeTeXcharclass `\( \french@openbrackets
- \XeTeXcharclass `\) \french@closebrackets
- \XeTeXcharclass `\[ \french@openbrackets
- \XeTeXcharclass `\] \french@closebrackets
- \XeTeXcharclass `\{ \french@openbrackets
- \XeTeXcharclass `\} \french@closebrackets
- \XeTeXcharclass `\⟨ \french@openbrackets
- \XeTeXcharclass `\⟩ \french@closebrackets
- \XeTeXinterchartoks \z@ \french@questionexclamation = {\xpg@french@thinsp}%
- \XeTeXinterchartoks \z@ \french@punctthin = {\xpg@french@thinsp}%
- \XeTeXinterchartoks \z@ \french@punctthick = {\nobreakspace}%
- \XeTeXinterchartoks \xpg@boundaryclass \french@questionexclamation = {\xpg@unskip\xpg@french@thinsp}%
- \XeTeXinterchartoks \xpg@boundaryclass \french@punctthin = {\xpg@unskip\xpg@french@thinsp}%
- \XeTeXinterchartoks \xpg@boundaryclass \french@punctthick = {\xpg@unskip\nobreakspace}%
- \iffrench@autospaceguillemets
- \let\xpg@french@guillspace\xpg@french@thinsp%
- \XeTeXinterchartoks \french@punctguillstart \z@ = {\xpg@french@guillspace}% "«a" -> "«\,a"
- \XeTeXinterchartoks \french@punctguillstart \french@punctguillstart = {\xpg@french@guillspace}% "«‹" -> "«\,‹"
- % \XeTeXinterchartoks \z@ \french@punctguillstart = {\nobreakspace}% "a«" unchanged?
- % \XeTeXinterchartoks \french@punctguillend \z@ = {\nobreakspace}% "»a" unchanged?
- \XeTeXinterchartoks \z@ \french@punctguillend = {\xpg@french@guillspace}% "a»" -> "a\,»"
- \XeTeXinterchartoks \french@punctguillstart \xpg@boundaryclass = {\xpg@french@guillspace\ignorespaces}% "« " -> "«\,"
- \XeTeXinterchartoks \xpg@boundaryclass \french@punctguillend = {\xpg@unskip\xpg@french@guillspace}% " »" -> "\,»"
- \XeTeXinterchartoks \french@closebrackets \french@punctguillend = {\xpg@french@guillspace}% ")»" -> ")\,»"
- \XeTeXinterchartoks \french@questionexclamation \french@punctguillend = {\xpg@french@guillspace}% "?»" -> "?\,»"
- \XeTeXinterchartoks \french@punctthin \french@punctguillend = {\xpg@french@guillspace}% ";»" -> ";\,»"
- \XeTeXinterchartoks \french@punctguillend \french@punctguillend = {\xpg@french@guillspace}% "›»" -> "›\,»"
- \else
- \def\xpg@french@guillspace{}%
- \fi
- \XeTeXinterchartoks \french@punctguillend \french@questionexclamation = {\xpg@french@thinsp}% "»?" -> "»\,?"
- \XeTeXinterchartoks \french@punctguillend \french@punctthin = {\xpg@french@thinsp}% "»;" -> "»\,;"
- \XeTeXinterchartoks \french@punctguillend \french@punctthick = {\nobreakspace}% "»:" -> "» :"
- \XeTeXinterchartoks \french@questionexclamation \french@punctthin = {\xpg@french@thinsp}% "?;" -> "?\,;"
- \XeTeXinterchartoks \french@questionexclamation \french@punctthick = {\xpg@french@thinsp}% "?:" -> "?\,:"
- \XeTeXinterchartoks \french@openbrackets \french@questionexclamation = {\xpg@unskip}% "(?" -> "(?" and not "( ?"
- \XeTeXinterchartoks \french@openbrackets \french@punctthin = {\xpg@unskip}% "(;" -> "(;" and not "( ;"
- \XeTeXinterchartoks \french@punctthin \french@closebrackets = {\xpg@unskip}% "?)" -> "?)" (code not need, just for symetry with previous one)
- \XeTeXinterchartoks \french@closebrackets \french@punctthin = {\xpg@french@thinsp}% ")?" -> ")\,?"
- \XeTeXinterchartoks \french@closebrackets \french@punctthick = {\nobreakspace}% "):" -> ") :"
- \fi
-}
-
-\def\nofrench@punctuation{%
- \lccode"2019=\z@
- \ifluatex
- \directlua{polyglossia.deactivate_french_punct()}%
- \else
- \XeTeXcharclass `\! \z@
- \XeTeXcharclass `\? \z@
- \XeTeXcharclass `\‼ \z@
- \XeTeXcharclass `\⁇ \z@
- \XeTeXcharclass `\⁈ \z@
- \XeTeXcharclass `\⁉ \z@
- \XeTeXcharclass `\‽ \z@
- \XeTeXcharclass `\; \z@
- \XeTeXcharclass `\: \z@
- \XeTeXcharclass `\« \z@
- \XeTeXcharclass `\» \z@
- \XeTeXcharclass `\‹ \z@
- \XeTeXcharclass `\› \z@
- \XeTeXcharclass `\( \z@
- \XeTeXcharclass `\) \z@
- \XeTeXcharclass `\[ \z@
- \XeTeXcharclass `\] \z@
- \XeTeXcharclass `\{ \z@
- \XeTeXcharclass `\} \z@
- \XeTeXcharclass `\⟨ \z@
- \XeTeXcharclass `\⟩ \z@
- \XeTeXinterchartokenstate=0
- \fi
-}
-
-\def\captionsfrench{%
- \def\refname{Références}%
- \def\abstractname{Résumé}%
- \def\bibname{Bibliographie}%
- \def\prefacename{Préface}%
- \def\chaptername{Chapitre}%
- \def\appendixname{Annexe}%
- \def\contentsname{Table des matières}%
- \def\listfigurename{Table des figures}%
- \def\listtablename{Liste des tableaux}%
- \def\indexname{Index}%
- \def\figurename{\textsc{Fig.}}%
- \def\tablename{\textsc{Tab.}}%
- \iffrench@frenchpart
- \def\partname{partie}%
- \else
- \def\partname{Partie}%
- \fi%
- \def\pagename{page}%
- \def\seename{voir}%
- \def\alsoname{voir aussi}%
- \def\enclname{P.~J. }%
- \def\ccname{Copie à }%
- \def\headtoname{}%
- \def\proofname{Démonstration}%
-}
-
-\def\datefrench{%
- \def\today{\ifx\ier\undefined\def\ier{er}\fi
- \ifnum\day=1\relax 1\ier%
- \else \number\day\fi
- \space \ifcase\month%
- \or janvier\or février\or mars\or avril\or mai\or juin\or
- juillet\or août\or septembre\or octobre\or novembre\or
- décembre\fi
- \space \number\year}}
-
-\def\xpg@french@part{\ifcase\value{part}\or Première\or Deuxième\or%
- Troisième\or Quatrième\or Cinquième\or Sixième\or%
- Septième\or Huitième\or Neuvième\or Dixième\or Onzième\or%
- Douzième\or Treizième\or Quatorzième\or Quinzième\or%
- Seizième\or Dix-septième\or Dix-huitième\or Dix-neuvième\or%
- Vingtième\fi}%
-
-\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}%
- {\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}{%
- \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
- \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}%
- {\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)
- }% (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
- }{}%
- }{%
- % 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%
- }%
- }{}%
- }% (end \ifdefined\sectionformat)
- }% (end \ifdefined\titleformat)
-}
-
-\newif\if@xpg@french@footnote@set
-\@xpg@french@footnote@setfalse
-\def\set@french@footnote{%
- % Set French footnote once if requested
- \if@xpg@french@footnote@set%
- \else%
- \iffrench@frenchfootnote%
- \ifdefstring{\xpg@main@language}{french}{%
- \ifx\@makefntext\undefined\else%
- \long\def\french@makefntext##1{%
- \parindent1em \noindent\quad%
- \ifx\@thefnmark\empty\else%
- \@thefnmark.\space\fi ##1%
- }%
- \let\@makefntext\french@makefntext%
- \fi%
- }{\xpg@warning{Option 'frenchfootnote' only supported if French is main language!}}%
- \else%
- \let\@makefntext\xpg@orig@makefntext%
- \fi%
- \@xpg@french@footnote@settrue%
- \fi%
-}
-
-\newif\if@xpg@french@itemlabels@set
-\@xpg@french@itemlabels@setfalse
-\def\set@french@itemlabels{%
- % Set French itemlabels once if requested
- \if@xpg@french@itemlabels@set%
- \else%
- \iffrench@frenchitemlabels
- \ifdefstring{\xpg@main@language}{french}{%
- \renewcommand{\labelitemi}{\french@itemi}%
- \renewcommand{\labelitemii}{\french@itemii}%
- \renewcommand{\labelitemiii}{\french@itemiii}%
- \renewcommand{\labelitemiv}{\french@itemiv}%
- }{\xpg@warning{Option 'frenchitemlabels' only supported if French is main language!}}%
- \fi
- \@xpg@french@itemlabels@settrue%
- \fi%
-}
-
-\def\noextras@french{%
- \nofrench@punctuation%
- \nofrench@fontsetup%
- \nofrench@capsformat%
-}
-
-\def\blockextras@french{%
- % Set French itemlabels and footnote,
- % if so requested, once in the document body
- \ifx\@onlypreamble\@notprerr%
- \set@french@footnote%
- \set@french@itemlabels%
- \fi%
- \iffrench@autospacing%
- \french@punctuation%
- \fi%
- \french@fontsetup%
- \iffrench@frenchpart%
- \french@capsformat%
- \fi%
-}
-
-\def\inlineextras@french{%
- \iffrench@autospacing
- \french@punctuation%
- \fi
- \french@fontsetup%
-}
-
-\def\NoAutoSpacing{%
- \nofrench@punctuation%
-}
-
-\def\AutoSpacing{%
- \french@punctuation%
-}
-
-\def\ier{\textsuperscript{er}}
-\def\iers{\textsuperscript{ers}}
-\def\iere{\textsuperscript{re}}
-\def\ieres{\textsuperscript{res}}
-\def\ieme{\textsuperscript{e}}
-\def\iemes{\textsuperscript{es}}
-\def\nd{\textsuperscript{nd}}
-\def\nds{\textsuperscript{nds}}
-\def\nde{\textsuperscript{nde}}
-\def\ndes{\textsuperscript{ndes}}
-\def\no{\textsuperscript{o}}
-\def\nos{\textsuperscript{os}}
-
-\def\mme{M\textsuperscript{me}\space}
-\def\mmes{M\textsuperscript{mes}\space}
-\def\mr{M.\space}
-\def\mrs{MM.\space}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-french.ldf>
-%<*gloss-friulan.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-friulan.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-friulan.ldf}[polyglossia: module for Friulian]
-
-% We only provide this gloss for babel compatibility.
-
-\xpg@load@master@language{friulian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-friulan.ldf>
-%<*gloss-friulian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-friulian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-friulian.ldf}[polyglossia: module for Friulian]
-
-\PolyglossiaSetup{friulian}{%
- bcp47=fur,
- bcp47-language=fur,
- bcp47-script=Latn,
- language=Friulian,
- babelname=friulan,
- hyphennames={friulan,furlan},
- hyphenmins={2,2},
- langtag=FRL,
- indentfirst=false,
- fontsetup=true,
- frenchspacing=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{friulian}{fur}
-
-% Babel and backwards compat. alias
-\setlanguagealias{friulian}{friulan}
-
-\def\captionsfriulian{%
- \def\prefacename{Prefazion}%
- \def\refname{Riferiments}%
- \def\abstractname{Somari}%
- \def\bibname{Bibliografie}%
- \def\chaptername{Cjapitul}%
- \def\appendixname{Zonte}%
- \def\contentsname{Tabele gjenerâl}%
- \def\listfigurename{Liste des figuris}%
- \def\listtablename{Liste des tabelis}%
- \def\indexname{Tabele analitiche}%
- \def\figurename{Figure}%
- \def\tablename{Tabele}%
- \def\partname{Part}%
- \def\enclname{Zonte(is)}%
- \def\ccname{Cun copie a}%
- \def\headtoname{Par}%
- \def\pagename{Pagjine}%
- \def\seename{cjale}%
- \def\alsoname{cjale ancje}%
- \def\proofname{Dimostrazion}%
- \def\glossaryname{Glossari}%
- }
-
-\def\datefriulian{%
- \def\today{\number\day\space di\space\ifcase\month\or
- Genâr\or Fevrâr\or Març\or Avril\or Mai\or Jugn\or
- 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
- \edef\xpgfu@savedvalues{%
- \clubpenalty=\the\clubpenalty\space
- \@clubpenalty=\the\@clubpenalty\space
- \widowpenalty=\the\widowpenalty\space
- \finalhyphendemerits=\the\finalhyphendemerits}
-}
-
-
-\def\noextras@friulian{%
- \lccode\string"2019=\z@
-}
-
-\def\blockextras@friulian{%
- \lccode\string"2019=\string"2019
- \clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000
- \finalhyphendemerits=50000000
-}
-
-\def\inlineextras@friulian{%
- \lccode\string"2019=\string"2019
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-friulian.ldf>
-%<*gloss-fur.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-fur.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-fur.ldf}[polyglossia: module for fur (Friulian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{friulian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-fur.ldf>
-%<*gloss-ga.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ga.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ga.ldf}[polyglossia: module for ga (Gaelic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{gaelic}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ga.ldf>
-%<*gloss-gaelic.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-gaelic.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-gaelic.ldf}[polyglossia: module for Gaelic]
-
-\PolyglossiaSetup{gaelic}{
- bcp47=ga,
- bcp47-language=ga,
- bcp47-script=Latn,
- language=Irish,
- babelname=irish,
- hyphennames={irish},
- hyphenmins={2,2},
- langtag=IRI,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*[variant=irish]{gaelic}{ga}
-\setlanguagealias*[variant=scottish]{gaelic}{gd}
-% Babel aliases
-\setlanguagealias[variant=irish]{gaelic}{irish}
-\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'}}
-
-% Register default options
-\xpg@initialize@gloss@options{gaelic}{variant=irish}
-
-\def\captionsgaelic@irish{%
- \def\refname{Tagairtí}%
- \def\abstractname{Achoimre}%
- \def\bibname{Leabharliosta}%
- \def\prefacename{Réamhrá}% <-- also "Brollach"
- \def\refname{Tagairtí}%
- \def\chaptername{Tagairtí}%
- \def\appendixname{Aguisín}%
- \def\contentsname{Clár Ábhair}%
- \def\listfigurename{Léaráidí}%
- \def\listtablename{Táblaí}%
- \def\indexname{Innéacs}%
- \def\figurename{Léaráid}%
- \def\tablename{Tábla}%
- %\def\thepart{}%
- \def\partname{Cuid}%
- \def\pagename{Leathanach}%
- \def\seename{féach}%
- \def\alsoname{féach freisin}%
- \def\enclname{faoi iamh}%
- \def\ccname{cc}%
- \def\headtoname{Go}%
- \def\proofname{Cruthúnas}%
- \def\glossaryname{Glossary}%
-}
-
-\def\captionsgaelic@scottish{%
- \def\refname{Iomraidh}%
- \def\abstractname{Brìgh}%
- \def\bibname{Leabhraichean}%
- \def\prefacename{Preface}% <-- needs translation
- \def\chaptername{Caibideil}%
- \def\appendixname{Ath-sgr`ıobhadh}%
- \def\contentsname{Clàr-obrach}%
- \def\listfigurename{Liosta Dhealbh}%
- \def\listtablename{Liosta Chlàr}%
- \def\indexname{Clàr-innse}%
- \def\figurename{Dealbh}%
- \def\tablename{Clàr}%
- %\def\thepart{}%
- \def\partname{Cuid}%
- \def\pagename{t.d.}%
- \def\seename{see}% <-- needs translation
- \def\alsoname{see also}% <-- needs translation
- \def\enclname{a-staigh}%
- \def\ccname{lethbhreac gu}%
- \def\headtoname{gu}%
- \def\proofname{Proof}% <-- needs translation
- \def\glossaryname{Glossary}% <-- needs translation
-}
-
-\def\captionsgaelic{%
- \csname captionsgaelic@\gaelic@variant\endcsname%
-}
-
-\def\dategaelic@irish{%
- \def\today{%
- \number\day\space \ifcase\month\or
- Eanáir\or Feabhra\or Márta\or Aibreán\or
- Bealtaine\or Meitheamh\or Iúil\or Lúnasa\or
- Meán Fómhair\or Deireadh Fómhair\or
- Mí na Samhna\or Mí na Nollag\fi
- \space \number\year}%
-}
-
-\def\dategaelic@scottish{%
- \def\today{%
- \number\day\space \ifcase\month\or
- am Faoilteach\or an Gearran\or am Màrt\or an Giblean\or
- an Cèitean\or an t-Òg mhios\or an t-Iuchar\or
- Lùnasdal\or an Sultuine\or an Dàmhar\or
- an t-Samhainn\or an Dubhlachd\fi
- \space \number\year}%
-}
-
-\def\dategaelic{%
- \csname dategaelic@\gaelic@variant\endcsname%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-gaelic.ldf>
-%<*gloss-galician.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-galician.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-galician.ldf}[polyglossia: module for Galician]
-\PolyglossiaSetup{galician}{
- bcp47=gl,
- bcp47-language=gl,
- bcp47-region=ES,
- bcp47-script=Latn,
- hyphennames={galician},
- hyphenmins={2,2},
- langtag=GAL,
- indentfirst=true,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{galician}{gl}
-
-\def\captionsgalician{%
- \def\refname{Referencias}%
- \def\abstractname{Resumo}%
- \def\bibname{Bibliografía}%
- \def\prefacename{Prefacio}%
- \def\chaptername{Capítulo}%
- \def\appendixname{Apéndice}%
- \def\contentsname{Índice Xeral}%
- \def\listfigurename{Índice de Figuras}%
- \def\listtablename{Índice de Táboas}%
- \def\indexname{Índice de Materias}%
- \def\figurename{Figura}%
- \def\tablename{Táboa}%
- %\def\thepart{}%
- \def\partname{Parte}%
- \def\pagename{Páxina}%
- \def\seename{véxase}%
- \def\alsoname{véxase tamén}%
- \def\enclname{Adxunto}%
- \def\ccname{Copia a}%
- \def\headtoname{A}%
- \def\proofname{Demostración}%
- \def\glossaryname{Glosario}%
- }
-\def\dategalician{%
- \def\today{\number\day~de\space\ifcase\month\or
- xaneiro\or febreiro\or marzo\or abril\or maio\or xuño\or
- xullo\or agosto\or setembro\or outubro\or novembro\or decembro\fi
- \space de~\number\year}}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-galician.ldf>
-%<*gloss-gd.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-gd.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-gd.ldf}[polyglossia: module for gd (Gaelic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{gaelic}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-gd.ldf>
-%<*gloss-georgian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-georgian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-georgian.ldf}[polyglossia: module for Georgian]
-
-\PolyglossiaSetup{georgian}{
- bcp47=ka,
- bcp47-language=ka,
- bcp47-script=Geor,
- script=Georgian,
- scripttag=geor,
- langtag=KAT,
- hyphennames={georgian},
- fontsetup=true,
- localnumeral=georgiannumerals
-}
-
-% BCP-47 compliant aliases
-\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]{}
-
-% Register default options
-\xpg@initialize@gloss@options{georgian}{babelshorthands=false,oldmonthnames=false,numerals=arabic}
-
-\ifsystem@babelshorthands
- \setkeys{georgian}{babelshorthands=true}
-\else
- \setkeys{georgian}{babelshorthands=false}
-\fi
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
-
-\def\georgian@shorthands{%
- \xpg@activate@shorthands%
- \def\language@group{georgian}%
- \declare@shorthand{georgian}{"`}{„}%
- \declare@shorthand{georgian}{"'}{“}%
- \declare@shorthand{georgian}{"<}{«}%
- \declare@shorthand{georgian}{">}{»}%
- \declare@shorthand{georgian}{""}{\hskip\z@skip}%
- \declare@shorthand{georgian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
- \declare@shorthand{georgian}{"=}{\nobreak-\hskip\z@skip}%
- \declare@shorthand{georgian}{"|}{\textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}%
- \declare@shorthand{georgian}{"-}{%
- \def\georgian@sh@tmp{%
- \if\georgian@sh@next-\expandafter\georgian@sh@emdash%
- \else\expandafter\georgian@sh@hyphen\fi%
- }%
- \futurelet\georgian@sh@next\georgian@sh@tmp}%
- \def\georgian@sh@hyphen{%
- \nobreak\-\bbl@allowhyphens}%
- \def\georgian@sh@emdash##1##2{\cdash-##1##2}%
- \def\cdash##1##2##3{\def\tempx@{##3}%
- \def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
- \ifx\tempx@\tempa@\@Acdash\else
- \ifx\tempx@\tempb@\@Bcdash\else
- \ifx\tempx@\tempc@\@Ccdash\else
- \errmessage{Wrong usage of cdash}\fi\fi\fi}%
- \def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
- \cyrdash\hskip.2em\ignorespaces}%
- \def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
- \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%
- \def\@Ccdash{\leavevmode
- \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
- \ifx\cyrdash\undefined
- \def\cyrdash{\hbox to.8em{\textendash\hss\textendash}}%
- \fi
- \declare@shorthand{georgian}{",}{\nobreak\hskip.2em\ignorespaces}%
-}
-
-\def\nogeorgian@shorthands{%
- \xpg@deactivate@shorthands%
-}
-
-\def\captionsgeorgian{%
- \def\prefacename{წინასიტყვაობა}%
- \def\refname{ლიტერატურა}%
- \def\abstractname{ანოტაცია}%
- \def\bibname{ლიტერატურა}%
- \def\chaptername{თავი}%
- \def\appendixname{დანართი}%
- \@ifundefined{thechapter}
- {\def\contentsname{შინაარსი}}%
- {\def\contentsname{შინაარსი}}%
- \let\tocname=\contentsname
- \def\listfigurename{სურათი}%
- \def\listtablename{ცხრილი}%
- \def\indexname{საძიებელი}%
- \def\authorname{სახელთა საძიებელი}%
- \def\figurename{სურ.}%
- \def\tablename{ცხრ.}%
- \def\partname{ნაწილი}%
- \def\enclname{ჩათვ.}%
- \def\ccname{წყარ.}%
- \def\headtoname{შ.}%
- \def\pagename{გვ.}%
- \def\seename{იხ.}%
- \def\alsoname{იხ.\ ასევე}%
- \def\proofname{დამტკიცება}%
- \def\glossaryname{ტერმინები}%
-}%
-
-\def\dategeorgian{%
- \def\today{\number\day~\ifcase\month\or
- იანვარი\or
- თებერვალი\or
- მარტი\or
- აპრილი\or
- მაისი\or
- ივნისი\or
- ივლისი\or
- აგვისტო\or
- სექტემბერი\or
- ოქტომბერი\or
- ნოემბერი\or
- დეკემბერი\fi
- \space \number\year~წ.}%
- \ifgeorgian@oldmonthnames
- \dategeorgian@old%
- \fi
-}
-
-\def\dategeorgian@old{%
- \def\today{\number\day~\ifcase\month\or
- აპნისი\or
- სურწყუნისი\or
- მირკანი\or
- იგრიკა\or
- ვარდობისთვე\or
- თიბათვე\or
- მკათათვე\or
- მარიამობისთვე\or
- ახალწლისა ენკენისთვე\or
- ღვინობისთვე\or
- გიორგობისთვე\or
- ქრისტეშობისთვე\fi
- \space \number\year~წ.}%
-}
-
-\def\georgian@numbers{%
- \ifgeorgian@numerals%
- \def\georgian@alph##1{\expandafter\georgiannumeral\expandafter{\the##1}}%
- \let\@alph\georgian@@alph%
- \fi
-}
-
-\def\nogeorgian@numbers{%
- \let\@alph\latin@alph%
- \let\georgian@alph\@undefined%
-}
-
-\def\georgian@globalnumbers{%
- \ifgeorgian@numerals
- \let\@arabic\georgiannumber%
- \renewcommand\thefootnote{\localnumeral*{footnote}}%
- \renewcommand\theequation{\localnumeral*{equation}}%
- \fi
-}
-
-% Store original definition
-\let\xpg@save@arabic\@arabic
-
-\def\nogeorgian@globalnumbers{
- \let\@arabic\xpg@save@arabic%
-}
-
-\newcommand{\georgiannumerals}[2]{%
- \ifgeorgian@numerals
- \georgiannumber{#2}%
- \else
- #2%
- \fi%
-}
-
-\protected\def\georgiannumber#1{\expandafter\@georgiannumber\expandafter{\number#1}}
-\def\@georgiannumber#1{%
- \ifnum#1<\@ne\space\geor@ill@value{#1}%
- \else
- \ifnum#1<10\expandafter\geor@num@i\number#1%
- \else
- \ifnum#1<100\expandafter\geor@num@ii\number#1%
- \else
- \ifnum#1<\@m\expandafter\geor@num@iii\number#1%
- \else
- \ifnum#1<\@M\expandafter\geor@num@iv\number#1%
- \else
- \space\geor@ill@value{#1}%
- \fi
- \fi
- \fi
- \fi
- \fi
-}
-
-\let\georgiannumeral=\georgiannumber
-\def\geor@num@i#1{% 1--9
- \ifcase#1\or ა\or ბ\or გ\or დ\or ე\or ვ\or ზ\or ჱ\or თ\fi}
-\def\geor@num@ii#1{% 10--90
- \ifcase#1\or ი\or კ\or ლ\or მ\or ნ\or ჲ\or ო\or პ\or ჟ\fi
- \geor@num@i}
-\def\geor@num@iii#1{% 100--900
- \ifcase#1\or რ\or ს\or ტ\or ჳ\or ფ\or ქ\or ღ\or ყ\or შ\fi
- \geor@num@ii}
-\def\geor@num@iv#1{% 1000--9000
- \ifcase#1\or ჩ\or ც\or ძ\or წ\or ჭ\or ხ\or ჴ\or ჯ\or ჰ\fi
- \geor@num@iii}
-\def\geor@ill@value#1{\xpg@warning{Illegal value (#1) for Georgian numeral}[$#1$]}
-
-\def\noextras@georgian{%
- \ifgeorgian@numerals\nogeorgian@numbers\fi%
- \ifgeorgian@babelshorthands\nogeorgian@shorthands\fi%
-}
-
-\def\blockextras@georgian{%
- \ifgeorgian@numerals\georgian@numbers\else\nogeorgian@numbers\fi%
- \ifgeorgian@babelshorthands\georgian@shorthands\else\nogeorgian@shorthands\fi%
-}
-
-\def\inlineextras@georgian{%
- \ifgeorgian@babelshorthands\georgian@shorthands\else\nogeorgian@shorthands\fi%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-georgian.ldf>
-%<*gloss-german.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-german.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-german.ldf}[polyglossia: module for German]
-
-\PolyglossiaSetup{german}{
- bcp47=de-DE,
- bcp47-language=de,
- bcp47-region=DE,
- bcp47-variant=1996,
- bcp47-script=Latn,
- hyphenmins={2,2},
- frenchspacing=true,
- fontsetup=true,
- langtag=DEU,
- babelname=ngerman
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{german}{de}
-\setlanguagealias*[variant=swiss,spelling=new]{german}{de-CH}
-\setlanguagealias*[variant=austrian,spelling=new]{german}{de-AT}
-\setlanguagealias*[variant=german,spelling=new]{german}{de-DE}
-\setlanguagealias*[variant=swiss,spelling=new,script=blackletter]{german}{de-Latf-CH}
-\setlanguagealias*[variant=german,spelling=new,script=blackletter]{german}{de-Latf-DE}
-\setlanguagealias*[variant=austrian,spelling=new,script=blackletter]{german}{de-Latf-AT}
-\setlanguagealias*[variant=austrian,spelling=old]{german}{de-AT-1901}
-\setlanguagealias*[variant=swiss,spelling=new]{german}{de-CH-1996}
-\setlanguagealias*[variant=austrian,spelling=new]{german}{de-AT-1996}
-\setlanguagealias*[variant=german,spelling=old]{german}{de-DE-1901}
-\setlanguagealias*[variant=swiss,spelling=old,script=blackletter]{german}{de-Latf-CH-1901}
-\setlanguagealias*[variant=swiss,spelling=old]{german}{de-CH-1901}
-\setlanguagealias*[variant=austrian,spelling=old,script=blackletter]{german}{de-Latf-AT-1901}
-\setlanguagealias*[variant=swiss,spelling=new,script=blackletter]{german}{de-Latf-CH-1996}
-\setlanguagealias*[script=blackletter]{german}{de-Latf}
-\setlanguagealias*[variant=german,spelling=new]{german}{de-DE-1996}
-\setlanguagealias*[variant=german,spelling=old,script=blackletter]{german}{de-Latf-DE-1901}
-\setlanguagealias*[variant=german,spelling=new,script=blackletter]{german}{de-Latf-DE-1996}
-\setlanguagealias*[variant=austrian,spelling=new,script=blackletter]{german}{de-Latf-AT-1996}
-
-% Babel aliases
-\setlanguagealias[variant=austrian,spelling=old]{german}{austrian}
-\setlanguagealias[variant=austrian,spelling=new]{german}{naustrian}
-\setlanguagealias[variant=german,spelling=old]{german}{germanb}
-\setlanguagealias[variant=german,spelling=new]{german}{ngerman}
-\setlanguagealias[variant=swiss,spelling=old]{german}{swissgerman}
-\setlanguagealias[variant=swiss,spelling=new]{german}{nswissgerman}
-
-\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
- \if@swiss@locale
- \if@german@blackletter
- \SetLanguageKeys{german}{babelname=swissgerman,bcp47=de-Latf-CH-1901,bcp47-language=de,bcp47-region=CH,bcp47-variant=1901,bcp47-script=Latf}%
- \else
- \SetLanguageKeys{german}{babelname=swissgerman,bcp47=de-CH-1901,bcp47-language=de,bcp47-region=CH,bcp47-variant=1901,bcp47-script=Latn}%
- \fi
- \else
- \if@austrian@locale
- \if@german@blackletter
- \SetLanguageKeys{german}{babelname=austrian,bcp47=de-Latf-AT-1901,bcp47-language=de,bcp47-region=AT,bcp47-variant=1901,bcp47-script=Latf}%
- \else
- \SetLanguageKeys{german}{babelname=austrian,bcp47=de-AT-1901,bcp47-language=de,bcp47-region=AT,bcp47-variant=1901,bcp47-script=Latn}%
- \fi
- \else
- \if@german@blackletter
- \SetLanguageKeys{german}{babelname=german,bcp47=de-Latf-DE-1901,bcp47-script=Latf,bcp47-language=de,bcp47-region=DE,bcp47-variant=1901,bcp47-script=Latf}%
- \else
- \SetLanguageKeys{german}{babelname=german,bcp47=de-DE-1901,bcp47-language=de,bcp47-region=DE,bcp47-variant=1901,bcp47-script=Latn}%
- \fi
- \fi\fi
- \else
- \if@swiss@locale
- \if@german@blackletter
- \SetLanguageKeys{german}{babelname=nswissgerman,bcp47=de-Latf-CH,bcp47-language=de,bcp47-region=CH,bcp47-variant=1996,bcp47-script=Latf}%
- \else
- \SetLanguageKeys{german}{babelname=nswissgerman,bcp47=de-CH,bcp47-language=de,bcp47-region=CH,bcp47-variant=1996,bcp47-script=Latn}%
- \fi
- \else
- \if@austrian@locale
- \if@german@blackletter
- \SetLanguageKeys{german}{babelname=naustrian,bcp47=de-Latf-AT,bcp47-language=de,bcp47-region=AT,bcp47-variant=1996,bcp47-script=Latf}%
- \else
- \SetLanguageKeys{german}{babelname=naustrian,bcp47=de-AT,bcp47-language=de,bcp47-region=AT,bcp47-variant=1996,bcp47-script=Latn}%
- \fi
- \else
- \if@german@blackletter
- \SetLanguageKeys{german}{babelname=ngerman,bcp47=de-Latf-DE,bcp47-language=de,bcp47-region=DE,bcp47-variant=1996,bcp47-script=Latf}%
- \else
- \SetLanguageKeys{german}{babelname=ngerman,bcp47=de-DE,bcp47-language=de,bcp47-region=DE,bcp47-variant=1996,bcp47-script=Latn}%
- \fi
- \fi\fi
- \fi
-}
-
-\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]{}
-
-\setkeys{german}{spelling,script,variant}
-
-% Register default options
-\xpg@initialize@gloss@options{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}
-
-\ifsystem@babelshorthands
- \setkeys{german}{babelshorthands=true}
-\else
- \setkeys{german}{babelshorthands=false}
-\fi
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
-
-\def\german@shorthands{%
- \xpg@activate@shorthands%
- \def\language@group{german}%
- \declare@shorthand{german}{"`}{„}%
- \declare@shorthand{german}{"'}{“}%
- \declare@shorthand{german}{"<}{«}%
- \declare@shorthand{german}{">}{»}%
- \declare@shorthand{german}{"c}{\textormath{\bbl@disc@german ck}{c}}%
- \declare@shorthand{german}{"C}{\textormath{\bbl@disc@german CK}{C}}%
- \declare@shorthand{german}{"F}{\textormath{\bbl@disc@german F{FF}}{F}}%
- \declare@shorthand{german}{"l}{\textormath{\bbl@disc@german l{ll}}{l}}%
- \declare@shorthand{german}{"L}{\textormath{\bbl@disc@german L{LL}}{L}}%
- \declare@shorthand{german}{"m}{\textormath{\bbl@disc@german m{mm}}{m}}%
- \declare@shorthand{german}{"M}{\textormath{\bbl@disc@german M{MM}}{M}}%
- \declare@shorthand{german}{"n}{\textormath{\bbl@disc@german n{nn}}{n}}%
- \declare@shorthand{german}{"N}{\textormath{\bbl@disc@german N{NN}}{N}}%
- \declare@shorthand{german}{"p}{\textormath{\bbl@disc@german p{pp}}{p}}%
- \declare@shorthand{german}{"P}{\textormath{\bbl@disc@german P{PP}}{P}}%
- \declare@shorthand{german}{"r}{\textormath{\bbl@disc@german r{rr}}{r}}%
- \declare@shorthand{german}{"R}{\textormath{\bbl@disc@german R{RR}}{R}}%
- \declare@shorthand{german}{"t}{\textormath{\bbl@disc@german t{tt}}{t}}%
- \declare@shorthand{german}{"T}{\textormath{\bbl@disc@german T{TT}}{T}}%
- \declare@shorthand{german}{"f}{\texorpdfstring{\textormath{\bbl@discff}{f}}{f}}%
- \def\bbl@discff{\penalty\@M
- \afterassignment\bbl@insertff \cslet{bbl@nextff}{ }}%
- \def\bbl@insertff{%
- \if f\bbl@nextff
- \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
- {\relax\discretionary{ff-}{f}{ff}\allowhyphens}{f\bbl@nextff}}%
- \cslet{bbl@nextff}{f}%
- \declare@shorthand{german}{"-}{\nobreak\-\nobreak\hskip\z@skip}%
- \declare@shorthand{german}{"|}{\textormath{\penalty\@M\discretionary{-}{}{\kern.03em}}{}}%
- \declare@shorthand{german}{""}{\hskip\z@skip}%
- \declare@shorthand{german}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
- \declare@shorthand{german}{"=}{\penalty\@M-\hskip\z@skip}%
- \declare@shorthand{german}{"/}{\textormath
- {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}%
- \def\ck{\allowhyphens\discretionary{k-}{k}{ck}\allowhyphens}%
- \def\mkgender{*}%
- \declare@shorthand{german}{":}{\nobreak:\bbl@allowhyphens}%
- \declare@shorthand{german}{"*}{\nobreak*\bbl@allowhyphens}%
- \declare@shorthand{german}{"_}{\nobreak\_\bbl@allowhyphens}%
- \declare@shorthand{german}{"x}{\nobreak\mkgender\bbl@allowhyphens}%
-}
-
-\def\nogerman@shorthands{%
- \xpg@deactivate@shorthands%
-}
-
-\def\captions@german{%
- \def\prefacename{Vorwort}%
- \def\refname{Literatur}%
- \def\abstractname{Zusammenfassung}%
- \def\bibname{Literaturverzeichnis}%
- \def\chaptername{Kapitel}%
- \def\appendixname{Anhang}%
- \def\contentsname{Inhaltsverzeichnis}%
- \def\listfigurename{Abbildungsverzeichnis}%
- \def\listtablename{Tabellenverzeichnis}%
- \def\indexname{Index}%
- \def\figurename{Abbildung}%
- \def\tablename{Tabelle}%
- \def\partname{Teil}%
- \def\enclname{Anlage(n)}%
- \def\ccname{Verteiler}%
- \def\headtoname{An}%
- \def\pagename{Seite}%
- \def\seename{siehe}%
- \def\alsoname{siehe auch}%
- \def\proofname{Beweis}%
- \def\glossaryname{Glossar}%
-}
-\def\date@german{%
- \def\today{\number\day.%
- \space \ifcase\month%
- \or\if@austrian@locale Jänner\else Januar\fi\or Februar\or März\or%
- April\or Mai\or Juni\or Juli\or August\or September\or Oktober\or%
- November\or Dezember\fi
- \space \number\year}%
-}
-
-\def\captions@german@austrian{%
- \def\enclname{Beilage(n)}%
-}
-
-\def\captions@german@swiss{%
- \def\enclname{Beilage(n)}%
-}
-
-%%Strings for Fraktur contributed by Gerrit <z0idberg . gmx . de>
-\def\captions@german@blackletter{%
- \captions@german%
- \def\abstractname{Zuſammenfaſſung}%
- \def\seename{ſiehe}%
- \def\alsoname{ſiehe auch}%
- \def\glossaryname{Gloſſar}%
-}
-
-\def\date@german@blackletter{%
- \def\today{\number\day.%
- \space \ifcase\month%
- \or\if@austrian@locale Jänner\else Januar\fi\or Februar\or März\or%
- April\or Mai\or Juni\or Juli\or Auguſt\or September\or Oktober\or%
- November\or Dezember\fi
- \space \number\year}%
-}
-
-\def\captionsgerman{%
- \if@german@blackletter\captions@german@blackletter\else\captions@german\fi
- \if@austrian@locale\captions@german@austrian\fi
- \if@swiss@locale\captions@german@swiss\fi
-}
-
-\def\dategerman{%
- \if@german@blackletter\date@german@blackletter\else\date@german\fi
-}
-
-\def\german@language{%
- \if@german@oldspelling
- \if@swiss@locale
- \polyglossia@setup@language@patterns{swissgerman}%
- \else
- \polyglossia@setup@language@patterns{german}%
- \fi
- \if@austrian@locale
- \adddialect\l@austrian\l@german%
- \fi
- \else
- \polyglossia@setup@language@patterns{ngerman}%
- \if@austrian@locale
- \adddialect\l@naustrian\l@ngerman%
- \fi
- \if@swiss@locale
- \adddialect\l@nswissgerman\l@ngerman%
- \fi
- \fi
-}
-
-\def\noextras@german{%
- \ifgerman@babelshorthands\nogerman@shorthands\fi%
-}
-
-\def\blockextras@german{%
- \ifgerman@babelshorthands\german@shorthands\else\nogerman@shorthands\fi%
-}
-
-\def\inlineextras@german{%
- \ifgerman@babelshorthands\german@shorthands\else\nogerman@shorthands\fi%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-german.ldf>
-%<*gloss-germanb.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-germanb.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-germanb.ldf}[polyglossia: module for German (old spelling)]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{german}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-germanb.ldf>
-%<*gloss-gl.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-gl.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-gl.ldf}[polyglossia: module for gl (Galician)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{galician}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-gl.ldf>
-%<*gloss-grc.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-grc.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-grc.ldf}[polyglossia: module for grc (Greek)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{greek}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-grc.ldf>
-%<*gloss-greek.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-greek.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-greek.ldf}[polyglossia: module for Greek]
-
-\PolyglossiaSetup{greek}{
- bcp47=el-monoton,
- bcp47-language=el,
- bcp47-variant=monoton,
- bcp47-script=Grek,
- bcp47-extension-u=nu-grek,
- bcp47-casing=el,
- script=Greek,
- scripttag=grek,
- langtag=ELL,
- frenchspacing=true,
- indentfirst=true,
- fontsetup=true,
- localnumeral=greeknumerals,
- Localnumeral=Greeknumerals
- %TODO localalph={greek@alph,greek@Alph}
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*[variant=ancient]{greek}{grc}
-\setlanguagealias*[varant=polytonic]{greek}{el-polyton}
-\setlanguagealias*[variant=monotonic]{greek}{el-monoton}
-\setlanguagealias*{greek}{el}
-
-% Babel aliases
-\setlanguagealias[variant=polytonic]{greek}{polutonikogreek}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% The code in this file was initially adapted from the antomega
-%% module for greek. Currently large parts of it derive from the
-%% package xgreek.sty (c) Apostolos Syropoulos
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% this file imported from xgreek fixes the \lccode and \uccode of Greek letters:
-\input{xgreek-fixes.def}
-
-\def\greek@variant{monogreek}
-
-\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}{}%
- {\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}%
- \def\greek@variant{ancientgreek}%
- \def\captionsgreek{\ancientgreekcaptions}%
- \def\dategreek{\dateancientgreek}%
- \SetLanguageKeys{greek}{babelname=greek,bcp47=grc,bcp47-language=grc,bcp47-variant={}}%
- \else
- \if@greek@poly
- \xpg@ifdefined{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}%
- \def\greek@variant{polygreek}%
- \def\captionsgreek{\polygreekcaptions}%
- \def\dategreek{\datepolygreek}%
- \SetLanguageKeys{greek}{babelname=polutonikogreek,bcp47=el-polyton,bcp47-language=el,bcp47-variant=polyton}%
- \else% monotonic greek
- \xpg@ifdefined{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}%
- \def\greek@variant{monogreek}% monotonic
- \def\captionsgreek{\monogreekcaptions}%
- \def\dategreek{\datemonogreek}%
- \SetLanguageKeys{greek}{babelname=greek,bcp47=el-monoton,bcp47-language=el,bcp47-variant=monoton}%
- \fi%
- \fi%
-}
-
-
-\def\greek@language{%
- \polyglossia@setup@language@patterns{\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.}}
-
-% Register default options
-\xpg@initialize@gloss@options{greek}{variant=monotonic,numerals=greek}
-% Register alias options
-\xpg@set@alias@values{greek}{variant}{monotonic}{mono}
-\xpg@set@alias@values{greek}{variant}{polytonic}{poly}
-
-\def\monogreekcaptions{%
- \def\refname{Αναφορές}%
- \def\abstractname{Περίληψη}%
- \def\bibname{Βιβλιογραφία}%
- \def\prefacename{Πρόλογος}%
- \def\chaptername{Κεφάλαιο}%
- \def\appendixname{Παράρτημα}%
- \def\contentsname{Περιεχόμενα}%
- \def\listfigurename{Κατάλογος σχημάτων}%
- \def\listtablename{Κατάλογος πινάκων}%
- \def\indexname{Ευρετήριο}%
- \def\figurename{Σχήμα}%
- \def\tablename{Πίνακας}%
- \def\partname{Μέρος}%
- \def\pagename{Σελίδα}%
- \def\seename{βλέπε}%
- \def\alsoname{βλέπε επίσης}%
- \def\enclname{Συνημμένα}%
- \def\ccname{Κοινοποίηση}%
- \def\headtoname{Προς}%
- \def\proofname{Απόδειξη}%
- \def\glossaryname{Γλωσσάρι}}%
-
-\def\datemonogreek{%
- \def\today{\number\day\space%
- \greek@month%
- \space\number\year}%
- \def\greektoday{\greeknumber\day\space%
- \greek@month%
- \space\greeknumber\year}%
- \def\Greektoday{\Greeknumber\day\space%
- \greek@month%
- \space\Greeknumber\year}%
- \def\greek@month{\ifcase\month\or%
- Ιανουαρίου\or
- Φεβρουαρίου\or
- Μαρτίου\or
- Απριλίου\or
- Μαΐου\or
- Ιουνίου\or
- Ιουλίου\or
- Αυγούστου\or
- Σεπτεμβρίου\or
- Οκτωβρίου\or
- Νοεμβρίου\or
- Δεκεμβρίου\fi}}%
-
-\def\polygreekcaptions{%
- \def\refname{Ἀναφορές}%
- \def\abstractname{Περίληψη}%
- \def\bibname{Βιβλιογραφία}%
- \def\prefacename{Πρόλογος}%
- \def\chaptername{Κεφάλαιο}%
- \def\appendixname{Παράρτημα}%
- \def\contentsname{Περιεχόμενα}%
- \def\listfigurename{Κατάλογος σχημάτων}%
- \def\listtablename{Κατάλογος πινάκων}%
- \def\indexname{Εὑρετήριο}%
- \def\figurename{Σχῆμα}%
- \def\tablename{Πίνακας}%
- \def\partname{Μέρος}%
- \def\pagename{Σελίδα}%
- \def\seename{βλέπε}%
- \def\alsoname{βλέπε ἐπίσης}%
- \def\enclname{Συνημμένα}%
- \def\ccname{Κοινοποίηση}%
- \def\headtoname{Πρὸς}%
- \def\proofname{Ἀπόδειξη}}%
-
-\def\datepolygreek{%
- \def\today{\number\day\space%
- \greek@month%
- \space\number\year}%
- \def\greektoday{\greeknumber\day\space%
- \greek@month%
- \space\greeknumber\year}%
- \def\Greektoday{\Greeknumber\day\space%
- \greek@month%
- \space\Greeknumber\year}%
- \def\greek@month{\ifcase\month\or%
- Ἰανουαρίου\or
- Φεβρουαρίου\or
- Μαρτίου\or
- Ἀπριλίου\or
- Μαΐου\or
- Ἰουνίου\or
- Ἰουλίου\or
- Αὐγούστου\or
- Σεπτεμβρίου\or
- Ὀκτωβρίου\or
- Νοεμβρίου\or
- Δεκεμβρίου\fi}}%
-
-% this is copied verbatim from xgreek.sty:
-\def\ancientgreekcaptions{%
- \def\prefacename{Προοίμιον}%
- \def\refname{Αναφοραί}%
- \def\abstractname{Περίληψις}%
- \def\bibname{Βιβλιογραφία}%
- \def\chaptername{Κεφάλαιον}%
- \def\appendixname{Παράρτημα}%
- \def\contentsname{Περιεχόμενα}%
- \def\listfigurename{Κατάλογος σχημάτων}%
- \def\listtablename{Κατάλογος πινάκων}%
- \def\indexname{Εὑρετήριον}%
- \def\figurename{Σχήμα}%
- \def\tablename{Πίναξ}%
- \def\partname{Μέρος}%
- \def\enclname{Συνημμένως}%
- \def\ccname{Κοινοποίησις}%
- \def\headtoname{Πρὸς}%
- \def\pagename{Σελὶς}%
- \def\seename{ὅρα}%
- \def\alsoname{ὅρα ὡσαύτως}%
- \def\proofname{Ἀπόδειξις}%
- \def\glossaryname{Γλωσσάριον}%
- \def\refname{Ἀναφοραὶ}%
- \def\indexname{Εὑρετήριο}%
- \def\figurename{Σχῆμα}%
- \def\headtoname{Πρὸς}}%
-
-\def\dateancientgreek{%
- \def\today{\number\day\space%
- \greek@month%
- \space\number\year}%
- \def\greektoday{\greeknumber\day\space%
- \greek@month%
- \space\greeknumber\year}%
- \def\Greektoday{\Greeknumber\day\space%
- \greek@month%
- \space\Greeknumber\year}%
- \def\greek@month{\ifcase\month\or%
- Ἰανουαρίου\or
- Φεβρουαρίου\or
- Μαρτίου\or
- Ἀπριλίου\or
- Μαΐου\or
- Ἰουνίου\or
- Ἰουλίου\or
- Αὐγούστου\or
- Σεπτεμβρίου\or
- Ὀκτωβρίου\or
- Νοεμβρίου\or
- Δεκεμβρίου\fi}}
-
-% the code for alphabetic numbers and attic numerals
-\newrobustcmd\anw@print{}
-\newrobustcmd\anw@false{%
- \renewrobustcmd\anw@print{}}
-\newrobustcmd\anw@true{%
- \renewrobustcmd\anw@print{ʹ}}
-\anw@true
-
-% Use \providecommand here as the ldf file might
-% be reloaded via politunikogreek.
-\providecommand{\greeknumerals}[2]{\greeknumber{#2}}
-\providecommand{\Greeknumerals}[2]{\Greeknumber{#2}}
-
-\protected\def\greeknumber#1{\expandafter\@greeknumber\expandafter{\number#1}}
-\def\@greeknumber#1{%
- \ifnum#1<\@ne\space\gr@ill@value{#1}%
- \else
- \ifnum#1<10\expandafter\gr@num@i\number#1%
- \else
- \ifnum#1<100\expandafter\gr@num@ii\number#1%
- \else
- \ifnum#1<\@m\expandafter\gr@num@iii\number#1%
- \else
- \ifnum#1<\@M\expandafter\gr@num@iv\number#1%
- \else
- \ifnum#1<100000\expandafter\gr@num@v\number#1%
- \else
- \ifnum#1<1000000\expandafter\gr@num@vi\number#1%
- \else
- \space\gr@ill@value{#1}%
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
-}
-\protected\def\Greeknumber#1{\expandafter\@Greeknumber\expandafter{\number#1}}
-\def\@Greeknumber#1{%
- \ifnum#1<\@ne\space\gr@ill@value{#1}%
- \else
- \ifnum#1<10\expandafter\gr@Num@i\number#1%
- \else
- \ifnum#1<100\expandafter\gr@Num@ii\number#1%
- \else
- \ifnum#1<\@m\expandafter\gr@Num@iii\number#1%
- \else
- \ifnum#1<\@M\expandafter\gr@Num@iv\number#1%
- \else
- \ifnum#1<100000\expandafter\gr@Num@v\number#1%
- \else
- \ifnum#1<1000000\expandafter\gr@Num@vi\number#1%
- \else
- \space\gr@ill@value{#1}%
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
-}
-\let\greeknumeral=\greeknumber
-\let\Greeknumeral=\Greeknumber
-\def\gr@num@i#1{%
- \ifcase#1\or α\or β\or γ\or δ\or ε\or ϛ\or ζ\or η\or θ\fi
- \ifnum#1=\z@\else\anw@true\fi\anw@print}
-\def\gr@num@ii#1{%
- \ifcase#1\or ι\or κ\or λ\or μ\or ν\or ξ\or ο\or π\or ϟ\fi
- \ifnum#1=\z@\else\anw@true\fi\gr@num@i}
-\def\gr@num@iii#1{%
- \ifcase#1\or ρ\or σ\or τ\or υ\or φ\or χ\or ψ\or ω\or ϡ\fi
- \ifnum#1=\z@\anw@false\else\anw@true\fi\gr@num@ii}
-\def\gr@num@iv#1{%
- \ifnum#1=\z@\else ͵\fi
- \ifcase#1\or α\or β\or γ\or δ\or ε\or Ϛ\or ζ\or η\or θ\fi
- \gr@num@iii}
-\def\gr@num@v#1{%
- \ifnum#1=\z@\else ͵\fi
- \ifcase#1\or ι\or κ\or λ\or μ\or ν\or ξ\or ο\or π\or ϟ\fi
- \gr@num@iv}
-\def\gr@num@vi#1{%
- ͵\ifcase#1\or ρ\or σ\or τ\or υ\or φ\or χ\or ψ\or ω\or ϡ\fi
- \gr@num@v}
-\def\gr@Num@i#1{%
- \ifcase#1 \or Α\or Β\or Γ\or Δ\or Ε\or Ϛ\or Ζ\or Η\or θ\fi
- \ifnum#1=\z@\else\anw@true\fi\anw@print}
-\def\gr@Num@ii#1{%
- \ifcase#1 \or Ι\or Κ\or Λ\or Μ\or Ν\or Ξ\or Ο\or Π\or \MakeUppercase{ϟ}\fi
- \ifnum#1=\z@\else\anw@true\fi\gr@Num@i}
-\def\gr@Num@iii#1{%
- \ifcase#1 \or Ρ\or Σ\or Τ\or Υ\or Φ\or Χ\or Ψ\or Ω\or \MakeUppercase{ϡ}\fi
- \ifnum#1=\z@\anw@false\else\anw@true\fi\gr@Num@ii}
-\def\gr@Num@iv#1{%
- \ifnum#1=\z@\else ͵\fi
- \ifcase#1 \or Α\or Β\or Γ\or Δ\or Ε\or \MakeUppercase{Ϛ}\or Ζ\or Η\or θ\fi
- \gr@Num@iii}
-\def\gr@Num@v#1{%
- \ifnum#1=\z@\else ͵\fi
- \ifcase#1 \or Ι\or Κ\or Λ\or Μ\or Ν\or Ξ\or Ο\or Π\or \MakeUppercase{ϟ}\fi
-\gr@Num@iv}
- \def\gr@Num@vi#1{%
-͵ \ifcase#1 \or Ρ\or Σ\or Τ\or Υ\or Φ\or Χ\or Ψ\or Ω\or \MakeUppercase{ϡ}\fi
- \gr@Num@v}
-\def\gr@ill@value#1{\xpg@warning{Illegal value (#1) for Greek numeral}[$#1$]}
-
-%%%% Attic numerals (no longer optional)
-\newcount\@attic@num
-\DeclareRobustCommand*{\@@atticnum}[1]{%
- \@attic@num#1\relax
- \ifnum\@attic@num<\@ne%
- \space%
- \xpg@warning{Illegal value (\the\@attic@num) for acrophonic Attic numeral}%
- \else\ifnum\@attic@num>249999%
- \space%
- \xpg@warning{Illegal value (\the\@attic@num) for acrophonic Attic numeral}%
- \else
- \@whilenum\@attic@num>49999\do{%
- \char"10147\advance\@attic@num-50000}%
- \@whilenum\@attic@num>9999\do{%
- M\advance\@attic@num-\@M}%
- \ifnum\@attic@num>4999%
- \char"10146\advance\@attic@num-5000%
- \fi\relax
- \@whilenum\@attic@num>999\do{%
- Χ\advance\@attic@num-\@m}%
- \ifnum\@attic@num>499%
- \char"10145\advance\@attic@num-500%
- \fi\relax
- \@whilenum\@attic@num>99\do{%
- Η\advance\@attic@num-100}%
- \ifnum\@attic@num>49%
- \char"10144\advance\@attic@num-50%
- \fi\relax
- \@whilenum\@attic@num>9\do{%
- Δ\advance\@attic@num by-10}%
- \@whilenum\@attic@num>4\do{%
- Π\advance\@attic@num-5}%
- \ifcase\@attic@num\or Ι\or ΙΙ\or ΙΙΙ\or ΙΙΙΙ\fi%
- \fi\fi}
-\def\@atticnum#1{%
- \expandafter\@@atticnum\expandafter{\the#1}}
-\def\atticnumeral#1{%
- \@attic@num#1\relax
- \@atticnum{\@attic@num}}
-\let\atticnum=\atticnumeral
-
-\def\greek@numbers{%
- \if@greek@numerals
- \def\greek@alph##1{\expandafter\greeknumeral\expandafter{\the##1}}%
- \def\greek@Alph##1{\expandafter\Greeknumeral\expandafter{\the##1}}%
- \let\@alph\greek@alph%
- \let\@Alph\greek@Alph%
- \fi}
-
-\def\nogreek@numbers{%
- \let\@alph\latin@alph%
- \let\@Alph\latin@Alph%
- \let\greek@alph\@undefined%
- \let\greek@Alph\@undefined%
- }
-
-% \end{macrocode}
-% \iffalse
-%</gloss-greek.ldf>
-%<*gloss-he.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-he.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-he.ldf}[polyglossia: module for he (Hebrew)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{hebrew}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-he.ldf>
-%<*gloss-hebrew.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-hebrew.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-hebrew.ldf}[polyglossia: module for Hebrew]
-
-\RequireBidi
-\RequirePackage{hebrewcal}
-
-\PolyglossiaSetup{hebrew}{
- bcp47=he,
- bcp47-language=hr,
- bcp47-region=HE,
- bcp47-script=Hebr,
- script=Hebrew,
- direction=RL,
- scripttag=hebr,
- langtag=IWR,
- hyphennames={nohyphenation},
- fontsetup=true,
- localnumeral=hebrewnumerals
- %TODO localalph={hebrewnumeral,Hebrewnumeral}
- %digits = hebrewnumber
-}
-
-% 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}
-
-% Register default options
-\xpg@initialize@gloss@options{hebrew}{numerals=arabic,calendar=gregorian,marcheshvan=false,fullyear=false}
-
-\def\captionshebrew{%
- \def\prefacename{מבוא}%
- \def\refname{מקורות}%
- \def\abstractname{תקציר}%
- \def\bibname{ביבליוגרפיה}%
- \def\chaptername{פרק}%
- \def\appendixname{נספח}%
- \def\contentsname{תוכן העניינים}%
- \def\listfigurename{רשימת האיורים}%
- \def\listtablename{רשימת הטבלאות}%
- \def\indexname{מפתח}%
- \def\figurename{איור}%
- \def\tablename{טבלה}%
- \def\partname{חלק}%
- \def\enclname{רצ"ב}%
- \def\ccname{העתקים}%
- \def\headtoname{אל}%
- \def\pagename{עמוד}%
- \def\psname{נ.ב.}%
- \def\seename{ראה}%
- \def\alsoname{ראה גם}% check
- \def\proofname{הוכחה}%
- \def\glossaryname{מילון מונחים}% check
-}
-\def\datehebrew{%
- \def\today{%
- \if@calendar@hebrew
- \hebrewtoday
- \else
- \hebrewnumber\day
- \space ב\hebrewgregmonth{\month}\space
- \hebrewnumber\year
- \fi
- }%
-}
-
-\def\hebrewgregmonth#1{\ifcase#1%
- \or ינואר% יאנואר
- \or פברואר\or מרץ% מרס / מארס
- \or אפריל\or מאי% מי
- \or יוני\or יולי\or אוגוסט %אבגוסט
- \or ספטמבר\or אוקטובר\or נובמבר\or דצמבר\fi}
-
-\input{babel-hebrewalph.def}
-
-\newcommand{\hebrewnumerals}[2]{\hebrewnumber{#2}}
-
-\def\hebrewnumber#1{%
- \if@hebrew@numerals
- \hebrewnumeral{#1}%
- \else
- \number#1%
- \fi
-}
-
-\ifxetex
- % Bidi inserts an RTL mark (0x200f) between number and number separator (- .),
- % forcing numbers to RTL. This is wrong for Hebrew.
- % So we defunc the respective command with XeTeX.
- \let\xpg@orig@DigitsDotDashInterCharToks\DigitsDotDashInterCharToks
-
- \def\hebrew@ltr@numbers{%
- \renewcommand*{\DigitsDotDashInterCharToks}{}%
- }
-
- \def\nohebrew@ltr@numbers{%
- % Restore bidi's \DigitsDotDashInterCharToks
- \let\DigitsDotDashInterCharToks\xpg@orig@DigitsDotDashInterCharToks
- }
-\else
- % Only dummy commands (nothing to do here) for LuaTeX
- \def\hebrew@ltr@numbers{}
- \def\nohebrew@ltr@numbers{}
-\fi
-
-\def\hebrew@numbers{%
- \let\@alph\hebrewnumeral
- \let\@Alph\Hebrewnumeral
- % Prevent bidi from setting the numbers RTL
- \hebrew@ltr@numbers
-}
-
-\def\nohebrew@numbers{%
- \let\@alph\latin@alph
- \let\@Alph\latin@Alph
- % Restore previous bidi numbers definition
- \nohebrew@ltr@numbers
-}
-
-\def\hebrew@globalnumbers{%
- \let\@arabic\hebrewnumber
- \renewcommand\thefootnote{\localnumeral*{footnote}}%
- % Prevent bidi from setting the numbers RTL
- \hebrew@ltr@numbers
-}
-
-% Store original definition
-\let\xpg@save@arabic\@arabic
-
-\def\nohebrew@globalnumbers{%
- \let\@arabic\xpg@save@arabic
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-hebrew.ldf>
-%<*gloss-hi.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-hi.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-hi.ldf}[polyglossia: module for hi (Hindi)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{hindi}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-hi.ldf>
-%<*gloss-hindi.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-hindi.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-% UTF-8 strings kindly provided by Zdenĕk Wagner, 10-03-2008
-% with corrections and additional contributions by Anshuman Pandey
-% TODO: add option for velthuis transliteration with link to
-% Velthuis Devanagari project.
-
-\ProvidesFile{gloss-hindi.ldf}[polyglossia: module for Hindi]
-\RequirePackage{devanagaridigits}
-\PolyglossiaSetup{hindi}{
- bcp47=hi,
- bcp47-language=hi,
- bcp47-script=Deva,
- script=Devanagari,
- scripttag=deva,
- langtag=HIN,
-%% hyphennames={hindi,!sanskrit}, TODO: implement fallback patterns (with ! prefix)
- fontsetup=true,
- localnumeral=hindinumerals
- %TODO nouppercase=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{hindi}{hi}
-
-\ifx\l@hindi\@undefined%
- \ifx\l@sanskrit\@undefined%
- \xpg@nopatterns{Hindi}%
- \adddialect\l@hindi\l@nohyphenation%
- \else
- \xpg@warning{No hyphenation patterns were loaded for Hindi\MessageBreak
- I will use the patterns for Sanskrit instead}
- \adddialect\l@hindi\l@sanskrit%
- \fi
-\fi
-
-\def\hindi@language{%
- \polyglossia@setup@language@patterns{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'}}
-
-% Register default options
-\xpg@initialize@gloss@options{hindi}{numerals=devanagari}
-
-\newcommand{\hindinumerals}[2]{\hindinumber{#2}}
-
-\def\hindinumber#1{%
- \ifhindi@devanagari@numerals
- \devanagaridigits{\number#1}%
- \else
- \number#1%
- \fi}
-
-\def\captionshindi{%
- \def\abstractname{सारांश}%
- \def\appendixname{परिशिष्ट}%
- \def\bibname{संदर्भ ग्रंथ}%
- \def\ccname{}%
- \def\chaptername{अध्याय}%
- \def\contentsname{विषय सूची}%
- \def\enclname{}%
- \def\figurename{चित्र}% रेखाचित्र
- \def\headpagename{पृष्ठ}%
- \def\headtoname{}%
- \def\indexname{सूची}%
- % सूचक
- % अनुक्रमणिका
- % अनुक्रमणि
- \def\listfigurename{चित्रों की सूची}%
- \def\listtablename{तालिकाओं की सूची}%
- \def\pagename{पृष्ठ}%
- \def\partname{खण्ड}%
- \def\prefacename{प्रस्तावना}% प्राक्कथन
- \def\refname{हवाले}%
- \def\tablename{तालिका}%
- \def\seename{देखिए}%
- \def\alsoname{और देखिए}%
- \def\alsoseename{और देखिए}%
-}
-\def\datehindi{%
- \def\today{\hindinumber\day\space\ifcase\month\or
- जनवरी\or
- फ़रवरी\or
- मार्च\or
- अपरैल\or
- मई\or
- जून\or
- जलाई\or
- अगस्त\or
- सितम्बर\or
- अक्तूबर\or
- नवम्बर\or
- दिसम्बर\fi
- \space\hindinumber\year}%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-hindi.ldf>
-%<*gloss-hr.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-hr.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-hr.ldf}[polyglossia: module for hr (Croatian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{croatian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-hr.ldf>
-%<*gloss-hsb.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-hsb.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-hsb.ldf}[polyglossia: module for hsb (Higher Sorbian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{sorbian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-hsb.ldf>
-%<*gloss-hu.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-hu.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-hu.ldf}[polyglossia: module for hu (Hungarian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{hungarian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-hu.ldf>
-%<*gloss-hungarian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-hungarian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-hungarian.ldf}[polyglossia: module for Hungarian]
-
-\PolyglossiaSetup{hungarian}{
- bcp47=hu,
- bcp47-language=hu,
- bcp47-region=HU,
- bcp47-script=Latn,
- babelname=magyar,
- hyphennames={hungarian,magyar},
- langtag=HUN,
- hyphenmins={2,2},
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{hungarian}{hu}
-
-\frenchspacing
-
-% Babel and backwards compat. alias
-\setlanguagealias{hungarian}{magyar}
-
-\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]{}
-
-% Register default options
-% forceheadinpunctuatin is recommended, but the default value is false for compatibility reasons
-\xpg@initialize@gloss@options{hungarian}{swapstrings=all,
- forceheadingpunctuation=false}
-
-
-\def\hungarian@language{%
- \polyglossia@setup@language@patterns{hungarian}%
- \xpg@ifdefined{hungarian}{\adddialect\l@magyar\l@hungarian}{}%
-}%
-
-\def\captionshungarian{%
- \def\refname{Hivatkozások}%
- \def\abstractname{Kivonat}%
- \def\bibname{Irodalomjegyzék}%
- \def\prefacename{Előszó}%
- \def\chaptername{fejezet}%
- \def\appendixname{Függelék}%
- \def\contentsname{Tartalomjegyzék}%
- \def\listfigurename{Ábrák jegyzéke}%
- \def\listtablename{Táblázatok jegyzéke}%
- \def\indexname{Tárgymutató}%
- \def\figurename{ábra}%
- \def\tablename{táblázat}%
- %\def\thepart{}%
- \def\partname{rész}%
- \def\pagename{oldal}%
- \def\seename{lásd}%
- \def\alsoname{lásd még}%
- \def\enclname{Melléklet}%
- \def\ccname{Körlevél–címzettek}%
- \def\headtoname{Címzett}%
- \def\proofname{Bizonyítás}%
- \def\glossaryname{Szójegyzék}%
-}
-
-\def\datehungarian{%
- \def\today{%
- \number\year.\nobreakspace\ifcase\month\or
- január\or február\or március\or
- április\or május\or június\or
- július\or augusztus\or szeptember\or
- október\or november\or december\fi
- \space\number\day.}%
- \def\ondatehungarian{%
- \number\year.\nobreakspace\ifcase\month\or
- január\or február\or március\or
- április\or május\or június\or
- július\or augusztus\or szeptember\or
- október\or november\or december\fi
- \space\ifcase\day\or
- 1-jén\or 2-án\or 3-án\or 4-én\or 5-én\or
- 6-án\or 7-én\or 8-án\or 9-én\or 10-én\or
- 11-én\or 12-én\or 13-án\or 14-én\or 15-én\or
- 16-án\or 17-én\or 18-án\or 19-én\or 20-án\or
- 21-én\or 22-én\or 23-án\or 24-én\or 25-én\or
- 26-án\or 27-én\or 28-án\or 29-én\or 30-án\or
- 31-én\fi}%
- \let\ontoday\ondatehungarian%
- \let\ondatemagyar\ondatehungarian%
-}
-
-% Save original capsformats
-\let\xpg@save@fnum@table\fnum@table
-\let\xpg@save@fnum@figure\fnum@figure
-
-\def\hungarian@capsformat{%
- %
- % Change captions
- \if@hungarian@swapcaptions
- % change 'ábra x.x' to 'x.x. ábra'
- \def\fnum@figure{\thefigure.~\figurename}
- %
- % change 'táblázat x.x' to 'x.x. táblázat'
- \def\fnum@table{\thetable.~\tablename}
- \fi
- %
- % 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)
- % 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)
- % With standard classes
- \ifcsdef{@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)
- \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)
- }% (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)
- % With standard classes
- \ifcsdef{chaptermark}{%
- \ifpatchable{\chaptermark}%
- {\@chapapp\ \thechapter.}%
- {\let\xpg@save@chaptermark@format\chaptermark%
- \patchcmd{\chaptermark}%
- {\@chapapp\ \thechapter.}%
- {\thechapter.\ \@chapapp\@hungarian@forced@dot}%
- {}%
- {\xpg@warning{Failed to patch chaptermark for Hungarian}}}%
- {}%
- }{}% (end \ifdefined\chaptermark)
- }% (end \ifdefined\@memptsize)
- }% (end \ifdefined\chapterformat)
- \fi% (end \if@hungarian@swapheaders)
-}
-
-\def\nohungarian@capsformat{%
- %
- % Reset changes of \hungarian@capsformat
- \let\fnum@table\xpg@save@fnum@table%
- \let\fnum@figure\xpg@save@fnum@figure%
- %
- % 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%
- }%
- }{}%
- \ifcsdef{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}{%
- % With memoir and standard classes
- \ifcsdef{xpg@save@chaptermark@format}{%
- \let\chaptermark\xpg@save@chaptermark@format%
- }{}%
- }{}% (end \ifdefined\chaptermark)
- }% (end \ifdefined\chapterformat)
-}
-% Hungarian needs 1) trailing dots in chapter headings; 2) trailing dot in section, subsection, etc, counters
-\def\@hungarian@forced@dot{}
-\def\xpg@save@autodot{}
-\ifdef{\KOMAScript}{%
- \providecommand*\autodot{}%
- \let\xpg@save@autodot\autodot%
-}{}
-% The following is based on some ideas from gloss-russian.ldf
-\def\hungarian@sectsformat{%
- \ifhungarian@forceheadingpunctuation%
- \ifdef{\KOMAScript}{%
- \renewcommand*\autodot{.}%
- }{%
- \def\@seccntformat##1{\csname pre##1\endcsname%
- \csname the##1\endcsname%
- \csname post##1\endcsname}%
- \def\@aftersepkern{\hspace{0.5em}}%
- \def\postchapter{.\@aftersepkern}%
- \def\postsection{.\@aftersepkern}%
- \def\postsubsection{.\@aftersepkern}%
- \def\postsubsubsection{.\@aftersepkern}%
- \def\postparagraph{.\@aftersepkern}%
- \def\postsubparagraph{.\@aftersepkern}%
- \def\prechapter{}%
- \def\presection{}%
- \def\presubsection{}%
- \def\presubsubsection{}%
- \def\preparagraph{}%
- \def\presubparagraph{}%
- }%
- \def\@hungarian@forced@dot{.}
- \fi%
-}
-%
-\def\nohungarian@sectsformat{%
- \ifhungarian@forceheadingpunctuation%
- \ifdef{\KOMAScript}{%
- \let\autodot\xpg@save@autodot%
- }{%
- \def\@seccntformat##1{\csname the##1\endcsname\quad}% = LaTeX kernel
- }%
- \fi%
- \def\@hungarian@forced@dot{}
-}
-%
-\def\blockextras@hungarian{%
- \hungarian@capsformat%
- \hungarian@sectsformat%
-}
-%
-\def\noextras@hungarian{%
- \nohungarian@capsformat%
- \nohungarian@sectsformat%
- \let\ontoday\@undefined%
-}
-%
-% \end{macrocode}
-% \iffalse
-%</gloss-hungarian.ldf>
-%<*gloss-hy.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-hy.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-hy.ldf}[polyglossia: module for hy (Armenian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{armenian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-hy.ldf>
-%<*gloss-ia.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ia.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ia.ldf}[polyglossia: module for ia (Interlingua)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{interlingua}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ia.ldf>
-%<*gloss-icelandic.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-icelandic.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-icelandic.ldf}[polyglossia: module for Icelandic]
-\PolyglossiaSetup{icelandic}{
- bcp47=is,
- bcp47-language=is,
- bcp47-script=Latn,
- hyphennames={icelandic},
- hyphenmins={2,2},
- langtag=ISL,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{icelandic}{is}
-
-\def\captionsicelandic{%
- \def\refname{Heimildir}%
- \def\abstractname{Útdráttur}%
- \def\bibname{Heimildir}%
- \def\prefacename{Formáli}%
- \def\chaptername{Kafli}%
- \def\appendixname{Viðauki}%
- \def\contentsname{Efnisyfirlit}%
- \def\listfigurename{Myndaskrá}%
- \def\listtablename{Töfluskrá}%
- \def\indexname{Atriðisorðaskrá}%
- \def\figurename{Mynd}%
- \def\tablename{Tafla}%
- %\def\thepart{}%
- \def\partname{Hluti}%
- \def\pagename{Blaðsíða}%
- \def\seename{Sjá}%
- \def\alsoname{Sjá einnig}%
- \def\enclname{Hjálagt}%
- \def\ccname{Samrit}%
- \def\headtoname{Til:}%
- \def\proofname{Sönnun}%
- \def\glossaryname{Orðalisti}%
- }
-
-\def\dateicelandic{%
- \def\today{\number\day.~\ifcase\month\or
- janúar\or febrúar\or mars\or apríl\or maí\or
- júní\or júlí\or ágúst\or september\or
- október\or nóvember\or desember\fi
- \space\number\year}%
- }
-
-% \end{macrocode}
-% \iffalse
-%</gloss-icelandic.ldf>
-%<*gloss-id.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-id.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-id.ldf}[polyglossia: module for id (Malay)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{malay}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-id.ldf>
-%<*gloss-interlingua.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-interlingua.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-interlingua.ldf}[polyglossia: module for Interlingua]
-\PolyglossiaSetup{interlingua}{
- bcp47=ia,
- bcp47-language=ia,
- bcp47-script=Latn,
- hyphennames={interlingua},
- hyphenmins={2,2},
- langtag=INA,
- frenchspacing=true,
- indentfirst=true,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{interlingua}{ia}
-
-\def\captionsinterlingua{%
- \def\refname{Referentias}%
- \def\abstractname{Summario}%
- \def\bibname{Bibliographia}%
- \def\prefacename{Prefacio}%
- \def\chaptername{Capitulo}%
- \def\appendixname{Appendice}%
- \def\contentsname{Contento}%
- \def\listfigurename{Lista de figuras}%
- \def\listtablename{Lista de tabellas}%
- \def\indexname{Indice}%
- \def\figurename{Figura}%
- \def\tablename{Tabella}%
- \def\partname{Parte}%
- %\def\thepart{}%
- \def\pagename{Pagina}%
- \def\seename{vide}%
- \def\alsoname{vide etiam}%
- \def\enclname{Incluso}%
- \def\ccname{Copia}%
- \def\headtoname{A}%
- \def\proofname{Prova}%
- \def\glossaryname{Glossario}%
- }
-\def\dateinterlingua{%
- \def\today{le~\number\day\space de \ifcase\month\or
- januario\or februario\or martio\or april\or maio\or junio\or
- julio\or augusto\or septembre\or octobre\or novembre\or
- decembre\fi
- \space \number\year}}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-interlingua.ldf>
-%<*gloss-irish.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-irish.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-irish.ldf>
-%<*gloss-is.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-is.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-is.ldf}[polyglossia: module for is (Icelandic)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{icelandic}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-is.ldf>
-%<*gloss-it.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-it.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-it.ldf}[polyglossia: module for it (Italian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{italian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-it.ldf>
-%<*gloss-italian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-italian.ldf}
-% \begin{macrocode}
-% !TEX encoding = UTF-8 Unicode
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-italian.ldf}[polyglossia: module for Italian]
-\PolyglossiaSetup{italian}{
- bcp47=it,
- bcp47-language=it,
- bcp47-region=IT,
- bcp47-script=Latn,
- hyphennames={italian},
- hyphenmins={2,2},
- langtag=ITA,
- frenchspacing=true,
- indentfirst=true,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{italian}{it}
-
-
-%%% CHANGES START %%% by Enrico Gregorio
-\define@boolkey{italian}[italian@]{babelshorthands}[true]{}
-
-% Register default options
-\xpg@initialize@gloss@options{italian}{babelshorthands=false}
-
-\ifsystem@babelshorthands
- \setkeys{italian}{babelshorthands=true}
-\else
- \setkeys{italian}{babelshorthands=false}
-\fi
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
-
-\def\italian@shorthands{%
- \xpg@activate@shorthands%
- \def\language@group{italian}%
- \declare@shorthand{italian}{"}{%
- \relax\ifmmode
- \def\xpgit@next{''}%
- \else
- \def\xpgit@next{\futurelet\xpgit@temp\xpgit@cwm}%
- \fi
- \xpgit@next}%
-}
-
-%%% By Enrico Gregorio and Claudio Beccari %%%
-\def\xpgit@@cwm{\nobreak\discretionary{-}{}{}\nobreak\hskip\z@skip}
-\def\xpgit@cwm{\let\xpgit@@next\relax
- \ifcat\noexpand\xpgit@temp a%
- \def\xpgit@@next{\xpgit@@cwm}%
- \else
- \if\noexpand\xpgit@temp \string|%
- \def\xpgit@@next##1{\xpgit@@cwm}%
- \else
- \if\noexpand\xpgit@temp \string<%
- \def\xpgit@@next##1{«\ignorespaces}%
- \else
- \if\noexpand\xpgit@temp \string>%
- \def\xpgit@@next##1{\unskip »}%
- \else
- \if\noexpand\xpgit@temp\string/%
- \def\xpgit@@next##1{\slash}%
- \else
- \ifx\xpgit@temp"%
- \def\xpgit@@next##1{?}%
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \xpgit@@next}
-
-\def\noitalian@shorthands{%
- \xpg@deactivate@shorthands%
-}
-%%% CHANGES END %%%
-
-%%% ORIGINAL %%% by Claudio Beccari
-\def\captionsitalian{%
- \def\prefacename{Prefazione}%
- \def\refname{Riferimenti bibliografici}%
- \def\abstractname{Sommario}%
- \def\bibname{Bibliografia}%
- \def\chaptername{Capitolo}%
- \def\appendixname{Appendice}%
- \def\contentsname{Indice}%
- \def\listfigurename{Elenco delle figure}%
- \def\listtablename{Elenco delle tabelle}%
- \def\indexname{Indice analitico}%
- \def\figurename{Figura}%
- \def\tablename{Tabella}%
- \def\partname{Parte}%
- \def\enclname{Allegati}%
- \def\ccname{e~p.~c.}%
- \def\headtoname{Per}%
- \def\pagename{Pag.}% % in Italian the abbreviation is preferred
- \def\seename{vedi}%
- \def\alsoname{vedi anche}%
- \def\proofname{Dimostrazione}%
- \def\glossaryname{Glossario}%
- }
-\def\dateitalian{%
- \def\today{\number\day~\ifcase\month\or
- gennaio\or febbraio\or marzo\or aprile\or maggio\or giugno\or
- luglio\or agosto\or settembre\or ottobre\or novembre\or
- dicembre\fi\space \number\year}}
-%%% ORIGINAL END %%%
-
-%%% CHANGES START %%% by Enrico Gregorio
-\let\xpgit@savedvalues\empty
-\AtEndPreamble{% the user or the class might define different values
- \edef\xpgit@savedvalues{%
- \clubpenalty=\the\clubpenalty\space
- \@clubpenalty=\the\@clubpenalty\space
- \widowpenalty=\the\widowpenalty\space
- \finalhyphendemerits=\the\finalhyphendemerits}
-}
-
-
-\def\noextras@italian{%
- \lccode\string"2019=\z@%
- \ifitalian@babelshorthands\noitalian@shorthands\fi%
- \xpgit@savedvalues%
-}
-
-\def\blockextras@italian{%
- \lccode\string"2019=\string"2019%
- \clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000%
- \finalhyphendemerits=50000000%
- \ifitalian@babelshorthands\italian@shorthands\else\noitalian@shorthands\fi%
-}
-
-\def\inlineextras@italian{%
- \lccode\string"2019=\string"2019%
- \ifitalian@babelshorthands\italian@shorthands\else\noitalian@shorthands\fi%
-}
-%%% CHANGES END %%%
-% \end{macrocode}
-% \iffalse
-%</gloss-italian.ldf>
-%<*gloss-ja.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ja.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ja.ldf}[polyglossia: module for ja (Japanese)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{japanese}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ja.ldf>
-%<*gloss-japanese.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-japanese.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-japanese.ldf}[polyglossia: module for Japanese]
-
-\PolyglossiaSetup{japanese}{
- bcp47=ja,
- bcp47-language=ja,
- bcp47-region=JP,
- bcp47-script=Hrkt,
- script=CJK,
- scripttag=kana,
- language=Japanese,
- langtag=JAN,
- hyphennames={nohyphenation},
- frenchspacing=false,
- fontsetup=true,
- localnumeral=japanesenumerals
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{japanese}{ja}
-
-\def\japanese@capsformat{%
- \def\@seccntformat##1{%
- \csname pre##1\endcsname%
- \csname the##1\endcsname%
- \csname post##1\endcsname%
- }%
- \def\postsection{節\space}%
- \def\postsubsection{節\space}%
- \def\postsubsubsection{節\space}%
- \def\presection{第}%
- \def\presubsection{第}%
- \def\presubsubsection{第}%
-}
-
-\def\captionsjapanese{%
- \def\refname{参考文献}%
- \def\abstractname{概要}%
- \def\bibname{文献目録}%
- \def\prefacename{端書き}%
- \def\chaptername##1##2{第##1##2 章}%
- \def\appendixname{付録}%
- \def\contentsname{目次}%
- \def\listfigurename{図目次}%
- \def\listtablename{表目次}%
- \def\indexname{索引}%
- \def\figurename{図}%
- \def\tablename{表}%
- \def\partname##1##2{第##1##2 部}%
- \def\pagename##1##2{第##1##2 頁}%
- \def\seename{参照}%
- \def\alsoname{参照}%
- \def\enclname{添付}%
- \def\ccname{同報}%
- \def\headtoname{宛先}%
- \def\proofname{証明}%
- \def\glossaryname{用語集}%
- }
-
-\newif\if@WameiReki \@WameiRekifalse%
-\newif\if@WameiTosi \@WameiTosifalse%
-\newif\if@WameiTuki \@WameiTukifalse%
-\newif\if@WameiHi \@WameiHifalse%
-\newif\if@IzumoTuki \@IzumoTukifalse%
-\newcount\c@TempJNum%
-
-\def\@JapaneseDigit#1{%
- \ifcase#1\or 一\or 二\or 三\or 四\or 五\or%
- 六\or 七\or 八\or 九\or 十\or%
- 十一\or 十二\or 十三\or 十四\or 十五\or%
- 十六\or 十七\or 十八\or 十九\or 廿\or%
- 廿一\or 廿二\or 廿三\or 廿四\or 廿五\or%
- 廿六\or 廿七\or 廿八\or 廿九\or 丗\or%
- 丗一\or 丗二\or 丗三\or 丗四\or 丗五\or%
- 丗六\or 丗七\or 丗八\or 丗九\or 四十\or%
- 四十一\or 四十二\or 四十三\or 四十四\or 四十五\or%
- 四十六\or 四十七\or 四十八\or 四十九\or 五十\or%
- 五十一\or 五十二\or 五十三\or 五十四\or 五十五\or%
- 五十六\or 五十七\or 五十八\or 五十九\or 六十\or%
- 六十一\or 六十二\or 六十三\or 六十四\or 六十五\or%
- 六十六\or 六十七\or 六十八\or 六十九\or 七十\or%
- 七十一\or 七十二\or 七十三\or 七十四\or 七十五\or%
- 七十六\or 七十七\or 七十八\or 七十九\or 八十\or%
- 八十一\or 八十二\or 八十三\or 八十四\or 八十五\or%
- 八十六\or 八十七\or 八十八\or 八十九\or 九十\or%
- 九十一\or 九十二\or 九十三\or 九十四\or 九十五\or%
- 九十六\or 九十七\or 九十八\or 九十九%
- \else
- \@ctrerr%
- \fi\relax%
-}
-
-\def\@JapaneseNum#1{%
- \c@TempJNum=#1\divide\c@TempJNum by 1000\relax%
- \ifnum\c@TempJNum=\z@\c@TempJNum=#1%
- \divide\c@TempJNum by 100\relax%
- \ifnum\c@TempJNum=\z@\@JapaneseDigit{#1}\relax%
- \else
- \ifcase\c@TempJNum\or 百\or 二百\or 三百\or 四百\or 五百\or
- 六百\or 七百\or 八百\or 九百%
- \fi
- \c@TempJNum=#1\divide\c@TempJNum by 100\multiply\c@TempJNum by -100\advance\c@TempJNum#1\@JapaneseDigit\c@TempJNum\relax%
- \fi%
- \else
- \ifcase\c@TempJNum\or 千\or 二千\or 三千\or 四千\or 五千\or
- 六千\or 七千\or 八千\or 九千%
- \fi
- \c@TempJNum=#1\divide\c@TempJNum by 1000\multiply\c@TempJNum by -1000\advance\c@TempJNum#1\divide\c@TempJNum by 100\relax%
- \ifnum\c@TempJNum=\z@\c@TempJNum=#1%
- \divide\c@TempJNum by 100\multiply\c@TempJNum by -100\advance\c@TempJNum#1\@JapaneseDigit\c@TempJNum\relax%
- \else
- \ifcase\c@TempJNum\or 百\or 二百\or 三百\or 四百\or 五百\or
- 六百\or 七百\or 八百\or 九百%
- \fi
- \c@TempJNum=#1\divide\c@TempJNum by 100\multiply\c@TempJNum by -100\advance\c@TempJNum#1\@JapaneseDigit\c@TempJNum\relax%
- \fi
- \fi
-}
-
-\def\@japanesenumber#1{%
- \@tempcnta=#1%
- \ifnum\@tempcnta=\z@{〇}%
- \else
- \ifnum\@tempcnta<\z@{負}%
- \multiply\@tempcnta by -1%
- \fi
- \@tempcntb=\@tempcnta\divide\@tempcntb by 10000\relax%
- \ifnum\@tempcntb=\z@\@JapaneseNum%
- \@tempcnta%
- \else
- \@tempcntb=\@tempcnta\divide\@tempcntb by 100000000\relax%
- \ifnum\@tempcntb=\z@\@tempcntb=\@tempcnta%
- \divide\@tempcntb by 10000%
- \@JapaneseNum\@tempcntb{万}\@tempcntb=\@tempcnta%
- \divide\@tempcntb by 10000\multiply\@tempcntb by -10000%
- \advance\@tempcntb\@tempcnta\relax\@JapaneseNum\@tempcntb%
- \else
- \@JapaneseNum\@tempcntb{億}\@tempcntb=\@tempcnta%
- \divide\@tempcntb by 100000000\multiply\@tempcntb by -100000000%
- \advance\@tempcntb\@tempcnta\divide\@tempcntb by 10000\relax%
- \ifnum\@tempcntb=\z@%
- \else
- \@JapaneseNum\@tempcntb{万}%
- \fi
- \@tempcntb=\@tempcnta\divide\@tempcntb by 10000%
- \multiply\@tempcntb by -10000\advance\@tempcntb\@tempcnta%
- \@JapaneseNum\@tempcntb%
- \fi
- \fi
- \fi
-}
-
-\def\japanesenumber#1{%
- \expandafter\@japanesenumber\csname c@#1\endcsname%
-}
-
-\newcommand{\japanesenumerals}[2]{\@japanesenumber{#2}}
-
-\def\datejapanese{%
- {%
- \ifnum\year<1868%
- \xdef\the@WarekiCur{}%
- \else
- \ifnum\year<1912%
- \xdef\the@WarekiCur{明治}\advance\year-1867\relax%
- \else
- \ifnum\year<1926%
- \xdef\the@WarekiCur{大正}\advance\year-1911\relax%
- \else
- \ifnum\year<1989%
- \xdef\the@WarekiCur{昭和}\advance\year-1925\relax%
- \else
- \xdef\the@WarekiCur{平成}\advance\year-1988\relax%
- \fi
- \fi
- \fi
- \fi
- \xdef\the@WameiTosi{\the\year}%
- }%
- \def\西暦{\@WameiRekifalse \@WameiTukifalse \@WameiHifalse}%
- \def\和暦{\@WameiRekitrue \@WameiTosifalse \@WameiTukifalse \@WameiHifalse}%
- \def\和名暦{\@WameiTositrue \@WameiTukitrue \@WameiHitrue}%
- \def\数字暦{\@WameiTosifalse \@WameiTukifalse \@WameiHifalse}%
- \def\出雲月{\@IzumoTukitrue}%
- \def\大和月{\@IzumoTukifalse}%
- \def\today{%
- \if@WameiReki%
- \the@WarekiCur%
- \if@WameiTosi%
- \@JapaneseNum\the@WameiTosi%
- \else
- \,\the@WameiTosi%
- \fi
- \else
- \number\year\,%
- \fi
- {年}%
- \if@WameiTuki%
- \ifcase\month\or 睦月\or 如月\or 弥生\or 卯月\or 皐月\or
- 水無月\or 文月\or 葉月\or 長月\or
- \if@IzumoTuki 神在月\else 神無月\fi
- \or 霜月\or 師走%
- \fi
- \else
- \,\number\month\,%
- {月}%
- \fi
- \if@WameiHi%
- \@JapaneseNum\day%
- \else
- \,\number\day\,%
- \fi
- {日}%
- }%
-}
-
-\def\noextras@japanese{%
- \japanese@capsformat%
-}
-
-\def\blockextras@japanese{%
- \japanese@capsformat%
-}
-
-\def\inlineextras@japanese{%
- \japanese@capsformat%
-}
-% Based on contributions of Toru Inagaki, Norio Iwase, François Charette
-
-% \end{macrocode}
-% \iffalse
-%</gloss-japanese.ldf>
-%<*gloss-ka.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ka.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ka.ldf}[polyglossia: module for ka (Georgian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{georgian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ka.ldf>
-%<*gloss-kannada.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-kannada.ldf}
-% \begin{macrocode}
-%% gloss-kannada.ldf
-%% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%%
-%% Copyright 2011 Aravinda VK <hallimanearavind AT gmail.com>,
-%% Shankar Prasad <prasad.mvs AT gmail.com>,
-%% Team Sanchaya <dev AT lists.sanchaya.net>
-%
-% 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 Aravinda VK <hallimanearavind AT gmail.com>.
-%
-% This work consists of the file gloss-kannada.ldf
-\ProvidesFile{gloss-kannada.ldf}[polyglossia: module for Kannada]
-
-\PolyglossiaSetup{kannada}{
- bcp47=kn,
- bcp47-language=kn,
- bcp47-region=IN,
- bcp47-script=Knda,
- script=Kannada,
- scripttag=knda,
- langtag=KAN,
- hyphennames={kannada},
- hyphenmins={2,2},
- fontsetup=true,
- localnumeral=kannadanumerals
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{kannada}{kn}
-
-%% Defining Kannada digits equivalents to english
-\def\kannadadigits#1{\expandafter\@kannada@digits #1@}
-\def\@kannada@digits#1{%
- \ifx @#1% then terminate
- \else
- \ifx0#1೦\else\ifx1#1೧\else\ifx2#1೨\else\ifx3#1೩\else\ifx4#1೪\else\ifx5#1೫\else\ifx6#1೬\else\ifx7#1೭\else\ifx8#1೮\else\ifx9#1೯\else#1\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
- \expandafter\@kannada@digits
- \fi
-}
-
-%% \kannada@numerals variable will be set to true or false depending on the option provided in \setmainlanguage
-%% \kannada@numerals true by default or when we set \setmainlanguage[numerals=Kannada]{kannada}
-%% \kannada@numerals false when we set \setmainlanguage[numerals=Western]{kannada}
-\def\tmp@western{Western}
-\newif\ifkannada@numerals
-\kannada@numeralstrue
-
-\define@key{kannada}{numerals}[Kannada]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@western
- \kannada@numeralsfalse
- \fi}
-
-
-\def\captionskannada{%
- \def\prefacename{ಮುನ್ನುಡಿ}%
- \def\refname{ಉಲ್ಲೇಖಗಳು}%
- \def\abstractname{ಸಾರಾಂಶ}%
- \def\bibname{ಗ್ರಂಥಸೂಚಿ}%
- \def\chaptername{ಅಧ್ಯಾಯ}%
- \def\appendixname{ಅನುಬಂಧ}%
- \def\contentsname{ವಿಷಯಗಳು}%
- \def\listfigurename{ಚಿತ್ರಗಳ ಪಟ್ಟಿ}%
- \def\listtablename{ಕೋಷ್ಟಕಗಳ ಪಟ್ಟಿ}%
- \def\indexname{ಸೂಚಿ}%
- \def\figurename{ಚಿತ್ರ}%
- \def\tablename{ಕೋಷ್ಟಕ}%
- \def\partname{ಭಾಗ}%
- \def\enclname{encl}%
- \def\ccname{cc}%
- \def\headtoname{ಗೆ}%
- \def\pagename{ಪುಟ}%
- \def\seename{ನೋಡು}%
- \def\alsoname{ಇದನ್ನೂ ಸಹ ನೋಡು}%
- \def\proofname{ಕರಡುಪ್ರತಿ}%
-}
-
-\def\datekannada{%
- \def\kannadamonth{%
- \ifcase\month\or
- ಜನವರಿ\or
- ಫೆಬ್ರವರಿ\or
- ಮಾರ್ಚ್\or
- ಏಪ್ರಿಲ್\or
- ಮೇ\or
- ಜೂನ್\or
- ಜುಲೈ\or
- ಆಗಷ್ಟ್\or
- ಸೆಪ್ಟೆಂಬರ್\or
- ಅಕ್ಟೋಬರ್\or
- ನವಂಬರ್\or
- ಡಿಸಂಬರ್\fi}%
- \def\today{\kannadanumber\day\space\kannadamonth\space\kannadanumber\year}%
-}
-
-\newcommand{\kannadanumerals}[2]{\kannadanumber{#2}}
-
-%% Based on the settings displays respective numbers
-\def\kannadanumber#1{%
- \ifkannada@numerals
- \kannadadigits{\number#1}%
- \else
- \number#1%
- \fi
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-kannada.ldf>
-%<*gloss-khmer.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-khmer.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-khmer.ldf}[polyglossia: module for Khmer]
-\PolyglossiaSetup{khmer}{
- bcp47=km,
- bcp47-language=km,
- bcp47-region=KH,
- bcp47-script=Khmr,
- script=Khmer,%
- scripttag=khmr,%
- langtag=KHM,%
- hyphennames={nohyphenation},%
- fontsetup=true,%
- localnumeral=khmernumerals%
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{khmer}{km}
-
-\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}
-
-\def\captionskhmer{%
- \def\prefacename{អារម្ភកថា}%
- \def\refname{ឯកសារយោង}%
- \def\abstractname{សង្ខេប}%
- \def\bibname{គន្ថនិទ្ទេស}%
- \def\chaptername{ជំពូក}%
- \def\appendixname{សេចក្ដីបន្ថែម}%
- \def\contentsname{មាតិការ}%
- \def\listfigurename{បញ្ជីរូបភាព}%
- \def\listtablename{បញ្ជីតារាង}%
- \def\indexname{សន្ទស្សន៍}%
- \def\figurename{រូប}%
- \def\tablename{តារាង}%
- \def\partname{ផ្នែក}%
- \def\pagename{ទំព័រ}%
- \def\seename{មើល}%
- \def\alsoname{មើលបន្ថែម}%
- \def\enclname{ឯកសារភ្ជាប់}%
- \def\ccname{ចម្លងជួន}%
- \def\headtoname{ផ្ញើរទៅ}%
- \def\proofname{សម្រាយ}%
- \def\glossaryname{សទានុក្រម}%
-}
-\def\datekhmer{%
- \def\khmer@month{%
- \ifcase\month\or%
- មករា\or%
- កុម្ភៈ\or%
- មិនា\or%
- មេសា\or%
- ឧសភា\or%
- មិថុនា\or%
- កក្កដា\or%
- សីហា\or%
- កញ្ញា\or%
- តុលា\or%
- វិច្ឆិកា\or%
- ធ្នូ\fi}%
- \def\today{\khmernumber\day\space\khmer@month\space\khmernumber\year}%
-}
-\def\khmerdigits#1{\expandafter\@khmer@digits #1@}
-\def\@khmer@digits#1{%
- \ifx @#1% then terminate
- \else\ifx0#1០%
- \else\ifx1#1១%
- \else\ifx2#1២%
- \else\ifx3#1៣%
- \else\ifx4#1៤%
- \else\ifx5#1៥%
- \else\ifx6#1៦%
- \else\ifx7#1៧%
- \else\ifx8#1៨%
- \else\ifx9#1៩%
- \else#1\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
- \expandafter\@khmer@digits%
- \fi
-}
-
-\newcommand{\khmernumerals}[2]{\khmernumber{#2}}
-
-\def\khmernumber#1{%
- \if@khmer@numerals%
- \khmerdigits{\number#1}%
- \else%
- \number#1%
- \fi}
-\def\khmer@globalnumbers{%
- \let\orig@arabic\@arabic%
- \let\@arabic\khmernumber%
- \renewcommand{\thefootnote}{\localnumeral*{footnote}}%
-}
-\def\nokhmer@globalnumbers{%
- \let\@arabic\orig@arabic%
-}
-\def\thepart{\arabic{part}}
-\def\@khmeralph#1{%
-\ifcase#1%
-\or ក\or ខ\or គ\or ឃ\or ង%
-\or ច\or ឆ\or ជ\or ឈ\or ញ%
-\or ដ\or ឋ\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}{@khmeralph}\fi}
-\def\khmerAlph#1{\expandafter\@khmerAlph\csname c@#1\endcsname}
-\def\@khmerAlph#1{%
-\ifcase#1%
-\or ក\or ខ\or គ\or ឃ\or ង%
-\or ច\or ឆ\or ជ\or ឈ\or ញ%
-\or ដ\or ឋ\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}{@khmeralph}\fi}
-\def\khmer@numbers{%
- \if@khmer@numerals
- \let\@alph\@khmeralph%
- \let\@Alph\@khmerAlph%
- \fi%
-}
-\def\nokhmer@numbers{%
- \let\@alph\latin@alph%
- \let\@Alph\latin@Alph%
-}
-\def\blockextras@khmer{%
- \XeTeXlinebreaklocale "kh" %
- \XeTeXlinebreakskip = 0pt plus 1pt minus 1pt
-% \let\orig@baselinestretch\baselinestretch%
-% \renewcommand{\baselinestretch}{1.2}% not work
-}
-\def\noblockextras@khmer{%
- \XeTeXlinebreaklocale "en"%
-% \let\baselinestretch\orig@baselinestretch%
-}
-\@ifclassloaded{beamer}{%
- \usefonttheme{professionalfonts}%
- \def\factname{ស្វ័យសត្យ}%
- \def\lemmaname{បទគន្លិះ}%
- \def\theoremname{ទ្រឹស្ដីបទ}%
- \def\corollaryname{អនុសាធ្យ}%
- \def\problemname{ចំណោទ}%
- \def\solutionname{ដំណោះស្រាយ}%
- \def\definitionname{និយមន័យ}%
- \def\examplename{ឧទាហរណ៏}%
- \uselanguage{khmer}%
- \languagepath{khmer}%
- \deftranslation[to=khmer]{Fact}{\factname}%
- \deftranslation[to=khmer]{Lemma}{\lemmaname}%
- \deftranslation[to=khmer]{Theorem}{\theoremname}%
- \deftranslation[to=khmer]{Corollary}{\corollaryname}%
- \deftranslation[to=khmer]{Problem}{\problemname}%
- \deftranslation[to=khmer]{Solution}{\solutionname}%
- \deftranslation[to=khmer]{Definition}{\definitionname}%
- \deftranslation[to=khmer]{Definitions}{\definitionname}%
- \deftranslation[to=khmer]{Example}{\examplename}%
- \deftranslation[to=khmer]{Examples}{\examplename}%
- \AtEndDocument{\immediate\write\@auxout{\string\@writefile{nav}%
- {\noexpand\headcommand{\noexpand\def\noexpand%
- \inserttotalframenumber{\localnumeral*{framenumber}}}}}}%
-}{}
-% \end{macrocode}
-% \iffalse
-%</gloss-khmer.ldf>
-%<*gloss-km.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-km.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-km.ldf}[polyglossia: module for km (Khmer)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{khmer}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-km.ldf>
-%<*gloss-kmr-Arab.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-kmr-Arab.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-kmr-Arab.ldf}[polyglossia: module for kmr-Arab (Kurdish)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{kurdish}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-kmr-Arab.ldf>
-%<*gloss-kmr-Latn.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-kmr-Latn.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-kmr-Latn.ldf}[polyglossia: module for kmr-Latn (Kurdish)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{kurdish}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-kmr-Latn.ldf>
-%<*gloss-kmr.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-kmr.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-kmr.ldf}[polyglossia: module for kmr (Kurdish)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{kurdish}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-kmr.ldf>
-%<*gloss-kn.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-kn.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-kn.ldf}[polyglossia: module for kn (Kannada)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{kannada}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-kn.ldf>
-%<*gloss-ko.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ko.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ko.ldf}[polyglossia: module for ko (Korean)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{korean}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ko.ldf>
-%<*gloss-korean.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-korean.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-korean.ldf}[polyglossia: module for Korean]
-
-\PolyglossiaSetup{korean}{
- bcp47=ko,
- bcp47-language=ko,
- bcp47-script=Kore,
- script=Hangul,
- scripttag=hang,
- language=Korean,
- langtag=KOR,
- hyphennames={nohyphenation},
- frenchspacing=true,
- fontsetup=true
-}
-
-% 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'}}
-
-% Register default options
-\xpg@initialize@gloss@options{korean}{variant=plain,swapstrings=all,captions=hangul}
-
-\def\captionskorean{%
- \ifcase\xpg@korean@captions\relax
- \captions@korean@hangul
- \else
- \captions@korean@hanja
- \fi
- \def\seename{$\rightarrow$}%
- \def\alsoname{$\Rightarrow$}%
-}
-\def\captions@korean@hangul{%
- \def\koreanTHEname{제}%
- \def\partname{편}%
- \def\chaptername{장}%
- \def\refname{참고문헌}%
- \def\abstractname{요약}%
- \def\bibname{참고문헌}%
- \def\prefacename{서문}%
- \def\appendixname{부록}%
- \def\contentsname{차례}%
- \def\listfigurename{그림 차례}%
- \def\listtablename{표 차례}%
- \def\indexname{찾아보기}%
- \def\figurename{그림}%
- \def\tablename{표}%
- \def\pagename{페이지}%
- \def\enclname{동봉}%
- \def\proofname{증명}%
- \def\headtoname{수신:}%
- \def\ccname{사본}%
- \def\glossaryname{용어집}%
-}
-\def\captions@korean@hanja{%
- \def\koreanTHEname{第}%
- \def\partname{篇}%
- \def\chaptername{章}%
- \def\refname{參考文獻}%
- \def\abstractname{要約}%
- \def\bibname{參考文獻}%
- \def\prefacename{序文}%
- \def\appendixname{附錄}%
- \def\contentsname{目次}%
- \def\listfigurename{圖版 目次}%
- \def\listtablename{表 目次}%
- \def\indexname{索引}%
- \def\figurename{圖版}%
- \def\tablename{表}%
- \def\pagename{面}%
- \def\enclname{同封}%
- \def\proofname{證明}%
- \def\headtoname{受信:}%
- \def\ccname{寫本}%
- \def\glossaryname{用語集}%
-}
-
-\def\korean@appendix@chapapp{\appendixname}% to exclude appendix
-
-\def\korean@headingsformat{%
- % 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}%
- {\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}{%
- \let\xpg@save@chap@format\@makechapterhead
- \patchcmd{\@makechapterhead}%
- {\printchaptername \chapternamenum \printchapternum}%
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \printchaptername\relax\chapternamenum \printchapternum
- \else
- \printkoreanchapterthe \printchapternum\chapternamenum \printchaptername
- \fi
- }%
- {}%
- {\xpg@warning{Failed to patch chapter for Korean}}%
- \ifdefined\printkoreanchapterthe\else
- \def\printkoreanchapterthe{%
- \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}{%
- \let\xpg@save@part@format\@part
- \patchcmd{\@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 \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)
- \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}{%
- \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)
- }% (end \ifdefined\@memptsize)
- }% (end \ifdefined\sectionformat)
- }% (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)
- % With standard classes
- \ifcsdef{chaptermark}{%
- \ifpatchable{\chaptermark}%
- {\@chapapp\ \thechapter}%
- {\let\xpg@save@chaptermark@format\chaptermark
- \patchcmd{\chaptermark}%
- {\@chapapp\ \thechapter}%
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \appendixname\ \thechapter
- \else
- \koreanTHEname\ \thechapter\ \@chapapp
- \fi
- }%
- {}%
- {\xpg@warning{Failed to patch chaptermark for Korean}}}%
- {}%
- }{}% (end \ifdefined\chaptermark)
- }% (end \ifdefined\@memptsize)
- }% (end \ifdefined\chapterformat)
- \fi % (end \if@korean@swapheaders)
-}
-
-\def\nokorean@headingsformat{%
- % 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
- }%
- }{}%
- \ifcsdef{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}{%
- % With memoir and standard classes
- \ifcsdef{xpg@save@chaptermark@format}{%
- \let\chaptermark\xpg@save@chaptermark@format
- }{}%
- }{}% (end \ifdefined\chaptermark)
- }% (end \ifdefined\chapterformat)
-}
-
-\def\datekorean{%
- \ifcase\xpg@korean@captions\relax
- \def\today{\the\year 년 \the\month 월 \the\day 일}%
- \else
- \def\today{\the\year 年 \the\month 月 \the\day 日}%
- \fi
-}
-
-\def\koreanAlph#1{\expandafter\@koreanAlph\csname c@#1\endcsname}
-\def\@koreanAlph#1{%
- \ifcase#1\or 가\or 나\or 다\or 라\or 마\or 바\or 사\or 아\or 자\or
- 차\or 카\or 타\or 파\or 하\else\xpg@ill@value{#1}{@koreanAlph}\fi
-}
-
-\def\koreanalph#1{\expandafter\@koreanalph\csname c@#1\endcsname}
-\def\@koreanalph#1{%
- \ifcase#1\or ㄱ\or ㄴ\or ㄷ\or ㄹ\or ㅁ\or ㅂ\or ㅅ\or ㅇ\or ㅈ\or
- ㅊ\or ㅋ\or ㅌ\or ㅍ\or ㅎ\else\xpg@ill@value{#1}{@koreanalph}\fi
-}
-
-\def\korean@numbers{%
- \let\@alph\@koreanalph
- \let\@Alph\@koreanAlph
-}
-\def\nokorean@numbers{%
- \let\@alph\latin@alph
- \let\@Alph\latin@Alph
-}
-\let\nokorean@globalnumbers\nokorean@numbers
-
-\ifxetex
- \def\inlineextras@korean{%
- \ifcase\xpg@korean@variant\relax
- \XeTeXinterchartokenstate\z@
- \XeTeXlinebreakpenalty 50
- \or
- \setvariantkoreaninterchartoks
- \setvariantkoreancharclasses
- \def\XPGKOhalfdim{\dimexpr.5em\relax}%
- \XeTeXinterchartokenstate\@ne
- \XeTeXlinebreakpenalty \z@
- \else
- \setvariantkoreaninterchartoks
- \setvariantkoreancharclasses
- \def\XPGKOhalfdim{\dimexpr.5\fontdimen\tw@\font\relax}%
- \XeTeXinterchartokenstate\@ne
- \XeTeXlinebreakpenalty 50
- \fi
- \XeTeXlinebreakskip 0pt plus.05em minus .01em
- \XeTeXlinebreaklocale "ko"
- }
- \def\noextras@korean{%
- \ifcase\xpg@korean@variant\relax
- \else
- \unsetvariantkoreaninterchartoks
- \unsetvariantkoreancharclasses
- \fi
- \XeTeXinterchartokenstate\z@
- \XeTeXlinebreakpenalty\z@
- \XeTeXlinebreakskip\z@skip
- \XeTeXlinebreaklocale "en"
- \noextras@korean@common
- }
-\else % luatex
- \def\inlineextras@korean{\xpg@attr@korean\xpg@korean@variant\relax}
- \def\noextras@korean{%
- \unsetattribute\xpg@attr@korean
- \noextras@korean@common
- }
-\fi
-
-\def\blockextras@korean{%
- \inlineextras@korean
- \korean@headingsformat
-}
-
-\def\noextras@korean@common{%
- \nokorean@headingsformat
-}
-
-\ifluatex % luatex
-\protected\def\inhibitglue{\hskip\z@skip}
-\ifdefined\newattribute\else
- \let\newattribute\newluatexattribute
- \let\unsetattribute\unsetluatexattribute
-\fi
-\newattribute\xpg@attr@korean
-\newattribute\xpg@attr@autojosa
-% user commands for Josa
-% Josa : particles in Korean grammar that immediately follow a noun or pronoun.
-% Josa might vary depending on previous character.
-\protected\def\rieul{\global\let\xpg@josa@zwang\@ne}
-\protected\def\jung {\global\let\xpg@josa@zwang\tw@}
-\protected\def\jong {\global\let\xpg@josa@zwang\thr@@}
-\protected\def\은{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 은\endgroup\xpg@reset@josa}
-\let\는\은
-\protected\def\을{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 을\endgroup\xpg@reset@josa}
-\let\를\을
-\protected\def\와{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 와\endgroup\xpg@reset@josa}
-\let\과\와
-\protected\def\가{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 가\endgroup\xpg@reset@josa}
-\protected\def\이{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 이\endgroup\xpg@reset@josa}
-\protected\def\라{\이 라}
-\protected\def\으{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 으\endgroup\xpg@reset@josa}
-\protected\def\로{\으 로}
-\def\xpg@reset@josa {\global\let\xpg@josa@zwang\z@}\xpg@reset@josa
-% load lua file for korean
-\directlua{ require "polyglossia-korean" }
-% \end{macrocode}
-% \iffalse
-%</gloss-korean.ldf>
-%<*gloss-ku-Arab.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ku-Arab.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ku-Arab.ldf}[polyglossia: module for ku-Arab (Kurdish)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{kurdish}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ku-Arab.ldf>
-%<*gloss-ku-Latn.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ku-Latn.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ku-Latn.ldf}[polyglossia: module for ku-Latn (Kurdish)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{kurdish}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ku-Latn.ldf>
-%<*gloss-ku.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ku.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ku.ldf}[polyglossia: module for ku (Kurdish)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{kurdish}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ku.ldf>
-%<*gloss-kurdish.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-kurdish.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-% Created on September 1, 2019
-% Last updated on May 17, 2020
-% Sina Ahmadi (ahmadi.sina@outlook.com)
-% For more information, visit the Kurdish XeLaTeX Users Group at https://github.com/KurdishXeLaTeX
-\ProvidesFile{gloss-kurdish.ldf}[polyglossia: module for Kurdish]
-
-\RequireBidi
-\RequirePackage{arabicnumbers}
-\RequirePackage{farsical}
-\RequirePackage{hijrical}
-
-\PolyglossiaSetup{kurdish}{
- bcp47=ckb,
- bcp47-language=ckb,
- bcp47-script=Arab,
- bcp47-casing=ckb-Arab,
- script=Arabic,
- direction=RL,
- scripttag=arab,
- langtag=KUR,
- hyphennames={nohyphenation},
- fontsetup=true,
- localnumeral=kurdishnumerals
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{kurdish}{ku}
-\setlanguagealias*[variant=kurmanji,script=latin]{kurdish}{kmr-Latn}
-\setlanguagealias*[variant=sorani]{kurdish}{ckb}
-\setlanguagealias*[variant=kurmanji,script=arabic]{kurdish}{kmr-Arab}
-\setlanguagealias*[script=latin]{kurdish}{ku-Latn}
-\setlanguagealias*[variant=sorani,script=arabic]{kurdish}{ckb-Arab}
-\setlanguagealias*[variant=sorani,script=latin]{kurdish}{ckb-Latn}
-\setlanguagealias*[script=arabic]{kurdish}{ku-Arab}
-\setlanguagealias*[variant=kurmanji]{kurdish}{kmr}
-
-% Babel aliases
-\setlanguagealias[variant=kurmanji]{kurdish}{kurmanji}
-
-\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
-\def\kurdish@script{arabic}
-\def\kurdish@pattern{nohyphenation}
-
-\def\kurdish@set@variety{%
- \if@kurdish@latin% latin explicitly set
- \@western@numeralstrue%
- \if@kurdish@kurmanji
- \def\kurdish@pattern{kurmanji}%
- \SetLanguageKeys{kurdish}{script=Latin,direction=LR,scripttag=latn,babelname=kurmanji,bcp47=kmr-Latn,bcp47-language=kmr,bcp47-script=Latn,bcp47-casing=kmr-Latn}%
- \else
- \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}%
- \else
- \if@kurdish@arabic% arabic explicitly set
- \if@kurdish@kurmanji
- \if@force@western@numerals\else\@western@numeralsfalse\fi%
- \SetLanguageKeys{kurdish}{script=Arabic,direction=RL,scripttag=arab,babelname=kurmanji,bcp47=kmr-Arab,bcp47-language=kmr,bcp47-script=Arab,bcp47-casing=kmr-Arab}%
- \def\kurdish@script{arabic}%
- \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}%
- \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}%
- \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}%
- \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
-
-% Register default options
-\xpg@initialize@gloss@options{kurdish}{variant=sorani,locale=default,script=arabic,abjadjimnotail=false,numerals=eastern}
-
-\def\kurdish@language{%
- \polyglossia@setup@language@patterns{\kurdish@pattern}%
-}%
-
-\def\kurdishNativemonth#1{\ifcase#1%
- \or رێبەندان\or رەشەمێ\or خاكەلێوە\or گوڵان\or جۆزەردان\or پووشپەڕ\or خەرمانان\or گەلاوێژ\or رەزبەر\or گەڵارێزان\or سەرماوەز\or بەفرانبار\fi}
-\def\kurdishmonth#1{\ifcase#1%
- \or كانوونی دووهەم\or شوبات\or ئازار\or نیسان\or ئایار\or حوزەیران\or تەممووز\or ئاب\or ئەیلوول\or تشرینی یەكەم\or تشرینی دووهەم\or كانوونی یەكەم\fi}
-
-%\Hijritoday is now locale-aware and will format the date with this macro:
-\DefineFormatHijriDate{kurdish}{%
- \@ensure@RTL{%
- \kurdishnumber{\value{Hijriday}}\space\HijriMonthArabic{\value{Hijrimonth}}\space\kurdishnumber{\value{Hijriyear}}%
- }%
-}
-
-\def\captionskurdish@sorani@arabic{%
- \def\prefacename{\@ensure@RTL{پێشەكی}}%
- \def\refname{\@ensure@RTL{سەرچاوەکان}}%
- \def\abstractname{\@ensure@RTL{پوختە}}%
- \def\bibname{\@ensure@RTL{کتێبنامە}}%
- \def\chaptername{\@ensure@RTL{بەندی}}%
- \def\appendixname{\@ensure@RTL{پاشکۆ}}%
- \def\contentsname{\@ensure@RTL{نێوەڕۆک}}%
- \def\listfigurename{\@ensure@RTL{لیستی وێنەکان}}%
- \def\listtablename{\@ensure@RTL{لیستی خشتەکان}}%
- \def\indexname{\@ensure@RTL{پێنوێن}}%
- \def\figurename{\@ensure@RTL{وێنەی}}%
- \def\tablename{\@ensure@RTL{خشتەی}}%
- \def\partname{\@ensure@RTL{بەشی}}%
- \def\enclname{\@ensure@RTL{هاوپێچ}}%
- \def\ccname{\@ensure@RTL{ڕوونووس}}%
- \def\headtoname{\@ensure@RTL{بۆ}}%
- \def\pagename{\@ensure@RTL{لاپەڕە}}%
- \def\seename{\@ensure@RTL{چاو لێکەن}}%
- \def\alsoname{\@ensure@RTL{هەروەها چاو لێکەن}}%
- \def\proofname{\@ensure@RTL{سەلماندن}}%
- \def\glossaryname{\@ensure@RTL{فەرهەنگۆک}}%
-}
-
-\def\captionskurdish@sorani@latin{%
- \def\prefacename{Pêşekî}%
- \def\refname{Serçawekan}%
- \def\abstractname{Puxte}%
- \def\bibname{Kitêbname}%
- \def\chaptername{Bendî}%
- \def\appendixname{Paşko}%
- \def\contentsname{Nêweřok}%
- \def\listfigurename{Lîstî Wênekan}%
- \def\listtablename{Lîstî Xiştekan}%
- \def\indexname{Pêřist}%
- \def\figurename{Wêney}%
- \def\tablename{Xiştey}%
- \def\partname{Beşî}%
- \def\enclname{Hawpêç}%
- \def\ccname{Řûnûs}%
- \def\headtoname{Bo}%
- \def\pagename{Lapeře}%
- \def\seename{Çaw lêken}%
- \def\alsoname{Herweha çaw lêken}%
- \def\proofname{Selmandin}%
- \def\glossaryname{Ferhengok}%
-}
-
-\def\captionskurdish@kurmanji@latin{%
- \def\prefacename{Peşgotin}%
- \def\refname{Jêder}%
- \def\abstractname{Kurtebîr}%
- \def\bibname{Çavkanîya Pirtukan}%
- \def\chaptername{Serê}%
- \def\appendixname{Tebînîya}%
- \def\contentsname{Navêrok}%
- \def\listfigurename{Hejmara Dimena}%
- \def\listtablename{Hejmara Kevalen}%
- \def\indexname{Endeks}%
- \def\figurename{Dimenê}%
- \def\tablename{Kevala}%
- \def\partname{Bêşa}%
- \def\enclname{Dumahik}%
- \def\ccname{Belavker}%
- \def\headtoname{Ji bo}%
- \def\pagename{Rûpelê}%
- \def\seename{binêra}%
- \def\alsoname{li vêya jî binêra}%
- \def\proofname{Delîl}%
- \def\glossaryname{Çavkanîya lêkolînê}%
-}
-
-\def\captionskurdish@kurmanji@arabic{%
- \def\prefacename{\@ensure@RTL{پێشگۆتن}}%
- \def\refname{\@ensure@RTL{ژێدەر}}%
- \def\abstractname{\@ensure@RTL{کورتەبیر}}%
- \def\bibname{\@ensure@RTL{چاڤکانییا پرتووکان}}%
- \def\chaptername{\@ensure@RTL{سەرێ}}%
- \def\appendixname{\@ensure@RTL{پاشکۆ}}%
- \def\contentsname{\@ensure@RTL{ناڤێرۆک}}%
- \def\listfigurename{\@ensure@RTL{هەژمارا دیمەنا}}%
- \def\listtablename{\@ensure@RTL{هەژمارا کەڤالێن}}%
- \def\indexname{\@ensure@RTL{پێرست}}%
- \def\figurename{\@ensure@RTL{دیمەنێ}}%
- \def\tablename{\@ensure@RTL{کەڤالا}}%
- \def\partname{\@ensure@RTL{بەشا}}%
- \def\enclname{\@ensure@RTL{دوماهک}}%
- \def\ccname{\@ensure@RTL{بەلاڤکەر}}%
- \def\headtoname{\@ensure@RTL{ژ بۆ}}%
- \def\pagename{\@ensure@RTL{رووپەلێ}}%
- \def\seename{\@ensure@RTL{بنێرا}}%
- \def\alsoname{\@ensure@RTL{لە ڤێیا ژ بنێرا}}%
- \def\proofname{\@ensure@RTL{دەلیل}}%
- \def\glossaryname{\@ensure@RTL{چاڤکانییا لێکۆلینێ}}%
-}
-
-\def\captionskurdish{%
- \csname captionskurdish@\kurdish@variant @\kurdish@script\endcsname%
-}
-
-\def\datekurdish@sorani@arabic{%
- \def\today{\@ensure@RTL{\kurdishnumber\day{ی}\space\kurdishmonth{\month}{ی}\space\kurdishnumber\year}}%
-}
-
-\def\datekurdish@sorani@latin{%
- \def\today{%
- \number\day ~\ifcase\month\or
- \januaryname\or \februaryname\or \marchname\or \aprilname\or
- \mayname\or \junename\or \julyname\or \augustname\or
- \septembername\or \octobername\or \novembername\or
- \decembername\or \@ctrerr\fi~\number\year}%
- \def\ontoday{%
- \number\day î~\ifcase\month\or
- \januaryname\or \februaryname\or \marchname\or \aprilname\or
- \mayname\or \junename\or \julyname\or \augustname\or
- \septembername\or \octobername\or \novembername\or
- \decembername\or \@ctrerr\fi î~\number\year}%
- \def\januaryname{Kanûnî Yekem}%
- \def\februaryname{Şubat}%
- \def\marchname{Azar}%
- \def\aprilname{Nîsan}%
- \def\mayname{Ayar}%
- \def\junename{Huzeyran}%
- \def\julyname{Temmûz}%
- \def\augustname{Ab}%
- \def\septembername{Eylûl}%
- \def\octobername{Tişrînî Yekem}%
- \def\novembername{Tişrînî Dûhem}%
- \def\decembername{Kanûnî Dûhem}%
-}
-
-\def\datekurdish@kurmanji@latin{%
- \def\today{%
- \number\day ~\ifcase\month\or
- \januaryname\or \februaryname\or \marchname\or \aprilname\or
- \mayname\or \junename\or \julyname\or \augustname\or
- \septembername\or \octobername\or \novembername\or
- \decembername\or \@ctrerr\fi~\number\year}%
- \def\ontoday{%
- \number\day ê~\ifcase\month\or
- \januaryname\or \februaryname\or \marchname\or \aprilname\or
- \mayname\or \junename\or \julyname\or \augustname\or
- \septembername\or \octobername\or \novembername\or
- \decembername\or \@ctrerr\fi ê~\number\year}%
- \def\januaryname{Çileya Paşîn}%
- \def\februaryname{Sibat}%
- \def\marchname{Adar}%
- \def\aprilname{Nîsan}%
- \def\mayname{Gulan}%
- \def\junename{Hezîran}%
- \def\julyname{Tîrmeh}%
- \def\augustname{Tebax}%
- \def\septembername{Îlon}%
- \def\octobername{Çiriya Pêşîn}%
- \def\novembername{Çiriya Paşîn}%
- \def\decembername{Çileya Pêşîn}%
-}
-
-\def\kurdishmonthkurmanji#1{\ifcase#1%
- چلەیا پاشین \or شبات \or ئادار \or نیسان \or گولان \or حەزیران \or تیرمەهـ \or تەباخ \or ئیلۆن \or چریا پێشین \or چریا پاشین \or چلەیا پێشین\fi}
-
-\def\datekurdish@kurmanji@arabic{%
- \def\today{\@ensure@RTL{\kurdishnumber\day\space\kurdishmonthkurmanji{\month}\space\kurdishnumber\year}}%
-}
-
-% TODO: babel-kurmanji has these "alternative" month names
-% How to integrate them ("montnames=alternative" is not really good)?
-% It seems the month name question is all but straightforward:
-% https://en.wikipedia.org/wiki/Kurdish_calendar#Names
-%\def\datekurdish@kurmanji@alternate{%
-% \datekurdish@kurmanji
-% \def\januaryname{Rêbendan}%
-% \def\februaryname{Reşemih}%
-% \def\aprilname{Cotan}% % Avrêl
-% \def\junename{Pûşper}%
-% \def\augustname{Gelavêj}%
-% \def\septembername{Gelarezan}% % Rezber
-% \def\octobername{Kewçêr}%
-% \def\novembername{Sermawez}%
-% \def\decembername{Berfandar}%
-%}
-
-\def\datekurdish{%
- \csname datekurdish@\kurdish@variant @\kurdish@script\endcsname%
-}
-
-% Use \providecommand here as the ldf file might
-% be reloaded via BCP.
-\providecommand{\kurdishnumerals}[2]{\kurdishnumber{#2}}
-
-\def\kurdishnumber#1{%
- \if@western@numerals
- \number#1%
- \else
- \IfCharIsAvailableTF{06F0}%
- {\@ensure@LTR{\farsidigits{\number#1}}}%
- {\@ensure@LTR{\arabicdigits{\number#1}}}%
- \fi
-}
-
-%\def\kurdishnum#1{\expandafter\kurdishnumber\csname c@#1\endcsname}
-%\def\kurdishbracenum#1{(\expandafter\kurdishnumber\csname c@#1\endcsname)}
-%\def\kurdishornatebracenum#1{\char"FD3E\expandafter\kurdishnumber\csname c@#1\endcsname\char"FD3F}
-%\def\kurdishalph#1{\expandafter\@farsialph\csname c@#1\endcsname}
-
-\def\kurdish@numbers{%
- \if@western@numerals%
- \else%
- \let\@alph\abjad%
- \let\@Alph\abjad%
- \fi%
-}
-
-\def\nokurdish@numbers{%
- \let\@alph\@latinalph%
- \let\@Alph\@latinAlph%
-}
-
-\def\kurdish@globalnumbers{%
- \let\@arabic\kurdishnumber%
- \renewcommand\thefootnote{\localnumeral*{footnote}}%
- \renewcommand\theequation{\localnumeral*{equation}}%
-}
-
-% Store original definition
-\let\xpg@save@arabic\@arabic
-
-\def\nokurdish@globalnumbers{
- \let\@arabic\xpg@save@arabic%
- \renewcommand\thefootnote{\protect\number{\c@footnote}}%
-}
-
-\def\kurdish@xetex@capsformat{%
- \let\xpg@save@sepmark\@SepMark%
- \SepMark{\xpg@sepmark}
-}
-
-\def\nokurdish@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
- \SepMark{\xpg@save@sepmark}
- }{}%
-}
-
-\def\kurdish@luatex@capsformat{%
- %
- % change chapter and part headings
- \ifkurdish@customsep
- \ifcsdef{chapter}{%
- \let\xpg@save@thesection\thesection%
- \renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
- \let\xpg@save@theequation\theequation%
- \renewcommand*\theequation{%
- \ifnum \c@chapter>\z@ \thechapter\xpg@sepmark\fi\@arabic\c@equation}
- \let\xpg@save@thefigure\thefigure%
- \renewcommand*\thefigure{%
- \ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@figure}
- \let\xpg@save@thetable\thetable%
- \renewcommand*\thetable{%
- \ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
- \let\xpg@save@thesubsection\thesubsection%
- \renewcommand\thesubsection
- {\thesection\xpg@sepmark\@arabic\c@subsection}
- \let\xpg@save@thesubsubsection\thesubsubsection%
- \renewcommand\thesubsubsection{\thesubsection\xpg@sepmark\@arabic\c@subsubsection}
- \let\xpg@save@theparagraph\theparagraph%
- \renewcommand\theparagraph
- {\thesubsubsection\xpg@sepmark\@arabic\c@paragraph}
- \let\xpg@save@thesubparagraph\thesubparagraph%
- \renewcommand\thesubparagraph{\theparagraph\xpg@sepmark\@arabic\c@subparagraph}
- \fi% (end \ifkurdish@customsep)
-}
-
-\def\nokurdish@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%
- }{}%
-}
-
-\def\blockextras@kurdish{%
- \ifkurdish@customsep
- \ifxetex
- \kurdish@xetex@capsformat
- \else
- \kurdish@luatex@capsformat
- \fi
- \fi
-}
-%
-\def\noextras@kurdish{%
- \ifkurdish@customsep
- \ifxetex
- \nokurdish@xetex@capsformat
- \else
- \nokurdish@luatex@capsformat
- \fi
- \fi
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-kurdish.ldf>
-%<*gloss-kurmanji.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-kurmanji.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-kurmanji.ldf}[polyglossia: module for Kurmanji Kurdish]
-
-% We provide this gloss for babel compatibility.
-
-\xpg@load@master@language{kurdish}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-kurmanji.ldf>
-%<*gloss-la-x-classic.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-la-x-classic.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-la-xclassic.ldf}[polyglossia: module for la-xclassic (Latin)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{latin}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-la-x-classic.ldf>
-%<*gloss-la-x-ecclesia.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-la-x-ecclesia.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-la-xecclesiastic.ldf}[polyglossia: module for la-xecclesiastic (Latin)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{latin}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-la-x-ecclesia.ldf>
-%<*gloss-la-x-medieval.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-la-x-medieval.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-la-xmedieval.ldf}[polyglossia: module for la-xmedieval (Latin)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{latin}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-la-x-medieval.ldf>
-%<*gloss-la.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-la.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-la.ldf}[polyglossia: module for la (Latin)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{latin}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-la.ldf>
-%<*gloss-lao.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-lao.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-lao.ldf}[polyglossia: module for Lao]
-
-\PolyglossiaSetup{lao}{
- bcp47=lo,
- bcp47-language=lo,
- bcp47-script=Laoo,
- script=Lao,
- scripttag=lao,
- langtag=LAO,
- hyphennames={lao},
- hyphenmins={1,1},
- fontsetup=true,
- localnumeral=laonumerals
- %TODO localalph={xxx@alph,xxx@Alph}
- %TODO localdigits=laonumber
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{lao}{lo}
-
-\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
-}
-
-% Register default options
-\xpg@initialize@gloss@options{lao}{numerals=arabic}
-
-% Translations provided by Brian Wilson <bountonw at gmail.com>
-\def\captionslao{%
- \def\prefacename{ຄໍານໍາ}%
- \def\refname{ໜັງສືອ້າງອີງ}%
- \def\abstractname{ບົດຫຍໍ້ຄວາມ}%
- \def\bibname{ເອກະສານອ້າງອີງ}%
- \def\chaptername{ບົດທີ}%
- \def\appendixname{ພາກຄັດຕິດ}%
- \def\contentsname{ສາລະບານ}%
- \def\listfigurename{ສາລະບານຮູບ}%
- \def\listtablename{ສາລະບານຕາຕະລາງ}%
- \def\indexname{ດັດຊະນີ}%
- \def\figurename{ຮູບທີ}%
- \def\tablename{ຕາຕະລາງທີ}%
- \def\partname{ພາກ}%
- \def\pagename{ໜ້າ}%
- \def\seename{ອ່ານ}%
- \def\alsoname{ອ່ານເພີ່ມ}%
- \def\enclname{ເອກະສານປະກອບ}%
- \def\ccname{ສໍາເນົາເຖິງ}%
- \def\headtoname{ຮຽນ}%
- \def\proofname{ຂໍ້ພິສູດ}%
- \def\glossaryname{ປະມວນສັບ}%
-}
-\def\datelao{%
- \def\lao@month{%
- \ifcase\month\or
- ມັງກອນ\or
- ກຸມພາ\or
- ມີນາ\or
- ເມສາ\or
- ພຶດສະພາ\or
- ມິຖຸນາ\or
- ກໍລະກົດ\or
- ສິງຫາ\or
- ກັນຍາ\or
- ຕຸລາ\or
- ພະຈິກ\or
- ທັນວາ\fi}%
- \def\today{\laonumber\day \space \lao@month \space \laonumber\year}%
-}
-
-\def\laodigits#1{\expandafter\@lao@digits #1@}
-\def\@lao@digits#1{%
- \ifx @#1% then terminate
- \else
- \ifx0#1໐\else\ifx1#1໑\else\ifx2#1໒\else\ifx3#1໓\else\ifx4#1໔\else\ifx5#1໕\else\ifx6#1໖\else\ifx7#1໗\else\ifx8#1໘\else\ifx9#1໙\else#1\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
- \expandafter\@lao@digits
- \fi
-}
-
-\newcommand{\laonumerals}[2]{\laonumber{#2}}
-
-\def\laonumber#1{%
- \if@lao@numerals
- \laodigits{\number#1}%
- \else
- \number#1%
- \fi}
-
-\def\lao@globalnumbers{%
- \let\orig@arabic\@arabic%
- \let\@arabic\laonumber%
- \renewcommand{\thefootnote}{\localnumeral*{footnote}}%
-}
-\def\nolao@globalnumbers{%
- \let\@arabic\orig@arabic%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-lao.ldf>
-%<*gloss-latex.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-latex.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-latex.ldf}[polyglossia: module for default language]
-
-\PolyglossiaSetup{latex}{
- bcp47=en-US,
- bcp47-language=en,
- bcp47-region=US,
- bcp47-script=Latn,
- hyphennames={english},
- hyphenmins={2,3},
- langtag=ENG,
- fontsetup=true,
- % ignore command
- DefineCommandsCmd={use_none:n}
-}
-
-\def\captionslatex{%
- \def\prefacename{Preface}%
- \def\refname{References}%
- \def\abstractname{Abstract}%
- \def\bibname{Bibliography}%
- \def\chaptername{Chapter}%
- \def\appendixname{Appendix}%
- \def\contentsname{Contents}%
- \def\listfigurename{List of Figures}%
- \def\listtablename{List of Tables}%
- \def\indexname{Index}%
- \def\figurename{Figure}%
- \def\tablename{Table}%
- \def\partname{Part}%
- \def\enclname{encl}%
- \def\ccname{cc}%
- \def\headtoname{To}%
- \def\pagename{Page}%
- \def\seename{see}%
- \def\alsoname{see also}%
- \def\proofname{Proof}%
-}
-
-
-% \end{macrocode}
-% \iffalse
-%</gloss-latex.ldf>
-%<*gloss-latin.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-latin.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-latin.ldf}[polyglossia: module for Latin]
-
-\ExplSyntaxOn
-
-\PolyglossiaSetup {latin}
- {
- bcp47 = la,
- bcp47-language = la,
- bcp47-script = Latn,
- hyphenmins = {2,2},
- frenchspacing = true,
- fontsetup = true,
- langtag = LAT
- }
-
-% BCP-47 compliant aliases
-\setlanguagealias*{latin}{la}
-\setlanguagealias*[variant=classic]{latin}{la-x-classic}
-\setlanguagealias*[variant=ecclesiastic]{latin}{la-x-ecclesia}
-\setlanguagealias*[variant=medieval]{latin}{la-x-medieval}
-
-% Babel aliases
-\setlanguagealias[variant=classic]{latin}{classiclatin}
-\setlanguagealias[variant=ecclesiastic]{latin}{ecclesiasticlatin}
-\setlanguagealias[variant=medieval]{latin}{medievallatin}
-
-
-%%%%% Variables and commands concerning spelling
-
-\bool_new:N \l_polyglossia_latin_use_j_bool
-\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
-
-\cs_new:Npn \polyglossia_latin_classical_character_codes:
- {
- \char_set_lccode:nn {`\V} {`\u}
- \char_set_uccode:nn {`\u} {`\V}
- \char_set_uccode:nn {`\ú} {`\V}
- \char_set_uccode:nn {`\ū} {`\V}
- \char_set_uccode:nn {`\ŭ} {`\V}
- }
-
-\cs_new:Npn \polyglossia_latin_modern_character_codes:
- {
- \char_set_lccode:nn {`\V} {`\v}
- \char_set_uccode:nn {`\u} {`\U}
- \char_set_uccode:nn {`\ú} {`\Ú}
- \char_set_uccode:nn {`\ū} {`\Ū}
- \char_set_uccode:nn {`\ŭ} {`\Ŭ}
- }
-
-
-%%%%% Messages and commands concerning hyphenation
-
-\msg_new:nnn {polyglossia} {latin / missing modern patterns}
- {
- The~hyphenation~patterns~for~modern~Latin~were~not~found~\msg_line_context:.
- }
-
-\msg_new:nnn {polyglossia} {latin / missing patterns}
- {
- The~"#1"~hyphenation~patterns~were~not~found~\msg_line_context:.~
- I~will~use~the~patterns~for~modern~Latin~instead.
- }
-
-\cs_new:Npn \polyglossia_latin_use_modern_patterns:
- {
- \xpg@ifdefined {latin}
- {
- \def \latin@language
- {
- \polyglossia@setup@language@patterns {latin}
- \str_case:Vn \l_polyglossia_latin_variant_str
- {
- {classic} { \adddialect \l@classiclatin \l@latin }
- {medieval} { \adddialect \l@medievallatin \l@latin }
- {ecclesiastic} { \adddialect \l@ecclesiasticlatin \l@latin }
- }
- }
- }
- {
- \msg_warning:nn {polyglossia} {latin / missing modern patterns}
- \str_case:Vn \l_polyglossia_latin_variant_str
- {
- {classic} { \adddialect \l@classiclatin \l@nohyphenation }
- {medieval} { \adddialect \l@medievallatin \l@nohyphenation }
- {modern} { \adddialect \l@latin \l@nohyphenation }
- {ecclesiastic} { \adddialect \l@ecclesiasticlatin \l@nohyphenation }
- }
- }
- }
-
-\cs_new:Npn \polyglossia_latin_set_patterns:n #1
-% #1 may be "classiclatin" or "liturgicallatin"
- {
- \xpg@ifdefined {#1}
- {
- \def \latin@language
- {
- \polyglossia@setup@language@patterns {#1}
- \str_case:Vn \l_polyglossia_latin_variant_str
- {
- {classic} {
- \str_if_eq:nnF {#1} {classiclatin}
- {
- \adddialect \l@classiclatin { \use:c {l@#1} }
- }
- }
- {medieval} { \adddialect \l@medievallatin { \use:c {l@#1} } }
- {modern} { \adddialect \l@latin { \use:c {l@#1} } }
- {ecclesiastic} { \adddialect \l@ecclesiasticlatin { \use:c {l@#1} } }
- }
- }
- }
- {
- \msg_warning:nnn {polyglossia} {latin / missing patterns} {#1}
- \polyglossia_latin_use_modern_patterns:
- }
- }
-
-
-%%%%% Settings for the spacing of the punctuation for ecclesiastical Latin
-
-\bool_new:N \g_polyglossia_latin_punctuation_spacing_bool
-
-\sys_if_engine_luatex:TF
- {
- \directlua { require('polyglossia-latin') }
- }
- {
- \newXeTeXintercharclass \g_polyglossia_latin_question_exclamation_class
- \newXeTeXintercharclass \g_polyglossia_latin_colon_semicolon_class
- \newXeTeXintercharclass \g_polyglossia_latin_opening_guillemet_class
- \newXeTeXintercharclass \g_polyglossia_latin_closing_guillemet_class
- \newXeTeXintercharclass \g_polyglossia_latin_opening_bracket_class
- \newXeTeXintercharclass \g_polyglossia_latin_closing_bracket_class
-
- \cs_new:Npn \polyglossia_latin_insert_punctuation_space:
- {
- \nobreak
- \skip_horizontal:n { 0.08333 \fontdimen6 \font } % 1/12 quad
- }
- \cs_new:Npn \polyglossia_latin_replace_preceding_space:
- {
- \dim_compare:nNnT {\lastskip} > {\c_zero_dim} {\unskip}
- \polyglossia_latin_insert_punctuation_space:
- }
- \cs_new:Npn \polyglossia_latin_replace_following_space:
- {
- \polyglossia_latin_insert_punctuation_space:
- \ignorespaces
- }
- }
-
-\cs_new:Npn \polyglossia_latin_punctuation_spacing:
- {
- \sys_if_engine_luatex:TF
- {
- \directlua { polyglossia.activate_latin_punct() }
- }
- {
- \XeTeXinterchartokenstate = 1
- \XeTeXcharclass `\! \g_polyglossia_latin_question_exclamation_class
- \XeTeXcharclass `\? \g_polyglossia_latin_question_exclamation_class
- \XeTeXcharclass `\‼ \g_polyglossia_latin_question_exclamation_class
- \XeTeXcharclass `\⁇ \g_polyglossia_latin_question_exclamation_class
- \XeTeXcharclass `\⁈ \g_polyglossia_latin_question_exclamation_class
- \XeTeXcharclass `\⁉ \g_polyglossia_latin_question_exclamation_class
- \XeTeXcharclass `\‽ \g_polyglossia_latin_question_exclamation_class
- \XeTeXcharclass `\; \g_polyglossia_latin_colon_semicolon_class
- \XeTeXcharclass `\: \g_polyglossia_latin_colon_semicolon_class
- \XeTeXcharclass `\« \g_polyglossia_latin_opening_guillemet_class
- \XeTeXcharclass `\» \g_polyglossia_latin_closing_guillemet_class
- \XeTeXcharclass `\‹ \g_polyglossia_latin_opening_guillemet_class
- \XeTeXcharclass `\› \g_polyglossia_latin_closing_guillemet_class
- \XeTeXcharclass `\( \g_polyglossia_latin_opening_bracket_class
- \XeTeXcharclass `\) \g_polyglossia_latin_closing_bracket_class
- \XeTeXcharclass `\[ \g_polyglossia_latin_opening_bracket_class
- \XeTeXcharclass `\] \g_polyglossia_latin_closing_bracket_class
- \XeTeXcharclass `\{ \g_polyglossia_latin_opening_bracket_class
- \XeTeXcharclass `\} \g_polyglossia_latin_closing_bracket_class
- \XeTeXcharclass `\⟨ \g_polyglossia_latin_opening_bracket_class
- \XeTeXcharclass `\⟩ \g_polyglossia_latin_closing_bracket_class
-
- % question or exclamation mark followed by a closing guillemet
- \XeTeXinterchartoks \g_polyglossia_latin_question_exclamation_class \g_polyglossia_latin_closing_guillemet_class =
- {
- \polyglossia_latin_insert_punctuation_space:
- }
- % question or exclamation mark followed by a colon or semicolon
- \XeTeXinterchartoks \g_polyglossia_latin_question_exclamation_class \g_polyglossia_latin_colon_semicolon_class =
- {
- \polyglossia_latin_insert_punctuation_space:
- }
- % colon or semicolon followed by a closing guillemet
- \XeTeXinterchartoks \g_polyglossia_latin_colon_semicolon_class \g_polyglossia_latin_closing_guillemet_class =
- {
- \polyglossia_latin_insert_punctuation_space:
- }
- % closing bracket followed by a question or exclamation mark
- \XeTeXinterchartoks \g_polyglossia_latin_closing_bracket_class \g_polyglossia_latin_question_exclamation_class =
- {
- \polyglossia_latin_insert_punctuation_space:
- }
- % closing bracket followed by a colon or semicolon
- \XeTeXinterchartoks \g_polyglossia_latin_closing_bracket_class \g_polyglossia_latin_colon_semicolon_class =
- {
- \polyglossia_latin_insert_punctuation_space:
- }
- % closing bracket followed by a closing guillemet
- \XeTeXinterchartoks \g_polyglossia_latin_closing_bracket_class \g_polyglossia_latin_closing_guillemet_class =
- {
- \polyglossia_latin_insert_punctuation_space:
- }
- % opening guillemet followed by a space
- \XeTeXinterchartoks \g_polyglossia_latin_opening_guillemet_class \xpg@boundaryclass =
- {
- \polyglossia_latin_replace_following_space:
- }
- % opening guillemet followed by an opening guillemet
- \XeTeXinterchartoks \g_polyglossia_latin_opening_guillemet_class \g_polyglossia_latin_opening_guillemet_class =
- {
- \polyglossia_latin_insert_punctuation_space:
- }
- % opening guillemet followed by an ordinary character
- \XeTeXinterchartoks \g_polyglossia_latin_opening_guillemet_class \z@ =
- {
- \polyglossia_latin_insert_punctuation_space:
- }
- % closing guillemet followed by a closing guillemet
- \XeTeXinterchartoks \g_polyglossia_latin_closing_guillemet_class \g_polyglossia_latin_closing_guillemet_class =
- {
- \polyglossia_latin_insert_punctuation_space:
- }
- % closing guillemet followed by a question or exclamation mark
- \XeTeXinterchartoks \g_polyglossia_latin_closing_guillemet_class \g_polyglossia_latin_question_exclamation_class =
- {
- \polyglossia_latin_insert_punctuation_space:
- }
- % closing guillemet followed by a colon or semicolon
- \XeTeXinterchartoks \g_polyglossia_latin_closing_guillemet_class \g_polyglossia_latin_colon_semicolon_class =
- {
- \polyglossia_latin_insert_punctuation_space:
- }
- % space followed by a question or exclamation mark
- \XeTeXinterchartoks \xpg@boundaryclass \g_polyglossia_latin_question_exclamation_class =
- {
- \polyglossia_latin_replace_preceding_space:
- }
- % space followed by a colon or semicolon
- \XeTeXinterchartoks \xpg@boundaryclass \g_polyglossia_latin_colon_semicolon_class =
- {
- \polyglossia_latin_replace_preceding_space:
- }
- % space followed by closing guillemet
- \XeTeXinterchartoks \xpg@boundaryclass \g_polyglossia_latin_closing_guillemet_class =
- {
- \polyglossia_latin_replace_preceding_space:
- }
- % ordinary character followed by a question or exclamation mark
- \XeTeXinterchartoks \z@ \g_polyglossia_latin_question_exclamation_class =
- {
- \polyglossia_latin_insert_punctuation_space:
- }
- % ordinary character followed by a colon or semicolon
- \XeTeXinterchartoks \z@ \g_polyglossia_latin_colon_semicolon_class =
- {
- \polyglossia_latin_insert_punctuation_space:
- }
- % ordinary character followed by closing guillemet
- \XeTeXinterchartoks \z@ \g_polyglossia_latin_closing_guillemet_class =
- {
- \polyglossia_latin_insert_punctuation_space:
- }
- }
- }
-
-\cs_new:Npn \polyglossia_latin_no_punctuation_spacing:
- {
- \sys_if_engine_luatex:TF
- {
- \directlua { polyglossia.deactivate_latin_punct() }
- }
- {
- \XeTeXcharclass `\! \z@
- \XeTeXcharclass `\? \z@
- \XeTeXcharclass `\‼ \z@
- \XeTeXcharclass `\⁇ \z@
- \XeTeXcharclass `\⁈ \z@
- \XeTeXcharclass `\⁉ \z@
- \XeTeXcharclass `\‽ \z@
- \XeTeXcharclass `\; \z@
- \XeTeXcharclass `\: \z@
- \XeTeXcharclass `\« \z@
- \XeTeXcharclass `\» \z@
- \XeTeXcharclass `\‹ \z@
- \XeTeXcharclass `\› \z@
- \XeTeXcharclass `\( \z@
- \XeTeXcharclass `\) \z@
- \XeTeXcharclass `\[ \z@
- \XeTeXcharclass `\] \z@
- \XeTeXcharclass `\{ \z@
- \XeTeXcharclass `\} \z@
- \XeTeXcharclass `\⟨ \z@
- \XeTeXcharclass `\⟩ \z@
- \XeTeXinterchartokenstate = 0
- }
- }
-
-
-%%%%% Messages and commands concerning footnotes
-
-% Save original footnote definition
-% Do this at the end of the preamble to catch other
-% packages' footnote changes (#391)
-\AtEndPreamble{%
- \cs_if_exist:NT \@makefntext
- {
- \cs_set_eq:NN \polyglossia_latin_original_footnote:n \@makefntext
- }
-}
-
-% This is the footnote style as defined by the "ecclesiastic" package.
-\cs_new:Npn \polyglossia_latin_variant_footnote:n #1
- {
- \parindent 1em
- \noindent
- \hbox { \normalfont \@thefnmark . }
- \enspace #1
- }
-
-\msg_new:nnn {polyglossia} {latin / ineffective footnote option}
- {
- The~option~"ecclesiasticfootnotes"~is~ineffective~\msg_line_context:
- \c_space_tl as~Latin~is~not~the~main~language.
- }
-
-\cs_new:Npn \polyglossia_latin_apply_footnote_option:
- {
- \str_if_eq:VnTF \xpg@main@language {latin}
- {
- \cs_if_exist:NT \@makefntext
- {
- \iflatin@ecclesiasticfootnotes
- \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: }
- }
- }
-
-
-%%%%% Language variants: classic, medieval, modern, and ecclesiastic
-
-\str_new:N \l_polyglossia_latin_variant_str
-
-\msg_new:nnn {polyglossia} {latin / language variant}
- {
- Activating~Latin~language~variant~"#1"~\msg_line_context:.
- }
-
-\msg_new:nnn {polyglossia} {latin / illegal language variant}
- {
- The~Latin~language~variant~"#1"~is~undefined~\msg_line_context:.
- }
-
-\cs_new:Npn \polyglossia_latin_classic_settings:
- {
- \bool_set_false:N \l_polyglossia_latin_use_j_bool
- \bool_set_false:N \l_polyglossia_latin_use_v_bool
- \bool_set_false:N \l_polyglossia_latin_use_ligatures_bool
- \bool_set_true:N \l_polyglossia_latin_capitalize_month_bool
- \bool_set_false:N \l_polyglossia_latin_punctuation_spacing_bool
- \str_set:Nn \l_polyglossia_latin_variant_str {classic}
- \SetLanguageKeys {latin} { babelname = classiclatin, bcp47 = la-x-classic, bcp47-extension-x = classic }
- \polyglossia_latin_set_patterns:n {classiclatin}
- }
-
-\cs_new:Npn \polyglossia_latin_medieval_settings:
- {
- \bool_set_false:N \l_polyglossia_latin_use_j_bool
- \bool_set_false:N \l_polyglossia_latin_use_v_bool
- \bool_set_true:N \l_polyglossia_latin_use_ligatures_bool
- \bool_set_true:N \l_polyglossia_latin_capitalize_month_bool
- \bool_set_false:N \l_polyglossia_latin_punctuation_spacing_bool
- \str_set:Nn \l_polyglossia_latin_variant_str {medieval}
- \SetLanguageKeys {latin} { babelname = medievallatin, bcp47 = la-x-medieval, bcp47-extension-x = medieval, bcp47-casing = la-x-medieval }
- \polyglossia_latin_use_modern_patterns:
- }
-
-\cs_new:Npn \polyglossia_latin_modern_settings:
- {
- \bool_set_false:N \l_polyglossia_latin_use_j_bool
- \bool_set_true:N \l_polyglossia_latin_use_v_bool
- \bool_set_false:N \l_polyglossia_latin_use_ligatures_bool
- \bool_set_true:N \l_polyglossia_latin_capitalize_month_bool
- \bool_set_false:N \l_polyglossia_latin_punctuation_spacing_bool
- \str_set:Nn \l_polyglossia_latin_variant_str {modern}
- \SetLanguageKeys {latin} { babelname = latin, bcp47 = la }
- \polyglossia_latin_use_modern_patterns:
- }
-
-\cs_new:Npn \polyglossia_latin_ecclesiastic_settings:
- {
- \bool_set_false:N \l_polyglossia_latin_use_j_bool
- \bool_set_true:N \l_polyglossia_latin_use_v_bool
- \bool_set_true:N \l_polyglossia_latin_use_ligatures_bool
- \bool_set_false:N \l_polyglossia_latin_capitalize_month_bool
- \bool_set_true:N \l_polyglossia_latin_punctuation_spacing_bool
- \str_set:Nn \l_polyglossia_latin_variant_str {ecclesiastic}
- \SetLanguageKeys {latin} { babelname = ecclesiasticlatin, bcp47 = la-x-ecclesia, bcp47-extension-x = ecclesia }
- \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}
- {
- Activating~hyphenation~patterns~for~#1~Latin~\msg_line_context:.
- }
-
-\msg_new:nnn {polyglossia} {latin / illegal hyphenation variant}
- {
- 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
- {
- \def \prefacename
- {
- \bool_if:NTF \l_polyglossia_latin_use_ligatures_bool {Præfatio} {Praefatio}
- }
- \def \refname {Conspectus~librorum}
- \def \abstractname {Summarium}
- \def \bibname {Conspectus~librorum}
- \def \chaptername {Caput}
- \def \appendixname {Additamentum}
- \def \contentsname {Index}
- \def \listfigurename {Conspectus~descriptionum}
- \def \listtablename {Conspectus~tabularum}
- \def \indexname {Index~rerum~notabilium}
- \def \figurename {Descriptio}
- \def \tablename {Tabula}
- \def \partname {Pars}
- \def \enclname {Additur}
- \def \ccname {Exemplar}
- \def \headtoname {\ignorespaces}
- \def \pagename {charta}
- \def \seename {cfr.}
- \def \alsoname {cfr.}
- \def \proofname {Demonstratio}
- \def \glossaryname {Glossarium}
- }
-
-\cs_new:Npn \polyglossia_latin_month_name:
- {
- \tl_set:Nx \l_tmpa_tl
- {
- \int_case:nn { \month }
- {
- {1} { \bool_if:NTF \l_polyglossia_latin_use_j_bool {januarii} {ianuarii} }
- {2} {februarii}
- {3} {martii}
- {4} {aprilis}
- {5} { \bool_if:NTF \l_polyglossia_latin_use_j_bool {maji} {maii} }
- {6} { \bool_if:NTF \l_polyglossia_latin_use_j_bool {junii} {iunii} }
- {7} { \bool_if:NTF \l_polyglossia_latin_use_j_bool {julii} {iulii} }
- {8} {augusti}
- {9} {septembris}
- {10} {octobris}
- {11} { \bool_if:NTF \l_polyglossia_latin_use_v_bool {novembris} {nouembris} }
- {12} {decembris}
- }
- }
- \bool_if:NTF \l_polyglossia_latin_capitalize_month_bool
- {
- \text_titlecase:n { \l_tmpa_tl }
- }
- {
- \l_tmpa_tl
- }
- }
-
-\def \datelatin
- {
- \def \today
- {
- \int_to_Roman:n { \day }
- \c_space_tl
- \polyglossia_latin_month_name:
- \c_space_tl
- \int_to_Roman:n { \year }
- }
- }
-
-
-%%%%% Latin shorthands
-
-\define@boolkey{latin}[latin@]{babelshorthands}[true]
- {
- }
-
-\define@boolkey{latin}[latin@]{prosodicshorthands}[true]
- {
- }
-
-% Register default options
-\xpg@initialize@gloss@options{latin}{variant=modern,hyphenation=modern,babelshorthands=false,
- prosodicshorthands=false,ecclesiasticfootnotes=false,
- usej=false,capitalizemonth=true}
-
-\ifsystem@babelshorthands
- \setkeys{latin}{babelshorthands=true}
-\else
- \setkeys{latin}{babelshorthands=false}
-\fi
-
-\ExplSyntaxOff % babelsh.def does not support expl3 syntax
-\ifcsundef{initiate@active@char}{\input{babelsh.def}}{}
-\ExplSyntaxOn
-
-\initiate@active@char {"}
-\initiate@active@char {'}
-\initiate@active@char {^}
-\initiate@active@char {=}
-
-\shorthandoff {"}
-\shorthandoff {'}
-\shorthandoff* {^}
-\shorthandoff {=}
-
-% The active = character may cause problems with key=value interfaces.
-% We have to make sure here that no problems can occur outside a Latin
-% prosodic shorthand environment.
-% The active ^ character may cause problems with TeX's ^^xx convention
-% for hexadecimal input. We have to make sure here that no problems can
-% occur outside a Latin prosodic shorthand environment.
-% The active ' character may cause problems with the unicode-math package
-% (in case Latin is used as a secondary language, see #394). We have to
-% turn it off if Latin is not the main language.
-
-% For the aux file:
-\protected@write \@auxout { }
- {
- \shorthandoff {=}
- \shorthandoff* {^} % #582
- }
-
-\AtBeginDocument
- {
- \str_if_eq:VnTF \xpg@main@language {latin}
- {
- \iflatin@prosodicshorthands
- \else
- \shorthandoff {=}
- \shorthandoff* {^}
- \fi
- }
- {
- % The following command should not be called if the main language
- % defines a = shorthand. However, there are no languages besides
- % Latin defining such a shorthand in polyglossia.
- \shorthandoff {=}
- % The following command should not be called if the main language
- % defines a ^ shorthand. However, there are no languages besides
- % Latin defining such a shorthand in polyglossia.
- \shorthandoff* {^}
- % The following command should not be called if the main language
- % defines a ' shorthand. However, there are no languages besides
- % Latin defining such a shorthand in polyglossia.
- \shorthandoff {'}
- }
- }
-
-\cs_new:Npn \polyglossia_latin_shorthands:
- {
- \def \language@group {latin}
- \xpg@activate@shorthands ["]
- \declare@shorthand {latin} {"}
- {
- \mode_if_math:TF
- {
- \token_to_str:N "
- }
- {
- \polyglossia_latin_apply_quotemark:N
- }
- }
- % The ' shorthand is normally turned off to avoid problems with the unicode-math
- % package. We have to turn it on here.
- \shorthandon {'}
- \xpg@activate@shorthands [']
- \declare@shorthand {latin} {'}
- {
- \mode_if_math:TF
- {
- \active@math@prime % defined in "latex.ltx"
- % This definition is differing from the primes of the unicode-math package.
- % TO DO: Make sure that the appearance of primes is the same as with the
- % unicode-math package if this package is loaded.
- }
- {
- \polyglossia_latin_put_acute:N
- }
- }
- }
-
-\cs_new:Npn \polyglossia_latin_prosodic_shorthands:
- {
- \def \language@group {latin}
- % The '=' and '^' shorthands are normally turned off to avoid problems with
- % key=value interfaces and TeX's ^^xx convention for hexadecimal input. We
- % turn them on here to enable prosodic shorthands.
- \shorthandon {=}
- \bbl@activate {=}
- \declare@shorthand {latin} {=}
- {
- \mode_if_math:TF
- {
- \token_to_str:N =
- }
- {
- \polyglossia_latin_put_macron:N
- }
- }
- \shorthandon {^}
- \bbl@activate {^}
- \declare@shorthand {latin} {^}
- {
- \mode_if_math:TF
- {
- \token_to_str:N ^
- }
- {
- \polyglossia_latin_put_breve:N
- }
- }
- }
-
-\cs_new:Npn \polyglossia_latin_apply_quotemark:N #1
- {
- \str_case:nnF {#1}
- {
- {A} { \polyglossia_latin_ligature_shorthand:Nnn E { Æ }
- {
- \polyglossia_latin_ligature_shorthand:Nnn e { Æ }
- {
- \polyglossia_latin_allow_hyphens: A
- }
- }
- }
- {a} { \polyglossia_latin_ligature_shorthand:Nnn e { æ }
- {
- \polyglossia_latin_allow_hyphens: a
- }
- }
- {O} { \polyglossia_latin_ligature_shorthand:Nnn E { Π}
- {
- \polyglossia_latin_ligature_shorthand:Nnn e { Π}
- {
- \polyglossia_latin_allow_hyphens: O
- }
- }
- }
- {o} { \polyglossia_latin_ligature_shorthand:Nnn e { œ }
- {
- \polyglossia_latin_allow_hyphens: o
- }
- }
- {|} { \polyglossia_latin_allow_hyphens: }
- {<} { « }
- {>} { » }
- }
- {
- \tl_if_single_token:nTF {#1}
- {
- \token_if_letter:NTF #1 { \polyglossia_latin_allow_hyphens: }
- {
- \polyglossia_latin_if_ligature_command:NTF #1 { \polyglossia_latin_allow_hyphens: }
- {
- \token_to_str:N "
- }
- }
- }
- {
- \token_to_str:N "
- }
- #1
- }
- }
-
-\cs_new:Npn \polyglossia_latin_put_acute:N #1
- {
- \str_case:nnF {#1}
- {
- {A} { \polyglossia_latin_ligature_shorthand:Nnn E { Ǽ }
- {
- \polyglossia_latin_ligature_shorthand:Nnn e { Ǽ } { Á }
- }
- }
- {a} { \polyglossia_latin_ligature_shorthand:Nnn e { ǽ } { á } }
- {E} { É }
- {e} { é }
- {I} { Í }
- {i} { í }
- {O} { \polyglossia_latin_ligature_shorthand:Nnn E { \'Π}
- {
- \polyglossia_latin_ligature_shorthand:Nnn e { \'Œ } { Ó }
- }
- }
- {o} { \polyglossia_latin_ligature_shorthand:Nnn e { \'œ } { ó } }
- {U} { Ú }
- {u} { ú }
- {V} { \' V } % V may be a vowel, but lowercase v is never used as a vowel.
- {Y} { Ý }
- {y} { ý }
- {Æ} { Ǽ }
- {æ} { ǽ }
- {Œ} { \'Œ }
- {œ} { \'œ }
- }
- {
- \tl_if_single_token:nTF {#1}
- {
- \polyglossia_latin_if_ligature_command:NTF #1 { \' }
- {
- \token_to_str:N '
- }
- }
- {
- \token_to_str:N '
- }
- #1
- }
- }
-
-\cs_new:Npn \polyglossia_latin_put_macron:N #1
- {
- \str_case:nnF {#1}
- {
- {A} { \polyglossia_latin_ligature_macron:NNnn AE { Ǣ }
- {
- \polyglossia_latin_ligature_macron:NNnn Ae { Ǣ }
- {
- \polyglossia_latin_diphthong_macron:NNn AU
- {
- \polyglossia_latin_diphthong_macron:NNn Au { Ā }
- }
- }
- }
- }
- {a} { \polyglossia_latin_ligature_macron:NNnn ae { ǣ }
- {
- \polyglossia_latin_diphthong_macron:NNn au { ā }
- }
- }
- {E} { \polyglossia_latin_diphthong_macron:NNn EU
- {
- \polyglossia_latin_diphthong_macron:NNn Eu { Ē }
- }
- }
- {e} { \polyglossia_latin_diphthong_macron:NNn eu { ē } }
- {I} { Ī }
- {i} { ī }
- {O} { \polyglossia_latin_ligature_macron:NNnn OE { \=Π}
- {
- \polyglossia_latin_ligature_macron:NNnn Oe { \=Œ } { Ō }
- }
- }
- {o} { \polyglossia_latin_ligature_macron:NNnn oe { \=œ } { ō } }
- {U} { Ū }
- {u} { ū }
- {V} { \= V } % V may be a vowel, but lowercase v is never used as a vowel.
- {Y} { Ȳ }
- {y} { ȳ }
- }
- {
- \tl_if_single_token:nTF {#1}
- {
- \polyglossia_latin_if_ligature_command:NTF #1 { \= }
- {
- \token_to_str:N =
- }
- }
- {
- \token_to_str:N =
- }
- #1
- }
- }
-
-\cs_new:Npn \polyglossia_latin_put_breve:N #1
- {
- \str_case:nnF {#1}
- {
- {A} { Ă }
- {a} { ă }
- {E} { Ĕ }
- {e} { ĕ }
- {I} { Ĭ }
- {i} { ĭ }
- {O} { Ŏ }
- {o} { ŏ }
- {U} { Ŭ }
- {u} { ŭ }
- {V} { \u{V} } % V may be a vowel, but lowercase v is never used as a vowel.
- {Y} { \u{Y} }
- {y} { \u{y} }
- }
- {
- \token_to_str:N ^
- #1
- }
- }
-
-
-\cs_new:Npn \polyglossia_latin_allow_hyphens:
- {
- \bbl@allowhyphens
- \discretionary {-} {} {}
- \bbl@allowhyphens
- }
-
-\cs_new:Npn \polyglossia_latin_ligature_shorthand:Nnn #1#2#3
-% #1: second letter of ligature (E or e)
-% #2: ligature character
-% #3: non-ligature code
- {
- \bool_if:NTF \l_polyglossia_latin_use_ligatures_bool
- {
- \peek_meaning_remove:NTF #1 {#2} {#3}
- }
- {
- #3
- }
- }
-
-\msg_new:nnn {polyglossia} {latin / no-double-macron-font}
- {
- The~combining~double~macron~(U+035E)~is~not~available~in~the~current~
- font.~The~diphthong~is~typeset~without~macron~ \msg_line_context: .
- }
-
-\cs_new:Npn \polyglossia_latin_diphthong_macron:NNn #1#2#3
-% #1: first character of diphthong
-% #2: second character of diphthong
-% #3: non-diphthong code
- {
- \peek_meaning:NTF #2
- {
- #1
- \iffontchar \font "35E \relax % U+035E: combining double macron
- \char "35E \relax
- \else
- \msg_warning:nn {polyglossia} {latin / no-double-macron-font}
- \fi
- }
- {
- #3
- }
- }
-
-\cs_new:Npn \polyglossia_latin_ligature_macron:NNnn #1#2#3#4
-% #1: first character of diphthong
-% #2: second character of diphthong
-% #3: ligature code
-% #4: false code
- {
- \polyglossia_latin_ligature_shorthand:Nnn #2 {#3}
- {
- \polyglossia_latin_diphthong_macron:NNn #1 #2 {#4}
- }
- }
-
-% The following conditional tests if the argument is a ligature command (\AE,
-% \ae, \OE, or \oe).
-\prg_new_conditional:Npnn \polyglossia_latin_if_ligature_command:N #1 {TF}
- {
- \token_if_eq_meaning:NNTF #1 \AE { \prg_return_true: }
- {
- \token_if_eq_meaning:NNTF #1 \ae { \prg_return_true: }
- {
- \token_if_eq_meaning:NNTF #1 \OE { \prg_return_true: }
- {
- \token_if_eq_meaning:NNTF #1 \oe { \prg_return_true: }
- {
- \prg_return_false:
- }
- }
- }
- }
- }
-
-\cs_new:Npn \polyglossia_latin_no_shorthands:
- {
- \xpg@deactivate@shorthands ["]
- \xpg@deactivate@shorthands [']
- }
-
-\cs_new:Npn \polyglossia_latin_no_prosodic_shorthands:
- {
- \bbl@deactivate {=}
- \bbl@deactivate {^}
- % The active '=' character may cause problems with key=value interfaces.
- % We have to make sure here that no problems can occur outside a Latin
- % prosodic shorthand environment.
- \shorthandoff {=}
- % The active '^' character may cause problems with TeX's ^^xx convention
- % for hexadecimal input. We have to make sure here that no problems can
- % occur outside a Latin prosodic shorthand environment.
- \shorthandoff* {^}
- }
-
-
-%%%%% Further settings
-
-\let \xpgla@savedvalues \empty
-
-\AtEndPreamble
- {
- \edef \xpgla@savedvalues
- {
- \clubpenalty = \the \clubpenalty \space
- \@clubpenalty = \the \@clubpenalty \space
- \widowpenalty = \the \widowpenalty \space
- \finalhyphendemerits = \the \finalhyphendemerits
- }
- }
-
-\def \noextras@latin
- {
- \iflatin@babelshorthands
- \polyglossia_latin_no_shorthands:
- \fi
- \iflatin@prosodicshorthands
- \polyglossia_latin_no_prosodic_shorthands:
- \fi
- \xpgla@savedvalues
- \polyglossia_latin_no_punctuation_spacing:
- \polyglossia_latin_modern_character_codes:
- }
-
-\cs_new:Npn \polyglossia_latin_inline_extras:
- {
- \bool_if:NF \l_polyglossia_latin_use_v_bool
- {
- \polyglossia_latin_classical_character_codes:
- }
- \bool_if:NT \l_polyglossia_latin_punctuation_spacing_bool
- {
- \polyglossia_latin_punctuation_spacing:
- }
- \iflatin@babelshorthands
- \polyglossia_latin_shorthands:
- \else
- \polyglossia_latin_no_shorthands:
- \fi
- \iflatin@prosodicshorthands
- \polyglossia_latin_prosodic_shorthands:
- \else
- \polyglossia_latin_no_prosodic_shorthands:
- \fi
- }
-
-\def \blockextras@latin
- {
- % The following four values were overtaken from the Italian language module.
- % It is unclear why they were chosen.
- \clubpenalty = 3000
- \@clubpenalty = 3000
- \widowpenalty = 3000
- \finalhyphendemerits = 50000000
- \polyglossia_latin_inline_extras:
- }
-
-\def \inlineextras@latin
- {
- \polyglossia_latin_inline_extras:
- }
-
-
-%% Default settings
-
-\polyglossia_latin_modern_settings:
-
-\ExplSyntaxOff
-
-%% Copyright (C) Claudio Beccari 2013-2016
-%% Copyright (C) Élie Roux 2016-2019
-%% Copyright (C) Keno Wehr 2019-2022
-%%
-%% 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.
-%%
-%% End of file `gloss-latin.ldf'.
-% \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)
-%
-\ProvidesFile{gloss-latvian.ldf}[polyglossia: module for Latvian]
-\PolyglossiaSetup{latvian}{
- bcp47=lv,
- bcp47-language=lv,
- bcp47-region=LV,
- bcp47-script=Latn,
- hyphennames={latvian},
- hyphenmins={2,2},
- langtag=LVI,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{latvian}{lv}
-
-\def\captionslatvian{%
- \def\prefacename{Priekšvārds}%
- \def\refname{Literatūras saraksts}%
- \def\abstractname{Anotācija}%
- \def\bibname{Literatūra}%
- \def\chaptername{Nodaļa}%
- \def\appendixname{Pielikums}%
- \def\contentsname{Saturs}%
- \def\listfigurename{Attēlu saraksts}%
- \def\listtablename{Tabulu saraksts}%
- \def\indexname{Index}%
- \def\figurename{Att.}%
- \def\tablename{Tabula}%
- \def\partname{Daļa}%
- \def\enclname{encl}%
- \def\ccname{cc}%
- \def\headtoname{To}%
- \def\pagename{lpp.}%
- \def\seename{sk.}%
- \def\alsoname{sk. arī}%
- \def\proofname{Pierādījums}%
- }
-\def\datelatvian{%
- \def\today{%
- \number\year.\thinspace gada%
- \space\number\day.\thinspace%
- \ifcase\month\or%
- janvārī\or februārī\or martā\or%
- aprīlī\or maijā\or jūnijā\or%
- jūlijā\or augustā\or septembrī\or%
- oktobrī\or novembrī\or decembrī\fi}}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-latvian.ldf>
-%<*gloss-lithuanian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-lithuanian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-% Translated by Paulius Sladkevičius <komsas@gmail.com>
-
-\ProvidesFile{gloss-lithuanian.ldf}[polyglossia: module for Lithuanian]
-\PolyglossiaSetup{lithuanian}{
- bcp47=lt,
- bcp47-language=lt,
- bcp47-region=LT,
- bcp47-script=Latn,
- hyphennames={lithuanian},
- hyphenmins={2,2},
- langtag=LTH,
- indentfirst=true,
- fontsetup=true
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{lithuanian}{lt}
-
-\def\captionslithuanian{%
- \def\prefacename{Pratarmė}%
- \def\refname{Literatūra}%
- \def\abstractname{Santrauka}%
- \def\bibname{Literatūra}%
- \def\chaptername{Skyrius}%
- \def\appendixname{Priedas}%
- \def\contentsname{Turinys}%
- \def\listfigurename{Iliustracijų sąrašas}%
- \def\listtablename{Lentelių sąrašas}%
- \def\indexname{Rodyklė}%
- \def\figurename{pav.}%
- \def\tablename{lentelė}%
- \def\partname{Dalis}%
- \def\enclname{Įdėta}%
- \def\ccname{Kopijos}%
- \def\headtoname{Kam}% TODO empty in babel?
- \def\pagename{puslapis}%
- \def\seename{žiūrėk}%
- \def\alsoname{taip pat}%
- \def\proofname{Įrodymas}%
- \def\glossaryname{Terminų žodynas}%
-}
-
-\def\datelithuanian{%
- \def\lithuanianmonth{\ifcase\month\or
- sausio\or
- vasario\or
- kovo\or
- balandžio\or
- gegužės\or
- birželio\or
- liepos\or
- rugpjūčio\or
- rugsėjo\or
- spalio\or
- lapkričio\or
- gruodžio\fi}%
- \def\today{\number\year~m.~\lithuanianmonth~\number\day~d.}%
-}
-
-\def\blockextras@lithuanian{%
- \let\fnum@figure@orig\fnum@figure
- \def\fnum@figure{\thefigure\nobreakspace\figurename}%
- \let\fnum@table@orig\fnum@table
- \def\fnum@table{\thetable\nobreakspace\tablename}%
-}
-
-\def\noextras@lithuanian{%
- \let\fnum@figure\fnum@figure@orig
- \let\fnum@table\fnum@table@orig
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-lithuanian.ldf>
-%<*gloss-lo.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-lo.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-lo.ldf}[polyglossia: module for lo (Lao)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{lao}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-lo.ldf>
-%<*gloss-lowersorbian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-lowersorbian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-lowersorbian.ldf}[polyglossia: module for Lower Sorbian]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{sorbian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-lowersorbian.ldf>
-%<*gloss-lsorbian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-lsorbian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-lsorbian.ldf>
-%<*gloss-lt.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-lt.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-lt.ldf}[polyglossia: module for lt (Lithuanian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{lithuanian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-lt.ldf>
-%<*gloss-lv.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-lv.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-lv.ldf}[polyglossia: module for lv (Latvian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{latvian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-lv.ldf>
-%<*gloss-macedonian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-macedonian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-macedonian.ldf}[polyglossia: module for Macedonian]
-\PolyglossiaSetup{macedonian}{
- bcp47=mk,
- bcp47-language=mk,
- bcp47-script=Cyrl,
- script=Cyrillic,
- scripttag=cyrl,
- langtag=MKD,
- hyphennames={macedonian},
- hyphenmins={2,2},
- frenchspacing=true,
- fontsetup
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{macedonian}{mk}
-
-\def\macedonian@Alph#1{%
- \ifcase#1\or
- А\or Б\or В\or Г\or Д\or Ѓ\or Е\or
- Ж\or З\or Ѕ\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}{macedonian@Alph}\fi}%
-
-\def\macedonian@alph#1{%
- \ifcase#1\or
- а\or б\or в\or г\or д\or ѓ\or е\or
- ж\or з\or ѕ\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}{macedonian@alph}\fi}%
-
-\def\macedonian@numbers{%
- \let\@Alph\macedonian@Alph%
- \let\@alph\macedonian@alph%
- }
-
-\def\nomacedonian@numbers{%
- \let\@Alph\latin@Alph%
- \let\@alph\latin@alph%
-}
-
-\def\captionsmacedonian{%
- \def\refname{Литература}%
- \def\abstractname{Апстракт}%
- \def\bibname{Библиографија}%
- \def\prefacename{Предговор}%
- \def\chaptername{Глава}%
- \def\appendixname{Прилог}%
- \def\contentsname{Содржина}%
- \def\listfigurename{Листа на слики}%
- \def\listtablename{Листа на табели}%
- \def\indexname{Индекс}%
- \def\figurename{Слика}%
- \def\tablename{Табела}%
- %\def\thepart{}%
- \def\partname{Поглавје}%
- \def\pagename{стр.}%
- \def\seename{види}%
- \def\alsoname{види исто така}%
- \def\enclname{Прилог}%
- %\def\ccname{cc}%
- %\def\headtoname{}%
- \def\proofname{Доказ}%
- \def\glossaryname{Терминолошки речник}%
- }
-\def\datemacedonian{%
- \def\today{\number\day~\ifcase\month\or
- јануари\or
- февруари\or
- март\or
- април\or
- мај\or
- јуни\or
- јули\or
- август\or
- септември\or
- октомври\or
- ноември\or
- декември\fi%
- \ \number\year~г.}%
- \def\month@Roman{\expandafter\@Roman\month}%
- \def\todayRoman{\number\day.\,\month@Roman.\,\number\year~г.}%
- }
-
-% \end{macrocode}
-% \iffalse
-%</gloss-macedonian.ldf>
-%<*gloss-magyar.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-magyar.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-magyar.ldf}[polyglossia: module for Hungarian (Magyar)]
-
-% We only provide this gloss for babel compatibility.
-
-\xpg@load@master@language{hungarian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-magyar.ldf>
-%<*gloss-malay.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-malay.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-malay.ldf}[polyglossia: module for Malay]
-
-\RequirePackage{hijrical}
-
-\PolyglossiaSetup{malay}{%
- bcp47=id,
- bcp47-language=id,
- bcp47-script=Latn,
- language=Malay,
- langtag=MLY,
- hyphennames={malay,melayu,bahasam,bahasai,indonesian,indon,bahasa},
- hyphenmins={2,2},
- fontsetup=true
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*[variant=malaysian]{malay}{zsm}
-\setlanguagealias*[variant=indonesian]{malay}{id}
-
-% Babel aliases
-\setlanguagealias[variant=indonesian]{malay}{bahasai}
-\setlanguagealias[variant=malaysian]{malay}{bahasa}
-
-% Backwards compat. alias
-\setlanguagealias[variant=malaysian]{malay}{bahasam}
-
-\providebool{malay@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'}}
-
-% Register default options
-\xpg@initialize@gloss@options{malay}{variant=malaysian}
-
-
-\def\malay@language{%
- \polyglossia@setup@language@patterns{\malay@variant}%
-}%
-
-
-\def\captionsmalay@indonesian{%
- \def\refname{Pustaka}%
- \def\abstractname{Ringkasan}%
- \def\bibname{Bibliografi}%
- \def\prefacename{Pendahuluan}%
- \def\chaptername{Bab}%
- \def\appendixname{Lampiran}%
- \def\contentsname{Daftar Isi}%
- \def\listfigurename{Daftar Gambar}%
- \def\listtablename{Daftar Tabel}%
- \def\indexname{Indeks}%
- \def\figurename{Gambar}%
- \def\tablename{Tabel}%
- %\def\thepart{}%
- \def\partname{Bagian}%
- \def\pagename{Halaman}%
- \def\seename{lihat}%
- \def\alsoname{lihat juga}%
- \def\enclname{Lampiran}%
- \def\ccname{cc}%
- \def\headtoname{Kepada}%
- \def\proofname{Bukti}%
- \def\glossaryname{Daftar Istilah}%
-}
-
-\def\captionsmalay@malay{%
- \def\refname{Rujukan}%
- \def\abstractname{Abstrak}%
- \def\bibname{Bibliografi}%
- \def\prefacename{Pendahuluan}%
- \def\chaptername{Bab}%
- \def\appendixname{Lampiran}%
- \def\contentsname{Kandungan}%
- \def\listfigurename{Senarai Rajah}%
- \def\listtablename{Senarai Jadual}%
- \def\indexname{Indeks}%
- \def\figurename{Rajah}%
- \def\tablename{Jadual}%
- \def\thepart{}%
- \def\partname{Bahagian}%
- \def\pagename{Halaman}%
- \def\seename{lihat}%
- \def\alsoname{lihat juga}%
- \def\enclname{Lampiran}%
- \def\ccname{salinan kpd}%
- \def\headtoname{Kepada}%
- \def\proofname{Bukti}%
- \def\glossaryname{Senarai Istilah}%
-}
-
-\def\captionsmalay{%
- \csname captionsmalay@\malay@variant\endcsname%
-}
-
-\def\datemalay@indonesian{%
- \def\today{\number\day~\ifcase\month\or
- Januari\or Februari\or Maret\or April\or Mei\or Juni\or
- Juli\or Agustus\or September\or Oktober\or November\or Desember\fi
- \space \number\year}}
-
-\def\datemalay@malay{%
- \def\bahasam@day{%
- \ifcase\day\or%
- 1hb\or 2hb\or 3hb\or 4hb\or 5hb\or%
- 6hb\or 7hb\or 8hb\or 9hb\or 10hb\or%
- 11hb\or 12hb\or 13hb\or 14hb\or 15hb\or%
- 16hb\or 17hb\or 18hb\or 19hb\or 20hb\or%
- 21hb\or 22hb\or 23hb\or 24hb\or 25hb\or%
- 26hb\or 27hb\or 28hb\or 29hb\or 30hb\or%
- 31hb\fi}%
- \def\today{\bahasam@day~\ifcase\month\or
- Januari\or Februari\or Mac\or April\or Mei\or Jun\or
- Julai\or Ogos\or September\or Oktober\or November\or Disember\fi
- \space \number\year}}
-
-\def\datemalay{%
- \csname datemalay@\malay@variant\endcsname%
-}
-
-% Hijri calendar localizations
-\def\hijrimonthmalay@indonesian#1{%
- \ifcase#1%
- \or Muharram\or Safar\or Rabiul awal\or Rabiul akhir\or Jumadil awal\or Jumadil akhir\or Rajab%
- \or Sya'ban\or Ramadhan\or Syawal\or Dzulkaidah\or Dzulhijjah\fi%
-}
-
-\def\hijrimonthmalay@malay#1{%
- \ifcase#1%
- \or Muharram\or Safar\or Rabiulawal\or Rabiulakhir\or Jamadilawal\or Jamadilakhir\or Rejab%
- \or Syaaban\or Ramadan\or Syawal\or Zulkaedah\or Zulhijah\fi%
-}
-
-\def\hijrimonthmalay{%
- \csname hijrimonthmalay@\malay@variant\endcsname%
-}
-
-%\Hijritoday is now locale-aware and will format the date with this macro:
-\DefineFormatHijriDate{malay}{%
- \number\value{Hijriday}\space\hijrimonthmalay{\value{Hijrimonth}}\space\number\value{Hijriyear}}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-malay.ldf>
-%<*gloss-malayalam.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-malayalam.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-malayalam.ldf}[polyglossia: module for Malayalam]
-
-% Translations provided by Kevin & Siji, 01-11-2009
-
-\PolyglossiaSetup{malayalam}{
- bcp47=ml,
- bcp47-language=ml,
- bcp47-script=Mlym,
- script=Malayalam,
- scripttag=mlym,
- langtag=MAL, %FIXME there is also MLR for "Malayalam Reformed"
- hyphennames={malayalam},
- hyphenmins={2,2}, %FIXME
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{malayalam}{ml}
-
-\def\captionsmalayalam{%
- \def\abstractname{സാരാംശം}%
- \def\appendixname{ശിഷ്ടം}%
- \def\bibname{}% (?)
- \def\ccname{}%
- \def\chaptername{അദ്ധ്യായം}%
- \def\contentsname{ഉള്ളടക്കം}%
- \def\enclname{}%
- \def\figurename{ചിത്രം}% रेखाचित्र
- \def\headpagename{}%
- \def\headtoname{}%
- \def\indexname{സൂചിക}%
- \def\listfigurename{ചിത്രസൂചിക}%
- \def\listtablename{പട്ടികകളുടെ സൂചിക}%
- \def\pagename{}%
- \def\partname{ഭാഗം}%
- \def\prefacename{}%
- \def\refname{}%
- \def\tablename{പട്ടിക}%
- \def\seename{കാണുക}%
- \def\alsoname{ഇതും കാണുക}%
- \def\alsoseename{ഇതും കാണുക}%
-}
-\def\datemalayalam{%
- \def\today{\number\year\space\ifcase\month\or
- ജനുവരി\or
- ഫിബ്രുവരി\or
- മാർച്ച്\or
- ഏപ്രിൽ\or
- മെയ്\or
- ജൂൺ\or
- ജൂലായ്\or
- ആഗസ്ത്\or
- സെപ്തംബർ\or
- ഒക്ടോബർ\or
- നവംബർ\or
- ഡിസംബർ\fi
- \space\number\day}%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-malayalam.ldf>
-%<*gloss-marathi.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-marathi.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-% Translations provided by Abhijit Navale <abhi_navale@live.in>
-% Ordinals (1-100) added by Niranjan Tambe <niranjanvikastambe@gmail.com> on 14th December, 2019
-% TODO implement Hindu calendar (not used in day-to-day practice)
-
-\ProvidesFile{gloss-marathi.ldf}[polyglossia: module for Marathi]
-
-\RequirePackage{devanagaridigits}
-
-\PolyglossiaSetup{marathi}{
- bcp47=mr,
- bcp47-language=mr,
- bcp47-script=Deva,
- script=Devanagari,
- scripttag=deva,
- langtag=MAR,
- hyphennames={marathi},
- hyphenmins={2,2},%CHECK
- fontsetup=true,
- localnumeral=marathinumerals
- %TODO nouppercase=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{marathi}{mr}
-
-\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'}}
-
-% Register default options
-\xpg@initialize@gloss@options{marathi}{numerals=Devanagari}
-
-\newcommand{\marathinumerals}[2]{\marathinumber{#2}}
-
-\def\marathinumber#1{%
- \ifmarathi@devanagari@numerals
- \devanagaridigits{\number#1}%
- \else
- \number#1%
- \fi%
-}
-
-\def\captionsmarathi{%
- \def\refname{संदर्भ}%
- \def\abstractname{सारांश}%
- \def\bibname{संदर्भसूची}%
- \def\prefacename{प्रस्तावना}%
- \def\chaptername{प्रकरण}%
- \def\appendixname{परिशिष्ट}%
- \def\contentsname{अनुक्रमणिका}%
- \def\listfigurename{आकृत्यांची सूची}%
- \def\listtablename{कोष्टकसूची}%
- \def\indexname{सूची}%
- \def\figurename{आकृती}%
- \def\tablename{कोष्टक}%
- \def\partname{खंड}%
- \def\pagename{पृष्ठ}%
- \def\seename{पाहा}%
- \def\alsoname{हेदेखील पाहा}%
- \def\enclname{समाविष्ट}%
- \def\ccname{प्रत}%
- \def\headtoname{प्रति}%
- \def\proofname{सिद्धता}%
- \def\glossaryname{संज्ञांची सूची}%
- \def\authorsand{आणि}%
-}
-
-\def\datemarathi{%
- \def\marathimonth{%
- \ifcase\month\or
- जानेवारी\or
- फेब्रुवारी\or
- मार्च\or
- एप्रिल\or
- मे\or
- जून\or
- जुलै\or
- ऑगस्ट\or
- सप्टेंबर\or
- ऑक्टोबर\or
- नोव्हेंबर\or
- डिसेंबर%
- \fi%
- }%
- \def\today{%
- \marathinumber\day\space\marathimonth\space\marathinumber\year%
- }%
-}
-
-\def\devanagari@akshar#1{\ifcase#1\or अ\or आ\or इ\or ई\or उ\or ऊ\or ऋ\or ऌ\or ए\or ॲ\or ऐ\or ओ\or ऑ\or औ\or अं\or अः\else\@ctrerr\fi}
-
-\def\devanagari@alph#1{%
- \ifcase#1\or क\or ख\or ग\or घ\or ङ\or च\or छ\or ज\or झ\or ञ\or ट\or ठ\or ड\or ढ\or ण\or त\or थ\or द%
- \or ध\or न\or प\or फ\or ब\or भ\or म\or य\or र\or ल\or व\or श\or ष\or स\or ह\or ळ\or क्ष \or ज्ञ \else\@ctrerr%
- \fi%
-}
-
-\def\devanagari@letter#1{%
- \ifcase#1\or एक\or दोन\or तीन\or चार\or पाच\or सहा\or सात\or आठ\or नऊ\or दहा\or अकरा\or बारा\or तेरा\or चौदा%
- \or पंधरा\or सोळा\or सतरा\or अठरा\or एकोणीस\or वीस\or एकवीस\or बावीस\or तेवीस\or चोवीस\or पंचवीस\or सव्वीस\or सत्तावीस\or अठ्ठावीस%
- \or एकोणतीस\or तीस\or एकतीस\or बत्तीस\or तेहतीस \or चौतीस \or पस्तीस \or छत्तीस \or सदतीस \or अडतीस \or एकोणचाळीस \or चाळीस %
- \or एकेचाळीस \or बेचाळीस \or त्रेचाळीस \or चव्वेचाळीस \or पंचेचाळीस \or शेहेचाळीस \or सत्तेचाळीस \or अठ्ठेचाळीस \or एकोणपन्नास \or पन्नास %
- \or एकावन्न \or बावन्न \or त्रेपन्न \or चौपन्न \or पंचावन्न \or छप्पन्न\or सत्तावन्न \or अठ्ठावन्न \or एकोणसाठ \or साठ \or एकसष्ट \or बासष्ट \or त्रेसष्ट %
- \or चौसष्ट \or पासष्ट \or सहासष्ट \or सदुष्ट \or अडुसष्ट \or एकोणसत्तर\or सत्तर \or एकाहत्तर \or बाहत्तर \or त्र्याहत्तर \or चौऱ्याहत्तर \or पंचाहत्तर %
- \or शाहत्तर \or सत्त्याहत्तर \or अठ्ठ्याहत्तर \or एकोणऐंशी \or ऐंशी\or एक्याऐंशी \or ब्याऐंशी \or त्र्याऐंशी \or चौऱ्याऐंशी \or पंच्याऐंशी \or श्याऐंशी \or सत्त्याऐंशी %
- \or अठ्ठ्याऐंशी \or एकोणनव्वद \or नव्वद \or एक्याण्णव\or ब्याण्णव \or त्र्याण्णव \or चौऱ्याण्णव \or पंचाण्णव \or शहाण्णव \or सत्त्याण्णव \or अठ्याण्णव %
- \or नव्याण्णव \or शंभर\else\@ctrerr%
- \fi%
-}
-
-\let\xpg@save@roman\@roman
-\let\xpg@save@Roman\@Roman
-
-\def\marathi@numbers{%
- \let\@alph\devanagari@akshar
- \let\@Alph\devanagari@letter
- \let\@roman\devanagari@alph
- \let\@Roman\devanagari@letter
-}
-
-\def\nomarathi@numbers{%
- \let\@alph\latin@alph%
- \let\@Alph\latin@Alph%
- \let\@roman\xpg@save@roman
- \let\@Roman\xpg@save@Roman
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-marathi.ldf>
-%<*gloss-mk.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-mk.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-mk.ldf}[polyglossia: module for mk (Macedonian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{macedonian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-mk.ldf>
-%<*gloss-ml.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ml.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ml.ldf}[polyglossia: module for ml (Malayalam)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{malayalam}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ml.ldf>
-%<*gloss-mn.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-mn.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-mn.ldf}[polyglossia: module for mn (Mongolian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{mongolian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-mn.ldf>
-%<*gloss-mongolian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-mongolian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-mongolian.ldf}[polyglossia: module for Mongolian]
-
-\RequirePackage{xpg-cyrillicnumbers}
-
-\PolyglossiaSetup{mongolian}{
- bcp47=mn,
- bcp47-language=mn,
- bcp47-script=Cyrl,
- script=Cyrillic,
- scripttag=cyrl,
- langtag=MNG,
- hyphennames={mongolian},
- hyphenmins={2,2},
- frenchspacing=true,
- fontsetup,
- localnumeral=mongoliannumerals,
- Localnumeral=Mongoliannumerals
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{mongolian}{mn}
-
-% This file is derived from mongolian-babel. which
-% provides support for Mongolian (Khalkha variety)
-% with Cyrillic script
-% TODO: Implement script=mongolian and maybe other
-% variants of Mongolian
-
-\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]{}
-
-% Register default options
-\xpg@initialize@gloss@options{mongolian}{babelshorthands=false,numerals=arabic}
-
-\ifsystem@babelshorthands
- \setkeys{mongolian}{babelshorthands=true}
-\else
- \setkeys{mongolian}{babelshorthands=false}
-\fi
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
-
-\def\mongolian@shorthands{%
- \xpg@activate@shorthands%
- \def\language@group{mongolian}%
- \declare@shorthand{mongolian}{"`}{„}%
- \declare@shorthand{mongolian}{"'}{“}%
- \declare@shorthand{mongolian}{"<}{«}%
- \declare@shorthand{mongolian}{">}{»}%
- \declare@shorthand{mongolian}{""}{\hskip\z@skip}%
- \declare@shorthand{mongolian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
- \declare@shorthand{mongolian}{"=}{\nobreak-\hskip\z@skip}%
- \declare@shorthand{mongolian}{"|}{\textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}%
- \declare@shorthand{mongolian}{"-}{%
- \def\mongolian@sh@tmp{%
- \if\mongolian@sh@next-\expandafter\mongolian@sh@emdash%
- \else\expandafter\mongolian@sh@hyphen\fi%
- }%
- \futurelet\mongolian@sh@next\mongolian@sh@tmp%
- }%
- \def\mongolian@sh@hyphen{%
- \nobreak\-\bbl@allowhyphens}%
- \def\mongolian@sh@emdash##1##2{\cdash-##1##2}%
- \def\cdash##1##2##3{\def\tempx@{##3}%
- \def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
- \ifx\tempx@\tempa@\@Acdash\else
- \ifx\tempx@\tempb@\@Bcdash\else
- \ifx\tempx@\tempc@\@Ccdash\else
- \errmessage{Wrong usage of cdash}\fi\fi\fi}%
- \def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
- \cyrdash\hskip.2em\ignorespaces}%
- \def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
- \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%
- \def\@Ccdash{\leavevmode
- \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
- \ifx\cyrdash\undefined
- \def\cyrdash{\hbox to.8em{\textendash\hss\textendash}}%
- \fi
- \declare@shorthand{mongolian}{",}{\nobreak\hskip.2em\ignorespaces}%
-}
-
-\def\nomongolian@shorthands{%
- \xpg@deactivate@shorthands%
-}
-
-% Taken from babel-mongolian
-\def\captionsmongolian{%
- \def\prefacename{Өмнөх үг}%
- \def\refname{Ашигласан ном}%
- \def\abstractname{Удиртгал}%
- \def\bibname{Номзүй}%
- \def\chaptername{Бүлэг}%
- \def\appendixname{Хавсралт}%
- \ifcsundef{thechapter}%
- {\def\contentsname{Агуулга}}%
- {\def\contentsname{Гарчиг}}%
- \def\listfigurename{Зургийн жагсаалт}%
- \def\listtablename{Хүснэгтийн жагсаалт}%
- \def\indexname{Товъёг}%
- \def\authorname{Нэрийн хэлхээ}%
- \def\figurename{Зураг}%
- \def\tablename{Хүснэгт}%
- \def\partname{Хэсэг}%
- \def\enclname{Ишлэл}%
- \def\ccname{э.с.}%
- \def\headtoname{}%
- \def\pagename{тал}%
- \def\seename{талд үз}%
- \def\alsoname{мөн талд үз}%
- \def\proofname{Баталгаа}%
-}
-
-\def\datemongolian{%
- \def\today{\number\year~оны \ifcase\month\or
- 1-р\or 2-р\or 3-р\or 4-р\or 5-р\or 6-р\or
- 7-р\or 8-р\or 9-р\or 10-р\or 11-р\or 12-р\fi
- ~сарын \number\day}}
-
-\newcommand{\mongoliannumerals}[2]{\mongoliannumber{#2}}
-\newcommand{\Mongoliannumerals}[2]{\Mongoliannumber{#2}}
-
-\def\mongoliannumber#1{%
- \ifcyrillic@numerals
- \ifcyrillic@asbuk@numerals
- \mongolian@asbuk@alph{#1}%
- \else
- \cyr@alph{#1}%
- \fi
- \else
- \number#1%
- \fi%
-}
-
-\def\Mongoliannumber#1{%
- \ifcyrillic@numerals
- \ifcyrillic@asbuk@numerals
- \mongolian@asbuk@Alph{#1}%
- \else
- \cyr@Alph{#1}%
- \fi
- \else
- \number#1%
- \fi%
-}
-
-\let\mongoliannumeral=\mongoliannumber
-\let\Mongoliannumeral=\Mongoliannumber
-
-\def\Asbuk#1{\expandafter\mongolian@asbuk@Alph\csname c@#1\endcsname}
-\def\asbuk#1{\expandafter\mongolian@asbuk@alph\csname c@#1\endcsname}
-
-\def\AsbukTrad#1{\expandafter\cyr@Alph\csname c@#1\endcsname}
-\def\asbukTrad#1{\expandafter\cyr@alph\csname c@#1\endcsname}
-
-% This is a poor man's cyrillic alphanumeric. It just uses the alphabet and
-% thus ends at 30.
-\def\mongolian@asbuk@Alph#1{\ifcase#1\or
- А\or Б\or В\or Г\or Д\or Е\or Ж\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}{mongolian@asbuk@Alph}\fi%
-}
-
-\def\mongolian@asbuk@alph#1{\ifcase#1\or
- а\or б\or в\or г\or д\or е\or ж\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}{mongolian@asbuk@alph}\fi%
-}
-
-\def\mongolian@numbers{%
- \let\latin@alph\@alph
- \let\latin@Alph\@Alph
- \ifcyrillic@numerals%
- \def\mongolian@alph##1{\expandafter\mongoliannumeral\expandafter{\the##1}}%
- \def\mongolian@Alph##1{\expandafter\Mongoliannumeral\expandafter{\the##1}}%
- \let\@alph\mongolian@alph%
- \let\@Alph\mongolian@Alph%
- \fi
-}
-
-\def\nomongolian@numbers{%
- \let\@alph\latin@alph%
- \let\@Alph\latin@Alph%
-}
-
-\def\noextras@mongolian{%
- \ifcyrillic@numerals\nomongolian@numbers\fi%
- \ifmongolian@babelshorthands\nomongolian@shorthands\fi%
-}
-
-\def\blockextras@mongolian{%
- \ifcyrillic@numerals\mongolian@numbers\else\nomongolian@numbers\fi%
- \ifmongolian@babelshorthands\mongolian@shorthands\else\nomongolian@shorthands\fi%
-}
-
-\def\inlineextras@mongolian{%
- \ifmongolian@babelshorthands\mongolian@shorthands\else\nomongolian@shorthands\fi%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-mongolian.ldf>
-%<*gloss-mr.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-mr.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-mr.ldf}[polyglossia: module for mr (Marathi)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{marathi}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-mr.ldf>
-%<*gloss-naustrian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-naustrian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-naustrian.ldf}[polyglossia: module for Austrian German (current spelling)]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{german}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-naustrian.ldf>
-%<*gloss-nb.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-nb.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-nb.ldf}[polyglossia: module for nb (Norwegian)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{norwegian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-nb.ldf>
-%<*gloss-newzealand.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-newzealand.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-newzealand.ldf}[polyglossia: module for Newzealand English]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{english}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-newzealand.ldf>
-%<*gloss-ngerman.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ngerman.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ngerman.ldf}[polyglossia: module for German (current spelling)]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{german}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ngerman.ldf>
-%<*gloss-nko.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-nko.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-nko.ldf}[Polyglossia: module for N’Ko]
-\PolyglossiaSetup{nko}{%
- bcp47=nko,
- bcp47-language=nko,
- bcp47-script=Nkoo,
- script=N'ko,
- scripttag=nko~,
- langtag=NKO,
- fontsetup=true,
- hyphennames={nohyphenation},
- direction=RL,
- localnumeral=nkonumerals
-}
-
-\RequirePackage{nkonumbers}%
-
-\newcommand{\nkonumerals}[2]{\nkonumber{#2}}
-
-\def\captionsnko{%
- \def\prefacename{ߢߍߛߓߍ}%
- \def\refname{ߞߐߡߊߛߙߋ}%
- \def\abstractname{ߓߊߕߐߡߐ߲}%
- \def\bibname{ߟߍߙߊߥߙߍߟߐ߲߲}%
- \def\chaptername{ߛߌ߰ߘߊ}%
- \def\appendixname{ߘߋ߬ߙߋ}%
- \def\contentsname{ߞߣߐߘߐ}%
- \def\listfigurename{ߢߊ ߟߎ߬ ߛߙߍߘߍ}%
- \def\listtablename{ߦߌ߬ߘߊ߬ߥߟߊ ߟߎ߬ ߛߙߍߘߍ}%
- \def\indexname{ߛߙߍߘߍ}%
- \def\figurename{ߢߊ}%
- \def\tablename{ߦߌ߬ߘߊ߬ߥߟߊ}%
- \def\partname{ߛߌ߰ߘߊ߬ߙߋ߲}%
- \def\enclname{ߝߍ߬ߕߊ}%
- \def\ccname{ߓߊ ߘߏ߫ ߘߌ߫}%
- \def\headtoname{ߞߊߕߙߍ߬}%
- \def\pagename{ߞߐߜߍ}%
- \def\seename{ߡߊߝߟߍ߫}%
- \def\alsoname{ߝߟߍߡߊߛߊ߬ߦߌ߬}%
- \def\proofname{ߦߌ߬ߘߊ߬ߞߏ}%
- \def\glossaryname{ߞߘߐߝߐߟߊ߲}%
-}%
-
-% In n'ko, this is an example of date :
-% ߂߀߁߃ ߞߏ߲ߞߏߜߍ ߕߟߋ߬ ߁߈ (RTL)
-% ( 18 February 2013 )
-% The word "ߕߟߋ߬" is mandatory between month name and day number.
-% Replace "ߕߟߋ߬" by "ߕߋ߬ߟߋ߫" if and only if day = 2 or day = 3 or day = 9
-% or (day >= 20 and day <= 29).
-
-\newcommand*\nkodayprefix[1]{%
- \ifnum\numexpr#1=2 ߕߋ߬ߟߋ߫\else%
- \ifnum\numexpr#1=3 ߕߋ߬ߟߋ߫\else%
- \ifnum\numexpr#1=9 ߕߋ߬ߟߋ߫\else%
- \ifnum\numexpr#1>19\ifnum\numexpr#1<30 ߕߋ߬ߟߋ߫\else ߕߟߋ߬\fi\else ߕߟߋ߬\fi%
- \fi%
- \fi%
- \fi%
-}
-
-\newcommand*\nkoday[1]{%
- % If day = 1, put above "߁", NKO_COMBINING_SHORT_RISING_TONE
- \ifnum\numexpr#1=1 ߁߭\else%
- \nkonumber{#1}
- \fi
-}
-
-\def\datenko{%
- \def\today{%
- \nkonumber{\year}\space
- \ifcase\month
- \or ߓߌ߲ߠߊߥߎߟߋ߲%
- \or ߞߏ߲ߞߏߜߍ%
- \or ߕߙߊߓߊ%
- \or ߞߏ߲ߞߏߘߌ߬ߓߌ%
- \or ߘߓߊ߬ߕߊ%
- \or ߥߊ߬ߛߌߥߊ߬ߙߊ%
- \or ߞߊ߬ߙߌߝߐ߭%
- \or ߘߓߊ߬ߓߌߟߊ%
- \or ߕߎߟߊߝߌ߲%
- \or ߞߏ߲ߓߌߕߌ߮%
- \or ߣߍߣߍߓߊ%
- \or ߞߏ߬ߟߌ߲߬ߞߏߟߌ߲\fi
- \space\nkodayprefix{\number\day}
- \space\nkoday{\day}
- }%
-}%
-
-% \end{macrocode}
-% \iffalse
-%</gloss-nko.ldf>
-%<*gloss-norsk.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-norsk.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-norsk.ldf>
-%<*gloss-norwegian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-norwegian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-norwegian.ldf}[polyglossia: module for Norwegian]
-\PolyglossiaSetup{norwegian}{
- bcp47=nn,
- bcp47-language=nn,
- bcp47-script=Latn,
- hyphennames={nynorsk},
- langtag=NYN,
- hyphenmins={2,2},
- frenchspacing=true,
- fontsetup=false,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*[variant=bokmal]{norwegian}{nb}
-\setlanguagealias*[variant=nynorsk]{norwegian}{nn}
-% Babel and backwards compat. aliases
-\setlanguagealias[variant=bokmal]{norwegian}{norsk}
-\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'}}
-
-
-% Register default options
-\xpg@initialize@gloss@options{norwegian}{variant=nynorsk}
-
-
-\def\norwegian@language{%
- \polyglossia@setup@language@patterns{\norwegian@variant}%
-}%
-
-\def\captionsnorwegian@nynorsk{%
- \def\refname{Referansar}%
- \def\abstractname{Sammendrag}%
- \def\bibname{Litteratur}%
- \def\prefacename{Forord}%
- \def\chaptername{Kapittel}%
- \def\appendixname{Tillegg}%
- \def\contentsname{Innhald}%
- \def\listfigurename{Figurar}%
- \def\listtablename{Tabellar}%
- \def\indexname{Register}%
- \def\figurename{Figur}%
- \def\tablename{Tabell}%
- %\def\thepart{}% <<<
- \def\partname{Del}%
- \def\pagename{Side}%
- \def\seename{Sjå}%
- \def\alsoname{Sjå òg}%
- \def\enclname{Vedlegg}%
- \def\ccname{Kopi til}%
- \def\headtoname{Til}%
- \def\proofname{Bevis}%
- \def\glossaryname{Ordliste}%
-}
-
-\def\captionsnorwegian@norsk{%
- \def\refname{Referanser}%
- \def\abstractname{Sammendrag}%
- \def\bibname{Bibliografi}%
- \def\prefacename{Forord}%
- \def\chaptername{Kapittel}%
- \def\appendixname{Tillegg}%
- \def\contentsname{Innhold}%
- \def\listfigurename{Figurer}%
- \def\listtablename{Tabeller}%
- \def\indexname{Register}%
- \def\figurename{Figur}%
- \def\tablename{Tabell}%
- %\def\thepart{}% <<<
- \def\partname{Del}%
- \def\pagename{Side}%
- \def\seename{Se}%
- \def\alsoname{Se også}%
- \def\enclname{Vedlegg}%
- \def\ccname{Kopi sendt}%
- \def\headtoname{Til}%
- \def\proofname{Bevis}%
- \def\glossaryname{Ordliste}%
-}
-
-\def\captionsnorwegian{%
- \csname captionsnorwegian@\norwegian@variant\endcsname%
-}
-
-\def\datenorwegian@nynorsk{%
- \def\today{\number\day.~\ifcase\month\or
- januar\or februar\or mars\or april\or mai\or juni\or
- juli\or august\or september\or oktober\or november\or desember
- \fi\space\number\year}%
-}
-
-\def\datenorwegian@norsk{%
- \def\today{\number\day.~\ifcase\month\or
- januar\or februar\or mars\or april\or mai\or juni\or
- juli\or august\or september\or oktober\or november\or
- desember\fi\space\number\year}%
-}
-
-\def\datenorwegian{%
- \csname datenorwegian@\norwegian@variant\endcsname%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-norwegian.ldf>
-%<*gloss-nswissgerman.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-nswissgerman.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-nswissgerman.ldf}[polyglossia: module for Swiss German (current spelling)]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{german}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-nswissgerman.ldf>
-%<*gloss-nynorsk.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-nynorsk.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-nynorsk.ldf>
-%<*gloss-occitan.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-occitan.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-%%
-%% This is file `gloss-occitan.ldf',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% gloss-occitan.dtx (with options: `ldf')
-%% ------------------------------------------------------------------
-%% The gloss-occitan module for polyglossia
-%% Copyright (C) 2016 Cédric Valmary
-%% All rights reserved
-%%
-%% Licence information appended
-%%
-%% Created by Cédric Valmary: cvalmary at yahoo dot fr
-%% of Tot en òc <http://www.totenoc.eu/>
-%%
-\ProvidesFile{gloss-occitan.ldf}[polyglossia: module for Occitan]
-
-\PolyglossiaSetup{occitan}{
- bcp47=oc,
- bcp47-language=oc,
- bcp47-script=Latn,
- hyphennames={occitan},
- langtag=OCI,
- hyphenmins={2,2},
- frenchspacing=true,
- indentfirst=true,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{occitan}{oc}
-
-\define@boolkey{occitan}[occitan@]{babelshorthands}[true]{}
-
-\ifsystem@babelshorthands
- \setkeys{occitan}{babelshorthands=true}
-\else
- \setkeys{occitan}{babelshorthands=false}
-\fi
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
-
-\def\occitan@shorthands{%
- \xpg@activate@shorthands%
- \def\language@group{occitan}%
- \declare@shorthand{occitan}{"}{%
- \relax\ifmmode
- \def\xpgoc@next{''}%
- \else
- \def\xpgoc@next{\futurelet\xpgoc@temp\xpgoc@cwm}%
- \fi
- \xpgoc@next}%
-}
-\def\xpgoc@@cwm{\nobreak\discretionary{-}{}{}\nobreak\hskip\z@skip}
-\def\xpgoc@ponchinterior{%
- \nobreak\discretionary{-}{}{\mbox{$\cdot$}}\nobreak\hskip\z@skip}
-\def\xpgoc@cwm{\let\xpgoc@@next\relax
- \ifcat\noexpand\xpgoc@temp a%
- \def\xpgoc@@next{\xpgoc@@cwm}%
- \else
- \if\noexpand\xpgoc@temp \string|%
- \def\xpgoc@@next##1{\xpgoc@@cwm}%
- \else
- \if\noexpand\xpgoc@temp \string<%
- \def\xpgoc@@next##1{«\ignorespaces}%
- \else
- \if\noexpand\xpgoc@temp \string>%
- \def\xpgoc@@next##1{\unskip»}%
- \else
- \if\noexpand\xpgoc@temp\string/%
- \def\xpgoc@@next##1{\slash}%
- \else
- \if\noexpand\xpgoc@temp\string.%
- \def\xpgoc@@next##1{\xpgoc@ponchinterior}%
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \xpgoc@@next%
-}
-
-\def\nooccitan@shorthands{%
- \xpg@deactivate@shorthands%
-}
-\def\captionsoccitan{%
- \def\refname{Referéncias}%
- \def\abstractname{Resumit}%
- \def\bibname{Bibliografia}%
- \def\prefacename{Prefaci}%
- \def\chaptername{Capítol}%
- \def\appendixname{Annèx}%
- \def\contentsname{Ensenhador}%
- \def\listfigurename{Taula de las figuras}%
- \def\listtablename{Taula dels tablèus}%
- \def\indexname{Indèx}%
- \def\figurename{Figura}%
- \def\tablename{Tablèu}%
- %\def\thepart{}%
- \def\partname{Partida}%
- \def\pagename{Pagina}%
- \def\seename{vejatz}%
- \def\alsoname{vejatz tanben}%
- \def\enclname{Pèça junta}%
- \def\ccname{còpia a}%
- \def\headtoname{A}%
- \def\proofname{Demostracion}%
- \def\glossaryname{Glossari}%
-}
-\def\dateoccitan{%
- \def\occitanmonth{\ifcase\month\or
- de~genièr\or
- de~febrièr\or
- de~març\or
- d'abril\or
- de~mai\or
- de~junh\or
- de~julhet\or
- d'agost\or
- de~setembre\or
- d'octobre\or
- de~novembre\or
- de~decembre\fi
- }%
- \def\occitanday{\ifcase\day\or
- 1èr\else% primièr
- \number\day\fi% all other numbers
- }%
- \def\today{\occitanday\space \occitanmonth\space de~\number\year}%
-}
-\let\xpgoc@savedvalues\empty
-\AtEndPreamble{% the user or the class might define different values
- \edef\xpgoc@savedvalues{%
- \clubpenalty=\the\clubpenalty\space
- \@clubpenalty=\the\@clubpenalty\space
- \widowpenalty=\the\widowpenalty\space
- \finalhyphendemerits=\the\finalhyphendemerits}
-}
-\def\noextras@occitan{%
- \lccode\string"2019=\z@%
- \ifoccitan@babelshorthands\nooccitan@shorthands\fi%
- \xpgoc@savedvalues%
-}
-\def\blockextras@occitan{%
- \lccode\string"2019=\string"2019%
- \clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000%
- \finalhyphendemerits=50000000%
- \ifoccitan@babelshorthands\occitan@shorthands\else\nooccitan@shorthands\fi%
-}
-
-\def\inlineextras@occitan{%
- \lccode\string"2019=\string"2019%
- \ifoccitan@babelshorthands\occitan@shorthands\else\nooccitan@shorthands\fi%
-}
-%% Distributable under the LaTeX Project Public License,
-%% version 1.3c or higher (your choice). The latest version of
-%% this license is at: http://www.latex-project.org/lppl.txt
-%%
-%% This work is "author-maintained"
-%% The maintainer is Cédric Valmary
-%%
-%%
-%% End of file `gloss-occitan.ldf'.
-% \end{macrocode}
-% \iffalse
-%</gloss-occitan.ldf>
-%<*gloss-odia.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-odia.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-% Translations provided by ଅଶୋକ ଦାସ୍ <das@pas.rochester.edu> and ଅଭିଷେକ ଜେନା <avisekjena@gmail.com>
-% TODO implement Odia calendar
-
-\ProvidesFile{gloss-odia.ldf}[polyglossia: module for Odia]
-
-\RequirePackage{devanagaridigits}
-\RequirePackage{odiadigits}
-
-\PolyglossiaSetup{odia}{
- bcp47=or,
- bcp47-language=or,
- bcp47-script=Orya,
- script=Odia,
- scripttag=odia,
- langtag=ODI,
- hyphennames={odia},
- hyphenmins={2,2},%CHECK
- fontsetup=true,
- localnumeral=odianumerals
- %TODO nouppercase=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{odia}{or}
-
-
-%Adapted from gloss-bengali.ldf
-
-\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]{}
-
-% Register default options
-\xpg@initialize@gloss@options{odia}{changecounternumbering=false,numerals=Devanagari}
-
-\def\captionsodia{%
- \def\refname{ସନ୍ଦର୍ଭ}%
- \def\abstractname{ସାରାଂଶ}%
- \def\bibname{ସୂଚନା}%
- \def\prefacename{ପ୍ରାରମ୍ଭ}%
- \def\chaptername{ଅଧ୍ୟାୟ}%
- \def\appendixname{ପରିଶିଷ୍ଟ}%
- \def\contentsname{ସୁଚୀ ପତ୍ର}%
- \def\listfigurename{ପ୍ରତିଛବି ତାଲିକା}%
- \def\listtablename{ଟେବୁଲ ତାଲିକା}%
- \def\indexname{ସୂଚକାଙ୍କ}%
- \def\figurename{ପ୍ରତିଛବି}%
- \def\tablename{ଟେବୁଲ୍}%
- \def\partname{ବିଭାଗ}%
- \def\pagename{ପୃଷ୍ଠା}%
- \def\seename{ଦେଖନ୍ତୁ}%
- \def\alsoname{ଅଧିକ ଦେଖନ୍ତୁ}%
- \def\enclname{ସଂଲଗ୍ନ}%
- \def\ccname{କପି କରନ୍ତୁ}%
- \def\headtoname{ପ୍ରତି}%
- \def\proofname{ପ୍ରମାଣ}%
- \def\glossaryname{ଶବ୍ଦର ଶବ୍ଦକୋଷ}%
-}
-\def\dateodia{%
- \def\odiamonth{%
- \ifcase\month\or
- ଜାନୁଆରୀ\or
- ଫେବୃଆରୀ\or
- ମାର୍ଚ୍ଚ\or
- ଏପ୍ରିଲ୍\or
- ମେ\or
- ଜୁନ୍\or
- ଜୁଲାଇ\or
- ଅଗଷ୍ଟ\or
- ସେପ୍ଟେମ୍ବର\or
- ଅକ୍ଟୋବର\or
- ନଭେମ୍ବର\or
- ଡିସେମ୍ବର\fi}%
- \def\today{\odianumber\day\space\odiamonth\space\odianumber\year}%
-}
-
-\newcommand{\odianumerals}[2]{\odianumber{#2}}
-
-\def\odianumber#1{%
- \ifodia@devanagari@numerals
- \devanagaridigits{\number#1}%
- \else
- \ifodia@odia@numerals
- \odiadigits{\number#1}%
- \else % Assumed Western
- \number#1%
- \fi
- \fi%
-}
-
-\def\odia@globalnumbers{%
- \ifodia@changecounternumbering
- \let\@arabic\odianumber%
- \renewcommand\thefootnote{\localnumeral*{footnote}}%
- \fi
-}
-
-%Adapted from gloss-marathi.ldf
-
-\def\odia@akshar#1{\ifcase#1\or ଅ\or ଆ\or ଇ\or ଈ\or ଉ\or ଊ\or ଋ\or ଏ\or ଐ\or ଓ\or ଔ\else\@ctrerr\fi}
-
-\def\odia@alph#1{%
- \ifcase#1\or କ\or ଖ\or ଗ\or ଘ\or ଙ\or ଚ\or ଛ\or ଜ\or ଝ\or ଞ\or ଟ\or ଠ\or ଡ\or ଢ\or ଣ\or ତ\or ଥ\or ଦ%
- \or ଧ\or ନ\or ପ\or ଫ\or ବ\or ଭ\or ମ\or ଯ\or ର\or ଲ\or ଳ\or ଶ\or ସ\or ଷ\or ହ\or କ୍ଷ \else\@ctrerr%
- \fi%
-}
-
-\def\odia@numbers{%
- \let\@alph\odia@alph
- \let\@Alph\devanagari@letter
- \let\@roman\odia@akshar
- \let\@Roman\devanagari@letter
-}
-
-
-% Store original definition
-\let\xpg@save@arabic\@arabic
-
-\def\noodia@globalnumbers{%
- \let\@arabic\xpg@save@arabic%
-}
-
-
-
-\def\blockextras@odia{\extras@odia}
-\def\inlineextras@odia{\extras@odia}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-odia.ldf>
-%<*gloss-or.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-or.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-odia.ldf}[polyglossia: module for or (Odia)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{odia}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-or.ldf>
-%<*gloss-pa.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-pa.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-pa.ldf}[polyglossia: module for pa (Punjabi)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{punjabi}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-pa.ldf>
-%<*gloss-persian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-persian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-persian.ldf}[polyglossia: module for Persian]
-
-\RequireBidi
-\RequirePackage{arabicnumbers}
-\RequirePackage{farsical}
-\RequirePackage{hijrical}
-\PolyglossiaSetup{persian}{
- bcp47=fa,
- bcp47-language=fa,
- bcp47-script=Arab,
- babelname=farsi,
- script=Arabic,
- direction=RL,
- scripttag=arab,
- langtag=FAR,
- hyphennames={nohyphenation},
- fontsetup=true,
- localnumeral=farsinumerals
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{persian}{fa}
-
-% Babel and backwards compat. alias
-\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
-
-% Register default options
-\xpg@initialize@gloss@options{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}
-\def\farsimonth#1{\ifcase#1%
- \or کانون ثانی\or شباط\or اذار%%or ادار
- \or نیسان\or ایار\or حزیران\or تموز\or آب\or ایلول\or تشرین اول\or تشرین ثانی\or کانون اول\fi}
-
-%\Hijritoday is now locale-aware and will format the date with this macro:
-\DefineFormatHijriDate{persian}{\@ensure@RTL{%
-\farsinumber{\value{Hijriday}}\space\HijriMonthArabic{\value{Hijrimonth}}\space\farsinumber{\value{Hijriyear}}}}
-
-\def\captionspersian{%
-\def\prefacename{\@ensure@RTL{پیشگفتار}}%
-\def\refname{\@ensure@RTL{مراجع}}%
-\def\abstractname{\@ensure@RTL{چکیده}}%
-\def\bibname{\@ensure@RTL{کتاب‌نامه}}%
-\def\chaptername{\@ensure@RTL{فصل}}%
-\def\appendixname{\@ensure@RTL{پیوست}}%
-\def\contentsname{\@ensure@RTL{فهرست مطالب}}%
-\def\listfigurename{\@ensure@RTL{لیست تصاویر}}%
-\def\listtablename{\@ensure@RTL{لیست جداول}}%
-\def\indexname{\@ensure@RTL{نمایه}}%
-\def\figurename{\@ensure@RTL{شكل}}%
-\def\tablename{\@ensure@RTL{جدول}}%
-\def\partname{\@ensure@RTL{بخش}}%
-\def\enclname{\@ensure@RTL{پیوست}}%
-\def\ccname{\@ensure@RTL{رونوشت}}%
-\def\headtoname{\@ensure@RTL{به}}%
-\def\pagename{\@ensure@RTL{صفحة}}%
-\def\seename{\@ensure@RTL{ببینید}}%
-\def\alsoname{\@ensure@RTL{نیز ببینید}}%
-\def\proofname{\@ensure@RTL{برهان}}%
-\def\glossaryname{\@ensure@RTL{دانش‌نامه}}%
-}
-\def\datepersian{%
- \def\today{\@ensure@RTL{\farsinumber\day\space\farsigregmonth{\month}\space\farsinumber\year}}%
-}
-
-\newcommand{\farsinumerals}[2]{\farsinumber{#2}}
-
-\def\farsinumber#1{%
- \if@western@numerals
- \number#1%
- \else
- \IfCharIsAvailableTF{06F0}%
- {\@ensure@LTR{\farsidigits{\number#1}}}%
- {\@ensure@LTR{\arabicdigits{\number#1}}}%
- \fi
-}
-
-%\def\farsinum#1{\expandafter\farsinumber\csname c@#1\endcsname}
-%\def\farsibracenum#1{(\expandafter\farsinumber\csname c@#1\endcsname)}
-%\def\farsiornatebracenum#1{\char"FD3E\expandafter\farsinumber\csname c@#1\endcsname\char"FD3F}
-%\def\farsialph#1{\expandafter\@farsialph\csname c@#1\endcsname}
-
-\def\persian@numbers{%
- \let\@alph\abjad%
- \let\@Alph\abjad%
-}
-
-\def\nopersian@numbers{%
- \let\@alph\@latinalph%
- \let\@Alph\@latinAlph%
-}
-
-\def\persian@globalnumbers{%
- \let\@arabic\farsinumber%
- \renewcommand\thefootnote{\localnumeral*{footnote}}%
- \renewcommand\theequation{\localnumeral*{equation}}%
-}
-
-% Store original definition
-\let\xpg@save@arabic\@arabic
-
-\def\nopersian@globalnumbers{
- \let\@arabic\xpg@save@arabic%
-}
-
-\def\persian@xetex@capsformat{%
- \let\xpg@save@sepmark\@SepMark%
- \SepMark{\xpg@sepmark}
-}
-
-\def\nopersian@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
- \SepMark{\xpg@save@sepmark}
- }{}%
-}
-
-\def\persian@luatex@capsformat{%
- %
- % change chapter and part headings
- \ifpersian@customsep
- \ifcsdef{chapter}{%
- \let\xpg@save@thesection\thesection%
- \renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
- \let\xpg@save@theequation\theequation%
- \renewcommand*\theequation{%
- \ifnum \c@chapter>\z@ \thechapter\xpg@sepmark\fi\@arabic\c@equation}
- \let\xpg@save@thefigure\thefigure%
- \renewcommand*\thefigure{%
- \ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@figure}
- \let\xpg@save@thetable\thetable%
- \renewcommand*\thetable{%
- \ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
- \let\xpg@save@thesubsection\thesubsection%
- \renewcommand\thesubsection
- {\thesection\xpg@sepmark\@arabic\c@subsection}
- \let\xpg@save@thesubsubsection\thesubsubsection%
- \renewcommand\thesubsubsection{\thesubsection\xpg@sepmark\@arabic\c@subsubsection}
- \let\xpg@save@theparagraph\theparagraph%
- \renewcommand\theparagraph
- {\thesubsubsection\xpg@sepmark\@arabic\c@paragraph}
- \let\xpg@save@thesubparagraph\thesubparagraph%
- \renewcommand\thesubparagraph{\theparagraph\xpg@sepmark\@arabic\c@subparagraph}
- \fi% (end \ifpersiancustomsep)
-}
-
-\def\nopersian@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%
- }{}%
-}
-
-\def\blockextras@persian{%
- \ifpersian@customsep
- \ifxetex
- \persian@xetex@capsformat
- \else
- \persian@luatex@capsformat
- \fi
- \fi
-}
-%
-\def\noextras@persian{%
- \ifpersian@customsep
- \ifxetex
- \nopersian@xetex@capsformat
- \else
- \nopersian@luatex@capsformat
- \fi
- \fi
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-persian.ldf>
-%<*gloss-piedmontese.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-piedmontese.ldf}
-% \begin{macrocode}
-% !TEX encoding = UTF-8 Unicode
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-piedmontese.ldf}[2013/02/12 v1.0 polyglossia: module for Piedmontese]
-\makeatletter
-\PolyglossiaSetup{piedmontese}{
- bcp47=pms,
- bcp47-language=pms,
- bcp47-script=Latn,
- hyphennames={piedmontese},
- hyphenmins={2,2},
- langtag=PMS,
- frenchspacing=true,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{piedmontese}{pms}
-
-\define@boolkey{piedmontese}[piedmontese@]{babelshorthands}[true]{}
-
-\ifsystem@babelshorthands
- \setkeys{piedmontese}{babelshorthands=true}
-\else
- \setkeys{piedmontese}{babelshorthands=false}
-\fi
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
-
-\def\piedmontese@shorthands{%
- \xpg@activate@shorthands%
- \def\language@group{piedmontese}%
- \declare@shorthand{piedmontese}{"}{%
- \relax\ifmmode
- \def\xpgpms@next{''}%
- \else
- \def\xpgpms@next{\futurelet\xpgpms@temp\xpgpms@cwm}%
- \fi
- \xpgpms@next}%
-}
-
-\def\xpgpms@@cwm{\nobreak\discretionary{-}{}{}\nobreak\hskip\z@skip}
-\def\xpgpms@cwm{\let\xpgpms@@next\relax
-\ifcat\noexpand\xpgpms@temp a%
- \def\xpgpms@@next{\pms@@cwm}%
-\else
- \ifx\xpgpms@temp/%
- \def\xpgpms@@next{\bbl@allowhyphens/\bbl@allowhyphens\@gobble}%
- \else
- \ifx\xpgpms@temp-%
- \def\xpgpms@@next{\bbl@allowhyphens-\bbl@allowhyphens\@gobble}%
- \else
- \ifx\xpgpms@temp"%
- \def\xpgpms@@next{``\expandafter\@gobble\string}%
- \fi
- \fi
- \fi
-\xpgpms@@next}
-
-\def\nopiedmontese@shorthands{%
- \xpg@deactivate@shorthands%
-}
-\@namedef{captions\CurrentOption}{%
- \def\prefacename{Prefassion}%
- \def\refname{Riferiment}%
- \def\abstractname{Somari}%
- \def\bibname{Bibliografìa}%
- \def\chaptername{Capìtol}%
- \def\appendixname{Gionta}%
- \def\contentsname{Tàula}%
- \def\listfigurename{Lista dle figure}%
- \def\listtablename{Lista dle tabele}%
- \def\indexname{Tàula analìtica}%
- \def\figurename{Figura}%
- \def\tablename{Tabela}%
- \def\partname{Part}%
- \def\enclname{Gionta/e}%
- \def\ccname{Con còpia a}%
- \def\headtoname{Për}%
- \def\pagename{Pàgina}%
- \def\seename{vëd}%
- \def\alsoname{vëd anche}%
- \def\proofname{Dimostrassion}%
- \def\glossaryname{Glossari}%
-}
-\@namedef{date\CurrentOption}{%
- \def\today{\number\day\space\ifcase\month\or
- ëd gené\or ëd fevré\or ëd mars\or d'avril\or ëd maj\or ëd giugn\or
- ë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{%
- \edef\xpgpms@savedvalues{%
- \clubpenalty=\the\clubpenalty\space
- \@clubpenalty=\the\@clubpenalty\space
- \widowpenalty=\the\widowpenalty\space
- \finalhyphendemerits=\the\finalhyphendemerits}
-}
-
-
-\def\noextras@piedmontese{%
- \lccode\string"2019=\z@%
- \ifpiedmontese@babelshorthands\nopiedmontese@shorthands\fi%
- \xpgpms@savedvalues%
-}
-
-\def\blockextras@piedmontese{%
- \lccode\string"2019=\string"2019%
- \clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000%
- \finalhyphendemerits=50000000%
- \ifpiedmontese@babelshorthands\piedmontese@shorthands\else\nopiedmontese@shorthands\fi%
-}
-
-\def\inlineextras@piedmontese{%
- \lccode\string"2019=\string"2019%
- \ifpiedmontese@babelshorthands\piedmontese@shorthands\else\nopiedmontese@shorthands\fi%
-}
-%%% CHANGES END %%%
-% \end{macrocode}
-% \iffalse
-%</gloss-piedmontese.ldf>
-%<*gloss-polish.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-polish.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-polish.ldf}[polyglossia: module for Polish]
-
-\PolyglossiaSetup{polish}{
- bcp47=pl,
- bcp47-language=pl,
- bcp47-script=Latn,
- hyphennames={polish},
- hyphenmins={2,2},
- langtag=PLK,
- frenchspacing=true,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{polish}{pl}
-
-\ifluatex
- \RequirePackage{luavlna}
-\fi
-
-\define@boolkey{polish}[polish@]{babelshorthands}[true]{}
-
-\define@boolkey{polish}[polish@]{splithyphens}[true]{}
-
-\define@boolkey{polish}[polish@]{vlna}[true]{}
-
-% Register default options
-\xpg@initialize@gloss@options{polish}{babelshorthands=false,splithyphens=true,vlna=true}
-
-\ifsystem@babelshorthands
- \setkeys{polish}{babelshorthands=true}
-\else
- \setkeys{polish}{babelshorthands=false}
-\fi
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
-
-\let\xpg@hyphen@char-
-\def\polish@@splhyphen#1{%
- \def\polish@sh@tmp{%
- \ifx\polish@sh@next\xpg@hyphen@char#1%
- \else\expandafter\polish@@@splhyphen{#1}\fi%
- }%
- \futurelet\polish@sh@next\polish@sh@tmp%
-}
-
-\def\polish@@@splhyphen#1{%
- \ifnum\hyphenchar \font>0%
- \kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}%
- \nobreak\hskip\z@%
- \else%
- #1%
- \fi%
-}
-
-\def\polish@splhyphen{%
- \polish@@splhyphen{-}%
-}
-
-\def\polish@shorthands{%
- \xpg@activate@shorthands%
- \def\language@group{polish}%
- \declare@shorthand{polish}{"=}{\polish@splhyphen}%
- \declare@shorthand{polish}{""}{\hskip\z@skip}%
- \declare@shorthand{polish}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
- \declare@shorthand{polish}{"-}{\nobreak\-\bbl@allowhyphens}%
- \declare@shorthand{polish}{"|}{%
- \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
- \bbl@allowhyphens}{}%
- }%
- \declare@shorthand{polish}{"/}{\textormath
- {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}%
- \declare@shorthand{polish}{"`}{„}%
- \declare@shorthand{polish}{"'}{”}%
- \declare@shorthand{polish}{"<}{«}%
- \declare@shorthand{polish}{">}{»}%
-}
-
-\def\nopolish@shorthands{%
- \xpg@deactivate@shorthands%
-}
-
-\ifxetex
- % splithyphens
- \newXeTeXintercharclass\polish@hyphen % -
- % vlna
- \newXeTeXintercharclass\polish@openpunctuation
- \newXeTeXintercharclass\polish@nonsyllabicpreposition
- \ifdefined\e@alloc@intercharclass@top
- \chardef\polish@boundary=\e@alloc@intercharclass@top
- \else
- \ifdefined\XeTeXinterwordspaceshaping
- \chardef\polish@boundary=4095 %
- \def\newXeTeXintercharclass{%
- \e@alloc\XeTeXcharclass\chardef
- \xe@alloc@intercharclass\m@ne\@ucharclass@boundary}%
- \else
- \chardef\polish@boundary=255
- \fi
- \fi
-\fi
-
-\def\polish@hyphens{%
- \ifluatex
- \AfterPreamble{\enablesplithyphens{polish}}%
- \else
- \XeTeXinterchartokenstate=1
- \XeTeXcharclass `\- \polish@hyphen
- \XeTeXinterchartoks \z@ \polish@hyphen = {\polish@@splhyphen}% "-" -> "\polish@@splhyphen-"
- % necessary if used together with vlna:
- \XeTeXinterchartoks \polish@nonsyllabicpreposition \polish@hyphen = {\polish@@splhyphen}% "-" -> "\polish@@splhyphen-"
- \fi%
-}
-
-\def\nopolish@hyphens{%
- \ifluatex
- \AfterPreamble{\disablesplithyphens{polish}}%
- \else
- \XeTeXcharclass `\- \z@
- \fi%
-}
-
-% Add nonbreakable space after single-letter word to
-% prevent them to land at the end of a line
-% vlna code taken and adapted from xevlna.sty
-\ifxetex
- \def\polish@nointerchartoks{\let\polish@interchartoks\polish@PreCSpreposition}%
- \def\polish@PreCSpreposition{%
- \def\next{}%
- \ifnum\catcode`\ =10 % nothing will be done in verbatim
- \ifmmode % nothing in math
- \else
- \let\polish@interchartoks\polish@nointerchartoks
- \let\next\polish@ExamineCSpreposition
- \fi\fi
- \next%
- }%
- \def\polish@ExamineCSpreposition #1{#1\futurelet\next\polish@ProcessCSpreposition}%
- \def\polish@ProcessCSpreposition{\ifx\next\polish@XeTeXspace\nobreak\fi}%
- \futurelet\polish@XeTeXspace{ }\polish@nointerchartoks
-\fi
-
-\def\polish@vlna{%
- \ifluatex
- \singlechars{polish}{AaIiOoUuWwZz}%
- \preventsingleon
- \else
- % Code taken and adapted from xevlna.sty
- \XeTeXinterchartokenstate=1
- \XeTeXcharclass `\( \polish@openpunctuation
- \XeTeXcharclass `\[ \polish@openpunctuation
- \XeTeXcharclass `\„ \polish@openpunctuation
- \XeTeXcharclass `\« \polish@openpunctuation
- \XeTeXcharclass `\W \polish@nonsyllabicpreposition
- \XeTeXcharclass `\w \polish@nonsyllabicpreposition
- \XeTeXcharclass `\Z \polish@nonsyllabicpreposition
- \XeTeXcharclass `\z \polish@nonsyllabicpreposition
- \XeTeXcharclass `\O \polish@nonsyllabicpreposition
- \XeTeXcharclass `\o \polish@nonsyllabicpreposition
- \XeTeXcharclass `\U \polish@nonsyllabicpreposition
- \XeTeXcharclass `\u \polish@nonsyllabicpreposition
- \XeTeXcharclass `\A \polish@nonsyllabicpreposition
- \XeTeXcharclass `\a \polish@nonsyllabicpreposition
- \XeTeXcharclass `\I \polish@nonsyllabicpreposition
- \XeTeXcharclass `\i \polish@nonsyllabicpreposition
- \XeTeXinterchartoks \polish@boundary \polish@nonsyllabicpreposition {\polish@interchartoks}%
- \XeTeXinterchartoks \polish@openpunctuation \polish@nonsyllabicpreposition {\polish@interchartoks}%
- \fi
-}
-
-\def\nopolish@vlna{%
- \ifluatex
- \preventsingleoff
- \else
- \XeTeXcharclass`\(\z@
- \XeTeXcharclass`\[\z@
- \XeTeXcharclass`\„\z@
- \XeTeXcharclass`\«\z@
- \XeTeXcharclass`\W\z@
- \XeTeXcharclass`\w\z@
- \XeTeXcharclass`\Z\z@
- \XeTeXcharclass`\z\z@
- \XeTeXcharclass`\O\z@
- \XeTeXcharclass`\o\z@
- \XeTeXcharclass`\U\z@
- \XeTeXcharclass`\u\z@
- \XeTeXcharclass`\A\z@
- \XeTeXcharclass`\a\z@
- \XeTeXcharclass`\I\z@
- \XeTeXcharclass`\i\z@
- \fi
-}
-
-\def\captionspolish{%
- \def\prefacename{Przedmowa}%
- \def\refname{Literatura}%
- \def\abstractname{Streszczenie}%
- \def\bibname{Bibliografia}%
- \def\chaptername{Rozdział}%
- \def\appendixname{Dodatek}%
- \def\contentsname{Spis treści}%
- \def\listfigurename{Spis rysunków}%
- \def\listtablename{Spis tabel}%
- \def\indexname{Indeks}%
- \def\figurename{Rysunek}%
- \def\tablename{Tabela}%
- \def\partname{Część}%
- \def\enclname{Załącznik}%
- \def\ccname{Kopie:}%
- \def\headtoname{Do}%
- \def\pagename{Strona}%
- \def\seename{Zobacz}%
- \def\alsoname{Zobacz też}%
- \def\proofname{Dowód}%
- \def\glossaryname{Słowniczek}%
-}
-
-\def\datepolish{%
- \def\today{\number\day\space\ifcase\month\or
- stycznia\or lutego\or marca\or kwietnia\or maja\or czerwca\or
- lipca\or sierpnia\or września\or października\or
- listopada\or grudnia\fi\space
- \number\year}%
-}
-
-\def\noextras@polish{%
- \ifpolish@babelshorthands\nopolish@shorthands\fi%
- \nopolish@hyphens%
- \nopolish@vlna%
- \ifxetex\XeTeXinterchartokenstate=0\fi%
-}
-
-\def\blockextras@polish{%
- \ifpolish@babelshorthands\polish@shorthands\else\nopolish@shorthands\fi%
- \ifpolish@vlna\polish@vlna\else\nopolish@vlna\fi%
- \ifpolish@splithyphens\polish@hyphens\else\nopolish@hyphens\fi%
-}
-
-\def\inlineextras@polish{%
- \ifpolish@babelshorthands\polish@shorthands\else\nopolish@shorthands\fi%
- \ifpolish@vlna\polish@vlna\else\nopolish@vlna\fi%
- \ifpolish@splithyphens\polish@hyphens\else\nopolish@hyphens\fi%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-polish.ldf>
-%<*gloss-polutonikogreek.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-polutonikogreek.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-polutonikogreek.ldf}[polyglossia: module for polytonic Greek]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{greek}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-polutonikogreek.ldf>
-%<*gloss-portuges.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-portuges.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-portuges.ldf}[polyglossia: module for Portuguese]
-
-% We only provide this gloss for backwards compatibility. The name
-% 'portuges' was selected in accordance with babel (which probably
-% introduced it in 8.3 filename times). Since polyglossia uses full
-% English language names, we use 'portuguese' now.
-
-\xpg@load@master@language{portuguese}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-portuges.ldf>
-%<*gloss-portuguese.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-portuguese.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-portuguese.ldf}[polyglossia: module for Portuguese]
-
-\PolyglossiaSetup{portuguese}{
- bcp47=pt-PT,
- bcp47-language=pt,
- bcp47-region=PT,
- bcp47-script=Latn,
- babelname=portuges,
- hyphennames={portuges,portuguese},
- hyphenmins={2,3},
- langtag=PTG,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*[variant=portuguese]{portuguese}{pt-PT}
-\setlanguagealias*[variant=brazilian]{portuguese}{pt-BR}
-\setlanguagealias*{portuguese}{pt}
-
-% Babel aliases
-\setlanguagealias[variant=portuguese]{portuguese}{portuges}
-\setlanguagealias[variant=brazilian]{portuguese}{brazil}
-
-\ifluatex
- \RequirePackage{luavlna}
-\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]{}
-
-% Register default options
-\xpg@initialize@gloss@options{portuguese}{variant=portuguese,
- babelshorthands=false,
- splithyphens=true}
-
-\ifsystem@babelshorthands
- \setkeys{portuguese}{babelshorthands=true}
-\else
- \setkeys{portuguese}{babelshorthands=false}
-\fi
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
-
-\let\xpg@hyphen@char-
-\def\portuguese@@splhyphen#1{%
- \def\portuguese@sh@tmp{%
- \ifx\portuguese@sh@next\xpg@hyphen@char#1%
- \else\expandafter\portuguese@@@splhyphen{#1}\fi%
- }%
- \futurelet\portuguese@sh@next\portuguese@sh@tmp%
-}
-
-\def\portuguese@@@splhyphen#1{%
- \ifnum\hyphenchar \font>0%
- \kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}%
- \nobreak\hskip\z@%
- \else%
- #1%
- \fi%
-}
-
-\def\portuguese@splhyphen{%
- \portuguese@@splhyphen{-}%
-}
-
-\def\portuguese@shorthands{%
- \xpg@activate@shorthands%
- \def\language@group{portuguese}%
- \declare@shorthand{portuguese}{"=}{\portuguese@splhyphen}%
- \declare@shorthand{portuguese}{""}{\hskip\z@skip}%
- \declare@shorthand{portuguese}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
- \declare@shorthand{portuguese}{"-}{\nobreak\-\bbl@allowhyphens}%
- \declare@shorthand{portuguese}{"|}{%
- \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
- \bbl@allowhyphens}{}%
- }%
- \declare@shorthand{portuguese}{"/}{\textormath
- {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}%
- \declare@shorthand{portuguese}{"<}{«}%
- \declare@shorthand{portuguese}{">}{»}%
-}
-
-\def\noportuguese@shorthands{%
- \xpg@deactivate@shorthands%
-}
-
-\ifxetex
- % splithyphens
- \newXeTeXintercharclass\portuguese@hyphen % -
-\fi
-
-\def\portuguese@hyphens{%
- \ifluatex
- \AfterPreamble{\enablesplithyphens{portuguese}}%
- \else
- \XeTeXinterchartokenstate=1
- \XeTeXcharclass `\- \portuguese@hyphen
- \XeTeXinterchartoks \z@ \portuguese@hyphen = {\portuguese@@splhyphen}% "-" -> "\portuguese@@splhyphen-"
- \fi%
-}
-
-\def\noportuguese@hyphens{%
- \ifluatex
- \AfterPreamble{\disablesplithyphens{portuguese}}%
- \else
- \XeTeXcharclass `\- \z@
- \fi%
-}
-
-\def\portuguese@language{%
- \polyglossia@setup@language@patterns{\portuguese@variant}%
-}%
-
-\def\captionsportuguese@portuges{%
- \def\refname{Referências}%
- \def\abstractname{Resumo}%
- \def\bibname{Bibliografia}%
- \def\prefacename{Prefácio}%
- \def\chaptername{Capítulo}%
- \def\appendixname{Apêndice}%
- \def\contentsname{Conteúdo}%
- \def\listfigurename{Lista de Figuras}%
- \def\listtablename{Lista de Tabelas}%
- \def\indexname{Índice}%
- \def\figurename{Figura}%
- \def\tablename{Tabela}%
- \def\partname{Parte}%
- \def\pagename{Página}%
- \def\seename{ver}%
- \def\alsoname{ver também}%
- \def\enclname{Anexo}%
- \def\ccname{Com cópia a}%
- \def\headtoname{Para}%
- \def\proofname{Demonstração}%
- \def\glossaryname{Glossário}%
-}
-
-\def\captionsportuguese@brazil{%
- \def\refname{Referências}%
- \def\abstractname{Resumo}%
- \def\bibname{Referências Bibliográficas}%
- \def\prefacename{Prefácio}%
- \def\chaptername{Capítulo}%
- \def\appendixname{Apêndice}%
- \def\contentsname{Sumário}%
- \def\listfigurename{Lista de Figuras}%
- \def\listtablename{Lista de Tabelas}%
- \def\indexname{Índice Remissivo}%
- \def\figurename{Figura}%
- \def\tablename{Tabela}%
- \def\partname{Parte}%
- \def\pagename{Página}%
- \def\seename{veja}%
- \def\alsoname{veja também}%
- \def\enclname{Anexo}%
- \def\ccname{Cópia para}%
- \def\headtoname{Para}%
- \def\proofname{Demonstração}%
- \def\glossaryname{Glossário}%
-}
-
-\def\captionsportuguese{%
- \csname captionsportuguese@\portuguese@variant\endcsname%
-}
-
-\def\dateportuguese@portuges{%
- \def\today{\number\day\space de\space\ifcase\month\or
- Janeiro\or Fevereiro\or Março\or Abril\or Maio\or Junho\or
- Julho\or Agosto\or Setembro\or Outubro\or Novembro\or Dezembro\fi
- \space de\space\number\year}%
-}
-
-
-\def\dateportuguese@brazil{%
- \def\today{\number\day\space de\space\ifcase\month\or
- janeiro\or fevereiro\or março\or abril\or maio\or junho\or
- julho\or agosto\or setembro\or outubro\or novembro\or dezembro%
- \fi\space de\space\number\year}%
-}
-
-\def\dateportuguese{%
- \csname dateportuguese@\portuguese@variant\endcsname%
-}
-
-\def\noextras@portuguese{%
- \ifportuguese@babelshorthands\noportuguese@shorthands\fi%
- \noportuguese@hyphens%
-}
-
-\def\blockextras@portuguese{%
- \ifportuguese@babelshorthands\portuguese@shorthands\else\noportuguese@shorthands\fi%
- \ifportuguese@splithyphens\portuguese@hyphens\else\noportuguese@hyphens\fi%
-}
-
-\def\inlineextras@portuguese{%
- \ifportuguese@babelshorthands\portuguese@shorthands\else\noportuguese@shorthands\fi%
- \ifportuguese@splithyphens\portuguese@hyphens\else\noportuguese@hyphens\fi%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-portuguese.ldf>
-%<*gloss-punjabi.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-punjabi.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-% UTF-8 strings kindly provided by
-% Arvinder Singh Kang, <17-11-2022>
-% Amanpreet Singh Brar <17-11-2022>
-% Amandeep Singh Saini <17-11-2022>
-
-\ProvidesFile{gloss-punjabi.ldf}[polyglossia: module for Panjabi/Punjabi/pa-Gurmukhi]
-\RequirePackage{gurmukhidigits}
-\PolyglossiaSetup{punjabi}{
- bcp47=pa,
- bcp47-language=pa,
- bcp47-script=Guru,
- script=Gurmukhi,
- scripttag=gur,
- langtag=pan,
-%% hyphennames={panjabi,punjabi,gurmukhi}, TODO: implement fallback patterns (with ! prefix)
- fontsetup=true,
- localnumeral=punjabinumerals
- %TODO nouppercase=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{punjabi}{pa}
-
-\def\punjabi@language{%
- % patterns are spelled panjabi
- \polyglossia@setup@language@patterns{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'}}
-
-% Register default options
-\xpg@initialize@gloss@options{punjabi}{numerals=gurmukhi}
-
-\newcommand{\punjabinumerals}[2]{\punjabinumber{#2}}
-
-\def\punjabinumber#1{%
- \ifpunjabi@gurmukhi@numerals
- \gurmukhidigits{\number#1}%
- \else
- \number#1%
- \fi}
-
-\let\punjabinumeral=\punjabinumber
-
-\def\captionspunjabi{%
- \def\abstractname{ਨਿਚੋੜ}%
- \def\appendixname{ਅੰਤਿਕਾ}%
- \def\bibname{ਪੁਸਤਕ ਸੂਚੀ}%
- \def\ccname{}%
- \def\chaptername{ਖੰਡ}%
- \def\contentsname{ਸਮਗਰੀ ਸੂਚੀ}%
- \def\enclname{ਨੱਥੀ}%
- \def\figurename{ਚਿੱਤਰ}%
- \def\headpagename{ਪਲੇਠਾ-ਪੰਨਾ}%
- \def\headtoname{}%
- \def\indexname{ਸੂਚੀ}%
- \def\listfigurename{ਚਿੱਤਰਾਂ ਦੀ ਸੂਚੀ}%
- \def\listtablename{ਸਾਰਣੀ}%
- \def\pagename{ਪੰਨਾ}%
- \def\partname{ਭਾਗ}%
- \def\prefacename{ਮੁੱਖਬੰਦ}%
- \def\refname{ਹਵਾਲੇ}%
- \def\tablename{ਸਾਰਣੀ}%
- \def\seename{ਵੇਖੋ}%
- \def\alsoname{ਹੋਰ ਵੇਖੋ}%
- \def\alsoseename{ਹੋਰ ਵੇਖੋ}%
-}
-\def\datepunjabi{%
- \def\today{\punjabinumber\day\space\ifcase\month\or
- ਜਨਵਰੀ\or
- ਫਰਵਰੀ\or
- ਮਾਰਚ\or
- ਅਪ੍ਰੈਲ\or
- ਮਈ\or
- ਜੂਨ\or
- ਜੁਲਾਈ\or
- ਅਗਸਤ\or
- ਸਤੰਬਰ\or
- ਅਕਤੂਬਰ\or
- ਨਵੰਬਰ\or
- ਦਸੰਬਰ\fi
- \space\punjabinumber\year}%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-punjabi.ldf>
-%<*gloss-romanian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-romanian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-romanian.ldf}[polyglossia: module for Romanian]
-
-\PolyglossiaSetup{romanian}{
- bcp47=ro,
- bcp47-language=ro,
- bcp47-script=Latn,
- hyphennames={romanian},
- hyphenmins={2,2},
- langtag=ROM,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{romanian}{ro}
-
-\def\captionsromanian{%
- \def\refname{Bibliografie}%
- \def\abstractname{Rezumat}%
- \def\bibname{Bibliografie}%
- \def\prefacename{Prefață}%
- \def\chaptername{Capitolul}%
- \def\appendixname{Anexa}%
- \def\contentsname{Cuprins}%
- \def\listfigurename{Listă de figuri}%
- \def\listtablename{Listă de tabele}%
- \def\indexname{Glosar}%
- \def\figurename{Figura}%
- \def\tablename{Tabela}%
- %\def\thepart{}%
- \def\partname{Partea}%
- \def\pagename{Pagina}%
- \def\seename{Vezi}%
- \def\alsoname{Vezi de asemenea}%
- \def\enclname{Anexă}%
- \def\ccname{Copie}%
- \def\headtoname{Pentru}%
- \def\proofname{Demonstrație}%
- \def\glossaryname{Glosar}%
- }
-
-\def\dateromanian{%
- \def\today{\number\day~\ifcase\month\or
- ianuarie\or februarie\or martie\or aprilie\or mai\or
- iunie\or iulie\or august\or septembrie\or octombrie\or
- noiembrie\or decembrie\fi
- \space \number\year}%
- }
-
-% \end{macrocode}
-% \iffalse
-%</gloss-romanian.ldf>
-%<*gloss-romansh.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-romansh.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-romansh.ldf}[polyglossia: module for Romansh]
-\makeatletter
-\PolyglossiaSetup{romansh}{%
- bcp47=rm,
- bcp47-language=rm,
- bcp47-script=Latn,
- hyphennames={romansh},
- hyphenmins={2,2},
- langtag=RMS,
- indentfirst=true,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{romansh}{rm}
-
-\def\captionsromansh{%
- \def\prefacename{Prefaziun}%
- \def\refname{Bibliografia}%
- \def\abstractname{Recapitulaziun}%
- \def\bibname{Index bibliografic}%
- \def\chaptername{Chapitel}%
- \def\appendixname{Appendix}%
- \def\contentsname{Tavla dal cuntegn}%
- \def\listfigurename{Tavla da las figuras}%
- \def\listtablename{Tavla da las tabellas}%
- \def\indexname{Register da materias}% Index?
- \def\figurename{Figura}%
- \def\tablename{Tabella}%
- \def\partname{Part}%
- \def\enclname{Agiunta(s)}%
- \def\ccname{Copia a}%
- \def\headtoname{A}%
- \def\pagename{pagina}%
- \def\seename{vesair }%
- \def\alsoname{vesair era}%
- \def\proofname{Demonstraziun}%
- \def\glossaryname{Glossari}%
- }
-
-\def\dateromansh{%
- \def\today{\ifcase\day\or1.\else ils~\number\day\fi~da~%
- \ifcase\month\or
- schaner\or favrer\or mars\or avrigl\or matg\or zercladur\or
- fanadur\or avust\or settember\or october\or november\or
- december\fi\space \number\year}}
-\makeatother
-% \end{macrocode}
-% \iffalse
-%</gloss-romansh.ldf>
-%<*gloss-russian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-russian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-russian.ldf}[polyglossia: module for Russian]
-
-\RequirePackage{xpg-cyrillicnumbers}
-
-\PolyglossiaSetup{russian}{
- bcp47=ru,
- bcp47-language=ru,
- bcp47-variant=luna1918,
- bcp47-script=Cyrl,
- script=Cyrillic,
- scripttag=cyrl,
- langtag=RUS,
- hyphennames={russian},
- hyphenmins={2,2},
- frenchspacing=true,
- indentfirst=true,
- fontsetup,
- localnumeral=russiannumerals,
- Localnumeral=Russiannumerals
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{russian}{ru}
-\setlanguagealias*[spelling=modern]{russian}{ru-luna1918}
-\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%
-}%
-
-\def\daterussian{%
- \if@russian@modern\daterussian@modern\else\daterussian@old\fi%
-}%
-
-\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]{}
-
-% Register default options
-\xpg@initialize@gloss@options{russian}{babelshorthands=false,
- spelling=modern,
- numerals=arabic,
- indentfirst=true,
- forceheadingpunctuation=true,
- mathfunctions=true}
-
-
-\ifsystem@babelshorthands
- \setkeys{russian}{babelshorthands=true}
-\else
- \setkeys{russian}{babelshorthands=false}
-\fi
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
-
-\def\russian@shorthands{%
- \xpg@activate@shorthands%
- \def\language@group{russian}%
-% \declare@shorthand{russian}{"`}{„}%
-% \declare@shorthand{russian}{"'}{“}%
-% \declare@shorthand{russian}{"<}{«}%
-% \declare@shorthand{russian}{">}{»}%
- \declare@shorthand{russian}{""}{\hskip\z@skip}%
- \declare@shorthand{russian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
- \declare@shorthand{russian}{"=}{\nobreak-\hskip\z@skip}%
- \declare@shorthand{russian}{"|}{\textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}%
- \declare@shorthand{russian}{"-}{%
- \def\russian@sh@tmp{%
- \if\russian@sh@next-\expandafter\russian@sh@emdash%
- \else\expandafter\russian@sh@hyphen\fi%
- }%
- \futurelet\russian@sh@next\russian@sh@tmp}%
- \def\russian@sh@hyphen{%
- \nobreak\-\bbl@allowhyphens}%
- \def\russian@sh@emdash##1##2{\cdash-##1##2}%
- \def\cdash##1##2##3{\def\tempx@{##3}%
- \def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
- \ifx\tempx@\tempa@\@Acdash\else
- \ifx\tempx@\tempb@\@Bcdash\else
- \ifx\tempx@\tempc@\@Ccdash\else
- \errmessage{Wrong usage of cdash}\fi\fi\fi}%
- \def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
- \cyrdash\hskip.2em\ignorespaces}%
- \def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
- \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%
- \def\@Ccdash{\leavevmode
- \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
- \ifx\cyrdash\undefined
- \def\cyrdash{\hbox to.8em{\textendash\hss\textendash}}%
- \fi
- \declare@shorthand{russian}{",}{\nobreak\hskip.2em\ignorespaces}%
-}
-
-\def\norussian@shorthands{%
- \xpg@deactivate@shorthands%
-}
-
-
-\def\captionsrussian@modern{%
- \def\prefacename{Предисловие}%
- \def\refname{Список литературы}%
- \def\abstractname{Аннотация}%
- \def\bibname{Литература}%
- \def\chaptername{Глава}%
- \def\appendixname{Приложение}%
- \ifcsundef{thechapter}%
- {\def\contentsname{Содержание}}%
- {\def\contentsname{Оглавление}}%
- \def\listfigurename{Список иллюстраций}%
- \def\listtablename{Список таблиц}%
- \def\indexname{Предметный указатель}%
- \def\authorname{Именной указатель}%
- \def\figurename{Рис.}%
- \def\tablename{Таблица}%
- \def\partname{Часть}%
- \def\enclname{вкл.}%
- \def\ccname{исх.}%
- \def\headtoname{вх.}%
- \def\pagename{с.}%
- \def\seename{см.}%
- \def\alsoname{см.~также}%
- \def\proofname{Доказательство}%
-}
-\def\daterussian@modern{%
- \def\today{\number\day%
- \space\ifcase\month\or%
- января\or
- февраля\or
- марта\or
- апреля\or
- мая\or
- июня\or
- июля\or
- августа\or
- сентября\or
- октября\or
- ноября\or
- декабря\fi%
- \space \number\year\space г.}%
-}
-
-\def\captionsrussian@old{%
- \def\prefacename{Предисловіе}%
- \def\refname{Примѣчанія}%
- \def\abstractname{Аннотація}%
- \def\bibname{Библіографія}%
- \def\chaptername{Глава}%
- \def\appendixname{Приложеніе}%
- \ifcsundef{thechapter}%
- {\def\contentsname{Содержаніе}}%
- {\def\contentsname{Оглавленіе}}%
- \def\listfigurename{Списокъ иллюстрацій}%
- \def\listtablename{Списокъ таблицъ}%
- \def\indexname{Предмѣтный указатель}%
- \def\authorname{Именной указатель}%
- \def\figurename{Рис.}%
- \def\tablename{Таблица}%
- \def\partname{Часть}%
- \def\enclname{вкл.}%
- \def\ccname{исх.}%
- \def\headtoname{вх.}%
- \def\pagename{с.}%
- \def\seename{см.}%
- \def\alsoname{см.~также}%
- \def\proofname{Доказательство}%
-}
-
-\def\daterussian@old{%
- \def\today{\number\day%
- \space\ifcase\month\or%
- января\or
- февраля\or
- марта\or
- апреля\or
- мая\or
- іюня\or
- іюля\or
- августа\or
- сентября\or
- октября\or
- ноября\or
- декабря\fi%
- \space \number\year\space г.}%
-}
-
-% Russian needs trailing dots in all headings
-\def\xpg@save@autodot{}
-\ifdef{\KOMAScript}{%
- \providecommand*\autodot{}%
- \let\xpg@save@autodot\autodot%
-}
-
-\def\russian@capsformat{%
- \ifrussian@forceheadingpunctuation%
- \ifdef{\KOMAScript}{%
- \renewcommand*\autodot{.}%
- }{%
- % The following is based on some ideas from ruscor.sty
- \def\@seccntformat##1{\csname pre##1\endcsname%
- \csname the##1\endcsname%
- \csname post##1\endcsname}%
- \def\@aftersepkern{\hspace{0.5em}}%
- \def\postchapter{.\@aftersepkern}%
- \def\postsection{.\@aftersepkern}%
- \def\postsubsection{.\@aftersepkern}%
- \def\postsubsubsection{.\@aftersepkern}%
- \def\postparagraph{.\@aftersepkern}%
- \def\postsubparagraph{.\@aftersepkern}%
- \def\prechapter{}%
- \def\presection{}%
- \def\presubsection{}%
- \def\presubsubsection{}%
- \def\preparagraph{}%
- \def\presubparagraph{}%
- }%
- \fi%
-}
-
-\def\norussian@capsformat{%
- \ifrussian@forceheadingpunctuation%
- \ifdef{\KOMAScript}{%
- \let\autodot\xpg@save@autodot%
- }{%
- \def\@seccntformat##1{\csname the##1\endcsname\quad}% = LaTeX kernel
- }%
- \fi%
-}
-
-\newcommand{\russiannumerals}[2]{\russiannumber{#2}}
-\newcommand{\Russiannumerals}[2]{\Russiannumber{#2}}
-
-\def\russiannumber#1{%
- \ifcyrillic@numerals
- \ifcyrillic@asbuk@numerals
- \russian@asbuk@alph{#1}%
- \else
- \cyr@alph{#1}%
- \fi
- \else
- \number#1%
- \fi%
-}
-
-\def\Russiannumber#1{%
- \ifcyrillic@numerals
- \ifcyrillic@asbuk@numerals
- \russian@asbuk@Alph{#1}%
- \else
- \cyr@Alph{#1}%
- \fi
- \else
- \number#1%
- \fi%
-}
-
-\let\russiannumeral=\russiannumber
-\let\Russiannumeral=\Russiannumber
-
-\def\Asbuk#1{\expandafter\russian@asbuk@Alph\csname c@#1\endcsname}
-\def\asbuk#1{\expandafter\russian@asbuk@alph\csname c@#1\endcsname}
-
-\def\AsbukTrad#1{\expandafter\cyr@Alph\csname c@#1\endcsname}
-\def\asbukTrad#1{\expandafter\cyr@alph\csname c@#1\endcsname}
-
-
-% This is a poor man's cyrillic alphanumeric. It just uses the alphabet and
-% thus ends at 30.
-\def\russian@asbuk@Alph#1{\ifcase#1\or
- А\or Б\or В\or Г\or Д\or Е\or Ж\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}{russian@asbuk@Alph}\fi%
-}
-
-\def\russian@asbuk@alph#1{\ifcase#1\or
- а\or б\or в\or г\or д\or е\or ж\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}{russian@asbuk@alph}\fi%
-}
-
-\def\russian@numbers{%
- \let\latin@alph\@alph
- \let\latin@Alph\@Alph
- \ifcyrillic@numerals%
- \def\russian@alph##1{\expandafter\russiannumeral\expandafter{\the##1}}%
- \def\russian@Alph##1{\expandafter\Russiannumeral\expandafter{\the##1}}%
- \let\@alph\russian@alph%
- \let\@Alph\russian@Alph%
- \fi
-}
-
-\def\norussian@numbers{%
- \let\@alph\latin@alph%
- \let\@Alph\latin@Alph%
-}
-
-\def\noextras@russian{%
- \norussian@capsformat%
- \ifcyrillic@numerals\norussian@numbers\fi%
- \ifrussian@babelshorthands\norussian@shorthands\fi%
-}
-
-\def\blockextras@russian{%
- \russian@capsformat%
- \ifcyrillic@numerals\russian@numbers\else\norussian@numbers\fi%
- \ifrussian@babelshorthands\russian@shorthands\else\norussian@shorthands\fi%
-}
-
-\def\inlineextras@russian{%
- \ifrussian@babelshorthands\russian@shorthands\else\norussian@shorthands\fi%
-}
-
-%%% These lines taken from russianb.ldf, part of babel package.
-\AtBeginDocument{%
-\ifrussian@mathfunctions%
- \def\sh {\mathop{\operator@font sh}\nolimits}
- \def\ch {\mathop{\operator@font ch}\nolimits}
- \def\tg {\mathop{\operator@font tg}\nolimits}
- \def\arctg {\mathop{\operator@font arctg}\nolimits}
- \def\arcctg{\mathop{\operator@font arcctg}\nolimits}
- \def\th {\mathop{\operator@font th}\nolimits}
- \def\ctg {\mathop{\operator@font ctg}\nolimits}
- \def\cth {\mathop{\operator@font cth}\nolimits}
- \def\cosec {\mathop{\operator@font cosec}\nolimits}
- \def\Prob {\mathop{\kern\z@\mathsf{P}}\nolimits}
- \def\Variance{\mathop{\kern\z@\mathsf{D}}\nolimits}
- \def\nod {\mathop{\mathrm{н.о.д.}}\nolimits}
- \def\nok {\mathop{\mathrm{н.о.к.}}\nolimits}
- \def\NOD {\mathop{\mathrm{НОД}}\nolimits}
- \def\NOK {\mathop{\mathrm{НОК}}\nolimits}
- \def\Proj {\mathop{\mathrm{Пр}}\nolimits}
- %\DeclareRobustCommand{\No}{№}
-\fi
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-russian.ldf>
-%<*gloss-sami.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-sami.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-sami.ldf}[polyglossia: module for Sami]
-
-\PolyglossiaSetup{sami}{
- bcp47=se,
- bcp47-language=se,
- bcp47-script=Latn,
- babelname=samin,
- hyphennames={samin},
- hyphenmins={2,2},
- language={Northern Sami},
- langtag=NSM,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{sami}{se}
-
-% Babel and backwards compat. alias
-\setlanguagealias{sami}{samin}
-%\setlanguagealias[variant=northern]{sami}{samin}
-
-% TODO: Add other Sami varieties
-\def\sami@variant{northern}
-%\define@choicekey*+{sami}{variant}[\xpg@val\xpg@nr]{northern}[nothern]{%
-% \ifcase\xpg@nr\relax
-% % northern:
-% \def\sami@variant{samin}%
-% \SetLanguageKeys{sami}{language=Northern Sami,langtag=NSM}%
-% \xpg@fontsetup@latin{sami}%
-% \or
-% % other:
-% \def\sami@variant{}%
-% \SetLanguageKeys{sami}{language= Sami,langtag=}%
-% \xpg@fontsetup@latin{sami}%
-% \fi
-% \xpg@info{Option: sami, variant=\xpg@val}%
-%}{\xpg@warning{Unknown sami variant `#1'}}
-
-
-%\def\sami@language{%
-% \polyglossia@setup@language@patterns{\sami@variant}%
-%}%
-
-\def\captionssami@northern{%
- \def\refname{Čujuhusat}%
- \def\abstractname{Čoahkkáigeassu}%
- \def\bibname{Girjjálašvuohta}%
- \def\prefacename{Ovdasátni}%
- \def\chaptername{Kapihttal}%
- \def\appendixname{Čuovus}%
- \def\contentsname{Sisdoallu}%
- \def\listfigurename{Govvosat}%
- \def\listtablename{Tabeallat}%
- \def\indexname{Registtar}%
- \def\figurename{Govus}%
- \def\tablename{Tabealla}%
- \def\thepart{}%
- \def\partname{Oassi}%
- \def\pagename{Siidu}%
- \def\seename{geahča}%
- \def\alsoname{geahča maiddái}%
- \def\enclname{Mielddus}%
- \def\ccname{Kopia sáddejuvvon}%
- \def\headtoname{Vuostáiváldi}%
- \def\proofname{Duođaštus}%
- \def\glossaryname{Sátnelistu}%
-}
-
-\def\captionssami{%
- \csname captionssami@\sami@variant\endcsname%
-}
-
-\def\datesami@northern{%
- \def\today{\ifcase\month\or
- ođđajagemánu\or
- guovvamánu\or
- njukčamánu\or
- cuoŋománu\or
- miessemánu\or
- geassemánu\or
- suoidnemánu\or
- borgemánu\or
- čakčamánu\or
- golggotmánu\or
- skábmamánu\or
- juovlamánu\fi
- \space\number\day.~b.\space\number\year}%
-}
-
-\def\datesami{%
- \csname datesami@\sami@variant\endcsname%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-sami.ldf>
-%<*gloss-samin.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-samin.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-samin.ldf>
-%<*gloss-sanskrit.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-sanskrit.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-sanskrit.ldf}[polyglossia: module for Sanskrit]
-
-\RequirePackage{devanagaridigits}
-
-\PolyglossiaSetup{sanskrit}{
- bcp47=sa-Deva,
- bcp47-language=sa,
- bcp47-script=Deva,
- bcp47-casing=sa-Deva,
- langtag=SAN,
- hyphennames={sanskrit,prakrit},
- hyphenmins={1,3},
- frenchspacing=true,
- fontsetup=false, % will be done below
- localnumeral=sanskritnumerals
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{sanskrit}{sa}
-\setlanguagealias*[script=devanagari]{sanskrit}{sa-Deva}
-\setlanguagealias*[script=malayalam]{sanskrit}{sa-Mlym}
-\setlanguagealias*[script=telugu]{sanskrit}{sa-Telu}
-\setlanguagealias*[script=bengali]{sanskrit}{sa-Beng}
-\setlanguagealias*[script=kannada]{sanskrit}{sa-Knda}
-\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}}
-\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}}
-\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}}
-\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}}
-\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}}
-\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}}
-\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}}
-
-
-\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'}}
-
-
-% Register default options
-\xpg@initialize@gloss@options{sanskrit}{script=devanagari,numerals=devanagari}
-
-% Use \providecommand here as the ldf file might
-% be reloaded via BCP.
-\providecommand{\sanskritnumerals}[2]{\sanskritnumber{#2}}
-
-\def\sanskritnumber#1{%
- \ifsanskrit@devanagari@numerals
- \devanagaridigits{\number#1}%
- \else
- \number#1%
- \fi%
-}
-
-\ifluatex
- \directlua{require('polyglossia-sanskrit')}%
-\else
- \newXeTeXintercharclass\sanskrit@questionexclamation % ! ? ‼ ⁇ ⁈ ⁉ ‽
- \newXeTeXintercharclass\sanskrit@punctthin % : ; danda double_danda
-\fi
-
-\def\sanskrit@punctthinspace{{\unskip\thinspace}}
-
-\def\sanskrit@punctuation{%
- \ifluatex
- \directlua{polyglossia.activate_sanskrit_punct()}%
- \else
- \XeTeXinterchartokenstate=1%
- \XeTeXcharclass `\! \sanskrit@questionexclamation
- \XeTeXcharclass `\? \sanskrit@questionexclamation
- \XeTeXcharclass `\‼ \sanskrit@questionexclamation
- \XeTeXcharclass `\⁇ \sanskrit@questionexclamation
- \XeTeXcharclass `\⁈ \sanskrit@questionexclamation
- \XeTeXcharclass `\⁉ \sanskrit@questionexclamation
- \XeTeXcharclass `\‽ \sanskrit@questionexclamation % interrobang, U+203D
- \XeTeXcharclass `\: \sanskrit@punctthin
- \XeTeXcharclass `\; \sanskrit@punctthin
- \XeTeXcharclass `\। \sanskrit@punctthin % danda, U+0964
- \XeTeXcharclass `\॥ \sanskrit@punctthin % double danda, U+0965
- \XeTeXinterchartoks \z@ \sanskrit@questionexclamation = \sanskrit@punctthinspace
- \XeTeXinterchartoks \z@ \sanskrit@punctthin = \sanskrit@punctthinspace
- \XeTeXinterchartoks \sanskrit@questionexclamation \sanskrit@punctthin = \sanskrit@punctthinspace
- \fi
-}
-
-\def\nosanskrit@punctuation{%
- \ifluatex
- \directlua{polyglossia.deactivate_sanskrit_punct()}%
- \else
- \XeTeXcharclass `\! \z@
- \XeTeXcharclass `\? \z@
- \XeTeXcharclass `\‼ \z@
- \XeTeXcharclass `\⁇ \z@
- \XeTeXcharclass `\⁈ \z@
- \XeTeXcharclass `\⁉ \z@
- \XeTeXcharclass `\‽ \z@
- \XeTeXcharclass `\: \z@
- \XeTeXcharclass `\; \z@
- \XeTeXcharclass `\। \z@
- \XeTeXcharclass `\॥ \z@
- \XeTeXinterchartokenstate=0%
- \fi
-}
-
-\def\noextras@sanskrit{%
- \nosanskrit@punctuation%
-}
-
-\def\blockextras@sanskrit{%
- \sanskrit@punctuation%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-sanskrit.ldf>
-%<*gloss-scottish.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-scottish.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-scottish.ldf>
-%<*gloss-serbian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-serbian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-serbian.ldf}[polyglossia: module for Serbian]
-%TODO split into gloss-serbiancyr.ldf and gloss-serbianlat.ldf
-%% load these automatically from polyglossia.sty according to the script option ??
-%% same thing for all languages that have a "script" key !
-%% BETTER APPROACH: see gloss-sanskrit!
-
-\RequirePackage{xpg-cyrillicnumbers}
-
-\PolyglossiaSetup{serbian}{
- bcp47=sr-Latn,
- bcp47-language=sr,
- bcp47-variant=ekavsk,
- bcp47-script=Latn,
- bcp47-casing=sr-Latn,
- langtag=SRB,
- hyphennames={serbian},
- hyphenmins={2,2},
- frenchspacing=true, % Правопис српскога језика, Матица српска, 2010. (измењено и допуњено, четврто издање): т. 188, под Обликовање ступца и пасуса
- indentfirst=true, % Правопис српскога језика, Матица српска, 2010. (измењено и допуњено, четврто издање): т. 188, под Обликовање ступца и пасуса
- fontsetup=false,
- localnumeral=serbiannumerals,
- Localnumeral=Serbiannumerals,
- babelname=serbian
- %TODO localalph
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{serbian}{sr}
-\setlanguagealias*[script=cyrillic]{serbian}{sr-Cyrl}
-\setlanguagealias*[script=latin]{serbian}{sr-Latn}
-
-% Babel aliases
-\setlanguagealias[script=cyrillic]{serbian}{serbianc}
-
-\ifluatex
- \RequirePackage{luavlna}
-\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
- \if@serbian@ijekavian
- \SetLanguageKeys{serbian}{scripttag=cyrl,script=Cyrillic,babelname=serbianc,bcp47=sr-Cyrl-ijekavsk,bcp47-language=sr,bcp47-script=Cyrl,bcp47-variant=ijekavsk,bcp47-casing=sr-Cyrl}
- \else
- \SetLanguageKeys{serbian}{scripttag=cyrl,script=Cyrillic,babelname=serbianc,bcp47=sr-Cyrl,bcp47-language=sr,bcp47-script=Cyrl,bcp47-variant=ekavsk,bcp47-casing=sr-Cyrl}
- \fi
- \else
- \if@serbian@ijekavian
- \SetLanguageKeys{serbian}{scripttag=latn,script=Latin,babelname=serbian,bcp47=sr-Latn-ijekavsk,bcp47-language=sr,bcp47-script=Latn,bcp47-variant=ijekavsk,bcp47-casing=sr-Latn}
- \else
- \SetLanguageKeys{serbian}{scripttag=latn,script=Latin,babelname=serbian,bcp47=sr-Latn,bcp47-language=sr,bcp47-script=Latn,bcp47-variant=ekavsk,bcp47-casing=sr-Latn}
- \fi
- \fi%
-}
-
-\setkeys{serbian}{Script,numerals}
-
-% Register default options
-\xpg@initialize@gloss@options{serbian}{script=cyrillic,numerals=arabic,splithyphens=true}
-
-\def\captionsserbian{%
- \if@serbian@cyr\captionsserbian@cyr\else\captionsserbian@lat\fi
-}
-
-\def\dateserbian{%
- \if@serbian@cyr\dateserbian@cyr\else\dateserbian@lat\fi
-}
-
-\def\captionsserbian@lat{%
- \def\refname{Bibliografija}%
- \def\abstractname{Sažetak}%
- \def\bibname{Literatura}%
- \def\prefacename{Predgovor}%
- \def\chaptername{Glava}%
- \def\appendixname{Dodatak}%
- \def\contentsname{Sadržaj}%
- \def\listfigurename{Spisak slika}%
- \def\listtablename{Spisak tabela}%
- \def\indexname{Registar}%
- \def\figurename{Slika}%
- \def\tablename{Tabela}%
- \def\partname{Deo}%
- \renewcommand\thepart{\ifcase\value{part}\or Prvi\or Drugi\or
- Treći\or Četvrti\or Peti\or Šesti\or Sedmi\or Osmi\or
- Deveti\or Deseti\or Jedanaesti\or Dvanaesti\or Trinaesti\or
- Četrnaesti\or Petnaesti\or Šesnaesti\or Sedamnaesti\or
- Osamnaesti\or Devetnaesti\or Dvadeseti\fi}%
- \def\pagename{Strana}%
- \def\seename{Vidi}%
- \def\alsoname{Vidi takođe}%
- \def\enclname{Prilozi}%
- \def\ccname{Kopije}%
- \def\headtoname{Prima}%
- \def\proofname{Dokaz}%
- \def\glossaryname{Rečnik nepoznatih reči}%
- \if@serbian@ijekavian%
- \def\partname{Dio}%
- \def\glossaryname{Rječnik nepoznatih riječi}%
- \fi
-}
-
-\def\month@serbian@lat{%
- \ifcase\month\or
- januar\or
- februar\or
- mart\or
- april\or
- maj\or
- \ifserbian@datei juni\else jun\fi\or
- \ifserbian@datei juli\else jul\fi\or
- avgust\or
- septembar\or
- oktobar\or
- novembar\or
- decembar%
- \fi%
-}%
-
-\def\month@serbian@lat@gen{%
- \ifcase\month\or
- januara\or
- februara\or
- marta\or
- aprila\or
- maja\or
- juna\or
- jula\or
- avgusta\or
- septembra\or
- oktobra\or
- novembra\or
- decembra%
- \fi%
-}%
-
-\def\dateserbian@lat{%
- \def\today{\number\day.~\month@serbian@lat\ \number\year\@ifstar{}{.}}%
- \def\todayRoman{\number\day.~\@Roman\month~\number\year\@ifstar{}{.}}%
- \def\todayGen{\number\day.~\month@serbian@lat@gen\ \number\year\@ifstar{}{.}}%
- \def\todayArabic{\number\day.~\number\month.~\number\year\@ifstar{}{.}}%
-}
-
-\def\captionsserbian@cyr{%
- \def\refname{Библиографија}%
- \def\abstractname{Сажетак}%
- \def\bibname{Литература}%
- \def\prefacename{Предговор}%
- \def\chaptername{Глава}%
- \def\appendixname{Додатак}%
- \def\contentsname{Садржај}%
- \def\listfigurename{Списак слика}%
- \def\listtablename{Списак табела}%
- \def\indexname{Регистар}%
- \def\figurename{Слика}%
- \def\tablename{Табела}%
- \def\partname{Део}%
- \renewcommand\thepart{\ifcase\value{part}\or Први\or Други\or Трећи\or
- Четврти\or Пети\or Шести\or Седми\or Осми\or Девети\or Десети\or
- Једанаести\or Дванаести\or Тринаести\or Четрнаести\or Петнаести\or
- Шеснаести\or Седамнаести\or Осамнаести\or Деветнаести\or Двадесети\fi}%
- \def\pagename{Страна}%
- \def\seename{Види}%
- \def\alsoname{Види такође}%
- \def\enclname{Прилози}%
- \def\ccname{Копије}%
- \def\headtoname{Прима}%
- \def\proofname{Доказ}%
- \def\glossaryname{Речник непознатих речи}%
- \if@serbian@ijekavian%
- \def\partname{Дио}%
- \def\glossaryname{Рјечник непознатих ријечи}%
- \fi
-}
-
-\def\month@serbian@cyr{%
- \ifcase\month\or
- јануар\or
- фебруар\or
- март\or
- април\or
- мај\or
- \ifserbian@datei јуни\else јун\fi\or
- \ifserbian@datei јули\else јул\fi\or
- август\or
- септембар\or
- октобар\or
- новембар\or
- децембар%
- \fi%
-}%
-
-\def\month@serbian@cyr@gen{%
- \ifcase\month\or
- јануара\or
- фебруара\or
- марта\or
- априла\or
- маја\or
- јуна\or
- јула\or
- августа\or
- септембра\or
- октобра\or
- новембра\or
- децембра%
- \fi%
-}%
-
-\def\dateserbian@cyr{%
- \def\today{\number\day.~\month@serbian@cyr\ \number\year\@ifstar{}{.}}%
- \def\todayRoman{\number\day.~\@Roman\month~\number\year\@ifstar{}{.}}%
- \def\todayGen{\number\day.~\month@serbian@cyr@gen\ \number\year\@ifstar{}{.}}%
- \def\todayArabic{\number\day.~\number\month.~\number\year\@ifstar{}{.}}%
-}
-
-% Use \providecommand here as the ldf file might
-% be reloaded via serbianc.
-\providecommand{\serbiannumerals}[2]{\serbiannumber{#2}}
-\providecommand{\Serbiannumerals}[2]{\Serbiannumber{#2}}
-
-\def\serbiannumber#1{%
- \ifcyrillic@numerals
- \ifcyrillic@asbuk@numerals
- \serbian@asbuk@alph{#1}%
- \else
- \cyr@alph{#1}%
- \fi
- \else
- \number#1%
- \fi%
-}
-
-\def\Serbiannumber#1{%
- \ifcyrillic@numerals
- \ifcyrillic@asbuk@numerals
- \serbian@asbuk@Alph{#1}%
- \else
- \cyr@Alph{#1}%
- \fi
- \else
- \number#1%
- \fi%
-}
-
-\let\serbiannumeral=\serbiannumber
-\let\Serbiannumeral=\Serbiannumber
-
-\def\serbian@numbers{%
- \let\latin@alph\@alph
- \let\latin@Alph\@Alph
- \ifcyrillic@numerals
- \def\serbian@alph##1{\expandafter\serbiannumeral\expandafter{\the##1}}%
- \def\serbian@Alph##1{\expandafter\Serbiannumeral\expandafter{\the##1}}%
- \let\@alph\serbian@alph%
- \let\@Alph\serbian@Alph%
- \fi
-}
-
-\def\noserbian@numbers{%
- \let\@alph\latin@alph
- \let\@Alph\latin@Alph
-}
-
-\let\xpg@hyphen@char-
-\def\serbian@@splhyphen#1{%
- \def\serbian@sh@tmp{%
- \ifx\serbian@sh@next\xpg@hyphen@charx#1%
- \else\expandafter\serbian@@@splhyphen{#1}\fi%
- }%
- \futurelet\serbian@sh@next\serbian@sh@tmp%
-}
-
-\def\serbian@@@splhyphen#1{%
- \ifnum\hyphenchar \font>0%
- \kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}%
- \nobreak\hskip\z@%
- \else%
- #1%
- \fi%
-}
-
-\def\serbian@splhyphen{%
- \serbian@@splhyphen{-}%
-}
-
-\ifxetex
- % splithyphens
- \newXeTeXintercharclass\serbian@hyphen % -
- \newXeTeXintercharclass\serbian@nonsyllabicpreposition%
-\fi
-
-\def\serbian@hyphens{%
- \ifluatex
- \AfterPreamble{\enablesplithyphens{serbian}}%
- \else
- \XeTeXinterchartokenstate=1
- \XeTeXcharclass `\- \serbian@hyphen
- \XeTeXinterchartoks \z@ \serbian@hyphen = {\serbian@@splhyphen}% "-" -> "\serbian@@splhyphen-"
- % necessary if used together with vlna:
- \XeTeXinterchartoks \serbian@nonsyllabicpreposition \serbian@hyphen = {\serbian@@splhyphen}% "-" -> "\serbian@@splhyphen-"
- \fi%
-}
-
-\def\noserbian@hyphens{%
- \ifluatex
- \AfterPreamble{\disablesplithyphens{serbian}}%
- \else
- \XeTeXcharclass `\- \z@
- \fi%
-}
-
-\def\blockextras@serbian{%
- \ifcyrillic@numerals\serbian@numbers\else\noserbian@numbers\fi%
- \ifserbian@splithyphens\serbian@hyphens\else\noserbian@hyphens\fi%
-}
-
-\def\inlineextras@serbian{%
- \ifserbian@splithyphens\serbian@hyphens\else\noserbian@hyphens\fi%
-}
-
-\def\noextras@serbian{%
- \ifcyrillic@numerals\noserbian@numbers\fi%
- \noserbian@hyphens%
-}
-
-\def\Asbuk#1{\expandafter\serbian@asbuk@Alph\csname c@#1\endcsname}
-\def\asbuk#1{\expandafter\serbian@asbuk@alph\csname c@#1\endcsname}
-
-\def\AsbukTrad#1{\expandafter\cyr@Alph\csname c@#1\endcsname}
-\def\asbukTrad#1{\expandafter\cyr@alph\csname c@#1\endcsname}
-
-% This is a poor man's cyrillic alphanumeric.
-% It just uses the alphabet and thus ends at 30.
-\def\serbian@asbuk@Alph#1{\ifcase#1\or
- А\or Б\or В\or Г\or Д\or Ђ\or Е\or Ж\or
- З\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}{serbian@asbuk@Alph}\fi%
-}
-
-\def\serbian@asbuk@alph#1{\ifcase#1\or
- а\or б\or в\or г\or д\or ђ\or е\or ж\or
- з\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}{serbian@asbuk@alph}\fi%
-}
-
-
-% \end{macrocode}
-% \iffalse
-%</gloss-serbian.ldf>
-%<*gloss-serbianc.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-serbianc.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-serbianc.ldf}[polyglossia: module for Serbian (cyrillic)]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{serbian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-serbianc.ldf>
-%<*gloss-slovak.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-slovak.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-slovak.ldf}[polyglossia: module for Slovak]
-
-\PolyglossiaSetup{slovak}{
- bcp47=sk,
- bcp47-language=sk,
- bcp47-script=Latn,
- hyphennames={slovak},
- hyphenmins={2,2},
- langtag=SKY,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{slovak}{sk}
-
-\ifluatex
- \RequirePackage{luavlna}
-\fi
-
-\define@boolkey{slovak}[slovak@]{babelshorthands}[true]{}
-
-\define@boolkey{slovak}[slovak@]{splithyphens}[true]{}
-
-\define@boolkey{slovak}[slovak@]{vlna}[true]{}
-
-% Register default options
-\xpg@initialize@gloss@options{slovak}{babelshorthands=false,splithyphens=true,vlna=true}
-
-\ifsystem@babelshorthands
- \setkeys{slovak}{babelshorthands=true}
-\else
- \setkeys{slovak}{babelshorthands=false}
-\fi
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
-
-\let\xpg@hyphen@char-
-\def\slovak@@splhyphen#1{%
- \def\slovak@sh@tmp{%
- \ifx\slovak@sh@next\xpg@hyphen@char#1%
- \else\expandafter\slovak@@@splhyphen{#1}\fi%
- }%
- \futurelet\slovak@sh@next\slovak@sh@tmp%
-}
-
-\def\slovak@@@splhyphen#1{%
- \ifnum\hyphenchar \font>0%
- \kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}%
- \nobreak\hskip\z@%
- \else%
- #1%
- \fi%
-}
-
-\def\slovak@splhyphen{%
- \slovak@@splhyphen{-}%
-}
-
-\def\slovak@shorthands{%
- \xpg@activate@shorthands%
- \def\language@group{slovak}%
- \declare@shorthand{slovak}{"=}{\slovak@splhyphen}%
- \declare@shorthand{slovak}{""}{\hskip\z@skip}%
- \declare@shorthand{slovak}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
- \declare@shorthand{slovak}{"-}{\nobreak\-\bbl@allowhyphens}%
- \declare@shorthand{slovak}{"|}{%
- \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
- \bbl@allowhyphens}{}%
- }%
- \declare@shorthand{slovak}{"/}{\textormath
- {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}%
- \declare@shorthand{slovak}{"`}{„}%
- \declare@shorthand{slovak}{"'}{“}%
- \declare@shorthand{slovak}{"<}{«}%
- \declare@shorthand{slovak}{">}{»}%
-}
-
-\def\noslovak@shorthands{%
- \xpg@deactivate@shorthands%
-}
-
-\ifxetex
- % splithyphens
- \newXeTeXintercharclass\slovak@hyphen % -
- % vlna
- \newXeTeXintercharclass\slovak@openpunctuation
- \newXeTeXintercharclass\slovak@nonsyllabicpreposition
- \ifdefined\e@alloc@intercharclass@top
- \chardef\slovak@boundary=\e@alloc@intercharclass@top
- \else
- \ifdefined\XeTeXinterwordspaceshaping
- \chardef\slovak@boundary=4095 %
- \def\newXeTeXintercharclass{%
- \e@alloc\XeTeXcharclass\chardef
- \xe@alloc@intercharclass\m@ne\@ucharclass@boundary}%
- \else
- \chardef\slovak@boundary=255
- \fi
- \fi
-\fi
-
-\def\slovak@hyphens{%
- \ifluatex
- \AfterPreamble{\enablesplithyphens{slovak}}%
- \else
- \XeTeXinterchartokenstate=1
- \XeTeXcharclass `\- \slovak@hyphen
- \XeTeXinterchartoks \z@ \slovak@hyphen = {\slovak@@splhyphen}% "-" -> "\slovak@@splhyphen-"
- % necessary if used together with vlna:
- \XeTeXinterchartoks \slovak@nonsyllabicpreposition \slovak@hyphen = {\slovak@@splhyphen}% "-" -> "\slovak@@splhyphen-"
- \fi%
-}
-
-\def\noslovak@hyphens{%
- \ifluatex
- \AfterPreamble{\disablesplithyphens{slovak}}%
- \else
- \XeTeXcharclass `\- \z@
- \fi%
-}
-
-% Add nonbreakable space after single-letter word to
-% prevent them to land at the end of a line
-% vlna code taken and adapted from xevlna.sty
-\ifxetex
- \def\slovak@nointerchartoks{\let\slovak@interchartoks\slovak@PreCSpreposition}%
- \def\slovak@PreCSpreposition{%
- \def\next{}%
- \ifnum\catcode`\ =10 % nothing will be done in verbatim
- \ifmmode % nothing in math
- \else
- \let\slovak@interchartoks\slovak@nointerchartoks
- \let\next\slovak@ExamineCSpreposition
- \fi\fi
- \next%
- }%
- \def\slovak@ExamineCSpreposition #1{#1\futurelet\next\slovak@ProcessCSpreposition}%
- \def\slovak@ProcessCSpreposition{\ifx\next\slovak@XeTeXspace\nobreak\fi}%
- \futurelet\slovak@XeTeXspace{ }\slovak@nointerchartoks
-\fi
-
-\def\slovak@vlna{%
- \ifluatex
- \preventsingleon
- \else
- % Code taken and adapted from xevlna.sty
- \XeTeXinterchartokenstate=1
- \XeTeXcharclass `\( \slovak@openpunctuation
- \XeTeXcharclass `\[ \slovak@openpunctuation
- \XeTeXcharclass `\„ \slovak@openpunctuation
- \XeTeXcharclass `\» \slovak@openpunctuation
- \XeTeXcharclass `\K \slovak@nonsyllabicpreposition
- \XeTeXcharclass `\k \slovak@nonsyllabicpreposition
- \XeTeXcharclass `\S \slovak@nonsyllabicpreposition
- \XeTeXcharclass `\s \slovak@nonsyllabicpreposition
- \XeTeXcharclass `\V \slovak@nonsyllabicpreposition
- \XeTeXcharclass `\v \slovak@nonsyllabicpreposition
- \XeTeXcharclass `\Z \slovak@nonsyllabicpreposition
- \XeTeXcharclass `\z \slovak@nonsyllabicpreposition
- \XeTeXcharclass `\O \slovak@nonsyllabicpreposition
- \XeTeXcharclass `\o \slovak@nonsyllabicpreposition
- \XeTeXcharclass `\U \slovak@nonsyllabicpreposition
- \XeTeXcharclass `\u \slovak@nonsyllabicpreposition
- \XeTeXcharclass `\A \slovak@nonsyllabicpreposition
- \XeTeXcharclass `\a \slovak@nonsyllabicpreposition
- \XeTeXcharclass `\I \slovak@nonsyllabicpreposition
- \XeTeXcharclass `\i \slovak@nonsyllabicpreposition
- \XeTeXinterchartoks \slovak@boundary \slovak@nonsyllabicpreposition {\slovak@interchartoks}%
- \XeTeXinterchartoks \slovak@openpunctuation \slovak@nonsyllabicpreposition {\slovak@interchartoks}%
- \fi
-}
-
-\def\noslovak@vlna{%
- \ifluatex
- \preventsingleoff
- \else
- \XeTeXcharclass`\(\z@
- \XeTeXcharclass`\[\z@
- \XeTeXcharclass`\„\z@
- \XeTeXcharclass`\»\z@
- \XeTeXcharclass`\K\z@
- \XeTeXcharclass`\k\z@
- \XeTeXcharclass`\S\z@
- \XeTeXcharclass`\s\z@
- \XeTeXcharclass`\V\z@
- \XeTeXcharclass`\v\z@
- \XeTeXcharclass`\Z\z@
- \XeTeXcharclass`\z\z@
- \XeTeXcharclass`\O\z@
- \XeTeXcharclass`\o\z@
- \XeTeXcharclass`\U\z@
- \XeTeXcharclass`\u\z@
- \XeTeXcharclass`\A\z@
- \XeTeXcharclass`\a\z@
- \XeTeXcharclass`\I\z@
- \XeTeXcharclass`\i\z@
- \fi
-}
-
-
-\def\captionsslovak{%
- \def\refname{Referencie}%
- \def\abstractname{Abstrakt}%
- \def\bibname{Literatúra}%
- \def\prefacename{Úvod}%
- \def\chaptername{Kapitola}%
- \def\appendixname{Dodatok}%
- \def\contentsname{Obsah}%
- \def\listfigurename{Zoznam obrázkov}%
- \def\listtablename{Zoznam tabuliek}%
- \def\indexname{Index}%
- \def\figurename{Obrázok}%
- \def\tablename{Tabuľka}%
- %\def\thepart{}%
- \def\partname{Časť}%
- \def\pagename{Strana}%
- \def\seename{viď}%
- \def\alsoname{viď tiež}%
- \def\enclname{Prílohy}%
- \def\ccname{cc.}%
- \def\headtoname{Pre}% was komu
- \def\proofname{Dôkaz}%
- \def\glossaryname{Slovník}%
-}
-
-\def\dateslovak{%
- \def\today{\number\day.~\ifcase\month\or
- januára\or februára\or marca\or apríla\or mája\or
- júna\or júla\or augusta\or septembra\or októbra\or
- novembra\or decembra\fi
- \space \number\year}%
-}
-
-\def\noextras@slovak{%
- \ifslovak@babelshorthands\noslovak@shorthands\fi%
- \noslovak@hyphens%
- \noslovak@vlna%
- \ifxetex\XeTeXinterchartokenstate=0\fi%
-}
-
-\def\blockextras@slovak{%
- \ifslovak@babelshorthands\slovak@shorthands\else\noslovak@shorthands\fi%
- \ifslovak@vlna\slovak@vlna\else\noslovak@vlna\fi%
- \ifslovak@splithyphens\slovak@hyphens\else\noslovak@hyphens\fi%
-}
-
-\def\inlineextras@slovak{%
- \ifslovak@babelshorthands\slovak@shorthands\else\noslovak@shorthands\fi%
- \ifslovak@vlna\slovak@vlna\else\noslovak@vlna\fi%
- \ifslovak@splithyphens\slovak@hyphens\else\noslovak@hyphens\fi%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-slovak.ldf>
-%<*gloss-slovene.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-slovene.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-slovene.ldf}[polyglossia: module for Slovenian]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{slovenian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-slovene.ldf>
-%<*gloss-slovenian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-slovenian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-slovenian.ldf}[polyglossia: module for Slovenian]
-
-\PolyglossiaSetup{slovenian}{
- bcp47=sl,
- bcp47-language=sl,
- bcp47-script=Latn,
- hyphennames={slovenian,slovene},
- babelname=slovene,
- hyphenmins={2,2},
- langtag=SLV,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{slovenian}{sl}
-
-% Babel aliases
-\setlanguagealias{slovenian}{slovene}
-
-\define@boolkey{slovenian}[slovenian@]{localalph}[true]{}
-
-% Register default options
-\xpg@initialize@gloss@options{slovenian}{localalph=false}
-
-
-\def\captionsslovenian{%
- \def\refname{Literatura}%
- \def\abstractname{Povzetek}%
- \def\bibname{Literatura}%
- \def\prefacename{Predgovor}%
- \def\chaptername{Poglavje}%
- \def\appendixname{Dodatek}%
- \def\contentsname{Kazalo}%
- \def\listfigurename{Slike}%
- \def\listtablename{Tabele}%
- \def\indexname{Stvarno kazalo}%
- \def\figurename{Slika}%
- \def\tablename{Tabela}%
- %\def\thepart{}%
- \def\partname{Del}%
- \def\pagename{Stran}%
- \def\seename{glej}%
- \def\alsoname{glej tudi}%
- \def\enclname{Priloge}%
- \def\ccname{Kopije}%
- \def\headtoname{Prejme}%
- \def\proofname{Dokaz}%
- \def\glossaryname{Slovar}%
-}
-
-\def\dateslovenian{%
- \def\today{\number\day.~\ifcase\month\or
- januar\or februar\or marec\or april\or maj\or junij\or
- julij\or avgust\or september\or oktober\or november\or december\fi
- \space \number\year}%
-}
-
-\def\slovenian@alph#1{%
- \ifcase#1\or a\or b\or c\or č\or d\or e\or f\or g\or h\or i\or j\or k\or l\or
- m\or n\or o\or p\or r\or s\or š\or t\or u\or v\or z\or ž\else#1\fi
-}
-\def\slovenian@Alph#1{%
- \ifcase#1\or A\or B\or C\or Č\or D\or E\or F\or G\or H\or I\or J\or K\or L\or
- M\or N\or O\or P\or R\or S\or Š\or T\or U\or V\or Z\or Ž\else#1\fi
-}
-
-\def\abeceda#1{\expandafter\slovenian@alph\csname c@#1\endcsname}
-\def\Abeceda#1{\expandafter\slovenian@Alph\csname c@#1\endcsname}
-
-\def\extras@slovenian{%
- \ifslovenian@localalph\let\alph\abeceda\let\Alph\Abeceda\fi%
-}
-
-\def\blockextras@slovenian{\extras@slovenian}
-
-\def\inlineextras@slovenian{\extras@slovenian}
-
-\def\noextras@slovenian{%
- \let\alph\latinalph\let\Alph\latinAlph%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-slovenian.ldf>
-%<*gloss-sorbian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-sorbian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-sorbian.ldf}[polyglossia: module for Sorbian]
-
-\PolyglossiaSetup{sorbian}{
- bcp47=hsb,
- bcp47-language=hsb,
- bcp47-script=Latn,
- language=Upper Sorbian,
- babelname=uppersorbian,
- hyphennames={usorbian,uppersorbian},
- langtag=USB,
- hyphenmins={2,2},
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*[variant=upper]{sorbian}{hsb}
-\setlanguagealias*[variant=lower]{sorbian}{dsb}
-% Backwards compat. aliases
-\setlanguagealias[variant=lower]{sorbian}{lsorbian}
-\setlanguagealias[variant=upper]{sorbian}{usorbian}
-
-% Babel aliases
-\setlanguagealias[variant=lower]{sorbian}{lowersorbian}
-\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]{}
-
-% Register default options
-\xpg@initialize@gloss@options{sorbian}{variant=upper,olddate=false}
-
-
-\def\sorbian@language{%
- \polyglossia@setup@language@patterns{\sorbian@variant}%
-}%
-
-
-\def\captionssorbian@lsorbian{%
- \def\refname{Referency}%
- \def\abstractname{Abstrakt}%
- \def\bibname{Literatura}%
- \def\prefacename{Zawod}%
- \def\chaptername{Kapitl}%
- \def\appendixname{Dodawki}%
- \def\contentsname{Wopśimjeśe}%
- \def\listfigurename{Zapis wobrazow}%
- \def\listtablename{Zapis tabulkow}%
- \def\indexname{Indeks}%
- \def\figurename{Wobraz}%
- \def\tablename{Tabulka}%
- %\def\thepart{}%
- \def\partname{Źěl}%
- \def\pagename{Strona}%
- \def\seename{gl.}%
- \def\alsoname{gl.~teke}%
- \def\enclname{Pśiłoga}%
- \def\ccname{CC}%
- \def\headtoname{Komu}%
- \def\proofname{Proof}%
- \def\glossaryname{Glossary}%
-}
-
-\def\captionssorbian@usorbian{%
- \def\refname{Referency}%
- \def\abstractname{Abstrakt}%
- \def\bibname{Literatura}%
- \def\prefacename{Zawod}%
- \def\chaptername{Kapitl}%
- \def\appendixname{Dodawki}%
- \def\contentsname{Wobsah}%
- \def\listfigurename{Zapis wobrazow}%
- \def\listtablename{Zapis tabulkow}%
- \def\indexname{Indeks}%
- \def\figurename{Wobraz}%
- \def\tablename{Tabulka}%
- %\def\thepart{}%
- \def\partname{Dźěl}%
- \def\pagename{Strona}%
- \def\seename{hl.}%
- \def\alsoname{hl.~tež}%
- \def\enclname{Přłoha}%
- \def\ccname{CC}%
- \def\headtoname{Komu}%
- \def\proofname{Proof}% <-- needs translation
- \def\glossaryname{Glossary}% <-- needs translation
-}%
-
-\def\captionssorbian{%
- \csname captionssorbian@\sorbian@variant\endcsname%
-}
-
-\def\datesorbian@lsorbian{%
- \def\oldtoday{%
- \number\day.~\ifcase\month\or
- wjelikego rožka\or małego rožka\or nalětnika\or
- jatšownika\or rožownika\or smažnika\or pražnika\or
- žnjeńca\or požnjeńca\or winowca\or nazymnika\or
- godownika\fi\space \number\year}%
- \def\today{%
- \ifsorbian@olddate
- \oldtoday%
- \else
- \number\day.~\ifcase\month\or
- januara\or februara\or měrca\or apryla\or maja\or
- junija\or julija\or awgusta\or septembra\or oktobra\or
- nowembra\or decembra\fi
- \space \number\year%
- \fi
- }%
-}
-
-\def\datesorbian@usorbian{%
- \def\oldtoday{\number\day.~\ifcase\month\or
- wulkeho róžka\or małeho róžka\or nalětnika\or
- jutrownika\or róžownika\or smažnika\or pražnika\or
- žnjenca\or požnjenca\or winowca\or nazymnika\or
- hodownika\fi \space \number\year}%
- \def\today{%
- \ifsorbian@olddate
- \oldtoday%
- \else
- \number\day.~\ifcase\month\or
- januara\or februara\or měrca\or apryla\or meje\or junija\or
- julija\or awgusta\or septembra\or oktobra\or
- nowembra\or decembra\fi
- \space \number\year%
- \fi
- }%
-}
-
-\def\datesorbian{%
- \csname datesorbian@\sorbian@variant\endcsname%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-sorbian.ldf>
-%<*gloss-spanish.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-spanish.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-spanish.ldf}[polyglossia: module for Spanish]
-
-\PolyglossiaSetup{spanish}{
- bcp47=es-ES,
- bcp47-language=es,
- bcp47-region=ES,
- bcp47-script=Latn,
- hyphennames={spanish},
- hyphenmins={2,2},
- totalhyphenmin=5,
- langtag=ESP,
- frenchspacing=true,
- indentfirst=true,
- fontsetup=true,
- babelname=spanish
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{spanish}{es}
-\setlanguagealias*[variant=mexican]{spanish}{es-MX}
-\setlanguagealias*[variant=spanish]{spanish}{es-ES}
-
-% Babel aliases
-\setlanguagealias[variant=mexican]{spanish}{spanishmx}
-
-\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'}}
-
-
-% Register default options
-\xpg@initialize@gloss@options{spanish}{variant=spanish,spanishoperators=none}
-
-\let\xpg@save@lim\lim
-\let\xpg@save@limsup\limsup
-\let\xpg@save@liminf\liminf
-\let\xpg@save@max\max
-\let\xpg@save@min\min
-\let\xpg@save@inf\inf
-\let\xpg@save@bmod\bmod
-\let\xpg@save@pmod\pmod
-
-\def\spanish@accentedoperators{%
- \DeclareRobustCommand\lim{\mathop{\operator@font lím}}%
- \DeclareRobustCommand\limsup{\mathop{\operator@font lím\,sup}}%
- \DeclareRobustCommand\liminf{\mathop{\operator@font lím\,inf}}%
- \DeclareRobustCommand\max{\mathop{\operator@font máx}}%
- \DeclareRobustCommand\min{\mathop{\operator@font mín}}%
- \DeclareRobustCommand\inf{\mathop{\operator@font ínf}}%
- \DeclareRobustCommand\bmod{%
- \nonscript\mskip-\medmuskip\mkern5mu%
- \mathbin{\operator@font mód}\penalty900\mkern5mu%
- \nonscript\mskip-\medmuskip}%
- \@ifundefined{@amsmath@err}%
- {\DeclareRobustCommand\pmod[1]{%
- \allowbreak\mkern18mu({\operator@font mód}\,\,##1)}}%
- {\let\xpg@save@mod\mod
- \DeclareRobustCommand\mod[1]{\allowbreak\if@display\mkern18mu
- \else\mkern12mu\fi{\operator@font mód}\,\,##1}%
- \DeclareRobustCommand\pmod[1]{\pod{{\operator@font mód}%
- \mkern6mu##1}}}%
-}
-
-\def\nospanish@accentedoperators{%
- \let\lim\xpg@save@lim%
- \let\limsup\xpg@save@limsup%
- \let\liminf\xpg@save@liminf%
- \let\max\xpg@save@max%
- \let\min\xpg@save@min%
- \let\inf\xpg@save@inf%
- \let\bmod\xpg@save@bmod%
- \let\pmod\xpg@save@pmod%
- \@ifundefined{@amsmath@err}{}{\let\mod\xpg@save@mod}%
-}
-
-\let\xpg@save@arccos\arccos
-\let\xpg@save@arcsin\arcsin
-\let\xpg@save@arctan\arctan
-\let\arcsen\arcsin
-\let\arctg\arctan
-
-
-\def\spanish@spacedoperators{%
- \DeclareRobustCommand\arccos{\mathop{\operator@font arc\,cos}\nolimits}%
- \DeclareRobustCommand\arcsin{\mathop{\operator@font arc\,sen}\nolimits}%
- \DeclareRobustCommand\arctan{\mathop{\operator@font arc\,tg}\nolimits}%
-}
-
-\def\nospanish@spacedoperators{%
- \let\arccos\xpg@save@arccos%
- \let\arcsen\arcsin%
- \let\arctg\arctan%
-}
-
-
-\let\xpg@save@sin\sin
-\let\xpg@save@tan\tan
-\let\xpg@save@sinh\sinh
-\let\xpg@save@tanh\tanh
-\let\sen\sin
-\let\tg\tan
-\let\senh\sinh
-\let\tgh\tanh
-
-\def\spanish@locoperators{%
- \DeclareRobustCommand\sin{\mathop{\operator@font sen}\nolimits}%
- \DeclareRobustCommand\tan{\mathop{\operator@font tg}\nolimits}%
- \DeclareRobustCommand\sinh{\mathop{\operator@font senh}\nolimits}%
- \DeclareRobustCommand\tanh{\mathop{\operator@font tgh}\nolimits}%
-}
-
-\def\nospanish@locoperators{%
- \let\sen\xpg@save@sin%
- \let\tg\xpg@save@tan%
- \let\sinh\xpg@save@sinh%
- \let\tanh\xpg@save@tanh%
- \let\sen\relax%
- \let\tg\relax%
- \let\senh\relax%
- \let\tgh\relax%
-}
-
-% Use \providecommand here as the ldf file might
-% be reloaded via babel aliases.
-\providecommand*\spanishoperator[2][]{%
- \ifx#1\\\\
- \protected@csxdef{#2}{\mathop{\operator@font #2}\nolimits}%
- \else
- \protected@csxdef{#2}{\mathop{\operator@font #1}\nolimits}%
- \fi
-}
-
-\def\captionsspanish{%
- \def\prefacename{Prefacio}%
- \def\refname{Referencias}%
- \def\abstractname{Resumen}%
- \def\bibname{Bibliografía}%
- \def\chaptername{Capítulo}%
- \def\appendixname{Apéndice}%
- \def\contentsname{Índice general}%
- \def\listfigurename{Índice de figuras}%
- \def\listtablename{Índice de cuadros}%
- \def\indexname{Índice alfabético}%
- \def\figurename{Figura}%
- \def\tablename{Cuadro}%
- \def\partname{Parte}%
- \def\enclname{Adjunto(s)}%
- \def\ccname{Copia a}%
- \def\headtoname{A}%
- \def\pagename{Página}%
- \def\seename{véase}%
- \def\alsoname{véase también}%
- \def\proofname{Prueba}%
- \def\glossaryname{Glosario}%
- \if@spanish@mexico
- \captionsspanish@mexico%
- \fi%
-}
-
-\def\captionsspanish@mexico{%
- \def\tablename{Tabla}%
-}
-
-\def\datespanish{%
- \def\today{\number\day~de~\ifcase\month\or
- enero\or febrero\or marzo\or abril\or mayo\or junio\or
- julio\or agosto\or septiembre\or octubre\or noviembre\or
- diciembre\fi\space de~\number\year}%
-}
-
-\def\noextras@spanish{%
- \nospanish@accentedoperators%
- \nospanish@spacedoperators%
- \nospanish@locoperators%
-}
-
-\def\blockextras@spanish{%
- \ifspanish@accentedoperators\spanish@accentedoperators\fi%
- \ifspanish@spacedoperators\spanish@spacedoperators\fi%
- \ifspanish@locoperators\spanish@locoperators\fi%
-}
-
-\def\inlineextras@spanish{%
- \ifspanish@accentedoperators\spanish@accentedoperators\fi%
- \ifspanish@spacedoperators\spanish@spacedoperators\fi%
- \ifspanish@locoperators\spanish@locoperators\fi%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-spanish.ldf>
-%<*gloss-spanishmx.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-spanishmx.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-spanishmx.ldf}[polyglossia: module for Mexican Spanish]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{spanish}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-spanishmx.ldf>
-%<*gloss-swedish.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-swedish.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-swedish.ldf}[polyglossia: module for Swedish]
-
-\PolyglossiaSetup{swedish}{
- bcp47=sv,
- bcp47-language=sv,
- bcp47-script=Latn,
- hyphennames={swedish},
- hyphenmins={2,2},
- langtag=SVE,
- frenchspacing=true,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{swedish}{sv}
-
-\def\captionsswedish{%
- \def\refname{Referenser}%
- \def\abstractname{Sammanfattning}%
- \def\bibname{Litteraturförteckning}%
- \def\prefacename{Förord}%
- \def\chaptername{Kapitel}%
- \def\appendixname{Bilaga}%
- \def\contentsname{Innehåll}%
- \def\listfigurename{Figurer}%
- \def\listtablename{Tabeller}%
- \def\indexname{Sakregister}%
- \def\figurename{Figur}%
- \def\tablename{Tabell}%
- %\def\thepart{}%
- \def\partname{Del}%
- \def\pagename{Sida}%
- \def\seename{se}%
- \def\alsoname{se även}%
- \def\enclname{Bil.}%
- \def\ccname{Kopia för kännedom}%
- \def\headtoname{Till}%
- \def\proofname{Bevis}%
- \def\glossaryname{Ordlista}%
- }
-
-\def\dateswedish{%
- \def\today{%
- \number\day~\ifcase\month\or
- januari\or februari\or mars\or april\or maj\or juni\or
- juli\or augusti\or september\or oktober\or november\or
- december\fi
- \space\number\year}%
- \def\datesymd{%
- \def\today{\number\year-\two@digits\month-\two@digits\day}}%
- \def\datesdmy{%
- \def\today{\number\day/\number\month\space\number\year}}%
- }
-
-% \end{macrocode}
-% \iffalse
-%</gloss-swedish.ldf>
-%<*gloss-swissgerman.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-swissgerman.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-swissgerman.ldf}[polyglossia: module for Swiss German (old spelling)]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{german}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-swissgerman.ldf>
-%<*gloss-syriac.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-syriac.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-syriac.ldf}[polyglossia: module for Syriac]
-
-\RequireBidi
-\RequirePackage{arabicnumbers}
-
-\PolyglossiaSetup{syriac}{
- bcp47=syr,
- bcp47-language=syr,
- bcp47-script=Syrc,
- script=Syriac,
- scripttag=syrc,
- langtag=SYR,
- direction=RL,
- hyphennames={syriac,nohyphenation},
- fontsetup=true,
- localnumeral=syriacnumerals
- %TODO localalph
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{syriac}{syr}
-
-\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}%
-}
-
-% Register default options
-\xpg@initialize@gloss@options{syriac}{numerals=western}
-
-%\define@key{polyglossia}{syriaclocale}[default]{%
-% \def\@syriac@locale{#1}}
-%
-%\def\captionssyriac{%
-%\def\prefacename{\@ensure@RTL{}}%
-%\def\refname{\@ensure@RTL{}}
-%\def\abstractname{\@ensure@RTL{}}%
-%\def\bibname{\@ensure@RTL{}}%
-%\def\chaptername{\@ensure@RTL{}}%
-%\def\appendixname{\@ensure@RTL{}}%
-%\def\contentsname{\@ensure@RTL{}}
-%\def\listfigurename{\@ensure@RTL{}}%
-%\def\listtablename{\@ensure@RTL{}}%
-%\def\indexname{\@ensure@RTL{}}%
-%\def\figurename{\@ensure@RTL{}}%
-%\def\tablename{\@ensure@RTL{}}%
-%\def\partname{\@ensure@RTL{}}%
-%\def\enclname{\@ensure@RTL{}}%
-%\def\ccname{\@ensure@RTL{}}%
-%\def\headtoname{\@ensure@RTL{}}%
-%\def\pagename{\@ensure@RTL{}}%
-%\def\seename{\@ensure@RTL{}}%
-%\def\alsoname{\@ensure@RTL{}}%
-%\def\proofname{\@ensure@RTL{}}%
-%\def\glossaryname{\@ensure@RTL{}}%
-%}
-
-\def\datesyriac{%
- \def\syriac@month##1{\ifcase##1%
- \or ܟܢܘܢ ܐܚܪܝ\or ܫܒܛ\or ܐܕܪ\or ܢܝܣܢ\or ܐܝܪ\or ܚܙܝܪܢ\or ܬܡܘܙ\or ܐܒ\or ܐܝܠܘܠ% ܐܠܘܠ
- \or ܬܫܪܝܢ ܩܕܡ% ܬܫܪܝܢ ܩܕܝܡ
- \or ܬܫܪܝܢ ܐܚܪܝ\or ܟܢܘܢ ܩܕܡ% ܟܢܘܢ ܩܕܝܡ
- \fi}%
- \def\today{\@ensure@RTL{\syriacnumber\day{\space}%
- \syriac@month{\month}{\space}\syriacnumber\year}}%
-}
-
-\def\syriac@zero{}
-
-\def\abjadsyriac#1{%
-\ifnum#1>9999\xpg@ill@value{#1}{abjadsyriac}%
-\else%
- \ifnum#1<\z@\space\xpg@ill@value{#1}{abjadsyriac}%
- \else%
- \ifnum#1<10\expandafter\abj@syr@num@i\number#1%
- \else%
- \ifnum#1<100\expandafter\abj@syr@num@ii\number#1%
- \else%
- \ifnum#1<1000\expandafter\abj@syr@num@iii\number#1%
- \else%
- \expandafter\abj@syr@num@iv\number#1%
- \fi%
- \fi%
- \fi%
- \fi%
-\fi%
-}
-\def\abj@syr@num@i#1{%
- \ifcase#1\or\char"0710\or\char"0712\or\char"0713\or\char"0715%
- \or\char"0717\or\char"0718\or\char"0719\or\char"071A\or\char"071B\fi
- \ifnum#1=\z@\syriac@zero\fi}
-\def\abj@syr@num@ii#1{%
- \ifcase#1\or\char"071D\or\char"071F\or\char"0720\or\char"0721\or\char"0722%
- \or\char"0723\or\char"0725\or\char"0726\or\char"0728\fi
- \ifnum#1=\z@\fi\abj@syr@num@i}
-\def\abj@syr@num@iii#1{%
- \ifcase#1\or\char"0729\or\char"072A\or\char"072B\or\char"072C%
- \or\char"0722\char"0307\or\char"0723\char"0307\or\char"0725\char"0307%
- \or\char"0726\char"0307\or\char"0728\char"0307\fi
- \ifnum#1=\z@\fi\abj@syr@num@ii}
-\def\abj@syr@num@iv#1{%
- \ifcase#1\or\char"0710\char"0748\or\char"0712\char"0748%
- \or\char"0713\char"0748\or\char"0715\char"0748%
- \or\char"0717\char"0748\or\char"0718\char"0748%
- \or\char"0719\char"0748\or\char"071A\char"0748\or\char"071B\char"0748\fi
- \ifnum#1=\z@\fi\abj@syr@num@iii}
-
-\def\@syriacnumber#1{%
- \if@eastern@numerals
- %%% we test for the presence of one of ١٢٣٤٥٦٧٨٩٠ in the Syriac font,
- %%% else we try \arabicfont if defined (and give a warning),
- %%% else we fall back to the Western numerals.
- \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}}%
- {\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}}%
- }%
- \else
- %%\RL{\protect\reset@font\number#1}%
- \number#1%
- \fi%
-}
-
-\def\syriac@numbers{%
- \let\@alph\abjadsyriac%
- \let\@Alph\abjadsyriac%
-}
-
-\def\nosyriac@numbers{%
- \let\@alph\latin@alph%
- \let\@Alph\latin@Alph%
-}
-
-\newcommand{\syriacnumerals}[2]{\syriacnumber{#2}}
-
-% Store original definition
-\let\xpg@save@arabic\@arabic
-
-\def\syriac@globalnumbers{%
- \let\@arabic\syriacnumber%
- \renewcommand\thefootnote{\localnumeral*{footnote}}%
-}
-
-\def\nosyriac@globalnumbers{%
- \let\@arabic\xpg@save@arabic%
-}
-
-\def\syriac@xetex@capsformat{%
- \let\xpg@save@sepmark\@SepMark%
- \SepMark{\xpg@sepmark}
-}
-
-\def\nosyriac@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
- \SepMark{\xpg@save@sepmark}
- }{}%
-}
-
-\def\syriac@luatex@capsformat{%
- %
- % change chapter and part headings
- \ifsyriac@customsep
- \ifcsdef{chapter}{%
- \let\xpg@save@thesection\thesection%
- \renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
- \let\xpg@save@theequation\theequation%
- \renewcommand*\theequation{%
- \ifnum \c@chapter>\z@ \thechapter\xpg@sepmark\fi\@arabic\c@equation}
- \let\xpg@save@thefigure\thefigure%
- \renewcommand*\thefigure{%
- \ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@figure}
- \let\xpg@save@thetable\thetable%
- \renewcommand*\thetable{%
- \ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
- \let\xpg@save@thesubsection\thesubsection%
- \renewcommand\thesubsection
- {\thesection\xpg@sepmark\@arabic\c@subsection}
- \let\xpg@save@thesubsubsection\thesubsubsection%
- \renewcommand\thesubsubsection{\thesubsection\xpg@sepmark\@arabic\c@subsubsection}
- \let\xpg@save@theparagraph\theparagraph%
- \renewcommand\theparagraph
- {\thesubsubsection\xpg@sepmark\@arabic\c@paragraph}
- \let\xpg@save@thesubparagraph\thesubparagraph%
- \renewcommand\thesubparagraph{\theparagraph\xpg@sepmark\@arabic\c@subparagraph}
- \fi% (end \ifsyriac@customsep)
-}
-
-\def\nosyriac@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%
- }{}%
-}
-
-\def\blockextras@syriac{%
- \ifsyriac@customsep
- \ifxetex
- \syriac@xetex@capsformat
- \else
- \syriac@luatex@capsformat
- \fi
- \fi
-}
-%
-\def\noextras@syriac{%
- \ifsyriac@customsep
- \ifxetex
- \nosyriac@xetex@capsformat
- \else
- \nosyriac@luatex@capsformat
- \fi
- \fi
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-syriac.ldf>
-%<*gloss-tamil.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-tamil.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-tamil.ldf}[polyglossia: module for Tamil]
-
-% Translations provided by Kevin & Siji, 01-11-2009
-
-\PolyglossiaSetup{tamil}{
- bcp47=ta,
- bcp47-language=ta,
- bcp47-script=Taml,
- script=Tamil,
- scripttag=taml,
- langtag=TAM,
- hyphennames={tamil},
- hyphenmins={2,2}, %FIXME?
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{tamil}{ta}
-
-\def\captionstamil{%
- \def\abstractname{சாராம்சம்}%
- \def\appendixname{பிற்சேர்க்கை}%பின்னிணைப்பு
- %\def\bibname{}%
- %\def\ccname{}%
- \def\chaptername{அத்தியாயம்}%
- \def\contentsname{உள்ளே}%
- %\def\enclname{}%
- \def\figurename{படம்}%
- %\def\headpagename{}%
- %\def\headtoname{}%
- \def\indexname{சுட்டி}%பொருளடக்க அட்டவணை
- \def\listfigurename{படங்களின் பட்டியல்}%
- \def\listtablename{அட்டவணை பட்டியல்}%
- %\def\pagename{}%
- \def\partname{பகுதி}%
- %\def\prefacename{}%
- %\def\refname{}%
- \def\tablename{அட்டவணை}%
- \def\seename{பார்க்க}%
- %\def\alsoname{}%
- %\def\alsoseename{}%
-}
-\def\datetamil{%
- \def\today{\number\year\space\ifcase\month\or
- ஜனவரி\or
- பிப்ரவரி\or
- மார்ச்\or
- ஏப்ரல்\or
- மே\or
- ஜூன்\or
- ஜூலை\or
- ஆகஸ்ட்\or
- செப்டம்பர்\or
- அக்டோபர்\or
- நவம்பர்\or
- டிசம்பர்\fi
- \space\number\day}%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-tamil.ldf>
-%<*gloss-telugu.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-telugu.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-telugu.ldf}[polyglossia: module for Telugu]
-
-% Translations provided by Anmol Sharma <unmole.in@gmail.com>
-
-\PolyglossiaSetup{telugu}{
- bcp47=te,
- bcp47-language=te,
- bcp47-script=Telu,
- script=Telugu,
- scripttag=telu,
- langtag=TEL,
- hyphennames={telugu},
- hyphenmins={2,2}, %FIXME
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{telugu}{te}
-
-\def\captionstelugu{%
- \def\refname{ఆధారాలు}%
- \def\abstractname{సారాంశం}%
- \def\bibname{గ్రంథాల జాబితా}%
- \def\prefacename{ముందుమాట}%
- \def\chaptername{అధ్యాయము}%
- \def\appendixname{అదనంగా}%
- \def\contentsname{విషయాలు}%
- \def\listfigurename{ఆకృతుల జాబితా}%
- \def\listtablename{పట్టికల జాబితా}%
- \def\indexname{విషయ సూచిక}%
- \def\figurename{ఆకృతి}%
- \def\tablename{పట్టిక}%
- %\def\thepart{}%
- \def\partname{భాగం}%
- \def\pagename{పేజి}%
- \def\seename{చూడండి}%
- \def\alsoname{కూడా చూడండి}%
- \def\enclname{ఎంక్లోజర్*}%
- \def\ccname{సిసి}%
- \def\headtoname{కి}%
- \def\proofname{రుజువు}%
- \def\glossaryname{నిఘంటువు}%
-}
-
-\def\datetelugu{%
- \def\telugu@month{%
- \ifcase\month\or
- జనవరి\or
- ఫిబ్రవరి\or
- మార్చ్\or
- ఏప్రిల్\or
- మే\or
- జూన్\or
- జూలై\or
- ఆగస్ట్\or
- సెప్టెంబర్\or
- అక్తోబెర్\or
- నవంబర్\or
- డిసంబర్\fi}%
- \def\today{\telugu@month\space\number\day,\space\number\year}%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-telugu.ldf>
-%<*gloss-thai.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-thai.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-thai.ldf}[polyglossia: module for Thai]
-%% This is partly based on thai-latex for Babel:
-%%%% Copyright (C) 1999 - 2006
-%%%% by Surapant Meknavin,
-%%%% Theppitak Karoonboonyanan (thep at linux.thai.net),
-%%%% Chanop Silpa-Anan (chanop at debian.org),
-%%%% Poonlap Veerathanabutr (poonlap at linux.thai.net)
-%%%% Thai Linux Working Group
-%%%% http://linux.thai.net/
-%%%%
-\PolyglossiaSetup{thai}{
- bcp47=th,
- bcp47-language=th,
- bcp47-script=Thai,
- script=Thai,
- scripttag=thai,
- langtag=THA,
- hyphennames={nohyphenation},
- fontsetup=true,
- localnumeral=thainumerals
- %TODO localalph={xxx@alph,xxx@Alph}
- %TODO localdigits=thainumber
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{thai}{th}
-
-\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
-}
-
-% Register default options
-\xpg@initialize@gloss@options{thai}{numerals=arabic}
-
-\def\captionsthai{%
- \def\refname{หนังสืออ้างอิง}%
- \def\abstractname{บทคัดย่อ}%
- \def\bibname{บรรณานุกรม}%
- \def\prefacename{คำนำ}%
- \def\chaptername{บทที่}%
- \def\appendixname{ภาคผนวก}%
- \def\contentsname{สารบัญ}%
- \def\listfigurename{สารบัญรูป}%
- \def\listtablename{สารบัญตาราง}%
- \def\indexname{ดรรชนี}%
- \def\figurename{รูปที่}%
- \def\tablename{ตารางที่}%
- %\def\thepart{}%
- \def\partname{ภาค}%
- \def\pagename{หน้า}%
- \def\seename{ดู}%
- \def\alsoname{ดูเพิ่มเติม}%
- \def\enclname{สิ่งที่แนบมาด้วย}%
- \def\ccname{สำเนาถึง}%
- \def\headtoname{เรียน}%
- \def\proofname{พิสูจน์}%
- %\def\glossaryname{}%
-}
-\def\datethai{%
- \def\thai@month{%
- \ifcase\month\or
- มกราคม\or กุมภาพันธ์\or มีนาคม\or เมษายน%
- \or พฤษภาคม\or มิถุนายน\or กรกฎาคม\or สิงหาคม%
- \or กันยายน\or ตุลาคม\or พฤศจิกายน\or ธันวาคม\fi}%
- \newcount\thai@year%
- \thai@year=\year%
- \advance\thai@year by 543%
- \def\today{\thainumber\day \space \thai@month\space พ.ศ.~\thainumber\thai@year}%
-}
-
-%NB: thai-latex had "plus 0.6pt", but .4em appears to give better results
-% FIXME to avoid name clashes, rename \wbr to \wordbreak or \thaiworkbreak ?
-\def\wbr{\hskip0pt plus .4em\relax} %%OR \char"200B = ZWSP ? Does not work
-%\catcode"200b=\active
-%\def^^200b{\hskip 0pt plus .4em}
-
-\def\thaidigits#1{\expandafter\@thai@digits #1@}
-\def\@thai@digits#1{%
- \ifx @#1% then terminate
- \else
- \ifx0#1๐\else\ifx1#1๑\else\ifx2#1๒\else\ifx3#1๓\else\ifx4#1๔\else\ifx5#1๕\else\ifx6#1๖\else\ifx7#1๗\else\ifx8#1๘\else\ifx9#1๙\else#1\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
- \expandafter\@thai@digits
- \fi
-}
-
-\newcommand{\thainumerals}[2]{\thainumber{#2}}
-
-\def\thainumber#1{%
- \if@thai@numerals
- \thaidigits{\number#1}%
- %%{\protect\addfontfeature{Mapping=thaidigits}\protect\number#1}
- \else
- \number#1%
- %%{\protect\reset@font\number#1}
- \fi}
-
-\def\@thaialph#1{%
- \ifcase#1\or ก\or ข\or ค\or ง\or จ\or ฉ\or ช\or ซ\or ฌ\or ญ\or ฎ\or
- ฏ\or ฐ\or ฑ\or ฒ\or ณ\or ด\or ต\or ถ\or ท\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}{@thaialph}\fi}
-\def\thaiAlph#1{\expandafter\@thaiAlph\csname c@#1\endcsname}
-\def\@thaiAlph#1{%
- \ifcase#1\or ก\or ข\or ฃ\or ค\or ฅ\or ฆ\or ง\or จ\or ฉ\or ช\or ซ\or
- ฌ\or ญ\or ฎ\or ฏ\or ฐ\or ฑ\or ฒ\or ณ\or ด\or ต\or ถ\or ท\or ธ\or น\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}{@thaialph}\fi}
-
-\def\thai@numbers{%
- \if@thai@numerals
- \let\@alph\@thaialph%
- \let\@Alph\@thaiAlph%
- \fi
-}
-\def\nothai@numbers{%
- \let\@alph\latin@alph%
- \let\@Alph\latin@Alph%
-}
-
-\def\thai@globalnumbers{%
- \let\orig@arabic\@arabic%
- \let\@arabic\thainumber%
- \renewcommand{\thefootnote}{\localnumeral*{footnote}}%
-}
-\def\nothai@globalnumbers{%
- \let\@arabic\orig@arabic%
-}
-
-\def\blockextras@thai{%
-%%TODO \XeTeXlinebreaklocales "th"% uses ICU to find line breaks on the basis of a dictionary lookup-- make this optional? (in case a user might prefer a preprocessor
- \let\orig@baselinestrech\baselinestretch%
- \renewcommand{\baselinestretch}{1.2}%
-}
-\def\noblockextras@thai{%
-%%TODO \XeTeXlinebreaklocales "en"%
- \let\baselinestrech\orig@baselinestretch%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-thai.ldf>
-%<*gloss-tibetan.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-tibetan.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-tibetan.ldf}[polyglossia: module for Tibetan]
-%% Copyright 2013 Elie Roux
-%% Under the CC0 license <http://creativecommons.org/publicdomain/zero/1.0/>
-%%
-%% A good font to make tests is \newfontfamily\tibetanfont{Tibetan Machine Uni}
-%%
-
-\PolyglossiaSetup{tibetan}{
- bcp47=bo,
- bcp47-language=bo,
- bcp47-script=Tibt,
- script=Tibetan,
- scripttag=tibt,
- langtag=TIB,
- hyphennames={nohyphenation},
- fontsetup=true,
- localnumeral=tibetannumerals
- %TODO localalph={xxx@alph,xxx@Alph}
-}
-
-% BCP-47 compliant aliases
-\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%
-}
-
-\ifluatex
- \newluatexattribute\xpg@tibteol %
- \directlua{polyglossia.load_tibt_eol()}%
-\fi
-
-\def\tibetan@eol{%
- \ifluatex%
- \xpg@tibteol=1\relax%
- \directlua{polyglossia.activate_tibt_eol()}%
- \else%
- \XeTeXlinebreaklocale "bo"%
- \XeTeXlinebreakskip=0pt plus 0.1em% doesn't do much, but doesn't harm I guess...
- \fi%
-}
-
-\def\notibetan@eol{%
- \ifluatex%
- \xpg@tibteol=0\relax%
- %\directlua{polyglossia.activate_tibt_eol()}%
- \else%
- \XeTeXlinebreaklocale "en"% en? really?
- \XeTeXlinebreakskip=0pt plus 0pt%
- \fi%
-}
-
-% Register default options
-\xpg@initialize@gloss@options{tibetan}{numerals=tibetan}
-
-% some are known, but very few
-% a few come from "Standardizing Tibetan Terms of Information Technology"
-% from the China Tibetology Research Center
-\def\captionstibetan{%
- %\def\refname{}%
- \def\abstractname{གནད་བསྡུས།}%
- \def\bibname{དཔེ་ཆའི་ཐོ་གཞུང་།}% or dpe deb kyi re'u mig?
- \def\prefacename{དཔེ་དེབ་ཀྱི་གླེང་བརྗོད།}% or gleng brjod 'god pa or ngo sprod?
- \def\chaptername{ལེའུ་}%
- \def\appendixname{ཞར་བྱུང་།}%
- \def\contentsname{དཀར་ཆག།}%
- %\def\listfigurename{}%
- %\def\listtablename{}%
- \def\indexname{གསུལ་བྱང་།}%
- \def\figurename{པར་རིས་}% or dpe ris?
- \def\tablename{རེའུ་མིག་}%
- %\def\thepart{}%
- \def\partname{ཆ་ཤས་}%
- \def\pagename{ཤོག་}%
- %\def\seename{}%
- %\def\alsoname{}%
- %\def\enclname{}%
- \def\ccname{འདྲ་བཤུས་ལེན་མཁན་}%
- %\def\headtoname{}%
- \def\proofname{བདེན་དཔང་།}% not sure about this one...
- \def\glossaryname{མིང་ཚིག་རེའུ་མིག།}%
-}
-
-\def\datetibetan{%
- \def\tibetan@month{%
- \ifcase\month\or
- ཟླ་དང་པོ\or ཟླ་གཉིས་པ\or ཟླ་གསུམ་པ%
- \or ཟླ་བཞི་པ\or ཟླ་ལྔ་པ\or ཟླ་དྲུག་པ\or ཟླ་བདུན་པ%
- \or ཟླ་བརྒྱད་པ\or ཟླ་དགུ་པ\or ཟླ་བཆུ་པ\or ཟླ་བཆུ་གཅིག་པ\or ཟླ་བཆུ་གཉིས་པ\fi}%
- \def\tibetan@daynum{%
- \ifcase\day\or དང་པོ\or གཉིས་པ\or གསུམ་པ \or བཞི་པ\or ལྔ་པ\or དྲུག་པ\or བདུན་པ\or བརྒྱད་པ\or དགུ་པ\or བཆུ་པ%
- \or བཆུ་གཅིག་པ\or བཆུ་གཉིས་པ\or བཆུ་གསུམ་པ\or བཆུ་བཞི་པ\or བཆུ་ལྔ་པ\or བཆུ་དྲུག་པ\or བཆུ་བདུན་པ\or བཆུ་བརྒྱད་པ\or བཆུ་དགུ་པ\or ཉི་ཤུ་པ%
-
- \or ཉི་ཤུ་རྩ་གཅིག་པ\or ཉི་ཤུ་རྩ་གཉིས་པ\or ཉི་ཤུ་རྩ་གསུམ་པ\or ཉི་ཤུ་རྩ་བཞི་པ\or ཉི་ཤུ་རྩ་ལྔ་པ\or ཉི་ཤུ་རྩ་དྲུག་པ\or ཉི་ཤུ་རྩ་བདུན་པ\or ཉི་ཤུ་རྩ་བརྒྱད་པ\or ཉི་ཤུ་རྩ་དགུ་པ\or སུམ་ཆུ་པ%
- \or སུམ་ཆུ་སོ་གཅིག་པ\fi}%
- % As we use gregorian calendar, it's better to stick with spyi lo
- %\newcount\tibetan@year%
- %\tibetan@year=\year%
- %\advance\tibetan@year by 127% this is bod rgyal lo, the most common, but there are others...
- % I'm not sure the / character is in most tibetan fonts
- %\def\today{\tibetannumber\day /\tibetannumber\day /\tibetannumber\year}%
- \def\today{\tibetannumber\day །\tibetannumber\month །\tibetannumber\year}%
- % this is more litterate, but longer
- %\def\today{སྤྱི་ལོ་\tibetannumber\year ་སྤྱི་\tibetan@month{}་ད་རེས་\tibetan@daynum{}།}%
-}
-
-\def\tibetandigits#1{\expandafter\@tibetan@digits #1@}
-
-\def\@tibetan@digits#1{%
- \ifx @#1% then terminate
- \else
- \ifx0#1༠\else\ifx1#1༡\else\ifx2#1༢\else\ifx3#1༣\else\ifx4#1༤\else\ifx5#1༥\else\ifx6#1༦\else\ifx7#1༧\else\ifx8#1༨\else\ifx9#1༩\else#1\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
- \expandafter\@tibetan@digits
- \fi
-}
-
-\def\tibetannumber#1{%
- \if@tibetan@numerals
- \tibetandigits{\number#1}%
- %%{\protect\addfontfeature{Mapping=tibetandigits}\protect\number#1}
- \else
- \number#1%
- %%{\protect\reset@font\number#1}
- \fi}
-
-\def\@tibetanalph#1{%
- \ifcase#1\or ཀ\or ཁ\or ག\or ང\or ཅ\or ཆ\or
- ཇ\or ཉ\or ཏ\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}{@tibetanalph}%
- \fi%
-}
-
-\def\tibetanAlph#1{%
- \expandafter\@tibetanAlph\csname c@#1\endcsname%
-}
-
-\def\@tibetanAlph#1{%
- \ifcase#1\or ཀ\or ཁ\or ག\or ང\or ཅ\or ཆ\or ཇ\or
- ཉ\or ཏ\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}{@tibetanalph}%
- \fi%
-}
-
-\newcommand{\tibetanumerals}[2]{\tibetannumber{#2}}
-
-\def\tibetan@numbers{%
- \if@tibetan@numerals
- \let\@alph\@tibetanalph%
- \let\@Alph\@tibetanAlph%
- \fi
-}
-
-\def\notibetan@numbers{%
- \let\@alph\latin@alph%
- \let\@Alph\latin@Alph%
-}
-
-% Store original definition
-\let\xpg@orig@arabic\@arabic
-
-\def\tibetan@globalnumbers{%
- \let\@arabic\tibetannumber%
- \renewcommand{\thefootnote}{\localnumeral*{footnote}}%
-}
-
-\def\notibetan@globalnumbers{%
- \let\@arabic\xpg@orig@arabic%
-}
-
-\def\noextras@tibetan{%
- \notibetan@eol%
- \ifcsname xpg@orig@baselinestretch\endcsname%
- \renewcommand{\baselinestretch}{\xpg@orig@baselinestretch}%
- \fi%
-}
-
-\def\inlineextras@tibetan{%
- \xdef\xpg@orig@baselinestretch{%
- \ifcsname baselinestretch\endcsname
- \baselinestretch
- \else
- 1%
- \fi%
- }%
- \renewcommand{\baselinestretch}{1.2}%
- \tibetan@eol%
-}
-
-\def\blockextras@tibetan{%
- \xdef\xpg@orig@baselinestretch{%
- \ifcsname baselinestretch\endcsname
- \baselinestretch
- \else
- 1%
- \fi%
- }%
- \renewcommand{\baselinestretch}{1.2}%
- \tibetan@eol%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-tibetan.ldf>
-%<*gloss-turkish.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-turkish.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-turkish.ldf}[polyglossia: module for Turkish]
-\RequirePackage{hijrical}
-\PolyglossiaSetup{turkish}{
- bcp47=tr,
- bcp47-language=tr,
- bcp47-script=Latn,
- hyphennames={turkish},
- hyphenmins={2,2},
- langtag=TRK,
- frenchspacing=true,
- fontsetup=true
- }
-
-% TODO Add \ifluatex branch everywhere
-\ifxetex
-\newXeTeXintercharclass\turkish@punctthin % ! :
-\newXeTeXintercharclass\turkish@punctthick % =
-\fi
-
-\def\turkish@punctthinspace{{\ifdim\lastskip>\z@\unskip\penalty\@M\thinspace\fi}}
-\def\turkish@punctthickspace{{\unskip\nobreakspace}}
-
-\def\turkish@punctuation{%
- \ifxetex
- \XeTeXinterchartokenstate=1%
- \XeTeXcharclass `\! \turkish@punctthin
- \XeTeXcharclass `\: \turkish@punctthin
- \XeTeXcharclass `\= \turkish@punctthick
- \XeTeXinterchartoks \z@ \turkish@punctthin = \turkish@punctthinspace
- \XeTeXinterchartoks \z@ \turkish@punctthick = \turkish@punctthickspace
- \fi
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{turkish}{tr}
-
-\def\noturkish@punctuation{%
- \ifxetex
- \XeTeXcharclass `\! \z@
- \XeTeXcharclass `\: \z@
- \XeTeXcharclass `\= \z@
- \XeTeXinterchartokenstate=0%
- \fi
-}
-
-\def\turkish@casing{%
- \lccode`\I=`\ı
- \uccode`\i=`\İ
-}
-
-\def\noturkish@casing{%
- \lccode`\I=`\i
- \uccode`\i=`\I
-}
-
-\def\captionsturkish{%
- \def\prefacename{Önsöz}%
- \def\refname{Kaynaklar}%
- \def\abstractname{Özet}%
- \def\bibname{Kaynakça}%
- \def\chaptername{Bölüm}%
- \def\appendixname{Ek}%
- \def\contentsname{İçindekiler}%
- \def\listfigurename{Şekil Listesi}%
- \def\listtablename{Tablo Listesi}%
- \def\indexname{Dizin}%
- \def\figurename{Şekil}%
- \def\tablename{Tablo}%
- \def\partname{Kısım}%
- \def\enclname{İlişik}%
- \def\ccname{Diğer Alıcılar}%
- \def\headtoname{Alıcı}%
- \def\pagename{Sayfa}%
- \def\subjectname{İlgili}%
- \def\seename{bkz.}%
- \def\alsoname{ayrıca bkz.}%
- \def\proofname{Kanıt}%
- \def\glossaryname{Lügatçe}%
- }
-\def\dateturkish{%
- \def\today{\number\day~\ifcase\month\or
- Ocak\or Şubat\or Mart\or Nisan\or Mayıs\or Haziran\or
- Temmuz\or Ağustos\or Eylül\or Ekim\or Kasım\or
- Aralık\fi
- \space\number\year}%
-}
-\def\hijrimonthturkish#1{\ifcase#1%
-\or Muharrem\or Safer\or Rebiülevvel\or Rebiülahir\or Cemaziyelevvel\or Cemaziyelahir\or Recep\or Şaban\or Ramazan\or Şevval\or Zilkade\or Zilhicce\fi}
-%%\Hijritoday is now locale-aware and will format the date with this macro:
-\DefineFormatHijriDate{turkish}{%
-\number\value{Hijriday}\space\hijrimonthturkish{\value{Hijrimonth}}\space\number\value{Hijriyear}}
-
-\def\noextras@turkish{%
- \noturkish@punctuation%
- \noturkish@casing%
-}
-
-\def\blockextras@turkish{%
- \turkish@punctuation%
- \turkish@casing%
-}
-
-\def\inlineextras@turkish{%
- \turkish@punctuation%
- \turkish@casing%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-turkish.ldf>
-%<*gloss-turkmen.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-turkmen.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-turkmen.ldf}[polyglossia: module for Turkmen]
-%% Translations provided by Nazar Annagurban <nazartm at gmail dot com>
-\PolyglossiaSetup{turkmen}{
- bcp47=tk,
- bcp47-language=tk,
- bcp47-script=Latn,
- hyphennames={turkmen},
- hyphenmins={2,2},
- langtag=TKM,
- frenchspacing=false,
- fontsetup=true
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{turkmen}{tk}
-
-\def\captionsturkmen{%
- \def\prefacename{Sözbaşy}%
- \def\refname{Çeşmeler}%
- \def\abstractname{Gysgaça manysy}%
- \def\bibname{Çeşmeler}%
- \def\chaptername{Bap}%
- \def\appendixname{Goşmaça}%
- \def\contentsname{Mazmuny}%
- \def\listfigurename{Suratlaryň sanawy}%
- \def\listtablename{Tablisalaryň sanawy}%
- \def\indexname{Indeks}%
- \def\figurename{Surat}%
- \def\tablename{Tablisa}%
- \def\partname{Bölüm}%
- \def\enclname{Goşmaça}%
- \def\ccname{Iberilenler}%
- \def\headtoname{Kime}%
- \def\pagename{Sahypa}%
- \def\subjectname{Tema}%
- \def\seename{ser.}%
- \def\alsoname{şuňa-da ser.}%
- \def\proofname{Delil}%
- \def\glossaryname{Sözlük}%
-}
-\def\dateturkmen{%
- \def\today{\number\day~\ifcase\month\or
- Ýanwar\or Fewral\or Mart\or Aprel\or Maý\or Iýun\or
- Iýul\or Awgust\or Sentýabr\or Oktýabr\or Noýabr\or
- Dekabr\fi
- \space\number\year}%
-}
-% \end{macrocode}
-% \iffalse
-%</gloss-turkmen.ldf>
-%<*gloss-ug.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ug.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ug.ldf}[polyglossia: module for ug (Uyghur)]
-% BCP 47 tag for Uyghur
-
-\xpg@load@master@language{uyghur}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ug.ldf>
-%<*gloss-ukrainian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ukrainian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-ukrainian.ldf}[polyglossia: module for Ukrainian]
-% Strings taken from Babel
-% and revised by Roman Kyrylych
-
-\RequirePackage{xpg-cyrillicnumbers}
-
-\PolyglossiaSetup{ukrainian}{%
- bcp47=uk,
- bcp47-language=uk,
- bcp47-script=Cyrl,
- script=Cyrillic,
- scripttag=cyrl,
- langtag=UKR,
- hyphennames={ukrainian},
- hyphenmins={2,2},
- frenchspacing=true,
- fontsetup=true,
- localnumeral=ukrainiannumerals,
- Localnumeral=Ukrainiannumerals
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{ukrainian}{uk}
-
-\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]{}
-
-% Register default options
-\xpg@initialize@gloss@options{ukrainian}{numerals=arabic,mathfunctions=true}
-
-\define@boolkey{ukrainian}[ukrainian@]{babelshorthands}[true]{}
-
-\ifsystem@babelshorthands
- \setkeys{ukrainian}{babelshorthands=true}
-\else
- \setkeys{ukrainian}{babelshorthands=false}
-\fi
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
-
-\def\ukrainian@shorthands{%
- \xpg@activate@shorthands%
- \def\language@group{ukrainian}%
-% \declare@shorthand{ukrainian}{"`}{„}%
-% \declare@shorthand{ukrainian}{"'}{“}%
-% \declare@shorthand{ukrainian}{"<}{«}%
-% \declare@shorthand{ukrainian}{">}{»}%
- \declare@shorthand{ukrainian}{""}{\hskip\z@skip}%
- \declare@shorthand{ukrainian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
- \declare@shorthand{ukrainian}{"=}{\nobreak-\hskip\z@skip}%
- \declare@shorthand{ukrainian}{"|}{\textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}%
- \declare@shorthand{ukrainian}{"-}{%
- \def\ukrainian@sh@tmp{%
- \if\ukrainian@sh@next-\expandafter\ukrainian@sh@emdash
- \else\expandafter\ukrainian@sh@hyphen\fi
- }%
- \futurelet\ukrainian@sh@next\ukrainian@sh@tmp}%
- \def\ukrainian@sh@hyphen{%
- \nobreak\-\bbl@allowhyphens}%
- \def\ukrainian@sh@emdash##1##2{\cdash-##1##2}%
- \def\cdash##1##2##3{%
- \def\tempx@{##3}%
- \def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
- \ifx\tempx@\tempa@\@Acdash\else
- \ifx\tempx@\tempb@\@Bcdash\else
- \ifx\tempx@\tempc@\@Ccdash\else
- \errmessage{Wrong usage of cdash}\fi\fi\fi%
- }%
- \def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
- \cyrdash\hskip.2em\ignorespaces}%
- \def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
- \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%
- \def\@Ccdash{\leavevmode
- \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
- \ifx\cyrdash\undefined
- \def\cyrdash{\hbox to.8em{\textendash\hss\textendash}}%
- \fi
- \declare@shorthand{ukrainian}{",}{\nobreak\hskip.2em\ignorespaces}%
-}
-
-\def\noukrainian@shorthands{%
- \xpg@deactivate@shorthands%
-}
-
-\def\captionsukrainian{%
- \def\refname{Література}%
- \def\abstractname{Анотація}%
- \def\bibname{Бібліоґрафія}%
- \def\prefacename{Вступ}%
- \def\chaptername{Розділ}%
- \def\appendixname{Додаток}%
- \def\contentsname{Зміст}%
- \def\listfigurename{Перелік ілюстрацій}%
- \def\listtablename{Перелік таблиць}%
- \def\indexname{Покажчик}%
- \def\authorname{Іменний покажчик}% babel has "Їменний покажчик"
- \def\figurename{Рис.}%
- \def\tablename{Табл.}%
- %\def\thepart{}%
- \def\partname{Частина}%
- \def\pagename{с.}%
- \def\seename{див.}%
- \def\alsoname{див.\ також}%
- \def\enclname{вкладка}%
- \def\ccname{копія}%
- \def\headtoname{До}%
- \def\proofname{Доведення}%
- \def\glossaryname{Словник термінів}%
-}
-
-\def\dateukrainian{%
- \def\today{\number\day~\ifcase\month\or
- січня\or
- лютого\or
- березня\or
- квітня\or
- травня\or
- червня\or
- липня\or
- серпня\or
- вересня\or
- жовтня\or
- листопада\or
- грудня\fi%
- \space\number\year~р.}%
-}
-
-% The following is based on some ideas from ruscor.sty
-\def\ukrainian@capsformat{%
- \def\@seccntformat##1{\csname pre##1\endcsname%
- \csname the##1\endcsname%
- \csname post##1\endcsname}%
- \def\@aftersepkern{\hspace{0.5em}}%
- \def\postchapter{.\@aftersepkern}%
- \def\postsection{.\@aftersepkern}%
- \def\postsubsection{.\@aftersepkern}%
- \def\postsubsubsection{.\@aftersepkern}%
- \def\postparagraph{.\@aftersepkern}%
- \def\postsubparagraph{.\@aftersepkern}%
- \def\prechapter{}%
- \def\presection{}%
- \def\presubsection{}%
- \def\presubsubsection{}%
- \def\preparagraph{}%
- \def\presubparagraph{}%
-}
-
-\newcommand{\ukrainiannumerals}[2]{\ukrainiannumber{#2}}
-\newcommand{\Ukrainiannumerals}[2]{\Ukrainiannumber{#2}}
-
-\def\ukrainiannumber#1{%
- \ifcyrillic@numerals
- \ifcyrillic@asbuk@numerals
- \ukrainian@asbuk@alph{#1}%
- \else
- \cyr@alph{#1}%
- \fi
- \else
- \number#1%
- \fi%
-}
-
-\def\Ukrainiannumber#1{%
- \ifcyrillic@numerals
- \ifcyrillic@asbuk@numerals
- \ukrainian@asbuk@Alph{#1}%
- \else
- \cyr@Alph{#1}%
- \fi
- \else
- \number#1%
- \fi%
-}
-
-\let\ukrainiannumeral=\ukrainiannumber
-\let\Ukrainiannumeral=\Ukrainiannumber
-
-\def\Asbuk#1{\expandafter\ukrainian@asbuk@Alph\csname c@#1\endcsname}
-\def\asbuk#1{\expandafter\ukrainian@asbuk@alph\csname c@#1\endcsname}
-
-\def\AsbukTrad#1{\expandafter\cyr@Alph\csname c@#1\endcsname}
-\def\asbukTrad#1{\expandafter\cyr@alph\csname c@#1\endcsname}
-
-% This is a poor man's cyrillic alphanumeric. It just uses the alphabet and
-% thus ends at 30.
-\def\ukrainian@asbuk@Alph#1{\ifcase#1\or
- А\or Б\or В\or Г\or Д\or Е\or Ж\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}{ukrainian@asbuk@Alph}\fi%
-}
-
-\def\ukrainian@asbuk@alph#1{\ifcase#1\or
- а\or б\or в\or г\or д\or е\or ж\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}{ukrainian@asbuk@alph}\fi%
-}
-
-\def\ukrainian@numbers{%
- \ifcyrillic@numerals
- \def\ukrainian@alph##1{\expandafter\ukrainiannumeral\expandafter{\the##1}}%
- \def\ukrainian@Alph##1{\expandafter\Ukrainiannumeral\expandafter{\the##1}}%
- \let\@Alph\ukrainian@Alph%
- \let\@alph\ukrainian@alph%
- \fi
-}
-
-\def\noukrainian@numbers{%
- \let\@Alph\latin@Alph%
- \let\@alph\latin@alph%
-}
-
-\def\noextras@ukrainian{%
- \def\@seccntformat##1{\csname the##1\endcsname\quad}% = LaTeX kernel
- \ifcyrillic@numerals\noukrainian@numbers\fi
- \ifukrainian@babelshorthands\noukrainian@shorthands\fi%
-}
-
-\def\blockextras@ukrainian{%
- \ukrainian@capsformat%
- \ifcyrillic@numerals\ukrainian@numbers\else\noukrainian@numbers\fi%
- \ifukrainian@babelshorthands\ukrainian@shorthands\else\noukrainian@shorthands\fi%
-}
-
-\def\inlineextras@ukrainian{%
- \ifukrainian@babelshorthands\ukrainian@shorthands\else\noukrainian@shorthands\fi%
-}
-
-%%% stuff from Babel
-\AtBeginDocument{%
-\ifukrainian@mathfunctions%
- \def\sh{\mathop{\operator@font sh}\nolimits}
- \def\ch{\mathop{\operator@font ch}\nolimits}
- \def\tg{\mathop{\operator@font tg}\nolimits}
- \def\arctg{\mathop{\operator@font arctg}\nolimits}
- \def\arcctg{\mathop{\operator@font arcctg}\nolimits}
- \def\ctg{\mathop{\operator@font ctg}\nolimits}
- \def\cth{\mathop{\operator@font cth}\nolimits}
- \def\cosec{\mathop{\operator@font cosec}\nolimits}
- \def\Prob{\mathop{\kern\z@\mathsf{P}}\nolimits}
- \def\Variance{\mathop{\kern\z@\mathsf{D}}\nolimits}
- \def\nsd{\mathop{\mathrm{н.с.д.}}\nolimits}
- \def\nsk{\mathop{\mathrm{н.с.к.}}\nolimits}
- \def\NSD{\mathop{\mathrm{НСД}}\nolimits}
- \def\NSK{\mathop{\mathrm{НСК}}\nolimits}
- \def\nod{\mathop{\mathrm{н.о.д.}}\nolimits}
- \def\nok{\mathop{\mathrm{н.о.к.}}\nolimits}
- \def\NOD{\mathop{\mathrm{НОД}}\nolimits}
- \def\NOK{\mathop{\mathrm{НОК}}\nolimits}
- \def\Proj{\mathop{\mathrm{пр}}\nolimits}
-\fi
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ukrainian.ldf>
-%<*gloss-uppersorbian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-uppersorbian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-uppersorbian.ldf}[polyglossia: module for Upper Sorbian]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{sorbian}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-uppersorbian.ldf>
-%<*gloss-urdu.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-urdu.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-%%% Adapted from a file contributed by Kamal Abdali
-\ProvidesFile{gloss-urdu.ldf}[polyglossia: module for Urdu]
-
-\RequireBidi
-\RequirePackage{arabicnumbers}
-\RequirePackage{hijrical}
-
-\PolyglossiaSetup{urdu}{
- bcp47=ur,
- bcp47-language=ur,
- bcp47-script=Arab,
- script=Arabic,
- direction=RL,
- scripttag=arab,
- langtag=URD,
- hyphennames={urdu,nohyphenation},
- fontsetup=true,
- localnumeral=urdunumerals
- %TODO localalph={abjad,abjad}
-}
-
-% BCP-47 compliant aliases
-\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}}%
-
-% This should set the defaults
-\setkeys{urdu}{calendar,numerals,hijricorrection}
-
-\def\urdugregmonth#1{\ifcase#1%
- \or جنوری\or فروری\or مارچ\or اپریل\or مئی\or جون\or جولائی\or اگست\or ستمبر\or اکتوبر\or نومبر\or دسمبر\fi}
-
-\def\urduhijrimonth#1{\ifcase#1%
- \or محرّم\or صفر\or ربیع الاوّل\or ربیع الثّانی\or جمادی الاوّل\or جمادی الثّانی\or رجب\or شعبان\or رمضان\or شوّال\or ذیقعدہ\or ذی الحجّہ\fi}
-
-%\Hijritoday is now locale-aware and will format the date with this macro:
-\DefineFormatHijriDate{urdu}{\@ensure@RTL{%
- \urdunumber{\value{Hijriday}}؍\space\urduhijrimonth{\value{Hijrimonth}}\space\urdunumber{\value{Hijriyear}}}}
-
-\def\captionsurdu{%
- \def\refname{\@ensure@RTL{حوالہ جات}}%
- \def\abstractname{\@ensure@RTL{ملخّص}}%
- \def\bibname{\@ensure@RTL{کتابیات}}%
- \def\prefacename{\@ensure@RTL{دیباچہ}}%
- \def\chaptername{\@ensure@RTL{باب}}%
- \def\appendixname{\@ensure@RTL{ضمیمہ}}%
- \def\contentsname{\@ensure@RTL{فہرست عنوانات}}%
- \def\listfigurename{\@ensure@RTL{فہرست اشکال}}%
- \def\listtablename{\@ensure@RTL{فہرست جداول}}%
- \def\indexname{\@ensure@RTL{اشاریہ}}%
- \def\figurename{\@ensure@RTL{شكل}}%
- \def\tablename{\@ensure@RTL{جدول}}%
- %\def\thepart{}%
- \def\partname{\@ensure@RTL{حصّہ}}%
- \def\pagename{\@ensure@RTL{صفحہ}}%
- \def\seename{\@ensure@RTL{ملاحظہ ہو}}%
- \def\alsoname{\@ensure@RTL{ایضاً}}%
- \def\enclname{\@ensure@RTL{منسلک}}%
- \def\ccname{\@ensure@RTL{نقل}}%
- \def\headtoname{\@ensure@RTL{بملاحظہ}}%
- \def\proofname{\@ensure@RTL{ثبوت}}%
- \def\glossaryname{\@ensure@RTL{لغت}}%
- \def\sectionname{\@ensure@RTL{فصل}}%
-}
-
-\def\dateurdu{%
- \def\today{%
- \if@hijrical
- \Hijritoday[\urdu@hijri@correction]%
- \else
- \@ensure@RTL{\urdunumber\day؍\space\urdugregmonth{\month}%
- \space\urdunumber\year}%
- \fi}%
-}
-
-\def\urdunumber#1{%
- \if@western@numerals
- \number#1%
- \else
- %%FIXME use farsidigits instead???
- \@ensure@LTR{\protect\arabicdigits{\number#1}}%
- \fi}
-
-\def\urdu@numbers{%
- \let\@alph\abjad%
- \let\@Alph\abjad%
-}
-
-\def\nourdu@numbers{%
- \let\@alph\latin@alph%
- \let\@Alph\latin@Alph%
-}
-
-\newcommand{\urdunumerals}[2]{\urdunumber{#2}}
-
-% Store original definition
-\let\xpg@save@arabic\@arabic
-
-\def\urdu@globalnumbers{%
- \let\@arabic\urdunumber%
- % For some reason \thefootnote needs to be set separately:
- \renewcommand\thefootnote{\localnumeral*{footnote}}%
-}
-
-\def\nourdu@globalnumbers{
- \let\@arabic\xpg@save@arabic%
-}
-
-\def\urdu@xetex@capsformat{%
- \let\xpg@save@sepmark\@SepMark%
- \SepMark{\xpg@sepmark}
-}
-
-\def\nourdu@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
- \SepMark{\xpg@save@sepmark}
- }{}%
-}
-
-\def\urdu@luatex@capsformat{%
- %
- % change chapter and part headings
- \ifurdu@customsep
- \ifcsdef{chapter}{%
- \let\xpg@save@thesection\thesection%
- \renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
- \let\xpg@save@theequation\theequation%
- \renewcommand*\theequation{%
- \ifnum \c@chapter>\z@ \thechapter\xpg@sepmark\fi\@arabic\c@equation}
- \let\xpg@save@thefigure\thefigure%
- \renewcommand*\thefigure{%
- \ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@figure}
- \let\xpg@save@thetable\thetable%
- \renewcommand*\thetable{%
- \ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
- \let\xpg@save@thesubsection\thesubsection%
- \renewcommand\thesubsection
- {\thesection\xpg@sepmark\@arabic\c@subsection}
- \let\xpg@save@thesubsubsection\thesubsubsection%
- \renewcommand\thesubsubsection{\thesubsection\xpg@sepmark\@arabic\c@subsubsection}
- \let\xpg@save@theparagraph\theparagraph%
- \renewcommand\theparagraph
- {\thesubsubsection\xpg@sepmark\@arabic\c@paragraph}
- \let\xpg@save@thesubparagraph\thesubparagraph%
- \renewcommand\thesubparagraph{\theparagraph\xpg@sepmark\@arabic\c@subparagraph}
- \fi% (end \ifurdu@customsep)
-}
-
-\def\nourdu@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%
- }{}%
-}
-
-\def\blockextras@urdu{%
- \ifurdu@customsep
- \ifxetex
- \urdu@xetex@capsformat
- \else
- \urdu@luatex@capsformat
- \fi
- \fi
-}
-%
-\def\noextras@urdu{%
- \ifurdu@customsep
- \ifxetex
- \nourdu@xetex@capsformat
- \else
- \nourdu@luatex@capsformat
- \fi
- \fi
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-urdu.ldf>
-%<*gloss-usorbian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-usorbian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\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}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-usorbian.ldf>
-%<*gloss-uyghur.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-uyghur.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-uyghur.ldf}[polyglossia: module for Uyghur]
-%% Translations provided by Osman Tursun (Github Account: neouyghur)
-
-\RequireBidi
-\PolyglossiaSetup{uyghur}{
- bcp47=ug,
- bcp47-language=ug,
- bcp47-script=Arab,
- script=Arabic,
- direction=RL,
- scripttag=arab,
- langtag=UYG,
- hyphennames={nohyphenation},
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{uyghur}{ug}
-
-\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'}}
-
-% Register default options
-\xpg@initialize@gloss@options{uyghur}{swapstrings=all,chapterformat=ordinal}
-
-
-\def\captionsuyghur{%
- \def\refname{\@ensure@RTL{پايدىلانمىلار}}%
- \def\abstractname{\@ensure@RTL{قىسقىچە مەزمۇنى}}%
- \def\bibname{\@ensure@RTL{پايدىلانمىلار}}%
- \def\prefacename{\@ensure@RTL{كىرىش سۆز}}%
- \def\chaptername{\@ensure@RTL{باب}}%
- \def\appendixname{\@ensure@RTL{قوشۇمچە}}%
- \def\contentsname{\@ensure@RTL{مۇندەرىجە}}%
- \def\listfigurename{\@ensure@RTL{رەسىملەر}}%
- \def\listtablename{\@ensure@RTL{جەدۋەللەر}}%
- \def\indexname{\@ensure@RTL{ئىندېكىس}}%
- \def\figurename{\@ensure@RTL{رەسىم}}%
- \def\tablename{\@ensure@RTL{جەدۋەل}}%
- %\def\thepart{}%
- \def\partname{\@ensure@RTL{قىسىم}}%
- \def\pagename{\@ensure@RTL{بەت}}%
- \def\seename{\@ensure@RTL{قاراڭ}}%
- \def\alsoname{\@ensure@RTL{ئايرىم قاراڭ}}%
- \def\enclname{\@ensure@RTL{قوشۇمچە ھۆججەت}}%
- \def\ccname{\@ensure@RTL{باشقا تاپشۇرۇۋالغۇچى}}%
- \def\headtoname{\@ensure@RTL{تاپشۇرۇۋالغۇچى}}%
- \def\proofname{\@ensure@RTL{ئىسپات}}%
- \def\glossaryname{\@ensure@RTL{لۇغەت}}%
- %\def\sectionname{\@ensure@RTL{}}%
- \def\subjectname{\@ensure@RTL{تېما}}%
-}
-
-% Save original capsformats
-\let\xpg@save@fnum@table\fnum@table
-\let\xpg@save@fnum@figure\fnum@figure
-
-\def\uyghur@capsformat{%
- %
- % Change captions
- \if@uyghur@swapcaptions
- % change ‫‪'x.x‬‬ ‫ﺭﻩﺳﯩﻢ‬' to 'ﺭﻩﺳﯩﻢ-x.x‬‬'
- \def\fnum@figure{\thefigure-\figurename}
- %
- % same for table
- \def\fnum@table{\thetable-\tablename}
- \fi
- %
- % 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)
- % 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)
- % 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)
- % With standard classes
- \ifcsdef{@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
- \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)
- }% (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)
- % With standard classes
- \ifcsdef{chaptermark}{%
- \ifpatchable{\chaptermark}%
- {\@chapapp\ \thechapter.}%
- {\let\xpg@save@chaptermark@format\chaptermark%
- \patchcmd{\chaptermark}%
- {\@chapapp\ \thechapter.}%
- {\the@uyghur@chapter\ \@chapapp}%
- {}%
- {\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\@memptsize)
- }% (end \ifdefined\chapterformat)
- \fi% (end \if@uyghur@swapheaders)
-}
-
-\def\nouyghur@capsformat{%
- %
- % Reset changes of \uyghur@capsformat
- \let\fnum@table\xpg@save@fnum@table%
- \let\fnum@figure\xpg@save@fnum@figure%
- %
- % Reset chapter and part heading
- \ifcsdef{titleformat}{%
- % With titlesec
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{H@old@part}{%
- \let\H@old@part\xpg@save@part@format%
- }{%
- \let\@part\xpg@save@part@format%
- }%
- }{}%
- \ifcsdef{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}{%
- % With memoir and standard classes
- \ifcsdef{xpg@save@chaptermark@format}{%
- \let\chaptermark\xpg@save@chaptermark@format%
- }{}%
- }{}% (end \ifdefined\chaptermark)
- \ifcsdef{sectionmark}{%
- \ifcsdef{xpg@save@sectionmark@format}{%
- \let\sectionmark\xpg@save@sectionmark@format%
- }{}%
- }{}% (end \ifdefined\sectionmark)
- }% (end \ifdefined\chapterformat)
-}
-
-\def\blockextras@uyghur{%
- \uyghur@capsformat%
-}
-
-\def\noextras@uyghur{%
- \nouyghur@capsformat%
-}
-
-\ifxetex
- \let\xpg@orig@DigitsDotDashInterCharToks\DigitsDotDashInterCharToks%
-\fi
-
-\def\uyghur@ltr@numbers{%
- \ifxetex
- % Bidi inserts an RTL mark (0x200f) between number and number separator (- .),
- % forcing numbers to RTL. This is wrong for Uyghur, where numbers are left to right.
- % So we defunc the respective command.
- \renewcommand*{\DigitsDotDashInterCharToks}{}%
- \fi%
-}
-
-\def\nouyghur@ltr@numbers{%
- \ifxetex
- % Restore bidi's \DigitsDotDashInterCharToks
- \let\DigitsDotDashInterCharToks\xpg@orig@DigitsDotDashInterCharToks%
- \fi%
-}
-
-\let\the@uyghur@part\thepart
-\let\the@uyghur@chapter\thechapter
-
-\def\uyghur@chapterformat{%
- \ifcsdef{part}{%
- \if@uyghur@ordchapter%
- \renewcommand{\the@uyghur@part}{\uyghurord{part}}%
- \fi%
- \if@uyghur@romchapter%
- \renewcommand{\the@uyghur@part}{\Roman{part}}%
- \fi%
- }{}%
- \ifcsdef{chapter}{%
- \if@uyghur@ordchapter%
- \renewcommand{\the@uyghur@chapter}{\uyghurord{chapter}}%
- \fi%
- \if@uyghur@romchapter%
- \renewcommand{\the@uyghur@chapter}{\Roman{chapter}}%
- \fi%
- }{}%
-}
-
-\def\uyghur@numbers{%
- % Prevent bidi from setting the numbers RTL
- \uyghur@ltr@numbers%
- % Format chapter and part
- \uyghur@chapterformat%
-}
-
-\def\nouyghur@numbers{%
- % Restore previous bidi numbers definition
- \nouyghur@ltr@numbers
-}
-
-\def\uyghur@globalnumbers{%
- % Prevent bidi from setting the numbers RTL
- \uyghur@ltr@numbers%
- % Format chapter and part
- \uyghur@chapterformat%
-}
-
-\def\uyghurmonth#1{\ifcase#1%
- \or يانۋار\or فېۋرال\or مارت\or ئاپرېل\or ماي\or ئىيۇن
- \or ئىيۇل\or ئاۋغۇست\or سېنتەبىر\or ئۆكتەبىر\or نويابىر\or دېكابىر\fi}
-
-\def\dateuyghur{%
- \def\today{\number\year-يىلى\space\number\day-\uyghurmonth{\month}}%
-}
-
-\def\uyghurord#1{\expandafter\uyghurordinal\csname c@#1\endcsname}
-
-% Ordinals 1--100
-\def\uyghurordinal#1{\ifcase#1%
-\or بىرىنچى\or ئىككىنچى\or ئۈچىنچى\or تۆتىنچى\or بەشىنچى\or ئالتىنچى\or يەتتىنچى\or سەككىزىنچى
-\or توققۇزىنچى\or ئونىنچى\or ئون بىرىنچى\or ئون ئىككىنچى\or ئون ئۈچىنچى\or ئون تۆتىنچى\or ئون بەشىنچى
-\or ئون ئالتىنچى\or ئون يەتتىنچى\or ئون سەككىزىنچى\or ئون توققۇزىنچى\or يىگىرمىنچى\or يىگىرمە بىرىنچى
-\or يىگىرمە ئىككىنچى\or يىگىرمە ئۈچىنچى\or يىگىرمە تۆتىنچى\or يىگىرمە بەشىنچى\or يىگىرمە ئالتىنچى
-\or يىگىرمە يەتتىنچى\or يىگىرمە سەككىزىنچى\or يىگىرمە توققۇزىنچى\or ئوتتۇزىنچى\or ئوتتۇز بىرىنچى
-\or ئوتتۇز ئىككىنچى\or ئوتتۇز ئۈچىنچى\or ئوتتۇز تۆتىنچى\or ئوتتۇز بەشىنچى\or ئوتتۇز ئالتىنچى\or ئوتتۇز يەتتىنچى
-\or ئوتتۇز سەككىزىنچى\or ئوتتۇز توققۇزىنچى\or قىرىقىنچى\or قىرىق بىرىنچى\or قىرىق ئىككىنچى\or قىرىق ئۈچىنچى
-\or قىرىق تۆتىنچى\or قىرىق بەشىنچى\or قىرىق ئالتىنچى\or قىرىق يەتتىنچى\or قىرىق سەككىزىنچى\or قىرىق توققۇزىنچى
-\or ئەللىكىنچى\or ئەللىك بىرىنچى\or ئەللىك ئىككىنچى\or ئەللىك ئۈچىنچى\or ئەللىك تۆتىنچى\or ئەللىك بەشىنچى
-\or ئەللىك ئالتىنچى\or ئەللىك يەتتىنچى\or ئەللىك سەككىزىنچى\or ئەللىك توققۇزىنچى\or ئاتمىشىنچى\or ئاتمىش بىرىنچى
-\or ئاتمىش ئىككىنچى\or ئاتمىش ئۈچىنچى\or ئاتمىش تۆتىنچى\or ئاتمىش بەشىنچى\or ئاتمىش ئالتىنچى\or ئاتمىش يەتتىنچى
-\or ئاتمىش سەككىزىنچى\or ئاتمىش توققۇزىنچى\or يەتمىشىنچى\or يەتمىش بىرىنچى\or يەتمىش ئىككىنچى\or يەتمىش ئۈچىنچى
-\or يەتمىش تۆتىنچى\or يەتمىش بەشىنچى\or يەتمىش ئالتىنچى\or يەتمىش يەتتىنچى\or يەتمىش سەككىزىنچى\or يەتمىش توققۇزىنچى
-\or سەكسىنىنچى\or سەكسەن بىرىنچى\or سەكسەن ئىككىنچى\or سەكسەن ئۈچىنچى\or سەكسەن تۆتىنچى\or سەكسەن بەشىنچى
-\or سەكسەن ئالتىنچى\or سەكسەن يەتتىنچى\or سەكسەن سەككىزىنچى\or سەكسەن توققۇزىنچى\or توقسىنىنچى\or توقسان بىرىنچى
-\or توقسان ئىككىنچى\or توقسان ئۈچىنچى\or توقسان تۆتىنچى\or توقسان بەشىنچى\or توقسان ئالتىنچى\or توقسان يەتتىنچى
-\or توقسان سەككىزىنچى\or توقسان توققۇزىنچى\or يۈزىنچى\fi}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-uyghur.ldf>
-%<*gloss-vietnamese.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-vietnamese.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-vietnamese.ldf}[polyglossia: module for Vietnamese]
-%% Strings contributed by Daniel Owens < dhowens . pmbx . net >
-
-\PolyglossiaSetup{vietnamese}{
- bcp47=vi,
- bcp47-language=vi,
- bcp47-script=Latn,
- hyphennames={nohyphenation},
- hyphenmins={2,2},
- langtag=VIT,
- frenchspacing=true,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{vietnamese}{vi}
-
-\def\captionsvietnamese{%
- \def\refname{Tài liệu}%
- \def\abstractname{Tóm tắt nội dung}%
- \def\bibname{Tài liệu tham khảo}%
- \def\prefacename{Lời nói đầu}%
- \def\chaptername{Chương}%
- \def\appendixname{Phụ lục}%
- \def\contentsname{Mục lục}%
- \def\listfigurename{Danh sách hình vẽ}%
- \def\listtablename{Danh sách bảng}%
- \def\indexname{Chỉ mục}%
- \def\figurename{Hình}%
- \def\tablename{Bảng}%
- \def\partname{Phần}%
- \def\pagename{Trang}%
- \def\seename{Xem}%
- \def\alsoname{Xem thêm}%
- \def\enclname{Kèm theo}%
- \def\ccname{Cùng gửi}%
- \def\headtoname{Gửi}%
- \def\proofname{Chứng minh}%
- \def\glossaryname{Từ điển chú giải}%
- }
-
-\def\datevietnamese{%
- \def\today{%
- Ngày \number\day\space
- tháng \number\month\space
- năm \number\year}%
- }
-
-% \end{macrocode}
-% \iffalse
-%</gloss-vietnamese.ldf>
-%<*gloss-welsh.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-welsh.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-welsh.ldf}[polyglossia: module for Welsh]
-
-\PolyglossiaSetup{welsh}{
- bcp47=cy,
- bcp47-language=cy,
- bcp47-script=Latn,
- hyphennames={welsh},
- hyphenmins={2,3},
- langtag=WEL,
- fontsetup=true,
-}
-
-% BCP-47 compliant aliases
-\setlanguagealias*{welsh}{cy}
-
-\providebool{welsh@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'}}
-
-% Register default options
-\xpg@initialize@gloss@options{welsh}{date=short}
-
-\def\captionswelsh{%
- \def\refname{Cyfeiriadau}%
- \def\abstractname{Crynodeb}%
- \def\bibname{Llyfryddiaeth}%
- \def\prefacename{Rhagair}%
- \def\chaptername{Pennod}%
- \def\appendixname{Atodiad}%
- \def\contentsname{Cynnwys}%
- \def\listfigurename{Rhestr Ddarluniau}%
- \def\listtablename{Rhestr Dablau}%
- \def\indexname{Mynegai}%
- \def\figurename{Darlun}%
- \def\tablename{Taflen}%
- %\def\thepart{}%
- \def\partname{Rhan}%
- \def\pagename{tudalen}%
- \def\seename{gweler}%
- \def\alsoname{gweler hefyd}%
- \def\enclname{amgaeëdig}%
- \def\ccname{copïau}%
- \def\headtoname{At}% ‘at’ on letters meaning ‘to (a person)’;
- % ‘to (a place)’ is ‘i’ in Welsh
- \def\proofname{Prawf}%
- \def\glossaryname{Rhestr termau}%
- }
-
-\newif\ifwelsh@first
-\def\welsh@article#1{\welsh@firsttrue y\expandafter\welsh@article@do#1}
-\def\welsh@article@do#1{\ifwelsh@first\welsh@isvowel#1\ifwelsh@vowel r\space\welsh@vowelfalse\else\space\fi#1\welsh@firstfalse\fi}
-\newif\ifwelsh@vowel
-\def\welsh@isvowel#1{\show#1\ifx#1a\welsh@voweltrue\else\ifx#1u\welsh@voweltrue\else\ifx#1w\welsh@voweltrue\fi\fi\fi}% FIXME Add the other vowels, just for good measure
-
-\def\welsh@ordinal@long#1{%
- \ifcase#1\or cyntaf\or ail\or trydydd\or pedwerydd\or
- pumed\or chweched\or seithfed\or wythfed\or nawfed\or degfed\or unfed ar ddeg\or deuddegfed\or trydydd ar ddeg\or pedwerydd ar ddeg\or pymthegfed\or unfed ar bymtheg\or ail ar bymtheg\or deunawfed\or pedwerydd ar bymtheg\or ugeinfed\else\expandafter\welsh@ordinalplusxx@long#1\fi}
-
-\def\welsh@ordinalplusxx@long#1{%
- \let\dday=#1\advance\dday by -20\relax\welsh@ordinal@long\dday\space ar hugain%
-}
-
-\def\datewelsh{%
- \def\today{\ifwelsh@formaldate\formaltoday\else\standardtoday\fi}
- \def\standardtoday{%
- \ifcase\day\or 1af\or 2ail\or 3ydd\or 4ydd\or 5ed\or 6ed%
- \or 7fed\or 8fed\or 9fed\or 10fed\or 11eg\or 12fed\or 13eg\or
- 14eg\or 15fed\or 16eg\or 17eg\or 18fed\or 19eg\or
- 20fed\else\number\day ain\fi\space\ifcase\month\or
- Ionawr\or Chwefror\or Mawrth\or Ebrill\or
- Mai\or Mehefin\or Gorffennaf\or Awst\or
- Medi\or Hydref\or Tachwedd\or Rhagfyr\fi%
- \space\number\year}%
- \def\formaltoday{%
- \expandafter\welsh@article\welsh@ordinal@long\day\space o\space\ifcase\month\or
- Ionawr\or Chwefror\or Fawrth\or Ebrill\or Fai\or Fehefin\or Orffenaf\or Awst\or
- Fedi\or Hydref\or Dachwedd\or Ragfyr\fi%
- \space\number\year}%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-welsh.ldf>
-%<*gloss-zh-CN.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-zh-CN.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-zh-CN.ldf}[polyglossia: module for zh-CN (Chinese)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{chinese}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-zh-CN.ldf>
-%<*gloss-zh-TW.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-zh-TW.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-zh-TW.ldf}[polyglossia: module for zh-TW (Chinese)]
-
-% We provide this as a bcp47-compliant alias
-
-\xpg@load@master@language{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>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-korean.lua}
-% \begin{macrocode}
---
--- polyglossia-korean.lua
--- part of polyglossia v2.1 -- 2024/03/07
---
-
-local glyph_id = node.id"glyph"
-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"
-
---
--- attr_korean: variant = plain (0), classic (1), modern (2)
---
-local attr_korean = luatexbase.attributes["xpg@attr@korean"]
-local attr_josa = luatexbase.attributes["xpg@attr@autojosa"]
-
---
--- characters after which linebreak is not allowed
---
-local nobr_after = {
- [0x28] = 1, -- ( LEFT PARENTHESIS
- [0x3C] = 1, -- < LESS-THAN SIGN
- [0x5B] = 1, -- [ LEFT SQUARE BRACKET
- [0x60] = 1, -- ` GRAVE ACCENT
- [0x7B] = 1, -- { LEFT CURLY BRACKET
- [0xAB] = 1, -- « LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
- [0x2018] = 1, -- ‘ LEFT SINGLE QUOTATION MARK
- [0x201C] = 1, -- “ LEFT DOUBLE QUOTATION MARK
- [0x2329] = 1, -- 〈 LEFT-POINTING ANGLE BRACKET
- [0x3008] = 1, -- 〈 LEFT ANGLE BRACKET
- [0x300A] = 1, -- 《 LEFT DOUBLE ANGLE BRACKET
- [0x300C] = 1, -- 「 LEFT CORNER BRACKET
- [0x300E] = 1, -- 『 LEFT WHITE CORNER BRACKET
- [0x3010] = 1, -- 【 LEFT BLACK LENTICULAR BRACKET
- [0x3014] = 1, -- 〔 LEFT TORTOISE SHELL BRACKET
- [0x3016] = 1, -- 〖 LEFT WHITE LENTICULAR BRACKET
- [0x3018] = 1, -- 〘 LEFT WHITE TORTOISE SHELL BRACKET
- [0x301A] = 1, -- 〚 LEFT WHITE SQUARE BRACKET
- [0x301D] = 1, -- 〝 REVERSED DOUBLE PRIME QUOTATION MARK
- [0xFE17] = 1, -- ︗ PRESENTATION FORM FOR VERTICAL LEFT WHITE LENTICULAR BRACKET
- [0xFE35] = 1, -- ︵ PRESENTATION FORM FOR VERTICAL LEFT PARENTHESIS
- [0xFE37] = 1, -- ︷ PRESENTATION FORM FOR VERTICAL LEFT CURLY BRACKET
- [0xFE39] = 1, -- ︹ PRESENTATION FORM FOR VERTICAL LEFT TORTOISE SHELL BRACKET
- [0xFE3B] = 1, -- ︻ PRESENTATION FORM FOR VERTICAL LEFT BLACK LENTICULAR BRACKET
- [0xFE3D] = 1, -- ︽ PRESENTATION FORM FOR VERTICAL LEFT DOUBLE ANGLE BRACKET
- [0xFE3F] = 1, -- ︿ PRESENTATION FORM FOR VERTICAL LEFT ANGLE BRACKET
- [0xFE41] = 1, -- ﹁ PRESENTATION FORM FOR VERTICAL LEFT CORNER BRACKET
- [0xFE43] = 1, -- ﹃ PRESENTATION FORM FOR VERTICAL LEFT WHITE CORNER BRACKET
- [0xFE47] = 1, -- ﹇ PRESENTATION FORM FOR VERTICAL LEFT SQUARE BRACKET
- [0xFE59] = 1, -- ﹙ SMALL LEFT PARENTHESIS
- [0xFE5B] = 1, -- ﹛ SMALL LEFT CURLY BRACKET
- [0xFE5D] = 1, -- ﹝ SMALL LEFT TORTOISE SHELL BRACKET
- [0xFF08] = 1, -- ( FULLWIDTH LEFT PARENTHESIS
- [0xFF3B] = 1, -- [ FULLWIDTH LEFT SQUARE BRACKET
- [0xFF5B] = 1, -- { FULLWIDTH LEFT CURLY BRACKET
- [0xFF5F] = 1, -- ⦅ FULLWIDTH LEFT WHITE PARENTHESIS
- [0xFF62] = 1, -- 「 HALFWIDTH LEFT CORNER BRACKET
-}
-
---
--- characters before which linebreak is not allowed
--- (currently, not much differences among the followings)
--- 1: normal chars
--- 2: hangul jamo vowels and trailing consonants
--- 3: kana small letters
--- 0: dashes (supress visible spacing)
---
-local nobr_before = setmetatable({
- [0x21] = 1, -- ! EXCLAMATION MARK
- [0x22] = 1, -- " QUOTATION MARK
- [0x27] = 1, -- ' APOSTROPHE
- [0x29] = 1, -- ) RIGHT PARENTHESIS
- [0x2C] = 1, -- , COMMA
- [0x2D] = 0, -- - HYPHEN-MINUS
- [0x2E] = 1, -- . FULL STOP
- [0x2F] = 0, -- / SOLIDUS
- [0x3A] = 0, -- : COLON
- [0x3B] = 1, -- ; SEMICOLON
- [0x3E] = 1, -- > GREATER-THAN SIGN
- [0x3F] = 1, -- ? QUESTION MARK
- [0x5C] = 0, -- \ REVERSE SOLIDUS
- [0x5D] = 1, -- ] RIGHT SQUARE BRACKET
- [0x7D] = 1, -- } RIGHT CURLY BRACKET
- [0x7E] = 0, -- ~ TILDE
- [0xB7] = 1, -- · MIDDLE DOT
- [0xBB] = 1, -- » RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
- [0x2013] = 0, -- – EN DASH
- [0x2014] = 0, -- — EM DASH
- [0x2015] = 1, -- ― HORIZONTAL BAR
- [0x2019] = 1, -- ’ RIGHT SINGLE QUOTATION MARK
- [0x201D] = 1, -- ” RIGHT DOUBLE QUOTATION MARK
- [0x2025] = 1, -- ‥ TWO DOT LEADER
- [0x2026] = 1, -- … HORIZONTAL ELLIPSIS
- [0x232A] = 1, -- 〉 RIGHT-POINTING ANGLE BRACKET
- [0x3001] = 1, -- 、 IDEOGRAPHIC COMMA
- [0x3002] = 1, -- 。 IDEOGRAPHIC FULL STOP
- [0x3005] = 1, -- 々 IDEOGRAPHIC ITERATION MARK
- [0x3009] = 1, -- 〉 RIGHT ANGLE BRACKET
- [0x300B] = 1, -- 》 RIGHT DOUBLE ANGLE BRACKET
- [0x300D] = 1, -- 」 RIGHT CORNER BRACKET
- [0x300F] = 1, -- 』 RIGHT WHITE CORNER BRACKET
- [0x3011] = 1, -- 】 RIGHT BLACK LENTICULAR BRACKET
- [0x3015] = 1, -- 〕 RIGHT TORTOISE SHELL BRACKET
- [0x3017] = 1, -- 〗 RIGHT WHITE LENTICULAR BRACKET
- [0x3019] = 1, -- 〙 RIGHT WHITE TORTOISE SHELL BRACKET
- [0x301B] = 1, -- 〛 RIGHT WHITE SQUARE BRACKET
- [0x301C] = 1, -- 〜 WAVE DASH
- [0x301E] = 1, -- 〞 DOUBLE PRIME QUOTATION MARK
- [0x301F] = 1, -- 〟 LOW DOUBLE PRIME QUOTATION MARK
- [0x3035] = 1, -- 〵 VERTICAL KANA REPEAT MARK LOWER HALF
- [0x303B] = 1, -- 〻 VERTICAL IDEOGRAPHIC ITERATION MARK
- [0x303C] = 1, -- 〼 MASU MARK
- [0x3041] = 3, -- ぁ HIRAGANA LETTER SMALL A
- [0x3043] = 3, -- ぃ HIRAGANA LETTER SMALL I
- [0x3045] = 3, -- ぅ HIRAGANA LETTER SMALL U
- [0x3047] = 3, -- ぇ HIRAGANA LETTER SMALL E
- [0x3049] = 3, -- ぉ HIRAGANA LETTER SMALL O
- [0x3063] = 3, -- っ HIRAGANA LETTER SMALL TU
- [0x3083] = 3, -- ゃ HIRAGANA LETTER SMALL YA
- [0x3085] = 3, -- ゅ HIRAGANA LETTER SMALL YU
- [0x3087] = 3, -- ょ HIRAGANA LETTER SMALL YO
- [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
- [0x309D] = 1, -- ゝ HIRAGANA ITERATION MARK
- [0x309E] = 1, -- ゞ HIRAGANA VOICED ITERATION MARK
- [0x30A0] = 1, -- ゠ KATAKANA-HIRAGANA DOUBLE HYPHEN
- [0x30A1] = 3, -- ァ KATAKANA LETTER SMALL A
- [0x30A3] = 3, -- ィ KATAKANA LETTER SMALL I
- [0x30A5] = 3, -- ゥ KATAKANA LETTER SMALL U
- [0x30A7] = 3, -- ェ KATAKANA LETTER SMALL E
- [0x30A9] = 3, -- ォ KATAKANA LETTER SMALL O
- [0x30C3] = 3, -- ッ KATAKANA LETTER SMALL TU
- [0x30E3] = 3, -- ャ KATAKANA LETTER SMALL YA
- [0x30E5] = 3, -- ュ KATAKANA LETTER SMALL YU
- [0x30E7] = 3, -- ョ KATAKANA LETTER SMALL YO
- [0x30EE] = 3, -- ヮ KATAKANA LETTER SMALL WA
- [0x30F5] = 3, -- ヵ KATAKANA LETTER SMALL KA
- [0x30F6] = 3, -- ヶ KATAKANA LETTER SMALL KE
- [0x30FB] = 1, -- ・ KATAKANA MIDDLE DOT
- [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
- [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
- [0xFE3C] = 1, -- ︼ PRESENTATION FORM FOR VERTICAL RIGHT BLACK LENTICULAR BRACKET
- [0xFE3E] = 1, -- ︾ PRESENTATION FORM FOR VERTICAL RIGHT DOUBLE ANGLE BRACKET
- [0xFE40] = 1, -- ﹀ PRESENTATION FORM FOR VERTICAL RIGHT ANGLE BRACKET
- [0xFE42] = 1, -- ﹂ PRESENTATION FORM FOR VERTICAL RIGHT CORNER BRACKET
- [0xFE44] = 1, -- ﹄ PRESENTATION FORM FOR VERTICAL RIGHT WHITE CORNER BRACKET
- [0xFE48] = 1, -- ﹈ PRESENTATION FORM FOR VERTICAL RIGHT SQUARE BRACKET
- [0xFE5A] = 1, -- ﹚ SMALL RIGHT PARENTHESIS
- [0xFE5C] = 1, -- ﹜ SMALL RIGHT CURLY BRACKET
- [0xFE5E] = 1, -- ﹞ SMALL RIGHT TORTOISE SHELL BRACKET
- [0xFF01] = 1, -- ! FULLWIDTH EXCLAMATION MARK
- [0xFF09] = 1, -- ) FULLWIDTH RIGHT PARENTHESIS
- [0xFF0C] = 1, -- , FULLWIDTH COMMA
- [0xFF0E] = 1, -- . FULLWIDTH FULL STOP
- [0xFF1A] = 1, -- : FULLWIDTH COLON
- [0xFF1B] = 1, -- ; FULLWIDTH SEMICOLON
- [0xFF1F] = 1, -- ? FULLWIDTH QUESTION MARK
- [0xFF3D] = 1, -- ] FULLWIDTH RIGHT SQUARE BRACKET
- [0xFF5D] = 1, -- } FULLWIDTH RIGHT CURLY BRACKET
- [0xFF60] = 1, -- ⦆ FULLWIDTH RIGHT WHITE PARENTHESIS
- [0xFF61] = 1, -- 。 HALFWIDTH IDEOGRAPHIC FULL STOP
- [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
-}, { __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 >= 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 >= 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
- end
-})
-
---
--- whether 'c' is a cjk character
---
-local function is_cjk (c)
- return c >= 0xAC00 and c <= 0xD7FF
- or c >= 0x1100 and c <= 0x11FF
- or c >= 0xA960 and c <= 0xA97F
- or c >= 0x2E80 and c <= 0x9FFF
- or c >= 0xF900 and c <= 0xFAFF
- or c >= 0xFE10 and c <= 0xFE1F
- or c >= 0xFE30 and c <= 0xFE6F
- or c >= 0xFF00 and c <= 0xFFEF
- or c >= 0x1F100 and c <= 0x1F2FF
- or c >= 0x20000 and c <= 0x2FA1F
- or nobr_after[c] and c > 0x2014
- or nobr_before[c] and c > 0x2014
-end
-
---
--- classify cjk characters
--- 1: openings
--- 2: closings
--- 3: centered chars
--- 4: full stops
--- 5: ellipses
--- 6: exclamation and question marks
--- 0: all others
---
-local charclass = setmetatable({
- [0x2018] = 1, [0x201C] = 1, [0x2329] = 1, [0x3008] = 1,
- [0x300A] = 1, [0x300C] = 1, [0x300E] = 1, [0x3010] = 1,
- [0x3014] = 1, [0x3016] = 1, [0x3018] = 1, [0x301A] = 1,
- [0x301D] = 1, [0xFE17] = 1, [0xFE35] = 1, [0xFE37] = 1,
- [0xFE39] = 1, [0xFE3B] = 1, [0xFE3D] = 1, [0xFE3F] = 1,
- [0xFE41] = 1, [0xFE43] = 1, [0xFE47] = 1, [0xFF08] = 1,
- [0xFF3B] = 1, [0xFF5B] = 1, [0xFF5F] = 1, [0xFF62] = 1,
- [0x2019] = 2, [0x201D] = 2, [0x232A] = 2, [0x3001] = 2,
- [0x3009] = 2, [0x300B] = 2, [0x300D] = 2, [0x300F] = 2,
- [0x3011] = 2, [0x3015] = 2, [0x3017] = 2, [0x3019] = 2,
- [0x301B] = 2, [0x301E] = 2, [0x301F] = 2, [0xFE10] = 2,
- [0xFE11] = 2, [0xFE18] = 2, [0xFE36] = 2, [0xFE38] = 2,
- [0xFE3A] = 2, [0xFE3C] = 2, [0xFE3E] = 2, [0xFE40] = 2,
- [0xFE42] = 2, [0xFE44] = 2, [0xFE48] = 2, [0xFF09] = 2,
- [0xFF0C] = 2, [0xFF3D] = 2, [0xFF5D] = 2, [0xFF60] = 2,
- [0xFF63] = 2, [0xFF64] = 2, [0x00B7] = 3, [0x30FB] = 3,
- [0xFF1A] = 3, [0xFF1B] = 3, [0xFF65] = 3, [0x3002] = 4,
- [0xFE12] = 4, [0xFF0E] = 4, [0xFF61] = 4, [0x2015] = 5,
- [0x2025] = 5, [0x2026] = 5, [0xFE19] = 5, [0xFE30] = 5,
- [0xFE31] = 5, [0xFE15] = 6, [0xFE16] = 6, [0xFF01] = 6,
- [0xFF1F] = 6,
-}, { __index = function() return 0 end })
-
---
--- table for spacing between char classes
--- 1 stands for 0.5*fontsize when variant=classic
---
-local intercharclass = { [0] =
- { [0] = nil, {1,1}, nil, {.5,.5} },
- { [0] = nil, nil, nil, {.5,.5} },
- { [0] = {1,1}, {1,1}, nil, {.5,.5}, nil, {1,1}, {1,1} },
- { [0] = {.5,.5},{.5,.5},{.5,.5},{1,.5}, {.5,.5},{.5,.5},{.5,.5} },
- { [0] = {1,0}, {1,0}, nil, {1.5,.5},nil, {1,0}, {1,0} },
- { [0] = nil, {1,1}, nil, {.5,.5} },
- { [0] = {1,1}, {1,1}, nil, {.5,.5} },
-}
-
---
--- get a new penalty node
---
-local function get_new_penalty (p)
- local penalty = node.new("penalty")
- penalty.penalty = p
- return penalty
-end
-
---
--- get a new glue node
---
-local function get_new_glue (...)
- local glue = node.new("glue")
- node.setglue(glue, ...)
- return glue
-end
-
---
--- return 0.5*fontsize of given fontid
--- space: true if variant=modern; then 0.5*interword_space
---
-local function get_font_size (fid, space)
- local size = font.getparameters(fid)
- if space then
- size = size and size.space or 196608
- else
- size = size and size.quad or 655360
- end
- return size/2
-end
-
---
--- charclass 1 thru 4 will be packed in \hbox to 0.5em{\hss? curr \hss?}
--- when variant=classic/modern
---
-local function glyph_to_box (head, curr, class)
- local g, h = curr
- local size = get_font_size(g.font)
- head, curr = node.remove(head, curr)
- g.next, g.prev = nil, nil
- local hss = get_new_glue(0, 65536, 65536, 2, 2)
- if class == 1 then
- h, hss.next, g.prev = hss, g, hss
- elseif class == 2 or class == 4 then
- h, g.next, hss.prev = g, hss, g
- else
- local hss2 = node.copy(hss)
- h, hss.next, g.prev, g.next, hss2.prev = hss, g, hss, hss2, g
- end
- h = nodes.simple_font_handler(h)
- local box = node.hpack(h, size, "exactly")
- if curr then
- head, curr = node.insert_before(head, curr, box)
- else
- head, curr = node.insert_after(head, node.tail(head), box)
- end
- return head, curr
-end
-
---
--- insert spacing defined as charclass[a][b] between a and b
--- f: fontid
--- var: variant = plain, classic, modern
--- cc: charclass of current char
--- nc: charclass of next char
--- nobr: linebreak is not allowed
---
-local function insert_cjk_penalty_glue (head, curr, f, var, cc, nc, nobr)
- if nobr or cc == 1 or nc > 1 then
- local penalty = get_new_penalty(10000)
- head, curr = node.insert_after(head, curr, penalty)
- end
- local factor = get_font_size(f, var == 2)
- local t = intercharclass[cc][nc]
- local glue = get_new_glue(t[1]*factor, nil, t[2]*factor)
- head, curr = node.insert_after(head, curr, glue)
- return head, curr
-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)
---
-local function insert_penalty_glue (head, curr, f, var, x)
- if var ~= 1 then
- local penalty = get_new_penalty(50)
- head, curr = node.insert_after(head, curr, penalty)
- end
- local size, glue = get_font_size(f, x and var == 2)
- if x then
- glue = get_new_glue(size/2, size/4, size/8)
- else
- glue = get_new_glue(0, size/10, size/50)
- end
- head, curr = node.insert_after(head, curr, glue)
- return head, curr
-end
-
---
--- main process for linebreak and inter-character spacing
--- lb: true if pre_linebreak_filter
---
-local function korean_break (head, lb)
- local curr = head
- while curr do
- if curr.id == glyph_id then
- local var = node.has_attribute(curr, attr_korean)
- if var then
- local c, f = curr.char or 0, curr.font or 0
- local cc, cjkc = charclass[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 n = next.char or 0
- local nc = charclass[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
- 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)
-
- -- or under pre_linebreak_filter
- elseif lb then
- head, curr = insert_penalty_glue(head, curr, f, var)
- end
- end
- end
- end
- end
- end
- curr = curr.next
- end
- return head
-end
-
---
--- process for reordering hangul tone marks (U+302E, U+302F)
--- some hangul fonts (eg. Noto CJK) are so designed that hangul tone marks
--- should be moved to the first position of a syllable.
--- Currently, this functionality is not provided by luaotfload.
---
-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
- local f = font.getfont(curr.font) or font.fonts[curr.font]
- if f and f.hb then -- harfbuzz do the right thing
- tone = nil
- else
- local c, wd = curr.char or 0, curr.width or 0
- if (c == 0x302E or c == 0x302F) and wd > 0 then
- tone = curr
- elseif tone and not nobr_before[c] then
- head = node.remove(head, tone)
- tone.next, tone.prev = nil, nil
- head, curr = node.insert_before(head, curr, tone)
- tone = nil
- end
- end
- end
- curr = curr.prev
- end
- return head
-end
-
---
--- automatic josa selection
---
-local josa_table = {
- -- consonant ㄹ, vowel, other consonants
- [0xAC00] = {0xC774, 0xAC00, 0xC774}, -- 가 => 이, 가, 이
- [0xC740] = {0xC740, 0xB294, 0xC740}, -- 은 => 은, 는, 은
- [0xC744] = {0xC744, 0xB97C, 0xC744}, -- 을 => 을, 를, 을
- [0xC640] = {0xACFC, 0xC640, 0xACFC}, -- 와 => 과, 와, 과
- [0xC73C] = {nil, nil, 0xC73C}, -- 으(로) => , , 으
- [0xC774] = {0xC774, nil, 0xC774}, -- 이(라) => 이, , 이
-}
-
---
--- helper function for number-like characters
---
-local function josa_char_num (t, c)
- c = c % 10 + 0x30
- return t[c] or 2
-end
-
---
--- decide josa selection
---
-local josa_code = setmetatable({
- [0x30] = 3, [0x31] = 1, [0x33] = 3, [0x36] = 3, [0x37] = 1,
- [0x38] = 1, [0x4C] = 1, [0x4D] = 3, [0x4E] = 3, [0x6C] = 1,
- [0x6D] = 3, [0x6E] = 3, [0xFB02] = 1, [0xFB04] = 1,
-},{ __index = function(t,c)
- if c >= 0xAC00 and c <= 0xD7A3 then
- c = (c - 0xAC00) % 28 + 0x11A7
- end
- if c >= 0x11A8 and c <= 0x11FF then
- if c == 0x11AF then return 1 end
- return 3
- end
- if c >= 0xD7CB and c <= 0xD7FB then return 3 end
- if c >= 0x2170 and c <= 0x217F then c = c - 0x10 end
- if c >= 0x2160 and c <= 0x216F then
- if c >= 0x216C then return 3 end
- return josa_char_num(t, c - 0x215F)
- end
- if c >= 0x2460 and c <= 0x2473 then return josa_char_num(t, c - 0x245F) end
- if c >= 0x2474 and c <= 0x2487 then return josa_char_num(t, c - 0x2473) end
- if c >= 0x2488 and c <= 0x249B then return josa_char_num(t, c - 0x2487) end
- if c >= 0x249C and c <= 0x24B5 then return t[c - 0x249C + 0x61] or 2 end
- if c >= 0x24B6 and c <= 0x24CF then return t[c - 0x24B6 + 0x61] or 2 end
- if c >= 0x24D0 and c <= 0x24E9 then return t[c - 0x24D0 + 0x61] or 2 end
- if c >= 0x3131 and c <= 0x318E then
- if c == 0x3139 then return 1 end
- if c >= 0x314F and c <= 0x3163 or c >= 0x3187 then return 2 end
- return 3
- end
- if c >= 0x3260 and c <= 0x327E then c = c - 0x60 end
- if c >= 0x3200 and c <= 0x321E then
- if c == 0x3203 then return 1 end
- if c >= 0x320E then return 2 end
- return 3
- end
- if c >= 0xFF10 and c <= 0xFF19 then return josa_char_num(t, c - 0xFF10) end
- if c >= 0xFF21 and c <= 0xFF3A then return t[c - 0xFF21 + 0x61] or 2 end
- if c >= 0xFF41 and c <= 0xFF5A then return t[c - 0xFF41 + 0x61] or 2 end
- return 2
- end
-})
-
---
--- obtain char that comes just before the josa
---
-local function get_prev_char (p)
- while p do
- if p.id == glyph_id then
- local pc = p.char or 0
- if not nobr_after[pc] then
- if not nobr_before[pc] or nobr_before[pc] >= 2 then
- return pc
- end
- end
- elseif p.id == hbox_id or p.id == vbox_id then
- local pc = get_prev_char(node.slide(p.head))
- if pc then return pc end
- end
- p = p.prev
- end
-end
-
---
--- main process of josa selection
---
-local function auto_josa (head)
- local curr, tofree = head, {}
- while curr do
- if curr.id == glyph_id then
- local josa = node.has_attribute(curr, attr_josa)
- if josa then
- local cc = curr.char or 0
- if josa == 0 then
- josa = josa_code[get_prev_char(curr.prev) or 0x30]
- end
- if cc == 0xC774 then
- local n = curr.next
- if n and n.char and n.char >= 0xAC00 and n.char <= 0xD7A3 then
- else
- cc = 0xAC00
- end
- end
- local new = josa_table[cc]
- if new then
- cc = new[josa]
- if cc then
- curr.char = cc
- else
- head = node.remove(head, curr)
- table.insert(tofree, curr)
- end
- end
- node.unset_attribute(curr, attr_josa)
- end
- end
- curr = curr.next
- end
- for _,v in ipairs(tofree) do node.free(v) end
- return head
-end
-
---
--- now register to luatex callbacks
--- 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)
- 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
- 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")
-
--- vim:ft=lua:tw=0:sw=4:ts=4:expandtab
-% \end{macrocode}
-% \iffalse
-%</polyglossia-korean.lua>
-%<*polyglossia-latin.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-latin.lua}
-% \begin{macrocode}
---
--- polyglossia-latin.lua
--- part of polyglossia v2.1 -- 2024/03/07
---
-
-require('polyglossia-punct')
-
--- For ecclesiastic Latin (and sometimes for Italian) a very small space is
--- used for the punctuation. The ecclesiastic package uses a space of
--- 0.3\fontdimen2, where \fontdimen2 is a interword space, which is typically
--- between 1/4 and 1/3 of a quad. We choose a half of a \thinspace here.
-local hairspace = 0.08333 -- 1/12
-
-local function space_left(char)
- polyglossia.add_left_spaced_character('latin', char, hairspace, 'quad')
-end
-
-local function space_right(char)
- polyglossia.add_right_spaced_character('latin', char, hairspace, 'quad')
-end
-
-polyglossia.clear_spaced_characters('latin')
-space_left('!')
-space_left('?')
-space_left('‼')
-space_left('⁇')
-space_left('⁈')
-space_left('⁉')
-space_left('‽') -- U+203D (interrobang)
-space_left(':')
-space_left(';')
-space_left('»')
-space_left('›')
-space_right('«')
-space_right('‹')
-
-local function activate_latin_punct()
- polyglossia.activate_punct('latin')
-end
-
-local function deactivate_latin_punct()
- polyglossia.deactivate_punct()
-end
-
-polyglossia.activate_latin_punct = activate_latin_punct
-polyglossia.deactivate_latin_punct = deactivate_latin_punct
-% \end{macrocode}
-% \iffalse
-%</polyglossia-latin.lua>
-%<*polyglossia-punct.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-punct.lua}
-% \begin{macrocode}
---
--- polyglossia-punct.lua
--- part of polyglossia v2.1 -- 2024/03/07
---
-
-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 new_attribute = luatexbase.new_attribute
-
-local node = node
-
-local insert_node_before = node.insert_before
-local insert_node_after = node.insert_after
-local remove_node = node.remove
-local has_attribute = node.has_attribute
-local node_copy = node.copy
-local new_node = node.new
-local end_of_math = node.end_of_math
-local getnext = node.getnext
-local getprev = node.getprev
-
--- node types according to node.types()
-local glue_code = node.id"glue"
-local glyph_code = node.id"glyph"
-local penalty_code = node.id"penalty"
-local kern_code = node.id"kern"
-local math_code = node.id"math"
-
--- we need some node subtypes
-local userkern = 1
-local userskip = 0
-local removable_skip = {
- [0] = true, -- userskip
- [13] = true, -- spaceskip
- [14] = true, -- xspaceskip
-}
-
--- we make a new node, so that we can copy it later on
-local kern_node = new_node(kern_code)
-kern_node.subtype = userkern -- this kern can be removed later on
-
-local function get_kern_node(dim)
- local n = node_copy(kern_node)
- n.kern = dim
- return n
-end
-
-local glue_node = new_node(glue_code)
-glue_node.subtype = userskip
-
-local function get_glue_node(dim, stretch, shrink)
- local n = node_copy(glue_node)
- n.width = dim
- n.stretch = stretch
- n.shrink = shrink
- return n
-end
-
-local penalty_node = new_node(penalty_code)
-penalty_node.penalty = 10000
-
-local function get_penalty_node()
- return node_copy(penalty_node)
-end
-
--- all possible space characters according to section 6.2 of the Unicode Standard
--- https://www.unicode.org/versions/Unicode12.0.0/ch06.pdf
-local space_chars = {
- [0x20] = true, -- space
- [0xA0] = true, -- no-break space
- [0x1680] = true, -- ogham space mark
- [0x2000] = true, -- en quad
- [0x2001] = true, -- em quad
- [0x2002] = true, -- en space
- [0x2003] = true, -- em space
- [0x2004] = true, -- three-per-em-space
- [0x2005] = true, -- four-per-em space
- [0x2006] = true, -- six-per-em space
- [0x2007] = true, -- figure space
- [0x2008] = true, -- punctuation space
- [0x2009] = true, -- thin space
- [0x200A] = true, -- hair space
- [0x202F] = true, -- narrow no-break space
- [0x205F] = true, -- medium mathematical space
- [0x3000] = true -- ideographic space
-}
-
--- all left bracket characters, referenced by their Unicode slot
-local left_bracket_chars = {
- [0x28] = true, -- left parenthesis
- [0x5B] = true, -- left square bracket
- [0x7B] = true, -- left curly bracket
- [0x27E8] = true -- mathematical left angle bracket
-}
-
--- all right bracket characters, referenced by their Unicode slot
-local right_bracket_chars = {
- [0x29] = true, -- right parenthesis
- [0x5D] = true, -- right square bracket
- [0x7D] = true, -- right curly bracket
- [0x27E9] = true -- mathematical right angle bracket
-}
-
--- question and exclamation marks, referenced by their Unicode slot
-local question_exclamation_chars = {
- [0x21] = true, -- exclamation mark !
- [0x3F] = true, -- question mark ?
- [0x203C] = true, -- double exclamation mark ‼
- [0x203D] = true, -- interrobang ‽
- [0x2047] = true, -- double question mark ⁇
- [0x2048] = true, -- question exclamation mark ⁈
- [0x2049] = true -- exclamation question mark ⁉
-}
-
--- from nodes-tst.lua, adapted
-local function somespace(n)
- if n then
- local id, subtype = n.id, n.subtype
- if id == glue_code then
- -- it is dangerous to remove all the type of glue
- return removable_skip[subtype]
- elseif id == kern_code then
- -- remove only user's kern
- return subtype == userkern
- elseif id == glyph_code then
- return space_chars[n.char]
- end
- end
-end
-
-local function someleftbracket(n)
- if n then
- local id = n.id
- if id == glyph_code then
- return left_bracket_chars[n.char]
- end
- end
-end
-
-local function somerightbracket(n)
- if n then
- local id = n.id
- if id == glyph_code then
- return right_bracket_chars[n.char]
- end
- end
-end
-
-local function question_exclamation_sequence(n1, n2)
- if n1 and n2 then
- local id1 = n1.id
- local id2 = n2.id
- if id1 == glyph_code and id2 == glyph_code then
- return question_exclamation_chars[n1.char] and question_exclamation_chars[n2.char]
- end
- end
-end
-
--- idem
-local function somepenalty(n, value)
- if n then
- local id = n.id
- if id == penalty_code then
- if value then
- return n.penalty == value
- else
- return true
- end
- end
- end
-end
-
-local punct_attr = new_attribute("polyglossia_punct")
-
-local lang_id = {}
-local lang_counter = 0
-local left_space = {}
-local right_space = {}
-
-local function ensure_lang_id(lang)
- if not lang_id[lang] then
- lang_counter = lang_counter + 1
- lang_id[lang] = lang_counter
- end
- return lang_id[lang]
-end
-
-local function clear_spaced_characters(lang)
- local id = ensure_lang_id(lang)
- left_space[id] = {}
- right_space[id] = {}
-end
-
-local function illegal_unit(unit)
- if unit then
- texio.write_nl('Illegal spacing unit "'..unit..'".')
- else
- texio.write_nl('Spacing unit is a nil value.')
- end
-end
-
-local function add_left_spaced_character(lang, char, kern, unit, rubber)
--- The parameter kern is a number meant as a fraction of the unit.
--- The unit can be "quad" (1em) or "space" (interword space).
--- The parameter rubber is a Boolean value indicating if the inserted space is
--- stretchable and shrinkable (only relevant if the unit is "space").
- local id = ensure_lang_id(lang)
- if unit == "quad" or unit == "space" then
- left_space[id][char] = {}
- left_space[id][char]["kern"] = kern
- left_space[id][char]["unit"] = unit
- left_space[id][char]["rubber"] = rubber
- else
- illegal_unit(unit)
- end
-end
-
-local function add_right_spaced_character(lang, char, kern, unit, rubber)
- local id = ensure_lang_id(lang)
- if unit == "quad" or unit == "space" then
- right_space[id][char] = {}
- right_space[id][char]["kern"] = kern
- right_space[id][char]["unit"] = unit
- right_space[id][char]["rubber"] = rubber
- else
- illegal_unit(unit)
- end
-end
-
--- from typo-spa.lua, adapted
-local function process(head)
- local current = head
- while current do
- local id = current.id
- if id == glyph_code then
- local attr = has_attribute(current, punct_attr)
- if attr then
- local char, leftspace, rightspace
- if current.char <= 0x10FFFF then -- greater values may cause problems with utf8.char
- char = utf8.char(current.char)
- leftspace = left_space[attr][char]
- rightspace = right_space[attr][char]
- end
- if leftspace or rightspace then
- local fontparameters = fonts.hashes.parameters[current.font]
- local unit, stretch, shrink, spacing_node
- if leftspace and fontparameters then
- local prev = getprev(current)
- local space_exception = false
- if prev then
- -- do not add space after left (opening) bracket and between question/exclamation marks
- space_exception = someleftbracket(prev) or question_exclamation_sequence(prev, current)
- -- TODO: there is a question here: do we override a preceding space or not?...
- while somespace(prev) do
- head = remove_node(head, prev)
- prev = getprev(current)
- end
- if somepenalty(prev, 10000) then
- head = remove_node(head, prev)
- end
- end
- if leftspace.unit == "quad" then
- unit = fontparameters.quad
- spacing_node = get_kern_node(leftspace.kern*unit)
- elseif leftspace.unit == "space" then
- unit = fontparameters.space
- if leftspace.rubber then
- stretch = leftspace.kern*fontparameters.space_stretch
- shrink = leftspace.kern*fontparameters.space_shrink
- spacing_node = get_glue_node(leftspace.kern*unit, stretch, shrink)
- head = insert_node_before(head, current, get_penalty_node())
- else
- spacing_node = get_kern_node(leftspace.kern*unit)
- end
- end
- if not space_exception then
- head = insert_node_before(head, current, spacing_node)
- end
- end
- if rightspace and fontparameters then
- local next = getnext(current)
- local space_exception = false
- if next then
- -- do not add space before right (closing) bracket
- space_exception = somerightbracket(next)
- local nextnext = getnext(next)
- if somepenalty(next, 10000) and somespace(nextnext) then
- head, next = remove_node(head, next)
- end
- while somespace(next) do
- head, next = remove_node(head, next)
- end
- end
- if rightspace.unit == "quad" then
- unit = fontparameters.quad
- spacing_node = get_kern_node(rightspace.kern*unit)
- elseif rightspace.unit == "space" then
- unit = fontparameters.space
- if rightspace.rubber then
- stretch = rightspace.kern*fontparameters.space_stretch
- shrink = rightspace.kern*fontparameters.space_shrink
- spacing_node = get_glue_node(rightspace.kern*unit, stretch, shrink)
- if not space_exception then
- head, current = insert_node_after(head, current, get_penalty_node())
- end
- else
- spacing_node = get_kern_node(rightspace.kern*unit)
- end
- end
- if not space_exception then
- head, current = insert_node_after(head, current, spacing_node)
- end
- end
- end
- end
- elseif id == math_code then
- -- warning: this is a feature of luatex > 0.76
- current = end_of_math(current) -- weird, can return nil .. no math end?
- end
- current = getnext(current) -- no error even if current is nil
- end
- return head
-end
-
-local function activate(lang)
- local id = ensure_lang_id(lang)
- -- We set the punctuation attribute to a language id here. This is
- -- 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
-
-local function deactivate()
- tex.setattribute(punct_attr, -0x7FFFFFFF) -- this value means "unset"
- -- Though it would make compilation slightly faster, it is not possible to
- -- safely uncomment the following lines. Imagine the following case: you
- -- start a paragraph by some spaced punctuation text, then, in the same
- -- paragraph, you change the language to something else, and thus call the
- -- following lines. This means that, at the end of the paragraph, the
- -- function won't be in the callback, so the beginning of the paragraph
- -- won't be processed by it.
- -- if priority_in_callback(callback_name, "polyglossia-punct.process") then
- -- remove_from_callback(callback_name, "polyglossia-punct.process")
- -- end
-end
-
-polyglossia.activate_punct = activate
-polyglossia.deactivate_punct = deactivate
-polyglossia.add_left_spaced_character = add_left_spaced_character
-polyglossia.add_right_spaced_character = add_right_spaced_character
-polyglossia.clear_spaced_characters = clear_spaced_characters
-% \end{macrocode}
-% \iffalse
-%</polyglossia-punct.lua>
-%<*polyglossia-sanskrit.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-sanskrit.lua}
-% \begin{macrocode}
---
--- polyglossia-sanskrit.lua
--- part of polyglossia v2.1 -- 2024/03/07
---
-
-require('polyglossia-punct')
-
--- How do we now, in Lua, what a \thinspace is? In the LaTeX source (latex.ltx)
--- it is defined as:
--- \def\thinspace{\leavevmode@ifvmode\kern .16667em }
--- I see no way of seeing if it has been overriden or not. So we stick to this
--- value.
-local thinspace = 0.16667 -- 1/6
-
-local function space_left(char)
- polyglossia.add_left_spaced_character('sanskrit', char, thinspace, 'quad')
-end
-
-polyglossia.clear_spaced_characters('sanskrit')
-space_left('!')
-space_left('?')
-space_left('‼')
-space_left('⁇')
-space_left('⁈')
-space_left('⁉')
-space_left('‽') -- U+203D (interrobang)
-space_left(':')
-space_left(';')
-space_left('।') -- danda, U+0964
-space_left('॥') -- double danda, U+0965
-
-local function activate_sanskrit_punct()
- polyglossia.activate_punct('sanskrit')
-end
-
-local function deactivate_sanskrit_punct()
- polyglossia.deactivate_punct()
-end
-
-polyglossia.activate_sanskrit_punct = activate_sanskrit_punct
-polyglossia.deactivate_sanskrit_punct = deactivate_sanskrit_punct
-% \end{macrocode}
-% \iffalse
-%</polyglossia-sanskrit.lua>
-%<*polyglossia-tibt.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-tibt.lua}
-% \begin{macrocode}
---
--- polyglossia-tibt.lua
--- part of polyglossia v2.1 -- 2024/03/07
---
-
-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 next, type = next, type
-
-local nodes, fonts, node = nodes, fonts, node
-
-local nodecodes = nodes.nodecodes --- <= preloaded node.types()
-
-local insert_node_before = node.insert_before
-local insert_node_after = node.insert_after
-local remove_node = nodes.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 end_of_math = function (n)
- for n in traverse_nodes(math_code, n.next) do
- return n
- end
- end
-end
-
--- node types as of April 2013
-local glyph_code = nodecodes.glyph
-local penalty_code = nodecodes.penalty
-local kern_code = nodecodes.kern
-
--- we make a new node, so that we can copy it later on
-local penalty_node = node.new(penalty_code)
-penalty_node.penalty = 50 -- corresponds to the penalty LaTeX sets at explicit hyphens
-
-local function get_penalty_node()
- return copy_node(penalty_node)
-end
-
-local xpgtibtattr = luatexbase.attributes['xpg@tibteol']
-
-local tsheg = unicode.utf8.byte('་')
-
--- from typo-spa.lua
-local function process(head)
- local start = head
- -- head is always begin of par (whatsit), so we have at least two prev nodes
- -- penalty followed by glue
- while start do
- local id = start.id
- if id == glyph_code then
- local attr = has_attribute(start, xpgtibtattr)
- if attr and attr > 0 then
- if start.char == tsheg then
- if start.next then
- insert_node_after(head,start,get_penalty_node())
- end
- 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
- start = start.next
- end
- end
- return head
-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
-end
-
-local function desactivate()
- if priority_in_callback (callback_name, "polyglossia-tibt.process") then
- remove_from_callback(callback_name, "polyglossia-tibt.process")
- end
-end
-
-polyglossia.activate_tibt_eol = activate
-polyglossia.desactivate_tibt_eol = desactivate
-% \end{macrocode}
-% \iffalse
-%</polyglossia-tibt.lua>
-%<*polyglossia.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia.lua}
-% \begin{macrocode}
---
--- polyglossia.lua
--- part of polyglossia v2.1 -- 2024/03/07
---
-
-local module_name = "polyglossia"
-local polyglossia_module = {
- name = module_name,
- version = 1.3,
- date = "2013/05/11",
- description = "Polyglossia",
- author = "Elie Roux",
- copyright = "Elie Roux",
- license = "CC0"
-}
-
-luatexbase.provides_module(polyglossia_module)
-
-local log_info = function(message, ...)
- luatexbase.module_info(module_name, message:format(...))
-end
-local log_warn = function(message, ...)
- luatexbase.module_warning(module_name, message:format(...))
-end
-
-polyglossia = polyglossia or {}
-local polyglossia = polyglossia
-
-local function load_tibt_eol()
- require('polyglossia-tibt')
-end
-
--- predefined l@nohyphenation or LuaTeX's maximum value for \language
-local nohyphid = luatexbase.registernumber'l@nohyphenation' or 16383
-token.set_char('l@nohyphenation', nohyphid)
-
--- key `nohyphenation` is for .sty file when possibly undefined l@nohyphenation
-local newloader_loaded_languages = { nohyphenation = nohyphid }
-
-local newloader_available_languages = require'language.dat.lua'
--- Suggestion by Dohyun Kim on #129
-local t = { }
-for k, v in pairs(newloader_available_languages) do
- t[k] = v
- for _, vv in pairs(v.synonyms) do
- t[vv] = v
- end
-end
-newloader_available_languages = t
-
--- LaTeX's language register is \count19
-local lang_register = 19
-
--- New hyphenation pattern loader: use language.dat.lua directly and the language identifiers
-local function newloader(langentry)
- local loaded_language = newloader_loaded_languages[langentry]
- if loaded_language then
- local langid = lang.id(loaded_language)
- log_info('Language %s already loaded; id is %i', langentry, langid)
- return langid
- else
- local langdata = newloader_available_languages[langentry]
- if langdata then
-
- local special = langdata.special
- if special then
- -- language0 (USenglish) is already included in the format
- if special == 'language0' then
- return 0
-
- -- disabled language should not be used for utf-8 text
- elseif special:find'^disabled:' then
- log_warn('Hyphenation of language %s %s', langentry, special)
- return nohyphid
- end
- end
-
- -- language info will be written into the .log file
- local s = { "Language data for " .. langentry }
- for k, v in pairs(langdata) do
- if type(v) == 'table' then -- for 'synonyms'
- s[#s+1] = k .. "\t" .. table.concat(v,',')
- else
- s[#s+1] = k .. "\t" .. tostring(v)
- end
- end
- log_info(table.concat(s,"\n"))
-
- --
- -- LaTeX's \newlanguage increases language register (count19),
- -- whereas LuaTeX's lang.new() increases its own language id.
- -- So when a user has declared, say, \newlanguage\lang@xyz, then
- -- these two numbers do not match each other. If we do not consider
- -- this possible situation, our newloader() function will
- -- unfortunately overwrite the language \lang@xyz.
- --
- -- Threfore 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
- -- overwrite our language object.
- --
- -- get next \newlanguage allocation number
- local langcnt = tex.count[lang_register] + 1
- -- get new lang object
- local langobject = lang.new()
- local langid = lang.id(langobject)
- -- get bigger one between \newlanguage and new lang obj id
- local newlangid = math.max(langcnt, langid)
- -- set language register for possible \newlanguage
- tex.setcount('global', lang_register, newlangid)
- -- get new lang object if needeed
- if langid ~= newlangid then
- langobject = lang.new(newlangid)
- end
-
- -- load hyphenation patterns and exceptions
- for _,v in ipairs{ 'patterns', 'hyphenation' } do
- local data = langdata[v]
- if data and data ~= '' then
- -- cope with comma separated list, such as serbian
- for _,vv in ipairs(data:explode',+') do
- local filepath = kpse.find_file(vv)
- if filepath then
- local fh = io.open(filepath)
- lang[v](langobject, fh:read'a')
- fh:close()
- else
- log_warn('Hyphenation file %s not found', vv)
- end
- end
- end
- end
-
- newloader_loaded_languages[langentry] = langobject
-
- log_info('Language %s was not yet loaded; created with id %i',
- langentry, newlangid)
- return newlangid
- else
- log_warn('Language %s not found in language.dat.lua', langentry)
- return nohyphid
- end
- end
-end
-
-polyglossia.load_tibt_eol = load_tibt_eol
-polyglossia.newloader = newloader
-polyglossia.newloader_loaded_languages = newloader_loaded_languages
-% \end{macrocode}
-% \iffalse
-%</polyglossia.lua>
-% \fi
-% \clearpage
-% \PrintChanges
-% \Finale
-%
-% \iffalse
-%<*examples.tex>
-\documentclass[a4paper]{article}
-\usepackage[no-math]{fontspec}
-\usepackage{xltxtra,url}
-\let\XeTeX\undefined
-\let\XeLaTeX\undefined
-\usepackage{polyglossia}
-\usepackage{trace}
-\setdefaultlanguage{french}
-\setotherlanguage[variant=british,ordinalmonthday=false]{english}
-\setotherlanguage[variant=poly]{greek}
-\setotherlanguage[numerals=thai]{thai}
-\setotherlanguage[locale=mashriq]{arabic}
-\setotherlanguage[spelling=new,latesthyphen=true,babelshorthands=true]{german}
-\setotherlanguages{latin,russian,turkish,polish,latvian,sanskrit,ukrainian,farsi,syriac,divehi,hebrew,amharic,nko}
-\setotherlanguage[calendar=gregorian,numerals=western]{urdu}
-\setmainfont{Linux Libertine O}
-\defaultfontfeatures{Scale=MatchLowercase}
-\setmonofont{Inconsolata}
-\newfontfamily\arabicfont[Script=Arabic]{Amiri}
-\newfontfamily\syriacfont[Script=Syriac]{Serto Jerusalem}
-\newfontfamily\hebrewfont[Script=Hebrew]{Ezra SIL}
-\newfontfamily\sanskritfont[Script=Devanagari]{Sanskrit 2003}
-\newfontfamily\thaifont[Script=Thai]{Norasi}
-\newfontfamily\thaanafont[Script=Thaana,WordSpace=2]{FreeSerif}
-\newfontfamily\ethiopicfont[Script=Ethiopic]{Abyssinica SIL}
-\newfontfamily\nkofont[Renderer=Graphite]{Conakry}
-\parskip 1.33\baselineskip
-%\newcommand\showhyphmin{\fbox{\the\lefthyphenmin\ \the\righthyphenmin}}
-\begin{document}
-\hyphenation{Bru-xel-les}
-\noindent
-\textbf{Le français}\footnote{ From \url{http://fr.wikipedia.org/wiki/Français}} est une langue romane parlée en France, dont elle est originaire (la «langue d'oïl»), ainsi qu'en Afrique francophone, au Canada (principalement au Québec, au Nouveau-Brunswick et en Ontario), en Belgique (en Région wallonne et à Bruxelles), en Suisse, au Liban, en Haïti et dans d'autres régions du monde, soit au total dans 51 pays du monde ayant pour la plupart fait partie des anciens empires coloniaux français et belge. \\
-(\today)
-
-\begin{english}
-\textbf{English}\footnote{From \url{http://en.wikipedia.org/wiki/English_language}} is a West Germanic language originating in England, and the first language for most people in Australia, Canada, the Commonwealth Caribbean, Ireland, New Zealand, the United Kingdom and the United States of America (also commonly known as the Anglosphere). It is used extensively as a second language and as an official language throughout the world, especially in Commonwealth countries and in many international organisations. \\
-(\today)
-\end{english}
-
-\begin{german}
-\textbf{Die deutsche Sprache}\footnote{ From \url{http://de.wikipedia.org/wiki/Deutsche_Sprache}} (auch das Deutsche) gehört zum westlichen Zweig der germanischen Sprachen und ist eine der meistgesprochenen europäischen Sprachen weltweit, und gilt so als Weltsprache.\\
-(\today)
-\end{german}
-
-\begin{russian}
-\textbf{Русский язык} — один из восточнославянских языков, один из крупнейших языков мира, в том числе самый распространённый из славянских языков и самый распространённый язык Европы, как географически, так и по числу носителей языка как родного (хотя значительная, и географически бо́льшая, часть русского языкового ареала находится в Азии). \\
-(\today)
-\end{russian}
-
-\begin{latin}
-\textbf{Lingua Latina} est lingua Indoeuropaea. Nomen ductum est de terra in paeninsula Italica quam Latine loquentes incolebant, Vetus Latium appellata sitaque inter flumen Tiberis, Volscam terram, mare Tyrrhenicum, montes Apenninos.
-Quamquam sermone nativo fungi desinit, cumque nostris diebus perpauci Latine loqui possint, lingua mortua appellari solet, multas tamen peperit linguas quae linguae romanicae vocantur, sicut Hispanicam, Francogallicam, Italicam, Lusitanam, Dacoromanicam, Gallaicam, ne omnes afferam. \\
-(\today)
-\end{latin}
-
-\begin{greek}
-\textbf{Η ελληνική γλώσσα} είναι μία από τις ινδοευρωπαϊκές γλώσσες, για την
-οποία έχουμε γραπτά κείμενα από τον 15ο αιώνα π.Χ. μέχρι σήμερα. Αποτελεί το
-μοναδικό μέλος ενός κλάδου της ινδοευρωπαϊκής οικογένειας γλωσσών. Ανήκει
-επίσης στον βαλκανικό γλωσσικό δεσμό.\\
-(\today)
-\end{greek}
-
-
-\begin{hebrew}[numerals=hebrew]
-\textbf{עברית} היא שפה ממשפחת השפות השמיות, הידועה כשפתו של העם היהודי, ואשר ניב מודרני שלה משמש כשפה הרשמית והעיקרית של מדינת ישראל. \\
-(\today\ = \hebrewtoday)
-\end{hebrew}
-
-\begin{syriac}[numerals=abjad]
-ܠܫܢܐ ܐܪܡܝܐ ܐܘ ܐܪܡܝܬ ܗܘ ܠܫܢ̈ܐ ܥܡ ܬܫܥܝܬܐ ܕ\textrm{3000} ܫܢ̈ܝܐ܂ ܗܘܐ ܠܫܢܐ ܕܡܠܟܘ̈ܬܐ ܘܬܘܕ̈ܝܬܐ܂ ܥܡ ܠܫܢܐ ܥܒܪܝܐ܄ ܗܘܐ ܠܫܢܐ ܕܣܦܪ̈ܐ ܕܕܢܝܐܝܠ ܘܥܙܪܐ ܘܗܘ ܠܫܢܐ ܚܕܢܝܐ ܕܬܠܡܘܕ܂ ܐܪܡܝܐ ܗܘܐ ܠܫܢܐ ܕܝܫܘܥ܂ ܐܕܝܘܡ܄ ܐܪܡܝܐ ܗܘ ܠܫܢܐ ܕܟܠܕ̈ܝܐ܄ ܐܬܘܪ̈ܝܐ܄ ܡܪ̈ܘܢܝܐ܄ ܘܣܘܪ̈ܝܝܐ܀ \\
-(\today)
-\end{syriac}
-
-\begin{turkish}
-\textbf{Türkiye Türkçesi}, Ural-Altay Dilleri içerisinde Türk dil ailesinin Oğuz Grubu'na mensup lehçedir. Anadolu, Kıbrıs, Balkanlar ve Orta Avrupa'da geniş yayılım alanı bulmuş olup, Türkiye Cumhuriyeti, Kuzey Kıbrıs Türk Cumhuriyeti, Güney Kıbrıs Rum Kesimi, Makedonya ve Kosova'nın resmî dilidir. \\
-(\today = \Hijritoday)
-\end{turkish}
-
-\begin{polish}
-\textbf{Język polski (polszczyzna)} należy wraz z językiem czeskim, słowackim, pomorskim (kaszubskim), dolnołużyckim, górnołużyckim oraz wymarłym połabskim do grupy języków zachodniosłowiańskich, stanowiących część rodziny języków indoeuropejskich. Ocenia się, że język polski jest językiem ojczystym około 44 milionów ludzi na świecie (w literaturze naukowej można spotkać szacunki od 40 do 48 milionów), mieszkańców Polski oraz Polaków zamieszkałych za granicą (Polonia).\\
-(\today)
-\end{polish}
-
-\begin{latvian}
-\textbf{Latviešu valoda} ir dzimtā valoda apmēram 1,5 miljoniem cilvēku, galvenokārt Latvijā, kurā tā ir vienīgā valsts valoda. Lielākās latviešu valodas pratēju kopienas ārzemēs ir Austrālijā, ASV, Zviedrijā, Lielbritānijā, Vācijā, Brazīlijā, Krievijā. Latviešu valoda pieder indoeiropiešu valodu saimes baltu valodu grupai.\\
-(\today)
-\end{latvian}
-
-\begin{ukrainian}
-\textbf{Українська мова} — східнослов'янська мова, входить до однієї підгрупи з білоруською та російською. Подібно до цих мов українську записують кирилицею. Історично білоруська та українська мови походять з давньоруської (давньоукраїнської) — розмовної мови Київської Русі.\\
-(\today)
-\end{ukrainian}
-
-\begin{sanskrit}
-{\Large ससकत} पृथिव्यां प्राचीना समृद्घा वैज्ञानिकी च भाषा मन्यते । विश्ववाङ्‌मयेषु संस्कृतं श्रेष्ठरत्नम् इति न केवलं भारते अपि तु समग्रविश्वे एतद्विषये निर्णयाधिकारिभि: जनै: स्वीकृतम् । महर्षि पाणिनिना विरचिता अष्टाध्यायी इति संस्कृतव्याकरणम्‌ अधुनापि भारते विदेशेषु च भाषाविज्ञानिनां प्रेरणास्‍थानं वर्तते . संस्कृतशब्दा: एव उत्तरं दक्षिणं च भारतं संयोजयन्ति ।
-\end{sanskrit}
-
-\begin{Arabic}[]
-«اعلم أنّ فنّ التاريخ فنّ عزيز المذهب، جمّ الفوائد، شريف الغاية؛ إذ هو يوقفنا على أحوال الماضين من الأمم في أخلاقهم، و الأنبياء في سيرهم، و الملوك في دولهم و سياستهم؛ حتّى تتمّ فائدة الإقتداء في ذلك لمن يرومه في أحوال الدين و الدنيا.» (ابن خلدون، المقدّمة)\\
-(\today\ = \Hijritoday[0])
-\end{Arabic}
-
-\begin{farsi}
-فارسی یا پارسی، (که دری، فارسی دری، و پارسی دری نیز نامیده می‌شود) زبانی است که
-در کشورهای ایران، افغانستان، تاجیکستان و ازبکستان به آن سخن می‌رانند. \\
-(\Jalalitoday = \Hijritoday)
-\end{farsi}
-
-\pagebreak
-\begin{urdu}
-اُردو ایک ہندآریائی زبان ہے جس کا تعلّق ہند یوروپی لسانی خاندان کی ہندایرانی شاخ سے ہے۔ بارہویں صدی میں ہندوستان کی مقامی زبانوں اور فارسی، عربی، اور تُرکی زبانوں کے اختلاط سے اردو وجود میں آئی۔ اردو پاکستان کی قومی زبان ہے، اور ہندوستان کی 23 سرکاری زبانوں میں سے ایک ہے۔ جنوبی ایشیا کے باہر خلیجِ فارس کے ممالک، سعودی عرب، برطانیہ، امریکہ، کنیڈا، جرمنی، ناروے، اور آسٹریلیا میں بھی جنوبی ایشیائی مہاجرین کی بڑی تعداد اردو بولتی ہے۔ \\
-
-(\today\ مطابق \Hijritoday[0])
-\end{urdu}
-
-\begin{thai}
-เป็น\wbr แผนงานเพื่อ\wbr สนับสนุน\wbr การ\wbr ร่วมกัน\wbr สร้าง, การ\wbr ร่วมกันใช้, และ\wbr การ%
-ร่วมกัน\wbr พัฒนา\wbr ทรัพยากร\wbr ทาง\wbr ภาษา\wbr ของ\wbr ภาษา\wbr ไทย, บน\wbr เครือข่าย World Wide Web. แผนงานนี้\wbr มี%
-จุด\wbr ประสงค์หลั\wbr กอยู่\wbr สอง\wbr ประการคือ เพื่อแก้ปัญหา\wbr กำ\wbr แพง\wbr ทาง\wbr ภาษา, และรักษา%
-ไว้เพื่อ\wbr ความค\wbr งอยู่\wbr ของ\wbr ภาษา\wbr และ\wbr วัฒนธรรม\wbr ไทย. \\
-(\today)
-\end{thai}
-
-\begin{divehi}\small\sloppy
-ދިވެހިބަހަކީ ދިވެހިރާއްޖޭގެ ރަސްމީ ބަހެވެ. މި ބަހުން ވާހަކަ ދައްކައި އުޅެނީ ދިވެހިރާއްޖޭގެ އަހުލުވެރިންގެ އިތުރުން ހިންދުސްތާނުގެ މަލިކު ގެ
-އަހުލުވެރިންނެވެ. އެބައިމީހުން މި ބަހަށް ކިޔަނީ މަހަލް ބަހެވެ. ބަހާބެހޭ މާހިރުން ދިވެހިބަސް ހިމަނުއްވައިފައިވަނީ އިންޑޯ އާރިޔަން ބަސްތަކުގެ
-ތެރޭގަ އެވެ.
-\end{divehi}
-
-%\fontspec[Script=Georgian]{DejaVu Serif}
-%ქართული ენა არის საქართველოს სახელმწიფო ენა (აფხაზეთის ავტონომიურ რესპ\-უბლიკაში მის პარალელურად სახელმწიფო ენად აღიარებულია აგრეთვე აფხაზური ენა). ქართულ ენაზე 7 მილიონზე მეტი ადამიანი ლაპარაკობს.
-%
-
-\begin{amharic}
-\textbf{አማርኛ} የኢትዮጵያ መደበኛ ቋንቋ ነው። ከሴማዊ ቋንቋዎች እንደ ዕብራይስጥ ወይም ዓረብኛ አንዱ ነው። እንዲያውም 27 ሚሊዮን ያህል ተናጋሪዎች እያሉት፣ አማርኛ ከአረብኛ ቀጥሎ ትልቁ ሴማዊ ቋንቋ ነው። የሚጻፈውም በግዕዝ ፊደል ነው። አማርኛ ክዓረብኛና ከዕብራይስጥ ያለው መሰረታዊ ልዩነት አንደላቲን ከግራ ወደ ቀኝ መጻፉ ነው። \\
-(\today)
-\end{amharic}
-
-\begin{nko}
-ߒߞߏ ߦߋ߫ ߛߓߍߟߌߞߊ߲ߞߋ ߟߋ߬ ߘߌ߫ ߝߘߊ߬ߝߌ߲߬ߠߊ߫ ߕߟߋ߬ߓߋ ߘߐ߫ ߡߊ߲߬ߘߋ߲߬ ߡߌߙߌ߲ߘߌ ߞߊ߲ ߞߊߡߊ߬߸ ߊ߬ ߣߴߊ߬ ߡߟߋߞߎߦߊߞߊ߲ ߕߐ߮ ߟߋ߬. ߞߊ߬ߕߎ߲߯ ߸ ߊ߬ ߞߘߐ ߟߋ߬ ߡߊ߲߬ߘߋ߲߫ ߝߘߏ߬ߓߊ߬ߞߊ߲ ߓߏߟߏ߲ ߓߍ߯ ߘߐ߫ ߞߏ߫: ߒ ߞߊ߲߫ ߠߋ߬ ߞߏ߫. ߝߣߊ߫߸ ߊ߬ ߦߋ߫ ߟߊߓߊ߯ߙߟߊ߫ ߟߊ߫ ߖߡߊ߬ߣߊ ߢߌ߲߬ ߠߎ߫ ߟߋ߬ ߘߐ߫ ߓߊߞߍ߭: ߖߌ߬ߣߍ߫، ߜߋ߲ߞߐ߰ߖߌ߬ߘߊ، ߊ߬ ߣߌ߫ ߡߊߟߌ߫.
-\\
-(\today)
-\end{nko}
-
-\end{document}
-%</examples.tex>
-%<*example-arabic.tex>
-% !TeX TS-program = xelatex
-\documentclass[a4paper]{book}%
-\usepackage[no-math]{fontspec}
-\usepackage{xltxtra,url,amsmath}
-\setmainfont{Linux Libertine O}
-\defaultfontfeatures{Scale=MatchLowercase}
-\newfontfamily\arabicfont[Script=Arabic]{Amiri}
-\newfontfamily\arabicfonttt[Script=Arabic,Scale=.75]{DejaVu Sans Mono}
-\newfontfamily\farsifont[Script=Arabic,Scale=1.1,WordSpace=2]{IranNastaliq}
-\let\XeTeX\undefined
-\let\XeLaTeX\undefined
-\usepackage[quiet,nolocalmarks]{polyglossia}
-\setdefaultlanguage[calendar=gregorian,hijricorrection=1,locale=mashriq]{arabic}
-\setotherlanguage[variant=british]{english}
-\setotherlanguage{farsi}
-\parindent 0pt
-\title{اختبار دعم اللغة العربية}
-\author{فرانسوا شاريت}
-\begin{document}
-\pagenumbering{alph}
-\maketitle
-\tableofcontents
-\chapter{تجربة}
-\pagenumbering{arabic}
-\section{لغات مختلفة}
-
-\textbf{العربية}\footnote{%
-من «\LR{\textenglish{\url{http://ar.wikipedia.org/wiki/}}\RL{\ttfamily لغة عربية}}»}
-أكبر لغات المجموعة السامية من حيث عدد المتحدثين، وإحدى أكثر اللغات انتشارا في
-العالم، يتحدثها أكثر من ٤٢٢ مليون نسمة، ويتوزع متحدثوها في المنطقة المعروفة
-باسم الوطن العربي، بالإضافة إلى العديد من المناطق الأخرى المجاورة كالأحواز وتركيا
-وتشاد ومالي والسنغال. وللغة العربية أهمية قصوى لدى أتباع الديانة الإسلامية، فهي
-لغة مصدري التشريع الأساسيين في الإسلام: القرآن، والأحاديث النبوية المروية عن النبي
-محمد، ولا تتم الصلاة في الإسلام (وعبادات أخرى) إلا بإتقان بعض من كلمات هذه اللغة.
-والعربية هي أيضًا لغة طقسية رئيسية لدى عدد من الكنائس المسيحية في العالم العربي،
-كما كتبت بها الكثير من أهم الأعمال الدينية والفكرية اليهودية في العصور الوسطى.
-وإثر انتشار الإسلام، وتأسيسه دولا، ارتفعت مكانة اللغة العربية، وأصبحت لغة السياسة
-والعلم والأدب لقرون طويلة في الأراضي التي حكمها المسلمون، وأثرت العربية، تأثيرا
-مباشرا أو غير مباشر على كثير من اللغات الأخرى في العالم الإسلامي، كالتركية
-والفارسية والأردية مثلا.
-
-\textlang{farsi}{\bfseries فارسی}\footnote{%
-از «\LR{\textenglish{\url{http://fa.wikipedia.org/wiki/}}\RL{\ttfamily فارسي}}»}
-\begin{farsi}
-یا پارسی، (که دری، فارسی دری، و پارسی دری نیز نامیده می‌شود) زبانی است که
-در کشورهای ایران، افغانستان، تاجیکستان و ازبکستان به آن سخن می‌رانند.
-(برخی زبان فارسی در تاجیکستان و ازبکستان و چین را فارسی تاجیکی نام
-می‌گذارند).
-\end{farsi}
-
-\newpage
-\begin{english}
-\textbf{English}\footnote{%
- From \url{http://en.wikipedia.org/wiki/English_language}}
-is a West Germanic language originating in England, and the first language for
-most people in Australia, Canada, the Commonwealth Caribbean, Ireland, New
-Zealand, the United Kingdom and the United States of America (also commonly
-known as the Anglosphere). It is used extensively as a second language and as
-an official language throughout the world, especially in Commonwealth countries
-and in many international organisations.
-
-\textarabic{١ ٢ ٣}
-
-\end{english}
-\clearpage
-
-\section{أعمال تأريخية \textenglish{(Calendar operations)}}
-
-%\textenglish{\today} = \LTR{\today} =
-\setfootnoteLR
-\today\ = \Hijritoday%\footnote{
-% محسوب بـ \textenglish{\textsf{hijrical.sty}}}
-\LTRfootnote{ What is this?}
-\setfootnoteRL
-
-%\newpage
-\subsection{فلان}
-\textenglish{This is English: a b c}\marginpar{انكليزي} %FIXME! cf farsitex?
-
-\subsubsection{فلان فلان}
-\begin{enumerate}
- \item مثال
- \item مثال
- \begin{enumerate}
- \item مثال
- \item مثال
- \end{enumerate}
-
- \item مثال
-\end{enumerate}
-
-\begin{table}[h]
- \centering
- \begin{tabular}{cc}
- ا & ب \\
- ج & د
- \end{tabular}
- \caption{هذا المثال}
-\end{table}
-
-\[
-x^\text{مال مال}
-\]
-
-\begin{equation}
- x^2 + y^2 = z^2
- \label{test}
-\end{equation}
-\end{document}
-%</example-arabic.tex>
-%<*example-thai.tex>
-\documentclass[a4paper]{article}
-\usepackage[no-math]{fontspec}
-\usepackage{xltxtra,url}
-\usepackage{polyglossia}
-\setdefaultlanguage[numerals=thai]{thai}
-\setotherlanguage{english}
-\setmainfont{Norasi}
-\begin{document}
-\begin{center}
- \abstractname
-\end{center}
-\begin{english}
-Some English to begin with.\footnote{ %
- Blabla}
-\end{english}
-%%% NOTE: The wordbreak (\wbr) commands were inserted by the preprocessor cttex
-%%% (available from http://linux.thai.net/pub/thailinux/cvs/software/cttex/
-%%% or from http://packages.debian.org/cttex)
-%%% using the command :
-%%% $ cttex-utf8 <infile.tex> <outfile.tex>
-%%% where cttex-utf8 is the following simple shell script:
-%%% #!/bin/bash
-%%% cat $1 | iconv -f UTF-8 -t TIS-620 | cttex -w | sed 's/<WBR>/\\wbr /g' | iconv -f TIS-620 -t UTF8 > $2
-%%% (this should also work on MacOSX; windows users need to tweak it into a batch file I guess)
-
-เป็น\wbr แผนงานเพื่อ\wbr สนับสนุน\wbr การ\wbr ร่วมกัน\wbr สร้าง, การ\wbr ร่วมกันใช้, และ\wbr การ%
-ร่วมกัน\wbr พัฒนา\wbr ทรัพยากร\wbr ทาง\wbr ภาษา\wbr ของ\wbr ภาษา\wbr ไทย, บน\wbr เครือข่าย World Wide Web. แผนงานนี้\wbr มี%
-จุด\wbr ประสงค์หลั\wbr กอยู่\wbr สอง\wbr ประการคือ เพื่อแก้ปัญหา\wbr กำ\wbr แพง\wbr ทาง\wbr ภาษา, และรักษา%
-ไว้เพื่อ\wbr ความค\wbr งอยู่\wbr ของ\wbr ภาษา\wbr และ\wbr วัฒนธรรม\wbr ไทย.
-
-เรา\wbr ตระหนัก\wbr ดีถึง\wbr ความ\wbr สำคัญ\wbr ของ\wbr ภาษา ซึ่ง\wbr นอกจาก\wbr จะ\wbr เป็นสื่อ\wbr ระหว่าง\wbr คนกับ\wbr คน\wbr แล้ว ยัง\wbr เป็น%
-รูปแทน\wbr ความคิด และ\wbr เป็น\wbr เครื่องมือ\wbr ใน\wbr การใช้\wbr ความคิด\wbr ด้วย. เครือข่าย\wbr คอมพิวเตอร์%
-ใน\wbr ปัจจุบัน\wbr ทำให้ข้อมูล\wbr ข่าวสาร\wbr แพร่หลาย\wbr ไป\wbr อย่าง\wbr รวดเร็ว. เครื่องมือที่ใช้\wbr ใน\wbr การแส\wbr ดง\wbr ผล%
-และ\wbr การเต\wbr รี\wbr ยมข้อมูล\wbr ข่าวสาร\wbr นั้น จึง\wbr เป็นสิ่ง\wbr จำ\wbr เป็น. ด้วย\wbr เทคโนโลยีที่\wbr ก้าวหน้า\wbr ไป%
-อย่าง\wbr รวดเร็ว, การที่\wbr เพียง\wbr จะ\wbr สามารถแส\wbr ดง\wbr ผลได้หรือ\wbr ป้อนข้อมูลได้\wbr เท่านั้น ไม่\wbr เป็นที่%
-เพียงพออีก\wbr แล้ว. การแส\wbr ดง\wbr ผลที่\wbr สวย\wbr งาม\wbr ถูก\wbr ต้อง\wbr ตาม\wbr แบบแผน หรือ\wbr การเต\wbr รี\wbr ยมข้อมูลได้\wbr อย่าง%
-ถูก\wbr ต้อง และ\wbr รวดเร็วจึง\wbr เป็นสิ่งที่\wbr จำ\wbr เป็นที่\wbr จะ\wbr ต้อง\wbr พัฒนาให้\wbr ทันตาม\wbr การ\wbr เปลี่ยนแปลง\wbr ของ%
-เทคโนโลยี.\footnote{ %
- Second footnote}
-
-\today
-
-\begin{english}
-This is today: \today
-\end{english}
-
-\begin{enumerate}
- \item A
- \item B
- \begin{enumerate}
- \item a
- \item b
- \item c
- \end{enumerate}
- \item C
-\end{enumerate}
-\end{document}
-%</example-thai.tex>
-% \fi
-%
-% \typeout{*************************************************************}
-% \typeout{*}
-% \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{*}
-% \typeout{* You also need to compile the *.map files with teckit_compile}
-% \typeout{* and place the resulting *.tec files under}
-% \typeout{* .../fonts/misc/xetex/fontmapping}
-% \typeout{*}
-% \typeout{*************************************************************}
-\endinput
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..e26daf2f5a6 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-09-22 v1.2}
\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
@@ -199,7 +199,7 @@ colorlinks,
% \date{\filedate}
%
% \maketitle
-%
+%^^A
% \begin{abstract}
% \noindent When writing a large manuscript, it is sometimes
% beneficial to repeat a theorem (or lemma or \dots) at
@@ -211,21 +211,21 @@ colorlinks,
% of the |.aux| file, and also introduces its own file
% extension, |.thm|, to replicate theorems in other files.
% \end{abstract}
-%
+%^^A
% \tableofcontents
-%
+%^^A
%\changes{v1.0}{2024-03-27}{First public release}
-%
-%
-%
+%^^A
+%^^A
+%^^A
%\StopEventually{^^A
% \PrintChanges
% \PrintIndex
%}
-%
-%
-%
-%
+%^^A
+%^^A
+%^^A
+%^^A
% \section{Repeating theorems}
% Let's say we define a theorem as follows:
% \begin{verbatim}
@@ -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}
@@ -257,55 +257,55 @@ colorlinks,
% difference is that we have saved the theorem for later use.\par
% The |makethm| environment takes two mandatory arguments
% and one optional one. The first mandatory argument is the
-% type of theorem environment, like |theorem|, |lemma|,
+% type of theorem environment as defined in \textsf{amsthm}, like |theorem|, |lemma|,
% |definition|, etc. The second is the theorem's label.
-% The label is mandatory because to replicate the theorem,
+% The label is mandatory since, to replicate the theorem,
% we need to have a ``name'' attached to it. |makethm|
% automatically attaches a |\label|, as well, so |\ref{thm:Yoneda}|
% becomes \ref{thm:Yoneda}. The optional argument is passed
% right to the optional argument of the theorem environment,
-% giving the name of a theorem\par
-%
+% giving the theorem a name.\par
+%^^A
% Now let's say we want to replicate the theorem later
% or earlier in the text. This may be done if, for example,
% 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.
-% \begin{verbatim}
-% \repthm{theorem}{thm:Yoneda}
-% \end{verbatim}
+% \DescribeMacro{\repthm} |\repthm| command: |\repthm{thm:Yoneda}|.
% 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]
-% If we do the same without providing an alt text, we get
-% \repthm{theorem}{thm:foo}
-% together with a warning.\par
+% |\repthm{thm:foo}[bar]| returns
+% \repthm{thm:foo}[bar]
+% \noindent If we do the same without providing an alt text, we get
+% \repthm{thm:foo}
+% \noindent together with a warning: ``Package \textsf{reptheorem}: Theorem |thm:foo|
+% 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.''\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}
-% \begin{makethm}{theorem}{thm:later}[Later]
+% \repthm{thm:later}
+% \begin{makethm}{theorem}{thm:later}
% Alligator!
% \end{makethm}
% \end{verbatim}
% returns
-% \repthm{theorem}{thm:later}
-% \begin{makethm}{theorem}{thm:later}[Later]
+% \repthm{thm:later}
+% \begin{makethm}{theorem}{thm:later}
% Alligator
% \end{makethm}
% Note that it is necessary to run a |.tex| file twice
% to replicate theorems ahead of time, similarly to
% how one has to run a file twice to make sure the
% references are correct.\par
-%
+%^^A
% \section{Replicating theorems between files}
% Let's say we have the following files for our project:
% \begin{verbatim}
@@ -328,7 +328,7 @@ colorlinks,
% In our example, if we also defined a |thm:baz| in |foo.tex|,
% loading |bar.thm| into |foo.tex| will not overwrite the local
% |thm:baz|.
-%
+%^^A
% \subsection{Replicating theorems to subfiles}
% Replicating theorems to different files is particularly
% useful when working in big documents with multiple subfiles.
@@ -346,15 +346,14 @@ colorlinks,
% |foo.tex| and |bar.tex|. This will allow us to
% use all theorems in the final |main.tex| in each of
% the subfiles.
-%
-%
-%
+%^^A
+%^^A
+%^^A
% \section{Source code}
% \begin{macrocode}
%<*package>
-\ProvidesPackage{reptheorem}[2024-03-27 v1.0 Reptheorem package]
+\ProvidesPackage{reptheorem}[2024-09-22 v1.2 Reptheorem package]
% \end{macrocode}
-%
% \begin{macro}{\theoremfile}
% Using |\theoremfile| will output all saved theorems into an output file.
% By default, if your \LaTeX file is |foo.tex|, the output file is |foo.thm|.
@@ -369,7 +368,6 @@ colorlinks,
}
% \end{macrocode}
% \end{macro}
-%
% \begin{macro}{\loadtheorems}
% If you have exported saved theorems to a file, you can load them
% into another file using the macro |\loadtheorems|.
@@ -385,8 +383,11 @@ colorlinks,
}
% \end{macrocode}
% \end{macro}
-%
% \begin{environment}{makethm}
+% \changes{v1.1}{2024/05/03}{Now saves theorem environment type, breaking backwards compatibility}
+% \changes{v1.2}{2024/09/21}{Environment end moved to fix vertical spacing.}
+% \changes{v1.2}{2024/09/22}{Theorem name is only saved if it exists.}
+% \changes{v1.2}{2024/09/22}{Renamed theorem output variable to be unique for each theorem.}
% On to defining the actual theorems to be saved.
% \begin{macrocode}
\NewDocumentEnvironment{makethm}{ m m o +b }
@@ -401,86 +402,97 @@ colorlinks,
}{
\begin{#1}\label{#2}
}
- #4
+ % \begin{theorem}
+ #4
+ \expandafter\gdef\csname thmtype@#2\endcsname{#1}%
+ \expandafter\long\expandafter\gdef\csname thm@#2\endcsname{#4}%
+ \IfValueT{#3}{% Only save theorem name if it exists
+ \expandafter\gdef\csname thmdesc@#2\endcsname{#3}%
+ }
+ % Saving parameters to aux file
+ \expandafter\long\expandafter\gdef\csname thmoutput@#2\endcsname{%
+ \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}%
+ \IfValueT{#3}{
+ ^^J%
+ \string\expandafter\string\gdef\noexpand%
+ \csname thmdesc@#2\string\endcsname{#3}%
+ }
+ }
+ \write\@auxout{\csname thmoutput@#2\endcsname}
+ \if\reptheorem@theoremfile\relax
+ % No file has been set
+ \else
+ % We have a theorem file
+ % Saving parameters to theorem file
+ \write\@thmlist{\csname thmoutput@#2\endcsname}
+ \fi
\end{#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\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}%
- }
- \write\@auxout{\@thmoutput}
- \if\reptheorem@theoremfile\relax
- % No file has been set
- \else
- % We have a theorem file
- % Saving parameters to theorem file
- \write\@thmlist{\@thmoutput}
- \fi
}{}
% \end{macrocode}
% \end{environment}
-%
% \begin{macro}{\repthm}
+% \changes{v1.1}{2024/05/03}{Now saves theorem environment type, breaking backwards compatibility}
+% \changes{v1.2}{2024/09/22}{Fixed bug where theorems got a name even if undefined.}
% 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\let\expandafter\@@thm\csname thm@#1\endcsname
% Output theorem
- \IfValueTF{\@@thmdesc}{% Check if theorem has name
- \begin{#1}[\@@thmdesc]
+ \ifcsname thmdesc@#1\endcsname % Check if theorem has name
+ \begin{\@@thmtype}[\csname thmdesc@#1\endcsname]
\@@thm
- \end{#1}
- }{% No optionals
- \begin{#1}
+ \end{\@@thmtype}
+ \else % No optionals
+ \begin{\@@thmtype}
\@@thm
- \end{#1}
- }
+ \end{\@@thmtype}
+ \fi
\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
}
% \end{macrocode}
% \end{macro}
-
-
% \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..cf6d514b274 100644
--- a/Master/texmf-dist/source/latex/reptheorem/reptheorem.ins
+++ b/Master/texmf-dist/source/latex/reptheorem/reptheorem.ins
@@ -18,7 +18,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
@@ -27,7 +27,7 @@
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: reptheorem 2024-03-27 v1.0}
+\Msg{* Package: reptheorem 2024-09-22 v1.2}
\Msg{************************************************************************}
\keepsilent
@@ -47,7 +47,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
diff --git a/Master/texmf-dist/source/latex/rub-kunstgeschichte/rub-kunstgeschichte.dtx b/Master/texmf-dist/source/latex/rub-kunstgeschichte/rub-kunstgeschichte.dtx
index 5423d5babeb..d41d99379d3 100644
--- a/Master/texmf-dist/source/latex/rub-kunstgeschichte/rub-kunstgeschichte.dtx
+++ b/Master/texmf-dist/source/latex/rub-kunstgeschichte/rub-kunstgeschichte.dtx
@@ -29,10 +29,15 @@
%<class>\NeedsTeXFormat{LaTeX2e}[2022-06-01]
%<class>\ProvidesClass{rub-kunstgeschichte}
%<*class>
- [2024-05-26 v0.1.0 RUB KGI class]
+ [2024-09-06 v0.2.0 RUB Kunstgeschichte class]
%</class>
%<*driver>
\documentclass{ltxdoc}
+
+%^^A Load packages needed for the documentation
+\usepackage{dtxdescribe}
+\fvset{commandchars={|()}}
+
\EnableCrossrefs
\CodelineIndex
\RecordChanges
@@ -51,16 +56,15 @@
%
% \DoNotIndex{\newcommand,\newenvironment}
% \DoNotIndex{\begin,\end}
+% \DoNotIndex{\fi}
+% \DoNotIndex{\section,\subsection,\subsubsection}
+% \DoNotIndex{\title,\author,\tableofcontents}
+% \DoNotIndex{\LaTeX,\verb}
%
%^^A define helper commands for consistent typesetting in the documentation
-% \def\env{\texttt}
-% \def\opt{\texttt}
-% \def\cls{\textsf}
-% \def\pkg{\textsf}
-% \def\prg{\textsf}
% \DeclareDocumentCommand\email{m}{\href{mailto:#1}{\nolinkurl{#1}}}
%
-% \title{The \cls{\jobname} class^^A
+% \title{The \pkg{\jobname} class^^A
% \thanks{This document corresponds to \pkg{\jobname}~\fileversion,
% dated \filedate.}}
% \author{\copyright{} Joran Schneyer^^A
@@ -70,6 +74,7 @@
% \date{\filedate}
%
% \maketitle
+% \tableofcontents
%
% \section{Introduction}\label{sec:introduction}
%
@@ -84,9 +89,64 @@
%
% To use this class, simply specify it as the document class.^^A
% \footnote{You can also find a complete example usage of this class in \autoref{sec:example}.}
-% \begin{verbatim}
+% \begin{sourceverb}
% \documentclass{rub-kunstgeschichte}
-% \end{verbatim}
+% \end{sourceverb}
+%
+% \subsection{Caveats}
+% When using this class, some packages are loaded automatically with options (see also \autoref{sec:implementation:package-loading}).
+% That means that you can't reload the same package with different options without risking an option clash error.
+% The relevant packages offer other ways to change their options in the preamble:
+%
+% \DescribePackage{biblatex}
+% Customize citations and bibliography.
+%
+% \verb|\ExecuteBibliographyOptions|\oarg{entrytype}\marg{options} can be used to set most options,
+% but some can only be set at the time of loading the \pkg{biblatex} package.
+% Those can be set in the class options using the \optn{biblatex} key (see also \autoref{sec:usage:class-options}).
+%
+% \DescribePackage{hyperref}
+% Customize behavior of clickable elements and pdf meta-data.
+%
+% \verb|\hypersetup|\marg{options} should be used for nearly all options.
+% The few options that can only be given at load time of the package have to be passed along using the \optn{hyperref} class option (see also \autoref{sec:usage:class-options}).
+%
+% \DescribePackage{setspace}
+% Overwrite the 1.5 line-spacing setting.
+%
+% Either \verb|\singlespacing|,
+% \verb|\doublespacing|
+% or for custom spacing factors also
+% \verb|\setstretch|\marg{baselinestretch}.
+%
+% \DescribePackage{geometry}
+% Overwrite geometry options such as the page margin settings.
+%
+% \verb|\geometry|\marg{options}
+%
+% \subsection{Class options}\label{sec:usage:class-options}
+% You can pass several \meta{options} to the class by using
+% \begin{sourceverb}
+% \documentclass|oarg(options){rub-kunstgeschichte}
+% \end{sourceverb}
+% The \meta{options} are key/value pairs that sometimes defer to a default value when only the key is given.
+%
+% \DescribeOption{biblatex}
+% Pass along options to the \pkg{biblatex} package. They overwrite default options set by this class.
+%
+% \DescribeOption{hyperref}
+% Pass along options to the \pkg{biblatex} package. They do \textbf{not} overwrite default options set by this class as they are set after loading the package using the \verb|\hypersetup| command.
+% To overwrite them, use \verb|\hypersetup|\marg{options} in the preamble.
+%
+% \DescribeOption{parskip}
+% \DescribeDefault{\optn{true}}
+% Specify wether to load the \pkg{parskip} package to remove indentation at the start of paragraphs.
+%
+% \DescribeOption{noparskip}
+% \DescribeDefault{\optn{true}}
+% The complementary option to the \optn{parskip} option.
+%
+% If neither \optn{parksip} nor \optn{noparskip} are given, the \pkg{parskip} package is automatically loaded by default.
%
% \StopEventually{}
%
@@ -99,8 +159,73 @@
%<*class>
% \fi
%
+% \subsection{Class options}\label{sec:implementation:class-options}
+% \iffalse
+%% Class options
+% \fi
+% The class options are defined as keyval options for great flexibility.
+% They toggle some of the class features or customize their behavior.
+%
+% \begin{option}{biblatex}
+% The \optn{biblatex} option stores its content in a macro until it is later passed along to the \pkg{biblatex} package after specifying the default options (see \autoref{sec:implementation:package-loading:bibliography}).
+% Therefore, options provided with this key overwrite the ones set per default by this class.
+% \begin{macrocode}
+\DeclareKeys[rubkgi]{
+ biblatex.store = \@rubkgi@biblatexOptions,
+ biblatex.usage = load
+}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{hyperref}
+% The \optn{hyperref} option passes its content along immediately, to be used as options when the \pkg{hyperref} package is loaded.
+% This will \textbf{not} overwrite default options set by this class as they are set after loading the package using \verb|\hypersetup|\marg{options} (see also \autoref{sec:implementation:package-loading:others}).
+% \begin{macrocode}
+\DeclareKeys[rubkgi]{
+ hyperref.code = \PassOptionsToPackage{#1}{hyperref},
+ hyperref.usage = load
+}
+% \end{macrocode}
+% \end{option}
+%
+% \paragraph{Paragraph indentation}
+% First we define a TeX switch which is later used (see \autoref{sec:implementation:package-loading}) to check wether to load the \pkg{parskip} package to remove the indentation at the start of paragraphs.
+% \iffalse
+%% TeX switch to decide wether to load the parskip package
+% \fi
+% \begin{macrocode}
+\newif\if@rubkgi@parskip
+% \end{macrocode}
+% By default we set the switch to true, so the parskip package is normally loaded when using this class.
+% \begin{macrocode}
+\@rubkgi@parskiptrue
+% \end{macrocode}
+% \begin{option}{parskip}
+% Then we declare the key so the switch can be turned on and off by the user in the class options.
+% \begin{macrocode}
+\DeclareKeys[rubkgi]{
+ parskip.if = @rubkgi@parskip,
+ parskip.usage = load,
+% \end{macrocode}
+% \end{option}
+% \begin{option}{noparskip}
+% Finally we define the complementary key for easier disabling of the parskip feature.
+% \begin{macrocode}
+ noparskip.ifnot = @rubkgi@parskip,
+ noparskip.usage = load
+}
+% \end{macrocode}
+% \end{option}
+%
+% \paragraph{Process options}
+% After defining the class options it is necessary to process them too in order to actually make use of them.
+% \begin{macrocode}
+\ProcessKeyOptions[rubkgi]
+% \end{macrocode}
+%
% \subsection{Base class}\label{sec:implementation:base-class}
-% The \cls{\jobname} class is based on the \cls{article} class.
+% \DescribeClass{article}
+% The \pkg{\jobname} class is based on the \pkg{article} class.
% When loading the class we specify \texttt{12pt} as the base font size, as required by the guidelines.
% \iffalse
%% Load base class with 12pt base font size
@@ -111,9 +236,95 @@
%
% \subsection{Loading packages}\label{sec:implementation:package-loading}
%
-% \paragraph{Line spacing}
+% \subsubsection{Bibliography}\label{sec:implementation:package-loading:bibliography}
+%
+% \DescribePackage{biblatex}
+% \changes{v0.2.0}{2024-09-06}{Use biblatex with authortitle-dw style from biblatex-dw package.}^^A
+% To support bibliography facilities out of the box, the \pkg{biblatex} package is loaded. To customize the behavior, a few options are passed to the package.
+% \iffalse
+%% biblatex options
+% \fi
+% \begin{macrocode}
+\PassOptionsToPackage{
+% \end{macrocode}
+%
+% \DescribeOption[biblatex]{backend}
+% Defines the backend program. To use all features of \pkg{biblatex}, the \prog{biber} backend must be used.
+% \begin{macrocode}
+ backend=biber,
+% \end{macrocode}
+%
+% \DescribeOption[biblatex]{singletitle}
+% Prints the title of a cited work in short citations only if there is more than one work of the same author.
+% \begin{macrocode}
+ singletitle=true,
+% \end{macrocode}
+%
+% \DescribeOption[biblatex]{autocite}
+% Defines the behavior of the \cs{autocite} command, which in this case will behave like the \cs{footcite} command and will print citations in the footnotes instead of directly in the text.
+% \begin{macrocode}
+ autocite=footnote,
+% \end{macrocode}
+%
+% \DescribeOption[biblatex]{autopunct}
+% Controls whether the citation commands scan ahead for punctuation marks.
+% \begin{macrocode}
+ autopunct=false
+}{biblatex}
+% \end{macrocode}
+%
+% \DescribePackage{biblatex-dw}
+% \iffalse
+%% biblatex-dw package
+% \fi
+% Further approximation of the suggested bibliography and citation styles in the guidelines is achieved by using the \pkg{biblatex-dw} package.
+% To use it, a few more options are passed to \pkg{biblatex}:
+% \begin{macrocode}
+\PassOptionsToPackage{
+% \end{macrocode}
+%
+% \DescribeOption[biblatex]{style}
+% The \optn{authortitle-dw} provided by the \pkg{biblatex-dw} package is probably the closest style to the one suggested in the guidelines.
+% \begin{macrocode}
+ style=authortitle-dw,
+% \end{macrocode}
+%
+% The following options are provided by the \pkg{biblatex-dw} package:
+%
+% \DescribeOption[biblatex]{firstfull}
+% Delivers a full citation for the first occurence of an entry.
+% \begin{macrocode}
+ firstfull=true,
+% \end{macrocode}
+%
+% \DescribeOption[biblatex]{addyear}
+% Adds the year of the publication after the title.
+% \begin{macrocode}
+ addyear=true
+}{biblatex}
+% \end{macrocode}
+%
+% After specifying the default options, we pass along the ones that might have been set in the class options.
+% \iffalse
+%% pass biblatex class options along
+% \fi
+% \begin{macrocode}
+\PassOptionsToPackage{\@rubkgi@biblatexOptions}{biblatex}
+% \end{macrocode}
+%
+% And finally the \pkg{biblatex} package is loaded.
+% \iffalse
+%% load biblatex
+% \fi
+% \begin{macrocode}
+\RequirePackage{biblatex}
+% \end{macrocode}
+%
+% \subsubsection{Document format}
+%
+% \DescribePackage{setspace}
% To achieve 1.5 times line spacing as required by the guidelines,
-% we simply load the package \pkg{setspace} with the \opt{onehalfspacing} option.
+% we simply load the package \pkg{setspace} with the \optn{onehalfspacing} option.
% \iffalse
%% Set 1.5 times line spacing
% \fi
@@ -121,7 +332,8 @@
\RequirePackage[onehalfspacing]{setspace}
% \end{macrocode}
%
-% \paragraph{Margins}
+% \DescribePackage{geometry}
+% Used to set page size and margins.
% The guidelines require 2cm top, left and bottom margins as well as a 4cm correction margin on the right side.
% Furthermore A4 paper is the standard page size here.
% \iffalse
@@ -134,22 +346,48 @@
]{geometry}
% \end{macrocode}
%
+% \DescribePackage{parskip}
+% \changes{v0.2.0}{2024-09-06}{Use parskip to avoid paragraph indentation}^^A
+% To avoid indentation at the start of paragraphs, the \pkg{parskip} package is loaded if the corresponding switch is set to true. See also \autoref{sec:implementation:class-options}.
+% \iffalse
+%% Avoid paragraph indentation
+% \fi
+% \begin{macrocode}
+\if@rubkgi@parskip
+ \RequirePackage{parskip}
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Other useful packages}\label{sec:implementation:package-loading:others}
+%
+% \DescribePackage{hyperref}
+% \changes{v0.2.0}{2024-09-06}{Use hyperref for clickable links and references.}^^A
+% Makes links and references clickable.
% \iffalse
+%% Hyperref
+% \fi
+% \begin{macrocode}
+\RequirePackage{hyperref}
+% \end{macrocode}
+% By default, we configure it to not highlight clickable elements.
+% \begin{macrocode}
+\hypersetup{hidelinks=true}
+% \end{macrocode}
+% \iffalse
+
%</class>
%<*example>
% \fi
+% \clearpage
%
% \section{Example}\label{sec:example}
%
% To further exemplify the use of this class,
-% we create an example .tex file.
-% The full \texttt{rub-kunstgeschichte-example.tex} and the corresponding \texttt{rub-kunstgeschichte-example.pdf} are available on GitHub.^^A
+% we create an example \filenm{.tex} file.
+% The full \filenm{rub-kunstgeschichte-example.tex} and the corresponding \PDF{} are available on GitHub.^^A
% \footnote{\url{https://github.com/rub-kgi/rub-kunstgeschichte-latex/releases}}
%
-% Let's examine the contents of this example .tex file step by step
-% to highlight features of this class that were used.
-%
-% First, the \cls{rub-kunstgeschichte} class is loaded
+% First, the \pkg{rub-kunstgeschichte} class is loaded
% \iffalse
%% Load the rub-kunstgeschichte class
% \fi
@@ -160,33 +398,142 @@
% \fi
%
-% and then the information needed to typeset a title is given:
+% followed by the information that is needed to typeset a title:
% \begin{macrocode}
\title{Example usage of the \textsf{rub-kunstgeschichte} class}
\author{Joran Schneyer}
% \end{macrocode}
%
-% Naturally, we begin the document environment and typeset the title
+% For citations, the bibtex entries are usually written to a seperate \filenm{.bib} file.
+% For the sake of this example we keep everything in one \filenm{.tex} file and use the \env{filecontents} environment instead.
+% \iffalse
+
+%% bibliography file (usually you would put this in a seperate .bib file)
+% \fi
+% \begin{macrocode}
+\begin{filecontents}{rub-kunstgeschichte-example.bib}
+@article{exampleArticle,
+ author = {Maxi Mustermann},
+ title = {A very interesting article},
+ year = {2001},
+ journal = {Important example journal}
+}
+@book{exampleBook,
+ author = {John Smith},
+ title = {A long example book},
+ year = {2024}
+}
+@online{exampleWebsite,
+ author = {{Example consortium}},
+ title = {The truth about example documents},
+ year = {2020},
+ note = {Internet forum article},
+ url = {https://example.com},
+ urldate = {2100-04-01}
+}
+@manual{biblatexDocs,
+ author = {Philip Kime and Moritz Wemheuer and Philipp Lehman},
+ title = {The biblatex Package},
+ subtitle = {Programmable Bibliographies and Citations},
+ year = {2024},
+ url = {https://ctan.org/pkg/biblatex},
+ urldate = {2024-06-25}
+}
+@online{biblatexCheatsheet,
+ title = {Biblatex Cheat Sheet},
+ author = {Clea F. Rees},
+ year = {2017},
+ url = {https://ctan.org/pkg/biblatex-cheatsheet},
+ urldate = {2024-06-25}
+}
+\end{filecontents}
+% \end{macrocode}
+% \iffalse
+
+% \fi
+% After that, we need to load the bibliography to use it with biblatex.
+% \begin{macrocode}
+\addbibresource{rub-kunstgeschichte-example.bib}
+% \end{macrocode}
+%
+% Having finished the preamble, we begin the document, typeset the title and include a table of contents.
% \begin{macrocode}
\begin{document}
\maketitle
+ \tableofcontents
% \end{macrocode}
+% \iffalse
+
+% \fi
%
-% Next we need some text to show some features.
-% The text in the example itself will explain the features used.
+% Next we add different sections that explain common usage and some features of this class.
% \begin{macrocode}
- Here is some text.
- Note, how the typeset text has 12pt font size as specified
- and there is a 1.5 times line-spacing present.
+ \section{Introduction}
+ The \textsf{rub-kunstgeschichte} class aims to implement
+ the guidelines on scientific writing of the art history institute
+ ``KGI'' (\textit{Kunstgeschichtliches Institut})
+ at Ruhr University Bochum.
+
+ This example document showcases a typical use
+ of the \textsf{rub-kunstgeschichte} class.
+ Just by using the class, the page is already formatted
+ so that the typeset text has 12pt font size,
+ there is a 1.5 times line-spacing present
+ and the page size is A4 with 2cm margins at top, left and bottom,
+ as well as a 4cm margin on the right.
+
+ Also, paragraphs don't have an indentation
+ in the first line by default,
+ contrary to typical \LaTeX{} documents.
+ Furthermore the \texttt{hyperref} package
+ is automatically loaded to enable clickable
+ links and references.
+
+ \section{How to cite sources}
+ This class automatically loads the \texttt{biblatex} package
+ for sophisticated bibliography and citations.
+ The class also sets some options by default
+ that make \texttt{biblatex} behave closer to the
+ suggested citation style in the guidelines of the institute.
+
+ You can cite sources using the \verb|\autocite| command,
+ which is configured by this class to use footnotes
+ \autocite{exampleArticle}.
+ Page numbers can be added in the optional argument
+ \autocite[394]{exampleBook}
+ and citation signals in a second one
+ that comes before the one for page numbers
+ \autocite[see][]{exampleWebsite}.
+ You can even cite multiple sources at once
+ using the \verb|\autocites| command
+ \autocites[111]{exampleBook}[see also][13]{exampleArticle}.
+
+ For more information refer to the documentation
+ of the \texttt{biblatex} package
+ \autocite{biblatexDocs}
+ or the biblatex cheatsheet
+ \autocite{biblatexCheatsheet}.
+
+ At the end of the document we can include a bibliography
+ containing all cited sources with \verb|\printbibliography|.
+% \end{macrocode}
+% \iffalse
+
+% \fi
+%
+% As suggested in the example document itself, we include the bibliography.
+% \begin{macrocode}
+ \printbibliography
% \end{macrocode}
%
% Finally we end the document environment
% \begin{macrocode}
\end{document}
% \end{macrocode}
+% \clearpage
% \iffalse
%</example>
% \fi
%
-% \Finale \ No newline at end of file
+% \Finale
diff --git a/Master/texmf-dist/source/latex/scrhack/scrhack-2023-07-07.dtx b/Master/texmf-dist/source/latex/scrhack/scrhack-2023-07-07.dtx
new file mode 100644
index 00000000000..332c388e620
--- /dev/null
+++ b/Master/texmf-dist/source/latex/scrhack/scrhack-2023-07-07.dtx
@@ -0,0 +1,2057 @@
+% \iffalse meta-comment
+% ======================================================================
+% scrhack-2023-07-07.dtx
+% Copyright © 2008–2023 Markus Kohm
+%
+% This work is a KOMA-Script spin-off. For the original sources of
+% KOMA-Script's `scrhack.sty' see file `scrhack.dtx' in the KOMA-Script
+% sources at <https://sourceforge.net/p/koma-script/code/>.
+%
+% Development is taking place as part of `scrhack' at
+% <https://github.com/komascript/third-party-enhancements>. New issues
+% should be reported there as well as known issues can be found.
+%
+% This work may be distributed and/or modified under the conditions of
+% the LaTeX Project Public License, version 1.3c of the license.
+% 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 and of this work.
+%
+% This work has the LPPL maintenance status "author-maintained".
+%
+% The Current Maintainer and author of this work is Markus Kohm.
+%
+% This work consists of the file `scrhack.dtx',
+% `scrhack-2023-07-07,dtx', and `README.md'.
+%
+% The recommended way to install `scrhack' is to use
+% the package manager of your TeX distribution.
+% ======================================================================
+%
+%<package&identify>%%% using: package,identify
+%<package&option>%%% using: package,option
+%<package&body>%%% using: package,body
+%<package&identity>\NeedsTeXFormat{LaTeX2e}[1995/06/01]
+%<*dtx>
+\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
+\begingroup
+ \def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#2/#3/#4}}
+ \filedate$Date: 2023-06-28 10:28:26 +0200 (Mi, 28 Jun 2023) $
+ \def\filerevision$#1: #2 ${\gdef\filerevision{r#2}}
+ \filerevision$Revision: 4063 $
+\endgroup
+\ProvidesFile{scrhack-2023-07-07.dtx}[\filedate\space\filerevision\space
+%</dtx>
+%<package&identify>\ProvidesPackage{scrhack}[%
+%<hyperref&identify>\ProvidesFile{hyperref.hak}[%
+%<float&identify>\ProvidesFile{float.hak}[%
+%<floatrow&identify>\ProvidesFile{floatrow.hak}[%
+%<listings&identify>\ProvidesFile{listings.hak}[%
+%<setspace&identify>\ProvidesFile{setspace.hak}[%
+%<lscape&identify>\ProvidesFile{lscape.hak}[%
+%<nomencl&identify>\ProvidesFile{nomencl.hak}[%
+%<standardsections&identify>\ProvidesFile{standardsections.hak}[%
+%<*dtx|identify>
+ 2024-04-17 v3.42
+%<*dtx>
+ source of
+%</dtx>
+%<*dtx|package>
+ legacy version of package scrhack%
+%</dtx|package>
+%<*hack>
+%<hack> scrhack part
+%<!standardsections> (hacking package
+%<hyperref&identify> hyperref)%
+%<float&identify> float)%
+%<floatrow&identify> floatrow)%
+%<listings&identify> listings)%
+%<setspace&identify> setspace)%
+%<lscape&identify> lscape)%
+%<nomencl&identify> nomencl)%
+%<standardsections&identify> (defining standard LaTeX class section headings)%
+%</hack>
+]
+%</dtx|identify>
+%<*dtx>
+\ifx\documentclass\undefined
+ \input docstrip.tex
+ \generate{%
+ \file{scrhack-2023-07-07.sty}{%
+ \from{scrhack-2023-07-07.dtx}{package,identify}%
+ \from{scrhack-2023-07-07.dtx}{package,option}%
+ \from{scrhack-2023-07-07.dtx}{package,body}%
+ }%
+ \file{hyperref.hak}{%
+ \from{scrhack-2023-07-07.dtx}{hack,hyperref,identify}%
+ \from{scrhack-2023-07-07.dtx}{hack,hyperref,body}%
+ }%
+ \file{float.hak}{%
+ \from{scrhack-2023-07-07.dtx}{hack,float,identify}%
+ \from{scrhack-2023-07-07.dtx}{hack,float,body}%
+ }%
+ \file{floatrow.hak}{%
+ \from{scrhack-2023-07-07.dtx}{hack,floatrow,identify}%
+ \from{scrhack-2023-07-07.dtx}{hack,floatrow,body}%
+ }%
+ \file{listings.hak}{%
+ \from{scrhack-2023-07-07.dtx}{hack,listings,identify}%
+ \from{scrhack-2023-07-07.dtx}{hack,listings,body}%
+ }%
+ \file{setspace.hak}{%
+ \from{scrhack-2023-07-07.dtx}{hack,setspace,identify}%
+ \from{scrhack-2023-07-07.dtx}{hack,setspace,body}%
+ }%
+ \file{lscape.hak}{%
+ \from{scrhack-2023-07-07.dtx}{hack,lscape,identify}%
+ \from{scrhack-2023-07-07.dtx}{hack,lscape,body}%
+ }%
+ \file{nomencl.hak}{%
+ \from{scrhack-2023-07-07.dtx}{hack,nomencl,identify}%
+ \from{scrhack-2023-07-07.dtx}{hack,nomencl,body}%
+ }%
+ \file{standardsections.hak}{%
+ \from{scrhack-2023-07-07.dtx}{hack,standardsections,identify}%
+ \from{scrhack-2023-07-07.dtx}{hack,standardsections,body}%
+ }%
+ }
+\else
+ \let\endbatchfile\relax
+\fi
+\endbatchfile
+\documentclass[USenglish]{koma-script-source-doc}
+\usepackage{babel}
+\setcounter{StandardModuleDepth}{2}
+\begin{document}
+ \DocInput{scrhack-2023-07-07.dtx}
+\end{document}
+%</dtx>
+%\fi
+%
+% \changes{v3.03}{2009/03/12}{first version ever}
+% \changes{v3.36}{2022/02/08}{switch over from \cls*{scrdoc} to
+% \cls*{koma-script-source-doc}}
+% \changes{v3.36}{2022/02/08}{require package \pkg*{scrlogo} instead of
+% defining \cs{KOMAScript}}
+% \changes{v3.36}{2022/02/08}{whole implementation documentation in English}
+% \changes{v3.40}{2023/04/17}{guide names changed}
+%
+% \GetFileInfo{scrhack.dtx}
+% \title{Legacy Version of Package \pkg*{scrhack}}
+% \author{\href{mailto:komascript@gmx.info}{Markus Kohm}}
+% \date{2023-07-15}
+% \maketitle
+% \tableofcontents
+%
+% \section{User Manual}
+%
+% You can find the user manual of the legacy version in
+% \href{file:scrhack.pdf}{the manual of \pkg*{scrhack}}.
+%
+% \MaybeStop{\PrintIndex}
+%
+% \section{Implementation of the Legacy Version of
+% \texorpdfstring{\pkg*{scrhack}}{scrhack}}
+%
+% \changes{v3.04b}{2009/08/05}{order of commands/macros and options changed}
+%
+% \subsection{Options}
+%
+% The package uses \cs{KOMAoptions} of \pkg*{scrkbase} and needs at least the
+% one of \KOMAScript{} v3.39:
+% \begin{macrocode}
+%<*package&option>
+\RequirePackage{scrkbase}[2022-11-11]
+\@ifpackagelater{scrkbase}{2023-07-14}{%
+ \PackageInfo{scrhack}{KOMA-Script >= 3.42 detected.\MessageBreak
+ In this case you should not use this legacy version of\MessageBreak
+ scrhack, but should be able to use the current version\MessageBreak
+ or even replace loading scrhack by loading really\MessageBreak
+ needed third-party patches, e.g., floatbytocbasic.\MessageBreak
+ But you are the boss ..}%
+}{%
+ \@ifpackagelater{scrkbase}{2022-11-11}{%
+ \PackageWarningNoLine{scrhack}{KOMA-Script < 3.42 detected.\MessageBreak
+ In this case the original scrhack of that version\MessageBreak
+ should also be installed and used instead of this\MessageBreak
+ legacy package}%
+ }{%
+ \PackageError{scrhack}{incompatible KOMA-Script < v3.39 detected}{%
+ This error is fatal!\MessageBreak
+ Loading of scrhack will be aborted!}%
+ \expandafter\let\csname ver@scrhack.sty\endcsname\undefined
+ \endinput
+ }%
+}
+%</package&option>
+% \end{macrocode}
+% The options allow the selection of the used manipulations of other
+% packages. But all these options are valid only until both \pkg*{scrhack} and
+% the other package has been loaded. Later settings are invalid.
+%
+%
+% \subsection{Used Macros and Commands}
+% \label{sec:macros}
+% \begin{macrocode}
+%<*package&body>
+% \end{macrocode}
+%
+% \begin{macro}{\scr@ifexpected}
+% Mentioned to do (re)definitions only, if local execution of code does not
+% change a command. Concrete, if (local) execution of \marg{test code} of
+% \begin{quote}
+% \cs{scr@ifexpected}\marg{command}\marg{test code}\marg{then
+% code}\marg{else code}
+% \end{quote}
+% would not result in a change of \cs{\meta{command}}, the \marg{then code}
+% will be executed, otherwise the \marg{else code}.
+% \begin{description}\item[Note:] \meta{test code} must not have any global
+% side effect!\end{description}
+% \begin{macrocode}
+\newcommand{\scr@ifexpected}[2]{%
+ \begingroup
+ \let\@tempa#1
+ #2
+ \ifx\@tempa#1
+ \aftergroup\@firstoftwo
+ \else
+ \aftergroup\@secondoftwo
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\scr@hack@load}
+% Conditionally loading of a hack file.
+% \begin{quote}
+% \cs{scr@hack@load}\marg{extension}\marg{basename}\marg{hack}%
+% \marg{true code}\marg{false code}
+% \end{quote}
+% The first two arguments \marg{} and \marg{extension} and \marg{basename} are
+% same to the internal\LaTeX{} kernel command \cs{@ifl@aded}. With \LaTeX{}
+% from 2021/11/15 we even could use \cs{@ifl@aded} for the test, because it is
+% not restricted to the preamble any more. But because it is restricted with
+% older \LaTeX{} kernels, we test the definition of
+% \cs{ver@}\meta{basename}\texttt{.}\meta{extension}. If it is defined, we
+% also test the definition of \cs{ver@}\meta{basename}\texttt{.hak}. If this
+% is not defined, \file{\meta{hack}.hak} is loaded and \meta{true code} is
+% executed. Otherwise \meta{false code} is executed. This means: A hack file
+% is only loaded, if a class or package (or other file with version) has
+% already been loaded, but the hack file has not already been loaded.
+% \begin{macrocode}
+\newcommand*{\scr@hack@load}[2]{%
+ \expandafter\ifx\csname ver@#2.#1\endcsname\relax
+ \expandafter\@secondoftwo
+ \else
+% \end{macrocode}
+% Load a hack only once.
+% \begin{macrocode}
+ \expandafter\ifx\csname ver@#2.hak\endcsname\relax
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi
+ \fi
+ {%
+ \PackageInfo{scrhack}{loading #2 hack}%
+ \edef\reserved@a{%
+ \noexpand\makeatletter\noexpand\input{#2.hak}%
+ \noexpand\catcode`\noexpand\@\the\catcode`\@\relax
+ }\reserved@a
+ }{%
+ \PackageInfo{scrhack}{ignorring #2 hack}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package&body>
+% \end{macrocode}
+%
+% \subsection{The \texorpdfstring{\pkg*{hyperref}}{hyperref} hack}
+%
+% Package \pkg{hyperref} places the anchor of the star variant of a heading
+% after the heading, but the anchor of the normal variant before the heading
+% even if the heading is not numbered because of the value of
+% \cnt{secnumdepth}. The hack changes this to more consistent placing always
+% before the heading.
+%
+% \begin{option}{hyperref}
+% \changes{v3.12}{2013/03/05}{using \cs{FamilyKeyStateProcessed}}
+% \changes{v3.17}{2015/03/09}{defaults by \cs{KOMAExecuteOptions}}
+% \begin{macrocode}
+%<*package&option>
+\KOMA@ifkey{hyperref}{@scrhack@hyperref}%
+\KOMAExecuteOptions{hyperref=true}%
+%</package&option>
+% \end{macrocode}
+% \changes{v3.04b}{2009/11/09}{loading \pkg{hyperref} hack earlier}
+% \changes{v3.17}{2015/03/09}{auto deactivation for newer versions of
+% \pkg{hyperref}}
+% \changes{v3.18}{2015/05/22}{newer versions of \KOMAScript{} classes also
+% deactivate the the hack}
+% \changes{v3.39}{2022/11/11}{initial dot in member argument of \cs{KOMA@key}
+% and \cs{KOMAExecuteOptions} removed}
+% This is a little bit tricky, because \pkg{hyperref} loads the driver file
+% via \cs{AtEndOfPackage} and the hack cannot be loaded before loading the
+% driver file. Using \cs{AfterPackage*} would not be good enough therefore,
+% because it would load the hack before the driver file. But using
+% \cs{AtEndOfPackage} inside \cs{AfterPackage*} should delay the loading
+% enough. This also works, if \pkg{hyperref} has already been loaded. In this
+% case the code will be executed at the end of \pkg*{scrhack} instead of
+% \pkg{hyperref}. This is no problem.
+% \begin{macrocode}
+%<*package&body>
+\BeforePackage{hyperref}{%
+ \scr@ifundefinedorrelax{hy@insteadofrefstepcounter}{}{%
+ \PackageInfo{scrhack}{hyperref hack deactivated because of\MessageBreak
+ detection of KOMA-Script class, that doesn't\MessageBreak
+ need that hack,}%
+ \KOMAExecuteOptions[scrhack.sty]{hyperref=false}%
+ }%
+}
+\AfterPackage*{hyperref}{%
+ \if@scrhack@hyperref
+ \@ifpackagelater{hyperref}{2009/11/24}{%
+ \PackageInfo{scrhack}{hyperref hack deactivated because of\MessageBreak
+ detection of hyperref version, that doesn't\MessageBreak
+ need that hack,}%
+ \KOMAExecuteOptions[scrhack.sty]{hyperref=false}%
+ }{%
+ \AtEndOfPackage{%
+ \KOMA@key[scrhack.sty]{hyperref}[true]{%
+ \PackageWarning{scrhack}{option `hyperref=#1' ignored}%
+ \FamilyKeyStateProcessed
+ }%
+ \if@scrhack@hyperref\scr@hack@load\@pkgextension{hyperref}\fi
+ }%
+ }%
+ \fi
+}
+%</package&body>
+% \end{macrocode}
+% \end{option}
+%
+%
+% \begin{macro}{\@schapter,\@spart,\@ssect}
+% We do not hack \pkg{hyperref} itself, but the driver files. After loading
+% \pkg{hyperref} the driver file is also loaded. Moreover, all driver files
+% that re-define these commands have to be patched also. So the patch is
+% related to the loading of \pkg{hyperref} instead of every single driver
+% file. This have already been tested by \cs{scr@hack@load}. So we just have
+% to test, whether the definition of these commands are the expected one.
+% derzeit den erwarteten Inhalt haben.
+% \begin{macrocode}
+%<*hyperref&body>
+\scr@ifexpected\@schapter{%
+ \def\@schapter#1{%
+ \H@old@schapter{#1}%
+ \begingroup
+ \let\@mkboth\@gobbletwo
+ \Hy@GlobalStepCount\Hy@linkcounter
+ \xdef\@currentHref{\Hy@chapapp*.\the\Hy@linkcounter}%
+ \Hy@raisedlink{%
+ \hyper@anchorstart{\@currentHref}\hyper@anchorend
+ }%
+ \endgroup
+ }%
+}{%
+ \PackageInfo{scrhack}{redefining \string\@schapter}%
+ \def\@schapter#1{%
+ \begingroup
+ \let\@mkboth\@gobbletwo
+ \Hy@GlobalStepCount\Hy@linkcounter
+ \xdef\@currentHref{\Hy@chapapp*.\the\Hy@linkcounter}%
+ \Hy@raisedlink{%
+ \hyper@anchorstart{\@currentHref}\hyper@anchorend
+ }%
+ \endgroup
+ \H@old@schapter{#1}%
+ }%
+}{%
+ \scr@ifexpected\@schapter{%
+ \def\@schapter#1{%
+ \begingroup
+ \let\@mkboth\@gobbletwo
+ \Hy@GlobalStepCount\Hy@linkcounter
+ \xdef\@currentHref{\Hy@chapapp*.\the\Hy@linkcounter}%
+ \Hy@raisedlink{%
+ \hyper@anchorstart{\@currentHref}\hyper@anchorend
+ }%
+ \endgroup
+ \H@old@schapter{#1}%
+ }%
+ }{}{%
+ \PackageWarningNoLine{scrhack}{unknown \string\@schapter\space
+ definition found!\MessageBreak
+ Maybe you are using a unsupported hyperref version}%
+ }%
+}
+\scr@ifexpected\@spart{%
+ \def\@spart#1{%
+ \H@old@spart{#1}%
+ \Hy@GlobalStepCount\Hy@linkcounter
+ \xdef\@currentHref{part*.\the\Hy@linkcounter}%
+ \Hy@raisedlink{%
+ \hyper@anchorstart{\@currentHref}\hyper@anchorend
+ }%
+ }%
+}{%
+ \PackageInfo{scrhack}{redefining \string\@spart}%
+ \def\@spart#1{%
+ \Hy@GlobalStepCount\Hy@linkcounter
+ \xdef\@currentHref{part*.\the\Hy@linkcounter}%
+ \Hy@raisedlink{%
+ \hyper@anchorstart{\@currentHref}\hyper@anchorend
+ }%
+ \H@old@spart{#1}%
+ }%
+}{%
+ \scr@ifexpected\@spart{%
+ \def\@spart#1{%
+ \Hy@GlobalStepCount\Hy@linkcounter
+ \xdef\@currentHref{part*.\the\Hy@linkcounter}%
+ \Hy@raisedlink{%
+ \hyper@anchorstart{\@currentHref}\hyper@anchorend
+ }%
+ \H@old@spart{#1}%
+ }%
+ }{}{%
+ \PackageWarningNoLine{scrhack}{unknown \string\@spart\space
+ definition found!\MessageBreak
+ Maybe you are using a unsupported hyperref version}%
+ }%
+}
+\scr@ifexpected\@ssect{%
+ \def\@ssect#1#2#3#4#5{%
+ \H@old@ssect{#1}{#2}{#3}{#4}{#5}%
+ \phantomsection
+ }%
+}{%
+ \PackageInfo{scrhack}{redefining \string\@ssect}%
+ \def\@ssect#1#2#3#4#5{%
+ \H@old@ssect{#1}{#2}{#3}{#4}{\phantomsection\ignorespaces#5}%
+ }%
+}{%
+ \scr@ifexpected\@ssect{%
+ \def\@ssect#1#2#3#4#5{%
+ \H@old@ssect{#1}{#2}{#3}{#4}{\phantomsection\ignorespaces#5}%
+ }%
+ }{}{%
+ \PackageWarningNoLine{scrhack}{unknown \string\@ssect\space
+ definition found!\MessageBreak
+ Maybe you are using a unsupported hyperref version}%
+ }%
+}
+%</hyperref&body>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{The \texorpdfstring{\pkg*{floatrow}}{floatrow} hack}
+%
+% Package \pkg{floatrow} insists in using \cs{float@listhead} for the setting
+% of the headings. This is not recommended any longer since \KOMAScript~2.95
+% from July 2006! The \KOMAScript{} classes will remove the support for
+% this very limited approach. Recommended is the usage of \pkg*{tocbasic}. The
+% effort to do so, it very small and I do not understand, why package authors
+% are not willing to use it. Because the benefit would be a lot.
+%
+% This hack adds \pkg*{tocbasic} usage to \pkg{floatrow}. Nevertheless it is
+% more complicated than adding \pkg*{tocbasic} support into \pkg{floatrow}.
+%
+% \begin{option}{floatrow}
+% \changes{v3.12}{2013/03/05}{using \cs{FamilyKeyStateProcessed}}
+% \changes{v3.17}{2015/03/09}{using \cs{KOMAExecuteOptions}}
+% \changes{v3.34}{2021/06/03}{deactivation of the \pkg{float} hack}
+% \changes{v3.39}{2022/11/11}{initial dot in member argument of \cs{KOMA@key}
+% removed}
+% \begin{macrocode}
+%<*package&option>
+\KOMA@ifkey{floatrow}{@scrhack@floatrow}
+\KOMAExecuteOptions{floatrow=true}
+%</package&option>
+%<*package&body>
+\AfterPackage*{floatrow}{%
+ \KOMAoptions{float=false}%
+ \PackageInfo{scrhack}{option `float' deactivated}%
+ \KOMA@key[scrhack.sty]{floatrow}{%
+ \PackageWarning{scrhack}{option `floatrow' ignored}%
+ \FamilyKeyStateProcessed
+ }%
+ \if@scrhack@floatrow\scr@hack@load\@pkgextension{floatrow}\fi
+}
+%</package&body>
+% \end{macrocode}
+% \end{option}
+%
+%
+% \begin{command}{\DeclareNewFloatType,\listof}
+% \changes{v3.25}{2018/03/16}{using \cs{DeclareTOCStyleEntry}}
+% Command \cs{DeclareNewFloatType} is used to define a new float
+% environment. We have to add registration of the file extension (third
+% argument) with \pkg*{tocbasic}.
+% Command \cs{listof} outputs the list of the float environments. Here we
+% just use the corresponding macro of \pkg*{tocbasic}.
+% \begin{macro}{\float@addtolists}
+% The deprecated macro \cs{float@addtolists} is not needed any longer an will
+% be reset to the original definition.
+% \begin{macrocode}
+%<*floatrow&body>
+\scr@ifexpected{\DeclareNewFloatType}{%
+ \long\def\DeclareNewFloatType#1#2{\def\FB@captype{#1}%
+ \expandafter\edef\csname ftype@#1\endcsname{\the\c@float@type}%
+ \addtocounter{float@type}{\value{float@type}}%
+ \@namedef{#1name}{#1}\newcounter{#1}%
+ \expandafter\edef\csname fnum@#1\endcsname
+ {\expandafter\noexpand\csname #1name\endcsname\nobreakspace
+ \expandafter\noexpand\csname the#1\endcsname}%
+ \@namedef{the#1}{\arabic{#1}}\flnew@ext{lo#1}\@namedef{fps@#1}{tbp}%
+ \@namedef{l@#1}{\@dottedtocline{1}{1.5em}{2.3em}}%
+ \caption@setkeys[floatrow]{newfloat}{#2}\let\FR@tmp=\relax
+ \xdef\@tempa{\noexpand\flrow@types{\the\flrow@types \FR@tmp{#1}}}%
+ \@tempa}%
+}{%
+ \scr@ifexpected{\listof}{%
+ \def\listof#1#2{%
+ \@ifundefined{ext@#1}{\flrow@error{Unknown float style `#1'}}{%
+ \expandafter\providecommand\csname l@#1\endcsname
+ {\@dottedtocline{1}{1.5em}{2.3em}}%
+ \float@listhead{#2}%
+ \begingroup\setlength{\parskip}{\z@}%
+ \@starttoc{\@nameuse{ext@#1}}%
+ \endgroup}}%
+ }{%
+ \RequirePackage{tocbasic}%
+ \PackageInfo{scrhack}{redefining \string\DeclareNewFloatType}%
+% \end{macrocode}
+% \begin{description}
+% \item[Note:] It would be better to first test, if the new extension is
+% already in use like done at the \pkg{float} hack. But I don't know the
+% \pkg{floatrow} code good enough to make such a change!
+% \end{description}
+% \begin{macrocode}
+ \renewcommand\DeclareNewFloatType[2]{\def\FB@captype{#1}%
+ \expandafter\edef\csname ftype@#1\endcsname{\the\c@float@type}%
+ \addtocounter{float@type}{\value{float@type}}%
+ \@namedef{#1name}{#1}\newcounter{#1}%
+ \expandafter\edef\csname fnum@#1\endcsname
+ {\expandafter\noexpand\csname #1name\endcsname\nobreakspace
+ \expandafter\noexpand\csname the#1\endcsname}%
+ \@namedef{the#1}{\arabic{#1}}\flnew@ext{lo#1}\@namedef{fps@#1}{tbp}%
+ \DeclareTOCStyleEntry[level=1,numwidth=2.3em,indent=1.5em]{default}{#1}%
+ \caption@setkeys[floatrow]{newfloat}{#2}\let\FR@tmp=\relax
+ \xdef\@tempa{\noexpand\flrow@types{\the\flrow@types \FR@tmp{#1}}}%
+ \@tempa
+ \xdef\@tempa{\noexpand\addtotoclist[float]{\@nameuse{ext@\FB@captype}}%
+ \noexpand\setuptoc{\@nameuse{ext@\FB@captype}}{chapteratlist}%
+ }%
+ \@tempa
+ }%
+ \PackageInfo{scrhack}{redefining \string\listof}%
+ \renewcommand*\listof[2]{%
+ \@ifundefined{ext@#1}{\flrow@error{Unknown float style `#1'}}{%
+ \@ifundefined{l@#1}{\expandafter\let\csname l@#1\endcsname\l@figure
+ \@ifundefined{l@#1}{%
+ \DeclareTOCStyleEntry[level=1,numwidth=2.3em,indent=1.5em]
+ {default}{#1}%
+ }{}%
+ }{}%
+ \listoftoc[{#2}]{\csname ext@#1\endcsname}%
+ }%
+ }%
+ \scr@ifexpected{\float@addtolists}{%
+ \long\def\float@addtolists#1{%
+ \def\float@do##1{\addtocontents{##1}{#1}} \the\float@exts}%
+ }{%
+ \PackageInfo{scrhack}{undefining \string\float@addtolists}%
+ \let\float@addtolists\relax
+ }{%
+ \PackageWarningNoLine{scrhack}{unkown \string\float@addtolists\space
+ definition found!\MessageBreak
+ Maybe you are using a unsupported floatrow version}%
+ }%
+ }{%
+ \PackageWarningNoLine{scrhack}{unknown \string\listof\space
+ definition found!\MessageBreak
+ Maybe you are using a unsupported floatrow version}%
+ }%
+}{%
+ \PackageWarningNoLine{scrhack}{unknown \string\DeclareNewFloatType\space
+ definition found!\MessageBreak
+ Maybe you are using a unsupported floatrow version}%
+}
+%</floatrow&body>
+% \end{macrocode}
+% \end{macro}
+% \end{command}
+%
+%
+% \subsection{The \texorpdfstring{\pkg*{float}}{float} hack}
+%
+% Package \pkg{float} insists in using \cs{float@listhead} for the setting
+% of the headings. This is not recommended any longer since \KOMAScript~2.95
+% from July 2006! The \KOMAScript{} classes will remove the support for
+% this very limited approach. Recommended is the usage of \pkg*{tocbasic}. The
+% effort to do so, it very small and I do not understand, why package authors
+% are not willing to use it. Because the benefit would be a lot.
+%
+% This hack adds \pkg*{tocbasic} usage to \pkg{float}. Nevertheless it is
+% more complicated than adding \pkg*{tocbasic} support into \pkg{float}.
+%
+% \begin{option}{float}
+% \changes{v3.12}{2013/03/05}{using \cs{FamilyKeyStateProcessed}}
+% \changes{v3.17}{2015/03/09}{using \cs{KOMAExecuteOptions}}
+% \changes{v3.39}{2022/11/11}{initial dot in member argument of \cs{KOMA@key}
+% removed}
+% \begin{macrocode}
+%<*package&option>
+\KOMA@ifkey{float}{@scrhack@float}%
+\KOMAExecuteOptions{float=true}%
+%</package&option>
+%<*package&body>
+\AfterPackage*{float}{%
+ \KOMA@key[scrhack.sty]{float}{%
+ \PackageWarning{scrhack}{option `float' ignored}%
+ \FamilyKeyStateProcessed
+ }%
+ \if@scrhack@float\scr@hack@load\@pkgextension{float}\fi
+}
+%</package&body>
+% \end{macrocode}
+% \end{option}
+%
+%
+% \begin{command}{\newfloat}
+% \changes{v3.28}{2019/11/19}{\cs{ifattoclist} replaced by
+% \cs{Ifattoclist}}
+% \changes{v3.25}{2018/03/16}{using \cs{DeclareTOCStyleEntry}}
+% We have to add registration of the file extension (third argument of
+% \cs{newfloat}) with \pkg*{tocbasic}.
+% \begin{command}{\listof}
+% Command \cs{listof} outputs the list of the float environments. Here we
+% just use the corresponding macro of \pkg*{tocbasic}.
+% \begin{macro}{\float@addtolists}
+% The deprecated macro \cs{float@addtolists} is not needed any longer an will
+% be reset to the original definition.
+% \begin{macrocode}
+%<*float&body>
+\scr@ifexpected{\newfloat}{%
+ \long\def\newfloat#1#2#3{\@namedef{ext@#1}{#3}
+ \let\float@do=\relax
+ \xdef\@tempa{\noexpand\float@exts{\the\float@exts \float@do{#3}}}%
+ \@tempa
+ \floatplacement{#1}{#2}%
+ \@ifundefined{fname@#1}{\floatname{#1}{#1}}{}
+ \expandafter\edef\csname ftype@#1\endcsname{\value{float@type}}%
+ \addtocounter{float@type}{\value{float@type}}
+ \restylefloat{#1}%
+ \expandafter\edef\csname fnum@#1\endcsname%
+ {\expandafter\noexpand\csname fname@#1\endcsname{}
+ \expandafter\noexpand\csname the#1\endcsname}
+ \@ifnextchar[%]
+ {\float@newx{#1}}%
+ {\@ifundefined{c@#1}{\newcounter{#1}\@namedef{the#1}{\arabic{#1}}}%
+ {}}}%
+}{%
+ \scr@ifexpected{\listof}{%
+ \def\listof#1#2{%
+ \@ifundefined{ext@#1}{\float@error{#1}}{%
+ \@namedef{l@#1}{\@dottedtocline{1}{1.5em}{2.3em}}%
+ \float@listhead{#2}%
+ \begingroup\setlength{\parskip}{\z@}%
+ \@starttoc{\@nameuse{ext@#1}}%
+ \endgroup}}%
+ }{%
+ \RequirePackage{tocbasic}%
+ \PackageInfo{scrhack}{redefining \string\newfloat}%
+ \renewcommand\newfloat[3]{%
+ \Ifattoclist{#3}{%
+ \PackageError{scrhack}{extension `#3' already in use}{%
+ Each extension may be used only once.\MessageBreak
+ You, the class, or another package already uses extension
+ `#3'.\MessageBreak
+ \string\newfloat\space command will be ignored!}%
+ }{%
+ \addtotoclist[float]{#3}%
+ \setuptoc{#3}{chapteratlist}%
+ \@namedef{ext@#1}{#3}%
+ \let\float@do=\relax
+ \xdef\@tempa{\noexpand\float@exts{\the\float@exts \float@do{#3}}}%
+ \@tempa
+ \floatplacement{#1}{#2}%
+ \@ifundefined{fname@#1}{\floatname{#1}{#1}}{}%
+ \expandafter\edef\csname ftype@#1\endcsname{\value{float@type}}%
+ \addtocounter{float@type}{\value{float@type}}
+ \restylefloat{#1}%
+ \expandafter\edef\csname fnum@#1\endcsname%
+ {\expandafter\noexpand\csname fname@#1\endcsname{}
+ \expandafter\noexpand\csname the#1\endcsname}%
+ \@ifnextchar[%]
+ {\float@newx{#1}}%
+ {\@ifundefined{c@#1}{\newcounter{#1}\@namedef{the#1}{\arabic{#1}}}%
+ {}}}%
+ }%
+ \PackageInfo{scrhack}{redefining \string\listof}%
+ \renewcommand*\listof[2]{%
+ \@ifundefined{ext@#1}{\float@error{#1}}{%
+ \@ifundefined{l@#1}{\expandafter\let\csname l@#1\endcsname\l@figure
+ \@ifundefined{l@#1}{%
+ \DeclareTOCStyleEntry[level=1,numwidth=2.3em,indent=1.5em]
+ {default}{#1}%
+ }{}%
+ }{}%
+ \listoftoc[{#2}]{\csname ext@#1\endcsname}%
+ }%
+ }%
+ \scr@ifexpected{\float@addtolists}{%
+ \long\def\float@addtolists#1{%
+ \def\float@do##1{\addtocontents{##1}{#1}} \the\float@exts}%
+ }{%
+ \PackageInfo{scrhack}{undefining \string\float@addtolists}%
+ \let\float@addtolists\relax
+ }{%
+ \PackageWarningNoLine{scrhack}{unkown \string\float@addtolists\space
+ definition found!\MessageBreak
+ Maybe you are using a unsupported float version}%
+ }%
+ }{%
+ \PackageWarningNoLine{scrhack}{unknown \string\listof\space
+ definition found!\MessageBreak
+ Maybe you are using a unsupported float version}%
+ }%
+}{%
+ \PackageWarningNoLine{scrhack}{unknown \string\newfloat\space
+ definition found!\MessageBreak
+ Maybe you are using a unsupported float version}%
+}
+%</float&body>
+% \end{macrocode}
+% \end{macro}
+% \end{command}
+% \end{command}
+%
+%
+% \subsection{The \texorpdfstring{\pkg*{listings}}{listings} hack}
+%
+% Package \pkg{listing} insists in using \cs{float@listhead} for the setting
+% of the headings. This is not recommended any longer since \KOMAScript~2.95
+% from July 2006! The \KOMAScript{} classes will remove the support for
+% this very limited approach. Recommended is the usage of \pkg*{tocbasic}. The
+% effort to do so, it very small and I do not understand, why package authors
+% are not willing to use it. Because the benefit would be a lot.
+%
+% This hack adds \pkg*{tocbasic} usage to old versions of
+% \pkg{listings}. Nevertheless it is more complicated than adding
+% \pkg*{tocbasic} support into \pkg{listings}.
+%
+% \begin{option}{listings}
+% \changes{v3.12}{2013/03/05}{using \cs{FamilyKeyStateProcessed}}
+% \changes{v3.17}{2015/03/09}{using \cs{KOMAExecuteOptions}}
+% \changes{v3.39}{2022/11/11}{initial dot in member argument of \cs{KOMA@key}
+% removed}
+% \changes{v3.42}{2024/04/17}{automatic deactivation for new \pkg{listings}}
+% Note: The deactivation of the hack for new version of \pkg{listings} cannot
+% be done comparing the \pkg{listings} version, because \pkg{listings} version
+% 1.10 uses \cs{AtEndOfPackage} for \cs{ProvidesPackage} and therefore the
+% version is not defined when the after package hook is executed. So we test
+% instead the \pkg{lstmisc} version.
+% \begin{macrocode}
+%<*package&option>
+\KOMA@ifkey{listings}{@scrhack@listings}
+\KOMAExecuteOptions{listings=true}
+%</package&option>
+%<*package&body>
+\AfterPackage*{listings}{%
+ \@ifpackagelater{lstmisc}{2024/02/15}{%
+ \PackageInfo{scrhack}{listings hack deactivated because of\MessageBreak
+ detection of listings version, that doesn't\MessageBreak
+ need that hack,}%
+ \KOMAExecuteOptions[scrhack.sty]{listings=false}%
+ }{%
+ \if@scrhack@listings\scr@hack@load\@pkgextension{listings}\fi
+ }%
+ \KOMA@key[scrhack.sty]{listings}[true]{%
+ \PackageWarning{scrhack}{option `listings=#1' ignored}%
+ \FamilyKeyStateProcessed
+ }%
+}
+%</package&body>
+% \end{macrocode}
+% \end{option}
+%
+%
+% \begin{macro}{\scr@do@hack@listings}
+% \changes{v3.41}{2023/06/28}{patching \cs{lst@MakeCaption} to use
+% \cs{ext@lstlisting}}
+% \begin{command}{\lstlistoflistings}
+% \cs{scr@do@hack@listings} patches \pkg{listings} to use \pkg*{tocbasic} for
+% the whole output of the list of listings. This adds several new features to
+% \pkg{listings}.
+% \begin{macro}{\ext@lstlisting,\lst@MakeCaption,\float@addtolists}
+% Macro \cs{ext@lstlisting} is defined, to make \cs{captionof} work with
+% argument \texttt{lstlisting}. Additionally \cs{lst@MakeCaption} is patched
+% to use the new macro. The deprecated macro \cs{float@addtolists} is not
+% needed any longer an will be reset to the original definition. But, because
+% \pkg{listings} delays the redefinition with \cs{AtBeginDocument} we have to
+% do the same here.
+% \begin{macrocode}
+%<*listings&body>
+\newcommand*{\scr@do@hack@listings}{%
+ \RequirePackage{tocbasic}%
+ \addtotoclist[float]{lol}%
+ \setuptoc{lol}{chapteratlist}%
+ \PackageInfo{scrhack}{redefining \string\lstlistoflistings}%
+ \renewcommand*{\lstlistoflistings}{\listoftoc[{\lstlistlistingname}]{lol}}%
+ \providecommand*{\ext@lstlisting}{lol}%
+ \@tempswafalse
+ \xpatchcmd\lst@MakeCaption
+ {\addcontentsline{lol}}%
+ {\addcontentsline{\ext@lstlisting}}%
+ {\PackageInfo{scrhack}{patching \string\lst@MakeCaption}\@tempswatrue}%
+ {\PackageWarning{scrhack}{cannot patch \string\lst@MakeCaption}}%
+ \@whilesw\if@tempswa\fi{%
+ \xpatchcmd\lst@MakeCaption
+ {\addcontentsline{lol}}%
+ {\addcontentsline{\ext@lstlisting}}%
+ {}%
+ {\@tempswafalse}%
+ }%
+ \AtBeginDocument{%
+ \scr@ifexpected{\float@addtolists}{%
+ \def\float@addtolists##1{\addtocontents{lol}{##1}}%
+ }{%
+ \PackageInfo{scrhack}{undefining \string\float@addtolists}%
+ \let\float@addtolists\relax
+ }{%
+ \scr@ifexpected{\float@addtolists}{%
+ \def\float@addtolists##1{\addtocontents{lol}{##1}%
+ \orig@float@addtolists{##1}}%
+ }{%
+ \PackageInfo{scrhack}{setting \string\float@addtolists\MessageBreak
+ to \string\orig@float@addtolists}%
+ \let\float@addtolists\orig@float@addtolists
+ }{%
+ \PackageWarningNoLine{scrhack}{unkown \string\float@addtolists\space
+ definition found!\MessageBreak
+ Maybe you are using a unsupported listings version}%
+ }%
+ }%
+ }%
+% \end{macrocode}
+% \begin{macro}{\lst@makecaption}
+% \changes{v3.30}{2020/04/01}{setting of \cs{@captype} added}
+% From version~3.30 setting of \cs{@captype} to \texttt{lstlisting} is added
+% to \cs{lst@makecaption}. This adds support for usage of
+% \cs{raggedlstlistingcaption} (if the user or a package author defines
+% it). The change is a little bit dangerous, because it will break, if
+% \pkg{listings} would add an argument to \cs{lst@makecaption}.
+% \begin{macrocode}
+ \expandafter\def\expandafter\lst@makecaption\expandafter{%
+ \expandafter\def\expandafter\@captype\expandafter{%
+ \expandafter l\expandafter s\expandafter t\expandafter l%
+ \expandafter i\expandafter s\expandafter t\expandafter i%
+ \expandafter n\expandafter g\expandafter}\lst@makecaption
+ }%
+ \let\scr@do@hack@listings\relax
+}
+\scr@ifexpected{\lstlistoflistings}{%
+ \def\lstlistoflistings{\bgroup
+ \let\contentsname\lstlistlistingname
+ \let\lst@temp\@starttoc \def\@starttoc##1{\lst@temp{lol}}%
+ \tableofcontents \egroup}%
+}{%
+ \scr@do@hack@listings
+}{%
+ \scr@ifexpected{\lstlistoflistings}{%
+ \def\lstlistoflistings{%
+ \begingroup
+ \@ifundefined{@restonecoltrue}{}{%
+ \if@twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse
+ \fi
+ }%
+ \float@listhead{\lstlistlistingname}%
+ \parskip\z@\parindent\z@\parfillskip \z@ \@plus 1fil%
+ \@starttoc{lol}%
+ \@ifundefined{@restonecoltrue}{}{%
+ \if@restonecol\twocolumn\fi
+ }%
+ \endgroup
+ }%
+ }{%
+ \scr@do@hack@listings
+ }{%
+ \PackageWarningNoLine{scrhack}{unknown \string\lstlistoflistings\space
+ definition found!\MessageBreak
+ Maybe you are using a unsupported listings version}%
+ }%
+}
+%</listings&body>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{command}
+% \end{macro}
+%
+%
+%
+% \subsection{The \texorpdfstring{\pkg*{nomencl}}{nomencl} hack}
+%
+% With package \pkg{nomencl} and the \KOMAScript{} classes there is only a
+% small disharmony between relating the ToC entry. Nevertheless the package
+% can benefit from using \pkg*{tocbasic}.
+%
+% This hack adds \pkg*{tocbasic} usage to \pkg{nomencl}. This is done using
+% \pkg{xpatch} Nevertheless it is much more complicated than adding real
+% \pkg*{tocbasic} support into \pkg{nomencl}. The mess is, that every new
+% release of \pkg{nomencl} changes the kind of ``support'' of
+% \pkg*{tocbasic}. For some versions there isn't any such support. Other
+% versions use \pkg*{tocbasic} if it has been loaded. Other versions need an
+% option to activate usage of \pkg*{tocbasic}. So don't expect that the
+% following hack does the correct thing for every version of \pkg{nomencl}!
+%
+% \begin{option}{nomencl}
+% \changes{v3.23}{2017/03/31}{added}
+% \changes{v3.39}{2022/11/11}{initial dot in member argument of \cs{KOMA@key}
+% removed}
+% \begin{macrocode}
+%<*package&option>
+\RequirePackage{xpatch}%
+\KOMA@ifkey{nomencl}{@scrhack@nomencl}
+\KOMAExecuteOptions{nomencl=true}
+%</package&option>
+%<*package&body>
+\AfterPackage*{nomencl}{%
+ \KOMA@key[scrhack.sty]{nomencl}{%
+ \PackageWarning{scrhack}{option `nomencl' ignored}%
+ \FamilyKeyStateProcessed
+ }%
+ \if@scrhack@nomencl\scr@hack@load\@pkgextension{nomencl}\fi
+}
+%</package&body>
+% \end{macrocode}
+% \end{option}^^A nomencl
+%
+% \begin{command}{\thenomenclature}
+% \changes{v3.23}{2017/03/31}{added}
+% Instead of using the several definitions by cases of the several versions of
+% \pkg{nomencl} we use a patch, that should remove all such cases and use
+% \pkg*{tocbasic} always.
+% \begin{macrocode}
+%<*nomencl&body>
+\RequirePackage{tocbasic}
+% \end{macrocode}
+% With \pkg{nomencl} > 5.0 this should be all.
+% Unfortunately is isn't, because newer versions of \pkg{nomencl} need option
+% \opt{tocbasic} to be set. Good luck: It is the default. So the chances
+% are good, that with new versions of \pkg{nomencl} usage of \pkg*{tocbasic} is
+% the default.
+% \begin{macrocode}
+\@ifpackagelater{nomencl}{2019/01/01}{%
+ \PackageInfo{scrhack}{only `tocbasic' loaded for `nomencl'}%
+ \expandafter\endinput
+}{}
+% \end{macrocode}
+% Otherwise we have to patch it.
+% \begin{macrocode}
+\addtotoclist[nomencl]{nlo}
+\addtotoclist[nomencl]{nls}
+\xpatchcmd{\thenomenclature}{%
+ \@ifundefined{chapter}%
+ {
+ \section*{\nomname}
+ \if@intoc\addcontentsline{toc}{section}{\nomname}\fi%
+ }%
+ {
+ \chapter*{\nomname}
+ \if@intoc\addcontentsline{toc}{chapter}{\nomname}\fi%
+ }%
+}{%
+ \scr@hack@nomencl@head
+}{%
+ \PackageInfo{scrhack}{\string\thenomenclature\space successfully patched}%
+}{%
+% \end{macrocode}
+% \changes{v3.26b}{2019/01/23}{new \pkg{nomencl} 5.0}
+% From \pkg{nomencl} 5.0 another code is used if the nomenclature is a
+% chapter. So we need another patch:
+% \begin{macrocode}
+ \xpatchcmd{\thenomenclature}{%
+ \@ifundefined{chapter}%
+ {
+ \section*{\nomname}
+ \if@intoc\addcontentsline{toc}{section}{\nomname}\fi%
+ }%
+ {
+ \chapter*{\nomname}
+ \markboth{\nomname}{\nomname}%
+ \if@intoc\addcontentsline{toc}{chapter}{\nomname}\fi%
+ }%
+ }{%
+ \scr@hack@nomencl@head
+ }{%
+ \PackageInfo{scrhack}{\string\thenomenclature\space successfully patched}%
+ }{%
+% \end{macrocode}
+% \changes{v3.26b}{2019/01/23}{prepared for hoply comming \pkg{nomencl}}
+% But this code is also wrong, because it breaks manual running heads, e.g.,
+% of page style \texttt{myheadings}. So I hope, there will be another code,
+% that needs a somehow different patch:
+% \begin{macrocode}
+ \xpatchcmd{\thenomenclature}{%
+ \@ifundefined{chapter}%
+ {
+ \section*{\nomname}
+ \if@intoc\addcontentsline{toc}{section}{\nomname}\fi%
+ }%
+ {
+ \chapter*{\nomname}
+ \@mkboth{\nomname}{\nomname}%
+ \if@intoc\addcontentsline{toc}{chapter}{\nomname}\fi%
+ }%
+ }{%
+ \scr@hack@nomencl@head
+ }{%
+ \PackageInfo{scrhack}{\string\thenomenclature\space successfully patched}%
+ }{%
+% \end{macrocode}
+% \changes{v3.25}{2019/01/23}{emergency patch added}
+% \changes{v3.30}{2020/02/25}{spurious space in warning message removed}
+% If this also does not work, we try an emergency patch, that could break
+% things.
+% \begin{macrocode}
+ \xpatchcmd{\thenomenclature}{%
+ \@ifundefined{chapter}%
+ }{%
+ \scr@hack@nomencl@head
+ \@gobbletwo
+ }{%
+ \PackageWarning{scrhack}{%
+ using emergency patch of \string\thenomenclature.\MessageBreak
+ This could happen if you are using an unknown\MessageBreak
+ release of package `nomencl'.\MessageBreak
+ Mostly this patch does work too, but it also could\MessageBreak
+ break `nomencl`. If this happens, please deactivate\MessageBreak
+ the `nomencl` hack of `scrhack`%
+ }%
+ }{%
+ \PackageWarning{scrhack}{%
+ cannot patch \string\thenomenclature.\MessageBreak
+ This could happen if you are using an unknown\MessageBreak
+ release of package `nomencl'%
+ }%
+ }%
+ }%
+ }%
+}
+%</nomencl&body>
+% \end{macrocode}
+% \end{command}^^A \thenomenclature
+%
+% \begin{macro}{\scr@hack@nomencl@head}
+% \changes{v3.23}{2017/03/31}{heading of \env{thenomenclature} by
+% \pkg*{tocbasic}}
+% \changes{v3.31}{2020/07/08}{internal \cs{list@fname} eliminated}
+% We don't need an extra group, because \env{thenomenclature} already adds the
+% group.
+% \begin{macrocode}
+%<*nomencl&body>
+\newcommand*{\scr@hack@nomencl@head}{%
+ \providecommand*{\listofnlsname}{\nomname}%
+ \def\@currext{nls}%
+ \tocbasic@listhead{\nomname}%
+}
+%</nomencl&body>
+% \end{macrocode}
+% \begin{description}
+% \item[Note:] Only the heading hooks of \pkg*{tocbasic} are used. The other
+% hooks can be set, but would never be used!
+% \end{description}
+% \end{macro}^^A \scr@hack@nomencl@head
+%
+% \begin{macro}{\if@intoc}
+% \changes{3.23}{2017/03/31}{support of \cs{if@intoc}}
+% Generally we have to support \pkg{nomencl}'s option \opt{intoc} and the
+% switch \cs{if@intoc}. This is done by (un-)setting \pkg*{tocbasic} feature
+% \texttt{totoc}. So additional changes of the feature can be done at first
+% after loading both, \pkg{nomencl} and \pkg*{scrhack}. Moreover, later changes
+% of \cs{if@intoc} are not recognized.
+% \begin{macrocode}
+%<*nomencl&body>
+\if@intoc
+ \setuptoc{nls}{totoc}
+\fi
+%</nomencl&body>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{The \texorpdfstring{\pkg*{setspace}}{setspace} hack}
+%
+% Package \pkg{setspace} internally uses \cs{@ptsize} in a way, that only
+% works as long as \cs{@ptsize} is an integer. But because \KOMAScript{}
+% supports non integer font sizes, \cs{@ptsize} can also contain non-integer
+% values. Moreover for \opt{11pt}, \LaTeX{} does not use a 11\,pt font but
+% a 10.95\,pt font with a \len{baselineskip} of 13.6\,pt, the correct factor
+% for, e.g., \cs{onehalfspacing} would be:
+% \[ 10{,}95\,\mathrm{pt} \dot 1{,5} / 13{,}6\,\mathrm{pt} \equiv 1{,}208 \]
+% But \pkg{setspace} uses 1.213, which would be correct for 11\,pt. Moreover
+% the factor is always relative to the base font size and not the current font
+% size. Because of this
+% \begin{verbatim}
+% \documentclass[10pt]{article}
+% \usepackage{setspace}
+% \begin{document}
+% \large\onehalfspacing\raggedright
+% Fontsize: \csname f@size\endcsname pt\\
+% Normal baselineskip: \csname f@baselineskip\endcsname\\
+% baselineskip: \the\baselineskip
+% \end{document}
+% \end{verbatim}
+% results in another \len{baselineskip} than:
+% \begin{verbatim}
+% \documentclass[11pt]{article}
+% \usepackage{setspace}
+% \begin{document}
+% \large\onehalfspacing\raggedright
+% Fontsize: \csname f@size\endcsname pt\\
+% Normal baselineskip: \csname f@baselineskip\endcsname\\
+% baselineskip: \the\baselineskip
+% \end{document}
+% \end{verbatim}
+% despite both examples use the same font size. So, to make it absolutely
+% correct, the factor would have to change with every change of the font
+% size. But the hack also does not do so. It just calculates the factor
+% depending on the base font size an the current font size. This is enough to
+% have the same \len{baselineskip} with both of the examples above.
+%
+% \begin{option}{setspace}
+% \changes{v3.17}{2015/04/16}{added}
+% \changes{v3.39}{2022/11/11}{initial dot in member argument of \cs{KOMA@key}
+% removed}
+% \begin{macrocode}
+%<*package&option>
+\KOMA@ifkey{setspace}{@scrhack@setspace}
+\KOMAExecuteOptions{setspace=true}
+%</package&option>
+%<*package&body>
+\AfterPackage*{setspace}{%
+ \KOMA@key[scrhack.sty]{setspace}{%
+ \PackageWarning{scrhack}{option `setspace' ignored}%
+ \FamilyKeyStateProcessed
+ }%
+ \if@scrhack@setspace\scr@hack@load\@pkgextension{setspace}\fi
+}
+%</package&body>
+% \end{macrocode}
+% \end{option}
+%
+%
+% \begin{command}{\onehalfspacing}
+% \changes{v3.17}{2015/04/16}{added}
+% This selects the one half line spacing. I think, a factor with three digits
+% for the decimals should be enough.
+% \begin{macrocode}
+%<*setspace&body>
+\scr@ifexpected{\onehalfspacing}{%
+ \long\def\onehalfspacing{%
+ \setstretch{1.25}% default
+ \ifcase \@ptsize \relax % 10pt
+ \setstretch {1.25}%
+ \or % 11pt
+ \setstretch {1.213}%
+ \or % 12pt
+ \setstretch {1.241}%
+ \fi
+ }%
+}{%
+ \renewcommand*{\onehalfspacing}{%
+ \@tempdima=\dimexpr (\f@size pt)*1500/
+ (\dimexpr \f@baselineskip\relax)*\p@/1000\relax
+ \expandafter\setstretch\expandafter{\strip@pt\@tempdima}%
+ }%
+}{%
+% \end{macrocode}
+% \changes{v3.39}{2023/03/15}{support for \pkg{setspace} 6.7b added}
+% \begin{macrocode}
+ \scr@ifexpected{\onehalfspacing}{%
+ \long\def\onehalfspacing{%
+ \setstretch{1.25}% default
+% DPC 6.7b guard \@ptsize
+ \ifx\@ptsize\@undefined\else
+ \ifcase \@ptsize \relax % 10pt
+ \setstretch {1.25}%
+ \or % 11pt
+ \setstretch {1.213}%
+ \or % 12pt
+ \setstretch {1.241}%
+ \fi
+ \fi
+ }%
+ }{%
+ \renewcommand*{\onehalfspacing}{%
+ \@tempdima=\dimexpr (\f@size pt)*1500/
+ (\dimexpr \f@baselineskip\relax)*\p@/1000\relax
+ \expandafter\setstretch\expandafter{\strip@pt\@tempdima}%
+ }%
+ }{%
+ \PackageWarning{scrhack}{unknown \string\onehalfspacing\space
+ definition found!\MessageBreak
+ Maybe you are using a unsupported setpace version}%
+ }%
+}
+% \end{macrocode}
+% \end{command}
+% \begin{command}{\doublespacing}
+% \changes{v3.17}{2015/04/16}{new}
+% This selects the double line spacing. I think, a factor with three digits
+% for the decimals should be enough.
+% \begin{macrocode}
+\scr@ifexpected{\doublespacing}{%
+ \long\def\doublespacing{%
+ \setstretch{1.667}% default
+ \ifcase \@ptsize \relax % 10pt
+ \setstretch {1.667}%
+ \or % 11pt
+ \setstretch {1.618}%
+ \or % 12pt
+ \setstretch {1.655}%
+ \fi
+ }%
+}{%
+ \renewcommand*{\doublespacing}{%
+ \@tempdima=\dimexpr (\f@size pt)*2000/
+ (\dimexpr \f@baselineskip\relax)*\p@/1000\relax
+ \expandafter\setstretch\expandafter{\strip@pt\@tempdima}%
+ }%
+}{%
+% \end{macrocode}
+% \changes{v3.39}{2023/03/15}{support for \pkg{setspace} 6.7b added}
+% \begin{macrocode}
+ \scr@ifexpected{\doublespacing}{%
+ \long\def\doublespacing{%
+ \setstretch {1.667}% default
+% DPC 6.7b guard \@ptsize
+ \ifx\@ptsize\@undefined\else
+ \ifcase \@ptsize \relax % 10pt
+ \setstretch {1.667}%
+ \or % 11pt
+ \setstretch {1.618}%
+ \or % 12pt
+ \setstretch {1.655}%
+ \fi
+ \fi
+ }%
+ }{%
+ \renewcommand*{\doublespacing}{%
+ \@tempdima=\dimexpr (\f@size pt)*2000/
+ (\dimexpr \f@baselineskip\relax)*\p@/1000\relax
+ \expandafter\setstretch\expandafter{\strip@pt\@tempdima}%
+ }%
+ }{%
+ \PackageWarning{scrhack}{unknown \string\doublespacing\space
+ definition found!\MessageBreak
+ Maybe you are using a unsupported setpace version}%
+ }%
+}
+%</setspace&body>
+% \end{macrocode}
+% \end{command}
+%
+%
+% \subsection{The \texorpdfstring{\pkg*{lscape}}{lscape} hack}
+% \changes{v3.18a}{2015/07/07}{\pkg{lscape} hack added}
+%
+% The package does change \len{textheight} inside \env{landscape} to the prior
+% value of \len{textwidth}, nevertheless is does not change \len{textwidth} to
+% the prior value of \len{textheight}. This is at least inconsistent. After
+% asking him, David~Carlisle answered, that he does not change
+% \len{textwidth}, because this could result in problems. Therefore it is very
+% strange, that he does change \cs{textheight}, despite this also to problems,
+% e.g., with packages \pkg{showframe} or \pkg*{scrlayer}. So the patch here
+% also keeps \len{textheight} unchanged. This also has to take care for
+% \pkg{pdflscape}. The patches are done using \pkg{xpatch}.
+%
+%
+% \begin{option}{lscape}
+% \changes{v3.18a}{2015/07/07}{added}
+% \changes{v3.20}{2016/05/07}{loading \pkg{xpatch} in option part already}
+% \changes{v3.39}{2022/11/11}{initial dot in member argument of \cs{KOMA@key}
+% removed}
+% \begin{macrocode}
+%<*package&option>
+\RequirePackage{xpatch}%
+\KOMA@ifkey{lscape}{@scrhack@lscape}%
+\KOMAExecuteOptions{lscape=true}%
+%</package&option>
+%<*package&body>
+\AfterPackage*{lscape}{%
+ \if@scrhack@lscape\scr@hack@load\@pkgextension{lscape}\else
+ \KOMA@key[scrhack.sty]{lscape}{%
+ \PackageWarning{scrhack}{option `lscape' ignored}%
+ \FamilyKeyStateProcessed
+ }%
+ \fi
+}
+%</package&body>
+% \end{macrocode}
+% \end{option}
+%
+% \begin{command}{\landscape}
+% \changes{v3.18a}{2015/07/07}{added}
+% \changes{v3.20}{2016/05/07}{loading \pkg{xpatch} in option part already}
+% This command is the beginning of environment \env{landscape}. This has to be
+% patched using \pkg{xpatch}.
+% \begin{description}
+% \item[Note:] This is a load time option and cannot be changed after loading
+% the package!
+% \end{description}
+% \begin{macrocode}
+%<*lscape&body>
+\xpatchcmd{\landscape}{\textheight=\vsize}{%
+ \if@scrhack@lscape
+% \end{macrocode}
+% \begin{macro}{\@outputpage}
+% \changes{v3.18a}{2015/08/11}{added}
+% Here the changed value of \len{textheight} is needed for initialization of
+% \cs{@colht}. So we patch it to use the new internal \len{scr@LT@textheight}
+% instead of \len{textheight}.
+% \begin{macrocode}
+ \scrh@LT@textheight=\vsize
+ \let\scrh@LT@outputpage\@outputpage
+ \def\@outputpage{\scrh@LT@outputpage\global\@colht\scrh@LT@textheight}%
+ \else
+ \textheight=\vsize
+ \fi
+}{%
+ \PackageInfo{scrhack}{\string\landscape\space patched to make
+ \string\textheight\space change optional}%
+}{%
+ \PackageWarning{scrhack}{Cannot patch \string\landscape!\MessageBreak
+ Maybe you are using a unsupported lscape version}%
+ \@scrhack@lscapefalse
+}
+% \end{macrocode}
+% \begin{ilength}{\scrh@LT@textheight}
+% \changes{v3.18a}{2015/08/11}{new}
+% \begin{macrocode}
+\newlength{\scrh@LT@textheight}
+%</lscape&body>
+% \end{macrocode}
+% \end{ilength}^^A \scrh@LT@textheight
+% \end{macro}^^A \@outputpage
+% \end{command}^^A \landscape
+%
+%
+% \subsection{The standard classes sections hack}
+% \label{sec:standardsections}
+% The \emph{standard classes sections hack} differs from each other
+% hack. First of all it does not patch a specific package but the class
+% definitions of section commands from \cs{part} till
+% \cs{subparagraph}. Additionally it resets several internal \LaTeX{} macros
+% which are changed by \KOMAScript{} classes to their original
+% definition. Last but not least it is not activated by default, but the user
+% has to activate it, if he needs it. The hack has more potential to break
+% things than to make things better. Because of this, there is not any support
+% for using this hack and the hack shows several warning messages.
+%
+% \begin{option}{standardsections}
+% \begin{macrocode}
+%<*package&option>
+\KOMA@ifkey{standardsections}{@scrhack@standardsections}
+\KOMAExecuteOptions{standardsections=false}
+%</package&option>
+%<*package&body>
+\AtEndOfPackage{%
+ \if@scrhack@standardsections
+ \PackageInfo{scrhack}{loading standard classes sections hack}%
+ \input{standardsections.hak}%
+ \fi
+}
+%</package&body>
+% \end{macrocode}
+% \end{option}^^A standardsections
+%
+% \begin{command}{\part,\chapter,
+% \section,\subsection,\subsubsection,
+% \paragraph,\subparagraph}
+% The hack redefines all these commands to a definition copied from the
+% standard \LaTeX{} classes version v1.4i. Copyright of this code is by the
+% \LaTeX3{} Project. The complete, unmodified code can be found on
+% \url{https://ctan.org/tex-archive/macros/latex/base/classes.dtx}.
+% \begin{macrocode}
+%<*standardsections&body>
+\PackageWarningNoLine{scrhack}{%
+ You are loosing every kind of support because of\MessageBreak
+ using the dangerous standard classes sections hack!\MessageBreak
+ This hack can break several classes and packages.\MessageBreak
+ However, sometimes it is needed to make a\MessageBreak
+ package work%
+}%
+\PackageInfo{scrhack}{%
+ Using code from the standard LaTeX classes.\MessageBreak
+ For more information about this code and the\MessageBreak
+ license of this code, please see:\MessageBreak
+ https://ctan.org/tex-archive/macros/latex/base/classes.dtx
+}%
+\@ifpackageloaded{hyperref}{%
+ \PackageWarning{scrhack}{this hack should not be loaded after `hyperref'}%
+}{}
+\@ifpackageloaded{titlesec}{%
+ \PackageWarning{scrhack}{this hack should not be loaded after `titlesec'}%
+}{}
+\@ifpackageloaded{sectsty}{%
+ \PackageWarning{scrhack}{this hack should not be loaded after `sectsty'}%
+}{}
+\scr@ifundefinedorrelax{chapter}{%
+% \end{macrocode}
+% It seems to be an article class, so we use the code from
+% \href{http://mirrors.ctan.org/macros/latex/base/classes.dtx}{\cls*{article}}.
+% \begin{macrocode}
+ \scr@ifundefinedorrelax{c@part}{\newcounter{part}}{}%
+ \scr@ifundefinedorrelax{c@section}{\newcounter{section}}{}%
+ \scr@ifundefinedorrelax{c@subsection}{\newcounter{subsection}[section]}{}%
+ \scr@ifundefinedorrelax{c@subsubsection}{%
+ \newcounter{subsubsection}[subsection]}{}%
+ \scr@ifundefinedorrelax{c@paragraph}{%
+ \newcounter{paragraph}[subsubsection]}{}%
+ \scr@ifundefinedorrelax{c@subparagraph}{%
+ \newcounter{subparagraph}[paragraph]}{}%
+ \renewcommand\thepart {\@Roman\c@part}%
+ \renewcommand\thesection {\@arabic\c@section}%
+ \renewcommand\thesubsection {\thesection.\@arabic\c@subsection}%
+ \renewcommand\thesubsubsection{\thesubsection.\@arabic\c@subsubsection}%
+ \renewcommand\theparagraph {\thesubsubsection.\@arabic\c@paragraph}%
+ \renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph}%
+ \def\part{%
+ \if@noskipsec \leavevmode \fi
+ \par
+ \addvspace{4ex}%
+ \@afterindentfalse
+ \secdef\@part\@spart}%
+ \def\@part[#1]#2{%
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ {\parindent \z@ \raggedright
+ \interlinepenalty \@M
+ \normalfont
+ \ifnum \c@secnumdepth >\m@ne
+ \Large\bfseries \partname\nobreakspace\thepart
+ \par\nobreak
+ \fi
+ \huge \bfseries #2%
+ \markboth{}{}\par}%
+ \nobreak
+ \vskip 3ex
+ \@afterheading}%
+ \def\@spart#1{%
+ {\parindent \z@ \raggedright
+ \interlinepenalty \@M
+ \normalfont
+ \huge \bfseries #1\par}%
+ \nobreak
+ \vskip 3ex
+ \@afterheading}%
+ \def\section{\@startsection {section}{1}{\z@}%
+ {-3.5ex \@plus -1ex \@minus -.2ex}%
+ {2.3ex \@plus.2ex}%
+ {\normalfont\Large\bfseries}}%
+ \def\subsection{\@startsection{subsection}{2}{\z@}%
+ {-3.25ex\@plus -1ex \@minus -.2ex}%
+ {1.5ex \@plus .2ex}%
+ {\normalfont\large\bfseries}}%
+ \def\subsubsection{\@startsection{subsubsection}{3}{\z@}%
+ {-3.25ex\@plus -1ex \@minus -.2ex}%
+ {1.5ex \@plus .2ex}%
+ {\normalfont\normalsize\bfseries}}%
+ \def\paragraph{\@startsection{paragraph}{4}{\z@}%
+ {3.25ex \@plus1ex \@minus.2ex}%
+ {-1em}%
+ {\normalfont\normalsize\bfseries}}%
+ \def\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
+ {3.25ex \@plus1ex \@minus .2ex}%
+ {-1em}%
+ {\normalfont\normalsize\bfseries}}%
+}{%
+% \end{macrocode}
+% It seems to be either a book or report class.
+% \begin{macrocode}
+ \scr@ifundefinedorrelax{c@part}{\newcounter{part}}{}%
+ \scr@ifundefinedorrelax{c@chapter}{\newcounter{chapter}}{}%
+ \scr@ifundefinedorrelax{c@section}{\newcounter{section}[chapter]}{}%
+ \scr@ifundefinedorrelax{c@subsection}{\newcounter{subsection}[section]}{}%
+ \scr@ifundefinedorrelax{c@subsubsection}{%
+ \newcounter{subsubsection}[subsection]}{}%
+ \scr@ifundefinedorrelax{c@paragraph}{%
+ \newcounter{paragraph}[subsubsection]}{}%
+ \scr@ifundefinedorrelax{c@subparagraph}{%
+ \newcounter{subparagraph}[paragraph]}{}%
+ \def\@chapapp{\chaptername}%
+ \scr@ifundefinedorrelax{frontmatter}{%
+% \end{macrocode}
+% It seems not to be a book class.
+% \begin{macrocode}
+ \def\part{%
+ \if@openright
+ \cleardoublepage
+ \else
+ \clearpage
+ \fi
+ \thispagestyle{plain}%
+ \if@twocolumn
+ \onecolumn
+ \@tempswatrue
+ \else
+ \@tempswafalse
+ \fi
+ \null\vfil
+ \secdef\@part\@spart}
+
+ \def\@part[#1]#2{%
+ \ifnum \c@secnumdepth >-2\relax
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ \markboth{}{}%
+ {\centering
+ \interlinepenalty \@M
+ \normalfont
+ \ifnum \c@secnumdepth >-2\relax
+ \huge\bfseries \partname\nobreakspace\thepart
+ \par
+ \vskip 20\p@
+ \fi
+ \Huge \bfseries #2\par}%
+ \@endpart}
+ \def\@spart#1{%
+ {\centering
+ \interlinepenalty \@M
+ \normalfont
+ \Huge \bfseries #1\par}%
+ \@endpart}
+ \def\@endpart{\vfil\newpage
+ \if@twoside
+ \if@openright
+ \null
+ \thispagestyle{empty}%
+ \newpage
+ \fi
+ \fi
+ \if@tempswa
+ \twocolumn
+ \fi}
+ \def\chapter{\if@openright\cleardoublepage\else\clearpage\fi
+ \thispagestyle{plain}%
+ \global\@topnum\z@
+ \@afterindentfalse
+ \secdef\@chapter\@schapter}
+ \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{chapter}%
+ \typeout{\@chapapp\space\thechapter.}%
+ \addcontentsline{toc}{chapter}%
+ {\protect\numberline{\thechapter}#1}%
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \fi
+ \chaptermark{#1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{#2}]%
+ \else
+ \@makechapterhead{#2}%
+ \@afterheading
+ \fi}
+ \def\@makechapterhead#1{%
+ \vspace*{50\p@}%
+ {\parindent \z@ \raggedright \normalfont
+ \ifnum \c@secnumdepth >\m@ne
+ \huge\bfseries \@chapapp\space \thechapter
+ \par\nobreak
+ \vskip 20\p@
+ \fi
+ \interlinepenalty\@M
+ \Huge \bfseries #1\par\nobreak
+ \vskip 40\p@
+ }}
+ \def\@schapter#1{\if@twocolumn
+ \@topnewpage[\@makeschapterhead{#1}]%
+ \else
+ \@makeschapterhead{#1}%
+ \@afterheading
+ \fi}
+ \def\@makeschapterhead#1{%
+ \vspace*{50\p@}%
+ {\parindent \z@ \raggedright
+ \normalfont
+ \interlinepenalty\@M
+ \Huge \bfseries #1\par\nobreak
+ \vskip 40\p@
+ }}
+ \def\section{\@startsection {section}{1}{\z@}%
+ {-3.5ex \@plus -1ex \@minus -.2ex}%
+ {2.3ex \@plus.2ex}%
+ {\normalfont\Large\bfseries}}%
+ \def\subsection{\@startsection{subsection}{2}{\z@}%
+ {-3.25ex\@plus -1ex \@minus -.2ex}%
+ {1.5ex \@plus .2ex}%
+ {\normalfont\large\bfseries}}%
+ \def\subsubsection{\@startsection{subsubsection}{3}{\z@}%
+ {-3.25ex\@plus -1ex \@minus -.2ex}%
+ {1.5ex \@plus .2ex}%
+ {\normalfont\normalsize\bfseries}}%
+ \def\paragraph{\@startsection{paragraph}{4}{\z@}%
+ {3.25ex \@plus1ex \@minus.2ex}%
+ {-1em}%
+ {\normalfont\normalsize\bfseries}}%
+ \def\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
+ {3.25ex \@plus1ex \@minus .2ex}%
+ {-1em}%
+ {\normalfont\normalsize\bfseries}}%
+ }{%
+% \end{macrocode}
+% It seems to be a book class.
+% \begin{macrocode}
+ \scr@ifundefinedorrelax{if@mainmatter}{%
+ \expandafter\newif\csname if@mainmatter\endcsname
+ }{}%
+ \def\frontmatter{%
+ \cleardoublepage
+ \@mainmatterfalse
+ \pagenumbering{roman}}%
+ \def\mainmatter{%
+ \cleardoublepage
+ \@mainmattertrue
+ \pagenumbering{arabic}}%
+ \def\backmatter{%
+ \if@openright
+ \cleardoublepage
+ \else
+ \clearpage
+ \fi
+ \@mainmatterfalse}%
+ \def\part{%
+ \if@openright
+ \cleardoublepage
+ \else
+ \clearpage
+ \fi
+ \thispagestyle{plain}%
+ \if@twocolumn
+ \onecolumn
+ \@tempswatrue
+ \else
+ \@tempswafalse
+ \fi
+ \null\vfil
+ \secdef\@part\@spart}%
+
+ \def\@part[#1]#2{%
+ \ifnum \c@secnumdepth >-2\relax
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ \markboth{}{}%
+ {\centering
+ \interlinepenalty \@M
+ \normalfont
+ \ifnum \c@secnumdepth >-2\relax
+ \huge\bfseries \partname\nobreakspace\thepart
+ \par
+ \vskip 20\p@
+ \fi
+ \Huge \bfseries #2\par}%
+ \@endpart}%
+ \def\@spart#1{%
+ {\centering
+ \interlinepenalty \@M
+ \normalfont
+ \Huge \bfseries #1\par}%
+ \@endpart}%
+ \def\@endpart{\vfil\newpage
+ \if@twoside
+ \if@openright
+ \null
+ \thispagestyle{empty}%
+ \newpage
+ \fi
+ \fi
+ \if@tempswa
+ \twocolumn
+ \fi}%
+ \def\chapter{\if@openright\cleardoublepage\else\clearpage\fi
+ \thispagestyle{plain}%
+ \global\@topnum\z@
+ \@afterindentfalse
+ \secdef\@chapter\@schapter}%
+ \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \refstepcounter{chapter}%
+ \typeout{\@chapapp\space\thechapter.}%
+ \addcontentsline{toc}{chapter}%
+ {\protect\numberline{\thechapter}#1}%
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \fi
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \fi
+ \chaptermark{#1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{#2}]%
+ \else
+ \@makechapterhead{#2}%
+ \@afterheading
+ \fi}%
+ \def\@makechapterhead#1{%
+ \vspace*{50\p@}%
+ {\parindent \z@ \raggedright \normalfont
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \huge\bfseries \@chapapp\space \thechapter
+ \par\nobreak
+ \vskip 20\p@
+ \fi
+ \fi
+ \interlinepenalty\@M
+ \Huge \bfseries #1\par\nobreak
+ \vskip 40\p@
+ }}%
+ \def\@schapter#1{\if@twocolumn
+ \@topnewpage[\@makeschapterhead{#1}]%
+ \else
+ \@makeschapterhead{#1}%
+ \@afterheading
+ \fi}%
+ \def\@makeschapterhead#1{%
+ \vspace*{50\p@}%
+ {\parindent \z@ \raggedright
+ \normalfont
+ \interlinepenalty\@M
+ \Huge \bfseries #1\par\nobreak
+ \vskip 40\p@
+ }}%
+ \def\section{\@startsection {section}{1}{\z@}%
+ {-3.5ex \@plus -1ex \@minus -.2ex}%
+ {2.3ex \@plus.2ex}%
+ {\normalfont\Large\bfseries}}%
+ \def\subsection{\@startsection{subsection}{2}{\z@}%
+ {-3.25ex\@plus -1ex \@minus -.2ex}%
+ {1.5ex \@plus .2ex}%
+ {\normalfont\large\bfseries}}%
+ \def\subsubsection{\@startsection{subsubsection}{3}{\z@}%
+ {-3.25ex\@plus -1ex \@minus -.2ex}%
+ {1.5ex \@plus .2ex}%
+ {\normalfont\normalsize\bfseries}}%
+ \def\paragraph{\@startsection{paragraph}{4}{\z@}%
+ {3.25ex \@plus1ex \@minus.2ex}%
+ {-1em}%
+ {\normalfont\normalsize\bfseries}}%
+ \def\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
+ {3.25ex \@plus1ex \@minus .2ex}%
+ {-1em}%
+ {\normalfont\normalsize\bfseries}}%
+ }%
+}% End of the derived code.
+% \end{macrocode}
+% \end{command}
+%
+% \begin{macro}{\@startsection}
+% \KOMAScript{} classes redefine this internal \LaTeX{} kernel macro. In this
+% case \cs{scr@saved@startsection} is defined, differs from
+% \cs{@startsection} and has the definition found before redefining the
+% original macro. We do nothing else but resetting \cs{@startsection} to this
+% saved definition.
+% \begin{macrocode}
+\scr@ifundefinedorrelax{scr@saved@startsection}{}{%
+ \ifx\@startsection\scr@saved@startsection\else
+ \PackageWarningNoLine{scrhack}{%
+ Resetting \string\@startsection,\MessageBreak
+ because of loading standard classes sections hack%
+ }%
+ \let\@startsection\scr@saved@startsection
+ \fi
+}
+% \end{macrocode}
+% \end{macro}^^A \@startsection
+%
+% \begin{macro}{\@sect,\@ssect,\@xsect}
+% All these should be resetted to their original definitions stored in
+% \cs{scr@latex@\dots}.
+% \begin{macrocode}
+\scr@ifundefinedorrelax{scr@latex@sect}{}{%
+ \ifx\@sect\scr@latex@sect\else
+ \PackageWarningNoLine{scrhack}{%
+ Resetting \string\@sect,\MessageBreak
+ because of loading standard classes sections hack%
+ }%
+ \let\@sect\scr@latex@sect
+ \fi
+}
+\scr@ifundefinedorrelax{scr@latex@ssect}{}{%
+ \ifx\@ssect\scr@latex@ssect\else
+ \PackageWarningNoLine{scrhack}{%
+ Resetting \string\@ssect,\MessageBreak
+ because of loading standard classes sections hack%
+ }%
+ \let\@ssect\scr@latex@ssect
+ \fi
+}
+\scr@ifundefinedorrelax{scr@latex@xsect}{}{%
+ \ifx\@xsect\scr@latex@xsect\else
+ \PackageWarningNoLine{scrhack}{%
+ Resetting \string\@xsect,\MessageBreak
+ because of loading standard classes sections hack%
+ }%
+ \let\@xsect\scr@latex@xsect
+ \fi
+}
+% \end{macrocode}
+% \end{macro}^^A \@xsect,\@ssect,\@sect
+%
+% \begin{command}{\DeclareSectionCommand,\RedeclareSectionCommand,
+% \DeclareNewSectionCommand,\ProvideSectionCommand,
+% \DeclareSectionCommands,\RedeclareSectionCommands,
+% \DeclareNewSectionCommands,\ProvideSectionCommands}
+% These \KOMAScript{} commands do not make sense any longer after forced
+% redefinition of \cs{part} \dots{} \cs{subparagraph}. They even would not
+% work correctly after resetting, e.g., \cs{@startsection}. So best reaction
+% is to \emph{undefine} them.
+% \begin{macrocode}
+\scr@ifundefinedorrelax{DeclareSectionCommand}{}{%
+ \PackageWarningNoLine{scrhack}{%
+ \string\DeclareSectionCommand\space
+ and all derivates deactivated,\MessageBreak
+ because of loading standard classes sections hack%
+ }%
+ \let\DeclareSectionCommand\undefined
+ \let\DeclareSectionCommands\undefined
+ \let\RedeclareSectionCommand\undefined
+ \let\RedeclareSectionCommands\undefined
+ \let\DeclareNewSectionCommand\undefined
+ \let\DeclareNewSectionCommands\undefined
+ \let\ProvideSectionCommand\undefined
+ \let\ProvideSectionCommands\undefined
+}
+% \end{macrocode}
+% \begin{macro}{\scr@chapter@before@hyperref@patch,
+% \scr@chapter@after@hyperref@patch}
+% Now, definitions without respecting \pkg{hyperref} are used, so
+% \pkg{hyperref} should again be able to patch them. So the hack should
+% deactivate the patch deactivation of the \KOMAScript{} classes.
+% \begin{macrocode}
+\let\scr@chapter@before@hyperref@patch\relax
+\let\scr@chapter@after@hyperref@patch\relax
+% \end{macrocode}
+% \end{macro}
+% \end{command}
+%
+% \begin{macro}{\scr@osectarg}
+% The \KOMAScript{} classes use this macro to store how to use the optional
+% argument of section commands. But with the standard class definition the
+% only possibility is to use it as running head and write it into the table of
+% contents without any extended handling. So the only value, that makes sense
+% is 0.
+% \begin{macrocode}
+\scr@ifundefinedorrelax{scr@osectarg}{}{%
+ \def\reserved@a{0}%
+ \ifx\scr@osectarg\reserved@a\else
+ \let\scr@osectarg\reserved@a
+ \PackageWarningNoLine{scrhack}{%
+ Extended option handling for section commands deactivated,\MessageBreak
+ because of loading standard classes sections hack%
+ }%
+ \fi
+}%
+% \end{macrocode}
+% \begin{macro}{\scr@activate@xsection}
+% Further changing of the value has to be deactivated.
+% \begin{macrocode}
+\scr@ifundefinedorrelax{scr@activate@xsection}{}{%
+ \renewcommand*{\scr@activate@xsection}[1]{%
+ \edef\scr@osectarg{#1}\def\reserved@a{0}%
+ \ifx\scr@osectarg\reserved@a
+ \else
+ \let\scr@osectarg\reserved@a
+ \PackageWarning{scrhack}{%
+ Because of loading the standard classes\MessageBreak
+ sections hack, the extended option handling\MessageBreak
+ of section commands failed%
+ }%
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}^^A \scr@activate@xsection
+% \end{macro}^^A \scr@osectarg
+%
+% \begin{command}{\partformat,\chapterformat}
+% Most \cs{\dots format} macros of \KOMAScript{} are still used, because of
+% the redefinition of \cs{@seccntformat}. But \cs{part} and \cs{chapter} are
+% defined without using them.
+% \begin{macrocode}
+\scr@ifundefinedorrelax{partformat}{}{%
+ \PackageWarningNoLine{scrhack}{%
+ Usage of \string\partformat\space
+ deactivated,\MessageBreak
+ because of loading the standard classes sections hack%
+ }%
+}
+\scr@ifundefinedorrelax{chapterformat}{}{%
+ \PackageWarningNoLine{scrhack}{%
+ Usage of \string\chapterformat\space
+ deactivated,\MessageBreak
+ because of loading the standard classes sections hack%
+ }%
+}
+% \end{macrocode}
+% \end{command}^^A \chapterformat,\partformat
+%
+% \begin{command}{\sectionformat,\subsectionformat,\subsubsectionformat,
+% \paragraphformat,\subparagraphformat}
+% All these commands have to be resetted to not use the automatic dot and to
+% add a \cs{quad} instead of an \cs{enskip}.
+% \begin{macrocode}
+\scr@ifundefinedorrelax{sectionformat}{}{%
+ \PackageWarningNoLine{scrhack}{%
+ \string\sectionformat\space set to
+ `\string\thesection\string\quad',\MessageBreak
+ because of loading the standard classes sections hack%
+ }%
+ \renewcommand*{\sectionformat}{\thesection\quad}%
+}
+\scr@ifundefinedorrelax{subsectionformat}{}{%
+ \PackageWarningNoLine{scrhack}{%
+ \string\subsectionformat\space set to
+ `\string\thesubsection\string\quad'\MessageBreak
+ because of loading the standard classes sections hack%
+ }%
+ \renewcommand*{\subsectionformat}{\thesubsection\quad}%
+}
+\scr@ifundefinedorrelax{subsubsectionformat}{}{%
+ \PackageWarningNoLine{scrhack}{%
+ \string\subsubsectionformat\space set to
+ `\string\thesubsubsection\string\quad'\MessageBreak
+ because of loading the standard classes sections hack%
+ }%
+ \renewcommand*{\subsubsectionformat}{\thesubsubsection\quad}%
+}
+\scr@ifundefinedorrelax{paragraphformat}{}{%
+ \PackageWarningNoLine{scrhack}{%
+ \string\paragraphformat\space set to
+ `\string\theparagraph\string\quad'\MessageBreak
+ because of loading the standard classes sections hack%
+ }%
+ \renewcommand*{\paragraphformat}{\theparagraph\quad}%
+}
+\scr@ifundefinedorrelax{subparagraphformat}{}{%
+ \PackageWarningNoLine{scrhack}{%
+ \string\subparagraphformat\space set to
+ `\string\thesubparagraph\string\quad'\MessageBreak
+ because of loading the standard classes sections hack%
+ }%
+ \renewcommand*{\subparagraphformat}{\thesubparagraph\quad}%
+}
+% \end{macrocode}
+% \end{command}
+%
+% \begin{command}{\partlineswithprefixformat,
+% \chapterlineswithprefixformat,\chapterlinesformat,
+% \sectionlinesformat,\sectioncatchphraseformat}
+% These \KOMAScript{} commands are not used any longer.
+% \begin{macrocode}
+\scr@ifundefinedorrelax{partlineswithprefixformat}{}{%
+ \PackageWarningNoLine{scrhack}{%
+ Usage of \string\partlineswithprefixformat\space deactivated,\MessageBreak
+ because of loading the standard classes sections hack%
+ }%
+}
+\scr@ifundefinedorrelax{chapterlineswithprefixformat}{}{%
+ \PackageWarningNoLine{scrhack}{%
+ Usage of \string\chapterlineswithprefixformat\space and\MessageBreak
+ \string\chapterlinesformat\space deactivated,\MessageBreak
+ because of using standard classes sections hack%
+ }%
+}
+\scr@ifundefinedorrelax{sectionlinesformat}{}{%
+ \PackageWarningNoLine{scrhack}{%
+ Usage of \string\sectionlinesformat\space and\MessageBreak
+ \string\sectioncatchphraseformat\space deactivated,\MessageBreak
+ because of using standard classes sections hack%
+ }%
+}
+% \end{macrocode}
+% \end{command}^^A \partlineswithprefixformat …
+%
+% \begin{option}{headings}
+% \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage
+% commands removed}
+% The \KOMAScript{} option does not make sense any longer. So it is
+% deactivated and usage will throw an error.
+% \begin{macrocode}
+\scr@ifundefinedorrelax{KOMAClassName}{}{%
+ \PackageWarningNoLine{scrhack}{%
+ KOMA-Script option `headings' removed,\MessageBreak
+ because of loading standard classes sections hack%
+ }%
+ \RelaxFamilyKey[.\KOMAClassFileName]{KOMA}{headings}%
+ \KOMA@kav@removekey{\KOMAClassFileName}{headings}%
+}
+% \end{macrocode}
+% \end{option}^^A headings
+%
+% \begin{macro}{\scr@class@titlesec@warning}
+% The warning about loading \pkg{titlesec} has to be changes, because we do
+% not expect errors any longer.
+% \begin{macrocode}
+\def\scr@class@titlesec@warning{%
+ \PackageWarning{scrhack}{%
+ Usage of `titlesec' should work, because of\MessageBreak
+ loading the standard classes sections hack.\MessageBreak
+ However, you should know, there is not any\MessageBreak
+ support for this combination by the\MessageBreak
+ KOMA-Script author%
+ }%
+}
+%</standardsections&body>
+% \end{macrocode}
+% \end{macro}^^A \scr@class@titlesec@warning
+%
+% \subsection{Executing options}
+%
+% Last but not least the options have to be processed. In the generated
+% package this will be done before the commands of \autoref{sec:macros}.
+% \begin{macrocode}
+%<*package&option>
+\KOMAProcessOptions\relax
+%</package&option>
+% \end{macrocode}
+%
+% \Finale
+% \PrintChanges
+%
+\endinput
+% Local Variables:
+% mode: doctex
+% ispell-local-dictionary: "en_US"
+% eval: (flyspell-mode 1)
+% TeX-master: t
+% TeX-engine: luatex-dev
+% eval: (setcar (or (cl-member "Index" (setq-local TeX-command-list (copy-alist TeX-command-list)) :key #'car :test #'string-equal) (setq-local TeX-command-list (cons nil TeX-command-list))) '("Index" "mkindex %s" TeX-run-index nil t :help "makeindex for dtx"))
+% End:
diff --git a/Master/texmf-dist/source/latex/scrhack/scrhack.dtx b/Master/texmf-dist/source/latex/scrhack/scrhack.dtx
new file mode 100644
index 00000000000..a14d7e2e948
--- /dev/null
+++ b/Master/texmf-dist/source/latex/scrhack/scrhack.dtx
@@ -0,0 +1,991 @@
+% \iffalse meta-comment
+% ======================================================================
+% scrhack.dtx
+% Copyright © 2008–2024 Markus Kohm
+%
+% This work is a KOMA-Script spin-off. For the original sources of
+% KOMA-Script's `scrhack.sty' see file `scrhack.dtx' in the KOMA-Script
+% sources at <https://sourceforge.net/p/koma-script/code/>.
+%
+% Development is taking place as part of `scrhack' at
+% <https://github.com/komascript/third-party-enhancements>. New issues
+% should be reported there as well as known issues can be found.
+%
+% This work may be distributed and/or modified under the conditions of
+% the LaTeX Project Public License, version 1.3c of the license.
+% 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 and of this work.
+%
+% This work has the LPPL maintenance status "author-maintained".
+%
+% The Current Maintainer and author of this work is Markus Kohm.
+%
+% This work consists of the file `scrhack.dtx',
+% `scrhack-2023-07-07,dtx', and `README.md'.
+%
+% The recommended way to install `scrhack' is to use
+% the package manager of your TeX distribution.
+% ======================================================================
+%
+%<*dtx>
+\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
+\ProvidesFile{scrhack.dtx}
+%</dtx>
+%<package>\providecommand\DeclareRelease[3]{}
+%<package>\providecommand\DeclareCurrentRelease[2]{}
+%<package>\DeclareRelease{v3.41}{2023-07-07}{scrhack-2023-07-07.sty}
+%<package>\DeclareCurrentRelease{}{2023-07-15}
+%<*dtx|package>
+%<package>\ProvidesPackage{scrhack}
+ [2024-09-04 v3.42
+%<dtx> sources and unpack driver of
+ scrhack emulation package]
+%</dtx|package>
+%<*dtx>
+\ifx\documentclass\undefined
+ \input docstrip.tex
+ \generate{%
+ \file{scrhack.sty}{%
+ \from{scrhack.dtx}{package}%
+ }%
+ }%
+\else
+ \let\endbatchfile\relax
+\fi
+\endbatchfile
+\documentclass[ngerman,USenglish]{koma-script-source-doc}
+\usepackage{babel}
+\usepackage{csquotes}
+\usepackage[style=alphabetic]{biblatex}
+\begin{filecontents}[force]{\jobname.bib}
+@online{pkg:koma-script,
+ author={Markus Kohm},
+ version={3.41},
+ date={2023-07-07},
+ title={{\KOMAScript} --- A bundle of versatile classes and packages},
+ url={https://ctan.org/pkg/koma-script},
+ urldate={2023-07-14},
+ note={The \KOMAScript{} bundle provides replacements for the \pkg*{article},
+ \pkg*{report}, and \pkg*{book} classes with emphasis on typography and
+ versatility. There is also a letter class.},
+}
+@manual{pkg:koma-script:manual:de,
+ author={Markus Kohm},
+ date={2023-06-16},
+ title={{\KOMAScript}},
+ subtitle={Die Anleitung},
+ url={http://mirrors.ctan.org/macros/latex/contrib/koma-script/scrguide-de.pdf},
+ urldate={2023-07-04},
+}
+@manual{pkg:koma-script:manual:en,
+ author={Markus Kohm},
+ date={2023-06-16},
+ title={{\KOMAScript}},
+ subtitle={The Guide},
+ url={http://mirrors.ctan.org/macros/latex/contrib/koma-script/scrguide-en.pdf},
+ urldate={2023-07-14},
+}
+@article{latexnews35,
+ author={{The {\LaTeX} Project Team}},
+ shortauthor={TLT},
+ year={2022},
+ month={6},
+ title={Issue 35},
+ journal={{\LaTeX} News},
+ url={http://mirrors.ctan.org/macros/latex/base/ltnews35.pdf},
+ urldate={2023-07-14},
+}
+\end{filecontents}
+\addbibresource{\jobname.bib}
+\setcounter{StandardModuleDepth}{2}
+\providecommand*{\seclabel}[1]{\label{sec:#1}}
+\begin{document}
+ \nocite{pkg:koma-script}
+ \DocInput{scrhack.dtx}
+\end{document}
+%</dtx>
+%\fi
+%
+% \changes{v0.1}{2023/07/14}{start of \KOMAScript{} spin-off}
+%
+% \GetFileInfo{scrhack.dtx}
+% \title{Emulating Former \href{https://komascript.de/}{\KOMAScript} Package
+% \pkg*{scrhack}}
+% \author{\href{mailto:komascript@gmx.info}{Markus Kohm}}
+% \date{Version \filedate{} \fileversion}
+% \maketitle
+% \begin{abstract}
+% For several years \href{https://komascript.de/}{\KOMAScript} provided a
+% package \pkg*{scrhack}, that has been made not only to improve the
+% compatibility of third-party packages with
+% \href{https://komascript.de/}{\KOMAScript} classes, but also to generally
+% improve third-party packages. The package consisted not only in the
+% package file \file{scrhack.sty} but also in several so called \emph{hacks}
+% as separate files with extension \file{.hak}. In the course of splitting
+% off former \href{https://komascript.de/}{\KOMAScript} packages from the
+% \href{https://komascript.de/}{\KOMAScript} collection, it was decided to
+% create independent packages from the individual hacks. These new
+% independent packages then serve as replacements for the original packages
+% they were intended to improve. In addition, to preserve the functionality
+% of loading the enhancements only when the corresponding original package
+% is loaded, a new \pkg*{scrhack} was created to do just that.
+% \end{abstract}
+%
+% \tableofcontents
+%
+%\iffalse
+%<*doc>
+%\fi
+% \section{History}
+% \label{sec:history}
+Some packages from other authors do not work well with
+\href{https://komascript.de/}{\KOMAScript}. It is often very tedious for the
+author of \href{https://komascript.de/}{\KOMAScript} to convince the authors
+of these packages to make specific improvements. This also applies to packages
+whose development has been discontinued. That's why the \pkg*{scrhack} was
+created. This package alters the commands and definitions of other to work
+better with \href{https://komascript.de/}{\KOMAScript}. Some changes are also
+useful when using other classes.
+
+In the early days of \href{https://komascript.de/}{\KOMAScript}, users wanted
+to handle lists of floating environments created with the \pkg{float} package
+in the same way as the list of figures and list of tables created by
+\href{https://komascript.de/}{\KOMAScript} itself. At that time the author of
+\href{https://komascript.de/}{\KOMAScript} contacted the author of
+\pkg{float} to propose an interface to support such an enhancement. A
+somewhat modified form of that interface was implemented with the
+\cs{float@listhead} and \cs{float@addtolists} commands.
+
+Later it became apparent that these two commands were not flexible enough to
+fully support all of \href{https://komascript.de/}{\KOMAScript}'s
+capabilities. Unfortunately, the author of \pkg{float} had already ceased
+development by that point, so further changes to this package cannot be
+expected.
+
+Other package authors have also adopted these two commands, and it became
+apparent that the implementation in some packages, including \pkg{float},
+means that all these packages can only be loaded in a specific order, even
+though they are otherwise unrelated to each other.
+
+To overcome all these disadvantages and problems,
+\href{https://komascript.de/}{\KOMAScript} no longer officially supports this
+old interface. Instead, \href{https://komascript.de/}{\KOMAScript} warns if
+the old interface is used. At the same time, the \pkg{tocbasic} package has
+been designed and implemented as a central interface for managing of table of
+contents and similar content lists. This package provides many more
+advantages and features than the two old commands.
+
+Although the effort to use this package is very small, so far the authors of
+most of the packages that use the old interface have not made any adjustments.
+Therefore the \KOMAScript author designed a new
+package \pkg*{scrhack} as part of
+\href{https://komascript.de/}{\KOMAScript}. That package contained appropriate
+modifications of the packages
+\pkg{float}, \pkg{floatrow}, \pkg{listings}, and later on also for
+\pkg{nomencl} and some others not related to that interface. Merely loading
+\pkg*{scrhack} was sufficient to make these packages recognize not only the
+setting of the \href{https://komascript.de/}{\KOMAScript} option \opt{listof},
+but, e.g., also to react to the language switching features of the
+\pkg{babel} package. You can find more information
+about the features available by switching packages to \pkg{tocbasic} in
+\autocite{pkg:koma-script:manual:en} or \autocite{pkg:koma-script:manual:de}.
+
+With release of version 3.42 package \pkg*{scrhack} has been removed from
+\href{https://komascript.de/}{\KOMAScript}. The code of the former package has
+been split into several standalone packages, that can be loaded individually
+if needed. However, for compatibility and maybe for convenience there is also
+a new standalone package \pkg*{scrhack} almost compatible with the old
+one.
+
+\section{Using \texorpdfstring{\pkg*{scrhack}}{scrhack}}
+\seclabel{usage}
+
+It is recommended to load the \pkg*{scrhack} package using:
+\begin{verbatim}
+ \usepackage{scrhack}
+\end{verbatim}
+as early as possible. In particular, loading should be done before the
+affected packages. The package also provides several options, one for each
+hack. Usually the options are named identically to the package, that is
+patched by the hack. All these options are boolean options. You can switch
+such an option on assigning value \optvalue{true} or using it without
+value. You can switch off such an option assigning value
+\optvalue{false}. Switching off an option means to not automatically load the
+corresponding enhancement package after the package, that has to be
+patched. Therefore switching off an option results in not patching the
+corresponding package.
+
+\paragraph{Notes:}
+\begin{itemize}
+\item From version 3.42, you cannot use \cs{KOMAoptions} or \cs{KOMAoption}
+ any longer to change the options. Instead loading \pkg*{scrhack} again with
+ other options does not result in an option clash, but in a change of the
+ option settings.
+\item Switching off an option of an already loaded enhancement package is
+ ignored (with warning). It does not unload the enhancement package or switch
+ back to a not patched functionality.
+\item Switching on an option of a not yet loaded enhancement package would
+ result in loading the enhancement package.
+\item From version 3.42, you should no longer load package
+ \pkg*{scrhack}. Instead you can and should simply load the individual
+ enhancement package when you need it.
+\item If you need the old legacy version of \pkg*{scrhack} from
+ \href{https://komascript.de/}{\KOMAScript} 3.41 you can use:
+\begin{verbatim}
+ \usepackage{scrhack}[=2023-07-07]
+\end{verbatim}
+ or
+\begin{verbatim}
+ \usepackage{scrhack}[=v3.41]
+\end{verbatim}
+ However, this depends on internal packages of
+ \href{https://komascript.de/}{\KOMAScript}.
+\item The hacks of the legacy version have been frozen. So the
+ hacks may break with packages or \LaTeX{} versions released after
+ 2023-07-07. There is no support for such combinations!
+\item Loading the legacy version more than once with different option setting
+ still results in option clash errors.
+\end{itemize}
+
+\paragraph{Available options with \pkg*{scrhack}:}
+\begin{description}
+\item[\opt{float=\meta{boolean}}:]
+ \DescribeOption[noprint]{float=\meta{boolean}}%
+ \hfill initial: \optvalue{true}, default: \optvalue{true}\\
+ After package \pkg{float} is loaded, load also package \pkg{floatbytocbasic}
+ to fix the issue explained in \autoref{sec:history}. This also provides the
+ full functionality of \pkg{tocbasic} to \pkg{float}.
+\item[\opt{floatrow=\meta{boolean}}:]
+ \DescribeOption[noprint]{floatrow=\meta{boolean}}%
+ \hfill initial: \optvalue{true}, default: \optvalue{true}\\
+ After package \pkg{floatrow} is loaded, load also package
+ \pkg{floatbytocbasic} to fix the issue explained in
+ \autoref{sec:history}. This also provides the full functionality of
+ \pkg{tocbasic} to \pkg{floatrow}.
+\item[\opt{hyperref=\meta{boolean}}:]
+ \DescribeOption[noprint]{hyperref=\meta{boolean}}%
+ \hfill
+ \marginline{\raisebox{\dimexpr\ht\strutbox-\height\relax}{\Huge\textcolor{red}{!}}}%
+ initial: \optvalue{false}, default: \optvalue{true}\\
+ Option \opt{hyperref} is deprecated. It is implemented for compatibility
+ reasons only. Using \opt{hyperref} without value or \opt{hyperref=true}
+ results in a warning. Using \opt{hyperref=false} results in an info only.
+\item[\opt{listings=\meta{boolean}}:]
+ \DescribeOption[noprint]{listings=\meta{boolean}}%
+ \hfill
+ \marginline{\raisebox{\dimexpr\ht\strutbox-\height\relax}{\Huge\textcolor{red}{!}}}%
+ initial: \optvalue{false}, default: \optvalue{true}\\
+ Option \opt{listings} is deprecated. It is implemented for compatibility
+ reasons only. Using \opt{listings} without value or \opt{listings=true}
+ results in a warning. Using \opt{listings=false} results in an info only.
+\item[\opt{lscape=\meta{boolean}}:]
+ \DescribeOption[noprint]{lscape=\meta{boolean}}%
+ \hfill initial: \optvalue{true}, default: \optvalue{true}\\
+ After package \pkg{lscape} is loaded, load also package
+ \pkg{lscapeenhanced} to fix an issue with detection of text height for
+ some packages like \pkg{scrlayer} and \pkg{showframe}.
+\item[\opt{nomencl=\meta{boolean}}:]
+ \DescribeOption[noprint]{nomencl=\meta{boolean}}%
+ \hfill
+ \marginline{\raisebox{\dimexpr\ht\strutbox-\height\relax}{\Huge\textcolor{red}{!}}}%
+ initial: \optvalue{false}, default: \optvalue{true}\\
+ Option \opt{nomencl} is deprecated. It is implemented for compatibility
+ reasons only. Using \opt{nomencl} without value or \opt{nomencl=true}
+ results in a warning. Using \opt{nomencl=false} results in an info only.
+\item[\opt{setspace=\meta{boolean}}:]
+ \DescribeOption[noprint]{setspace=\meta{boolean}}%
+ \hfill initial: \optvalue{true}, default: \optvalue{true}\\
+ After package \pkg{setspace} is loaded, load also package
+ \pkg{setspaceenhanced} with the same options plus options \opt{byselectfont}
+ and \opt{keepfontsize}.
+\item[\opt{standardsectioning=\meta{boolean}}:]
+ \DescribeOption[noprint]{standardsectioning=\meta{boolean}}%
+ \hfill initial: \optvalue{false}, default: \optvalue{true}\\
+ Load package \pkg{standardsectioning} to (re-)define the sectioning commands
+ using the code from the standard classes. If \pkg*{scrhack} is loaded
+ \emph{before} any class\footnote{This is detected heuristic by definition of
+ \cs{normalsize}. If \cs{normalsize} contains \cs{@latex@error} no class
+ has been loaded.} the definition is delayed until a class has been loaded.
+\end{description}
+
+\paragraph{Available options with the legacy version:}
+\begin{description}
+\item[\opt{float=\meta{boolean}}:] \hfill
+ initial: \optvalue{true}, default: \optvalue{true}\\
+ After package \pkg{float} is loaded, load \file{float.hak} to fix the issue
+ explained in \autoref{sec:history}. This also provides the full
+ functionality of \pkg{tocbasic} to \pkg{float}.
+\item[\opt{floatrow=\meta{boolean}}:] \hfill
+ initial: \optvalue{true}, default: \optvalue{true}\\
+ After package \pkg{floatrow} is loaded, load \file{floatrow.hak} to fix the
+ issue explained in \autoref{sec:history}. This also provides the full
+ functionality of \pkg{tocbasic} to \pkg{floatrow}.
+\item[\opt{hyperref=\meta{boolean}}:] \hfill
+ initial: \optvalue{true}, default: \optvalue{true}\\
+ Versions of \pkg{hyperref} before 6.79h set the link anchors after the
+ heading of the starred versions of commands like \cs{part*}, \cs{chapter*},
+ etc. instead of before them. Since then, this problem has been resolved at
+ the suggestion of \KOMAScript's author. But because the change took more
+ than a year, a patch was added to \pkg*{scrhack}. Although this can also be
+ deactivated with \opt{hyperref=false}, you should instead use an up-to-date
+ \pkg{hyperref} release. In this case the legacy version of \pkg*{scrhack}
+ automatically deactivates this unnecessary patch.
+\item[\opt{listings=\meta{boolean}}:] \hfill
+ initial: \optvalue{true}, default: \optvalue{true}\\
+ After package \pkg{listings} is loaded, load \file{listings.hak} to fix the
+ issue explained in \autoref{sec:history}. This also provides the full
+ functionality of \pkg{tocbasic} to old versions of \pkg{listings}. With
+ newer versions, also the legacy version of \pkg*{scrhack} automatically
+ deactivates this unnecessary patch.
+\item[\opt{lscape=\meta{boolean}}:] \hfill
+ initial: \optvalue{true}, default: \optvalue{true}\\
+ The \pkg{lscape} package defines a \env{landscape} environment to set the
+ page contents, but not the header or footer in landscape mode. Inside this
+ environment, \len{textheight}is set to the value of \len{textwidth}, but
+ \len{textwidth} is not set to the former value of \len{textheight}. This is
+ inconsistent. As far as I know, \len{textwidth} is left unchanged because
+ setting it to \len{textheight} could interfere with other packages or user
+ commands. But changing \len{textheight} also has this potential, and indeed
+ it breaks, for example, \pkg{showframe} and \pkg{scrlayer}. Thus it would be
+ best if \len{textheight} too remained unchanged. After package \pkg{lscape}
+ is loaded, the legacy version of \pkg*{scrhack} loads \file{lscape.hak},
+ that uses the \pkg{xpatch} package to modify the \env{landscape}
+ environment's start macro \cs{landscape} appropriately.
+
+ Incidentally, the \pkg{pdflscape} package also uses \pkg{lscape}, so this
+ option affects the functioning of this package too.
+\item[\opt{nomencl=\meta{boolean}}:] \hfill
+ initial: \optvalue{true}, default: \optvalue{true}\\
+ After package \pkg{nomencl} is loaded, load \file{nomencl.hak} to fix the
+ issue explained in \autoref{sec:history}. This is a little bit more
+ complicated, because the \pkg*{nomencl} author has also adapted his
+ package to support \pkg{tocbasic}. So additional versions checks are done.
+\item[\opt{setspace=\meta{boolean}}:] \hfill
+ initial: \optvalue{true}, default: \optvalue{true}\\
+ Some packages assume that the class-internal macro \cs{@ptsize} both is
+ defined and expands to an integer. For compatibility,
+ \href{https://komascript.de/}{\KOMAScript} defines \cs{@ptsize} even if the
+ basic font size is something other than 10\,pt, 11\,pt, or 12\,pt.
+ \href{https://komascript.de/}{\KOMAScript} also allows non-integer font
+ sizes. So \cs{@ptsize} can, of course, also expand to a non-integer number.
+
+ One of the packages that cannot cope with a non-integer \cs{@ptsize} is
+ \pkg{setspace}. Additionally, the values set by this package are always
+ dependent on the basic font size, even if the setting is made in the context
+ of another font size. The legacy version of \pkg{scrhack} loads the hack
+ \file{setspace.hak} after package \pkg{setspace} to solves both problems by
+ redefining \cs{onehalfspacing} and \cs{doublespacing} to set the spacing
+ relative to the actual font size.
+
+ \textbf{Note:} if you use \pkg{setspace} with either the
+ \opt{onehalfspacing} or \opt{doublespacing} option, you must load
+ \pkg*{scrhack} first.
+\item[\opt{standardsections=\meta{boolean}}] \hfill
+ initial: \optvalue{false}, default: \optvalue{true}\\
+ Various packages assume that the sectioning commands are defined in a
+ specific way, corresponding to the definitions in the standard classes. But
+ for some classes this is not the case. For example, the
+ \href{https://komascript.de/}{\KOMAScript} classes use a completely
+ different implementation to provide many additional features. But this can
+ cause problems for packages that depend on the definition of the standard
+ classes. The legacy version of \pkg*{scrhack} offers the option to force
+ the sectioning commands \cs{part}, \cs{chapter}, \cs{section},
+ \cs{subsection}, \cs{subsubsection}, \cs{paragraph}, and \cs{subparagraph}
+ to be compatible with those in the standard classes. When \cs{chapter} is
+ defined, the definitions are based on those in \cls{book}. When \cs{chapter}
+ is undefined, the definitions of \cls{article} are used.
+
+ If you are using a \href{https://komascript.de/}{\KOMAScript} class, several
+ features of these classes are also deactivated as side effect. For example,
+ the commands to define or modify sectioning commands or option
+ \opt{headings} are no longer available, and commands like \cs{partformat}
+ have different defaults.
+
+ Because this hack has the potential to do more harm than good, it issues
+ several warnings. Also it is not activated simply by loading the legacy
+ version of \pkg*{scrhack} package. If you want to use it, you must explicitly
+ activate this option when you load the package. Late activation or
+ deactivation is not supported.
+
+ Since there are often less invasive solutions to fix the problem of package
+ incompatibilities, using this hack is not recommended. It is provided only
+ as a last resort for emergencies.
+\end{description}
+%
+% \iffalse
+%</doc>
+% \fi
+%
+% \MaybeStop{\printbibliography[heading=bibintoc]\PrintIndex}
+%
+% \iffalse
+%<*package>
+%<@@=scrhack>
+% \fi
+% \section{Implementation}
+%
+% Because \pkg*{scrhack} is not longer a
+% \href{https://komascript.de/}{\KOMAScript} package, it does not use the
+% \texttt{KOMA} family for options any longer. Instead it uses the new
+% \LaTeX{} kernel feature of key-value-options introduced in
+% \autocite{latexnews35}. So we need at least \LaTeX{} 2022-06-01:
+% \begin{macrocode}
+\ifnum 0=\ifcsname IfFormatAtLeastTF\endcsname
+ \IfFormatAtLeastTF{2022-06-01}{1}{0}%
+ \else
+ 0%
+ \fi\relax
+ \PackageError{scrhack}{LaTeX kernel too old}{%
+ The package needs at least LaTeX 2022-06-01.\MessageBreak
+ This error is fatal. Loading will be aborted.%
+ }%
+ \endinput
+\fi
+\ExplSyntaxOn
+% \end{macrocode}
+%
+% \subsection{Messages}
+%
+% We need some messages, that are not specific for only one use-case.
+% \begin{itemize}
+% \item If an option is ignored, because it cannot be handled after already
+% loading the enhancement package. \#1 is the name option, \#2 is the
+% enhancement package.
+% \end{itemize}
+% \begin{macrocode}
+\msg_new:nnn { scrhack } { option-too-late }
+ {
+ option~`#1'~after~loading~package~`#2'~ignored.
+ }
+% \end{macrocode}
+% \begin{itemize}
+% \item If an option is ignored, because it is deprecated.
+% \end{itemize}
+% \begin{macrocode}
+\msg_new:nnn { scrhack } { deprecated-option }
+ {
+ deprecated~option~`#1'~ignored.
+ }
+% \end{macrocode}
+%
+% \subsection{Emulating \file{float.hak}}
+% First we declare the options using the new key-value interface:
+% \begin{macrocode}
+\DeclareKeys{%
+ float .code = \@@_switch_float:n { #1 },
+ float .default:n = true,
+ float .usage = preamble,
+}
+% \end{macrocode}
+%
+% \ExplSyntaxOn
+% \begin{macro}{\__scrhack_switch_float:n}
+% \ExplSyntaxOff
+% This is used to switch the state and add or remove the hook if needed. A new
+% boolean is used to know, whether the hook has been put. Using
+% \opt{float=true}, if package \pkg{floatbytocbasic} already has been loaded
+% isn't a foul. So we just write an information to the \file{log}. But using
+% \opt{float=false}, if package \pkg{floatbytocbasic} already has been loaded
+% may be wrong. So we use a warning message. We also warn if a not allowed
+% value is used.
+% \begin{macrocode}
+\bool_new:N \@@_float_bool
+
+\cs_new:Nn \@@_switch_float:n
+ {
+ \str_case_e:nnF { \str_foldcase:n { #1 } }
+ {
+ {true} {
+ \@ifpackageloaded { floatbytocbasic }
+ {
+ \msg_info:nnnn { scrhack } { option-too-late }
+ { float = true } { floatbytocbasic }
+ }
+ {
+ \bool_if:NF \@@_float_bool
+ {
+ \hook_gput_code:nnn { package/float/after } { scrhack }
+ {
+ \RequirePackage { floatbytocbasic }
+ }
+ \bool_gset_true:N \@@_float_bool
+ }
+ }
+ }
+ {false} {
+ \@ifpackageloaded { floatbytocbasic }
+ {
+ \msg_warning:nnnn { scrhack } { option-too-late }
+ { float=false } { floatbytocbasic }
+ }
+ {
+ \bool_if:NT \@@_float_bool
+ {
+ \hook_gremove_code:nn { package/float/after } { scrhack }
+ }
+ \bool_gset_false:N \@s@_float_bool
+ }
+ }
+ }
+ {
+ \msg_warning:nnn { keys } { boolean-values-only } { float }
+ }
+ }
+\SetKeys{float=true}
+% \end{macrocode}
+% \end{macro}
+% \ExplSyntaxOff
+%
+% \subsection{Emulating \file{floatrow.hak}}
+% First we declare the options using the new key-value interface:
+% \begin{macrocode}
+\DeclareKeys{%
+ floatrow .code = \@@_switch_floatrow:n { #1 },
+ floatrow .default:n = true,
+ floatrow .usage = preamble,
+}
+% \end{macrocode}
+%
+% \ExplSyntaxOn
+% \begin{macro}{\__scrhack_switch_floatrow:n}
+% \ExplSyntaxOff
+% This is used to switch the state and add or remove the hook if needed. A new
+% boolean is used to know, whether the hook has been put. Using
+% \opt{floatrow=true}, if package \pkg{floatrowbytocbasic} already has been
+% loaded isn't a foul. So we just write an information to the \file{log}. But
+% using \opt{floatrow=false}, if package \pkg{floatrowbytocbasic} already has
+% been loaded may be wrong. So we use a warning message. We also warn if a not
+% allowed value is used.
+% \begin{macrocode}
+\bool_new:N \@@_floatrow_bool
+
+\cs_new:Nn \@@_switch_floatrow:n
+ {
+ \str_case_e:nnF { \str_foldcase:n { #1 } }
+ {
+ {true} {
+ \@ifpackageloaded { floatrowbytocbasic }
+ {
+ \msg_info:nnnn { scrhack } { option-too-late }
+ { floatrow = true } { floatrowbytocbasic }
+ }
+ {
+ \bool_if:NF \@@_floatrow_bool
+ {
+ \hook_gput_code:nnn { package/floatrow/after }
+ { scrhack }
+ {
+ \RequirePackage { floatrowbytocbasic }
+ }
+ \bool_gset_true:N \@@_floatrow_bool
+ }
+ }
+ }
+ {false} {
+ \@ifpackageloaded { floatrowbytocbasic }
+ {
+ \msg_warning:nnnn { scrhack } { option-too-late }
+ { floatrow=false } { floatrowbytocbasic }
+ }
+ {
+ \bool_if:NT \@@_floatrow_bool
+ {
+ \hook_gremove_code:nn { package/floatrow/after }
+ { scrhack }
+ }
+ \bool_gset_false:N \@s@_floatrow_bool
+ }
+ }
+ }
+ {
+ \msg_warning:nnn { keys } { boolean-values-only } { floatrow }
+ }
+ }
+\SetKeys{floatrow=true}
+% \end{macrocode}
+% \end{macro}
+% \ExplSyntaxOff
+%
+% \subsection{Emulating \file{hyperref.hak}}
+%
+% First we declare the options using the new key-value interface:
+% \begin{macrocode}
+\DeclareKeys{%
+ hyperref .code = \@@_switch_hyperref:n { #1 },
+ hyperref .default:n = true,
+ hyperref .usage = preamble,
+}
+% \end{macrocode}
+%
+% \ExplSyntaxOn
+% \begin{macro}{\__scrhack_switch_hyperref:n}
+% \ExplSyntaxOff
+% This is somehow special, because the hack is deprecated. It only has been
+% needed for \pkg{hyperref} versions released before 2009-11-24, which would
+% not work with the \LaTeX{} kernel version needed by this version of
+% \pkg*{scrhack}. So emulating the hack does not make sense. Instead the
+% initial value of the option is changed to implicit \optvalue{false} and
+% switching it on explicitly does result in a warning.
+% \begin{macrocode}
+\cs_new:Nn \@@_switch_hyperref:n
+ {
+ \str_case_e:nnF { \str_foldcase:n { #1 } }
+ {
+ {true} {
+ \msg_warning:nnn { scrhack } { deprecated-option }
+ { hyperref=#1 }
+ }
+ {false} {
+ \msg_info:nnn { scrhack } { deprecated-option }
+ { hyperref=#1 }
+ }
+ }
+ {
+ \msg_warning:nnn { keys } { boolean-values-only } { hyperref }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \ExplSyntaxOff
+%
+% \subsection{Emulating \file{listings.hak}}
+% First we declare the options using the new key-value interface:
+% \begin{macrocode}
+\DeclareKeys{%
+ listings .code = \@@_switch_listings:n { #1 },
+ listings .default:n = true,
+ listings .usage = preamble,
+}
+% \end{macrocode}
+%
+% \ExplSyntaxOn
+% \begin{macro}{\__scrhack_switch_listings:n}
+% \ExplSyntaxOff
+% This is somehow special, because the hack is deprecated. It only has
+% been needed for \pkg{listings} version released before 2024-02-15. So
+% instead of using any patch hacks, users should update \pkg{listings}. So
+% emulating the hack does not make sense. Instead the initial value of the
+% option is changed to implicit \optvalue{false} and switching it on
+% explicitly does result in a warning.
+% \begin{macrocode}
+\cs_new:Nn \@@_switch_listings:n
+ {
+ \str_case_e:nnF { \str_foldcase:n { #1 } }
+ {
+ {true} {
+ \msg_warning:nnn { scrhack } { deprecated-option }
+ { listings=#1 }
+ }
+ {false} {
+ \msg_info:nnn { scrhack } { deprecated-option }
+ { listings=#1 }
+ }
+ }
+ {
+ \msg_warning:nnn { keys } { boolean-values-only } { listings }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \ExplSyntaxOff
+%
+% \subsection{Emulating \file{lscape.hak}}
+% First we declare the options using the new key-value interface:
+% \begin{macrocode}
+\DeclareKeys{%
+ lscape .code = \@@_switch_lscape:n { #1 },
+ lscape .default:n = true,
+ lscape .usage = preamble,
+}
+% \end{macrocode}
+%
+% \ExplSyntaxOn
+% \begin{macro}{\__scrhack_switch_lscape:n}
+% \ExplSyntaxOff
+% This is used to switch the state and add or remove the hook if needed. A new
+% boolean is used to know, whether the hook has been put. Using
+% \opt{lscape=true}, if package \pkg{lscapeenhanced} already has been
+% loaded isn't a foul. So we just write an information to the \file{log}. But
+% using \opt{lscape=false}, if package \pkg{lscapeenhanced} already has
+% been loaded may be wrong. So we use a warning message. We also warn if a not
+% allowed value is used.
+% \begin{macrocode}
+\bool_new:N \@@_lscape_bool
+
+\cs_new:Nn \@@_switch_lscape:n
+ {
+ \str_case_e:nnF { \str_foldcase:n { #1 } }
+ {
+ {true} {
+ \@ifpackageloaded { lscapeenhanced }
+ {
+ \msg_info:nnnn { scrhack } { option-too-late }
+ { lscape = true } { lscapeenhanced }
+ }
+ {
+ \bool_if:NF \@@_lscape_bool
+ {
+ \hook_gput_code:nnn { package/lscape/after }
+ { scrhack }
+ {
+ \RequirePackage { lscapeenhanced }
+ }
+ \bool_gset_true:N \@@_lscape_bool
+ }
+ }
+ }
+ {false} {
+ \@ifpackageloaded { lscapeenhanced }
+ {
+ \msg_warning:nnnn { scrhack } { option-too-late }
+ { lscape=false } { lscapeenhanced }
+ }
+ {
+ \bool_if:NT \@@_lscape_bool
+ {
+ \hook_gremove_code:nn { package/lscape/after }
+ { scrhack }
+ }
+ \bool_gset_false:N \@s@_lscape_bool
+ }
+ }
+ }
+ {
+ \msg_warning:nnn { keys } { boolean-values-only } { lscape }
+ }
+ }
+\SetKeys{lscape=true}
+% \end{macrocode}
+% \end{macro}
+% \ExplSyntaxOff
+%
+% \subsection{Emulating \file{nomencl.hak}}
+%
+% First we declare the options using the new key-value interface:
+% \begin{macrocode}
+\DeclareKeys{%
+ nomencl .code = \@@_switch_nomencl:n { #1 },
+ nomencl .default:n = true,
+ nomencl .usage = preamble,
+}
+% \end{macrocode}
+%
+% \ExplSyntaxOn
+% \begin{macro}{\__scrhack_switch_nomencl:n}
+% \ExplSyntaxOff
+% This is somehow special, because the hack is deprecated. It only has been
+% needed for \pkg{nomencl} versions released before 2019-01-23. So updating
+% the package would be the better \emph{hack}. So emulating the hack does not
+% make sense. Instead the initial value of the option is changed to implicit
+% \optvalue{false} and switching it on explicitly does result in a warning.
+% \begin{macrocode}
+\cs_new:Nn \@@_switch_nomencl:n
+ {
+ \str_case_e:nnF { \str_foldcase:n { #1 } }
+ {
+ {true} {
+ \msg_warning:nnn { scrhack } { deprecated-option }
+ { nomencl=#1 }
+ }
+ {false} {
+ \msg_info:nnn { scrhack } { deprecated-option }
+ { nomencl=#1 }
+ }
+ }
+ {
+ \msg_warning:nnn { keys } { boolean-values-only } { nomencl }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \ExplSyntaxOff
+%
+%
+% \subsection{Emulating \file{setspace.hak}}
+% First we declare the options using the new key-value interface:
+% \begin{macrocode}
+\DeclareKeys{%
+ setspace .code = \@@_switch_setspace:n { #1 },
+ setspace .default:n = true,
+ setspace .usage = preamble,
+}
+% \end{macrocode}
+%
+% \ExplSyntaxOn
+% \begin{macro}{\__scrhack_switch_setspace:n}
+% \ExplSyntaxOff
+% This is used to switch the state and add or remove the hook if needed. A new
+% boolean is used to know, whether the hook has been put. Using
+% \opt{setspace=true}, if package \pkg{setspaceenhanced} already has been loaded
+% isn't a foul. So we just write an information to the \file{log}. But using
+% \opt{setspace=false}, if package \pkg{setspaceenhanced} already has been loaded
+% may be wrong. So we use a warning message. We also warn if a not allowed
+% value is used.
+% \begin{macrocode}
+\bool_new:N \@@_setspace_bool
+
+\cs_new:Nn \@@_switch_setspace:n
+ {
+ \str_case_e:nnF { \str_foldcase:n { #1 } }
+ {
+ {true} {
+ \@ifpackageloaded { setspaceenhanced }
+ {
+ \msg_info:nnnn { scrhack } { option-too-late }
+ { setspace = true } { setspaceenhanced }
+ }
+ {
+ \bool_if:NF \@@_setspace_bool
+ {
+ \hook_gput_code:nnn { package/setspace/after } { scrhack }
+ {
+ \exp_last_unbraced:Ne \RequirePackage
+ {
+ [ \use:c { @raw@opt@setspace.sty },
+ byselectfont,
+ keepfontsize ]
+ }
+ { setspaceenhanced }
+ }
+ \bool_gset_true:N \@@_setspace_bool
+ }
+ }
+ }
+ {false} {
+ \@ifpackageloaded { setspaceenhanced }
+ {
+ \msg_warning:nnnn { scrhack } { option-too-late }
+ { setspace=false } { setspaceenhanced }
+ }
+ {
+ \bool_if:NT \@@_setspace_bool
+ {
+ \hook_gremove_code:nn { package/setspace/after } { scrhack }
+ }
+ \bool_gset_false:N \@s@_setspace_bool
+ }
+ }
+ }
+ {
+ \msg_warning:nnn { keys } { boolean-values-only } { setspace }
+ }
+ }
+\SetKeys{setspace=true}
+% \end{macrocode}
+% \end{macro}
+% \ExplSyntaxOff
+%
+% \subsection{Emulating \file{standardsectioning.hak}}
+% First we declare the options using the new key-value interface:
+% \begin{macrocode}
+\DeclareKeys{%
+ standardsections .code = \@@_switch_standardsectioning:n { #1 },
+ standardsections .default:n = true,
+ standardsections .usage = preamble,
+}
+% \end{macrocode}
+%
+% \ExplSyntaxOn
+% \begin{macro}{\__scrhack_switch_standardsectioning:n}
+% \ExplSyntaxOff
+% This is used to switch the state and add or remove the hook if needed. A new
+% boolean is used to know, whether the hook has been put. Using
+% \opt{standardsectioning=true}, if package \pkg{standardsectioning}
+% already has been loaded isn't a foul. So we just write an information to the
+% \file{log}. But using \opt{standardsectioning=false}, if package
+% \pkg{standardsectioning} already has been loaded may be wrong. So
+% we use a warning message. We also warn if a not allowed value is used.
+% \begin{macrocode}
+\bool_new:N \@@_standardsectioning_bool
+
+\cs_new:Nn \@@_switch_standardsectioning:n
+ {
+ \str_case_e:nnF { \str_foldcase:n { #1 } }
+ {
+ {true} {
+ \@ifpackageloaded { standardsectioning }
+ {
+ \msg_info:nnnn { scrhack } { option-too-late }
+ { standardsectioning = true } { standardsectioning }
+ }
+ {
+ \bool_if:NF \@@_standardsectioning_bool
+ {
+ \str_set:Nx \l_tmpa_str { \cs_meaning:N \normalsize }
+ \str_if_in:NnTF
+ \l_tmpa_str
+ { \@latex@error }
+ {
+ \hook_gput_code:nnn { class/after } { scrhack }
+ {
+ \RequirePackage { standardsectioning }
+ \exp_args:Nnnx \hook_gput_code:nnn
+ { begindocument/before } { scrhack }
+ {
+ \exp_not:N \cs_gset:Npn
+ \exp_after:wN \exp_not:N
+ \cs:w ver@standardsectioning.sty \cs_end:
+ {
+ \cs:w ver@standardsectioning.sty \cs_end:
+ }
+ }
+ \cs_undefine:c { var@standardsectioning.sty }
+ }
+ \bool_gset_true:N \@@_standardsectioning_bool
+ }
+ {
+ \RequirePackage{ standardsectioning }
+ \bool_gset_false:N \@@_standardsectioning_bool
+ }
+ }
+ }
+ }
+ {false} {
+ \@ifpackageloaded { standardsectioning }
+ {
+ \msg_warning:nnnn { scrhack } { option-too-late }
+ { standardsectioning=false } { standardsectioning }
+ }
+ {
+ \bool_if:NT \@@_standardsectioning_bool
+ {
+ \hook_gremove_code:nn { class/after } { scrhack }
+ }
+ \bool_gset_false:N \@s@_standardsectioning_bool
+ }
+ }
+ }
+ {
+ \msg_warning:nnn { keys } { boolean-values-only } { standardsectioning }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \ExplSyntaxOff
+%
+%
+%
+% \subsection{Processing the options}
+% Last but not least, we set the defaults and process the options.
+% \begin{macrocode}
+\ExplSyntaxOff
+\ProcessKeyOptions\relax
+% \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \Finale
+% \PrintChanges
+%
+% \endinput
+% Local Variables:
+% mode: doctex
+% ispell-local-dictionary: "en_US"
+% eval: (flyspell-mode 1)
+% TeX-master: t
+% eval: (setcar (or (cl-member "Index" (setq-local TeX-command-list (copy-alist TeX-command-list)) :key #'car :test #'string-equal) (setq-local TeX-command-list (cons nil TeX-command-list))) '("Index" "mkindex %s" TeX-run-index nil t :help "makeindex for dtx"))
+% End:
diff --git a/Master/texmf-dist/source/latex/se2thesis/se2colors.dtx b/Master/texmf-dist/source/latex/se2thesis/se2colors.dtx
index dd4b9da06cb..20985382c8e 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-09-19} {4.3.4}
{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..728998f60b1 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-09-19} {4.3.4}
{A font-selection support package for the se2thesis bundle}
% \end{macrocode}
%
@@ -214,6 +214,12 @@
%
% \subsection{Font loading}
%
+% Load the \pkg{mismath} package, which itself loads \pkg{mathtools} and
+% transitively \pkg{amsmath} \emph{before} \pkg{unicode-math}.
+% \begin{macrocode}
+\RequirePackage{mismath}
+% \end{macrocode}
+%
% Depending on the engine used by the user,
% we can use \pkg{fontspec} for loading fonts.
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex/se2thesis/se2packages.dtx b/Master/texmf-dist/source/latex/se2thesis/se2packages.dtx
index 8d3baeed708..f71e5891807 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-09-19} {4.3.4}
{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..6129c3e6d65 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-09-19} {4.3.4}
{A thesis class for the Chair of Software Engineering II}
% \end{macrocode}
%
@@ -1124,10 +1171,9 @@
\DeclareNewLayer[
mode=picture,
foreground,
- align=tr,
- hoffset=\oddsidemargin+1.5in+\textwidth,
+ hoffset=\paperwidth-\coverpagerightmargin-\box_wd:N \l_@@_logo_box,
voffset=\coverpagetopmargin+1.5in+\ht\strutbox,
- width=\textwidth - \box_wd:N \l_@@_logo_box,
+ width=\box_wd:N \l_@@_logo_box,
height=\box_ht:N \l_@@_logo_box,
contents={\putUL{\box_use:N \l_@@_logo_box}},
]{title.seii.logo}
@@ -1246,7 +1292,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 +1329,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 +1337,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 +1408,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 +1730,7 @@
% We provide the following English translations.
%
% \begin{macrocode}
-\ProvideDictionaryFor{English}{se2translations}[2024/06/07]
+\ProvideDictionaryFor{English}{se2translations}[2024/09/19]
\ProvideDictTranslation{abstract}{abstract}
\ProvideDictTranslation{Abstract}{Abstract}
\ProvideDictTranslation{acknowledgement}{acknowledgement}
@@ -1703,10 +1755,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 +1781,7 @@
% We provide the following German translations.
%
% \begin{macrocode}
-\ProvideDictionaryFor{German}{se2translations}[2024/06/07]
+\ProvideDictionaryFor{German}{se2translations}[2024/09/19]
\ProvideDictTranslation{abstract}{Zusammenfassung}
\ProvideDictTranslation{Abstract}{Zusammenfassung}
\ProvideDictTranslation{acknowledgement}{Danksagung}
diff --git a/Master/texmf-dist/source/latex/sidenotes/sidenotes.dtx b/Master/texmf-dist/source/latex/sidenotes/sidenotes.dtx
index 7c67ad4fd19..709a8a5e32e 100644
--- a/Master/texmf-dist/source/latex/sidenotes/sidenotes.dtx
+++ b/Master/texmf-dist/source/latex/sidenotes/sidenotes.dtx
@@ -2,7 +2,7 @@
%
% sidenotes.dtx
%
-% Copyright (C) 2011-2020 by Andy Thomas <andythomas(at)web.de>
+% Copyright (C) 2011-2024 by Andy Thomas <andythomas(at)web.de>
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -11,17 +11,17 @@
% 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.
-%
+%
% The author of this work is Andy Thomas
%
%<*driver>
-\ProvidesFile{sidenotes.dtx}[2016/04/21 v1.00 rich text in the margin for LaTeX]%
+\ProvidesFile{sidenotes.dtx}[2024/09/12 v1.20 Rich text in the margin for LaTeX]%
%</driver>
%<package>\RequirePackage{l3keys2e}%
-%<package>\ProvidesExplPackage{sidenotes}{2016/04/21}{1.00}{rich text in the margin for LaTeX}
-%<package>\RequirePackage{marginnote} % provides an offset option for the marginals instead of a float
-%<package>\RequirePackage{caption} % handles the captions (in the margin)
-%<package>\RequirePackage{xparse} % new LaTeX3 syntax to define macros and environments
+%<package>\ProvidesExplPackage{sidenotes}{2024/09/12}{1.20}{Rich text in the margin for LaTeX}
+%<package>\RequirePackage{marginnote} % Provides an offset option for the marginals instead of a float
+%<package>\RequirePackage{caption} % Handles the captions (in the margin)
+%<package>\RequirePackage{xparse} % New LaTeX3 syntax to define macros and environments
%<package>\RequirePackage[strict]{changepage} % Changepage package for symmetric twoside handling
%<*driver>
\documentclass{ltxdoc}
@@ -54,10 +54,10 @@
%
%
% \GetFileInfo{sidenotes.dtx}
-%
+%
%
% \title{The \textsf{sidenotes} package\thanks{This document
-% corresponds to \textsf{sidenotes}~\fileversion, dated \filedate.
+% corresponds to \textsf{sidenotes}~\fileversion, dated \filedate.
% Earlier versions by Oliver Schebaum.}}
% \author{Andy Thomas\\ \texttt{andythomas(at)web.de}}
%
@@ -74,9 +74,9 @@
% \changes{v1.00}{2016/04/21}{no changes, tag v1.0}
%
% \begin{abstract}
-% \noindent This package allows the typesetting of rich content in the margin.
+% \noindent This package allows the typesetting of rich content in the margin.
% It includes text, but also figures, captions, tables and citations,
-% which is common in science textbooks such as Feynman's
+% which is common in science textbooks such as Feynman's
% \textit{Lectures on Physics}.
% \end{abstract}
%
@@ -91,99 +91,99 @@
% \DescribeMacro{\sidenote}
% The macro is very similar to the footnote macro and tries to emulate
% its behavior. It just puts the notes in the margin instead of the bottom
-% of the page, therefore the name \emph{sidenote}. It has the same parameters
+% of the page, therefore the name \emph{sidenote}. It has the same parameters
% as footnote as well as an additional offset:
-% \verb+\sidenote[number][offset]{text}+. All the sidenotes are subsequently
-% numbered and float in the margin to avoid overlap.
+% \verb+\sidenote[number][offset]{text}+. All the sidenotes are subsequently
+% numbered and float in the margin to avoid overlap.
% The first, optional parameter will manually change the numbering to the given
-% value. The second offset parameter will fix the text at a certain position
-% in the margin. In particular, there is a difference between not providing an
+% value. The second offset parameter will fix the text at a certain position
+% in the margin. In particular, there is a difference between not providing an
% offset (floating text) and an offset of 0 (fix text at actual position).
%
-% \DescribeMacro{\sidenotemark}
-% Sidenote tries to mimic the footnote behavior and, consequently, provides the
-% same solutions. Sometimes, it is not possible to directly call a sidenote
-% macro, e.g.\ inside of a figure caption. Then, you can use
-% \verb+\sidenotemark[number]+ and \verb+\sidenotetext[number][offset]{text}+
-% macros. \verb+\sidenotemark+ puts a mark at the current position. Afterwards,
-% outside of the environment that causes the trouble,
+% \DescribeMacro{\sidenotemark}
+% Sidenote tries to mimic the footnote behavior and, consequently, provides the
+% same solutions. Sometimes, it is not possible to directly call a sidenote
+% macro, e.g.\ inside of a figure caption. Then, you can use
+% \verb+\sidenotemark[number]+ and \verb+\sidenotetext[number][offset]{text}+
+% macros. \verb+\sidenotemark+ puts a mark at the current position. Afterwards,
+% outside of the environment that causes the trouble,
% \DescribeMacro{\sidenotetext}
-% it is possible the call \verb+\sidenotetext[number][offset]{text}+ to provide
-% the text and typeset the sidenote. The optional parameters are similar to the
-% sidenote macro. The first, optional parameter will change the numbering and
+% it is possible the call \verb+\sidenotetext[number][offset]{text}+ to provide
+% the text and typeset the sidenote. The optional parameters are similar to the
+% sidenote macro. The first, optional parameter will change the numbering and
% the offset will change the position.
%
% \changes{v0.61}{2011/10/17}{documentation of sidetext}
%
%\DescribeMacro{\sidecaption}
-% The \verb+\sidecaption[entry][offset]{text}+ macro can be used if the caption
-% of a figure or table should be in the margin. The caption has to be adjacent
-% to the figure, so a float is not an option here. Therefore, the caption might
+% The \verb+\sidecaption[entry][offset]{text}+ macro can be used if the caption
+% of a figure or table should be in the margin. The caption has to be adjacent
+% to the figure, so a float is not an option here. Therefore, the caption might
% overlap with other marginals. Then, these marginals have to be adjusted with
% offset parameters. The formatting of the caption is done by the \emph{caption}
-% package by defining a \emph{sidecaption} style. Please refer to the
+% package by defining a \emph{sidecaption} style. Please refer to the
% documentation of the caption package for information on styles. The macro can
-% be starred, which is analog to the regular starred caption (no numbering, no
+% be starred, which is analog to the regular starred caption (no numbering, no
% tof entry): \verb+\sidecaption*[offset]{text}+.
%
% \DescribeEnv{marginfigure}
-% The marginfigure environment puts a figure and its caption in the margin.
-% Instead of \verb+\begin{figure}[htbp]+ use \verb+\begin{marginfigure}[offset]+.
-% Again, using an offset value switches the behavior from float to fixed
-% position. The marginfigure has its own caption style named \emph{marginfigure}.
+% The marginfigure environment puts a figure and its caption in the margin.
+% Instead of \verb+\begin{figure}[htbp]+ use \verb+\begin{marginfigure}[offset]+.
+% Again, using an offset value switches the behavior from float to fixed
+% position. The marginfigure has its own caption style named \emph{marginfigure}.
%
% \DescribeEnv{margintable}
-% The margintable environment works similar to marginfigure, but with table
-% environments. Use \verb+\begin{margintable}[offset]+ instead of
+% The margintable environment works similar to marginfigure, but with table
+% environments. Use \verb+\begin{margintable}[offset]+ instead of
% \verb+\begin{table}[htbp]+, its caption style is named \emph{margintable}.
%
% \DescribeEnv{figure*}
-% The \verb+figure*+ environment is used to position figures across the full
+% The \verb+figure*+ environment is used to position figures across the full
% page, i.e. the text width plus the margin. The algorithm has to distinguish
% between recto and verso (left and right) pages and might need up to three
% \LaTeX{} runs to provide the desired result. The corresponding caption style
-% is called \emph{widefigure}.
+% is called \emph{widefigure}.
% \DescribeEnv{table*}
-% The sister environment for tables is \verb+table*+. Use \emph{widetable} to
-% change its caption style.
+% The sister environment for tables is \verb+table*+. Use \emph{widetable} to
+% change its caption style.
%
% \section{Technical note}
%
-% When writing the package, we tried to provide a \emph{minimum} extension to
+% When writing the package, we tried to provide a \emph{minimum} extension to
% standard \LaTeX{} for typesetting rich content in the margin. This means,
% that there are no sensible default values for most things such as page
-% geometry, fonts and font sizes. However, the \emph{caesar\textunderscore
-% book}-class accompanies this package as an example implementation as well
-% as a template we use for our theses.
-%
-% In addition, we tried to keep compatibility with
-% packages the user might want to use later. However, the following packages
-% are needed by \emph{sidenotes} and might introduce side effects with other
+% geometry, fonts and font sizes. However, the \emph{caesar\textunderscore
+% book}-class accompanies this package as an example implementation as well
+% as a template we use for our theses.
+%
+% In addition, we tried to keep compatibility with
+% packages the user might want to use later. However, the following packages
+% are needed by \emph{sidenotes} and might introduce side effects with other
% packages.
%
% \section{Required packages}
-%
+%
% \changes{v0.52}{2011/10/06}{added a section that the package needs marginnote, caption and xifthen.}
% \changes{v0.90}{2012/06/02}{added a section that the package needs twoopt and changepage.}
-% \changes{v0.94}{2014/01/22}{start using xparse}
-% \changes{v0.97}{2014/06/05}{start using l3keys2e}
+% \changes{v0.94}{2014/01/22}{start using xparse}
+% \changes{v0.97}{2014/06/05}{start using l3keys2e}
%
% \begin{description}
% \item[marginnote]
-% supports an alternative to \verb+\marginpar+ and creates notes in the
-% margin. The notes are not floats and can be shifted up or down.
-% Technically, every time an offset is provided the package uses
+% supports an alternative to \verb+\marginpar+ and creates notes in the
+% margin. The notes are not floats and can be shifted up or down.
+% Technically, every time an offset is provided the package uses
% \verb+\marginnote+ and \verb+\marginpar+ otherwise.
% \item[caption]
-% allows to set figure and table captions in the margin and allows
-% easier formatting of these captions. Please refer to the
-% \emph{caption} manual for details on styles.
+% allows to set figure and table captions in the margin and allows
+% easier formatting of these captions. Please refer to the
+% \emph{caption} manual for details on styles.
% \item[xparse] is used to take advantage of the improved \LaTeX3 syntax.
% All macros and environments are defined using this package.
-% \item[l3keys2e] provides a key/value mechanism
-% \item[changepage] is used to correctly shift figure* and table*. It has
-% to use the option [strict] to work properly. This might lead to an
-% option clash, if the same package is loaded without this option.
+% \item[l3keys2e] provides a key/value mechanism
+% \item[changepage] is used to correctly shift figure* and table*. It has
+% to use the option [strict] to work properly. This might lead to an
+% option clash, if the same package is loaded without this option.
% \end{description}%
%
% \section{Implementation}
@@ -192,39 +192,41 @@
%<*package>
% \fi
%
-% Process the package options: onside
+% Process the package options: onside
%
% \begin{macrocode}
-\ExplSyntaxOn
+\ExplSyntaxOn
%
\keys_define:nn { sidenotes }
{
- oneside .bool_set:N = \sidenotes_oneside
+ oneside .bool_set:N = \sidenotes_oneside
}
\ProcessKeysOptions { sidenotes }
% \end{macrocode}
%
% \changes{v0.91}{2012/06/03}{sidenotetextstyle is not needed any more}
-% \changes{v0.94}{2014/01/22}{change sidenote counter behavior}
+% \changes{v0.94}{2014/01/22}{change sidenote counter behavior}
%
% We need a counter similar to the footnote counter.
%
% \begin{macrocode}
-\newcounter{sidenote} % make a counter
-\setcounter{sidenote}{1} % init the counter
+\newcounter{sidenote} % make a counter
+\setcounter{sidenote}{1} % init the counter
% \end{macrocode}
-%
-% \noindent The \LaTeX3 parts concerning the optional arguments should not
-% distinguish between an empty bracket pair and no optional
-% argument. This is required to keep macros with two leading
+%
+% \noindent The \LaTeX3 parts concerning the optional arguments should not
+% distinguish between an empty bracket pair and no optional
+% argument. This is required to keep macros with two leading
% optional arguments.
%
+% \changes{v1.20}{2024/09/12}{Allow long arguments.}
+%
% \begin{macrocode}
-\DeclareExpandableDocumentCommand{\IfNoValueOrEmptyTF}{ m m m }
+\DeclareExpandableDocumentCommand{\IfNoValueOrEmptyTF}{ m +m +m }
{
\IfNoValueTF{#1}
- {#2}
- {\tl_if_empty:nTF {#1} {#2} {#3}}
+ {#2}
+ {\tl_if_empty:nTF {#1} {#2} {#3}}
}
% \end{macrocode}
%
@@ -237,28 +239,28 @@
% \begin{macrocode}
\NewDocumentCommand \@sidenotes@thesidenotemark { m }
{
- \leavevmode
- \ifhmode
+ \leavevmode
+ \ifhmode
\edef \@x@sf {\the \spacefactor }
- \nobreak
- \fi
- \hbox {\@textsuperscript {\normalfont #1 }}
- \ifhmode
- \spacefactor \@x@sf
- \fi
+ \nobreak
+ \fi
+ \hbox {\@textsuperscript {\normalfont #1 }}
+ \ifhmode
+ \spacefactor \@x@sf
+ \fi
\relax
}
%
\NewDocumentCommand \@sidenotes@multisign { } {3sp}
%
-\NewDocumentCommand \@sidenotes@multimarker { }
+\NewDocumentCommand \@sidenotes@multimarker { }
{
\kern-\@sidenotes@multisign
- \kern\@sidenotes@multisign\relax
+ \kern\@sidenotes@multisign\relax
}
%
-\NewDocumentCommand \@sidenotes@multichecker { }
-{
+\NewDocumentCommand \@sidenotes@multichecker { }
+{
\dim_compare:nNnTF \lastkern = \@sidenotes@multisign
{\@sidenotes@thesidenotemark{,}}
{}
@@ -269,33 +271,35 @@
% \changes{v0.97}{2014/05/27}{introduce an internal macro to place the marginal text}
%
% \noindent Introduce an internal macro to place the marginal text. Use
-% margin note in case an offset is given and marginpar otherwise.
+% margin note in case an offset is given and marginpar otherwise.
+%
+% \changes{v1.20}{2024/09/12}{Allow long arguments.}
%
% \begin{macrocode}
-\NewDocumentCommand \@sidenotes@placemarginal { m m }
-{
+\NewDocumentCommand \@sidenotes@placemarginal { +m +m }
+{
\IfNoValueOrEmptyTF{#1}
- {\marginpar{#2}}
- {\marginnote{#2}[#1]}
+ {\marginpar{#2}}
+ {\marginnote{#2}[#1]}
}
%
% \end{macrocode}
%
% \begin{macro}{\sidenote}
-%
-% Introduce the \verb+\sidenote+ macro with two optional
+%
+% Introduce the \verb+\sidenote+ macro with two optional
% arguments to set the number and the offset.
%
% \changes{v0.53}{2011/10/07}{bugfix, now optional number and offset possible}
% \changes{v0.80}{2011/11/10}{unstar the newcommand.}
-% \changes{v0.81}{2011/11/29}{added a comma between subsequent sidenotes}
-% \changes{v0.90}{2012/06/02}{add optional offset for sidenote}
+% \changes{v0.81}{2011/11/29}{added a comma between subsequent sidenotes}
+% \changes{v0.90}{2012/06/02}{add optional offset for sidenote}
% \changes{v0.93}{2012/04/17}{removed mandatory whitespace, new ifnextchar takes care of that}
% \changes{v0.94}{2014/01/11}{use xparse syntax}
%
% \begin{macrocode}
-\NewDocumentCommand \sidenote { o o +m }
-{
+\NewDocumentCommand \sidenote { o o +m }
+{
\sidenotemark[#1]
\sidenotetext[#1][#2]{#3}
\@sidenotes@multimarker
@@ -311,8 +315,8 @@
% \changes{v0.96}{2014/02/14}{increase the sidenote counter in sidenotetext now}
%
% \begin{macrocode}
-\NewDocumentCommand \sidenotemark { o }
-{
+\NewDocumentCommand \sidenotemark { o }
+{
\@sidenotes@multichecker
\IfNoValueOrEmptyTF{#1}
{\@sidenotes@thesidenotemark{\thesidenote}}
@@ -324,7 +328,7 @@
%
% \begin{macro}{\sidenotetext}
%
-% Sidenotetext is supposed to work similarly to footnotetext. The additional,
+% Sidenotetext is supposed to work similarly to footnotetext. The additional,
% optional argument sets the offset.
%
% \changes{v0.80}{2011/11/10}{unstar the newcommand.}
@@ -333,10 +337,10 @@
% \changes{v0.94}{2014/01/11}{use xparse syntax, change counter behavior}
%
% \begin{macrocode}
-\NewDocumentCommand \sidenotetext { o o +m }
-{
+\NewDocumentCommand \sidenotetext { o o +m }
+{
\IfNoValueOrEmptyTF{#1}
- {
+ {
\@sidenotes@placemarginal{#2}{\textsuperscript{\thesidenote}{}~#3}
\refstepcounter{sidenote}
}
@@ -348,18 +352,18 @@
% \begin{macro}{\sidecaption}
%
% \changes{v0.91}{2012/06/03}{sidecaption* accompanies sidecaption}
-% \changes{v0.94}{2014/01/22}{use xparse syntax}
+% \changes{v0.94}{2014/01/22}{use xparse syntax}
%
-% Sidecaption puts the caption in the margin. It never floats with the other
+% Sidecaption puts the caption in the margin. It never floats with the other
% text in the margin, since it has to be next to the figure.
% Sidecaption* works similarly to sidecaption, but without an entry.
%
% \begin{macrocode}
\DeclareCaptionStyle{sidecaption}{font=footnotesize}
-\NewDocumentCommand \sidecaption {s o o m}
-{
+\NewDocumentCommand \sidecaption {s o o m}
+{
\captionsetup{style=sidecaption}
- \IfBooleanTF{#1}
+ \IfBooleanTF{#1}
{ % starred
\IfNoValueOrEmptyTF{#2}
{\marginnote{\caption*{#4}}}
@@ -381,15 +385,15 @@
%
% \changes{v0.3}{2011/09/29}{define the sidefigure enviroment without the environ package}
% \changes{v0.90}{2012/06/02}{the optional offset parameter is back, renamed environment from sidefigure to marginfigure}
-% \changes{v0.94}{2014/01/22}{use xparse syntax}
+% \changes{v0.94}{2014/01/22}{use xparse syntax}
%
-% The marginfigure environment is similar to the figure environment. But the
+% The marginfigure environment is similar to the figure environment. But the
% figure is put in the margin.
%
% \begin{macrocode}
\newsavebox{\@sidenotes@marginfigurebox}
\DeclareCaptionStyle{marginfigure}{font=footnotesize}
-\NewDocumentEnvironment{marginfigure} { o }
+\NewDocumentEnvironment{marginfigure} { o }
{
\begin{lrbox}{\@sidenotes@marginfigurebox}
\begin{minipage}{\marginparwidth}
@@ -407,9 +411,9 @@
%
% \changes{v0.4}{2011/09/30}{define the sidetable enviroment without the environ package}
% \changes{v0.90}{2012/06/02}{the optional offset parameter is back, renamed environment from sidetable to margintable}
-% \changes{v0.94}{2014/01/22}{use xparse syntax}
+% \changes{v0.94}{2014/01/22}{use xparse syntax}
%
-% The margintable is similar to the table environment. But the table
+% The margintable is similar to the table environment. But the table
% is put in the margin.
%
% \begin{macrocode}
@@ -433,11 +437,12 @@
%
% \changes{v0.85}{2011/06/01}{added the figure* environment}
% \changes{v0.97}{2014/05/27}{use adjustwidth in figure* environment}
+% \changes{v1.10}{2020/04/05}{address issue with figures across the full width}
%
-% The figure* environment provides a figure environment for figures that
+% The figure* environment provides a figure environment for figures that
% span across the full page (text plus margin width).
%
-% \begin{macrocode}
+% \begin{macrocode}
\AtBeginDocument{%
\newlength{\@sidenotes@extrawidth}
\setlength{\@sidenotes@extrawidth}{\marginparwidth}
@@ -468,9 +473,11 @@
{
\begin{figure}[#1]
\begin{autoadjustwidth}{}{-\@sidenotes@extrawidth}
+ \begin{minipage}{\linewidth}
\captionsetup{style=widefigure}
}
{
+ \end{minipage}
\end{autoadjustwidth}
\end{figure}
}
@@ -481,19 +488,22 @@
%
% \changes{v0.85}{2011/06/01}{added the table* environment}
% \changes{v0.97}{2014/05/27}{use adjustwidth in table* environment}
+% \changes{v1.10}{2020/04/05}{address issue with tables across the full width}
%
-% The table* environment provides a table environment for figures across
+% The table* environment provides a table environment for figures across
% text and margin width.
%
-% \begin{macrocode}
+% \begin{macrocode}
\DeclareCaptionStyle{widetable}{font=footnotesize}
\RenewDocumentEnvironment{table*}{ O{htbp} }
{
\begin{table}[#1]
\begin{autoadjustwidth}{}{-\@sidenotes@extrawidth}
+ \begin{minipage}{\linewidth}
\captionsetup{style=widetable}
}
{
+ \end{minipage}
\end{autoadjustwidth}
\end{table}
}
diff --git a/Master/texmf-dist/source/latex/sidenotes/sidenotes.ins b/Master/texmf-dist/source/latex/sidenotes/sidenotes.ins
index d6b5ebd8a86..7a21aa0515d 100644
--- a/Master/texmf-dist/source/latex/sidenotes/sidenotes.ins
+++ b/Master/texmf-dist/source/latex/sidenotes/sidenotes.ins
@@ -8,7 +8,7 @@
%% 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.
-%%
+%%
%% The author of this work is Andy Thomas
%%
@@ -21,7 +21,7 @@
IMPORTANT NOTE:
-This is a generated file and you are not allowed to distribute it
+This is a generated file and you are not allowed to distribute it
without the source of the work. See below about more informations
about the files the work consists of.
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-compound.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-compound.dtx
index ec5a6805167..6bca9a8417e 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx-compound.dtx
+++ b/Master/texmf-dist/source/latex/siunitx/siunitx-compound.dtx
@@ -871,7 +871,6 @@
}
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% \begin{macro}{\@@_print:N}
% \begin{macro}{\@@_print:nnN, \@@_print:nVN, \@@_print:enN, \@@_print:eeN}
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
index 2b875143759..0cc22455590 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
@@ -4751,6 +4757,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \subsection{Miscellaneous tools}
%
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-unit.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx
index 7faf5740da4..6c440b8fd64 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx
+++ b/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx
@@ -2997,7 +2997,10 @@
\str_if_eq:eeT
{ \exp_not:o { \familydefault } }
{ \exp_not:n { \sfdefault } }
- { \keys_set:nn { siunitx } { unit-font-command = \mathsf } }
+ {
+ \tl_if_eq:VnT \l_siunitx_unit_font_tl { \mathrm }
+ { \keys_set:nn { siunitx } { unit-font-command = \mathsf } }
+ }
}
{ }
}
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
index ca2b7822aa8..11bce0caf98 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-09-30} {3.3.22}
{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..564abba5a2c 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
%
@@ -21,7 +20,6 @@
% This work consists of the files spelatex.dtx, spelatex.ins,
% and any derivative file, generated from the dtx file using
% the ins driver file.
-%
% \fi
%
% \iffalse
@@ -34,17 +32,20 @@
\ProvidesFile{spelatex.dtx}
%</driver>
%<*package>
- [2024/06/12 v0.9 SpeLaTeX - Speech-enabled LaTeX (DMW and LVP)]
+ [2024/09/09 v0.92 SpeLaTeX - Speech-enabled LaTeX (DMW and LVP)]
%</package>
-\def\fileversion{0.9}
-\def\filedate{2024/06/12}
+\def\fileversion{0.92}
+\def\filedate{2024/09/09}
%<*driver>
\documentclass[10pt]{ltxdoc}
\usepackage{makeidx}
\usepackage{alltt}
\usepackage[english]{babel}
-\usepackage[extramath]{spelatex}
+\usepackage[extramath,
+ server=https://ctan.org/tex-archive/macros/latex/contrib/spelatex
+ ]{spelatex}
\usepackage{amsmath}
+\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{tikz}
\IfFileExists{tocbibind.sty}{\usepackage{tocbibind}}{}
@@ -79,7 +80,16 @@
% 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.}
+% \changes{v0.92}{2024/09/09}{. Second overhaul:\\
+% - dumped orgmode export idea (too small of an audience)\\
+% - introduced markers for non-area-links\\
+% - implemented audio on server\\
+% - implemented <\kern-0.5ex<\kern-0.5ex<-macro as a shorthand}
%
% \GetFileInfo{spelatex.dtx}
%
@@ -104,97 +114,204 @@
% \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*{Disclaimer}
+% \<<<{
+% Note that this is an experimental package. Its interface may change
+% considerably over subsequent versions (until v1.0).
+% }
+%
% \section{Preface}
%
-% \begin{spelchunk}
+% \subsection{Background}
+%
+% \<<<{
% At our institute, the University of Antwerp in Belgium, the number
% of students with reading and/or writing disorders (or at least
% aware of these disorders) is increasing. Approximately 5\% of the
-% students are registered with such a disorder. Probably there's an
-% additional number of people opting not to register their disorder.
-% \end{spelchunk}
-%
-% \begin{spelchunk}
+% students are registered with such a disorder and the number is rising
+% steadily over the past 10 years. Probably this number is an
+% underestimation as a number of people opti not to register their
+% disorder.
+% }
+
+% \<<<{
% A large portion of the study materials we offer to students is
% still written material. The authors believe that this will keep on
% being so, even given the multimedia and AI options that have
% become mainstream. Let's not go into this debate for now.\\
% However, written course texts cannot be but suboptimal for
% students with reading disorders.
-% \end{spelchunk}
+% }
%
-% \begin{spelchunk}
+% \<<<{
% For small texts, reading them out loud and recording them using a
% voice recorder to create an aid for our target group, is still
-% feasible. We have taken that route at our institute for exam
+% feasible. We have taken that in the past for exam
% assignments. However, for bigger texts (like course syllabi) this
-% is beyond the time a teacher can afford spending on this small a
+% is beyond the time a professor can afford spending on this small a
% group of students. Yes, economic laws also govern teaching!
-% \end{spelchunk}
+% }
%
-% \begin{spelchunk}
+% \subsection{State of the art}
+%
+% \subsubsection{In general}
+%
+% \<<<{
% 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.
-% \end{spelchunk}
+% 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.
+% }
+%
+% \<<<{
+% 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.
+% }
+%
+% \<<<{
+% 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.
+% }
+%
+% \subsubsection{For \LaTeX}
+%
+% \<<<{
+% 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.
+% }
+%
+% \<<<{
+% So all is well? Not quite. Though we are confident that --- with enough
+% time --- the community will solve the issue completely, there are
+% still some gaps:
+% }
+% \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}
%
-% \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
-% \cite{ORGMODE} of \GNU{} Emacs \cite{EMACS}. To satisfy your
-% curiosity: \spelbox{} stands for ``Speech-Enabled \LaTeX{} By
-% Org-mode eXport''.
-% \end{spelchunk}
+% \subsection{This package}
+%
+% \<<<{
+% 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.
+% }
+%
+% \<<<{
+% 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.
+% You have the choice to use local files or files that are made available on a
+% server (as holds for this text; the audio files are on the CTAN servers).\\
+% How does \spelatex{} 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.
+% }
+%
+% \<<<{
+% 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.
+% }
+%
+% \<<<{
+% 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:
+% }
+% \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 (us) paying for them at document creation
+% time, makes more sense to us than having our 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.}
+% \end{itemize}
%
-% \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.
+% }
+
+% \<<<{
+% 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.
-% \end{spelchunk}
-%
-% \begin{spelchunk}
+% 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.
+% }
+%
+% \<<<{
% 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
-% 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.
-% \end{spelchunk}
-%
-% \begin{spelchunk}
+% \spelatex{}'' in the section treating copyrights,
+% bibliographic data or any other spot of your text 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 our day.
+% }
+%
+% \<<<{
% You are free to modify this \LaTeX-package, keeping a reference to
% our original package intact, provided that your package is subject
% to the LPPL license, as is \spelatex{}. However, contributing to our
-% package might be a better way to go, in order to bundle the efforts
+% package or to the \LaTeX{} project in general, might be a better
+% way to go, in order to bundle the efforts
% for a better speech-enabled \LaTeX{}.
-% \end{spelchunk}
-%
+% }
+% \clearpage
% \section{Introduction}
%
% \subsection{Target audience}
-% \begin{spelchunk}
+% \<<<{
% \spelatex{} is primarily intended for persons with a reading
% disorder. This may be:
-% \end{spelchunk}
+% }
% \begin{itemize}
% \spelitem{persons suffering dyslexia}
% \spelitem{visually impaired persons}
@@ -209,160 +326,158 @@
% \end{itemize}
% \end{itemize}
%
-% \begin{spelchunk}
+% \<<<{
% But also people who want to multitask, e.g., gardening while
% listening to a technical book, can benefit from
% \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.
-% \end{spelchunk}
+% things.}\\ We often use \spelatex{} to proofread the texts we've
+% written ourselves as we hear language errors more easily than we
+% spot them while reading.
+% }
%
% \subsection{The magic under the hood}
%
-% \subsubsection{The \spelbox{}-ecosystem}
-%
-% \begin{spelchunk}
-% The \spelatex{}-package is one of the parts of the \spelbox{}
-% ecosystem. It consists of three components:
-% \end{spelchunk}
-% \begin{itemize}
-% \spelitem{An Org-mode exporter called \texttt{ox-spelatex} \cite{OXSPELATEX}}
-% \spelitem{This \LaTeX{}-package \spelatex{} \cite{SPEL}}
-% \spelitem{A script embeded in the Perl module \spelwizardmodule~\cite{SPELWIZARD}}
-% \end{itemize}
-%
% \subsubsection{The overall picture}
%
-% \begin{spelchunk}
-% \spelatex{} equips the PDF that is generated by \LaTeX{}
-% with hyperlinks to audio files that contain the spoken
-% equivalent of the original text, equations, figures and tables
-% \end{spelchunk}
-%
-% \begin{spelchunk}
-% Let's look at this in detail in Fig.~\ref{fig:setup}.
-% For now, ignore the two top boxes, and let's assume you are
-% composing the file |text.tex| as your document. We will return
-% to the two top boxes later.
-% \end{spelchunk}
-%
-% \begin{spelchunk}
-% By loading the |spelatex.sty| package in your source
-% document, \LaTeX{} will produce a PDF file that references audio
+% \<<<{
+% \spelatex{} equips the PDF that is generated by \LaTeX{}
+% with hyperlinks to audio files that contain the spoken
+% equivalent of the original text, equations, figures and tables.
+% }
+%
+% \<<<{
+% Let's start by considering the flow depicted in
+% Fig.~\ref{fig:setup} at the top of the diagram.
+% By loading the |spel.sty| package in your source
+% document (|text.tex|), \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
% your text) in separate files (|.tex|) and a spel index file
% (|.spelidx|) referencing them in sequence.
-% \end{spelchunk}
+% }
%
-% \begin{spelchunk}
+% \<<<{
% Together with the |.aux|-file (needed by \spelatex{} for labels and
% citations), these are the inputs to the \spelatex-engine (|spel-wizard.pl|)
% that parses the text chunks, writes a full text version of them as
% spel files (with extension |.spel|) and
-% controls the text-to-speech engine to generate audio files of
+% controls the text-to-speech engine to generate audio versions of
% them.\footnote{In the figure, Ogg Vorbis has been chosen as
% format, but this can be any audio format.}
-% \end{spelchunk}
+% }
%
-% \begin{spelchunk}
+% \<<<{
% To avoid excessive text to speech conversion (i.e. an expensive step)
-% the \spelatex{} engine derives a finger print of them and compares it
+% the \spelatex{} engine derives an MD5 fingerprint of them and compares it
% to previously generated fingerprints for the chunk. If the
-% finger print has changed, the audio file is overwritten (or
+% fingerprint has changed, the audio file is overwritten (or
% created the first time), otherwise it is left untouched.
-% \end{spelchunk}
+% }
%
-% \begin{spelchunk}
-% As a cherry on top, the \spelatex-engine also creates a playlist,
+% \<<<{
+% As a cherry on top, the \spelatex-engine also creates a top-level playlist,
% such that you may use the audio files for a \POD{}cast-like
% listening experience.\\
% Something that has not been indicated on the figure, is that for
% reading out loud entire (sub)sections, the PDF-file also references
% m3u playlists that gather all chunks belonging to the (sub)section.
-% \end{spelchunk}
+% }
%
-% \begin{figure}[p]
+% \begin{figure}
% \begin{spelchunk}
% \begin{center}
% \begin{tikzpicture}
-% [scale=0.8,>=latex,
-% doc/.style={rectangle,fill=black!10,align=center,minimum
-% width=2cm,minimum height=2cm},
-% 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 [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 [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)};
-% \node [doc] (aux) at (9,-3) {text.aux\\\footnotesize(auxiliary file)};
-% \node [doc] (files) at (3,-3) {*.tex\\\footnotesize(text chunks)};
-% \draw[->] (text) -- (latex);
-% \draw[->,dotted] (text) -- (R);
-% \draw[->,dotted] (spelidx) -- (files);
-% \draw[->] (R) -- (latex);
-% \draw[->] (latex) -- (pdf);
-% \draw[->] (latex) edge[out=0,in=90] (spelidx);
-% \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)};
-% \node [tool] (t2s) at (1.5,-6) {text-to-speech\\engine};
-% \draw[->] (files) -- (engine);
-% \draw[->] (spelidx) -- (engine);
-% \draw[->] (aux) -- (engine);
-% \node[doc] (ogg) at (0,-9) {*.ogg\\\footnotesize(audio files)};
-% \node[doc] (spel) at (3,-9) {*.spel\\\footnotesize(spel files)};
-% \node[doc] (m3u) at (6,-9) {text.m3u\\\footnotesize(playlist)};
-% \node[doc] (md5) at (9,-9) {*.md5\\\footnotesize(fingerprints)};
-% \draw[->] (engine) -- (spel);
-% \draw[->] (engine) -- (m3u);
-% \draw[<->] (engine) -- (md5);
-% \draw[->,dotted] (pdf) edge[out=-115,in=115] (ogg);
-% \draw[->,dotted] (m3u) edge[out=-125,in=-55] (ogg);
-% \draw[->,dashed] (engine) -- (t2s);
-% \draw[->] (spel) -- (t2s);
-% \draw[->] (t2s) -- (ogg);
+% [scale=0.8,>=latex,
+% doc/.style={rectangle,fill=black!10,align=center,minimum
+% width=2cm,minimum height=2cm},
+% tool/.style={rectangle,draw,align=center}]
+% \node [doc] (text) at (0,3) {text.tex\\\footnotesize(source file)};
+% \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)};
+% \node [doc] (aux) at (9,-3) {text.aux\\\footnotesize(auxiliary file)};
+% \node [doc] (files) at (3,-3) {*.tex\\\footnotesize(text chunks)};
+% \draw[->] (text) -- (latex);
+% \draw[->,dotted] (text) -- (R);
+% \draw[->,dotted] (spelidx) -- (files);
+% \draw[->] (R) -- (latex);
+% \draw[->] (latex) -- (pdf);
+% \draw[->] (latex) edge[out=0,in=90] (spelidx);
+% \draw[->] (latex) edge[out=10,in=90] (aux);
+% \draw[->] (latex) edge[out=-10,in=90] (files);
+% \node [tool] (engine) at (6,-6) {\spelpl{}\\
+% \footnotesize(\spelatex{} engine)};
+% \node [tool] (t2s) at (1.5,-6) {text-to-speech\\engine};
+% \draw[->] (files) -- (engine);
+% \draw[->] (spelidx) -- (engine);
+% \draw[->] (aux) -- (engine);
+% \node[doc] (ogg) at (0,-9) {*.ogg\\\footnotesize(audio files)};
+% \node[doc] (spel) at (3,-9) {*.spel\\\footnotesize(spel files)};
+% \node[doc] (m3u) at (6,-9) {text.m3u\\\footnotesize(playlist)};
+% \node[doc] (md5) at (9,-9) {*.md5\\\footnotesize(fingerprints)};
+% \draw[->] (engine) -- (spel);
+% \draw[->] (engine) -- (m3u);
+% \draw[<->] (engine) -- (md5);
+% \draw[->,dotted] (pdf) edge[out=-115,in=115] (ogg);
+% \draw[->,dotted] (m3u) edge[out=-125,in=-55] (ogg);
+% \draw[->,dashed] (engine) -- (t2s);
+% \draw[->] (spel) -- (t2s);
+% \draw[->] (t2s) -- (ogg);
% \end{tikzpicture}
-% \end{center}
-% \end{spelchunk}
-% \begin{spelchunkad}
-% The easiest flow is to start from the top box, which represents
-% an org file that describes your text. We call this the
-% 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
-% also start by composing this file yourself.
-% If your prepped source file uses the \spelatex{} style file, then
-% 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
-% 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
-% Ogg-Vorbis files. To avoid having to call the text-to-speech
-% engine too frequently (which may incur costs), MD5-fingerprints
-% are used such that chunks that have been generated before and
-% are unchanged, can be reused. The end result is a PDF file that
-% references the audio files.
-% \end{spelchunkad}
-% \caption{Basic tool setup of \spelbox{} of which the \spelatex{} package
-% is an integral part; filled boxes indicate files,
-% outlined boxes indicate tools; solid lines indicates use or
-% creation of files, dotted lines indicate references, dashed lines
-% indicate a control relationship.}
-% \label{fig:setup}
+% \end{center}
+% \end{spelchunk}
+% \begin{spelchunkad}
+% If you load the \spelatex{} style file in your source file (at the
+% top of the figure) and prepare your source file according to the
+% instructions in this manual, 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 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
+% Ogg-Vorbis files. To avoid having to call the text-to-speech
+% engine too frequently (which may incur costs), MD5 fingerprints
+% are used such that chunks that have been generated before and
+% are unchanged, can be reused. The end result is a PDF file that
+% references the audio files.
+% \end{spelchunkad}
+% \caption{Basic tool setup of the \spelatex{} package; filled boxes indicate
+% files, outlined boxes indicate tools; solid lines indicates use or
+% creation of files, dotted lines indicate references, dashed lines
+% indicate a control relationship.}
+% \label{fig:setup}
% \end{figure}
%
+% \<<<{
+% You might wonder: where are the links? Well, there are three
+% variants:
+% }
+% \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 (on the far right). These cause all
+% blocks in the section to be read one by one.\\
+% In case you specify the
+% package option \texttt{markervisibility=none} these triangles will become
+% invisible. However, the clickable areay still exists. Try!}
+% \spelitem{\emph{chunk links}, before every
+% paragraph, footnote or list, a small triangle indicates a clickable link.\\
+% If you activate the package option \texttt{markervisibility=onlygroups}, they will
+% become invisible, but still clickable. Try it! Once you
+% are aware that these regions are active, you'll find them
+% easily. 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}
@@ -373,7 +488,7 @@
% \spelmacad{thanks}{the thanks macro}
% \spelmacad{item}{the item macro}
% \spelmacad{spelitem}{the spelitem macro}
-% \begin{spelchunk}
+% \<<<{
% Generating the text chunks to be read out loud requires us to use
% special \LaTeX-macros. For all pieces of text that are within
% an existing macro (e.g. |\title|, |\author|, |\section|,
@@ -381,26 +496,26 @@
% redefined by the \spelatex{}-package to
% execute the magic without any further hassle.\\
% We call these \LaTeX-fragments \emph{implicit spelchunks}.%
-% \end{spelchunk}
+% }
%
-% \begin{spelchunk}
+% \<<<{
% However, not all \LaTeX-constructs can be dealt with in an
% automatic way. This is true for any |\item| you put inside a list.
% You need to replace that with a |\spelitem| that takes the text
% 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}
+% }
%
% \subsubsection{Explicit spelchunks}
-% \begin{spelchunk}
+% \<<<{
% 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
@@ -409,12 +524,12 @@
% will have to provide a text description for tables and figures
% manually, using a subsequence |spelchunkad|
% environment (the suffix ad stands for \emph{audio description}).
-% \end{spelchunk}
+% }
%
-% \begin{spelchunk}
+% \<<<{
% To keep the terminology clear, we label them as automatic
-% and manual spelchunks respectively:
-% \end{spelchunk}
+% and manual explicit spelchunks respectively:
+% }
% \begin{itemize}
% \spelitem{automatic: \texttt{equation}, \texttt{eqnarray},
% \texttt{gather}, \texttt{align}, \texttt{alignat}, \ldots}
@@ -422,25 +537,26 @@
% \texttt{tikzpicture}, \ldots}
% \end{itemize}
%
-% \begin{spelchunk}
+% \<<<{
% The similarity between both categories is that you both embed them
% in a |spelchunk| environment, but that you provide the manual
% textual description using a |spelchunkad| environment right after
-% the chunk: in this way, the |spelchunkad| environment provides an
+% the chunk for the manual ones: in this way, the |spelchunkad| environment provides an
% alternative text for the chunk. Note that this way of working also
-% enables you to provide an overriding text for an equation, if you
-% think that \spelpl{} is doing a bad job. You do me a favor if
-% you submit this subpar behavior as a bug report to me!
-% \end{spelchunk}
+% enables you to provide an overriding text for an automatic spelchunk,
+% e.g., an equation, if you
+% think that \spelpl{} is doing a bad job. You do us a favor if
+% you submit this subpar behavior as a bug report to us!
+% }
%
-% \begin{spelchunk}
+% \<<<{
% It is worthwile to make good descriptions for a figure or a
% table. It's here that you can create true added value to your
% manuscript, even for readers without impairment!
-% \end{spelchunk}
+% }
%
% \subsubsection{Paragraphs}
-% \begin{spelchunk}
+% \<<<{
% However, there is the elephant in the room that we did not yet
% talk about, the paragraph. Indeed, it is desirable to split plain
% text according to the paragraphs in the document. Alas, paragraphs
@@ -450,63 +566,40 @@
% explicit spelchunks and need to be embedded
% in |spelchunk| environments. This environment will cause its
% contents to be hyperlinked to a separate piece of audio.
-% \end{spelchunk}
+% }
%
-% \begin{spelchunk}
+% \<<<{
% Encasing all your paragraphs with |spelchunk| environments
% manually is a pain. There is a reason why in \LaTeX{}
% paragraphs can be created by a double newline: convenience.
% The |spelchunk|-environment encasing ruins this totally!
-% \end{spelchunk}
-%
-% \subsubsection{Emacs Orgmode to the rescue!}
-% \begin{spelchunk}
-% However, we provide an exporter for the Org-mode \cite{ORGMODE} of
-% Emacs \cite{EMACS}, such
-% that you can prepare your manuscript in Org-mode and not worry
-% about all these exlicit tricks with |spelchunk| and |spelitem|
-% constructs.
-% \end{spelchunk}
-%
-% \begin{spelchunk}
-% 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
-% 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
-% the non textual portions of your manuscript, e.g. giving a good
-% description of a graph.
-% \end{spelchunk}
-%
-% \begin{spelchunk}
-% Note that this very document has been prepared manually to make it
-% 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{}
-% outside \spelbox{}. Outside a proper boxed confinement,
-% spells easily become curses\ldots
-% \end{spelchunk}
+% }
+% \spelmacad{<<<}{the shorthand macro}
+% \<<<{
+% To ease the pain and in order to avoid the visual intrusiveness of the
+% spelchunk environments, you can also use the \texttt{\textbackslash{}<<<\{\}} command to
+% encase your paragraphs. In some cases the \texttt{\textbackslash{}<<<\{\}}
+% command will not work, e.g., if there is a |Verbatim| environment
+% inside. In that case you must use the |spelchunk| environment directly.
+% }
%
% \subsection{Extra math commands}
%
-% \begin{spelchunk}
+% \<<<{
% Some of the ways to specify mathematical expressions in \LaTeX{} is
% very liberal, what makes converting them to text quite
% difficult. Therefore, we also provide some
% extra constructs that make life easier for both parties: you as a
% user and \spelpl{} as a parser.
-% \end{spelchunk}
+% }
%
-% \begin{spelchunk}
+% \<<<{
% An example of this are sets. We provide two commands to define a
% set. As we want these commands to blend in with general \LaTeX{},
% we did not equip them with a prefix |spel|. Therefore, we made
% activating them conditional to specifying the package option
% |extramath|.
-% \end{spelchunk}
+% }
% \begin{description}
% \spelitem[\texttt{\textbackslash{}setenum}]{a command to define a set
% that consists of comma or semicolon separated elements}
@@ -517,14 +610,11 @@
%
% \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:
-% \end{spelchunk}
+% \<<<{
+% Why would it make sense to use \spelatex? We think there are many
+% selling points. We can mention a few:
+% }
% \begin{description}
-% \spelitem[Minimal overhead]{
-% Preparing a \LaTeX{} manuscript for use with \spelatex{} requires a
-% minimal amount of work, if you are using Org-mode in Emacs.}
% \spelitem[Free for the content provider]{
% If you are using a freeware text-to-speech engine (like for
% example festival \cite{FESTIVAL} or balabolka \cite{BALABOLKA})
@@ -533,8 +623,9 @@
% 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
-% Polly \cite{AWSPOLLY}.\\
+% service. As an example, we incorporated a connection to Amazon's
+% Polly \cite{AWSPOLLY}. We admit, it's not free, but it doesn't
+% cost an arm and a leg either.\\
% In addition, if your user has a better-quality (maybe
% commercial) text-to-speech system, he/she can reconvert the text
% files him-/herself, equiping your document with a voice they
@@ -544,63 +635,74 @@
% \spelitem[Free for your audience]{
% In addition, the user of your audio-enabled document doesn't
% need to buy a license for text-to-speech software. Only a PDF-viewer
-% and standard audio-player program are required.}
+% and a standard audio-player program are required.}
% \spelitem[Math capable]{
-% Try some of the equations in this manuscript. We are quite
-% confident you'll be convinced fairly soon.}
+% Try some of the equations in this manuscript in
+% section~\ref{sec:demo}. We are quite confident you'll be
+% convinced fairly soon.}
% \end{description}
%
% \section{Installation}
%
% \subsection{The \spelatex{} package}
-
-% \begin{spelchunk}
-% Most \LaTeX{} distributions use \CTAN{} as their main package source
-% and therefore will include \spelatex.
-% \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.
-% \end{spelchunk}
+% \<<<{
+% If you are a package manager then you'll know how to
+% prepare an installation package for \spelatex.
+% }
+%
+% \<<<{
+% If you are a normal user, 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.\\
+% The fallback option is to grab the |spelatex.sty| file from CTAN
+% and put it in our \TeX{} search path.
+% }
+%
+% \<<<{
+% 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|, |xcolor|, |ifthen|, |verbatim|,
+% |fancyvrb|, |newfile|, |rotating|, |babel|, |kvoptions| and |xkeyval|.
+% }
%
% \subsection{The \spelpl{} speech generator}
%
% \subsubsection{The script}
-% \begin{spelchunk}
+% \<<<{
% You can install the wizard assuming you have a working Perl
% interpreter installed. Assuming you're on \GNU/Linux or MAC, you
% should be able to find an installation package using the package
% manager for your distribution. If you are on MS-Windows, look for
% Strawberry perl or ActiveState perl.
-% \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.
-% \end{spelchunk}
+% \<<<{
+% The only thing to do is to install the |SpeL::Wizard|
+% module. You can do this with the perl pacakge manager for your
+% interpreter.
+% }
%
-% \begin{spelchunk}
+% \<<<{
% Open a terminal or command window, and then enter on the
% command line (the dollar represents your prompt):
-% \end{spelchunk}
+% }
%
-% \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|
-% \end{spelchunk}
+% For Strawberry perl: |$ cpan SpeL::Wizard|\\
+% For ActiveState perl: |$ ppm install SpeL-Wizard|
+% }
%
-% \begin{spelchunk}
+% \<<<{
% The script \spelpl{} will be installed on your system. Make sure
% it is on your search path.
-% \end{spelchunk}
+% }
%
% \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,12 +717,27 @@
% 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}
+%
+% \<<<{
% The tts configuration parameter defines the speech engine to use.
% The languagetags section defines how the babel languages are mapped to
% internationalization codes (also known as locales).
% The voices section specifies what voice to use for a specific language.
-% \end{spelchunk}
+% }
%
% \begin{spelchunk}
% An environment variable can specify where your config file is
@@ -630,87 +747,97 @@
% \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%| on
+% MS-Windows), or it will take the default that came with the
+% |SpeL::Wizard| module.
+% \end{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.%
-% \end{spelchunk}
+% assistance for this is beyond the aim of this manual.
+% }
%
% \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
-% \cite{OKULAR} and Adobe Reader \cite{ADOBEREADER} do. So does
-% PDF-XChange Viewer \cite{PDFXCHANGE}.
-% \end{spelchunk}
+% \<<<{
+% You need to make sure you have a PDF-viewer that supports file links
+% E.g., xpdf \cite{XPDF} does not, but evince \cite{EVINCE}, okular
+% \cite{OKULAR} and Adobe Reader \cite{ADOBEREADER} do.
+% }
%
% \subsection{The media player}
-% \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).
+% }
+%
+% \<<<{
+% 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}
+% }
+%
+% \<<<{
+% If you gave the |server| option to the \spelatex{} package, then your
+% favorite webbrowser will be started to download and play the file.
+% If you move it out of your way, you can avoid that it jumps in front of
+% your text every time again.
+% }
%
% \section{Usage}
%
% \subsection{Preparing your document source}
% \begin{spelchunk}
% Using the \spelatex{} package is very simple. Just load the package's
-% style file using an appropriate |\usepackage{spel}|.
+% style file using an appropriate |\usepackage{spelatex}|.
% \end{spelchunk}
%
-% \begin{spelchunk}
-% In case you are not using Org-mode, there are $5$ things to do:
-% \end{spelchunk}
+% \<<<{
+% There are $5$ things to do:
+% }
% \begin{enumerate}
-% \spelitem{Treat the defunct implicit spelchunks}
-% \spelitem{Treat the explicit spelchunks}
-% \spelitem{Manually provide text to read when needed}
+% \spelitem{Treat the defunct implicit spelchunks.}
+% \spelitem{Treat the explicit spelchunks.}
+% \spelitem{Manually provide text to read when needed.}
% \spelitem{Provide audiodescriptions or preprocessing instructions
-% for your typesetting macros}
+% for your typesetting macros.}
% \spelitem{Provide audiodescriptions or preprocessing instructions
-% for your typesetting environments}
+% for your typesetting environments.}
% \end{enumerate}
%
-% \begin{spelchunk}
-% Steps 1 and 2 can be done automatically for you by using Org-mode in
-% Emacs and using the proper |spel| exporter.
-% Steps 3, 4 and 5 are up to you. In this section, we assume you are
-% executing all 5 steps manually and therefore, we will explain all
-% required macros.
-% \end{spelchunk}
+% We will now explain all required macros.
%
-% \subsubsection{Treating the implicit spelchunks}
-% \begin{spelchunk}
+% \subsubsection{Treat the implicit spelchunks}
+% \<<<{
% The texts of chapter, (sub)section titles, a.s.o. will be formatted
% automatically such that they are hyperlinked to the appropriate
% audio file. Therefore, this step was not mentioned above. It is done
% automatically for you by using the \spelatex{} package.
-% \end{spelchunk}
+% }
%
-% \begin{spelchunk}
+% \<<<{
% You only need to cover your \emph{defunct implicit spelchunks}:\\
% \DescribeMacro{\spelitem}
% Use this macro instead of the \texttt{\textbackslash{}item} macro to make
% sure your list environments are converted to speech chunks
% appropriately.
-% \end{spelchunk}
+% }
%
% \begin{spelchunk}
% Example:
% \begin{Verbatim}
-% I like
+% We like
% \begin{itemize}
% \spelitem{apples,}
% \spelitem{pears, and}
@@ -728,30 +855,36 @@
% \spelitem[orange]{an orange round fruit}
% \end{description}
% \end{Verbatim}
-% Note that the spel exporter in Org-mode takes care of all this
-% boilerplate work.
% \end{spelchunk}
%
-% \subsubsection{Treating the explicit spelchunks}
-%
-% \begin{spelchunk}
+% \subsubsection{Treat the explicit spelchunks}
+% \label{sec:explicitspelchunks}
+% \<<<{
% \DescribeEnv{spelchunk}
% Use this environment to embed the chunks of text in that you want
-% to generate audio for.
-% \end{spelchunk}
-%
-% \begin{spelchunk}
+% 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.
+% Note that you cannot specify an |arealink| when the area to be covered is
+% vertical-mode object. In common language: put your |arealink| |spelchunk|
+% environments inside a |center| environment and not the other way around.
+% }
+%
+% \<<<{
% Example:\\
-% {\footnotesize (note: the example below is not \spelatex{}-enabled because it
-% generates internal package problems)}
-% \end{spelchunk}
+% {\footnotesize (note: the example below is not \spelatex{}-enabled
+% in this manual because it generates internal package problems)}
+% }
% \begin{Verbatim}
% \begin{spelchunk}
-% An orderinary paragraph must be embedded in this environment.
-% The same holds for equations!
+% An ordinary paragraph must be embedded in this environment.
+% 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 +893,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,12 +911,12 @@
%
% \begin{spelchunk}
% Example:\\
-% {\footnotesize (note: the example below is not \spelatex{}-enabled because it also
+% {\footnotesize (note: the example below is again not \spelatex{}-enabled because it
% generates internal package problems)}
% \end{spelchunk}
% \begin{Verbatim}
% \begin{spelchunk}
-% An orderinary paragraph must be embedded in this environment.
+% An ordinary paragraph must be embedded in this environment.
% \end{spelchunk}
% \begin{spelchunkad}
% Do not forget to embed ordinary paragraphs in this environment.
@@ -801,8 +934,8 @@
%
% \begin{spelchunk}
% Example:\\
-% {\footnotesize (note: the example below is not \spelatex{}-enabled because it
-% generates internal package problems also)}
+% {\footnotesize (note: the example below is for a third time not \spelatex{}-enabled because it
+% generates internal package problems)}
% \end{spelchunk}
% \begin{Verbatim}
% \begin{spelchunk}
@@ -815,6 +948,39 @@
% \end{spelchunkad}
% \end{Verbatim}
%
+% \subsubsection{Use the shorthand \texttt{\textbackslash <<<}-macro}
+%
+% \<<<{
+% \DescribeMacro{\<<<}
+% This macro takes the text to be read-out loud as an
+% argument. It is a shorthand for the |spelchunk|
+% environment. Options you would have given to the |spelchunk|
+% environment can be given as an optional argument to this macro.
+% }
+%
+% \<<<{
+% Retaking the example of section~\ref{sec:explicitspelchunks},
+% using the shorthand, we obtain:\\
+% {\footnotesize (note: the example below is once again not \spelatex{}-enabled
+% in this manual because it generates internal package problems)}
+% }
+% \begin{Verbatim}
+% \<<<{
+% An ordinary paragraph must be embedded in this macro.
+% 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.
+% }
+% \<<<[arealink]{
+% \begin{align}
+% E &= m c^2\\
+% e^{j\pi} &= -1
+% \end{align}
+% }
+% \end{Verbatim}
+%
+%
% \subsubsection{Provide descriptions for typesetting macros}
%
% \DescribeMacro{\spelmacad}
@@ -874,9 +1040,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,21 +1109,23 @@
% 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 a definition set and makes sure \spelpl{}
% can read it properly.
% \end{spelchunk}
% \begin{spelchunk}
% \begin{Verbatim}
% \begin{equation}
-% P = \setdesc{ n \in N \mid n \text{~is prime} }
+% P = \setdesc{ n \in \mathbb{N} \mid n \text{~is prime} }
% \end{equation}
% \end{Verbatim}
% \end{spelchunk}
@@ -1005,10 +1173,13 @@
% \begin{VerbatimOut}[gobble=4]{Example/example.tex}
% \documentclass{article}
%
-% \usepackage[dutch,english]{babel} % load babel before spel to avoid
+% \usepackage[dutch,english]{babel} % load babel before spelatex to avoid
% % option clash!
% \selectlanguage{english}
-% \usepackage[format=ogg]{spelatex}
+% \usepackage[format=ogg,
+% server=https://ctan.org/tex-archive/macros/latex/contrib/spelatex/Example
+% ]
+% {spelatex}
%
% \newrobustcmd\CTAN{CTAN}
% \spelmacad{CTAN}{see-tan}
@@ -1017,7 +1188,7 @@
%
% \title{\spelatex{} Example}
% \author{Walter Daems and Paul Levrie}
-% \date{2011/04/12}
+% \date{2024/09/09}
% \setlength\parindent{0em}
% \setlength\parskip{1ex}
%
@@ -1027,10 +1198,10 @@
%
% \section{Introduction}
%
-% \begin{spelchunk}
-% This file is just a simple showcase of the features of \spelatex.
+% \<<<{
+% This file is just a simple showcase of the features of \spelatex{}.
% Below, you'll find examples of:
-% \end{spelchunk}
+% }
%
% \begin{itemize}
% \spelitem{a simple equation}
@@ -1039,21 +1210,25 @@
%
% \section{A simple equation}
% \label{eqn:simple}
-% \begin{spelchunk}
+% \<<<{
% Consider the following simple definition of a polynomial function and
% check its spoken version by clicking on it.
-% \end{spelchunk}
-%
-% \begin{spelchunk}
+% }
+% \<<<[arealink]{
% \begin{equation}
-% f(x) = x^{5}- x^4 + 7 x^3 + 3 x^2 - 8 x + 23
+% f(x) = x^{5}- x^4 + 7 x^3 + 3 x^2 - 8 x + 25
% \end{equation}
-% \end{spelchunk}
-% \begin{spelchunk}
+% }
+% \<<<{
% This seems a simple equation, however, it is not so straightforward
% for an automated reader, to read it correctly.
-% \end{spelchunk}
+% }
%
+% \section{Remark}
+% \<<<{
+% Instead of the \texttt{\textbackslash{}<<<} macro, one can also use the
+% spelchunk environment. We did this in the next sections.
+% }
% \section{A more complex equation}
% \newcommand\xx[2]{\ensuremath{#1_{#2}}}
% \spelmacad{xx}[2]{#1 #2}
@@ -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,13 +1254,14 @@
% 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}
-
+%
% \selectlanguage{english}
+%
% \section{And some extras}
% \subsection{Citations}
% \begin{spelchunk}
@@ -1099,6 +1275,8 @@
% section~\ref{eqn:complex}.
% \end{spelchunk}
%
+% \selectlanguage{dutch}
+%
% \bibliographystyle{alpha}
%
% \begin{thebibliography}{99}
@@ -1113,14 +1291,15 @@
% \newblock \url{http://www.cpan.org}.
% \newblock online, accessed in August 2021.
%
-% \end{thebibliography}{99}
+% \end{thebibliography}
%
% \end{document}
% \end{VerbatimOut}
+% \footnotesize
% \VerbatimInput[frame=lines,numbers=left,gobble=0]{Example/example.tex}
-%
+% \normalsize
% \section{Demo}
-%
+% \label{sec:demo}
% \newcommand\rd[1]{\ensuremath{\mathrm{d}#1}}
% \spelmacad{rd}[1]{d of #1}
% \newcommand\xx[2]{\ensuremath{#1_{#2}}}
@@ -1134,8 +1313,7 @@
% \end{spelchunk}
%
% \subsection{Numbers}
-%
-% \begin{spelchunk}
+% \begin{spelchunk}[arealink]
% \begin{align}
% \pi\\
% -31415\\
@@ -1149,7 +1327,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 +1335,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 +1344,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 +1355,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 +1364,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}
@@ -1195,14 +1373,14 @@
% \begin{spelchunk}
% Euler's identity:
% \end{spelchunk}
-% \begin{spelchunk}
+% \begin{spelchunk}[arealink]
% \begin{equation}
% e^{j \pi} + 1 = 0
% \end{equation}
% \end{spelchunk}
%
% \subsubsection{A rather well-known definite integral}
-% \begin{spelchunk}
+% \begin{spelchunk}[arealink]
% \begin{equation}
% \int_{-\infty}^\infty e^{-x^2}\,\rd{x} = \sqrt{\pi}
% \end{equation}
@@ -1214,16 +1392,18 @@
% \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}}
+% P &= \setdesc{ n \in \mathbb{N} \mid n \text{~is prime}}
% \end{align}
% \end{spelchunk}
%
% \subsection{Matrices}
% \begin{spelchunk}
% How about some linear algebra?
+% \end{spelchunk}
+% \begin{spelchunk}[arealink]
% \begin{align}
% \begin{bmatrix}
% 3 & 4 \\
@@ -1253,43 +1433,44 @@
% \end{spelchunk}
% \begin{figure}[h]
% \setlength{\unitlength}{4mm}
-% \begin{spelchunk}
% \begin{center}
+% \begin{spelchunk}[arealink]
% \begin{picture}(24,2)
% \put(0,0.8){$x[n]$}
% \put(2,1){\vector(1,0){3}}
% \put(5,0){\framebox(5,2){$H(z)$}}
% \put(10,1){\vector(1,0){3}}
-% \put(13,0){\framebox(5,2){$G(z) \ast F(z)$}}
+% \put(13,0){\framebox(5,2){$G(z) \cdot F(z)$}}
% \put(18,1){\vector(1,0){3}}
% \put(22,0.8){$y[n]$}
% \end{picture}
+% \end{spelchunk}
% \end{center}
-% \end{spelchunk}
% \begin{spelchunkad}
% The discrete-time input signal x is fed through a filter H of
% z. The intermediate output signal of the filter H of z is fed into
-% another filter whose transfer function is the convolution of G of
-% z and F of z. This resuspel in the discrete-time output signal y.
+% another filter whose transfer function is the product of G of
+% z and F of z. This results in the discrete-time output signal y.
% \end{spelchunkad}
% \caption{A block diagram of the filter system}
% \label{fig:blockdiagram}
% \end{figure}
%
% \subsubsection{Tables}
-% \begin{spelchunk}
-% \begin{center}
+% \<<<{Tables can also be equiped with a sensible description:}
+% \begin{center}
+% \begin{spelchunk}[arealink]
% \begin{tabular}{lcc}
% Food & Sweet & Bitter \\
% \hline
-% apple & $\bullet$ & \\
+% apples & $\bullet$ & \\
% unsweetened coffee & & $\bullet$\\
% cake & $\bullet$ & \\
% chocolate & $\bullet$ & $\bullet$ \\
% \hline
% \end{tabular}
-% \end{center}
-% \end{spelchunk}
+% \end{spelchunk}
+% \end{center}
% \begin{spelchunkad}
% This table indicates the sweetness and bitterness for several food
% products.
@@ -1305,50 +1486,46 @@
% to $\tan \alpha = -\frac{t}{2}$, the equation of the reflected
% ray is given by
% \end{spelchunk}
-% \begin{spelchunk}
+% \begin{spelchunk}[arealink]
% \begin{equation}
% y-9+\frac{t^2}{4} = -\frac{4t}{4-t^2} \cdot (x-t)
% \end{equation}
% \end{spelchunk}
-%
% \begin{spelchunk}
% The $x$-coordinate of the point of intersection of the reflected ray
% with a fixed line $y=u$ satisfies:
% \end{spelchunk}
-% \begin{spelchunk}
+% \begin{spelchunk}[arealink]
% \begin{equation}
% u-9+\frac{t^2}{4} = -\frac{4t}{4-t^2} \cdot (x-t)
% \label{eqn:refray}
% \end{equation}
% \end{spelchunk}
-%
% \begin{spelchunk}
% We calculate the minimal value of this $x$ for varying $t$, by
% differentiating (\ref{eqn:refray}) with respect to $t$ and assuming
% that $\frac{\rd{x}}{\rd{t}}=0$:
% \end{spelchunk}
-% \begin{spelchunk}
+% \begin{spelchunk}[arealink]
% \[
% \frac{t}{2} = -\frac{4(4+t^2)}{(4-t^2)^2} (x-t) -
% \frac{4t}{4-t^2} \cdot (-1) \ \ \ \Leftrightarrow \ \ \ x=
% 3\frac{t}{2}-\frac{t^3}{8}
% \]
% \end{spelchunk}
-%
% \begin{spelchunk}
% Inserting in the equation containing $u$ gives us the relation
% between $t$ and $u$:
% \end{spelchunk}
-% \begin{spelchunk}
+% \begin{spelchunk}[arealink]
% \[
% u = 9- 3 \frac{t^2}{4}
% \]
% \end{spelchunk}
-%
-% \begin{spelchunk}
+%% \begin{spelchunk}
% This leads to a system of parametric equations for the caustic:
% \end{spelchunk}
-% \begin{spelchunk}
+% \begin{spelchunk}[arealink]
% \[
% \left\{\begin{array}{l}
% x = 3\frac{t}{2}-\frac{t^3}{8} \\[0.3cm]
@@ -1361,7 +1538,6 @@
% \end{array} \right.
% \]
% \end{spelchunk}
-%
% \begin{spelchunk}
% It is now easy to eliminate the parameter $t$. As you can see, $t
% = \frac{6 x}{y}$. Inserting into the equation for $y$ gives us the
@@ -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}
@@ -1407,6 +1583,7 @@
\RequirePackage{hyperref}
\RequirePackage{xcolor}
\RequirePackage{ifthen}
+\RequirePackage{verbatim}
\RequirePackage{fancyvrb}
\RequirePackage{newfile}
\RequirePackage{rotating}
@@ -1425,6 +1602,7 @@
bookmarksopen=true,
urlcolor=black}
\RequirePackage{kvoptions}
+\RequirePackage{xkeyval}
% \end{macrocode}
%
% \subsection{Options}
@@ -1435,9 +1613,10 @@
prefix=spel@
}
\DeclareStringOption[ogg]{format}
+\DeclareStringOption[local]{server}
+\DeclareStringOption[full]{markervisibility}
\DeclareBoolOption[false]{disabled}
\DeclareBoolOption[false]{extramath}
-\DeclareBoolOption[false]{propermath}
\ProcessKeyvalOptions*
% \end{macrocode}
%
@@ -1449,12 +1628,6 @@
\DeclareRobustCommand{\spelatex}{S\kern-0.3ex\raisebox{-0.1ex}{\rotatebox{-15}{p}}\kern-0.25ex\raisebox{0.1ex}{\rotatebox{10}{e}}\kern-0.1ex\LaTeX}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\spelbox}
-% This is the official \spelbox{} logo.
-% \begin{macrocode}
-\DeclareRobustCommand{\spelbox}{S\kern-0.3ex\raisebox{-0.1ex}{\rotatebox{-15}{p}}\kern-0.25ex\raisebox{0.1ex}{\rotatebox{10}{e}}\kern-0.1exLbo\raisebox{-0.2ex}{x}}
-% \end{macrocode}
-% \end{macro}
% \begin{macro}{\spelpl}
% This is the official \spelpl{} logo.
% \begin{macrocode}
@@ -1496,6 +1669,10 @@
\addtostream{spelidx}{format|\spel@format}
\addtostream{spelidx}{audiodir|\audiodir}
\addtostream{spelidx}{chunkdir|\chunkdir}
+\addtostream{spelidx}{server|\spel@server}
+\ExplSyntaxOn
+\newcommand\linksdir{\str_if_eq:VnTF{\spel@server}{local}{./\audiodir}{\spel@server/\audiodir}}
+\ExplSyntaxOff
% \end{macrocode}
%
% To ease writing to the speech index stream, we define a |\spelidxwrite|
@@ -1596,7 +1773,29 @@
\AddBabelHook{informspel}{write}{\spel@idxwrite{language}{\languagename}}
\EnableBabelHook{informspel}
% \end{macrocode}
-%
+%
+% \subsection{Setting up the visibility}
+%
+% \begin{macrocode}
+\ExplSyntaxOn
+\definecolor{faintgray}{rgb}{0.9,0.9,0.9}
+\str_if_eq:VnTF{\spel@markervisibility}{none}{
+ \colorlet{spel@color@right}{white}
+ \colorlet{spel@color@left}{white}
+}{}
+\str_if_eq:VnTF{\spel@markervisibility}{onlygroups}{
+ \colorlet{spel@color@right}{black!25}
+ \colorlet{spel@color@left}{white}
+}{}
+\str_if_eq:VnTF{\spel@markervisibility}{full}{
+ \colorlet{spel@color@right}{black!25}
+ \colorlet{spel@color@left}{black!25}
+}{}
+\ExplSyntaxOff
+% \end{macrocode}
+%
+%
+%
% \subsection{Generating speech chunks --- implicitly}
% \subsubsection{Auxiliary macros}
% We define a macro to generate wrappers for single-line text elements.
@@ -1611,7 +1810,7 @@
\expandafter\let\csname spel@@#1\expandafter\endcsname\csname #1\endcsname
\expandafter\gdef\csname #1\endcsname##1{%
\spel@chunkwrite{#1}{##1}
- \csname spel@@#1\endcsname{\href{run:\audiodir/#1.\spel@format}{##1}}
+ \csname spel@@#1\endcsname{\href{\linksdir/#1.\spel@format}{##1}}
}
\expandafter\AtBeginDocument{
\spel@idxwrite{#1}{#1}
@@ -1633,9 +1832,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
@@ -1671,7 +1867,7 @@
\let\spel@@part\@part
\def\@part[#1]#2{%
\setcounter{spel@chunk}{0}% need this because counter resetting fails
- \spel@@part[#1]{\href{run:\audiodir/\spel@@optpart.\spel@format}{#2}}%
+ \spel@@part[#1]{\href{\linksdir/\spel@@optpart.\spel@format}{#2}}%
\spel@idxwrite{part \thepart}{\spel@@optpart}%
\spel@chunkwrite{\spel@@optpart}{#2}%
}
@@ -1688,7 +1884,7 @@
\stepcounter{spel@spart}%
\setcounter{spel@chunk}{0}% need this because counter resetting fails
\spel@@spart{%
- \href{run:\audiodir/\spel@@optpart star-\thespel@spart.\spel@format}{#1}}%
+ \href{\linksdir/\spel@@optpart star-\thespel@spart.\spel@format}{#1}}%
\spel@idxwrite{part}{\spel@@optpart star-\thespel@spart}%
\spel@chunkwrite{\spel@@optpart star-\thespel@spart}{#1}%
}
@@ -1706,7 +1902,7 @@
\def\@chapter[#1]#2{%
\setcounter{spel@chunk}{0}% need this because counter resetting fails
\spel@@chapter[#1]{%
- \href{run:\audiodir/\spel@@optpart\thechapter.\spel@format}{#2}}%
+ \href{\linksdir/\spel@@optpart\thechapter.\spel@format}{#2}}%
\spel@idxwrite{chapter \thechapter}{\spel@@optpart\thechapter}%
\spel@chunkwrite{\spel@@optpart\thechapter}{#2}%
}
@@ -1726,7 +1922,7 @@
\stepcounter{spel@schapter}%
\setcounter{spel@chunk}{0}% need this because counter resetting fails
\spel@@schapter{%
- \href{run:\audiodir/\spel@@optpart star-\thespel@schapter.\spel@format}{#1}}%
+ \href{\linksdir/\spel@@optpart star-\thespel@schapter.\spel@format}{#1}}%
\spel@idxwrite{chapter}{\spel@@optpart star-\thespel@schapter}%
\spel@chunkwrite{\spel@@optpart star-\thespel@schapter}{#1}%
}
@@ -1747,8 +1943,8 @@
\fi%
\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{\linksdir/\spel@@optpart\thesubparagraph.\spel@format}{#8}\hfill%
+ \href{\linksdir/\spel@@optpart\thesubparagraph.m3u}{\textcolor{spel@color@right}{$\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}%
@@ -1766,7 +1962,7 @@
\stepcounter{spel@ssect}%
%\setcounter{spel@chunk}{0}% need this because counter resetting fails
\spel@@ssect{#1}{#2}{#3}{#4}{%
- \href{run:\audiodir/\spel@@optpart\thesubparagraph-star-\thespel@ssect.\spel@format}%
+ \href{\linksdir/\spel@@optpart\thesubparagraph-star-\thespel@ssect.\spel@format}%
{#5}}%
\spel@idxwrite{section}{\spel@@optpart\thesubparagraph-star-\thespel@ssect}%
\spel@chunkwrite{\spel@@optpart\thesubparagraph-star-\thespel@ssect}{#5}%
@@ -1786,8 +1982,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{\linksdir/footnote-\thespel@footnote.\spel@format}{\usebox\spel@mptbox}#1}%
\spel@idxwrite{footnote}{footnote-\thespel@footnote}%
\spel@chunkwrite{footnote-\thespel@footnote}{#1}%
}
@@ -1825,10 +2022,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{\linksdir/\spel@@optpart\thesubparagraph-\thespel@chunk.\spel@format}{\usebox\spel@mptbox}#1}
% \end{macrocode}
% \end{macro}
%
@@ -1838,10 +2035,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{\linksdir/\spel@@optpart\thesubparagraph-\thespel@chunk.\spel@format}{\usebox\spel@mptbox}#2}
% \end{macrocode}
% \end{macro}
%
@@ -1855,7 +2052,7 @@
\stepcounter{spel@chunk}%
\spel@idxwrite{caption}{\spel@@optpart\thesubparagraph-\thespel@chunk}%
\spel@chunkwrite{\spel@@optpart\thesubparagraph-\thespel@chunk}{#2}%
- \spel@@caption[#1]{\protect\href{run:\audiodir/\spel@@optpart\thesubparagraph-\thespel@chunk.\spel@format}{#2}}
+ \spel@@caption[#1]{\protect\href{\linksdir/\spel@@optpart\thesubparagraph-\thespel@chunk.\spel@format}{#2}}
}
\fi
% \end{macrocode}
@@ -1868,6 +2065,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{spel@color@left}{\quad\strut\tiny\raisebox{0.4ex}{$\triangleright$}\,}}
+\newif\ifspel@chunkarealink
+\define@key{spelchunk}{arealink}[]{\spel@chunkarealinktrue}
\ifspel@disabled\def\spelchunk{}\else
\def\spelchunk{%
\catcode`\^^M=\active%
@@ -1879,7 +2081,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{\linksdir/\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{\linksdir/\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 +2099,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 +2113,48 @@
% \end{macrocode}
% \end{macro}
%
-% \subsubsection{Provideing an explicit audiodescription for a spelchunk}
+% \begin{macrocode}
+\ExplSyntaxOn
+\NewDocumentCommand{\spelchunkatom}{O{}m}{
+ \stepcounter{spel@chunk}%
+ \spel@idxwrite{chunk}{\spel@@optpart\thesubparagraph-\thespel@chunk}%
+ \setkeys{spelchunk}{#1}
+ \scantokens{
+ \makeatletter
+ \begin{spelverbatimwrite}{\chunkdir/\spel@@optpart\thesubparagraph-\thespel@chunk.tex}
+ #2
+ \end{spelverbatimwrite}
+ \makeatother
+ }
+ \ifspel@chunkarealink%
+ \href{\linksdir/\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{\linksdir/\spel@@optpart\thesubparagraph-\thespel@chunk.\spel@format}{\usebox\spel@mptbox}\input{./\chunkdir/\spel@@optpart\thesubparagraph-\thespel@chunk}%
+ \fi%
+ \spel@chunkarealinkfalse%
+}
+
+\def\spelverbatimwrite#1{%
+ \@bsphack
+ \openoutputfile{#1}{chunk}%
+ \def\verbatim@processline{\addtostream{chunk}{\the\verbatim@line}}%
+ \let\do\@makeother\dospecials
+ \catcode`\^^M\active \catcode`\^^I=12
+ \verbatim@start}%
+\def\endspelverbatimwrite{%
+ \closeoutputstream{chunk}%
+ \@esphack%
+}
+\ifspel@disabled
+ \newcommand\<<<[2][]{#2}
+\else
+ \def\<<<{\spelchunkatom}
+\fi
+\ExplSyntaxOff
+% \end{macrocode}
+%
+% \subsubsection{Explicit spelchunks}
%
% \begin{environment}{spelchunkad}
% The |spelchunkad| environment is used to override a previous speech
@@ -1930,6 +2179,7 @@
% \subsection{Helping the wizard to read our chunks}
%
% \subsubsection{Listing macros that are to be preprocessed}
+% \begin{macro}{\spelmacpp}
% Some \LaTeX{} or \TeX commands are only for layout purposes and are
% totally not content related. They do not contribute to what must be
% read. On the contrary, they make it hard for the \spelpl{} parser to
@@ -1943,7 +2193,6 @@
% oriented, it makes sense to provide a macro that registers them as
% pure type-setting macros and use that macro to cover the examples
% mentioned above.
-% \begin{macro}{\spelmacpp}
% \begin{macrocode}
\ExplSyntaxOn
\NewDocumentCommand{\spelmacpp}{moom}
@@ -1976,6 +2225,8 @@
\spelmacpp{textit}[1]{keep}
\spelmacpp{texttt}[1]{keep}
\spelmacpp{textbf}[1]{keep}
+\spelmacpp{mathbb}[1]{keep}
+\spelmacpp{mathcal}[1]{keep}
\spelmacpp{quad}{}
\spelmacpp{qquad}{}
\spelmacpp{displaystyle}{}
@@ -1992,6 +2243,7 @@
% \end{macrocode}
%
% \subsubsection{Listing environments that are to be ignored}
+% \begin{macro}{\spelenvpp}
% Some \LaTeX{} or \TeX environments are only for layout purposes and are
% totally not content related. They do not contribute to what must be
% read. On the contrary, they make it hard for the \spelpl{} parser to
@@ -2004,7 +2256,6 @@
% oriented, it makes sense to provide a macro that registers them as
% pure type-setting macros and use that macro to cover the examples
% mentioned above.
-% \begin{macro}{\spelenvpp}
% \begin{macrocode}
\ExplSyntaxOn
\NewDocumentCommand{\spelenvpp}{moom}
@@ -2052,10 +2303,9 @@
% We immediately provide some standard constructs, which are to be
% ignored:
% \begin{macrocode}
-\spelmacad{spelatex}{spee-laytech}
-\spelmacad{spelbox}{spel-box}
+\spelmacad{spelatex}{spee-lay-tech}
\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 +2357,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 +2395,55 @@
%</package>
% \end{macrocode}
% \fi
-
+%
+% \section{TODO}
+% \begin{spelchunk}[arealink]
+% As long as there are things on our 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/}.
-% \newblock online, accessed in May 2024.
+% \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{ORGMODE}
-% Org Mode --- your life in plain text.
-% \newblock \url{https://orgmode.org/}.
+% \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{OXSPELATEX}
-% Org Mode SpeLaTeX Exporter --- SpeLaTeX made easy.
-% \newblock \url{https://www.melpa.org/#/ox-spelatex}
-% \newblock (not yet online)
+% \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{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,16 +2492,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/}
-% \newblock online, accessed in May 2024.
-%
% \end{thebibliography}
%
% \Finale
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/tableof/tableof.dtx b/Master/texmf-dist/source/latex/tableof/tableof.dtx
index bd7a435cefb..bd952ec2a37 100644
--- a/Master/texmf-dist/source/latex/tableof/tableof.dtx
+++ b/Master/texmf-dist/source/latex/tableof/tableof.dtx
@@ -1,14 +1,14 @@
% -*- coding: utf-8; -*-
%<*none>
-{\def\doctimestamp {Time-stamp: <05-07-2021 14:42:11 CEST>}%
+{\def\doctimestamp {Time-stamp: <17-09-2024 10:15:25 CEST>}%
\def\getdtxtimestamp #1 <#2 #3 #4>{#2 at #3 #4}%
\xdef\tofdtxtimestamp {\expandafter\getdtxtimestamp\doctimestamp }}%
%</none>
%%
%% Package: tableof
-%% Version: 1.4c (2021/07/05)
+%% Version: 1.4d (2024/09/17)
%% License: LPPL 1.3c
-%% Copyright (C) 2012, 2013, 2015, 2018, 2021 Jean-Francois Burnol <jfbu at free dot fr>
+%% Copyright (C) 2012, 2013, 2015, 2018, 2021, 2024 Jean-Francois Burnol <jfbu at free dot fr>
%%
% See README.md for installation instructions
%
@@ -22,8 +22,8 @@
% The Author of this Work is: Jean-Francois Burnol <jfbu at free dot fr>
%<*none>
\def\pkgname {tableof}
-\def\pkgdate {2021/07/05}
-\def\pkgversion {v1.4c}
+\def\pkgdate {2024/09/17}
+\def\pkgversion {v1.4d}
\def\pkgdescription {Tables of tagged contents (JFB)}
\begingroup
\input docstrip.tex
@@ -237,11 +237,85 @@ A,B,C
% \PassOptionsToPackage{dvipdfmx-outline-open}{bookmark}
%
\makeatother
-\documentclass[a4paper,fontsize=11pt,abstract]{scrdoc}
+\documentclass[a4paper,fontsize=11pt,abstract]{scrartcl}
+\makeatletter
+%%% START OF CUSTOM doc.sty LOADING (May 21, 2022 in xint.dtx)
+%%% (August 26, 2022 in etoc.dtx, comments trimmed)
+%%% (September 17, 2024 here, some unneeded stuff removed,
+%%% I do not have time to do the syntax coloring as in etoc.pdf,
+%%% and in particular there is here no reason to use doc=v2)
+
+
+% At 1.4d I wanted to use doc v3, but hypdoc is causing too much trouble.
+% - a warning in the log about hyperref already loaded,
+% - an overwrite of my hidelinks option,
+% - an impact on placement of codeline numbers in implementation part.
+\usepackage{doc}[=v2]
+% As explained above I was formerly using scrdoc hence ltxdoc indirectly.
+% Let's emulate here the little I appear to need from ltxdoc.cls and
+% srcdoc.cls.
+%
+\AtBeginDocument{\MakeShortVerb{\|}}
+\DeclareFontShape{OT1}{cmtt}{bx}{n}{<-> ssub * cmtt/m/n}{}
+\DeclareFontFamily{OMS}{cmtt}{\skewchar\font 48} % '60
+\DeclareFontShape{OMS}{cmtt}{m}{n}{<-> ssub * cmsy/m/n}{}
+\DeclareFontShape{OMS}{cmtt}{bx}{n}{<-> ssub * cmsy/b/n}{}
+\DeclareFontShape{OT1}{cmss}{m}{it}{<->ssub*cmss/m/sl}{}
+\CodelineNumbered
+% \EnableCrossrefs % but this will be hacked
+% \setcounter{StandardModuleDepth}{1} % we don't use this mechanism currently
+\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
+% thinking I had kept this.
+\DeclareRobustCommand\cs[1]{\texttt{\bslash#1}}
+% As I may have the * active, or macro names with _ or ^, I should
+% add \detokenize. But see below for a redefinition anyhow.
+%
+% More urgent is that I am also using hyperref and this definition gives wrong
+% bookmarks if \cs is used in section titles. As I had very very few usags of
+% \cs in the whole of xint.dtx, it took me a while to realize the problem
+% here. Turns out that doc=v3 by default loads hypdoc which includes this
+% configuration for hyperref compatibility:
+\AtBeginDocument{%
+\pdfstringdefDisableCommands{\def\cs#1{\textbackslash\detokenize{#1}}}%
+}%
+% As I have not loaded hyperref yet I must delay it to AtBeginDocument.
+\providecommand\marg[1]{%
+ {\ttfamily\char`\{}\meta{#1}{\ttfamily\char`\}}}
+\providecommand\oarg[1]{%
+ {\ttfamily[}\meta{#1}{\ttfamily]}}
+\providecommand\parg[1]{%
+ {\ttfamily(}\meta{#1}{\ttfamily)}}
+% \@addtoreset{CodelineNo}{part}% No need for this here
+% \def\partname{File}% \partname is "fixed" somewhere further down anyhow
+% No need for this, anyhow I don't build the indices
+% \gdef\codeline@wrindex#1{\if@filesw
+% \begingroup
+% \let\protect\noexpand
+% \immediate\write\@indexfile
+% {\string\indexentry{#1}%
+% {\filesep\number\c@CodelineNo}}%
+% \endgroup\fi}
+% \let\filesep\@empty
+
+% There is very little we seem to need from the scrdoc extras: page geometry
+% 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*{\LuaTeX}{\hologo{LuaTeX}}%
+%
+\makeatother
+%%% end of ltxdoc+srcdoc emulation from June 2022 xint.dtx,
+%%% copied over almost verbatim to etoc.dtx on 2022/08/26,
+%%% and copied and trimmed for tableof.dtx 2024/09/17.
+
\pagestyle{headings}
\usepackage[T1]{fontenc}
\usepackage[hscale=0.66,vscale=0.76]{geometry}
-
+\usepackage{centeredline}
\usepackage{txfonts}
\DeclareFontFamily{T1}{txtt}{}
\DeclareFontShape{T1}{txtt}{m}{n}{ %medium
@@ -314,6 +388,15 @@ pdfkeywords={LaTeX, table of contents},%
pdfstartview=FitH,%
pdfpagemode=UseOutlines}
+
+% Finally 1.4d uses doc=v2
+% % Attention que hypdoc fait
+% % Package hyperref Info: Option `colorlinks' set `true' on input line 75.
+% % Package hyperref Info: Option `plainpages' set `false' on input line 75.
+% % Package hyperref Info: Option `bookmarksopen' set `true' on input line 75.
+% % Package hyperref Info: Option `bookmarksnumbered' set `true' on input line 75.
+% \AtBeginDocument{\hypersetup{hidelinks}}% fix de l'effet de hypdoc
+
\usepackage{bookmark}
\DeclareRobustCommand\csa[1]{{\ttfamily\char`\\#1}}
@@ -356,7 +439,7 @@ pdfpagemode=UseOutlines}
Package version: \pkgversion\ (\pkgdate)\\
Documentation generated from tableof.dtx
with timestamp \tofdtxtimestamp\\
- \textcopyright 2012, 2013, 2015, 2018, 2021 Jean-François Burnol
+ \textcopyright 2012, 2013, 2015, 2018, 2021, 2024 Jean-François Burnol
<jfbu (at) free (dot) fr>
\end{center}
@@ -554,10 +637,6 @@ Please consider: this command should \emph{not} be used when the
\section{Compatibility with other packages}
-\tableof checks if |hyperref| is loaded as |hyperref| modifies the format of the
-lines in the |.toc| file (and this must be taken into account). This check is
-done at the \csa{begin}|{document}| so the order of loading is not important.
-
\tableof requires the document |.toc| file to use the |\contentsline| macro
(possibly patched by other packages). It is thus incompatible with the
|beamer| class. However, if |beamer| is used in an article mode, i.e., with
@@ -585,6 +664,10 @@ tables of contents, apart from
\hangafter1 }
\makeatother
+|2024/09/17 v1.4d: |reestablish compatibility with |hyperref|,
+which got broken at the latter |v7.01c| release. The package now
+requires \LaTeX{} |2020-10-01|. Thanks to Ekkart Kleinod for report.
+
|2021/07/05 v1.4c: |ensure the added scope-limiting group for |\tableof{}|
and alike macros encompasses all contents of the |.toc| file even in presence
of packages hacking into these contents (in particular |biblatex|).
@@ -696,7 +779,7 @@ document uses standard |\tableofcontents| or like commands.
%</none>
%<*package>
% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}
+\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{atveryend}
\DeclareOption*{\PackageWarning{tableof}{Option `\CurrentOption' is unknown.}}
\ProcessOptions\relax
@@ -738,7 +821,8 @@ document uses standard |\tableofcontents| or like commands.
% macro is used to typeset the TOC, it is now the one bearing the
% responsability for creating the scope-limiting group.
% \begin{macrocode}
-\AtBeginDocument{\IfFileExists{\jobname.toc}
+\AtBeginDocument{%
+ \IfFileExists{\jobname.toc}
{{\endlinechar\m@ne
\makeatletter
\newread\tof@tf
@@ -746,7 +830,9 @@ document uses standard |\tableofcontents| or like commands.
\tof@toctoks{\tof@begingroup}%
\tof@readtoc
\global\tof@toctoks=\expandafter{\the\tof@toctoks\tof@endgroup}%
- \closein\tof@tf}}{}}
+ \closein\tof@tf}}
+ {}%
+}
% \end{macrocode}
% The trick is that |\@ifundefined| chooses the undefined branch if the
% meaning is |\relax|. Thus it is possible for \tableof to define and use
@@ -771,26 +857,39 @@ document uses standard |\tableofcontents| or like commands.
% |1.4c| replaces |{}| (last argument of |\@ifundefined|) by |\relax|. No
% strong reason. We and \etoc use |\endlinechar-1| anyhow.
% \begin{macrocode}
-\AtBeginDocument{
+\AtBeginDocument{%
\addtocontents{toc}{\string\@ifundefined{tof@begin}%
{\global\let\string\tof@begin\relax
\global\let\string\tof@finish\string\@empty
\global\let\string\tof@starttags\string\@gobble
\global\let\string\tof@stoptags\string\@gobble
\global\let\string\tof@tagthis\string\@gobble
- \global\let\string\tof@untagthis\string\@gobble}\relax}
- \addtocontents{toc}{\string\tof@begin}
+ \global\let\string\tof@untagthis\string\@gobble}\relax}%
+ \addtocontents{toc}{\string\tof@begin}%
+}
% \end{macrocode}
-% \LaTeX\ of 2020 or 2021 always has |\contentsline| with four arguments.
+% \textbf{Now obsolete hyperref-related remark (see next paragraph)}:
+% {\itshape\LaTeX\ of 2020 or 2021 always has |\contentsline| with four arguments.
% So an update should be done here to always gobble four, else in absence
% of |hyperref| some |{}| are left. Does not seem to matter a lot except
% if all is executed in math mode... thanks to \etoc for example.
-% No urgency here, only mentioning for the record.
+% No urgency here, only mentioning for the record.}
+%
+% |hyperref| stopped defining its |\hyper@last| at its |7.01c| release in fall
+% of 2023, but \tableof tested for it, if |hyperref| was found to be present,
+% in case a document previously not using |hyperref| started using it on
+% second compilation, hence with a wrong |.toc| file format (in earlier
+% years). As \tableof was doing
+% \centeredline{|\ifx\hyper@last\@undefined\tof@toctoks{}\fi|} it now
+% unconditionally emptied |\tof@toctoks| in presence of |hyperref|. This is
+% the same problem which impacted \etoc and got fixed at its |1.2c| release
+% but unfortunately \tableof was not updated then. Belatedly fixed at |1.4d|
+% of |2024/09/17|.
+%
+% Formerly this was a short macro, but it doesn't look like a problem
+% to simply alias it to the long |\@gobblefour|.
% \begin{macrocode}
- \@ifpackageloaded{hyperref}
- {\def\tof@gobblethree@orfour#1#2#3#4{}%
- \ifx\hyper@last\@undefined\tof@toctoks{}\fi}
- {\def\tof@gobblethree@orfour#1#2#3{}}}
+\let\tof@gobblethree@orfour\@gobblefour
% \end{macrocode}
% |1.4b| (belatedly) fixes issue with |\tof@finish| getting lost due
% to a final |\clearpage| before |\end{document}|. Indeed, formerly
@@ -999,24 +1098,6 @@ document uses standard |\tableofcontents| or like commands.
\endinput
% \end{macrocode}
% \MakePercentComment
-\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 \~}
-
-\CheckSum{559}
-
\Finale
%%
%% End of file `tableof.dtx'.
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 7e19e1e90f7..f21c1804ecb 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.99c, released 2024-06-20}
+% \date{Version 0.99f, released 2024-09-16}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*luatex>
-\ProvidesExplFile {tagpdf-luatex.def} {2024-06-20} {0.99c}
+\ProvidesExplFile {tagpdf-luatex.def} {2024-09-16} {0.99f}
{tagpdf~driver~for~luatex}
% \end{macrocode}
% \section{Loading the lua}
@@ -85,6 +85,7 @@
% \@@_seq_new:N,
% \@@_prop_gput:Nnn,
% \@@_seq_gput_right:Nn,
+% \@@_seq_gput_left:Nn,
% \@@_seq_item:cn,
% \@@_prop_item:cn,
% \@@_seq_show:N,
@@ -114,7 +115,7 @@
\cs_set_protected:Npn \@@_prop_gput:Nnn #1 #2 #3
{
\prop_gput:Nnn #1 { #2 } { #3 }
- \lua_now:e { ltx.@@.tables.\cs_to_str:N#1 ["#2"] = "#3" }
+ \lua_now:e { ltx.@@.tables.\cs_to_str:N#1 ["#2"] = "\lua_escape:n{#3}" }
}
@@ -123,9 +124,18 @@
\seq_gput_right:Nn #1 { #2 }
\lua_now:e { table.insert(ltx.@@.tables.\cs_to_str:N#1, "#2") }
}
-
+% \end{macrocode}
+%
+% this inserts on the right of the lua table, but as the lua table is not used for kids
+% this is ignored for now.
+% \begin{macrocode}
+\cs_set_protected:Npn \@@_seq_gput_left:Nn #1 #2
+ {
+ \seq_gput_left:Nn #1 { #2 }
+ \lua_now:e { table.insert(ltx.@@.tables.\cs_to_str:N#1, "#2") }
+ }
+
%Hm not quite sure about the naming
-
\cs_set:Npn \@@_seq_item:cn #1 #2
{
\lua_now:e { tex.print(ltx.@@.tables.#1[#2]) }
@@ -164,8 +174,8 @@
local ProvidesLuaModule = {
name = "tagpdf",
- version = "0.99c", --TAGVERSION
- date = "2024-06-20", --TAGDATE
+ version = "0.99f", --TAGVERSION
+ date = "2024-09-16", --TAGDATE
description = "tagpdf lua code",
license = "The LATEX Project Public License 1.3c"
}
@@ -252,6 +262,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 +302,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}
@@ -1267,6 +1286,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 345b2e35bad..5ade1ff427f 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.99c, released 2024-06-20}
+% \date{Version 0.99f, released 2024-09-16}
% \maketitle
% \begin{documentation}
% \section{Commands}
@@ -331,11 +331,12 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-checks-code} {2024-06-20} {0.99c}
+\ProvidesExplPackage {tagpdf-checks-code} {2024-09-16} {0.99f}
{part of tagpdf - code related to checks, conditionals, debugging and messages}
%</header>
% \end{macrocode}
% \section{Messages}
+%
% \subsection{Messages related to mc-chunks}
% \begin{macro}{mc-nested}
% This message is issue is a mc is opened before the previous has been closed.
@@ -454,6 +455,18 @@
{ closing~structure~#1~tagged~\use:e{\prop_item:cn{g_@@_struct_#1_prop}{S}} }
% \end{macrocode}
% \end{macro}
+%
+% \begin{macro}{struct-Ref-unknown}
+% This message is issued at the end, when the Ref keys are updated.
+% TODO: in debug mode it should report more info about the structure.
+% \begin{macrocode}
+\msg_new:nnn { tag } {struct-Ref-unknown}
+ {
+ #1~has~no~related~structure.\\
+ /Ref~not~updated.
+ }
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{tree-struct-still-open}
% Message issued at the end if there are beside Root other
% open structures on the stack.
@@ -752,7 +765,7 @@
\cs_new_protected:Npn \@@_check_struct_used:n #1 %#1 label
{
\prop_get:cnNT
- {g_@@_struct_\@@_property_ref:enn{tagpdfstruct-#1}{tagstruct}{unknown}_prop}
+ {g_@@_struct_\property_ref:enn{tagpdfstruct-#1}{tagstruct}{unknown}_prop}
{P}
\l_@@_tmpa_tl
{
@@ -940,7 +953,7 @@
{
\int_compare:nT
{
- \@@_property_ref:enn
+ \property_ref:enn
{mcid-####1}
{tagabspage}
{-1}
@@ -951,7 +964,7 @@
\seq_gput_right:Ne \l_tmpa_seq
{
Page##1-####1-
- \@@_property_ref:enn
+ \property_ref:enn
{mcid-####1}
{tagmcid}
{-1}
@@ -1124,24 +1137,24 @@
}
}
% \end{macrocode}
-% This tracks tag stop and start.
-% The tag-stop message should go before the int is increased.
-% The tag-start message after the int is decreased.
+% This tracks tag suspend and resume.
+% The tag-suspend message should go before the int is increased.
+% The tag-resume message after the int is decreased.
% \begin{macrocode}
-\msg_new:nnn { tag / debug } {tag-stop}
+\msg_new:nnn { tag / debug } {tag-suspend}
{
\int_if_zero:nTF
{#1}
- {Tagging~stopped}
- {Tagging~(not)~stopped~(already~inactive)}\\
+ {Tagging~suspended}
+ {Tagging~(not)~suspended~(already~inactive)}\\
level:~#1~==>~\int_eval:n{#1+1}\tl_if_empty:nF{#2}{,~label:~#2}~[\msg_line_context:]
}
-\msg_new:nnn { tag / debug } {tag-start}
+\msg_new:nnn { tag / debug } {tag-resume}
{
\int_if_zero:nTF
{#1}
- {Tagging~restarted}
- {Tagging~(not)~restarted}\\
+ {Tagging~resumed}
+ {Tagging~(not)~resumed}\\
level:~\int_eval:n{#1+1}~==>~#1\tl_if_empty:nF{#2}{,~label:~#2}~[\msg_line_context:]
}
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx
index f07e5db3edc..7bff6b5d158 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.99c, released 2024-06-20}
+% \date{Version 0.99f, released 2024-09-16}
% \maketitle
% \begin{documentation}
% This files contains a various data files which are read in
@@ -61,7 +61,7 @@
% latex-lab has also a namespace module, which takes precedence!
% \begin{macrocode}
%<*ns-latex>
-%% \ProvidesExplFile {tagpdf-ns-latex.def} {2024-06-20} {0.99c}
+%% \ProvidesExplFile {tagpdf-ns-latex.def} {2024-09-16} {0.99f}
%% {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-06-20} {0.99c}
+%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2024-09-16} {0.99f}
%% {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-06-20} {0.99c}
+%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2024-09-16} {0.99f}
%% {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-06-20} {0.99c}
+%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2024-09-16} {0.99f}
%% {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-06-20} {0.99c}
+%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2024-09-16} {0.99f}
% {mathml}{http://www.w3.org/1998/Math/MathML}{}
abs,abs,mathml,
and,and,mathml,
@@ -467,7 +467,7 @@ xor,xor,mathml,
% This will perhaps change in future.
% \begin{macrocode}
%<*parent-child>
-%% \ProvidesExplFile {tagpdf-parent-child.csv} {2024-06-20} {0.99c}
+%% \ProvidesExplFile {tagpdf-parent-child.csv} {2024-09-16} {0.99f}
,,,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-06-20} {0.99c}
+%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2024-09-16} {0.99f}
,,,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 0cef27fd3b8..f10752d2963 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.99c, released 2024-06-20}
+% \date{Version 0.99f, released 2024-09-16}
% \maketitle
% \begin{documentation}
% \end{documentation}
@@ -55,11 +55,11 @@
% \begin{macrocode}
%<@@=tag>
%<*generic>
-\ProvidesExplPackage {tagpdf-mc-code-generic} {2024-06-20} {0.99c}
+\ProvidesExplPackage {tagpdf-mc-code-generic} {2024-09-16} {0.99f}
{part of tagpdf - code related to marking chunks - generic mode}
%</generic>
%<*debug>
-\ProvidesExplPackage {tagpdf-debug-generic} {2024-06-20} {0.99c}
+\ProvidesExplPackage {tagpdf-debug-generic} {2024-09-16} {0.99f}
{part of tagpdf - debugging code related to marking chunks - generic mode}
%</debug>
% \end{macrocode}
@@ -573,14 +573,14 @@
% \end{macrocode}
% revert the attribute:
% \begin{macrocode}
- \@@_property_gset:nnnn {tagmcid } { now }
+ \property_gset:nnnn {tagmcid } { now }
{0} { \int_use:N \g_@@_MCID_tmp_bypage_int }
\cs_new_protected:Npn \@@_mc_bdc_mcid:nn #1 #2
{
\int_gincr:N \c@g_@@_MCID_abs_int
\tl_set:Ne \l_@@_mc_ref_abspage_tl
{
- \@@_property_ref:enn %3 args
+ \property_ref:enn %3 args
{
mcid-\int_use:N \c@g_@@_MCID_abs_int
}
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 7dd309c5f53..5b41c883ed1 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.99c, released 2024-06-20}
+% \date{Version 0.99f, released 2024-09-16}
% \maketitle
% \begin{implementation}
% The code is split into three parts: code shared by all engines,
@@ -86,11 +86,11 @@
% \begin{macrocode}
%<@@=tag>
%<*luamode>
-\ProvidesExplPackage {tagpdf-mc-code-lua} {2024-06-20} {0.99c}
+\ProvidesExplPackage {tagpdf-mc-code-lua} {2024-09-16} {0.99f}
{tagpdf - mc code only for the luamode }
%</luamode>
%<*debug>
-\ProvidesExplPackage {tagpdf-debug-lua} {2024-06-20} {0.99c}
+\ProvidesExplPackage {tagpdf-debug-lua} {2024-09-16} {0.99f}
{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 c96fd8c4c81..c8b7d1a5e81 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.99c, released 2024-06-20}
+% \date{Version 0.99f, released 2024-09-16}
% \maketitle
% \begin{documentation}
% \section{Public Commands}
@@ -181,7 +181,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-mc-code-shared} {2024-06-20} {0.99c}
+\ProvidesExplPackage {tagpdf-mc-code-shared} {2024-09-16} {0.99f}
{part of tagpdf - code related to marking chunks -
code shared by generic and luamode }
%</header>
@@ -328,7 +328,7 @@
{
\@@_check_if_active_struct:T
{
- \tl_set:Ne \l_@@_tmpa_tl { \@@_property_ref:nnn{tagpdf-#1}{tagmcabs}{} }
+ \tl_set:Ne \l_@@_tmpa_tl { \property_ref:nnn{tagpdf-#1}{tagmcabs}{} }
\tl_if_empty:NTF\l_@@_tmpa_tl
{
\msg_warning:nnn {tag} {mc-label-unknown} {#1}
@@ -365,12 +365,12 @@
\tag_mc_end_push:
\tag_mc_begin:n {artifact=#1}
\group_begin:
- \tag_stop:n{artifact-group}
+ \tag_suspend:n{artifact-group}
}
\cs_set_protected:Npn \tag_mc_artifact_group_end:
{
- \tag_start:n{artifact-group}
+ \tag_resume:n{artifact-group}
\group_end:
\tag_mc_end:
\tag_mc_begin_pop:n{}
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx
index 80f9da0f6bd..d29c328b2e7 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.99c, released 2024-06-20}
+% \date{Version 0.99f, released 2024-09-16}
% \maketitle
% \begin{documentation}
% \begin{function}
@@ -98,7 +98,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-roles-code} {2024-06-20} {0.99c}
+\ProvidesExplPackage {tagpdf-roles-code} {2024-09-16} {0.99f}
{part of tagpdf - code related to roles and structure names}
%</header>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx
index a29c8f0fb3d..e0aa2e09d78 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.99c, released 2024-06-20}
+% \date{Version 0.99f, released 2024-09-16}
% \maketitle
% \begin{documentation}
% \begin{function}{activate/space (setup-key),interwordspace (deprecated)}
@@ -66,7 +66,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-space-code} {2024-06-20} {0.99c}
+\ProvidesExplPackage {tagpdf-space-code} {2024-09-16} {0.99f}
{part of tagpdf - code related to real space chars}
%</header>
% \end{macrocode}
@@ -78,6 +78,7 @@
% \begin{macro}{activate/spaces (setup-key),interwordspace (deprecated),show-spaces (deprecated)}
% \begin{macrocode}
%<*package>
+\bool_new:N\l_@@_showspaces_bool
\keys_define:nn { @@ / setup }
{
activate/spaces .choice:,
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx
index 963852b1fca..f656b916861 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx
@@ -27,6 +27,7 @@
\usepackage{array,booktabs,caption}
\hypersetup{pdfauthor=Ulrike Fischer,
pdftitle=tagpdf-tree module (tagpdf)}
+\input{tagpdf-docelements}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -46,7 +47,7 @@
% }^^A
% }
%
-% \date{Version 0.99c, released 2024-06-20}
+% \date{Version 0.99f, released 2024-09-16}
% \maketitle
% \begin{documentation}
% \section{Public Commands}
@@ -120,10 +121,22 @@
% the third the value. Currently the only keyword is \texttt{ref} which updates
% the Ref key (an array)
% \end{function}
+%
+% \begin{function}{\tag_struct_gput_ref:nnn}
+% \begin{syntax}
+% \cs{tag_struct_gput_ref:nnn}\Arg{structure number}\Arg{keyword}\Arg{value}
+% \end{syntax}
+% This is an user interface to add a Ref key to an
+% existing structure. The target structure doesn't have to exist yet
+% but can be addressed by label, destname or even num.
+% \meta{keyword} is currently either \texttt{label}, \texttt{dest}
+% or \texttt{num}. The value is then either a label name, the name of a destination
+% or a structure number.
+% \end{function}
%
% \section{Public keys}
% \subsection{Keys for the structure commands}
-% \begin{function}{tag (struct-key)}
+% \begin{structkeydecl}{tag}
% This is required. The value of the key is normally one of the
% standard types listed in the main tagpdf documentation.
% It is possible to setup new tags/types.
@@ -132,15 +145,15 @@
% Currently the names spaces |pdf|, |pdf2|, |mathml| and |user| are defined.
% This allows to use a different name space than
% the one connected by default to the tag. But normally this should not be needed.
-% \end{function}
-% \begin{function}{stash (struct-key)}
+% \end{structkeydecl}
+% \begin{structkeydecl}{stash}
% Normally a new structure inserts itself as a kid
% into the currently active structure. This key prohibits this.
% The structure is nevertheless from now on
% \enquote{the current active structure}
% and parent for following marked content and structures.
-% \end{function}
-% \begin{function}{label (struct-key)}
+% \end{structkeydecl}
+% \begin{structkeydecl}{label}
% This key sets a label by which
% one can refer to the structure. It is e.g.
% used by \cs{tag_struct_use:n} (where a real label is actually not
@@ -149,55 +162,63 @@
% Internally the label name will start with \texttt{tagpdfstruct-} and it stores
% the two attributes |tagstruct| (the structure number) and |tagstructobj| (the
% object reference).
-% \end{function}
-% \begin{function}{parent (struct-key)}
+% \end{structkeydecl}
+% \begin{structkeydecl}{parent}
% By default a structure is added as kid to the currently active structure.
% With the parent key one can choose another parent. The value is a structure number which
% must refer to an already existing, previously created structure. Such a structure
% number can for example be have been stored with \cs{tag_get:n}, but one can also use
% a label on the parent structure and then use
% \cs{property_ref:nn}|{tagpdfstruct-label}{tagstruct}| to retrieve it.
-% \end{function}
-% \begin{function}{title (struct-key),title-o (struct-key)}
+% \end{structkeydecl}
+% \begin{structkeydecl}{firstkey}
+% If this key is used the structure is added at the left of the kids of
+% the parent structure (if the structure is not stashed).
+% This means that it will be the first kid of the structure
+% (unless some later structure uses the key too).
+% \end{structkeydecl}
+% \begin{structkeydecl}{title,title-o}
% This keys allows to set the dictionary entry
% \texttt{/Title} in the structure object.
% The value is handled as verbatim string and hex encoded.
% Commands are not expanded. |title-o| will expand the value once.
-% \end{function}
+% \end{structkeydecl}
%
-% \begin{function}{alt (struct-key)}
+% \begin{structkeydecl}{alt}
% This key inserts an \texttt{/Alt} value in the dictionary of structure object.
% The value is handled as verbatim string and hex encoded.
% The value will be expanded first once. If it is empty, nothing will happen.
-% \end{function}
-% \begin{function}{actualtext (struct-key)}
+% \end{structkeydecl}
+% \begin{structkeydecl}{actualtext}
% This key inserts an \texttt{/ActualText} value in the dictionary of structure object.
% The value is handled as verbatim string and hex encoded.
% The value will be expanded first once. If it is empty, nothing will happen.
-% \end{function}
-% \begin{function}{lang (struct-key)}
+% \end{structkeydecl}
+% \begin{structkeydecl}{lang}
% This key allows to set the language for a structure element. The value should be a bcp-identifier,
% e.g. |de-De|.
-% \end{function}
-% \begin{function}{ref (struct-key)}
+% \end{structkeydecl}
+% \begin{structkeydecl}{ref}
% This key allows to add references to other structure elements,
% it adds the |/Ref| array to the structure.
% The value should be a comma separated list of structure labels
% set with the |label| key. e.g. |ref={label1,label2}|.
-% \end{function}
-% \begin{function}{E (struct-key)}
+% \end{structkeydecl}
+% \begin{structkeydecl}{E}
% This key sets the |/E| key, the expanded form of an
% abbreviation or an acronym
% (I couldn't think of a better name, so I sticked to E).
-% \end{function}
-% \begin{function}{AF (struct-key),AFref (struct-key),
-% AFinline (struct-key),AFinline-o (struct-key),texsource,mathml}
+% \end{structkeydecl}
+% \begin{structkeydecl}{AF,AFref,
+% AFinline,AFinline-o,texsource,mathml}
+% These keys handle associated files in the structure element.
+%
% \begin{syntax}
% AF = \meta{object name}\\
% AFref = \meta{object reference}\\
% AF-inline = \meta{text content}\\
% \end{syntax}
-% These keys allows to reference an associated file in the structure element.
+%
% The value \meta{object name} should be the name of an object pointing
% to the \texttt{/Filespec} dictionary as expected by
% |\pdf_object_ref:n| from a current \texttt{l3kernel}.
@@ -209,15 +230,16 @@
% Future versions will perhaps extend this to more mime types, but it is
% still a research task to find out what is really needed.
%
-% |texsource| is a special variant of |AF-inline-o| which embeds the file
-% as |.tex| source with the |/AFrelationship| key set to |/Source|. It also sets the |/Desc| key
-% to a (currently) fix text.
+% |texsource| is a special variant of |AF-inline-o| which embeds the content
+% as |.tex| source with the |/AFrelationship| key set to |/Source|.
+% It also sets the |/Desc| key to a (currently) fix text.
%
-% |mathml| is a special variant of |AF-inline-o| which embeds the file
+% |mathml| is a special variant of |AF-inline-o| which embeds the content
% as |.xml| file with the |/AFrelationship| key set to |/Supplement|.
% It also sets the |/Desc| key to a (currently) fix text.
%
-% The argument of |AF| is an object name referring an embedded file as declared for example with
+% The argument of |AF| is an object name referring an embedded file as declared
+% for example with
% \cs{pdf_object_new:n} or with the l3pdffile module. |AF| expands its argument
% (this allows e.g. to use some variable for automatic numbering)
% and can be used more than once, to associate more than one file.
@@ -231,9 +253,9 @@
% does not check if the reference is valid!}
%
% The inline keys can be used only once per structure. Additional calls are ignored.
-% \end{function}
+% \end{structkeydecl}
%
-% \begin{function}{attribute (struct-key)}
+% \begin{structkeydecl}{attribute}
% This key takes as argument a comma list of attribute names
% (use braces to protect the commas from the external key-val parser)
% and allows to add one or more attribute dictionary entries in
@@ -243,16 +265,17 @@
% \end{verbatim}
% Attribute names and their content must be declared first in \cs{tagpdfsetup}.
%
-% \end{function}
+% \end{structkeydecl}
%
-% \begin{function}{attribute-class (struct-key)}
+% \begin{structkeydecl}{attribute-class}
% This key takes as argument a comma list of attribute class names
% (use braces to protect the commas from the external key-val parser)
% and allows to add one or more attribute classes to the structure object.
%
% Attribute class names and their content
% must be declared first in \cs{tagpdfsetup}.
-% \end{function}
+% \end{structkeydecl}
+%
% \subsection{Setup keys}
% \begin{function}{role/new-attribute (setup-key), newattribute (deprecated)}
% \begin{syntax}
@@ -272,20 +295,20 @@
% \end{verbatim}
%
% \end{function}
-% \begin{function}{root-AF (setup-key)}
+% \begin{setupkeydecl}{root-AF}
% \begin{syntax}
% root-AF = \meta{object name}
% \end{syntax}
% This key can be used in the setup command \cs{tagpdfsetup} and allows
% to add associated files to the root structure. Like |AF| it can be used more than
% once to add more than one file.
-% \end{function}
+% \end{setupkeydecl}
% \end{documentation}
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-struct-code} {2024-06-20} {0.99c}
+\ProvidesExplPackage {tagpdf-struct-code} {2024-09-16} {0.99f}
{part of tagpdf - code related to storing structure}
%</header>
% \end{macrocode}
@@ -442,12 +465,16 @@
\tl_new:N \l_@@_struct_roletag_NS_tl
% \end{macrocode}
% \end{variable}
-% \begin{variable}{\l_@@_struct_key_label_tl}
-% This will hold the label value.
+% \begin{variable}{\g_@@_struct_label_num_prop}
+% This will hold for every structure label the associated
+% structure number. The prop will allow to
+% fill the /Ref key directly at the first compilation if the ref
+% key is used.
% \begin{macrocode}
-\tl_new:N \l_@@_struct_key_label_tl
+\prop_new_linked:N \g_@@_struct_label_num_prop
% \end{macrocode}
% \end{variable}
+
% \begin{variable}{\l_@@_struct_elem_stash_bool}
% This will keep track of the stash status
% \begin{macrocode}
@@ -455,6 +482,15 @@
% \end{macrocode}
% \end{variable}
%
+% \begin{variable}{\l_@@_struct_addkid_tl}
+% This decides if a structure kid is added at the left or right of the parent.
+% The default is \texttt{right}.
+% \begin{macrocode}
+\tl_new:N \l_@@_struct_addkid_tl
+\tl_set:Nn \l_@@_struct_addkid_tl {right}
+% \end{macrocode}
+% \end{variable}
+
% \subsection{Variables used by tagging code of basic elements}
%
% \begin{variable}{\g_@@_struct_dest_num_prop}
@@ -696,16 +732,17 @@
/Type \c_space_tl /MCR \c_space_tl
/Pg
\c_space_tl
- \pdf_pageobject_ref:n { \@@_property_ref:enn{mcid-#1}{tagabspage}{1} }
- /MCID \c_space_tl \@@_property_ref:enn{mcid-#1}{tagmcid}{1}
+ \pdf_pageobject_ref:n { \property_ref:enn{mcid-#1}{tagabspage}{1} }
+ /MCID \c_space_tl \property_ref:enn{mcid-#1}{tagmcid}{1}
>>
}
%</package>
% \end{macrocode}
% \begin{macrocode}
%<*package|debug>
-%<package>\cs_new_protected:Npn \@@_struct_kid_mc_gput_right:nn #1 #2 %#1 structure num, #2 MCID absnum%
-%<debug>\cs_set_protected:Npn \@@_struct_kid_mc_gput_right:nn #1 #2 %#1 structure num, #2 MCID absnum%
+%<package>\cs_new_protected:Npn \@@_struct_kid_mc_gput_right:nn #1 #2
+%<debug>\cs_set_protected:Npn \@@_struct_kid_mc_gput_right:nn #1 #2
+%#1 structure num, #2 MCID absnum%
{
\@@_seq_gput_right:ce
{ g_@@_struct_kids_#1_seq }
@@ -733,8 +770,9 @@
% This commands adds a structure as kid. We only need to record the object
% reference in the sequence.
% \begin{macrocode}
-%<package>\cs_new_protected:Npn\@@_struct_kid_struct_gput_right:nn #1 #2 %#1 num of parent struct, #2 kid struct
-%<debug>\cs_set_protected:Npn\@@_struct_kid_struct_gput_right:nn #1 #2 %#1 num of parent struct, #2 kid struct
+%<package>\cs_new_protected:Npn\@@_struct_kid_struct_gput_right:nn #1 #2
+%<debug>\cs_set_protected:Npn\@@_struct_kid_struct_gput_right:nn #1 #2
+%%#1 num of parent struct, #2 kid struct
{
\@@_seq_gput_right:ce
{ g_@@_struct_kids_#1_seq }
@@ -747,10 +785,35 @@
%<debug> Struct~#2
%<debug> }
}
-
%<package>\cs_generate_variant:Nn \@@_struct_kid_struct_gput_right:nn {ee}
% \end{macrocode}
% \end{macro}
+% \begin{macro}
+% {
+% \@@_struct_kid_struct_gput_left:nn,\@@_struct_kid_struct_gput_left:ee
+% }
+% This commands adds a structure as kid one the left, so as first
+% kid. We only need to record the object reference in the sequence.
+% \begin{macrocode}
+%<package>\cs_new_protected:Npn\@@_struct_kid_struct_gput_left:nn #1 #2
+%<debug>\cs_set_protected:Npn\@@_struct_kid_struct_gput_left:nn #1 #2
+%%#1 num of parent struct, #2 kid struct
+ {
+ \@@_seq_gput_left:ce
+ { g_@@_struct_kids_#1_seq }
+ {
+ \pdf_object_ref_indexed:nn { @@/struct }{ #2 }
+ }
+%<debug> \seq_gput_left:cn
+%<debug> { g_@@_struct_debug_kids_#1_seq }
+%<debug> {
+%<debug> Struct~#2
+%<debug> }
+ }
+%<package>\cs_generate_variant:Nn \@@_struct_kid_struct_gput_left:nn {ee}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}
% {\@@_struct_kid_OBJR_gput_right:nnn,\@@_struct_kid_OBJR_gput_right:eee}
% At last the command to add an OBJR object. This has to write an object first.
@@ -759,10 +822,11 @@
% object reference
%
% \begin{macrocode}
-%<package>\cs_new_protected:Npn\@@_struct_kid_OBJR_gput_right:nnn #1 #2 #3 %#1 num of parent struct,
-%<package> %#2 obj reference
-%<package> %#3 page object reference
+%<package>\cs_new_protected:Npn\@@_struct_kid_OBJR_gput_right:nnn #1 #2 #3
+%<package>
+%<package>
%<debug>\cs_set_protected:Npn\@@_struct_kid_OBJR_gput_right:nnn #1 #2 #3
+%%#1 num of parent struct,#2 obj reference,#3 page object reference
{
\pdf_object_unnamed_write:nn
{ dict }
@@ -907,34 +971,47 @@
\tl_clear:N #2
\prop_map_inline:cn { g_@@_struct_#1_prop }
{
- \tl_put_right:Ne #2
- {
% \end{macrocode}
% Some keys needs the option to format the value, e.g. add brackets for an
% array, we also need the option to ignore some entries in the properties.
-% \begin{macrocode}
- \cs_if_exist_use:cTF {@@_struct_format_##1:nn}
- {{##1}{##2}}
- {\c_space_tl/##1~##2}
+% \begin{macrocode}
+ \cs_if_exist_use:cTF {@@_struct_format_##1:nnN}
+ {
+ {##1}{##2}#2
}
- }
+ {
+ \tl_put_right:Ne #2 { \c_space_tl/##1~##2 }
+ }
+ }
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_struct_format_rolemap:nn,\@@_struct_format_parentrole:nn}
+% \begin{macro}{\@@_struct_format_rolemap:nnN,\@@_struct_format_parentrole:nnN}
% This two entries should not end in the PDF.
% \begin{macrocode}
-\cs_new:Nn\@@_struct_format_rolemap:nn{}
-\cs_new:Nn\@@_struct_format_parentrole:nn{}
+\cs_new:Nn\@@_struct_format_rolemap:nnN{}
+\cs_new:Nn\@@_struct_format_parentrole:nnN{}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\@@_struct_format_Ref:nn}
-% Ref is an array, we store only the content to be able to extend it
-% so the formatting command adds the brackets:
+% \begin{macro}{\@@_struct_format_Ref:nnN}
+% Ref is an array, we store values as a clist of commands that must
+% be executed here, the formatting has to add also brackets.
+%
% \begin{macrocode}
-\cs_new:Nn\__tag_struct_format_Ref:nn{\c_space_tl/#1~[#2]}
+\cs_new_protected:Nn\@@_struct_format_Ref:nnN
+ {
+ \tl_put_right:Nn #3 { ~/#1~[ } %]
+ \clist_map_inline:nn{ #2 }
+ {
+ ##1 #3
+ }
+ \tl_put_right:Nn #3
+ { %[
+ \c_space_tl]
+ }
+ }
% \end{macrocode}
% \end{macro}
% \begin{macro}{\@@_struct_write_obj:n}
@@ -953,7 +1030,8 @@
% \begin{macrocode}
\prop_get:cnNF { g_@@_struct_#1_prop } {P}\l_@@_tmpb_tl
{
- \prop_gput:cne { g_@@_struct_#1_prop } {P}{\pdf_object_ref_indexed:nn { @@/struct }{1}}
+ \prop_gput:cne { g_@@_struct_#1_prop } {P}
+ {\pdf_object_ref_indexed:nn { @@/struct }{1}}
\prop_gput:cne { g_@@_struct_#1_prop } {S}{/Artifact}
\seq_if_empty:cF {g_@@_struct_kids_#1_seq}
{
@@ -1005,8 +1083,9 @@
% \tag_struct_end:
% \end{verbatim}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_struct_insert_annot:nn #1 #2 %#1 object reference to the annotation/xform
- %#2 structparent number
+\cs_new_protected:Npn \@@_struct_insert_annot:nn #1 #2
+ %#1 object reference to the annotation/xform
+ %#2 structparent number
{
\bool_if:NT \g_@@_active_struct_bool
{
@@ -1028,7 +1107,8 @@
#1 %
}
{
- \pdf_pageobject_ref:n { \@@_property_ref:nnn {@tag@objr@page@#2 }{ tagabspage }{1} }
+ \pdf_pageobject_ref:n
+ { \property_ref:nnn {@tag@objr@page@#2 }{ tagabspage }{1} }
}
% add the parent obj number to the parent tree:
\exp_args:Nne
@@ -1037,7 +1117,8 @@
#2
}
{
- \pdf_object_ref_indexed:nn { @@/struct }{ \l_@@_struct_stack_parent_tmpa_tl }
+ \pdf_object_ref_indexed:nn
+ { @@/struct }{ \l_@@_struct_stack_parent_tmpa_tl }
}
% increase the int:
\int_gincr:N \c@g_@@_parenttree_obj_int
@@ -1112,7 +1193,8 @@
\socket_new:nn { tag/struct/tag }{1}
\socket_new_plug:nnn { tag/struct/tag }{ latex-tags }
{
- \seq_set_split:Nne \l_@@_tmpa_seq { / } {#1/\prop_item:Ne\g__tag_role_tags_NS_prop{#1}}
+ \seq_set_split:Nne \l_@@_tmpa_seq { / }
+ {#1/\prop_item:Ne\g__tag_role_tags_NS_prop{#1}}
\tl_gset:Ne \g_@@_struct_tag_tl { \seq_item:Nn\l_@@_tmpa_seq {1} }
\tl_gset:Ne \g_@@_struct_tag_NS_tl{ \seq_item:Nn\l_@@_tmpa_seq {2} }
\@@_check_structure_tag:N \g_@@_struct_tag_tl
@@ -1120,10 +1202,12 @@
\socket_new_plug:nnn { tag/struct/tag }{ pdf-tags }
{
- \seq_set_split:Nne \l_@@_tmpa_seq { / } {#1/\prop_item:Ne\g_@@_role_tags_NS_prop{#1}}
+ \seq_set_split:Nne \l_@@_tmpa_seq { / }
+ {#1/\prop_item:Ne\g_@@_role_tags_NS_prop{#1}}
\tl_gset:Ne \g_@@_struct_tag_tl { \seq_item:Nn\l_@@_tmpa_seq {1} }
\tl_gset:Ne \g_@@_struct_tag_NS_tl{ \seq_item:Nn\l_@@_tmpa_seq {2} }
- \@@_role_get:VVNN \g_@@_struct_tag_tl\g_@@_struct_tag_NS_tl\l_@@_tmpa_tl\l_@@_tmpb_tl
+ \@@_role_get:VVNN
+ \g_@@_struct_tag_tl \g_@@_struct_tag_NS_tl \l_@@_tmpa_tl \l_@@_tmpb_tl
\tl_gset:Ne \g_@@_struct_tag_tl {\l_@@_tmpa_tl}
\tl_gset:Ne \g_@@_struct_tag_NS_tl{\l_@@_tmpb_tl}
\@@_check_structure_tag:N \g_@@_struct_tag_tl
@@ -1131,24 +1215,32 @@
\socket_assign_plug:nn { tag/struct/tag } {latex-tags}
% \end{macrocode}
-% \begin{macro}
+% \begin{structkeydecl}
% {
-% label (struct-key),
-% stash (struct-key),
-% parent (struct-key),
-% tag (struct-key),
-% title (struct-key),
-% title-o (struct-key),
-% alt (struct-key),
-% actualtext (struct-key),
-% lang (struct-key),
-% ref (struct-key),
-% E (struct-key)
+% label,
+% stash,
+% parent,
+% firstkid,
+% tag,
+% title,
+% title-o,
+% alt,
+% actualtext,
+% lang,
+% ref,
+% E
% }
% \begin{macrocode}
\keys_define:nn { @@ / struct }
{
- label .tl_set:N = \l_@@_struct_key_label_tl,
+ label .code:n =
+ {
+ \prop_gput:Nee\g_@@_struct_label_num_prop
+ {#1}{\int_use:N \c@g_@@_struct_abs_int}
+ \@@_property_record:eV
+ {tagpdfstruct-#1}
+ \c_@@_property_struct_clist
+ },
stash .bool_set:N = \l_@@_struct_elem_stash_bool,
parent .code:n =
{
@@ -1166,7 +1258,8 @@
{ parent~key~ignored }
}
},
- parent .default:n = {-1},
+ parent .default:n = {-1},
+ firstkid .code:n = { \tl_set:Nn \l_@@_struct_addkid_tl {left} },
tag .code:n = % S property
{
\socket_use:nn { tag/struct/tag }{#1}
@@ -1233,19 +1326,77 @@
{ Lang }
{ (#1) }
},
+ }
% \end{macrocode}
-% Ref is an array, the brackets are added through the formatting command.
+% \end{structkeydecl}
+% Ref is rather special as it values are often
+% known only at the end of the document.
+% It therefore stores it values as
+% clist of commands which are executed at the end of the document,
+% when the structure elements are written.
+% \begin{macro}{\@@_struct_Ref_obj:nN,\@@_struct_Ref_label:nN,
+% \@@_struct_Ref_dest:nN,\@@_struct_Ref_num:nN}
+% this commands are helper commands that are stored as clist
+% in the Ref key of a structure. They are executed when the structure
+% elements are written in \cs{@@_struct_write_obj}. They are used
+% in \cs{@@_struct_format_Ref}. They allow to add a Ref by object reference,
+% label, destname and structure number
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_struct_Ref_obj:nN #1 #2 %#1 a object reference
+ {
+ \tl_put_right:Ne#2
+ {
+ \c_space_tl#1
+ }
+ }
+
+\cs_new_protected:Npn \@@_struct_Ref_label:nN #1 #2 %#1 a label
+ {
+ \prop_get:NnNTF \g_@@_struct_label_num_prop {#1} \l_@@_tmpb_tl
+ {
+ \tl_put_right:Ne#2
+ {
+ \c_space_tl\tag_struct_object_ref:e{ \l_@@_tmpb_tl }
+ }
+ }
+ {
+ \msg_warning:nnn {tag}{struct-Ref-unknown}{Label~'#1'}
+ }
+ }
+\cs_new_protected:Npn \@@_struct_Ref_dest:nN #1 #2 %#1 a dest name
+ {
+ \prop_get:NnNTF \g_@@_struct_dest_num_prop {#1} \l_@@_tmpb_tl
+ {
+ \tl_put_right:Ne#2
+ {
+ \c_space_tl\tag_struct_object_ref:e{ \l_@@_tmpb_tl }
+ }
+ }
+ {
+ \msg_warning:nnn {tag}{struct-Ref-unknown}{Destination~'#1'}
+ }
+ }
+\cs_new_protected:Npn \@@_struct_Ref_num:nN #1 #2 %#1 a structure number
+ {
+ \tl_put_right:Ne#2
+ {
+ \c_space_tl\tag_struct_object_ref:e{ #1 }
+ }
+ }
+
+% \end{macrocode}
+% \end{macro}
+% \begin{structkeydecl}{ref,E,}
% \begin{macrocode}
+\keys_define:nn { @@ / struct }
+ {
ref .code:n = % ref property
{
- \tl_clear:N\l_@@_tmpa_tl
\clist_map_inline:on {#1}
{
- \tl_put_right:Ne \l_@@_tmpa_tl
- {~\@@_property_ref:en{tagpdfstruct-##1}{tagstructobj} }
+ \tag_struct_gput:nne
+ {\int_use:N \c@g_@@_struct_abs_int}{ref_label}{ ##1 }
}
- \@@_struct_gput_data_ref:ee
- { \int_use:N \c@g_@@_struct_abs_int } {\l_@@_tmpa_tl}
},
E .code:n = % E property
{
@@ -1261,9 +1412,9 @@
},
}
% \end{macrocode}
-% \end{macro}
-% \begin{macro}{AF (struct-key), AFref (struct-key),
-% AFinline (struct-key),AFinline-o (struct-key)}
+% \end{structkeydecl}
+%
+% \begin{structkeydecl}{AF, AFref,AFinline,AFinline-o,texsource,mathml}
% keys for the AF keys (associated files). They use commands from l3pdffile!
% The stream variants use txt as extension to get the mimetype.
% TODO: check if this should be configurable. For math we will perhaps need another
@@ -1314,7 +1465,8 @@
% \end{macrocode}
%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_struct_add_AF:nn #1 #2 % #1 struct num #2 object reference
+\cs_new_protected:Npn \@@_struct_add_AF:nn #1 #2
+% #1 struct num #2 object reference
{
\tl_if_exist:cTF
{
@@ -1340,7 +1492,8 @@
{
\pdf_object_if_exist:eTF {#1}
{
- \@@_struct_add_AF:ee { \int_use:N \c@g_@@_struct_abs_int }{\pdf_object_ref:e {#1}}
+ \@@_struct_add_AF:ee
+ { \int_use:N \c@g_@@_struct_abs_int }{\pdf_object_ref:e {#1}}
\@@_struct_prop_gput:nne
{ \int_use:N \c@g_@@_struct_abs_int }
{ AF }
@@ -1397,8 +1550,8 @@
}
}
% \end{macrocode}
-% \end{macro}
-% \begin{macro}{root-AF (setup-key)}
+% \end{structkeydecl}
+% \begin{setupkeydecl}{root-AF}
% The root structure can take AF keys too, so we provide a key for it.
% This key is used with |\tagpdfsetup|, not in a structure!
% \begin{macrocode}
@@ -1425,7 +1578,7 @@
},
}
% \end{macrocode}
-% \end{macro}
+% \end{setupkeydecl}
% \section{User commands}
% We allow to set a language by default
% \begin{macro}{\l_@@_struct_lang_tl}
@@ -1481,13 +1634,6 @@
\g_@@_struct_tag_tl
\g_@@_struct_tag_NS_tl
\@@_check_structure_has_tag:n { \int_use:N \c@g_@@_struct_abs_int }
- \tl_if_empty:NF
- \l_@@_struct_key_label_tl
- {
- \@@_property_record:eV
- {tagpdfstruct-\l_@@_struct_key_label_tl}
- \c_@@_property_struct_clist
- }
% \end{macrocode}
% The structure number of the parent is either taken from the stack or
% has been set with the parent key.
@@ -1613,7 +1759,7 @@
%record this structure as kid:
%\tl_show:N \g_@@_struct_stack_current_tl
%\tl_show:N \l_@@_struct_stack_parent_tmpa_tl
- \@@_struct_kid_struct_gput_right:ee
+ \use:c { @@_struct_kid_struct_gput_ \l_@@_struct_addkid_tl :ee }
{ \l_@@_struct_stack_parent_tmpa_tl }
{ \g_@@_struct_stack_current_tl }
%\prop_show:c { g_@@_struct_\g_@@_struct_stack_current_tl _prop }
@@ -1706,16 +1852,16 @@
\@@_check_if_active_struct:T
{
\prop_if_exist:cTF
- { g_@@_struct_\@@_property_ref:enn{tagpdfstruct-#1}{tagstruct}{unknown}_prop } %
+ { g_@@_struct_\property_ref:enn{tagpdfstruct-#1}{tagstruct}{unknown}_prop } %
{
\@@_check_struct_used:n {#1}
%add the label structure as kid to the current structure (can be the root)
\@@_struct_kid_struct_gput_right:ee
{ \g_@@_struct_stack_current_tl }
- { \@@_property_ref:enn{tagpdfstruct-#1}{tagstruct}{1} }
+ { \property_ref:enn{tagpdfstruct-#1}{tagstruct}{1} }
%add the current structure to the labeled one as parents
\@@_prop_gput:cne
- { g_@@_struct_\@@_property_ref:enn{tagpdfstruct-#1}{tagstruct}{1}_prop }
+ { g_@@_struct_\property_ref:enn{tagpdfstruct-#1}{tagstruct}{1}_prop }
{ P }
{
\pdf_object_ref_indexed:nn { @@/struct } { \g_@@_struct_stack_current_tl }
@@ -1724,7 +1870,7 @@
% debug code
% \begin{macrocode}
%<debug> \prop_gput:cne
-%<debug> { g_@@_struct_debug_\@@_property_ref:enn{tagpdfstruct-#1}{tagstruct}{1}_prop }
+%<debug> { g_@@_struct_debug_\property_ref:enn{tagpdfstruct-#1}{tagstruct}{1}_prop }
%<debug> { P }
%<debug> {
%<debug> parent~structure:~\g_@@_struct_stack_current_tl\c_space_tl=~
@@ -1736,7 +1882,7 @@
% the global tl-vars:
% \begin{macrocode}
\@@_struct_get_parentrole:eNN
- {\@@_property_ref:enn{tagpdfstruct-#1}{tagstruct}{1}}
+ {\property_ref:enn{tagpdfstruct-#1}{tagstruct}{1}}
\l_@@_tmpa_tl
\l_@@_tmpb_tl
\@@_check_parent_child:VVVVN
@@ -1853,6 +1999,7 @@
\pdf_object_ref_indexed:nn {@@/struct}{ #1 }
}
\cs_generate_variant:Nn \tag_struct_object_ref:n {e}
+%</package>
% \end{macrocode}
%
% \end{macro}
@@ -1864,10 +2011,18 @@
% adjusted to the key in question.
% The first argument is the number of the structure,
% the second a keyword referring to a function,
-% the third the value. Currently the only keyword is \texttt{ref} which updates
-% the Ref key (an array)
-% \begin{macrocode}
-\cs_new_protected:Npn \tag_struct_gput:nnn #1 #2 #3
+% the third the value. Currently the existing keywords are all related
+% to the \texttt{Ref} key (an array).
+% The keyword \texttt{ref} takes as value an explicit object reference to
+% a structure. The keyword \texttt{ref_label} expects as value a label name (from
+% a label set in a \cs{tagstructbegin} command). The keyword \texttt{ref_dest}
+% expects a destination name set with \cs{MakeLinkTarget}. It then will refer to
+% the structure in which this \cs{MakeLinkTarget} was used. At last
+% the keyword \texttt{ref_num} expects a structure number.
+% \begin{macrocode}
+%<base>\cs_new_protected:Npn \tag_struct_gput:nnn #1 #2 #3{}
+%<*package>
+\cs_set_protected:Npn \tag_struct_gput:nnn #1 #2 #3
{
\cs_if_exist_use:cF {@@_struct_gput_data_#2:nn}
{ %warning??
@@ -1880,22 +2035,47 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_struct_gput_data_ref:nn}
+% \begin{macro}{\@@_struct_gput_data_ref_aux:nnn}
% \begin{macrocode}
%<*package>
-\cs_new_protected:Npn \@@_struct_gput_data_ref:nn #1 #2
- % #1 receiving struct num, #2 list of object ref
+\cs_new_protected:Npn \@@_struct_gput_data_ref_aux:nnn #1 #2 #3
+ % #1 receiving struct num, #2 key word #3 value
{
- \prop_get:cnN
- { g_@@_struct_#1_prop }
- {Ref}
- \l_@@_get_tmpc_tl
- \@@_struct_prop_gput:nne
- { #1 }
- { Ref }
- { \quark_if_no_value:NF\l_@@_get_tmpc_tl { \l_@@_get_tmpc_tl\c_space_tl }#2 }
+ \prop_get:cnNTF
+ { g_@@_struct_#1_prop }
+ {Ref}
+ \l_@@_get_tmpc_tl
+ {
+ \tl_put_right:No \l_@@_get_tmpc_tl
+ {\cs:w @@_struct_Ref_#2:nN \cs_end: {#3},}
+ }
+ {
+ \tl_set:No \l_@@_get_tmpc_tl
+ {\cs:w @@_struct_Ref_#2:nN \cs_end: {#3},}
+ }
+ \@@_struct_prop_gput:nno
+ { #1 }
+ { Ref }
+ { \l_@@_get_tmpc_tl }
}
-\cs_generate_variant:Nn \@@_struct_gput_data_ref:nn {ee}
+\cs_new_protected:Npn \@@_struct_gput_data_ref:nn #1 #2
+ {
+ \@@_struct_gput_data_ref_aux:nnn {#1}{obj}{#2}
+ }
+\cs_new_protected:Npn \@@_struct_gput_data_ref_label:nn #1 #2
+ {
+ \@@_struct_gput_data_ref_aux:nnn {#1}{label}{#2}
+ }
+\cs_new_protected:Npn \@@_struct_gput_data_ref_dest:nn #1 #2
+ {
+ \@@_struct_gput_data_ref_aux:nnn {#1}{dest}{#2}
+ }
+\cs_new_protected:Npn \@@_struct_gput_data_ref_num:nn #1 #2
+ {
+ \@@_struct_gput_data_ref_aux:nnn {#1}{num}{#2}
+ }
+
+\cs_generate_variant:Nn \@@_struct_gput_data_ref:nn {ee,no}
% \end{macrocode}
% \end{macro}
% \begin{macro}
@@ -1937,7 +2117,7 @@
% \section{Attributes and attribute classes}
% \begin{macrocode}
%<*header>
-\ProvidesExplPackage {tagpdf-attr-code} {2024-06-20} {0.99c}
+\ProvidesExplPackage {tagpdf-attr-code} {2024-09-16} {0.99f}
{part of tagpdf - code related to attributes and attribute classes}
%</header>
% \end{macrocode}
@@ -2012,7 +2192,7 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{attribute-class (struct-key)}
+% \begin{structkeydecl}{attribute-class}
% attribute-class has to store the used attribute names so that
% they can be added to the ClassMap later.
% \begin{macrocode}
@@ -2054,8 +2234,8 @@
}
}
% \end{macrocode}
-% \end{macro}
-% \begin{macro}{attribute (struct-key)}
+% \end{structkeydecl}
+% \begin{structkeydecl}{attribute}
% \begin{macrocode}
\keys_define:nn { @@ / struct }
{
@@ -2112,5 +2292,5 @@
}
%</package>
% \end{macrocode}
-% \end{macro}
+% \end{structkeydecl}
% \end{implementation}
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx
index 04b9309597f..879a62c41f2 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.99c, released 2024-06-20}
+% \date{Version 0.99f, released 2024-09-16}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-tree-code} {2024-06-20} {0.99c}
+\ProvidesExplPackage {tagpdf-tree-code} {2024-09-16} {0.99f}
{part of tagpdf - code related to writing trees and dictionaries to the pdf}
%</header>
% \end{macrocode}
@@ -118,7 +118,7 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}{viewer/startpage (setup-key)}
+% \begin{macro}{viewer/startstructure (setup-key)}
% We also need an option to setup the start structure. So we setup a key
% which sets the variable to the current structure. This still requires
% hyperref to do most of the job, this should perhaps be changed.
@@ -367,11 +367,11 @@
{
%mcid####1
\int_compare:nT
- {\@@_property_ref:enn{mcid-####1}{tagabspage}{-1}=##1} %mcid is on current page
+ {\property_ref:enn{mcid-####1}{tagabspage}{-1}=##1} %mcid is on current page
{% yes
\prop_put:Nee
\l_@@_tmpa_prop
- {\@@_property_ref:enn{mcid-####1}{tagmcid}{-1}}
+ {\property_ref:enn{mcid-####1}{tagmcid}{-1}}
{\prop_item:Nn \g_@@_mc_parenttree_prop {####1}}
}
}
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx
index 916ff041d01..8dfa6893c00 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.99c, released 2024-06-20}
+% \date{Version 0.99f, released 2024-09-16}
% \maketitle
% \begin{documentation}
% \section{Setup commands}
@@ -309,7 +309,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-user} {2024-06-20} {0.99c}
+\ProvidesExplPackage {tagpdf-user} {2024-09-16} {0.99f}
{tagpdf - user commands}
%</header>
% \end{macrocode}
@@ -866,9 +866,9 @@
{\tagmcbegin{tag=Lbl}}
{#1}
}
- \tag_stop:n{hangfrom}
+ \tag_suspend:n{hangfrom}
\hangindent \wd\@tempboxa\noindent
- \tag_start:n{hangfrom}
+ \tag_resume:n{hangfrom}
\tagmcbegin{}\box\@tempboxa\tagmcend\tagstructend\tagmcbegin{}
}
}
@@ -1166,7 +1166,7 @@
% \tagpdfparaOff
% }
% This two command switch para mode on and off. |\tagpdfsetup| could be used
-% too but is longer. An alternative is |\tag_tool:n{para=false}|
+% too but is longer. An alternative is |\tag_tool:n{para/tagging=false}|
% \begin{macrocode}
%<base>\newcommand\tagpdfparaOn {}
%<base>\newcommand\tagpdfparaOff{}
@@ -1246,11 +1246,11 @@
\bool_gset_false:N \g_@@_in_mc_bool
}
\tag_mc_begin:n {artifact}
- \tag_stop:n{headfoot}
+ \tag_suspend:n{headfoot}
}
\cs_new_protected:Npn \@@_exclude_headfoot_end:
{
- \tag_start:n{headfoot}
+ \tag_resume:n{headfoot}
\tag_mc_end:
\bool_if:NTF \g_@@_mode_lua_bool
{
@@ -1277,12 +1277,12 @@
}
\tag_struct_begin:n{tag=Artifact,attribute-class=@@/attr/#1}
\tag_mc_begin:n {artifact=#1}
- \tag_stop:n{headfoot}
+ \tag_suspend:n{headfoot}
}
\cs_new_protected:Npn \@@_exclude_struct_headfoot_end:
{
- \tag_start:n{headfoot}
+ \tag_resume:n{headfoot}
\tag_mc_end:
\tag_struct_end:
\bool_if:NTF \g_@@_mode_lua_bool
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx
index e58570340e5..d40c60bc67a 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx
@@ -21,62 +21,107 @@
% https://github.com/latex3/tagpdf
%
% for those people who are interested.
-%
+%<*driver>
+\DocumentMetadata{}
+\documentclass{l3doc}
+\usepackage{array,booktabs,caption}
+\hypersetup{pdfauthor=Ulrike Fischer,
+ pdftitle=tagpdf (main module)}
+\input{tagpdf-docelements}
+\begin{document}
+ \DocInput{\jobname.dtx}
+\end{document}
+%</driver>
% \fi
+% \title{^^A
+% The \pkg{tagpdf} main module
+% \\ Part of the tagpdf package
+% }
+%
+% \author{^^A
+% Ulrike Fischer\thanks
+% {^^A
+% E-mail:
+% \href{mailto:fischer@troubleshooting-tex.de}
+% {fischer@troubleshooting-tex.de}^^A
+% }^^A
+% }
+%
+% \date{Version 0.99f, released 2024-09-16}
+% \maketitle%
+%
% \begin{documentation}
-% \begin{function}{
-% \tag_stop:, \tag_start:,
-% \tagstop, \tagstart }
+% \begin{function}{\tag_suspend:n, \tag_resume:n,\tag_stop:n, \tag_start:n }%
+% \begin{syntax}
+% \cs{tag_suspend:n}\Arg{label}\\
+% \cs{tag_resume:n}\Arg{label}\\
+% \cs{tag_stop:n}\Arg{label} (\emph{deprecated})\\
+% \cs{tag_start:n}\Arg{label} (\emph{deprecated})
+% \end{syntax}
% We need commands to stop tagging in some places.
% They switches three local booleans and also stop the counting
-% of paragraphs. If they are nested an inner \cs{tag_start:} will not
-% restart tagging.
+% of paragraphs. If they are nested an inner \cs{tag_resume:n} will not
+% restart tagging.
+% \meta{label} is only used in debugging messages to allow to follow the nesting
+% and to identify which code is disabling the tagging.
+% The label is not expanded so can be a single token, e.g. |\caption|.
+% |\tag_suspend:n| and |\tag_resume:n| are the l3-layer variants of
+% |\SuspendTagging| and |\ResumeTagging| and will be provided by the kernel
+% in the next release.
% \end{function}
-%
-% \begin{function}{\tag_stop:n, \tag_start:n }%
-% \begin{syntax}
-% \cs{tag_stop:n}\Arg{label}
-% \cs{tag_start:n}\Arg{label}\\
-% \end{syntax}
-% The commands with argument allow to give a label. This is only used
-% in debugging messages to allow to follow the nesting.
+%
+% \begin{function}{
+% \tag_stop:, \tag_start:,
+% \tagstop, \tagstart }
+% \emph{deprecated} These are variants of the above commands
+% without the debuging level. They are now deprecated and it
+% is recommended to use the kernel command
+% |\SuspendTagging|, |\ResumeTagging|, |\tag_suspend:n| and |\tag_resume:n|
+% instead.
% \end{function}
%
-% \begin{function}{activate/spaces (setup-key)}
+%
+% \begin{setupkeydecl}{activate/spaces}
% |activate/spaces| activates the additional parsing needed for
% interword spaces. It replaces the deprecated key |interwordspace|.
-% \end{function}
+% \end{setupkeydecl}
%
-% \begin{function}{activate/mc (setup-key),
-% activate/tree (setup-key),
-% activate/struct (setup-key),
-% activate/all (setup-key),
+% \begin{setupkeydecl}{activate/mc,
+% activate/tree,
+% activate/struct,
+% activate/all,
% activate-mc (deprecated),
% activate-tree (deprecated),
% activate-struct (deprecated),
% activate-all (deprecated),
% }
% Keys to activate the various tagging steps.
-% \end{function}
-%\begin{function}{activate/struct-dest (setup-key),no-struct-dest (deprecated)}
+% \end{setupkeydecl}
+%\begin{setupkeydecl}{activate/struct-dest,no-struct-dest (deprecated)}
% The key allows to suppress the creation of structure destinations
-% \end{function}
+% \end{setupkeydecl}
%
-% \begin{function}{debug/log (setup-key)}
+% \begin{setupkeydecl}{debug/log}
% The |debug/log| key takes currently the values |none|, |v|, |vv|, |vvv|, |all|.
% More details are in \texttt{tagpdf-checks}.
-% \end{function}
+% \end{setupkeydecl}
%
-% \begin{function}{activate/tagunmarked (setup-key), tagunmarked (deprecated) }
+% \begin{setupkeydecl}{activate/tagunmarked, tagunmarked (deprecated) }
% This key allows to set if (in luamode) unmarked text should be
% marked up as artifact. The initial value is true.
-% \end{function}
+% \end{setupkeydecl}
%
-% \begin{function}{page/tabsorder (setup-key), tabsorder (deprecated)}
+% \begin{setupkeydecl}{activate/softhyphen}
+% 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{setupkeydecl}
+%
+% \begin{setupkeydecl}{page/tabsorder, 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
% added if needed.
-% \end{function}
+% \end{setupkeydecl}
%
% \begin{function}{tagstruct,tagstructobj,tagabspage,tagmcabs,tagmcid}
% These are attributes used by the label/ref system.
@@ -87,8 +132,8 @@
% \begin{macrocode}
%<@@=tag>
%<*package>
-\ProvidesExplPackage {tagpdf} {2024-06-20} {0.99c}
- { A package to experiment with pdf tagging }
+\ProvidesExplPackage {tagpdf} {2024-09-16} {0.99f}
+ { LaTeX kernel code for PDF tagging }
\bool_if:nF
{
@@ -113,7 +158,7 @@
% \end{macrocode}
%<*debug>
% \begin{macrocode}
-\ProvidesExplPackage {tagpdf-debug} {2024-06-20} {0.99c}
+\ProvidesExplPackage {tagpdf-debug} {2024-09-16} {0.99f}
{ debug code for tagpdf }
\@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput}
% \end{macrocode}
@@ -136,7 +181,7 @@
% we define a base package with dummy functions
% \begin{macrocode}
%<*base>
-\ProvidesExplPackage {tagpdf-base} {2024-06-20} {0.99c}
+\ProvidesExplPackage {tagpdf-base} {2024-09-16} {0.99f}
{part of tagpdf - provide base, no-op versions of the user commands }
%</base>
% \end{macrocode}
@@ -185,34 +230,31 @@
}
%</base>
% \end{macrocode}
-% \subsection{Indexed objects}
-% 2024-04-11: Temporary code! Can be removed after the next expl3 release!
+% \subsection{Patches related to Ref improvement}
+% 2024-09-09: Temporary code. Can be removed when the latex-lab-footnote
+% and latex-lab-toc code have been adapted to the better Ref handling.
% \begin{macrocode}
-\cs_if_free:NT \pdf_object_new_indexed:nn
- {
- \cs_generate_variant:Nn \pdf_object_new:n {e}
- \cs_generate_variant:Nn \pdf_object_write:nnn {enn}
- \cs_new_protected:Npn \pdf_object_new_indexed:nn #1 #2
- {
- \pdf_object_new:e {#1/\int_eval:n{#2}}
- }
- \cs_new_protected:Npn \pdf_object_write_indexed:nnnn #1 #2 #3 #4
- {
- \pdf_object_write:enn {#1/\int_eval:n{#2}}{#3}{#4}
- }
- \cs_generate_variant:Nn \pdf_object_write_indexed:nnnn {nnne}
- \cs_new:Npn\pdf_object_ref_indexed:nn #1 #2
- {
- \pdf_object_ref:e {#1/\int_eval:n{#2}}
- }
- \cs_new:Npn \__kernel_pdf_object_id_indexed:nn #1 #2
- {
- \int_use:c
- { c__pdf_object_ #1/\int_eval:n{#2} _int }
- }
- }
-
+%<*package>
+\AddToHook{package/latex-lab-testphase-new-or-2/after}
+ {
+ \cs_set_protected:Npn \__fnote_gput_ref:nn #1 #2 %#1 the structure number receiving the ref #2
+ {
+ \tag_struct_gput:nnn {#1}{ref_num}{#2}
+ }
+ }
+\AddToHook{package/latex-lab-testphase-toc/after}
+ {
+ \cs_set_protected:Npn \g_@@_struct_ref_by_dest:
+ {
+ \prop_map_inline:Nn\g_@@_struct_ref_by_dest_prop
+ {
+ \tag_struct_gput:nnn {##1}{ref_dest}{##2}
+ }
+ }
+ }
+%</package>
% \end{macrocode}
+%
% \subsection{a LastPage label}
% See also issue \#2 in Accessible-xref
% \begin{macro}{\@@_lastpagelabel:}
@@ -245,6 +287,7 @@
% {
% \l_@@_tmpa_tl,
% \l_@@_tmpb_tl,
+% \l_@@_Ref_tmpa_tl,
% \l_@@_get_tmpc_tl,
% \l_@@_get_parent_tmpa_tl
% \l_@@_get_parent_tmpb_tl
@@ -261,6 +304,7 @@
% \begin{macrocode}
\tl_new:N \l_@@_tmpa_tl
\tl_new:N \l_@@_tmpb_tl
+\tl_new:N \l_@@_Ref_tmpa_tl
\tl_new:N \l_@@_get_tmpc_tl
\tl_new:N \l_@@_get_parent_tmpa_tl
\tl_new:N \l_@@_get_parent_tmpb_tl
@@ -354,6 +398,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}
@@ -369,24 +420,10 @@
% \end{macrocode}
%
% \section{Label and Reference commands}
-% To ease transition to properties we setup internal definition. They can be replaced
-% by the property definitions once that is released.
-% %** do it!
-% \begin{macro}{\@@_property_new:nnnn,\@@_property_gset:nnnn,\@@_property_ref:nnn}
-% At first a command to define new properties
-% \begin{macrocode}
- \cs_new_eq:NN \@@_property_new:nnnn \property_new:nnnn
-% \end{macrocode}
-% For the non-shipout code we need also the option to reset property
-% \begin{macrocode}
- \cs_new_eq:NN \@@_property_gset:nnnn \property_gset:nnnn
-% \end{macrocode}
-% The command to reference while giving a local default.
-% \begin{macrocode}
- \cs_new_eq:NN \@@_property_ref:nnn \property_ref:nnn
- \cs_new_eq:NN \@@_property_ref:nn \property_ref:nn
-% \end{macrocode}
-% The command to record
+% The code uses mostly the kernel properties but need a few local variants.
+% \begin{macro}{\@@_property_record:nn}
+% The command to record a property while preserving the spaces similar to the standard
+% \cs{label}.
% \begin{macrocode}
\cs_new_protected:Npn \@@_property_record:nn #1#2
{
@@ -398,8 +435,8 @@
% \end{macrocode}
% And a few variants
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_property_ref:nnn {enn}
-\cs_generate_variant:Nn \@@_property_ref:nn {en}
+\cs_generate_variant:Nn \property_ref:nnn {enn}
+\cs_generate_variant:Nn \property_ref:nn {en}
\cs_generate_variant:Nn \@@_property_record:nn {en,eV}
% \end{macrocode}
% \end{macro}
@@ -410,7 +447,7 @@
% \begin{macrocode}
\cs_new:Npn \@@_property_ref_lastpage:nn #1 #2
{
- \@@_property_ref:nnn {@tag@LastPage}{#1}{#2}
+ \property_ref:nnn {@tag@LastPage}{#1}{#2}
}
% \end{macrocode}
%\end{macro}
@@ -427,21 +464,21 @@
% With mc-chunks we store the absolute page number |tagabspage|,
% the absolute id |tagmcabc|, and the id on the page |tagmcid|.
% \begin{macrocode}
-\@@_property_new:nnnn
+\property_new:nnnn
{ tagstruct } { now }
- {0} { \int_use:N \c@g_@@_struct_abs_int }
-\@@_property_new:nnnn { tagstructobj } { now } {}
+ {1} { \int_use:N \c@g_@@_struct_abs_int }
+\property_new:nnnn { tagstructobj } { now } {}
{
\pdf_object_ref_indexed:nn { @@/struct } { \c@g_@@_struct_abs_int }
}
-\@@_property_new:nnnn
+\property_new:nnnn
{ tagabspage } { shipout }
{0} { \int_use:N \g_shipout_readonly_int }
-\@@_property_new:nnnn { tagmcabs } { now }
+\property_new:nnnn { tagmcabs } { now }
{0} { \int_use:N \c@g_@@_MCID_abs_int }
\flag_new:n { @@/mcid }
-\@@_property_new:nnnn {tagmcid } { shipout }
+\property_new:nnnn {tagmcid } { shipout }
{0} { \flag_height:n { @@/mcid } }
% \end{macrocode}
@@ -469,6 +506,7 @@
\cs_set_eq:NN \@@_seq_new:N \seq_new:N
\cs_set_eq:NN \@@_prop_gput:Nnn \prop_gput:Nnn
\cs_set_eq:NN \@@_seq_gput_right:Nn \seq_gput_right:Nn
+\cs_set_eq:NN \@@_seq_gput_left:Nn \seq_gput_left:Nn
\cs_set_eq:NN \@@_seq_item:cn \seq_item:cn
\cs_set_eq:NN \@@_prop_item:cn \prop_item:cn
\cs_set_eq:NN \@@_seq_show:N \seq_show:N
@@ -476,6 +514,7 @@
% cnx temporary needed for latex-lab-graphic code
\cs_generate_variant:Nn \@@_prop_gput:Nnn { Nen , Nee, Nne , cnn, cen, cne, cno, cnx}
\cs_generate_variant:Nn \@@_seq_gput_right:Nn { Ne , No, cn, ce }
+\cs_generate_variant:Nn \@@_seq_gput_left:Nn { ce }
\cs_generate_variant:Nn \@@_prop_new:N { c }
\cs_generate_variant:Nn \@@_seq_new:N { c }
\cs_generate_variant:Nn \@@_seq_show:N { c }
@@ -487,6 +526,7 @@
% \section{General tagging commands}
%
% \begin{macro}{
+% \tag_suspend:n,\tag_resume:n,
% \tag_stop:,\tag_start:,
% \tag_stop:n,\tag_start:n}
% We need commands to stop tagging in some places.
@@ -495,7 +535,8 @@
% counter. Tagging only is only restarted at the outer level,
% if the current level is 1.
% The commands with argument allow to give a label. This is only used
-% in debugging messages to allow to follow the nesting.
+% in debugging messages to allow to follow the nesting. The label is
+% not expand so can e.g. be a single command token.
%
% \begin{variable}{\l_@@_tag_stop_int}
% When stop/start pairs are nested we do not want the inner
@@ -512,7 +553,7 @@
% \begin{macrocode}
\cs_set_protected:Npn \tag_stop:
{
-%<debug> \msg_note:nne {tag / debug }{tag-stop}{ \int_use:N \l_@@_tag_stop_int }
+%<debug> \msg_note:nne {tag / debug }{tag-suspend}{ \int_use:N \l_@@_tag_stop_int }
\int_incr:N \l_@@_tag_stop_int
\bool_set_false:N \l_@@_active_struct_bool
\bool_set_false:N \l_@@_active_mc_bool
@@ -529,22 +570,24 @@
\bool_set_true:N \l_@@_active_socket_bool
\@@_start_para_ints:
}
-%<debug> \msg_note:nne {tag / debug }{tag-start}{ \int_use:N \l_@@_tag_stop_int }
+%<debug> \msg_note:nne {tag / debug }{tag-resume}{ \int_use:N \l_@@_tag_stop_int }
}
\cs_set_eq:NN\tagstop\tag_stop:
\cs_set_eq:NN\tagstart\tag_start:
% \end{macrocode}
% \begin{macrocode}
-\cs_set_protected:Npn \tag_stop:n #1
+\cs_set_protected:Npn \tag_suspend:n #1
{
-%<debug> \msg_note:nnee {tag / debug }{tag-stop}{ \int_use:N \l_@@_tag_stop_int }{#1}
+%<debug> \msg_note:nnee {tag / debug }{tag-suspend}
+%<debug> { \int_use:N \l_@@_tag_stop_int }{\exp_not:n{#1}}
\int_incr:N \l_@@_tag_stop_int
\bool_set_false:N \l_@@_active_struct_bool
\bool_set_false:N \l_@@_active_mc_bool
\bool_set_false:N \l_@@_active_socket_bool
\@@_stop_para_ints:
}
-\cs_set_protected:Npn \tag_start:n #1
+\cs_set_eq:NN \tag_stop:n \tag_suspend:n
+\cs_set_protected:Npn \tag_resume:n #1
{
\int_if_zero:nF { \l_@@_tag_stop_int } { \int_decr:N \l_@@_tag_stop_int }
\int_if_zero:nT { \l_@@_tag_stop_int }
@@ -553,9 +596,11 @@
\bool_set_true:N \l_@@_active_mc_bool
\bool_set_true:N \l_@@_active_socket_bool
\@@_start_para_ints:
- }
-%<debug> \msg_note:nnee {tag / debug }{tag-start}{ \int_use:N \l_@@_tag_stop_int }{#1}
+ }
+%<debug> \msg_note:nnee {tag / debug }{tag-resume}
+%<debug> { \int_use:N \l_@@_tag_stop_int }{\exp_not:n{#1}}
}
+\cs_set_eq:NN \tag_start:n \tag_resume:n
%</package|debug>
%<*base>
\cs_new_protected:Npn \tag_stop:{}
@@ -564,6 +609,11 @@
\cs_new_protected:Npn \tagstart{}
\cs_new_protected:Npn \tag_stop:n #1 {}
\cs_new_protected:Npn \tag_start:n #1 {}
+% \end{macrocode}
+% Until the commands are provided by the kernel we provide them here too
+% \begin{macrocode}
+\cs_set_eq:NN \tag_suspend:n \tag_stop:n
+\cs_set_eq:NN \tag_resume:n \tag_start:n
%</base>
% \end{macrocode}
% \end{macro}
@@ -573,13 +623,13 @@
%
% TODO: the log-levels must be sorted
%
-% \begin{macro}
+% \begin{setupkeydecl}
% {
-% activate/mc (setup-key),
-% activate/tree (setup-key),
-% activate/struct (setup-key),
-% activate/all (setup-key),
-% activate/struct-dest (setup-key),
+% activate/mc,
+% activate/tree,
+% activate/struct,
+% activate/all,
+% activate/struct-dest,
% }
% Keys to (globally) activate tagging.
% |activate/spaces| activates the additional parsing needed for
@@ -607,14 +657,14 @@
activate-all .default:n = true,
no-struct-dest .bool_gset_inverse:N = \g_@@_active_struct_dest_bool,
% \end{macrocode}
-% \end{macro}
-% \begin{macro}{debug/show (setup-key)}
+% \end{setupkeydecl}
+% \begin{setupkeydecl}{debug/show}
% Subkeys/values are defined in various other places.
% \begin{macrocode}
debug/show .choice:,
% \end{macrocode}
-% \end{macro}
-% \begin{macro}{debug/log (setup-key), debug/uncompress (setup-key), log (deprecated), uncompress (deprecated)}
+% \end{setupkeydecl}
+% \begin{setupkeydecl}{debug/log, debug/uncompress, log (deprecated), uncompress (deprecated)}
% The |log| takes currently the values |none|, |v|, |vv|, |vvv|, |all|.
% The description of the log levels is in tagpdf-checks.
% \begin{macrocode}
@@ -635,8 +685,8 @@
log .meta:n = {debug/log={#1}},
uncompress .code:n = { \pdf_uncompress: },
% \end{macrocode}
-% \end{macro}
-% \begin{macro}{activate/tagunmarked (setup-key),tagunmarked (deprecated)}
+% \end{setupkeydecl}
+% \begin{setupkeydecl}{activate/tagunmarked,tagunmarked (deprecated)}
% This key allows to set if (in luamode) unmarked text should be
% marked up as artifact. The initial value is true.
% \begin{macrocode}
@@ -647,8 +697,15 @@
% \begin{macrocode}
tagunmarked .bool_gset:N = \g_@@_tagunmarked_bool,
% \end{macrocode}
-% \end{macro}
-% \begin{macro}{page/tabsorder (setup-key),tabsorder (deprecated)}
+% \end{setupkeydecl}
+% \begin{setupkeydecl}{activate/softhyphen}
+% 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{setupkeydecl}
+% \begin{setupkeydecl}{page/tabsorder,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
% added if needed.
@@ -669,7 +726,7 @@
tabsorder .meta:n = {page/tabsorder={#1}},
}
% \end{macrocode}
-% \end{macro}
+% \end{setupkeydecl}
% \section{loading of engine/more dependent code}
% \begin{macrocode}
\sys_if_engine_luatex:T
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/ucph-revy/ucph-revy.dtx b/Master/texmf-dist/source/latex/ucph-revy/ucph-revy.dtx
index 79a9a1aa0b4..9fdb39549e3 100644
--- a/Master/texmf-dist/source/latex/ucph-revy/ucph-revy.dtx
+++ b/Master/texmf-dist/source/latex/ucph-revy/ucph-revy.dtx
@@ -20,7 +20,7 @@
%<class>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
%<class>\ProvidesClass{ucph-revy}
%<*class>
- [2024/02/07 v1.0.1 Fix occational divide by 0]
+ [2024/09/24 v1.0.2 A class for making musical manuscripts]
%</class>
%<*driver>
\documentclass[a4paper]{ltxdoc}
@@ -372,7 +372,7 @@
% betyder bliver gennemgået i sektion \ref{thumbindex}.
% \end{danish}
% \begin{english}
-% \cn\ inherits from the \texttt{article}\DescribeMacro{article}
+% \cn\ inherits from the \texttt{article}\DescribeMacro{article}\
% class, and accepts all its options. It sets \texttt{a4paper} and
% \texttt{11pt} by default, if not given any contrary options.
%
@@ -470,13 +470,14 @@
% \end{implementation}
%
% \begin{danish}
+% \changes{v1.0.2}{2024/09/24}{Skift fontenc til OT1}
% I eksemplet inkluderer vi fire pakker. De er ikke strengt
% nødvendige for at få \cn\ til at fungere, men de kommer næsten med
% sikkerhed til at gøre dit liv lettere.
%
% \medskip\noindent\begin{tabulary}{\textwidth}{lL}
% \verb|\usepackage[utf8]{inputenc}| & \\
-% \verb|\usepackage[T1]{fontenc}| &
+% \verb|\usepackage[OT1]{fontenc}| &
% Gør \LaTeX's håndtering af danske bogstaver mere moderne. \\
% \verb|\usepackage[danish]{babel}| &
% Fortæller \LaTeX\ en masse ting om dansk, bl.a. hvordan
@@ -490,13 +491,14 @@
% \end{tabulary}
% \end{danish}
% \begin{english}
+% \changes{v1.0.2}{2024/09/24}{Change fontenc to OT1}
% In the example, we've included three packages that aren't strictly
% necessary for \cn\ to function, but will probably make your life
% easier.
%
% \medskip\noindent\begin{tabulary}{\textwidth}{lL}
% \verb|\usepackage[utf8]{inputenc}| & \\
-% \verb|\usepackage[T1]{fontenc}| &
+% \verb|\usepackage[OT1]{fontenc}| &
% Modernize \LaTeX's handling of (particularly special)
% characters.\\
% \verb|\usepackage{hyperref}| &
@@ -700,23 +702,24 @@
% \begin{danish}
% For at sammenligningen kan fungere, er vi afhængige af, at
% tekstrepræsentationen ikke skifter undervejs. Det kan ske, hvis
-% \verb|.tex|--filen kalder \textsf{fontenc}, og titlerne
-% indeholder specialtegn. Den simple og effektive\footnote{Læs:
-% det er et hack, som ikke har givet mig problemer \emph{endnu}.}
-% løsning er bare at kalde \textsf{fontenc} selv, så der ikke er
-% plads til misforståelser.
+% \verb|.tex|--filen kalder
+% \DescribeMacro{fontenc}\textsf{fontenc}, og titlerne indeholder
+% specialtegn. Den simple og effektive\footnote{Læs: det er et
+% hack, som ikke har givet mig problemer \emph{endnu}.} løsning
+% er bare at kalde \textsf{fontenc} selv, så der ikke er plads til
+% misforståelser.
% \end{danish}
% \begin{english}
% For this comparing of titles to work, we depend of the text
% representation not changing between the \verb|\title|
% declaration and the time when the thumb index routine runs. It
-% might, though, if \textsf{fontenc} is called. To quickly knock
-% that problem on the head,\footnote{In a way that hasn't come
-% back to bite \emph{me} yet.} we'll just call \textsf{fontenc}
-% ourselves.
+% might, though, if \DescribeMacro{fontenc}\textsf{fontenc} is
+% called. To quickly knock that problem on the head,\footnote{In a
+% way that hasn't come back to bite \emph{me} yet.} we'll just
+% call \textsf{fontenc} ourselves.
% \end{english}
% \begin{macrocode}
- \RequirePackage[T1]{fontenc}
+ \RequirePackage[OT1]{fontenc}
% \end{macrocode}
%
% \begin{danish}
@@ -2927,22 +2930,51 @@
}{}
% \end{macrocode}
% \end{implementation}
+%
+% \begin{danish}
+% \subsection{Assorterede emner}
+% \subsubsection{\SaTyR}
+% \end{danish}
+% \begin{english}
+% \subsection{Miscellenia}
+% \subsubsection{\SaTyR}
+% \end{english}
+% \begin{macro}{\SaTyR}
+% \begin{danish}
+% \changes{v1.0.2}{2024/09/24}{SaTyR-makro}
+% Man skriver \SaTyR{}Revy ved at elske alle dyr, og derefter
+% skrive
+% \end{danish}
+% \begin{english}
+% \changes{v1.0.2}{2024/09/24}{SaTyR-macro}
+% \SaTyR{}Revy, which is produced by the students at the Faculty
+% of Science at the University of Copenhagen, is properly written
+% by saying
+% \end{english}
+% \begin{verbatim}
+%\SaTyR{}Revy
+% \end{verbatim}
+% \begin{implementation}
+% \begin{macrocode}
+\newcommand{\SaTyR}{S\hspace*{-.2ex}\raisebox{-.15em}{A}\hspace*{-.5ex}TyR}
+% \end{macrocode}
+% \end{implementation}
+% \end{macro}
% \iffalse
%<*driver>
\jump
%</driver>
% \fi
-%
% \begin{implementation}
-% \begin{danish}
-% \subsection{\texttt{.aux}--filen}
+% \begin{danish}
+% \subsubsection{\texttt{.aux}--filen}
% Til fremtidigt brug sørger vi for, at vores metadata også bliver
% skrevet ud til \texttt{.aux}--filen, når dokumentet er færdigt.
%
% Det er også her, vi sætter en \texttt{label} på den sidste side.
% \end{danish}
% \begin{english}
-% \subsection{The \texttt{.aux} file}
+% \subsubsection{The \texttt{.aux} file}
% For futue use, we will also ensure that our metadata is written
% to the \texttt{.aux} file at the end of the document.
%
@@ -2986,11 +3018,13 @@
% \end{implementation}
% \begin{danish}
% \section{Komplet eksempel}
+% \changes{v1.0.2}{2024/09/24}{Tilpasninger i eksempelfil}
% \label{fullex}
% \VerbatimInput{Eksempel.tex}
% \end{danish}
% \begin{english}
% \section{Complete example}
+% \changes{v1.0.2}{2024/09/24}{Minor adjustments in example file}
% \label{fullex}
% \VerbatimInput{Example.tex}
% \end{english}
@@ -3001,7 +3035,7 @@
\documentclass{ucph-revy}
\usepackage[utf8]{inputenc}
-\usepackage[T1]{fontenc}
+\usepackage[OT1]{fontenc}
\usepackage[danish]{babel}
\usepackage{hyperref}
%<*driver>
@@ -3011,6 +3045,7 @@
\urlstyle{sf}
\version{1.0}
+%% følgende definitioner kan godt fjernes, hvis der ikke er brug for dem:
\revyname{FysikRevy\texttrademark}
\revyyear{2019}
\status{eksempel}
@@ -3033,6 +3068,7 @@
\role{I} Vred instruktør
\role{A9}[A--ni] Anine
\end{roles}
+%% props-miljøet kan fjernes, hvis der ikke er brug for det
\begin{props}
\prop{Hedegaard--hår}[Person, der skaffer]
\prop{Didgeridoo}[Anine]
@@ -3139,7 +3175,7 @@
\documentclass{ucph-revy}
\usepackage[utf8]{inputenc}
-\usepackage[T1]{fontenc}
+\usepackage[OT1]{fontenc}
\usepackage{hyperref}
%<*driver>
\land
@@ -3148,6 +3184,7 @@
\urlstyle{sf}
\version{1.0}
+%% The settings below may be omitted if their inclusion is undesired
\revyname{The Meaning of Liff}
\revyyear{3001}
\title{Example}
@@ -3185,6 +3222,7 @@
\role{CC}[Eric] Crucified Criminal
\role{B}[Graham] Brian
\end{roles}
+%% The props environment may be omitted if found to be superfluous
\propname{Props:}
\begin{props}
\prop{Large sign}
diff --git a/Master/texmf-dist/source/latex/udiss/udiss.dtx b/Master/texmf-dist/source/latex/udiss/udiss.dtx
new file mode 100644
index 00000000000..32dc9595604
--- /dev/null
+++ b/Master/texmf-dist/source/latex/udiss/udiss.dtx
@@ -0,0 +1,4143 @@
+% \iffalse meta-comment
+%
+% File: udiss.dtx
+% ----------------------------------------------------------
+% Bundle: udiss
+% Version: v0.1 (October 1, 2024)
+% Author: TUGIndia
+% Description: A LaTeX bundle for typesetting dissertations
+% Bugs: puszcza.gnu.org.ua/bugs/?group=udiss
+% Licenses: GPLv3+, GFDLv1.3+
+% ----------------------------------------------------------
+% The LaTeX bundle udiss v0.1
+% Copyright © 2024 TUGIndia
+%
+% This program is free software: you can redistribute it
+% and/or modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation,
+% either version 3 of the License, or (at your option) any
+% later version.
+%
+% This program 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. See the GNU General Public License for more
+% details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this program. If not, see
+% <https://www.gnu.org/licenses/>.
+% ----------------------------------------------------------
+% arara: lualatex
+% arara: lualatex
+% arara: clean: {
+% arara: --> extensions: [
+% arara: --> log,aux,glo,idx,ist,
+% arara: --> out,toc,hd
+% arara: --> ]
+% arara: --> }
+% ----------------------------------------------------------
+% \fi
+% \iffalse
+%<*internal>
+\iffalse
+%</internal>
+%<*readme>
+------------------------------------------------------------
+Class: udiss
+Author: TUGIndia
+Description: A LaTeX bundle for typesetting dissertations
+Bugs: puszcza.gnu.org.ua/bugs/?group=udiss
+Licenses: GPLv3+, GFDLv1.3+
+------------------------------------------------------------
+%</readme>
+%<*internal>
+\fi
+%</internal>
+%<*driver>
+\documentclass{l3doc}
+\usepackage[provide*=*]{babel}
+\babelprovide[import,main]{english}
+\babelprovide[import,onchar={ids fonts}]{marathi}
+\usepackage[svgnames]{xcolor}
+\usepackage{fontawesome5}
+\usepackage{gfdl}
+\usepackage{microtype}
+\usepackage{unicode-math}
+\usepackage{hologo}
+\babelfont{rm}[%
+ IgnoreFontspecFile,%
+ Extension = {.otf},%
+ ItalicFont = {NewCM10-BookItalic},%
+ BoldFont = {NewCM10-Bold},%
+ BoldItalicFont = {NewCM10-BoldItalic},%
+ SlantedFont = {NewCM10-Book},%
+ BoldSlantedFont = {NewCM10-Bold},%
+ Numbers = {OldStyle},%
+ CharacterVariant = {6}%
+]{NewCM10-Book}
+\babelfont{sf}[%
+ IgnoreFontspecFile,%
+ Extension = {.otf},%
+ ItalicFont = {NewCMSans10-BookOblique},%
+ BoldFont = {NewCMSans10-Bold},%
+ BoldItalicFont = {NewCMSans10-BoldOblique},%
+ SlantedFont = {NewCMSans10-Book},%
+ BoldSlantedFont = {NewCMSans10-Bold},%
+ Numbers = {OldStyle},%
+ CharacterVariant = {6}%
+]{NewCMSans10-Book}
+\babelfont{tt}[%
+ IgnoreFontspecFile,%
+ Extension = {.otf},%
+ BoldFont = {NewCMMono10-Bold},%
+ ItalicFont = {NewCMMono10-Italic}%
+]{NewCMMono10-Book}
+\setmathfont[%
+ IgnoreFontspecFile,%
+ Extension = {.otf},%
+ CharacterVariant = {1}%
+]{NewCMMath-Book}
+\newfontfamily\newcmnewnum[%
+ IgnoreFontspecFile,%
+ Extension = {.otf}%
+]{NewCM10-Book}
+\newfontfamily\newcmnewone[%
+ IgnoreFontspecFile,%
+ Extension = {.otf},%
+ Numbers = {OldStyle}%
+]{NewCM10-Book}
+\newfontfamily\expkvkp[%
+ BoldFont = {KpRoman-Bold.otf}%
+]{KpRoman-Regular.otf}
+\babelfont[marathi]{tt}[%
+ IgnoreFontspecFile,%
+ Script = {Devanagari},%
+ Language = {Marathi},%
+ Renderer = {HarfBuzz},%
+ ItalicFont = {NewCMMono10-Book.otf}%
+]{Mukta-Regular.ttf}
+\colorlet{udisslink}{red!60!black}
+\colorlet{udissurl}{blue!60!black}
+\colorlet{udisscite}{green!60!black}
+\hypersetup{%
+ unicode,%
+ colorlinks,%
+ linkcolor = {udisslink},%
+ citecolor = {udisscite},%
+ urlcolor = {udissurl},%
+ pdftitle = {The udiss bundle},%
+ pdfauthor = {TUGIndia},%
+ pdfcreator = {TUGIndia},%
+ pdfsubject = {%
+ A LaTeX bundle for typesetting dissertations%
+ },%
+ pdfkeywords = {%
+ LaTeX, dissertations, thesis, bundle, academia%
+ }%
+}
+\gfdlcopyrightholders{%
+ \texorpdfstring{%
+ \TUGIndia
+ }{%
+ TUGIndia%
+ }%
+}
+\gfdlcopyrightdescription{%
+ \texorpdfstring{The \cls{udiss} bundle}%
+ {The udiss bundle}%
+}
+\gfdlcopyrightableyears{2024}
+\usepackage{cleveref}
+\usepackage{stackengine}
+\setquotestyle{british}
+\def\udisstval{%
+ \hfill
+ \begingroup
+ \ttfamily
+ \textcolor{udisslink}{true}\,\textbar\,false%
+ \endgroup
+}
+\def\udissfval{%
+ \hfill
+ \begingroup
+ \ttfamily
+ true\,\textbar\,\textcolor{udisslink}{false}%
+ \endgroup
+}
+\def\udisscolorred{%
+ \hfill
+ \begingroup
+ \ttfamily
+ \color{udisslink}%
+ udisslink%
+ \endgroup
+}
+\def\udisscolorblue{%
+ \hfill
+ \begingroup
+ \ttfamily
+ \color{udisslink}%
+ udissurl%
+ \endgroup
+}
+\def\udisscolorgreen{%
+ \hfill
+ \begingroup
+ \ttfamily
+ \color{udisslink}%
+ udisscite%
+ \endgroup
+}
+\def\udissarr{%
+ \hfill
+ \begingroup
+ \ttfamily
+ \color{udisslink}%
+ all-rights-reserved%
+ \endgroup
+}
+\makeatletter
+% Adapted from manfnt.sty (LPPL v1.0+)
+\DeclareFontFamily{U}{manfnt}{}
+\DeclareFontShape{U}{manfnt}{m}{n}{ <-> manfnt }{}
+\def\manfntsymbol#1{%
+ \begingroup
+ \fontencoding{U}
+ \fontfamily{manfnt}\selectfont
+ \symbol{#1}%
+ \endgroup
+}
+\def\dbend{%
+ \manfntsymbol{127}%
+ \hspace*{0.5em}%
+}
+\def\ddbend{%
+ \manfntsymbol{127}%
+ \manfntsymbol{127}%
+ \hspace*{0.5em}%
+}
+\makeatother
+\ExplSyntaxOn
+%% Answer on TopAnswers by Udi Fogiel (LPPL v1.3c+)
+%% URL: https://topanswers.xyz/tex?q=8033
+\NewDocumentCommand \textfunction { v }{
+ \__codedoc_function_index:n { #1 }
+ \__codedoc_function_label:nN { #1 } \c_false_bool
+ \texttt{#1}
+}
+\ExplSyntaxOff
+\def\TUGIndia{\textsc{tugindia}}
+\def\babelurl{%
+ https://latex3.github.io/babel/guides/%
+ which-method-for-which-language.html%
+}
+\definecolor{ekvred}{HTML}{9F393D}
+\colorlet{ekvgrey}{black!75}
+\NewDocumentCommand\expkvlogo{ m }{%
+ %% Stolen from Jonathan's sources: preamble-logos.tex
+ %% LPPL 1.3c+
+ %% /texmf-dist/doc/latex/expkv-bundle/preamble-logos.tex
+ \begingroup
+ \expkvkp
+ \bfseries
+ {%
+ \color{ekvgrey}e%
+ \kern-.05em x\kern-.05em%
+ }%
+ \lower.493ex\hbox{%
+ {\color{ekvgrey}P}%
+ \kern-.1em{\color{ekvred}k}}%
+ \kern-.18em{\color{ekvred}v}%
+ \IfBlankF{#1}{%
+ \begingroup
+ \color{ekvgrey}%
+ \kern.05em\rule[-.1ex]{.08em}{1.2ex}%
+ \kern.05em\textsc{#1}%
+ \endgroup
+ }%
+ \endgroup
+}
+
+\begin{document}
+\DocInput{udiss.dtx}
+\end{document}
+%</driver>
+% \fi
+% \title{The \cls{udiss} bundle}
+% \author{\TUGIndia}
+% \date{^^A
+% Version 0.1---October 1, 2024\\[1ex]^^A
+% {^^A
+% \small\faIcon{link}\quad
+% \url{https://ctan.org/pkg/udiss}^^A
+% }\\^^A
+% {^^A
+% \small\faIcon{bug}\quad
+% \url{https://puszcza.gnu.org.ua/bugs/?group=udiss}^^A
+% }^^A
+% }
+%
+% \maketitle
+%
+% \tableofcontents
+%
+% \DoNotIndex{%
+% \@empty,\@percentchar,\AddToHook,\ClassError,
+% \ClassWarningNoLine,\IfBlankTF,\IfBooleanTF,
+% \IfFileExists,\IfLanguageName,\LoadClass,
+% \MessageBreak,\NewDocumentCommand,\PassOptionsToClass,
+% \PassOptionsToPackage,\ProcessList,\ProvidesClass,
+% \RenewDocumentCommand,\RequirePackage,\RequireTUTeX,
+% \SplitList,\addcontentsline,\addfontfeature,
+% \addtocounter,\alph,\babelfont,\babelprovide,\begin,
+% \begingroup,\bfseries,\bigskip,\clearpage,\color,
+% \colorlet,\def,\definecolor,\dimexpr,\docLicenseThis,
+% \documentclass,\edef,\ekvdefinekeys,
+% \ekvoProcessGlobalOptions,\ekvoProcessLocalOptions,
+% \ekvset,\else,\empty,\end,\endcsname,\endgroup,\enquote,
+% \expandafter,\expanded,\fbox,\fboxsep,\fi,
+% \fontspec,\hrule,\hspace,\hypersetup,\ifLuaTeX,
+% \ifnum,\ifx,\includegraphics,\input,\itshap,
+% \udiss@lgbbl,\let,\linewidth,\loop,\medskip,
+% \newcounter,\newif,\newpage,\noindent,\normalfont,
+% \numexpr,\pagestyle,\parindent,\protected,\relax,
+% \repeat,\setlength,\setmathfont,\space,\stepcounter,
+% \stretch,\string,\tableofcontents,\textLF,
+% \textheight,\the,\thispagestyle,\unexpanded,\vfill,
+% \vspace,\year,\itshape,\csname,\fboxrule,\flushleft,
+% \flushright,\LARGE,\listoffigures,\listoftables,
+% \localecounter,\makeatletter,\makeatother,\normalsize,
+% \Require,\theenumiii,\theenumiv^^A
+% }
+%
+% \begin{documentation}
+% \section{Introduction}
+% \label{int}
+%
+% The \cls{udiss} bundle is a \LaTeX-class-file developed to
+% assist students in typesetting their \emph{u}niversity
+% \emph{diss}ertations. It is a collection of multiple
+% support files. This is the first experimental version. We
+% need feedback and comments from the community to make it
+% better. Currently, nothing should be considered
+% \enquote{stable}. Soon after getting comments and reviews
+% from the community, we will move towards a stable version.
+%
+% Universities often have strict requirements regarding the
+% formatting of the dissertations/theses submitted to them.
+% This bundle pre-supplies a generic style
+% (university-agnostic) for creating dissertations. It can
+% be loaded simply with:
+%
+% \begin{verbatim}
+% \documentclass{udiss}
+% \end{verbatim}
+%
+% But, apart from the generic style, it also supplies
+% university or department specific files for some selected
+% institutions. Each specialised class file comes
+% with an identifier. E.g., if you want to use the template
+% for the Kerala university, you may use the |ukerala| tag
+% and load its template like in the following:
+%
+% \begin{verbatim}
+% \documentclass{udiss}
+% \dissertationstyle{ukerala}
+% \end{verbatim}
+%
+% We are willing to expand. If you want your institution to
+% be supported by us, please have a look at the instructions
+% given in \cref{req}. If you want to develop your own
+% style, please have a look at the developer's instruction
+% given in \cref{dev}. If you want to get your class
+% published under this bundle, please have a look at the
+% contribution guidelines given in \cref{con}.
+%
+% This document explains the user interface as well as the
+% implementation of the class. It has three major parts.
+% The first one contains the documentation of the class
+% (\cref{doc}), the second one contains the developer's
+% manual (\cref{dev}) and the third one contains the
+% implementation of it (\cref{imp}).
+%
+% Before getting started with the documentation, just a
+% brief note about our approach. As of version 0.1, we are
+% planning to have a radically all-modern and
+% backwards-blind approach. This is a Unicode-only package,
+% meaning, it won't work with the classic PDF\LaTeX. We load
+% the modern, well maintaned and inclusive implementation of
+% the Latin Modern family, i.e., the New Computer Modern
+% family (\url{ctan.org/pkg/newcm}). For using/testing the
+% class, please use the latest \TeX\ Live (all packages
+% updated, as of 2024-09-27). Both \hologo{XeLaTeX} and
+% Lua\LaTeX\ supported, but the latter is recommended as it
+% identifies scripts without markup.
+%
+% \section{Documentation}
+% \label{doc}
+%
+% This part of the document describes everything that a
+% normal user of this class should know. It enlists all the
+% features of the class.
+%
+% \subsection{User manual}
+%
+% Since this is a class that typesets dissertations, it
+% requires some basic information which is provided using
+% the following macros.
+%
+% We provide the usual \LaTeX-like macros for the
+% convenience, but these macros have
+% \emph{key-value}-equivalents as well.
+%
+% \begin{function}{\title,\author,\pronouns}
+% \begin{syntax}
+% \cs{title}\marg{the-title-of-the-dissertation}^^A
+% \ignorespaces\hfill^^A
+% {\footnotesize\faIcon{exclamation-triangle}}
+% \cs{author}\marg{name-of-the-author}^^A
+% \ignorespaces\hfill^^A
+% {\footnotesize\faIcon{exclamation-triangle}}
+% \cs{pronouns}\marg{the-pronouns-of-the-author}
+% \end{syntax}
+% Like in most standard \LaTeX\ classes, |\title|
+% command saves the title of the dissertation from its
+% argument. This is one of the commands which we mark as
+% \emph{strict}. In the manual, all such commands are
+% marked with a
+% {\footnotesize\faIcon{exclamation-triangle}} symbol at
+% the right end. If such commands (or their parametric
+% equivalents as shown in the following paragraph) are not
+% provided, the compilation is interrupted with an error.
+% The |\author| command doesn't return any error if the
+% class option |blind| is loaded. Since the |blind| option
+% is used for anonymous submissions, the author
+% information is irrelevant anyways and hence, is ignored.
+%
+% These macros are available as class options too. One
+% just has to use |title=|\marg{title} in the optional
+% argument of the |\documentclass| command. Similarly,
+% |author| and |pronouns| also are available.
+% \end{function}
+%
+% \begin{function}{\subtitle,\shorttitle}
+% \begin{syntax}
+% \cs{subtitle}\marg{the-subtitle-of-the-dissertation}
+% \cs{shorttitle}\marg{a-short-title-for-headers}
+% \end{syntax}
+% Dissertations often have a subtitle too, but it is not
+% an absolute requirement, so optionally, one may want to
+% use |\subtitle| command. Sometimes the title and the
+% subtitle are too long for the running header. One may
+% provide a short title with |\shorttitle| for this
+% purpose. Depending on the selected template and options,
+% it will be printed.
+%
+% These commands are also available as class options
+% |subtitle| and |shorttitle|.
+% \end{function}
+%
+% \begin{function}{\stream,\discipline,\degree}
+% \begin{syntax}
+% \cs{stream}\marg{the-name-of-the-stream}^^A
+% \ignorespaces\hfill^^A
+% {\footnotesize\faIcon{exclamation-triangle}}
+% \cs{discipline}\marg{the-name-of-the-discipline}^^A
+% \ignorespaces\hfill^^A
+% {\footnotesize\faIcon{exclamation-triangle}}
+% \cs{degree}\marg{the-name-of-the-degree}^^A
+% \ignorespaces\hfill^^A
+% {\footnotesize\faIcon{exclamation-triangle}}
+% \end{syntax}
+% These details are used at several places in the class.
+% E.g., the declaration, the \enquote{fulfilment}
+% statement printed on the first page. Like most other
+% macros, these too have straight forward
+% \emph{key-value}-equivalents |stream|, |discipline| and
+% |degree|.
+% \end{function}
+%
+% \begin{function}{\supervisor,\university,\department}
+% \begin{syntax}
+% \cs{supervisor}\marg{name-of-the-supervisor}^^A
+% \ignorespaces\hfill^^A
+% {\footnotesize\faIcon{exclamation-triangle}}
+% \cs{university}\marg{name-of-the-university}^^A
+% \ignorespaces\hfill^^A
+% {\footnotesize\faIcon{exclamation-triangle}}
+% \cs{department}\marg{name-of-the-department}^^A
+% \ignorespaces\hfill^^A
+% {\footnotesize\faIcon{exclamation-triangle}}
+% \end{syntax}
+% These commands are not seen in other standard
+% \LaTeX-classes, but \cls{udiss} requires them
+% obligatorily (only except in the |blind| mode).
+%
+% |supervisor|, |university| and |department| are the
+% \emph{key-value}-equivalents.
+% \end{function}
+%
+% \begin{function}{\logo,\logo*}
+% \begin{syntax}
+% \cs{logo}\marg{file-name}
+% \cs{logo*}\marg{\TeX-code}
+% \end{syntax}
+% Some departments mandate printing the university logos
+% in the dissertation. If this command is used, the logo
+% is printed. The location of the logo can be customised
+% as per the requirement. The class provides options for
+% that.
+%
+% If you are mad about \TeX\ and have a code for printing
+% the logo of your institute, use this command with a star
+% and in its argument, paste your code to get it printed
+% at an appropriate place.
+%
+% We have |logo| and |logo*| as the
+% \emph{key-value}-equivalents.
+% \end{function}
+%
+% \begin{function}{language,ldfbabel,nofontwarning}
+% \begin{syntax}
+% |language|=\marg{babel-language-names}
+% |ldfbabel|=\marg{babel-ldf-language-names}
+% |nofontwarning|=\marg{truth-value}\udissfval
+% \end{syntax}
+% The \pkg{babel} package has a complex mechanism for
+% loading languages. The complex design has its own
+% advantages, especially with regards to backwards
+% compatibility. For detailed explanation, it's best to go
+% through the user manual of \pkg{babel}, or its official
+% online documentation, especially the web-page at:
+% \url{\babelurl}.
+%
+% To help those who are completely at sea, we briefly will
+% have a look at the two mechanisms \pkg{babel} provides.
+% One is the original method of loading the
+% language-name(s) as class option(s), so something like:
+%
+% \begin{verbatim}
+% \usepackage[italian,hindi,english]{babel}
+% \end{verbatim}
+%
+% The last one from the list is understood as the
+% \enquote{main} language of the document. These languages
+% are defined using the so-called |.ldf|-files. A lot of
+% support for some languages is available using this
+% mechanism. For some European languages, e.g., French,
+% the difference between the two mechanisms is too sharp
+% and it has been found that a lot of native speakers
+% still prefer the old, stable way of using |.ldf|-files.
+% If you are one of them and you are used to loading
+% language-names as options to package \pkg{babel}, you
+% should use the |ldfbabel| option of \cls{udiss}. But we
+% advise against it.
+%
+% The second approach provided by \pkg{babel} for loading
+% languages is as follows:
+%
+% \bigskip
+% |\babelprovide|\marg{language-name}
+% \bigskip
+%
+% This method follows and uses the Unicode Common Locale
+% Data Repository (CLDR) for creating the resources. This
+% data is saved in |.ini| files. This is a more modern
+% approach, in our opinion. But it may cost us a little
+% bit of inconvenience since it doesn't support the common
+% short-hands which are provided by the |.ldf| files. But
+% short-hands make the input more and more \TeX-dependent
+% and thus less productive, so we don't endorse it. That
+% is why the more intuitive name for language-options in
+% this class is for the |.ini|-based approach. We load the
+% |english| language by default if no other is loaded. For
+% this too, we go with the |.ini| file developed for
+% English.
+%
+% The syntax of both these options is exactly like the one
+% provided by \pkg{babel}. One may provide a
+% comma-separated list and the last one of them will be
+% set as the main language of the document. Have a look at
+% \cref{dev} for more details regarding this.
+%
+% We also provide some auxiliary \TeX\ files with the
+% class for setting the font-families as well as the
+% language-specifics as required by \pkg{babel}. If a file
+% like that it is not found, we issue a warning. If the
+% users want that warning to be silent, they can use the
+% option |nofontwarning|.
+% \end{function}
+%
+% \begin{function}{license,copyright-yrs,localcopyright}
+% \begin{syntax}
+% |license|=\marg{all-rights-reserved/CC-BY-SA/GFDL}^^A
+% \udissarr
+% |copyright-yrs|=\marg{copyrightable-years}\hfill^^A
+% {\color{udisslink}|\the\year|}
+% |localcopyright|=\marg{the-word-for-copyright}^^A
+% \hfill{\color{udisslink}|Copyright|}
+% \end{syntax}
+% This is an option to set a license for the dissertation.
+% We encourage users to use free culture licenses.
+% Currently we support two popular licenses, i.e.,
+% \enquote{CC-BY-SA 4.0+ International} and \enquote{GFDL
+% v1.3+}. We don't set any license by default as we
+% believe making a work \enquote{free} (as in freedom)
+% should be the decision of the author and hence
+% \enquote{all rights are reserved} by default. If you are
+% not using the |blind| package option, your output will
+% have a copyright notice with your (author's) name and
+% the current year as the copyrightable year in the
+% metadata of the PDF. If you are wondering why, the
+% |blind| option is for preserving the anonymity of the
+% author and the copyright-notices require a
+% copyright-holder by default, thus with |blind| option,
+% we have disabled choosing licenses. If you want to
+% change the copyrightable year(s), you may use the option
+% |copyright-yrs|. Since the package is supposed to
+% support multilingual typesetting, we have provided an
+% option to change the word \enquote{Copyright} to the one
+% in the main language of your document.
+% \end{function}
+%
+% \begin{function}{placeholders}
+% \begin{syntax}
+% |placeholders|
+% \end{syntax}
+% If you want to see how the things so far discussed come
+% together, you may just load this option. It places
+% placeholders for all the options discussed for creating
+% a sample document.
+% \end{function}
+%
+% \begin{function}{^^A
+% lot,lof,declaration,declarationtxt,decllocal^^A
+% }
+% \begin{syntax}
+% |lot|=\marg{truth-value}\udissfval
+% |lof|=\marg{truth-value}\udissfval
+% |declaration|=\marg{truth-value}\udissfval
+% \end{syntax}
+% By default, the class only prints the table of contents.
+% If the author requires the list of figures (|lof|) or
+% tables (|lot|), they may use the respective option.
+% These are boolean keys which take either |true| or
+% |false| as their values. Not passing any truth-value to
+% a |key| is equivalent to using |key=true|. Similarly,
+% many universities require a declaration from the
+% candidate regarding the originality of the work. We have
+% provided a sample draft of the declaration in a
+% renewable macro, but it is not enabled by default. After
+% getting comments from the community, we will decide what
+% should be done with it. Note that the default value for
+% all these keys is |false|\footnote{^^A
+% Throughout the documentation, at the right corner, we
+% enlist the possible values to a key and the default
+% one is marked in red.^^A
+% }. Declaration text can be edited using |declarationtxt|
+% option. The local word for declaration is stored in
+% |decllocal| (defaulting to \enquote{Declaration}).
+% \end{function}
+%
+% \begin{function}{blind}
+% \begin{syntax}
+% |blind|=\marg{truth-value}\udissfval
+% \end{syntax}
+% At times, anonymous submissions are required where the
+% name of the author and supervisor is hidden.
+% \end{function}
+%
+% \begin{function}{framed-title}
+% \begin{syntax}
+% |framed-title|=\marg{truth-value}\udissfval
+% \end{syntax}
+% By default the title-page is very minimal. If a user
+% wants to have a frame around the title-page, they may
+% use this option.
+% \end{function}
+%
+% \begin{function}{^^A
+% print,norefcolors,colorprint,udisslinkclr,^^A
+% udissurlclr,udissciteclr^^A
+% }
+% \begin{syntax}
+% |print|=\marg{truth-value}\udissfval
+% |norefcolors|=\marg{truth-value}\udissfval
+% |udisslinkclr|=\marg{link-colour}\udisscolorred
+% |udissurlclr|=\marg{url-colour}\udisscolorblue
+% |udissciteclr|=\marg{cite-colour}\udisscolorgreen
+% \end{syntax}
+% Many departments require the submissions to be made in
+% the print form as well. For that, |print| is a boolean
+% option. It creates outputs suitable for the print
+% submissions. The class, by default, does not use |print|
+% option. The default output of the class is suitable for
+% digital submissions. The following settings are always
+% turned on by the class in normal circumstances:
+%
+% \begin{itemize}
+% \item The \pkg{hyperref} package is loaded.
+% \item The \pkg{xcolor} package is loaded. Some colours
+% for the internal cross-references are pre-selected.
+% \end{itemize}
+%
+% If you don't want colours for the hyperlinks in your
+% digital document, you may use the |norefcolors|
+% option. If you don't like the pre-defined colour-scheme
+% given by us for the digital documents, you may use the
+% class options specifically developed for changing them.
+% They are |udisslinkclr|, |udissurlclr| and
+% |udissciteclr|. The arguments of these options are
+% either the pre-defined colours by package |xcolor| or
+% user-defined colours with the |\colorlet| or
+% |\definecolor| commands. The default colour-scheme
+% used by us is as seen in the macro explanation above.
+%
+% More importantly though, if a PDF with colours is given
+% for printing and the printer is using the black and
+% white mode, then the coloured words look faded in the
+% print out. To avoid this, we load the \pkg{xcolor}
+% package only when the |print| option is \emph{not}
+% loaded (basically always, by default). For performance
+% reasons, we don't load the |hyperref| package when
+% |print| is loaded. Hyper-references make sense only in a
+% digital PDF, so to optimise PDF compilation, in |print|
+% mode, we don't load |hyperref|.
+% \end{function}
+%
+% Note that if you are using the |license| option with
+% |CC-BY-SA|, the \pkg{doclicense} package |\Require|d for
+% printing the license automatically loads the
+% \pkg{hyperref} package. We don't have any control over it
+% and hence, you will see the hyperlink boxes around the
+% CC-text. You can safely ignore them as the text is still
+% in black colour and your objective is anyways just to
+% \emph{print} the output.
+%
+% \begin{function}{oldstylenumoff,oldone}
+% \begin{syntax}
+% |oldstylenumoff|=\marg{truth-value}\udissfval
+% |oldone|=\marg{truth-value}\udissfval
+% \end{syntax}
+% In text, the old style numbers look better. The numbers
+% in the current document are old style. Lining numbers,
+% on the other hand, don't have ascenders and descenders.
+%
+% If you prefer the lining numbers, you may turn this
+% option on and all the fonts will start showing lining
+% numbers. Note that printing of old style numbers also
+% depends upon whether the font has old style numbers or
+% not. The relevant settings are added to the font
+% automatically, but while selecting the font, first make
+% sure whether the old style table is present or not.
+%
+% Apart from that, the New Computer Modern font family
+% provides an old-style shape for the number 1 (this exact
+% shape!), but this shape is provided as a character
+% variant and character variants cannot be loaded
+% globally, since various fonts may have various variants
+% at that slot, hence if someone wants this shape, they
+% will have to use the |oldone| option. Without this
+% option the number looks like as seen on the first line
+% and that's the default style of \cls{udiss}.
+%
+% \begin{quote}
+% {\newcmnewone 0123456789}\hfill
+% \begingroup
+% \ttfamily\footnotesize\color{udisslink}^^A
+% Old style with default 1^^A
+% \endgroup
+%
+% 0123456789\hfill
+% \texttt{\footnotesize Old style with the old 1}^^A
+%
+% {\newcmnewnum 0123456789}\hfill
+% \texttt{\footnotesize Lining}^^A
+% \end{quote}
+% \end{function}
+%
+% \begin{function}{fulfilment}
+% \begin{syntax}
+% |fulfilment|=\ignorespaces^^A
+% \marg{the-titlepage-sentence-about-course-requirement}
+% \end{syntax}
+% The title-page prints a sentence which says:
+%
+% \begin{quote}
+% A dissertation submitted in the partial fulfilment of
+% the requirements for the |\udiss@degree|\ program
+% in |\udiss@discipline|.
+% \end{quote}
+%
+% In order to change it, one may use this package option.
+% If you want to use the internal macros for univesity
+% and department names, don't forget to use
+% |\makeatletter| and |\makeatother|.
+% \end{function}
+%
+% As described in the introduction (\cref{int}), the users
+% can choose to load the generic style or a specialised
+% style. For that, we have the following macro:
+%
+% \begin{function}{\dissertationstyle}
+% \begin{syntax}
+% \cs{dissertationstyle}\marg{style-for-dissertation}
+% \end{syntax}
+% With this command, you may select the institute or the
+% style. It will set certain defaults.
+%
+% We provide limited support as of v0.1 (only for
+% university of Kerala). We wish to expand more. Send us
+% support requests for adding your institute to the list.
+% \end{function}
+%
+% \subsection{Multilingual typesetting}
+%
+% The \cls{udiss} class aims at supporting multilingual
+% typesetting by default. We load the \pkg{babel} package
+% for linguistic support, \pkg{fontspec} and
+% \pkg{unicode-math} package for loading fonts. It's the
+% best to not load them again. For loading languages, it's
+% best to use the package internal mechanism. If you find
+% something missing in the mechanism, you may load
+% \pkg{babel} or \pkg{fontspec} commands directly. Please
+% consider reporting a missing feature so that we can
+% implement it in the future versions.
+%
+% We will see two examples of loading languages.
+%
+% \subsection[Developer's manual]{^^A
+% Developer's manual\marginpar{\hfill\dbend}\\[0.5ex]^^A
+% \small\normalfont\itshape
+% \quad Only if you sure about what you are doing^^A
+% }
+% \label{dev}
+%
+% As the section title and the double bend suggests, this
+% area is for advanced customisation. Only enter it if you
+% have sufficient confidence to avoid errors.
+%
+%
+% \subsubsection{Fonts}
+%
+% We are a Unicode-only class, so we need to take care of
+% three major font families, i.e., Roman,
+% \texttt{Typewriter} and \textsf{Sans} (stylisation
+% intentional, for demonstration). The \pkg{fontspec}
+% package takes care of Unicode fonts in \LaTeX, but we,
+% additionally, load package \pkg{unicode-math} too, to set
+% math-fonts. Even though, this much is practically enough
+% for font-selection, we go with the \pkg{babel}'s mechanism
+% of loading language-specific fonts, so that the fonts
+% don't apply globally. Our class already takes care of most
+% of the requirements regarding font, but if you want to
+% tinker with the defaults, you are advised to read this
+% section. The following parameters are for you.
+%
+% \begin{function}{explicitext,ignorefsoff}
+% \begin{syntax}
+% |explicitext|=\marg{truth-value}\udissfval
+% |ignorefsoff|=\marg{truth-value}\udisstval
+% \end{syntax}
+% Without this option, one cannot use the |Extension|
+% parameter of package \pkg{fontspec}/\pkg{unicode-math}.
+% We have some options later which set the extension for
+% |rm|, |sf| and |tt| families. They are also useless if
+% this key is not used. A word of caution: loading
+% explicit extensions for fonts is restrictive. Suppose
+% you want to use KpRoman-Regular as your normal font,
+% but, say, FreeSerifBold as your bold font (please don't,
+% this is solely for exemplification :P), loading an
+% explicit extension will cause errors as the former is an
+% OpenType font and the latter is a TrueType one. So if
+% you are 200\% sure that all the fonts you need use one
+% particular extension \emph{only}, then use this option.
+% Otherwise, you are better off without it.
+%
+% The \TeX-tree contains many files having the
+% |.fontspec| extension. These files contain predefined
+% settings for fonts which the users may not always want.
+% Thus, we ignore these files by default. If you are very
+% sure that you want to load |.fontspec| files, you may
+% turn our conditional off and the |.fontspec|-files, will
+% be loaded correctly.
+% \end{function}
+%
+% \begin{function}{^^A
+% rmfeatures,sffeatures,ttfeatures,mathfeatures^^A
+% }
+% \begin{syntax}
+% |rmfeatures|=\marg{font-features-for-serif-fonts}
+% |sffeatures|=\marg{font-features-for-sans-fonts}
+% |ttfeatures|=\marg{font-features-for-mono-fonts}
+% |mathfeatures|=\marg{font-features-for-math-fonts}
+% \end{syntax}
+% We have |udiss|-options for most commonly used optional
+% parameters of fonts, still there are a lot of them
+% available which we didn't consider important for the
+% purpose of this class, e.g., |Scale|, |Color|. If you
+% want to use these features with your fonts, you may use
+% these four options as per your need. The value of this
+% key is directly injected in the font-loading commands.
+% \end{function}
+%
+% \begin{function}{rmfntext,sffntext,ttfntext,mathfntext}
+% \begin{syntax}
+% |rmfntext|=\ignorespaces^^A
+% \marg{font-extension-for-serif-fonts}\ignorespaces^^A
+% \hfill\texttt{ttf\,\textbar\,otf}
+% |sffntext|=\ignorespaces^^A
+% \marg{font-extension-for-sans-fonts}\ignorespaces^^A
+% \hfill\texttt{ttf\,\textbar\,otf}
+% |ttfntext|=\ignorespaces^^A
+% \marg{font-extension-for-mono-fonts}\ignorespaces^^A
+% \hfill\texttt{ttf\,\textbar\,otf}
+% |mathfntext|=\ignorespaces^^A
+% \marg{font-extension-for-math-fonts}\ignorespaces^^A
+% \hfill\texttt{ttf\,\textbar\,otf}
+% \end{syntax}
+% With these four options, one may choose either
+% |ttf| or |otf| extension for a particular font family.
+% As mentioned before, it applies to all the fonts loaded
+% in that family. Note that these options are only used
+% when the |explicitext| option is active. This is why
+% there is no default value set. By default this explicit
+% extension method itself is not used.
+% \end{function}
+%
+% If you want to know the default fonts we load always with
+% \cls{udiss}, you may refer to \cref{udissenfonts}.
+%
+% \begin{table}
+% \centering
+% \small
+% \begin{tabular}{llll}
+% \toprule
+% \textfunction{rmfont} &
+% \textfunction{sffont} &
+% \textfunction{ttfont} \\
+% NewCM10-Book &
+% NewCMSans10-Book &
+% NewCMMono10-Book \\
+% \specialrule{0pt}{\aboverulesep}{\aboverulesep}
+% \textfunction{rmbffont} &
+% \textfunction{sfbffont} &
+% \textfunction{ttbffont} \\
+% NewCM10-Bold &
+% NewCMSans10-Bold &
+% NewCMMono10-Bold \\
+% \specialrule{0pt}{\aboverulesep}{\aboverulesep}
+% \textfunction{rmitfont} &
+% \textfunction{sfitfont} &
+% \textfunction{ttitfont} \\
+% NewCM10-BookItalic &
+% NewCMSans10-BookItalic &
+% NewCMMono10-BookItalic \\
+% \specialrule{0pt}{\aboverulesep}{\aboverulesep}
+% \textfunction{rmbfitfont} &
+% \textfunction{sfbfitfont} &
+% \textfunction{ttbfitfont} \\
+% NewCM10-BoldItalic &
+% NewCMSans10-BoldOblique &
+% NewCMMono10-BoldOblique \\
+% \specialrule{0pt}{\aboverulesep}{\aboverulesep}
+% \textfunction{rmslfont} &
+% \textfunction{sfslfont} &
+% \textfunction{ttslfont} \\
+% NewCM10-Book &
+% NewCMSans10-BookOblique &
+% NewCMMono10-Book \\
+% \specialrule{0pt}{\aboverulesep}{\aboverulesep}
+% \textfunction{rmbfslfont} &
+% \textfunction{sfbfslfont} &
+% \textfunction{ttbfslfont} \\
+% NewCM10-Bold &
+% NewCMSans10-BoldOblique &
+% NewCMMono10-BoldOblique \\
+% \midrule
+% \textfunction{mathfont} & & \\
+% NewCMMath-Book & & \\
+% \specialrule{0pt}{\aboverulesep}{\aboverulesep}
+% \textfunction{mathbffont} & & \\
+% NewCMMath-Bold & & \\
+% \bottomrule
+% \end{tabular}
+% \caption{Default fonts for English language (all otfs)}
+% \label{udissenfonts}
+% \end{table}
+%
+% \subsubsection{Title-page customisation}
+%
+% The title-page prints several fields and very often
+% authors are very picky about it. Most of the things we
+% offer in it are customisable. One may change the following
+% things for all the major fields on the title-page.
+%
+% \begin{enumerate}
+% \item The font
+% \item The font-size
+% \item The font-color
+% \item The font-shape (e.g., |\itshape|, |\scshape| etc.)
+% \item Additional features to the font loaded
+% \end{enumerate}
+%
+% All the parameters (along with their default values) are
+% listed in \cref{titlepagetbl}. The table uses \enquote{-}
+% when there is no change in the default, only the fields
+% having a special value are marked.
+%
+% \begin{table}
+% \small
+% \centering
+% \begin{tabular}{>{\itshape\normalsize}llllll}
+% \toprule
+% Title &
+% - &
+% |\bfseries| &
+% huge &
+% black &
+% -\\
+% & \scriptsize\textfunction{titlefont} &
+% \scriptsize\textfunction{titleshape} &
+% \scriptsize\textfunction{titlesize} &
+% \scriptsize\textfunction{titlecolor} &
+% \scriptsize\textfunction{titleffeat}\\
+% \cmidrule{2-6}
+% Subtitle &
+% - &
+% |\normalfont| &
+% large &
+% black &
+% -\\
+% & \scriptsize\textfunction{subtitlefont} &
+% \scriptsize\textfunction{subtitleshape} &
+% \scriptsize\textfunction{subtitlesize} &
+% \scriptsize\textfunction{subtitlecolor} &
+% \scriptsize\textfunction{subtitleffeat}\\
+% \cmidrule{2-6}
+% Author &
+% - &
+% |\normalfont| &
+% large &
+% black &
+% -\\
+% & \scriptsize\textfunction{authorfont} &
+% \scriptsize\textfunction{authorshape} &
+% \scriptsize\textfunction{authorsize} &
+% \scriptsize\textfunction{authorcolor} &
+% \scriptsize\textfunction{authorffeat}\\
+% \cmidrule{2-6}
+% University &
+% - &
+% |\normalfont| &
+% |\normalsize| &
+% black &
+% -\\
+% & \scriptsize\textfunction{unifont} &
+% \scriptsize\textfunction{unishape} &
+% \scriptsize\textfunction{unisize} &
+% \scriptsize\textfunction{unicolor} &
+% \scriptsize\textfunction{uniffeat}\\
+% \cmidrule{2-6}
+% Department &
+% - &
+% |\normalfont| &
+% |small| &
+% black &
+% -\\
+% & \scriptsize\textfunction{deptfont} &
+% \scriptsize\textfunction{deptshape} &
+% \scriptsize\textfunction{deptsize} &
+% \scriptsize\textfunction{deptcolor} &
+% \scriptsize\textfunction{deptffeat}\\
+% \cmidrule{2-6}
+% Fulfilment &
+% - &
+% |\normalfont| &
+% small &
+% black &
+% -\\
+% & \scriptsize\textfunction{fffont} &
+% \scriptsize\textfunction{ffshape} &
+% \scriptsize\textfunction{ffsize} &
+% \scriptsize\textfunction{ffcolor} &
+% \scriptsize\textfunction{fffeat}\\
+% \bottomrule
+% \end{tabular}
+% \caption{Customising title-page}
+% \label{titlepagetbl}
+% \end{table}
+%
+% \begin{function}{logowidth,logoheight}
+% \begin{syntax}
+% |logowidth|=\marg{logo-width-proportion}\hfill^^A
+% \begingroup^^A
+% \ttfamily\color{udisslink}^^A
+% 0.3^^A
+% \endgroup
+% |logoheight|=\marg{logo-height-proportion}\hfill^^A
+% \begingroup^^A
+% \ttfamily\color{udisslink}^^A
+% 0.075^^A
+% \endgroup
+% \end{syntax}
+% By default the width of the logo is
+% 0.3$\times$|\linewidth| and 0.075$\times$|\textheight|.
+% If you want to change these default numbers, you may use
+% these parameters.
+% \end{function}
+% \subsection[^^A
+% Contributing to our repository^^A
+% ]{^^A
+% Contributing to the bundle^^A
+% \marginpar{\hfill\ddbend}\\[0.5ex]^^A
+% \small\normalfont\itshape
+% \quad Only if you are ready to bear with us :P^^A
+% }
+% \label{con}
+%
+% We welcome contributions to our code. Our code is hosted
+% at Puszcza, a free-software-based web-space. But for
+% consistency, we request our supporters to write the code
+% using 60 characters per line limit. Try to adhere to the
+% coding conventions. If there is a slight violation here
+% and there in your patches, please don't mind us editing
+% your code first and then merging it in the main branch.
+%
+% We release our code with GPLv3+ and the documentation with
+% GFDLv1.3+. Your patches also will have to comply with the
+% conditions of these licenses.
+%
+% If you wish to document your patches, please avoid
+% gendered language. Use \emph{they/them} pronouns when
+% referring to users.
+%
+% Apart from university-styles, we also need support for
+% language and fonts. If you know free/libre Unicode fonts
+% for your language, please release them on CTAN or let us
+% know about them, so that we will release using our
+% templates. Provide appropriate translations for the fields
+% provided in class.
+%
+% The class comes with a test-suit. You are advised to run
+% |l3build check| command before pushing a patch. This way
+% we can be sure that the patch doesn't break any of the
+% already existing features. If you think something was
+% buggy in the original design and you got a fix for that,
+% kindly run |l3build save| on the concerned test file and
+% push the changed |.lvt| and |.tlg|s also.
+%
+% \section{Requests for new templates}
+% \label{req}
+%
+% We are open to your support-requests too. Just let us know
+% the norms and conventions of your institution. Let us know
+% which fields you would like to have pre-filled in the
+% style file. If you require the logo to be printed on the
+% title-page, send it to us in a decent resolution. We will
+% include it in our bundle.
+% \end{documentation}
+%
+% \begin{implementation}
+% \section{Implementation}
+% \label{imp}
+%
+% In this section, we explain how this program was
+% developed. We discuss the tools used by us for developing
+% the features offered in this class. The features can be
+% seen in the left margin hyperlinked to their respective
+% place in the documentation section \cref{doc}.
+%
+% We first declare the tag used by the |.ins| file for
+% stripping the source-code of the generic class. We will
+% have several tags for generating the other class-files,
+% but for the convenience of maintenance, we will have all
+% the code in this central |.dtx| file.
+%
+% \begin{macrocode}
+%<*class>
+% \end{macrocode}
+%
+% First we declare the class with some elementary
+% information.
+%
+% \begin{macrocode}
+\ProvidesClass{udiss}[2024/10/01 v0.1
+ A LaTeX bundle for typesetting dissertations (TUGIndia)]
+% \end{macrocode}
+%
+% We develop the options for the class using
+% |\ekvdefinekeys| command. This command is provided by the
+% \expkvlogo{def} package, whereas for creating
+% class/package options, we use the \expkvlogo{opt}
+% package. For performance reasons, we don't use the entire
+% \expkvlogo{bundle}.
+%
+% \begin{macrocode}
+\RequirePackage{expkv-def,expkv-opt}
+% \end{macrocode}
+%
+% \begin{macro}{\pronouns,pronouns}
+% Mostly we have implemented the macros in the same order
+% as they are documented, but the exception is of the
+% first two, i.e., |\title| and |\author|. These commands
+% are developed by the standard classes too and hence,
+% after loading the class (\cls{memoir} in our case) their
+% definitions are rewritten. Thus these two macros are
+% developed a little late in the code. Rest is still in
+% line with the documentation. The method of saving the
+% values of the macros is an indirect one. We use internal
+% macros (e.g., |\udiss@title|) for saving them.
+%
+% We start with the |pronouns| field. Since it is
+% optional, we don't need any errors here. At each step,
+% we set some if-conditionals. All of them follow the
+% standard convention of prefixing the class/package name
+% and the |@| symbol for internalising. Have a look at the
+% following two conditionals which we use immediately
+% while defining the |pronouns| field:
+%
+% \begin{macrocode}
+\newif\ifudiss@pronouns
+\newif\ifudiss@blind
+% \end{macrocode}
+%
+% We use the \pkg{xparse}-syntax for developing user-side
+% macros. First we check if the class option |blind| is
+% loaded. If it is so, there is no point in saving
+% |pronouns|, hence it is skipped. The following code does
+% that:
+%
+% \begin{macrocode}
+\NewDocumentCommand{ \pronouns }{ m }{%
+ \ifudiss@blind
+ \else
+ \def\udiss@pronouns{#1}%
+ \fi
+}
+% \end{macrocode}
+%
+% As mentioned before, we use \expkvlogo{def} and
+% \expkvlogo{opt} packages for developing the
+% \emph{key-values}. The former proives a command
+% |\ekvdefinekeys| that defines all the \emph{key}s. We
+% could have called it just once in the code and developed
+% all the \emph{key}s at one go, but in order to keep the
+% implementation in line with the documentation and for a
+% generally better readable code, we segment it in several
+% pieces and develop the respective options with different
+% calls of |\ekvdefinekeys|. Note that the set used for
+% all of them is still the same, i.e., |udiss|. Storing a
+% value passed to a key in a specific macro for later use
+% is quite straight-forward in \expkvlogo{def}, but since
+% we need to set some macros conditionally, we will use
+% the |code| \emph{type} of \expkvlogo{}. The first
+% non-space-token followed by the invocation of this type
+% is the name of the \emph{key}. Its argument is an
+% arbitrary \TeX-code where we can use have the usual
+% \TeX-argument-call, i.e., |#1|.
+%
+%
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ code pronouns = {%
+ \ifudiss@blind
+ \else
+ \def\udiss@pronouns{(#1)}%
+ \fi
+ \udiss@pronounstrue
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% The |\ifudiss@blind| conditional was developed in order to
+% conditionally save (and print) some information which
+% identifies the author. If a user loads the option |blind|,
+% they don't need that information to be printed and since
+% it is not supposed to be printed, why to even save it?
+% Thus we save it only when needed.
+%
+% \begin{macro}{title,author}
+%
+% Since we don't allow blank arguments for \emph{strict}
+% commands/parameters, we check their existence there and
+% there and generate an error if found blank. Since we
+% need to error twice (once with the macro, once with the
+% parameter, we save the code for generating the error in
+% a handy internal macro. Let's have a look at one
+% developed for the |title| field.
+%
+% \begin{macrocode}
+\newif\ifudiss@title
+\def\udiss@blank@title@err{%
+ \ClassError{udiss}{%
+ The `title' field cannot be blank%
+ }{%
+ You have provided an empty argument to the `title'
+ field. This is not\MessageBreak permitted by the class.%
+ }%
+}
+% \end{macrocode}
+%
+% We use the same method for all the other \emph{strict}
+% commands too.
+%
+% \begin{macrocode}\newif\ifudiss@author
+\def\udiss@blank@author@err{%
+ \ClassError{udiss}{%
+ The `author' field cannot be blank%
+ }{%
+ You have provided an empty argument to the `author'
+ field. This is not\MessageBreak permitted by the class.%
+ }%
+}
+% \end{macrocode}
+%
+% Now we start developing the code for the |title| and
+% |author| parameters. In order to check whether a macro
+% is empty or not, we need to use the
+% |\ifx\macro|$_{1}$|\macro|$_{2}$ construct. But since
+% we have an argument and not a ready macro for
+% comparison, we first we develop an internal macro with
+% the argument as its value.
+%
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ code title = {%
+ \def\udiss@tmp@title{#1}%
+% \end{macrocode}
+%
+% The true branch of this conditional, i.e., everything
+% till either |\else| or |\fi| is found, defines the
+% actual macro to be used while typesetting, i.e.,
+% |\udiss@title|, but since the user has provided a blank
+% macro, we give a cryptic value to the macro, e.g.,
+% |-NoValidTitle-|. Note that this gets printed in the
+% document even though the user gets an error. Since we
+% use this regularly, a user may search for |-NoValid| in
+% the output to find out all the values they missed
+% providing.
+%
+% \begin{macrocode}
+ \ifx\udiss@tmp@title\empty
+ \def\udiss@title{-NoValidTitle-}%
+% \end{macrocode}
+%
+% After this, we print the error for the blank argument.
+% In the |\else| branch (which means the user did
+% \emph{not} pass a blank argument, but provided a
+% legit value), we define the command with the actual
+% user-given-value. This is the most ideal condition.
+%
+% \begin{macrocode}
+ \udiss@blank@title@err
+ \else
+ \def\udiss@title{#1}%
+ \fi
+ },%
+% \end{macrocode}
+%
+% We repeat the same pattern for the \emph{strict} commands
+% now. Here is the code for |author|.
+%
+% \begin{macrocode}
+ code author = {%
+ \def\udiss@tmp@author{#1}%
+ \ifx\udiss@tmp@author\empty
+ \def\udiss@author{-NoValidAuthor-}%
+ \udiss@blank@author@err
+ \else
+ \def\udiss@author{#1}%
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{subtitle,\subtitle,shorttitle,\shorttitle}
+% Here is the code for the |subtitle| and |shorttitle|
+% fields. As they aren't \emph{strict}, no errors needed
+% for them. We need a conditional though. We set it to
+% true so that it is understood that this field was not
+% forgotten by the author. Only if their value is true, we
+% print them later.
+%
+% \begin{macrocode}
+\newif\ifudiss@subtitle
+\newif\ifudiss@shorttitle
+\ekvdefinekeys{udiss}{%
+ code subtitle = {%
+ \IfBlankTF{#1}{%
+ \def\udiss@subtitle{-NoValidSubtitle-}%
+ \udiss@subtitletrue
+ }{%
+ \def\udiss@subtitle{#1}%
+ \udiss@subtitletrue
+ }%
+ },%
+ code shorttitle = {%
+ \IfBlankTF{#1}{%
+ \def\udiss@shorttitle{-NoValidSubtitle-}%
+ \udiss@shorttitletrue
+ }{%
+ \def\udiss@shorttitle{#1}%
+ \udiss@shorttitletrue
+ }%
+ }%
+}
+\NewDocumentCommand{ \subtitle }{ m }{%
+ \def\udiss@subtitle{#1}%
+ \udiss@subtitletrue
+}
+\NewDocumentCommand{ \shorttitle }{ m }{%
+ \def\udiss@shorttitle{#1}%
+ \udiss@shorttitletrue
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{^^A
+% stream,\stream,discipline,\discipline,^^A
+% degree,\degree^^A
+% }
+% Again some compulsory fields, so we develop the errors,
+% then the \emph{key}s and then the macros.
+%
+% \begin{macrocode}
+\newif\ifudiss@stream
+\def\udiss@blank@stream@err{%
+ \ClassError{udiss}{%
+ The `stream' field cannot be blank%
+ }{%
+ You have provided an empty argument to the `stream'
+ field. This is not\MessageBreak permitted by the class.%
+ }%
+}
+\newif\ifudiss@discipline
+\def\udiss@blank@discipline@err{%
+ \ClassError{udiss}{%
+ The `discipline' field cannot be blank%
+ }{%
+ You have provided an empty argument to the `discipline'
+ field. This is not\MessageBreak permitted by the class.%
+ }%
+}
+\newif\ifudiss@degree
+\def\udiss@blank@degree@err{%
+ \ClassError{udiss}{%
+ The `degree' field cannot be blank%
+ }{%
+ You have provided an empty argument to the `degree'
+ field. This is not\MessageBreak permitted by the class.%
+ }%
+}
+\ekvdefinekeys{udiss}{%
+ code stream = {%
+ \def\udiss@tmp@stream{#1}%
+ \ifx\udiss@tmp@stream\empty
+ \def\udiss@stream{-NoValidStream-}%
+ \udiss@blank@stream@err
+ \else
+ \def\udiss@stream{#1}%
+ \fi
+ },%
+ code discipline = {%
+ \def\udiss@tmp@discipline{#1}%
+ \ifx\udiss@tmp@discipline\empty
+ \def\udiss@discipline{-NoValidDiscipline-}%
+ \udiss@blank@discipline@err
+ \else
+ \def\udiss@discipline{#1}%
+ \fi
+ },%
+ code degree = {%
+ \def\udiss@tmp@degree{#1}%
+ \ifx\udiss@tmp@degree\empty
+ \def\udiss@degree{-NoValidDegree-}%
+ \udiss@blank@degree@err
+ \else
+ \def\udiss@degree{#1}%
+ \fi
+ }%
+}
+\NewDocumentCommand{ \stream }{ m }{%
+ \IfBlankTF{#1}{%
+ \udiss@blank@stream@err
+ \def\udiss@stream{-NoValidStream-}%
+ }{%
+ \def\udiss@stream{#1}%
+ }%
+ \IfBlankTF{#1}{%
+ \udiss@streamtrue
+ }{%
+ \def\udiss@stream{#1}%
+ \udiss@streamtrue
+ }%
+}
+\NewDocumentCommand{ \discipline }{ m }{%
+ \IfBlankTF{#1}{%
+ \udiss@blank@discipline@err
+ \def\udiss@discipline{-NoValidDiscipline-}%
+ }{%
+ \def\udiss@discipline{#1}%
+ }%
+ \IfBlankTF{#1}{%
+ \udiss@disciplinetrue
+ }{%
+ \def\udiss@discipline{#1}%
+ \udiss@disciplinetrue
+ }%
+}
+\NewDocumentCommand{ \degree }{ m }{%
+ \IfBlankTF{#1}{%
+ \udiss@blank@degree@err
+ \def\udiss@degree{-NoValidDegree-}%
+ }{%
+ \def\udiss@degree{#1}%
+ }%
+ \IfBlankTF{#1}{%
+ \udiss@degreetrue
+ }{%
+ \def\udiss@degree{#1}%
+ \udiss@degreetrue
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% We then develop the last set of \emph{strict} macros which
+% are used in the declaration and some on the title-page
+% too. The method is no different.
+%
+% \begin{macro}{^^A
+% supervisor,\supervisor,university,\university,^^A
+% department,\department^^A
+% }
+% \begin{macrocode}
+\newif\ifudiss@supervisor
+\newif\ifudiss@university
+\newif\ifudiss@department
+\def\udiss@blank@supervisor@err{%
+ \ClassError{udiss}{%
+ The `supervisor' field cannot be blank%
+ }{%
+ You have provided an empty argument to the `supervisor'
+ field. This is not\MessageBreak permitted by the class.%
+ }%
+}
+\def\udiss@blank@university@err{%
+ \ClassError{udiss}{%
+ The `university' field cannot be blank%
+ }{%
+ You have provided an empty argument to the `university'
+ field. This is not\MessageBreak permitted by the class.%
+ }%
+}
+\def\udiss@blank@department@err{%
+ \ClassError{udiss}{%
+ The `department' field cannot be blank%
+ }{%
+ You have provided an empty argument to the `department'
+ field. This is not\MessageBreak permitted by the class.%
+ }%
+}
+\ekvdefinekeys{udiss}{%
+ code supervisor = {%
+ \def\udiss@tmp@supervisor{#1}%
+ \ifx\udiss@tmp@supervisor\empty
+ \def\udiss@supervisor{-NoValidSupervisor-}%
+ \udiss@blank@supervisor@err
+ \else
+ \def\udiss@supervisor{#1}%
+ \fi
+ },%
+ code university = {%
+ \def\udiss@tmp@university{#1}%
+ \ifx\udiss@tmp@university\empty
+ \def\udiss@university{-NoValidUniversity-}%
+ \udiss@blank@university@err
+ \else
+ \def\udiss@university{#1}%
+ \fi
+ },%
+ code department = {%
+ \def\udiss@tmp@department{#1}%
+ \ifx\udiss@tmp@department\empty
+ \def\udiss@department{-NoValidDepartment-}%
+ \udiss@blank@department@err
+ \else
+ \def\udiss@department{#1}%
+ \fi
+ }%
+}
+\NewDocumentCommand{ \supervisor }{ m }{%
+ \IfBlankTF{#1}{%
+ \udiss@blank@supervisor@err
+ \def\udiss@supervisor{-NoValidSupervisor-}%
+ }{%
+ \def\udiss@supervisor{#1}%
+ }%
+ \IfBlankTF{#1}{%
+ \udiss@supervisortrue
+ }{%
+ \def\udiss@supervisor{#1}%
+ \udiss@supervisortrue
+ }%
+}
+\NewDocumentCommand{ \university }{ m }{%
+ \IfBlankTF{#1}{%
+ \udiss@blank@university@err
+ \def\udiss@author{-NoValidUniversity-}%
+ }{%
+ \def\udiss@university{#1}%
+ }%
+ \IfBlankTF{#1}{%
+ \udiss@universitytrue
+ }{%
+ \def\udiss@university{#1}%
+ \udiss@universitytrue
+ }%
+}
+\NewDocumentCommand{ \department }{ m }{%
+ \IfBlankTF{#1}{%
+ \udiss@blank@department@err
+ \def\udiss@author{-NoValidDepartment-}%
+ }{%
+ \def\udiss@department{#1}%
+ }%
+ \IfBlankTF{#1}{%
+ \udiss@departmenttrue
+ }{%
+ \def\udiss@department{#1}%
+ \udiss@departmenttrue
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{ \logo,\logo* }
+% We develop the |\logo| command with a starred variant
+% using the intuitive \pkg{xparse} trickery. Notice the
+% use of two different conditionals |\ifudiss@logo| and
+% |\ifudiss@texlogo|.
+%
+% \begin{macrocode}
+\newif\ifudiss@logo
+\newif\ifudiss@texlogo
+\NewDocumentCommand{ \logo }{ s +m }{%
+ \IfBooleanTF{#1}{%
+ \def\udiss@texlogo{#2}%
+ \udiss@texlogotrue
+ }{%
+ \def\udiss@logo{#2}%
+ }%
+ \udiss@logotrue
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{logo,logo*}
+% \expkvlogo{} doesn't have a way to have starred
+% variants of the keys, but we can always create a
+% different key with an additional star. That's what we do
+% here.
+%
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ code logo = {%
+ \def\udiss@logo{#1}%
+ \udiss@logotrue
+ },%
+ code logo* = {%
+ \def\udiss@texlogo{#1}%
+ \udiss@logotrue
+ \udiss@texlogotrue
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Now we move to the complicated task of developing the
+% mechanism for loading languages. In order to imitate the
+% syntax of |babel|, we need a parser which inteprets
+% comma-separated language-names. We develop a new counter
+% called |udiss@langbabel| and use it with |\alph| inside
+% |\csname| in order to produce an ordered sequence of
+% macros that store the different language-names. After
+% parsing, the language macros should look like
+% |\udiss@langbabel@a|, |\udiss@langbabel@a| etc. The
+% following code does that. The |\udiss@lgbbl| macro is the
+% internal parser for the language-names.
+%
+% \begin{macrocode}
+\newcounter{udiss@langbabel}
+\stepcounter{udiss@langbabel}
+\def\udiss@int@langbabel#1{%
+ \expandafter\edef
+ \csname
+ udiss@langbabel@\alph{udiss@langbabel}%
+ \endcsname{#1}%
+ \stepcounter{udiss@langbabel}%
+}
+\NewDocumentCommand\udiss@lgbbl{ >{ \SplitList{,} } m }{%
+ \ProcessList{#1}{\udiss@int@langbabel}%
+}
+% \end{macrocode}
+%
+% \begin{macro}{language,ldfbabel,nofontwarning}
+% We first create the if-conditionals required for this
+% job.
+%
+% \begin{macrocode}
+\newif\ifudiss@lg@used
+\newif\ifudiss@ldfbabel
+% \end{macrocode}
+%
+% The |language| key takes the comma-separated list as its
+% argument and passes the list to the |\udiss@lgbbl|
+% macro which we just saw. So whenever we pass multiple
+% languages to the option |language|, it is parsed by
+% |\udiss@lgbbl|. We then turn the |\ifudiss@lg@used|
+% conditional on, so that when neither of these options
+% are used by the user, we can do something.
+%
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ code language = {%
+ \udiss@lgbbl{#1}%
+ \udiss@lg@usedtrue
+ },%
+% \end{macrocode}
+%
+% On the other hand though, the process is quite simple
+% and straight forward. We need to store the list of the
+% |.ldf|-languages in a macro and later pass it to the
+% \pkg{babel} package as \pkg{babel} already understands
+% how to parse it. We store the list in the
+% |\udiss@ldfbabel@list| macro. With this option, we have
+% to turn an additional conditional on, i.e.,
+% |\ifudiss@ldfbabel|. Usually we don't use the |.ldf|
+% mechanism at all as mentioned in \cref{doc}.
+%
+% \begin{macrocode}
+ code ldfbabel = {%
+ \def\udiss@ldfbabel@list{#1}%
+ \udiss@lg@usedtrue
+ \udiss@ldfbabeltrue
+ },%
+% \end{macrocode}
+%
+% The |nofontwarning| option is developed using the
+% |invbool| \emph{type} which creates (or uses, if present)
+% a conditional and sets it to true. In this case, it is
+% |\ifudiss@font@warning|. Unless the option |nofontwarning|
+% is used, the aforementioned condition is true.
+%
+% \begin{macrocode}
+ invbool nofontwarning = {\ifudiss@font@warning}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{license,copyright-yrs,localcopyright}
+% Now we develop the options for setting a license with
+% the legit copyrightable years. As usual, we first
+% develop the required conditionals.
+%
+% \begin{macrocode}
+\newif\ifudiss@free@culture
+\newif\ifudiss@ccbysa
+\newif\ifudiss@gfdl
+% \end{macrocode}
+%
+% We use a new \expkvlogo{} \emph{type}s for license which
+% is |choice|. It takes a definite list of |choice|s that
+% run some arbitrary code. We define an internal macro
+% |\udiss@license@notice| which holds the notice text of
+% the selected licenses. We set the
+% |\ifudiss@free@culture| conditional to true if the
+% user's |choice| is |CC-BY-SA| or |GFDL|. Why we do this
+% is because if the choice is |all-rights-reserved|, it
+% need not be explicitly mentioned. It is always assumed.
+% Also, it is seen in PDF's metadata. For this, we enable
+% the conditional. Using the |initial| \emph{prefix} of
+% \expkvlogo{}, we set the |all-rights-reserved| as the
+% default choice of users.
+%
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ choice license = {%
+ all-rights-reserved = {%
+ \def\udiss@license@notice{%
+ All rights reserved.\textLF
+ }%
+ },%
+ CC-BY-SA = {%
+ \def\udiss@license@notice{%
+ This work is available under the "Creative Commons
+ Attribution ShareAlike 4.0 International" license.%
+ }%
+ \def\udiss@free@license@url{%
+ https://creativecommons.org/licenses/%
+ by-sa/4.0/legalcode.txt%
+ }%
+ \udiss@free@culturetrue
+ \udiss@ccbysatrue
+ },%
+ GFDL = {%
+ \def\udiss@license@notice{%
+ Permission is granted to copy, distribute and/or
+ modify this document under the terms of the GNU Free
+ Documentation License, Version 1.3 or any later
+ version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts,
+ and no Back-Cover Texts. A copy of the license is
+ included in the section entitled “GNU Free
+ Documentation License”.%
+ }%
+ \def\udiss@free@license@url{%
+ https://www.gnu.org/licenses/fdl-1.3.txt%
+ }%
+ \udiss@free@culturetrue
+ \udiss@gfdltrue
+ },%
+ },%
+ initial license = {all-rights-reserved},%
+% \end{macrocode}
+%
+% Then we use the |store| \emph{type} which, as the name
+% suggests, |store|s the value given by the user in a
+% macro. Again, with the |initial| \emph{prefix}, we set
+% the initial values for the two options.
+%
+% \begin{macrocode}
+ store copyright-yrs = {\udiss@copyrightable@years},%
+ initial copyright-yrs = {\the\year},%
+ store localcopyright = {\udiss@local@copyright},%
+ initial localcopyright = {Copyright},%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{placeholders}
+% This option pre-fills all the necessary fields with some
+% random (and rather delusional :P) values. We use the
+% |nmeta| \emph{type} of \expkvlogo{} for this. This type
+% uses the already developed keys with some values. When
+% the key developed with |nmeta| is used by the user, it
+% behaves as if the user has passed the keys inside it
+% with the corresponding values.
+%
+% \begin{macrocode}
+ nmeta placeholders = {%
+ title = {%
+ A groundbreaking dissertation%
+ },%
+ author = {%
+ Jane Doe%
+ },%
+ pronouns = {She/her},%
+ subtitle = {%
+ A milestone study on a longstanding question
+ in a discipline%
+ },%
+ shorttitle = {A Milestone study},%
+ stream = {intriguing stream},%
+ discipline = {rigorous discipline},
+ degree = {enriching degree},%
+ supervisor = {A kind supervisor},%
+ university = {An ideal university},%
+ department = {A homely department},%
+ license = {CC-BY-SA},%
+ copyright-yrs = {2022, 2023, 2024}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{^^A
+% lot,lof,declaration,declarationtxt,decllocal^^A
+% }
+% The list of tables and figures are conditionals
+% developed with the |bool| \emph{type} of \expkvlogo{}
+% which creates (or uses, if already present) a boolean.
+% It is by default set to the false value. The declaration
+% also is a |bool|ean as it is turned off by default.
+%
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ bool lot = {\ifudiss@lot},%
+ bool lof = {\ifudiss@lof},%
+ bool declaration = {\ifudiss@declaration},%
+% \end{macrocode}
+%
+% The |declarationtxt| \emph{key} contains text which has
+% paragraphs inside it and the default \emph{key-value}s
+% of \expkvlogo{} are |\def| type (meaning, they don't
+% accept |\par| tokens). So in order to have the effect of
+% |\long\def|, we need to use |long| \emph{prefix} of
+% \expkvlogo{}. We set an initial value for this too. Then
+% we store the value for the local word for declaration.
+%
+% \begin{macrocode}
+ long
+ store declarationtxt = {\udiss@declaration},%
+ initial declarationtxt = {%
+ \noindent As required by the university regulations, I
+ wish to state that the work embodied in this thesis
+ titled \enquote{\udiss@title: \udiss@subtitle} forms
+ my own contribution to the research work carried out
+ under the guidance of \udiss@supervisor\ at the
+ \udiss@university, \udiss@department.
+
+ This work has not been submitted for any other degree
+ of this or any other university. Whenever references
+ have been made to previous works of others, it has
+ been clearly indicated as such and included in the
+ bibliography.
+
+ \bigskip
+ \flushright{%
+ Date: \today
+
+ \vspace{4em}%
+
+ Name: \udiss@author
+ }%
+
+ \bigskip\bigskip
+ \flushleft{%
+ Certified by:%
+
+ \vspace{4em}%
+
+ \udiss@supervisor
+ }%
+ },%
+ store decllocal = {\udiss@decllocal},%
+ initial decllocal = {Declaration}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{^^A
+% print,norefcolors,udisslinkclr,^^A
+% udissurlclr,udissciteclr^^A
+% }
+% The |print| key is created using the |bool| \emph{type}.
+% The |norefcolors| option, on the other hand, uses the
+% |invbool| \emph{type}. For |udisslinkclr|, |udissurlclr|
+% and |udissciteclr| we use the |store| \emph{type} along
+% with some |initial| values.
+%
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ bool print = {\ifudiss@print},%
+ invbool norefcolors = {\ifudiss@colors},%
+ store udisslinkclr = {\udiss@int@link@color},%
+ initial udisslinkclr = {udisslink},%
+ store udissurlclr = {\udiss@int@url@color},%
+ initial udissurlclr = {udissurl},%
+ store udissciteclr = {\udiss@int@cite@color},%
+ initial udissciteclr = {udisscite}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{blind}
+% The next boolean is for printing blind documents.
+%
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ bool blind = {\ifudiss@blind}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{framed-title}
+% We provide a conditional for producing a framed
+% title-page. The conditional will be used later while
+% typesetting.
+%
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ bool framed-title = {\ifudiss@ftitle}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{oldone,oldstylenumoff}
+% We set the old style numerals as the default for
+% typesetting. We provide an inverse boolean for setting
+% the old style numbers off. The special shape for number
+% one is enabled only with the boolean key |oldone|. We
+% develop it here.
+%
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ invbool oldstylenumoff = {\ifudiss@oldstylenum},%
+ bool oldone = {\ifudiss@oldone}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{explicitext,ignorefsoff}
+% To turn on the explicit extension mechanism of the
+% font-loading packages, we provide a conditional. It is
+% disabled by default and hence is of the |bool| type.
+%
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ bool explicitext = {\ifudiss@explicitext},%
+ invbool ignorefsoff = {\ifudiss@ignorefontspec}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{fulfilment}
+% In order to store the sentence written on the
+% title-page, we again use the common |store| and
+% |initial store| pair.
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ store fulfilment = {\udiss@fulfilment},%
+ initial fulfilment = {%
+ A dissertation submitted in the partial fulfilment of
+ the requirements for the \udiss@degree\ program in
+ \udiss@discipline.%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% All of the upcoming \emph{key}s are font-selection keys.
+% We set their defaults as explained in \cref{udissenfonts}.
+%
+% \begin{macro}{^^A
+% rmfont,rmbffont,rmitfont,rmbfitfont,^^A
+% rmslfont,rmbfslfont^^A
+% }
+% The following sets the default text font for the
+% document. We are using NewCM family as the default
+% font-family. But as of now, the NewCM fonts don't have
+% all the variants. E.g., it lacks slanted/oblique shapes
+% in the natural weight, but we provide the regular ones
+% in place of them.
+%
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ store rmfont = {\udiss@rmfont},%
+ initial rmfont = {NewCM10-Book.otf},%
+ store rmbffont = {\udiss@rmbffont},%
+ initial rmbffont = {NewCM10-Bold.otf},%
+ store rmitfont = {\udiss@rmitfont},%
+ initial rmitfont = {NewCM10-BookItalic.otf},%
+ store rmbfitfont = {\udiss@rmbfitfont},%
+ initial rmbfitfont = {NewCM10-BoldItalic.otf},%
+ store rmslfont = {\udiss@rmslfont},%
+ initial rmslfont = {NewCM10-Book.otf},%
+ store rmbfslfont = {\udiss@rmbfslfont},%
+ initial rmbfslfont = {NewCM10-Bold.otf},%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{^^A
+% sffont,sfbffont,sfitfont,sfbfitfont,^^A
+% sfslfont,sfbfslfont^^A
+% }
+%
+% Similarly, we store values for the sans fonts too. NewCM
+% lacks certain variants in sans, but again, the options
+% are set font-agnostically and hence they are more in
+% number than the actually available variants. The sans
+% fonts in NewCM, don't have an Italic design. We have
+% used the oblique version of the fonts there instead.
+% Note that the same designs are used for the slanted
+% fonts too.
+%
+% \begin{macrocode}
+ store sffont = {\udiss@sffont},%
+ initial sffont = {NewCMSans10-Book.otf},%
+ store sfbffont = {\udiss@sfbffont},%
+ initial sfbffont = {NewCMSans10-Bold.otf},%
+ store sfitfont = {\udiss@sfitfont},
+ initial sfitfont = {NewCMSans10-BookOblique.otf},%
+ store sfbfitfont = {\udiss@sfbfitfont},%
+ initial sfbfitfont = {NewCMSans10-BoldOblique.otf},%
+ store sfslfont = {\udiss@sfslfont},%
+ initial sfslfont = {NewCMSans10-BookOblique.otf},%
+ store sfbfslfont = {\udiss@sfbfslfont},%
+ initial sfbfslfont = {NewCMSans10-BoldOblique.otf},%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{^^A
+% ttfont,ttbffont,ttitfont,ttbfitfont,^^A
+% ttslfont,ttbfslfont^^A
+% }
+% The settings for typewriter fonts are loaded in the below
+% code. We have a strange situation here. NewCM provides
+% |BookItalic|, but doesn't have a |BoldItalic|. We instead
+% have |BoldOblique|. Thus we set the |BookItalic| as the
+% |ttitfont| and |BoldOblique| as the |ttbfit| font. The
+% same pair for |ttslfont| and |ttbfslfont|.
+%
+% \begin{macrocode}
+ store ttfont = {\udiss@ttfont},%
+ initial ttfont = {NewCMMono10-Book.otf},%
+ store ttbffont = {\udiss@ttbffont},
+ initial ttbffont = {NewCMMono10-Bold.otf},%
+ store ttitfont = {\udiss@ttitfont},%
+ initial ttitfont = {NewCMMono10-BookItalic.otf},%
+ store ttbfitfont = {\udiss@ttbfitfont},%
+ initial ttbfitfont = {NewCMMono10-BoldOblique.otf},%
+ store ttslfont = {\udiss@ttslfont},%
+ initial ttslfont = {NewCM10-Book.otf},%
+ store ttbfslfont = {\udiss@ttbfslfont},%
+ initial ttbfslfont = {NewCMMono10-BoldOblique.otf},%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{mathfont,mathbffont}
+% Maths fonts have very little variation, so we just have
+% two parameters for selecting the fonts and two of the
+% usual parameters for features and extensions.
+%
+% \begin{macrocode}
+ store mathfont = {\udiss@mathfont},%
+ initial mathfont = {NewCMMath-Book.otf},%
+ store mathbffont = {\udiss@mathbffont},%
+ initial mathbffont = {NewCMMath-Bold.otf},%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{^^A
+% rmfeatures,rmfntext,sffeatures,sffntext,^^A
+% ttfeatures,ttfntext,mathfeatures,mathfntext^^A
+% }
+% If the user wants to add features to the selected fonts,
+% they are allowed to use these commands and if they use
+% the |explicitext| option, they can choose the font
+% extensions too using the \emph{key}s specifically
+% developed for that. We use |store| and |choice|
+% \emph{type}s for this.
+%
+% \begin{macrocode}
+ store rmfeatures = {\udiss@rmfeatures},%
+ choice rmfntext = {%
+ ttf = {%
+ \ifudiss@explicitext
+ \def\udiss@rmfntext{ttf}%
+ \else
+ \ClassError{udiss}{%
+ Option `explicitext' is needed for adding
+ font extensions%
+ }{%
+ You have loaded font-option `rmfntext' to
+ add extension to font-names.
+ This\MessageBreak option is supposed to be
+ used only with the `explicitext' option.
+ E.g., for\MessageBreak loading, say,
+ FreeSerif, you may choose one of the
+ following two methods:%
+ \MessageBreak\MessageBreak
+ 1. The recommended method:%
+ \MessageBreak
+ \space\space\space
+ ----8<---------------8<----%
+ \MessageBreak
+ \space\space\space
+ \string\documentclass[\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ rmfont = {FreeSerif.ttf}\@percentchar
+ \MessageBreak
+ \space\space\space
+ ]{udiss}\MessageBreak
+ \space\space\space
+ ----8<---------------8<----%
+ \MessageBreak\MessageBreak
+ 2. The alternative:%
+ \MessageBreak
+ \space\space\space
+ ----8<------------8<----%
+ \MessageBreak
+ \space\space\space
+ \string\documentclass[\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ explicitext,\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ rmfont = {FreeSerif},\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ rmfntext = {ttf}\@percentchar
+ \MessageBreak
+ \space\space\space
+ ]{udiss}%
+ \MessageBreak
+ \space\space\space
+ ----8<------------8<----%
+ }%
+ \fi
+ },%
+ otf = {%
+ \ifudiss@explicitext
+ \def\udiss@rmfntext{otf}%
+ \else
+ \ClassError{udiss}{%
+ Option `explicitext' is needed for adding
+ font extensions%
+ }{%
+ You have loaded font-option `rmfntext' to
+ add extension to font-names.
+ This\MessageBreak option is supposed to be
+ used only with the `explicitext' option.
+ E.g., for\MessageBreak loading, say,
+ KpRoman-Regular.otf, you may choose one of
+ the following two\MessageBreak
+ methods:%
+ \MessageBreak\MessageBreak
+ 1. The recommended method:%
+ \MessageBreak
+ \space\space\space
+ ----8<---------------------8<----%
+ \MessageBreak
+ \space\space\space
+ \string\documentclass[\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ rmfont = {KpRoman-Regular.otf}%
+ \@percentchar
+ \MessageBreak
+ \space\space\space
+ ]{udiss}\MessageBreak
+ \space\space\space
+ ----8<---------------------8<----%
+ \MessageBreak
+ \MessageBreak
+ 2. The alternative:%
+ \MessageBreak
+ \space\space\space
+ ----8<------------------8<----%
+ \MessageBreak
+ \space\space\space
+ \string\documentclass[\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ explicitext,\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ rmfont = {KpRoman-Regular},%
+ \@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ rmfntext = {otf}\@percentchar
+ \MessageBreak
+ \space\space\space
+ ]{udiss}%
+ \MessageBreak
+ \space\space\space
+ ----8<------------------8<----%
+ }%
+ \fi
+ }%
+ },%
+ store sffeatures = {\udiss@sffeatures},%
+ choice sffntext = {%
+ ttf = {%
+ \ifudiss@explicitext
+ \def\udiss@sffntext{ttf}%
+ \else
+ \ClassError{udiss}{%
+ Option `explicitext' is needed for adding
+ font extensions%
+ }{%
+ You have loaded font-option `sffntext' to
+ add extension to font-names.
+ This\MessageBreak option is supposed to be
+ used only with the `explicitext' option.
+ E.g., for\MessageBreak loading, say,
+ FreeSans, you may choose one of the
+ following two methods:%
+ \MessageBreak\MessageBreak
+ 1. The recommended method:%
+ \MessageBreak
+ \space\space\space
+ ----8<---------------8<----%
+ \MessageBreak
+ \space\space\space
+ \string\documentclass[\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ sffont = {FreeSans.ttf}\@percentchar
+ \MessageBreak
+ \space\space\space
+ ]{udiss}\MessageBreak
+ \space\space\space
+ ----8<---------------8<----%
+ \MessageBreak\MessageBreak
+ 2. The alternative:%
+ \MessageBreak
+ \space\space\space
+ ----8<------------8<----%
+ \MessageBreak
+ \space\space\space
+ \string\documentclass[\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ explicitext,\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ sffont = {FreeSans},\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ sffntext = {ttf}\@percentchar
+ \MessageBreak
+ \space\space\space
+ ]{udiss}%
+ \MessageBreak
+ \space\space\space
+ ----8<------------8<----%
+ }%
+ \fi
+ },%
+ otf = {%
+ \ifudiss@explicitext
+ \def\udiss@sffntext{otf}%
+ \else
+ \ClassError{udiss}{%
+ Option `explicitext' is needed for adding
+ font extensions%
+ }{%
+ You have loaded font-option `sffntext' to
+ add extension to font-names.
+ This\MessageBreak option is supposed to be
+ used only with the `explicitext' option.
+ E.g., for\MessageBreak loading, say,
+ KpSans-Regular.otf, you may choose one of
+ the following two\MessageBreak
+ methods:%
+ \MessageBreak\MessageBreak
+ 1. The recommended method:%
+ \MessageBreak
+ \space\space\space
+ ----8<---------------------8<----%
+ \MessageBreak
+ \space\space\space
+ \string\documentclass[\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ sffont = {KpSans-Regular.otf}%
+ \@percentchar
+ \MessageBreak
+ \space\space\space
+ ]{udiss}\MessageBreak
+ \space\space\space
+ ----8<---------------------8<----%
+ \MessageBreak
+ \MessageBreak
+ 2. The alternative:%
+ \MessageBreak
+ \space\space\space
+ ----8<------------------8<----%
+ \MessageBreak
+ \space\space\space
+ \string\documentclass[\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ explicitext,\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ sffont = {KpSans-Regular},%
+ \@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ sffntext = {otf}\@percentchar
+ \MessageBreak
+ \space\space\space
+ ]{udiss}%
+ \MessageBreak
+ \space\space\space
+ ----8<------------------8<----%
+ }%
+ \fi
+ }%
+ },%
+ store ttfeatures = {\udiss@ttfeatures},%
+ choice ttfntext = {%
+ ttf = {%
+ \ifudiss@explicitext
+ \def\udiss@ttfntext{ttf}%
+ \else
+ \ClassError{udiss}{%
+ Option `explicitext' is needed for adding
+ font extensions%
+ }{%
+ You have loaded font-option `ttfntext' to
+ add extension to font-names.
+ This\MessageBreak option is supposed to be
+ used only with the `explicitext' option.
+ E.g., for\MessageBreak loading, say,
+ FreeMono, you may choose one of the
+ following two methods:%
+ \MessageBreak\MessageBreak
+ 1. The recommended method:%
+ \MessageBreak
+ \space\space\space
+ ----8<---------------8<----%
+ \MessageBreak
+ \space\space\space
+ \string\documentclass[\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ ttfont = {FreeMono.ttf}\@percentchar
+ \MessageBreak
+ \space\space\space
+ ]{udiss}\MessageBreak
+ \space\space\space
+ ----8<---------------8<----%
+ \MessageBreak\MessageBreak
+ 2. The alternative:%
+ \MessageBreak
+ \space\space\space
+ ----8<------------8<----%
+ \MessageBreak
+ \space\space\space
+ \string\documentclass[\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ explicitext,\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ ttfont = {FreeMono},\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ ttfntext = {ttf}\@percentchar
+ \MessageBreak
+ \space\space\space
+ ]{udiss}%
+ \MessageBreak
+ \space\space\space
+ ----8<------------8<----%
+ }%
+ \fi
+ },%
+ otf = {%
+ \ifudiss@explicitext
+ \def\udiss@ttfntext{otf}%
+ \else
+ \ClassError{udiss}{%
+ Option `explicitext' is needed for adding
+ font extensions%
+ }{%
+ You have loaded font-option `ttfntext' to
+ add extension to font-names.
+ This\MessageBreak option is supposed to be
+ used only with the `explicitext' option.
+ E.g., for\MessageBreak loading, say,
+ KpMono-Regular.otf, you may choose one of
+ the following two\MessageBreak
+ methods:%
+ \MessageBreak\MessageBreak
+ 1. The recommended method:%
+ \MessageBreak
+ \space\space\space
+ ----8<---------------------8<----%
+ \MessageBreak
+ \space\space\space
+ \string\documentclass[\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ ttfont = {KpMono-Regular.otf}%
+ \@percentchar
+ \MessageBreak
+ \space\space\space
+ ]{udiss}\MessageBreak
+ \space\space\space
+ ----8<---------------------8<----%
+ \MessageBreak
+ \MessageBreak
+ 2. The alternative:%
+ \MessageBreak
+ \space\space\space
+ ----8<------------------8<----%
+ \MessageBreak
+ \space\space\space
+ \string\documentclass[\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ explicitext,\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ ttfont = {KpMono-Regular},%
+ \@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ ttfntext = {otf}\@percentchar
+ \MessageBreak
+ \space\space\space
+ ]{udiss}%
+ \MessageBreak
+ \space\space\space
+ ----8<------------------8<----%
+ }%
+ \fi
+ }%
+ },%
+ store mathfeatures = {\udiss@mathfeatures},%
+ choice mathfntext = {%
+ ttf = {%
+ \ifudiss@explicitext
+ \def\udiss@mathfntext{ttf}%
+ \else
+ \ClassError{udiss}{%
+ Option `explicitext' is needed for adding
+ font extensions%
+ }{%
+ You have loaded font-option `mathfntext'
+ to add extension to font-names.
+ This\MessageBreak option is supposed to be
+ used only with the `explicitext' option.
+ E.g., for\MessageBreak loading, say,
+ NotoSansMath-Regular, you may choose one
+ of the following two\MessageBreak
+ methods:%
+ \MessageBreak\MessageBreak
+ 1. The recommended method:%
+ \MessageBreak
+ \space\space\space
+ ----8<----------------------------8<----%
+ \MessageBreak
+ \space\space\space
+ \string\documentclass[\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ mathfont = {NotoSansMath-Regular.ttf}%
+ \@percentchar
+ \MessageBreak
+ \space\space\space
+ ]{udiss}\MessageBreak
+ \space\space\space
+ ----8<----------------------------8<----%
+ \MessageBreak\MessageBreak
+ 2. The alternative:%
+ \MessageBreak
+ \space\space\space
+ ----8<-------------------------8<----%
+ \MessageBreak
+ \space\space\space
+ \string\documentclass[\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ explicitext,\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ mathfont = {NotoSansMath-Regular},%
+ \@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ mathfntext = {ttf}\@percentchar
+ \MessageBreak
+ \space\space\space
+ ]{udiss}%
+ \MessageBreak
+ \space\space\space
+ ----8<-------------------------8<----%
+ }%
+ \fi
+ },%
+ otf = {%
+ \ifudiss@explicitext
+ \def\udiss@mathfntext{otf}%
+ \else
+ \ClassError{udiss}{%
+ Option `explicitext' is needed for adding
+ font extensions%
+ }{%
+ You have loaded font-option `mathfntext'
+ to add extension to font-names.
+ This\MessageBreak option is supposed to be
+ used only with the `explicitext' option.
+ E.g., for\MessageBreak loading, say,
+ XITSMath-Regular, you may choose one of
+ the following two\MessageBreak methods:%
+ \MessageBreak\MessageBreak
+ 1. The recommended method:%
+ \MessageBreak
+ \space\space\space
+ ----8<----------------------------8<----%
+ \MessageBreak
+ \space\space\space
+ \string\documentclass[\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ mathfont = {XITSMath-Regular.otf}%
+ \@percentchar
+ \MessageBreak
+ \space\space\space
+ ]{udiss}\MessageBreak
+ \space\space\space
+ ----8<----------------------------8<----%
+ \MessageBreak\MessageBreak
+ 2. The alternative:%
+ \MessageBreak
+ \space\space\space
+ ----8<-------------------------8<----%
+ \MessageBreak
+ \space\space\space
+ \string\documentclass[\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ explicitext,\@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ mathfont = {XITSMath-Regular},%
+ \@percentchar
+ \MessageBreak
+ \space\space\space\space\space
+ mathfntext = {otf}\@percentchar
+ \MessageBreak
+ \space\space\space
+ ]{udiss}%
+ \MessageBreak
+ \space\space\space
+ ----8<-------------------------8<----%
+ }%
+ \fi
+ }%
+ },%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{^^A
+% titleshape,titlefont,titleffeat,titlesize,titlecolor^^A
+% }
+% We store various variables in these keys for customising
+% the layout of the title-page. The following are the keys
+% specifically developed for customising the title. The
+% sizing is done with internal macros specifically
+% designed for consistent size-changing. We use
+% \pkg{fontspec}-scaling for that.
+%
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ store titleshape = {\udiss@title@shape},%
+ initial titleshape = {\bfseries},%
+ store titlefont = {\udiss@title@font},%
+ store titlesize = {\udiss@title@size},%
+ initial titlesize = {\udiss@int@huge},%
+ store titlecolor = {\udiss@title@color},%
+ initial titlecolor = {black},%
+ store titleffeat = {\udiss@title@fontfeats},%
+ initial titleffeat = {}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{^^A
+% subtitleshape,subtitlefont,subtitleffeat,^^A
+% subtitlesize,subtitlecolor^^A
+% }
+% The same logic is applied for subtitles and these
+% variables are created.
+%
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ store subtitleshape = {\udiss@subtitle@shape},%
+ initial subtitleshape = {\normalfont},%
+ store subtitlefont = {\udiss@subtitle@font},%
+ store subtitlesize = {\udiss@subtitle@size},%
+ initial subtitlesize = {\udiss@int@large},%
+ store subtitlecolor = {\udiss@subtitle@color},%
+ initial subtitlecolor = {black},%
+ store subtitleffeat = {\udiss@subtitle@fontfeats},%
+ initial subtitleffeat = {}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{^^A
+% authorshape,authorfont,authorsize,authorcolor,^^A
+% authorffeat^^A
+% }
+% Similarly, we have the following keys for author.
+%
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ store authorshape = {\udiss@author@shape},%
+ initial authorshape = {\normalfont},%
+ store authorfont = {\udiss@author@font},%
+ store authorsize = {\udiss@author@size},%
+ initial authorsize = {\udiss@int@large},%
+ store authorcolor = {\udiss@author@color},%
+ initial authorcolor = {black},%
+ store authorffeat = {\udiss@author@fontfeats},%
+ initial authorffeat = {}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{^^A
+% unishape,unifont,unisize,unicolor,uniffeat^^A
+% }
+% The same pattern for printing the university name.
+%
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ store unishape = {\udiss@uni@shape},%
+ initial unishape = {\itshape},%
+ store unifont = {\udiss@uni@font},%
+ store unisize = {\udiss@uni@size},%
+ initial unisize = {\normalsize},%
+ store unicolor = {\udiss@uni@color},%
+ initial unicolor = {black},%
+ store uniffeat = {\udiss@uni@fontfeats}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{^^A
+% deptshape,deptfont,deptsize,deptcolor,deptffeat^^A
+% }
+% The following keys for the department.
+%
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ store deptshape = {\udiss@dept@shape},%
+ initial deptshape = {\normalfont},%
+ store deptfont = {\udiss@dept@font},%
+ store deptsize = {\udiss@dept@size},%
+ initial deptsize = {\udiss@int@small},%
+ store deptcolor = {\udiss@dept@color},%
+ initial deptcolor = {black},%
+ store deptffeat = {\udiss@dept@fontfeats},%
+ initial deptffeat = {}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{^^A
+% ffshape,fffont,ffsize,ffcolor,ffffeat^^A
+% }
+% These are for the fulfilment-text.
+%
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ store ffshape = {\udiss@fulfilment@shape},%
+ initial ffshape = {\normalfont},%
+ store fffont = {\udiss@fulfilment@font},%
+ store ffsize = {\udiss@fulfilment@size},%
+ initial ffsize = {\udiss@int@small},%
+ store ffcolor = {\udiss@fulfilment@color},%
+ initial ffcolor = {black},%
+ store fffeat = {\udiss@fulfilment@fontfeats},%
+ initial fffeat = {}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{^^A
+% logowidth,logoheight^^A
+% }
+% The following parameters save the values for the
+% logo-height and the logo-width. These are the last
+% options after which we |\Process| our options.
+%
+% \begin{macrocode}
+\ekvdefinekeys{udiss}{%
+ store logowidth = {\udiss@logo@width},%
+ initial logowidth = {0.3},%
+ store logoheight = {\udiss@logo@hght},%
+ initial logoheight = {0.075}%
+}
+\ekvoProcessGlobalOptions{udiss}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dissertationstyle}
+% We develop the command for loading custom styles. It
+% just inputs files starting with |udiss-style-| followed
+% by the designated tag, e.g., |ukerala| for the
+% university of Kerala.
+%
+% \begin{macrocode}
+\NewDocumentCommand{ \dissertationstyle }{ m }{%
+ \AddToHook{begindocument/before}{%
+ \input{udiss-style-#1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% To minimise loading a lot of packages, we use the
+% \cls{memoir} class which provides many features useful for
+% document-creation. But we also need to set print and
+% digital versions of the dissertations. For that we use our
+% conditional.
+%
+% \begin{macrocode}
+\ifudiss@print
+\else
+ \PassOptionsToClass{oneside}{memoir}%
+\fi
+\LoadClass{memoir}
+% \end{macrocode}
+%
+% \begin{macro}{\title,\author}
+% We defined most other commands as per the flow of the
+% documentation, but as mentioned before, we had kept
+% |\title| and |\author| aside. As mentioned before, we
+% did so because these commands are defined by the
+% \cls{memoir} class. If we had defined it before loading
+% the memoir class (which we just loaded), the commands
+% would have got renewed after loading the class and thus
+% our internal macros would have failed. On the other
+% hand, we could not have loaded the memoir class in the
+% beginning, because we use the |\ifudiss@print|
+% conditional, i.e., developed with the help of
+% \expkvlogo{def} package. Even if we had separated the
+% code of |print| key, it would have been necessary to
+% process the keys using |\ekvoProcessGlobalOptions|, but
+% we could not have done that since there were a lot of
+% other options pending. This is why, we develop the
+% |\title| and |\author| commands now.
+%
+% \begin{macrocode}
+\RenewDocumentCommand{ \title }{ m }{%
+ \IfBlankTF{#1}{%
+ \udiss@blank@title@err
+ \def\udiss@title{-NoValidTitle-}%
+ }{%
+ \def\udiss@title{#1}%
+ }%
+}
+\RenewDocumentCommand{ \author }{ m }{%
+ \IfBlankTF{#1}{%
+ \udiss@blank@author@err
+ \def\udiss@author{-NoValidAuthor-}%
+ }{%
+ \def\udiss@author{#1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% We are using OpenType fonts for better accessibility. They
+% are incompatible with the classic PDF\LaTeX\ and require
+% either Lua\LaTeX\ or \hologo{XeLaTeX} for compilation. To
+% ensure that one of these two is loaded, we load the
+% \pkg{iftex} package and mandate a Unicode engine with the
+% |\RequireTUTeX| command.
+%
+% \begin{macrocode}
+\RequirePackage{iftex}
+\RequireTUTeX
+% \end{macrocode}
+%
+% We used custom \cls{udiss} size commands. They are
+% developed with \pkg{fontspec}-scaling as follows:
+%
+% \begin{macrocode}
+\def\udiss@int@HUGE{%
+ \addfontfeature{Scale={2.5}}%
+}
+\def\udiss@int@Huge{%
+ \addfontfeature{Scale={2}}%
+}
+\def\udiss@int@huge{%
+ \addfontfeature{Scale={1.7}}%
+}
+\def\udiss@int@LARGE{%
+ \addfontfeature{Scale={1.4}}%
+}
+\def\udiss@int@Large{%
+ \addfontfeature{Scale={1.2}}%
+}
+\def\udiss@int@large{%
+ \addfontfeature{Scale={1.1}}%
+}
+\def\udiss@int@small{%
+ \addfontfeature{Scale={0.9}}%
+}
+\def\udiss@int@footnotesize{%
+ \addfontfeature{Scale={0.8}}%
+}
+\def\udiss@int@scriptsize{%
+ \addfontfeature{Scale={0.7}}%
+}
+\def\udiss@int@tiny{%
+ \addfontfeature{Scale={0.6}}%
+}
+\def\udiss@int@miniscule{%
+ \addfontfeature{Scale={0.5}}%
+}
+% \end{macrocode}
+%
+% We require the \pkg{babel} package for loading the
+% language settings. We have the following three situations
+% with loading languages in \cls{udiss}:
+%
+% \begin{enumerate}
+% \item Users don't load any of the language options at all.
+% \item Users load languages with option |ldfbabel|.
+% \item Users load languages with option |language|.
+% \end{enumerate}
+%
+% If a user has used |ldfbabel|, then the macro which stores
+% the language-list is directly passed to the package using
+% |\PassOptionsToPackage|.
+%
+% \begin{macrocode}
+\ifudiss@lg@used
+ \ifudiss@ldfbabel
+ \PassOptionsToPackage{%
+ \udiss@ldfbabel@list
+ }{babel}%
+ \fi
+% \end{macrocode}
+%
+% If user hasn't loaded any language options, we assume that
+% they have no intent to load languages that require |.ldf|
+% files and hence we mandate loading |.ini| files for all
+% the languages. In addition to that, we load |english| as
+% the main language. This takes care of the first two
+% situations.
+%
+% \begin{macrocode}
+\else
+ \PassOptionsToPackage{english,provide*=*}{babel}%
+\fi
+\RequirePackage{babel}
+% \end{macrocode}
+%
+% We also load package \pkg{iflang} for testing
+% language-names.
+%
+% \begin{macrocode}
+\RequirePackage{iflang}
+% \end{macrocode}
+%
+% First we check if the user has loaded |ldf| languages. We
+% ignore that branch completely. If it is not loaded and
+% they have loaded exactly one language, then we set that
+% language as the main language. Note that when user uses
+% one language, the value of the counter is 2 as it is
+% increased by the counter each time.
+%
+% \begin{macrocode}
+\newcounter{udiss@tmp@langcnt}
+\ifudiss@ldfbabel
+\else
+ \ifudiss@lg@used
+ \ifnum\theudiss@langbabel=2\relax
+ \addtocounter{udiss@langbabel}{-1}%
+ \ifLuaTeX
+ \babelprovide[%
+ main,%
+ import,%
+ onchar ={ids fonts}%
+ ]{%
+ \csname
+ udiss@langbabel@\alph{udiss@langbabel}%
+ \endcsname
+ }%
+ \else
+ \babelprovide[main,import]{%
+ \csname
+ udiss@langbabel@\alph{udiss@langbabel}%
+ \endcsname
+ }%
+ \fi
+ \fi
+% \end{macrocode}%
+%
+% When users use multiple languages, the situation is a bit
+% more complicated. Because the parser parses and increases
+% the counter each time. Suppose, the user provided 5
+% languages, the parser will create 5 macros \emph{and}
+% increase the counter for one last time resulting in the
+% value 6. In order to stop processing when the number of
+% actually used languages is reached, we need to store the
+% current number \emph{minus one} because of this. We have
+% to start a loop from value 1 till it reaches the last
+% value. For this, we reset the counter. In order % to stop
+% when all the languages are parsed, we need to remember the
+% actual value of the counter somewhere. Hence we create a
+% temporary counter for this and equate it with the value of
+% our actual counter minus 1. Note that we escape
+% |\ifudiss@ldfbabel| too. Now we start the calculation when
+% the counter's value is 3 or more, basically the author has
+% to use at least two languages in order to activate the
+% loop ahead.
+%
+% \begin{macrocode}
+ \ifnum\theudiss@langbabel>2\relax
+ \setcounter{udiss@tmp@langcnt}{%
+ \numexpr\theudiss@langbabel -1\relax
+ }%
+% \end{macrocode}
+%
+% We now can safely manipulate our actual counter. Starting
+% from the first language, we load all of them with the
+% |\babelprovide| command. We reset the counter to 1:
+%
+% \begin{macrocode}
+ \setcounter{udiss@langbabel}{1}%
+% \end{macrocode}
+%
+% Now we start a loop.
+%
+% \begin{macrocode}
+ \loop
+% \end{macrocode}
+%
+% Only Lua\LaTeX\ supports the |ids fonts| parameter with
+% |\babelprovide| for applying fonts to the input text with
+% respect to their Unicode slots. That is why we start the
+% |\ifLuaTeX| conditional and load the |onchar| option.
+% Loading a conditional inside |\babelprovide| wasn't
+% permitted because of expansion, hence we load the entire
+% command in the else branch. Notice that there is no space
+% after the |=| sign of the |onchar| option. To know why,
+% you may want to read this wonderful answer by Jonathan P.
+% Spratte: \url{https://topanswers.xyz/tex?q=8039#a7652}.
+%
+% \begin{macrocode}
+ \ifLuaTeX
+ \babelprovide[%
+ import,%
+ onchar ={ids fonts}%
+ ]{%
+% \end{macrocode}
+%
+% Now we pass |\udiss@langbabel@a| as an argument to
+% |\babelprovide| command (the value of the counter is as of
+% now 1).
+%
+% \begin{macrocode}
+ \csname
+ udiss@langbabel@\alph{udiss@langbabel}%
+ \endcsname
+ }%
+% \end{macrocode}
+%
+% We start the |\else| branch and use the same thing again,
+% just without the |onchar| option .
+%
+% \begin{macrocode}
+ \else
+ \babelprovide[import]{%
+ \csname
+ udiss@langbabel@\alph{udiss@langbabel}%
+ \endcsname
+ }%
+ \fi
+% \end{macrocode}
+%
+% Woohoo! We loaded the first language successfully. Now, we
+% increment the counter, but there is another situation
+% which we have to take into account. What if the user just
+% loaded a single language with the |language| option? The
+% loop will run into trouble, that's why we only run the
+% loop if the value of the total number of languages is more
+% than one. We had saved it in a temporary counter.
+%
+% \begin{macrocode}
+ \ifnum\theudiss@tmp@langcnt=1\relax
+ \else
+ \addtocounter{udiss@langbabel}{1}%
+ \fi
+% \end{macrocode}
+%
+% Now the value of the counter is 2 which means the second
+% language. We need to again load the same settings for it,
+% but we can't keep doing this manually since 1) we are lazy
+% (the most important) 2) we have no idea how many languages
+% the user has loaded, so now we actually activate the
+% |\loop| that we had started with the |\repeat| command. It
+% runs all the commands seen after the |\loop| command (this
+% includes the one used for increasing the counter too) till
+% the value of the counter is less than the value of
+% |udiss@tmp@langcnt|. Remember we had already set it to the
+% value of the original counter (before setting it to 1)
+% \emph{minus one}. Now the next command will stop at one
+% number even lesser than it as we have used the |<|
+% relation while comparing. Also, here we will close the
+% if-conditional that checked if more than one languages
+% were used or not.
+%
+% \begin{macrocode}
+ \ifnum\theudiss@langbabel<\theudiss@tmp@langcnt
+ \relax
+ \repeat
+ \fi
+% \end{macrocode}
+%
+% Are you wondering why we did this? Because we want to set
+% the \emph{exact} last language as the |main| language! The
+% current value of our counter at this point has that
+% language. But remember we are out of the loop as well as
+% the if-conditional. Thus we have to again consider the
+% situation where user just passed one language. So far what
+% we have done is load all the languages except the last one
+% with |\babelprovide|. This includes the single-language
+% case. Thus we need no further processing in that case. So
+% we only parse the last pending language if the user had
+% passed multiple languages. We start an if-conditional and
+% keep its |if|-branch empty and write the rest in the
+% |else|-branch.
+%
+% \begin{macrocode}
+ \ifnum\theudiss@langbabel=1\relax
+% \end{macrocode}
+%
+% We again use |\babelprovide|, but this time with |main|
+% option. Load the last language successfully.
+%
+% \begin{macrocode}
+ \else
+ \ifLuaTeX
+ \babelprovide[%
+ main,%
+ import,%
+ onchar ={ids fonts}%
+ ]{%
+ \csname
+ udiss@langbabel@\alph{udiss@langbabel}%
+ \endcsname
+ }%
+ \else
+ \babelprovide[main,import]{%
+ \csname
+ udiss@langbabel@\alph{udiss@langbabel}%
+ \endcsname
+ }%
+ \fi
+ \fi
+% \end{macrocode}
+%
+% Now it's the time to load language support files. We need
+% to load all the language support files and here we don't
+% have the constraint to treat the last language specially.
+% Therefore we add 1 to the temporary counter (the one that
+% was decreased before).
+%
+% \begin{macrocode}
+ \setcounter{udiss@tmp@langcnt}{%
+ \numexpr\theudiss@langbabel + 1\relax
+ }%
+% \end{macrocode}
+%
+% We again start from the first language. If the support
+% file exists for that language, we |\input| it.
+%
+% \begin{macrocode}
+ \setcounter{udiss@langbabel}{1}%
+ \loop
+ \IfFileExists{%
+ udiss-fonts-\csname
+ udiss@langbabel@\alph{udiss@langbabel}%
+ \endcsname
+ }{%
+ \input{%
+ udiss-fonts-\csname
+ udiss@langbabel@\alph{udiss@langbabel}%
+ \endcsname
+ }%
+% \end{macrocode}
+%
+% Otherwise, we check if the warning option is true. By
+% default it is always true, but if the user has used
+% |nofontwarning| option to turn them off, this conditional
+% should do its job.
+%
+% \begin{macrocode}
+ }{%
+ \ifudiss@font@warning
+ \ClassWarningNoLine{udiss}{%
+ We don't support \csname
+ udiss@langbabel@\alph{udiss@langbabel}%
+ \endcsname\space yet.%
+ \MessageBreak
+ It requires a font-setup. You may add the fonts
+ directly\MessageBreak to your preamble using:%
+ \MessageBreak\MessageBreak
+ \space\space\string\babelfont[%
+ \csname
+ udiss@langbabel@\alph{udiss@langbabel}%
+ \endcsname
+ ]{rm}{main font}%
+ \MessageBreak
+ \space\space\string\babelfont[%
+ \csname
+ udiss@langbabel@\alph{udiss@langbabel}%
+ \endcsname
+ ]{sf}{sans font}%
+ \MessageBreak
+ \space\space\string\babelfont[%
+ \csname
+ udiss@langbabel@\alph{udiss@langbabel}%
+ \endcsname
+ ]{tt}{mono font}%
+ \MessageBreak\MessageBreak
+ Read more about this in the documentation of
+ `udiss' in a\MessageBreak section called
+ `multilingual typesetting'. Consider%
+ \MessageBreak contacting us with a support
+ request and let us know some\MessageBreak
+ suitable free (libre) fonts for this
+ language. If you\MessageBreak don't wish to see
+ this warning again, use the option%
+ \MessageBreak `nofontwarning' to suppress it%
+ }%
+ \fi
+ }%
+% \end{macrocode}
+%
+% Like before, we increment the counter and start the loop
+% till this is repeated for all the languages.
+%
+% \begin{macrocode}
+ \addtocounter{udiss@langbabel}{1}%
+ \ifnum\theudiss@langbabel<\theudiss@tmp@langcnt\relax
+ \repeat
+ \fi
+\fi
+% \end{macrocode}
+%
+% After all this processing, we load the Roman,
+% \texttt{Typewriter} and \textsf{Sans} fonts stored in the
+% variables set by \emph{key}s.
+%
+% \begin{macrocode}
+\babelfont{rm}[%
+ \ifudiss@ignorefontspec
+ IgnoreFontspecFile,%
+ \fi
+ \ifudiss@explicitext
+ Extension = {.\udiss@rmfntext},%
+ \fi
+ BoldFont = {\udiss@rmbffont},%
+ ItalicFont = {\udiss@rmitfont},%
+ BoldItalicFont = {\udiss@rmbfitfont},%
+ SlantedFont = {\udiss@rmslfont},%
+ BoldSlantedFont = {\udiss@rmbfslfont},%
+ \ifudiss@oldstylenum
+ Numbers = {OldStyle},%
+ \ifudiss@oldone
+ CharacterVariant = {6},%
+ \fi
+ \fi
+ \ifLuaTeX
+ Renderer = {HarfBuzz},%
+ \fi
+ \udiss@rmfeatures
+]{\udiss@rmfont}
+\babelfont{sf}[%
+ \ifudiss@ignorefontspec
+ IgnoreFontspecFile,%
+ \fi
+ \ifudiss@explicitext
+ Extension = {.\udiss@sffntext},%
+ \fi
+ BoldFont = {\udiss@sfbffont},%
+ ItalicFont = {\udiss@sfitfont},%
+ BoldItalicFont = {\udiss@sfbfitfont},%
+ SlantedFont = {\udiss@sfslfont},%
+ BoldSlantedFont = {\udiss@sfbfslfont},%
+ \ifudiss@oldstylenum
+ Numbers = {OldStyle},%
+ \ifudiss@oldone
+ CharacterVariant = {6},%
+ \fi
+ \fi
+ \ifLuaTeX
+ Renderer = {HarfBuzz},%
+ \fi
+ \udiss@sffeatures
+]{\udiss@sffont}
+\babelfont{tt}[%
+ \ifudiss@ignorefontspec
+ IgnoreFontspecFile,%
+ \fi
+ \ifudiss@explicitext
+ Extension = {.\udiss@ttfntext},%
+ \fi
+ BoldFont = {\udiss@ttbffont},%
+ ItalicFont = {\udiss@ttitfont},%
+ BoldItalicFont = {\udiss@ttbfitfont},%
+ SlantedFont = {\udiss@ttslfont},%
+ BoldSlantedFont = {\udiss@ttbfslfont},%
+ \ifLuaTeX
+ Renderer = {HarfBuzz},%
+ \fi
+ \udiss@ttfeatures
+]{\udiss@ttfont}
+% \end{macrocode}
+%
+% We load the \pkg{unicode-math} here for loading the math
+% fonts. After that, inside |\expanded|, we load the
+% |\setmathfont| command.
+%
+% \begin{macrocode}
+\RequirePackage{unicode-math}
+\expanded{%
+ \setmathfont[%
+ \ifudiss@ignorefontspec%
+ IgnoreFontspecFile,%
+ \fi%
+ \ifudiss@explicitext
+ Extension = {.\udiss@mathfntext},%
+ \fi
+ BoldFont = {\udiss@mathbffont},%
+ SlantedFont = {\udiss@mathfont},%
+ BoldSlantedFont = {\udiss@mathbffont},%
+ \udiss@mathfeatures%
+ ]{\udiss@mathfont}%
+}
+% \end{macrocode}
+%
+% Now we load a few last packages.
+%
+% \begin{macrocode}
+\RequirePackage{graphicx}
+\RequirePackage{xcolor}
+\RequirePackage{csquotes}
+% \end{macrocode}
+%
+% For Creative Commons license, we use the \pkg{doclicense}
+% package with appropriate settings.
+%
+% \begin{macrocode}
+\ifudiss@ccbysa
+ \RequirePackage[%
+ hyperxmp = {false},%
+ type = {CC},%
+ modifier = {by-sa},%
+ version = {4.0}%
+ ]{doclicense}
+\fi
+% \end{macrocode}
+%
+% We set the \cls{udiss}-specific-colours with the following
+% commands, but we set them conditionally. If the colours
+% are disabled, we set the same colours to |black| value.
+% \begin{macrocode}
+\ifudiss@colors
+ \colorlet{udisslink}{red!60!black}
+ \colorlet{udissurl}{blue!60!black}
+ \colorlet{udisscite}{green!60!black}
+\else
+ \colorlet{udisslink}{black}
+ \colorlet{udissurl}{black}
+ \colorlet{udisscite}{black}
+\fi
+% \end{macrocode}
+%
+% We start the hook |begindocument/before| and check if
+% author did not provide any of the \emph{strict} fields
+% and if they have done so, we generate errors.
+%
+% \begin{macrocode}
+\AddToHook{begindocument/before}{%
+ \ifdefined\udiss@title
+ \else
+ \def\udiss@title{\textbf{-NoValidTitle-}}%
+ \ClassError{udiss}{%
+ Title not given%
+ }{%
+ `title' is a compulsory field. Provide it in the
+ preamble like in the following:%
+ \MessageBreak
+ \MessageBreak
+ ----8<-----------------------8<----%
+ \MessageBreak\MessageBreak
+ \space\space\string\title{title-of-the-dissertation}%
+ \MessageBreak\MessageBreak
+ ----8<-----------------------8<----%
+ \MessageBreak
+ }%
+ \fi
+ \ifdefined\udiss@author
+ \else
+ \def\udiss@author{\textbf{-NoValidAuthor-}}%
+ \ClassError{udiss}{%
+ No author given in a normal (non-blind) document%
+ }{%
+ Do you want a blind document? If yes, then use the
+ package option `blind' like\MessageBreak in the
+ following:%
+ \MessageBreak
+ ----8<------------------8<----%
+ \MessageBreak\MessageBreak
+ \space\space\string\documentclass[blind]{udiss}%
+ \MessageBreak\MessageBreak
+ ----8<------------------8<----%
+ \MessageBreak
+ Otherwise, `author' is a compulsory field. Provide it
+ in the preamble like in\MessageBreak the following:%
+ \MessageBreak
+ ----8<-------------------------8<----%
+ \MessageBreak\MessageBreak
+ \space\space\string\author{author-name}%
+ \MessageBreak\MessageBreak
+ ----8<-------------------------8<----%
+ \MessageBreak
+ }%
+ \fi
+ \ifdefined\udiss@stream
+ \else
+ \def\udiss@stream{\textbf{-NoValidStream-}}%
+ \ClassError{udiss}{%
+ Stream not given%
+ }{%
+ `stream' is a compulsory field. Provide it in the
+ preamble like in the following:%
+ \MessageBreak
+ \MessageBreak
+ ----8<-----------------------8<----%
+ \MessageBreak\MessageBreak
+ \space\space\string\stream{stream-of-the-candidate}%
+ \MessageBreak\MessageBreak
+ ----8<-----------------------8<----%
+ \MessageBreak
+ }%
+ \fi
+ \ifdefined\udiss@discipline
+ \else
+ \def\udiss@discipline{\textbf{-NoValidDiscipline-}}%
+ \ClassError{udiss}{%
+ Discipline not given%
+ }{%
+ `discipline' is a compulsory field. Provide it in the
+ preamble like in the following:%
+ \MessageBreak
+ \MessageBreak
+ ----8<-----------------------8<----%
+ \MessageBreak\MessageBreak
+ \space\space\string\discipline%
+ {discipline-of-the-candidate}%
+ \MessageBreak\MessageBreak
+ ----8<-----------------------8<----%
+ \MessageBreak
+ }%
+ \fi
+ \ifdefined\udiss@degree
+ \else
+ \def\udiss@degree{\textbf{-NoValidDegree-}}%
+ \ClassError{udiss}{%
+ Degree not given%
+ }{%
+ `degree' is a compulsory field. Provide it in the
+ preamble like in the following:%
+ \MessageBreak
+ \MessageBreak
+ ----8<-----------------------8<----%
+ \MessageBreak\MessageBreak
+ \space\space\string\degree{degree-of-the-candidate}%
+ \MessageBreak\MessageBreak
+ ----8<-----------------------8<----%
+ \MessageBreak
+ }%
+ \fi
+ \ifdefined\udiss@supervisor
+ \else
+ \def\udiss@title{\textbf{-NoValidTitle-}}%
+ \ClassError{udiss}{%
+ No supervisor given in a normal (non-blind) document%
+ }{%
+ Do you want a blind document? If yes, then use the
+ package option `blind' like\MessageBreak in the
+ following:%
+ \MessageBreak
+ ----8<------------------8<----%
+ \MessageBreak\MessageBreak
+ \space\space\string\documentclass[blind]{udiss}%
+ \MessageBreak\MessageBreak
+ ----8<------------------8<----%
+ \MessageBreak
+ Otherwise, `supervisor' is a compulsory field. Provide
+ it in the preamble like\MessageBreak in the
+ following:%
+ \MessageBreak
+ ----8<-------------------------8<----%
+ \MessageBreak\MessageBreak
+ \space\space\string\supervisor{supervisor's-name}%
+ \MessageBreak\MessageBreak
+ ----8<-------------------------8<----%
+ \MessageBreak
+ }%
+ \fi
+ \ifdefined\udiss@university
+ \else
+ \def\udiss@university{\textbf{-NoValidUniversity-}}%
+ \ClassError{udiss}{%
+ No university given in a normal (non-blind) document%
+ }{%
+ Do you want a blind document? If yes, then use the
+ package option `blind' like\MessageBreak in the
+ following:%
+ \MessageBreak
+ ----8<------------------8<----%
+ \MessageBreak\MessageBreak
+ \space\space\string\documentclass[blind]{udiss}%
+ \MessageBreak\MessageBreak
+ ----8<------------------8<----%
+ \MessageBreak
+ Otherwise, `university' is a compulsory field. Provide
+ it in the preamble like\MessageBreak in the
+ following:%
+ \MessageBreak
+ ----8<-------------------------8<----%
+ \MessageBreak\MessageBreak
+ \space\space\string\university{university-name}%
+ \MessageBreak\MessageBreak
+ ----8<-------------------------8<----%
+ \MessageBreak
+ }%
+ \fi
+ \ifdefined\udiss@department
+ \else
+ \def\udiss@department{\textbf{-NoValidDepartment-}}%
+ \ClassError{udiss}{%
+ No department given in a normal (non-blind) document%
+ }{%
+ Do you want a blind document? If yes, then use the
+ package option `blind' like\MessageBreak in the
+ following:%
+ \MessageBreak
+ ----8<------------------8<----%
+ \MessageBreak\MessageBreak
+ \space\space\string\documentclass[blind]{udiss}%
+ \MessageBreak\MessageBreak
+ ----8<------------------8<----%
+ \MessageBreak
+ Otherwise, `department'\space is a compulsory field.
+ Provide it in the preamble like in\MessageBreak the
+ following:%
+ \MessageBreak
+ ----8<-------------------------8<----%
+ \MessageBreak\MessageBreak
+ \space\space\string\department{department-name}%
+ \MessageBreak\MessageBreak
+ ----8<-------------------------8<----%
+ \MessageBreak
+ }%
+ \fi
+% \end{macrocode}
+%
+% For printing, \pkg{hyperref} and \pkg{hyperxmp} are
+% irrelevant, so we load them only when the documents are
+% digital.
+%
+% \begin{macrocode}
+ \ifudiss@print
+ \else
+ \RequirePackage{hyperref}%
+ \RequirePackage{hyperxmp}%
+% \end{macrocode}
+%
+% We set the metadata here using |\hypersetup| command.
+%
+% \begin{macrocode}
+ \hypersetup{%
+ unicode,%
+ colorlinks,%
+ pdftitle = {\udiss@title}%
+ }%
+ \ifudiss@subtitle
+ \hypersetup{%
+ pdfsubject = {\udiss@subtitle}%
+ }%
+ \fi
+% \end{macrocode}
+%
+% We don't set author's name if the user has used the
+% |blind| option as it defeats the whole purpose. If it is
+% not used, we set the copyright information and the
+% license-url. All-rights-reserved doesn't have a specific
+% license-url, so it is used only if the user uses a free
+% culture license.
+%
+% \begin{macrocode}
+ \ifudiss@blind
+ \else
+ \hypersetup{%
+ pdfauthor = {\udiss@author},%
+ pdfcopyright = {%
+ \udiss@title\textLF
+ \udiss@local@copyright\
+ ©
+ \udiss@copyrightable@years\
+ \udiss@author\textLF
+ \udiss@license@notice
+ },%
+ }%
+ \ifudiss@free@culture
+ \hypersetup{%
+ pdflicenseurl = {%
+ \udiss@free@license@url
+ }%
+ }%
+ \fi
+ \fi
+% \end{macrocode}
+%
+% If the color option is not disabled, we load the color
+% variables with |\hypersetup|.
+%
+% \begin{macrocode}
+ \ifudiss@colors
+ \hypersetup{%
+ linkcolor = {\udiss@int@link@color},%
+ urlcolor = {\udiss@int@url@color},%
+ citecolor = {\udiss@int@cite@color}%
+ }%
+% \end{macrocode}
+%
+% Otherwise, we use the |hidelinks| option of \pkg{hyperref}
+% which creates links, but without colors.
+%
+% \begin{macrocode}
+ \else
+ \hypersetup{%
+ hidelinks%
+ }%
+ \fi
+ \fi
+}
+% \end{macrocode}
+%
+% Now, after setting everything, we typeset the front matter
+% including title-page, table of contents, optionally list
+% of figures/tables and declaration with the following code.
+%
+% \begin{macrocode}
+\AddToHook{begindocument/end}{%
+ \begingroup
+ \thispagestyle{titlingpage}%
+ \ifudiss@ftitle
+ \setlength{\fboxsep}{25pt}%
+ \noindent\fbox{%
+ \begin{minipage}%
+ [c][\dimexpr\textheight-2\fboxsep-2\fboxrule]%
+ [c]{\dimexpr\linewidth-2\fboxsep-2\fboxrule}%
+ \fi
+ \hspace{0pt}%
+ \vspace{3em}%
+ \begin{center}
+ \begingroup
+ \udiss@title@shape
+ \ifx\udiss@title@font\empty
+ \else
+ \fontspec[\udiss@title@fontfeats]%
+ {\udiss@title@font}%
+ \fi
+ \udiss@title@size
+ \color{\udiss@title@color}%
+ \udiss@title
+ \endgroup
+
+ \medskip
+
+ \ifudiss@subtitle
+ \begingroup
+ \udiss@subtitle@shape
+ \ifx\udiss@subtitle@font\empty
+ \else
+ \fontspec[\udiss@subtitle@fontfeats]%
+ {\udiss@subtitle@font}%
+ \fi
+ \udiss@subtitle@size
+ \color{\udiss@subtitle@color}%
+ \udiss@subtitle
+ \endgroup
+ \fi
+
+ \vfill
+
+ \ifudiss@blind
+ \else
+ \begingroup
+ \udiss@author@shape
+ \ifx\udiss@author@font\empty
+ \else
+ \fontspec[\udiss@author@fontfeats]%
+ {\udiss@author@font}%
+ \fi
+ \udiss@author@size
+ \color{\udiss@author@color}%
+ \udiss@author
+ \ifudiss@pronouns
+ \begingroup
+ \space
+ \addfontfeature{Scale={0.6}}%
+ \udiss@pronouns
+ \endgroup
+ \fi
+ \endgroup
+
+ \vspace{2em}%
+ \fi
+
+ \begingroup
+ \udiss@fulfilment@shape
+ \ifx\udiss@fulfilment@font\empty
+ \else
+ \fontspec[\udiss@fulfilment@fontfeats]%
+ {\udiss@fulfilment@font}%
+ \fi
+ \udiss@fulfilment@size
+ \color{\udiss@fulfilment@color}%
+ \udiss@fulfilment
+ \endgroup
+
+ \vfill
+
+ \begingroup
+ \udiss@uni@shape
+ \ifx\udiss@uni@font\empty
+ \else
+ \fontspec[\udiss@university@fontfeats]%
+ {\udiss@uni@font}%
+ \fi
+ \udiss@uni@size
+ \color{\udiss@uni@color}%
+ \udiss@university
+ \endgroup
+
+ \vspace{0.5em}%
+
+ \begingroup
+ \udiss@dept@shape
+ \ifx\udiss@dept@font\empty
+ \else
+ \fontspec[\udiss@dept@fontfeats]%
+ {\udiss@dept@font}%
+ \fi
+ \udiss@dept@size
+ \color{\udiss@dept@color}%
+ \udiss@department
+ \endgroup
+
+ \ifudiss@logo
+ \bigskip
+ \ifudiss@texlogo
+ \udiss@texlogo
+ \fi
+ \includegraphics[%
+ width = {%
+ \udiss@logo@width\linewidth
+ },%
+ height = {%
+ \udiss@logo@hght\textheight
+ }%
+ ]{%
+ \udiss@logo
+ }%
+ \fi
+ \end{center}
+ \ifudiss@ftitle
+ \end{minipage}%
+ }%
+ \fi
+
+ \newpage
+
+ \ifudiss@blind
+ \else
+ \ifudiss@free@culture
+ \thispagestyle{titlingpage}%
+ \vspace*{\stretch{1}}
+ \begin{quote}
+ \setlength{\parindent}{0pt}%
+ \begingroup
+ \begin{minipage}{\linewidth}
+ \bfseries
+ \udiss@title
+
+ \udiss@local@copyright\
+ ©
+ \udiss@copyrightable@years\
+ \udiss@author
+
+ \medskip
+ \noindent\hrule \linewidth 0.4pt\relax
+ \end{minipage}
+ \endgroup
+
+ \ifudiss@gfdl
+ Permission is granted to copy, distribute and/or
+ modify this document under the terms of the GNU
+ Free Documentation License, Version 1.3 or any
+ later version published by the Free Software
+ Foundation; with no Invariant Sections, no
+ Front-Cover Texts, and no Back-Cover Texts. A copy
+ of the license is included in the section entitled
+ \enquote{GNU Free Documentation License}.%
+ \fi
+ \ifudiss@ccbysa
+ \begin{minipage}{\linewidth}
+ \doclicenseThis
+ \end{minipage}
+ \fi
+ \vspace{\stretch{3}}
+ \end{quote}
+ \newpage
+ \fi
+ \fi
+
+ \tableofcontents*
+
+ \newpage
+
+ \ifudiss@blind
+ \else
+ \ifudiss@declaration
+ \thispagestyle{empty}%
+ \begin{center}%
+ {%
+ \LARGE\bfseries
+ \udiss@decllocal
+ }%
+ \end{center}%
+
+ \udiss@declaration
+ \fi
+ \fi
+
+ \newpage
+
+ \ifudiss@lot
+ \listoftables
+ \fi
+
+ \newpage
+
+ \ifudiss@lof
+ \listoffigures
+ \fi
+ \endgroup
+}%
+% \end{macrocode}
+%
+% The following code adds the GFDL v1.3+ notice at the end
+% of the document if that option was used.
+%
+% \begin{macrocode}
+\ifudiss@blind
+\else
+ \ifudiss@gfdl
+ \AddToHook{enddocument}{%
+ \newpage
+ \begingroup
+ \pagestyle{plain}%
+ \addcontentsline{toc}%
+ {chapter}%
+ {GNU Free Documentation License}%
+ \input{gfdl-tex-1p3}%
+ \clearpage
+ \endgroup
+ }%
+ \fi
+\fi
+%</class>
+% \end{macrocode}
+%
+% Our class ended here. Now we start creating the
+% language-support files. The first is the Malayalam
+% language. We use fonts provided at:
+% \url{https://ctan.org/pkg/rit-fonts}. Notice that this is
+% done conditionally. If the language is loaded as the main
+% language, the fonts are set as the default fonts using
+% class options, else |malayalam| is passed as the optional
+% argument to |\babelfont|.
+%
+% \begin{macrocode}
+%<*babel-ml>
+\IfLanguageName{malayalam}{%
+ \ekvset{udiss}{%
+ rmfont = {RIT-Rachana-Regular.ttf},%
+ rmitfont = {RIT-Rachana-Italic.ttf},%
+ rmbffont = {RIT-Rachana-Bold.ttf},%
+ rmbfitfont = {RIT-Rachana-BoldItalic.ttf},%
+ rmfeatures = {%
+ Script = {Malayalam}%
+ },%
+ sffont = {RIT-MeeraNew.ttf},%
+ sfitfont = {RIT-MeeraNew.ttf},%
+ sfbffont = {RIT-tnjoy-bold.ttf},%
+ sfbfitfont = {RIT-tnjoy-bold.ttf},%
+ sffeatures = {%
+ Script = {Malayalam}%
+ },%
+ ttfont = {RIT-MeeraNew.ttf},%
+ ttitfont = {RIT-MeeraNew.ttf},%
+ ttbffont = {RIT-tnjoy-bold.ttf},%
+ ttbfitfont = {RIT-tnjoy-bold.ttf},%
+ sffeatures = {%
+ Script = {Malayalam}%
+ }%
+ }%
+}{%
+ \babelfont[malayalam]{rm}[%
+ IgnoreFontspecFile,%
+ Script = {Malayalam},%
+ ItalicFont = {RIT-Rachana-Italic.ttf},%
+ BoldFont = {RIT-Rachana-Bold.ttf},%
+ BoldItalicFont = {RIT-Rachana-BoldItalic.ttf},%
+ \ifLuaTeX
+ Renderer = {HarfBuzz}%
+ \fi
+ ]{RIT-Rachana-Regular.ttf}
+ \babelfont[malayalam]{sf}[%
+ IgnoreFontspecFile,%
+ Script = {Malayalam},%
+ ItalicFont = {RIT-tnjoy-regular.ttf},%
+ BoldFont = {RIT-tnjoy-bold.ttf},%
+ BoldItalicFont = {RIT-tnjoy-bold.ttf},%
+ \ifLuaTeX
+ Renderer = {HarfBuzz}%
+ \fi
+ ]{RIT-tnjoy-regular.ttf}
+ \babelfont[malayalam]{tt}[%
+ IgnoreFontspecFile,%
+ Script = {Malayalam},%
+ ItalicFont = {RIT-tnjoy-regular.ttf},%
+ BoldFont = {RIT-tnjoy-bold.ttf},%
+ BoldItalicFont = {RIT-tnjoy-bold.ttf},%
+ \ifLuaTeX
+ Renderer = {HarfBuzz}%
+ \fi
+ ]{RIT-tnjoy-regular.ttf}%
+}
+%</babel-ml>
+% \end{macrocode}
+%
+% Marathi requires local numerals and local counters. We
+% provide that here and set Mukta as the default font
+% provided in: \url{https://ctan.org/pkg/EkType-Tanka}.
+%
+% \begin{macrocode}
+%<*babel-mr>
+\babelprovide[%
+ mapdigits,%
+ counters/स्वर = अ आ इ ई उ ऊ ए ऐ ओ औ अं अः ॲ ऋ ऌ ऑ,%
+ counters/अंक = एक दोन तीन चार पाच सहा सात आठ नऊ दहा अकरा
+ बारा तेरा चौदा पंधरा सोळा सतरा अठरा एकोणीस वीस एकवीस बावीस
+ तेवीस चोवीस पंचवीस सव्वीस सत्तावीस अठ्ठावीस एकोणतीस तीस एकतीस
+ बत्तीस तेहतीस चौतीस पस्तीस छत्तीस सदतीस अडतीस एकोणचाळीस चाळीस
+ एकेचाळीस बेचाळीस त्रेचाळीस चव्वेचाळीस पंचेचाळीस शेहेचाळीस सत्तेचाळीस
+ अठ्ठेचाळीस एकोणपन्नास पन्नास एकावन्न बावन्न त्रेपन्न चौपन्न पंचावन्न
+ छप्पन्न सत्तावन्न अठ्ठावन्न एकोणसाठ साठ एकसष्ट बासष्ट त्रेसष्ट चौसष्ट
+ पासष्ट सहासष्ट सदुष्ट अडुसष्ट एकोणसत्तर सत्तर एकाहत्तर बाहत्तर
+ त्र्याहत्तर चौऱ्याहत्तर पंचाहत्तर शाहत्तर सत्त्याहत्तर अठ्ठ्याहत्तर
+ एकोणऐंशी ऐंशी एक्याऐंशी ब्याऐंशी त्र्याऐंशी चौऱ्याऐंशी पंच्याऐंशी श्याऐंशी
+ सत्त्याऐंशी अठ्ठ्याऐंशी एकोणनव्वद नव्वद एक्याण्णव ब्याण्णव त्र्याण्णव
+ चौऱ्याण्णव पंचाण्णव शहाण्णव सत्त्याण्णव अठ्याण्णव नव्याण्णव शंभर,%
+ counters/व्यंजन = क ख ग घ ङ%
+ च छ ज झ ञ%
+ ट ठ ड ढ ण%
+ त थ द ध न%
+ प फ ब भ म%
+ य र ल व श ष स ह ळ,%
+ Alph = अंक,%
+ alph = स्वर%
+]{marathi}
+\def\theenumiii{\localecounter{व्यंजन}{enumiii}}
+\def\theenumiv{\localecounter{अंक}{enumiii}}
+\IfLanguageName{marathi}{%
+ \ekvset{udiss}{%
+ rmfont = {Mukta-Regular.ttf},%
+ rmitfont = {Mukta-Regular.ttf},%
+ rmbffont = {Mukta-Bold.ttf},%
+ rmbfitfont = {Mukta-Bold.ttf},%
+ rmfeatures = {%
+ Script = {Devanagari}%
+ },%
+ sffont = {Mukta-Regular.ttf},%
+ sfitfont = {Mukta-Regular.ttf},%
+ sfbffont = {Mukta-Bold.ttf},%
+ sfbfitfont = {Mukta-Bold.ttf},%
+ sffeatures = {%
+ Script = {Devanagari}%
+ },%
+ ttfont = {Mukta-Regular.ttf},%
+ ttitfont = {Mukta-Regular.ttf},%
+ ttbffont = {Mukta-Bold.ttf},%
+ ttbfitfont = {Mukta-Bold.ttf},%
+ sffeatures = {%
+ Script = {Devanagari}%
+ }%
+ }%
+}{%
+ \babelfont[marathi]{rm}[%
+ IgnoreFontspecFile,%
+ ItalicFont = {Mukta-Regular.ttf},%
+ BoldFont = {Mukta-Bold.ttf},%
+ BoldItalicFont = {Mukta-Bold.ttf},%
+ Language = {Marathi},%
+ Script = {Devanagari},%
+ Numbers = {OldStyle},%
+ \ifLuaTeX
+ Renderer = {HarfBuzz}%
+ \fi
+ ]{Mukta-Regular.ttf}
+ \babelfont[marathi]{sf}[%
+ IgnoreFontspecFile,%
+ ItalicFont = {Mukta-Regular.ttf},%
+ BoldFont = {Mukta-Bold.ttf},%
+ BoldItalicFont = {Mukta-Bold.ttf},%
+ Language = {Marathi},%
+ Script = {Devanagari},%
+ Numbers = {OldStyle},%
+ \ifLuaTeX
+ Renderer = {HarfBuzz}%
+ \fi
+ ]{Mukta-Regular.ttf}
+ \babelfont[marathi]{tt}[%
+ IgnoreFontspecFile,%
+ ItalicFont = {Mukta-Regular.ttf},%
+ BoldFont = {Mukta-Bold.ttf},%
+ BoldItalicFont = {Mukta-Bold.ttf},%
+ Language = {Marathi},%
+ Script = {Devanagari},%
+ Numbers = {OldStyle},%
+ \ifLuaTeX
+ Renderer = {HarfBuzz}%
+ \fi
+ ]{Mukta-Regular.ttf}%
+}
+%</babel-mr>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*babel-en>
+\babelfont[english]{rm}[%
+ IgnoreFontspecFile,%
+ Extension = {.otf},%
+ ItalicFont = {NewCM10-BookItalic},%
+ BoldFont = {NewCM10-Bold},%
+ BoldItalicFont = {NewCM10-BoldItalic},%
+ SlantedFont = {NewCM10-Book},%
+ BoldSlantedFont = {NewCM10-Bold},%
+ Numbers = {OldStyle},%
+ CharacterVariant = {6},%
+ \ifLuaTeX
+ Renderer = {HarfBuzz}%
+ \fi
+]{NewCM10-Book}
+\babelfont[english]{sf}[%
+ IgnoreFontspecFile,%
+ Extension = {.otf},%
+ ItalicFont = {NewCMSans10-BookOblique},%
+ BoldFont = {NewCMSans10-Bold},%
+ BoldItalicFont = {NewCMSans10-BoldOblique},%
+ SlantedFont = {NewCMSans10-Book},%
+ BoldSlantedFont = {NewCMSans10-Bold},%
+ Numbers = {OldStyle},%
+ CharacterVariant = {6},%
+ \ifLuaTeX
+ Renderer = {HarfBuzz}%
+ \fi
+]{NewCMSans10-Book}
+\babelfont[english]{tt}[%
+ IgnoreFontspecFile,%
+ Extension = {.otf},%
+ BoldFont = {NewCMMono10-Bold},%
+ ItalicFont = {NewCMMono10-Italic},%
+ \ifLuaTeX
+ Renderer = {HarfBuzz}%
+ \fi
+]{NewCMMono10-Book}
+%</babel-en>
+% \end{macrocode}
+%
+% Hindi and Marathi share the script, but the language
+% variants Marathi needs are not required by Hindi. So we
+% use the same font, but with a little different settings
+% for Hindi.
+%
+% \begin{macrocode}
+%<*babel-hi>
+\IfLanguageName{hindi}{%
+ \ekvset{udiss}{%
+ rmfont = {Mukta-Regular.ttf},%
+ rmitfont = {Mukta-Regular.ttf},%
+ rmbffont = {Mukta-Bold.ttf},%
+ rmbfitfont = {Mukta-Bold.ttf},%
+ rmfeatures = {%
+ Script = {Devanagari}%
+ },%
+ sffont = {Mukta-Regular.ttf},%
+ sfitfont = {Mukta-Regular.ttf},%
+ sfbffont = {Mukta-Bold.ttf},%
+ sfbfitfont = {Mukta-Bold.ttf},%
+ sffeatures = {%
+ Script = {Devanagari}%
+ },%
+ ttfont = {Mukta-Regular.ttf},%
+ ttitfont = {Mukta-Regular.ttf},%
+ ttbffont = {Mukta-Bold.ttf},%
+ ttbfitfont = {Mukta-Bold.ttf},%
+ sffeatures = {%
+ Script = {Devanagari}%
+ }%
+ }%
+}{%
+ \babelfont[hindi]{rm}[%
+ IgnoreFontspecFile,%
+ ItalicFont = {Mukta-Regular.ttf},%
+ BoldFont = {Mukta-Bold.ttf},%
+ BoldItalicFont = {Mukta-Bold.ttf},%
+ Language = {Hindi},%
+ Script = {Devanagari},%
+ Numbers = {OldStyle},%
+ \ifLuaTeX
+ Renderer = {HarfBuzz}%
+ \fi
+ ]{Mukta-Regular.ttf}
+ \babelfont[hindi]{sf}[%
+ IgnoreFontspecFile,%
+ ItalicFont = {Mukta-Regular.ttf},%
+ BoldFont = {Mukta-Bold.ttf},%
+ BoldItalicFont = {Mukta-Bold.ttf},%
+ Language = {Hindi},%
+ Script = {Devanagari},%
+ Numbers = {OldStyle},%
+ \ifLuaTeX
+ Renderer = {HarfBuzz}%
+ \fi
+ ]{Mukta-Regular.ttf}
+ \babelfont[hindi]{tt}[%
+ IgnoreFontspecFile,%
+ ItalicFont = {Mukta-Regular.ttf},%
+ BoldFont = {Mukta-Bold.ttf},%
+ BoldItalicFont = {Mukta-Bold.ttf},%
+ Language = {Hindi},%
+ Script = {Devanagari},%
+ Numbers = {OldStyle},%
+ \ifLuaTeX
+ Renderer = {HarfBuzz}%
+ \fi
+ ]{Mukta-Regular.ttf}
+}
+%</babel-hi>
+% \end{macrocode}
+%
+% In this tag, we set three main variables for the |ukerala|
+% dissertation-style. This is just a sample. These style
+% files can contain much more than this. In the experimental
+% release, we start with a small sample. We will be
+% expanding this more.
+%
+% \begin{macrocode}
+%<*ukerala>
+\ekvset{udiss}{%
+ university = {University of Kerala},%
+ logo = {udiss-logo-ukerala.png},%
+ logoheight = {0.11}%
+}
+%</ukerala>
+% \end{macrocode}
+% \end{implementation}
+% \PrintIndex
+% \Finale
diff --git a/Master/texmf-dist/source/latex/udiss/udiss.ins b/Master/texmf-dist/source/latex/udiss/udiss.ins
new file mode 100644
index 00000000000..3a3023dbb14
--- /dev/null
+++ b/Master/texmf-dist/source/latex/udiss/udiss.ins
@@ -0,0 +1,75 @@
+% File: udiss.ins
+\input l3docstrip.tex
+
+\keepsilent
+\askforoverwritefalse
+
+\preamble
+---------------------------------------------------------
+Bundle: udiss
+Version: v0.1 (October 1, 2024)
+Author: Indian TeX Users Group
+Description: A LaTeX bundle for typesetting dissertations
+Bugs: puszcza.gnu.org.ua/bugs/?group=udiss
+Licenses: GPLv3+, GFDLv1.3+
+---------------------------------------------------------
+
+The LaTeX bundle udiss v0.1
+Copyright © 2024 Indian TeX Users Group
+
+This program is free software: you can redistribute it
+and/or modify it under the terms of the GNU General
+Public License as published by the Free Software
+Foundation, either version 3 of the License, or (at your
+option) any later version.
+
+This program 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. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public
+License along with this program. If not, see
+<https://www.gnu.org/licenses/>.
+---------------------------------------------------------
+\endpreamble
+\usedir{tex/latex/\jobname}
+\generate{%
+ \file{\jobname.cls}{\from{\jobname.dtx}{class}}%
+}
+% ----------------------------------------------------------
+% BEGIN GENERATING UDISS BABEL FILES
+\generate{%
+ \file{\jobname-fonts-malayalam.tex}{%
+ \from{\jobname.dtx}{babel-ml}%
+ }%
+}
+\generate{%
+ \file{\jobname-fonts-marathi.tex}{%
+ \from{\jobname.dtx}{babel-mr}%
+ }%
+}
+\generate{%
+ \file{\jobname-fonts-english.tex}{%
+ \from{\jobname.dtx}{babel-en}%
+ }%
+}
+\generate{%
+ \file{\jobname-fonts-hindi.tex}{%
+ \from{\jobname.dtx}{babel-hi}%
+ }%
+}
+\generate{%
+ \file{\jobname-style-ukerala.tex}{%
+ \from{\jobname.dtx}{ukerala}%
+ }%
+}
+% END GENERATING UDISS BABEL FILES
+% ----------------------------------------------------------
+\nopreamble\nopostamble
+\usedir{doc/latex/\jobname}
+\generate{%
+ \file{README.txt}{\from{\jobname.dtx}{readme}}%
+}
+\endbatchfile
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 Bibliothèque de l’Université Laval dé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
+% écrivant à %
+% \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/useclass/useclass.dtx b/Master/texmf-dist/source/latex/useclass/useclass.dtx
index 37016e738b6..d4eb1744d19 100644
--- a/Master/texmf-dist/source/latex/useclass/useclass.dtx
+++ b/Master/texmf-dist/source/latex/useclass/useclass.dtx
@@ -62,17 +62,19 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesExplPackage{useclass}
-%<package> {2024-03-06}{1.0}{Use Classes as Packages} %
+%<package> {2024-10-03}{1.1}{Use Classes as Packages} %
%<*driver>
\documentclass{article}
\usepackage{useclass}
\useclass*[full]{l3doc}
+\RecordChanges
\usepackage{mdframed}
\providecommand{\name}{\jobname}
\providecommand{\pkgname}{\pkg{\name}}
\begin{document}
\DocInput{\jobname.dtx}
+ \PrintChanges
\PrintIndex
\end{document}
%</driver>
@@ -81,7 +83,7 @@
% \title{The \pkgname.sty Package: Load Classes as Packages}
% \author
% {
-% Huang Yuxi
+% Huang Yuxi^^A
% \thanks{
% \textit{Huang} is his surname.
% }
@@ -91,7 +93,7 @@
% {useclass@hyxi.dev}^^A
% >
% }
-% \date{2024-03-06 \quad Version 1.0}
+% \date{2024-10-03 \quad Version 1.1}
%
%
% \maketitle
@@ -106,6 +108,8 @@
%
% \tableofcontents
%
+% \changes{v1.0}{2024-03-05}{Initial release.}
+%
% \begin{documentation}
%
% \section{Introduction}
@@ -159,7 +163,8 @@
% \begin{verbatim}
% % \iffalse
% \documentclass{article}
-% \usepackage{l3doc}
+% \usepackage{useclass}
+% \useclass*[full]{l3doc}
% \begin{document}
% \DocInput{\jobname.dtx}
% \end{document}
@@ -438,6 +443,7 @@
%
% \subsection{Classes Configuration}
% \begin{variable}{\c_@@_classes_prop}
+% \changes{v1.1}{2024-10-03}{Support \cls{ctex} classes.}
% Configuration for classes to restore after loading.
% The defined property is NOT nested, where values in the prop are token lists but not properties or sequences.
% \begin{macrocode}
@@ -459,6 +465,7 @@
list,
l@section,
l@subsection,
+ @maketitle,
},
},
}
@@ -470,4 +477,3 @@
% \end{macrocode}
%
% \end{implementation}
-% \PrintIndex
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/verifycommand/verifycommand.dtx b/Master/texmf-dist/source/latex/verifycommand/verifycommand.dtx
index 4e1a1ae6d66..eb01d05e338 100644
--- a/Master/texmf-dist/source/latex/verifycommand/verifycommand.dtx
+++ b/Master/texmf-dist/source/latex/verifycommand/verifycommand.dtx
@@ -17,7 +17,7 @@
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{verifycommand}
-%<package> [2024/01/11 v1.00 Verify definitions have not changed.]
+%<package> [2024/09/03 v1.10 Verify definitions have not changed.]
%
%<*driver>
\documentclass{ltxdoc}
@@ -77,7 +77,7 @@
\usepackage{microtype}
-
+\usepackage{nowidow}
\usepackage[svgnames]{xcolor}
@@ -233,6 +233,7 @@
\usepackage{\mypackagename}
+%\usepackage[disable]{\mypackagename}
@@ -301,6 +302,7 @@ pageanchor=true,
%
% \changes{v1.00}{2024/01/11}{\ 2024/01/11 Initial version.}
+% \changes{v1.10}{2024/09/03}{\ 2024/09/03}
% \GetFileInfo{\mypackagename.sty}
@@ -353,11 +355,17 @@ pageanchor=true,
%
% To improve reliability,
% the \pkg{verifycommand} package provides a way to verify that
-% macros or environments have not changed.
-% This allows a package author to check before patching a definition.
+% macros or environments have not changed since the patches were
+% last designed.
+% This may be checked before applying the patch.
% If a definition is not as expected, a warning is issued.
% At the end of the compile, a list of all changed definitions is displayed.
%
+% Conditionals are provided, allowing multiple versions of a definition
+% to be tested and patched, warning if no known version is found.
+% Conditionals also allow the package to verify that several macros
+% are unchanged before taking a single common action.
+%
% \vfill
%
% \footnotesize
@@ -448,12 +456,51 @@ pageanchor=true,
% expected values.
%
%
-% \clearpage
+% \section{Warnings}
+%
+% \changes{v1.10}{2024/09/03}{Docs: Added Warnings section.}
+%
+% The document \textit{\LaTeX\ for authors} (\cmds{texdoc usrguide}
+% recommends the use of \LaTeX\ hooks where possible (\cmds{texdoc lthooks}).
+%
+% Commands created with \cs{NewDocumentCommand} and related may
+% \watchout[kernel changes]
+% change their definitions when the inner workings of
+% \cs{NewDocumentCommand} are optimized.
+% When this occurs, any checksums for these commands will
+% change, even though the associated patches probably will continue to work.
+% If you use \pkg{verifycommand} for these commands, expect the
+% checksums to need updates at some point in the future.
+%
+% Use \cs{NewCommandCopy} and \cs{NewEnvironmentCopy} to copy commands
+% for reuse. These work with all kinds of commmand definitions.
+% See \cmds{texdoc usrguide} for details.
+%
+% Use \cs{ShowCommand} or \cs{ShowEnvironment} to see an existing definition,
+% which again works with all forms of commands.
+%
%
% \section{How to use \pkg{verifycommand}}
%
+%
% \subsection{The user interface}
%
+% \changes{v1.10}{2024/06/25}{Docs: Added conditional tests.}
+%
+% In the following, \oarg{yourpackagename} is the package doing the
+% testing and patching,
+% and \oarg{theirpackagename} is the package which defines
+% the original macro.
+% Using these optional package names make it easier to find where
+% to make changes if needed.
+%
+% If there is only one optional argument,
+% \watchout[optional arguments]
+% it is used as \oarg{yourpackagename},
+% to identify where to find the \cs{VerifyCommand} checksum entry.
+% The second optional argument identifies what is being patched,
+% in case it has been changed.
+%
% \needspace{2\baselineskip}
% \DescribeMacro{\VerifyCommand} \oarg{yourpackagename} \oarg{theirpackagename}
% \marg{\cs{macroname}} \marg{\MDfive\ checksum}
@@ -464,13 +511,54 @@ pageanchor=true,
% \fqquad \marg{begin \MDfive\ checksum} \marg{end \MDfive\ checksum}
%
% Use one of these macros just before patching a macro or environment,
-% as seen below.
+% as seen below. A test is performed to see if the definition
+% is as expected before applying a patch.
%
% Note that there is one checksum for \cs{VerifyCommand}, but there
-% are two checksums for \cs{VerifyEnvironment}: once for the begin section
+% are two checksums for an environment: once for the begin section
% and one for the end section.
%
-% If there is only one optional argument, it is used as your package name.
+% It may be necessary to test for each of several possible versions of
+% a definition, then patch accordingly. The following test and apply a
+% true or false clause, without issuing a warning.
+%
+% \needspace{2\baselineskip}
+% \DescribeMacro{\IfVerifyCommand} \oarg{yourpackagename} \oarg{theirpackagename}
+% \marg{\cs{macroname}} \\
+% \fqquad \marg{\MDfive\ checksum} \\
+% \fqquad \marg{true} \marg{false}
+%
+% \needspace{3\baselineskip}
+% \DescribeMacro{\IfVerifyEnvironmentBegin} \oarg{yourpackagename} \oarg{theirpackagename}
+% \marg{\env{envname}} \\
+% \fqquad \marg{begin \MDfive\ checksum} \\
+% \fqquad \marg{true} \marg{false}
+%
+% \needspace{3\baselineskip}
+% \DescribeMacro{\IfVerifyEnvironmentEnd} \oarg{yourpackagename} \oarg{theirpackagename}
+% \marg{\env{envname}} \\
+% \fqquad \marg{end \MDfive\ checksum} \\
+% \fqquad \marg{true} \marg{false}
+%
+% Tests may be done as a group, either to try several versions of the same
+% definition, or to verify several definitions and act if any of them fail:
+%
+% \DescribeMacro{\TestVerifyCommands} Starts a group of tests.
+%
+% \DescribeMacro{\IfVerifyCommandPassed} \marg{true} \marg{false}
+% \quad Act if any of a group passed.
+% May be used to try to patch multiple versions of a command.
+%
+% \DescribeMacro{\IfVerifyCommandFailed} \marg{true} \marg{false}
+% \quad Act if any of a group failed.
+% May be used to verify several definitions are unchanged.
+%
+% A warning may be also issued:
+%
+% \DescribeMacro{\VERCMDWarning} \marg{yourpackage} \marg{theirpackage} \marg{defn name}
+% \quad Used to issue a warning that the macro has changed.
+%
+% See \cref{sec:conditionals} for examples of conditional tests.
%
%
% \subsection{Placing the macros}
@@ -483,70 +571,86 @@ pageanchor=true,
%
% \begin{sourceverb}
% \VerifyCommand{\LaTeX}{}
-% <patch \LaTeX here>
+% (patch \LaTeX here)
%
% \VerifyCommand[mypackage]{\textcolor}{}
-% <patch \textcolor here>
+% (patch \textcolor here)
%
% \VerifyCommand[mypackage][graphics]{\rotatebox}{}
-% <patch \rotatebox here>
+% (patch \rotatebox here)
%
% \VerifyEnvironment{tabbing}{}{}
-% <patch tabbing here>
+% (patch tabbing here)
% \end{sourceverb}
%
%
% \subsection{Finding the checksums of the current definitions}
+% \changes{v1.10}{2024/06/25}{Docs: ``Finding checksums'' reorganized.}
%
-% In the above examples, testing \cs{LaTeX} would print a warning showing
-% the correct \MDfive\ checksum.
-% Testing \cs{textcolor} would do the same, but as a \cs{PackageWarning} from \pkg{mypackage}.
-% Testing \cs{rotatebox} would also mention the package being tested, \pkg{graphics}.
-% Testing \env{tabbing} issues a separate warning for the begin and end sections.
-%
-%
+% The warnings are issued and the correct checksums are given.
+% The type of warning depends on the usage:
+% \begin{itemize}
+% \item Verifying \cs{LaTeX} would print a warning showing
+% the correct \MDfive\ checksum.
% \begin{sourceverb}
-% Warning: Something may fail. A definition has changed:
+% Warning: A definition has changed:
% \LaTeX
-% FAAAC6146C9A80F46A1F029B67923851
+% (FAAAC6146C9A80F46A1F029B67923851)
% on input line 464.
-
-% Package mypackage Warning: Something may fail. A definition has changed:
+% \end{sourceverb}
+% \item Verifying \cs{textcolor} would do the same,
+% but as a \cs{PackageWarning} from \pkg{mypackage},
+% which is the package doing the testing.
+% \begin{sourceverb}
+% Package mypackage Warning: A definition has changed:
% (mypackage) \textcolor
-% (mypackage) E1E2B5A908AA1BCDDF6BEA038596A381
+% (mypackage) (E1E2B5A908AA1BCDDF6BEA038596A381)
% (mypackage) on input line 465.
-
-% Package mypackage Warning: Something may fail. A definition has changed:
+% \end{sourceverb}
+% \item Verifying \cs{rotatebox} would also issue a warning from \pkg{mypackage},
+% but also mention the package being tested, \pkg{graphics}.
+% \begin{sourceverb}
+% Package mypackage Warning: A definition has changed:
% (mypackage) graphics: \rotatebox
-% (mypackage) 2472999B02C97AC847128AF24C55D150
+% (mypackage) (2472999B02C97AC847128AF24C55D150)
% (mypackage) on input line 466.
-%
-% Warning: Something may fail. A definition has changed:
+% \end{sourceverb}
+% \item Verifying \env{tabbing} issues a separate warning
+% for the begin and end sections.
+% \begin{sourceverb}
+% Warning: A definition has changed:
% tabbing
-% 1AD73B4527AD30969CF3219F2FB1306B
+% (1AD73B4527AD30969CF3219F2FB1306B)
% on input line 518.
%
-% Warning: Something may fail. A definition has changed:
+% Warning: A definition has changed:
% (end)tabbing
-% E8326AC43EE0A6E922A20F2A798BD177
+% (E8326AC43EE0A6E922A20F2A798BD177)
% on input line 518.
% \end{sourceverb}
+% \end{itemize}
+%
%
-% And at the end of the compile, a summary is given:
+% At the end of the compile, a summary is given:
%
% \begin{sourceverb}
% --------------------------------
-% WARNING: Something may fail.
-% Definition changed: \LaTeX
-% Definition changed: FAAAC6146C9A80F46A1F029B67923851
-% Definition changed: \textcolor
-% Definition changed: E1E2B5A908AA1BCDDF6BEA038596A381
-% Definition changed: graphics: \rotatebox
-% Definition changed: 2472999B02C97AC847128AF24C55D150
-% Definition changed: tabbing
-% Definition changed: 1AD73B4527AD30969CF3219F2FB1306B
-% Definition changed: (end)tabbing
-% Definition changed: E8326AC43EE0A6E922A20F2A798BD177
+% Package verifycommand Warning: Definitions have changed.
+% Patches for the following macros may need to be updated.
+% See the previous warnings for line numbers.
+%
+% Syntax: Patching pkg -> Defining pkg: Macro (checksum)
+% -----
+% (verifycommand) \LaTeX
+% (FAAAC6146C9A80F46A1F029B67923851)
+% (verifycommand) mypackage -> \textcolor
+% (E1E2B5A908AA1BCDDF6BEA038596A381)
+% (verifycommand) mypackage -> graphics: \rotatebox
+% (2472999B02C97AC847128AF24C55D150)
+% (verifycommand) tabbing
+% (1AD73B4527AD30969CF3219F2FB1306B)
+% (verifycommand) (end)tabbing
+% (E8326AC43EE0A6E922A20F2A798BD177)
% --------------------------------
% \end{sourceverb}
%
@@ -558,24 +662,24 @@ pageanchor=true,
%
% \begin{sourceverb}
% \VerifyCommand{\LaTeX}{FAAAC6146C9A80F46A1F029B67923851}
-% <patch \LaTeX here>
+% (patch \LaTeX here)
%
% \VerifyCommand[mypackage]{\textcolor}
% {E1E2B5A908AA1BCDDF6BEA038596A381}
-% <patch \textcolor here>
+% (patch \textcolor here)
%
% \VerifyCommand[mypackage][graphics]{\rotatebox}
% {2472999B02C97AC847128AF24C55D150}
-% <patch \rotatebox here>
+% (patch \rotatebox here)
%
% \VerifyEnvironment{tabbing}
% {1AD73B4527AD30969CF3219F2FB1306B}% beginning code
% {E8326AC43EE0A6E922A20F2A798BD177}% endind code
-% <patch tabbing here>
+% (patch tabbing here)
% \end{sourceverb}
%
%
-% \subsection{When a definition is changed}
+% \subsection{When a definition has changed}
%
% When something being verified changes at a later time, the resulting
% warning will let the user know that the patches may not work
@@ -584,14 +688,97 @@ pageanchor=true,
% this warning will be issued before the patch is even attempted.
%
% When testing many packages in bulk, a utility such as \cmds{grep}
-% can report the changed definitions.
-% Search the log file for ``Definition changed:''.
+% can report which macros have changed.
+% Search the log file for ``\texttt{(verifycommand)}''.
+%
+%
+% \subsection{Testing for changed macros}
+% \label{sec:conditionals}
+%
+% \changes{v1.10}{2024/06/25}{Docs: Added conditional tests.}
+%
+% To test to see if a macro or environment has changed, use
+% \cs{IfVerifyCommand}, \cs{IfVerifyEnvironmentBegin},
+% or \cs{IfVerifyEnvironmentEnd}.
+%
+% Example:
+% \begin{sourceverb}
+% \IfVerifyCommand[mypackage][LaTeX kernel]{\LaTeX}{123}{True}{False}
+% \end{sourceverb}
+% Result: \IfVerifyCommand[mypackage][LaTeX kernel]{\LaTeX}{}{True}{False}
+%
+% Example:
+% \begin{sourceverb}
+% \IfVerifyCommand[mypackage][LaTeX kernel]{\LaTeX}
+% {FAAAC6146C9A80F46A1F029B67923851}
+% {True}{False}
+% \end{sourceverb}
+% Result:
+% \IfVerifyCommand[mypackage][LaTeX kernel]{\LaTeX}
+% {FAAAC6146C9A80F46A1F029B67923851}
+% {True}{False}
+% (Assuming \cs{LaTeX} has not actually changed since
+% this manual was generated.)
+%
+% Example:
+% \begin{sourceverb}
+% \IfVerifyEnvironmentEnd[mypackage][LaTeX kernel]{tabbing}
+% {E8326AC43EE0A6E922A20F2A798BD177}
+% {True}{False}
+% \end{sourceverb}
+% Result:
+% \IfVerifyEnvironmentEnd[mypackage][LaTeX kernel]{tabbing}
+% {E8326AC43EE0A6E922A20F2A798BD177}
+% {True}{False}
+%
+% If the \pkg{verifycommand} package is disabled, these tests
+% will always return true.
+%
+% These tests do not issue warnings if the test fails, so they may
+% be used to test against several possible definitions, chosing the
+% appropriate patch depending on which match is found.
+%
+% To try to patch multiple versions of the same command,
+% and issue a warning if no match is found:
+%
+% \begin{sourceverb}
+% \TestVerifyCommands
+%
+% \IfVerifyCommand[mypackage][theirpackage]{\theirmacro}
+% {12312312312312312321312312312312}
+% {(Patch an older version of the macro.)}
+%
+% \IfVerifyCommand[mypackage][theirpackage]{\theirmacro}
+% {45645645645645645645645645645645}
+% {(Patch a newer version of the macro.)}
+%
+% \IfVerifyCommandPassed
+% {}% One of the patches worked.
+% {\VERCMDWarning{mypackage}{theirpackage}{\theirmacro}}
+% \end{sourceverb}
+%
+% To verify several commands have not changed:
+%
+% \begin{sourceverb}
+% \TestVerifyCommands
+%
+% \VerifyCommand[mypackage][theirpackage]{\firstmacro}
+% {78978978978978978978978978978978}
+% \VerifyCommand[mypackage][theirpackage]{\secondmacro}
+% {27272727272727272727277272727272}
+% \VerifyCommand[mypackage][theirpackage]{\thirdmacro}
+% {84838483848384838483848384838483}
+%
+% \IfVerifyCommandFailed
+% {Something is not correct. (Warnings have been issued above.)}
+% {}% All are fine.
+% \end{sourceverb}
%
%
% \subsection{Disabling the package}
%
% \pkg{verifycommand} relies on knowing the internal structure of
-% various kinds of definitions. It is possible that these may change some day,
+% various kinds of definitions. It is possible that these may change,
% causing endless warnings for that kind of definition.
% Should that happen, it will be necessary to disable the \pkg{verifycommand}
% package until it can be updated.
@@ -601,15 +788,22 @@ pageanchor=true,
% \usepackage[disable]{verifycommand}
% \end{sourceverb}
%
+% Package warnings will stop,
+% and the conditional tests will always return true.
+%
+% If the package is disabled, the boolean \bool{VERCMDenable}
+% will be |false|. This may be used to help decide which patches
+% to apply as a default.
%
%
% ^^A To trigger the checksums to be copied into the exmaples:
+% \typeout{(verifycommand): The following warnings that definitions have changed}
+% \typeout{are expected, and are for demonstration purposes:}
% \VerifyCommand{\LaTeX}{}
% \VerifyCommand[mypackage]{\textcolor}{}
% \VerifyCommand[mypackage][graphics]{\rotatebox}{}
% \VerifyEnvironment{tabbing}{}{}
%
-%
% \clearpage
%
% ^^A \StopEventually{\PrintChanges\PrintIndex}
@@ -638,7 +832,7 @@ pageanchor=true,
% \PrintChanges
% \phantomsection
% \label{sec:changesend}
-%
+% \clearpage
%
% ^^A The instructions for the Index of Objects:
% \IndexPrologue{
@@ -719,7 +913,7 @@ pageanchor=true,
%
% \typeout{--------------------------------}
% \typeout{The following warning that}
-% \typeout{something may fail is an}
+% \typeout{definitions have changed is an}
% \typeout{example of the output of this}
% \typeout{package, and is not evidence of}
% \typeout{a problem with the verifycommand}
@@ -747,16 +941,16 @@ pageanchor=true,
%
% Package option to disable all functions.
%
-% \DescribeBoolean{VERCMD@enable} Is the package enabled?
+% \DescribeBoolean{VERCMDenable} Is the package enabled?
% \begin{macrocode}
-\newbool{VERCMD@enable}
-\booltrue{VERCMD@enable}
+\newbool{VERCMDenable}
+\booltrue{VERCMDenable}
% \end{macrocode}
%
% \DescribeOption{disable} Turn off all functions.
% \begin{macrocode}
\DeclareOption{disable}{%
- \boolfalse{VERCMD@enable}%
+ \boolfalse{VERCMDenable}%
\typeout{----}%
\typeout{Package verifycommand: Turned off by option 'disable'.}%
\typeout{----}%
@@ -788,6 +982,8 @@ pageanchor=true,
%
% The \MDfive\ hash is used for \env{lateximage} filenames for \SVG\ math.
%
+% The default definition if no MD5 function is found.
+% This will be changed below if an MD5 function is available.
% \begin{macrocode}
\newcommand{\VERCMD@mdfivesum}[1]{%
\PackageError{verifycommand}
@@ -855,27 +1051,78 @@ pageanchor=true,
% \end{macrocode}
% \end{macro}
+% \DescribeBoolean{VERCMD@this@ltxcmd} True if this command is
+% defined by \cs{NewDocumentCommand} or related.
+% \begin{macrocode}
+\newbool{VERCMD@this@ltxcmd}
+\boolfalse{VERCMD@this@ltxcmd}
+% \end{macrocode}
+
+% \DescribeBoolean{VERCMD@failed@ltxcmd} True if any command that failed
+% was defined by \cs{NewDocumentCommand} or related.
+% \begin{macrocode}
+\newbool{VERCMD@failed@ltxcmd}
+\boolfalse{VERCMD@failed@ltxcmd}
+% \end{macrocode}
+
% \begin{macro}{\VERCMD@addchanged} \marg{\MDfive sum} \marg{text} \qquad Add to the list of changed definitions.
+% \changes{v1.10}{2024/08/25}{Revised summary message.}
+% \changes{v1.10}{2024/08/28}{Added `\texttt{*}' if \cs{NewDocumentCommand} or related is used.}
% \begin{macrocode}
\newcommand*{\VERCMD@addchanged}[2]{%
+% \end{macrocode}
+% Newline control for pretty print.
+% \begin{macrocode}
\ifdefempty{\VERCMD@whatchanged}%
{}%
{\apptocmd{\VERCMD@whatchanged}{^^J}{}{}}%
- \apptocmd{\VERCMD@whatchanged}{Definition changed: #2^^J}{}{}%
- \apptocmd{\VERCMD@whatchanged}{Definition changed: \space\space\space#1}{}{}%
+% \end{macrocode}
+% ID the message as from \pkg{verifycommand}, add the text,
+% add the checksum.
+% \begin{macrocode}
+ \apptocmd{\VERCMD@whatchanged}{%
+ (verifycommand)\space\space#2^^J%
+ \space\space\space\space\space\space\space\space\space\space%
+ \space\space\space\space\space\space\space\space\space(#1)%
+ }{}{}%
+% \end{macrocode}
+% Optionally add a |*| after the checksum if the command was
+% defined with \cs{NewCommand} or related.
+% \begin{macrocode}
+ \ifbool{VERCMD@this@ltxcmd}{%
+ \apptocmd{\VERCMD@whatchanged}{ *}{}{}%
+ \booltrue{VERCMD@failed@ltxcmd}%
+ }{}%
+ \boolfalse{VERCMD@this@ltxcmd}%
}
% \end{macrocode}
% \end{macro}
% When the compile is finished, print the accumulated list of changed definitions.
+% \changes{v1.10}{2024/08/25}{Revised summary message.}
+% ^^A *date
% \begin{macrocode}
-\AfterEndDocument{
+\AtEndDocument{
\ifdefempty{\VERCMD@whatchanged}{}{%
\typeout{--------------------------------}%
- \typeout{WARNING: Something may fail.}%
- \typeout{\VERCMD@whatchanged}%
- \typeout{--------------------------------}%
+ \typeout{Package verifycommand Warning: Definitions have changed.}%
+ \typeout{Patches for the following macros may need to be updated.}%
+ \typeout{See the previous warnings for line numbers.}%
+ \typeout{}%
+ \typeout{Syntax:\space\space Patching pkg -> Defining pkg: Macro (checksum)}%
+ \typeout{-----}%
+ \typeout{\VERCMD@whatchanged}
+ \typeout{-----}%
+ \typeout{Look for updates to these packages.}
+%
+ \ifbool{VERCMD@failed@ltxcmd}{
+ \typeout{Any of the above marked with a * may be due to changes in LaTeX internals,}
+ \typeout{the most recently known of which was 2023/12/01.}
+ \typeout{If so, look for updates for the LaTeX sytem as well.}
+ }{}
+%
+ \typeout{--------------------------------}
}
}
% \end{macrocode}
@@ -895,29 +1142,33 @@ pageanchor=true,
% \end{macro}
-% \begin{macro}{\VERCMD@Warning} \marg{yourpackage} \marg{theirpackage} \marg{defn name}
+% \begin{macro}{\VERCMDWarning} \marg{yourpackage} \marg{theirpackage} \marg{defn name}
%
% If no package names, print a general warning.
% If package names are given, print a \cs{PackageWarning}.
+% Either way, also add to the summary report.
+% \changes{v1.10}{2024/08/25}{Revised warning message.}
% \begin{macrocode}
-\newcommand*{\VERCMD@Warning}[3]{%
+\newcommand*{\VERCMDWarning}[3]{%
\ifblank{#1}%
{%
\VERCMD@ProgWarning{%
- Something may fail. A definition has changed:\MessageBreak
+ A definition has changed:\MessageBreak
\ifblank{#2}{}{#2: }\string#3\MessageBreak
- \VERCMD@temp\MessageBreak
- }
- \expandafter\VERCMD@addchanged\expandafter{\VERCMD@temp}{\string#3}%
+ (\VERCMD@temp)\MessageBreak
+ }%
+ \expandafter\VERCMD@addchanged%
+ \expandafter{\VERCMD@temp}{\string#3}%
}%
{%
\PackageWarning{#1}{%
- Something may fail. A definition has changed:\MessageBreak%
+ A definition has changed:\MessageBreak%
\ifblank{#2}{}{#2: }%
\string#3\MessageBreak%
- \VERCMD@temp\MessageBreak%
+ (\VERCMD@temp)\MessageBreak%
}%
- \expandafter\VERCMD@addchanged\expandafter{\VERCMD@temp}{\ifblank{#2}{}{#2: }\string#3}%
+ \expandafter\VERCMD@addchanged%
+ \expandafter{\VERCMD@temp}{#1 -> \ifblank{#2}{}{#2: }\string#3}%
}%
}
% \end{macrocode}
@@ -929,19 +1180,78 @@ pageanchor=true,
% \end{macrocode}
%
%
+%
% \subsection{User interface}
%
-% \begin{macro}{\VerifyCommand} \oarg{yourpackage} \oarg{theirpackage}
+%
+% \DescribeBoolean{VERCMD@passed} True if any test passed.
+% \changes{v1.10}{2024/08/28}{Added test groups.}
+% \begin{macrocode}
+\newbool{VERCMD@passed}
+% \end{macrocode}
+%
+% \DescribeBoolean{VERCMD@failed} True if any test failed.
+% \changes{v1.10}{2024/08/28}{Added test groups.}
+% \begin{macrocode}
+\newbool{VERCMD@failed}
+% \end{macrocode}
+%
+% \begin{macro}{\TestVerifyCommands}
+% Starts a new set of \cs{VerifyCommand} tests,
+% after which the booleans will tell if any passed and if any failed.
+% \changes{v1.10}{2024/08/28}{Added test groups.}
+% \begin{macrocode}
+\newcommand*{\TestVerifyCommands}
+{
+ \boolfalse{VERCMD@passed}
+ \boolfalse{VERCMD@failed}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IfVerifyCommandPassed} \marg{true} \marg{false}
+% If any of the \cs{VerifyCommand} tests passed, do the |true| clause.
+% If none of them passed, do the |false| clause.
+% \changes{v1.10}{2024/08/28}{Added test groups.}
+% \begin{macrocode}
+\newcommand*{\IfVerifyCommandPassed}
+ {%
+ \ifbool{VERCMD@passed}%
+ {\let\VERCMD@tempa\@firstoftwo}%
+ {\let\VERCMD@tempa\@secondoftwo}%
+ \VERCMD@tempa%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IfVerifyCommandFailed} \marg{true} \marg{false}
+% If any of the \cs{VerifyCommand} tests failed, do the |true| clause.
+% If none of them failed, do the |false| clause.
+% \changes{v1.10}{2024/08/28}{Added test groups.}
+% \begin{macrocode}
+\newcommand*{\IfVerifyCommandFailed}
+ {%
+ \ifbool{VERCMD@failed}%
+ {\let\VERCMD@tempa\@firstoftwo}%
+ {\let\VERCMD@tempa\@secondoftwo}%
+ \VERCMD@tempa%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IfVerifyCommand} \oarg{yourpackage} \oarg{theirpackage}
% \marg{\cs{commandname}} \marg{\MDfive\ checksum}
+% \marg{true} \marg{false}
+% \changes{v1.10}{2024/06/25}{Added conditional tests.}
%
% Test for various kinds of definitions, and convert them to \MDfive\ checksums.
% \begin{macrocode}
-\NewDocumentCommand{\VerifyCommand}{O{} O{} m m}{%
+\NewDocumentCommand{\IfVerifyCommand}{O{} O{} m m}{%
% \end{macrocode}
%
% Only if the package is enabled:
% \begin{macrocode}
- \ifbool{VERCMD@enable}{%
+ \ifbool{VERCMDenable}{%
% \end{macrocode}
%
% Default to an un-detected definition type:
@@ -949,11 +1259,18 @@ pageanchor=true,
\edef\VERCMD@temp{Unknown~definition}%
% \end{macrocode}
%
-% For \cs{NewDocumentCommand}, the macro name is ``|\name code|'' with a space in the middle.
+% Will become true if found \cs{NewDocumentCommand} or related.
+% \begin{macrocode}
+ \boolfalse{VERCMD@this@ltxcmd}
+% \end{macrocode}
+%
+% For \cs{NewDocumentCommand}, the macro name is ``|\name code|''
+% with a space in the middle.
% \begin{macrocode}
% % NewDocumentCommand:
\ifcsdef{\cs_to_str:N #3~code}%
{%
+ \booltrue{VERCMD@this@ltxcmd}%
\expandafter\VERCMD@mdfive%
\csname \cs_to_str:N #3~code\endcsname%
}%
@@ -972,7 +1289,8 @@ pageanchor=true,
{%
% \end{macrocode}
%
-% For \cs{DeclareRobustCommand}, the macro name is ``|\name |'' with a trailing space.
+% For \cs{DeclareRobustCommand}, the macro name is ``|\name |''
+% with a trailing space.
% \begin{macrocode}
% % DeclareRobustCommand:
\ifcsdef{\cs_to_str:N #3~}%
@@ -983,19 +1301,24 @@ pageanchor=true,
{%
% \end{macrocode}
%
-% For \cs{newcommand} with an option, the macro name is ``|\\name|'', with two backslashes.
+% For \cs{newcommand} with an option, the macro name is ``|\\name|'',
+% with two backslashes.
% \begin{macrocode}
% % newcommand w/ option:
\ifcsdef{\VERCMD@backslash\cs_to_str:N #3}%
{%
\expandafter\VERCMD@mdfive%
- \csname \VERCMD@backslash\cs_to_str:N #3\endcsname%
+ \csname %
+ \VERCMD@backslash%
+ \cs_to_str:N #3%
+ \endcsname%
}%
% \end{macrocode}
%
% For \cs{newcommand}, the macro name is ``|\name|''.
%
-% If none match, the default unknown definition warning is show in place of the checksum.
+% If none match, the default unknown definition warning is shown
+% in place of the checksum.
% \begin{macrocode}
{%
% % newcommand:
@@ -1008,33 +1331,65 @@ pageanchor=true,
}%
% \end{macrocode}
%
-% If the checksum does not match the expected value, issue a warning.
+% If the checksum matches the expected value, do the following
+% |true| clause, else do the following |false| clause.
+% Also track the true and false tests for \cs{IfVerifyCommandPassed}
+% and \cs{IfVerifyCommandFailed}.
+% \changes{v1.10}{2024/08/28}{Added test groups.}
% \begin{macrocode}
\ifdefstring{\VERCMD@temp}{#4}%
- {}%
{%
- \VERCMD@Warning{#1}{#2}{#3}%
+ \booltrue{VERCMD@passed}%
+ \let\VERCMD@tempa\@firstoftwo%
+ }%
+ {%
+ \booltrue{VERCMD@failed}%
+ \let\VERCMD@tempa\@secondoftwo%
}%
}% if package enabled
- {}% if package not enabled
+ {\let\VERCMD@tempa\@firstoftwo}% if package not enabled
+ \VERCMD@tempa%
}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\VerifyEnvironment} \oarg{yourpackage} \oarg{theirpackage}
-% \marg{\cs{commandname}}
-% \marg{begin \MDfive\ checksum}
-% \marg{end \MDfive\ checksum}
+% \begin{macro}{\VerifyCommand} \oarg{yourpackage} \oarg{theirpackage}
+% \marg{\cs{commandname}} \marg{\MDfive\ checksum}
%
-% Test both the begin and end section of the environment.
+% Test for various kinds of definitions, and convert them to \MDfive\ checksums.
% \begin{macrocode}
-\NewDocumentCommand{\VerifyEnvironment}{O{} O{} m m m}{%
+\NewDocumentCommand{\VerifyCommand}{O{} O{} m m}{%
+ \ifblank{#1}{% #1 blank
+ \IfVerifyCommand{#3}{#4}{}{\VERCMDWarning{}{}{#3}}%
+ }% #1 blank
+ {% #1 given
+ \ifblank{#2}{% #2 blank
+ \IfVerifyCommand[#1]{#3}{#4}{}{\VERCMDWarning{#1}{}{#3}}%
+ }% #2 blank
+ {% #2 given
+ \IfVerifyCommand[#1][#2]{#3}{#4}{}{\VERCMDWarning{#1}{#2}{#3}}%
+ }% #2 given
+ }% #1 given
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\IfVerifyEnvironmentBegin}
+% \oarg{yourpackage} \oarg{theirpackage}
+% \marg{\cs{commandname}}
+% \marg{begin \MDfive\ checksum}
+% \changes{v1.10}{2024/06/25}{Added conditional tests.}
+%
+% Test the begin section of the environment.
+% \begin{macrocode}
+\NewDocumentCommand{\IfVerifyEnvironmentBegin}{O{} O{} m m}{%
% \end{macrocode}
%
% Only if the package is enabled:
% \begin{macrocode}
- \ifbool{VERCMD@enable}{%
+ \ifbool{VERCMDenable}{%
% \end{macrocode}
%
% Default to an un-detected definition type:
@@ -1042,11 +1397,17 @@ pageanchor=true,
\edef\VERCMD@temp{Unknown~definition}%
% \end{macrocode}
%
+% Will become true if found \cs{NewDocumentCommand} or related.
+% \begin{macrocode}
+ \boolfalse{VERCMD@this@ltxcmd}
+% \end{macrocode}
+%
% For \cs{NewDocumentEnvironment}, the macro name is ``|\environment name code|'' with internal spaces.
% \begin{macrocode}
% % NewDocumentEnvironment:
\ifcsdef{environment~#3~code}%
{%
+ \booltrue{VERCMD@this@ltxcmd}%
\expandafter\VERCMD@mdfive%
\csname environment~#3~code\endcsname%
}%
@@ -1075,26 +1436,62 @@ pageanchor=true,
}%
% \end{macrocode}
%
-% If the checksum does not match the expected value, issue a warning.
+% Do the first or second next argument depending on a match:
+% \changes{v1.10}{2024/08/28}{Added test groups.}
% \begin{macrocode}
\ifdefstring{\VERCMD@temp}{#4}%
- {}%
{%
- \VERCMD@Warning{#1}{#2}{#3}%
+ \booltrue{VERCMD@passed}%
+ \let\VERCMD@tempa\@firstoftwo%
+ }%
+ {%
+ \booltrue{VERCMD@failed}%
+ \let\VERCMD@tempa\@secondoftwo%
}%
% \end{macrocode}
%
-% Reset the default to an un-detected definition type:
+% \begin{macrocode}
+ }% if package enabled
+ {\let\VERCMD@tempa\@firstoftwo}% if package not enabled
+ \VERCMD@tempa%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\IfVerifyEnvironmentEnd}
+% \oarg{yourpackage} \oarg{theirpackage}
+% \marg{\cs{commandname}}
+% \marg{end \MDfive\ checksum}
+% \changes{v1.10}{2024/06/25}{Added conditional tests.}
+%
+% Test the end section of the environment.
+% \begin{macrocode}
+\NewDocumentCommand{\IfVerifyEnvironmentEnd}{O{} O{} m m}{%
+% \end{macrocode}
+%
+% Only if the package is enabled:
+% \begin{macrocode}
+ \ifbool{VERCMDenable}{%
+% \end{macrocode}
+%
+% Default to an un-detected definition type:
% \begin{macrocode}
\edef\VERCMD@temp{Unknown~definition}%
% \end{macrocode}
%
+% Will become true if found \cs{NewDocumentCommand} or related.
+% \begin{macrocode}
+ \boolfalse{VERCMD@this@ltxcmd}
+% \end{macrocode}
+%
% For \cs{NewDocumentEnvironment}, the ending macro name
% is ``|\environment name end aux |'', with spaces and a trailing space.
% \begin{macrocode}
% % end DocumentEnvironment:
\ifcsdef{environment~#3~end~aux~}%
{%
+ \booltrue{VERCMD@this@ltxcmd}%
\expandafter\VERCMD@mdfive
\csname environment~#3~end~aux~\endcsname%
}%
@@ -1113,24 +1510,134 @@ pageanchor=true,
}%
% \end{macrocode}
%
-% If the checksum does not match the expected value, issue a warning.
+% Do the first or second next argument depending on a match:
+% \changes{v1.10}{2024/08/28}{Added test groups.}
% \begin{macrocode}
- \ifdefstring{\VERCMD@temp}{#5}%
- {}%
+ \ifdefstring{\VERCMD@temp}{#4}%
+ {%
+ \booltrue{VERCMD@passed}%
+ \let\VERCMD@tempa\@firstoftwo%
+ }%
{%
- \VERCMD@Warning{#1}{#2}{(end)#3}%
+ \booltrue{VERCMD@failed}%
+ \let\VERCMD@tempa\@secondoftwo%
}%
}% if package enabled
- {}% if package not enabled
+ {\let\VERCMD@tempa\@firstoftwo}% if package not enabled
+ \VERCMD@tempa%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\VerifyEnvironment} \oarg{yourpackage} \oarg{theirpackage}
+% \marg{\cs{commandname}}
+% \marg{begin \MDfive\ checksum}
+% \marg{end \MDfive\ checksum}
+%
+% Test both the begin and end section of the environment.
+% \begin{macrocode}
+\NewDocumentCommand{\VerifyEnvironment}{O{} O{} m m m}{%
+% begin:
+ \ifblank{#1}{% #1 blank
+ \IfVerifyEnvironmentBegin{#3}{#4}%
+ {}%
+ {\VERCMDWarning{}{}{#3}}%
+ }% #1 blank
+ {% #1 given
+ \ifblank{#2}{% #2 blank
+ \IfVerifyEnvironmentBegin[#1]{#3}{#4}%
+ {}%
+ {\VERCMDWarning{#1}{}{#3}}%
+ }% #2 blank
+ {% #2 given
+ \IfVerifyEnvironmentBegin[#1][#2]{#3}{#4}%
+ {}%
+ {\VERCMDWarning{#1}{#2}{#3}}%
+ }% #2 given
+ }% #1 given
+% end:
+ \ifblank{#1}{% #1 blank
+ \IfVerifyEnvironmentEnd{#3}{#5}%
+ {}%
+ {\VERCMDWarning{}{}{(end)#3}}%
+ }% #1 blank
+ {% #1 given
+ \ifblank{#2}{% #2 blank
+ \IfVerifyEnvironmentEnd[#1]{#3}{#5}%
+ {}%
+ {\VERCMDWarning{#1}{}{(end)#3}}%
+ }% #2 blank
+ {% #2 given
+ \IfVerifyEnvironmentEnd[#1][#2]{#3}{#5}%
+ {}%
+ {\VERCMDWarning{#1}{#2}{(end)#3}}%
+ }% #2 given
+ }% #1 given
}
% \end{macrocode}
% \end{macro}
%
+%
% \begin{macrocode}
\ExplSyntaxOff
% \end{macrocode}
%
%
+% \subsection{Verify infrastructure}
+%
+% \changes{v1.10}{2024/08/28}{Tests low-level \cs{NewDocumentCommand} code.}
+%
+% The low-level infrastructure for \cs{NewDocumentCommand} and related
+% may change on occasion, causing a change in the resulting code and
+% a verification error for such code.
+% The following is done while generating the documentation
+% for the \pkg{verifycommand} package,
+% and verifies the definitions of the underlying
+% infrastructure and issues a warning if any has changed.
+%
+% In the source for the following, \filenm{ltxcmd.dtx} uses |@@| which is
+% replaced by |__cmd|.
+%
+% (Testing silently occurs here, without adding text to the documentation.)
+%
+% \ExplSyntaxOn
+%
+% \TestVerifyCommands
+%
+% ^^A *checksums
+% \VerifyCommand[verifycommand][LaTeX kernel]{\__cmd_declare_cmd_code:Nnn}
+% {0911983C176452DDE1F471783F875529}
+%
+% \VerifyCommand[verifycommand][LaTeX kernel]{\__cmd_declare_cmd_optimized:Nnn}
+% {CC1FE1C2D4782317D9E9EB391AD7FFE4}
+%
+% \VerifyCommand[verifycommand][LaTeX kernel]{\__cmd_declare_cmd_code_aux:Nnn}
+% {6675F7AC09F310F6AB963DAA0860BD37}
+%
+% \VerifyCommand[verifycommand][LaTeX kernel]{\__cmd_declare_cmd_code_expandable:Nnn}
+% {8EDCF2A369B6F9CE43280D9118F01383}
+
+% \VerifyCommand[verifycommand][LaTeX kernel]{\__cmd_declare_env_internal:nnnn}
+% {7F026120EACC68911B492D09A4B0F537}
+%
+% \ExplSyntaxOff
+%
+% \IfVerifyCommandFailed
+% {
+% \AfterEndDocument{
+% \PackageWarningNoLine{verifycommand}{%
+% The internals for LaTeX \string\NewCommand\MessageBreak%
+% and related have changed.\MessageBreak%
+% Update the checksums in verifycommand.dtx\MessageBreak
+% at `*checksums', and research when the\MessageBreak
+% internals changed and update the date\MessageBreak
+% in verifycommand.dtx at `*date'%
+% }%
+% }
+% }
+% {}
+%
%
% \clearpage
%
diff --git a/Master/texmf-dist/source/latex/xcolor/xcolor.dtx b/Master/texmf-dist/source/latex/xcolor/xcolor.dtx
index 5af54596822..5a8dd1ee080 100644
--- a/Master/texmf-dist/source/latex/xcolor/xcolor.dtx
+++ b/Master/texmf-dist/source/latex/xcolor/xcolor.dtx
@@ -2,7 +2,7 @@
%%
%% ----------------------------------------------------------------
%% Copyright (C) 2003-2021 by Dr. Uwe Kern <xcolor at ukern dot de>
-%% 2021-2023 LaTeX Project https://github.com/latex3/xcolor/issues
+%% 2021-2024 LaTeX Project https://github.com/latex3/xcolor/issues
%% ----------------------------------------------------------------
%%
%<*package>
@@ -18,8 +18,8 @@
%%
%</package>
%<*extract|driver|test1|test2|test3|test4>
-\def\XCfileversion{v3.01}%
-\def\XCfiledate{2023/11/15}%
+\def\XCfileversion{v3.02}%
+\def\XCfiledate{2024/09/29}%
%</extract|driver|test1|test2|test3|test4>
%
% This file may be distributed and/or modified under the
@@ -320,7 +320,7 @@
% There are proprietary models (like \Index{Pantone} or \Index{HKS}) that provide finite sets of colors (often called \emph{\Index{spot color}s}), where the user has to choose from without caring about parametrisations; on the other hand, there are parameter-driven models like \Model{gray}, \Model{rgb}, and \Model{cmyk}, that aim to represent large finite or even (theoretically) infinite sets of colors, built on very small subsets of base colors and rules, how to construct other colors from these base colors.
% For example, a large range of colors can be constructed by linear combinations of the base colors \Color{red}, \Color{green}, and \Color{blue}.
% On the other hand, usually \Index{spot color}s can only be \emph{approximated} by parameter values in models like \Model{cmyk} or \Model{rgb}; the original colors are being physically mixed even dependent on the targeted kind of paper.
-% Finally, there are certain colors like \Color{gold} and \Color{silver} that are hardly reproducable by any parameter-driven color model on standard ink or laser printers.
+% Finally, there are certain colors like \Color{gold} and \Color{silver} that are hardly reproducible by any parameter-driven color model on standard ink or laser printers.
%
%
%
@@ -501,7 +501,7 @@
%
% Example: assuming that |a.tex| is a complete \LaTeX{} document, a command like
% `|latex \def\xcolorcmd{\colorlet{black}{red}}\input{a}|'
-% at the console generates a file |a.dvi| with all occurences of \Color{black} being replaced by \Color{red}, without the necessity to change the source file itself.
+% at the console generates a file |a.dvi| with all occurrences of \Color{black} being replaced by \Color{red}, without the necessity to change the source file itself.
% (The exact spelling of the console command might vary across operating systems and \TeX{} distributions.)
%
%
@@ -2486,7 +2486,7 @@
% \subsection{Color conversion and complements}\label{sec.cnv}
%
% We collect here the specific conversion formulas between the supported color models.
-% Table \vref{tab.cnv} gives an overwiew of how each conversion pair is handled.
+% Table \vref{tab.cnv} gives an overview of how each conversion pair is handled.
% In general, \Index{PostScript} (as described in \cite{plrm}) is used as a basis for most of the calculations, since it supports the color models \Model{rgb}, \Model{cmyk}, \Model{hsb}, and \Model{gray} natively.
% Furthermore, \People{Alvy Ray}{Smith}'s paper \cite{smith} is cited in \cite{plrm} as reference for \Model{hsb}-related formulas.
%
@@ -4119,7 +4119,7 @@
{
,usenames .code =
{\PackageWarning{xcolor}{Package option `usenames' is obsolete and ignored}}
- ,usename .usage = preamble
+ ,usenames .usage = preamble
,hyperref .code =
{\PackageWarning{xcolor}{Package option `hyperref' is obsolete and ignored}}
,hyperref .usage = preamble
@@ -4153,9 +4153,14 @@
% \end{macrocode}
%
% After the options are processed, load the appropriate driver file.
-% If a site wants a default driver (e.g., \Option{dvips}) it just needs to put |\ExecuteOptions{dvips}| in a \File{color.cfg} file.
+% If a site wants a default driver (e.g., \Option{dvips}) it just needs
+% to put |\ExecuteOptions{dvips}| in a \File{color.cfg} file.
+%
+% Note |\relax| added here to ensure that |\ProcessKeyOptions| not the following
+% |\edef| shows in error context lines for unknown options.
+% \changes{3.02}{2024-03-13}{Added \cs{relax}}
% \begin{macrocode}
-\ProcessKeyOptions
+\ProcessKeyOptions\relax
% \end{macrocode}
%
% \begin{macro}{\XC@@drv}
@@ -4269,7 +4274,7 @@
%
% \begin{macro}{\xglobal}
% \begin{macro}{\xglobal@test}
-% If |\foo| occurs in the token list |\xglobal@@|, then the command |\xglobal\foo| will set the switch |\xglobal@true| which can be used inside |\foo| to determine whether certain definitions are to be made explicitely global.
+% If |\foo| occurs in the token list |\xglobal@@|, then the command |\xglobal\foo| will set the switch |\xglobal@true| which can be used inside |\foo| to determine whether certain definitions are to be made explicitly global.
% |\foo| is responsible for resetting |\xglobal@false| in order to avoid side effects.
% To include |\foo| in the magic list, simply say |\XC@append\xglobal@list{\foo}|.
% If |\foo| is not in the list, |\xglobal\foo| will behave like |\global\foo|, thus |\xglobal\let| will be like |\global\let| etc.
@@ -4356,7 +4361,7 @@
%
% \begin{macro}{\XC@replace}
% \marg{cmd}\marg{search}\marg{replace}\\
-% Replace all occurences of \meta{search} within the first-level expansion of \meta{cmd} by \meta{replace} and save the result in \meta{cmd}.
+% Replace all occurrences of \meta{search} within the first-level expansion of \meta{cmd} by \meta{replace} and save the result in \meta{cmd}.
% The replacement is recursive, so don't put the search pattern into the replacement text!
% Note that this macro is incapable of seeing `into' braces.
% The code and its explanation is taken from \People{Donald}{Arseneau}'s \Package{url} package \cite{url}, with only minor changes and renamings applied.
@@ -4976,9 +4981,10 @@
% Retrieve model position |\XC@@pos|, model |\@@mod|, and target model |\@@Mod| from multiple definitions (up to~8), separated by `|/|'.
% \begin{macrocode}
\def\XC@getmod#1/#2/#3/#4/#5/#6/#7/#8/#9\XC@@
- {\XC@g@tm@d0#1::\XC@@ \XC@getm@d1{#2}\XC@getm@d2{#3}%
+ {\def\XC@dflt@@mod{#1}%
+ \XC@g@tm@d0#1::\XC@@ \XC@getm@d1{#2}\XC@getm@d2{#3}%
\XC@getm@d3{#4}\XC@getm@d4{#5}\XC@getm@d5{#6}\XC@getm@d6{#7}%
- \XC@getm@d7{#8}\def\XC@@pos{0}\def\@@mod{#1}\@gobble\@nnil}%
+ \XC@getm@d7{#8}\def\XC@@pos{0}\let\@@mod\XC@dflt@@mod\@gobble\@nnil}%
% \end{macrocode}
%
% \begin{macrocode}
@@ -4990,7 +4996,10 @@
% \begin{macrocode}
\def\XC@g@tm@d#1#2:#3:#4\XC@@
{\@ifxempty{#3}{\let\@@Mod\XC@mod@ignore\XC@getm@d0{#2}}%
- {\def\@@Mod{#2}\XC@getm@d0{#3}}}%
+ {\def\@@Mod{#2}%
+ \def\XC@tgt@mod##1{#2}%
+ \def\XC@dflt@@mod{#3}%
+ \XC@getm@d0{#3}}}%
% \end{macrocode}
% \end{macro}
%
@@ -6182,11 +6191,13 @@
%
%
% \subsubsection{Extra groups}
-% Turning on extra groups in the standard \LaTeX\ commands, so that color commands are scoped corectly.
%
-% Like |\normalcolor|, the following five commands are defined in the kernel, with empty definitions (|\relax|).
+% Like |\normalcolor|, the following five commands are defined in the kernel.
% This means that they can be used to make macros in packages `color safe'.
-% The commands will not have any effect unless a user also uses a color package, when the `active definitions' here will take effect and keep color commands correctly scoped.
+% The extra groups have been made permanent in the \LaTeX{} kernel 2021 so
+% they are no longer redefined here.
+% The |\color@setgroup| will not have any effect unless a user also uses
+% a color package, when the `active definition' here will take effect.
%
% \begin{macro}{\color@setgroup}
% This is to be used in contexts (e.g., `lrbox') where text is to be saved and used after some other, unknown, text that may contain color commands.
@@ -6200,38 +6211,23 @@
% This is to be used at the start of contexts that may contain color commands, but where it is not necessary to save the current color.
% Examples of this are in the box commands of \File{ltboxes.dtx} where user-supplied text is saved internally in a box between |\color@begingroup|, |\color@endgroup|, but the box is used before any other color commands could intervene.
% A matching |\color@endgroup| should be used at the end of the text.
-% \begin{macrocode}
-\let\color@begingroup\begingroup
-% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\color@endgroup}
% To be used to close the `group' started by one of the above two 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.
-% \begin{macrocode}
-\def\color@endgroup{\endgraf\endgroup}
-% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\color@hbox}
% To be used to open a `colored hbox'
-% \begin{macrocode}
-\def\color@hbox{\hbox\bgroup\color@begingroup}
-% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\color@vbox}
% To be used to open a `colored hbox'
-% \begin{macrocode}
-\def\color@vbox{\vbox\bgroup\color@begingroup}
-% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\color@endbox}
% To be used to close a `colored (h/v)box'
-% \begin{macrocode}
-\def\color@endbox{\color@endgroup\egroup}
-% \end{macrocode}
% \end{macro}
%
%
@@ -6458,7 +6454,7 @@
%
% \begin{macro}{\XC@cnv@gray}
% \Meta{gray}|,|
-% \changes{3.0}{2022-08-10}{moved the patch from hycolor to correct Gray model, issue \#23}
+% \changes{3.0}{2022-08-10}{moved the patch from hycolor to correct Gray model, issue \#23}w
% \begin{macrocode}
\def\XC@cnv@gray#1,%
{\XC@ifxcase\tm
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..2a35b27d486 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-09-30} {0.4.7}
{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 ,
}
@@ -7195,251 +7253,269 @@
%
% \begin{macro}{\@@_type_name_setup:}
% Auxiliary function to \cs{@@_typeset_refs_last_of_type:}. It is
-% responsible for setting the type name variable \cs{l_@@_type_name_tl} and
-% \cs{l_@@_name_in_link_bool}. If a type name can't be found,
-% \cs{l_@@_type_name_tl} is cleared. The function takes no arguments, but
-% is expected to be called in \cs{@@_typeset_refs_last_of_type:} right
-% before \cs{@@_get_ref_first:}, which is the main consumer of the variables
-% it sets, though not the only one (and hence this cannot be moved into
-% \cs{@@_get_ref_first:} itself). It also expects a number of relevant
-% variables to have been appropriately set, and which it uses, prominently
-% \cs{l_@@_type_first_label_type_tl}, but also the queue itself in
-% \cs{l_@@_typeset_queue_curr_tl}, which should be ``ready except for the
-% first label'', and the type counter \cs{l_@@_type_count_int}.
+% responsible for setting the type name variable \cs{l_@@_type_name_tl},
+% \cs{l_@@_name_in_link_bool}, and \cs{l_@@_type_name_missing_bool}. If a
+% type name can't be found, \cs{l_@@_type_name_tl} is cleared. The function
+% takes no arguments, but is expected to be called in
+% \cs{@@_typeset_refs_last_of_type:} right before \cs{@@_get_ref_first:},
+% which is the main consumer of the variables it sets, though not the only
+% one (and hence this cannot be moved into \cs{@@_get_ref_first:} itself).
+% It also expects a number of relevant variables to have been appropriately
+% set, and which it uses, prominently \cs{l_@@_type_first_label_type_tl},
+% but also the queue itself in \cs{l_@@_typeset_queue_curr_tl}, which should
+% be ``ready except for the first label'', and the type counter
+% \cs{l_@@_type_count_int}.
% \begin{macrocode}
\cs_new_protected:Npn \@@_type_name_setup:
{
- \zref@ifrefundefined { \l_@@_type_first_label_tl }
+ \bool_if:nTF
+ { \l_@@_typeset_ref_bool && ! \l_@@_typeset_name_bool }
{
+ % `typeset=ref' / `noname' option
+ % Probably redundant, since in this case the type name is not being
+ % typeset. But, for completeness sake:
\tl_clear:N \l_@@_type_name_tl
+ \bool_set_false:N \l_@@_name_in_link_bool
\bool_set_true:N \l_@@_type_name_missing_bool
}
{
- \tl_if_eq:NnTF
- \l_@@_type_first_label_type_tl { zc@missingtype }
+ \zref@ifrefundefined { \l_@@_type_first_label_tl }
{
\tl_clear:N \l_@@_type_name_tl
\bool_set_true:N \l_@@_type_name_missing_bool
}
{
- % Determine whether we should use capitalization, abbreviation,
- % and plural.
- \bool_lazy_or:nnTF
- { \l_@@_cap_bool }
- {
- \l_@@_capfirst_bool &&
- \int_compare_p:nNn { \l_@@_type_count_int } = { 0 }
- }
- { \tl_set:Nn \l_@@_name_format_tl {Name} }
- { \tl_set:Nn \l_@@_name_format_tl {name} }
- % If the queue is empty, we have a singular, otherwise, plural.
- \tl_if_empty:NTF \l_@@_typeset_queue_curr_tl
- { \tl_put_right:Nn \l_@@_name_format_tl { -sg } }
- { \tl_put_right:Nn \l_@@_name_format_tl { -pl } }
- \bool_lazy_and:nnTF
- { \l_@@_abbrev_bool }
+ \tl_if_eq:NnTF
+ \l_@@_type_first_label_type_tl { zc@missingtype }
{
- ! \int_compare_p:nNn
- { \l_@@_type_count_int } = { 0 } ||
- ! \l_@@_noabbrev_first_bool
+ \tl_clear:N \l_@@_type_name_tl
+ \bool_set_true:N \l_@@_type_name_missing_bool
}
{
- \tl_set:NV \l_@@_name_format_fallback_tl
- \l_@@_name_format_tl
- \tl_put_right:Nn \l_@@_name_format_tl { -ab }
- }
- { \tl_clear:N \l_@@_name_format_fallback_tl }
-
- % Handle number and gender nudges.
- \bool_if:NT \l_@@_nudge_enabled_bool
- {
- \bool_if:NTF \l_@@_nudge_singular_bool
+ % Determine whether we should use capitalization,
+ % abbreviation, and plural.
+ \bool_lazy_or:nnTF
+ { \l_@@_cap_bool }
{
- \tl_if_empty:NF \l_@@_typeset_queue_curr_tl
- {
- \msg_warning:nne { zref-clever }
- { nudge-plural-when-sg }
- { \l_@@_type_first_label_type_tl }
- }
+ \l_@@_capfirst_bool &&
+ \int_compare_p:nNn { \l_@@_type_count_int } = { 0 }
}
+ { \tl_set:Nn \l_@@_name_format_tl {Name} }
+ { \tl_set:Nn \l_@@_name_format_tl {name} }
+ % If the queue is empty, we have a singular, otherwise,
+ % plural.
+ \tl_if_empty:NTF \l_@@_typeset_queue_curr_tl
+ { \tl_put_right:Nn \l_@@_name_format_tl { -sg } }
+ { \tl_put_right:Nn \l_@@_name_format_tl { -pl } }
+ \bool_lazy_and:nnTF
+ { \l_@@_abbrev_bool }
{
- \bool_lazy_all:nT
- {
- { \l_@@_nudge_comptosing_bool }
- { \tl_if_empty_p:N \l_@@_typeset_queue_curr_tl }
- {
- \int_compare_p:nNn
- { \l_@@_label_count_int } > { 0 }
- }
- }
- {
- \msg_warning:nne { zref-clever }
- { nudge-comptosing }
- { \l_@@_type_first_label_type_tl }
- }
+ ! \int_compare_p:nNn
+ { \l_@@_type_count_int } = { 0 } ||
+ ! \l_@@_noabbrev_first_bool
}
- \bool_lazy_and:nnT
- { \l_@@_nudge_gender_bool }
- { ! \tl_if_empty_p:N \l_@@_ref_gender_tl }
{
- \@@_get_rf_opt_seq:neeN { gender }
- { \l_@@_type_first_label_type_tl }
- { \l_@@_ref_language_tl }
- \l_@@_type_name_gender_seq
- \seq_if_in:NVF
- \l_@@_type_name_gender_seq
- \l_@@_ref_gender_tl
+ \tl_set:NV \l_@@_name_format_fallback_tl
+ \l_@@_name_format_tl
+ \tl_put_right:Nn \l_@@_name_format_tl { -ab }
+ }
+ { \tl_clear:N \l_@@_name_format_fallback_tl }
+
+ % Handle number and gender nudges.
+ % Note that these nudges get disabled for `typeset=ref' /
+ % `noname' option, but in this case they are not really
+ % meaningful anyway.
+ \bool_if:NT \l_@@_nudge_enabled_bool
+ {
+ \bool_if:NTF \l_@@_nudge_singular_bool
{
- \seq_if_empty:NTF \l_@@_type_name_gender_seq
+ \tl_if_empty:NF \l_@@_typeset_queue_curr_tl
{
- \msg_warning:nneee { zref-clever }
- { nudge-gender-not-declared-for-type }
- { \l_@@_ref_gender_tl }
+ \msg_warning:nne { zref-clever }
+ { nudge-plural-when-sg }
{ \l_@@_type_first_label_type_tl }
- { \l_@@_ref_language_tl }
+ }
+ }
+ {
+ \bool_lazy_all:nT
+ {
+ { \l_@@_nudge_comptosing_bool }
+ { \tl_if_empty_p:N \l_@@_typeset_queue_curr_tl }
+ {
+ \int_compare_p:nNn
+ { \l_@@_label_count_int } > { 0 }
+ }
}
{
- \msg_warning:nneeee { zref-clever }
- { nudge-gender-mismatch }
+ \msg_warning:nne { zref-clever }
+ { nudge-comptosing }
{ \l_@@_type_first_label_type_tl }
- { \l_@@_ref_gender_tl }
+ }
+ }
+ \bool_lazy_and:nnT
+ { \l_@@_nudge_gender_bool }
+ { ! \tl_if_empty_p:N \l_@@_ref_gender_tl }
+ {
+ \@@_get_rf_opt_seq:neeN { gender }
+ { \l_@@_type_first_label_type_tl }
+ { \l_@@_ref_language_tl }
+ \l_@@_type_name_gender_seq
+ \seq_if_in:NVF
+ \l_@@_type_name_gender_seq
+ \l_@@_ref_gender_tl
+ {
+ \seq_if_empty:NTF \l_@@_type_name_gender_seq
{
- \seq_use:Nn
- \l_@@_type_name_gender_seq { ,~ }
+ \msg_warning:nneee { zref-clever }
+ { nudge-gender-not-declared-for-type }
+ { \l_@@_ref_gender_tl }
+ { \l_@@_type_first_label_type_tl }
+ { \l_@@_ref_language_tl }
+ }
+ {
+ \msg_warning:nneeee { zref-clever }
+ { nudge-gender-mismatch }
+ { \l_@@_type_first_label_type_tl }
+ { \l_@@_ref_gender_tl }
+ {
+ \seq_use:Nn
+ \l_@@_type_name_gender_seq { ,~ }
+ }
+ { \l_@@_ref_language_tl }
}
- { \l_@@_ref_language_tl }
}
}
}
- }
- \tl_if_empty:NTF \l_@@_name_format_fallback_tl
- {
- \@@_opt_tl_get:cNF
- {
- \@@_opt_varname_type:een
- { \l_@@_type_first_label_type_tl }
- { \l_@@_name_format_tl }
- { tl }
- }
- \l_@@_type_name_tl
+ \tl_if_empty:NTF \l_@@_name_format_fallback_tl
{
- \tl_if_empty:NF \l_@@_ref_decl_case_tl
- {
- \tl_put_left:Nn \l_@@_name_format_tl { - }
- \tl_put_left:NV \l_@@_name_format_tl
- \l_@@_ref_decl_case_tl
- }
\@@_opt_tl_get:cNF
{
- \@@_opt_varname_lang_type:eeen
- { \l_@@_ref_language_tl }
+ \@@_opt_varname_type:een
{ \l_@@_type_first_label_type_tl }
{ \l_@@_name_format_tl }
{ tl }
}
\l_@@_type_name_tl
{
- \tl_clear:N \l_@@_type_name_tl
- \bool_set_true:N \l_@@_type_name_missing_bool
- \msg_warning:nnee { zref-clever } { missing-name }
- { \l_@@_name_format_tl }
- { \l_@@_type_first_label_type_tl }
+ \tl_if_empty:NF \l_@@_ref_decl_case_tl
+ {
+ \tl_put_left:Nn \l_@@_name_format_tl { - }
+ \tl_put_left:NV \l_@@_name_format_tl
+ \l_@@_ref_decl_case_tl
+ }
+ \@@_opt_tl_get:cNF
+ {
+ \@@_opt_varname_lang_type:eeen
+ { \l_@@_ref_language_tl }
+ { \l_@@_type_first_label_type_tl }
+ { \l_@@_name_format_tl }
+ { tl }
+ }
+ \l_@@_type_name_tl
+ {
+ \tl_clear:N \l_@@_type_name_tl
+ \bool_set_true:N \l_@@_type_name_missing_bool
+ \msg_warning:nnee { zref-clever } { missing-name }
+ { \l_@@_name_format_tl }
+ { \l_@@_type_first_label_type_tl }
+ }
}
}
- }
- {
- \@@_opt_tl_get:cNF
- {
- \@@_opt_varname_type:een
- { \l_@@_type_first_label_type_tl }
- { \l_@@_name_format_tl }
- { tl }
- }
- \l_@@_type_name_tl
{
\@@_opt_tl_get:cNF
{
\@@_opt_varname_type:een
{ \l_@@_type_first_label_type_tl }
- { \l_@@_name_format_fallback_tl }
+ { \l_@@_name_format_tl }
{ tl }
}
\l_@@_type_name_tl
{
- \tl_if_empty:NF \l_@@_ref_decl_case_tl
- {
- \tl_put_left:Nn
- \l_@@_name_format_tl { - }
- \tl_put_left:NV \l_@@_name_format_tl
- \l_@@_ref_decl_case_tl
- \tl_put_left:Nn
- \l_@@_name_format_fallback_tl { - }
- \tl_put_left:NV
- \l_@@_name_format_fallback_tl
- \l_@@_ref_decl_case_tl
- }
\@@_opt_tl_get:cNF
{
- \@@_opt_varname_lang_type:eeen
- { \l_@@_ref_language_tl }
+ \@@_opt_varname_type:een
{ \l_@@_type_first_label_type_tl }
- { \l_@@_name_format_tl }
+ { \l_@@_name_format_fallback_tl }
{ tl }
}
\l_@@_type_name_tl
{
+ \tl_if_empty:NF \l_@@_ref_decl_case_tl
+ {
+ \tl_put_left:Nn
+ \l_@@_name_format_tl { - }
+ \tl_put_left:NV \l_@@_name_format_tl
+ \l_@@_ref_decl_case_tl
+ \tl_put_left:Nn
+ \l_@@_name_format_fallback_tl { - }
+ \tl_put_left:NV
+ \l_@@_name_format_fallback_tl
+ \l_@@_ref_decl_case_tl
+ }
\@@_opt_tl_get:cNF
{
\@@_opt_varname_lang_type:eeen
{ \l_@@_ref_language_tl }
{ \l_@@_type_first_label_type_tl }
- { \l_@@_name_format_fallback_tl }
+ { \l_@@_name_format_tl }
{ tl }
}
\l_@@_type_name_tl
{
- \tl_clear:N \l_@@_type_name_tl
- \bool_set_true:N
- \l_@@_type_name_missing_bool
- \msg_warning:nnee { zref-clever }
- { missing-name }
- { \l_@@_name_format_tl }
- { \l_@@_type_first_label_type_tl }
+ \@@_opt_tl_get:cNF
+ {
+ \@@_opt_varname_lang_type:eeen
+ { \l_@@_ref_language_tl }
+ { \l_@@_type_first_label_type_tl }
+ { \l_@@_name_format_fallback_tl }
+ { tl }
+ }
+ \l_@@_type_name_tl
+ {
+ \tl_clear:N \l_@@_type_name_tl
+ \bool_set_true:N
+ \l_@@_type_name_missing_bool
+ \msg_warning:nnee { zref-clever }
+ { missing-name }
+ { \l_@@_name_format_tl }
+ { \l_@@_type_first_label_type_tl }
+ }
}
}
}
}
}
}
- }
- % Signal whether the type name is to be included in the hyperlink or not.
- \bool_lazy_any:nTF
- {
- { ! \l_@@_hyperlink_bool }
- { \l_@@_link_star_bool }
- { \tl_if_empty_p:N \l_@@_type_name_tl }
- { \str_if_eq_p:Vn \l_@@_nameinlink_str { false } }
- }
- { \bool_set_false:N \l_@@_name_in_link_bool }
- {
+ % Signal whether the type name is to be included in the hyperlink or
+ % not.
\bool_lazy_any:nTF
{
- { \str_if_eq_p:Vn \l_@@_nameinlink_str { true } }
- {
- \str_if_eq_p:Vn \l_@@_nameinlink_str { tsingle } &&
- \tl_if_empty_p:N \l_@@_typeset_queue_curr_tl
- }
- {
- \str_if_eq_p:Vn \l_@@_nameinlink_str { single } &&
- \tl_if_empty_p:N \l_@@_typeset_queue_curr_tl &&
- \l_@@_typeset_last_bool &&
- \int_compare_p:nNn { \l_@@_type_count_int } = { 0 }
- }
+ { ! \l_@@_hyperlink_bool }
+ { \l_@@_link_star_bool }
+ { \tl_if_empty_p:N \l_@@_type_name_tl }
+ { \str_if_eq_p:Vn \l_@@_nameinlink_str { false } }
}
- { \bool_set_true:N \l_@@_name_in_link_bool }
{ \bool_set_false:N \l_@@_name_in_link_bool }
+ {
+ \bool_lazy_any:nTF
+ {
+ { \str_if_eq_p:Vn \l_@@_nameinlink_str { true } }
+ {
+ \str_if_eq_p:Vn \l_@@_nameinlink_str { tsingle } &&
+ \tl_if_empty_p:N \l_@@_typeset_queue_curr_tl
+ }
+ {
+ \str_if_eq_p:Vn \l_@@_nameinlink_str { single } &&
+ \tl_if_empty_p:N \l_@@_typeset_queue_curr_tl &&
+ \l_@@_typeset_last_bool &&
+ \int_compare_p:nNn { \l_@@_type_count_int } = { 0 }
+ }
+ }
+ { \bool_set_true:N \l_@@_name_in_link_bool }
+ { \bool_set_false:N \l_@@_name_in_link_bool }
+ }
}
}
% \end{macrocode}
@@ -7754,11 +7830,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 +7907,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 +7944,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 +7986,8 @@
} ,
}
}
+ \AddToHook { env / subappendices / end }
+ { \setcounter { zc@subappendix } { 0 } }
\msg_info:nnn { zref-clever } { compat-package } { appendix }
}
}
@@ -7977,10 +8114,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 +8181,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/latex/zugferd/zugferd.dtx b/Master/texmf-dist/source/latex/zugferd/zugferd.dtx
new file mode 100644
index 00000000000..1bfdb78ac69
--- /dev/null
+++ b/Master/texmf-dist/source/latex/zugferd/zugferd.dtx
@@ -0,0 +1,2285 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2021–2024 Marei Peischl <marei@peitex.de>
+% ---------------------------------------------------------
+%
+% 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 2008-05-04 or later.
+%
+% \fi
+% \iffalse
+%<*driver>
+\ProvidesFile{zugferd.dtx}[2024-09-11 v0.8 ZUGFerd Invoice and Faktur-X]
+%</driver>
+%<package>\NeedsTeXFormat{LaTeX2e}[2023-11-01]
+%<package>\ProvidesExplPackage{zugferd}{2024-09-11}{0.8}{Create ZUGFerd invoices using LaTeX}
+%<*driver>
+\DocumentMetadata{pdfstandard=a-3b,lang=en}
+\documentclass[lm-default=false,cs-break-nohyphen]{l3doc}
+\usepackage{zugferd}[2024-09-11]
+\EnableCrossrefs
+%\CodelineIndex
+\RecordChanges
+\usepackage{biblatex}
+
+\usepackage{shellesc}
+\ifnum\ShellEscapeStatus=1\relax\else
+ \PassOptionsToPackage{draft}{minted}
+\fi
+\usepackage{minted}
+\newcounter{codelist}
+\newenvironment{examplecode}{%
+ \VerbatimEnvironment%
+ \fvset{gobble=0}%
+ \begin{VerbatimOut}[tabsize=3,gobble=1]{minted.doc.out}%
+}{%
+ \end{VerbatimOut}%
+ \inputminted[autogobble, escapeinside=||]{latex}{minted.doc.out}%
+}
+\usepackage{accsupp}
+\setminted{breaksymbol={\BeginAccSupp{method=escape,ActualText={}}\tiny\ensuremath{\hookrightarrow}\EndAccSupp{}},breaklines}
+
+\ExplSyntaxOn
+\makeatletter
+\tl_new:N \l__ptxtools_doc_values_tl
+\newcommand*{\codefamily}{\MacroFont}
+\DeclareTextFontCommand{\codefont}{\codefamily}
+\providecommand{\option}[1]{\codefont{#1}}
+
+\cs_new:Npn \__ptxctools_parse_key_option:w #1 #2 #3 #4 = #5 \q_stop {
+ \begingroup
+ \let\PrintDescribeOption\PrintDescribeKeyOption
+ \tl_set:Nn \l__ptxtools_doc_values_tl {\small\IfBooleanTF{#3}{\textsf{#5}}{\textsf{(\codefont{#5})}}}
+ \noindent\DescribeOption{#4}\hfill
+ \small
+ \tl_if_blank:nTF {#2} {\meta{\textrm{initially~unset}}} {
+ \IfBooleanTF{#1}
+ {#2}
+ {(default:~\codefont{#2})}
+ }\strut\par
+ \endgroup
+}
+
+\newcommand*{\PrintDescribeKeyOption}[1]{
+ {\MacroFont #1=}\rlap{\hskip\marginparsep\l__ptxtools_doc_values_tl}
+}
+
+\bool_new:N \l_ptxtools_last_was_describe_bool
+
+\NewDocumentCommand{\DescribeKeyOption}{smms}{
+ \bool_if:NTF \l_ptxtools_last_was_describe_bool {
+ \vskip -\lastskip
+ }{
+ \par
+ \dim_compare:nNnF {\parskip} > {\c_zero_dim} {\medskip}
+ }
+ \__ptxctools_parse_key_option:w #1 {#3} #4 #2 \q_stop
+
+ \bool_set_true:N \l_ptxtools_last_was_describe_bool
+ \AddToHookNext{para/begin}{
+ \bool_set_false:N \l_ptxtools_last_was_describe_bool
+ \OmitIndent
+ }
+ \smallskip
+}
+
+\newenvironment{valuelist}{
+ \list{}{
+ \labelwidth0pt
+ \itemindent0pt
+ \leftmargin0pt
+ \let\makelabel\valuelistlabel
+ }
+}{
+ \endlist
+}
+\newcommand*\valuelistlabel[1]{
+ \llap{
+ \normalfont\codefamily\color_select:n {black!60}
+ \begin{tabular}[t]{@{}r@{}}
+ \clist_use:nn {#1} {\\}
+ \end{tabular}
+ }
+}
+
+\newcommand*{\accessTaxExemptionReason}[1]{
+ \keys_set:nn {zugferd / tax } {category=#1}
+ Exemption~reason:~\tl_if_empty:NTF \l__zugferd_tax_exemption_reason_tl {\meta{empty}} {\l__zugferd_tax_exemption_reason_tl};~
+ Exemption~reason~code:~\tl_if_empty:NTF \l__zugferd_tax_exemption_code_tl {\meta{empty}} {\l__zugferd_tax_exemption_code_tl}
+}
+% to support small layout adjustments for the texdoc version
+\newcommand*{\IfOnlyDocumentation}[1]{
+ \bool_if_exist:NT \g__codedoc_typeset_implementation_bool {
+ \bool_if:NF \g__codedoc_typeset_implementation_bool {#1}
+ }
+}
+%add a subtitle
+\def\@maketitle{%
+ \newpage
+ \null
+ \vskip 2em%
+ \begin{center}%
+ \let \footnote \thanks
+ {\LARGE \@title \par}%
+ \vskip 1.5em%
+ {\large \@subtitle \par}%
+ \vskip 1em%
+ {\large
+ \lineskip .5em%
+ \begin{tabular}[t]{c}%
+ \@author
+ \end{tabular}\par}%
+ \vskip 1em%
+ {\large \@date}%
+ \end{center}%
+ \par
+ \vskip 1.5em}
+\newcommand{\subtitle}[1]{\def\@subtitle{#1}}
+\subtitle{}
+\makeatother
+\ExplSyntaxOff
+
+\usepackage{underscore-ltx}
+
+\begin{filecontents}{zugferd.bib}
+@online{x-rechnung,
+ url={https://xeinkauf.de/dokumente/},
+ urldate={2024-08-20}
+}
+@online{spec-xrechnung,
+ url={https://xeinkauf.de/app/uploads/2024/07/302-XRechnung-2024-06-20.pdf},
+ author={{Koodinierungsstelle für IT-Standards}},
+ title={Spezifikation Standard XRechnung},
+ subtitle={CIUS und Extension},
+ edition={Version XRechnung 3.0.2},
+ date={2024-06-20},
+ urldate={2024-08-20},
+ langid={german}
+}
+@online{mustang-project,
+ title={Mustangproject},
+ url={https://github.com/ZUGFeRD/mustangproject},
+ urldate={2024-08-20}
+}
+@online{country-codes,
+ title={ECE/TRADE/201},
+ subtitle={ISO COUNTRY CODE for Representation of Names of Countries},
+ url={https://unece.org/trade/documents/iso-country-code-representation-names-countries},
+ urldate={2024-08-20},
+}
+@online{unit-codes,
+ title={Rec 20 – Codes for Units of Measure Used in International Trade},
+ url={https://unece.org/sites/default/files/2023-10/rec20_Rev17e-2021.xlsx},
+ urldate={2024-08-20},
+ note={Link directly to xlsx. \cite[see][for all revisions]{cl-recommendations}.}
+}
+@online{cl-recommendations,
+ author={United Nations Economic Commission for Europe (UNECE)},
+ title={Code List Recommendations},
+ url={https://unece.org/trade/uncefact/cl-recommendations},
+ urldate={2024-08-20}
+}
+@online{VAT-exemption-codes,
+ title={VAT exemption reason code list},
+ url={https://www.xrepository.de/details/urn:xoev-de:kosit:codeliste:vatex_1},
+ urldate={2024-08-20}
+}
+@online{zugferd-download,
+ title={ZUGFeRD 2.2},
+ subtitle={Download page},
+ url={https://ferd-net.de/standards/zugferd-2.2/zugferd-2.2.html},
+ urldate={2024-09-02},
+}
+@manual{scrletter,
+ title = {The scrletter package},
+ subtitle = {Letter extension to KOMA-Script classes},
+ author = {Kohm, Markus},
+ url = {https://komascript.de/},
+ urldate = {2024-09-03},
+ documentation = {ctan://macros/latex/contrib/koma-script/doc/scrguide-en.pdf},
+ date = {2023-07-07},
+ version = {3.41},
+}
+@online{leitweg-id,
+ title={Xeinkauf FAQ},
+ subtitle={Leitweg ID},
+ author={{Koordinierungsstelle für IT Standards (KoSIT)}},
+ url={https://xeinkauf.de/faq/xrechnung#leitweg-id},
+ urldate={2024-09-04}
+}
+\end{filecontents}
+\addbibresource{zugferd.bib}
+\nocite{cl-recommendations}
+
+\usepackage{xspace}
+\newcommand*{\XML}{XML\xspace}
+\newcommand*{\XMLfile}{\XML file}
+
+\begin{document}
+\EnableDocumentation\DisableImplementation
+\DocInput{zugferd.dtx}
+%\DisableDocumentation\EnableImplementation
+%\DocInputAgain
+\PrintChanges
+\printbibliography
+\PrintIndex
+\end{document}
+%</driver>
+% \fi
+%
+% \changes{v0.8}{2024-09-11}{First CTAN version}
+%
+% \GetFileInfo{zugferd.dtx}
+%
+% \DoNotIndex{\newcommand,\newenvironment}
+% \begin{documentation}
+% \title{The \textsf{zugferd} package\thanks{This document
+% corresponds to \textsf{zugferd}~\fileversion, dated \filedate.}}
+% \subtitle{Creating electronic and hybrid invoices using \LaTeX}
+% \author{Marei Peischl \\ \texttt{marei@peitex.de}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Invoicing is getting more and more automated.
+% Starting with public sector, within Germany there already is a requirement to stick to the Faktur-X Standard.
+% First Invoices based on this implementation here have been created back in 2021.
+% And this is now the trial to create a more universal and public package to support the current Version of ZUGFeRD and therefore also X-Rechung and Faktur-X.
+%
+% \indent The fundamental idea of this package was to use the calculation within \LaTeX{} as well. So it also creates the \XMLfile for the attachment on the fly.
+% To match typical setups there is a wrapper package which usually would also hold the personal Invoicing layout configuration.
+% \end{abstract}
+%
+% \IfOnlyDocumentation{\vfill}
+% \section*{Sponsors \& Supporters}
+% Most of this package has been created within my free time and for my personal use. At start, it was not a paid project at all.
+% Since it is addressing business users it would be great if we could keep this actively maintained.
+% If you are able to support this either financially for the maintenance effort, a custom extension, I'd love to hear from you.
+%
+% Tthis project was financially supported by:
+% \begin{itemize}
+% \item Pengutronix e.K., \url{https://pengutronix.de}\newline
+% Special thanks to them, as they also sponsored the minimal portable \TeX{} Live setup.
+% \end{itemize}
+%
+% \IfOnlyDocumentation{\clearpage}
+%
+% \tableofcontents
+%
+% \IfOnlyDocumentation{\clearpage}
+%
+% \section{Quick start}
+% This package is still in development and does not provide any validation.
+% To ensure your invoice is created correctly you should also validate the output files.
+% There are tools like the \citeauthor{mustang-project} \cite{mustang-project} providing an easy-to-use interface for the validation.
+% In the appendix I will add some notes on my setup and how I use it within pipelines.
+%
+% The Bundle provides an example file called \file{DEMO-rechnung-zugferd.tex}.
+% This includes a basic setup for a valid X-Rechnung currently matching Version 3.0.1 of the standard.
+% Details on the requirements can be found in the documentation at \cite{x-rechnung}.
+%
+% \subsection{Disclaimer concerning the \pkg{zugferd-invoice} Package}
+% The included package \pkg{zugferd-invoice} is an example project which might match your own invoicing structure.
+% It holds all the layout information which is static across all the invoices.
+% This package is an example implementation and should not be used in production.
+% It is published as a part of the documentation.
+%
+% The idea is to create your own version of this package to use your own layout and internally load the \pkg {zugferd} package that way.
+% Of course, it's possible to use a copy of this package within your personal setup.
+% But the syntax used in the DEMO file may change, so you have to ensure yourself to be compatible with updates.
+%
+% The interfaces for \pkg{zugferd} will hopefully stay the same.
+% At least changes will be announced and build compatible during a deprecation period.
+%
+% \end{documentation}
+% \iffalse
+% \begin{macrocode}
+%<*package>
+%<@@=zugferd>
+% \end{macrocode}
+% Workaround to replace module name without having a visible <@@=zugferd> in the documentation
+% \fi
+%</package>
+% \ExplSyntaxOn
+% \tl_gset:Nn \g__codedoc_module_name_tl {zugferd}
+% \ExplSyntaxOff
+% \iffalse
+%<*!package>
+% \fi
+% \begin{documentation}
+\ExplSyntaxOn
+\tl_gset:Nn \g__codedoc_module_name_tl {zugferd}
+\ExplSyntaxOff
+% \end{documentation}
+% \iffalse
+%</!package>
+%<*package>
+% \fi
+% \begin{implementation}
+% \section{Implementation}
+% \begin{variable}{\l_@@_tmp_tl,\g_@@_format_str,\g_@@_businessProcessId_str,\g_@@_writeTradeContact_bool,\g_@@_writePaymentMeans_bool,\g_@@_conformance_level_str}
+% \begin{macrocode}
+\tl_new:N \l_@@_tmp_tl
+\str_new:N \g_@@_format_str
+\str_new:N \g_@@_businessProcessId_str
+\bool_new:N \g_@@_writeTradeContact_bool
+\bool_new:N \g_@@_writePaymentMeans_bool
+\str_new:N \g_@@_conformance_level_str
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+% \begin{documentation}
+% \section{Package Options}\label{sec:package-options}
+% The package supports a few fundamental settings.
+% These have to be set when the package is loaded as they are used internally to setup the scheme or activate the \XML mechanism.
+%
+% \DescribeKeyOption{format=xrechnung/xrechnung3.0/xrechnung2.3/basic}{xrechunng}
+% \option{format} selects the scheme to be used for the zugferd invoice.
+% Currently xrechnung3.0, xrechnung2.3 and the basic scheme are supported.
+%
+% The value \option{xrechnung} is set as an alias to |xrechnung3.0| and will always use the latest version supported by \pkg{zugferd}.
+%
+% \DescribeKeyOption{zugferd=\meta{boolean}}{true}*
+% This option can be used to deactivate the \XML embedding.
+% It would also disable the the \option{write-xml} option.
+% This can be used to create a package which can use the same structure to also create invoices without \XML attachment.
+% It can also be used with older \LaTeX{} releases than this package requires.
+% There will be a warning, but the visible part should be okay.
+%
+% \DescribeKeyOption{write-xml=\meta{boolean}}{true}*
+% Disable the \XML output.
+% This can be used if you want to create the \XML attachment with different software than this package.
+%
+% In that case you can either rename your file to \meta{\cs[no-index]{jobname}\_zugferd.xml} or also adjust the \option{xml-file} option.
+%
+% \DescribeKeyOption{xml-file=\meta{filename}}{\cs[no-index]{jobname}_zugferd.xml}*
+% Adjust the file name of the created or loaded \XMLfile.
+%
+% The option \option{xrechnung} is only used internally to set the global parameters for all |xrechnung| variants.
+%
+% \DescribeKeyOption{auto-exemption=\meta{boolean}}{true}
+% \pkg{zugferd} tries to automatically add an exemption-reason for the most common VAT categories.
+% In case a more specific reason is required this setting can be disabled and everything should be configured manually.
+% See \autoref{sec:tax-category} for more explanation of this feature and the categories this applies to.
+%
+% \end{documentation}
+% \begin{implementation}
+% \begin{optionenv}{format,xrechnung,write-xml,zugferd,xml-file,auto-exemption}
+% \changes{v0.7}{2024-09-10}{Added auto-exemption option}
+% \begin{macrocode}
+\char_set_catcode_other:N \#%
+\keys_define:nn {zugferd} {
+ xrechnung .code:n = {
+ \bool_gset_true:N \g_@@_writeTradeContact_bool
+ \bool_gset_true:N \g_@@_writePaymentMeans_bool
+ \str_gset:Nn \g_@@_conformance_level_str {XRECHNUNG}
+ },
+ format .choice:,
+ format / xrechnung3.0 .code:n = {
+ \str_gset:Nx \g_@@_format_str {
+ urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0
+ }
+ \str_gset:Nx \g_@@_businessProcessId_str {
+ urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
+ }
+ \keys_set:nn {zugferd}{xrechnung}
+ },
+ format / xrechnung2.3 .code:n = {
+ \str_gset:Nx \g_@@_format_str {
+ urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.3
+ }
+ \keys_set:nn {zugferd}{xrechnung}
+ },
+ format / basic .code:n = {
+ \str_gset:Nx \g_@@_format_str {
+ urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic
+ }
+ \bool_gset_false:N \g_@@_writeTradeContact_bool
+ \bool_gset_false:N \g_@@_writePaymentMeans_bool
+ \str_gset:Nn \g_@@_conformance_level_str {BASIC}
+ },
+ format / xrechnung .meta:n = { format = xrechnung3.0 },
+ format .initial:n = xrechnung,
+ format .usage:n = load,
+ write-xml .bool_gset:N = \g_@@_write_xml_bool,
+ write-xml .initial:n = true,
+ write-xml .usage:n = load,
+ zugferd .bool_gset:N = \g_@@_active_bool,
+ zugferd .initial:n = true,
+ zugferd .default:n = true,
+ zugferd .usage:n = load,
+ ZUGFerD .meta:n = {zugferd = #1},
+ xml-file .tl_gset:N = \g_@@_xml_file_tl,
+ xml-file .initial:n = \jobname _zugferd.xml,
+ xml-file .usage:n = load,
+ auto-exemption .bool_gset:N = \g_@@_auto_exemption_bool,
+ auto-exemption .initial:n = true,
+ auto-exemption .default:n = true,
+ auto-exemption .usage:n =load,
+}
+\char_set_catcode_parameter:N \#%
+
+\ProcessKeyOptions[zugferd]
+% \end{macrocode}
+% \end{optionenv}
+% \subsection{Preparation to write the \file{.xml} file}
+% \begin{variable}{\_@@_xml_writer_iow}
+% \begin{macrocode}
+\iow_new:N \_@@_xml_writer_iow
+% \end{macrocode}
+% \end{variable}
+% To adjust the metadata it is necessary to use the \pkg{pdfmanagement-testphase} by \citeauthor{pdfmanagement-testphase}.
+% She had prepared some experiment files for the PDF attachment in the experiments of the repository.
+% We use these to embed the \XML file.
+%
+% This part prepares the XMP metadata according to the required scheme.
+% \begin{macrocode}
+\bool_if:NT \g_@@_active_bool {
+ \cs_if_exist:NF \pdfmeta_xmp_xmlns_new:nn {
+ \msg_new:nnnn {zugferd} {PDFmanagement-not-active} {
+ The~\LaTeX~PDF~management~is~not~active.\\
+ Activate~it~using~\string\DocumentMetadata.
+ } {
+ See~ZUGFeRD~or~PDFmanagement~documentation~for~more~information.
+ }
+ \msg_error:nn{zugferd} {PDFmanagement-not-active}
+ }
+ %% based on experiments for l3pdfmeta by Ulrike Fischer
+ \pdfmeta_xmp_xmlns_new:nn {fx}{
+ urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0\c_hash_str
+ }
+
+ \cs_generate_variant:Nn \__pdfmeta_xmp_schema_new:nnn {nne}
+
+ \__pdfmeta_xmp_schema_new:nne
+ {Factur-X~PDFA~Extension~Schema}
+ {fx}
+ {urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0\c_hash_str}
+
+ \__pdfmeta_xmp_property_new:nnnnn
+ {fx}
+ {DocumentFileName}
+ {Text}
+ {external}
+ {name~of~the~embedded~XML~invoice~file}
+
+ \__pdfmeta_xmp_property_new:nnnnn
+ {fx}
+ {DocumentType}
+ {Text}
+ {external}
+ {INVOICE}
+
+ \__pdfmeta_xmp_property_new:nnnnn
+ {fx}
+ {Version}
+ {Text}
+ {external}
+ {The~actual~version~of~the~factur-x~schema}
+
+ \__pdfmeta_xmp_property_new:nnnnn
+ {fx}
+ {ConformanceLevel}
+ {Text}
+ {external}
+ {The~conformance~level~of~the~factur-x~data}
+
+ \exp_args:Ne \pdfmeta_xmp_add:n {
+ % fix INVOICE
+ <fx:DocumentType>INVOICE</fx:DocumentType>\iow_newline:
+ % fix factur-x.xml
+ <fx:DocumentFileName>factur-x.xml</fx:DocumentFileName>\iow_newline:
+ % fix schema version
+ <fx:Version>1.0</fx:Version>\iow_newline:
+ % zulässige Werte MINIMUM, BASIC WL, BASIC, EN 16931, EXTENDED, XRECHNUNG
+ <fx:ConformanceLevel>\g_@@_conformance_level_str</fx:ConformanceLevel>%
+ \iow_newline:
+ %
+ }
+}
+% \end{macrocode}
+% \end{implementation}
+% \begin{documentation}
+% \section{User Commands}
+% The end user is only asked to set or access the data to be used by \pkg{zugferd}.
+%
+% \begin{syntax}
+% \cs[no-index]{SetZUGFeRDData}*\marg{key value list}
+% \end{syntax}
+% \DescribeMacro{\SetZUGFeRDData}
+% \DescribeMacro[noindex]{\SetZugferdData}
+% The two modes of \cs[no-index]{SetZUGFeRDData} control if the argument is expanded before the fields are set.
+% Depending on the source of the data this might be necessary.
+% Fields which are involved in the calculation will be expanded anyway, but the text fields will not, to support special characters.
+%
+% \end{documentation}
+% \begin{implementation}
+% \begin{function}{\SetZUGFeRDData}
+% \begin{macrocode}
+\NewDocumentCommand{\SetZUGFeRDData}{sm}{
+ \IfBooleanTF{#1}
+ {\keys_set:ne}
+ {\keys_set:nn}
+ {zugferd} {#2}
+}
+\let\SetZugferdData\SetZUGFeRDData
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+% \begin{documentation}
+%
+% \DescribeMacro{\InsertZUGFeRDData}
+% \DescribeMacro[noindex]{\InsertZugferdData}
+% \begin{syntax}
+% \cs[no-index]{InsertZugferdData}\oarg{special mode option}\marg{data-selection}
+% \end{syntax}
+% ZUGFerd uses the same data as the \XMLfile inside the PDF.
+% To simplify the reuse of data this command is designed to simplify the access to data fields, for example:
+%
+% \begin{examplecode}
+% \InsertZUGFeRDData{id}
+% {\InsertZUGFeRDData[set-today]{date}\today}
+% \InsertZUGFeRDData[AddressData]{seller}
+% \end{examplecode}
+% As special modes the command currently supports the following:
+%
+% By default \pkg{zugferd} tries to find the variable holding the data itself.
+% First a token list is tried, afterwards a string.
+% Global variables are prefered over local ones.
+%
+% As the variable names may container underscores and the option usually prefers dashes, dashes are converted to underscores for the detection.
+%
+% \DescribeOption{AddressData} Allows |seller| or |buyer| for the data selection.
+% Will print the address, to be used in letters.
+%
+% \DescribeOption{set-today}
+% For dates there also exists the variant which will not print the variable but parse the variable to be used as \cs{today}.
+% Using this the date format can be controlled easier using the language setting of the document.
+% Here you should take care to use it within a group to restore the real value of \cs[no-index]{today} afterwards.
+%
+% \end{documentation}
+% \begin{implementation}
+% \begin{function}{\InsertZUGFeRDData,\InsertZugferdData}
+% To simplify the usage in letters we also add fields to be able to use the zugferd data within \LaTeX{} output.
+% Country is still missing.
+% \begin{macrocode}
+\NewDocumentCommand{\InsertZUGFeRDData}{om}{
+ \str_case:nnF {#1} {
+% \end{macrocode}
+% \begin{macrocode}
+ {AddressData} {
+ \clist_map_inline:nn {name, lineone, linetwo} {
+ \prop_if_in:cnT {g_@@_#2_AddressData_prop } {##1} {
+ \prop_item:cn {g_@@_#2_AddressData_prop } {##1}\\
+ }
+ }
+ \prop_item:cn {g_@@_#2_AddressData_prop } {postcode}
+ \space
+ \prop_item:cn {g_@@_#2_AddressData_prop } {city}
+ }
+% \end{macrocode}
+% \begin{macrocode}
+ {set-today} {
+ \_@@_set_today:v {g_@@_#2_tl}
+ }
+ } {
+% \end{macrocode}
+% Try to find the variable automatially.
+% \begin{itemize}
+% \item replace dashes by underscores
+% \item try if a tokenlist or a string
+% \item prefer global over local
+% \item take the first existing variable and break the loop
+% \end{itemize}
+% \begin{macrocode}
+ \str_set:Ne \l_tmpa_str {#2}
+ \str_replace_all:Nnn \l_tmpa_str {-} {_}
+ \str_replace_all:Nnn \l_tmpa_str {/} {_}
+ \bool_set_true:N \g_tmpa_bool
+ \clist_map_inline:nn {tl, str} {
+ \clist_map_inline:nn {g, l} {
+ \use:c {##1 _if_exist:cT} {####1_@@_ \l_tmpa_str _##1}
+ {
+ \use:c {####1_@@_ \l_tmpa_str _##1}
+ \bool_gset_false:N \g_tmpa_bool
+ }
+ \bool_if:NF \g_tmpa_bool {\clist_map_break:}
+ }
+ \bool_if:NF \g_tmpa_bool {\clist_map_break:}
+ }
+ }
+}
+\providecommand{\InsertZugferdData}{\InsertZUGFeRDData}
+\providecommand{\insertZugferdData}{\InsertZUGFeRDData}
+% \end{macrocode}
+% \end{function}
+% \begin{function}{\_@@_set_today:c}
+% Auxiliary function to use a date variable within the current group to be used as \cs[no-index]{today}.
+% \begin{macrocode}
+\cs_new:Nn \_@@_set_today:n {
+ \_@@_set_today_aux:w #1 \q_stop
+}
+\cs_generate_variant:Nn \_@@_set_today:n {v}
+\cs_new:Npn \_@@_set_today_aux:w #1 #2 #3 #4 #5 #6 #7 #8 \q_stop{
+ \int_set:Nn \year {#1#2#3#4}
+ \int_set:Nn \month {#5#6}
+ \int_set:Nn \day {#7#8}
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+% \begin{documentation}
+% \section{Commands for template authors}
+%
+% \DescribeEnv{ZUGFeRD}
+% To simplify the structure of the wrapper package, \pkg{zugferd} provides an environment for the \XML mechanism and does the attachment to the PDF file (of course only, if enabled, see \autoref{sec:package-options}).
+% This provides the public interface bundling some steps together to reduce maintenance effort for any template maintainer using this package.
+% It also avoids the use of internal commands.
+%
+% This environment opens the \XML file using \cs{startWritingZUGFeRDxml} and afterwards writes the \XML header including the File and Scheme information, the |ExchangedDocumentContext| and information of the |ExchangedDocument|.
+% Notes will also be written within this step.
+% Afterwards the environment should include all the mechanisms to write the invoice positions as well as summation.
+%
+% At the end of the environment the footer is inserted, before the output stream is closed using \cs{stopWritingZUGFeRDxml}. Which also attaches the \XMLfile to the PDF.
+%
+%
+% \end{documentation}
+% \begin{implementation}
+% \begin{macrocode}
+\NewDocumentEnvironment{ZUGFeRD}{o}{
+ \IfNoValueF{#1}{
+ \SetZUGFeRDData{#1}
+ }
+ \zugferd_enable_XML_interfaces:
+ \startWritingZUGFeRDxml
+ \zugferd_write_Header:
+ \ignorespaces
+}{
+ \zugferd_enable_XML_interfaces:
+ \zugferd_write_Footer:
+ \stopWritingZUGFeRDxml
+ \zugferd_disable_XML_interfaces:
+}
+% \end{macrocode}
+% \end{implementation}
+% \begin{documentation}
+% \DescribeMacro{\startWritingZUGFeRDxml}
+% \cs[no-index]{startWritingZUGFeRDxml} is opening the output stream for the \XMLfile.
+% It also adjusts the indentation.
+% If \option{write-xml} is false, this option only opens a group to achieve the same structure in both modes.
+%
+% \DescribeMacro{\stopWritingZUGFeRDxml}
+% Here the output stream is closed and the \XMLfile is attached.
+% In case \option{write-xml} is not active, the attachment will be made if that's not deactivated separately using \option{zugferd}.
+% It also ends the group started by \cs[no-index]{startWritingZUGFeRDxml}.
+% \end{documentation}
+% \begin{implementation}
+% \begin{macrocode}
+\newcommand*{\startWritingZUGFeRDxml}{
+ \begingroup
+ \bool_if:NTF \g_@@_write_xml_bool {
+ \char_set_active_eq:nN {13} \_@@_xml_newline_indent:
+ \iow_open:Nn \_@@_xml_writer_iow {\g_@@_xml_file_tl}
+ }{
+ \msg_info:nn {zugferd} {no-xml-write}
+ }
+}
+\msg_new:nnn {zugferd} {no-xml-write} {
+ The~option~write-xml=false~was~set.\\
+ Writing~of~XML~file~is~deactivated.
+}
+% \end{macrocode}
+% The PDF attachment is done after the writing stream is closed.
+% \begin{macrocode}
+%% The metadata elements are taken by Ulrike Fischer's faktur-x experiments
+%% https://github.com/latex3/pdfresources/tree/main/experiments/factur-x-bills
+\newcommand*{\stopWritingZUGFeRDxml}{%
+ \bool_if:NT \g_@@_write_xml_bool
+ {\iow_close:N \_@@_xml_writer_iow}%
+ \endgroup
+ \bool_if:NT \g_@@_active_bool {
+ \group_begin:
+ \pdfdict_put:nnn {l_pdffile/Filespec} {AFRelationship}{/Alternative}
+ %or /Source in some cases
+ \pdfdict_put:nnn {l_pdffile/Filespec} {Desc}{(Factur-X/ZUGFeRD-Rechnung)}
+ \pdffile_embed_file:nnn {\g_@@_xml_file_tl}{factur-x.xml}
+ {zugferd/rechnung}
+ \group_end:
+ \pdfmanagement_add:nnx
+ {Catalog/Names}
+ {EmbeddedFiles}
+ {\pdf_object_ref:n{zugferd/rechnung}}
+ % steht in der docu ist aber pdf 2.0 ....
+ \pdfmanagement_add:nnx{Catalog}{AF}{\pdf_object_ref:n{zugferd/rechnung}}
+ }
+}
+% \end{macrocode}
+% \end{implementation}
+% \begin{documentation}
+% \subsection{Interfaces to write the \XML contents}
+% \changes{v0.6}{2024-09-05}{Provide public interfaces and first version of the documentation.}
+% \label{sec:xml-interfaces}
+% In case you are using |write-xml=true| (which is the default) You need to ensure to call the \XML writing functions in the correct order.
+% For example after setting the global invoice data, like it's done in the example file.
+% The minimal example below would create a valid XML.
+% The interface commands are described afterwards.
+%
+% \begin{examplecode}
+% \begin{ZUGFeRD}
+% \zugferd_write_Item:nnnnnn {1} {} {Plushie \TeX{} lion} {31.98} {2} {63.78}
+% \zugferd_startInvoiceSums:
+% \zugferd_write_TaxEntry:nnnn {S} {19} {63.78} {12.12}
+% \zugferd_write_Summation:nnnnnnnn {63.78} {0} {0} {63.78} {12.12} {75.90} {0} {75.90}
+% \zugferd_stopInvoiceSums:
+% \end{ZUGFeRD}
+% \end{examplecode}
+%
+% \DescribeMacro{\zugferd_write_Item:nnnnnn}
+% This command is the interface to write invoice items to the \XMLfile.
+% If the \XML interface is enabled this is a reference to the internal command \cs{_@@_insert_TradeLineItem:nnnnnn}.
+% \begin{syntax}
+% \cs[no-index]{zugferd_write_Item:nnnnn}
+% \marg{LineID}\marg{optional: item id (\enquote{SellerAssignedID})}\marg{item name}
+% \marg{NetPriceProductTradePrice}
+% \marg{BilledQuantity}
+% \marg{LineTotalAmount}
+% \end{syntax}
+% Within the product name macros are disabled using \cs[no-index]{zugferd_disable_macros:}, see \autoref{sec:disable_macros}.
+%
+% This command is using the local values of tax information as well as the unit code.
+% If you want to overwrite them, adjust them locally using the corresponding options, e.g.:
+% \begin{examplecode}
+% \begingroup
+% \keys_set:nn {zugferd}{tax/rate=19, tax/category=S}
+% \zugferd_write_Item:nnnnnn {1} {} {Plushie \TeX{} lion} {31.98} {2} {63.78}
+% % Code using the data for visible representation
+% \endgroup
+% \end{examplecode}
+% This will set the tax rate to 19\,\% unregarding the global setting.
+%
+% \DescribeMacro{\zugferd_startInvoiceSums:}
+% \DescribeMacro{\zugferd_stopInvoiceSums:}
+% There is some global data which is placed in the \XMLfile after the invoice items have been placed.
+% Typically, in \LaTeX{} this block is started after the items have been printed and will enclose the summation block.
+%
+% The starting includes the so called \enquote{ApplicableHeaderTradeAgreement} which contains the address data of both trade parties, see \autoref{sec:TradeParties}
+% And this will also print the \enquote{SpecifiedTradeSettlementPaymentMeans}, see \autoref{sec:PaymentMeans}.
+%
+% \DescribeMacro{\zugferd_write_TaxEntry:nnnn}
+% This command is writing the sum over a tax rate. This command has to be used once per rate applied to the items.
+% \begin{syntax}
+% \cs[no-index]{zugferd_write_TaxEntry:nnnn} \marg{tax category code} \marg{tax rate in \%} \marg{basis amount the tax applies to} \marg{tax amount}
+% \end{syntax}
+% The tax amount could of course be calculated internally.
+% In the example package this is done automatically, but the interface needs to support manual input as a lot of use cases for \LaTeX{} invoicing use it only to create the output file.
+%
+% \DescribeMacro{\zugferd_write_Summation:nnnnnnnn}\par
+% \noindent The total values are all collected with a single macro.
+% \begin{syntax}
+% \cs[no-index]{zugferd_write_Summation:nnnnnnnn}
+% \marg{LineTotalAmount}\marg{ChargeTotalAmount}\marg{AllowanceTotalAmount}
+% \marg{TaxBasisTotalAmount}\marg{TaxTotalAmount}
+% \marg{GrandTotalAmount}\marg{TotalPrepaidAmount}\marg{DuePayableAmount}
+% \end{syntax}
+% This commnd is also writing the payment terms to the \XMLfile.
+% Please be aware that it's in general not possible to calculate the tax values in here, as there might be multiple tax rates applied.
+% This is only taking the sums over all tax entries.
+%
+% In case you are using some specials like category \enquote{E} the exemption reason will also be written at that point.
+% For that it is referencing the current value of the setting.
+%
+% \subsection{Commands to temporary disable/re-enable the \XML writing interfaces}
+% \DescribeMacro{\zugferd_enable_XML_interfaces:}
+% \DescribeMacro{\zugferd_disable_XML_interfaces:}
+% \par\bigskip
+% As there are a lot of usecases where code is processed multiple times, it's necessary to provide an interface to temporary disable the \XML writing mechanism.
+% A lot of these situations appear within table structures whereas a local adjustment would not be helpful.
+% Therefore these adjustments have to be done globally.
+%
+% The example package \pkg{zugferd-invoice} provides an example for this to ensure the \XML data is not written multiple times.
+% The \env{ZUGFeRD} environment has been constructed that way, that it would automatically enable the interface when it begins and also when it ends, to write the data. So you should ensure this environment is only processed once or use the lower level interfaces directly.
+% \end{documentation}
+% \begin{implementation}
+% Provide public interfaces and the ZUGFeRD environment.
+% \begin{function}{\zugferd_enable_XML_interfaces:,\zugferd_disable_XML_interfaces:}
+% \begin{macrocode}
+\cs_new:Nn \zugferd_enable_XML_interfaces: {
+ \bool_if:NT \g_@@_write_xml_bool {
+ \cs_gset:Nn \zugferd_write_Header: {
+ \_@@_insert_Header:
+ \_@@_insert_FrontMatter:
+ }
+ \cs_gset:Nn \zugferd_write_Footer: {
+ \_@@_insert_Footer:
+ }
+ \cs_gset_eq:NN \zugferd_write_Item:nnnnnn
+ \_@@_insert_TradeLineItem:nnnnnn
+ \cs_gset:Nn \zugferd_startInvoiceSums: {
+ \_@@_ApplicableHeaderTradeAgreement:
+ \_@@_ApplicableHeaderTradeSettlement_start:
+ \_@@_SpecifiedTradeSettlementPaymentMeans:
+ }
+ \cs_gset:Nn \zugferd_stopInvoiceSums: {
+ \_@@_ApplicableHeaderTradeSettlement_stop:
+ }
+ \cs_gset_eq:NN \zugferd_write_TaxEntry:nnnn \_@@_ApplicableTradeTax:nnnn
+ \cs_gset:Nn \zugferd_write_Summation:nnnnnnnn {
+ \_@@_SpecifiedTradePaymentTerms:
+ \_@@_SpecifiedTradeSettlementHeaderMonetarySummation:nnnnnnnn
+ {##1} {##2} {##3} {##4} {##5} {##6} {##7} {##8}
+ }
+ }
+}
+\cs_new:Nn \zugferd_disable_XML_interfaces: {
+ \cs_gset_eq:NN \zugferd_write_Header: \prg_do_nothing:
+ \cs_gset_eq:NN \zugferd_write_Footer: \prg_do_nothing:
+ \cs_gset_eq:NN \zugferd_write_Item:nnnnnn \use_none:nnnnnn
+ \cs_gset_eq:NN \zugferd_startInvoiceSums: \prg_do_nothing:
+ \cs_gset_eq:NN \zugferd_stopInvoiceSums: \prg_do_nothing:
+ \cs_gset_eq:NN \zugferd_write_TaxEntry:nnnn \use_none:nnnn
+ \cs_gset_eq:NN \zugferd_write_Summation:nnnnnnnn \use_none:nnnnnnnn
+}
+\bool_if:NTF \g_@@_write_xml_bool {
+ \zugferd_enable_XML_interfaces:
+}{
+ \zugferd_disable_XML_interfaces:
+}
+% \end{macrocode}
+% \end{function}
+% \begin{function}{\_@@_write_xml:n,\_@@_define_xml_writer:Nn,\_@@_define_xml_content:Nn}
+% These commands are used to toggle the writing of the \XMLfile. This corresponds to the option \option{write-xml}.
+% \begin{macrocode}
+\bool_if:NTF \g_@@_write_xml_bool {
+ \cs_new:Nn \_@@_write_xml:n {
+ \iow_now:Ne \_@@_xml_writer_iow {\_@@_xml_auto_indent: #1}
+ }
+ \cs_new_eq:NN \_@@_define_xml_writer:Nn \cs_new:Nn
+ \cs_new_eq:NN \_@@_define_xml_content:Nn \cs_new:Nn
+} {
+ \cs_set_eq:NN \_@@_write_xml:n \use_none:n
+ \cs_set:Nn \_@@_define_xml_writer:Nn {\cs_new:Nn #1 {}}
+ \cs_set:Nn \_@@_define_xml_content:Nn {\cs_new:Nn #1 {}}
+}
+
+\cs_generate_variant:Nn \_@@_write_xml:n {e}
+% \end{macrocode}
+% \end{function}
+% \subsection{Number rounding}
+% As \pkg{siunitx} is implementing this, we use it instead of building our own mechanism.
+% \begin{macrocode}
+\RequirePackage{siunitx}
+% \end{macrocode}
+% \begin{function}{\_@@_number_format:nNn,\_@@_number_format:nNe}
+% \begin{macrocode}
+\cs_new:Nn \_@@_number_format:nNn {
+ \sisetup{
+ parse-numbers=true,
+ round-mode=places,
+ round-precision=#1,
+ round-pad = false,
+ group-digits=false,
+ minimum-decimal-digits=#1,
+ output-decimal-marker=.
+ }
+ \siunitx_number_format:nN {#3} #2
+}
+\cs_generate_variant:Nn \_@@_number_format:nNn {nNe}
+% \end{macrocode}
+% \end{function}
+% \begin{function}{\_@@_write_rounded:nnnn,\_@@_write_rounded:nnn}
+% \begin{macrocode}
+\cs_new:Nn \_@@_write_rounded:nnnn {
+ \_@@_number_format:nNe {#1} \l_@@_tmp_tl {#4}
+ \_@@_write_xml:e {<ram:#2#3>\l_@@_tmp_tl</ram:#2>}
+}
+\cs_new:Nn \_@@_write_rounded:nnn {
+ \_@@_write_rounded:nnnn {#1} {#2} {} {#3}
+}
+% \end{macrocode}
+% \end{function}
+% \subsection{XML indentation}
+% The indentation of the \XML does not really matter.
+% For debugging, it's a lot simpler to have it included and this also helped to maintain the structure of the code during development, so I decided to keep it.
+% The indentation is created using s bunch of auxiliary commands and variables which are defined here.
+% \begin{variable}{\g_@@_indent_int}
+% \begin{macrocode}
+\int_new:N \g_@@_indent_int
+% \end{macrocode}
+% \end{variable}
+% \begin{function}{\_@@_indent:,\_@@_xml_auto_indent:,\_@@_xml_newline_indent: }
+% \begin{macrocode}
+\cs_new:Nn \_@@_indent: {
+ \space\space
+}
+\cs_new:Nn \_@@_indent:n {
+ \prg_replicate:nn {#1} {\_@@_indent:}
+}
+\cs_new:Nn \_@@_xml_auto_indent: {
+ \_@@_indent:n {\g_@@_indent_int}
+}
+% \end{macrocode}
+% \end{function}
+% The idea was to redefine the \cs[no-index]{newlinechar} to automatically indent the following line.
+% \begin{macrocode}
+\cs_new:Nn \_@@_xml_newline_indent: {
+ \iow_newline: \_@@_xml_auto_indent:
+}
+% \end{macrocode}
+% \end{implementation}
+% Setting up the catcodes to simplify the \XML indentation.
+% \iffalse
+% \begin{macrocode}
+\cctab_new:N \g_@@_xml_cctab
+\begingroup%
+\endlinechar=13%
+\char_set_catcode:nn {13}{13}%
+\cctab_gsave_current:N \g_@@_xml_cctab%
+\endgroup
+% \end{macrocode}
+% \fi
+% \begin{documentation}
+% \subsection{Escaping macros inside \XML data}
+% \label{sec:disable_macros}
+% \DescribeMacro{\zugferd_disable_macros:}
+% Since we allow the use of \LaTeX{} code in some fields there has to be a mechanism to disable macros inside the \XML output.
+% The mechanism is created similar to the one by \pkg{hyperref}, and we also use some definitions from there to use those as a starting point.
+% To have a detailed list of the redefinition, please have a look at the implementation of this command.
+%
+% There exists a hook to extend or overwrite these definitions |zugferd/disable-macros|.
+% You can add own redefinitions using this. For example if you want to overwrite the setting mapping a \cs[no-index]{newline} to a new line char instead of space, you could add the following to your setup:
+% \begin{examplecode}
+% \hook_gput_code:nnn {zugferd/disable-macros}
+% {newline-to-LF}
+% {\def\newline{\iow_newline:}}
+% \end{examplecode}
+% \end{documentation}
+% \begin{implementation}
+% \begin{function}{\zugferd_disable_macros:}
+% The definition was mostly taken from \pkg{hyperref} \cite{hyperref}.
+% Most likely not all of these are required, but it's probably easier to take this as a reasonable choice instead of creating an own collection.
+% \iffalse
+% \begin{macrocode}
+%% modified list taken from hyperref.sty v7.01i
+%% Copyright
+%% 1995-2001 Sebastian Rahtz, with portions written by David Carlisle and Heiko Oberdiek
+%% 2001-2015 Heiko Oberdiek
+%% 2016-2019 Oberdiek Package Support Group
+%% 2019-2024 LaTeX Project
+%% modifications have been made to support the mechanism if hyperref is not loaded
+% \end{macrocode}
+% \fi
+% \begin{macrocode}
+\cs_new:Nn \zugferd_disable_macros: {
+ \let\{\textbraceleft
+ \let\}\textbraceright
+ \let\\\textbackslash
+ \let\#\textnumbersign
+ \let\$\textdollar
+% \end{macrocode}
+% This only is a part of the list.
+% There is no real use of printing the whole list, it's inside \file{zugferd.sty} anyway.
+% \comment
+% \begin{macrocode}
+ \let\%\textpercent
+ \let\&\textampersand
+ \let\_\textunderscore
+ \let\P\textparagraph
+ \let\ldots\textellipsis
+ \let\dots\textellipsis
+ \def\\{\space}%
+ \def\newline{\space}%
+ \def\TeX{TeX}%
+ \def\LaTeX{La\TeX}%
+ \def\LaTeXe{\LaTeX2e}%
+ \def\eTeX{e-\TeX}%
+ \def\SliTeX{Sli\TeX}%
+ \def\MF{Metafont}%
+ \def\MP{Metapost}%
+ \let\fontencoding\@gobble
+ \let\fontfamily\@gobble
+ \let\fontseries\@gobble
+ \let\fontshape\@gobble
+ \let\fontsize\@gobbletwo
+ \let\selectfont\@empty
+ \let\usefont\@gobblefour
+ \let\emph\@firstofone
+ \let\textnormal\@firstofone
+ \let\textrm\@firstofone
+ \let\textsf\@firstofone
+ \let\texttt\@firstofone
+ \let\textbf\@firstofone
+ \let\textmd\@firstofone
+ \let\textit\@firstofone
+ \let\textsc\@firstofone
+ \let\textsl\@firstofone
+ \let\textup\@firstofone
+ \let\normalfont\@empty
+ \let\rmfamily\@empty
+ \let\sffamily\@empty
+ \let\ttfamily\@empty
+ \let\bfseries\@empty
+ \let\mdseries\@empty
+ \let\itshape\@empty
+ \let\scshape\@empty
+ \let\slshape\@empty
+ \let\upshape\@empty
+ \let\em\@empty
+ \let\rm\@empty
+ \let\Huge\@empty
+ \let\LARGE\@empty
+ \let\Large\@empty
+ \let\footnotesize\@empty
+ \let\huge\@empty
+ \let\large\@empty
+ \let\normalsize\@empty
+ \let\scriptsize\@empty
+ \let\small\@empty
+ \let\tiny\@empty
+ \let\mathversion\@gobble
+ \let\phantom\@gobble
+ \let\vphantom\@gobble
+ \let\hphantom\@gobble
+ \let\ding\HyPsd@ding
+ \let\Cube\HyPsd@DieFace
+ \def\begin##1{\csname##1\endcsname}%
+ \def\end##1{\csname end##1\endcsname}%
+ \def\textcolor##1##{\@secondoftwo}%
+ \def\TextOrMath{\ifmmode\expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi}%
+ \let\foreignlanguage\@secondoftwo
+ \let\textlatin\@firstofone
+ \let\cyr\relax
+ \let\glqq\textglqq
+ \let\grqq\textgrqq
+ \let\glq\textglq
+ \let\grq\textgrq
+ \let\flqq\textflqq
+ \let\frqq\textfrqq
+ \let\flq\textflq
+ \let\frq\textfrq
+ \let\if@mid@expandable\@firstoftwo
+ \let\hspace\@gobble
+ \let\label\@gobble
+ \let\index\@gobble
+ \let\glossary\@gobble
+ \let\@mkboth\@gobbletwo
+ \let\leavevmode\@empty
+ \let\mbox\@empty
+ \def\halign{\@gobble}%
+ \let\Hy@SectionAnchorHref\@gobble
+ \let\ref\@gobble
+ \let\href\@gobble
+ \let\pageref\@gobble
+ \let\nameref\@gobble
+ \let\autoref\@gobble
+ \let\ignorespaces\relax
+ \let\ensuremath\@firstofone
+ \hook_use:n {zugferd/disable-macros}
+% \end{macrocode}
+% \endcomment
+% \begin{macrocode}
+}
+% \end{macrocode}
+% To provide a possibility to extend or overwrite the macro list a hook is added.
+% \begin{macrocode}
+\hook_new:n {zugferd/disable-macros}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+% \begin{documentation}
+% \section{Adding data to the XML}
+% All data which does not directly depend on amounts or specific items is provided using a key-value interface.
+% For some fields there is the option to define a global preset but locally overwrite it for a specific item.
+% This only applies to data fields used by the writing interfaces described in \autoref{sec:xml-interfaces}.
+%
+% This package is using the UN/CEFACT Cross Industry Invoice Syntax for the data.
+% Currently it is not planned to implement the UBL syntax as well, but generally this would be possible.
+%
+% In most cases this functionality will be used to change the tax setting or unit for a single item.
+% \autoref{sec:xml-interfaces} also provided an example for this.
+%
+% This section will now take all data which can be set using \cs{SetZUGFeRDData}.
+%
+% \end{documentation}
+% \begin{implementation}
+% \begin{variable}{\g_@@_notes_seq,\g_@@_id_tl,\g_@@_date_tl,\g_@@_subject_tl,\g_@@_fromaddress_tl,\g_@@_DocumentTypeCode_tl}
+% \begin{macrocode}
+\seq_new:N \g_@@_notes_seq
+\tl_new:N \g_@@_id_tl
+\tl_new:N \g_@@_date_tl
+\tl_new:N \g_@@_delivery_date_tl
+\tl_new:N \g_@@_subject_tl
+\tl_new:N \g_@@_fromaddress_tl
+\tl_new:N \g_@@_DocumentTypeCode_tl
+\tl_new:N \l_@@_currency_tl
+% \end{macrocode}
+% \end{variable}
+% \end{implementation}
+% \begin{documentation}
+% \subsection{General Invoicing Data}
+% Some of the general data currently supports only one value, which is alreay selected by default.
+% The interface already exists and may be extended later.
+%
+% \end{documentation}
+% \begin{implementation}
+% \begin{macrocode}
+\keys_define:nn { zugferd } {
+%TODO define others
+% \end{macrocode}
+% \end{implementation}
+% \begin{documentation}
+% \DescribeKeyOption{document-type=commercial-invoice}{commercial-invoice}
+% Select the document type. The only supported value currently is |commercial-invoice|. This will select the corresponding type code, which is 380.
+% \end{documentation}
+% \begin{implementation}
+% \begin{optionenv}{id, document-type}
+% \begin{macrocode}
+ document-type .choice:,
+ document-type / commercial-invoice .code:n =
+ \tl_gset:Nn \g_@@_DocumentTypeCode_tl {380},
+ document-type .initial:n = commercial-invoice,
+% \end{macrocode}
+% \end{optionenv}
+% \end{implementation}
+% \begin{documentation}
+% \subsubsection{Invoice number/document ID}
+% \DescribeKeyOption*{id=komavar/\meta{document ID/invoice number}}{}
+% This has to be set. Leaving it empty will lead to an invalid \XMLfile.
+%
+% The value |komavar| would reference the data provided the KOMA-Script letter variabe |invoice|. In case you don't use \pkg{scrletter} you should not use this setting.
+% More information can be found in the documentation \cite{scrletter}.
+% \end{documentation}
+% \begin{implementation}
+% \begin{macrocode}
+ id .choice:,
+ id / komavar .code:n = \tl_gset:Nf \g_@@_id_tl {\scr@invoice@var},
+ id / unknown .code:n = \tl_gset:Nn \g_@@_id_tl {#1},
+% \end{macrocode}
+% \end{implementation}
+% \begin{documentation}
+% \subsubsection{Currency}
+% \DescribeKeyOption{currency=EUR/USD/CHF/€}{EUR}
+% Currently \pkg{zugferd} only supports one currency for an invoice. This might be extended later.
+% The currency is pre-configured to use Euro.
+% \end{documentation}
+% \begin{implementation}
+% \begin{macrocode}
+ currency .choices:nn = {EUR, USD, CHF} {
+ \tl_set_eq:NN \l_@@_currency_tl \l_keys_choice_tl
+ },
+ currency / € .meta:n = {currency = EUR},
+ currency / unknown .code:n = {
+ \exp_args:Nnnx \keys_if_choice_exist:nnnTF {zugferd} {unit} {
+ \str_uppercase:f {#1}
+ }
+ {\keys_set:nx { zugferd } {unit= {\str_uppercase:f {#1}}}}
+ {
+ \msg_warning:nnn { zugferd } {unknown-value} {currency} {#1}
+ \tl_set:Ne \l_@@_currency_tl {\str_uppercase:f {#1}}
+ }
+ },
+ currency .initial:n = EUR,
+% \end{macrocode}
+% \end{implementation}
+% \begin{documentation}
+% \subsubsection{Dates}
+% \DescribeKeyOption{date=auto/\meta{date formatted as YYYYMMDD}}{auto}
+% \DescribeKeyOption{delivery-date=auto/\meta{date formatted as YYYYMMDD}}{auto}
+% \DescribeKeyOption*{due-date=\meta{date formatted as YYYYMMDD}}{}*
+% Currently there are three kinds of dates implemented.
+% The XML-Standard requires them to use the structure \meta{YYYYMMDD}.
+% For the day this document was compiled this would be: \enquote{\InsertZUGFeRDData{date}} (\today).
+%
+% Instead of providing a date value directly it's also possible to use \cs[no-index]{today}.
+% This is done using the \value{auto} which is the default setting for \option{date} and \option{delivery-date}.
+% Please be aware, that this would change if you rebuild the document later. So you might want to use an actual value here.
+% \end{documentation}
+%
+% \begin{implementation}
+% \begin{optionenv}{date,delivery-date}
+% \begin{macrocode}
+ date .choice:,
+ date / auto .code:n = \tl_gset:Ne \g_@@_date_tl {
+ \the\year
+ \int_compare:nNnT {\month} < {10} {0} \the\month
+ \int_compare:nNnT {\day} < {10} {0}\the\day
+ },
+ date / unknown .code:n = \tl_gset:Nn \g_@@_date_tl {#1},
+ date .initial:n = auto,
+ delivery-date .choice:,
+ delivery-date / auto .code:n = \tl_gset:Ne \g_@@_delivery_date_tl {
+ \the\year
+ \int_compare:nNnT {\month} < {10} {0} \the\month
+ \int_compare:nNnT {\day} < {10} {0}\the\day
+ },
+ delivery-date / unknown .code:n = {
+ \tl_gset:Nn \g_@@_delivery_date_tl {#1}
+ },
+ delivery-date .initial:n = auto,
+ due-date .tl_gset:N = \_@@_due_date_tl,
+ due-date .initial:n =,
+% \end{macrocode}
+% \end{optionenv}
+% \end{implementation}
+% \begin{documentation}
+% \subsubsection{Payment terms}
+% \DescribeKeyOption{payment-terms=\meta{string}}{}
+% One option to set payment terms is the \option{due-date} mentioned before.
+% If this is not set or the setting is more complex one can use \option{payment-terms} to add more information.
+%
+% This setting is a string. In case there is expansion required this has to be done before.
+% \end{documentation}
+% \begin{implementation}
+% \begin{optionenv}{payment-terms}
+% \begin{macrocode}
+ payment-terms .str_gset:N = \_@@_payment_terms_str,
+ payment-terms .initial:n =,
+% \end{macrocode}
+% \end{optionenv}
+% \end{implementation}
+% \begin{documentation}
+% \subsubsection{Notes: Adding additional information}
+% \DescribeKeyOption{subject=komavar/\meta{Tokenlist}}{}
+% \DescribeKeyOption{fromaddress=komavar/\meta{Tokenlist}}{}
+% \DescribeKeyOption{add-note=\meta{Tokenlist}}{}*
+% The ZUGFeRD example files\cite{zugferd-download} use all visible data to add them to the \XML as a note.
+% \option{subject} and \option{fromaddress} are used to support this.
+% The data should not be too relevant but \pkg{zugferd} want's to support adding additional data to the \XML using the note element.
+% So these fields can be left out but in case they are not empty, they will also be written to the \XML.
+%
+% The \value{komavar} corresponds to the mechanism provided by \pkg{scrletter}.
+% It accesses the variable expands it to be used directly.
+% If you don't use this package, you can ignore this setting or add content manually.
+% \end{documentation}
+% \begin{implementation}
+% \begin{optionenv}{subject,fromaddress,add-note}
+% \begin{macrocode}
+ subject .choice:,
+ subject / komavar .code:n = {
+ \tl_gset:Nf \g_@@_subject_tl {\scr@subject@var}
+ },
+ subject / unknown .code:n = \tl_gset:Nn \g_@@_subject_tl {#1},
+ fromaddress .choice:,
+ fromaddress / komavar .code:n = \tl_gset:Nf \g_@@_fromaddress_tl
+ {\scr@fromaddress@var},
+ fromaddress / unknown .code:n = \tl_gset:Nn \g_@@_fromaddress_tl {#1},
+ add-note .code:n = \seq_gput_right:Nn \g_@@_notes_seq {#1},
+}
+\msg_new:nnnn {zugferd} {unknown-value} {
+ You~selected~a~#1~which~was~not~predefined.\\
+ I~will~directly~use~your~selection~'#1=#2'.
+ Please~ensure~the~selection~is~valid!
+} {
+ For~more~information~see~the~zugferd~documentation.
+}
+% \end{macrocode}
+% \end{optionenv}
+% Macro to write notes
+% \begin{macrocode}
+\cs_new:Nn \_@@_note_if_not_empty:N {%
+ \tl_if_empty:NF #1 {%
+ \_@@_write_note:n {#1}%
+ }%
+}%
+% \end{macrocode}
+% \end{implementation}
+% \begin{documentation}
+% \subsection{Trade parties}
+% \label{sec:TradeParties}
+% The \XML scheme knows 6 different Trade Parties:
+% \begin{itemize}
+% \item Seller
+% \item Buyer
+% \item Payee
+% \item ShipTo
+% \item SellerTaxRepresentative
+% \end{itemize}
+%
+% \noindent Currently \pkg{zugferd} supports only Buyer, Seller and ShipTo, but can be easily extended to support the others as well.
+% The data for each party follows the same structure, except the \enquote{BuyerReference} which is described later in this section.
+%
+% Some of the data is optional for specific parties.
+% As this also depends on the selected scheme and version we will not list the details.
+% All fields for a trade party can be set using the \enquote{group} named by the party.
+% For example setting all the seller data is done in the following listing:
+% \begin{examplecode}
+% \SetZUGFeRDData{
+% seller/name = {peiTeX (Marei Peischl)},
+% seller/email = {invoicing@peitex.de},
+% seller/vatid = {DE123456789},
+% seller/contact= {Marei\\+4900000000\\marei@peitex.de},
+% seller/address = {Address Line 1\\Address Line 2},
+% seller/postcode = {20253},
+% seller/city ={Hamburg},
+% seller/country = {DE},
+% }
+% \end{examplecode}
+% \noindent All this data is saved within a property list, which is internally called \cs[no-index]{g_@@_\meta{seller/buyer/shipto}_prop}.
+% By default this property list is empty.
+% The users themselves have to ensure to add the required data.
+%
+% The outer braces are not required, if the data does not container an equal sign or a comma.
+% In case the final data is unknown, it's recommended to use them anyway.
+%
+% \DescribeKeyOption*{\meta{party}/name=\meta{name}}{}*
+% \DescribeKeyOption*{\meta{party}/email=\meta{email address}}{}*
+% \DescribeKeyOption*{\meta{party}/vatid=\meta{VAT ID}}{}*
+%
+% \DescribeKeyOption*{\meta{party}/address=\meta{address}}{}*
+% As shown in the example \option{address} can use two lines separted by |\\|.
+% It's possble to set all fields for all trade contacts, but e.\,g. for the |shipto|-party email and vatid will not be used in the \XML.
+%
+% Alternatively it's also possible to use \option{\meta{party}/lineone} and \option{\meta{party/linetwo}} separately.
+% This may be helpful if you use a custom input format. In any way you should ensure that all macros used within the data either are expandable or disabled using \cs[no-index]{zugferd_disable_macros:}.
+%
+% \DescribeKeyOption*{\meta{party}/postcode=\meta{postal code}}{}*
+% \DescribeKeyOption*{\meta{party}/city=\meta{city}}{}*
+% \DescribeKeyOption*{\meta{party}/country=\meta{country code}}{}*
+% The two letter country codes allowed here can be found in \cite{country-codes}.
+%
+% % \DescribeKeyOption*{\meta{party}/contact=\meta{Combined contact data}}{}*
+% The contact person can either be set using the combined structure similar to \option{\meta{party}/address}.
+% It either consists of 3 or 4 entries, depending on if a department should be used or not.
+%
+% \begin{examplecode}
+% \SetZUGFeRDData{
+% seller/contact = {
+% |\meta{contact-name}|\\
+% |\meta{contact-phone}|\\
+% |\meta{contact-email}|
+% },
+% seller/contact = {
+% |\meta{contact-name}|\\
+% |\meta{contact-department}|\\
+% |\meta{contact-phone}|\\
+% |\meta{contact-email}|
+% }
+% }
+% \end{examplecode}
+% \noindent As for \option{seller/address} it's also possible to set the keys directly:
+% \begin{examplecode}
+% \SetZUGFeRDData{
+% seller/contact-name= {|\meta{contact-name}|},
+% seller/contact-department = {|\meta{contact-department}|},
+% seller/cotact-phone ={|\meta{contact-phone}|},
+% seller/contact-email= {|\meta{contact-email}|}
+% }
+% \end{examplecode}
+% \end{documentation}
+% \begin{implementation}
+% ApplicableHeaderTradeAgreement
+%
+% Contains information on seller and buyer trade party:
+% \begin{itemize}
+% \item BuyerReference
+% \item SellerTradeParty
+% \item BuyerTradeParty
+% \end{itemize}
+%
+% \begin{optionenv}{\meta{party}/address}
+% \begin{variable}{\g_@@_seller_AddressData_prop,\g_@@_buyer_AddressData_prop,\g_@@_shipto_AddressData_prop}
+% Seller and Buyer are specified the same way.
+% \begin{macrocode}
+\clist_map_inline:nn {seller,buyer,shipto} {
+ \prop_new:c {g_@@_#1_AddressData_prop}
+ \keys_define:nn {zugferd / #1} {
+ address .code:n = {
+ \seq_set_split:Nnn \l_tmpa_seq {\\} {##1}
+ %TODO error if more than 2 lines or only 1
+ \keys_set:nx {zugferd / #1} {
+ lineone=\seq_item:Nn \l_tmpa_seq {1},
+ linetwo=\seq_item:Nn \l_tmpa_seq {2}
+ }
+ },
+ contact .code:n = {
+ \seq_set_split:Nnn \l_tmpa_seq {\\} {##1}
+ \int_compare:nNnTF {\seq_count:N \l_tmpa_seq} > {3} {
+ \keys_set:ne {zugferd/#1} {
+ contact-name = \seq_item:Nn \l_tmpa_seq {1},
+ contact-department = \seq_item:Nn \l_tmpa_seq {2},
+ contact-phone = \seq_item:Nn \l_tmpa_seq {3},
+ contact-email= \seq_item:Nn \l_tmpa_seq {4}
+ }
+ }{
+ \keys_set:ne {zugferd/#1} {
+ contact-name = \seq_item:Nn \l_tmpa_seq {1},
+ contact-phone = \seq_item:Nn \l_tmpa_seq {2},
+ contact-email= \seq_item:Nn \l_tmpa_seq {3}
+ }
+ }
+ },
+ unknown .code:n = \tl_if_blank:nF {##1} {
+ \prop_gput:cVe {g_@@_#1_AddressData_prop}
+ \l_keys_key_tl {\tl_trim_spaces:n {##1}}
+ }
+ }
+}
+% \end{macrocode}
+% \end{variable}
+% \end{optionenv}
+% \begin{function}{\_@@_PostalTradeAddress:N,\_@@_DefinedTradeContact:N}
+% Wrappers to map the property list items to the writing macro.
+% \begin{macrocode}
+\cs_new:Nn \_@@_PostalTradeAddress_short:N {
+ \exp_args:Ne \tl_if_blank:nF {\prop_item:Nn #1 {name}}
+ {<ram:Name>\prop_item:Nn #1 {name}</ram:Name>\iow_newline:\_@@_xml_auto_indent:}
+ \_@@_PostalTradeAddress:eeeee
+ {\prop_item:Nn #1 {postcode}}
+ {\prop_item:Nn #1 {lineone}}
+ {\prop_item:Nn #1 {linetwo}}
+ {\prop_item:Nn #1 {city}}
+ {\prop_item:Nn #1 {country}}
+}
+\cs_new:Nn \_@@_PostalTradeAddress:N {%
+ \_@@_PostalTradeAddress:eeeeeee
+ {\prop_item:Nn #1 {postcode}}
+ {\prop_item:Nn #1 {lineone}}
+ {\prop_item:Nn #1 {linetwo}}
+ {\prop_item:Nn #1 {city}}
+ {\prop_item:Nn #1 {country}}
+ {\prop_item:Nn #1 {email}}
+ {\prop_item:Nn #1 {vatid}}
+}%
+\cs_new:Nn \_@@_DefinedTradeContact:N {%
+ \_@@_DefinedTradeContact:eeee
+ {\prop_item:Nn #1 {contact-name}}
+ {\prop_item:Nn #1 {contact-department}}
+ {\prop_item:Nn #1 {contact-phone}}
+ {\prop_item:Nn #1 {contact-email}}
+}%
+% \end{macrocode}
+% \end{function}
+% \begin{macrocode}
+\cctab_begin:N \g_@@_xml_cctab%
+% \end{macrocode}
+% \iffalse
+% \_@@_PostalTradeAddress:nnnnnnn Name/Firma PLZ Zeile1 Zeile2 Ort Ländercode Email UID
+% \fi
+% \begin{macrocode}
+\_@@_define_xml_content:Nn \_@@_PostalTradeAddress:nnnnn {%
+ <ram:PostalTradeAddress>
+ \_@@_indent: <ram:PostcodeCode>#1</ram:PostcodeCode>
+ \tl_if_blank:nF {#2} {%
+ \_@@_indent: <ram:LineOne>#2</ram:LineOne>
+ }%
+ \tl_if_blank:nF {#3} {%
+ \_@@_indent: <ram:LineTwo>#3</ram:LineTwo>
+ }%
+ \_@@_indent: <ram:CityName>#4</ram:CityName>
+ \_@@_indent: <ram:CountryID>#5</ram:CountryID>
+ </ram:PostalTradeAddress>%
+}
+\_@@_define_xml_content:Nn \_@@_PostalTradeAddress:nnnnnnn {%
+ \_@@_PostalTradeAddress:nnnnn {#1} {#2} {#3} {#4} {#5}
+ \tl_if_empty:nF {#6} {%
+ <ram:URIUniversalCommunication>
+ \_@@_indent: <ram:URIID~schemeID="EM">#6</ram:URIID>
+ </ram:URIUniversalCommunication>%
+ }%
+ % TODO add support local tax id: schemaID="FC"
+ \tl_if_empty:nF {#7} {
+ <ram:SpecifiedTaxRegistration>
+ \_@@_indent: <ram:ID~schemeID="VA">#7</ram:ID>
+ </ram:SpecifiedTaxRegistration>%
+ }%
+}%
+%
+% Contact data phone/email to a specific contact person
+\_@@_define_xml_content:Nn \_@@_DefinedTradeContact:nnnn {%
+ % Do not print if name is empty
+ \tl_if_blank:nT {#1} {\use_none:nnn} %
+ \bool_if:NT \g_@@_writeTradeContact_bool {%
+ <ram:DefinedTradeContact>
+ \_@@_indent: <ram:PersonName>#1</ram:PersonName>
+ \tl_if_blank:nF {#2} {%
+ \_@@_indent: <ram:DepartmentName>#2</ram:DepartmentName>
+ }%
+ \tl_if_blank:nF {#3} {%
+ \_@@_indent: <ram:TelephoneUniversalCommunication>
+ \_@@_indent:n {2} <ram:CompleteNumber>#3</ram:CompleteNumber>
+ \_@@_indent: </ram:TelephoneUniversalCommunication>
+ }%
+ \tl_if_blank:nF {#4} {%
+ \_@@_indent: <ram:EmailURIUniversalCommunication>
+ \_@@_indent:n {2} <ram:URIID>#4</ram:URIID>
+ \_@@_indent: </ram:EmailURIUniversalCommunication>
+ }%
+ </ram:DefinedTradeContact>%
+ }%
+}%
+%
+\_@@_define_xml_writer:Nn \_@@_ApplicableHeaderTradeAgreement: {%
+ \_@@_write_xml:n {<ram:ApplicableHeaderTradeAgreement>}%
+ \int_gincr:N \g_@@_indent_int%
+ \_@@_write_xml:e {%
+ <ram:BuyerReference>\g_@@_buyer_reference_tl</ram:BuyerReference>
+ <ram:SellerTradeParty>%
+ }%
+ \int_gincr:N \g_@@_indent_int%
+ \_@@_write_xml:e {%
+ <ram:Name>\prop_item:Nn \g_@@_seller_AddressData_prop {name}</ram:Name>
+ \_@@_DefinedTradeContact:N \g_@@_seller_AddressData_prop%
+ \_@@_PostalTradeAddress:N \g_@@_seller_AddressData_prop%
+ }%
+ \int_gdecr:N \g_@@_indent_int%
+ \_@@_write_xml:e {%
+ </ram:SellerTradeParty>
+ <ram:BuyerTradeParty>%
+ }%
+ \int_gincr:N \g_@@_indent_int%
+ \_@@_write_xml:e {%
+ <ram:Name>\prop_item:Nn \g_@@_buyer_AddressData_prop {name}</ram:Name>
+ \_@@_DefinedTradeContact:N \g_@@_buyer_AddressData_prop%
+ \_@@_PostalTradeAddress:N \g_@@_buyer_AddressData_prop%
+ }%
+ \int_gdecr:N \g_@@_indent_int%
+ \_@@_write_xml:n {</ram:BuyerTradeParty>}%
+ \int_gdecr:N \g_@@_indent_int%
+ \_@@_write_xml:n {</ram:ApplicableHeaderTradeAgreement>}
+ \_@@_ApplicableHeaderTradeDelivery:V \g_@@_delivery_date_tl%
+}%
+%
+%
+% delivery date
+\_@@_define_xml_content:Nn \_@@_ApplicableHeaderTradeDelivery:n {%
+ \bool_lazy_and:nnF {\prop_if_empty_p:N \g_@@_shipto_AddressData_prop}%
+ {\tl_if_blank_p:n {#1}}%
+ {%
+ \_@@_write_xml:n {<ram:ApplicableHeaderTradeDelivery>}%
+ \prop_if_empty:NF \g_@@_shipto_AddressData_prop {%
+ \int_gincr:N \g_@@_indent_int%
+ \_@@_write_xml:n {<ram:ShipToTradeParty>}%
+ \int_gincr:N \g_@@_indent_int%
+ \_@@_write_xml:e {%
+ \_@@_PostalTradeAddress_short:N \g_@@_shipto_AddressData_prop%
+ }%
+ \int_gdecr:N \g_@@_indent_int%
+ \_@@_write_xml:n {</ram:ShipToTradeParty>}%
+ \int_gdecr:N \g_@@_indent_int%
+ }%
+ \tl_if_blank:nF {#1} {%
+ \_@@_write_xml:n {%
+ \_@@_indent: <ram:ActualDeliverySupplyChainEvent>
+ \_@@_indent:n {2} <ram:OccurrenceDateTime>
+ \_@@_indent:n {3}<udt:DateTimeString~format="102">#1</udt:DateTimeString>
+ \_@@_indent:n {2} </ram:OccurrenceDateTime>
+ \_@@_indent: </ram:ActualDeliverySupplyChainEvent>%
+ }%
+ }%
+ \_@@_write_xml:n {</ram:ApplicableHeaderTradeDelivery>}%
+ }%
+}%
+%
+\cctab_end:
+\cs_generate_variant:Nn \_@@_DefinedTradeContact:nnnn {eeee}
+\cs_generate_variant:Nn \_@@_PostalTradeAddress:nnnnn {eeeee}%
+\cs_generate_variant:Nn \_@@_PostalTradeAddress:nnnnnnn {eeeeeee}
+\cs_generate_variant:Nn \_@@_ApplicableHeaderTradeDelivery:n {V}
+% \end{macrocode}
+% \end{implementation}
+% \begin{documentation}
+% \subsubsection{Buyer Reference}
+% \DescribeKeyOption*{buyer/reference=komavar/\meta{Reference}}{}
+% The reference field only exists for the |buyer| trade party.
+% Depending on the process it's required to use some unique identifier referring to the |buyer|.
+% Within Germany these numbers are called \enquote{Leitweg-ID}\cite{leitweg-id}.
+%
+% In any way the |buyer| may choose what is used here. Also may be some PO number or similar reference.
+%
+% As defined for other variables the \option{reference} can also use the \value{komavar} value to refer to the value of komavar |yourref|\cite{scrletter}.
+% \end{documentation}
+% \begin{implementation}
+% \begin{optionenv}{buyer/reference}
+% \begin{macrocode}
+\tl_new:N \g_@@_buyer_reference_tl
+\keys_define:nn {zugferd/buyer} {
+ reference .choice:,
+ reference / komavar .code:n = {
+ \tl_gset:Nf \g_@@_buyer_reference_tl {\scr@yourref@var}
+ },
+ reference / unknown .code:n = {
+ \tl_gset:Nn \g_@@_buyer_reference_tl {#1}
+ }
+}
+% \end{macrocode}
+% \end{optionenv}
+% \end{implementation}
+% \begin{documentation}
+% \subsubsection{Payment Means}
+% \label{sec:PaymentMeans}
+% The payment means are selected by numeric codes.
+% Currently we support:
+% \begin{itemize}
+% \UseName{exp_args:Nnnc} \UseName{exp_args:co} {clist_map_inline:nn} {zugferd@paymentMeans@english} {\item #1}
+% \end{itemize}
+% Others may be added in the future but it's not planned to include a full list.
+%
+% The codes will automatically add the corresponding string inside the \enquote{Information} field.
+% The initial version only included German strings, but currently they are also included in English.
+% It's possible to overwrite them using the same structure:
+%
+% \begin{examplecode}
+% \setupZUGFeRDStrings{payment-means}{
+% 10 = Bargeld,
+% 58 = Zahlung per SEPA Überweisung.,
+% }
+% \end{examplecode}
+% The language selection is done using at hook executed at |\begin{document}| and will try to use the document's language.
+% If this is not defined English will be used.
+%
+% Internally the commands are predefined as a key-value list like the argument in the example above.
+% They macros are called \cs[no-index]{zugferd@paymentMeans@\meta{languagename}}.
+% Currently \pkg{zugferd} defines these for |english| and |german| (also |ngerman| as an compatibility alias).
+% \end{documentation}
+% \begin{implementation}
+% \begin{optionenv}{payment-means}
+% \begin{macrocode}
+\ExplSyntaxOff
+\providecommand*{\zugferd@paymentMeans@german}{
+ 1 = Keine Zahlungsart definiert,
+ 10 = Bargeld,
+ 30 = Überweisung,
+ 42 = Zahlung an Bankkonto,
+ 48 = Kartenzahlung,
+ 49 = Lastschriftverfahren,
+ 57 = Dauerauftrag,
+ 58 = Zahlung per SEPA Überweisung.,
+ 59 = SEPA Lastschrift,
+ 97 = Ausgleich zwischen Partnern
+}
+\def\zugferd@paymentMeans@ngerman{\zugferd@paymentMeans@german}
+\providecommand*{\zugferd@paymentMeans@english}{
+ 1 = Instrument not defined,
+ 10 = In cash,
+ 30 = Credit Transfer,
+ 31 = Debit Transfer,
+ 42 = Payment to bank account,
+ 48 = Bank card,
+ 49 = Direct Debit,
+ 57 = Standing agreement,
+ 58 = SEPA credit transfer,
+ 59 = SEPA direct debit,
+ 97 = Clearing between partners
+}
+\ExplSyntaxOn
+\tl_new:N \g_@@_payment_means_tl
+\keys_define:nn {zugferd} {
+ payment-means / type .choices:nn = {1,10,30,42,48,49,57,58,59,97} {
+ \tl_gset_eq:NN \g_@@_payment_means_tl \l_keys_choice_tl
+ },
+ payment-means / unknown .code:n = {
+ \msg_warning:nnn { zugferd } {unknown-value} {payment-means} {#1}
+ \tl_gset:Nn \g_@@_payment_means_tl {\int_eval:n {#1}}
+ }
+}
+
+\clist_map_inline:nn {iban,account-holder,bic} {
+ \keys_define:nn {zugferd/payment-means} {
+ #1 .tl_gset:c = {g_@@_payment_#1_tl}
+ }
+}
+
+\prop_new:c {g_@@_payment-means_names_prop}
+\newcommand*{\setupZUGFeRDStrings}[2]{
+ \prop_gset_from_keyval:cn {g_@@_#1_names_prop} {
+ #2
+ }
+}
+
+\hook_gput_code:nnn {begindocument/end}{zugferd/payment-means}{
+ \prop_if_empty:cT {g_@@_payment-means_names_prop} {
+ \exp_args:Nne \setupZUGFeRDStrings{payment-means}{
+ \use:c {zugferd@paymentMeans@
+ \cs_if_exist:cTF {zugferd@paymentMeans@\languagename} {\languagename} {english}
+ }
+ }
+ }
+}
+% \end{macrocode}
+% \end{optionenv}
+% \end{implementation}
+% \begin{documentation}
+% \subsection{Variables which may be changed per invoice item}
+% Some settings may have the same value for all invoice items.
+% These are defined to take some preset but are set locally.
+% So it's possible to adjust them for a single invoice item if necessary.
+% An example is shown in \autoref{sec:xml-interfaces}.
+% \subsubsection{Units}
+% \DescribeKeyOption*{unit=hour/day/one/piece/\meta{unit code}}{}
+% The Faktur-X standard requires the unit to be selected.
+% These are called \enquote{/UN/CEFACT Common Codes} and can be found withtin \cite{unit-codes}.
+%
+% Currently \pkg{zugferd} supports |hour| (|HUR|), |day| (|DAY|), |one| (C62) and |piece| (H87).
+% For these the corresponding codes have been implemented within the package.
+% Other units can be selected using the codes listed in \cite{unit-codes}.
+%
+% This option is not case sensitive
+% The value is automatically converted to uppercase.
+% If the selected option is different from the predefined ones, there will be a warning, as \pkg{zugferd} does not know if the selection is valid or not.
+% \begin{NOTE}
+% additional source: http://www.unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_Rev9e_2014.xls
+% \end{NOTE}
+% \end{documentation}
+% \begin{implementation}
+% \begin{optionenv}{unit}
+% \begin{macrocode}
+\keys_define:nn { zugferd } {
+ unit .choices:nn = {HUR,DAY,C62,H87} {
+ \tl_set_eq:NN \l_@@_unit_code_tl \l_keys_choice_tl
+ },
+ unit / hour .meta:n = {unit=HUR},
+ unit / day .meta:n = {unit=DAY},
+ unit / one .meta:n= {unit= C62},
+ unit / piece .meta:n = {unit=H87},
+% \end{macrocode}
+% If unknown, the value is converted to uppercase and we use the selection directly.
+% There is a warning in that case
+% \begin{macrocode}
+ unit / unknown .code:n = {
+ \tl_set:Nx \l_tmpa_tl {\str_uppercase:f {#1}}
+ \exp_args:NnnV \keys_if_choice_exist:nnnTF {zugferd} {unit}
+ \l_tmpa_tl
+ {
+ \keys_set:ne { zugferd } {unit= {\l_tmpa_tl}}
+ } {
+ \msg_warning:nnn { zugferd } {unknown-unit} {#1}
+ \tl_set_eq:NN \l_@@_unit_code_tl \l_tmpa_tl
+ }
+ },
+ unit .usage:n = general,
+}
+
+\msg_new:nnnn {zugferd} {unknown-unit} {
+ You~selected~a~unit~which~was~not~predefined.\\
+ I~~will~directly~use~your~selection~'unit=#1'~as~Common~Code.
+ Please~ensure~the~selection~is~valid!
+} {
+ For~more~information~see~the~zugferd~documentation\\
+ and~the~/UN/CEFACT~Common~Code~list.
+}
+% \end{macrocode}
+% \end{optionenv}
+% \end{implementation}
+% \begin{documentation}
+% \subsubsection{Tax category and rate}
+% \label{sec:tax-category}
+% \DescribeKeyOption{tax/category=\meta{category code/alias}}{standard}*
+% The Tax data requires a category code. For details have a look at the Specification \cite[e.\,g. at][]{spec-xrechnung}.
+% \pkg{zugferd} implements all of those, but the user has to take care to select the correct one for each invoice item.
+% The example file includes 2 different VAT values using the same category.
+%
+% The labels have been chosen to simplify the usage. It's also possible to enter the codes directly.
+% This option is not case sensitive.
+% \begin{valuelist}
+% \item[standard] Standard rate and reduced rate item, |category=S|
+% \item[zero] Zero rated sale, |category=Z|
+% \item[exempt] Exempted from VAT. This requires a reason via \option{exemption-reason},|category=E|
+% \item[reverse-charge] Reverse Charge, |category=AE|
+% \item[intra-community\\\textnormal{or} EEA] Intra-Community Supply, |category=K|
+% \item[export] Free export item, tax not charged, |category=G|
+% \item[O] Services outside scope of tax
+% \item[canary-islands] Canary Islands general indirect tax, |category=L|
+% \item[ceuta\\\textnormal{or} melilla] Ceuta and Melilla, |category=M|
+% \end{valuelist}
+%
+% \end{documentation}
+% \begin{implementation}
+% \optionenv{category, exemption-reason,rate}
+% \begin{macrocode}
+\msg_new:nnnn {zugferd} {unknown-tax-category} {
+ You~selected~an~unknown~tax~category.\\
+ I~~will~directly~use~your~selection~'category=#1'~as~Code.\\
+ Please~ensure~the~selection~is~valid!
+} {
+ For~more~information~see~the~zugferd~documentation\\
+ and~the~corresponding~code~list.
+}
+\msg_new:nnnn {zugferd} {no-auto-exemption} {
+ You~selected~tax/category=#1~together~with~the~auto-exemption~option.\\
+ I~don't~have~any~pre-configured~exemption~setting~for~category=#1.\\
+ Please~make~sure~you~add~a~valid~setting~yourself.
+} {
+ For~more~information~see~the~zugferd~documentation.
+}
+\keys_define:nn { zugferd / tax } {
+ category .choices:nn = {S,Z,E,AE,K,G,O,L,M} {
+ \tl_set_eq:NN \l_@@_tax_category_code_tl \l_keys_choice_tl
+ \bool_if:NT \g_@@_auto_exemption_bool {
+ \keys_if_choice_exist:nnnTF {zugferd/tax} {exemption-reason-auto} {#1} {
+ \keys_set:nn {zugferd/tax} {exemption-reason-auto=#1}
+ } {
+ \msg_warning:nnn { zugferd } {no-auto-exemption} {#1}
+ }
+ }
+ },
+% \end{macrocode}
+% \end{implementation}
+% \begin{documentation}
+% \DescribeKeyOption*{tax/exemption-reason=\meta{Text}}{}*
+% \DescribeKeyOption*{tax/exemption-reason-code=\meta{exemption reason code}}{}*
+% Add Reasons for a tax exempt, as required by |category=E,K,AE,G,O|.
+% This can either be added using a text (|exemption-reason|) or a predefined code (|exemption-reason-code|).
+% The codes are listed at \cite{VAT-exemption-codes}.
+%
+% In most common cases \pkg{zugferd} tries to automatically match them if the package option \option{auto-exemption} is enabled, which is the default.
+% In that case the following settings would apply:
+%
+% \begin{valuelist}
+% \item[S] \accessTaxExemptionReason{S}
+% \item[Z] Not configured.
+% \item[E] Not configured, as there are too many options.
+% \item[AE] \accessTaxExemptionReason{AE}
+% \item[K] \accessTaxExemptionReason{K}
+% \item[G] \accessTaxExemptionReason{G}
+% \item[O] \accessTaxExemptionReason{O}
+% \end{valuelist}
+%
+% In case there is no pre-configured selection \pkg{zugferd} will create a warning to remind the user to add a selection themselves.
+%
+% \end{documentation}
+% \begin{implementation}
+% \begin{macrocode}
+ exemption-reason .tl_set:N = \l_@@_tax_exemption_reason_tl,
+ exemption-reason .initial:V = \c_empty_tl,
+ exemption-reason .usage:n = general,
+ exemption-reason-code .tl_set:N = \l_@@_tax_exemption_code_tl,
+ exemption-reason-code .initial:V = \c_empty_tl,
+ exemption-reason .usage:n = general,
+% \end{macrocode}
+% \changes{v0.7}{2024-09-10}{Added exemption-reason-auto key for pre-configured exemption-reasons.}
+% \begin{macrocode}
+ exemption-reason-auto .choice:,
+ exemption-reason-auto / S .code:n = {
+ \keys_set:nn {zugferd/tax} {exemption-reason=,exemption-reason-code=}
+ },
+ exemption-reason-auto / K .code:n = {
+ \keys_set:nn {zugferd/tax} {
+ exemption-reason= Intra-Community~Supply,
+ exemption-reason-code={vatex-eu-ic}
+ }
+ },
+ exemption-reason-auto / AE .code:n = {
+ \keys_set:nn {zugferd/tax}{
+ exemption-reason=Reverse~Charge,
+ exemption-reason-code={vatex-eu-ae}
+ }
+ },
+ exemption-reason-auto / G .code:n = {
+ \keys_set:nn {zugferd/tax}{
+ exemption-reason=Export~outside~the~EU,
+ exemption-reason-code={vatex-eu-g}
+ }
+ },
+ exemption-reason-auto / O .code:n = {
+ \keys_set:nn {zugferd/tax}{
+ exemption-reason=No~subject~to~VAT,
+ exemption-reason-code={vatex-eu-o}
+ }
+ },
+ standard .meta:n = {category=S},
+ zero .meta:n = {category=Z},
+ exempt .meta:n = {category=E},
+ reverse-charge .meta:n = {category=AE},
+ intra-community .meta:n = {category=K},
+ EEA .meta:n = {category=K},
+ export .meta:n = {category=G},
+ canary-islands .meta:n = {category=L},
+ ceuta .meta:n = {category=M},
+ melilla .meta:n = {category=M},
+ category / unknown .code:n = {
+ \exp_args:Nnnx \keys_if_choice_exist:nnnTF {zugferd} {category}
+ {\str_uppercase:f {#1}}
+ {
+ \keys_set:nx { zugferd } {category= {\str_uppercase:f {#1}}}
+ } {
+ \msg_warning:nnn { zugferd } {unknown-tax-category} {#1}
+ }
+ },
+ category .initial:n = S,
+ category .usage:n = general,
+% \end{macrocode}
+% \end{implementation}
+% \begin{documentation}
+% \DescribeKeyOption{tax/rate=\meta{floating point}}{19}*
+% The value given will be used for tax calculation.
+% By default it's configured to |19| to match the German standard VAT rate.
+%
+% \end{documentation}
+% \begin{implementation}
+% \begin{macrocode}
+ rate .fp_set:N = \l_@@_tax_rate_fp,
+ rate .initial:n = 19,
+ rate .usage:n = general,
+}
+% \end{macrocode}
+% \endoptionenv
+% \begin{macrocode}
+\_@@_define_xml_writer:Nn \_@@_write_inline:nn {
+ \tl_if_blank:nF {#2} {
+ <#1>#2</#1>
+ }
+}
+\cs_generate_variant:Nn \_@@_write_inline:nn {ne}
+\_@@_define_xml_writer:Nn \_@@_write_inline_i:nn {
+ \_@@_indent: \_@@_write_inline:nn {#1} {#2}
+}
+\cctab_begin:N \g_@@_xml_cctab%
+%
+\_@@_define_xml_writer:Nn \_@@_write_note:n {%
+ \begingroup%
+ \let\\\iow_newline:%
+ \_@@_write_xml:e {%
+ <ram:IncludedNote>
+ \_@@_indent: <ram:Content>
+ #1
+ \_@@_indent: </ram:Content>
+ </ram:IncludedNote>%
+ }%
+ \endgroup%
+}%
+%
+%
+\begingroup%
+\char_set_catcode_other:N \#%
+\char_set_catcode:nn {32}{10}%
+\_@@_define_xml_writer:Nn \_@@_insert_Header: {%
+ \_@@_write_xml:e {%
+ <?xml version='1.0' encoding='UTF-8' ?>
+ <rsm:CrossIndustryInvoice %
+ xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" %
+ xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" %
+ xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" %
+ xmlns:xs="http://www.w3.org/2001/XMLSchema" %
+ xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">%
+ }%
+ \int_gincr:N \g_@@_indent_int%
+ \_@@_write_xml:n {<rsm:ExchangedDocumentContext>}%
+ \int_gincr:N \g_@@_indent_int%
+ \_@@_write_xml:e {%
+ \str_if_empty:NF \g_@@_businessProcessId_str {%
+ <ram:BusinessProcessSpecifiedDocumentContextParameter>
+ \_@@_indent: <ram:ID>\g_@@_businessProcessId_str</ram:ID>
+ </ram:BusinessProcessSpecifiedDocumentContextParameter>
+ }%
+ <ram:GuidelineSpecifiedDocumentContextParameter>
+ \_@@_indent: <ram:ID>\g_@@_format_str</ram:ID>
+ </ram:GuidelineSpecifiedDocumentContextParameter>%
+ }%
+ \int_gdecr:N \g_@@_indent_int%
+ \_@@_write_xml:n {</rsm:ExchangedDocumentContext>}%
+}%
+\endgroup%
+\_@@_define_xml_writer:Nn \_@@_insert_FrontMatter: {%
+ \_@@_write_xml:n {<rsm:ExchangedDocument>}%
+ \int_gincr:N \g_@@_indent_int%
+ \_@@_write_xml:e {%
+ <ram:ID>\g_@@_id_tl</ram:ID>
+ <ram:TypeCode>\g_@@_DocumentTypeCode_tl</ram:TypeCode>
+ <ram:IssueDateTime>
+ % space required!
+ \_@@_indent:<udt:DateTimeString~format="102">\g_@@_date_tl</udt:DateTimeString>
+ </ram:IssueDateTime>%
+ }%
+ \_@@_note_if_not_empty:N \g_@@_subject_tl%
+ \_@@_note_if_not_empty:N \g_@@_fromaddress_tl%
+ \seq_map_inline:Nn \g_@@_notes_seq {%
+ \_@@_write_note:n {##1}%
+ }%
+ \int_gdecr:N \g_@@_indent_int%
+ \_@@_write_xml:e {%
+ </rsm:ExchangedDocument>
+ <rsm:SupplyChainTradeTransaction>%
+ }%
+ \int_gincr:N \g_@@_indent_int%
+}%
+%
+% footer
+\_@@_define_xml_writer:Nn \_@@_insert_Footer: {%
+ \int_gdecr:N \g_@@_indent_int%
+ \_@@_write_xml:n {</rsm:SupplyChainTradeTransaction>}%
+ \int_gdecr:N \g_@@_indent_int%
+ \_@@_write_xml:n {</rsm:CrossIndustryInvoice>}%
+}%
+\cctab_end:
+% \end{macrocode}
+%
+% \subsection{Invoice Items}
+% Each item consists of 5 parts:
+% \begin{itemize}
+% \item AssociatedDocumentLineDocument
+% \item SpecifiedTradeProduct
+% \item SpecifiedLineTradeAgreement
+% \item SpecifiedLineTradeDelivery
+% \item SpecifiedLineTradeSettlement
+% \end{itemize}
+% These are implemented as separate commands to be more flexible.
+% The wrapper command is called \cs[no-index]{@@_insert_TradeLineItem:nnnnnn} and is created to be used in your own invoicing package-
+% \begin{macrocode}
+\cctab_begin:N \g_@@_xml_cctab%
+% \end{macrocode}
+% \begin{function}{\_@@_AssociatedDocumentLineDocument:n}
+% \begin{macrocode}
+\_@@_define_xml_writer:Nn \_@@_AssociatedDocumentLineDocument:n {%
+ <ram:AssociatedDocumentLineDocument>
+ \_@@_indent: <ram:LineID>#1</ram:LineID>
+ </ram:AssociatedDocumentLineDocument>%
+}%
+% \end{macrocode}
+% \end{function}
+% \begin{function}{\_@@_SpecifiedTradeProduct:nn}
+% \begin{macrocode}
+\_@@_define_xml_writer:Nn \_@@_SpecifiedTradeProduct:nn {%
+ <ram:SpecifiedTradeProduct>
+ \tl_if_empty:nF {#1} {%
+ \_@@_indent: <ram:SellerAssignedID>#1</ram:SellerAssignedID>
+ }%
+ \_@@_indent: <ram:Name>#2</ram:Name>
+ </ram:SpecifiedTradeProduct>%
+}%
+% \end{macrocode}
+% \end{function}
+% \begin{function}{\_@@_ProductTradePrice:nn}
+% \begin{macrocode}
+\_@@_define_xml_writer:Nn \_@@_ProductTradePrice:nn {%
+ <ram:\str_uppercase:n #1PriceProductTradePrice>
+ \_@@_indent: <ram:ChargeAmount>#2</ram:ChargeAmount>
+ </ram:\str_uppercase:n #1PriceProductTradePrice>%
+}%
+% \end{macrocode}
+% \end{function}
+% \begin{function}{\_@@_SpecifiedLineTradeAgreement:nn}
+% \begin{macrocode}
+\_@@_define_xml_writer:Nn \_@@_SpecifiedLineTradeAgreement:nn {%
+ <ram:SpecifiedLineTradeAgreement>
+ \_@@_indent:<ram:GrossPriceProductTradePrice>
+ \_@@_indent:n {2} <ram:ChargeAmount>#1</ram:ChargeAmount>
+ \_@@_indent:</ram:GrossPriceProductTradePrice>
+ \_@@_indent:<ram:NetPriceProductTradePrice>
+ \_@@_indent:n {2} <ram:ChargeAmount>#2</ram:ChargeAmount>
+ \_@@_indent:</ram:NetPriceProductTradePrice>
+ </ram:SpecifiedLineTradeAgreement>
+}%
+% \end{macrocode}
+% \end{function}
+%%%\subsubsection{SpecifiedLineTradeDelivery}%:nn <unit code > <number>
+% \begin{function}{\_@@_SpecifiedLineTradeDelivery:nn}
+% \begin{macrocode}
+\_@@_define_xml_writer:Nn \_@@_SpecifiedLineTradeDelivery:nn {%
+ <ram:SpecifiedLineTradeDelivery>
+ % SPACE!
+ \_@@_indent: <ram:BilledQuantity~unitCode="#1">#2</ram:BilledQuantity>
+ </ram:SpecifiedLineTradeDelivery>
+}%
+% \end{macrocode}
+% \end{function}
+% \begin{function}{\_@@_SpecifiedLineTradeSettlement:nnn,\_@@_SpecifiedLineTradeSettlement:Vnn}
+% \begin{macrocode}
+\_@@_define_xml_content:Nn \_@@_SpecifiedLineTradeSettlement:nnn {%
+ <ram:SpecifiedLineTradeSettlement>
+ \_@@_indent: <ram:ApplicableTradeTax>
+ %BT-151
+ \_@@_indent:n {2} <ram:TypeCode>VAT</ram:TypeCode>
+ %BT-151
+ \_@@_indent:n {2} <ram:CategoryCode>#1</ram:CategoryCode>
+ %BT-152
+ \_@@_indent:n {2} <ram:RateApplicablePercent>#2</ram:RateApplicablePercent>
+ \_@@_indent: </ram:ApplicableTradeTax>
+ \_@@_indent: <ram:SpecifiedTradeSettlementLineMonetarySummation>
+ % BT-131
+ \_@@_indent:n {2} <ram:LineTotalAmount>#3</ram:LineTotalAmount>
+ \_@@_indent: </ram:SpecifiedTradeSettlementLineMonetarySummation>
+ </ram:SpecifiedLineTradeSettlement>%
+}%
+% \end{macrocode}
+% \begin{macrocode}
+\cctab_end:
+\cs_generate_variant:Nn \_@@_SpecifiedLineTradeSettlement:nnn {Vnn}
+% \end{macrocode}
+% \end{function}
+% The exemption reason was placed wrong with the pre-CTAN release.
+% This was fixed in August 2024.
+% The old macro will be kept for a bit longer but will be removed soon.
+% Please update your own implementations accordingly.
+% \changes{v0.4}{2024-08-22}{Deprecate old syntax and add public interfaces.}
+% \begin{macrocode}
+\cs_new:Nn \_@@_SpecifiedLineTradeSettlement:nnnn {
+ \msg_warning:nnnn {zugferd} {macro-deprecated}
+ { \_@@_SpecifiedLineTradeSettlement:nnnn }
+ { \_@@_SpecifiedLineTradeSettlement:nnn }
+ \_@@_SpecifiedLineTradeSettlement:nnn {#2} {#3} {#4}
+}
+\cs_generate_variant:Nn \_@@_SpecifiedLineTradeSettlement:nnnn {VVnn}
+% \end{macrocode}
+% \end{implementation}
+% \begin{implementation}
+% \begin{function}{ \_@@_insert_TradeLineItem:nnnnnn,\@@_write_TradeLineItem:nnnnnn}
+% Writing an invoice item using the helper commands defined before, to the \XMLfile.
+% \begin{macrocode}
+\_@@_define_xml_writer:Nn \_@@_insert_TradeLineItem:nnnnnn {
+ \_@@_write_xml:n {<ram:IncludedSupplyChainTradeLineItem>}
+ \int_gincr:N \g_@@_indent_int
+ \_@@_write_xml:e {\_@@_AssociatedDocumentLineDocument:n {#1}}%
+
+ \begingroup
+ \zugferd_disable_macros:
+ \_@@_write_xml:e {\_@@_SpecifiedTradeProduct:nn {#2} {#3}}
+ \endgroup
+
+ \_@@_write_xml:n {<ram:SpecifiedLineTradeAgreement>}
+ \int_gincr:N \g_@@_indent_int%
+ \_@@_write_xml:e {\_@@_ProductTradePrice:nn {net} {#4}}
+ \int_gdecr:N \g_@@_indent_int%
+ \_@@_write_xml:n {</ram:SpecifiedLineTradeAgreement>}
+ \_@@_write_xml:e {%
+ \_@@_SpecifiedLineTradeDelivery:nn { \l_@@_unit_code_tl } {#5}
+ \_@@_SpecifiedLineTradeSettlement:Vnn \l_@@_tax_category_code_tl %
+ { \fp_use:N \l_@@_tax_rate_fp} {#6}
+ }%
+ \int_gdecr:N \g_@@_indent_int
+ \_@@_write_xml:n {</ram:IncludedSupplyChainTradeLineItem>}
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+% \begin{implementation}
+% ApplicableHeaderTradeSettlement
+% \begin{macrocode}
+\_@@_define_xml_writer:Nn \_@@_SpecifiedTradeSettlementHeaderMonetarySummation:nnnnnnnn {%
+ \_@@_write_xml:n {<ram:SpecifiedTradeSettlementHeaderMonetarySummation>}%
+ \int_gincr:N \g_@@_indent_int%
+ \_@@_write_rounded:nnn {2} {LineTotalAmount} {#1}
+ \_@@_write_rounded:nnn {2} {ChargeTotalAmount} {#2}
+ \_@@_write_rounded:nnn {2} {AllowanceTotalAmount} {#3}
+ \_@@_write_rounded:nnn {2} {TaxBasisTotalAmount} {#4}
+ \_@@_write_rounded:nnnn {2} {TaxTotalAmount} {~currencyID="\l_@@_currency_tl "} {#5}
+ \_@@_write_rounded:nnn {2} {GrandTotalAmount} {#6}
+ \_@@_write_rounded:nnn {2} {TotalPrepaidAmount} {#7}
+ \_@@_write_rounded:nnn {2} {DuePayableAmount} {#8}
+ \int_gdecr:N \g_@@_indent_int%
+ \_@@_write_xml:n {</ram:SpecifiedTradeSettlementHeaderMonetarySummation>}%
+}%
+% ApplicableTradeTax CategoryCode Rate BaseAmount Result
+\_@@_define_xml_writer:Nn \_@@_ApplicableTradeTax:nnnn {%
+ \_@@_write_xml:n {<ram:ApplicableTradeTax>}
+ \int_gincr:N \g_@@_indent_int%
+ \_@@_write_rounded:nnn {2} {CalculatedAmount} {#4}%BT117
+ \_@@_write_xml:n {<ram:TypeCode>VAT</ram:TypeCode>}%BT118
+ \tl_if_blank:VF \l_@@_tax_exemption_reason_tl {%BT-120
+ \_@@_write_xml:e {<ram:ExemptionReason>
+ \l_@@_tax_exemption_reason_tl
+ </ram:ExemptionReason>}
+ }
+ {{\_@@_write_rounded:nnn {2} {BasisAmount} {#3}}}%BT-116
+ \_@@_write_xml:e {<ram:CategoryCode>#1</ram:CategoryCode>}%BT-118
+ \tl_if_blank:VF \l_@@_tax_exemption_code_tl {%BT121
+ \_@@_write_xml:e {<ram:ExemptionReasonCode>
+ \l_@@_tax_exemption_code_tl
+ </ram:ExemptionReasonCode>}
+ }
+ \_@@_write_xml:n {<ram:RateApplicablePercent>#2</ram:RateApplicablePercent>}%BT-119
+ \int_gdecr:N \g_@@_indent_int%
+ \_@@_write_xml:n {</ram:ApplicableTradeTax>}
+}%
+%
+\cctab_begin:N \g_@@_xml_cctab%
+% ApplicableHeaderTradeSettlement
+\_@@_define_xml_writer:Nn \_@@_ApplicableHeaderTradeSettlement:nnnnnnnn {%
+
+}%
+% \end{macrocode}
+% ApplicableHeaderTradeSettlement needs to be splitted to be used in separate parts of the tabular.
+% \begin{macrocode}
+\_@@_define_xml_writer:Nn \_@@_ApplicableHeaderTradeSettlement_start: {%
+ \_@@_write_xml:n {<ram:ApplicableHeaderTradeSettlement>}%
+ \int_gincr:N \g_@@_indent_int%
+ \_@@_write_xml:e {<ram:InvoiceCurrencyCode>\l_@@_currency_tl</ram:InvoiceCurrencyCode>}%
+}%
+\_@@_define_xml_writer:Nn \_@@_ApplicableHeaderTradeSettlement_stop: {%
+ \int_gdecr:N \g_@@_indent_int%
+ \_@@_write_xml:n {</ram:ApplicableHeaderTradeSettlement>}%
+}%
+% \end{macrocode}
+% SpecifiedTradePaymentTerms
+% \begin{macrocode}
+\_@@_define_xml_writer:Nn \_@@_SpecifiedTradePaymentTerms:nn {%
+ \_@@_write_xml:n {<ram:SpecifiedTradePaymentTerms>}%
+ \int_gincr:N \g_@@_indent_int%
+ \_@@_write_xml:e {%
+ \tl_if_blank:nF {#1} {%
+ <ram:Description>#1</ram:Description>%
+ }%
+ \tl_if_blank:nF {#2} {%
+ <ram:DueDateDateTime>
+ \_@@_indent: <udt:DateTimeString~format="102">#2</udt:DateTimeString>
+ </ram:DueDateDateTime>%
+ }%
+ }%
+ \int_gdecr:N \g_@@_indent_int%
+ \_@@_write_xml:n {</ram:SpecifiedTradePaymentTerms>}%
+}%
+%
+%
+% sums
+\_@@_define_xml_writer:Nn \_@@_SpecifiedTradeSettlementPaymentMeans:nnn {%
+ \bool_if:NT \g_@@_writePaymentMeans_bool {%
+ \_@@_write_xml:n {<ram:SpecifiedTradeSettlementPaymentMeans>}%
+ \int_gincr:N \g_@@_indent_int%
+ \_@@_write_xml:e {%
+ <ram:TypeCode>\g_@@_payment_means_tl</ram:TypeCode>
+ \_@@_write_inline:ne {ram:Information} {\prop_item:cV {g_@@_payment-means_names_prop} \g_@@_payment_means_tl}%
+ \tl_if_blank:nF {#1#2} {%
+ <ram:PayeePartyCreditorFinancialAccount>
+ \_@@_write_inline_i:nn {ram:IBANID} {#2}
+ \_@@_write_inline_i:nn {ram:AccountName} {#1}
+ </ram:PayeePartyCreditorFinancialAccount>
+ }%
+ \tl_if_blank:nF {#3} {%
+ <ram:PayeeSpecifiedCreditorFinancialInstitution>
+ \_@@_write_inline_i:nn {ram:BICID} {#3}
+ </ram:PayeeSpecifiedCreditorFinancialInstitution>%
+ }%
+ }%
+ \int_gdecr:N \g_@@_indent_int%
+ \_@@_write_xml:n {</ram:SpecifiedTradeSettlementPaymentMeans>}%
+ }%
+}%
+\cctab_end:
+\cs_generate_variant:Nn \_@@_SpecifiedTradePaymentTerms:nn {VV}
+\_@@_define_xml_writer:Nn \_@@_SpecifiedTradePaymentTerms: {
+ \_@@_SpecifiedTradePaymentTerms:VV \_@@_payment_terms_str \_@@_due_date_tl
+}
+% \end{macrocode}
+% \begin{function}{\_@@_SpecifiedTradeSettlementPaymentMeans:}
+% \begin{macrocode}
+\cs_generate_variant:Nn \_@@_SpecifiedTradeSettlementPaymentMeans:nnn {vvv}
+\_@@_define_xml_writer:Nn \_@@_SpecifiedTradeSettlementPaymentMeans: {
+ \tl_if_blank:VF \g_@@_payment_means_tl {
+ \_@@_SpecifiedTradeSettlementPaymentMeans:vvv
+ {g_@@_payment_account-holder_tl} {g_@@_payment_iban_tl} {g_@@_payment_bic_tl}
+ }
+}
+% \end{macrocode}
+% \end{function}
+% \end{implementation}
+% \begin{implementation}
+% \begin{macrocode}
+\msg_new:nnn {zugferd} {macro-deprecated} {
+ The~function~#1~is~deprecated.\\
+ It~was~replaced~by~#2.\\
+ Please~adjust~your~mechanism~to~use~the~new~version.
+}
+% \end{macrocode}
+% \end{implementation}
+% \iffalse
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+% \fi
+% \Finale
+\endinput
diff --git a/Master/texmf-dist/source/latex/zugferd/zugferd.ins b/Master/texmf-dist/source/latex/zugferd/zugferd.ins
new file mode 100644
index 00000000000..207227702ae
--- /dev/null
+++ b/Master/texmf-dist/source/latex/zugferd/zugferd.ins
@@ -0,0 +1,19 @@
+\input docstrip
+
+\preamble
+
+Copyright (C) 2023--2024 by Marei Peischl (peiTeX) <marei@peitex.de>
+
+\endpreamble
+
+\askforoverwritefalse
+
+\usedir{tex/latex/zugferd}
+
+\generate{
+ \file{zugferd.sty}{
+ \from{zugferd.dtx}{package}
+ }
+}
+
+\endbatchfile