diff options
author | Karl Berry <karl@freefriends.org> | 2011-09-18 22:29:36 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-09-18 22:29:36 +0000 |
commit | 793be33975bf8f6986bb6435f2039c7c34ac3c15 (patch) | |
tree | 873887f99fef55a52edf3614dd48ec340b1515e6 | |
parent | 4c7c93512d5ad99119fc38035815ba54a17605a5 (diff) |
unicode-math 0.6 (18sep11)
git-svn-id: svn://tug.org/texlive/trunk@24003 c570f23f-e606-0410-a88d-b1316a301751
28 files changed, 6627 insertions, 3960 deletions
diff --git a/Master/texmf-dist/doc/latex/unicode-math/README b/Master/texmf-dist/doc/latex/unicode-math/README index 01399e0c16c..0e578f4f007 100644 --- a/Master/texmf-dist/doc/latex/unicode-math/README +++ b/Master/texmf-dist/doc/latex/unicode-math/README @@ -55,13 +55,15 @@ Furthermore, it will be in a different font. REQUIREMENTS ------------ -As well as running XeTeX or LuaTeX this package requires recent versions of +If you're using an up-to-date TeX Live 2011 or MiKTeX 2.9 then there'll be no problems. +Otherwise, read on. + +As well as running XeTeX or LuaTeX, this package requires recent versions of the `fontspec`, `expl3`, `xpackages`, `catchfile`, `trimspaces`, -`filehook`, and `lualatex-math` packages. If you're using an up-to-date TeX Live 2011 then there'll -be no problems. +`filehook`, and `lualatex-math` packages. For some additional features you need LuaTeX 0.65 or later, which can be -updated using [TLContrib][TLC]. +updated using [TLContrib][TLC] if you're still using TeX Live 2010. [TLC]: http://tlcontrib.metatex.org) @@ -83,12 +85,14 @@ Please file bug reports with minimal examples: INSTALLATION ------------ -The steps below assume that you have obtained unicode-math either from CTAN or -Github and you wish to install the package yourself. If you are using TeX Live -2010 or later, you may install the latest release version of the package with +If you are using TeX Live 2010 or later, you may install the latest release +version of the package with sudo tlmgr update unicode-math +The steps below assume that you have obtained unicode-math either from CTAN or +Github and you wish to install the package yourself. + Installation and compilation are automated by the Makefile; see below for the manual procedure. To re-compile the documentation (requiring XeLaTeX and a variety of installed fonts): @@ -108,7 +112,7 @@ See `make help` for further information. ### Manual procedure -Run TeX on unicode-math.dtx to generate the package file unicode-math.sty: +Run TeX on unicode-math.dtx to generate the package file `unicode-math.sty`: tex unicode-math.dtx @@ -138,7 +142,7 @@ After installation you can initialise the testsuite with Subsequently, the test suite may be executed with - make test + make check Both of these operations will take quite some time and require ImageMagick's `convert` tool to be installed. They are only necessary if you wish to make @@ -150,7 +154,32 @@ changes have not affected the standard behaviour. CHANGE HISTORY -------------- -- v0.5e (2011/07/07) +- v0.6 (2011/09/18) + + * Keep in sync with fontspec internals + (sorry for the small delay where things were broken) + * Keep in sync with expl3 deprecated functions + * Math versions (finally) implemented; can now change maths fonts + mid-document without reinitialising everything + (thanks to Ulrike Fischer and Ulrik Vieth) + * Symbols file `unimath-symbols.pdf` now uses maths versions to compare + all of the OpenType maths fonts I currently have access to + * Over- and under- braces, brackets, and parentheses now work in XeTeX + (thanks to Claudio Beccari) + * Many internal changes, including a re-write of the `range` feature; + it should now be faster and more robust + * Tentative programmer's interface for querying the current math style: + `\l_um_mathstyle_tl`. + * Remove (outdated) interaction with beamer; you must specify + `professionalfonts` manually for now + * Quieten the console output when loading maths fonts with incomplete maths + style coverage + * Synonym added: `\lnot` -> `\neg` + * Two added Unicode symbols (names tentative): `\blanksymbol` and `\openbox` + (thanks to Apostolos Syropoulos) + * Fixed literal sub-/super-script input. + +- v0.5e (2011/07/31) * Fix forward compatibility clash with deprecated expl3 functions (sorry) * Command names are now `\protected`; this makes them safe to use in moving @@ -169,7 +198,7 @@ CHANGE HISTORY * Fix the math class of `\modtwosum`; it is now a large operator (thanks to Michael Ummels) * Move several LuaTeX-related patches to the `lualatex-math` package - + * Fixed mathtool's `\cramped` in XeLaTeX usage - v0.5d (2011/01/30) @@ -189,7 +218,7 @@ CHANGE HISTORY - v0.5b (2010/09/19): Tune-up - * Added missing symbols/synonyms: + * Added missing symbols/synonyms: \diamond \smallint \emptyset \hbar \backepsilon \eth * \overline works for LuaLaTeX * Fix \slash; previously, it overwrote the text definition @@ -199,8 +228,10 @@ CHANGE HISTORY * Numerous documentation improvements * Bug fix against stray catcode changes - * Add `\mathcal` and `\mathbfcal` as distinct from the Script style; these are only supported by the XITS fonts at present - * Small changes to the range of symbols offered (especially note that `\ac` is now `\invlazys` to avoid acronym package clash) + * Add `\mathcal` and `\mathbfcal` as distinct from the Script style; + these are only supported by the XITS fonts at present + * Small changes to the range of symbols offered (especially note that `\ac` + is now `\invlazys` to avoid acronym package clash) * Superscripts are allowed after primes (as they should be) * Numerous LuaLaTeX improvements, including roots and over/under braces. @@ -221,10 +252,12 @@ This work is author-maintained and consists of the files - unicode-math.dtx, - unicode-math-table.tex, - unimath-example.ltx, -- unimath-symbols.ltx; +- unimath-symbols.ltx, +- unicode-math-testsuite.ltx; -the derived file +the derived files +- unicode-math.lua, - unicode-math.sty; the compiled documentation files @@ -237,9 +270,8 @@ the compiled documentation files and the test suite for this package - testfiles/umtest-preamble.tex, -- testfiles/umtest-suite.tex, -- testfiles/umtest*.ltx, -- testfiles/umtest*.safe.png. +- testfiles/umtest-suite-(F|L|X).tex, +- testfiles/*.ltx. ____________________________________ Copyright 2006-2011 Will Robertson <will.robertson@latex-project.org> diff --git a/Master/texmf-dist/doc/latex/unicode-math/unicode-math-testsuite.pdf b/Master/texmf-dist/doc/latex/unicode-math/unicode-math-testsuite.pdf Binary files differindex 03fe07dea18..392b519c1c7 100644 --- a/Master/texmf-dist/doc/latex/unicode-math/unicode-math-testsuite.pdf +++ b/Master/texmf-dist/doc/latex/unicode-math/unicode-math-testsuite.pdf diff --git a/Master/texmf-dist/doc/latex/unicode-math/unicode-math.pdf b/Master/texmf-dist/doc/latex/unicode-math/unicode-math.pdf Binary files differindex 956adb1db1e..3773e1ab9ca 100644 --- a/Master/texmf-dist/doc/latex/unicode-math/unicode-math.pdf +++ b/Master/texmf-dist/doc/latex/unicode-math/unicode-math.pdf diff --git a/Master/texmf-dist/doc/latex/unicode-math/unimath-symbols.pdf b/Master/texmf-dist/doc/latex/unicode-math/unimath-symbols.pdf Binary files differindex 90219546ff9..f27de4fe8e9 100644 --- a/Master/texmf-dist/doc/latex/unicode-math/unimath-symbols.pdf +++ b/Master/texmf-dist/doc/latex/unicode-math/unimath-symbols.pdf diff --git a/Master/texmf-dist/source/latex/unicode-math/Makefile b/Master/texmf-dist/source/latex/unicode-math/Makefile index b75e1574945..807cda3fe6e 100644 --- a/Master/texmf-dist/source/latex/unicode-math/Makefile +++ b/Master/texmf-dist/source/latex/unicode-math/Makefile @@ -27,6 +27,10 @@ help: echo ' xfile F=<abc> - compile file <abc> with XeLaTeX' echo ' lfile F=<abc> - compile file <abc> with LuaLaTeX' echo ' ' + echo ' ' + echo 'Append `hometree=none` to any of the above to disable searching + echo 'the home texmf directory.' + echo ' ' echo 'To add a new test, add a file called X****.ltx to' echo 'directory testfiles/, run `make initest` and ensure' echo 'that the output X****.safe.pdf is correct.' @@ -58,7 +62,9 @@ builddir=build tds=$(builddir)/$(PKG).tds UPDATE = `which dtx-update` || true # TODO: generalise -SPEAKFAIL := `say 'Test failed!'` || true # Mac OS X only? +SPEAKFAIL := say 'Test failed!' || true # Mac OS X only? + +hometree = `kpsewhich -var-value=TEXMFHOME` # these files end up in the CTAN directory: @@ -70,12 +76,14 @@ BUILDDOC = $(addprefix $(builddir)/,$(DOC)) # -LTXSOURCE = $(PKG).sty $(PKG).lua $(TBL) +LTXSOURCE = $(PKG).sty $(PKG)-xetex.sty $(PKG)-luatex.sty $(PKG).lua $(TBL) # and this is how the TDS zip file is produced: INSFILES = \ $(tds)/tex/latex/$(PKG)/unicode-math.sty \ + $(tds)/tex/latex/$(PKG)/unicode-math-xetex.sty \ + $(tds)/tex/latex/$(PKG)/unicode-math-luatex.sty \ $(tds)/tex/latex/$(PKG)/unicode-math.lua \ $(tds)/tex/latex/$(PKG)/unicode-math-table.tex @@ -103,7 +111,7 @@ README: $(XMPL): clean: - rm -rf $(builddir) + rm -rf $(builddir)/* rm -f $(PKG).zip $(PKG).pdf $(SUITE).pdf all: clean doc ctan @@ -127,14 +135,14 @@ $(builddir)/$(PKG).lua: $(builddir)/$(PKG).dtx $(builddir)/$(PKG).pdf: $(builddir)/$(PKG).dtx $(BUILDSOURCE) cd $(builddir) && \ - xelatex $(PKG).dtx && \ + $(run_xelatex) $(PKG).dtx && \ makeindex -s gind.ist $(PKG) && \ - xelatex $(PKG).dtx; + $(run_xelatex) $(PKG).dtx; $(builddir)/$(SYM).pdf: $(builddir)/$(SYM).ltx cd $(builddir) && \ - xelatex $(SYM).ltx && \ - xelatex $(SYM).ltx; + $(run_xelatex) $(SYM).ltx && \ + $(run_xelatex) $(SYM).ltx; $(builddir)/%.ltx: $(testdir)/%.ltx $(COPY) $< $@ @@ -204,26 +212,32 @@ install-sys: $(INSFILES) fi ; +run_xelatex = export TEXMFHOME=$(hometree) && xelatex +run_lualatex = export TEXMFHOME=$(hometree) && lualatex ##### USEFUL FOR TEST FILES ##### xfile: $(F) $(BUILDSOURCE) if test -z "$(F)" ; then \ - echo "Need a filename!\nE.g. \`make xfile F=test.ltx\`" ; \ - false ; \ + echo "Typesetting test.tex:"; \ + $(COPY) test.tex $(builddir)/test.tex; \ + cd $(builddir); $(run_xelatex) test.tex; \ + else \ + echo Typesetting $(F):; \ + $(COPY) $(F) $(builddir)/$(F); \ + cd $(builddir); $(run_xelatex) $(F); \ fi - echo Typesetting $(F): - $(COPY) $(F) $(builddir)/$(F) - cd $(builddir); xelatex $(F) lfile: $(F) $(BUILDSOURCE) if test -z "$(F)" ; then \ - echo "Need a filename!\nE.g. \`make lfile F=test.ltx\`" ; \ - false ; \ + echo "Typesetting test.tex:"; \ + $(COPY) test.tex $(builddir)/test.tex; \ + cd $(builddir); $(run_lualatex) test.tex; \ + else \ + echo Typesetting $(F):; \ + $(COPY) $(F) $(builddir)/$(F); \ + cd $(builddir); $(run_lualatex) $(F); \ fi - echo Typesetting $(F): - $(COPY) $(F) $(builddir)/$(F) - cd $(builddir); lualatex $(F) ############# @@ -246,7 +260,7 @@ COMPARE_OPTS = -density 300x300 -metric ae -fuzz 35% # Redefine this to print output if you need: REDIRECT = > /dev/null -LTXSOURCE = $(NAME).sty $(NAME).lua +LTXSOURCE = $(NAME).sty $(NAME)-xetex.sty $(NAME)-luatex.sty $(NAME).lua TESTLIST = umtest-suite-X.tex umtest-suite-L.tex umtest-suite-F.tex @@ -271,21 +285,18 @@ BUILDFILES = $(BUILDSOURCE) $(BUILDSUITE) $(BUILDTESTSRC) $(BUILDTESTTARGET) $(builddir)/$(SUITE).pdf: $(builddir)/$(SUITE).ltx $(BUILDSUITE) cd $(builddir) && \ - xelatex $(SUITE).ltx + $(run_xelatex) $(SUITE).ltx #### All tests #### -foo: - echo $(BUILDTESTTARGET) - check: $(TESTLIST) $(TESTLIST): $(BUILDFILES) cd $(testdir) && \ ls X*.safe.pdf | sed -e 's/\(.*\).safe.pdf/\\inserttest{\1}/g' > umtest-suite-X.tex && \ ls L*.safe.pdf | sed -e 's/\(.*\).safe.pdf/\\inserttest{\1}/g' > umtest-suite-L.tex && \ - ls F*.safe.pdf | sed -e 's/\(.*\).safe.pdf/\\inserttest{\1}/g' > umtest-suite-F.tex; + ls F*-L.safe.pdf | sed -e 's/\(.*\).safe.pdf/\\inserttest{\1}/g' > umtest-suite-F.tex; $(builddir)/%: $(testdir)/% @mkdir -p $(builddir); \ @@ -329,11 +340,9 @@ $(Llonelypath): $(Llonelytest) $(builddir)/F%-L.diff.pdf: $(builddir)/F%-L.pdf @echo 'F$*: Comparing PDF from LuaLaTeX against reference output.' - if test $(shell compare \ - $(COMPARE_OPTS) \ - $(builddir)/F$*-L.pdf \ - $(testdir)/F$*-L.safe.pdf \ - $(builddir)/F$*-L.diff.pdf 2>&1) -le 1 ; then \ + compare_result="$$(compare "$(builddir)/F$*-L.pdf" "$(testdir)/F$*-L.safe.pdf" $(COMPARE_OPTS) "$(builddir)/F$*-L.diff.pdf" 2>&1)" ; \ + if [ 0 -eq "$$?" -a 1 -ge "$$compare_result" ] ; \ + then \ echo 'F$*: Test passed.' ; \ else \ echo 'F$*: Test failed.' ; \ @@ -343,11 +352,9 @@ $(builddir)/F%-L.diff.pdf: $(builddir)/F%-L.pdf $(builddir)/F%-X.diff.pdf: $(builddir)/F%-X.pdf @echo 'F$*: Comparing PDF from XeLaTeX against reference output.' - if test $(shell compare \ - $(COMPARE_OPTS) \ - $(builddir)/F$*-X.pdf \ - $(testdir)/F$*-X.safe.pdf \ - $(builddir)/F$*-X.diff.pdf 2>&1) -le 1 ; then \ + compare_result="$$(compare "$(builddir)/F$*-X.pdf" "$(testdir)/F$*-X.safe.pdf" $(COMPARE_OPTS) "$(builddir)/F$*-X.diff.pdf" 2>&1)" ; \ + if [ 0 -eq "$$?" -a 1 -ge "$$compare_result" ] ; \ + then \ echo 'F$*: Test passed.' ; \ else \ echo 'F$*: Test failed.' ; \ @@ -357,11 +364,11 @@ $(builddir)/F%-X.diff.pdf: $(builddir)/F%-X.pdf $(builddir)/F%-L.pdf: $(BUILDSOURCE) $(builddir)/F%-L.ltx @echo 'F$*: Generating PDF output with LuaLaTeX.' - @cd $(builddir); lualatex -interaction=nonstopmode F$*-L.ltx $(REDIRECT) + @cd $(builddir); $(run_lualatex) -interaction=nonstopmode F$*-L.ltx $(REDIRECT) $(builddir)/F%-X.pdf: $(BUILDSOURCE) $(builddir)/F%-X.ltx @echo 'F$*: Generating PDF output with XeLaTeX.' - @cd $(builddir); xelatex -interaction=nonstopmode F$*-X.ltx $(REDIRECT) + @cd $(builddir); $(run_xelatex) -interaction=nonstopmode F$*-X.ltx $(REDIRECT) $(builddir)/F%-L.ltx: $(builddir)/F%.ltx $(COPY) $< $@ @@ -374,9 +381,9 @@ $(builddir)/F%-X.ltx: $(builddir)/F%.ltx $(builddir)/L%.diff.pdf: $(builddir)/L%.pdf @echo 'L$*: Comparing PDF against reference output.' - if test $(shell compare $(COMPARE_OPTS) \ - $(builddir)/L$*.pdf $(testdir)/L$*.safe.pdf \ - $(builddir)/L$*.diff.pdf 2>&1) -le 1 ; then \ + compare_result="$$(compare "$(builddir)/L$*.pdf" "$(testdir)/L$*.safe.pdf" $(COMPARE_OPTS) "$(builddir)/L$*.diff.pdf" 2>&1)" ; \ + if [ 0 -eq "$$?" -a 1 -ge "$$compare_result" ] ; \ + then \ echo 'L$*: Test passed.' ; \ else \ echo 'L$*: Test failed.' ; \ @@ -386,11 +393,9 @@ $(builddir)/L%.diff.pdf: $(builddir)/L%.pdf $(builddir)/X%.diff.pdf: $(builddir)/X%.pdf @echo 'X$*: Comparing PDF against reference output.' - if test $(shell compare \ - $(COMPARE_OPTS) \ - $(builddir)/X$*.pdf \ - $(testdir)/X$*.safe.pdf \ - $(builddir)/X$*.diff.pdf 2>&1) -le 1 ; then \ + compare_result="$$(compare "$(builddir)/X$*.pdf" "$(testdir)/X$*.safe.pdf" $(COMPARE_OPTS) "$(builddir)/X$*.diff.pdf" 2>&1)" ; \ + if [ 0 -eq "$$?" -a 1 -ge "$$compare_result" ] ; \ + then \ echo 'X$*: Test passed.' ; \ else \ echo 'X$*: Test failed.' ; \ @@ -400,11 +405,11 @@ $(builddir)/X%.diff.pdf: $(builddir)/X%.pdf $(builddir)/X%.pdf: $(BUILDSOURCE) $(BUILDSUITE) $(builddir)/X%.ltx @echo 'X$*: Generating PDF output with XeLaTeX.' - @cd $(builddir); xelatex -interaction=nonstopmode X$*.ltx $(REDIRECT) + @cd $(builddir) && $(run_xelatex) -interaction=nonstopmode X$*.ltx $(REDIRECT) $(builddir)/L%.pdf: $(BUILDSOURCE) $(BUILDSUITE) $(builddir)/L%.ltx @echo 'L$*: Generating PDF output with LuaLaTeX.' - @cd $(builddir); lualatex -interaction=nonstopmode L$*.ltx $(REDIRECT) + @cd $(builddir) && $(run_lualatex) -interaction=nonstopmode L$*.ltx $(REDIRECT) #### HACK: allow `make <foobar>` run that test. diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/X204a.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-active-sscripts.ltx index 95a219a933d..95a219a933d 100644 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/X204a.ltx +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-active-sscripts.ltx diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/F-mathversion.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-mathversion.ltx new file mode 100644 index 00000000000..7fe40976ebe --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-mathversion.ltx @@ -0,0 +1,13 @@ +\input{umtest-preamble} +\usepackage{unicode-math} +\setmathfont{xits-math.otf} +\setmathfont[version=bold,Colour=009900]{xits-math.otf} +\begin{document} +\[ +(x+y)^{{z+c}^{a+b}} +\] +\mathversion{bold} +\[ +(x+y)^{{z+c}^{a+b}} +\] +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/X205a.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-nolimits-spec.ltx index f5887be747d..23900115403 100644 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/X205a.ltx +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-nolimits-spec.ltx @@ -1,6 +1,6 @@ \input{umtest-preamble} \usepackage{unicode-math} -\setmathfont{Cambria Math} +\setmathfont{xits-math.otf} \begin{document} \[\iiint_V\] \removenolimits\iiint diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/F-over-under-2.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-over-under-2.ltx new file mode 100644 index 00000000000..f3cdfe89a3d --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-over-under-2.ltx @@ -0,0 +1,17 @@ + +% see http://github.com/wspr/unicode-math/issues/212 + +\input{umtest-preamble} +\usepackage{unicode-math} +\setmathfont[Colour=FF0000]{xits-math.otf} +\setmathfont + [range={\mathop},Colour=0000FF] + {xits-math.otf} + +\begin{document} + +\[ \underbrace{\int x dx}_{xyz} +\qquad +\overbrace{\int x dx}^{xyz} \] + +\end{document} diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/F-over-under.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-over-under.ltx new file mode 100644 index 00000000000..2d67a983321 --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-over-under.ltx @@ -0,0 +1,15 @@ +\input{umtest-preamble} +\usepackage{unicode-math} +\setmathfont{xits-math.otf} +\begin{document} +\[ +\overbrace{a+b+c+d}^{e/f/g/h} +\overbracket{a+b+c+d}^{e/f/g/h} +\overparen{a+b+c+d}^{e/f/g/h} +\] +\[ +\underbrace{a+b+c+d}_{e/f/g/h} +\underbracket{a+b+c+d}_{e/f/g/h} +\underparen{a+b+c+d}_{e/f/g/h} +\] +\end{document} diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/X400a.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-pkg-url.ltx index 014bfe1d35a..2d204d33794 100644 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/X400a.ltx +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-pkg-url.ltx @@ -1,5 +1,5 @@ \input{umtest-preamble} -\usepackage[trace=on]{unicode-math} +\usepackage{unicode-math} \setmainfont{TeX Gyre Pagella} \setsansfont{TeX Gyre Adventor} \setmonofont{TeX Gyre Cursor} diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/F-query-mathstyle.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-query-mathstyle.ltx new file mode 100644 index 00000000000..6b61f8ae14c --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-query-mathstyle.ltx @@ -0,0 +1,26 @@ +\input{umtest-preamble} + +\usepackage{unicode-math} +\setmathfont[Colour=FF0000]{xits-math.otf} + +\begin{document} + +\ExplSyntaxOn +[$\l_um_mathstyle_tl$]\ +[$\mathrm{\l_um_mathstyle_tl}$]\ +[$\mathup{\l_um_mathstyle_tl}$]\ +[$\mathit{\l_um_mathstyle_tl}$] + +[$\mathbf{\l_um_mathstyle_tl}$]\ +[$\mathbfit{\l_um_mathstyle_tl}$]\ +[$\mathbfup{\l_um_mathstyle_tl}$] + +[$\mathsf{\l_um_mathstyle_tl}$]\ +[$\mathsfit{\l_um_mathstyle_tl}$]\ +[$\mathsfup{\l_um_mathstyle_tl}$] + +[$\mathbfsf{\l_um_mathstyle_tl}$]\ +[$\mathbfsfit{\l_um_mathstyle_tl}$]\ +[$\mathbfsfup{\l_um_mathstyle_tl}$] + +\end{document} diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/F-range-prime-check.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-range-prime-check.ltx new file mode 100644 index 00000000000..3181d7b8f79 --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-range-prime-check.ltx @@ -0,0 +1,17 @@ +% +% See http://github.com/wspr/unicode-math/issues/171 +% +% The fix is related to the fact that primes use the `mathactive' +% section of the unicode-math code, which is now controlled by +% the parsing range feature (as it always should have been). + +\input{umtest-preamble} +\usepackage{unicode-math} +\setmathfont[Colour=FF0000]{xits-math.otf} +\setmathfont + [range=\mathop,Colour=0000FF] + {xits-math.otf} + +\begin{document} +\[ f(x) = \int f'(x) dx \] +\end{document} diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/F-slash-delim-2.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-slash-delim-2.ltx index 5d62e1a15ed..179ae3ef968 100644 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/F-slash-delim-2.ltx +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-slash-delim-2.ltx @@ -1,4 +1,4 @@ -\documentclass{article} +\input{umtest-preamble} \usepackage{unicode-math} \begin{document} \newcommand\ARRAY[4]{% diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/X300a.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-sscript-features.ltx index 694c33da949..3db6e6547c6 100644 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/X300a.ltx +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-sscript-features.ltx @@ -1,10 +1,10 @@ \input{umtest-preamble} \usepackage{unicode-math} \setmathfont[script-font = {Asana Math}, - script-features = {ScriptStyle,Colour=FF0000}, + script-features = {Style=MathScript,Colour=FF0000}, sscript-font = {Cambria Math}, - sscript-features= {ScriptScriptStyle,Colour=0000FF}] - {Cambria Math} + sscript-features= {Style=MathScriptScript,Colour=0000FF}] + {XITS Math} \begin{document} \[123456789^{123456789^{123456789}}\] -\end{document}
\ No newline at end of file +\end{document} diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/L602b.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/L602b.ltx index 15be38ca38e..ce99258e075 100644 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/L602b.ltx +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/L602b.ltx @@ -2,7 +2,7 @@ \usepackage{unicode-math} -\setmathfont{Cambria Math} +\setmathfont{xits-math.otf} \ExplSyntaxOn diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/L603b.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/L603b.ltx index 40f1aaa8606..9b53e908fcf 100644 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/L603b.ltx +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/L603b.ltx @@ -3,7 +3,7 @@ \usepackage{amsmath} \usepackage{unicode-math} -\setmathfont{Cambria Math} +\setmathfont{xits-math.otf} \ExplSyntaxOn diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/X601b.ignore.pdf b/Master/texmf-dist/source/latex/unicode-math/testfiles/X601b.ignore.pdf Binary files differdeleted file mode 100644 index ebb5c2dbc98..00000000000 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/X601b.ignore.pdf +++ /dev/null diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/X601f.ignore.pdf b/Master/texmf-dist/source/latex/unicode-math/testfiles/X601f.ignore.pdf Binary files differdeleted file mode 100644 index d8d62dd116f..00000000000 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/X601f.ignore.pdf +++ /dev/null diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-F.tex b/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-F.tex index 2a2b99cbe4c..4f97a00b0e2 100644 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-F.tex +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-F.tex @@ -1,26 +1,22 @@ +\inserttest{F-active-sscripts-L} \inserttest{F-alph-spaces-L} -\inserttest{F-alph-spaces-X} \inserttest{F-arrow-accents-L} -\inserttest{F-arrow-accents-X} \inserttest{F-mathstyle-french-L} -\inserttest{F-mathstyle-french-X} \inserttest{F-mathstyle-iso-L} -\inserttest{F-mathstyle-iso-X} \inserttest{F-mathstyle-literal-L} -\inserttest{F-mathstyle-literal-X} \inserttest{F-mathstyle-tex-L} -\inserttest{F-mathstyle-tex-X} \inserttest{F-mathstyle-upright-L} -\inserttest{F-mathstyle-upright-X} +\inserttest{F-mathversion-L} +\inserttest{F-nolimits-spec-L} +\inserttest{F-over-under-2-L} +\inserttest{F-over-under-L} +\inserttest{F-pkg-url-L} \inserttest{F-primes-1-L} -\inserttest{F-primes-1-X} \inserttest{F-primes-2-L} -\inserttest{F-primes-2-X} \inserttest{F-primes-back-L} -\inserttest{F-primes-back-X} +\inserttest{F-query-mathstyle-L} +\inserttest{F-range-prime-check-L} \inserttest{F-slash-delim-2-L} -\inserttest{F-slash-delim-2-X} \inserttest{F-sqrt-L} -\inserttest{F-sqrt-X} \inserttest{F-sqrt-n-L} -\inserttest{F-sqrt-n-X} +\inserttest{F-sscript-features-L} diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-X.tex b/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-X.tex index 4bc92dec7cb..6ab838ffe64 100644 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-X.tex +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-X.tex @@ -90,14 +90,10 @@ \inserttest{X202a} \inserttest{X202b} \inserttest{X203a} -\inserttest{X204a} -\inserttest{X205a} \inserttest{X206a} \inserttest{X206b} \inserttest{X206c} \inserttest{X207a} -\inserttest{X300a} -\inserttest{X400a} \inserttest{X401a} \inserttest{X500a} \inserttest{X501a} @@ -113,6 +109,8 @@ \inserttest{X600d} \inserttest{X600f} \inserttest{X601a} +\inserttest{X601b} +\inserttest{X601f} \inserttest{X604a} \inserttest{X604b} \inserttest{X610f} diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-testsuite.ltx b/Master/texmf-dist/source/latex/unicode-math/unicode-math-testsuite.ltx index e6e0d845bd8..0744cfbc4ec 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math-testsuite.ltx +++ b/Master/texmf-dist/source/latex/unicode-math/unicode-math-testsuite.ltx @@ -37,6 +37,8 @@ When the test suite is run, the new output is compared pixel by pixel with that \section{Test files for both engines} +Only the Lua\LaTeX\ output is shown; there will be (usually only) negligible differences between the outout between the two engines. + \input{umtest-suite-F.tex} \def\prefix{} diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx b/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx index b6121b84d02..458c3203f4f 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx @@ -35,7 +35,13 @@ This work is "author-maintained" by Will Robertson. \generate{\file{unicode-math.sty}{ \from{unicode-math.dtx}{preamble} \from{unicode-math.dtx}{msg} - \from{unicode-math.dtx}{package,stix} + \from{unicode-math.dtx}{load} +}} +\generate{\file{unicode-math-xetex.sty}{ + \from{unicode-math.dtx}{package,XE} +}} +\generate{\file{unicode-math-luatex.sty}{ + \from{unicode-math.dtx}{package,LU} }} \def\MetaPrefix{--} \usepreamble\luapreamble @@ -48,9 +54,11 @@ This work is "author-maintained" by Will Robertson. \endgroup \ProvidesFile{unicode-math.dtx} %</internal> -%<preamble>\ProvidesPackage{unicode-math} +%<preamble&!XE&!LU>\ProvidesPackage{unicode-math} +%<preamble&XE>\ProvidesPackage{unicode-math-xetex} +%<preamble&LU>\ProvidesPackage{unicode-math-luatex} %<*preamble> - [2011/07/31 v0.5e Unicode maths in XeLaTeX and LuaLaTeX] + [2011/09/18 v0.6 Unicode maths in XeLaTeX and LuaLaTeX] %</preamble> %<*internal> \documentclass[a4paper]{ltxdoc} @@ -74,27 +82,16 @@ This work is "author-maintained" by Will Robertson. % % \begin{abstract} % \noindent -% \begingroup -% \bfseries -% Warning! This package is experimental and subject to change without regard -% for backwards compatibility. -% Performance issues may be encountered until algorithms are refined. -% \endgroup -% -% (But don't take the warning too seriously, either. -% I hope the package is now ready to use.) -% -% This is the first release of the \pkg{unicode-math} package, which is +% This is the first incarnation of the \pkg{unicode-math} package, which is % intended to be a complete implementation of Unicode % maths for \LaTeX\ using the \XeTeX\ and Lua\TeX\ typesetting engines. -% With this package, changing maths fonts will be as easy as changing -% text fonts --- not that there are many Unicode maths fonts yet. +% With this package, changing maths fonts is as easy as changing +% text fonts --- and there are more and more maths fonts appearing now. % Maths input can also be simplified with Unicode since literal glyphs may be % entered instead of control sequences in your document source. % % The package provides support for both \XeTeX\ and Lua\TeX. The different -% engines provide differing levels of support for Unicode maths, and -% support for Lua\TeX's features in this area is still incomplete. +% engines provide differing levels of support for Unicode maths. % Please let us know of any troubles. % % Alongside this documentation file, you should be able to find a minimal @@ -102,7 +99,7 @@ This work is "author-maintained" by Will Robertson. % `\texttt{unimath-example.ltx}'. It also comes with a separate document, % `\texttt{unimath-symbols.pdf}', % containing a complete listing of mathematical symbols defined by -% \pkg{unicode-math}. +% \pkg{unicode-math}, including comparisons between different fonts. % % Finally, while the STIX fonts may be used with this package, accessing % their alphabets in their `private user area' is not yet supported. @@ -117,6 +114,7 @@ This work is "author-maintained" by Will Robertson. % \tableofcontents % % \newpage +% \part{User documentation} % \section{Introduction} % % This document describes the \pkg{unicode-math} package, which is an @@ -134,9 +132,11 @@ This work is "author-maintained" by Will Robertson. % Microsoft for developing the mathematics extension to OpenType as part of % Microsoft Office~2007; % Jonathan Kew for implementing Unicode math support in \XeTeX; +% Taco Hoekwater for implementing Unicode math support in \LuaTeX; % Barbara Beeton for her prodigious effort compiling the definitive list of Unicode math % glyphs and their \LaTeX\ names (inventing them where necessary), and also -% for her thoughtful replies to my sometimes incessant questions. +% for her thoughtful replies to my sometimes incessant questions; +% Philipp Stephani for extending the package to support \LuaTeX. % Ross Moore and Chris Rowley have provided moral and technical support % from the very early days with great insight into the issues we face trying % to extend and use \TeX\ in the future. @@ -233,10 +233,6 @@ This work is "author-maintained" by Will Robertson. % such symbols is not necessarily going to be consistent; please report % problem areas to me. % -% \LaTeX's concept of math `versions' is not yet supported. The only way to -% get bold maths is to add markup for it all. This is still an area that -% requires investigation. -% % Symbols for maths characters have been inherited from the STIX project and % may change slightly in the long term. We have tried to preserve backwards % compatibility with \LaTeX\ conventions as best as possible; again, please @@ -289,7 +285,7 @@ This work is "author-maintained" by Will Robertson. % where \meta{unicode range} is a comma-separated list of Unicode slots and % ranges such as |{"27D0-"27EB,"27FF,"295B-"297F}|. You may also use the macro % for accessing the glyph, such as \cs{int}, or whole collection of symbols with -% the same math type, such as \cs{mathopen}, or complete math alphabets such as \cs{mathbb}. +% the same math type, such as \cs{mathopen}, or complete math styles such as \cs{mathbb}. % (Only numerical slots, however, can be used in ranged declarations.) % % \paragraph{\XeTeX\ users only} @@ -305,7 +301,7 @@ This work is "author-maintained" by Will Robertson. % Here is the current plan. % \begin{itemize} % \item |[range=\mathbb]| to use the font for `bb' letters only. -% \item |[range=\mathbfsfit/{greek,Greek}]| for Greek lowercase and uppercase only (with |latin|, |Latin|, |num| as well for Latin lower-/upper-case and numbers). +% \item |[range=\mathbfsfit/{greek,Greek}]| for Greek lowercase and uppercase only (also with |latin|, |Latin|, |num| as possible options for Latin lower-/upper-case and numbers, resp.). % \item |[range=\mathsfit->\mathbfsfit]| to map to different output alphabet(s) (which is rather useless right now but will become less useless in the future). % \end{itemize} % @@ -314,7 +310,7 @@ This work is "author-maintained" by Will Robertson. % Therefore, to use an \ascii-encoded fractur font, for example, write % \par{\centering|\setmathfont[range=\mathfrak]{SomeFracturFont}|\par}\noindent % and because the math plane fractur glyphs will be missing, \pkg{unicode-math} will know to use the \ascii\ ones instead. -% If necessary (but why?) this behaviour can be forced with |[range=\mathfrac->\mathup]|. +% If necessary this behaviour can be forced with |[range=\mathfrac->\mathup]|. % % % \subsection{Script and scriptscript fonts/features} @@ -324,13 +320,30 @@ This work is "author-maintained" by Will Robertson. % for scriptsize and scriptscriptsize symbols (the $B$ and $C$, respectively, % in $A_{B_C}$). Other fonts will possibly use entirely separate fonts. % -% Not yet implemented: Both of these options -% must be taken into account. I hope this will be mostly automatic from the -% users' points of view. The |+ssty| feature can be detected and applied -% automatically, and appropriate optical size information embedded in the -% fonts will ensure this latter case. Fine tuning should be possible -% automatically with \pkg{fontspec} options. We might have to wait until -% MnMath, for example, before we really know. +% The features |script-font| and |sscript-font| allow alternate fonts to be +% selected for the script and scriptscript sizes, and |script-features| and +% |sscript-features| to apply different OpenType features to them. +% +% By default |script-features| is defined as |Style=MathScript| and |sscript-features| is |Style=MathScriptScript|. +% These correspond to the two levels of OpenType's |ssty| feature tag. +% If the |(s)script-features| options are specified manually, you must +% additionally specify the |Style| options as above. +% +% +% \subsection{Maths `versions'} +% +% \LaTeX\ uses a concept known as `maths versions' to switch math fonts +% mid-document. +% This is useful because it is more efficient than loading a complete maths +% font from scratch every time---especially with thousands of glyphs in the case of Unicode maths! +% The canonical example for maths versions is to select a `bold' maths font +% which might be suitable for section headings, say. +% (Not everyone agrees with this typesetting choice, though; be careful.) +% +% To select a new maths font in a particular version, use the syntax +% \codeline{\cmd\setmathfont|[version=|\meta{version name}|,|\meta{font features}|]|\marg{font name}} +% and to switch between maths versions mid-document use the standard \LaTeX\ command +% \cmd\mathversion\marg{version name}. % % \section{Maths input} % @@ -346,7 +359,7 @@ This work is "author-maintained" by Will Robertson. % Classically, \TeX\ uses italic lowercase Greek letters and \emph{upright} % uppercase Greek letters for variables in mathematics. This is contrary to % the \textsc{iso} standards of using italic forms for both upper- and lowercase. -% Furthermore, the French (contrary again, \emph{quelle surprise}) have been +% Furthermore, the French have been % known to use upright uppercase \emph{Latin} letters as well as upright % upper- and lowercase Greek. Finally, it is not unknown to use upright letters % for all characters, as seen in the Euler fonts. @@ -354,7 +367,7 @@ This work is "author-maintained" by Will Robertson. % The \pkg{unicode-math} package accommodates these possibilities with an % interface heavily inspired by Walter Schmidt's \pkg{lucimatx} package: a % package option \opt{math-style} that takes one of four arguments: -% \opt{TeX}, \opt{ISO}, \opt{french}, or \opt{upright}. +% \opt{TeX}, \opt{ISO}, \opt{french}, or \opt{upright} (case sensitive). % % The philosophy behind the interface to the mathematical alphabet symbols % lies in \LaTeX's attempt of separating content and formatting. Because input @@ -469,7 +482,7 @@ This work is "author-maintained" by Will Robertson. % But \LaTeX's \cs{mathsf} is \textsl{upright} sans serif. % % Therefore I reluctantly add the package options |[sans-style=upright]| and |[sans-style=italic]| to control the behaviour of \cs{mathsf}. -% The |upright| style sets up the command to use the seemingly-useless upright sans serif, including Greek; +% The |upright| style sets up the command to use upright sans serif, including Greek; % the |italic| style switches to using italic in both Latin and Greek alphabets. % In other words, this option simply changes the meaning of \cs{mathsf} to either \cs{mathsfup} or \cs{mathsfit}, respectively. % Please let me know if more granular control is necessary here. @@ -498,11 +511,11 @@ This work is "author-maintained" by Will Robertson. % This may change in the future. % % \begin{table} -% \caption{Mathematical alphabets defined in Unicode. Black dots indicate an alphabet exists in the font specified; grey dots indicate shapes that should always be taken from the upright font even in the italic style. See main text for description of \cs{mathbbit}.} +% \caption{Mathematical alphabets defined in Unicode. Black dots indicate an alphabet exists in the font specified; blue dots indicate shapes that should always be taken from the upright font even in the italic style. See main text for description of \cs{mathbbit}.} % \tablabel{mathalphabets} % \centering % \def\Y{\textbullet} -% \def\M{\textcolor{gray}{\textbullet}} +% \def\M{\textcolor{blue}{\textbullet}} % \begin{tabular}{@{} lll l ccc @{}} % \toprule % \multicolumn{3}{c}{Font} & & \multicolumn{3}{c}{Alphabet} \\ @@ -810,8 +823,8 @@ This work is "author-maintained" by Will Robertson. % % Of \unichar{2044} {fraction slash}, TR25 says that it is: % \begin{quote} -% \dots used to build up simple fractions in running text\dots -% however parsers of mathematical texts should be prepared to handle fraction slash +% \dots used to build up simple fractions in running text\dots +% however parsers of mathematical texts should be prepared to handle fraction slash % when it is received from other sources. % \end{quote} % @@ -823,7 +836,7 @@ This work is "author-maintained" by Will Robertson. % \paragraph{Backslash} % % The \unichar{005C} {reverse solidus} character \cs{backslash} is used for denoting -% double cosets: $A\backslash B$. (So I'm led to believe.) +% double cosets: $A\backslash B$. (So I'm led to believe.) % It may be used as a `stretchy' delimiter if supported by the font. % % MathML uses \unichar{2216} {set minus} like this: $A\smallsetminus B$.\footnote{\S4.4.5.11 \url{http://www.w3.org/TR/MathML3/}} @@ -1007,14 +1020,35 @@ This work is "author-maintained" by Will Robertson. % (Not yet implemented.) % \fi % +% \subsubsection{Programmer's interface} +% +% (Tentative and under construction.) +% If you are writing some code that needs to know the current +% maths style (\cs{mathbf}, \cs{mathit}, etc.), you can query the +% variable \cs{l_um_mathstyle_tl}. It will contain the maths style +% without the leading `math' string; for example, +% |\mathbf { \show \l_um_mathstyle_tl }| +% will produce `bf'. % % \StopEventually{} % -% \part{The \pkg{unicode-math} package} +% \part{Package implementation} % -%<*preamble> +% We (later on) bifurcate the package based on the engine being used. +% \begin{macrocode} +%<*load> +\luatex_if_engine:T { \usepackage{unicode-math-luatex} \endinput } +\xetex_if_engine:T { \usepackage{unicode-math-xetex} \endinput } +%</load> +% \end{macrocode} +% +% \section{Header code} % -% \section{Things we need} +% The shared part of the code starts here before the split mentioned above. +% +% \begin{macrocode} +%<*preamble&!XE&!LU> +% \end{macrocode} % % \begin{macrocode} \usepackage{ifxetex,ifluatex} @@ -1028,12 +1062,11 @@ This work is "author-maintained" by Will Robertson. % % \paragraph{Packages} % \begin{macrocode} -\RequirePackage{expl3}[2009/08/12] +\RequirePackage{expl3}[2011/07/01] \RequirePackage{xparse}[2009/08/31] \RequirePackage{l3keys2e} \RequirePackage{fontspec}[2010/10/25] \RequirePackage{catchfile} -\RequirePackage{trimspaces}% I'd like to incorporate this into expl3... \RequirePackage{fix-cm} % avoid some warnings \RequirePackage{filehook}[2011/01/03] % \end{macrocode} @@ -1043,20 +1076,6 @@ This work is "author-maintained" by Will Robertson. \ExplSyntaxOn % \end{macrocode} % -% \paragraph{Forwards compatibility} -% \begin{macrocode} -\cs_if_exist:NF \char_set_catcode_other:N - { - \cs_set_eq:NN \c_math_toggle_token \c_math_shift_token - \cs_set_eq:NN \char_set_catcode_other:N \char_make_other:N - \cs_set_eq:NN \char_set_catcode_active:N \char_make_active:N - \cs_set_eq:NN \char_set_catcode_active:n \char_make_active:n - \cs_set_eq:NN \char_set_catcode_escape:N \char_make_escape:N - \cs_set_eq:NN \char_set_catcode_math_superscript:N - \char_make_math_superscript:N - } -% \end{macrocode} -% % \paragraph{Extra \pkg{expl3} variants} % \begin{macrocode} \cs_generate_variant:Nn \tl_put_right:Nn {cx} @@ -1072,20 +1091,23 @@ This work is "author-maintained" by Will Robertson. \cs:w #3 \exp_after:wN \cs_end: \cs:w #4 \cs_end: } -\cs_new_protected_nopar:Npn \bool_const:Nn #1 #2 { - \bool_new:N #1 - \bool_set:Nn #1 { #2 } -} +% \end{macrocode} +% +% For for old command in lualatex-math: (Sept 2011) +% \begin{macrocode} +\cs_set_eq:NN \tl_replace_in:Nnn \tl_replace_once:Nnn % \end{macrocode} % % % \paragraph{Conditionals} -% Engine capabilities: +% % \begin{macrocode} -\bool_const:Nn \c_um_have_fixed_accents_bool { - \c_luatex_is_engine_bool && \int_compare_p:n { \luatexversion > 64 } +\cs_new_protected_nopar:Npn \bool_const:Nn #1 #2 { + \bool_new:N #1 + \bool_set:Nn #1 { #2 } } % \end{macrocode} +% % \begin{macrocode} \bool_new:N \l_um_ot_math_bool \bool_new:N \l_um_init_bool @@ -1120,7 +1142,7 @@ This work is "author-maintained" by Will Robertson. \bool_new:N \g_um_literal_Nabla_bool \bool_new:N \g_um_literal_partial_bool \bool_new:N \g_um_texgreek_bool -\bool_gset_true:N \g_um_texgreek_bool +\bool_set_true:N \g_um_texgreek_bool \bool_new:N \l_um_smallfrac_bool \bool_new:N \g_um_literal_colon_bool % \end{macrocode} @@ -1131,12 +1153,12 @@ This work is "author-maintained" by Will Robertson. % \end{macrocode} % % \begin{macrocode} -\tl_set:Nn \g_um_math_alphabet_name_latin_tl {Latin,~lowercase} -\tl_set:Nn \g_um_math_alphabet_name_Latin_tl {Latin,~uppercase} -\tl_set:Nn \g_um_math_alphabet_name_greek_tl {Greek,~lowercase} -\tl_set:Nn \g_um_math_alphabet_name_Greek_tl {Greek,~uppercase} -\tl_set:Nn \g_um_math_alphabet_name_num_tl {Numerals} -\tl_set:Nn \g_um_math_alphabet_name_misc_tl {Misc.} +\tl_const:Nn \c_um_math_alphabet_name_latin_tl {Latin,~lowercase} +\tl_const:Nn \c_um_math_alphabet_name_Latin_tl {Latin,~uppercase} +\tl_const:Nn \c_um_math_alphabet_name_greek_tl {Greek,~lowercase} +\tl_const:Nn \c_um_math_alphabet_name_Greek_tl {Greek,~uppercase} +\tl_const:Nn \c_um_math_alphabet_name_num_tl {Numerals} +\tl_const:Nn \c_um_math_alphabet_name_misc_tl {Misc.} % \end{macrocode} % % \subsection{Extras} @@ -1158,41 +1180,284 @@ This work is "author-maintained" by Will Robertson. % \end{macrocode} % \end{macro} % -% \subsection{Compatibility with Lua\TeX} +% \subsection{Function variants} % % \begin{macrocode} -\xetex_or_luatex:nnn { \cs_new:Npn \um_cs_compat:n #1 } - { \cs_set_eq:cc {U#1} {XeTeX#1} } - { \cs_set_eq:cc {U#1} {luatexU#1} } -\um_cs_compat:n {mathcode} -\um_cs_compat:n {delcode} -\um_cs_compat:n {mathcodenum} -\um_cs_compat:n {mathcharnum} -\um_cs_compat:n {mathchardef} -\um_cs_compat:n {radical} -\um_cs_compat:n {mathaccent} -\um_cs_compat:n {delimiter} -\luatex_if_engine:T { - \RequirePackage { lualatex-math } [ 2011/05/05 ] +\cs_generate_variant:Nn \fontspec_set_family:Nnn {Nx} +\cs_generate_variant:Nn \fontspec_set_fontface:NNnn {NNx} +% \end{macrocode} +% +% \subsection{Package options} +% +% \begin{macro}{\unimathsetup} +% This macro can be used in lieu of or later to override +% options declared when the package is loaded. +% \begin{macrocode} +\DeclareDocumentCommand \unimathsetup {m} { + \keys_set:nn {unicode-math} {#1} +} +% \end{macrocode} +% \end{macro} +% +% +% \paragraph{math-style} +% \begin{macrocode} +\keys_define:nn {unicode-math} { + normal-style .choice_code:n = + { + \bool_set_false:N \g_um_literal_bool + \ifcase \l_keys_choice_int + \bool_set_false:N \g_um_upGreek_bool + \bool_set_false:N \g_um_upgreek_bool + \bool_set_false:N \g_um_upLatin_bool + \bool_set_false:N \g_um_uplatin_bool + \or + \bool_set_true:N \g_um_upGreek_bool + \bool_set_false:N \g_um_upgreek_bool + \bool_set_false:N \g_um_upLatin_bool + \bool_set_false:N \g_um_uplatin_bool + \or + \bool_set_true:N \g_um_upGreek_bool + \bool_set_true:N \g_um_upgreek_bool + \bool_set_true:N \g_um_upLatin_bool + \bool_set_false:N \g_um_uplatin_bool + \or + \bool_set_true:N \g_um_upGreek_bool + \bool_set_true:N \g_um_upgreek_bool + \bool_set_true:N \g_um_upLatin_bool + \bool_set_true:N \g_um_uplatin_bool + \or + \bool_set_true:N \g_um_literal_bool + \fi + } , + normal-style .generate_choices:n = {ISO,TeX,french,upright,literal} , +} +% \end{macrocode} +% +% \begin{macrocode} +\keys_define:nn {unicode-math} { + math-style .choice_code:n = + { + \ifcase \l_keys_choice_int + \unimathsetup { + normal-style=ISO, + bold-style=ISO, + sans-style=italic, + nabla=upright, + partial=italic, + } + \or + \unimathsetup { + normal-style=TeX, + bold-style=TeX, + sans-style=upright, + nabla=upright, + partial=italic, + } + \or + \unimathsetup { + normal-style=french, + bold-style=upright, + sans-style=upright, + nabla=upright, + partial=upright, + } + \or + \unimathsetup { + normal-style=upright, + bold-style=upright, + sans-style=upright, + nabla=upright, + partial=upright, + } + \or + \unimathsetup { + normal-style=literal, + bold-style=literal, + sans-style=literal, + colon=literal, + nabla=literal, + partial=literal, + } + \fi + } , + math-style .generate_choices:n = {ISO,TeX,french,upright,literal} , +} +% \end{macrocode} +% +% \paragraph{bold-style} +% \begin{macrocode} +\keys_define:nn {unicode-math} { + bold-style .choice_code:n = { + \bool_set_false:N \g_um_bfliteral_bool + \ifcase \l_keys_choice_int + \bool_set_false:N \g_um_bfupGreek_bool + \bool_set_false:N \g_um_bfupgreek_bool + \bool_set_false:N \g_um_bfupLatin_bool + \bool_set_false:N \g_um_bfuplatin_bool + \or + \bool_set_true:N \g_um_bfupGreek_bool + \bool_set_false:N \g_um_bfupgreek_bool + \bool_set_true:N \g_um_bfupLatin_bool + \bool_set_true:N \g_um_bfuplatin_bool + \or + \bool_set_true:N \g_um_bfupGreek_bool + \bool_set_true:N \g_um_bfupgreek_bool + \bool_set_true:N \g_um_bfupLatin_bool + \bool_set_true:N \g_um_bfuplatin_bool + \or + \bool_set_true:N \g_um_bfliteral_bool + \fi + } , + bold-style .generate_choices:n = {ISO,TeX,upright,literal} , +} +% \end{macrocode} +% +% \paragraph{sans-style} +% \begin{macrocode} +\keys_define:nn {unicode-math} { + sans-style .choice_code:n = { + \ifcase \l_keys_choice_int + \bool_set_false:N \g_um_upsans_bool + \or + \bool_set_true:N \g_um_upsans_bool + \or + \bool_set_true:N \g_um_sfliteral_bool + \fi + } , + sans-style .generate_choices:n = {italic,upright,literal} , } % \end{macrocode} % -% \subsubsection{Function variants} % +% \paragraph{Nabla and partial} % \begin{macrocode} -\cs_generate_variant:Nn \fontspec_select:nn {x} +\keys_define:nn {unicode-math} { + nabla .choice_code:n = { + \bool_set_false:N \g_um_literal_Nabla_bool + \ifcase \l_keys_choice_int + \bool_set_true:N \g_um_upNabla_bool + \or + \bool_set_false:N \g_um_upNabla_bool + \or + \bool_set_true:N \g_um_literal_Nabla_bool + \fi + } , + nabla .generate_choices:n = {upright,italic,literal} , +} % \end{macrocode} % -% \subsubsection{\Hologo{LuaLaTeX} module} +% \begin{macrocode} +\keys_define:nn {unicode-math} { + partial .choice_code:n = { + \bool_set_false:N \g_um_literal_partial_bool + \ifcase \l_keys_choice_int + \bool_set_true:N \g_um_uppartial_bool + \or + \bool_set_false:N \g_um_uppartial_bool + \or + \bool_set_true:N \g_um_literal_partial_bool + \fi + } , + partial .generate_choices:n = {upright,italic,literal} , +} +% \end{macrocode} % -% We create a \pkg{luatexbase} module that contains Lua functions for use with \hologo{LuaLaTeX}. +% \paragraph{Epsilon and phi shapes} % \begin{macrocode} -\luatex_if_engine:T { - \RequirePackage { luatexbase } - \RequirePackage { luaotfload } [ 2010/11/26 ] - \RequireLuaModule { unicode-math } [ 2011/04/23 ] +\keys_define:nn {unicode-math} { + vargreek-shape .choice: , + vargreek-shape / unicode .code:n = { + \bool_set_false:N \g_um_texgreek_bool + } , + vargreek-shape / TeX .code:n = { + \bool_set_true:N \g_um_texgreek_bool + } } -%</preamble> +% \end{macrocode} +% +% \paragraph{Colon style} +% \begin{macrocode} +\keys_define:nn {unicode-math} { + colon .choice: , + colon / literal .code:n = { + \bool_set_true:N \g_um_literal_colon_bool + } , + colon / TeX .code:n = { + \bool_set_false:N \g_um_literal_colon_bool + } +} +% \end{macrocode} +% +% \paragraph{Slash delimiter style} +% \begin{macrocode} +\keys_define:nn {unicode-math} { + slash-delimiter .choice: , + slash-delimiter / ascii .code:n = { + \tl_set:Nn \g_um_slash_delimiter_usv {"002F} + } , + slash-delimiter / frac .code:n = { + \tl_set:Nn \g_um_slash_delimiter_usv {"2044} + } , + slash-delimiter / div .code:n = { + \tl_set:Nn \g_um_slash_delimiter_usv {"2215} + } +} +% \end{macrocode} +% +% +% \paragraph{Active fraction style} +% \begin{macrocode} +\keys_define:nn {unicode-math} { + active-frac .choice: , + active-frac / small .code:n = { + \cs_if_exist:NTF \tfrac { + \bool_set_true:N \l_um_smallfrac_bool + }{ + \um_warning:n {no-tfrac} + \bool_set_false:N \l_um_smallfrac_bool + } + \use:c{um_setup_active_frac:} + } , + active-frac / normalsize .code:n = { + \bool_set_false:N \l_um_smallfrac_bool + \use:c{um_setup_active_frac:} + } +} +% \end{macrocode} +% +% \paragraph{Debug/tracing} +% \begin{macrocode} +\keys_define:nn {unicode-math} { + trace .choice: , + trace / debug .code:n = { + \msg_redirect_module:nnn { unicode-math } { log } { warning } + } , + trace / on .code:n = { + % default + } , + trace / off .code:n = { + \msg_redirect_module:nnn { unicode-math } { log } { none } + } , +} +% \end{macrocode} +% +% \begin{macrocode} +\unimathsetup {math-style=TeX} +\unimathsetup {slash-delimiter=ascii} +\unimathsetup {trace=off} +\cs_if_exist:NT \tfrac { + \unimathsetup {active-frac=small} +} +\ProcessKeysOptions {unicode-math} +% \end{macrocode} +% +% +% \section{\Hologo{LuaLaTeX} module} +% +% We create a \pkg{luatexbase} module that contains Lua functions for use with \hologo{LuaLaTeX}. +% \begin{macrocode} +%</preamble&!XE&!LU> %<*lua> local err, warn, info, log = luatexbase.provides_module({ name = "unicode-math", @@ -1222,8 +1487,46 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % (Error messages and warning definitions go here from the |msg| chunk % defined in \secref[vref]{codemsg}.) % +% \section{Bifurcation} +% And here the split begins. Most of the code is still shared, but +% code for \LuaTeX\ uses the `LU' prefix and code for \XeTeX\ uses `XE'. +% +% \begin{macrocode} +%<*package&(XE|LU)> +\ExplSyntaxOn +% \end{macrocode} +% +% \subsection{Engine differences} +% +% \begin{macrocode} +\cs_new:Nn \um_cs_compat:n +%<XE> { \cs_set_eq:cc {U#1} {XeTeX#1} } +%<LU> { \cs_set_eq:cc {U#1} {luatexU#1} } +\um_cs_compat:n {mathcode} +\um_cs_compat:n {delcode} +\um_cs_compat:n {mathcodenum} +\um_cs_compat:n {mathcharnum} +\um_cs_compat:n {mathchardef} +\um_cs_compat:n {radical} +\um_cs_compat:n {mathaccent} +\um_cs_compat:n {delimiter} +% \end{macrocode} +% % \begin{macrocode} -%<*package> +%<XE>\bool_set_false:N \c_um_have_fixed_accents_bool +%<*LU> +\bool_const:Nn \c_um_have_fixed_accents_bool + { \int_compare_p:n { \luatexversion > 64 } } +%</LU> +% \end{macrocode} +% +% \begin{macrocode} +%<*LU> +\RequirePackage { lualatex-math } [ 2011/08/07 ] +\RequirePackage { luatexbase } +\RequirePackage { luaotfload } [ 2010/11/26 ] +\RequireLuaModule { unicode-math } [ 2011/04/23 ] +%</LU> % \end{macrocode} % % \subsection{Alphabet Unicode positions} @@ -1234,10 +1537,10 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % % Rather than `readable', in the end, this makes the code more extensible. % \begin{macrocode} -\cs_new:Npn \usv_set:nnn #1#2#3 { +\cs_new:Nn \usv_set:nnn { \tl_set:cn { \um_to_usv:nn {#1}{#2} } {#3} } -\cs_new:Npn \um_to_usv:nn #1#2 { g_um_#1_#2_usv } +\cs_new:Nn \um_to_usv:nn { g_um_#1_#2_usv } % \end{macrocode} % \paragraph{Alphabets} % \begin{macrocode} @@ -1548,7 +1851,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % But we still want to be able to use them if possible. % % \begin{macrocode} -%</package> +%</package&(XE|LU)> %<*stix> % \end{macrocode} % @@ -1776,284 +2079,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % % \begin{macrocode} %</stix> -%<*package> -% \end{macrocode} -% -% \subsection{Package options} -% -% \begin{macro}{\unimathsetup} -% This macro can be used in lieu of or later to override -% options declared when the package is loaded. -% \begin{macrocode} -\DeclareDocumentCommand \unimathsetup {m} { - \clist_clear:N \l_um_unknown_keys_clist - \keys_set:nn {unicode-math} {#1} -} -% \end{macrocode} -% \end{macro} -% -% -% \paragraph{math-style} -% \begin{macrocode} -\keys_define:nn {unicode-math} { - normal-style .choice_code:n = - { - \bool_set_false:N \g_um_literal_bool - \ifcase \l_keys_choice_int - \bool_set_false:N \g_um_upGreek_bool - \bool_set_false:N \g_um_upgreek_bool - \bool_set_false:N \g_um_upLatin_bool - \bool_set_false:N \g_um_uplatin_bool - \or - \bool_set_true:N \g_um_upGreek_bool - \bool_set_false:N \g_um_upgreek_bool - \bool_set_false:N \g_um_upLatin_bool - \bool_set_false:N \g_um_uplatin_bool - \or - \bool_set_true:N \g_um_upGreek_bool - \bool_set_true:N \g_um_upgreek_bool - \bool_set_true:N \g_um_upLatin_bool - \bool_set_false:N \g_um_uplatin_bool - \or - \bool_set_true:N \g_um_upGreek_bool - \bool_set_true:N \g_um_upgreek_bool - \bool_set_true:N \g_um_upLatin_bool - \bool_set_true:N \g_um_uplatin_bool - \or - \bool_set_true:N \g_um_literal_bool - \fi - } , - normal-style .generate_choices:n = {ISO,TeX,french,upright,literal} , -} -% \end{macrocode} -% -% \begin{macrocode} -\keys_define:nn {unicode-math} { - math-style .choice_code:n = - { - \ifcase \l_keys_choice_int - \unimathsetup { - normal-style=ISO, - bold-style=ISO, - sans-style=italic, - nabla=upright, - partial=italic, - } - \or - \unimathsetup { - normal-style=TeX, - bold-style=TeX, - sans-style=upright, - nabla=upright, - partial=italic, - } - \or - \unimathsetup { - normal-style=french, - bold-style=upright, - sans-style=upright, - nabla=upright, - partial=upright, - } - \or - \unimathsetup { - normal-style=upright, - bold-style=upright, - sans-style=upright, - nabla=upright, - partial=upright, - } - \or - \unimathsetup { - normal-style=literal, - bold-style=literal, - sans-style=literal, - colon=literal, - nabla=literal, - partial=literal, - } - \fi - } , - math-style .generate_choices:n = {ISO,TeX,french,upright,literal} , -} -% \end{macrocode} -% -% \paragraph{bold-style} -% \begin{macrocode} -\keys_define:nn {unicode-math} { - bold-style .choice_code:n = { - \bool_set_false:N \g_um_bfliteral_bool - \ifcase \l_keys_choice_int - \bool_set_false:N \g_um_bfupGreek_bool - \bool_set_false:N \g_um_bfupgreek_bool - \bool_set_false:N \g_um_bfupLatin_bool - \bool_set_false:N \g_um_bfuplatin_bool - \or - \bool_set_true:N \g_um_bfupGreek_bool - \bool_set_false:N \g_um_bfupgreek_bool - \bool_set_true:N \g_um_bfupLatin_bool - \bool_set_true:N \g_um_bfuplatin_bool - \or - \bool_set_true:N \g_um_bfupGreek_bool - \bool_set_true:N \g_um_bfupgreek_bool - \bool_set_true:N \g_um_bfupLatin_bool - \bool_set_true:N \g_um_bfuplatin_bool - \or - \bool_set_true:N \g_um_bfliteral_bool - \fi - } , - bold-style .generate_choices:n = {ISO,TeX,upright,literal} , -} -% \end{macrocode} -% -% \paragraph{sans-style} -% \begin{macrocode} -\keys_define:nn {unicode-math} { - sans-style .choice_code:n = { - \ifcase \l_keys_choice_int - \bool_set_false:N \g_um_upsans_bool - \or - \bool_set_true:N \g_um_upsans_bool - \or - \bool_set_true:N \g_um_sfliteral_bool - \fi - } , - sans-style .generate_choices:n = {italic,upright,literal} , -} -% \end{macrocode} -% -% -% \paragraph{Nabla and partial} -% \begin{macrocode} -\keys_define:nn {unicode-math} { - nabla .choice_code:n = { - \bool_set_false:N \g_um_literal_Nabla_bool - \ifcase \l_keys_choice_int - \bool_set_true:N \g_um_upNabla_bool - \or - \bool_set_false:N \g_um_upNabla_bool - \or - \bool_set_true:N \g_um_literal_Nabla_bool - \fi - } , - nabla .generate_choices:n = {upright,italic,literal} , -} -% \end{macrocode} -% -% \begin{macrocode} -\keys_define:nn {unicode-math} { - partial .choice_code:n = { - \bool_set_false:N \g_um_literal_partial_bool - \ifcase \l_keys_choice_int - \bool_set_true:N \g_um_uppartial_bool - \or - \bool_set_false:N \g_um_uppartial_bool - \or - \bool_set_true:N \g_um_literal_partial_bool - \fi - } , - partial .generate_choices:n = {upright,italic,literal} , -} -% \end{macrocode} -% -% \paragraph{Epsilon and phi shapes} -% \begin{macrocode} -\keys_define:nn {unicode-math} { - vargreek-shape .choice: , - vargreek-shape / unicode .code:n = { - \bool_set_false:N \g_um_texgreek_bool - } , - vargreek-shape / TeX .code:n = { - \bool_set_true:N \g_um_texgreek_bool - } -} -% \end{macrocode} -% -% \paragraph{Colon style} -% \begin{macrocode} -\keys_define:nn {unicode-math} { - colon .choice: , - colon / literal .code:n = { - \bool_set_true:N \g_um_literal_colon_bool - } , - colon / TeX .code:n = { - \bool_set_false:N \g_um_literal_colon_bool - } -} -% \end{macrocode} -% -% \paragraph{Slash delimiter style} -% \begin{macrocode} -\keys_define:nn {unicode-math} { - slash-delimiter .choice: , - slash-delimiter / ascii .code:n = { - \tl_set:Nn \g_um_slash_delimiter_usv {"002F} - } , - slash-delimiter / frac .code:n = { - \tl_set:Nn \g_um_slash_delimiter_usv {"2044} - } , - slash-delimiter / div .code:n = { - \tl_set:Nn \g_um_slash_delimiter_usv {"2215} - } -} -% \end{macrocode} -% -% -% \paragraph{Active fraction style} -% \begin{macrocode} -\keys_define:nn {unicode-math} { - active-frac .choice: , - active-frac / small .code:n = { - \cs_if_exist:NTF \tfrac { - \bool_set_true:N \l_um_smallfrac_bool - }{ - \um_warning:n {no-tfrac} - \bool_set_false:N \l_um_smallfrac_bool - } - \use:c{um_setup_active_frac:} - } , - active-frac / normalsize .code:n = { - \bool_set_false:N \l_um_smallfrac_bool - \use:c{um_setup_active_frac:} - } -} -% \end{macrocode} -% -% \paragraph{Debug/tracing} -% \begin{macrocode} -\keys_define:nn {unicode-math} { - trace .choice: , - trace / debug .code:n = { - \msg_redirect_module:nnn { unicode-math } { trace } { warning } - } , - trace / on .code:n = { - \msg_redirect_module:nnn { unicode-math } { trace } { trace } - } , - trace / off .code:n = { - \msg_redirect_module:nnn { unicode-math } { trace } { none } - } , -} -% \end{macrocode} -% -% \begin{macrocode} -\clist_new:N \l_um_unknown_keys_clist -\keys_define:nn {unicode-math} { - unknown .code:n = { - \clist_put_right:No \l_um_unknown_keys_clist { - \l_keys_key_tl = {#1} - } - } -} -% \end{macrocode} -% -% \begin{macrocode} -\unimathsetup {math-style=TeX} -\unimathsetup {slash-delimiter=ascii} -\unimathsetup {trace=off} -\cs_if_exist:NT \tfrac { - \unimathsetup {active-frac=small} -} -\ProcessKeysOptions {unicode-math} +%<*package&(XE|LU)> % \end{macrocode} % % \subsection{Overcoming \cmd\@onlypreamble} @@ -2075,7 +2101,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \set@@mathdelimiter\DeclareMathRadical\mathchar@type \DeclareSymbolFontAlphabet\DeclareSymbolFontAlphabet@ }{ - \tl_remove_in:Nn \@preamblecmds {\do#1} + \tl_remove_once:Nn \@preamblecmds {\do#1} } % \end{macrocode} % @@ -2085,12 +2111,14 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % % To start with, we've got a power of two as many \cmd\fam s as before. So (from |ltfssbas.dtx|) we want to redefine % \begin{macrocode} +%<*XE> \def\new@mathgroup{\alloc@8\mathgroup\chardef\@cclvi} \let\newfam\new@mathgroup +%</XE> % \end{macrocode} -% % This is sufficient for \LaTeX's \cmd\DeclareSymbolFont-type commands to be able % to define 256 named maths fonts. +% For \hologo{LuaLaTeX}, this is handled by the \pkg{lualatex-math} package. % % \subsection{Setting math chars, math codes, etc.} % @@ -2102,41 +2130,54 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % There are a bunch of tests to perform to process the various characters. % The following assignments should all be fairly straightforward. % \begin{macrocode} -\cs_set:Npn \um_set_mathsymbol:nNNn #1#2#3#4 { +\cs_set:Nn \um_set_mathsymbol:nNNn { \prg_case_tl:Nnn #3 { - \mathop { - \um_set_big_operator:nnn {#1} {#2} {#4} - } - \mathopen { - \tl_if_in:NnTF \l_um_radicals_tl {#2} { - \cs_gset_protected_nopar:cpx {\cs_to_str:N #2 sign} { \um_radical:nn {#1} {#4} } - \tl_set:cn {l_um_radical_\cs_to_str:N #2_tl} {\use:c{sym #1}~ #4} - }{ + \mathop { \um_set_big_operator:nnn {#1} {#2} {#4} } + \mathopen + { + \tl_if_in:NnTF \l_um_radicals_tl {#2} + { + \cs_gset_protected_nopar:cpx {\cs_to_str:N #2 sign} + { \um_radical:nn {#1} {#4} } + \tl_set:cn {l_um_radical_\cs_to_str:N #2_tl} {\use:c{sym #1}~ #4} + } + { + \um_set_delcode:nnn {#1} {#4} {#4} + \um_set_mathcode:nnn {#4} \mathopen {#1} + \cs_gset_protected_nopar:Npx #2 + { \um_delimiter:Nnn \mathopen {#1} {#4} } + } + } + \mathclose + { \um_set_delcode:nnn {#1} {#4} {#4} - \um_set_mathcode:nnn {#4} \mathopen {#1} - \cs_gset_protected_nopar:Npx #2 { \um_delimiter:Nnn \mathopen {#1} {#4} } + \um_set_mathcode:nnn {#4} \mathclose {#1} + \cs_gset_protected_nopar:Npx #2 + { \um_delimiter:Nnn \mathclose {#1} {#4} } } - } - \mathclose { - \um_set_delcode:nnn {#1} {#4} {#4} - \um_set_mathcode:nnn {#4} \mathclose {#1} - \cs_gset_protected_nopar:Npx #2 { \um_delimiter:Nnn \mathclose {#1} {#4} } - } - \mathaccent { - \cs_gset_protected_nopar:Npx #2 { \um_accent:Nnn #3 {#1} {#4} } - } - \mathfence { - \um_set_mathcode:nnn {#4} {#3} {#1} - \um_set_delcode:nnn {#1} {#4} {#4} - \cs_gset_protected_nopar:cpx {l \cs_to_str:N #2} { \um_delimiter:Nnn \mathopen {#1} {#4} } - \cs_gset_protected_nopar:cpx {r \cs_to_str:N #2} { \um_delimiter:Nnn \mathclose {#1} {#4} } - } - \mathover { % LuaTeX only - \cs_set_protected_nopar:Npn #2 ##1 { \mathop { \um_overbrace:nnn {#1} {#4} {##1} } \limits } - } - \mathunder { % LuaTeX only - \cs_set_protected_nopar:Npn #2 ##1 { \mathop { \um_underbrace:nnn {#1} {#4} {##1} } \limits } - } + \mathaccent + { \cs_gset_protected_nopar:Npx #2 { \um_accent:Nnn #3 {#1} {#4} } } + \mathfence + { + \um_set_mathcode:nnn {#4} {#3} {#1} + \um_set_delcode:nnn {#1} {#4} {#4} + \cs_gset_protected_nopar:cpx {l \cs_to_str:N #2} + { \um_delimiter:Nnn \mathopen {#1} {#4} } + \cs_gset_protected_nopar:cpx {r \cs_to_str:N #2} + { \um_delimiter:Nnn \mathclose {#1} {#4} } + } +%<*LU> + \mathover + { + \cs_set_protected_nopar:Npx #2 ##1 + { \mathop { \um_overbrace:nnn {#1} {#4} {##1} } \limits } + } + \mathunder + { + \cs_set_protected_nopar:Npx #2 ##1 + { \mathop { \um_underbrace:nnn {#1} {#4} {##1} } \limits } + } +%</LU> }{ \um_set_mathcode:nnn {#4} {#3} {#1} } @@ -2179,7 +2220,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % (~\cs{int} $\to$~) $\int$ $\to$ \cs{int_sym} $\to$ \cs{intop} % \end{quote} % \begin{macrocode} -\cs_new:Npn \um_set_big_operator:nnn #1#2#3 { +\cs_new:Nn \um_set_big_operator:nnn { \group_begin: \char_set_catcode_active:n {#3} \char_gmake_mathactive:n {#3} @@ -2221,21 +2262,28 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \Umathchardef #1 = \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#4} \scan_stop: } -\cs_new:Npn \um_set_delcode:nnn #1#2#3 { +\cs_new:Nn \um_set_delcode:nnn { \Udelcode#2 = \csname sym#1\endcsname #3 } -\cs_new:Npn \um_radical:nn #1#2 { +\cs_new:Nn \um_radical:nn { \Uradical \csname sym#1\endcsname #2 \scan_stop: } -\cs_new:Npn \um_delimiter:Nnn #1#2#3 { +\cs_new:Nn \um_delimiter:Nnn { \Udelimiter \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop: } -\xetex_or_luatex:nnn { \cs_new:Npn \um_accent:Nnn #1#2#3 } { - \Umathaccent \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop: -} { - \Umathaccent \c_um_accent_keyword_tl \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop: -} -\luatex_if_engine:T { +\cs_new:Nn \um_accent:Nnn +%<*XE> + { + \Umathaccent \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop: + } +%</XE> +%<*LU> + { + \Umathaccent \c_um_accent_keyword_tl + \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop: + } +%</LU> +%<*LU> \cs_new_nopar:Npn \um_wide_top_accent:Nnn #1 #2 #3 { \Umathaccent \mathchar@type #1 \use:c { sym #2 } #3 \scan_stop: } @@ -2247,7 +2295,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } { \tl_const:Nn \c_um_accent_keyword_tl { } } -} +%</LU> % \end{macrocode} % % \begin{macrocode} @@ -2285,10 +2333,10 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \begin{macro}{\char_gmake_mathactive:N} % \begin{macro}{\char_gmake_mathactive:n} % \begin{macrocode} -\cs_new:Npn \char_gmake_mathactive:N #1 { +\cs_new:Nn \char_gmake_mathactive:N { \global\mathcode `#1 = "8000 \scan_stop: } -\cs_new:Npn \char_gmake_mathactive:n #1 { +\cs_new:Nn \char_gmake_mathactive:n { \global\mathcode #1 = "8000 \scan_stop: } % \end{macrocode} @@ -2338,7 +2386,8 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \doarg{font features} % \darg{font name} % \begin{macrocode} -\cs_new:Npn \um_init: { +\cs_new:Nn \um_init: { + \bool_set_true:N \l_um_ot_math_bool % \end{macrocode} % \begin{itemize} % \item Erase any conception \LaTeX\ has of previously defined math symbol fonts; @@ -2356,98 +2405,127 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \seq_clear:N \l_um_char_range_seq \clist_clear:N \l_um_char_num_range_clist \seq_clear:N \l_um_mathalph_seq - \clist_clear:N \l_um_unknown_keys_clist \seq_clear:N \l_um_missing_alph_seq % \end{macrocode} +% \item By default use the `normal' math version +% \begin{macrocode} + \tl_set:Nn \l_um_mversion_tl {normal} +% \end{macrocode} +% \item Other range initialisations +% \begin{macrocode} + \tl_set:Nn \um_symfont_tl {operators} + \cs_set_eq:NN \_um_sym:nnn \um_process_symbol_noparse:nnn + \cs_set_eq:NN \um_set_mathalphabet_char:Nnn \um_mathmap_noparse:Nnn + \cs_set_eq:NN \um_remap_symbol:nnn \um_remap_symbol_noparse:nnn + \cs_set_eq:NN \um_maybe_init_alphabet:n \um_init_alphabet:n + \cs_set_eq:NN \um_map_char_single:nn \um_map_char_noparse:nn + \cs_set_eq:NN \um_assign_delcode:nn \um_assign_delcode_noparse:nn + \cs_set_eq:NN \um_make_mathactive:nNN \um_make_mathactive_noparse:nNN +% \end{macrocode} +% \item Define default font features for the script and scriptscript font. +% \begin{macrocode} + \tl_set:Nn \l_um_script_features_tl {Style=MathScript} + \tl_set:Nn \l_um_sscript_features_tl {Style=MathScriptScript} + \tl_set_eq:NN \l_um_script_font_tl \l_um_fontname_tl + \tl_set_eq:NN \l_um_sscript_font_tl \l_um_fontname_tl +% \end{macrocode} % \end{itemize} % \begin{macrocode} } \DeclareDocumentCommand \setmathfont { O{} m } { + \tl_set:Nn \l_um_fontname_tl {#2} \um_init: % \end{macrocode} -% \begin{itemize} -% \item Grab the current size information +% Grab the current size information: % (is this robust enough? Maybe it should be preceded by \cmd\normalsize). +% The macro \cmd\S@\meta{size} +% contains the definitions of the sizes used for maths letters, subscripts and subsubscripts in +% \cmd\tf@size, \cmd\sf@size, and \cmd\ssf@size, respectively. % \begin{macrocode} \cs_if_exist:cF { S@ \f@size } { \calculate@math@sizes } \csname S@\f@size\endcsname % \end{macrocode} -% \item Set the name of the math version being defined. -% (obviously more needs to be done here!) -% \end{itemize} +% Parse options and tell people what's going on: % \begin{macrocode} - \tl_set:Nn \l_um_mversion_tf {normal} - \DeclareMathVersion{\l_um_mversion_tf} + \keys_set_known:nnN {unicode-math} {#1} \l_um_unknown_keys_clist + \bool_if:NT \l_um_init_bool { \um_log:n {default-math-font} } % \end{macrocode} -% \item Define default font features for the script and scriptscript font. +% Use \pkg{fontspec} to select a font to use. % \begin{macrocode} - \tl_set:Nn \l_um_script_features_tl {ScriptStyle} - \tl_set:Nn \l_um_sscript_features_tl {ScriptScriptStyle} - \tl_set:Nn \l_um_script_font_tl {#2} - \tl_set:Nn \l_um_sscript_font_tl {#2} + \um_fontspec_select_font: % \end{macrocode} -% Use \pkg{fontspec} to select a font to use. The macro \cmd\S@\meta{size} -% contains the definitions of the sizes used for maths letters, subscripts and subsubscripts in -% \cmd\tf@size, \cmd\sf@size, and \cmd\ssf@size, respectively. +% Now define |\um_symfont_tl| as the \LaTeX\ math font to access everything: % \begin{macrocode} - \keys_set:nn {unicode-math} {#1} - \um_fontspec_select_font:n {#2} + \cs_if_exist:cF { sym \um_symfont_tl } + { + \DeclareSymbolFont{\um_symfont_tl} + {\encodingdefault}{\l_um_family_tl}{\mddefault}{\updefault} + } + \SetSymbolFont{\um_symfont_tl}{\l_um_mversion_tl} + {\encodingdefault}{\l_um_family_tl}{\mddefault}{\updefault} % \end{macrocode} -% Check whether we're using a real maths font: +% Declare the math sizes (i.e., scaling of superscripts) for the specific +% values for this font, +% and set defaults for math fams two and three for legacy compatibility: % \begin{macrocode} - \group_begin: - \fontfamily{\zf@family}\selectfont - \fontspec_if_script:nTF {math} - {\bool_gset_true:N \l_um_ot_math_bool} - {\bool_gset_false:N \l_um_ot_math_bool} - \group_end: + \bool_if:nT {\l_um_ot_math_bool && !\g_um_mainfont_already_set_bool} { + \bool_set_true:N \g_um_mainfont_already_set_bool + \um_declare_math_sizes: + \um_setup_legacy_fam_two: + \um_setup_legacy_fam_three: + } % \end{macrocode} -% If we're defining the full Unicode math repetoire, then we skip all -% the parsing processing needed if we're only defining a subset. +% And now we input every single maths char. +% \begin{macrocode} + \um_input_math_symbol_table: +% \end{macrocode} +% Finally, % \begin{itemize} -% \item Math symbols are defined with \cmd\_um_sym:nnn; see \secref{mathsymbol} -% for the individual definitions +% \item Remap symbols that don't take their natural mathcode +% \item Activate any symbols that need to be math-active +% \item Enable wide/narrow accents +% \item Assign delimiter codes for symbols that need to grow +% \item Setup the maths alphabets (\cs{mathbf} etc.) % \end{itemize} % \begin{macrocode} - \bool_if:NTF \l_um_init_bool { - \tl_set:Nn \um_symfont_tl {operators} - \msg_trace:nnx {unicode-math} {default-math-font} {#2} - \cs_set_eq:NN \_um_sym:nnn \um_process_symbol_noparse:nnn - \cs_set_eq:NN \um_set_mathalphabet_char:Nnn \um_mathmap_noparse:Nnn - \cs_set_eq:NN \um_remap_symbol:nnn \um_remap_symbol_noparse:nnn - \cs_set_eq:NN \um_maybe_init_alphabet:n \um_init_alphabet:n - \cs_set_eq:NN \um_map_char_single:nn \um_map_char_noparse:nn - \cs_set_eq:NN \um_assign_delcode:nn \um_assign_delcode_noparse:nn - }{ - \int_incr:N \g_um_fam_int - \tl_set:Nx \um_symfont_tl {um_fam\int_use:N\g_um_fam_int} - \cs_set_eq:NN \_um_sym:nnn \um_process_symbol_parse:nnn - \cs_set_eq:NN \um_set_mathalphabet_char:Nnn \um_mathmap_parse:Nnn - \cs_set_eq:NN \um_remap_symbol:nnn \um_remap_symbol_parse:nnn - \cs_set_eq:NN \um_maybe_init_alphabet:n \use_none:n - \cs_set_eq:NN \um_map_char_single:nn \um_map_char_parse:nn - \cs_set_eq:NN \um_assign_delcode:nn \um_assign_delcode_parse:nn - } + \um_remap_symbols: + \um_setup_mathactives: + \um_setup_accents: + \um_setup_delcodes: + \um_setup_alphabets: % \end{macrocode} -% Now define |\um_symfont_tl| as the \LaTeX\ math font to access everything: +% Prevent spaces, and that's it: % \begin{macrocode} - \DeclareSymbolFont{\um_symfont_tl} - {\encodingdefault}{\zf@family}{\mddefault}{\updefault} - - \bool_if:nT {\l_um_ot_math_bool && !\g_um_mainfont_already_set_bool} { - \bool_set_true:N \g_um_mainfont_already_set_bool + \ignorespaces +} % \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\um_declare_math_sizes:} % Set the math sizes according to the recommend font parameters: % \begin{macrocode} - \dim_compare:nF { \fontdimen 10 \l_um_font == 0pt } { - \DeclareMathSizes { \f@size } { \f@size } - { \um_fontdimen_to_percent:nn{10}{\l_um_font}\dimexpr \f@size pt\relax } - { \um_fontdimen_to_percent:nn{11}{\l_um_font}\dimexpr \f@size pt\relax } - } +\cs_new:Nn \um_declare_math_sizes: + { + \dim_compare:nF { \fontdimen 10 \l_um_font == 0pt } + { + \DeclareMathSizes { \f@size } { \f@size } + { \um_fontdimen_to_scale:nn {10} {\l_um_font} } + { \um_fontdimen_to_scale:nn {11} {\l_um_font} } + } + } % \end{macrocode} -% Set defaults for fam2 for legacy compatibility: +% \end{macro} +% +% +% +% \begin{macro}{\um_setup_legacy_fam_two:} % \begin{macrocode} - \fontspec_select:xn {\l_um_font_keyval_tl, +\cs_new:Nn \um_setup_legacy_fam_two: + { + \fontspec_set_family:Nxn \l_um_family_tl + { + \l_um_font_keyval_tl, Scale=1.00001, FontAdjustment={ \fontdimen8\font= \um_get_fontparam:nn {43} {FractionNumeratorDisplayStyleShiftUp}\relax @@ -2466,13 +2544,20 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \fontdimen21\font=0pt\relax % delim2 = FractionDelimiterSize \fontdimen22\font=\um_get_fontparam:nn {15} {AxisHeight}\relax } - } {#2} - \DeclareSymbolFont{symbols} - {\encodingdefault}{\zf@family}{\mddefault}{\updefault} + } {\l_um_fontname_tl} + \SetSymbolFont{symbols}{\l_um_mversion_tl} + {\encodingdefault}{\l_um_family_tl}{\mddefault}{\updefault} + } % \end{macrocode} -% Set defaults for fam3 for legacy compatibility: +% \end{macro} +% +% \begin{macro}{\um_setup_legacy_fam_three:} % \begin{macrocode} - \fontspec_select:xn {\l_um_font_keyval_tl, +\cs_new:Nn \um_setup_legacy_fam_three: + { + \fontspec_set_family:Nxn \l_um_family_tl + { + \l_um_font_keyval_tl, Scale=0.99999, FontAdjustment={ \fontdimen8\font= \um_get_fontparam:nn {48} {FractionRuleThickness}\relax @@ -2482,44 +2567,18 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \fontdimen12\font=\um_get_fontparam:nn {31} {LowerLimitBaselineDropMin}\relax \fontdimen13\font=0pt\relax } - } {#2} - \DeclareSymbolFont{largesymbols} - {\encodingdefault}{\zf@family}{\mddefault}{\updefault} + } {\l_um_fontname_tl} + \SetSymbolFont{largesymbols}{\l_um_mversion_tl} + {\encodingdefault}{\l_um_family_tl}{\mddefault}{\updefault} } % \end{macrocode} -% And now we input every single maths char. -% \begin{macrocode} - \um_input_math_symbol_table: -% \end{macrocode} -% Finally, -% \begin{itemize} -% \item Remap symbols that don't take their natural mathcode -% \item Activate any symbols that need to be math-active -% \item Enable wide/narrow accents -% \item Assign delimiter codes for symbols that need to grow -% \item Setup the maths alphabets (\cs{mathbf} etc.) -% \end{itemize} -% \begin{macrocode} - \um_remap_symbols: - \um_setup_mathactives: - \um_setup_accents: - \um_setup_delcodes: - \um_setup_alphabets: -% \end{macrocode} -% Prevent spaces: -% \begin{macrocode} - \ignorespaces -} -% \end{macrocode} % \end{macro} % % % \begin{macrocode} -\xetex_or_luatex:nnn { \cs_new:Nn \um_get_fontparam:nn } { - \the\fontdimen#1\zf@basefont\relax -}{ - \directlua{fontspec.mathfontdimen("zf@basefont","#2")} -} +\cs_new:Nn \um_get_fontparam:nn +%<XE> { \the\fontdimen#1\l_um_font\relax } +%<LU> { \directlua{fontspec.mathfontdimen("l_um_font","#2")} } % \end{macrocode} % % \begin{macro}{\resetmathfont} @@ -2535,9 +2594,9 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \begin{macro}{\um_fontspec_select_font:} % Select the font with \cs{fontspec} and define \cs{l_um_font} from it. % \begin{macrocode} -\cs_new:Npn \um_fontspec_select_font:n #1 { +\cs_new:Nn \um_fontspec_select_font: { \tl_set:Nx \l_um_font_keyval_tl { - \luatex_if_engine:T { Renderer = Basic, } +%<LU> Renderer = Basic, BoldFont = {}, ItalicFont = {}, Script = Math, SizeFeatures = { @@ -2553,8 +2612,15 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ }, \l_um_unknown_keys_clist } - \fontspec_select:xn {\l_um_font_keyval_tl} {#1} - \tl_set_eq:NN \l_um_font \zf@basefont + \fontspec_set_fontface:NNxn \l_um_font \l_um_family_tl + {\l_um_font_keyval_tl} {\l_um_fontname_tl} +% \end{macrocode} +% Check whether we're using a real maths font: +% \begin{macrocode} + \group_begin: + \fontfamily{\l_um_family_tl}\selectfont + \fontspec_if_script:nF {math} {\bool_gset_false:N \l_um_ot_math_bool} + \group_end: } % \end{macrocode} % \end{macro} @@ -2575,7 +2641,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \end{macrocode} % \begin{macrocode} \cs_set:Npn \um_process_symbol_parse:nnn #1#2#3 { - \um@parse@term{#1}{#2}{#3}{ + \um_if_char_spec:nNNT{#1}{#2}{#3}{ \um_process_symbol_noparse:nnn {#1}{#2}{#3} } } @@ -2602,12 +2668,12 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % Where |\um_remap_symbol:nnn| is defined to be one of these two, depending % on the range setup: % \begin{macrocode} -\cs_new:Npn \um_remap_symbol_parse:nnn #1#2#3 { - \um@parse@term {#3} {\@nil} {#2} { +\cs_new:Nn \um_remap_symbol_parse:nnn { + \um_if_char_spec:nNNT {#3} {\@nil} {#2} { \um_remap_symbol_noparse:nnn {#1} {#2} {#3} } } -\cs_new:Npn \um_remap_symbol_noparse:nnn #1#2#3 { +\cs_new:Nn \um_remap_symbol_noparse:nnn { \clist_map_inline:nn {#1} { \um_set_mathcode:nnnn {##1} {#2} {\um_symfont_tl} {#3} } @@ -2639,15 +2705,20 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \end{macro} % % \begin{macro}{\um_make_mathactive:nNN} -%: TODO : hook into range feature % Makes |#1| a mathactive char, and gives cs |#2| the meaning of mathchar |#1| % with class |#3|. % You are responsible for giving active |#1| a particular meaning! % \begin{macrocode} -\cs_new:Npn \um_make_mathactive:nNN #1#2#3 { - \um_set_mathchar:NNnn #2 #3 {\um_symfont_tl} {#1} - \char_gmake_mathactive:n {#1} -} +\cs_new:Nn \um_make_mathactive_parse:nNN + { + \um_if_char_spec:nNNT {#1} #2 #3 + { \um_make_mathactive_noparse:nNN {#1} #2 #3 } + } +\cs_new:Nn \um_make_mathactive_noparse:nNN + { + \um_set_mathchar:NNnn #2 #3 {\um_symfont_tl} {#1} + \char_gmake_mathactive:n {#1} + } % \end{macrocode} % \end{macro} % @@ -2655,13 +2726,12 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % % % \begin{macro}{\um_assign_delcode:nn} -%: TODO : hook csnames into range feature % \begin{macrocode} -\cs_new:Npn \um_assign_delcode_noparse:nn #1#2 { +\cs_new:Nn \um_assign_delcode_noparse:nn { \um_set_delcode:nnn \um_symfont_tl {#1} {#2} } -\cs_new:Npn \um_assign_delcode_parse:nn #1#2 { - \um@parse@term {#2}{\@nil}{\@nil} { +\cs_new:Nn \um_assign_delcode_parse:nn { + \um_if_char_spec:nNNT {#2}{\@nil}{\@nil} { \um_assign_delcode_noparse:nn {#1} {#2} } } @@ -2672,9 +2742,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \begin{macro}{\um_assign_delcode:n} % Shorthand. % \begin{macrocode} -\cs_new:Npn \um_assign_delcode:n #1 { - \um_assign_delcode:nn {#1} {#1} -} +\cs_new:Nn \um_assign_delcode:n { \um_assign_delcode:nn {#1} {#1} } % \end{macrocode} % \end{macro} % @@ -2747,7 +2815,8 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % I've a feeling that it's more useful \emph{not} to include the multiple % integrals such as $\iiiint$, but that might be a matter of preference. % \begin{macrocode} -\tl_new:Nn \l_um_nolimits_tl { +\tl_new:N \l_um_nolimits_tl +\tl_set:Nn \l_um_nolimits_tl { \int\iint\iiint\iiiint\oint\oiint\oiiint \intclockwise\varointclockwise\ointctrclockwise\sumint \intbar\intBar\fint\cirfnint\awint\rppolint @@ -2772,7 +2841,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % It removes an item from the nolimits list. % \begin{macrocode} \DeclareDocumentCommand \removenolimits {m} { - \tl_remove_all_in:Nn \l_um_nolimits_tl {#1} + \tl_remove_all:Nn \l_um_nolimits_tl {#1} } % \end{macrocode} % \end{macro} @@ -2787,10 +2856,10 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % Also, what about right-to-left square roots? % % \begin{macro}{\l_um_radicals_tl} -% We organise radicals in the same way as nolimits-operators; that is, -% in a comma-list. +% We organise radicals in the same way as nolimits-operators. % \begin{macrocode} -\tl_new:Nn \l_um_radicals_tl {\sqrt} +\tl_new:N \l_um_radicals_tl +\tl_set:Nn \l_um_radicals_tl {\sqrt} % \end{macrocode} % \end{macro} % @@ -2827,13 +2896,9 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % For \LuaTeX, simply rename the correspronding primitive. % For \XeTeX, define \meta{command} as a new quark. % \begin{macrocode} -\cs_new_protected_nopar:Npn \um_new_cramped_style:N #1 { - \xetex_or_luatex:nn { - \quark_new:N #1 - } { - \cs_new_eq:Nc #1 { luatex \cs_to_str:N #1 } - } -} +\cs_new_protected_nopar:Nn \um_new_cramped_style:N +%<XE> { \quark_new:N #1 } +%<LU> { \cs_new_eq:Nc #1 { luatex \cs_to_str:N #1 } } % \end{macrocode} % \end{macro} % @@ -2869,7 +2934,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % The other parameters are integer constants referring to font dimension numbers. % The macro expands to a dimension which contains the appropriate font dimension. % \begin{macrocode} -\xetex_if_engine:T { +%<*XE> \cs_new_nopar:Npn \um_font_dimen:Nnnnn #1 #2 #3 #4 #5 { \fontdimen \cs_if_eq:NNTF #1 \displaystyle { @@ -2909,7 +2974,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \begin{macrocode} \c_two } -} +%</XE> % \end{macrocode} % \end{macro} % @@ -2926,17 +2991,21 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % The \LuaTeX\ font parameter name is produced by removing all underscores and prefixing the result with |luatexUmath|. % The \XeTeX\ font dimension numbers must be integer constants. % \begin{macrocode} -\xetex_or_luatex:nnn { - \cs_new_protected_nopar:Npn \um_font_param:nnnnn #1 #2 #3 #4 #5 -} { +\cs_new_protected_nopar:Nn \um_font_param:nnnnn +%<*XE> +{ \um_font_param_aux:ccnnnn { um_ #1 :N } { um_set_ #1 :N } { #2 } { #3 } { #4 } { #5 } -} { +} +%</XE> +%<*LU> +{ \tl_set:Nn \l_um_tmpa_tl { #1 } - \tl_remove_all_in:Nn \l_um_tmpa_tl { _ } + \tl_remove_all:Nn \l_um_tmpa_tl { _ } \um_font_param_aux:ccc { um_ #1 :N } { um_set_ #1 :N } { luatexUmath \l_um_tmpa_tl } } +%</LU> % \end{macrocode} % \end{macro} % @@ -2972,11 +3041,9 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % This macro defines getter and setter functions for the font parameter \meta{name}, which is considered unavailable in \XeTeX\@. % The \LuaTeX\ font parameter name is produced by removing all underscores and prefixing the result with |luatexUmath|. % \begin{macrocode} -\xetex_or_luatex:nnn { - \cs_new_protected_nopar:Npn \um_font_param:n #1 -} { } { - \um_font_param:nnnnn { #1 } { 0 } { 0 } { 0 } { 0 } -} +\cs_new_protected_nopar:Nn \um_font_param:n +%<XE> { } +%<LU> { \um_font_param:nnnnn { #1 } { 0 } { 0 } { 0 } { 0 } } % \end{macrocode} % \end{macro} % @@ -2984,8 +3051,9 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \begin{macro}{\um_font_param_aux:NNN} % Auxiliary macros for generating font parameter accessor macros. % \begin{macrocode} -\xetex_or_luatex:nn { - \cs_new_protected_nopar:Npn \um_font_param_aux:NNnnnn #1 #2 #3 #4 #5 #6 { +%<*XE> +\cs_new_protected_nopar:Nn \um_font_param_aux:NNnnnn + { \cs_new_nopar:Npn #1 ##1 { \um_font_dimen:Nnnnn ##1 { #3 } { #4 } { #5 } { #6 } } @@ -2993,9 +3061,11 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ #1 ##1 \dim_eval:n { ##2 } } } - \cs_generate_variant:Nn \um_font_param_aux:NNnnnn { cc } -} { - \cs_new_protected_nopar:Npn \um_font_param_aux:NNN #1 #2 #3 { +\cs_generate_variant:Nn \um_font_param_aux:NNnnnn { cc } +%</XE> +%<*LU> +\cs_new_protected_nopar:Nn \um_font_param_aux:NNN + { \cs_new_nopar:Npn #1 ##1 { #3 ##1 } @@ -3003,8 +3073,8 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ #3 ##1 \dim_eval:n { ##2 } } } - \cs_generate_variant:Nn \um_font_param_aux:NNN { ccc } -} +\cs_generate_variant:Nn \um_font_param_aux:NNN { ccc } +%</LU> % \end{macrocode} % \end{macro} % \end{macro} @@ -3060,6 +3130,56 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % % \section{Font features} % +% \begin{macro}{\new@mathversion} +% Fix bug in the \LaTeX\ version. +% (Fixed upstream, too, but unsure when that will propagate.) +% \begin{macrocode} +\def\new@mathversion#1{% + \expandafter\in@\expandafter#1\expandafter{\version@list}% + \ifin@ + \@font@info{Redeclaring math version + `\expandafter\@gobblefour\string#1'}% + \else + \expandafter\newcount\csname c@\expandafter + \@gobble\string#1\endcsname + \def\version@elt{\noexpand\version@elt\noexpand}% + \edef\version@list{\version@list\version@elt#1}% + \fi + \toks@{}% + \count@\z@ + \def\group@elt##1##2{% + \advance\count@\@ne + \addto@hook\toks@{\getanddefine@fonts##1##2}% + }% + \group@list + \global\csname c@\expandafter\@gobble\string#1\endcsname\count@ + \def\alpha@elt##1##2##3{% + \ifx##2\no@alphabet@error + \toks@\expandafter{\the\toks@\install@mathalphabet##1% + {\no@alphabet@error##1}}% + \else + \toks@\expandafter{\the\toks@\install@mathalphabet##1% + {\select@group##1##2##3}}% + \fi + }% + \alpha@list + \xdef#1{\the\toks@}% +} +% \end{macrocode} +% \end{macro} +% +% \subsection{Math version} +% \begin{macrocode} +\keys_define:nn {unicode-math} + { + version .code:n = + { + \tl_set:Nn \l_um_mversion_tl {#1} + \DeclareMathVersion{\l_um_mversion_tl} + } + } +% \end{macrocode} +% % \subsection{Script and scriptscript font options} % \begin{macrocode} \keys_define:nn {unicode-math} @@ -3077,10 +3197,31 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \begin{macrocode} \seq_new:N \l_um_mathalph_seq \seq_new:N \l_um_char_range_seq +\seq_new:N \l_um_mclass_range_seq +\seq_new:N \l_um_cmd_range_seq \keys_define:nn {unicode-math} { range .code:n = { \bool_set_false:N \l_um_init_bool +% \end{macrocode} +% Set processing functions if we're not defining the full Unicode math repetoire. +% Math symbols are defined with \cmd\_um_sym:nnn; see \secref{mathsymbol} +% for the individual definitions +% \begin{macrocode} + \int_incr:N \g_um_fam_int + \tl_set:Nx \um_symfont_tl {um_fam\int_use:N\g_um_fam_int} + \cs_set_eq:NN \_um_sym:nnn \um_process_symbol_parse:nnn + \cs_set_eq:NN \um_set_mathalphabet_char:Nnn \um_mathmap_parse:Nnn + \cs_set_eq:NN \um_remap_symbol:nnn \um_remap_symbol_parse:nnn + \cs_set_eq:NN \um_maybe_init_alphabet:n \use_none:n + \cs_set_eq:NN \um_map_char_single:nn \um_map_char_parse:nn + \cs_set_eq:NN \um_assign_delcode:nn \um_assign_delcode_parse:nn + \cs_set_eq:NN \um_make_mathactive:nNN \um_make_mathactive_parse:nNN +% \end{macrocode} +% Proceed by filling up the various `range' seqs according to the user options. +% \begin{macrocode} \seq_clear:N \l_um_char_range_seq + \seq_clear:N \l_um_mclass_range_seq + \seq_clear:N \l_um_cmd_range_seq \seq_clear:N \l_um_mathalph_seq \clist_map_inline:nn {#1} { \um_if_mathalph_decl:nTF {##1} { @@ -3090,11 +3231,31 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ { \exp_not:V \l_um_tmpc_tl } } }{ - \seq_put_right:Nn \l_um_char_range_seq {##1} +% \end{macrocode} +% Four cases: +% math class matching the known list; +% single item that is a control sequence---command name; +% single item that isn't---edge case, must be 0--9; +% none of the above---char range. +% \begin{macrocode} + \seq_if_in:NnTF \g_um_mathclasses_seq {##1} + { \seq_put_right:Nn \l_um_mclass_range_seq {##1} } + { + \bool_if:nTF { \tl_if_single_p:n {##1} && \token_if_cs_p:N ##1 } + { \seq_put_right:Nn \l_um_cmd_range_seq {##1} } + { \seq_put_right:Nn \l_um_char_range_seq {##1} } + } } } } } +\seq_new:N \g_um_mathclasses_seq +\seq_set_from_clist:Nn \g_um_mathclasses_seq + { + \mathord,\mathalpha,\mathop,\mathbin,\mathrel, + \mathopen,\mathclose,\mathpunct,\mathaccent, + \mathfence,\mathover,\mathunder + } % \end{macrocode} % % @@ -3113,7 +3274,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % in the general case. % \begin{macrocode} \prg_new_conditional:Nnn \um_if_mathalph_decl:n {TF} { - \tl_set:Nx \l_um_tmpa_tl { \trim@spaces@noexp {#1} } + \tl_set:Nx \l_um_tmpa_tl { \tl_trim_spaces:n {#1} } \tl_clear:N \l_um_tmpb_tl \tl_clear:N \l_um_tmpc_tl \tl_if_in:NnT \l_um_tmpa_tl {->} { @@ -3145,10 +3306,10 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % Pretty basic comma separated range processing. % Donald Arseneau's \pkg{selectp} package has a cleverer technique. % -% \begin{macro}{\um@parse@term} +% \begin{macro}{\um_if_char_spec:nNNT} % \darg{Unicode character slot} % \darg{control sequence (character macro)} -% \darg{control sequence (math type)} +% \darg{control sequence (math class)} % \darg{code to execute} % This macro expands to |#4| % if any of its arguments are contained in \cmd\l_um_char_range_seq. @@ -3172,120 +3333,68 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \end{tabular} % \end{table} % -% Start by iterating over the commalist, ignoring empties, and initialising the scratch conditional: -% \begin{macrocode} -\newcommand\um@parse@term[4]{ - \seq_map_variable:NNn \l_um_char_range_seq \@ii { - \unless\ifx\@ii\@empty - \@tempswafalse -% \end{macrocode} -% Match to either the character macro (\cmd\alpha) or the math type (\cmd\mathbin): +% We have three tests, performed sequentially in order of execution time. +% Any test finding a match jumps directly to the end. % \begin{macrocode} - \expandafter\um@firstchar\expandafter{\@ii} - \ifx\@tempa\um@backslash - \expandafter\ifx\@ii#2\relax - \@tempswatrue - \else - \expandafter\ifx\@ii#3\relax - \@tempswatrue - \fi - \fi -% \end{macrocode} -% Otherwise, we have a number range, which is passed to another macro: -% \begin{macrocode} - \else - \expandafter\um@parse@range\@ii-\@marker-\@nil#1\@nil - \fi -% \end{macrocode} -% If we have a match, execute the code! -% It also populates the -% \cmd\l_um_char_num_range_clist\ macro, which is used when defining -% \cmd\mathbf\ (\etc) \cmd\mathchar\ remappings. -% \begin{macrocode} - \if@tempswa +\cs_new:Nn \um_if_char_spec:nNNT + { + + % math class: + \seq_if_in:NnT \l_um_mclass_range_seq {#3} + { \use_none_delimit_by_q_nil:w } + + % command name: + \seq_if_in:NnT \l_um_cmd_range_seq {#2} + { \use_none_delimit_by_q_nil:w } + + % character slot: + \seq_map_inline:Nn \l_um_char_range_seq + { + \um_int_if_range_matches_slot:nnT {##1} {#1} + { \seq_map_break:n { \use_none_delimit_by_q_nil:w } } + } + + % this executes if no match was found: + \use_none:nnn + \q_nil + \use:n + { \clist_put_right:Nx \l_um_char_num_range_clist { \int_eval:n {#1} } #4 - \fi - \fi + } } -} -\def\um@firstof#1#2\@nil{#1} -\edef\um@backslash{\expandafter\um@firstof\string\string\@nil} -\def\um@firstchar#1{\edef\@tempa{\expandafter\um@firstof\string#1\@nil}} % \end{macrocode} % \end{macro} % -% \begin{macro}{\um@parse@range} -% Weird syntax. -% As shown previously in \tabref{ranges}, this macro can be passed four different input types via \cmd\um@parse@term. -% \begin{macrocode} -\def\um@parse@range#1-#2-#3\@nil#4\@nil{ - \def\@tempa{#1} - \def\@tempb{#2} -% \end{macrocode} -% \begin{tabular}{@{}ll} -% \hline -% Range & $r=x$ \\ -% C-list input & \cmd\@ii=|X| \\ -% Macro input & |\um@parse@range X-\@marker-\@nil#1\@nil| \\ -% Arguments & -% \texttt{\textcolor{red}{\char`\#1}-\textcolor{blue}{\char`\#2}-\textcolor{Green}{\char`\#3}} -% = \texttt{\textcolor{red}{X}-\textcolor{blue}{\cmd\@marker}-\textcolor{Green}{\char`\{\char`\}}} \\ -% \hline -% \end{tabular} -% \begin{macrocode} - \expandafter\ifx\expandafter\@marker\@tempb\relax - \int_compare:nT {#4=#1} \@tempswatrue - \else -% \end{macrocode} -% \begin{tabular}{@{}ll} -% \hline -% Range & $r\geq x$ \\ -% C-list input & \cmd\@ii=|X-| \\ -% Macro input & |\um@parse@range X--\@marker-\@nil#1\@nil|\\ -% Arguments & -% \texttt{\textcolor{red}{\char`\#1}-\textcolor{blue}{\char`\#2}-\textcolor{Green}{\char`\#3}} -% = \texttt{\textcolor{red}{X}-\textcolor{blue}{\char`\{\char`\}}-\textcolor{Green}{\cmd\@marker-}} \\ -% \hline -% \end{tabular} -% \begin{macrocode} - \ifx\@empty\@tempb - \int_compare:nT {#4>#1-1} \@tempswatrue - \else -% \end{macrocode} -% \begin{tabular}{@{}ll} -% \hline -% Range & $r\leq y$ \\ -% C-list input & \cmd\@ii=|-Y| \\ -% Macro input & |\um@parse@range -Y-\@marker-\@nil#1\@nil|\\ -% Arguments & -% \texttt{\textcolor{red}{\char`\#1}-\textcolor{blue}{\char`\#2}-\textcolor{Green}{\char`\#3}} -% = \texttt{\textcolor{red}{\char`\{\char`\}}-\textcolor{blue}{Y}-\textcolor{Green}{\cmd\@marker-}}\\ -% \hline -% \end{tabular} +% \begin{macro}{\um_int_if_range_matches_slot:nnT} +% A `numrange' is like |-2,5-8,12,17-| (can be unsorted). +% +% Four cases, four argument types: +% \begin{Verbatim} +% #2 #3 #4 +% [ 1] - [qn] - [ ] qs +% [ 1] - [ ] - [qn-] qs +% [ ] - [ 3] - [qn-] qs +% [ 1] - [ 3] - [qn-] qs +% \end{Verbatim} +% % \begin{macrocode} - \ifx\@empty\@tempa - \int_compare:nT {#4<#2+1} \@tempswatrue +\cs_new:Nn \um_int_if_range_matches_slot:nnT + { \um_numrange_parse:nwT {#1} #2 - \q_nil - \q_stop {#3} } % \end{macrocode} -% \begin{tabular}{@{}ll} -% \hline -% Range & $x \leq r \leq y$ \\ -% C-list input & \cmd\@ii=|X-Y| \\ -% Macro input & |\um@parse@range X-Y-\@marker-\@nil#1\@nil|\\ -% Arguments & -% \texttt{\textcolor{red}{\char`\#1}-\textcolor{blue}{\char`\#2}-\textcolor{Green}{\char`\#3}} -% = \texttt{\textcolor{red}{X}-\textcolor{blue}{Y}-\textcolor{Green}{\cmd\@marker-}}\\ -% \hline -% \end{tabular} +% % \begin{macrocode} - \else - \int_compare:nT {#4>#1-1} { - \int_compare:nT {#4<#2+1} \@tempswatrue - } - \fi - \fi - \fi -} +\cs_set:Npn \um_numrange_parse:nwT #1 #2 - #3 - #4 \q_stop #5 + { + \tl_if_empty:nTF {#4} { \int_compare:nT {#1=#2} {#5} } + { + \tl_if_empty:nTF {#3} { \int_compare:nT {#1>=#2} {#5} } + { + \tl_if_empty:nTF {#2} { \int_compare:nT {#1<=#3} {#5} } + { + \int_compare:nT {#1>=#2} { \int_compare:nT {#1<=#3} {#5} } + } } } + } % \end{macrocode} % \end{macro} % @@ -3359,7 +3468,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \begin{macro}{\um_new_mathstyle:N} % This function defines a new command like \cs{mathfrak}. % \begin{macrocode} -\cs_new:Npn \um_new_mathstyle:N #1 { +\cs_new:Nn \um_new_mathstyle:N { \um_prepare_mathstyle:f {\exp_after:wN \use_none:nnnnn \token_to_str:N #1} \seq_put_right:Nn \g_um_mathstyles_seq {#1} } @@ -3428,8 +3537,11 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % Define the high level math alphabet macros (\cs{mathit}, etc.) in terms of % unicode-math definitions. Use \cs{bgroup}/\cs{egroup} so s'scripts scan the % whole thing. +% +% The flag \cs{l_um_mathstyle_tl} is for other applications to query the +% current math style. % \begin{macrocode} -\cs_new:Npn \um_prepare_mathstyle:n #1 { +\cs_new:Nn \um_prepare_mathstyle:n { \um_init_alphabet:x {#1} \cs_set:cpn {_um_math#1_aux:n} ##1 { \use:c {um_switchto_math#1:} ##1 \egroup @@ -3437,14 +3549,17 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \cs_set_protected:cpx {math#1} { \exp_not:n{ \bgroup - \mode_if_math:F { - \egroup\expandafter - \non@alpherr\expandafter{\csname math#1\endcsname\space} - } + \mode_if_math:F + { + \egroup\expandafter + \non@alpherr\expandafter{\csname math#1\endcsname\space} + } + \tl_set:Nn \l_um_mathstyle_tl {#1} } \exp_not:c {_um_math#1_aux:n} } } +\tl_new:N \l_um_mathstyle_tl \cs_generate_variant:Nn \um_prepare_mathstyle:n {f} % \end{macrocode} % \end{macro} @@ -3456,12 +3571,13 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % later when redefining a particular maths alphabet. % \begin{macrocode} \cs_set:Npn \um_init_alphabet:n #1 { - \um_trace:nx {alph-initialise} {#1} + \um_log:nx {alph-initialise} {#1} \cs_set_eq:cN {um_switchto_math#1:} \prg_do_nothing: } \cs_generate_variant:Nn \um_init_alphabet:n {x} % \end{macrocode} -% Variants +% Variants (cannot use |\cs_generate_variant:Nn| because the base function is +% defined dynamically.) % \begin{macrocode} \cs_new:Npn \um_maybe_init_alphabet:V { \exp_args:NV \um_maybe_init_alphabet:n @@ -3487,7 +3603,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % |\l_um_mathalph_seq|. If not, set up the styles implicitly: % \begin{macrocode} \seq_if_empty:NTF \l_um_mathalph_seq { - \um_trace:n {setup-implicit} + \um_log:n {setup-implicit} \seq_set_eq:NN \l_um_mathalph_seq \g_um_default_mathalph_seq \bool_set_true:N \l_um_implicit_alph_bool \um_maybe_init_alphabet:n {sf} @@ -3498,7 +3614,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % If |range=| has been used then we're in explicit mode: % \begin{macrocode} { - \um_trace:n {setup-explicit} + \um_log:n {setup-explicit} \bool_set_false:N \l_um_implicit_alph_bool \cs_set_eq:NN \um_set_mathalphabet_char:Nnn \um_mathmap_noparse:Nnn \cs_set_eq:NN \um_map_char_single:nn \um_map_char_noparse:nn @@ -3521,21 +3637,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \um_setup_math_alphabet:VVV \l_um_tmpa_tl \l_um_tmpb_tl \l_um_remap_style_tl } - \um_warn_missing_alphabets: -} -% \end{macrocode} -% -% \begin{macrocode} -\cs_new:Npn \um_warn_missing_alphabets: { - \seq_if_empty:NF \l_um_missing_alph_seq { - \typeout{ - Package~unicode-math~Warning:~ - missing~math~alphabets~in~font~ \fontname\l_um_font - } - \seq_map_inline:Nn \l_um_missing_alph_seq { - \typeout{\space\space\space\space##1} - } - } + \seq_if_empty:NF \l_um_missing_alph_seq { \um_log:n { missing-alphabets } } } % \end{macrocode} % \end{macro} @@ -3545,7 +3647,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \darg{Math alphabets, comma separated of \{latin,Latin,greek,Greek,num\}} % \darg{Name of the output math style (usually same as input \texttt{bb})} % \begin{macrocode} -\cs_new:Npn \um_setup_math_alphabet:Nnn #1#2#3 { +\cs_new:Nn \um_setup_math_alphabet:Nnn { \tl_set:Nx \l_um_style_tl { \exp_after:wN \use_none:nnnnn \token_to_str:N #1 } @@ -3553,7 +3655,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % First check that at least one of the alphabets for the font shape is defined\dots % \begin{macrocode} \clist_map_inline:nn {#2} { - \tl_set:Nx \l_um_tmpa_tl { \trim@spaces {##1} } + \tl_set:Nx \l_um_tmpa_tl { \tl_trim_spaces:n {##1} } \cs_if_exist:cT {um_config_ \l_um_style_tl _\l_um_tmpa_tl :n} { \str_if_eq:xxTF {\l_um_tmpa_tl}{misc} { \um_maybe_init_alphabet:V \l_um_style_tl @@ -3570,20 +3672,20 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \dots and then loop through them defining the individual ranges: % \begin{macrocode} \clist_map_inline:nn {#2} { - \tl_set:Nx \l_um_tmpa_tl { \trim@spaces {##1} } + \tl_set:Nx \l_um_tmpa_tl { \tl_trim_spaces:n {##1} } \cs_if_exist:cT {um_config_ \l_um_style_tl _ \l_um_tmpa_tl :n} { \str_if_eq:xxTF {\l_um_tmpa_tl}{misc} { - \um_trace:nx {setup-alph} {math \l_um_style_tl~(\l_um_tmpa_tl)} + \um_log:nx {setup-alph} {math \l_um_style_tl~(\l_um_tmpa_tl)} \use:c {um_config_ \l_um_style_tl _ \l_um_tmpa_tl :n} {#3} }{ \um_glyph_if_exist:cTF { \um_to_usv:nn {#3}{\l_um_tmpa_tl} } { - \um_trace:nx {setup-alph} {math \l_um_style_tl~(\l_um_tmpa_tl)} + \um_log:nx {setup-alph} {math \l_um_style_tl~(\l_um_tmpa_tl)} \use:c {um_config_ \l_um_style_tl _ \l_um_tmpa_tl :n} {#3} }{ \bool_if:NTF \l_um_implicit_alph_bool { \seq_put_right:Nx \l_um_missing_alph_seq { \@backslashchar math \l_um_style_tl \space - (\tl_use:c{g_um_math_alphabet_name_ \l_um_tmpa_tl _tl}) + (\tl_use:c{c_um_math_alphabet_name_ \l_um_tmpa_tl _tl}) } }{ \use:c {um_config_ \l_um_style_tl _ \l_um_tmpa_tl :n} {up} @@ -3610,6 +3712,8 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \begin{macro}{\um_map_char_single:nn} % Wrapper for |\um_map_char_noparse:nn| or |\um_map_char_parse:nn| % depending on the context. +% Cannot use |\cs_generate_variant:Nn| because the base function is +% defined dynamically. % \begin{macrocode} \cs_new:Npn \um_map_char_single:cc { \exp_args:Ncc \um_map_char_single:nn } % \end{macrocode} @@ -3619,14 +3723,14 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \begin{macro}{\um_map_char_noparse:nn} % \begin{macro}{\um_map_char_parse:nn} % \begin{macrocode} -\cs_new:Npn \um_map_char_noparse:nn #1#2 { +\cs_new:Nn \um_map_char_noparse:nn { \um_set_mathcode:nnnn {#1}{\mathalpha}{\um_symfont_tl}{#2} } % \end{macrocode} % % \begin{macrocode} -\cs_new:Npn \um_map_char_parse:nn #1#2 { - \um@parse@term {#1} {\@nil} {\mathalpha} { +\cs_new:Nn \um_map_char_parse:nn { + \um_if_char_spec:nNNT {#1} {\@nil} {\mathalpha} { \um_map_char_noparse:nn {#1}{#2} } } @@ -3639,7 +3743,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \darg{from alphabet(s)} % \darg{to alphabet} % \begin{macrocode} -\cs_new:Npn \um_map_char_single:nnn #1#2#3 { +\cs_new:Nn \um_map_char_single:nnn { \um_map_char_single:cc { \um_to_usv:nn {#1}{#3} } { \um_to_usv:nn {#2}{#3} } } @@ -3671,7 +3775,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \end{macrocode} % And the wrapper with names: % \begin{macrocode} -\cs_new:Npn \um_map_chars_range:nnnn #1#2#3#4 { +\cs_new:Nn \um_map_chars_range:nnnn { \um_map_chars_range:ncc {#1} { \um_to_usv:nn {#2}{#4} } { \um_to_usv:nn {#3}{#4} } } @@ -3681,7 +3785,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \subsubsection{Functions for alphabets} % % \begin{macrocode} -\cs_set:Npn \um_map_chars_Latin:nn #1#2 { +\cs_new:Nn \um_map_chars_Latin:nn { \clist_map_inline:nn {#1} { \um_map_chars_range:nnnn {26} {##1} {#2} {Latin} } @@ -3689,7 +3793,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \end{macrocode} % % \begin{macrocode} -\cs_set:Npn \um_map_chars_latin:nn #1#2 { +\cs_new:Nn \um_map_chars_latin:nn { \clist_map_inline:nn {#1} { \um_map_chars_range:nnnn {26} {##1} {#2} {latin} } @@ -3697,7 +3801,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \end{macrocode} % % \begin{macrocode} -\cs_set:Npn \um_map_chars_greek:nn #1#2 { +\cs_new:Nn \um_map_chars_greek:nn { \clist_map_inline:nn {#1} { \um_map_chars_range:nnnn {25} {##1} {#2} {greek} \um_map_char_single:nnn {##1} {#2} {varepsilon} @@ -3711,7 +3815,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \end{macrocode} % % \begin{macrocode} -\cs_set:Npn \um_map_chars_Greek:nn #1#2 { +\cs_new:Nn \um_map_chars_Greek:nn { \clist_map_inline:nn {#1} { \um_map_chars_range:nnnn {25} {##1} {#2} {Greek} \um_map_char_single:nnn {##1} {#2} {varTheta} @@ -3720,7 +3824,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \end{macrocode} % % \begin{macrocode} -\cs_set:Npn \um_map_chars_numbers:nn #1#2 { +\cs_new:Nn \um_map_chars_numbers:nn { \um_map_chars_range:nnnn {10} {#1} {#2} {num} } % \end{macrocode} @@ -3731,7 +3835,10 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \subsubsection{Functions for setting up the maths alphabets} % % \begin{macro}{\um_set_mathalphabet_char:Nnn} -% This is a wrapper for either |\um_mathmap_noparse:Nnn| or |\um_mathmap_parse:Nnn|, depending on the context. +% This is a wrapper for either |\um_mathmap_noparse:Nnn| or +% |\um_mathmap_parse:Nnn|, depending on the context. +% Cannot use |\cs_generate_variant:Nn| because the base function is +% defined dynamically. % \begin{macrocode} \cs_new:Npn \um_set_mathalphabet_char:Ncc { \exp_args:NNcc \um_set_mathalphabet_char:Nnn @@ -3745,7 +3852,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \darg{Output slot, \eg, the slot for `$\mathbb{A}$'} % Adds \cs{um_set_mathcode:nnnn} declarations to the specified maths alphabet's definition. % \begin{macrocode} -\cs_set:Npn \um_mathmap_noparse:Nnn #1#2#3 { +\cs_new:Nn \um_mathmap_noparse:Nnn { \clist_map_inline:nn {#2} { \tl_put_right:cx {um_switchto_\cs_to_str:N #1:} { \um_set_mathcode:nnnn{##1}{\mathalpha}{\um_symfont_tl}{#3} @@ -3759,11 +3866,11 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \darg{Maths alphabet, \eg, \cmd\mathbb} % \darg{Input slot(s), \eg, the slot for `A' (comma separated)} % \darg{Output slot, \eg, the slot for `$\mathbb{A}$'} -% When \cmd\um@parse@term\ is executed, it populates the \cmd\l_um_char_num_range_clist\ +% When \cmd\um_if_char_spec:nNNT\ is executed, it populates the \cmd\l_um_char_num_range_clist\ % macro with slot numbers corresponding to the specified range. This range is used to % conditionally add \cs{um_set_mathcode:nnnn} declaractions to the maths alphabet definition. % \begin{macrocode} -\cs_set:Npn \um_mathmap_parse:Nnn #1#2#3 { +\cs_new:Nn \um_mathmap_parse:Nnn { \clist_if_in:NnT \l_um_char_num_range_clist {#3} { \um_mathmap_noparse:Nnn {#1}{#2}{#3} } @@ -3793,9 +3900,8 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % First the version that uses numbers: % \begin{macrocode} \cs_new:Npn \um_set_mathalph_range:nNnn #1#2#3#4 { - \prg_stepwise_inline:nnnn {0}{1}{#1-1} { - \um_set_mathalphabet_char:Nnn {#2} { ##1 + #3 } { ##1 + #4 } - } + \prg_stepwise_inline:nnnn {0}{1}{#1-1} + { \um_set_mathalphabet_char:Nnn {#2} { ##1 + #3 } { ##1 + #4 } } } \cs_generate_variant:Nn \um_set_mathalph_range:nNnn {nNcc} % \end{macrocode} @@ -3813,31 +3919,28 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \begin{macrocode} \cs_new:Npn \um_set_mathalphabet_pos:Nnnn #1#2#3#4 { \cs_if_exist:cT { \um_to_usv:nn {#4}{#2} } { - \clist_map_inline:nn {#3} { - \um_set_mathalphabet_char:Nnnn #1 {##1} {#4} {#2} - } + \clist_map_inline:nn {#3} + { \um_set_mathalphabet_char:Nnnn #1 {##1} {#4} {#2} } } } % \end{macrocode} % % \begin{macrocode} -\cs_new:Npn \um_set_mathalphabet_numbers:Nnn #1#2#3 { - \clist_map_inline:nn {#2} { - \um_set_mathalph_range:nNnnn {10} #1 {##1} {#3} {num} - } +\cs_new:Nn \um_set_mathalphabet_numbers:Nnn { + \clist_map_inline:nn {#2} + { \um_set_mathalph_range:nNnnn {10} #1 {##1} {#3} {num} } } % \end{macrocode} % % \begin{macrocode} -\cs_new:Npn \um_set_mathalphabet_Latin:Nnn #1#2#3 { - \clist_map_inline:nn {#2} { - \um_set_mathalph_range:nNnnn {26} #1 {##1} {#3} {Latin} - } +\cs_new:Nn \um_set_mathalphabet_Latin:Nnn { + \clist_map_inline:nn {#2} + { \um_set_mathalph_range:nNnnn {26} #1 {##1} {#3} {Latin} } } % \end{macrocode} % % \begin{macrocode} -\cs_new:Npn \um_set_mathalphabet_latin:Nnn #1#2#3 { +\cs_new:Nn \um_set_mathalphabet_latin:Nnn { \clist_map_inline:nn {#2} { \um_set_mathalph_range:nNnnn {26} #1 {##1} {#3} {latin} \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {h} @@ -3846,7 +3949,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \end{macrocode} % % \begin{macrocode} -\cs_new:Npn \um_set_mathalphabet_Greek:Nnn #1#2#3 { +\cs_new:Nn \um_set_mathalphabet_Greek:Nnn { \clist_map_inline:nn {#2} { \um_set_mathalph_range:nNnnn {25} #1 {##1} {#3} {Greek} \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varTheta} @@ -3855,7 +3958,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \end{macrocode} % % \begin{macrocode} -\cs_new:Npn \um_set_mathalphabet_greek:Nnn #1#2#3 { +\cs_new:Nn \um_set_mathalphabet_greek:Nnn { \clist_map_inline:nn {#2} { \um_set_mathalph_range:nNnnn {25} #1 {##1} {#3} {greek} \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varepsilon} @@ -3872,24 +3975,21 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % % \subsubsection{Upright: \cmd\mathup} % \begin{macrocode} -\cs_new:Npn \um_config_up_num:n #1 { +\cs_new:Nn \um_config_up_num:n { \um_map_chars_numbers:nn {up}{#1} \um_set_mathalphabet_numbers:Nnn \mathup {up}{#1} } -\cs_new:Npn \um_config_up_Latin:n #1 { - \bool_if:NTF \g_um_literal_bool { - \um_map_chars_Latin:nn {up} {#1} - }{ - \bool_if:NT \g_um_upLatin_bool { - \um_map_chars_Latin:nn {up,it} {#1} - } +\cs_new:Nn \um_config_up_Latin:n + { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_Latin:nn {up} {#1} } + { + \bool_if:NT \g_um_upLatin_bool { \um_map_chars_Latin:nn {up,it} {#1} } } \um_set_mathalphabet_Latin:Nnn \mathup {up,it}{#1} } -\cs_new:Npn \um_config_up_latin:n #1 { - \bool_if:NTF \g_um_literal_bool { - \um_map_chars_latin:nn {up} {#1} - }{ +\cs_new:Nn \um_config_up_latin:n { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_latin:nn {up} {#1} } + { \bool_if:NT \g_um_uplatin_bool { \um_map_chars_latin:nn {up,it} {#1} \um_map_single:nnn {h} {up,it} {#1} @@ -3899,27 +3999,23 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } \um_set_mathalphabet_latin:Nnn \mathup {up,it}{#1} } -\cs_new:Npn \um_config_up_Greek:n #1 { - \bool_if:NTF \g_um_literal_bool { - \um_map_chars_Greek:nn {up}{#1} - }{ - \bool_if:NT \g_um_upGreek_bool { - \um_map_chars_Greek:nn {up,it}{#1} - } +\cs_new:Nn \um_config_up_Greek:n { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_Greek:nn {up}{#1} } + { + \bool_if:NT \g_um_upGreek_bool { \um_map_chars_Greek:nn {up,it}{#1} } } \um_set_mathalphabet_Greek:Nnn \mathup {up,it}{#1} } -\cs_new:Npn \um_config_up_greek:n #1 { - \bool_if:NTF \g_um_literal_bool { - \um_map_chars_greek:nn {up} {#1} - }{ +\cs_new:Nn \um_config_up_greek:n { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_greek:nn {up} {#1} } + { \bool_if:NT \g_um_upgreek_bool { \um_map_chars_greek:nn {up,it} {#1} } } \um_set_mathalphabet_greek:Nnn \mathup {up,it} {#1} } -\cs_new:Npn \um_config_up_misc:n #1 { +\cs_new:Nn \um_config_up_misc:n { \bool_if:NTF \g_um_literal_Nabla_bool { \um_map_single:nnn {Nabla}{up}{up} }{ @@ -3944,17 +4040,14 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \subsubsection{Italic: \cmd\mathit} % % \begin{macrocode} -\cs_new:Npn \um_config_it_Latin:n #1 { - \bool_if:NTF \g_um_literal_bool { - \um_map_chars_Latin:nn {it} {#1} - }{ - \bool_if:NF \g_um_upLatin_bool { - \um_map_chars_Latin:nn {up,it} {#1} - } +\cs_new:Nn \um_config_it_Latin:n { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_Latin:nn {it} {#1} } + { + \bool_if:NF \g_um_upLatin_bool { \um_map_chars_Latin:nn {up,it} {#1} } } \um_set_mathalphabet_Latin:Nnn \mathit {up,it}{#1} } -\cs_new:Npn \um_config_it_latin:n #1 { +\cs_new:Nn \um_config_it_latin:n { \bool_if:NTF \g_um_literal_bool { \um_map_chars_latin:nn {it} {#1} \um_map_single:nnn {h}{it}{#1} @@ -3970,27 +4063,21 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \um_set_mathalphabet_pos:Nnnn \mathit {dotlessi} {up,it} {#1} \um_set_mathalphabet_pos:Nnnn \mathit {dotlessj} {up,it} {#1} } -\cs_new:Npn \um_config_it_Greek:n #1 { - \bool_if:NTF \g_um_literal_bool { - \um_map_chars_Greek:nn {it}{#1} +\cs_new:Nn \um_config_it_Greek:n { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_Greek:nn {it}{#1} }{ - \bool_if:NF \g_um_upGreek_bool { - \um_map_chars_Greek:nn {up,it}{#1} - } + \bool_if:NF \g_um_upGreek_bool { \um_map_chars_Greek:nn {up,it}{#1} } } \um_set_mathalphabet_Greek:Nnn \mathit {up,it}{#1} } -\cs_new:Npn \um_config_it_greek:n #1 { - \bool_if:NTF \g_um_literal_bool { - \um_map_chars_greek:nn {it} {#1} - }{ - \bool_if:NF \g_um_upgreek_bool { - \um_map_chars_greek:nn {it,up} {#1} - } +\cs_new:Nn \um_config_it_greek:n { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_greek:nn {it} {#1} } + { + \bool_if:NF \g_um_upgreek_bool { \um_map_chars_greek:nn {it,up} {#1} } } \um_set_mathalphabet_greek:Nnn \mathit {up,it} {#1} } -\cs_new:Npn \um_config_it_misc:n #1 { +\cs_new:Nn \um_config_it_misc:n { \bool_if:NTF \g_um_literal_Nabla_bool { \um_map_single:nnn {Nabla}{it}{it} }{ @@ -4013,10 +4100,10 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \subsubsection{Blackboard or double-struck: \cmd\mathbb\ and \cmd\mathbbit} % % \begin{macrocode} -\cs_new:Npn \um_config_bb_latin:n #1 { +\cs_new:Nn \um_config_bb_latin:n { \um_set_mathalphabet_latin:Nnn \mathbb {up,it}{#1} } -\cs_new:Npn \um_config_bb_Latin:n #1 { +\cs_new:Nn \um_config_bb_Latin:n { \um_set_mathalphabet_Latin:Nnn \mathbb {up,it}{#1} \um_set_mathalphabet_pos:Nnnn \mathbb {C} {up,it} {#1} \um_set_mathalphabet_pos:Nnnn \mathbb {H} {up,it} {#1} @@ -4026,17 +4113,17 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \um_set_mathalphabet_pos:Nnnn \mathbb {R} {up,it} {#1} \um_set_mathalphabet_pos:Nnnn \mathbb {Z} {up,it} {#1} } -\cs_new:Npn \um_config_bb_num:n #1 { +\cs_new:Nn \um_config_bb_num:n { \um_set_mathalphabet_numbers:Nnn \mathbb {up}{#1} } -\cs_new:Npn \um_config_bb_misc:n #1 { +\cs_new:Nn \um_config_bb_misc:n { \um_set_mathalphabet_pos:Nnnn \mathbb {Pi} {up,it} {#1} \um_set_mathalphabet_pos:Nnnn \mathbb {pi} {up,it} {#1} \um_set_mathalphabet_pos:Nnnn \mathbb {Gamma} {up,it} {#1} \um_set_mathalphabet_pos:Nnnn \mathbb {gamma} {up,it} {#1} \um_set_mathalphabet_pos:Nnnn \mathbb {summation} {up} {#1} } -\cs_new:Npn \um_config_bbit_misc:n #1 { +\cs_new:Nn \um_config_bbit_misc:n { \um_set_mathalphabet_pos:Nnnn \mathbbit {D} {up,it} {#1} \um_set_mathalphabet_pos:Nnnn \mathbbit {d} {up,it} {#1} \um_set_mathalphabet_pos:Nnnn \mathbbit {e} {up,it} {#1} @@ -4048,7 +4135,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \subsubsection{Script and caligraphic: \cmd\mathscr\ and \cmd\mathcal} % % \begin{macrocode} -\cs_new:Npn \um_config_scr_Latin:n #1 { +\cs_new:Nn \um_config_scr_Latin:n { \um_set_mathalphabet_Latin:Nnn \mathscr {up,it}{#1} \um_set_mathalphabet_pos:Nnnn \mathscr {B}{up,it}{#1} \um_set_mathalphabet_pos:Nnnn \mathscr {E}{up,it}{#1} @@ -4059,7 +4146,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \um_set_mathalphabet_pos:Nnnn \mathscr {M}{up,it}{#1} \um_set_mathalphabet_pos:Nnnn \mathscr {R}{up,it}{#1} } -\cs_new:Npn \um_config_scr_latin:n #1 { +\cs_new:Nn \um_config_scr_latin:n { \um_set_mathalphabet_latin:Nnn \mathscr {up,it}{#1} \um_set_mathalphabet_pos:Nnnn \mathscr {e}{up,it}{#1} \um_set_mathalphabet_pos:Nnnn \mathscr {g}{up,it}{#1} @@ -4069,7 +4156,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % These are by default synonyms for the above, but with the STIX % fonts we want to use the alternate alphabet. % \begin{macrocode} -\cs_new:Npn \um_config_cal_Latin:n #1 { +\cs_new:Nn \um_config_cal_Latin:n { \um_set_mathalphabet_Latin:Nnn \mathcal {up,it}{#1} \um_set_mathalphabet_pos:Nnnn \mathcal {B}{up,it}{#1} \um_set_mathalphabet_pos:Nnnn \mathcal {E}{up,it}{#1} @@ -4085,7 +4172,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \subsubsection{Fractur or fraktur or blackletter: \cmd\mathfrak} % % \begin{macrocode} -\cs_new:Npn \um_config_frak_Latin:n #1 { +\cs_new:Nn \um_config_frak_Latin:n { \um_set_mathalphabet_Latin:Nnn \mathfrak {up,it}{#1} \um_set_mathalphabet_pos:Nnnn \mathfrak {C}{up,it}{#1} \um_set_mathalphabet_pos:Nnnn \mathfrak {H}{up,it}{#1} @@ -4093,18 +4180,18 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \um_set_mathalphabet_pos:Nnnn \mathfrak {R}{up,it}{#1} \um_set_mathalphabet_pos:Nnnn \mathfrak {Z}{up,it}{#1} } -\cs_new:Npn \um_config_frak_latin:n #1 { +\cs_new:Nn \um_config_frak_latin:n { \um_set_mathalphabet_latin:Nnn \mathfrak {up,it}{#1} } % \end{macrocode} % % \subsubsection{Sans serif upright: \cmd\mathsfup} % \begin{macrocode} -\cs_new:Npn \um_config_sfup_num:n #1 { +\cs_new:Nn \um_config_sfup_num:n { \um_set_mathalphabet_numbers:Nnn \mathsf {up}{#1} \um_set_mathalphabet_numbers:Nnn \mathsfup {up}{#1} } -\cs_new:Npn \um_config_sfup_Latin:n #1 { +\cs_new:Nn \um_config_sfup_Latin:n { \bool_if:NTF \g_um_sfliteral_bool { \um_map_chars_Latin:nn {sfup} {#1} \um_set_mathalphabet_Latin:Nnn \mathsf {up}{#1} @@ -4116,7 +4203,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } \um_set_mathalphabet_Latin:Nnn \mathsfup {up,it}{#1} } -\cs_new:Npn \um_config_sfup_latin:n #1 { +\cs_new:Nn \um_config_sfup_latin:n { \bool_if:NTF \g_um_sfliteral_bool { \um_map_chars_latin:nn {sfup} {#1} \um_set_mathalphabet_latin:Nnn \mathsf {up}{#1} @@ -4133,7 +4220,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \subsubsection{Sans serif italic: \cmd\mathsfit} % % \begin{macrocode} -\cs_new:Npn \um_config_sfit_Latin:n #1 { +\cs_new:Nn \um_config_sfit_Latin:n { \bool_if:NTF \g_um_sfliteral_bool { \um_map_chars_Latin:nn {sfit} {#1} \um_set_mathalphabet_Latin:Nnn \mathsf {it}{#1} @@ -4145,7 +4232,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } \um_set_mathalphabet_Latin:Nnn \mathsfit {up,it}{#1} } -\cs_new:Npn \um_config_sfit_latin:n #1 { +\cs_new:Nn \um_config_sfit_latin:n { \bool_if:NTF \g_um_sfliteral_bool { \um_map_chars_latin:nn {sfit} {#1} \um_set_mathalphabet_latin:Nnn \mathsf {it}{#1} @@ -4161,13 +4248,13 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % % \subsubsection{Typewriter or monospaced: \cmd\mathtt} % \begin{macrocode} -\cs_new:Npn \um_config_tt_num:n #1 { +\cs_new:Nn \um_config_tt_num:n { \um_set_mathalphabet_numbers:Nnn \mathtt {up}{#1} } -\cs_new:Npn \um_config_tt_Latin:n #1 { +\cs_new:Nn \um_config_tt_Latin:n { \um_set_mathalphabet_Latin:Nnn \mathtt {up,it}{#1} } -\cs_new:Npn \um_config_tt_latin:n #1 { +\cs_new:Nn \um_config_tt_latin:n { \um_set_mathalphabet_latin:Nnn \mathtt {up,it}{#1} } % \end{macrocode} @@ -4175,7 +4262,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % % \subsubsection{Bold Italic: \cmd\mathbfit} % \begin{macrocode} -\cs_new:Npn \um_config_bfit_Latin:n #1 { +\cs_new:Nn \um_config_bfit_Latin:n { \bool_if:NF \g_um_bfupLatin_bool { \um_map_chars_Latin:nn {bfup,bfit} {#1} } @@ -4190,7 +4277,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } } } -\cs_new:Npn \um_config_bfit_latin:n #1 { +\cs_new:Nn \um_config_bfit_latin:n { \bool_if:NF \g_um_bfuplatin_bool { \um_map_chars_latin:nn {bfup,bfit} {#1} } @@ -4205,7 +4292,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } } } -\cs_new:Npn \um_config_bfit_Greek:n #1 { +\cs_new:Nn \um_config_bfit_Greek:n { \um_set_mathalphabet_Greek:Nnn \mathbfit {up,it}{#1} \bool_if:NTF \g_um_bfliteral_bool { \um_map_chars_Greek:nn {bfit}{#1} @@ -4217,7 +4304,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } } } -\cs_new:Npn \um_config_bfit_greek:n #1 { +\cs_new:Nn \um_config_bfit_greek:n { \um_set_mathalphabet_greek:Nnn \mathbfit {up,it} {#1} \bool_if:NTF \g_um_bfliteral_bool { \um_map_chars_greek:nn {bfit} {#1} @@ -4229,7 +4316,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } } } -\cs_new:Npn \um_config_bfit_misc:n #1 { +\cs_new:Nn \um_config_bfit_misc:n { \bool_if:NTF \g_um_literal_Nabla_bool { \um_map_single:nnn {Nabla}{bfit}{#1} }{ @@ -4266,11 +4353,11 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % % \subsubsection{Bold Upright: \cmd\mathbfup} % \begin{macrocode} -\cs_new:Npn \um_config_bfup_num:n #1 { +\cs_new:Nn \um_config_bfup_num:n { \um_set_mathalphabet_numbers:Nnn \mathbf {up}{#1} \um_set_mathalphabet_numbers:Nnn \mathbfup {up}{#1} } -\cs_new:Npn \um_config_bfup_Latin:n #1 { +\cs_new:Nn \um_config_bfup_Latin:n { \bool_if:NT \g_um_bfupLatin_bool { \um_map_chars_Latin:nn {bfup,bfit} {#1} } @@ -4285,7 +4372,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } } } -\cs_new:Npn \um_config_bfup_latin:n #1 { +\cs_new:Nn \um_config_bfup_latin:n { \bool_if:NT \g_um_bfuplatin_bool { \um_map_chars_latin:nn {bfup,bfit} {#1} } @@ -4300,7 +4387,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } } } -\cs_new:Npn \um_config_bfup_Greek:n #1 { +\cs_new:Nn \um_config_bfup_Greek:n { \um_set_mathalphabet_Greek:Nnn \mathbfup {up,it}{#1} \bool_if:NTF \g_um_bfliteral_bool { \um_map_chars_Greek:nn {bfup}{#1} @@ -4312,7 +4399,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } } } -\cs_new:Npn \um_config_bfup_greek:n #1 { +\cs_new:Nn \um_config_bfup_greek:n { \um_set_mathalphabet_greek:Nnn \mathbfup {up,it} {#1} \bool_if:NTF \g_um_bfliteral_bool { \um_map_chars_greek:nn {bfup} {#1} @@ -4324,7 +4411,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } } } -\cs_new:Npn \um_config_bfup_misc:n #1 { +\cs_new:Nn \um_config_bfup_misc:n { \bool_if:NTF \g_um_literal_Nabla_bool { \um_map_single:nnn {Nabla}{bfup}{#1} }{ @@ -4364,34 +4451,34 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % % \subsubsection{Bold fractur or fraktur or blackletter: \cmd\mathbffrak} % \begin{macrocode} -\cs_new:Npn \um_config_bffrak_Latin:n #1 { +\cs_new:Nn \um_config_bffrak_Latin:n { \um_set_mathalphabet_Latin:Nnn \mathbffrak {up,it}{#1} } -\cs_new:Npn \um_config_bffrak_latin:n #1 { +\cs_new:Nn \um_config_bffrak_latin:n { \um_set_mathalphabet_latin:Nnn \mathbffrak {up,it}{#1} } % \end{macrocode} % % \subsubsection{Bold script or calligraphic: \cmd\mathbfscr} % \begin{macrocode} -\cs_new:Npn \um_config_bfscr_Latin:n #1 { +\cs_new:Nn \um_config_bfscr_Latin:n { \um_set_mathalphabet_Latin:Nnn \mathbfscr {up,it}{#1} } -\cs_new:Npn \um_config_bfscr_latin:n #1 { +\cs_new:Nn \um_config_bfscr_latin:n { \um_set_mathalphabet_latin:Nnn \mathbfscr {up,it}{#1} } -\cs_new:Npn \um_config_bfcal_Latin:n #1 { +\cs_new:Nn \um_config_bfcal_Latin:n { \um_set_mathalphabet_Latin:Nnn \mathbfcal {up,it}{#1} } % \end{macrocode} % % \subsubsection{Bold upright sans serif: \cmd\mathbfsfup} % \begin{macrocode} -\cs_new:Npn \um_config_bfsfup_num:n #1 { +\cs_new:Nn \um_config_bfsfup_num:n { \um_set_mathalphabet_numbers:Nnn \mathbfsf {up}{#1} \um_set_mathalphabet_numbers:Nnn \mathbfsfup {up}{#1} } -\cs_new:Npn \um_config_bfsfup_Latin:n #1 { +\cs_new:Nn \um_config_bfsfup_Latin:n { \bool_if:NTF \g_um_sfliteral_bool { \um_map_chars_Latin:nn {bfsfup} {#1} \um_set_mathalphabet_Latin:Nnn \mathbfsf {up}{#1} @@ -4403,7 +4490,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } \um_set_mathalphabet_Latin:Nnn \mathbfsfup {up,it}{#1} } -\cs_new:Npn \um_config_bfsfup_latin:n #1 { +\cs_new:Nn \um_config_bfsfup_latin:n { \bool_if:NTF \g_um_sfliteral_bool { \um_map_chars_latin:nn {bfsfup} {#1} \um_set_mathalphabet_latin:Nnn \mathbfsf {up}{#1} @@ -4415,7 +4502,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } \um_set_mathalphabet_latin:Nnn \mathbfsfup {up,it}{#1} } -\cs_new:Npn \um_config_bfsfup_Greek:n #1 { +\cs_new:Nn \um_config_bfsfup_Greek:n { \bool_if:NTF \g_um_sfliteral_bool { \um_map_chars_Greek:nn {bfsfup}{#1} \um_set_mathalphabet_Greek:Nnn \mathbfsf {up}{#1} @@ -4427,7 +4514,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } \um_set_mathalphabet_Greek:Nnn \mathbfsfup {up,it}{#1} } -\cs_new:Npn \um_config_bfsfup_greek:n #1 { +\cs_new:Nn \um_config_bfsfup_greek:n { \bool_if:NTF \g_um_sfliteral_bool { \um_map_chars_greek:nn {bfsfup} {#1} \um_set_mathalphabet_greek:Nnn \mathbfsf {up} {#1} @@ -4439,7 +4526,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } \um_set_mathalphabet_greek:Nnn \mathbfsfup {up,it} {#1} } -\cs_new:Npn \um_config_bfsfup_misc:n #1 { +\cs_new:Nn \um_config_bfsfup_misc:n { \bool_if:NTF \g_um_literal_Nabla_bool { \um_map_single:nnn {Nabla}{bfsfup}{#1} }{ @@ -4476,7 +4563,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % % \subsubsection{Bold italic sans serif: \cmd\mathbfsfit} % \begin{macrocode} -\cs_new:Npn \um_config_bfsfit_Latin:n #1 { +\cs_new:Nn \um_config_bfsfit_Latin:n { \bool_if:NTF \g_um_sfliteral_bool { \um_map_chars_Latin:nn {bfsfit} {#1} \um_set_mathalphabet_Latin:Nnn \mathbfsf {it}{#1} @@ -4488,7 +4575,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } \um_set_mathalphabet_Latin:Nnn \mathbfsfit {up,it}{#1} } -\cs_new:Npn \um_config_bfsfit_latin:n #1 { +\cs_new:Nn \um_config_bfsfit_latin:n { \bool_if:NTF \g_um_sfliteral_bool { \um_map_chars_latin:nn {bfsfit} {#1} \um_set_mathalphabet_latin:Nnn \mathbfsf {it}{#1} @@ -4500,7 +4587,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } \um_set_mathalphabet_latin:Nnn \mathbfsfit {up,it}{#1} } -\cs_new:Npn \um_config_bfsfit_Greek:n #1 { +\cs_new:Nn \um_config_bfsfit_Greek:n { \bool_if:NTF \g_um_sfliteral_bool { \um_map_chars_Greek:nn {bfsfit}{#1} \um_set_mathalphabet_Greek:Nnn \mathbfsf {it}{#1} @@ -4512,7 +4599,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } \um_set_mathalphabet_Greek:Nnn \mathbfsfit {up,it}{#1} } -\cs_new:Npn \um_config_bfsfit_greek:n #1 { +\cs_new:Nn \um_config_bfsfit_greek:n { \bool_if:NTF \g_um_sfliteral_bool { \um_map_chars_greek:nn {bfsfit} {#1} \um_set_mathalphabet_greek:Nnn \mathbfsf {it} {#1} @@ -4524,7 +4611,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } \um_set_mathalphabet_greek:Nnn \mathbfsfit {up,it} {#1} } -\cs_new:Npn \um_config_bfsfit_misc:n #1 { +\cs_new:Nn \um_config_bfsfit_misc:n { \bool_if:NTF \g_um_literal_Nabla_bool { \um_map_single:nnn {Nabla}{bfsfit}{#1} }{ @@ -4569,7 +4656,8 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % In time, the case statement inside |set_mathsymbol| will be moved in here % to avoid re-running it every time. % \begin{macrocode} -\xetex_or_luatex:nnn { \cs_set:Npn \um_symbol_setup: } +\cs_new:Npn \um_symbol_setup: +%<*XE> { \cs_set:Npn \UnicodeMathSymbol ##1##2##3##4 { \prg_case_tl:Nnn ##3 { \mathover {} \mathunder {} } @@ -4578,11 +4666,14 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } } } +%</XE> +%<*LU> { \cs_set:Npn \UnicodeMathSymbol ##1##2##3##4 { \exp_not:n {\_um_sym:nnn{##1}{##2}{##3}} } } +%</LU> % \end{macrocode} % % \begin{macrocode} @@ -4593,7 +4684,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \begin{macro}{\um_input_math_symbol_table:} % This function simply expands to the token list containing all the data. % \begin{macrocode} -\cs_new:Npn \um_input_math_symbol_table: {\g_um_mathtable_tl} +\cs_new:Nn \um_input_math_symbol_table: {\g_um_mathtable_tl} % \end{macrocode} % \end{macro} % @@ -4613,18 +4704,19 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % to perform the lowercasing and |\let|. \cmd\scantokens\ changes the carets % back into their original meaning after the group has ended and |^|'s catcode returns to normal. % \begin{macrocode} -\begingroup +\group_begin: \char_set_catcode_other:N \^ \cs_gset:Npn \um_cs_set_eq_active_char:Nw #1 = "#2 \q_nil { - \lowercase{ + \tex_lowercase:D { \tl_rescan:nn { + \ExplSyntaxOn \char_set_catcode_other:N \{ \char_set_catcode_other:N \} \char_set_catcode_other:N \& \char_set_catcode_other:N \% \char_set_catcode_other:N \$ }{ - \global\let#1=^^^^^#2 + \cs_gset_eq:NN #1 ^^^^^#2 } } } @@ -4634,18 +4726,13 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % Because we're inside a |\tl_rescan:nn|, use plain old \TeX\ syntax to avoid % any catcode problems. % \begin{macrocode} - \cs_gnew:Npn \um_active_char_set:wc "#1 \q_nil #2 { - \lowercase { - \tl_rescan:nn { - \catcode`\_=11\relax - \catcode`\:=11\relax - \catcode`\^=7\relax - }{ - \protected\gdef^^^^^#1{\csname #2\endcsname}% - } + \cs_new:Npn \um_active_char_set:wc "#1 \q_nil #2 { + \tex_lowercase:D { + \tl_rescan:nn { \ExplSyntaxOn } + { \cs_gset_protected_nopar:Npx ^^^^^#1 { \exp_not:c {#2} } } } } -\endgroup +\group_end: % \end{macrocode} % \end{macro} % \end{macro} @@ -4657,7 +4744,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % make sure |#| is an `other' so that we don't get confused with \cs{mathoctothorpe}. % \begin{macrocode} \AtBeginDocument{\um_define_math_chars:} -\cs_set:Nn \um_define_math_chars: { +\cs_new:Nn \um_define_math_chars: { \group_begin: \char_set_catcode_math_superscript:N \^ \cs_set:Npn \_um_sym:nnn ##1##2##3 { @@ -4749,8 +4836,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \cs_new:Nn \um_arg_i_before_egroup:n {#1\egroup} \cs_new:Nn \um_superscript:n { ^\bgroup #1 - \peek_meaning_remove:NTF ^ - \um_arg_i_before_egroup:n \egroup + \peek_meaning_remove:NTF ^ \um_arg_i_before_egroup:n \egroup } % \end{macrocode} % @@ -4761,13 +4847,13 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \end{macrocode} % % \begin{macrocode} -\cs_new:Npn \um_nprimes:Nn #1#2 { +\cs_new:Nn \um_nprimes:Nn { \um_superscript:n { #1 \prg_replicate:nn {#2-1} { \mskip \g_um_primekern_muskip #1 } } } -\cs_new:Npn \um_nprimes_select:nn #1#2 { +\cs_new:Nn \um_nprimes_select:nn { \prg_case_int:nnn {#2}{ {1} { \um_superscript:n {#1} } {2} { @@ -4789,7 +4875,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \um_nprimes:Nn #1 {#2} } } -\cs_new:Npn \um_nbackprimes_select:nn #1#2 { +\cs_new:Nn \um_nbackprimes_select:nn { \prg_case_int:nnn {#2}{ {1} { \um_superscript:n {#1} } {2} { @@ -4847,7 +4933,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \int_set:Nn \l_um_primecount_int {3} \um_scanprime_collect:N \um_prime_single_mchar } -\cs_new:Npn \um_scanprime_collect:N #1 { +\cs_new:Nn \um_scanprime_collect:N { \int_incr:N \l_um_primecount_int \peek_meaning_remove:NTF ' { \um_scanprime_collect:N #1 @@ -4920,7 +5006,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \int_set:Nn \l_um_primecount_int {2} \um_scanbackprime_collect:N \um_backprime_single_mchar } -\cs_new:Npn \um_scanbackprime_collect:N #1 { +\cs_new:Nn \um_scanbackprime_collect:N { \int_incr:N \l_um_primecount_int \peek_meaning_remove:NTF ` { \um_scanbackprime_collect:N #1 @@ -4960,7 +5046,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % % \begin{macrocode} \AtBeginDocument{\um_define_prime_commands: \um_define_prime_chars:} -\cs_set:Nn \um_define_prime_commands: { +\cs_new:Nn \um_define_prime_commands: { \cs_set_eq:NN \prime \um_prime_single_mchar \cs_set_eq:NN \dprime \um_prime_double_mchar \cs_set_eq:NN \trprime \um_prime_triple_mchar @@ -4997,7 +5083,9 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % % \begin{macrocode} \AtBeginDocument{\um_redefine_radical:} -\xetex_or_luatex:nnn { \cs_set:Nn \um_redefine_radical: } { +\cs_new:Nn \um_redefine_radical: +%<*XE> + { \@ifpackageloaded { amsmath } { } { % \end{macrocode} % \begin{macro}{\r@@t} @@ -5031,7 +5119,10 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \end{macro} % \begin{macrocode} } -} { + } +%</XE> +%<*LU> + { \@ifpackageloaded { amsmath } { } { % \end{macrocode} % \begin{macro}{\root} @@ -5044,20 +5135,30 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \end{macro} % \begin{macrocode} } -} + } +%</LU> % \end{macrocode} % % % \begin{macro}{\um_fontdimen_to_percent:nn} +% \begin{macro}{\um_fontdimen_to_scale:nn} % \darg{Font dimen number} % \darg{Font `variable'} -% \cmd\fontdimen s |10|, |11|, and |65| aren't actually dimensions, they're percentage values given in units of |sp|. This macro takes a font dimension number and outputs the decimal value of the associated parameter. +% \cmd\fontdimen s |10|, |11|, and |65| aren't actually dimensions, they're percentage values given in units of |sp|. +% \cs{um_fontdimen_to_percent:nn} takes a font dimension number and outputs the decimal value of the associated parameter. +% \cs{um_fontdimen_to_scale:nn} returns a dimension correspond to the current +% font size relative proportion based on that percentage. % \begin{macrocode} -\cs_new:Npn \um_fontdimen_to_percent:nn #1#2 { +\cs_new:Nn \um_fontdimen_to_percent:nn { \strip@pt\dimexpr\fontdimen#1#2*65536/100\relax } +\cs_new:Nn \um_fontdimen_to_scale:nn + { + \um_fontdimen_to_percent:nn {#1} {#2} \dimexpr \f@size pt\relax + } % \end{macrocode} % \end{macro} +% \end{macro} % % \begin{macro}{\um_mathstyle_scale:Nnn} % \darg{A math style (\cs{scriptstyle}, say)} @@ -5065,7 +5166,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \darg{Length control sequence to be scaled according to the math style} % This macro is used to scale the lengths reported by \cmd\fontdimen\ according to the scale factor for script- and scriptscript-size objects. % \begin{macrocode} -\cs_new:Npn \um_mathstyle_scale:Nnn #1#2#3 { +\cs_new:Nn \um_mathstyle_scale:Nnn { \ifx#1\scriptstyle #2\um_fontdimen_to_percent:nn{10}\l_um_font#3 \else @@ -5106,7 +5207,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \cs{scantokens} makes this process much simpler since we can activate the % char and assign its meaning in one step. % \begin{macrocode} -\cs_set:Npn \um_setup_active_superscript:nn #1#2 { +\cs_new:Nn \um_setup_active_superscript:nn { \prop_gput:Nxn \g_um_supers_prop {\meaning #1} {#2} \char_set_catcode_active:N #1 \char_gmake_mathactive:N #1 @@ -5142,7 +5243,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \end{macrocode} % \paragraph{Subscripts} Ditto above. % \begin{macrocode} -\cs_set:Npn \um_setup_active_subscript:nn #1#2 { +\cs_new:Nn \um_setup_active_subscript:nn { \prop_gput:Nxn \g_um_subs_prop {\meaning #1} {#2} \char_set_catcode_active:N #1 \char_gmake_mathactive:N #1 @@ -5203,13 +5304,14 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \end{macrocode} % The main theme here is stolen from the source to the various \cs{peek_} functions. % Consider this function as simply boilerplate: +% TODO: move all this to expl3, and don't use internal expl3 macros. % \begin{macrocode} \cs_new:Npn \um_scan_sscript:TF #1#2 { - \tl_set:Nx \l_peek_true_aux_tl { \exp_not:n{ #1 } } - \tl_set_eq:NN \l_peek_true_tl \c_peek_true_remove_next_tl - \tl_set:Nx \l_peek_false_tl {\exp_not:n{\group_align_safe_end: #2}} + \tl_set:Nx \peek_true_aux:w { \exp_not:n{ #1 } } + \tl_set_eq:NN \peek_true:w \peek_true_remove:w + \tl_set:Nx \peek_false:w { \exp_not:n { \group_align_safe_end: #2 } } \group_align_safe_begin: - \peek_after:NN \um_peek_execute_branches_ss: + \peek_after:Nw \um_peek_execute_branches_ss: } % \end{macrocode} % We do not skip spaces when scanning ahead, and we explicitly wish to @@ -5221,7 +5323,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \token_if_eq_catcode_p:NN \l_peek_token \c_group_end_token || \token_if_eq_meaning_p:NN \l_peek_token \c_space_token } - { \l_peek_false_tl } + { \peek_false:w } { \um_peek_execute_branches_ss_aux: } } % \end{macrocode} @@ -5238,17 +5340,14 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \begin{macrocode} \cs_new:Npn \um_peek_execute_branches_ss_aux: { \prop_if_in:cxTF - {g_um_\l_um_tmpa_tl _prop} - {\meaning\l_peek_token} + {g_um_\l_um_tmpa_tl _prop} {\meaning\l_peek_token} { - \prop_get:cxN - {g_um_\l_um_tmpa_tl _prop} - {\meaning\l_peek_token} - \l_um_tmpb_tl + \prop_get:cxN + {g_um_\l_um_tmpa_tl _prop} {\meaning\l_peek_token} \l_um_tmpb_tl \tl_put_right:NV \l_um_ss_chain_tl \l_um_tmpb_tl - \l_peek_true_tl + \peek_true:w } - {\l_peek_false_tl} + { \peek_false:w } } % \end{macrocode} % @@ -5301,6 +5400,51 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \um_setup_active_frac: % \end{macrocode} % +% \subsection{\XeTeX\ over- and under- brace, paren, bracket} +% Thanks to Claudio Beccari for this code. +% \begin{macrocode} +%<*XE> +\cs_new:Nn \um_over_bracket:nN + { + \mathop { \vbox { + \setbox\z@\hbox{$\displaystyle#1$} + \dimen@=\dimexpr\wd\z@+3\p@\relax + \setbox\tw@\hbox{$\left #2 \vcenter to\dimen@{\vss} \right. $} + \m@th\ialign + { + ##\crcr\noalign{\kern-\p@}% + \rotatebox[origin=Bl]{-90} + {\box\tw@}\crcr\noalign{\kern0\p@\nointerlineskip}% + \hfil\box\z@\hfil\crcr + } + } } \limits + } +% \end{macrocode} +% +% \begin{macrocode} +\cs_new:Nn \um_under_bracket:nN + { + \mathop { \vtop { + \setbox\z@\hbox{$\displaystyle#1$} + \dimen@=\dimexpr\wd\z@+3\p@\relax + \setbox\tw@\hbox{$\left #2 \vcenter to\dimen@{\vss} \right. $} + \m@th\ialign + { + ##\crcr\hfil\box\z@\hfil\crcr + \noalign{\kern1\p@\nointerlineskip}% + \rotatebox[origin=Br]{-90}{\box\tw@}\crcr\noalign{\kern0\p@} + } + } } \limits + } +\DeclareDocumentCommand \overbrace {m} { \um_over_bracket:nN {#1} \{ } +\DeclareDocumentCommand \overbracket {m} { \um_over_bracket:nN {#1} [ } +\DeclareDocumentCommand \overparen {m} { \um_over_bracket:nN {#1} ( } +\DeclareDocumentCommand \underbrace {m} { \um_under_bracket:nN {#1} \} } +\DeclareDocumentCommand \underbracket {m} { \um_under_bracket:nN {#1} ] } +\DeclareDocumentCommand \underparen {m} { \um_under_bracket:nN {#1} ) } +%</XE> +% \end{macrocode} +% % \subsection{Synonyms and all the rest} % % These are symbols with multiple names. Eventually to be taken care of @@ -5324,6 +5468,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \def\owns{\ni} \def\gets{\leftarrow} \def\mathring{\ocirc} +\def\lnot{\neg} % \end{macrocode} % These are somewhat odd: (and their usual Unicode uprightness does not match their amssymb glyphs) % \begin{macrocode} @@ -5408,7 +5553,9 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \msg_info:nnx { unicode-math } { patch-macro } { \token_to_str:N #1 } \group_end: - \xetex_or_luatex:nnn { #2 #1 #3 } { #6 } { #5 } + #2 #1 #3 +%<XE> { #6 } +%<LU> { #5 } } { \msg_warning:nnxxx { unicode-math } { wrong-meaning } { \token_to_str:N #1 } { \token_to_meaning:N #1 } @@ -5490,14 +5637,14 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % Since the mathcode of |`\-| is greater than eight bits, this piece of |\AtBeginDocument| code from \pkg{amsmath} dies if we try and set the maths font in the preamble: % \begin{macrocode} \AtEndOfPackageFile * {amsmath} { - \xetex_if_engine:T { - \tl_remove_in:Nn \@begindocumenthook { +%<*XE> + \tl_remove_once:Nn \@begindocumenthook { \mathchardef\std@minus\mathcode`\-\relax \mathchardef\std@equal\mathcode`\=\relax } \def\std@minus{\Umathcharnum\Umathcodenum`\-\relax} \def\std@equal{\Umathcharnum\Umathcodenum`\=\relax} - } +%</XE> % \end{macrocode} % % \begin{macrocode} @@ -5506,16 +5653,14 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \end{macrocode} % This isn't as clever as the \pkg{amsmath} definition but I think it works: % \begin{macrocode} - \xetex_if_engine:T { +%<*XE> \def \resetMathstrut@ {% \setbox\z@\hbox{$($}%) \ht\Mathstrutbox@\ht\z@ \dp\Mathstrutbox@\dp\z@ } - } % \end{macrocode} % The |subarray| environment uses inappropriate font dimensions. % \begin{macrocode} - \xetex_if_engine:T { \um_check_and_fix:NNnnn \subarray \cs_set:Npn { #1 } { \vcenter \bgroup @@ -5561,7 +5706,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \hfil \crcr } - } +%</XE> % \end{macrocode} % The roots need a complete rework. % \begin{macrocode} @@ -5693,11 +5838,16 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \end{macrocode} % \paragraph{Accents} % \begin{macrocode} -\xetex_or_luatex:nnn { \cs_new_protected_nopar:Npn \um_setup_accents: } { +\cs_new_protected_nopar:Nn \um_setup_accents: +%<*XE> + { \def\widehat{\hat} \def\widetilde{\tilde} \def\overrightarrow{\vec} -} { + } +%</XE> +%<*LU> + { \cs_gset_protected_nopar:Npx \widehat { \um_wide_top_accent:Nnn \mathaccent { \um_symfont_tl } { "0302 } } @@ -5727,12 +5877,13 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \um_wide_bottom_accent:Nnn \mathaccent { \um_symfont_tl } { "20EF } } } -} + } +%</LU> % \end{macrocode} % % \begin{macrocode} \cs_set_eq:NN \um_text_slash: \slash -\cs_set:Npn \slash { +\cs_set_protected:Npn \slash { \mode_if_math:TF {\mathslash} {\um_text_slash:} } % \end{macrocode} @@ -5742,8 +5893,12 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % % \begin{macrocode} \AtEndOfPackageFile * { mathtools } { - \xetex_if_engine:T { - \um_check_and_fix:NNnnn \MT_cramped_internal:Nn \cs_set_nopar:Npn { #1 #2 } { +%<*XE> + \chk_if_free_cs:N \g_um_empty_fam + \newfam \g_um_empty_fam + \um_check_and_fix:NNnnn + \MT_cramped_internal:Nn \cs_set_nopar:Npn { #1 #2 } + { \sbox \z@ { $ \m@th @@ -5771,17 +5926,19 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \advance \dimen@ -\ht\z@ \ht\z@ = -\dimen@ \box\z@ - } { + } % \end{macrocode} % The \XeTeX\ version is pretty similar to the legacy version, only using the correct font dimensions. +% Note we used `\verb|\XeTeXradical|' with a newly-allocated empty family to make sure that the radical rule width is not set. % \begin{macrocode} + { \hbox_set:Nn \l_tmpa_box { \color@setgroup \c_math_toggle_token \m@th #1 \dim_zero:N \nulldelimiterspace - \radical \c_zero { #2 } + \XeTeXradical \g_um_empty_fam \c_zero { #2 } \c_math_toggle_token \color@endgroup } @@ -5794,7 +5951,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } \box_use_clear:N \l_tmpa_box } - } +%</XE> % \end{macrocode} % % \begin{macro}{\dblcolon} @@ -5848,22 +6005,9 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \end{macro} % \end{macro} % -% \paragraph{\pkg{beamer}} -% \begin{macrocode} -\@ifclassloaded{beamer}{ - \ifbeamer@suppressreplacements\else - \um_warning:n {disable-beamer} - \beamer@suppressreplacementstrue - \fi -}{} -% \end{macrocode} -% % \begin{macrocode} \ExplSyntaxOff -% \end{macrocode} -% -% \begin{macrocode} -%</package> +%</package&(XE|LU)> % \end{macrocode} % % \section{Error messages} @@ -5879,16 +6023,11 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % Wrapper functions: % \begin{macrocode} \cs_new:Npn \um_warning:n { \msg_warning:nn {unicode-math} } -\cs_new:Npn \um_trace:n { \msg_trace:nn {unicode-math} } -\cs_new:Npn \um_trace:nx { \msg_trace:nnx {unicode-math} } +\cs_new:Npn \um_log:n { \msg_log:nn {unicode-math} } +\cs_new:Npn \um_log:nx { \msg_log:nnx {unicode-math} } % \end{macrocode} % % \begin{macrocode} -\msg_new:nnn {unicode-math} {disable-beamer} -{ - Disabling~ beamer's~ math~ setup.\\ - Please~ load~ beamer~ with~ the~ [professionalfonts]~ class~ option. -} \msg_new:nnn {unicode-math} {no-tfrac} { Small~ fraction~ command~ \protect\tfrac\ not~ defined.\\ @@ -5896,7 +6035,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ } \msg_new:nnn {unicode-math} {default-math-font} { - Defining~ the~ default~ maths~ font~ as~ '#1'. + Defining~ the~ default~ maths~ font~ as~ '\l_um_fontname_tl'. } \msg_new:nnn {unicode-math} {setup-implicit} { @@ -5923,6 +6062,12 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ is~ not~ supported.~ Either~ select~ a~ Unicode~ math~ font,~ or~ don't~ load \\ the~ unicode-math~ package. } +\msg_new:nnn { unicode-math } { missing-alphabets } + { + Missing~math~alphabets~in~font~ "\fontname\l_um_font" \\ \\ + \seq_map_function:NN \l_um_missing_alph_seq \um_print_indent:n + } +\cs_new:Nn \um_print_indent:n { \space\space\space\space #1 \\ } \msg_new:nnn {unicode-math} {macro-expected} { I've~ expected~ that~ #1~ is~ a~ macro,~ but~ it~ isn't. @@ -6170,7 +6315,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \mathfontdimen{Sub\-Superscript\-Gap\-Min} % {Minimum gap between the superscript and subscript ink. Suggested: 4×default rule thickness.} % \mathfontdimen{Superscript\-Bottom\-Max\-With\-Subscript} -% {The maximum level to which the (ink) bottom of superscript can be pushed to increase the gap between superscript and subscript, before subscript starts being moved down. +% {The maximum level to which the (ink) bottom of superscript can be pushed to increase the gap between superscript and subscript, before subscript starts being moved down. % Suggested: /5 x-height.} % \mathfontdimen{Space\-After\-Script} % {Extra white space to be added after each subscript and superscript. Suggested: 0.5pt for a 12 pt font.} @@ -6282,8 +6427,8 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \renewenvironment{theglossary} {\small\list{}{} \item\relax - \glossary@prologue\GlossaryParms - \let\item\@idxitem \ignorespaces + \glossary@prologue\GlossaryParms + \let\item\@idxitem \ignorespaces \def\pfill{\hspace*{\fill}}} {\endlist} @@ -6355,6 +6500,9 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ \catcode`\_=11\relax \catcode`\:=11\relax } + +\def\partname{Part} + % \end{macrocode} %</dtx-style> %\fi @@ -6369,4 +6517,5 @@ luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_ % \typeout{*************************************************************} % \endinput - + + diff --git a/Master/texmf-dist/source/latex/unicode-math/unimath-symbols.ltx b/Master/texmf-dist/source/latex/unicode-math/unimath-symbols.ltx index b5dcc98dbfc..451fd687ca5 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unimath-symbols.ltx +++ b/Master/texmf-dist/source/latex/unicode-math/unimath-symbols.ltx @@ -6,7 +6,7 @@ \documentclass{article} \makeatletter -\usepackage{booktabs,longtable,shortvrb,geometry,varwidth,textcomp,hyperref} +\usepackage{booktabs,shortvrb,geometry,varwidth,textcomp,longtable,hyperref} \geometry{margin=3cm} \hypersetup{colorlinks,linkcolor=black} @@ -14,26 +14,78 @@ \def\cmd#1{\texttt{\textbackslash\expandafter\@gobble\string#1}} \usepackage{fontspec} -\setmainfont[Ligatures=TeX,Numbers={Monospaced}]{TeX Gyre Pagella} +\setmainfont[Ligatures=TeX,Numbers={Lowercase,Monospaced}]{TeX Gyre Pagella} \usepackage{unicode-math} -\setmathfont[SizeFeatures={ - {Size=-10, Colour=888888}, - {Size=10-, Colour=FF0000}}]{XITS Math} +\setmathfont{XITS Math} + +\newcounter{lm} +\setcounter{lm}{-1} +\setmathfont[version=lm,SizeFeatures={ + {Size=-10, Colour=999999}, + {Size=10-, Colour=CC6666}}]{lmmath-regular.otf} + +\newcounter{xits} +\setcounter{xits}{-1} +\setmathfont[version=xits,SizeFeatures={ + {Size=-10, Colour=999999}, + {Size=10-, Colour=CCCC66}}]{xits-math.otf} + +\newcounter{lucida} +\setcounter{lucida}{-1} +\setmathfont[version=lucida,SizeFeatures={ + {Size=-10, Colour=999999}, + {Size=10-, Colour=66CC66}}]{Lucida Math} + +\newcounter{lucibold} +\setcounter{lucibold}{-1} +\setmathfont[version=lucibold,SizeFeatures={ + {Size=-10, Colour=999999}, + {Size=10-, Colour=66CC66}}]{Lucida Math Demibold} + +\newcounter{cambria} +\setcounter{cambria}{-1} +\setmathfont[version=cambria,SizeFeatures={ + {Size=-10, Colour=999999}, + {Size=10-, Colour=66CCCC}}]{Cambria Math} + +\newcounter{asana} +\setcounter{asana}{-1} +\setmathfont[version=asana,SizeFeatures={ + {Size=-10, Colour=999999}, + {Size=10-, Colour=6666CC}}]{Asana-Math.otf} + +\newcounter{euler} +\setcounter{euler}{-1} +\setmathfont[version=euler,SizeFeatures={ + {Size=-10, Colour=999999}, + {Size=10-, Colour=CC66CC}}]{Neo Euler} + +\ExplSyntaxOn +\fontspec_set_fontface:NNnn \lm \x {} {lmmath-regular.otf} +\fontspec_set_fontface:NNnn \xits \x {} {xits-math.otf} +\fontspec_set_fontface:NNnn \lucida \x {} {Lucida~ Math} +\fontspec_set_fontface:NNnn \lucibold \x {} {Lucida~ Math~ Demibold} +\fontspec_set_fontface:NNnn \cambria \x {} {Cambria~ Math} +\fontspec_set_fontface:NNnn \asana \x {} {Asana-Math.otf} +\fontspec_set_fontface:NNnn \euler \x {} {Neo~ Euler} +\ExplSyntaxOff \def\TABLE{% -\begin{longtable}[l]{@{}lcll@{}} -\toprule -\textsc{usv} & Ex. & Macro & Description \\ -\midrule -\input unicode-math-table.tex\relax\\ -\bottomrule +\setlength\LTleft{-2cm} +\par\noindent +\begin{longtable}[l]{@{}lcccccccll@{}} + \toprule + \textsc{usv} & M & X & C & L & D & A & E & Macro & Description \\ + \midrule \endhead + \input unicode-math-table.tex\relax\\ + \bottomrule \end{longtable} } -\def\USV#1{\small\scshape\MakeLowercase{U+\@gobble#1}} -\def\CMD#1{\small\cmd#1} +\def\USV#1{\footnotesize\scshape\MakeLowercase{\@gobble#1}} +\def\CMD#1{\footnotesize\cmd#1} \def\DESC#1{% - \begin{varwidth}[t]{10cm} - \raggedright\linespread{0.6}\scshape#1% + \begin{varwidth}[t]{6cm} + \raggedright\linespread{0.6}\scriptsize #1% \end{varwidth} } @@ -42,16 +94,29 @@ \def\1{#1}\def\2{##3}% \ifx\1\2% \def\tempa{% - \USV{##1} &% - \SYMB{##2} &% - \CMD{##2} & \DESC{##4}\\% + \USV{##1} & + \SYMB{##2}{lm}{##1} & + \SYMB{##2}{xits}{##1} & + \SYMB{##2}{cambria}{##1} & + \SYMB{##2}{lucida}{##1} & + \SYMB{##2}{lucibold}{##1} & + \SYMB{##2}{asana}{##1} & + \SYMB{##2}{euler}{##1} & + \CMD{##2} & + \DESC{##4} \\% }% \expandafter\tempa \fi }% \TABLE } -\def\SYMB#1{$\displaystyle#1$} +\def\SYMB#1#2#3{% + \expandafter\iffontchar\csname#2\endcsname #3\relax + \refstepcounter{#2}% + \mathversion{#2}% + $\displaystyle#1$% + \fi +} \begin{document} \MakeShortVerb\| @@ -61,7 +126,18 @@ This document uses the file \texttt{unicode-math-table.tex} to print every symbol defined by the \textsf{unicode-math} -package. Use this document to find the command name or the Unicode glyph slot for a symbol that you wish to use. +package. +Use this document to find the command name or the Unicode glyph slot for a symbol that you wish to use. +Seven fonts are shown: (with approximate symbol counts) +\begin{itemize} +\item[M] \mathversion{lm} $\mathup{Latin\ Modern\ Math}$ (\ref{count:lm}) +\item[X] \mathversion{xits} $\mathup{XITS\ Math}$ (\ref{count:xits}) +\item[C] \mathversion{cambria} $\mathup{Cambria\ Math}$ (\ref{count:cambria}) +\item[L] \mathversion{lucida} $\mathup{Lucida\ Math}$ (\ref{count:lucida}) +\item[D] \mathversion{lucibold} $\mathup{Lucida\ Math\ Demibold}$ (\ref{count:lucibold}) +\item[A] \mathversion{asana} $\mathup{Asana\ Math}$ (\ref{count:asana}) +\item[E] \mathversion{euler} $\mathup{Neo\ Euler}$ (\ref{count:euler}) +\end{itemize} \tableofcontents @@ -90,7 +166,13 @@ package. Use this document to find the command name or the Unicode glyph slot fo Note that accents will only be properly placed if used with an OpenType font with the necessary information. \begingroup -\def\SYMB#1{$\displaystyle#1 x$} +\def\SYMB#1#2#3{% + \expandafter\iffontchar\csname#2\endcsname #3\relax + \refstepcounter{#2}% + \mathversion{#2}% + $\displaystyle#1 x$% + \fi +} \SHOW\mathaccent \endgroup @@ -100,7 +182,13 @@ Note that accents will only be properly placed if used with an OpenType font wit Of the operators shown below, a subset need to be flagged by \textsf{unicode-math} for \cmd\nolimits\ adjustments. The limits behaviour as specified by \textsf{unicode-math} are shown with grey subscripts and superscripts. \begingroup -\def\SYMB#1{$\displaystyle#1_0^1$} +\def\SYMB#1#2#3{% + \expandafter\iffontchar\csname#2\endcsname #3\relax + \stepcounter{#2}% + \mathversion{#2}% + $\displaystyle#1_0^1$% + \fi +} \SHOW\mathop \endgroup @@ -120,6 +208,12 @@ The limits behaviour as specified by \textsf{unicode-math} are shown with grey s \section{Alphabetical symbols, \cmd\mathalpha} \SHOW\mathalpha - +\refstepcounter{lm}\label{count:lm} +\refstepcounter{xits}\label{count:xits} +\refstepcounter{cambria}\label{count:cambria} +\refstepcounter{lucida}\label{count:lucida} +\refstepcounter{lucibold}\label{count:lucibold} +\refstepcounter{asana}\label{count:asana} +\refstepcounter{euler}\label{count:euler} \end{document} diff --git a/Master/texmf-dist/tex/latex/unicode-math/unicode-math-luatex.sty b/Master/texmf-dist/tex/latex/unicode-math/unicode-math-luatex.sty new file mode 100644 index 00000000000..bf6589a5a06 --- /dev/null +++ b/Master/texmf-dist/tex/latex/unicode-math/unicode-math-luatex.sty @@ -0,0 +1,2495 @@ +%% +%% This is file `unicode-math-luatex.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% unicode-math.dtx (with options: `package,LU') +%% Copyright 2006-2011 Will Robertson <will.robertson@latex-project.org> +%% Copyright 2010-2011 Philipp Stephani <st_philipp@yahoo.de> +%% +%% This package is free software and may be redistributed and/or modified under +%% the conditions of the LaTeX Project Public License, version 1.3c or higher +%% (your choice): <http://www.latex-project.org/lppl/>. +%% +%% This work is "author-maintained" by Will Robertson. +\ExplSyntaxOn +\cs_new:Nn \um_cs_compat:n + { \cs_set_eq:cc {U#1} {luatexU#1} } +\um_cs_compat:n {mathcode} +\um_cs_compat:n {delcode} +\um_cs_compat:n {mathcodenum} +\um_cs_compat:n {mathcharnum} +\um_cs_compat:n {mathchardef} +\um_cs_compat:n {radical} +\um_cs_compat:n {mathaccent} +\um_cs_compat:n {delimiter} +\bool_const:Nn \c_um_have_fixed_accents_bool + { \int_compare_p:n { \luatexversion > 64 } } +\RequirePackage { lualatex-math } [ 2011/08/07 ] +\RequirePackage { luatexbase } +\RequirePackage { luaotfload } [ 2010/11/26 ] +\RequireLuaModule { unicode-math } [ 2011/04/23 ] +\cs_new:Nn \usv_set:nnn { + \tl_set:cn { \um_to_usv:nn {#1}{#2} } {#3} +} +\cs_new:Nn \um_to_usv:nn { g_um_#1_#2_usv } +\usv_set:nnn {up}{num}{48} +\usv_set:nnn {up}{Latin}{65} +\usv_set:nnn {up}{latin}{97} +\usv_set:nnn {up}{Greek}{"391} +\usv_set:nnn {up}{greek}{"3B1} +\usv_set:nnn {it}{Latin}{"1D434} +\usv_set:nnn {it}{latin}{"1D44E} +\usv_set:nnn {it}{Greek}{"1D6E2} +\usv_set:nnn {it}{greek}{"1D6FC} +\usv_set:nnn {bb}{num}{"1D7D8} +\usv_set:nnn {bb}{Latin}{"1D538} +\usv_set:nnn {bb}{latin}{"1D552} +\usv_set:nnn {scr}{Latin}{"1D49C} +\usv_set:nnn {cal}{Latin}{"1D49C} +\usv_set:nnn {scr}{latin}{"1D4B6} +\usv_set:nnn {frak}{Latin}{"1D504} +\usv_set:nnn {frak}{latin}{"1D51E} +\usv_set:nnn {sf}{num}{"1D7E2} +\usv_set:nnn {sfup}{num}{"1D7E2} +\usv_set:nnn {sfit}{num}{"1D7E2} +\usv_set:nnn {sfup}{Latin}{"1D5A0} +\usv_set:nnn {sf}{Latin}{"1D5A0} +\usv_set:nnn {sfup}{latin}{"1D5BA} +\usv_set:nnn {sf}{latin}{"1D5BA} +\usv_set:nnn {sfit}{Latin}{"1D608} +\usv_set:nnn {sfit}{latin}{"1D622} +\usv_set:nnn {tt}{num}{"1D7F6} +\usv_set:nnn {tt}{Latin}{"1D670} +\usv_set:nnn {tt}{latin}{"1D68A} +\usv_set:nnn {bf}{num}{"1D7CE} +\usv_set:nnn {bfup}{num}{"1D7CE} +\usv_set:nnn {bfit}{num}{"1D7CE} +\usv_set:nnn {bfup}{Latin}{"1D400} +\usv_set:nnn {bfup}{latin}{"1D41A} +\usv_set:nnn {bfup}{Greek}{"1D6A8} +\usv_set:nnn {bfup}{greek}{"1D6C2} +\usv_set:nnn {bfit}{Latin}{"1D468} +\usv_set:nnn {bfit}{latin}{"1D482} +\usv_set:nnn {bfit}{Greek}{"1D71C} +\usv_set:nnn {bfit}{greek}{"1D736} +\usv_set:nnn {bffrak}{Latin}{"1D56C} +\usv_set:nnn {bffrak}{latin}{"1D586} +\usv_set:nnn {bfscr}{Latin}{"1D4D0} +\usv_set:nnn {bfcal}{Latin}{"1D4D0} +\usv_set:nnn {bfscr}{latin}{"1D4EA} +\usv_set:nnn {bfsf}{num}{"1D7EC} +\usv_set:nnn {bfsfup}{num}{"1D7EC} +\usv_set:nnn {bfsfit}{num}{"1D7EC} +\usv_set:nnn {bfsfup}{Latin}{"1D5D4} +\usv_set:nnn {bfsfup}{latin}{"1D5EE} +\usv_set:nnn {bfsfup}{Greek}{"1D756} +\usv_set:nnn {bfsfup}{greek}{"1D770} +\usv_set:nnn {bfsfit}{Latin}{"1D63C} +\usv_set:nnn {bfsfit}{latin}{"1D656} +\usv_set:nnn {bfsfit}{Greek}{"1D790} +\usv_set:nnn {bfsfit}{greek}{"1D7AA} +\usv_set:nnn {bfsf}{Latin}{ \bool_if:NTF \g_um_upLatin_bool \g_um_bfsfup_Latin_usv \g_um_bfsfit_Latin_usv } +\usv_set:nnn {bfsf}{latin}{ \bool_if:NTF \g_um_uplatin_bool \g_um_bfsfup_latin_usv \g_um_bfsfit_latin_usv } +\usv_set:nnn {bfsf}{Greek}{ \bool_if:NTF \g_um_upGreek_bool \g_um_bfsfup_Greek_usv \g_um_bfsfit_Greek_usv } +\usv_set:nnn {bfsf}{greek}{ \bool_if:NTF \g_um_upgreek_bool \g_um_bfsfup_greek_usv \g_um_bfsfit_greek_usv } +\usv_set:nnn {bf}{Latin}{ \bool_if:NTF \g_um_bfupLatin_bool \g_um_bfup_Latin_usv \g_um_bfit_Latin_usv } +\usv_set:nnn {bf}{latin}{ \bool_if:NTF \g_um_bfuplatin_bool \g_um_bfup_latin_usv \g_um_bfit_latin_usv } +\usv_set:nnn {bf}{Greek}{ \bool_if:NTF \g_um_bfupGreek_bool \g_um_bfup_Greek_usv \g_um_bfit_Greek_usv } +\usv_set:nnn {bf}{greek}{ \bool_if:NTF \g_um_bfupgreek_bool \g_um_bfup_greek_usv \g_um_bfit_greek_usv } +\usv_set:nnn {up}{varTheta}{"3F4} +\usv_set:nnn {up}{Digamma}{"3DC} +\usv_set:nnn {up}{varepsilon}{"3F5} +\usv_set:nnn {up}{vartheta}{"3D1} +\usv_set:nnn {up}{varkappa}{"3F0} +\usv_set:nnn {up}{varphi}{"3D5} +\usv_set:nnn {up}{varrho}{"3F1} +\usv_set:nnn {up}{varpi}{"3D6} +\usv_set:nnn {up}{digamma}{"3DD} +\usv_set:nnn {bfup}{varTheta}{"1D6B9} +\usv_set:nnn {bfup}{Digamma}{"1D7CA} +\usv_set:nnn {bfup}{varepsilon}{"1D6DC} +\usv_set:nnn {bfup}{vartheta}{"1D6DD} +\usv_set:nnn {bfup}{varkappa}{"1D6DE} +\usv_set:nnn {bfup}{varphi}{"1D6DF} +\usv_set:nnn {bfup}{varrho}{"1D6E0} +\usv_set:nnn {bfup}{varpi}{"1D6E1} +\usv_set:nnn {bfup}{digamma}{"1D7CB} +\usv_set:nnn {it}{varTheta}{"1D6F3} +\usv_set:nnn {it}{varepsilon}{"1D716} +\usv_set:nnn {it}{vartheta}{"1D717} +\usv_set:nnn {it}{varkappa}{"1D718} +\usv_set:nnn {it}{varphi}{"1D719} +\usv_set:nnn {it}{varrho}{"1D71A} +\usv_set:nnn {it}{varpi}{"1D71B} +\usv_set:nnn {bfit}{varTheta}{"1D72D} +\usv_set:nnn {bfit}{varepsilon}{"1D750} +\usv_set:nnn {bfit}{vartheta}{"1D751} +\usv_set:nnn {bfit}{varkappa}{"1D752} +\usv_set:nnn {bfit}{varphi}{"1D753} +\usv_set:nnn {bfit}{varrho}{"1D754} +\usv_set:nnn {bfit}{varpi}{"1D755} +\usv_set:nnn {bfsfup}{varTheta}{"1D767} +\usv_set:nnn {bfsfup}{varepsilon}{"1D78A} +\usv_set:nnn {bfsfup}{vartheta}{"1D78B} +\usv_set:nnn {bfsfup}{varkappa}{"1D78C} +\usv_set:nnn {bfsfup}{varphi}{"1D78D} +\usv_set:nnn {bfsfup}{varrho}{"1D78E} +\usv_set:nnn {bfsfup}{varpi}{"1D78F} +\usv_set:nnn {bfsfit}{varTheta} {"1D7A1} +\usv_set:nnn {bfsfit}{varepsilon}{"1D7C4} +\usv_set:nnn {bfsfit}{vartheta} {"1D7C5} +\usv_set:nnn {bfsfit}{varkappa} {"1D7C6} +\usv_set:nnn {bfsfit}{varphi} {"1D7C7} +\usv_set:nnn {bfsfit}{varrho} {"1D7C8} +\usv_set:nnn {bfsfit}{varpi} {"1D7C9} +\usv_set:nnn {up} {Nabla}{"02207} +\usv_set:nnn {it} {Nabla}{"1D6FB} +\usv_set:nnn {bfup} {Nabla}{"1D6C1} +\usv_set:nnn {bfit} {Nabla}{"1D735} +\usv_set:nnn {bfsfup}{Nabla}{"1D76F} +\usv_set:nnn {bfsfit}{Nabla}{"1D7A9} +\usv_set:nnn {up} {partial}{"02202} +\usv_set:nnn {it} {partial}{"1D715} +\usv_set:nnn {bfup} {partial}{"1D6DB} +\usv_set:nnn {bfit} {partial}{"1D74F} +\usv_set:nnn {bfsfup}{partial}{"1D789} +\usv_set:nnn {bfsfit}{partial}{"1D7C3} +\usv_set:nnn {up}{B}{`\B} +\usv_set:nnn {up}{C}{`\C} +\usv_set:nnn {up}{D}{`\D} +\usv_set:nnn {up}{E}{`\E} +\usv_set:nnn {up}{F}{`\F} +\usv_set:nnn {up}{H}{`\H} +\usv_set:nnn {up}{I}{`\I} +\usv_set:nnn {up}{L}{`\L} +\usv_set:nnn {up}{M}{`\M} +\usv_set:nnn {up}{N}{`\N} +\usv_set:nnn {up}{P}{`\P} +\usv_set:nnn {up}{Q}{`\Q} +\usv_set:nnn {up}{R}{`\R} +\usv_set:nnn {up}{Z}{`\Z} +\usv_set:nnn {it}{B}{"1D435} +\usv_set:nnn {it}{C}{"1D436} +\usv_set:nnn {it}{D}{"1D437} +\usv_set:nnn {it}{E}{"1D438} +\usv_set:nnn {it}{F}{"1D439} +\usv_set:nnn {it}{H}{"1D43B} +\usv_set:nnn {it}{I}{"1D43C} +\usv_set:nnn {it}{L}{"1D43F} +\usv_set:nnn {it}{M}{"1D440} +\usv_set:nnn {it}{N}{"1D441} +\usv_set:nnn {it}{P}{"1D443} +\usv_set:nnn {it}{Q}{"1D444} +\usv_set:nnn {it}{R}{"1D445} +\usv_set:nnn {it}{Z}{"1D44D} +\usv_set:nnn {up}{d}{`\d} +\usv_set:nnn {up}{e}{`\e} +\usv_set:nnn {up}{g}{`\g} +\usv_set:nnn {up}{h}{`\h} +\usv_set:nnn {up}{i}{`\i} +\usv_set:nnn {up}{j}{`\j} +\usv_set:nnn {up}{o}{`\o} +\usv_set:nnn {it}{d}{"1D451} +\usv_set:nnn {it}{e}{"1D452} +\usv_set:nnn {it}{g}{"1D454} +\usv_set:nnn {it}{h}{"0210E} +\usv_set:nnn {it}{i}{"1D456} +\usv_set:nnn {it}{j}{"1D457} +\usv_set:nnn {it}{o}{"1D45C} +\usv_set:nnn {bb} {h}{"1D559} +\usv_set:nnn {tt} {h}{"1D691} +\usv_set:nnn {scr} {h}{"1D4BD} +\usv_set:nnn {frak} {h}{"1D525} +\usv_set:nnn {bfup} {h}{"1D421} +\usv_set:nnn {bfit} {h}{"1D489} +\usv_set:nnn {sfup} {h}{"1D5C1} +\usv_set:nnn {sfit} {h}{"1D629} +\usv_set:nnn {bffrak}{h}{"1D58D} +\usv_set:nnn {bfscr} {h}{"1D4F1} +\usv_set:nnn {bfsfup}{h}{"1D5F5} +\usv_set:nnn {bfsfit}{h}{"1D65D} +\usv_set:nnn {up}{dotlessi}{"00131} +\usv_set:nnn {up}{dotlessj}{"00237} +\usv_set:nnn {it}{dotlessi}{"1D6A4} +\usv_set:nnn {it}{dotlessj}{"1D6A5} +\usv_set:nnn {bb}{C}{"2102} +\usv_set:nnn {bb}{H}{"210D} +\usv_set:nnn {bb}{N}{"2115} +\usv_set:nnn {bb}{P}{"2119} +\usv_set:nnn {bb}{Q}{"211A} +\usv_set:nnn {bb}{R}{"211D} +\usv_set:nnn {bb}{Z}{"2124} +\usv_set:nnn {up}{Pi} {"003A0} +\usv_set:nnn {up}{pi} {"003C0} +\usv_set:nnn {up}{Gamma} {"00393} +\usv_set:nnn {up}{gamma} {"003B3} +\usv_set:nnn {up}{summation}{"02211} +\usv_set:nnn {it}{Pi} {"1D6F1} +\usv_set:nnn {it}{pi} {"1D70B} +\usv_set:nnn {it}{Gamma} {"1D6E4} +\usv_set:nnn {it}{gamma} {"1D6FE} +\usv_set:nnn {bb}{Pi} {"0213F} +\usv_set:nnn {bb}{pi} {"0213C} +\usv_set:nnn {bb}{Gamma} {"0213E} +\usv_set:nnn {bb}{gamma} {"0213D} +\usv_set:nnn {bb}{summation}{"02140} +\usv_set:nnn {bbit}{D}{"2145} +\usv_set:nnn {bbit}{d}{"2146} +\usv_set:nnn {bbit}{e}{"2147} +\usv_set:nnn {bbit}{i}{"2148} +\usv_set:nnn {bbit}{j}{"2149} +\usv_set:nnn {scr}{B}{"212C} +\usv_set:nnn {scr}{E}{"2130} +\usv_set:nnn {scr}{F}{"2131} +\usv_set:nnn {scr}{H}{"210B} +\usv_set:nnn {scr}{I}{"2110} +\usv_set:nnn {scr}{L}{"2112} +\usv_set:nnn {scr}{M}{"2133} +\usv_set:nnn {scr}{R}{"211B} +\usv_set:nnn {scr}{e}{"212F} +\usv_set:nnn {scr}{g}{"210A} +\usv_set:nnn {scr}{o}{"2134} +\usv_set:nnn {cal}{B}{"212C} +\usv_set:nnn {cal}{E}{"2130} +\usv_set:nnn {cal}{F}{"2131} +\usv_set:nnn {cal}{H}{"210B} +\usv_set:nnn {cal}{I}{"2110} +\usv_set:nnn {cal}{L}{"2112} +\usv_set:nnn {cal}{M}{"2133} +\usv_set:nnn {cal}{R}{"211B} +\usv_set:nnn {frak}{C}{"212D} +\usv_set:nnn {frak}{H}{"210C} +\usv_set:nnn {frak}{I}{"2111} +\usv_set:nnn {frak}{R}{"211C} +\usv_set:nnn {frak}{Z}{"2128} +\tl_map_inline:nn { + \new@mathgroup\cdp@list\cdp@elt\DeclareMathSizes + \@DeclareMathSizes\newmathalphabet\newmathalphabet@@\newmathalphabet@@@ + \DeclareMathVersion\define@mathalphabet\define@mathgroup\addtoversion + \version@list\version@elt\alpha@list\alpha@elt + \restore@mathversion\init@restore@version\dorestore@version\process@table + \new@mathversion\DeclareSymbolFont\group@list\group@elt + \new@symbolfont\SetSymbolFont\SetSymbolFont@\get@cdp + \DeclareMathAlphabet\new@mathalphabet\SetMathAlphabet\SetMathAlphabet@ + \DeclareMathAccent\set@mathaccent\DeclareMathSymbol\set@mathchar + \set@mathsymbol\DeclareMathDelimiter\@xxDeclareMathDelimiter + \@DeclareMathDelimiter\@xDeclareMathDelimiter\set@mathdelimiter + \set@@mathdelimiter\DeclareMathRadical\mathchar@type + \DeclareSymbolFontAlphabet\DeclareSymbolFontAlphabet@ +}{ + \tl_remove_once:Nn \@preamblecmds {\do#1} +} +\cs_set:Nn \um_set_mathsymbol:nNNn { + \prg_case_tl:Nnn #3 { + \mathop { \um_set_big_operator:nnn {#1} {#2} {#4} } + \mathopen + { + \tl_if_in:NnTF \l_um_radicals_tl {#2} + { + \cs_gset_protected_nopar:cpx {\cs_to_str:N #2 sign} + { \um_radical:nn {#1} {#4} } + \tl_set:cn {l_um_radical_\cs_to_str:N #2_tl} {\use:c{sym #1}~ #4} + } + { + \um_set_delcode:nnn {#1} {#4} {#4} + \um_set_mathcode:nnn {#4} \mathopen {#1} + \cs_gset_protected_nopar:Npx #2 + { \um_delimiter:Nnn \mathopen {#1} {#4} } + } + } + \mathclose + { + \um_set_delcode:nnn {#1} {#4} {#4} + \um_set_mathcode:nnn {#4} \mathclose {#1} + \cs_gset_protected_nopar:Npx #2 + { \um_delimiter:Nnn \mathclose {#1} {#4} } + } + \mathaccent + { \cs_gset_protected_nopar:Npx #2 { \um_accent:Nnn #3 {#1} {#4} } } + \mathfence + { + \um_set_mathcode:nnn {#4} {#3} {#1} + \um_set_delcode:nnn {#1} {#4} {#4} + \cs_gset_protected_nopar:cpx {l \cs_to_str:N #2} + { \um_delimiter:Nnn \mathopen {#1} {#4} } + \cs_gset_protected_nopar:cpx {r \cs_to_str:N #2} + { \um_delimiter:Nnn \mathclose {#1} {#4} } + } + \mathover + { + \cs_set_protected_nopar:Npx #2 ##1 + { \mathop { \um_overbrace:nnn {#1} {#4} {##1} } \limits } + } + \mathunder + { + \cs_set_protected_nopar:Npx #2 ##1 + { \mathop { \um_underbrace:nnn {#1} {#4} {##1} } \limits } + } + }{ + \um_set_mathcode:nnn {#4} {#3} {#1} + } +} +\edef\mathfence{\string\mathfence} +\edef\mathover{\string\mathover} +\edef\mathunder{\string\mathunder} +\cs_new:Nn \um_set_big_operator:nnn { + \group_begin: + \char_set_catcode_active:n {#3} + \char_gmake_mathactive:n {#3} + \um_active_char_set:wc #3 \q_nil { \cs_to_str:N #2 _sym } + \group_end: + \um_set_mathchar:cNnn {\cs_to_str:N #2 op} \mathop {#1} {#3} + \cs_gset:cpx { \cs_to_str:N #2 _sym } { + \exp_not:c { \cs_to_str:N #2 op } + \exp_not:n { \tl_if_in:NnT \l_um_nolimits_tl {#2} \nolimits } + } +} +\cs_set:Npn \um_set_mathcode:nnnn #1#2#3#4 { + \Umathcode \int_eval:n {#1} = + \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#4} \scan_stop: +} +\cs_set:Npn \um_set_mathcode:nnn #1#2#3 { + \Umathcode \int_eval:n {#1} = + \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#1} \scan_stop: +} +\cs_set:Npn \um_set_mathchar:NNnn #1#2#3#4 { + \Umathchardef #1 = + \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#4} \scan_stop: +} +\cs_new:Nn \um_set_delcode:nnn { + \Udelcode#2 = \csname sym#1\endcsname #3 +} +\cs_new:Nn \um_radical:nn { + \Uradical \csname sym#1\endcsname #2 \scan_stop: +} +\cs_new:Nn \um_delimiter:Nnn { + \Udelimiter \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop: +} +\cs_new:Nn \um_accent:Nnn + { + \Umathaccent \c_um_accent_keyword_tl + \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop: + } + \cs_new_nopar:Npn \um_wide_top_accent:Nnn #1 #2 #3 { + \Umathaccent \mathchar@type #1 \use:c { sym #2 } #3 \scan_stop: + } + \bool_if:NTF \c_um_have_fixed_accents_bool { + \cs_new_nopar:Npn \um_wide_bottom_accent:Nnn #1 #2 #3 { + \Umathaccent bottom~ \mathchar@type #1 \use:c { sym #2 } #3 \scan_stop: + } + \tl_const:Nn \c_um_accent_keyword_tl { fixed } + } { + \tl_const:Nn \c_um_accent_keyword_tl { } + } +\cs_generate_variant:Nn \um_set_mathchar:NNnn {c} +\cs_set:Npn \um_overbrace:nnn #1#2#3 { + \luatexUdelimiterover \csname sym#1\endcsname #2 {#3} +} +\cs_set:Npn \um_underbrace:nnn #1#2#3 { + \luatexUdelimiterunder \csname sym#1\endcsname #2 {#3} +} +\cs_new:Nn \char_gmake_mathactive:N { + \global\mathcode `#1 = "8000 \scan_stop: +} +\cs_new:Nn \char_gmake_mathactive:n { + \global\mathcode #1 = "8000 \scan_stop: +} +\cs_new_eq:NN \um_saved_ltxe_glb_settings: \glb@settings +\CheckCommand * \glb@settings { + \expandafter\ifx\csname S@\f@size\endcsname\relax + \calculate@math@sizes + \fi + \csname S@\f@size\endcsname + \ifmath@fonts + \begingroup + \escapechar\m@ne + \csname mv@\math@version \endcsname + \globaldefs\@ne + \math@fonts + \let \glb@currsize \f@size + \endgroup + \the\every@math@size + \fi +} +\cs_set_protected_nopar:Npn \glb@settings { + \msg_error:nn { unicode-math } { no-font-selected } +} +\cs_new:Nn \um_init: { + \bool_set_true:N \l_um_ot_math_bool + \let\glb@currsize\relax + \cs_set_eq:NN \glb@settings \um_saved_ltxe_glb_settings: + \bool_set_true:N \l_um_init_bool + \seq_clear:N \l_um_char_range_seq + \clist_clear:N \l_um_char_num_range_clist + \seq_clear:N \l_um_mathalph_seq + \seq_clear:N \l_um_missing_alph_seq + \tl_set:Nn \l_um_mversion_tl {normal} + \tl_set:Nn \um_symfont_tl {operators} + \cs_set_eq:NN \_um_sym:nnn \um_process_symbol_noparse:nnn + \cs_set_eq:NN \um_set_mathalphabet_char:Nnn \um_mathmap_noparse:Nnn + \cs_set_eq:NN \um_remap_symbol:nnn \um_remap_symbol_noparse:nnn + \cs_set_eq:NN \um_maybe_init_alphabet:n \um_init_alphabet:n + \cs_set_eq:NN \um_map_char_single:nn \um_map_char_noparse:nn + \cs_set_eq:NN \um_assign_delcode:nn \um_assign_delcode_noparse:nn + \cs_set_eq:NN \um_make_mathactive:nNN \um_make_mathactive_noparse:nNN + \tl_set:Nn \l_um_script_features_tl {Style=MathScript} + \tl_set:Nn \l_um_sscript_features_tl {Style=MathScriptScript} + \tl_set_eq:NN \l_um_script_font_tl \l_um_fontname_tl + \tl_set_eq:NN \l_um_sscript_font_tl \l_um_fontname_tl +} +\DeclareDocumentCommand \setmathfont { O{} m } { + \tl_set:Nn \l_um_fontname_tl {#2} + \um_init: + \cs_if_exist:cF { S@ \f@size } { \calculate@math@sizes } + \csname S@\f@size\endcsname + \keys_set_known:nnN {unicode-math} {#1} \l_um_unknown_keys_clist + \bool_if:NT \l_um_init_bool { \um_log:n {default-math-font} } + \um_fontspec_select_font: + \cs_if_exist:cF { sym \um_symfont_tl } + { + \DeclareSymbolFont{\um_symfont_tl} + {\encodingdefault}{\l_um_family_tl}{\mddefault}{\updefault} + } + \SetSymbolFont{\um_symfont_tl}{\l_um_mversion_tl} + {\encodingdefault}{\l_um_family_tl}{\mddefault}{\updefault} + \bool_if:nT {\l_um_ot_math_bool && !\g_um_mainfont_already_set_bool} { + \bool_set_true:N \g_um_mainfont_already_set_bool + \um_declare_math_sizes: + \um_setup_legacy_fam_two: + \um_setup_legacy_fam_three: + } + \um_input_math_symbol_table: + \um_remap_symbols: + \um_setup_mathactives: + \um_setup_accents: + \um_setup_delcodes: + \um_setup_alphabets: + \ignorespaces +} +\cs_new:Nn \um_declare_math_sizes: + { + \dim_compare:nF { \fontdimen 10 \l_um_font == 0pt } + { + \DeclareMathSizes { \f@size } { \f@size } + { \um_fontdimen_to_scale:nn {10} {\l_um_font} } + { \um_fontdimen_to_scale:nn {11} {\l_um_font} } + } + } +\cs_new:Nn \um_setup_legacy_fam_two: + { + \fontspec_set_family:Nxn \l_um_family_tl + { + \l_um_font_keyval_tl, + Scale=1.00001, + FontAdjustment={ + \fontdimen8\font= \um_get_fontparam:nn {43} {FractionNumeratorDisplayStyleShiftUp}\relax + \fontdimen9\font= \um_get_fontparam:nn {42} {FractionNumeratorShiftUp}\relax + \fontdimen10\font=\um_get_fontparam:nn {32} {StackTopShiftUp}\relax + \fontdimen11\font=\um_get_fontparam:nn {45} {FractionDenominatorDisplayStyleShiftDown}\relax + \fontdimen12\font=\um_get_fontparam:nn {44} {FractionDenominatorShiftDown}\relax + \fontdimen13\font=\um_get_fontparam:nn {21} {SuperscriptShiftUp}\relax + \fontdimen14\font=\um_get_fontparam:nn {21} {SuperscriptShiftUp}\relax + \fontdimen15\font=\um_get_fontparam:nn {22} {SuperscriptShiftUpCramped}\relax + \fontdimen16\font=\um_get_fontparam:nn {18} {SubscriptShiftDown}\relax + \fontdimen17\font=\um_get_fontparam:nn {18} {SubscriptShiftDownWithSuperscript}\relax + \fontdimen18\font=\um_get_fontparam:nn {24} {SuperscriptBaselineDropMax}\relax + \fontdimen19\font=\um_get_fontparam:nn {20} {SubscriptBaselineDropMin}\relax + \fontdimen20\font=0pt\relax % delim1 = FractionDelimiterDisplaySize + \fontdimen21\font=0pt\relax % delim2 = FractionDelimiterSize + \fontdimen22\font=\um_get_fontparam:nn {15} {AxisHeight}\relax + } + } {\l_um_fontname_tl} + \SetSymbolFont{symbols}{\l_um_mversion_tl} + {\encodingdefault}{\l_um_family_tl}{\mddefault}{\updefault} + } +\cs_new:Nn \um_setup_legacy_fam_three: + { + \fontspec_set_family:Nxn \l_um_family_tl + { + \l_um_font_keyval_tl, + Scale=0.99999, + FontAdjustment={ + \fontdimen8\font= \um_get_fontparam:nn {48} {FractionRuleThickness}\relax + \fontdimen9\font= \um_get_fontparam:nn {28} {UpperLimitGapMin}\relax + \fontdimen10\font=\um_get_fontparam:nn {30} {LowerLimitGapMin}\relax + \fontdimen11\font=\um_get_fontparam:nn {29} {UpperLimitBaselineRiseMin}\relax + \fontdimen12\font=\um_get_fontparam:nn {31} {LowerLimitBaselineDropMin}\relax + \fontdimen13\font=0pt\relax + } + } {\l_um_fontname_tl} + \SetSymbolFont{largesymbols}{\l_um_mversion_tl} + {\encodingdefault}{\l_um_family_tl}{\mddefault}{\updefault} + } +\cs_new:Nn \um_get_fontparam:nn + { \directlua{fontspec.mathfontdimen("l_um_font","#2")} } +\DeclareDocumentCommand \resetmathfont { O{} m } { + \bool_set_false:N \g_um_mainfont_already_set_bool + \setmathfont[#1]{#2} +} +\cs_new:Nn \um_fontspec_select_font: { + \tl_set:Nx \l_um_font_keyval_tl { + Renderer = Basic, + BoldFont = {}, ItalicFont = {}, + Script = Math, + SizeFeatures = { + {Size = \tf@size-} , + {Size = \sf@size-\tf@size , + Font = \l_um_script_font_tl , + \l_um_script_features_tl + } , + {Size = -\sf@size , + Font = \l_um_sscript_font_tl , + \l_um_sscript_features_tl + } + }, + \l_um_unknown_keys_clist + } + \fontspec_set_fontface:NNxn \l_um_font \l_um_family_tl + {\l_um_font_keyval_tl} {\l_um_fontname_tl} + \group_begin: + \fontfamily{\l_um_family_tl}\selectfont + \fontspec_if_script:nF {math} {\bool_gset_false:N \l_um_ot_math_bool} + \group_end: +} +\cs_set:Npn \um_process_symbol_noparse:nnn #1#2#3 { + \um_set_mathsymbol:nNNn {\um_symfont_tl} #2#3{#1} +} +\cs_set:Npn \um_process_symbol_parse:nnn #1#2#3 { + \um_if_char_spec:nNNT{#1}{#2}{#3}{ + \um_process_symbol_noparse:nnn {#1}{#2}{#3} + } +} +\cs_new:Npn \um_remap_symbols: { + \um_remap_symbol:nnn{`\-}{\mathbin}{"02212}% hyphen to minus + \um_remap_symbol:nnn{`\*}{\mathbin}{"02217}% text asterisk to "centred asterisk" + \bool_if:NF \g_um_literal_colon_bool { + \um_remap_symbol:nnn{`\:}{\mathrel}{"02236}% colon to ratio (i.e., punct to rel) + } +} +\cs_new:Nn \um_remap_symbol_parse:nnn { + \um_if_char_spec:nNNT {#3} {\@nil} {#2} { + \um_remap_symbol_noparse:nnn {#1} {#2} {#3} + } +} +\cs_new:Nn \um_remap_symbol_noparse:nnn { + \clist_map_inline:nn {#1} { + \um_set_mathcode:nnnn {##1} {#2} {\um_symfont_tl} {#3} + } +} +\cs_new:Npn \um_setup_mathactives: { + \um_make_mathactive:nNN {"2032} \um_prime_single_mchar \mathord + \um_make_mathactive:nNN {"2033} \um_prime_double_mchar \mathord + \um_make_mathactive:nNN {"2034} \um_prime_triple_mchar \mathord + \um_make_mathactive:nNN {"2057} \um_prime_quad_mchar \mathord + \um_make_mathactive:nNN {"2035} \um_backprime_single_mchar \mathord + \um_make_mathactive:nNN {"2036} \um_backprime_double_mchar \mathord + \um_make_mathactive:nNN {"2037} \um_backprime_triple_mchar \mathord + \um_make_mathactive:nNN {`\'} \mathstraightquote \mathord + \um_make_mathactive:nNN {`\`} \mathbacktick \mathord +} +\cs_new:Nn \um_make_mathactive_parse:nNN + { + \um_if_char_spec:nNNT {#1} #2 #3 + { \um_make_mathactive_noparse:nNN {#1} #2 #3 } + } +\cs_new:Nn \um_make_mathactive_noparse:nNN + { + \um_set_mathchar:NNnn #2 #3 {\um_symfont_tl} {#1} + \char_gmake_mathactive:n {#1} + } +\cs_new:Nn \um_assign_delcode_noparse:nn { + \um_set_delcode:nnn \um_symfont_tl {#1} {#2} +} +\cs_new:Nn \um_assign_delcode_parse:nn { + \um_if_char_spec:nNNT {#2}{\@nil}{\@nil} { + \um_assign_delcode_noparse:nn {#1} {#2} + } +} +\cs_new:Nn \um_assign_delcode:n { \um_assign_delcode:nn {#1} {#1} } +\cs_new:Npn \um_setup_delcodes: { + \um_assign_delcode:nn {`\/} {\g_um_slash_delimiter_usv} + \um_assign_delcode:nn {"2044} {\g_um_slash_delimiter_usv} % fracslash + \um_assign_delcode:nn {"2215} {\g_um_slash_delimiter_usv} % divslash + \um_assign_delcode:n {"005C} % backslash + \um_assign_delcode:nn {`\<} {"27E8} % angle brackets with ascii notation + \um_assign_delcode:nn {`\>} {"27E9} % angle brackets with ascii notation + \um_assign_delcode:n {"2191} % up arrow + \um_assign_delcode:n {"2193} % down arrow + \um_assign_delcode:n {"2195} % updown arrow + \um_assign_delcode:n {"219F} % up arrow twohead + \um_assign_delcode:n {"21A1} % down arrow twohead + \um_assign_delcode:n {"21A5} % up arrow from bar + \um_assign_delcode:n {"21A7} % down arrow from bar + \um_assign_delcode:n {"21A8} % updown arrow from bar + \um_assign_delcode:n {"21BE} % up harpoon right + \um_assign_delcode:n {"21BF} % up harpoon left + \um_assign_delcode:n {"21C2} % down harpoon right + \um_assign_delcode:n {"21C3} % down harpoon left + \um_assign_delcode:n {"21C5} % arrows up down + \um_assign_delcode:n {"21F5} % arrows down up + \um_assign_delcode:n {"21C8} % arrows up up + \um_assign_delcode:n {"21CA} % arrows down down + \um_assign_delcode:n {"21D1} % double up arrow + \um_assign_delcode:n {"21D3} % double down arrow + \um_assign_delcode:n {"21D5} % double updown arrow + \um_assign_delcode:n {"21DE} % up arrow double stroke + \um_assign_delcode:n {"21DF} % down arrow double stroke + \um_assign_delcode:n {"21E1} % up arrow dashed + \um_assign_delcode:n {"21E3} % down arrow dashed + \um_assign_delcode:n {"21E7} % up white arrow + \um_assign_delcode:n {"21E9} % down white arrow + \um_assign_delcode:n {"21EA} % up white arrow from bar + \um_assign_delcode:n {"21F3} % updown white arrow +} +\tl_new:N \l_um_nolimits_tl +\tl_set:Nn \l_um_nolimits_tl { + \int\iint\iiint\iiiint\oint\oiint\oiiint + \intclockwise\varointclockwise\ointctrclockwise\sumint + \intbar\intBar\fint\cirfnint\awint\rppolint + \scpolint\npolint\pointint\sqint\intlarhk\intx + \intcap\intcup\upint\lowint +} +\DeclareDocumentCommand \addnolimits {m} { + \tl_put_right:Nn \l_um_nolimits_tl {#1} +} +\DeclareDocumentCommand \removenolimits {m} { + \tl_remove_all:Nn \l_um_nolimits_tl {#1} +} +\tl_new:N \l_um_radicals_tl +\tl_set:Nn \l_um_radicals_tl {\sqrt} +\cs_new_protected_nopar:Nn \um_new_cramped_style:N + { \cs_new_eq:Nc #1 { luatex \cs_to_str:N #1 } } +\um_new_cramped_style:N \crampeddisplaystyle +\um_new_cramped_style:N \crampedtextstyle +\um_new_cramped_style:N \crampedscriptstyle +\um_new_cramped_style:N \crampedscriptscriptstyle +\cs_new_protected_nopar:Nn \um_font_param:nnnnn +{ + \tl_set:Nn \l_um_tmpa_tl { #1 } + \tl_remove_all:Nn \l_um_tmpa_tl { _ } + \um_font_param_aux:ccc { um_ #1 :N } { um_set_ #1 :N } + { luatexUmath \l_um_tmpa_tl } +} +\cs_new_protected_nopar:Npn \um_font_param:nnn #1 #2 #3 { + \um_font_param:nnnnn { #1 } { #2 } { #2 } { #3 } { #3 } +} +\cs_new_protected_nopar:Npn \um_font_param:nn #1 #2 { + \um_font_param:nnnnn { #1 } { #2 } { #2 } { #2 } { #2 } +} +\cs_new_protected_nopar:Nn \um_font_param:n + { \um_font_param:nnnnn { #1 } { 0 } { 0 } { 0 } { 0 } } +\cs_new_protected_nopar:Nn \um_font_param_aux:NNN + { + \cs_new_nopar:Npn #1 ##1 { + #3 ##1 + } + \cs_new_protected_nopar:Npn #2 ##1 ##2 { + #3 ##1 \dim_eval:n { ##2 } + } + } +\cs_generate_variant:Nn \um_font_param_aux:NNN { ccc } +\um_font_param:nn { axis } { 15 } +\um_font_param:nn { operator_size } { 13 } +\um_font_param:n { fraction_del_size } +\um_font_param:nnn { fraction_denom_down } { 45 } { 44 } +\um_font_param:nnn { fraction_denom_vgap } { 50 } { 49 } +\um_font_param:nnn { fraction_num_up } { 43 } { 42 } +\um_font_param:nnn { fraction_num_vgap } { 47 } { 46 } +\um_font_param:nn { fraction_rule } { 48 } +\um_font_param:nn { limit_above_bgap } { 29 } +\um_font_param:n { limit_above_kern } +\um_font_param:nn { limit_above_vgap } { 28 } +\um_font_param:nn { limit_below_bgap } { 31 } +\um_font_param:n { limit_below_kern } +\um_font_param:nn { limit_below_vgap } { 30 } +\um_font_param:nn { over_delimiter_vgap } { 41 } +\um_font_param:nn { over_delimiter_bgap } { 38 } +\um_font_param:nn { under_delimiter_vgap } { 40 } +\um_font_param:nn { under_delimiter_bgap } { 39 } +\um_font_param:nn { overbar_kern } { 55 } +\um_font_param:nn { overbar_rule } { 54 } +\um_font_param:nn { overbar_vgap } { 53 } +\um_font_param:n { quad } +\um_font_param:nn { radical_kern } { 62 } +\um_font_param:nn { radical_rule } { 61 } +\um_font_param:nnn { radical_vgap } { 60 } { 59 } +\um_font_param:nn { radical_degree_before } { 63 } +\um_font_param:nn { radical_degree_after } { 64 } +\um_font_param:nn { radical_degree_raise } { 65 } +\um_font_param:nn { space_after_script } { 27 } +\um_font_param:nnn { stack_denom_down } { 35 } { 34 } +\um_font_param:nnn { stack_num_up } { 33 } { 32 } +\um_font_param:nnn { stack_vgap } { 37 } { 36 } +\um_font_param:nn { sub_shift_down } { 18 } +\um_font_param:nn { sub_shift_drop } { 20 } +\um_font_param:n { subsup_shift_down } +\um_font_param:nn { sub_top_max } { 19 } +\um_font_param:nn { subsup_vgap } { 25 } +\um_font_param:nn { sup_bottom_min } { 23 } +\um_font_param:nn { sup_shift_drop } { 24 } +\um_font_param:nnnnn { sup_shift_up } { 21 } { 22 } { 21 } { 22 } +\um_font_param:nn { supsub_bottom_max } { 26 } +\um_font_param:nn { underbar_kern } { 58 } +\um_font_param:nn { underbar_rule } { 57 } +\um_font_param:nn { underbar_vgap } { 56 } +\um_font_param:n { connector_overlap_min } +\def\new@mathversion#1{% + \expandafter\in@\expandafter#1\expandafter{\version@list}% + \ifin@ + \@font@info{Redeclaring math version + `\expandafter\@gobblefour\string#1'}% + \else + \expandafter\newcount\csname c@\expandafter + \@gobble\string#1\endcsname + \def\version@elt{\noexpand\version@elt\noexpand}% + \edef\version@list{\version@list\version@elt#1}% + \fi + \toks@{}% + \count@\z@ + \def\group@elt##1##2{% + \advance\count@\@ne + \addto@hook\toks@{\getanddefine@fonts##1##2}% + }% + \group@list + \global\csname c@\expandafter\@gobble\string#1\endcsname\count@ + \def\alpha@elt##1##2##3{% + \ifx##2\no@alphabet@error + \toks@\expandafter{\the\toks@\install@mathalphabet##1% + {\no@alphabet@error##1}}% + \else + \toks@\expandafter{\the\toks@\install@mathalphabet##1% + {\select@group##1##2##3}}% + \fi + }% + \alpha@list + \xdef#1{\the\toks@}% +} +\keys_define:nn {unicode-math} + { + version .code:n = + { + \tl_set:Nn \l_um_mversion_tl {#1} + \DeclareMathVersion{\l_um_mversion_tl} + } + } +\keys_define:nn {unicode-math} +{ + script-features .tl_set:N = \l_um_script_features_tl , + sscript-features .tl_set:N = \l_um_sscript_features_tl , + script-font .tl_set:N = \l_um_script_font_tl , + sscript-font .tl_set:N = \l_um_sscript_font_tl , +} +\seq_new:N \l_um_mathalph_seq +\seq_new:N \l_um_char_range_seq +\seq_new:N \l_um_mclass_range_seq +\seq_new:N \l_um_cmd_range_seq +\keys_define:nn {unicode-math} { + range .code:n = { + \bool_set_false:N \l_um_init_bool + \int_incr:N \g_um_fam_int + \tl_set:Nx \um_symfont_tl {um_fam\int_use:N\g_um_fam_int} + \cs_set_eq:NN \_um_sym:nnn \um_process_symbol_parse:nnn + \cs_set_eq:NN \um_set_mathalphabet_char:Nnn \um_mathmap_parse:Nnn + \cs_set_eq:NN \um_remap_symbol:nnn \um_remap_symbol_parse:nnn + \cs_set_eq:NN \um_maybe_init_alphabet:n \use_none:n + \cs_set_eq:NN \um_map_char_single:nn \um_map_char_parse:nn + \cs_set_eq:NN \um_assign_delcode:nn \um_assign_delcode_parse:nn + \cs_set_eq:NN \um_make_mathactive:nNN \um_make_mathactive_parse:nNN + \seq_clear:N \l_um_char_range_seq + \seq_clear:N \l_um_mclass_range_seq + \seq_clear:N \l_um_cmd_range_seq + \seq_clear:N \l_um_mathalph_seq + \clist_map_inline:nn {#1} { + \um_if_mathalph_decl:nTF {##1} { + \seq_put_right:Nx \l_um_mathalph_seq { + { \exp_not:V \l_um_tmpa_tl } + { \exp_not:V \l_um_tmpb_tl } + { \exp_not:V \l_um_tmpc_tl } + } + }{ + \seq_if_in:NnTF \g_um_mathclasses_seq {##1} + { \seq_put_right:Nn \l_um_mclass_range_seq {##1} } + { + \bool_if:nTF { \tl_if_single_p:n {##1} && \token_if_cs_p:N ##1 } + { \seq_put_right:Nn \l_um_cmd_range_seq {##1} } + { \seq_put_right:Nn \l_um_char_range_seq {##1} } + } + } + } + } +} +\seq_new:N \g_um_mathclasses_seq +\seq_set_from_clist:Nn \g_um_mathclasses_seq + { + \mathord,\mathalpha,\mathop,\mathbin,\mathrel, + \mathopen,\mathclose,\mathpunct,\mathaccent, + \mathfence,\mathover,\mathunder + } +\prg_new_conditional:Nnn \um_if_mathalph_decl:n {TF} { + \tl_set:Nx \l_um_tmpa_tl { \tl_trim_spaces:n {#1} } + \tl_clear:N \l_um_tmpb_tl + \tl_clear:N \l_um_tmpc_tl + \tl_if_in:NnT \l_um_tmpa_tl {->} { + \exp_after:wN \um_split_arrow:w \l_um_tmpa_tl \q_nil + } + \tl_if_in:NnT \l_um_tmpa_tl {/} { + \exp_after:wN \um_split_slash:w \l_um_tmpa_tl \q_nil + } + \tl_if_empty:NT \l_um_tmpc_tl { \tl_set_eq:NN \l_um_tmpc_tl \l_um_tmpa_tl } + \seq_if_in:NVTF \g_um_mathstyles_seq \l_um_tmpa_tl { + \prg_return_true: + }{ + \prg_return_false: + } +} +\cs_set:Npn \um_split_arrow:w #1->#2 \q_nil { + \tl_set:Nn \l_um_tmpa_tl {#1} + \tl_if_single:nTF {#2} + { \tl_set:Nn \l_um_tmpc_tl {#2} } + { \exp_args:NNc \tl_set:Nn \l_um_tmpc_tl {math#2} } +} +\cs_set:Npn \um_split_slash:w #1/#2 \q_nil { + \tl_set:Nn \l_um_tmpa_tl {#1} + \tl_set:Nn \l_um_tmpb_tl {#2} +} +\cs_new:Nn \um_if_char_spec:nNNT + { + + % math class: + \seq_if_in:NnT \l_um_mclass_range_seq {#3} + { \use_none_delimit_by_q_nil:w } + + % command name: + \seq_if_in:NnT \l_um_cmd_range_seq {#2} + { \use_none_delimit_by_q_nil:w } + + % character slot: + \seq_map_inline:Nn \l_um_char_range_seq + { + \um_int_if_range_matches_slot:nnT {##1} {#1} + { \seq_map_break:n { \use_none_delimit_by_q_nil:w } } + } + + % this executes if no match was found: + \use_none:nnn + \q_nil + \use:n + { + \clist_put_right:Nx \l_um_char_num_range_clist { \int_eval:n {#1} } + #4 + } + } +\cs_new:Nn \um_int_if_range_matches_slot:nnT + { \um_numrange_parse:nwT {#1} #2 - \q_nil - \q_stop {#3} } +\cs_set:Npn \um_numrange_parse:nwT #1 #2 - #3 - #4 \q_stop #5 + { + \tl_if_empty:nTF {#4} { \int_compare:nT {#1=#2} {#5} } + { + \tl_if_empty:nTF {#3} { \int_compare:nT {#1>=#2} {#5} } + { + \tl_if_empty:nTF {#2} { \int_compare:nT {#1<=#3} {#5} } + { + \int_compare:nT {#1>=#2} { \int_compare:nT {#1<=#3} {#5} } + } } } + } +\AtBeginDocument{\um_resolve_greek:} +\cs_new:Npn \um_resolve_greek: { + \clist_map_inline:nn { + Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda, + alpha,beta,gamma,delta, zeta,eta,theta,iota,kappa,lambda, + Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega, + mu,nu,xi,omicron,pi,rho,sigma,tau,upsilon, chi,psi,omega, + varTheta, + varsigma,vartheta,varkappa,varrho,varpi + }{ + \tl_set:cx {##1} { \exp_not:c { mit ##1 } } + } + \tl_set:Nn \epsilon { + \bool_if:NTF \g_um_texgreek_bool \mitvarepsilon \mitepsilon + } + \tl_set:Nn \phi { + \bool_if:NTF \g_um_texgreek_bool \mitvarphi \mitphi + } + \tl_set:Nn \varepsilon { + \bool_if:NTF \g_um_texgreek_bool \mitepsilon \mitvarepsilon + } + \tl_set:Nn \varphi { + \bool_if:NTF \g_um_texgreek_bool \mitphi \mitvarphi + } +} +\cs_new:Nn \um_new_mathstyle:N { + \um_prepare_mathstyle:f {\exp_after:wN \use_none:nnnnn \token_to_str:N #1} + \seq_put_right:Nn \g_um_mathstyles_seq {#1} +} +\seq_new:N \g_um_default_mathalph_seq +\seq_new:N \g_um_mathstyles_seq +\AtEndOfPackage{ +\clist_map_inline:nn { + {\mathup } {latin,Latin,greek,Greek,num,misc} {\mathup } , + {\mathit } {latin,Latin,greek,Greek,misc} {\mathit } , + {\mathbb } {latin,Latin,num,misc} {\mathbb } , + {\mathbbit } {misc} {\mathbbit } , + {\mathscr } {latin,Latin} {\mathscr } , + {\mathcal } {Latin} {\mathscr } , + {\mathbfcal } {Latin} {\mathbfscr } , + {\mathfrak } {latin,Latin} {\mathfrak } , + {\mathtt } {latin,Latin,num} {\mathtt } , + {\mathsfup } {latin,Latin,num} {\mathsfup } , + {\mathsfit } {latin,Latin} {\mathsfit } , + {\mathbfup } {latin,Latin,greek,Greek,num,misc} {\mathbfup } , + {\mathbfit } {latin,Latin,greek,Greek,misc} {\mathbfit } , + {\mathbfscr } {latin,Latin} {\mathbfscr } , + {\mathbffrak} {latin,Latin} {\mathbffrak} , + {\mathbfsfup} {latin,Latin,greek,Greek,num,misc} {\mathbfsfup} , + {\mathbfsfit} {latin,Latin,greek,Greek,misc} {\mathbfsfit} +}{ + \seq_put_right:Nn \g_um_default_mathalph_seq {#1} + \exp_after:wN \um_new_mathstyle:N \use_i:nnn #1 +} +\um_new_mathstyle:N \mathsf +\um_new_mathstyle:N \mathbf +\um_new_mathstyle:N \mathbfsf +} +\cs_new:Nn \um_prepare_mathstyle:n { + \um_init_alphabet:x {#1} + \cs_set:cpn {_um_math#1_aux:n} ##1 { + \use:c {um_switchto_math#1:} ##1 \egroup + } + \cs_set_protected:cpx {math#1} { + \exp_not:n{ + \bgroup + \mode_if_math:F + { + \egroup\expandafter + \non@alpherr\expandafter{\csname math#1\endcsname\space} + } + \tl_set:Nn \l_um_mathstyle_tl {#1} + } + \exp_not:c {_um_math#1_aux:n} + } +} +\tl_new:N \l_um_mathstyle_tl +\cs_generate_variant:Nn \um_prepare_mathstyle:n {f} +\cs_set:Npn \um_init_alphabet:n #1 { + \um_log:nx {alph-initialise} {#1} + \cs_set_eq:cN {um_switchto_math#1:} \prg_do_nothing: +} +\cs_generate_variant:Nn \um_init_alphabet:n {x} +\cs_new:Npn \um_maybe_init_alphabet:V { + \exp_args:NV \um_maybe_init_alphabet:n +} +\seq_new:N \l_um_missing_alph_seq +\cs_new:Npn \um_setup_alphabets: { + \seq_if_empty:NTF \l_um_mathalph_seq { + \um_log:n {setup-implicit} + \seq_set_eq:NN \l_um_mathalph_seq \g_um_default_mathalph_seq + \bool_set_true:N \l_um_implicit_alph_bool + \um_maybe_init_alphabet:n {sf} + \um_maybe_init_alphabet:n {bf} + \um_maybe_init_alphabet:n {bfsf} + } + { + \um_log:n {setup-explicit} + \bool_set_false:N \l_um_implicit_alph_bool + \cs_set_eq:NN \um_set_mathalphabet_char:Nnn \um_mathmap_noparse:Nnn + \cs_set_eq:NN \um_map_char_single:nn \um_map_char_noparse:nn + } + \seq_map_inline:Nn \l_um_mathalph_seq { + \tl_set:No \l_um_tmpa_tl { \use_i:nnn ##1 } + \tl_set:No \l_um_tmpb_tl { \use_ii:nnn ##1 } + \tl_set:No \l_um_remap_style_tl { \use_iii:nnn ##1 } + \tl_set:Nx \l_um_remap_style_tl { + \exp_after:wN \exp_after:wN \exp_after:wN \use_none:nnnnn + \exp_after:wN \token_to_str:N \l_um_remap_style_tl + } + \tl_if_empty:NT \l_um_tmpb_tl { + \cs_set_eq:NN \um_maybe_init_alphabet:n \um_init_alphabet:n + \tl_set:Nn \l_um_tmpb_tl { latin,Latin,greek,Greek,num,misc } + } + \um_setup_math_alphabet:VVV + \l_um_tmpa_tl \l_um_tmpb_tl \l_um_remap_style_tl + } + \seq_if_empty:NF \l_um_missing_alph_seq { \um_log:n { missing-alphabets } } +} +\cs_new:Nn \um_setup_math_alphabet:Nnn { + \tl_set:Nx \l_um_style_tl { + \exp_after:wN \use_none:nnnnn \token_to_str:N #1 + } + \clist_map_inline:nn {#2} { + \tl_set:Nx \l_um_tmpa_tl { \tl_trim_spaces:n {##1} } + \cs_if_exist:cT {um_config_ \l_um_style_tl _\l_um_tmpa_tl :n} { + \str_if_eq:xxTF {\l_um_tmpa_tl}{misc} { + \um_maybe_init_alphabet:V \l_um_style_tl + \clist_map_break: + }{ + \um_glyph_if_exist:cT { \um_to_usv:nn {#3}{\l_um_tmpa_tl} }{ + \um_maybe_init_alphabet:V \l_um_style_tl + \clist_map_break: + } + } + } + } + \clist_map_inline:nn {#2} { + \tl_set:Nx \l_um_tmpa_tl { \tl_trim_spaces:n {##1} } + \cs_if_exist:cT {um_config_ \l_um_style_tl _ \l_um_tmpa_tl :n} { + \str_if_eq:xxTF {\l_um_tmpa_tl}{misc} { + \um_log:nx {setup-alph} {math \l_um_style_tl~(\l_um_tmpa_tl)} + \use:c {um_config_ \l_um_style_tl _ \l_um_tmpa_tl :n} {#3} + }{ + \um_glyph_if_exist:cTF { \um_to_usv:nn {#3}{\l_um_tmpa_tl} } { + \um_log:nx {setup-alph} {math \l_um_style_tl~(\l_um_tmpa_tl)} + \use:c {um_config_ \l_um_style_tl _ \l_um_tmpa_tl :n} {#3} + }{ + \bool_if:NTF \l_um_implicit_alph_bool { + \seq_put_right:Nx \l_um_missing_alph_seq { + \@backslashchar math \l_um_style_tl \space + (\tl_use:c{c_um_math_alphabet_name_ \l_um_tmpa_tl _tl}) + } + }{ + \use:c {um_config_ \l_um_style_tl _ \l_um_tmpa_tl :n} {up} + } + } + } + } + } +} +\cs_generate_variant:Nn \um_setup_math_alphabet:Nnn {VVV} +\cs_new:Npn \um_map_char_single:cc { \exp_args:Ncc \um_map_char_single:nn } +\cs_new:Nn \um_map_char_noparse:nn { + \um_set_mathcode:nnnn {#1}{\mathalpha}{\um_symfont_tl}{#2} +} +\cs_new:Nn \um_map_char_parse:nn { + \um_if_char_spec:nNNT {#1} {\@nil} {\mathalpha} { + \um_map_char_noparse:nn {#1}{#2} + } +} +\cs_new:Nn \um_map_char_single:nnn { + \um_map_char_single:cc { \um_to_usv:nn {#1}{#3} } + { \um_to_usv:nn {#2}{#3} } +} +\cs_set:Npn \um_map_single:nnn #1#2#3 { + \cs_if_exist:cT { \um_to_usv:nn {#3} {#1} } + { + \clist_map_inline:nn {#2} { + \um_map_char_single:nnn {##1} {#3} {#1} + } + } +} +\cs_set:Npn \um_map_chars_range:nnn #1#2#3 { + \prg_stepwise_inline:nnnn {0}{1}{#1-1} { + \um_map_char_single:nn {#2+##1}{#3+##1} + } +} +\cs_generate_variant:Nn \um_map_chars_range:nnn {ncc} +\cs_new:Nn \um_map_chars_range:nnnn { + \um_map_chars_range:ncc {#1} { \um_to_usv:nn {#2}{#4} } + { \um_to_usv:nn {#3}{#4} } +} +\cs_new:Nn \um_map_chars_Latin:nn { + \clist_map_inline:nn {#1} { + \um_map_chars_range:nnnn {26} {##1} {#2} {Latin} + } +} +\cs_new:Nn \um_map_chars_latin:nn { + \clist_map_inline:nn {#1} { + \um_map_chars_range:nnnn {26} {##1} {#2} {latin} + } +} +\cs_new:Nn \um_map_chars_greek:nn { + \clist_map_inline:nn {#1} { + \um_map_chars_range:nnnn {25} {##1} {#2} {greek} + \um_map_char_single:nnn {##1} {#2} {varepsilon} + \um_map_char_single:nnn {##1} {#2} {vartheta} + \um_map_char_single:nnn {##1} {#2} {varkappa} + \um_map_char_single:nnn {##1} {#2} {varphi} + \um_map_char_single:nnn {##1} {#2} {varrho} + \um_map_char_single:nnn {##1} {#2} {varpi} + } +} +\cs_new:Nn \um_map_chars_Greek:nn { + \clist_map_inline:nn {#1} { + \um_map_chars_range:nnnn {25} {##1} {#2} {Greek} + \um_map_char_single:nnn {##1} {#2} {varTheta} + } +} +\cs_new:Nn \um_map_chars_numbers:nn { + \um_map_chars_range:nnnn {10} {#1} {#2} {num} +} +\cs_new:Npn \um_set_mathalphabet_char:Ncc { + \exp_args:NNcc \um_set_mathalphabet_char:Nnn +} +\cs_new:Nn \um_mathmap_noparse:Nnn { + \clist_map_inline:nn {#2} { + \tl_put_right:cx {um_switchto_\cs_to_str:N #1:} { + \um_set_mathcode:nnnn{##1}{\mathalpha}{\um_symfont_tl}{#3} + } + } +} +\cs_new:Nn \um_mathmap_parse:Nnn { + \clist_if_in:NnT \l_um_char_num_range_clist {#3} { + \um_mathmap_noparse:Nnn {#1}{#2}{#3} + } +} +\cs_new:Npn \um_set_mathalphabet_char:Nnnn #1#2#3#4 { + \um_set_mathalphabet_char:Ncc #1 { \um_to_usv:nn {#2} {#4} } + { \um_to_usv:nn {#3} {#4} } +} +\cs_new:Npn \um_set_mathalph_range:nNnn #1#2#3#4 { + \prg_stepwise_inline:nnnn {0}{1}{#1-1} + { \um_set_mathalphabet_char:Nnn {#2} { ##1 + #3 } { ##1 + #4 } } +} +\cs_generate_variant:Nn \um_set_mathalph_range:nNnn {nNcc} +\cs_new:Npn \um_set_mathalph_range:nNnnn #1#2#3#4#5 { + \um_set_mathalph_range:nNcc {#1} #2 { \um_to_usv:nn {#3} {#5} } + { \um_to_usv:nn {#4} {#5} } +} +\cs_new:Npn \um_set_mathalphabet_pos:Nnnn #1#2#3#4 { + \cs_if_exist:cT { \um_to_usv:nn {#4}{#2} } { + \clist_map_inline:nn {#3} + { \um_set_mathalphabet_char:Nnnn #1 {##1} {#4} {#2} } + } +} +\cs_new:Nn \um_set_mathalphabet_numbers:Nnn { + \clist_map_inline:nn {#2} + { \um_set_mathalph_range:nNnnn {10} #1 {##1} {#3} {num} } +} +\cs_new:Nn \um_set_mathalphabet_Latin:Nnn { + \clist_map_inline:nn {#2} + { \um_set_mathalph_range:nNnnn {26} #1 {##1} {#3} {Latin} } +} +\cs_new:Nn \um_set_mathalphabet_latin:Nnn { + \clist_map_inline:nn {#2} { + \um_set_mathalph_range:nNnnn {26} #1 {##1} {#3} {latin} + \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {h} + } +} +\cs_new:Nn \um_set_mathalphabet_Greek:Nnn { + \clist_map_inline:nn {#2} { + \um_set_mathalph_range:nNnnn {25} #1 {##1} {#3} {Greek} + \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varTheta} + } +} +\cs_new:Nn \um_set_mathalphabet_greek:Nnn { + \clist_map_inline:nn {#2} { + \um_set_mathalph_range:nNnnn {25} #1 {##1} {#3} {greek} + \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varepsilon} + \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {vartheta} + \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varkappa} + \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varphi} + \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varrho} + \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varpi} + } +} +\cs_new:Nn \um_config_up_num:n { + \um_map_chars_numbers:nn {up}{#1} + \um_set_mathalphabet_numbers:Nnn \mathup {up}{#1} +} +\cs_new:Nn \um_config_up_Latin:n + { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_Latin:nn {up} {#1} } + { + \bool_if:NT \g_um_upLatin_bool { \um_map_chars_Latin:nn {up,it} {#1} } + } + \um_set_mathalphabet_Latin:Nnn \mathup {up,it}{#1} +} +\cs_new:Nn \um_config_up_latin:n { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_latin:nn {up} {#1} } + { + \bool_if:NT \g_um_uplatin_bool { + \um_map_chars_latin:nn {up,it} {#1} + \um_map_single:nnn {h} {up,it} {#1} + \um_map_single:nnn {dotlessi} {up,it} {#1} + \um_map_single:nnn {dotlessj} {up,it} {#1} + } + } + \um_set_mathalphabet_latin:Nnn \mathup {up,it}{#1} +} +\cs_new:Nn \um_config_up_Greek:n { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_Greek:nn {up}{#1} } + { + \bool_if:NT \g_um_upGreek_bool { \um_map_chars_Greek:nn {up,it}{#1} } + } + \um_set_mathalphabet_Greek:Nnn \mathup {up,it}{#1} +} +\cs_new:Nn \um_config_up_greek:n { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_greek:nn {up} {#1} } + { + \bool_if:NT \g_um_upgreek_bool { + \um_map_chars_greek:nn {up,it} {#1} + } + } + \um_set_mathalphabet_greek:Nnn \mathup {up,it} {#1} +} +\cs_new:Nn \um_config_up_misc:n { + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_map_single:nnn {Nabla}{up}{up} + }{ + \bool_if:NT \g_um_upNabla_bool { + \um_map_single:nnn {Nabla}{up,it}{up} + } + } + \bool_if:NTF \g_um_literal_partial_bool { + \um_map_single:nnn {partial}{up}{up} + }{ + \bool_if:NT \g_um_uppartial_bool { + \um_map_single:nnn {partial}{up,it}{up} + } + } + \um_set_mathalphabet_pos:Nnnn \mathup {partial} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathup {Nabla} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathup {dotlessi} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathup {dotlessj} {up,it} {#1} +} +\cs_new:Nn \um_config_it_Latin:n { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_Latin:nn {it} {#1} } + { + \bool_if:NF \g_um_upLatin_bool { \um_map_chars_Latin:nn {up,it} {#1} } + } + \um_set_mathalphabet_Latin:Nnn \mathit {up,it}{#1} +} +\cs_new:Nn \um_config_it_latin:n { + \bool_if:NTF \g_um_literal_bool { + \um_map_chars_latin:nn {it} {#1} + \um_map_single:nnn {h}{it}{#1} + }{ + \bool_if:NF \g_um_uplatin_bool { + \um_map_chars_latin:nn {up,it} {#1} + \um_map_single:nnn {h}{up,it}{#1} + \um_map_single:nnn {dotlessi}{up,it}{#1} + \um_map_single:nnn {dotlessj}{up,it}{#1} + } + } + \um_set_mathalphabet_latin:Nnn \mathit {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathit {dotlessi} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathit {dotlessj} {up,it} {#1} +} +\cs_new:Nn \um_config_it_Greek:n { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_Greek:nn {it}{#1} + }{ + \bool_if:NF \g_um_upGreek_bool { \um_map_chars_Greek:nn {up,it}{#1} } + } + \um_set_mathalphabet_Greek:Nnn \mathit {up,it}{#1} +} +\cs_new:Nn \um_config_it_greek:n { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_greek:nn {it} {#1} } + { + \bool_if:NF \g_um_upgreek_bool { \um_map_chars_greek:nn {it,up} {#1} } + } + \um_set_mathalphabet_greek:Nnn \mathit {up,it} {#1} +} +\cs_new:Nn \um_config_it_misc:n { + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_map_single:nnn {Nabla}{it}{it} + }{ + \bool_if:NF \g_um_upNabla_bool { + \um_map_single:nnn {Nabla}{up,it}{it} + } + } + \bool_if:NTF \g_um_literal_partial_bool { + \um_map_single:nnn {partial}{it}{it} + }{ + \bool_if:NF \g_um_uppartial_bool { + \um_map_single:nnn {partial}{up,it}{it} + } + } + \um_set_mathalphabet_pos:Nnnn \mathit {partial} {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathit {Nabla} {up,it}{#1} +} +\cs_new:Nn \um_config_bb_latin:n { + \um_set_mathalphabet_latin:Nnn \mathbb {up,it}{#1} +} +\cs_new:Nn \um_config_bb_Latin:n { + \um_set_mathalphabet_Latin:Nnn \mathbb {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {C} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {H} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {N} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {P} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {Q} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {R} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {Z} {up,it} {#1} +} +\cs_new:Nn \um_config_bb_num:n { + \um_set_mathalphabet_numbers:Nnn \mathbb {up}{#1} +} +\cs_new:Nn \um_config_bb_misc:n { + \um_set_mathalphabet_pos:Nnnn \mathbb {Pi} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {pi} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {Gamma} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {gamma} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {summation} {up} {#1} +} +\cs_new:Nn \um_config_bbit_misc:n { + \um_set_mathalphabet_pos:Nnnn \mathbbit {D} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbbit {d} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbbit {e} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbbit {i} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbbit {j} {up,it} {#1} +} +\cs_new:Nn \um_config_scr_Latin:n { + \um_set_mathalphabet_Latin:Nnn \mathscr {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {B}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {E}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {F}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {H}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {I}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {L}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {M}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {R}{up,it}{#1} +} +\cs_new:Nn \um_config_scr_latin:n { + \um_set_mathalphabet_latin:Nnn \mathscr {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {e}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {g}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {o}{up,it}{#1} +} +\cs_new:Nn \um_config_cal_Latin:n { + \um_set_mathalphabet_Latin:Nnn \mathcal {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathcal {B}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathcal {E}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathcal {F}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathcal {H}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathcal {I}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathcal {L}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathcal {M}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathcal {R}{up,it}{#1} +} +\cs_new:Nn \um_config_frak_Latin:n { + \um_set_mathalphabet_Latin:Nnn \mathfrak {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathfrak {C}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathfrak {H}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathfrak {I}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathfrak {R}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathfrak {Z}{up,it}{#1} +} +\cs_new:Nn \um_config_frak_latin:n { + \um_set_mathalphabet_latin:Nnn \mathfrak {up,it}{#1} +} +\cs_new:Nn \um_config_sfup_num:n { + \um_set_mathalphabet_numbers:Nnn \mathsf {up}{#1} + \um_set_mathalphabet_numbers:Nnn \mathsfup {up}{#1} +} +\cs_new:Nn \um_config_sfup_Latin:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_Latin:nn {sfup} {#1} + \um_set_mathalphabet_Latin:Nnn \mathsf {up}{#1} + }{ + \bool_if:NT \g_um_upsans_bool { + \um_map_chars_Latin:nn {sfup,sfit} {#1} + \um_set_mathalphabet_Latin:Nnn \mathsf {up,it}{#1} + } + } + \um_set_mathalphabet_Latin:Nnn \mathsfup {up,it}{#1} +} +\cs_new:Nn \um_config_sfup_latin:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_latin:nn {sfup} {#1} + \um_set_mathalphabet_latin:Nnn \mathsf {up}{#1} + }{ + \bool_if:NT \g_um_upsans_bool { + \um_map_chars_latin:nn {sfup,sfit} {#1} + \um_set_mathalphabet_latin:Nnn \mathsf {up,it}{#1} + } + } + \um_set_mathalphabet_latin:Nnn \mathsfup {up,it}{#1} +} +\cs_new:Nn \um_config_sfit_Latin:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_Latin:nn {sfit} {#1} + \um_set_mathalphabet_Latin:Nnn \mathsf {it}{#1} + }{ + \bool_if:NF \g_um_upsans_bool { + \um_map_chars_Latin:nn {sfup,sfit} {#1} + \um_set_mathalphabet_Latin:Nnn \mathsf {up,it}{#1} + } + } + \um_set_mathalphabet_Latin:Nnn \mathsfit {up,it}{#1} +} +\cs_new:Nn \um_config_sfit_latin:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_latin:nn {sfit} {#1} + \um_set_mathalphabet_latin:Nnn \mathsf {it}{#1} + }{ + \bool_if:NF \g_um_upsans_bool { + \um_map_chars_latin:nn {sfup,sfit} {#1} + \um_set_mathalphabet_latin:Nnn \mathsf {up,it}{#1} + } + } + \um_set_mathalphabet_latin:Nnn \mathsfit {up,it}{#1} +} +\cs_new:Nn \um_config_tt_num:n { + \um_set_mathalphabet_numbers:Nnn \mathtt {up}{#1} +} +\cs_new:Nn \um_config_tt_Latin:n { + \um_set_mathalphabet_Latin:Nnn \mathtt {up,it}{#1} +} +\cs_new:Nn \um_config_tt_latin:n { + \um_set_mathalphabet_latin:Nnn \mathtt {up,it}{#1} +} +\cs_new:Nn \um_config_bfit_Latin:n { + \bool_if:NF \g_um_bfupLatin_bool { + \um_map_chars_Latin:nn {bfup,bfit} {#1} + } + \um_set_mathalphabet_Latin:Nnn \mathbfit {up,it}{#1} + \bool_if:NTF \g_um_bfliteral_bool { + \um_map_chars_Latin:nn {bfit} {#1} + \um_set_mathalphabet_Latin:Nnn \mathbf {it}{#1} + }{ + \bool_if:NF \g_um_bfupLatin_bool { + \um_map_chars_Latin:nn {bfup,bfit} {#1} + \um_set_mathalphabet_Latin:Nnn \mathbf {up,it}{#1} + } + } +} +\cs_new:Nn \um_config_bfit_latin:n { + \bool_if:NF \g_um_bfuplatin_bool { + \um_map_chars_latin:nn {bfup,bfit} {#1} + } + \um_set_mathalphabet_latin:Nnn \mathbfit {up,it}{#1} + \bool_if:NTF \g_um_bfliteral_bool { + \um_map_chars_latin:nn {bfit} {#1} + \um_set_mathalphabet_latin:Nnn \mathbf {it}{#1} + }{ + \bool_if:NF \g_um_bfuplatin_bool { + \um_map_chars_latin:nn {bfup,bfit} {#1} + \um_set_mathalphabet_latin:Nnn \mathbf {up,it}{#1} + } + } +} +\cs_new:Nn \um_config_bfit_Greek:n { + \um_set_mathalphabet_Greek:Nnn \mathbfit {up,it}{#1} + \bool_if:NTF \g_um_bfliteral_bool { + \um_map_chars_Greek:nn {bfit}{#1} + \um_set_mathalphabet_Greek:Nnn \mathbf {it}{#1} + }{ + \bool_if:NF \g_um_bfupGreek_bool { + \um_map_chars_Greek:nn {bfup,bfit}{#1} + \um_set_mathalphabet_Greek:Nnn \mathbf {up,it}{#1} + } + } +} +\cs_new:Nn \um_config_bfit_greek:n { + \um_set_mathalphabet_greek:Nnn \mathbfit {up,it} {#1} + \bool_if:NTF \g_um_bfliteral_bool { + \um_map_chars_greek:nn {bfit} {#1} + \um_set_mathalphabet_greek:Nnn \mathbf {it} {#1} + }{ + \bool_if:NF \g_um_bfupgreek_bool { + \um_map_chars_greek:nn {bfit,bfup} {#1} + \um_set_mathalphabet_greek:Nnn \mathbf {up,it} {#1} + } + } +} +\cs_new:Nn \um_config_bfit_misc:n { + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_map_single:nnn {Nabla}{bfit}{#1} + }{ + \bool_if:NF \g_um_upNabla_bool { + \um_map_single:nnn {Nabla}{bfup,bfit}{#1} + } + } + \bool_if:NTF \g_um_literal_partial_bool { + \um_map_single:nnn {partial}{bfit}{#1} + }{ + \bool_if:NF \g_um_uppartial_bool { + \um_map_single:nnn {partial}{bfup,bfit}{#1} + } + } + \um_set_mathalphabet_pos:Nnnn \mathbfit {partial} {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathbfit {Nabla} {up,it}{#1} + \bool_if:NTF \g_um_literal_partial_bool { + \um_set_mathalphabet_pos:Nnnn \mathbf {partial} {it}{#1} + }{ + \bool_if:NF \g_um_uppartial_bool { + \um_set_mathalphabet_pos:Nnnn \mathbf {partial} {up,it}{#1} + } + } + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_set_mathalphabet_pos:Nnnn \mathbf {Nabla} {it}{#1} + }{ + \bool_if:NF \g_um_upNabla_bool { + \um_set_mathalphabet_pos:Nnnn \mathbf {Nabla} {up,it}{#1} + } + } +} +\cs_new:Nn \um_config_bfup_num:n { + \um_set_mathalphabet_numbers:Nnn \mathbf {up}{#1} + \um_set_mathalphabet_numbers:Nnn \mathbfup {up}{#1} +} +\cs_new:Nn \um_config_bfup_Latin:n { + \bool_if:NT \g_um_bfupLatin_bool { + \um_map_chars_Latin:nn {bfup,bfit} {#1} + } + \um_set_mathalphabet_Latin:Nnn \mathbfup {up,it}{#1} + \bool_if:NTF \g_um_bfliteral_bool { + \um_map_chars_Latin:nn {bfup} {#1} + \um_set_mathalphabet_Latin:Nnn \mathbf {up}{#1} + }{ + \bool_if:NT \g_um_bfupLatin_bool { + \um_map_chars_Latin:nn {bfup,bfit} {#1} + \um_set_mathalphabet_Latin:Nnn \mathbf {up,it}{#1} + } + } +} +\cs_new:Nn \um_config_bfup_latin:n { + \bool_if:NT \g_um_bfuplatin_bool { + \um_map_chars_latin:nn {bfup,bfit} {#1} + } + \um_set_mathalphabet_latin:Nnn \mathbfup {up,it}{#1} + \bool_if:NTF \g_um_bfliteral_bool { + \um_map_chars_latin:nn {bfup} {#1} + \um_set_mathalphabet_latin:Nnn \mathbf {up}{#1} + }{ + \bool_if:NT \g_um_bfuplatin_bool { + \um_map_chars_latin:nn {bfup,bfit} {#1} + \um_set_mathalphabet_latin:Nnn \mathbf {up,it}{#1} + } + } +} +\cs_new:Nn \um_config_bfup_Greek:n { + \um_set_mathalphabet_Greek:Nnn \mathbfup {up,it}{#1} + \bool_if:NTF \g_um_bfliteral_bool { + \um_map_chars_Greek:nn {bfup}{#1} + \um_set_mathalphabet_Greek:Nnn \mathbf {up}{#1} + }{ + \bool_if:NT \g_um_bfupGreek_bool { + \um_map_chars_Greek:nn {bfup,bfit}{#1} + \um_set_mathalphabet_Greek:Nnn \mathbf {up,it}{#1} + } + } +} +\cs_new:Nn \um_config_bfup_greek:n { + \um_set_mathalphabet_greek:Nnn \mathbfup {up,it} {#1} + \bool_if:NTF \g_um_bfliteral_bool { + \um_map_chars_greek:nn {bfup} {#1} + \um_set_mathalphabet_greek:Nnn \mathbf {up} {#1} + }{ + \bool_if:NT \g_um_bfupgreek_bool { + \um_map_chars_greek:nn {bfup,bfit} {#1} + \um_set_mathalphabet_greek:Nnn \mathbf {up,it} {#1} + } + } +} +\cs_new:Nn \um_config_bfup_misc:n { + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_map_single:nnn {Nabla}{bfup}{#1} + }{ + \bool_if:NT \g_um_upNabla_bool { + \um_map_single:nnn {Nabla}{bfup,bfit}{#1} + } + } + \bool_if:NTF \g_um_literal_partial_bool { + \um_map_single:nnn {partial}{bfup}{#1} + }{ + \bool_if:NT \g_um_uppartial_bool { + \um_map_single:nnn {partial}{bfup,bfit}{#1} + } + } + \um_set_mathalphabet_pos:Nnnn \mathbfup {partial} {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathbfup {Nabla} {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathbfup {digamma} {up}{#1} + \um_set_mathalphabet_pos:Nnnn \mathbfup {Digamma} {up}{#1} + \um_set_mathalphabet_pos:Nnnn \mathbf {digamma} {up}{#1} + \um_set_mathalphabet_pos:Nnnn \mathbf {Digamma} {up}{#1} + \bool_if:NTF \g_um_literal_partial_bool { + \um_set_mathalphabet_pos:Nnnn \mathbf {partial} {up}{#1} + }{ + \bool_if:NT \g_um_uppartial_bool { + \um_set_mathalphabet_pos:Nnnn \mathbf {partial} {up,it}{#1} + } + } + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_set_mathalphabet_pos:Nnnn \mathbf {Nabla} {up}{#1} + }{ + \bool_if:NT \g_um_upNabla_bool { + \um_set_mathalphabet_pos:Nnnn \mathbf {Nabla} {up,it}{#1} + } + } +} +\cs_new:Nn \um_config_bffrak_Latin:n { + \um_set_mathalphabet_Latin:Nnn \mathbffrak {up,it}{#1} +} +\cs_new:Nn \um_config_bffrak_latin:n { + \um_set_mathalphabet_latin:Nnn \mathbffrak {up,it}{#1} +} +\cs_new:Nn \um_config_bfscr_Latin:n { + \um_set_mathalphabet_Latin:Nnn \mathbfscr {up,it}{#1} +} +\cs_new:Nn \um_config_bfscr_latin:n { + \um_set_mathalphabet_latin:Nnn \mathbfscr {up,it}{#1} +} +\cs_new:Nn \um_config_bfcal_Latin:n { + \um_set_mathalphabet_Latin:Nnn \mathbfcal {up,it}{#1} +} +\cs_new:Nn \um_config_bfsfup_num:n { + \um_set_mathalphabet_numbers:Nnn \mathbfsf {up}{#1} + \um_set_mathalphabet_numbers:Nnn \mathbfsfup {up}{#1} +} +\cs_new:Nn \um_config_bfsfup_Latin:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_Latin:nn {bfsfup} {#1} + \um_set_mathalphabet_Latin:Nnn \mathbfsf {up}{#1} + }{ + \bool_if:NT \g_um_upsans_bool { + \um_map_chars_Latin:nn {bfsfup,bfsfit} {#1} + \um_set_mathalphabet_Latin:Nnn \mathbfsf {up,it}{#1} + } + } + \um_set_mathalphabet_Latin:Nnn \mathbfsfup {up,it}{#1} +} +\cs_new:Nn \um_config_bfsfup_latin:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_latin:nn {bfsfup} {#1} + \um_set_mathalphabet_latin:Nnn \mathbfsf {up}{#1} + }{ + \bool_if:NT \g_um_upsans_bool { + \um_map_chars_latin:nn {bfsfup,bfsfit} {#1} + \um_set_mathalphabet_latin:Nnn \mathbfsf {up,it}{#1} + } + } + \um_set_mathalphabet_latin:Nnn \mathbfsfup {up,it}{#1} +} +\cs_new:Nn \um_config_bfsfup_Greek:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_Greek:nn {bfsfup}{#1} + \um_set_mathalphabet_Greek:Nnn \mathbfsf {up}{#1} + }{ + \bool_if:NT \g_um_upsans_bool { + \um_map_chars_Greek:nn {bfsfup,bfsfit}{#1} + \um_set_mathalphabet_Greek:Nnn \mathbfsf {up,it}{#1} + } + } + \um_set_mathalphabet_Greek:Nnn \mathbfsfup {up,it}{#1} +} +\cs_new:Nn \um_config_bfsfup_greek:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_greek:nn {bfsfup} {#1} + \um_set_mathalphabet_greek:Nnn \mathbfsf {up} {#1} + }{ + \bool_if:NT \g_um_upsans_bool { + \um_map_chars_greek:nn {bfsfup,bfsfit} {#1} + \um_set_mathalphabet_greek:Nnn \mathbfsf {up,it} {#1} + } + } + \um_set_mathalphabet_greek:Nnn \mathbfsfup {up,it} {#1} +} +\cs_new:Nn \um_config_bfsfup_misc:n { + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_map_single:nnn {Nabla}{bfsfup}{#1} + }{ + \bool_if:NT \g_um_upNabla_bool { + \um_map_single:nnn {Nabla}{bfsfup,bfsfit}{#1} + } + } + \bool_if:NTF \g_um_literal_partial_bool { + \um_map_single:nnn {partial}{bfsfup}{#1} + }{ + \bool_if:NT \g_um_uppartial_bool { + \um_map_single:nnn {partial}{bfsfup,bfsfit}{#1} + } + } + \um_set_mathalphabet_pos:Nnnn \mathbfsfup {partial} {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathbfsfup {Nabla} {up,it}{#1} + \bool_if:NTF \g_um_literal_partial_bool { + \um_set_mathalphabet_pos:Nnnn \mathbfsf {partial} {up}{#1} + }{ + \bool_if:NT \g_um_uppartial_bool { + \um_set_mathalphabet_pos:Nnnn \mathbfsf {partial} {up,it}{#1} + } + } + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_set_mathalphabet_pos:Nnnn \mathbfsf {Nabla} {up}{#1} + }{ + \bool_if:NT \g_um_upNabla_bool { + \um_set_mathalphabet_pos:Nnnn \mathbfsf {Nabla} {up,it}{#1} + } + } +} +\cs_new:Nn \um_config_bfsfit_Latin:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_Latin:nn {bfsfit} {#1} + \um_set_mathalphabet_Latin:Nnn \mathbfsf {it}{#1} + }{ + \bool_if:NF \g_um_upsans_bool { + \um_map_chars_Latin:nn {bfsfup,bfsfit} {#1} + \um_set_mathalphabet_Latin:Nnn \mathbfsf {up,it}{#1} + } + } + \um_set_mathalphabet_Latin:Nnn \mathbfsfit {up,it}{#1} +} +\cs_new:Nn \um_config_bfsfit_latin:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_latin:nn {bfsfit} {#1} + \um_set_mathalphabet_latin:Nnn \mathbfsf {it}{#1} + }{ + \bool_if:NF \g_um_upsans_bool { + \um_map_chars_latin:nn {bfsfup,bfsfit} {#1} + \um_set_mathalphabet_latin:Nnn \mathbfsf {up,it}{#1} + } + } + \um_set_mathalphabet_latin:Nnn \mathbfsfit {up,it}{#1} +} +\cs_new:Nn \um_config_bfsfit_Greek:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_Greek:nn {bfsfit}{#1} + \um_set_mathalphabet_Greek:Nnn \mathbfsf {it}{#1} + }{ + \bool_if:NF \g_um_upsans_bool { + \um_map_chars_Greek:nn {bfsfup,bfsfit}{#1} + \um_set_mathalphabet_Greek:Nnn \mathbfsf {up,it}{#1} + } + } + \um_set_mathalphabet_Greek:Nnn \mathbfsfit {up,it}{#1} +} +\cs_new:Nn \um_config_bfsfit_greek:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_greek:nn {bfsfit} {#1} + \um_set_mathalphabet_greek:Nnn \mathbfsf {it} {#1} + }{ + \bool_if:NF \g_um_upsans_bool { + \um_map_chars_greek:nn {bfsfup,bfsfit} {#1} + \um_set_mathalphabet_greek:Nnn \mathbfsf {up,it} {#1} + } + } + \um_set_mathalphabet_greek:Nnn \mathbfsfit {up,it} {#1} +} +\cs_new:Nn \um_config_bfsfit_misc:n { + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_map_single:nnn {Nabla}{bfsfit}{#1} + }{ + \bool_if:NF \g_um_upNabla_bool { + \um_map_single:nnn {Nabla}{bfsfup,bfsfit}{#1} + } + } + \bool_if:NTF \g_um_literal_partial_bool { + \um_map_single:nnn {partial}{bfsfit}{#1} + }{ + \bool_if:NF \g_um_uppartial_bool { + \um_map_single:nnn {partial}{bfsfup,bfsfit}{#1} + } + } + \um_set_mathalphabet_pos:Nnnn \mathbfsfit {partial} {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathbfsfit {Nabla} {up,it}{#1} + \bool_if:NTF \g_um_literal_partial_bool { + \um_set_mathalphabet_pos:Nnnn \mathbfsf {partial} {it}{#1} + }{ + \bool_if:NF \g_um_uppartial_bool { + \um_set_mathalphabet_pos:Nnnn \mathbfsf {partial} {up,it}{#1} + } + } + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_set_mathalphabet_pos:Nnnn \mathbfsf {Nabla} {it}{#1} + }{ + \bool_if:NF \g_um_upNabla_bool { + \um_set_mathalphabet_pos:Nnnn \mathbfsf {Nabla} {up,it}{#1} + } + } +} +\cs_new:Npn \um_symbol_setup: + { + \cs_set:Npn \UnicodeMathSymbol ##1##2##3##4 { + \exp_not:n {\_um_sym:nnn{##1}{##2}{##3}} + } + } +\CatchFileEdef \g_um_mathtable_tl {unicode-math-table.tex} {\um_symbol_setup:} +\cs_new:Nn \um_input_math_symbol_table: {\g_um_mathtable_tl} +\group_begin: + \char_set_catcode_other:N \^ + \cs_gset:Npn \um_cs_set_eq_active_char:Nw #1 = "#2 \q_nil { + \tex_lowercase:D { + \tl_rescan:nn { + \ExplSyntaxOn + \char_set_catcode_other:N \{ + \char_set_catcode_other:N \} + \char_set_catcode_other:N \& + \char_set_catcode_other:N \% + \char_set_catcode_other:N \$ + }{ + \cs_gset_eq:NN #1 ^^^^^#2 + } + } + } + \cs_new:Npn \um_active_char_set:wc "#1 \q_nil #2 { + \tex_lowercase:D { + \tl_rescan:nn { \ExplSyntaxOn } + { \cs_gset_protected_nopar:Npx ^^^^^#1 { \exp_not:c {#2} } } + } + } +\group_end: +\AtBeginDocument{\um_define_math_chars:} +\cs_new:Nn \um_define_math_chars: { + \group_begin: + \char_set_catcode_math_superscript:N \^ + \cs_set:Npn \_um_sym:nnn ##1##2##3 { + \bool_if:nF { \cs_if_eq_p:NN ##3 \mathaccent || + \cs_if_eq_p:NN ##3 \mathopen || + \cs_if_eq_p:NN ##3 \mathclose || + \cs_if_eq_p:NN ##3 \mathover || + \cs_if_eq_p:NN ##3 \mathunder } { + \um_cs_set_eq_active_char:Nw ##2 = ##1 \q_nil \ignorespaces + } + } + \char_set_catcode_other:N \# + \um_input_math_symbol_table: + \group_end: +} +\group_begin: + \lccode`\*=`\\ + \char_set_catcode_escape:N \| + \char_set_catcode_other:N \\ + |lowercase{ + |AtBeginDocument{ + |let|backslash=* + } + } +|group_end: +\cs_new:Nn \um_arg_i_before_egroup:n {#1\egroup} +\cs_new:Nn \um_superscript:n { + ^\bgroup #1 + \peek_meaning_remove:NTF ^ \um_arg_i_before_egroup:n \egroup +} +\muskip_new:N \g_um_primekern_muskip +\muskip_gset:Nn \g_um_primekern_muskip { -\thinmuskip/2 }% arbitrary +\int_new:N \l_um_primecount_int +\cs_new:Nn \um_nprimes:Nn { + \um_superscript:n { + #1 + \prg_replicate:nn {#2-1} { \mskip \g_um_primekern_muskip #1 } + } +} +\cs_new:Nn \um_nprimes_select:nn { + \prg_case_int:nnn {#2}{ + {1} { \um_superscript:n {#1} } + {2} { + \um_glyph_if_exist:nTF {"2033} + { \um_superscript:n {\um_prime_double_mchar} } + { \um_nprimes:Nn #1 {#2} } + } + {3} { + \um_glyph_if_exist:nTF {"2034} + { \um_superscript:n {\um_prime_triple_mchar} } + { \um_nprimes:Nn #1 {#2} } + } + {4} { + \um_glyph_if_exist:nTF {"2057} + { \um_superscript:n {\um_prime_quad_mchar} } + { \um_nprimes:Nn #1 {#2} } + } + }{ + \um_nprimes:Nn #1 {#2} + } +} +\cs_new:Nn \um_nbackprimes_select:nn { + \prg_case_int:nnn {#2}{ + {1} { \um_superscript:n {#1} } + {2} { + \um_glyph_if_exist:nTF {"2036} + { \um_superscript:n {\um_backprime_double_mchar} } + { \um_nprimes:Nn #1 {#2} } + } + {3} { + \um_glyph_if_exist:nTF {"2037} + { \um_superscript:n {\um_backprime_triple_mchar} } + { \um_nprimes:Nn #1 {#2} } + } + }{ + \um_nprimes:Nn #1 {#2} + } +} +\cs_new:Npn \um_scan_prime: { + \cs_set_eq:NN \um_superscript:n \use:n + \int_zero:N \l_um_primecount_int + \um_scanprime_collect:N \um_prime_single_mchar +} +\cs_new:Npn \um_scan_dprime: { + \cs_set_eq:NN \um_superscript:n \use:n + \int_set:Nn \l_um_primecount_int {1} + \um_scanprime_collect:N \um_prime_single_mchar +} +\cs_new:Npn \um_scan_trprime: { + \cs_set_eq:NN \um_superscript:n \use:n + \int_set:Nn \l_um_primecount_int {2} + \um_scanprime_collect:N \um_prime_single_mchar +} +\cs_new:Npn \um_scan_qprime: { + \cs_set_eq:NN \um_superscript:n \use:n + \int_set:Nn \l_um_primecount_int {3} + \um_scanprime_collect:N \um_prime_single_mchar +} +\cs_new:Npn \um_scan_sup_prime: { + \int_zero:N \l_um_primecount_int + \um_scanprime_collect:N \um_prime_single_mchar +} +\cs_new:Npn \um_scan_sup_dprime: { + \int_set:Nn \l_um_primecount_int {1} + \um_scanprime_collect:N \um_prime_single_mchar +} +\cs_new:Npn \um_scan_sup_trprime: { + \int_set:Nn \l_um_primecount_int {2} + \um_scanprime_collect:N \um_prime_single_mchar +} +\cs_new:Npn \um_scan_sup_qprime: { + \int_set:Nn \l_um_primecount_int {3} + \um_scanprime_collect:N \um_prime_single_mchar +} +\cs_new:Nn \um_scanprime_collect:N { + \int_incr:N \l_um_primecount_int + \peek_meaning_remove:NTF ' { + \um_scanprime_collect:N #1 + }{ + \peek_meaning_remove:NTF \um_scan_prime: { + \um_scanprime_collect:N #1 + }{ + \peek_meaning_remove:NTF ^^^^2032 { + \um_scanprime_collect:N #1 + }{ + \peek_meaning_remove:NTF \um_scan_dprime: { + \int_incr:N \l_um_primecount_int + \um_scanprime_collect:N #1 + }{ + \peek_meaning_remove:NTF ^^^^2033 { + \int_incr:N \l_um_primecount_int + \um_scanprime_collect:N #1 + }{ + \peek_meaning_remove:NTF \um_scan_trprime: { + \int_add:Nn \l_um_primecount_int {2} + \um_scanprime_collect:N #1 + }{ + \peek_meaning_remove:NTF ^^^^2034 { + \int_add:Nn \l_um_primecount_int {2} + \um_scanprime_collect:N #1 + }{ + \peek_meaning_remove:NTF \um_scan_qprime: { + \int_add:Nn \l_um_primecount_int {3} + \um_scanprime_collect:N #1 + }{ + \peek_meaning_remove:NTF ^^^^2057 { + \int_add:Nn \l_um_primecount_int {3} + \um_scanprime_collect:N #1 + }{ + \um_nprimes_select:nn {#1} {\l_um_primecount_int} + } + } + } + } + } + } + } + } + } +} +\cs_new:Npn \um_scan_backprime: { + \cs_set_eq:NN \um_superscript:n \use:n + \int_zero:N \l_um_primecount_int + \um_scanbackprime_collect:N \um_backprime_single_mchar +} +\cs_new:Npn \um_scan_backdprime: { + \cs_set_eq:NN \um_superscript:n \use:n + \int_set:Nn \l_um_primecount_int {1} + \um_scanbackprime_collect:N \um_backprime_single_mchar +} +\cs_new:Npn \um_scan_backtrprime: { + \cs_set_eq:NN \um_superscript:n \use:n + \int_set:Nn \l_um_primecount_int {2} + \um_scanbackprime_collect:N \um_backprime_single_mchar +} +\cs_new:Npn \um_scan_sup_backprime: { + \int_zero:N \l_um_primecount_int + \um_scanbackprime_collect:N \um_backprime_single_mchar +} +\cs_new:Npn \um_scan_sup_backdprime: { + \int_set:Nn \l_um_primecount_int {1} + \um_scanbackprime_collect:N \um_backprime_single_mchar +} +\cs_new:Npn \um_scan_sup_backtrprime: { + \int_set:Nn \l_um_primecount_int {2} + \um_scanbackprime_collect:N \um_backprime_single_mchar +} +\cs_new:Nn \um_scanbackprime_collect:N { + \int_incr:N \l_um_primecount_int + \peek_meaning_remove:NTF ` { + \um_scanbackprime_collect:N #1 + }{ + \peek_meaning_remove:NTF \um_scan_backprime: { + \um_scanbackprime_collect:N #1 + }{ + \peek_meaning_remove:NTF ^^^^2035 { + \um_scanbackprime_collect:N #1 + }{ + \peek_meaning_remove:NTF \um_scan_backdprime: { + \int_incr:N \l_um_primecount_int + \um_scanbackprime_collect:N #1 + }{ + \peek_meaning_remove:NTF ^^^^2036 { + \int_incr:N \l_um_primecount_int + \um_scanbackprime_collect:N #1 + }{ + \peek_meaning_remove:NTF \um_scan_backtrprime: { + \int_add:Nn \l_um_primecount_int {2} + \um_scanbackprime_collect:N #1 + }{ + \peek_meaning_remove:NTF ^^^^2037 { + \int_add:Nn \l_um_primecount_int {2} + \um_scanbackprime_collect:N #1 + }{ + \um_nbackprimes_select:nn {#1} {\l_um_primecount_int} + } + } + } + } + } + } + } +} +\AtBeginDocument{\um_define_prime_commands: \um_define_prime_chars:} +\cs_new:Nn \um_define_prime_commands: { + \cs_set_eq:NN \prime \um_prime_single_mchar + \cs_set_eq:NN \dprime \um_prime_double_mchar + \cs_set_eq:NN \trprime \um_prime_triple_mchar + \cs_set_eq:NN \qprime \um_prime_quad_mchar + \cs_set_eq:NN \backprime \um_backprime_single_mchar + \cs_set_eq:NN \backdprime \um_backprime_double_mchar + \cs_set_eq:NN \backtrprime \um_backprime_triple_mchar +} +\group_begin: + \char_set_catcode_active:N \' + \char_set_catcode_active:N \` + \char_set_catcode_active:n {"2032} + \char_set_catcode_active:n {"2033} + \char_set_catcode_active:n {"2034} + \char_set_catcode_active:n {"2057} + \char_set_catcode_active:n {"2035} + \char_set_catcode_active:n {"2036} + \char_set_catcode_active:n {"2037} + \cs_gset:Nn \um_define_prime_chars: { + \cs_set_eq:NN ' \um_scan_sup_prime: + \cs_set_eq:NN ^^^^2032 \um_scan_sup_prime: + \cs_set_eq:NN ^^^^2033 \um_scan_sup_dprime: + \cs_set_eq:NN ^^^^2034 \um_scan_sup_trprime: + \cs_set_eq:NN ^^^^2057 \um_scan_sup_qprime: + \cs_set_eq:NN ` \um_scan_sup_backprime: + \cs_set_eq:NN ^^^^2035 \um_scan_sup_backprime: + \cs_set_eq:NN ^^^^2036 \um_scan_sup_backdprime: + \cs_set_eq:NN ^^^^2037 \um_scan_sup_backtrprime: + } +\group_end: +\AtBeginDocument{\um_redefine_radical:} +\cs_new:Nn \um_redefine_radical: + { + \@ifpackageloaded { amsmath } { } { + \cs_set:Npn \root ##1 \of ##2 { + \luatexUroot \l_um_radical_sqrt_tl { ##1 } { ##2 } + } + } + } +\cs_new:Nn \um_fontdimen_to_percent:nn { + \strip@pt\dimexpr\fontdimen#1#2*65536/100\relax +} +\cs_new:Nn \um_fontdimen_to_scale:nn + { + \um_fontdimen_to_percent:nn {#1} {#2} \dimexpr \f@size pt\relax + } +\cs_new:Nn \um_mathstyle_scale:Nnn { + \ifx#1\scriptstyle + #2\um_fontdimen_to_percent:nn{10}\l_um_font#3 + \else + \ifx#1\scriptscriptstyle + #2\um_fontdimen_to_percent:nn{11}\l_um_font#3 + \else + #2#3 + \fi + \fi +} +\prop_new:N \g_um_supers_prop +\prop_new:N \g_um_subs_prop +\group_begin: +\cs_new:Nn \um_setup_active_superscript:nn { + \prop_gput:Nxn \g_um_supers_prop {\meaning #1} {#2} + \char_set_catcode_active:N #1 + \char_gmake_mathactive:N #1 + \scantokens{ + \cs_gset:Npn #1 { + \tl_set:Nn \l_um_ss_chain_tl {#2} + \cs_set_eq:NN \um_sub_or_super:n \sp + \tl_set:Nn \l_um_tmpa_tl {supers} + \um_scan_sscript: + } + } +} +\um_setup_active_superscript:nn {^^^^2070} {0} +\um_setup_active_superscript:nn {^^^^00b9} {1} +\um_setup_active_superscript:nn {^^^^00b2} {2} +\um_setup_active_superscript:nn {^^^^00b3} {3} +\um_setup_active_superscript:nn {^^^^2074} {4} +\um_setup_active_superscript:nn {^^^^2075} {5} +\um_setup_active_superscript:nn {^^^^2076} {6} +\um_setup_active_superscript:nn {^^^^2077} {7} +\um_setup_active_superscript:nn {^^^^2078} {8} +\um_setup_active_superscript:nn {^^^^2079} {9} +\um_setup_active_superscript:nn {^^^^207a} {+} +\um_setup_active_superscript:nn {^^^^207b} {-} +\um_setup_active_superscript:nn {^^^^207c} {=} +\um_setup_active_superscript:nn {^^^^207d} {(} +\um_setup_active_superscript:nn {^^^^207e} {)} +\um_setup_active_superscript:nn {^^^^2071} {i} +\um_setup_active_superscript:nn {^^^^207f} {n} +\cs_new:Nn \um_setup_active_subscript:nn { + \prop_gput:Nxn \g_um_subs_prop {\meaning #1} {#2} + \char_set_catcode_active:N #1 + \char_gmake_mathactive:N #1 + \scantokens{ + \cs_gset:Npn #1 { + \tl_set:Nn \l_um_ss_chain_tl {#2} + \cs_set_eq:NN \um_sub_or_super:n \sb + \tl_set:Nn \l_um_tmpa_tl {subs} + \um_scan_sscript: + } + } +} +\um_setup_active_subscript:nn {^^^^2080} {0} +\um_setup_active_subscript:nn {^^^^2081} {1} +\um_setup_active_subscript:nn {^^^^2082} {2} +\um_setup_active_subscript:nn {^^^^2083} {3} +\um_setup_active_subscript:nn {^^^^2084} {4} +\um_setup_active_subscript:nn {^^^^2085} {5} +\um_setup_active_subscript:nn {^^^^2086} {6} +\um_setup_active_subscript:nn {^^^^2087} {7} +\um_setup_active_subscript:nn {^^^^2088} {8} +\um_setup_active_subscript:nn {^^^^2089} {9} +\um_setup_active_subscript:nn {^^^^208a} {+} +\um_setup_active_subscript:nn {^^^^208b} {-} +\um_setup_active_subscript:nn {^^^^208c} {=} +\um_setup_active_subscript:nn {^^^^208d} {(} +\um_setup_active_subscript:nn {^^^^208e} {)} +\um_setup_active_subscript:nn {^^^^2090} {a} +\um_setup_active_subscript:nn {^^^^2091} {e} +\um_setup_active_subscript:nn {^^^^1d62} {i} +\um_setup_active_subscript:nn {^^^^2092} {o} +\um_setup_active_subscript:nn {^^^^1d63} {r} +\um_setup_active_subscript:nn {^^^^1d64} {u} +\um_setup_active_subscript:nn {^^^^1d65} {v} +\um_setup_active_subscript:nn {^^^^2093} {x} +\um_setup_active_subscript:nn {^^^^1d66} {\beta} +\um_setup_active_subscript:nn {^^^^1d67} {\gamma} +\um_setup_active_subscript:nn {^^^^1d68} {\rho} +\um_setup_active_subscript:nn {^^^^1d69} {\phi} +\um_setup_active_subscript:nn {^^^^1d6a} {\chi} +\group_end: +\cs_new:Npn \um_scan_sscript: { + \um_scan_sscript:TF { + \um_scan_sscript: + }{ + \um_sub_or_super:n {\l_um_ss_chain_tl} + } +} +\cs_new:Npn \um_scan_sscript:TF #1#2 { + \tl_set:Nx \peek_true_aux:w { \exp_not:n{ #1 } } + \tl_set_eq:NN \peek_true:w \peek_true_remove:w + \tl_set:Nx \peek_false:w { \exp_not:n { \group_align_safe_end: #2 } } + \group_align_safe_begin: + \peek_after:Nw \um_peek_execute_branches_ss: +} +\cs_new:Npn \um_peek_execute_branches_ss: { + \bool_if:nTF { + \token_if_eq_catcode_p:NN \l_peek_token \c_group_begin_token || + \token_if_eq_catcode_p:NN \l_peek_token \c_group_end_token || + \token_if_eq_meaning_p:NN \l_peek_token \c_space_token + } + { \peek_false:w } + { \um_peek_execute_branches_ss_aux: } +} +\cs_new:Npn \um_peek_execute_branches_ss_aux: { + \prop_if_in:cxTF + {g_um_\l_um_tmpa_tl _prop} {\meaning\l_peek_token} + { + \prop_get:cxN + {g_um_\l_um_tmpa_tl _prop} {\meaning\l_peek_token} \l_um_tmpb_tl + \tl_put_right:NV \l_um_ss_chain_tl \l_um_tmpb_tl + \peek_true:w + } + { \peek_false:w } +} +\cs_new:Npn \um_define_active_frac:Nw #1 #2/#3 { + \char_set_catcode_active:N #1 + \char_gmake_mathactive:N #1 + \tl_rescan:nn { + \catcode`\_=11\relax + \catcode`\:=11\relax + }{ + \cs_gset:Npx #1 { + \bool_if:NTF \l_um_smallfrac_bool {\exp_not:N\tfrac} {\exp_not:N\frac} + {#2} {#3} + } + } +} +\cs_new:Npn \um_setup_active_frac: { + \group_begin: + \um_define_active_frac:Nw ^^^^2189 0/3 + \um_define_active_frac:Nw ^^^^2152 1/{10} + \um_define_active_frac:Nw ^^^^2151 1/9 + \um_define_active_frac:Nw ^^^^215b 1/8 + \um_define_active_frac:Nw ^^^^2150 1/7 + \um_define_active_frac:Nw ^^^^2159 1/6 + \um_define_active_frac:Nw ^^^^2155 1/5 + \um_define_active_frac:Nw ^^^^00bc 1/4 + \um_define_active_frac:Nw ^^^^2153 1/3 + \um_define_active_frac:Nw ^^^^215c 3/8 + \um_define_active_frac:Nw ^^^^2156 2/5 + \um_define_active_frac:Nw ^^^^00bd 1/2 + \um_define_active_frac:Nw ^^^^2157 3/5 + \um_define_active_frac:Nw ^^^^215d 5/8 + \um_define_active_frac:Nw ^^^^2154 2/3 + \um_define_active_frac:Nw ^^^^00be 3/4 + \um_define_active_frac:Nw ^^^^2158 4/5 + \um_define_active_frac:Nw ^^^^215a 5/6 + \um_define_active_frac:Nw ^^^^215e 7/8 + \group_end: +} +\um_setup_active_frac: +\def\to{\rightarrow} +\def\le{\leq} +\def\ge{\geq} +\def\neq{\ne} +\def\triangle{\mathord{\bigtriangleup}} +\def\bigcirc{\mdlgwhtcircle} +\def\circ{\vysmwhtcircle} +\def\bullet{\smblkcircle} +\def\mathyen{\yen} +\def\mathsterling{\sterling} +\def\diamond{\smwhtdiamond} +\def\emptyset{\varnothing} +\def\hbar{\hslash} +\def\land{\wedge} +\def\lor{\vee} +\def\owns{\ni} +\def\gets{\leftarrow} +\def\mathring{\ocirc} +\def\lnot{\neg} +\def\backepsilon{\upbackepsilon} +\def\eth{\matheth} +\def\smallint{{\textstyle\int}\limits} +\@ifpackageloaded{amsmath}{ + % define their own colon, perhaps I should just steal it. (It does look much better.) +}{ + \cs_set_protected:Npn \colon { + \bool_if:NTF \g_um_literal_colon_bool {:} { \mathpunct{:} } + } +} +\def\mathrm{\mathup} +\let\mathfence\mathord +\def\digamma{\updigamma} +\def\Digamma{\upDigamma} +\def\operator@font{\um_switchto_mathup:} +\chk_if_free_cs:N \um_tmpa:w +\cs_new_protected_nopar:Npn \um_check_and_fix:NNnnnn #1 #2 #3 #4 #5 #6 { + \cs_if_exist:NT #1 { + \token_if_macro:NTF #1 { + \group_begin: + #2 \um_tmpa:w #3 { #4 } + \cs_if_eq:NNTF #1 \um_tmpa:w { + \msg_info:nnx { unicode-math } { patch-macro } + { \token_to_str:N #1 } + \group_end: + #2 #1 #3 + { #5 } + } { + \msg_warning:nnxxx { unicode-math } { wrong-meaning } + { \token_to_str:N #1 } { \token_to_meaning:N #1 } + { \token_to_meaning:N \um_tmpa:w } + \group_end: + } + } { + \msg_warning:nnx { unicode-math } { macro-expected } + { \token_to_str:N #1 } + } + } +} +\cs_new_protected_nopar:Npn \um_check_and_fix:NNnnn #1 #2 #3 #4 #5 { + \um_check_and_fix:NNnnnn #1 #2 { #3 } { #4 } { #5 } { #5 } +} +\cs_new_protected_nopar:Npn \um_check_and_fix_luatex:NNnnn #1 #2 #3 #4 #5 { + \luatex_if_engine:T { + \um_check_and_fix:NNnnn #1 #2 { #3 } { #4 } { #5 } + } +} +\cs_generate_variant:Nn \um_check_and_fix_luatex:NNnnn { c } +\AtEndOfPackageFile * {url} { + \tl_put_left:Nn \Url@FormatString { \um_switchto_mathup: } + \tl_put_right:Nn \UrlSpecials { + \do\`{\mathchar`\`} + \do\'{\mathchar`\'} + \do\${\mathchar`\$} + \do\&{\mathchar`\&} + } +} +\AtEndOfPackageFile * {amsmath} { + \cs_set:Npn \@cdots {\mathinner{\cdots}} + \cs_set_eq:NN \dotsb@ \cdots + \um_check_and_fix_luatex:NNnnn \plainroot@ \cs_set_nopar:Npn { #1 \of #2 } { + \setbox \rootbox \hbox { + $ \m@th \scriptscriptstyle { #1 } $ + } + \mathchoice + { \r@@t \displaystyle { #2 } } + { \r@@t \textstyle { #2 } }~ + { \r@@t \scriptstyle { #2 } } + { \r@@t \scriptscriptstyle { #2 } } + \egroup + } { + \bool_if:nTF { + \int_compare_p:nNn { \uproot@ } = { \c_zero } + && \int_compare_p:nNn { \leftroot@ } = { \c_zero } + } { + \luatexUroot \l_um_radical_sqrt_tl { #1 } { #2 } + } { + \hbox_set:Nn \rootbox { + \c_math_toggle_token + \m@th + \scriptscriptstyle { #1 } + \c_math_toggle_token + } + \mathchoice + { \r@@t \displaystyle { #2 } } + { \r@@t \textstyle { #2 } } + { \r@@t \scriptstyle { #2 } } + { \r@@t \scriptscriptstyle { #2 } } + } + \c_group_end_token + } + \um_check_and_fix:NNnnnn \r@@t \cs_set_nopar:Npn { #1 #2 } { + \setboxz@h { $ \m@th #1 \sqrtsign { #2 } $ } + \dimen@ \ht\z@ + \advance \dimen@ -\dp\z@ + \setbox\@ne \hbox { $ \m@th #1 \mskip \uproot@ mu $ } + \advance \dimen@ by 1.667 \wd\@ne + \mkern -\leftroot@ mu + \mkern 5mu + \raise .6\dimen@ \copy\rootbox + \mkern -10mu + \mkern \leftroot@ mu + \boxz@ + } { + \hbox_set:Nn \l_tmpa_box { + \c_math_toggle_token + \m@th + #1 + \mskip \uproot@ mu + \c_math_toggle_token + } + \luatexUroot \l_um_radical_sqrt_tl { + \box_move_up:nn { \box_wd:N \l_tmpa_box } { + \hbox:n { + \c_math_toggle_token + \m@th + \mkern -\leftroot@ mu + \box_use:N \rootbox + \mkern \leftroot@ mu + \c_math_toggle_token + } + } + } { + #2 + } + } { + \hbox_set:Nn \l_tmpa_box { + \c_math_toggle_token + \m@th + #1 + \sqrtsign { #2 } + \c_math_toggle_token + } + \hbox_set:Nn \l_tmpb_box { + \c_math_toggle_token + \m@th + #1 + \mskip \uproot@ mu + \c_math_toggle_token + } + \mkern -\leftroot@ mu + \um_mathstyle_scale:Nnn #1 { \kern } { + \fontdimen 63 \l_um_font + } + \box_move_up:nn { + \box_wd:N \l_tmpb_box + + (\box_ht:N \l_tmpa_box - \box_dp:N \l_tmpa_box) + * \number \fontdimen 65 \l_um_font / 100 + } { + \box_use:N \rootbox + } + \um_mathstyle_scale:Nnn #1 { \kern } { + \fontdimen 64 \l_um_font + } + \mkern \leftroot@ mu + \box_use_clear:N \l_tmpa_box + } +} +\AtEndOfPackageFile * {amsopn} { + \cs_set:Npn \newmcodes@ { + \mathcode`\'39\scan_stop: + \mathcode`\*42\scan_stop: + \mathcode`\."613A\scan_stop: +%% \ifnum\mathcode`\-=45 \else +%% \mathchardef\std@minus\mathcode`\-\relax +%% \fi + \mathcode`\-45\scan_stop: + \mathcode`\/47\scan_stop: + \mathcode`\:"603A\scan_stop: + } +} +\cs_set:Npn \| {\Vert} +\cs_set:Npn \mathellipsis {\mathinner{\unicodeellipsis}} +\cs_set:Npn \cdots {\mathinner{\unicodecdots}} +\cs_new_protected_nopar:Nn \um_setup_accents: + { + \cs_gset_protected_nopar:Npx \widehat { + \um_wide_top_accent:Nnn \mathaccent { \um_symfont_tl } { "0302 } + } + \cs_gset_protected_nopar:Npx \widetilde { + \um_wide_top_accent:Nnn \mathaccent { \um_symfont_tl } { "0303 } + } + \cs_gset_protected_nopar:Npx \overleftarrow { + \um_wide_top_accent:Nnn \mathaccent { \um_symfont_tl } { "20D6 } + } + \cs_gset_protected_nopar:Npx \overrightarrow { + \um_wide_top_accent:Nnn \mathaccent { \um_symfont_tl } { "20D7 } + } + \cs_gset_protected_nopar:Npx \overleftrightarrow { + \um_wide_top_accent:Nnn \mathaccent { \um_symfont_tl } { "20E1 } + } + \bool_if:NT \c_um_have_fixed_accents_bool { + \cs_gset_protected_nopar:Npx \underrightharpoondown { + \um_wide_bottom_accent:Nnn \mathaccent { \um_symfont_tl } { "20EC } + } + \cs_gset_protected_nopar:Npx \underleftharpoondown { + \um_wide_bottom_accent:Nnn \mathaccent { \um_symfont_tl } { "20ED } + } + \cs_gset_protected_nopar:Npx \underleftarrow { + \um_wide_bottom_accent:Nnn \mathaccent { \um_symfont_tl } { "20EE } + } + \cs_gset_protected_nopar:Npx \underrightarrow { + \um_wide_bottom_accent:Nnn \mathaccent { \um_symfont_tl } { "20EF } + } + } + } +\cs_set_eq:NN \um_text_slash: \slash +\cs_set_protected:Npn \slash { + \mode_if_math:TF {\mathslash} {\um_text_slash:} +} +\AtEndOfPackageFile * { mathtools } { + \msg_warning:nn { unicode-math } { mathtools } + \NewDocumentCommand \dblcolon { } { \Colon } + \NewDocumentCommand \coloneqq { } { \coloneq } + \NewDocumentCommand \Coloneqq { } { \Coloneq } + \NewDocumentCommand \eqqcolon { } { \eqcolon } +} +\AtEndOfPackageFile * { colonequals } { + \msg_warning:nn { unicode-math } { colonequals } + \RenewDocumentCommand \ratio { } { \mathratio } + \RenewDocumentCommand \coloncolon { } { \Colon } + \RenewDocumentCommand \minuscolon { } { \dashcolon } + \RenewDocumentCommand \colonequals { } { \coloneq } + \RenewDocumentCommand \equalscolon { } { \eqcolon } + \RenewDocumentCommand \coloncolonequals { } { \Coloneq } +} +\ExplSyntaxOff diff --git a/Master/texmf-dist/tex/latex/unicode-math/unicode-math-table.tex b/Master/texmf-dist/tex/latex/unicode-math/unicode-math-table.tex index 7312839ddb8..b4aeff77cee 100644 --- a/Master/texmf-dist/tex/latex/unicode-math/unicode-math-table.tex +++ b/Master/texmf-dist/tex/latex/unicode-math/unicode-math-table.tex @@ -7,7 +7,7 @@ \UnicodeMathSymbol{"00029}{\rparen }{\mathclose}{right parenthesis}% \UnicodeMathSymbol{"0002B}{\plus }{\mathbin}{plus sign b:}% \UnicodeMathSymbol{"0002C}{\comma }{\mathpunct}{comma}% -\UnicodeMathSymbol{"0002E}{\period }{\mathalpha}{full stop, period}% +\UnicodeMathSymbol{"0002E}{\period }{\mathord}{full stop, period}% \UnicodeMathSymbol{"0002F}{\mathslash }{\mathord}{solidus}% \UnicodeMathSymbol{"0003A}{\mathcolon }{\mathpunct}{colon}% \UnicodeMathSymbol{"0003B}{\semicolon }{\mathpunct}{semicolon p:}% @@ -318,12 +318,12 @@ \UnicodeMathSymbol{"021FF}{\leftrightarrowtriangle }{\mathrel}{left right open-headed arrow}% \UnicodeMathSymbol{"02200}{\forall }{\mathord}{for all}% \UnicodeMathSymbol{"02201}{\complement }{\mathord}{complement sign}% -\UnicodeMathSymbol{"02202}{\partial }{\mathord}{partial differential}% +\UnicodeMathSymbol{"02202}{\partial }{\mathalpha}{partial differential}% \UnicodeMathSymbol{"02203}{\exists }{\mathord}{at least one exists}% \UnicodeMathSymbol{"02204}{\nexists }{\mathord}{negated exists}% \UnicodeMathSymbol{"02205}{\varnothing }{\mathord}{circle, slash}% \UnicodeMathSymbol{"02206}{\increment }{\mathord}{laplacian (delta; nabla\string^2)}% -\UnicodeMathSymbol{"02207}{\nabla }{\mathord}{nabla, del, hamilton operator}% +\UnicodeMathSymbol{"02207}{\nabla }{\mathalpha}{nabla, del, hamilton operator}% \UnicodeMathSymbol{"02208}{\in }{\mathrel}{set membership, variant}% \UnicodeMathSymbol{"02209}{\notin }{\mathrel}{negated set membership}% \UnicodeMathSymbol{"0220A}{\smallin }{\mathrel}{set membership (small set membership)}% @@ -648,6 +648,8 @@ \UnicodeMathSymbol{"023E5}{\fltns }{\mathord}{flatness}% \UnicodeMathSymbol{"023E6}{\accurrent }{\mathord}{ac current}% \UnicodeMathSymbol{"023E7}{\elinters }{\mathord}{electrical intersection}% +\UnicodeMathSymbol{"02422}{\blanksymbol }{\mathord}{blank symbol}% +\UnicodeMathSymbol{"02423}{\openbox }{\mathord}{open box}% \UnicodeMathSymbol{"02506}{\bdtriplevdash }{\mathord}{doubly broken vert}% \UnicodeMathSymbol{"02580}{\blockuphalf }{\mathord}{upper half block}% \UnicodeMathSymbol{"02584}{\blocklowhalf }{\mathord}{lower half block}% @@ -2119,7 +2121,7 @@ \UnicodeMathSymbol{"1D6BE}{\mbfChi }{\mathalpha}{mathematical bold capital chi}% \UnicodeMathSymbol{"1D6BF}{\mbfPsi }{\mathalpha}{mathematical bold capital psi}% \UnicodeMathSymbol{"1D6C0}{\mbfOmega }{\mathalpha}{mathematical bold capital omega}% -\UnicodeMathSymbol{"1D6C1}{\mbfnabla }{\mathord}{mathematical bold nabla}% +\UnicodeMathSymbol{"1D6C1}{\mbfnabla }{\mathalpha}{mathematical bold nabla}% \UnicodeMathSymbol{"1D6C2}{\mbfalpha }{\mathalpha}{mathematical bold small alpha}% \UnicodeMathSymbol{"1D6C3}{\mbfbeta }{\mathalpha}{mathematical bold small beta}% \UnicodeMathSymbol{"1D6C4}{\mbfgamma }{\mathalpha}{mathematical bold small gamma}% @@ -2145,7 +2147,7 @@ \UnicodeMathSymbol{"1D6D8}{\mbfchi }{\mathalpha}{mathematical bold small chi}% \UnicodeMathSymbol{"1D6D9}{\mbfpsi }{\mathalpha}{mathematical bold small psi}% \UnicodeMathSymbol{"1D6DA}{\mbfomega }{\mathalpha}{mathematical bold small omega}% -\UnicodeMathSymbol{"1D6DB}{\mbfpartial }{\mathord}{mathematical bold partial differential}% +\UnicodeMathSymbol{"1D6DB}{\mbfpartial }{\mathalpha}{mathematical bold partial differential}% \UnicodeMathSymbol{"1D6DC}{\mbfvarepsilon }{\mathalpha}{mathematical bold epsilon symbol}% \UnicodeMathSymbol{"1D6DD}{\mbfvartheta }{\mathalpha}{mathematical bold theta symbol}% \UnicodeMathSymbol{"1D6DE}{\mbfvarkappa }{\mathalpha}{mathematical bold kappa symbol}% @@ -2177,7 +2179,7 @@ \UnicodeMathSymbol{"1D6F8}{\mitChi }{\mathalpha}{mathematical italic capital chi}% \UnicodeMathSymbol{"1D6F9}{\mitPsi }{\mathalpha}{mathematical italic capital psi}% \UnicodeMathSymbol{"1D6FA}{\mitOmega }{\mathalpha}{mathematical italic capital omega}% -\UnicodeMathSymbol{"1D6FB}{\mitnabla }{\mathord}{mathematical italic nabla}% +\UnicodeMathSymbol{"1D6FB}{\mitnabla }{\mathalpha}{mathematical italic nabla}% \UnicodeMathSymbol{"1D6FC}{\mitalpha }{\mathalpha}{mathematical italic small alpha}% \UnicodeMathSymbol{"1D6FD}{\mitbeta }{\mathalpha}{mathematical italic small beta}% \UnicodeMathSymbol{"1D6FE}{\mitgamma }{\mathalpha}{mathematical italic small gamma}% @@ -2203,7 +2205,7 @@ \UnicodeMathSymbol{"1D712}{\mitchi }{\mathalpha}{mathematical italic small chi}% \UnicodeMathSymbol{"1D713}{\mitpsi }{\mathalpha}{mathematical italic small psi}% \UnicodeMathSymbol{"1D714}{\mitomega }{\mathalpha}{mathematical italic small omega}% -\UnicodeMathSymbol{"1D715}{\mitpartial }{\mathord}{mathematical italic partial differential}% +\UnicodeMathSymbol{"1D715}{\mitpartial }{\mathalpha}{mathematical italic partial differential}% \UnicodeMathSymbol{"1D716}{\mitvarepsilon }{\mathalpha}{mathematical italic epsilon symbol}% \UnicodeMathSymbol{"1D717}{\mitvartheta }{\mathalpha}{mathematical italic theta symbol}% \UnicodeMathSymbol{"1D718}{\mitvarkappa }{\mathalpha}{mathematical italic kappa symbol}% @@ -2235,7 +2237,7 @@ \UnicodeMathSymbol{"1D732}{\mbfitChi }{\mathalpha}{mathematical bold italic capital chi}% \UnicodeMathSymbol{"1D733}{\mbfitPsi }{\mathalpha}{mathematical bold italic capital psi}% \UnicodeMathSymbol{"1D734}{\mbfitOmega }{\mathalpha}{mathematical bold italic capital omega}% -\UnicodeMathSymbol{"1D735}{\mbfitnabla }{\mathord}{mathematical bold italic nabla}% +\UnicodeMathSymbol{"1D735}{\mbfitnabla }{\mathalpha}{mathematical bold italic nabla}% \UnicodeMathSymbol{"1D736}{\mbfitalpha }{\mathalpha}{mathematical bold italic small alpha}% \UnicodeMathSymbol{"1D737}{\mbfitbeta }{\mathalpha}{mathematical bold italic small beta}% \UnicodeMathSymbol{"1D738}{\mbfitgamma }{\mathalpha}{mathematical bold italic small gamma}% @@ -2261,7 +2263,7 @@ \UnicodeMathSymbol{"1D74C}{\mbfitchi }{\mathalpha}{mathematical bold italic small chi}% \UnicodeMathSymbol{"1D74D}{\mbfitpsi }{\mathalpha}{mathematical bold italic small psi}% \UnicodeMathSymbol{"1D74E}{\mbfitomega }{\mathalpha}{mathematical bold italic small omega}% -\UnicodeMathSymbol{"1D74F}{\mbfitpartial }{\mathord}{mathematical bold italic partial differential}% +\UnicodeMathSymbol{"1D74F}{\mbfitpartial }{\mathalpha}{mathematical bold italic partial differential}% \UnicodeMathSymbol{"1D750}{\mbfitvarepsilon }{\mathalpha}{mathematical bold italic epsilon symbol}% \UnicodeMathSymbol{"1D751}{\mbfitvartheta }{\mathalpha}{mathematical bold italic theta symbol}% \UnicodeMathSymbol{"1D752}{\mbfitvarkappa }{\mathalpha}{mathematical bold italic kappa symbol}% @@ -2293,7 +2295,7 @@ \UnicodeMathSymbol{"1D76C}{\mbfsansChi }{\mathalpha}{mathematical sans-serif bold capital chi}% \UnicodeMathSymbol{"1D76D}{\mbfsansPsi }{\mathalpha}{mathematical sans-serif bold capital psi}% \UnicodeMathSymbol{"1D76E}{\mbfsansOmega }{\mathalpha}{mathematical sans-serif bold capital omega}% -\UnicodeMathSymbol{"1D76F}{\mbfsansnabla }{\mathord}{mathematical sans-serif bold nabla}% +\UnicodeMathSymbol{"1D76F}{\mbfsansnabla }{\mathalpha}{mathematical sans-serif bold nabla}% \UnicodeMathSymbol{"1D770}{\mbfsansalpha }{\mathalpha}{mathematical sans-serif bold small alpha}% \UnicodeMathSymbol{"1D771}{\mbfsansbeta }{\mathalpha}{mathematical sans-serif bold small beta}% \UnicodeMathSymbol{"1D772}{\mbfsansgamma }{\mathalpha}{mathematical sans-serif bold small gamma}% @@ -2319,7 +2321,7 @@ \UnicodeMathSymbol{"1D786}{\mbfsanschi }{\mathalpha}{mathematical sans-serif bold small chi}% \UnicodeMathSymbol{"1D787}{\mbfsanspsi }{\mathalpha}{mathematical sans-serif bold small psi}% \UnicodeMathSymbol{"1D788}{\mbfsansomega }{\mathalpha}{mathematical sans-serif bold small omega}% -\UnicodeMathSymbol{"1D789}{\mbfsanspartial }{\mathord}{mathematical sans-serif bold partial differential}% +\UnicodeMathSymbol{"1D789}{\mbfsanspartial }{\mathalpha}{mathematical sans-serif bold partial differential}% \UnicodeMathSymbol{"1D78A}{\mbfsansvarepsilon }{\mathalpha}{mathematical sans-serif bold epsilon symbol}% \UnicodeMathSymbol{"1D78B}{\mbfsansvartheta }{\mathalpha}{mathematical sans-serif bold theta symbol}% \UnicodeMathSymbol{"1D78C}{\mbfsansvarkappa }{\mathalpha}{mathematical sans-serif bold kappa symbol}% @@ -2351,7 +2353,7 @@ \UnicodeMathSymbol{"1D7A6}{\mbfitsansChi }{\mathalpha}{mathematical sans-serif bold italic capital chi}% \UnicodeMathSymbol{"1D7A7}{\mbfitsansPsi }{\mathalpha}{mathematical sans-serif bold italic capital psi}% \UnicodeMathSymbol{"1D7A8}{\mbfitsansOmega }{\mathalpha}{mathematical sans-serif bold italic capital omega}% -\UnicodeMathSymbol{"1D7A9}{\mbfitsansnabla }{\mathord}{mathematical sans-serif bold italic nabla}% +\UnicodeMathSymbol{"1D7A9}{\mbfitsansnabla }{\mathalpha}{mathematical sans-serif bold italic nabla}% \UnicodeMathSymbol{"1D7AA}{\mbfitsansalpha }{\mathalpha}{mathematical sans-serif bold italic small alpha}% \UnicodeMathSymbol{"1D7AB}{\mbfitsansbeta }{\mathalpha}{mathematical sans-serif bold italic small beta}% \UnicodeMathSymbol{"1D7AC}{\mbfitsansgamma }{\mathalpha}{mathematical sans-serif bold italic small gamma}% @@ -2377,7 +2379,7 @@ \UnicodeMathSymbol{"1D7C0}{\mbfitsanschi }{\mathalpha}{mathematical sans-serif bold italic small chi}% \UnicodeMathSymbol{"1D7C1}{\mbfitsanspsi }{\mathalpha}{mathematical sans-serif bold italic small psi}% \UnicodeMathSymbol{"1D7C2}{\mbfitsansomega }{\mathalpha}{mathematical sans-serif bold italic small omega}% -\UnicodeMathSymbol{"1D7C3}{\mbfitsanspartial }{\mathord}{mathematical sans-serif bold italic partial differential}% +\UnicodeMathSymbol{"1D7C3}{\mbfitsanspartial }{\mathalpha}{mathematical sans-serif bold italic partial differential}% \UnicodeMathSymbol{"1D7C4}{\mbfitsansvarepsilon }{\mathalpha}{mathematical sans-serif bold italic epsilon symbol}% \UnicodeMathSymbol{"1D7C5}{\mbfitsansvartheta }{\mathalpha}{mathematical sans-serif bold italic theta symbol}% \UnicodeMathSymbol{"1D7C6}{\mbfitsansvarkappa }{\mathalpha}{mathematical sans-serif bold italic kappa symbol}% diff --git a/Master/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty b/Master/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty new file mode 100644 index 00000000000..339f67ff4cd --- /dev/null +++ b/Master/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty @@ -0,0 +1,2630 @@ +%% +%% This is file `unicode-math-xetex.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% unicode-math.dtx (with options: `package,XE') +%% Copyright 2006-2011 Will Robertson <will.robertson@latex-project.org> +%% Copyright 2010-2011 Philipp Stephani <st_philipp@yahoo.de> +%% +%% This package is free software and may be redistributed and/or modified under +%% the conditions of the LaTeX Project Public License, version 1.3c or higher +%% (your choice): <http://www.latex-project.org/lppl/>. +%% +%% This work is "author-maintained" by Will Robertson. +\ExplSyntaxOn +\cs_new:Nn \um_cs_compat:n + { \cs_set_eq:cc {U#1} {XeTeX#1} } +\um_cs_compat:n {mathcode} +\um_cs_compat:n {delcode} +\um_cs_compat:n {mathcodenum} +\um_cs_compat:n {mathcharnum} +\um_cs_compat:n {mathchardef} +\um_cs_compat:n {radical} +\um_cs_compat:n {mathaccent} +\um_cs_compat:n {delimiter} +\bool_set_false:N \c_um_have_fixed_accents_bool +\cs_new:Nn \usv_set:nnn { + \tl_set:cn { \um_to_usv:nn {#1}{#2} } {#3} +} +\cs_new:Nn \um_to_usv:nn { g_um_#1_#2_usv } +\usv_set:nnn {up}{num}{48} +\usv_set:nnn {up}{Latin}{65} +\usv_set:nnn {up}{latin}{97} +\usv_set:nnn {up}{Greek}{"391} +\usv_set:nnn {up}{greek}{"3B1} +\usv_set:nnn {it}{Latin}{"1D434} +\usv_set:nnn {it}{latin}{"1D44E} +\usv_set:nnn {it}{Greek}{"1D6E2} +\usv_set:nnn {it}{greek}{"1D6FC} +\usv_set:nnn {bb}{num}{"1D7D8} +\usv_set:nnn {bb}{Latin}{"1D538} +\usv_set:nnn {bb}{latin}{"1D552} +\usv_set:nnn {scr}{Latin}{"1D49C} +\usv_set:nnn {cal}{Latin}{"1D49C} +\usv_set:nnn {scr}{latin}{"1D4B6} +\usv_set:nnn {frak}{Latin}{"1D504} +\usv_set:nnn {frak}{latin}{"1D51E} +\usv_set:nnn {sf}{num}{"1D7E2} +\usv_set:nnn {sfup}{num}{"1D7E2} +\usv_set:nnn {sfit}{num}{"1D7E2} +\usv_set:nnn {sfup}{Latin}{"1D5A0} +\usv_set:nnn {sf}{Latin}{"1D5A0} +\usv_set:nnn {sfup}{latin}{"1D5BA} +\usv_set:nnn {sf}{latin}{"1D5BA} +\usv_set:nnn {sfit}{Latin}{"1D608} +\usv_set:nnn {sfit}{latin}{"1D622} +\usv_set:nnn {tt}{num}{"1D7F6} +\usv_set:nnn {tt}{Latin}{"1D670} +\usv_set:nnn {tt}{latin}{"1D68A} +\usv_set:nnn {bf}{num}{"1D7CE} +\usv_set:nnn {bfup}{num}{"1D7CE} +\usv_set:nnn {bfit}{num}{"1D7CE} +\usv_set:nnn {bfup}{Latin}{"1D400} +\usv_set:nnn {bfup}{latin}{"1D41A} +\usv_set:nnn {bfup}{Greek}{"1D6A8} +\usv_set:nnn {bfup}{greek}{"1D6C2} +\usv_set:nnn {bfit}{Latin}{"1D468} +\usv_set:nnn {bfit}{latin}{"1D482} +\usv_set:nnn {bfit}{Greek}{"1D71C} +\usv_set:nnn {bfit}{greek}{"1D736} +\usv_set:nnn {bffrak}{Latin}{"1D56C} +\usv_set:nnn {bffrak}{latin}{"1D586} +\usv_set:nnn {bfscr}{Latin}{"1D4D0} +\usv_set:nnn {bfcal}{Latin}{"1D4D0} +\usv_set:nnn {bfscr}{latin}{"1D4EA} +\usv_set:nnn {bfsf}{num}{"1D7EC} +\usv_set:nnn {bfsfup}{num}{"1D7EC} +\usv_set:nnn {bfsfit}{num}{"1D7EC} +\usv_set:nnn {bfsfup}{Latin}{"1D5D4} +\usv_set:nnn {bfsfup}{latin}{"1D5EE} +\usv_set:nnn {bfsfup}{Greek}{"1D756} +\usv_set:nnn {bfsfup}{greek}{"1D770} +\usv_set:nnn {bfsfit}{Latin}{"1D63C} +\usv_set:nnn {bfsfit}{latin}{"1D656} +\usv_set:nnn {bfsfit}{Greek}{"1D790} +\usv_set:nnn {bfsfit}{greek}{"1D7AA} +\usv_set:nnn {bfsf}{Latin}{ \bool_if:NTF \g_um_upLatin_bool \g_um_bfsfup_Latin_usv \g_um_bfsfit_Latin_usv } +\usv_set:nnn {bfsf}{latin}{ \bool_if:NTF \g_um_uplatin_bool \g_um_bfsfup_latin_usv \g_um_bfsfit_latin_usv } +\usv_set:nnn {bfsf}{Greek}{ \bool_if:NTF \g_um_upGreek_bool \g_um_bfsfup_Greek_usv \g_um_bfsfit_Greek_usv } +\usv_set:nnn {bfsf}{greek}{ \bool_if:NTF \g_um_upgreek_bool \g_um_bfsfup_greek_usv \g_um_bfsfit_greek_usv } +\usv_set:nnn {bf}{Latin}{ \bool_if:NTF \g_um_bfupLatin_bool \g_um_bfup_Latin_usv \g_um_bfit_Latin_usv } +\usv_set:nnn {bf}{latin}{ \bool_if:NTF \g_um_bfuplatin_bool \g_um_bfup_latin_usv \g_um_bfit_latin_usv } +\usv_set:nnn {bf}{Greek}{ \bool_if:NTF \g_um_bfupGreek_bool \g_um_bfup_Greek_usv \g_um_bfit_Greek_usv } +\usv_set:nnn {bf}{greek}{ \bool_if:NTF \g_um_bfupgreek_bool \g_um_bfup_greek_usv \g_um_bfit_greek_usv } +\usv_set:nnn {up}{varTheta}{"3F4} +\usv_set:nnn {up}{Digamma}{"3DC} +\usv_set:nnn {up}{varepsilon}{"3F5} +\usv_set:nnn {up}{vartheta}{"3D1} +\usv_set:nnn {up}{varkappa}{"3F0} +\usv_set:nnn {up}{varphi}{"3D5} +\usv_set:nnn {up}{varrho}{"3F1} +\usv_set:nnn {up}{varpi}{"3D6} +\usv_set:nnn {up}{digamma}{"3DD} +\usv_set:nnn {bfup}{varTheta}{"1D6B9} +\usv_set:nnn {bfup}{Digamma}{"1D7CA} +\usv_set:nnn {bfup}{varepsilon}{"1D6DC} +\usv_set:nnn {bfup}{vartheta}{"1D6DD} +\usv_set:nnn {bfup}{varkappa}{"1D6DE} +\usv_set:nnn {bfup}{varphi}{"1D6DF} +\usv_set:nnn {bfup}{varrho}{"1D6E0} +\usv_set:nnn {bfup}{varpi}{"1D6E1} +\usv_set:nnn {bfup}{digamma}{"1D7CB} +\usv_set:nnn {it}{varTheta}{"1D6F3} +\usv_set:nnn {it}{varepsilon}{"1D716} +\usv_set:nnn {it}{vartheta}{"1D717} +\usv_set:nnn {it}{varkappa}{"1D718} +\usv_set:nnn {it}{varphi}{"1D719} +\usv_set:nnn {it}{varrho}{"1D71A} +\usv_set:nnn {it}{varpi}{"1D71B} +\usv_set:nnn {bfit}{varTheta}{"1D72D} +\usv_set:nnn {bfit}{varepsilon}{"1D750} +\usv_set:nnn {bfit}{vartheta}{"1D751} +\usv_set:nnn {bfit}{varkappa}{"1D752} +\usv_set:nnn {bfit}{varphi}{"1D753} +\usv_set:nnn {bfit}{varrho}{"1D754} +\usv_set:nnn {bfit}{varpi}{"1D755} +\usv_set:nnn {bfsfup}{varTheta}{"1D767} +\usv_set:nnn {bfsfup}{varepsilon}{"1D78A} +\usv_set:nnn {bfsfup}{vartheta}{"1D78B} +\usv_set:nnn {bfsfup}{varkappa}{"1D78C} +\usv_set:nnn {bfsfup}{varphi}{"1D78D} +\usv_set:nnn {bfsfup}{varrho}{"1D78E} +\usv_set:nnn {bfsfup}{varpi}{"1D78F} +\usv_set:nnn {bfsfit}{varTheta} {"1D7A1} +\usv_set:nnn {bfsfit}{varepsilon}{"1D7C4} +\usv_set:nnn {bfsfit}{vartheta} {"1D7C5} +\usv_set:nnn {bfsfit}{varkappa} {"1D7C6} +\usv_set:nnn {bfsfit}{varphi} {"1D7C7} +\usv_set:nnn {bfsfit}{varrho} {"1D7C8} +\usv_set:nnn {bfsfit}{varpi} {"1D7C9} +\usv_set:nnn {up} {Nabla}{"02207} +\usv_set:nnn {it} {Nabla}{"1D6FB} +\usv_set:nnn {bfup} {Nabla}{"1D6C1} +\usv_set:nnn {bfit} {Nabla}{"1D735} +\usv_set:nnn {bfsfup}{Nabla}{"1D76F} +\usv_set:nnn {bfsfit}{Nabla}{"1D7A9} +\usv_set:nnn {up} {partial}{"02202} +\usv_set:nnn {it} {partial}{"1D715} +\usv_set:nnn {bfup} {partial}{"1D6DB} +\usv_set:nnn {bfit} {partial}{"1D74F} +\usv_set:nnn {bfsfup}{partial}{"1D789} +\usv_set:nnn {bfsfit}{partial}{"1D7C3} +\usv_set:nnn {up}{B}{`\B} +\usv_set:nnn {up}{C}{`\C} +\usv_set:nnn {up}{D}{`\D} +\usv_set:nnn {up}{E}{`\E} +\usv_set:nnn {up}{F}{`\F} +\usv_set:nnn {up}{H}{`\H} +\usv_set:nnn {up}{I}{`\I} +\usv_set:nnn {up}{L}{`\L} +\usv_set:nnn {up}{M}{`\M} +\usv_set:nnn {up}{N}{`\N} +\usv_set:nnn {up}{P}{`\P} +\usv_set:nnn {up}{Q}{`\Q} +\usv_set:nnn {up}{R}{`\R} +\usv_set:nnn {up}{Z}{`\Z} +\usv_set:nnn {it}{B}{"1D435} +\usv_set:nnn {it}{C}{"1D436} +\usv_set:nnn {it}{D}{"1D437} +\usv_set:nnn {it}{E}{"1D438} +\usv_set:nnn {it}{F}{"1D439} +\usv_set:nnn {it}{H}{"1D43B} +\usv_set:nnn {it}{I}{"1D43C} +\usv_set:nnn {it}{L}{"1D43F} +\usv_set:nnn {it}{M}{"1D440} +\usv_set:nnn {it}{N}{"1D441} +\usv_set:nnn {it}{P}{"1D443} +\usv_set:nnn {it}{Q}{"1D444} +\usv_set:nnn {it}{R}{"1D445} +\usv_set:nnn {it}{Z}{"1D44D} +\usv_set:nnn {up}{d}{`\d} +\usv_set:nnn {up}{e}{`\e} +\usv_set:nnn {up}{g}{`\g} +\usv_set:nnn {up}{h}{`\h} +\usv_set:nnn {up}{i}{`\i} +\usv_set:nnn {up}{j}{`\j} +\usv_set:nnn {up}{o}{`\o} +\usv_set:nnn {it}{d}{"1D451} +\usv_set:nnn {it}{e}{"1D452} +\usv_set:nnn {it}{g}{"1D454} +\usv_set:nnn {it}{h}{"0210E} +\usv_set:nnn {it}{i}{"1D456} +\usv_set:nnn {it}{j}{"1D457} +\usv_set:nnn {it}{o}{"1D45C} +\usv_set:nnn {bb} {h}{"1D559} +\usv_set:nnn {tt} {h}{"1D691} +\usv_set:nnn {scr} {h}{"1D4BD} +\usv_set:nnn {frak} {h}{"1D525} +\usv_set:nnn {bfup} {h}{"1D421} +\usv_set:nnn {bfit} {h}{"1D489} +\usv_set:nnn {sfup} {h}{"1D5C1} +\usv_set:nnn {sfit} {h}{"1D629} +\usv_set:nnn {bffrak}{h}{"1D58D} +\usv_set:nnn {bfscr} {h}{"1D4F1} +\usv_set:nnn {bfsfup}{h}{"1D5F5} +\usv_set:nnn {bfsfit}{h}{"1D65D} +\usv_set:nnn {up}{dotlessi}{"00131} +\usv_set:nnn {up}{dotlessj}{"00237} +\usv_set:nnn {it}{dotlessi}{"1D6A4} +\usv_set:nnn {it}{dotlessj}{"1D6A5} +\usv_set:nnn {bb}{C}{"2102} +\usv_set:nnn {bb}{H}{"210D} +\usv_set:nnn {bb}{N}{"2115} +\usv_set:nnn {bb}{P}{"2119} +\usv_set:nnn {bb}{Q}{"211A} +\usv_set:nnn {bb}{R}{"211D} +\usv_set:nnn {bb}{Z}{"2124} +\usv_set:nnn {up}{Pi} {"003A0} +\usv_set:nnn {up}{pi} {"003C0} +\usv_set:nnn {up}{Gamma} {"00393} +\usv_set:nnn {up}{gamma} {"003B3} +\usv_set:nnn {up}{summation}{"02211} +\usv_set:nnn {it}{Pi} {"1D6F1} +\usv_set:nnn {it}{pi} {"1D70B} +\usv_set:nnn {it}{Gamma} {"1D6E4} +\usv_set:nnn {it}{gamma} {"1D6FE} +\usv_set:nnn {bb}{Pi} {"0213F} +\usv_set:nnn {bb}{pi} {"0213C} +\usv_set:nnn {bb}{Gamma} {"0213E} +\usv_set:nnn {bb}{gamma} {"0213D} +\usv_set:nnn {bb}{summation}{"02140} +\usv_set:nnn {bbit}{D}{"2145} +\usv_set:nnn {bbit}{d}{"2146} +\usv_set:nnn {bbit}{e}{"2147} +\usv_set:nnn {bbit}{i}{"2148} +\usv_set:nnn {bbit}{j}{"2149} +\usv_set:nnn {scr}{B}{"212C} +\usv_set:nnn {scr}{E}{"2130} +\usv_set:nnn {scr}{F}{"2131} +\usv_set:nnn {scr}{H}{"210B} +\usv_set:nnn {scr}{I}{"2110} +\usv_set:nnn {scr}{L}{"2112} +\usv_set:nnn {scr}{M}{"2133} +\usv_set:nnn {scr}{R}{"211B} +\usv_set:nnn {scr}{e}{"212F} +\usv_set:nnn {scr}{g}{"210A} +\usv_set:nnn {scr}{o}{"2134} +\usv_set:nnn {cal}{B}{"212C} +\usv_set:nnn {cal}{E}{"2130} +\usv_set:nnn {cal}{F}{"2131} +\usv_set:nnn {cal}{H}{"210B} +\usv_set:nnn {cal}{I}{"2110} +\usv_set:nnn {cal}{L}{"2112} +\usv_set:nnn {cal}{M}{"2133} +\usv_set:nnn {cal}{R}{"211B} +\usv_set:nnn {frak}{C}{"212D} +\usv_set:nnn {frak}{H}{"210C} +\usv_set:nnn {frak}{I}{"2111} +\usv_set:nnn {frak}{R}{"211C} +\usv_set:nnn {frak}{Z}{"2128} +\tl_map_inline:nn { + \new@mathgroup\cdp@list\cdp@elt\DeclareMathSizes + \@DeclareMathSizes\newmathalphabet\newmathalphabet@@\newmathalphabet@@@ + \DeclareMathVersion\define@mathalphabet\define@mathgroup\addtoversion + \version@list\version@elt\alpha@list\alpha@elt + \restore@mathversion\init@restore@version\dorestore@version\process@table + \new@mathversion\DeclareSymbolFont\group@list\group@elt + \new@symbolfont\SetSymbolFont\SetSymbolFont@\get@cdp + \DeclareMathAlphabet\new@mathalphabet\SetMathAlphabet\SetMathAlphabet@ + \DeclareMathAccent\set@mathaccent\DeclareMathSymbol\set@mathchar + \set@mathsymbol\DeclareMathDelimiter\@xxDeclareMathDelimiter + \@DeclareMathDelimiter\@xDeclareMathDelimiter\set@mathdelimiter + \set@@mathdelimiter\DeclareMathRadical\mathchar@type + \DeclareSymbolFontAlphabet\DeclareSymbolFontAlphabet@ +}{ + \tl_remove_once:Nn \@preamblecmds {\do#1} +} +\def\new@mathgroup{\alloc@8\mathgroup\chardef\@cclvi} +\let\newfam\new@mathgroup +\cs_set:Nn \um_set_mathsymbol:nNNn { + \prg_case_tl:Nnn #3 { + \mathop { \um_set_big_operator:nnn {#1} {#2} {#4} } + \mathopen + { + \tl_if_in:NnTF \l_um_radicals_tl {#2} + { + \cs_gset_protected_nopar:cpx {\cs_to_str:N #2 sign} + { \um_radical:nn {#1} {#4} } + \tl_set:cn {l_um_radical_\cs_to_str:N #2_tl} {\use:c{sym #1}~ #4} + } + { + \um_set_delcode:nnn {#1} {#4} {#4} + \um_set_mathcode:nnn {#4} \mathopen {#1} + \cs_gset_protected_nopar:Npx #2 + { \um_delimiter:Nnn \mathopen {#1} {#4} } + } + } + \mathclose + { + \um_set_delcode:nnn {#1} {#4} {#4} + \um_set_mathcode:nnn {#4} \mathclose {#1} + \cs_gset_protected_nopar:Npx #2 + { \um_delimiter:Nnn \mathclose {#1} {#4} } + } + \mathaccent + { \cs_gset_protected_nopar:Npx #2 { \um_accent:Nnn #3 {#1} {#4} } } + \mathfence + { + \um_set_mathcode:nnn {#4} {#3} {#1} + \um_set_delcode:nnn {#1} {#4} {#4} + \cs_gset_protected_nopar:cpx {l \cs_to_str:N #2} + { \um_delimiter:Nnn \mathopen {#1} {#4} } + \cs_gset_protected_nopar:cpx {r \cs_to_str:N #2} + { \um_delimiter:Nnn \mathclose {#1} {#4} } + } + }{ + \um_set_mathcode:nnn {#4} {#3} {#1} + } +} +\edef\mathfence{\string\mathfence} +\edef\mathover{\string\mathover} +\edef\mathunder{\string\mathunder} +\cs_new:Nn \um_set_big_operator:nnn { + \group_begin: + \char_set_catcode_active:n {#3} + \char_gmake_mathactive:n {#3} + \um_active_char_set:wc #3 \q_nil { \cs_to_str:N #2 _sym } + \group_end: + \um_set_mathchar:cNnn {\cs_to_str:N #2 op} \mathop {#1} {#3} + \cs_gset:cpx { \cs_to_str:N #2 _sym } { + \exp_not:c { \cs_to_str:N #2 op } + \exp_not:n { \tl_if_in:NnT \l_um_nolimits_tl {#2} \nolimits } + } +} +\cs_set:Npn \um_set_mathcode:nnnn #1#2#3#4 { + \Umathcode \int_eval:n {#1} = + \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#4} \scan_stop: +} +\cs_set:Npn \um_set_mathcode:nnn #1#2#3 { + \Umathcode \int_eval:n {#1} = + \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#1} \scan_stop: +} +\cs_set:Npn \um_set_mathchar:NNnn #1#2#3#4 { + \Umathchardef #1 = + \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#4} \scan_stop: +} +\cs_new:Nn \um_set_delcode:nnn { + \Udelcode#2 = \csname sym#1\endcsname #3 +} +\cs_new:Nn \um_radical:nn { + \Uradical \csname sym#1\endcsname #2 \scan_stop: +} +\cs_new:Nn \um_delimiter:Nnn { + \Udelimiter \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop: +} +\cs_new:Nn \um_accent:Nnn + { + \Umathaccent \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop: + } +\cs_generate_variant:Nn \um_set_mathchar:NNnn {c} +\cs_set:Npn \um_overbrace:nnn #1#2#3 { + \luatexUdelimiterover \csname sym#1\endcsname #2 {#3} +} +\cs_set:Npn \um_underbrace:nnn #1#2#3 { + \luatexUdelimiterunder \csname sym#1\endcsname #2 {#3} +} +\cs_new:Nn \char_gmake_mathactive:N { + \global\mathcode `#1 = "8000 \scan_stop: +} +\cs_new:Nn \char_gmake_mathactive:n { + \global\mathcode #1 = "8000 \scan_stop: +} +\cs_new_eq:NN \um_saved_ltxe_glb_settings: \glb@settings +\CheckCommand * \glb@settings { + \expandafter\ifx\csname S@\f@size\endcsname\relax + \calculate@math@sizes + \fi + \csname S@\f@size\endcsname + \ifmath@fonts + \begingroup + \escapechar\m@ne + \csname mv@\math@version \endcsname + \globaldefs\@ne + \math@fonts + \let \glb@currsize \f@size + \endgroup + \the\every@math@size + \fi +} +\cs_set_protected_nopar:Npn \glb@settings { + \msg_error:nn { unicode-math } { no-font-selected } +} +\cs_new:Nn \um_init: { + \bool_set_true:N \l_um_ot_math_bool + \let\glb@currsize\relax + \cs_set_eq:NN \glb@settings \um_saved_ltxe_glb_settings: + \bool_set_true:N \l_um_init_bool + \seq_clear:N \l_um_char_range_seq + \clist_clear:N \l_um_char_num_range_clist + \seq_clear:N \l_um_mathalph_seq + \seq_clear:N \l_um_missing_alph_seq + \tl_set:Nn \l_um_mversion_tl {normal} + \tl_set:Nn \um_symfont_tl {operators} + \cs_set_eq:NN \_um_sym:nnn \um_process_symbol_noparse:nnn + \cs_set_eq:NN \um_set_mathalphabet_char:Nnn \um_mathmap_noparse:Nnn + \cs_set_eq:NN \um_remap_symbol:nnn \um_remap_symbol_noparse:nnn + \cs_set_eq:NN \um_maybe_init_alphabet:n \um_init_alphabet:n + \cs_set_eq:NN \um_map_char_single:nn \um_map_char_noparse:nn + \cs_set_eq:NN \um_assign_delcode:nn \um_assign_delcode_noparse:nn + \cs_set_eq:NN \um_make_mathactive:nNN \um_make_mathactive_noparse:nNN + \tl_set:Nn \l_um_script_features_tl {Style=MathScript} + \tl_set:Nn \l_um_sscript_features_tl {Style=MathScriptScript} + \tl_set_eq:NN \l_um_script_font_tl \l_um_fontname_tl + \tl_set_eq:NN \l_um_sscript_font_tl \l_um_fontname_tl +} +\DeclareDocumentCommand \setmathfont { O{} m } { + \tl_set:Nn \l_um_fontname_tl {#2} + \um_init: + \cs_if_exist:cF { S@ \f@size } { \calculate@math@sizes } + \csname S@\f@size\endcsname + \keys_set_known:nnN {unicode-math} {#1} \l_um_unknown_keys_clist + \bool_if:NT \l_um_init_bool { \um_log:n {default-math-font} } + \um_fontspec_select_font: + \cs_if_exist:cF { sym \um_symfont_tl } + { + \DeclareSymbolFont{\um_symfont_tl} + {\encodingdefault}{\l_um_family_tl}{\mddefault}{\updefault} + } + \SetSymbolFont{\um_symfont_tl}{\l_um_mversion_tl} + {\encodingdefault}{\l_um_family_tl}{\mddefault}{\updefault} + \bool_if:nT {\l_um_ot_math_bool && !\g_um_mainfont_already_set_bool} { + \bool_set_true:N \g_um_mainfont_already_set_bool + \um_declare_math_sizes: + \um_setup_legacy_fam_two: + \um_setup_legacy_fam_three: + } + \um_input_math_symbol_table: + \um_remap_symbols: + \um_setup_mathactives: + \um_setup_accents: + \um_setup_delcodes: + \um_setup_alphabets: + \ignorespaces +} +\cs_new:Nn \um_declare_math_sizes: + { + \dim_compare:nF { \fontdimen 10 \l_um_font == 0pt } + { + \DeclareMathSizes { \f@size } { \f@size } + { \um_fontdimen_to_scale:nn {10} {\l_um_font} } + { \um_fontdimen_to_scale:nn {11} {\l_um_font} } + } + } +\cs_new:Nn \um_setup_legacy_fam_two: + { + \fontspec_set_family:Nxn \l_um_family_tl + { + \l_um_font_keyval_tl, + Scale=1.00001, + FontAdjustment={ + \fontdimen8\font= \um_get_fontparam:nn {43} {FractionNumeratorDisplayStyleShiftUp}\relax + \fontdimen9\font= \um_get_fontparam:nn {42} {FractionNumeratorShiftUp}\relax + \fontdimen10\font=\um_get_fontparam:nn {32} {StackTopShiftUp}\relax + \fontdimen11\font=\um_get_fontparam:nn {45} {FractionDenominatorDisplayStyleShiftDown}\relax + \fontdimen12\font=\um_get_fontparam:nn {44} {FractionDenominatorShiftDown}\relax + \fontdimen13\font=\um_get_fontparam:nn {21} {SuperscriptShiftUp}\relax + \fontdimen14\font=\um_get_fontparam:nn {21} {SuperscriptShiftUp}\relax + \fontdimen15\font=\um_get_fontparam:nn {22} {SuperscriptShiftUpCramped}\relax + \fontdimen16\font=\um_get_fontparam:nn {18} {SubscriptShiftDown}\relax + \fontdimen17\font=\um_get_fontparam:nn {18} {SubscriptShiftDownWithSuperscript}\relax + \fontdimen18\font=\um_get_fontparam:nn {24} {SuperscriptBaselineDropMax}\relax + \fontdimen19\font=\um_get_fontparam:nn {20} {SubscriptBaselineDropMin}\relax + \fontdimen20\font=0pt\relax % delim1 = FractionDelimiterDisplaySize + \fontdimen21\font=0pt\relax % delim2 = FractionDelimiterSize + \fontdimen22\font=\um_get_fontparam:nn {15} {AxisHeight}\relax + } + } {\l_um_fontname_tl} + \SetSymbolFont{symbols}{\l_um_mversion_tl} + {\encodingdefault}{\l_um_family_tl}{\mddefault}{\updefault} + } +\cs_new:Nn \um_setup_legacy_fam_three: + { + \fontspec_set_family:Nxn \l_um_family_tl + { + \l_um_font_keyval_tl, + Scale=0.99999, + FontAdjustment={ + \fontdimen8\font= \um_get_fontparam:nn {48} {FractionRuleThickness}\relax + \fontdimen9\font= \um_get_fontparam:nn {28} {UpperLimitGapMin}\relax + \fontdimen10\font=\um_get_fontparam:nn {30} {LowerLimitGapMin}\relax + \fontdimen11\font=\um_get_fontparam:nn {29} {UpperLimitBaselineRiseMin}\relax + \fontdimen12\font=\um_get_fontparam:nn {31} {LowerLimitBaselineDropMin}\relax + \fontdimen13\font=0pt\relax + } + } {\l_um_fontname_tl} + \SetSymbolFont{largesymbols}{\l_um_mversion_tl} + {\encodingdefault}{\l_um_family_tl}{\mddefault}{\updefault} + } +\cs_new:Nn \um_get_fontparam:nn + { \the\fontdimen#1\l_um_font\relax } +\DeclareDocumentCommand \resetmathfont { O{} m } { + \bool_set_false:N \g_um_mainfont_already_set_bool + \setmathfont[#1]{#2} +} +\cs_new:Nn \um_fontspec_select_font: { + \tl_set:Nx \l_um_font_keyval_tl { + BoldFont = {}, ItalicFont = {}, + Script = Math, + SizeFeatures = { + {Size = \tf@size-} , + {Size = \sf@size-\tf@size , + Font = \l_um_script_font_tl , + \l_um_script_features_tl + } , + {Size = -\sf@size , + Font = \l_um_sscript_font_tl , + \l_um_sscript_features_tl + } + }, + \l_um_unknown_keys_clist + } + \fontspec_set_fontface:NNxn \l_um_font \l_um_family_tl + {\l_um_font_keyval_tl} {\l_um_fontname_tl} + \group_begin: + \fontfamily{\l_um_family_tl}\selectfont + \fontspec_if_script:nF {math} {\bool_gset_false:N \l_um_ot_math_bool} + \group_end: +} +\cs_set:Npn \um_process_symbol_noparse:nnn #1#2#3 { + \um_set_mathsymbol:nNNn {\um_symfont_tl} #2#3{#1} +} +\cs_set:Npn \um_process_symbol_parse:nnn #1#2#3 { + \um_if_char_spec:nNNT{#1}{#2}{#3}{ + \um_process_symbol_noparse:nnn {#1}{#2}{#3} + } +} +\cs_new:Npn \um_remap_symbols: { + \um_remap_symbol:nnn{`\-}{\mathbin}{"02212}% hyphen to minus + \um_remap_symbol:nnn{`\*}{\mathbin}{"02217}% text asterisk to "centred asterisk" + \bool_if:NF \g_um_literal_colon_bool { + \um_remap_symbol:nnn{`\:}{\mathrel}{"02236}% colon to ratio (i.e., punct to rel) + } +} +\cs_new:Nn \um_remap_symbol_parse:nnn { + \um_if_char_spec:nNNT {#3} {\@nil} {#2} { + \um_remap_symbol_noparse:nnn {#1} {#2} {#3} + } +} +\cs_new:Nn \um_remap_symbol_noparse:nnn { + \clist_map_inline:nn {#1} { + \um_set_mathcode:nnnn {##1} {#2} {\um_symfont_tl} {#3} + } +} +\cs_new:Npn \um_setup_mathactives: { + \um_make_mathactive:nNN {"2032} \um_prime_single_mchar \mathord + \um_make_mathactive:nNN {"2033} \um_prime_double_mchar \mathord + \um_make_mathactive:nNN {"2034} \um_prime_triple_mchar \mathord + \um_make_mathactive:nNN {"2057} \um_prime_quad_mchar \mathord + \um_make_mathactive:nNN {"2035} \um_backprime_single_mchar \mathord + \um_make_mathactive:nNN {"2036} \um_backprime_double_mchar \mathord + \um_make_mathactive:nNN {"2037} \um_backprime_triple_mchar \mathord + \um_make_mathactive:nNN {`\'} \mathstraightquote \mathord + \um_make_mathactive:nNN {`\`} \mathbacktick \mathord +} +\cs_new:Nn \um_make_mathactive_parse:nNN + { + \um_if_char_spec:nNNT {#1} #2 #3 + { \um_make_mathactive_noparse:nNN {#1} #2 #3 } + } +\cs_new:Nn \um_make_mathactive_noparse:nNN + { + \um_set_mathchar:NNnn #2 #3 {\um_symfont_tl} {#1} + \char_gmake_mathactive:n {#1} + } +\cs_new:Nn \um_assign_delcode_noparse:nn { + \um_set_delcode:nnn \um_symfont_tl {#1} {#2} +} +\cs_new:Nn \um_assign_delcode_parse:nn { + \um_if_char_spec:nNNT {#2}{\@nil}{\@nil} { + \um_assign_delcode_noparse:nn {#1} {#2} + } +} +\cs_new:Nn \um_assign_delcode:n { \um_assign_delcode:nn {#1} {#1} } +\cs_new:Npn \um_setup_delcodes: { + \um_assign_delcode:nn {`\/} {\g_um_slash_delimiter_usv} + \um_assign_delcode:nn {"2044} {\g_um_slash_delimiter_usv} % fracslash + \um_assign_delcode:nn {"2215} {\g_um_slash_delimiter_usv} % divslash + \um_assign_delcode:n {"005C} % backslash + \um_assign_delcode:nn {`\<} {"27E8} % angle brackets with ascii notation + \um_assign_delcode:nn {`\>} {"27E9} % angle brackets with ascii notation + \um_assign_delcode:n {"2191} % up arrow + \um_assign_delcode:n {"2193} % down arrow + \um_assign_delcode:n {"2195} % updown arrow + \um_assign_delcode:n {"219F} % up arrow twohead + \um_assign_delcode:n {"21A1} % down arrow twohead + \um_assign_delcode:n {"21A5} % up arrow from bar + \um_assign_delcode:n {"21A7} % down arrow from bar + \um_assign_delcode:n {"21A8} % updown arrow from bar + \um_assign_delcode:n {"21BE} % up harpoon right + \um_assign_delcode:n {"21BF} % up harpoon left + \um_assign_delcode:n {"21C2} % down harpoon right + \um_assign_delcode:n {"21C3} % down harpoon left + \um_assign_delcode:n {"21C5} % arrows up down + \um_assign_delcode:n {"21F5} % arrows down up + \um_assign_delcode:n {"21C8} % arrows up up + \um_assign_delcode:n {"21CA} % arrows down down + \um_assign_delcode:n {"21D1} % double up arrow + \um_assign_delcode:n {"21D3} % double down arrow + \um_assign_delcode:n {"21D5} % double updown arrow + \um_assign_delcode:n {"21DE} % up arrow double stroke + \um_assign_delcode:n {"21DF} % down arrow double stroke + \um_assign_delcode:n {"21E1} % up arrow dashed + \um_assign_delcode:n {"21E3} % down arrow dashed + \um_assign_delcode:n {"21E7} % up white arrow + \um_assign_delcode:n {"21E9} % down white arrow + \um_assign_delcode:n {"21EA} % up white arrow from bar + \um_assign_delcode:n {"21F3} % updown white arrow +} +\tl_new:N \l_um_nolimits_tl +\tl_set:Nn \l_um_nolimits_tl { + \int\iint\iiint\iiiint\oint\oiint\oiiint + \intclockwise\varointclockwise\ointctrclockwise\sumint + \intbar\intBar\fint\cirfnint\awint\rppolint + \scpolint\npolint\pointint\sqint\intlarhk\intx + \intcap\intcup\upint\lowint +} +\DeclareDocumentCommand \addnolimits {m} { + \tl_put_right:Nn \l_um_nolimits_tl {#1} +} +\DeclareDocumentCommand \removenolimits {m} { + \tl_remove_all:Nn \l_um_nolimits_tl {#1} +} +\tl_new:N \l_um_radicals_tl +\tl_set:Nn \l_um_radicals_tl {\sqrt} +\cs_new_protected_nopar:Nn \um_new_cramped_style:N + { \quark_new:N #1 } +\um_new_cramped_style:N \crampeddisplaystyle +\um_new_cramped_style:N \crampedtextstyle +\um_new_cramped_style:N \crampedscriptstyle +\um_new_cramped_style:N \crampedscriptscriptstyle + \cs_new_nopar:Npn \um_font_dimen:Nnnnn #1 #2 #3 #4 #5 { + \fontdimen + \cs_if_eq:NNTF #1 \displaystyle { + #2 \textfont + } { + \cs_if_eq:NNTF #1 \crampeddisplaystyle { + #3 \textfont + } { + \cs_if_eq:NNTF #1 \textstyle { + #4 \textfont + } { + \cs_if_eq:NNTF #1 \crampedtextstyle { + #5 \textfont + } { + \cs_if_eq:NNTF #1 \scriptstyle { + #4 \scriptfont + } { + \cs_if_eq:NNTF #1 \crampedscriptstyle { + #5 \scriptfont + } { + \cs_if_eq:NNTF #1 \scriptscriptstyle { + #4 \scriptscriptfont + } { + #5 \scriptscriptfont + } + } + } + } + } + } + } + \c_two + } +\cs_new_protected_nopar:Nn \um_font_param:nnnnn +{ + \um_font_param_aux:ccnnnn { um_ #1 :N } { um_set_ #1 :N } + { #2 } { #3 } { #4 } { #5 } +} +\cs_new_protected_nopar:Npn \um_font_param:nnn #1 #2 #3 { + \um_font_param:nnnnn { #1 } { #2 } { #2 } { #3 } { #3 } +} +\cs_new_protected_nopar:Npn \um_font_param:nn #1 #2 { + \um_font_param:nnnnn { #1 } { #2 } { #2 } { #2 } { #2 } +} +\cs_new_protected_nopar:Nn \um_font_param:n + { } +\cs_new_protected_nopar:Nn \um_font_param_aux:NNnnnn + { + \cs_new_nopar:Npn #1 ##1 { + \um_font_dimen:Nnnnn ##1 { #3 } { #4 } { #5 } { #6 } + } + \cs_new_protected_nopar:Npn #2 ##1 ##2 { + #1 ##1 \dim_eval:n { ##2 } + } + } +\cs_generate_variant:Nn \um_font_param_aux:NNnnnn { cc } +\um_font_param:nn { axis } { 15 } +\um_font_param:nn { operator_size } { 13 } +\um_font_param:n { fraction_del_size } +\um_font_param:nnn { fraction_denom_down } { 45 } { 44 } +\um_font_param:nnn { fraction_denom_vgap } { 50 } { 49 } +\um_font_param:nnn { fraction_num_up } { 43 } { 42 } +\um_font_param:nnn { fraction_num_vgap } { 47 } { 46 } +\um_font_param:nn { fraction_rule } { 48 } +\um_font_param:nn { limit_above_bgap } { 29 } +\um_font_param:n { limit_above_kern } +\um_font_param:nn { limit_above_vgap } { 28 } +\um_font_param:nn { limit_below_bgap } { 31 } +\um_font_param:n { limit_below_kern } +\um_font_param:nn { limit_below_vgap } { 30 } +\um_font_param:nn { over_delimiter_vgap } { 41 } +\um_font_param:nn { over_delimiter_bgap } { 38 } +\um_font_param:nn { under_delimiter_vgap } { 40 } +\um_font_param:nn { under_delimiter_bgap } { 39 } +\um_font_param:nn { overbar_kern } { 55 } +\um_font_param:nn { overbar_rule } { 54 } +\um_font_param:nn { overbar_vgap } { 53 } +\um_font_param:n { quad } +\um_font_param:nn { radical_kern } { 62 } +\um_font_param:nn { radical_rule } { 61 } +\um_font_param:nnn { radical_vgap } { 60 } { 59 } +\um_font_param:nn { radical_degree_before } { 63 } +\um_font_param:nn { radical_degree_after } { 64 } +\um_font_param:nn { radical_degree_raise } { 65 } +\um_font_param:nn { space_after_script } { 27 } +\um_font_param:nnn { stack_denom_down } { 35 } { 34 } +\um_font_param:nnn { stack_num_up } { 33 } { 32 } +\um_font_param:nnn { stack_vgap } { 37 } { 36 } +\um_font_param:nn { sub_shift_down } { 18 } +\um_font_param:nn { sub_shift_drop } { 20 } +\um_font_param:n { subsup_shift_down } +\um_font_param:nn { sub_top_max } { 19 } +\um_font_param:nn { subsup_vgap } { 25 } +\um_font_param:nn { sup_bottom_min } { 23 } +\um_font_param:nn { sup_shift_drop } { 24 } +\um_font_param:nnnnn { sup_shift_up } { 21 } { 22 } { 21 } { 22 } +\um_font_param:nn { supsub_bottom_max } { 26 } +\um_font_param:nn { underbar_kern } { 58 } +\um_font_param:nn { underbar_rule } { 57 } +\um_font_param:nn { underbar_vgap } { 56 } +\um_font_param:n { connector_overlap_min } +\def\new@mathversion#1{% + \expandafter\in@\expandafter#1\expandafter{\version@list}% + \ifin@ + \@font@info{Redeclaring math version + `\expandafter\@gobblefour\string#1'}% + \else + \expandafter\newcount\csname c@\expandafter + \@gobble\string#1\endcsname + \def\version@elt{\noexpand\version@elt\noexpand}% + \edef\version@list{\version@list\version@elt#1}% + \fi + \toks@{}% + \count@\z@ + \def\group@elt##1##2{% + \advance\count@\@ne + \addto@hook\toks@{\getanddefine@fonts##1##2}% + }% + \group@list + \global\csname c@\expandafter\@gobble\string#1\endcsname\count@ + \def\alpha@elt##1##2##3{% + \ifx##2\no@alphabet@error + \toks@\expandafter{\the\toks@\install@mathalphabet##1% + {\no@alphabet@error##1}}% + \else + \toks@\expandafter{\the\toks@\install@mathalphabet##1% + {\select@group##1##2##3}}% + \fi + }% + \alpha@list + \xdef#1{\the\toks@}% +} +\keys_define:nn {unicode-math} + { + version .code:n = + { + \tl_set:Nn \l_um_mversion_tl {#1} + \DeclareMathVersion{\l_um_mversion_tl} + } + } +\keys_define:nn {unicode-math} +{ + script-features .tl_set:N = \l_um_script_features_tl , + sscript-features .tl_set:N = \l_um_sscript_features_tl , + script-font .tl_set:N = \l_um_script_font_tl , + sscript-font .tl_set:N = \l_um_sscript_font_tl , +} +\seq_new:N \l_um_mathalph_seq +\seq_new:N \l_um_char_range_seq +\seq_new:N \l_um_mclass_range_seq +\seq_new:N \l_um_cmd_range_seq +\keys_define:nn {unicode-math} { + range .code:n = { + \bool_set_false:N \l_um_init_bool + \int_incr:N \g_um_fam_int + \tl_set:Nx \um_symfont_tl {um_fam\int_use:N\g_um_fam_int} + \cs_set_eq:NN \_um_sym:nnn \um_process_symbol_parse:nnn + \cs_set_eq:NN \um_set_mathalphabet_char:Nnn \um_mathmap_parse:Nnn + \cs_set_eq:NN \um_remap_symbol:nnn \um_remap_symbol_parse:nnn + \cs_set_eq:NN \um_maybe_init_alphabet:n \use_none:n + \cs_set_eq:NN \um_map_char_single:nn \um_map_char_parse:nn + \cs_set_eq:NN \um_assign_delcode:nn \um_assign_delcode_parse:nn + \cs_set_eq:NN \um_make_mathactive:nNN \um_make_mathactive_parse:nNN + \seq_clear:N \l_um_char_range_seq + \seq_clear:N \l_um_mclass_range_seq + \seq_clear:N \l_um_cmd_range_seq + \seq_clear:N \l_um_mathalph_seq + \clist_map_inline:nn {#1} { + \um_if_mathalph_decl:nTF {##1} { + \seq_put_right:Nx \l_um_mathalph_seq { + { \exp_not:V \l_um_tmpa_tl } + { \exp_not:V \l_um_tmpb_tl } + { \exp_not:V \l_um_tmpc_tl } + } + }{ + \seq_if_in:NnTF \g_um_mathclasses_seq {##1} + { \seq_put_right:Nn \l_um_mclass_range_seq {##1} } + { + \bool_if:nTF { \tl_if_single_p:n {##1} && \token_if_cs_p:N ##1 } + { \seq_put_right:Nn \l_um_cmd_range_seq {##1} } + { \seq_put_right:Nn \l_um_char_range_seq {##1} } + } + } + } + } +} +\seq_new:N \g_um_mathclasses_seq +\seq_set_from_clist:Nn \g_um_mathclasses_seq + { + \mathord,\mathalpha,\mathop,\mathbin,\mathrel, + \mathopen,\mathclose,\mathpunct,\mathaccent, + \mathfence,\mathover,\mathunder + } +\prg_new_conditional:Nnn \um_if_mathalph_decl:n {TF} { + \tl_set:Nx \l_um_tmpa_tl { \tl_trim_spaces:n {#1} } + \tl_clear:N \l_um_tmpb_tl + \tl_clear:N \l_um_tmpc_tl + \tl_if_in:NnT \l_um_tmpa_tl {->} { + \exp_after:wN \um_split_arrow:w \l_um_tmpa_tl \q_nil + } + \tl_if_in:NnT \l_um_tmpa_tl {/} { + \exp_after:wN \um_split_slash:w \l_um_tmpa_tl \q_nil + } + \tl_if_empty:NT \l_um_tmpc_tl { \tl_set_eq:NN \l_um_tmpc_tl \l_um_tmpa_tl } + \seq_if_in:NVTF \g_um_mathstyles_seq \l_um_tmpa_tl { + \prg_return_true: + }{ + \prg_return_false: + } +} +\cs_set:Npn \um_split_arrow:w #1->#2 \q_nil { + \tl_set:Nn \l_um_tmpa_tl {#1} + \tl_if_single:nTF {#2} + { \tl_set:Nn \l_um_tmpc_tl {#2} } + { \exp_args:NNc \tl_set:Nn \l_um_tmpc_tl {math#2} } +} +\cs_set:Npn \um_split_slash:w #1/#2 \q_nil { + \tl_set:Nn \l_um_tmpa_tl {#1} + \tl_set:Nn \l_um_tmpb_tl {#2} +} +\cs_new:Nn \um_if_char_spec:nNNT + { + + % math class: + \seq_if_in:NnT \l_um_mclass_range_seq {#3} + { \use_none_delimit_by_q_nil:w } + + % command name: + \seq_if_in:NnT \l_um_cmd_range_seq {#2} + { \use_none_delimit_by_q_nil:w } + + % character slot: + \seq_map_inline:Nn \l_um_char_range_seq + { + \um_int_if_range_matches_slot:nnT {##1} {#1} + { \seq_map_break:n { \use_none_delimit_by_q_nil:w } } + } + + % this executes if no match was found: + \use_none:nnn + \q_nil + \use:n + { + \clist_put_right:Nx \l_um_char_num_range_clist { \int_eval:n {#1} } + #4 + } + } +\cs_new:Nn \um_int_if_range_matches_slot:nnT + { \um_numrange_parse:nwT {#1} #2 - \q_nil - \q_stop {#3} } +\cs_set:Npn \um_numrange_parse:nwT #1 #2 - #3 - #4 \q_stop #5 + { + \tl_if_empty:nTF {#4} { \int_compare:nT {#1=#2} {#5} } + { + \tl_if_empty:nTF {#3} { \int_compare:nT {#1>=#2} {#5} } + { + \tl_if_empty:nTF {#2} { \int_compare:nT {#1<=#3} {#5} } + { + \int_compare:nT {#1>=#2} { \int_compare:nT {#1<=#3} {#5} } + } } } + } +\AtBeginDocument{\um_resolve_greek:} +\cs_new:Npn \um_resolve_greek: { + \clist_map_inline:nn { + Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda, + alpha,beta,gamma,delta, zeta,eta,theta,iota,kappa,lambda, + Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega, + mu,nu,xi,omicron,pi,rho,sigma,tau,upsilon, chi,psi,omega, + varTheta, + varsigma,vartheta,varkappa,varrho,varpi + }{ + \tl_set:cx {##1} { \exp_not:c { mit ##1 } } + } + \tl_set:Nn \epsilon { + \bool_if:NTF \g_um_texgreek_bool \mitvarepsilon \mitepsilon + } + \tl_set:Nn \phi { + \bool_if:NTF \g_um_texgreek_bool \mitvarphi \mitphi + } + \tl_set:Nn \varepsilon { + \bool_if:NTF \g_um_texgreek_bool \mitepsilon \mitvarepsilon + } + \tl_set:Nn \varphi { + \bool_if:NTF \g_um_texgreek_bool \mitphi \mitvarphi + } +} +\cs_new:Nn \um_new_mathstyle:N { + \um_prepare_mathstyle:f {\exp_after:wN \use_none:nnnnn \token_to_str:N #1} + \seq_put_right:Nn \g_um_mathstyles_seq {#1} +} +\seq_new:N \g_um_default_mathalph_seq +\seq_new:N \g_um_mathstyles_seq +\AtEndOfPackage{ +\clist_map_inline:nn { + {\mathup } {latin,Latin,greek,Greek,num,misc} {\mathup } , + {\mathit } {latin,Latin,greek,Greek,misc} {\mathit } , + {\mathbb } {latin,Latin,num,misc} {\mathbb } , + {\mathbbit } {misc} {\mathbbit } , + {\mathscr } {latin,Latin} {\mathscr } , + {\mathcal } {Latin} {\mathscr } , + {\mathbfcal } {Latin} {\mathbfscr } , + {\mathfrak } {latin,Latin} {\mathfrak } , + {\mathtt } {latin,Latin,num} {\mathtt } , + {\mathsfup } {latin,Latin,num} {\mathsfup } , + {\mathsfit } {latin,Latin} {\mathsfit } , + {\mathbfup } {latin,Latin,greek,Greek,num,misc} {\mathbfup } , + {\mathbfit } {latin,Latin,greek,Greek,misc} {\mathbfit } , + {\mathbfscr } {latin,Latin} {\mathbfscr } , + {\mathbffrak} {latin,Latin} {\mathbffrak} , + {\mathbfsfup} {latin,Latin,greek,Greek,num,misc} {\mathbfsfup} , + {\mathbfsfit} {latin,Latin,greek,Greek,misc} {\mathbfsfit} +}{ + \seq_put_right:Nn \g_um_default_mathalph_seq {#1} + \exp_after:wN \um_new_mathstyle:N \use_i:nnn #1 +} +\um_new_mathstyle:N \mathsf +\um_new_mathstyle:N \mathbf +\um_new_mathstyle:N \mathbfsf +} +\cs_new:Nn \um_prepare_mathstyle:n { + \um_init_alphabet:x {#1} + \cs_set:cpn {_um_math#1_aux:n} ##1 { + \use:c {um_switchto_math#1:} ##1 \egroup + } + \cs_set_protected:cpx {math#1} { + \exp_not:n{ + \bgroup + \mode_if_math:F + { + \egroup\expandafter + \non@alpherr\expandafter{\csname math#1\endcsname\space} + } + \tl_set:Nn \l_um_mathstyle_tl {#1} + } + \exp_not:c {_um_math#1_aux:n} + } +} +\tl_new:N \l_um_mathstyle_tl +\cs_generate_variant:Nn \um_prepare_mathstyle:n {f} +\cs_set:Npn \um_init_alphabet:n #1 { + \um_log:nx {alph-initialise} {#1} + \cs_set_eq:cN {um_switchto_math#1:} \prg_do_nothing: +} +\cs_generate_variant:Nn \um_init_alphabet:n {x} +\cs_new:Npn \um_maybe_init_alphabet:V { + \exp_args:NV \um_maybe_init_alphabet:n +} +\seq_new:N \l_um_missing_alph_seq +\cs_new:Npn \um_setup_alphabets: { + \seq_if_empty:NTF \l_um_mathalph_seq { + \um_log:n {setup-implicit} + \seq_set_eq:NN \l_um_mathalph_seq \g_um_default_mathalph_seq + \bool_set_true:N \l_um_implicit_alph_bool + \um_maybe_init_alphabet:n {sf} + \um_maybe_init_alphabet:n {bf} + \um_maybe_init_alphabet:n {bfsf} + } + { + \um_log:n {setup-explicit} + \bool_set_false:N \l_um_implicit_alph_bool + \cs_set_eq:NN \um_set_mathalphabet_char:Nnn \um_mathmap_noparse:Nnn + \cs_set_eq:NN \um_map_char_single:nn \um_map_char_noparse:nn + } + \seq_map_inline:Nn \l_um_mathalph_seq { + \tl_set:No \l_um_tmpa_tl { \use_i:nnn ##1 } + \tl_set:No \l_um_tmpb_tl { \use_ii:nnn ##1 } + \tl_set:No \l_um_remap_style_tl { \use_iii:nnn ##1 } + \tl_set:Nx \l_um_remap_style_tl { + \exp_after:wN \exp_after:wN \exp_after:wN \use_none:nnnnn + \exp_after:wN \token_to_str:N \l_um_remap_style_tl + } + \tl_if_empty:NT \l_um_tmpb_tl { + \cs_set_eq:NN \um_maybe_init_alphabet:n \um_init_alphabet:n + \tl_set:Nn \l_um_tmpb_tl { latin,Latin,greek,Greek,num,misc } + } + \um_setup_math_alphabet:VVV + \l_um_tmpa_tl \l_um_tmpb_tl \l_um_remap_style_tl + } + \seq_if_empty:NF \l_um_missing_alph_seq { \um_log:n { missing-alphabets } } +} +\cs_new:Nn \um_setup_math_alphabet:Nnn { + \tl_set:Nx \l_um_style_tl { + \exp_after:wN \use_none:nnnnn \token_to_str:N #1 + } + \clist_map_inline:nn {#2} { + \tl_set:Nx \l_um_tmpa_tl { \tl_trim_spaces:n {##1} } + \cs_if_exist:cT {um_config_ \l_um_style_tl _\l_um_tmpa_tl :n} { + \str_if_eq:xxTF {\l_um_tmpa_tl}{misc} { + \um_maybe_init_alphabet:V \l_um_style_tl + \clist_map_break: + }{ + \um_glyph_if_exist:cT { \um_to_usv:nn {#3}{\l_um_tmpa_tl} }{ + \um_maybe_init_alphabet:V \l_um_style_tl + \clist_map_break: + } + } + } + } + \clist_map_inline:nn {#2} { + \tl_set:Nx \l_um_tmpa_tl { \tl_trim_spaces:n {##1} } + \cs_if_exist:cT {um_config_ \l_um_style_tl _ \l_um_tmpa_tl :n} { + \str_if_eq:xxTF {\l_um_tmpa_tl}{misc} { + \um_log:nx {setup-alph} {math \l_um_style_tl~(\l_um_tmpa_tl)} + \use:c {um_config_ \l_um_style_tl _ \l_um_tmpa_tl :n} {#3} + }{ + \um_glyph_if_exist:cTF { \um_to_usv:nn {#3}{\l_um_tmpa_tl} } { + \um_log:nx {setup-alph} {math \l_um_style_tl~(\l_um_tmpa_tl)} + \use:c {um_config_ \l_um_style_tl _ \l_um_tmpa_tl :n} {#3} + }{ + \bool_if:NTF \l_um_implicit_alph_bool { + \seq_put_right:Nx \l_um_missing_alph_seq { + \@backslashchar math \l_um_style_tl \space + (\tl_use:c{c_um_math_alphabet_name_ \l_um_tmpa_tl _tl}) + } + }{ + \use:c {um_config_ \l_um_style_tl _ \l_um_tmpa_tl :n} {up} + } + } + } + } + } +} +\cs_generate_variant:Nn \um_setup_math_alphabet:Nnn {VVV} +\cs_new:Npn \um_map_char_single:cc { \exp_args:Ncc \um_map_char_single:nn } +\cs_new:Nn \um_map_char_noparse:nn { + \um_set_mathcode:nnnn {#1}{\mathalpha}{\um_symfont_tl}{#2} +} +\cs_new:Nn \um_map_char_parse:nn { + \um_if_char_spec:nNNT {#1} {\@nil} {\mathalpha} { + \um_map_char_noparse:nn {#1}{#2} + } +} +\cs_new:Nn \um_map_char_single:nnn { + \um_map_char_single:cc { \um_to_usv:nn {#1}{#3} } + { \um_to_usv:nn {#2}{#3} } +} +\cs_set:Npn \um_map_single:nnn #1#2#3 { + \cs_if_exist:cT { \um_to_usv:nn {#3} {#1} } + { + \clist_map_inline:nn {#2} { + \um_map_char_single:nnn {##1} {#3} {#1} + } + } +} +\cs_set:Npn \um_map_chars_range:nnn #1#2#3 { + \prg_stepwise_inline:nnnn {0}{1}{#1-1} { + \um_map_char_single:nn {#2+##1}{#3+##1} + } +} +\cs_generate_variant:Nn \um_map_chars_range:nnn {ncc} +\cs_new:Nn \um_map_chars_range:nnnn { + \um_map_chars_range:ncc {#1} { \um_to_usv:nn {#2}{#4} } + { \um_to_usv:nn {#3}{#4} } +} +\cs_new:Nn \um_map_chars_Latin:nn { + \clist_map_inline:nn {#1} { + \um_map_chars_range:nnnn {26} {##1} {#2} {Latin} + } +} +\cs_new:Nn \um_map_chars_latin:nn { + \clist_map_inline:nn {#1} { + \um_map_chars_range:nnnn {26} {##1} {#2} {latin} + } +} +\cs_new:Nn \um_map_chars_greek:nn { + \clist_map_inline:nn {#1} { + \um_map_chars_range:nnnn {25} {##1} {#2} {greek} + \um_map_char_single:nnn {##1} {#2} {varepsilon} + \um_map_char_single:nnn {##1} {#2} {vartheta} + \um_map_char_single:nnn {##1} {#2} {varkappa} + \um_map_char_single:nnn {##1} {#2} {varphi} + \um_map_char_single:nnn {##1} {#2} {varrho} + \um_map_char_single:nnn {##1} {#2} {varpi} + } +} +\cs_new:Nn \um_map_chars_Greek:nn { + \clist_map_inline:nn {#1} { + \um_map_chars_range:nnnn {25} {##1} {#2} {Greek} + \um_map_char_single:nnn {##1} {#2} {varTheta} + } +} +\cs_new:Nn \um_map_chars_numbers:nn { + \um_map_chars_range:nnnn {10} {#1} {#2} {num} +} +\cs_new:Npn \um_set_mathalphabet_char:Ncc { + \exp_args:NNcc \um_set_mathalphabet_char:Nnn +} +\cs_new:Nn \um_mathmap_noparse:Nnn { + \clist_map_inline:nn {#2} { + \tl_put_right:cx {um_switchto_\cs_to_str:N #1:} { + \um_set_mathcode:nnnn{##1}{\mathalpha}{\um_symfont_tl}{#3} + } + } +} +\cs_new:Nn \um_mathmap_parse:Nnn { + \clist_if_in:NnT \l_um_char_num_range_clist {#3} { + \um_mathmap_noparse:Nnn {#1}{#2}{#3} + } +} +\cs_new:Npn \um_set_mathalphabet_char:Nnnn #1#2#3#4 { + \um_set_mathalphabet_char:Ncc #1 { \um_to_usv:nn {#2} {#4} } + { \um_to_usv:nn {#3} {#4} } +} +\cs_new:Npn \um_set_mathalph_range:nNnn #1#2#3#4 { + \prg_stepwise_inline:nnnn {0}{1}{#1-1} + { \um_set_mathalphabet_char:Nnn {#2} { ##1 + #3 } { ##1 + #4 } } +} +\cs_generate_variant:Nn \um_set_mathalph_range:nNnn {nNcc} +\cs_new:Npn \um_set_mathalph_range:nNnnn #1#2#3#4#5 { + \um_set_mathalph_range:nNcc {#1} #2 { \um_to_usv:nn {#3} {#5} } + { \um_to_usv:nn {#4} {#5} } +} +\cs_new:Npn \um_set_mathalphabet_pos:Nnnn #1#2#3#4 { + \cs_if_exist:cT { \um_to_usv:nn {#4}{#2} } { + \clist_map_inline:nn {#3} + { \um_set_mathalphabet_char:Nnnn #1 {##1} {#4} {#2} } + } +} +\cs_new:Nn \um_set_mathalphabet_numbers:Nnn { + \clist_map_inline:nn {#2} + { \um_set_mathalph_range:nNnnn {10} #1 {##1} {#3} {num} } +} +\cs_new:Nn \um_set_mathalphabet_Latin:Nnn { + \clist_map_inline:nn {#2} + { \um_set_mathalph_range:nNnnn {26} #1 {##1} {#3} {Latin} } +} +\cs_new:Nn \um_set_mathalphabet_latin:Nnn { + \clist_map_inline:nn {#2} { + \um_set_mathalph_range:nNnnn {26} #1 {##1} {#3} {latin} + \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {h} + } +} +\cs_new:Nn \um_set_mathalphabet_Greek:Nnn { + \clist_map_inline:nn {#2} { + \um_set_mathalph_range:nNnnn {25} #1 {##1} {#3} {Greek} + \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varTheta} + } +} +\cs_new:Nn \um_set_mathalphabet_greek:Nnn { + \clist_map_inline:nn {#2} { + \um_set_mathalph_range:nNnnn {25} #1 {##1} {#3} {greek} + \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varepsilon} + \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {vartheta} + \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varkappa} + \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varphi} + \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varrho} + \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varpi} + } +} +\cs_new:Nn \um_config_up_num:n { + \um_map_chars_numbers:nn {up}{#1} + \um_set_mathalphabet_numbers:Nnn \mathup {up}{#1} +} +\cs_new:Nn \um_config_up_Latin:n + { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_Latin:nn {up} {#1} } + { + \bool_if:NT \g_um_upLatin_bool { \um_map_chars_Latin:nn {up,it} {#1} } + } + \um_set_mathalphabet_Latin:Nnn \mathup {up,it}{#1} +} +\cs_new:Nn \um_config_up_latin:n { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_latin:nn {up} {#1} } + { + \bool_if:NT \g_um_uplatin_bool { + \um_map_chars_latin:nn {up,it} {#1} + \um_map_single:nnn {h} {up,it} {#1} + \um_map_single:nnn {dotlessi} {up,it} {#1} + \um_map_single:nnn {dotlessj} {up,it} {#1} + } + } + \um_set_mathalphabet_latin:Nnn \mathup {up,it}{#1} +} +\cs_new:Nn \um_config_up_Greek:n { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_Greek:nn {up}{#1} } + { + \bool_if:NT \g_um_upGreek_bool { \um_map_chars_Greek:nn {up,it}{#1} } + } + \um_set_mathalphabet_Greek:Nnn \mathup {up,it}{#1} +} +\cs_new:Nn \um_config_up_greek:n { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_greek:nn {up} {#1} } + { + \bool_if:NT \g_um_upgreek_bool { + \um_map_chars_greek:nn {up,it} {#1} + } + } + \um_set_mathalphabet_greek:Nnn \mathup {up,it} {#1} +} +\cs_new:Nn \um_config_up_misc:n { + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_map_single:nnn {Nabla}{up}{up} + }{ + \bool_if:NT \g_um_upNabla_bool { + \um_map_single:nnn {Nabla}{up,it}{up} + } + } + \bool_if:NTF \g_um_literal_partial_bool { + \um_map_single:nnn {partial}{up}{up} + }{ + \bool_if:NT \g_um_uppartial_bool { + \um_map_single:nnn {partial}{up,it}{up} + } + } + \um_set_mathalphabet_pos:Nnnn \mathup {partial} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathup {Nabla} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathup {dotlessi} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathup {dotlessj} {up,it} {#1} +} +\cs_new:Nn \um_config_it_Latin:n { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_Latin:nn {it} {#1} } + { + \bool_if:NF \g_um_upLatin_bool { \um_map_chars_Latin:nn {up,it} {#1} } + } + \um_set_mathalphabet_Latin:Nnn \mathit {up,it}{#1} +} +\cs_new:Nn \um_config_it_latin:n { + \bool_if:NTF \g_um_literal_bool { + \um_map_chars_latin:nn {it} {#1} + \um_map_single:nnn {h}{it}{#1} + }{ + \bool_if:NF \g_um_uplatin_bool { + \um_map_chars_latin:nn {up,it} {#1} + \um_map_single:nnn {h}{up,it}{#1} + \um_map_single:nnn {dotlessi}{up,it}{#1} + \um_map_single:nnn {dotlessj}{up,it}{#1} + } + } + \um_set_mathalphabet_latin:Nnn \mathit {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathit {dotlessi} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathit {dotlessj} {up,it} {#1} +} +\cs_new:Nn \um_config_it_Greek:n { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_Greek:nn {it}{#1} + }{ + \bool_if:NF \g_um_upGreek_bool { \um_map_chars_Greek:nn {up,it}{#1} } + } + \um_set_mathalphabet_Greek:Nnn \mathit {up,it}{#1} +} +\cs_new:Nn \um_config_it_greek:n { + \bool_if:NTF \g_um_literal_bool { \um_map_chars_greek:nn {it} {#1} } + { + \bool_if:NF \g_um_upgreek_bool { \um_map_chars_greek:nn {it,up} {#1} } + } + \um_set_mathalphabet_greek:Nnn \mathit {up,it} {#1} +} +\cs_new:Nn \um_config_it_misc:n { + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_map_single:nnn {Nabla}{it}{it} + }{ + \bool_if:NF \g_um_upNabla_bool { + \um_map_single:nnn {Nabla}{up,it}{it} + } + } + \bool_if:NTF \g_um_literal_partial_bool { + \um_map_single:nnn {partial}{it}{it} + }{ + \bool_if:NF \g_um_uppartial_bool { + \um_map_single:nnn {partial}{up,it}{it} + } + } + \um_set_mathalphabet_pos:Nnnn \mathit {partial} {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathit {Nabla} {up,it}{#1} +} +\cs_new:Nn \um_config_bb_latin:n { + \um_set_mathalphabet_latin:Nnn \mathbb {up,it}{#1} +} +\cs_new:Nn \um_config_bb_Latin:n { + \um_set_mathalphabet_Latin:Nnn \mathbb {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {C} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {H} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {N} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {P} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {Q} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {R} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {Z} {up,it} {#1} +} +\cs_new:Nn \um_config_bb_num:n { + \um_set_mathalphabet_numbers:Nnn \mathbb {up}{#1} +} +\cs_new:Nn \um_config_bb_misc:n { + \um_set_mathalphabet_pos:Nnnn \mathbb {Pi} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {pi} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {Gamma} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {gamma} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbb {summation} {up} {#1} +} +\cs_new:Nn \um_config_bbit_misc:n { + \um_set_mathalphabet_pos:Nnnn \mathbbit {D} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbbit {d} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbbit {e} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbbit {i} {up,it} {#1} + \um_set_mathalphabet_pos:Nnnn \mathbbit {j} {up,it} {#1} +} +\cs_new:Nn \um_config_scr_Latin:n { + \um_set_mathalphabet_Latin:Nnn \mathscr {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {B}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {E}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {F}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {H}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {I}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {L}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {M}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {R}{up,it}{#1} +} +\cs_new:Nn \um_config_scr_latin:n { + \um_set_mathalphabet_latin:Nnn \mathscr {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {e}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {g}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathscr {o}{up,it}{#1} +} +\cs_new:Nn \um_config_cal_Latin:n { + \um_set_mathalphabet_Latin:Nnn \mathcal {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathcal {B}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathcal {E}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathcal {F}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathcal {H}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathcal {I}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathcal {L}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathcal {M}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathcal {R}{up,it}{#1} +} +\cs_new:Nn \um_config_frak_Latin:n { + \um_set_mathalphabet_Latin:Nnn \mathfrak {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathfrak {C}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathfrak {H}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathfrak {I}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathfrak {R}{up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathfrak {Z}{up,it}{#1} +} +\cs_new:Nn \um_config_frak_latin:n { + \um_set_mathalphabet_latin:Nnn \mathfrak {up,it}{#1} +} +\cs_new:Nn \um_config_sfup_num:n { + \um_set_mathalphabet_numbers:Nnn \mathsf {up}{#1} + \um_set_mathalphabet_numbers:Nnn \mathsfup {up}{#1} +} +\cs_new:Nn \um_config_sfup_Latin:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_Latin:nn {sfup} {#1} + \um_set_mathalphabet_Latin:Nnn \mathsf {up}{#1} + }{ + \bool_if:NT \g_um_upsans_bool { + \um_map_chars_Latin:nn {sfup,sfit} {#1} + \um_set_mathalphabet_Latin:Nnn \mathsf {up,it}{#1} + } + } + \um_set_mathalphabet_Latin:Nnn \mathsfup {up,it}{#1} +} +\cs_new:Nn \um_config_sfup_latin:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_latin:nn {sfup} {#1} + \um_set_mathalphabet_latin:Nnn \mathsf {up}{#1} + }{ + \bool_if:NT \g_um_upsans_bool { + \um_map_chars_latin:nn {sfup,sfit} {#1} + \um_set_mathalphabet_latin:Nnn \mathsf {up,it}{#1} + } + } + \um_set_mathalphabet_latin:Nnn \mathsfup {up,it}{#1} +} +\cs_new:Nn \um_config_sfit_Latin:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_Latin:nn {sfit} {#1} + \um_set_mathalphabet_Latin:Nnn \mathsf {it}{#1} + }{ + \bool_if:NF \g_um_upsans_bool { + \um_map_chars_Latin:nn {sfup,sfit} {#1} + \um_set_mathalphabet_Latin:Nnn \mathsf {up,it}{#1} + } + } + \um_set_mathalphabet_Latin:Nnn \mathsfit {up,it}{#1} +} +\cs_new:Nn \um_config_sfit_latin:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_latin:nn {sfit} {#1} + \um_set_mathalphabet_latin:Nnn \mathsf {it}{#1} + }{ + \bool_if:NF \g_um_upsans_bool { + \um_map_chars_latin:nn {sfup,sfit} {#1} + \um_set_mathalphabet_latin:Nnn \mathsf {up,it}{#1} + } + } + \um_set_mathalphabet_latin:Nnn \mathsfit {up,it}{#1} +} +\cs_new:Nn \um_config_tt_num:n { + \um_set_mathalphabet_numbers:Nnn \mathtt {up}{#1} +} +\cs_new:Nn \um_config_tt_Latin:n { + \um_set_mathalphabet_Latin:Nnn \mathtt {up,it}{#1} +} +\cs_new:Nn \um_config_tt_latin:n { + \um_set_mathalphabet_latin:Nnn \mathtt {up,it}{#1} +} +\cs_new:Nn \um_config_bfit_Latin:n { + \bool_if:NF \g_um_bfupLatin_bool { + \um_map_chars_Latin:nn {bfup,bfit} {#1} + } + \um_set_mathalphabet_Latin:Nnn \mathbfit {up,it}{#1} + \bool_if:NTF \g_um_bfliteral_bool { + \um_map_chars_Latin:nn {bfit} {#1} + \um_set_mathalphabet_Latin:Nnn \mathbf {it}{#1} + }{ + \bool_if:NF \g_um_bfupLatin_bool { + \um_map_chars_Latin:nn {bfup,bfit} {#1} + \um_set_mathalphabet_Latin:Nnn \mathbf {up,it}{#1} + } + } +} +\cs_new:Nn \um_config_bfit_latin:n { + \bool_if:NF \g_um_bfuplatin_bool { + \um_map_chars_latin:nn {bfup,bfit} {#1} + } + \um_set_mathalphabet_latin:Nnn \mathbfit {up,it}{#1} + \bool_if:NTF \g_um_bfliteral_bool { + \um_map_chars_latin:nn {bfit} {#1} + \um_set_mathalphabet_latin:Nnn \mathbf {it}{#1} + }{ + \bool_if:NF \g_um_bfuplatin_bool { + \um_map_chars_latin:nn {bfup,bfit} {#1} + \um_set_mathalphabet_latin:Nnn \mathbf {up,it}{#1} + } + } +} +\cs_new:Nn \um_config_bfit_Greek:n { + \um_set_mathalphabet_Greek:Nnn \mathbfit {up,it}{#1} + \bool_if:NTF \g_um_bfliteral_bool { + \um_map_chars_Greek:nn {bfit}{#1} + \um_set_mathalphabet_Greek:Nnn \mathbf {it}{#1} + }{ + \bool_if:NF \g_um_bfupGreek_bool { + \um_map_chars_Greek:nn {bfup,bfit}{#1} + \um_set_mathalphabet_Greek:Nnn \mathbf {up,it}{#1} + } + } +} +\cs_new:Nn \um_config_bfit_greek:n { + \um_set_mathalphabet_greek:Nnn \mathbfit {up,it} {#1} + \bool_if:NTF \g_um_bfliteral_bool { + \um_map_chars_greek:nn {bfit} {#1} + \um_set_mathalphabet_greek:Nnn \mathbf {it} {#1} + }{ + \bool_if:NF \g_um_bfupgreek_bool { + \um_map_chars_greek:nn {bfit,bfup} {#1} + \um_set_mathalphabet_greek:Nnn \mathbf {up,it} {#1} + } + } +} +\cs_new:Nn \um_config_bfit_misc:n { + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_map_single:nnn {Nabla}{bfit}{#1} + }{ + \bool_if:NF \g_um_upNabla_bool { + \um_map_single:nnn {Nabla}{bfup,bfit}{#1} + } + } + \bool_if:NTF \g_um_literal_partial_bool { + \um_map_single:nnn {partial}{bfit}{#1} + }{ + \bool_if:NF \g_um_uppartial_bool { + \um_map_single:nnn {partial}{bfup,bfit}{#1} + } + } + \um_set_mathalphabet_pos:Nnnn \mathbfit {partial} {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathbfit {Nabla} {up,it}{#1} + \bool_if:NTF \g_um_literal_partial_bool { + \um_set_mathalphabet_pos:Nnnn \mathbf {partial} {it}{#1} + }{ + \bool_if:NF \g_um_uppartial_bool { + \um_set_mathalphabet_pos:Nnnn \mathbf {partial} {up,it}{#1} + } + } + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_set_mathalphabet_pos:Nnnn \mathbf {Nabla} {it}{#1} + }{ + \bool_if:NF \g_um_upNabla_bool { + \um_set_mathalphabet_pos:Nnnn \mathbf {Nabla} {up,it}{#1} + } + } +} +\cs_new:Nn \um_config_bfup_num:n { + \um_set_mathalphabet_numbers:Nnn \mathbf {up}{#1} + \um_set_mathalphabet_numbers:Nnn \mathbfup {up}{#1} +} +\cs_new:Nn \um_config_bfup_Latin:n { + \bool_if:NT \g_um_bfupLatin_bool { + \um_map_chars_Latin:nn {bfup,bfit} {#1} + } + \um_set_mathalphabet_Latin:Nnn \mathbfup {up,it}{#1} + \bool_if:NTF \g_um_bfliteral_bool { + \um_map_chars_Latin:nn {bfup} {#1} + \um_set_mathalphabet_Latin:Nnn \mathbf {up}{#1} + }{ + \bool_if:NT \g_um_bfupLatin_bool { + \um_map_chars_Latin:nn {bfup,bfit} {#1} + \um_set_mathalphabet_Latin:Nnn \mathbf {up,it}{#1} + } + } +} +\cs_new:Nn \um_config_bfup_latin:n { + \bool_if:NT \g_um_bfuplatin_bool { + \um_map_chars_latin:nn {bfup,bfit} {#1} + } + \um_set_mathalphabet_latin:Nnn \mathbfup {up,it}{#1} + \bool_if:NTF \g_um_bfliteral_bool { + \um_map_chars_latin:nn {bfup} {#1} + \um_set_mathalphabet_latin:Nnn \mathbf {up}{#1} + }{ + \bool_if:NT \g_um_bfuplatin_bool { + \um_map_chars_latin:nn {bfup,bfit} {#1} + \um_set_mathalphabet_latin:Nnn \mathbf {up,it}{#1} + } + } +} +\cs_new:Nn \um_config_bfup_Greek:n { + \um_set_mathalphabet_Greek:Nnn \mathbfup {up,it}{#1} + \bool_if:NTF \g_um_bfliteral_bool { + \um_map_chars_Greek:nn {bfup}{#1} + \um_set_mathalphabet_Greek:Nnn \mathbf {up}{#1} + }{ + \bool_if:NT \g_um_bfupGreek_bool { + \um_map_chars_Greek:nn {bfup,bfit}{#1} + \um_set_mathalphabet_Greek:Nnn \mathbf {up,it}{#1} + } + } +} +\cs_new:Nn \um_config_bfup_greek:n { + \um_set_mathalphabet_greek:Nnn \mathbfup {up,it} {#1} + \bool_if:NTF \g_um_bfliteral_bool { + \um_map_chars_greek:nn {bfup} {#1} + \um_set_mathalphabet_greek:Nnn \mathbf {up} {#1} + }{ + \bool_if:NT \g_um_bfupgreek_bool { + \um_map_chars_greek:nn {bfup,bfit} {#1} + \um_set_mathalphabet_greek:Nnn \mathbf {up,it} {#1} + } + } +} +\cs_new:Nn \um_config_bfup_misc:n { + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_map_single:nnn {Nabla}{bfup}{#1} + }{ + \bool_if:NT \g_um_upNabla_bool { + \um_map_single:nnn {Nabla}{bfup,bfit}{#1} + } + } + \bool_if:NTF \g_um_literal_partial_bool { + \um_map_single:nnn {partial}{bfup}{#1} + }{ + \bool_if:NT \g_um_uppartial_bool { + \um_map_single:nnn {partial}{bfup,bfit}{#1} + } + } + \um_set_mathalphabet_pos:Nnnn \mathbfup {partial} {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathbfup {Nabla} {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathbfup {digamma} {up}{#1} + \um_set_mathalphabet_pos:Nnnn \mathbfup {Digamma} {up}{#1} + \um_set_mathalphabet_pos:Nnnn \mathbf {digamma} {up}{#1} + \um_set_mathalphabet_pos:Nnnn \mathbf {Digamma} {up}{#1} + \bool_if:NTF \g_um_literal_partial_bool { + \um_set_mathalphabet_pos:Nnnn \mathbf {partial} {up}{#1} + }{ + \bool_if:NT \g_um_uppartial_bool { + \um_set_mathalphabet_pos:Nnnn \mathbf {partial} {up,it}{#1} + } + } + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_set_mathalphabet_pos:Nnnn \mathbf {Nabla} {up}{#1} + }{ + \bool_if:NT \g_um_upNabla_bool { + \um_set_mathalphabet_pos:Nnnn \mathbf {Nabla} {up,it}{#1} + } + } +} +\cs_new:Nn \um_config_bffrak_Latin:n { + \um_set_mathalphabet_Latin:Nnn \mathbffrak {up,it}{#1} +} +\cs_new:Nn \um_config_bffrak_latin:n { + \um_set_mathalphabet_latin:Nnn \mathbffrak {up,it}{#1} +} +\cs_new:Nn \um_config_bfscr_Latin:n { + \um_set_mathalphabet_Latin:Nnn \mathbfscr {up,it}{#1} +} +\cs_new:Nn \um_config_bfscr_latin:n { + \um_set_mathalphabet_latin:Nnn \mathbfscr {up,it}{#1} +} +\cs_new:Nn \um_config_bfcal_Latin:n { + \um_set_mathalphabet_Latin:Nnn \mathbfcal {up,it}{#1} +} +\cs_new:Nn \um_config_bfsfup_num:n { + \um_set_mathalphabet_numbers:Nnn \mathbfsf {up}{#1} + \um_set_mathalphabet_numbers:Nnn \mathbfsfup {up}{#1} +} +\cs_new:Nn \um_config_bfsfup_Latin:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_Latin:nn {bfsfup} {#1} + \um_set_mathalphabet_Latin:Nnn \mathbfsf {up}{#1} + }{ + \bool_if:NT \g_um_upsans_bool { + \um_map_chars_Latin:nn {bfsfup,bfsfit} {#1} + \um_set_mathalphabet_Latin:Nnn \mathbfsf {up,it}{#1} + } + } + \um_set_mathalphabet_Latin:Nnn \mathbfsfup {up,it}{#1} +} +\cs_new:Nn \um_config_bfsfup_latin:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_latin:nn {bfsfup} {#1} + \um_set_mathalphabet_latin:Nnn \mathbfsf {up}{#1} + }{ + \bool_if:NT \g_um_upsans_bool { + \um_map_chars_latin:nn {bfsfup,bfsfit} {#1} + \um_set_mathalphabet_latin:Nnn \mathbfsf {up,it}{#1} + } + } + \um_set_mathalphabet_latin:Nnn \mathbfsfup {up,it}{#1} +} +\cs_new:Nn \um_config_bfsfup_Greek:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_Greek:nn {bfsfup}{#1} + \um_set_mathalphabet_Greek:Nnn \mathbfsf {up}{#1} + }{ + \bool_if:NT \g_um_upsans_bool { + \um_map_chars_Greek:nn {bfsfup,bfsfit}{#1} + \um_set_mathalphabet_Greek:Nnn \mathbfsf {up,it}{#1} + } + } + \um_set_mathalphabet_Greek:Nnn \mathbfsfup {up,it}{#1} +} +\cs_new:Nn \um_config_bfsfup_greek:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_greek:nn {bfsfup} {#1} + \um_set_mathalphabet_greek:Nnn \mathbfsf {up} {#1} + }{ + \bool_if:NT \g_um_upsans_bool { + \um_map_chars_greek:nn {bfsfup,bfsfit} {#1} + \um_set_mathalphabet_greek:Nnn \mathbfsf {up,it} {#1} + } + } + \um_set_mathalphabet_greek:Nnn \mathbfsfup {up,it} {#1} +} +\cs_new:Nn \um_config_bfsfup_misc:n { + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_map_single:nnn {Nabla}{bfsfup}{#1} + }{ + \bool_if:NT \g_um_upNabla_bool { + \um_map_single:nnn {Nabla}{bfsfup,bfsfit}{#1} + } + } + \bool_if:NTF \g_um_literal_partial_bool { + \um_map_single:nnn {partial}{bfsfup}{#1} + }{ + \bool_if:NT \g_um_uppartial_bool { + \um_map_single:nnn {partial}{bfsfup,bfsfit}{#1} + } + } + \um_set_mathalphabet_pos:Nnnn \mathbfsfup {partial} {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathbfsfup {Nabla} {up,it}{#1} + \bool_if:NTF \g_um_literal_partial_bool { + \um_set_mathalphabet_pos:Nnnn \mathbfsf {partial} {up}{#1} + }{ + \bool_if:NT \g_um_uppartial_bool { + \um_set_mathalphabet_pos:Nnnn \mathbfsf {partial} {up,it}{#1} + } + } + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_set_mathalphabet_pos:Nnnn \mathbfsf {Nabla} {up}{#1} + }{ + \bool_if:NT \g_um_upNabla_bool { + \um_set_mathalphabet_pos:Nnnn \mathbfsf {Nabla} {up,it}{#1} + } + } +} +\cs_new:Nn \um_config_bfsfit_Latin:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_Latin:nn {bfsfit} {#1} + \um_set_mathalphabet_Latin:Nnn \mathbfsf {it}{#1} + }{ + \bool_if:NF \g_um_upsans_bool { + \um_map_chars_Latin:nn {bfsfup,bfsfit} {#1} + \um_set_mathalphabet_Latin:Nnn \mathbfsf {up,it}{#1} + } + } + \um_set_mathalphabet_Latin:Nnn \mathbfsfit {up,it}{#1} +} +\cs_new:Nn \um_config_bfsfit_latin:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_latin:nn {bfsfit} {#1} + \um_set_mathalphabet_latin:Nnn \mathbfsf {it}{#1} + }{ + \bool_if:NF \g_um_upsans_bool { + \um_map_chars_latin:nn {bfsfup,bfsfit} {#1} + \um_set_mathalphabet_latin:Nnn \mathbfsf {up,it}{#1} + } + } + \um_set_mathalphabet_latin:Nnn \mathbfsfit {up,it}{#1} +} +\cs_new:Nn \um_config_bfsfit_Greek:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_Greek:nn {bfsfit}{#1} + \um_set_mathalphabet_Greek:Nnn \mathbfsf {it}{#1} + }{ + \bool_if:NF \g_um_upsans_bool { + \um_map_chars_Greek:nn {bfsfup,bfsfit}{#1} + \um_set_mathalphabet_Greek:Nnn \mathbfsf {up,it}{#1} + } + } + \um_set_mathalphabet_Greek:Nnn \mathbfsfit {up,it}{#1} +} +\cs_new:Nn \um_config_bfsfit_greek:n { + \bool_if:NTF \g_um_sfliteral_bool { + \um_map_chars_greek:nn {bfsfit} {#1} + \um_set_mathalphabet_greek:Nnn \mathbfsf {it} {#1} + }{ + \bool_if:NF \g_um_upsans_bool { + \um_map_chars_greek:nn {bfsfup,bfsfit} {#1} + \um_set_mathalphabet_greek:Nnn \mathbfsf {up,it} {#1} + } + } + \um_set_mathalphabet_greek:Nnn \mathbfsfit {up,it} {#1} +} +\cs_new:Nn \um_config_bfsfit_misc:n { + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_map_single:nnn {Nabla}{bfsfit}{#1} + }{ + \bool_if:NF \g_um_upNabla_bool { + \um_map_single:nnn {Nabla}{bfsfup,bfsfit}{#1} + } + } + \bool_if:NTF \g_um_literal_partial_bool { + \um_map_single:nnn {partial}{bfsfit}{#1} + }{ + \bool_if:NF \g_um_uppartial_bool { + \um_map_single:nnn {partial}{bfsfup,bfsfit}{#1} + } + } + \um_set_mathalphabet_pos:Nnnn \mathbfsfit {partial} {up,it}{#1} + \um_set_mathalphabet_pos:Nnnn \mathbfsfit {Nabla} {up,it}{#1} + \bool_if:NTF \g_um_literal_partial_bool { + \um_set_mathalphabet_pos:Nnnn \mathbfsf {partial} {it}{#1} + }{ + \bool_if:NF \g_um_uppartial_bool { + \um_set_mathalphabet_pos:Nnnn \mathbfsf {partial} {up,it}{#1} + } + } + \bool_if:NTF \g_um_literal_Nabla_bool { + \um_set_mathalphabet_pos:Nnnn \mathbfsf {Nabla} {it}{#1} + }{ + \bool_if:NF \g_um_upNabla_bool { + \um_set_mathalphabet_pos:Nnnn \mathbfsf {Nabla} {up,it}{#1} + } + } +} +\cs_new:Npn \um_symbol_setup: + { + \cs_set:Npn \UnicodeMathSymbol ##1##2##3##4 { + \prg_case_tl:Nnn ##3 { \mathover {} \mathunder {} } + { + \exp_not:n {\_um_sym:nnn{##1}{##2}{##3}} + } + } + } +\CatchFileEdef \g_um_mathtable_tl {unicode-math-table.tex} {\um_symbol_setup:} +\cs_new:Nn \um_input_math_symbol_table: {\g_um_mathtable_tl} +\group_begin: + \char_set_catcode_other:N \^ + \cs_gset:Npn \um_cs_set_eq_active_char:Nw #1 = "#2 \q_nil { + \tex_lowercase:D { + \tl_rescan:nn { + \ExplSyntaxOn + \char_set_catcode_other:N \{ + \char_set_catcode_other:N \} + \char_set_catcode_other:N \& + \char_set_catcode_other:N \% + \char_set_catcode_other:N \$ + }{ + \cs_gset_eq:NN #1 ^^^^^#2 + } + } + } + \cs_new:Npn \um_active_char_set:wc "#1 \q_nil #2 { + \tex_lowercase:D { + \tl_rescan:nn { \ExplSyntaxOn } + { \cs_gset_protected_nopar:Npx ^^^^^#1 { \exp_not:c {#2} } } + } + } +\group_end: +\AtBeginDocument{\um_define_math_chars:} +\cs_new:Nn \um_define_math_chars: { + \group_begin: + \char_set_catcode_math_superscript:N \^ + \cs_set:Npn \_um_sym:nnn ##1##2##3 { + \bool_if:nF { \cs_if_eq_p:NN ##3 \mathaccent || + \cs_if_eq_p:NN ##3 \mathopen || + \cs_if_eq_p:NN ##3 \mathclose || + \cs_if_eq_p:NN ##3 \mathover || + \cs_if_eq_p:NN ##3 \mathunder } { + \um_cs_set_eq_active_char:Nw ##2 = ##1 \q_nil \ignorespaces + } + } + \char_set_catcode_other:N \# + \um_input_math_symbol_table: + \group_end: +} +\group_begin: + \lccode`\*=`\\ + \char_set_catcode_escape:N \| + \char_set_catcode_other:N \\ + |lowercase{ + |AtBeginDocument{ + |let|backslash=* + } + } +|group_end: +\cs_new:Nn \um_arg_i_before_egroup:n {#1\egroup} +\cs_new:Nn \um_superscript:n { + ^\bgroup #1 + \peek_meaning_remove:NTF ^ \um_arg_i_before_egroup:n \egroup +} +\muskip_new:N \g_um_primekern_muskip +\muskip_gset:Nn \g_um_primekern_muskip { -\thinmuskip/2 }% arbitrary +\int_new:N \l_um_primecount_int +\cs_new:Nn \um_nprimes:Nn { + \um_superscript:n { + #1 + \prg_replicate:nn {#2-1} { \mskip \g_um_primekern_muskip #1 } + } +} +\cs_new:Nn \um_nprimes_select:nn { + \prg_case_int:nnn {#2}{ + {1} { \um_superscript:n {#1} } + {2} { + \um_glyph_if_exist:nTF {"2033} + { \um_superscript:n {\um_prime_double_mchar} } + { \um_nprimes:Nn #1 {#2} } + } + {3} { + \um_glyph_if_exist:nTF {"2034} + { \um_superscript:n {\um_prime_triple_mchar} } + { \um_nprimes:Nn #1 {#2} } + } + {4} { + \um_glyph_if_exist:nTF {"2057} + { \um_superscript:n {\um_prime_quad_mchar} } + { \um_nprimes:Nn #1 {#2} } + } + }{ + \um_nprimes:Nn #1 {#2} + } +} +\cs_new:Nn \um_nbackprimes_select:nn { + \prg_case_int:nnn {#2}{ + {1} { \um_superscript:n {#1} } + {2} { + \um_glyph_if_exist:nTF {"2036} + { \um_superscript:n {\um_backprime_double_mchar} } + { \um_nprimes:Nn #1 {#2} } + } + {3} { + \um_glyph_if_exist:nTF {"2037} + { \um_superscript:n {\um_backprime_triple_mchar} } + { \um_nprimes:Nn #1 {#2} } + } + }{ + \um_nprimes:Nn #1 {#2} + } +} +\cs_new:Npn \um_scan_prime: { + \cs_set_eq:NN \um_superscript:n \use:n + \int_zero:N \l_um_primecount_int + \um_scanprime_collect:N \um_prime_single_mchar +} +\cs_new:Npn \um_scan_dprime: { + \cs_set_eq:NN \um_superscript:n \use:n + \int_set:Nn \l_um_primecount_int {1} + \um_scanprime_collect:N \um_prime_single_mchar +} +\cs_new:Npn \um_scan_trprime: { + \cs_set_eq:NN \um_superscript:n \use:n + \int_set:Nn \l_um_primecount_int {2} + \um_scanprime_collect:N \um_prime_single_mchar +} +\cs_new:Npn \um_scan_qprime: { + \cs_set_eq:NN \um_superscript:n \use:n + \int_set:Nn \l_um_primecount_int {3} + \um_scanprime_collect:N \um_prime_single_mchar +} +\cs_new:Npn \um_scan_sup_prime: { + \int_zero:N \l_um_primecount_int + \um_scanprime_collect:N \um_prime_single_mchar +} +\cs_new:Npn \um_scan_sup_dprime: { + \int_set:Nn \l_um_primecount_int {1} + \um_scanprime_collect:N \um_prime_single_mchar +} +\cs_new:Npn \um_scan_sup_trprime: { + \int_set:Nn \l_um_primecount_int {2} + \um_scanprime_collect:N \um_prime_single_mchar +} +\cs_new:Npn \um_scan_sup_qprime: { + \int_set:Nn \l_um_primecount_int {3} + \um_scanprime_collect:N \um_prime_single_mchar +} +\cs_new:Nn \um_scanprime_collect:N { + \int_incr:N \l_um_primecount_int + \peek_meaning_remove:NTF ' { + \um_scanprime_collect:N #1 + }{ + \peek_meaning_remove:NTF \um_scan_prime: { + \um_scanprime_collect:N #1 + }{ + \peek_meaning_remove:NTF ^^^^2032 { + \um_scanprime_collect:N #1 + }{ + \peek_meaning_remove:NTF \um_scan_dprime: { + \int_incr:N \l_um_primecount_int + \um_scanprime_collect:N #1 + }{ + \peek_meaning_remove:NTF ^^^^2033 { + \int_incr:N \l_um_primecount_int + \um_scanprime_collect:N #1 + }{ + \peek_meaning_remove:NTF \um_scan_trprime: { + \int_add:Nn \l_um_primecount_int {2} + \um_scanprime_collect:N #1 + }{ + \peek_meaning_remove:NTF ^^^^2034 { + \int_add:Nn \l_um_primecount_int {2} + \um_scanprime_collect:N #1 + }{ + \peek_meaning_remove:NTF \um_scan_qprime: { + \int_add:Nn \l_um_primecount_int {3} + \um_scanprime_collect:N #1 + }{ + \peek_meaning_remove:NTF ^^^^2057 { + \int_add:Nn \l_um_primecount_int {3} + \um_scanprime_collect:N #1 + }{ + \um_nprimes_select:nn {#1} {\l_um_primecount_int} + } + } + } + } + } + } + } + } + } +} +\cs_new:Npn \um_scan_backprime: { + \cs_set_eq:NN \um_superscript:n \use:n + \int_zero:N \l_um_primecount_int + \um_scanbackprime_collect:N \um_backprime_single_mchar +} +\cs_new:Npn \um_scan_backdprime: { + \cs_set_eq:NN \um_superscript:n \use:n + \int_set:Nn \l_um_primecount_int {1} + \um_scanbackprime_collect:N \um_backprime_single_mchar +} +\cs_new:Npn \um_scan_backtrprime: { + \cs_set_eq:NN \um_superscript:n \use:n + \int_set:Nn \l_um_primecount_int {2} + \um_scanbackprime_collect:N \um_backprime_single_mchar +} +\cs_new:Npn \um_scan_sup_backprime: { + \int_zero:N \l_um_primecount_int + \um_scanbackprime_collect:N \um_backprime_single_mchar +} +\cs_new:Npn \um_scan_sup_backdprime: { + \int_set:Nn \l_um_primecount_int {1} + \um_scanbackprime_collect:N \um_backprime_single_mchar +} +\cs_new:Npn \um_scan_sup_backtrprime: { + \int_set:Nn \l_um_primecount_int {2} + \um_scanbackprime_collect:N \um_backprime_single_mchar +} +\cs_new:Nn \um_scanbackprime_collect:N { + \int_incr:N \l_um_primecount_int + \peek_meaning_remove:NTF ` { + \um_scanbackprime_collect:N #1 + }{ + \peek_meaning_remove:NTF \um_scan_backprime: { + \um_scanbackprime_collect:N #1 + }{ + \peek_meaning_remove:NTF ^^^^2035 { + \um_scanbackprime_collect:N #1 + }{ + \peek_meaning_remove:NTF \um_scan_backdprime: { + \int_incr:N \l_um_primecount_int + \um_scanbackprime_collect:N #1 + }{ + \peek_meaning_remove:NTF ^^^^2036 { + \int_incr:N \l_um_primecount_int + \um_scanbackprime_collect:N #1 + }{ + \peek_meaning_remove:NTF \um_scan_backtrprime: { + \int_add:Nn \l_um_primecount_int {2} + \um_scanbackprime_collect:N #1 + }{ + \peek_meaning_remove:NTF ^^^^2037 { + \int_add:Nn \l_um_primecount_int {2} + \um_scanbackprime_collect:N #1 + }{ + \um_nbackprimes_select:nn {#1} {\l_um_primecount_int} + } + } + } + } + } + } + } +} +\AtBeginDocument{\um_define_prime_commands: \um_define_prime_chars:} +\cs_new:Nn \um_define_prime_commands: { + \cs_set_eq:NN \prime \um_prime_single_mchar + \cs_set_eq:NN \dprime \um_prime_double_mchar + \cs_set_eq:NN \trprime \um_prime_triple_mchar + \cs_set_eq:NN \qprime \um_prime_quad_mchar + \cs_set_eq:NN \backprime \um_backprime_single_mchar + \cs_set_eq:NN \backdprime \um_backprime_double_mchar + \cs_set_eq:NN \backtrprime \um_backprime_triple_mchar +} +\group_begin: + \char_set_catcode_active:N \' + \char_set_catcode_active:N \` + \char_set_catcode_active:n {"2032} + \char_set_catcode_active:n {"2033} + \char_set_catcode_active:n {"2034} + \char_set_catcode_active:n {"2057} + \char_set_catcode_active:n {"2035} + \char_set_catcode_active:n {"2036} + \char_set_catcode_active:n {"2037} + \cs_gset:Nn \um_define_prime_chars: { + \cs_set_eq:NN ' \um_scan_sup_prime: + \cs_set_eq:NN ^^^^2032 \um_scan_sup_prime: + \cs_set_eq:NN ^^^^2033 \um_scan_sup_dprime: + \cs_set_eq:NN ^^^^2034 \um_scan_sup_trprime: + \cs_set_eq:NN ^^^^2057 \um_scan_sup_qprime: + \cs_set_eq:NN ` \um_scan_sup_backprime: + \cs_set_eq:NN ^^^^2035 \um_scan_sup_backprime: + \cs_set_eq:NN ^^^^2036 \um_scan_sup_backdprime: + \cs_set_eq:NN ^^^^2037 \um_scan_sup_backtrprime: + } +\group_end: +\AtBeginDocument{\um_redefine_radical:} +\cs_new:Nn \um_redefine_radical: + { + \@ifpackageloaded { amsmath } { } { + \cs_set_nopar:Npn \r@@t ##1 ##2 { + \hbox_set:Nn \l_tmpa_box { + \c_math_toggle_token + \m@th + ##1 + \sqrtsign { ##2 } + \c_math_toggle_token + } + \um_mathstyle_scale:Nnn ##1 { \kern } { + \fontdimen 63 \l_um_font + } + \box_move_up:nn { + (\box_ht:N \l_tmpa_box - \box_dp:N \l_tmpa_box) + * \number \fontdimen 65 \l_um_font / 100 + } { + \box_use:N \rootbox + } + \um_mathstyle_scale:Nnn ##1 { \kern } { + \fontdimen 64 \l_um_font + } + \box_use_clear:N \l_tmpa_box + } + } + } +\cs_new:Nn \um_fontdimen_to_percent:nn { + \strip@pt\dimexpr\fontdimen#1#2*65536/100\relax +} +\cs_new:Nn \um_fontdimen_to_scale:nn + { + \um_fontdimen_to_percent:nn {#1} {#2} \dimexpr \f@size pt\relax + } +\cs_new:Nn \um_mathstyle_scale:Nnn { + \ifx#1\scriptstyle + #2\um_fontdimen_to_percent:nn{10}\l_um_font#3 + \else + \ifx#1\scriptscriptstyle + #2\um_fontdimen_to_percent:nn{11}\l_um_font#3 + \else + #2#3 + \fi + \fi +} +\prop_new:N \g_um_supers_prop +\prop_new:N \g_um_subs_prop +\group_begin: +\cs_new:Nn \um_setup_active_superscript:nn { + \prop_gput:Nxn \g_um_supers_prop {\meaning #1} {#2} + \char_set_catcode_active:N #1 + \char_gmake_mathactive:N #1 + \scantokens{ + \cs_gset:Npn #1 { + \tl_set:Nn \l_um_ss_chain_tl {#2} + \cs_set_eq:NN \um_sub_or_super:n \sp + \tl_set:Nn \l_um_tmpa_tl {supers} + \um_scan_sscript: + } + } +} +\um_setup_active_superscript:nn {^^^^2070} {0} +\um_setup_active_superscript:nn {^^^^00b9} {1} +\um_setup_active_superscript:nn {^^^^00b2} {2} +\um_setup_active_superscript:nn {^^^^00b3} {3} +\um_setup_active_superscript:nn {^^^^2074} {4} +\um_setup_active_superscript:nn {^^^^2075} {5} +\um_setup_active_superscript:nn {^^^^2076} {6} +\um_setup_active_superscript:nn {^^^^2077} {7} +\um_setup_active_superscript:nn {^^^^2078} {8} +\um_setup_active_superscript:nn {^^^^2079} {9} +\um_setup_active_superscript:nn {^^^^207a} {+} +\um_setup_active_superscript:nn {^^^^207b} {-} +\um_setup_active_superscript:nn {^^^^207c} {=} +\um_setup_active_superscript:nn {^^^^207d} {(} +\um_setup_active_superscript:nn {^^^^207e} {)} +\um_setup_active_superscript:nn {^^^^2071} {i} +\um_setup_active_superscript:nn {^^^^207f} {n} +\cs_new:Nn \um_setup_active_subscript:nn { + \prop_gput:Nxn \g_um_subs_prop {\meaning #1} {#2} + \char_set_catcode_active:N #1 + \char_gmake_mathactive:N #1 + \scantokens{ + \cs_gset:Npn #1 { + \tl_set:Nn \l_um_ss_chain_tl {#2} + \cs_set_eq:NN \um_sub_or_super:n \sb + \tl_set:Nn \l_um_tmpa_tl {subs} + \um_scan_sscript: + } + } +} +\um_setup_active_subscript:nn {^^^^2080} {0} +\um_setup_active_subscript:nn {^^^^2081} {1} +\um_setup_active_subscript:nn {^^^^2082} {2} +\um_setup_active_subscript:nn {^^^^2083} {3} +\um_setup_active_subscript:nn {^^^^2084} {4} +\um_setup_active_subscript:nn {^^^^2085} {5} +\um_setup_active_subscript:nn {^^^^2086} {6} +\um_setup_active_subscript:nn {^^^^2087} {7} +\um_setup_active_subscript:nn {^^^^2088} {8} +\um_setup_active_subscript:nn {^^^^2089} {9} +\um_setup_active_subscript:nn {^^^^208a} {+} +\um_setup_active_subscript:nn {^^^^208b} {-} +\um_setup_active_subscript:nn {^^^^208c} {=} +\um_setup_active_subscript:nn {^^^^208d} {(} +\um_setup_active_subscript:nn {^^^^208e} {)} +\um_setup_active_subscript:nn {^^^^2090} {a} +\um_setup_active_subscript:nn {^^^^2091} {e} +\um_setup_active_subscript:nn {^^^^1d62} {i} +\um_setup_active_subscript:nn {^^^^2092} {o} +\um_setup_active_subscript:nn {^^^^1d63} {r} +\um_setup_active_subscript:nn {^^^^1d64} {u} +\um_setup_active_subscript:nn {^^^^1d65} {v} +\um_setup_active_subscript:nn {^^^^2093} {x} +\um_setup_active_subscript:nn {^^^^1d66} {\beta} +\um_setup_active_subscript:nn {^^^^1d67} {\gamma} +\um_setup_active_subscript:nn {^^^^1d68} {\rho} +\um_setup_active_subscript:nn {^^^^1d69} {\phi} +\um_setup_active_subscript:nn {^^^^1d6a} {\chi} +\group_end: +\cs_new:Npn \um_scan_sscript: { + \um_scan_sscript:TF { + \um_scan_sscript: + }{ + \um_sub_or_super:n {\l_um_ss_chain_tl} + } +} +\cs_new:Npn \um_scan_sscript:TF #1#2 { + \tl_set:Nx \peek_true_aux:w { \exp_not:n{ #1 } } + \tl_set_eq:NN \peek_true:w \peek_true_remove:w + \tl_set:Nx \peek_false:w { \exp_not:n { \group_align_safe_end: #2 } } + \group_align_safe_begin: + \peek_after:Nw \um_peek_execute_branches_ss: +} +\cs_new:Npn \um_peek_execute_branches_ss: { + \bool_if:nTF { + \token_if_eq_catcode_p:NN \l_peek_token \c_group_begin_token || + \token_if_eq_catcode_p:NN \l_peek_token \c_group_end_token || + \token_if_eq_meaning_p:NN \l_peek_token \c_space_token + } + { \peek_false:w } + { \um_peek_execute_branches_ss_aux: } +} +\cs_new:Npn \um_peek_execute_branches_ss_aux: { + \prop_if_in:cxTF + {g_um_\l_um_tmpa_tl _prop} {\meaning\l_peek_token} + { + \prop_get:cxN + {g_um_\l_um_tmpa_tl _prop} {\meaning\l_peek_token} \l_um_tmpb_tl + \tl_put_right:NV \l_um_ss_chain_tl \l_um_tmpb_tl + \peek_true:w + } + { \peek_false:w } +} +\cs_new:Npn \um_define_active_frac:Nw #1 #2/#3 { + \char_set_catcode_active:N #1 + \char_gmake_mathactive:N #1 + \tl_rescan:nn { + \catcode`\_=11\relax + \catcode`\:=11\relax + }{ + \cs_gset:Npx #1 { + \bool_if:NTF \l_um_smallfrac_bool {\exp_not:N\tfrac} {\exp_not:N\frac} + {#2} {#3} + } + } +} +\cs_new:Npn \um_setup_active_frac: { + \group_begin: + \um_define_active_frac:Nw ^^^^2189 0/3 + \um_define_active_frac:Nw ^^^^2152 1/{10} + \um_define_active_frac:Nw ^^^^2151 1/9 + \um_define_active_frac:Nw ^^^^215b 1/8 + \um_define_active_frac:Nw ^^^^2150 1/7 + \um_define_active_frac:Nw ^^^^2159 1/6 + \um_define_active_frac:Nw ^^^^2155 1/5 + \um_define_active_frac:Nw ^^^^00bc 1/4 + \um_define_active_frac:Nw ^^^^2153 1/3 + \um_define_active_frac:Nw ^^^^215c 3/8 + \um_define_active_frac:Nw ^^^^2156 2/5 + \um_define_active_frac:Nw ^^^^00bd 1/2 + \um_define_active_frac:Nw ^^^^2157 3/5 + \um_define_active_frac:Nw ^^^^215d 5/8 + \um_define_active_frac:Nw ^^^^2154 2/3 + \um_define_active_frac:Nw ^^^^00be 3/4 + \um_define_active_frac:Nw ^^^^2158 4/5 + \um_define_active_frac:Nw ^^^^215a 5/6 + \um_define_active_frac:Nw ^^^^215e 7/8 + \group_end: +} +\um_setup_active_frac: +\cs_new:Nn \um_over_bracket:nN + { + \mathop { \vbox { + \setbox\z@\hbox{$\displaystyle#1$} + \dimen@=\dimexpr\wd\z@+3\p@\relax + \setbox\tw@\hbox{$\left #2 \vcenter to\dimen@{\vss} \right. $} + \m@th\ialign + { + ##\crcr\noalign{\kern-\p@}% + \rotatebox[origin=Bl]{-90} + {\box\tw@}\crcr\noalign{\kern0\p@\nointerlineskip}% + \hfil\box\z@\hfil\crcr + } + } } \limits + } +\cs_new:Nn \um_under_bracket:nN + { + \mathop { \vtop { + \setbox\z@\hbox{$\displaystyle#1$} + \dimen@=\dimexpr\wd\z@+3\p@\relax + \setbox\tw@\hbox{$\left #2 \vcenter to\dimen@{\vss} \right. $} + \m@th\ialign + { + ##\crcr\hfil\box\z@\hfil\crcr + \noalign{\kern1\p@\nointerlineskip}% + \rotatebox[origin=Br]{-90}{\box\tw@}\crcr\noalign{\kern0\p@} + } + } } \limits + } +\DeclareDocumentCommand \overbrace {m} { \um_over_bracket:nN {#1} \{ } +\DeclareDocumentCommand \overbracket {m} { \um_over_bracket:nN {#1} [ } +\DeclareDocumentCommand \overparen {m} { \um_over_bracket:nN {#1} ( } +\DeclareDocumentCommand \underbrace {m} { \um_under_bracket:nN {#1} \} } +\DeclareDocumentCommand \underbracket {m} { \um_under_bracket:nN {#1} ] } +\DeclareDocumentCommand \underparen {m} { \um_under_bracket:nN {#1} ) } +\def\to{\rightarrow} +\def\le{\leq} +\def\ge{\geq} +\def\neq{\ne} +\def\triangle{\mathord{\bigtriangleup}} +\def\bigcirc{\mdlgwhtcircle} +\def\circ{\vysmwhtcircle} +\def\bullet{\smblkcircle} +\def\mathyen{\yen} +\def\mathsterling{\sterling} +\def\diamond{\smwhtdiamond} +\def\emptyset{\varnothing} +\def\hbar{\hslash} +\def\land{\wedge} +\def\lor{\vee} +\def\owns{\ni} +\def\gets{\leftarrow} +\def\mathring{\ocirc} +\def\lnot{\neg} +\def\backepsilon{\upbackepsilon} +\def\eth{\matheth} +\def\smallint{{\textstyle\int}\limits} +\@ifpackageloaded{amsmath}{ + % define their own colon, perhaps I should just steal it. (It does look much better.) +}{ + \cs_set_protected:Npn \colon { + \bool_if:NTF \g_um_literal_colon_bool {:} { \mathpunct{:} } + } +} +\def\mathrm{\mathup} +\let\mathfence\mathord +\def\digamma{\updigamma} +\def\Digamma{\upDigamma} +\def\operator@font{\um_switchto_mathup:} +\chk_if_free_cs:N \um_tmpa:w +\cs_new_protected_nopar:Npn \um_check_and_fix:NNnnnn #1 #2 #3 #4 #5 #6 { + \cs_if_exist:NT #1 { + \token_if_macro:NTF #1 { + \group_begin: + #2 \um_tmpa:w #3 { #4 } + \cs_if_eq:NNTF #1 \um_tmpa:w { + \msg_info:nnx { unicode-math } { patch-macro } + { \token_to_str:N #1 } + \group_end: + #2 #1 #3 + { #6 } + } { + \msg_warning:nnxxx { unicode-math } { wrong-meaning } + { \token_to_str:N #1 } { \token_to_meaning:N #1 } + { \token_to_meaning:N \um_tmpa:w } + \group_end: + } + } { + \msg_warning:nnx { unicode-math } { macro-expected } + { \token_to_str:N #1 } + } + } +} +\cs_new_protected_nopar:Npn \um_check_and_fix:NNnnn #1 #2 #3 #4 #5 { + \um_check_and_fix:NNnnnn #1 #2 { #3 } { #4 } { #5 } { #5 } +} +\cs_new_protected_nopar:Npn \um_check_and_fix_luatex:NNnnn #1 #2 #3 #4 #5 { + \luatex_if_engine:T { + \um_check_and_fix:NNnnn #1 #2 { #3 } { #4 } { #5 } + } +} +\cs_generate_variant:Nn \um_check_and_fix_luatex:NNnnn { c } +\AtEndOfPackageFile * {url} { + \tl_put_left:Nn \Url@FormatString { \um_switchto_mathup: } + \tl_put_right:Nn \UrlSpecials { + \do\`{\mathchar`\`} + \do\'{\mathchar`\'} + \do\${\mathchar`\$} + \do\&{\mathchar`\&} + } +} +\AtEndOfPackageFile * {amsmath} { + \tl_remove_once:Nn \@begindocumenthook { + \mathchardef\std@minus\mathcode`\-\relax + \mathchardef\std@equal\mathcode`\=\relax + } + \def\std@minus{\Umathcharnum\Umathcodenum`\-\relax} + \def\std@equal{\Umathcharnum\Umathcodenum`\=\relax} + \cs_set:Npn \@cdots {\mathinner{\cdots}} + \cs_set_eq:NN \dotsb@ \cdots + \def \resetMathstrut@ {% + \setbox\z@\hbox{$($}%) + \ht\Mathstrutbox@\ht\z@ \dp\Mathstrutbox@\dp\z@ + } + \um_check_and_fix:NNnnn \subarray \cs_set:Npn { #1 } { + \vcenter + \bgroup + \Let@ + \restore@math@cr + \default@tag + \baselineskip \fontdimen 10~ \scriptfont \tw@ + \advance \baselineskip \fontdimen 12~ \scriptfont \tw@ + \lineskip \thr@@ \fontdimen 8~ \scriptfont \thr@@ + \lineskiplimit \lineskip + \ialign + \bgroup + \ifx c #1 \hfil \fi + $ \m@th \scriptstyle ## $ + \hfil + \crcr + } { + \vcenter + \c_group_begin_token + \Let@ + \restore@math@cr + \default@tag + \skip_set:Nn \baselineskip { + \um_stack_num_up:N \scriptstyle + + \um_stack_denom_down:N \scriptstyle + } + \lineskip \um_stack_vgap:N \scriptstyle + \lineskiplimit \lineskip + \ialign + \c_group_begin_token + \token_if_eq_meaning:NNT c #1 { \hfil } + \c_math_toggle_token + \m@th + \scriptstyle + \c_parameter_token \c_parameter_token + \c_math_toggle_token + \hfil + \crcr + } + \um_check_and_fix_luatex:NNnnn \plainroot@ \cs_set_nopar:Npn { #1 \of #2 } { + \setbox \rootbox \hbox { + $ \m@th \scriptscriptstyle { #1 } $ + } + \mathchoice + { \r@@t \displaystyle { #2 } } + { \r@@t \textstyle { #2 } }~ + { \r@@t \scriptstyle { #2 } } + { \r@@t \scriptscriptstyle { #2 } } + \egroup + } { + \bool_if:nTF { + \int_compare_p:nNn { \uproot@ } = { \c_zero } + && \int_compare_p:nNn { \leftroot@ } = { \c_zero } + } { + \luatexUroot \l_um_radical_sqrt_tl { #1 } { #2 } + } { + \hbox_set:Nn \rootbox { + \c_math_toggle_token + \m@th + \scriptscriptstyle { #1 } + \c_math_toggle_token + } + \mathchoice + { \r@@t \displaystyle { #2 } } + { \r@@t \textstyle { #2 } } + { \r@@t \scriptstyle { #2 } } + { \r@@t \scriptscriptstyle { #2 } } + } + \c_group_end_token + } + \um_check_and_fix:NNnnnn \r@@t \cs_set_nopar:Npn { #1 #2 } { + \setboxz@h { $ \m@th #1 \sqrtsign { #2 } $ } + \dimen@ \ht\z@ + \advance \dimen@ -\dp\z@ + \setbox\@ne \hbox { $ \m@th #1 \mskip \uproot@ mu $ } + \advance \dimen@ by 1.667 \wd\@ne + \mkern -\leftroot@ mu + \mkern 5mu + \raise .6\dimen@ \copy\rootbox + \mkern -10mu + \mkern \leftroot@ mu + \boxz@ + } { + \hbox_set:Nn \l_tmpa_box { + \c_math_toggle_token + \m@th + #1 + \mskip \uproot@ mu + \c_math_toggle_token + } + \luatexUroot \l_um_radical_sqrt_tl { + \box_move_up:nn { \box_wd:N \l_tmpa_box } { + \hbox:n { + \c_math_toggle_token + \m@th + \mkern -\leftroot@ mu + \box_use:N \rootbox + \mkern \leftroot@ mu + \c_math_toggle_token + } + } + } { + #2 + } + } { + \hbox_set:Nn \l_tmpa_box { + \c_math_toggle_token + \m@th + #1 + \sqrtsign { #2 } + \c_math_toggle_token + } + \hbox_set:Nn \l_tmpb_box { + \c_math_toggle_token + \m@th + #1 + \mskip \uproot@ mu + \c_math_toggle_token + } + \mkern -\leftroot@ mu + \um_mathstyle_scale:Nnn #1 { \kern } { + \fontdimen 63 \l_um_font + } + \box_move_up:nn { + \box_wd:N \l_tmpb_box + + (\box_ht:N \l_tmpa_box - \box_dp:N \l_tmpa_box) + * \number \fontdimen 65 \l_um_font / 100 + } { + \box_use:N \rootbox + } + \um_mathstyle_scale:Nnn #1 { \kern } { + \fontdimen 64 \l_um_font + } + \mkern \leftroot@ mu + \box_use_clear:N \l_tmpa_box + } +} +\AtEndOfPackageFile * {amsopn} { + \cs_set:Npn \newmcodes@ { + \mathcode`\'39\scan_stop: + \mathcode`\*42\scan_stop: + \mathcode`\."613A\scan_stop: +%% \ifnum\mathcode`\-=45 \else +%% \mathchardef\std@minus\mathcode`\-\relax +%% \fi + \mathcode`\-45\scan_stop: + \mathcode`\/47\scan_stop: + \mathcode`\:"603A\scan_stop: + } +} +\cs_set:Npn \| {\Vert} +\cs_set:Npn \mathellipsis {\mathinner{\unicodeellipsis}} +\cs_set:Npn \cdots {\mathinner{\unicodecdots}} +\cs_new_protected_nopar:Nn \um_setup_accents: + { + \def\widehat{\hat} + \def\widetilde{\tilde} + \def\overrightarrow{\vec} + } +\cs_set_eq:NN \um_text_slash: \slash +\cs_set_protected:Npn \slash { + \mode_if_math:TF {\mathslash} {\um_text_slash:} +} +\AtEndOfPackageFile * { mathtools } { + \chk_if_free_cs:N \g_um_empty_fam + \newfam \g_um_empty_fam + \um_check_and_fix:NNnnn + \MT_cramped_internal:Nn \cs_set_nopar:Npn { #1 #2 } + { + \sbox \z@ { + $ + \m@th + #1 + \nulldelimiterspace = \z@ + \radical \z@ { #2 } + $ + } + \ifx #1 \displaystyle + \dimen@ = \fontdimen 8 \textfont 3 + \advance \dimen@ .25 \fontdimen 5 \textfont 2 + \else + \dimen@ = 1.25 \fontdimen 8 + \ifx #1 \textstyle + \textfont + \else + \ifx #1 \scriptstyle + \scriptfont + \else + \scriptscriptfont + \fi + \fi + 3 + \fi + \advance \dimen@ -\ht\z@ + \ht\z@ = -\dimen@ + \box\z@ + } + { + \hbox_set:Nn \l_tmpa_box { + \color@setgroup + \c_math_toggle_token + \m@th + #1 + \dim_zero:N \nulldelimiterspace + \XeTeXradical \g_um_empty_fam \c_zero { #2 } + \c_math_toggle_token + \color@endgroup + } + \box_set_ht:Nn \l_tmpa_box { + \box_ht:N \l_tmpa_box + - \um_radical_vgap:N #1 + } + \box_use_clear:N \l_tmpa_box + } + \msg_warning:nn { unicode-math } { mathtools } + \NewDocumentCommand \dblcolon { } { \Colon } + \NewDocumentCommand \coloneqq { } { \coloneq } + \NewDocumentCommand \Coloneqq { } { \Coloneq } + \NewDocumentCommand \eqqcolon { } { \eqcolon } +} +\AtEndOfPackageFile * { colonequals } { + \msg_warning:nn { unicode-math } { colonequals } + \RenewDocumentCommand \ratio { } { \mathratio } + \RenewDocumentCommand \coloncolon { } { \Colon } + \RenewDocumentCommand \minuscolon { } { \dashcolon } + \RenewDocumentCommand \colonequals { } { \coloneq } + \RenewDocumentCommand \equalscolon { } { \eqcolon } + \RenewDocumentCommand \coloncolonequals { } { \Coloneq } +} +\ExplSyntaxOff diff --git a/Master/texmf-dist/tex/latex/unicode-math/unicode-math.sty b/Master/texmf-dist/tex/latex/unicode-math/unicode-math.sty index 10187f64053..39631028f3f 100644 --- a/Master/texmf-dist/tex/latex/unicode-math/unicode-math.sty +++ b/Master/texmf-dist/tex/latex/unicode-math/unicode-math.sty @@ -6,7 +6,7 @@ %% %% unicode-math.dtx (with options: `preamble') %% unicode-math.dtx (with options: `msg') -%% unicode-math.dtx (with options: `package,stix') +%% unicode-math.dtx (with options: `load') %% Copyright 2006-2011 Will Robertson <will.robertson@latex-project.org> %% Copyright 2010-2011 Philipp Stephani <st_philipp@yahoo.de> %% @@ -16,7 +16,7 @@ %% %% This work is "author-maintained" by Will Robertson. \ProvidesPackage{unicode-math} - [2011/07/31 v0.5e Unicode maths in XeLaTeX and LuaLaTeX] + [2011/09/18 v0.6 Unicode maths in XeLaTeX and LuaLaTeX] \usepackage{ifxetex,ifluatex} \ifxetex\else\ifluatex\else \PackageError{unicode-math}{% @@ -24,25 +24,14 @@ Use XeLaTeX or LuaLaTeX instead.% }\@ehd \fi\fi -\RequirePackage{expl3}[2009/08/12] +\RequirePackage{expl3}[2011/07/01] \RequirePackage{xparse}[2009/08/31] \RequirePackage{l3keys2e} \RequirePackage{fontspec}[2010/10/25] \RequirePackage{catchfile} -\RequirePackage{trimspaces}% I'd like to incorporate this into expl3... \RequirePackage{fix-cm} % avoid some warnings \RequirePackage{filehook}[2011/01/03] \ExplSyntaxOn -\cs_if_exist:NF \char_set_catcode_other:N - { - \cs_set_eq:NN \c_math_toggle_token \c_math_shift_token - \cs_set_eq:NN \char_set_catcode_other:N \char_make_other:N - \cs_set_eq:NN \char_set_catcode_active:N \char_make_active:N - \cs_set_eq:NN \char_set_catcode_active:n \char_make_active:n - \cs_set_eq:NN \char_set_catcode_escape:N \char_make_escape:N - \cs_set_eq:NN \char_set_catcode_math_superscript:N - \char_make_math_superscript:N - } \cs_generate_variant:Nn \tl_put_right:Nn {cx} \cs_generate_variant:Nn \seq_if_in:NnTF {NV} \cs_generate_variant:Nn \prop_gput:Nnn {Nxn} @@ -53,13 +42,11 @@ \cs:w #3 \exp_after:wN \cs_end: \cs:w #4 \cs_end: } +\cs_set_eq:NN \tl_replace_in:Nnn \tl_replace_once:Nnn \cs_new_protected_nopar:Npn \bool_const:Nn #1 #2 { \bool_new:N #1 \bool_set:Nn #1 { #2 } } -\bool_const:Nn \c_um_have_fixed_accents_bool { - \c_luatex_is_engine_bool && \int_compare_p:n { \luatexversion > 64 } -} \bool_new:N \l_um_ot_math_bool \bool_new:N \l_um_init_bool \bool_new:N \l_um_implicit_alph_bool @@ -81,16 +68,16 @@ \bool_new:N \g_um_literal_Nabla_bool \bool_new:N \g_um_literal_partial_bool \bool_new:N \g_um_texgreek_bool -\bool_gset_true:N \g_um_texgreek_bool +\bool_set_true:N \g_um_texgreek_bool \bool_new:N \l_um_smallfrac_bool \bool_new:N \g_um_literal_colon_bool \int_new:N \g_um_fam_int -\tl_set:Nn \g_um_math_alphabet_name_latin_tl {Latin,~lowercase} -\tl_set:Nn \g_um_math_alphabet_name_Latin_tl {Latin,~uppercase} -\tl_set:Nn \g_um_math_alphabet_name_greek_tl {Greek,~lowercase} -\tl_set:Nn \g_um_math_alphabet_name_Greek_tl {Greek,~uppercase} -\tl_set:Nn \g_um_math_alphabet_name_num_tl {Numerals} -\tl_set:Nn \g_um_math_alphabet_name_misc_tl {Misc.} +\tl_const:Nn \c_um_math_alphabet_name_latin_tl {Latin,~lowercase} +\tl_const:Nn \c_um_math_alphabet_name_Latin_tl {Latin,~uppercase} +\tl_const:Nn \c_um_math_alphabet_name_greek_tl {Greek,~lowercase} +\tl_const:Nn \c_um_math_alphabet_name_Greek_tl {Greek,~uppercase} +\tl_const:Nn \c_um_math_alphabet_name_num_tl {Numerals} +\tl_const:Nn \c_um_math_alphabet_name_misc_tl {Misc.} \prg_new_conditional:Nnn \um_glyph_if_exist:n {p,TF,T,F} { \iffontchar \l_um_font #1 \scan_stop: \prg_return_true: @@ -102,514 +89,10 @@ \cs_generate_variant:Nn \um_glyph_if_exist:nTF {c} \cs_generate_variant:Nn \um_glyph_if_exist:nT {c} \cs_generate_variant:Nn \um_glyph_if_exist:nF {c} -\xetex_or_luatex:nnn { \cs_new:Npn \um_cs_compat:n #1 } - { \cs_set_eq:cc {U#1} {XeTeX#1} } - { \cs_set_eq:cc {U#1} {luatexU#1} } -\um_cs_compat:n {mathcode} -\um_cs_compat:n {delcode} -\um_cs_compat:n {mathcodenum} -\um_cs_compat:n {mathcharnum} -\um_cs_compat:n {mathchardef} -\um_cs_compat:n {radical} -\um_cs_compat:n {mathaccent} -\um_cs_compat:n {delimiter} -\luatex_if_engine:T { - \RequirePackage { lualatex-math } [ 2011/05/05 ] -} -\cs_generate_variant:Nn \fontspec_select:nn {x} -\luatex_if_engine:T { - \RequirePackage { luatexbase } - \RequirePackage { luaotfload } [ 2010/11/26 ] - \RequireLuaModule { unicode-math } [ 2011/04/23 ] -} -\cs_new:Npn \um_warning:n { \msg_warning:nn {unicode-math} } -\cs_new:Npn \um_trace:n { \msg_trace:nn {unicode-math} } -\cs_new:Npn \um_trace:nx { \msg_trace:nnx {unicode-math} } -\msg_new:nnn {unicode-math} {disable-beamer} -{ - Disabling~ beamer's~ math~ setup.\\ - Please~ load~ beamer~ with~ the~ [professionalfonts]~ class~ option. -} -\msg_new:nnn {unicode-math} {no-tfrac} -{ - Small~ fraction~ command~ \protect\tfrac\ not~ defined.\\ - Load~ amsmath~ or~ define~ it~ manually~ before~ loading~ unicode-math. -} -\msg_new:nnn {unicode-math} {default-math-font} -{ - Defining~ the~ default~ maths~ font~ as~ '#1'. -} -\msg_new:nnn {unicode-math} {setup-implicit} -{ - Setup~ alphabets:~ implicit~ mode. -} -\msg_new:nnn {unicode-math} {setup-explicit} -{ - Setup~ alphabets:~ explicit~ mode. -} -\msg_new:nnn {unicode-math} {alph-initialise} -{ - Initialising~ \@backslashchar math#1. -} -\msg_new:nnn {unicode-math} {setup-alph} -{ - Setup~ alphabet:~ #1. -} -\msg_new:nnnn { unicode-math } { no-font-selected } { - You've~ loaded~ the~ unicode-math~ package,~ but~ you~ forgot~ to~ select \\ - a~ Unicode~ math~ font.~ Please~ select~ one~ with~ the~ \token_to_str:N \setmathfont \\ - command. -} { - Loading~ the~ unicode-math~ package~ without~ using~ a~ Unicode~ math~ font \\ - is~ not~ supported.~ Either~ select~ a~ Unicode~ math~ font,~ or~ don't~ load \\ - the~ unicode-math~ package. -} -\msg_new:nnn {unicode-math} {macro-expected} -{ - I've~ expected~ that~ #1~ is~ a~ macro,~ but~ it~ isn't. -} -\msg_new:nnn {unicode-math} {wrong-meaning} -{ - I've~ expected~ #1~ to~ have~ the~ meaning~ #3,~ but~ it~ has~ the~ meaning~ #2. -} -\msg_new:nnn {unicode-math} {patch-macro} -{ - I'm~ going~ to~ patch~ macro~ #1. -} -\msg_new:nnn { unicode-math } { mathtools } { - I'm~ going~ to~ overwrite~ the~ following~ commands~ from \\ - the~ `mathtools'~ package: \\ - \token_to_str:N \dblcolon,~ - \token_to_str:N \coloneqq,~ - \token_to_str:N \Coloneqq,~ - \token_to_str:N \eqqcolon. \\ - Note~ that~ since~ I~ won't~ overwrite~ the~ other~ colon-like \\ - commands,~ using~ them~ will~ lead~ to~ inconsistencies. -} -\msg_new:nnn { unicode-math } { colonequals } { - I'm~ going~ to~ overwrite~ the~ following~ commands~ from \\ - the~ `colonequals'~ package: \\ - \token_to_str:N \ratio,~ - \token_to_str:N \coloncolon,~ - \token_to_str:N \minuscolon, \\ - \token_to_str:N \colonequals,~ - \token_to_str:N \equalscolon,~ - \token_to_str:N \coloncolonequals. \\ - Note~ that~ since~ I~ won't~ overwrite~ the~ other~ colon-like \\ - commands,~ using~ them~ will~ lead~ to~ inconsistencies. \\ - Furthermore,~ changing~ \token_to_str:N \colonsep \c_space_tl - or~ \token_to_str:N \doublecolonsep \c_space_tl won't~ have \\ - any~ effect~ on~ the~ re-defined~ commands. -} -\cs_new:Npn \usv_set:nnn #1#2#3 { - \tl_set:cn { \um_to_usv:nn {#1}{#2} } {#3} -} -\cs_new:Npn \um_to_usv:nn #1#2 { g_um_#1_#2_usv } -\usv_set:nnn {up}{num}{48} -\usv_set:nnn {up}{Latin}{65} -\usv_set:nnn {up}{latin}{97} -\usv_set:nnn {up}{Greek}{"391} -\usv_set:nnn {up}{greek}{"3B1} -\usv_set:nnn {it}{Latin}{"1D434} -\usv_set:nnn {it}{latin}{"1D44E} -\usv_set:nnn {it}{Greek}{"1D6E2} -\usv_set:nnn {it}{greek}{"1D6FC} -\usv_set:nnn {bb}{num}{"1D7D8} -\usv_set:nnn {bb}{Latin}{"1D538} -\usv_set:nnn {bb}{latin}{"1D552} -\usv_set:nnn {scr}{Latin}{"1D49C} -\usv_set:nnn {cal}{Latin}{"1D49C} -\usv_set:nnn {scr}{latin}{"1D4B6} -\usv_set:nnn {frak}{Latin}{"1D504} -\usv_set:nnn {frak}{latin}{"1D51E} -\usv_set:nnn {sf}{num}{"1D7E2} -\usv_set:nnn {sfup}{num}{"1D7E2} -\usv_set:nnn {sfit}{num}{"1D7E2} -\usv_set:nnn {sfup}{Latin}{"1D5A0} -\usv_set:nnn {sf}{Latin}{"1D5A0} -\usv_set:nnn {sfup}{latin}{"1D5BA} -\usv_set:nnn {sf}{latin}{"1D5BA} -\usv_set:nnn {sfit}{Latin}{"1D608} -\usv_set:nnn {sfit}{latin}{"1D622} -\usv_set:nnn {tt}{num}{"1D7F6} -\usv_set:nnn {tt}{Latin}{"1D670} -\usv_set:nnn {tt}{latin}{"1D68A} -\usv_set:nnn {bf}{num}{"1D7CE} -\usv_set:nnn {bfup}{num}{"1D7CE} -\usv_set:nnn {bfit}{num}{"1D7CE} -\usv_set:nnn {bfup}{Latin}{"1D400} -\usv_set:nnn {bfup}{latin}{"1D41A} -\usv_set:nnn {bfup}{Greek}{"1D6A8} -\usv_set:nnn {bfup}{greek}{"1D6C2} -\usv_set:nnn {bfit}{Latin}{"1D468} -\usv_set:nnn {bfit}{latin}{"1D482} -\usv_set:nnn {bfit}{Greek}{"1D71C} -\usv_set:nnn {bfit}{greek}{"1D736} -\usv_set:nnn {bffrak}{Latin}{"1D56C} -\usv_set:nnn {bffrak}{latin}{"1D586} -\usv_set:nnn {bfscr}{Latin}{"1D4D0} -\usv_set:nnn {bfcal}{Latin}{"1D4D0} -\usv_set:nnn {bfscr}{latin}{"1D4EA} -\usv_set:nnn {bfsf}{num}{"1D7EC} -\usv_set:nnn {bfsfup}{num}{"1D7EC} -\usv_set:nnn {bfsfit}{num}{"1D7EC} -\usv_set:nnn {bfsfup}{Latin}{"1D5D4} -\usv_set:nnn {bfsfup}{latin}{"1D5EE} -\usv_set:nnn {bfsfup}{Greek}{"1D756} -\usv_set:nnn {bfsfup}{greek}{"1D770} -\usv_set:nnn {bfsfit}{Latin}{"1D63C} -\usv_set:nnn {bfsfit}{latin}{"1D656} -\usv_set:nnn {bfsfit}{Greek}{"1D790} -\usv_set:nnn {bfsfit}{greek}{"1D7AA} -\usv_set:nnn {bfsf}{Latin}{ \bool_if:NTF \g_um_upLatin_bool \g_um_bfsfup_Latin_usv \g_um_bfsfit_Latin_usv } -\usv_set:nnn {bfsf}{latin}{ \bool_if:NTF \g_um_uplatin_bool \g_um_bfsfup_latin_usv \g_um_bfsfit_latin_usv } -\usv_set:nnn {bfsf}{Greek}{ \bool_if:NTF \g_um_upGreek_bool \g_um_bfsfup_Greek_usv \g_um_bfsfit_Greek_usv } -\usv_set:nnn {bfsf}{greek}{ \bool_if:NTF \g_um_upgreek_bool \g_um_bfsfup_greek_usv \g_um_bfsfit_greek_usv } -\usv_set:nnn {bf}{Latin}{ \bool_if:NTF \g_um_bfupLatin_bool \g_um_bfup_Latin_usv \g_um_bfit_Latin_usv } -\usv_set:nnn {bf}{latin}{ \bool_if:NTF \g_um_bfuplatin_bool \g_um_bfup_latin_usv \g_um_bfit_latin_usv } -\usv_set:nnn {bf}{Greek}{ \bool_if:NTF \g_um_bfupGreek_bool \g_um_bfup_Greek_usv \g_um_bfit_Greek_usv } -\usv_set:nnn {bf}{greek}{ \bool_if:NTF \g_um_bfupgreek_bool \g_um_bfup_greek_usv \g_um_bfit_greek_usv } -\usv_set:nnn {up}{varTheta}{"3F4} -\usv_set:nnn {up}{Digamma}{"3DC} -\usv_set:nnn {up}{varepsilon}{"3F5} -\usv_set:nnn {up}{vartheta}{"3D1} -\usv_set:nnn {up}{varkappa}{"3F0} -\usv_set:nnn {up}{varphi}{"3D5} -\usv_set:nnn {up}{varrho}{"3F1} -\usv_set:nnn {up}{varpi}{"3D6} -\usv_set:nnn {up}{digamma}{"3DD} -\usv_set:nnn {bfup}{varTheta}{"1D6B9} -\usv_set:nnn {bfup}{Digamma}{"1D7CA} -\usv_set:nnn {bfup}{varepsilon}{"1D6DC} -\usv_set:nnn {bfup}{vartheta}{"1D6DD} -\usv_set:nnn {bfup}{varkappa}{"1D6DE} -\usv_set:nnn {bfup}{varphi}{"1D6DF} -\usv_set:nnn {bfup}{varrho}{"1D6E0} -\usv_set:nnn {bfup}{varpi}{"1D6E1} -\usv_set:nnn {bfup}{digamma}{"1D7CB} -\usv_set:nnn {it}{varTheta}{"1D6F3} -\usv_set:nnn {it}{varepsilon}{"1D716} -\usv_set:nnn {it}{vartheta}{"1D717} -\usv_set:nnn {it}{varkappa}{"1D718} -\usv_set:nnn {it}{varphi}{"1D719} -\usv_set:nnn {it}{varrho}{"1D71A} -\usv_set:nnn {it}{varpi}{"1D71B} -\usv_set:nnn {bfit}{varTheta}{"1D72D} -\usv_set:nnn {bfit}{varepsilon}{"1D750} -\usv_set:nnn {bfit}{vartheta}{"1D751} -\usv_set:nnn {bfit}{varkappa}{"1D752} -\usv_set:nnn {bfit}{varphi}{"1D753} -\usv_set:nnn {bfit}{varrho}{"1D754} -\usv_set:nnn {bfit}{varpi}{"1D755} -\usv_set:nnn {bfsfup}{varTheta}{"1D767} -\usv_set:nnn {bfsfup}{varepsilon}{"1D78A} -\usv_set:nnn {bfsfup}{vartheta}{"1D78B} -\usv_set:nnn {bfsfup}{varkappa}{"1D78C} -\usv_set:nnn {bfsfup}{varphi}{"1D78D} -\usv_set:nnn {bfsfup}{varrho}{"1D78E} -\usv_set:nnn {bfsfup}{varpi}{"1D78F} -\usv_set:nnn {bfsfit}{varTheta} {"1D7A1} -\usv_set:nnn {bfsfit}{varepsilon}{"1D7C4} -\usv_set:nnn {bfsfit}{vartheta} {"1D7C5} -\usv_set:nnn {bfsfit}{varkappa} {"1D7C6} -\usv_set:nnn {bfsfit}{varphi} {"1D7C7} -\usv_set:nnn {bfsfit}{varrho} {"1D7C8} -\usv_set:nnn {bfsfit}{varpi} {"1D7C9} -\usv_set:nnn {up} {Nabla}{"02207} -\usv_set:nnn {it} {Nabla}{"1D6FB} -\usv_set:nnn {bfup} {Nabla}{"1D6C1} -\usv_set:nnn {bfit} {Nabla}{"1D735} -\usv_set:nnn {bfsfup}{Nabla}{"1D76F} -\usv_set:nnn {bfsfit}{Nabla}{"1D7A9} -\usv_set:nnn {up} {partial}{"02202} -\usv_set:nnn {it} {partial}{"1D715} -\usv_set:nnn {bfup} {partial}{"1D6DB} -\usv_set:nnn {bfit} {partial}{"1D74F} -\usv_set:nnn {bfsfup}{partial}{"1D789} -\usv_set:nnn {bfsfit}{partial}{"1D7C3} -\usv_set:nnn {up}{B}{`\B} -\usv_set:nnn {up}{C}{`\C} -\usv_set:nnn {up}{D}{`\D} -\usv_set:nnn {up}{E}{`\E} -\usv_set:nnn {up}{F}{`\F} -\usv_set:nnn {up}{H}{`\H} -\usv_set:nnn {up}{I}{`\I} -\usv_set:nnn {up}{L}{`\L} -\usv_set:nnn {up}{M}{`\M} -\usv_set:nnn {up}{N}{`\N} -\usv_set:nnn {up}{P}{`\P} -\usv_set:nnn {up}{Q}{`\Q} -\usv_set:nnn {up}{R}{`\R} -\usv_set:nnn {up}{Z}{`\Z} -\usv_set:nnn {it}{B}{"1D435} -\usv_set:nnn {it}{C}{"1D436} -\usv_set:nnn {it}{D}{"1D437} -\usv_set:nnn {it}{E}{"1D438} -\usv_set:nnn {it}{F}{"1D439} -\usv_set:nnn {it}{H}{"1D43B} -\usv_set:nnn {it}{I}{"1D43C} -\usv_set:nnn {it}{L}{"1D43F} -\usv_set:nnn {it}{M}{"1D440} -\usv_set:nnn {it}{N}{"1D441} -\usv_set:nnn {it}{P}{"1D443} -\usv_set:nnn {it}{Q}{"1D444} -\usv_set:nnn {it}{R}{"1D445} -\usv_set:nnn {it}{Z}{"1D44D} -\usv_set:nnn {up}{d}{`\d} -\usv_set:nnn {up}{e}{`\e} -\usv_set:nnn {up}{g}{`\g} -\usv_set:nnn {up}{h}{`\h} -\usv_set:nnn {up}{i}{`\i} -\usv_set:nnn {up}{j}{`\j} -\usv_set:nnn {up}{o}{`\o} -\usv_set:nnn {it}{d}{"1D451} -\usv_set:nnn {it}{e}{"1D452} -\usv_set:nnn {it}{g}{"1D454} -\usv_set:nnn {it}{h}{"0210E} -\usv_set:nnn {it}{i}{"1D456} -\usv_set:nnn {it}{j}{"1D457} -\usv_set:nnn {it}{o}{"1D45C} -\usv_set:nnn {bb} {h}{"1D559} -\usv_set:nnn {tt} {h}{"1D691} -\usv_set:nnn {scr} {h}{"1D4BD} -\usv_set:nnn {frak} {h}{"1D525} -\usv_set:nnn {bfup} {h}{"1D421} -\usv_set:nnn {bfit} {h}{"1D489} -\usv_set:nnn {sfup} {h}{"1D5C1} -\usv_set:nnn {sfit} {h}{"1D629} -\usv_set:nnn {bffrak}{h}{"1D58D} -\usv_set:nnn {bfscr} {h}{"1D4F1} -\usv_set:nnn {bfsfup}{h}{"1D5F5} -\usv_set:nnn {bfsfit}{h}{"1D65D} -\usv_set:nnn {up}{dotlessi}{"00131} -\usv_set:nnn {up}{dotlessj}{"00237} -\usv_set:nnn {it}{dotlessi}{"1D6A4} -\usv_set:nnn {it}{dotlessj}{"1D6A5} -\usv_set:nnn {bb}{C}{"2102} -\usv_set:nnn {bb}{H}{"210D} -\usv_set:nnn {bb}{N}{"2115} -\usv_set:nnn {bb}{P}{"2119} -\usv_set:nnn {bb}{Q}{"211A} -\usv_set:nnn {bb}{R}{"211D} -\usv_set:nnn {bb}{Z}{"2124} -\usv_set:nnn {up}{Pi} {"003A0} -\usv_set:nnn {up}{pi} {"003C0} -\usv_set:nnn {up}{Gamma} {"00393} -\usv_set:nnn {up}{gamma} {"003B3} -\usv_set:nnn {up}{summation}{"02211} -\usv_set:nnn {it}{Pi} {"1D6F1} -\usv_set:nnn {it}{pi} {"1D70B} -\usv_set:nnn {it}{Gamma} {"1D6E4} -\usv_set:nnn {it}{gamma} {"1D6FE} -\usv_set:nnn {bb}{Pi} {"0213F} -\usv_set:nnn {bb}{pi} {"0213C} -\usv_set:nnn {bb}{Gamma} {"0213E} -\usv_set:nnn {bb}{gamma} {"0213D} -\usv_set:nnn {bb}{summation}{"02140} -\usv_set:nnn {bbit}{D}{"2145} -\usv_set:nnn {bbit}{d}{"2146} -\usv_set:nnn {bbit}{e}{"2147} -\usv_set:nnn {bbit}{i}{"2148} -\usv_set:nnn {bbit}{j}{"2149} -\usv_set:nnn {scr}{B}{"212C} -\usv_set:nnn {scr}{E}{"2130} -\usv_set:nnn {scr}{F}{"2131} -\usv_set:nnn {scr}{H}{"210B} -\usv_set:nnn {scr}{I}{"2110} -\usv_set:nnn {scr}{L}{"2112} -\usv_set:nnn {scr}{M}{"2133} -\usv_set:nnn {scr}{R}{"211B} -\usv_set:nnn {scr}{e}{"212F} -\usv_set:nnn {scr}{g}{"210A} -\usv_set:nnn {scr}{o}{"2134} -\usv_set:nnn {cal}{B}{"212C} -\usv_set:nnn {cal}{E}{"2130} -\usv_set:nnn {cal}{F}{"2131} -\usv_set:nnn {cal}{H}{"210B} -\usv_set:nnn {cal}{I}{"2110} -\usv_set:nnn {cal}{L}{"2112} -\usv_set:nnn {cal}{M}{"2133} -\usv_set:nnn {cal}{R}{"211B} -\usv_set:nnn {frak}{C}{"212D} -\usv_set:nnn {frak}{H}{"210C} -\usv_set:nnn {frak}{I}{"2111} -\usv_set:nnn {frak}{R}{"211C} -\usv_set:nnn {frak}{Z}{"2128} -\usv_set:nnn {stixsfup}{partial}{"E17C} -\usv_set:nnn {stixsfup}{Greek}{"E17D} -\usv_set:nnn {stixsfup}{greek}{"E196} -\usv_set:nnn {stixsfup}{varTheta}{"E18E} -\usv_set:nnn {stixsfup}{varepsilon}{"E1AF} -\usv_set:nnn {stixsfup}{vartheta}{"E1B0} -\usv_set:nnn {stixsfup}{varkappa}{0000} % ??? -\usv_set:nnn {stixsfup}{varphi}{"E1B1} -\usv_set:nnn {stixsfup}{varrho}{"E1B2} -\usv_set:nnn {stixsfup}{varpi}{"E1B3} -\usv_set:nnn {stixupslash}{Greek}{"E2FC} -\usv_set:nnn {stixbbit}{A}{"E154} -\usv_set:nnn {stixbbit}{B}{"E155} -\usv_set:nnn {stixbbit}{E}{"E156} -\usv_set:nnn {stixbbit}{F}{"E157} -\usv_set:nnn {stixbbit}{G}{"E158} -\usv_set:nnn {stixbbit}{I}{"E159} -\usv_set:nnn {stixbbit}{J}{"E15A} -\usv_set:nnn {stixbbit}{K}{"E15B} -\usv_set:nnn {stixbbit}{L}{"E15C} -\usv_set:nnn {stixbbit}{M}{"E15D} -\usv_set:nnn {stixbbit}{O}{"E15E} -\usv_set:nnn {stixbbit}{S}{"E15F} -\usv_set:nnn {stixbbit}{T}{"E160} -\usv_set:nnn {stixbbit}{U}{"E161} -\usv_set:nnn {stixbbit}{V}{"E162} -\usv_set:nnn {stixbbit}{W}{"E163} -\usv_set:nnn {stixbbit}{X}{"E164} -\usv_set:nnn {stixbbit}{Y}{"E165} -\usv_set:nnn {stixbbit}{a}{"E166} -\usv_set:nnn {stixbbit}{b}{"E167} -\usv_set:nnn {stixbbit}{c}{"E168} -\usv_set:nnn {stixbbit}{f}{"E169} -\usv_set:nnn {stixbbit}{g}{"E16A} -\usv_set:nnn {stixbbit}{h}{"E16B} -\usv_set:nnn {stixbbit}{k}{"E16C} -\usv_set:nnn {stixbbit}{l}{"E16D} -\usv_set:nnn {stixbbit}{m}{"E16E} -\usv_set:nnn {stixbbit}{n}{"E16F} -\usv_set:nnn {stixbbit}{o}{"E170} -\usv_set:nnn {stixbbit}{p}{"E171} -\usv_set:nnn {stixbbit}{q}{"E172} -\usv_set:nnn {stixbbit}{r}{"E173} -\usv_set:nnn {stixbbit}{s}{"E174} -\usv_set:nnn {stixbbit}{t}{"E175} -\usv_set:nnn {stixbbit}{u}{"E176} -\usv_set:nnn {stixbbit}{v}{"E177} -\usv_set:nnn {stixbbit}{w}{"E178} -\usv_set:nnn {stixbbit}{x}{"E179} -\usv_set:nnn {stixbbit}{y}{"E17A} -\usv_set:nnn {stixbbit}{z}{"E17B} -\usv_set:nnn {stixsfit}{Numerals}{"E1B4} -\usv_set:nnn {stixsfit}{partial}{"E1BE} -\usv_set:nnn {stixsfit}{Greek}{"E1BF} -\usv_set:nnn {stixsfit}{greek}{"E1D8} -\usv_set:nnn {stixsfit}{varTheta}{"E1D0} -\usv_set:nnn {stixsfit}{varepsilon}{"E1F1} -\usv_set:nnn {stixsfit}{vartheta}{"E1F2} -\usv_set:nnn {stixsfit}{varkappa}{0000} % ??? -\usv_set:nnn {stixsfit}{varphi}{"E1F3} -\usv_set:nnn {stixsfit}{varrho}{"E1F4} -\usv_set:nnn {stixsfit}{varpi}{"E1F5} -\usv_set:nnn {stixcal}{Latin}{"E22D} -\usv_set:nnn {stixcal}{num}{"E262} -\usv_set:nnn {scr}{num}{48} -\usv_set:nnn {it}{num}{48} -\usv_set:nnn {stixsfitslash}{Latin}{"E294} -\usv_set:nnn {stixsfitslash}{latin}{"E2C8} -\usv_set:nnn {stixsfitslash}{greek}{"E32C} -\usv_set:nnn {stixsfitslash}{varepsilon}{"E37A} -\usv_set:nnn {stixsfitslash}{vartheta}{"E35E} -\usv_set:nnn {stixsfitslash}{varkappa}{"E374} -\usv_set:nnn {stixsfitslash}{varphi}{"E360} -\usv_set:nnn {stixsfitslash}{varrho}{"E376} -\usv_set:nnn {stixsfitslash}{varpi}{"E362} -\usv_set:nnn {stixsfitslash}{digamma}{"E36A} -\usv_set:nnn {stixbfupslash}{Greek}{"E2FD} -\usv_set:nnn {stixbfupslash}{Digamma}{"E369} -\usv_set:nnn {stixbfbb}{A}{"E38A} -\usv_set:nnn {stixbfbb}{B}{"E38B} -\usv_set:nnn {stixbfbb}{E}{"E38D} -\usv_set:nnn {stixbfbb}{F}{"E38E} -\usv_set:nnn {stixbfbb}{G}{"E38F} -\usv_set:nnn {stixbfbb}{I}{"E390} -\usv_set:nnn {stixbfbb}{J}{"E391} -\usv_set:nnn {stixbfbb}{K}{"E392} -\usv_set:nnn {stixbfbb}{L}{"E393} -\usv_set:nnn {stixbfbb}{M}{"E394} -\usv_set:nnn {stixbfbb}{O}{"E395} -\usv_set:nnn {stixbfbb}{S}{"E396} -\usv_set:nnn {stixbfbb}{T}{"E397} -\usv_set:nnn {stixbfbb}{U}{"E398} -\usv_set:nnn {stixbfbb}{V}{"E399} -\usv_set:nnn {stixbfbb}{W}{"E39A} -\usv_set:nnn {stixbfbb}{X}{"E39B} -\usv_set:nnn {stixbfbb}{Y}{"E39C} -\usv_set:nnn {stixbfbb}{a}{"E39D} -\usv_set:nnn {stixbfbb}{b}{"E39E} -\usv_set:nnn {stixbfbb}{c}{"E39F} -\usv_set:nnn {stixbfbb}{f}{"E3A2} -\usv_set:nnn {stixbfbb}{g}{"E3A3} -\usv_set:nnn {stixbfbb}{h}{"E3A4} -\usv_set:nnn {stixbfbb}{k}{"E3A7} -\usv_set:nnn {stixbfbb}{l}{"E3A8} -\usv_set:nnn {stixbfbb}{m}{"E3A9} -\usv_set:nnn {stixbfbb}{n}{"E3AA} -\usv_set:nnn {stixbfbb}{o}{"E3AB} -\usv_set:nnn {stixbfbb}{p}{"E3AC} -\usv_set:nnn {stixbfbb}{q}{"E3AD} -\usv_set:nnn {stixbfbb}{r}{"E3AE} -\usv_set:nnn {stixbfbb}{s}{"E3AF} -\usv_set:nnn {stixbfbb}{t}{"E3B0} -\usv_set:nnn {stixbfbb}{u}{"E3B1} -\usv_set:nnn {stixbfbb}{v}{"E3B2} -\usv_set:nnn {stixbfbb}{w}{"E3B3} -\usv_set:nnn {stixbfbb}{x}{"E3B4} -\usv_set:nnn {stixbfbb}{y}{"E3B5} -\usv_set:nnn {stixbfbb}{z}{"E3B6} -\usv_set:nnn {stixbfsfup}{Numerals}{"E3B7} -\usv_set:nnn {stixbfsfit}{Numerals}{"E1F6} -\usv_set:nnn {stixbfbbit}{A}{"E200} -\usv_set:nnn {stixbfbbit}{B}{"E201} -\usv_set:nnn {stixbfbbit}{E}{"E203} -\usv_set:nnn {stixbfbbit}{F}{"E204} -\usv_set:nnn {stixbfbbit}{G}{"E205} -\usv_set:nnn {stixbfbbit}{I}{"E206} -\usv_set:nnn {stixbfbbit}{J}{"E207} -\usv_set:nnn {stixbfbbit}{K}{"E208} -\usv_set:nnn {stixbfbbit}{L}{"E209} -\usv_set:nnn {stixbfbbit}{M}{"E20A} -\usv_set:nnn {stixbfbbit}{O}{"E20B} -\usv_set:nnn {stixbfbbit}{S}{"E20C} -\usv_set:nnn {stixbfbbit}{T}{"E20D} -\usv_set:nnn {stixbfbbit}{U}{"E20E} -\usv_set:nnn {stixbfbbit}{V}{"E20F} -\usv_set:nnn {stixbfbbit}{W}{"E210} -\usv_set:nnn {stixbfbbit}{X}{"E211} -\usv_set:nnn {stixbfbbit}{Y}{"E212} -\usv_set:nnn {stixbfbbit}{a}{"E213} -\usv_set:nnn {stixbfbbit}{b}{"E214} -\usv_set:nnn {stixbfbbit}{c}{"E215} -\usv_set:nnn {stixbfbbit}{e}{"E217} -\usv_set:nnn {stixbfbbit}{f}{"E218} -\usv_set:nnn {stixbfbbit}{g}{"E219} -\usv_set:nnn {stixbfbbit}{h}{"E21A} -\usv_set:nnn {stixbfbbit}{k}{"E21D} -\usv_set:nnn {stixbfbbit}{l}{"E21E} -\usv_set:nnn {stixbfbbit}{m}{"E21F} -\usv_set:nnn {stixbfbbit}{n}{"E220} -\usv_set:nnn {stixbfbbit}{o}{"E221} -\usv_set:nnn {stixbfbbit}{p}{"E222} -\usv_set:nnn {stixbfbbit}{q}{"E223} -\usv_set:nnn {stixbfbbit}{r}{"E224} -\usv_set:nnn {stixbfbbit}{s}{"E225} -\usv_set:nnn {stixbfbbit}{t}{"E226} -\usv_set:nnn {stixbfbbit}{u}{"E227} -\usv_set:nnn {stixbfbbit}{v}{"E228} -\usv_set:nnn {stixbfbbit}{w}{"E229} -\usv_set:nnn {stixbfbbit}{x}{"E22A} -\usv_set:nnn {stixbfbbit}{y}{"E22B} -\usv_set:nnn {stixbfbbit}{z}{"E22C} -\usv_set:nnn {stixbfcal}{Latin}{"E247} -\usv_set:nnn {stixbfitslash}{Latin}{"E295} -\usv_set:nnn {stixbfitslash}{latin}{"E2C9} -\usv_set:nnn {stixbfitslash}{greek}{"E32D} -\usv_set:nnn {stixsfitslash}{varepsilon}{"E37B} -\usv_set:nnn {stixsfitslash}{vartheta}{"E35F} -\usv_set:nnn {stixsfitslash}{varkappa}{"E375} -\usv_set:nnn {stixsfitslash}{varphi}{"E361} -\usv_set:nnn {stixsfitslash}{varrho}{"E377} -\usv_set:nnn {stixsfitslash}{varpi}{"E363} -\usv_set:nnn {stixsfitslash}{digamma}{"E36B} +\cs_generate_variant:Nn \fontspec_set_family:Nnn {Nx} +\cs_generate_variant:Nn \fontspec_set_fontface:NNnn {NNx} \DeclareDocumentCommand \unimathsetup {m} { - \clist_clear:N \l_um_unknown_keys_clist - \keys_set:nn {unicode-math} {#1} + \keys_set:nn {unicode-math} {#1} } \keys_define:nn {unicode-math} { normal-style .choice_code:n = @@ -800,23 +283,15 @@ \keys_define:nn {unicode-math} { trace .choice: , trace / debug .code:n = { - \msg_redirect_module:nnn { unicode-math } { trace } { warning } + \msg_redirect_module:nnn { unicode-math } { log } { warning } } , trace / on .code:n = { - \msg_redirect_module:nnn { unicode-math } { trace } { trace } + % default } , trace / off .code:n = { - \msg_redirect_module:nnn { unicode-math } { trace } { none } + \msg_redirect_module:nnn { unicode-math } { log } { none } } , } -\clist_new:N \l_um_unknown_keys_clist -\keys_define:nn {unicode-math} { - unknown .code:n = { - \clist_put_right:No \l_um_unknown_keys_clist { - \l_keys_key_tl = {#1} - } - } -} \unimathsetup {math-style=TeX} \unimathsetup {slash-delimiter=ascii} \unimathsetup {trace=off} @@ -824,2384 +299,85 @@ \unimathsetup {active-frac=small} } \ProcessKeysOptions {unicode-math} -\tl_map_inline:nn { - \new@mathgroup\cdp@list\cdp@elt\DeclareMathSizes - \@DeclareMathSizes\newmathalphabet\newmathalphabet@@\newmathalphabet@@@ - \DeclareMathVersion\define@mathalphabet\define@mathgroup\addtoversion - \version@list\version@elt\alpha@list\alpha@elt - \restore@mathversion\init@restore@version\dorestore@version\process@table - \new@mathversion\DeclareSymbolFont\group@list\group@elt - \new@symbolfont\SetSymbolFont\SetSymbolFont@\get@cdp - \DeclareMathAlphabet\new@mathalphabet\SetMathAlphabet\SetMathAlphabet@ - \DeclareMathAccent\set@mathaccent\DeclareMathSymbol\set@mathchar - \set@mathsymbol\DeclareMathDelimiter\@xxDeclareMathDelimiter - \@DeclareMathDelimiter\@xDeclareMathDelimiter\set@mathdelimiter - \set@@mathdelimiter\DeclareMathRadical\mathchar@type - \DeclareSymbolFontAlphabet\DeclareSymbolFontAlphabet@ -}{ - \tl_remove_in:Nn \@preamblecmds {\do#1} -} -\def\new@mathgroup{\alloc@8\mathgroup\chardef\@cclvi} -\let\newfam\new@mathgroup -\cs_set:Npn \um_set_mathsymbol:nNNn #1#2#3#4 { - \prg_case_tl:Nnn #3 { - \mathop { - \um_set_big_operator:nnn {#1} {#2} {#4} - } - \mathopen { - \tl_if_in:NnTF \l_um_radicals_tl {#2} { - \cs_gset_protected_nopar:cpx {\cs_to_str:N #2 sign} { \um_radical:nn {#1} {#4} } - \tl_set:cn {l_um_radical_\cs_to_str:N #2_tl} {\use:c{sym #1}~ #4} - }{ - \um_set_delcode:nnn {#1} {#4} {#4} - \um_set_mathcode:nnn {#4} \mathopen {#1} - \cs_gset_protected_nopar:Npx #2 { \um_delimiter:Nnn \mathopen {#1} {#4} } - } - } - \mathclose { - \um_set_delcode:nnn {#1} {#4} {#4} - \um_set_mathcode:nnn {#4} \mathclose {#1} - \cs_gset_protected_nopar:Npx #2 { \um_delimiter:Nnn \mathclose {#1} {#4} } - } - \mathaccent { - \cs_gset_protected_nopar:Npx #2 { \um_accent:Nnn #3 {#1} {#4} } - } - \mathfence { - \um_set_mathcode:nnn {#4} {#3} {#1} - \um_set_delcode:nnn {#1} {#4} {#4} - \cs_gset_protected_nopar:cpx {l \cs_to_str:N #2} { \um_delimiter:Nnn \mathopen {#1} {#4} } - \cs_gset_protected_nopar:cpx {r \cs_to_str:N #2} { \um_delimiter:Nnn \mathclose {#1} {#4} } - } - \mathover { % LuaTeX only - \cs_set_protected_nopar:Npn #2 ##1 { \mathop { \um_overbrace:nnn {#1} {#4} {##1} } \limits } - } - \mathunder { % LuaTeX only - \cs_set_protected_nopar:Npn #2 ##1 { \mathop { \um_underbrace:nnn {#1} {#4} {##1} } \limits } - } - }{ - \um_set_mathcode:nnn {#4} {#3} {#1} - } -} -\edef\mathfence{\string\mathfence} -\edef\mathover{\string\mathover} -\edef\mathunder{\string\mathunder} -\cs_new:Npn \um_set_big_operator:nnn #1#2#3 { - \group_begin: - \char_set_catcode_active:n {#3} - \char_gmake_mathactive:n {#3} - \um_active_char_set:wc #3 \q_nil { \cs_to_str:N #2 _sym } - \group_end: - \um_set_mathchar:cNnn {\cs_to_str:N #2 op} \mathop {#1} {#3} - \cs_gset:cpx { \cs_to_str:N #2 _sym } { - \exp_not:c { \cs_to_str:N #2 op } - \exp_not:n { \tl_if_in:NnT \l_um_nolimits_tl {#2} \nolimits } - } -} -\cs_set:Npn \um_set_mathcode:nnnn #1#2#3#4 { - \Umathcode \int_eval:n {#1} = - \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#4} \scan_stop: -} -\cs_set:Npn \um_set_mathcode:nnn #1#2#3 { - \Umathcode \int_eval:n {#1} = - \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#1} \scan_stop: -} -\cs_set:Npn \um_set_mathchar:NNnn #1#2#3#4 { - \Umathchardef #1 = - \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#4} \scan_stop: -} -\cs_new:Npn \um_set_delcode:nnn #1#2#3 { - \Udelcode#2 = \csname sym#1\endcsname #3 -} -\cs_new:Npn \um_radical:nn #1#2 { - \Uradical \csname sym#1\endcsname #2 \scan_stop: -} -\cs_new:Npn \um_delimiter:Nnn #1#2#3 { - \Udelimiter \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop: -} -\xetex_or_luatex:nnn { \cs_new:Npn \um_accent:Nnn #1#2#3 } { - \Umathaccent \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop: -} { - \Umathaccent \c_um_accent_keyword_tl \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop: -} -\luatex_if_engine:T { - \cs_new_nopar:Npn \um_wide_top_accent:Nnn #1 #2 #3 { - \Umathaccent \mathchar@type #1 \use:c { sym #2 } #3 \scan_stop: - } - \bool_if:NTF \c_um_have_fixed_accents_bool { - \cs_new_nopar:Npn \um_wide_bottom_accent:Nnn #1 #2 #3 { - \Umathaccent bottom~ \mathchar@type #1 \use:c { sym #2 } #3 \scan_stop: - } - \tl_const:Nn \c_um_accent_keyword_tl { fixed } - } { - \tl_const:Nn \c_um_accent_keyword_tl { } - } -} -\cs_generate_variant:Nn \um_set_mathchar:NNnn {c} -\cs_set:Npn \um_overbrace:nnn #1#2#3 { - \luatexUdelimiterover \csname sym#1\endcsname #2 {#3} -} -\cs_set:Npn \um_underbrace:nnn #1#2#3 { - \luatexUdelimiterunder \csname sym#1\endcsname #2 {#3} -} -\cs_new:Npn \char_gmake_mathactive:N #1 { - \global\mathcode `#1 = "8000 \scan_stop: -} -\cs_new:Npn \char_gmake_mathactive:n #1 { - \global\mathcode #1 = "8000 \scan_stop: -} -\cs_new_eq:NN \um_saved_ltxe_glb_settings: \glb@settings -\CheckCommand * \glb@settings { - \expandafter\ifx\csname S@\f@size\endcsname\relax - \calculate@math@sizes - \fi - \csname S@\f@size\endcsname - \ifmath@fonts - \begingroup - \escapechar\m@ne - \csname mv@\math@version \endcsname - \globaldefs\@ne - \math@fonts - \let \glb@currsize \f@size - \endgroup - \the\every@math@size - \fi -} -\cs_set_protected_nopar:Npn \glb@settings { - \msg_error:nn { unicode-math } { no-font-selected } -} -\cs_new:Npn \um_init: { - \let\glb@currsize\relax - \cs_set_eq:NN \glb@settings \um_saved_ltxe_glb_settings: - \bool_set_true:N \l_um_init_bool - \seq_clear:N \l_um_char_range_seq - \clist_clear:N \l_um_char_num_range_clist - \seq_clear:N \l_um_mathalph_seq - \clist_clear:N \l_um_unknown_keys_clist - \seq_clear:N \l_um_missing_alph_seq -} -\DeclareDocumentCommand \setmathfont { O{} m } { - \um_init: - \cs_if_exist:cF { S@ \f@size } { \calculate@math@sizes } - \csname S@\f@size\endcsname - \tl_set:Nn \l_um_mversion_tf {normal} - \DeclareMathVersion{\l_um_mversion_tf} - \tl_set:Nn \l_um_script_features_tl {ScriptStyle} - \tl_set:Nn \l_um_sscript_features_tl {ScriptScriptStyle} - \tl_set:Nn \l_um_script_font_tl {#2} - \tl_set:Nn \l_um_sscript_font_tl {#2} - \keys_set:nn {unicode-math} {#1} - \um_fontspec_select_font:n {#2} - \group_begin: - \fontfamily{\zf@family}\selectfont - \fontspec_if_script:nTF {math} - {\bool_gset_true:N \l_um_ot_math_bool} - {\bool_gset_false:N \l_um_ot_math_bool} - \group_end: - \bool_if:NTF \l_um_init_bool { - \tl_set:Nn \um_symfont_tl {operators} - \msg_trace:nnx {unicode-math} {default-math-font} {#2} - \cs_set_eq:NN \_um_sym:nnn \um_process_symbol_noparse:nnn - \cs_set_eq:NN \um_set_mathalphabet_char:Nnn \um_mathmap_noparse:Nnn - \cs_set_eq:NN \um_remap_symbol:nnn \um_remap_symbol_noparse:nnn - \cs_set_eq:NN \um_maybe_init_alphabet:n \um_init_alphabet:n - \cs_set_eq:NN \um_map_char_single:nn \um_map_char_noparse:nn - \cs_set_eq:NN \um_assign_delcode:nn \um_assign_delcode_noparse:nn - }{ - \int_incr:N \g_um_fam_int - \tl_set:Nx \um_symfont_tl {um_fam\int_use:N\g_um_fam_int} - \cs_set_eq:NN \_um_sym:nnn \um_process_symbol_parse:nnn - \cs_set_eq:NN \um_set_mathalphabet_char:Nnn \um_mathmap_parse:Nnn - \cs_set_eq:NN \um_remap_symbol:nnn \um_remap_symbol_parse:nnn - \cs_set_eq:NN \um_maybe_init_alphabet:n \use_none:n - \cs_set_eq:NN \um_map_char_single:nn \um_map_char_parse:nn - \cs_set_eq:NN \um_assign_delcode:nn \um_assign_delcode_parse:nn - } - \DeclareSymbolFont{\um_symfont_tl} - {\encodingdefault}{\zf@family}{\mddefault}{\updefault} - - \bool_if:nT {\l_um_ot_math_bool && !\g_um_mainfont_already_set_bool} { - \bool_set_true:N \g_um_mainfont_already_set_bool - \dim_compare:nF { \fontdimen 10 \l_um_font == 0pt } { - \DeclareMathSizes { \f@size } { \f@size } - { \um_fontdimen_to_percent:nn{10}{\l_um_font}\dimexpr \f@size pt\relax } - { \um_fontdimen_to_percent:nn{11}{\l_um_font}\dimexpr \f@size pt\relax } - } - \fontspec_select:xn {\l_um_font_keyval_tl, - Scale=1.00001, - FontAdjustment={ - \fontdimen8\font= \um_get_fontparam:nn {43} {FractionNumeratorDisplayStyleShiftUp}\relax - \fontdimen9\font= \um_get_fontparam:nn {42} {FractionNumeratorShiftUp}\relax - \fontdimen10\font=\um_get_fontparam:nn {32} {StackTopShiftUp}\relax - \fontdimen11\font=\um_get_fontparam:nn {45} {FractionDenominatorDisplayStyleShiftDown}\relax - \fontdimen12\font=\um_get_fontparam:nn {44} {FractionDenominatorShiftDown}\relax - \fontdimen13\font=\um_get_fontparam:nn {21} {SuperscriptShiftUp}\relax - \fontdimen14\font=\um_get_fontparam:nn {21} {SuperscriptShiftUp}\relax - \fontdimen15\font=\um_get_fontparam:nn {22} {SuperscriptShiftUpCramped}\relax - \fontdimen16\font=\um_get_fontparam:nn {18} {SubscriptShiftDown}\relax - \fontdimen17\font=\um_get_fontparam:nn {18} {SubscriptShiftDownWithSuperscript}\relax - \fontdimen18\font=\um_get_fontparam:nn {24} {SuperscriptBaselineDropMax}\relax - \fontdimen19\font=\um_get_fontparam:nn {20} {SubscriptBaselineDropMin}\relax - \fontdimen20\font=0pt\relax % delim1 = FractionDelimiterDisplaySize - \fontdimen21\font=0pt\relax % delim2 = FractionDelimiterSize - \fontdimen22\font=\um_get_fontparam:nn {15} {AxisHeight}\relax - } - } {#2} - \DeclareSymbolFont{symbols} - {\encodingdefault}{\zf@family}{\mddefault}{\updefault} - \fontspec_select:xn {\l_um_font_keyval_tl, - Scale=0.99999, - FontAdjustment={ - \fontdimen8\font= \um_get_fontparam:nn {48} {FractionRuleThickness}\relax - \fontdimen9\font= \um_get_fontparam:nn {28} {UpperLimitGapMin}\relax - \fontdimen10\font=\um_get_fontparam:nn {30} {LowerLimitGapMin}\relax - \fontdimen11\font=\um_get_fontparam:nn {29} {UpperLimitBaselineRiseMin}\relax - \fontdimen12\font=\um_get_fontparam:nn {31} {LowerLimitBaselineDropMin}\relax - \fontdimen13\font=0pt\relax - } - } {#2} - \DeclareSymbolFont{largesymbols} - {\encodingdefault}{\zf@family}{\mddefault}{\updefault} - } - \um_input_math_symbol_table: - \um_remap_symbols: - \um_setup_mathactives: - \um_setup_accents: - \um_setup_delcodes: - \um_setup_alphabets: - \ignorespaces -} -\xetex_or_luatex:nnn { \cs_new:Nn \um_get_fontparam:nn } { - \the\fontdimen#1\zf@basefont\relax -}{ - \directlua{fontspec.mathfontdimen("zf@basefont","#2")} -} -\DeclareDocumentCommand \resetmathfont { O{} m } { - \bool_set_false:N \g_um_mainfont_already_set_bool - \setmathfont[#1]{#2} -} -\cs_new:Npn \um_fontspec_select_font:n #1 { - \tl_set:Nx \l_um_font_keyval_tl { - \luatex_if_engine:T { Renderer = Basic, } - BoldFont = {}, ItalicFont = {}, - Script = Math, - SizeFeatures = { - {Size = \tf@size-} , - {Size = \sf@size-\tf@size , - Font = \l_um_script_font_tl , - \l_um_script_features_tl - } , - {Size = -\sf@size , - Font = \l_um_sscript_font_tl , - \l_um_sscript_features_tl - } - }, - \l_um_unknown_keys_clist - } - \fontspec_select:xn {\l_um_font_keyval_tl} {#1} - \tl_set_eq:NN \l_um_font \zf@basefont -} -\cs_set:Npn \um_process_symbol_noparse:nnn #1#2#3 { - \um_set_mathsymbol:nNNn {\um_symfont_tl} #2#3{#1} -} -\cs_set:Npn \um_process_symbol_parse:nnn #1#2#3 { - \um@parse@term{#1}{#2}{#3}{ - \um_process_symbol_noparse:nnn {#1}{#2}{#3} - } -} -\cs_new:Npn \um_remap_symbols: { - \um_remap_symbol:nnn{`\-}{\mathbin}{"02212}% hyphen to minus - \um_remap_symbol:nnn{`\*}{\mathbin}{"02217}% text asterisk to "centred asterisk" - \bool_if:NF \g_um_literal_colon_bool { - \um_remap_symbol:nnn{`\:}{\mathrel}{"02236}% colon to ratio (i.e., punct to rel) - } -} -\cs_new:Npn \um_remap_symbol_parse:nnn #1#2#3 { - \um@parse@term {#3} {\@nil} {#2} { - \um_remap_symbol_noparse:nnn {#1} {#2} {#3} - } -} -\cs_new:Npn \um_remap_symbol_noparse:nnn #1#2#3 { - \clist_map_inline:nn {#1} { - \um_set_mathcode:nnnn {##1} {#2} {\um_symfont_tl} {#3} - } -} -\cs_new:Npn \um_setup_mathactives: { - \um_make_mathactive:nNN {"2032} \um_prime_single_mchar \mathord - \um_make_mathactive:nNN {"2033} \um_prime_double_mchar \mathord - \um_make_mathactive:nNN {"2034} \um_prime_triple_mchar \mathord - \um_make_mathactive:nNN {"2057} \um_prime_quad_mchar \mathord - \um_make_mathactive:nNN {"2035} \um_backprime_single_mchar \mathord - \um_make_mathactive:nNN {"2036} \um_backprime_double_mchar \mathord - \um_make_mathactive:nNN {"2037} \um_backprime_triple_mchar \mathord - \um_make_mathactive:nNN {`\'} \mathstraightquote \mathord - \um_make_mathactive:nNN {`\`} \mathbacktick \mathord -} -\cs_new:Npn \um_make_mathactive:nNN #1#2#3 { - \um_set_mathchar:NNnn #2 #3 {\um_symfont_tl} {#1} - \char_gmake_mathactive:n {#1} -} -\cs_new:Npn \um_assign_delcode_noparse:nn #1#2 { - \um_set_delcode:nnn \um_symfont_tl {#1} {#2} -} -\cs_new:Npn \um_assign_delcode_parse:nn #1#2 { - \um@parse@term {#2}{\@nil}{\@nil} { - \um_assign_delcode_noparse:nn {#1} {#2} - } -} -\cs_new:Npn \um_assign_delcode:n #1 { - \um_assign_delcode:nn {#1} {#1} -} -\cs_new:Npn \um_setup_delcodes: { - \um_assign_delcode:nn {`\/} {\g_um_slash_delimiter_usv} - \um_assign_delcode:nn {"2044} {\g_um_slash_delimiter_usv} % fracslash - \um_assign_delcode:nn {"2215} {\g_um_slash_delimiter_usv} % divslash - \um_assign_delcode:n {"005C} % backslash - \um_assign_delcode:nn {`\<} {"27E8} % angle brackets with ascii notation - \um_assign_delcode:nn {`\>} {"27E9} % angle brackets with ascii notation - \um_assign_delcode:n {"2191} % up arrow - \um_assign_delcode:n {"2193} % down arrow - \um_assign_delcode:n {"2195} % updown arrow - \um_assign_delcode:n {"219F} % up arrow twohead - \um_assign_delcode:n {"21A1} % down arrow twohead - \um_assign_delcode:n {"21A5} % up arrow from bar - \um_assign_delcode:n {"21A7} % down arrow from bar - \um_assign_delcode:n {"21A8} % updown arrow from bar - \um_assign_delcode:n {"21BE} % up harpoon right - \um_assign_delcode:n {"21BF} % up harpoon left - \um_assign_delcode:n {"21C2} % down harpoon right - \um_assign_delcode:n {"21C3} % down harpoon left - \um_assign_delcode:n {"21C5} % arrows up down - \um_assign_delcode:n {"21F5} % arrows down up - \um_assign_delcode:n {"21C8} % arrows up up - \um_assign_delcode:n {"21CA} % arrows down down - \um_assign_delcode:n {"21D1} % double up arrow - \um_assign_delcode:n {"21D3} % double down arrow - \um_assign_delcode:n {"21D5} % double updown arrow - \um_assign_delcode:n {"21DE} % up arrow double stroke - \um_assign_delcode:n {"21DF} % down arrow double stroke - \um_assign_delcode:n {"21E1} % up arrow dashed - \um_assign_delcode:n {"21E3} % down arrow dashed - \um_assign_delcode:n {"21E7} % up white arrow - \um_assign_delcode:n {"21E9} % down white arrow - \um_assign_delcode:n {"21EA} % up white arrow from bar - \um_assign_delcode:n {"21F3} % updown white arrow -} -\tl_new:Nn \l_um_nolimits_tl { - \int\iint\iiint\iiiint\oint\oiint\oiiint - \intclockwise\varointclockwise\ointctrclockwise\sumint - \intbar\intBar\fint\cirfnint\awint\rppolint - \scpolint\npolint\pointint\sqint\intlarhk\intx - \intcap\intcup\upint\lowint -} -\DeclareDocumentCommand \addnolimits {m} { - \tl_put_right:Nn \l_um_nolimits_tl {#1} -} -\DeclareDocumentCommand \removenolimits {m} { - \tl_remove_all_in:Nn \l_um_nolimits_tl {#1} -} -\tl_new:Nn \l_um_radicals_tl {\sqrt} -\cs_new_protected_nopar:Npn \um_new_cramped_style:N #1 { - \xetex_or_luatex:nn { - \quark_new:N #1 - } { - \cs_new_eq:Nc #1 { luatex \cs_to_str:N #1 } - } -} -\um_new_cramped_style:N \crampeddisplaystyle -\um_new_cramped_style:N \crampedtextstyle -\um_new_cramped_style:N \crampedscriptstyle -\um_new_cramped_style:N \crampedscriptscriptstyle -\xetex_if_engine:T { - \cs_new_nopar:Npn \um_font_dimen:Nnnnn #1 #2 #3 #4 #5 { - \fontdimen - \cs_if_eq:NNTF #1 \displaystyle { - #2 \textfont - } { - \cs_if_eq:NNTF #1 \crampeddisplaystyle { - #3 \textfont - } { - \cs_if_eq:NNTF #1 \textstyle { - #4 \textfont - } { - \cs_if_eq:NNTF #1 \crampedtextstyle { - #5 \textfont - } { - \cs_if_eq:NNTF #1 \scriptstyle { - #4 \scriptfont - } { - \cs_if_eq:NNTF #1 \crampedscriptstyle { - #5 \scriptfont - } { - \cs_if_eq:NNTF #1 \scriptscriptstyle { - #4 \scriptscriptfont - } { - #5 \scriptscriptfont - } - } - } - } - } - } - } - \c_two - } -} -\xetex_or_luatex:nnn { - \cs_new_protected_nopar:Npn \um_font_param:nnnnn #1 #2 #3 #4 #5 -} { - \um_font_param_aux:ccnnnn { um_ #1 :N } { um_set_ #1 :N } - { #2 } { #3 } { #4 } { #5 } -} { - \tl_set:Nn \l_um_tmpa_tl { #1 } - \tl_remove_all_in:Nn \l_um_tmpa_tl { _ } - \um_font_param_aux:ccc { um_ #1 :N } { um_set_ #1 :N } - { luatexUmath \l_um_tmpa_tl } -} -\cs_new_protected_nopar:Npn \um_font_param:nnn #1 #2 #3 { - \um_font_param:nnnnn { #1 } { #2 } { #2 } { #3 } { #3 } -} -\cs_new_protected_nopar:Npn \um_font_param:nn #1 #2 { - \um_font_param:nnnnn { #1 } { #2 } { #2 } { #2 } { #2 } -} -\xetex_or_luatex:nnn { - \cs_new_protected_nopar:Npn \um_font_param:n #1 -} { } { - \um_font_param:nnnnn { #1 } { 0 } { 0 } { 0 } { 0 } -} -\xetex_or_luatex:nn { - \cs_new_protected_nopar:Npn \um_font_param_aux:NNnnnn #1 #2 #3 #4 #5 #6 { - \cs_new_nopar:Npn #1 ##1 { - \um_font_dimen:Nnnnn ##1 { #3 } { #4 } { #5 } { #6 } - } - \cs_new_protected_nopar:Npn #2 ##1 ##2 { - #1 ##1 \dim_eval:n { ##2 } - } - } - \cs_generate_variant:Nn \um_font_param_aux:NNnnnn { cc } -} { - \cs_new_protected_nopar:Npn \um_font_param_aux:NNN #1 #2 #3 { - \cs_new_nopar:Npn #1 ##1 { - #3 ##1 - } - \cs_new_protected_nopar:Npn #2 ##1 ##2 { - #3 ##1 \dim_eval:n { ##2 } - } - } - \cs_generate_variant:Nn \um_font_param_aux:NNN { ccc } -} -\um_font_param:nn { axis } { 15 } -\um_font_param:nn { operator_size } { 13 } -\um_font_param:n { fraction_del_size } -\um_font_param:nnn { fraction_denom_down } { 45 } { 44 } -\um_font_param:nnn { fraction_denom_vgap } { 50 } { 49 } -\um_font_param:nnn { fraction_num_up } { 43 } { 42 } -\um_font_param:nnn { fraction_num_vgap } { 47 } { 46 } -\um_font_param:nn { fraction_rule } { 48 } -\um_font_param:nn { limit_above_bgap } { 29 } -\um_font_param:n { limit_above_kern } -\um_font_param:nn { limit_above_vgap } { 28 } -\um_font_param:nn { limit_below_bgap } { 31 } -\um_font_param:n { limit_below_kern } -\um_font_param:nn { limit_below_vgap } { 30 } -\um_font_param:nn { over_delimiter_vgap } { 41 } -\um_font_param:nn { over_delimiter_bgap } { 38 } -\um_font_param:nn { under_delimiter_vgap } { 40 } -\um_font_param:nn { under_delimiter_bgap } { 39 } -\um_font_param:nn { overbar_kern } { 55 } -\um_font_param:nn { overbar_rule } { 54 } -\um_font_param:nn { overbar_vgap } { 53 } -\um_font_param:n { quad } -\um_font_param:nn { radical_kern } { 62 } -\um_font_param:nn { radical_rule } { 61 } -\um_font_param:nnn { radical_vgap } { 60 } { 59 } -\um_font_param:nn { radical_degree_before } { 63 } -\um_font_param:nn { radical_degree_after } { 64 } -\um_font_param:nn { radical_degree_raise } { 65 } -\um_font_param:nn { space_after_script } { 27 } -\um_font_param:nnn { stack_denom_down } { 35 } { 34 } -\um_font_param:nnn { stack_num_up } { 33 } { 32 } -\um_font_param:nnn { stack_vgap } { 37 } { 36 } -\um_font_param:nn { sub_shift_down } { 18 } -\um_font_param:nn { sub_shift_drop } { 20 } -\um_font_param:n { subsup_shift_down } -\um_font_param:nn { sub_top_max } { 19 } -\um_font_param:nn { subsup_vgap } { 25 } -\um_font_param:nn { sup_bottom_min } { 23 } -\um_font_param:nn { sup_shift_drop } { 24 } -\um_font_param:nnnnn { sup_shift_up } { 21 } { 22 } { 21 } { 22 } -\um_font_param:nn { supsub_bottom_max } { 26 } -\um_font_param:nn { underbar_kern } { 58 } -\um_font_param:nn { underbar_rule } { 57 } -\um_font_param:nn { underbar_vgap } { 56 } -\um_font_param:n { connector_overlap_min } -\keys_define:nn {unicode-math} +\cs_new:Npn \um_warning:n { \msg_warning:nn {unicode-math} } +\cs_new:Npn \um_log:n { \msg_log:nn {unicode-math} } +\cs_new:Npn \um_log:nx { \msg_log:nnx {unicode-math} } +\msg_new:nnn {unicode-math} {no-tfrac} { - script-features .tl_set:N = \l_um_script_features_tl , - sscript-features .tl_set:N = \l_um_sscript_features_tl , - script-font .tl_set:N = \l_um_script_font_tl , - sscript-font .tl_set:N = \l_um_sscript_font_tl , -} -\seq_new:N \l_um_mathalph_seq -\seq_new:N \l_um_char_range_seq -\keys_define:nn {unicode-math} { - range .code:n = { - \bool_set_false:N \l_um_init_bool - \seq_clear:N \l_um_char_range_seq - \seq_clear:N \l_um_mathalph_seq - \clist_map_inline:nn {#1} { - \um_if_mathalph_decl:nTF {##1} { - \seq_put_right:Nx \l_um_mathalph_seq { - { \exp_not:V \l_um_tmpa_tl } - { \exp_not:V \l_um_tmpb_tl } - { \exp_not:V \l_um_tmpc_tl } - } - }{ - \seq_put_right:Nn \l_um_char_range_seq {##1} - } - } - } -} -\prg_new_conditional:Nnn \um_if_mathalph_decl:n {TF} { - \tl_set:Nx \l_um_tmpa_tl { \trim@spaces@noexp {#1} } - \tl_clear:N \l_um_tmpb_tl - \tl_clear:N \l_um_tmpc_tl - \tl_if_in:NnT \l_um_tmpa_tl {->} { - \exp_after:wN \um_split_arrow:w \l_um_tmpa_tl \q_nil - } - \tl_if_in:NnT \l_um_tmpa_tl {/} { - \exp_after:wN \um_split_slash:w \l_um_tmpa_tl \q_nil - } - \tl_if_empty:NT \l_um_tmpc_tl { \tl_set_eq:NN \l_um_tmpc_tl \l_um_tmpa_tl } - \seq_if_in:NVTF \g_um_mathstyles_seq \l_um_tmpa_tl { - \prg_return_true: - }{ - \prg_return_false: - } -} -\cs_set:Npn \um_split_arrow:w #1->#2 \q_nil { - \tl_set:Nn \l_um_tmpa_tl {#1} - \tl_if_single:nTF {#2} - { \tl_set:Nn \l_um_tmpc_tl {#2} } - { \exp_args:NNc \tl_set:Nn \l_um_tmpc_tl {math#2} } -} -\cs_set:Npn \um_split_slash:w #1/#2 \q_nil { - \tl_set:Nn \l_um_tmpa_tl {#1} - \tl_set:Nn \l_um_tmpb_tl {#2} -} -\newcommand\um@parse@term[4]{ - \seq_map_variable:NNn \l_um_char_range_seq \@ii { - \unless\ifx\@ii\@empty - \@tempswafalse - \expandafter\um@firstchar\expandafter{\@ii} - \ifx\@tempa\um@backslash - \expandafter\ifx\@ii#2\relax - \@tempswatrue - \else - \expandafter\ifx\@ii#3\relax - \@tempswatrue - \fi - \fi - \else - \expandafter\um@parse@range\@ii-\@marker-\@nil#1\@nil - \fi - \if@tempswa - \clist_put_right:Nx \l_um_char_num_range_clist { \int_eval:n {#1} } - #4 - \fi - \fi - } -} -\def\um@firstof#1#2\@nil{#1} -\edef\um@backslash{\expandafter\um@firstof\string\string\@nil} -\def\um@firstchar#1{\edef\@tempa{\expandafter\um@firstof\string#1\@nil}} -\def\um@parse@range#1-#2-#3\@nil#4\@nil{ - \def\@tempa{#1} - \def\@tempb{#2} - \expandafter\ifx\expandafter\@marker\@tempb\relax - \int_compare:nT {#4=#1} \@tempswatrue - \else - \ifx\@empty\@tempb - \int_compare:nT {#4>#1-1} \@tempswatrue - \else - \ifx\@empty\@tempa - \int_compare:nT {#4<#2+1} \@tempswatrue - \else - \int_compare:nT {#4>#1-1} { - \int_compare:nT {#4<#2+1} \@tempswatrue - } - \fi - \fi - \fi -} -\AtBeginDocument{\um_resolve_greek:} -\cs_new:Npn \um_resolve_greek: { - \clist_map_inline:nn { - Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda, - alpha,beta,gamma,delta, zeta,eta,theta,iota,kappa,lambda, - Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega, - mu,nu,xi,omicron,pi,rho,sigma,tau,upsilon, chi,psi,omega, - varTheta, - varsigma,vartheta,varkappa,varrho,varpi - }{ - \tl_set:cx {##1} { \exp_not:c { mit ##1 } } - } - \tl_set:Nn \epsilon { - \bool_if:NTF \g_um_texgreek_bool \mitvarepsilon \mitepsilon - } - \tl_set:Nn \phi { - \bool_if:NTF \g_um_texgreek_bool \mitvarphi \mitphi - } - \tl_set:Nn \varepsilon { - \bool_if:NTF \g_um_texgreek_bool \mitepsilon \mitvarepsilon - } - \tl_set:Nn \varphi { - \bool_if:NTF \g_um_texgreek_bool \mitphi \mitvarphi - } -} -\cs_new:Npn \um_new_mathstyle:N #1 { - \um_prepare_mathstyle:f {\exp_after:wN \use_none:nnnnn \token_to_str:N #1} - \seq_put_right:Nn \g_um_mathstyles_seq {#1} -} -\seq_new:N \g_um_default_mathalph_seq -\seq_new:N \g_um_mathstyles_seq -\AtEndOfPackage{ -\clist_map_inline:nn { - {\mathup } {latin,Latin,greek,Greek,num,misc} {\mathup } , - {\mathit } {latin,Latin,greek,Greek,misc} {\mathit } , - {\mathbb } {latin,Latin,num,misc} {\mathbb } , - {\mathbbit } {misc} {\mathbbit } , - {\mathscr } {latin,Latin} {\mathscr } , - {\mathcal } {Latin} {\mathscr } , - {\mathbfcal } {Latin} {\mathbfscr } , - {\mathfrak } {latin,Latin} {\mathfrak } , - {\mathtt } {latin,Latin,num} {\mathtt } , - {\mathsfup } {latin,Latin,num} {\mathsfup } , - {\mathsfit } {latin,Latin} {\mathsfit } , - {\mathbfup } {latin,Latin,greek,Greek,num,misc} {\mathbfup } , - {\mathbfit } {latin,Latin,greek,Greek,misc} {\mathbfit } , - {\mathbfscr } {latin,Latin} {\mathbfscr } , - {\mathbffrak} {latin,Latin} {\mathbffrak} , - {\mathbfsfup} {latin,Latin,greek,Greek,num,misc} {\mathbfsfup} , - {\mathbfsfit} {latin,Latin,greek,Greek,misc} {\mathbfsfit} -}{ - \seq_put_right:Nn \g_um_default_mathalph_seq {#1} - \exp_after:wN \um_new_mathstyle:N \use_i:nnn #1 -} -\um_new_mathstyle:N \mathsf -\um_new_mathstyle:N \mathbf -\um_new_mathstyle:N \mathbfsf -} -\cs_new:Npn \um_prepare_mathstyle:n #1 { - \um_init_alphabet:x {#1} - \cs_set:cpn {_um_math#1_aux:n} ##1 { - \use:c {um_switchto_math#1:} ##1 \egroup - } - \cs_set_protected:cpx {math#1} { - \exp_not:n{ - \bgroup - \mode_if_math:F { - \egroup\expandafter - \non@alpherr\expandafter{\csname math#1\endcsname\space} - } - } - \exp_not:c {_um_math#1_aux:n} - } -} -\cs_generate_variant:Nn \um_prepare_mathstyle:n {f} -\cs_set:Npn \um_init_alphabet:n #1 { - \um_trace:nx {alph-initialise} {#1} - \cs_set_eq:cN {um_switchto_math#1:} \prg_do_nothing: -} -\cs_generate_variant:Nn \um_init_alphabet:n {x} -\cs_new:Npn \um_maybe_init_alphabet:V { - \exp_args:NV \um_maybe_init_alphabet:n -} -\seq_new:N \l_um_missing_alph_seq -\cs_new:Npn \um_setup_alphabets: { - \seq_if_empty:NTF \l_um_mathalph_seq { - \um_trace:n {setup-implicit} - \seq_set_eq:NN \l_um_mathalph_seq \g_um_default_mathalph_seq - \bool_set_true:N \l_um_implicit_alph_bool - \um_maybe_init_alphabet:n {sf} - \um_maybe_init_alphabet:n {bf} - \um_maybe_init_alphabet:n {bfsf} - } - { - \um_trace:n {setup-explicit} - \bool_set_false:N \l_um_implicit_alph_bool - \cs_set_eq:NN \um_set_mathalphabet_char:Nnn \um_mathmap_noparse:Nnn - \cs_set_eq:NN \um_map_char_single:nn \um_map_char_noparse:nn - } - \seq_map_inline:Nn \l_um_mathalph_seq { - \tl_set:No \l_um_tmpa_tl { \use_i:nnn ##1 } - \tl_set:No \l_um_tmpb_tl { \use_ii:nnn ##1 } - \tl_set:No \l_um_remap_style_tl { \use_iii:nnn ##1 } - \tl_set:Nx \l_um_remap_style_tl { - \exp_after:wN \exp_after:wN \exp_after:wN \use_none:nnnnn - \exp_after:wN \token_to_str:N \l_um_remap_style_tl - } - \tl_if_empty:NT \l_um_tmpb_tl { - \cs_set_eq:NN \um_maybe_init_alphabet:n \um_init_alphabet:n - \tl_set:Nn \l_um_tmpb_tl { latin,Latin,greek,Greek,num,misc } - } - \um_setup_math_alphabet:VVV - \l_um_tmpa_tl \l_um_tmpb_tl \l_um_remap_style_tl - } - \um_warn_missing_alphabets: -} -\cs_new:Npn \um_warn_missing_alphabets: { - \seq_if_empty:NF \l_um_missing_alph_seq { - \typeout{ - Package~unicode-math~Warning:~ - missing~math~alphabets~in~font~ \fontname\l_um_font - } - \seq_map_inline:Nn \l_um_missing_alph_seq { - \typeout{\space\space\space\space##1} - } - } -} -\cs_new:Npn \um_setup_math_alphabet:Nnn #1#2#3 { - \tl_set:Nx \l_um_style_tl { - \exp_after:wN \use_none:nnnnn \token_to_str:N #1 - } - \clist_map_inline:nn {#2} { - \tl_set:Nx \l_um_tmpa_tl { \trim@spaces {##1} } - \cs_if_exist:cT {um_config_ \l_um_style_tl _\l_um_tmpa_tl :n} { - \str_if_eq:xxTF {\l_um_tmpa_tl}{misc} { - \um_maybe_init_alphabet:V \l_um_style_tl - \clist_map_break: - }{ - \um_glyph_if_exist:cT { \um_to_usv:nn {#3}{\l_um_tmpa_tl} }{ - \um_maybe_init_alphabet:V \l_um_style_tl - \clist_map_break: - } - } - } - } - \clist_map_inline:nn {#2} { - \tl_set:Nx \l_um_tmpa_tl { \trim@spaces {##1} } - \cs_if_exist:cT {um_config_ \l_um_style_tl _ \l_um_tmpa_tl :n} { - \str_if_eq:xxTF {\l_um_tmpa_tl}{misc} { - \um_trace:nx {setup-alph} {math \l_um_style_tl~(\l_um_tmpa_tl)} - \use:c {um_config_ \l_um_style_tl _ \l_um_tmpa_tl :n} {#3} - }{ - \um_glyph_if_exist:cTF { \um_to_usv:nn {#3}{\l_um_tmpa_tl} } { - \um_trace:nx {setup-alph} {math \l_um_style_tl~(\l_um_tmpa_tl)} - \use:c {um_config_ \l_um_style_tl _ \l_um_tmpa_tl :n} {#3} - }{ - \bool_if:NTF \l_um_implicit_alph_bool { - \seq_put_right:Nx \l_um_missing_alph_seq { - \@backslashchar math \l_um_style_tl \space - (\tl_use:c{g_um_math_alphabet_name_ \l_um_tmpa_tl _tl}) - } - }{ - \use:c {um_config_ \l_um_style_tl _ \l_um_tmpa_tl :n} {up} - } - } - } - } - } -} -\cs_generate_variant:Nn \um_setup_math_alphabet:Nnn {VVV} -\cs_new:Npn \um_map_char_single:cc { \exp_args:Ncc \um_map_char_single:nn } -\cs_new:Npn \um_map_char_noparse:nn #1#2 { - \um_set_mathcode:nnnn {#1}{\mathalpha}{\um_symfont_tl}{#2} -} -\cs_new:Npn \um_map_char_parse:nn #1#2 { - \um@parse@term {#1} {\@nil} {\mathalpha} { - \um_map_char_noparse:nn {#1}{#2} - } -} -\cs_new:Npn \um_map_char_single:nnn #1#2#3 { - \um_map_char_single:cc { \um_to_usv:nn {#1}{#3} } - { \um_to_usv:nn {#2}{#3} } -} -\cs_set:Npn \um_map_single:nnn #1#2#3 { - \cs_if_exist:cT { \um_to_usv:nn {#3} {#1} } - { - \clist_map_inline:nn {#2} { - \um_map_char_single:nnn {##1} {#3} {#1} - } - } -} -\cs_set:Npn \um_map_chars_range:nnn #1#2#3 { - \prg_stepwise_inline:nnnn {0}{1}{#1-1} { - \um_map_char_single:nn {#2+##1}{#3+##1} - } -} -\cs_generate_variant:Nn \um_map_chars_range:nnn {ncc} -\cs_new:Npn \um_map_chars_range:nnnn #1#2#3#4 { - \um_map_chars_range:ncc {#1} { \um_to_usv:nn {#2}{#4} } - { \um_to_usv:nn {#3}{#4} } -} -\cs_set:Npn \um_map_chars_Latin:nn #1#2 { - \clist_map_inline:nn {#1} { - \um_map_chars_range:nnnn {26} {##1} {#2} {Latin} - } -} -\cs_set:Npn \um_map_chars_latin:nn #1#2 { - \clist_map_inline:nn {#1} { - \um_map_chars_range:nnnn {26} {##1} {#2} {latin} - } -} -\cs_set:Npn \um_map_chars_greek:nn #1#2 { - \clist_map_inline:nn {#1} { - \um_map_chars_range:nnnn {25} {##1} {#2} {greek} - \um_map_char_single:nnn {##1} {#2} {varepsilon} - \um_map_char_single:nnn {##1} {#2} {vartheta} - \um_map_char_single:nnn {##1} {#2} {varkappa} - \um_map_char_single:nnn {##1} {#2} {varphi} - \um_map_char_single:nnn {##1} {#2} {varrho} - \um_map_char_single:nnn {##1} {#2} {varpi} - } -} -\cs_set:Npn \um_map_chars_Greek:nn #1#2 { - \clist_map_inline:nn {#1} { - \um_map_chars_range:nnnn {25} {##1} {#2} {Greek} - \um_map_char_single:nnn {##1} {#2} {varTheta} - } -} -\cs_set:Npn \um_map_chars_numbers:nn #1#2 { - \um_map_chars_range:nnnn {10} {#1} {#2} {num} -} -\cs_new:Npn \um_set_mathalphabet_char:Ncc { - \exp_args:NNcc \um_set_mathalphabet_char:Nnn -} -\cs_set:Npn \um_mathmap_noparse:Nnn #1#2#3 { - \clist_map_inline:nn {#2} { - \tl_put_right:cx {um_switchto_\cs_to_str:N #1:} { - \um_set_mathcode:nnnn{##1}{\mathalpha}{\um_symfont_tl}{#3} - } - } -} -\cs_set:Npn \um_mathmap_parse:Nnn #1#2#3 { - \clist_if_in:NnT \l_um_char_num_range_clist {#3} { - \um_mathmap_noparse:Nnn {#1}{#2}{#3} - } -} -\cs_new:Npn \um_set_mathalphabet_char:Nnnn #1#2#3#4 { - \um_set_mathalphabet_char:Ncc #1 { \um_to_usv:nn {#2} {#4} } - { \um_to_usv:nn {#3} {#4} } -} -\cs_new:Npn \um_set_mathalph_range:nNnn #1#2#3#4 { - \prg_stepwise_inline:nnnn {0}{1}{#1-1} { - \um_set_mathalphabet_char:Nnn {#2} { ##1 + #3 } { ##1 + #4 } - } -} -\cs_generate_variant:Nn \um_set_mathalph_range:nNnn {nNcc} -\cs_new:Npn \um_set_mathalph_range:nNnnn #1#2#3#4#5 { - \um_set_mathalph_range:nNcc {#1} #2 { \um_to_usv:nn {#3} {#5} } - { \um_to_usv:nn {#4} {#5} } -} -\cs_new:Npn \um_set_mathalphabet_pos:Nnnn #1#2#3#4 { - \cs_if_exist:cT { \um_to_usv:nn {#4}{#2} } { - \clist_map_inline:nn {#3} { - \um_set_mathalphabet_char:Nnnn #1 {##1} {#4} {#2} - } - } -} -\cs_new:Npn \um_set_mathalphabet_numbers:Nnn #1#2#3 { - \clist_map_inline:nn {#2} { - \um_set_mathalph_range:nNnnn {10} #1 {##1} {#3} {num} - } -} -\cs_new:Npn \um_set_mathalphabet_Latin:Nnn #1#2#3 { - \clist_map_inline:nn {#2} { - \um_set_mathalph_range:nNnnn {26} #1 {##1} {#3} {Latin} - } -} -\cs_new:Npn \um_set_mathalphabet_latin:Nnn #1#2#3 { - \clist_map_inline:nn {#2} { - \um_set_mathalph_range:nNnnn {26} #1 {##1} {#3} {latin} - \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {h} - } -} -\cs_new:Npn \um_set_mathalphabet_Greek:Nnn #1#2#3 { - \clist_map_inline:nn {#2} { - \um_set_mathalph_range:nNnnn {25} #1 {##1} {#3} {Greek} - \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varTheta} - } -} -\cs_new:Npn \um_set_mathalphabet_greek:Nnn #1#2#3 { - \clist_map_inline:nn {#2} { - \um_set_mathalph_range:nNnnn {25} #1 {##1} {#3} {greek} - \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varepsilon} - \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {vartheta} - \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varkappa} - \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varphi} - \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varrho} - \um_set_mathalphabet_char:Nnnn #1 {##1} {#3} {varpi} - } -} -\cs_new:Npn \um_config_up_num:n #1 { - \um_map_chars_numbers:nn {up}{#1} - \um_set_mathalphabet_numbers:Nnn \mathup {up}{#1} -} -\cs_new:Npn \um_config_up_Latin:n #1 { - \bool_if:NTF \g_um_literal_bool { - \um_map_chars_Latin:nn {up} {#1} - }{ - \bool_if:NT \g_um_upLatin_bool { - \um_map_chars_Latin:nn {up,it} {#1} - } - } - \um_set_mathalphabet_Latin:Nnn \mathup {up,it}{#1} -} -\cs_new:Npn \um_config_up_latin:n #1 { - \bool_if:NTF \g_um_literal_bool { - \um_map_chars_latin:nn {up} {#1} - }{ - \bool_if:NT \g_um_uplatin_bool { - \um_map_chars_latin:nn {up,it} {#1} - \um_map_single:nnn {h} {up,it} {#1} - \um_map_single:nnn {dotlessi} {up,it} {#1} - \um_map_single:nnn {dotlessj} {up,it} {#1} - } - } - \um_set_mathalphabet_latin:Nnn \mathup {up,it}{#1} -} -\cs_new:Npn \um_config_up_Greek:n #1 { - \bool_if:NTF \g_um_literal_bool { - \um_map_chars_Greek:nn {up}{#1} - }{ - \bool_if:NT \g_um_upGreek_bool { - \um_map_chars_Greek:nn {up,it}{#1} - } - } - \um_set_mathalphabet_Greek:Nnn \mathup {up,it}{#1} -} -\cs_new:Npn \um_config_up_greek:n #1 { - \bool_if:NTF \g_um_literal_bool { - \um_map_chars_greek:nn {up} {#1} - }{ - \bool_if:NT \g_um_upgreek_bool { - \um_map_chars_greek:nn {up,it} {#1} - } - } - \um_set_mathalphabet_greek:Nnn \mathup {up,it} {#1} -} -\cs_new:Npn \um_config_up_misc:n #1 { - \bool_if:NTF \g_um_literal_Nabla_bool { - \um_map_single:nnn {Nabla}{up}{up} - }{ - \bool_if:NT \g_um_upNabla_bool { - \um_map_single:nnn {Nabla}{up,it}{up} - } - } - \bool_if:NTF \g_um_literal_partial_bool { - \um_map_single:nnn {partial}{up}{up} - }{ - \bool_if:NT \g_um_uppartial_bool { - \um_map_single:nnn {partial}{up,it}{up} - } - } - \um_set_mathalphabet_pos:Nnnn \mathup {partial} {up,it} {#1} - \um_set_mathalphabet_pos:Nnnn \mathup {Nabla} {up,it} {#1} - \um_set_mathalphabet_pos:Nnnn \mathup {dotlessi} {up,it} {#1} - \um_set_mathalphabet_pos:Nnnn \mathup {dotlessj} {up,it} {#1} -} -\cs_new:Npn \um_config_it_Latin:n #1 { - \bool_if:NTF \g_um_literal_bool { - \um_map_chars_Latin:nn {it} {#1} - }{ - \bool_if:NF \g_um_upLatin_bool { - \um_map_chars_Latin:nn {up,it} {#1} - } - } - \um_set_mathalphabet_Latin:Nnn \mathit {up,it}{#1} -} -\cs_new:Npn \um_config_it_latin:n #1 { - \bool_if:NTF \g_um_literal_bool { - \um_map_chars_latin:nn {it} {#1} - \um_map_single:nnn {h}{it}{#1} - }{ - \bool_if:NF \g_um_uplatin_bool { - \um_map_chars_latin:nn {up,it} {#1} - \um_map_single:nnn {h}{up,it}{#1} - \um_map_single:nnn {dotlessi}{up,it}{#1} - \um_map_single:nnn {dotlessj}{up,it}{#1} - } - } - \um_set_mathalphabet_latin:Nnn \mathit {up,it} {#1} - \um_set_mathalphabet_pos:Nnnn \mathit {dotlessi} {up,it} {#1} - \um_set_mathalphabet_pos:Nnnn \mathit {dotlessj} {up,it} {#1} -} -\cs_new:Npn \um_config_it_Greek:n #1 { - \bool_if:NTF \g_um_literal_bool { - \um_map_chars_Greek:nn {it}{#1} - }{ - \bool_if:NF \g_um_upGreek_bool { - \um_map_chars_Greek:nn {up,it}{#1} - } - } - \um_set_mathalphabet_Greek:Nnn \mathit {up,it}{#1} -} -\cs_new:Npn \um_config_it_greek:n #1 { - \bool_if:NTF \g_um_literal_bool { - \um_map_chars_greek:nn {it} {#1} - }{ - \bool_if:NF \g_um_upgreek_bool { - \um_map_chars_greek:nn {it,up} {#1} - } - } - \um_set_mathalphabet_greek:Nnn \mathit {up,it} {#1} -} -\cs_new:Npn \um_config_it_misc:n #1 { - \bool_if:NTF \g_um_literal_Nabla_bool { - \um_map_single:nnn {Nabla}{it}{it} - }{ - \bool_if:NF \g_um_upNabla_bool { - \um_map_single:nnn {Nabla}{up,it}{it} - } - } - \bool_if:NTF \g_um_literal_partial_bool { - \um_map_single:nnn {partial}{it}{it} - }{ - \bool_if:NF \g_um_uppartial_bool { - \um_map_single:nnn {partial}{up,it}{it} - } - } - \um_set_mathalphabet_pos:Nnnn \mathit {partial} {up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathit {Nabla} {up,it}{#1} -} -\cs_new:Npn \um_config_bb_latin:n #1 { - \um_set_mathalphabet_latin:Nnn \mathbb {up,it}{#1} -} -\cs_new:Npn \um_config_bb_Latin:n #1 { - \um_set_mathalphabet_Latin:Nnn \mathbb {up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathbb {C} {up,it} {#1} - \um_set_mathalphabet_pos:Nnnn \mathbb {H} {up,it} {#1} - \um_set_mathalphabet_pos:Nnnn \mathbb {N} {up,it} {#1} - \um_set_mathalphabet_pos:Nnnn \mathbb {P} {up,it} {#1} - \um_set_mathalphabet_pos:Nnnn \mathbb {Q} {up,it} {#1} - \um_set_mathalphabet_pos:Nnnn \mathbb {R} {up,it} {#1} - \um_set_mathalphabet_pos:Nnnn \mathbb {Z} {up,it} {#1} -} -\cs_new:Npn \um_config_bb_num:n #1 { - \um_set_mathalphabet_numbers:Nnn \mathbb {up}{#1} -} -\cs_new:Npn \um_config_bb_misc:n #1 { - \um_set_mathalphabet_pos:Nnnn \mathbb {Pi} {up,it} {#1} - \um_set_mathalphabet_pos:Nnnn \mathbb {pi} {up,it} {#1} - \um_set_mathalphabet_pos:Nnnn \mathbb {Gamma} {up,it} {#1} - \um_set_mathalphabet_pos:Nnnn \mathbb {gamma} {up,it} {#1} - \um_set_mathalphabet_pos:Nnnn \mathbb {summation} {up} {#1} -} -\cs_new:Npn \um_config_bbit_misc:n #1 { - \um_set_mathalphabet_pos:Nnnn \mathbbit {D} {up,it} {#1} - \um_set_mathalphabet_pos:Nnnn \mathbbit {d} {up,it} {#1} - \um_set_mathalphabet_pos:Nnnn \mathbbit {e} {up,it} {#1} - \um_set_mathalphabet_pos:Nnnn \mathbbit {i} {up,it} {#1} - \um_set_mathalphabet_pos:Nnnn \mathbbit {j} {up,it} {#1} -} -\cs_new:Npn \um_config_scr_Latin:n #1 { - \um_set_mathalphabet_Latin:Nnn \mathscr {up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathscr {B}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathscr {E}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathscr {F}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathscr {H}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathscr {I}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathscr {L}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathscr {M}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathscr {R}{up,it}{#1} -} -\cs_new:Npn \um_config_scr_latin:n #1 { - \um_set_mathalphabet_latin:Nnn \mathscr {up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathscr {e}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathscr {g}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathscr {o}{up,it}{#1} -} -\cs_new:Npn \um_config_cal_Latin:n #1 { - \um_set_mathalphabet_Latin:Nnn \mathcal {up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathcal {B}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathcal {E}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathcal {F}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathcal {H}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathcal {I}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathcal {L}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathcal {M}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathcal {R}{up,it}{#1} -} -\cs_new:Npn \um_config_frak_Latin:n #1 { - \um_set_mathalphabet_Latin:Nnn \mathfrak {up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathfrak {C}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathfrak {H}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathfrak {I}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathfrak {R}{up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathfrak {Z}{up,it}{#1} -} -\cs_new:Npn \um_config_frak_latin:n #1 { - \um_set_mathalphabet_latin:Nnn \mathfrak {up,it}{#1} -} -\cs_new:Npn \um_config_sfup_num:n #1 { - \um_set_mathalphabet_numbers:Nnn \mathsf {up}{#1} - \um_set_mathalphabet_numbers:Nnn \mathsfup {up}{#1} -} -\cs_new:Npn \um_config_sfup_Latin:n #1 { - \bool_if:NTF \g_um_sfliteral_bool { - \um_map_chars_Latin:nn {sfup} {#1} - \um_set_mathalphabet_Latin:Nnn \mathsf {up}{#1} - }{ - \bool_if:NT \g_um_upsans_bool { - \um_map_chars_Latin:nn {sfup,sfit} {#1} - \um_set_mathalphabet_Latin:Nnn \mathsf {up,it}{#1} - } - } - \um_set_mathalphabet_Latin:Nnn \mathsfup {up,it}{#1} -} -\cs_new:Npn \um_config_sfup_latin:n #1 { - \bool_if:NTF \g_um_sfliteral_bool { - \um_map_chars_latin:nn {sfup} {#1} - \um_set_mathalphabet_latin:Nnn \mathsf {up}{#1} - }{ - \bool_if:NT \g_um_upsans_bool { - \um_map_chars_latin:nn {sfup,sfit} {#1} - \um_set_mathalphabet_latin:Nnn \mathsf {up,it}{#1} - } - } - \um_set_mathalphabet_latin:Nnn \mathsfup {up,it}{#1} -} -\cs_new:Npn \um_config_sfit_Latin:n #1 { - \bool_if:NTF \g_um_sfliteral_bool { - \um_map_chars_Latin:nn {sfit} {#1} - \um_set_mathalphabet_Latin:Nnn \mathsf {it}{#1} - }{ - \bool_if:NF \g_um_upsans_bool { - \um_map_chars_Latin:nn {sfup,sfit} {#1} - \um_set_mathalphabet_Latin:Nnn \mathsf {up,it}{#1} - } - } - \um_set_mathalphabet_Latin:Nnn \mathsfit {up,it}{#1} -} -\cs_new:Npn \um_config_sfit_latin:n #1 { - \bool_if:NTF \g_um_sfliteral_bool { - \um_map_chars_latin:nn {sfit} {#1} - \um_set_mathalphabet_latin:Nnn \mathsf {it}{#1} - }{ - \bool_if:NF \g_um_upsans_bool { - \um_map_chars_latin:nn {sfup,sfit} {#1} - \um_set_mathalphabet_latin:Nnn \mathsf {up,it}{#1} - } - } - \um_set_mathalphabet_latin:Nnn \mathsfit {up,it}{#1} -} -\cs_new:Npn \um_config_tt_num:n #1 { - \um_set_mathalphabet_numbers:Nnn \mathtt {up}{#1} -} -\cs_new:Npn \um_config_tt_Latin:n #1 { - \um_set_mathalphabet_Latin:Nnn \mathtt {up,it}{#1} -} -\cs_new:Npn \um_config_tt_latin:n #1 { - \um_set_mathalphabet_latin:Nnn \mathtt {up,it}{#1} -} -\cs_new:Npn \um_config_bfit_Latin:n #1 { - \bool_if:NF \g_um_bfupLatin_bool { - \um_map_chars_Latin:nn {bfup,bfit} {#1} - } - \um_set_mathalphabet_Latin:Nnn \mathbfit {up,it}{#1} - \bool_if:NTF \g_um_bfliteral_bool { - \um_map_chars_Latin:nn {bfit} {#1} - \um_set_mathalphabet_Latin:Nnn \mathbf {it}{#1} - }{ - \bool_if:NF \g_um_bfupLatin_bool { - \um_map_chars_Latin:nn {bfup,bfit} {#1} - \um_set_mathalphabet_Latin:Nnn \mathbf {up,it}{#1} - } - } -} -\cs_new:Npn \um_config_bfit_latin:n #1 { - \bool_if:NF \g_um_bfuplatin_bool { - \um_map_chars_latin:nn {bfup,bfit} {#1} - } - \um_set_mathalphabet_latin:Nnn \mathbfit {up,it}{#1} - \bool_if:NTF \g_um_bfliteral_bool { - \um_map_chars_latin:nn {bfit} {#1} - \um_set_mathalphabet_latin:Nnn \mathbf {it}{#1} - }{ - \bool_if:NF \g_um_bfuplatin_bool { - \um_map_chars_latin:nn {bfup,bfit} {#1} - \um_set_mathalphabet_latin:Nnn \mathbf {up,it}{#1} - } - } -} -\cs_new:Npn \um_config_bfit_Greek:n #1 { - \um_set_mathalphabet_Greek:Nnn \mathbfit {up,it}{#1} - \bool_if:NTF \g_um_bfliteral_bool { - \um_map_chars_Greek:nn {bfit}{#1} - \um_set_mathalphabet_Greek:Nnn \mathbf {it}{#1} - }{ - \bool_if:NF \g_um_bfupGreek_bool { - \um_map_chars_Greek:nn {bfup,bfit}{#1} - \um_set_mathalphabet_Greek:Nnn \mathbf {up,it}{#1} - } - } -} -\cs_new:Npn \um_config_bfit_greek:n #1 { - \um_set_mathalphabet_greek:Nnn \mathbfit {up,it} {#1} - \bool_if:NTF \g_um_bfliteral_bool { - \um_map_chars_greek:nn {bfit} {#1} - \um_set_mathalphabet_greek:Nnn \mathbf {it} {#1} - }{ - \bool_if:NF \g_um_bfupgreek_bool { - \um_map_chars_greek:nn {bfit,bfup} {#1} - \um_set_mathalphabet_greek:Nnn \mathbf {up,it} {#1} - } - } -} -\cs_new:Npn \um_config_bfit_misc:n #1 { - \bool_if:NTF \g_um_literal_Nabla_bool { - \um_map_single:nnn {Nabla}{bfit}{#1} - }{ - \bool_if:NF \g_um_upNabla_bool { - \um_map_single:nnn {Nabla}{bfup,bfit}{#1} - } - } - \bool_if:NTF \g_um_literal_partial_bool { - \um_map_single:nnn {partial}{bfit}{#1} - }{ - \bool_if:NF \g_um_uppartial_bool { - \um_map_single:nnn {partial}{bfup,bfit}{#1} - } - } - \um_set_mathalphabet_pos:Nnnn \mathbfit {partial} {up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathbfit {Nabla} {up,it}{#1} - \bool_if:NTF \g_um_literal_partial_bool { - \um_set_mathalphabet_pos:Nnnn \mathbf {partial} {it}{#1} - }{ - \bool_if:NF \g_um_uppartial_bool { - \um_set_mathalphabet_pos:Nnnn \mathbf {partial} {up,it}{#1} - } - } - \bool_if:NTF \g_um_literal_Nabla_bool { - \um_set_mathalphabet_pos:Nnnn \mathbf {Nabla} {it}{#1} - }{ - \bool_if:NF \g_um_upNabla_bool { - \um_set_mathalphabet_pos:Nnnn \mathbf {Nabla} {up,it}{#1} - } - } -} -\cs_new:Npn \um_config_bfup_num:n #1 { - \um_set_mathalphabet_numbers:Nnn \mathbf {up}{#1} - \um_set_mathalphabet_numbers:Nnn \mathbfup {up}{#1} -} -\cs_new:Npn \um_config_bfup_Latin:n #1 { - \bool_if:NT \g_um_bfupLatin_bool { - \um_map_chars_Latin:nn {bfup,bfit} {#1} - } - \um_set_mathalphabet_Latin:Nnn \mathbfup {up,it}{#1} - \bool_if:NTF \g_um_bfliteral_bool { - \um_map_chars_Latin:nn {bfup} {#1} - \um_set_mathalphabet_Latin:Nnn \mathbf {up}{#1} - }{ - \bool_if:NT \g_um_bfupLatin_bool { - \um_map_chars_Latin:nn {bfup,bfit} {#1} - \um_set_mathalphabet_Latin:Nnn \mathbf {up,it}{#1} - } - } -} -\cs_new:Npn \um_config_bfup_latin:n #1 { - \bool_if:NT \g_um_bfuplatin_bool { - \um_map_chars_latin:nn {bfup,bfit} {#1} - } - \um_set_mathalphabet_latin:Nnn \mathbfup {up,it}{#1} - \bool_if:NTF \g_um_bfliteral_bool { - \um_map_chars_latin:nn {bfup} {#1} - \um_set_mathalphabet_latin:Nnn \mathbf {up}{#1} - }{ - \bool_if:NT \g_um_bfuplatin_bool { - \um_map_chars_latin:nn {bfup,bfit} {#1} - \um_set_mathalphabet_latin:Nnn \mathbf {up,it}{#1} - } - } -} -\cs_new:Npn \um_config_bfup_Greek:n #1 { - \um_set_mathalphabet_Greek:Nnn \mathbfup {up,it}{#1} - \bool_if:NTF \g_um_bfliteral_bool { - \um_map_chars_Greek:nn {bfup}{#1} - \um_set_mathalphabet_Greek:Nnn \mathbf {up}{#1} - }{ - \bool_if:NT \g_um_bfupGreek_bool { - \um_map_chars_Greek:nn {bfup,bfit}{#1} - \um_set_mathalphabet_Greek:Nnn \mathbf {up,it}{#1} - } - } -} -\cs_new:Npn \um_config_bfup_greek:n #1 { - \um_set_mathalphabet_greek:Nnn \mathbfup {up,it} {#1} - \bool_if:NTF \g_um_bfliteral_bool { - \um_map_chars_greek:nn {bfup} {#1} - \um_set_mathalphabet_greek:Nnn \mathbf {up} {#1} - }{ - \bool_if:NT \g_um_bfupgreek_bool { - \um_map_chars_greek:nn {bfup,bfit} {#1} - \um_set_mathalphabet_greek:Nnn \mathbf {up,it} {#1} - } - } -} -\cs_new:Npn \um_config_bfup_misc:n #1 { - \bool_if:NTF \g_um_literal_Nabla_bool { - \um_map_single:nnn {Nabla}{bfup}{#1} - }{ - \bool_if:NT \g_um_upNabla_bool { - \um_map_single:nnn {Nabla}{bfup,bfit}{#1} - } - } - \bool_if:NTF \g_um_literal_partial_bool { - \um_map_single:nnn {partial}{bfup}{#1} - }{ - \bool_if:NT \g_um_uppartial_bool { - \um_map_single:nnn {partial}{bfup,bfit}{#1} - } - } - \um_set_mathalphabet_pos:Nnnn \mathbfup {partial} {up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathbfup {Nabla} {up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathbfup {digamma} {up}{#1} - \um_set_mathalphabet_pos:Nnnn \mathbfup {Digamma} {up}{#1} - \um_set_mathalphabet_pos:Nnnn \mathbf {digamma} {up}{#1} - \um_set_mathalphabet_pos:Nnnn \mathbf {Digamma} {up}{#1} - \bool_if:NTF \g_um_literal_partial_bool { - \um_set_mathalphabet_pos:Nnnn \mathbf {partial} {up}{#1} - }{ - \bool_if:NT \g_um_uppartial_bool { - \um_set_mathalphabet_pos:Nnnn \mathbf {partial} {up,it}{#1} - } - } - \bool_if:NTF \g_um_literal_Nabla_bool { - \um_set_mathalphabet_pos:Nnnn \mathbf {Nabla} {up}{#1} - }{ - \bool_if:NT \g_um_upNabla_bool { - \um_set_mathalphabet_pos:Nnnn \mathbf {Nabla} {up,it}{#1} - } - } -} -\cs_new:Npn \um_config_bffrak_Latin:n #1 { - \um_set_mathalphabet_Latin:Nnn \mathbffrak {up,it}{#1} -} -\cs_new:Npn \um_config_bffrak_latin:n #1 { - \um_set_mathalphabet_latin:Nnn \mathbffrak {up,it}{#1} -} -\cs_new:Npn \um_config_bfscr_Latin:n #1 { - \um_set_mathalphabet_Latin:Nnn \mathbfscr {up,it}{#1} -} -\cs_new:Npn \um_config_bfscr_latin:n #1 { - \um_set_mathalphabet_latin:Nnn \mathbfscr {up,it}{#1} -} -\cs_new:Npn \um_config_bfcal_Latin:n #1 { - \um_set_mathalphabet_Latin:Nnn \mathbfcal {up,it}{#1} -} -\cs_new:Npn \um_config_bfsfup_num:n #1 { - \um_set_mathalphabet_numbers:Nnn \mathbfsf {up}{#1} - \um_set_mathalphabet_numbers:Nnn \mathbfsfup {up}{#1} -} -\cs_new:Npn \um_config_bfsfup_Latin:n #1 { - \bool_if:NTF \g_um_sfliteral_bool { - \um_map_chars_Latin:nn {bfsfup} {#1} - \um_set_mathalphabet_Latin:Nnn \mathbfsf {up}{#1} - }{ - \bool_if:NT \g_um_upsans_bool { - \um_map_chars_Latin:nn {bfsfup,bfsfit} {#1} - \um_set_mathalphabet_Latin:Nnn \mathbfsf {up,it}{#1} - } - } - \um_set_mathalphabet_Latin:Nnn \mathbfsfup {up,it}{#1} -} -\cs_new:Npn \um_config_bfsfup_latin:n #1 { - \bool_if:NTF \g_um_sfliteral_bool { - \um_map_chars_latin:nn {bfsfup} {#1} - \um_set_mathalphabet_latin:Nnn \mathbfsf {up}{#1} - }{ - \bool_if:NT \g_um_upsans_bool { - \um_map_chars_latin:nn {bfsfup,bfsfit} {#1} - \um_set_mathalphabet_latin:Nnn \mathbfsf {up,it}{#1} - } - } - \um_set_mathalphabet_latin:Nnn \mathbfsfup {up,it}{#1} -} -\cs_new:Npn \um_config_bfsfup_Greek:n #1 { - \bool_if:NTF \g_um_sfliteral_bool { - \um_map_chars_Greek:nn {bfsfup}{#1} - \um_set_mathalphabet_Greek:Nnn \mathbfsf {up}{#1} - }{ - \bool_if:NT \g_um_upsans_bool { - \um_map_chars_Greek:nn {bfsfup,bfsfit}{#1} - \um_set_mathalphabet_Greek:Nnn \mathbfsf {up,it}{#1} - } - } - \um_set_mathalphabet_Greek:Nnn \mathbfsfup {up,it}{#1} -} -\cs_new:Npn \um_config_bfsfup_greek:n #1 { - \bool_if:NTF \g_um_sfliteral_bool { - \um_map_chars_greek:nn {bfsfup} {#1} - \um_set_mathalphabet_greek:Nnn \mathbfsf {up} {#1} - }{ - \bool_if:NT \g_um_upsans_bool { - \um_map_chars_greek:nn {bfsfup,bfsfit} {#1} - \um_set_mathalphabet_greek:Nnn \mathbfsf {up,it} {#1} - } - } - \um_set_mathalphabet_greek:Nnn \mathbfsfup {up,it} {#1} -} -\cs_new:Npn \um_config_bfsfup_misc:n #1 { - \bool_if:NTF \g_um_literal_Nabla_bool { - \um_map_single:nnn {Nabla}{bfsfup}{#1} - }{ - \bool_if:NT \g_um_upNabla_bool { - \um_map_single:nnn {Nabla}{bfsfup,bfsfit}{#1} - } - } - \bool_if:NTF \g_um_literal_partial_bool { - \um_map_single:nnn {partial}{bfsfup}{#1} - }{ - \bool_if:NT \g_um_uppartial_bool { - \um_map_single:nnn {partial}{bfsfup,bfsfit}{#1} - } - } - \um_set_mathalphabet_pos:Nnnn \mathbfsfup {partial} {up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathbfsfup {Nabla} {up,it}{#1} - \bool_if:NTF \g_um_literal_partial_bool { - \um_set_mathalphabet_pos:Nnnn \mathbfsf {partial} {up}{#1} - }{ - \bool_if:NT \g_um_uppartial_bool { - \um_set_mathalphabet_pos:Nnnn \mathbfsf {partial} {up,it}{#1} - } - } - \bool_if:NTF \g_um_literal_Nabla_bool { - \um_set_mathalphabet_pos:Nnnn \mathbfsf {Nabla} {up}{#1} - }{ - \bool_if:NT \g_um_upNabla_bool { - \um_set_mathalphabet_pos:Nnnn \mathbfsf {Nabla} {up,it}{#1} - } - } -} -\cs_new:Npn \um_config_bfsfit_Latin:n #1 { - \bool_if:NTF \g_um_sfliteral_bool { - \um_map_chars_Latin:nn {bfsfit} {#1} - \um_set_mathalphabet_Latin:Nnn \mathbfsf {it}{#1} - }{ - \bool_if:NF \g_um_upsans_bool { - \um_map_chars_Latin:nn {bfsfup,bfsfit} {#1} - \um_set_mathalphabet_Latin:Nnn \mathbfsf {up,it}{#1} - } - } - \um_set_mathalphabet_Latin:Nnn \mathbfsfit {up,it}{#1} -} -\cs_new:Npn \um_config_bfsfit_latin:n #1 { - \bool_if:NTF \g_um_sfliteral_bool { - \um_map_chars_latin:nn {bfsfit} {#1} - \um_set_mathalphabet_latin:Nnn \mathbfsf {it}{#1} - }{ - \bool_if:NF \g_um_upsans_bool { - \um_map_chars_latin:nn {bfsfup,bfsfit} {#1} - \um_set_mathalphabet_latin:Nnn \mathbfsf {up,it}{#1} - } - } - \um_set_mathalphabet_latin:Nnn \mathbfsfit {up,it}{#1} -} -\cs_new:Npn \um_config_bfsfit_Greek:n #1 { - \bool_if:NTF \g_um_sfliteral_bool { - \um_map_chars_Greek:nn {bfsfit}{#1} - \um_set_mathalphabet_Greek:Nnn \mathbfsf {it}{#1} - }{ - \bool_if:NF \g_um_upsans_bool { - \um_map_chars_Greek:nn {bfsfup,bfsfit}{#1} - \um_set_mathalphabet_Greek:Nnn \mathbfsf {up,it}{#1} - } - } - \um_set_mathalphabet_Greek:Nnn \mathbfsfit {up,it}{#1} -} -\cs_new:Npn \um_config_bfsfit_greek:n #1 { - \bool_if:NTF \g_um_sfliteral_bool { - \um_map_chars_greek:nn {bfsfit} {#1} - \um_set_mathalphabet_greek:Nnn \mathbfsf {it} {#1} - }{ - \bool_if:NF \g_um_upsans_bool { - \um_map_chars_greek:nn {bfsfup,bfsfit} {#1} - \um_set_mathalphabet_greek:Nnn \mathbfsf {up,it} {#1} - } - } - \um_set_mathalphabet_greek:Nnn \mathbfsfit {up,it} {#1} -} -\cs_new:Npn \um_config_bfsfit_misc:n #1 { - \bool_if:NTF \g_um_literal_Nabla_bool { - \um_map_single:nnn {Nabla}{bfsfit}{#1} - }{ - \bool_if:NF \g_um_upNabla_bool { - \um_map_single:nnn {Nabla}{bfsfup,bfsfit}{#1} - } - } - \bool_if:NTF \g_um_literal_partial_bool { - \um_map_single:nnn {partial}{bfsfit}{#1} - }{ - \bool_if:NF \g_um_uppartial_bool { - \um_map_single:nnn {partial}{bfsfup,bfsfit}{#1} - } - } - \um_set_mathalphabet_pos:Nnnn \mathbfsfit {partial} {up,it}{#1} - \um_set_mathalphabet_pos:Nnnn \mathbfsfit {Nabla} {up,it}{#1} - \bool_if:NTF \g_um_literal_partial_bool { - \um_set_mathalphabet_pos:Nnnn \mathbfsf {partial} {it}{#1} - }{ - \bool_if:NF \g_um_uppartial_bool { - \um_set_mathalphabet_pos:Nnnn \mathbfsf {partial} {up,it}{#1} - } - } - \bool_if:NTF \g_um_literal_Nabla_bool { - \um_set_mathalphabet_pos:Nnnn \mathbfsf {Nabla} {it}{#1} - }{ - \bool_if:NF \g_um_upNabla_bool { - \um_set_mathalphabet_pos:Nnnn \mathbfsf {Nabla} {up,it}{#1} - } - } -} -\xetex_or_luatex:nnn { \cs_set:Npn \um_symbol_setup: } - { - \cs_set:Npn \UnicodeMathSymbol ##1##2##3##4 { - \prg_case_tl:Nnn ##3 { \mathover {} \mathunder {} } - { - \exp_not:n {\_um_sym:nnn{##1}{##2}{##3}} - } - } - } - { - \cs_set:Npn \UnicodeMathSymbol ##1##2##3##4 { - \exp_not:n {\_um_sym:nnn{##1}{##2}{##3}} - } - } -\CatchFileEdef \g_um_mathtable_tl {unicode-math-table.tex} {\um_symbol_setup:} -\cs_new:Npn \um_input_math_symbol_table: {\g_um_mathtable_tl} -\begingroup - \char_set_catcode_other:N \^ - \cs_gset:Npn \um_cs_set_eq_active_char:Nw #1 = "#2 \q_nil { - \lowercase{ - \tl_rescan:nn { - \char_set_catcode_other:N \{ - \char_set_catcode_other:N \} - \char_set_catcode_other:N \& - \char_set_catcode_other:N \% - \char_set_catcode_other:N \$ - }{ - \global\let#1=^^^^^#2 - } - } - } - \cs_gnew:Npn \um_active_char_set:wc "#1 \q_nil #2 { - \lowercase { - \tl_rescan:nn { - \catcode`\_=11\relax - \catcode`\:=11\relax - \catcode`\^=7\relax - }{ - \protected\gdef^^^^^#1{\csname #2\endcsname}% - } - } - } -\endgroup -\AtBeginDocument{\um_define_math_chars:} -\cs_set:Nn \um_define_math_chars: { - \group_begin: - \char_set_catcode_math_superscript:N \^ - \cs_set:Npn \_um_sym:nnn ##1##2##3 { - \bool_if:nF { \cs_if_eq_p:NN ##3 \mathaccent || - \cs_if_eq_p:NN ##3 \mathopen || - \cs_if_eq_p:NN ##3 \mathclose || - \cs_if_eq_p:NN ##3 \mathover || - \cs_if_eq_p:NN ##3 \mathunder } { - \um_cs_set_eq_active_char:Nw ##2 = ##1 \q_nil \ignorespaces - } - } - \char_set_catcode_other:N \# - \um_input_math_symbol_table: - \group_end: -} -\group_begin: - \lccode`\*=`\\ - \char_set_catcode_escape:N \| - \char_set_catcode_other:N \\ - |lowercase{ - |AtBeginDocument{ - |let|backslash=* - } - } -|group_end: -\cs_new:Nn \um_arg_i_before_egroup:n {#1\egroup} -\cs_new:Nn \um_superscript:n { - ^\bgroup #1 - \peek_meaning_remove:NTF ^ - \um_arg_i_before_egroup:n \egroup -} -\muskip_new:N \g_um_primekern_muskip -\muskip_gset:Nn \g_um_primekern_muskip { -\thinmuskip/2 }% arbitrary -\int_new:N \l_um_primecount_int -\cs_new:Npn \um_nprimes:Nn #1#2 { - \um_superscript:n { - #1 - \prg_replicate:nn {#2-1} { \mskip \g_um_primekern_muskip #1 } - } -} -\cs_new:Npn \um_nprimes_select:nn #1#2 { - \prg_case_int:nnn {#2}{ - {1} { \um_superscript:n {#1} } - {2} { - \um_glyph_if_exist:nTF {"2033} - { \um_superscript:n {\um_prime_double_mchar} } - { \um_nprimes:Nn #1 {#2} } - } - {3} { - \um_glyph_if_exist:nTF {"2034} - { \um_superscript:n {\um_prime_triple_mchar} } - { \um_nprimes:Nn #1 {#2} } - } - {4} { - \um_glyph_if_exist:nTF {"2057} - { \um_superscript:n {\um_prime_quad_mchar} } - { \um_nprimes:Nn #1 {#2} } - } - }{ - \um_nprimes:Nn #1 {#2} - } -} -\cs_new:Npn \um_nbackprimes_select:nn #1#2 { - \prg_case_int:nnn {#2}{ - {1} { \um_superscript:n {#1} } - {2} { - \um_glyph_if_exist:nTF {"2036} - { \um_superscript:n {\um_backprime_double_mchar} } - { \um_nprimes:Nn #1 {#2} } - } - {3} { - \um_glyph_if_exist:nTF {"2037} - { \um_superscript:n {\um_backprime_triple_mchar} } - { \um_nprimes:Nn #1 {#2} } - } - }{ - \um_nprimes:Nn #1 {#2} - } -} -\cs_new:Npn \um_scan_prime: { - \cs_set_eq:NN \um_superscript:n \use:n - \int_zero:N \l_um_primecount_int - \um_scanprime_collect:N \um_prime_single_mchar -} -\cs_new:Npn \um_scan_dprime: { - \cs_set_eq:NN \um_superscript:n \use:n - \int_set:Nn \l_um_primecount_int {1} - \um_scanprime_collect:N \um_prime_single_mchar -} -\cs_new:Npn \um_scan_trprime: { - \cs_set_eq:NN \um_superscript:n \use:n - \int_set:Nn \l_um_primecount_int {2} - \um_scanprime_collect:N \um_prime_single_mchar -} -\cs_new:Npn \um_scan_qprime: { - \cs_set_eq:NN \um_superscript:n \use:n - \int_set:Nn \l_um_primecount_int {3} - \um_scanprime_collect:N \um_prime_single_mchar -} -\cs_new:Npn \um_scan_sup_prime: { - \int_zero:N \l_um_primecount_int - \um_scanprime_collect:N \um_prime_single_mchar -} -\cs_new:Npn \um_scan_sup_dprime: { - \int_set:Nn \l_um_primecount_int {1} - \um_scanprime_collect:N \um_prime_single_mchar -} -\cs_new:Npn \um_scan_sup_trprime: { - \int_set:Nn \l_um_primecount_int {2} - \um_scanprime_collect:N \um_prime_single_mchar -} -\cs_new:Npn \um_scan_sup_qprime: { - \int_set:Nn \l_um_primecount_int {3} - \um_scanprime_collect:N \um_prime_single_mchar -} -\cs_new:Npn \um_scanprime_collect:N #1 { - \int_incr:N \l_um_primecount_int - \peek_meaning_remove:NTF ' { - \um_scanprime_collect:N #1 - }{ - \peek_meaning_remove:NTF \um_scan_prime: { - \um_scanprime_collect:N #1 - }{ - \peek_meaning_remove:NTF ^^^^2032 { - \um_scanprime_collect:N #1 - }{ - \peek_meaning_remove:NTF \um_scan_dprime: { - \int_incr:N \l_um_primecount_int - \um_scanprime_collect:N #1 - }{ - \peek_meaning_remove:NTF ^^^^2033 { - \int_incr:N \l_um_primecount_int - \um_scanprime_collect:N #1 - }{ - \peek_meaning_remove:NTF \um_scan_trprime: { - \int_add:Nn \l_um_primecount_int {2} - \um_scanprime_collect:N #1 - }{ - \peek_meaning_remove:NTF ^^^^2034 { - \int_add:Nn \l_um_primecount_int {2} - \um_scanprime_collect:N #1 - }{ - \peek_meaning_remove:NTF \um_scan_qprime: { - \int_add:Nn \l_um_primecount_int {3} - \um_scanprime_collect:N #1 - }{ - \peek_meaning_remove:NTF ^^^^2057 { - \int_add:Nn \l_um_primecount_int {3} - \um_scanprime_collect:N #1 - }{ - \um_nprimes_select:nn {#1} {\l_um_primecount_int} - } - } - } - } - } - } - } - } - } -} -\cs_new:Npn \um_scan_backprime: { - \cs_set_eq:NN \um_superscript:n \use:n - \int_zero:N \l_um_primecount_int - \um_scanbackprime_collect:N \um_backprime_single_mchar -} -\cs_new:Npn \um_scan_backdprime: { - \cs_set_eq:NN \um_superscript:n \use:n - \int_set:Nn \l_um_primecount_int {1} - \um_scanbackprime_collect:N \um_backprime_single_mchar -} -\cs_new:Npn \um_scan_backtrprime: { - \cs_set_eq:NN \um_superscript:n \use:n - \int_set:Nn \l_um_primecount_int {2} - \um_scanbackprime_collect:N \um_backprime_single_mchar + Small~ fraction~ command~ \protect\tfrac\ not~ defined.\\ + Load~ amsmath~ or~ define~ it~ manually~ before~ loading~ unicode-math. } -\cs_new:Npn \um_scan_sup_backprime: { - \int_zero:N \l_um_primecount_int - \um_scanbackprime_collect:N \um_backprime_single_mchar +\msg_new:nnn {unicode-math} {default-math-font} +{ + Defining~ the~ default~ maths~ font~ as~ '\l_um_fontname_tl'. } -\cs_new:Npn \um_scan_sup_backdprime: { - \int_set:Nn \l_um_primecount_int {1} - \um_scanbackprime_collect:N \um_backprime_single_mchar +\msg_new:nnn {unicode-math} {setup-implicit} +{ + Setup~ alphabets:~ implicit~ mode. } -\cs_new:Npn \um_scan_sup_backtrprime: { - \int_set:Nn \l_um_primecount_int {2} - \um_scanbackprime_collect:N \um_backprime_single_mchar +\msg_new:nnn {unicode-math} {setup-explicit} +{ + Setup~ alphabets:~ explicit~ mode. } -\cs_new:Npn \um_scanbackprime_collect:N #1 { - \int_incr:N \l_um_primecount_int - \peek_meaning_remove:NTF ` { - \um_scanbackprime_collect:N #1 - }{ - \peek_meaning_remove:NTF \um_scan_backprime: { - \um_scanbackprime_collect:N #1 - }{ - \peek_meaning_remove:NTF ^^^^2035 { - \um_scanbackprime_collect:N #1 - }{ - \peek_meaning_remove:NTF \um_scan_backdprime: { - \int_incr:N \l_um_primecount_int - \um_scanbackprime_collect:N #1 - }{ - \peek_meaning_remove:NTF ^^^^2036 { - \int_incr:N \l_um_primecount_int - \um_scanbackprime_collect:N #1 - }{ - \peek_meaning_remove:NTF \um_scan_backtrprime: { - \int_add:Nn \l_um_primecount_int {2} - \um_scanbackprime_collect:N #1 - }{ - \peek_meaning_remove:NTF ^^^^2037 { - \int_add:Nn \l_um_primecount_int {2} - \um_scanbackprime_collect:N #1 - }{ - \um_nbackprimes_select:nn {#1} {\l_um_primecount_int} - } - } - } - } - } - } - } +\msg_new:nnn {unicode-math} {alph-initialise} +{ + Initialising~ \@backslashchar math#1. } -\AtBeginDocument{\um_define_prime_commands: \um_define_prime_chars:} -\cs_set:Nn \um_define_prime_commands: { - \cs_set_eq:NN \prime \um_prime_single_mchar - \cs_set_eq:NN \dprime \um_prime_double_mchar - \cs_set_eq:NN \trprime \um_prime_triple_mchar - \cs_set_eq:NN \qprime \um_prime_quad_mchar - \cs_set_eq:NN \backprime \um_backprime_single_mchar - \cs_set_eq:NN \backdprime \um_backprime_double_mchar - \cs_set_eq:NN \backtrprime \um_backprime_triple_mchar +\msg_new:nnn {unicode-math} {setup-alph} +{ + Setup~ alphabet:~ #1. } -\group_begin: - \char_set_catcode_active:N \' - \char_set_catcode_active:N \` - \char_set_catcode_active:n {"2032} - \char_set_catcode_active:n {"2033} - \char_set_catcode_active:n {"2034} - \char_set_catcode_active:n {"2057} - \char_set_catcode_active:n {"2035} - \char_set_catcode_active:n {"2036} - \char_set_catcode_active:n {"2037} - \cs_gset:Nn \um_define_prime_chars: { - \cs_set_eq:NN ' \um_scan_sup_prime: - \cs_set_eq:NN ^^^^2032 \um_scan_sup_prime: - \cs_set_eq:NN ^^^^2033 \um_scan_sup_dprime: - \cs_set_eq:NN ^^^^2034 \um_scan_sup_trprime: - \cs_set_eq:NN ^^^^2057 \um_scan_sup_qprime: - \cs_set_eq:NN ` \um_scan_sup_backprime: - \cs_set_eq:NN ^^^^2035 \um_scan_sup_backprime: - \cs_set_eq:NN ^^^^2036 \um_scan_sup_backdprime: - \cs_set_eq:NN ^^^^2037 \um_scan_sup_backtrprime: - } -\group_end: -\AtBeginDocument{\um_redefine_radical:} -\xetex_or_luatex:nnn { \cs_set:Nn \um_redefine_radical: } { - \@ifpackageloaded { amsmath } { } { - \cs_set_nopar:Npn \r@@t ##1 ##2 { - \hbox_set:Nn \l_tmpa_box { - \c_math_toggle_token - \m@th - ##1 - \sqrtsign { ##2 } - \c_math_toggle_token - } - \um_mathstyle_scale:Nnn ##1 { \kern } { - \fontdimen 63 \l_um_font - } - \box_move_up:nn { - (\box_ht:N \l_tmpa_box - \box_dp:N \l_tmpa_box) - * \number \fontdimen 65 \l_um_font / 100 - } { - \box_use:N \rootbox - } - \um_mathstyle_scale:Nnn ##1 { \kern } { - \fontdimen 64 \l_um_font - } - \box_use_clear:N \l_tmpa_box - } - } +\msg_new:nnnn { unicode-math } { no-font-selected } { + You've~ loaded~ the~ unicode-math~ package,~ but~ you~ forgot~ to~ select \\ + a~ Unicode~ math~ font.~ Please~ select~ one~ with~ the~ \token_to_str:N \setmathfont \\ + command. } { - \@ifpackageloaded { amsmath } { } { - \cs_set:Npn \root ##1 \of ##2 { - \luatexUroot \l_um_radical_sqrt_tl { ##1 } { ##2 } - } - } -} -\cs_new:Npn \um_fontdimen_to_percent:nn #1#2 { - \strip@pt\dimexpr\fontdimen#1#2*65536/100\relax -} -\cs_new:Npn \um_mathstyle_scale:Nnn #1#2#3 { - \ifx#1\scriptstyle - #2\um_fontdimen_to_percent:nn{10}\l_um_font#3 - \else - \ifx#1\scriptscriptstyle - #2\um_fontdimen_to_percent:nn{11}\l_um_font#3 - \else - #2#3 - \fi - \fi -} -\prop_new:N \g_um_supers_prop -\prop_new:N \g_um_subs_prop -\group_begin: -\cs_set:Npn \um_setup_active_superscript:nn #1#2 { - \prop_gput:Nxn \g_um_supers_prop {\meaning #1} {#2} - \char_set_catcode_active:N #1 - \char_gmake_mathactive:N #1 - \scantokens{ - \cs_gset:Npn #1 { - \tl_set:Nn \l_um_ss_chain_tl {#2} - \cs_set_eq:NN \um_sub_or_super:n \sp - \tl_set:Nn \l_um_tmpa_tl {supers} - \um_scan_sscript: - } - } -} -\um_setup_active_superscript:nn {^^^^2070} {0} -\um_setup_active_superscript:nn {^^^^00b9} {1} -\um_setup_active_superscript:nn {^^^^00b2} {2} -\um_setup_active_superscript:nn {^^^^00b3} {3} -\um_setup_active_superscript:nn {^^^^2074} {4} -\um_setup_active_superscript:nn {^^^^2075} {5} -\um_setup_active_superscript:nn {^^^^2076} {6} -\um_setup_active_superscript:nn {^^^^2077} {7} -\um_setup_active_superscript:nn {^^^^2078} {8} -\um_setup_active_superscript:nn {^^^^2079} {9} -\um_setup_active_superscript:nn {^^^^207a} {+} -\um_setup_active_superscript:nn {^^^^207b} {-} -\um_setup_active_superscript:nn {^^^^207c} {=} -\um_setup_active_superscript:nn {^^^^207d} {(} -\um_setup_active_superscript:nn {^^^^207e} {)} -\um_setup_active_superscript:nn {^^^^2071} {i} -\um_setup_active_superscript:nn {^^^^207f} {n} -\cs_set:Npn \um_setup_active_subscript:nn #1#2 { - \prop_gput:Nxn \g_um_subs_prop {\meaning #1} {#2} - \char_set_catcode_active:N #1 - \char_gmake_mathactive:N #1 - \scantokens{ - \cs_gset:Npn #1 { - \tl_set:Nn \l_um_ss_chain_tl {#2} - \cs_set_eq:NN \um_sub_or_super:n \sb - \tl_set:Nn \l_um_tmpa_tl {subs} - \um_scan_sscript: - } - } -} -\um_setup_active_subscript:nn {^^^^2080} {0} -\um_setup_active_subscript:nn {^^^^2081} {1} -\um_setup_active_subscript:nn {^^^^2082} {2} -\um_setup_active_subscript:nn {^^^^2083} {3} -\um_setup_active_subscript:nn {^^^^2084} {4} -\um_setup_active_subscript:nn {^^^^2085} {5} -\um_setup_active_subscript:nn {^^^^2086} {6} -\um_setup_active_subscript:nn {^^^^2087} {7} -\um_setup_active_subscript:nn {^^^^2088} {8} -\um_setup_active_subscript:nn {^^^^2089} {9} -\um_setup_active_subscript:nn {^^^^208a} {+} -\um_setup_active_subscript:nn {^^^^208b} {-} -\um_setup_active_subscript:nn {^^^^208c} {=} -\um_setup_active_subscript:nn {^^^^208d} {(} -\um_setup_active_subscript:nn {^^^^208e} {)} -\um_setup_active_subscript:nn {^^^^2090} {a} -\um_setup_active_subscript:nn {^^^^2091} {e} -\um_setup_active_subscript:nn {^^^^1d62} {i} -\um_setup_active_subscript:nn {^^^^2092} {o} -\um_setup_active_subscript:nn {^^^^1d63} {r} -\um_setup_active_subscript:nn {^^^^1d64} {u} -\um_setup_active_subscript:nn {^^^^1d65} {v} -\um_setup_active_subscript:nn {^^^^2093} {x} -\um_setup_active_subscript:nn {^^^^1d66} {\beta} -\um_setup_active_subscript:nn {^^^^1d67} {\gamma} -\um_setup_active_subscript:nn {^^^^1d68} {\rho} -\um_setup_active_subscript:nn {^^^^1d69} {\phi} -\um_setup_active_subscript:nn {^^^^1d6a} {\chi} -\group_end: -\cs_new:Npn \um_scan_sscript: { - \um_scan_sscript:TF { - \um_scan_sscript: - }{ - \um_sub_or_super:n {\l_um_ss_chain_tl} - } -} -\cs_new:Npn \um_scan_sscript:TF #1#2 { - \tl_set:Nx \l_peek_true_aux_tl { \exp_not:n{ #1 } } - \tl_set_eq:NN \l_peek_true_tl \c_peek_true_remove_next_tl - \tl_set:Nx \l_peek_false_tl {\exp_not:n{\group_align_safe_end: #2}} - \group_align_safe_begin: - \peek_after:NN \um_peek_execute_branches_ss: -} -\cs_new:Npn \um_peek_execute_branches_ss: { - \bool_if:nTF { - \token_if_eq_catcode_p:NN \l_peek_token \c_group_begin_token || - \token_if_eq_catcode_p:NN \l_peek_token \c_group_end_token || - \token_if_eq_meaning_p:NN \l_peek_token \c_space_token - } - { \l_peek_false_tl } - { \um_peek_execute_branches_ss_aux: } -} -\cs_new:Npn \um_peek_execute_branches_ss_aux: { - \prop_if_in:cxTF - {g_um_\l_um_tmpa_tl _prop} - {\meaning\l_peek_token} - { - \prop_get:cxN - {g_um_\l_um_tmpa_tl _prop} - {\meaning\l_peek_token} - \l_um_tmpb_tl - \tl_put_right:NV \l_um_ss_chain_tl \l_um_tmpb_tl - \l_peek_true_tl - } - {\l_peek_false_tl} -} -\cs_new:Npn \um_define_active_frac:Nw #1 #2/#3 { - \char_set_catcode_active:N #1 - \char_gmake_mathactive:N #1 - \tl_rescan:nn { - \catcode`\_=11\relax - \catcode`\:=11\relax - }{ - \cs_gset:Npx #1 { - \bool_if:NTF \l_um_smallfrac_bool {\exp_not:N\tfrac} {\exp_not:N\frac} - {#2} {#3} - } - } -} -\cs_new:Npn \um_setup_active_frac: { - \group_begin: - \um_define_active_frac:Nw ^^^^2189 0/3 - \um_define_active_frac:Nw ^^^^2152 1/{10} - \um_define_active_frac:Nw ^^^^2151 1/9 - \um_define_active_frac:Nw ^^^^215b 1/8 - \um_define_active_frac:Nw ^^^^2150 1/7 - \um_define_active_frac:Nw ^^^^2159 1/6 - \um_define_active_frac:Nw ^^^^2155 1/5 - \um_define_active_frac:Nw ^^^^00bc 1/4 - \um_define_active_frac:Nw ^^^^2153 1/3 - \um_define_active_frac:Nw ^^^^215c 3/8 - \um_define_active_frac:Nw ^^^^2156 2/5 - \um_define_active_frac:Nw ^^^^00bd 1/2 - \um_define_active_frac:Nw ^^^^2157 3/5 - \um_define_active_frac:Nw ^^^^215d 5/8 - \um_define_active_frac:Nw ^^^^2154 2/3 - \um_define_active_frac:Nw ^^^^00be 3/4 - \um_define_active_frac:Nw ^^^^2158 4/5 - \um_define_active_frac:Nw ^^^^215a 5/6 - \um_define_active_frac:Nw ^^^^215e 7/8 - \group_end: -} -\um_setup_active_frac: -\def\to{\rightarrow} -\def\le{\leq} -\def\ge{\geq} -\def\neq{\ne} -\def\triangle{\mathord{\bigtriangleup}} -\def\bigcirc{\mdlgwhtcircle} -\def\circ{\vysmwhtcircle} -\def\bullet{\smblkcircle} -\def\mathyen{\yen} -\def\mathsterling{\sterling} -\def\diamond{\smwhtdiamond} -\def\emptyset{\varnothing} -\def\hbar{\hslash} -\def\land{\wedge} -\def\lor{\vee} -\def\owns{\ni} -\def\gets{\leftarrow} -\def\mathring{\ocirc} -\def\backepsilon{\upbackepsilon} -\def\eth{\matheth} -\def\smallint{{\textstyle\int}\limits} -\@ifpackageloaded{amsmath}{ - % define their own colon, perhaps I should just steal it. (It does look much better.) -}{ - \cs_set_protected:Npn \colon { - \bool_if:NTF \g_um_literal_colon_bool {:} { \mathpunct{:} } - } -} -\def\mathrm{\mathup} -\let\mathfence\mathord -\def\digamma{\updigamma} -\def\Digamma{\upDigamma} -\def\operator@font{\um_switchto_mathup:} -\chk_if_free_cs:N \um_tmpa:w -\cs_new_protected_nopar:Npn \um_check_and_fix:NNnnnn #1 #2 #3 #4 #5 #6 { - \cs_if_exist:NT #1 { - \token_if_macro:NTF #1 { - \group_begin: - #2 \um_tmpa:w #3 { #4 } - \cs_if_eq:NNTF #1 \um_tmpa:w { - \msg_info:nnx { unicode-math } { patch-macro } - { \token_to_str:N #1 } - \group_end: - \xetex_or_luatex:nnn { #2 #1 #3 } { #6 } { #5 } - } { - \msg_warning:nnxxx { unicode-math } { wrong-meaning } - { \token_to_str:N #1 } { \token_to_meaning:N #1 } - { \token_to_meaning:N \um_tmpa:w } - \group_end: - } - } { - \msg_warning:nnx { unicode-math } { macro-expected } - { \token_to_str:N #1 } - } - } -} -\cs_new_protected_nopar:Npn \um_check_and_fix:NNnnn #1 #2 #3 #4 #5 { - \um_check_and_fix:NNnnnn #1 #2 { #3 } { #4 } { #5 } { #5 } -} -\cs_new_protected_nopar:Npn \um_check_and_fix_luatex:NNnnn #1 #2 #3 #4 #5 { - \luatex_if_engine:T { - \um_check_and_fix:NNnnn #1 #2 { #3 } { #4 } { #5 } - } -} -\cs_generate_variant:Nn \um_check_and_fix_luatex:NNnnn { c } -\AtEndOfPackageFile * {url} { - \tl_put_left:Nn \Url@FormatString { \um_switchto_mathup: } - \tl_put_right:Nn \UrlSpecials { - \do\`{\mathchar`\`} - \do\'{\mathchar`\'} - \do\${\mathchar`\$} - \do\&{\mathchar`\&} - } -} -\AtEndOfPackageFile * {amsmath} { - \xetex_if_engine:T { - \tl_remove_in:Nn \@begindocumenthook { - \mathchardef\std@minus\mathcode`\-\relax - \mathchardef\std@equal\mathcode`\=\relax - } - \def\std@minus{\Umathcharnum\Umathcodenum`\-\relax} - \def\std@equal{\Umathcharnum\Umathcodenum`\=\relax} - } - \cs_set:Npn \@cdots {\mathinner{\cdots}} - \cs_set_eq:NN \dotsb@ \cdots - \xetex_if_engine:T { - \def \resetMathstrut@ {% - \setbox\z@\hbox{$($}%) - \ht\Mathstrutbox@\ht\z@ \dp\Mathstrutbox@\dp\z@ - } - } - \xetex_if_engine:T { - \um_check_and_fix:NNnnn \subarray \cs_set:Npn { #1 } { - \vcenter - \bgroup - \Let@ - \restore@math@cr - \default@tag - \baselineskip \fontdimen 10~ \scriptfont \tw@ - \advance \baselineskip \fontdimen 12~ \scriptfont \tw@ - \lineskip \thr@@ \fontdimen 8~ \scriptfont \thr@@ - \lineskiplimit \lineskip - \ialign - \bgroup - \ifx c #1 \hfil \fi - $ \m@th \scriptstyle ## $ - \hfil - \crcr - } { - \vcenter - \c_group_begin_token - \Let@ - \restore@math@cr - \default@tag - \skip_set:Nn \baselineskip { - \um_stack_num_up:N \scriptstyle - + \um_stack_denom_down:N \scriptstyle - } - \lineskip \um_stack_vgap:N \scriptstyle - \lineskiplimit \lineskip - \ialign - \c_group_begin_token - \token_if_eq_meaning:NNT c #1 { \hfil } - \c_math_toggle_token - \m@th - \scriptstyle - \c_parameter_token \c_parameter_token - \c_math_toggle_token - \hfil - \crcr - } - } - \um_check_and_fix_luatex:NNnnn \plainroot@ \cs_set_nopar:Npn { #1 \of #2 } { - \setbox \rootbox \hbox { - $ \m@th \scriptscriptstyle { #1 } $ - } - \mathchoice - { \r@@t \displaystyle { #2 } } - { \r@@t \textstyle { #2 } }~ - { \r@@t \scriptstyle { #2 } } - { \r@@t \scriptscriptstyle { #2 } } - \egroup - } { - \bool_if:nTF { - \int_compare_p:nNn { \uproot@ } = { \c_zero } - && \int_compare_p:nNn { \leftroot@ } = { \c_zero } - } { - \luatexUroot \l_um_radical_sqrt_tl { #1 } { #2 } - } { - \hbox_set:Nn \rootbox { - \c_math_toggle_token - \m@th - \scriptscriptstyle { #1 } - \c_math_toggle_token - } - \mathchoice - { \r@@t \displaystyle { #2 } } - { \r@@t \textstyle { #2 } } - { \r@@t \scriptstyle { #2 } } - { \r@@t \scriptscriptstyle { #2 } } - } - \c_group_end_token - } - \um_check_and_fix:NNnnnn \r@@t \cs_set_nopar:Npn { #1 #2 } { - \setboxz@h { $ \m@th #1 \sqrtsign { #2 } $ } - \dimen@ \ht\z@ - \advance \dimen@ -\dp\z@ - \setbox\@ne \hbox { $ \m@th #1 \mskip \uproot@ mu $ } - \advance \dimen@ by 1.667 \wd\@ne - \mkern -\leftroot@ mu - \mkern 5mu - \raise .6\dimen@ \copy\rootbox - \mkern -10mu - \mkern \leftroot@ mu - \boxz@ - } { - \hbox_set:Nn \l_tmpa_box { - \c_math_toggle_token - \m@th - #1 - \mskip \uproot@ mu - \c_math_toggle_token - } - \luatexUroot \l_um_radical_sqrt_tl { - \box_move_up:nn { \box_wd:N \l_tmpa_box } { - \hbox:n { - \c_math_toggle_token - \m@th - \mkern -\leftroot@ mu - \box_use:N \rootbox - \mkern \leftroot@ mu - \c_math_toggle_token - } - } - } { - #2 - } - } { - \hbox_set:Nn \l_tmpa_box { - \c_math_toggle_token - \m@th - #1 - \sqrtsign { #2 } - \c_math_toggle_token - } - \hbox_set:Nn \l_tmpb_box { - \c_math_toggle_token - \m@th - #1 - \mskip \uproot@ mu - \c_math_toggle_token - } - \mkern -\leftroot@ mu - \um_mathstyle_scale:Nnn #1 { \kern } { - \fontdimen 63 \l_um_font - } - \box_move_up:nn { - \box_wd:N \l_tmpb_box - + (\box_ht:N \l_tmpa_box - \box_dp:N \l_tmpa_box) - * \number \fontdimen 65 \l_um_font / 100 - } { - \box_use:N \rootbox - } - \um_mathstyle_scale:Nnn #1 { \kern } { - \fontdimen 64 \l_um_font - } - \mkern \leftroot@ mu - \box_use_clear:N \l_tmpa_box - } + Loading~ the~ unicode-math~ package~ without~ using~ a~ Unicode~ math~ font \\ + is~ not~ supported.~ Either~ select~ a~ Unicode~ math~ font,~ or~ don't~ load \\ + the~ unicode-math~ package. } -\AtEndOfPackageFile * {amsopn} { - \cs_set:Npn \newmcodes@ { - \mathcode`\'39\scan_stop: - \mathcode`\*42\scan_stop: - \mathcode`\."613A\scan_stop: -%% \ifnum\mathcode`\-=45 \else -%% \mathchardef\std@minus\mathcode`\-\relax -%% \fi - \mathcode`\-45\scan_stop: - \mathcode`\/47\scan_stop: - \mathcode`\:"603A\scan_stop: +\msg_new:nnn { unicode-math } { missing-alphabets } + { + Missing~math~alphabets~in~font~ "\fontname\l_um_font" \\ \\ + \seq_map_function:NN \l_um_missing_alph_seq \um_print_indent:n } +\cs_new:Nn \um_print_indent:n { \space\space\space\space #1 \\ } +\msg_new:nnn {unicode-math} {macro-expected} +{ + I've~ expected~ that~ #1~ is~ a~ macro,~ but~ it~ isn't. } -\cs_set:Npn \| {\Vert} -\cs_set:Npn \mathellipsis {\mathinner{\unicodeellipsis}} -\cs_set:Npn \cdots {\mathinner{\unicodecdots}} -\xetex_or_luatex:nnn { \cs_new_protected_nopar:Npn \um_setup_accents: } { - \def\widehat{\hat} - \def\widetilde{\tilde} - \def\overrightarrow{\vec} -} { - \cs_gset_protected_nopar:Npx \widehat { - \um_wide_top_accent:Nnn \mathaccent { \um_symfont_tl } { "0302 } - } - \cs_gset_protected_nopar:Npx \widetilde { - \um_wide_top_accent:Nnn \mathaccent { \um_symfont_tl } { "0303 } - } - \cs_gset_protected_nopar:Npx \overleftarrow { - \um_wide_top_accent:Nnn \mathaccent { \um_symfont_tl } { "20D6 } - } - \cs_gset_protected_nopar:Npx \overrightarrow { - \um_wide_top_accent:Nnn \mathaccent { \um_symfont_tl } { "20D7 } - } - \cs_gset_protected_nopar:Npx \overleftrightarrow { - \um_wide_top_accent:Nnn \mathaccent { \um_symfont_tl } { "20E1 } - } - \bool_if:NT \c_um_have_fixed_accents_bool { - \cs_gset_protected_nopar:Npx \underrightharpoondown { - \um_wide_bottom_accent:Nnn \mathaccent { \um_symfont_tl } { "20EC } - } - \cs_gset_protected_nopar:Npx \underleftharpoondown { - \um_wide_bottom_accent:Nnn \mathaccent { \um_symfont_tl } { "20ED } - } - \cs_gset_protected_nopar:Npx \underleftarrow { - \um_wide_bottom_accent:Nnn \mathaccent { \um_symfont_tl } { "20EE } - } - \cs_gset_protected_nopar:Npx \underrightarrow { - \um_wide_bottom_accent:Nnn \mathaccent { \um_symfont_tl } { "20EF } - } - } +\msg_new:nnn {unicode-math} {wrong-meaning} +{ + I've~ expected~ #1~ to~ have~ the~ meaning~ #3,~ but~ it~ has~ the~ meaning~ #2. } -\cs_set_eq:NN \um_text_slash: \slash -\cs_set:Npn \slash { - \mode_if_math:TF {\mathslash} {\um_text_slash:} +\msg_new:nnn {unicode-math} {patch-macro} +{ + I'm~ going~ to~ patch~ macro~ #1. } -\AtEndOfPackageFile * { mathtools } { - \xetex_if_engine:T { - \um_check_and_fix:NNnnn \MT_cramped_internal:Nn \cs_set_nopar:Npn { #1 #2 } { - \sbox \z@ { - $ - \m@th - #1 - \nulldelimiterspace = \z@ - \radical \z@ { #2 } - $ - } - \ifx #1 \displaystyle - \dimen@ = \fontdimen 8 \textfont 3 - \advance \dimen@ .25 \fontdimen 5 \textfont 2 - \else - \dimen@ = 1.25 \fontdimen 8 - \ifx #1 \textstyle - \textfont - \else - \ifx #1 \scriptstyle - \scriptfont - \else - \scriptscriptfont - \fi - \fi - 3 - \fi - \advance \dimen@ -\ht\z@ - \ht\z@ = -\dimen@ - \box\z@ - } { - \hbox_set:Nn \l_tmpa_box { - \color@setgroup - \c_math_toggle_token - \m@th - #1 - \dim_zero:N \nulldelimiterspace - \radical \c_zero { #2 } - \c_math_toggle_token - \color@endgroup - } - \box_set_ht:Nn \l_tmpa_box { - \box_ht:N \l_tmpa_box - - \um_radical_vgap:N #1 - } - \box_use_clear:N \l_tmpa_box - } - } - \msg_warning:nn { unicode-math } { mathtools } - \NewDocumentCommand \dblcolon { } { \Colon } - \NewDocumentCommand \coloneqq { } { \coloneq } - \NewDocumentCommand \Coloneqq { } { \Coloneq } - \NewDocumentCommand \eqqcolon { } { \eqcolon } +\msg_new:nnn { unicode-math } { mathtools } { + I'm~ going~ to~ overwrite~ the~ following~ commands~ from \\ + the~ `mathtools'~ package: \\ + \token_to_str:N \dblcolon,~ + \token_to_str:N \coloneqq,~ + \token_to_str:N \Coloneqq,~ + \token_to_str:N \eqqcolon. \\ + Note~ that~ since~ I~ won't~ overwrite~ the~ other~ colon-like \\ + commands,~ using~ them~ will~ lead~ to~ inconsistencies. } -\AtEndOfPackageFile * { colonequals } { - \msg_warning:nn { unicode-math } { colonequals } - \RenewDocumentCommand \ratio { } { \mathratio } - \RenewDocumentCommand \coloncolon { } { \Colon } - \RenewDocumentCommand \minuscolon { } { \dashcolon } - \RenewDocumentCommand \colonequals { } { \coloneq } - \RenewDocumentCommand \equalscolon { } { \eqcolon } - \RenewDocumentCommand \coloncolonequals { } { \Coloneq } +\msg_new:nnn { unicode-math } { colonequals } { + I'm~ going~ to~ overwrite~ the~ following~ commands~ from \\ + the~ `colonequals'~ package: \\ + \token_to_str:N \ratio,~ + \token_to_str:N \coloncolon,~ + \token_to_str:N \minuscolon, \\ + \token_to_str:N \colonequals,~ + \token_to_str:N \equalscolon,~ + \token_to_str:N \coloncolonequals. \\ + Note~ that~ since~ I~ won't~ overwrite~ the~ other~ colon-like \\ + commands,~ using~ them~ will~ lead~ to~ inconsistencies. \\ + Furthermore,~ changing~ \token_to_str:N \colonsep \c_space_tl + or~ \token_to_str:N \doublecolonsep \c_space_tl won't~ have \\ + any~ effect~ on~ the~ re-defined~ commands. } -\@ifclassloaded{beamer}{ - \ifbeamer@suppressreplacements\else - \um_warning:n {disable-beamer} - \beamer@suppressreplacementstrue - \fi -}{} -\ExplSyntaxOff +\luatex_if_engine:T { \usepackage{unicode-math-luatex} \endinput } +\xetex_if_engine:T { \usepackage{unicode-math-xetex} \endinput } |