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/atveryend/atveryend.dtx1059
-rw-r--r--Master/texmf-dist/source/latex/babel/babel.dtx7063
-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.zipbin1089081 -> 1090145 bytes
-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/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/bithesis/bithesis.dtx490
-rw-r--r--Master/texmf-dist/source/latex/bookcover/bookcover.dtx536
-rw-r--r--Master/texmf-dist/source/latex/bookcover/bookcover.ins4
-rw-r--r--Master/texmf-dist/source/latex/bookshelf/bookshelf.dtx2524
-rw-r--r--Master/texmf-dist/source/latex/bookshelf/bookshelf.ins62
-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/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/easybook/easybook.dtx466
-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/fillwith/fillwith.dtx747
-rw-r--r--Master/texmf-dist/source/latex/fillwith/fillwith.ins68
-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.dtx33
-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/jlreq/Makefile103
-rw-r--r--Master/texmf-dist/source/latex/l3build/l3build.dtx81
-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.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3cctab.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3clist.dtx6
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3color.dtx4
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3debug.dtx4
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx2
-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.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3int.dtx9
-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.dtx2
-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.dtx8
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3prg.dtx4
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3prop.dtx2
-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.dtx5
-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.dtx2
-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/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/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/mathtools/empheq.dtx25
-rw-r--r--Master/texmf-dist/source/latex/mathtools/empheq.ins94
-rw-r--r--Master/texmf-dist/source/latex/mathtools/mathtools.dtx33
-rw-r--r--Master/texmf-dist/source/latex/mathtools/mathtools.ins2
-rw-r--r--Master/texmf-dist/source/latex/minted/Makefile38
-rw-r--r--Master/texmf-dist/source/latex/minted/minted.dtx5384
-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/moremath/moremath.dtx402
-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.dtx381
-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/polyglossia/polyglossia.dtx30582
-rw-r--r--Master/texmf-dist/source/latex/reptheorem/reptheorem.dtx199
-rw-r--r--Master/texmf-dist/source/latex/reptheorem/reptheorem.ins10
-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.dtx23
-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/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.dtx1
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx50
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx5
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx.dtx2
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx.tex8
-rw-r--r--Master/texmf-dist/source/latex/spelatex/spelatex.dtx898
-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.dtx24
-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.dtx263
-rw-r--r--Master/texmf-dist/source/latex/to-be-determined/to-be-determined.dtx32
-rw-r--r--Master/texmf-dist/source/latex/to-be-determined/to-be-determined.ins4
-rw-r--r--Master/texmf-dist/source/latex/uantwerpendocs/uantwerpendocs.dtx19
-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/useclass/useclass.dtx16
-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
200 files changed, 40039 insertions, 45173 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/atveryend/atveryend.dtx b/Master/texmf-dist/source/latex/atveryend/atveryend.dtx
index 24c67081b37..8e9b3bb74cc 100644
--- a/Master/texmf-dist/source/latex/atveryend/atveryend.dtx
+++ b/Master/texmf-dist/source/latex/atveryend/atveryend.dtx
@@ -1,12 +1,12 @@
% \iffalse meta-comment
%
% File: atveryend.dtx
-% Version: 2019-12-11 v1.11
+% Version: 2024-08-06 v1.12
% Info: Hooks at the very end of document
%
% Copyright (C)
% 2009-2011 Heiko Oberdiek
-% 2016-2019 Oberdiek Package Support Group
+% 2016-2024 Oberdiek Package Support Group
% https://github.com/ho-tex/atveryend/issues
%
% This work may be distributed and/or modified under the
@@ -80,7 +80,7 @@
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: atveryend 2019-12-11 v1.11 Hooks at the very end of document (HO)}
+\Msg{* Package: atveryend 2024-08-06 v1.12 Hooks at the very end of document (HO)}
\Msg{************************************************************************}
\keepsilent
@@ -92,11 +92,11 @@
This is a generated file.
Project: atveryend
-Version: 2019-12-11 v1.11
+Version: 2024-08-06 v1.12
Copyright (C)
2009-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
@@ -154,7 +154,7 @@ and the derived files
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{atveryend.drv}%
- [2019-12-11 v1.11 Hooks at the very end of document (HO)]%
+ [2024-08-06 v1.12 Hooks at the very end of document (HO)]%
\documentclass{ltxdoc}
\usepackage{holtxdoc}[2011/11/22]
\begin{document}
@@ -168,103 +168,56 @@ and the derived files
% \GetFileInfo{atveryend.drv}
%
% \title{The \xpackage{atveryend} package}
-% \date{2019-12-11 v1.11}
+% \date{2024-08-06 v1.12}
% \author{Heiko Oberdiek\thanks
% {Please report any issues at \url{https://github.com/ho-tex/atveryend/issues}}}
%
% \maketitle
%
% \begin{abstract}
-% This \LaTeX\ package provides two hooks for \verb|\end{document}|
-% that are executed after the hook of \cs{AtEndDocument}.
-% \cs{AfterLastShipout} can be used for code that is to be executed
-% right after the last \cs{clearpage} before the \xext{aux} file
-% is closed. \cs{AtVeryEndDocument} is used for code after closing
-% and final reading of the \xext{aux} file.
+% This \LaTeX\ package is a small wrapper around standard \LaTeX{} hooks at the end
+% of a document.
+%
% \end{abstract}
%
-% \tableofcontents
%
% \section{Documentation}
-%
-% There are packages (e.g. \xpackage{hyperref} \cite{hyperref},
-% \xpackage{lastpage} \cite{lastpage})
-% that want to call code after the typesetting is done, for example
-% to remember the last page number. \LaTeX\ provides the hook
-% \cs{AtEndDocument} (\xpackage{clsguide} \cite{clsguide}).
-% There are packages that use this hook to do their job for
-% typesetting pages (e.g. \xpackage{endfloat} emits the floats here
-% \cite{endfloat}).
-% Also a user might provide additional code in \cs{AtEndDocument}.
-% Therefore packages have to call \cs{clearpage} in \cs{AtEndDocument}
-% to get after the last shipout page. But this is not too reliable,
-% because the right timing is important between packages that want
-% or have to do things before the last page is output and packages
-% that only work properly if they can reach the point after the
-% last shipout.
-%
-% Therefore the task of this package is to provide additional
-% hooks for |\end{document}|. All hooks are called after
-% the hook of \cs{AtEndDocument}.
-% \begin{declcs}{BeforeClearDocument} \M{code}
-% \end{declcs}
-% The code is called before the final \cs{clearpage} in
-% \cs{enddocument}. However it is unknown, whether the last
-% page is already shipped out or if this will be triggered by the
-% final \cs{clearpage}.
-%
+%
+% In the past this package patched the command \cs{enddocument} to
+% provided two additional hooks for \verb|\end{document}|
+% that were executed after the hook of \cs{AtEndDocument}.
+%
+% Since 2020 this patching is no longer needed as the
+% hooks are provided by \LaTeX{} directly. Since this time the code of the package
+% was no longer used as \LaTeX{} suppressed the loading of the package
+% and replaced the commands by commands based on the new hooks. In version 1.12
+% this new code was moved into \texttt{atveryend} directly.
+%
+% The package defines the following user commands and maps them
+% to \cs{AddToHook} calls. A description of the used
+% hooks can be found in \texttt{lhooks-doc.pdf}.
+%
% \begin{declcs}{AfterLastShipout} \M{code}
% \end{declcs}
-% The code is called after the final \cs{clearpage} of \cs{enddocument}
-% before the main \xext{aux} file is closed. This is the right place
-% to remember the last page in the \xext{aux} file, for instance.
+% This adds the code to the \texttt{enddocument/afterlastpage} hook.
%
% \begin{declcs}{AtVeryEndDocument} \M{code}
% \end{declcs}
-% The code is called after the \xext{aux} file is closed and read in again.
-% It is the place for final checks, rerun hints, final messages.
+% This adds the code to the \texttt{enddocument/afteraux} hook.
%
% \begin{declcs}{AtEndAfterFileList} \M{code}
% \end{declcs}
-% After the \xext{aux} file closing and reading \hologo{LaTeX}
-% prints the file list if requested by \cs{listfiles}.
-% Then this hook is executed.
-%
+% This adds the code to the \texttt{enddocument/info} hook.%
+%
% \begin{declcs}{AtVeryVeryEnd} \M{code}
% \end{declcs}
-% This code is called right before the final \cs{@@end}.
-%
-% \subsection{Related work}
-%
-% \begin{description}
-% \item[Package \xpackage{scrfile}:]
-% Markus Kohm has written package \xpackage{scrlfile}
-% (part of KOMA-Script \cite{koma})
-% that provides
-% hooks \cs{BeforeClosingMainAux} and after \cs{AfterReadingMainAux}.
-% They have the same function as the hooks of this package. In fact
-% this package uses them, if they are available.
-% \item[Class \xclass{revtex4-1}:]
-% This class calls \cs{clear@document} in \cs{enddocument}
-% that wraps the final call of \cs{clearpage}.
-% Thus it can be used as hook to call stuff after that \cs{clearpage}.
-% This is also done by this package.
-% \item[Package \xpackage{etoolbox}:]
-% It provides \cs{AfterEndDocument}, a hook right before
-% \cs{deadcycles} or \cs{@@end} \cite{etoolbox}.
-% \end{description}
-% This package tries to combine as many approaches as possible:
-% \begin{itemize}
-% \item It looks for a known \cs{enddocument} and redefines it.
-% \item Hooks that are provided by others are used (package
-% \xpackage{scrlfile} or class \xclass{revtex4-1}.
-% \item It redefines \cs{@checkend} and \cs{@dofilelist} to insert
-% the hooks similar to package \xpackage{scrlfile}.
-% \item The hook execution is wrapped in a macro that
-% is redefined by its first call to prevent calling the hook
-% more than once.
-% \end{itemize}
+% This adds the code to the \texttt{enddocument/end} hook.
%
+% \begin{declcs}{BeforeClearDocument} \M{code}
+% \end{declcs}
+% This adds the code to the \texttt{enddocument} hook.
+% It is recommended to use \cs{AtEndDocument} instead.
+%
% \StopEventually{
% }
%
@@ -273,899 +226,45 @@ and the derived files
%<*package>
% \end{macrocode}
%
-% \begin{macrocode}
-\begingroup\catcode61\catcode48\catcode32=10\relax%
- \catcode13=5 % ^^M
- \endlinechar=13 %
- \catcode123=1 % {
- \catcode125=2 % }
- \catcode64=11 % @
- \def\x{\endgroup
- \expandafter\edef\csname AtVeryEnd@AtEnd\endcsname{%
- \endlinechar=\the\endlinechar\relax
- \catcode13=\the\catcode13\relax
- \catcode32=\the\catcode32\relax
- \catcode35=\the\catcode35\relax
- \catcode61=\the\catcode61\relax
- \catcode64=\the\catcode64\relax
- \catcode123=\the\catcode123\relax
- \catcode125=\the\catcode125\relax
- }%
- }%
-\x\catcode61\catcode48\catcode32=10\relax%
-\catcode13=5 % ^^M
-\endlinechar=13 %
-\catcode35=6 % #
-\catcode64=11 % @
-\catcode123=1 % {
-\catcode125=2 % }
-\def\TMP@EnsureCode#1#2{%
- \edef\AtVeryEnd@AtEnd{%
- \AtVeryEnd@AtEnd
- \catcode#1=\the\catcode#1\relax
- }%
- \catcode#1=#2\relax
-}
-\TMP@EnsureCode{9}{10}% (tab)
-\TMP@EnsureCode{39}{12}% '
-\TMP@EnsureCode{40}{12}% (
-\TMP@EnsureCode{41}{12}% )
-\TMP@EnsureCode{42}{12}% *
-\TMP@EnsureCode{45}{12}% -
-\TMP@EnsureCode{46}{12}% .
-\TMP@EnsureCode{47}{12}% /
-\TMP@EnsureCode{62}{12}% >
-\TMP@EnsureCode{91}{12}% [
-\TMP@EnsureCode{93}{12}% ]
-\TMP@EnsureCode{96}{12}% `
-\edef\AtVeryEnd@AtEnd{\AtVeryEnd@AtEnd\noexpand\endinput}
-% \end{macrocode}
-%
% Package identification.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{atveryend}%
- [2019-12-11 v1.11 Hooks at the very end of document (HO)]
+ [2024-08-06 v1.12 Hooks at the very end of document (HO)]
% \end{macrocode}
%
% \subsection{Tools}
%
-% \begin{macro}{\AtVeryEnd@ifundefined}
-% \begin{macrocode}
-\def\AtVeryEnd@ifundefined#1{%
- \begingroup\expandafter\expandafter\expandafter\endgroup
- \expandafter\ifx\csname #1\endcsname\relax
- \expandafter\@firstoftwo
- \else
- \expandafter\@secondoftwo
- \fi
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Hooks}
-%
-% \begin{macro}{\AtVeryEnd@BeforeClearDocumentHook}
-% \begin{macrocode}
-\let\AtVeryEnd@BeforeClearDocumentHook\@empty
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@AfterLastShipoutHook}
-% \begin{macrocode}
-\let\AtVeryEnd@AfterLastShipoutHook\@empty
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@AtVeryEndDocumentHook}
-% \begin{macrocode}
-\let\AtVeryEnd@AtVeryEndDocumentHook\@empty
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@AtEndAfterFileListHook}
-% \begin{macrocode}
-\let\AtVeryEnd@AtEndAfterFileListHook\@empty
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@AtVeryVeryEndHook}
-% \begin{macrocode}
-\let\AtVeryEnd@AtVeryVeryEndHook\@empty
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\BeforeClearDocument}
-% \begin{macrocode}
-\newcommand*{\BeforeClearDocument}{%
- \g@addto@macro\AtVeryEnd@BeforeClearDocumentHook
-}
-% \end{macrocode}
-% \end{macro}
% \begin{macro}{\AfterLastShipout}
% \begin{macrocode}
-\newcommand*{\AfterLastShipout}{%
- \g@addto@macro\AtVeryEnd@AfterLastShipoutHook
-}
+\newcommand\AfterLastShipout {\AddToHook{enddocument/afterlastpage}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\AtVeryEndDocument}
% \begin{macrocode}
-\newcommand*{\AtVeryEndDocument}{%
- \g@addto@macro\AtVeryEnd@AtVeryEndDocumentHook
-}
+\newcommand\AtVeryEndDocument {\AddToHook{enddocument/afteraux}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\AtEndAfterFileList}
% \begin{macrocode}
-\newcommand*{\AtEndAfterFileList}{%
- \g@addto@macro\AtVeryEnd@AtEndAfterFileListHook
-}
+\newcommand\AtEndAfterFileList{\AddToHook{enddocument/info}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\AtVeryVeryEnd}
% \begin{macrocode}
-\newcommand*{\AtVeryVeryEnd}{%
- \g@addto@macro\AtVeryEnd@AtVeryVeryEndHook
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\Call@BeforeClearDocument}
-% \begin{macrocode}
-\newcommand*{\Call@BeforeClearDocument}{%
- \let\BeforeClearDocument\@firstofone
- \ifx\AtVeryEnd@BeforeClearDocumentHook\@empty
- \PackageInfo{atveryend}{Empty hook `BeforeClearDocument'}%
- \else
- \PackageInfo{atveryend}{Executing hook `BeforeClearDocument'}%
- \AtVeryEnd@BeforeClearDocumentHook
- \fi
- \global\let\AtVeryEnd@BeforeClearDocumentHook\@undefined
- \global\let\Call@BeforeClearDocument\relax
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\Call@AfterLastShipout}
-% \begin{macrocode}
-\newcommand*{\Call@AfterLastShipout}{%
- \let\AfterLastShipout\@firstofone
- \ifx\AtVeryEnd@AfterLastShipoutHook\@empty
- \PackageInfo{atveryend}{Empty hook `AfterLastShipout'}%
- \else
- \PackageInfo{atveryend}{Executing hook `AfterLastShipout'}%
- \AtVeryEnd@AfterLastShipoutHook
- \fi
- \global\let\AtVeryEnd@AfterLastShipoutHook\@undefined
- \global\let\Call@AfterLastShipout\relax
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\Call@AtVeryEndDocument}
-% \begin{macrocode}
-\newcommand*{\Call@AtVeryEndDocument}{%
- \let\AtVeryEndDocument\@firstofone
- \ifx\AtVeryEnd@AtVeryEndDocumentHook\@empty
- \PackageInfo{atveryend}{Empty hook `AtVeryEndDocument'}%
- \else
- \PackageInfo{atveryend}{Executing hook `AtVeryEndDocument'}%
- \AtVeryEnd@AtVeryEndDocumentHook
- \fi
- \global\let\AtVeryEnd@AtVeryEndDocumentHook\@undefined
- \global\let\Call@AtVeryEndDocument\relax
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\Call@AtEndAfterFileList}
-% \begin{macrocode}
-\newcommand*{\Call@AtEndAfterFileList}{%
- \Call@AtVeryEndDocument
- \let\AtEndAfterFileList\@firstofone
- \ifx\AtVeryEnd@AtEndAfterFileListHook\@empty
- \PackageInfo{atveryend}{Empty hook `AtEndAfterFileList'}%
- \else
- \PackageInfo{atveryend}{Executing hook `AtEndAfterFileList'}%
- \AtVeryEnd@AtEndAfterFileListHook
- \fi
- \global\let\AtVeryEnd@AtEndAfterFileListHook\@undefined
- \global\let\Call@AtEndAfterFileList\relax
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\Call@AtVeryVeryEnd}
-% \begin{macrocode}
-\newcommand*{\Call@AtVeryVeryEnd}{%
- \Call@AtEndAfterFileList
- \let\AtVeryVeryEnd\@firstofone
- \ifx\AtVeryEnd@AtVeryVeryEndHook\@empty
- \PackageInfo{atveryend}{Empty hook `AtVeryVeryEnd'}%
- \else
- \PackageInfo{atveryend}{Executing hook `AtVeryVeryEnd'}%
- \AtVeryEnd@AtVeryVeryEndHook
- \fi
- \global\let\AtVeryEnd@AtVeryVeryEndHook\@undefined
- \global\let\Call@AtVeryVeryEnd\relax
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Redefining \cs{enddocument}}
-%
-% This approach looks for known versions of \cs{enddocument}
-% and redefines it. Class \xclass{seminar}
-% and package \xpackage{slidesec} are not checked, because
-% there would be too much combinations to check.
-%
-% \subsubsection{\LaTeX\ kernel}
-%
-% \begin{macro}{\AtVeryEnd@test@standard}
-% \begin{macrocode}
-\def\AtVeryEnd@test@standard{%
- \let\AtEndDocument\@firstofone
- \@enddocumenthook
- \@checkend{document}%
- \clearpage
- \begingroup
- \if@filesw
- \immediate\closeout\@mainaux
- \let\@setckpt\@gobbletwo
- \let\@newl@bel\@testdef
- \@tempswafalse
- \makeatletter
- \input\jobname.aux %
- \fi
- \@dofilelist
- \ifdim \font@submax >\fontsubfuzz\relax
- \@font@warning{Size substitutions with differences\MessageBreak
- up to \font@submax\space have occurred.\@gobbletwo}%
- \fi
- \@defaultsubs
- \@refundefined
- \if@filesw
- \ifx \@multiplelabels \relax
- \if@tempswa
- \@latex@warning@no@line{Label(s) may have changed. %
- Rerun to get cross-references right}%
- \fi
- \else
- \@multiplelabels
- \fi
- \fi
- \endgroup
- \deadcycles\z@
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@enddocument@standard}
-% \begin{macrocode}
-\def\AtVeryEnd@enddocument@standard{%
- \let\AtEndDocument\@firstofone
- \@enddocumenthook
- \@checkend{document}%
- \Call@BeforeClearDocument
- \clearpage
- \Call@AfterLastShipout
- \begingroup
- \if@filesw
- \immediate\closeout\@mainaux
- \let\@setckpt\@gobbletwo
- \let\@newl@bel\@testdef
- \@tempswafalse
- \makeatletter
- \input\jobname.aux %
- \fi
- \Call@AtVeryEndDocument
- \@dofilelist
- \Call@AtEndAfterFileList
- \ifdim \font@submax >\fontsubfuzz\relax
- \@font@warning{Size substitutions with differences\MessageBreak
- up to \font@submax\space have occurred.\@gobbletwo}%
- \fi
- \@defaultsubs
- \@refundefined
- \if@filesw
- \ifx \@multiplelabels \relax
- \if@tempswa
- \@latex@warning@no@line{Label(s) may have changed. %
- Rerun to get cross-references right}%
- \fi
- \else
- \@multiplelabels
- \fi
- \fi
- \endgroup
- \deadcycles\z@
- \Call@AtVeryVeryEnd
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \subsubsection{\LaTeX\ kernel 2011/06/27}
-%
-% The \hologo{LaTeX2e} release 2011/06/27 has changed \cs{enddocument}
-% (\cs{input} is replaced by \cs{@@input}).
-% \begin{macro}{\AtVeryEnd@test@standard20110627}
-% \begin{macrocode}
-\expandafter\def\csname AtVeryEnd@test@standard20110627\endcsname{%
- \let\AtEndDocument\@firstofone
- \@enddocumenthook
- \@checkend{document}%
- \clearpage
- \begingroup
- \if@filesw
- \immediate\closeout\@mainaux
- \let\@setckpt\@gobbletwo
- \let\@newl@bel\@testdef
- \@tempswafalse
- \makeatletter
- \@@input\jobname.aux %
- \fi
- \@dofilelist
- \ifdim \font@submax >\fontsubfuzz\relax
- \@font@warning{Size substitutions with differences\MessageBreak
- up to \font@submax\space have occurred.\@gobbletwo}%
- \fi
- \@defaultsubs
- \@refundefined
- \if@filesw
- \ifx \@multiplelabels \relax
- \if@tempswa
- \@latex@warning@no@line{Label(s) may have changed. %
- Rerun to get cross-references right}%
- \fi
- \else
- \@multiplelabels
- \fi
- \fi
- \endgroup
- \deadcycles\z@
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@enddocument@standard20110627}
-% \begin{macrocode}
-\expandafter\def\csname AtVeryEnd@enddocument@standard20110627\endcsname{%
- \let\AtEndDocument\@firstofone
- \@enddocumenthook
- \@checkend{document}%
- \Call@BeforeClearDocument
- \clearpage
- \Call@AfterLastShipout
- \begingroup
- \if@filesw
- \immediate\closeout\@mainaux
- \let\@setckpt\@gobbletwo
- \let\@newl@bel\@testdef
- \@tempswafalse
- \makeatletter
- \@@input\jobname.aux %
- \fi
- \Call@AtVeryEndDocument
- \@dofilelist
- \Call@AtEndAfterFileList
- \ifdim \font@submax >\fontsubfuzz\relax
- \@font@warning{Size substitutions with differences\MessageBreak
- up to \font@submax\space have occurred.\@gobbletwo}%
- \fi
- \@defaultsubs
- \@refundefined
- \if@filesw
- \ifx \@multiplelabels \relax
- \if@tempswa
- \@latex@warning@no@line{Label(s) may have changed. %
- Rerun to get cross-references right}%
- \fi
- \else
- \@multiplelabels
- \fi
- \fi
- \endgroup
- \deadcycles\z@
- \Call@AtVeryVeryEnd
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \subsubsection{Package \xpackage{booklet}, file \xpackage{2up.tex}}
-%
-% \begin{macro}{\AtVeryEnd@test@booklet}
-% \begin{macrocode}
-\expandafter\def\expandafter\AtVeryEnd@test@booklet\expandafter{%
- \expandafter\twoupclearpage
- \AtVeryEnd@test@standard
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@enddocument@booklet}
-% \begin{macrocode}
-\expandafter\def\expandafter\AtVeryEnd@enddocument@booklet\expandafter{%
- \expandafter\twoclearpage
- \AtVeryEnd@enddocument@standard
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \subsubsection{Class \xclass{dinbrief}}
-%
-% \begin{macro}{\AtVeryEnd@test@dinbrief}
-% \begin{macrocode}
-\def\AtVeryEnd@test@dinbrief{%
- \@checkend{document} %
- \newpage
- \begingroup
- \if@filesw
- \ifnum\c@labelgen>0 %
- \immediate\closeout\@mainlbl
- \makeatletter
- \input \jobname@lbl\relax
- \clearpage
- \fi
- \immediate\closeout\@mainaux
- \fi
- \endgroup
- \deadcycles\z@
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@enddocument@dinbrief}
-% \begin{macrocode}
-\def\AtVeryEnd@enddocument@dinbrief{%
- \@checkend{document}%
- \Call@BeforeClearDocument
- \newpage
- \Call@AfterLastShipout
- \begingroup
- \if@filesw
- \ifnum\c@labelgen>\z@
- \immediate\closeout\@mainlbl
- \makeatletter
- \input \jobname@lbl\relax
- \clearpage
- \fi
- \immediate\closeout\@mainaux
- \fi
- \Call@AtVeryEndDocument
- \csname @dofilelist\endcsname
- \Call@AtEndAfterFileList
- \endgroup
- \deadcycles\z@
- \Call@AtVeryVeryEnd
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \subsubsection{Class \xclass{combine}}
-%
-% \begin{macro}{\AtVeryEnd@test@combine}
-% \begin{macrocode}
-\def\AtVeryEnd@test@combine{%
- \@enddocumenthook
- \@checkend{document}%
- \clearpage
- \begingroup
- \if@filesw
- \immediate\closeout\@mainaux
- \immediate\closeout\@partaux
- \let\@setckpt\@gobbletwo
- \let\@newl@bel\@testdef
- \@tempswafalse
- \makeatletter \input\c@lmainauxfile %% change here
- \fi
- \c@lenddoca %% a replacement
- \@refundefined
- \endgroup
- \deadcycles\z@
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@enddocument@combine}
-% \begin{macrocode}
-\def\AtVeryEnd@enddocument@combine{%
- \@enddocumenthook
- \@checkend{document}%
- \Call@BeforeClearDocument
- \clearpage
- \Call@AfterLastShipout
- \begingroup
- \if@filesw
- \immediate\closeout\@mainaux
- \immediate\closeout\@partaux
- \let\@setckpt\@gobbletwo
- \let\@newl@bel\@testdef
- \@tempswafalse
- \makeatletter \input\c@lmainauxfile %% change here
- \fi
- \Call@AtVeryEndDocument
- \c@lenddoca %% a replacement
- \@refundefined
- \endgroup
- \deadcycles\z@
- \Call@AtVeryVeryEnd
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\AtVeryEnd@test@c@lenddoca}
-% \begin{macrocode}
-\long\def\AtVeryEnd@test@c@lenddoca{%
- \@dofilelist
- \ifdim\font@submax>\fontsubfuzz\relax
- \@font@warning{%
- Size substitutions with differences\MessageBreak
- up to \font@submax\space have occured.\@gobbletwo
- }%
- \fi
- \@defaultsubs
- \if@filesw
- \ifx\@multiplelabels\relax
- \if@tempswa
- \@latex@warning@no@line{%
- Label(s) may have changed. %
- Rerun to get cross-references right%
- }%
- \fi
- \else
- \@multiplelabels
- \fi
- \fi
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\c@lenddoca}
-% \begin{macrocode}
-\ifx\AtVeryEnd@c@lenddoca\c@lenddoca
- \def\c@lenddoca{%
- \@dofilelist
- \Call@AtEndAfterFileList
- \ifdim\font@submax>\fontsubfuzz\relax
- \@font@warning{%
- Size substitutions with differences\MessageBreak
- up to \font@submax\space have occured.\@gobbletwo
- }%
- \fi
- \@defaultsubs
- \if@filesw
- \ifx\@multiplelabels\relax
- \if@tempswa
- \@latex@warning@no@line{%
- Label(s) may have changed. %
- Rerun to get cross-references right%
- }%
- \fi
- \else
- \@multiplelabels
- \fi
- \fi
- }%
-\fi
-% \end{macrocode}
-% \end{macro}
-%
-% \subsubsection{Class \xpackage{jpsj2}}
-%
-% \begin{macro}{\AtVeryEnd@test@jpsj}
-% \begin{macrocode}
-\def\AtVeryEnd@test@jpsj{%
- \if@lastpagebalancing
- \global\let\@outputdblcol=\balancing@outputdblcol
- \fi
- \@checkend{document}%
- \clearpage
- \begingroup
- \if@filesw
- \immediate\closeout\@mainaux
- \def\global\@namedef##1##2{}%
- \def\newlabel{\@testdef r}%
- \def\bibcite{\@testdef b}%
- \@tempswafalse
- \makeatletter
- \input \jobname.aux %
- \if@tempswa
- \@warning{%
- Label(s) may have changed. %
- Rerun to get cross-references right%
- }%
- \fi
- \fi
- \endgroup
- \deadcycles\z@
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@enddocument@jpsj}
-% \begin{macrocode}
-\def\AtVeryEnd@enddocument@jpsj{%
- \if@lastpagebalancing
- \global\let\@outputdblcol=\balancing@outputdblcol
- \fi
- \@checkend{document}%
- \Call@BeforeClearDocument
- \clearpage
- \Call@AfterLastShipout
- \begingroup
- \if@filesw
- \immediate\closeout\@mainaux
- \def\global\@namedef##1##2{}%
- \def\newlabel{\@testdef r}%
- \def\bibcite{\@testdef b}%
- \@tempswafalse
- \makeatletter
- \input \jobname.aux %
- \if@tempswa
- \@warning{%
- Label(s) may have changed. %
- Rerun to get cross-references right%
- }%
- \fi
- \fi
- \Call@AtVeryEndDocument
- \csname @dofilelist\endcsname
- \Call@AtEndAfterFileList
- \endgroup
- \deadcycles\z@
- \Call@AtVeryVeryEnd
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \subsubsection{Testing and redefining}
-%
-% \begin{macro}{\AtVeryEnd@Test}
-% \begin{macrocode}
-\def\AtVeryEnd@Test#1#2{%
- \expandafter\ifx\csname AtVeryEnd@test@#2\endcsname#1%
- \expandafter\let\expandafter#1%
- \csname AtVeryEnd@enddocument@#2\endcsname
- \begingroup
- \let\on@line\@empty
- \PackageInfo{atveryend}{%
- \string#1 detected (#2)%
- }%
- \endgroup
- \expandafter\AtVeryEnd@SkipToNil
- \fi
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@SkipToNil}
-% \begin{macrocode}
-\def\AtVeryEnd@SkipToNil#1\@nil{}
+\newcommand\AtVeryVeryEnd {\AddToHook{enddocument/end}}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\AtVeryEnd@RedefEndDocument}
+% \begin{macro}{\BeforeClearDocument}
% \begin{macrocode}
-\def\AtVeryEnd@RedefEndDocument#1{%
- \ifx#1\@undefined
- \else
- \AtVeryEnd@Test#1{standard20110627}%
- \AtVeryEnd@Test#1{standard}%
- \AtVeryEnd@Test#1{booklet}%
- \AtVeryEnd@Test#1{dinbrief}%
- \AtVeryEnd@Test#1{combine}%
- \AtVeryEnd@Test#1{jpsj}%
- \AtVeryEnd@SkipToNil
- \@nil
- \fi
-}
+\newcommand\BeforeClearDocument{\AddToHook{enddocument}}
% \end{macrocode}
% \end{macro}
-% \begin{macrocode}
-\AtVeryEnd@RedefEndDocument\enddocument
-\AtVeryEnd@RedefEndDocument\AP@enddocument % afterpage.sty
-\AtVeryEnd@RedefEndDocument\hyper@back@cite@enddocument % htx-bc.sty
-\AtVeryEnd@RedefEndDocument\hyper@enddocument % hyper.sty
-\AtVeryEnd@RedefEndDocument\hyper@fn@enddocument % hyper.sty
-\AtVeryEnd@RedefEndDocument\cweb@save@enddocument % cweb.cls
-\AtVeryEnd@RedefEndDocument\prev@enddocument % flushend.sty
-\AtVeryEnd@RedefEndDocument\endorigdocument % gaceta.cls
-\AtVeryEnd@RedefEndDocument\keependdoc % aguplus.sty
-\AtVeryEnd@RedefEndDocument\EMenddocument % t-angles.sty
-\AtVeryEnd@RedefEndDocument\docmute@enddocument % docmute.sty
-\AtVeryEnd@RedefEndDocument\a@enddocument % alatex.sty
-\AtVeryEnd@RedefEndDocument\enddocumentasusual % frenchle.sty
-\AtVeryEnd@RedefEndDocument\old@enddocument % uwthesis.cls
-% \end{macrocode}
-%
-% \subsection{Hack into \cs{enddocument}}
-%
-% \begin{macrocode}
-\def\AtVeryEnd@document{document}%
-\def\AtVeryEnd@RedefCheckEnd{%
- \expandafter\def\expandafter\@checkend
- \expandafter##\expandafter1\expandafter{%
- \@checkend{##1}%
- \def\AtVeryEnd@temp{##1}%
- \ifx\AtVeryEnd@temp\AtVeryEnd@document
- \let\AtVeryEnd@OrgClearpage\clearpage
- \def\clearpage{%
- \let\clearpage\AtVeryEnd@OrgClearpage
- \Call@BeforeClearDocument
- \clearpage
- \Call@AfterLastShipout
- }%
- \fi
- }%
- \aftergroup\AtVeryEnd@RedefCheckEnd
-}%
-\AtBeginDocument{%
- \AtEndDocument{%
- \AtVeryEnd@RedefCheckEnd
- }%
-}
-% \end{macrocode}
-%
-% \begin{macrocode}
-\AtEndDocument{%
- \@ifundefined{@dofilelist}{%
- \gdef\@dofilelist{%
- \Call@AtVeryEndDocument
- \Call@AtEndAfterFileList
- }%
- }{%
- \begingroup
- \toks@\expandafter{\@dofilelist}%
- \xdef\@dofilelist{%
- \noexpand\Call@AtVeryEndDocument
- \the\toks@
- \noexpand\Call@AtEndAfterFileList
- }%
- \endgroup
- }%
-}
-% \end{macrocode}
-%
-% \subsection{Using hooks of other packages}
-%
-% \subsubsection{Package \xpackage{scrlfile}}
-%
-% \begin{macrocode}
-\AtBeginDocument{%
- \@ifpackageloaded{scrlfile}{%
- \AtVeryEnd@ifundefined{BeforeClosingMainAux}{}{%
- \BeforeClosingMainAux{\Call@AfterLastShipout}%
- }%
- \AtVeryEnd@ifundefined{AfterReadingMainAux}{}{%
- \AfterReadingMainAux{\Call@AtVeryEndDocument}%
- }%
- }{}%
-% \end{macrocode}
-%
-% \subsubsection{Package \xpackage{etoolbox}}
-%
-% \begin{macrocode}
- \@ifpackageloaded{etoolbox}{%
- \AtVeryEnd@ifundefined{AfterEndDocument}{}{%
- \AfterEndDocument{\Call@AtVeryEndDocument}%
- }%
- }{}%
-% \end{macrocode}
-% \begin{macrocode}
-}
-% \end{macrocode}
-%
-% \subsection{Class \xclass{letter}}
-%
-% The class \xclass{letter} and some similar classes
-% insert material (\cs{@startlabels}) at the end of the document.
-% However, this method violates
-% a precondition of this package that the \cs{clearpage} in
-% \cs{enddocument} is the final call with no material at
-% later times. Therefore we move the label making
-% from the \xext{aux} file to \cs{AtEndDocument}.
-% \begin{macrocode}
-\def\AtVeryEnd@temp{%
- \AtBeginDocument{%
- \let\@startlabels\startlabels
- \let\@mlabel\mlabel
- \if@filesw
- \immediate\write\@mainaux{\string\@startlabels}%
- \fi
- }%
- \AtEndDocument{%
- \if@filesw
- \immediate\write\@mainaux{\string\clearpage}%
- \fi
- }%
-}
-\ifx\makelabels\AtVeryEnd@temp
-\else
- \expandafter\AtVeryEnd@AtEnd
-\fi%
-\let\AtVeryEnd@PatchLetter=N%
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname endletter\endcsname\relax
-\else
- \long\def\AtVeryEnd@TestEndLetter#1\@auxout#2#3\AtVeryEnd@Nil{%
- \def\AtVeryEnd@temp{#2}%
- \ifx\AtVeryEnd@temp\@empty
- \else
- \@onelevel@sanitize\AtVeryEnd@temp
- \edef\AtVeryEnd@StringMlabel{%
- \string\string
- \string\@mlabel
- \expandafter\@gobble\string\{%
- }%
- \def\AtVeryEnd@CatchFirst##1##2##3##4##5##6##7##8{%
- ##1##2##3##4##5##6##7##8\AtVeryEnd@CatchSecond
- }%
- \def\AtVeryEnd@CatchSecond##1##2##3##4##5##6##7##8##9\@nil{%
- ##1##2##3##4##5##6##7##8%
- }%
- \edef\AtVeryEnd@temp{%
- \expandafter\AtVeryEnd@CatchFirst\AtVeryEnd@temp
- {}{}{}{}{}{}{}{}%
- {}{}{}{}{}{}{}{}%
- \@nil
- }%
- \ifx\AtVeryEnd@temp\AtVeryEnd@StringMlabel
- \expandafter\def\expandafter\endletter\expandafter{%
- \endletter
- \begingroup
- \let\\=\relax
- \let\protect\@unexpandable@protect
- \let\@mlabel=\relax
- \edef\x{\endgroup
- \noexpand\AtEndDocument{%
- \@gobble#2%
- }%
- }%
- \x
- }%
- \let\AtVeryEnd@PatchLetter=Y%
- \fi
- \fi
- }%
- \expandafter\AtVeryEnd@TestEndLetter\endletter
- \@auxout{}\AtVeryEnd@Nil
-\fi
-\ifx\AtVeryEnd@PatchLetter Y%
- \begingroup
- \let\on@line\@empty
- \PackageInfo{atveryend}{%
- \@backslashchar makelabels detected. %
- Moving labels\MessageBreak
- from `.aux' file to \@backslashchar AtEndDocument%
- }%
- \endgroup
- \def\makelabels{%
- \AtBeginDocument{%
- \let\@startlabels\startlabels
- \let\@mlabel\mlabel
- }%
- }%
- \AtEndDocument{%
- \AtVeryEnd@ifundefined{@startlabels}{%
- }{%
- \clearpage
- \@startlabels
- }%
- }%
- \AfterLastShipout{%
- \let\@startlabels\relax
- \let\@mlabel\@gobbletwo
- }%
-\else
- \PackageWarningNoLine{atveryend}{%
- \@backslashchar makelabels detected, but labels cannot\MessageBreak
- be moved to \@backslashchar AtEndDocument, because\MessageBreak
- \@backslashchar endletter is not in expected form%
- }%
-\fi
-% \end{macrocode}
%
% \begin{macrocode}
-\AtVeryEnd@AtEnd%
%</package>
% \end{macrocode}
-%% \section{Installation}
+% \section{Installation}
%
% \subsection{Download}
%
@@ -1175,28 +274,7 @@ and the derived files
% \item[\CTAN{macros/latex/contrib/atveryend/atveryend.dtx}] The source file.
% \item[\CTAN{macros/latex/contrib/atveryend/atveryend.pdf}] Documentation.
% \end{description}
-%
-%
-% \paragraph{Bundle.} All the packages of the bundle `atveryend'
-% 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/atveryend.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{atveryend.tds.zip} in the
-% TDS tree (also known as \xfile{texmf} tree) of your choice.
-% Example (linux):
-% \begin{quote}
-% |unzip atveryend.tds.zip -d ~/texmf|
-% \end{quote}
-%
+%
% \subsection{Package installation}
%
% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting
@@ -1332,51 +410,6 @@ and the derived files
% suggestions and comments.
% \end{description}
%
-% \begin{thebibliography}{9}
-%
-% \bibitem{clsguide}
-% The \LaTeX3 Project:
-% \textit{\LaTeX2e\ for class and package writers}
-% 2006/02/15;
-% \CTANpkg{clsguide}.
-%
-% \bibitem{endfloat}
-% James Darrell McCauley, Jeff Goldberg:
-% \textit{The \xpackage{endfloat} package};
-% 1995/10/11 v2.4i;
-% \CTANpkg{endfloat}.
-%
-% \bibitem{etoolbox}
-% Philipp Lehmann:
-% \textit{The \xpackage{etoolbox} package};
-% 2009/08/06 v1.8;
-% \CTANpkg{etoolbox}.
-%
-% \bibitem{hyperref}
-% Sebastian Rahtz, Heiko Oberdiek:
-% \textit{The \xpackage{hyperref} package};
-% 2009/12/05 v6.79l;
-% \CTANpkg{hyperref}.
-%
-% \bibitem{koma}
-% Markus Kohm:
-% \textit{KOMA-Script};
-% 2009/07/24 v3.04a;
-% \url{https://www.komascript.de/}.
-%
-% \bibitem{lastpage}
-% Jeff Goldberg:
-% \textit{The \xpackage{lastpage} package};
-% 1994/07/20 v0.1b;
-% \CTANpkg{lastpage}.
-%
-% \bibitem{revtex}
-% APS, AIP, Arthur Orgawa;
-% ReVTeX 4.1;
-% 2009/10/13 v4.1;
-% \url{http://authors.aps.org/revtex4/}.
-%
-% \end{thebibliography}
%
% \begin{History}
% \begin{Version}{2009/12/06 v1.0}
@@ -1434,6 +467,10 @@ and the derived files
% \begin{Version}{2019-12-11 v1.11}
% \item Updated
% \end{Version}
+%
+% \begin{Version}{2024-08-06 v1.12}
+% \item Switch to kernel hooks
+% \end{Version}
% \end{History}
%
% \PrintIndex
diff --git a/Master/texmf-dist/source/latex/babel/babel.dtx b/Master/texmf-dist/source/latex/babel/babel.dtx
index 19db3457599..d71d80d19ac 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/26 v24.7 The Babel package]
+\ProvidesFile{babel.dtx}[2024/10/05 v24.11 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
@@ -50,7 +50,10 @@
{NotoSans-Regular.ttf}
\setmonofont[Scale=.86, FakeStretch=.97]{DejaVu Sans Mono}
\raggedright
-\addtolength{\textwidth}{25pt}
+\setlength{\parindent}{.8em}
+\frenchspacing
+\addtolength{\oddsidemargin}{-2em}
+\addtolength{\textwidth}{25.5pt}
\addtolength{\textheight}{3.5cm}
\addtolength{\topmargin}{-2cm}
\font\manual=logo10 % font used for the METAFONT logo, etc.
@@ -65,7 +68,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 +78,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}
@@ -89,12 +91,17 @@
pdfkeywords={TeX, LaTeX, pdfTeX, LuaTeX, XeTeX, internationalization,
localization}}
\ExplSyntaxOn
+\normalmarginpar
\newcommand\New[1]{%
\regex_extract_once:nnN{(\d\d?)\.(\d\d?)}{#1}\bbltempa
\seq_pop_right:NN\bbltempa\bbltempb
\seq_pop_right:NN\bbltempa\bbltempa
+ \leavevmode%\marginpar
+ {\scriptsize
+ % \enspace
\colorbox[rgb]{.92, .86, .73}%
- {New~#1%
+ {%New~
+ #1%
\quark_if_no_value:NTF\bbltempb{}%
{~
\ifnum\bbltempa>2 \ifnum\bbltempb>34
@@ -106,61 +113,87 @@
\href{https://latex3.github.io/babel/news/%
whats-new-in-babel-\bbltempa.\bbltempb.html}%
{\raisebox{.15ex}{$\oplus$}}%
- \fi}}\enspace\ignorespaces}
+ \fi}}}\enspace\ignorespaces}
\ExplSyntaxOff
\definecolor{thered}{rgb}{0.65,0.04,0.07}
\definecolor{thegrey}{gray}{0.8}
+\definecolor{thegreyed}{gray}{0.6}
\definecolor{shadecolor}{rgb}{1,1,0.97}
\definecolor{messages}{rgb}{.66,.13,.27}
\makeatletter
+\def\@seccntformat#1{%
+ \llap{\makebox[1.7cm][l]{\csname the#1\endcsname.}}%
+ \hspace{-.7cm}}
\def\@begintheorem#1#2{%
\list{}{}%
\global\advance\@listdepth\m@ne
- \item[{\sffamily\bfseries\color{messages}\hspace*{1.3em}%
+ \item[{\sffamily\bfseries\color{messages}\hspace*{1.4em}%\hspace*{2.8em}%
\MakeUppercase{#1}}]}%
\makeatother
\newtheorem{warning}{Warning}
\newtheorem{note}{Note}
\newtheorem{example}{Example}
\newtheorem{troubleshooting}{Troubleshooting}
-\newtheorem{more}{More}
\let\bblxv\verbatim
\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*}%
+ \fboxsep=.8em
+ \begin{snugshade*}%
\ifx\engine\relax\else
- \vskip-1.08\baselineskip
- \leavevmode\llap{\fbox{\footnotesize\textsc{\engine}}\hskip2.8em}%
- \vskip-1.5\baselineskip
+ \vskip-.75\baselineskip
+ \leavevmode\llap{%
+ \fboxsep=2pt\fbox{\scriptsize\textsc{\engine}}\hskip2.8em}%
+ \vskip-1.6\baselineskip
\vskip0pt
\global\let\engine\relax
\fi
- \bblxv\vskip-\baselineskip\vskip2.5\parsep}
-\def\endverbatim{\bblexv\vskip-2\baselineskip\end{shaded*}}
+ \bblxv\vskip0pt }
+\def\endverbatim{%
+ \bblexv\vskip-7.5ex \end{snugshade*}}
\catcode`\_=\active
\def_{\bgroup\let_\egroup\leavevmode\color{thered}}
\def\MacroFont{\fontencoding \encodingdefault \fontfamily\ttdefault
\fontseries\mddefault \fontshape\updefault \small \catcode`\_=\active}
\definecolor{shadecolor}{rgb}{0.96,0.96,0.93}
-\AtBeginDocument{%
- \def\PrintDescribeMacro#1{%
- \strut\MacroFont\color{thered}\normalsize\string#1}}
-\def\Describe#1{%
- \par\penalty-500\vskip3ex\noindent
- \DescribeMacro{#1}\args}
-\def\DescribeOther{\vskip-4ex\Describe}
-\makeatletter
+%
+\makeatletter
+\def\Describe#1#2{%
+ \@startsection{subsubsection}{100}{\z@}%
+ {2.5ex\@plus .7ex \@minus .2ex}%
+ {1.5ex \@plus .2ex}%
+ {\hspace{-2cm}\color{thegreyed}\normalsize\ttfamily}*%
+ {\underline{\strut{\color{thered}\string#1}\color{black}#2}}}
+\def\DescribeOther{\addvspace{-1.5ex}\Describe}
+\AtBeginDocument{\def\DescribeMacro#1{{\ttfamily\color{thered}\string#1}}}
+\def\macro#1{% WIP
+ \if@noskipsec\leavevmode\vskip-1.2\baselineskip\vskip0pt\fi
+ \@startsection{paragraph}{101}{\z@}%
+ {3.25ex \@plus1ex \@minus.2ex}%
+ {-1em}%
+ {\sffamily\bfseries\color{thered}}*{\hspace*{-1em}\string#1}}
+\let\environment\macro
+\def\optstar{%
+ \kern1pt\relax
+ \colorbox{thegrey}{\ttfamily\hskip-.2em*\hskip-.2em}%
+ \kern1pt}
\def\trouble#1{\addcontentsline{tsh}{trouble}{#1}}
\def\listoftroubles{\section*{Troubleshoooting}\@starttoc{tsh}}
\let\l@trouble\l@figure
\let\saved@check@percent\check@percent
\let\check@percent\relax
-\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 +207,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,16 +232,14 @@
\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}
\date{Typeset \today}
\begin{titlepage}
\begin{minipage}[t][0pt]{30cm}
-\vspace{-3cm}\hspace{-7cm}
+\vspace{-3cm}\hspace{-6cm}
\sffamily
\begin{tabular}{p{8cm}p{15cm}}
\cellcolor[rgb]{.86,.73,.67}
@@ -275,6 +306,16 @@ 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.6) describe the ways
+of loading a language, which is usually all you need.
+
+\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,26 +347,35 @@ 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}
-\section{The user interface}\label{U-I}
+\section{The basic user interface}\label{U-I}
+
+There are two ways to load a language with babel, namely, the old good
+‘classical’ one, based on mostly self-contained declarations in a file
+with |ldf| extension, and the ‘modern’ one, based on a brand new
+mechanism based on descriptive |ini| files.
-\subsection{Monolingual documents}
+‘Classical’ doesn’t mean outdated or obsolete. In fact, this is the
+recommended method in most languages where an |ldf| file exists. Below
+is a list of the supported languages. See also
+\href{https://latex3.github.io/%
+babel/guides/which-method-for-which-language.html}{Which
+method for which language} in the \babel{} site.
+
+Basically, what you need is typically:
+\begin{itemize}
+\bfseries
+\item Tell \babel{} which language or languages are required.
+\item With non-Latin scripts and Unicode engines, select a suitable
+font (sec.~\ref{fonts})
+\item In multilingual documents, switch the language in the text body
+(sec.~\ref{selectors}).
+\end{itemize}
+
+\subsection{Monolingual documents: the ‘classical’ way}
In most cases, a single language is required, and then all you need in
\LaTeX{} is to load the package using its standard mechanism for this
@@ -335,15 +385,15 @@ addition, you may want to set the font and input encodings.
Another approach is making the language a global option in order to let
other packages detect and use it. This is the standard way in \LaTeX{}
for an option – in this case a language – to be recognized by several
-packages.
+packages (in other words, \babel{} doesn’t set the languages, it just
+recognizes the options passed to the class or the package).
-Many languages are compatible with \textsf{xetex} and \textsf{luatex}.
-With them you can use \babel{} to localize the documents. When these
-engines are used, the Latin script is covered by default in current
-\LaTeX{} (provided the document encoding is UTF-8), because the font
-loader is preloaded and the font is switched to |lmroman|. Other
-scripts require loading \textsf{fontspec}. You may want to set the font
-attributes with \textsf{fontspec}, too.
+Many languages are compatible with \textsf{xetex} and \textsf{luatex},
+but a few only work with \pdftex. When these engines are used, the
+Latin script is covered by default in current \LaTeX{} (provided the
+document encoding is UTF-8). Other scripts require loading
+\textsf{fontspec}, although \babel{} provides a higher level interface
+(see |\babelfont| below).
\begin{example}
Here is a simple full example for “traditional” \TeX{} engines
@@ -377,11 +427,10 @@ the option |french| and will be able to use it.
\end{example}
\begin{example}
-And now a simple monolingual document in Russian (text from the
-Wikipedia) with \xetex{} or \luatex{}. Note neither \textsf{fontenc}
-nor \textsf{inputenc} are necessary, but the document should be encoded
-in UTF-8 and a so-called Unicode font must be loaded (in this example
-|\babelfont| is used, described below).
+Now a simple monolingual document in Russian (text from the Wikipedia)
+with \xetex{} or \luatex{}. Note neither \textsf{fontenc} nor
+\textsf{inputenc} are necessary, and a so-called Unicode font must be
+loaded (in this example with the help of |\babelfont|, described below).
\setengine{luatex/xetex}
\begin{verbatim}
@@ -402,65 +451,20 @@ _\babelfont{rm}{DejaVu Serif}_
\end{verbatim}
\end{example}
-\begin{troubleshooting}
-\trouble{Paragraph ended before \textbackslash UTFviii@three@octets
-was complete}
-A common source of trouble is a wrong setting of the input encoding.
-Depending on the \LaTeX{} version you can get the following somewhat
-cryptic error:
-\begin{verbatim}
-! Paragraph ended before \UTFviii@three@octets was complete.
-\end{verbatim}
-Or the more explanatory:
-\begin{verbatim}
-! Package inputenc Error: Invalid UTF-8 byte ...
-\end{verbatim}
-Make sure you set the encoding actually used by your editor.
-\end{troubleshooting}
-
\begin{note}
Because of the way \babel{} has evolved, ``language'' can refer to
- (1) a set of hyphenation patterns as preloaded into the format, (2)
- a package option, (3) an |ldf| file, and (4) a name used in the
- document to select a language or dialect. So, a package option
- refers to a language in a generic way -- sometimes it is the actual
- language name used to select it, sometimes it is a file name loading
- a language with a different name, sometimes it is a file name
- loading several languages. Please, read the documentation for
- specific languages for further info.
+ (1) a set of hyphenation patterns as preloaded into the format, (2) a
+ package option, (3) an |ldf| file, and (4) a name used in the
+ document to select a language or dialect. Please, read the
+ documentation for specific languages for further info.
\end{note}
-\begin{troubleshooting}
- The following warning is about hyphenation patterns, which are
- not under the direct control of \babel:
-\trouble{No hyphenation patterns were preloaded for (babel) the
- language `LANG' into the format}
-\begin{verbatim}
-Package babel Warning: No hyphenation patterns were preloaded for
-(babel) the language `LANG' into the format.
-(babel) Please, configure your TeX system to add them and
-(babel) rebuild the format. Now I will use the patterns
-(babel) preloaded for \language=0 instead on input line 57.
-\end{verbatim}
- The document will be typeset, but very likely the text will not be
- correctly hyphenated. Some languages in some system may be raising
- this warning wrongly (because they are not hyphenated) -- just ignore
- it. See the manual of your distribution (Mac\TeX, Mik\TeX, \TeX Live,
- etc.) for further info about how to configure it.
-\end{troubleshooting}
-
\begin{note}
- With \textsf{hyperref} you may want to set the document language with
- something like:
-\begin{verbatim}
-\usepackage[_pdflang=es-MX_]{hyperref}
-\end{verbatim}
-This is not currently done by \babel{} and you must set it by hand. The
-document language can be also set with |\DocumentMetadata|, before
-|\documentclass|; for example:
-\begin{verbatim}
-\DocumentMetadata{_lang=es-MX_}
-\end{verbatim}
+ \Babel{} does not make any readjustments by default in font size,
+ vertical positioning or line height by default. This is on purpose
+ because the optimal solution depends on the document layout and the
+ font, and very likely the most appropriate one is a combination of
+ these settings.
\end{note}
\begin{note}
@@ -472,157 +476,180 @@ document language can be also set with |\DocumentMetadata|, before
\end{note}
\begin{note}
- \Babel{} does not make any readjustments by default in font size,
- vertical positioning or line height by default. This is on purpose
- because the optimal solution depends on the document layout and the
- font, and very likely the most appropriate one is a combination of
- these settings.
+ With \textsf{hyperref} you may want to set the PDF document language
+ with something like:
+\begin{verbatim}
+\usepackage[_pdflang=es-MX_]{hyperref}
+\end{verbatim}
+This is not currently done by \babel{} and you must set it by hand. The
+PDF document language can be also set with |\DocumentMetadata|, before
+|\documentclass|; for example:
+\begin{verbatim}
+\DocumentMetadata{_lang=es-MX_}
+\end{verbatim}
\end{note}
-\subsection{Multilingual documents}
+\begin{warning}
+ In the preamble, \textit{no} language has been selected, except
+ hyphenation patterns and the name assigned to |\localename| (and
+ |\languagename|) (in particular, shorthands, captions and date are not
+ activated). If you need to define boxes and the like in the preamble,
+ you might want to use some of the language selectors described below.
+\end{warning}
-In multilingual documents, just use a list of the required languages as
-package or class options. The last language is considered the main one,
-activated by default. Sometimes, the main language changes the document
-layout (eg, |spanish| and |french|).
+\begin{troubleshooting}
+\trouble{Package inputenc Error: Invalid UTF-8 byte ...}
+\textit{Package inputenc Error: Invalid UTF-8 byte ...}
+A common source of trouble is a wrong setting of the input encoding.
+Make sure you set the encoding actually used by your editor, or
+even better, make sure the encoding in your editor is set to UTF-8.
+\end{troubleshooting}
-\begin{example}
- In \LaTeX, the preamble of the document:
+\begin{troubleshooting}
+Another typical error when using \babel{} is the
+ following:\footnote{In old versions the error read ``You haven't
+ loaded the language LANG yet''.}
+\trouble{Unknown language `LANG'}
\begin{verbatim}
-\documentclass{article}
-\usepackage[dutch,english]{babel}
+! Package babel Error: Unknown language `#1'. Either you have
+(babel) misspelled its name, it has not been installed,
+(babel) or you requested it in a previous run. Fix its name,
+(babel) install it or just rerun the file, respectively. In
+(babel) some cases, you may need to remove the aux file
\end{verbatim}
- would tell \LaTeX\ that the document would be written in two
- languages, Dutch and English, and that English would be the first
- language in use, and the main one.
-\end{example}
+ The most frequent reason is, by far, the latest (for example, you
+ included |spanish|, but you realized this language is not used after
+ all, and therefore you removed it from the option list). In most
+ cases, the error vanishes when the document is typeset again, but in
+ more severe ones you will need to remove the |aux| file.
+\end{troubleshooting}
-You can also set the main language explicitly, but it is discouraged
-except if there is a real reason to do so:
+\begin{troubleshooting}
+\textit{No hyphenation patterns were preloaded...}
+ The following warning is about hyphenation patterns, which are
+ not under the direct control of \babel:
+\trouble{No hyphenation patterns were preloaded for (babel) the
+ language `LANG' into the format}
\begin{verbatim}
-\documentclass{article}
-\usepackage[_main=english_,dutch]{babel}
+Package babel Warning: No hyphenation patterns were preloaded for
+(babel) the language `LANG' into the format.
+(babel) Please, configure your TeX system to add them and
+(babel) rebuild the format. Now I will use the patterns
+(babel) preloaded for \language=0 instead on input line 57.
\end{verbatim}
+ The document will be typeset, but very likely the text will not be
+ correctly hyphenated. Some languages in some system may be raising
+ this warning wrongly (because they are not hyphenated) -- just ignore
+ it. See the manual of your distribution (Mac\TeX, Mik\TeX, \TeX Live,
+ etc.) for further info about how to configure it.
+\end{troubleshooting}
-Examples of cases where |main| is useful are the following.
-
-\begin{example}
-Some classes load \babel{} with a hardcoded language option. Sometimes,
-the main language can be overridden with something like that before
-|\documentclass|:
+\begin{troubleshooting}
+\textit{You are loading directly a language style.}
+Loading directly |sty| files in \LaTeX{} (ie,
+ |\usepackage{<language>}|) was deprecated many years ago 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}
\begin{verbatim}
-\PassOptionsToPackage{main=english}{babel}
+! Package babel Error: You are loading directly a language style.
+(babel) This syntax is deprecated and you must use
+(babel) \usepackage[language]{babel}.
\end{verbatim}
-\end{example}
+\end{troubleshooting}
\begin{note}
- Languages may be set as global and as package option at the same
- time, but in such a case you should set explicitly the main language
- with the package option |main|:
-\begin{verbatim}
-\documentclass[_italian_]{book}
-\usepackage[ngerman,_main=italian_]{babel}
-\end{verbatim}
+ You will see an ‘info’ in the log file stating some data is being
+ loaded from an |ini| file. It includes standardized names for
+ language and script used by |\babelfont|, and the BCP-47 tag, required in
+ some cases by |\Make<Xxxxx>case|.
\end{note}
-\begin{warning}
- In the preamble the main language has \textit{not} been selected,
- except hyphenation patterns and the name assigned to |\languagename|
- (in particular, shorthands, captions and date are not activated). If
- you need to define boxes and the like in the preamble, you might
- want to use some of the language selectors described below.
-\end{warning}
+\subsection{Monolingual documents: the ‘modern’ way}
-To switch the language there are two basic macros, described below in
-detail: |\selectlanguage| is used for blocks of text, while
-|\foreignlanguage| is for chunks of text inside paragraphs.
+When, for whatever reason, the ‘classical’ way with the |ldf| is not
+suitable for the needs of a document or a document system, you have to
+resort to a different mechanism, which is activated with the package
+option |provide=*| (in monolingual documents).
\begin{example}
-A full bilingual document with \pdftex{} follows. The main language is
-|french|, which is activated when the document begins. It assumes UTF-8:
-\setengine{pdftex}
+ Although Georgian has its own \texttt{ldf} file, here is how to
+ declare this language in Unicode engines. Here, as in a previous
+ example, we resort to |\babelfont| to set the font for this language
+ (with the |Harfbuzz| renderer).
+\setengine{luatex/xetex}
\begin{verbatim}
-\documentclass{article}
+\documentclass{book}
-\usepackage[T1]{fontenc}
+\usepackage[_georgian, provide=*_]{babel}
-_\usepackage[english,french]{babel}_
+_\babelfont{rm}[Renderer=Harfbuzz]{DejaVu Sans}_
\begin{document}
-Plus ça change, plus c'est la même chose!
+\tableofcontents
-_\selectlanguage{english}_
+\chapter{სამზარეულო და სუფრის ტრადიციები}
-And an English paragraph, with a short text in
-_\foreignlanguage{french}{français}_.
+ქართული ტრადიციული სამზარეულო ერთ-ერთი უმდიდრესია მთელ მსოფლიოში.
\end{document}
\end{verbatim}
-\end{example}
-
-\begin{example}
- With \xetex{} and \luatex, the following bilingual, single script
- document in UTF-8 encoding just prints a couple of ‘captions’ and
- |\today| in Danish and Vietnamese. No additional packages are
- required, because the default font supports both languages.
-\setengine{luatex/xetex}
+And with a global option:
\begin{verbatim}
-\documentclass{article}
-
-_\usepackage[vietnamese,danish]{babel}_
-
-\begin{document}
-
-\prefacename, \alsoname, \today.
-
-\selectlanguage{vietnamese}
-
-\prefacename, \alsoname, \today.
-
-\end{document}
+\documentclass[_georgian_]{book}
+\usepackage[_provide=*_]{babel}
+\babelfont{rm}[Renderer=Harfbuzz]{DejaVu Sans}
\end{verbatim}
\end{example}
\begin{note}
- Once loaded a language, you can select it with the corresponding
- BCP47 tag. See section \ref{bcp47} for further details.
+ This option actually loads the language with |\babelprovide| and the
+ |import| option, described below. Instead of an asterisk, you may
+ provide a list of options for |\babelprovide| enclosed in braces
+ (|import| is included by default).
\end{note}
-\begin{note}
- Documents with several input encodings are not frequent, but
- sometimes are useful. You can set different encodings for different
- languages as the following example shows:
+\begin{example}
+For a text in Chinese, you can write in the preamble:
+\setengine{luatex/xetex}
\begin{verbatim}
-\addto\extrasfrench{\inputencoding{latin1}}
-\addto\extrasrussian{\inputencoding{koi8-r}}
+\usepackage[_chinese, provide=*_]{babel}
+_\babelfont{rm}{FandolSong}_
\end{verbatim}
-\end{note}
+The skip between characters is 0 pt plus .1 pt, which can be modified
+with an option (explained below) in |provide|. For example:
+\setengine{luatex/xetex}
+\begin{verbatim}
+\usepackage[chinese, provide=_{ intraspace=0 .2 0 }_]{babel}
+\end{verbatim}
+\end{example}
-\subsection{Mostly monolingual documents}
+\subsection{Mostly monolingual documents: lazy loading}
\label{mostlymono}
\New{3.39} Very often, multilingual documents consist of a main
language with small pieces of text in another languages (words, idioms,
short sentences). Typically, all you need is to set the line breaking
-rules and, perhaps, the font. In such a case, \babel{} now does not
-require declaring these secondary languages explicitly, because the
-basic settings are loaded on the fly when the language is selected (and
-also when provided in the optional argument of |\babelfont|, if used).
-
-This is particularly useful, too, when there are short texts of this
-kind coming from an external source whose contents are not known on
-beforehand (for example, titles in a bibliography). At this regard, it
-is worth remembering that |\babelfont| does \textit{not} load any font
-until required, so that it can be used just in case.
+rules and, perhaps, the font. In such a case, there is no need to
+clutter the preamble (particularly the class and package options)
+because \babel{} does not require declaring these secondary languages
+explicitly — the basic settings are loaded on the fly when the language
+is first selected.
+
+This is particularly useful in documents with many languages, and also
+when there are short texts of this kind coming from an external source
+whose contents are not known on beforehand (for example, titles in a
+bibliography). At this regard, it is worth remembering that
+|\babelfont| does \textit{not} load any font until required, so that it
+can be used just in case.
\New{3.84} With \pdftex, when a language is loaded on the fly
-(actually, with |\babelprovide|, because this is the macro used
-internally to load it) selectors now set the font encoding based on the
-list provided when loading |fontenc|. Not all scripts have an
-associated encoding, so this feature works only with Latin, Cyrillic,
-Greek, Arabic, Hebrew, Cherokee, Armenian, and Georgian, provided a
-suitable font is found.
+(internally it's loaded with |\babelprovide|) selectors now set the
+font encoding based on the list provided when loading |fontenc|. Not
+all scripts have an associated encoding, so this feature works only
+with Latin, Cyrillic, Greek, Arabic, Hebrew, Cherokee, Armenian, and
+Georgian, provided a suitable font is found.
\begin{example}
A trivial document with the default font in English and Spanish, and
@@ -641,6 +668,11 @@ _\foreignlanguage{spanish}{Español}_.
\end{document}
\end{verbatim}
+If you need the ‘modern’ way to load the main language set as global
+option, just write:
+\begin{verbatim}
+\usepackage[provide=*]{babel}
+\end{verbatim}
\end{example}
\begin{note}
@@ -651,946 +683,284 @@ _\foreignlanguage{spanish}{Español}_.
for |lubakatanga|). See section \ref{bcp47} for further details.
\end{note}
-\subsection{Modifiers}
+\subsection{Multilingual documents: the ‘classical’ way}
-\New{3.9c} The basic behavior of some languages can be modified when
-loading \babel{} by means of \textit{modifiers}. They are set after
-the language name, and are prefixed with a dot (only when the language
-is set as package option -- neither global options nor the |main| key
-accepts them). An example is (spaces are not significant and they can
-be added or removed):\footnote{No predefined ``axis'' for modifiers
-are provided because languages and their scripts have quite different
-needs.}
-\begin{verbatim}
-\usepackage[latin_.medieval_, spanish_.notilde.lcroman_, danish]{babel}
-\end{verbatim}
+In multilingual documents, just use a list of the required languages
+either as package or as class options. The last language is considered the
+main one, activated by default. Sometimes, the main language changes
+the document layout (eg, |spanish| and |french|).
-Attributes (described below) are considered modifiers, ie, you can
-set an attribute by including it in the list of modifiers.
-
-\New{3.89} Alternatively, modifiers can be set with a separate option,
-with the keyword |modifiers| followed by a dot and the language name
-(note the language is not selected or loaded with this option). It is
-useful to activate some feature when the language is declared as a
-class option:
-\begin{verbatim}
-\documentclass[spanish]{report}
-\usepackage[_modifiers.spanish = notilde.lcroman_]{babel}
-\end{verbatim}
-
-\subsection{Troubleshooting}
-
-\begin{itemize}
-\item Loading directly |sty| files in \LaTeX{} (ie,
- |\usepackage|\marg{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}
-\begin{verbatim}
-! Package babel Error: You are loading directly a language style.
-(babel) This syntax is deprecated and you must use
-(babel) \usepackage[language]{babel}.
-\end{verbatim}
-
-\item Another typical error when using \babel{} is the
- following:\footnote{In old versions the error read ``You haven't
- loaded the language LANG yet''.}
-\trouble{Unknown language `LANG'}
-\begin{verbatim}
-! Package babel Error: Unknown language `#1'. Either you have
-(babel) misspelled its name, it has not been installed,
-(babel) or you requested it in a previous run. Fix its name,
-(babel) install it or just rerun the file, respectively. In
-(babel) some cases, you may need to remove the aux file
-\end{verbatim}
- The most frequent reason is, by far, the latest (for example, you
- included |spanish|, but you realized this language is not used after
- all, and therefore you removed it from the option list). In most
- cases, the error vanishes when the document is typeset again, but in
- more severe ones you will need to remove the |aux| file.
-\end{itemize}
-
-\subsection{Plain}
-
-In e-Plain and pdf-Plain, load languages styles with |\input| and then use
-|\begindocument| (the latter is defined by \babel):
-\begin{verbatim}
-\input estonian.sty
-\begindocument
-\end{verbatim}
-
-\begin{warning}
- Not all languages provide a |sty| file and some of them are not
- compatible with those formats. Please, refer to
- \href{https://latex3.github.io/babel/guides/using-babel-with-plain.html}%
- {Using babel with Plain} for further details.
-\end{warning}
-
-\subsection{Basic language selectors}
-
-This section describes the commands to be used in the document to
-switch the language in multilingual documents. In most cases, only the
-two basic macros |\selectlanguage| and |\foreignlanguage| are
-necessary. The environments |otherlanguage|, |otherlanguage*| and
-|hyphenrules| are auxiliary, and described in the next section.
-
-The main language is selected automatically when the |document|
-environment begins.
-
-\Describe{\selectlanguage}{\marg{language}}
-When a user wants to switch from one language to another he can
-do so using the macro |\selectlanguage|. This macro takes the
-language, defined previously by a language definition file, as
-its argument. It calls several macros that should be defined in
-the language definition files to activate the special definitions
-for the language chosen:
-\begin{verbatim}
-\selectlanguage{german}
-\end{verbatim}
-
-This command can be used as environment, too, in case there are
-relatively short texts and you do not want to reset the language with a
-hardcode value.
-
-\begin{note}
- For ``historical reasons'', a macro name is converted to a language
- name without the leading |\|; in other words,
- |\selectlanguage{\german}| is equivalent to
- |\selectlanguage{german}|. Using a macro instead of a ``real'' name
- is deprecated. \New{3.43} However, if the macro name does not match
- any language, it will get expanded as expected.
-\end{note}
-
-\begin{note}
- Bear in mind |\selectlanguage| can be automatically executed, in some
- cases, in the auxiliary files, at heads and foots, and after the
- environment |otherlanguage*|.
-\end{note}
-
-\begin{warning}
- If used inside braces there might be some non-local changes, as this
- would be roughly equivalent to:
-\begin{verbatim}
-{\selectlanguage{<inner-language>} ...}\selectlanguage{<outer-language>}
-\end{verbatim}
- If you want a change which is really local, you must enclose this
- code with an additional grouping level.
-\end{warning}
-
-\begin{warning}
- There are a couple of issues related to the way the language
- information is written to the auxiliary files:
-\begin{itemize}
- \item |\selectlanguage| should not be used inside some boxed environments
- (like floats or |minipage|) to switch the language if you need the
- information written to the |aux| be correctly synchronized. This
- rarely happens, but if it were the case, you must use
- |otherlanguage| instead.
- \item In addition, this macro inserts a |\write| in vertical mode,
- 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|
- (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
- solution, because nothing is written, but more often than not this
- command is applied to more or less shorts texts with no sectioning
- or similar commands, and therefore no language synchronization is
- necessary). In a table cell, a |\leavevmode| just before the
- selector may be enough.
-\end{itemize}
-\end{warning}
-
-\Describe{\foreignlanguage}{\oarg{option-list}\marg{language}\marg{text}}
-
-The command |\foreignlanguage| takes two arguments; the second argument
-is a phrase to be typeset according to the rules of the language named
-in its first one.
-
-This command (1) only switches the extra definitions and the
-hyphenation rules for the language, \emph{not} the names and dates, (2)
-does not send information about the language to auxiliary files (i.e.,
-the surrounding language is still in force), and (3) it works even if
-the language has not been set as package option (but in such a case it
-only sets the hyphenation patterns and a warning is shown). With the
-|bidi| option, it also enters in horizontal mode (this is not done
-always for backwards compatibility), and since it is meant for phrases
-only the text direction (and not the paragraph one) is set.
-
-\New{3.44} As already said, captions and dates are not switched.
-However, with the optional argument you can switch them, too. So, you
-can write:
-\begin{verbatim}
-\foreignlanguage[date]{polish}{\today}
-\end{verbatim}
-In addition, captions can be switched with |captions| (or both, of
-course, with |date,| |captions|). Until 3.43 you had to write something
-like |{\selectlanguage{..} ..}|, which was not always the most
-convenient way.
-
-\begin{note}
- |\bibitem| is out of sync with |\selectlanguage| in the \file{.aux}
- file. The reason is |\bibitem| uses |\immediate| (and others, in
- fact), while |\selectlanguage| doesn't. There is a similar issue with
- floats, too. There is no known workaround.
-\end{note}
-
-\subsection{Auxiliary language selectors}
-
-\Describe{\begin\menv{otherlanguage}}{\marg{language}\Eenv{otherlanguage}}
-
-The environment \Lenv{otherlanguage} does basically the same as
-|\selectlanguage|, except that language change is (mostly) local to
-the environment.
-
-Actually, there might be some non-local changes, as this environment
-is roughly equivalent to:
-\begin{verbatim}
-\begingroup
-\selectlanguage{<inner-language>}
-...
-\endgroup
-\selectlanguage{<outer-language>}
-\end{verbatim}
-If you want a change which is really local, you must enclose this
-environment with an additional grouping, like braces |{}|.
-
-Spaces after the environment are ignored.\footnote{Very likely, and
-because of the limitations of many old editors with bidi text, the idea
-was \cs{end}\texttt{\{otherlanguage\}} had to be a line by itself.} If this
-behavior is not desired, you may use the environment
-\texttt{selectlanguage}.
-
-\begin{warning}
- Being similar to |\selectlanguage|, the warning above about the
- internal |\write| also applies here. The current mode (vertical or
- horizontal) is also not changed.
-\end{warning}
-
-\Describe{\begin\menv{otherlanguage*}}%
-{\oarg{option-list}\marg{language}\Eenv{otherlanguage*}}
-
-Same as |\foreignlanguage| but as environment. Spaces after the
-environment are \textit{not} ignored.
-
-This environment was originally intended for intermixing left-to-right
-typesetting with right-to-left typesetting in engines not supporting a
-change in the writing direction inside a line. However, by default it
-never complied with the documented behavior and it is just a version as
-environment of |\foreignlanguage|, except when the option |bidi| is
-set -- in this case, |\foreignlanguage| emits a |\leavevmode|, while
-|otherlanguage*| does not.
-
-\subsection{More on selection}
-
-\Describe{\babeltags}{\char`\{\m{tag1} \texttt{=} \m{language1}, \m{tag2}
-\texttt{=} \m{language2}, \dots\char`\}}
-
-\New{3.9i} In multilingual documents with many language-switches the
-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
-group.
-
-\begin{warning}
- There is a clear drawback to this feature, namely, the ‘prefix’
- |\text...| is heavily overloaded in \LaTeX{} and conflicts with
- existing macros may arise (|\textlatin|, |\textbar|, |\textit|,
- |\textcolor| and many others). The same applies to environments,
- because |arabic| conflicts with |\arabic|. Furthermore, and because of
- this overloading, detecting the language of a chunk of text by
- external tools can become unfeasible (is |\textga| the locale for the
- African language Gã or something else?). Except if there is a reason for
- this ‘syntactical sugar’, the best option is to stick to the default
- selectors or even to define your own alternatives.
-\end{warning}
+To switch the language there are two basic macros, described below in
+detail: |\selectlanguage| is used for blocks of text, while
+|\foreignlanguage| is for chunks of text inside paragraphs.
\begin{example}
-With
-\begin{verbatim}
-\babeltags{de = german}
-\end{verbatim}
-you can write
-\begin{verbatim}
-text \textde{German text} text
-\end{verbatim}
-and
+ In \LaTeX, the preamble of the document:
\begin{verbatim}
-text
-\begin{de}
- German text
-\end{de}
-text
+\documentclass{article}
+\usepackage[dutch,english]{babel}
\end{verbatim}
+ would tell \LaTeX\ that the document would be written in two
+ languages, Dutch and English, and that English would be the first
+ language in use, and the main one.
\end{example}
-\begin{note}
- Something like \verb|\babeltags{finnish = finnish}| is legitimate --
- it defines |\textfinnish| and |\finnish| (and, of course,
- |\begin{finnish}|).
-\end{note}
-
-\Describe{\babelensure}{|[include=|\m{commands}|,exclude=|\m{commands}%
- |,fontenc=|\m{encoding}|]|\marg{language}}
-
-\New{3.9i} Except in a few languages, like \textsf{russian},
-captions and dates are just strings, and do not switch the
-language. That means you should set it explicitly if you want to use
-them, or hyphenation (and in some cases the text itself) will be
-wrong. For example:
-\begin{verbatim}
-\foreignlanguage{russian}{text \foreignlanguage{polish}{\seename} text}
-\end{verbatim}
-
-Of course, \TeX{} can do it for you. To avoid switching the language
-all the while, |\babelensure| redefines the captions for a given
-language to wrap them with a selector:
-\begin{verbatim}
-\babelensure{polish}
-\end{verbatim}
-By default only the basic captions and |\today| are redefined, but you
-can add further macros with the key |include| in the optional argument
-(without commas). Macros not to be modified are listed in
-|exclude|. You can also enforce a font encoding with the option
-|fontenc|.\footnote{With it, encoded strings may not work as expected.}
-A couple of examples:
-\begin{verbatim}
-\babelensure[include=\Today]{spanish}
-\babelensure[fontenc=T5]{vietnamese}
-\end{verbatim}
-
-They are activated when the language is selected (at the |afterextras|
-event), and it makes some assumptions which could not be fulfilled in
-some languages. Note also you should include only macros defined by
-the language, not global macros (eg, |\TeX| of |\dag|).
-
-With |ini| files (see below), captions are ensured by default.
-
-\subsection{Shorthands}
-
-A \textit{shorthand} is a sequence of one or two characters that
-expands to arbitrary \TeX{} code.
-
-Shorthands can be used for different kinds of things; for example:
-(1) in some languages shorthands such as |"a| are defined to be able
-to hyphenate the word if the encoding is |OT1|; (2) in some languages
-shorthands such as |!| are used to insert the right amount of white
-space; (3) several kinds of discretionaries and breaks can be inserted
-easily with |"-|, |"=|, etc.
-
-The package \textsf{inputenc} as well as \xetex{} and \luatex{} have
-alleviated entering non-ASCII characters, but minority languages and
-some kinds of text can still require characters not directly available
-on the keyboards (and sometimes not even as separated or precomposed
-Unicode characters). As to the point 2, now \textsf{pdfTeX} provides
-|\knbccode|, and \luatex{} can manipulate the glyph list. Tools for
-point 3 can be still very useful in general.
-
-There are four levels of shorthands: \textit{user}, \textit{language},
-\textit{system}, and \textit{language user} (by order of precedence).
-In most cases, you will use only shorthands provided by languages.
-
-\begin{note} Keep in mind the following:
-\begin{enumerate}
-\item Activated chars used for two-char shorthands cannot be followed
- by a closing brace |}| and the spaces following are gobbled. With
- one-char shorthands (eg,~|:|), they are preserved.
-\item If on a certain level (system, language, user, language user)
- there is a one-char shorthand, two-char ones starting with that char
- and on the same level are ignored.
-\item Since they are active, a shorthand cannot contain the same
- character in its definition (except if deactivated with, eg,
- |\string|).
-\end{enumerate}
-\end{note}
-
-\begin{troubleshooting}
-\trouble{Argument of \textbackslash language@active@arg"
-has an extra \textbraceright}
-A typical error when using shorthands is the following:
-\begin{verbatim}
-! Argument of \language@active@arg" has an extra }.
-\end{verbatim}
-It means there is a closing brace just after a shorthand, which is not
-allowed (eg,~|"}|). Just add |{}| after (eg,~|"{}}|).
-\end{troubleshooting}
-
-\Describe{\shorthandon}{\marg{shorthands-list}}
-\DescribeOther{\shorthandoff}{%
-\colorbox{thegrey}{\ttfamily\hskip-.2em*\hskip-.2em}%
-\marg{shorthands-list}}
-It is sometimes necessary to switch a shorthand
-character off temporarily, because it must be used in an
-entirely different way. For this purpose, the user commands
-|\shorthandoff| and |\shorthandon| are provided. They each take a
-list of characters as their arguments.
-
-The command |\shorthandoff| sets the |\catcode| for each of the
-characters in its argument to other (12); the command |\shorthandon|
-sets the |\catcode| to active (13). Both commands only work on `known'
-shorthand characters, and an error will be raised otherwise. You can
-check if a character is a shorthand with |\ifbabelshorthand| (see
-below).
-
-\New{3.9a} However, |\shorthandoff| does not behave as
-you would expect with characters like |~| or |^|, because they
-usually are not ``other''. For them |\shorthandoff*| is provided,
-so that with
+\begin{example}
+A full bilingual document with \pdftex{} follows. The main language is
+|french|, which is activated when the document begins. It assumes UTF-8:
+\setengine{pdftex}
\begin{verbatim}
-\shorthandoff*{~^}
-\end{verbatim}
-|~| is still active, very likely with the meaning of a non-breaking
-space, and |^| is the superscript character. The catcodes used are
-those when the shorthands are defined, usually when language files are
-loaded.
-
-If you do not need shorthands, or prefer an alternative approach of
-your own, you may want to switch them off with the package option
-|shorthands=off|, as described below.
-
-\begin{warning}
- It is worth emphasizing these macros are meant for temporary changes.
- Whenever possible and if there are not conflicts with other packages,
- shorthands must be always enabled (or disabled).
-\end{warning}
-
-\Describe{\useshorthands}{%
-\colorbox{thegrey}{\ttfamily\hskip-.2em*\hskip-.2em}%
-\marg{char}}
-
-The command |\useshorthands| initiates the definition of user-defined
-shorthand sequences. It has one argument, the character that starts
-these personal shorthands.
+\documentclass{article}
-\New{3.9a} User shorthands are not always alive, as they may
-be deactivated by languages (for example, if you use |"| for your user
-shorthands and switch from \textsf{german} to \textsf{french}, they
-stop working). Therefore, a starred version
-|\useshorthands*|\marg{char} is provided, which makes sure shorthands
-are always activated.
+\usepackage[T1]{fontenc}
-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
+_\usepackage[english,french]{babel}_
-\Describe\defineshorthand{\texttt{[}\langlist\texttt{]}%
- \marg{shorthand}\marg{code}}
+\begin{document}
-The command |\defineshorthand| takes two arguments: the first is
-a one- or two-character shorthand sequence, and the second is the
-code the shorthand should expand to.
+Plus ça change, plus c'est la même chose!
-\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
-are (re)defined.
+_\selectlanguage{english}_
-User shorthands override language ones, which in turn override
-system shorthands. Language-dependent user shorthands (new in
-3.9) take precedence over ``normal'' user shorthands.
+And an English paragraph, with a short text in
+_\foreignlanguage{french}{français}_.
-\begin{example}
- Let's assume you want a unified set of shorthand for discretionaries
- (languages do not define shorthands consistently, and |"-|, |\-|,
- |"=| have different meanings). You can start with, say:
-\begin{verbatim}
-\useshorthands*{"}
-\defineshorthand{"*}{\babelhyphen{soft}}
-\defineshorthand{"-}{\babelhyphen{hard}}
-\end{verbatim}
- However, the behavior of hyphens is language-dependent. For example, in
- languages like Polish and Portuguese, a hard hyphen inside compound
- words are repeated at the beginning of the next line. You can then
- set:
-\begin{verbatim}
-\defineshorthand[*polish,*portuguese]{"-}{\babelhyphen{repeat}}
+\end{document}
\end{verbatim}
- Here, options with |*| set a language-dependent user shorthand,
- which means the generic one above only applies for the rest of
- languages; without |*| they would (re)define the language shorthands
- instead, which are overridden by user ones.
-
- Now, you have a single unified shorthand (|"-|), with a
- content-based meaning (`compound word hyphen') whose visual behavior
- is that expected in each context.
\end{example}
-\Describe{\languageshorthands}{\marg{language}} The command
-|\languageshorthands| can be used to switch the shorthands on the
-language level. It takes one argument, the name of a language or
-|none| (the latter does what its name suggests).\footnote{Actually,
-any name not corresponding to a language group does the same as
-\texttt{none}. However, follow this convention because it might be
-enforced in future releases of \babel{} to catch possible errors.}
-Note that for this to work the language should have been specified as
-an option when loading the \babel\ package. For example, you can use
-in \textsf{english} the shorthands defined by \textsf{ngerman} with
-\begin{verbatim}
-\addto\extrasenglish{\languageshorthands{ngerman}}
-\end{verbatim}
-(You may also need to activate them as user shorthands in the preamble
-with, for example, |\useshorthands| or |\useshorthands*|.)
-
\begin{example}
- Very often, this is a more convenient way to deactivate shorthands
- than |\shorthandoff|, for example if you want to define a macro
- to easy typing phonetic characters with \textsf{tipa}:
+ With \xetex{} and \luatex, the following bilingual, single script
+ document in UTF-8 encoding just prints a couple of ‘captions’ and
+ |\today| in Danish and Vietnamese. No additional packages are
+ required, because the default font supports both languages.
+\setengine{luatex/xetex}
\begin{verbatim}
-\newcommand{\myipa}[1]{{_\languageshorthands{none}_\tipaencoding#1}}
-\end{verbatim}
-\end{example}
-
-\Describe{\babelshorthand}{\marg{shorthand}}
-With this command you can use a shorthand even if (1) not activated in
-\texttt{shorthands} (in this case only shorthands for the current
-language are taken into account, ie, not user shorthands), (2) turned
-off with |\shorthandoff| or (3) deactivated with the internal
-|\bbl@deactivate|; for example, \verb|\babelshorthand{"u}| or
-\verb|\babelshorthand{:}|. (You can conveniently define your own
-macros, or even your own user shorthands provided they do not overlap.)
+\documentclass{article}
-\begin{example}
- Since by default shorthands are not activated until
- |\begin{document}|, you may use this macro when defining the |\title|
- in the preamble:
-\begin{verbatim}
-\title{Documento científico_\babelshorthand{"-}_técnico}
-\end{verbatim}
-\end{example}
+_\usepackage[vietnamese,danish]{babel}_
-\bigskip
+\begin{document}
-For your records, here is a list of shorthands, but you must double
-check them, as they may change:\footnote{Thanks to Enrico Gregorio}
+Danish: \prefacename, \alsoname, \today.
-\begin{description}
-\itemsep=-\parskip
-\item[Languages with no shorthands] Croatian, English (any variety),
- Indonesian, Hebrew, Interlingua, Irish, Lower Sorbian, Malaysian,
- North Sami, Romanian, Scottish, Welsh
-\item[Languages with only \texttt{"} as defined shorthand character]
- Albanian, Bulgarian, Danish, Dutch, Finnish, German (old and new
- orthography, also Austrian), Icelandic, Italian, Norwegian, Polish,
- Portuguese (also Brazilian), Russian, Serbian (with Latin script),
- Slovene, Swedish, Ukrainian, Upper Sorbian
-\item[Basque] |" ' ~|
-\item[Breton] |: ; ? !|
-\item[Catalan] |" ' `|
-\item[Czech] |" -|
-\item[Esperanto] |^|
-\item[Estonian] |" ~|
-\item[French] (all varieties) |: ; ? !|
-\item[Galician] |" . ' ~ < >|
-\item[Greek] (ancient, polutoniko, only 8-bit \TeX) |~|, (optional, see
-the manual for Greek) |;|
-\item[Hungarian] |`|
-\item[Kurmanji] |^|
-\item[Latin] |" ^ =|
-\item[Slovak] |" ^ ' -|
-\item[Spanish] |" . < > ' ~|
-\item[Turkish] |: ! =|
-\end{description}
-In addition, the \babel{} core declares |~| as a one-char shorthand
-which is let, like the standard |~|, to a non breaking
-space.\footnote{This declaration serves to nothing, but it is
-preserved for backward compatibility.}
+\selectlanguage{vietnamese}
-\Describe\ifbabelshorthand{\marg{character}\marg{true}\marg{false}}
+Vietnamese: \prefacename, \alsoname, \today.
-\New{3.23} Tests if a character has been made a shorthand.
+\end{document}
+\end{verbatim}
+\end{example}
\begin{note}
- \catcode`\|=12\relax Both \textsf{ltxdoc} and \textsf{babel} use
- \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
+ Although strongly discouraged, languages can be set as global and as
+ package option at the same time, but in such a case you should set
+ explicitly the main language with the package option |main|,
+ described below:
\begin{verbatim}
-\AtBeginDocument{\DeleteShortVerb{\|}}
+\documentclass[_italian_]{book}
+\usepackage[ngerman,_main=italian_]{babel}
\end{verbatim}
- \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
- with the correct catcodes for \verb/|/ and
- \verb|:|).\catcode`\|=\active
\end{note}
-\subsection{Package options}
-
-\New{3.9a}
-These package options are processed before language options, so
-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
-file, so that they are also available in the preamble.
-
-\Describe{activeacute}{} For some languages \babel\ supports this
-options to set |'| as a shorthand in case it is not done by default.
-
-\Describe{activegrave}{}
-Same for |`|.
+\begin{note}
+ Once loaded a language, you can select it with the corresponding
+ BCP47 tag. See section \ref{bcp47} for further details.
+\end{note}
-\Describe{shorthands=}{\meta{char}\meta{char}...
-$\string|$ \texttt{off}}
-The only language shorthands activated
-are those given, like, eg:
+\begin{note}
+ Documents with several input encodings are not frequent, but
+ sometimes are useful. You can set different encodings for different
+ languages as the following example shows:
\begin{verbatim}
-\usepackage[esperanto,french,_shorthands=:;!?_]{babel}
+\addto\extrasfrench{\inputencoding{latin1}}
+\addto\extrasrussian{\inputencoding{koi8-r}}
\end{verbatim}
-If \verb|'| is included, \texttt{activeacute} is set; if \verb|`| is
-included, \texttt{activegrave} is set. Active characters (like
-\verb|~|) should be preceded by \verb|\string| (otherwise they will be
-expanded by \LaTeX{} before they are passed to the package and
-therefore they will not be recognized); however, |t| is provided for
-the common case of |~| (as well as |c| for not so common case of the
-comma).
-
-With |shorthands=off| no language shorthands are defined,
-As some languages use this mechanism for tools not available
-otherwise, a macro \verb|\babelshorthand| is defined, which allows
-using them; see above.
-
-\Describe{safe=}{\texttt{none} $\string|$ \texttt{ref} $\string|$
-\texttt{bib}} Some \LaTeX{} macros are redefined so that using
-shorthands is safe. With \texttt{safe=bib} only |\nocite|, |\bibcite|
-and |\bibitem| are redefined. With |safe=ref| only |\newlabel|, |\ref|
-and |\pageref| are redefined (as well as a few macros from
-\textsf{varioref} and \textsf{ifthen}).
-
-With |safe=none| no macro is redefined. This option is strongly
-recommended, because a good deal of incompatibilities and errors are
-related to these redefinitions. As of \New{3.34}, in $\epsilon$\TeX{}
-based engines (ie, almost every engine except the oldest ones)
-shorthands can be used in these macros (formerly you could not).
-
-\Describe{math=}{\texttt{active} $\string|$ \texttt{normal}}
-Shorthands are mainly intended for text, not for math. By setting this
-option with the value |normal| they are deactivated in math mode
-(default is |active|) and things like |${a'}$| (a closing brace after
-a shorthand) are not a source of trouble anymore.
-
-\Describe{config=}{\meta{file}} Load \meta{file}\texttt{.cfg} instead
-of the default config file |bblopts.cfg| (the file is loaded even
-with |noconfigs|).
-
-\Describe{main=}{\meta{language}} Sets the main language, as explained
-above, ie, this language is always loaded last. If it is not given as
-package or global option, it is added to the list of requested
-languages.
-
-\Describe{headfoot=}{\meta{language}} By default, headlines and
-footlines are not touched (only marks), and if they contain
-language-dependent macros (which is not usual) there may be unexpected
-results. With this option you may set the language in heads and foots.
-An alternative is to set the language explicitly when heads and foots
-are redefined.
-
-\Describe{noconfigs}{} Global and language default config files are
-not loaded, so you can make sure your document is not spoilt by an
-unexpected \texttt{.cfg} file. However, if the key |config| is set,
-this file is loaded.
-
-\Describe{showlanguages}{} Prints to the log the list of languages
-loaded when the format was created: number (remember dialects can
-share it), name, hyphenation file and exceptions file.
-
-% \Describe{nocase}{} \New{3.9l} Language settings for uppercase and
-% lowercase mapping (as set by |\SetCase|) are ignored. Use only if there
-% are incompatibilities with other packages.
-
-\Describe{silent}{} \New{3.9l} No warnings and no \textit{infos} are
-written to the log file.\footnote{You can use alternatively the
-package \textsf{silence}.}
-
-\Describe{hyphenmap=}{\texttt{off} $\string|$ \texttt{first}
-$\string|$ \texttt{select} $\string|$ \texttt{other} $\string|$
-\texttt{other*}}
-
-\New{3.9g} Sets the behavior of case mapping for hyphenation,
-provided the language defines it.\footnote{Turned off in plain.} It
-can take the following values:
-\begin{description}
-\renewcommand\makelabel[1]{%
- \hspace\labelsep\normalfont\ttfamily\color{thered}#1}
-\itemsep=-\parskip
-\item[off] deactivates this feature and no case mapping is applied;
-\item[first] sets it at the first switching commands in the
- current or parent scope (typically, when the aux file is first read
- and at |\begin{document}|, but also the first |\selectlanguage| in
- the preamble), and it's the default if a single
- language option has been stated;\footnote{Duplicated options count
- as several ones.}
-\item[select] sets it only at |\selectlanguage|;
-\item[other] also sets it at |otherlanguage|;
-\item[other*] also sets it at |otherlanguage*| as well as in heads and
- foots (if the option |headfoot| is used) and in auxiliary files (ie,
- at |\select@language|), and it's the default if several language
- options have been stated. The option |first| can be regarded as an
- optimized version of \texttt{other*} for monolingual
- documents.\footnote{Providing |foreign| is pointless, because the
- case mapping applied is that at the end of the paragraph, but if either
- \xetex{} or \luatex{} change this behavior it might be added. On
- the other hand, |other| is provided even if I [JBL] think it isn't
- really useful, but who knows.}
-\end{description}
-
-\Describe{bidi=}{\texttt{default} $\string|$ \texttt{basic}
- $\string|$ \texttt{basic-r} $\string|$ \texttt{bidi-l} $\string|$
- \texttt{bidi-r}}
-
-\New{3.14} Selects the bidi algorithm to be used in \luatex{} and
-\xetex{}. See sec.~\ref{bidi}.
-
-\Describe{layout=}{}
-
-\New{3.16} Selects which layout elements are adapted in bidi
-documents. See sec.~\ref{bidi}.
-
-\Describe{provide=}{\texttt{*}}
-\New{3.49} An alternative to |\babelprovide| for languages passed as
-options. See section~\ref{inifiles}, which describes also the variants
-|provide+=| and |provide*=|.
+\end{note}
-\subsection{The \texttt{base} option}
+\subsection{Languages supported by \babel{} in the ‘classical’ mode}
-With this package option \babel{} just loads some basic macros (mainly
-the selectors), defines |\AfterBabelLanguage| and exits. It also
-selects the hyphenation patterns for the last language passed as option
-(by its name in |language.dat|). There are two main uses: classes and
-packages, and as a last resort in case there are, for some reason,
-incompatible languages. It can be used if you just want to select the
-hyphenation patterns of a single language, too.
+(To be updated.) In the following table most of the languages supported
+by \babel{} with an |.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).
-\Describe\AfterBabelLanguage{\marg{option-name}\marg{code}}
+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}).
-This command is currently the only provided by |base|. Executes
-\meta{code} when the file loaded by the corresponding package option
-is finished (at |\ldf@finish|). The setting is global. So
-\begin{verbatim}
-\AfterBabelLanguage{french}{...}
-\end{verbatim}
-does ... at the end of |french.ldf|. It can be used in |ldf| files,
-too, but in such a case the code is executed only if
-\meta{option-name} is the same as |\CurrentOption| (which could not
-be the same as the option name as set in |\usepackage|!).
+\begingroup
-\begin{example}
- Consider two languages \textsf{foo} and \textsf{bar} defining the
- same |\macro| with |\newcommand|. An error is raised if you attempt
- to load both. Here is a way to overcome this problem:
-\begin{verbatim}
-\usepackage[base]{babel}
-\AfterBabelLanguage{foo}{%
- \let\macroFoo\macro
- \let\macro\relax}
-\usepackage[foo,bar]{babel}
-\end{verbatim}
-\end{example}
+\bigskip\hrule\nobreak
-\begin{note}
- With a recent version of \LaTeX, an alternative method to execute
- some code just after an |ldf| file is loaded is with |\AddToHook| and
- the hook |file/<language>.ldf/after|. \Babel{} does not predeclare
- it, and you have to do it yourself with |\ActivateGenericHook|.
-\end{note}
+\makeatletter
+\def\tag#1{\par\@hangfrom{\makebox[10em][l]{#1}}\ignorespaces}
+\def\tag#1#2{\par
+ \hspace{-2em}\textcolor{thered}{\texttt{#1}}#2\enspace}
+\def\subtag#1#2{\par
+ \hspace{-1em}\texttt{#1}#2\enspace}
+\def\subtagalt#1#2{\par
+ \hspace{-1em}\textcolor{thered}{\texttt{#1}}#2\enspace}
+\def\tagmin#1#2{\par
+ \hspace{-2em}\textcolor[gray]{.4}{\texttt{#1}}#2\enspace}
+\def\subtagmin#1#2{\par
+ \hspace{-1em}\textcolor[gray]{.4}{\texttt{#1}}#2\enspace}
+\def\note#1{\par{\footnotesize#1\par}}
+\small
-\begin{warning}
- Currently this option is not compatible with languages loaded on the
- fly.
-\end{warning}
+\bigskip
-\subsection{\texttt{ini} files}
-\label{inifiles}
+\textit{This list is still under revision.}\\
+Recommended names are set in \textcolor{thered}{red}.\\
+Additional languages are set in \textcolor[gray]{.4}{gray}.\\
+Discouraged and deprecated names are not included.\\
+There are some notes in a few languages.
-An alternative approach to define a language (or, more precisely, a
-\textit{locale}) is by means of an \texttt{ini} file. Currently
-\babel{} provides about 380 of these files containing the basic data
-required for a locale, covering about 300 languages, plus basic
-templates for about 400 locales.
+\bigskip\hrule\nobreak
-|ini| files are not meant only for \babel, and they has been devised as
-a resource for other packages. To easy interoperability between \TeX{}
-and other systems, they are identified with the BCP 47 codes as
-preferred by the Unicode Common Locale Data Repository, which was
-used as source for most of the data provided by these files, too (the
-main exception being the |\...name| strings).
+\begin{multicols}{2}
+\leftskip2em\parindent0pt
+\tag{afrikaans}{}
+\tag{albanian}{}
+\tag{arabic}{}
+\tag{azerbaijani}{}
+\tag{basque}{}
+\tag{belarusian}{}
+\tag{bosnian}{}
+\tag{breton}{}
+\tag{bulgarian}{}
+\tag{catalan}{}
+\tag{croatian}{}
+\tag{czech}{}
+\tag{danish}{}
+\tag{dutch}{}
+\tag{english}{}
+\subtagalt{american}{}
+\subtag{USenglish}{}{}
+\subtagalt{australian}{}
+\subtagalt{british}{}
+\subtag{UKenglish}{}
+\subtagalt{canadian}{}
+\subtagalt{newzealand}{}
+\tag{esperanto}{}
+\tag{estonian}{}
+\tagmin{ethiop}{} %%%%%%
+\tag{farsi}{}
+\tag{finnish}{}
+\tag{french}{}
+\subtagalt{acadian}{}
+\tag{friulian}{}
+\tag{galician}{}
+\tag{georgian}{}
+\tag{german}{}
+\note{This block refers to the old ortography. For the modern one, use
+the names in the block \textsf{ngerman}.}
+\subtagalt{austrian}{}
+\subtagalt{swissgerman}{}
+\note{Swiss High German}
+\tag{greek}{}
+% \subtagalt{polutonicogreek}{}
+\subtagmin{ibycus}{}
+\subtagmin{bgreek}{}
+\tag{hebrew}{}
+\tag{hindi}{}
+\tag{hungarian}{}
+\subtag{magyar}{}
+\tag{icelandic}{}
+\tag{indonesian}{}
+\tag{interlingua}{}
+\tag{irish}{}
+\tag{italian}{}
+\tag{japanese}{}
+\tag{kurmanji}{}
+\tag{latin}{}
+% \subtagalt{classiclatin}{}
+% \subtagalt{medievallatin}{}
+% \subtagalt{ecclesiasticlatin}{}
+\tag{latvian}{}
+\tag{lithuanian}{}
+\tag{lowersorbian}{}
+\tag{macedonian}{}
+\tag{malay}{}
+\tag{mongolian}{}
+\tag{ngerman}{}
+\note{This block refers to the new ortography.}
+\subtagalt{naustrian}{}
+\subtagalt{nswissgerman}{}
+\note{Swiss High German}
+\tag{northernsami}{}
+\tag{norwegian}{}
+\subtag{norsk}{}
+\tag{nynorsk}{}
+\tag{occitan}{}
+\tag{piedmontese}{}
+\tagmin{pinyin}{}
+\tag{polish}{}
+\tag{portuguese}{}
+\subtagalt{brazilian}{}
+\tag{romanian}{}
+\tag{romansh}{}
+\tag{russian}{}
+\tag{scottishgaelic}{}
+\note{Preferred to \texttt{scottish}}
+\tag{serbian}{}
+\note{Latin script}
+\subtagalt{serbianc}{}
+\note{Cyrillic script}
+\tag{slovak}{}
+\tag{slovene}{}
+\tag{slovenian}{} %%%%%% <- and ini
+\tag{spanglish}{}
+\tag{spanish}{}
+\tag{swedish}{}
+\tag{thai}{}
+\subtagmin{thaicjk}{}
+\tag{turkish}{}
+\tag{turkmen}{}
+\tag{ukrainian}{}
+\tag{uppersorbian}{}
+\tag{vietnamese}{}
+\tag{welsh}{}
+\end{multicols}
+\endgroup
+\hrule
+\bigskip
-Most of them set the date, and many also the captions (Unicode and
-LICR). They will be evolving with the time to add more features
-(something to keep in mind if backward compatibility is important). The
-following section shows how to make use of them by means of
-|\babelprovide|. In other words, |\babelprovide| is mainly meant as
-alternative when the |ldf| does not exists or does not work as
-expected, and for secondary tasks.
+% \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}
\begin{example}
- Although Georgian has its own \texttt{ldf} file, here is how to
- declare this language with an |ini| file in Unicode engines.
-\setengine{luatex/xetex}
+ An example of a language requiring a preprocessor and a separate
+ package is \texttt{hindi}. If you have got the
+ \textsf{velthuis/devnag} package, create a file with
+ extension |.dn|:
\begin{verbatim}
-\documentclass{book}
-
-\usepackage{babel}
-_\babelprovide[import, main]{georgian}_
-
-\babelfont{rm}[Renderer=Harfbuzz]{DejaVu Sans}
-
+\documentclass{article}
+\usepackage[hindi]{babel}
\begin{document}
-
-\tableofcontents
-
-\chapter{სამზარეულო და სუფრის ტრადიციები}
-
-ქართული ტრადიციული სამზარეულო ერთ-ერთი უმდიდრესია მთელ მსოფლიოში.
-
+{\dn devaanaa.m priya.h}
\end{document}
\end{verbatim}
+ Then preprocess it with |devnag| \m{file}, which creates
+ \m{file}|.tex|; you can then typeset the latter with \LaTeX.
\end{example}
-\begin{more}
- There is an example of how to use an |ini| template file
- \href{https://github.com/latex3/babel/issues/176#issuecomment-1080846575}{here},
- for Phoenician (although currently this locale is bundled with
- \babel).
-\end{more}
-
-\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’
-applying the basic features, which in this case means |import,| |main|.
-There are (currently) three options:
-\begin{itemize}
-\item |provide=*| is the option just explained, for the main language;
-\item |provide+=*| is the same for additional languages (the main
- language is still the |ldf| file);
-\item |provide*=*| is the same for all languages, ie, main and
- additional.
-\end{itemize}
-
-\begin{example}
- The preamble in the previous example can be more compactly written
- as:
-\begin{verbatim}
-\documentclass{book}
-\usepackage[_georgian, provide=*_]{babel}
-\babelfont{rm}[Renderer=Harfbuzz]{DejaVu Sans}
-\end{verbatim}
-Or also:
-\begin{verbatim}
-\documentclass[_georgian_]{book}
-\usepackage[_provide=*_]{babel}
-\babelfont{rm}[Renderer=Harfbuzz]{DejaVu Sans}
-\end{verbatim}
-\end{example}
-
-\begin{note}
- The \texttt{ini} files just define and set some parameters, but the
- corresponding behavior is not always implemented. Also, there are
- some limitations in the engines. A few remarks follow (which could no
- longer be valid when you read this manual, if the packages involved
- have been updated). The Harfbuzz renderer still has some issues, so as
- a rule of thumb prefer the default renderer, and resort to Harfbuzz
- 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[hindi]{rm}[Renderer=Harfbuzz]{FreeSerif}
-\end{verbatim}
-\begin{description}
-\itemsep=-\parskip
-\item[Arabic] Monolingual documents mostly work in \luatex, but it must
- be fine tuned, particularly math and graphical elements like
- |picture|. In \xetex{} \babel{} resorts to the \textsf{bidi} package,
- which seems to work.
-\item[Hebrew] Niqqud marks seem to work in both engines, but depending
- on the font cantillation marks might be misplaced (\xetex{} or
- \luatex{} with Harfbuzz seems better).
-\item[Devanagari] In \luatex{} and the default renderer many fonts
-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}
- 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
- the font behavior is not always possible.
-\item[Southeast scripts] Thai works in both \luatex{} and \xetex{}, but
- line breaking differs (rules are hard-coded in \xetex, but they can
- be modified in \luatex). Lao seems to work, too, but there are no
- patterns for the latter in \luatex{}. Khemer clusters are rendered
- wrongly with the default renderer. The comment about Indic scripts
- and \textsf{lualatex} also applies here. Some quick patterns can
- help, with something similar to:
-\begin{verbatim}
-\babelprovide[import, hyphenrules=+]{lao}
-\babelpatterns[lao]{1ດ 1ມ 1ອ 1ງ 1ກ 1າ} % Random
-\end{verbatim}
-\item[East Asia scripts] Settings for either Simplified of Traditional
- should work out of the box, with basic line breaking with any
- renderer. Although for a few words and shorts texts the |ini| files
- should be fine, CJK texts are best set with a dedicated framework
- (\textsf{CJK}, \textsf{luatexja}, \textsf{kotex}, \textsf{CTeX},
- etc.). This is what the class |ltjbook| does with \luatex, which can
- be used in conjunction with the |ldf| for |japanese|, because the
- following piece of code loads \textsf{luatexja}:
-\begin{verbatim}
-\documentclass[japanese]{ltjbook}
-\usepackage{babel}
-\end{verbatim}
-\item[Latin, Greek, Cyrillic] Combining chars with the default
- \luatex{} font renderer might be wrong; on then other hand, with the
- Harfbuzz renderer diacritics are stacked correctly, but many
- hyphenations points are discarded (this bug is related to kerning,
- so it depends on the font). With \xetex{} both combining characters
- and hyphenation work as expected (not quite, but in most cases it
- works; the problem here are font clusters).
-\end{description}
-\end{note}
-
-\begin{note}
- Wikipedia defines a \textit{locale} as follows: “In computing, a
- locale is a set of parameters that defines the user’s language,
- region and any special variant preferences that the user wants to see
- in their user interface. Usually a locale identifier consists of at
- least a language code and a country/region code.” \Babel{} is moving
- gradually from the old and fuzzy concept of \textit{language} to the
- more modern of \textit{locale}. Note each locale is by itself a
- separate “language”, which explains why there are so many files. This
- is on purpose, so that possible variants can be created and/or
- redefined easily.
-\end{note}
-
-\textbf{Modifying and adding values to |ini| files}
-
-\nobreak
-\New{3.39} There is a way to modify the values of |ini| files when they
-get loaded with |\babelprovide| and |import|. To set, say,
-|digits.native| in the |numbers| section, use something like
-|numbers/digits.native=abcdefghij|. Keys may be added, too. Without
-|import| you may modify the identification keys.
-
-This can be used to create private variants easily. All you need is to
-import the same |ini| file with a different locale name and different
-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
-% \end{example}
-
-\subsection{List of locales available in \cs{babelprovide}}
+\subsection{Languages supported by \babel{} in the ‘modern’ mode}
Here is the list of the names currently supported with |ini| locale
files, with |\babelprovide| (or |provide=|). With these languages,
@@ -1618,7 +988,7 @@ they are ‘bare minimum locales’. They are set in
\bigskip\hrule\nobreak
\makeatletter
-\def\tag#1{\par\@hangfrom{\makebox[10em][l]{#1}}\ignorespaces}
+\def\tag#1{\par\@hangfrom{\makebox[1em][l]{#1}}\ignorespaces}
\def\tag#1#2#3{\par
\hspace{-2em}\textcolor{thered}{\texttt{#1}}#2\enspace
\mbox{\footnotesize(#3)}}
@@ -1652,7 +1022,7 @@ There are some notes in a few locales.
\bigskip\hrule\nobreak
\begin{multicols}{2}
-\leftskip2em
+\leftskip2em\parindent0pt
\tag{abkhazian}{}{ab}
\tag{afar}{}{aa}
\tag{afrikaans}{\hascapu\hascapl}{af}
@@ -2169,54 +1539,72 @@ in Switzerland.}
\hrule
\bigskip
-\subsection{Selecting fonts}
+\subsection{Fonts in Unicode engines}
+\label{fonts}
+
+\begin{note}
+ For \textsf{pdflatex} and the standard \textsf{fontenc} mechanism,
+ refer to the \LaTeX{} manuals or \textit{The \LaTeX{} Companion},
+ vol.~I, ch.~9, and vol.~II, ch.~10.
+\end{note}
+
+\New{3.15} \Babel{} has native support for Unicode fonts (OpenType and
+TrueType) in \xetex{} and \luatex{} by means of a high level interface
+on top of |fontspec|. This makes it easier to handle a wide range of
+languages and scripts, and simplifies the process of typesetting
+multilingual documents. As described below, with \luatex{} the font can
+be switched automatically based on the script without explicit markup.
-\New{3.15} Babel provides a high level interface on top of |fontspec|
-to select fonts. There is no need to load \textsf{fontspec} explicitly
--- \babel{} does it for you with the first |\babelfont|.\footnote{See
-also the package \textsf{combofont} for a complementary approach.}
+There is no need to load \textsf{fontspec} explicitly – \babel{} does
+it for you with the first |\babelfont|. (See also the package
+\textsf{combofont} for a complementary approach.)
\Describe\babelfont{\oarg{language-list}\marg{font-family}%
\oarg{font-options}\marg{font-name}}
-\begin{note}
- See the note in the previous section about some issues in
- specific languages.
-\end{note}
+% \begin{note}
+% See the note in the previous section about some issues in
+% specific languages.
+% \end{note}
-The main purpose of |\babelfont| is to define at once in a multilingual
-document the fonts required by the different languages, with their
-corresponding language systems (script and language). So, if you load,
-say, 4 languages, |\babelfont{rm}{FreeSerif}| defines 4 fonts (with
-their variants, of course), which are switched with the language by
-\babel. It is a tool to make things easier and transparent to the user.
+The main purpose of |\babelfont| is to define at once the fonts
+required by the different languages, with their corresponding language
+systems (script and language). So, if you load, say, 4 languages,
+|\babelfont{rm}{FreeSerif}| defines 4 fonts (with their variants, of
+course), which are switched with the language by \babel. It is a tool
+to make things easier and transparent to the user.
Here \textit{font-family} is |rm|, |sf| or |tt| (or newly defined
ones, as explained below), and \textit{font-name} is the same as in
\textsf{fontspec} and the like.
-If no language is given, then it is considered the default font for
-the family, activated when a language is selected.
+If no language is given, then it is considered the default font for the
+family. On the other hand, if there is one or more languages in the
+optional argument, the font will be assigned to all of them, overriding
+the default one. Alternatively, you may set a font for a script -- just
+precede its name (lowercase) with a star (eg, |*devanagari|).
-On the other hand, if there is one or more languages in the optional
-argument, the font will be assigned to them, overriding the default one.
-Alternatively, you may set a font for a script -- just precede its name
-(lowercase) with a star (eg, |*devanagari|). With this optional
-argument, the font is \textit{not} yet defined, but just predeclared.
-This means you may define as many fonts as you want ‘just in case’,
-because if the language is never selected, the corresponding
-|\babelfont| declaration is just ignored.
+With the optional argument, the font is \textit{not} yet loaded, but
+just predeclared. In other words, font loading is lazy, which means you
+may define as many fonts as you want ‘just in case’, because if the
+language is never selected, the corresponding |\babelfont| declaration
+is just ignored.
\Babel{} takes care of the font language and the font script when
-languages are selected (as well as the writing direction); see the
-recognized languages above. In most cases, you will not need
-\textit{font-options}, which is the same as in \textsf{fontspec}, but
-you may add further key/value pairs if necessary.
+languages are selected (as well as the writing direction). In most
+cases, you will not need \textit{font-options}, which is the same as in
+\textsf{fontspec}, but you may add further key/value pairs if
+necessary.
+
+|\babelfont| can be used to implicitly define a new font family. Just
+write its name instead of |rm|, |sf| or |tt|. This is the preferred way
+to select fonts in addition to the three basic families.
\begin{example}
Usage in most cases is very simple. Let us assume you are setting up
a document in Swedish, with some words in Hebrew, with a font suited
- for both languages.
+ for both languages. Here the option |bidi=default| activates a simple
+ (or, rather, simplistic) bidirectional mode.
\begingroup
% If you are looking at the code to see how it has been written, you
% will be disappointed :-). The following example is built ad hoc to
@@ -2253,15 +1641,27 @@ replace the red line above with, say:
\end{verbatim}
\end{example}
-|\babelfont| can be used to implicitly define a new font family. Just
-write its name instead of |rm|, |sf| or |tt|. This is the preferred way
-to select fonts in addition to the three basic families.
+\begin{example}
+Thanks to this high level interface to |fontenc|, the roman fonts for
+all secondary languages in the Cyrillic and Greek scripts can be set
+at once with the following single line:
+\setengine{luatex/xetex}
+\begin{verbatim}
+\babelfont[_*cyrillic, *greek_]{rm}{NewComputerModern10}
+\end{verbatim}
+With some scripts, the \textsf{Harfbuzz} renderer is preferred:
+\begin{verbatim}
+ \babelfont[_*arabic, *devanagari_]{rm}[_Renderer=Harfbuzz_]{FreeSerif}
+\end{verbatim}
+\Babel{} does the rest for you, including setting the font language and
+script.
+\end{example}
\begin{example}
- Here is how to do it:
+ Here is how to declare a new family:
\setengine{luatex/xetex}
\begin{verbatim}
-\babelfont{kai}{FandolKai}
+\babelfont{_kai_}{FandolKai}
\end{verbatim}
Now, |\kaifamily| and |\kaidefault|, as well as |\textkai| are at
your disposal.
@@ -2277,10 +1677,6 @@ to select fonts in addition to the three basic families.
\end{verbatim}
This makes sure the OpenType script for Devanagari is |deva| and not
|dev2|, in case it is not detected correctly.
-% You may also pass some
-% options to \textsf{fontspec}: with |silent|, the warnings about
-% unavailable scripts or languages are not shown (they are only really
-% useful when the document format is being set up).
\end{note}
\begin{note}
@@ -2312,6 +1708,16 @@ to select fonts in addition to the three basic families.
above for the reasons of this behavior.
\end{note}
+\begin{note}
+ |\babelfont| is a high level interface to \textsf{fontspec}, and
+ therefore in \xetex{} you can apply |Mapping|s. For example, there is
+ a set of
+ \href{https://github.com/davidmjones/brahmic-maps}{transliterations
+ for Brahmic scripts} by Davis M. Jones. After installing
+ them in you distribution, just set the map as you would do with
+ \textsf{fontspec}.
+\end{note}
+
\begin{warning}
Using |\set|\textit{xxxx}|font| and |\babelfont| at the same time is
discouraged, but very often works as expected. However, be aware with
@@ -2320,6 +1726,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}.
@@ -2341,22 +1769,761 @@ to select fonts in addition to the three basic families.
be aware that this may lead to some problems.
\end{troubleshooting}
+\subsection{Basic language selectors}
+\label{selectors}
+
+This section describes the commands to be used in the document to
+switch the language in multilingual documents. In most cases, only the
+two basic macros |\selectlanguage| and |\foreignlanguage| are
+necessary. The environments |otherlanguage|, |otherlanguage*| are
+auxiliary, and described in the next section.
+
+The main language is selected automatically when the |document|
+environment begins.
+
+\Describe{\selectlanguage}{\marg{language}}
+\DescribeOther{\begin\menv{selectlanguage}}%
+ {\marg{language}\Eenv{selectlanguage}}
+
+When a user wants to switch from one language to another he can do so
+using the macro |\selectlanguage|. It is meant for blocks of texts, and
+therefore should be used mainly in vertical mode, although it also
+works in horizontal mode.
+\begin{verbatim}
+\selectlanguage{german}
+\end{verbatim}
+
+This command can be used as environment, too, in case there are
+relatively short texts and you do not want to reset the language with a
+hardcode value.
+
\begin{note}
- |\babelfont| is a high level interface to \textsf{fontspec}, and
- therefore in \xetex{} you can apply |Mapping|s. For example, there is
- a set of
- \href{https://github.com/davidmjones/brahmic-maps}{transliterations
- for Brahmic scripts} by Davis M. Jones. After installing
- them in you distribution, just set the map as you would do with
- \textsf{fontspec}.
+ Bear in mind |\selectlanguage| can be automatically executed, in some
+ cases, in the auxiliary files, at heads and foots, and after the
+ environment |otherlanguage*|.
\end{note}
-\subsection{Modifying a language}
+\begin{warning}
+ If used inside braces or a group there might be some non-local
+ changes, as it would be roughly equivalent to:
+\begin{verbatim}
+\bgroup
+\selectlanguage{<inner-language>}
+...
+\egroup
+\selectlanguage{<outer-language>}
+\end{verbatim}
+ If you want a change which is really local, you must enclose this
+ code with an additional grouping level. The same applies to the
+ environment version.
+\end{warning}
+
+\begin{warning}
+ There are a couple of issues related to the way the language
+ information is written to the auxiliary files:
+\begin{itemize}
+ \item |\selectlanguage| should not be used inside some boxed environments
+ (like floats or |minipage|) to switch the language if you need the
+ information written to the |aux| be correctly synchronized. This
+ rarely happens, but if it were the case, you must use the
+ environment version or |otherlanguage| instead.
+ \item In addition, this macro inserts a |\write| in vertical mode,
+ 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=<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
+ solution, because nothing is written, but more often than not this
+ command is applied to more or less shorts texts with no sectioning
+ or similar commands, and therefore no language synchronization is
+ necessary). In a table cell, a |\leavevmode| just before the
+ selector may be enough.
+\end{itemize}
+\end{warning}
+
+\Describe{\foreignlanguage}{\oarg{option-list}\marg{language}\marg{text}}
+
+It takes two mandatory arguments; the second argument is a phrase to be
+typeset according to the rules of the language named in its first one.
+
+This command (1) only switches the extra definitions and the
+hyphenation rules for the language, \emph{not} the names and dates, (2)
+does not send information about the language to auxiliary files (i.e.,
+the surrounding language is still in force), and (3) it works even if
+the language has not been set as package option (but in such a case it
+only sets the hyphenation patterns and a warning is shown). With the
+|bidi| option, it also enters in horizontal mode (this is not done
+always for backwards compatibility), and since it is meant for phrases
+only the text direction (and not the paragraph one) is set.
+
+\New{3.44} As already said, captions and dates are not switched.
+However, with the optional argument you can switch them, too. So, you
+can write:
+\begin{verbatim}
+\foreignlanguage[date]{polish}{\today}
+\end{verbatim}
+In addition, captions can be switched with |captions| (or both, of
+course, with |date,| |captions|). Until 3.43 you had to write something
+like |{\selectlanguage{..} ..}|, which was not always the most
+convenient way.
+
+\begin{note}
+ |\bibitem| is out of sync with |\selectlanguage| in the \file{.aux}
+ file. The reason is |\bibitem| uses |\immediate| (and others, in
+ fact), while |\selectlanguage| doesn't. There is a similar issue with
+ floats, too. There is no known workaround, but it’s not usually a
+ real issue.
+\end{note}
+
+\subsection{Auxiliary language selectors}
+
+\Describe{\begin\menv{otherlanguage}}{\marg{language}\Eenv{otherlanguage}}
+
+Same as |selectlanguage| as environment, except spaces after the
+|\begin| and |\end| commands are ignored. (Very likely, and because of
+the limitations of many old editors with bidi text, the idea was
+\cs{end}\texttt{\{otherlanguage\}} had to be a line by itself.) The
+warning above about the internal |\write| also applies here. The
+current mode (vertical or horizontal) also remains unchanged.
+
+\Describe{\begin\menv{otherlanguage*}}%
+{\oarg{option-list}\marg{language}\Eenv{otherlanguage*}}
+
+Same as |\foreignlanguage| but as environment. Spaces are \textit{not}
+ignored.
+
+It was originally devised for intermixing left-to-right
+typesetting with right-to-left typesetting in engines not supporting a
+change in the writing direction inside a line. However, by default it
+never complied with the documented behavior and it is just a version as
+environment of |\foreignlanguage|, except when the package option
+|bidi| is set -- in this case, |\foreignlanguage| emits a
+|\leavevmode|, while |otherlanguage*| does not. Like |\foreignlanguage|
+it is a \textit{text} command, and therefore it doesn’t change the
+paragraph direction.
+
+\subsection{Plain}
+
+In e-Plain and pdf-Plain, load languages styles with |\input| and then use
+|\begindocument| (the latter is defined by \babel):
+\begin{verbatim}
+\input estonian.sty
+\begindocument
+\end{verbatim}
+
+\begin{warning}
+ Not all languages provide a |sty| file and some of them are not
+ compatible with those formats. Please, refer to
+ \href{https://latex3.github.io/babel/guides/using-babel-with-plain.html}%
+ {Using babel with Plain} for further details.
+\end{warning}
+
+\section{More on language loading and selection}
+
+\subsection{A couple of tools}
+
+% Also Plain
+\Describe{\babeltags}{\char`\{\m{tag1} \texttt{=} \m{language1}, \m{tag2}
+\texttt{=} \m{language2}, \dots\char`\}}
+
+\New{3.9i} In multilingual documents with many language-switches the
+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<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}
+ There is a clear drawback to this feature, namely, the ‘prefix’
+ |\text...| is heavily overloaded in \LaTeX{} and conflicts with
+ existing macros may arise (|\textlatin|, |\textbar|, |\textit|,
+ |\textcolor| and many others). The same applies to environments,
+ because |arabic| conflicts with |\arabic|. Furthermore, and because of
+ this overloading, detecting the language of a chunk of text by
+ external tools can become unfeasible (is |\textga| the locale for the
+ African language Gã or something else?). Except if there is a reason for
+ this ‘syntactical sugar’, the best option is to stick to the default
+ selectors or even to define your own alternatives.
+\end{warning}
+
+\begin{example}
+With
+\begin{verbatim}
+\babeltags{de = german}
+\end{verbatim}
+you can write
+\begin{verbatim}
+text \textde{German text} text
+\end{verbatim}
+and
+\begin{verbatim}
+text
+\begin{de}
+ German text
+\end{de}
+text
+\end{verbatim}
+\end{example}
+
+\begin{note}
+ Something like \verb|\babeltags{finnish = finnish}| is legitimate --
+ it defines |\textfinnish| and |\finnish| (and, of course,
+ |\begin{finnish}|).
+\end{note}
+
+% Also Plain
+\Describe{\babelensure}{|[include=|\m{commands}|,exclude=|\m{commands}%
+ |,fontenc=|\m{encoding}|]|\marg{language}}
+
+\New{3.9i} Except in a few languages, like \textsf{russian},
+captions and dates are just strings, and do not switch the
+language. That means you should set it explicitly if you want to use
+them, or hyphenation (and in some cases the text itself) will be
+wrong. For example:
+\begin{verbatim}
+\foreignlanguage{russian}{text \foreignlanguage{polish}{\seename} text}
+\end{verbatim}
+
+Of course, \TeX{} can do it for you. To avoid switching the language
+all the while, |\babelensure| redefines the captions for a given
+language to wrap them with a selector:
+\begin{verbatim}
+\babelensure{polish}
+\end{verbatim}
+By default only the basic captions and |\today| are redefined, but you
+can add further macros with the key |include| in the optional argument
+(without commas). Macros not to be modified are listed in
+|exclude|. You can also enforce a font encoding with the option
+|fontenc|.\footnote{With it, encoded strings may not work as expected.}
+A couple of examples:
+\begin{verbatim}
+\babelensure[include=\Today]{spanish}
+\babelensure[fontenc=T5]{vietnamese}
+\end{verbatim}
+
+They are activated when the language is selected (at the |afterextras|
+event), and it makes some assumptions which could not be fulfilled in
+some languages. Note also you should include only macros defined by
+the language, not global macros (eg, |\TeX| of |\dag|).
+
+With |ini| files (see below), captions are ensured by default.
+
+\subsection{Accessing language info}
+
+% Also Plain
+\Describe{\localename}{}
+\DescribeOther{\mainlocalename}{}
+\DescribeOther{\languagename}{}
+
+\New{24.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 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}}
+
+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}{\optstar{\marg{field}}}
+
+\New{3.38} If an |ini| file has been loaded for the current language,
+you may access the information stored in it. Note with the ‘classical’
+|ldf| files the corresponding |ini| ones are also loaded, but only some
+basic data required for fonts, casing and a few more.
+
+This macro is fully expandable, but raises an error if the info doesn’t
+exist. \New{3.75} Sometimes, it comes in handy to be able to use
+|\localeinfo| in an quite fully expandable way even if something went
+wrong (for example, the locale currently active is undefined). For
+these cases, |localeinfo*| just returns an empty string instead of
+raising an error.
+
+The available fields are:
+\begin{description}
+\itemsep=-\parskip
+\item[|name.english|] as provided by the Unicode CLDR.
+\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
+ is the value to be used for the ‘real' provided tag (\babel{} may
+ fill other fields if they are considered necessary).
+\item[|language.tag.bcp47|] is the BCP 47 language tag.
+\item[|tag.opentype|] is the tag used by OpenType (usually, but not
+ always, the same as BCP 47).
+\item[|script.name|], as provided by the Unicode CLDR.
+\item[|script.tag.bcp47|] is the BCP 47 tag of the script
+ used by this locale. This is a required field for the fonts to be
+ correctly set up, and therefore it should be always defined.
+\item[|script.tag.opentype|] is the tag used by OpenType (usually,
+ but not always, the same as BCP 47).
+\item[|region.tag.bcp47|] is the BCP 47 tag of the region or territory.
+ Defined only if the locale loaded actually contains it (eg, |es-MX|
+ does, but |es| doesn’t), which is how locales behave in the CLDR.
+ \New{3.75}
+\item[|variant.tag.bcp47|] is the BCP 47 tag of the variant (in the BCP 47
+ sense, like |1901| for German). \New{3.75}
+\item[|extension.|\m{s}|.tag.bcp47|] is the BCP 47 value of the
+ extension whose singleton is \m{s} (currently the recognized
+ singletons are |x|, |t| and |u|). The internal syntax can be somewhat
+ complex, and this feature is still somewhat tentative. An example is
+ \textsf{classicallatin} which sets |extension.x.tag.bcp47| to |classic|.
+ \New{3.75}
+\end{description}
+
+% All of these keys can be preceded by |main.| (eg, |main.tag.ini|),
+% which retrieves the values of the main locale.
+
+\begin{note}
+ Currently, |x| is used for two separate functions, namely,
+ identifying a \babel{} locale without a BCP47 tag and setting an
+ alternative set of rules for casing.
+\end{note}
+
+\begin{note}
+ Bear in mind that \babel{}, following the CLDR, may leave the region
+ unset, which means |\getlocaleproperty*|, described below, is the
+ preferred command, so that the existence of a field can be checked
+ before. This also means building a string with the language and the
+ region with something like
+ |\localeinfo*{language.tab.bcp47}|\allowbreak |-|\allowbreak
+ |\localeinfo*{region.tab.bcp47}| is not usually a good idea (because
+ of the hyphen).
+\end{note}
+
+\begin{warning}
+ \New{3.46} As of version 3.46 |tag.bcp47| returns the full BCP 47
+ tag. Formerly it returned just the language subtag, which was clearly
+ counterintuitive.
+\end{warning}
+
+\Describe{\getlocaleproperty}{%
+ \optstar\marg{macro}\marg{locale}\marg{property}}
+
+\New{3.42} The value of any locale property as set by the |ini| files
+(or added/modified with |\babelprovide|) can be retrieved and stored in
+a macro with this command. For example, after:
+\begin{verbatim}
+ \getlocaleproperty\hechap{hebrew}{captions/chapter}
+\end{verbatim}
+the macro |\hechap| will contain the string
+{\fontspec[Scale=.87,Script=Hebrew]{Liberation Mono}\textdir TRT פרק}.
+
+If the key does not exist, the macro is set to |\relax| and an error is
+raised. \New{3.47} With the starred version no error is raised, so that
+you can take your own actions with undefined properties.
+
+\Describe{\localeid}{}
+Each language in the \babel{} sense has its own unique numeric
+identifier, which can be retrieved with |\localeid|.
+
+The |\localeid| is not the same as the |\language| identifier, which
+refers to a set of hyphenation patterns (which, in turn, is just a
+component of the line breaking algorithm described in the next
+section). The data about preloaded patterns are store in an internal
+macro named |\bbl@languages| (see the code for further details), but
+note several locales may share a single |\language|, so they are
+separated concepts. In \luatex, the |\localeid| is saved in each node
+(when it makes sense) as an attribute, too.
+
+\Describe{\ShowLocaleProperties}{\marg{language}}
+\New{3.98} Prints to the |log| file all the loaded key/value pairs from
+the |ini| locale file for \meta{language}.
+
+\Describe{\LocaleForEach}{\marg{code}}
+\Babel{} remembers which |ini| files have been loaded. There is a loop
+named |\LocaleForEach| to traverse the list, where |#1| is the name of
+the current item, so that |\LocaleForEach{\message{ **#1** }}| just
+shows the loaded |ini|’s.
+
+\subsection{Package options}
+
+\New{3.9a}
+These package options are processed before language options, so
+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
+file, so that they are also available in the preamble.
+
+\Describe{headfoot=}{\meta{language}} By default, headlines and
+footlines are not touched (only marks), and if they contain
+language-dependent macros (which is not usual) there may be unexpected
+results. With this option you may set the language in heads and foots.
+An alternative is to set the language explicitly when heads and foots
+are redefined.
+
+\Describe{noconfigs}{} Global and language default config files are
+not loaded, so you can make sure your document is not spoilt by an
+unexpected \texttt{.cfg} file. However, if the key |config| is set,
+this file is loaded.
+
+\Describe{config=}{\meta{file}} Load \meta{file}\texttt{.cfg} instead
+of the default config file |bblopts.cfg| (forced even with
+|noconfigs|).
+
+\Describe{showlanguages}{} Prints to the log the list of languages
+loaded when the format was created: number (remember dialects can
+share it), name, hyphenation file and exceptions file.
+
+\Describe{silent}{} \New{3.9l} No warnings and no \textit{infos} are
+written to the log file.\footnote{You can use alternatively the
+package \textsf{silence}.}
+
+\Describe{hyphenmap=}{\texttt{off} $\string|$ \texttt{first}
+$\string|$ \texttt{select} $\string|$ \texttt{other} $\string|$
+\texttt{other*}}
+
+\New{3.9g} Sets the behavior of case mapping for hyphenation,
+provided the language defines it.\footnote{Turned off in plain.} It
+can take the following values:
+\begin{description}
+\renewcommand\makelabel[1]{%
+ \hspace\labelsep\normalfont\ttfamily\color{thered}#1}
+\itemsep=-\parskip
+\item[off] deactivates this feature and no case mapping is applied;
+\item[first] sets it at the first switching commands in the
+ current or parent scope (typically, when the aux file is first read
+ and at |\begin{document}|, but also the first |\selectlanguage| in
+ the preamble), and it's the default if a single
+ language option has been stated;\footnote{Duplicated options count
+ as several ones.}
+\item[select] sets it only at |\selectlanguage|;
+\item[other] also sets it at |otherlanguage|;
+\item[other*] also sets it at |otherlanguage*| as well as in heads and
+ foots (if the option |headfoot| is used) and in auxiliary files (ie,
+ at |\select@language|), and it's the default if several language
+ options have been stated. The option |first| can be regarded as an
+ optimized version of \texttt{other*} for monolingual
+ documents.\footnote{Providing |foreign| is pointless, because the
+ case mapping applied is that at the end of the paragraph, but if either
+ \xetex{} or \luatex{} change this behavior it might be added. On
+ the other hand, |other| is provided even if I [JBL] think it isn't
+ really useful, but who knows.}
+\end{description}
+
+\Describe{bidi=}{\texttt{default} $\string|$ \texttt{basic}
+ $\string|$ \texttt{basic-r} $\string|$ \texttt{bidi-l} $\string|$
+ \texttt{bidi-r}}
+
+\New{3.14} Selects the bidi algorithm to be used in \luatex{} and
+\xetex{}. See sec.~\ref{bidi}.
+
+\Describe{layout=}{}
+
+\New{3.16} Selects which layout elements are adapted in bidi
+documents. See sec.~\ref{bidi}.
+
+\Describe{provide=}{\texttt{*} $\string|$ \meta{option-list}}
+\New{3.49} An alternative to |\babelprovide| for languages passed as
+options. See section~\ref{inifiles}, which describes also the variants
+|provide+=| and |provide*=|.
+
+\Describe{main=}{\meta{language}} Forces the main language, but this
+option should not be used except if there a need to do it. If the
+language is not given as such as package or global option, it is added
+to the list of requested languages. For example:
+\begin{verbatim}
+\documentclass{article}
+\usepackage[_main=english_,dutch]{babel}
+\end{verbatim}
+Some classes load \babel{} with a hardcoded language option. Sometimes,
+the main language can be overridden with something like that before
+|\documentclass|:
+\begin{verbatim}
+\PassOptionsToPackage{main=english}{babel}
+\end{verbatim}
+
+\subsection{The \texttt{base} option}
+
+With this package option \babel{} just loads some basic macros (mainly
+the selectors), defines |\AfterBabelLanguage| and exits. It also
+selects the hyphenation patterns for the last language passed as option
+(by its name in |language.dat|). There are two main uses: classes and
+packages, and as a last resort in case there are, for some reason,
+incompatible languages. It can be used if you just want to select the
+hyphenation patterns of a single language, too.
+
+\Describe\AfterBabelLanguage{\marg{option-name}\marg{code}}
+
+This command is currently the only provided by |base|. Executes
+\meta{code} when the file loaded by the corresponding package option
+is finished (at |\ldf@finish|). The setting is global. So
+\begin{verbatim}
+\AfterBabelLanguage{french}{...}
+\end{verbatim}
+does ... at the end of |french.ldf|. It can be used in |ldf| files,
+too, but in such a case the code is executed only if
+\meta{option-name} is the same as |\CurrentOption| (which could not
+be the same as the option name as set in |\usepackage|!).
+
+\begin{example}
+ Consider two languages \textsf{foo} and \textsf{bar} defining the
+ same |\macro| with |\newcommand|. An error is raised if you attempt
+ to load both. Here is a way to overcome this problem:
+\begin{verbatim}
+\usepackage[base]{babel}
+\AfterBabelLanguage{foo}{%
+ \let\macroFoo\macro
+ \let\macro\relax}
+\usepackage[foo,bar]{babel}
+\end{verbatim}
+\end{example}
+
+\begin{note}
+ With a recent version of \LaTeX, an alternative method to execute
+ some code just after an |ldf| file is loaded is with |\AddToHook| and
+ the hook |file/<language>.ldf/after|. \Babel{} does not predeclare
+ it, and you have to do it yourself with |\ActivateGenericHook|.
+\end{note}
+
+\begin{warning}
+ Currently this option is not compatible with languages loaded on the
+ fly.
+\end{warning}
+
+\subsection{\texttt{provide} and \cs{babelprovide} – \texttt{ini} files}
+\label{inifiles}
+
+An alternative approach to define a language (or, more precisely, a
+\textit{locale}) is by means of an \texttt{ini} file. Currently
+\babel{} provides about 380 of these files containing the basic data
+required for a locale, covering about 300 languages and 40 scripts,
+plus basic templates for about 400 locales.
+
+|ini| files are not meant only for \babel, and they has been devised as
+a resource for other packages. To easy interoperability between \TeX{}
+and other systems, they are identified with the BCP 47 codes as
+preferred by the Unicode Common Locale Data Repository, which was
+used as source for most of the data provided by these files, where
+available.
+
+Most of them set the date, and many also the captions (Unicode and
+LICR). They will be evolving with the time to add more features
+(something to keep in mind if backward compatibility is important). The
+following section shows how to make use of them by means of
+|\babelprovide|.
+
+Not all languages in the CLDR are complete, and therefore neither are
+the |ini| files. A few languages may show a warning about the current
+lack of suitability of some features.
+
+\begin{example}
+ There is an example of how to use an |ini| template file
+ \href{https://github.com/latex3/babel/issues/176#issuecomment-1080846575}{here},
+ for Phoenician (although currently this locale is bundled with
+ \babel).
+\end{example}
+
+\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’
+applying the basic features, which in this case means |import| and |main|.
+There are (currently) three options:
+\begin{itemize}
+\item |provide=*| is the option just explained, for the main language;
+\item |provide+=*| is the same for additional languages (the main
+ language is still the |ldf| file);
+\item |provide*=*| is the same for all languages, ie, main and
+ additional.
+\end{itemize}
+
+\begin{note}
+ The \texttt{ini} files just define and set some parameters, but the
+ corresponding behavior is not always implemented. Also, there are
+ some limitations in the engines. A few remarks follow (which could no
+ longer be valid when you read this manual, if the packages involved
+ have been updated). The Harfbuzz renderer still has some issues, so as
+ a rule of thumb prefer the default renderer, and resort to Harfbuzz
+ 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[hindi]{rm}[Renderer=Harfbuzz]{FreeSerif}
+\end{verbatim}
+\begin{description}
+\itemsep=-\parskip
+\item[Arabic] Monolingual documents mostly work in \luatex, but it must
+ be fine tuned, particularly math and graphical elements like
+ |picture|. In \xetex{} \babel{} resorts to the \textsf{bidi} package,
+ which seems to work.
+\item[Hebrew] Niqqud marks seem to work in both engines, but depending
+ on the font cantillation marks might be misplaced (\xetex{} or
+ \luatex{} with Harfbuzz seems better).
+\item[Devanagari] In \luatex{} and the default renderer many fonts
+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}
+ 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
+ the font behavior is not always possible.
+\item[Southeast scripts] Thai works in both \luatex{} and \xetex{}, but
+ line breaking differs (rules are hard-coded in \xetex, but they can
+ be modified in \luatex). Lao seems to work, too, but there are no
+ patterns for the latter in \luatex{}. Khemer clusters are rendered
+ wrongly with the default renderer. The comment about Indic scripts
+ and \textsf{lualatex} also applies here. Some quick patterns can
+ help, with something similar to:
+\begin{verbatim}
+\babelprovide[import, hyphenrules=+]{lao}
+\babelpatterns[lao]{1ດ 1ມ 1ອ 1ງ 1ກ 1າ} % Random
+\end{verbatim}
+\item[East Asia scripts] Settings for either Simplified of Traditional
+ should work out of the box, with basic line breaking with any
+ renderer. Although for a few words and shorts texts the |ini| files
+ should be fine, CJK texts are best set with a dedicated framework
+ (\textsf{CJK}, \textsf{luatexja}, \textsf{kotex}, \textsf{CTeX},
+ etc.). This is what the class |ltjbook| does with \luatex, which can
+ be used in conjunction with the |ldf| for |japanese|, because the
+ following piece of code loads \textsf{luatexja}:
+\begin{verbatim}
+\documentclass[japanese]{ltjbook}
+\usepackage{babel}
+\end{verbatim}
+\item[Latin, Greek, Cyrillic] Combining chars with the default
+ \luatex{} font renderer might be wrong; on then other hand, with the
+ Harfbuzz renderer diacritics are stacked correctly, but many
+ hyphenations points are discarded (this bug is related to kerning,
+ so it depends on the font). With \xetex{} both combining characters
+ and hyphenation work as expected (not quite, but in most cases it
+ works; the problem here are font clusters).
+\end{description}
+\end{note}
+
+\begin{note}
+ Wikipedia defines a \textit{locale} as follows: “In computing, a
+ locale is a set of parameters that defines the user’s language,
+ region and any special variant preferences that the user wants to see
+ in their user interface. Usually a locale identifier consists of at
+ least a language code and a country/region code.” \Babel{} is moving
+ gradually from the old and fuzzy concept of \textit{language} to the
+ more modern of \textit{locale}. Note each locale is by itself a
+ separate “language”, which explains why there are so many files. This
+ is on purpose, so that possible variants can be created and/or
+ redefined easily.
+\end{note}
+
+% \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
+% \end{example}
+
+\subsection{Selection based on BCP 47 tags}
+\label{bcp47}
+
+\New{3.43} The recommended way to select languages is that described at
+the beginning of this document. However, BCP 47 tags are becoming
+customary, particularly in documents (or parts of documents) generated
+by external sources, and therefore \babel{} will provide a set of tools
+to select the locales in different situations, adapted to the
+particular needs of each case. Currently, \babel{} provides autoloading
+of locales as described in this section. In these contexts autoloading
+is particularly important because we may not know on beforehand which
+languages will be requested.
+
+It must be activated explicitly, because it is primarily meant for
+special tasks. Mapping from BCP 47 codes to locale names are not
+hardcoded in \babel. Instead the data is taken from the \texttt{ini}
+files, which means currently about 350 tags are already recognized.
+\Babel{} performs a simple lookup in the following way: |fr-Latn-FR| $\to$
+|fr-Latn| $\to$ |fr-FR| $\to$ |fr|. Languages with the same resolved
+name are considered the same. Case is normalized before, so that
+|fr-latn-fr| $\to$ |fr-Latn-FR|. If a tag and a name overlap, the tag
+takes precedence.
+
+Here is a minimal example:
+\begin{verbatim}
+\documentclass{article}
+
+\usepackage[danish]{babel}
+
+_\babeladjust{_
+_ autoload.bcp47 = on,_
+_ autoload.bcp47.options = import_
+_}_
+
+\begin{document}
+
+Chapter in Danish: \chaptername.
+
+_\selectlanguage{de-AT}_
+
+\localedate{2020}{1}{30}
+
+\end{document}
+\end{verbatim}
+
+Currently the locales loaded are based on the \texttt{ini} files and
+decoupled from the main \texttt{ldf} files. This is by design, to
+ensure code generated externally produces the same result regardless of
+the languages requested in the document, but an option to use the
+\texttt{ldf} instead will be added in a future release, because both
+options make sense depending on the particular needs of each document
+(there will be some restrictions, however).
+
+The behavior is adjusted with |\babeladjust| with the following parameters:
+\begin{description}
+\item \texttt{autoload.bcp47} with values |on| and |off|.
+\item \texttt{autoload.bcp47.options}, which are passed to
+ |\babelprovide|; empty by default, but you may add \texttt{import}
+ (features defined in the corresponding |babel-...tex| file might not
+ be available).
+\item \texttt{autoload.bcp47.prefix}. Although the public name used in
+ selectors is the tag, the internal name will be different and
+ generated by prepending a prefix, which by default is
+ \texttt{bcp47-}. You may change it with this key.
+\end{description}
+
+\New{3.46} If an |ldf| file has been loaded, you can enable the
+corresponding language tags as selector names with:
+\begin{verbatim}
+\babeladjust{ bcp47.toname = on }
+\end{verbatim}
+(You can deactivate it with |off|.) So, if |dutch| is one of the
+package (or class) options, you can write |\selectlanguage{nl}|. Note
+the language name does not change (in this example is still |dutch|),
+but you can get it with |\localeinfo| or |\getlocaleproperty|. It
+must be turned on explicitly for similar reasons to those explained
+above.
+
+\section{Tailoring, customizing and modifying a language}
Modifying the behavior of a language (say, the chapter
-“caption”), is sometimes necessary, but not always trivial. In the case
-of caption names a specific macro is provided, because this is perhaps
-the most frequent change:
+“caption”) is sometimes necessary.
+
+Several language definition files use their own methods to set
+options. For example, \textsf{french} uses |\frenchsetup|,
+\textsf{magyar} (1.5) uses |\magyarOptions|; modifiers provided by
+|spanish| have no attribute counterparts. Macros setting
+options are also used (eg, |\ProsodicMarksOn| in \textsf{latin}).
+
+This section describes the general tools provided by the \babel{} core.
+
+\subsection{Captions}
+
+In the case of caption names a specific macro is provided,
+because this is perhaps the most frequent change.
\Describe{\setlocalecaption}{%
\marg{language-name}\marg{caption-name}\marg{string}}
@@ -2376,15 +2543,15 @@ redefined behave with the ‘new way’ described in the following note.
There are a few alternative methods:
\begin{itemize}
\item With data |import|’ed from |ini| files, you can modify the values
- of specific keys, like:
+ of specific keys when loaded, like:
\begin{verbatim}
\babelprovide[import, _captions/listtable = Lista de tablas_]{spanish}
\end{verbatim}
(In this particular case, instead of the |captions| group you may need
to modify the |captions.licr| one.)
-\item The ‘old way’, still valid for many languages, to redefine a
- caption is the following:
+\item The ‘old way’ to redefine a caption, still valid for many
+languages but discouraged in general, is the following:
\begin{verbatim}
\addto\captionsenglish{%
\renewcommand\contentsname{Foo}%
@@ -2414,15 +2581,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}
@@ -2432,13 +2599,54 @@ is by means of |\babelprovide|, described below in depth. So,
something like:
\begin{verbatim}
\usepackage[danish]{babel}
-\babelprovide[captions=da, hyphenrules=nohyphenation]{danish}
+\babelprovide[_hyphenrules=nohyphenation_]{danish}
+\end{verbatim}
+first loads |danish.ldf|, and then prevents hyphenation for this
+locale. The rest of the language definitions are not touched. Without
+the optional argument it just loads some additional tools if provided
+by the |ini| file, like extra counters.
+
+\subsection{Modifiers}
+
+\New{3.9c} The basic behavior of some languages can be modified when
+loading \babel{} by means of \textit{modifiers}. They are set after
+the language name, and are prefixed with a dot (only when the language
+is set as package option -- neither global options nor the |main| key
+accepts them). An example is (spaces are not significant and they can
+be added or removed):\footnote{No predefined ``axis'' for modifiers
+are provided because languages and their scripts have quite different
+needs.}
+\begin{verbatim}
+\usepackage[latin_.medieval_, spanish_.notilde.lcroman_, danish]{babel}
\end{verbatim}
-first loads |danish.ldf|, and then redefines the captions for
-\texttt{danish} (as provided by the |ini| file) and prevents
-hyphenation. The rest of the language definitions are not touched.
-Without the optional argument it just loads some additional tools if
-provided by the |ini| file, like extra counters.
+
+Attributes (described below) are considered modifiers, ie, you can
+set an attribute by including it in the list of modifiers.
+
+\New{3.89} Alternatively, modifiers can be set with a separate option,
+with the keyword |modifiers| followed by a dot and the language name
+(note the language is not selected or loaded with this option). It is
+useful to activate some feature when the language is declared as a
+class option:
+\begin{verbatim}
+\documentclass[spanish]{report}
+\usepackage[_modifiers.spanish = notilde.lcroman_]{babel}
+\end{verbatim}
+
+\subsection{Language attributes}
+
+\Describe{\languageattribute}{\marg{language}}
+
+This is a user-level command, to be used in the preamble of a
+document (after |\usepackage[...]{babel}|), that declares which
+attributes are to be used for a given language. It takes two
+arguments: the first is the name of the language; the second,
+a (list of) attribute(s) to be used. Attributes must be set in the
+preamble and only once -- they cannot be turned on and off.
+The command checks whether the language is known in this document
+and whether the attribute(s) are known for this language.
+
+\subsection{Casing}
\Describe{\BabelUppercaseMapping}
{\marg{locale-name}\marg{codepoint}\marg{output}}
@@ -2470,7 +2678,220 @@ be still assigned to that language.
tag. These issues are expected be sorted out in future releases.
\end{note}
-\subsection{Creating a language}
+\subsection{Modifying and adding values to \texttt{ini} files}
+
+\New{3.39} There is a way to modify or even add values of |ini| files
+when they are imported with |\babelprovide| or |provide=|. This can be
+used to create private variants easily. All you need is to import the
+same |ini| file with a different locale name and different parameters.
+Without |import| you may still modify the identification keys.
+
+Examples of the fine-grained control you have at your disposal are the
+following. All of them assume |\usepackage[english]{babel}|.
+
+\begin{example}
+ Here is how to change the hyphenation rules because there are several
+ criteria, or you must follow and editorial style. The following
+ example just uses the default Spanish rules in English:
+\begin{verbatim}
+\babelprovide[hyphenrules=spanish]{english}
+\end{verbatim}
+\end{example}
+
+\begin{example}
+ The required native digits are already defined in the corresponding
+ |ini| files, but they can be modified and even added as shown:
+\begin{verbatim}
+\babelprovide[numbers/digits.native=abcdefghij]{english}
+\end{verbatim}
+This example is somewhat absurd, but now |\englishdigits{264}| will
+print ‘cge’. (It doesn't work with \pdftex.)
+\end{example}
+
+\begin{example}
+ Currently date format they can be changed only with imported data, but
+ with its high level interface it’s quite straightforward:
+\begin{verbatim}
+\babelprovide[
+ import,
+ date.gregorian/date.long = {[d] ([MMMM]) [y]}]
+ {english}
+\end{verbatim}
+ Here |[d]| is the day number, |[MMMM]| the month name and |[y]| the
+ years. It will print something like ‘5 (October) 2024’.
+\end{example}
+
+\begin{example}
+ To set the hyphen to ‘none’ (only \luatex).
+\begin{verbatim}
+\babelprovide[typography/prehyphenchar = 0]{english}
+\end{verbatim}
+This setting \textit{may} work with `xetex`, but getting rid of the
+hyphen char in this engine is not trivial, because you must rely on the
+font, and not all fonts behave the same.
+\end{example}
+
+\begin{example}
+You can define new counters freely, and assign them to |\alph|:
+\begin{verbatim}
+\babelprovide[
+ counters/acute = á é í ó ú, % Define a counter named `acute`
+ alph = acute % Assign it to \alph
+ ]{english}
+\end{verbatim}
+You can choose the name, and instead of `alphabetic` it can be another one.
+\end{example}
+
+\subsection{Hooks}
+
+\New{3.9a} A hook is a piece of code to be executed at certain
+events. Some hooks are predefined when \luatex{} and \xetex{} are
+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/<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{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
+|\EnableBabelHook|\marg{name}, |\DisableBabelHook|\marg{name}. Names
+containing the string |babel| are reserved (they are used, for example,
+by |\useshortands*| to add a hook for the event |afterextras|).
+\New{3.33} They may be also applied to a specific language with the
+optional argument; language-specific settings are executed after global
+ones.
+
+Current events are the following; in some of them you can use one to
+three \TeX{} parameters (|#1|, |#2|, |#3|), with the meaning given:
+\begin{description}
+\renewcommand\makelabel[1]{%
+ \hspace\labelsep\normalfont\ttfamily\color{thered}#1}
+\itemsep=-\parskip
+\item[adddialect] (language name, dialect name) Used by
+ \file{luababel.def} to load the patterns if not preloaded.
+\item[patterns] (language name, language with encoding) Executed just
+ after the |\language| has been set. The second argument has the
+ patterns name actually selected (in the form of either |lang:ENC| or
+ |lang|).
+\item[hyphenation] (language name, language with encoding) Executed
+ locally just before exceptions given in |\babelhyphenation| are
+ actually set.
+\item[defaultcommands] Used (locally) in |\StartBabelCommands|.
+\item[encodedcommands] (input, font encodings) Used (locally) in
+ |\StartBabelCommands|. Both \xetex{} and \luatex{} make sure the
+ encoded text is read correctly.
+\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<language>|. This
+ event and the next one should not contain language-dependent code
+ (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}}
+\end{verbatim}
+\item[stringprocess] Instead of a parameter, you can manipulate the
+ macro |\BabelString| containing the string to be defined with
+ |\SetString|. For example, to use an expanded version of the string
+ in the definition, write:
+\begin{verbatim}
+\AddBabelHook{myhook}{stringprocess}{%
+ \protected@edef\BabelString{\BabelString}}
+\end{verbatim}
+\item[initiateactive] (char as active, char as other, original char)
+ \New{3.9i} Executed just after a shorthand has been `initiated'. The three
+ parameters are the same character with different catcodes: active,
+ 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<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).
+\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
+quite different way for efficiency reasons -- unlike the precedent
+ones, they only have a single hook and replace a default definition.
+\begin{description}
+\renewcommand\makelabel[1]{%
+ \hspace\labelsep\normalfont\ttfamily\color{thered}#1}
+\itemsep=-\parskip
+\item[everylanguage] (language) Executed before every language patterns
+ are loaded.
+\item[loadkernel] (file) By default just defines a few basic commands.
+ It can be used to define different versions of them or to load a file.
+\item[loadpatterns] (patterns file) Loads the patterns file. Used by
+ \file{luababel.def}.
+\item[loadexceptions] (exceptions file) Loads the exceptions
+ file. Used by \file{luababel.def}.
+\end{description}
+
+\begin{example}
+The generic unlocalized \LaTeX{} hooks are predefined, so that you can
+write:
+\begin{verbatim}
+\AddToHook{babel/*/afterextras}{\frenchspacing}
+\end{verbatim}
+which is executed always after the extras for the language being
+selected (and just before the non-localized hooks defined with
+|\AddBabelHook|).
+
+In addition, locale-specific hooks in the form
+|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|:
+\begin{verbatim}
+\ActivateGenericHook{babel/bengali/afterextras}
+\AddToHook{babel/bengali/afterextras}{\frenchspacing}
+\end{verbatim}
+\end{example}
+
+\subsection{Manage auxiliary files}
+
+\Describe{\BabelContentsFiles}{}
+\New{3.9a} This macro contains a list of ``toc'' types
+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{Code based on the selector}
+
+\Describe{\IfBabelSelectorTF}{\marg{selectors}\marg{true}\marg{false}}
+
+\New{3.67} Sometimes a different setup is desired depending on the
+selector used. Values allowed in \m{selectors} are |select|, |other|,
+|foreign|, |other*| (and also |foreign*| for the tentative starred
+version), and it can consist of a comma-separated list. For example:
+\begin{verbatim}
+\IfBabelSelectorTF{other, other*}{A}{B}
+\end{verbatim}
+is true with any of these two environment selectors.
+
+Its natural place of use is in hooks or in |\extras<language>|.
+
+\section{Creating a language}
\New{3.10} And what if there is no style for your language or none fits
your needs? You may then define quickly a language with the help of the
@@ -2528,14 +2949,15 @@ languages loaded on the fly are not yet available in the preamble.
Blah \foreignlanguage{ipa}{ɔːlˈðəʊ} Blah.
\end{document}
\end{verbatim}
- Then you can define shorthands, transforms (with \luatex), and so on.
+ Then you can define shorthands, transforms (with \luatex), interchars
+ (with \xetex) and so on, specific to this new ‘language’.
\end{example}
\begin{example}
Locales with names based on BCP 47 codes can be created with
something like:
\begin{verbatim}
- \babelprovide[import=en-US]{enUS}
+ \babelprovide[import=en-US]{en-US}
\end{verbatim}
Note, however, mixing ways to identify locales can lead to problems.
For example, is \verb|yi| the name of the language spoken by the Yi
@@ -2549,43 +2971,32 @@ necessary.
If the language has been loaded as an argument in |\documentclass| or
|\usepackage|, then |\babelprovide| redefines the requested data.
-\Describe{import=}{\meta{language-tag}}
-\New{3.13} Imports data from an |ini| file, including captions and date
-(also line breaking rules in newly defined languages). For example:
-\begin{verbatim}
-\babelprovide[_import=hu_]{hungarian}
-\end{verbatim}
-Unicode engines load the UTF-8 variants, while 8-bit engines load the
-LICR (ie, with macros like |\'| or |\ss|) ones.
-
-\New{3.23} It may be used without a value, and that is often the
-recommended option. In such a case, the |ini| file set in the
-corresponding |babel-<language>.tex| (where |<language>| is the last
-argument in |\babelprovide|) is imported. See the list of recognized
-languages above. So, the previous example is best written as:
+\Describe{import=}{\meta{locale-tag}} The |<language-tag>| is optional.
+Imports the full data from the |ini| file corresponding to the locale
+being loaded, as set in |babel-<locale>.tex| (where |<locale>| is the
+last argument in |\babelprovide|), including captions and date (and
+also line breaking rules in newly defined languages). Unicode engines
+load the UTF-8 variants, while 8-bit engines load the LICR (ie, with
+macros like |\'| or |\ss|) ones.
+
+However, in some cases you may want to load a different |ini| file. In
+such a case, you can set its value.
+
+\begin{example}
+ For example, the locale |ar-DZ| is named |arabic-algeria|. You may
+ prefer the shorter name |arabic| if there are no conflicts:
\begin{verbatim}
-\babelprovide[_import_]{hungarian}
+\babelprovide[_import=ar-DZ_]{arabic}
\end{verbatim}
-
-There are 380 |ini| files for about 300 languages, with data taken from
-the |ldf| files and the CLDR provided by Unicode. Not all languages in
-the latter are complete, and therefore neither are the |ini| files. A
-few languages may show a warning about the current lack of suitability
-of some features.
+\end{example}
Besides |\today|, this option defines an additional command for dates:
|\<language>date|, which takes three arguments, namely, year, month and
day numbers. In fact, |\today| calls |\<language>today|, which in turn
calls |\<language>date{\the\year}{\the\month}{\the\day}|. \New{3.44}
-More convenient is usually |\localedate|, with prints the date for the
+More convenient is usually |\localedate|, which prints the date for the
current locale.
-\Describe{captions=}{\meta{language-tag}}
-Loads only the strings. For example:
-\begin{verbatim}
-\babelprovide[_captions=hu_]{hungarian}
-\end{verbatim}
-
\Describe{hyphenrules=}{\meta{language-list}} With this option, with a
space-separated list of hyphenation rules, \babel{} assigns to the
language the first valid hyphenation rules in the list. For example:
@@ -2613,8 +3024,7 @@ list is empty).
alternative to |justification=unhyphenated|.
\Describe{main}{} This valueless option makes the language the main one
-(thus overriding that set when \babel\ is loaded). Only in newly defined
-languages.
+(thus overriding that set when \babel\ is loaded).
\begin{example}
Let's assume your document (\xetex{} or \luatex{}) is mainly in
Polytonic Greek with but with some sections in Italian. Then, the
@@ -2655,7 +3065,7 @@ See the next section.
\Describe{Alph=}{\meta{counter-name}} Same for |\Alph|.
-\Describe{casing}{\meta{rules}} \New{3.90} Selects the casing rules in a few
+\Describe{casing=}{\meta{rules}} \New{3.90} Selects the casing rules in a few
languages. The first ones are predefined by \LaTeX{} (see
\textsf{interface3.pdf}), while the following are defined by \babel:
\begin{description}
@@ -2666,9 +3076,10 @@ languages. The first ones are predefined by \LaTeX{} (see
\item[Greek] |iota| converts the \textit{ypogegrammeni} (subscript muted
iota) to capital iota when uppercasing.
\item[Latin] |nouv| in |classicallatin| and |medievallatin| reverts
- the default rules, which maps u ↔ V; |uv| in |ecclesianticallatin|
- and the basic |latin| locale applies the map u ↔ V (by default it’s
- u ↔ U and v ↔ V).
+ the default rules, which maps u $\leftrightarrow$ V; |uv| in
+ |ecclesianticallatin| and the basic |latin| locale applies the map
+ u $\leftrightarrow$ V (by default it’s u $\leftrightarrow$ U and v
+ $\leftrightarrow$ V).
\end{description}
\begin{example} For the latter:
@@ -2727,21 +3138,252 @@ one whose script is Latin.
be still necessary.
\end{note}
-\Describe{intraspace=}{\meta{base} \meta{shrink} \meta{stretch}}
-Sets the interword space for the writing system of the language, in em
-units (so, |0 .1 0| is |0em plus .1em|). Like |\spaceskip|, the em unit
-applied is that of the current text (more precisely, the previous
-glyph). Currently used only in Southeast Asian scripts, like Thai, and
-CJK.
-
-\Describe{intrapenalty=}{\meta{penalty}}
-Sets the interword penalty for the writing system of this language.
-Currently used only in Southeast Asian scripts, like Thai. Ignored if 0
-(which is the default value).
-
\Describe{transforms=}{\meta{transform-list}}
See section~\ref{transforms}.
+\Describe{interchar=}{\meta{interchar-list}}
+See section~\ref{interchar}.
+
+\begin{note}
+ (1) If you need shorthands, you can define them with |\useshorthands|
+ and |\defineshorthand| as described above. (2) Captions and |\today|
+ are ``ensured'' with |\babelensure| (this is the default in
+ |ini|-based languages).
+\end{note}
+
+\begin{example} When creating a locale from another locale, you may want
+to reset some properties, like the BCP-47 tags. Here is an example of
+how to do it:
+\begin{verbatim}
+\babelprovide{spanish} % import=es by default
+\babelprovide[
+ import=es,
+ _identification/tag.bcp47 = es-x-medieval_,
+ _identification/extension.x.tag.bcp47 = medieval_]
+ {medievalspanish}
+\end{verbatim}
+\end{example}
+
+\section{Locale features}
+
+\subsection{Hyphenation and line breaking – 1. Commands}
+
+\Babel{} deals with three kinds of line breaking rules: Western,
+typically the LGC group, South East Asian, like Thai, and CJK, but
+support depends on the engine: \textsf{pdftex} only deals with the
+former, \xetex{} also with the second one (although in a limited way),
+while \luatex{} provides basic rules for the latter, too. With \luatex{}
+there are also tools for non-standard hyphenation rules, explained in
+the next section.
+
+\Describe{\babelhyphenation}{\texttt{[}\langlist\texttt{]}%
+ \marg{exceptions}}
+
+\New{3.9a} Sets hyphenation exceptions for the languages given
+or, without the optional argument, for \textit{all} languages (eg,
+proper nouns or common loan words, and of course monolingual
+documents). Multiple declarations work much like |\hyphenation| (last
+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<language>| as well as the language-specific
+encoding (not set in the preamble by default). Multiple
+|\babelhyphenation|'s are allowed. For example:
+\begin{verbatim}
+\babelhyphenation{Wal-hal-la Dar-bhan-ga}
+\end{verbatim}
+
+Listed words are saved expanded and therefore it relies on the
+LICR. Of course, it also works without the LICR if the input and the
+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). 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}
+ Use |\babelhyphenation| instead of |\hyphenation| to set hyphenation
+ exceptions in the preamble before any language is explicitly set with
+ a selector. In the preamble the hyphenation rules are not always
+ fully set up and an error can be raised.
+\end{note}
+
+\Describe{\babelpatterns}{\texttt{[}\langlist\texttt{]}%
+ \marg{patterns}}
+
+\New{3.9m} \textit{In \textsf{luatex} only},\footnote{With
+\textsf{luatex} exceptions and patterns can be modified almost
+freely. However, this is very likely a task for a separate package
+and \texttt{babel} only provides the most basic tools.} adds or
+replaces patterns for the languages given or, without the optional
+argument, for \textit{all} languages. If a pattern for a certain
+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<language>| as well as the language-specific
+encoding (not set in the preamble by default). Multiple
+|\babelpatterns|'s are allowed.
+
+Listed patterns are saved expanded and therefore it relies on the
+LICR. Of course, it also works without the LICR if the input and the
+font encodings are the same, like in Unicode based engines.
+
+\New{3.31} (Only \luatex.) With |\babelprovide| and |import|ed CJK
+languages, a simple generic line breaking algorithm (push-out-first) is
+applied, based on a selection of the Unicode rules (\New{3.32} it is
+disabled in verbatim mode, or more precisely when the hyphenrules
+are set to |nohyphenation|). It can be activated alternatively by
+setting explicitly the |intraspace|.
+
+\New{3.27} Interword spacing for Thai, Lao and Khemer is activated
+automatically if a language with one of those scripts are loaded with
+|\babelprovide|. See the sample on the \babel{} repository. With both
+Unicode engines, spacing is based on the ``current'' em unit (the size
+of the previous char in \luatex, and the font size set by the last
+|\selectfont| in \xetex).
+
+\begin{note}
+ With Unicode engines, a line break can happen just before an explicit
+ combining char (eg, \textit{\~{g}}, used in Guarani and Filipino, is
+ not included as a combined char and it’s represented in Unicode as
+ |U+0067|~|U+0303|. This issue is not directly related to \babel, but
+ to the hyphenation patterns and/or the font renderer. However, at
+ least with \luatex{} there is a workaround (change the language name
+ to what you are using):
+\begin{verbatim}
+\babelposthyphenation{guarani}{ | [{0300}-{036F}] }{ remove, {} }
+\end{verbatim}
+The Lua pattern means ‘a discretionary followed by a character in the
+range |U+0300|--|U+0367| (which contains combining chars)’. An
+alternative to a transform is |\babelpatterns|.
+\end{note}
+
+\Describe{\babelhyphenmins}{%
+ \optstar\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{\babelhyphen}{\optstar\marg{type}}
+\DescribeOther{\babelhyphen}{\optstar\marg{text}}
+
+\New{3.9a} It is customary to classify hyphens in two types: (1)
+\textit{explicit} or \textit{hard hyphens}, which in \TeX\ are
+entered as \verb|-|, and (2) \textit{optional} or \textit{soft
+hyphens}, which are entered as \verb|\-|. Strictly, a \textit{soft
+hyphen} is not a hyphen, but just a breaking opportunity or, in
+\TeX\ terms, a ``discretionary''; a \textit{hard hyphen} is a hyphen
+with a breaking opportunity after it. A further type is a
+\textit{non-breaking hyphen}, a hyphen without a breaking
+opportunity.
+
+In \TeX, \verb|-| and \verb|\-| forbid further breaking opportunities
+in the word. This is the desired behavior very often, but not always,
+and therefore many languages provide shorthands for these
+cases. Unfortunately, this has not been done consistently: for
+example, \verb|"-| in Dutch, Portuguese, Catalan or Danish is a hard
+hyphen, while in German, Spanish, Norwegian, Slovak or Russian is a
+soft hyphen. Furthermore, some of them even redefine |\-|, so that you
+cannot insert a soft hyphen without breaking opportunities in the rest
+of the word.
+
+Therefore, some macros are provided with a set of basic ``hyphens''
+which can be used by themselves, to define a user shorthand, or even
+in language files.
+\begin{itemize}
+\item |\babelhyphen{soft}| and |\babelhyphen{hard}| are self
+ explanatory.
+\item |\babelhyphen{repeat}| inserts a hard hyphen which is repeated
+ at the beginning of the next line, as done in languages like
+ Polish, Portuguese and Spanish.
+\item |\babelhyphen{nobreak}| inserts a hard hyphen without a break
+ after it (even if a space follows).
+\item |\babelhyphen{empty}| inserts a break opportunity without
+ a hyphen at all.
+\item |\babelhyphen|\marg{text} is a hard ``hyphen'' using \m{text}
+ instead. A typical case is |\babelhyphen{/}|.
+\end{itemize}
+With all of them, hyphenation in the rest of the word is enabled. If
+you don't want to enable it, there is a starred counterpart:
+|\babelhyphen*{soft}| (which in most cases is equivalent to the
+original |\-|), |\babelhyphen*{hard}|, etc.
+
+Note |hard| is also good for isolated prefixes (eg, \textit{anti-})
+and |nobreak| for isolated suffixes (eg, \textit{-ism}), but in both
+cases |\babelhyphen*{nobreak}| is usually better.
+
+There are also some differences with \LaTeX: (1) the character used is
+that set for the current font, while in \LaTeX{} it is hardwired to
+|-| (a typical value); (2) the hyphen to be used in fonts with a
+negative |\hyphenchar| is |-|, like in \LaTeX, but it can be changed to
+another value by redefining |\babelnullhyphen|; (3) a break after the
+hyphen is forbidden if preceded by a glue ${>}0$~pt (at the beginning
+of a word, provided it is not immediately preceded by, say, a
+parenthesis).
+
+\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}).
+
+\begin{note}
+ For the hyphenation to work correctly, lccodes cannot change, because
+ \TeX{} only takes into account the values when the paragraph is
+ hyphenated, i.e., when it has been finished.\footnote{This explains
+ why \LaTeX{} assumes the lowercase mapping of T1 and does not provide
+ a tool for multiple mappings. Unfortunately, \cs{savinghyphcodes} is
+ not a solution either, because lccodes for hyphenation are frozen in
+ the format and cannot be changed.} So, if you write a chunk of French
+ text with |\foreignlanguage|, the apostrophes might not be taken into
+ account. This is a limitation of \TeX, not of \babel. Alternatively,
+ you may use |\useshorthands| to activate |'| and |\defineshorthand|,
+ or redefine |\textquoteright| (the latter is called by the non-ASCII
+ right quote).
+\end{note}
+
+\subsection{Hyphenation and line breaking – 2. ‘Provide’ options}
+
\Describe{justification=}{\texttt{unhyphenated} $\string|$
\texttt{kashida} $\string|$ \texttt{elongated} $\string|$
\texttt{padding}}
@@ -2749,14 +3391,14 @@ See section~\ref{transforms}.
dependent, so that they will not be applied to other languages.
The first one (|unhyphenated|) activates a line breaking mode that
-allows spaces to be stretched to arbitrary amounts. Although for
-European standards the result may look odd, in some writing systems,
-like Malayalam and other Indic scripts, this has been the customary
-(although not always the desired) practice. Because of that, no locale
-sets currently this mode by default (Amharic is an exception). Unlike
-|\sloppy|, the |\hfuzz| and the |\vfuzz| are not changed, because this
-line breaking mode is not really ‘sloppy’ (in other words, overfull
-boxes are reported as usual).
+allows breaks only at spaces, which can be stretched to arbitrary
+amounts. Although for European standards the result may look odd, in
+some writing systems, like Malayalam and other Indic scripts, this has
+been the customary (although not always the desired) practice. Because
+of that, no locale sets currently this mode by default (Amharic is an
+exception). Unlike |\sloppy|, the |\hfuzz| and the |\vfuzz| are not
+changed, because this line breaking mode is not really ‘sloppy’ (in
+other words, overfull boxes are reported as usual).
The second and the third are for the Arabic script. It sets the
linebreaking and justification method, which can be based on the
@@ -2775,13 +3417,316 @@ It’s still somewhat experimental. Again, there is an explanation in the
\New{3.59} Just a synonymous for \texttt{justification}. Depending on
the language, this name can make more sense.
+\Describe{intraspace=}{\meta{base} \meta{shrink} \meta{stretch}}
+Sets the interword space for the writing system of the language, in em
+units (so, |0 .1 0| is |0em plus .1em|). Like |\spaceskip|, the em unit
+applied is that of the current text (more precisely, the previous
+glyph). Currently used only in Southeast Asian scripts, like Thai, and
+CJK.
+
+\Describe{intrapenalty=}{\meta{penalty}}
+Sets the interword penalty for the writing system of this language.
+Currently used only in Southeast Asian scripts, like Thai. If 0, which
+is the default value, no penalty is inserted.
+
+\subsection{Shorthands – 1. Commands}
+
+A \textit{shorthand} is a sequence of one or two characters that
+expands to arbitrary \TeX{} code.
+
+Shorthands can be used for different kinds of things; for example:
+(1) in some languages shorthands such as |"a| are defined to be able
+to hyphenate the word if the encoding is |OT1|; (2) in some languages
+shorthands such as |!| are used to insert the right amount of white
+space; (3) several kinds of discretionaries and breaks can be inserted
+easily with |"-|, |"=|, etc.
+
+The package \textsf{inputenc} as well as \xetex{} and \luatex{} have
+alleviated entering non-ASCII characters, but minority languages and
+some kinds of text can still require characters not directly available
+on the keyboards (and sometimes not even as separated or precomposed
+Unicode characters). As to the point 2, now \textsf{pdfTeX} provides
+|\knbccode|, and \luatex{} can manipulate the glyph list. Tools for
+point 3 can be still very useful in general.
+
+There are four levels of shorthands: \textit{user}, \textit{language},
+\textit{system}, and \textit{language user} (by order of precedence).
+In most cases, you will use only shorthands provided by languages.
+
+\begin{note} Keep in mind the following:
+\begin{enumerate}
+\item Activated chars used for two-char shorthands cannot be followed
+ by a closing brace |}| and the spaces following are gobbled. With
+ one-char shorthands (eg,~|:|), they are preserved.
+\item If on a certain level (system, language, user, language user)
+ there is a one-char shorthand, two-char ones starting with that char
+ and on the same level are ignored.
+\item Since they are active, a shorthand cannot contain the same
+ character in its definition (except if deactivated with, eg,
+ |\string|).
+\end{enumerate}
+\end{note}
+
+\begin{troubleshooting}
+\trouble{Argument of \textbackslash language@active@arg"
+has an extra \textbraceright}
+A typical error when using shorthands is the following:
+\begin{verbatim}
+! Argument of \language@active@arg" has an extra }.
+\end{verbatim}
+It means there is a closing brace just after a shorthand, which is not
+allowed (eg,~|"}|). Just add |{}| after (eg,~|"{}}|).
+\end{troubleshooting}
+
+\Describe{\shorthandon}{\marg{shorthands-list}}
+\DescribeOther{\shorthandoff}{\optstar\marg{shorthands-list}}
+It is sometimes necessary to switch a shorthand
+character off temporarily, because it must be used in an
+entirely different way. For this purpose, the user commands
+|\shorthandoff| and |\shorthandon| are provided. They each take a
+list of characters as their arguments.
+
+The command |\shorthandoff| sets the |\catcode| for each of the
+characters in its argument to other (12); the command |\shorthandon|
+sets the |\catcode| to active (13). Both commands only work on `known'
+shorthand characters, and an error will be raised otherwise. You can
+check if a character is a shorthand with |\ifbabelshorthand| (see
+below).
+
+\New{3.9a} However, |\shorthandoff| does not behave as
+you would expect with characters like |~| or |^|, because they
+usually are not ``other''. For them |\shorthandoff*| is provided,
+so that with
+\begin{verbatim}
+\shorthandoff*{~^}
+\end{verbatim}
+|~| is still active, very likely with the meaning of a non-breaking
+space, and |^| is the superscript character. The catcodes used are
+those when the shorthands are defined, usually when language files are
+loaded.
+
+If you do not need shorthands, or prefer an alternative approach of
+your own, you may want to switch them off with the package option
+|shorthands=off|, as described below.
+
+\begin{warning}
+ It is worth emphasizing these macros are meant for temporary changes.
+ Whenever possible shorthands must be always enabled or disabled.
+\end{warning}
+
+\Describe{\useshorthands}{\optstar\marg{char}}
+
+It initiates the definition of user-defined
+shorthand sequences. It has one argument, the character that starts
+these personal shorthands.
+
+\New{3.9a} User shorthands are not always alive, as they may
+be deactivated by languages (for example, if you use |"| for your user
+shorthands and switch from \textsf{german} to \textsf{french}, they
+stop working). Therefore, a starred version
+|\useshorthands*|\marg{char} is provided, which makes sure shorthands
+are always activated.
+
+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}}
+
+It takes two arguments: the first is a one- or two-character shorthand
+sequence, and the second is the 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{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 system
+shorthands. Language-dependent user shorthands take precedence over
+``normal'' user shorthands.
+
+\begin{example}
+ Let's assume you want a unified set of shorthand for discretionaries
+ (languages do not define shorthands consistently, and |"-|, |\-|,
+ |"=| have different meanings). You can start with, say:
+\begin{verbatim}
+\useshorthands*{"}
+\defineshorthand{"*}{\babelhyphen{soft}}
+\defineshorthand{"-}{\babelhyphen{hard}}
+\end{verbatim}
+ However, the behavior of hyphens is language-dependent. For example, in
+ languages like Polish and Portuguese, a hard hyphen inside compound
+ words are repeated at the beginning of the next line. You can then
+ set:
+\begin{verbatim}
+\defineshorthand[*polish,*portuguese]{"-}{\babelhyphen{repeat}}
+\end{verbatim}
+ Here, options with |*| set a language-dependent user shorthand,
+ which means the generic one above only applies for the rest of
+ languages; without |*| they would (re)define the language shorthands
+ instead, which are overridden by user ones.
+
+ Now, you have a single unified shorthand (|"-|), with a
+ content-based meaning (`compound word hyphen') whose visual behavior
+ is that expected in each context.
+\end{example}
+
+\Describe{\languageshorthands}{\marg{language}}
+
+Used to switch the shorthands on the
+language level. It takes one argument, the name of a language or
+|none| (the latter does what its name suggests).\footnote{Actually,
+any name not corresponding to a language group does the same as
+\texttt{none}. However, follow this convention because it might be
+enforced in future releases of \babel{} to catch possible errors.}
+Note that for this to work the language should have been specified as
+an option when loading the \babel\ package. For example, you can use
+in \textsf{english} the shorthands defined by \textsf{ngerman} with
+\begin{verbatim}
+\addto\extrasenglish{\languageshorthands{ngerman}}
+\end{verbatim}
+(You may also need to activate them as user shorthands in the preamble
+with, for example, |\useshorthands| or |\useshorthands*|.)
+
+\begin{example}
+ Very often, this is a more convenient way to deactivate shorthands
+ than |\shorthandoff|, for example if you want to define a macro
+ to easy typing phonetic characters with \textsf{tipa}:
+\begin{verbatim}
+\newcommand{\myipa}[1]{{_\languageshorthands{none}_\tipaencoding#1}}
+\end{verbatim}
+\end{example}
+
+\Describe{\babelshorthand}{\marg{shorthand}}
+With this command you can use a shorthand even if (1) not activated in
+\texttt{shorthands} (in this case only shorthands for the current
+language are taken into account, ie, not user shorthands), (2) turned
+off with |\shorthandoff| or (3) deactivated with the internal
+|\bbl@deactivate|; for example, \verb|\babelshorthand{"u}| or
+\verb|\babelshorthand{:}|. (You can conveniently define your own
+macros, or even your own user shorthands provided they do not overlap.)
+
+\begin{example}
+ Since by default shorthands are not activated until
+ |\begin{document}|, you may use this macro when defining the |\title|
+ in the preamble:
+\begin{verbatim}
+\title{Documento científico_\babelshorthand{"-}_técnico}
+\end{verbatim}
+\end{example}
+
+\bigskip
+
+For your records, here is a list of shorthands, but you must double
+check them, as they may change:\footnote{Thanks to Enrico Gregorio}
+
+\begin{description}
+\itemsep=-\parskip
+\item[Languages with no shorthands] Croatian, English (any variety),
+ Indonesian, Hebrew, Interlingua, Irish, Lower Sorbian, Malaysian,
+ North Sami, Romanian, Scottish, Welsh
+\item[Languages with only \texttt{"} as defined shorthand character]
+ Albanian, Bulgarian, Danish, Dutch, Finnish, German (old and new
+ orthography, also Austrian), Icelandic, Italian, Norwegian, Polish,
+ Portuguese (also Brazilian), Russian, Serbian (with Latin script),
+ Slovene, Swedish, Ukrainian, Upper Sorbian
+\item[Basque] |" ' ~|
+\item[Breton] |: ; ? !|
+\item[Catalan] |" ' `|
+\item[Czech] |" -|
+\item[Esperanto] |^|
+\item[Estonian] |" ~|
+\item[French] (all varieties) |: ; ? !|
+\item[Galician] |" . ' ~ < >|
+\item[Greek] (ancient, polutoniko, only 8-bit \TeX) |~|, (optional, see
+the manual for Greek) |;|
+\item[Hungarian] |`|
+\item[Kurmanji] |^|
+\item[Latin] |" ^ =|
+\item[Slovak] |" ^ ' -|
+\item[Spanish] |" . < > ' ~|
+\item[Turkish] |: ! =|
+\end{description}
+In addition, the \babel{} core declares |~| as a one-char shorthand
+which is let, like the standard |~|, to a non breaking
+space.\footnote{This declaration serves to nothing, but it is
+preserved for backward compatibility.}
+
+\Describe\ifbabelshorthand{\marg{character}\marg{true}\marg{false}}
+
+\New{3.23} Tests if a character has been made a shorthand.
+
\begin{note}
- (1) If you need shorthands, you can define them with |\useshorthands|
- and |\defineshorthand| as described above. (2) Captions and |\today|
- are ``ensured'' with |\babelensure| (this is the default in
- |ini|-based languages).
+ \catcode`\|=12\relax Both \textsf{ltxdoc} and \textsf{babel} use
+ \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
+ 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
+ with the correct catcodes for \verb/|/ and
+ \verb|:|).\catcode`\|=\active
\end{note}
+\begin{note}
+Using a character mathematically active (ie, with math code |"8000|) as
+a shorthand can make \TeX{} enter in an infinite loop in some rare
+cases. (There is a partial solution.)
+\end{note}
+
+\subsection{Shorthands – 2. Package options}
+
+\Describe{activeacute}{}
+\DescribeOther{activegrave}{}
+
+For some languages \babel\ supports these options to set |'| and |`|,
+respectively, as a shorthand in case it is not done by default.
+
+\Describe{shorthands=}{\meta{char}\meta{char}...
+$\string|$ \texttt{off}}
+The only language shorthands activated
+are those given, like, eg:
+\begin{verbatim}
+\usepackage[esperanto,french,_shorthands=:;!?_]{babel}
+\end{verbatim}
+If \verb|'| is included, \texttt{activeacute} is set; if \verb|`| is
+included, \texttt{activegrave} is set. Active characters (like
+\verb|~|) should be preceded by \verb|\string| (otherwise they will be
+expanded by \LaTeX{} before they are passed to the package and
+therefore they will not be recognized); however, |t| is provided for
+the common case of |~| (as well as |c| for not so common case of the
+comma).
+
+With |shorthands=off| no language shorthands are defined,
+As some languages use this mechanism for tools not available
+otherwise, a macro \verb|\babelshorthand| is defined, which allows
+using them; see above.
+
+\Describe{safe=}{\texttt{none} $\string|$ \texttt{ref} $\string|$
+\texttt{bib}} Some \LaTeX{} macros are redefined so that using
+shorthands is safe. With \texttt{safe=bib} only |\nocite|, |\bibcite|
+and |\bibitem| are redefined. With |safe=ref| only |\newlabel|, |\ref|
+and |\pageref| are redefined (as well as a few macros from
+\textsf{varioref} and \textsf{ifthen}).
+
+With |safe=none| no macro is redefined. This option is strongly
+recommended, because a good deal of incompatibilities and errors are
+related to these redefinitions. As of \New{3.34}, in $\epsilon$\TeX{}
+based engines (ie, almost every engine except the oldest ones)
+shorthands can be used in these macros (formerly you could not).
+
+\Describe{math=}{\texttt{active} $\string|$ \texttt{normal}}
+Shorthands are mainly intended for text, not for math. By setting this
+option with the value |normal| they are deactivated in math mode
+(default is |active|) and things like |${a'}$| (a closing brace after
+a shorthand) are not a source of trouble anymore.
+
\subsection{Digits and counters}
\New{3.20} About thirty |ini| files define a field named
@@ -2796,9 +3741,9 @@ well dates do not rely on |\arabic|.)
For example:
\begin{verbatim}
-\babelprovide[import]{telugu}
- % Or also, if you want:
- % \babelprovide[import, maparabic]{telugu}
+\usepackage[telugu, provide=*]{babel}
+ % Or also, if you want, with:
+ % provide={ maparabic }
\babelfont{rm}{Gautami} % With luatex, better with Harfbuzz
\begin{document}
_\telugudigits{1234}_
@@ -2808,51 +3753,52 @@ _\telugucounter{section}_
Languages providing native digits in all or some variants are:
\begin{multicols}{5}
+\parindent0pt
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
@@ -2861,7 +3807,7 @@ is applied to the typeset text (not math, PDF bookmarks, etc.) before
bidi and fonts are processed (ie, to the node list as generated by the
\TeX{} code). This means the local digits have the correct
bidirectional behavior (unlike |Numbers=Arabic| in \textsf{fontspec},
-which is deprecated).
+which is deprecated). Another option is the transform |digits.native|.
\begin{note}
With \xetex{} you can use the option |Mapping| when defining a
@@ -2888,7 +3834,7 @@ language, see the list below):
\item In |\babelprovide|, as an argument to the keys |alph| and |Alph|,
which redefine what |\alph| and |\Alph| print. For example:
\begin{verbatim}
-\babelprovide[alph=alphabetic]{thai}
+\babelprovide[_alph=alphabetic_]{thai}
\end{verbatim}
\end{itemize}
@@ -3040,313 +3986,6 @@ The optional argument converts the given date, in the form
calendars accept only a restricted range of years. Please, refer to the
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.
-
-\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.
-\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.
-
-\Describe{\localeinfo}{%
- \colorbox{thegrey}{\ttfamily\hskip-.2em*\hskip-.2em}{\marg{field}}}
-
-\New{3.38} If an |ini| file has been loaded for the current language,
-you may access the information stored in it. This macro is fully
-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
- is the value to be used for the ‘real' provided tag (\babel{} may
- fill other fields if they are considered necessary).
-\item[|language.tag.bcp47|] is the BCP 47 language tag.
-\item[|tag.opentype|] is the tag used by OpenType (usually, but not
- always, the same as BCP 47).
-\item[|script.name|], as provided by the Unicode CLDR.
-\item[|script.tag.bcp47|] is the BCP 47 tag of the script
- used by this locale. This is a required field for the fonts to be
- correctly set up, and therefore it should be always defined.
-\item[|script.tag.opentype|] is the tag used by OpenType (usually,
- but not always, the same as BCP 47).
-\item[|region.tag.bcp47|] is the BCP 47 tag of the region or territory.
- Defined only if the locale loaded actually contains it (eg, |es-MX|
- does, but |es| doesn’t), which is how locales behave in the CLDR.
- \New{3.75}
-\item[|variant.tag.bcp47|] is the BCP 47 tag of the variant (in the BCP 47
- sense, like |1901| for German). \New{3.75}
-\item[|extension.|\m{s}|.tag.bcp47|] is the BCP 47 value of the
- extension whose singleton is \m{s} (currently the recognized
- singletons are |x|, |t| and |u|). The internal syntax can be somewhat
- complex, and this feature is still somewhat tentative. An example is
- \textsf{classicallatin} which sets |extension.x.tag.bcp47| to |classic|.
- \New{3.75}
-\end{description}
-
-\begin{note}
- Currently, |x| is used for two separate functions, namely,
- identifying a \babel{} locale without a BCP47 tag and setting an
- alternative set of rules for casing.
-\end{note}
-
-\begin{warning}
- \New{3.46} As of version 3.46 |tag.bcp47| returns the full BCP 47
- tag. Formerly it returned just the language subtag, which was clearly
- counterintuitive.
-\end{warning}
-
-\New{3.75} Sometimes, it comes in handy to be able to use |\localeinfo|
-in an expandable way even if something went wrong (for example, the
-locale currently active is undefined). For these cases, |localeinfo*|
-just returns an empty string instead of raising an error. Bear in mind
-that \babel{}, following the CLDR, may leave the region unset, which
-means |\getlocaleproperty*|, described below, is the preferred
-command, so that the existence of a field can be checked before. This
-also means building a string with the language and the region with
-|\localeinfo*{language.tab.bcp47}|\allowbreak |-|\allowbreak
-|\localeinfo*{region.tab.bcp47}| is not usually a good idea (because of
-the hyphen).
-
-\Describe{\getlocaleproperty}{%
- \colorbox{thegrey}{\ttfamily\hskip-.2em*\hskip-.2em}%
- \marg{macro}\marg{locale}\marg{property}}
-
-\New{3.42} The value of any locale property as set by the |ini| files
-(or added/modified with |\babelprovide|) can be retrieved and stored in
-a macro with this command. For example, after:
-\begin{verbatim}
- \getlocaleproperty\hechap{hebrew}{captions/chapter}
-\end{verbatim}
-the macro |\hechap| will contain the string
-{\fontspec[Scale=.87,Script=Hebrew]{Liberation Mono}\textdir TRT פרק}.
-
-If the key does not exist, the macro is set to |\relax| and an error is
-raised. \New{3.47} With the starred version no error is raised, so that
-you can take your own actions with undefined properties.
-
-\Describe{\localeid}{}
-Each language in the \babel{} sense has its own unique numeric
-identifier, which can be retrieved with |\localeid|.
-
-The |\localeid| is not the same as the |\language| identifier, which
-refers to a set of hyphenation patterns (which, in turn, is just a
-component of the line breaking algorithm described in the next
-section). The data about preloaded patterns are store in an internal
-macro named |\bbl@languages| (see the code for further details), but
-note several locales may share a single |\language|, so they are
-separated concepts. In \luatex, the |\localeid| is saved in each node
-(when it makes sense) as an attribute, too.
-
-\Describe{\ShowLocaleProperties}{\marg{language}}
-\New{3.98} Prints to the |log| file all the loaded key/value pairs from
-the |ini| locale file for \meta{language}.
-
-\Describe{\LocaleForEach}{\marg{code}}
-\Babel{} remembers which |ini| files have been loaded. There is a loop
-named |\LocaleForEach| to traverse the list, where |#1| is the name of
-the current item, so that |\LocaleForEach{\message{ **#1** }}| just
-shows the loaded |ini|’s.
-
-\Describe{ensureinfo=off}{}
-\New{3.75} Previously, |ini| files were loaded only with |\babelprovide|
-and also when languages are selected if there is a |\babelfont| or they
-have not been explicitly declared. Now the |ini| files are loaded (and
-therefore the corresponding data) even if these two conditions are not
-met (in previous versions you had to enable it with |\BabelEnsureInfo|
-in the preamble). Because of the way this feature works, problems are
-very unlikely, but there is switch as a package option to turn the new
-behavior off (|ensureinfo=off|).
-
-\subsection{Hyphenation and line breaking}
-
-\Babel{} deals with three kinds of line breaking rules: Western,
-typically the LGC group, South East Asian, like Thai, and CJK, but
-support depends on the engine: \textsf{pdftex} only deals with the
-former, \xetex{} also with the second one (although in a limited way),
-while \luatex{} provides basic rules for the latter, too. With \luatex{}
-there are also tools for non-standard hyphenation rules, explained in
-the next section.
-
-\Describe{\babelhyphen}{%
- \colorbox{thegrey}{\ttfamily\hskip-.2em*\hskip-.2em}\marg{type}}
-\DescribeOther\babelhyphen{%
- \colorbox{thegrey}{\ttfamily\hskip-.2em*\hskip-.2em}\marg{text}}
-
-\New{3.9a} It is customary to classify hyphens in two types: (1)
-\textit{explicit} or \textit{hard hyphens}, which in \TeX\ are
-entered as \verb|-|, and (2) \textit{optional} or \textit{soft
-hyphens}, which are entered as \verb|\-|. Strictly, a \textit{soft
-hyphen} is not a hyphen, but just a breaking opportunity or, in
-\TeX\ terms, a ``discretionary''; a \textit{hard hyphen} is a hyphen
-with a breaking opportunity after it. A further type is a
-\textit{non-breaking hyphen}, a hyphen without a breaking
-opportunity.
-
-In \TeX, \verb|-| and \verb|\-| forbid further breaking opportunities
-in the word. This is the desired behavior very often, but not always,
-and therefore many languages provide shorthands for these
-cases. Unfortunately, this has not been done consistently: for
-example, \verb|"-| in Dutch, Portuguese, Catalan or Danish is a hard
-hyphen, while in German, Spanish, Norwegian, Slovak or Russian is a
-soft hyphen. Furthermore, some of them even redefine |\-|, so that you
-cannot insert a soft hyphen without breaking opportunities in the rest
-of the word.
-
-Therefore, some macros are provided with a set of basic ``hyphens''
-which can be used by themselves, to define a user shorthand, or even
-in language files.
-\begin{itemize}
-\item |\babelhyphen{soft}| and |\babelhyphen{hard}| are self
- explanatory.
-\item |\babelhyphen{repeat}| inserts a hard hyphen which is repeated
- at the beginning of the next line, as done in languages like
- Polish, Portuguese and Spanish.
-\item |\babelhyphen{nobreak}| inserts a hard hyphen without a break
- after it (even if a space follows).
-\item |\babelhyphen{empty}| inserts a break opportunity without
- a hyphen at all.
-\item |\babelhyphen|\marg{text} is a hard ``hyphen'' using \m{text}
- instead. A typical case is |\babelhyphen{/}|.
-\end{itemize}
-With all of them, hyphenation in the rest of the word is enabled. If
-you don't want to enable it, there is a starred counterpart:
-|\babelhyphen*{soft}| (which in most cases is equivalent to the
-original |\-|), |\babelhyphen*{hard}|, etc.
-
-Note |hard| is also good for isolated prefixes (eg, \textit{anti-})
-and |nobreak| for isolated suffixes (eg, \textit{-ism}), but in both
-cases |\babelhyphen*{nobreak}| is usually better.
-
-There are also some differences with \LaTeX: (1) the character used is
-that set for the current font, while in \LaTeX{} it is hardwired to
-|-| (a typical value); (2) the hyphen to be used in fonts with a
-negative |\hyphenchar| is |-|, like in \LaTeX, but it can be changed to
-another value by redefining |\babelnullhyphen|; (3) a break after the
-hyphen is forbidden if preceded by a glue ${>}0$~pt (at the beginning
-of a word, provided it is not immediately preceded by, say, a
-parenthesis).
-
-\Describe\babelhyphenation{\texttt{[}\langlist\texttt{]}%
- \marg{exceptions}}
-
-\New{3.9a} Sets hyphenation exceptions for the languages given
-or, without the optional argument, for \textit{all} languages (eg,
-proper nouns or common loan words, and of course monolingual
-documents). Multiple declarations work much like |\hyphenation| (last
-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
-encoding (not set in the preamble by default). Multiple
-|\babelhyphenation|'s are allowed. For example:
-\begin{verbatim}
-\babelhyphenation{Wal-hal-la Dar-bhan-ga}
-\end{verbatim}
-
-Listed words are saved expanded and therefore it relies on the
-LICR. Of course, it also works without the LICR if the input and the
-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.
-\end{note}
-
-\begin{note}
- Use |\babelhyphenation| instead of |\hyphenation| to set hyphenation
- exceptions in the preamble before any language is explicitly set with
- a selector. In the preamble the hyphenation rules are not always
- 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}}
-
-\New{3.9m} \textit{In \textsf{luatex} only},\footnote{With
-\textsf{luatex} exceptions and patterns can be modified almost
-freely. However, this is very likely a task for a separate package
-and \texttt{babel} only provides the most basic tools.} adds or
-replaces patterns for the languages given or, without the optional
-argument, for \textit{all} languages. If a pattern for a certain
-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
-encoding (not set in the preamble by default). Multiple
-|\babelpatterns|'s are allowed.
-
-Listed patterns are saved expanded and therefore it relies on the
-LICR. Of course, it also works without the LICR if the input and the
-font encodings are the same, like in Unicode based engines.
-
-\New{3.31} (Only \luatex.) With |\babelprovide| and |import|ed CJK
-languages, a simple generic line breaking algorithm (push-out-first) is
-applied, based on a selection of the Unicode rules (\New{3.32} it is
-disabled in verbatim mode, or more precisely when the hyphenrules
-are set to |nohyphenation|). It can be activated alternatively by
-setting explicitly the |intraspace|.
-
-\New{3.27} Interword spacing for Thai, Lao and Khemer is activated
-automatically if a language with one of those scripts are loaded with
-|\babelprovide|. See the sample on the \babel{} repository. With both
-Unicode engines, spacing is based on the ``current'' em unit (the size
-of the previous char in \luatex, and the font size set by the last
-|\selectfont| in \xetex).
-
-\begin{note}
- With Unicode engines, a line break can happen just before an explicit
- combining char (eg, \textit{\~{g}}, used in Guarani and Filipino, is
- not included as a combined char and it’s represented in Unicode as
- |U+0067|~|U+0303|. This issue is not directly related to \babel, but
- to the hyphenation patterns and/or the font renderer. However, at
- least with \luatex{} there is a workaround (change the language name
- to what you are using):
-\begin{verbatim}
-\babelposthyphenation{guarani}{ | [{0300}-{036F}] }{ remove, {} }
-\end{verbatim}
-The Lua pattern means ‘a discretionary followed by a character in the
-range |U+0300|--|U+0367| (which contains combining chars)’. An
-alternative to a transform is |\babelpatterns|.
-\end{note}
-
\subsection{Transforms}
\label{transforms}
@@ -3391,9 +4030,15 @@ some fine-tuning. More to follow in future releases.)
\parbox[t]{4.0cm}{\strut\ttfamily#2}%
\hspace{2mm}%
\parbox[t]{6.6cm}{\strut#3}\par}
-\bigskip\hrule\nobreak\vspace{.5mm}
-% \strut\hfil Transforms
-% \medskip\hrule\nobreak
+\bigskip\hrule\nobreak\vspace{.5mm}\parindent0pt
+
+\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
@@ -3625,6 +4270,7 @@ This feature is activated with the first |\babelposthyphenation| or
the current language.
\subsection{Support for \xetex{} interchar}
+\label{interchar}
\New{3.97} A few macros are provided to deal with locale dependent
inter-character rules (aka ‘interchar’).
@@ -3638,11 +4284,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}}
@@ -3704,7 +4349,7 @@ the ‘provided’ locale. Currently the following |interchar|’s are defined:
\parbox[t]{4.0cm}{\strut\ttfamily#2}%
\hspace{2mm}%
\parbox[t]{6.6cm}{\strut#3}\par}
-\bigskip\hrule\nobreak\vspace{.5mm}
+\bigskip\hrule\nobreak\vspace{.5mm}\parindent0pt
\trans{Cantonese, Chinese, Japanese,
Korean}{linebreak.basic}{\New{24.4} Basic settings for CJK
@@ -3725,85 +4370,7 @@ characters \textit{;:!?«»} are applied.}
relevant key for the current engine is taken into account.
\end{note}
-\subsection{Selection based on BCP 47 tags}
-\label{bcp47}
-
-\New{3.43} The recommended way to select languages is that described at
-the beginning of this document. However, BCP 47 tags are becoming
-customary, particularly in documents (or parts of documents) generated
-by external sources, and therefore \babel{} will provide a set of tools
-to select the locales in different situations, adapted to the
-particular needs of each case. Currently, \babel{} provides autoloading
-of locales as described in this section. In these contexts autoloading
-is particularly important because we may not know on beforehand which
-languages will be requested.
-
-It must be activated explicitly, because it is primarily meant for
-special tasks. Mapping from BCP 47 codes to locale names are not
-hardcoded in \babel. Instead the data is taken from the \texttt{ini}
-files, which means currently about 250 tags are already recognized.
-\Babel{} performs a simple lookup in the following way: |fr-Latn-FR| $\to$
-|fr-Latn| $\to$ |fr-FR| $\to$ |fr|. Languages with the same resolved
-name are considered the same. Case is normalized before, so that
-|fr-latn-fr| $\to$ |fr-Latn-FR|. If a tag and a name overlap, the tag
-takes precedence.
-
-Here is a minimal example:
-\begin{verbatim}
-\documentclass{article}
-
-\usepackage[danish]{babel}
-
-_\babeladjust{_
-_ autoload.bcp47 = on,_
-_ autoload.bcp47.options = import_
-_}_
-
-\begin{document}
-
-Chapter in Danish: \chaptername.
-
-_\selectlanguage{de-AT}_
-
-\localedate{2020}{1}{30}
-
-\end{document}
-\end{verbatim}
-
-Currently the locales loaded are based on the \texttt{ini} files and
-decoupled from the main \texttt{ldf} files. This is by design, to
-ensure code generated externally produces the same result regardless of
-the languages requested in the document, but an option to use the
-\texttt{ldf} instead will be added in a future release, because both
-options make sense depending on the particular needs of each document
-(there will be some restrictions, however).
-
-The behaviour is adjusted with |\babeladjust| with the following parameters:
-\begin{description}
-\item \texttt{autoload.bcp47} with values |on| and |off|.
-\item \texttt{autoload.bcp47.options}, which are passed to
- |\babelprovide|; empty by default, but you may add \texttt{import}
- (features defined in the corresponding |babel-...tex| file might not
- be available).
-\item \texttt{autoload.bcp47.prefix}. Although the public name used in
- selectors is the tag, the internal name will be different and
- generated by prepending a prefix, which by default is
- \texttt{bcp47-}. You may change it with this key.
-\end{description}
-
-\New{3.46} If an |ldf| file has been loaded, you can enable the
-corresponding language tags as selector names with:
-\begin{verbatim}
-\babeladjust{ bcp47.toname = on }
-\end{verbatim}
-(You can deactivate it with |off|.) So, if |dutch| is one of the
-package (or class) options, you can write |\selectlanguage{nl}|. Note
-the language name does not change (in this example is still |dutch|),
-but you can get it with |\localeinfo| or |\getlocaleproperty|. It
-must be turned on explicitly for similar reasons to those explained
-above.
-
-\subsection{Selecting scripts}
+\subsection{Scripts}
Currently \babel{} provides no standard interface to select
scripts, because they are best selected with either |\fontencoding|
@@ -3824,6 +4391,60 @@ fonts (for example, if the main Latin encoding was |LY1|), and
therefore it has been deprecated.\footnote{But still defined for
backwards compatibility.}
+The locales currently available cover the following scripts:
+\begin{multicols}{4}
+\parindent-.5em
+\leftskip.5em
+Arabic\\
+Armenian\\
+Bangla\\
+Bengali\\
+Cherokee\\
+Coptic\\
+Cyrillic\\
+Devanagari\\
+Egyptian hieroglyphs\\
+Ethiopic\\
+Georgian\\
+Glagolitic\\
+Gothic\\
+Greek\\
+Gujarati\\
+Gurmukhi\\
+Han\\
+Hebrew\\
+Japanese\\
+Kannada\\
+Khmer\\
+Khojki\\
+Khudawadi\\
+Korean\\
+Lao\\
+Latin\\
+Malayalam\\
+Myanmar\\
+Nyiakeng Puachue Hmong\\
+N’Ko\\
+Ol Chiki\\
+Old Church Slavonic Cyrillic\\
+Oriya\\
+Phoenician\\
+Runic\\
+Simplified\\
+Sinhala\\
+Sumero-Akkadian Cuneiform\\
+Tamil\\
+Telugu\\
+Thaana\\
+Thai\\
+Tibetan\\
+Tifinagh\\
+Traditional\\
+Unified Canadian Aboriginal Syllabics\\
+Vai\\
+Yi
+\end{multicols}
+
\Describe{\ensureascii}{\marg{text}}
\New{3.9i} This macro makes sure \m{text} is typeset with a
@@ -3849,7 +4470,7 @@ most of the cases. No assumption is made on characters above
127, which may not follow the LICR conventions -- the goal is just
to ensure most of the ASCII letters and symbols are the right ones.
-\subsection{Selecting directions}
+\subsection{Bidirectional and right-to-left text}
\label{bidi}
No macros to select the writing direction are provided, either --
@@ -3908,10 +4529,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|.
@@ -3930,12 +4555,11 @@ See particularly |lua-bidibasic.tex| and |lua-secenum.tex|.
\catcode`@=13
\def@#1{\ifcase#1\relax \egroup \or \bgroup\textdir TLT \else
\bgroup\textdir TRT \pardir TRT \fi}
+\setengine{luatex}
\begin{verbatim}
-\documentclass{article}
-
-\usepackage[_bidi=basic_]{babel}
+\documentclass[arabic]{article}
-_\babelprovide[import, main]{arabic}_
+\usepackage[_bidi=basic_, provide=*]{babel}
\babelfont{rm}{FreeSerif}
@@ -4015,7 +4639,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}}
@@ -4105,10 +4729,17 @@ the same for \textsf{pgf/tikz}. Somewhat experimental. \New{3.32}.
\begin{example}
Typically, in an Arabic document you would need:
+\setengine{luatex}
\begin{verbatim}
\usepackage[bidi=basic,
layout=counters tabular]{babel}
\end{verbatim}
+or
+\setengine{xetex}
+\begin{verbatim}
+\usepackage[bidi=bidi,
+ layout=counters tabular]{babel}
+\end{verbatim}
\end{example}
\Describe{\babelsublr}{\marg{lr-text}}
@@ -4165,18 +4796,18 @@ necessary (but note then tocs and marks are not touched).
\New{3.17} Something like:
\begin{verbatim}
-\BabelFootnote{\parsfootnote}{\languagename}{(}{)}
+\BabelFootnote{\parsfootnote}{\localename}{(}{)}
\end{verbatim}
defines |\parsfootnote| so that |\parsfootnote{note}| is equivalent to:
\begin{verbatim}
-\footnote{(\foreignlanguage{\languagename}{note})}
+\footnote{(\foreignlanguage{\localename}{note})}
\end{verbatim}
but the footnote itself is typeset in the main language (to unify its
direction). In addition, |\parsfootnotetext| is defined. The option
|footnotes| just does the following:
\begin{verbatim}
-\BabelFootnote{\footnote}{\languagename}{}{}%
-\BabelFootnote{\localfootnote}{\languagename}{}{}%
+\BabelFootnote{\footnote}{\localename}{}{}%
+\BabelFootnote{\localfootnote}{\localename}{}{}%
\BabelFootnote{\mainfootnote}{}{}{}
\end{verbatim}
(which also redefine |\footnotetext| and define |\localfootnotetext|
@@ -4196,249 +4827,6 @@ command is available always in bidi documents, even without
footnote text should be omitted.
\end{example}
-\subsection{Language attributes}
-
-\DescribeMacro{\languageattribute}
-
-This is a user-level command, to be used in the preamble of a
-document (after |\usepackage[...]{babel}|), that declares which
-attributes are to be used for a given language. It takes two
-arguments: the first is the name of the language; the second,
-a (list of) attribute(s) to be used. Attributes must be set in the
-preamble and only once -- they cannot be turned on and off.
-The command checks whether the language is known in this document
-and whether the attribute(s) are known for this language.
-
-Very often, using a \textit{modifier} in a package option is better.
-
-Several language definition files use their own methods to set
-options. For example, \textsf{french} uses |\frenchsetup|,
-\textsf{magyar} (1.5) uses |\magyarOptions|; modifiers provided by
-|spanish| have no attribute counterparts. Macros setting
-options are also used (eg, |\ProsodicMarksOn| in \textsf{latin}).
-
-\subsection{Hooks}
-
-\New{3.9a} A hook is a piece of code to be executed at certain
-events. Some hooks are predefined when \luatex{} and \xetex{} are
-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
-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}}
-
-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
-|\EnableBabelHook|\marg{name}, |\DisableBabelHook|\marg{name}. Names
-containing the string |babel| are reserved (they are used, for example,
-by |\useshortands*| to add a hook for the event |afterextras|).
-\New{3.33} They may be also applied to a specific language with the
-optional argument; language-specific settings are executed after global
-ones.
-
-Current events are the following; in some of them you can use one to
-three \TeX{} parameters (|#1|, |#2|, |#3|), with the meaning given:
-\begin{description}
-\renewcommand\makelabel[1]{%
- \hspace\labelsep\normalfont\ttfamily\color{thered}#1}
-\itemsep=-\parskip
-\item[adddialect] (language name, dialect name) Used by
- \file{luababel.def} to load the patterns if not preloaded.
-\item[patterns] (language name, language with encoding) Executed just
- after the |\language| has been set. The second argument has the
- patterns name actually selected (in the form of either |lang:ENC| or
- |lang|).
-\item[hyphenation] (language name, language with encoding) Executed
- locally just before exceptions given in |\babelhyphenation| are
- actually set.
-\item[defaultcommands] Used (locally) in |\StartBabelCommands|.
-\item[encodedcommands] (input, font encodings) Used (locally) in
- |\StartBabelCommands|. Both \xetex{} and \luatex{} make sure the
- encoded text is read correctly.
-\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
- 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
- example, the following deactivates shorthands in all languages:
-\begin{verbatim}
-\AddBabelHook{noshort}{afterextras}{\languageshorthands{none}}
-\end{verbatim}
-\item[stringprocess] Instead of a parameter, you can manipulate the
- macro |\BabelString| containing the string to be defined with
- |\SetString|. For example, to use an expanded version of the string
- in the definition, write:
-\begin{verbatim}
-\AddBabelHook{myhook}{stringprocess}{%
- \protected@edef\BabelString{\BabelString}}
-\end{verbatim}
-\item[initiateactive] (char as active, char as other, original char)
- \New{3.9i} Executed just after a shorthand has been `initiated'. The three
- parameters are the same character with different catcodes: active,
- 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}.
-\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.
-\end{description}
-
-Four events are used in \file{hyphen.cfg}, which are handled in a
-quite different way for efficiency reasons -- unlike the precedent
-ones, they only have a single hook and replace a default definition.
-\begin{description}
-\renewcommand\makelabel[1]{%
- \hspace\labelsep\normalfont\ttfamily\color{thered}#1}
-\itemsep=-\parskip
-\item[everylanguage] (language) Executed before every language patterns
- are loaded.
-\item[loadkernel] (file) By default just defines a few basic commands.
- It can be used to define different versions of them or to load a file.
-\item[loadpatterns] (patterns file) Loads the patterns file. Used by
- \file{luababel.def}.
-\item[loadexceptions] (exceptions file) Loads the exceptions
- file. Used by \file{luababel.def}.
-\end{description}
-
-\begin{example}
-The generic unlocalized \LaTeX{} hooks are predefined, so that you can
-write:
-\begin{verbatim}
-\AddToHook{babel/*/afterextras}{\frenchspacing}
-\end{verbatim}
-which is executed always after the extras for the language being
-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}
-(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|:
-\begin{verbatim}
-\ActivateGenericHook{babel/bengali/afterextras}
-\AddToHook{babel/bengali/afterextras}{\frenchspacing}
-\end{verbatim}
-\end{example}
-
-\Describe{\BabelContentsFiles}{}
-\New{3.9a} This macro contains a list of ``toc'' types
-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 +4848,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}
@@ -4476,7 +4864,7 @@ empty, removes them. The last argument is the locale name:
\babelcharproperty{`,}{locale}{english}
\end{verbatim}
-\subsection{Tweaking some features}
+\subsection{Tweaking some \babel{} features}
\Describe{\babeladjust}{\marg{key-value-list}}
@@ -4528,34 +4916,36 @@ an alternative algorithm or with large sections not requiring it. Use
with care, because these options do not deactivate other related
options (like paragraph direction with |bidi.text|).
-\subsection{Tips, workarounds, known issues and notes}
+\section{Relation with other packages}
-\begin{itemize}
- \item For the hyphenation to work correctly, lccodes cannot change,
- because \TeX{} only takes into account the values when the
- paragraph is hyphenated, i.e., when it has been
- finished.\footnote{This explains why \LaTeX{} assumes the lowercase
- mapping of T1 and does not provide a tool for multiple
- mappings. Unfortunately, \cs{savinghyphcodes} is not a solution
- either, because lccodes for hyphenation are frozen in the format
- and cannot be changed.} So, if you write a chunk of French text
- with |\foreignlanguage|, the apostrophes might not be taken into
- account. This is a limitation of \TeX, not of
- \babel. Alternatively, you may use |\useshorthands| to activate |'|
- and |\defineshorthand|, or redefine |\textquoteright| (the latter
- is called by the non-ASCII right quote).
-\item Babel does not take into account |\normalsfcodes| and
- (non-)French spacing is not always properly (un)set by
- languages. However, problems are unlikely to happen and therefore
- this part remains untouched (but it is in the `to do' list).
-\item Using a character mathematically active (ie, with math code
- |"8000|) as a shorthand can make \TeX{} enter in an infinite loop in
- some rare cases. (Another issue in the ‘to do’ list, although there
- is a partial solution.)
-\end{itemize}
+There are compatibility issues with the following packages.
+
+\begingroup
+\parindent0pt
+\def\trans#1#2{%
+ \vspace{1.5mm}%
+ \parbox[t]{3.0cm}{\strut\sffamily#1}%
+ \hspace{2mm}%
+ \parbox[t]{10cm}{\strut#2}\par}
+\bigskip\hrule\nobreak\vspace{.5mm}
+
+\trans{polyglossia}{This package is not compatible at all with \babel.
+They should never be used together, because macros are different, and
+even those with the same name doesn’t behave in the same way. Also,
+languages are organized quite differently (\babel{} treats all locales
+on an equal footing).}
+
+\trans{tikz/pgf}{There are some issues with shorthands, which are
+usually solved with \texttt{\string\usetikzlibrary\{babel\}}.}
+
+\trans{cleveref}{Because of a long standing bug in this package, some
+languages can raise and error (particularly |spanish| and |greek|).}
+
+\vspace{2mm}\hrule\nobreak\bigskip
+\endgroup
-The following packages can be useful, too (the list is still
-far from complete):
+The following packages can be useful in multilingual contexts (the list
+is far from complete):
\begin{description}
\itemsep=-\parskip
\item[csquotes] Logical markup for quotes.
@@ -4577,44 +4967,14 @@ 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}
+For multilingual indexing, see \textsf{upmendex} and \textsf{xindex}.
+
+\section{Tentative and experimental code}
See the code section for |\foreignlanguage*| (a new starred
version of |\foreignlanguage|).
-For old an deprecated functions, see the \babel{} site.
+For old and deprecated functions, see the \babel{} site.
\medskip
\textbf{Options for locales loaded on the fly}
@@ -4634,12 +4994,12 @@ counters are used to define them. It is still somewhat tentative
because it is far from trivial -- see the \babel{} site for further
details.
-\section{Loading languages with \file{language.dat}}
+\section{Loading language hyphenation rules with \file{language.dat}}
\TeX{} and most engines based on it (pdf\TeX, \xetex, $\epsilon$-\TeX,
the main exception being \luatex) require hyphenation patterns to be
-preloaded when a format is created (eg, \LaTeX, Xe\LaTeX,
-pdf\LaTeX). \babel{} provides a tool which has become standard in many
+preloaded when a format is created (eg, \LaTeX, Xe\LaTeX, pdf\LaTeX).
+\babel{} provides a tool which has become standard in many
distributions and based on a ``configuration file'' named
\file{language.dat}. The exact way this file is used depends on the
distribution, so please, read the documentation for the latter (note
@@ -4647,19 +5007,11 @@ also some distributions generate the file with some tool).
\New{3.9q} With \luatex, however, patterns are loaded on the fly when
requested by the language (except the ``0th'' language, typically
-\textsf{english}, which is preloaded always).\footnote{This feature
-was added to 3.9o, but it was buggy. Both 3.9o and 3.9p are
-deprecated.} Until 3.9n, this task was delegated to the package
-\textsf{luatex-hyphen}, by Khaled Hosny, \'Elie Roux, and Manuel
-P\'egouri\'e-Gonnard, and required an extra file named
-|language.dat.lua|, but now a new mechanism has been devised based
-solely on |language.dat|. \textbf{You must rebuild the formats} if
-upgrading from a previous version. You may want to have a local
-|language.dat| for a particular project (for example, a book on
-Chemistry).\footnote{The loader for lua(e)tex is slightly different as
-it's not based on \babel{} but on \texttt{etex.src}. Until 3.9p it
-just didn't work, but thanks to the new code it works by reloading the
-data in the \babel{} way, i.e., with \texttt{language.dat}.}
+\textsf{english}, which is preloaded always). You may want to have a
+local |language.dat| for a particular project (for example, a book on
+Chemistry). The loader for lua(e)tex is slightly different as it's not
+based on \babel{}, but on \texttt{etex.src}; however, \babel{} reloads
+the data so that it works as expected.
\subsection{Format}
@@ -4696,18 +5048,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}).
-
-A typical error when using \babel{} is the following:
-\begin{verbatim}
-No hyphenation patterns were preloaded for
-the language `<lang>' into the format.
-Please, configure your TeX system to add them and
-rebuild the format. Now I will use the patterns
-preloaded for english instead}}
-\end{verbatim}
-It simply means you must reconfigure \file{language.dat}, either by
-hand or with the tools provided by your distribution.
+can be set in |\extras<language>|).
\section{The interface between the core of \babel{} and the language
definition files}
@@ -4746,11 +5087,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 +5101,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 +5123,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 +5148,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 +5157,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 +5203,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
@@ -5009,38 +5352,35 @@ In quite a number of language definition files, active characters are
introduced. To facilitate this, some support macros are provided.
\DescribeMacro{\initiate@active@char}
-The internal macro |\initiate@active@char| is used in language
+Used in language
definition files to instruct \LaTeX\ to give a character the category
code `active'. When a character has been made active it will remain
that way until the end of the document. Its definition may vary.
\DescribeMacro{\bbl@activate}
\DescribeMacro{\bbl@deactivate}
-The command |\bbl@activate| is used to change the way an active
+Used to change the way an active
character expands. |\bbl@activate| `switches on' the active behavior
of the character. |\bbl@deactivate| lets the active character expand
to its former (mostly) non-active self.
\DescribeMacro{\declare@shorthand}
-The macro |\declare@shorthand| is used to define the various
+Used to define the various
shorthands. It takes three arguments: the name for the collection of
shorthands this definition belongs to; the character (sequence) that
makes up the shorthand, i.e.\ |~| or |"a|; and the code to be executed
when the shorthand is encountered. (It does \textit{not} raise an
error if the shorthand character has not been ``initiated''.)
-\DescribeMacro{\bbl@add@special}
-\DescribeMacro{\bbl@remove@special}
-The \TeX book states: ``Plain \TeX\ includes a macro called
-|\dospecials| that is essentially a set macro, representing the set of
-all characters that have a special category code.'' \cite[p.~380]{DEK}
-It is used to set text `verbatim'. To make this work if more
-characters get a special category code, you have to add this character
-to the macro |\dospecials|. \LaTeX\ adds another macro called
-|\@sanitize| representing the same character set, but without the
-curly braces. The macros |\bbl@add@special|\meta{char} and
-|\bbl@remove@special|\meta{char} add and remove the character
-\meta{char} to these two sets.
+\DescribeMacro{\bbl@add@special} The \TeX book states: ``Plain \TeX\
+includes a macro called |\dospecials| that is essentially a set macro,
+representing the set of all characters that have a special category
+code.'' \cite[p.~380]{DEK} It is used to set text `verbatim'. To make
+this work if more characters get a special category code, you have to
+add this character to the macro |\dospecials|. \LaTeX\ adds another
+macro called |\@sanitize| representing the same character set, but
+without the curly braces. The macros |\bbl@add@special|\meta{char} add
+the character \meta{char} to these two sets.
\DescribeMacro{\@safe@activestrue}
\DescribeMacro{\@safe@activesfalse}
@@ -5119,9 +5459,16 @@ spacefactor.
\DescribeMacro{\bbl@frenchspacing}
\DescribeMacro{\bbl@nonfrenchspacing}
-The commands |\bbl@frenchspacing| and |\bbl@nonfrenchspacing| can be
+Those commands can be
used to properly switch French spacing on and off.
+\begin{note}
+ With |lfd| files, \babel does not take into account |\normalsfcodes|
+ and (non-)French spacing is not always properly (un)set by languages
+ However, problems are unlikely to happen and therefore this part
+ remains untouched. With |ini| files, this issue has been addressed.
+\end{note}
+
\subsection{Encoding-dependent strings}
\label{s:strings}
@@ -5239,12 +5586,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)
@@ -5257,8 +5604,7 @@ exists (in the \babel{} sense, ie, if |\date|\m{language} exists).
with the help of these macros.
\end{note}
-\Describe\StartBabelCommands{%
- \colorbox{thegrey}{\ttfamily\hskip-.2em*\hskip-.2em}%
+\Describe\StartBabelCommands{\optstar
\marg{language-list}\marg{category}\oarg{selector}}
The starred version just forces |strings| to take a value -- if not set
as package option (which is now deprecated), then the default for the
@@ -5327,21 +5673,6 @@ by both \luatex{} and \xetex{}):
assignment is wrong, fix it directly.
\end{note}
-\subsection{Executing code based on the selector}
-
-\Describe{\IfBabelSelectorTF}{\marg{selectors}\marg{true}\marg{false}}
-
-\New{3.67} Sometimes a different setup is desired depending on the
-selector used. Values allowed in \m{selectors} are |select|, |other|,
-|foreign|, |other*| (and also |foreign*| for the tentative starred
-version), and it can consist of a comma-separated list. For example:
-\begin{verbatim}
-\IfBabelSelectorTF{other, other*}{A}{B}
-\end{verbatim}
-is true with any of these two environment selectors.
-
-Its natural place of use is in hooks or in |\extras|\m{language}.
-
\else
\DocInput{babel.dtx}
@@ -5350,13 +5681,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, Loren Davis and Udi Fogiel.
There are also many contributors for specific languages, which are
mentioned in the respective files. Without them, \babel{} just
@@ -5401,24 +5733,11 @@ wouldn’t exist.
\end{thebibliography}
\end{document}
%</filedriver>
-%
% \fi
%
-% \addtolength{\oddsidemargin}{-15pt}
+% \addtolength{\oddsidemargin}{-5pt}
% \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
+% \reversemarginpar
%
% \small
%
@@ -5430,8 +5749,6 @@ 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 +5762,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 +5796,14 @@ wouldn’t exist.
% \section{Tools}
%
% \begin{macrocode}
-%<<version=24.7>>
-%<<date=2024/06/26>>
+%<<version=24.11>>
+%<<date=2024/10/05>>
% \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 +5837,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.
+% \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 +5852,30 @@ wouldn’t exist.
#2}}
% \end{macrocode}
%
-% \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.
+% \macro{\bbl@afterelse}
+% \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}
+% \macro{\bbl@exp}
%
-% \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{%
@@ -5579,16 +5889,15 @@ wouldn’t exist.
\def\bbl@exp@ue#1]{%
\unexpanded\expandafter\expandafter\expandafter{\csname#1\endcsname}}%
% \end{macrocode}
-% \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.
+% \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.
%
% \begin{macrocode}
\def\bbl@tempa#1{%
@@ -5605,14 +5914,13 @@ wouldn’t exist.
\long\def\bbl@trim@i#1\@nil#2\relax#3{#3{#1}}
\long\def\bbl@trim@def#1{\bbl@trim{\def#1}}
% \end{macrocode}
-% \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.
+% \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.
%
% \begin{macrocode}
\begingroup
@@ -5636,12 +5944,11 @@ wouldn’t exist.
\fi}}
\endgroup
% \end{macrocode}
-% \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,
+% \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,
%
% \begin{macrocode}
\def\bbl@ifblank#1{%
@@ -5650,7 +5957,6 @@ wouldn’t exist.
\def\bbl@ifset#1#2#3{%
\bbl@ifunset{#1}{#3}{\bbl@exp{\\\bbl@ifblank{\@nameuse{#1}}}{#3}{#2}}}
% \end{macrocode}
-% \end{macro}
%
% For each element in the comma separated <key>|=|<value> list,
% execute <code> with |#1| and |#2| as the key and the value of
@@ -5688,7 +5994,7 @@ wouldn’t exist.
\def\bbl@foreach#1{\expandafter\bbl@vforeach\expandafter{#1}}
% \end{macrocode}
%
-% \begin{macro}{\bbl@replace}
+% \macro{\bbl@replace}
%
% Returns implicitly |\toks@| with the modified string.
%
@@ -5716,7 +6022,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{%
@@ -5746,7 +6052,6 @@ wouldn’t exist.
\bbl@tempc}} % empty or expand to set #1 with changes
\fi
% \end{macrocode}
-% \end{macro}
%
% Two further tools. |\bbl@ifsamestring| first expand its arguments and
% then compare their expansion (sanitized, so that the catcodes do not
@@ -5803,9 +6108,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 +6121,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}%
@@ -5844,16 +6149,11 @@ wouldn’t exist.
%<</Make sure ProvidesFile is defined>>
% \end{macrocode}
%
-% \subsection{Multiple languages}
+% \subsection{A few core definitions}
%
-% \begin{macro}{\language}
+% \macro{\language}
%
-% Plain \TeX\ version~3.0 provides the primitive |\language| that
-% is used to store the current language. When used with a pre-3.0
-% version this function has to be implemented by allocating a
-% counter. The following block is used in \file{switch.def} and
-% \file{hyphen.cfg}; the latter may seem redundant, but remember
-% \babel{} doesn't requires loading \file{switch.def} in the format.
+% Just for compatibility, for not to touch |hyphen.cfg|.
%
% \begin{macrocode}
%<<*Define core switching macros>>
@@ -5863,14 +6163,12 @@ wouldn’t exist.
%<</Define core switching macros>>
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\last@language}
+% \macro{\last@language}
%
% Another counter is used to keep track of the allocated languages.
% \TeX{} and \LaTeX{} reserves for this purpose the count 19.
%
-% \begin{macro}{\addlanguage}
+% \macro{\addlanguage}
%
% This macro was introduced for \TeX{} $<$ 2. Preserved for
% compatibility.
@@ -5882,50 +6180,57 @@ 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).
+% 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.
+% 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{\LaTeX: \texttt{babel.sty} (start)}
%
-% \subsection{The Package File (\LaTeX, \texttt{babel.sty})}
+% Here starts the style file for \LaTeX. It also takes care of a number
+% of compatibility issues with other packages.
%
% \begin{macrocode}
%<*package>
\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.
+%
+% Start with some “private” debugging tools, and then define macros for
+% errors. The global lua ‘space’ |Babel| is declared here, too (inside
+% the test for |debug|).
%
% \begin{macrocode}
\@ifpackagewith{babel}{debug}
{\providecommand\bbl@trace[1]{\message{^^J[ #1 ]}}%
\let\bbl@debug\@firstofone
\ifx\directlua\@undefined\else
- \directlua{ Babel = Babel or {}
+ \directlua{
+ Babel = Babel or {}
Babel.debug = true }%
\input{babel-debug.tex}%
\fi}
{\providecommand\bbl@trace[1]{}%
\let\bbl@debug\@gobble
\ifx\directlua\@undefined\else
- \directlua{ Babel = Babel or {}
+ \directlua{
+ Babel = Babel or {}
Babel.debug = false }%
\fi}
+% \end{macrocode}
+%
+% Macros to deal with errors, warnings, etc. Errors are stored in a
+% separate file.
+%
+% \begin{macrocode}
\def\bbl@error#1{% Implicit #2#3#4
\begingroup
\catcode`\\=0 \catcode`\==12 \catcode`\`=12
@@ -5949,13 +6254,8 @@ wouldn’t exist.
\endgroup}
% \end{macrocode}
%
-% This file also takes care of a number of compatibility issues with
-% other packages an defines a few additional package options. Apart from
-% all the language options below we also have a few options that
-% 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 +6307,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 +6334,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 +6346,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 +6355,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 +6388,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 +6442,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}
@@ -6156,6 +6453,8 @@ wouldn’t exist.
\ProcessOptions*
% \end{macrocode}
%
+% \subsection{Post-process some options}
+%
% \begin{macrocode}
\ifx\bbl@opt@provide\@nnil
\let\bbl@opt@provide\@empty % %%% MOVE above
@@ -6165,13 +6464,10 @@ wouldn’t exist.
\in@{,provide,}{,#1,}%
\ifin@
\def\bbl@opt@provide{#2}%
- \bbl@replace\bbl@opt@provide{;}{,}%
\fi}
\fi
-%
-% \end{macrocode}
%
-% \subsection{Conditional loading of shorthands}
+% \end{macrocode}
%
% If there is no |shorthands=<chars>|, the original \textsf{babel}
% macros are left untouched, but if there is, these macros are
@@ -6199,8 +6495,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{%
@@ -6280,10 +6575,9 @@ wouldn’t exist.
\fi}
\fi
%</package>
-%<*core>
% \end{macrocode}
%
-% \subsection{Interlude for Plain}
+% \subsection{Plain: \texttt{babel.def} (start)}
%
% Because of the way \pkg{docstrip} works, we need to insert some code
% for Plain here. However, the tools provided by the \babel{}
@@ -6292,11 +6586,12 @@ wouldn’t exist.
% \textit{Emulate LaTeX}.
%
% \begin{macrocode}
+%<*core>
\ifx\ldf@quit\@undefined\else
\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@>
@@ -6307,25 +6602,18 @@ wouldn’t exist.
%
% \begin{macrocode}
%</core>
-%<*package|core>
% \end{macrocode}
%
-% \section{Multiple languages}
-%
-% This is not a separate file (\texttt{switch.def}) anymore.
-%
-% Plain \TeX\ version~3.0 provides the primitive |\language| that
-% is used to store the current language. When used with a pre-3.0
-% version this function has to be implemented by allocating a
-% counter.
+% \section{\texttt{babel.sty} and \texttt{babel.def} (common)}
%
% \begin{macrocode}
+%<*package|core>
\def\bbl@version{<@version@>}
\def\bbl@date{<@date@>}
<@Define core switching macros@>
% \end{macrocode}
%
-% \begin{macro}{\adddialect}
+% \macro{\adddialect}
% The macro |\adddialect| can be used to add the name of a dialect
% or variant language, for which an already defined hyphenation
% table can be used.
@@ -6348,19 +6636,16 @@ wouldn’t exist.
\endgroup}
% \end{macrocode}
%
-% \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 +6677,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 +6696,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 +6705,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 +6750,11 @@ wouldn’t exist.
{\bbl@exp{\\\babelprovide[\bbl@autoload@options]{\languagename}}}%
{}%
\fi}
-%<+core>
+%</package>
+%<*package|core>
% \end{macrocode}
%
-% \begin{macro}{\iflanguage}
+% \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,13 +6773,11 @@ wouldn’t exist.
\fi}}
% \end{macrocode}
%
-% \end{macro}
-%
% \subsection{Selecting the language}
%
-% \begin{macro}{\selectlanguage}
+% \macro{\selectlanguage}
%
-% The macro |\selectlanguage| checks whether the language is
+% It checks whether the language is
% already defined before it performs its actual task, which is to
% update |\language| and activate language-specific definitions.
%
@@ -6520,13 +6805,11 @@ wouldn’t exist.
\let\xstring\string
% \end{macrocode}
%
-% \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}
+% \macro{\bbl@pop@language}
%
% \emph{But} when the language change happens \emph{inside} a group
% the end of the group doesn't write anything to the auxiliary
@@ -6537,7 +6820,7 @@ wouldn’t exist.
% executed at the end of the group. It calls |\bbl@set@language|
% with the name of the current language as its argument.
%
-% \begin{macro}{\bbl@language@stack}
+% \macro{\bbl@language@stack}
% The previous solution works for one level of nesting groups, but
% as soon as more levels are used it is no longer adequate. For
% that case we need to keep track of the nested languages using a
@@ -6551,8 +6834,8 @@ wouldn’t exist.
% When using a stack we need a mechanism to push an element on the
% stack and to retrieve the information afterwards.
%
-% \begin{macro}{\bbl@push@language}
-% \begin{macro}{\bbl@pop@language}
+% \macro{\bbl@push@language}
+% \macro{\bbl@pop@language}
% The stack is simply a list of languagenames, separated with a `+'
% sign; the push function can be simple:
%
@@ -6566,7 +6849,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 +6858,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|.
+% \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 +6869,6 @@ wouldn’t exist.
\xdef\bbl@language@stack{#2}}
% \end{macrocode}
%
-% \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 +6890,6 @@ 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}
%
% An alternative way to identify languages (in the \babel{} sense)
% with a numerical value is introduced in 3.30. This is one of the
@@ -6630,10 +6909,9 @@ wouldn’t exist.
\edef\bbl@id@last{\the\count@}%
\ifcase\bbl@engine\or
\directlua{
- Babel = Babel or {}
- Babel.locale_props = Babel.locale_props or {}
Babel.locale_props[\bbl@id@last] = {}
Babel.locale_props[\bbl@id@last].name = '\languagename'
+ Babel.locale_props[\bbl@id@last].vars = {}
}%
\fi}%
{}%
@@ -6652,9 +6930,7 @@ wouldn’t exist.
\let\endselectlanguage\relax
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\bbl@set@language}
+% \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 +6957,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 +6977,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,13 +7000,11 @@ 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}
-%
% First, check if the user asks for a known language. If so,
% update the value of |\language| and call |\originalTeX|
% to bring \TeX\ in a certain pre-defined state.
@@ -6772,7 +7030,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 +7061,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 +7101,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,21 +7118,23 @@ 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}
%
-% \begin{environment}{otherlanguage}
-% The \Lenv{otherlanguage} environment can be used as an alternative to
+% \environment{otherlanguage}
+% It can be used as an alternative to
% using the |\selectlanguage| declarative command. The |\ignorespaces|
% command is necessary to hide the environment when it is entered in
% horizontal mode.
@@ -6888,13 +7154,11 @@ wouldn’t exist.
\long\def\endotherlanguage{\@ignoretrue\ignorespaces}
% \end{macrocode}
%
-% \end{environment}
-%
-% \begin{environment}{otherlanguage*}
-% The \Lenv{otherlanguage} environment is meant to be used when a
+% \environment{otherlanguage*}
+% It is meant to be used when a
% large part of text from a different language needs to be typeset,
% but without changing the translation of words such as `figure'.
-% This environment makes use of |\foreign@language|.
+% It makes use of |\foreign@language|.
%
% \begin{macrocode}
\expandafter\def\csname otherlanguage*\endcsname{%
@@ -6914,14 +7178,11 @@ wouldn’t exist.
\expandafter\let\csname endotherlanguage*\endcsname\relax
% \end{macrocode}
%
-% \end{environment}
+% \macro{\foreignlanguage}
%
-% \begin{macro}{\foreignlanguage}
-%
-% The |\foreignlanguage| command is another substitute for the
-% |\selectlanguage| command. This command takes two arguments, the
-% first argument is the name of the language to use for typesetting
-% the text specified in the second argument.
+% This command takes two arguments, the first argument is the name of
+% the language to use for typesetting the text specified in the second
+% argument.
%
% Unlike |\selectlanguage| this command doesn't switch
% \emph{everything}, it only switches the hyphenation rules and the
@@ -6984,11 +7245,12 @@ 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}
-%
-% \begin{macro}{\foreign@language}
+% \macro{\foreign@language}
%
% This macro does the work for |\foreignlanguage| and the
% \Lenv{otherlanguage*} environment. First we need to store the name
@@ -7004,6 +7266,7 @@ wouldn’t exist.
\bbl@usedategroupfalse
\fi
\bbl@fixname\languagename
+ \let\localename\languagename
% TODO. name@map here?
\bbl@provide@locale
\bbl@iflanguage\languagename{%
@@ -7011,8 +7274,6 @@ wouldn’t exist.
\expandafter\bbl@switch\expandafter{\languagename}}}
% \end{macrocode}
%
-% \end{macro}
-%
% The following macro executes conditionally some code based on the
% selector being used.
%
@@ -7026,7 +7287,7 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \begin{macro}{\bbl@patterns}
+% \macro{\bbl@patterns}
%
% This macro selects the hyphenation patterns by changing the
% \cs{language} register. If special hyphenation patterns
@@ -7073,12 +7334,10 @@ wouldn’t exist.
\endgroup}}
% \end{macrocode}
%
-% \end{macro}
+% \environment{hyphenrules}
%
-% \begin{environment}{hyphenrules}
-%
-% The environment \Lenv{hyphenrules} can be used to select
-% \emph{just} the hyphenation rules. This environment does
+% It can be used to select
+% \emph{just} the hyphenation rules. It does
% \emph{not} change |\languagename| and when the hyphenation rules
% specified were not loaded it has no effect. Note however,
% |\lccode|'s and font encodings are not set at all, so in most
@@ -7102,9 +7361,7 @@ wouldn’t exist.
\let\endhyphenrules\@empty
% \end{macrocode}
%
-% \end{environment}
-%
-% \begin{macro}{\providehyphenmins}
+% \macro{\providehyphenmins}
% The macro |\providehyphenmins| should be used in the language
% definition files to provide a \emph{default} setting for the
% hyphenation parameters |\lefthyphenmin| and |\righthyphenmin|. If
@@ -7118,11 +7375,9 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\set@hyphenmins}
-% This macro sets the values of |\lefthyphenmin| and
-% |\righthyphenmin|. It expects two values as its argument.
+% \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{%
@@ -7130,9 +7385,7 @@ wouldn’t exist.
\righthyphenmin#2\relax}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\ProvidesLanguage}
+% \macro{\ProvidesLanguage}
% The identification code for each file is something that was
% introduced in \LaTeXe. When the command |\ProvidesFile| does not
% exist, a dummy definition is provided temporarily. For use in the
@@ -7161,27 +7414,23 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \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|.
+% \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}
-%
% A few macro names are reserved for future releases of \babel, which
% will use the concept of `locale':
%
@@ -7197,8 +7446,8 @@ wouldn’t exist.
%
% \subsection{Errors}
%
-% \begin{macro}{\@nolanerr}
-% \begin{macro}{\@nopatterns}
+% \macro{\@nolanerr}
+% \macro{\@nopatterns}
%
% The \babel\ package will signal an error when a documents tries
% to select a language that hasn't been defined earlier. When a
@@ -7208,7 +7457,7 @@ wouldn’t exist.
% In most formats that will be (US)english, but it might also be
% empty.
%
-% \begin{macro}{\@noopterr}
+% \macro{\@noopterr}
% When the package was loaded without options not everything will
% work as expected. An error message is issued in that case.
%
@@ -7231,7 +7480,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 +7537,7 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \begin{macro}{\addto}
+% \macro{\addto}
% It takes two arguments, a \meta{control sequence} and \TeX-code to
% be added to the \meta{control sequence}.
%
@@ -7312,8 +7561,6 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \end{macro}
-%
% The macro |\initiate@active@char| below takes all the necessary
% actions to make its argument a shorthand character. The real work
% is performed once for each character. But first we define a little
@@ -7326,7 +7573,7 @@ wouldn’t exist.
\lowercase{\endgroup#1~}}
% \end{macrocode}
%
-% \begin{macro}{\bbl@redefine}
+% \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 +7590,9 @@ wouldn’t exist.
\@onlypreamble\bbl@redefine
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\bbl@redefine@long}
-% This version of |\babel@redefine| can be used to redefine |\long|
-% commands such as |\ifthenelse|.
+% \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,9 +7602,7 @@ wouldn’t exist.
\@onlypreamble\bbl@redefine@long
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\bbl@redefinerobust}
+% \macro{\bbl@redefinerobust}
% For commands that are redefined, but which \textit{might} be
% robust we need a slightly more intelligent macro. A robust
% command |foo| is defined to expand to |\protect|\verb*|\foo |. So
@@ -7378,8 +7621,6 @@ wouldn’t exist.
\@onlypreamble\bbl@redefinerobust
% \end{macrocode}
%
-% \end{macro}
-%
% \subsection{Hooks}
%
% Admittedly, the current implementation is a somewhat simplistic and
@@ -7432,16 +7673,16 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \begin{macro}{\babelensure}
+% \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,11 +7759,9 @@ wouldn’t exist.
\alsoname\proofname\glossaryname}
% \end{macrocode}
%
-% \end{macro}
-%
% \subsection{Setting up language files}
%
-% \begin{macro}{\LdfInit}
+% \macro{\LdfInit}
%
% |\LdfInit| macro takes two arguments. The first
% argument is the name of the language that will be defined in the
@@ -7587,10 +7826,8 @@ wouldn’t exist.
\bbl@ldfinit}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\ldf@quit}
-% This macro interrupts the processing of a language definition file.
+% \macro{\ldf@quit}
+% This macro interrupts the processing of a language definition file.
%
% \begin{macrocode}
\def\ldf@quit#1{%
@@ -7600,19 +7837,17 @@ wouldn’t exist.
\endinput}
% \end{macrocode}
%
-% \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.
+% \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 +7860,9 @@ wouldn’t exist.
\catcode`\==\eqcatcode \let\eqcatcode\relax}
% \end{macrocode}
%
-% \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 +7870,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.
+% \macro{\main@language}
+% \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 +7906,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,25 +7922,25 @@ 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}
-%
% A bit of optimization. Select in heads/foots the language only if
% necessary.
%
@@ -7716,18 +7955,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.
+% \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,61 +7985,34 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \end{macro}
-%
-% \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.
-%
-% \begin{macrocode}
-\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}
-% \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|).
+% \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 +8024,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 +8037,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 +8050,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 +8068,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 +8090,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 +8113,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 +8145,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 +8163,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 +8174,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 +8189,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 +8205,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 +8215,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 +8232,16 @@ wouldn’t exist.
\AtEndOfPackage{\let\bbl@restoreactive\@gobble}}
% \end{macrocode}
%
-% \end{macro}
+% \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 +8252,18 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \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.
+% \macro{\active@prefix}
+% 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 +8292,26 @@ wouldn’t exist.
\endgroup
% \end{macrocode}
%
-% \end{macro}
+% \macro{if@safe@actives}
%
-% \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|).
+% 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}
-%
-% \begin{macro}{\bbl@restore@actives}
+% \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 +8321,13 @@ wouldn’t exist.
\def\bbl@restore@actives{\if@safe@actives\@safe@activesfalse\fi}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\bbl@activate}
-% \begin{macro}{\bbl@deactivate}
+% \macro{\bbl@activate}
+% \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 +8341,8 @@ wouldn’t exist.
\csname bbl@normal@\string#1\endcsname}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\bbl@firstcs}
-% \begin{macro}{\bbl@scndcs}
+% \macro{\bbl@firstcs}
+% \macro{\bbl@scndcs}
%
% These macros are used only as a trick when declaring shorthands.
%
@@ -8153,11 +8351,8 @@ wouldn’t exist.
\def\bbl@scndcs#1#2{\csname#2\endcsname}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\declare@shorthand}
-% The command |\declare@shorthand| is used to declare a shorthand
+% \macro{\declare@shorthand}
+% Used to declare a shorthand
% on a certain level. It takes three arguments:
% \begin{enumerate}
% \item a name for the collection of shorthands, i.e. `system', or
@@ -8174,7 +8369,7 @@ wouldn’t exist.
% string in math mode, like a minus sign instead of an hyphen
% (currently \textsf{hyperref} doesn't discriminate the mode). This
% macro may be used in |ldf| files.
-
+%
% \begin{macrocode}
\def\babel@texpdf#1#2#3#4{%
\ifx\texorpdfstring\@undefined
@@ -8212,12 +8407,10 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \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.
+% \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 +8421,27 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \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'.
+% \macro{\user@group}
+% \macro{\language@group}
+% \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}
+% \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 +8459,10 @@ wouldn’t exist.
{\bbl@error{shorthand-is-off}{}{#2}{}}}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\defineshorthand}
+% \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 +8492,25 @@ wouldn’t exist.
\declare@shorthand{\bbl@tempb}{#2}{#3}}}
% \end{macrocode}
%
-% \end{macro}
+% \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}
-%
-% \begin{macro}{\aliasshorthand}
+% \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 +8527,14 @@ wouldn’t exist.
{\bbl@error{shorthand-is-off}{}{#2}{}}}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\@notshorthand}
+% \macro{\@notshorthand}
%
% \begin{macrocode}
\def\@notshorthand#1{\bbl@error{not-a-shorthand}{#1}{}{}}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\shorthandon}
-% \begin{macro}{\shorthandoff}
+% \macro{\shorthandon}
+% \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 +8547,7 @@ wouldn’t exist.
\def\bbl@shorthandoff#1#2{\bbl@switch@sh#1#2\@nnil}
% \end{macrocode}
%
-% \begin{macro}{\bbl@switch@sh}
+% \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,10 +8593,6 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \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 +8632,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}
+% \macro{\bbl@prim@s}
+% \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,9 +8663,6 @@ wouldn’t exist.
\endgroup
% \end{macrocode}
%
-% \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
% expanded. To prevent that and to be able to use the character |~|
@@ -8511,20 +8679,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.
+% \macro{\OT1dqpos}
+% \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 +8700,17 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \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}
+% \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 +8754,22 @@ 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}
-%
-% \begin{macro}{\bbl@declare@ttribute}
-% This command adds the new language/attribute combination to the
-% list of known attributes.
+% \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 +8781,17 @@ wouldn’t exist.
\expandafter\def\csname#1@attr@#2\endcsname{#3}}
% \end{macrocode}
%
-% \end{macro}
+% \macro{\bbl@ifattributeset}
%
-% \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.
+% 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 +8807,14 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \end{macro}
+% \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 +8828,9 @@ wouldn’t exist.
\bbl@tempa}
% \end{macrocode}
%
-% \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).
+% \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 +8844,36 @@ wouldn’t exist.
\AtBeginDocument{\bbl@clear@ttribs}
% \end{macrocode}
%
-% \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.
+% \macro{\babel@savecnt}
+% \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}
-%
-% \begin{macro}{\babel@save}
-% \begin{macro}{\babel@savevariable}
+% \macro{\babel@save}
+% \macro{\babel@savevariable}
%
% The macro |\babel@save|\meta{csname} saves the current meaning of the
% control sequence \meta{csname} to
@@ -8756,11 +8905,8 @@ wouldn’t exist.
\bbl@exp{\def\\\originalTeX{\the\toks@\the#1\relax}}}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\bbl@frenchspacing}
-% \begin{macro}{\bbl@nonfrenchspacing}
+% \macro{\bbl@frenchspacing}
+% \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 +8954,12 @@ wouldn’t exist.
\fi\fi\fi}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-%
% \subsection{Short tags}
%
-% \begin{macro}{\babeltags}
+% \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}
@@ -8837,15 +8980,13 @@ wouldn’t exist.
\expandafter\bbl@tempb\bbl@tempa\@@}}
% \end{macrocode}
%
-% \end{macro}
-%
% \subsection{Hyphens}
%
-% \begin{macro}{\babelhyphenation}
+% \macro{\babelhyphenation}
%
% 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 +9019,31 @@ wouldn’t exist.
\fi}}
% \end{macrocode}
%
-% \end{macro}
+% \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}
%
-% \begin{macro}{\bbl@allowhyphens}
+% \macro{\bbl@allowhyphens}
%
% This macro makes hyphenation possible. Basically its definition
% is nothing more than |\nobreak| |\hskip| \texttt{0pt plus
@@ -8893,9 +9056,7 @@ wouldn’t exist.
\def\allowhyphens{\ifx\cf@encoding\bbl@t@one\else\bbl@allowhyphens\fi}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\babelhyphen}
+% \macro{\babelhyphen}
%
% Macros to insert common hyphens. Note the space before |@| in
% |\babelhyphen|. Instead of protecting it with
@@ -8935,7 +9096,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 +9107,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,19 +9128,15 @@ wouldn’t exist.
\def\bbl@hy@@empty{\discretionary{}{}{}}
% \end{macrocode}
%
-% \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.
+% \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}
-%
% \subsection{Multiencoding strings}
%
% The aim following commands is to provide a common interface for
@@ -9143,14 +9300,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 +9368,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 +9442,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 +9485,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{%
@@ -9339,13 +9496,15 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% This sections ends with a general tool for resetting the caption
+% \subsection{Tailor captions}
+%
+% A general tool for resetting the caption
% names with a unique interface. With the old way, which mixes the
% switcher and the string, we convert it to the new one, which
% 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 +9519,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 +9544,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 +9558,15 @@ 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}
+% \subsection{Making glyphs available}
+%
+% This section makes a number of glyphs available that either do not
+% exist in the \texttt{OT1} encoding and have to be `faked', or
+% that are not accessible through \file{T1enc.def}.
%
-% \begin{macro}{\set@low@box}
+% \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 +9578,9 @@ wouldn’t exist.
\setbox\z@\hbox{\lower\dimen\z@ \box\z@}\ht\z@\ht\tw@ \dp\z@\dp\tw@}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\save@sf@q}
-% The macro |\save@sf@q| is used to save and reset the current
-% space factor.
+% \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,17 +9589,9 @@ wouldn’t exist.
\endgroup}
% \end{macrocode}
%
-% \end{macro}
-%
-% \subsection{Making glyphs available}
-%
-% This section makes a number of glyphs available that either do not
-% exist in the \texttt{OT1} encoding and have to be `faked', or
-% that are not accessible through \file{T1enc.def}.
-%
% \subsubsection{Quotation marks}
%
-% \begin{macro}{\quotedblbase}
+% \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 +9612,8 @@ wouldn’t exist.
\UseTextSymbol{OT1}{\quotedblbase}}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\quotesinglbase}
-% We also need the single quote character at the baseline.
+% \macro{\quotesinglbase}
+% We also need the single quote character at the baseline.
%
% \begin{macrocode}
\ProvideTextCommand{\quotesinglbase}{OT1}{%
@@ -9471,18 +9621,16 @@ 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}
-%
-% \begin{macro}{\guillemetleft}
-% \begin{macro}{\guillemetright}
+% \macro{\guillemetleft}
+% \macro{\guillemetright}
% The guillemet characters are not available in \texttt{OT1}
% encoding. They are faked. (Wrong names with o preserved for
% compatibility.)
@@ -9532,13 +9680,10 @@ wouldn’t exist.
\UseTextSymbol{OT1}{\guillemotright}}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\guilsinglleft}
-% \begin{macro}{\guilsinglright}
-% The single guillemets are not available in \texttt{OT1}
-% encoding. They are faked.
+% \macro{\guilsinglleft}
+% \macro{\guilsinglright}
+% The single guillemets are not available in \texttt{OT1} encoding.
+% They are faked.
%
% \begin{macrocode}
\ProvideTextCommand{\guilsinglleft}{OT1}{%
@@ -9567,13 +9712,10 @@ wouldn’t exist.
\UseTextSymbol{OT1}{\guilsinglright}}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-%
% \subsubsection{Letters}
%
-% \begin{macro}{\ij}
-% \begin{macro}{\IJ}
+% \macro{\ij}
+% \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 +9729,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,11 +9739,8 @@ wouldn’t exist.
\UseTextSymbol{OT1}{\IJ}}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\dj}
-% \begin{macro}{\DJ}
+% \macro{\dj}
+% \macro{\DJ}
% The croatian language needs the letters |\dj| and |\DJ|; they are
% available in the \texttt{T1} encoding, but not in the
% \texttt{OT1} encoding by default.
@@ -9632,8 +9771,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 +9781,36 @@ wouldn’t exist.
\UseTextSymbol{OT1}{\DJ}}
% \end{macrocode}
%
-% \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.
+% \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}
-%
% \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}
+% \macro{\glq}
+% \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 +9824,18 @@ wouldn’t exist.
\ProvideTextCommandDefault{\grq}{\UseTextSymbol{OT1}\grq}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\glqq}
-% \begin{macro}{\grqq}
+% \macro{\glqq}
+% \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 +9849,10 @@ wouldn’t exist.
\ProvideTextCommandDefault{\grqq}{\UseTextSymbol{OT1}\grqq}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \macro{\flq}
+% \macro{\frq}
%
-% \begin{macro}{\flq}
-% \begin{macro}{\frq}
-%
-% The `french' single guillemets.
+% The `french' single guillemets.
%
% \begin{macrocode}
\ProvideTextCommandDefault{\flq}{%
@@ -9733,13 +9861,10 @@ wouldn’t exist.
\textormath{\guilsinglright}{\mbox{\guilsinglright}}}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\flqq}
-% \begin{macro}{\frqq}
+% \macro{\flqq}
+% \macro{\frqq}
%
-% The `french' double guillemets.
+% The `french' double guillemets.
%
% \begin{macrocode}
\ProvideTextCommandDefault{\flqq}{%
@@ -9748,24 +9873,21 @@ wouldn’t exist.
\textormath{\guillemetright}{\mbox{\guillemetright}}}
% \end{macrocode}
%
-% \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}
+% \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).
+% \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 +9902,10 @@ 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.
-%
-% We want the umlaut character lowered, nearer to the letter. To do
-% this we need an extra \meta{dimen} register.
+% \macro{\lower@umlaut}
+% 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 +9913,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,8 +9940,6 @@ wouldn’t exist.
\egroup}
% \end{macrocode}
%
-% \end{macro}
-%
% For all vowels we declare |\"| to be a composite command which
% uses |\bbl@umlauta| or |\bbl@umlaute| to position the umlaut
% character. We need to be sure that these definitions override the
@@ -9833,9 +9947,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 +9989,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 +10024,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.
%
@@ -9933,6 +10049,7 @@ wouldn’t exist.
\let\babelpatterns\babelprehyphenation
\let\babelcharproperty\babelprehyphenation
\fi
+%</package|core>
% \end{macrocode}
%
% \subsection{Creating and modifying languages}
@@ -9945,7 +10062,6 @@ wouldn’t exist.
% loaded |ldf| files.
%
% \begin{macrocode}
-%</package|core>
%<*package>
\bbl@trace{Creating languages and reading ini files}
\let\bbl@extend@ini\@gobble
@@ -9967,7 +10083,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 +10130,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 +10225,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 +10295,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 +10531,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 +10540,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 +10569,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 +
@@ -10490,7 +10605,7 @@ wouldn’t exist.
% \end{macrocode}
%
% The reader of |babel-...tex| files. We reset temporarily some
-% catcodes.
+% catcodes (and make sure no space is accidentally inserted).
%
% \begin{macrocode}
\def\bbl@input@texini#1{%
@@ -10521,7 +10636,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{%
@@ -10538,6 +10653,8 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
+% \subsection{Main loop in ‘provide’}
+%
% Now, the ‘main loop’, which \textbf{**must be executed inside a
% group**}. At this point, |\bbl@inidata| may contain data declared in
% |\babelprovide|, with ‘slashed’ keys. There are 3 steps: first read
@@ -10622,7 +10739,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 +10782,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 +10793,6 @@ 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 +10829,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 +10884,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}{}%
@@ -10786,6 +10902,8 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
+% \subsection{Processing keys in \texttt{ini}}
+%
% A shared handler for key=val lines to be stored in
% |\bbl@@kv@<section>.<key>|.
%
@@ -10881,9 +10999,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 +11040,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 +11089,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 +11280,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{&%
@@ -11214,6 +11332,8 @@ wouldn’t exist.
\endgroup
% \end{macrocode}
%
+% \subsection{Handle language system}
+%
% Language and Script values to be used when defining a font or
% setting the direction are set with the following macros.
%
@@ -11258,7 +11378,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}}
@@ -11283,6 +11403,8 @@ wouldn’t exist.
{\bbl@input@texini{#1}}}
% \end{macrocode}
%
+% \subsection{Numerals}
+%
% A tool to define the macros for native digits from the list provided
% in the |ini| file. Somewhat convoluted because there are 10 digits,
% but only 9 arguments in \TeX. Non-digits characters are kept. The
@@ -11376,6 +11498,58 @@ wouldn’t exist.
\bbl@error{alphabetic-too-large}{#1}{}{}}
% \end{macrocode}
%
+% \subsection{Casing}
+%
+% \begin{macrocode}
+\newcommand\BabelUppercaseMapping[3]{%
+ \DeclareUppercaseMapping[\@nameuse{bbl@casing@#1}]{#2}{#3}}
+\newcommand\BabelTitlecaseMapping[3]{%
+ \DeclareTitlecaseMapping[\@nameuse{bbl@casing@#1}]{#2}{#3}}
+\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
+ \bbl@casemapping@i{##1}%
+ \ifx\@empty##2\else\bbl@afterfi\bbl@tempa##2\fi}%
+ \edef\bbl@templ{\@nameuse{bbl@casing@#2}#1}% Language code
+ \def\bbl@tempe{0}% Mode (upper/lower...)
+ \def\bbl@tempc{#3 }% Casing list
+ \expandafter\bbl@tempa\bbl@tempc\@empty}
+\def\bbl@casemapping@i#1{%
+ \def\bbl@tempb{#1}%
+ \ifcase\bbl@engine % Handle utf8 in pdftex, by surrounding chars with {}
+ \@nameuse{regex_replace_all:nnN}%
+ {[\x{c0}-\x{ff}][\x{80}-\x{bf}]*}{{\0}}\bbl@tempb
+ \else
+ \@nameuse{regex_replace_all:nnN}{.}{{\0}}\bbl@tempb % TODO. needed?
+ \fi
+ \expandafter\bbl@casemapping@ii\bbl@tempb\@@}
+\def\bbl@casemapping@ii#1#2#3\@@{%
+ \in@{#1#3}{<>}% ie, if <u>, <l>, <t>
+ \ifin@
+ \edef\bbl@tempe{%
+ \if#2u1 \else\if#2l2 \else\if#2t3 \fi\fi\fi}%
+ \else
+ \ifcase\bbl@tempe\relax
+ \DeclareUppercaseMapping[\bbl@templ]{\bbl@utftocode{#1}}{#2}%
+ \DeclareLowercaseMapping[\bbl@templ]{\bbl@utftocode{#2}}{#1}%
+ \or
+ \DeclareUppercaseMapping[\bbl@templ]{\bbl@utftocode{#1}}{#2}%
+ \or
+ \DeclareLowercaseMapping[\bbl@templ]{\bbl@utftocode{#1}}{#2}%
+ \or
+ \DeclareTitlecaseMapping[\bbl@templ]{\bbl@utftocode{#1}}{#2}%
+ \fi
+ \fi}
+% \end{macrocode}
+%
+% \subsection{Getting info}
+%
% The information in the identification section can be useful, so the
% following macro just exposes it with a user command.
%
@@ -11412,7 +11586,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}
@@ -11422,14 +11596,15 @@ wouldn’t exist.
\def\bbl@utftocode#1{\expandafter`\string#1}
\fi
% Still somewhat hackish. WIP. Note |\str_if_eq:nnTF| is fully
-% expandable (|\bbl@ifsamestring| isn’t).
+% expandable (|\bbl@ifsamestring| isn’t). The argument is the prefix to
+% tag.bcp47. Can be prece
\providecommand\BCPdata{}
\ifx\renewcommand\@undefined\else % For plain. TODO. It’s a quick fix
\renewcommand\BCPdata[1]{\bbl@bcpdata@i#1\@empty}
\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}{}{}}%
@@ -11437,56 +11612,11 @@ wouldn’t exist.
{\bbl@cs{\csname bbl@info@#1.tag.bcp47\endcsname @#2}}}}
\fi
\@namedef{bbl@info@casing.tag.bcp47}{casing}
-\newcommand\BabelUppercaseMapping[3]{%
- \DeclareUppercaseMapping[\@nameuse{bbl@casing@#1}]{#2}{#3}}
-\newcommand\BabelTitlecaseMapping[3]{%
- \DeclareTitlecaseMapping[\@nameuse{bbl@casing@#1}]{#2}{#3}}
-\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
- \bbl@casemapping@i{##1}%
- \ifx\@empty##2\else\bbl@afterfi\bbl@tempa##2\fi}%
- \edef\bbl@templ{\@nameuse{bbl@casing@#2}#1}% Language code
- \def\bbl@tempe{0}% Mode (upper/lower...)
- \def\bbl@tempc{#3 }% Casing list
- \expandafter\bbl@tempa\bbl@tempc\@empty}
-\def\bbl@casemapping@i#1{%
- \def\bbl@tempb{#1}%
- \ifcase\bbl@engine % Handle utf8 in pdftex, by surrounding chars with {}
- \@nameuse{regex_replace_all:nnN}%
- {[\x{c0}-\x{ff}][\x{80}-\x{bf}]*}{{\0}}\bbl@tempb
- \else
- \@nameuse{regex_replace_all:nnN}{.}{{\0}}\bbl@tempb % TODO. needed?
- \fi
- \expandafter\bbl@casemapping@ii\bbl@tempb\@@}
-\def\bbl@casemapping@ii#1#2#3\@@{%
- \in@{#1#3}{<>}% ie, if <u>, <l>, <t>
- \ifin@
- \edef\bbl@tempe{%
- \if#2u1 \else\if#2l2 \else\if#2t3 \fi\fi\fi}%
- \else
- \ifcase\bbl@tempe\relax
- \DeclareUppercaseMapping[\bbl@templ]{\bbl@utftocode{#1}}{#2}%
- \DeclareLowercaseMapping[\bbl@templ]{\bbl@utftocode{#2}}{#1}%
- \or
- \DeclareUppercaseMapping[\bbl@templ]{\bbl@utftocode{#1}}{#2}%
- \or
- \DeclareLowercaseMapping[\bbl@templ]{\bbl@utftocode{#1}}{#2}%
- \or
- \DeclareTitlecaseMapping[\bbl@templ]{\bbl@utftocode{#1}}{#2}%
- \fi
- \fi}
% \end{macrocode}
%
% 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 +11641,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 +11675,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 +11685,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 +11699,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}{%
@@ -11701,7 +11832,7 @@ wouldn’t exist.
%<</More package options>>
% \end{macrocode}
%
-% \begin{macro}{\@newl@bel}
+% \macro{\@newl@bel}
%
% First we open a new group to keep the changed setting of
% |\protect| local and then we set the |@safe@actives| switch to
@@ -11721,9 +11852,7 @@ wouldn’t exist.
\global\@namedef{#1@#2}{#3}}}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\@testdef}
+% \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,10 +11893,8 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\ref}
-% \begin{macro}{\pageref}
+% \macro{\ref}
+% \macro{\pageref}
%
% The same holds for the macro |\ref| that references a label and
% |\pageref| to reference a page. We make them robust as well (if
@@ -11801,10 +11928,7 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\@citex}
+% \macro{\@citex}
%
% The macro used to cite from a bibliography, |\cite|, uses an
% internal macro, |\@citex|.
@@ -11859,9 +11983,7 @@ wouldn’t exist.
}{}}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\nocite}
+% \macro{\nocite}
%
% The macro |\nocite| which is used to instruct BiB\TeX\ to
% extract uncited references from the database.
@@ -11871,9 +11993,7 @@ wouldn’t exist.
\@safe@activestrue\org@nocite{#1}\@safe@activesfalse}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\bibcite}
+% \macro{\bibcite}
%
% The macro that is used in the |.aux| file to
% define citation labels. When packages such as \pkg{natbib} or
@@ -11894,9 +12014,7 @@ wouldn’t exist.
\bibcite}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\bbl@bibcite}
+% \macro{\bbl@bibcite}
%
% The macro |\bbl@bibcite| holds the definition of |\bibcite|
% needed when neither \pkg{natbib} nor \pkg{cite} is loaded.
@@ -11906,9 +12024,7 @@ wouldn’t exist.
\org@bibcite{#1}{\@safe@activesfalse#2}}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\bbl@cite@choice}
+% \macro{\bbl@cite@choice}
%
% The macro |\bbl@cite@choice| determines which definition of
% |\bibcite| is needed. First we give |\bibcite| its default
@@ -11930,9 +12046,7 @@ wouldn’t exist.
\AtBeginDocument{\bbl@cite@choice}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\@bibitem}
+% \macro{\@bibitem}
%
% One of the two internal \LaTeX\ macros called by |\bibitem|
% that write the citation label on the |.aux| file.
@@ -11948,11 +12062,9 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \end{macro}
-%
% \subsection{Marks}
%
-% \begin{macro}{\markright}
+% \macro{\markright}
% Because the output routine is asynchronous, we must pass the
% current language attribute to the head lines. To achieve this we
% need to adapt the definition of |\markright| and |\markboth|
@@ -11988,19 +12100,17 @@ wouldn’t exist.
{\\\protect\\\bbl@restore@actives\the\toks@}}}}}%
% \end{macrocode}
%
-% \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.)
+% \macro{\markboth}
+% \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,22 +12134,19 @@ wouldn’t exist.
\fi} % end ifbbl@single, end \IfBabelLayout
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-%
-% \subsection{Preventing clashes with other packages}
+% \subsection{Other packages}
%
% \subsubsection{\pkg{ifthen}}
%
-% \begin{macro}{\ifthenelse}
+% \macro{\ifthenelse}
%
% Sometimes a document writer wants to create a special effect
% 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,15 +12191,13 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \end{macro}
-%
% \subsubsection{\pkg{varioref}}
%
-% \begin{macro}{\@@vpageref}
-% \begin{macro}{\vrefpagenum}
-% \begin{macro}{\Ref}
+% \macro{\@@vpageref}
+% \macro{\vrefpagenum}
+% \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,13 +12232,9 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
% \subsubsection{\pkg{hhline}}
%
-% \begin{macro}{\hhline}
+% \macro{\hhline}
%
% Delaying the activation of the shorthand characters has introduced
% a problem with the \pkg{hhline} package. The reason is that it
@@ -12155,14 +12256,12 @@ wouldn’t exist.
{}}}
% \end{macrocode}
%
-% \end{macro}
+% \macro{\substitutefontfamily}
%
-% \begin{macro}{\substitutefontfamily}
-%
-% \textit{Deprecated.} Use the tools provides by \LaTeX. The command
-% |\substitutefontfamily| creates an \file{.fd} file on the fly. The
+% \textit{Deprecated.} It creates an \file{.fd} file on the fly. The
% first argument is an encoding mnemonic, the second and third
-% arguments are font family names.
+% arguments are font family names. Use the tools provided by \LaTeX\
+% (|\DeclareFontFamilySubstitution|).
%
% \begin{macrocode}
\def\substitutefontfamily#1#2#3{%
@@ -12186,20 +12285,18 @@ wouldn’t exist.
\@onlypreamble\substitutefontfamily
% \end{macrocode}
%
-% \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}
+% \macro{\ensureascii}
%
% \begin{macrocode}
\bbl@trace{Encoding and fonts}
@@ -12239,30 +12336,27 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \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.
+% \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 +12381,9 @@ wouldn’t exist.
\fi}}
% \end{macrocode}
%
-% \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.
+% \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 +12391,10 @@ wouldn’t exist.
\def\encodingdefault{\latinencoding}}
% \end{macrocode}
%
-% \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.
+% \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
@@ -12323,11 +12412,9 @@ wouldn’t exist.
\def\bbl@patchfont#1{\AddToHook{selectfont}{#1}}
% \end{macrocode}
%
-% \end{macro}
-%
% \subsection{Basic bidi support}
%
-% \textbf{Work in progress.} This code is currently placed here for
+% This code is currently placed here for
% practical reasons. It will be moved to the correct place soon, I
% hope.
%
@@ -12363,8 +12450,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 +12462,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,18 +12500,20 @@ 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 ??
- ,Imperial Aramaic,Avestan,Cypriot,Hatran,Hebrew,%
- Old Hungarian,Lydian,Mandaean,Manichaean,%
- Meroitic Cursive,Meroitic,Old North Arabian,%
- Nabataean,N'Ko,Orkhon,Palmyrene,Inscriptional Pahlavi,%
- Psalter Pahlavi,Phoenician,Inscriptional Parthian,Samaritan,%
- Old South Arabian,}%
+\def\bbl@rscripts{%
+ ,Garay,Todhri,Imperial Aramaic,Avestan,Cypriot,Elymaic,Hatran,Hebrew,%
+ Old Hungarian,Kharoshthi,Lydian,Mandaean,Manichaean,Mende Kikakui,%
+ Meroitic Cursive,Meroitic,Old North Arabian,Nabataean,N'Ko,%
+ Old Turkic,Orkhon,Palmyrene,Inscriptional Pahlavi,Psalter Pahlavi,%
+ Phoenician,Inscriptional Parthian,Hanifi,Samaritan,Old Sogdian,%
+ Old South Arabian,Yezidi,}%
\def\bbl@provide@dirs#1{%
\bbl@xin@{\csname bbl@sname@#1\endcsname}{\bbl@alscripts\bbl@rscripts}%
\ifin@
@@ -12453,9 +12544,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 +12617,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
@@ -12559,7 +12647,7 @@ wouldn’t exist.
%
% \subsection{Local Language Configuration}
%
-% \begin{macro}{\loadlocalcfg}
+% \macro{\loadlocalcfg}
%
% At some sites it may be necessary to add site-specific actions to
% a language definition file. This can be done by creating a file
@@ -12584,8 +12672,6 @@ wouldn’t exist.
\@empty}}
\fi
% \end{macrocode}%
-% \end{macro}
-%
% \subsection{Language options}
%
% Languages are loaded when processing the corresponding option
@@ -12629,6 +12715,7 @@ wouldn’t exist.
{\bbl@load@language{\CurrentOption}}%
{#1\bbl@load@language{#2}#3}}
%
+\DeclareOption{friulian}{\bbl@try@load@lang{}{friulan}{}}
\DeclareOption{hebrew}{%
\ifcase\bbl@engine\or
\bbl@error{only-pdftex-lang}{hebrew}{luatex}{}%
@@ -12676,7 +12763,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 +12804,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 +12830,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 +12906,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.
@@ -12838,7 +12925,7 @@ wouldn’t exist.
%</package>
% \end{macrocode}
%
-% \section{The kernel of Babel (\texttt{babel.def}, common)}
+% \section{The kernel of Babel}
%
% The kernel of the \babel\ system is currently stored in
% \file{babel.def}. The file \file{babel.def} contains most of the
@@ -12854,7 +12941,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.
%
@@ -12866,6 +12953,7 @@ wouldn’t exist.
\input babel.def
\let\bbl@onlyswitch\@undefined
%</kernel>
+% \end{macrocode}
%
% \section{Error messages}
%
@@ -12875,6 +12963,7 @@ wouldn’t exist.
% catcodes have the right value, although those for |\|, |`|, |^^M|,
% |%| and |=| are reset before loading the file.
%
+% \begin{macrocode}
%<*errors>
\catcode`\{=1 \catcode`\}=2 \catcode`\#=6
\catcode`\:=12 \catcode`\,=12 \catcode`\.=12 \catcode`\-=12
@@ -12946,19 +13035,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 +13055,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 +13067,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 +13110,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,16 +13149,16 @@ 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}
-%
% \section{Loading hyphenation patterns}
%
% The following code is meant to be read by ini\TeX\ because it
@@ -13090,13 +13179,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.
+% \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 +13196,7 @@ wouldn’t exist.
\ignorespaces}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\process@synonym}
+% \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,9 +13231,7 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\process@language}
+% \macro{\process@language}
%
% The macro |\process@language| is used to process a non-empty line
% from the `configuration file'. It has three arguments, each
@@ -13236,9 +13320,9 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \begin{macro}{\bbl@get@enc}
+% \macro{\bbl@get@enc}
%
-% \begin{macro}{\bbl@hyph@enc}
+% \macro{\bbl@hyph@enc}
% The macro |\bbl@get@enc| extracts the font encoding from the
% language name and stores it in |\bbl@hyph@enc|. It uses delimited
% arguments to achieve this.
@@ -13247,10 +13331,6 @@ wouldn’t exist.
\def\bbl@get@enc#1:#2:#3\@@@{\def\bbl@hyph@enc{#2}}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
% Now, hooks are defined. For efficiency reasons, they are dealt
% here in a special way. Besides \luatex, format-specific
% configuration files are taken into account. |loadkernel| currently
@@ -13324,15 +13404,15 @@ wouldn’t exist.
\bbl@hook@loadkernel{switch.def}
% \end{macrocode}
%
-% \begin{macro}{\readconfigfile}
-% The configuration file can now be opened for reading.
+% \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 +13447,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 +13478,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 +13489,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,10 +13508,9 @@ wouldn’t exist.
%</patterns>
% \end{macrocode}
%
-% Here the code for ini\TeX\ ends.
-% \end{macro}
+% Here the code for ini\TeX\ ends.
%
-% \section{Font handling with fontspec}
+% \section{\xetex{} + \luatex{}: common stuff}
%
% Add the bidi handler just before luaoftload, which is loaded by default
% by LaTeX. Just in case, consider the possibility it has not been
@@ -13450,33 +13528,19 @@ wouldn’t exist.
%<</More package options>>
% \end{macrocode}
%
+% \macro{\babelfont}
+%
% With explicit languages, we could define the font at once, but we
% don't. Just wait and see if the language is actually activated.
% |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 +13551,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 +13719,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)}
@@ -13700,13 +13759,9 @@ wouldn’t exist.
%<</Font selection>>
% \end{macrocode}
%
-% \section{Hooks for XeTeX and LuaTeX}
-%
-% \subsection{XeTeX}
+% \macro{\BabelFootnote}
%
-% Unfortunately, the current encoding cannot be retrieved and
-% therefore it is reset always to |utf8|, which seems a sensible
-% default.
+% Footnotes
%
% \begin{macrocode}
%<<*Footnote changes>>
@@ -13758,6 +13813,14 @@ wouldn’t exist.
%<</Footnote changes>>
% \end{macrocode}
%
+% \section{Hooks for XeTeX and LuaTeX}
+%
+% \subsection{XeTeX}
+%
+% Unfortunately, the current encoding cannot be retrieved and
+% therefore it is reset always to |utf8|, which seems a sensible
+% default.
+%
% Now, the code.
%
% \begin{macrocode}
@@ -13823,9 +13886,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 +14000,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 +14016,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 +14028,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 +14122,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,9 +14250,10 @@ 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>
+\directlua{ Babel = Babel or {} } % DL2
\ifx\AddBabelHook\@undefined % When plain.def, babel.sty starts
\bbl@trace{Read language.dat}
\ifx\bbl@readstream\@undefined
@@ -14338,8 +14399,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,16 +14420,19 @@ 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
-\begingroup % TODO - to a lua file
+% \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 % DL3
\catcode`\%=12
\catcode`\'=12
\catcode`\"=12
\catcode`\:=12
\directlua{
- Babel = Babel or {}
+ Babel.locale_props = Babel.locale_props or {}
function Babel.lua_error(e, a)
tex.print([[\noexpand\csname bbl@error\endcsname{]] ..
e .. '}{' .. (a or '') .. '}{}{}')
@@ -14461,7 +14529,7 @@ end
}
\endgroup
\ifx\newattribute\@undefined\else % Test for plain
- \newattribute\bbl@attr@locale
+ \newattribute\bbl@attr@locale % DL4
\directlua{ Babel.attr_locale = luatexbase.registernumber'bbl@attr@locale' }
\AddBabelHook{luatex}{beforeextras}{%
\setattribute\bbl@attr@locale\localeid}
@@ -14516,12 +14584,12 @@ end
{\prehyphenchar=\bbl@cl{prehc}\relax}}}}
% \end{macrocode}
%
-% \begin{macro}{\babelpatterns}
+% \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 +14618,6 @@ end
#2}}}%
\fi}}
% \end{macrocode}
-% \end{macro}
%
% \subsection{Southeast Asian scripts}
%
@@ -14563,9 +14630,8 @@ end
% not touched. See Unicode UAX 14.
%
% \begin{macrocode}
-% TODO - to a lua file
-\directlua{
- Babel = Babel or {}
+% TODO - to a lua file -- or a logical place
+\directlua{% DL5
Babel.linebreaking = Babel.linebreaking or {}
Babel.linebreaking.before = {}
Babel.linebreaking.after = {}
@@ -14585,7 +14651,6 @@ end
}
\def\bbl@intraspace#1 #2 #3\@@{%
\directlua{
- Babel = Babel or {}
Babel.intraspaces = Babel.intraspaces or {}
Babel.intraspaces['\csname bbl@sbcp@\languagename\endcsname'] = %
{b = #1, p = #2, m = #3}
@@ -14594,20 +14659,18 @@ end
}}
\def\bbl@intrapenalty#1\@@{%
\directlua{
- Babel = Babel or {}
Babel.intrapenalties = Babel.intrapenalties or {}
Babel.intrapenalties['\csname bbl@sbcp@\languagename\endcsname'] = #1
Babel.locale_props[\the\localeid].intrapenalty = #1
}}
\begingroup
\catcode`\%=12
-\catcode`\&=14
+\catcode`\&=14
\catcode`\'=12
\catcode`\~=12
\gdef\bbl@seaintraspace{&
\let\bbl@seaintraspace\relax
\directlua{
- Babel = Babel or {}
Babel.sea_enabled = true
Babel.sea_ranges = Babel.sea_ranges or {}
function Babel.set_chranges (script, chrng)
@@ -14638,7 +14701,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 +14714,9 @@ end
end
end
}&
- \bbl@luahyphenate}
+ \bbl@luahyphenate}
% \end{macrocode}
-%
+%
% \subsection{CJK line breaking}
%
% Minimal line breaking for CJK scripts, mainly intended for simple
@@ -14672,7 +14735,6 @@ end
\gdef\bbl@cjkintraspace{%
\let\bbl@cjkintraspace\relax
\directlua{
- Babel = Babel or {}
require('babel-data-cjk.lua')
Babel.cjk_enabled = true
function Babel.cjk_linebreak(head)
@@ -14697,8 +14759,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 +14777,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 +14809,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)
@@ -14769,7 +14833,6 @@ end
\ifin@ % cjk
\bbl@cjkintraspace
\directlua{
- Babel = Babel or {}
Babel.locale_props = Babel.locale_props or {}
Babel.locale_props[\the\localeid].linebreak = 'c'
}%
@@ -14781,7 +14844,6 @@ end
\bbl@seaintraspace
\bbl@exp{\\\bbl@intraspace\bbl@cl{intsp}\\\@@}%
\directlua{
- Babel = Babel or {}
Babel.sea_ranges = Babel.sea_ranges or {}
Babel.set_chranges('\bbl@cl{sbcp}',
'\bbl@cl{chrng}')
@@ -14829,7 +14891,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 +14912,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 +15078,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 +15096,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 +15139,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}
%
@@ -15100,14 +15159,14 @@ end
%
% \begin{macrocode}
% TODO - to a lua file
-\directlua{
+\directlua{% DL6
Babel.script_blocks = {
['dflt'] = {},
['Arab'] = {{0x0600, 0x06FF}, {0x08A0, 0x08FF}, {0x0750, 0x077F},
{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 +15278,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,9 +15338,9 @@ 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{
+\directlua{% DL7
Babel.nohyphenation = \the\l@nohyphenation
}
% \end{macrocode}
@@ -15299,7 +15358,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,27 +15384,30 @@ end
\bbl@ifsamestring{##1}{remove}&%
{\bbl@add@list\babeltempb{nil}}&%
{\directlua{
- local rep = [=[##1]=]
+ local rep = [=[##1]=]
+ local three_args = '%s*=%s*([%-%d%.%a{}|]+)%s+([%-%d%.%a{}|]+)%s+([%-%d%.%a{}|]+)'
+ &% Numeric passes directly: kern, penalty...
rep = rep:gsub('^%s*(remove)%s*$', 'remove = true')
rep = rep:gsub('^%s*(insert)%s*,', 'insert = true, ')
rep = rep:gsub('^%s*(after)%s*,', 'after = true, ')
rep = rep:gsub('(string)%s*=%s*([^%s,]*)', Babel.capture_func)
rep = rep:gsub('node%s*=%s*(%a+)%s*(%a*)', Babel.capture_node)
- rep = rep:gsub(&%
- '(norule)%s*=%s*([%-%d%.]+)%s+([%-%d%.]+)%s+([%-%d%.]+)',
- 'norule = {' .. '%2, %3, %4' .. '}')
+ rep = rep:gsub( '(norule)' .. three_args,
+ 'norule = {' .. '%2, %3, %4' .. '}')
if #1 == 0 or #1 == 2 then
- rep = rep:gsub(&%
- '(space)%s*=%s*([%-%d%.]+)%s+([%-%d%.]+)%s+([%-%d%.]+)',
+ rep = rep:gsub( '(space)' .. three_args,
'space = {' .. '%2, %3, %4' .. '}')
- rep = rep:gsub(&%
- '(spacefactor)%s*=%s*([%-%d%.]+)%s+([%-%d%.]+)%s+([%-%d%.]+)',
- 'spacefactor = {' .. '%2, %3, %4' .. '}')
+ rep = rep:gsub( '(spacefactor)' .. three_args,
+ 'spacefactor = {' .. '%2, %3, %4' .. '}')
rep = rep:gsub('(kashida)%s*=%s*([^%s,]*)', Babel.capture_kashida)
- else
+ &% Transform values
+ rep, n = rep:gsub( '{([%a%-]+)|([%-%d%.]+)}',
+ '{\the\csname bbl@id@@#3\endcsname,"%1",%2}')
+ end
+ if #1 == 1 then
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 .. [[}}]])
}}}&%
@@ -15355,14 +15417,14 @@ end
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 +15484,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 +15526,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
@@ -15478,6 +15540,10 @@ end
require('babel-transforms.lua')
Babel.linebreaking.add_before(Babel.pre_hyphenate_replace)
}}
+\newcommand\SetTransformValue[3]{%
+ \directlua{
+ Babel.locale_props[\the\csname bbl@id@@#1\endcsname].vars["#2"] = #3
+ }}
% \end{macrocode}
%
% The following experimental (and unfinished) macro applies the
@@ -15504,8 +15570,6 @@ end
\def\bbl@activate@preotf{%
\let\bbl@activate@preotf\relax % only once
\directlua{
- Babel = Babel or {}
- %
function Babel.pre_otfload_v(head)
if Babel.numbers and Babel.digits_mapped then
head = Babel.numbers(head)
@@ -15516,7 +15580,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 +15607,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,9 +15622,12 @@ 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
+ \newattribute\bbl@attr@dir
\directlua{ Babel.attr_dir = luatexbase.registernumber'bbl@attr@dir' }
\bbl@exp{\output{\bodydir\pagedir\the\output}}
\fi
@@ -15633,6 +15701,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}
@@ -15834,7 +15908,6 @@ end
{\RequirePackage{luatexbase}%
\bbl@activate@preotf
\directlua{
- Babel = Babel or {} %%% -> presets in luababel
Babel.digits_mapped = true
Babel.digits = Babel.digits or {}
Babel.digits[\the\localeid] =
@@ -15871,10 +15944,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 +15984,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 +16011,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 +16051,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 +16157,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 +16188,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 +16272,17 @@ Babel.linebreaking.replacements = {}
Babel.linebreaking.replacements[0] = {} -- pre
Babel.linebreaking.replacements[1] = {} -- post
+function Babel.tovalue(v)
+ if type(v) == 'table' then
+ return Babel.locale_props[v[1]].vars[v[2]] or v[3]
+ 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 +16329,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 +16345,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 +16393,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 +16406,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
@@ -16328,6 +16430,7 @@ Babel.us_char = string.char(31)
function Babel.hyphenate_replace(head, mode)
local u = unicode.utf8
local lbkr = Babel.linebreaking.replacements[mode]
+ local tovalue = Babel.tovalue
local word_head = head
@@ -16448,7 +16551,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 +16562,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 +16583,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,
@@ -16531,9 +16634,9 @@ function Babel.hyphenate_replace(head, mode)
d.replace = Babel.str_to_nodes(crep.no, matches, item_base)
d.attr = item_base.attr
if crep.pre == nil then -- TeXbook p96
- d.penalty = crep.penalty or tex.hyphenpenalty
+ d.penalty = tovalue(crep.penalty) or tex.hyphenpenalty
else
- d.penalty = crep.penalty or tex.exhyphenpenalty
+ d.penalty = tovalue(crep.penalty) or tex.exhyphenpenalty
end
placeholder = '|'
head, new = node.insert_before(head, item, d)
@@ -16544,37 +16647,37 @@ function Babel.hyphenate_replace(head, mode)
elseif crep and crep.penalty then
d = node.new(14, 0) -- (penalty, userpenalty)
d.attr = item_base.attr
- d.penalty = crep.penalty
+ d.penalty = tovalue(crep.penalty)
head, new = node.insert_before(head, item, d)
elseif crep and crep.space then
-- 655360 = 10 pt = 10 * 65536 sp
d = node.new(12, 13) -- (glue, spaceskip)
local quad = font.getfont(item_base.font).size or 655360
- node.setglue(d, crep.space[1] * quad,
- crep.space[2] * quad,
- crep.space[3] * quad)
+ node.setglue(d, tovalue(crep.space[1]) * quad,
+ tovalue(crep.space[2]) * quad,
+ tovalue(crep.space[3]) * quad)
if mode == 0 then
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
local quad = font.getfont(item_base.font).size or 655360
- d.width = crep.norule[1] * quad
- d.height = crep.norule[2] * quad
- d.depth = crep.norule[3] * quad
+ d.width = tovalue(crep.norule[1]) * quad
+ d.height = tovalue(crep.norule[2]) * quad
+ d.depth = tovalue(crep.norule[3]) * quad
head, new = node.insert_before(head, item, d)
elseif crep and crep.spacefactor then
d = node.new(12, 13) -- (glue, spaceskip)
local base_font = font.getfont(item_base.font)
node.setglue(d,
- crep.spacefactor[1] * base_font.parameters['space'],
- crep.spacefactor[2] * base_font.parameters['space_stretch'],
- crep.spacefactor[3] * base_font.parameters['space_shrink'])
+ tovalue(crep.spacefactor[1]) * base_font.parameters['space'],
+ tovalue(crep.spacefactor[2]) * base_font.parameters['space_stretch'],
+ tovalue(crep.spacefactor[3]) * base_font.parameters['space_shrink'])
if mode == 0 then
placeholder = ' '
end
@@ -16582,16 +16685,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
+ d.kern = tovalue(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 +16724,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 +16835,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
@@ -16768,24 +16871,19 @@ end
%<*bididata>
-- Data from Unicode and ConTeXt
-Babel = Babel or {}
-
Babel.ranges = {
{0x0590, 0x05FF, 'r'},
{0x0600, 0x07BF, 'al'},
{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 = {
@@ -22895,8 +22993,6 @@ Babel.characters = {
%
% \begin{macrocode}
%<*basic-r>
-Babel = Babel or {}
-
Babel.bidi_enabled = true
require('babel-data-bidi.lua')
@@ -22970,13 +23066,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 +23181,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 +23190,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
@@ -23163,8 +23257,6 @@ end
%
% \begin{macrocode}
%<*basic>
-Babel = Babel or {}
-
-- eg, Babel.fontmap[1][<prefontid>]=<dirfontid>
Babel.fontmap = Babel.fontmap or {}
@@ -23232,7 +23324,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 +23346,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 +23381,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 +23390,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 +23461,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 +23518,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 +23534,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 +23700,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}
%
@@ -23620,14 +23729,12 @@ end
%\iffalse
% \begin{macrocode}
%<*cjkdata>
-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 +23755,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 +23778,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 +23838,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 +23890,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 +23992,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 +24051,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 +24065,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,26 +24079,23 @@ 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.
-% \begin{macro}{\captionnil}
-% \begin{macro}{\datenil}
+% The next step consists of defining commands to switch to (and from)
+% the `nil' language.
+% \macro{\captionnil}
+% \macro{\datenil}
%
% \begin{macrocode}
\let\captionsnil\@empty
\let\datenil\@empty
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-%
% There is no locale file for this pseudo-language, so the
% corresponding fields are defined here.
%
@@ -23995,10 +24130,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 +24623,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 +24633,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 +24812,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 +24887,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 +24907,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 +24919,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 +24933,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 +25001,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 +25021,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 +25056,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 +25099,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 +25223,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 +25234,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 +25257,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 +25294,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 9c640a94cbe..649fdcfb09a 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/26}
+\def\filedate{2024/10/05}
\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 d88b690b23a..44813fd1706 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/26 v24.7]
+\ProvidesFile{bbcompat.dtx}[2024/10/05 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 f351a76a957..65094f6e58e 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/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/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/bithesis/bithesis.dtx b/Master/texmf-dist/source/latex/bithesis/bithesis.dtx
index ee8c1459638..88157edae07 100644
--- a/Master/texmf-dist/source/latex/bithesis/bithesis.dtx
+++ b/Master/texmf-dist/source/latex/bithesis/bithesis.dtx
@@ -21,10 +21,10 @@
%<thesis>\ProvidesExplClass{bithesis}
%<report>\ProvidesExplClass{bitreport}
%<beamer>\ProvidesExplClass{bitbeamer}
-%<cls>{2024-05-30}{3.7.9}{BIT Thesis Templates}
+%<cls>{2024-10-07}{3.8.0}{BIT Thesis Templates}
%
%<*driver>
-\ProvidesFile{bithesis.dtx}[2024/05/30 3.7.9 BIT Thesis Templates]
+\ProvidesFile{bithesis.dtx}[2024/10/07 3.8.0 BIT Thesis Templates]
\documentclass[letterpaper]{l3doc}
\usepackage{dtx-style}
@@ -66,7 +66,7 @@
%
% 定义全局变量。
% \begin{variable}{\g_@@_thesis_type_int}
-% 论文类型,取值从 1 开始,分别对应:
+% 论文类型,取值从 1 开始,分别对应:
% \begin{enumerate}
% \item 本科生毕业设计(论文)
% \item 本科生毕业设计(论文)外文翻译
@@ -160,7 +160,7 @@
%
% \end{macro}
%
-% \begin{macro}[added=2023-03-16]{\@@_get_const:}
+% \begin{macro}[added=2023-03-16]{\@@_get_const:N}
% 获取标题、章节、表格、图形等的常量名称。
% 会区别英文模式和中文模式。
% \begin{macrocode}
@@ -216,7 +216,7 @@
% \begin{macrocode}
\cs_new:Npn \@@_if_thesis_int_type:nTF #1#2#3 {\int_compare:nNnTF {\g_@@_thesis_type_int} = {#1} {#2} {#3}}
\cs_new:Npn \@@_if_thesis_int_type:nT #1#2 {\@@_if_thesis_int_type:nTF {#1} {#2} {}}
-\cs_new:Npn \__bithesis_if_thesis_int_type:nF #1#2 {\__bithesis_if_thesis_int_type:nTF {#1} {} {#2}}
+\cs_new:Npn \@@_if_thesis_int_type:nF #1#2 {\@@_if_thesis_int_type:nTF {#1} {} {#2}}
% \end{macrocode}
% \end{macro}
@@ -260,7 +260,7 @@
\cs_new_protected:Npn \@@_define_label:nn #1#2
{ \tl_const:cn { c_@@_label_ #1 _tl } {#2} }
-\cs_new_protected:Npn \@@_define_label_by_thesis_type:nnn #1#2#3
+\cs_new_protected:Npn \@@_define_label_by_thesis_type:nnn #1#2#3
{
\tl_const:cn { c_@@_ #1 _label_ #2 _tl } {#3}
}
@@ -370,9 +370,9 @@
\circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文);
\circled{3}~学校可允许本毕业设计(论文)被查阅或借阅;\circled{4}~学校可以学术交流为目的,
复制赠送和交换本毕业设计(论文);\circled{5}~学校可以公布本毕业设计(论文)的全部或部分内容。},
- {originality_author_signature}
+ {originality_author_signature}
{本人签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日},
- {originality_supervisor_signature}
+ {originality_supervisor_signature}
{指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日},
} {\@@_define_label_by_thesis_type:nnn {bachelor} #1}
% \end{macrocode}
@@ -388,7 +388,7 @@
本人郑重声明:所呈交的毕业设计(论文),
是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外,
本文不包含任何其他个人或集体已经发表或撰写过的研究成果。
- 对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。特此申明。\par
+ 对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。特此申明。\par
\arialfamily I,\dunderline[-1pt]{1pt}{\makebox[18mm]{}},~solemnly~
declare:~the~submitted~graduation~design~(thesis),~
is~the~research~achievement~completed~independently~by~myself~
@@ -441,9 +441,9 @@
\par~\circled{3}~学校可允许学位论文被查阅或借阅;
\par~\circled{4}~学校可以学术交流为目的,复制赠送和交换学位论文;
\par~\circled{5}~学校可以公布学位论文的全部或部分内容(保密学位论文在解密后遵守此规定)。},
- {originality_author_signature}
+ {originality_author_signature}
{签\qquad 名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad},
- {originality_supervisor_signature}
+ {originality_supervisor_signature}
{导师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad},
} {\@@_define_label_by_thesis_type:nnn {graduate} #1}
% \end{macrocode}
@@ -458,7 +458,7 @@
{school} {学\quad 院\quad 名\quad 称} {School~or~Department},
{supervisor} {指\quad 导\quad 教\quad 师} {Faculty~Mentor},
{chairman} {答辩委员会主席} {Chair,~Thesis~Committee},
- {degree}
+ {degree}
{申\quad 请\quad 学\quad 位}
{Degree~Applied},
{major} {学\quad 科\hspace{0.8ex} / \hspace{0.8ex} 类\quad 别} {Major},
@@ -475,7 +475,7 @@
% \begin{variable}{\c_@@_label_xxx_tl,\c_@@_label_xxx_en_tl}
% 常用的中英常量。
% \begin{macrocode}
-\clist_map_inline:nn
+\clist_map_inline:nn
{
{school} {学\qquad 院} {School},
{major} {专\qquad 业} {Degree},
@@ -491,14 +491,16 @@
{toc} {目\label_space: 录} {Table~of~Contents},
{abstract} {摘\label_space: 要} {Abstract},
{conclusion} {结\label_space: 论} {Conclusions},
+ % 附录部分的总标题
{appendix} {附\label_space: 录} {Appendices},
- {ack} {致\label_space: 谢} {Acknowledgement},
+ {ack} {致\label_space: 谢} {Acknowledgements},
{figure} {插\label_space: 图} {Illustrations},
{table} {表\label_space: 格} {Tables},
+ % 附录下各部分编号的前缀
{appendix_prefix} {附录} {Appendix},
{reference} {参考文献} {References},
{university} {北京理工大学} {Beijing~Institute~of~Technology},
- {publications} {攻读学位期间发表论文与研究成果清单}
+ {publications} {攻读学位期间发表论文与研究成果清单}
{Publications~During~Studies},
% TODO: Not so sure about the translation.
{resume} {作者简介} {Author~Biography},
@@ -527,8 +529,8 @@
% \begin{macrocode}
\clist_const:Nn \c_@@_bachelor_thesis_header_clist
{
- 北京理工大学本科生毕业设计(论文),
- 北京理工大学本科生毕业设计(论文)外文翻译,
+ 北京理工大学本科生毕业设计(论文),
+ 北京理工大学本科生毕业设计(论文)外文翻译,
Beijing~Institute~of~Technology~Bachelor's~Thesis,
北京理工大学硕士学位论文,
北京理工大学博士学位论文,
@@ -568,8 +570,8 @@
type .value_required:n = true,
type .choices:Vn =
\c_@@_thesis_type_clist
- {
- \int_set_eq:NN \g_@@_thesis_type_int \l_keys_choice_int
+ {
+ \int_set_eq:NN \g_@@_thesis_type_int \l_keys_choice_int
\int_case:nn {\l_keys_choice_int} {
% 本科全英文也是英文模板。
{3} {\@@_set_english_mode:}
@@ -598,7 +600,7 @@
xiheiFont .tl_set:N = \l_@@_cover_xihei_font_path_tl,
xiheiFont .default:n = {STXihei},
%% cover entry
- dilimiter .tl_set:N = \l_@@_cover_dilimiter_tl,
+ delimiter .tl_set:N = \l_@@_cover_delimiter_tl,
labelAlign .tl_set:N = \l_@@_cover_label_align_tl,
labelAlign .initial:n = {r},
valueAlign .tl_set:N = \l_@@_cover_value_align_tl,
@@ -614,10 +616,20 @@
underlineOffset .dim_set:N = \l_@@_cover_underline_offset_dim,
underlineOffset .initial:n = { -10pt },
hideCoverInPeerReview .bool_set:N = \l_@@_cover_hide_cover_in_peer_review_bool,
+ % 此处暂且填充默认值为`false`,待确定`\g_@@_thesis_type_int`后再根据论文类型覆盖默认值
hideCoverInPeerReview .initial:n = {false},
% 研究生的「特殊类型」
showSpecialTypeBox .bool_set:N = \l_@@_cover_show_special_type_box_bool,
- showSpecialTypeBox .initial:n = {false}
+ showSpecialTypeBox .initial:n = {false},
+ % 本科英文模板也可以使用中文封面
+ prefer-zh .bool_set:N = \l_@@_cover_prefer_zh_bool,
+ prefer-zh .initial:n = {false},
+ % 本科英文模板使用中文封面时可能需要调换中英文标题顺序
+ reverse-titles .bool_set:N = \l_@@_cover_reverse_titles_bool,
+ reverse-titles .initial:n = {false},
+ % 本科英文模板可加入中文标题
+ addTitleZh .bool_set:N = \l_@@_cover_add_titlezh_bool,
+ addTitleZh .initial:n = {true},
}
% \end{macrocode}
%
@@ -743,7 +755,7 @@
tabularRowSeparation .initial:n = {1},
}
% \end{macrocode}
-%
+%
% 定义 |bithesis/const| 键值对类。
% \begin{macrocode}
\keys_define:nn { bithesis / const }
@@ -751,6 +763,7 @@
autoref .meta:nn = { bithesis / const / autoref } { #1 },
style .meta:nn = { bithesis / const / style } { #1 },
info .meta:nn = { bithesis / const / info } { #1 },
+ heading .meta:nn = { bithesis / const / heading } { #1 },
}
\keys_define:nn { bithesis / const / autoref }
{
@@ -803,6 +816,13 @@
}
},
}
+\keys_define:nn { bithesis / const / heading }
+ {
+ acknowledgements .tl_set:N = \g_@@_const_heading_acknowledgements_tl,
+ acknowledgements .initial:n = {
+ \@@_get_const:N {ack}
+ },
+ }
% \end{macrocode}
%
% 定义 |bithesis/style| 键值对类。
@@ -825,6 +845,10 @@
{ \flushbottom }
},
pageVerticalAlign .initial:n = {top},
+ non-CJK-font-in-headings .choice:,
+ non-CJK-font-in-headings / serif .code:n = { \bool_set_false:N \l_@@_arial_as_title_font_bool },
+ non-CJK-font-in-headings / sans .code:n = { \bool_set_true:N \l_@@_arial_as_title_font_bool },
+ non-CJK-font-in-headings .initial:n = {serif},
% 数学字体配置
mathFont .choices:nn = {
asana, bonum, cm, concrete, dejavu, erewhon, euler,
@@ -854,10 +878,16 @@
% \begin{macrocode}
\keys_define:nn { bithesis / TOC }
{
+ title .tl_set:N = \l_@@_toc_title_tl,
+ title .initial:n = {
+ \@@_get_const:N {toc}
+ },
abstract .bool_set:N = \l_@@_add_abstract_to_toc_bool,
abstract .initial:n = {true},
abstractEn .bool_set:N = \l_@@_add_abstract_en_to_toc_bool,
abstractEn .initial:n = {true},
+ TOC .bool_set:N = \l_@@_add_toc_to_toc_bool,
+ TOC .initial:n = {false},
symbols .bool_set:N = \l_@@_add_symbols_to_toc_bool,
symbols .initial:n = {true},
}
@@ -879,7 +909,7 @@
{
% mode .choice:,
% mode .value_required:n = true,
- % mode .choices:Vn =
+ % mode .choices:Vn =
% \c_@@_publication_modes_clist
% {
% \int_new:N \l_@@_publication_mode_int
@@ -896,11 +926,19 @@
minbibnames .initial:n = {10},
}
% \end{macrocode}
-% 在宏加载时,处理 |bithesis/option| 中的值。使得 |bithesis|
+% 在宏加载时,处理 |bithesis/option| 中的值。使得 |bithesis|
% 宏包的模板选项可以在宏加载时生效。
% \begin{macrocode}
\ProcessKeysOptions { bithesis / option }
% \end{macrocode}
+% 确定 |bithesis/option| 中的 |\g_@@_thesis_type_int| 后,根据论文类型自动覆盖某些选项的默认值。
+% \begin{macrocode}
+\@@_if_graduate:TF {
+ \keys_set:nn {bithesis} {cover/hideCoverInPeerReview = false}
+} {
+ \keys_set:nn {bithesis} {cover/hideCoverInPeerReview = true}
+}
+% \end{macrocode}
%
% \subsubsection{处理模板选项}
%
@@ -952,6 +990,9 @@
\RequirePackage{geometry}
\RequirePackage[table,xcdraw]{xcolor}
\RequirePackage{xeCJK}
+% 恢复数学行距(restoremathleading),同时避免改变正文行距。
+% (ctex 默认 linespread 1.3 × LaTeX 默认倍数 1.2 = 1.56)
+\RequirePackage[bodytextleadingratio=1.56]{zhlineskip}
\RequirePackage{titletoc}
\RequirePackage{graphicx}
\RequirePackage{fancyhdr}
@@ -980,12 +1021,12 @@
% 抑制 \pkg{hyperref} 中对 |\hskip| 的 warning 信息。
% \begin{macrocode}
\pdfstringdefDisableCommands{%
- \let\quad\empty
+ \let\quad\empty
}
% \end{macrocode}
%
% 设置页眉字号,页边距。
-%
+%
% 需要注意的是,根据 \pkg{geometry} 的规则,
% |headsep| 和 |footskip| 分别受到 |top| 与 |bottom| 的影响。
% 所以你能看到在计算 |headsep| 与 |footskip| 时,我们
@@ -1040,7 +1081,7 @@
% \end{macrocode}
%
% \subsubsection{定义字体相关选项}
-%
+%
% 设置 Times New Roman 字体。
% 根据学校规范要求,默认情况下也使用 Times New Roman 字体。
% \begin{macrocode}
@@ -1073,7 +1114,7 @@
}
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\@@_load_unicode_math_pkg:}
% 加载\pkg{unicode-math}宏包。
% \begin{macrocode}
@@ -1133,7 +1174,7 @@
\cs_new:Npn \@@_load_math_font_cm: { }
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\@@_load_math_font_none:}
% 数学字体配置 |none|。
% \begin{macrocode}
@@ -1173,28 +1214,27 @@
{
\hypersetup { hidelinks }
} {
- \definecolor{blue}{RGB}{10,10,110}
+ \definecolor{blue}{RGB}{10,10,110}
\hypersetup{
colorlinks=true,
}
}
-
- \@@_if_thesis_english:TF {
- \@@_if_thesis_int_type:nT {3} {
- % 对于本科全英文专业模板
- % Font Arial is needed.
- \newfontfamily\arialfamily{Arial}
- }
+ \bool_if:NTF \l_@@_arial_as_title_font_bool {
+ % 手动指定时要加载 Arial
+ \newfontfamily\arialfamily{Arial}
} {
- % 对于其他的中文模板,
- % 需要加载细黑体。
- \tl_if_blank:VTF \l_@@_cover_xihei_font_path_tl {}
- {
- \setCJKfamilyfont{xihei}[AutoFakeBold,AutoFakeSlant]
- {\l_@@_cover_xihei_font_path_tl}
+ % 即使未指定,本科全英文专业模板的声明也需要 Arial
+ \@@_if_thesis_int_type:nT {3} {
+ \newfontfamily\arialfamily{Arial}
}
}
+ % 无论中英文,封面都可能需要细黑体。
+ \tl_if_blank:VTF \l_@@_cover_xihei_font_path_tl {}
+ {
+ \setCJKfamilyfont{xihei}[AutoFakeBold,AutoFakeSlant]
+ {\l_@@_cover_xihei_font_path_tl}
+ }
% 对于本科全英文专业模板,需要自定义日期格式。
\@@_if_thesis_int_type:nT {3} {
@@ -1219,7 +1259,7 @@
}
% 修改 biblatex 中「专利」(patent)部分的著录格式。
- % 主要根据北理工自定义的规范,参考 biblatex 和
+ % 主要根据北理工自定义的规范,参考 biblatex 和
% biblatex-gb7714-2015 的实现修改而成。
%
% 默认不开启,因为此修改可能会产生其他边界问题。
@@ -1295,7 +1335,7 @@
}
}
% \end{macrocode}
-%
+%
% \begin{macro}{\xihei:n}
% 定义细黑字体。
% \begin{macrocode}
@@ -1308,21 +1348,23 @@
}
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\l_@@_title_font_cs:n}
% 定义标题字体。
% \begin{macrocode}
\cs_new:Npn \l_@@_title_font_cs:n #1 {
- \int_compare:nNnTF {\g_@@_thesis_type_int} = {3}
+ \bool_if:NTF \l_@@_arial_as_title_font_bool
{
- \arialfamily #1
+ % 即使是英文模板,仍可能出现中文,也需设置中文字体。
+ \heiti\arialfamily #1
} {
+ % 西文保持原本的 Times New Roman。黑体一般不搭配衬线体,但学校要求如此。
\heiti #1
}
}
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\l_@@_unnumchapter_style_cs:n}
% 定义无序章节的样式。
% \begin{macrocode}
@@ -1344,7 +1386,7 @@
\cs_set:Npn \arabicHeiti #1 {#1}
% \end{macrocode}
% \end{macro}
-%
+%
% 定义 \pkg{fancyhdr} 的页眉页脚。
% \begin{macrocode}
\fancypagestyle{BIThesis}{
@@ -1470,20 +1512,14 @@
{\tablename~\thecontentslabel\quad}{\hspace*{-1.5cm}}
{\hspace{.5em}\titlerule*{.}\contentspage}
% \end{macrocode}
-%
+%
% \subsubsection{定义样式相关函数}
%
% \begin{macro}{\frontmatter}
% 定义前置内容的页面样式。
% \begin{macrocode}
\RenewDocumentCommand \frontmatter {} {
- \int_compare:nNnTF {\g_@@_thesis_type_int} = {3}
- {
- % 本科全英文专业论文,页码使用小罗马数字。
- \pagenumbering{roman}
- } {
- \pagenumbering{Roman}
- }
+ \pagenumbering{Roman}
% 这部分的章节标题不进行编号。
\ctexset{
chapter = {
@@ -1492,9 +1528,9 @@
}
\linespread{1.53}\selectfont
\pagestyle{BIThesis}
-
+
% 调整表格内容字号(默认五号)和各行之间的距离。
- %
+ %
% 由于这种方式会影响所有的表格,
% 所以我们尽可能延迟这种影响。
%
@@ -1507,7 +1543,7 @@
% 为保证各种表格效果一致,要先手动重置setspace宏包漏掉的longtable;
\AtBeginEnvironment {longtable} {\singlespacing}
% 之后再统一设置。
- \clist_map_inline:nn
+ \clist_map_inline:nn
{tabular, tabular*, tabularx, longtable}
{
\AtBeginEnvironment {##1} {
@@ -1522,7 +1558,7 @@
}
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\mainmatter}
% 主体内容的页面样式。
% \begin{macrocode}
@@ -1547,7 +1583,7 @@
}
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\backmatter}
% 后置内容的页面样式。
% \begin{macrocode}
@@ -1569,7 +1605,7 @@
}
% \end{macrocode}
% \end{macro}
-%
+%
% 定义标题的前后间距。
% \begin{macrocode}
\setlength{\abovecaptionskip}{11pt}
@@ -1580,7 +1616,7 @@
% 为了满足 “前后一行空白的问题”,需要删除 caption 下方的间距。
% 详见 `caption` 宏包手册和
% https://github.com/CTeX-org/forum/issues/86
- %
+ %
% 这里实际的 skip 在 15pt 左右,但是全部移除会导致当图片置于页面顶部时,
% 图片与上方的间距过小,因此这里只移除 5pt。
% 当然,这样会导致文本间的图片的 caption 下方的间距微微大于一行。
@@ -1601,7 +1637,7 @@
\setlength{\belowcaptionskip}{9pt}
}
% \end{macrocode}
-%
+%
% 定义分隔字符。
% \begin{macrocode}
\@@_if_graduate:TF {
@@ -1622,7 +1658,7 @@
\captionsetup[algorithm]{font=small,labelsep=space}
}
% \end{macrocode}
-%
+%
% \begin{macro}{\thefigure,\thetable,\theequation,\thelstlisting,\lstlistingname}
% 定义各种计数器的格式。
% \begin{macrocode}
@@ -1639,21 +1675,21 @@
\AtBeginDocument{
\cs_gset:Npn \thelstlisting {\thechapter\g_@@_label_divide_char_tl\arabic{lstlisting}}
\cs_gset:Npn \lstlistingname {\c_@@_label_code_tl}
-
+
% 算法变成「章节号-序号」
% 为了减少修改,我们只适配按章编号的情况。
% 针对 algorithm 宏包
\@ifpackagewith{algorithm}{chapter}{
\cs_gset:Npn \thealgorithm
- {\thechapter\g__bithesis_label_divide_char_tl\arabic{algorithm}}
+ {\thechapter\g_@@_label_divide_char_tl\arabic{algorithm}}
}{}
% 针对 algorithm2e 宏包
\@ifpackagewith{algorithm2e}{algochapter}{
% 名字中的“cf”是指其作者 Christophe Fiorio。
\cs_gset:Npn \thealgocf
- {\thechapter\g__bithesis_label_divide_char_tl\arabic{algocf}}
+ {\thechapter\g_@@_label_divide_char_tl\arabic{algocf}}
}{}
-
+
% 默认的情况下,保留公式和上下文的一定间距。(会比 Word 稍宽一些)
\setlength{\abovedisplayskip}{\l_@@_style_math_above_display_skip_dim}
\setlength{\abovedisplayshortskip}{\l_@@_style_math_above_display_skip_dim}
@@ -1676,7 +1712,7 @@
}
% \end{macrocode}
% \end{macro}
-%
+%
% 调整底层 TeX 排版引擎参数以保证所有段落能够很好地以两端对齐的方式呈现。
% 是的,这是祖传代码。
% 在英文模式下禁用,因为这段代码会禁用 hyphenation.
@@ -1715,13 +1751,13 @@
}
\lstset{style=examplestyle}
% \end{macrocode}
-%
+%
% 调整插图目录与表格目录的标题。
% \begin{macrocode}
-\cs_set:Npn \listfigurename {\currentpdfbookmark{\c__bithesis_label_figure_tl}{ch:figures}\@@_get_const:N {figure}}
-\cs_set:Npn \listtablename {\currentpdfbookmark{\c__bithesis_label_table_tl}{ch:tables}\@@_get_const:N {table}}
+\cs_set:Npn \listfigurename {\currentpdfbookmark{\c_@@_label_figure_tl}{ch:figures}\@@_get_const:N {figure}}
+\cs_set:Npn \listtablename {\currentpdfbookmark{\c_@@_label_table_tl}{ch:tables}\@@_get_const:N {table}}
% \end{macrocode}
-%
+%
% 预定义用户常用的证明环境。
% \begin{macrocode}
\theoremstyle{plain}
@@ -1740,10 +1776,10 @@
\newtheorem{rem}{\@@_get_const:N {rem}}
\renewcommand{\qedsymbol}{\ensuremath{\blacksquare}}
% \end{macrocode}
-%
+%
% \begin{macro}{\@@_dunderline:nnn,\@@_dunderline:nn,\@@_dunderline:n}
% 用于渲染下划线。
-%
+%
% 参数如下:
% \begin{itemize}
% \item \#1 位置,可选值为 \texttt{c}enter、\texttt{l}eft、\texttt{r}ight。
@@ -1781,7 +1817,7 @@
% \begin{macrocode}
\cs_new:Npn \@@_render_cover_entry:nn #1#2 {
\makebox[\l_@@_cover_label_max_width_dim][\l_@@_cover_label_align_tl]{
- \tl_if_blank:VTF #1 {} {#1\l_@@_cover_dilimiter_tl}
+ \tl_if_blank:VTF #1 {} {#1\l_@@_cover_delimiter_tl}
}
\hspace{1ex}
\@@_dunderline:nnn{\l_@@_cover_underline_offset_dim}
@@ -1791,7 +1827,7 @@
}
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{|@@_get_text_width:Nn,\@@_get_text_width:NV}
% 计算 \#2 所占用的宽度,将结果存储在 \#1 中。
%
@@ -1809,7 +1845,7 @@
\cs_generate_variant:Nn \@@_get_text_width:Nn { NV }
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\@@_get_max_text_width:NN}
% 从 \#2 中获取最大的文本宽度,然后设置到 \#1 中。
%
@@ -1876,7 +1912,7 @@
% 比如 {label_1} {value \\ 1} 会被转换成
% { {label_1} {value}, {} {1} }
\@@_parse_entry ##1
- % 然后将这些 label - value 对添加到 \l_@@_right_seq
+ % 然后将这些 label - value 对添加到 \l_@@_right_seq
% 或者 \l_@@_left_sql 中。
% left 就是 label,right 就是 value。
\seq_concat:NNN \l_@@_right_seq \l_@@_right_seq \l_@@_tmp_right_seq
@@ -1888,7 +1924,7 @@
\@@_get_max_text_width:NN \l_@@_cover_label_max_width_dim \l_@@_left_seq
\@@_get_max_text_width:NN \l_@@_cover_value_max_width_dim \l_@@_right_seq
}
-
+
% 最后,根据宽度渲染 label 和 value 对。
\group_begin:
@@ -1904,7 +1940,7 @@
}
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\make_graduate_cover:}
% 制作研究生论文模板封面。
% \begin{macrocode}
@@ -1948,7 +1984,7 @@
\centering
{
\heiti\zihao{3}
- \tl_if_blank:VTF \l_@@_value_vertical_title_tl
+ \tl_if_blank:VTF \l_@@_value_vertical_title_tl
{\l_@@_value_title_tl}{\l_@@_value_vertical_title_tl}
}
\par
@@ -2024,8 +2060,8 @@
{
\renewcommand{\baselinestretch}{2}
- \tl_if_empty:NT \l_@@_cover_dilimiter_tl {
- \tl_set:Nn \l_@@_cover_dilimiter_tl {\qquad}
+ \tl_if_empty:NT \l_@@_cover_delimiter_tl {
+ \tl_set:Nn \l_@@_cover_delimiter_tl {\qquad}
}
\tl_set:Nn \l_@@_cover_underline_offset_dim {-5pt}
@@ -2034,10 +2070,10 @@
\bool_if:NF \l_@@_cover_auto_width_bool {
\dim_compare:nNnT {\l_@@_cover_label_max_width_dim} = {0pt} {
\dim_set:Nn \l_@@_cover_label_max_width_dim {45mm}
- }
+ }
\dim_compare:nNnT {\l_@@_cover_value_max_width_dim} = {0pt} {
\dim_set:Nn \l_@@_cover_value_max_width_dim {60mm}
- }
+ }
}
% 渲染信息。
@@ -2080,8 +2116,8 @@
\vskip \stretch{1}
{
- \tl_if_empty:NT \l_@@_cover_dilimiter_tl {
- \tl_set:Nn \l_@@_cover_dilimiter_tl {:~}
+ \tl_if_empty:NT \l_@@_cover_delimiter_tl {
+ \tl_set:Nn \l_@@_cover_delimiter_tl {:~}
}
\tl_set:Nn \l_@@_cover_label_align_tl {l}
@@ -2092,10 +2128,10 @@
\bool_if:NF \l_@@_cover_auto_width_bool {
\dim_compare:nNnT {\l_@@_cover_label_max_width_dim} = {0pt} {
\dim_set:Nn \l_@@_cover_label_max_width_dim {55mm}
- }
+ }
\dim_compare:nNnT {\l_@@_cover_value_max_width_dim} = {0pt} {
\dim_set:Nn \l_@@_cover_value_max_width_dim {85mm}
- }
+ }
}
% 渲染信息。
@@ -2279,7 +2315,15 @@
\begin{blindPeerReview}[\l_@@_cover_hide_cover_in_peer_review_bool]
\group_begin:
- \int_case:nn {\g_@@_thesis_type_int}
+ % 封面使用的 thesis-type 可能与整体不同。
+ \int_new:N \l_@@_thesis_type_int
+ \bool_if:NTF \l_@@_cover_prefer_zh_bool {
+ \int_set:Nn \l_@@_thesis_type_int {1}
+ } {
+ \int_set:Nn \l_@@_thesis_type_int \g_@@_thesis_type_int
+ }
+
+ \int_case:nn {\l_@@_thesis_type_int}
{
{1}
{
@@ -2297,32 +2341,43 @@
\zihao{-0}\textbf{\ziju{0.12}\songti{\l_@@_style_headline_tl}}\par
- \vspace{16mm}
-
- \zihao{2}\textbf{\xihei:n \l_@@_value_title_tl}\par
+ \vspace{0.5em plus 1fill}
- \vspace{3mm}
+ \group_begin:
+ % 中文标题
+ \tl_set:Nn \l_tmpa_tl {
+ \linespread{1.46}\selectfont
+ \zihao{2}\textbf{\xihei:n \l_@@_value_title_tl}\par
+ }
+ % 英文标题
+ \tl_set:Nn \l_tmpb_tl {
+ \linespread{1.65}\selectfont
+ \zihao{3}\textbf{\l_@@_value_title_en_tl}\par
+ }
- \begin{spacing}{1.2}
- \zihao{3}\selectfont{\textbf{\l_@@_value_title_en_tl}}\par
- \end{spacing}
+ \bool_if:NTF \l_@@_cover_reverse_titles_bool {
+ \l_tmpb_tl \vspace{3mm} \l_tmpa_tl
+ } {
+ \l_tmpa_tl \vspace{3mm} \l_tmpb_tl
+ }
+ \group_end:
- \vspace{15mm}
+ \vspace{0em plus 1fill}
\begin{spacing}{1.8}
\begin{center}
- \tl_if_empty:NT \l_@@_cover_dilimiter_tl {
- \tl_set:Nn \l_@@_cover_dilimiter_tl {:}
+ \tl_if_empty:NT \l_@@_cover_delimiter_tl {
+ \tl_set:Nn \l_@@_cover_delimiter_tl {:}
}
% if not auto width, try override width
\bool_if:NF \l_@@_cover_auto_width_bool {
\dim_compare:nNnT {\l_@@_cover_label_max_width_dim} = {0pt} {
\dim_set:Nn \l_@@_cover_label_max_width_dim {35mm}
- }
+ }
\dim_compare:nNnT {\l_@@_cover_value_max_width_dim} = {0pt} {
\dim_set:Nn \l_@@_cover_value_max_width_dim {78mm}
- }
+ }
}
\clist_set:Nn \l_@@_input_clist {
@@ -2341,14 +2396,16 @@
\zihao{3}
\@@_render_cover_entry:n \l_@@_input_clist
-
+
\end{center}
\end{spacing}
- \vspace*{\fill}
+ \vspace*{1.5em plus 1.5fill}
\centering
\zihao{3}\ziju{0.5}\songti{
\tl_if_empty:NTF \l_@@_cover_date_tl {
+ % 英文模板中 ctex 不会预设日期格式,但仍要保证中文封面的日期按中文习惯
+ \ctexset{today=small}
\today
} {
\l_@@_cover_date_tl
@@ -2375,8 +2432,8 @@
{
\begin{spacing}{1.8}
-
- \tl_set:Nn \l_@@_cover_dilimiter_tl {\textbf{:}}
+
+ \tl_set:Nn \l_@@_cover_delimiter_tl {\textbf{:}}
\bool_set_false:N \l_@@_cover_auto_width_bool
\dim_set:Nn \l_@@_cover_label_max_width_dim {35mm}
\dim_set:Nn \l_@@_cover_value_max_width_dim {115mm}
@@ -2408,8 +2465,8 @@
\vspace{\stretch{0.67}}
\begin{spacing}{1.8}
- \tl_if_empty:NT \l_@@_cover_dilimiter_tl {
- \tl_set:Nn \l_@@_cover_dilimiter_tl {:}
+ \tl_if_empty:NT \l_@@_cover_delimiter_tl {
+ \tl_set:Nn \l_@@_cover_delimiter_tl {:}
}
% 如果不是自动计算宽度,且用户没有自定义宽度,
@@ -2417,10 +2474,10 @@
\bool_if:NF \l_@@_cover_auto_width_bool {
\dim_compare:nNnT {\l_@@_cover_label_max_width_dim} = {0pt} {
\dim_set:Nn \l_@@_cover_label_max_width_dim {35mm}
- }
+ }
\dim_compare:nNnT {\l_@@_cover_value_max_width_dim} = {0pt} {
\dim_set:Nn \l_@@_cover_value_max_width_dim {78mm}
- }
+ }
}
\zihao{3}
@@ -2437,7 +2494,7 @@
}
\@@_render_cover_entry:n \l_@@_input_clist
-
+
\end{spacing}
\vspace{\stretch{0.67}}
@@ -2459,6 +2516,11 @@
\vspace{18mm}
+ \bool_if:NT \l_@@_cover_add_titlezh_bool {
+ \zihao{2}\textbf{\xihei:n \l_@@_value_title_tl}\par
+ \vspace{16mm}
+ }
+
\zihao{2}\textbf{\xihei:n \l_@@_value_title_en_tl}\par
\vspace{10mm}
@@ -2466,25 +2528,25 @@
\begin{spacing}{1.8}
\begin{center}
- \tl_if_empty:NT \l_@@_cover_dilimiter_tl {
- \tl_set:Nn \l_@@_cover_dilimiter_tl {:}
+ \tl_if_empty:NT \l_@@_cover_delimiter_tl {
+ \tl_set:Nn \l_@@_cover_delimiter_tl {:}
}
% if not auto width, try override width
\bool_if:NF \l_@@_cover_auto_width_bool {
\dim_compare:nNnT {\l_@@_cover_label_max_width_dim} = {0pt} {
\dim_set:Nn \l_@@_cover_label_max_width_dim {20mm}
- }
+ }
\dim_compare:nNnT {\l_@@_cover_value_max_width_dim} = {0pt} {
\dim_set:Nn \l_@@_cover_value_max_width_dim {105mm}
- }
+ }
}
\zihao{4}
\clist_set:Nn \l_@@_input_clist {
{\c_@@_label_school_en_tl} {\l_@@_value_school_tl},
- {\c_@@_label_major_en_tl} {\l_@@_value_major_tl},
+ {\g_@@_const_info_major_tl} {\l_@@_value_major_tl},
{\c_@@_label_author_en_tl} {\l_@@_value_author_tl},
{\c_@@_label_student_id_en_tl} {\l_@@_value_student_id_tl},
{\c_@@_label_supervisor_en_tl} {\l_@@_value_supervisor_tl},
@@ -2524,13 +2586,13 @@
% \begin{macro}{\MakeOriginality}
% 原创性声明。
% \begin{macrocode}
-\NewDocumentCommand \MakeOriginality {}
+\NewDocumentCommand \MakeOriginality {}
{
\group_begin:
\begin{blindPeerReview}[\l_@@_cover_hide_cover_in_peer_review_bool]
\int_case:nn {\g_@@_thesis_type_int}
{
- {1}
+ {1}
{
\currentpdfbookmark{声明}{frontmatter:originality}
\pagestyle{BIThesis}
@@ -2580,7 +2642,10 @@
\newpage
}
{3} {
- \linespread{1.26}\selectfont
+ \currentpdfbookmark{Statements}{frontmatter:originality}
+ \pagestyle{BIThesis}
+ \pagenumbering{gobble}
+
% 原创性声明部分
\begin{center}
\vspace*{-2bp}
@@ -2591,7 +2656,7 @@
}
\end{center}~\par
- % 本部分字号为小三
+ % 本部分字号为小四
\zihao{-4}
\c_@@_bachelor_english_label_originality_clause_tl
@@ -2599,7 +2664,7 @@
Student~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm]{}}~Date:\par
- \vspace{6mm}
+ \vspace{\stretch{1}}
% 使用授权声明部分
\begin{center}
@@ -2679,12 +2744,6 @@
\renewcommand{\baselinestretch}{1.56}
}
- \@@_if_thesis_english:TF {
- \tl_set:Nn \l_@@_toc_title_tl {\c_@@_label_toc_en_tl}
- } {
- \tl_set:Nn \l_@@_toc_title_tl {\c_@@_label_toc_tl}
- }
-
% 自定义目录样式
\cs_set:Npn \contentsname {
\fontsize{16pt}{\baselineskip}
@@ -2694,19 +2753,19 @@
\vspace{-8pt}
}
- % 添加目录书签
- \__bithesis_if_thesis_int_type:nF {3} {
- \currentpdfbookmark{\c__bithesis_label_toc_tl}{ch:toc}
+ \bool_if:NTF \l_@@_add_toc_to_toc_bool {
+ % 添加「目录」本身到目录中,同时自动添加书签
+ % 此处必须有`\phantomsection`,不然 hyperref 会把链接指向之前摘要的标题。
+ \phantomsection
+ \addcontentsline{toc}{chapter}{\c_@@_label_toc_en_tl}
+ } {
+ % 手动添加目录书签
+ \currentpdfbookmark{\l_@@_toc_title_tl}{ch:toc}
}
% 制作目录
\tableofcontents
- % 在本科生全英文模板中,添加「目录」本身到目录中。
- \__bithesis_if_thesis_int_type:nT {3} {
- \addcontentsline{toc}{chapter}{\c__bithesis_label_toc_en_tl}
- }
-
% 单独成页
\clearpage
}
@@ -2744,16 +2803,8 @@
}
\@@_if_bachelor_thesis:T {
- \int_compare:nNnTF {\g_@@_thesis_type_int} = {3}
- {
- \ctexset{
- chapter/titleformat = {\heiti}
- }
- }
- {
- \ctexset{
- chapter/titleformat = {\textmd}
- }
+ \ctexset{
+ chapter/titleformat = {\textmd}
}
}
@@ -2798,39 +2849,25 @@
\centering
\vspace*{-2bp}
- \@@_if_thesis_int_type:nTF {3} {
- \arialfamily\zihao{-2}\textbf
- \l_@@_value_title_en_tl\\
- } {
- \heiti\zihao{3}\textbf
+ \l_@@_title_font_cs:n {
+ \zihao{3}\textbf
\l_@@_value_title_en_tl\\
}
\end{spacing}
\vspace*{10mm}
}
-
+
\ctexset{
chapter/numbering = false,
}
\@@_if_bachelor_thesis:TF {
- \int_compare:nNnTF {\g_@@_thesis_type_int} = {3}
- {
- \ctexset{
- chapter = {
- titleformat = {\heiti\zihao{3}\centering\textbf},
- }
- }
- } {
- \ctexset{
- chapter = {
- titleformat = {\heiti\zihao{-3}\centering\textmd},
- }
- }
+ \ctexset{
+ chapter/titleformat = {\zihao{-3}\textmd}
}
} {
\ctexset {
- chapter/titleformat = {\heiti\zihao{3}\centering\textbf}
+ chapter/titleformat = {\heiti\zihao{3}\centering\textbf}
}
}
@@ -2945,13 +2982,13 @@
}
\bool_if:NTF \l_@@_appendices_chapter_level_bool {
- % 附录章节级别
-
+ % 使用以「chapter」为顶层的附录格式
+
% 仅设置 \setcounter{chapter}{0} 时,pdf 目录会索引到正文章节。
% 因此,需要使用 \appendix 重置计数器,并将附录后面的
% 几个章节视为特殊的附录页。
\appendix
-
+
\ctexset{
chapter/numbering = true,
chapter/name = {},
@@ -2964,7 +3001,7 @@
\Alph{chapter}
}
} {
- % 附录节(section)级别
+ % 使用以「section」为顶层的附录格式
% 因为不需要用到 chapter counter, 所以直接加一即可。
\stepcounter{chapter}
@@ -3021,11 +3058,7 @@
subsubsection/number = \arabic{section}. \arabic{subsection}. \arabic{subsubsection},
}
- \@@_if_thesis_english:TF {
- \chapter{\c_@@_label_ack_en_tl}
- } {
- \chapter{\c_@@_label_ack_tl}
- }
+ \chapter{\g_@@_const_heading_acknowledgements_tl}
\@@_if_graduate:TF {\fangsong}{}
#1
\end{blindPeerReview}
@@ -3323,7 +3356,7 @@
% \subsubsection{全局变量与临时变量}
%
% \begin{variable}{\g_@@_thesis_type_int}
-% 论文类型,取值从 1 开始,分别对应:
+% 论文类型,取值从 1 开始,分别对应:
% \begin{enumerate}
% \item 课程实验报告
% \item (计算机学院)本科生毕业(设计)开题报告(已废弃)
@@ -3332,7 +3365,7 @@
\int_new:N \g_@@_report_type_int
% \end{macrocode}
% \end{variable}
-%
+%
% \begin{variable}{\c_@@_report_type_clist}
% 定义报告类型的列表。
% \begin{macrocode}
@@ -3340,7 +3373,7 @@
{ common, undergraduate_proposal}
% \end{macrocode}
% \end{variable}
-%
+%
% \begin{variable}{\l_@@_right_seq,\l_@@_left_seq}
% 临时变量。
% \begin{macrocode}
@@ -3348,12 +3381,12 @@
\seq_new:N \l_@@_left_seq
% \end{macrocode}
% \end{variable}
-%
+%
% 手动开启伪粗体、伪斜体。
% \begin{macrocode}
\PassOptionsToPackage{AutoFakeBold,AutoFakeSlant}{xeCJK}
% \end{macrocode}
-%
+%
% \subsubsection{l3keys 接口键值对定义}
%
% 定义 |bitreport| 模板类的键值对。
@@ -3366,7 +3399,7 @@
misc .meta:nn = { bitreport / misc } {#1}
}
% \end{macrocode}
-%
+%
% 定义 |bitreport/option| 模板类的键值对。
% \begin{macrocode}
\keys_define:nn { bitreport / option }
@@ -3375,14 +3408,14 @@
type .value_required:n = true,
type .choices:Vn =
\c_@@_report_type_clist
- {
- \int_set_eq:NN \g_@@_report_type_int \l_keys_choice_int
+ {
+ \int_set_eq:NN \g_@@_report_type_int \l_keys_choice_int
},
type .initial:n = common,
ctex .tl_set:N = \l_@@_options_to_ctex_tl,
}
% \end{macrocode}
-%
+%
% 定义 |bitreport/cover| 模板类的键值对。
% \begin{macrocode}
\keys_define:nn { bitreport / cover }
@@ -3390,7 +3423,7 @@
imagePath .tl_set:N = \l_bit_coverimagepath_tl,
date .tl_set:N = \l_@@_cover_date_tl,
%% cover entry
- dilimiter .tl_set:N = \l_@@_cover_dilimiter_tl,
+ delimiter .tl_set:N = \l_@@_cover_delimiter_tl,
labelAlign .tl_set:N = \l_@@_cover_label_align_tl,
labelAlign .initial:n = {r},
valueAlign .tl_set:N = \l_@@_cover_value_align_tl,
@@ -3407,7 +3440,7 @@
underlineOffset .initial:n = { -10pt },
}
% \end{macrocode}
-%
+%
% 定义 |bitreport/info| 模板类的键值对。
% \begin{macrocode}
\keys_define:nn { bitreport / info }
@@ -3422,7 +3455,7 @@
studentId .tl_set:N = \l_@@_value_student_id_tl,
}
% \end{macrocode}
-%
+%
% 定义 |bitreport/misc| 模板类的键值对。
% \begin{macrocode}
\keys_define:nn { bitreport / misc }
@@ -3430,20 +3463,20 @@
reviewTable .tl_set:N = \l_bit_reviewtable_tl,
}
% \end{macrocode}
-%
+%
% 将 |bithesis/option/ctex| 中的值传递给 ctexbook 模板类。
% \begin{macrocode}
\DeclareOption*{
\PassOptionsToClass{\l_@@_options_to_ctex_tl}{ctexart}
}
% \end{macrocode}
-%
+%
% 加载 ctexbook 模板类。
% \begin{macrocode}
\ProcessOptions\relax
\LoadClass[zihao=-4]{ctexart}
% \end{macrocode}
-%
+%
% \subsubsection{定义模板类样式}
% 加载所需的宏包。
% \begin{macrocode}
@@ -3454,13 +3487,13 @@
\RequirePackage{booktabs}
\RequirePackage{pdfpages}
% \end{macrocode}
-%
-% 在宏加载时,处理 |bitreport/option| 中的值。使得 |bitreport|
+%
+% 在宏加载时,处理 |bitreport/option| 中的值。使得 |bitreport|
% 宏包的模板选项可以在宏加载时生效。
% \begin{macrocode}
\ProcessKeysOptions { bitreport / option }
% \end{macrocode}
-%
+%
% \subsubsection{辅助函数与常量}
%
% \begin{macro}{\tl_if_empty:xTF,\seq_set_split:Nnx}
@@ -3470,10 +3503,10 @@
\cs_generate_variant:Nn \seq_set_split:Nnn {Nnx}
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\@@_dunderline:nnn}
% 用于渲染下划线。
-%
+%
% 参数如下:
% \begin{itemize}
% \item \#1 位置,可选值为 \texttt{c}enter、\texttt{l}eft、\texttt{r}ight。
@@ -3486,7 +3519,7 @@
}
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{|@@_render_cover_entry:nn}
% 用于渲染封面的辅助函数。
%
@@ -3501,7 +3534,7 @@
% \begin{macrocode}
\cs_new:Npn \@@_render_cover_entry:nn #1#2 {
\makebox[\l_@@_cover_label_max_width_dim][\l_@@_cover_label_align_tl]{
- \tl_if_blank:VTF #1 {} {#1\l_@@_cover_dilimiter_tl}
+ \tl_if_blank:VTF #1 {} {#1\l_@@_cover_delimiter_tl}
}
\hspace{1ex}
\@@_dunderline:nnn{\l_@@_cover_underline_offset_dim}{\l_@@_cover_underline_thickness_dim}{
@@ -3510,7 +3543,7 @@
}
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{|@@_get_text_width:Nn,\@@_get_text_width:NV}
% 计算 \#2 所占用的宽度,将结果存储在 \#1 中。
%
@@ -3529,7 +3562,7 @@
\cs_generate_variant:Nn \@@_get_text_width:Nn { NV }
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\@@_get_max_text_width:NN}
% 从 \#2 中获取最大的文本宽度,然后设置到 \#1 中。
%
@@ -3556,7 +3589,7 @@
}
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\@@_parse_entry}
% 解析封面信息条目。
%
@@ -3579,7 +3612,7 @@
}
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\@@_render_cover_entry}
% 渲染封面信息项。此函数为主函数。
% \begin{macrocode}
@@ -3596,7 +3629,7 @@
% 比如 {label_1} {value \\ 1} 会被转换成
% { {label_1} {value}, {} {1} }
\@@_parse_entry ##1
- % 然后将这些 label - value 对添加到 \l_@@_right_seq
+ % 然后将这些 label - value 对添加到 \l_@@_right_seq
% 或者 \l_@@_left_sql 中。
% left 就是 label,right 就是 value。
\seq_concat:NNN \l_@@_right_seq \l_@@_right_seq \l_@@_tmp_right_seq
@@ -3608,7 +3641,7 @@
\@@_get_max_text_width:NN \l_@@_cover_label_max_width_dim \l_@@_left_seq
\@@_get_max_text_width:NN \l_@@_cover_value_max_width_dim \l_@@_right_seq
}
-
+
% 最后,根据宽度渲染 label 和 value 对。
\group_begin:
@@ -3626,7 +3659,7 @@
% \end{macro}
%
% \subsubsection{定义用户接口}
-%
+%
% \begin{macro}{\BITSetup}
% 提供用户配置的接口。
% \begin{macrocode}
@@ -3736,7 +3769,7 @@
% \begin{macro}{\MakeReviewTable}
% 渲染评阅表。
% \begin{macrocode}
-\DeclareDocumentCommand \MakeReviewTable {}
+\DeclareDocumentCommand \MakeReviewTable {}
{
\group_begin:
\begin{titlepage}
@@ -3751,35 +3784,35 @@
% \begin{macrocode}
\DeclareCaptionFont{kaiticaption}{\kaishu \normalsize}
% \end{macrocode}
-%
+%
% 设置图片的 caption 格式
% \begin{macrocode}
\renewcommand{\thefigure}{\thesection-\arabic{figure}}
\captionsetup[figure]{font=small,labelsep=space,skip=10bp,labelfont=bf,font=kaiticaption}
% \end{macrocode}
-%
+%
% 设置表格的 caption 格式
% \begin{macrocode}
\renewcommand{\thetable}{\thesection-\arabic{table}}
\captionsetup[table]{font=small,labelsep=space,skip=10bp,labelfont=bf,font=kaiticaption}
% \end{macrocode}
-%
+%
% 输出大写数字日期
% \begin{macrocode}
\ctexset{today=big}
% \end{macrocode}
-%
+%
% 将西文字体设置为 Times New Roman
% \begin{macrocode}
\setromanfont{Times~New~Roman}
% \end{macrocode}
-%
+%
% 设置文档标题深度
% \begin{macrocode}
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}
% \end{macrocode}
-%
+%
% 设置一级标题、二级标题格式。
% \begin{macrocode}
% 一级标题:小三,宋体,加粗,段前段后各半行。
@@ -3804,7 +3837,7 @@
}
}
% \end{macrocode}
-%
+%
% 页眉和页脚(页码)的格式设定。
% \begin{macrocode}
\fancyhf{}
@@ -3826,13 +3859,13 @@
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{0pt}
% \end{macrocode}
-%
+%
% 正文开始
% \begin{macrocode}
\pagestyle{fancy}
\setcounter{page}{1}
% \end{macrocode}
-%
+%
% \begin{macrocode}
% 正文 22 磅的行距,段前段后间距为 0
% \setlength{\parskip}{0em}
@@ -3861,27 +3894,27 @@
framelogo .tl_set:N = \l_bit_framelogo_tl,
}
% \end{macrocode}
-%
-% 在宏加载时,处理 |bitbeamer| 中的值。使得 |bitbeamer|
+%
+% 在宏加载时,处理 |bitbeamer| 中的值。使得 |bitbeamer|
% 宏包的模板选项可以在宏加载时生效。
% \begin{macrocode}
\ProcessKeysOptions { bitbeamer }
% \end{macrocode}
-%
+%
% Pass every option not explicitly defined to `ctexbeamer`.
% \begin{macrocode}
\DeclareOption*{
\PassOptionsToClass{\CurrentOption}{ctexbeamer}
}
% \end{macrocode}
-%
+%
% Executes the code for each option.
% Load.
% \begin{macrocode}
\ProcessOptions\relax
\LoadClass{ctexbeamer}
% \end{macrocode}
-%
+%
% \subsubsection{定义模板类样式}
%
% 加载所需的宏包。
@@ -3898,7 +3931,7 @@
\definecolor{bitdarkgreen}{HTML}{005B30}
\colorlet{beamer@blendedblue}{bitdarkgreen}
% \end{macrocode}
-%
+%
%
% \begin{macro}{\CJKhl:nn}
% 高亮中文字符。
@@ -3907,8 +3940,8 @@
{ \CJKsout*[thickness=2.5ex, format=\color{#1}]{#2} }
% \end{macrocode}
% \end{macro}
-%
-% Set header if logo path is provided.
+%
+% Set header if logo path is provided.
% \begin{macrocode}
\tl_if_empty:NF \l_bit_titlegraphic_tl {
% BIT Logo
@@ -3917,19 +3950,19 @@
}
}
% \end{macrocode}
-%
+%
% Set title logo if logo path is provided.
% \begin{macrocode}
\tl_if_empty:NF \l_bit_framelogo_tl {
\addtobeamertemplate{frametitle}{}{%
\begin{tikzpicture}[remember~picture,overlay]
- \node[anchor=north~east,yshift=2pt] at (current~page.north~east)
+ \node[anchor=north~east,yshift=2pt] at (current~page.north~east)
{\includegraphics[height=0.8cm]{\tl_use:N \l_bit_framelogo_tl}};
\end{tikzpicture}
}
}
% \end{macrocode}
-%
+%
% \subsubsection{定义用户接口}
%
% \begin{macrocode}
@@ -4274,4 +4307,3 @@
% TeX-master: t
% End:
% \fi
-
diff --git a/Master/texmf-dist/source/latex/bookcover/bookcover.dtx b/Master/texmf-dist/source/latex/bookcover/bookcover.dtx
index c33d32f1cd7..8c1bf103df7 100644
--- a/Master/texmf-dist/source/latex/bookcover/bookcover.dtx
+++ b/Master/texmf-dist/source/latex/bookcover/bookcover.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2015-2024 by Tibor Tomacs
+% Copyright (C) 2015-2024 by Tibor Tómács
%
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.2
@@ -17,86 +17,87 @@
% \iffalse
%<*driver>
\ProvidesFile{bookcover.dtx}
-\newcommand{\eifiledate}{2024/04/06}
-\newcommand{\eifilever}{v3.6}
+\newcommand{\eifiledate}{2024/10/04}
+\newcommand{\eifilever}{v3.7}
%</driver>
%<class>
%<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-%<class>\ProvidesClass{bookcover}[2024/04/06 v3.6 class for book covers and dust jackets]
+%<class>\ProvidesClass{bookcover}[2024/10/04 v3.7 class for book covers and dust jackets]
%
%<*driver>
\documentclass{ltxdoc}
\OnlyDescription
\usepackage[T1]{fontenc}
\AddToHook{begindocument/before}[doc/hyperref]{\hypersetup{pdfstartview=FitH,bookmarksnumbered,colorlinks,allcolors=teal}}
-\usepackage[paperwidth=210mm,paperheight=295mm,textwidth=160mm,top=25mm,bottom=25mm,outer=25mm]{geometry}
+\usepackage[a4paper,margin=1in]{geometry}
\usepackage[english]{babel}
-\usepackage{graphicx,listings,calc,multirow,array,paralist,eso-pic,tikz}
+\usepackage{graphicx,listings,paralist,eso-pic,tikz,calc,lmodern}
\colorlet{command}{blue!80!black}
\colorlet{param}{green!50!black}
+\colorlet{example}{teal}
+\colorlet{bgexample}{black!10}
\lstnewenvironment{examplelst}{\lstset{
gobble=2,
- aboveskip=1.4pt,
basicstyle=\small\ttfamily,
- backgroundcolor=\color{black!10},
+ backgroundcolor=\color{bgexample},
columns=fullflexible,
- comment=[l][\ttfamily\color{purple}]{\%},
- frame=trbl,
+ comment=[l][\ttfamily\color{teal}]{\%},
+ frame=single,
framesep=3pt,
- xleftmargin=3.4pt,
- xrightmargin=3.4pt,
+ framerule=1pt,
+ rulecolor=\color{example},
+ xleftmargin=4pt,
+ xrightmargin=4pt,
keepspaces}}{}
\lstnewenvironment{commandlst}{\lstset{
literate={<}{{$\langle$}}1{>}{{$\rangle$}}1,
delim=[is][\color{param}\normalfont\itshape\small]{!}{!},
gobble=2,
- belowskip=-4pt,
- aboveskip=4pt,
basicstyle=\color{command}\ttfamily,
- backgroundcolor=\color{white},
columns=fullflexible,
- frame=trbl,
- frameround=tttt,
+ frame=single,
framesep=3pt,
- xleftmargin=3.4pt,
- xrightmargin=3.4pt,
+ framerule=1pt,
+ rulecolor=\color{command!80!black},
+ xleftmargin=4pt,
+ xrightmargin=4pt,
keepspaces}}{}
\lstdefinestyle{examplefile}{
- literate={ü}{{\"u}}1{ó}{{\'o}}1{é}{{\'e}}1{á}{{\'a}}1{Á}{{\'A}}1,
basicstyle=\small\ttfamily,
- backgroundcolor=\color{black!10},
+ backgroundcolor=\color{bgexample},
columns=fullflexible,
keepspaces,
- frame=trbl,
+ frame=single,
framesep=3pt,
- xleftmargin=3.4pt,
- xrightmargin=3.4pt,
- comment=[l][\ttfamily\color{purple}]{\%}}
+ framerule=1pt,
+ rulecolor=\color{example},
+ xleftmargin=4pt,
+ xrightmargin=4pt,
+ comment=[l][\ttfamily\color{teal}]{\%}}
-\newcommand{\commandinline}{\lstinline[
+\newcommand*{\commandinline}{\lstinline[
literate={<}{{$\langle$}}1{>}{{$\rangle$}}1,
delim={[is][\color{param}\normalfont\itshape\small]{!}{!}},
basicstyle=\color{command}\ttfamily,
columns=fullflexible,
keepspaces]}
-\def\meta#1{{\color{param}\normalfont\itshape\small$\langle$#1$\rangle$}}
+\renewcommand*{\meta}[1]{{\color{param}\normalfont\itshape\small$\langle$#1$\rangle$}}
-\def\example{{\setlength{\fboxsep}{3pt}\colorbox{command}{\footnotesize\sffamily\bfseries\color{white}EXAMPLE}}}
+\newcommand*{\example}{\par\medskip\hspace*{-2em}{\usefont{T1}{ugq}{b}{n}\color{example}EXAMPLE}}
-\def\BookCover{{\def\sfdefault{ugq}\sffamily\bfseries
+\newcommand*{\BookCover}{{\usefont{T1}{ugq}{b}{n}
\color{black!90}\mbox{}\lower.15ex\hbox{[B}ook%
\color{red!70!black}\lower.15ex\hbox{C}over\lower.15ex\hbox{]}}}
\def\bookcoversizename#1(#2,#3)#4{\texttt{\color{command}#1} ($#2\times#3$\,#4)}
\setlength{\parindent}{0pt}
-\setlength{\parskip}{8pt}
-\renewcommand{\descriptionlabel}[1]{\hspace{0mm}}
+\renewcommand*{\descriptionlabel}[1]{\hspace{0pt}}
\setlength{\fboxsep}{0pt}
\newcounter{partfig}
@@ -128,43 +129,60 @@
% \textsf{Class for book covers and dust jackets}\\[2mm]
% {\large\texttt{bookcover.cls}\\
% \eifilever\ (\eifiledate)}}
-% \author{Tibor T\'{o}m\'{a}cs\\{\normalsize\href{mailto:tomacs.tibor@gmail.com}{\texttt{tomacs.tibor@gmail.com}}}}
+% \author{Tibor Tómács\\{\normalsize\href{mailto:tomacs.tibor@gmail.com}{\texttt{tomacs.tibor@gmail.com}}}}
% \date{}
% \maketitle
%
-% \AddToShipoutPictureBG*{\tikz[overlay]\fill[top color=black!50, bottom color=white] (current page.north west) rectangle +(\paperwidth,-11cm);}
+% \AddToShipoutPictureBG*{\tikz[overlay]\fill[top color=black!50, bottom color=white, middle color=white] (current page.north west) rectangle (current page.south east);}
%
% \section{Introduction}
%
-% The \texttt{bookcover} document class can be used to create dust jackets and book covers of hardcover and paperback books.
+% The \texttt{bookcover} document class can be used to create dust jackets and book covers for hardcover and paperback books.
%
% \paragraph{Dust jacket.}
%
-% In the following picture you can see a typical dust jacket of a hardcover book, which is a detachable outer book cover. Its parts are back flap, back cover, spine, front cover and front flap.
+% The following image shows a typical dust jacket of a hardcover book, which is a detachable outer cover of the book.
+% Its parts are the back flap, the back cover, the spine, the front cover and the front flap.
% \begin{center}
% \includegraphics{figures/bookcover-dustjacket}
% \end{center}
-% When you prepare a dust jacket for printing, some marks are needed to know where to trim or fold the cover. The crop marks determine a special area of the sheet, which is called ``bleed'' (see the gray area in the next figure). The bleed will be trimmed off. The background will be expanded onto the bleed, taking account of slight inaccuracy when trimming. If there is no bleed, the likelihood of having a white strip on the edge of the finished product is high. In the next schematics figure, the red lines are the marks. The marks closest to the corners are the crop marks, and the other ones are the fold marks.
+% When preparing a dust jacket for printing, some marks are needed to know where to trim or fold the cover.
+% The crop marks define a special area of the sheet called the ``bleed'' (see the gray area in the next figure).
+% The bleed will be trimmed off.
+% The background will be extended to the bleed, taking into account the slight inaccuracy of the trim.
+% If there is no bleed, there is a high probability that there will be a white stripe around the edge of the finished product.
+% In the next schematics figure, the red lines are the marks.
+% The marks closest to the corners are the crop marks and the others are the fold marks.
% \begin{center}
% \includegraphics{figures/bookcover-scheme-withflaps}
% \end{center}
-% The back/front ``wraps'' (see the black area in the previous figure) are the areas between the front cover and front flap, and back cover and back flap. The reason this is defined is that if the front and back covers have background colors or images that continue to the foreedge of each cover, they must continue onto the flap. Because putting the edge of color right at the edge of the board would result in an unsightly boundary line when the book is closed.
+% If the book cover is detachable, it is advisable to leave folding areas (called ``wraps'') between the front cover and the front flap, and between the back cover and the back flap (see the black bars in the previous figure).
+% This is important if the book board is thick, because when the book is folded, this area will be visible on the edges of the book board.
+% In this case, the background color or image should not stop at the outer edge of the front or back cover.
+% It should be extended to the wraps, as on the bleed, otherwise, due to minor cutting and folding inaccuracies, a stripe may appear on the cover that is not necessarily parallel to the edges, which would give an aesthetically unacceptable result when the book is folded.
%
% \paragraph{Book cover for paperback book.}
%
-% A book cover of a paperback book is glued to the spine of the book and usually has no flaps. The function of the bleed here is the same as before. The crop marks are closest to the corners, and the other ones are the fold marks.
+% The cover of a paperback book is glued to the spine of the book and usually has no flaps.
+% The function of the bleed here is the same as before.
+% The crop marks are closest to the corners, and the others are the fold marks.
% \begin{center}
% \includegraphics{figures/bookcover-scheme-withoutflaps}
% \end{center}
-% Rarely, a book cover of a paperback book may have flaps. In this case, its scheme is similar to a dust jacket.
+% Rarely, the cover of a paperback book may have flaps.
+% In this case, the scheme is similar to that of a dust jacket.
%
% \paragraph{Book cover for hardcover book.}
%
-% The outside of the cover of a hardcover book is glued to the boards of the book. Of course, this never has flaps.
+% The outside of the cover of a hardcover book is glued to the boards of the book.
+% This, of course, never has flaps.
% \begin{center}
% \includegraphics{figures/bookcover-scheme-foldingmargin}
% \end{center}
-% In this case, the function of the bleed is not to eliminate cutting inaccuracies. It will not be trimmed off, but it will be a margin which is folded back and glued onto the inside of the book boards. This way, it will cover all the edges of the boards. The crop marks are closest to the corners, and the other ones are the fold marks.
+% In this case, the function of the bleed is not to eliminate cutting inaccuracies.
+% It is not trimmed, but is a margin that is folded back and glued to the inside of the book boards.
+% In this way it will cover all the edges of the boards.
+% The crop marks are closest to the corners, and the others are the fold marks.
%
% \section{Loading class and options}\label{sec:class}
%
@@ -175,8 +193,11 @@
%
% \medskip The list of \meta{options}:
%
+% \medskip
% \begin{compactdesc}
-% \item[]\commandinline|cover=!<size-name>!| It specifies the front/back cover width and height (without bleed) by name (default \texttt{cover=default}). Allowed \meta{size-names} (width${}\times{}$height):
+% \item \commandinline|cover=!<size-name>!|
+% It specifies the front/back cover width and height (without bleed) by name (default \texttt{cover=default}).
+% Allowed \meta{size-names} (width${}\times{}$height):
% \bookcoversizename{default}(170,240){mm}
% \bookcoversizename{a0}(841,1189){mm}
% \bookcoversizename{a1}(594,841){mm}
@@ -214,30 +235,51 @@
% \bookcoversizename{letter}(8.5,11){in}
% \bookcoversizename{legal}(8.5,14){in}
% \bookcoversizename{executive}(7.25,10.5){in}
-% \item[]\commandinline|coverheight=!<length>!| Cover height without bleed. It overrides the height specified by the \texttt{cover} option.
-% \item[]\commandinline|coverwidth=!<length>!| Front/back cover width. It overrides the width specified by the \texttt{cover} option.
-% \item[]\commandinline|spinewidth=!<length>!| Spine width (default \texttt{spinewidth=5mm}).
-% \item[]\commandinline|flapwidth=!<length>!| Flap width (default \texttt{flapwidth=0mm}).
-% \item[]\commandinline|wrapwidth=!<length>!| Wrap width (default \texttt{wrapwidth=0mm}). It has no effect with \texttt{flapwidth=0mm} option.
-% \item[]\commandinline|bleedwidth=!<length>!| Bleed width (default \texttt{bleedwidth=5mm}).
-% \item[]\commandinline|marklength=!<length>!| Mark length (default \texttt{marklength=10mm}).
-% \item[]\commandinline|foldingmargin| or \commandinline|foldingmargin=true| The bleed will not a trimmed area but a folding margin. The crop marks will be placed at the corners of the bleed and the options \texttt{flapwidth} and \texttt{wrapwidth} will be ineffective, meaning there will be no flaps.
-% \item[]\commandinline|foldingmargin=false| (Default.)
-% \item[]\commandinline|10pt| (Default.) Normal font size is 10\,pt.
-% \item[]\commandinline|11pt| Normal font size is 11\,pt.
-% \item[]\commandinline|12pt| Normal font size is 12\,pt.
-% \item[]\commandinline|markthick=!<length>!| Thickness of marks (default \texttt{markthick=0.4pt}).
-% \item[]\commandinline|markcolor=!<color name>!| Color of marks (default \texttt{markcolor=red}).
-% \item[]\commandinline|pagecolor=!<color name>!| Color of page (default \texttt{pagecolor=white}).
-% \item[]\commandinline|trimmed| or \commandinline|trimmed=true| Trimmed version for demonstration.
-% \item[]\commandinline|trimmed=false| (Default.) No trimming. Use this for printing!
-% \item[]\commandinline|trimmingcolor=!<color name>!| Color of trimming (default \texttt{trimmingcolor=white}).
+% \item \commandinline|coverheight=!<length>!|
+% Cover height without bleed.
+% It overrides the height specified by the \texttt{cover} option.
+% \item \commandinline|coverwidth=!<length>!|
+% Front/back cover width.
+% It overrides the width specified by the \texttt{cover} option.
+% \item \commandinline|spinewidth=!<length>!|
+% Spine width (default \texttt{spinewidth=5mm}).
+% \item \commandinline|flapwidth=!<length>!|
+% Flap width (default \texttt{flapwidth=0mm}).
+% \item \commandinline|wrapwidth=!<length>!|
+% Wrap width (default \texttt{wrapwidth=0mm}).
+% It has no effect with \texttt{flapwidth=0mm} option.
+% \item \commandinline|bleedwidth=!<length>!|
+% Bleed width (default \texttt{bleedwidth=5mm}).
+% \item \commandinline|marklength=!<length>!|
+% Mark length (default \texttt{marklength=10mm}).
+% \item \commandinline|foldingmargin=!<boolean>!|
+% If the \meta{boolean} is \commandinline|true|, then the bleed will be not a trimmed area but a fold margin.
+% The crop marks will be placed at the corners of the bleed and the options \texttt{flapwidth} and \texttt{wrapwidth} will be ineffective, i.e.~there will be no flaps.
+% (Default \texttt{foldingmargin=false}.)
+% \item \commandinline|10pt|, \commandinline|11pt|, \commandinline|12pt|
+% Normal font size (default \texttt{10pt}).
+% \item \commandinline|markthick=!<length>!|
+% Thickness of marks (default \texttt{markthick=0.4pt}).
+% \item \commandinline|markcolor=!<color name>!|
+% Color of marks (default \texttt{markcolor=red}).
+% \item \commandinline|pagecolor=!<color name>!|
+% Color of page (default \texttt{pagecolor=white}).
+% \item \commandinline|trimmed=!<boolean>!|
+% If the \meta{boolean} is \commandinline|true|, then the result will be the trimmed version for demonstration.
+% (Default \texttt{trimmed=false} for printing.)
+% \item \commandinline|trimmingcolor=!<color name>!|
+% Color of trimming (default \texttt{trimmingcolor=white}).
% \end{compactdesc}
%
-% The \texttt{bookcover.cls} requires the services of the \texttt{article} class and the following packages: \texttt{kvoptions}, \texttt{geometry}, \texttt{graphicx}, \texttt{calc}, \texttt{tikz}, \texttt{xparse}, \texttt{etoolbox}, \texttt{fgruler}.
+% \medskip
+% The \texttt{bookcover.cls} requires the services of the \texttt{article} class and the following packages:
+% \texttt{kvoptions}, \texttt{geometry}, \texttt{graphicx}, \texttt{calc}, \texttt{tikz}, \texttt{xparse}, \texttt{etoolbox}, \texttt{fgruler}.
%
% \section{Commands and environments}
-% Use \commandinline{bookcover} environment in the document body to make a new book cover. If you need to edit both sides of the cover, you can do it with two \texttt{bookcover} environments (see an example in the Subsection~\ref{subsec-two-sided-example}). You can create a component of the book cover by the following command or environment in the \texttt{bookcover} environment:
+%
+% Use the \commandinline{bookcover} environment in the document body to create a new book cover.
+% If you need to edit both sides of the cover, you can do it with two \texttt{bookcover} environments (see an example in the Subsection~\ref{subsec-two-sided-example}).
+% You can create a book cover component by using the following command or environment in the \texttt{bookcover} environment:
% \begin{commandlst}
% \bookcovercomponent{!<component type>!}{!<part>!}[!<left>!,!<bottom>!,!<right>!,!<top>!]{!<content>!}
% \end{commandlst}
@@ -248,28 +290,56 @@
% \end{bookcoverelement}
% \end{commandlst}
%
-% \begin{description}
-% \item[]\meta{component type} It determines the bookcover component type (see the Section~\ref{sec:componenttypes}). Predefined component types: \commandinline{color}, \commandinline{tikz}, \commandinline{tikz clip}, \commandinline{picture}, \commandinline{normal}, \commandinline{center}, \commandinline{ruler}.
-% \item[]\meta{part} This determines where in the book cover the \meta{content} is located. You can read the description of \meta{part} in the Section~\ref{sec:parts}. Some predefined parts: \commandinline{front} (front cover), \commandinline{bg front} (front cover expanded onto the bleed), \commandinline{back} (back cover), \commandinline{bg back} (back cover expanded onto the bleed), \commandinline{whole} (whole book cover), \commandinline{bg whole} (whole book cover expanded onto the bleed), \commandinline{spine}, etc.
-% \item[]\meta{left},\meta{bottom},\meta{right},\meta{top} These are the margins of the \meta{part}. The default value of every margin is \texttt{0mm}. If the \meta{left}, \meta{bottom}, \meta{right} or \meta{top} is empty or space, then its value will be \texttt{0mm}. If the value of a margin is negative, the part size will increase instead of decrease.
-% \item[]\meta{content} This can be text, image, color, etc., which depends on the \meta{component type} (see the Section~\ref{sec:componenttypes}). This will be located in the \meta{part}.
-% \end{description}
+% \begin{compactdesc}
+% \item \meta{component type}
+% It determines the type of the bookcover component (see the Section~\ref{sec:componenttypes}).
+% Predefined component types:
+% \commandinline{color}, \commandinline{tikz}, \commandinline{tikz clip}, \commandinline{picture}, \commandinline{normal}, \commandinline{center}, \commandinline{ruler}.
+% \item \meta{part}
+% This determines where in the book cover the \meta{content} is located.
+% You can read the description of \meta{part} in the Section~\ref{sec:parts}.
+% Some predefined parts:
+% \commandinline{front} (front cover), \commandinline{bg front} (front cover extended to the bleed), \commandinline{back} (back cover), \commandinline{bg back} (back cover extended to the bleed), \commandinline{whole} (whole book cover), \commandinline{bg whole} (whole book cover extended to the bleed), \commandinline{spine}, etc.
+% \item \meta{left},\meta{bottom},\meta{right},\meta{top}
+% These are the margins of the \meta{part}.
+% The default value of every margin is \texttt{0mm}.
+% If the \meta{left}, \meta{bottom}, \meta{right} or \meta{top} is empty or space, then its value will be \texttt{0mm}.
+% If the value of a margin is negative, the part size will increase instead of decreasing.
+% \item \meta{content}
+% This can be text, image, color, etc., which depends on the \meta{component type} (see the Section~\ref{sec:componenttypes}).
+% This will be located in the \meta{part}.
+% \end{compactdesc}
+%
+% \medskip
% You can use the following length commands in the \meta{content} and to specify the margins of the \meta{part}:
%
+% \medskip
% \begin{compactdesc}
-% \item[]\commandinline{\partheight} The height of the \meta{part} (reduced by \meta{bottom} and \meta{top} in \meta{content}).
-% \item[]\commandinline{\partwidth} The width of the \meta{part} (reduced by \meta{left} and \meta{right} in \meta{content}).
-% \item[]\commandinline{\coverheight} Cover height.
-% \item[]\commandinline{\coverwidth} Front/back cover width.
-% \item[]\commandinline{\spinewidth} Spine width.
-% \item[]\commandinline{\flapwidth} Flap width.
-% \item[]\commandinline{\wrapwidth} Wrap width.
-% \item[]\commandinline{\bleedwidth} Bleed width.
-% \item[]\commandinline{\marklength} Mark length.
+% \item \commandinline{\partheight}
+% The height of the \meta{part} (reduced by \meta{bottom} and \meta{top} in \meta{content}).
+% \item \commandinline{\partwidth}
+% The width of the \meta{part} (reduced by \meta{left} and \meta{right} in \meta{content}).
+% \item \commandinline{\coverheight}
+% Cover height.
+% \item \commandinline{\coverwidth}
+% Front/back cover width.
+% \item \commandinline{\spinewidth}
+% Spine width.
+% \item \commandinline{\flapwidth}
+% Flap width.
+% \item \commandinline{\wrapwidth}
+% Wrap width.
+% \item \commandinline{\bleedwidth}
+% Bleed width.
+% \item \commandinline{\marklength}
+% Mark length.
% \end{compactdesc}
%
-% Every |\bookcovercomponent| command and |bookcoverelement| environment generates a layer on the sheet. The first one generates the bottom layer and the last one generates the top layer.
+% \medskip
+% Each |\bookcovercomponent| command and |bookcoverelement| environment creates a layer on the sheet.
+% The first one creates the bottom layer and the last one creates the top layer.
%
+% \medskip
% In the following example we use |\bookcovercomponent| commands.
%
% \example
@@ -279,12 +349,13 @@
% \begin{bookcover}
% \bookcovercomponent{color}{bg whole}{orange}
% \bookcovercomponent{normal}{front}[,,,0.4\partheight]{
-% \centering\bfseries\huge Book title\par}
+% \centering\bfseries\huge Book title}
% \end{bookcover}
% \end{document}
% \end{examplelst}
%
-% In the following example we use |bookcoverelement| environments. This example is equivalent to the previous one.
+% In the following example we use |bookcoverelement| environments.
+% This example is equivalent to the previous one.
%
% \example
% \begin{examplelst}
@@ -295,68 +366,101 @@
% orange
% \end{bookcoverelement}
% \begin{bookcoverelement}{normal}{front}[,,,0.4\partheight]
-% \centering\bfseries\huge Book title\par
+% \centering\bfseries\huge Book title
% \end{bookcoverelement}
% \end{bookcover}
% \end{document}
% \end{examplelst}
%
-% Use \commandinline{bookcoverdescription} environment in the document body for adding the description of the book cover and other information. Don't use it in |bookcover| environment! You can set the page geometry of the description by the following command:
+% Use the \commandinline{bookcoverdescription} environment in the document body to add the description of the book cover and other information.
+% Do not use it in |bookcover| environment!
+% You can set the page geometry of the description by using the following command:
% \begin{commandlst}
% \bookcoverdescgeometry{!<geometry parameteres>!}
% \end{commandlst}
-% The possible \meta{geometry parameteres} are the same as for |\newgeometry| in the |geometry| package. Its default value is |margin=1in|. Unlike |\newgeometry|, it can be used in the preamble as well. See an example in the Subsection~\ref{subsec:desc}.
+% The possible \meta{geometry parameters} are the same as for |\newgeometry| in the |geometry| package.
+% Its default value is |margin=1in|.
+% Unlike |\newgeometry|, it can be used in the preamble as well.
+% See an example in the Subsection~\ref{subsec:desc}.
%
-% If you want to check the set dimensions, use the following command in the |bookcoverdescription| environment:
+% \medskip
+% If you want to check the dimensions, use the following command in the |bookcoverdescription| environment:
% \begin{commandlst}
% \showbookcoverparameters
% \end{commandlst}
%
-% If the value of the \texttt{trimmed} option is \texttt{true}, then you can set the trimmed part by the following command before any \texttt{bookcover} environment:
+% If the value of the \texttt{trimmed} option is \texttt{true}, then you can set the trimmed part by using the following command before any \texttt{bookcover} environment:
% \begin{commandlst}
% \bookcovertrimmedpart{!<trimmed part>!}[!<left>!,!<bottom>!,!<right>!,!<top>!]
% \end{commandlst}
%
-% Without this command, or if the \meta{trimmed part} is empty or space, then its value will be \texttt{whole} (see the Section~\ref{sec:parts}). The \meta{left}, \meta{bottom}, \meta{right} and \meta{top} are the margins of the \meta{trimmed part}. The default value of every margin is \texttt{0mm}. If the \meta{left}, \meta{bottom}, \meta{right} or \meta{top} is empty or space, then its value will be \texttt{0mm}. The trimmed area will be the \meta{trimmed part} reduced by the margins. If the value of a margin is negative, the \meta{trimmed part} size will increase instead of decrease.
+% Without this command, or if the \meta{trimmed part} is empty or space, then its value will be \texttt{whole} (see the Section~\ref{sec:parts}).
+% The \meta{left}, \meta{bottom}, \meta{right} and \meta{top} are the margins of the \meta{trimmed part}.
+% The default value of every margin is \texttt{0mm}.
+% If the \meta{left}, \meta{bottom}, \meta{right} or \meta{top} is empty or space, then its value will be \texttt{0mm}.
+% The trimmed area will be the \meta{trimmed part} reduced by the margins.
+% If the value of a margin is negative, the size of the \meta{trimmed part} size will increase instead of decreasing.
%
-% You can change some options before any \texttt{bookcover} environment by the following command:
+% \medskip
+% You can change some options before each \texttt{bookcover} environment by using the following command:
% \begin{commandlst}
% \setbookcover{!<options>!}
% \end{commandlst}
-% The \meta{options} can be as follows: \commandinline|markthick=!<length>!|, \commandinline|markcolor=!<color name>!|, \commandinline|pagecolor=!<color name>!|, \commandinline|trimmed|, \commandinline|trimmed=false|, \commandinline|trimmingcolor=!<color name>!| (see the Section~\ref{sec:class}). See an example in the Subsection~\ref{subsec:trimming}
+% The \meta{options} can be as follows:
+% \commandinline|markthick=!<length>!|, \commandinline|markcolor=!<color name>!|, \commandinline|pagecolor=!<color name>!|, \commandinline|trimmed|, \commandinline|trimmed=false|, \commandinline|trimmingcolor=!<color name>!| (see the Section~\ref{sec:class}).
+% See an example in the Subsection~\ref{subsec:trimming}.
%
% \section{Book cover parts}\label{sec:parts}
%
-% Each predefined \meta{part} is illustrated in this section.
-%
-% The background parts are expanded onto the bleed, taking account of slight inaccuracy when trimming. In contrast, the foreground parts do not extend onto the bleed. The names of the background parts start with \commandinline{bg}.
-%
-% If your book will also have printing on the inside cover, the layout for the inside cover will be the exact opposite of the outside cover. Therefore, these parts also have synonymous names. The synonymous names contain \commandinline{inside front} instead of \commandinline{back} and \commandinline{inside back} instead of \commandinline{front}. For example \commandinline{bg front} is the same as \commandinline{bg inside back}, \commandinline{above back} is the same as \commandinline{above inside front}, etc.
-%
-% You can also use short names to specify foreground and background parts. The elements of the abbreviations are as follows: \commandinline{F} (flap), \commandinline{W} (wrap), \commandinline{C} (cover), \commandinline{S} (spine), \commandinline{l} (a part to the left of the spine), \commandinline{r} (a part to the right of the spine). For example \commandinline{lC} is the abbreviation of the left cover, i.e.\ the back cover of the outside cover, or the inside front cover of the inside cover. It is not extended onto the bleed, i.e.\ it is a foreground part. If you want to extend that part onto the bleed, type \commandinline{bg} and then a space in the front of the name. For example \commandinline{bg lC} is the left cover extended onto the bleed. Use a hyphen to specify multi-piece parts. For example \commandinline{lW-S} is the part from the left wrap to the spine, which is not extended onto the bleed.
-%
-% The following figures also show the normal and abbreviated names of the blue parts.
+% The parts are the rectangular subspaces of the sheet.
+% The foreground parts are the back flap, back wrap, back cover, spine, front cover, front wrap, front flap and various combinations of these.
+% These can be referred to by their names (see later).
+% The foreground parts do not extend to the bleed.
+%
+% \medskip
+% The background parts are extended to the bleed.
+% Their names start with \commandinline{bg} followed by a space before the foreground part name.
+%
+% \medskip
+% If your book also has printing on the inside cover, the layout for the inside cover will be the exact opposite of the layout for the outside cover.
+% This is why these parts have synonymous names.
+% The synonymous names contain \commandinline{inside front} instead of \commandinline{back} and \commandinline{inside back} instead of \commandinline{front}.
+% For example \commandinline{bg front} is the same as \commandinline{bg inside back}, \commandinline{above back} is the same as \commandinline{above inside front}, etc.
+%
+% \medskip
+% You can also use short names to specify parts.
+% The elements of the abbreviations are as follows:
+% \commandinline{F} (flap), \commandinline{W} (wrap), \commandinline{C} (cover), \commandinline{S} (spine), \commandinline{l} (a part to the left of the spine), \commandinline{r} (a part to the right of the spine).
+% For example \commandinline{lC} is the abbreviation for the left cover, i.e.~the back cover of the outside cover, or the inside front cover of the inside cover.
+% It is not extended to the bleed, i.e.~it is a foreground part.
+% If you want to extend a part to the bleed, type \commandinline{bg} followed by a space before the name.
+% For example \commandinline{bg lC} is the left cover extended to the bleed.
+% Use a hyphen to specify multiple parts.
+% For example, \commandinline{lW-S} is the part from the left wrap to the spine that does not extend to the bleed.
+%
+% \medskip
+% The following figures also show the full and abbreviated names of the blue parts.
%
% \subsection{Book cover without flaps, background parts}
%
% \setcounter{partfig}{1}
% \loop
% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\hfill\stepcounter{partfig}
-% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\par\smallskip\stepcounter{partfig}
+% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\par\bigskip\stepcounter{partfig}
% \ifnum\value{partfig}<7\repeat
%
% \subsection{Book cover without flaps, foreground parts}
%
% \loop
% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\hfill\stepcounter{partfig}
-% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\par\smallskip\stepcounter{partfig}
+% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\par\bigskip\stepcounter{partfig}
% \ifnum\value{partfig}<13\repeat
%
% \subsection{Book cover without flaps, other parts}
%
% \loop
% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\hfill\stepcounter{partfig}
-% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\par\smallskip\stepcounter{partfig}
+% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\par\bigskip\stepcounter{partfig}
% \ifnum\value{partfig}<17\repeat
% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\stepcounter{partfig}
%
@@ -364,32 +468,34 @@
%
% \loop
% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\hfill\stepcounter{partfig}
-% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\par\smallskip\stepcounter{partfig}
+% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\par\bigskip\stepcounter{partfig}
% \ifnum\value{partfig}<46\repeat
%
% \subsection{Book cover with flaps, foreground parts}
%
% \loop
% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\hfill\stepcounter{partfig}
-% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\par\smallskip\stepcounter{partfig}
+% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\par\bigskip\stepcounter{partfig}
% \ifnum\value{partfig}<74\repeat
%
% \subsection{Book cover with flaps, other parts}
%
% \loop
% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\hfill\stepcounter{partfig}
-% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\par\smallskip\stepcounter{partfig}
+% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\par\bigskip\stepcounter{partfig}
% \ifnum\value{partfig}<78\repeat
% \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}
%
% \subsection{Defining part}
-% You can define a new rectangular part or redefine a defined part with the following commands:
+%
+% You can define a new rectangular part or redefine a defined part using the following commands:
% \begin{commandlst}
% \newbookcoverpart{!<new part>!}{!<setting>!}
% \renewbookcoverpart{!<defined part>!}{!<setting>!}
% \end{commandlst}
%
-% \medskip In \meta{setting} you have to set the new part sizes, the coordinates of its upper left corner (the origin is the upper left corner of the printed area), and the parameters of the \texttt{trimmed part} rectangle node in \texttt{tikz} and \texttt{tikz clip} component types (see in the Section~\ref{sec:componenttypes}). For this purpose, use the following commands:
+% In \meta{setting} you have to set the new part sizes, the coordinates of its upper left corner (the origin is the upper left corner of the printed area), and the parameters of the \texttt{trimmed part} rectangle node in the \texttt{tikz} and \texttt{tikz clip} component types (see in the Section~\ref{sec:componenttypes}).
+% Use the following commands to do this:
% \begin{commandlst}
% \setpartposx{!<coord x>!}
% \setpartposy{!<coord y>!}
@@ -402,16 +508,17 @@
% \includegraphics{./figures/bookcover-newpart}
% \end{center}
%
-% To give the previous lengths, you can use the following length commands, which are declared by the options of the document class:
+% To specify the previous lengths, you can use the following length commands, which are declared by the options of the document class:
%
+% \medskip
% \begin{compactdesc}
-% \item[]\commandinline{\coverheight} Cover height.
-% \item[]\commandinline{\coverwidth} Front/back cover width.
-% \item[]\commandinline{\spinewidth} Spine width.
-% \item[]\commandinline{\flapwidth} Flap width.
-% \item[]\commandinline{\wrapwidth} Wrap width.
-% \item[]\commandinline{\bleedwidth} Bleed width.
-% \item[]\commandinline{\marklength} Mark length.
+% \item \commandinline{\coverheight} Cover height.
+% \item \commandinline{\coverwidth} Front/back cover width.
+% \item \commandinline{\spinewidth} Spine width.
+% \item \commandinline{\flapwidth} Flap width.
+% \item \commandinline{\wrapwidth} Wrap width.
+% \item \commandinline{\bleedwidth} Bleed width.
+% \item \commandinline{\marklength} Mark length.
% \end{compactdesc}
%
% \example
@@ -440,26 +547,33 @@
% \end{document}
% \end{examplelst}
%
-% You can rename a defined part with the following commands:
+% You can rename a defined part using the following commands:
% \begin{commandlst}
% \newnamebookcoverpart{!<new part>!}{!<defined part>!}
% \letnamebookcoverpart{!<new part>!}{!<defined part>!}[!<left>!,!<bottom>!,!<right>!,!<top>!]
% \end{commandlst}
%
-% \medskip Using |\newnamebookcoverpart|, the definition of the \meta{new part} and the \meta{defined part} are always the same, even if you redefine the \meta{defined part} later with the |\renewbookcoverpart|.
+% With |\newnamebookcoverpart|, the definition of the \meta{new part} and the \meta{defined part} are always the same, even if you redefine the \meta{defined part} later with the |\renewbookcoverpart|.
%
-% Using |\letnamebookcoverpart|, the definition of the \meta{new part} is the same as the current definition of the \meta{defined part} reduced by the \meta{left}, \meta{bottom}, \meta{right} and \meta{top} margins. If you change the \meta{defined part} later with the |\renewbookcoverpart|, the \meta{new part} doesn't change with it. The default value of every margin is \texttt{0mm}. If the \meta{left}, \meta{bottom}, \meta{right} or \meta{top} is empty or space, then its value will be \texttt{0mm}. If the value of a margin is negative, the part size will increase instead of decrease. You can use the following length commands to specify the margins:
+% \medskip
+% Using |\letnamebookcoverpart|, the definition of the \meta{new part} is the same as the current definition of the \meta{defined part} reduced by the \meta{left}, \meta{bottom}, \meta{right} and \meta{top} margins.
+% If you change the \meta{defined part} later with the |\renewbookcoverpart|, the \meta{new part} will not change with it.
+% The default value of every margin is \texttt{0mm}.
+% If the \meta{left}, \meta{bottom}, \meta{right} or \meta{top} is empty or space, then its value will be \texttt{0mm}.
+% If the value of a margin is negative, the part size will increase instead of decreasing.
+% You can use the following length commands to specify the margins:
%
+% \medskip
% \begin{compactdesc}
-% \item[]\commandinline{\partheight} The height of the \meta{defined part}.
-% \item[]\commandinline{\partwidth} The width of the \meta{defined part}.
-% \item[]\commandinline{\coverheight} Cover height.
-% \item[]\commandinline{\coverwidth} Front/back cover width.
-% \item[]\commandinline{\spinewidth} Spine width.
-% \item[]\commandinline{\flapwidth} Flap width.
-% \item[]\commandinline{\wrapwidth} Wrap width.
-% \item[]\commandinline{\bleedwidth} Bleed width.
-% \item[]\commandinline{\marklength} Mark length.
+% \item \commandinline{\partheight} The height of the \meta{defined part}.
+% \item \commandinline{\partwidth} The width of the \meta{defined part}.
+% \item \commandinline{\coverheight} Cover height.
+% \item \commandinline{\coverwidth} Front/back cover width.
+% \item \commandinline{\spinewidth} Spine width.
+% \item \commandinline{\flapwidth} Flap width.
+% \item \commandinline{\wrapwidth} Wrap width.
+% \item \commandinline{\bleedwidth} Bleed width.
+% \item \commandinline{\marklength} Mark length.
% \end{compactdesc}
%
% \example
@@ -480,21 +594,31 @@
%
% \section{Book cover component types}\label{sec:componenttypes}
%
-% Predefined \meta{component type}: \commandinline{color}, \commandinline{tikz}, \commandinline{tikz clip}, \commandinline{picture}, \commandinline{normal}, \commandinline{center}, \commandinline{ruler}.
+% The predefined component types:
+% \commandinline{color}, \commandinline{tikz}, \commandinline{tikz clip}, \commandinline{picture}, \commandinline{normal}, \commandinline{center}, \commandinline{ruler}.
%
% \subsection{The color component type}
-% It determines the color of the \meta{part}. The \meta{content} is the options of the |\fill| in the \texttt{tikz} package:
+%
+% It determines the color of the \meta{part}.
+% The \meta{content} is the options of the |\fill| in the \texttt{tikz} package:
+%
+% \medskip
% \begin{compactdesc}
-% \item[]\commandinline{!<color name>!} (See it in the \texttt{xcolor} package.)
-% \item[]\commandinline{color=!<color name>!} (It is equivalent to the previous one.)
-% \item[]\commandinline{top color=!<color name>!}
-% \item[]\commandinline{bottom color=!<color name>!}
-% \item[]\commandinline{middle color=!<color name>!}
-% \item[]\commandinline{inner color=!<color name>!}
-% \item[]\commandinline{outer color=!<color name>!}
-% \item[]\commandinline{ball color=!<color name>!}
-% \item[]\commandinline{shading angle=!<degree>!} It rotates the shading by the given angle.
-% \item[]\commandinline{opacity=!<value>!} Sets the filling opacity. The \meta{value} is between 0 and 1.
+% \item \commandinline{!<color name>!}
+% (See it in the \texttt{xcolor} package.)
+% \item \commandinline{color=!<color name>!}
+% (It is equivalent to the previous one.)
+% \item \commandinline{top color=!<color name>!}
+% \item \commandinline{bottom color=!<color name>!}
+% \item \commandinline{middle color=!<color name>!}
+% \item \commandinline{inner color=!<color name>!}
+% \item \commandinline{outer color=!<color name>!}
+% \item \commandinline{ball color=!<color name>!}
+% \item \commandinline{shading angle=!<degree>!}
+% It rotates the shading by the given angle.
+% \item \commandinline{opacity=!<value>!}
+% Sets the filling opacity.
+% The \meta{value} is between 0 and 1.
% \end{compactdesc}
%
% \example
@@ -507,9 +631,13 @@
% \end{examplelst}
%
% \subsection{The tikz component type}
-% The \meta{content} is a Ti\emph{k}Z code without |\tikz| command and |tikzpicture| environment. The origin of the Ti\emph{k}Z figure is the lower left corner of the \meta{part}. Two rectangle nodes come into being: \commandinline{part} and \commandinline{trimmed part}. (Thanks to Zunbeltz Izaola for the idea.)
%
-% \begin{minipage}{\textwidth}
+% The \meta{content} is a Ti\emph{k}Z code without |\tikz| command and |tikzpicture| environment.
+% The origin of the Ti\emph{k}Z figure is the lower left corner of the \meta{part}.
+% Two rectangular nodes are created:
+% \commandinline{part} and \commandinline{trimmed part}.
+% (Thanks to Zunbeltz Izaola for the idea.)
+%
% \example
% \begin{examplelst}
% \begin{bookcover}
@@ -520,13 +648,13 @@
% \fill[blue] (part.south west) -- (part.center) -- (part.north west) -- cycle;}
% \end{bookcover}
% \end{examplelst}
-% \end{minipage}
% \begin{center}
% \fcolorbox{black!50}{white}{\includegraphics{figures/bookcover-tikz}}
% \end{center}
%
% \subsection{The tikz clip component type}
-% It works the same way as the \texttt{tikz} component type, but it clips the \meta{part}.
+%
+% It works in the same way as the \texttt{tikz} component type, but it clips the \meta{part}.
%
% \example
% \begin{examplelst}
@@ -542,7 +670,8 @@
% \end{center}
%
% \subsection{The picture component type}
-% The \meta{content} is a picture file, which will be rescaled according to the sizes of the \meta{part}.
+%
+% The \meta{content} is an image file that is resized according to the size of the \meta{part}.
%
% \example
% \begin{examplelst}
@@ -552,7 +681,9 @@
% \end{examplelst}
%
% \subsection{The normal component type}
-% In this case, the \meta{content} is not specific. You can choose it as text or picture etc.
+%
+% In this case, the \meta{content} is not specific.
+% You can choose it as text or picture etc.
%
% \example
% \begin{examplelst}
@@ -560,12 +691,13 @@
% \bookcovercomponent{normal}{front}[,,,5cm]{
% \centering
% {\bfseries\huge Book title}\\[5mm]
-% \includegraphics[width=0.4\partwidth]{fig.png}\\}
+% \includegraphics[width=0.4\partwidth]{fig.png}}
% \end{bookcover}
% \end{examplelst}
%
% \subsection{The center component type}
-% It works the same way as the \texttt{normal} component type, but the position of the content is the center of the part horizontally and vertically.
+%
+% It works in the same way as the \texttt{normal} component type, but the position of the content is the centre of the part horizontally and vertically.
%
% \example
% \begin{examplelst}
@@ -578,28 +710,49 @@
% \end{examplelst}
%
% \subsection{The ruler component type}
-% Use the \texttt{ruler} component type to check the dimensions of the part. It draws a square ruler at the borders of the part. The \meta{content} is
+%
+% Use the \texttt{ruler} component type to check the dimensions of the part.
+% It draws a square ruler at the borders of the part.
+% The \meta{content} is
% \begin{commandlst}
% !<unit>!,!<origin>!,!<color name>!
% \end{commandlst}
%
-% \begin{description}
-% \item[]\meta{unit} The ruler unit:
% \begin{compactdesc}
-% \item[]\commandinline{cm} Metric ruler (centimeter). If the \meta{unit} is empty or space, then its value will be \texttt{cm}.
-% \item[]\commandinline{in} English ruler (inch).
+% \item \meta{unit}
+% The ruler unit:
+%
+% \begin{compactdesc}
+% \item \commandinline{cm}
+% Metric ruler (centimeter).
+% If the \meta{unit} is empty or space, then its value will be \texttt{cm}.
+% \item \commandinline{in}
+% English ruler (inch).
% \end{compactdesc}
%
-% \item[]\meta{origin} The origin of the square ruler:
+% \item \meta{origin}
+% The origin of the square ruler:
+%
% \begin{compactdesc}
-% \item[]\commandinline{upperleft } The origin is the upper left corner of the part. Directions: down and right. If the \meta{origin} is empty or space, then its value will be \texttt{upperleft}.
-% \item[]\commandinline{upperright} The origin is the upper right corner of the part. Directions: down and left.
-% \item[]\commandinline{lowerleft } The origin is the lower left corner of the part. Directions: up and right.
-% \item[]\commandinline{lowerright} The origin is the lower right corner of the part. Directions: up and left.
+% \item \commandinline{upperleft }
+% The origin is the upper left corner of the part.
+% Directions: down and right.
+% If the \meta{origin} is empty or space, then its value will be \texttt{upperleft}.
+% \item \commandinline{upperright}
+% The origin is the upper right corner of the part.
+% Directions: down and left.
+% \item \commandinline{lowerleft }
+% The origin is the lower left corner of the part.
+% Directions: up and right.
+% \item \commandinline{lowerright}
+% The origin is the lower right corner of the part.
+% Directions: up and left.
% \end{compactdesc}
%
-% \item[]\meta{color name} The color of the ruler. If it is empty or space, then its value will be the color of the marks.
-% \end{description}
+% \item \meta{color name}
+% The color of the ruler.
+% If it is empty or space, then its value will be the color of the marks.
+% \end{compactdesc}
%
% \example
% \begin{examplelst}
@@ -615,7 +768,8 @@
% \end{center}
%
% \subsection{Defining component type}
-% You can define a new component type, redefine or rename a defined component type with the following commands:
+%
+% You can define a new component type, redefine or rename a defined component type using the following commands:
% \begin{commandlst}
% \newbookcovercomponenttype{!<new component type>!}{!<formatting>!}
% \renewbookcovercomponenttype{!<defined component type>!}{!<formatting>!}
@@ -623,18 +777,26 @@
% \letnamebookcovercomponenttype{!<new component type>!}{!<defined component type>!}
% \end{commandlst}
%
-% \medskip Using |\newnamebookcovercomponenttype|, the definition of the \meta{new component type} and the \meta{defined component type} are always the same, even if you redefine the \meta{defined component type} later with the |\renewbookcovercomponenttype|.
+% \medskip
+% With |\newnamebookcovercomponenttype|, the definition of the \meta{new component type} and the \meta{defined component type} are always the same, even if you redefine the \meta{defined component type} later with the |\renewbookcovercomponenttype|.
%
-% Using |\letnamebookcovercomponenttype|, the definition of the \meta{new component type} is the same as the current definition of the \meta{defined component type}. If you change the \meta{defined component type} later with |\renewbookcovercomponenttype|, the \meta{new component type} doesn't change with it.
+% \medskip
+% With |\letnamebookcovercomponenttype|, the definition of the \meta{new component type} is the same as the current definition of the \meta{defined component type}.
+% If you change the \meta{defined component type} later with |\renewbookcovercomponenttype|, the \meta{new component type} doesn't change with it.
%
+% \medskip
% You can use the following length commands in \meta{formatting}:
%
+% \medskip
% \begin{compactdesc}
-% \item[]\commandinline{\partwidth} The width of the part (reduced by the margins) in which you are using the defined component type.
-% \item[]\commandinline{\partheight} The height of the part (reduced by the margins) in which you are using the defined component type.
+% \item \commandinline{\partwidth}
+% The width of the part (reduced by the margins) in which you are using the defined component type.
+% \item \commandinline{\partheight}
+% The height of the part (reduced by the margins) in which you are using the defined component type.
% \end{compactdesc}
%
-% You have to referrence the content as \verb|#1|.
+% \medskip
+% You must refer to the content as \verb|#1|.
%
% \example
% \begin{examplelst}
@@ -651,7 +813,10 @@
% \end{document}
% \end{examplelst}
%
-% \newpage\section{Examples}
+% \newpage
+% \section{Examples}
+%
+% This section provides some examples to help you better understand the use and functionality of the commands and options of the \texttt{bookcover} document class.
%
% \subsection{Barcode and QR code}
%
@@ -682,7 +847,8 @@
% \end{document}
% \end{examplelst}
%
-% \newpage\subsection{Description}\label{subsec:desc}
+% \newpage
+% \subsection{Description}\label{subsec:desc}
%
% \begin{center}
% \fcolorbox{black!50}{white}{\includegraphics[page=1,width=\textwidth-.8pt]{figures/bookcover-description}}\\[5mm]
@@ -718,7 +884,8 @@
% \end{document}
% \end{examplelst}
%
-% \newpage\subsection{Usage of margins}
+% \newpage
+% \subsection{Usage of margins}
%
% \begin{center}
% \fcolorbox{black!50}{white}{\includegraphics[width=\textwidth-.8pt]{figures/bookcover-margins}}
@@ -745,7 +912,6 @@
%
% or its equivalent
%
-% \bigskip
% \begin{examplelst}
% \documentclass[spinewidth=30mm]{bookcover}
%
@@ -771,31 +937,37 @@
% \end{document}
% \end{examplelst}
%
-% \newpage\subsection{A dust jacket}
+% \newpage
+% \subsection{A dust jacket}
%
% \begin{center}
% \fcolorbox{black!50}{white}{\includegraphics[width=\textwidth-.8pt]{bookcover-example1}}
% \end{center}
% \lstinputlisting[style=examplefile]{bookcover-example1.tex}
%
-% \newpage\subsection{A two-sided book cover}\label{subsec-two-sided-example}
+% \newpage
+% \subsection{A two-sided book cover}\label{subsec-two-sided-example}
%
% \begin{center}
% \fcolorbox{black!50}{white}{\includegraphics[page=1,width=\textwidth-.8pt]{bookcover-example2}}\\[5mm]
% \fcolorbox{black!50}{white}{\includegraphics[page=2,width=\textwidth-.8pt]{bookcover-example2}}
% \end{center}
+% \newpage
% \lstinputlisting[style=examplefile]{bookcover-example2.tex}
%
-% \newpage\subsection{Trimming and checking dimensions}\label{subsec:trimming}
+% \newpage
+% \subsection{Trimming and checking dimensions}\label{subsec:trimming}
%
% \begin{center}
% \fcolorbox{black!50}{white}{\includegraphics[page=1,width=\textwidth-.8pt]{figures/bookcover-trimming}}\\[5mm]
% \fcolorbox{black!50}{white}{\includegraphics[page=2,width=\textwidth-.8pt]{figures/bookcover-trimming}}
% \end{center}
%
-% This example shows the usage of the \texttt{trimmed} option and the |\bookcovertrimmedpart| command. These allow you to view the finished product for demonstration purposes. We also check the cover dimensions. Set the value of the \texttt{trimmed} option \texttt{false} and clear \texttt{ruler} component type before printing!
+% This example shows the use of the \texttt{trimmed} option and the |\bookcovertrimmedpart| command.
+% These allow you to see the finished product for demonstration purposes.
+% We also check the dimensions of the book cover.
+% Set the value of the \texttt{trimmed} option to \texttt{false} and clear the \texttt{ruler} component type before printing!
%
-% \bigskip
% \begin{examplelst}
% \documentclass[
% spinewidth=15mm,
@@ -819,7 +991,7 @@
% \centering
% {\huge\bfseries ANNALES\\ INFORMATICAE\par}
% \vfill
-% {\large\bfseries TOMUS 43.~(2020)}
+% {\large\bfseries TOMUS 43.~(2024)}
% \vfill
% {\large COMMISSIO REDACTORIUM}\\[3mm]
% \lipsum[2]}
@@ -830,7 +1002,7 @@
%
% \bookcovercomponent{center}{spine}{
% \rotatebox[origin=c]{-90}{\footnotesize\bfseries
-% ANNALES INFORMATICAE 43.~(2020)}}
+% ANNALES INFORMATICAE 43.~(2024)}}
%
% \bookcovercomponent{ruler}{whole}{,,} % Check dimensions
%
@@ -851,7 +1023,8 @@
% \end{document}
% \end{examplelst}
%
-% \newpage\subsection{A book cover with folding margin for hardcover book}
+% \newpage
+% \subsection{A book cover with folding margin for hardcover book}
%
% \begin{center}
% \fcolorbox{black!50}{white}{\includegraphics[width=\textwidth-.8pt]{figures/bookcover-foldingmargin}}
@@ -1273,7 +1446,7 @@
%% BOOKCOVERELEMENT ENVIRONMENT
-\NewDocumentEnvironment{bookcoverelement}{ m m O{,,,} +b }{\bookcovercomponent{#1}{#2}[#3]{#4}}
+\NewDocumentEnvironment{bookcoverelement}{ m m O{,,,} +b }{\bookcovercomponent{#1}{#2}[#3]{#4}}{}
%% NEW BOOKCOVER PART
@@ -1353,10 +1526,13 @@
\def\bookcover@tikz@content#1{%
\begin{tikzpicture}[overlay,yshift=-\bookcover@partheight@]
\begingroup
- \pgfset{minimum width=\bookcover@partwidth@,minimum height=\bookcover@partheight@}
+ \pgfset{minimum width=\bookcover@partwidth@,
+ minimum height=\bookcover@partheight@,
+ outer sep=0pt}
\pgfnode{rectangle}{south west}{}{part}{\pgfusepath{}}
\pgfset{minimum width=\bookcover@partwidth@-\bookcover@tikz@trimmed@part@width@minus,
- minimum height=\bookcover@partheight@-\bookcover@tikz@trimmed@part@height@minus}
+ minimum height=\bookcover@partheight@-\bookcover@tikz@trimmed@part@height@minus,
+ outer sep=0pt}
\pgftransformshift{\pgfpoint{\bookcover@tikz@trimmed@part@push@right}
{\bookcover@tikz@trimmed@part@push@up}}
\pgfnode{rectangle}{south west}{}{trimmed part}{\pgfusepath{}}
@@ -1875,7 +2051,7 @@
\letnamebookcoverpart{bookcoverpart@whole}{whole} % bookcoverpart@whole is protected part
-%% SYNONYMOUS PART NAMES FOR INSIDE COVER ('INSIDE FRONT' = 'BACK', 'INSIDE BACK' = 'FRONT')
+%% SYNONYMOUS NAMES OF PARTS FOR INSIDE COVER ('INSIDE FRONT' = 'BACK', 'INSIDE BACK' = 'FRONT')
\@for\bookcover@partname@:={%
bg back flap,bg back wrap,bg back,bg front,bg front wrap,bg front flap,%
@@ -1898,7 +2074,7 @@ whole without front flap,whole without back flap}%
\patchcmd{\bookcover@partname@}{fr@nt}{inside back}{}{}%
\letnamebookcoverpart{\bookcover@partname@}{\bookcover@partname@original@}}
-%% SHORT PART NAMES
+%% SHORT NAMES OF PARTS
\def\bookcover@shortpartname@#1=#2.{\letnamebookcoverpart{#1}{#2}\letnamebookcoverpart{bg #1}{bg #2}}
\@for\bookcover@partname@:={%
diff --git a/Master/texmf-dist/source/latex/bookcover/bookcover.ins b/Master/texmf-dist/source/latex/bookcover/bookcover.ins
index 5f601760d38..81f51163b6d 100644
--- a/Master/texmf-dist/source/latex/bookcover/bookcover.ins
+++ b/Master/texmf-dist/source/latex/bookcover/bookcover.ins
@@ -1,5 +1,5 @@
-% Copyright (C) 2015-2024 Tibor Tomacs
+% Copyright (C) 2015-2024 Tibor Tómács
% 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
@@ -15,7 +15,7 @@
\usedir{tex/latex/bookcover}
\preamble
This is a generated file.
-Copyright (C) 2015-2024 Tibor Tomacs
+Copyright (C) 2015-2024 Tibor Tómács
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
diff --git a/Master/texmf-dist/source/latex/bookshelf/bookshelf.dtx b/Master/texmf-dist/source/latex/bookshelf/bookshelf.dtx
deleted file mode 100644
index 8abaee3d6d1..00000000000
--- a/Master/texmf-dist/source/latex/bookshelf/bookshelf.dtx
+++ /dev/null
@@ -1,2524 +0,0 @@
-% \iffalse meta-comment
-%
-% Transformed from bookshelf.xml by ClassPack db2dtx.xsl
-% version 1.19 (2020-05-19) on Saturday 23 May 2020 at 23:33:08
-%
-% bookshelf.dtx is copyright © 2020 by Peter Flynn <peter@silmaril.ie>
-%
-% 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 Peter Flynn <peter@silmaril.ie>
-%
-% This work consists of the files bookshelf.dtx and bookshelf.ins,
-% the derived file ,
-% and any other ancillary files listed in the MANIFEST.
-%
-% \fi
-% \iffalse
-%<*driver>
-\ProvidesFile{bookshelf.dtx}
-%</driver>
-%<class>\NeedsTeXFormat{LaTeX2e}[2017/04/15]
-%<class>\ProvidesClass{bookshelf}[2020/05/24 v0.5
-%<class> Turn your bibliography into a bookshelf image]
-%<*driver>
-\RequirePackage{fix-cm}% included by default.
-\PassOptionsToPackage{svgnames}{xcolor}% xcolor/dox/hyperref implied
-\documentclass[12pt]{ltxdoc}
-%%
-%% Packages added for documentation
-%%
-\usepackage{dox}% used by default. (0)%
- \makeatletter
- \doxitem[idxtype=attribute]{Attribute}{CPK@attribute}{attributes}
- \makeatother
- \makeatletter
- \doxitem[idxtype=attributevalue]{AttributeValue}{CPK@attributevalue}{attribute values}
- \makeatother
- \makeatletter
- \doxitem[idxtype=class]{Class}{CPK@class}{classes}
- \makeatother
- \makeatletter
- \doxitem[idxtype=colour]{Colour}{CPK@colour}{colours}
- \makeatother
- \makeatletter
- \doxitem[idxtype=counter]{Counter}{CPK@counter}{counters}
- \makeatother
- \makeatletter
- \doxitem[idxtype=DTD]{DTD}{CPK@dtd}{DTDs/Schemas}
- \makeatother
- \makeatletter
- \doxitem[idxtype=element]{Element}{CPK@element}{element types}
- \makeatother
- \makeatletter
- \doxitem[idxtype=entity]{Entity}{CPK@entity}{entities}
- \makeatother
- \makeatletter
- \doxitem[idxtype=error]{Error}{CPK@error}{errors}
- \makeatother
- \makeatletter
- \doxitem[idxtype=field]{Field}{CPK@field}{fields}
- \makeatother
- \makeatletter
- \doxitem[idxtype=file]{File}{CPK@file}{files}
- \makeatother
- \makeatletter
- \doxitem[idxtype=font]{Font}{CPK@font}{fonts}
- \makeatother
- \makeatletter
- \doxitem[idxtype=function]{Function}{CPK@function}{functions}
- \makeatother
- \makeatletter
- \doxitem[idxtype=language]{Language}{CPK@language}{languages}
- \makeatother
- \makeatletter
- \doxitem[macrolike,idxtype=length]{Length}{CPK@length}{lengths}
- \makeatother
- \makeatletter
- \doxitem[idxtype=mode]{Mode}{CPK@mode}{modes}
- \makeatother
- \makeatletter
- \doxitem[idxtype=option]{Option}{CPK@option}{options}
- \makeatother
- \makeatletter
- \doxitem[idxtype=package]{Package}{CPK@package}{packages}
- \makeatother
- \makeatletter
- \doxitem[idxtype=variable]{Variable}{CPK@variable}{variables}
- \makeatother
- \makeatletter
- \doxitem[idxtype=parameter]{Parameter}{CPK@parameter}{parameters}
- \makeatother
- \makeatletter
- \doxitem[macrolike,idxtype=switch]{Switch}{CPK@switch}{switches}
- \makeatother
- \makeatletter
- \doxitem[idxtype=template]{Template}{CPK@template}{templates}
- \makeatother
- \makeatletter
- \doxitem[idxtype=typeface]{Typeface}{CPK@typeface}{typefaces}
- \makeatother
- \makeatletter
- \doxitem[macrolike,idxtype=box]{Box}{CPK@box}{boxes}
- \makeatother
- \newcommand{\LabelFont}[2][\relax]{\strut
- {\fontencoding\encodingdefault
- \fontfamily{lmtt}\fontseries{lc}#1\selectfont#2}\space}
- \makeatletter
- \let\CPK@macro\macro\let\CPK@endmacro\endmacro
- \makeatother
- \makeatletter
- \let\CPK@environment\environment\let\CPK@endenvironment\endenvironment
- \makeatother
- \makeatletter
- \def\PrintAttributeName#1{\LabelFont{@#1}}
- \makeatother
- \def\PrintAttributeValueName#1{\LabelFont{"#1"}}
- \def\PrintClassName#1{\LabelFont[\fontfamily{lmss}]{#1}}
- \def\PrintColourName#1{\LabelFont[\color{#1}]{#1}}
- \def\PrintCounterName#1{\LabelFont{#1}}
- \def\PrintDTDName#1{\LabelFont{#1}}
- \def\PrintElementName#1{\LabelFont{<#1>}}
- \def\PrintEntityName#1{\LabelFont{\&#1;}}
- \def\PrintEnvironmentName#1{\LabelFont[\fontfamily{lmss}]{#1}}
- \def\PrintErrorName#1{\LabelFont[\color{Red}!]{#1}}
- \def\PrintFunctionName#1{\LabelFont[\bfseries\itshape]{#1}}
- \def\PrintLanguageName#1{\LabelFont{#1}}
- \def\PrintLengthName#1{\LabelFont{#1}}
- \def\PrintMacroName#1{\LabelFont{#1}}
- \def\PrintModeName#1{\LabelFont[\sffamily]{\textlangle#1\textrangle}}
- \def\PrintOptionName#1{\LabelFont[\bfseries]{#1}}
- \def\PrintPackageName#1{\LabelFont[\fontfamily{lmss}]{#1}}
- \def\PrintSwitchName#1{\LabelFont{#1}}
- \def\PrintTemplateName#1{\LabelFont[\bfseries]{#1}}
- \def\PrintVariableName#1{\LabelFont[\ttfamily]{#1}}
- \def\PrintParameterName#1{\LabelFont[\ttfamily]{#1}}
- \def\PrintFieldName#1{\LabelFont[\ttfamily]{#1}}
-%% fontenc omit: conflict: fontspec (3)
-%% inputenc omit: conflict: fontspec (6)
-\usepackage{fontspec}% part/@conformance=xelatex detected. (7)%
- \renewcommand{\textsc}[1]{{\small\MakeTextUppercase{#1}}}
-\usepackage{noto}% requested by author (15)%
-\usepackage{luximono}% requested by author (16)%
-\usepackage{mflogo}% used by default. (36)%
-\usepackage[british]{babel}% used by default. (41)%
-\usepackage[backend=biber,doi=true,
- isbn=true,url=true,uniquename=false,style=apa]{biblatex}% bibliography/@arch=biblatex detected. (42)%
- \makeatletter
- \AtBeginDocument{%
- \setlength{\bibitemsep}{1ex}%
- \setlength{\bibnamesep}{1.5\itemsep}%
- \defbibheading{shortbib}[References]%
- {\section{#1}}}
- \@ifpackagewith{babel}{british}{%
- \DeclareLanguageMapping{british}%
- {british-apa}}{\relax}
- \makeatother
- \makeatletter
- \providetoggle{blx@skipbiblist}
- \makeatother
-\usepackage{calc}% used by default. (50)%
- \makeatletter
- {\scriptsize
- \global\advance\@totalleftmargin by1em
- \global\advance\MacroIndent by.5em}
- \makeatother
-\usepackage{ccaption}% used by default. (53)%
- \captionnamefont{\bfseries}
- \captionstyle{\raggedright}
-\usepackage[inline]{enumitem}% use of 'variablelist' detected (57)%
- \setlist[description]{style=unboxed}
- \setlist[itemize]{leftmargin=2em}
- \setlist[enumerate]{leftmargin=2em}
- \newlist{inlineenum}{enumerate*}{1}
- \setlist[inlineenum,1]{label=\emph{\alph*}),
- itemjoin={{; }},itemjoin*={{; and }}}
-\usepackage{fancyhdr}% requested by author (59)%
- \makeatletter
- \pagestyle{fancy}
- \cfoot{}
- \lhead{\footnotesize\rightmark}
- \rhead{\small\thepage}
- \rfoot{\footnotesize The \LaTeX\
- \textsf{\SIL@docname} \SIL@doctype}
- \renewcommand{\headrulewidth}{0pt}
- \renewcommand{\footrulewidth}{0pt}
- \makeatother
-\usepackage{relsize}% use of 'acronym' detected (65)%
-\usepackage{textcase}% used by default. (68)%
-\usepackage{float}% used by default. (70)%
- \renewcommand{\topfraction}{.85}
- \renewcommand{\bottomfraction}{.7}
- \renewcommand{\textfraction}{.15}
- \renewcommand{\floatpagefraction}{.66}
- \renewcommand{\dbltopfraction}{.66}
- \renewcommand{\dblfloatpagefraction}{.66}
- \setcounter{topnumber}{9}
- \setcounter{bottomnumber}{9}
- \setcounter{totalnumber}{20}
- \setcounter{dbltopnumber}{9}
-\usepackage[level]{fmtcount}% xref/@linkend➝listitem/xml:id detected. (71)%
-\usepackage[a4paper,left=30mm,top=25mm,
- textwidth=150mm,textheight=225mm,headheight=15pt]{geometry}% used by default. (72)%
-\usepackage{hypdoc}% requested by author (78)%
- \hypersetup{linkcolor=DarkBlue,urlcolor=Blue,citecolor=Red}
- \ExecuteBibliographyOptions{maxcitenames=1}
- \DeclareFieldFormat{citehyperref}{%
- \DeclareFieldAlias{bibhyperref}{noformat}% Avoid nested links
- \bibhyperref{#1}}
- \DeclareFieldFormat{textcitehyperref}{%
- \DeclareFieldAlias{bibhyperref}{noformat}% Avoid nested links
- \bibhyperref{%
- #1%
- \ifbool{cbx:parens}
- {\bibcloseparen\global\boolfalse{cbx:parens}}
- {}}}
- \savebibmacro{cite}
- \savebibmacro{textcite}
- \renewbibmacro*{cite}{%
- \printtext[citehyperref]{%
- \restorebibmacro{cite}%
- \usebibmacro{cite}}}
- \renewbibmacro*{textcite}{%
- \ifboolexpr{
- ( not test {\iffieldundef{prenote}} and
- test {\ifnumequal{\value{citecount}}{1}} )
- or
- ( not test {\iffieldundef{postnote}} and
- test {\ifnumequal{\value{citecount}}{\value{citetotal}}} )
- }
- {\DeclareFieldAlias{textcitehyperref}{noformat}}
- {}%
- \printtext[textcitehyperref]{%
- \restorebibmacro{textcite}%
- \usebibmacro{textcite}}}
-\usepackage{listings}% use of 'programlisting' detected (85)%
- \lstdefinelanguage{dummy}
- {morekeywords={dummy}}
- \lstdefinelanguage{Makefile}
- {otherkeywords={.PHONY,.DEFAULT},%
- morekeywords={PHONY,DEFAULT,shell,ifeq,else,endif},%
- keywordsprefix={.},%
- moredelim=[l][\color{Green}]{:},%
- morecomment=[l]{\#},%
- moredelim=[s][\color{Blue}]{\$(}{)}%
- }
- \lstdefinelanguage{DocBook}[]{XML}
- {morekeywords={abstract,address,affiliation,annotation,arg,
- author,book,chapter,classname,cmdsynopsis,command,
- constraintdef,contrib,copyright,cover,date,email,emphasis,
- envar,filename,firstname,footnote,guibutton,guilabel,
- guimenu,guimenuitem,guisubmenu,holder,info,itemizedlist,
- listitem,literal,member,option,orderedlist,orgdiv,orgname,
- package,para,parameter,part,personname,phrase,procedure,
- productname,programlisting,quote,refsection,remark,
- constructorsynopsis,methodparan,modifier,funcparams,olink,
- bibliography,biblioentry,biblioset,subtitle,artpagenums,
- volumenum,issuenum,DOCTYPE,SYSTEM,xml:id,releaseinfo,
- replaceable,revdescription,revhistory,revision,sect1,sect2,
- sect3,sect4,seg,seglistitem,segmentedlist,segtitle,
- simplelist,step,surname,systemitem,tag,term,title,uri,
- userinput,variablelist,varlistentry,wordasword,xref,year,
- xlink:href}}
-
- \makeatletter
- \lstdefinelanguage{bash}
- {morestring=[s]{[]},morekeywords={exit,logout,yes,no,@,
- password,ssh,URL,cd,dvips,latex,ls,makeindex,man,mkdir,
- pdflatex,sudo,texconfig,texdoc,updmap,xelatex,biber,
- latexmk,bibtex}}
-
- \makeatother
- \lstdefinelanguage{APA}[]{XML}
- {morekeywords={TTL}}
-
- \lstdefinelanguage{OOXML}[]{XML}
- {morekeywords={w:p,w:pPr,w:pStyle,w:rPr,w:rFonts,
- w:r,w:t,w:lang}}
-
- \lstdefinelanguage{SGML}[]{XML}
- {morekeywords={sec,ttl}}
-
- \lstdefinelanguage{DTD}[]{XML}
- {morekeywords={ELEMENT,ENTITY,ATTLIST,CDATA,ID,REQUIRED,
- IMPLIED,PCDATA}}
-
- \lstdefinelanguage{Runoff}
- {morekeywords={h1}}
-
- \lstdefinelanguage{GML}
- {morekeywords={h1}}
-
- \lstdefinelanguage{Scribe}
- {morekeywords={Heading},morestring=[s]{[]}}
-
- \lstdefinelanguage{RTF}[]{TeX}
- {moretexcs={rtf,ansi,deff,adeflang,fonttbl,f,froman,fprq,
- fcharset,f1,fswiss,falt,fnil,colortbl,red,green,blue,
- stylesheet,s,snext,nowidctlpar,hyphen,hyphlead,hyphtrail,
- hyphmax,cf,kerning,dbch,af,langfe,afs,alang,loch,fs,
- pgndec,pard,plain,qc,sb,sa,keepn,b,ab,rtlch,ltrch,par}}
-
- \lstdefinelanguage{TEI}[]{XML}
- {morekeywords={TEI,TEI.2,teiHeader,fileDesc,sourceDesc,
- titleStmt,title,author,editor,respStmt,resp,name,
- editionStmt,edition,text,body,publicationStmt,publisher,
- div,div1,placeName,lg,l,s,cl,phr,w,list,distinct,p,pb,
- mls,div2,head,num,val,app,lem,rdg,q,sup,uncl,note,
- DOCTYPE,SYSTEM,xml:id}}[keywords,comments,strings]
-
- \lstdefinelanguage{XSLT2}[]{XML}
- {morekeywords={xsl:stylesheet,xsl:transform,
- xsl:apply-imports,xsl:attribute-set,xsl:decimal-format,
- xsl:import,xsl:include,xsl:key,xsl:namespace-alias,
- xsl:output,xsl:param,
- xsl:preserve-space,xsl:strip-space,xsl:template,
- xsl:variable,xsl:character-map,xsl:function,
- xsl:import-schema,xsl:param,xsl:variable,
- xsl:apply-imports,xsl:apply-templates,xsl:attribute,
- xsl:call-template,xsl:choose,xsl:comment,xsl:copy,
- xsl:copy-of,xsl:element,xsl:fallback,xsl:for-each,
- xsl:if,xsl:message,xsl:number,xsl:otherwise,
- xsl:processing-instruction,xsl:text,xsl:value-of,
- xsl:variable,xsl:when,xsl:with-param,xsl:sort,
- xsl:for-each-group,xsl:next-match,xsl:analyze-string,
- xsl:namespace,xsl:result-document,xsl:copy,
- xsl:fallback,xsl:document,xsl:sequence,
- xsl:matching-substring,xsl:non-matching-substring,
- xsl:perform-sort,xsl:output-character},
- alsodigit={-}}
-
- \lstdefinelanguage{LaTeXe}[LaTeX]{TeX}
- {morekeywords = {selectlanguage,foreignlanguage,
- textbrokenbar,textlangle,textrangle,subsection,url,
- chapter,tableofcontents,part,subsubsection,paragraph,
- subparagraph,maketitle,setlength,listoffigures,
- listoftables,color,arraybackslash,includegraphics,
- textcite,parencite,graphicspath,lstinline,
- DeclareLanguageMapping,textcolor,definecolor,colorbox,
- fcolorbox,RequirePackage,PassOptionsToPackage}}
-
- \lstdefinelanguage{BIBTeX}{
- morekeywords = {title,author,edition,publisher,year,
- address},
- morestring=[b]",
- }
-
- \lstdefinelanguage{Email}{
- morekeywords={From,Subject,To,Date},
- }
-
- \lstset{defaultdialect=LaTeXe,frame=single,
- framesep=.5em,backgroundcolor=\color{AliceBlue},
- rulecolor=\color{LightSteelBlue},framerule=1pt}
-
- \lstloadlanguages{LaTeXe,DocBook,XML,XSLT2,bash}
- \lstdefinelanguage{XMLFRAG}{tag=**[s]<>}[html]
- \lstnewenvironment{listingsdoc}
- {\lstset{language={[LaTeX]TeX}}}
- {}
- \newcommand\basicdefault[1]{\footnotesize
- \color{Black}\ttfamily#1}
-
- \lstset{basicstyle=\basicdefault{\spaceskip.5em}}
- \lstset{literate=
- {§}{{\S}}1
- {©}{{\raisebox{.125ex}{\copyright}\enspace}}1
- {«}{{\guillemotleft}}1
- {»}{{\guillemotright}}1
- {Á}{{\'A}}1
- {Ä}{{\"A}}1
- {É}{{\'E}}1
- {Í}{{\'I}}1
- {Ó}{{\'O}}1
- {Ö}{{\"O}}1
- {Ú}{{\'U}}1
- {Ü}{{\"U}}1
- {ß}{{\ss}}2
- {à}{{\`a}}1
- {á}{{\'a}}1
- {ä}{{\"a}}1
- {é}{{\'e}}1
- {í}{{\'i}}1
- {ó}{{\'o}}1
- {ö}{{\"o}}1
- {ú}{{\'u}}1
- {ü}{{\"u}}1
- {¹}{{\textsuperscript1}}1
- {²}{{\textsuperscript2}}1
- {³}{{\textsuperscript3}}1
- {ı}{{\i}}1
- {—}{{---}}1
- {’}{{'}}1
- {…}{{\dots}}1
- {➝}{{$leftarrow$}}1
- {⮠}{{$\hookleftarrow$}}1
- {␣}{{\textvisiblespace}}1,
- keywordstyle=\color{DarkGreen}\bfseries,
- identifierstyle=\color{DarkRed},
- commentstyle=\color{Gray}\upshape,
- stringstyle=\color{DarkBlue}\upshape,
- emphstyle=\color{Chocolate}\upshape,
- showstringspaces=false,
- columns=fullflexible,
- keepspaces=true}
-\usepackage{makeidx}% used by default. (87)%
- \makeindex
-\usepackage{nicefrac}% used by default. (93)%
- \def\textonehalf{\ensuremath{\nicefrac12}}
-\usepackage{parskip}% requested by author (95)%
-\usepackage{sectsty}% requested by author (99)%
- \allsectionsfont{\sffamily\raggedright}
- \renewcommand*{\descriptionlabel}[1]{\hspace\labelsep
- \sffamily\bfseries #1}
-\usepackage[normalem]{ulem}% use of 'link' detected (105)%
-\usepackage{url}% use of 'uri' detected (106)%
- \AtBeginDocument{\urlstyle{tt}}
-\usepackage{varioref}% use of 'xref' detected (109)%
- \vrefwarning
- \labelformat{appendix}{Appendix~#1}
- \makeatletter
- \labelformat{chapter}{\@chapapp~#1}
- \makeatother
- \labelformat{section}{section~#1}
- \labelformat{subsection}{section~#1}
- \labelformat{subsubsection}{section~#1}
- \labelformat{paragraph}{section~#1}
- \labelformat{figure}{Figure~#1}
- \labelformat{table}{Table~#1}
- \labelformat{item}{item~#1}
- \renewcommand{\reftextcurrent}{elsewhere on this
- page}
- \def\reftextafter{on the
- \reftextvario{next}{following} page}
-\usepackage{xcolor}% used by default. (117)%
- \makeatletter
- \@ifundefined{T}{%
- \newcommand{\T}[2]{{\fontencoding{T1}%
- \selectfont#2}}}{}
- \makeatother
-\usepackage{classpack}[2020/05/19]% used by default. (122)%
-\makeatletter
-\newcommand{\SIL@doctype}{class}
-\newcommand{\SIL@docname}{bookshelf}
-\newcommand{\SIL@docowner}{Silmaril}
-\makeatother
-\addbibresource{bookshelf.bib}
-\allsectionsfont{\sffamily}
-%
-%%
-%% Settings for docstrip and ltxdoc
-%%
-\EnableCrossrefs
-\CodelineIndex
-\RecordChanges
-\begin{document}\raggedright
- \DocInput{bookshelf.dtx}
-\end{document}
-%</driver>
-% \fi
-%
-% \CheckSum{718}
-%
-% \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{v0.5}{2020/05/24}{Finished initial testing: Replaced hyperref with hypdoc to avoid makeindex bug.}
-% \changes{v0.4}{2020/05/19}{Completed documentation: 1) Updated note on bug in biber when processing sgml.bib; 2) Removed sgml.bib as example until problems are resolved; 3) Backtracked on attempt to use the monographic title for articles, chapters, etc; 4) Revised notes on production.}
-% \changes{v0.3}{2020/05/14}{Finished first pass on documentation: 1) Done preliminary testing; 2) Script adapted for Mac OS X.}
-% \changes{v0.2}{2020/05/12}{Started documentation: Code doc done, user doc still missing.}
-% \changes{v0.1}{2020/05/7}{First packaged draft: Done manually from .tex file.}
-%
-% \GetFileInfo{bookshelf.dtx}
-%
-% \DoNotIndex{\@,\@@par,\@beginparpenalty,\@empty}
-% \DoNotIndex{\@flushglue,\@gobble,\@input,\@makefnmark}
-% \DoNotIndex{\@makeother,\@maketitle,\@namedef,\@ne}
-% \DoNotIndex{\@spaces,\@tempa,\@tempb,\@tempswafalse}
-% \DoNotIndex{\@tempswatrue,\@thanks,\@thefnmark,\@topnum}
-% \DoNotIndex{\@@,\@elt,\@forloop,\@fortmp,\@gtempa}
-% \DoNotIndex{\@totalleftmargin,\",\/,\@ifundefined,\@nil}
-% \DoNotIndex{\@verbatim,\@vobeyspaces,\|,\~,\ ,\active}
-% \DoNotIndex{\advance,\aftergroup,\begingroup,\bgroup}
-% \DoNotIndex{\mathcal,\csname,\def,\documentstyle}
-% \DoNotIndex{\dospecials,\edef,\egroup,\else,\endcsname}
-% \DoNotIndex{\endgroup,\endinput,\endtrivlist}
-% \DoNotIndex{\expandafter,\fi,\fnsymbol,\futurelet,\gdef}
-% \DoNotIndex{\global,\hbox,\hss,\if,\if@inlabel}
-% \DoNotIndex{\if@tempswa,\if@twocolumn,\ifcase,\ifcat}
-% \DoNotIndex{\iffalse,\ifx,\ignorespaces,\index,\input}
-% \DoNotIndex{\item,\jobname,\kern,\leavevmode,\leftskip}
-% \DoNotIndex{\let,\llap,\lower,\m@ne,\next,\newpage}
-% \DoNotIndex{\nobreak,\noexpand,\nonfrenchspacing}
-% \DoNotIndex{\obeylines,\or,\protect,\raggedleft}
-% \DoNotIndex{\rightskip,\rm,\sc,\setbox,\setcounter}
-% \DoNotIndex{\small,\space,\string,\strut,\strutbox}
-% \DoNotIndex{\thefootnote,\thispagestyle,\topmargin}
-% \DoNotIndex{\trivlist,\tt,\twocolumn,\typeout,\vss,\vtop}
-% \DoNotIndex{\xdef,\z@,\,,\@bsphack,\@esphack,\@noligs}
-% \DoNotIndex{\@vobeyspaces,\@xverbatim,\`,\catcode,\end}
-% \DoNotIndex{\escapechar,\frenchspacing,\glossary}
-% \DoNotIndex{\hangindent,\hfil,\hfill,\hskip,\hspace,\ht}
-% \DoNotIndex{\it,\langle,\leaders,\long,\makelabel}
-% \DoNotIndex{\marginpar,\markboth,\mathcode,\mathsurround}
-% \DoNotIndex{\mbox,\newcount,\newdimen,\newskip}
-% \DoNotIndex{\nopagebreak,\parfillskip,\parindent}
-% \DoNotIndex{\parskip,\penalty,\raise,\rangle,\section}
-% \DoNotIndex{\setlength,\TeX,\topsep,\underline,\unskip}
-% \DoNotIndex{\verb,\vskip,\vspace,\widetilde,\\,\%,\@date}
-% \DoNotIndex{\@defpar,\[,\{,\},\],\count@,\ifnum,\loop}
-% \DoNotIndex{\today,\uppercase,\uccode,\baselineskip}
-% \DoNotIndex{\begin,\tw@,\a,\b,\c,\d,\e,\f,\g,\h,\i,\j,\k}
-% \DoNotIndex{\l,\m,\n,\o,\p,\q,\r,\s,\t,\u,\v,\w,\x,\y,\z}
-% \DoNotIndex{\A,\B,\C,\D,\E,\F,\G,\H,\I,\J,\K,\L,\M,\N,\O}
-% \DoNotIndex{\P,\Q,\R,\S,\T,\U,\V,\W,\X,\Y,\Z,\1,\2,\3,\4}
-% \DoNotIndex{\5,\6,\7,\8,\9,\0,\!,\#,\$,\&,\',\(,\)}
-% \DoNotIndex{\+,\.,\:,\;,\<,\=,\>,\?,\_,\discretionary}
-% \DoNotIndex{\immediate,\makeatletter,\makeatother}
-% \DoNotIndex{\meaning,\newenvironment,\par,\relax}
-% \DoNotIndex{\renewenvironment,\repeat,\scriptsize}
-% \DoNotIndex{\selectfont,\the,\undefined,\arabic,\do}
-% \DoNotIndex{\makeindex,\null,\number,\show,\write,\@ehc}
-% \DoNotIndex{\@author,\@ehc,\@ifstar,\@sanitize,\@title}
-% \DoNotIndex{\everypar,\if@minipage,\if@restonecol,\ifeof}
-% \DoNotIndex{\ifmmode,\lccode,\newtoks,\onecolumn,\openin}
-% \DoNotIndex{\p@,\SelfDocumenting,\settowidth}
-% \DoNotIndex{\@resetonecoltrue,\@resetonecolfalse,\bf}
-% \DoNotIndex{\clearpage,\closein,\lowercase,\@tempdima}
-% \DoNotIndex{\@inlabelfalse,\selectfont,\mathcode}
-% \DoNotIndex{\newmathalphabet,\rmdefault,\bfdefault}
-% \DoNotIndex{\DeclareRobustCommand,\@ifpackagewith}
-% \DoNotIndex{\SIL@doctype}
-% \DoNotIndex{\SIL@docname}
-% \DoNotIndex{\SIL@docowner}
-% \DoNotIndex{\SIL@svgcolname}
-% \DoNotIndex{\ifcase}
-% \DoNotIndex{\SIL@svgcolval}
-% \DoNotIndex{\addbibresource}
-% \DoNotIndex{\immediate}
-% \DoNotIndex{\input}
-% \DoNotIndex{\documentclass}
-% \DoNotIndex{\pagewidth}
-% \DoNotIndex{\raggedright}
-% \DoNotIndex{\name}
-% \DoNotIndex{\SIL@topauthor}
-% \DoNotIndex{\SIL@titleoneline}
-% \DoNotIndex{\makebook}
-% \DoNotIndex{\SILmfont}
-% \DoNotIndex{\SILmfontname}
-% \DoNotIndex{\vbox}
-% \DoNotIndex{\fcolorbox}
-% \DoNotIndex{\scalebox}
-% \setcounter{tocdepth}{5}
-% \setcounter{secnumdepth}{5}
-% \makeatletter
-% \def\@@doxdescribe#1#2{\endgroup \ifdox@noprint\else\marginpar{\raggedleft \textcolor{DarkRed}{\@nameuse{PrintDescribe#1}{#2}}}\fi \ifdox@noindex\else\@nameuse{Special#1Index}{#2}\fi \endgroup\@esphack\ignorespaces}
-% \makeatother
-%
-% \def\fileversion{0.5}
-% \def\filedate{2020/05/24}
-% \title{The \textsf{bookshelf} \LaTeXe\ document class\thanks{%
-% This document corresponds to \textsf{bookshelf}
-% \textit{v.}\ \fileversion $\beta$, dated \filedate.}
-% \\[1em]\Large
-% Turn your bibliography into a bookshelf image}
-% \author{Peter Flynn\\\normalsize Silmaril Consultants\\[-.25ex]\normalsize Instant Textual Gratification Division\\\normalsize(\url{peter@silmaril.ie})}
-% \maketitle
-% \renewcommand{\abstractname}{Summary}\thispagestyle{empty}
-% \begin{abstract}
-% \parskip=0.5\baselineskip
-% \advance\parskip by 0pt plus 2pt
-% \parindent=0pt% \noindent
-% The \textsf{bookshelf} package uses
-% \textsf{biblatex} and
-% \emph{biber} to turn a \BibTeX{}
-% bibliography file into a randomly-coloured, randomly-sized
-% shelf of books, with the title and author in a randomly-chosen
-% typeface. The image (converted to {\smaller JPEG} from
-% {\smaller PDF}) can then be used as a background in
-% \emph{Zoom},
-% \emph{Teams},
-% \emph{WhatsApp} etc video calls. It
-% requires a little preliminary work with the supplied script to
-% set up a list of all your fonts, a list of colors, and a list
-% of the \BibTeX{} entry names in your {\ttfamily{}.bib}
-% file, but otherwise should work on any modern \TeX{}
-% distribution.\par
-% \par\centering\includegraphics[width=.666\columnwidth]{myshelf.jpg}
-% \end{abstract}
-% \clearpage
-% \tableofcontents
-% \subsection*{Note on required and optional features}
-% In this document, the keywords
-% {\sffamily {\smaller MUST}}, {\sffamily {\smaller MUST NOT}}, {\sffamily {\smaller REQUIRED}},
-% {\sffamily {\smaller SHALL}}, {\sffamily {\smaller SHALL NOT}}, {\sffamily {\smaller SHOULD}},
-% {\sffamily {\smaller SHOULD NOT}},
-% {\sffamily {\smaller RECOMMENDED}},
-% {\sffamily {\smaller MAY}}, and
-% {\sffamily {\smaller OPTIONAL}} have a specific
-% meaning when shown in {\sffamily {\smaller THIS TYPESTYLE}}, and
-% {\sffamily {\smaller MUST}} be interpreted as described in
-% RFC 2119 \parencite{rfc2119}.\par
-% When shown in normal type, these words keep their conventional
-% contextual degree of meaning.\par
-% \clearpage
-% \section*{Latest changes}
-% \subsection*{v.0.5 (2020-05-24)}
-% \paragraph*{Finished initial testing}
-% \begin{itemize}
-% \item Replaced \textsf{hyperref}
-% with \textsf{hypdoc} to avoid
-% \emph{makeindex} bug\par
-% \end{itemize}
-% \subsection*{v.0.1 (2020-05-7)}
-% \paragraph*{First packaged draft}
-% \begin{itemize}
-% \item Done manually from .tex file\par
-% \end{itemize}
-% \subsection*{v.0.4 (2020-05-19)}
-% \paragraph*{Completed documentation}
-% \begin{itemize}
-% \item Updated note on bug in
-% \emph{biber} when processing
-% {\ttfamily{}sgml.bib}\par
-% \item Removed {\ttfamily{}sgml.bib} as example
-% until problems are resolved\par
-% \item Backtracked on attempt to use the monographic
-% title for articles, chapters, etc\par
-% \item Revised notes on production\par
-% \end{itemize}
-% \subsection*{v.0.3 (2020-05-14)}
-% \paragraph*{Finished first pass on documentation}
-% \begin{itemize}
-% \item Done preliminary testing\par
-% \item Script adapted for Mac OS X\par
-% \end{itemize}
-% See p.\thinspace\pageref{changehistory} for earlier changes.
-% \subsection*{Acknowledgments}
-% Thanks to many people for the original
-% suggestion; and to Isabel Yorke, Bethan Tovey-Walsh,
-% Nelson Beebe, The \LaTeX{} Ninja, Stephan Lukasczyk,
-% and others for their thesis bibliographies and
-% testing comments.\par
-% \clearpage
-% \section{Documentation}
-% During the era of the
-% {\smaller COVID-19} lockdown, the popularity
-% of group video messaging grew rapidly, both for
-% business and domestic use. As people sought for what
-% they believed to be more representative backgrounds
-% than a messy kitchen, an untidy workroom, or a
-% sterile blank wall, a well-populated bookshelf was a
-% frequent choice.\par
-% This package is for those who cannot use (or
-% don't have, or don't want to use) such a bookshelf,
-% but can still lay their hands on a bibliography or
-% reference list in \BibTeX{} format — perhaps from a
-% recent or long-forgotten thesis, book, article, or
-% other document.\par
-% \par\begingroup
-% \fboxsep1em\centering
-% \fbox{\begin{minipage}{0.8\columnwidth}\sffamily
-% \raggedright\parindent0pt
-% \parskip=.5\baselineskip
-% \subsubsection*{\sffamily \XeLaTeX{} and \textsf{biblatex} and
-% \emph{biber}}
-% To avoid problems with accented and other
-% characters, and to make it easier to maintain,
-% this document class uses only \XeLaTeX{} and
-% \textsf{biblatex} and
-% \emph{biber}.\par
-% It will not work with the
-% \emph{pdflatex} or
-% \emph{bibtex} programs, and it does not
-% use the {\ttfamily{}.bst} files of old
-% \BibTeX{}.\par
-% \end{minipage}}\par\endgroup
-% This is a work-in-progress: there are bugs (see \vref{bugs}).\par
-% \subsection{What the package does}
-% The \textsf{bookshelf} package
-% generates what looks like shelves of book spines
-% from your list of references, using random
-% dimensions (within specified limits) in random but
-% contrasting colors, with a randomly-selected
-% typeface.\par
-% It does this by creating a box (rectangle) for each
-% entry in your list, assigning colors to the background and
-% foreground, deciding on the layout and font, and then
-% stacking the boxes side-by-side as if they were letters on a
-% line.\par
-% \subsection{Preparation}
-% To get things ready for this, you need to install this
-% document class, and provide the following files.\par
-% \begin{enumerate}
-% \item Your \BibTeX{} file;
-% \item A list of all the entry values;
-% \item A list of all your usable text fonts;
-% \item A command defining how many such fonts;
-% \item A list of all the colors to choose from.
-% \end{enumerate}
-% These are explained in more detail in the subsections
-% below.\par
-% All but the first of these can be generated by the
-% supplied shell script {\ttfamily{}prepdata.sh}. This
-% works on UNIX/GNU Linux and on Apple Mac OS X, and may work
-% in CygWin, but needs more work for plain Windows.\par
-% \subsubsection{Your \BibTeX{} file}
-% Your \BibTeX{} ({\ttfamily{}.bib}) file,
-% suitable for use with \emph{biber}
-% rather than \emph{bibtex}.\par
-% Old \BibTeX{} files will work, but possibly not
-% optimally: if you want to update them, see \vref{bibchanges} for what to edit; but this is not
-% needed for this class.\par
-% One thing that may help is to replace all the
-% old-style symbolic notation accented characters like
-% \verb|{\"a}| for
-% `ä' and
-% \verb|{\l}| for
-% `ł'. Not only is the symbolic
-% notation no longer needed because \XeLaTeX{} and the
-% \emph{biber} program handle
-% {\smaller UTF-8} characters, which the old
-% \emph{bibtex} program doesn't; the
-% discipline of replacing helps to reduce the problem of
-% unmatched curly braces, which is one of the biggest
-% sources of errors in \BibTeX{} files.\par
-% If you have a bibliography in
-% \emph{EndNote},
-% \emph{Mendeley},
-% \emph{Zotero},
-% \emph{ProCite},
-% \emph{Reference Manager},
-% etc, you should be able to export it in either
-% \BibTeX{} or {\smaller RIS} format. A
-% {\smaller RIS} file can easily be
-% converted to \BibTeX{} by opening it in
-% \emph{JabRef} and saving it
-% as \BibTeX{}.\par
-% \subsubsection{Entry values}
-% A list of all the entry values from your \BibTeX{} file
-% (the unique names immediately after the document type),
-% each given as the argument to a
-% \verb|\makebook}{...}| command in a file called
-% {\ttfamily{}entries.tex}.\par
-% \subsubsection{Font file list}\label{fontfiles}
-% A set of 1–line files in a subdirectory called
-% {\ttfamily{}fontsel} representing of all the
-% usable text fonts on your system that you wish to use;
-% that is, excluding broken or partial fonts, symbols, math,
-% non-Latin characters or alphabets, and display or non-text
-% fonts.\par
-% Each file {\sffamily {\smaller MUST}} be
-% numbered sequentially in its name (eg
-% {\ttfamily{}1.tex}, {\ttfamily{}2.tex},
-% {\ttfamily{}3.tex}, etc) and
-% {\sffamily {\smaller MUST}} contain a
-% \verb|\newfontface{SILmfont}{...}| command for
-% the font name \emph{and} a definition of its
-% name in a \verb|\SILmfontname{...}| command
-% (see the examples generated by the
-% {\ttfamily{}prepdata.sh} script). Be aware that
-% many fonts on your system may not be suitable for setting
-% normal text: see the comments in the script\par
-% These files are entirely dependent on your system
-% because everyone has a different set of fonts.\par
-% \subsubsection{Maximum number of fonts}
-% A file called {\ttfamily{}pickfont.tex}
-% containing a
-% \verb|\setcounter{SIL@maxfont}{...}| command to
-% set the total number of the fonts which are represented in
-% the {\ttfamily{}fontsel} subdirectory above\par
-% \subsubsection{List of colors}
-% A list of all the colors represented by the
-% {\smaller SVG} palette used by the
-% \textsf{xcolor} package: the file created by
-% the script is called {\ttfamily{}svgnam.tex}.
-% This contains three definitions:\par
-% \begin{enumerate}
-% \item the command {\ttfamily{}\textbackslash{}SIL@svgcolname}
-% which uses an {\ttfamily{}\textbackslash{}ifcase} command to
-% return the name of the \emph{n}th color
-% in alphabetical order;\par
-% \item the command {\ttfamily{}\textbackslash{}SIL@svgcolval} which
-% does the same to return the brightness value of that
-% color, computed by the formula on \vpageref{bright} (see script for
-% details);\par
-% \item the counter {\ttfamily{}SIL@maxcolno} which holds
-% the number of colors available.\par
-% \end{enumerate}
-% \subsection{Producing your bookshelf}
-% This class comes with a file
-% {\ttfamily{}test.tex} which you can use to test your
-% file of references. It is initially set just to make the
-% {\ttfamily{}test.aux} file that
-% \emph{biber} needs to create your
-% {\ttfamily{}test.bbl} bibliography file; that is, it
-% will \emph{not} try to run the shell script
-% \emph{or} to create a bookshelf the first time
-% round, until everything else is ready.\par
-% \begin{enumerate}
-% \item Run the shell script with your
-% {\ttfamily{}.bib} filename as the argument,
-% eg;
-% \iffalse
-%<*ignore>
-% \fi
-\begin{lstlisting}[language={[LaTeX]TeX}]
-$ ./prepdata.sh mythesis.bib
-\end{lstlisting}
-% \iffalse
-%</ignore>
-% \fi
-% \item Edit the {\ttfamily{}test.tex} file and
-% change the name of the {\ttfamily{}.bib} file in
-% the {\ttfamily{}\textbackslash{}addbibresource} command to the
-% name of your own file\par
-% Leave the two lines {\ttfamily{}\textbackslash{}immediate} and
-% {\ttfamily{}\textbackslash{}input} commented out for the
-% moment;
-% \item Delete any {\ttfamily{}test.aux} or
-% {\ttfamily{}test.bbl} files in the directory in
-% which you are doing this;
-% \item Typeset the test file with \XeLaTeX{}. You should get
-% three messages:\par
-% \iffalse
-%<*ignore>
-% \fi
-\begin{lstlisting}[language={[LaTeX]TeX}]
-LaTeX Warning: Empty bibliography on input line 12.
-LaTeX Warning: There were undefined references.
-Package biblatex Warning: Please (re)run Biber on the file:
-(biblatex) test
-(biblatex) and rerun LaTeX afterwards.
-\end{lstlisting}
-% \iffalse
-%</ignore>
-% \fi
-% \item Process the test file with
-% \emph{biber}
-% (\emph{not} \emph{bibtex}). You will probably
-% get many warning messages: ignore them. If you get a
-% fatal error, however, you will need to find the problem
-% in your {\ttfamily{}.bib} file and fix it before
-% going any further.\par
-% See also the known bug at item~\ref{sgmlbib} in the list on p.\thinspace\pageref{sgmlbib};
-% \item Edit the test file and
-% \emph{un}comment the line starting
-% {\ttfamily{}\textbackslash{}input}, save the file, and retypeset
-% it twice.
-% \end{enumerate}
-% You should now have a {\smaller PDF} bookshelf!
-% The books are in the order in which they appear in your
-% {\ttfamily{}.bib} file because the script creates
-% the list of entries to process in that order, regardless of
-% what \emph{biblatex} or
-% \emph{biber} are configured to
-% do.\par
-% \subsubsection{Options}
-% The class comes set for making an
-% \textbf{\texttt{a0paper}} page (1189 mm × 841 mm
-% or 4′ 11″ × 2′ 10″) in
-% \textbf{\texttt{landscape}} mode, suitable for
-% large bibliographies. If you have a smaller
-% {\ttfamily{}.bib} file, or if you want
-% fewer volumes per page, you can change the paper
-% size option in the
-% {\ttfamily{}\textbackslash{}documentclass} command to a
-% smaller one: all the `A'
-% sizes from 5 to 0 are supported, plus the common
-% US office sizes including Ledger (Tabloid).\par
-% There is also a \textbf{\texttt{portrait}} option to
-% produce the page in that format instead of
-% landscape.\par
-% \subsection{Changes between \BibTeX{} fields and
-% \emph{biblatex}}\label{bibchanges}
-% This has been expanded from the description provided in
-% \href{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf\#page=33}{§2.3
-% of the online documentation for
-% \textsf{biblatex}} v3.14 (1 December
-% 2019).\par
-% This is for information only. You do not need to do any
-% of this to use the \index{bookshelf=\textsf{bookshelf} (class)}\textsf{bookshelf} document
-% class unless you encounter errors processing your
-% {\ttfamily{}.bib} file.\par
-% \begin{enumerate}
-% \item The entry type {\ttfamily{}@inbook}
-% (basically only use this where each chapter of the book
-% is written by a different author). See \href{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf\#page=8}{§2.1.1}
-% and \href{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf\#page=33}{§2.3.1}
-% for details.\par
-% \item Replace {\ttfamily{}school} with {\ttfamily{}institution} for theses;
-% replace {\ttfamily{}publisher} with {\ttfamily{}organization} for manuals
-% and conference sponsors;
-% and replace {\ttfamily{}address} with {\ttfamily{}location}. See \href{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf\#page=17}{§2.2.2},
-% \href{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf\#page=32}{§2.2.5},
-% and \href{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf\#page=34}{§2.3.4}
-% for details.\par
-% \item The handling of certain types of titles. See \href{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf\#page=35}{§2.3.5}
-% for details. Replace {\ttfamily{}journal} with
-% {\ttfamily{}journaltitle} in {\ttfamily{}@article} entries.\par
-% \item The field {\ttfamily{}series}: only
-% use it for journal series; for the main title of
-% multi-volume works use {\ttfamily{}maintitle}.
-% See \href{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf\#page=17}{§2.2.2}
-% and \href{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf\#page=37}{§2.3.7}
-% for details.\par
-% \item The fields {\ttfamily{}year} and {\ttfamily{}month} must be
-% integers; {\ttfamily{}month} {\sffamily {\smaller MUST NOT}} be
-% alphabetic. The field {\ttfamily{}date} {\sffamily {\smaller MUST}} be an
-% {\smaller ISO} 8601 date in the format
-% {\ttfamily{}yyyy-mm-dd}. See \href{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf\#page=17}{§2.2.2},
-% \href{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf\#page=38}{§2.3.8},
-% and \href{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf\#page=39}{§2.3.9}
-% for details.\par
-% \item The field {\ttfamily{}edition} must
-% be an integer with no ordinal indicator or abbreviation
-% `ed'. See \href{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf\#page=17}{§2.2.2}
-% for details.\par
-% \item Replace {\ttfamily{}key} with
-% {\ttfamily{}label}. See \href{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf\#page=33}{§2.3.2}
-% for details.\par
-% \end{enumerate}
-% Most of this is for creating new entries. For converting
-% \BibTeX{} files for use with
-% \emph{biblatex}, just change the field
-% names as in items 2, 3, 4, and 7; and make sure your months
-% and editions are integers.\par
-% \subsection{Bugs}\label{bugs}
-% Some things don't yet work as they should, and
-% there are some features that may or may not make
-% the final cut.\par
-% \begin{enumerate}
-% \item The shell script doesn't run on Windows
-% because I don't have any Windows. If someone
-% would write some Powershell I could include it
-% in a later version.\par
-% \item There is no conscious
-% `line'-breaking when a
-% row of books comes to the
-% {\ttfamily{}\textbackslash{}pagewidth}, and as it is
-% deliberately set
-% {\ttfamily{}\textbackslash{}raggedright} (because you
-% can't hyphenate a book and variable space
-% between books seems to be a silly idea), there
-% is no filler at the ends of lines to complete
-% the `shelf' (which is
-% in any case just a bar below each
-% book).\par
-% \item \label{sgmlbib}A test with a bibliography file from
-% Nelson Beebe's collection
-% ({\ttfamily{}sgml.bib}) generated a
-% {\ttfamily{}test.bbl} with a missing
-% closing curly brace, terminating (or rather,
-% failing to terminate) the
-% {\ttfamily{}\textbackslash{}name} command for an entry.
-% This appears to be a known bug in
-% \emph{biber} which is
-% being fixed in the version 2.15.\par
-% \item There seems to be a recurrent problem with
-% certain entries and certain fonts where the
-% length of the title is measured as 0.0pt which
-% causes an unresolvable problem for the routine
-% which assigns space and layout. Any
-% suggestions as to why this occurs are
-% welcomed.\par
-% \item The objective of the field re-expressions
-% (see \vref{fields}) was to make sure the book
-% spine for journal {\ttfamily{}@article}, {\ttfamily{}@incollection}, and
-% {\ttfamily{}@inbook} entry
-% types reflected the \emph{book}
-% or \emph{journal} title, not the
-% title of the article or chapter. This may or
-% may not be a good idea.\par
-% \item During development, it became obvious that
-% the number of fonts on many systems can be
-% very large. The
-% {\ttfamily{}prepdata.sh} script
-% currently includes the exclusions I made on
-% {\smaller UNIX}/{\smaller GNU}
-% Linux and Apple Mac {\smaller OS X} in
-% order to get a set of fonts that did not issue
-% errors (bearing in mind we are using
-% \textsf{fontspec}, so for simplicity
-% the script deals only with TrueType and
-% OpenType fonts, not Postscript Type 1 or
-% Type 3, or font packaging systems like
-% \emph{Suitcase} or True
-% Type Collections). I am not aware of any
-% easily-accessible machine-readable list or
-% {\smaller API} for identifying normal
-% text fonts by name (there are commercial
-% databases but that is outside the scope of
-% this document class).\par
-% \end{enumerate}
-% \StopEventually{\label{endcode}%
-% \clearpage
-% \newgeometry{left=3cm}%
-% \addcontentsline{toc}{section}{Change History}%
-% \label{changehistory}%
-% \PrintChanges
-% \clearpage
-% \label{codeindex}%
-% \addcontentsline{toc}{section}{Index}%
-% \PrintIndex}
-% \addtolength{\CPKrevmarg}{\widthof{\LabelFont{AddToShipoutPictureBG}}}
-% \newgeometry{left=\CPKrevmarg}
-% \message{Margin reset to \the\CPKrevmarg, to fit <AddToShipoutPictureBG>}
-% \iffalse
-%<*class>
-% \fi
-% \clearpage
-% \section{Implementation}\label{setup}
-% \par
-% \subsection{Auto-initialisation}\label{setup:autoinit}
-% This section is added automatically by \textit{ClassPack}
-% as a preamble to all classes and style packages.
-% The \textsf{fixltx2e} package, which used to be included
-% automatically, is no longer preloaded, as its
-% features are now a part of the latest \LaTeXe\ kernel.\par
-% The code starts with identity and requirements which are
-% generated automatically as needed by the Doc\TeX\ system.
-% For details see the \textsf{ltxdoc} package documentation.
-% \par\smallskip
-% \begingroup\color{DarkRed}\footnotesize
-% \leavevmode\enspace{\scriptsize1}\quad{\ttfamily\textbackslash NeedsTeXFormat\{LaTeX2e\}[2017/04/15]}\\
-% \leavevmode\enspace{\scriptsize2}\quad{\ttfamily\textbackslash ProvidesClass\{bookshelf\}[2020/05/24 v0.5}\\
-% \leavevmode\enspace{\scriptsize3}\qquad{\ttfamily Turn your bibliography into a bookshelf image]}\\\endgroup
-% \setcounter{CodelineNo}{3}
-% \begin{CPK@package}{fix-cm}
-% Preloaded functions to override the default \LaTeX\
-% step-size font sizes (which can still be used,
-% but are no longer restrictions).\par
-% \begin{macrocode}
-\RequirePackage{fix-cm}
-% \end{macrocode}
-% \end{CPK@package}
-% \begin{CPK@option}{svgnames}
-% Pass the \textbf{\texttt{svgnames}} option to the
-% \textsf{xcolor} package if that gets loaded later.
-% This avoids a conflict with any other packages
-% (eg \textsf{hyperref}) which use their own default
-% is when they load \textsf{xcolor}.\par
-% \begin{macrocode}
- \PassOptionsToPackage{svgnames}{xcolor}
-% \end{macrocode}
-% \end{CPK@option}
-% \subsection{Options}\label{options}
-% \iffalse
-%%
-%% ******************************************************************
-%%
-%% Options
-% \fi
-% The paper size and orientation are the only two valid
-% options, both of which are the same as the standard
-% documentclass options, and will be passed to the underlying
-% class automatically, but they need recording so that they
-% can be used by the \textsf{geometry}
-% package. The default is for A0 paper, landscape.\par
-% \begin{macrocode}
-\def\SIL@paper{a0paper}%
-\DeclareOption{a0paper}{%
- \def\SIL@paper{a0paper}%
- \setlength\paperheight {1189mm}%
- \setlength\paperwidth {841mm}}
-\DeclareOption{a1paper}{%
- \def\SIL@paper{a1paper}%
- \setlength\paperheight {841mm}%
- \setlength\paperwidth {594mm}}
-\DeclareOption{a2paper}{%
- \def\SIL@paper{a2paper}%
- \setlength\paperheight {594mm}%
- \setlength\paperwidth {420mm}}
-\DeclareOption{a3paper}{%
- \def\SIL@paper{a3paper}%
- \setlength\paperheight {420mm}%
- \setlength\paperwidth {297mm}}
-\DeclareOption{a4paper}{%
- \def\SIL@paper{a4paper}%
- \setlength\paperheight {297mm}%
- \setlength\paperwidth {210mm}}
-\DeclareOption{a5paper}{%
- \def\SIL@paper{a5paper}%
- \setlength\paperheight {210mm}%
- \setlength\paperwidth {148mm}}
-\DeclareOption{b5paper}{%
- \def\SIL@paper{b5paper}%
- \setlength\paperheight {250mm}%
- \setlength\paperwidth {176mm}}
-\DeclareOption{letterpaper}{%
- \def\SIL@paper{letterpaper}%
- \setlength\paperheight {11in}%
- \setlength\paperwidth {8.5in}}
-\DeclareOption{legalpaper}{%
- \def\SIL@paper{legalpaper}%
- \setlength\paperheight {14in}%
- \setlength\paperwidth {8.5in}}
-\DeclareOption{executivepaper}{%
- \def\SIL@paper{executivepaper}%
- \setlength\paperheight {10.5in}%
- \setlength\paperwidth {7.25in}}
-\DeclareOption{ledgerpaper}{%
- \def\SIL@paper{ledgerpaper}%
- \setlength\paperheight {17in}%
- \setlength\paperwidth {11in}}
-\DeclareOption{tabloidpaper}{%
- \def\SIL@paper{tabloidpaper}%
- \setlength\paperheight {17in}%
- \setlength\paperwidth {11in}}
-\def\SIL@orient{landscape}%
-\DeclareOption{landscape}{%
- \def\SIL@orient{landscape}%
- \setlength\@tempdima {\paperheight}%
- \setlength\paperheight {\paperwidth}%
- \setlength\paperwidth {\@tempdima}}
-\DeclareOption{portrait}{%
- \def\SIL@orient{}}
-% \end{macrocode}
-% \subsection{Load the document base class}\label{classload}
-% \iffalse
-%%
-%% ******************************************************************
-%%
-%% Load the document base class
-% \fi
-% This class is based on the standard \LaTeX{}
-% \DescribeClass{report}\textsf{report} class, with no special options
-% except the extra sizes defined above. The default is A0
-% paper, landscape.\par
-% \begin{macrocode}
-\DeclareOption*{\ClassWarning{bookshelf}{%
- Unknown option `\CurrentOption', please RTFM}}
-\ProcessOptions\relax
-\LoadClass{report}
-% \end{macrocode}
-%\iffalse
-%%
-%% Packages required for the class or package
-%%
-% \fi
-% \subsection{Packages required for the class or
-% package}\label{clspackages}
-% \begin{CPK@package}{fontspec}
-% Font specification setup for use with \XeLaTeX{}.
-% \iffalse
-%% Font specification setup for use with \XeLaTeX{}.
-% \fi
-% \begin{macrocode}
-\RequirePackage{fontspec}%
-% \end{macrocode}
-% \end{CPK@package}
-% \begin{CPK@package}{calc}
-% Required for calculations involving lengths or counters,
-% such as changes to widths for margin adjustment.
-% \iffalse
-%% Required for calculations involving lengths or counters, such as changes to widths for margin adjustment.
-% \fi
-% \begin{macrocode}
-\RequirePackage{calc}%
-% \end{macrocode}
-% \end{CPK@package}
-% \begin{CPK@package}{fp}
-% Used for fixed-point calculations;
-% \iffalse
-%% Used for fixed-point calculations
-% \fi
-% \begin{macrocode}
-\RequirePackage{fp}%
-% \end{macrocode}
-% \end{CPK@package}
-% \begin{CPK@package}{graphicx}
-% Provide for graphics (PNG, JPG, or PDF format (only) for
-% pdflatex; EPS format (only) for standard \LaTeX{}).
-% \iffalse
-%% Provide for graphics (PNG, JPG, or PDF format (only) for pdflatex; EPS format (only) for standard \LaTeX{}).
-% \fi
-% \begin{macrocode}
-\RequirePackage{graphicx}%
-% \end{macrocode}
-% \end{CPK@package}
-% \begin{CPK@package}{xcolor}
-% Provide color.
-% \iffalse
-%% Provide color.
-% \fi
-% \begin{macrocode}
-\RequirePackage{xcolor}%
- \@ifundefined{T}{%
- \newcommand{\T}[2]{{\fontencoding{T1}%
- \selectfont#2}}}{}
-% \end{macrocode}
-% There seems to be a bug in the T1 encoding of some package
-% (unidentified, but possibly \textsf{xcolor}) which
-% uses the command {\ttfamily{}\textbackslash{}T1}, which is an
-% impossibility (no digits allowed in command names). So we fake
-% it here to stop \LaTeX{} complaining, by dropping the first
-% argument on the floor.
-% \end{CPK@package}
-% \begin{CPK@package}{eso-pic}
-% Add picture commands (or backgrounds) to every page.
-% \iffalse
-%% Add picture commands (or backgrounds) to every page.
-% \fi
-% \begin{macrocode}
-\RequirePackage{eso-pic}%
-% \end{macrocode}
-% \end{CPK@package}
-% \begin{CPK@package}{geometry}
-% Package for establishing margins and text area.
-% \iffalse
-%% Package for establishing margins and text area.
-% \fi
-% \begin{macrocode}
-\RequirePackage[\SIL@paper,\SIL@orient,nohead,
- nofoot,margin=1cm]{geometry}%
-% \end{macrocode}
-% \end{CPK@package}
-% \begin{CPK@package}{biblatex}
-% Use \textsf{biblatex} instead of \BibTeX{};
-% \iffalse
-%% Use biblatex instead of \BibTeX{}
-% \fi
-% \begin{macrocode}
-\RequirePackage[backend=biber,style=authoryear,
- doi=true,isbn=true,url=true,uniquename=false]{biblatex}%
- \AtBeginDocument{%
- \setlength{\bibitemsep}{1ex}%
- \setlength{\bibnamesep}{1.5\itemsep}%
- \defbibheading{shortbib}[References]%
- {\section{#1}}}
- \@ifpackagewith{babel}{british}{%
- \DeclareLanguageMapping{british}%
- {british-apa}}{\relax}
- \providetoggle{blx@skipbiblist}
-% \end{macrocode}
-% \end{CPK@package}
-%
-% \subsection{Non-package resources}
-% \iffalse
-%%
-%% ******************************************************************
-%%
-%% Non-package resources
-% \fi
-% \begin{CPK@file}{random.tex}\label{file--random.tex}
-% There is one resource not available in packaged form,
-% the module that lets \LaTeX{} create random values. This is
-% in {\ttfamily{}random.tex}, which on the author's
-% system is hiding in a directory
-% {\ttfamily{}texmf/tex/generic/genmisc/}, in the
-% {\ttfamily{}texmf-dist} tree, and indexed by an
-% {\ttfamily{}ls-R} database, so it should therefore
-% be findable by any \TeX{} system.\par
-% \begin{macrocode}
-\input{random.tex}
-% \end{macrocode}
-% \end{CPK@file}
-% \subsection{The code}
-% \iffalse
-%%
-%% ******************************************************************
-%%
-%% The code
-% \fi
-% This is beta software: the code is messy and covered in
-% tracing output.\par
-% \subsubsection{Font selection}\label{fonts}
-% \begin{CPK@counter}{maxfont}\label{counter--maxfont}
-% This is set in the {\ttfamily{}\textbackslash{}input} file
-% {\ttfamily{}pickfont.tex}, which is created by
-% the preparatory data script
-% {\ttfamily{}prepdata.sh}. It is the number of
-% working text fonts found on the system.\par
-% \begin{macrocode}
-\newcounter{SIL@maxfont}
-% \end{macrocode}
-% \end{CPK@counter}
-% \begin{CPK@counter}{SIL@fontsel}\label{counter--SIL@fontsel}
-% This is set to a random number between one and
-% \DescribeCounter{SIL@maxfont}{\ttfamily{}SIL@maxfont}, and used as the
-% name of the file containing the font name.\par
-% \begin{macrocode}
-\newcounter{SIL@fontsel}
-% \end{macrocode}
-% \end{CPK@counter}
-% \begin{CPK@file}{pickfont.tex}\label{file--pickfont.tex}
-% This file is created by the preparatory data script
-% {\ttfamily{}prepdata.sh} after it sets up the
-% subdirectory list of valid text fonts. It sets the value
-% of \DescribeCounter{SIL@maxfont}{\ttfamily{}SIL@maxfont}.\par
-% \begin{macrocode}
-\input{pickfont.tex}
-% \end{macrocode}
-% \end{CPK@file}
-% \subsubsection{Color selection}\label{color}
-% \begin{CPK@counter}{SIL@maxcolno}\label{counter--SIL@maxcolno}
-% This value is set at the end of the file
-% {\ttfamily{}svgnam.tex}. This is the number of
-% color names found by the routine in
-% {\ttfamily{}prepdata.sh} which extracts the color
-% names.\par
-% \begin{macrocode}
-\newcounter{SIL@maxcolno}
-% \end{macrocode}
-% \end{CPK@counter}
-% \begin{CPK@file}{svgnam.tex}\label{file--svgnam.tex}
-% The preparatory data script
-% {\ttfamily{}prepdata.sh} retrieves the colors named
-% in the \textbf{\texttt{svgnames}} option to the
-% \textsf{xcolor} package and instantiates them
-% as a \LaTeX{} {\ttfamily{}\textbackslash{}ifcase} list in the file
-% {\ttfamily{}svgnam.tex} as the command
-% {\ttfamily{}\textbackslash{}SIL@svgcolname}.\par
-% \begin{macrocode}
-\input{svgnam.tex}
-% \end{macrocode}
-% \end{CPK@file}
-% \begin{CPK@counter}{SIL@loopcount}\label{counter--SIL@loopcount}
-% The random font selection is done in a loop because
-% of the need to test the values. This counter counts the
-% iterations…\par
-% \begin{macrocode}
-\newcounter{SIL@loopcount}
-% \end{macrocode}
-% \end{CPK@counter}
-% \begin{CPK@counter}{SIL@maxloop}\label{counter--SIL@maxloop}
-% …and this one the limit.\par
-% \begin{macrocode}
-\newcounter{SIL@maxloop}
-% \end{macrocode}
-% \end{CPK@counter}
-% \begin{CPK@counter}{SIL@bgcolno}\label{counter--SIL@bgcolno}
-% The colors are selected numerically. This value is
-% the background color of the spine of a book.\par
-% \begin{macrocode}
-\newcounter{SIL@bgcolno}
-% \end{macrocode}
-% \end{CPK@counter}
-% \begin{CPK@counter}{SIL@fgcolno}\label{counter--SIL@fgcolno}
-% And this is the foreground color, used to typeset
-% the title and author on the spine of a book.\par
-% \begin{macrocode}
-\newcounter{SIL@fgcolno}
-% \end{macrocode}
-% \end{CPK@counter}
-% \begin{CPK@length}{\splitpoint}\label{length--splitpoint}
-% To make sure that \DescribeCounter{SIL@bgcolno}{\ttfamily{}SIL@bgcolno} and \DescribeCounter{SIL@fgcolno}{\ttfamily{}SIL@fgcolno}
-% are distinct, we will need to pick one
-% `dark' and one
-% `light', crudely distinguished by
-% examining their `brightness'
-% (monochrome intensity value) using the formula
-% \label{bright}\(b=\sqrt(.241r^2+.691g^2+.068b^2)\) due to \href{https://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx}{Nir
-% Dobovizki}. From inspection, the modal point of
-% the {\smaller SVG} values occurs around 0.6, so
-% use use this to determine if the randomly-selected color
-% is `dark' or
-% `light'. Because it's a decimal
-% fraction, we express it as a dimension and strip off the
-% `pt' later.\par
-% \begin{macrocode}
-\newlength{\SIL@splitpoint}
-\setlength{\SIL@splitpoint}{0.6pt}
-% \end{macrocode}
-% \end{CPK@length}
-% \begin{CPK@macro}{\SIL@bgcol}\label{macro--SIL@bgcol}
-% We establish defaults for the background color…\par
-% \begin{macrocode}
-\def\SIL@bgcol{White}
-% \end{macrocode}
-% \end{CPK@macro}
-% \begin{CPK@macro}{\SIL@fgcol}\label{macro--SIL@fgcol}
-% …and the foreground color.\par
-% \begin{macrocode}
-\def\SIL@fgcol{Black}
-% \end{macrocode}
-% \end{CPK@macro}
-% \begin{CPK@length}{\SIL@bgval}\label{length--SIL@bgval}
-% The values computed by the
-% {\ttfamily{}prepdata.sh} script and stored in
-% {\ttfamily{}svgnam.tex} are decimal fractions,
-% to they need to be retrieved as lengths. This is the
-% background value…\par
-% \begin{macrocode}
-\newlength{\SIL@bgval}
-% \end{macrocode}
-% \end{CPK@length}
-% \begin{CPK@length}{\SIL@fgval}\label{length--SIL@fgval}
-% …and the foreground value.\par
-% \begin{macrocode}
-\newlength{\SIL@fgval}
-% \end{macrocode}
-% \end{CPK@length}
-% \begin{CPK@length}{\SIL@bgfgdiff}\label{length--SIL@bgfgdiff}
-% The `dark' or
-% `light' test discussed above also
-% needs to test if the values are too close to the
-% splitpoint. By examination, if the values have an
-% absolute difference of 0.2 they should be visually
-% distinct enough. The difference is calculated and stored
-% in this length variable, as it's a decimal fraction.\par
-% \begin{macrocode}
-\newlength{\SIL@bgfgdiff}
-% \end{macrocode}
-% \end{CPK@length}
-% \begin{CPK@switch}{\SIL@notyetcols}\label{switch--SIL@notyetcols}
-% In the testing for colors, the nested conditionals
-% set this switch true or false, so that it can be used to
-% control the iteration through successive attempts to find
-% suitable random values.\par
-% \begin{macrocode}
-\newif\ifSIL@notyetcols
-% \end{macrocode}
-% \end{CPK@switch}
-% \subsubsection{Page border setup}\label{borders}
-% \begin{CPK@macro}{\AddToShipoutPictureBG}\label{macro--AddToShipoutPictureBG}
-% The page background color is set to a pale brown
-% roughly matching the pine veneer of IKEA bookcases, with
-% the inner page (behind the books) in a dark shadow
-% brown. The technique for imposing a colored margin is
-% due to \href{https://tex.stackexchange.com/questions/7725/how-to-set-a-certain-color-other-than-white-to-margin-areas}{Ulrike
-% Fischer} and uses the commands from the
-% \textsf{eso-pic} package.\par
-% \begin{macrocode}
-\pagecolor{BurlyWood}
-\AddToShipoutPictureBG{%
- \AtTextLowerLeft{\color{SaddleBrown}%
- \rule[-\footskip]{\textwidth}{%
- \dimexpr\textheight+\footskip}}}
-% \end{macrocode}
-% \end{CPK@macro}
-% \subsubsection{Size and shape}\label{sizeshape}
-% Each book is assigned a random height and width,
-% within the bounds set by the maxima and minima. The final
-% dimensions may then be modified by the choice of layout
-% and font.\par
-% \begin{macrocode}
-\newlength{\SIL@bookheight}
-\newlength{\SIL@bookwidth}
-\newlength{\SIL@minbookwidth}
-\newlength{\SIL@maxbookwidth}
-\newlength{\SIL@minbookheight}
-\newlength{\SIL@maxbookheight}
-% \end{macrocode}
-% \subsubsection{Title and author dimensions}\label{titling}
-% The title and author need to be measured, and
-% decisions are made about what size they need to be. The
-% two layouts (author separately at the top, and author
-% inline to title) are distinguished with the
-% {\ttfamily{}\textbackslash{}SIL@topauthor} conditional. If the title
-% (with or without the author can fit on one line (rather
-% than multiple lines) this is signalled with the
-% {\ttfamily{}\textbackslash{}SIL@titleoneline} conditional.\par
-% \begin{macrocode}
-\newlength{\SIL@titlewidth}
-\newlength{\SIL@authorwidth}
-\newlength{\SIL@titleheight}
-\newlength{\SIL@authorheight}
-\newlength{\SIL@scaledtitle}
-\newlength{\SIL@heightfortitle}
-\newbox\SIL@titlebox
-\newif\ifSIL@topauthor
-\newif\ifSIL@titleoneline
-% \end{macrocode}
-% \subsubsection{Handling the math}
-% \begin{CPK@counter}{SIL@scale}\label{counter--SIL@scale}
-% To extract the integer part of a fixed-point value,
-% we define a simple strip which uses the integer and
-% throws away the rest. The integer ends up in this
-% counter.\par
-% \begin{macrocode}
-\newcounter{SIL@scale}
-% \end{macrocode}
-% \end{CPK@counter}
-% \begin{CPK@macro}{\SIL@scaleint}\label{macro--SIL@scaleint}
-% The integer macro returns the counter above.\par
-% \begin{macrocode}
-\def\SIL@scaleint#1.#2\sentinel{%
- \setcounter{SIL@scale}{#1}}
-% \end{macrocode}
-% \end{CPK@macro}
-% \subsubsection{Settings}
-% We set the space around a box and the thickness of the
-% rule, and remove the page numbers.\par
-% \begin{macrocode}
-\fboxsep1em\fboxrule.1pt
-\pagestyle{empty}
-% \end{macrocode}
-% \subsubsection{Making the book}\label{mb}
-% The {\ttfamily{}\textbackslash{}makebook} macro is huge, and
-% handles all the detail of making a book spine. It takes
-% one mandatory argument: a \BibTeX{} entry label value from
-% the declared \BibTeX{} {\ttfamily{}.bib} file in
-% {\ttfamily{}\textbackslash{}addbibresource}.\par
-% \begin{CPK@macro}{\makebook}\label{macro--makebook}
-% Start by announcing the entry label and setting the
-% values that need to be reset every time.\par
-% \begin{macrocode}
-\newcommand{\makebook}[1]{%
- \typeout{^^J#1}%
- \setcounter{SIL@maxloop}{10}%
- \setcounter{SIL@loopcount}{0}%
-% observed
- \setlength{\SIL@minbookwidth}{5mm}%
- \setlength{\SIL@maxbookwidth}{20mm}%
-% A5 to A4 height
- \setlength{\SIL@minbookheight}{70mm}%
- \setlength{\SIL@maxbookheight}{110mm}%
- \setlength{\SIL@bookwidth}{0pt}%
- \setlength{\SIL@bookheight}{0pt}%
- \setlength{\SIL@heightfortitle}{0pt}%
- \SIL@topauthorfalse
-% \end{macrocode}
-% \end{CPK@macro}
-% \begin{CPK@macro}{\loop}\label{macro--loop}
-% Start a loop which will pick two random integers,
-% one for background and one for foreground colors. Look
-% these up in the {\ttfamily{}\textbackslash{}SIL@svgcolval} (in
-% {\ttfamily{}svgnam.tex}) to get the brightness
-% values, and calculate the absolute distance between
-% them.\par
-% \begin{macrocode}
- \loop
- \addtocounter{SIL@loopcount}{1}%
- \typeout{Try \theSIL@loopcount}%
- \setrannum{\c@SIL@bgcolno}{1}{%
- \c@SIL@maxcolno}%
- \typeout{BG=\theSIL@bgcolno}%
- \setrannum{\c@SIL@fgcolno}{1}{%
- \c@SIL@maxcolno}%
- \typeout{FG=\theSIL@fgcolno}%
- \setlength{\SIL@bgval}{%
- \SIL@svgcolval{\theSIL@bgcolno}pt}%
- \typeout{BGval=\the\SIL@bgval}%
- \setlength{\SIL@fgval}{%
- \SIL@svgcolval{\theSIL@fgcolno}pt}%
- \typeout{FGval=\the\SIL@fgval}%
- \setlength{\SIL@bgfgdiff}{%
- \SIL@bgval - \SIL@fgval}%
- \typeout{Split gap is \the\SIL@bgfgdiff}%
- \ifdim\SIL@bgfgdiff<0pt
- \setlength{\SIL@bgfgdiff}{%
- \SIL@fgval - \SIL@bgval}%
- \typeout{Using absolute value
- \the\SIL@bgfgdiff}%
- \fi
-% \end{macrocode}
-% The colours need to be separated either side of the
-% 0.6 splitpoint value of the calculated brightness, so
-% make this the outer test, and make the inner test for
-% the separation difference. This will return true if the
-% colors are separated enough, and come from opposite
-% sides of the split point. If the loop makes \DescribeCounter{SIL@maxloop}{\ttfamily{}SIL@maxloop}
-% iterations without finding a pair of values, use
-% whatever was tested last.\par
-% \begin{macrocode}
- \ifdim\SIL@bgval<\SIL@splitpoint
- \ifdim\SIL@fgval>\SIL@splitpoint
- \ifdim\SIL@bgfgdiff>0.2pt
- \SIL@notyetcolsfalse
- \else
- \SIL@notyetcolstrue
- \fi
- \else
- \SIL@notyetcolstrue
- \fi
- \else
- \ifdim\SIL@fgval<\SIL@splitpoint
- \ifdim\SIL@bgfgdiff>0.2pt
- \SIL@notyetcolsfalse
- \else
- \SIL@notyetcolstrue
- \fi
- \else
- \SIL@notyetcolstrue
- \fi
- \fi
- \typeout{BG=\theSIL@bgcolno,
- FG=\theSIL@fgcolno}%
- \ifnum\c@SIL@loopcount>\c@SIL@maxloop
- \SIL@notyetcolsfalse
- \fi
- \ifSIL@notyetcols\repeat
- \def\SIL@bgcol{\SIL@svgcolname{%
- \theSIL@bgcolno}}%
- \def\SIL@fgcol{\SIL@svgcolname{%
- \theSIL@fgcolno}}%
- \typeout{BG=\SIL@bgcol, FG=\SIL@fgcol}%
-% \end{macrocode}
-% Now pick a random font: the files generated by
-% {\ttfamily{}prepdata.sh} are named as integers with
-% a {\ttfamily{}.tex} extension in the
-% {\ttfamily{}fontsel} directory. These files load
-% the font as {\ttfamily{}\textbackslash{}SILmfont} (no
-% {\ttfamily{}@} sign, because this is
-% occurring in user mode), and define
-% {\ttfamily{}\textbackslash{}SILmfontname} as the name (for the
-% same reason).\par
-% \begin{macrocode}
- \setrannum{\c@SIL@fontsel}{1}{\c@SIL@maxfont}%
- \input{fontsel/\theSIL@fontsel.tex}%
- \typeout{Set in \SILmfontname}%
-% \end{macrocode}
-% Measure the author width and height at the default
-% size (10pt). If the author fits in 90\% of the
-% maximum width of the book, we put it at the top of the
-% spine and shrink the book width to 1.1 times the set
-% width, provided that is not less than the defined
-% minimum width. The book width is therefore fixed at this
-% point and won't change later.\par
-% \begin{macrocode}
- \settowidth{\SIL@authorwidth}{%
- \SILmfont\citefullauthor{#1}}%
- \typeout{Author width: \the\SIL@authorwidth}%
- \settoheight{\SIL@authorheight}{%
- \SILmfont\citefullauthor{#1}}%
- \typeout{Author height: \the\SIL@authorheight}%
- \ifdim\SIL@authorwidth<.9\SIL@maxbookwidth
- \typeout{Author width is less than 90\%
- of \the\SIL@maxbookwidth}%
- \setlength{\SIL@bookwidth}{%
- 1.1\SIL@authorwidth}%
- \typeout{Book width set to \the\SIL@bookwidth}%
- \ifdim\SIL@bookwidth<\SIL@minbookwidth
- \setlength{\SIL@bookwidth}{%
- \SIL@minbookwidth}%
- \typeout{Book width reset to min
- \the\SIL@minbookheight}%
- \fi
- \SIL@topauthortrue
- \else
- \typeout{Author won't fit in .9 of
- \the\SIL@maxbookwidth}%
- \fi
-% \end{macrocode}
-% Now measure the title, with an em rule and the
-% author if it hasn't been assigned to the top of the
-% spine.\par
-% \begin{macrocode}
- \settowidth{\SIL@titlewidth}{%
- \SILmfont\citetitle{#1}}%
- \ifdim\SIL@titlewidth=0pt
- \typeout{WARNING title width for entry "#1"
- set in \SILmfontname=0pt!}%
- \typeout{Likely that the entry has faulty
- syntax or a bogus title field}%
- \typeout{or a BiBTeX management or
- crossref setting is being misinterpreted.}%
- \typeout{I can't go any further until you
- fix this, sorry}%
- \end{document}%
- \fi
- \ifSIL@topauthor
- \typeout{Title width: \the\SIL@titlewidth}%
- \else
- \addtolength{\SIL@titlewidth}{%
- \widthof{\SILmfont~~—~~}}%
- \addtolength{\SIL@titlewidth}{%
- \SIL@authorwidth}%
- \typeout{Title width with em rule and author:
- \the\SIL@titlewidth}%
- \fi
-% \end{macrocode}
-% We now have enough data to make a shot at the
-% dimensions. Pick a random book height and set the height
-% available for the title (set sideways) to 90\% of
-% that, so that it fits comfortably. Then if the author
-% was earlier assigned to the top of the spine, reduce
-% this height available for the title by 1.2 times the
-% height occupied by the author (again, to leave a little
-% space). In this case, the width has already been set;
-% otherwise, generate a random width now.\par
-% \begin{macrocode}
- \typeout{Limits: width=\the\SIL@minbookwidth
- –\the\SIL@maxbookwidth;
- height=\the\SIL@minbookheight
- –\the\SIL@maxbookheight}%
- \setrandim{\SIL@bookheight}%
- {\SIL@minbookheight}%
- {\SIL@maxbookheight}%
- \typeout{Height generated as
- \the\SIL@bookheight}%
- \setlength{\SIL@heightfortitle}%
- {.9\SIL@bookheight}%
- \typeout{Height available for title (90\%):
- \the\SIL@heightfortitle}%
- \ifSIL@topauthor
- \typeout{Width set because author fits:
- \the\SIL@bookwidth}%
- \addtolength{\SIL@heightfortitle}%
- {-1.2\SIL@authorheight}%
- \typeout{Height available for title reset to
- \the\SIL@heightfortitle}%
- \else
- \setrandim{\SIL@bookwidth}%
- {\SIL@minbookwidth}%
- {\SIL@maxbookwidth}%
- \typeout{Width generated as
- \the\SIL@bookwidth}%
- \fi
-% \end{macrocode}
-% See how the title will fit the space: if it's
-% smaller, it will fit on one line, but we scale it up so
-% it occupies more of the space available. To do this, we
-% perform fixed-point arithmetic on the space it takes and
-% the space available, and use the resulting decimal
-% fraction later to scale the title. However, if the value
-% resulting is greater than four, set it to four,
-% otherwise the title will be too big to fit. The value
-% four was obtained by inspection and trial and
-% error.\par
-% \begin{macrocode}
- \ifdim\SIL@titlewidth<\SIL@heightfortitle
- \typeout{Titling fits in
- \the\SIL@heightfortitle}%
- \SIL@titleonelinetrue
- \edef\titleval{\strip@pt\SIL@titlewidth}%
- \edef\heightval{\strip@pt\SIL@heightfortitle}%
- \FPeval\SIL@scaledtitle{\heightval/\titleval}%
- \typeout{Scaling 1-line title by
- \SIL@scaledtitle}%
- \expandafter\SIL@scaleint
- \SIL@scaledtitle\sentinel
- \ifnum\c@SIL@scale>4
- \gdef\SIL@scaledtitle{4}%
- \typeout{Resetting scale \theSIL@scale\ to
- \SIL@scaledtitle}%
- \fi
-% \end{macrocode}
-% Otherwise (too long) the title needs to be set in a
-% box as a multi-line title. This gets complicated:\par
-% \begin{enumerate}
-% \item set the title in a {\ttfamily{}\textbackslash{}vbox} and
-% then add the height and depth it occupies to get the
-% height of the set title;
-% \item if that height is more than the width of the
-% book, use the method above to divide the available
-% height by the [over]used height and use that to reduce
-% the point size by deducting it from 10 (points);
-% \item otherwise (the multiline title fits in the width
-% of the book), do the reverse and increase the point
-% size to take advantage of the extra space by adding it
-% to 10pt.\par
-% \end{enumerate}
-% \begin{macrocode}
- \else
- \typeout{Titling won't fit
- \the\SIL@heightfortitle}%
- \SIL@titleonelinefalse
- \setbox\SIL@titlebox=\vbox{%
- \hsize\SIL@heightfortitle
- \SILmfont\raggedright
- \vrule height1em width0pt
- \bfseries\citetitle{#1}%
- \vrule depth.2em width0pt
- }%
- \setlength{\SIL@titleheight}%
- {\ht\SIL@titlebox + \dp\SIL@titlebox}%
- \typeout{Multiline title takes
- \the\SIL@titleheight}%
- \ifdim\SIL@titleheight>\SIL@bookwidth
- \typeout{Height of title
- \the\SIL@titleheight\
- is greater than
- \the\SIL@bookwidth}%
- \edef\titleval{\strip@pt\SIL@titleheight}%
- \edef\heightval{\strip@pt\SIL@bookwidth}%
- \FPeval\SIL@scaledtitle
- {10 - \heightval / \titleval}%
- \typeout{10 - \heightval\ ÷ \titleval\
- = \SIL@scaledtitle}%
- \typeout{Using smaller font \SIL@scaledtitle
- pt for multiline title}%
- \else
- \typeout{Height of title
- \the\SIL@titleheight\
- is less than
- \the\SIL@bookwidth}%
- \edef\titleval{\strip@pt\SIL@titleheight}%
- \edef\heightval{\strip@pt\SIL@bookwidth}%
- \FPeval\SIL@scaledtitle
- {10 + \heightval / \titleval}%
- \typeout{10 + \heightval\ ÷ \titleval\
- = \SIL@scaledtitle}%
- \typeout{Using larger font \SIL@scaledtitle
- pt for multiline title}%
- \fi
- \fi
-% \end{macrocode}
-% Finally, set a {\ttfamily{}\textbackslash{}vbox} to the
-% defined width \emph{less} the space
-% occupied by the {\ttfamily{}\textbackslash{}fcolorbox} border and
-% rule; then set the {\ttfamily{}\textbackslash{}fcolorbox} with the
-% chosen colors, with the author at the top if that's what
-% was selected earlier, and the title below, either scaled
-% using {\ttfamily{}\textbackslash{}scalebox} if it was a
-% single-line title, or with the amended font size if it
-% was a multiline title.\par
-% For a setting with the author inline to the title,
-% just do the scaling of the title.\par
-% \begin{macrocode}
- \leavevmode\vbox{\hsize\SIL@bookwidth
- \advance\hsize by2\fboxsep
- \advance\hsize by2\fboxrule
- \fcolorbox{black}{\SIL@bgcol}{%
- \ifSIL@topauthor
- \typeout{Setting with top author}%
- \vbox to\SIL@bookheight{\hsize\SIL@bookwidth
- \typeout{Spine is a vbox to
- \the\SIL@bookheight,
- hsize=\the\SIL@bookwidth}%
- \centering
- \SILmfont\color{\SIL@fgcol}%
- \citefullauthor{#1}%
- \par\vfill
- \rotatebox{90}{\vbox to\SIL@bookwidth{%
- \hsize\SIL@heightfortitle
- \null\vfill
- \typeout{Title in a vbox to
- \the\SIL@bookwidth,
- hsize=\the\SIL@heightfortitle}%
- \raggedright\color{\SIL@fgcol}%
- \ifSIL@titleoneline
- \scalebox{\SIL@scaledtitle}%
- {\bfseries\citetitle{#1}}%
- \else
- \fontsize{\SIL@scaledtitle}%
- {\SIL@scaledtitle}\selectfont
- \bfseries\citetitle{#1}%
- \fi
- \par\vfill}%
- }%
- }%
- \else
- \typeout{Setting author inline to title}%
- \vbox to\SIL@bookheight{\hsize\SIL@bookwidth
- \typeout{Spine is a vbox to
- \the\SIL@bookheight,
- hsize=\the\SIL@bookwidth}%
- \centering
- \SILmfont\color{\SIL@fgcol}%
- \rotatebox{90}{\vbox to\SIL@bookwidth{%
- \hsize\SIL@heightfortitle
- \null\vfill
- \typeout{Title and author in a vbox to
- \the\SIL@bookwidth,
- hsize=\the\SIL@heightfortitle}%
- \raggedright\color{\SIL@fgcol}%
- \ifSIL@titleoneline
- \scalebox{\SIL@scaledtitle}%
- {{\bfseries\citetitle{#1}}\quad
- —\ \ \citefullauthor{#1}}%
- \else
- \fontsize{\SIL@scaledtitle}%
- {\SIL@scaledtitle}\selectfont
- {\bfseries\citetitle{#1}}\quad
- —\ \ \citefullauthor{#1}%
- \fi
- \par\vfill}%
- }%
- }%
- \fi
- }%
-% \end{macrocode}
-% At the bottom, add a colored bar to fake up the
-% shelf the books stand on. The number is the number of
-% the font that was selected, and is there for
-% error-tracing purposes only.\par
-% Despite best efforts at ending all
-% non-control-sequence line-ends with a percent shield,
-% space is creeping in somewhere, so the final negative
-% kern removes it.\par
-% \begin{macrocode}
- \\\fboxsep0pt\fboxrule0pt
- \colorbox{BurlyWood}{\hbox to\hsize{%
- \hfil\vrule height3mm depth6mm width0pt
- \normalfont\scriptsize\theSIL@fontsel\hfil}}%
- }%
-\kern-2.2mm}%
-% \end{macrocode}
-% \end{CPK@macro}
-% \begin{CPK@macro}{\DeclareCiteCommand}\label{fields}
-% Trying to ensure we have an author's full name, not
-% just the surname. This came from \href{https://tex.stackexchange.com/questions/24979/citing-authors-full-name-in-biblatex}{lockstep},
-% modified at \textsf{biblatex}'s suggestion to
-% use {\ttfamily{}given-family} instead of
-% {\ttfamily{}first-last}, but it doesn't seem
-% to have any effect.\par
-% \begin{macrocode}
-\DeclareCiteCommand{\citefullauthor}
- {\boolfalse{citetracker}%
- \boolfalse{pagetracker}%
- \DeclareNameAlias{labelname}{given-family}%
- \usebibmacro{prenote}}
- {\ifciteindex
- {\indexnames{labelname}}
- {}%
- \printnames{labelname}}
- {\multicitedelim}
- {\usebibmacro{postnote}}
-% \end{macrocode}
-% \end{CPK@macro}
-% \begin{CPK@macro}{\DeclareLabeltitle}\label{macro--DeclareLabeltitle}
-% Similarly, in an attempt to get keep the author and
-% title for books and monographs, but use the editors and
-% volume/journal/book title for articles, incollection, and
-% inbook entry types, these two definitions don't seem to
-% have any effect. The remaining definitions are
-% needed to cope with the expected commands found in
-% sample bibliographies.\par
-% \begin{macrocode}
-%%\DeclareLabeltitle[article]{%
-%% \field{journaltitle}
-%%}
-%%\DeclareLabeltitle
-%% [inbook,incollection,inproceedings]{%
-%% \field{booktitle}
-%% \field{maintitle}
-%%}
-%
-\DeclareFieldFormat*{citetitle}{#1}
-\let\citeA\textcite
-\let\titleref\emph
-\def\emdash{~--- }
-% \end{macrocode}
-% \end{CPK@macro}
-% \iffalse
-%</class>
-% \fi
-% \nocite{*}
-% \clearpage
-% \raggedright
-% \raggedright\printbibliography
-% \appendix
-% \newgeometry{left=3cm}
-% \clearpage
-% \section{The \LaTeX{} Project Public License (v\thinspace{}1.3c)}\label{LPPL}
-% \begin{quotation}\small\sffamily\parindent0pt
-% \parskip.5\baselineskip
-% \color{DarkBlue}\noindent
-% Everyone is allowed to distribute verbatim copies of this
-% license document, but modification of it is not allowed.\par
-% \end{quotation}
-% \subsection{Preamble}\label{Preamble}
-% The \LaTeX{} Project Public License ({\smaller LPPL})
-% is the primary license under which the \LaTeX{} kernel and the
-% base \LaTeX{} packages are distributed.\par
-% You may use this license for any work of which you hold the
-% copyright and which you wish to distribute. This license may be
-% particularly suitable if your work is \TeX{}-related (such as a
-% \LaTeX{} package), but it is written in such a way that you can
-% use it even if your work is unrelated to \TeX{}.\par
-% The section “Whether and How to Distribute Works under This
-% License”, below, gives instructions, examples, and
-% recommendations for authors who are considering distributing
-% their works under this license.\par
-% This license gives conditions under which a work may be
-% distributed and modified, as well as conditions under which
-% modified versions of that work may be distributed.\par
-% We, the \LaTeX{3} Project, believe that the conditions below
-% give you the freedom to make and distribute modified versions of
-% your work that conform with whatever technical specifications
-% you wish while maintaining the availability, integrity, and
-% reliability of that work. If you do not see how to achieve your
-% goal while meeting these conditions, then read the document
-% {\ttfamily{}cfgguide.tex} and {\ttfamily{}modguide.tex} in the base \LaTeX{}
-% distribution for suggestions.\par
-% \subsection{Definitions}\label{Definitions}
-% In this license document the following terms are used:\par
-% \begin{description}[style=unboxed]
-% \item[Work\thinspace:]Any work being distributed under this License.\par
-% \item[Derived Work\thinspace:]Any work that under any applicable law is derived from
-% the Work.\par
-% \item[Modification\thinspace:]Any procedure that produces a Derived Work under any
-% applicable law~--- for example, the production of a file
-% containing an original file associated with the Work or a
-% significant portion of such a file, either verbatim or
-% with modifications and/or translated into another
-% language.\par
-% \item[Modify\thinspace:]To apply any procedure that produces a Derived Work
-% under any applicable law.\par
-% \item[Distribution\thinspace:]Making copies of the Work available from one person to
-% another, in whole or in part. Distribution includes (but
-% is not limited to) making any electronic components of the
-% Work accessible by file transfer protocols such as
-% {\smaller FTP} or {\smaller HTTP} or by
-% shared file systems such as Sun's Network File System
-% ({\smaller NFS}).\par
-% \item[Compiled Work\thinspace:]A version of the Work that has been processed into a
-% form where it is directly usable on a computer system.
-% This processing may include using installation facilities
-% provided by the Work, transformations of the Work, copying
-% of components of the Work, or other activities. Note that
-% modification of any installation facilities provided by
-% the Work constitutes modification of the Work.\par
-% \item[Current Maintainer\thinspace:]A person or persons nominated as such within the Work.
-% If there is no such explicit nomination then it is the
-% `Copyright Holder' under any applicable
-% law.\par
-% \item[Base Interpreter\thinspace:]A program or process that is normally needed for
-% running or interpreting a part or the whole of the
-% Work.\par
-% A Base Interpreter may depend on external components
-% but these are not considered part of the Base Interpreter
-% provided that each external component clearly identifies
-% itself whenever it is used interactively. Unless
-% explicitly specified when applying the license to the
-% Work, the only applicable Base Interpreter is a
-% `\LaTeX{}-Format' or in the case of files
-% belonging to the `\LaTeX{}-format' a program
-% implementing the `\TeX{} language'.\par
-% \end{description}
-% \subsection{Conditions on Distribution and Modification}\label{Conditions}
-% \begin{enumerate}
-% \item Activities other than distribution and/or modification
-% of the Work are not covered by this license; they are
-% outside its scope. In particular, the act of running the
-% Work is not restricted and no requirements are made
-% concerning any offers of support for the Work.\par
-% \item \label{item-distribute}You may distribute a complete, unmodified copy of the
-% Work as you received it. Distribution of only part of the
-% Work is considered modification of the Work, and no right to
-% distribute such a Derived Work may be assumed under the
-% terms of this clause.\par
-% \item You may distribute a Compiled Work that has been
-% generated from a complete, unmodified copy of the Work as
-% distributed under Clause~item~\ref{item-distribute} above above, as
-% long as that Compiled Work is distributed in such a way that
-% the recipients may install the Compiled Work on their system
-% exactly as it would have been installed if they generated a
-% Compiled Work directly from the Work.\par
-% \item \label{item-currmaint}If you are the Current Maintainer of the Work, you may,
-% without restriction, modify the Work, thus creating a
-% Derived Work. You may also distribute the Derived Work
-% without restriction, including Compiled Works generated from
-% the Derived Work. Derived Works distributed in this manner
-% by the Current Maintainer are considered to be updated
-% versions of the Work.\par
-% \item If you are not the Current Maintainer of the Work, you
-% may modify your copy of the Work, thus creating a Derived
-% Work based on the Work, and compile this Derived Work, thus
-% creating a Compiled Work based on the Derived Work.\par
-% \item \label{item-conditions}If you are not the Current Maintainer of the Work, you
-% may distribute a Derived Work provided the following
-% conditions are met for every component of the Work unless
-% that component clearly states in the copyright notice that
-% it is exempt from that condition. Only the Current
-% Maintainer is allowed to add such statements of exemption to
-% a component of the Work.\par
-% \begin{enumerate}
-% \item If a component of this Derived Work can be a direct
-% replacement for a component of the Work when that
-% component is used with the Base Interpreter, then,
-% wherever this component of the Work identifies itself to
-% the user when used interactively with that Base
-% Interpreter, the replacement component of this Derived
-% Work clearly and unambiguously identifies itself as a
-% modified version of this component to the user when used
-% interactively with that Base Interpreter.\par
-% \item Every component of the Derived Work contains
-% prominent notices detailing the nature of the changes to
-% that component, or a prominent reference to another file
-% that is distributed as part of the Derived Work and that
-% contains a complete and accurate log of the
-% changes.\par
-% \item No information in the Derived Work implies that any
-% persons, including (but not limited to) the authors of
-% the original version of the Work, provide any support,
-% including (but not limited to) the reporting and
-% handling of errors, to recipients of the Derived Work
-% unless those persons have stated explicitly that they do
-% provide such support for the Derived Work.\par
-% \item You distribute at least one of the following with
-% the Derived Work:\par
-% \begin{enumerate}
-% \item A complete, unmodified copy of the Work; if your
-% distribution of a modified component is made by
-% offering access to copy the modified component from
-% a designated place, then offering equivalent access
-% to copy the Work from the same or some similar place
-% meets this condition, even though third parties are
-% not compelled to copy the Work along with the
-% modified component;\par
-% \item Information that is sufficient to obtain a
-% complete, unmodified copy of the Work.\par
-% \end{enumerate}
-% \end{enumerate}
-% \item If you are not the Current Maintainer of the Work, you
-% may distribute a Compiled Work generated from a Derived
-% Work, as long as the Derived Work is distributed to all
-% recipients of the Compiled Work, and as long as the
-% conditions of Clause~item~\ref{item-conditions} above, above, are met
-% with regard to the Derived Work.\par
-% \item The conditions above are not intended to prohibit, and
-% hence do not apply to, the modification, by any method, of
-% any component so that it becomes identical to an updated
-% version of that component of the Work as it is distributed
-% by the Current Maintainer under Clause~item~\ref{item-currmaint} above, above.\par
-% \item Distribution of the Work or any Derived Work in an
-% alternative format, where the Work or that Derived Work (in
-% whole or in part) is then produced by applying some process
-% to that format, does not relax or nullify any sections of
-% this license as they pertain to the results of applying that
-% process.\par
-% \item % \begin{enumerate}
-% \item A Derived Work may be distributed under a different
-% license provided that license itself honors the
-% conditions listed in Clause~item~\ref{item-conditions} in the list on p.\thinspace\pageref{item-conditions} above, in
-% regard to the Work, though it does not have to honor the
-% rest of the conditions in this license.\par
-% \item If a Derived Work is distributed under a different
-% license, that Derived Work must provide sufficient
-% documentation as part of itself to allow each recipient
-% of that Derived Work to honor the restrictions in
-% Clause~item~\ref{item-conditions} in the list on p.\thinspace\pageref{item-conditions} above, concerning
-% changes from the Work.\par
-% \end{enumerate}
-% \item This license places no restrictions on works that are
-% unrelated to the Work, nor does this license place any
-% restrictions on aggregating such works with the Work by any
-% means.\par
-% \item Nothing in this license is intended to, or may be used
-% to, prevent complete compliance by all parties with all
-% applicable laws.\par
-% \end{enumerate}
-% \subsection{No Warranty}\label{Warranty}
-% There is no warranty for the Work. Except when otherwise
-% stated in writing, the Copyright Holder provides the Work
-% `as is', without warranty of any kind, either
-% expressed or implied, including, but not limited to, the implied
-% warranties of merchantability and fitness for a particular
-% purpose. The entire risk as to the quality and performance of
-% the Work is with you. Should the Work prove defective, you
-% assume the cost of all necessary servicing, repair, or
-% correction.\par
-% In no event unless required by applicable law or agreed to
-% in writing will The Copyright Holder, or any author named in the
-% components of the Work, or any other party who may distribute
-% and/or modify the Work as permitted above, be liable to you for
-% damages, including any general, special, incidental or
-% consequential damages arising out of any use of the Work or out
-% of inability to use the Work (including, but not limited to,
-% loss of data, data being rendered inaccurate, or losses
-% sustained by anyone as a result of any failure of the Work to
-% operate with any other programs), even if the Copyright Holder
-% or said author or said other party has been advised of the
-% possibility of such damages.\par
-% \subsection{Maintenance of The Work}\label{Maintenance}
-% The Work has the status `author-maintained'
-% if the Copyright Holder explicitly and prominently states near
-% the primary copyright notice in the Work that the Work can only
-% be maintained by the Copyright Holder or simply that it is
-% `author-maintained'.\par
-% The Work has the status `maintained' if there
-% is a Current Maintainer who has indicated in the Work that they
-% are willing to receive error reports for the Work (for example,
-% by supplying a valid e-mail address). It is not required for the
-% Current Maintainer to acknowledge or act upon these error
-% reports.\par
-% The Work changes from status `maintained' to
-% `unmaintained' if there is no Current Maintainer,
-% or the person stated to be Current Maintainer of the work cannot
-% be reached through the indicated means of communication for a
-% period of six months, and there are no other significant signs
-% of active maintenance.\par
-% You can become the Current Maintainer of the Work by
-% agreement with any existing Current Maintainer to take over this
-% role.\par
-% If the Work is unmaintained, you can become the Current
-% Maintainer of the Work through the following steps:\par
-% \begin{enumerate}
-% \item Make a reasonable attempt to trace the Current
-% Maintainer (and the Copyright Holder, if the two differ)
-% through the means of an Internet or similar search.\par
-% \item If this search is successful, then enquire whether the
-% Work is still maintained.\par
-% \begin{enumerate}
-% \item If it is being maintained, then ask the Current
-% Maintainer to update their communication data within one
-% month.\par
-% \item \label{item-intention}If the search is unsuccessful or no action to resume
-% active maintenance is taken by the Current Maintainer,
-% then announce within the pertinent community your
-% intention to take over maintenance. (If the Work is a
-% \LaTeX{} work, this could be done, for example, by
-% posting to \url{news:comp.text.tex}.)\par
-% \end{enumerate}
-% \item % \begin{enumerate}
-% \item If the Current Maintainer is reachable and agrees to
-% pass maintenance of the Work to you, then this takes
-% effect immediately upon announcement.\par
-% \item \label{item-announce}If the Current Maintainer is not reachable and the
-% Copyright Holder agrees that maintenance of the Work be
-% passed to you, then this takes effect immediately upon
-% announcement.\par
-% \end{enumerate}
-% \item \label{item-change}If you make an `intention announcement'
-% as described in~item~\ref{item-intention} in the list on p.\thinspace\pageref{item-intention} above and after three
-% months your intention is challenged neither by the Current
-% Maintainer nor by the Copyright Holder nor by other people,
-% then you may arrange for the Work to be changed so as to
-% name you as the (new) Current Maintainer.\par
-% \item If the previously unreachable Current Maintainer becomes
-% reachable once more within three months of a change
-% completed under the terms of~item~\ref{item-announce} in the list on p.\thinspace\pageref{item-announce}
-% or~item~\ref{item-change} above, then that
-% Current
-% Maintainer must become or remain the Current Maintainer upon
-% request provided they then update their communication data
-% within one month.\par
-% \end{enumerate}
-% A change in the Current Maintainer does not, of itself,
-% alter the fact that the Work is distributed under the
-% {\smaller LPPL} license.\par
-% If you become the Current Maintainer of the Work, you should
-% immediately provide, within the Work, a prominent and
-% unambiguous statement of your status as Current Maintainer. You
-% should also announce your new status to the same pertinent
-% community as in~item~\ref{item-intention} in the list on p.\thinspace\pageref{item-intention}
-% above.\par
-% \subsection{Whether and How to Distribute Works under This
-% License}\label{Distribute}
-% This section contains important instructions, examples, and
-% recommendations for authors who are considering distributing
-% their works under this license. These authors are addressed as
-% `you' in this section.\par
-% \subsubsection{Choosing This License or Another License}\label{Choosing}
-% If for any part of your work you want or need to use
-% \emph{distribution} conditions that differ
-% significantly from those in this license, then do not refer to
-% this license anywhere in your work but, instead, distribute
-% your work under a different license. You may use the text of
-% this license as a model for your own license, but your license
-% should not refer to the {\smaller LPPL} or otherwise
-% give the impression that your work is distributed under the
-% {\smaller LPPL}.\par
-% The document {\ttfamily{}modguide.tex} in the base \LaTeX{}
-% distribution explains the motivation behind the conditions of
-% this license. It explains, for example, why distributing
-% \LaTeX{} under the {\smaller GNU} General Public
-% License ({\smaller GPL}) was considered inappropriate.
-% Even if your work is unrelated to \LaTeX{}, the discussion in
-% {\ttfamily{}modguide.tex} may still be
-% relevant, and authors intending to distribute their works
-% under any license are encouraged to read it.\par
-% \subsubsection{A Recommendation on Modification Without
-% Distribution}\label{WithoutDistribution}
-% It is wise never to modify a component of the Work, even
-% for your own personal use, without also meeting the above
-% conditions for distributing the modified component. While you
-% might intend that such modifications will never be
-% distributed, often this will happen by accident~--- you may
-% forget that you have modified that component; or it may not
-% occur to you when allowing others to access the modified
-% version that you are thus distributing it and violating the
-% conditions of this license in ways that could have legal
-% implications and, worse, cause problems for the community. It
-% is therefore usually in your best interest to keep your copy
-% of the Work identical with the public one. Many works provide
-% ways to control the behavior of that work without altering any
-% of its licensed components.\par
-% \subsubsection{How to Use This License}\label{HowTo}
-% To use this license, place in each of the components of
-% your work both an explicit copyright notice including your
-% name and the year the work was authored and/or last
-% substantially modified. Include also a statement that the
-% distribution and/or modification of that component is
-% constrained by the conditions in this license.\par
-% Here is an example of such a notice and statement:\par
-% \iffalse
-%<*ignore>
-% \fi
-\begin{lstlisting}[language={[LaTeX]TeX}]
-%%% pig.dtx
-%%% Copyright 2005 M. Y. Name
-%%
-%% 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 M. Y. Name.
-%%
-%% This work consists of the files pig.dtx and pig.ins
-%% and the derived file pig.sty.
-\end{lstlisting}
-% \iffalse
-%</ignore>
-% \fi
-% Given such a notice and statement in a file, the
-% conditions given in this license document would apply, with
-% the `Work' referring to the three files
-% {\ttfamily{}pig.dtx}, {\ttfamily{}pig.ins}, and {\ttfamily{}pig.sty} (the last being generated
-% from {\ttfamily{}pig.dtx} using {\ttfamily{}pig.ins}), the `Base
-% Interpreter' referring to any
-% `\LaTeX{}-Format', and both `Copyright
-% Holder' and `Current Maintainer'
-% referring to the person
-% M.~Y.~Name\index{!}.\par
-% If you do not want the Maintenance section of
-% {\smaller LPPL} to apply to your Work, change
-% `maintained' above into
-% `author-maintained'. However, we recommend that
-% you use `maintained' as the Maintenance
-% section was added in order to ensure that your Work remains
-% useful to the community even when you can no longer maintain
-% and support it yourself.\par
-% \subsubsection{Derived Works That Are Not Replacements}\label{NotReplacements}
-% Several clauses of the {\smaller LPPL} specify
-% means to provide reliability and stability for the user
-% community. They therefore concern themselves with the case
-% that a Derived Work is intended to be used as a (compatible or
-% incompatible) replacement of the original Work. If this is not
-% the case (e.g., if a few lines of code are reused for a
-% completely different task), then clauses 6b and 6d shall not
-% apply.\par
-% \subsubsection{Important Recommendations}\label{Recommendations}
-% \paragraph[Defining What Constitutes the Work]{Defining What Constitutes the Work :}
-% The {\smaller LPPL} requires that distributions
-% of the Work contain all the files of the Work. It is
-% therefore important that you provide a way for the licensee
-% to determine which files constitute the Work. This could,
-% for example, be achieved by explicitly listing all the files
-% of the Work near the copyright notice of each file or by
-% using a line such as:\par
-% \iffalse
-%<*ignore>
-% \fi
-\begin{lstlisting}[language={[LaTeX]TeX}]
-%% This work consists of all files listed in manifest.txt.
-\end{lstlisting}
-% \iffalse
-%</ignore>
-% \fi
-% in that place. In the absence of an unequivocal list it
-% might be impossible for the licensee to determine what is
-% considered by you to comprise the Work and, in such a case,
-% the licensee would be entitled to make reasonable
-% conjectures as to which files comprise the Work.\par
-% \iffalse
-%<*script>
-#! /bin/bash
-
-# prepdata.sh - prepare the datasets for the bookshelf package
-# which creates a bookshelf image from a BiBTeX file.
-#
-# Peter Flynn, 2020-05-14 <peter@silmaril.ie>
-#
-# Dependencies: the standard UNIX/GNU Linux text utilities
-# and builtins : cat, grep, awk, mkdir, rm, echo, sed, sort
-# PLUS the font-cache program fc-list (1) and the TeX utility
-# kpsewhich (1).
-#
-# Note that if you have not updated your font-cach to take
-# account of fonts added since installation (eg fonts
-# distributed with TeX which are not installed in the system
-# fonts directories) then you should edit /etc/fonts/conf.avail
-# to add the directories where they are installed to (eg)
-# 09-texlive.conf and then alias that file to conf.d, and then
-# run fc-cache as root.
-
-if [ -z "$1" ]; then
- echo You must give the full name of your BiBTeX file
- exit 1
-else
- if [ ! -s "$1" ]; then
-echo I can\'t find the file "$1" anywhere here
-exit 1
- else
-BIBFILE="$1"
- fi
-fi
-
-###########################################################
-#
-# Make a list of all the entries in the bib file. This is
-# in effect the 'driver' which creates each book spine image
-# and the entries.tex file is \input in the test.tex file.
-
-cat "$BIBFILE" |\
- grep '^@' |\
- grep -viE '(@Preamble|@String)' |\
- awk -F\{ '{print $2}' |\
- awk -F, '{print "\\makebook{" $1 "}%"}' >entries.tex
-
-echo `cat entries.tex|wc -l` bibliographic entries
-
-##########################################################
-#
-# Make a list of all the fonts available: this omits PFB
-# fonts (Postscript Type 1) and deduplicates the entries
-# on the first token of their name. CRITICALLY it then
-# applies a (typically) VERY LONG list of disallowed font
-# names so as to exclude non-text fonts: math, symbols,
-# display fonts, bogus and broken fonts, and fonts not
-# providing the Latin alphabet.
-#
-# Note that the current list includes many names which
-# ought not be there, because problems were encountered
-# when using them, especially as they returned a value
-# for the title length of 0.0pt, which is clearly a bug.
-
-mkdir -p fontsel
-rm -f fontsel/*
-
-if [[ "$OSTYPE" =~ ^darwin ]]; then
-
- system_profiler SPFontsDataType 2>/dev/null |\
- awk -F: '/^[ ]{4}[A-Za-z0-9\;\ ]*.[ot]tf*:$/ {font=substr($1,5)} \
- /^[ ]{10}Family:/ {if(font!="") \
- {print substr($2,2);font=""}}' |\
- grep -Ev '^[\.\ ]' |\
- sort |\
- uniq |\
- grep -Evi '(Bitmap|Emoji|Dingbats|Jazz|STIX|dings|Symbol|Numeric|DIN|Ornament|OCR|CJK|Awesome|Dummy|Math)' |\
- awk '{file="fontsel/" NR ".tex";\
- print "\\newfontface{\\SILmfont}{" $0 "}" >file;
- print "\\def\\SILmfontname{" $0 "}" >file;
- close(file)} \
- END {print "\\setcounter{SIL@maxfont}{" NR "}"}' >pickfont.tex
-
-elif [[ "$OSTYPE" =~ ^linux ]]; then
-
- fc-list |\
- grep -v '\.[ot]tf' |\
- grep -Ev '(fontsite|bitstrea)' |\
- awk -F: '{print substr($2,2)}' |\
- awk -F, '{print $1}' |\
- awk '{print $1 "," length($0) "," $0}' |\
- sort -t, -k 1,1 -k 2n |\
- awk -F, '{if($1!=last)print $3;last=$1}' |\
- grep -Evi '(Bitmap|Emoji|Dingbats|Jazz|STIX|dings|Symbol|Numeric|DIN|Ornament|OCR|CJK|Awesome|Dummy|Math)' |\
- awk '{file="fontsel/" NR ".tex";\
- print "\\newfontface{\\SILmfont}{" $0 "}" >file;
- print "\\def\\SILmfontname{" $0 "}" >file;
- close(file)} \
- END {print "\\setcounter{SIL@maxfont}{" NR "}"}' >pickfont.tex
-
-fi
-
-echo `ls -1 fontsel|wc -l` fonts
-
-###########################################################
-#
-# Make a list of the colour selection from the SVG palette
-# of the xcolor LaTeX package, with calculation of the
-# brightness/darkness value according to
-# https://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx
-
-PALETTE=`kpsewhich svgnam.def`
-cat $PALETTE |\
- grep '^[A-Z][A-Za-z]*,[\.0-9][0-9]*,[\.0-9][0-9]*,[\.0-9][0-9]*' |\
- awk -F\; '{print $1}' |\
- awk -F, '{r=$2;g=$3;b=$4} \
- {brightness=sqrt((0.241*r*r)+(0.691*g*g)+(0.068*b*b))} \
- {print $1,r,g,b,brightness}' >svgnam.csv
- cat svgnam.csv |\
- awk 'BEGIN {print "\\newcommand{\\SIL@svgcolname}[1]{\\ifcase#1 "} \
- {print $1 "\\or"} END {print "Black\\fi}\n"}' >svgnam.tex
- cat svgnam.csv |\
- awk 'BEGIN {print "\\newcommand{\\SIL@svgcolval}[1]{\\ifcase#1 "} \
- {print $5 "\\or"} END {print ".666666666\\fi}\n"}' >>svgnam.tex
- cat svgnam.csv | wc -l |\
- awk '{print "\\setcounter{SIL@maxcolno}{" $1 "}"}' >>svgnam.tex
-
-echo `cat svgnam.csv|wc -l` colors
-
-exit 0
-
-%</script>
-% \fi
-% \iffalse
-%<*tester>
-%<<COMMENT
-% !TEX TS-program = xelatex
-% !TEX encoding = UTF-8 Unicode
-% !BIB TS-program = biber
-%COMMENT
-
-%</tester>
-% \fi
-% \iffalse
-%<*tester>
-\documentclass[a0paper,landscape]{bookshelf}
-\addbibresource{mythesis.bib}
-\begin{document}\raggedright
-%%\immediate\write18{./prepdata.sh}
-%%\input{entries.tex}
-\nocite{*}
-\par\vfill\clearpage
-\printbibliography
-\end{document}
-
-%</tester>
-% \fi
-% \Finale
-
diff --git a/Master/texmf-dist/source/latex/bookshelf/bookshelf.ins b/Master/texmf-dist/source/latex/bookshelf/bookshelf.ins
deleted file mode 100644
index cc1b1c81645..00000000000
--- a/Master/texmf-dist/source/latex/bookshelf/bookshelf.ins
+++ /dev/null
@@ -1,62 +0,0 @@
-% Transformed from bookshelf.xml by ClassPack db2dtx.xsl
-% version 1.19 (2020-05-19) on Saturday 23 May 2020 at 23:33:08
-%
-% bookshelf.ins is copyright © 2020 by Peter Flynn <peter@silmaril.ie>
-%
-% 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 Peter Flynn <peter@silmaril.ie>
-%
-% This work consists of the files bookshelf.dtx and bookshelf.ins,
-% the derived file
-% and any other ancillary files listed in the MANIFEST.
-%
-\input docstrip.tex
-\keepsilent
-\usedir{tex/latex/bookshelf}
-\preamble
-
-This is a generated file.
-
-Copyright © 2020 by latex@silmaril.ie
-
-This file was generated from an XML master source.
-Amendments and corrections should be notified to the
-maintainer for inclusion in future versions.
-
-\endpreamble
-\generate{\file{bookshelf.cls}{\from{bookshelf.dtx}{class}}
- \usepreamble\empty\usepostamble\empty
- \file{prepdata.sh}{\from{bookshelf.dtx}{script}}
- \usepreamble\empty\usepostamble\empty
- \file{test.tex}{\from{bookshelf.dtx}{tester}}
-}
-\obeyspaces
-\Msg{********************************************************}
-\Msg{** **}
-\Msg{** Read the documentation before using this class. **}
-\Msg{** **}
-\Msg{** To finish the installation you have to move the **}
-\Msg{** following files into a directory searched by TeX: **}
-\Msg{** **}
-\Msg{** **}
-\Msg{** prepdata.sh **}
-\Msg{** test.tex **}
-\Msg{** **}
-\Msg{** To produce the documentation run the file **}
-\Msg{** bookshelf.dtx through XeLaTeX and biber **}
-\Msg{** **}
-\Msg{** Happy LaTeXing! **}
-\Msg{** **}
-\Msg{********************************************************}
-\endbatchfile
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/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/easybook/easybook.dtx b/Master/texmf-dist/source/latex/easybook/easybook.dtx
index 8387f4de4c3..fa28ce89aeb 100644
--- a/Master/texmf-dist/source/latex/easybook/easybook.dtx
+++ b/Master/texmf-dist/source/latex/easybook/easybook.dtx
@@ -14,7 +14,7 @@
% This work has the LPPL maintenance status `maintained'.
%<class|package>\NeedsTeXFormat{LaTeX2e}[2021/11/15]
%<*class>
-\ProvidesExplClass{easybook}{2024/08/03}{2024de}
+\ProvidesExplClass{easybook}{2024/10/08}{2024eh}
{Easily typesetting Chinese theses or books}
\bool_new:N \l__eb_compile_draft_bool
@@ -43,6 +43,7 @@
class.code:n = { },
floatpage.code:n = { },
theorem .code:n = { },
+ chem .code:n = { },
unknown .code:n = \clist_gput_right:NV \g__eb_doc_options_clist \CurrentOption
}
@@ -301,19 +302,16 @@
%</class>
%<*package>
\RequirePackage{etoolbox}
-\ProvidesExplPackage{easybase}{2024/08/03}{2024de}
+\ProvidesExplPackage{easybase}{2024/10/08}{2024eh}
{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 { o }
\cs_generate_variant:Nn \tl_if_novalue:nF { V }
\cs_set_protected:Npn \ctex_define:nn #1
@@ -327,12 +325,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
{
@@ -405,9 +398,18 @@
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/true .meta:n = { theorem = thmtools },
+ theorem .default:n = thmtools,
+ theorem .initial:n = thmtools,
+ chem .choices:nn =
+ { chemformula,mhchem,false }
+ { \tl_set:Nn \l__eb_chem_support_tl {#1} },
+ chem/true .meta:n = { chem = chemformula },
+ chem .default:n = chemformula,
+ chem .initial:n = chemformula,
paper .code:n = \eb_put_geometry:n {#1},
paper .initial:n = a4paper,
class .choice:,
@@ -416,13 +418,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
@@ -452,9 +456,9 @@
\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
{
@@ -510,11 +514,10 @@
{
[text]{spbmark},
[{shortlabels,inline}]{enumitem},
- chemformula,siunitx,pifont,
- geometry,marginnote,
- pdfpages,multicol,
+ siunitx,pifont,
+ geometry,marginnote,multicol,
fancyhdr,titletoc,caption,
- tabularray,
+ tabularray,graphicx,xcolor,
listings
}
\cs_new_protected:Npn \eb_package_date_check:nn #1#2
@@ -573,7 +576,8 @@
}
}
-\includepdfset{fitpaper = true}
+\ctex_at_end_package:nn { pdfpages }
+ { \includepdfset{fitpaper = true} }
\geometry
{
vmargin = 2.54cm,
@@ -702,18 +706,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} }
@@ -805,25 +809,14 @@
\UseFntSymbsList{empty}
\cs_set_eq:NN \DefineFntSymbols \SetFntSymbsList
\cs_set_eq:NN \setfntsymbol \UseFntSymbsList
-\cs_new:Npn \eb_int_type_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 }
@@ -841,18 +834,33 @@
\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:nnTF {##1} {#2}
{
\regex_replace_once:nnN {##1}
- { \c{eb_int_type_trans:NN} ##1 \c{c@footnote} }
- \l__eb_fnmarktext_short_tokens_tl
- \cs_set_eq:NN #1 \l__eb_fnmarktext_short_tokens_tl
+ { \c{eb_footnote_int_trans:n}\0 }
+ \l__eb_fnmarktext_tmpb_tl
+ \cs_set:Npx #1 { \l__eb_fnmarktext_tmpb_tl }
\clist_map_break:
}
{
@@ -957,14 +965,18 @@
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} }
}
@@ -1107,13 +1119,12 @@
\l__eb_fnpara_format_tl{#1}
\tl_if_eq:NnT \l__eb_footnote_value_tl { hang } { \par }
}
-\cs_new_protected:Npn \setspread #1 { \linespread{#1}\selectfont }
\clist_map_inline:nn { \@footnotetext,\@mpfootnotetext }
{
\eb_patch_cmd:Nnn #1
{ \reset@font }
{
- \setspread{\eb@spread@footnote}
+ \usestretch{\eb@spread@footnote}
\eb@font@footnote
}
}
@@ -1123,12 +1134,12 @@
\ctex_at_end_package:nn { footmisc }
{
\eb_package_date_check:nn { footmisc } { 2022/02/10 }
- \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
@@ -1697,6 +1708,12 @@
\tl_set:cn { ttll@#2 } {#1}
}
\contentsuse{lstlisting}{lol}
+\ctex_at_end_package:nn { hyperref }
+ {
+ \cs_if_exist:NTF \Hy@toclinkstart
+ { \cs_set:Npn \hytoclink #1 { \Hy@toclinkstart #1\Hy@toclinkend } }
+ { \cs_set_eq:NN \hytoclink \use:n }
+ }
\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 }
@@ -1750,7 +1767,7 @@
\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 = .—,
@@ -1849,8 +1866,6 @@
hang .initial:n = true,
pagenumwd .code:n = \contentsmargin{#1},
pagenumwd .initial:n = 1.55em,
- fileopen .tl_set:N = \l__eb_fileopen_type_tl,
- fileopen .initial:n = once,
unknown .code:n = \eb_msg_deprecated_option:n { toc }
}
@@ -1871,21 +1886,13 @@
\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}
- {
- \tl_if_eq:NnTF \l__eb_fileopen_type_tl { once }
- { \iow_now:Nn \@mainaux { \RemoveFromHook{starttoc/after}[*] } }
- {
- \IfHookEmptyTF{starttoc/after}{}
- {\iow_now:Nn \@mainaux { \RemoveFromHook{starttoc/after}[aux] }}
- }
- }
\cs_set_protected:Npn \AssignPartialExt #1#2
{
\tl_if_exist:cTF { ttl@partial#1 }
@@ -1973,7 +1980,7 @@
\ctex_at_end_package:nn { imakeidx }
{
- \RenewDocumentCommand{\printindex}{st+od()}
+ \RenewDocumentCommand{\printindex}{st++o}
{
\group_begin:
\tl_set_eq:NN \eb@toc@title \indexname
@@ -2069,19 +2076,46 @@
}
\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 }
},
@@ -2097,8 +2131,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}} },
@@ -2117,23 +2151,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,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 }
}
}
@@ -2153,11 +2203,7 @@
\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
{
\tl_gset:Nn \textfraction { 0.1 }
@@ -2173,11 +2219,6 @@
\setcounter{topnumber}{4}
\setcounter{bottomnumber}{4}
\setcounter{totalnumber}{8}
-\tl_set:Nn \fontsubfuzz { 0.5pt }
-\dim_zero_new:N \mathindent
-\allowdisplaybreaks[4]
-\everymath{\displaystyle}
-\DeclareGraphicsExtensions{.pdf,.png,.jpg,.eps,.tif}
\dim_new:N \hangwd
\cs_set_protected:Npn \hangpara #1#2
@@ -2234,7 +2275,7 @@
width .dim_set:N = \l__eb_eqsymb_width_dim,
width .initial:n = 10pt,
delim .tl_set:N = \l__eb_eqsymb_delim_tl,
- delim .initial:n = \tl_if_eq:NnTF \l__ctex_scheme_tl { chinese } { —— } { --- },
+ delim .initial:n = \tl_if_eq:NnTF \l__ctex_scheme_tl { chinese } { —— } { --- },
space .dim_set:N = \l__eb_eqsymb_space_dim,
space .initial:n = 0.25em,
item-align .tl_set:N = \l__eb_eqsymb_item_align_tl,
@@ -2306,24 +2347,48 @@
\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 }
+ \group_begin:
+ \exp_args:Nc \providecommand { c@@ckpt }{}
+ \@removefromreset{#1}{@ckpt}
+ \group_end:
+ }
+\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{}m+O{}}
- {\eb@declaretheoremstyle@save[#1,#3]{#2}}
+ {\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 }
+ \cs_gset:cpn { thmt@contentsline@##2 }
{ \thmt@contentslineIfNamed }
- \exp_args:Nc \providecommand { p@#2 }[1]{##1}
+ \exp_args:Nc \providecommand { p@##2 }[1]{####1}
}
\ctex_define:nn { thmt }
{
@@ -2341,14 +2406,13 @@
bodyfont = \normalfont,
postheadspace = 1em
]
- \theoremstyle{default}
- \cs_undefine:N \proof
\DeclareFloatList{theorem}{loe}
\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 }
@@ -2360,62 +2424,69 @@
\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 }
}
}
-
-\setchemformula
+\cs_new_protected:Npn \eb_theorem_load_keytheorems:
+ {
+ \RequirePackage{keytheorems}
+ \DeclareFloatList{theorem}{thlist}
+ \AssignPartialExt{thlist}{ple}
+ }
+\str_case:VnT \l__eb_theorem_support_tl
{
- math-scripts = false,
- charge-hshift = 0.25em,
- subscript-vshift = -0.2ex
+ { thmtools }
+ { \eb_theorem_load_thmtools: }
+ { keytheorems }
+ { \eb_theorem_load_keytheorems: }
}
-\IfPackageAtLeastTF{siunitx}{2021/06/22}
+ { \cs_undefine:N \proof }
+\cs_new_protected:Npn \eb_chem_load_chemformula:
{
- \sisetup
+ \RequirePackage{chemformula}
+ \setchemformula
{
- number-mode = match,
- range-phrase = \ensuremath{\sim},
- range-units = single,
- print-unity-mantissa = false,
- table-alignment-mode = none,
- group-digits = none
+ charge-hshift = 0pt,
+ subscript-vshift = -0.2ex
}
- }{}
-\eb_at_begin_environment:nn
+ }
+\cs_new_protected:Npn \eb_chem_load_mhchem:
{
- 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
+ \RequirePackage[version = 4]{mhchem}
+ \mhchemoptions{layout = stacked}
}
- { \setspread{\eb@spread@math} }
-\clist_map_inline:nn
- { \start@gather,\start@align,\start@multline }
+\str_case:VnF \l__eb_chem_support_tl
{
- \eb_patch_cmd:Nnn #1
- { \collect@body }
- {
- \setspread{\eb@spread@math}
- \collect@body
- }
+ { chemformula }
+ { \eb_chem_load_chemformula: }
+ { mhchem }
+ { \eb_chem_load_mhchem: }
}
-\eb_patch_cmd:Nnn \gather@split
- { \spread@equation }
+ { \RequirePackage{amsmath} }
+\tl_set:Nn \fontsubfuzz { 0.5pt }
+\everymath{\displaystyle}
+\dim_zero_new:N \mathindent
+\allowdisplaybreaks[4]
+\DeclareGraphicsExtensions{.pdf,.png,.jpg,.eps,.tif}
+\sisetup
{
- \setspread{\eb@spread@math}
- \spread@equation
+ number-mode = match,
+ range-phrase = \ensuremath{\sim},
+ range-units = single,
+ print-unity-mantissa = false,
+ table-alignment-mode = none,
+ group-digits = none
}
\ctex_at_end_package:nn { unicode-math }
{ \msg_redirect_module:nnn { unicode-math } { warning } { info } }
@@ -2437,7 +2508,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}
@@ -2455,7 +2525,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
@@ -2503,7 +2573,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
@@ -2705,7 +2775,7 @@
}
\ctex_define:n
{
- lstlistlistingname .tl_set:N = \listlstlistingname,
+ listlstlistingname .tl_set:N = \listlstlistingname,
lstlistingname .tl_set:N = \lstlistingname,
listtheoremname .tl_set:N = \listtheoremname
}
@@ -2716,29 +2786,123 @@
contentsname = 目\hspace{1em}录,
listfigurename = 插图清单,
listtablename = 附表清单,
- lstlistlistingname = 代码清单,
+ listlstlistingname = 代码清单,
lstlistingname = 代码,
listtheoremname = 定理清单
}
+ \ctex_at_end_package:nn { keytheorems }
+ { \keytheoremlistset{title = 定理清单} }
}
{
\keys_set_known:nn { ctex }
{
- lstlistlistingname = List~of~Codes,
+ listlstlistingname = List~of~Codes,
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/08/03}{2024de}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2024/10/08}{2024eh}
{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/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/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 60cc0162f13..a37fc045208 100644
--- a/Master/texmf-dist/source/latex/heria/heria.dtx
+++ b/Master/texmf-dist/source/latex/heria/heria.dtx
@@ -33,7 +33,7 @@
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\ProvidesClass{heria}
%<*class>
-[2024-07-14 v3.4.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{1520}
+% \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
@@ -109,6 +109,23 @@
% 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}
%
% The EC's official template is structured in such a way that form and
@@ -509,6 +526,12 @@
% \subsection{Version history}
%
% \begin{description}
+% \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.
@@ -709,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}
@@ -1089,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%
@@ -1098,7 +1121,7 @@
\arabic{@secolumn}},0)}}}%
\@esphack
}
- \serowtemp & \fpeval{round(\setotalpm,0)} \\
+ \serowtemp & \fpeval{round(\setotalpm/2,0)} \\
\hline
\end{xltabular}
\end{center}
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/jlreq/Makefile b/Master/texmf-dist/source/latex/jlreq/Makefile
index ed84b713364..6784e2d0340 100644
--- a/Master/texmf-dist/source/latex/jlreq/Makefile
+++ b/Master/texmf-dist/source/latex/jlreq/Makefile
@@ -1,51 +1,54 @@
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 \
+TFMS = jlreq.tfm bjlreq.tfm zjlreq.tfm bzjlreq.tfm \
ujlreq.tfm ubjlreq.tfm uzjlreq.tfm ubzjlreq.tfm \
- 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 \
+ jlreq-jidori.tfm jlreqg-jidori.tfm jlreq-v-jidori.tfm jlreqg-v-jidori.tfm \
+ ujlreq-jidori.tfm ujlreqg-jidori.tfm ujlreq-v-jidori.tfm ujlreqg-v-jidori.tfm \
+ ujlreq-jidori-q.tfm ujlreqg-jidori-q.tfm
+
+VFS = jlreq.vf bjlreq.vf zjlreq.vf bzjlreq.vf \
+ ujlreq.vf ubjlreq.vf uzjlreq.vf ubzjlreq.vf \
+ ujlreq-q.vf ubjlreq-q.vf uzjlreq-q.vf ubzjlreq-q.vf \
+ jlreqg.vf bjlreqg.vf zjlreqg.vf bzjlreqg.vf \
+ ujlreqg.vf ubjlreqg.vf uzjlreqg.vf ubzjlreqg.vf \
+ ujlreqg-q.vf ubjlreqg-q.vf uzjlreqg-q.vf ubzjlreqg-q.vf \
+ jlreq-v.vf bjlreq-v.vf zjlreq-v.vf bzjlreq-v.vf \
+ ujlreq-v.vf ubjlreq-v.vf uzjlreq-v.vf ubzjlreq-v.vf \
+ jlreqg-v.vf bjlreqg-v.vf zjlreqg-v.vf bzjlreqg-v.vf \
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
+ jlreq-jidori.vf jlreqg-jidori.vf jlreq-v-jidori.vf jlreqg-v-jidori.vf \
+ ujlreq-jidori.vf ujlreqg-jidori.vf ujlreq-v-jidori.vf ujlreqg-v-jidori.vf \
+ ujlreq-jidori-q.vf ujlreqg-jidori-q.vf
+
+
+.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 +65,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 +127,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 +205,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 +225,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 +264,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/l3build/l3build.dtx b/Master/texmf-dist/source/latex/l3build/l3build.dtx
index 2433c7a3115..642da13e909 100644
--- a/Master/texmf-dist/source/latex/l3build/l3build.dtx
+++ b/Master/texmf-dist/source/latex/l3build/l3build.dtx
@@ -251,7 +251,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-10-08}
%
% \maketitle
% \tableofcontents
@@ -369,7 +369,7 @@
% As well as these targets, the system recognises the options
% \begin{itemize}
% \item |--config| (|-c|) Configuration(s) to use for testing
-% \item |--date| Date to use when tagging data
+% \item |--date| (|-d|) Date to use when tagging data
% \item |--debug| Runs the target in debug mode (not supported by all targets)
% \item |--dirty| Skips cleaning up of the test area
% \item |--dry-run| Runs the \texttt{install} target but does not copy
@@ -388,7 +388,7 @@
% \item |--message| (|-m|) Text for upload announcement
% \item |--quiet| (|-q|) Suppresses output from unpacking
% \item |--rerun| Runs tests without unpacking/set up
-% \item |--show-log-on-error| To be used in addition to \texttt{--halt-on-error} and results
+% \item |--show-log-on-error| To be used in addition to |--halt-on-error| and results
% in the full \texttt{.log} file of a failed test to be shown on the console
% \item |--show-saves| (|-S|) When tests fail, prints the \texttt{l3build save} commands needed
% to regenerate the tests assuming that the failures were false negatives.
@@ -460,9 +460,19 @@
% \end{buildcmd}
%
% \begin{buildcmd}{clean}
-% This command removes all temporary files used for package bundling and regression testing.
-% In the standard layout, these are all files within the directories defined by \var{localdir}, \var{testdir}, \var{typesetdir} and \var{unpackdir}, as well as all files defined in the \var{cleanfiles} variable in the same directory as the script.
-% The defaults are |.pdf| files from typesetting (|doc|) and |.zip| files from bundling (|ctan|).
+% This target is meant as preparation for other targets, for example |ctan|.
+% It removes the contents of \var{distribdir} and all temporary files used for package bundling and regression testing.
+% These are all files within the directories \var{unpackdir}, \var{testdir}, \var{typesetdir} and \var{localdir}.
+% In addition, all the files in \var{maindir} (the directory of |build.lua| in the standard layout),
+% \var{sourcefiledir} and \var{docfiledir} are removed when matched by \var{cleanfiles}
+% but not by \var{sourcefiles}.
+% In a standard way are removed |.log| and |.pdf| files from the |doc| target and
+% |.zip| files from the |ctan| target.
+%
+% When applied to a bundle, the |clean| target is first applied to each
+% embedded modules (listed in |modules|).
+% In addition, all the files in the directory of |build.lua| are removed
+% when matched by \var{cleanfiles}, while ignoring \var{sourcefiles}. Finally |ctandir| and |tdsdir| are removed.
% \end{buildcmd}
%
%
@@ -1662,35 +1672,42 @@
%
% \begin{variable}{options}
% The |options| table holds the values passed to \pkg{l3build} at the
-% command line. The possible entries in the table are given in the table
-% below.
+% command line. Each possible \meta{entry} given below corresponds to
+% |--|\meta{entry} given at the command line, except the |target| entry
+% which is self explanatory and the |names| entry which corresponds to \meta{name(s)}
+% for |check|, |doc|, |save| and |tag| targets.
% \begin{center}
% \begin{tabular}{ll}
% \toprule
-% Entry & Type \\
+% Entry & Lua type \\
% \midrule
-% \var{config} & Table \\
-% \var{date} & String \\
-% \var{dirty} & Boolean \\
-% \var{dry-run} & Boolean \\
-% \var{email} & String \\
-% \var{engine} & Table \\
-% \var{epoch} & String \\
-% \var{file} & string \\
-% \var{first} & Boolean \\
-% \var{full} & Boolean \\
-% \var{halt-on-error} & Boolean \\
-% \var{help} & Boolean \\
-% \var{message} & string \\
-% \var{names} & Table \\
-% \var{quiet} & Boolean \\
-% \var{rerun} & Boolean \\
-% \var{shuffle} & Boolean \\
-% \var{stdengine} & Boolean \\
-% \var{texmfhome} & String \\
+% \var{config} & |table| \\
+% \var{date} & |string| \\
+% \var{dirty} & |boolean| \\
+% \var{dry-run} & |boolean| \\
+% \var{email} & |string| \\
+% \var{engine} & |table| \\
+% \var{epoch} & |string| \\
+% \var{file} & |string| \\
+% \var{first} & |boolean| \\
+% \var{full} & |boolean| \\
+% \var{halt-on-error} & |boolean| \\
+% \var{help} & |boolean| \\
+% \var{message} & |string| \\
+% \var{names} & |table| \\
+% \var{quiet} & |boolean| \\
+% \var{rerun} & |boolean| \\
+% \var{shuffle} & |boolean| \\
+% \var{stdengine} & |boolean| \\
+% \var{target} & |string| \\
+% \var{texmfhome} & |string| \\
% \bottomrule
% \end{tabular}
% \end{center}
+% The Lua tables mentionned here are in fact arrays of strings.
+% From the |build.lua| file, one can modify the string and boolean values,
+% add or remove entries in arrays. But it is not recommended to affect a
+% whole new Lua table to |options| nor to its array entries.
% \end{variable}
%
% \subsection{Utility functions}
@@ -1946,7 +1963,7 @@
% |tex(|\meta{file},\meta{dir},\meta{cmd}|)|
% \end{syntax}
% Runs \meta{cmd} (by default \luavar{typesetexe} \luavar{typesetopts}) on the
-% \meta{name} inside the \meta{dir}.
+% \meta{file} inside the \meta{dir}.
% \end{function}
%
% \begin{function}{runcmd()}
@@ -2127,7 +2144,7 @@
% \begin{verbatim}
% manifest_extract_filedesc = function(filehandle,filename)
%
-% local all_file = filehandle:read("*all")
+% local all_file = filehandle:read("a")
% local matchstr = "\\section{(.-)}"
%
% filedesc = string.match(all_file,matchstr)
@@ -2288,8 +2305,8 @@
\ifnum\currentgrouplevel>0 %
\LONGTYPEOUT{Bad grouping: \the\currentgrouplevel!}%
\fi
- \ifnum\currentiflevel>2 %
- \LONGTYPEOUT{Bad conditionals: \the\numexpr\currentiflevel-2!}%
+ \ifnum\currentiflevel>1 %
+ \LONGTYPEOUT{Bad conditionals: \the\numexpr\currentiflevel-1!}%
\fi
\LONGTYPEOUT{^^JEND-TEST-LOG^^J}%
\@@@end
diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx
index 64c65d0ff76..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-07-20}%
+\def\ExplFileDate{2024-09-10}%
%<*driver>
\documentclass[full]{l3doc}
\usepackage{graphicx}
@@ -51,7 +51,7 @@
% }^^A
% }
%
-% \date{Released 2024-07-20}
+% \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 ad15d79653e..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-07-20}
+% \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 2b62c68b4a0..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-07-20}
+% \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 7f4eba752be..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-07-20}
+% \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 532ec6a7d8e..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-07-20}
+% \date{Released 2024-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3cctab.dtx b/Master/texmf-dist/source/latex/l3kernel/l3cctab.dtx
index 92f134aa934..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-07-20}
+% \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 f8d1eeaea8f..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-07-20}
+% \date{Released 2024-09-10}
%
% \maketitle
%
@@ -326,7 +326,7 @@
% \clist_remove_all:NV, \clist_remove_all:cV,
% \clist_remove_all:Ne, \clist_remove_all:ce,
% \clist_gremove_all:Nn, \clist_gremove_all:cn,
-% \clist_gremove_all:NV, \clist_gremove_all:cV
+% \clist_gremove_all:NV, \clist_gremove_all:cV,
% \clist_gremove_all:Ne, \clist_gremove_all:ce
% }
% \begin{syntax}
@@ -352,7 +352,7 @@
% Reverses the order of items stored in the \meta{clist~var}.
% \end{function}
%
-% \begin{function}[added = 2014-07-18]{\clist_reverse:n}
+% \begin{function}[added = 2014-07-18, EXP]{\clist_reverse:n}
% \begin{syntax}
% \cs{clist_reverse:n} \Arg{comma list}
% \end{syntax}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx
index afbd1bd3945..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-07-20}
+% \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 117a468d218..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-07-20}
+% \date{Released 2024-09-10}
%
% \maketitle
%
@@ -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}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3debug.dtx b/Master/texmf-dist/source/latex/l3kernel/l3debug.dtx
index 4e578ee9b6d..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-07-20}
+% \date{Released 2024-09-10}
%
% \maketitle
%
@@ -69,7 +69,7 @@
%
% Standard file identification.
% \begin{macrocode}
-\ProvidesExplFile{l3debug.def}{2024-07-20}{}{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 697f235311a..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-07-20}
+% \date{Released 2024-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
index 751d4f4e145..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-07-20}{}
+\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-07-20}
+% \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 199801ff3b1..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-07-20}
+% \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 499c94587e4..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-07-20}
+% \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 039c4eecb8e..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-07-20}
+% \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 690347426f7..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-07-20}
+% \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 e1b3bc788b0..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-07-20}
+% \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 4c39e81f461..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-07-20}
+% \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 a93ff90291b..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-07-20}
+% \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 9b5b66f8151..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-07-20}
+% \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 e9dcdf66467..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-07-20}
+% \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 24f1e5c1279..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-07-20}
+% \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 2c5eb9602ff..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-07-20}
+% \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 9d39f4f67e7..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-07-20}
+% \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 191ab2755c6..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-07-20}
+% \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 dd407047197..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-07-20}
+% \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 ad209342152..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-07-20}
+% \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 8223419f66d..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-07-20}
+% \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 7f22a2d137f..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-07-20}
+% \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 b7b67c94457..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-07-20}
+% \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 d969f76bdc5..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-07-20}
+% \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 8e37a55799e..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-07-20}
+% \date{Released 2024-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx
index 9592671ae39..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-07-20}
+% \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 4b0d251cab5..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-07-20}
+% \date{Released 2024-09-10}
%
% \maketitle
%
@@ -411,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
@@ -430,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 4be0ca6be64..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-07-20}
+% \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 5d5758a6afd..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-07-20}
+% \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 db580c525cb..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-07-20}
+% \date{Released 2024-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx b/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx
index b5ef8968278..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-07-20}
+% \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 aa7724a8ce8..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-07-20}
+% \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 66e7ac82828..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-07-20}
+% \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 1cb0d132ae4..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-07-20}
+% \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 34118c371a4..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-07-20}
+% \date{Released 2024-09-10}
%
% \maketitle
%
@@ -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}
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
index ac6131d6ff1..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-07-20}
+% \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 fd0d8e167df..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-07-20}
+% \date{Released 2024-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx
index ad78a12bd29..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-07-20}
+% \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 c3d5de27cbd..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-07-20}
+% \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 413e20f8caa..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-07-20}
+% \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 9bea4c7b145..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-07-20}
+% \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 a86f916d241..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-07-20}
+% \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 40618958969..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-07-20}
+% \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 2be2b105ce4..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-07-20}
+% \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
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx
index 1db09f95505..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-07-20}
+% \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 134e2508b73..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-07-20}
+% \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 e3586164c5a..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-07-20}
+% \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 d22ee1bc3e0..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-07-20}
+% \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 9a4c4f244e8..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-07-20}
+% \date{Released 2024-09-10}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx
index 600da3985db..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-07-20}
+% \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 e484c5b1c59..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-07-20}
+% \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 84f2c367986..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-07-20}
+% \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 c028310326b..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-07-20}
+% \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 532eb315d35..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-07-20}
+% \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/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/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/mathtools/empheq.dtx b/Master/texmf-dist/source/latex/mathtools/empheq.dtx
index c0ecdec0270..9e57dd07726 100644
--- a/Master/texmf-dist/source/latex/mathtools/empheq.dtx
+++ b/Master/texmf-dist/source/latex/mathtools/empheq.dtx
@@ -69,7 +69,7 @@
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: empheq 2020/03/24 v2.16 empheq}
+\Msg{* Package: empheq 2024/08/09 v2.17 empheq}
\Msg{************************************************************************}
\keepsilent
@@ -133,13 +133,18 @@ and the derived files
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{empheq.drv}%
- [2020/03/24 v2.16 Emphasizing equations]
+ [2024/08/09 v2.17 Emphasizing equations]
\documentclass{ltxdoc}
\usepackage{mathpazo}
\usepackage[overload]{empheq}
-\usepackage{xcolor,varioref,booktabs,fancybox}
+\usepackage{xcolor,varioref,booktabs,fancybox,iftex}
\usepackage[overload]{textcase}
+\iftutex\else
+ \usepackage[T1]{fontenc}
+\fi
+
+
\pagestyle{headings}
\hyphenation{emph-eq}
\makeatletter
@@ -338,6 +343,7 @@ and the derived files
\end{document}
%</driver>
% \fi
+% \changes{v2.17}{2024/08/09}{Fixed typo in manual}
% \changes{v2.16}{2020/03/24}{fixed several bugs related to amsart/-book}
% \changes{v2.15}{2017/03/31}{Fixed a bug in relation to the AMS
% classes and completed prefixing macros belonging to \pkg{mhsetup}
@@ -376,7 +382,7 @@ and the derived files
% release}
%
% \GetFileInfo{empheq.drv}
-% \CheckSum{2495}
+% \CheckSum{2635}
%
% \title{The \pkg{empheq} package\thanks{This file has version number
% \fileversion, last revised \filedate.}\\
@@ -1498,8 +1504,8 @@ and the derived files
% \begin{codesyntax}
% \cs{newenvironment}
% \marg{env_name} \oarg{num} \oarg{default}\\
-% \texttt{~~}\arg{\meta{other commands} \cs{EmpheqMainEnv}}\\
-% \texttt{~~}\arg{\cs{endEmpheqMainEnv}}
+% \texttt{~~}\arg{\meta{other commands} \cs{EmphEqMainEnv}}\\
+% \texttt{~~}\arg{\cs{endEmphEqMainEnv}}
% \end{codesyntax}
% In the above environment the \meta{other commands} part must
% contain certain things before it'll work.
@@ -1753,7 +1759,7 @@ and the derived files
% \begin{macrocode}
%<*package>
\ProvidesPackage{empheq}%
- [2017/03/31 v2.15 Emphasizing equations]
+ [2024/08/09 v2.17 Emphasizing equations]
% \end{macrocode}
% \changes{v2.15}{2017/03/31}{Bumped required mhsetup release}
% \begin{macrocode}
@@ -2939,7 +2945,8 @@ and the derived files
% \end{macrocode}
% \end{environment}
% We make a choice here: the good \env{multline} or the bad?
-% \refstepcounter{CodelineNo}\label{goodandbad}\addtocounter{CodelineNo}{-1}
+% ^^A daleif 2024/10/07: the line below fails
+% ^^A \stepcounter{CodelineNo}\label{goodandbad}\addtocounter{CodelineNo}{-1}
% \begin{macrocode}
\MH_if_boolean:nTF {good_mult}{
% \end{macrocode}
@@ -4559,5 +4566,5 @@ and the derived files
% \begin{macrocode}
%</package>
% \end{macrocode}
-% Finale
+% \Finale
\endinput
diff --git a/Master/texmf-dist/source/latex/mathtools/empheq.ins b/Master/texmf-dist/source/latex/mathtools/empheq.ins
new file mode 100644
index 00000000000..ef9caae566f
--- /dev/null
+++ b/Master/texmf-dist/source/latex/mathtools/empheq.ins
@@ -0,0 +1,94 @@
+%%
+%% This is file `empheq.ins',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% empheq.dtx (with options: `install')
+%%
+%% This is a generated file.
+%%
+%% Copyright (C) 2002-2007 by Morten Hoegholm
+%% Copyright (C) 2012-2019 by Lars Madsen
+%% Copyright (C) 2020- by Lars Madsen, The LaTeX3 Project
+%%
+%%
+%% 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".
+%%
+%% This Current Maintainer of this work is
+%% Lars Madsen, The LaTeX3 Project
+%%
+%% This work consists of the main source file empheq.dtx
+%% and the derived files
+%% empheq.sty, empheq.pdf, empheq.ins, empheq.drv.
+%%
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: empheq 2024/08/09 v2.17 empheq}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\preamble
+
+This is a generated file.
+
+Copyright (C) 2002-2007 by Morten Hoegholm
+Copyright (C) 2012-2019 by Lars Madsen
+Copyright (C) 2020- by Lars Madsen, The LaTeX3 Project
+
+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".
+
+This Current Maintainer of this work is
+Lars Madsen, The LaTeX3 Project
+
+This work consists of the main source file empheq.dtx
+and the derived files
+ empheq.sty, empheq.pdf, empheq.ins, empheq.drv.
+
+\endpreamble
+
+\generate{%
+ \file{empheq.ins}{\from{empheq.dtx}{install}}%
+ \file{empheq.drv}{\from{empheq.dtx}{driver}}%
+ \usedir{tex/latex/mh}%
+ \file{empheq.sty}{\from{empheq.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{* empheq.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `empheq.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+\endinput
+%%
+%% End of file `empheq.ins'.
diff --git a/Master/texmf-dist/source/latex/mathtools/mathtools.dtx b/Master/texmf-dist/source/latex/mathtools/mathtools.dtx
index db726b51b51..2e3b50d7c6e 100644
--- a/Master/texmf-dist/source/latex/mathtools/mathtools.dtx
+++ b/Master/texmf-dist/source/latex/mathtools/mathtools.dtx
@@ -69,7 +69,7 @@
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: mathtools 2024/03/11 v1.30}
+\Msg{* Package: mathtools 2024/10/04 v1.31}
\Msg{************************************************************************}
\keepsilent
@@ -133,7 +133,7 @@ and the derived files
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{mathtools.drv}%
- [2024/03/11 v1.30 mathematical typesetting tools]
+ [2024/10/04 v1.31 mathematical typesetting tools]
\documentclass{ltxdoc}
\IfFileExists{fourier.sty}{\usepackage{fourier}}{}
@@ -333,7 +333,7 @@ colorlinks,
%
% \GetFileInfo{mathtools.drv}
%
-% \CheckSum{3772}
+% \CheckSum{3775}
%
% \title{The \pkg{mathtools} package\thanks{This file has version number
% \fileversion, last revised \filedate.}}
@@ -3138,7 +3138,7 @@ colorlinks,
% \begin{macrocode}
%<*package>
\ProvidesPackage{mathtools}%
- [2024/03/11 v1.30 mathematical typesetting tools]
+ [2024/10/04 v1.31 mathematical typesetting tools]
% \end{macrocode}
% \changes{v1.10}{2011/02/12}{Might as well make sure that we need the
% latest version of \texttt{mhsetup}}
@@ -6707,12 +6707,23 @@ colorlinks,
\MH_if_dim:w \lastskip>\z@
\skip@\lastskip\unskip
% \end{macrocode}
-% \changes{v1.15}{2014/07/16}{Added penalty workaround}
-% Here is the fix.
-% \changes{v1.19}{2017/03/31}{Added MH\_ prefix}
+% \changes{v1.15}{2014/07/16}{Added penalty workaround}
+% Here is the fix.
+% \changes{v1.19}{2017/03/31}{Added MH\_ prefix}
+% The code we inserted here in 2014, had a bug in it. The intent was
+% to move the penalty on to the other side of the italic correction.
+% But when we reinsert the penalty we only test if the scratch
+% counter is non-zero, so it may insert random penalties depending
+% on the non-zero value of \cs{count@}. Simple fix: initialise \cs{count@}.
+% \changes{v1.31}{2024/10/03}{Added missing counter initialisation, fixing issue \#62}
+% In chat David C. mentioned that \verb|\ifnum\lastnodetype=13| is a better
+% test than \verb|\ifnum\lastpenalty>\z@|. Just leaving this here for when we do the
+% Expl3 conversion.
% \begin{macrocode}
\MH_if_num:w \lastpenalty>\z@
\count@\lastpenalty\unpenalty
+ \MH_else:
+ \count@\z@
\MH_fi:
\@@italiccorr
% \end{macrocode}
@@ -6728,8 +6739,12 @@ colorlinks,
\@@italiccorr
\MH_fi:
\MH_fi:
- \MH_fi:
- $\MH_fi:
+% \end{macrocode}
+%
+% \changes{v1.31}{2024/10/03}{Also fixed typo here, the last two \cs{fi} comes from non-MH syntax}
+% \begin{macrocode}
+ \fi
+ $\fi
}
}
}
diff --git a/Master/texmf-dist/source/latex/mathtools/mathtools.ins b/Master/texmf-dist/source/latex/mathtools/mathtools.ins
index a8df08bca3c..47b1bc37937 100644
--- a/Master/texmf-dist/source/latex/mathtools/mathtools.ins
+++ b/Master/texmf-dist/source/latex/mathtools/mathtools.ins
@@ -33,7 +33,7 @@
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: mathtools 2024/03/11 v1.30}
+\Msg{* Package: mathtools 2024/10/04 v1.31}
\Msg{************************************************************************}
\keepsilent
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..a8f9b33952a 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/10/07 v3.1.2 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:
-%
-% \begin{Verbatim}[gobble=3,commandchars=\\\{\}]
-% \$ pdflatex -shell-escape minimal
-% \end{Verbatim}
+% \inputminted[frame=single]{latex}{minted.doc.out}
%
-% we end up with the following output in |minimal.pdf|:
+% This document can be compiled by running ``|pdflatex -shell-escape minimal|''
+% to produce 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,191 @@
% 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.
%
-% \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 |.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.
+%
+%
+% \subsubsection*{Config settings}
+%
+% \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.
+%
+% 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.
%
-% 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.
+% \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.
%
-% 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.}
+% 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}
%
-% \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.
%
-% 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.
+% \subsection{macOS compatibility}
+% \label{sec:configuration:macos}
%
-% 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,
+% 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. This only has an effect when |cache=true|.
%
+% 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).
%
-% This option may add a noticeable amount of overhead on some systems, or with some system configurations.
+% Temporary files with the following file extensions are automatically detected and processed correctly, regardless of |highlightmode|: |.listing|, |.out|, |.outfile|, |.output|, |.temp|, |.tempfile|, |.tmp|, |.verb|, and |.vrb|. For temp files with other file extensions, |highlightmode=immediate| is needed if the files are overwritten or deleted during compilation. |fastfirst| can work in such cases, but it will give an error message about modified or missing files during the first compile, and then will work correctly during subsequent compiles when it switches to |immediate| mode.
%
-% 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.
+% 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.
%
%
-% \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.
+% \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).
%
-% \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.
+% 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.
%
-% \begin{VerbatimOut}[gobble=1]{minted.doc.out}
-% \begin{minted}[linenos]{python}
-% def f(x):
-% return x**2
-% \end{minted}
%
-% \begin{minted}[linenos]{ruby}
-% def func
-% puts "message"
-% end
-% \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, 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
+% \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{longexample}[xleftmargin=1em]
+% \begin{minted}[linenos]{python}
+% def f(x):
+% return x**2
+% \end{minted}
+%
+% \begin{minted}[linenos]{ruby}
+% def func
+% puts "message"
+% end
+% \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, 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 +835,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 +845,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 +855,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 +894,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,10 +940,18 @@
% \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}.
%
-% For example, \texttt{breakafter=-/} would allow breaks after any hyphens or slashes. Special characters given to \texttt{breakafter} should be backslash-escaped (usually \texttt{\hashchar}, \texttt{\{}, \texttt{\}}, \texttt{\%}, \texttt{[}, \texttt{]}; the backslash \texttt{\textbackslash} may be obtained via \texttt{\textbackslash\textbackslash}).
+% For example, \texttt{breakafter=-/} would allow breaks after any hyphens or slashes. Special characters given to \texttt{breakafter} should be backslash-escaped (usually \texttt{\hashchar}, \texttt{\{}, \texttt{\}}, \texttt{\%}, \texttt{[}, \texttt{]}, and the comma \texttt{,}; the backslash \texttt{\textbackslash} may be obtained via \texttt{\textbackslash\textbackslash}).
%
% For an alternative, see \texttt{breakbefore}. When \texttt{breakbefore} and \texttt{breakafter} are used for the same character, \texttt{breakbeforeinrun} and \texttt{breakafterinrun} must both have the same setting.
%
@@ -1123,15 +961,17 @@
% \end{minted}
% \end{longexample}
%
-% \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[breakafterinrun] (boolean) (false)
+% When \texttt{breakafter} is used, insert breaks within runs of identical characters. If \texttt{false}, treat sequences of identical characters as a unit that cannot contain breaks. 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,19 +984,27 @@
% \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}.
%
% \item[breakbefore (string) (\meta{none})]
% Break lines before specified characters, not just at spaces, when \texttt{breaklines=true}.
%
-% For example, \texttt{breakbefore=A} would allow breaks before capital A's. Special characters given to \texttt{breakbefore} should be backslash-escaped (usually \texttt{\hashchar}, \texttt{\{}, \texttt{\}}, \texttt{\%}, \texttt{[}, \texttt{]}; the backslash \texttt{\textbackslash} may be obtained via \texttt{\textbackslash\textbackslash}).
+% For example, \texttt{breakbefore=A} would allow breaks before capital A's. Special characters given to \texttt{breakbefore} should be backslash-escaped (usually \texttt{\hashchar}, \texttt{\{}, \texttt{\}}, \texttt{\%}, \texttt{[}, \texttt{]}, and the comma \texttt{,}; the backslash \texttt{\textbackslash} may be obtained via \texttt{\textbackslash\textbackslash}).
%
% For an alternative, see \texttt{breakafter}. When \texttt{breakbefore} and \texttt{breakafter} are used for the same character, \texttt{breakbeforeinrun} and \texttt{breakafterinrun} must both have the same setting.
%
@@ -1166,25 +1014,32 @@
% \end{minted}
% \end{longexample}
%
-% \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[breakbeforeinrun] (boolean) (false)
+% When \texttt{breakbefore} is used, insert breaks within runs of identical characters. If \texttt{false}, treat sequences of identical characters as a unit that cannot contain breaks. 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 +1049,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 +1081,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 +1113,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 +1145,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 +1191,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 +1253,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 +1286,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 +1302,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 +1422,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 +1442,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 +1462,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 +1475,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{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{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 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 +1593,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 +1604,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.
-%
-% \item \textbf{I want to use a custom script/executable to access Pygments, rather than |pygmentize|.} Redefine |\MintedPygmentize|:
-%\begin{verbatim}
-%\renewcommand{\MintedPygmentize}{...}
-%\end{verbatim}
+% 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 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 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 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 +1630,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 +1640,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,1672 +1650,2267 @@
% \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}
%
%
-% \begin{macro}{newfloat}
%
-% Define an option to use \texpkg{newfloat} rather than \texpkg{float} to create a floated |listing| environment.
+% \subsection{Python executable and minimum supported version}
%
+%
+% \begin{macro}{\MintedExecutable}
+% Name of \mintedpkg\ Python executable.
% \begin{macrocode}
-\DeclareBoolOption{newfloat}
+\edef\MintedExecutable{\detokenize{latexminted}}
% \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@minversion}
% \begin{macrocode}
-\DeclareBoolOption[true]{cache}
+\edef\minted@executable@minversion{\detokenize{0.2.0}}
% \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@minmajor,\minted@executable@minminor,\minted@executable@minpatch}
% \begin{macrocode}
-\StrSubstitute{\jobname}{ }{_}[\minted@jobname]
-\StrSubstitute{\minted@jobname}{*}{_}[\minted@jobname]
-\StrSubstitute{\minted@jobname}{"}{}[\minted@jobname]
-\StrSubstitute{\minted@jobname}{'}{_}[\minted@jobname]
+\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@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@version}
% \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]}
+\let\minted@executable@version\relax
% \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@exists}
% \begin{macrocode}
-\DeclareBoolOption{finalizecache}
+\newbool{minted@executable@exists}
% \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.
+% \begin{macro}{minted@executable@issupported}
% \begin{macrocode}
-\DeclareBoolOption{frozencache}
+\newbool{minted@executable@issupported}
% \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{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.
+%
+% The |\outputmode=1| is for |dvilualatex| compatibility.
+%
+% The |\detokenize| is to prevent any possibility of |\catcode| issues.
+% \begin{macro}{\minted@timestamp}
% \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
+\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
+ \begingroup
+ \outputmode=1
+ \xdef\minted@timestamp{\minted@creationdatetotimestamp{\pdffeedback creationdate}}%
+ \endgroup
+\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
+\xdef\minted@timestamp{\detokenize\expandafter{\minted@timestamp}}
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{inputlanglinenos}
-% Enable |langlinenos| and make it apply to |\inputminted|.
+%
+% \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}
-\DeclareBoolOption{inputlanglinenos}
+\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}{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}{\MintedCacheIndexFilename}
+% Index file in cache. Used to detect whether cache exists.
% \begin{macrocode}
-\DeclareBoolOption{kpsewhich}
+\edef\MintedCacheIndexFilename{%
+ \detokenize{_}\MintedJobnameMdfive\detokenize{.index.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}{\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{langlinenos}
+\edef\MintedConfigFilename{%
+ \detokenize{_}\MintedJobnameMdfive\detokenize{.config.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}{\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{draft}
+\edef\MintedDataFilename{%
+ \detokenize{_}\MintedJobnameMdfive\detokenize{.data.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}{\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}
-\DeclareComplementaryOption{final}{draft}
+\edef\MintedErrlogFilename{%
+ \detokenize{_}\MintedJobnameMdfive\detokenize{.errlog.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.
-%
+% \begin{macro}{\MintedMessageFilename}
+% Messages from the Python side to the LaTeX side. Deleted immediately after reading.
% \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}}}}%
- {}
+\edef\MintedMessageFilename{%
+ \detokenize{_}\MintedJobnameMdfive\detokenize{.message.minted}}
% \end{macrocode}
+% \end{macro}
%
%
%
-% \subsection{Input, caching, and temp files}
+% \subsection{Package options}
+%
%
-% \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@pgfopts}
% \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.}}%
-}
+\def\minted@pgfopts#1{%
+ \pgfkeys{/minted/pkg/.cd,#1}}
% \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.
+% \subsubsection{Package option definitions}
+%
+%
+% \begin{macro}{\minted@float@within}
+% Control the section numbering of the |listing| float.
% \begin{macrocode}
-\newcommand{\minted@infile}{\minted@jobname.out.pyg}
+\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}
%
%
-% 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@newfloat}
+% Use \texpkg{newfloat} rather than \texpkg{float} to create a floating |listing| environment.
% \begin{macrocode}
-\newcommand{\minted@cachelist}{}
+\newbool{minted@newfloat}
+\minted@pgfopts{
+ newfloat/.is if=minted@newfloat,
+}
% \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@debug}
+% Keep temp files for aid in debugging.
% \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@debug}
+\minted@pgfopts{
+ debug/.is if=minted@debug,
}
% \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@cache}
+% Determine whether highlighted content is cached.
% \begin{macrocode}
-\newcommand{\minted@savecachelist}{%
- \ifdefempty{\minted@cachelist}{}{%
- \immediate\write\@mainaux{%
- \string\gdef\string\minted@oldcachelist\string{%
- \minted@cachelist\string}}%
- }%
+\newbool{minted@cache}
+\booltrue{minted@cache}
+\minted@pgfopts{
+ cache/.is if=minted@cache,
}
% \end{macrocode}
% \end{macro}
%
-%
-% \begin{macro}{\minted@cleancache}
-% Clean up old cache files that are no longer in use.
+% \begin{macro}{\minted@cachedir}
+% Set the directory in which cached content is saved.
% \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
+\edef\minted@cachedir{\detokenize{_minted}}
+\minted@pgfopts{
+ cachedir/.estore in=\minted@cachedir,
}
% \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@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}
-\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@frozencache}
+\minted@pgfopts{
+ frozencache/.is if=minted@frozencache,
+}
% \end{macrocode}
+% \end{macro}
%
%
+% \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}
+\newbool{minted@lexerlinenos}
+\minted@pgfopts{
+ lexerlinenos/.is if=minted@lexerlinenos,
+ langlinenos/.is if=minted@lexerlinenos,
+}
+% \end{macrocode}
+% \end{macro}
%
-% \subsection{OS interaction}
-%
-% We need system-dependent macros for communicating with the ``outside world.''
+% \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}
%
-% \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}{}{\minted@pgfopts{highlightmode=immediate,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@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@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@exec@batch}
+% Run in batch mode, for |highlightmode=fast| or |highlightmode=fastfirst|.
+% \begin{macrocode}
+\def\minted@exec@batch{%
+ \minted@ShellEscapeMaybeMessages{%
+ \MintedExecutable
+ \detokenize{ batch }\minted@execarg@timestamp\minted@execarg@debug
+ \MintedJobnameMdfive}}
% \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@config}
+% Detect configuration.
% \begin{macrocode}
-\newboolean{minted@isinline}
+\def\minted@exec@config{%
+ \minted@ShellEscapeMaybeMessages{%
+ \MintedExecutable
+ \detokenize{ config }\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@styledef}
+% Create style definition.
% \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@styledef{%
+ \minted@ShellEscapeMaybeMessages{%
+ \MintedExecutable
+ \detokenize{ styledef }\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.
+% \begin{macro}{\minted@exec@highlight}
+% Highlight code.
+% \begin{macrocode}
+\def\minted@exec@highlight{%
+ \minted@ShellEscapeMaybeMessages{%
+ \MintedExecutable
+ \detokenize{ highlight }\minted@execarg@timestamp\minted@execarg@debug
+ \MintedJobnameMdfive}}
+% \end{macrocode}
+% \end{macro}
%
-% Before actually creating the option-definition macro, we need a few helper macros.
%
+% \begin{macro}{\minted@exec@clean}
+% Clean temp files and cache.
+% \begin{macrocode}
+\def\minted@exec@clean{%
+ \minted@ShellEscapeNoMessages{%
+ \MintedExecutable
+ \detokenize{ clean }\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@cleanconfig}
+% Clean config temp file.
% \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@cleanconfig{%
+ \minted@ShellEscapeNoMessages{%
+ \MintedExecutable
+ \detokenize{ cleanconfig }\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@cleantemp}
+% Clean all temp files.
% \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@cleantemp{%
+ \minted@ShellEscapeNoMessages{%
+ \MintedExecutable
+ \detokenize{ cleantemp }\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@cleanconfig
+ \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@cleanconfig
+ \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
+ \ifbool{minted@fasthighlightmode}{\newread\minted@intempfile}{}}}%
+ {\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}.
%
-% 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.
+% Options are stored in scope-specific lists. They are applied by passing these lists to |\fvset|. Individual option values are not retrievable.
+%
+% 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}%
+ {}%
+ {\ifnum\value{minted@numcachefiles}>0\relax
+ \expandafter\minted@exec@clean
+ \else
+ \expandafter\minted@exec@cleantemp
+ \fi
+ \global\boolfalse{minted@canexec}}%
+ \setcounter{minted@numcachefiles}{0}}
+\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
+ \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|.
-% \begin{macrocode}
-\ifbool{minted@inputlanglinenos}%
- {\def\minted@inputlanglinenoson{\minted@langlinenoson}%
- \def\minted@inputlanglinenosoff{\minted@langlinenosoff}}%
- {\let\minted@inputlanglinenoson\relax
- \let\minted@inputlanglinenosoff\relax}
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
+% \subsubsection{Highlighting code}
%
%
+% \begin{macro}{\minted@highlight,\minted@highlightinputfile}
+% Highlight code previously stored in buffer |minted@tmpdatabuffer|, or code in an external file.
%
-% \subsection{Public API}
+% |\minted@defstyle| will invoke |\minted@detectconfig| the first time a style is loaded, so no separate |\minted@detectconfig| is needed.
%
-% \begin{macro}{\setminted}
-% Set global or language-level options.
+% 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}
-\newcommand{\setminted}[2][]{%
- \ifthenelse{\equal{#1}{}}%
- {\setkeys{minted@opt@g}{#2}}%
- {\minted@configlang{#1}%
- \setkeys{minted@opt@lang}{#2}}}
+\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@iffasthighlightmode@buffertempfile
+ \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}
%
-% \begin{macro}{\setmintedinline}
-% Set global or language-level options, but only for inline (|\mintinline|) content. These settings will override the corresponding |\setminted| settings.
+%
+% \begin{macro}{\minted@iffasthighlightmode@buffertempfile}
+%
+% With caching, when |fasthighlightmode=true| and |\minted@inputfilepath| has a file extension that has been designated for temp files, read the file into a temp buffer, and then if that succeeds copy the code into the highlighting buffer. This can avoid errors with temp files that are modified or deleted before highlighting occurs when |fasthighlightmode=true|, since that delays highlighting until the end of the document.
+%
+% This is not done for all highlighted external files because it adds overhead and complexity. When files are read, it is not possible to determine the newline sequence (|\n| versus |\r\n|), and trailing whitespace is discarded by \TeX\ during the reading process, so it is not possible to reconstruct the original file bytes within \TeX, only an (essentially equivalent) approximation. As a result, files that are read are hashed a second time after reading to reduce the chance that they were modified after initial hashing but before reading.
+%
% \begin{macrocode}
-\newcommand{\setmintedinline}[2][]{%
- \ifthenelse{\equal{#1}{}}%
- {\setkeys{minted@opt@g@i}{#2}}%
- {\minted@configlang{#1}%
- \setkeys{minted@opt@lang@i}{#2}}}
+\begingroup
+\def\minted@set@tempfileextension#1{%
+ \if\relax\detokenize{#1}\relax
+ \else
+ \expandafter\global\expandafter
+ \let\csname minted@buffertempfileextension@#1\endcsname\relax
+ \fi}
+\minted@forcsvlist{\minted@set@tempfileextension}{
+ listing,
+ out,
+ outfile,
+ output,
+ temp,
+ tempfile,
+ tmp,
+ verb,
+ vrb,
+}
+\endgroup
+\begingroup
+\catcode`\/=12
+\catcode`\.=12
+\gdef\minted@iffasthighlightmode@buffertempfile{%
+ \ifbool{minted@fasthighlightmode}%
+ {\ifcsname minted@inputfilepath\endcsname
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {\expandafter
+ \minted@iffasthighlightmode@buffertempfile@i\minted@inputfilepath/\FV@Sentinel}}%
+ {}}
+\gdef\minted@iffasthighlightmode@buffertempfile@i#1/#2\FV@Sentinel{%
+ \if\relax\detokenize{#2}\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {\minted@iffasthighlightmode@buffertempfile@ii#1.\FV@Sentinel}%
+ {\minted@iffasthighlightmode@buffertempfile@i#2\FV@Sentinel}}
+\gdef\minted@iffasthighlightmode@buffertempfile@ii#1.#2\FV@Sentinel{%
+ \if\relax\detokenize{#2}\relax
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {\minted@iffasthighlightmode@buffertempfile@iii#2\FV@Sentinel}}
+\gdef\minted@iffasthighlightmode@buffertempfile@iii#1.\FV@Sentinel{%
+ \ifcsname minted@buffertempfileextension@#1\endcsname
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {\minted@iffasthighlightmode@buffertempfile@iv}}
+\endgroup
+\def\minted@iffasthighlightmode@buffertempfile@iv{%
+ \begingroup
+ \setcounter{minted@tmpcodebufferlength}{0}%
+ \openin\minted@intempfile=\minted@inputfilepath
+ \endlinechar=-1%
+ \let\do\@makeother\FVExtraDoSpecials
+ \loop\unless\ifeof\minted@intempfile
+ \read\minted@intempfile to\minted@intempfileline
+ \stepcounter{minted@tmpcodebufferlength}%
+ \expandafter\global\expandafter\let\csname
+ minted@tmpcodebufferline\arabic{minted@tmpcodebufferlength}%
+ \endcsname\minted@intempfileline
+ \repeat
+ \closein\minted@intempfile
+ \expandafter\ifx\csname
+ minted@tmpcodebufferline\arabic{minted@tmpcodebufferlength}%
+ \endcsname\@empty
+ \expandafter\global\expandafter\let\csname
+ minted@tmpcodebufferline\arabic{minted@tmpcodebufferlength}%
+ \endcsname\minted@undefined
+ \addtocounter{minted@tmpcodebufferlength}{-1}%
+ \fi
+ \endgroup
+ \edef\minted@inputfilemdfivesum@check{\pdf@filemdfivesum{\minted@inputfilepath}}%
+ \ifx\minted@inputfilemdfivesum@check\minted@inputfilemdfivesum
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {\VerbatimClearBuffer[buffername=minted@tmpcodebuffer]}%
+ \ifnum\value{minted@tmpcodebufferlength}>0\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {\minted@iffasthighlightmode@buffertempfile@v}}
+\def\minted@iffasthighlightmode@buffertempfile@v{%
+ \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
+ \VerbatimClearBuffer[buffername=minted@tmpcodebuffer]}
% \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}
+% \subsection{Public API}
+%
%
-% Set style. This is a holdover from version 1, since |\setminted| can now accomplish this, and a hierarchy of style settings are now possible.
+% \begin{macro}{\setminted}
+% Set global or lexer-level options.
% \begin{macrocode}
-\newcommand{\usemintedstyle}[2][]{\setminted[#1]{style=#2}}
+\newcommand{\setminted}[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}{\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{macro}{\setmintedinline}
+% Set global or lexer-level options, but only for inline (|\mintinline|) content. These settings will override the corresponding |\setminted| settings.
% \begin{macrocode}
-\begingroup
-\catcode`\ =\active
-\catcode`\^^I=\active
-\gdef\minted@defwhitespace@retok{\def {\noexpand\FV@Space}\def^^I{\noexpand\FV@Tab}}%
-\endgroup
+\newcommand{\setmintedinline}[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}
%
%
-% \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{macro}{\usemintedstyle}
+% Set style. This is a holdover from \mintedpkg\ v1, before |\setminted| could be used to set the style.
% \begin{macrocode}
-\newcommand{\minted@writecmdcode}[1]{%
- \immediate\openout\minted@code\minted@jobname.pyg\relax
- \immediate\write\minted@code{\detokenize{#1}}%
- \immediate\closeout\minted@code}
+\newcommand{\usemintedstyle}[2][]{\setminted[#1]{style={#2}}}
% \end{macrocode}
% \end{macro}
%
@@ -3358,11 +3918,9 @@
% \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 +3930,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 +3990,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 +4194,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 +4203,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 +4235,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 +4251,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 +4259,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 +4284,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 +4317,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/moremath/moremath.dtx b/Master/texmf-dist/source/latex/moremath/moremath.dtx
index 3b520f4ac21..48e7bae62d0 100644
--- a/Master/texmf-dist/source/latex/moremath/moremath.dtx
+++ b/Master/texmf-dist/source/latex/moremath/moremath.dtx
@@ -67,6 +67,18 @@
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}
@@ -161,6 +173,7 @@
% \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}
@@ -238,7 +251,7 @@
% on their own.
%
% There are also other things that can be improved when typesetting math.
-% One prominent example is the typsetting of row and column vectors,
+% 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,
@@ -888,7 +901,7 @@
% \end{gather*}
% \end{minipage}
%
-% \item Feynman-Notation:
+% \item Feynman-notation:
%
% \begin{minipage}{.49\linewidth}
% \begin{verbatim}
@@ -1351,7 +1364,9 @@
% Valid keys are "delimiter", "fill", and "align",
% their usage is described in section~\ref{sec:options-matrix}.
%
-% \begin{function}{
+% \begin{function}[
+% updated=2024-08-20,
+% ]{
% \cvector,
% \rvector
% }
@@ -1443,7 +1458,7 @@
%
% As vectors are commonly delimited by parenthesis, brackets, braces, etc.\
% several shorthands producing delimited vectors are also available.
-% \begin{function}{
+% \begin{function}[updated=2024-08-20]{
% \pcvector,
% \bcvector,
% \Bcvector,
@@ -1504,7 +1519,9 @@
% This package provides analogous commands for row and column vectors
% to be typeset in inline math mode.
%
-% \begin{function}{
+% \begin{function}[
+% updated=2024-08-20,
+% ]{
% \smallcvector,
% \smallrvector
% }
@@ -1530,7 +1547,7 @@
% \(\smallcvector{1,0}\).
% \end{quote}
%
-% \begin{function}{
+% \begin{function}[updated=2024-08-20]{
% \psmallcvector,
% \bsmallcvector,
% \Bsmallcvector,
@@ -2215,7 +2232,7 @@
% \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 function is similar to the above functions
+% 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.).
@@ -2224,11 +2241,18 @@
% \section{Formatting Matrices and Vectors}
% \label{sec:authors-matrix}
%
-% \begin{function}[updated=2024-07-15]{
+% \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_row_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}
@@ -2256,6 +2280,7 @@
% \begin{function}[
% updated = 2024-07-04,
% updated=2024-07-15,
+% updated=2024-08-20,
% ]{
% \moremath_diagonal_matrix:nn,
% \moremath_diagonal_matrix:nV,
@@ -2330,6 +2355,7 @@
% \begin{function}[
% added=2024-07-08,
% updated=2024-07-15,
+% updated=2024-08-20,
% ]{
% \moremath_vcenter:n,
% }
@@ -2388,10 +2414,23 @@
% (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-07-15}{v0.4.0}{More Math Macros}
+ {2024-08-20}{v0.5.0}{More Math Macros}
% \end{macrocode}
%
% ^^X Debugging switch
@@ -2830,6 +2869,161 @@
% \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}
%
@@ -2851,7 +3045,7 @@
% \url{http://www.tug.org/TUGboat/Articles/tb22-4/tb72perlS.pdf}
% }
%
-% \begin{macro}[added = 2024-07-08]{
+% \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}
@@ -2872,15 +3066,21 @@
% \begin{macrocode}
\cs_new_protected_nopar:Nn \moremath_vcenter:n
{
- \mathpalette \@@_vcenter:Nn {#1}
+ \@@_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]{
+% \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
@@ -2907,18 +3107,22 @@
% \begin{macrocode}
\cs_new_protected_nopar:Nn \@@_vcenter:Nn
{
- \vcenter
+ \@@_tex_vcenter:n
{
\hbox:n
{
$
- \mathsurround=0pt
+ \@@_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}
%
%
@@ -3598,7 +3802,7 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_gradient_operator_get:}
+% \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}
@@ -3606,7 +3810,7 @@
{
\tl_if_empty:NTF \l_@@_grad_op_tl
{
- \mathop
+ \@@_tex_mathop:n
{
% \end{macrocode}
% Otherwise we first need to check if the operator shall have an arrow over it.
@@ -3645,7 +3849,7 @@
\l_@@_nabla_tl
}
}
- }% \mathop
+ }% \@@_tex_mathop:n
\nolimits
}{
% \end{macrocode}
@@ -3656,9 +3860,12 @@
}
}
% \end{macrocode}
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Now uses \cs{@@_tex_mathop:n} instead of \TeX{}-primitives.
+% }
% \end{macro}
%
-% \begin{macro}{\@@_laplace_operator_get:}
+% \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
@@ -3668,7 +3875,7 @@
{
\tl_if_empty:NTF \l_@@_laplacian_tl
{
- \mathop
+ \@@_tex_mathop:n
{
\bool_if:NTF \l_@@_laplacian_delta_bool
{
@@ -3709,9 +3916,12 @@
}
}
% \end{macrocode}
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Now uses \cs{@@_tex_mathop:n} instead of \TeX{}-primitives.
+% }
% \end{macro}
%
-% \begin{macro}{
+% \begin{macro}[updated=2024-08-20]{
% \@@_dalembert_operator_get:
% }
% This function returns the \foreignlanguage{french}{d'Alembert} operator
@@ -3721,16 +3931,19 @@
% \begin{macrocode}
\cs_new_protected:Nn \@@_dalembert_operator_get:
{
- \mathop
+ \@@_tex_mathop:n
{
\l_@@_dalembert_symb_tl
- }% \mathop
+ }% \@@_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}
@@ -3949,6 +4162,9 @@
% 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}
@@ -4350,11 +4566,13 @@
%
% In the next step we construct the single row/column matrix from the user
% provided input.
-% \begin{macro}{
+% \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:n} and \cs{moremath_row_vector:n}
+% 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.
@@ -4373,29 +4591,43 @@
\seq_clear:N \l_@@_vector_entries_seq
\seq_set_from_clist:Nn \l_@@_vector_entries_seq {#2}
- \exp_args:NnNV \begin{#1 matrix*} [ \l_@@_matrix_align_tl ]
+ \@@_matrix_star_begin:nV {#1} \l_@@_matrix_align_tl
\@@_seq_to_column_vector:N \l_@@_vector_entries_seq
- \end{#1 matrix*}
+ \@@_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}
- \exp_args:NnNV \begin{#1matrix*} [ \l_@@_matrix_align_tl ]
+ \@@_matrix_star_begin:nV {#1} \l_@@_matrix_align_tl
\@@_seq_to_row_vector:N \l_@@_vector_entries_seq
- \end{#1matrix*}
+ \@@_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_row_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
@@ -4411,10 +4643,16 @@
{
\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
@@ -4534,20 +4772,20 @@
\cs_new_protected:Nn \moremath_diagonal_matrix:nn
{
\seq_set_from_clist:Nn \l_@@_mat_diag_entries_seq { #2 }
- \exp_args:NnNV \begin{#1 matrix*} [ \l_@@_matrix_align_tl ]
+ \@@_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
- \end{#1 matrix*}
+ \@@_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 }
- \exp_args:NnNV \begin{ #1 matrix* } [ \l_@@_matrix_align_tl ]
+ \@@_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
- \end{ #1 matrix* }
+ \@@_matrix_star_end:n { #1 }
}
% Small versions
@@ -4577,18 +4815,10 @@
% }
% For convenience we also define some variants of the above functions.
% \begin{macrocode}
-\cs_generate_variant:Nn \moremath_diagonal_matrix:nn { n V }
-\cs_generate_variant:Nn \moremath_diagonal_matrix:nn { V n }
-\cs_generate_variant:Nn \moremath_diagonal_matrix:nn { V V }
-\cs_generate_variant:Nn \moremath_antidiagonal_matrix:nn { n V }
-\cs_generate_variant:Nn \moremath_antidiagonal_matrix:nn { V n }
-\cs_generate_variant:Nn \moremath_antidiagonal_matrix:nn { V V }
-\cs_generate_variant:Nn \moremath_diagonal_smallmatrix:nn { n V }
-\cs_generate_variant:Nn \moremath_diagonal_smallmatrix:nn { V n }
-\cs_generate_variant:Nn \moremath_diagonal_smallmatrix:nn { V V }
-\cs_generate_variant:Nn \moremath_antidiagonal_smallmatrix:nn { n V }
-\cs_generate_variant:Nn \moremath_antidiagonal_smallmatrix:nn { V n }
-\cs_generate_variant:Nn \moremath_antidiagonal_smallmatrix:nn { V V }
+\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.}
@@ -4597,6 +4827,10 @@
% 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}
%
%
@@ -4730,7 +4964,7 @@
\bool_if:nTF \l_@@_predef_crvector_bool
{
% \end{macrocode}
-% \begin{macro}{
+% \begin{macro}[updated=2024-08-20,]{
% \cvector,
% \rvector,
% \smallcvector,
@@ -4747,7 +4981,7 @@
{
\keys_set:nn { moremath / matrix } {#1}
}
- \moremath_column_vector:nn {\l_@@_matrix_delim_tl} {#2}
+ \moremath_column_vector:Vn \l_@@_matrix_delim_tl {#2}
\group_end:
}
}{
@@ -4769,7 +5003,7 @@
{
\keys_set:nn { moremath / matrix } {#1}
}
- \moremath_row_vector:nn {\l_@@_matrix_delim_tl} {#2}
+ \moremath_row_vector:Vn \l_@@_matrix_delim_tl {#2}
\group_end:
}
}{
@@ -4791,7 +5025,7 @@
{
\keys_set:nn {moremath / matrix} {#1}
}
- \moremath_column_smallvector:nn {\l_@@_matrix_delim_tl} {#2}
+ \moremath_column_smallvector:Vn \l_@@_matrix_delim_tl {#2}
\group_end:
}
}{
@@ -4811,7 +5045,7 @@
{
\keys_set:nn { moremath / matrix } {#1}
}
- \moremath_row_smallvector:nn {\l_@@_matrix_delim_tl} {#2}
+ \moremath_row_smallvector:Vn \l_@@_matrix_delim_tl {#2}
\group_end:
}
}{
@@ -4826,13 +5060,16 @@
% 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}{
+% \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,
@@ -4842,7 +5079,7 @@
% \item The \meta{function} to use for this shorthand.
%
% This should be one of the
-% \cs[no-index]{moremath_\meta{type}_\meta{size}vector:nn}
+% \cs[no-index]{moremath_\meta{type}_\meta{size}vector:Vn}
% like commands.
%
% \item The \meta{delimiter} to use.
@@ -4863,7 +5100,7 @@
{
\keys_set:nn {moremath / matrix } {##1}
}
- #2 {\l_@@_matrix_delim_tl} {##2}
+ #2 \l_@@_matrix_delim_tl {##2}
\group_end:
}
}{
@@ -4875,9 +5112,12 @@
}
}
% \end{macrocode}
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Require function with "Vn" signature to pass variable correctly.
+% }
% \end{macro}
%
-% \begin{macro}{
+% \begin{macro}[updated=2024-08-20]{
% \pcvector,
% \bcvector,
% \Bcvector,
@@ -4894,35 +5134,38 @@
% We begin with the column vector.
% \begin{macrocode}
% parenthesis
-\@@_new_vector_shorth_doc_cmd:NNn \pcvector \moremath_column_vector:nn {p}
+\@@_new_vector_shorth_doc_cmd:NNn \pcvector \moremath_column_vector:Vn {p}
% brackets
-\@@_new_vector_shorth_doc_cmd:NNn \bcvector \moremath_column_vector:nn {b}
+\@@_new_vector_shorth_doc_cmd:NNn \bcvector \moremath_column_vector:Vn {b}
% braces
-\@@_new_vector_shorth_doc_cmd:NNn \Bcvector \moremath_column_vector:nn {B}
+\@@_new_vector_shorth_doc_cmd:NNn \Bcvector \moremath_column_vector:Vn {B}
% single vert
-\@@_new_vector_shorth_doc_cmd:NNn \vcvector \moremath_column_vector:nn {v}
+\@@_new_vector_shorth_doc_cmd:NNn \vcvector \moremath_column_vector:Vn {v}
% double vert
-\@@_new_vector_shorth_doc_cmd:NNn \Vcvector \moremath_column_vector:nn {V}
+\@@_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:nn {p}
+\@@_new_vector_shorth_doc_cmd:NNn \prvector \moremath_row_vector:Vn {p}
% brackets
-\@@_new_vector_shorth_doc_cmd:NNn \brvector \moremath_row_vector:nn {b}
+\@@_new_vector_shorth_doc_cmd:NNn \brvector \moremath_row_vector:Vn {b}
% braces
-\@@_new_vector_shorth_doc_cmd:NNn \Brvector \moremath_row_vector:nn {B}
+\@@_new_vector_shorth_doc_cmd:NNn \Brvector \moremath_row_vector:Vn {B}
% single vert
-\@@_new_vector_shorth_doc_cmd:NNn \vrvector \moremath_row_vector:nn {v}
+\@@_new_vector_shorth_doc_cmd:NNn \vrvector \moremath_row_vector:Vn {v}
% double vert
-\@@_new_vector_shorth_doc_cmd:NNn \Vrvector \moremath_row_vector:nn {V}
+\@@_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}{
+% \begin{macro}[updated=2024-08-20]{
% \psmallcvector,
% \bsmallcvector,
% \Bsmallcvector,
@@ -4939,32 +5182,32 @@
% \begin{macrocode}
% column vectors
% parenthesis
-\@@_new_vector_shorth_doc_cmd:NNn \psmallcvector \moremath_column_smallvector:nn
+\@@_new_vector_shorth_doc_cmd:NNn \psmallcvector \moremath_column_smallvector:Vn
{p}
% brackets
-\@@_new_vector_shorth_doc_cmd:NNn \bsmallcvector \moremath_column_smallvector:nn
+\@@_new_vector_shorth_doc_cmd:NNn \bsmallcvector \moremath_column_smallvector:Vn
{b}
% braces
-\@@_new_vector_shorth_doc_cmd:NNn \Bsmallcvector \moremath_column_smallvector:nn
+\@@_new_vector_shorth_doc_cmd:NNn \Bsmallcvector \moremath_column_smallvector:Vn
{B}
% single vert
-\@@_new_vector_shorth_doc_cmd:NNn \vsmallcvector \moremath_column_smallvector:nn
+\@@_new_vector_shorth_doc_cmd:NNn \vsmallcvector \moremath_column_smallvector:Vn
{v}
% double vert
-\@@_new_vector_shorth_doc_cmd:NNn \Vsmallcvector \moremath_column_smallvector:nn
+\@@_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:nn {p}
+\@@_new_vector_shorth_doc_cmd:NNn \psmallrvector \moremath_row_smallvector:Vn {p}
% brackets
-\@@_new_vector_shorth_doc_cmd:NNn \bsmallrvector \moremath_row_smallvector:nn {b}
+\@@_new_vector_shorth_doc_cmd:NNn \bsmallrvector \moremath_row_smallvector:Vn {b}
% braces
-\@@_new_vector_shorth_doc_cmd:NNn \Bsmallrvector \moremath_row_smallvector:nn {B}
+\@@_new_vector_shorth_doc_cmd:NNn \Bsmallrvector \moremath_row_smallvector:Vn {B}
% single vert
-\@@_new_vector_shorth_doc_cmd:NNn \vsmallrvector \moremath_row_smallvector:nn {v}
+\@@_new_vector_shorth_doc_cmd:NNn \vsmallrvector \moremath_row_smallvector:Vn {v}
% double vert
-\@@_new_vector_shorth_doc_cmd:NNn \Vsmallrvector \moremath_row_smallvector:nn {V}
+\@@_new_vector_shorth_doc_cmd:NNn \Vsmallrvector \moremath_row_smallvector:Vn {V}
}{ % \bool_if:nTF \l_@@_predef_crvector_bool FALSE PATH
@@ -4978,6 +5221,9 @@
% 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}
%
%
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 05251bd9cd5..58a841a6553 100644
--- a/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx
+++ b/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx
@@ -17,8 +17,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{6.28b}
-\def\myfiledate{2024/06/29}
+\def\myfileversion{6.28c}
+\def\myfiledate{2024/08/22}
%
%
%<*batchfile>
@@ -2449,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 } { . }
@@ -2509,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 ,
@@ -2521,11 +2521,11 @@ 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 ,
@@ -2537,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 ,
@@ -2551,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 ,
@@ -2644,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 } ,
@@ -2698,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 ,
@@ -2741,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 ,
@@ -2754,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 ,
@@ -2858,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 ,
@@ -2878,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 }
{
@@ -2904,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 ,
@@ -2915,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}
%
@@ -2941,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}
@@ -2952,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 ,
@@ -2963,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.
@@ -2976,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 ,
@@ -3003,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 }
}
@@ -4282,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 ,
@@ -4298,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}
@@ -4559,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}
%
@@ -4592,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
@@ -6153,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}
@@ -7487,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 } }
@@ -7505,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 }
@@ -7536,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
@@ -7588,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 }
}
@@ -7605,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 }
}
@@ -7969,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}
%
%
@@ -8578,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:
@@ -8673,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:
@@ -8801,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:
@@ -8950,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:
@@ -9014,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
+ }
}
}
}
@@ -9045,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:
@@ -9090,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
+ }
}
}
}
@@ -9603,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 }
}
@@ -9633,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 }
}
@@ -9651,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 ,
@@ -9810,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:
@@ -9916,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:
@@ -9943,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 ,
@@ -10004,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
{
@@ -10125,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 ,
@@ -10162,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}
@@ -10608,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 ,
@@ -10645,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).
@@ -11304,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 ,
@@ -11327,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 ,
@@ -11378,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
@@ -11477,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:
{
@@ -11633,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
{
@@ -11643,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:
}
@@ -11738,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:
{
@@ -12018,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
@@ -12040,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 ,
@@ -12064,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 }
@@ -12112,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 ,
@@ -12150,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 ,
@@ -12240,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
@@ -12566,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 =
{
@@ -12583,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
@@ -12998,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 ,
@@ -13042,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~
@@ -13139,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}
@@ -13182,11 +13207,11 @@ version 2005/12/01 or later.
\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 }
+ { \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 }
+ { \exp_args:Nee \@@_Block_iv:nnnnn }
+ }
+ { \exp_args:Nee \@@_Block_v:nnnnn }
{ \l_tmpa_int } { \l_tmpb_int } { #3 } { #4 } { #5 }
}
% \end{macrocode}
@@ -13254,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
}
@@ -13614,7 +13671,7 @@ 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 ,
@@ -13785,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}
%
%
@@ -14190,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
{
@@ -14391,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
@@ -14402,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
@@ -14456,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 =
@@ -14478,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
@@ -14502,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
@@ -14534,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
@@ -14584,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
@@ -14653,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 ,
@@ -14677,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 ] }
(
[
@@ -14702,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}
@@ -14738,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 ,
@@ -14749,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
@@ -14770,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 }
@@ -15139,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 ,
@@ -15160,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}
%
@@ -15173,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 ,
@@ -15199,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 ,
@@ -15331,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
@@ -15772,7 +15845,7 @@ 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 ,
@@ -15816,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
@@ -15967,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
@@ -15992,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.
@@ -16282,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 ,
@@ -16295,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
@@ -17534,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 }
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/polyglossia/polyglossia.dtx b/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx
deleted file mode 100644
index 9e018afc668..00000000000
--- a/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx
+++ /dev/null
@@ -1,30582 +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.2
-## 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) 2023-2024 Udi Fogiel
- (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 The Polyglossia Team http://github.com/reutenauer/polyglossia/
-
- Except where otherwise noted, Polyglossia is placed under the terms of the
- MIT licence (https://opensource.org/licenses/MIT).
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"),
- to deal in the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the Software
- is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
- INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR
- A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
- OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- Please report issues to http://github.com/reutenauer/polyglossia/issues
-
-
-\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-cjk-spacing.lua}{\from{polyglossia.dtx}{polyglossia-cjk-spacing.lua}}}
-\generate{\file{polyglossia-french.lua}{\from{polyglossia.dtx}{polyglossia-french.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-acadian.ldf}{\from{polyglossia.dtx}{gloss-acadian.ldf}}}
-\generate{\file{gloss-aeb.ldf}{\from{polyglossia.dtx}{gloss-aeb.ldf}}}
-\generate{\file{gloss-af.ldf}{\from{polyglossia.dtx}{gloss-af.ldf}}}
-\generate{\file{gloss-afb.ldf}{\from{polyglossia.dtx}{gloss-afb.ldf}}}
-\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-classiclatin.ldf}{\from{polyglossia.dtx}{gloss-classiclatin.ldf}}}
-\generate{\file{gloss-cop.ldf}{\from{polyglossia.dtx}{gloss-cop.ldf}}}
-\generate{\file{gloss-coptic.ldf}{\from{polyglossia.dtx}{gloss-coptic.ldf}}}
-\generate{\file{gloss-croatian.ldf}{\from{polyglossia.dtx}{gloss-croatian.ldf}}}
-\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-ecclesiasticlatin.ldf}{\from{polyglossia.dtx}{gloss-ecclesiasticlatin.ldf}}}
-\generate{\file{gloss-el-monoton.ldf}{\from{polyglossia.dtx}{gloss-el-monoton.ldf}}}
-\generate{\file{gloss-el-polyton.ldf}{\from{polyglossia.dtx}{gloss-el-polyton.ldf}}}
-\generate{\file{gloss-el.ldf}{\from{polyglossia.dtx}{gloss-el.ldf}}}
-\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-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-medievallatin.ldf}{\from{polyglossia.dtx}{gloss-medievallatin.ldf}}}
-\generate{\file{gloss-mk.ldf}{\from{polyglossia.dtx}{gloss-mk.ldf}}}
-\generate{\file{gloss-ml.ldf}{\from{polyglossia.dtx}{gloss-ml.ldf}}}
-\generate{\file{gloss-mn.ldf}{\from{polyglossia.dtx}{gloss-mn.ldf}}}
-\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}}}
-\def\MetaPrefix{-- }
-\generate{\file{polyglossia-cjk-spacing.lua}{\from{polyglossia.dtx}{polyglossia-cjk-spacing.lua}}}
-\generate{\file{polyglossia-french.lua}{\from{polyglossia.dtx}{polyglossia-french.lua}}}
-\generate{\file{polyglossia-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}
-\ifxetex
- \let\XeTeX\undefined
- \let\XeLaTeX\undefined
-\fi
-\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}
-% Package culmus
-\newfontfamily\hebrewfont[Script=Hebrew]{DavidCLM}[
- UprightFont = *-Medium,
- BoldFont = *-Bold,
- Extension = .otf,
- ItalicFont = *-MediumItalic,
- BoldItalicFont = *-BoldItalic]
-% Package dejavu-otf
-\newfontfamily\armenianfont[Script=Armenian,Scale=MatchLowercase]{DejaVuSans}
-\newfontfamily\georgianfont[Scale=MatchLowercase]{DejaVuSerif}
-% Package amiri
-\newfontfamily\arabicfont[Script=Arabic]{Amiri}[%
- UprightFont = *-Regular,
- BoldFont = *-Bold,
- Extension = .ttf,
- ItalicFont = *-Italic,
- BoldItalicFont = *-BoldItalic]
-% No Syriac otf/ttf font seems available on CTAN
-% This one, from the Syriac Institute, is included on Linux
-% in the x11-fonts set and can be downloaded from
-% 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 & variant=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 \pkg{polyglossia} it is possible to associate a specific font with any script or language
-% that occurs in the document. That font should always be defined as
-% \cmd{\⟨script⟩font}\ or \cmd{\⟨language⟩font}. Note that ¦⟨language⟩¦ points to the \pkg{polyglossia}
-% language name, ¦⟨script⟩¦ might point either to an OpenType script name as defined by \pkg{fontspec}
-% (\eg ¦Latin¦) \new{2.2}or a BCP-47 script tag (\eg ¦Latn¦), though the script is fully lower-cased
-% in the \cmd{\⟨script⟩font}\ command.
-%
-% For instance, if the default font defined by \cmd\setmainfont\
-% does not support Greek, then one can define the font used to display Greek with:\\
-% \centerline{\cmd\newfontfamily\cmd{\greekfont[Script=Greek,\meta{…}]\marg{font}}}
-% ^^A
-% If you want to setup a blackletter font specifically for the German blackletter script variant,
-% you might do so by:\\
-% \centerline{\cmd\newfontfamily\cmd{\latffont[\meta{…}]\marg{font}}}
-% ^^A
-% Setting up a font specifically for traditional Chinese is possible via:\\
-% \centerline{\cmd\newfontfamily\cmd{\hantfont[Script=CJK,\meta{…}]\marg{font}}}
-% ^^A
-% Note that \pkg{polyglossia} will use the font defined as is, so assure to do all necessary settings
-% (please refer to the \pkg{fontspec} documentation for details).
-% For instance, if \cmd\arabicfont\ is explicitly defined, then the option ¦Script=Arabic¦ should
-% be included in that definition.
-%
-% 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. If this is not the case, it will check whether a font associated
-% with the BCP-47 script tag of the current language is defined. If this also isn't the case, \pkg{polyglossia}
-% will finally check (but this only for languages in non-Latin scripts) whether there is a font associated
-% with the OpenType script tag. If none of these fonts is defined, \pkg{polyglossia} will use the currently
-% active font as defined by ¦\setmainfont¦, ¦\setsansfont¦ or ¦\setmonofont¦ and – in the case of OpenType fonts –
-% will attempt to turn on the appropriate OpenType tags for the script and language used, in case these are available in
-% the font, by means of \pkg{fontspec}’s \cmd\addfontfeature. If the current font
-% does not appear to support the script of that language, an error message is
-% displayed.
-%
-% \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
-% documentation for them is available on the
-% Internet.\footnote{Refer to \url{https://github.com/gregorio-project/hyphen-la/blob/master/doc/README.md\#hyphenation-styles}}
-% Each of the four variants mentioned above has its default set of hyphenation
-% patterns as indicated by table \ref{tab:latin-hyphenation}. Use the
-% ¦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 similar 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 Millennium 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.2 (2024/07/15)}
-%
-% \subsubsection*{Bug fixes}
-% \begin{itemize}
-% \item Fix \texttt{lang} environment (\TXI{633}).
-% \item Fix first number of Maghrib abjad numbering for Algeria, Morocco and
-% Tunisia (\TXI{640}).
-% \item Fix some captions strings in Bulgarian, Chinese, Esperanto, Estonian, Hindi,
-% Latvian, and Slovak (\TXP{651})
-% \item Improve performance with multilingual documents that have a TOC (\TXI{641}).
-% \end{itemize}
-%
-% \subsubsection*{New Features}
-% \begin{itemize}
-% \item Add possibility to associate a font to a language/variant with reference to
-% a BCP-47 script tag (\TXI{636}).
-% \end{itemize}
-%
-% \subsubsection*{Internal work}
-% \begin{itemize}
-% \item The major rewrite of the package code has been finished. More code has been cleaned up,
-% and \pkg{polyglossia} employs modern concepts (\pkg{latex3} and modern \LaTeXe).
-% All key-val handling uses \pkg{l3keys} now rather than \pkg{xkeyval}.
-% \end{itemize}
-%
-% \subsection*{2.1 (2024/03/07)}
-%
-% \subsubsection*{Bug fixes}
-% \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 comparison: \TA{Johannes
-% Braams} and the numerous contributors to the \pkg{babel} package (in particular
-% \TA{Boris Lavva} and others for its Hebrew support), \TA{Alexej Kryukov} (\pkg{antomega}),
-% \TA{Will Robertson} (\pkg{fontspec}), \TA{Apostolos Syropoulos} (\pkg{xgreek}), \TA{Youssef Jabri}
-% (\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{Stephen Huan}, \TA{Najib Idrissi}, user \TA{julroy67}, \TA{Dohyun Kim}, \TA{Phil Kime},
-% \TA{Mike Kroutikov}, \TA{Ivan Kokan}, \TA{Caleb Maclennan}, \TA{Gyula Magyarkuti}, \TA{José Mancera}, \TA{Miquel Ortega},
-% \TA{Yevgen Pogribnyi}, \TA{Will Robertson}, \TA{Maïeul Rouquette}, \TA{Elie Roux}, \TA{Hugo Roy}, \TA{Guy Rutenberg},
-% \TA{Marcin Serwin}, \TA{Arvinder Singh}, \TA{Avisek Jena}, \TA{Philipp Stephani}, \TA{Niranjan Tambe}, \TA{Takuji Tanaka},
-% \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/07/15} {v2.2}
- {Modern multilingual typesetting with XeLaTeX and LuaLaTeX}
-
-% TODO Handle remaining uses in the gloss files (\patchcmd)
-% and remove package call afterwards
-\RequirePackage{etoolbox}
-% 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
-
-%% 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
-\hook_gput_code:nnn {begindocument/before} {.}
-{
- \cs_gset_eq:NN \bbl@set@language \xpg_set_language_aux:nn % for biblatex
- \cs_gset_eq:NN \bbl@main@language \xpg_main_language_tl % for biblatex
- \ProvideDocumentCommand \texorpdfstring { m m } { #1 } % dummy command if hyperref is not loaded
-}
-
-%% 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
- {
- \lua_load_module:n{polyglossia}
- }{
- \cs_if_free:cT { l@nohyphenation }
- { \chardef\l@nohyphenation=255 }
- }
-
-% Which version of XeTeX do we use? What is the boundary class? 4095 or 255
-\cs_if_exist:cTF { e@alloc@intercharclass@top }
- { \cs_gset_eq:NN \xpg@boundaryclass \e@alloc@intercharclass@top }
- { \chardef\xpg@boundaryclass=\@cclv }
-
-% Useful for getting list of loaded languages and variants. Like babel's bbl@loaded
-% 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
- \cs_gset_eq:cc{latin@alph}{@alph}% TODO rename when we have the C locale
- \cs_gset_eq:cc{latin@Alph}{@Alph}% TODO rename when we have the C locale
- % push to C language gloss
- \cs_gset_eq:cc{xpg_Clang_arabic}{@arabic}
-
- \xpg_initial_setup:
- % apply \familydefault changes
- \xpg_set_familydefault:
-}
-
-\hook_gput_code:nnn {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
-\hook_gput_code:nnn {begindocument/end} {.}
-{
- % now we have the C locale definition: select the language
- \__xpg_at_begin_document_selectlanguage:
- \bool_gset_true:N \g_xpg_main_lang_set_bool
- % If hyphenation disabling has been requested in preamble, do it now
- \__xpg_at_begin_document_hyphenation:
-}
-
-%
-% MESSAGES
-%
-
-% message templates
-\msg_new:nnn { polyglossia } { general } { #1 }
-
-\msg_new:nnn { polyglossia } { languagenotloaded }
-{
- The~ language~ #1~ is~ not~ loaded.~ You~ must~ load~ it~ in~ order~ to~ use~ it.
-}
-\msg_redirect_name:nnn { polyglossia } { languagenotloaded } { critical }
-
-\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~ a~ value.
-}
-
-\msg_new:nnn { polyglossia } { illvalue }
-{
- Illegal~ value~ (#1)~ for~ #2!
-}
-
-\msg_new:nnn { polyglossia } { illarg }
-{
- Invalid~ argument~ (#1)~ for~ #2!
-}
-
-\msg_new:nnn { polyglossia } { nopatterns }
-{
- No~ hyphenation~ patterns~ were~ loaded~ for~ `#2' \iow_newline:
- I~ will~ use~ \string\language=\string\l@ #1\space instead.
-}
-
-\msg_new:nnn { polyglossia } { undefcmd }
-{
- \tl_to_str:N {#1} ~ is~ not~ defined!
-}
-
-%% custom message macros
-\cs_new_nopar:Nn \xpg_error_msg:n
-{
- \exp_args:Nnne \msg_error:nnn { polyglossia } { general } { #1 }
-}
-
-\cs_new_nopar:Nn \xpg_warning_msg:n
-{
- \exp_args:Nnne \msg_warning:nnn { polyglossia } { general } { #1 }
-}
-
-\cs_new_nopar:Nn \xpg_info_msg:n
-{
- \exp_args:Nnne \msg_info:nnn { polyglossia } { general } { #1 }
-}
-
-\cs_new_nopar:Nn \xpg_no_patterns_msg:n
-{
- \msg_warning:nnnn { polyglossia } { nopatterns } { nohyphenation } { #1 }
-}
-
-\cs_new_nopar:Nn \xpg_ill_value_msg:nn
-{
- \msg_warning:nnnn { polyglossia } { illvalue } { #1 } { #2 }
-}
-
-\cs_new_nopar:Nn \xpg_ill_arg_msg:nn
-{
- \msg_error:nnnn { polyglossia } { illarg } { #1 } { #2 }
-}
-
-% error out if lang is not loaded
-\cs_new_nopar:Nn \xpg_error_if_lang_not_loaded:n
-{
- \seq_if_in:NeF \__xpg_langs_loaded {#1}
- {
- \msg_error:nnn { polyglossia } { languagenotloaded } { #1 }
- }
-}
-
-%% use macro if defined, else warn that it is not
-\cs_new_nopar:Nn \__xpg_use_or_warn:N
-{
- \cs_if_exist_use:NF {#1}
- {
- \msg_error:nnn { polyglossia } { undefcmd } { #1 }
- }
-}
-\cs_generate_variant:Nn \__xpg_use_or_warn:N {c}
-
-% gloss message interface
-\cs_set_eq:cc { xpg@error } { xpg_error_msg:n }
-\cs_set_eq:cc { xpg@warning } { xpg_warning_msg:n }
-\cs_set_eq:cc { xpg@info } { xpg_info_msg:n }
-\cs_set_eq:cc { xpg@ill@value } { xpg_ill_value_msg:nn }
-
-
-\NewDocumentCommand \XPGNoPatternsFallback { O{ nohyphenation } m }
-{
- \msg_warning:nnnn { polyglossia } { nopatterns } { #1 } { #2 }
- \exp_args:Ncc \adddialect {l@#2} {l@#1}
-}
-
-\NewDocumentCommand \CheckHyphenationPatterns { m }
-{
- \xpg_if_language_defined:nF {#1}
- {
- \XPGNoPatternsFallback{#1}
- }
-}
-
-%
-% END MESSAGES
-
-
-%% ensure directionality if bidi is loaded, else ignore
-%%% FIXME still used?
-\cs_new_nopar:Npn \@@ensure@dir #1
-{
- \cs_if_exist_use:c{@ensure@dir}{#1}
-}
-
-\cs_new_nopar:Npn \@@ensure@maindir #1
-{
- \cs_if_exist_use:c{@ensure@maindir}{#1}
-}
-
-% if we are in the document preamble run T else F
-\prg_set_conditional:Nnn \xpg_if_in_preamble: {T, F, TF}
-{
- \cs_if_eq:NNTF { \@onlypreamble } { \@notprerr }
- {
- \prg_return_false:
- }
- {
- \prg_return_true:
- }
-}
-
-%% Used by the language definitions files for right-to-left languages
-\DeclareDocumentCommand \RequireBidi {}
- {
- \xpg_if_in_preamble:T
- {
- \sys_if_engine_luatex:TF
- { \RequirePackage{luabidi} }
- { \RequirePackage{bidi} }
- }
- \DeclareDocumentCommand \RequireBidi {} {}
- }
-
-% if #1 is LR run T else F
-\prg_set_conditional:Nnn \__xpg_if_LR_str:n {p, T, F, TF}
-{
- \str_case_e:nnF{#1}
- {
- {LR}{\prg_return_true:}
- {RL}{\prg_return_false:}
- }
- {
- \xpg_error_msg:n {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_msg:n {right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}
- }
-}
-\cs_new_nopar:Nn \__xpg_set_text_direction:n
-{
- \__xpg_if_LR_str:nF {#1}
- {
- \xpg_error_msg:n {right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}
- }
-}
-\hook_gput_code:nnn {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
- }
- }
-}
-\hook_gput_code:nnn {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
-\cs_set:Npn \addto #1 #2
-{
- \cs_if_exist:NF { #1 }
- { \cs_new:Npn { #1 } {} }
- \tl_gput_right:Nn { #1 } { #2 }
-}
-
-%% 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 \CheckHyphenationPatterns - i.e. with a warning: e.g. sanskrit for hindi,
-%%%% or catalan for asturian. – Also for languages with variants!
-%%%% (English and German, etc.)
-%% script : the name of the script (as understood by fontspec) – default is Latin
-%% scripttag : the OpenType tag for the script
-%% langtag : the OpenType tag for the language
-%% 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
-\NewDocumentCommand \PolyglossiaSetup { m m }
-{
- \__xpg_keys_define_lang:n{#1}
- \keys_set:nn { polyglossia / #1 } { #2 }
- \__xpg_setup_hyphen:n {#1}
- %define booleans etoolbox style and set defaults
- %% TODO ? \providetoggle{#1@setup@done}%
- % we initialize this so that we can append below
- \cs_gset:cpn {init@extras@#1} {}
- % here we do the fontsetup:
- \__xpg_auto_setupfont:n { #1 }
- %% TODO? \toggletrue{#1@setup@done}
- % 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 } }
-}
-
-\bool_new:N \l__xpg_have_hyphen_bool
-% setup hyphennames from a str list of hyphen
-\cs_new:Nn \__xpg_setup_hyphen:n
-{
- \clist_set:Ne{\l_tmpa_clist}{\prop_item:Nn \l_xpg_langsetup_prop {#1 / hyphennames}}
- \bool_set_false:N \l__xpg_have_hyphen_bool
- % for each hyphen in the set until we find one that works
- \clist_map_inline:Nn \l_tmpa_clist
- {
- \bool_if:NF \l__xpg_have_hyphen_bool
- {
- % check if language hyphenname is defined
- \__xpg_pattern_check_if_exists:nF{#1}
- {
- % if not, first consider nohyphenation
- \str_if_eq:nnTF{##1}{nohyphenation}
- {
- \cs_gset_eq:cc{l@#1}{l@##1}
- \bool_gset_true:N \l__xpg_have_hyphen_bool
- }
- {
- % then test if hyphenation is defined
- \xpg_if_language_defined:nT {##1}
- {
- % test if language hyphenation is nohyphenation
- \cs_if_eq:cNTF{l@#1}{\l@nohyphenation}
- { \bool_gset_true:N \l__xpg_have_hyphen_bool }
- {
- % if false define language to hyphenation if it is not equal...
- \str_if_eq:nnF{#1}{##1}{\cs_gset_eq:cc{l@#1}{l@##1}}
- % ...and load
- \xpg_set_hyphenation_patterns:n {##1}
- \bool_gset_true:N \l__xpg_have_hyphen_bool
- }
- }
- }
- }
- }
- }
- % 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
- \bool_if:NF \l__xpg_have_hyphen_bool
- {
- \CheckHyphenationPatterns{#1}
- }
- \cs_gset:cpn {#1@language}
- {
- \SetupPolyglossiaLangPatterns{#1}
- }
- % setup hyphenmins
- \clist_set:Ne \l_tmpa_clist
- { \prop_item:Nn \l_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} }
- }
- }
-}
-
-\NewDocumentCommand \SetupPolyglossiaLangPatterns { m }
-{
- \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:n {#1}
- }
- }
- {
- % Since this function is sometimes called from the gloss files
- % directly, we need to check whether the requested hyphenname exists.
- \CheckHyphenationPatterns{#1}
- \xpg_set_hyphenation_patterns:n {#1}
- }
- }
-}
-
-\prop_new_linked:N \l_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_put:Nnn \l_xpg_langsetup_prop {#1/script}{##1}
- \prop_put:Nne \l_xpg_langsetup_prop {#1/lcscript}
- {\tl_if_empty:nF{##1}{\str_lowercase:n{##1}}}
- },
- #1 / script
- .value_required:n = true,
- #1 / script
- .initial:n = latin,
- % the opentype script tag
- #1 / scripttag
- .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/scripttag}{##1}},
- #1 / scripttag
- .default:n = {},
- #1 / scripttag
- .initial:n = {},
- % the language full name
- #1 / language
- .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/language}{##1}},
- #1 / language
- .value_required:n = true,
- #1 / language
- .initial:x = {\str_uppercase:n#1},
- % the language tag
- #1 / langtag
- .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/langtag}{##1}},
- #1 / langtag
- .value_required:n = true,
- #1 / langtag
- .initial:n = {},
- % the BCP-47 tag
- #1 / bcp47
- .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47}{##1}},
- #1 / bcp47
- .value_required:n = true,
- #1 / bcp47
- .initial:n = {},
- % the BCP-47 language tag
- #1 / bcp47-language
- .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-language}{##1}},
- #1 / bcp47-language
- .value_required:n = true,
- #1 / bcp47-language
- .initial:n = {},
- % the BCP-47 region tag
- #1 / bcp47-region
- .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-region}{##1}},
- #1 / bcp47-region
- .value_required:n = false,
- #1 / bcp47-region
- .initial:n = {},
- % the BCP-47 script tag
- #1 / bcp47-script
- .code:n =
- {
- \prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-script}{##1}
- \prop_put:Nne \l_xpg_langsetup_prop {#1/lc-bcp47-script}
- {\tl_if_empty:nF{##1}{\str_lowercase:n{##1}}}
- },
- #1 / bcp47-script
- .value_required:n = true,
- #1 / bcp47-script
- .initial:n = {Latn},
- % the BCP-47 variant tag
- #1 / bcp47-variant
- .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-variant}{##1}},
- #1 / bcp47-variant
- .value_required:n = false,
- #1 / bcp47-variant
- .initial:n = {},
- % the BCP-47 extension-t tag
- #1 / bcp47-extension-t
- .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-extension-t}{##1}},
- #1 / bcp47-extension-t
- .value_required:n = false,
- #1 / bcp47-extension-t
- .initial:n = {},
- % the BCP-47 extension-u tag
- #1 / bcp47-extension-u
- .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-extension-u}{##1}},
- #1 / bcp47-extension-u
- .value_required:n = false,
- #1 / bcp47-extension-u
- .initial:n = {},
- % the BCP-47 extension-x tag
- #1 / bcp47-extension-x
- .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-extension-x}{##1}},
- #1 / bcp47-extension-x
- .value_required:n = false,
- #1 / bcp47-extension-x
- .initial:n = {},
- % the BCP-47 casing alias
- #1 / bcp47-casing
- .code:n = {\prop_put:Nnn \l_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_put:Nne \l_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_put:Nnn \l_xpg_langsetup_prop {#1/direction}{##1} }
- { \xpg_error_msg:n {Unknown~ direction~ "##1"~ for~ language~ "#1"} }
- },
- #1 / direction
- .value_required:n = true,
- #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_msg:n {hypenmins~should~be~a~list~of~two~entries,~got~"##1"} }
- % set prop
- \prop_put:Nnn \l_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_msg:n {totalhyphenhypenmin~should~be~a~single~entry,~got~"##1"} }
- % set prop
- \prop_put:Nnn \l_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_put:Nnn \l_xpg_langsetup_prop {#1/envname}{##1}
- },
- #1/ envname.value_required:n = true,
- #1/ envname.initial:n = {#1},
- % babel name
- #1 / babelname
- .code:n = {
- \prop_put:Nnn \l_xpg_langsetup_prop {#1/babelname}{##1}
- },
- #1/ babelname.value_required:n = true,
- #1/ babelname.initial:n = {#1},
- % default numerals
- #1 / localnumeral
- . code:n = {
- \prop_put:Nnn \l_xpg_langsetup_prop {#1/localnumeral}{##1}
- \prop_put:Nnn \l_xpg_langsetup_prop {#1/Localnumeral}{##1}
- },
- #1 / localnumeral.value_required:n = true,
- #1 / localnumeral.initial:n = {xpg_C_localnumeral:nn},
- % uppercased
- #1 / Localnumeral
- . code:n = {
- \prop_put:Nnn \l_xpg_langsetup_prop {#1/Localnumeral}{##1}
- },
- #1 / Localnumeral.value_required:n = true,
- #1 / Localnumeral.initial:n = {xpg_C_localnumeral:nn},
- % environment define command (by default create the environment)
- #1 / DefineCommandsCmd
- .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/DefineCommandsCmd}{##1}},
- #1 / DefineCommandsCmd
- .value_required:n = true,
- #1 / DefineCommandsCmd
- .initial:n = {xpg_define_language_commands:e}
- }
-}
-
-\DeclareExpandableDocumentCommand \babelname { }
- {
- \prop_item:Ne \l_xpg_langsetup_prop { \languagename / babelname }
- }
-
-\DeclareExpandableDocumentCommand \mainbabelname { }
- {
- \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / babelname }
- }
-
-% TODO move to C module
-\cs_new:Nn \xpg_C_localnumeral:nn
-{
- \xpg_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 \l_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 }
- { \__xpg_french_indent: } { \__xpg_no_french_indent: }
- }
-
-\cs_new:Nn \__xpg_lang_set_par_direction:n
-{
- \prop_get:NeNTF \l_xpg_langsetup_prop {#1/direction} \l_tmpa_tl
- {
- \__xpg_set_par_direction:n{\l_tmpa_tl}
- }
- {
- \xpg_error_msg:n {Could~ not~ retrieve~ key~ direction~ for~ language~ "#1"}
- \prop_show:N{\l_xpg_langsetup_prop}
- }
-}
-
-
-\cs_new:Nn \__xpg_lang_set_text_direction:nn
-{
- \prop_get:NeNTF \l_xpg_langsetup_prop {#1/direction} \l_tmpa_tl
- {
- \__xpg_set_text_direction:n{\l_tmpa_tl}{#2}
- }
- {
- \xpg_error_msg:n {Could~ not~ retrieve~ key~ direction~ for~ language~ "#1"}
- \prop_show:N{\l_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:n 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{\l_xpg_langsetup_prop}{#1/lcscript}}{latin}
- {\SetupLatinPolyglossiaFont{#1}}
- {\SetupNonLatinPolyglossiaFont{#1}}
- }
- {
- \xpg_info_msg:n{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_msg:n{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:nT {TUR}
- {
- \addfontfeature{Language=Turkish}
- }
- }
- }{
- \fontspec_if_language:nT{#1}
- {
- \addfontfeature{Language=#2}
- }
- }
- }
-}
-\cs_generate_variant:Nn \__xpg_add_font_feature_language:nn { ee }
-
-% add fontfeature Script=#3 to scripttag #2 for family #1
-% do nothing if #2 or #3 is empty
-\cs_new:Nn \__xpg_add_font_feature_script:nnn
-{
- \bool_if:nTF{\tl_if_empty_p:n{#2} || \tl_if_empty_p:n{#3}}
- {
- % maybe an error ?
- \xpg_warning_msg:n{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_msg:n
- {
- The~ current~ main ~ \xpg_ffamily_tl\space font,~ \xpg_fname_str,~ does~ not~ contain~ the~"#3"~ script! \iow_newline:
- Please~ define~\csname\tl_if_empty:nF{#3}{\str_lowercase:n{#3}}font\xpg_ffamilysh_tl\endcsname~
- with~ \string\newfontfamily\space command
- }
- }
- }
-}
-\cs_generate_variant:Nn \__xpg_add_font_feature_script:nnn { nee }
-
-%% TODO: probably can be cleaned a little more
-\cs_new_protected:Npn \__xpg_setup_font:nnnnn #1 #2 #3 #4 #5 % #1 = lang, #2 = family, #3 = family, #4 = gobble, #5 gobble
- {
- \cs_set_protected_nopar:cpn { #1@font@#2 }
- {
- \cs_if_exist_use:cF{ #1font#3 }
- {
- \cs_if_exist_use:cF { \prop_item:Nn \l_xpg_langsetup_prop { #1 / lc-bcp47-script } font#3 }
- {
- #4 { \prop_item:Nn \l_xpg_langsetup_prop { #1 / lcscript } font#3 }
- {
- \use:c { #2familylatin }
- #5
- {
- \__xpg_add_font_feature_script:nee { #2 }
- { \prop_item:Nn \l_xpg_langsetup_prop { #1 / scripttag } }
- { \prop_item:Nn \l_xpg_langsetup_prop { #1 / script } }
- }
- }
- }
- \__xpg_add_font_feature_language:ee
- { \prop_item:Nn \l_xpg_langsetup_prop { #1 / langtag } }
- { \prop_item:Nn \l_xpg_langsetup_prop { #1 / language } }
- }
- \tl_set:Nn \familytype { #2 }
- }
- }
-
-\NewDocumentCommand \SetupLatinPolyglossiaFont { m }
- {
- \__xpg_setup_font:nnnnn { #1 } { rm } { } { \use_ii:nn } { \use_none:n }
- \__xpg_setup_font:nnnnn { #1 } { sf } { sf } { \use_ii:nn } { \use_none:n }
- \__xpg_setup_font:nnnnn { #1 } { tt } { tt } { \use_ii:nn } { \use_none:n }
- }
-
-\NewDocumentCommand \SetupNonLatinPolyglossiaFont { m }
- {
- \__xpg_setup_font:nnnnn { #1 } { rm } { } { \cs_if_exist_use:cF } { \use:n }
- \__xpg_setup_font:nnnnn { #1 } { sf } { sf } { \cs_if_exist_use:cF } { \use:n }
- \__xpg_setup_font:nnnnn { #1 } { tt } { tt } { \cs_if_exist_use:cF } { \use:n }
- }
-
-%%% END OF PolyglossiaSetup
-
-%% 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_msg:n{Option:~ localmarks}
- \cs_gset_nopar:Nn \__xpg_local_marks:n
- {
- \DeclareDocumentCommand \markboth { m m }
- {
- \group_begin:
- \cs_set_eq:cc { label } { relax }
- \cs_set_eq:cc { index } { relax }
- \cs_set_eq:cc { glossary } { relax }
- \unrestored@protected@xdef\@themark
- {
- {\foreignlanguage{##1}{\protect\@@ensure@maindir{####1}}}
- {\foreignlanguage{##1}{\protect\@@ensure@maindir{####2}}}
- }
- \@temptokena \expandafter{\@themark}
- \mark_insert:nn{2e-left}{####1}
- \mark_insert:nn{2e-right}{####2}
- \tl_if_empty:nF{####2}{ \mark_insert:nn{2e-right-nonempty}{####2} }
- \mark{\the\@temptokena}
- \group_end:
- \if@nobreak\ifvmode\nobreak\fi\fi
- }
- \DeclareDocumentCommand \markright { m }
- {
- \group_begin:
- \cs_set_eq:cc { label } { relax }
- \cs_set_eq:cc { index } { relax }
- \cs_set_eq:cc { glossary } { relax }
- \expandafter\@markright\@themark
- {\foreignlanguage{##1}{\protect\@@ensure@maindir{####1}}}
- \@temptokena \expandafter{\@themark}
- \mark_insert:nn{2e-right}{####1}
- \tl_if_empty:nF{####1}{ \mark_insert:nn{2e-right-nonempty}{####1} }
- \mark{\the\@temptokena}
- \group_end:
- \if@nobreak\ifvmode\nobreak\fi\fi
- }
- }
-}
-
-%we call this macro when a gloss file is not found for a given language
-\cs_new_nopar:Nn \__xpg_no_gloss:n
-{
- \xpg_warning_msg:n
- {File~ gloss-#1.ldf~ do~ not~ exists! \iow_newline:
- I~ will~ nevertheless~ try~ to~ use~ hyphenation~ patterns~ for~ #1.}
-
- \PolyglossiaSetup{#1}{hyphenmins={2,3},hyphennames={#1},fontsetup=true}
- % the above amounts to:
- %\ifcsundef{l@#1}%
- % {\expandafter\adddialect\csname l@#1\endcsname\l@nohyphenation\relax}%
- % {\setlocalhyphenmins{#1}{2}{3}}%
- %\csdef{#1@language}{\language=\csname l@#1\endcsname}%
-}
-
-\cs_new_nopar:Nn \xpg_input:n
-{
- % Store catcode of @ before making at letter
- \cs_set_protected_nopar:Npx \__xpg_restore_at_catcode:
- { \char_set_catcode:nn { `@ } { \char_value_catcode:n {`\@ } } }
- \char_set_catcode_letter:N @
- \file_input:n { #1 }
- % restore former @ catcode
- \__xpg_restore_at_catcode:
-}
-
-% try to load a language file
-\cs_new:Nn \__xpg_load_lang_definition:nn
-{
- \file_if_exist:nTF{gloss-#2.ldf}
- {
- \tl_set:Nn \xpg__tmp_default_options_tl { #1 }
- % Temporarily force catcode of ~ to 13 (active) since babelsh.def
- % requires it. This is needed particularly with LaTeX3
- % packages which force \ExplSyntaxOn (#425)
- \cs_gset_protected:Npx \__xpg_restore_tilde_catcode:
- { \char_set_catcode:nn { 126 } { \char_value_catcode:n { 126 } } }
- \char_set_catcode_active:n { 126 }
- \xpg_input:n {gloss-#2.ldf}
- % restore former ~ catcode
- \__xpg_restore_tilde_catcode:
- }
- {
- \__xpg_no_gloss:n {#2}
- }
-}
-\cs_generate_variant:Nn \__xpg_load_lang_definition:nn { ee }
-
-% load a master language from an alias file
-\NewDocumentCommand \InheritGlossFile { m }
-{
- \seq_if_in:NeF \__xpg_langs_loaded {#1}
- {
- \xpg_input:n {gloss-#1.ldf}
- % define environment and command if not alias
- \str_if_eq:eeT {\prop_item:Ne \__xpg_alias {#1/target}} {#1} {
- \use:c{\prop_item:Nn{\l_xpg_langsetup_prop}
- {#1/DefineCommandsCmd}}
- {#1}
- }
- \seq_gput_right:Nn \__xpg_langs_loaded {#1}
- }
- \__xpg_register_language:nn{}{#1}
-}
-
-\prop_new_linked:N \__xpg_alias
-
-% define environment and command if not alias
-\cs_new:Nn \xpg_define_language_commands:n {
- \str_if_eq:eeT {\prop_item:Ne \__xpg_alias {#1/target}} {#1}
- {
- \exp_args:Ne
- \NewDocumentEnvironment {\prop_item:Nn{\l_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{\l_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}
- }
- \group_begin:
- % set language options
- \__xpg_set_language_options:nn {#2} {#1}
- % register babelname
- \prop_get:NeN \l_xpg_langsetup_prop {#2/babelname} \l_tmpa_tl
- \clist_if_in:NeF \xpg@bloaded {\l_tmpa_tl}{
- \clist_gput_right:Ne \xpg@bloaded {\l_tmpa_tl}
- }
- % register BCP-47 ID
- \prop_get:NeN \l_xpg_langsetup_prop {#2/bcp47} \l_tmpa_tl
- \clist_if_in:NeF \xpg@bcp@loaded {\l_tmpa_tl}{
- \clist_gput_right:Ne \xpg@bcp@loaded {\l_tmpa_tl}
- }
- % register variant
- \prop_get:NnNT \l_xpg_curropt_prop {#2/variant} \l_tmpa_tl {
- \clist_if_in:NeF \xpg@vloaded {\l_tmpa_tl}{
- \clist_gput_right:Ne \xpg@vloaded {\l_tmpa_tl}
- }}
- \group_end:
-}
-
-\prop_new_linked:N \l_xpg_curropt_prop
-
-\DeclareDocumentCommand \setdefaultlanguage { O{} m }
-{
- % latex is an internal language, so do not record
- \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{\l_xpg_langsetup_prop}
- {#2/DefineCommandsCmd}}
- {#2}
- }
- \seq_gput_right:Ne \__xpg_langs_loaded {#2}
- }
- \cs_set_nopar:Npe \mainlanguagevariant { \prop_item:Ne \l_xpg_curropt_prop { \xpg_alias_base_lang:n{#2} / variant } }
- \exp_args:Nee \__xpg_set_default_language:nn {\xpg_alias_add_to_option_i:nn{#2}{#1}}
- {\xpg_alias_base_lang:n{#2}}
-}
-
-
-\cs_new:Nn \__xpg_set_default_language:nn
-{
- \tl_gset:Nn \xpg_main_language_tl {#2}
- %% The following settings are for the default language and script
- % this tells bidi.sty or luabidi.sty that the document is RTL
- \__xpg_if_LR_str:eF{\prop_item:Nn{\l_xpg_langsetup_prop}{#2/direction}}
- {
- \__xpg_setRTLmain:
- }
- \cs_gset_nopar:Nn \__xpg_at_begin_document_selectlanguage: {
- \selectbackgroundlanguage{#2}
- \selectlanguage[#1]{#2}
- }
- \str_if_eq:eeF { #2 } { latex }
- { \xpg_info_msg:n{Default~ language~ is~ #2} }
- \xpg_set_language_name:n { #2 }
-
- \cs_gset_nopar:Npn \mainlanguagename {#2}
-}
-
-\DeclareCommandCopy \setmainlanguage \setdefaultlanguage
-
-% Returns the language ID of the current language
-% Currently supported: bcp-47
-\DeclareDocumentCommand \languageid {m}
-{
- \str_case:nnF {#1}
- {
- {bcp-47} { \use:c{bcp47.tag} }
- {bcp47} { \use:c{bcp47.tag} }
- }
- {
- \xpg_ill_arg_msg:nn { #1 } { \languageid }
- }
-}
-
-% Returns the language ID of the main language
-% Currently supported: bcp-47
-\DeclareDocumentCommand \mainlanguageid {m}
-{
- \str_case:nnF {#1}
- {
- {bcp-47} { \use:c{bcp47.main.tag} }
- {bcp47} { \use:c{bcp47.main.tag} }
- }
- {
- \xpg_ill_arg_msg:nn { #1 } { \mainlanguageid }
- }
-}
-% 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_ill_arg_msg:nn { #1 } { \BCPdata } }
- }
-
-\clist_map_inline:nn
- {
- language, region, script, variant,
- extension.t, extension.u, extension.x
- }{
- \tl_set:Nn \l_tmpa_tl { #1 }
- \tl_replace_once:Nnn \l_tmpa_tl { . } { - }
- \cs_gset_nopar:cpe { bcp47.#1 }
- {
- \exp_not:n { \prop_item:Ne \l_xpg_langsetup_prop } { \exp_not:N \languagename / bcp47-\l_tmpa_tl }
- }
- \cs_gset_nopar:cpe { bcp47.main.#1 }
- {
- \exp_not:n { \prop_item:Ne \l_xpg_langsetup_prop } { \exp_not:N \mainlanguagename / bcp47-\l_tmpa_tl }
- }
- }
-\cs_gset_nopar:cpn { bcp47.casing }
- {
- \tl_if_empty:eTF { \prop_item:Ne \l_xpg_langsetup_prop { \languagename / bcp47-casing } }
- {
- \prop_item:Ne \l_xpg_langsetup_prop { \languagename / bcp47-language }
- }{
- \prop_item:Ne \l_xpg_langsetup_prop { \languagename / bcp47-casing }
- }
- }
-\cs_gset_nopar:cpn { bcp47.main.casing }
- {
- \tl_if_empty:eTF { \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / bcp47-casing } }
- {
- \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / bcp47-language }
- }{
- \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / bcp47-casing }
- }
- }
-\cs_gset_nopar:cpn { bcp47.tag }
- {
- \prop_item:Ne \l_xpg_langsetup_prop { \languagename / bcp47 }
- }
-\cs_gset_nopar:cpn { bcp47.main.tag }
- {
- \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / bcp47 }
- }
-
-\cs_new_nopar:Npn \languagevariant
- {
- \prop_item:Ne \l_xpg_curropt_prop { \languagename / variant }
- }
-
-\cs_new:Nn \xpg_set_language_name:n
-{
- \cs_set:Npn \languagename { #1 }
-}
-
-\NewDocumentCommand \resetdefaultlanguage { O{} m }
-{
- \__xpg_reset_default_language:nn
- {\xpg_alias_add_to_option_i:nn{#2}{#1}}
- {\xpg_alias_base_lang:n{#2}}
-}
-
-\cs_new:Nn \__xpg_reset_default_language:nn
-{
- \xpg_error_if_lang_not_loaded:n{#2}
- % disable globalnumbers of previously defined default language
- \use:c{no\xpg_main_language_tl @globalnumbers}
- \use:c{noextras@\xpg_main_language_tl}
- % This is a hook for external packages which want to access variants
- % via babelname (such as biblatex)
- \cs_if_exist_use:c{noextras@bbl@\mainbabelname}
- \use:c{init@noextras@\xpg_main_language_tl}
- \xpg_set_language_name:n { #2 }
- \__xpg_if_LR_str:eF{\prop_item:Ne{\l_xpg_langsetup_prop}{#2/direction}}
- {
- \@rlmaintrue\@rl@footnotetrue
- }
- \selectlanguage[#1]{#2}
- \selectbackgroundlanguage{#2}
- \cs_set_nopar:Npe \mainlanguagevariant { \prop_item:Ne \l_xpg_curropt_prop { \xpg_alias_base_lang:n{#2} / variant } }
-}
-
-% This saves the normalfont for the latin script since we may change normalfont in other scripts
-\cs_set_eq:cc { normalfontlatin } { normalfont }
-
-% Provide default fonts (as set with \setmainfont, \setsansfont and \setmonofont)
-% for Latin scripts and as a fallback for non-Latin scripts.
-\cs_set_protected:Nn \xpg_defaultfont_rm:
-{
- \tl_if_empty:NF{\g__fontspec_nfss_enc_tl}{\fontencoding{\g__fontspec_nfss_enc_tl}}
- \fontfamily\rmdefault
- \hook_use:n { rmfamily }
- \selectfont
-}
-
-\cs_set_protected:Nn \xpg_defaultfont_sf:
-{
- \tl_if_empty:NF{\g__fontspec_nfss_enc_tl}{\fontencoding{\g__fontspec_nfss_enc_tl}}
- \fontfamily\sfdefault
- \hook_use:n { sffamily }
- \selectfont
-}
-
-\cs_set_protected:Nn \xpg_defaultfont_tt:
-{
- \tl_if_empty:NF{\g__fontspec_nfss_enc_tl}{\fontencoding{\g__fontspec_nfss_enc_tl}}
- \fontfamily\ttdefault
- \hook_use:n { ttfamily }
- \selectfont
-}
-
-\cs_new:Nn \__xpg_patch_fontfamilies:
-{
- % This robustifies the redefinitions of \<xx>family (suggestion by Enrico Gregorio)
- % e.g. to prevent expansion of the \familytype redefinition in auxiliary files
- \tl_put_right:cn {rmfamily~} {\tl_set:Nn \familytype {rm}}
- \tl_put_right:cn {sffamily~} {\tl_set:Nn \familytype {sf}}
- \tl_put_right:cn {ttfamily~} {\tl_set:Nn \familytype {tt}}
-}
-
-% These switches activate the default fonts
-% Note that a simple \let\rmfamilylatin=\rmfamily
-% does not work reliably (see #24)
-\cs_set_eq:cc{rmfamilylatin}{xpg_defaultfont_rm:}
-\cs_set_eq:cc{sffamilylatin}{xpg_defaultfont_sf:}
-\cs_set_eq:cc{ttfamilylatin}{xpg_defaultfont_tt:}
-
-\cs_new:Nn \xpg_set_familydefault:
-{
- \tl_set:Ne \l_tmpa_tl { \familydefault }
- \tl_set:Ne \l_tmpb_tl { \sfdefault }
- \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl
- { \tl_set:Nn \familytype {sf} }
- { \tl_set_eq:NN \l_tmpb_tl \ttdefault
- \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl
- { \tl_set:Nn \familytype {tt} }
- { \tl_set:Nn \familytype {rm} }
- }
- \__xpg_patch_fontfamilies:
- % This (re-)saves the normalfont for the latin script since we may
- % change normalfont in other scripts
- \cs_set_eq:cc{ normalfontlatin }{ normalfont }
- % And for all cases, we also reset \<xx>familylatin
- \cs_set_eq:cc{ rmfamilylatin }{ xpg_defaultfont_rm: }
- \cs_set_eq:cc{ sffamilylatin }{ xpg_defaultfont_sf: }
- \cs_set_eq:cc{ ttfamilylatin }{ xpg_defaultfont_tt: }
-}
-
-\cs_set_nopar:Nn \xpg_select_fontfamily:n
-{
- \str_if_eq:VnTF \familytype { tt }
- { \__xpg_use_or_warn:c { #1@font@tt } }
- { \str_if_eq:VnTF \familytype { sf }
- { \__xpg_use_or_warn:c { #1@font@sf } }
- { \__xpg_use_or_warn:c { #1@font@rm } }
- }
-}
-
-\cs_set_protected:Npn \xpg_select_default_fontfamily:n #1
- {
- \tl_set:Ne \l_tmpa_tl { \familydefault }
- \tl_set:Ne \l_tmpb_tl { \sfdefault }
- \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl
- { \tl_set:Nn \familytype {sf} }
- { \tl_set_eq:NN \l_tmpb_tl \ttdefault
- \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl
- { \tl_set:Nn \familytype {tt} }
- { \tl_set:Nn \familytype {rm} }
- }
- \xpg_select_fontfamily:n{#1}
- }
-
-\cs_new_nopar:Nn \xpg_set_normalfont:n
-{
- \cs_set_eq:cc { rmfamily } { #1@font@rm }
- \cs_set_eq:cc { sffamily } { #1@font@sf }
- \cs_set_eq:cc { ttfamily } { #1@font@tt }
- \cs_set_nopar:Npn \normalfont
- { \xpg_select_default_fontfamily:n {#1}
- \fontseries{\seriesdefault}\selectfont
- \fontshape{\shapedefault}
- \hook_use:n { normalfont }
- \selectfont
- }
- \cs_set_nopar:Npn \reset@font {\protect\normalfont}
-}
-
-\cs_gset_eq:cc { @@fterindentfalse } { @afterindentfalse }
-\cs_new_nopar:Nn \__xpg_french_indent:
-{
- \cs_set_eq:cc { @afterindentfalse } { @afterindenttrue }
- \@afterindenttrue
-}
-\cs_new_nopar:Nn \__xpg_no_french_indent:
-{
- \cs_set_eq:cc { @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{\l_xpg_langsetup_prop}{#1/lcscript} } { latin }
- {}
- { \xpg_set_normalfont:n{#1} }
- \use:c{#1@globalnumbers}
-}
-\cs_generate_variant:Nn \__xpg_select_background_language:n {e}
-% Declare secondary language #2 with language options #1
-\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{\l_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}
-}
-\cs_generate_variant:Nn \__xpg_set_otherlanguage:nn { ee }
-
-\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)
-\NewDocumentCommand \textlang { O{} m +m }
-{
- \__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 }
-
-% wrapper for foreignlanguage and otherlanguage*
-\cs_new_nopar:Nn \xpg_set_foreign_language:nn
-{
- \xpg_select_language:nn { #1 } { #2 }
- \__xpg_register_language:nn{#1}{#2}
-}
-
-% lowercase options before passing to setkeys
-\NewDocumentCommand \SetGlossOptions { m m }
-{
- % \text_lowercase:n fully expands
- % (as opposed to \str_lowercase:n)
- \use:c { xpg_#1_default_options_tl }
- \exp_args:Ne \keys_set:ne{ polyglossia / gloss / #1 }{ \text_lowercase:n {#2} }
-}
-
-% joint code of \foreignlanguage, otherlanguage*
-% and \text<lang>
-% #1 option
-% #2 language
-\cs_new:Nn \xpg_otherlanguage:nn
-{
- \xpg_error_if_lang_not_loaded:n{#2}
- \SetGlossOptions{#2}{#1}
- \xpg_set_foreign_language:nn { #1 } { #2 }
- % Hook for external packages such as biblatex
- \polyglossia@language@switched
- % buggy restoration heure
- \use:c{inlineextras@#2}
- % This is a hook for external packages which want to access variants
- % via babelname (such as biblatex)
- \cs_if_exist_use:c{inlineextras@bbl@\babelname}
-}
-
-\DeclareDocumentCommand { \foreignlanguage } { O{} m +m }
-{
- \__xpg_foreignlanguage:eeen {#1} {#2} {\xpg_alias_base_lang:n{#2}} {#3}
-}
-
-% prevent case changing of language name in \foreignlanguage
-\tl_put_right:Nn \l_text_case_exclude_arg_tl { \foreignlanguage }
-
-% Direct access to \xpg_set_foreign_language:nn
-% used in captions
-\NewDocumentCommand \setforeignlanguage { O{} m }
-{
- \xpg_set_foreign_language:nn { #1 } { #2 }
-}
-
-% 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}
- }{
- \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:
- }
-}
-\cs_generate_variant:Nn \__xpg_foreignlanguage:nnnn {eeen}
-
-
-% otherlanguage* is the environment equivalent of \foreignlanguage
-\DeclareDocumentEnvironment { otherlanguage* } { O{} m }
- {
- \__xpg_otherlanguage:eee { #1 } { #2 } { \xpg_alias_base_lang:n { #2 } }
- }{
- \c_group_end_token% \group_end: does not work here!
- }
-
-% 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}%
- \c_group_begin_token% \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}
-
-% 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}
- }
- {
- \group_begin:
- \xpg_otherlanguage:nn{#1}{#3}
- \use:c{date#3}
- % This is a hook for external packages which want to access variants
- % via babelname (such as biblatex)
- \cs_if_exist_use:c{date@bbl@\babelname}
- \__xpg_lang_set_text_direction:nn{#3}{#4}
- \group_end:
- }
-}
-\cs_generate_variant:Nn \__xpg_textlanguage:nnnn {nnen}
-
-% Define language-specific hyphenation exceptions
-\NewDocumentCommand \pghyphenation {O{} m m}
-{
- \c_group_begin_token
- \xpg_error_if_lang_not_loaded:n { #2 }
- \SetGlossOptions{#2}{#1}
- \xpg_select_language:nn { #1 } { #2 }
- \hyphenation{#3}
- \c_group_end_token
-}
-
-
-% Hook that other package authors can use
-% (for instance biblatex):
-% Do not rename!
-\cs_set_nopar:Npn \xpg@hook@setlanguage {}
-
-\cs_set_nopar:Nn \__xpg_pop_language:nn
-{
- \xpg_set_language_aux:nn { #1 } { #2 }
- \xpg@hook@setlanguage
-% FIXME This seems to be a very old relict.
-% The macro is nowhere used. Probably remove.
-% \let\emp@langname\@undefined
-}
-
-\DeclareDocumentCommand \selectlanguage {s O{} m}
- {
- \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:nn {#3} {#2}
- \IfBooleanTF { #1 } % The starred variant does not write to the aux
- {
- \xpg_set_language_nonaux:nn { #2 } { #3 }
- }{
- \cs_set_nopar:Ne \xpg_pop_language: { \exp_not:N \__xpg_pop_language:nn { #2 } { #3 } }
- \group_insert_after:N \xpg_pop_language:
- \xpg_set_language_aux:nn { #2 } { #3 }
- }
- \__xpg_register_language:nn { #2 } { #3 }
-}
-\cs_generate_variant:Nn \__xpg_select_language:nnn { nee, nne }
-
-% set lang option #2 for lang #1
-\cs_new:Nn \__xpg_set_language_options:nn
-{
- \cs_if_exist:cT { xpg_#1_default_options_prop }
- {
- \prop_concat:ccc { l_xpg_curropt_prop } { l_xpg_curropt_prop }
- { xpg_#1_default_options_prop }
- }
- \xpg__keyval_parser:eeN { #2 } { #1 } \l_xpg_curropt_prop
- \SetGlossOptions{#1}{#2}
-}
-
-% Initialize default language options, so that
-% \iflanguageoption has the info it needs also
-% for default settings
-\NewDocumentCommand \InitializeGlossOptions { m m }
-{
- \tl_new:c { xpg_#1_default_options_tl }
- \prop_new:c { xpg_#1_default_options_prop }
- \keys_precompile:nec { polyglossia / gloss / #1 }
- { \text_lowercase:n { #2, \xpg__tmp_default_options_tl } }
- { xpg_#1_default_options_tl }
- \xpg__keyval_parser:enc { #2, \xpg__tmp_default_options_tl } { #1 }
- { xpg_#1_default_options_prop }
- \prop_concat:ccc { l_xpg_curropt_prop } { l_xpg_curropt_prop }
- { xpg_#1_default_options_prop }
- \use:c { xpg_#1_default_options_tl }
- \__xpg_set_language_options:nn {#1} {#2}
-}
-\tl_new:N \xpg__tmp_default_options_tl
-\cs_generate_variant:Nn \keys_precompile:nnN { nec }
-
-% Record synonymous keyvals such as variant=us and variant=american
-% Syntax: \SetLanguageAliasValues{<lang>}{<key>}{<alias vals, comma-separated>}
-\int_new:N \l_xpg_alias_keyvals_int
-\int_set:Nn \l_xpg_alias_keyvals_int { 2 }
-\NewDocumentCommand \SetLanguageAliasValues { m m m }
-{
- \clist_map_inline:nn { #3 }
- {
- \int_const:cn { c_xpg_alias_keyvals_#1_#2_##1_int } { \l_xpg_alias_keyvals_int }
- }
- \int_incr:N \l_xpg_alias_keyvals_int
-}
-
-\cs_new:Npn \xpg__keyval_parser:nnN #1 #2 #3 % #1 = key-vals, #2 = language, #3 = prop
- {
- \keyval_parse:nnn
- { \xpg__keyval_parser_default:nnn { #2 } { #3 } }
- { \xpg__keyval_parser_nondefault:nnnn { #2 } { #3 } }
- { #1 }
- }
-\cs_generate_variant:Nn \xpg__keyval_parser:nnN { eeN, enc }
-
-\cs_new:Npn \xpg__keyval_parser_default:nnn #1 #2 #3 % #1 = lang, #2 = prop, #3 = key
- {
- \str_set:Nn \l_tempa_str { #1 / #3 }
- \str_concat:NNN \l_tempa_str \c__keys_default_root_str \l_tempa_str
- \prop_put:Nne #2 { #1 / #3 } { \use:c { \l_tempa_str } }
- }
-
-\cs_new:Npn \xpg__keyval_parser_nondefault:nnnn #1 #2 #3 #4 % #1 = lang, #2 = prop, #3 = key, #4 = value
- {
- \prop_put:Nnn #2 { #1 / #3 } { #4 }
- }
-
-\prg_set_conditional:Npnn \__xpg_check_option_value:NNN #1#2#3 { p , T , F , TF }
- {
- \bool_lazy_or:nnTF
- {
- \str_if_eq_p:ee { \prop_item:Nn \l_xpg_curropt_prop { #1 / #2 } } { #3 }
- } {
- \int_compare_p:nNn
- {
- \cs_if_exist_use:cF { c_xpg_alias_keyvals_#1_#2_#3_int } { 0 }
- } = {
- \cs_if_exist_use:cF { c_xpg_alias_keyvals_#1_#2_\prop_item:Nn \l_xpg_curropt_prop { #1 / #2 }_int } { 1 }
- }
- } { \prg_return_true: } { \prg_return_false: }
- }
-
-\prg_set_conditional:Npnn \xpg_if_main_language:n #1 { T, F, TF }
-{
- \str_if_eq:VnTF \xpg_main_language_tl { #1 }
- { \prg_return_true: }
- { \prg_return_false: }
-}
-
-\cs_set_eq:NN \IfMainLanguageTF \xpg_if_main_language:nTF
-
-\cs_set_eq:NN \IfMainLanguageT \xpg_if_main_language:nT
-
-\cs_set_eq:NN \IfMainLanguageF \xpg_if_main_language:nF
-
-% Test if option value is set
-\DeclareDocumentCommand \iflanguageoption { m m m m m }
-{
- \__xpg_check_option_value:NNNTF{#1}{#2}{#3}{#4}{#5}
-}
-
-% Test if language is loaded
-\DeclareDocumentCommand \iflanguageloaded { m m m }
-{
- \hook_gput_code:nnn {begindocument/end} {.}
- {
- \clist_if_in:NeTF \xpg@loaded{#1}{#2}{#3}
- }
-}
-
-% Same for babellanguage is loaded
-\DeclareDocumentCommand \ifbabellanguageloaded { m m m }
-{
- \hook_gput_code:nnn {begindocument/end} {.}
- {
- \clist_if_in:NeTF \xpg@bloaded{#1}{#2}{#3}
- }
-}
-
-% Same for languageid
-\DeclareDocumentCommand \iflanguageidloaded { m m m m }
-{
- \hook_gput_code:nnn {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_ill_arg_msg:nn { #1 } { \iflanguageidloaded }
- }
- }%
-}
-
-% 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 }
- }
-
-
-\cs_new_nopar:Nn \xpg_set_language_nonaux:nn
-{
- \__xpg_start_language:nn { #1 } { #2 }
-}
-
-
-\cs_new_nopar:Nn \xpg_set_language_aux:nn
-{
- \__xpg_start_language:nn { #1 } { #2 }
- % Write to the aux
- \xpg_set_language_only_aux:nn { #1 } { #2 }
-}
-
-\cs_new_nopar:Nn \xpg_set_language_only_aux:nn
-{
- % Write to the aux (toc files)
- \if@filesw
- \addtocontents{toc}{\selectlanguage*[#1]{#2}}
- \fi
-}
-
-\hook_gput_code:nnn {begindocument} {.}
-{
- \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)
-\hook_gput_code:nnn {cmd/caption/before} {.}
-{
- \ifhmode\unskip\fi
- \addtocontents{lof}{\protect\setforeignlanguage{\languagename}}
- \addtocontents{lot}{\protect\setforeignlanguage{\languagename}}
-}
-
-% check if language is defined
-\prg_set_conditional:Npnn \__xpg_pattern_check_if_exists: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: }
- }
-
-\cs_new_nopar:Nn \__xpg_luatex_load_lang:n
-{
- % if \l@#1 is not properly defined, call lua function newloader(#1),
- % and assign the returned number to \l@#1
- \__xpg_pattern_check_if_exists:nF {#1}
- {
- \directlua { token.set_char('l@#1', polyglossia.newloader'#1') }
- }
-}
-
-% check if language is defined
-\prg_set_conditional:Npnn \xpg_if_language_defined:n #1 { T, F, TF }
-{
- % With luatex, we first need to define \l@#1.
- \sys_if_engine_luatex:T
- {
- \__xpg_luatex_load_lang:n {#1}
- }
- \__xpg_pattern_check_if_exists:nTF{#1}
- { \prg_return_true: }
- { \prg_return_false: }
-}
-
-% Aliases for gloss files
-\cs_gset_eq:cc { IfLanguageDefinedTF } { xpg_if_language_defined:nTF }
-\cs_gset_eq:cc { IfLanguageDefinedT } { xpg_if_language_defined:nT }
-\cs_gset_eq:cc { IfLanguageDefinedF } { xpg_if_language_defined:nF }
-
-% Check if patterns for language #1 is defined. If not, try
-% the comma-separated list of fallbacks in #2
-\NewDocumentCommand \TryPatternWithFallback { m m }
-{
- \xpg_if_language_defined:nF { #1 }
- {
- \clist_clear_new:N \l_xpg_lang_patterns
- \clist_set:Ne \l_xpg_lang_patterns { #2 }
- \bool_set_false:N \l_tmpa_bool
- \clist_map_inline:Nn \l_xpg_lang_patterns
- {
- \xpg_if_language_defined:nT { ##1 }
- {
- \cs_gset_eq:cc { l@#1 } { l@##1 }
- \bool_set_true:N \l_tmpa_bool
- \clist_map_break:
- }
- }
- \bool_if:NF \l_tmpa_bool
- {
- \xpg_warning_msg:n
- {No~ hyphenation~ patterns~ for~ #1~ found \iow_newline:
- Falling~ back~ to~ the~ default~ patterns~ (=~English)!}
- \exp_args:Nc \adddialect {l@#1} 0
- }
- }
-}
-
-% This old term is used by biblatex, so don't drop!
-\cs_gset_eq:cc { xpg@ifdefined } { xpg_if_language_defined:nTF }
-
-% Set \bbl@hyphendata@\the\language, which is (lua)babel's
-% hyphenation pattern hook
-% FIXME Clarifiy why/when this is needed.
-\cs_new:Nn \xpg_set_bbl_hyphendata:n
-{
- \sys_if_engine_luatex:T
- {
- \cs_if_exist:cF {bbl@hyphendata@#1}
- {
- \cs_gset:cpn {bbl@hyphendata@\the\language} {}
- }
- }
-}
-
-% Set hyphenation patterns for a given language. This does the right
-% thing both for XeTeX and LuaTeX
-\cs_new:Nn \xpg_set_hyphenation_patterns:n
-{
- \sys_if_engine_luatex:T { \__xpg_luatex_load_lang:n {#1} }
- \language=\csname l@#1\endcsname
-}
-
-\cs_new:Nn \__xpg_start_language:nn
-{
- % hook for compatibility with biblatex
- \select@language { #2 }
- \xpg_set_bbl_hyphendata:n {\the\language}
- \xpg_initial_setup:
- \xpg_select_language:nn { #1 } { #2 }
- % Hook for external packages such as biblatex
- \polyglossia@language@switched
- \__xpg_lang_set_par_direction:n {#2}
- \use:c {captions#2}
- \use:c {date#2}
- % These are hooks for external packages which want to access variants
- % via babelname (such as biblatex)
- \cs_if_exist_use:c {captions@bbl@\babelname}
- \cs_if_exist_use:c {date@bbl@\babelname}
- \__xpg_local_marks:n {#2}
- \use:c {init@extras@#2}
- \__xpg_indent_first:n { #2 }
- \cs_if_exist_use:c {blockextras@#2}
- % This is a hook for external packages which want to access variants
- % via babelname (such as biblatex)
- \cs_if_exist_use:c {blockextras@bbl@\babelname}
-}
-
-% hook for compatibility with biblatex
-% (probably no longer used due to the
-% more general hook that follows, but
-% we keep it for backwards comp.)
-\cs_set:Npn \select@language #1 {}
-
-% Hook for external packages such as biblatex
-% do not rename!
-\cs_new:Npn \polyglossia@language@switched {}
-
-% remove all customization for language #1
-\cs_new:Npn \noextrascurrent #1
-{
- \cs_if_exist_use:c{noextras@#1}%
- % This is a hook for external packages which want to access variants
- % via babelname (such as biblatex)
- \cs_if_exist_use:c{noextras@bbl@\babelname}
-}
-
-% Common code for `\select@language' and `\foreignlanguage'.
-\cs_new:Nn \xpg_select_language:nn
-{
- % disable the extras and number settings of the previous language
- \cs_if_exist:cT{languagename}
- {
- \noextrascurrent{\languagename}
- \cs_if_exist_use:c{no\languagename @numbers}
- \sys_if_engine_xetex:T{
- \__xpg_if_LR_str:eTF{\prop_item:Ne{\l_xpg_langsetup_prop}{\languagename/direction}}
- {
- \__xpg_if_LR_str:eF{\prop_item:Nn{\l_xpg_langsetup_prop}{#2/direction}}
- {\setnonlatin} % LTR -> RTL
- }
- {
- \__xpg_if_LR_str:eT{\prop_item:Nn{\l_xpg_langsetup_prop}{#2/direction}}
- {\setlatin} % RTL -> LTR
- }
- }
- }
- \xpg_set_language_name:n { #2 }
- \xpg_set_normalfont:n { #2 }
- \xpg_select_fontfamily:n { #2 }
- \__xpg_use_or_warn:c{#2@language}
- \cs_if_exist_use:c{#2@numbers}
- \__xpg_use_localhyphenmins:nn { #1 } { #2 }
- \__xpg_french_spacing:n { #2 }
-}
-
-
-\cs_undefine:N \xpg_pop_language:
-
-\DeclareDocumentEnvironment { otherlanguage } { O{} m }
- {
- \selectlanguage[#1]{#2}
- } { }
-
-% Alias to {<lang>}, but more suitable
-% for specific (esp. tag-based) aliases
-% where {<alias>} would cause clashes
-% (e.g., \fi)
-\DeclareEnvironmentCopy { lang } { otherlanguage }
-
-\NewDocumentCommand \setlocalhyphenmins { m m m }
-{
- \xpg_if_language_defined:nTF{#1}
- {
- \cs_if_eq:ccTF { l@#1 } { l@nohyphenation }
- {
- \xpg_warning_msg:n {\string\setlocalhyphenmin\space~ useless~ for~ unhyphenated~ language~ #1}
- }{
- \providehyphenmins{#1}{#2#3}
- }
- }{
- \xpg_warning_msg:n {\string\setlocalhyphenmin\space~ useless~ for~ unknown~ language~ #1}
- }
-}
-
-% \setlanghyphenmins[options]{lang}{l}{r}
-\NewDocumentCommand \setlanghyphenmins { O{} m m m }
-{
- % Check for real language name and options
- \tl_set:Nx \l_tmp_opts_tl { \xpg_alias_add_to_option_i:nn{#2}{#1} }
- \tl_set:Nx \l_tmp_lang_tl { \xpg_alias_base_lang:n{#2} }
- \c_group_begin_token
- \xpg_error_if_lang_not_loaded:n{\l_tmp_lang_tl}
- \SetGlossOptions{\l_tmp_lang_tl}{ \l_tmp_opts_tl }
- % Store bcp47.tag@hypenmins
- \cs_set_nopar:cpe {tmp@bcp47.tag} { \prop_item:Ne{\l_xpg_langsetup_prop}{ \l_tmp_lang_tl / bcp47 } }
- \cs_gset:cpn {\csname tmp@bcp47.tag\endcsname @hyphenmins} {{#3}{#4}}
- \c_group_end_token
-}
-
-% \__xpg_use_localhyphenmins:nn {options}{lang}
-\cs_new_nopar:Nn \__xpg_use_localhyphenmins:nn
-{
- \c_group_begin_token
- \xpg_error_if_lang_not_loaded:n {#2}
- \SetGlossOptions {#2} {#1}
- % Use bcp47.tag@hypenmins
- \cs_gset_nopar:cpe {tmp@bcp47.tag} { \prop_item:Nn{\l_xpg_langsetup_prop}{ #2 / bcp47 } }
- \c_group_end_token
- \cs_if_exist:cTF {\csname tmp@bcp47.tag\endcsname @hyphenmins}
- {
- \tl_set:Ne \l_tmpa_tl { \use:c{\csname tmp@bcp47.tag\endcsname @hyphenmins} }
- \expandafter \set@hyphenmins \l_tmpa_tl
- }{
- \cs_if_exist:cT{#2hyphenmins}
- {
- \expandafter\expandafter\expandafter\set@hyphenmins\csname #2hyphenmins\endcsname\relax
- }
- }
- \sys_if_engine_luatex:T
- {
- % Set \totalhyphenmin if specified
- \prop_get:NeNT \l_xpg_langsetup_prop {#2/totalhyphenmin} \l_tmpb_tl
- {
- \xpg_info_msg:n {totalhyphenmin: '\l_tmpb_tl'}
- \expandafter\hyphenationmin \l_tmpb_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
- \tl_set:Nx \l_tmp_opts_tl { \xpg_alias_add_to_option_i:nn{#2}{#1} }
- \tl_set:Nx \l_tmp_lang_tl { \xpg_alias_base_lang:n{#2} }
- % Register the language options
- \__xpg_set_language_options:nn { \l_tmp_lang_tl } { \l_tmp_opts_tl }
- % Now switch patterns
- \__xpg_use_or_warn:c{\use:c{l_tmp_lang_tl}@language}
- % And activate hyphenmins
- \__xpg_use_localhyphenmins:nn { \l_tmp_opts_tl } { \l_tmp_lang_tl }
- }
- { }
-
-\hook_gput_code:nnn {begindocument/before} {.}
-{
- \IfPackageLoadedTF{bidi}
- {
- \ProvideDocumentCommand \aemph { m } { $\overline{\hboxR{#1}}$ }
- }{}
- \IfPackageLoadedTF{luabidi}
- {
- \ProvideDocumentCommand \aemph { m } { $\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_msg:n{Setting~ LuaTeX~ font~ renderer~ to~ \g_xpg_luatex_renderer_str}
- \exp_args:Ne \defaultfontfeatures{Renderer=\g_xpg_luatex_renderer_str}
- }
-}
-
-\bool_if:nF \g_xpg_verbose_bool
-{
- \cs_gset_nopar:Npn \@latex@info #1 { \relax } % no latex info
- \cs_gset_nopar:Npn \@font@info #1 { \relax } % no latex font info
- \cs_gset_nopar:Npn \@font@warning #1 { \relax } % no latex font warnings
- \msg_redirect_module:nnn { fontspec } { info } { none } % no fontspec info
- \msg_redirect_module:nnn { polyglossia } { info } { none } % no polyglossia info
-}
-
-\bool_if:nT \g_xpg_localmarks_bool {
- \__xpg_enable_local_marks:
-}
-
-% common code to initiate babelshordhands in glosses
-\cs_new:Npn \InitializeBabelShorthands
-{
- \cs_if_exist:cF {initiate@active@char}
- {
- \file_input:n {babelsh.def}
- \initiate@active@char{"}
- \shorthandoff{"}
- }
-}
-
-% Control shorthand (de-)activation
-% This checks that the shorthand char is only deactivated
-% if we have activated it ourselves and hence keeps
-% 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 }
-{
- \hook_gput_code:nnn {begindocument/before} {.}
- {
- % Load the involved languages if necessary
- % Error if they do not exist
- \tl_set:Nn \l__xpg_tmpa_lang_tl { \xpg_alias_base_lang:n{#1} }
- \clist_if_in:NeF \xpg@loaded {\l__xpg_tmpa_lang_tl}{
- \file_if_exist:nTF{gloss-\l__xpg_tmpa_lang_tl .ldf}
- { \setotherlanguage{#1} }
- { \xpg_error_msg:n { Source~ language~ #1,~ used~ in~
- \string\inheritbabelshorthands,~ does~ not~ exist } }
- }
- \tl_set:Nn \l__xpg_tmpb_lang_tl { \xpg_alias_base_lang:n{#2} }
- \clist_if_in:NeF \xpg@loaded {\l__xpg_tmpb_lang_tl}{
- \file_if_exist:nTF{gloss-\l__xpg_tmpb_lang_tl .ldf}
- { \setotherlanguage{#2} }
- { \xpg_error_msg:n { 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_msg:n { 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_msg:n { 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 millennium, 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 Millennium 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-cjk-spacing.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-cjk-spacing.lua}
-% \begin{macrocode}
---
--- polyglossia-cjk-spacing.lua
--- part of polyglossia v2.2 -- 2024/07/15
---
-
-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 whatsit_id = node.id"whatsit"
-local math_id = node.id"math"
-
---
--- attr_cjk: variant = plain: 0, JP/classic: 1, KR/modern: 2, SC: 3, TC: 4
---
-local attr_cjk = luatexbase.attributes["xpg@attr@cjkspacing"]
---
--- attr_josa: ONLY For Korean. DO NOT declare \newattribute for other langs
---
-local attr_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 plus combinings
--- 3: kana small letters
--- 0: dashes (suppress visible spacing after this char)
---
-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] = 1, -- : 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] = 0, -- ― HORIZONTAL BAR
- [0x2019] = 1, -- ’ RIGHT SINGLE QUOTATION MARK
- [0x201D] = 1, -- ” RIGHT DOUBLE QUOTATION MARK
- [0x2025] = 0, -- ‥ TWO DOT LEADER
- [0x2026] = 0, -- … 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] = 2, -- COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK
- [0x309A] = 2, -- COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
- [0x309B] = 2, -- ゛ KATAKANA-HIRAGANA VOICED SOUND MARK
- [0x309C] = 2, -- ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
- [0x309D] = 1, -- ゝ HIRAGANA ITERATION MARK
- [0x309E] = 1, -- ゞ HIRAGANA VOICED ITERATION MARK
- [0x30A0] = 1, -- ゠ KATAKANA-HIRAGANA DOUBLE HYPHEN
- [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] = 0, -- ︰ PRESENTATION FORM FOR VERTICAL TWO DOT LEADER
- [0xFE31] = 0, -- ︱ PRESENTATION FORM FOR VERTICAL EM DASH
- [0xFE32] = 0, -- ︲ PRESENTATION FORM FOR VERTICAL EN DASH
- [0xFE36] = 1, -- ︶ PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS
- [0xFE38] = 1, -- ︸ PRESENTATION FORM FOR VERTICAL RIGHT CURLY BRACKET
- [0xFE3A] = 1, -- ︺ PRESENTATION FORM FOR VERTICAL RIGHT TORTOISE SHELL BRACKET
- [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] = 2, -- ゙ HALFWIDTH KATAKANA VOICED SOUND MARK
- [0xFF9F] = 2, -- ゚ HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
-}, { __index = function(_,c)
- if c >= 0x1160 and c <= 0x11FF then return 2 end
- if c >= 0xD7B0 and c <= 0xD7FF then return 2 end
- if c >= 0x302A and c <= 0x302F then return 2 end -- tone marks
- if c >= 0x31F0 and c <= 0x31FF then return 3 end
- if c >= 0xFF67 and c <= 0xFF70 then return 3 end
- if c >= 0xFE00 and c <= 0xFE0F then return 2 end -- variation selectors
- if c >= 0xFE10 and c <= 0xFE19 and not (c == 0xFE17) then return 1 end
- if c >= 0xFE50 and c <= 0xFE58 then return 1 end
- if c >= 0xE0100 and c <= 0xE01EF then return 2 end -- variation selecters
- 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 c >= 0x30000 and c <= 0x323AF
- 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 })
-
---
--- get character class
--- var : variant = plain, JP/classic, KR/modern, SC, TC
--- c : codepoint
---
-local function get_charclass (var, c)
- if var < 3 then
- return charclass[c]
- elseif var == 3 then
- -- SC : these are left aligned
- return (c == 0xFF01 or c == 0xFF1F) and 4 -- FULLWIDTH EXCLAMATION/QUESTION MARK
- or (c == 0xFF1A or c == 0xFF1B) and 2 -- FULLWIDTH COLON/SEMICOLON
- or charclass[c]
- end
- -- TC : these are center aligned
- return (c == 0x3001 or c == 0xFF0C) and 3 -- IDEOGRAPHIC/FULLWIDTH COMMA
- or (c == 0x3002 or c == 0xFF0E) and 3 -- IDEOGRAPHIC/FULLWIDTH FULL STOP -- 5 ?
- or charclass[c]
-end
-
---
--- table for spacing between char classes
--- 1 stands for 0.5*fontsize when variant = JP/classic or SC or TC
---
-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=KR/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 ~= plain
---
-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, JP/classic, KR/modern, SC, TC
--- 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, JP/classic, KR/modern, SC, TC
--- nobr: no linebreak
--- x: true between cjk and non-cjk (a little more spacing)
---
-local function insert_penalty_glue (head, curr, f, var, nobr, x)
- if nobr then
- local penalty = get_new_penalty(10000)
- head, curr = node.insert_after(head, curr, penalty)
- elseif var == 0 or var == 2 then
- local penalty = get_new_penalty(50)
- head, curr = node.insert_after(head, curr, penalty)
- end
- 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
---
-local function cjk_break (head)
- local curr = head
- while curr do
- if attr_cjk and (curr.id == glyph_id or curr.id == math_id and curr.subtype == 1) then
- local var = node.has_attribute(curr, attr_cjk)
- if var then
- local c, f = curr.char or 0, curr.font
- local cc, cjkc = get_charclass(var, c), is_cjk(c)
-
- -- compress cjk punctuations when charclass is 1 thru 4
- if var > 0 and cc > 0 and cc < 5 then
- head, curr = glyph_to_box(head, curr, cc)
- end
-
- local next = node.getnext(curr)
- while next and next.id == whatsit_id do -- skip whatsit nodes
- curr, next = next, node.getnext(next)
- end
-
- if next and (next.id == glyph_id or next.id == math_id and next.subtype == 0) then
- local n = next.char or 0
- f = f or next.font or 0 -- in case of curr == math_off
-
- -- skip combining. or dash+dash case to suppress stretching
- if nobr_before[n] == 2 or (nobr_before[c] == 0 and nobr_before[n] == 0) then
- goto skip_combining
- end
-
- local nc = get_charclass(var, n)
- local nobr = nobr_before[n] or nobr_after[c]
-
- -- insert spacing as of intercharclass
- if var > 0 and intercharclass[cc][nc] then
- head, curr = insert_cjk_penalty_glue(head, curr, f, var, cc, nc, nobr)
-
- else
- local cjkn = is_cjk(n)
-
- -- if curr or next is cjk char
- if cjkc or cjkn then
-
- -- plain variant / cjk+cjk / nobr cjk+noncjk / after dash
- -- : insert a 0pt glue
- if var == 0 or (cjkc and cjkn) or nobr or nobr_before[c] == 0 then
- head, curr = insert_penalty_glue(head, curr, f, var, nobr)
-
- -- other cases: insert a small glue
- else
- head, curr = insert_penalty_glue(head, curr, f, var, nobr, true)
- end
- end
- end
- end
- end
- end
- ::skip_combining::
- curr = node.getnext(curr)
- 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_cjk) then
- local f = font.getfont(curr.font) or font.fonts[curr.font]
- if f and f.hb then -- harfbuzz do the right thing
- tone = nil
- 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 = node.getprev(curr)
- 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 = node.getprev(p)
- 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(node.getprev(curr)) or 0x30]
- end
- if cc == 0xC774 then
- local n = node.getnext(curr)
- 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 = node.getnext(curr)
- 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.
---
-luatexbase.add_to_callback( "pre_shaping_filter",
-function(head)
- if attr_josa then head = auto_josa(head) end
- head = cjk_break(head)
- if attr_josa then head = reorder_tm(head) end
- return head
-end,
-"polyglossia.lang_cjk_spacing")
-
--- vim:ft=lua:tw=0:sw=4:ts=4:expandtab
-% \end{macrocode}
-% \iffalse
-%</polyglossia-cjk-spacing.lua>
-%<*polyglossia-french.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-french.lua}
-% \begin{macrocode}
---
--- polyglossia-punct.lua
--- part of polyglossia v2.2 -- 2024/07/15
---
-
-require('polyglossia-punct')
-
-local function set_left_space(lang, char, kern, rubber)
- polyglossia.add_left_spaced_character(lang, char, kern, "space", rubber)
-end
-
-local function set_right_space(lang, char, kern, rubber)
- polyglossia.add_right_spaced_character(lang, char, kern, "space", rubber)
-end
-
-local function activate_french_punct(thincolonspace, autospaceguillemets)
- -- We need different language tags here to make switching of options possible
- -- within a paragraph.
- local lang = "french"
- if thincolonspace then
- lang = lang.."-thincolon"
- end
- 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-latin.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-latin.lua}
-% \begin{macrocode}
---
--- polyglossia-latin.lua
--- part of polyglossia v2.2 -- 2024/07/15
---
-
-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.2 -- 2024/07/15
---
-
-require('polyglossia') -- just in case...
-
-local add_to_callback = luatexbase.add_to_callback
-local declare_callback_rule = luatexbase.declare_callback_rule
-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)
-end
-
-add_to_callback("pre_linebreak_filter",process,"polyglossia-punct.process")
-add_to_callback("hpack_filter",process,"polyglossia-punct.process")
-declare_callback_rule("pre_linebreak_filter",
- "polyglossia-punct.process", "before", "luaotfload.node_processor")
-declare_callback_rule("hpack_filter",
- "polyglossia-punct.process", "before", "luaotfload.node_processor")
-
-
-local function deactivate()
- tex.setattribute(punct_attr, -0x7FFFFFFF) -- this value means "unset"
- -- Though it would make compilation slightly faster, it is not possible to
- -- 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.2 -- 2024/07/15
---
-
-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.2 -- 2024/07/15
---
-
-require('polyglossia') -- just in case...
-
-local add_to_callback = luatexbase.add_to_callback
-local remove_from_callback = luatexbase.remove_from_callback
-local declare_callback_rule = luatexbase.declare_callback_rule
-local priority_in_callback = luatexbase.priority_in_callback
-
-local next, type = next, type
-local node = node
-
-local insert_node_before = node.insert_before
-local insert_node_after = node.insert_after
-local remove_node = node.remove
-local copy_node = node.copy
-local has_attribute = node.has_attribute
-
-local end_of_math = node.end_of_math
-if not end_of_math then -- luatex < .76
- local traverse_nodes = node.traverse_id
- local math_code = node.id('math_char')
- 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 2024
-local glyph_code = node.id('glyph')
-local penalty_code = node.id('penalty')
-local kern_code = node.id('kern')
-
--- we make a new node, so that we can copy it later on
-local penalty_node = node.new(penalty_code)
-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
- 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()
- add_to_callback(callback_name, process, "polyglossia-tibt.process")
- declare_callback_rule(callback_name,
- "polyglossia-tibt.process", "before", "luaotfload.node_processor")
-end
-
-local function desactivate()
- remove_from_callback(callback_name, "polyglossia-tibt.process")
-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.2 -- 2024/07/15
---
-
-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 = { }
- 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
- local a = {}
- for _,n in pairs(s) do table.insert(a, n) end
- table.sort(a)
- log_info("Language data for " .. langentry .. "\n" .. table.concat(a,"\n"))
-
- --
- -- LaTeX's \newlanguage increases language register (count19),
- -- 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.
- --
- -- Therefore here we will compare LaTeX's \newlanguage number with
- -- LuaTeX's lang.new() id and select the bigger one for our new
- -- language object. Also we will update LaTeX's language register
- -- by this new id, so that another possible \newlanguage should not
- -- 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 needed
- 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 Millennium 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-acadian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-acadian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-acadien.ldf}[polyglossia: module for Canadian (Acadian) French]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{french}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-acadian.ldf>
-%<*gloss-aeb.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-aeb.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-aeb.ldf}[polyglossia: module for aeb (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-af.ldf}[polyglossia: module for af (Afrikaans)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-afb.ldf}[polyglossia: module for afb (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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}
-
-\DeclareKeys[polyglossia/gloss/afrikaans]
- {
- babelshorthands.if = afrikaans@babelshorthands,
- babelshorthands.default:n = true,
- }
-% Register default options
-\InitializeGlossOptions{afrikaans}{babelshorthands=false}
-
-\ifsystem@babelshorthands
- \SetGlossOptions{afrikaans}{babelshorthands=true}
-\else
- \SetGlossOptions{afrikaans}{babelshorthands=false}
-\fi
-
-\InitializeBabelShorthands
-
-\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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-am.ldf}[polyglossia: module for am (Amharic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-american.ldf}[polyglossia: module for American English]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-apd.ldf}[polyglossia: module for apd (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ar-IQ.ldf}[polyglossia: module for ar-IQ (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ar-JO.ldf}[polyglossia: module for ar-JO (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ar-LB.ldf}[polyglossia: module for ar-LB (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ar-MR.ldf}[polyglossia: module for ar-MR (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ar-PS.ldf}[polyglossia: module for ar-PS (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ar-SY.ldf}[polyglossia: module for ar-SY (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ar-YE.ldf}[polyglossia: module for ar-YE (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ar.ldf}[polyglossia: module for ar (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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}
-
-\newif\ifeastern@numerals
-\newif\if@hijrical
-\newif\ifarabic@customsep\arabic@customsepfalse
-
-\DeclareKeys[polyglossia/gloss/arabic]
- {
- hijricorrection.code = \gdef\arabic@hijri@correction{#1},
- hijricorrection.default:n = 0,
- sectionsep.code = \gdef\xpg@sepmark{#1}\arabic@customseptrue,
- sectionsep.default:n = .,
- abjadalph.if = arabic@abjadalph,
- abjadalph.default:n = true,
- abjadjimnotail.if = abjad@jim@notail,
- abjadjimnotail.default:n = true,
- numerals.choice:,
- numerals / mashriq.code =
- {%
- \eastern@numeralstrue
- },
- numerals / maghrib.code =
- {%
- \eastern@numeralsfalse
- },
- numerals / eastern.code =
- {%
- \eastern@numeralstrue
- },
- numerals / western.code =
- {%
- \eastern@numeralsfalse
- },
- numerals.default:n = mashriq,
- numerals/unknown.code = \xpg@warning{Unknown Arabic numerals option `#1'},
- locale.choice:,
- locale / default.code =
- {%
- \eastern@numeralstrue
- \def\abjad@one{ا}%
- \SetLanguageKeys{arabic}{bcp47=ar-YE,bcp47-language=ar}%
- \gdef\@@arabic@month{\@arabic@month{#1}}%
- },
- locale / mashriq.code =
- {%
- \eastern@numeralstrue
- \def\abjad@one{ا}%
- \SetLanguageKeys{arabic}{bcp47=ar-IQ,bcp47-language=ar}%
- \gdef\@@arabic@month{\@arabic@month{#1}}%
- },
- locale / libya.code =
- {%
- \eastern@numeralstrue
- \def\abjad@one{ا}%
- \SetLanguageKeys{arabic}{bcp47=ayl,bcp47-language=ar,bcp47-region=LY}%
- \gdef\@@arabic@month{\@arabic@month{#1}}%
- },
- locale / algeria.code =
- {%
- \eastern@numeralsfalse
- \def\abjad@one{أ}%
- \SetLanguageKeys{arabic}{bcp47=arq,bcp47-language=ar,bcp47-region=DZ,bcp47-extension-u=nu-latn}%
- \gdef\@@arabic@month{\@arabic@month{#1}}%
- },
- locale / tunisia.code =
- {%
- \eastern@numeralsfalse
- \def\abjad@one{أ}%
- \SetLanguageKeys{arabic}{bcp47=aeb,bcp47-language=ar,bcp47-region=TN,bcp47-extension-u=nu-latn}%
- \gdef\@@arabic@month{\@arabic@month{#1}}%
- },
- locale / morocco.code =
- {%
- \eastern@numeralsfalse
- \def\abjad@one{أ}%
- \SetLanguageKeys{arabic}{bcp47=ary,bcp47-language=ar,bcp47-region=MA,bcp47-extension-u=nu-latn}%
- \gdef\@@arabic@month{\@arabic@month{#1}}%
- },
- locale / mauritania.code =
- {%
- \eastern@numeralstrue
- \def\abjad@one{ا}%
- \SetLanguageKeys{arabic}{bcp47=ar-MR,bcp47-language=ar,bcp47-region=MR}%
- \gdef\@@arabic@month{\@arabic@month{#1}}%
- },
- locale.default:n = default,
- locale/unknown.code = \xpg@warning{Unknown Arabic locale `#1'},
- calendar.choice:,
- calendar / gregorian.code =
- {%
- \@hijricalfalse
- },
- calendar / hijri.code =
- {%
- \@hijricaltrue
- },
- calendar / islamic.code =
- {%
- \@hijricaltrue
- },
- calendar.default:n = gregorian,
- calendar/unknown.code = \xpg@warning{Unknown Arabic calendar option `#1'}
- }
-
-% Register default options
-\InitializeGlossOptions{arabic}{locale=default,calendar=gregorian,numerals=mashriq,hijricorrection=0,abjadjimnotail=false}
-% Register alias options
-\SetLanguageAliasValues{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{%
- \@ifundefined{arabicgregmonth@#1}%
- {\xpg@warning{Option `locale=#1' is not defined for Arabic: using `default' instead}%
- \arabicgregmonth@default}%
- {\expandafter\csname arabicgregmonth@#1\endcsname}%
-}
-
-%\Hijritoday is now locale-aware and will format the date with this macro:
-\DefineFormatHijriDate{arabic}{\@ensure@RTL{\arabicnumber{\value{Hijriday}}%
- \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
- \iflanguageloaded{english}{\textenglish{\today}}%else US format
- {\normalfontlatin\ifcase\month\or January\or February\or March\or April\or May\or June\or
- July\or August\or September\or October\or November\or December\fi
- \space\number\day,\space\number\year}%
- \fi
- \fi}}
-
-% 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\abjad@zero\or ي\or ك\or ل\or م\or ن%
- \or ص\or ع\or ف\or ض\fi
- \abj@num@i}
-\def\abj@maghribi@num@iii#1{%
- \ifcase#1\or ق\or ر\or س\or ت\or ث%
- \or خ\or ذ\or ظ\or غ\fi
- \abj@maghribi@num@ii}
-\def\abj@maghribi@num@iv#1{%
- \ifcase#1\or ش\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{%
- \ifcsname xpg@save@sepmark\endcsname
- \SepMark{\xpg@save@sepmark}
- \fi
-}
-
-\def\arabic@luatex@capsformat{%
- %
- % change chapter and part headings
- \ifarabic@customsep
- \ifcsname chapter\endcsname
- \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}
- \fi
- \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{%
- \ifcsname xpg@save@thesection\endcsname
- \let\thesection\xpg@save@thesection
- \fi
- \ifcsname xpg@save@theequation\endcsname
- \let\theequation\xpg@save@theequation
- \fi
- \ifcsname xpg@save@thefigure\endcsname
- \let\thefigure\xpg@save@thefigure
- \fi
- \ifcsname xpg@save@thetable\endcsname
- \let\thetable\xpg@save@thetable
- \fi
- \ifcsname xpg@save@thesubsection\endcsname
- \let\thesubsection\xpg@save@thesubsection
- \ifcsname xpg@save@thesubsubsection\endcsname
- \let\thesubsubsection\xpg@save@thesubsubsection
- \fi
- \fi
- \ifcsname xpg@save@theparagraph\endcsname
- \let\theparagraph\xpg@save@theparagraph
- \fi
- \ifcsname xpg@save@thesubparagraph\endcsname
- \let\thesubparagraph\xpg@save@thesubparagraph
- \fi
-}
-
-\def\blockextras@arabic{%
- \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.2 -- 2024/07/15)
-%
-\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
-
-\newif\if@armenian@numerals
-\@armenian@numeralsfalse
-
-\DeclareKeys[polyglossia/gloss/armenian]
- {
- variant.choice:,
- variant / western.code =
- {%
- \@eastern@armenianfalse
- },
- variant / eastern.code =
- {%
- \@eastern@armeniantrue
- },
- variant.default:n = western,
- variant/unknown.code = \xpg@warning{Unknown Armenian variant `#1'},
- numerals.choice:,
- numerals / armenian.code =
- {%
- \@armenian@numeralstrue
- \SetLanguageKeys{armenian}{bcp47-extension-u={}}%
- },
- numerals / arabic.code =
- {%
- \@armenian@numeralsfalse
- \SetLanguageKeys{armenian}{bcp47-extension-u=nu-latn}%
- },
- numerals.default:n = armenian,
- capitalyiwn.choice:,
- capitalyiwn / true.code =
- {%
- \SetLanguageKeys{armenian}{bcp47-casing=hy-x-yiwn,bcp47-extension-x=yiwn}%
- },
- capitalyiwn / false.code =
- {%
- \SetLanguageKeys{armenian}{bcp47-casing=hy,bcp47-extension-x={}}%
- },
- capitalyiwn.default:n = true
- }
-
-% Register default options
-\InitializeGlossOptions{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-arq.ldf}[polyglossia: module for arq (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ary.ldf}[polyglossia: module for ary (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-arz.ldf}[polyglossia: module for arz (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ast.ldf}[polyglossia: module for ast (Asturian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-% 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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-australian.ldf}[polyglossia: module for Australian English]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-austrian.ldf}[polyglossia: module for Austrian German (old spelling)]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ayl.ldf}[polyglossia: module for ayl (Arabic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-bahasa.ldf}[polyglossia: module for Bahasa Indonesia]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-bahasai.ldf}[polyglossia: module for Bahasa Indonesia]
-
-% We only provide this gloss for babel compatibility. Since bahasai is
-% a malay variety, we use 'malay' with variant 'indonesian' now.
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-bahasam.ldf}[polyglossia: module for Bahasa Melayu]
-
-% We only provide this gloss for babel compatibility. Since bahasam is
-% a malay variety, we use 'malay' with variant 'malaysian' now.
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-be-tarask.ldf}[polyglossia: module for be-tarask (Belarusian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-be.ldf}[polyglossia: module for be (Belarusian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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}
-\newif\ifcyrillic@numerals
-\newif\ifcyrillic@asbuk@numerals
-
-\DeclareKeys[polyglossia/gloss/belarusian]
- {
- babelshorthands.if = belarusian@babelshorthands,
- babelshorthands.default:n = true,
- spelling.choice:,
- spelling / modern.code =
- {%
- \def\belarusian@spelling{modern}%
- \SetLanguageKeys{belarusian}{bcp47=be,bcp47-variant=1959acad}%
- },
- spelling / classic.code =
- {%
- \def\belarusian@spelling{tarask}%
- \SetLanguageKeys{belarusian}{bcp47=be-tarask,bcp47-variant=tarask}%
- },
- spelling / tarask.code =
- {%
- \def\belarusian@spelling{tarask}%
- \SetLanguageKeys{belarusian}{bcp47=be-tarask,bcp47-variant=tarask}%
- },
- spelling.default:n = modern,
- spelling/unknown.code = \xpg@warning{Unknown Belarusian spelling `#1'},
- numerals.choice:,
- numerals / arabic.code =
- {%
- \cyrillic@numeralsfalse
- \cyrillic@asbuk@numeralsfalse
- },
- numerals / cyrillic.code =
- {%
- \cyrillic@numeralstrue
- \cyrillic@asbuk@numeralsfalse
- },
- numerals / cyrillic-trad.code =
- {%
- \cyrillic@numeralstrue
- \cyrillic@asbuk@numeralsfalse
- },
- numerals / cyrillic-alph.code =
- {%
- \cyrillic@numeralstrue
- \cyrillic@asbuk@numeralstrue
- },
- numerals.default:n = arabic,
- numerals/unknown.code = \xpg@warning{Unknown Belarusian numerals value `#1'}
- }
-
-% Register default options
-\InitializeGlossOptions{belarusian}{babelshorthands=false,numerals=arabic,spelling=modern}
-% Register alias options
-\SetLanguageAliasValues{belarusian}{spelling}{classic,tarask}
-
-\ifsystem@babelshorthands
- \SetGlossOptions{belarusian}{babelshorthands=true}
-\else
- \SetGlossOptions{belarusian}{babelshorthands=false}
-\fi
-
-\InitializeBabelShorthands
-
-\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.2 -- 2024/07/15)
-%
-% 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
-
-\def\extras@bengali{}
-\def\noextras@bengali{}
-
-\DeclareKeys[polyglossia/gloss/bengali]
- {
- changecounternumbering.if = bengali@changecounternumbering,
- changecounternumbering.default:n = true,
- numerals.choice:,
- numerals / devanagari.code =
- {%
- \bengali@bengali@numeralsfalse
- \bengali@devanagari@numeralstrue
- },
- numerals / bengali.code =
- {%
- \bengali@bengali@numeralstrue
- \bengali@devanagari@numeralsfalse
- },
- numerals / western.code =
- {%
- \bengali@bengali@numeralsfalse
- \bengali@devanagari@numeralsfalse
- },
- numerals.default:n = devanagari,
- numerals/unknown.code = \xpg@warning{Unknown Bengali numeral `#1'}
- }
-
-% Register default options
-\InitializeGlossOptions{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-bg.ldf}[polyglossia: module for bg (Bulgarian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-bn.ldf}[polyglossia: module for bn (Bengali)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-bo.ldf}[polyglossia: module for bo (Tibetan)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-br.ldf}[polyglossia: module for br (Breton)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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.
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-british.ldf}[polyglossia: module for British English]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-bs.ldf}[polyglossia: module for bs (Bosnian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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{Доказателство}%
- \def\glossaryname{Притурка}%
-}
-
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ca.ldf}[polyglossia: module for ca (Catalan)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-canadian.ldf}[polyglossia: module for Canadian English]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-canadien.ldf}[polyglossia: module for Canadian French]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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}
-
-\DeclareKeys[polyglossia/gloss/catalan]
- {
- babelshorthands.if = catalan@babelshorthands,
- babelshorthands.default:n = true,
- }
-\ifsystem@babelshorthands
- \SetGlossOptions{catalan}{babelshorthands=true}
-\else
- \SetGlossOptions{catalan}{babelshorthands=false}
-\fi
-
-% Register default options
-\InitializeGlossOptions{catalan}{babelshorthands=false}
-
-\InitializeBabelShorthands
-
-%%% 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.2 -- 2024/07/15)
-%
-\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}
-
-\@ifundefined{ifchinese@traditional}%
- {\newif\ifchinese@traditional}{}
-
-\@ifundefined{ifchinese@numerals}%
- {\newif\ifchinese@numerals}{}
-
-\def\chinese@variant{chinese}
-
-\DeclareKeys[polyglossia/gloss/chinese]
- {
- variant.choice:,
- variant / cn.code =
- {%
- \chinese@traditionalfalse
- \SetLanguageKeys{chinese}{language={Chinese Simplified},langtag=ZHS,bcp47=zh-CN,bcp47-language=zh,bcp47-region=CN,bcp47-script=Hans}%
- },
- variant / simplified.code =
- {%
- \chinese@traditionalfalse
- \SetLanguageKeys{chinese}{language={Chinese Simplified},langtag=ZHS,bcp47=zh-CN,bcp47-language=zh,bcp47-region=CN,bcp47-script=Hans}%
- },
- variant / tw.code =
- {%
- \chinese@traditionaltrue
- \SetLanguageKeys{chinese}{language={Chinese Traditional},langtag=ZHT,bcp47=zh-TW,bcp47-language=zh,bcp47-region=TW,bcp47-script=Hant}%
- },
- variant / traditional.code =
- {%
- \chinese@traditionaltrue
- \SetLanguageKeys{chinese}{language={Chinese Traditional},langtag=ZHT,bcp47=zh-TW,bcp47-language=zh,bcp47-region=TW,bcp47-script=Hant}%
- },
- variant.default:n = cn,
- variant/unknown.code = \xpg@warning{Unknown Chinese variant `#1'},
- numerals.choice:,
- numerals / arabic.code =
- {%
- \chinese@numeralsfalse
- \SetLanguageKeys{chinese}{bcp47-extension-u=nu-latn}%
- },
- numerals / chinese.code =
- {%
- \chinese@numeralstrue
- \SetLanguageKeys{chinese}{bcp47-extension-u=nu-hant}%
- },
- numerals.default:n = arabic,
- numerals/unknown.code = \xpg@warning{Unknown Chinese numerals value `#1'}
- }
-
-% Register default options
-\InitializeGlossOptions{chinese}{variant=cn,numerals=arabic}
-%\InitializeGlossOptions{chinese}{variant=tw,numerals=arabic}
-% Register alias options
-\SetLanguageAliasValues{chinese}{variant}{cn,simplified}
-\SetLanguageAliasValues{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ckb-Arab.ldf}[polyglossia: module for ckb-Arab (Kurdish)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ckb-Latn.ldf}[polyglossia: module for ckb-Latn (Kurdish)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ckb.ldf}[polyglossia: module for ckb (Kurdish)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{kurdish}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ckb.ldf>
-%<*gloss-classiclatin.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-classiclatin.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-classiclatin.ldf}[polyglossia: module for classic Latin]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{latin}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-classiclatin.ldf>
-%<*gloss-cop.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-cop.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-cop.ldf}[polyglossia: module for cop (Coptic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\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
-
-\DeclareKeys[polyglossia/gloss/croatian]
- {
- babelshorthands.if = croatian@babelshorthands,
- babelshorthands.default:n = true,
- disabledigraphs.if = croatian@disabledigraphs,
- disabledigraphs.default:n = true,
- splithyphens.if = croatian@splithyphens,
- splithyphens.default:n = true,
- localalph.if = croatian@localalph,
- localalph.default:n = true,
- disableligatures.choices:nn = { true, false }
- {%
- \xpg@warning{The option disableligatures is deprecated.\MessageBreak
- Please use disabledigraphs instead}%
- \ifcase\UseName{l_keys_choice_int}\or
- \croatian@disabledigraphstrue
- \or
- \croatian@disabledigraphsfalse
- \fi
- },
- disableligatures.default:n = true,
- }
-
-% Register default options
-\InitializeGlossOptions{croatian}{babelshorthands=false,disabledigraphs=false,
- splithyphens=true,localalph=true}
-
-\ifsystem@babelshorthands
- \SetGlossOptions{croatian}{babelshorthands=true}
-\else
- \SetGlossOptions{croatian}{babelshorthands=false}
-\fi
-
-\InitializeBabelShorthands
-
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-cy.ldf}[polyglossia: module for cy (Welsh)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-cz.ldf}[polyglossia: module for cz (Czech)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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
-
-\DeclareKeys[polyglossia/gloss/czech]
- {
- babelshorthands.if = czech@babelshorthands,
- babelshorthands.default:n = true,
- splithyphens.if = czech@splithyphens,
- splithyphens.default:n = true,
- vlna.if = czech@vlna,
- vlna.default:n = true
- }
-
-% Register default options
-\InitializeGlossOptions{czech}{babelshorthands=false,splithyphens=true,vlna=true}
-
-\ifsystem@babelshorthands
- \SetGlossOptions{czech}{babelshorthands=true}
-\else
- \SetGlossOptions{czech}{babelshorthands=false}
-\fi
-
-\InitializeBabelShorthands
-
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-da.ldf}[polyglossia: module for da (Danish)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de-AT-1901.ldf}[polyglossia: module for de-AT-1901 (Austrian German, old spelling)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de-AT-1996.ldf}[polyglossia: module for de-AT-1996 (Austrian German)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de-AT.ldf}[polyglossia: module for de-AT (Austrian German)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de-CH-1901.ldf}[polyglossia: module for de-CH-1901 (Swiss German, old spelling)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de-CH-1996.ldf}[polyglossia: module for de-CH-1996 (Swiss German)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de-CH.ldf}[polyglossia: module for de-CH (Swiss German)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de-DE-1901.ldf}[polyglossia: module for de-DE-1901 (Germany's German, old spelling)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de-DE-1996.ldf}[polyglossia: module for de-DE-1996 (Germany's German)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de-DE.ldf}[polyglossia: module for de-DE (Germany's German)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de-AT-1901-Latf.ldf}[polyglossia: module for de-AT-1901-Latf (Austrian German, old spelling)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de-AT-1996-Latf.ldf}[polyglossia: module for de-AT-1996-Latf (Austrian German)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de-AT-Latf.ldf}[polyglossia: module for de-AT-Latf (Austrian German)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de-CH-1901-Latf.ldf}[polyglossia: module for de-CH-1901-Latf (Swiss German, old spelling)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de-CH-1996-Latf.ldf}[polyglossia: module for de-CH-1996-Latf (Swiss German)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de-CH-Latf.ldf}[polyglossia: module for de-CH-Latf (Swiss German)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de-DE-1901-Latf.ldf}[polyglossia: module for de-DE-1901-Latf (Germany's German, old spelling)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de-DE-1996-Latf.ldf}[polyglossia: module for de-DE-1996-Latf (Germany's German)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de-DE-Latf.ldf}[polyglossia: module for de-DE-Latf (Germany's German)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de-Latf.ldf}[polyglossia: module for de-Latf (German)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-de.ldf}[polyglossia: module for de (German)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-dsb.ldf}[polyglossia: module for dsb (Sorbian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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}
-
-\DeclareKeys[polyglossia/gloss/dutch]
- {
- babelshorthands.if = dutch@babelshorthands,
- babelshorthands.default:n = true,
- tremahyphenation.if = dutch@tremahyphenation,
- tremahyphenation.default:n = true
- }
-
-% Register default options
-\InitializeGlossOptions{dutch}{babelshorthands=false,tremahyphenation=true}
-
-\ifsystem@babelshorthands
- \SetGlossOptions{dutch}{babelshorthands=true}
-\else
- \SetGlossOptions{dutch}{babelshorthands=false}
-\fi
-
-\InitializeBabelShorthands
-
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-dv.ldf}[polyglossia: module for dv (Divehi)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{divehi}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-dv.ldf>
-%<*gloss-ecclesiasticlatin.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-ecclesiasticlatin.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ecclesiasticlatin.ldf}[polyglossia: module for ecclesiastic Latin]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{latin}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-ecclesiasticlatin.ldf>
-%<*gloss-el-monoton.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-el-monoton.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-el-monoton.ldf}[polyglossia: module for el-monoton (Greek)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-el-polyton.ldf}[polyglossia: module for el-polyton (Greek)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-el.ldf}[polyglossia: module for el (Greek)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-en-AU.ldf}[polyglossia: module for en-AU (Australian English)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-en-CA.ldf}[polyglossia: module for en-CA (Canadian English)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-en-GB.ldf}[polyglossia: module for en-GB (British English)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-en-NZ.ldf}[polyglossia: module for en-NZ (Newzealand English)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-en-US.ldf}[polyglossia: module for en-US (American English)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-en.ldf}[polyglossia: module for en (English)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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}
-
-\@ifundefined{ifbritish@hyphen}%
- {\newif\ifbritish@hyphen}{}
-\@ifundefined{ifenglish@ordinalmonthday}%
- {\newif\ifenglish@ordinalmonthday}{}
-\@ifundefined{ifbritish@dateformat}%
- {\newif\ifbritish@dateformat}{}
-
-% US English (\l@english) is default
-% Initialize its settings
-\def\english@variant{english}
-\british@hyphenfalse
-\english@ordinalmonthdayfalse
-\british@dateformatfalse
-
-\DeclareKeys[polyglossia/gloss/english]
- {
- ordinalmonthday.if = english@ordinalmonthday,
- ordinalmonthday.default:n = true,
- variant.choices:nn = { uk, british, us, american, usmax, australian, newzealand, canadian }
- {%
- \ifcase\UseName{l_keys_choice_int}\or
- % uk:
- \british@hyphentrue
- \british@dateformattrue
- \english@ordinalmonthdaytrue
- \SetLanguageKeys{english}{babelname=british,bcp47=en-GB,bcp47-language=en,bcp47-region=GB}%
- \or
- % british:
- \british@hyphentrue
- \british@dateformattrue
- \english@ordinalmonthdaytrue
- \SetLanguageKeys{english}{babelname=british,bcp47=en-GB,bcp47-language=en,bcp47-region=GB}%
- \or
- % us:
- \british@hyphenfalse
- \british@dateformatfalse
- \english@ordinalmonthdayfalse
- \SetLanguageKeys{english}{babelname=american,bcp47=en-US,bcp47-language=en,bcp47-region=US}%
- \or
- % american:
- \british@hyphenfalse
- \british@dateformatfalse
- \english@ordinalmonthdayfalse
- \SetLanguageKeys{english}{babelname=american,bcp47=en-US,bcp47-language=en,bcp47-region=US}%
- \or
- % usmax:
- \british@hyphenfalse
- \british@dateformatfalse
- \english@ordinalmonthdayfalse
- \SetLanguageKeys{english}{babelname=american,bcp47=en-US,bcp47-language=en,bcp47-region=US}%
- \IfLanguageDefinedF{usenglishmax}%
- {\xpg@warning{No hyphenation patterns were loaded for "US English Max"\MessageBreak
- I will use the standard patterns for US English instead}%
- \adddialect\l@usenglishmax\l@english
- }%
- \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}%
- \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}%
- \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}%
- \adddialect\l@canadian\l@english
- \fi
- \ifbritish@hyphen
- \IfLanguageDefinedF{ukenglish}%
- {\xpg@warning{No hyphenation patterns were loaded for British English\MessageBreak
- I will use the patterns for US English instead}%
- \adddialect\l@ukenglish\l@english
- }%
- \def\english@variant{ukenglish}%
- \fi
- },
- variant.default:n = us,
- variant/unknown.code = \xpg@warning{Unknown English variant `#1'},
- }
-
-% Register default options
-\InitializeGlossOptions{english}{variant=us,ordinalmonthday=false}
-% Register alias options
-\SetLanguageAliasValues{english}{variant}{us,american}
-\SetLanguageAliasValues{english}{variant}{uk,british}
-
-\ifxetex
- % Check if \l@english is defined. If not, try to set it to some variety
- % (specific order as in the csv list), or null language if everything fails
- \TryPatternWithFallback{english}{british, american, usenglishmax, australian, newzealand}
-\fi
-
-\def\english@language{%
- \SetupPolyglossiaLangPatterns{\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-eo.ldf}[polyglossia: module for eo (Esperanto)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-es-ES.ldf}[polyglossia: module for es-ES (Spain's Spanish)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-es-MX.ldf}[polyglossia: module for es-MX (Mexican Spanish)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-es.ldf}[polyglossia: module for es (Spanish)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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{Parto}%
- \def\pagename{Paĝo}%
- \def\seename{vidu}%
- \def\alsoname{vidu ankaŭ}%
- \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.2 -- 2024/07/15)
-%
-\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{Sõnastik}%
- }
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-et.ldf}[polyglossia: module for et (Estonian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-eu.ldf}[polyglossia: module for eu (Basque)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-fa.ldf}[polyglossia: module for fa (Persian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-farsi.ldf}[polyglossia: module for Farsi]
-
-% We only provide this gloss for babel compatibility.
-% The proper English language name is Persian.
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-fi.ldf}[polyglossia: module for fi (Finnish)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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}
-
-\newif\if@finnish@schoolhyphens
-\newif\if@finnish@babelhyphens
-
-\DeclareKeys[polyglossia/gloss/finnish]
- {
- babelshorthands.if = finnish@babelshorthands,
- babelshorthands.default:n = true,
- hyphens.choice:,
- hyphens / default.code =
- {%
- \@finnish@schoolhyphensfalse
- \@finnish@babelhyphensfalse
- },
- hyphens / school.code =
- {%
- \@finnish@schoolhyphenstrue
- \@finnish@babelhyphensfalse
- },
- hyphens / babel.code =
- {%
- \@finnish@schoolhyphensfalse
- \@finnish@babelhyphenstrue
- },
- hyphens.default:n = default,
- hyphens/unknown.code = \xpg@warning{Unknown Finnish hyphens `#1'},
- schoolhyphens.choice:,
- schoolhyphens / true.code =
- {%
- \@finnish@schoolhyphenstrue
- \@finnish@babelhyphensfalse
- },
- schoolhyphens / false.code =
- {%
- \@finnish@schoolhyphensfalse
- },
- schoolhyphens.default:n = true
- }
-
-% Register default options
-\InitializeGlossOptions{finnish}{babelshorthands=false,hyphens=default}
-
-\ifsystem@babelshorthands
- \SetGlossOptions{finnish}{babelshorthands=true}
-\else
- \SetGlossOptions{finnish}{babelshorthands=false}
-\fi
-
-\InitializeBabelShorthands
-
-\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
- \IfLanguageDefinedTF{schoolfinnish}{%
- \SetupPolyglossiaLangPatterns{schoolfinnish}%
- }{%
- \xpg@warning{Finnish 'School' hyphenation patterns (schoolfinnish) not available.\MessageBreak
- I will use the standard patterns for Finnish instead}%
- \SetupPolyglossiaLangPatterns{finnish}%
- }%
- \else
- \SetupPolyglossiaLangPatterns{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-fr-CA-u-sd-canb.ldf}[polyglossia: module for fr-CA-u-sd-canb (Canadian French, Acadian subvariety)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-fr-CA.ldf}[polyglossia: module for fr-CA (Canadian French)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-fr-CH.ldf}[polyglossia: module for fr-CH (Swiss French)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-fr-FR.ldf}[polyglossia: module for fr-FR (France's French)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-fr.ldf}[polyglossia: module for fr (French)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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}
-
-\def\french@language{%
- \SetupPolyglossiaLangPatterns{\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)
-\AddToHook{begindocument/before}{%
- \let\xpg@orig@makefntext\@makefntext
-}
-
-% name is for compatibility with babel
-\let\french@ttfamilyORI\ttfamily
-\DeclareRobustCommand\french@ttfamilyFB{\nofrench@punctuation\french@ttfamilyORI}
-
-% Configuration of item labels
-\def\french@itemi{\textemdash}
-\def\french@itemii{\textemdash}
-\def\french@itemiii{\textemdash}
-\def\french@itemiv{\textemdash}
-
-\newif\iffrench@autospacetypewriter
-\french@autospacetypewriterfalse
-\newif\iffrench@autospacing
-\french@autospacingtrue
-\newif\iffrench@frenchpart
-\french@frenchparttrue
-\newif\iffrench@autospaceguillemets
-\french@autospaceguillemetstrue
-
-\DeclareKeys[polyglossia/gloss/french]
- {
- variant.choice:,
- variant / french.code =
- {%
- \def\french@variant{french}%
- \SetLanguageKeys{french}{babelname=french,bcp47=fr-FR,bcp47-language=fr,bcp47-region=FR}%
- \french@thincolonspacefalse
- },
- variant / canadian.code =
- {%
- \def\french@variant{canadien}%
- \SetLanguageKeys{french}{babelname=canadien,bcp47=fr-CA,bcp47-language=fr,bcp47-region=CA,bcp47-extension-u=sd-caqc}%
- \IfLanguageDefinedF{canadien}%
- {\xpg@warning{No hyphenation patterns were loaded for "French (Canada)"\MessageBreak
- I will use the standard patterns for French instead}%
- \adddialect\l@canadien\l@french\relax}%
- \french@thincolonspacefalse
- },
- variant / acadian.code =
- {%
- \def\french@variant{acadian}%
- \SetLanguageKeys{french}{babelname=acadian,bcp47=fr-CA-u-sd-canb,bcp47-language=fr,bcp47-region=CA,bcp47-extension-u=sd-canb}%
- \IfLanguageDefinedF{acadian}%
- {\xpg@warning{No hyphenation patterns were loaded for "French (Canada, Acadian)"\MessageBreak
- I will use the standard patterns for French instead}%
- \adddialect\l@acadian\l@french\relax}%
- \french@thincolonspacefalse
- },
- variant / swiss.code =
- {%
- \def\french@variant{swissfrench}%
- \SetLanguageKeys{french}{babelname=french,bcp47=fr-CH,bcp47-language=fr,bcp47-region=CH}%
- \adddialect\l@swissfrench\l@french\relax%
- \french@thincolonspacetrue
- },
- variant.default:n = french,
- variant/unknown.code = \xpg@warning{Unknown French variant `#1'},
- frenchfootnote.if = french@frenchfootnote,
- frenchfootnote.default:n = true,
- autospacing.if = french@autospacing,
- autospacing.default:n = true,
- frenchpart.if = french@frenchpart,
- frenchpart.default:n = true,
- autospaceguillemets.if = french@autospaceguillemets,
- autospaceguillemets.default:n = true,
- thincolonspace.if = french@thincolonspace,
- thincolonspace.default:n = true,
- automaticspacesaroundguillemets.meta:n = {autospaceguillemets=#1},
- autospacetypewriter.if = french@autospacetypewriter,
- autospacetypewriter.default:n = true,
- originaltypewriter.meta:n = {autospacetypewriter=#1},
- itemlabeli.store = \french@itemi,
- itemlabelii.store = \french@itemii,
- itemlabeliii.store = \french@itemiii,
- itemlabeliv.store = \french@itemiv,
- frenchitemlabels.if = french@frenchitemlabels,
- frenchitemlabels.default:n = true,
- itemlabels.code =
- \def\french@itemi{#1}%
- \def\french@itemii{#1}%
- \def\french@itemiii{#1}%
- \def\french@itemiv{#1},
- itemlabels.default:n = \textemdash
- }
-
-% Register default options
-\InitializeGlossOptions{french}{variant=french,autospacing=true,thincolonspace=false,
- autospaceguillemets=true,autospacetypewriter=false,
- frenchfootnote=false,frenchitemlabels=false,
- itemlabels=\textemdash,itemlabeli=\textemdash,itemlabelii=\textemdash,
- itemlabeliii=\textemdash,itemlabeliv=\textemdash}
-% Register alias options
-\SetLanguageAliasValues{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
- \@ifundefined{titleformat}{%
- % With KOMA
- \@ifundefined{sectionformat}{%
- % With memoir
- \@ifundefined{@memptsize}{% (not \ifdefined\@memptsize)
- % With standard classes
- \@ifundefined{NR@part}{% not hyperref
- \@ifundefined{@part}{}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\xpg@french@part\nobreakspace\partname}%
- {}%
- {\@ifundefined{part}{}{\xpg@warning{Failed to patch part for French}}}%
- }% (end \ifdefined \@part)
- }{% Hyperref
- \let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}%
- {\partname\nobreakspace\thepart}%
- {\xpg@french@part\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for French}}%
- }% (end \ifdefined\NR@part)
- }{%
- \@ifundefined{NR@part}{% not hyperref
- \@ifundefined{@part}{}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
- {\partnamefont\xpg@french@part\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for French}}%
- }%
- }{% 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}}%
- }%
- }% (end \ifdefined\@memptsize)
- }{% (\ifdefined\sectionformat)
- \@ifundefined{partformat}{}{%
- \let\xpg@save@part@format\partformat%
- \renewcommand{\partformat}{\xpg@french@part~\partname}%
- }%
- }% (end \ifdefined\sectionformat)
- }{% (\ifdefined\titleformat)
- \@ifundefined{NR@part}{% not hyperref
- \@ifundefined{@part}{}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\xpg@french@part\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for French}}%
- }%
- }{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}%
- {\partname\nobreakspace\thepart}%
- {\xpg@french@part\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for French}}%
- }%
- }% (end \ifdefined\titleformat)
-}
-
-\def\nofrench@capsformat{%
- % Reset chapter and part heading
- \@ifundefined{titleformat}{%
- \@ifundefined{sectionformat}{%
- % With memoir and standard classes
- \@ifundefined{xpg@save@part@format}{}{%
- \@ifundefined{NR@part}{%
- \let\@part\xpg@save@part@format%
- }{%
- \let\NR@part\xpg@save@part@format%
- }%
- }%
- }{%
- % With KOMA
- \@ifundefined{xpg@save@part@format}{}{%
- \let\partformat\xpg@save@part@format
- }%
- }% (end \ifdefined\sectionformat)
- }{% (\ifdefined\titleformat)
- % With titlesec
- \@ifundefined{xpg@save@part@format}{}{%
- \@ifundefined{NR@part}{%
- \let\@part\xpg@save@part@format%
- }{%
- \let\NR@part\xpg@save@part@format%
- }%
- }%
- }% (end \ifdefined\titleformat)
-}
-
-\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%
- \IfMainLanguageTF{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
- \IfMainLanguageTF{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-friulan.ldf}[polyglossia: module for Friulian]
-
-% We only provide this gloss for babel compatibility.
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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}}
-
-\AddToHook{begindocument/before}{% 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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-fur.ldf}[polyglossia: module for fur (Friulian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ga.ldf}[polyglossia: module for ga (Gaelic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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}
-
-\DeclareKeys[polyglossia/gloss/gaelic]
- {
- variant.choice:,
- variant / irish.code =
- {%
- \gdef\gaelic@variant{irish}%
- \SetLanguageKeys{gaelic}{language=Irish,langtag=IRI,babelname=irish,bcp47=ga,bcp47-language=ga}%
- \SetupLatinPolyglossiaFont{gaelic}%
- },
- variant / scottish.code =
- {%
- \gdef\gaelic@variant{scottish}%
- \SetLanguageKeys{gaelic}{language=Gaelic,langtag=GAE,babelname=scottish,bcp47=gd,bcp47-language=gd}%
- \SetupLatinPolyglossiaFont{gaelic}%
- },
- variant.default:n = irish,
- variant/unknown.code = \xpg@warning{Unknown gaelic variant `#1'}
- }
-
-% Register default options
-\InitializeGlossOptions{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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-gd.ldf}[polyglossia: module for gd (Gaelic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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
-
-\DeclareKeys[polyglossia/gloss/georgian]
- {
- babelshorthands.if = georgian@babelshorthands,
- babelshorthands.default:n = true,
- oldmonthnames.if = georgian@oldmonthnames,
- oldmonthnames.default:n = true,
- numerals.choice:,
- numerals / arabic.code =
- {%
- \georgian@numeralsfalse
- \SetLanguageKeys{georgian}{bcp47-extension-u=nu-latn}%
- },
- numerals / georgian.code =
- {%
- \georgian@numeralstrue
- \SetLanguageKeys{georgian}{bcp47-extension-u=nu-geor}%
- },
- numerals.default:n = arabic
- }
-
-% Register default options
-\InitializeGlossOptions{georgian}{babelshorthands=false,oldmonthnames=false,numerals=arabic}
-
-\ifsystem@babelshorthands
- \SetGlossOptions{georgian}{babelshorthands=true}
-\else
- \SetGlossOptions{georgian}{babelshorthands=false}
-\fi
-
-\InitializeBabelShorthands
-
-\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.2 -- 2024/07/15)
-%
-\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
-
-\newif\if@austrian@locale
-\@austrian@localefalse
-\newif\if@swiss@locale
-\@swiss@localefalse
-
-\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
-
-\DeclareKeys[polyglossia/gloss/german]
- {
- babelshorthands.if = german@babelshorthands,
- babelshorthands.default:n = true,
- latesthyphen.if = german@latesthyphen,
- latesthyphen.default:n = true,
- capitaleszett.choice:,
- capitaleszett / true.code =
- {% MakeUppercase capitalizes the eszett (U+00DF) with U+1E9E
- \SetLanguageKeys{german}{bcp47-casing=de-x-eszett,bcp47-extension-x=eszett}%
- },
- capitaleszett / false.code =
- {% Capitalize eszett as <SS>
- \SetLanguageKeys{german}{bcp47-casing=de,bcp47-extension-x={}}%
- },
- capitaleszett.default:n = true,
- script.choice:,
- script / latin.code =
- {%
- \@german@blackletterfalse
- \german@set@babelname
- },
- script / blackletter.code =
- {%
- \@german@blacklettertrue
- \german@set@babelname
- },
- script / fraktur.code =
- {%
- \@german@blacklettertrue
- \german@set@babelname
- },
- script.default:n = latin,
- script/unknown.code = \xpg@warning{Unknown German script `#1'},
- spelling.choice:,
- spelling / new.code =
- {%
- \@german@oldspellingfalse
- \german@set@babelname
- },
- spelling / old.code =
- {%
- \@german@oldspellingtrue
- \german@set@babelname
- },
- spelling / 1901.code =
- {%
- \@german@oldspellingtrue
- \german@set@babelname
- },
- spelling / 1996.code =
- {%
- \@german@oldspellingfalse
- \german@set@babelname
- },
- spelling.default:n = new,
- spelling/unknown.code = \xpg@warning{Unknown German spelling `#1'},
- variant.choice:,
- variant / german.code =
- {%
- \@swiss@localefalse
- \@austrian@localefalse
- \german@set@babelname
- },
- variant / austrian.code =
- {%
- \@austrian@localetrue
- \@swiss@localefalse
- \german@set@babelname
- },
- variant / swiss.code =
- {%
- \@swiss@localetrue
- \@austrian@localefalse
- \IfLanguageDefinedF{swissgerman}
- {%
- \xpg@warning{No hyphenation patterns were loaded for "Swiss German (Old Spelling)"\MessageBreak
- I will use the standard patterns for German (old spelling) instead}%
- \adddialect\l@swissgerman\l@german\relax
- }%
- \german@set@babelname
- },
- variant.default:n = german,
- variant/unknown.code = \xpg@warning{Unknown German variant `#1'}
- }
-
-
-\SetGlossOptions{german}{spelling,script,variant}
-
-% Register default options
-\InitializeGlossOptions{german}{variant=german,spelling=new,script=latin,babelshorthands=false}
-% Register alias options
-\SetLanguageAliasValues{german}{spelling}{new,1996}
-\SetLanguageAliasValues{german}{spelling}{old,1901}
-\SetLanguageAliasValues{german}{script}{blackletter,fraktur}
-
-\ifsystem@babelshorthands
- \SetGlossOptions{german}{babelshorthands=true}
-\else
- \SetGlossOptions{german}{babelshorthands=false}
-\fi
-
-\InitializeBabelShorthands
-
-\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
- \SetupPolyglossiaLangPatterns{swissgerman}%
- \else
- \SetupPolyglossiaLangPatterns{german}%
- \fi
- \if@austrian@locale
- \adddialect\l@austrian\l@german%
- \fi
- \else
- \SetupPolyglossiaLangPatterns{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-germanb.ldf}[polyglossia: module for German (old spelling)]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-gl.ldf}[polyglossia: module for gl (Galician)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-grc.ldf}[polyglossia: module for grc (Greek)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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*[variant=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
-
-\def\greek@set@langdata{%
- \if@greek@ancient
- \IfLanguageDefinedF{ancientgreek}%
- {\xpg@warning{No hyphenation patterns were loaded for Ancient Greek\MessageBreak
- I will use the patterns loaded for \string\l@greek\space instead}%
- \adddialect\l@ancientgreek\l@greek\relax}%
- \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
- \IfLanguageDefinedF{polygreek}%
- {\xpg@warning{No hyphenation patterns were loaded for Polytonic Greek\MessageBreak
- I will use the patterns loaded for \string\l@greek\space instead}%
- \adddialect\l@polygreek\l@greek\relax}%
- \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
- \IfLanguageDefinedF{monogreek}%
- {\xpg@warning{No hyphenation patterns were loaded for Monotonic Greek\MessageBreak
- I will use the patterns loaded for \string\l@greek\space instead}%
- \adddialect\l@monogreek\l@greek\relax}%
- \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{%
- \SetupPolyglossiaLangPatterns{\greek@variant}%
-}
-
-
-\newif\if@greek@numerals
-
-\DeclareKeys[polyglossia/gloss/greek]
- {
- variant.choices:nn = { monotonic, mono,polytonic, poly,ancient, ancientgreek }
- {%
- \CheckHyphenationPatterns{greek}%
- \ifcase\UseName{l_keys_choice_int}\or
- % monotonic:
- \@greek@polyfalse
- \@greek@ancientfalse
- \or
- % mono:
- \@greek@polyfalse
- \@greek@ancientfalse
- \or
- % polytonic:
- \@greek@polytrue
- \@greek@ancientfalse
- \or
- % poly:
- \@greek@polytrue
- \@greek@ancientfalse
- \or
- % ancient:
- \@greek@polyfalse
- \@greek@ancienttrue
- \or
- % ancientgreek:
- \@greek@polyfalse
- \@greek@ancienttrue
- \fi
- \greek@set@langdata
- },
- variant.default:n = monotonic,
- variant/unknown.code = \xpg@warning{Unknown Greek variant `#1'},
- numerals.choice:,
- numerals / greek.code =
- {%
- \@greek@numeralstrue
- \SetLanguageKeys{greek}{bcp47-extension-u=nu-grek}%
- },
- numerals / arabic.code =
- {%
- \@greek@numeralsfalse
- \SetLanguageKeys{greek}{bcp47-extension-u=nu-latn}%
- },
- numerals.default:n = greek,
- numerals/unknown.code = \xpg@warning{Unknown Greek numerals value `#1'},
- capitaliota.choice:,
- capitaliota / true.code =
- {%
- \@greek@capitaliotatrue
- % \MakeUppercase converts the ypogegrammeni (subscript muted iota) to capital iota
- \SetLanguageKeys{greek}{bcp47-casing=el-x-iota,bcp47-extension-x=iota}%
- },
- capitaliota / false.code =
- {%
- \@greek@capitaliotafalse
- % \MakeUppercase retains the subscript versions (default)
- \SetLanguageKeys{greek}{bcp47-casing=el,bcp47-extension-x={}}%
- },
- capitaliota.default:n = true,
- attic.choices:nn = { true, false }
- {%
- \xpg@warning{Greek option `attic' is no longer required.}
- },
- capitaliota.default:n = true,
- }
-
-% Register default options
-\InitializeGlossOptions{greek}{variant=monotonic,numerals=greek}
-% Register alias options
-\SetLanguageAliasValues{greek}{variant}{monotonic,mono}
-\SetLanguageAliasValues{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-he.ldf}[polyglossia: module for he (Hebrew)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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}
-
-\newif\if@calendar@hebrew
-\newif\if@hebrew@numerals
-
-\DeclareKeys[polyglossia/gloss/hebrew]
- {
- marcheshvan.code = \setkeys{hebrewcal}{marcheshvan=#1},
- marcheshvan.default:n = true,
- transliteration.code = \setkeys{hebrewcal}{transliteration=#1},
- transliteration.default:n = alt,
- fullyear.code = \setkeys{hebrewcal}{fullyear=#1},
- fullyear.default:n = true,
- calendar.choice:,
- calendar / hebrew.code =
- {%
- \@calendar@hebrewtrue
- },
- calendar / gregorian.code =
- {%
- \@calendar@hebrewfalse
- },
- calendar.default:n = gregorian,
- calendar/unknown.code = \xpg@warning{Unknown Hebrew calendar `#1'},
- numerals.choice:,
- numerals / hebrew.code =
- {%
- \@hebrew@numeralstrue
- \SetLanguageKeys{hebrew}{bcp47-extension-u=nu-hebr}%
- },
- numerals / arabic.code =
- {%
- \@hebrew@numeralsfalse
- \SetLanguageKeys{hebrew}{bcp47-extension-u=nu-latn}%
- },
- numerals.default:n = arabic,
- numerals/unknown.code = \xpg@warning{Unknown Hebrew numerals value `#1'}
- }
-
-
-\SetGlossOptions{hebrew}{numerals}
-
-% Register default options
-\InitializeGlossOptions{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-hi.ldf}[polyglossia: module for hi (Hindi)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-% 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%
- \XPGNoPatternsFallback{hindi}%
- \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{%
- \SetupPolyglossiaLangPatterns{hindi}%
-}
-
-\newif\ifhindi@devanagari@numerals
-\hindi@devanagari@numeralstrue
-
-\DeclareKeys[polyglossia/gloss/hindi]
- {
- numerals.choice:,
- numerals / devanagari.code =
- {%
- \hindi@devanagari@numeralstrue
- \SetLanguageKeys{hindi}{bcp47-extension-u=nu-deva}%
- },
- numerals / western.code =
- {%
- \hindi@devanagari@numeralsfalse
- \SetLanguageKeys{hindi}{bcp47-extension-u=nu-latn}%
- },
- numerals.default:n = devanagari,
- numerals/unknown.code = \xpg@warning{Unknown Hindi numeral `#1'}
- }
-
-% Register default options
-\InitializeGlossOptions{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\glossaryname{शब्दार्थ सूची}%
- \def\headpagename{पृष्ठ}%
- \def\headtoname{}%
- \def\indexname{सूची}%
- % सूचक
- % अनुक्रमणिका
- % अनुक्रमणि
- \def\listfigurename{चित्रों की सूची}%
- \def\listtablename{तालिकाओं की सूची}%
- \def\pagename{पृष्ठ}%
- \def\partname{खण्ड}%
- \def\prefacename{प्रस्तावना}% प्राक्कथन
- \def\proofname{प्रमाण}%
- \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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-hr.ldf}[polyglossia: module for hr (Croatian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-hsb.ldf}[polyglossia: module for hsb (Higher Sorbian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-hu.ldf}[polyglossia: module for hu (Hungarian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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
-
-\DeclareKeys[polyglossia/gloss/hungarian]
- {
- forceheadingpunctuation.if = hungarian@forceheadingpunctuation,
- forceheadingpunctuation.default:n = true,
- swapstrings.choice:,
- swapstrings / all.code =
- {%
- \@hungarian@swapcaptionstrue
- \@hungarian@swapheadingstrue
- \@hungarian@swapheaderstrue
- },
- swapstrings / captions.code =
- {%
- \@hungarian@swapcaptionstrue
- \@hungarian@swapheadingsfalse
- \@hungarian@swapheadersfalse
- },
- swapstrings / headings.code =
- {%
- \@hungarian@swapcaptionsfalse
- \@hungarian@swapheadingstrue
- \@hungarian@swapheadersfalse
- },
- swapstrings / headers.code =
- {%
- \@hungarian@swapcaptionsfalse
- \@hungarian@swapheadingsfalse
- \@hungarian@swapheaderstrue
- },
- swapstrings / hheaders.code =
- {%
- \@hungarian@swapcaptionsfalse
- \@hungarian@swapheadingstrue
- \@hungarian@swapheaderstrue
- },
- swapstrings / none.code =
- {%
- \@hungarian@swapcaptionsfalse
- \@hungarian@swapheadingsfalse
- \@hungarian@swapheadersfalse
- },
- swapstrings.default:n = all,
- swapstrings/unknown.code = \xpg@warning{Unknown Hungarian swapstrings value `#1'}
- }
-
-% Register default options
-% forceheadinpunctuatin is recommended, but the default value is false for compatibility reasons
-\InitializeGlossOptions{hungarian}{swapstrings=all,
- forceheadingpunctuation=false}
-
-
-\def\hungarian@language{%
- \SetupPolyglossiaLangPatterns{hungarian}%
- \IfLanguageDefinedT{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
- \@ifundefined{titleformat}{%
- % With KOMA
- \@ifundefined{sectionformat}{%
- % Memoir?
- \@ifundefined{@memptsize}{%
- % With standard classes
- \@ifundefined{@makechapterhead}{}{%
- \let\xpg@save@chap@format\@makechapterhead%
- \patchcmd{\@makechapterhead}%
- {\@chapapp\space \thechapter}%
- {\thechapter.\space \@chapapp}%
- {}%
- {\xpg@warning{Failed to patch chapter for Hungarian}}%
- }%
- \@ifundefined{NR@part}{% not hyperref
- \@ifundefined{@part}{}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\thepart.\nobreakspace\partname}%
- {}%
- {\@ifundefined{part}{}{\xpg@warning{Failed to patch part for Hungarian}}}%
- }% (end \ifdefined\@part)
- }{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}%
- {\partname\nobreakspace\thepart}%
- {\thepart.\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for Hungarian}}%
- }% (end not hyperref)
- }{% with memoir (\ifdefined\@memptsize)
- \@ifundefined{@makechapterhead}{}{%
- \let\xpg@save@chap@format\@makechapterhead%
- \patchcmd{\@makechapterhead}{\printchaptername \chapternamenum \printchapternum}%
- {\printchapternum.\chapternamenum\printchaptername}%
- {}%
- {\xpg@warning{Failed to patch chapter for Hungarian}}%
- }%
- \@ifundefined{NR@part}{% not hyperref
- \@ifundefined{@part}{}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
- {\printpartnum.\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for Hungarian}}%
- }%
- }{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}{\printpartname \partnamenum \printpartnum}%
- {\printpartnum.\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for Hungarian}}%
- }%
- }% (end \ifdefined\@memptsize)
- }{% (\ifdefined\sectionformat)
- \@ifundefined{partformat}{}{%
- \let\xpg@save@part@format\partformat%
- \renewcommand{\partformat}{\thepart.~\partname}%
- }%
- \@ifundefined{chapterformat}{}{%
- \let\xpg@save@chap@format\chapterformat%
- \renewcommand{\chapterformat}{\mbox{\thechapter\autodot%
- \IfUsePrefixLine{\nobreakspace\chapapp}{\enskip}}}%
- }%
- }% (end \ifdefined\sectionformat)
- }{% (\ifdefined\titleformat)
- \@ifundefined{NR@part}{% not hyperref
- \@ifundefined{@part}{}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\thepart.\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for Hungarian}}%
- }%
- }{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}%
- {\partname\nobreakspace\thepart}%
- {\thepart.\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for Hungarian}}%
- }%
- \@ifundefined{chapter}{}{%
- \titleformat\chapter[display]%
- {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
- {\thechapter.\space\@chapapp}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
- }%
- }% (end \ifdefined\titleformat)
- \fi% (end \if@hungarian@swapheadings)
- %
- % Change running headers
- \if@hungarian@swapheaders
- \@ifundefined{chapterformat}{%
- \@ifundefined{@memptsize}{%
- % With standard classes
- \@ifundefined{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)
- }{% (\ifdefined\@memptsize)
- % With memoir
- \let\xpg@save@chaptermark@format\chaptermark%
- \renewcommand*\chaptermark[1]{%
- \markboth{\memUChead{%
- \ifnum \c@secnumdepth >\m@ne
- \ifbool{@mainmatter}{%
- \thechapter.\ \@chapapp\@hungarian@forced@dot\ %
- }{}%
- \fi
- ##1}}{}}%
- }% (end \ifdefined\@memptsize)
- }{% (\ifdefined\chapterformat)
- % With KOMA
- \let\xpg@save@chaptermark@format\chaptermarkformat%
- \renewcommand*\chaptermarkformat{%
- \thechapter\autodot\ \IfChapterUsesPrefixLine{\chapapp\@hungarian@forced@dot\enskip}{}}
- }% (end \ifdefined\chapterformat)
- \fi% (end \if@hungarian@swapheaders)
-}
-
-\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
- \@ifundefined{titleformat}{%
- \@ifundefined{sectionformat}{%
- % With memoir and standard classes
- \@ifundefined{xpg@save@part@format}{}{%
- \@ifundefined{NR@part}{%
- \let\@part\xpg@save@part@format%
- }{%
- \let\NR@part\xpg@save@part@format%
- }%
- }%
- \@ifundefined{xpg@save@chap@format}{}{%
- \let\@makechapterhead\xpg@save@chap@format
- }%
- }{%
- % With KOMA
- \@ifundefined{xpg@save@part@format}{}{%
- \let\partformat\xpg@save@part@format
- }%
- \@ifundefined{xpg@save@chap@format}{}{%
- \let\chapterformat\xpg@save@chap@format
- }%
- }% (end \ifdefined\sectionformat)
- }{% (\ifdefined\titleformat)
- % With titlesec
- \@ifundefined{xpg@save@part@format}{}{%
- \@ifundefined{NR@part}{%
- \let\@part\xpg@save@part@format%
- }{%
- \let\NR@part\xpg@save@part@format%
- }%
- }%
- \@ifundefined{chapter}{}{%
- \titleformat\chapter[display]%
- {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
- {\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
- }%
- }% (end \ifdefined\titleformat)
- %
- % Reset headers
- \@ifundefined{chaptermarkformat}{%
- \@ifundefined{chaptermark}{}{%
- % With memoir and standard classes
- \@ifundefined{xpg@save@chaptermark@format}{}{%
- \let\chaptermark\xpg@save@chaptermark@format%
- }%
- }% (end \ifdefined\chaptermark)
- }{%
- % With KOMA
- \@ifundefined{xpg@save@chaptermark@format}{}{%
- \let\chaptermarkformat\xpg@save@chaptermark@format%
- }%
- }% (end \ifdefined\chaptermarkformat)
-}
-% Hungarian needs 1) trailing dots in chapter headings; 2) trailing dot in section, subsection, etc, counters
-\def\@hungarian@forced@dot{}
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-hy.ldf}[polyglossia: module for hy (Armenian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ia.ldf}[polyglossia: module for ia (Interlingua)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-id.ldf}[polyglossia: module for id (Malay)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-irish.ldf}[polyglossia: module for Irish]
-
-% We only provide this gloss for babel compatibility. Since irish is
-% a gaelic variety, we use 'gaelic' with variant 'irish' now.
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-is.ldf}[polyglossia: module for is (Icelandic)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-it.ldf}[polyglossia: module for it (Italian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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}
-
-\DeclareKeys[polyglossia/gloss/italian]
- {
- babelshorthands.if = italian@babelshorthands,
- babelshorthands.default:n = true,
- }
-
-% Register default options
-\InitializeGlossOptions{italian}{babelshorthands=false}
-
-\ifsystem@babelshorthands
- \SetGlossOptions{italian}{babelshorthands=true}
-\else
- \SetGlossOptions{italian}{babelshorthands=false}
-\fi
-
-\InitializeBabelShorthands
-
-\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
-\AddToHook{begindocument/before}{% 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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ja.ldf}[polyglossia: module for ja (Japanese)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ka.ldf}[polyglossia: module for ka (Georgian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%%
-%% 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
-
-\DeclareKeys[polyglossia/gloss/kannada]
- {
- numerals.choice:,
- numerals / kannada.code =
- {%
- \kannada@numeralstrue
- },
- numerals / western.code =
- {%
- \kannada@numeralsfalse
- },
- numerals.default:n = kannada
- }
-
-
-\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.2 -- 2024/07/15)
-%
-\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}
-
-\DeclareKeys[polyglossia/gloss/khmer]
- {
- numerals.choice:,
- numerals / khmer.code =
- {%
- \@khmer@numeralstrue
- \SetLanguageKeys{khmer}{bcp47-extension-u=nu-khmr}%
- },
- numerals / arabic.code =
- {%
- \@khmer@numeralsfalse
- \SetLanguageKeys{khmer}{bcp47-extension-u=nu-latn}%
- },
- numerals.default:n = arabic
- }
-
-\SetGlossOptions{khmer}{numerals}
-
-\def\captionskhmer{%
- \def\prefacename{អារម្ភកថា}%
- \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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-km.ldf}[polyglossia: module for km (Khmer)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-kmr-Arab.ldf}[polyglossia: module for kmr-Arab (Kurdish)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-kmr-Latn.ldf}[polyglossia: module for kmr-Latn (Kurdish)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-kmr.ldf}[polyglossia: module for kmr (Kurdish)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-kn.ldf}[polyglossia: module for kn (Kannada)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ko.ldf}[polyglossia: module for ko (Korean)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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}
-
-\newif\if@korean@swapheadings
-\newif\if@korean@swapheaders
-
-\DeclareKeys[polyglossia/gloss/korean]
- {
- variant.choices:nn = { plain, classic, modern }
- {%
- \edef\xpg@korean@variant{\the\numexpr\UseName{l_keys_choice_int}-1\relax}
- },
- variant.default:n = plain,
- captions.choices:nn = { hangul, hanja }
- {%
- \edef\xpg@korean@captions{\the\numexpr\UseName{l_keys_choice_int}-1\relax}
- },
- captions.default:n = hangul,
- swapstrings.choice:,
- swapstrings / all.code =
- {%
- \@korean@swapheadingstrue
- \@korean@swapheaderstrue
- },
- swapstrings / headings.code =
- {%
- \@korean@swapheadingstrue
- \@korean@swapheadersfalse
- },
- swapstrings / headers.code =
- {%
- \@korean@swapheadingsfalse
- \@korean@swapheaderstrue
- },
- swapstrings / none.code =
- {%
- \@korean@swapheadingsfalse
- \@korean@swapheadersfalse
- },
- swapstrings.default:n = all,
- swapstrings/unknown.code = \xpg@warning{Unknown Korean swapstrings value `#1'}
- }
-
-% Register default options
-\InitializeGlossOptions{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
- \@ifundefined{titleformat}{%
- % With KOMA
- \@ifundefined{sectionformat}{%
- % With memoir
- \@ifundefined{@memptsize}{%
- % With standard classes
- \@ifundefined{@makechapterhead}{}{%
- \let\xpg@save@chap@format\@makechapterhead
- \patchcmd{\@makechapterhead}%
- {\@chapapp\space \thechapter}%
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \appendixname\space \thechapter
- \else
- \koreanTHEname\space \thechapter\space \@chapapp
- \fi
- }%
- {}%
- {\xpg@warning{Failed to patch chapter for Korean}}%
- }%
- \@ifundefined{NR@part}{% not hyperref
- \@ifundefined{@part}{}{%
- \ifpatchable{\@part}%
- {\partname\nobreakspace\thepart}%
- {\let\xpg@save@part@format\@part
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
- {}%
- {\@ifundefined{part}{}{\xpg@warning{Failed to patch part for Korean}}}}%
- {}%
- }% (end \ifdefined\@part)
- }{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part
- \patchcmd{\NR@part}%
- {\partname\nobreakspace\thepart}%
- {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
- {}%
- {\xpg@warning{Failed to patch part for Korean}}%
- }% (end not hyperref)
- }{% (\ifdefined\@memptsize)
- \@ifundefined{@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
- }%
- \@ifundefined{NR@part}{% not hyperref
- \@ifundefined{@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
- }%
- }{% 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
- }%
- }% (end \ifdefined\@memptsize)
- }{% (\ifdefined\sectionformat)
- \@ifundefined{partformat}{}{%
- \let\xpg@save@part@format\partformat
- \renewcommand*{\partformat}{\koreanTHEname~\thepart~\partname}%
- }%
- \@ifundefined{chapterformat}{}{%
- \let\xpg@save@chap@format\chapterformat
- \renewcommand*{\chapterformat}{\mbox{%
- \IfChapterUsesPrefixLine
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \chapapp\nobreakspace \thechapter\autodot
- \else
- \koreanTHEname\nobreakspace \thechapter\nobreakspace \chapapp\autodot
- \fi
- }%
- {\thechapter\autodot\enskip}%
- }}%
- }%
- }% (end \ifdefined\sectionformat)
- }{% (\ifdefined\titleformat)
- \@ifundefined{NR@part}{% not hyperref
- \@ifundefined{@part}{}{%
- \let\xpg@save@part@format\@part
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
- {}%
- {\xpg@warning{Failed to patch part for Korean}}%
- }%
- }{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part
- \patchcmd{\NR@part}%
- {\partname\nobreakspace\thepart}%
- {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
- {}%
- {\xpg@warning{Failed to patch part for Korean}}%
- }%
- \@ifundefined{chapter}{}{%
- \titleformat\chapter[display]%
- {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}%
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \appendixname\space \thechapter
- \else
- \koreanTHEname\space \thechapter\space \@chapapp
- \fi
- }{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}%
- }%
- }% (end \ifdefined\titleformat)
- \fi % (end \if@korean@swapheadings)
- %
- % Change running headers
- \if@korean@swapheaders
- \@ifundefined{chapterformat}{%
- \@ifundefined{@memptsize}{%
- % With standard classes
- \@ifundefined{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)
- }{% (\ifdefined\@memptsize)
- % With memoir
- \let\xpg@save@chaptermark@format\chaptermark
- \patchcmd{\chaptermark}%
- {\@chapapp\ \@nameuse{thechapter}}%
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \appendixname\ \@nameuse{thechapter}%
- \else
- \koreanTHEname\ \@nameuse{thechapter}\ \@chapapp
- \fi
- }%
- {}%
- {\xpg@warning{Failed to patch chaptermark for Korean}}%
- }% (end \ifdefined\@memptsize)
- }{% (\ifdefined\chapterformat)
- % With KOMA
- \let\xpg@save@chaptermark@format\chaptermarkformat
- \renewcommand*\chaptermarkformat{%
- \IfChapterUsesPrefixLine
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \chapapp\ \thechapter\autodot
- \else
- \koreanTHEname\ \thechapter\ \chapapp\autodot
- \fi
- }%
- {\thechapter\autodot}%
- \enskip
- }%
- }% (end \ifdefined\chapterformat)
- \fi % (end \if@korean@swapheaders)
-}
-
-\def\nokorean@headingsformat{%
- % Reset chapter and part heading
- \@ifundefined{titleformat}{%
- \@ifundefined{sectionformat}{%
- % With memoir and standard classes
- \@ifundefined{xpg@save@part@format}{}{%
- \@ifundefined{NR@part}{%
- \let\@part\xpg@save@part@format
- }{%
- \let\NR@part\xpg@save@part@format
- }%
- }%
- \@ifundefined{xpg@save@chap@format}{}{%
- \let\@makechapterhead\xpg@save@chap@format
- }%
- }{%
- % With KOMA
- \@ifundefined{xpg@save@part@format}{}{%
- \let\partformat\xpg@save@part@format
- }%
- \@ifundefined{xpg@save@chap@format}{}{%
- \let\chapterformat\xpg@save@chap@format
- }%
- }% (end \ifdefined\sectionformat)
- }{% (\ifdefined\titleformat)
- % With titlesec
- \@ifundefined{xpg@save@part@format}{}{%
- \@ifundefined{NR@part}{%
- \let\@part\xpg@save@part@format
- }{%
- \let\NR@part\xpg@save@part@format
- }%
- }%
- \@ifundefined{chapter}{}{%
- \titleformat\chapter[display]%
- {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}%
- {\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}%
- }%
- }% (end \ifdefined\titleformat)
- %
- % Reset headers
- \@ifundefined{chaptermarkformat}{%
- \@ifundefined{chaptermark}{}{%
- % With memoir and standard classes
- \@ifundefined{xpg@save@chaptermark@format}{}{%
- \let\chaptermark\xpg@save@chaptermark@format
- }%
- }% (end \ifdefined\chaptermark)
- }{%
- % With KOMA
- \@ifundefined{xpg@save@chaptermark@format}{}{%
- \let\chaptermarkformat\xpg@save@chaptermark@format
- }%
- }% (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 ""
- \noextras@korean@common
- }
-\else % luatex
- \def\inlineextras@korean{\xpg@attr@cjkspacing\xpg@korean@variant\relax}
- \def\noextras@korean{%
- \unsetattribute\xpg@attr@cjkspacing
- \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@cjkspacing
-\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-cjk-spacing" }
-% \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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ku-Arab.ldf}[polyglossia: module for ku-Arab (Kurdish)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ku-Latn.ldf}[polyglossia: module for ku-Latn (Kurdish)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ku.ldf}[polyglossia: module for ku (Kurdish)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-% 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}
-
-\newif\if@kurdish@latin
-\newif\if@kurdish@arabic
-
-\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}
- \SetupLatinPolyglossiaFont{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
- \SetupNonLatinPolyglossiaFont{kurdish}%
- \else% sorani=arabic, kurmanji=latin
- \if@kurdish@kurmanji
- \@western@numeralstrue%
- \SetLanguageKeys{kurdish}{script=Latin,direction=LR,scripttag=latn,babelname=kurmanji,bcp47=kmr-Latn,bcp47-language=kmr,bcp47-script=Latn,bcp47-casing=kmr-Latn}%
- \SetupLatinPolyglossiaFont{kurdish}%
- \def\kurdish@script{latin}
- \else
- \SetLanguageKeys{kurdish}{script=Arabic,direction=RL,scripttag=arab,babelname=kurdish,bcp47=ckb-Arab,bcp47-language=ckb,bcp47-script=Arab,bcp47-casing=ckb-Arab}%
- \SetupNonLatinPolyglossiaFont{kurdish}%
- \fi
- \fi
- \fi
-}
-
-\newif\if@western@numerals
-
-\newif\ifkurdish@customsep\kurdish@customsepfalse
-\def\xpg@sepmark{}
-
-%TODO add option for CALENDAR
-
-\DeclareKeys[polyglossia/gloss/kurdish]
- {
- variant.choice:,
- variant / sorani.code =
- {%
- \def\kurdish@variant{sorani}%
- \@kurdish@kurmanjifalse
- \kurdish@set@variety
- },
- variant / kurmanji.code =
- {%
- \def\kurdish@variant{kurmanji}%
- \@kurdish@kurmanjitrue
- \kurdish@set@variety
- },
- variant.default:n = sorani,
- variant/unknown.code = \xpg@warning{Unknown Kurdish variant `#1'},
- script.choice:,
- script / arabic.code =
- {%
- \@kurdish@latinfalse
- \@kurdish@arabictrue
- \kurdish@set@variety
- },
- script / latin.code =
- {%
- \@kurdish@latintrue
- \@kurdish@arabicfalse
- \kurdish@set@variety
- },
- script.default:n = sorani,
- script/unknown.code = \xpg@warning{Unknown Kurdish script `#1'},
- numerals.choice:,
- numerals / eastern.code =
- {%
- \@western@numeralsfalse
- },
- numerals / western.code =
- {%
- \@western@numeralstrue
- \@force@western@numeralstrue
- },
- numerals.default:n = eastern,
- numerals/unknown.code = \xpg@warning{Unknown Kurdish numerals value `#1'},
- sectionsep.code = \gdef\xpg@sepmark{#1}\kurdish@customseptrue,
- sectionsep.default:n = .,
- abjadjimnotail.if = abjad@jim@notail,
- abjadjimnotail.default:n = true,
- locale.store = \@kurdish@locale
- }
-
-% Register default options
-\InitializeGlossOptions{kurdish}{variant=sorani,locale=default,script=arabic,abjadjimnotail=false,numerals=eastern}
-
-\def\kurdish@language{%
- \SetupPolyglossiaLangPatterns{\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{%
- \ifcsname xpg@save@sepmark\endcsname%
- \SepMark{\xpg@save@sepmark}
- \fi%
-}
-
-\def\kurdish@luatex@capsformat{%
- %
- % change chapter and part headings
- \ifkurdish@customsep
- \ifcsname chapter\endcsname%
- \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}
- \fi%
- \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{%
- \ifcsname xpg@save@thesection\endcsname%
- \let\thesection\xpg@save@thesection%
- \fi%
- \ifcsname xpg@save@theequation\endcsname%
- \let\theequation\xpg@save@theequation%
- \fi%
- \ifcsname xpg@save@thefigure\endcsname%
- \let\thefigure\xpg@save@thefigure%
- \fi%
- \ifcsname xpg@save@thetable\endcsname%
- \let\thetable\xpg@save@thetable%
- \fi%
- \ifcsname xpg@save@thesubsection\endcsname%
- \let\thesubsection\xpg@save@thesubsection%
- \ifcsname xpg@save@thesubsubsection\endcsname%
- \let\thesubsubsection\xpg@save@thesubsubsection%
- \fi%
- \fi%
- \ifcsname xpg@save@theparagraph\endcsname%
- \let\theparagraph\xpg@save@theparagraph%
- \fi%
- \ifcsname xpg@save@thesubparagraph\endcsname%
- \let\thesubparagraph\xpg@save@thesubparagraph%
- \fi%
-}
-
-\def\blockextras@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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-kurmanji.ldf}[polyglossia: module for Kurmanji Kurdish]
-
-% We provide this gloss for babel compatibility.
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-la-xclassic.ldf}[polyglossia: module for la-xclassic (Latin)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-la-xecclesiastic.ldf}[polyglossia: module for la-xecclesiastic (Latin)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-la-xmedieval.ldf}[polyglossia: module for la-xmedieval (Latin)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-la.ldf}[polyglossia: module for la (Latin)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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}
-
-\DeclareKeys[polyglossia/gloss/lao]
- {
- numerals.choice:,
- numerals / arabic.code =
- {%
- \@lao@numeralsfalse
- },
- numerals / lao.code =
- {%
- \@lao@numeralstrue
- },
- numerals.default:n = arabic
- }
-
-% Register default options
-\InitializeGlossOptions{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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\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
-\bool_new:N \l_polyglossia_latin_babelshorthands_bool
-\bool_new:N \l_polyglossia_latin_prosodic_shorthands_bool
-\bool_new:N \l_polyglossia_latin_ecclesiastic_footnotes_bool
-
-\cs_new:Npn \polyglossia_latin_classical_character_codes:
- {
- \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:
- {
- \IfLanguageDefinedTF {latin}
- {
- \def \latin@language
- {
- \SetupPolyglossiaLangPatterns {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"
- {
- \IfLanguageDefinedTF {#1}
- {
- \def \latin@language
- {
- \SetupPolyglossiaLangPatterns {#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)
-\hook_gput_code:nnn { begindocument / before } {.}
-{
- \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:
- {
- \IfMainLanguageTF {latin}
- {
- \cs_if_exist:NT \@makefntext
- {
- \bool_if:NTF \l_polyglossia_latin_ecclesiastic_footnotes_bool
- {
- \let \@makefntext \polyglossia_latin_variant_footnote:n
- }
- {
- \let \@makefntext \polyglossia_latin_original_footnote:n
- }
- }
- }
- {
- \bool_if:NT \l_polyglossia_latin_ecclesiastic_footnotes_bool
- {
- \msg_warning:nn {polyglossia} {latin / ineffective footnote option}
- }
- }
- }
-
-%%%%% Language variants: classic, medieval, modern, and ecclesiastic
-
-\str_new:N \l_polyglossia_latin_variant_str
-
-\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:
- }
-
-%%%%% 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:.
- }
-
-%%%%% 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 }
- }
- }
-
-\DeclareKeys[polyglossia/gloss/latin]
- {
- babelshorthands.bool_set:N = \l_polyglossia_latin_babelshorthands_bool,
- babelshorthands.default:n = true,
- prosodicshorthands.bool_set:N = \l_polyglossia_latin_prosodic_shorthands_bool,
- prosodicshorthands.default:n = true,
- usej.bool_set:N = \l_polyglossia_latin_use_j_bool,
- capitalizemonth.bool_set:N = \l_polyglossia_latin_capitalize_month_bool,
- hyphenation.code =
- \str_case:nnTF {#1}
- {
- {classic} { \polyglossia_latin_set_patterns:n {classiclatin} }
- {liturgical} { \polyglossia_latin_set_patterns:n {liturgicallatin} }
- {modern} { \polyglossia_latin_use_modern_patterns: }
- }
- {
- \msg_info:nnn {polyglossia} {latin / hyphenation variant} {#1}
- }
- {
- \msg_warning:nnn {polyglossia} {latin / illegal hyphenation variant} {#1}
- },
- variant.code =
- \str_case:nnF {#1}
- {
- {classic}
- {
- \msg_info:nnn {polyglossia} {latin / language variant} {classic}
- \polyglossia_latin_classic_settings:
- }
- {medieval}
- {
- \msg_info:nnn {polyglossia} {latin / language variant} {medieval}
- \polyglossia_latin_medieval_settings:
- }
- {modern}
- {
- \msg_info:nnn {polyglossia} {latin / language variant} {modern}
- \polyglossia_latin_modern_settings:
- }
- {ecclesiastic}
- {
- \msg_info:nnn {polyglossia} {latin / language variant} {ecclesiastic}
- \polyglossia_latin_ecclesiastic_settings:
- }
- }
- {
- \msg_warning:nnn {polyglossia} {latin / illegal language variant} {#1}
- },
- ecclesiasticfootnotes.choices:nn = { true, false }
- {
- \ifcase\UseName{l_keys_choice_int}\or
- \bool_set_true:N \l_polyglossia_latin_ecclesiastic_footnotes_bool
- \else
- \bool_set_false:N \l_polyglossia_latin_ecclesiastic_footnotes_bool
- \fi
- \xpg_if_in_preamble:TF
- {
- % within the preamble
- % The application of the option has to be postponed as the main
- % language may be undefined when the option is called.
- \AtBeginDocument { \polyglossia_latin_apply_footnote_option: }
- }
- {
- % within the document
- \polyglossia_latin_apply_footnote_option:
- }
- },
- ecclesiasticfootnotes.default:n = true
- }
-
-% Register default options
-\InitializeGlossOptions{latin}{variant=modern,hyphenation=modern,babelshorthands=false,
- prosodicshorthands=false,ecclesiasticfootnotes=false,
- usej=false,capitalizemonth=true}
-
-\ifsystem@babelshorthands
- \SetGlossOptions{latin}{babelshorthands=true}
-\else
- \SetGlossOptions{latin}{babelshorthands=false}
-\fi
-
-\ExplSyntaxOff % babelsh.def does not support expl3 syntax
-\@ifundefined{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
- {
- \IfMainLanguageTF {latin}
- {
- \bool_if:NF \l_polyglossia_latin_prosodic_shorthands_bool
- {
- \shorthandoff {=}
- \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* {^}
- % 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
-
-\hook_gput_code:nnn { begindocument / before } {.}
- {
- \edef \xpgla@savedvalues
- {
- \clubpenalty = \the \clubpenalty \space
- \@clubpenalty = \the \@clubpenalty \space
- \widowpenalty = \the \widowpenalty \space
- \finalhyphendemerits = \the \finalhyphendemerits
- }
- }
-
-\def \noextras@latin
- {
- \bool_if:NT \l_polyglossia_latin_babelshorthands_bool
- {
- \polyglossia_latin_no_shorthands:
- }
- \bool_if:NT \l_polyglossia_latin_prosodic_shorthands_bool
- {
- \polyglossia_latin_no_prosodic_shorthands:
- }
- \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:
- }
- \bool_if:NTF \l_polyglossia_latin_babelshorthands_bool
- {
- \polyglossia_latin_shorthands:
- }
- {
- \polyglossia_latin_no_shorthands:
- }
- \bool_if:NTF \l_polyglossia_latin_prosodic_shorthands_bool
- {
- \polyglossia_latin_prosodic_shorthands:
- }
- {
- \polyglossia_latin_no_prosodic_shorthands:
- }
- }
-
-\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-latvian.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-latvian.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
-%
-\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{Priekšmetu rādītājs}%
- \def\figurename{Att.}%
- \def\tablename{Tabula}%
- \def\partname{Daļa}%
- \def\enclname{Pielikumā}%
- \def\ccname{Kopija(s)}%
- \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.2 -- 2024/07/15)
-%
-% 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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-lo.ldf}[polyglossia: module for lo (Lao)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-lowersorbian.ldf}[polyglossia: module for Lower Sorbian]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-lsorbian.ldf}[polyglossia: module for Lower Sorbian]
-
-% We only provide this gloss for babel compatibility. Since lsorbian is
-% a sorbian variety, we use 'sorbian' with variant 'lower' now.
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-lt.ldf}[polyglossia: module for lt (Lithuanian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-lv.ldf}[polyglossia: module for lv (Latvian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-magyar.ldf}[polyglossia: module for Hungarian (Magyar)]
-
-% We only provide this gloss for babel compatibility.
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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}
-
-\@ifundefined{ifmalay@melayu}%
- {\newif\ifmalay@melayu}{}
-\malay@melayufalse
-\def\malay@variant{malay}
-
-\DeclareKeys[polyglossia/gloss/malay]
- {
- variant.choice:,
- variant / indonesian.code =
- {%
- \def\malay@variant{indonesian}%
- \malay@melayufalse
- \SetLanguageKeys{malay}{language=Indonesian,langtag=IND,babelname=bahasa,bcp47=id,bcp47-language=id}%
- \SetupLatinPolyglossiaFont{malay}%
- % Check if \l@indonesian is defined. If not, try to set it to some variety
- % (specific order as in the csv list), or null language if everything fails
- \TryPatternWithFallback{indonesian}{indon,bahasai,bahasam,malay,melayu,bahasa}%
- },
- variant / malaysian.code =
- {%
- \def\malay@variant{malay}%
- \malay@melayutrue
- \SetLanguageKeys{malay}{language=Malay,langtag=MLY,babelname=bahasam,bcp47=zsm,bcp47-language=zsm}%
- \SetupLatinPolyglossiaFont{malay}%
- % Check if \l@malay is defined. If not, try to set it to some variety
- % (specific order as in the csv list), or null language if everything fails
- \TryPatternWithFallback{malay}{melayu,bahasam,bahasai,indonesian,indon,bahasa}%
- },
- variant.default:n = malaysian,
- variant/unknown.code = \xpg@warning{Unknown malay variant `#1'},
- }
-
-% Register default options
-\InitializeGlossOptions{malay}{variant=malaysian}
-
-
-\def\malay@language{%
- \SetupPolyglossiaLangPatterns{\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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-% Translations provided by Abhijit Navale <abhi_navale@live.in>
-% Ordinals (1-100) added by Niranjan Tambe <niranjanvikastambe@gmail.com> on 14th December, 2019
-% 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
-
-\DeclareKeys[polyglossia/gloss/marathi]
- {
- numerals.choice:,
- numerals / western.code =
- {%
- \marathi@devanagari@numeralsfalse
- \SetLanguageKeys{marathi}{bcp47-extension-u=nu-latn}%
- },
- numerals / devanagari.code =
- {%
- \marathi@devanagari@numeralstrue
- \SetLanguageKeys{marathi}{bcp47-extension-u=nu-deva}%
- },
- numerals.default:n = devanagari,
- numerals/unknown.code = \xpg@warning{Unknown Marathi numerals value `#1'}
- }
-
-% Register default options
-\InitializeGlossOptions{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-medievallatin.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-medievallatin.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-medievallatin.ldf}[polyglossia: module for medieval Latin]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{latin}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-medievallatin.ldf>
-%<*gloss-mk.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-mk.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-mk.ldf}[polyglossia: module for mk (Macedonian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ml.ldf}[polyglossia: module for ml (Malayalam)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-mn.ldf}[polyglossia: module for mn (Mongolian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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
-
-\DeclareKeys[polyglossia/gloss/mongolian]
- {
- babelshorthands.if = mongolian@babelshorthands,
- babelshorthands.default:n = true,
- numerals.choice:,
- numerals / arabic.code =
- {%
- \cyrillic@numeralsfalse
- \cyrillic@asbuk@numeralsfalse
- },
- numerals / cyrillic.code =
- {%
- \cyrillic@numeralstrue
- \cyrillic@asbuk@numeralsfalse
- },
- numerals / cyrillic-trad.code =
- {%
- \cyrillic@numeralstrue
- \cyrillic@asbuk@numeralsfalse
- },
- numerals / cyrillic-alph.code =
- {%
- \cyrillic@numeralstrue
- \cyrillic@asbuk@numeralstrue
- },
- numerals.default:n = arabic,
- numerals/unknown.code = \xpg@warning{Unknown Mongolian numerals value `#1'}
- }
-
-% Register default options
-\InitializeGlossOptions{mongolian}{babelshorthands=false,numerals=arabic}
-
-\ifsystem@babelshorthands
- \SetGlossOptions{mongolian}{babelshorthands=true}
-\else
- \SetGlossOptions{mongolian}{babelshorthands=false}
-\fi
-
-\InitializeBabelShorthands
-
-\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{Хавсралт}%
- \@ifundefined{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-mr.ldf}[polyglossia: module for mr (Marathi)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-naustrian.ldf}[polyglossia: module for Austrian German (current spelling)]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-nb.ldf}[polyglossia: module for nb (Norwegian)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-newzealand.ldf}[polyglossia: module for Newzealand English]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ngerman.ldf}[polyglossia: module for German (current spelling)]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-norsk.ldf}[polyglossia: module for Norwegian (Bokmal)]
-
-% We only provide this gloss for babel compatibility. Since norsk is
-% actually norwegian bokmal, we use 'norwegian' with variant 'bokmal' now.
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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}
-
-\DeclareKeys[polyglossia/gloss/norwegian]
- {
- variant.choice:,
- variant / nynorsk.code =
- {%
- \def\norwegian@variant{nynorsk}%
- \SetLanguageKeys{norwegian}{langtag=NYN,babelname=nynorsk,bcp47=nn,bcp47-language=nn}%
- \SetupLatinPolyglossiaFont{norwegian}%
- },
- variant / bokmal.code =
- {%
- \def\norwegian@variant{norsk}%
- \SetLanguageKeys{norwegian}{langtag=NOR,babelname=norsk,bcp47=nb,bcp47-language=nb}%
- \SetupLatinPolyglossiaFont{norwegian}%
- },
- variant.default:n = nynorsk,
- variant/unknown.code = \xpg@warning{Unknown norwegian variant `#1'}
- }
-
-% Register default options
-\InitializeGlossOptions{norwegian}{variant=nynorsk}
-
-
-\def\norwegian@language{%
- \SetupPolyglossiaLangPatterns{\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-nswissgerman.ldf}[polyglossia: module for Swiss German (current spelling)]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-nynorsk.ldf}[polyglossia: module for Norwegian (Nynorsk)]
-
-% We only provide this gloss for babel compatibility. Since nynorsk is
-% a norwegian variety, we use 'norwegian' with variant 'nynorsk' now.
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-%%
-%% 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}
-
-\DeclareKeys[polyglossia/gloss/occitan]
- {
- babelshorthands.if = occitan@babelshorthands,
- babelshorthands.default:n = true
- }
-
-\ifsystem@babelshorthands
- \SetGlossOptions{occitan}{babelshorthands=true}
-\else
- \SetGlossOptions{occitan}{babelshorthands=false}
-\fi
-
-\InitializeBabelShorthands
-
-\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
-\AddToHook{begindocument/before}{% 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.2 -- 2024/07/15)
-%
-% 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
-\def\extras@odia{}
-\def\noextras@odia{}
-
-\DeclareKeys[polyglossia/gloss/odia]
- {
- changecounternumbering.if = odia@changecounternumbering,
- changecounternumbering.default:n = true,
- numerals.choice:,
- numerals / devanagari.code =
- {%
- \odia@odia@numeralsfalse
- \odia@devanagari@numeralstrue
- \SetLanguageKeys{odia}{bcp47=or,bcp47-language=or,bcp47-extension-u=nu-deva}%
- },
- numerals / odia.code =
- {%
- \odia@odia@numeralstrue
- \odia@devanagari@numeralsfalse
- },
- numerals / western.code =
- {%
- \odia@odia@numeralsfalse
- \odia@devanagari@numeralsfalse
- \SetLanguageKeys{odia}{bcp47=or,bcp47-language=or,bcp47-extension-u=nu-latn}%
- },
- numerals.default:n = devanagari,
- numerals/unknown.code = \xpg@warning{Unknown Odia numeral `#1'}
- }
-
-% Register default options
-\InitializeGlossOptions{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-odia.ldf}[polyglossia: module for or (Odia)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-pa.ldf}[polyglossia: module for pa (Punjabi)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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
-\newif\ifpersian@customsep\persian@customsepfalse
-\def\xpg@sepmark{}
-
-%TODO add option for CALENDAR
-
-\DeclareKeys[polyglossia/gloss/persian]
- {
- sectionsep.code = \gdef\xpg@sepmark{#1}\persian@customseptrue,
- sectionsep.default:n = .,
- abjadjimnotail.if = abjad@jim@notail,
- abjadjimnotail.default:n = true,
- locale.store = \@persian@locale,
- locale.default:n = default,
- numerals.choice:,
- numerals / eastern.code =
- {%
- \@western@numeralsfalse
- \SetLanguageKeys{persian}{bcp47-extension-u=nu-arab}%
- },
- numerals / western.code =
- {%
- \@western@numeralstrue
- \SetLanguageKeys{persian}{bcp47-extension-u=nu-latn}%
- },
- numerals.default:n = eastern,
- numerals/unknown.code = \xpg@warning{Unknown Persian numerals option `#1'}
- }
-
-% Register default options
-\InitializeGlossOptions{persian}{locale=default,numerals=eastern,abjadjimnotail=false}
-
-\def\farsigregmonth#1{\ifcase#1%
- \or ژانویه\or فوریه\or مارس\or آوریل\or مه\or ژوئن\or ژوئیه\or اوت\or سپتامبر\or اکتبر\or نوامبر\or دسامبر\fi}
-\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{%
- \ifcsname xpg@save@sepmark\endcsname%
- \SepMark{\xpg@save@sepmark}
- \fi%
-}
-
-\def\persian@luatex@capsformat{%
- %
- % change chapter and part headings
- \ifpersian@customsep
- \ifcsname chapter\endcsname%
- \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}
- \fi%
- \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{%
- \ifcsname xpg@save@thesection\endcsname%
- \let\thesection\xpg@save@thesection%
- \fi%
- \ifcsname xpg@save@theequation\endcsname%
- \let\theequation\xpg@save@theequation%
- \fi%
- \ifcsname xpg@save@thefigure\endcsname%
- \let\thefigure\xpg@save@thefigure%
- \fi%
- \ifcsname xpg@save@thetable\endcsname%
- \let\thetable\xpg@save@thetable%
- \fi%
- \ifcsname xpg@save@thesubsection\endcsname%
- \let\thesubsection\xpg@save@thesubsection%
- \ifcsname xpg@save@thesubsubsection\endcsname%
- \let\thesubsubsection\xpg@save@thesubsubsection%
- \fi%
- \fi%
- \ifcsname xpg@save@theparagraph\endcsname%
- \let\theparagraph\xpg@save@theparagraph%
- \fi%
- \ifcsname xpg@save@thesubparagraph\endcsname%
- \let\thesubparagraph\xpg@save@thesubparagraph%
- \fi%
-}
-
-\def\blockextras@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.2 -- 2024/07/15)
-%
-\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}
-
-\DeclareKeys[polyglossia/gloss/piedmontese]
- {
- babelshorthands.if = piedmontese@babelshorthands,
- babelshorthands.default:n = true
- }
-
-\ifsystem@babelshorthands
- \SetGlossOptions{piedmontese}{babelshorthands=true}
-\else
- \SetGlossOptions{piedmontese}{babelshorthands=false}
-\fi
-
-\InitializeBabelShorthands
-
-\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}}
-
-\AddToHook{begindocument/before}{%
- \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.2 -- 2024/07/15)
-%
-\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
-
-\DeclareKeys[polyglossia/gloss/polish]
- {
- babelshorthands.if = polish@babelshorthands,
- babelshorthands.default:n = true,
- splithyphens.if = polish@splithyphens,
- splithyphens.default:n = true,
- vlna.if = polish@vlna,
- vlna.default:n = true,
- }
-
-% Register default options
-\InitializeGlossOptions{polish}{babelshorthands=false,splithyphens=true,vlna=true}
-
-\ifsystem@babelshorthands
- \SetGlossOptions{polish}{babelshorthands=true}
-\else
- \SetGlossOptions{polish}{babelshorthands=false}
-\fi
-
-\InitializeBabelShorthands
-
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-polutonikogreek.ldf}[polyglossia: module for polytonic Greek]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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.
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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}
-
-\DeclareKeys[polyglossia/gloss/portuguese]
- {
- babelshorthands.if = portuguese@babelshorthands,
- babelshorthands.default:n = true,
- splithyphens.if = portuguese@splithyphens,
- splithyphens.default:n = true,
- variant.choice:,
- variant / portuguese.code =
- {%
- \def\portuguese@variant{portuges}%
- \SetLanguageKeys{portuguese}{babelname=portuges,bcp47=pt-PT,bcp47-language=pt,bcp47-region=PT}%
- },
- variant / brazilian.code =
- {%
- \def\portuguese@variant{brazil}%
- \SetLanguageKeys{portuguese}{babelname=brazil,bcp47=pt-BR,bcp47-language=pt,bcp47-region=BR}%
- % There are no specific brazil patterns
- \adddialect\l@brazil\l@portuges\relax
- },
- variant.default:n = portuguese,
- variant/unknown.code = \xpg@warning{Unknown portuguese variant `#1'},
- }
-
-% Register default options
-\InitializeGlossOptions{portuguese}{variant=portuguese,
- babelshorthands=false,
- splithyphens=true}
-
-\ifsystem@babelshorthands
- \SetGlossOptions{portuguese}{babelshorthands=true}
-\else
- \SetGlossOptions{portuguese}{babelshorthands=false}
-\fi
-
-\InitializeBabelShorthands
-
-\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{%
- \SetupPolyglossiaLangPatterns{\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.2 -- 2024/07/15)
-%
-% 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
- \SetupPolyglossiaLangPatterns{panjabi}%
-}
-
-\newif\ifpunjabi@gurmukhi@numerals
-\punjabi@gurmukhi@numeralstrue
-
-\DeclareKeys[polyglossia/gloss/punjabi]
- {
- numerals.choice:,
- numerals / gurmukhi.code =
- {%
- \punjabi@gurmukhi@numeralstrue
- \SetLanguageKeys{punjabi}{bcp47-extension-u=nu-guru}%
- },
- numerals / western.code =
- {%
- \punjabi@gurmukhi@numeralsfalse
- \SetLanguageKeys{punjabi}{bcp47-extension-u=nu-latn}%
- },
- numerals.default:n = gurmukhi,
- numerals/unknown.code = \xpg@warning{Unknown Punjabi numeral `#1'}
- }
-
-% Register default options
-\InitializeGlossOptions{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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\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
-
-\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
-
-\DeclareKeys[polyglossia/gloss/russian]
- {
- babelshorthands.if = russian@babelshorthands,
- babelshorthands.default:n = true,
- forceheadingpunctuation.if = russian@forceheadingpunctuation,
- forceheadingpunctuation.default:n = true,
- mathfunctions.if = russian@mathfunctions,
- mathfunctions.default:n = true,
- spelling.choice:,
- spelling / modern.code =
- {%
- \@russian@moderntrue
- \SetLanguageKeys{russian}{bcp47=ru,bcp47-variant=luna1918}%
- },
- spelling / old.code =
- {%
- \@russian@modernfalse
- \SetLanguageKeys{russian}{bcp47=ru-petr1708,bcp47-variant=petr1708}%
- },
- spelling.default:n = modern,
- numerals.choice:,
- numerals / arabic.code =
- {%
- \cyrillic@numeralsfalse
- \cyrillic@asbuk@numeralsfalse
- \SetLanguageKeys{russian}{bcp47-extension-u=nu-latn}%
- },
- numerals / cyrillic.code =
- {%
- \cyrillic@numeralstrue
- \cyrillic@asbuk@numeralsfalse
- \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
- },
- numerals / cyrillic-trad.code =
- {%
- \cyrillic@numeralstrue
- \cyrillic@asbuk@numeralsfalse
- \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
- },
- numerals / cyrillic-alph.code =
- {%
- \cyrillic@numeralstrue
- \cyrillic@asbuk@numeralstrue
- \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
- },
- numerals.default:n = arabic,
- numerals/unknown.code = \xpg@warning{Unknown Russian numerals value `#1'},
- indentfirst.choice:,
- indentfirst / true.code =
- {%
- \SetLanguageKeys{russian}{indentfirst=true}%
- },
- indentfirst / false.code =
- {%
- \SetLanguageKeys{russian}{indentfirst=false}%
- },
- indentfirst.default:n = true,
- }
-
-% Register default options
-\InitializeGlossOptions{russian}{babelshorthands=false,
- spelling=modern,
- numerals=arabic,
- indentfirst=true,
- forceheadingpunctuation=true,
- mathfunctions=true}
-
-
-\ifsystem@babelshorthands
- \SetGlossOptions{russian}{babelshorthands=true}
-\else
- \SetGlossOptions{russian}{babelshorthands=false}
-\fi
-
-\InitializeBabelShorthands
-
-\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{Приложение}%
- \@ifundefined{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{Приложеніе}%
- \@ifundefined{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.2 -- 2024/07/15)
-%
-\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}%
-% \SetupLatinPolyglossiaFont{sami}%
-% \or
-% % other:
-% \def\sami@variant{}%
-% \SetLanguageKeys{sami}{language= Sami,langtag=}%
-% \SetupLatinPolyglossiaFont{sami}%
-% \fi
-% \xpg@info{Option: sami, variant=\xpg@val}%
-%}{\xpg@warning{Unknown sami variant `#1'}}
-
-
-%\def\sami@language{%
-% \SetupPolyglossiaLangPatterns{\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-samin.ldf}[polyglossia: module for Northern Sami]
-
-% We only provide this gloss for babel compatibility. Since samin is
-% a sami variety, we use 'sami' with variant 'northern' now.
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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}
-
-\def\fontsetup@sanskrit@devanagari{%
- \SetLanguageKeys{sanskrit}{scripttag=deva,script=Devanagari,bcp47=sa-Deva,bcp47-language=sa,bcp47-script=Deva,bcp47-casing=sa-Deva}
- \SetupNonLatinPolyglossiaFont{sanskrit}}
-\def\fontsetup@sanskrit@gujarati{%
- \SetLanguageKeys{sanskrit}{scripttag=gujr,script=Gujarati,bcp47=sa-Gujr,bcp47-language=sa,bcp47-script=Gujr,bcp47-casing=sa-Gujr}
- \SetupNonLatinPolyglossiaFont{sanskrit}}
-\def\fontsetup@sanskrit@malayalam{%
- \SetLanguageKeys{sanskrit}{scripttag=mlym,script=Malayalam,bcp47=sa-Mlym,bcp47-language=sa,bcp47-script=Mlym,bcp47-casing=sa-Mlym}
- \SetupNonLatinPolyglossiaFont{sanskrit}}
-\def\fontsetup@sanskrit@bengali{%
- \SetLanguageKeys{sanskrit}{scripttag=beng,script=Bengali,bcp47=sa-Beng,bcp47-language=sa,bcp47-script=Beng,bcp47-casing=sa-Beng}
- \SetupNonLatinPolyglossiaFont{sanskrit}}
-\def\fontsetup@sanskrit@kannada{%
- \SetLanguageKeys{sanskrit}{scripttag=knda,script=Kannada,bcp47=sa-Knda,bcp47-language=sa,bcp47-script=Knda,bcp47-casing=sa-Knda}
- \SetupNonLatinPolyglossiaFont{sanskrit}}
-\def\fontsetup@sanskrit@telugu{%
- \SetLanguageKeys{sanskrit}{scripttag=telu,script=Telugu,bcp47=sa-Relu,bcp47-language=sa,bcp47-script=Relu,bcp47-casing=sa-Relu}
- \SetupNonLatinPolyglossiaFont{sanskrit}}
-\def\fontsetup@sanskrit@latin{%
- \SetLanguageKeys{sanskrit}{scripttag=latn,script=Latin,bcp47=sa-Latn,bcp47-language=sa,bcp47-script=Latn,bcp47-casing=sa-Latn}
- \SetupLatinPolyglossiaFont{sanskrit}}
-
-
-\newif\ifsanskrit@devanagari@numerals
-\sanskrit@devanagari@numeralstrue
-
-\DeclareKeys[polyglossia/gloss/sanskrit]
- {
- script.code = \@ifundefined{fontsetup@sanskrit@#1}%
- {\xpg@error{`#1' is not a valid script for Sanskrit}}%
- {\csname fontsetup@sanskrit@#1\endcsname},
- script.default:n = devanagari,
- numerals.choice:,
- numerals / devanagari.code =
- {%
- \sanskrit@devanagari@numeralstrue
- \SetLanguageKeys{sanskrit}{bcp47-extension-u=nu-deva}%
- },
- numerals / western.code =
- {%
- \sanskrit@devanagari@numeralsfalse
- \SetLanguageKeys{sanskrit}{bcp47-extension-u=nu-latn}%
- },
- numerals.default:n = devanagari,
- numerals/unknown.code = \xpg@warning{Unknown Sanskrit numeral `#1'}
- }
-
-% Register default options
-\InitializeGlossOptions{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-scottish.ldf}[polyglossia: module for Scottish Gaelic]
-
-% We only provide this gloss for babel compatibility. Since scottish is
-% a gaelic variety, we use 'gaelic' with variant 'scottish' now.
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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
-\newif\if@serbian@ijekavian
-
-\newif\ifcyrillic@numerals
-\newif\ifcyrillic@asbuk@numerals
-
-\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%
-}
-
-\DeclareKeys[polyglossia/gloss/serbian]
- {
- splithyphens.if = serbian@splithyphens,
- splithyphens.default:n = true,
- datei.if = serbian@datei,
- datei.default:n = true,
- variant.choice:,
- variant / ekavian.code =
- {%
- \@serbian@ijekavianfalse
- \serbian@set@languagekeys
- },
- variant / ijekavian.code =
- {%
- \@serbian@ijekaviantrue
- \serbian@set@languagekeys
- },
- variant.default:n = ekavian,
- variant/unknown.code = \xpg@warning{Unknown Serbian variant `#1'},
- script.choice:,
- script / cyrillic.code =
- {%
- \@serbian@cyrtrue
- \SetupNonLatinPolyglossiaFont{serbian}%
- \serbian@set@languagekeys
- },
- script / latin.code =
- {%
- \@serbian@cyrfalse
- \SetupLatinPolyglossiaFont{serbian}%
- %TODO \def\serbian@language{\language=\l@serbianlat}%
- % or should we use Croatian patterns as a fallback for the time being???
- \serbian@set@languagekeys
- },
- script.default:n = cyrillic,
- script/unknown.code = \xpg@warning{Unknown Serbian script `#1'},
- numerals.choice:,
- numerals / arabic.code =
- {%
- \cyrillic@numeralsfalse
- \cyrillic@asbuk@numeralsfalse
- \SetLanguageKeys{serbian}{bcp47-extension-u=nu-latn}%
- },
- numerals / cyrillic.code =
- {%
- \cyrillic@numeralstrue
- \cyrillic@asbuk@numeralsfalse
- \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
- },
- numerals / cyrillic-trad.code =
- {%
- \cyrillic@numeralstrue
- \cyrillic@asbuk@numeralsfalse
- \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
- },
- numerals / cyrillic-alph.code =
- {%
- \cyrillic@numeralstrue
- \cyrillic@asbuk@numeralstrue
- \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
- },
- numerals.default:n = arabic,
- numerals/unknown.code = \xpg@warning{Unknown Serbian numerals value `#1'}
- }
-
-\SetGlossOptions{serbian}{script,numerals}
-
-% Register default options
-\InitializeGlossOptions{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-serbianc.ldf}[polyglossia: module for Serbian (cyrillic)]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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
-
-\DeclareKeys[polyglossia/gloss/slovak]
- {
- babelshorthands.if = slovak@babelshorthands,
- babelshorthands.default:n = true,
- splithyphens.if = slovak@splithyphens,
- splithyphens.default:n = true,
- vlna.if = slovak@vlna,
- vlna.default:n = true,
- }
-
-% Register default options
-\InitializeGlossOptions{slovak}{babelshorthands=false,splithyphens=true,vlna=true}
-
-\ifsystem@babelshorthands
- \SetGlossOptions{slovak}{babelshorthands=true}
-\else
- \SetGlossOptions{slovak}{babelshorthands=false}
-\fi
-
-\InitializeBabelShorthands
-
-\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{Register}%
- \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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-slovene.ldf}[polyglossia: module for Slovenian]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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}
-
-\DeclareKeys[polyglossia/gloss/slovenian]
- {
- localalph.if = slovenian@localalph,
- localalph.default:n = true
- }
-
-% Register default options
-\InitializeGlossOptions{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.2 -- 2024/07/15)
-%
-\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}
-
-\DeclareKeys[polyglossia/gloss/sorbian]
- {
- olddate.if = sorbian@olddate,
- olddate.default:n = true,
- variant.choice:,
- variant / upper.code =
- {%
- \def\sorbian@variant{usorbian}%
- \SetLanguageKeys{sorbian}{language=Upper Sorbian,langtag=USB,babelname=uppersorbian,bcp47=hsb,bcp47-language=hsb}%
- \SetupLatinPolyglossiaFont{sorbian}%
- % Check if \l@usorbian is defined. If not, try to set it to some variety
- % (specific order as in the csv list), or null language if everything fails
- \TryPatternWithFallback{usorbian}{uppersorbian}%
- },
- variant / lower.code =
- {%
- \def\sorbian@variant{lsorbian}%
- \SetLanguageKeys{sorbian}{language=Lower Sorbian,langtag=LSB,babelname=lowersorbian,bcp47=dsb,bcp47-language=dsb}%
- \SetupLatinPolyglossiaFont{sorbian}%
- % Check if \l@lsorbian is defined. If not, try to set it to some variety
- % (specific order as in the csv list), or null language if everything fails
- \TryPatternWithFallback{lsorbian}{lowersorbian,Lsorbian,usorbian,uppersorbian}%
- },
- variant.default:n = upper,
- variant/unknown.code = \xpg@warning{Unknown sorbian variant `#1'}
- }
-
-% Register default options
-\InitializeGlossOptions{sorbian}{variant=upper,olddate=false}
-
-
-\def\sorbian@language{%
- \SetupPolyglossiaLangPatterns{\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.2 -- 2024/07/15)
-%
-\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
-
-% Localized math operators à la babel
-\newif\ifspanish@accentedoperators
-\newif\ifspanish@spacedoperators
-\newif\ifspanish@locoperators
-
-\DeclareKeys[polyglossia/gloss/spanish]
- {
- variant.choice:,
- variant / spanish.code =
- {%
- \@spanish@mexicofalse
- \SetLanguageKeys{spanish}{babelname=spanish,bcp47=es-ES,bcp47-region=ES}%
- },
- variant / mexican.code =
- {%
- \@spanish@mexicotrue
- \SetLanguageKeys{spanish}{babelname=spanishmx,bcp47=es-MX,bcp47-region=MX}%
- },
- variant.default:n = spanish,
- variant/unknown.code = \xpg@warning{Unknown spanish variant `#1'},
- spanishoperators.choice:,
- spanishoperators / all.code =
- {%
- \spanish@locoperatorstrue
- \spanish@accentedoperatorstrue
- \spanish@spacedoperatorstrue
- },
- spanishoperators / accented.code =
- {%
- \spanish@locoperatorsfalse
- \spanish@accentedoperatorstrue
- \spanish@spacedoperatorsfalse
- },
- spanishoperators / spaced.code =
- {%
- \spanish@locoperatorsfalse
- \spanish@accentedoperatorsfalse
- \spanish@spacedoperatorstrue
- },
- spanishoperators / none.code =
- {%
- \spanish@locoperatorsfalse
- \spanish@accentedoperatorsfalse
- \spanish@spacedoperatorsfalse
- },
- spanishoperators.default:n = all,
- spanishoperators/unknown.code = \xpg@warning{Unknown spanishoperators value `#1'}
- }
-
-% Register default options
-\InitializeGlossOptions{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-spanishmx.ldf}[polyglossia: module for Mexican Spanish]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-swissgerman.ldf}[polyglossia: module for Swiss German (old spelling)]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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
-\newif\ifsyriac@customsep\syriac@customsepfalse
-\def\xpg@sepmark{}
-
-\DeclareKeys[polyglossia/gloss/syriac]
- {
- sectionsep.code = \gdef\xpg@sepmark{#1}\syriac@customseptrue,
- sectionsep.default:n = .,
- numerals.choice:,
- numerals / eastern.code =
- {%
- \@eastern@numeralstrue
- \SetLanguageKeys{syriac}{bcp47-extension-u=nu-syrc}%
- },
- numerals / western.code =
- {%
- \@eastern@numeralsfalse
- \SetLanguageKeys{syriac}{bcp47-extension-u=nu-latn}%
- },
- numerals / abjad.code =
- {%
- \let\syriacnumber\abjadsyriac
- },
- numerals.default:n = eastern,
- numerals/unknown.code = \xpg@warning{Unknown Syriac numerals option `#1'}
- }
-
-% Register default options
-\InitializeGlossOptions{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}}
- \@ifundefined{arabicfont}%
- {\number#1%%% <---changed from \RL{\protect\reset@font\protect\number#1}%
- \xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs:
- since \string\arabicfont is not defined, we'll use Western numerals instead}}%
- {\@ensure@LTR{\protect\arabicdigits{\number#1}}%
- \xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs:
- I am using \string\arabicfont instead}}%
- }%
- \else
- %%\RL{\protect\reset@font\number#1}%
- \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{%
- \ifcsname xpg@save@sepmark\endcsname%
- \SepMark{\xpg@save@sepmark}
- \fi%
-}
-
-\def\syriac@luatex@capsformat{%
- %
- % change chapter and part headings
- \ifsyriac@customsep
- \ifcsname chapter\endcsname%
- \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}
- \fi%
- \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{%
- \ifcsname xpg@save@thesection\endcsname%
- \let\thesection\xpg@save@thesection%
- \fi%
- \ifcsname xpg@save@theequation\endcsname%
- \let\theequation\xpg@save@theequation%
- \fi%
- \ifcsname xpg@save@thefigure\endcsname%
- \let\thefigure\xpg@save@thefigure%
- \fi%
- \ifcsname xpg@save@thetable\endcsname%
- \let\thetable\xpg@save@thetable%
- \fi%
- \ifcsname xpg@save@thesubsection\endcsname%
- \let\thesubsection\xpg@save@thesubsection%
- \ifcsname xpg@save@thesubsubsection\endcsname%
- \let\thesubsubsection\xpg@save@thesubsubsection%
- \fi%
- \fi%
- \ifcsname xpg@save@theparagraph\endcsname%
- \let\theparagraph\xpg@save@theparagraph%
- \fi%
- \ifcsname xpg@save@thesubparagraph\endcsname%
- \let\thesubparagraph\xpg@save@thesubparagraph%
- \fi%
-}
-
-\def\blockextras@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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\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}
-
-\DeclareKeys[polyglossia/gloss/thai]
- {
- numerals.choice:,
- numerals / arabic.code =
- {%
- \@thai@numeralsfalse
- \SetLanguageKeys{thai}{bcp47-extension-u=nu-latn}%
- },
- numerals / thai.code =
- {%
- \@thai@numeralstrue
- \SetLanguageKeys{thai}{bcp47-extension-u=nu-thai}%
- },
- numerals.default:n = arabic,
- }
-
-% Register default options
-\InitializeGlossOptions{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.2 -- 2024/07/15)
-%
-\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
-\DeclareKeys[polyglossia/gloss/tibetan]
- {
- numerals.choice:,
- numerals/tibetan.code = \@tibetan@numeralstrue
- \SetLanguageKeys{tibetan}{bcp47-extension-u=nu-tibt},
- numerals/arabic.code = \@tibetan@numeralsfalse
- \SetLanguageKeys{tibetan}{bcp47-extension-u=nu-latn},
- numerals.default:n = tibetan
- }
-
-\ifluatex
- \newattribute\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
-\InitializeGlossOptions{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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-ug.ldf}[polyglossia: module for ug (Uyghur)]
-% BCP 47 tag for Uyghur
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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
-
-\DeclareKeys[polyglossia/gloss/ukrainian]
- {
- babelshorthands.if = ukrainian@babelshorthands,
- babelshorthands.default:n = true,
- mathfunctions.if = ukrainian@mathfunctions,
- mathfunctions.default:n = true,
- numerals.choice:,
- numerals / arabic.code =
- {%
- \cyrillic@numeralsfalse
- \cyrillic@asbuk@numeralsfalse
- \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-latn}%
- },
- numerals / cyrillic.code =
- {%
- \cyrillic@numeralstrue
- \cyrillic@asbuk@numeralsfalse
- \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
- },
- numerals / cyrillic-trad.code =
- {%
- \cyrillic@numeralstrue
- \cyrillic@asbuk@numeralsfalse
- \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
- },
- numerals / cyrillic-alph.code =
- {%
- \cyrillic@numeralstrue
- \cyrillic@asbuk@numeralstrue
- \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
- },
- numerals.default:n = arabic,
- numerals/unknown.code = \xpg@warning{Unknown Ukrainian numerals value `#1'}
- }
-
-% Register default options
-\InitializeGlossOptions{ukrainian}{numerals=arabic,mathfunctions=true}
-
-\ifsystem@babelshorthands
- \SetGlossOptions{ukrainian}{babelshorthands=true}
-\else
- \SetGlossOptions{ukrainian}{babelshorthands=false}
-\fi
-
-\InitializeBabelShorthands
-
-\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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-uppersorbian.ldf}[polyglossia: module for Upper Sorbian]
-
-% We provide this as a babel alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-%%% 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
-\newif\ifurdu@customsep\urdu@customsepfalse
-\def\xpg@sepmark{}
-\newif\if@hijrical
-
-\DeclareKeys[polyglossia/gloss/urdu]
- {
- abjadjimnotail.if = abjad@jim@notail,
- abjadjimnotail.default:n = true,
- sectionsep.code = \gdef\xpg@sepmark{#1}\urdu@customseptrue,
- sectionsep.default:n = .,
- hijricorrection.code = \gdef\urdu@hijri@correction{#1},
- hijricorrection.default:n = 0,
- calendar.choice:,
- calendar / gregorian.code =
- {%
- \@hijricalfalse
- },
- calendar / hijri.code =
- {%
- \@hijricaltrue
- },
- calendar.default:n = gregorian,
- calendar/unknown.code = \xpg@warning{Unknown Urdu calendar option `#1'},
- numerals.choice:,
- numerals / eastern.code =
- {%
- \@western@numeralsfalse
- \SetLanguageKeys{urdu}{bcp47-extension-u=nu-arab}%
- },
- numerals / western.code =
- {%
- \@western@numeralstrue
- \SetLanguageKeys{urdu}{bcp47-extension-u=nu-latn}%
- },
- numerals.default:n = eastern,
- numerals/unknown.code = \xpg@warning{Unknown Urdu numerals option `#1'}
- }
-
-% This should set the defaults
-\SetGlossOptions{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{%
- \ifcsname xpg@save@sepmark\endcsname%
- \SepMark{\xpg@save@sepmark}
- \fi%
-}
-
-\def\urdu@luatex@capsformat{%
- %
- % change chapter and part headings
- \ifurdu@customsep
- \ifcsname chapter\endcsname%
- \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}
- \fi%
- \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{%
- \ifcsname xpg@save@thesection\endcsname%
- \let\thesection\xpg@save@thesection%
- \fi%
- \ifcsname xpg@save@theequation\endcsname%
- \let\theequation\xpg@save@theequation%
- \fi%
- \ifcsname xpg@save@thefigure\endcsname%
- \let\thefigure\xpg@save@thefigure%
- \fi%
- \ifcsname xpg@save@thetable\endcsname%
- \let\thetable\xpg@save@thetable%
- \fi%
- \ifcsname xpg@save@thesubsection\endcsname%
- \let\thesubsection\xpg@save@thesubsection%
- \ifcsname xpg@save@thesubsubsection\endcsname%
- \let\thesubsubsection\xpg@save@thesubsubsection%
- \fi%
- \fi%
- \ifcsname xpg@save@theparagraph\endcsname%
- \let\theparagraph\xpg@save@theparagraph%
- \fi%
- \ifcsname xpg@save@thesubparagraph\endcsname%
- \let\thesubparagraph\xpg@save@thesubparagraph%
- \fi%
-}
-
-\def\blockextras@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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-usorbian.ldf}[polyglossia: module for Upper Sorbian]
-
-% We only provide this gloss for babel compatibility. Since usorbian is
-% a sorbian variety, we use 'sorbian' with variant 'upper' now.
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\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
-\newif\if@uyghur@ordchapter
-\newif\if@uyghur@romchapter
-
-\DeclareKeys[polyglossia/gloss/uyghur]
- {
- chapterformat.choice:,
- chapterformat / ordinal.code =
- {%
- \@uyghur@ordchaptertrue
- \@uyghur@romchapterfalse
- },
- chapterformat / roman.code =
- {%
- \@uyghur@ordchapterfalse
- \@uyghur@romchaptertrue
- },
- chapterformat / arabic.code =
- {%
- \@uyghur@ordchapterfalse
- \@uyghur@romchapterfalse
- },
- chapterformat.default:n = ordinal,
- chapterformat/unknown.code = \xpg@warning{Unknown Uyghur chapterformat value `#1'},
- swapstrings.choice:,
- swapstrings / all.code =
- {%
- \@uyghur@swapcaptionstrue
- \@uyghur@swapheadingstrue
- \@uyghur@swapheaderstrue
- },
- swapstrings / captions.code =
- {%
- \@uyghur@swapcaptionstrue
- \@uyghur@swapheadingsfalse
- \@uyghur@swapheadersfalse
- },
- swapstrings / headings.code =
- {%
- \@uyghur@swapcaptionsfalse
- \@uyghur@swapheadingstrue
- \@uyghur@swapheadersfalse
- },
- swapstrings / headers.code =
- {%
- \@uyghur@swapcaptionsfalse
- \@uyghur@swapheadingsfalse
- \@uyghur@swapheaderstrue
- },
- swapstrings / hheaders.code =
- {%
- \@uyghur@swapcaptionsfalse
- \@uyghur@swapheadingstrue
- \@uyghur@swapheaderstrue
- },
- swapstrings / none.code =
- {%
- \@uyghur@swapcaptionsfalse
- \@uyghur@swapheadingsfalse
- \@uyghur@swapheadersfalse
- },
- swapstrings.default:n = all,
- swapstrings/unknown.code = \xpg@warning{Unknown Uyghur swapstrings value `#1'}
- }
-
-% Register default options
-\InitializeGlossOptions{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
- \@ifundefined{titleformat}{%
- % With KOMA
- \@ifundefined{sectionformat}{%
- % With memoir
- \@ifundefined{@memptsize}{%
- % With standard classes
- \@ifundefined{@makechapterhead}{}{%
- \let\xpg@save@chap@format\@makechapterhead%
- \patchcmd{\@makechapterhead}%
- {\@chapapp\space \thechapter}%
- {\the@uyghur@chapter\space \@chapapp}%
- {}%
- {\xpg@warning{Failed to patch chapter for Uyghur}}%
- }%
- \@ifundefined{H@old@part}{% not hyperref
- \@ifundefined{@part}{}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\the@uyghur@part\nobreakspace\partname}%
- {}%
- {\@ifundefined{part}{}{\xpg@warning{Failed to patch part for Uyghur}}}%
- }% (end \ifdefined\@part)
- }{% Hyperref
- \let\xpg@save@part@format\H@old@part%
- \patchcmd{\H@old@part}%
- {\partname\nobreakspace\thepart}%
- {\the@uyghur@part\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for Uyghur}}%
- }% (end not hyperref)
- }{% (\ifdefined\@memptsize)
- \@ifundefined{@makechapterhead}{}{%
- \let\xpg@save@chap@format\@makechapterhead%
- \patchcmd{\@makechapterhead}{\printchaptername \chapternamenum \printchapternum}%
- {\chapnumfont\the@uyghur@chapter\chapternamenum\printchaptername}%
- {}%
- {\xpg@warning{Failed to patch chapter for Uyghur}}%
- }%
- \@ifundefined{H@old@part}{% not hyperref
- \@ifundefined{@part}{}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
- {\chapnumfont\the@uyghur@part\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for Uyghur}}%
- }%
- }{% Hyperref
- \let\xpg@save@part@format\H@old@part%
- \patchcmd{\H@old@part}{\printpartname \partnamenum \printpartnum}%
- {\chapnumfont\the@uyghur@part\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for Uyghur}}%
- }%
- }% (end \ifdefined\@memptsize)
- }{% (\ifdefined\sectionformat)
- \@ifundefined{partformat}{}{%
- \let\xpg@save@part@format\partformat%
- \renewcommand{\partformat}{\the@uyghur@part~\partname}%
- }%
- \@ifundefined{chapterformat}{}{%
- \let\xpg@save@chap@format\chapterformat%
- \renewcommand{\chapterformat}{\mbox{\the@uyghur@chapter%
- \IfUsePrefixLine{\nobreakspace\chapapp}{\enskip}}}%
- }%
- }% (end \ifdefined\sectionformat)
- }{% (\ifdefined\titleformat)
- \@ifundefined{H@old@part}{% not hyperref
- \@ifundefined{@part}{}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\the@uyghur@part\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for Uyghur}}%
- }%
- }{% Hyperref
- \let\xpg@save@part@format\H@old@part%
- \patchcmd{\H@old@part}%
- {\partname\nobreakspace\thepart}%
- {\the@uyghur@part\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for Uyghur}}%
- }%
- \@ifundefined{chapter}{}{%
- \titleformat\chapter[display]%
- {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
- {\the@uyghur@chapter\space\@chapapp}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
- }%
- }% (end \ifdefined\titleformat)
- \fi% (end \if@uyghur@swapheadings)
- %
- % Change running headers
- \if@uyghur@swapheaders
- \@ifundefined{chapterformat}{%
- \@ifundefined{@memptsize}{%
- % With standard classes
- \@ifundefined{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)
- \@ifundefined{sectionmark}{}{%
- \ifpatchable{\sectionmark}%
- {\thesection.}%
- {\let\xpg@save@sectionmark@format\sectionmark%
- \patchcmd{\sectionmark}%
- {\thesection.}%
- {\thesection}%
- {}%
- {\xpg@warning{Failed to patch sectionmark for Uyghur}}%
- }%
- {}%
- }% (end \ifdefined\chaptermark)
- }{% (\ifdefined\@memptsize)
- % With memoir
- \let\xpg@save@chaptermark@format\chaptermark%
- \renewcommand*\chaptermark[1]{%
- \markboth{\memUChead{%
- \ifnum \c@secnumdepth >\m@ne
- \ifbool{@mainmatter}{%
- \the@uyghur@chapter\ \@chapapp\ %
- }{}%
- \fi
- ##1}}{}}%
- }% (end \ifdefined\@memptsize)
- }{% (\ifdefined\chapterformat)
- % With KOMA
- \let\xpg@save@chaptermark@format\chaptermarkformat%
- \renewcommand*\chaptermarkformat{%
- \the@uyghur@chapter\ \IfChapterUsesPrefixLine{\chapapp\enskip}{}}
- }% (end \ifdefined\chapterformat)
- \fi% (end \if@uyghur@swapheaders)
-}
-
-\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
- \@ifundefined{titleformat}{%
- \@ifundefined{sectionformat}{%
- % With memoir and standard classes
- \@ifundefined{xpg@save@part@format}{}{%
- \@ifundefined{H@old@part}{%
- \let\@part\xpg@save@part@format%
- }{%
- \let\H@old@part\xpg@save@part@format%
- }%
- }%
- \@ifundefined{xpg@save@chap@format}{}{%
- \let\@makechapterhead\xpg@save@chap@format
- }%
- }{%
- % With KOMA
- \@ifundefined{xpg@save@part@format}{}{%
- \let\partformat\xpg@save@part@format
- }%
- \@ifundefined{xpg@save@chap@format}{}{%
- \let\chapterformat\xpg@save@chap@format
- }%
- }% (end \ifdefined\sectionformat)
- }{% (\ifdefined\titleformat)
- % With titlesec
- \@ifundefined{xpg@save@part@format}{}{%
- \@ifundefined{H@old@part}{%
- \let\@part\xpg@save@part@format%
- }{%
- \let\H@old@part\xpg@save@part@format%
- }%
- }%
- \@ifundefined{chapter}{}{%
- \titleformat\chapter[display]%
- {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
- {\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
- }%
- }% (end \ifdefined\titleformat)
- %
- % Reset headers
- \@ifundefined{chaptermarkformat}{%
- \@ifundefined{chaptermark}{}{%
- % With memoir and standard classes
- \@ifundefined{xpg@save@chaptermark@format}{}{%
- \let\chaptermark\xpg@save@chaptermark@format%
- }%
- }% (end \ifdefined\chaptermark)
- \@ifundefined{sectionmark}{}{%
- \@ifundefined{xpg@save@sectionmark@format}{}{%
- \let\sectionmark\xpg@save@sectionmark@format%
- }%
- }% (end \ifdefined\sectionmark)
- }{%
- % With KOMA
- \@ifundefined{xpg@save@chaptermark@format}{}{%
- \let\chaptermarkformat\xpg@save@chaptermark@format%
- }%
- }% (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{%
- \@ifundefined{part}{}{%
- \if@uyghur@ordchapter%
- \renewcommand{\the@uyghur@part}{\uyghurord{part}}%
- \fi%
- \if@uyghur@romchapter%
- \renewcommand{\the@uyghur@part}{\Roman{part}}%
- \fi%
- }%
- \@ifundefined{chapter}{}{%
- \if@uyghur@ordchapter%
- \renewcommand{\the@uyghur@chapter}{\uyghurord{chapter}}%
- \fi%
- \if@uyghur@romchapter%
- \renewcommand{\the@uyghur@chapter}{\Roman{chapter}}%
- \fi%
- }%
-}
-
-\def\uyghur@numbers{%
- % 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.2 -- 2024/07/15)
-%
-\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.2 -- 2024/07/15)
-%
-\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}
-
-\@ifundefined{ifwelsh@formaldate}%
- {\newif\ifwelsh@formaldate}{}
-
-\DeclareKeys[polyglossia/gloss/welsh]
- {
- date.choice:,
- date / long.code =
- {%
- \welsh@formaldatetrue
- },
- date / short.code =
- {%
- \welsh@formaldatefalse
- },
- date.default:n = short,
- date/unknown.code = \xpg@warning{Unknown date value `#1'},
- }
-
-% Register default options
-\InitializeGlossOptions{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-zh-CN.ldf}[polyglossia: module for zh-CN (Chinese)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{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.2 -- 2024/07/15)
-%
-\ProvidesFile{gloss-zh-TW.ldf}[polyglossia: module for zh-TW (Chinese)]
-
-% We provide this as a bcp47-compliant alias
-
-\InheritGlossFile{chinese}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-zh-TW.ldf>
-%<*polyglossia-cjk-spacing.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-cjk-spacing.lua}
-% \begin{macrocode}
---
--- polyglossia-cjk-spacing.lua
--- part of polyglossia v2.2 -- 2024/07/15
---
-
-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 whatsit_id = node.id"whatsit"
-local math_id = node.id"math"
-
---
--- attr_cjk: variant = plain: 0, JP/classic: 1, KR/modern: 2, SC: 3, TC: 4
---
-local attr_cjk = luatexbase.attributes["xpg@attr@cjkspacing"]
---
--- attr_josa: ONLY For Korean. DO NOT declare \newattribute for other langs
---
-local attr_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 plus combinings
--- 3: kana small letters
--- 0: dashes (suppress visible spacing after this char)
---
-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] = 1, -- : 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] = 0, -- ― HORIZONTAL BAR
- [0x2019] = 1, -- ’ RIGHT SINGLE QUOTATION MARK
- [0x201D] = 1, -- ” RIGHT DOUBLE QUOTATION MARK
- [0x2025] = 0, -- ‥ TWO DOT LEADER
- [0x2026] = 0, -- … 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] = 2, -- COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK
- [0x309A] = 2, -- COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
- [0x309B] = 2, -- ゛ KATAKANA-HIRAGANA VOICED SOUND MARK
- [0x309C] = 2, -- ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
- [0x309D] = 1, -- ゝ HIRAGANA ITERATION MARK
- [0x309E] = 1, -- ゞ HIRAGANA VOICED ITERATION MARK
- [0x30A0] = 1, -- ゠ KATAKANA-HIRAGANA DOUBLE HYPHEN
- [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] = 0, -- ︰ PRESENTATION FORM FOR VERTICAL TWO DOT LEADER
- [0xFE31] = 0, -- ︱ PRESENTATION FORM FOR VERTICAL EM DASH
- [0xFE32] = 0, -- ︲ PRESENTATION FORM FOR VERTICAL EN DASH
- [0xFE36] = 1, -- ︶ PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS
- [0xFE38] = 1, -- ︸ PRESENTATION FORM FOR VERTICAL RIGHT CURLY BRACKET
- [0xFE3A] = 1, -- ︺ PRESENTATION FORM FOR VERTICAL RIGHT TORTOISE SHELL BRACKET
- [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] = 2, -- ゙ HALFWIDTH KATAKANA VOICED SOUND MARK
- [0xFF9F] = 2, -- ゚ HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
-}, { __index = function(_,c)
- if c >= 0x1160 and c <= 0x11FF then return 2 end
- if c >= 0xD7B0 and c <= 0xD7FF then return 2 end
- if c >= 0x302A and c <= 0x302F then return 2 end -- tone marks
- if c >= 0x31F0 and c <= 0x31FF then return 3 end
- if c >= 0xFF67 and c <= 0xFF70 then return 3 end
- if c >= 0xFE00 and c <= 0xFE0F then return 2 end -- variation selectors
- if c >= 0xFE10 and c <= 0xFE19 and not (c == 0xFE17) then return 1 end
- if c >= 0xFE50 and c <= 0xFE58 then return 1 end
- if c >= 0xE0100 and c <= 0xE01EF then return 2 end -- variation selecters
- 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 c >= 0x30000 and c <= 0x323AF
- 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 })
-
---
--- get character class
--- var : variant = plain, JP/classic, KR/modern, SC, TC
--- c : codepoint
---
-local function get_charclass (var, c)
- if var < 3 then
- return charclass[c]
- elseif var == 3 then
- -- SC : these are left aligned
- return (c == 0xFF01 or c == 0xFF1F) and 4 -- FULLWIDTH EXCLAMATION/QUESTION MARK
- or (c == 0xFF1A or c == 0xFF1B) and 2 -- FULLWIDTH COLON/SEMICOLON
- or charclass[c]
- end
- -- TC : these are center aligned
- return (c == 0x3001 or c == 0xFF0C) and 3 -- IDEOGRAPHIC/FULLWIDTH COMMA
- or (c == 0x3002 or c == 0xFF0E) and 3 -- IDEOGRAPHIC/FULLWIDTH FULL STOP -- 5 ?
- or charclass[c]
-end
-
---
--- table for spacing between char classes
--- 1 stands for 0.5*fontsize when variant = JP/classic or SC or TC
---
-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=KR/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 ~= plain
---
-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, JP/classic, KR/modern, SC, TC
--- 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, JP/classic, KR/modern, SC, TC
--- nobr: no linebreak
--- x: true between cjk and non-cjk (a little more spacing)
---
-local function insert_penalty_glue (head, curr, f, var, nobr, x)
- if nobr then
- local penalty = get_new_penalty(10000)
- head, curr = node.insert_after(head, curr, penalty)
- elseif var == 0 or var == 2 then
- local penalty = get_new_penalty(50)
- head, curr = node.insert_after(head, curr, penalty)
- end
- 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
---
-local function cjk_break (head)
- local curr = head
- while curr do
- if attr_cjk and (curr.id == glyph_id or curr.id == math_id and curr.subtype == 1) then
- local var = node.has_attribute(curr, attr_cjk)
- if var then
- local c, f = curr.char or 0, curr.font
- local cc, cjkc = get_charclass(var, c), is_cjk(c)
-
- -- compress cjk punctuations when charclass is 1 thru 4
- if var > 0 and cc > 0 and cc < 5 then
- head, curr = glyph_to_box(head, curr, cc)
- end
-
- local next = node.getnext(curr)
- while next and next.id == whatsit_id do -- skip whatsit nodes
- curr, next = next, node.getnext(next)
- end
-
- if next and (next.id == glyph_id or next.id == math_id and next.subtype == 0) then
- local n = next.char or 0
- f = f or next.font or 0 -- in case of curr == math_off
-
- -- skip combining. or dash+dash case to suppress stretching
- if nobr_before[n] == 2 or (nobr_before[c] == 0 and nobr_before[n] == 0) then
- goto skip_combining
- end
-
- local nc = get_charclass(var, n)
- local nobr = nobr_before[n] or nobr_after[c]
-
- -- insert spacing as of intercharclass
- if var > 0 and intercharclass[cc][nc] then
- head, curr = insert_cjk_penalty_glue(head, curr, f, var, cc, nc, nobr)
-
- else
- local cjkn = is_cjk(n)
-
- -- if curr or next is cjk char
- if cjkc or cjkn then
-
- -- plain variant / cjk+cjk / nobr cjk+noncjk / after dash
- -- : insert a 0pt glue
- if var == 0 or (cjkc and cjkn) or nobr or nobr_before[c] == 0 then
- head, curr = insert_penalty_glue(head, curr, f, var, nobr)
-
- -- other cases: insert a small glue
- else
- head, curr = insert_penalty_glue(head, curr, f, var, nobr, true)
- end
- end
- end
- end
- end
- end
- ::skip_combining::
- curr = node.getnext(curr)
- 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_cjk) then
- local f = font.getfont(curr.font) or font.fonts[curr.font]
- if f and f.hb then -- harfbuzz do the right thing
- tone = nil
- 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 = node.getprev(curr)
- 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 = node.getprev(p)
- 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(node.getprev(curr)) or 0x30]
- end
- if cc == 0xC774 then
- local n = node.getnext(curr)
- 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 = node.getnext(curr)
- 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.
---
-luatexbase.add_to_callback( "pre_shaping_filter",
-function(head)
- if attr_josa then head = auto_josa(head) end
- head = cjk_break(head)
- if attr_josa then head = reorder_tm(head) end
- return head
-end,
-"polyglossia.lang_cjk_spacing")
-
--- vim:ft=lua:tw=0:sw=4:ts=4:expandtab
-% \end{macrocode}
-% \iffalse
-%</polyglossia-cjk-spacing.lua>
-%<*polyglossia-french.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-french.lua}
-% \begin{macrocode}
---
--- polyglossia-punct.lua
--- part of polyglossia v2.2 -- 2024/07/15
---
-
-require('polyglossia-punct')
-
-local function set_left_space(lang, char, kern, rubber)
- polyglossia.add_left_spaced_character(lang, char, kern, "space", rubber)
-end
-
-local function set_right_space(lang, char, kern, rubber)
- polyglossia.add_right_spaced_character(lang, char, kern, "space", rubber)
-end
-
-local function activate_french_punct(thincolonspace, autospaceguillemets)
- -- We need different language tags here to make switching of options possible
- -- within a paragraph.
- local lang = "french"
- if thincolonspace then
- lang = lang.."-thincolon"
- end
- 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-latin.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-latin.lua}
-% \begin{macrocode}
---
--- polyglossia-latin.lua
--- part of polyglossia v2.2 -- 2024/07/15
---
-
-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.2 -- 2024/07/15
---
-
-require('polyglossia') -- just in case...
-
-local add_to_callback = luatexbase.add_to_callback
-local declare_callback_rule = luatexbase.declare_callback_rule
-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)
-end
-
-add_to_callback("pre_linebreak_filter",process,"polyglossia-punct.process")
-add_to_callback("hpack_filter",process,"polyglossia-punct.process")
-declare_callback_rule("pre_linebreak_filter",
- "polyglossia-punct.process", "before", "luaotfload.node_processor")
-declare_callback_rule("hpack_filter",
- "polyglossia-punct.process", "before", "luaotfload.node_processor")
-
-
-local function deactivate()
- tex.setattribute(punct_attr, -0x7FFFFFFF) -- this value means "unset"
- -- Though it would make compilation slightly faster, it is not possible to
- -- 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.2 -- 2024/07/15
---
-
-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.2 -- 2024/07/15
---
-
-require('polyglossia') -- just in case...
-
-local add_to_callback = luatexbase.add_to_callback
-local remove_from_callback = luatexbase.remove_from_callback
-local declare_callback_rule = luatexbase.declare_callback_rule
-local priority_in_callback = luatexbase.priority_in_callback
-
-local next, type = next, type
-local node = node
-
-local insert_node_before = node.insert_before
-local insert_node_after = node.insert_after
-local remove_node = node.remove
-local copy_node = node.copy
-local has_attribute = node.has_attribute
-
-local end_of_math = node.end_of_math
-if not end_of_math then -- luatex < .76
- local traverse_nodes = node.traverse_id
- local math_code = node.id('math_char')
- 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 2024
-local glyph_code = node.id('glyph')
-local penalty_code = node.id('penalty')
-local kern_code = node.id('kern')
-
--- we make a new node, so that we can copy it later on
-local penalty_node = node.new(penalty_code)
-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
- 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()
- add_to_callback(callback_name, process, "polyglossia-tibt.process")
- declare_callback_rule(callback_name,
- "polyglossia-tibt.process", "before", "luaotfload.node_processor")
-end
-
-local function desactivate()
- remove_from_callback(callback_name, "polyglossia-tibt.process")
-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.2 -- 2024/07/15
---
-
-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 = { }
- 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
- local a = {}
- for _,n in pairs(s) do table.insert(a, n) end
- table.sort(a)
- log_info("Language data for " .. langentry .. "\n" .. table.concat(a,"\n"))
-
- --
- -- LaTeX's \newlanguage increases language register (count19),
- -- 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.
- --
- -- Therefore here we will compare LaTeX's \newlanguage number with
- -- LuaTeX's lang.new() id and select the bigger one for our new
- -- language object. Also we will update LaTeX's language register
- -- by this new id, so that another possible \newlanguage should not
- -- 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 needed
- 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}[%
- UprightFont = *-Regular,
- BoldFont = *-Bold,
- Extension = .ttf,
- ItalicFont = *-Italic,
- BoldItalicFont = *-BoldItalic]
-\newfontfamily\syriacfont[Script=Syriac]{Serto Jerusalem}
-\newfontfamily\hebrewfont[Script=Hebrew]{Ezra SIL}
-\newfontfamily\sanskritfont[Script=Devanagari]{Sanskrit 2003}
-\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}[%
- UprightFont = *-Regular,
- BoldFont = *-Bold,
- Extension = .ttf,
- ItalicFont = *-Italic,
- BoldItalicFont = *-BoldItalic]
-\newfontfamily\arabicfonttt[Script=Arabic,Scale=.75]{DejaVu Sans Mono}
-\newfontfamily\farsifont[Script=Arabic,Scale=1.1,WordSpace=2]{IranNastaliq}
-\let\XeTeX\undefined
-\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\space all *.sty, *.lua, *.def and *.ldf files}
-% \typeout{*}
-% \typeout{* You also need to compile the *.map files with teckit_compile}
-% \typeout{* and place the resulting *.tec files under}
-% \typeout{* .../fonts/misc/xetex/fontmapping}
-% \typeout{*}
-% \typeout{*************************************************************}
-\endinput
diff --git a/Master/texmf-dist/source/latex/reptheorem/reptheorem.dtx b/Master/texmf-dist/source/latex/reptheorem/reptheorem.dtx
index d96f740fecb..47a94923227 100644
--- a/Master/texmf-dist/source/latex/reptheorem/reptheorem.dtx
+++ b/Master/texmf-dist/source/latex/reptheorem/reptheorem.dtx
@@ -3,7 +3,7 @@
% Copyright (c) 2024- Jesse Straat
%
% 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
@@ -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-10-07 v1.3}
\Msg{************************************************************************}
\keepsilent
@@ -100,7 +100,7 @@ License: [LPPL1.3c](https://www.latex-project.org/lppl.txt)
Copyright (c) 2024- Jesse Straat
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
@@ -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
-%
-%\changes{v1.0}{2024-03-27}{First public release}
-%
-%
-%
+%^^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-10-07 v1.3 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,100 @@ 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.}
+% \changes{v1.3}{2024/10/07}{Added hyperref named destination compatibility by setting counter to very low value}
+% \changes{v1.3}{2024/10/07}{Changed thetheorem to csname to fix compatibility with theorem types not called ``theorem''.}
% 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}}
+ \setcounter{\@@thmtype}{-900}
+ \expandafter\def\csname the\@@thmtype\endcsname{\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..a13a70f683a 100644
--- a/Master/texmf-dist/source/latex/reptheorem/reptheorem.ins
+++ b/Master/texmf-dist/source/latex/reptheorem/reptheorem.ins
@@ -9,7 +9,7 @@
%% Copyright (c) 2024- Jesse Straat
%%
%% 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,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-10-07 v1.3}
\Msg{************************************************************************}
\keepsilent
@@ -38,7 +38,7 @@
Copyright (c) 2024- Jesse Straat
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
@@ -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 b597e876ffe..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-07-31} {4.3.1}
+\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 0d33b812286..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-07-31} {4.3.1}
+\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 ed6cdd7ebf5..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-07-31} {4.3.1}
+\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 d0c787bf2a0..6129c3e6d65 100644
--- a/Master/texmf-dist/source/latex/se2thesis/se2thesis.dtx
+++ b/Master/texmf-dist/source/latex/se2thesis/se2thesis.dtx
@@ -570,7 +570,7 @@
% \end{verbatim}
%
% Note that by default, \LaTeX{} does not provide hyphenation for compound
-% words, which is explained in the \TeX{} Book~\cite[p.~454]{TODO} and a
+% 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
@@ -654,7 +654,7 @@
%
% Identify the class and give the overall version number.
% \begin{macrocode}
-\ProvidesExplClass {se2thesis} {2024-07-31} {4.3.1}
+\ProvidesExplClass {se2thesis} {2024-09-19} {4.3.4}
{A thesis class for the Chair of Software Engineering II}
% \end{macrocode}
%
@@ -1171,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}
@@ -1409,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 }
@@ -1725,7 +1730,7 @@
% We provide the following English translations.
%
% \begin{macrocode}
-\ProvideDictionaryFor{English}{se2translations}[2024/07/31]
+\ProvideDictionaryFor{English}{se2translations}[2024/09/19]
\ProvideDictTranslation{abstract}{abstract}
\ProvideDictTranslation{Abstract}{Abstract}
\ProvideDictTranslation{acknowledgement}{acknowledgement}
@@ -1776,7 +1781,7 @@
% We provide the following German translations.
%
% \begin{macrocode}
-\ProvideDictionaryFor{German}{se2translations}[2024/07/31]
+\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/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 4a7e2eb7057..0cc22455590 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
+++ b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
@@ -4757,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 03fe45441ed..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
@@ -365,9 +355,9 @@
{
\unskip { \@@_collect_loop: }
\textonly@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 }
@@ -394,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 }
@@ -425,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 054d525a88b..11bce0caf98 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
+++ b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
@@ -124,7 +124,7 @@
%
% Identify the package and give the over all version information.
% \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2024-08-01} {3.3.20}
+\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 3c0231e5b4f..90189978b12 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx.tex
+++ b/Master/texmf-dist/source/latex/siunitx/siunitx.tex
@@ -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/spelatex/spelatex.dtx b/Master/texmf-dist/source/latex/spelatex/spelatex.dtx
index bdedc84d70b..564abba5a2c 100644
--- a/Master/texmf-dist/source/latex/spelatex/spelatex.dtx
+++ b/Master/texmf-dist/source/latex/spelatex/spelatex.dtx
@@ -20,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
@@ -33,17 +32,20 @@
\ProvidesFile{spelatex.dtx}
%</driver>
%<*package>
- [2024/06/21 v0.91 SpeLaTeX - Speech-enabled LaTeX (DMW and LVP)]
+ [2024/09/09 v0.92 SpeLaTeX - Speech-enabled LaTeX (DMW and LVP)]
%</package>
-\def\fileversion{0.91}
-\def\filedate{2024/06/21}
+\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}}{}
@@ -83,6 +85,11 @@
% - 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}
%
@@ -111,41 +118,49 @@
% \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}
%
% \subsection{Background}
%
-% \begin{spelchunk}
+% \<<<{
% At our institute, the University of Antwerp in Belgium, the number
% of students with reading and/or writing disorders (or at least
% 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}
+% }
%
% \subsection{State of the art}
%
% \subsubsection{In general}
%
-% \begin{spelchunk}
+% \<<<{
% Therefore, reverting to readily available text-to-speech software
% is an obvious choice. Nowadays, special software exists that
% provides the functionality of reading out loud the contents of
@@ -158,40 +173,40 @@
% loaded with non-trivial mathematics, the standard text-to-speech
% packages fail to meet our expectations. In addition, they cannot
% read a sensible textual description of figures or tables.
-% \end{spelchunk}
+% }
%
-% \begin{spelchunk}
+% \<<<{
% The issue with reading mathematics will be solved in the future,
% by enforcing mathematical equations to follow a specific standard
% that can be parsed and converted, not only into a visual
% representation, but also into proper text. MathML will be one of
% the candidates for that format.
-% \end{spelchunk}
+% }
%
-% \begin{spelchunk}
+% \<<<{
% The issue with figures and tables can be solved by using the tag
% infrastructure of PDF. The format provides a system of tags that
% allow you to provide extra information about the content of a
% document, in much the same way as you can specify an 'alt' key for
% an image in HTML. This tag could contain a proper textual
% description of the figure or the table.
-% \end{spelchunk}
+% }
%
% \subsubsection{For \LaTeX}
%
-% \begin{spelchunk}
-% Currently, the \LaTeX project is investing in enabling \LaTeX{} to
+% \<<<{
+% Currently, the \LaTeX{} project is investing in enabling \LaTeX{} to
% partially automate the tagging of PDFs with the \texttt{tagpdf}
% package~\cite{TAGPDF}, such that the user only has to do a minimal
% job (adding tags for figures and tables). The goal is to maximize
% the accessibility of \LaTeX-produced documents.
-% \end{spelchunk}
+% }
%
-% \begin{spelchunk}
-% So all is well? Not quite. Though I'm confident that with enough
-% time the community will solve the issue completely, there are
+% \<<<{
+% 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:
-% \end{spelchunk}
+% }
% \begin{itemize}
% \spelitem{The tagpdf package is still not a part of the mainstream
% \LaTeX{}-kernel.}
@@ -202,13 +217,13 @@
%
% \subsection{This package}
%
-% \begin{spelchunk}
+% \<<<{
% This package aims to overcome these problems in the meantime and
% also to contribute to the longterm goal: making perfectly tagged
% PDFs that are read by any PDF-reader.
-% \end{spelchunk}
+% }
%
-% \begin{spelchunk}
+% \<<<{
% In the \emph{first phase} of this package (i.e. the version you are
% looking at right now), this package reads your \LaTeX{} source,
% converts the text and the formulas to audio files and equips your
@@ -217,58 +232,49 @@
% The audio files are external files that should be packaged with
% your PDF to allow a reader to use the document with the available
% audio.
-% How does it read the formulas? It parses your \LaTeX{} constructs and
+% 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.
-% \end{spelchunk}
+% }
%
-% \begin{spelchunk}
+% \<<<{
% In a \emph{second phase} of this package, the audio files will be embedded
% into the PDF. Currently, there are not enough PDF readers that
% support this feature. Therefore, we decided to keep using the
% external audio files for now.
-% \end{spelchunk}
+% }
%
-% \begin{spelchunk}
+% \<<<{
% In a \emph{third phase}, the audio files \emph{may be} abandoned
% alltogether, fully switching to tags. And we do think that this
% should be the end goal. The reasons why we say
% \emph{'may be'}, are:
-% \end{spelchunk}
+% }
% \begin{itemize}
% \spelitem{The voices of the current PDF-readers are still not of the
% same quality as the ones available online. And quality does matter.}
% \spelitem{The better voices may require cloud access, and probably
-% will not be free, therefore (me) paying for them at document creation
-% time, makes more sense to me than having my students pay
+% 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. In addition, Walter feels miserable when
-% he's forced to use anything else than GNU/Linux, because then he
-% keeps moaning that his productivity is ruined.}
+% rather than a nice-to-have.}
% \end{itemize}
%
-% \begin{spelchunk}
-% Admittedly, in this first phase, using the \spelatex{} package
-% causes a significant overhead in writing your text. Therefore we
-% also provide you the \spelbox{} extension for the Org-mode
-% \cite{ORGMODE} of \GNU{} Emacs \cite{EMACS}. To satisfy your
-% curiosity: \spelbox{} stands for ``Speech-Enabled \LaTeX{} By
-% Org-mode eXport''.
-% \end{spelchunk}
-%
-% \begin{spelchunk}
+% \<<<{
% Will \spelatex{} become obsolete in the future?
% Undoubtedly so. But for the time being, it answers our desire to
% provide our students with good audio support when studying their
% engineering courses. That is now, not only in five years time.
-% \end{spelchunk}
+% }
-% \begin{spelchunk}
+% \<<<{
% We hope that you enjoy
% using our software, or that --- if you are not pleased with it ---
% it triggers you to give us feedback or to come up with a better
@@ -278,32 +284,34 @@
% One of her suggestions (not to use big hyperlink-areas) was almost
% instantly implemented and has been adopted as the standard way of
% linking.
-% \end{spelchunk}
+% }
%
-% \begin{spelchunk}
+% \<<<{
% You are free to use our software but kindly ask you to provide a
% mention ``The audio materials of this text have been prepared with
-% \spelatex{}/\spelbox{}'' in the section treating copyrights,
-% bibliographic data or any other spot that is suited. 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.
-% \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}
@@ -318,177 +326,153 @@
% \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, we often use \spelatex{} to proofread texts as we
-% hear language errors more easily than we 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-spel} \cite{OXSPELATEX}}
-% \spelitem{This \LaTeX{}-package \spelatex{} \cite{SPEL}}
-% \spelitem{A script embeded in the Perl module \texttt{SpeL::Wizard} \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}
+% \<<<{
+% \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, \LaTeX{} will produce a PDF file that references audio
+% 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(\spelbox)};
-% \node [doc] (text) at (0,3) {text.tex\\\footnotesize(prepped source)};
-% \draw[->] (utext) -- (instrument);
-% \draw[->] (instrument) -- (text);
-% \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);
+% [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
-% equiped \LaTeX{} file of your text. We call this the prepped source. You can
-% also start by composing this file yourself.
-% If you prepped source file uses the \spelatex{} style file, than
-% your compiler will generate a PDF file with hyperlinks, a
-% dot aawks-file and a dot spellindex-file together with a directory full of
-% dot 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 \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}
%
-% \begin{spelchunk}
+% \<<<{
% You might wonder: where are the links? Well, there are three
% variants:
-% \end{spelchunk}
+% }
% \begin{itemize}
% \spelitem{\emph{area links}, which are almost exclusively
% used for equations, tables or figures. These links make an entire
% rectangle active, linking to the corresponding audio file.}
% \spelitem{\emph{group links}, indicated by small right-pointing
-% triangles next to section headers. These cause all blocks in the
-% section to be read one by one.}
-% \spelitem{\emph{hidden links}, wich are, as the name suggests,
-% hidden to avoid visual disturbance of the text; every
-% paragraph, footnote and list is activated by a link on the
-% whitespace before the first line of the chunk. Try it! Once you
+% 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. In addition, not using the full paragraph as an active
+% easily. Not using the full paragraph as an active
% region, allows existing hyperlinks (like for citations, references
% or URLs) to still function.}
% \end{itemize}
@@ -504,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|,
@@ -512,9 +496,9 @@
% 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
@@ -524,10 +508,10 @@
% 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
@@ -540,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}
@@ -553,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
@@ -581,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, we encourage
-% you to use Emacs as your editor. The learning
-% curve is steep, but the rewards regarding ease-of-use are huge.
-% In that way, you can focus on providing textual descriptions for
-% 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. We 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}
@@ -648,14 +610,11 @@
%
% \subsection{Added value}
%
-% \begin{spelchunk}
+% \<<<{
% Why would it make sense to use \spelatex? We think there are many
% selling points. We can mention a few:
-% \end{spelchunk}
+% }
% \begin{description}
-% \spelitem[Minimal overhead]{
-% 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})
@@ -664,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, We 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
@@ -675,72 +635,71 @@
% \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}
+% \<<<{
% If you are a package manager then you'll know how to
% prepare an installation package for \spelatex.
-% \end{spelchunk}
+% }
%
-% \begin{spelchunk}
-% If you are a normal user then you have two options. First,
-% check if there is a package that your favorite \LaTeX{}
-% distributor has prepared for you. Most of the major distributions
-% (like e.g. \TexLive{} or \MikTeX{}) do so.\\
-% Second, grab the TDS package
-% from \CTAN{} \cite{CTAN} (spel.TDS.zip) and unzip it somewhere in your
-% own TDS tree, regenerate your filename database and off you go.
-% In any case, make sure that \LaTeX{} finds the file |spel.sty|.
-% \end{spelchunk}
+% \<<<{
+% 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.
+% }
%
-% \begin{spelchunk}
+% \<<<{
% The \spelatex{} package uses a number of auxiliary packages, fetch them
% from \CTAN{} \cite{CTAN} if your \TeX{} distributor does not provide
-% them. The ones used are: |expl3|, |hyperref|, |ifthen|,
-% |fancyvrb|, |newfile|, |rotating|, |babel|, |kvoptions|.
-% \end{spelchunk}
+% 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 |SpeL::Wizard|
% module. You can do this with the perl pacakge manager for your
% interpreter.
-% \end{spelchunk}
+% }
%
-% \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|\\
-% On Strawberry perl: |$ cpan SpeL::Wizard|\\
-% On 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, named |tts.conf| that sets up the text-to-speech conversion.
@@ -773,12 +732,12 @@
% \end{Verbatim}
% \end{spelchunk}
%
-% \begin{spelchunk}
+% \<<<{
% The tts configuration parameter defines the speech engine to use.
% The languagetags section defines how the babel languages are mapped to
% 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
@@ -789,12 +748,12 @@
% \end{spelchunk}
% \begin{spelchunk}
% If that variable is not set, the script will look in a subdirectory
-% |.spel_wizard| of your home-folder (or |%userprofile%| in
+% |.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}
%
-% \begin{spelchunk}
+% \<<<{
% Be aware that you need to install your text-to-speech tool yourself
% according to the documentation provided by the tool provider.
% In addition, make sure it the executable is in your search path. In
@@ -802,79 +761,78 @@
% 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}
+% }
%
% \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 \cite{XPDF} does not, evince
-% \cite{EVINCE} complains about security risks, but okular
-% \cite{OKULAR} and Adobe Reader \cite{ADOBEREADER} do. So does
-% PDF-XChange Viewer \cite{PDFXCHANGE}.
-% \end{spelchunk}
+% \<<<{
+% 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).
-% \end{spelchunk}
+% }
%
-% \begin{spelchunk}
+% \<<<{
% On windows, we recommend using vlc. It works out of the box.
% When usign the stock Windows Media Player, you will need to add
% every folder that contains a PDF you'd like to have read, to your
% Media Player library. Search the internet to find instructions on
% that and be prepared: in line with Microsoft'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{Treat the implicit spelchunks}
-% \begin{spelchunk}
+% \<<<{
% The texts of chapter, (sub)section titles, a.s.o. will be formatted
% automatically such that they are hyperlinked to the appropriate
% 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:
@@ -897,35 +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{Treat the explicit spelchunks}
-%
-% \begin{spelchunk}
+% \label{sec:explicitspelchunks}
+% \<<<{
% \DescribeEnv{spelchunk}
% Use this environment to embed the chunks of text in that you want
% to generate audio for. In case the content is an equation, a
% figure or a table, we recommend specifying |arealink| as the
% optional argument to the |spelchunk| environment. It makes the
% entire equation an active hyperlink.
-% \end{spelchunk}
+% 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.
+% }
%
-% \begin{spelchunk}
+% \<<<{
% 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.
+% 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}[arealink]
+% \begin{spelchunk[arealink]
% \begin{align}
% E &= m c^2\\
% e^{j\pi} &= -1
@@ -952,12 +911,12 @@
%
% \begin{spelchunk}
% Example:\\
-% {\footnotesize (note: the example below is not \spelatex{}-enabled because it
+% {\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.
@@ -975,7 +934,7 @@
%
% \begin{spelchunk}
% Example:\\
-% {\footnotesize (note: the example below is not \spelatex{}-enabled because it
+% {\footnotesize (note: the example below is for a third time not \spelatex{}-enabled because it
% generates internal package problems)}
% \end{spelchunk}
% \begin{Verbatim}
@@ -989,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}
@@ -1127,13 +1119,13 @@
%
% \DescribeMacro{\setdesc}
% \begin{spelchunk}
-% This macro typesets an enumeration 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}
@@ -1181,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}
@@ -1193,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}
%
@@ -1203,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}
@@ -1215,20 +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]
+% }
+% \<<<[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}
@@ -1259,8 +1259,9 @@
% 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}
@@ -1274,6 +1275,8 @@
% section~\ref{eqn:complex}.
% \end{spelchunk}
%
+% \selectlanguage{dutch}
+%
% \bibliographystyle{alpha}
%
% \begin{thebibliography}{99}
@@ -1292,10 +1295,11 @@
%
% \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}}}
@@ -1369,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}
@@ -1391,7 +1395,7 @@
% \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}
%
@@ -1429,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.
@@ -1481,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]
@@ -1537,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
@@ -1583,6 +1583,7 @@
\RequirePackage{hyperref}
\RequirePackage{xcolor}
\RequirePackage{ifthen}
+\RequirePackage{verbatim}
\RequirePackage{fancyvrb}
\RequirePackage{newfile}
\RequirePackage{rotating}
@@ -1602,7 +1603,6 @@
urlcolor=black}
\RequirePackage{kvoptions}
\RequirePackage{xkeyval}
-\RequirePackage{marginnote}
% \end{macrocode}
%
% \subsection{Options}
@@ -1613,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}
%
@@ -1627,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}
@@ -1674,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|
@@ -1774,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.
@@ -1789,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}
@@ -1846,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}%
}
@@ -1863,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}%
}
@@ -1881,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}%
}
@@ -1901,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}%
}
@@ -1922,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!25}{$\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}%
@@ -1941,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}%
@@ -1963,7 +1984,7 @@
\stepcounter{spel@footnote}%
\settowidth\spel@mptboxwidth{\usebox\spel@mptbox}%
\spel@@fntext{%
- \hspace*{-\spel@mptboxwidth}\href{run:\audiodir/footnote-\thespel@footnote.\spel@format}{\usebox\spel@mptbox}#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}%
}
@@ -2004,7 +2025,7 @@
\settowidth\spel@mptboxwidth{\usebox\spel@mptbox}%
\spel@idxwrite{item}{\spel@@optpart\thesubparagraph-\thespel@chunk}%
\spel@chunkwrite{\spel@@optpart\thesubparagraph-\thespel@chunk}{#1}%
- \item \hspace*{-\spel@mptboxwidth}\href{run:\audiodir/\spel@@optpart\thesubparagraph-\thespel@chunk.\spel@format}{\usebox\spel@mptbox}#1}
+ \item \hspace*{-\spel@mptboxwidth}\href{\linksdir/\spel@@optpart\thesubparagraph-\thespel@chunk.\spel@format}{\usebox\spel@mptbox}#1}
% \end{macrocode}
% \end{macro}
%
@@ -2017,7 +2038,7 @@
\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] \hspace*{-\spel@mptboxwidth}\href{run:\audiodir/\spel@@optpart\thesubparagraph-\thespel@chunk.\spel@format}{\usebox\spel@mptbox}#2}
+\item[#1] \hspace*{-\spel@mptboxwidth}\href{\linksdir/\spel@@optpart\thesubparagraph-\thespel@chunk.\spel@format}{\usebox\spel@mptbox}#2}
% \end{macrocode}
% \end{macro}
%
@@ -2031,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}
@@ -2046,7 +2067,7 @@
% \begin{macrocode}
\newlength\spel@mptboxwidth
\newsavebox\spel@mptbox
-\savebox\spel@mptbox{\textcolor{black!25}{$\qquad$}}
+\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
@@ -2061,10 +2082,10 @@
\end{VerbatimOut}%
\catcode`\^^M=5\relax%
\ifspel@chunkarealink%
- \href{run:\audiodir/\spel@@optpart\thesubparagraph-\thespel@chunk.\spel@format}{\input{./\chunkdir/\spel@@optpart\thesubparagraph-\thespel@chunk}}%
+ \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{run:\audiodir/\spel@@optpart\thesubparagraph-\thespel@chunk.\spel@format}{\usebox\spel@mptbox}\input{./\chunkdir/\spel@@optpart\thesubparagraph-\thespel@chunk}%
+ \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%
}%
@@ -2092,6 +2113,47 @@
% \end{macrocode}
% \end{macro}
%
+% \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}
@@ -2117,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
@@ -2130,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}
@@ -2163,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}{}
@@ -2179,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
@@ -2191,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}
@@ -2240,7 +2304,6 @@
% ignored:
% \begin{macrocode}
\spelmacad{spelatex}{spee-lay-tech}
-\spelmacad{spelbox}{spel-box}
\spelmacad{spelpl}{spel wizzard dot pl}
\spelmacad{LaTeX}{lay-tech}
\spelmacad{TeX}{tech}
@@ -2335,7 +2398,7 @@
%
% \section{TODO}
% \begin{spelchunk}[arealink]
-% As long as there are things on my todo list, We have a reason to
+% As long as there are things on our todo list, we have a reason to
% live.
% \end{spelchunk}
% \begin{itemize}
@@ -2374,22 +2437,6 @@
% \newblock \url{https://www.winehq.org}
% \newblock online, accessed in June 2024.
%
-% \bibitem{ORGMODE}
-% Org Mode --- your life in plain text.
-% \newblock \url{https://orgmode.org/}.
-% \newblock online, accessed in May 2024.
-%
-% \bibitem{EMACS}
-% The Emacs An extensible, customizable, free text editor --- and
-% more.
-% \newblock \url{https://www.gnu.org/software/emacs/}.
-% \newblock online, accessed in May 2024.
-%
-% \bibitem{OXSPELATEX}
-% Org Mode SpeLaTeX Exporter --- SpeLaTeX made easy.
-% \newblock \url{https://www.melpa.org/#/ox-spelatex}
-% \newblock (not yet online)
-%
% \bibitem{SPEL}
% SpeL --- Speech-enabled \LaTeX.
% \newblock \url{https://ctan.org/pkg/spel}
@@ -2445,11 +2492,6 @@
% \newblock \url{https://okular.kde.org}.
% \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/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 0ed233e2e0b..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.99d, released 2024-08-02}
+% \date{Version 0.99f, released 2024-09-16}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*luatex>
-\ProvidesExplFile {tagpdf-luatex.def} {2024-08-02} {0.99d}
+\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.99d", --TAGVERSION
- date = "2024-08-02", --TAGDATE
+ version = "0.99f", --TAGVERSION
+ date = "2024-09-16", --TAGDATE
description = "tagpdf lua code",
license = "The LATEX Project Public License 1.3c"
}
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx
index 3cbe3b141bb..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.99d, released 2024-08-02}
+% \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-08-02} {0.99d}
+\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 6417b44c404..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.99d, released 2024-08-02}
+% \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-08-02} {0.99d}
+%% \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-08-02} {0.99d}
+%% \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-08-02} {0.99d}
+%% \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-08-02} {0.99d}
+%% \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-08-02} {0.99d}
+%% \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-08-02} {0.99d}
+%% \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-08-02} {0.99d}
+%% \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 ff036b5523f..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.99d, released 2024-08-02}
+% \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-08-02} {0.99d}
+\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-08-02} {0.99d}
+\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 3c2e91605e1..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.99d, released 2024-08-02}
+% \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-08-02} {0.99d}
+\ProvidesExplPackage {tagpdf-mc-code-lua} {2024-09-16} {0.99f}
{tagpdf - mc code only for the luamode }
%</luamode>
%<*debug>
-\ProvidesExplPackage {tagpdf-debug-lua} {2024-08-02} {0.99d}
+\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 5bfe0658d10..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.99d, released 2024-08-02}
+% \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-08-02} {0.99d}
+\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 fb5f1b77c99..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.99d, released 2024-08-02}
+% \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-08-02} {0.99d}
+\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 5c8e0070848..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.99d, released 2024-08-02}
+% \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-08-02} {0.99d}
+\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 6da5e48b187..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.99d, released 2024-08-02}
+% \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-08-02} {0.99d}
+\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-08-02} {0.99d}
+\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 f7ae6de9966..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.99d, released 2024-08-02}
+% \date{Version 0.99f, released 2024-09-16}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-tree-code} {2024-08-02} {0.99d}
+\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 a4014b62e39..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.99d, released 2024-08-02}
+% \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-08-02} {0.99d}
+\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 b1d008a6e6c..d40c60bc67a 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx
@@ -21,68 +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}{activate/softhyphen (setup-key)}
+% \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{function}
+% \end{setupkeydecl}
%
-% \begin{function}{page/tabsorder (setup-key), tabsorder (deprecated)}
+% \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.
@@ -93,8 +132,8 @@
% \begin{macrocode}
%<@@=tag>
%<*package>
-\ProvidesExplPackage {tagpdf} {2024-08-02} {0.99d}
- { A package to experiment with pdf tagging }
+\ProvidesExplPackage {tagpdf} {2024-09-16} {0.99f}
+ { LaTeX kernel code for PDF tagging }
\bool_if:nF
{
@@ -119,7 +158,7 @@
% \end{macrocode}
%<*debug>
% \begin{macrocode}
-\ProvidesExplPackage {tagpdf-debug} {2024-08-02} {0.99d}
+\ProvidesExplPackage {tagpdf-debug} {2024-09-16} {0.99f}
{ debug code for tagpdf }
\@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput}
% \end{macrocode}
@@ -142,7 +181,7 @@
% we define a base package with dummy functions
% \begin{macrocode}
%<*base>
-\ProvidesExplPackage {tagpdf-base} {2024-08-02} {0.99d}
+\ProvidesExplPackage {tagpdf-base} {2024-09-16} {0.99f}
{part of tagpdf - provide base, no-op versions of the user commands }
%</base>
% \end{macrocode}
@@ -191,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:}
@@ -251,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
@@ -267,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
@@ -382,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
{
@@ -411,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}
@@ -423,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}
@@ -440,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}
@@ -482,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
@@ -489,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 }
@@ -500,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.
@@ -508,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
@@ -525,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
@@ -542,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 }
@@ -566,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:{}
@@ -577,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}
@@ -586,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
@@ -620,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}
@@ -648,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}
@@ -660,15 +697,15 @@
% \begin{macrocode}
tagunmarked .bool_gset:N = \g_@@_tagunmarked_bool,
% \end{macrocode}
-% \end{macro}
-% \begin{macro}{activate/softhyphen (setup-key)}
+% \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{macro}
-% \begin{macro}{page/tabsorder (setup-key),tabsorder (deprecated)}
+% \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.
@@ -689,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/to-be-determined/to-be-determined.dtx b/Master/texmf-dist/source/latex/to-be-determined/to-be-determined.dtx
index 9cb2074d9b9..91183abd3f2 100644
--- a/Master/texmf-dist/source/latex/to-be-determined/to-be-determined.dtx
+++ b/Master/texmf-dist/source/latex/to-be-determined/to-be-determined.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
% (The MIT License)
%
-% Copyright (c) 2021-2022 Yegor Bugayenko
+% Copyright (c) 2021-2024 Yegor Bugayenko
%
% Permission is hereby granted, free of charge, to any person obtaining a copy
% of this software and associated documentation files (the 'Software'), to deal
@@ -50,7 +50,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{to-be-determined}
%<*package>
-[31.10.20220 0.3.0 Highlighting places requiring future work]
+[2024/10/11 0.3.2 Highlighting places requiring future work]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -81,24 +81,26 @@
% \section{Introduction}
%
% This package helps you highlight places in your articles
-% and make sure it looks nice. Install it from CTAN and then
+% and make sure the hightlighting looks nice. Install it from CTAN and then
% use like this:
+% \docshotPrerequisite{../local/to-be-determined.sty}
% \begin{docshot}
% \documentclass{article}
% \pagestyle{empty}
% \usepackage{to-be-determined}
% \begin{document}
-% The budget is \tbd{99.00 USD}.
+% The budget is \tbd{99.00 USD}.\par
+% In math too: $a \tbd{?} b$.
% \end{document}
% \end{docshot}
% \section{Package Options}
% \DescribeMacro{hide}
-% If you want to hide the content of what's inside |\tbd|,
-% use |hide| option of the package. They will all be replaced with
-% \tbd{TBD} placeholders.
+% If you want to hide the content of what's inside the |\tbd| command,
+% use the |hide| option of the package. They all will be replaced with
+% the \tbd{TBD} placeholders.
% \DescribeMacro{off}
% If you want them to disappear entirely, use the |off| package option.
@@ -121,22 +123,32 @@
\ProcessOptionsX\relax
% \end{macrocode}
-% Then, we include a few packages:
+% Then, we include \href{https://ctan.org/pkg/xcolor}{xcolor} to use colors:
% \begin{macrocode}
\RequirePackage{xcolor}
+% \end{macrocode}
+
+% Then, we include \href{https://ctan.org/pkg/mathtools}{mathtools} to enable our commands in math mode:
+% \begin{macrocode}
+\RequirePackage{mathtools}
+% \end{macrocode}
+
+% Then, we include \href{https://ctan.org/pkg/soul}{soul} to use highlights:
+% \begin{macrocode}
\RequirePackage{soul}
% \end{macrocode}
% \begin{macro}{\tbd}
+% \changes{v0.3.1}{2024/10/11}{Now, it works in math mode too.}
% Finally, we define the |\tbd| command:
% \begin{macrocode}
\makeatletter\newcommand\tbd[1]{{%
\iftbd@off\else%
\sethlcolor{yellow}%
\iftbd@hide%
- \hl{TBD}%
+ \text{\hl{TBD}}%
\else%
- \hl{#1}%
+ \text{\hl{#1}}%
\fi%
\fi%
}}\makeatother
diff --git a/Master/texmf-dist/source/latex/to-be-determined/to-be-determined.ins b/Master/texmf-dist/source/latex/to-be-determined/to-be-determined.ins
index a922989b508..db2662409e6 100644
--- a/Master/texmf-dist/source/latex/to-be-determined/to-be-determined.ins
+++ b/Master/texmf-dist/source/latex/to-be-determined/to-be-determined.ins
@@ -1,6 +1,6 @@
%% (The MIT License)
%%
-%% Copyright (c) 2021-2022 Yegor Bugayenko
+%% Copyright (c) 2021-2024 Yegor Bugayenko
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of this software and associated documentation files (the 'Software'), to deal
@@ -26,7 +26,7 @@
\preamble
(The MIT License)
-Copyright (c) 2021-2022 Yegor Bugayenko
+Copyright (c) 2021-2024 Yegor Bugayenko
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
diff --git a/Master/texmf-dist/source/latex/uantwerpendocs/uantwerpendocs.dtx b/Master/texmf-dist/source/latex/uantwerpendocs/uantwerpendocs.dtx
index acddbf252f9..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/06/04 v4.7 .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.7}
-\def\filedate{2024/06/24}%
+\def\fileversion{4.8}
+\def\filedate{2024/08/27}%
\usepackage{makeidx}
\usepackage{alltt}
\usepackage{longtable}
@@ -127,7 +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}
+% \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}
@@ -1210,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}
@@ -1364,8 +1365,8 @@
\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)
@@ -2808,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}
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/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/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