diff options
Diffstat (limited to 'Master/texmf-dist')
43 files changed, 8964 insertions, 7627 deletions
diff --git a/Master/texmf-dist/doc/latex/unicode-math/CHANGES.md b/Master/texmf-dist/doc/latex/unicode-math/CHANGES.md index 0353ce95694..9153716de7f 100644 --- a/Master/texmf-dist/doc/latex/unicode-math/CHANGES.md +++ b/Master/texmf-dist/doc/latex/unicode-math/CHANGES.md @@ -1,6 +1,52 @@ CHANGE HISTORY -------------- +- v0.8j (2018/01/07) + + * NEW + + * Numbers and latin letters in the fullwidth Unicode range are now supported + as aliases to their ASCII counterparts (#337). + * New commands `\(New|Renew)NegationCommand \foo` for defining custom negations + accessed via `\not\foo`. + + * SYMBOLS + + * `\typecolon` is now `\mathrel` instead of `\mathbin` (#360). + * New symbol `\mathhyphen` which acts like a ‘letter’ (#313). + * `\nabla` and `\partial` have corrected documentation (#257). + * The following legacy commands are listed as ‘unsupported’ and will result + in sensible error messages rather than the old behaviour of meaningless + output: `\arrowvert`, `\Arrowvert`, `\bracevert`. (#411). + + * BUGS + + * LuaTeX bug with shifted `\underbrace` when it contains accented symbols worked around (#391). + * When using the `range` feature, users commonly found they needed to call + `\setmathfont` a final time with the original font to ensure correct + formatting and correct selection of symbol alphabets. I hope the issues + that required this have now been corrected (#331, #387). + * If `\setmathfont` is called a second time in a document, it tries harder + to more properly reset the maths font setup for the new font (#224). + * Properly hard-coded the `\delcode` of the period to ensure `\left`/`\right` + behave correctly in all circumstances (#344, #351, #420). + * Correct `\mathrm` (etc.) situation when no fonts loaded explicitly by the user (#330). + * Various bug fixes to `\not` (#126, #343, #363) + * `\std@minus` & `\std@equal` now properly corrected (#332). + * Fix problem with infinite loop with `\cdots` when `amsmath` loaded after `unicode-math` (#227). + * If `\setmath(rm|sf|tt)` is called *before* loading `unicode-math`, the setting + is now remembered (#407). + + * INTERNALS + + * A number of improvements to efficiency when loading subsequent math fonts + using the `range` feature. + * No longer loads the `ucharcat` package. + * Test suite re-implemented for better portability and use with Travis CI. + See <https://travis-ci.org/wspr/unicode-math> for the up-to-date status + of whether the test suite is passing. + + - v0.8i (2017/11/18) * Many internal changes to support future work. diff --git a/Master/texmf-dist/doc/latex/unicode-math/MANIFEST.md b/Master/texmf-dist/doc/latex/unicode-math/MANIFEST.md index df005e9990f..945c07f07fd 100644 --- a/Master/texmf-dist/doc/latex/unicode-math/MANIFEST.md +++ b/Master/texmf-dist/doc/latex/unicode-math/MANIFEST.md @@ -1,77 +1,294 @@ # Manifest for unicode-math -This file is automatically generated with `texlua build.lua manifest`. -Only ‘source’ files in the repository and derived files are included in this list; -it does not include ‘generated’ files such as PDF. - -## Source files - -* unimath-example.ltx -* um-code-pkgopt.dtx -* um-code-opening.dtx -* unicode-math-code.ltx -* um-code-usv.dtx -* unicode-math.ltx -* unimath-symbols.ltx -* um-code-epilogue.dtx -* unicode-math-table.tex -* um-doc-style.tex -* um-code-api.dtx -* um-code-msg.dtx -* um-doc.tex -* um-doc-nfsssummary.tex -* um-code-sscript.dtx -* um-code-base.dtx -* um-code-fontopt.dtx -* um-code-fontparam.dtx -* um-doc-mathfontdimen.tex -* um-code-ui.dtx -* um-code-mathmap.dtx -* um-code-mathtext.dtx -* um-doc-legacyfontdimen.tex -* unicode-math.dtx -* unicode-math.ins -* um-code-primes.dtx -* um-code-compat.dtx -* um-code-alphabets.dtx -* um-code-main.dtx -* um-code-variables.dtx -* um-doc-stixextract.tex -* um-code-setchar.dtx - -## Text and Documentation files - -* README.md -* CHANGES.md - -## Derived files - -* unicode-math-luatex.sty -* unicode-math-xetex.sty -* unicode-math.sty - -## Typeset documents - -* unicode-math.pdf -* unimath-example.pdf -* unicode-math-code.pdf -* unimath-symbols.pdf - -## Checking-specific support files - -* umtest-preamble.tex - -## Test files - -* mathit-symit.luatex.tlg -* mathit-symit.xetex.tlg -* fontname-log.luatex.tlg -* mathit-symit-var.lvt -* fontname-log.lvt -* fontname-log.xetex.tlg -* aaa-loading.luatex.tlg -* mathit-symit.lvt -* aaa-loading.lvt -* mathit-symit-var.luatex.tlg -* mathit-symit-var.xetex.tlg -* aaa-loading.xetex.tlg +This file is a listing of all files considered to be part of this package. +It is automatically generated with `texlua build.lua manifest`. + + +## Repository manifest + +The following groups list the files included in the development repository of the package. +Files listed with a ‘†’ marker are included in the TDS but not CTAN files, and files listed +with ‘‡’ are included in both. + +### Source files + +These are source files for a number of purposes, including the `unpack` process which +generates the installation files of the package. Additional files included here will also +be installed for processing such as testing. + + | File | Flag | Description | + | --- | --- | --- | + | unicode-math.dtx | ‡ | Metadata for the package code, including files and versioning | + | um-code-base.dtx | ‡ | Definition of unicode-math.sty, which splits and loads according to engine. | + | um-code-opening.dtx | ‡ | Assorted initialisation tasks, including some low-level function definitions. | + | um-code-variables.dtx | ‡ | Declaration of all code-level variables used in the package. | + | um-code-api.dtx | ‡ | The (underdeveloped) API to interface with the package internals. | + | um-code-ui.dtx | ‡ | The xparse user interface top-level definitions. | + | um-code-pkgopt.dtx | ‡ | Package options. | + | um-code-msg.dtx | ‡ | Definitions of error, warning, and log messages. | + | um-code-usv.dtx | ‡ | Mapping of mathematical unicode slots for alphabets. | + | um-code-setchar.dtx | ‡ | General assignment of maths symbols. | + | um-code-mathtext.dtx | ‡ | The "math text" commands such as `\mathbf` and co. | + | um-code-main.dtx | ‡ | Definition of `\setmainfont`. | + | um-code-fontopt.dtx | ‡ | Keyval for `\setmathfont` | + | um-code-fontparam.dtx | ‡ | Cross-platform interface for font parameters | + | um-code-mathmap.dtx | ‡ | Setup of symbol alphabets. | + | um-code-sym-commands.dtx | | Definition of "math symbol alphabet" commands such as `\symbf` and co. | + | um-code-alphabets.dtx | ‡ | Definitions for setting up the "math symbol alphabets". | + | um-code-epilogue.dtx | ‡ | Assorted definitions to close up. | + | um-code-primes.dtx | ‡ | The definitions needed for the input of primes. | + | um-code-sscript.dtx | ‡ | Setup for active chars needed to process subscript/superscript input chars. | + | um-code-compat.dtx | ‡ | Compatibility with 3rd party packages. | + | um-code-amsmath.dtx | | Compatibility with amsmath. | + | unicode-math.ins | ‡ | Docstrip installer. | + | unicode-math-table.tex | ‡ | Source file of the math symbols. | + +### Typeset documentation source files + +These files are typeset using LaTeX to produce the PDF documentation for the package. + + | File | Flag | Description | + | --- | --- | --- | + | unicode-math-code.ltx | ‡ | Typeset code. | + | unicode-math.ltx | ‡ | User documentation. | + | unimath-example.ltx | ‡ | A minimal example file to demonstrate the package. | + | unimath-symbols.ltx | ‡ | Listing of Unicode mathematics symbols using a variety of fonts. | + +### Documentation files + +These files form part of the documentation but are not typeset. Generally they will be +additional input files for the typeset documentation files listed above. + + 1. um-doc-style.tex ‡ + 2. um-doc-main.tex ‡ + 3. um-doc-stixextract.tex ‡ + 4. um-doc-nfsssummary.tex ‡ + 5. um-doc-legacyfontdimen.tex ‡ + 6. um-doc-mathfontdimen.tex ‡ + +### Text files + +Plain text files included as documentation or metadata. + + 1. CHANGES.md ‡ + 2. MANIFEST.md ‡ + 3. README.md ‡ + 4. LICENSE + +### Derived files + +The files created by ‘unpacking’ the package sources. This typically includes +`.sty` and `.cls` files created from DocStrip `.dtx` files. + + 1. unicode-math-luatex.sty † + 2. unicode-math-xetex.sty † + 3. unicode-math.sty † + +### Typeset documents + +The output files (PDF, essentially) from typesetting the various source, demo, +etc., package files. + + 1. unicode-math-code.pdf ‡ + 2. unicode-math.pdf ‡ + 3. unimath-example.pdf ‡ + 4. unimath-symbols.pdf ‡ + +### Checking-specific support files + +Support files for checking the test suite. + + 1. umtest-preamble.tex + +### Test files + +These files form the test suite for the package. `.lvt` or `.lte` files are the individual +unit tests, and `.tlg` are the stored output for ensuring changes to the package produce +the same output. These output files are sometimes shared and sometime specific for +different engines (pdfTeX, XeTeX, LuaTeX, etc.). + + 1. Bbbit.lvt + 2. aaa-loading.lvt + 3. active-frac.lvt + 4. active-sscripts-amsmath.lvt + 5. active-sscripts.lvt + 6. amsmath-sqrt-exec.lvt + 7. amsmath-sqrt-output.lvt + 8. ascii-catcodes.lvt + 9. fontname-log.lvt +10. hyphen.lvt +11. input-fullwidth.lvt +12. lmdefault-mathrm-it-bf.lvt +13. mathit-symit-var.lvt +14. mathit-symit.lvt +15. mathsizes.lvt +16. nabla.lvt +17. not.lvt +18. operatorname.lvt +19. partial.lvt +20. range-char-cmd.lvt +21. range-class.lvt +22. range-up-num.lvt +23. setmathsf.lvt +24. sqrt-exec.lvt +25. sqrt-output.lvt +26. Bbbit.luatex.tlg +27. Bbbit.xetex.tlg +28. aaa-loading.luatex.tlg +29. aaa-loading.xetex.tlg +30. active-frac.luatex.tlg +31. active-frac.xetex.tlg +32. active-sscripts-amsmath.luatex.tlg +33. active-sscripts-amsmath.xetex.tlg +34. active-sscripts.luatex.tlg +35. active-sscripts.xetex.tlg +36. amsmath-sqrt-exec.luatex.tlg +37. amsmath-sqrt-exec.xetex.tlg +38. amsmath-sqrt-output.luatex.tlg +39. amsmath-sqrt-output.xetex.tlg +40. ascii-catcodes.luatex.tlg +41. ascii-catcodes.xetex.tlg +42. fontname-log.luatex.tlg +43. fontname-log.xetex.tlg +44. hyphen.luatex.tlg +45. hyphen.xetex.tlg +46. input-fullwidth.luatex.tlg +47. input-fullwidth.xetex.tlg +48. lmdefault-mathrm-it-bf.luatex.tlg +49. lmdefault-mathrm-it-bf.xetex.tlg +50. mathit-symit-var.luatex.tlg +51. mathit-symit-var.xetex.tlg +52. mathit-symit.luatex.tlg +53. mathit-symit.xetex.tlg +54. mathsizes.luatex.tlg +55. mathsizes.xetex.tlg +56. nabla.luatex.tlg +57. nabla.xetex.tlg +58. not.luatex.tlg +59. not.xetex.tlg +60. operatorname.luatex.tlg +61. operatorname.xetex.tlg +62. partial.luatex.tlg +63. partial.xetex.tlg +64. range-char-cmd.luatex.tlg +65. range-char-cmd.xetex.tlg +66. range-class.luatex.tlg +67. range-class.xetex.tlg +68. range-up-num.luatex.tlg +69. range-up-num.xetex.tlg +70. setmathsf.luatex.tlg +71. setmathsf.xetex.tlg +72. sqrt-exec.luatex.tlg +73. sqrt-exec.xetex.tlg +74. sqrt-output.luatex.tlg +75. sqrt-output.xetex.tlg + + +## TDS manifest + +The following groups list the files included in the TeX Directory Structure used to install +the package into a TeX distribution. + +### Source files (TDS) + +All files included in the `unicode-math/source` directory. + + 1. um-code-alphabets.dtx + 2. um-code-api.dtx + 3. um-code-base.dtx + 4. um-code-compat.dtx + 5. um-code-epilogue.dtx + 6. um-code-fontopt.dtx + 7. um-code-fontparam.dtx + 8. um-code-main.dtx + 9. um-code-mathmap.dtx +10. um-code-mathtext.dtx +11. um-code-msg.dtx +12. um-code-opening.dtx +13. um-code-pkgopt.dtx +14. um-code-primes.dtx +15. um-code-setchar.dtx +16. um-code-sscript.dtx +17. um-code-ui.dtx +18. um-code-usv.dtx +19. um-code-variables.dtx +20. unicode-math.dtx +21. unicode-math.ins + +### TeX files (TDS) + +All files included in the `unicode-math/tex` directory. + + 1. unicode-math-luatex.sty + 2. unicode-math-table.tex + 3. unicode-math-xetex.sty + 4. unicode-math.sty + +### Doc files (TDS) + +All files included in the `unicode-math/doc` directory. + + 1. CHANGES.md + 2. MANIFEST.md + 3. README.md + 4. um-doc-legacyfontdimen.tex + 5. um-doc-main.tex + 6. um-doc-mathfontdimen.tex + 7. um-doc-nfsssummary.tex + 8. um-doc-stixextract.tex + 9. um-doc-style.tex +10. unicode-math-code.ltx +11. unicode-math-code.pdf +12. unicode-math.ltx +13. unicode-math.pdf +14. unimath-example.ltx +15. unimath-example.pdf +16. unimath-symbols.ltx +17. unimath-symbols.pdf + + +## CTAN manifest + +The following group lists the files included in the CTAN package. + +### CTAN files + + 1. CHANGES.md + 2. MANIFEST.md + 3. README.md + 4. um-code-alphabets.dtx + 5. um-code-api.dtx + 6. um-code-base.dtx + 7. um-code-compat.dtx + 8. um-code-epilogue.dtx + 9. um-code-fontopt.dtx +10. um-code-fontparam.dtx +11. um-code-main.dtx +12. um-code-mathmap.dtx +13. um-code-mathtext.dtx +14. um-code-msg.dtx +15. um-code-opening.dtx +16. um-code-pkgopt.dtx +17. um-code-primes.dtx +18. um-code-setchar.dtx +19. um-code-sscript.dtx +20. um-code-ui.dtx +21. um-code-usv.dtx +22. um-code-variables.dtx +23. um-doc-legacyfontdimen.tex +24. um-doc-main.tex +25. um-doc-mathfontdimen.tex +26. um-doc-nfsssummary.tex +27. um-doc-stixextract.tex +28. um-doc-style.tex +29. unicode-math-code.ltx +30. unicode-math-code.pdf +31. unicode-math-table.tex +32. unicode-math.dtx +33. unicode-math.ins +34. unicode-math.ltx +35. unicode-math.pdf +36. unimath-example.ltx +37. unimath-example.pdf +38. unimath-symbols.ltx +39. unimath-symbols.pdf diff --git a/Master/texmf-dist/doc/latex/unicode-math/README.md b/Master/texmf-dist/doc/latex/unicode-math/README.md index 5c72db9b573..26d4f1571d1 100644 --- a/Master/texmf-dist/doc/latex/unicode-math/README.md +++ b/Master/texmf-dist/doc/latex/unicode-math/README.md @@ -52,7 +52,7 @@ PACKAGE USAGE Please see the PDF documentation for full details. A simple beginning is: \usepackage{unicode-math} - \setmathfont{xits-math.otf} + \setmathfont{texgyrepagella-math.otf} Most LaTeX math should still work after this. (Let me know if it doesn't.) Furthermore, it will be in a different font. @@ -61,11 +61,18 @@ Furthermore, it will be in a different font. REQUIREMENTS ------------ -As well as running XeTeX or LuaTeX, this package requires recent versions of the `fontspec`, `expl3`, `xpackages`, `filehook`, `ucharcat`, and `lualatex-math` packages. +As well as running XeTeX or LuaTeX, this package requires recent versions of the `fontspec`, `expl3`, `xpackages`, `filehook`, and `lualatex-math` packages. -MAINTENANCE ------------ +THANKS +------ + +I write LaTeX code as a hobby and a passion, not as part of my day job. +If you would like to say thanks, please consider a donation at: <https://www.patreon.com/wspr> + + +DEVELOPMENT and MAINTENANCE +--------------------------- The current release version is available from CTAN: > <http://tug.ctan.org/pkg/unicode-math> @@ -78,12 +85,8 @@ Please file bug reports with minimal examples: See `CHANGES.md` for the complete listing of change history. - -THANKS ------- - -I write LaTeX code as a hobby and a passion, not as part of my day job. -If you would like to say thanks, please consider a donation at: <https://www.patreon.com/wspr> +Further information on the details surrounding the development of the package +can be found in the `CONTRIBUTING.md` file in the Github repository. LICENCE @@ -95,36 +98,4 @@ greater. [LPPL]: http://www.latex-project.org/lppl/ -This work is author-maintained and consists of the code files: - -- unicode-math.dtx, -- unicode-math.ins, -- um-code-*.dtx, -- unicode-math-table.tex; - -the documentation files: - -- unicode-math.ltx, -- unicode-math-code.ltx, -- um-doc*.tex, -- unimath-example.ltx, -- unimath-symbols.ltx; - -the derived files: - -- unicode-math.lua, -- unicode-math-xetex.sty, -- unicode-math-luatex.sty, -- unicode-math.sty; - -the compiled documentation files: - -- unicode-math.pdf, -- unicode-math-code.pdf, -- unimath-example.pdf, -- unimath-symbols.pdf; - -and the test suite: - -- testfiles/support/umtest-preamble.tex, -- testfiles/*.(lvt|tlg). +This work is author-maintained and consists of the files listed in `MANIFEST.md`. diff --git a/Master/texmf-dist/source/latex/unicode-math/um-doc-legacyfontdimen.tex b/Master/texmf-dist/doc/latex/unicode-math/um-doc-legacyfontdimen.tex index 0dbac058d60..5ba9f95e365 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-doc-legacyfontdimen.tex +++ b/Master/texmf-dist/doc/latex/unicode-math/um-doc-legacyfontdimen.tex @@ -67,7 +67,7 @@ $\xi_{13}$ & big op spacing5 \\ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-doc.tex b/Master/texmf-dist/doc/latex/unicode-math/um-doc-main.tex index 7e28f17c9f4..23d17472bb4 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-doc.tex +++ b/Master/texmf-dist/doc/latex/unicode-math/um-doc-main.tex @@ -1,4 +1,4 @@ -%%^^A%% um-doc.tex -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% um-doc-main.tex -- part of UNICODE-MATH <wspr.io/unicode-math> \begin{abstract} \noindent @@ -103,24 +103,19 @@ math~`x', but this is not the point: they \emph{should} be considered different, because the former is |U+0078| in Unicode, the latter is |U+1D431|. -When discussing the matter, it soon appeared clear that \emph{two} -different commands are needed: one for using text boldface in math, +It was clear that \emph{two} different commands are needed: one for using text boldface in math, one for using math boldface. Only the document's author can know whether one or the other is needed. The decision was to split off -the two meanings by using either |\mathbf| (for the boldface text font -in math) or |\symbf| (for the bold math font). - -To be more detailed, most alphabet commands are provided with the -\cs{math...} prefix synonyms, but there are five `legacy' font alphabets -that intentionally behave somewhat different. These are \cs{mathup}, -\cs{mathit}, \cs{mathbf}, \cs{mathsf}, and \cs{mathtt}. (N.B.: -\cs{mathrm} is defined as a synonym for \cs{mathup}, but the latter is -prefered as it is a script-agnostic term.) - -The \cs{symbf} command switches to single-letter mathematical symbols -(generally within the same OpenType font). The \cs{mathbf} command -switches to a text font that is set up to behave correctly in -mathematics, and should be used for multi-letter identifiers. These +the two meanings with a command like |\mathbf| for the boldface text font +in math and a command like |\symbf| (for the bold math font). + +The five new symbol font commands that behave in this way are: \cs{symup}, +\cs{symit}, \cs{symbf}, \cs{symsf}, and \cs{symit}. +These commands switch to single-letter mathematical symbols +(generally within the same OpenType font). + +The legacy \cs{math..} commands switch to text fonts that are set up to behave +correctly in mathematics, and should be used for multi-letter identifiers. These could be denoted `text math alphabets'; further details are discussed in \secref{mathselect}. Additional similar `text math alphabet' commands can be defined using the \cs{setmathfontface} command @@ -129,52 +124,61 @@ default text math alphabet commands to behave in a backwards-compatible mode, see the package options described in \secref{textmathlegacy}. -\begin{table}\centering - \topcaption{New \pkg{unicode-math} commands.} + +\begin{table}[t!] + \topcaption{New \pkg{unicode-math} commands which overlap with legacy + math commands. For new documents the \texttt{sym} versions are recommended.} \tablabel{symvsmath} - \begin{tabular}{lll} + \centering + \begin{tabular}[t]{ll} \toprule - \pkg{unicode-math} command & Synonym \\ + Command & Synonym \\ \midrule - |\symup| & \\ - |\symit| & \\ - |\symbf| & \\ - |\symsf| & \\ - |\symtt| & \\ + \cs{symnormal} & \cs{mathnormal} \\ + \cs{symliteral} & \\ + & \\ + & \\ + & \\ + \cs{symbb} & \cs{mathbb} \\ + \cs{symbbit} & \cs{mathbbit} \\ + \cs{symcal} & \cs{mathcal} \\ + \cs{symscr} & \cs{mathscr} \\ + \cs{symfrak} & \cs{mathfrak} \\ + \cs{symsfup} & \cs{mathsfup} \\ + \cs{symsfit} & \cs{mathsfit} \\ + \bottomrule + \end{tabular}\qquad + \begin{tabular}[t]{ll} + \toprule + Command & Synonym \\ \midrule - |\symnormal| & |\mathnormal| \\ - |\symliteral| & \\ - |\symbfup| & |\mathbfup| \\ - |\symbfit| & |\mathbfit| \\ - |\symsfup| & |\mathsfup| \\ - |\symsfit| & |\mathsfit| \\ - |\symbfsfup| & |\mathbfsfup| \\ - |\symbfsfit| & |\mathbfsfit| \\ - |\symbfsf| & |\mathbfsf| \\ - |\symbb| & |\mathbb| \\ - |\symbbit| & |\mathbbit| \\ - |\symscr| & |\mathscr| \\ - |\symbfscr| & |\mathbfscr| \\ - |\symcal| & |\mathcal| \\ - |\symbfcal| & |\mathbfcal| \\ - |\symfrak| & |\mathfrak| \\ - |\symbffrak| & |\mathbffrak| \\ + & \\ + & \\ + \cs{symbfsf} & \cs{mathbfsf} \\ + \cs{symbfup} & \cs{mathbfup} \\ + \cs{symbfit} & \cs{mathbfit} \\ + & \\ + & \\ + \cs{symbfcal} & \cs{mathbfcal} \\ + \cs{symbfscr} & \cs{mathbfscr} \\ + \cs{symbffrak} & \cs{mathbffrak} \\ + \cs{symbfsfup} & \cs{mathbfsfup} \\ + \cs{symbfsfit} & \cs{mathbfsfit} \\ \bottomrule \end{tabular} \end{table} -Thus \pkg{unicode-math} provides a number of commands (such as -|\symbfsf|) to select specific `symbol alphabets' within the unicode -maths font, with usage, e.g., |$\symbfsf{g}$|${}\to\symbfsf{g}$. The +In addition, \pkg{unicode-math} also provides a number of commands (such as +|\symcal|) to select specific `symbol alphabets' within the unicode +maths font, with usage, e.g., |$\symcal{G}$|${}\to\symcal{G}$. The full listing is shown in \Tabref{symvsmath}. For backwards compatibility, many of these are also defined with `familiar' synonyms -such as |\mathbfsf|. However, where possible the `sym' prefix +such as |\mathcal|. However, where possible the `sym' prefix commands should be preferred, as certain synonyms may become deprecated in time. The |\symliteral| command is described in \secref{math-style}. - \subsection{Package options} Package options may be set when the package as loaded or at any later stage with the \cs{unimathsetup} command. Therefore, the following two @@ -194,9 +198,9 @@ passed via options to the \cs{setmathfont} command. Therefore, the following two examples are equivalent: \begin{Verbatim} \unimathsetup{math-style=TeX} -\setmathfont{Cambria Math} +\setmathfont{texgyrepagella-math.otf} % OR -\setmathfont{Cambria Math}[math-style=TeX] +\setmathfont{texgyrepagella-math.otf}[math-style=TeX] \end{Verbatim} A summary list of package options is shown in \tabref{pkgopt}. @@ -209,13 +213,13 @@ See following sections for more information. \toprule Option & Description & See\dots \\ \midrule - |math-style| & Style of letters & \secref{math-style} \\ - |bold-style| & Style of bold letters & \secref{bold-style} \\ - |sans-style| & Style of sans serif letters & \secref{sans-style} \\ - |nabla| & Style of the nabla symbol & \secref{nabla} \\ - |partial| & Style of the partial symbol & \secref{partial} \\ - |colon| & Behaviour of \cs{colon} & \secref{colon} \\ - |slash-delimiter| & Glyph to use for `stretchy' slash & \secref{slash-delimiter} \\ + |math-style| & Style of letters & \secref*{math-style} \\ + |bold-style| & Style of bold letters & \secref*{bold-style} \\ + |sans-style| & Style of sans serif letters & \secref*{sans-style} \\ + |nabla| & Style of the nabla symbol & \secref*{nabla} \\ + |partial| & Style of the partial symbol & \secref*{partial} \\ + |colon| & Behaviour of \cs{colon} & \secref*{colon} \\ + |slash-delimiter| & Glyph to use for `stretchy' slash & \secref*{slash-delimiter} \\ \bottomrule \end{tabular} \end{table} @@ -267,26 +271,48 @@ Unicode ranges of glyphs to separate fonts: \codeline{\cmd\setmathfont\marg{font name}|[range=|\meta{unicode range}|,|\meta{font features}|]|} where \meta{unicode range} is a comma-separated list of Unicode slot numbers and ranges such as |{"27D0-"27EB,"27FF,"295B-"297F}|. Note that \TeX's syntax for accessing the slot number of a character, such as |`\+|, will also work here. +Only numerical slots can be used in ranged declarations. -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 styles such as \cs{symbb}. -(Only numerical slots, however, can be used in ranged declarations.) +You may also use the macro for accessing the glyph, such as |range=|\cs{int}, or whole collection of symbols with the same math type, such as |range=\mathopen|, or complete math styles such as |range=\symbb| (or just |range=bb|). \subsubsection{Control over alphabet ranges} As discussed earlier, Unicode mathematics consists of a number of `alphabet styles' within a single font. In \pkg{unicode-math}, these ranges are indicated with the following (hopefully self-explanatory) labels: \begin{quote}\ttfamily \ExplSyntaxOn +\clist_const:Nn \g__um_named_ranges_clist { +up , +it , +bb , +bbit , +scr , +cal , +bfcal , +frak , +tt , +sfup , +sfit , +bfup , +bfit , +bfscr , +bffrak, +bfsfup, +bfsfit, +} \clist_use:Nn \g__um_named_ranges_clist {\,,\,~} \ExplSyntaxOff \end{quote} -Fonts can be selected for specified ranges only using the following syntax, in which case all other maths font setup remains untouched: +Fonts can be selected (for predefined ranges only) using the following syntax, in which case all other maths font setup remains untouched: \begin{itemize} \item |[range=bb]| to use the font for `|bb|' letters only. \item |[range=bfsfit/{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=up->sfup]| to map to different output styles. \end{itemize} -Note that `meta-styles' such as `|bf|' and `|sf|' are not included here since they are context dependent. Use |[range=bfup]| and |[range=bfit]| to effect changes to the particular ranges selected by `|bf|' (and similarly for `|sf|'). +A common request is to load numerals only from a specific font. This can be +achieved with an option such as |range=up/{num}|. + +Note that `meta-styles' such as `|bf|' and `|sf|' are not included in the list above since they are context dependent. Use |[range=bfup]| and |[range=bfit]| to effect changes to the particular ranges selected by `|bf|' (and similarly for `|sf|'). If a particular math style is not defined in the font, we fall back onto the lower-base plane (i.e., `upright') glyphs. Therefore, to use an \ascii-encoded fractur font, for example, write @@ -324,7 +350,6 @@ To set up the complete range of optical sizes for these fonts, a font declaratio {Size = 19.91-, Font = MinionMath-BoldDisp} }] \end{Verbatim} -\textbf{v0.8:} Note that in previous versions of \pkg{unicode-math}, these features were labelled |[range=\mathbb]| and so on. This old syntax is still supported for backwards compatibility, but is now discouraged. \subsection{Script and scriptscript fonts/features} @@ -360,6 +385,8 @@ To select a new maths font in a particular version, use the syntax and to switch between maths versions mid-document use the standard \LaTeX\ command \cmd\mathversion\marg{version name}. +Note there are currently open issues regarding the interaction between the |version| +and the |range| features, so please proceed with caution. \subsection{Legacy maths `alphabet' commands} \seclabel{mathselect} @@ -384,6 +411,7 @@ For example, if you want to define a new legacy maths alphabet font \cs{mathittt The five `text math' fonts, discussed above, are: \cs{mathrm}, \cs{mathbf}, \cs{mathit}, \cs{mathsf}, and \cs{mathtt}. These commands are also defined with their original definition under synonyms \cs{mathtextrm}, \cs{mathtextbf}, and so on. +(These definitions hold regardless of package option, in case you need to be sure.) When selecting document fonts using \pkg{fontspec} commands such as \cs{setmainfont}, \pkg{unicode-math} inserts some additional code into \pkg{fontspec} that keeps the current default fonts `in sync' with their corresponding \cs{mathrm} commands, etc. @@ -479,6 +507,12 @@ example, an upright `g' is desired but typing |$g$| yields `$g$'), |\symup{g}|. Maths style commands such as \cmd\symup\ are detailed later. +For compatibility and consistency, however, upright and italic Greek letters +can be `forced` using \verb|up| or \verb|it| prefixes before their names. +For example, \cs{Gamma} will give an upright or italic Gamma depending on the +\opt{math-style}, but \cs{upGamma} and \cs{itGamma} will always give upright +or italic Gammas, respectively. + \paragraph{`Literal' interface} Some may not like this convention of normalising their input. For them, an upright |x| is an upright `x' and that's that. @@ -488,6 +522,7 @@ For these users, the |literal| option to |math-style| will effect this behaviour The \cs{symliteral}\marg{syms} command can also be used, regardless of package setting, to force the style to match the literal input characters. This is a `mirror' to \cs{symnormal}\marg{syms} (also alias \cs{mathnormal}) which `resets' the character mapping in its argument to that originally set up through package options. + \begin{table} \centering \topcaption{Effects of the \opt{math-style} package option.} @@ -506,6 +541,11 @@ This is a `mirror' to \cs{symnormal}\marg{syms} (also alias \cs{mathnormal}) whi \end{tabular} \end{table} +\paragraph{`Full-width' letters} +Unicode contains `full-width' versions of ASCII from \unichar{FF01}. +The numerals and latin letters in this range are defined by \pkg{unicode-math} +to map to their standard ASCII counterparts, which are then controlled by the relevant \opt{math-style} setting. +Other full-width symbols are not currently included but can be if there is sufficient need or desire. \subsection{Bold style} \seclabel{bold-style} @@ -564,29 +604,28 @@ latter. \seclabel{sans-style} Unicode contains upright and italic, medium and bold mathematical style characters. -These may be explicitly selected with the \cs{mathsfup}, \cs{mathsfit}, \cs{mathbfsfup}, and \cs{mathbfsfit} +These may be explicitly selected with the \cs{symsfup}, \cs{symsfit}, \cs{symbfsfup}, and \cs{symbfsfit} commands discussed in \secref{all-math-alphabets}. -How should the generic \cs{mathsf} behave? Unlike bold, sans serif is used much more sparingly +How should the generic \cs{symsf} behave? Unlike bold, sans serif is used much more sparingly in mathematics. I've seen recommendations to typeset tensors in sans serif italic or sans serif italic bold (e.g., examples in the \pkg{isomath} and \pkg{mattens} packages). 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}. +Therefore, the package options |[sans-style=upright]| and |[sans-style=italic]| control the behaviour of \cs{symsf}. 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. -In other words, this option simply changes the meaning of \cs{mathsf} to either \cs{mathsfup} or \cs{mathsfit}, respectively. +In other words, this option simply changes the meaning of \cs{symsf} to either \cs{symsfup} or \cs{symsfit}, respectively. Please let me know if more granular control is necessary here. There is also a |[sans-style=literal]| setting, set automatically with |[math-style=literal]|, which retains the uprightness of the input characters used when selecting the sans serif output. \subsubsection{What about bold sans serif?} -While you might want your bold upright and your sans serif italic, I don't believe you'd also want -your bold sans serif upright (or all vice versa, if that's even conceivable). Therefore, bold sans -serif follows from the setting for sans serif; it is completely independent of the setting for bold. +While you might want your bold upright and your sans serif italic, I don't believe you'd also want your bold sans serif upright (etc.). +Therefore, bold sans serif follows from the setting for sans serif; it is completely independent of the setting for bold. -In other words, \cs{mathbfsf} is either \cs{mathbfsfup} or \cs{mathbfsfit} based on |[sans-style=upright]| or |[sans-style=italic]|, respectively. And \texttt{[sans-style = literal]} causes \cs{mathbfsf} to retain the same italic or upright shape as the input, and turns it bold sans serif. +In other words, \cs{symbfsf} is either \cs{symbfsfup} or \cs{symbfsfit} based on |[sans-style=upright]| or |[sans-style=italic]|, respectively. And \texttt{[sans-style = literal]} causes \cs{symbfsf} to retain the same italic or upright shape as the input, and turns it bold sans serif. N.B.: there is no medium-weight sans serif Greek range in Unicode. Therefore, |\symsf{\alpha}| does not make sense (it produces `$\symsf{\alpha}$'), while |\symbfsf{\alpha}| gives `$\symbfsfup{\alpha}$' or `$\symbfsfit{\alpha}$' according to the |sans-style|. @@ -615,25 +654,33 @@ This may change in the future. \cmidrule(l){5-7} Style & Shape & Series & Switch & Latin & Greek & Numerals \\ \midrule -Serif & Upright & Normal & \cs{mathup} & \Y & \Y & \Y \\ - & & Bold & \cs{mathbfup} & \Y & \Y & \Y \\ - & Italic & Normal & \cs{mathit} & \Y & \Y & \M \\ - & & Bold & \cs{mathbfit} & \Y & \Y & \M \\ -Sans serif & Upright & Normal & \cs{mathsfup} & \Y & & \Y \\ - & Italic & Normal & \cs{mathsfit} & \Y & & \M \\ - & Upright & Bold & \cs{mathbfsfup} & \Y & \Y & \Y \\ - & Italic & Bold & \cs{mathbfsfit} & \Y & \Y & \M \\ -Typewriter & Upright & Normal & \cs{mathtt} & \Y & & \Y \\ -Double-struck & Upright & Normal & \cs{mathbb} & \Y & & \Y \\ - & Italic & Normal & \cs{mathbbit} & \Y & & \\ -Script & Upright & Normal & \cs{mathscr} & \Y & & \\ - & & Bold & \cs{mathbfscr} & \Y & & \\ -Fraktur & Upright & Normal & \cs{mathfrak} & \Y & & \\ - & & Bold & \cs{mathbffrac} & \Y & & \\ +Serif & Upright & Normal & \cs{symup} & \Y & \Y & \Y \\ + & & Bold & \cs{symbfup} & \Y & \Y & \Y \\ + & Italic & Normal & \cs{symit} & \Y & \Y & \M \\ + & & Bold & \cs{symbfit} & \Y & \Y & \M \\ +Sans serif & Upright & Normal & \cs{symsfup} & \Y & & \Y \\ + & Italic & Normal & \cs{symsfit} & \Y & & \M \\ + & Upright & Bold & \cs{symbfsfup} & \Y & \Y & \Y \\ + & Italic & Bold & \cs{symbfsfit} & \Y & \Y & \M \\ +Typewriter & Upright & Normal & \cs{symtt} & \Y & & \Y \\ +Double-struck & Upright & Normal & \cs{symbb} & \Y & & \Y \\ + & Italic & Normal & \cs{symbbit} & \Y & & \\ +Script & Upright & Normal & \cs{symscr} & \Y & & \\ + & & Bold & \cs{symbfscr} & \Y & & \\ +Fraktur & Upright & Normal & \cs{symfrak} & \Y & & \\ + & & Bold & \cs{symbffrac} & \Y & & \\ \bottomrule \end{tabular} \end{table} +\subsubsection{Scope of the functionality of the \cs{sym..} commands} + +The \cs{sym..} commands are designed to affect only the follow sets of input letters: numerals ($0$--$9$), Latin ($a$--$z$, $A$--$Z$), Greek ($\alpha$--$\omega$, $\Alpha$--$\Omega$,), and the \cs{partial} and \cs{nabla} symbols ($\partial$, $\nabla$). +These are the only symbols for which Unicode defines separate codepoints with varying mathematical style. + +There is currently no scope for including other symbols in the \cs{sym..} commands, such as writing |\symbf{\int}| for a bold integral symbol. +Therefore the commands provided by \pkg{unicode-math} should not be compared to those provided by the \pkg{bm} package. + \subsubsection{Double-struck} The double-struck style (also known as `blackboard bold') consists of @@ -685,14 +732,13 @@ The Caligraphic style (\cs{mathcal}) in XITS Math is: $\symcal{ABCXYZ}$ nabla by default (when either upright or italic nabla is used in the source). \TeX\ classically uses an upright nabla, and \textsc{iso} standards agree with this convention. - The package options |nabla=upright| and + The package options |nabla=upright| (default) and |nabla=italic| switch between the two choices, and |nabla=literal| respects - the shape of the input character. This is then inherited - through \cmd\symbf; \cmd\symit\ and \cmd\symup\ can be used to force one - way or the other. + the shape of the input character. +|nabla=literal| is activated automatically after |math-style=literal|. + +These settings are then inherited through \cmd\symbf; \cmd\symit\ and \cmd\symup\ can be used to force the shape of the nabla one way or the other. -|nabla=italic| is the default. |nabla=literal| is -activated automatically after |math-style=literal|. \begin{table} \begin{minipage}[b]{0.49\textwidth} @@ -701,17 +747,17 @@ activated automatically after |math-style=literal|. \tablabel{nabla} \let \tmpshow\empty \begin{tabular}{@{}llc@{}} - \toprule - \multicolumn{2}{@{}l}{Description} & Glyph - \\ \cmidrule(r){1-2}\cmidrule(l){3-3} - Upright & Serif & $\symup\nabla$ \\ - & Bold serif & $\symbfup\nabla$ \\ - & Bold sans & $\symbfsfup\nabla$ \\ - \cmidrule(lr){1-2}\cmidrule(lr){3-3} - Italic & Serif & $\symit\nabla$ \\ - & Bold serif & $\symbfit\nabla$ \\ - & Bold sans & $\symbfsfit\nabla$ \\ - \bottomrule + \toprule + \multicolumn{2}{@{}l}{Description} & Glyph \\ + \cmidrule(r){1-2}\cmidrule(l){3-3} + Upright & Serif & $\symup\nabla$ \\ + & Bold serif & $\symbfup\nabla$ \\ + & Bold sans & $\symbfsfup\nabla$ \\ + \cmidrule(lr){1-2}\cmidrule(lr){3-3} + Italic & Serif & $\symit\nabla$ \\ + & Bold serif & $\symbfit\nabla$ \\ + & Bold sans & $\symbfsfit\nabla$ \\ + \bottomrule \end{tabular} \end{minipage}\hfill \begin{minipage}[b]{0.49\textwidth} @@ -719,16 +765,16 @@ activated automatically after |math-style=literal|. \topcaption{The partial differential.} \tablabel{partial} \begin{tabular}{@{}llc@{}} - \toprule - \multicolumn{2}{@{}l}{Description} & Glyph - \\ \cmidrule(r){1-2}\cmidrule(l){3-3} - Regular & Upright & $\symup\partial$ \\ - & Italic & $\symit\partial$ \\ - Bold & Upright & $\symbfup\partial$ \\ - & Italic & $\symbfit\partial$ \\ + \toprule + \multicolumn{2}{@{}l}{Description} & Glyph \\ + \cmidrule(r){1-2}\cmidrule(l){3-3} + Regular & Upright & $\symup\partial$ \\ + & Italic & $\symit\partial$ \\ + Bold & Upright & $\symbfup\partial$ \\ + & Italic & $\symbfit\partial$ \\ Sans bold & Upright & $\symbfsfup\partial$ \\ & Italic & $\symbfsfit\partial$ \\ - \bottomrule + \bottomrule \end{tabular} \end{minipage} \end{table} @@ -737,22 +783,13 @@ activated automatically after |math-style=literal|. \subsubsection{Partial} \seclabel{partial} -The same applies to the symbols \unichar{2202} partial differential and -\unichar{1D715} math italic partial differential. - -At time of writing, both the Cambria Math and STIX fonts display these -two glyphs in the same italic style, but this is hopefully a bug that will -be corrected in the future~--- the `plain' partial differential should -really have an upright shape. +The same logic as for nabla applies to the symbols \unichar{2202} partial differential and \unichar{1D715} math italic partial differential. +However, in practice these symbols are often designed identically in an italic style. -Use the |partial=upright| or |partial=italic| package options to specify +If the font you are using supports it, use the |partial=upright| or |partial=italic| (default) package options to specify which one you would like, or |partial=literal| to have the same character used in the output as was used for the input. -The default is (always, unless someone requests and -argues otherwise) |partial=italic|.\footnote{A good argument would revolve -around some international standards body recommending upright over italic. -I just don't have the time right now to look it up.} |partial=literal| -is activated following |math-style=literal|. +|partial=literal| is activated following |math-style=literal|. See \tabref{partial} for the variations on the partial differential symbol. @@ -956,6 +993,22 @@ For example: as mentioned above, Cambria Math's stretchy slash is (This should be a font option rather than a package option, but it will change soon.) +\subsubsection{Behaviour of hyphens in mathematics} +\seclabel{hyphen} + +Unicode defines the following related characters: +\begin{itemize} +\item \unichar{0002D}{hyphen-minus} +\item \unichar{02212}{minus sign} +\item \unichar{02010}{hyphen} (\cs{mathhyphen}) +\end{itemize} +The first two of these characters in the input will all behave as the binary operator +`minus sign'. +The third is defined by \pkg{unicode-math} as a `math letter' for constructions +like \verb|$R‐\text{Mod}$| ($R‐\text{Mod}$). +If more control is needed surrounding these symbols, additional options can be added to the package; +please get in touch if this is the case for you. + \subsubsection{Growing and non-growing accents} \seclabel{growing-accents} @@ -971,6 +1024,23 @@ v0.9998, these wide/non-wide commands will again behave in their expected manner. +\subsubsection{Negations and the \cs{not} command} +\seclabel{negations} + +The \cs{not} command in classic \LaTeXe\ was a mathematical slash modifying glyph that allowed for `negating` maths symbols where pre-built glyphs were not available. While Unicode encodes a slot for this modifying slash, it is only well-supported in \LuaTeX\ and not in \XeTeX. + +To provide more flexibility, the \pkg{unicode-math} package defines \cs{not} to search for a predefined `negated' definitions for its argument and use that if available. This method can be used for fine-tuning in cases where spacing needs to be adjusted. + +A `negated definition` is any symbol command prefixed by either \verb|n| or \verb|not|. For example, \pkg{unicode-math} by default defines both \cs{leftarrow} ($\leftarrow$) and \cs{nleftarrow} ($\nleftarrow$). + +To define custom negated definitions for either symbols (e.g., \verb|\not=|) or commands (e.g., \verb|\not\equal|), use the \cs{NewNotCommand}\marg{symbol or cmd}\marg{definition} command. Its usage is as follows: +\begin{verbatim} +\NewNegationCommand {=} {\neq} +\NewNegationCommand {\equal} {\neq} +\end{verbatim} +If the command has already been defined, an error will result and \verb|\RenewNegationCommand| can be used to overwrite the original definition. + + \subsubsection{Pre-drawn fraction characters} Pre-drawn fractions \unichar{00BC}--\unichar{00BE}, \unichar{2150}--\unichar{215E} @@ -1128,7 +1198,7 @@ will produce `bf'. % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-doc-mathfontdimen.tex b/Master/texmf-dist/doc/latex/unicode-math/um-doc-mathfontdimen.tex index 4ef1df29728..45b7463dbf0 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-doc-mathfontdimen.tex +++ b/Master/texmf-dist/doc/latex/unicode-math/um-doc-mathfontdimen.tex @@ -142,7 +142,7 @@ Suggested: /5 x-height.} % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-doc-nfsssummary.tex b/Master/texmf-dist/doc/latex/unicode-math/um-doc-nfsssummary.tex index 645664b4bde..a4666af1930 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-doc-nfsssummary.tex +++ b/Master/texmf-dist/doc/latex/unicode-math/um-doc-nfsssummary.tex @@ -75,7 +75,7 @@ For characters, something like: % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-doc-stixextract.tex b/Master/texmf-dist/doc/latex/unicode-math/um-doc-stixextract.tex index b86ae1e33fd..7738fc8be86 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-doc-stixextract.tex +++ b/Master/texmf-dist/doc/latex/unicode-math/um-doc-stixextract.tex @@ -29,7 +29,7 @@ things are supposed to work!) % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-doc-style.tex b/Master/texmf-dist/doc/latex/unicode-math/um-doc-style.tex index 31a01bd7927..88c761e512b 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-doc-style.tex +++ b/Master/texmf-dist/doc/latex/unicode-math/um-doc-style.tex @@ -13,7 +13,7 @@ \usepackage[svgnames]{xcolor} \usepackage[inline]{enumitem} -\usepackage{array,booktabs,calc,enumitem,fancyvrb,graphicx,ifthen,longtable,refstyle,subfig,topcapt,url,varioref,underscore} +\usepackage{amsmath,array,booktabs,calc,enumitem,fancyvrb,graphicx,ifthen,longtable,refstyle,subfig,topcapt,url,varioref,underscore} \setcounter{LTchunksize}{100} \usepackage[slash-delimiter=frac,nabla=literal]{unicode-math} \usepackage{metalogo,hologo} @@ -120,7 +120,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-code.ltx b/Master/texmf-dist/doc/latex/unicode-math/unicode-math-code.ltx index 29cadd8081e..62fb9bbf801 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math-code.ltx +++ b/Master/texmf-dist/doc/latex/unicode-math/unicode-math-code.ltx @@ -1,4 +1,5 @@ %%^^A%% unicode-math-code.ltx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Typeset code. \documentclass[a4paper]{ltxdoc} \input{um-doc-style.tex} @@ -30,7 +31,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/doc/latex/unicode-math/unicode-math-code.pdf b/Master/texmf-dist/doc/latex/unicode-math/unicode-math-code.pdf Binary files differindex 25edd19f389..6b7207ba10c 100644 --- a/Master/texmf-dist/doc/latex/unicode-math/unicode-math-code.pdf +++ b/Master/texmf-dist/doc/latex/unicode-math/unicode-math-code.pdf diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math.ltx b/Master/texmf-dist/doc/latex/unicode-math/unicode-math.ltx index df10b66e401..9f140383e00 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math.ltx +++ b/Master/texmf-dist/doc/latex/unicode-math/unicode-math.ltx @@ -1,4 +1,5 @@ %%^^A%% unicode-math.ltx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% User documentation. \documentclass[a4paper]{ltxdoc} \input{um-doc-style.tex} @@ -10,7 +11,7 @@ \maketitle -\input{um-doc.tex} +\input{um-doc-main.tex} \clearpage \appendix @@ -33,7 +34,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny 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 d6f01362c18..c1ae6d97379 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/source/latex/unicode-math/unimath-example.ltx b/Master/texmf-dist/doc/latex/unicode-math/unimath-example.ltx index 908c74d3125..928a523f306 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unimath-example.ltx +++ b/Master/texmf-dist/doc/latex/unicode-math/unimath-example.ltx @@ -1,4 +1,5 @@ %%^^A%% unimath-example.ltx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% A minimal example file to demonstrate the package. %%%%%%%%%%%%%%%%%%%%%%% % UNICODE-MATH EXAMPLE FILE @@ -59,7 +60,7 @@ And that's a brief introduction to the package. Please see the documentation for % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/unimath-symbols.ltx b/Master/texmf-dist/doc/latex/unicode-math/unimath-symbols.ltx index e285099899c..808f26bc693 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unimath-symbols.ltx +++ b/Master/texmf-dist/doc/latex/unicode-math/unimath-symbols.ltx @@ -1,4 +1,5 @@ %%^^A%% unimath-symbols.ltx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Listing of Unicode mathematics symbols using a variety of fonts. %!TEX TS-program = LuaLaTeX @@ -137,22 +138,6 @@ % \overrightarrow\overleftarrow\overbrace\underbrace\lmoustache\rmoustache\lgroup\rgroup\arrowvert\Arrowvert\bracevert\Vert\vert\uparrow\downarrow\updownarrow\Uparrow\Downarrow\Updownarrow\backslash\rangle\langle\rbrace\lbrace\rceil\lceil\rfloor\lfloor\sqrt} -% /© -% -% ------------------------------------------------ -% The UNICODE-MATH package <wspr.io/unicode-math> -% ------------------------------------------------ -% 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/>. -% ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" -% Copyright 2010-2017 Philipp Stephani -% Copyright 2011-2017 Joseph Wright -% Copyright 2012-2015 Khaled Hosny -% ------------------------------------------------ -% -% ©/ \def\LTXSYM{ \cong @@ -493,7 +478,7 @@ The limits behaviour as specified by \textsf{unicode-math} are shown with grey s % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny 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 037f7586e5c..74fbb674e38 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/um-code-alphabets.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-alphabets.dtx index 348a5a22eb1..f36613f05da 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-code-alphabets.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-alphabets.dtx @@ -1,4 +1,5 @@ %%^^A%% um-code-alphabets.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Definitions for setting up the "math symbol alphabets". % \section{Setting up alphabets} % \label{sec:setupalphabets} @@ -12,730 +13,738 @@ % % \begin{macrocode} \@@_new_alphabet_config:nnn {up} {num} - { - \@@_set_normal_numbers:nn {up} {#1} - \@@_set_mathalphabet_numbers:nnn {up} {up} {#1} - } + { + \@@_set_normal_numbers:nn {up} {#1} + \@@_set_mathalphabet_numbers:nnn {up} {up} {#1} + } \@@_new_alphabet_config:nnn {up} {Latin} - { - \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_Latin:nn {up} {#1} } - { - \bool_if:NT \g_@@_upLatin_bool { \@@_set_normal_Latin:nn {up,it} {#1} } - } - \@@_set_mathalphabet_Latin:nnn {up} {up,it} {#1} - \@@_set_mathalphabet_Latin:nnn {literal} {up} {up} - \@@_set_mathalphabet_Latin:nnn {literal} {it} {it} - } + { + \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_Latin:nn {up} {#1} } + { + \bool_if:NT \g_@@_upLatin_bool { \@@_set_normal_Latin:nn {up,it} {#1} } + } + \@@_set_mathalphabet_Latin:nnn {up} {up,it} {#1} + \@@_set_mathalphabet_Latin:nnn {literal} {up} {up} + \@@_set_mathalphabet_Latin:nnn {literal} {it} {it} + } \@@_new_alphabet_config:nnn {up} {latin} - { - \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_latin:nn {up} {#1} } - { - \bool_if:NT \g_@@_uplatin_bool - { - \@@_set_normal_latin:nn {up,it} {#1} - \@@_set_normal_char:nnn {h} {up,it} {#1} - \@@_set_normal_char:nnn {dotlessi} {up,it} {#1} - \@@_set_normal_char:nnn {dotlessj} {up,it} {#1} - } - } - \@@_set_mathalphabet_latin:nnn {up} {up,it}{#1} - \@@_set_mathalphabet_latin:nnn {literal} {up} {up} - \@@_set_mathalphabet_latin:nnn {literal} {it} {it} - } + { + \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_latin:nn {up} {#1} } + { + \bool_if:NT \g_@@_uplatin_bool + { + \@@_set_normal_latin:nn {up,it} {#1} + \@@_set_normal_char:nnn {h} {up,it} {#1} + \@@_set_normal_char:nnn {dotlessi} {up,it} {#1} + \@@_set_normal_char:nnn {dotlessj} {up,it} {#1} + } + } + \@@_set_mathalphabet_latin:nnn {up} {up,it}{#1} + \@@_set_mathalphabet_latin:nnn {literal} {up} {up} + \@@_set_mathalphabet_latin:nnn {literal} {it} {it} + } \@@_new_alphabet_config:nnn {up} {Greek} - { - \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_Greek:nn {up}{#1} } - { - \bool_if:NT \g_@@_upGreek_bool { \@@_set_normal_Greek:nn {up,it}{#1} } - } - \@@_set_mathalphabet_Greek:nnn {up} {up,it}{#1} - \@@_set_mathalphabet_Greek:nnn {literal} {up} {up} - \@@_set_mathalphabet_Greek:nnn {literal} {it} {it} - } + { + \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_Greek:nn {up}{#1} } + { + \bool_if:NT \g_@@_upGreek_bool { \@@_set_normal_Greek:nn {up,it}{#1} } + } + \@@_set_mathalphabet_Greek:nnn {up} {up,it}{#1} + \@@_set_mathalphabet_Greek:nnn {literal} {up} {up} + \@@_set_mathalphabet_Greek:nnn {literal} {it} {it} + } \@@_new_alphabet_config:nnn {up} {greek} - { - \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_greek:nn {up} {#1} } - { - \bool_if:NT \g_@@_upgreek_bool - { - \@@_set_normal_greek:nn {up,it} {#1} - } - } - \@@_set_mathalphabet_greek:nnn {up} {up,it} {#1} - \@@_set_mathalphabet_greek:nnn {literal} {up} {up} - \@@_set_mathalphabet_greek:nnn {literal} {it} {it} - } + { + \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_greek:nn {up} {#1} } + { + \bool_if:NT \g_@@_upgreek_bool + { + \@@_set_normal_greek:nn {up,it} {#1} + } + } + \@@_set_mathalphabet_greek:nnn {up} {up,it} {#1} + \@@_set_mathalphabet_greek:nnn {literal} {up} {up} + \@@_set_mathalphabet_greek:nnn {literal} {it} {it} + } \@@_new_alphabet_config:nnn {up} {misc} - { - \bool_if:NTF \g_@@_literal_Nabla_bool - { - \@@_set_normal_char:nnn {Nabla}{up}{up} - } - { - \bool_if:NT \g_@@_upNabla_bool - { - \@@_set_normal_char:nnn {Nabla}{up,it}{up} - } - } - \bool_if:NTF \g_@@_literal_partial_bool - { - \@@_set_normal_char:nnn {partial}{up}{up} - } - { - \bool_if:NT \g_@@_uppartial_bool - { - \@@_set_normal_char:nnn {partial}{up,it}{up} - } - } - \@@_set_mathalphabet_pos:nnnn {up} {partial} {up,it} {#1} - \@@_set_mathalphabet_pos:nnnn {up} {Nabla} {up,it} {#1} - \@@_set_mathalphabet_pos:nnnn {up} {dotlessi} {up,it} {#1} - \@@_set_mathalphabet_pos:nnnn {up} {dotlessj} {up,it} {#1} - } + { + \bool_if:NTF \g_@@_literal_Nabla_bool + { + \@@_set_normal_char:nnn {Nabla}{up}{up} + } + { + \bool_if:NT \g_@@_upNabla_bool + { + \@@_set_normal_char:nnn {Nabla}{up,it}{up} + } + } + \bool_if:NTF \g_@@_literal_partial_bool + { + \@@_set_normal_char:nnn {partial}{up}{up} + } + { + \bool_if:NT \g_@@_uppartial_bool + { + \@@_set_normal_char:nnn {partial}{up,it}{up} + } + } + \@@_set_mathalphabet_pos:nnnn {up} {partial} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {up} {Nabla} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {up} {dotlessi} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {up} {dotlessj} {up,it} {#1} + } % \end{macrocode} % % \subsection{Italic: it} % % \begin{macrocode} \@@_new_alphabet_config:nnn {it} {Latin} - { - \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_Latin:nn {it} {#1} } - { - \bool_if:NF \g_@@_upLatin_bool { \@@_set_normal_Latin:nn {up,it} {#1} } - } - \@@_set_mathalphabet_Latin:nnn {it}{up,it}{#1} - } + { + \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_Latin:nn {it} {#1} } + { + \bool_if:NF \g_@@_upLatin_bool { \@@_set_normal_Latin:nn {up,it} {#1} } + } + \@@_set_mathalphabet_Latin:nnn {it} {up,it} {#1} + } \@@_new_alphabet_config:nnn {it} {latin} - { - \bool_if:NTF \g_@@_literal_bool - { - \@@_set_normal_latin:nn {it} {#1} - \@@_set_normal_char:nnn {h}{it}{#1} - } - { - \bool_if:NF \g_@@_uplatin_bool - { - \@@_set_normal_latin:nn {up,it} {#1} - \@@_set_normal_char:nnn {h}{up,it}{#1} - \@@_set_normal_char:nnn {dotlessi}{up,it}{#1} - \@@_set_normal_char:nnn {dotlessj}{up,it}{#1} - } - } - \@@_set_mathalphabet_latin:nnn {it} {up,it} {#1} - \@@_set_mathalphabet_pos:nnnn {it} {dotlessi} {up,it} {#1} - \@@_set_mathalphabet_pos:nnnn {it} {dotlessj} {up,it} {#1} - } + { + \bool_if:NTF \g_@@_literal_bool + { + \@@_set_normal_latin:nn {it}{#1} + \@@_set_normal_char:nnn {h}{it}{#1} + } + { + \bool_if:NF \g_@@_uplatin_bool + { + \@@_set_normal_latin:nn {up,it} {#1} + \@@_set_normal_char:nnn {h} {up,it} {#1} + \@@_set_normal_char:nnn {dotlessi} {up,it} {#1} + \@@_set_normal_char:nnn {dotlessj} {up,it} {#1} + } + } + \@@_set_mathalphabet_latin:nnn {it} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {it} {dotlessi} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {it} {dotlessj} {up,it} {#1} + } \@@_new_alphabet_config:nnn {it} {Greek} - { - \bool_if:NTF \g_@@_literal_bool - { - \@@_set_normal_Greek:nn {it}{#1} - } - { - \bool_if:NF \g_@@_upGreek_bool { \@@_set_normal_Greek:nn {up,it}{#1} } - } - \@@_set_mathalphabet_Greek:nnn {it} {up,it}{#1} - } + { + \bool_if:NTF \g_@@_literal_bool + { + \@@_set_normal_Greek:nn {it} {#1} + } + { + \bool_if:NF \g_@@_upGreek_bool { \@@_set_normal_Greek:nn {up,it} {#1} } + } + \@@_set_mathalphabet_Greek:nnn {it} {up,it} {#1} + } \@@_new_alphabet_config:nnn {it} {greek} - { - \bool_if:NTF \g_@@_literal_bool - { - \@@_set_normal_greek:nn {it} {#1} - } - { - \bool_if:NF \g_@@_upgreek_bool { \@@_set_normal_greek:nn {it,up} {#1} } - } - \@@_set_mathalphabet_greek:nnn {it} {up,it} {#1} - } + { + \bool_if:NTF \g_@@_literal_bool + { + \@@_set_normal_greek:nn {it} {#1} + } + { + \bool_if:NF \g_@@_upgreek_bool { \@@_set_normal_greek:nn {it,up} {#1} } + } + \@@_set_mathalphabet_greek:nnn {it} {up,it} {#1} + } \@@_new_alphabet_config:nnn {it} {misc} - { - \bool_if:NTF \g_@@_literal_Nabla_bool - { - \@@_set_normal_char:nnn {Nabla}{it}{it} - } - { - \bool_if:NF \g_@@_upNabla_bool - { - \@@_set_normal_char:nnn {Nabla}{up,it}{it} - } - } - \bool_if:NTF \g_@@_literal_partial_bool - { - \@@_set_normal_char:nnn {partial}{it}{it} - } - { - \bool_if:NF \g_@@_uppartial_bool - { - \@@_set_normal_char:nnn {partial}{up,it}{it} - } - } - \@@_set_mathalphabet_pos:nnnn {it} {partial} {up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {it} {Nabla} {up,it}{#1} - } + { + \bool_if:NTF \g_@@_literal_Nabla_bool + { + \@@_set_normal_char:nnn {Nabla} {it} {it} + } + { + \bool_if:NF \g_@@_upNabla_bool + { + \@@_set_normal_char:nnn {Nabla} {up,it} {it} + } + } + \bool_if:NTF \g_@@_literal_partial_bool + { + \@@_set_normal_char:nnn {partial} {it} {it} + } + { + \bool_if:NF \g_@@_uppartial_bool + { + \@@_set_normal_char:nnn {partial} {up,it} {it} + } + } + \@@_set_mathalphabet_pos:nnnn {it} {partial} {up,it}{#1} + \@@_set_mathalphabet_pos:nnnn {it} {Nabla} {up,it}{#1} + } % \end{macrocode} % % \subsection{Blackboard or double-struck: bb and bbit} % % \begin{macrocode} \@@_new_alphabet_config:nnn {bb} {latin} - { - \@@_set_mathalphabet_latin:nnn {bb} {up,it}{#1} - } + { + \@@_set_mathalphabet_latin:nnn {bb} {up,it} {#1} + } \@@_new_alphabet_config:nnn {bb} {Latin} - { - \@@_set_mathalphabet_Latin:nnn {bb} {up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {bb} {C} {up,it} {#1} - \@@_set_mathalphabet_pos:nnnn {bb} {H} {up,it} {#1} - \@@_set_mathalphabet_pos:nnnn {bb} {N} {up,it} {#1} - \@@_set_mathalphabet_pos:nnnn {bb} {P} {up,it} {#1} - \@@_set_mathalphabet_pos:nnnn {bb} {Q} {up,it} {#1} - \@@_set_mathalphabet_pos:nnnn {bb} {R} {up,it} {#1} - \@@_set_mathalphabet_pos:nnnn {bb} {Z} {up,it} {#1} - } + { + \@@_set_mathalphabet_Latin:nnn {bb} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {bb} {C} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {bb} {H} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {bb} {N} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {bb} {P} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {bb} {Q} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {bb} {R} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {bb} {Z} {up,it} {#1} + } \@@_new_alphabet_config:nnn {bb} {num} - { - \@@_set_mathalphabet_numbers:nnn {bb} {up}{#1} - } + { + \@@_set_mathalphabet_numbers:nnn {bb} {up} {#1} + } \@@_new_alphabet_config:nnn {bb} {misc} - { - \@@_set_mathalphabet_pos:nnnn {bb} {Pi} {up,it} {#1} - \@@_set_mathalphabet_pos:nnnn {bb} {pi} {up,it} {#1} - \@@_set_mathalphabet_pos:nnnn {bb} {Gamma} {up,it} {#1} - \@@_set_mathalphabet_pos:nnnn {bb} {gamma} {up,it} {#1} - \@@_set_mathalphabet_pos:nnnn {bb} {summation} {up} {#1} - } + { + \@@_set_mathalphabet_pos:nnnn {bb} {Pi} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {bb} {pi} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {bb} {Gamma} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {bb} {gamma} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {bb} {summation} {up} {#1} + } \@@_new_alphabet_config:nnn {bbit} {misc} - { - \@@_set_mathalphabet_pos:nnnn {bbit} {D} {up,it} {#1} - \@@_set_mathalphabet_pos:nnnn {bbit} {d} {up,it} {#1} - \@@_set_mathalphabet_pos:nnnn {bbit} {e} {up,it} {#1} - \@@_set_mathalphabet_pos:nnnn {bbit} {i} {up,it} {#1} - \@@_set_mathalphabet_pos:nnnn {bbit} {j} {up,it} {#1} - } + { + \@@_set_mathalphabet_pos:nnnn {bbit} {D} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {bbit} {d} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {bbit} {e} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {bbit} {i} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {bbit} {j} {up,it} {#1} + } % \end{macrocode} % % \subsection{Script and caligraphic: scr and cal} % % \begin{macrocode} \@@_new_alphabet_config:nnn {scr} {Latin} - { - \@@_set_mathalphabet_Latin:nnn {scr} {up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {scr} {B}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {scr} {E}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {scr} {F}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {scr} {H}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {scr} {I}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {scr} {L}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {scr} {M}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {scr} {R}{up,it}{#1} - } + { + \@@_set_mathalphabet_Latin:nnn {scr} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {scr} {B} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {scr} {E} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {scr} {F} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {scr} {H} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {scr} {I} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {scr} {L} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {scr} {M} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {scr} {R} {up,it} {#1} + } \@@_new_alphabet_config:nnn {scr} {latin} - { - \@@_set_mathalphabet_latin:nnn {scr} {up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {scr} {e}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {scr} {g}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {scr} {o}{up,it}{#1} - } + { + \@@_set_mathalphabet_latin:nnn {scr} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {scr} {e} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {scr} {g} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {scr} {o} {up,it} {#1} + } % \end{macrocode} % These are by default synonyms for the above, but with the STIX % fonts we want to use the alternate alphabet. % \begin{macrocode} \@@_new_alphabet_config:nnn {cal} {Latin} - { - \@@_set_mathalphabet_Latin:nnn {cal} {up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {cal} {B}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {cal} {E}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {cal} {F}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {cal} {H}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {cal} {I}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {cal} {L}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {cal} {M}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {cal} {R}{up,it}{#1} - } + { + \@@_set_mathalphabet_Latin:nnn {cal} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {cal} {B} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {cal} {E} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {cal} {F} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {cal} {H} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {cal} {I} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {cal} {L} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {cal} {M} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {cal} {R} {up,it} {#1} + } % \end{macrocode} % % \subsection{Fractur or fraktur or blackletter: frak} % % \begin{macrocode} \@@_new_alphabet_config:nnn {frak} {Latin} - { - \@@_set_mathalphabet_Latin:nnn {frak} {up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {frak} {C}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {frak} {H}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {frak} {I}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {frak} {R}{up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {frak} {Z}{up,it}{#1} - } + { + \@@_set_mathalphabet_Latin:nnn {frak} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {frak} {C} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {frak} {H} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {frak} {I} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {frak} {R} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {frak} {Z} {up,it} {#1} + } \@@_new_alphabet_config:nnn {frak} {latin} - { - \@@_set_mathalphabet_latin:nnn {frak} {up,it}{#1} - } + { + \@@_set_mathalphabet_latin:nnn {frak} {up,it} {#1} + } % \end{macrocode} % % \subsection{Sans serif upright: sfup} % \begin{macrocode} \@@_new_alphabet_config:nnn {sfup} {num} - { - \@@_set_mathalphabet_numbers:nnn {sf} {up}{#1} - \@@_set_mathalphabet_numbers:nnn {sfup} {up}{#1} - } + { + \@@_set_mathalphabet_numbers:nnn {sf} {up} {#1} + \@@_set_mathalphabet_numbers:nnn {sfup} {up} {#1} + } \@@_new_alphabet_config:nnn {sfup} {Latin} - { - \bool_if:NTF \g_@@_sfliteral_bool - { - \@@_set_normal_Latin:nn {sfup} {#1} - \@@_set_mathalphabet_Latin:nnn {sf} {up}{#1} - } - { - \bool_if:NT \g_@@_upsans_bool - { - \@@_set_normal_Latin:nn {sfup,sfit} {#1} - \@@_set_mathalphabet_Latin:nnn {sf} {up,it}{#1} - } - } - \@@_set_mathalphabet_Latin:nnn {sfup} {up,it}{#1} - } + { + \bool_if:NTF \g_@@_sfliteral_bool + { + \@@_set_normal_Latin:nn {sfup} {#1} + \@@_set_mathalphabet_Latin:nnn {sf} {up} {#1} + } + { + \bool_if:NT \g_@@_upsans_bool + { + \@@_set_normal_Latin:nn {sfup,sfit} {#1} + \@@_set_mathalphabet_Latin:nnn {sf} {up,it} {#1} + } + } + \@@_set_mathalphabet_Latin:nnn {sfup} {up,it} {#1} + } + \@@_new_alphabet_config:nnn {sfup} {latin} - { - \bool_if:NTF \g_@@_sfliteral_bool - { - \@@_set_normal_latin:nn {sfup} {#1} - \@@_set_mathalphabet_latin:nnn {sf} {up}{#1} - } - { - \bool_if:NT \g_@@_upsans_bool - { - \@@_set_normal_latin:nn {sfup,sfit} {#1} - \@@_set_mathalphabet_latin:nnn {sf} {up,it}{#1} - } - } - \@@_set_mathalphabet_latin:nnn {sfup} {up,it}{#1} - } + { + \bool_if:NTF \g_@@_sfliteral_bool + { + \@@_set_normal_latin:nn {sfup} {#1} + \@@_set_mathalphabet_latin:nnn {sf} {up} {#1} + } + { + \bool_if:NT \g_@@_upsans_bool + { + \@@_set_normal_latin:nn {sfup,sfit} {#1} + \@@_set_mathalphabet_latin:nnn {sf} {up,it} {#1} + } + } + \@@_set_mathalphabet_latin:nnn {sfup} {up,it} {#1} + } % \end{macrocode} % % \subsection{Sans serif italic: sfit} % % \begin{macrocode} \@@_new_alphabet_config:nnn {sfit} {Latin} - { - \bool_if:NTF \g_@@_sfliteral_bool - { - \@@_set_normal_Latin:nn {sfit} {#1} - \@@_set_mathalphabet_Latin:nnn {sf} {it}{#1} - } - { - \bool_if:NF \g_@@_upsans_bool - { - \@@_set_normal_Latin:nn {sfup,sfit} {#1} - \@@_set_mathalphabet_Latin:nnn {sf} {up,it}{#1} - } - } - \@@_set_mathalphabet_Latin:nnn {sfit} {up,it}{#1} - } + { + \bool_if:NTF \g_@@_sfliteral_bool + { + \@@_set_normal_Latin:nn {sfit} {#1} + \@@_set_mathalphabet_Latin:nnn {sf} {it} {#1} + } + { + \bool_if:NF \g_@@_upsans_bool + { + \@@_set_normal_Latin:nn {sfup,sfit} {#1} + \@@_set_mathalphabet_Latin:nnn {sf} {up,it} {#1} + } + } + \@@_set_mathalphabet_Latin:nnn {sfit} {up,it} {#1} + } + \@@_new_alphabet_config:nnn {sfit} {latin} - { - \bool_if:NTF \g_@@_sfliteral_bool - { - \@@_set_normal_latin:nn {sfit} {#1} - \@@_set_mathalphabet_latin:nnn {sf} {it}{#1} - } - { - \bool_if:NF \g_@@_upsans_bool - { - \@@_set_normal_latin:nn {sfup,sfit} {#1} - \@@_set_mathalphabet_latin:nnn {sf} {up,it}{#1} - } - } - \@@_set_mathalphabet_latin:nnn {sfit} {up,it}{#1} - } + { + \bool_if:NTF \g_@@_sfliteral_bool + { + \@@_set_normal_latin:nn {sfit} {#1} + \@@_set_mathalphabet_latin:nnn {sf} {it}{#1} + } + { + \bool_if:NF \g_@@_upsans_bool + { + \@@_set_normal_latin:nn {sfup,sfit} {#1} + \@@_set_mathalphabet_latin:nnn {sf} {up,it}{#1} + } + } + \@@_set_mathalphabet_latin:nnn {sfit} {up,it}{#1} + } % \end{macrocode} % % \subsection{Typewriter or monospaced: tt} % \begin{macrocode} \@@_new_alphabet_config:nnn {tt} {num} - { - \@@_set_mathalphabet_numbers:nnn {tt} {up}{#1} - } + { + \@@_set_mathalphabet_numbers:nnn {tt} {up}{#1} + } \@@_new_alphabet_config:nnn {tt} {Latin} - { - \@@_set_mathalphabet_Latin:nnn {tt} {up,it}{#1} - } + { + \@@_set_mathalphabet_Latin:nnn {tt} {up,it}{#1} + } \@@_new_alphabet_config:nnn {tt} {latin} - { - \@@_set_mathalphabet_latin:nnn {tt} {up,it}{#1} - } + { + \@@_set_mathalphabet_latin:nnn {tt} {up,it}{#1} + } % \end{macrocode} % % % \subsection{Bold Italic: bfit} % \begin{macrocode} \@@_new_alphabet_config:nnn {bfit} {Latin} - { - \bool_if:NF \g_@@_bfupLatin_bool - { - \@@_set_normal_Latin:nn {bfup,bfit} {#1} - } - \@@_set_mathalphabet_Latin:nnn {bfit} {up,it}{#1} - \bool_if:NTF \g_@@_bfliteral_bool - { - \@@_set_normal_Latin:nn {bfit} {#1} - \@@_set_mathalphabet_Latin:nnn {bf} {it}{#1} - } - { + { \bool_if:NF \g_@@_bfupLatin_bool - { - \@@_set_normal_Latin:nn {bfup,bfit} {#1} - \@@_set_mathalphabet_Latin:nnn {bf} {up,it}{#1} - } - } - } + { + \@@_set_normal_Latin:nn {bfup,bfit} {#1} + } + \@@_set_mathalphabet_Latin:nnn {bfit} {up,it}{#1} + \bool_if:NTF \g_@@_bfliteral_bool + { + \@@_set_normal_Latin:nn {bfit} {#1} + \@@_set_mathalphabet_Latin:nnn {bf} {it}{#1} + } + { + \bool_if:NF \g_@@_bfupLatin_bool + { + \@@_set_normal_Latin:nn {bfup,bfit} {#1} + \@@_set_mathalphabet_Latin:nnn {bf} {up,it}{#1} + } + } + } \@@_new_alphabet_config:nnn {bfit} {latin} - { - \bool_if:NF \g_@@_bfuplatin_bool - { - \@@_set_normal_latin:nn {bfup,bfit} {#1} - } - \@@_set_mathalphabet_latin:nnn {bfit} {up,it}{#1} - \bool_if:NTF \g_@@_bfliteral_bool - { - \@@_set_normal_latin:nn {bfit} {#1} - \@@_set_mathalphabet_latin:nnn {bf} {it}{#1} - } - { + { \bool_if:NF \g_@@_bfuplatin_bool - { - \@@_set_normal_latin:nn {bfup,bfit} {#1} - \@@_set_mathalphabet_latin:nnn {bf} {up,it}{#1} - } - } - } + { + \@@_set_normal_latin:nn {bfup,bfit} {#1} + } + \@@_set_mathalphabet_latin:nnn {bfit} {up,it}{#1} + \bool_if:NTF \g_@@_bfliteral_bool + { + \@@_set_normal_latin:nn {bfit} {#1} + \@@_set_mathalphabet_latin:nnn {bf} {it}{#1} + } + { + \bool_if:NF \g_@@_bfuplatin_bool + { + \@@_set_normal_latin:nn {bfup,bfit} {#1} + \@@_set_mathalphabet_latin:nnn {bf} {up,it}{#1} + } + } + } \@@_new_alphabet_config:nnn {bfit} {Greek} - { - \@@_set_mathalphabet_Greek:nnn {bfit} {up,it}{#1} - \bool_if:NTF \g_@@_bfliteral_bool - { - \@@_set_normal_Greek:nn {bfit}{#1} - \@@_set_mathalphabet_Greek:nnn {bf} {it}{#1} - } - { - \bool_if:NF \g_@@_bfupGreek_bool - { - \@@_set_normal_Greek:nn {bfup,bfit}{#1} - \@@_set_mathalphabet_Greek:nnn {bf} {up,it}{#1} - } - } - } + { + \@@_set_mathalphabet_Greek:nnn {bfit} {up,it}{#1} + \bool_if:NTF \g_@@_bfliteral_bool + { + \@@_set_normal_Greek:nn {bfit}{#1} + \@@_set_mathalphabet_Greek:nnn {bf} {it}{#1} + } + { + \bool_if:NF \g_@@_bfupGreek_bool + { + \@@_set_normal_Greek:nn {bfup,bfit}{#1} + \@@_set_mathalphabet_Greek:nnn {bf} {up,it}{#1} + } + } + } \@@_new_alphabet_config:nnn {bfit} {greek} - { - \@@_set_mathalphabet_greek:nnn {bfit} {up,it} {#1} - \bool_if:NTF \g_@@_bfliteral_bool - { - \@@_set_normal_greek:nn {bfit} {#1} - \@@_set_mathalphabet_greek:nnn {bf} {it} {#1} - } - { - \bool_if:NF \g_@@_bfupgreek_bool - { - \@@_set_normal_greek:nn {bfit,bfup} {#1} - \@@_set_mathalphabet_greek:nnn {bf} {up,it} {#1} - } - } - } + { + \@@_set_mathalphabet_greek:nnn {bfit} {up,it} {#1} + \bool_if:NTF \g_@@_bfliteral_bool + { + \@@_set_normal_greek:nn {bfit} {#1} + \@@_set_mathalphabet_greek:nnn {bf} {it} {#1} + } + { + \bool_if:NF \g_@@_bfupgreek_bool + { + \@@_set_normal_greek:nn {bfit,bfup} {#1} + \@@_set_mathalphabet_greek:nnn {bf} {up,it} {#1} + } + } + } \@@_new_alphabet_config:nnn {bfit} {misc} - { - \bool_if:NTF \g_@@_literal_Nabla_bool - { \@@_set_normal_char:nnn {Nabla}{bfit}{#1} } - { - \bool_if:NF \g_@@_upNabla_bool - { \@@_set_normal_char:nnn {Nabla}{bfup,bfit}{#1} } - } - \bool_if:NTF \g_@@_literal_partial_bool - { \@@_set_normal_char:nnn {partial}{bfit}{#1} } - { - \bool_if:NF \g_@@_uppartial_bool - { \@@_set_normal_char:nnn {partial}{bfup,bfit}{#1} } - } - \@@_set_mathalphabet_pos:nnnn {bfit} {partial} {up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {bfit} {Nabla} {up,it}{#1} - \bool_if:NTF \g_@@_literal_partial_bool - { - \@@_set_mathalphabet_pos:nnnn {bf} {partial} {it}{#1} - } - { - \bool_if:NF \g_@@_uppartial_bool - { - \@@_set_mathalphabet_pos:nnnn {bf} {partial} {up,it}{#1} - } - } - \bool_if:NTF \g_@@_literal_Nabla_bool - { - \@@_set_mathalphabet_pos:nnnn {bf} {Nabla} {it}{#1} - } - { - \bool_if:NF \g_@@_upNabla_bool - { - \@@_set_mathalphabet_pos:nnnn {bf} {Nabla} {up,it}{#1} - } - } - } + { + \bool_if:NTF \g_@@_literal_Nabla_bool + { \@@_set_normal_char:nnn {Nabla} {bfit} {#1} } + { + \bool_if:NF \g_@@_upNabla_bool + { \@@_set_normal_char:nnn {Nabla} {bfup,bfit} {#1} } + } + + \bool_if:NTF \g_@@_literal_partial_bool + { \@@_set_normal_char:nnn {partial} {bfit} {#1} } + { + \bool_if:NF \g_@@_uppartial_bool + { \@@_set_normal_char:nnn {partial} {bfup,bfit} {#1} } + } + + \@@_set_mathalphabet_pos:nnnn {bfit} {partial} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {bfit} {Nabla} {up,it} {#1} + + \bool_if:NTF \g_@@_literal_partial_bool + { + \@@_set_mathalphabet_pos:nnnn {bf} {partial} {it}{#1} + } + { + \bool_if:NF \g_@@_uppartial_bool + { + \@@_set_mathalphabet_pos:nnnn {bf} {partial} {up,it}{#1} + } + } + + \bool_if:NTF \g_@@_literal_Nabla_bool + { + \@@_set_mathalphabet_pos:nnnn {bf} {Nabla} {it}{#1} + } + { + \bool_if:NF \g_@@_upNabla_bool + { + \@@_set_mathalphabet_pos:nnnn {bf} {Nabla} {up,it}{#1} + } + } + } % \end{macrocode} % % % \subsection{Bold Upright: bfup} % \begin{macrocode} \@@_new_alphabet_config:nnn {bfup} {num} - { - \@@_set_mathalphabet_numbers:nnn {bf} {up}{#1} - \@@_set_mathalphabet_numbers:nnn {bfup} {up}{#1} - } + { + \@@_set_mathalphabet_numbers:nnn {bf} {up} {#1} + \@@_set_mathalphabet_numbers:nnn {bfup} {up} {#1} + } \@@_new_alphabet_config:nnn {bfup} {Latin} - { - \bool_if:NT \g_@@_bfupLatin_bool - { - \@@_set_normal_Latin:nn {bfup,bfit} {#1} - } - \@@_set_mathalphabet_Latin:nnn {bfup} {up,it}{#1} - \bool_if:NTF \g_@@_bfliteral_bool - { - \@@_set_normal_Latin:nn {bfup} {#1} - \@@_set_mathalphabet_Latin:nnn {bf} {up}{#1} - } - { + { \bool_if:NT \g_@@_bfupLatin_bool - { - \@@_set_normal_Latin:nn {bfup,bfit} {#1} - \@@_set_mathalphabet_Latin:nnn {bf} {up,it}{#1} - } - } + { + \@@_set_normal_Latin:nn {bfup,bfit} {#1} + } + \@@_set_mathalphabet_Latin:nnn {bfup} {up,it} {#1} + \bool_if:NTF \g_@@_bfliteral_bool + { + \@@_set_normal_Latin:nn {bfup} {#1} + \@@_set_mathalphabet_Latin:nnn {bf} {up} {#1} + } + { + \bool_if:NT \g_@@_bfupLatin_bool + { + \@@_set_normal_Latin:nn {bfup,bfit} {#1} + \@@_set_mathalphabet_Latin:nnn {bf} {up,it} {#1} + } + } } \@@_new_alphabet_config:nnn {bfup} {latin} - { - \bool_if:NT \g_@@_bfuplatin_bool - { - \@@_set_normal_latin:nn {bfup,bfit} {#1} - } - \@@_set_mathalphabet_latin:nnn {bfup} {up,it}{#1} - \bool_if:NTF \g_@@_bfliteral_bool - { - \@@_set_normal_latin:nn {bfup} {#1} - \@@_set_mathalphabet_latin:nnn {bf} {up}{#1} - } - { + { \bool_if:NT \g_@@_bfuplatin_bool - { - \@@_set_normal_latin:nn {bfup,bfit} {#1} - \@@_set_mathalphabet_latin:nnn {bf} {up,it}{#1} - } - } - } + { + \@@_set_normal_latin:nn {bfup,bfit} {#1} + } + \@@_set_mathalphabet_latin:nnn {bfup} {up,it} {#1} + \bool_if:NTF \g_@@_bfliteral_bool + { + \@@_set_normal_latin:nn {bfup} {#1} + \@@_set_mathalphabet_latin:nnn {bf} {up} {#1} + } + { + \bool_if:NT \g_@@_bfuplatin_bool + { + \@@_set_normal_latin:nn {bfup,bfit} {#1} + \@@_set_mathalphabet_latin:nnn {bf} {up,it} {#1} + } + } + } + \@@_new_alphabet_config:nnn {bfup} {Greek} - { - \@@_set_mathalphabet_Greek:nnn {bfup} {up,it}{#1} - \bool_if:NTF \g_@@_bfliteral_bool - { - \@@_set_normal_Greek:nn {bfup}{#1} - \@@_set_mathalphabet_Greek:nnn {bf} {up}{#1} - } - { - \bool_if:NT \g_@@_bfupGreek_bool - { - \@@_set_normal_Greek:nn {bfup,bfit}{#1} - \@@_set_mathalphabet_Greek:nnn {bf} {up,it}{#1} - } - } - } + { + \@@_set_mathalphabet_Greek:nnn {bfup} {up,it} {#1} + \bool_if:NTF \g_@@_bfliteral_bool + { + \@@_set_normal_Greek:nn {bfup} {#1} + \@@_set_mathalphabet_Greek:nnn {bf} {up} {#1} + } + { + \bool_if:NT \g_@@_bfupGreek_bool + { + \@@_set_normal_Greek:nn {bfup,bfit} {#1} + \@@_set_mathalphabet_Greek:nnn {bf} {up,it} {#1} + } + } + } \@@_new_alphabet_config:nnn {bfup} {greek} - { - \@@_set_mathalphabet_greek:nnn {bfup} {up,it} {#1} - \bool_if:NTF \g_@@_bfliteral_bool - { - \@@_set_normal_greek:nn {bfup} {#1} - \@@_set_mathalphabet_greek:nnn {bf} {up} {#1} - } - { - \bool_if:NT \g_@@_bfupgreek_bool - { - \@@_set_normal_greek:nn {bfup,bfit} {#1} - \@@_set_mathalphabet_greek:nnn {bf} {up,it} {#1} - } - } - } + { + \@@_set_mathalphabet_greek:nnn {bfup} {up,it} {#1} + \bool_if:NTF \g_@@_bfliteral_bool + { + \@@_set_normal_greek:nn {bfup} {#1} + \@@_set_mathalphabet_greek:nnn {bf} {up} {#1} + } + { + \bool_if:NT \g_@@_bfupgreek_bool + { + \@@_set_normal_greek:nn {bfup,bfit} {#1} + \@@_set_mathalphabet_greek:nnn {bf} {up,it} {#1} + } + } + } \@@_new_alphabet_config:nnn {bfup} {misc} - { - \bool_if:NTF \g_@@_literal_Nabla_bool - { - \@@_set_normal_char:nnn {Nabla}{bfup}{#1} - } - { - \bool_if:NT \g_@@_upNabla_bool - { - \@@_set_normal_char:nnn {Nabla}{bfup,bfit}{#1} - } - } - \bool_if:NTF \g_@@_literal_partial_bool - { - \@@_set_normal_char:nnn {partial}{bfup}{#1} - } - { - \bool_if:NT \g_@@_uppartial_bool - { - \@@_set_normal_char:nnn {partial}{bfup,bfit}{#1} - } - } - \@@_set_mathalphabet_pos:nnnn {bfup} {partial} {up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {bfup} {Nabla} {up,it}{#1} - \@@_set_mathalphabet_pos:nnnn {bfup} {digamma} {up}{#1} - \@@_set_mathalphabet_pos:nnnn {bfup} {Digamma} {up}{#1} - \@@_set_mathalphabet_pos:nnnn {bf} {digamma} {up}{#1} - \@@_set_mathalphabet_pos:nnnn {bf} {Digamma} {up}{#1} - \bool_if:NTF \g_@@_literal_partial_bool - { - \@@_set_mathalphabet_pos:nnnn {bf} {partial} {up}{#1} - } - { - \bool_if:NT \g_@@_uppartial_bool - { - \@@_set_mathalphabet_pos:nnnn {bf} {partial} {up,it}{#1} - } - } - \bool_if:NTF \g_@@_literal_Nabla_bool - { - \@@_set_mathalphabet_pos:nnnn {bf} {Nabla} {up}{#1} - } - { - \bool_if:NT \g_@@_upNabla_bool - { - \@@_set_mathalphabet_pos:nnnn {bf} {Nabla} {up,it}{#1} - } - } - } + { + \bool_if:NTF \g_@@_literal_Nabla_bool + { + \@@_set_normal_char:nnn {Nabla} {bfup} {#1} + } + { + \bool_if:NT \g_@@_upNabla_bool + { + \@@_set_normal_char:nnn {Nabla} {bfup,bfit} {#1} + } + } + \bool_if:NTF \g_@@_literal_partial_bool + { + \@@_set_normal_char:nnn {partial} {bfup} {#1} + } + { + \bool_if:NT \g_@@_uppartial_bool + { + \@@_set_normal_char:nnn {partial} {bfup,bfit} {#1} + } + } + \@@_set_mathalphabet_pos:nnnn {bfup} {partial} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {bfup} {Nabla} {up,it} {#1} + \@@_set_mathalphabet_pos:nnnn {bfup} {digamma} {up} {#1} + \@@_set_mathalphabet_pos:nnnn {bfup} {Digamma} {up} {#1} + \@@_set_mathalphabet_pos:nnnn {bf} {digamma} {up} {#1} + \@@_set_mathalphabet_pos:nnnn {bf} {Digamma} {up} {#1} + \bool_if:NTF \g_@@_literal_partial_bool + { + \@@_set_mathalphabet_pos:nnnn {bf} {partial} {up} {#1} + } + { + \bool_if:NT \g_@@_uppartial_bool + { + \@@_set_mathalphabet_pos:nnnn {bf} {partial} {up,it} {#1} + } + } + \bool_if:NTF \g_@@_literal_Nabla_bool + { + \@@_set_mathalphabet_pos:nnnn {bf} {Nabla} {up}{#1} + } + { + \bool_if:NT \g_@@_upNabla_bool + { + \@@_set_mathalphabet_pos:nnnn {bf} {Nabla} {up,it} {#1} + } + } + } % \end{macrocode} % % \subsection{Bold fractur or fraktur or blackletter: bffrak} % \begin{macrocode} \@@_new_alphabet_config:nnn {bffrak} {Latin} - { - \@@_set_mathalphabet_Latin:nnn {bffrak} {up,it}{#1} - } + { + \@@_set_mathalphabet_Latin:nnn {bffrak} {up,it}{#1} + } \@@_new_alphabet_config:nnn {bffrak} {latin} - { - \@@_set_mathalphabet_latin:nnn {bffrak} {up,it}{#1} - } + { + \@@_set_mathalphabet_latin:nnn {bffrak} {up,it}{#1} + } % \end{macrocode} % % \subsection{Bold script or calligraphic: bfscr} % \begin{macrocode} \@@_new_alphabet_config:nnn {bfscr} {Latin} - { - \@@_set_mathalphabet_Latin:nnn {bfscr} {up,it}{#1} - } + { + \@@_set_mathalphabet_Latin:nnn {bfscr} {up,it}{#1} + } \@@_new_alphabet_config:nnn {bfscr} {latin} - { - \@@_set_mathalphabet_latin:nnn {bfscr} {up,it}{#1} - } + { + \@@_set_mathalphabet_latin:nnn {bfscr} {up,it}{#1} + } \@@_new_alphabet_config:nnn {bfcal} {Latin} - { - \@@_set_mathalphabet_Latin:nnn {bfcal} {up,it}{#1} - } + { + \@@_set_mathalphabet_Latin:nnn {bfcal} {up,it}{#1} + } % \end{macrocode} % % \subsection{Bold upright sans serif: bfsfup} % \begin{macrocode} \@@_new_alphabet_config:nnn {bfsfup} {num} - { - \@@_set_mathalphabet_numbers:nnn {bfsf} {up}{#1} - \@@_set_mathalphabet_numbers:nnn {bfsfup} {up}{#1} - } + { + \@@_set_mathalphabet_numbers:nnn {bfsf} {up}{#1} + \@@_set_mathalphabet_numbers:nnn {bfsfup} {up}{#1} + } \@@_new_alphabet_config:nnn {bfsfup} {Latin} - { - \bool_if:NTF \g_@@_sfliteral_bool - { - \@@_set_normal_Latin:nn {bfsfup} {#1} - \@@_set_mathalphabet_Latin:nnn {bfsf} {up}{#1} - } - { - \bool_if:NT \g_@@_upsans_bool - { - \@@_set_normal_Latin:nn {bfsfup,bfsfit} {#1} - \@@_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1} - } - } - \@@_set_mathalphabet_Latin:nnn {bfsfup} {up,it}{#1} - } + { + \bool_if:NTF \g_@@_sfliteral_bool + { + \@@_set_normal_Latin:nn {bfsfup} {#1} + \@@_set_mathalphabet_Latin:nnn {bfsf} {up}{#1} + } + { + \bool_if:NT \g_@@_upsans_bool + { + \@@_set_normal_Latin:nn {bfsfup,bfsfit} {#1} + \@@_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1} + } + } + \@@_set_mathalphabet_Latin:nnn {bfsfup} {up,it}{#1} + } \@@_new_alphabet_config:nnn {bfsfup} {latin} - { - \bool_if:NTF \g_@@_sfliteral_bool - { - \@@_set_normal_latin:nn {bfsfup} {#1} - \@@_set_mathalphabet_latin:nnn {bfsf} {up}{#1} - } - { - \bool_if:NT \g_@@_upsans_bool - { - \@@_set_normal_latin:nn {bfsfup,bfsfit} {#1} - \@@_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1} - } - } - \@@_set_mathalphabet_latin:nnn {bfsfup} {up,it}{#1} - } + { + \bool_if:NTF \g_@@_sfliteral_bool + { + \@@_set_normal_latin:nn {bfsfup} {#1} + \@@_set_mathalphabet_latin:nnn {bfsf} {up}{#1} + } + { + \bool_if:NT \g_@@_upsans_bool + { + \@@_set_normal_latin:nn {bfsfup,bfsfit} {#1} + \@@_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1} + } + } + \@@_set_mathalphabet_latin:nnn {bfsfup} {up,it}{#1} + } \@@_new_alphabet_config:nnn {bfsfup} {Greek} - { - \bool_if:NTF \g_@@_sfliteral_bool - { - \@@_set_normal_Greek:nn {bfsfup}{#1} - \@@_set_mathalphabet_Greek:nnn {bfsf} {up}{#1} - } - { - \bool_if:NT \g_@@_upsans_bool - { - \@@_set_normal_Greek:nn {bfsfup,bfsfit}{#1} - \@@_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1} - } - } - \@@_set_mathalphabet_Greek:nnn {bfsfup} {up,it}{#1} - } + { + \bool_if:NTF \g_@@_sfliteral_bool + { + \@@_set_normal_Greek:nn {bfsfup}{#1} + \@@_set_mathalphabet_Greek:nnn {bfsf} {up}{#1} + } + { + \bool_if:NT \g_@@_upsans_bool + { + \@@_set_normal_Greek:nn {bfsfup,bfsfit}{#1} + \@@_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1} + } + } + \@@_set_mathalphabet_Greek:nnn {bfsfup} {up,it}{#1} + } \@@_new_alphabet_config:nnn {bfsfup} {greek} - { - \bool_if:NTF \g_@@_sfliteral_bool - { - \@@_set_normal_greek:nn {bfsfup} {#1} - \@@_set_mathalphabet_greek:nnn {bfsf} {up} {#1} - } - { - \bool_if:NT \g_@@_upsans_bool - { - \@@_set_normal_greek:nn {bfsfup,bfsfit} {#1} - \@@_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1} - } - } - \@@_set_mathalphabet_greek:nnn {bfsfup} {up,it} {#1} - } + { + \bool_if:NTF \g_@@_sfliteral_bool + { + \@@_set_normal_greek:nn {bfsfup} {#1} + \@@_set_mathalphabet_greek:nnn {bfsf} {up} {#1} + } + { + \bool_if:NT \g_@@_upsans_bool + { + \@@_set_normal_greek:nn {bfsfup,bfsfit} {#1} + \@@_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1} + } + } + \@@_set_mathalphabet_greek:nnn {bfsfup} {up,it} {#1} + } + \@@_new_alphabet_config:nnn {bfsfup} {misc} { \bool_if:NTF \g_@@_literal_Nabla_bool @@ -916,7 +925,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-amsmath.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-amsmath.dtx new file mode 100644 index 00000000000..7900b3360a6 --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-amsmath.dtx @@ -0,0 +1,225 @@ +%%^^A%% um-code-amsmath.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Compatibility with amsmath. + +% \section{Compatibility with \pkg{amsmath}} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% 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} + { + \tl_remove_once:Nn \@begindocumenthook + { + \mathchardef\std@minus\mathcode`\-\relax + \mathchardef\std@equal\mathcode`\=\relax + } + \AtBeginDocument + { + \Umathcharnumdef\std@minus\Umathcodenum`- + \Umathcharnumdef\std@equal\Umathcodenum`= + } +% \end{macrocode} +% +% \begin{macrocode} + \cs_set:Npn \@cdots {\mathinner{\unicodecdots}} + \cs_set_eq:NN \dotsb@ \cdots +% \end{macrocode} +% This isn't as clever as the \pkg{amsmath} definition but I think it works: +% \begin{macrocode} +%<*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} + \@@_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 + { +% \end{macrocode} +% Here we use stack top shift + stack bottom shift, which sounds reasonable. +% \begin{macrocode} + \@@_stack_num_up:N \scriptstyle + + \@@_stack_denom_down:N \scriptstyle + } +% \end{macrocode} +% Here we use the minimum stack gap. +% \begin{macrocode} + \lineskip \@@_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 + } +%</XE> +% \end{macrocode} +% The roots need a complete rework. +% \begin{macrocode} +%<*LU> + \@@_check_and_fix: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 } + } + { + \Uroot \l_@@_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 + } +%</LU> +% \end{macrocode} +% +% \begin{macrocode} + \@@_check_and_fix:NNnnn \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@ + } +%<*LU> + { + \hbox_set:Nn \l_tmpa_box + { + \c_math_toggle_token \m@th + #1 \mskip \uproot@ mu + \c_math_toggle_token + } + \Uroot \l_@@_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 } + } +%</LU> +%<*XE> + { + \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 + \@@_mathstyle_scale:Nnn #1 { \kern } { \fontdimen 63 \g_@@_sqrt_font_cmd_tl } + \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 \g_@@_sqrt_font_cmd_tl / 100 + } + { \box_use:N \rootbox } + \@@_mathstyle_scale:Nnn #1 { \kern } { \fontdimen 64 \g_@@_sqrt_font_cmd_tl } + \mkern \leftroot@ mu + \box_use_clear:N \l_tmpa_box + } +%</XE> + } +% \end{macrocode} +% +% \begin{macrocode} +%</package> +% \end{macrocode} + +\endinput + +% /© +% +% ------------------------------------------------ +% The UNICODE-MATH package <wspr.io/unicode-math> +% ------------------------------------------------ +% 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/>. +% ------------------------------------------------ +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-api.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-api.dtx index 434625df65b..c319601fb2b 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-code-api.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-api.dtx @@ -1,4 +1,5 @@ %%^^A%% um-code-api.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% The (underdeveloped) API to interface with the package internals. % \section{Programmers' interface} % @@ -33,7 +34,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-base.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-base.dtx index 0fbdc55c1ee..6564d7bf026 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-code-base.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-base.dtx @@ -1,4 +1,5 @@ %%^^A%% um-code-base.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Definition of unicode-math.sty, which splits and loads according to engine. % \section{The \texttt{unicode-math.sty} loading file} % @@ -37,10 +38,11 @@ % \begin{macrocode} \RequirePackage{expl3,xparse,l3keys2e} \RequirePackage{fontspec} -\RequirePackage{ucharcat} -\RequirePackage{fix-cm} % avoid some warnings (still necessary? check...) \RequirePackage{filehook} +\RequirePackage{fix-cm} +%<debug>\RequirePackage{l3benchmark} % \end{macrocode} +% % \paragraph{Bifurcate} % \begin{macrocode} \ExplSyntaxOn @@ -64,7 +66,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-compat.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-compat.dtx index 84f6f600e62..2aca97a2fa9 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-code-compat.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-compat.dtx @@ -1,4 +1,5 @@ %%^^A%% um-code-compat.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Compatibility with 3rd party packages. % \section{Compatibility} % @@ -6,52 +7,6 @@ %<*package> % \end{macrocode} % -% \begin{macro}{\@@_check_and_fix:NNnnnn} -% \darg{command} -% \darg{factory command} -% \darg{parameter text} -% \darg{expected replacement text} -% \darg{new replacement text for \LuaTeX} -% \darg{new replacement text for \XeTeX} -% Tries to patch \meta{command}. -% If \meta{command} is undefined, do nothing. -% Otherwise it must be a macro with the given \meta{parameter text} and \meta{expected replacement text}, created by the given \meta{factory command} or equivalent. -% In this case it will be overwritten using the \meta{parameter text} and the \meta{new replacement text for \LuaTeX} or the \meta{new replacement text for \XeTeX}, depending on the engine. -% Otherwise issue a warning and don’t overwrite. -% \begin{macrocode} -\cs_new_protected_nopar:Nn \@@_check_and_fix:NNnnnn - { - \cs_if_exist:NT #1 - { - \token_if_macro:NTF #1 - { - \group_begin: - #2 \@@_tmpa:w #3 { #4 } - \cs_if_eq:NNTF #1 \@@_tmpa:w - { - \msg_info:nnx { unicode-math } { patch-macro } - { \token_to_str:N #1 } - \group_end: - #2 #1 #3 -%<XE> { #6 } -%<LU> { #5 } - } - { - \msg_warning:nnxxx { unicode-math } { wrong-meaning } - { \token_to_str:N #1 } { \token_to_meaning:N #1 } - { \token_to_meaning:N \@@_tmpa:w } - \group_end: - } - } - { - \msg_warning:nnx { unicode-math } { macro-expected } - { \token_to_str:N #1 } - } - } - } -% \end{macrocode} -% \end{macro} -% % \begin{macro}{\@@_check_and_fix:NNnnn} % \darg{command} % \darg{factory command} @@ -61,39 +16,43 @@ % Tries to patch \meta{command}. % If \meta{command} is undefined, do nothing. % Otherwise it must be a macro with the given \meta{parameter text} and \meta{expected replacement text}, created by the given \meta{factory command} or equivalent. -% In this case it will be overwritten using the \meta{parameter text} and the \meta{new replacement text}. +% In this case it will be overwritten using the \meta{parameter text} and the \meta{new replacement text for \LuaTeX} or the \meta{new replacement text for \XeTeX}, depending on the engine. % Otherwise issue a warning and don’t overwrite. % \begin{macrocode} \cs_new_protected_nopar:Nn \@@_check_and_fix:NNnnn - { - \@@_check_and_fix:NNnnnn #1 #2 { #3 } { #4 } { #5 } { #5 } - } + { + \cs_if_exist:NT #1 + { + \token_if_macro:NTF #1 + { + \group_begin: + #2 \@@_tmpa:w #3 { #4 } + \cs_if_eq:NNTF #1 \@@_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 \@@_tmpa:w } + \group_end: + } + } + { + \msg_warning:nnx { unicode-math } { macro-expected } + { \token_to_str:N #1 } + } + } + } % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_check_and_fix_luatex:NNnnn} -% \begin{macro}{\@@_check_and_fix_luatex:cNnnn} -% \darg{command} -% \darg{factory command} -% \darg{parameter text} -% \darg{expected replacement text} -% \darg{new replacement text} -% Tries to patch \meta{command}. -% If \XeTeX\ is the current engine or \meta{command} is undefined, do nothing. -% Otherwise it must be a macro with the given \meta{parameter text} and \meta{expected replacement text}, created by the given \meta{factory command} or equivalent. -% In this case it will be overwritten using the \meta{parameter text} and the \meta{new replacement text}. -% Otherwise issue a warning and don’t overwrite. -% \begin{macrocode} -\cs_new_protected_nopar:Nn \@@_check_and_fix_luatex:NNnnn - { -%<LU> \@@_check_and_fix:NNnnn #1 #2 { #3 } { #4 } { #5 } - } -\cs_generate_variant:Nn \@@_check_and_fix_luatex:NNnnn { c } -% \end{macrocode} -% \end{macro} -% \end{macro} +% \section{Patching/augmenting 3rd-party packages} +% +% \subsection{\pkg{url}} % -% \paragraph{\pkg{url}} % Simply need to get \pkg{url} in a state such that % when it switches to math mode and enters \ascii\ characters, the maths % setup (i.e., \pkg{unicode-math}) doesn't remap the symbols into Plane 1. @@ -104,310 +63,70 @@ % font still work correctly. % \begin{macrocode} \AtEndOfPackageFile * {url} - { - \tl_put_left:Nn \Url@FormatString { \@@_switchto_up: } - \tl_put_right:Nn \UrlSpecials - { - \do\`{\mathchar`\`} - \do\'{\mathchar`\'} - \do\${\mathchar`\$} - \do\&{\mathchar`\&} - } - } + { + \tl_put_left:Nn \Url@FormatString { \@@_switchto_up: } + \tl_put_right:Nn \UrlSpecials + { + \do \` { \mathchar`\` } + \do \' { \mathchar`\' } + \do \$ { \mathchar`\$ } + \do \& { \mathchar`\& } + } + } % \end{macrocode} % -% \paragraph{\pkg{amsmath}} -% 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} - { -%<*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} - \cs_set:Npn \@cdots {\mathinner{\cdots}} - \cs_set_eq:NN \dotsb@ \cdots -% \end{macrocode} -% This isn't as clever as the \pkg{amsmath} definition but I think it works: -% \begin{macrocode} -%<*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} - \@@_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 - { -% \end{macrocode} -% Here we use stack top shift + stack bottom shift, which sounds reasonable. -% \begin{macrocode} - \@@_stack_num_up:N \scriptstyle - + \@@_stack_denom_down:N \scriptstyle - } -% \end{macrocode} -% Here we use the minimum stack gap. -% \begin{macrocode} - \lineskip \@@_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 - } -%</XE> -% \end{macrocode} -% The roots need a complete rework. -% \begin{macrocode} - \@@_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 } - } - { - \Uroot \l_@@_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 - } - \@@_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 - } - \Uroot \l_@@_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 - \@@_mathstyle_scale:Nnn #1 { \kern } - { - \fontdimen 63 \l_@@_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_@@_font / 100 - } - { - \box_use:N \rootbox - } - \@@_mathstyle_scale:Nnn #1 { \kern } - { - \fontdimen 64 \l_@@_font - } - \mkern \leftroot@ mu - \box_use_clear:N \l_tmpa_box - } - } -% \end{macrocode} +% \subsection{\pkg{mathtools}} % -% \paragraph{\pkg{amsopn}} -% This code is to improve the output of analphabetic symbols in text of operator names (\cs{sin}, \cs{cos}, etc.). Just comment out the offending lines for now: -% \begin{macrocode} -%<*XE> -\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: - } - } -%</XE> -% \end{macrocode} -% -% \paragraph{\pkg{mathtools}} % \pkg{mathtools}’s |\cramped| command and others that make use of its internal version use an incorrect font dimension. % -% \begin{macrocode} -%<*XE> -\AtEndOfPackageFile * { mathtools } - { - \@@_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@ - } -% \end{macrocode} % The \XeTeX\ version is pretty similar to the legacy version, only using the correct font dimensions. % Note we used `\verb|\XeTeXradical|' with the family 255 to be almost sure % that the radical rule width is not set. Former use of `\verb|\newfam|' had an % upsetting effect on legacy math alphabets. % \begin{macrocode} - { - \hbox_set:Nn \l_tmpa_box - { - \color@setgroup - \c_math_toggle_token - \m@th - #1 - \dim_zero:N \nulldelimiterspace - \XeTeXradical \c_two_hundred_fifty_five \c_zero { #2 } - \c_math_toggle_token - \color@endgroup - } - \box_set_ht:Nn \l_tmpa_box - { - \box_ht:N \l_tmpa_box -% \end{macrocode} -% Here we use the radical vertical gap. -% \begin{macrocode} - - \@@_radical_vgap:N #1 - } - \box_use_clear:N \l_tmpa_box +%<*XE> +\AtEndOfPackageFile * { mathtools } + { + \@@_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 \c_two_hundred_fifty_five \c_zero { #2 } + \c_math_toggle_token \color@endgroup + } + \box_set_ht:Nn \l_tmpa_box + { + \box_ht:N \l_tmpa_box - \@@_radical_vgap:N #1 + } + \box_use_clear:N \l_tmpa_box } - } + } %</XE> % \end{macrocode} % @@ -416,40 +135,42 @@ % \pkg{mathtools}’s |\overbracket| and |\underbracket| take optional % arguments and are defined in terms of rules, so we keep them, and rename % ours to |\Uoverbracket| and |\Uunderbracket|. +% +% Original definition used the height of |\braceld| which is not available +% with Unicode fonts, so we are hard coding the $5/18$ex suggested by +% \pkg{mathtools}’s documentation. % \begin{macrocode} \AtEndOfPackageFile * { mathtools } - { + { \cs_set_eq:NN \MToverbracket \overbracket \cs_set_eq:NN \MTunderbracket \underbracket \AtBeginDocument - { - \msg_warning:nn { unicode-math } { mathtools-overbracket } + { + \msg_warning:nn { unicode-math } { mathtools-overbracket } - \def\downbracketfill#1#2 - {% -% \end{macrocode} -% Original definition used the height of |\braceld| which is not available -% with Unicode fonts, so we are hard coding the $5/18$ex suggested by -% \pkg{mathtools}’s documentation. -% \begin{macrocode} - \edef\l_MT_bracketheight_fdim{.27ex}% - \downbracketend{#1}{#2} + \cs_set:Npn \downbracketfill #1 #2 + { + \tl_set:Nn \l_MT_bracketheight_fdim {.27ex} + \downbracketend {#1} {#2} \leaders \vrule \@height #1 \@depth \z@ \hfill - \downbracketend{#1}{#2}% - } - \def\upbracketfill#1#2 - {% - \edef\l_MT_bracketheight_fdim{.27ex}% - \upbracketend{#1}{#2} + \downbracketend {#1} {#2} + } + + \cs_set:Npn \upbracketfill #1 #2 + { + \tl_set:Nn \l_MT_bracketheight_fdim {.27ex} + \upbracketend {#1} {#2} \leaders \vrule \@height \z@ \@depth #1 \hfill - \upbracketend{#1}{#2}% + \upbracketend {#1} {#2} + } + + \cs_set_eq:NN \Uoverbracket \overbracket + \cs_set_eq:NN \Uunderbracket \underbracket + \cs_set_eq:NN \overbracket \MToverbracket + \cs_set_eq:NN \underbracket \MTunderbracket } - \let\Uoverbracket =\overbracket - \let\Uunderbracket=\underbracket - \let\overbracket =\MToverbracket - \let\underbracket =\MTunderbracket - }% end of AtBeginDocument + } % \end{macrocode} % \end{macro} % \end{macro} @@ -464,19 +185,21 @@ % \cmd{\providecommand} \cmd{\AtBeginDocument}, we can just define the % offending commands here. % \begin{macrocode} - \msg_warning:nn { unicode-math } { mathtools-colon } - \NewDocumentCommand \dblcolon { } { \Colon } - \NewDocumentCommand \coloneqq { } { \coloneq } - \NewDocumentCommand \Coloneqq { } { \Coloneq } - \NewDocumentCommand \eqqcolon { } { \eqcolon } - } +\AtEndOfPackageFile * { mathtools } + { + \msg_warning:nn { unicode-math } { mathtools-colon } + \NewDocumentCommand \dblcolon { } { \Colon } + \NewDocumentCommand \coloneqq { } { \coloneq } + \NewDocumentCommand \Coloneqq { } { \Coloneq } + \NewDocumentCommand \eqqcolon { } { \eqcolon } + } % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % -% \paragraph{\pkg{colonequals}} +% \subsection{\pkg{colonequals}} % % \begin{macro}{\ratio} % \begin{macro}{\coloncolon} @@ -489,15 +212,15 @@ % overwrite their definitions. % \begin{macrocode} \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_warning:nn { unicode-math } { colonequals } + \RenewDocumentCommand \ratio { } { \mathratio } + \RenewDocumentCommand \coloncolon { } { \Colon } + \RenewDocumentCommand \minuscolon { } { \dashcolon } + \RenewDocumentCommand \colonequals { } { \coloneq } + \RenewDocumentCommand \equalscolon { } { \eqcolon } + \RenewDocumentCommand \coloncolonequals { } { \Coloneq } + } % \end{macrocode} % \end{macro} % \end{macro} @@ -521,7 +244,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-epilogue.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-epilogue.dtx index 0a7f386eda6..19ea4bcebbf 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-code-epilogue.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-epilogue.dtx @@ -1,4 +1,5 @@ %%^^A%% um-code-epilogue.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Assorted definitions to close up. % \section{Epilogue} % @@ -16,23 +17,25 @@ % to upright or italic happens with the mathcode definitions, whereas these macros % just stand for the literal Unicode characters. % \begin{macrocode} -\AtBeginDocument{\@@_resolve_greek:} +\AtBeginDocument { \@@_resolve_greek: } +% \end{macrocode} +% \begin{macrocode} \cs_new:Npn \@@_resolve_greek: - { - \clist_map_inline:nn - { - Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda, - alpha,beta,gamma,delta,epsilon,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,phi,chi,psi,omega, - varTheta,varsigma,vartheta,varkappa,varrho,varpi,varepsilon,varphi - } - { - \tl_set:cx {##1} { \exp_not:c { mit ##1 } } - \tl_set:cx {up ##1} { \exp_not:N \symup \exp_not:c { ##1 } } - \tl_set:cx {it ##1} { \exp_not:N \symit \exp_not:c { ##1 } } - } - } + { + \clist_map_inline:nn + { + Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda, + alpha,beta,gamma,delta,epsilon,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,phi,chi,psi,omega, + varTheta,varsigma,vartheta,varkappa,varrho,varpi,varepsilon,varphi + } + { + \tl_set:cx {##1} { \exp_not:c { mit ##1 } } + \tl_set:cx {up ##1} { \exp_not:N \symup \exp_not:c { ##1 } } + \tl_set:cx {it ##1} { \exp_not:N \symit \exp_not:c { ##1 } } + } + } % \end{macrocode} % \end{macro} % @@ -42,128 +45,102 @@ % % Make sure \cs{Uroot} is defined in the case where the \LaTeX{} % kernel doesn't make it available with its native name. -% \begin{macrocode} -%<*LU> -\cs_if_exist:NF \Uroot - { \cs_new_eq:NN \Uroot \luatexUroot } -%</LU> -% \end{macrocode} % +% \begin{macro}{\@@_redefine_radical:} % \begin{macrocode} -\AtBeginDocument{\@@_redefine_radical:} -\cs_new:Nn \@@_redefine_radical: -%<*XE> - { - \@ifpackageloaded { amsmath } { } - { +\AtBeginDocument{ \@ifpackageloaded { amsmath } { } { \@@_redefine_radical: } } % \end{macrocode} +% % \begin{macro}{\r@@t} % \darg{A mathstyle (for \cmd\mathpalette)} % \darg{Leading superscript for the sqrt sign} % A re-implementation of \LaTeX's hard-coded n-root sign using the appropriate \cmd\fontdimen s. % \begin{macrocode} +%<*XE> +\cs_new:Nn \@@_redefine_radical: + { \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 - } - \@@_mathstyle_scale:Nnn ##1 { \kern } - { \fontdimen 63 \l_@@_font } - \box_move_up:nn - { - (\box_ht:N \l_tmpa_box - \box_dp:N \l_tmpa_box) - * \number \fontdimen 65 \l_@@_font / 100 - } - { \box_use:N \rootbox } - \@@_mathstyle_scale:Nnn ##1 { \kern } - { \fontdimen 64 \l_@@_font } - \box_use_clear:N \l_tmpa_box - } -% \end{macrocode} -% \end{macro} -% \begin{macrocode} - } - } + { + \hbox_set:Nn \l_tmpa_box + { + \c_math_toggle_token \m@th + ##1 \sqrtsign { ##2 } + \c_math_toggle_token + } + \@@_mathstyle_scale:NnnN ##1 { \kern } { \fontdimen 63 \g_@@_sqrt_font_cmd_tl } \g_@@_sqrt_font_cmd_tl + \box_move_up:nn + { + (\box_ht:N \l_tmpa_box - \box_dp:N \l_tmpa_box) * \number \fontdimen 65 \g_@@_sqrt_font_cmd_tl / 100 + } + { \box_use:N \rootbox } + \@@_mathstyle_scale:NnnN ##1 { \kern } { \fontdimen 64 \g_@@_sqrt_font_cmd_tl } \g_@@_sqrt_font_cmd_tl + \box_use_clear:N \l_tmpa_box + } + } %</XE> -%<*LU> - { - \@ifpackageloaded { amsmath } { } - { % \end{macrocode} +% \end{macro} +% % \begin{macro}{\root} % Redefine this macro for \LuaTeX, which provides us a nice primitive to use. % \begin{macrocode} +%<*LU> +\cs_new:Nn \@@_redefine_radical: + { \cs_set:Npn \root ##1 \of ##2 - { - \Uroot \l_@@_radical_sqrt_tl { ##1 } { ##2 } - } -% \end{macrocode} -% \end{macro} -% \begin{macrocode} - } - } + { + \Uroot \l_@@_radical_sqrt_tl { ##1 } { ##2 } + } + } %</LU> % \end{macrocode} +% \end{macro} +% \end{macro} +% % % \subsubsection{Active fractions} -% Active fractions can be setup independently of any maths font definition; +% +% Active fractions can be set up independently of any maths font definition; % all it requires is a mapping from the Unicode input chars to the relevant % \LaTeX\ fraction declaration. % % \begin{macrocode} -\cs_new:Npn \@@_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_@@_smallfrac_bool {\exp_not:N\tfrac} {\exp_not:N\frac} - {#2} {#3} - } - } - } +\cs_new:Nn \@@_which_frac:nn + { + \bool_if:NTF \l_@@_smallfrac_bool {\tfrac} {\frac} {#1} {#2} + } % \end{macrocode} -% These are redefined for each math font selection in case the |active-frac| -% feature changes. +% % \begin{macrocode} \cs_new:Npn \@@_setup_active_frac: - { - \group_begin: - \@@_define_active_frac:Nw ^^^^2189 0/3 - \@@_define_active_frac:Nw ^^^^2152 1/{10} - \@@_define_active_frac:Nw ^^^^2151 1/9 - \@@_define_active_frac:Nw ^^^^215b 1/8 - \@@_define_active_frac:Nw ^^^^2150 1/7 - \@@_define_active_frac:Nw ^^^^2159 1/6 - \@@_define_active_frac:Nw ^^^^2155 1/5 - \@@_define_active_frac:Nw ^^^^00bc 1/4 - \@@_define_active_frac:Nw ^^^^2153 1/3 - \@@_define_active_frac:Nw ^^^^215c 3/8 - \@@_define_active_frac:Nw ^^^^2156 2/5 - \@@_define_active_frac:Nw ^^^^00bd 1/2 - \@@_define_active_frac:Nw ^^^^2157 3/5 - \@@_define_active_frac:Nw ^^^^215d 5/8 - \@@_define_active_frac:Nw ^^^^2154 2/3 - \@@_define_active_frac:Nw ^^^^00be 3/4 - \@@_define_active_frac:Nw ^^^^2158 4/5 - \@@_define_active_frac:Nw ^^^^215a 5/6 - \@@_define_active_frac:Nw ^^^^215e 7/8 - \group_end: - } -\@@_setup_active_frac: + { + \@@_mathactive_remap:nn {"2189} { \@@_which_frac:nn {0} {3} } + \@@_mathactive_remap:nn {"2152} { \@@_which_frac:nn {1} {10} } + \@@_mathactive_remap:nn {"2151} { \@@_which_frac:nn {1} {9} } + \@@_mathactive_remap:nn {"215B} { \@@_which_frac:nn {1} {8} } + \@@_mathactive_remap:nn {"2150} { \@@_which_frac:nn {1} {7} } + \@@_mathactive_remap:nn {"2159} { \@@_which_frac:nn {1} {6} } + \@@_mathactive_remap:nn {"2155} { \@@_which_frac:nn {1} {5} } + \@@_mathactive_remap:nn {"00BC} { \@@_which_frac:nn {1} {4} } + \@@_mathactive_remap:nn {"2153} { \@@_which_frac:nn {1} {3} } + \@@_mathactive_remap:nn {"215C} { \@@_which_frac:nn {3} {8} } + \@@_mathactive_remap:nn {"2156} { \@@_which_frac:nn {2} {5} } + \@@_mathactive_remap:nn {"00BD} { \@@_which_frac:nn {1} {2} } + \@@_mathactive_remap:nn {"2157} { \@@_which_frac:nn {3} {5} } + \@@_mathactive_remap:nn {"215D} { \@@_which_frac:nn {5} {8} } + \@@_mathactive_remap:nn {"2154} { \@@_which_frac:nn {2} {3} } + \@@_mathactive_remap:nn {"00BE} { \@@_which_frac:nn {3} {4} } + \@@_mathactive_remap:nn {"2158} { \@@_which_frac:nn {4} {5} } + \@@_mathactive_remap:nn {"215A} { \@@_which_frac:nn {5} {6} } + \@@_mathactive_remap:nn {"215E} { \@@_which_frac:nn {7} {8} } + } % \end{macrocode} % +% \begin{macrocode} +\AtBeginDocument { \@@_setup_active_frac: } +% \end{macrocode} +% +% % \subsection{Synonyms and all the rest} % % These are symbols with multiple names. Eventually to be taken care of @@ -214,9 +191,9 @@ % \begin{macrocode} \cs_set_eq:NN \latexe_underbar:n \underbar \renewcommand\underbar - { - \mode_if_math:TF \mathunderbar \latexe_underbar:n - } + { + \mode_if_math:TF \mathunderbar \latexe_underbar:n + } % \end{macrocode} % \end{macro} % @@ -226,15 +203,15 @@ % We hope no-one will notice. % \begin{macrocode} \@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_@@_literal_colon_bool {:} { \mathpunct{:} } - } - } + { + % define their own colon, perhaps I should just steal it. (It does look much better.) + } + { + \cs_set_protected:Npn \colon + { + \bool_if:NTF \g_@@_literal_colon_bool {:} { \mathpunct{:} } + } + } % \end{macrocode} % \end{macro} % @@ -249,9 +226,11 @@ % \end{macro} % % \paragraph{Symbols} +% % \begin{macrocode} \cs_set_protected:Npn \| {\Vert} % \end{macrocode} +% % \cs{mathinner} items: % \begin{macrocode} \cs_set_protected:Npn \mathellipsis {\mathinner{\unicodeellipsis}} @@ -261,18 +240,20 @@ % \begin{macrocode} \cs_set_eq:NN \@@_text_slash: \slash \cs_set_protected:Npn \slash - { - \mode_if_math:TF {\mathslash} {\@@_text_slash:} - } + { + \mode_if_math:TF {\mathslash} {\@@_text_slash:} + } % \end{macrocode} % +% % \subsubsection{\cs{not}} % \label{sec:negations} % % The situation of \cs{not} symbol is currently messy, in Unicode it is defined % as a combining mark so naturally it should be treated as a math accent, -% however neither Lua\TeX\ nor \XeTeX\ correctly place it as it needs special -% treatment compared to other accents, furthermore a math accent changes the +% however \XeTeX\ does not correctly place it as it needs special +% treatment compared to other accents. +% Furthermore a math accent changes the % spacing of its nucleus, so \cs{not=} will be spaced as an ordinary not % relational symbol, which is undesired. % @@ -283,50 +264,124 @@ % This code is based on an answer to a TeX -- Stack Exchange question by Enrico % Gregorio\footnote{\url{http://tex.stackexchange.com/a/47260/729}}. % +% \begin{macro}{\not} % \begin{macrocode} -\cs_new:Npn \@@_newnot:N #1 - { - \tl_set:Nx \l_not_token_name_tl { \token_to_str:N #1 } - \exp_args:Nx \tl_if_empty:nF { \tl_tail:V \l_not_token_name_tl } - { - \tl_set:Nx \l_not_token_name_tl { \tl_tail:V \l_not_token_name_tl } - } - \cs_if_exist:cTF { n \l_not_token_name_tl } - { - \use:c { n \l_not_token_name_tl } - } - { - \cs_if_exist:cTF { not \l_not_token_name_tl } +\DeclareDocumentCommand \not {m} + { + \tl_set:Nx \l_@@_not_token_name_tl { \cs_to_str:N #1 } + \tl_if_empty:NT \l_@@_not_token_name_tl + { + \tl_set:Nx \l_@@_not_token_name_tl { \token_to_str:N #1 } + } + \cs_if_exist:cTF { not \l_@@_not_token_name_tl } { - \use:c { not \l_not_token_name_tl } + \use:c { not \l_@@_not_token_name_tl } } { - \@@_oldnot: #1 + \cs_if_exist:cTF { n \l_@@_not_token_name_tl } + { + \use:c { n \l_@@_not_token_name_tl } + } + { + \tl_if_eq:nnTF {#1} {$} { \notaccent{} } { \notaccent } #1 + } } - } - } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NewNegationCommand} +% \begin{macro}{\RenewNegationCommand} +% \begin{macrocode} +\DeclareDocumentCommand \NewNegationCommand {mm} + { + \@@_set_negation_command:Nnn \cs_new_protected:cpn {#1} {#2} + } % \end{macrocode} +% % \begin{macrocode} -\cs_set_eq:NN \@@_oldnot: \not -\AtBeginDocument{\cs_set_eq:NN \not \@@_newnot:N} +\DeclareDocumentCommand \RenewNegationCommand {mm} + { + \@@_set_negation_command:Nnn \cs_set_protected:cpn {#1} {#2} + } +% \end{macrocode} +% +% \begin{macrocode} +\cs_set:Nn \@@_set_negation_command:Nnn + { + \tl_set:Nx \l_@@_not_token_name_tl { \cs_to_str:N #2 } + \tl_if_empty:NT \l_@@_not_token_name_tl + { + \tl_set:Nx \l_@@_not_token_name_tl { \token_to_str:N #2 } + } + #1 { not \l_@@_not_token_name_tl } { #3 } + } % \end{macrocode} +% \end{macro} +% \end{macro} +% % \begin{macrocode} -\cs_new_protected_nopar:Nn \@@_setup_negations: - { - \cs_gset:cpn { not= } { \neq } - \cs_gset:cpn { not< } { \nless } - \cs_gset:cpn { not> } { \ngtr } - \cs_gset:Npn \ngets { \nleftarrow } - \cs_gset:Npn \nsimeq { \nsime } - \cs_gset:Npn \nequal { \ne } - \cs_gset:Npn \nle { \nleq } - \cs_gset:Npn \nge { \ngeq } - \cs_gset:Npn \ngreater { \ngtr } - \cs_gset:Npn \nforksnot { \forks } - } +\NewNegationCommand { = } { \neq } +\NewNegationCommand { < } { \nless } +\NewNegationCommand { > } { \ngtr } +\NewNegationCommand { \gets } { \nleftarrow } +\NewNegationCommand { \simeq } { \nsime } +\NewNegationCommand { \equal } { \ne } +\NewNegationCommand { \le } { \nleq } +\NewNegationCommand { \ge } { \ngeq } +\NewNegationCommand { \greater } { \ngtr } +\NewNegationCommand { \forksnot } { \forks } % \end{macrocode} % % +% \subsubsection{Full-width remapping} +% +% While this could be done with the full mathcode remapping machinery used +% for the other purposes, it would be fairly redundant with plain ASCII. +% Worse, this would slow down what is already an inefficient part of \pkg{unicode-math}. +% +% Instead we use mathactive to do a plain old mapping from full-width to ASCII directly. +% +% Until I get requests for it, I've not included symbols or punctuation here. +% +% \paragraph{Numbers} +% +% \begin{macrocode} +\int_step_inline:nnnn {0} {1} {9} + { + \@@_mathactive_remap:nn {"FF10+#1} {\char\int_eval:n{`\0+#1}} + } +% \end{macrocode} +% +% \paragraph{Letters} +% +% \begin{macrocode} +\int_step_inline:nnnn {0} {1} {26} + { + \@@_mathactive_remap:nn {"FF21+#1} {\char\int_eval:n{`\A+#1}} + \@@_mathactive_remap:nn {"FF41+#1} {\char\int_eval:n{`\a+#1}} + } +% \end{macrocode} +% +% +% \subsection{Legacy characters} +% +% \begin{macro}{\@@_undeclare_symbol:N} +% \begin{macrocode} +\cs_new:Nn \@@_undeclare_symbol:N + { + \cs_set_protected:Npn #1 + { \@@_error:nx {legacy-char-not-supported} { \token_to_str:N #1 } } + } +% \end{macrocode} +% \end{macro} +% +% If you have better ideas about what to do here, please mention. +% \begin{macrocode} +\@@_undeclare_symbol:N \arrowvert +\@@_undeclare_symbol:N \Arrowvert +\@@_undeclare_symbol:N \bracevert +% \end{macrocode} % % \begin{macrocode} %</package> @@ -343,7 +398,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-fontopt.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-fontopt.dtx index 59805971ee7..4e142e967bb 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-code-fontopt.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-fontopt.dtx @@ -1,4 +1,5 @@ %%^^A%% um-code-fontopt.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Keyval for `\setmathfont` % \section{Font loading options} % @@ -21,79 +22,79 @@ % \subsection{Script and scriptscript font options} % \begin{macrocode} \keys_define:nn {unicode-math} - { - script-features .tl_set:N = \l_@@_script_features_tl , - sscript-features .tl_set:N = \l_@@_sscript_features_tl , - script-font .tl_set:N = \l_@@_script_font_tl , - sscript-font .tl_set:N = \l_@@_sscript_font_tl , - } + { + script-features .tl_set:N = \l_@@_script_features_tl , + sscript-features .tl_set:N = \l_@@_sscript_features_tl , + script-font .tl_set:N = \l_@@_script_font_tl , + sscript-font .tl_set:N = \l_@@_sscript_font_tl , + } % \end{macrocode} % % \subsection{Range processing} % \seclabel{rangeproc} % +% Locally redefined all math symbol commands to their slot number prefixed by a quark. +% Similary for the math classes. % \begin{macrocode} \keys_define:nn {unicode-math} - { - range .code:n = - { - \bool_set_false:N \l_@@_init_bool + { + range .code:n = + { + \bool_set_false:N \l_@@_init_bool + \@@_range_init: + \group_begin: + \seq_map_inline:Nn \g_@@_mathclasses_seq + { + \cs_set:Npn ##1 { \use_none:n \q_unicode_math \exp_not:N ##1 } + } + \cs_set:Npn \_@@_sym:nnn ##1 ##2 ##3 + { + \cs_set:Npn ##2 { \use_none:n \q_unicode_math ##1 } + } + \@@_input_math_symbol_table: + \@@_range_process:n {#1} + \group_end: + } + } % \end{macrocode} +% +% \begin{macro}{\@@_range_init:} % Set processing functions if we're not defining the full Unicode math repetoire. % Math symbols are defined with \cmd\_@@_sym:nnn; see \secref{mathsymbol} % for the individual definitions % \begin{macrocode} +\cs_new:Nn \@@_range_init: + { \int_incr:N \g_@@_fam_int \tl_set:Nx \l_@@_symfont_label_tl {@@_fam\int_use:N\g_@@_fam_int} \cs_set_eq:NN \_@@_sym:nnn \@@_process_symbol_parse:nnn - \cs_set_eq:NN \@@_set_mathalphabet_char:Nnn \@@_mathmap_parse:Nnn \cs_set_eq:NN \@@_remap_symbol:nnn \@@_remap_symbol_parse:nnn \cs_set_eq:NN \@@_maybe_init_alphabet:n \use_none:n - \cs_set_eq:NN \@@_map_char_single:nn \@@_map_char_parse:nn \cs_set_eq:NN \@@_assign_delcode:nn \@@_assign_delcode_parse:nn \cs_set_eq:NN \@@_make_mathactive:nNN \@@_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_@@_char_range_seq - \seq_clear:N \l_@@_mclass_range_seq - \seq_clear:N \l_@@_cmd_range_seq - \seq_clear:N \l_@@_mathalph_seq - - \clist_map_inline:nn {#1} - { - \@@_if_mathalph_decl:nTF {##1} - { - \seq_put_right:Nx \l_@@_mathalph_seq - { - { \exp_not:V \l_@@_tmpa_tl } - { \exp_not:V \l_@@_tmpb_tl } - { \exp_not:V \l_@@_tmpc_tl } - } - } - { + \seq_gclear:N \g_@@_char_range_seq + \seq_gclear:N \g_@@_mclass_range_seq + \seq_gclear:N \g_@@_mathalph_seq + } % \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. +% \end{macro} +% +% \begin{macro}{\@@_range_process:} % \begin{macrocode} - \seq_if_in:NnTF \g_@@_mathclasses_seq {##1} - { \seq_put_right:Nn \l_@@_mclass_range_seq {##1} } - { - \bool_lazy_and:nnTF { \tl_if_single_p:n {##1} } { \token_if_cs_p:N ##1 } - { \seq_put_right:Nn \l_@@_cmd_range_seq {##1} } - { \seq_put_right:Nn \l_@@_char_range_seq {##1} } - } - } - } - } - } +\cs_new:Nn \@@_range_process:n + { + \clist_map_inline:nn {#1} + { + \@@_mathalph_decl:nF {##1} { \@@_range_decl:n {##1} } + } +} % \end{macrocode} +% \end{macro} % -% -% \begin{macro}{\@@_if_mathalph_decl:nTF} +% \begin{macro}{\@@_mathalph_decl:nF} % Possible forms of input:\\ % |\mathscr|\\ % |\mathscr->\mathup|\\ @@ -107,65 +108,95 @@ % The remap style can also be |\mathcal->stixcal|, which I marginally prefer % in the general case. % \begin{macrocode} -\prg_new_conditional:Nnn \@@_if_mathalph_decl:n {TF} - { - \tl_set:Nn \l_@@_tmpa_tl {#1} - \tl_clear:N \l_@@_tmpb_tl - \tl_clear:N \l_@@_tmpc_tl +\cs_new:Nn \@@_mathalph_decl:nF + { + + \tl_set:Nn \l_@@_tmpa_tl {#1} + \tl_clear:N \l_@@_tmpb_tl + \tl_clear:N \l_@@_tmpc_tl - \tl_if_in:NnT \l_@@_tmpa_tl {->} - { \exp_after:wN \@@_split_arrow:w \l_@@_tmpa_tl \q_nil } + \tl_if_in:NnT \l_@@_tmpa_tl {->} + { \exp_after:wN \@@_split_arrow:w \l_@@_tmpa_tl \q_nil } - \tl_if_in:NnT \l_@@_tmpa_tl {/} - { \exp_after:wN \@@_split_slash:w \l_@@_tmpa_tl \q_nil } + \tl_if_in:NnT \l_@@_tmpa_tl {/} + { \exp_after:wN \@@_split_slash:w \l_@@_tmpa_tl \q_nil } - \tl_set:Nx \l_@@_tmpa_tl { \tl_to_str:N \l_@@_tmpa_tl } - \exp_args:NNx \tl_remove_all:Nn \l_@@_tmpa_tl { \token_to_str:N \math } - \exp_args:NNx \tl_remove_all:Nn \l_@@_tmpa_tl { \token_to_str:N \sym } - \tl_trim_spaces:N \l_@@_tmpa_tl + \tl_set:Nx \l_@@_tmpa_tl { \tl_to_str:N \l_@@_tmpa_tl } + \exp_args:NNx \tl_remove_all:Nn \l_@@_tmpa_tl { \token_to_str:N \math } + \exp_args:NNx \tl_remove_all:Nn \l_@@_tmpa_tl { \token_to_str:N \sym } + \tl_trim_spaces:N \l_@@_tmpa_tl - \tl_if_empty:NT \l_@@_tmpc_tl - { \tl_set_eq:NN \l_@@_tmpc_tl \l_@@_tmpa_tl } + \tl_if_empty:NT \l_@@_tmpc_tl + { \tl_set_eq:NN \l_@@_tmpc_tl \l_@@_tmpa_tl } - \seq_if_in:NVTF \g_@@_named_ranges_seq \l_@@_tmpa_tl - { \prg_return_true: } { \prg_return_false: } - } + \clist_if_in:NVT \g_@@_bad_alpha_clist \l_@@_tmpa_tl { \@@_error:n {range-not-bf-sf} } + + \prop_if_exist:cTF {g_@@_named_range_ \l_@@_tmpa_tl _prop} + { + \seq_gput_right:Nx \g_@@_mathalph_seq + { + { \exp_not:V \l_@@_tmpa_tl } + { \exp_not:V \l_@@_tmpb_tl } + { \exp_not:V \l_@@_tmpc_tl } + } + } + {#2} + } % \end{macrocode} +% % \begin{macrocode} \cs_set:Npn \@@_split_arrow:w #1->#2 \q_nil - { - \tl_set:Nx \l_@@_tmpa_tl { \tl_trim_spaces:n {#1} } - \tl_set:Nx \l_@@_tmpc_tl { \tl_trim_spaces:n {#2} } - } + { + \tl_set:Nx \l_@@_tmpa_tl { \tl_trim_spaces:n {#1} } + \tl_set:Nx \l_@@_tmpc_tl { \tl_trim_spaces:n {#2} } + } % \end{macrocode} % \begin{macrocode} \cs_set:Npn \@@_split_slash:w #1/#2 \q_nil - { - \tl_set:Nx \l_@@_tmpa_tl { \tl_trim_spaces:n {#1} } - \tl_set:Nx \l_@@_tmpb_tl { \tl_trim_spaces:n {#2} } - } + { + \tl_set:Nx \l_@@_tmpa_tl { \tl_trim_spaces:n {#1} } + \tl_set:Nx \l_@@_tmpb_tl { \tl_trim_spaces:n {#2} } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_range_decl:n} +% \begin{macrocode} +\cs_new_protected:Nn \@@_range_decl:n + { + \bool_lazy_and:nnTF { \tl_if_single_p:n {#1} } { \token_if_cs_p:N #1 } + { + \tl_if_in:VnTF #1 { \q_unicode_math } + { + \seq_if_in:NnTF \g__um_mathclasses_seq {#1} + { \seq_gput_right:Nn \g_@@_mclass_range_seq {#1} } + { \seq_gput_right:Nx \g_@@_char_range_seq {#1} } + } + { \@@_error:nx {bad-cs-in-range} { \tl_to_str:n {#1} } } + } + { + \seq_gput_right:Nx \g_@@_char_range_seq {#1} + } + } % \end{macrocode} % \end{macro} % -% Pretty basic comma separated range processing. -% Donald Arseneau's \pkg{selectp} package has a cleverer technique. % -% \begin{macro}{\@@_if_char_spec:nNNT} +% \begin{macro}{\@@_if_char_spec:nNT} % \darg{Unicode character slot} -% \darg{control sequence (character macro)} % \darg{control sequence (math class)} % \darg{code to execute} -% This macro expands to |#4| -% if any of its arguments are contained in \cmd\l_@@_char_range_seq. +% This macro expands to |#3| +% if any of its arguments are contained in \cmd\g_@@_char_range_seq. % This list can contain either character ranges (for checking with |#1|) or control sequences. % These latter can either be the command name of a specific character, \emph{or} the math % type of one (\eg, \cmd\mathbin). % -% Character ranges are passed to \cs{@@_if_char_spec:nNNT}, which accepts input in the form shown in \tabref{ranges}. +% Character ranges are passed to \cs{@@_if_char_spec:nNT}, which accepts input in the form shown in \tabref{ranges}. % % \begin{table}[htbp] % \centering -% \topcaption{Ranges accepted by \cs{@@_if_char_spec:nNNT}.} +% \topcaption{Ranges accepted by \cs{@@_if_char_spec:nNT}.} % \label{tab:ranges} % \begin{tabular}{>{\ttfamily}cc} % \textrm{Input} & Range \\ @@ -180,19 +211,18 @@ % We have three tests, performed sequentially in order of execution time. % Any test finding a match jumps directly to the end. % \begin{macrocode} -\cs_new:Nn \@@_if_char_spec:nNNT +\cs_new:Nn \@@_if_char_spec:nNT { % math class: - \seq_if_in:NnT \l_@@_mclass_range_seq {#3} - { \use_none_delimit_by_q_nil:w } - - % command name: - \seq_if_in:NnT \l_@@_cmd_range_seq {#2} + \seq_if_in:NnT \g_@@_mclass_range_seq {#2} { \use_none_delimit_by_q_nil:w } % character slot: - \seq_map_inline:Nn \l_@@_char_range_seq + \seq_map_inline:Nn \g_@@_char_range_seq { + \@@_int_if_slot_is_last_in_range:nnT {#1} {##1} + { \seq_gremove_all:Nn \g_@@_char_range_seq {##1} } + \@@_int_if_slot_in_range:nnT {#1} {##1} { \seq_map_break:n { \use_none_delimit_by_q_nil:w } } } @@ -202,14 +232,20 @@ \q_nil \use:n { - \clist_put_right:Nx \l_@@_char_nrange_clist { \int_eval:n {#1} } - #4 + \cs_if_eq:NNT #2 \mathalpha + { + \clist_put_right:Nx \l_@@_mathmap_charints_clist { \int_eval:n {#1} } + } + #3 } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_int_if_slot_in_range:nnT} +% Pretty basic comma separated range processing. +% Donald Arseneau's \pkg{selectp} package has a cleverer technique. +% % A `numrange' is like |-2,5-8,12,17-| (can be unsorted). % % Four cases, four argument types: @@ -223,7 +259,9 @@ % % \begin{macrocode} \cs_new:Nn \@@_int_if_slot_in_range:nnT - { \@@_numrange_parse:nwT {#1} #2 - \q_nil - \q_stop {#3} } + { + \@@_numrange_parse:nwT {#1} #2 - \q_nil - \q_stop {#3} + } % \end{macrocode} % % \begin{macrocode} @@ -241,6 +279,27 @@ % \end{macrocode} % \end{macro} % +% +% \begin{macrocode} +\cs_new:Nn \@@_int_if_slot_is_last_in_range:nnT + { + \@@_numrange_last_parse:nwT {#1} #2 - \q_nil - \q_stop {#3} + } +% \end{macrocode} +% +% \begin{macrocode} +\cs_set:Npn \@@_numrange_last_parse:nwT #1 #2 - #3 - #4 \q_stop #5 + { + \tl_if_empty:nTF {#4} { \int_compare:nT {#1==#2} {#5} } + { + \tl_if_empty:nTF {#2} { \int_compare:nT {#1==#3} {#5} } + { + \int_compare:nT {#1==#3} {#5} + } } + } +% \end{macrocode} +% \end{macro} +% % \begin{macrocode} %</package> % \end{macrocode} @@ -256,7 +315,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-fontparam.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-fontparam.dtx index 54021c48f36..18006feaddb 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-code-fontparam.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-fontparam.dtx @@ -1,6 +1,7 @@ %%^^A%% um-code-fontparam.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Cross-platform interface for font parameters -% \section{Common interface for font parameters} +% \section{Cross-platform interface for font parameters} % % \begin{macrocode} %<*package> @@ -134,18 +135,18 @@ % \begin{macrocode} \cs_new_protected_nopar:Nn \@@_font_param:nnnnn %<*XE> -{ - \@@_font_param_aux:ccnnnn { @@_ #1 :N } { @@_set_ #1 :Nn } - { #2 } { #3 } { #4 } { #5 } -} + { + \@@_font_param_aux:ccnnnn { @@_ #1 :N } { @@_set_ #1 :Nn } + { #2 } { #3 } { #4 } { #5 } + } %</XE> %<*LU> -{ - \tl_set:Nn \l_@@_tmpa_tl { #1 } - \tl_remove_all:Nn \l_@@_tmpa_tl { _ } - \@@_font_param_aux:ccc { @@_ #1 :N } { @@_set_ #1 :Nn } - { Umath \l_@@_tmpa_tl } -} + { + \tl_set:Nn \l_@@_tmpa_tl { #1 } + \tl_remove_all:Nn \l_@@_tmpa_tl { _ } + \@@_font_param_aux:ccc { @@_ #1 :N } { @@_set_ #1 :Nn } + { Umath \l_@@_tmpa_tl } + } %</LU> % \end{macrocode} % \end{macro} @@ -159,9 +160,9 @@ % The \XeTeX\ font dimension numbers must be integer constants. % \begin{macrocode} \cs_new_protected_nopar:Nn \@@_font_param:nnn - { - \@@_font_param:nnnnn { #1 } { #2 } { #2 } { #3 } { #3 } - } + { + \@@_font_param:nnnnn { #1 } { #2 } { #2 } { #3 } { #3 } + } % \end{macrocode} % \end{macro} % @@ -173,9 +174,9 @@ % The \XeTeX\ font dimension number must be an integer constant. % \begin{macrocode} \cs_new_protected_nopar:Nn \@@_font_param:nn - { - \@@_font_param:nnnnn { #1 } { #2 } { #2 } { #2 } { #2 } - } + { + \@@_font_param:nnnnn { #1 } { #2 } { #2 } { #2 } { #2 } + } % \end{macrocode} % \end{macro} % @@ -198,13 +199,13 @@ \cs_new_protected_nopar:Nn \@@_font_param_aux:NNnnnn { \cs_new_nopar:Npn #1 ##1 - { - \@@_font_dimen:Nnnnn ##1 { #3 } { #4 } { #5 } { #6 } - } + { + \@@_font_dimen:Nnnnn ##1 { #3 } { #4 } { #5 } { #6 } + } \cs_new_protected_nopar:Npn #2 ##1 ##2 - { - #1 ##1 \dim_eval:n { ##2 } - } + { + #1 ##1 \dim_eval:n { ##2 } + } } \cs_generate_variant:Nn \@@_font_param_aux:NNnnnn { cc } %</XE> @@ -212,13 +213,13 @@ \cs_new_protected_nopar:Nn \@@_font_param_aux:NNN { \cs_new_nopar:Npn #1 ##1 - { - #3 ##1 - } + { + #3 ##1 + } \cs_new_protected_nopar:Npn #2 ##1 ##2 - { - #3 ##1 \dim_eval:n { ##2 } - } + { + #3 ##1 \dim_eval:n { ##2 } + } } \cs_generate_variant:Nn \@@_font_param_aux:NNN { ccc } %</LU> @@ -277,10 +278,8 @@ % % \subsection{Historical commands} % -% TODO: maybe no longer necessary? -% -% \begin{macro}{\@@_fontdimen_to_percent:nn} -% \begin{macro}{\@@_fontdimen_to_scale:nn} +% \begin{macro}{\@@_fontdimen_to_percent:nN} +% \begin{macro}{\@@_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|. @@ -288,36 +287,37 @@ % \cs{@@_fontdimen_to_scale:nn} returns a dimension correspond to the current % font size relative proportion based on that percentage. % \begin{macrocode} -\cs_new:Nn \@@_fontdimen_to_percent:nn - { - \fp_eval:n { \dim_to_decimal:n { \fontdimen #1 #2 } * 65536 / 100 } - } -\cs_new:Nn \@@_fontdimen_to_scale:nn - { - \fp_eval:n {\@@_fontdimen_to_percent:nn {#1} {#2} * \f@size } pt - } +\cs_new:Nn \@@_fontdimen_to_percent:nN + { + \fp_eval:n { \dim_to_decimal:n { \fontdimen #1 #2 } * 65536 / 100 } + } +\cs_new:Nn \@@_fontdimen_to_scale:nN + { + \fp_eval:n { \@@_fontdimen_to_percent:nN {#1} #2 * \f@size } pt + } % \end{macrocode} % \end{macro} % \end{macro} % -% \begin{macro}{\@@_mathstyle_scale:Nnn} +% \begin{macro}{\@@_mathstyle_scale:NnnN} % \darg{A math style (\cs{scriptstyle}, say)} % \darg{Macro that takes a non-delimited length argument (like \cmd\kern)} % \darg{Length control sequence to be scaled according to the math style} +% \darg{Math font face to use for the lookups} % 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:Nn \@@_mathstyle_scale:Nnn - { - \ifx#1\scriptstyle - #2 \@@_fontdimen_to_percent:nn {10} \l_@@_font #3 - \else - \ifx#1\scriptscriptstyle - #2 \@@_fontdimen_to_percent:nn {11} \l_@@_font #3 +\cs_new:Nn \@@_mathstyle_scale:NnnN + { + \ifx#1\scriptstyle + #2 \@@_fontdimen_to_percent:nN {10} #4 #3 \else - #2 #3 + \ifx#1\scriptscriptstyle + #2 \@@_fontdimen_to_percent:nN {11} #4 #3 + \else + #2 #3 + \fi \fi - \fi - } + } % \end{macrocode} % \end{macro} % @@ -336,7 +336,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-main.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-main.dtx index 942ea4771fa..2ae228df24e 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-code-main.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-main.dtx @@ -1,4 +1,5 @@ %%^^A%% um-code-main.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Definition of `\setmainfont`. % \section{The main \cs{setmathfont} macro} % @@ -6,103 +7,75 @@ %<*package> % \end{macrocode} % -% Using a |range| including large character sets such as \cmd\mathrel, -% \cmd\mathalpha, \etc, is \emph{very slow}! -% I hope to improve the performance somehow. -% % \begin{macro}{\@@_setmathfont:nn} +% \darg{keyval options} +% \darg{font name/file} % \begin{macrocode} \cs_set:Nn \@@_setmathfont:nn { - \tl_set:Nn \l_@@_fontname_tl {#2} % \end{macrocode} +% \begin{itemize} +% \item Initialise all local variables. +% \item % Erase any conception \LaTeX\ has of previously defined math symbol fonts; % this allows \cmd\DeclareSymbolFont\ at any point in the document. -% \begin{macrocode} - \cs_set_eq:NN \glb@currsize \scan_stop: -% \end{macrocode} -% Initialise all local variabes: -% \begin{macrocode} - \@@_init: -% \end{macrocode} +% \item % 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. +% \end{itemize} % \begin{macrocode} + + \@@_init:n {#2} + \cs_set_eq:NN \glb@currsize \scan_stop: \cs_if_exist:cF { S@ \f@size } { \calculate@math@sizes } - \csname S@\f@size\endcsname -% \end{macrocode} -% Parse options and tell people what's going on: -% \begin{macrocode} + \use:c { S@ \f@size } + \keys_set_known:nnN {unicode-math} {#1} \l_@@_unknown_keys_clist - \bool_if:NT \l_@@_init_bool { \@@_log:n {default-math-font} } -% \end{macrocode} -% Use \pkg{fontspec} to select a font to use. -% After loading the font, we detect what sizes it recommends for scriptsize and scriptscriptsize, so after setting those values appropriately, we reload the font to take these into account. -% \begin{macrocode} -%<debug> \csname TIC\endcsname - \@@_fontspec_select_font: -%<debug> \csname TOC\endcsname - \bool_if:nT { \l_@@_ot_math_bool && !\g_@@_mainfont_already_set_bool } + + \bool_if:NT \l_@@_init_bool { + \@@_fontspec_trial_font: \@@_declare_math_sizes: - \@@_fontspec_select_font: } -% \end{macrocode} -% Now define |\l_@@_symfont_label_tl| as the \LaTeX\ math font to access everything: -% \begin{macrocode} - \cs_if_exist:cF { sym \l_@@_symfont_label_tl } - { - \DeclareSymbolFont{\l_@@_symfont_label_tl} - {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault} - } - \SetSymbolFont{\l_@@_symfont_label_tl}{\l_@@_mversion_tl} - {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault} -% \end{macrocode} -% Set the bold math version. -% \begin{macrocode} - \str_if_eq_x:nnT {\l_@@_mversion_tl} {normal} - { - \SetSymbolFont{\l_@@_symfont_label_tl}{bold} - {\encodingdefault}{\l_@@_family_tl}{\bfdefault}{\updefault} - } -% \end{macrocode} -% 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} - \bool_if:nT { \l_@@_ot_math_bool && !\g_@@_mainfont_already_set_bool } + \@@_fontspec_select_font: + \@@_setup_math_fam: + \bool_if:NT \l_@@_init_bool { - \bool_set_true:N \g_@@_mainfont_already_set_bool \@@_setup_legacy_fam_two: \@@_setup_legacy_fam_three: } -% \end{macrocode} -% And now we input every single maths char. -% \begin{macrocode} -%<debug> \csname TIC\endcsname + \@@_input_math_symbol_table: -%<debug> \csname TOC\endcsname + % \end{macrocode} -% Finally, % \begin{itemize} +% \item the `once-off' setup that doesn't need to be per-font % \item remap symbols that don't take their natural mathcode; % \item activate any symbols that need to be math-active; % \item assign delimiter codes for symbols that need to grow; % \item setup the maths alphabets (\cs{symbf} etc.) --- % this is an extensive part of the code; see Section~\ref{sec:mathmap}; -% \item setup negations, which are handled on an ad hoc basis; see Section~\ref{sec:negations}. % \end{itemize} % \begin{macrocode} + \bool_if:NT \l_@@_init_bool \@@_onceoff_setup: \@@_remap_symbols: \@@_setup_mathactives: \@@_setup_delcodes: -%<debug> \csname TIC\endcsname \@@_setup_alphabets: -%<debug> \csname TOC\endcsname - \@@_setup_negations: + + %% TODO: what of the above should only be run for the "default"/"main" font? + + \bool_if:NTF \l_@@_init_bool + { +%<LU> \@@_mathparam_store: + \@@_log:n {default-math-font} + } + { +%<LU> \@@_mathparam_restore: + } } % \end{macrocode} % \end{macro} @@ -118,9 +91,8 @@ { \cs_if_exist:NF \l_@@_fontname_tl { - % TODO: update this when lmmath-bold.otf is released - \setmathfont{latinmodern-math.otf}[BoldFont={latinmodern-math.otf}] - \bool_set_false:N \g_@@_mainfont_already_set_bool + \setmathfont{latinmodern-math.otf} + [BoldFont={latinmodern-math.otf}] } } % \end{macrocode} @@ -129,78 +101,192 @@ % % TODO: need a better way to do this for the general case. (Maybe a `reset' command option?) % -% \begin{macro}{\@@_init:} +% \begin{macro}{\@@_init:n} +% Reset local variables. +% Default to defining the font for every math symbol character. % \begin{macrocode} -\cs_new:Nn \@@_init: +\cs_new:Nn \@@_init:n { + \tl_set:Nn \l_@@_fontname_tl {#1} \bool_set_true:N \l_@@_ot_math_bool - \tl_set:Nn \l_@@_mversion_tl {normal} + \tl_set:Nn \l_@@_mversion_tl {normal} \tl_set:Nn \l_@@_symfont_label_tl {operators} -% \end{macrocode} -% Defaults for the script and scriptscript font. -% \begin{macrocode} + \tl_set:Nn \l_@@_script_features_tl {Style=MathScript} \tl_set:Nn \l_@@_sscript_features_tl {Style=MathScriptScript} \tl_set_eq:NN \l_@@_script_font_tl \l_@@_fontname_tl \tl_set_eq:NN \l_@@_sscript_font_tl \l_@@_fontname_tl -% \end{macrocode} -% Default to defining the font for every math symbol character. -% \begin{macrocode} + \bool_set_true:N \l_@@_init_bool - \seq_clear:N \l_@@_char_range_seq - \clist_clear:N \l_@@_char_nrange_clist - \seq_clear:N \l_@@_mathalph_seq + \seq_gclear:N \g_@@_char_range_seq + \clist_clear:N \l_@@_mathmap_charints_clist + \seq_gclear:N \g_@@_mathalph_seq \seq_clear:N \l_@@_missing_alph_seq -% \end{macrocode} -% Other range initialisations. -% \begin{macrocode} - \cs_set_eq:NN \_@@_sym:nnn \@@_process_symbol_noparse:nnn - \cs_set_eq:NN \@@_set_mathalphabet_char:nnn \@@_mathmap_noparse:nnn - \cs_set_eq:NN \@@_remap_symbol:nnn \@@_remap_symbol_noparse:nnn - \cs_set_eq:NN \@@_maybe_init_alphabet:n \@@_init_alphabet:n - \cs_set_eq:NN \@@_map_char_single:nn \@@_map_char_noparse:nn - \cs_set_eq:NN \@@_assign_delcode:nn \@@_assign_delcode_noparse:nn - \cs_set_eq:NN \@@_make_mathactive:nNN \@@_make_mathactive_noparse:nNN + + \cs_set_eq:NN \_@@_sym:nnn \@@_process_symbol_noparse:nnn + \cs_set_eq:NN \@@_remap_symbol:nnn \@@_remap_symbol_noparse:nnn + \cs_set_eq:NN \@@_maybe_init_alphabet:n \@@_init_alphabet:n + \cs_set_eq:NN \@@_assign_delcode:nn \@@_assign_delcode_noparse:nn + \cs_set_eq:NN \@@_make_mathactive:nNN \@@_make_mathactive_noparse:nNN } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_declare_math_sizes:} % Set the math sizes according to the recommended font parameters. -% TODO: this shouldn't need to be per-engine; check out why the wrappers aren't used. % \begin{macrocode} +\tl_new:N \g_@@_main_font_cmd_tl \cs_new:Nn \@@_declare_math_sizes: { -%<*LU> - \fp_compare:nF { \@@_script_style_size:n {ScriptPercentScaleDown} == 0 } + \dim_compare:nF { \fontdimen 10 \g_@@_trial_font == 0pt } { \DeclareMathSizes { \f@size } { \f@size } - { \@@_script_style_size:n {ScriptPercentScaleDown} } - { \@@_script_style_size:n {ScriptScriptPercentScaleDown} } + { \@@_fontdimen_to_scale:nN {10} \g_@@_trial_font } + { \@@_fontdimen_to_scale:nN {11} \g_@@_trial_font } } -%</LU> -%<*XE> - \dim_compare:nF { \fontdimen 10 \l_@@_font == 0pt } + } +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\@@_fontspec_trial_font:} +% \begin{macrocode} +\cs_new:Nn \@@_fontspec_trial_font: + { + \tl_set:Nx \l_@@_font_keyval_tl { - \DeclareMathSizes { \f@size } { \f@size } - { \@@_fontdimen_to_scale:nn {10} {\l_@@_font} } - { \@@_fontdimen_to_scale:nn {11} {\l_@@_font} } +%<LU> Renderer = Basic, + BoldItalicFont = {}, ItalicFont = {}, + Script = Math, +%<LU> FontAdjustment = { \g_@@_luatex_copy_fontdimens_tl }, + \l_@@_unknown_keys_clist + } + + \fontspec_set_family:Nxn \l_@@_trial_family_tl {\l_@@_font_keyval_tl} {\l_@@_fontname_tl} + + \group_begin: + \fontfamily { \l_@@_trial_family_tl } \selectfont + \@@_fontface_gset_eq:NV \g_@@_trial_font \font@name + \fontspec_if_script:nF {math} + { + \bool_gset_false:N \l_@@_ot_math_bool + \bool_gset_false:N \l_@@_init_bool + } + \group_end: + + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_fontspec_select_font:} +% \begin{macrocode} +\cs_new:Nn \@@_fontspec_select_font: + { + \fp_gset:Nn \g_@@_size_tfsf_fp { (\f@size +\sf@size )/2 } + \fp_gset:Nn \g_@@_size_sfssf_fp { (\sf@size+\ssf@size)/2 } + + \tl_set:Nx \l_@@_font_keyval_tl + { +%<LU> Renderer = Basic, + BoldItalicFont = {}, ItalicFont = {}, + Script = Math, + SizeFeatures = + { + { + Size = \fp_use:N \g_@@_size_tfsf_fp - + } , + { + Size = \fp_use:N \g_@@_size_sfssf_fp - \fp_use:N \g_@@_size_tfsf_fp , + Font = \l_@@_script_font_tl , + \l_@@_script_features_tl + } , + { + Size = - \fp_use:N \g_@@_size_sfssf_fp , + Font = \l_@@_sscript_font_tl , + \l_@@_sscript_features_tl + } + } , +%<LU> FontAdjustment = { \g_@@_luatex_copy_fontdimens_tl }, + \l_@@_unknown_keys_clist } -%</XE> + + \fontspec_set_family:Nxn \l_@@_family_tl {\l_@@_font_keyval_tl} {\l_@@_fontname_tl} + + \int_gincr:N \g_@@_fonts_used_int + \group_begin: + \fontfamily { \l_@@_family_tl } \selectfont + \@@_fontface_gset_eq:cV {g_@@_mathfont_ \int_use:N \g_@@_fonts_used_int _font} \font@name + \tl_gset:Nx \g_@@_curr_font_cmd_tl { \exp_not:c {g_@@_mathfont_ \int_use:N \g_@@_fonts_used_int _font} } + \bool_if:NT \l_@@_init_bool + { + \@@_fontface_gset_eq:NV \l_@@_font \font@name + } + \fontspec_if_script:nF {math} + { + \bool_gset_false:N \l_@@_ot_math_bool + \bool_gset_false:N \l_@@_init_bool + } + \group_end: } % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_script_style_size:n} -% Determine script- and scriptscriptstyle sizes using luaotfload: -% \begin{macrocode} +% \begin{macrocode} +\tl_set:Nn \g_@@_main_font_cmd_tl { \l_@@_font } +\tl_set:Nn \g_@@_sqrt_font_cmd_tl { \l_@@_font } +\tl_set:Nn \g_@@_prime_font_cmd_tl { \l_@@_font } +% \end{macrocode} +% +% \begin{macro}{\g_@@_luatex_copy_fontdimens_tl} +% \begin{macrocode} %<*LU> -\cs_new:Nn \@@_script_style_size:n +\tl_const:Nn \g_@@_luatex_copy_fontdimens_tl { - \fp_eval:n {\directlua{tex.sprint(luaotfload.aux.get_math_dimension("l_@@_font","#1"))} * \f@size / 100 } + \@@_fontdimen_from_param:nn {10} {ScriptPercentScaleDown} + \@@_fontdimen_from_param:nn {11} {ScriptScriptPercentScaleDown} + \@@_fontdimen_from_param:nn {15} {AxisHeight} + \@@_fontdimen_from_param:nn {18} {SubscriptShiftDown} + \@@_fontdimen_from_param:nn {20} {SubscriptBaselineDropMin} + \@@_fontdimen_from_param:nn {21} {SuperscriptShiftUp} + \@@_fontdimen_from_param:nn {22} {SuperscriptShiftUpCramped} + \@@_fontdimen_from_param:nn {24} {SuperscriptBaselineDropMax} + \@@_fontdimen_from_param:nn {28} {UpperLimitGapMin} + \@@_fontdimen_from_param:nn {29} {UpperLimitBaselineRiseMin} + \@@_fontdimen_from_param:nn {30} {LowerLimitGapMin} + \@@_fontdimen_from_param:nn {31} {LowerLimitBaselineDropMin} + \@@_fontdimen_from_param:nn {32} {StackTopShiftUp} + \@@_fontdimen_from_param:nn {42} {FractionNumeratorShiftUp} + \@@_fontdimen_from_param:nn {43} {FractionNumeratorDisplayStyleShiftUp} + \@@_fontdimen_from_param:nn {44} {FractionDenominatorShiftDown} + \@@_fontdimen_from_param:nn {45} {FractionDenominatorDisplayStyleShiftDown} + \@@_fontdimen_from_param:nn {48} {FractionRuleThickness} } %</LU> -% \end{macrocode} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_setup_math_fam:} +% \begin{macrocode} +\cs_new:Nn \@@_setup_math_fam: + { + \cs_if_exist:cF { sym \l_@@_symfont_label_tl } + { + \DeclareSymbolFont{\l_@@_symfont_label_tl} + {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault} + } + \SetSymbolFont{\l_@@_symfont_label_tl}{\l_@@_mversion_tl} + {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault} +% \end{macrocode} +% Set the bold math version. +% \begin{macrocode} + \str_if_eq_x:nnT {\l_@@_mversion_tl} {normal} + { + \SetSymbolFont{\l_@@_symfont_label_tl}{bold} + {\encodingdefault}{\l_@@_family_tl}{\bfdefault}{\updefault} + } + } +% \end{macrocode} % \end{macro} % % \begin{macro}{\@@_setup_legacy_fam_two:} @@ -208,37 +294,37 @@ % \begin{macrocode} \cs_new:Nn \@@_setup_legacy_fam_two: { - \fontspec_set_family:Nxn \l_@@_family_tl + \fontspec_set_family:Nxn \l_@@_fam_two_tl { \l_@@_font_keyval_tl, Scale=1.00001, FontAdjustment = { - \@@_copy_fontparam:nnn { 8} {43} {FractionNumeratorDisplayStyleShiftUp}\relax - \@@_copy_fontparam:nnn { 9} {42} {FractionNumeratorShiftUp}\relax - \@@_copy_fontparam:nnn {10} {32} {StackTopShiftUp}\relax - \@@_copy_fontparam:nnn {11} {45} {FractionDenominatorDisplayStyleShiftDown}\relax - \@@_copy_fontparam:nnn {12} {44} {FractionDenominatorShiftDown}\relax - \@@_copy_fontparam:nnn {13} {21} {SuperscriptShiftUp}\relax - \@@_copy_fontparam:nnn {14} {21} {SuperscriptShiftUp}\relax - \@@_copy_fontparam:nnn {15} {22} {SuperscriptShiftUpCramped}\relax - \@@_copy_fontparam:nnn {16} {18} {SubscriptShiftDown}\relax - \@@_copy_fontparam:nnn {17} {18} {SubscriptShiftDownWithSuperscript}\relax - \@@_copy_fontparam:nnn {18} {24} {SuperscriptBaselineDropMax}\relax - \@@_copy_fontparam:nnn {19} {20} {SubscriptBaselineDropMin}\relax - \@@_zero_fontparam:n {20} % delim1 = FractionDelimiterDisplaySize - \@@_zero_fontparam:n {21} % delim2 = FractionDelimiterSize - \@@_copy_fontparam:nnn {22} {15} {AxisHeight}\relax + \@@_copy_fontdimen:nnN { 8} {43} \g_@@_main_font_cmd_tl + \@@_copy_fontdimen:nnN { 9} {42} \g_@@_main_font_cmd_tl + \@@_copy_fontdimen:nnN {10} {32} \g_@@_main_font_cmd_tl + \@@_copy_fontdimen:nnN {11} {45} \g_@@_main_font_cmd_tl + \@@_copy_fontdimen:nnN {12} {44} \g_@@_main_font_cmd_tl + \@@_copy_fontdimen:nnN {13} {21} \g_@@_main_font_cmd_tl + \@@_copy_fontdimen:nnN {14} {21} \g_@@_main_font_cmd_tl + \@@_copy_fontdimen:nnN {15} {22} \g_@@_main_font_cmd_tl + \@@_copy_fontdimen:nnN {16} {18} \g_@@_main_font_cmd_tl + \@@_copy_fontdimen:nnN {17} {18} \g_@@_main_font_cmd_tl + \@@_copy_fontdimen:nnN {18} {24} \g_@@_main_font_cmd_tl + \@@_copy_fontdimen:nnN {19} {20} \g_@@_main_font_cmd_tl + \@@_copy_fontdimen:nnN {22} {15} \g_@@_main_font_cmd_tl + \@@_zero_fontdimen:n {20} % delim1 = FractionDelimiterDisplaySize + \@@_zero_fontdimen:n {21} % delim2 = FractionDelimiterSize } } {\l_@@_fontname_tl} \SetSymbolFont{symbols}{\l_@@_mversion_tl} - {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault} + {\encodingdefault}{\l_@@_fam_two_tl}{\mddefault}{\updefault} \str_if_eq_x:nnT {\l_@@_mversion_tl} {normal} { \SetSymbolFont{symbols}{bold} - {\encodingdefault}{\l_@@_family_tl}{\bfdefault}{\updefault} + {\encodingdefault}{\l_@@_fam_two_tl}{\bfdefault}{\updefault} } } % \end{macrocode} @@ -249,70 +335,37 @@ % \begin{macrocode} \cs_new:Nn \@@_setup_legacy_fam_three: { - \fontspec_set_family:Nxn \l_@@_family_tl + \fontspec_set_family:Nxn \l_@@_fam_three_tl { \l_@@_font_keyval_tl, Scale=0.99999, FontAdjustment = { - \@@_copy_fontparam:nnn { 8} {48} {FractionRuleThickness}\relax - \@@_copy_fontparam:nnn { 9} {28} {UpperLimitGapMin}\relax - \@@_copy_fontparam:nnn {10} {30} {LowerLimitGapMin}\relax - \@@_copy_fontparam:nnn {11} {29} {UpperLimitBaselineRiseMin}\relax - \@@_copy_fontparam:nnn {12} {31} {LowerLimitBaselineDropMin}\relax - \@@_zero_fontparam:n {13} + \@@_copy_fontdimen:nnN { 8} {48} \g_@@_main_font_cmd_tl + \@@_copy_fontdimen:nnN { 9} {28} \g_@@_main_font_cmd_tl + \@@_copy_fontdimen:nnN {10} {30} \g_@@_main_font_cmd_tl + \@@_copy_fontdimen:nnN {11} {29} \g_@@_main_font_cmd_tl + \@@_copy_fontdimen:nnN {12} {31} \g_@@_main_font_cmd_tl + \@@_zero_fontdimen:n {13} } } {\l_@@_fontname_tl} \SetSymbolFont{largesymbols}{\l_@@_mversion_tl} - {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault} + {\encodingdefault}{\l_@@_fam_three_tl}{\mddefault}{\updefault} \str_if_eq_x:nnT {\l_@@_mversion_tl} {normal} { \SetSymbolFont{largesymbols}{bold} - {\encodingdefault}{\l_@@_family_tl}{\bfdefault}{\updefault} + {\encodingdefault}{\l_@@_fam_three_tl}{\bfdefault}{\updefault} } } % \end{macrocode} % \end{macro} % -% -% \begin{macro}{\@@_fontspec_select_font:} -% Select the font with \cs{fontspec} and define \cs{l_@@_font} from it. +% \begin{macro}{\@@_onceoff_setup:} % \begin{macrocode} -\cs_new:Nn \@@_fontspec_select_font: +\cs_new:Nn \@@_onceoff_setup: { - \tl_set:Nx \l_@@_font_keyval_tl { -%<LU> Renderer = Basic, - BoldItalicFont = {}, ItalicFont = {}, - Script = Math, - SizeFeatures = - { - { - Size = \tf@size- - } , - { - Size = \sf@size-\tf@size , - Font = \l_@@_script_font_tl , - \l_@@_script_features_tl - } , - { - Size = -\sf@size , - Font = \l_@@_sscript_font_tl , - \l_@@_sscript_features_tl - } - } , - \l_@@_unknown_keys_clist - } - - \fontspec_set_fontface:NNxn \l_@@_font \l_@@_family_tl - {\l_@@_font_keyval_tl} {\l_@@_fontname_tl} -% \end{macrocode} -% Check whether we're using a real maths font: -% \begin{macrocode} - \group_begin: - \fontfamily{\l_@@_family_tl}\selectfont - \fontspec_if_script:nF {math} {\bool_gset_false:N \l_@@_ot_math_bool} - \group_end: + \@@_set_delcode:nnn {operators} {`\.} {\c_zero} } % \end{macrocode} % \end{macro} @@ -334,7 +387,7 @@ % \begin{macrocode} \cs_set:Nn \@@_process_symbol_parse:nnn { - \@@_if_char_spec:nNNT {#1} {#2} {#3} + \@@_if_char_spec:nNT {#1} {#3} { \@@_process_symbol_noparse:nnn {#1} {#2} {#3} } @@ -344,28 +397,29 @@ % \end{macro} % % \begin{macro}{\@@_remap_symbols:} -% \begin{macro}{\@@_remap_symbol_noparse:nnn} -% \begin{macro}{\@@_remap_symbol_parse:nnn} % This function is used to define the mathcodes for those chars which should % be mapped to a different glyph than themselves. % \begin{macrocode} -\cs_new:Npn \@@_remap_symbols: +\cs_new:Nn \@@_remap_symbols: { - \@@_remap_symbol:nnn{`\-}{\mathbin}{"02212}% hyphen to minus - \@@_remap_symbol:nnn{`\*}{\mathbin}{"02217}% text asterisk to "centred asterisk" + \@@_remap_symbol:nnn {`\-} {\mathbin} {"2212} + \@@_remap_symbol:nnn {`\*} {\mathbin} {"02217}% text asterisk to "centred asterisk" \bool_if:NF \g_@@_literal_colon_bool { - \@@_remap_symbol:nnn{`\:}{\mathrel}{"02236}% colon to ratio (i.e., punct to rel) + \@@_remap_symbol:nnn {`\:} {\mathrel} {"02236}% colon to ratio (i.e., punct to rel) } } % \end{macrocode} % \end{macro} +% +% \begin{macro}{\@@_remap_symbol_noparse:nnn} +% \begin{macro}{\@@_remap_symbol_parse:nnn} % Where |\@@_remap_symbol:nnn| is defined to be one of these two, depending % on the range setup: % \begin{macrocode} \cs_new:Nn \@@_remap_symbol_parse:nnn { - \@@_if_char_spec:nNNT {#3} {\@nil} {#2} + \@@_if_char_spec:nNT {#3} {#2} { \@@_remap_symbol_noparse:nnn {#1} {#2} {#3} } } \cs_new:Nn \@@_remap_symbol_noparse:nnn @@ -383,16 +437,18 @@ % But they don't need to be able to be typeset directly. % % \begin{macro}{\@@_setup_mathactives:} +% TODO: if not an OpenType math font, we should ignore doing anything with primes. +% This needs a revamped `range` feature, I think. % \begin{macrocode} \cs_new:Npn \@@_setup_mathactives: { - \@@_make_mathactive:nNN {"2032} \@@_prime_single_mchar \mathord - \@@_make_mathactive:nNN {"2033} \@@_prime_double_mchar \mathord - \@@_make_mathactive:nNN {"2034} \@@_prime_triple_mchar \mathord - \@@_make_mathactive:nNN {"2057} \@@_prime_quad_mchar \mathord - \@@_make_mathactive:nNN {"2035} \@@_backprime_single_mchar \mathord - \@@_make_mathactive:nNN {"2036} \@@_backprime_double_mchar \mathord - \@@_make_mathactive:nNN {"2037} \@@_backprime_triple_mchar \mathord + \@@_make_mathactive:nNN {"2032} \@@_prime_single_mchar \mathord + \@@_make_mathactive:nNN {"2033} \@@_prime_double_mchar \mathord + \@@_make_mathactive:nNN {"2034} \@@_prime_triple_mchar \mathord + \@@_make_mathactive:nNN {"2057} \@@_prime_quad_mchar \mathord + \@@_make_mathactive:nNN {"2035} \@@_backprime_single_mchar \mathord + \@@_make_mathactive:nNN {"2036} \@@_backprime_double_mchar \mathord + \@@_make_mathactive:nNN {"2037} \@@_backprime_triple_mchar \mathord \@@_make_mathactive:nNN {`\'} \mathstraightquote \mathord \@@_make_mathactive:nNN {`\`} \mathbacktick \mathord } @@ -406,7 +462,7 @@ % \begin{macrocode} \cs_new:Nn \@@_make_mathactive_parse:nNN { - \@@_if_char_spec:nNNT {#1} #2 #3 + \@@_if_char_spec:nNT {#1} #3 { \@@_make_mathactive_noparse:nNN {#1} #2 #3 } } % \end{macrocode} @@ -420,6 +476,7 @@ % \end{macrocode} % \end{macro} % +% % \subsection{Delimiter codes} % % \begin{macro}{\@@_assign_delcode:nn} @@ -433,7 +490,7 @@ % \begin{macrocode} \cs_new:Nn \@@_assign_delcode_parse:nn { - \@@_if_char_spec:nNNT {#2} {\@nil} {\@nil} + \@@_if_char_spec:nNT {#2} \@nil { \@@_assign_delcode_noparse:nn {#1} {#2} } @@ -456,10 +513,6 @@ % \begin{macrocode} \cs_new:Npn \@@_setup_delcodes: { - % ensure \left. and \right. work: - \@@_set_delcode:nnn \l_@@_symfont_label_tl {`\.} {\c_zero} - % this is forcefully done to fix a bug -- indicates a larger problem! - \@@_assign_delcode:nn {`\/} {\g_@@_slash_delimiter_usv} \@@_assign_delcode:nn {"2044} {\g_@@_slash_delimiter_usv} % fracslash \@@_assign_delcode:nn {"2215} {\g_@@_slash_delimiter_usv} % divslash @@ -538,6 +591,93 @@ % \end{macrocode} % \end{macro} % +% \subsection{Fontdimens} +% +% \begin{macrocode} +%<*LU> +% \end{macrocode} +% +% \begin{macro}{\@@_mathparam_restore:} +% \begin{macrocode} +\cs_set:Nn \@@_mathparam_restore: + { + \check@mathfonts + \tl_use:N \g_@@_mathparam_store_tl + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_mathparam_store:} +% \begin{macrocode} +\cs_set:Nn \@@_mathparam_store: + { + \check@mathfonts + \tl_gset:Nx \g_@@_mathparam_store_tl + { + \@@_mathparam_store_aux:N \displaystyle + \@@_mathparam_store_aux:N \textstyle + \@@_mathparam_store_aux:N \scriptstyle + \@@_mathparam_store_aux:N \scriptscriptstyle + } + } +% \end{macrocode} +% +% \begin{macrocode} +\cs_set:Nn \@@_mathparam_store_aux:N + { + \Umathquad #1 = \the \Umathquad #1 + \Umathaxis #1 = \the \Umathaxis #1 + \Umathoperatorsize #1 = \the \Umathoperatorsize #1 + \Umathoverbarkern #1 = \the \Umathoverbarkern #1 + \Umathoverbarrule #1 = \the \Umathoverbarrule #1 + \Umathoverbarvgap #1 = \the \Umathoverbarvgap #1 + \Umathunderbarkern #1 = \the \Umathunderbarkern #1 + \Umathunderbarrule #1 = \the \Umathunderbarrule #1 + \Umathunderbarvgap #1 = \the \Umathunderbarvgap #1 + \Umathradicalkern #1 = \the \Umathradicalkern #1 + \Umathradicalrule #1 = \the \Umathradicalrule #1 + \Umathradicalvgap #1 = \the \Umathradicalvgap #1 + \Umathradicaldegreebefore #1 = \the \Umathradicaldegreebefore #1 + \Umathradicaldegreeafter #1 = \the \Umathradicaldegreeafter #1 + \Umathradicaldegreeraise #1 = \the \Umathradicaldegreeraise #1 + \Umathstackvgap #1 = \the \Umathstackvgap #1 + \Umathstacknumup #1 = \the \Umathstacknumup #1 + \Umathstackdenomdown #1 = \the \Umathstackdenomdown #1 + \Umathfractionrule #1 = \the \Umathfractionrule #1 + \Umathfractionnumvgap #1 = \the \Umathfractionnumvgap #1 + \Umathfractionnumup #1 = \the \Umathfractionnumup #1 + \Umathfractiondenomvgap #1 = \the \Umathfractiondenomvgap #1 + \Umathfractiondenomdown #1 = \the \Umathfractiondenomdown #1 + \Umathfractiondelsize #1 = \the \Umathfractiondelsize #1 + \Umathlimitabovevgap #1 = \the \Umathlimitabovevgap #1 + \Umathlimitabovebgap #1 = \the \Umathlimitabovebgap #1 + \Umathlimitabovekern #1 = \the \Umathlimitabovekern #1 + \Umathlimitbelowvgap #1 = \the \Umathlimitbelowvgap #1 + \Umathlimitbelowbgap #1 = \the \Umathlimitbelowbgap #1 + \Umathlimitbelowkern #1 = \the \Umathlimitbelowkern #1 + \Umathoverdelimitervgap #1 = \the \Umathoverdelimitervgap #1 + \Umathoverdelimiterbgap #1 = \the \Umathoverdelimiterbgap #1 + \Umathunderdelimitervgap #1 = \the \Umathunderdelimitervgap #1 + \Umathunderdelimiterbgap #1 = \the \Umathunderdelimiterbgap #1 + \Umathsubshiftdrop #1 = \the \Umathsubshiftdrop #1 + \Umathsubshiftdown #1 = \the \Umathsubshiftdown #1 + \Umathsupshiftdrop #1 = \the \Umathsupshiftdrop #1 + \Umathsupshiftup #1 = \the \Umathsupshiftup #1 + \Umathsubsupshiftdown #1 = \the \Umathsubsupshiftdown #1 + \Umathsubtopmax #1 = \the \Umathsubtopmax #1 + \Umathsupbottommin #1 = \the \Umathsupbottommin #1 + \Umathsupsubbottommax #1 = \the \Umathsupsubbottommax #1 + \Umathsubsupvgap #1 = \the \Umathsubsupvgap #1 + \Umathspaceafterscript #1 = \the \Umathspaceafterscript #1 + \Umathconnectoroverlapmin #1 = \the \Umathconnectoroverlapmin #1 + } +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%</LU> +% \end{macrocode} +% % \begin{macrocode} %</package> % \end{macrocode} @@ -553,7 +693,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-mathmap.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-mathmap.dtx index 2b843fb29a4..21e0266543d 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-code-mathmap.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-mathmap.dtx @@ -1,416 +1,235 @@ %%^^A%% um-code-mathmap.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Setup of symbol alphabets. -% \section{Mapping in maths alphabets} +% \section{Defining the math alphabets per style} % \label{sec:mathmap} % % \begin{macrocode} %<*package> % \end{macrocode} % -% Switching to a different style of alphabetic symbols was traditionally performed with -% commands like \cmd\mathbf, which literally changes fonts to access alternate symbols. -% This is not as simple with Unicode fonts. -% -% In traditional \TeX{} maths font setups, you simply switch between different `families' (\cmd\fam), which is analogous to changing from one font to another---a symbol such as `a' will be upright in one font, bold in another, and so on. -% In pkg{unicode-math}, a different mechanism is used to switch between styles. For every letter (start with ascii a-zA-Z and numbers to keep things simple for now), they are assigned a `mathcode' with \cmd\Umathcode\ that maps from input letter to output font glyph slot. This is done with the equivalent of -% \begin{Verbatim} -% \Umathcode`\a = 7 1 "1D44E\relax -% \Umathcode`\b = 7 1 "1D44F\relax -% \Umathcode`\c = 7 1 "1D450\relax -% ... -% \end{Verbatim} -% When switching from regular letters to, say, \cmd\mathrm, we now need to execute a new mapping: -% \begin{Verbatim} -% \Umathcode`\a = 7 1 `\a\relax -% \Umathcode`\b = 7 1 `\b\relax -% \Umathcode`\c = 7 1 `\c\relax -% ... -% \end{Verbatim} -% This is fairly straightforward to perform when we're defining our own commands such as \cmd\symbf\ and so on. However, this means that `classical' \TeX\ font setups will break, because with the original mapping still in place, the engine will be attempting to insert unicode maths glyphs from a standard font. -% -% \subsection{Hooks into \LaTeXe} -% -% To overcome this, we patch \cs{use@mathgroup}. -% (An alternative is to patch \cs{extract@alph@from@version}, which constructs the \cs{mathXYZ} commands, but this method fails if the command has been defined using \cs{DeclareSymbolFontAlphabet}.) -% As far as I can tell, this is only used inside of commands such as \cs{mathXYZ}, so this shouldn't have any major side-effects. -% -% \begin{macrocode} -\cs_set:Npn \use@mathgroup #1 #2 - { - \mode_if_math:T % <- not sure if this is really necessary since we've just checked for mmode and raised an error if not! - { - \math@bgroup - \cs_if_eq:cNF {M@\f@encoding} #1 {#1} - \@@_switchto_literal: - \mathgroup #2 \relax - \math@egroup - } - } -% \end{macrocode} -% -% In LaTeX maths, the command |\operator@font| is defined that switches to the |operator| mathgroup. The classic example is the |\sin| in |$\sin{x}$|; essentially we're using |\mathrm| to typeset the upright symbols, but the syntax is |{\operator@font sin}|. -% I thought that hooking into |\operator@font| would be hard because all other maths font selection in 2e uses |\mathrm{...}| style. -% Then reading source2e a little more I stumbled upon: -% \begin{macro}{\operator@font} -% \begin{macrocode} -\cs_set:Npn \operator@font - { - \@@_switchto_literal: - \@fontswitch {} { \g_@@_operator_mathfont_tl } - } +% \begin{macro}{\@@_setup_alphabets:} +% This function is called within \cs{setmathfont} to configure the +% mapping between characters inside math styles. Three modes: +% \begin{description} +% \item[IMPLICIT] No ranges specified, set up everything +% \item[EXPLICIT] Some ranges specified, set up what is requested only +% \item[INHERIT] Of the slots in the ranges specified, compare against +% slots in each styled alphabet and only set up those needed +% \end{description} +% The INHERIT mode saves less time than I was hoping for but is still beneficial +% in simple cases. +% \begin{macrocode} +\cs_new:Npn \@@_setup_alphabets: + { + + \bool_if:NTF \l_@@_init_bool + { + % IMPLICIT + \@@_log:n {setup-implicit} + \seq_gset_eq:NN \g_@@_mathalph_seq \g_@@_default_mathalph_seq + \bool_set_true:N \l_@@_implicit_alph_bool + \@@_maybe_init_alphabet:n {sf} + \@@_maybe_init_alphabet:n {bf} + \@@_maybe_init_alphabet:n {bfsf} + \cs_set_eq:NN \@@_set_mathalphabet_char:nnn \@@_mathmap_noparse:nnn + \cs_set_eq:NN \@@_map_char_single:nn \@@_map_char_noparse:nn + \@@_mathalph_map: + \seq_if_empty:NF \l_@@_missing_alph_seq { \@@_log:n { missing-alphabets } } + } + { + \seq_if_empty:NF \g_@@_mathalph_seq + { + % EXPLICIT + \@@_log:n {setup-explicit} + \bool_set_false:N \l_@@_implicit_alph_bool + \cs_set_eq:NN \@@_set_mathalphabet_char:nnn \@@_mathmap_noparse:nnn + \cs_set_eq:NN \@@_map_char_single:nn \@@_map_char_noparse:nn + \@@_mathalph_map: + \seq_if_empty:NF \l_@@_missing_alph_seq { \@@_log:n { missing-alphabets } } + } + + % INHERIT + \clist_if_empty:NF \l_@@_mathmap_charints_clist + { + \seq_gclear:N \g_@@_mathalph_seq + \seq_map_inline:Nn \g_@@_default_mathalph_seq + { + \tl_set:No \l_@@_style_tl { \use_i:nnn ##1 } + \clist_set:No \l_@@_alphabet_clist { \use_ii:nnn ##1 } + + \clist_map_inline:Nn \l_@@_alphabet_clist + { + \clist_map_inline:cn {g_@@_named_slots_ \l_@@_style_tl _ ####1 _clist} + { + \clist_map_inline:Nn \l_@@_mathmap_charints_clist + { + \@@_int_if_slot_in_range:nnT {################1} {########1} + { + \seq_gput_right:Nn \g_@@_mathalph_seq {##1} + \clist_map_break:n { \clist_map_break:n { \clist_map_break: } } + } + } + } + } + } + } + + \cs_set_eq:NN \@@_set_mathalphabet_char:nnn \@@_mathmap_parse:nnn + \cs_set_eq:NN \@@_map_char_single:nn \@@_map_char_parse:nn + \@@_mathalph_map: + } + } % \end{macrocode} % \end{macro} % -% -% \subsection{Setting styles} -% -% Algorithm for setting alphabet fonts. -% By default, when |range| is empty, we are in \emph{implicit} mode. -% If |range| contains the name of the math alphabet, we are in \emph{explicit} -% mode and do things slightly differently. -% -% Implicit mode: -% \begin{itemize} -% \item Try and set all of the alphabet shapes. -% \item Check for the first glyph of each alphabet to detect if the font supports each -% alphabet shape. -% \item For alphabets that do exist, overwrite whatever's already there. -% \item For alphabets that are not supported, \emph{do nothing}. -% (This includes leaving the old alphabet definition in place.) -% \end{itemize} -% -% Explicit mode: -% \begin{itemize} -% \item Only set the alphabets specified. -% \item Check for the first glyph of the alphabet to detect if the font contains -% the alphabet shape in the Unicode math plane. -% \item For Unicode math alphabets, overwrite whatever's already there. -% \item Otherwise, use the \ascii\ glyph slots instead. -% \end{itemize} -% -% -% -% \subsection{Defining the math style macros} -% -% We call the different shapes that a math alphabet can be a `math style'. -% Note that different alphabets can exist within the same math style. E.g., -% we call `bold' the math style |bf| and within it there are upper and lower -% case Greek and Roman alphabets and Arabic numerals. -% -% \begin{macro}{\@@_prepare_mathstyle:n} -% \darg{math style name (e.g., \texttt{it} or \texttt{bb})} -% 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_@@_mathstyle_tl} is for other applications to query the -% current math style. -% \begin{macrocode} -\cs_new:Nn \@@_prepare_mathstyle:n - { - \seq_put_right:Nn \g_@@_mathstyles_seq {#1} - \@@_init_alphabet:n {#1} - \cs_set:cpn {_@@_sym_#1_aux:n} - { \use:c {@@_switchto_#1:} \math@egroup } - \cs_set_protected:cpx {sym#1} - { - \exp_not:n - { - \math@bgroup - \mode_if_math:F - { - \egroup\expandafter - \non@alpherr\expandafter{\csname sym#1\endcsname\space} - } - \tl_set:Nn \l_@@_mathstyle_tl {#1} - } - \exp_not:c {_@@_sym_#1_aux:n} - } - } +% \begin{macro}{\@@_mathalph_map:} +% \begin{macrocode} +\cs_set:Nn \@@_mathalph_map: + { + \seq_map_inline:Nn \g_@@_mathalph_seq + { + \tl_set:No \l_@@_style_tl { \use_i:nnn ##1 } + \clist_set:No \l_@@_alphabet_clist { \use_ii:nnn ##1 } + \tl_set:No \l_@@_remap_style_tl { \use_iii:nnn ##1 } + + % If no set of alphabets is defined: + \clist_if_empty:NT \l_@@_alphabet_clist + { + \cs_set_eq:NN \@@_maybe_init_alphabet:n \@@_init_alphabet:n + \prop_get:cnN { g_@@_named_range_ \l_@@_style_tl _prop } + { default-alpha } \l_@@_alphabet_clist + } + + \@@_check_math_alphabet: + \@@_setup_math_alphabet: + } + } % \end{macrocode} % \end{macro} % -% -% \begin{macro}{\@@_init_alphabet:n} -% \darg{math alphabet name (e.g., \texttt{it} or \texttt{bb})} -% This macro initialises the macros used to set up a math alphabet. -% First used when the math alphabet macro is first defined, but then used -% later when redefining a particular maths alphabet. +% \begin{macro}{\@@_check_math_alphabet:} +% First check that at least one of the alphabets for the font shape is defined +% (this process is fast) \dots % \begin{macrocode} -\cs_set:Nn \@@_init_alphabet:n - { - \@@_log:nx {alph-initialise} {#1} - \cs_set_eq:cN {@@_switchto_#1:} \prg_do_nothing: - } +\cs_new:Nn \@@_check_math_alphabet: + { + \clist_map_inline:Nn \l_@@_alphabet_clist + { + \tl_set:Nn \l_@@_alphabet_tl {##1} + \@@_if_alphabet_exists:nnTF \l_@@_style_tl \l_@@_alphabet_tl + { + \str_if_eq_x:nnTF {\l_@@_alphabet_tl} {misc} + { + \@@_maybe_init_alphabet:n \l_@@_style_tl + \clist_map_break: + } + { + \@@_glyph_if_exist:NnT \g_@@_curr_font_cmd_tl + { \@@_to_usv:nn {\l_@@_style_tl} {\l_@@_alphabet_tl} } + { + \@@_maybe_init_alphabet:n \l_@@_style_tl + \clist_map_break: + } + } + } + { + \msg_warning:nnx {unicode-math} {no-alphabet} + { \l_@@_style_tl / \l_@@_alphabet_tl } + } + } + } % \end{macrocode} % \end{macro} % -% \subsection{Definition of alphabets and styles} -% -% First of all, we break up unicode into `named ranges', such as |up|, |bb|, |sfup|, and so on, which refer to specific blocks of unicode that contain various symbols (usually alphabetical symbols). -% +% \begin{macro}{\@@_setup_math_alphabet:} +% \dots and then loop through them defining the individual ranges: +% (currently this process is slow) % \begin{macrocode} -\cs_new:Nn \@@_new_named_range:n - { - \prop_new:c {g_@@_named_range_#1_prop} - } -\clist_set:Nn \g_@@_named_ranges_clist - { - up, it, tt, bfup, bfit, bb , bbit, scr, bfscr, cal, bfcal, - frak, bffrak, sfup, sfit, bfsfup, bfsfit, bfsf - } -\clist_map_inline:Nn \g_@@_named_ranges_clist - { \@@_new_named_range:n {#1} } +\cs_new:Nn \@@_setup_math_alphabet: + { + \clist_map_inline:Nn \l_@@_alphabet_clist + { + \tl_set:Nx \l_@@_alphabet_tl { \tl_trim_spaces:n {##1} } + +%<debug>\typeout{_setup_math_alphabet:~\l_@@_style_tl/\l_@@_alphabet_tl} + + \@@_if_alphabet_exists:nnT {\l_@@_style_tl} {\l_@@_alphabet_tl} + { + \exp_args:No \tl_if_eq:nnTF \l_@@_alphabet_tl {misc} + { + \@@_log:nx {setup-alph} {sym \l_@@_style_tl~(\l_@@_alphabet_tl)} + \@@_alphabet_config:nnn {\l_@@_style_tl} {\l_@@_alphabet_tl} {\l_@@_remap_style_tl} + } + { + \@@_glyph_if_exist:NnTF \g_@@_curr_font_cmd_tl { \@@_to_usv:nn {\l_@@_remap_style_tl} {\l_@@_alphabet_tl} } + { + \@@_log:nx {setup-alph} {sym \l_@@_style_tl~(\l_@@_alphabet_tl)} + \@@_alphabet_config:nnn {\l_@@_style_tl} {\l_@@_alphabet_tl} {\l_@@_remap_style_tl} + } + { + \bool_if:NTF \l_@@_implicit_alph_bool + { + \seq_put_right:Nx \l_@@_missing_alph_seq + { + \@backslashchar sym \l_@@_style_tl \space + (\tl_use:c{c_@@_math_alphabet_name_ \l_@@_alphabet_tl _tl}) + } + } + { + \@@_alphabet_config:nnn {\l_@@_style_tl} {\l_@@_alphabet_tl} {up} + } + } + } + } + } + } % \end{macrocode} -% +% \end{macro} % % Each alphabet style needs to be configured. % This happens in Section~\ref{sec:setupalphabets}. % \begin{macrocode} \cs_new:Nn \@@_new_alphabet_config:nnn - { - \prop_if_exist:cF {g_@@_named_range_#1_prop} - { \@@_warning:nnn {no-named-range} {#1} {#2} } - - \prop_gput:cnn {g_@@_named_range_#1_prop} { alpha_tl } - { - \prop_item:cn {g_@@_named_range_#1_prop} { alpha_tl } - {#2} - } - % Q: do I need to bother removing duplicates? - - \cs_new:cn { @@_config_#1_#2:n } {#3} - } -% \end{macrocode} -% \begin{macrocode} -\cs_new:Nn \@@_alphabet_config:nnn - { - \use:c {@@_config_#1_#2:n} {#3} - } -% \end{macrocode} -% \begin{macrocode} -\prg_new_conditional:Nnn \@@_if_alphabet_exists:nn {T,TF} - { - \cs_if_exist:cTF {@@_config_#1_#2:n} - \prg_return_true: \prg_return_false: - } -% \end{macrocode} -% -% The linking between named ranges and symbol style commands happens here. -% It's currently not using all of the machinery we're in the process of setting up above. -% Baby steps. -% \begin{macrocode} -\cs_new:Nn \@@_default_mathalph:nnn - { - \seq_put_right:Nx \g_@@_named_ranges_seq { \tl_to_str:n {#1} } - \seq_put_right:Nn \g_@@_default_mathalph_seq {{#1}{#2}{#3}} - \prop_gput:cnn { g_@@_named_range_#1_prop } { default-alpha } {#2} - } -\@@_default_mathalph:nnn {up } {latin,Latin,greek,Greek,num,misc} {up } -\@@_default_mathalph:nnn {it } {latin,Latin,greek,Greek,misc} {it } -\@@_default_mathalph:nnn {bb } {latin,Latin,num,misc} {bb } -\@@_default_mathalph:nnn {bbit } {misc} {bbit } -\@@_default_mathalph:nnn {scr } {latin,Latin} {scr } -\@@_default_mathalph:nnn {cal } {Latin} {scr } -\@@_default_mathalph:nnn {bfcal } {Latin} {bfscr } -\@@_default_mathalph:nnn {frak } {latin,Latin} {frak } -\@@_default_mathalph:nnn {tt } {latin,Latin,num} {tt } -\@@_default_mathalph:nnn {sfup } {latin,Latin,num} {sfup } -\@@_default_mathalph:nnn {sfit } {latin,Latin} {sfit } -\@@_default_mathalph:nnn {bfup } {latin,Latin,greek,Greek,num,misc} {bfup } -\@@_default_mathalph:nnn {bfit } {latin,Latin,greek,Greek,misc} {bfit } -\@@_default_mathalph:nnn {bfscr } {latin,Latin} {bfscr } -\@@_default_mathalph:nnn {bffrak} {latin,Latin} {bffrak} -\@@_default_mathalph:nnn {bfsfup} {latin,Latin,greek,Greek,num,misc} {bfsfup} -\@@_default_mathalph:nnn {bfsfit} {latin,Latin,greek,Greek,misc} {bfsfit} -% \end{macrocode} -% -% \subsubsection{Define symbol style commands} -% Finally, all of the `symbol styles' commands are set up, which are the commands to access each of the named alphabet styles. There is not a one-to-one mapping between symbol style commands and named style ranges! -% \begin{macrocode} -\clist_map_inline:nn - { - up, it, bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf, - tt, bb, bbit, scr, bfscr, cal, bfcal, frak, bffrak, - normal, literal, sf, bf, - } - { \@@_prepare_mathstyle:n {#1} } -% \end{macrocode} -% -% -% \subsubsection{New names for legacy textmath alphabet selection} -% In case a package option overwrites, say, \cs{mathbf} with \cs{symbf}. -% \begin{macrocode} -\clist_map_inline:nn - { rm, it, bf, sf, tt } - { \cs_set_eq:cc { mathtext #1 } { math #1 } } -% \end{macrocode} -% Perhaps these should actually be defined using a hypothetical unicode-math interface to creating new such styles. To come. -% -% -% \subsubsection{Replacing legacy pure-maths alphabets} -% The following are alphabets which do not have a math/text ambiguity. -% \begin{macrocode} -\clist_map_inline:nn - { - normal, bb , bbit, scr, bfscr, cal, bfcal, frak, bffrak, tt, - bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf - } - { - \cs_set:cpx { math #1 } { \exp_not:c { sym #1 } } - } -% \end{macrocode} -% -% -% \subsubsection{New commands for ambiguous alphabets} -% \begin{macrocode} -\AtBeginDocument{ -\clist_map_inline:nn - { rm, it, bf, sf, tt } - { - \cs_set_protected:cpx { math #1 } - { - \exp_not:n { \bool_if:NTF } \exp_not:c { g_@@_ math #1 _text_bool} - { \exp_not:c { mathtext #1 } } - { \exp_not:c { sym #1 } } - } - }} -% \end{macrocode} -% -% \paragraph{Alias \cs{mathrm} as legacy name for \cs{mathup}} -% \begin{macrocode} -\cs_set_protected:Npn \mathup { \mathrm } -\cs_set_protected:Npn \symrm { \symup } -% \end{macrocode} -% -% -% -% -% \subsection{Defining the math alphabets per style} -% -% \begin{macro}{\@@_setup_alphabets:} -% This function is called within \cs{setmathfont} to configure the -% mapping between characters inside math styles. -% \begin{macrocode} -\cs_new:Npn \@@_setup_alphabets: - { -% \end{macrocode} -% If |range=| has been used to configure styles, those choices will be in -% |\l_@@_mathalph_seq|. If not, set up the styles implicitly: -% \begin{macrocode} - \seq_if_empty:NTF \l_@@_mathalph_seq - { - \@@_log:n {setup-implicit} - \seq_set_eq:NN \l_@@_mathalph_seq \g_@@_default_mathalph_seq - \bool_set_true:N \l_@@_implicit_alph_bool - \@@_maybe_init_alphabet:n {sf} - \@@_maybe_init_alphabet:n {bf} - \@@_maybe_init_alphabet:n {bfsf} - } -% \end{macrocode} -% If |range=| has been used then we're in explicit mode: -% \begin{macrocode} - { - \@@_log:n {setup-explicit} - \bool_set_false:N \l_@@_implicit_alph_bool - \cs_set_eq:NN \@@_set_mathalphabet_char:nnn \@@_mathmap_noparse:nnn - \cs_set_eq:NN \@@_map_char_single:nn \@@_map_char_noparse:nn - } + { + \prop_if_exist:cF {g_@@_named_range_#1_prop} + { \@@_warning:nnn {no-named-range} {#1} {#2} } - % Now perform the mapping: - \seq_map_inline:Nn \l_@@_mathalph_seq - { - \tl_set:No \l_@@_style_tl { \use_i:nnn ##1 } - \clist_set:No \l_@@_alphabet_clist { \use_ii:nnn ##1 } - \tl_set:No \l_@@_remap_style_tl { \use_iii:nnn ##1 } - % If no set of alphabets is defined: - \clist_if_empty:NT \l_@@_alphabet_clist - { - \cs_set_eq:NN \@@_maybe_init_alphabet:n \@@_init_alphabet:n - \prop_get:cnN { g_@@_named_range_ \l_@@_style_tl _prop } - { default-alpha } \l_@@_alphabet_clist - } + \prop_gput:cnn {g_@@_named_range_#1_prop} { alpha_tl } + { + \prop_item:cn {g_@@_named_range_#1_prop} { alpha_tl } {#2} + } + % Q: do I need to bother removing duplicates? - \@@_setup_math_alphabet: - } - \seq_if_empty:NF \l_@@_missing_alph_seq { \@@_log:n { missing-alphabets } } - } % \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@@_setup_math_alphabet:} +% Create list of all chars defined in this named range: % \begin{macrocode} -\cs_new:Nn \@@_setup_math_alphabet: - { + \cs_new:cn { @@_config_#1_#2:n } + { + \clist_gclear_new:c {g_@@_named_slots_#1_#2_clist} + \tl_set:Nn \l_@@_curr_named_slot { g_@@_named_slots_#1_#2_clist } + #3 + \clist_gremove_duplicates:c {g_@@_named_slots_#1_#2_clist} + } + + } % \end{macrocode} -% First check that at least one of the alphabets for the font shape is defined -% (this process is fast) \dots % \begin{macrocode} - \clist_map_inline:Nn \l_@@_alphabet_clist - { - \tl_set:Nn \l_@@_alphabet_tl {##1} - \@@_if_alphabet_exists:nnTF \l_@@_style_tl \l_@@_alphabet_tl - { - \str_if_eq_x:nnTF {\l_@@_alphabet_tl} {misc} - { - \@@_maybe_init_alphabet:n \l_@@_style_tl - \clist_map_break: - } - { - \@@_glyph_if_exist:NnT \l_@@_font { \@@_to_usv:nn {\l_@@_style_tl} {\l_@@_alphabet_tl} } - { - \@@_maybe_init_alphabet:n \l_@@_style_tl - \clist_map_break: - } - } - } - { \msg_warning:nnx {unicode-math} {no-alphabet} { \l_@@_style_tl / \l_@@_alphabet_tl } } - } +\cs_new:Nn \@@_alphabet_config:nnn + { + \use:c {@@_config_#1_#2:n} {#3} + } % \end{macrocode} -% \dots and then loop through them defining the individual ranges: -% (currently this process is slow) % \begin{macrocode} -%<debug> \csname TIC\endcsname - \clist_map_inline:Nn \l_@@_alphabet_clist - { - \tl_set:Nx \l_@@_alphabet_tl { \tl_trim_spaces:n {##1} } - \cs_if_exist:cT {@@_config_ \l_@@_style_tl _ \l_@@_alphabet_tl :n} - { - \exp_args:No \tl_if_eq:nnTF \l_@@_alphabet_tl {misc} - { - \@@_log:nx {setup-alph} {sym \l_@@_style_tl~(\l_@@_alphabet_tl)} - \@@_alphabet_config:nnn {\l_@@_style_tl} {\l_@@_alphabet_tl} {\l_@@_remap_style_tl} - } - { - \@@_glyph_if_exist:NnTF \l_@@_font { \@@_to_usv:nn {\l_@@_remap_style_tl} {\l_@@_alphabet_tl} } - { - \@@_log:nx {setup-alph} {sym \l_@@_style_tl~(\l_@@_alphabet_tl)} - \@@_alphabet_config:nnn {\l_@@_style_tl} {\l_@@_alphabet_tl} {\l_@@_remap_style_tl} - } - { - \bool_if:NTF \l_@@_implicit_alph_bool - { - \seq_put_right:Nx \l_@@_missing_alph_seq - { - \@backslashchar sym \l_@@_style_tl \space - (\tl_use:c{c_@@_math_alphabet_name_ \l_@@_alphabet_tl _tl}) - } - } - { - \@@_alphabet_config:nnn {\l_@@_style_tl} {\l_@@_alphabet_tl} {up} - } - } - } - } - } -%<debug> \csname TOC\endcsname - } +\prg_new_conditional:Nnn \@@_if_alphabet_exists:nn {T,TF} + { + \cs_if_exist:cTF {@@_config_#1_#2:n} + \prg_return_true: \prg_return_false: + } % \end{macrocode} -% \end{macro} -% % -% \subsection{Mapping `naked' math characters} +% \subsection{Mapping `naked’ math characters} % % Before we show the definitions of the alphabet mappings using the functions % |\@@_alphabet_config:nnn \l_@@_style_tl {##1} {...}|, we first want to define some functions @@ -426,31 +245,33 @@ % \begin{macro}{\@@_map_char_parse:nn} % \begin{macrocode} \cs_new:Nn \@@_map_char_noparse:nn - { \@@_set_mathcode:nnnn {#1}{\mathalpha}{\l_@@_symfont_label_tl}{#2} } + { + \@@_set_mathcode:nnnn {#1} {\mathalpha} {\l_@@_symfont_label_tl} {#2} + } % \end{macrocode} % % \begin{macrocode} \cs_new:Nn \@@_map_char_parse:nn - { - \@@_if_char_spec:nNNT {#1} {\@nil} {\mathalpha} - { \@@_map_char_noparse:nn {#1}{#2} } - } + { + \@@_if_char_spec:nNT {#1} {\mathalpha} + { \@@_map_char_noparse:nn {#1}{#2} } + } % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\@@_map_char_single:nnn} -% \darg{char name (`dotlessi')} +% \darg{char name (`dotlessi’)} % \darg{from alphabet(s)} % \darg{to alphabet} % Logical interface to \cs{@@_map_char_single:nn}. % \begin{macrocode} \cs_new:Nn \@@_map_char_single:nnn - { - \@@_map_char_single:nn { \@@_to_usv:nn {#1}{#3} } - { \@@_to_usv:nn {#2}{#3} } - } + { + \@@_map_char_single:nn { \@@_to_usv:nn {#1} {#3} } + { \@@_to_usv:nn {#2} {#3} } + } % \end{macrocode} % \end{macro} % @@ -463,103 +284,109 @@ % First the function with numbers: % \begin{macrocode} \cs_set:Nn \@@_map_chars_range:nnn - { - \int_step_inline:nnnn {0}{1}{#1-1} - { \@@_map_char_single:nn {#2+##1}{#3+##1} } - } + { + \int_step_inline:nnnn {0} {1} {#1-1} + { \@@_map_char_single:nn {#2+##1} {#3+##1} } + + \clist_gput_right:cx { \l_@@_curr_named_slot } + { \int_eval:n { #3 } - \int_eval:n { #3 + #1-1 } } + } % \end{macrocode} % And the wrapper with names: % \begin{macrocode} \cs_new:Nn \@@_map_chars_range:nnnn - { - \@@_map_chars_range:nnn {#1} { \@@_to_usv:nn {#2}{#4} } - { \@@_to_usv:nn {#3}{#4} } - } + { + \@@_map_chars_range:nnn {#1} { \@@_to_usv:nn {#2} {#4} } + { \@@_to_usv:nn {#3} {#4} } + } % \end{macrocode} % \end{macro} % -% \subsubsection{Functions for `normal' alphabet symbols} +% \subsubsection{Functions for `normal’ alphabet symbols} % % \begin{macro}{\@@_set_normal_char:nnn} % \begin{macrocode} \cs_set:Nn \@@_set_normal_char:nnn - { - \@@_usv_if_exist:nnT {#3} {#1} { - \clist_map_inline:nn {#2} - { - \@@_set_mathalphabet_pos:nnnn {normal} {#1} {##1} {#3} - \@@_map_char_single:nnn {##1} {#3} {#1} - } + \@@_usv_if_exist:nnT {#3} {#1} + { + \clist_map_inline:nn {#2} + { + \@@_set_mathalphabet_pos:nnnn {normal} {#1} {##1} {#3} + \@@_map_char_single:nnn {##1} {#3} {#1} + + \clist_gput_right:cx {\l_@@_curr_named_slot} + { \int_eval:n { \@@_to_usv:nn {#3} {#1} } } + } + } } - } % \end{macrocode} % \end{macro} % % \begin{macrocode} \cs_new:Nn \@@_set_normal_Latin:nn - { - \clist_map_inline:nn {#1} - { - \@@_set_mathalphabet_Latin:nnn {normal} {##1} {#2} - \@@_map_chars_range:nnnn {26} {##1} {#2} {Latin} - } - } + { + \clist_map_inline:nn {#1} + { + \@@_set_mathalphabet_Latin:nnn {normal} {##1} {#2} + \@@_map_chars_range:nnnn {26} {##1} {#2} {Latin} + } + } % \end{macrocode} % % \begin{macrocode} \cs_new:Nn \@@_set_normal_latin:nn - { - \clist_map_inline:nn {#1} - { - \@@_set_mathalphabet_latin:nnn {normal} {##1} {#2} - \@@_map_chars_range:nnnn {26} {##1} {#2} {latin} - } - } + { + \clist_map_inline:nn {#1} + { + \@@_set_mathalphabet_latin:nnn {normal} {##1} {#2} + \@@_map_chars_range:nnnn {26} {##1} {#2} {latin} + } + } % \end{macrocode} % % \begin{macrocode} \cs_new:Nn \@@_set_normal_greek:nn - { - \clist_map_inline:nn {#1} - { - \@@_set_mathalphabet_greek:nnn {normal} {##1} {#2} - \@@_map_chars_range:nnnn {25} {##1} {#2} {greek} - \@@_map_char_single:nnn {##1} {#2} {epsilon} - \@@_map_char_single:nnn {##1} {#2} {vartheta} - \@@_map_char_single:nnn {##1} {#2} {varkappa} - \@@_map_char_single:nnn {##1} {#2} {phi} - \@@_map_char_single:nnn {##1} {#2} {varrho} - \@@_map_char_single:nnn {##1} {#2} {varpi} - \@@_set_mathalphabet_pos:nnnn {normal} {epsilon} {##1} {#2} - \@@_set_mathalphabet_pos:nnnn {normal} {vartheta} {##1} {#2} - \@@_set_mathalphabet_pos:nnnn {normal} {varkappa} {##1} {#2} - \@@_set_mathalphabet_pos:nnnn {normal} {phi} {##1} {#2} - \@@_set_mathalphabet_pos:nnnn {normal} {varrho} {##1} {#2} - \@@_set_mathalphabet_pos:nnnn {normal} {varpi} {##1} {#2} - } - } + { + \clist_map_inline:nn {#1} + { + \@@_set_mathalphabet_greek:nnn {normal} {##1} {#2} + \@@_map_chars_range:nnnn {25} {##1} {#2} {greek} + \@@_map_char_single:nnn {##1} {#2} {epsilon} + \@@_map_char_single:nnn {##1} {#2} {vartheta} + \@@_map_char_single:nnn {##1} {#2} {varkappa} + \@@_map_char_single:nnn {##1} {#2} {phi} + \@@_map_char_single:nnn {##1} {#2} {varrho} + \@@_map_char_single:nnn {##1} {#2} {varpi} + \@@_set_mathalphabet_pos:nnnn {normal} {epsilon} {##1} {#2} + \@@_set_mathalphabet_pos:nnnn {normal} {vartheta} {##1} {#2} + \@@_set_mathalphabet_pos:nnnn {normal} {varkappa} {##1} {#2} + \@@_set_mathalphabet_pos:nnnn {normal} {phi} {##1} {#2} + \@@_set_mathalphabet_pos:nnnn {normal} {varrho} {##1} {#2} + \@@_set_mathalphabet_pos:nnnn {normal} {varpi} {##1} {#2} + } + } % \end{macrocode} % % \begin{macrocode} \cs_new:Nn \@@_set_normal_Greek:nn - { - \clist_map_inline:nn {#1} - { - \@@_set_mathalphabet_Greek:nnn {normal} {##1} {#2} - \@@_map_chars_range:nnnn {25} {##1} {#2} {Greek} - \@@_map_char_single:nnn {##1} {#2} {varTheta} - \@@_set_mathalphabet_pos:nnnn {normal} {varTheta} {##1} {#2} - } - } + { + \clist_map_inline:nn {#1} + { + \@@_set_mathalphabet_Greek:nnn {normal} {##1} {#2} + \@@_map_chars_range:nnnn {25} {##1} {#2} {Greek} + \@@_map_char_single:nnn {##1} {#2} {varTheta} + \@@_set_mathalphabet_pos:nnnn {normal} {varTheta} {##1} {#2} + } + } % \end{macrocode} % % \begin{macrocode} \cs_new:Nn \@@_set_normal_numbers:nn - { - \@@_set_mathalphabet_numbers:nnn {normal} {#1} {#2} - \@@_map_chars_range:nnnn {10} {#1} {#2} {num} - } + { + \@@_set_mathalphabet_numbers:nnn {normal} {#1} {#2} + \@@_map_chars_range:nnnn {10} {#1} {#2} {num} + } % \end{macrocode} % % @@ -567,45 +394,45 @@ % % \subsubsection{Functions for setting up the maths alphabets} % -% \begin{macro}{\@@_set_mathalphabet_char:Nnn} +% \begin{macro}{\@@_set_mathalphabet_char:nnn} +% \darg{Maths alphabet, \eg, `bb’} +% \darg{Input slot, \eg, the slot for `A’ (comma separated)} +% \darg{Output slot, \eg, the slot for `$\mathbb{A}$’} % This is a wrapper for either |\@@_mathmap_noparse:nnn| or -% |\@@_mathmap_parse:Nnn|, depending on the context. +% |\@@_mathmap_parse:nnn|, depending on the context. % \end{macro} % % \begin{macro}{\@@_mathmap_noparse:nnn} -% \darg{Maths alphabet, \eg, `bb'} -% \darg{Input slot(s), \eg, the slot for `A' (comma separated)} -% \darg{Output slot, \eg, the slot for `$\mathbb{A}$'} -% Adds \cs{@@_set_mathcode:nnnn} declarations to the specified maths alphabet's definition. +% \darg{Maths alphabet, \eg, `bb’} +% \darg{Input slot, \eg, the slot for `A’ (comma separated)} +% \darg{Output slot, \eg, the slot for `$\mathbb{A}$’} +% Adds \cs{@@_set_mathcode:nnnn} declarations to the specified maths alphabet’s definition. % \begin{macrocode} \cs_new:Nn \@@_mathmap_noparse:nnn - { - \clist_map_inline:nn {#2} - { - \tl_put_right:cx {@@_switchto_#1:} - { - \@@_set_mathcode:nnnn {##1} {\mathalpha} {\l_@@_symfont_label_tl} {#3} - } - } - } + { + \tl_put_right:cx { @@_switchto_#1: } + { + \@@_set_mathcode:nnnn {#2} {\mathalpha} {\l_@@_symfont_label_tl} {#3} + } + } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_mathmap_parse:nnn} -% \darg{Maths alphabet, \eg, `bb'} -% \darg{Input slot(s), \eg, the slot for `A' (comma separated)} -% \darg{Output slot, \eg, the slot for `$\mathbb{A}$'} -% When \cmd\@@_if_char_spec:nNNT\ is executed, it populates the \cmd\l_@@_char_nrange_clist\ +% \darg{Maths alphabet, \eg, `bb’} +% \darg{Input slot, \eg, the slot for `A’ (comma separated)} +% \darg{Output slot, \eg, the slot for `$\mathbb{A}$’} +% When \cmd\@@_if_char_spec:nNT\ is executed, it populates the \cmd\l_@@_mathmap_charints_clist\ % macro with slot numbers corresponding to the specified range. This range is used to % conditionally add \cs{@@_set_mathcode:nnnn} declaractions to the maths alphabet definition. % \begin{macrocode} \cs_new:Nn \@@_mathmap_parse:nnn - { - \clist_if_in:NnT \l_@@_char_nrange_clist {#3} - { - \@@_mathmap_noparse:nnn {#1}{#2}{#3} - } - } + { + \exp_args:NNx \clist_if_in:NnT \l_@@_mathmap_charints_clist { \int_eval:n {#3} } + { + \@@_mathmap_noparse:nnn {#1} {#2} {#3} + } + } % \end{macrocode} % \end{macro} % @@ -616,34 +443,45 @@ % \darg{char name to map} % \begin{macrocode} \cs_new:Nn \@@_set_mathalphabet_char:nnnn - { - \@@_set_mathalphabet_char:nnn {#1} { \@@_to_usv:nn {#2} {#4} } - { \@@_to_usv:nn {#3} {#4} } - } + { + \@@_set_mathalphabet_char:nnn {#1} { \@@_to_usv:nn {#2} {#4} } + { \@@_to_usv:nn {#3} {#4} } + } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_set_mathalph_range:nnnn} % \darg{Number of iterations} -% \darg{Maths alphabet} -% \darg{Starting input char (single)} +% \darg{Sym command suffix} +% \darg{Starting input char} % \darg{Starting output char} % Loops through character ranges setting \cmd\mathcode. % First the version that uses numbers: % \begin{macrocode} \cs_new:Nn \@@_set_mathalph_range:nnnn - { - \int_step_inline:nnnn {0} {1} {#1-1} - { \@@_set_mathalphabet_char:nnn {#2} { ##1 + #3 } { ##1 + #4 } } - } + { + \int_step_inline:nnnn {0} {1} {#1-1} + { \@@_set_mathalphabet_char:nnn {#2} { ##1 + #3 } { ##1 + #4 } } + } % \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_set_mathalph_range:nnnn} +% \darg{Number of iterations} +% \darg{Sym command suffix} +% \darg{input style} +% \darg{output style} +% \darg{alphabet} % Then the wrapper version that uses names: % \begin{macrocode} \cs_new:Nn \@@_set_mathalph_range:nnnnn - { - \@@_set_mathalph_range:nnnn {#1} {#2} { \@@_to_usv:nn {#3} {#5} } - { \@@_to_usv:nn {#4} {#5} } - } + { + \clist_gput_right:cx { \l_@@_curr_named_slot } + { \int_eval:n { \@@_to_usv:nn {#4} {#5} } - \int_eval:n { (#1-1)+\@@_to_usv:nn {#4} {#5} } } + + \@@_set_mathalph_range:nnnn {#1} {#2} { \@@_to_usv:nn {#3} {#5} } + { \@@_to_usv:nn {#4} {#5} } + } % \end{macrocode} % \end{macro} % @@ -651,67 +489,70 @@ % % \begin{macrocode} \cs_new:Nn \@@_set_mathalphabet_pos:nnnn - { - \@@_usv_if_exist:nnT {#4} {#2} - { - \clist_map_inline:nn {#3} - { \@@_set_mathalphabet_char:nnnn {#1} {##1} {#4} {#2} } - } - } + { + \@@_usv_if_exist:nnT {#4} {#2} + { + \clist_map_inline:nn {#3} + { \@@_set_mathalphabet_char:nnnn {#1} {##1} {#4} {#2} } + + \clist_gput_right:cx {\l_@@_curr_named_slot} + { \int_eval:n { \@@_to_usv:nn {#4} {#2} } } + } + } % \end{macrocode} % % \begin{macrocode} \cs_new:Nn \@@_set_mathalphabet_numbers:nnn - { - \clist_map_inline:nn {#2} - { \@@_set_mathalph_range:nnnnn {10} {#1} {##1} {#3} {num} } - } + { + \clist_map_inline:nn {#2} + { \@@_set_mathalph_range:nnnnn {10} {#1} {##1} {#3} {num} } + } % \end{macrocode} % % \begin{macrocode} \cs_new:Nn \@@_set_mathalphabet_Latin:nnn - { - \clist_map_inline:nn {#2} - { \@@_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {Latin} } - } + { + \clist_map_inline:nn {#2} + { \@@_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {Latin} } + } % \end{macrocode} % % \begin{macrocode} \cs_new:Nn \@@_set_mathalphabet_latin:nnn - { - \clist_map_inline:nn {#2} - { - \@@_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {latin} - \@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {h} - } - } + { + \clist_map_inline:nn {#2} + { + \@@_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {latin} + \@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {h} + } + } % \end{macrocode} % % \begin{macrocode} \cs_new:Nn \@@_set_mathalphabet_Greek:nnn - { - \clist_map_inline:nn {#2} - { - \@@_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {Greek} - \@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varTheta} - } - } + { + \clist_map_inline:nn {#2} + { + \@@_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {Greek} + \@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varTheta} + } + } % \end{macrocode} % % \begin{macrocode} \cs_new:Nn \@@_set_mathalphabet_greek:nnn - { - \clist_map_inline:nn {#2} - { - \@@_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {greek} - \@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {epsilon} - \@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {vartheta} - \@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varkappa} - \@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {phi} - \@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varrho} - \@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varpi} - } - } + { + \clist_map_inline:nn {#2} + { + \@@_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {greek} + \@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {epsilon} + \@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {vartheta} + \@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varkappa} + \@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {phi} + \@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varrho} + \@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varpi} + } + } % \end{macrocode} % % \begin{macrocode} @@ -729,7 +570,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-mathtext.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-mathtext.dtx index 9cdbb3b6add..c576d63770b 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-code-mathtext.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-mathtext.dtx @@ -1,4 +1,5 @@ %%^^A%% um-code-mathtext.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% The "math text" commands such as `\mathbf` and co. % \section{Maths text commands} % @@ -11,38 +12,37 @@ % \begin{macro}{\@@_setmathfontface:Nnn} % \begin{macrocode} \keys_define:nn {@@_mathface} - { - version .code:n = - { \tl_set:Nn \l_@@_mversion_tl {#1} } - } + { + version .tl_set:N = \l_@@_mversion_tl + } % \end{macrocode} % % \begin{macrocode} \cs_set:Nn \@@_setmathfontface:Nnn - { - \tl_clear:N \l_@@_mversion_tl + { + \tl_clear:N \l_@@_mversion_tl - \keys_set_known:nnN {@@_mathface} {#2} \l_@@_keyval_clist + \keys_set_known:nnN {@@_mathface} {#2} \l_@@_keyval_clist - \exp_args:Nnx \fontspec_set_family:Nxn \l_@@_tmpa_tl - { ItalicFont={}, BoldFont={}, \exp_not:V \l_@@_keyval_clist } {#3} + \exp_args:Nnx \fontspec_set_family:Nxn \l_@@_tmpa_tl + { ItalicFont={}, BoldFont={}, \exp_not:V \l_@@_keyval_clist } {#3} - \tl_if_empty:NT \l_@@_mversion_tl - { - \tl_set:Nn \l_@@_mversion_tl {normal} - \DeclareMathAlphabet #1 {\g_fontspec_encoding_tl} {\l_@@_tmpa_tl} {\mddefault} {\updefault} - } + \tl_if_empty:NT \l_@@_mversion_tl + { + \tl_set:Nn \l_@@_mversion_tl {normal} + \DeclareMathAlphabet #1 {\g_fontspec_encoding_tl} {\l_@@_tmpa_tl} {\mddefault} {\updefault} + } - \SetMathAlphabet #1 {\l_@@_mversion_tl} {\g_fontspec_encoding_tl} {\l_@@_tmpa_tl} {\mddefault} {\updefault} + \SetMathAlphabet #1 {\l_@@_mversion_tl} {\g_fontspec_encoding_tl} {\l_@@_tmpa_tl} {\mddefault} {\updefault} - % integrate with fontspec's \setmathrm etc: - \tl_case:Nn #1 - { - \mathrm { \cs_set_eq:NN \g__fontspec_mathrm_tl \l_@@_tmpa_tl } - \mathsf { \cs_set_eq:NN \g__fontspec_mathsf_tl \l_@@_tmpa_tl } - \mathtt { \cs_set_eq:NN \g__fontspec_mathtt_tl \l_@@_tmpa_tl } - } - } + % integrate with fontspec's \setmathrm etc: + \tl_case:Nn #1 + { + \mathrm { \cs_set_eq:NN \g__fontspec_mathrm_tl \l_@@_tmpa_tl } + \mathsf { \cs_set_eq:NN \g__fontspec_mathsf_tl \l_@@_tmpa_tl } + \mathtt { \cs_set_eq:NN \g__fontspec_mathtt_tl \l_@@_tmpa_tl } + } + } % \end{macrocode} % \end{macro} % @@ -54,6 +54,7 @@ % While we could now re-activate the way that \pkg{fontspec} does the following, because we can now change maths fonts whenever it's better to define new commands in \pkg{unicode-math} to define the \cs{mathXYZ} fonts. % % \subsubsection{Text font} +% % \begin{macrocode} \cs_generate_variant:Nn \tl_if_eq:nnT {o} \cs_set:Nn \__fontspec_setmainfont_hook:nn @@ -62,31 +63,29 @@ { %<XE> \fontspec_set_family:Nnn \g__fontspec_mathrm_tl {#1} {#2} %<LU> \fontspec_set_family:Nnn \g__fontspec_mathrm_tl {Renderer=Basic,#1} {#2} - \SetMathAlphabet\mathrm{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\updefault - \SetMathAlphabet\mathit{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\itdefault - \SetMathAlphabet\mathbf{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\bfdefault\updefault + \__fontspec_setmathrm_hook:nn {#1} {#2} } } - +% \end{macrocode} +% \begin{macrocode} \cs_set:Nn \__fontspec_setsansfont_hook:nn { \tl_if_eq:onT {\g__fontspec_mathsf_tl} {\sfdefault} { %<XE> \fontspec_set_family:Nnn \g__fontspec_mathsf_tl {#1} {#2} %<LU> \fontspec_set_family:Nnn \g__fontspec_mathsf_tl {Renderer=Basic,#1} {#2} - \SetMathAlphabet\mathsf{normal}\g_fontspec_encoding_tl\g__fontspec_mathsf_tl\mddefault\updefault - \SetMathAlphabet\mathsf{bold} \g_fontspec_encoding_tl\g__fontspec_mathsf_tl\bfdefault\updefault + \__fontspec_setmathsf_hook:nn {#1} {#2} } } - +% \end{macrocode} +% \begin{macrocode} \cs_set:Nn \__fontspec_setmonofont_hook:nn { \tl_if_eq:onT {\g__fontspec_mathtt_tl} {\ttdefault} { %<XE> \fontspec_set_family:Nnn \g__fontspec_mathtt_tl {#1} {#2} %<LU> \fontspec_set_family:Nnn \g__fontspec_mathtt_tl {Renderer=Basic,#1} {#2} - \SetMathAlphabet\mathtt{normal}\g_fontspec_encoding_tl\g__fontspec_mathtt_tl\mddefault\updefault - \SetMathAlphabet\mathtt{bold} \g_fontspec_encoding_tl\g__fontspec_mathtt_tl\bfdefault\updefault + \__fontspec_setmathtt_hook:nn {#1} {#2} } } % \end{macrocode} @@ -100,17 +99,23 @@ \SetMathAlphabet\mathit{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\itdefault \SetMathAlphabet\mathbf{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\bfdefault\updefault } +% \end{macrocode} +% \begin{macrocode} \cs_set:Nn \__fontspec_setboldmathrm_hook:nn { \SetMathAlphabet\mathrm{bold}\g_fontspec_encoding_tl\g__fontspec_bfmathrm_tl\mddefault\updefault \SetMathAlphabet\mathbf{bold}\g_fontspec_encoding_tl\g__fontspec_bfmathrm_tl\bfdefault\updefault \SetMathAlphabet\mathit{bold}\g_fontspec_encoding_tl\g__fontspec_bfmathrm_tl\mddefault\itdefault } +% \end{macrocode} +% \begin{macrocode} \cs_set:Nn \__fontspec_setmathsf_hook:nn { \SetMathAlphabet\mathsf{normal}\g_fontspec_encoding_tl\g__fontspec_mathsf_tl\mddefault\updefault \SetMathAlphabet\mathsf{bold} \g_fontspec_encoding_tl\g__fontspec_mathsf_tl\bfdefault\updefault } +% \end{macrocode} +% \begin{macrocode} \cs_set:Nn \__fontspec_setmathtt_hook:nn { \SetMathAlphabet\mathtt{normal}\g_fontspec_encoding_tl\g__fontspec_mathtt_tl\mddefault\updefault @@ -118,6 +123,27 @@ } % \end{macrocode} % +% I can't quite remember the logic behind the following two. +% +% If \pkg{fontspec} has been loaded and \verb|\setmathsf| (etc) run, this +% syncs things up: +% \begin{macrocode} +\tl_if_eq:onF {\g__fontspec_mathrm_tl} {\rmdefault} { \__fontspec_setmathrm_hook:nn {} {} } +\tl_if_eq:onF {\g__fontspec_mathsf_tl} {\sfdefault} { \__fontspec_setmathsf_hook:nn {} {} } +\tl_if_eq:onF {\g__fontspec_mathtt_tl} {\ttdefault} { \__fontspec_setmathtt_hook:nn {} {} } +% \end{macrocode} +% +% I suppose this is to make things work if neither fontspec or unicode-math +% load any fonts: (I should check that) +% \begin{macrocode} +\AtBeginDocument + { + \tl_if_eq:onT {\g__fontspec_mathrm_tl} {\rmdefault} { \__fontspec_setmathrm_hook:nn {} {} } + \tl_if_eq:onT {\g__fontspec_mathsf_tl} {\sfdefault} { \__fontspec_setmathsf_hook:nn {} {} } + \tl_if_eq:onT {\g__fontspec_mathtt_tl} {\ttdefault} { \__fontspec_setmathtt_hook:nn {} {} } + } +% \end{macrocode} +% % \begin{macrocode} %</package> % \end{macrocode} @@ -133,7 +159,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-msg.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-msg.dtx index d797e09b57d..db561dcebb3 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-code-msg.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-msg.dtx @@ -1,4 +1,5 @@ %%^^A%% um-code-msg.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Definitions of error, warning, and log messages. % \section{Error messages} % \seclabel{codemsg} @@ -7,102 +8,116 @@ %<*package> % \end{macrocode} % -% Wrapper functions: % \begin{macrocode} -\cs_new:Npn \@@_error:n { \msg_error:nn {unicode-math} } -\cs_new:Npn \@@_warning:n { \msg_warning:nn {unicode-math} } -\cs_new:Npn \@@_warning:nnn { \msg_warning:nnxx {unicode-math} } -\cs_new:Npn \@@_log:n { \msg_log:nn {unicode-math} } -\cs_new:Npn \@@_log:nx { \msg_log:nnx {unicode-math} } +\char_set_catcode_space:n {32} % \end{macrocode} % % \begin{macrocode} -\msg_new:nnn {unicode-math} {no-tfrac} +\@@_msg_new:nn {no-tfrac} { - Small~ fraction~ command~ \protect\tfrac\ not~ defined.\\ - Load~ amsmath~ or~ define~ it~ manually~ before~ loading~ unicode-math. + 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} +\@@_msg_new:nn {default-math-font} { - Defining~ the~ default~ maths~ font~ as~ '\l_@@_fontname_tl'. + Defining the default maths font as '\l_@@_fontname_tl'. } -\msg_new:nnn {unicode-math} {setup-implicit} +\@@_msg_new:nn {setup-implicit} { - Setup~ alphabets:~ implicit~ mode. + Setup alphabets: implicit mode. } -\msg_new:nnn {unicode-math} {setup-explicit} +\@@_msg_new:nn {setup-explicit} { - Setup~ alphabets:~ explicit~ mode. + Setup alphabets: explicit mode. } -\msg_new:nnn {unicode-math} {alph-initialise} +\@@_msg_new:nn {alph-initialise} { - Initialising~ \@backslashchar math#1. + Initialising \@backslashchar math#1. } -\msg_new:nnn {unicode-math} {setup-alph} +\@@_msg_new:nn {setup-alph} { - Setup~ alphabet:~ #1. + Setup alphabet: #1. } -\msg_new:nnn {unicode-math} {no-alphabet} +\@@_msg_new:nn {no-alphabet} { - I~ am~ trying~ to~ set~ up~ alphabet~"#1"~ but~ there~ are~ no~ configuration~ settings~ for~ it.~ - (See~ source~ file~ "unicode-math-alphabets.dtx"~ to~ debug.) + I am trying to set up alphabet"#1" but there are no configuration settings for it. + (See source file "unicode-math-alphabets.dtx" to debug.) } -\msg_new:nnn { unicode-math } { no-named-range } +\@@_msg_new:nn {no-named-range} { - I~ am~ trying~ to~ define~ new~ alphabet~ "#2"~ in~ range~ "#1",~ but~ range~ "#1"~ hasn't~ been~ defined~ yet. + I am trying to define new alphabet "#2" in range "#1", but range "#1" hasn't been defined yet. } -\msg_new:nnn { unicode-math } { missing-alphabets } +\@@_msg_new:nn {missing-alphabets} { - Missing~math~alphabets~in~font~ "\fontname\l_@@_font" \\ \\ + Missingmathalphabetsinfont "\fontname\g_@@_curr_font_cmd_tl" \\ \\ \seq_map_function:NN \l_@@_missing_alph_seq \@@_print_indent:n } \cs_new:Nn \@@_print_indent:n { \space\space\space\space #1 \\ } -\msg_new:nnn {unicode-math} {macro-expected} +\@@_msg_new:nn {macro-expected} { - I've~ expected~ that~ #1~ is~ a~ macro,~ but~ it~ isn't. + I've expected that #1 is a macro, but it isn't. } -\msg_new:nnn {unicode-math} {wrong-meaning} +\@@_msg_new:nn {wrong-meaning} { - I've~ expected~ #1~ to~ have~ the~ meaning~ #3,~ but~ it~ has~ the~ meaning~ #2. + I've expected #1 to have the meaning #3, but it has the meaning #2. } -\msg_new:nnn {unicode-math} {patch-macro} +\@@_msg_new:nn {patch-macro} { - I'm~ going~ to~ patch~ macro~ #1. + I'm going to patch macro #1. } -\msg_new:nnn { unicode-math } { mathtools-overbracket } { - Using~ \token_to_str:N \overbracket\ and~ - \token_to_str:N \underbracket\ from~ - `mathtools'~ package.\\ +\@@_msg_new:nn {mathtools-overbracket} { + Using \token_to_str:N \overbracket\ and + \token_to_str:N \underbracket\ from + `mathtools' package.\\ \\ - Use~ \token_to_str:N \Uoverbracket\ and~ - \token_to_str:N \Uunderbracket\ for~ - original~ `unicode-math'~ definition. + Use \token_to_str:N \Uoverbracket\ and + \token_to_str:N \Uunderbracket\ for + original `unicode-math' definition. } -\msg_new:nnn { unicode-math } { mathtools-colon } { - 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,~ +\@@_msg_new:nn {mathtools-colon} { + 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. + 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,~ +\@@_msg_new:nn {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 \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. + 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. } +\@@_msg_new:nn {bad-cs-in-range} + { + Command `#1` in math range is not recognised as a maths symbol. + Check file "unicode-math-table.tex" for allowable commands. + } +\@@_msg_new:nn {legacy-char-not-supported} + { + Command `#1` is a legacy maths symbol that is not supported by unicode-math. + } +\@@_msg_new:nn {range-not-bf-sf} + { + Range alphabets cannot include alphabets referring to `bf`, `sf`, or `bfsf` + since they relate to input commands not output glyphs. + Use `bfit` or `bfup` (etc.) to specify which. + } +% \end{macrocode} +% +% \begin{macrocode} +\char_set_catcode_ignore:n {32} % \end{macrocode} % % \begin{macrocode} @@ -120,7 +135,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-opening.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-opening.dtx index 0f681f52dee..95ef8dd2450 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-code-opening.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-opening.dtx @@ -1,4 +1,5 @@ %%^^A%% um-code-opening.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Assorted initialisation tasks, including some low-level function definitions. % \section{Start of the package code} % @@ -31,7 +32,18 @@ % For \pkg{fontspec}: % \begin{macrocode} \cs_generate_variant:Nn \fontspec_set_family:Nnn {Nx} -\cs_generate_variant:Nn \fontspec_set_fontface:NNnn {NNx} +\cs_generate_variant:Nn \prop_get:NnNTF {cx} +\cs_generate_variant:Nn \tl_if_eq:nnF {o} +% \end{macrocode} +% +% +% \subsection{Low level commands} +% +% \begin{macrocode} +\cs_set_eq:NN \@@_group_begin: \group_begin: +\cs_set_eq:NN \@@_group_end: \group_end: +\cs_set_eq:NN \@@_group_begin_frozen: \@@_group_begin: +\cs_set_eq:NN \@@_group_end_frozen: \@@_group_end: % \end{macrocode} % % @@ -52,6 +64,16 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\@@_fontface_gset_eq:NN} +% \begin{macrocode} +\cs_set_protected:Nn \@@_fontface_gset_eq:NN + { + \tex_global:D \tex_let:D #1 #2 + } +\cs_generate_variant:Nn \@@_fontface_gset_eq:NN {NV,cV} +% \end{macrocode} +% \end{macro} +% % \subsubsection{Mathcode and friends} % % \begin{macro}{\@@_set_mathcode:nnnn} @@ -133,43 +155,64 @@ % \begin{macrocode} \cs_new:Nn \@@_char_gmake_mathactive:N { - \global\mathcode `#1 = "8000 \scan_stop: + \tex_global:D \tex_mathcode:D `#1 = "8000 \scan_stop: } +% \end{macrocode} +% \begin{macrocode} \cs_new:Nn \@@_char_gmake_mathactive:n { - \global\mathcode #1 = "8000 \scan_stop: + \tex_global:D \tex_mathcode:D \int_eval:n {#1} = "8000 \scan_stop: } % \end{macrocode} % \end{macro} % \end{macro} % +% \begin{macro}{\@@_mathactive_remap:nn} +% Makes |#1| math-active and defines its meaning to be |#2|. +% This is a global operation. +% \begin{macrocode} +\cs_new:Nn \@@_mathactive_remap:nn + { + \group_begin: + \cs_set_protected:Npn \@@_tmp: {#2} + \@@_char_gmake_mathactive:n {#1} + \char_gset_active_eq:nN {#1} \@@_tmp: + \group_end: + } +% \end{macrocode} +% % \subsubsection{Font parameters} % -% \begin{macro}{\@@_copy_fontparam:nnn} +% \begin{macro}{\@@_copy_fontdimen:nnN} % \begin{macrocode} -\cs_new:Nn \@@_copy_fontparam:nnn +\cs_new:Nn \@@_copy_fontdimen:nnN { - \fontdimen #1 \font = \@@_get_fontparam:nn {#2} {#3} + \fontdimen #1 \font = \the \fontdimen #2 #3 \relax } % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_zero_fontparam:n} +% \begin{macro}{\@@_zero_fontdimen:n} % \begin{macrocode} -\cs_new:Nn \@@_zero_fontparam:n +\cs_new:Nn \@@_zero_fontdimen:n { \fontdimen #1 \font = 0pt\relax } % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_get_fontparam:nn} +% \begin{macro}{\@@_fontdimen_from_param:Nnn} +% This function extracts the math font dimen \verb|#3| from the font \verb|#1| +% and sets fontdimen \verb|#2| of the same font to that value. +% +% Use \XeTeX's fontdimen approach because it's tidy. We don't need bells and whistles here. % \begin{macrocode} -\cs_new:Nn \@@_get_fontparam:nn +%<*LU> +\cs_new_protected:Nn \@@_fontdimen_from_param:nn { -%<XE> \the\fontdimen#1\l_@@_font\relax -%<LU> \directlua{fontspec.mathfontdimen("l_@@_font","#2")} + \fontdimen #1 \font = \directlua{fontspec.mathfontdimen(font.current(),"#2")}\relax } +%</LU> % \end{macrocode} % \end{macro} % @@ -188,7 +231,7 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[TF]{\@@_usv_if_exist:nn} +% \begin{macro}{\@@_usv_if_exist:nnTF} % \begin{macrocode} \prg_new_conditional:Nnn \@@_usv_if_exist:nn {T,F,TF} { @@ -225,12 +268,103 @@ } % \end{macrocode} % +% +% \subsection{Wrappers for message functions} +% +% Messages themselves are defined in \secref{codemsg}. +% +% \begin{macrocode} +\cs_new:Npn \@@_error:n { \msg_error:nn {unicode-math} } +\cs_new:Npn \@@_error:nx { \msg_error:nnx {unicode-math} } +\cs_new:Npn \@@_warning:n { \msg_warning:nn {unicode-math} } +\cs_new:Npn \@@_warning:nnn { \msg_warning:nnxx {unicode-math} } +\cs_new:Npn \@@_log:n { \msg_log:nn {unicode-math} } +\cs_new:Npn \@@_log:nx { \msg_log:nnx {unicode-math} } +% \end{macrocode} +% +% \begin{macrocode} +\cs_generate_variant:Nn \msg_new:nnn {nnx} +\cs_generate_variant:Nn \msg_new:nnnn {nnxx} +\cs_new:Nn \@@_msg_new:nn { \msg_new:nnx {unicode-math} {#1} { \tl_trim_spaces:n {#2} } } +% \end{macrocode} +% +% % \begin{macrocode} %</package> % \end{macrocode} \endinput + +% \subsection{Sow/reap} +% +% This might make it into the kernel; not sure. +% Not actually used yet in the package! +% +% \begin{macro}{\__@@_sow_item:Nn} +% Helper variables for constructing \verb|c|-type arguments. +% \begin{macrocode} +\cs_new:Nn \__@@_sow_item:Nn { l___sow___ \token_to_str:N #1 ___ #2 ___tl } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\__@@_sow_int:N} +% Helper variables for constructing \verb|c|-type arguments. +% \begin{macrocode} +\cs_new:Nn \__@@_sow_int:N { l___sow___ \token_to_str:N #1 ___int } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_sow_prepare:N} +% \begin{macrocode} +\cs_new:Nn \@@_sow_prepare:N + { + \tl_clear:N #1 + \int_zero_new:c { \__@@_sow_int:N #1 } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_sow:Nn} +% \begin{macrocode} +\cs_new:Nn \@@_sow:Nn + { + \int_incr:c { \__@@_sow_int:N #1 } + \tl_clear_new:c + { + \__@@_sow_item:Nn #1 + { \int_use:c { \__@@_sow_int:N #1 } } + } + \tl_set:cn + { + \__@@_sow_item:Nn #1 + { \int_use:c { \__@@_sow_int:N #1 } } + } + { #2 } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_sow_reap:N} +% \begin{macrocode} +\cs_new:Nn \@@_sow_reap:N + { + \cs_set:Npn \__@@_sow_tmp:n ##1 + { + \exp_not:v { \__@@_sow_item:Nn #1 {##1} } + } + \tl_set:Nx #1 + { + \int_step_function:nnnN {1} {1} + { \int_use:c { \__@@_sow_int:N #1 } } + \__@@_sow_tmp:n + } + + } +% \end{macrocode} +% \end{macro} + + % /© % % ------------------------------------------------ @@ -240,7 +374,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-pkgopt.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-pkgopt.dtx index 625770edbdc..15b9373ce32 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-code-pkgopt.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-pkgopt.dtx @@ -1,4 +1,5 @@ %%^^A%% um-code-pkgopt.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Package options. % \section{setup and package options} % @@ -10,17 +11,19 @@ % To simplify the creation of option keys, let's iterate in pairs rather than worry about equals signs and commas. % \begin{macrocode} \cs_new:Nn \@@_keys_choices:nn - { - \cs_set:Npn \@@_keys_choices_fn:nn { \@@_keys_choices_aux:nnn {#1} } - \use:x - { - \exp_not:N \keys_define:nn {unicode-math} - { - #1 .choice: , - \@@_tl_map_dbl:nN {#2} \@@_keys_choices_fn:nn - } - } - } + { + \cs_set:Npn \@@_keys_choices_fn:nn { \@@_keys_choices_aux:nnn {#1} } + \use:x + { + \exp_not:N \keys_define:nn {unicode-math} + { + #1 .choice: , + \@@_tl_map_dbl:nN {#2} \@@_keys_choices_fn:nn + } + } + } +% \end{macrocode} +% \begin{macrocode} \cs_new:Nn \@@_keys_choices_aux:nnn { #1 / #2 .code:n = { \exp_not:n {#3} } , } % \end{macrocode} % @@ -45,41 +48,51 @@ % \paragraph{Compatibility} % \begin{macrocode} \@@_keys_choices:nn {mathup} - { - {sym} { \bool_set_false:N \g_@@_mathrm_text_bool } - {text} { \bool_set_true:N \g_@@_mathrm_text_bool } - } + { + {sym} { \bool_set_false:N \g_@@_mathrm_text_bool } + {text} { \bool_set_true:N \g_@@_mathrm_text_bool } + } +% \end{macrocode} +% \begin{macrocode} \@@_keys_choices:nn {mathrm} - { - {sym} { \bool_set_false:N \g_@@_mathrm_text_bool } - {text} { \bool_set_true:N \g_@@_mathrm_text_bool } - } + { + {sym} { \bool_set_false:N \g_@@_mathrm_text_bool } + {text} { \bool_set_true:N \g_@@_mathrm_text_bool } + } +% \end{macrocode} +% \begin{macrocode} \@@_keys_choices:nn {mathit} - { - {sym} { \bool_set_false:N \g_@@_mathit_text_bool } - {text} { \bool_set_true:N \g_@@_mathit_text_bool } - } + { + {sym} { \bool_set_false:N \g_@@_mathit_text_bool } + {text} { \bool_set_true:N \g_@@_mathit_text_bool } + } +% \end{macrocode} +% \begin{macrocode} \@@_keys_choices:nn {mathbf} - { - {sym} { \bool_set_false:N \g_@@_mathbf_text_bool } - {text} { \bool_set_true:N \g_@@_mathbf_text_bool } - } + { + {sym} { \bool_set_false:N \g_@@_mathbf_text_bool } + {text} { \bool_set_true:N \g_@@_mathbf_text_bool } + } +% \end{macrocode} +% \begin{macrocode} \@@_keys_choices:nn {mathsf} - { - {sym} { \bool_set_false:N \g_@@_mathsf_text_bool } - {text} { \bool_set_true:N \g_@@_mathsf_text_bool } - } + { + {sym} { \bool_set_false:N \g_@@_mathsf_text_bool } + {text} { \bool_set_true:N \g_@@_mathsf_text_bool } + } +% \end{macrocode} +% \begin{macrocode} \@@_keys_choices:nn {mathtt} - { - {sym} { \bool_set_false:N \g_@@_mathtt_text_bool } - {text} { \bool_set_true:N \g_@@_mathtt_text_bool } - } + { + {sym} { \bool_set_false:N \g_@@_mathtt_text_bool } + {text} { \bool_set_true:N \g_@@_mathtt_text_bool } + } % \end{macrocode} % % \paragraph{math-style} % \begin{macrocode} \@@_keys_choices:nn {normal-style} - { + { {ISO} { \bool_set_false:N \g_@@_literal_bool \bool_set_false:N \g_@@_upGreek_bool @@ -111,12 +124,12 @@ {literal} { \bool_set_true:N \g_@@_literal_bool } - } + } % \end{macrocode} % % \begin{macrocode} \@@_keys_choices:nn {math-style} - { + { {ISO} { \unimathsetup { nabla=upright, partial=italic, normal-style=ISO, bold-style=ISO, sans-style=italic } @@ -137,13 +150,13 @@ \unimathsetup { colon=literal, nabla=literal, partial=literal, normal-style=literal, bold-style=literal, sans-style=literal } } - } + } % \end{macrocode} % % \paragraph{bold-style} % \begin{macrocode} \@@_keys_choices:nn {bold-style} - { + { {ISO} { \bool_set_false:N \g_@@_bfliteral_bool \bool_set_false:N \g_@@_bfupGreek_bool @@ -168,92 +181,96 @@ {literal} { \bool_set_true:N \g_@@_bfliteral_bool } - } + } % \end{macrocode} % % \paragraph{sans-style} % \begin{macrocode} \@@_keys_choices:nn {sans-style} - { - {italic} { \bool_set_false:N \g_@@_upsans_bool } - {upright} { \bool_set_true:N \g_@@_upsans_bool } - {literal} { \bool_set_true:N \g_@@_sfliteral_bool } - } + { + {italic} { \bool_set_false:N \g_@@_upsans_bool } + {upright} { \bool_set_true:N \g_@@_upsans_bool } + {literal} { \bool_set_true:N \g_@@_sfliteral_bool } + } % \end{macrocode} % % % \paragraph{Nabla and partial} % \begin{macrocode} \@@_keys_choices:nn {nabla} - { - {upright} { - \bool_set_false:N \g_@@_literal_Nabla_bool - \bool_set_true:N \g_@@_upNabla_bool - } - {italic} { - \bool_set_false:N \g_@@_literal_Nabla_bool - \bool_set_false:N \g_@@_upNabla_bool - } - {literal} { \bool_set_true:N \g_@@_literal_Nabla_bool } - } + { + {upright} { + \bool_set_false:N \g_@@_literal_Nabla_bool + \bool_set_true:N \g_@@_upNabla_bool + } + {italic} { + \bool_set_false:N \g_@@_literal_Nabla_bool + \bool_set_false:N \g_@@_upNabla_bool + } + {literal} { + \bool_set_true:N \g_@@_literal_Nabla_bool + } + } % \end{macrocode} % % \begin{macrocode} \@@_keys_choices:nn {partial} - { - {upright} { - \bool_set_false:N \g_@@_literal_partial_bool - \bool_set_true:N \g_@@_uppartial_bool - } - {italic} { - \bool_set_false:N \g_@@_literal_partial_bool - \bool_set_false:N \g_@@_uppartial_bool - } - {literal} { \bool_set_true:N \g_@@_literal_partial_bool } - } + { + {upright} { + \bool_set_false:N \g_@@_literal_partial_bool + \bool_set_true:N \g_@@_uppartial_bool + } + {italic} { + \bool_set_false:N \g_@@_literal_partial_bool + \bool_set_false:N \g_@@_uppartial_bool + } + {literal} { + \bool_set_true:N \g_@@_literal_partial_bool + } + } % \end{macrocode} % % \paragraph{Colon style} % \begin{macrocode} \@@_keys_choices:nn {colon} - { - {literal} { \bool_set_true:N \g_@@_literal_colon_bool } - {TeX} { \bool_set_false:N \g_@@_literal_colon_bool } - } + { + {literal} { \bool_set_true:N \g_@@_literal_colon_bool } + {TeX} { \bool_set_false:N \g_@@_literal_colon_bool } + } % \end{macrocode} % % \paragraph{Slash delimiter style} % \begin{macrocode} \@@_keys_choices:nn {slash-delimiter} - { - {ascii} { \tl_set:Nn \g_@@_slash_delimiter_usv {"002F} } - {frac} { \tl_set:Nn \g_@@_slash_delimiter_usv {"2044} } - {div} { \tl_set:Nn \g_@@_slash_delimiter_usv {"2215} } - } + { + {ascii} { \tl_set:Nn \g_@@_slash_delimiter_usv {"002F} } + {frac} { \tl_set:Nn \g_@@_slash_delimiter_usv {"2044} } + {div} { \tl_set:Nn \g_@@_slash_delimiter_usv {"2215} } + } % \end{macrocode} % % % \paragraph{Active fraction style} % \begin{macrocode} \@@_keys_choices:nn {active-frac} - { - {small} - { - \cs_if_exist:NTF \tfrac - { \bool_set_true:N \l_@@_smallfrac_bool } - { - \@@_warning:n {no-tfrac} - \bool_set_false:N \l_@@_smallfrac_bool - } - \use:c {@@_setup_active_frac:} - } + { + {small} + { + \cs_if_exist:NTF \tfrac + { \bool_set_true:N \l_@@_smallfrac_bool } + { + \@@_warning:n {no-tfrac} + \bool_set_false:N \l_@@_smallfrac_bool + } + \use:c {@@_setup_active_frac:} + } - {normalsize} - { - \bool_set_false:N \l_@@_smallfrac_bool - \use:c {@@_setup_active_frac:} - } - } + {normalsize} + { + \bool_set_false:N \l_@@_smallfrac_bool + \use:c {@@_setup_active_frac:} + } + } % \end{macrocode} % % \paragraph{Debug/tracing} @@ -271,11 +288,11 @@ % % \begin{macrocode} \@@_keys_choices:nn {trace} - { - {on} {} % default - {debug} { \msg_redirect_module:nnn { unicode-math } { log } { warning } } - {off} { \msg_redirect_module:nnn { unicode-math } { log } { none } } - } + { + {on} {} % default + {debug} { \msg_redirect_module:nnn { unicode-math } { log } { warning } } + {off} { \msg_redirect_module:nnn { unicode-math } { log } { none } } + } % \end{macrocode} % % \subsection{Defaults} @@ -304,7 +321,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-primes.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-primes.dtx index 510ecc5f2ff..395ec6a796a 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-code-primes.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-primes.dtx @@ -1,4 +1,5 @@ %%^^A%% um-code-primes.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% The definitions needed for the input of primes. % \section{Primes} % @@ -80,17 +81,17 @@ { {1} { \@@_superscript:n {#1} } {2} { - \@@_glyph_if_exist:NnTF \l_@@_font {"2033} + \@@_glyph_if_exist:NnTF \g_@@_prime_font_cmd_tl {"2033} { \@@_superscript:n {\@@_prime_double_mchar} } { \@@_nprimes:Nn #1 {#2} } } {3} { - \@@_glyph_if_exist:NnTF \l_@@_font {"2034} + \@@_glyph_if_exist:NnTF \g_@@_prime_font_cmd_tl {"2034} { \@@_superscript:n {\@@_prime_triple_mchar} } { \@@_nprimes:Nn #1 {#2} } } {4} { - \@@_glyph_if_exist:NnTF \l_@@_font {"2057} + \@@_glyph_if_exist:NnTF \g_@@_prime_font_cmd_tl {"2057} { \@@_superscript:n {\@@_prime_quad_mchar} } { \@@_nprimes:Nn #1 {#2} } } @@ -108,12 +109,12 @@ { {1} { \@@_superscript:n {#1} } {2} { - \@@_glyph_if_exist:NnTF \l_@@_font {"2036} + \@@_glyph_if_exist:NnTF \g_@@_prime_font_cmd_tl {"2036} { \@@_superscript:n {\@@_backprime_double_mchar} } { \@@_nprimes:Nn #1 {#2} } } {3} { - \@@_glyph_if_exist:NnTF \l_@@_font {"2037} + \@@_glyph_if_exist:NnTF \g_@@_prime_font_cmd_tl {"2037} { \@@_superscript:n {\@@_backprime_triple_mchar} } { \@@_nprimes:Nn #1 {#2} } } @@ -375,7 +376,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-setchar.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-setchar.dtx index 12928baf240..520f4b68ea6 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-code-setchar.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-setchar.dtx @@ -1,4 +1,5 @@ %%^^A%% um-code-setchar.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% General assignment of maths symbols. % \section{Setting up maths chars} % @@ -41,9 +42,6 @@ % % \subsection{Definitions of the active math characters} % -% Now give \cmd\_@@_sym:nnn\ a definition in terms of \cmd\@@_cs_set_eq_active_char:Nw\ -% and we're good to go. -% % Ensure catcodes are appropriate; % make sure |#| is an `other' so that we don't get confused with \cs{mathoctothorpe}. % \begin{macrocode} @@ -57,7 +55,7 @@ { \mathord \mathalpha \mathbin \mathrel \mathpunct \mathop \mathfence } {##3} { - \exp_last_unbraced:NNx \cs_gset_eq:NN ##2 { \Ucharcat ##1 ~ 12 ~ } + \exp_last_unbraced:NNx \cs_gset_eq:NN ##2 { \char_generate:nn {##1} {12} } } } \@@_input_math_symbol_table: @@ -114,6 +112,9 @@ { \@@_set_math_overunder:Nnnn #2 {} {#1} {#4} } \mathunder { \@@_set_math_overunder:Nnnn #2 {bottom} {#1} {#4} } + \mathaccentoverlay +%<LU> { \@@_set_math_accent:Nnnn #2 {overlay~ fixed} {#1} {#4} } +%<XE> { \@@_set_math_accent:Nnnn #2 {} {#1} {#4} } } } % \end{macrocode} @@ -125,6 +126,7 @@ \edef\mathunder{\string\mathunder} \edef\mathbotaccent{\string\mathbotaccent} \edef\mathaccentwide{\string\mathaccentwide} +\edef\mathaccentoverlay{\string\mathaccentoverlay} \edef\mathbotaccentwide{\string\mathbotaccentwide} % \end{macrocode} % @@ -255,7 +257,8 @@ \cs_gset_protected_nopar:Npx #1 ##1 { \mathop - { \@@_accent:nnn {#2} {#3} {#4} {##1} } + { \@@_accent:nnn {#2} {#3} {#4} {{}##1} } + % TODO: remove braces above ^^ which work around a LuaTeX bug \limits } } @@ -278,7 +281,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-sscript.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-sscript.dtx index ed94037f2af..51a7666ec08 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-code-sscript.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-sscript.dtx @@ -1,4 +1,5 @@ %%^^A%% um-code-sscript.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Setup for active chars needed to process subscript/superscript input chars. % \section{Unicode sub- and super-scripts} % @@ -17,9 +18,7 @@ % % Open question: should the superscript-like `modifiers' (\unichar{1D2C} % {modifier capital letter a} and on) be included here? -% \begin{macrocode} -\group_begin: -% \end{macrocode} +% % \paragraph{Superscripts} % Populate a property list with superscript characters; themselves as their % key, and their replacement as each key's value. @@ -29,123 +28,43 @@ % char and assign its meaning in one step. % \begin{macrocode} \cs_new:Nn \@@_setup_active_superscript:nn - { - \prop_gput:Nnn \g_@@_supers_prop {#1} {#2} - \char_set_catcode_active:N #1 - \@@_char_gmake_mathactive:N #1 - \scantokens - { - \cs_gset:Npn #1 - { - \tl_set:Nn \l_@@_ss_chain_tl {#2} - \cs_set_eq:NN \@@_sub_or_super:n \sp - \tl_set:Nn \l_@@_tmpa_tl {supers} - \@@_scan_sscript: - } - } - } -% \end{macrocode} -% Bam: -% \begin{macrocode} -\@@_setup_active_superscript:nn {^^^^2070} {0} -\@@_setup_active_superscript:nn {^^^^00b9} {1} -\@@_setup_active_superscript:nn {^^^^00b2} {2} -\@@_setup_active_superscript:nn {^^^^00b3} {3} -\@@_setup_active_superscript:nn {^^^^2074} {4} -\@@_setup_active_superscript:nn {^^^^2075} {5} -\@@_setup_active_superscript:nn {^^^^2076} {6} -\@@_setup_active_superscript:nn {^^^^2077} {7} -\@@_setup_active_superscript:nn {^^^^2078} {8} -\@@_setup_active_superscript:nn {^^^^2079} {9} -\@@_setup_active_superscript:nn {^^^^207a} {+} -\@@_setup_active_superscript:nn {^^^^207b} {-} -\@@_setup_active_superscript:nn {^^^^207c} {=} -\@@_setup_active_superscript:nn {^^^^207d} {(} -\@@_setup_active_superscript:nn {^^^^207e} {)} -\@@_setup_active_superscript:nn {^^^^2071} {i} -\@@_setup_active_superscript:nn {^^^^207f} {n} -\@@_setup_active_superscript:nn {^^^^02b0} {h} -\@@_setup_active_superscript:nn {^^^^02b2} {j} -\@@_setup_active_superscript:nn {^^^^02b3} {r} -\@@_setup_active_superscript:nn {^^^^02b7} {w} -\@@_setup_active_superscript:nn {^^^^02b8} {y} + { + \prop_gput:Nxn \g_@@_supers_prop { \int_eval:n {#1} } {#2} + \@@_mathactive_remap:nn {#1} + { + \tl_set:Nn \l_@@_ss_chain_tl {#2} + \cs_set_eq:NN \@@_sub_or_super:n \sp + \tl_set:Nn \l_@@_tmpa_tl {supers} + \@@_scan_sscript: + } + } % \end{macrocode} -% \paragraph{Subscripts} Ditto above. +% +% \paragraph{Subscripts} % \begin{macrocode} \cs_new:Nn \@@_setup_active_subscript:nn - { - \prop_gput:Nnn \g_@@_subs_prop {#1} {#2} - \char_set_catcode_active:N #1 - \@@_char_gmake_mathactive:N #1 - \scantokens - { - \cs_gset:Npn #1 - { - \tl_set:Nn \l_@@_ss_chain_tl {#2} - \cs_set_eq:NN \@@_sub_or_super:n \sb - \tl_set:Nn \l_@@_tmpa_tl {subs} - \@@_scan_sscript: - } - } - } -% \end{macrocode} -% A few more subscripts than superscripts: -% \begin{macrocode} -\@@_setup_active_subscript:nn {^^^^2080} {0} -\@@_setup_active_subscript:nn {^^^^2081} {1} -\@@_setup_active_subscript:nn {^^^^2082} {2} -\@@_setup_active_subscript:nn {^^^^2083} {3} -\@@_setup_active_subscript:nn {^^^^2084} {4} -\@@_setup_active_subscript:nn {^^^^2085} {5} -\@@_setup_active_subscript:nn {^^^^2086} {6} -\@@_setup_active_subscript:nn {^^^^2087} {7} -\@@_setup_active_subscript:nn {^^^^2088} {8} -\@@_setup_active_subscript:nn {^^^^2089} {9} -\@@_setup_active_subscript:nn {^^^^208a} {+} -\@@_setup_active_subscript:nn {^^^^208b} {-} -\@@_setup_active_subscript:nn {^^^^208c} {=} -\@@_setup_active_subscript:nn {^^^^208d} {(} -\@@_setup_active_subscript:nn {^^^^208e} {)} -\@@_setup_active_subscript:nn {^^^^2090} {a} -\@@_setup_active_subscript:nn {^^^^2091} {e} -\@@_setup_active_subscript:nn {^^^^2095} {h} -\@@_setup_active_subscript:nn {^^^^1d62} {i} -\@@_setup_active_subscript:nn {^^^^2c7c} {j} -\@@_setup_active_subscript:nn {^^^^2096} {k} -\@@_setup_active_subscript:nn {^^^^2097} {l} -\@@_setup_active_subscript:nn {^^^^2098} {m} -\@@_setup_active_subscript:nn {^^^^2099} {n} -\@@_setup_active_subscript:nn {^^^^2092} {o} -\@@_setup_active_subscript:nn {^^^^209a} {p} -\@@_setup_active_subscript:nn {^^^^1d63} {r} -\@@_setup_active_subscript:nn {^^^^209b} {s} -\@@_setup_active_subscript:nn {^^^^209c} {t} -\@@_setup_active_subscript:nn {^^^^1d64} {u} -\@@_setup_active_subscript:nn {^^^^1d65} {v} -\@@_setup_active_subscript:nn {^^^^2093} {x} -\@@_setup_active_subscript:nn {^^^^1d66} {\beta} -\@@_setup_active_subscript:nn {^^^^1d67} {\gamma} -\@@_setup_active_subscript:nn {^^^^1d68} {\rho} -\@@_setup_active_subscript:nn {^^^^1d69} {\phi} -\@@_setup_active_subscript:nn {^^^^1d6a} {\chi} + { + \prop_gput:Nxn \g_@@_subs_prop { \int_eval:n {#1} } {#2} + \@@_mathactive_remap:nn {#1} + { + \tl_set:Nn \l_@@_ss_chain_tl {#2} + \cs_set_eq:NN \@@_sub_or_super:n \sb + \tl_set:Nn \l_@@_tmpa_tl {subs} + \@@_scan_sscript: + } + } % \end{macrocode} % -% \begin{macrocode} -\group_end: -% \end{macrocode} -% The scanning command, which collects a chain of subscripts or a chain +% \paragraph{The scanning command} +% Collects a chain of subscripts or a chain % of superscripts and then typesets what it has collected. % \begin{macrocode} -\cs_new:Npn \@@_scan_sscript: - { - \@@_scan_sscript:TF - { - \@@_scan_sscript: - } - { - \@@_sub_or_super:n {\l_@@_ss_chain_tl} - } - } +\cs_new:Nn \@@_scan_sscript: + { + \@@_scan_sscript:TF + { \@@_scan_sscript: } + { \@@_sub_or_super:n {\l_@@_ss_chain_tl} } + } % \end{macrocode} % We do not skip spaces when scanning ahead, and we explicitly wish to % bail out on encountering a space or a brace. These cases are filtered @@ -157,25 +76,98 @@ % The \cs{group_align_safe_begin:} and \cs{group_align_safe_end:} are % needed in case |#3| is |&|. % \begin{macrocode} -\cs_new:Npn \@@_scan_sscript:TF #1#2 - { - \peek_N_type:TF - { - \group_align_safe_begin: - \@@_scan_sscript_aux:nnN {#1} {#2} - } - {#2} - } -\cs_new:Npn \@@_scan_sscript_aux:nnN #1#2#3 - { - \prop_get:cnNTF {g_@@_\l_@@_tmpa_tl _prop} {#3} \l_@@_tmpb_tl - { - \tl_put_right:NV \l_@@_ss_chain_tl \l_@@_tmpb_tl - \group_align_safe_end: - #1 - } - { \group_align_safe_end: #2 #3 } - } +\cs_new:Nn \@@_scan_sscript:TF + { + \peek_N_type:TF + { + \group_align_safe_begin: + \@@_scan_sscript_aux:nnN {#1} {#2} + } + {#2} + } +% \end{macrocode} +% The look-ahead for the sscripts doesn't try to peek inside the lookahead. +% \begin{macrocode} +\cs_new:Nn \@@_scan_sscript_aux:nnN + { + \tl_set:Nx \l_@@_tmpa_key_tl { \tl_to_str:n {#3} } + \prop_get:cxNTF {g_@@_\l_@@_tmpa_tl _prop} + { \int_eval:n { \exp_after:wN ` \l_@@_tmpa_key_tl } } + \l_@@_tmpb_tl + { + \tl_put_right:NV \l_@@_ss_chain_tl \l_@@_tmpb_tl + \group_align_safe_end: + #1 + } + { \group_align_safe_end: #2 #3 } + } +% \end{macrocode} +% +% \paragraph{Definitions} +% Superscripts. +% \begin{macrocode} +\@@_setup_active_superscript:nn {"2070} {0} +\@@_setup_active_superscript:nn {"00B9} {1} +\@@_setup_active_superscript:nn {"00B2} {2} +\@@_setup_active_superscript:nn {"00B3} {3} +\@@_setup_active_superscript:nn {"2074} {4} +\@@_setup_active_superscript:nn {"2075} {5} +\@@_setup_active_superscript:nn {"2076} {6} +\@@_setup_active_superscript:nn {"2077} {7} +\@@_setup_active_superscript:nn {"2078} {8} +\@@_setup_active_superscript:nn {"2079} {9} +\@@_setup_active_superscript:nn {"207A} {+} +\@@_setup_active_superscript:nn {"207B} {-} +\@@_setup_active_superscript:nn {"207C} {=} +\@@_setup_active_superscript:nn {"207D} {(} +\@@_setup_active_superscript:nn {"207E} {)} +\@@_setup_active_superscript:nn {"2071} {i} +\@@_setup_active_superscript:nn {"207F} {n} +\@@_setup_active_superscript:nn {"02B0} {h} +\@@_setup_active_superscript:nn {"02B2} {j} +\@@_setup_active_superscript:nn {"02B3} {r} +\@@_setup_active_superscript:nn {"02B7} {w} +\@@_setup_active_superscript:nn {"02B8} {y} +% \end{macrocode} +% A few more subscripts than superscripts: +% \begin{macrocode} +\@@_setup_active_subscript:nn {"2080} {0} +\@@_setup_active_subscript:nn {"2081} {1} +\@@_setup_active_subscript:nn {"2082} {2} +\@@_setup_active_subscript:nn {"2083} {3} +\@@_setup_active_subscript:nn {"2084} {4} +\@@_setup_active_subscript:nn {"2085} {5} +\@@_setup_active_subscript:nn {"2086} {6} +\@@_setup_active_subscript:nn {"2087} {7} +\@@_setup_active_subscript:nn {"2088} {8} +\@@_setup_active_subscript:nn {"2089} {9} +\@@_setup_active_subscript:nn {"208A} {+} +\@@_setup_active_subscript:nn {"208B} {-} +\@@_setup_active_subscript:nn {"208C} {=} +\@@_setup_active_subscript:nn {"208D} {(} +\@@_setup_active_subscript:nn {"208E} {)} +\@@_setup_active_subscript:nn {"2090} {a} +\@@_setup_active_subscript:nn {"2091} {e} +\@@_setup_active_subscript:nn {"2095} {h} +\@@_setup_active_subscript:nn {"1D62} {i} +\@@_setup_active_subscript:nn {"2C7C} {j} +\@@_setup_active_subscript:nn {"2096} {k} +\@@_setup_active_subscript:nn {"2097} {l} +\@@_setup_active_subscript:nn {"2098} {m} +\@@_setup_active_subscript:nn {"2099} {n} +\@@_setup_active_subscript:nn {"2092} {o} +\@@_setup_active_subscript:nn {"209A} {p} +\@@_setup_active_subscript:nn {"1D63} {r} +\@@_setup_active_subscript:nn {"209B} {s} +\@@_setup_active_subscript:nn {"209C} {t} +\@@_setup_active_subscript:nn {"1D64} {u} +\@@_setup_active_subscript:nn {"1D65} {v} +\@@_setup_active_subscript:nn {"2093} {x} +\@@_setup_active_subscript:nn {"1D66} {\beta} +\@@_setup_active_subscript:nn {"1D67} {\gamma} +\@@_setup_active_subscript:nn {"1D68} {\rho} +\@@_setup_active_subscript:nn {"1D69} {\phi} +\@@_setup_active_subscript:nn {"1D6A} {\chi} % \end{macrocode} % % @@ -194,7 +186,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-sym-commands.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-sym-commands.dtx new file mode 100644 index 00000000000..cd7263ecf9e --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-sym-commands.dtx @@ -0,0 +1,289 @@ +%%^^A%% um-code-sym-commands.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Definition of "math symbol alphabet" commands such as `\symbf` and co. + +% \section{Mapping in maths alphabets} +% \label{sec:symcmd} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% Switching to a different style of alphabetic symbols was traditionally performed with +% commands like \cmd\mathbf, which literally changes fonts to access alternate symbols. +% This is not as simple with Unicode fonts. +% +% In traditional \TeX{} maths font setups, you simply switch between different `families' (\cmd\fam), which is analogous to changing from one font to another---a symbol such as `a' will be upright in one font, bold in another, and so on. +% In pkg{unicode-math}, a different mechanism is used to switch between styles. For every letter (start with ascii a-zA-Z and numbers to keep things simple for now), they are assigned a `mathcode' with \cmd\Umathcode\ that maps from input letter to output font glyph slot. This is done with the equivalent of +% \begin{Verbatim} +% \Umathcode`\a = 7 1 "1D44E\relax +% \Umathcode`\b = 7 1 "1D44F\relax +% \Umathcode`\c = 7 1 "1D450\relax +% ... +% \end{Verbatim} +% When switching from regular letters to, say, \cmd\mathrm, we now need to execute a new mapping: +% \begin{Verbatim} +% \Umathcode`\a = 7 1 `\a\relax +% \Umathcode`\b = 7 1 `\b\relax +% \Umathcode`\c = 7 1 `\c\relax +% ... +% \end{Verbatim} +% This is fairly straightforward to perform when we're defining our own commands such as \cmd\symbf\ and so on. However, this means that `classical' \TeX\ font setups will break, because with the original mapping still in place, the engine will be attempting to insert unicode maths glyphs from a standard font. +% +% \subsection{Hooks into \LaTeXe} +% +% To overcome this, we patch \cs{use@mathgroup}. +% (An alternative is to patch \cs{extract@alph@from@version}, which constructs the \cs{mathXYZ} commands, but this method fails if the command has been defined using \cs{DeclareSymbolFontAlphabet}.) +% As far as I can tell, this is only used inside of commands such as \cs{mathXYZ}, so this shouldn't have any major side-effects. +% +% \begin{macrocode} +\cs_set:Npn \use@mathgroup #1 #2 + { + \mode_if_math:T % <- not sure if this is really necessary since we've just checked for mmode and raised an error if not! + { + \math@bgroup + \cs_if_eq:cNF {M@\f@encoding} #1 {#1} + \@@_switchto_literal: + \mathgroup #2 \relax + \math@egroup + } + } +% \end{macrocode} +% +% In LaTeX maths, the command |\operator@font| is defined that switches to the |operator| mathgroup. The classic example is the |\sin| in |$\sin{x}$|; essentially we’re using |\mathrm| to typeset the upright symbols, but the syntax is |{\operator@font sin}|. +% I thought that hooking into |\operator@font| would be hard because all other maths font selection in 2e uses |\mathrm{...}| style. +% Then reading source2e a little more I stumbled upon \cs{@fontswitch}. +% Reimplement that here to avoid \cs{bgroup}/\cs{egroup}. +% \begin{macro}{\operator@font} +% \begin{macrocode} +\cs_set:Npn \operator@font + { + \@@_switchto_literal: + \@@_fontswitch:n { \g_@@_operator_mathfont_tl } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_fontswitch:n} +% \begin{macrocode} +\cs_set:Nn \@@_fontswitch:n + { + \mode_if_math:T + { + \cs_set_eq:NN \math@bgroup \scan_stop: + \cs_set_eq:NN \@@_group_begin: \scan_stop: + \cs_set:Npn \@@_group_end: + { + \cs_set_eq:NN \@@_group_begin: \@@_group_begin_frozen: + \cs_set_eq:NN \@@_group_end: \@@_group_end_frozen: + \cs_set_eq:NN \math@bgroup \@@math@bgroup + \cs_set_eq:NN \math@egroup \@@math@egroup + } + \cs_set_eq:NN \math@egroup \@@_group_end: + #1 \scan_stop: + } + } +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Setting styles} +% +% Algorithm for setting alphabet fonts. +% By default, when |range| is empty, we are in \emph{implicit} mode. +% If |range| contains the name of the math alphabet, we are in \emph{explicit} +% mode and do things slightly differently. +% +% Implicit mode: +% \begin{itemize} +% \item Try and set all of the alphabet shapes. +% \item Check for the first glyph of each alphabet to detect if the font supports each +% alphabet shape. +% \item For alphabets that do exist, overwrite whatever’s already there. +% \item For alphabets that are not supported, \emph{do nothing}. +% (This includes leaving the old alphabet definition in place.) +% \end{itemize} +% +% Explicit mode: +% \begin{itemize} +% \item Only set the alphabets specified. +% \item Check for the first glyph of the alphabet to detect if the font contains +% the alphabet shape in the Unicode math plane. +% \item For Unicode math alphabets, overwrite whatever’s already there. +% \item Otherwise, use the \ascii\ glyph slots instead. +% \end{itemize} +% +% +% +% \subsection{Defining the math style macros} +% +% We call the different shapes that a math alphabet can be a `math style’. +% Note that different alphabets can exist within the same math style. E.g., +% we call `bold’ the math style |bf| and within it there are upper and lower +% case Greek and Roman alphabets and Arabic numerals. +% +% \begin{macro}{\@@_prepare_mathstyle:n} +% \darg{math style name (e.g., \texttt{it} or \texttt{bb})} +% 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_@@_mathstyle_tl} is for other applications to query the +% current math style. +% \begin{macrocode} +\cs_new:Nn \@@_prepare_mathstyle:n + { + \seq_gput_right:Nn \g_@@_mathstyles_seq {#1} + \@@_init_alphabet:n {#1} + \cs_set_protected:cpx {sym#1} ##1 + { + \@@_group_begin: + \exp_not:n + { + \mode_if_math:F + { + \exp_args:Nc \non@alpherr {sym#1} + } + \tl_set:Nn \l_@@_mathstyle_tl {#1} + } + \exp_not:c {@@_switchto_#1:} ##1 + \@@_group_end: + } + } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@@_init_alphabet:n} +% \darg{math alphabet name (e.g., \texttt{it} or \texttt{bb})} +% This macro initialises the macros used to set up a math alphabet. +% First used when the math alphabet macro is first defined, but then used +% later when redefining a particular maths alphabet. +% \begin{macrocode} +\cs_set:Nn \@@_init_alphabet:n + { + \@@_log:nx {alph-initialise} {#1} + \cs_set_eq:cN {@@_switchto_#1:} \prg_do_nothing: + } +% \end{macrocode} +% \end{macro} +% +% \subsection{Definition of alphabets and styles} +% +% +% The linking between named ranges and symbol style commands happens here. +% It’s currently not using all of the machinery we’re in the process of setting up above. +% Baby steps. +% \begin{macrocode} +\cs_new:Nn \@@_default_mathalph:nnn + { + \prop_new:c {g_@@_named_range_#1_prop} + \seq_gput_right:Nn \g_@@_default_mathalph_seq {{#1}{#2}{#3}} + \prop_gput:cnn { g_@@_named_range_#1_prop } { default-alpha } {#2} + } +% \end{macrocode} +% \begin{macrocode} +\@@_default_mathalph:nnn {up } {latin,Latin,greek,Greek,num,misc} {up } +\@@_default_mathalph:nnn {it } {latin,Latin,greek,Greek,misc} {it } +\@@_default_mathalph:nnn {bb } {latin,Latin,num,misc} {bb } +\@@_default_mathalph:nnn {bbit } {misc} {bbit } +\@@_default_mathalph:nnn {scr } {latin,Latin} {scr } +\@@_default_mathalph:nnn {cal } {Latin} {scr } +\@@_default_mathalph:nnn {bfcal } {Latin} {bfscr } +\@@_default_mathalph:nnn {frak } {latin,Latin} {frak } +\@@_default_mathalph:nnn {tt } {latin,Latin,num} {tt } +\@@_default_mathalph:nnn {sfup } {latin,Latin,num} {sfup } +\@@_default_mathalph:nnn {sfit } {latin,Latin} {sfit } +\@@_default_mathalph:nnn {bfup } {latin,Latin,greek,Greek,num,misc} {bfup } +\@@_default_mathalph:nnn {bfit } {latin,Latin,greek,Greek,misc} {bfit } +\@@_default_mathalph:nnn {bfscr } {latin,Latin} {bfscr } +\@@_default_mathalph:nnn {bffrak} {latin,Latin} {bffrak} +\@@_default_mathalph:nnn {bfsfup} {latin,Latin,greek,Greek,num,misc} {bfsfup} +\@@_default_mathalph:nnn {bfsfit} {latin,Latin,greek,Greek,misc} {bfsfit} +% \end{macrocode} +% +% \subsubsection{Define symbol style commands} +% Finally, all of the `symbol styles’ commands are set up, which are the commands to access each of the named alphabet styles. There is not a one-to-one mapping between symbol style commands and named style ranges! +% \begin{macrocode} +\clist_map_inline:nn + { + up, it, bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf, + tt, bb, bbit, scr, bfscr, cal, bfcal, frak, bffrak, + normal, literal, sf, bf, + } + { + \@@_prepare_mathstyle:n {#1} + } +% \end{macrocode} +% +% +% \subsubsection{New names for legacy textmath alphabet selection} +% In case a package option overwrites, say, \cs{mathbf} with \cs{symbf}. +% \begin{macrocode} +\clist_map_inline:nn + { rm, it, bf, sf, tt } + { \cs_set_eq:cc { mathtext #1 } { math #1 } } +% \end{macrocode} +% Perhaps these should actually be defined using a hypothetical unicode-math interface to creating new such styles. To come. +% +% +% \subsubsection{Replacing legacy pure-maths alphabets} +% The following are alphabets which do not have a math/text ambiguity. +% \begin{macrocode} +\clist_map_inline:nn + { + normal, bb , bbit, scr, bfscr, cal, bfcal, frak, bffrak, tt, + bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf + } + { + \cs_set:cpx { math #1 } { \exp_not:c { sym #1 } } + } +% \end{macrocode} +% +% +% \subsubsection{New commands for ambiguous alphabets} +% +% \begin{macrocode} +\AtBeginDocument + { + \clist_map_inline:nn + { rm, it, bf, sf, tt } + { + \cs_set_protected:cpx { math #1 } + { + \exp_not:n { \bool_if:NTF } \exp_not:c { g_@@_ math #1 _text_bool} + { \exp_not:c { mathtext #1 } } + { \exp_not:c { sym #1 } } + } + } + } +% \end{macrocode} +% +% \paragraph{Alias \cs{mathrm} as legacy name for \cs{mathup}} +% \begin{macrocode} +\cs_set_protected:Npn \mathup { \mathrm } +\cs_set_protected:Npn \symrm { \symup } +% \end{macrocode} +% +% +% \begin{macrocode} +%</package> +% \end{macrocode} + +\endinput + +% /© +% +% ------------------------------------------------ +% The UNICODE-MATH package <wspr.io/unicode-math> +% ------------------------------------------------ +% 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/>. +% ------------------------------------------------ +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-ui.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-ui.dtx index 8dd1272a9d9..697dab3dc84 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-code-ui.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-ui.dtx @@ -1,4 +1,5 @@ %%^^A%% um-code-ui.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% The xparse user interface top-level definitions. % \section{The user interface commands} % @@ -91,7 +92,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-usv.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-usv.dtx index 694e6b4eae7..954ba649206 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-code-usv.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-usv.dtx @@ -1,4 +1,5 @@ %%^^A%% um-code-usv.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Mapping of mathematical unicode slots for alphabets. % \section{Alphabet Unicode positions} % @@ -11,317 +12,321 @@ % \end{macrocode} % % \paragraph{Alphabets} -% \begin{macrocode} -\usv_set:nnn {normal} {num} {48} -\usv_set:nnn {normal} {Latin}{"1D434} -\usv_set:nnn {normal} {latin}{"1D44E} -\usv_set:nnn {normal} {Greek}{"1D6E2} -\usv_set:nnn {normal} {greek}{"1D6FC} -\usv_set:nnn {normal}{varTheta} {"1D6F3} -\usv_set:nnn {normal}{epsilon}{"1D716} -\usv_set:nnn {normal}{vartheta} {"1D717} -\usv_set:nnn {normal}{varkappa} {"1D718} -\usv_set:nnn {normal}{phi} {"1D719} -\usv_set:nnn {normal}{varrho} {"1D71A} -\usv_set:nnn {normal}{varpi} {"1D71B} -\usv_set:nnn {normal} {Nabla}{"1D6FB} -\usv_set:nnn {normal} {partial}{"1D715} - -\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} +% `Normal': +% \begin{macrocode} +\usv_set:nnn {normal} {num} {48} +\usv_set:nnn {normal} {Latin} {"1D434} +\usv_set:nnn {normal} {latin} {"1D44E} +\usv_set:nnn {normal} {Greek} {"1D6E2} +\usv_set:nnn {normal} {greek} {"1D6FC} +\usv_set:nnn {normal} {varTheta} {"1D6F3} +\usv_set:nnn {normal} {epsilon} {"1D716} +\usv_set:nnn {normal} {vartheta} {"1D717} +\usv_set:nnn {normal} {varkappa} {"1D718} +\usv_set:nnn {normal} {phi} {"1D719} +\usv_set:nnn {normal} {varrho} {"1D71A} +\usv_set:nnn {normal} {varpi} {"1D71B} +\usv_set:nnn {normal} {Nabla} {"1D6FB} +\usv_set:nnn {normal} {partial} {"1D715} +% \end{macrocode} +% Regular weights: +% \begin{macrocode} +\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} +% \end{macrocode} +% Bold weights: +% \begin{macrocode} +\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} +% \end{macrocode} +% The `auto' bolds: +% \begin{macrocode} +\usv_set:nnn {bfsf} {Latin} { \bool_if:NTF \g_@@_upLatin_bool \g_@@_bfsfup_Latin_usv \g_@@_bfsfit_Latin_usv } +\usv_set:nnn {bfsf} {latin} { \bool_if:NTF \g_@@_uplatin_bool \g_@@_bfsfup_latin_usv \g_@@_bfsfit_latin_usv } +\usv_set:nnn {bfsf} {Greek} { \bool_if:NTF \g_@@_upGreek_bool \g_@@_bfsfup_Greek_usv \g_@@_bfsfit_Greek_usv } +\usv_set:nnn {bfsf} {greek} { \bool_if:NTF \g_@@_upgreek_bool \g_@@_bfsfup_greek_usv \g_@@_bfsfit_greek_usv } +\usv_set:nnn {bf} {Latin} { \bool_if:NTF \g_@@_bfupLatin_bool \g_@@_bfup_Latin_usv \g_@@_bfit_Latin_usv } +\usv_set:nnn {bf} {latin} { \bool_if:NTF \g_@@_bfuplatin_bool \g_@@_bfup_latin_usv \g_@@_bfit_latin_usv } +\usv_set:nnn {bf} {Greek} { \bool_if:NTF \g_@@_bfupGreek_bool \g_@@_bfup_Greek_usv \g_@@_bfit_Greek_usv } +\usv_set:nnn {bf} {greek} { \bool_if:NTF \g_@@_bfupgreek_bool \g_@@_bfup_greek_usv \g_@@_bfit_greek_usv } +% \end{macrocode} +% \paragraph{Greek variants} +% Upright: +% \begin{macrocode} +\usv_set:nnn {up} {varTheta} {"3F4} +\usv_set:nnn {up} {Digamma} {"3DC} +\usv_set:nnn {up} {epsilon} {"3F5} +\usv_set:nnn {up} {vartheta} {"3D1} +\usv_set:nnn {up} {varkappa} {"3F0} +\usv_set:nnn {up} {phi} {"3D5} +\usv_set:nnn {up} {varrho} {"3F1} +\usv_set:nnn {up} {varpi} {"3D6} +\usv_set:nnn {up} {digamma} {"3DD} % \end{macrocode} % Bold: % \begin{macrocode} -\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} -% \end{macrocode} -% -% \begin{macrocode} -\usv_set:nnn {bfsf}{Latin}{ \bool_if:NTF \g_@@_upLatin_bool \g_@@_bfsfup_Latin_usv \g_@@_bfsfit_Latin_usv } -\usv_set:nnn {bfsf}{latin}{ \bool_if:NTF \g_@@_uplatin_bool \g_@@_bfsfup_latin_usv \g_@@_bfsfit_latin_usv } -\usv_set:nnn {bfsf}{Greek}{ \bool_if:NTF \g_@@_upGreek_bool \g_@@_bfsfup_Greek_usv \g_@@_bfsfit_Greek_usv } -\usv_set:nnn {bfsf}{greek}{ \bool_if:NTF \g_@@_upgreek_bool \g_@@_bfsfup_greek_usv \g_@@_bfsfit_greek_usv } -\usv_set:nnn {bf} {Latin}{ \bool_if:NTF \g_@@_bfupLatin_bool \g_@@_bfup_Latin_usv \g_@@_bfit_Latin_usv } -\usv_set:nnn {bf} {latin}{ \bool_if:NTF \g_@@_bfuplatin_bool \g_@@_bfup_latin_usv \g_@@_bfit_latin_usv } -\usv_set:nnn {bf} {Greek}{ \bool_if:NTF \g_@@_bfupGreek_bool \g_@@_bfup_Greek_usv \g_@@_bfit_Greek_usv } -\usv_set:nnn {bf} {greek}{ \bool_if:NTF \g_@@_bfupgreek_bool \g_@@_bfup_greek_usv \g_@@_bfit_greek_usv } -% \end{macrocode} -% Greek variants: -% \begin{macrocode} -\usv_set:nnn {up}{varTheta} {"3F4} -\usv_set:nnn {up}{Digamma} {"3DC} -\usv_set:nnn {up}{epsilon}{"3F5} -\usv_set:nnn {up}{vartheta} {"3D1} -\usv_set:nnn {up}{varkappa} {"3F0} -\usv_set:nnn {up}{phi} {"3D5} -\usv_set:nnn {up}{varrho} {"3F1} -\usv_set:nnn {up}{varpi} {"3D6} -\usv_set:nnn {up}{digamma} {"3DD} -% \end{macrocode} -% Bold: -% \begin{macrocode} -\usv_set:nnn {bfup}{varTheta} {"1D6B9} -\usv_set:nnn {bfup}{Digamma} {"1D7CA} -\usv_set:nnn {bfup}{epsilon}{"1D6DC} -\usv_set:nnn {bfup}{vartheta} {"1D6DD} -\usv_set:nnn {bfup}{varkappa} {"1D6DE} -\usv_set:nnn {bfup}{phi} {"1D6DF} -\usv_set:nnn {bfup}{varrho} {"1D6E0} -\usv_set:nnn {bfup}{varpi} {"1D6E1} -\usv_set:nnn {bfup}{digamma} {"1D7CB} -% \end{macrocode} -% Italic Greek variants: -% \begin{macrocode} -\usv_set:nnn {it}{varTheta} {"1D6F3} -\usv_set:nnn {it}{epsilon}{"1D716} -\usv_set:nnn {it}{vartheta} {"1D717} -\usv_set:nnn {it}{varkappa} {"1D718} -\usv_set:nnn {it}{phi} {"1D719} -\usv_set:nnn {it}{varrho} {"1D71A} -\usv_set:nnn {it}{varpi} {"1D71B} +\usv_set:nnn {bfup} {varTheta} {"1D6B9} +\usv_set:nnn {bfup} {Digamma} {"1D7CA} +\usv_set:nnn {bfup} {epsilon} {"1D6DC} +\usv_set:nnn {bfup} {vartheta} {"1D6DD} +\usv_set:nnn {bfup} {varkappa} {"1D6DE} +\usv_set:nnn {bfup} {phi} {"1D6DF} +\usv_set:nnn {bfup} {varrho} {"1D6E0} +\usv_set:nnn {bfup} {varpi} {"1D6E1} +\usv_set:nnn {bfup} {digamma} {"1D7CB} +% \end{macrocode} +% Italic: +% \begin{macrocode} +\usv_set:nnn {it} {varTheta} {"1D6F3} +\usv_set:nnn {it} {epsilon} {"1D716} +\usv_set:nnn {it} {vartheta} {"1D717} +\usv_set:nnn {it} {varkappa} {"1D718} +\usv_set:nnn {it} {phi} {"1D719} +\usv_set:nnn {it} {varrho} {"1D71A} +\usv_set:nnn {it} {varpi} {"1D71B} % \end{macrocode} % Bold italic: % \begin{macrocode} -\usv_set:nnn {bfit}{varTheta} {"1D72D} -\usv_set:nnn {bfit}{epsilon}{"1D750} -\usv_set:nnn {bfit}{vartheta} {"1D751} -\usv_set:nnn {bfit}{varkappa} {"1D752} -\usv_set:nnn {bfit}{phi} {"1D753} -\usv_set:nnn {bfit}{varrho} {"1D754} -\usv_set:nnn {bfit}{varpi} {"1D755} +\usv_set:nnn {bfit} {varTheta} {"1D72D} +\usv_set:nnn {bfit} {epsilon} {"1D750} +\usv_set:nnn {bfit} {vartheta} {"1D751} +\usv_set:nnn {bfit} {varkappa} {"1D752} +\usv_set:nnn {bfit} {phi} {"1D753} +\usv_set:nnn {bfit} {varrho} {"1D754} +\usv_set:nnn {bfit} {varpi} {"1D755} % \end{macrocode} % Bold sans: % \begin{macrocode} -\usv_set:nnn {bfsfup}{varTheta} {"1D767} -\usv_set:nnn {bfsfup}{epsilon}{"1D78A} -\usv_set:nnn {bfsfup}{vartheta} {"1D78B} -\usv_set:nnn {bfsfup}{varkappa} {"1D78C} -\usv_set:nnn {bfsfup}{phi} {"1D78D} -\usv_set:nnn {bfsfup}{varrho} {"1D78E} -\usv_set:nnn {bfsfup}{varpi} {"1D78F} +\usv_set:nnn {bfsfup} {varTheta} {"1D767} +\usv_set:nnn {bfsfup} {epsilon} {"1D78A} +\usv_set:nnn {bfsfup} {vartheta} {"1D78B} +\usv_set:nnn {bfsfup} {varkappa} {"1D78C} +\usv_set:nnn {bfsfup} {phi} {"1D78D} +\usv_set:nnn {bfsfup} {varrho} {"1D78E} +\usv_set:nnn {bfsfup} {varpi} {"1D78F} % \end{macrocode} % Bold sans italic: % \begin{macrocode} -\usv_set:nnn {bfsfit}{varTheta} {"1D7A1} -\usv_set:nnn {bfsfit}{epsilon}{"1D7C4} -\usv_set:nnn {bfsfit}{vartheta} {"1D7C5} -\usv_set:nnn {bfsfit}{varkappa} {"1D7C6} -\usv_set:nnn {bfsfit}{phi} {"1D7C7} -\usv_set:nnn {bfsfit}{varrho} {"1D7C8} -\usv_set:nnn {bfsfit}{varpi} {"1D7C9} +\usv_set:nnn {bfsfit} {varTheta} {"1D7A1} +\usv_set:nnn {bfsfit} {epsilon} {"1D7C4} +\usv_set:nnn {bfsfit} {vartheta} {"1D7C5} +\usv_set:nnn {bfsfit} {varkappa} {"1D7C6} +\usv_set:nnn {bfsfit} {phi} {"1D7C7} +\usv_set:nnn {bfsfit} {varrho} {"1D7C8} +\usv_set:nnn {bfsfit} {varpi} {"1D7C9} % \end{macrocode} % Nabla: % \begin{macrocode} -\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} {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} % \end{macrocode} % Partial: % \begin{macrocode} -\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} -% \end{macrocode} -% \paragraph{Exceptions} -% These are need for mapping with the exceptions in other alphabets: -% (coming up) -% \begin{macrocode} -\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 {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} % \end{macrocode} % -% \begin{macrocode} -\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} -% \end{macrocode} -% -% \begin{macrocode} -\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} -% \end{macrocode} -% -% \begin{macrocode} -\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} +% \paragraph{Exceptions} +% Upright uppercase: +% \begin{macrocode} +\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} +% \end{macrocode} +% Italic uppercase: +% \begin{macrocode} +\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} +% \end{macrocode} +% Upright lowercase (needed for later mappings): +% \begin{macrocode} +\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} +% \end{macrocode} +% Italic lowercase: +% \begin{macrocode} +\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} % \end{macrocode} % Latin `h': % \begin{macrocode} -\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 {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} % \end{macrocode} % Dotless `i' and `j: % \begin{macrocode} -\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 {up} {dotlessi} {"00131} +\usv_set:nnn {up} {dotlessj} {"00237} +\usv_set:nnn {it} {dotlessi} {"1D6A4} +\usv_set:nnn {it} {dotlessj} {"1D6A5} % \end{macrocode} % Blackboard: % \begin{macrocode} -\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 {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} % \end{macrocode} % Italic blackboard: % \begin{macrocode} -\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} -% \end{macrocode} -% Script exceptions: -% \begin{macrocode} -\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 {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} % \end{macrocode} -% +% Script: +% \begin{macrocode} +\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} +% \end{macrocode} +% Caligraphic: % \begin{macrocode} -\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 {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} % \end{macrocode} -% Fractur exceptions: +% Fractur: % \begin{macrocode} -\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 {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} % \end{macrocode} % % \begin{macrocode} @@ -578,7 +583,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-variables.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-variables.dtx index 1f4a5c70fb4..082a38bb3cb 100644 --- a/Master/texmf-dist/source/latex/unicode-math/um-code-variables.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-variables.dtx @@ -1,4 +1,5 @@ %%^^A%% um-code-variables.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Declaration of all code-level variables used in the package. % \section{Variable initialisation} % @@ -7,7 +8,7 @@ % \end{macrocode} % % -% \paragraph{Conditionals} +% \subsection{bool} % % True if using a proper OpenType font with unicode maths % \begin{macrocode} @@ -17,7 +18,6 @@ % \begin{macrocode} \bool_new:N \l_@@_init_bool \bool_new:N \l_@@_implicit_alph_bool -\bool_new:N \g_@@_mainfont_already_set_bool % \end{macrocode} % For \opt{math-style}: % \begin{macrocode} @@ -55,11 +55,16 @@ \bool_new:N \g_@@_mathtt_text_bool % \end{macrocode} % -% \paragraph{Variables} +% \subsection{int} +% % \begin{macrocode} \int_new:N \g_@@_fam_int +\int_new:N \g_@@_fonts_used_int +\int_new:N \l_@@_primecount_int % \end{macrocode} % +% \subsection{tl} +% % For displaying in warning messages, etc.: % \begin{macrocode} \tl_const:Nn \c_@@_math_alphabet_name_latin_tl {Latin,~lowercase} @@ -82,29 +87,56 @@ % \end{macrocode} % % \begin{macrocode} -\seq_new:N \l_@@_missing_alph_seq -\seq_new:N \l_@@_mathalph_seq -\seq_new:N \l_@@_char_range_seq -\seq_new:N \l_@@_mclass_range_seq -\seq_new:N \l_@@_cmd_range_seq +\tl_new:N \g_@@_slash_delimiter_usv +\tl_new:N \g_@@_mathtable_tl +\tl_new:N \g_@@_fontname_tl +\tl_new:N \g_@@_mversion_tl +\tl_new:N \g_@@_symfont_tl +\tl_new:N \g_@@_font_keyval_tl +\tl_new:N \g_@@_family_tl +\tl_new:N \g_@@_style_tl +\tl_new:N \g_@@_remap_style_tl +\tl_new:N \l_@@_not_token_name_tl +\tl_new:N \g_@@_curr_font_cmd_tl +\tl_new:N \g_@@_sqrt_font_cmd_tl +\tl_new:N \g_@@_prime_font_cmd_tl % \end{macrocode} % -% \begin{macro}{\g_@@_alphabets_seq} -% Each of math `style' (bfup, sfit, etc.) usually contains one or more `alphabets', which are currently |latin|, |Latin|, |greek|, |Greek|, |num|, and |misc|, although there's an implicit potential for more. -% |misc| is not included in the official list to avoid checking code. +% \begin{macro}{\g_@@_mathparam_store_tl} +% Used to store and restore the math parameters used in Lua\TeX. +% This is done to `save' the values of the \emph{first} (or main) +% maths font loaded, rather than (as per Lua\TeX\ defaults) the last. % \begin{macrocode} -\clist_new:N \g_@@_alphabets_seq -\clist_set:Nn \g_@@_alphabets_seq { latin, Latin, greek, Greek, num } +%<*LU> +\tl_new:N \g_@@_mathparam_store_tl +%</LU> % \end{macrocode} % \end{macro} % +% \subsection{clist} +% % \begin{macrocode} -\clist_new:N \g_@@_named_ranges_clist \clist_new:N \g_@@_char_nrange_clist \clist_new:N \g_@@_unknown_keys_clist \clist_new:N \g_@@_alphabet_clist % \end{macrocode} % +% \begin{macrocode} +\clist_new:N \g_@@_bad_alpha_clist +\clist_put_right:Nx \g_@@_bad_alpha_clist { \tl_to_str:n {bf} } +\clist_put_right:Nx \g_@@_bad_alpha_clist { \tl_to_str:n {sf} } +\clist_put_right:Nx \g_@@_bad_alpha_clist { \tl_to_str:n {bfsf} } +% \end{macrocode} +% +% \subsection{seq} +% +% \begin{macrocode} +\seq_new:N \l_@@_missing_alph_seq +\seq_new:N \g_@@_mathalph_seq +\seq_new:N \g_@@_char_range_seq +\seq_new:N \g_@@_mclass_range_seq +% \end{macrocode} +% % \begin{macro}{\g_@@_mathclasses_seq} % Every math class. % \begin{macrocode} @@ -115,12 +147,11 @@ \mathop, \mathopen,\mathclose, \mathfence,\mathover,\mathunder, - \mathaccent,\mathbotaccent,\mathaccentwide,\mathbotaccentwide + \mathaccent,\mathaccentoverlay,\mathbotaccent,\mathaccentwide,\mathbotaccentwide } % \end{macrocode} % \end{macro} % - % \begin{macro}{\g_@@_default_mathalph_seq} % This sequence stores the alphabets in each math style. % \begin{macrocode} @@ -129,37 +160,45 @@ % \end{macro} % % \begin{macro}{\g_@@_mathstyles_seq} -% This is every `named range' and every `math style' known to \pkg{unicode-math}. +% This is every `math style' known to \pkg{unicode-math}. % A named range is such as "bfit" and "sfit", which are also math styles (with \cs{symbfit} and \cs{symsfit}). % `Mathstyles' are a superset of named ranges and also include commands such as \cs{symbf} and \cs{symsf}. % % N.B. for parsing purposes `named ranges' are defined as strings! % \begin{macrocode} -\seq_new:N \g_@@_named_ranges_seq \seq_new:N \g_@@_mathstyles_seq % \end{macrocode} % \end{macro} % +% \subsection{prop} +% % \begin{macrocode} -\muskip_new:N \g_@@_primekern_muskip -\muskip_gset:Nn \g_@@_primekern_muskip { -\thinmuskip/2 }% arbitrary -\int_new:N \l_@@_primecount_int \prop_new:N \g_@@_supers_prop \prop_new:N \g_@@_subs_prop -\tl_new:N \l_not_token_name_tl % \end{macrocode} % +% \subsection{muskip} +% % \begin{macrocode} -\tl_new:N \g_@@_slash_delimiter_usv -\tl_new:N \g_@@_mathtable_tl -\tl_new:N \g_@@_fontname_tl -\tl_new:N \g_@@_mversion_tl -\tl_new:N \g_@@_symfont_tl -\tl_new:N \g_@@_font_keyval_tl -\tl_new:N \g_@@_family_tl -\tl_new:N \g_@@_style_tl -\tl_new:N \g_@@_remap_style_tl +\muskip_new:N \g_@@_primekern_muskip +\muskip_gset:Nn \g_@@_primekern_muskip { -\thinmuskip/2 }% arbitrary +% \end{macrocode} +% +% \subsection{fp} +% +% \begin{macrocode} +\fp_new:N \g_@@_size_tfsf_fp +\fp_new:N \g_@@_size_sfssf_fp +% \end{macrocode} +% +% \subsection{quark} +% +% \begin{macro}{\q_unicode_math} +% Used as a flag within control sequences to check they're recognised by the package. +% \begin{macrocode} +\quark_new:N \q_unicode_math % \end{macrocode} +% \end{macro} % % \begin{macrocode} %</package> @@ -176,7 +215,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny 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 38c525202f3..04b72f2f77a 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx @@ -1,4 +1,5 @@ %%^^A%% unicode-math.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Metadata for the package code, including files and versioning % \section{Package declaration} % @@ -22,11 +23,13 @@ \DTX{um-code-fontopt.dtx} \DTX{um-code-fontparam.dtx} \DTX{um-code-mathmap.dtx} + \DTX{um-code-sym-commands.dtx} + \DTX{um-code-alphabets.dtx} \DTX{um-code-epilogue.dtx} \DTX{um-code-primes.dtx} \DTX{um-code-sscript.dtx} \DTX{um-code-compat.dtx} - \DTX{um-code-alphabets.dtx} + \DTX{um-code-amsmath.dtx} } %</dtx> % \end{macrocode} @@ -52,7 +55,7 @@ \ProvidesFile{unicode-math.dtx} %</dtx> %<*base|package> - [2017/11/18 v0.8i Unicode maths in XeLaTeX and LuaLaTeX] + [2018/01/07 v0.8j Unicode maths in XeLaTeX and LuaLaTeX] %</base|package> % \end{macrocode} @@ -67,7 +70,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math.ins b/Master/texmf-dist/source/latex/unicode-math/unicode-math.ins index 6279c56bd5b..d1366222d04 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math.ins +++ b/Master/texmf-dist/source/latex/unicode-math/unicode-math.ins @@ -1,4 +1,5 @@ %%^^A%% unicode-math.ins -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Docstrip installer. \ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi \input unicode-math.dtx\relax @@ -23,17 +24,19 @@ Copyright 2012-2015 Khaled Hosny \nopostamble \askforoverwritefalse +\def\FROM#1#2{\from{#1}{#2}} +\def\FROMDEBUG#1#2{\from{#1}{#2,debug}} +\ifx\DEBUG\undefined\else\let\FROM\FROMDEBUG\fi + \generate{\file{unicode-math.sty}{ - \from{unicode-math.dtx}{base} - \from{um-code-base.dtx}{base} + \FROM{unicode-math.dtx}{base} + \FROM{um-code-base.dtx}{base} }} -\ifx\UMDEBUG\undefined\def\UMDEBUG{}\else\def\UMDEBUG{,debug}\fi - -\def\DTX#1{\from{#1}{package,XE\UMDEBUG}} +\def\DTX#1{\FROM{#1}{package,XE}} \generate{\file{unicode-math-xetex.sty}{\DTXFILES}} -\def\DTX#1{\from{#1}{package,LU\UMDEBUG}} +\def\DTX#1{\FROM{#1}{package,LU}} \generate{\file{unicode-math-luatex.sty}{\DTXFILES}} \endbatchfile @@ -48,7 +51,7 @@ Copyright 2012-2015 Khaled Hosny % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny 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 index 33373857539..fa0711b6f1e 100644 --- a/Master/texmf-dist/tex/latex/unicode-math/unicode-math-luatex.sty +++ b/Master/texmf-dist/tex/latex/unicode-math/unicode-math-luatex.sty @@ -19,11 +19,13 @@ %% um-code-fontopt.dtx (with options: `package,LU') %% um-code-fontparam.dtx (with options: `package,LU') %% um-code-mathmap.dtx (with options: `package,LU') +%% um-code-sym-commands.dtx (with options: `package,LU') +%% um-code-alphabets.dtx (with options: `package,LU') %% um-code-epilogue.dtx (with options: `package,LU') %% um-code-primes.dtx (with options: `package,LU') %% um-code-sscript.dtx (with options: `package,LU') %% um-code-compat.dtx (with options: `package,LU') -%% um-code-alphabets.dtx (with options: `package,LU') +%% um-code-amsmath.dtx (with options: `package,LU') %% ------------------------------------------------ %% The UNICODE-MATH package <wspr.io/unicode-math> %% ------------------------------------------------ @@ -37,20 +39,28 @@ %% Copyright 2012-2015 Khaled Hosny %% ------------------------------------------------ %%^^A%% unicode-math.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Metadata for the package code, including files and versioning \ProvidesPackage{unicode-math-luatex} - [2017/11/18 v0.8i Unicode maths in XeLaTeX and LuaLaTeX] + [2018/01/07 v0.8j Unicode maths in XeLaTeX and LuaLaTeX] %%^^A%% um-code-base.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Definition of unicode-math.sty, which splits and loads according to engine. %%^^A%% um-code-opening.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Assorted initialisation tasks, including some low-level function definitions. \RequirePackage{lualatex-math} \ExplSyntaxOn \cs_set_protected_nopar:Npn \exp_last_unbraced:NNx { \::N \::x_unbraced \::: } \cs_generate_variant:Nn \fontspec_set_family:Nnn {Nx} -\cs_generate_variant:Nn \fontspec_set_fontface:NNnn {NNx} +\cs_generate_variant:Nn \prop_get:NnNTF {cx} +\cs_generate_variant:Nn \tl_if_eq:nnF {o} +\cs_set_eq:NN \__um_group_begin: \group_begin: +\cs_set_eq:NN \__um_group_end: \group_end: +\cs_set_eq:NN \__um_group_begin_frozen: \__um_group_begin: +\cs_set_eq:NN \__um_group_end_frozen: \__um_group_end: \prg_new_conditional:Nnn \__um_glyph_if_exist:Nn {p,TF,T,F} { \etex_iffontchar:D #1 #2 \scan_stop: @@ -59,6 +69,11 @@ \prg_return_false: \fi: } +\cs_set_protected:Nn \__um_fontface_gset_eq:NN + { + \tex_global:D \tex_let:D #1 #2 + } +\cs_generate_variant:Nn \__um_fontface_gset_eq:NN {NV,cV} \cs_set:Npn \__um_set_mathcode:nnnn #1#2#3#4 { \Umathcode \int_eval:n {#1} = @@ -93,23 +108,31 @@ } \cs_new:Nn \__um_char_gmake_mathactive:N { - \global\mathcode `#1 = "8000 \scan_stop: + \tex_global:D \tex_mathcode:D `#1 = "8000 \scan_stop: } \cs_new:Nn \__um_char_gmake_mathactive:n { - \global\mathcode #1 = "8000 \scan_stop: + \tex_global:D \tex_mathcode:D \int_eval:n {#1} = "8000 \scan_stop: + } +\cs_new:Nn \__um_mathactive_remap:nn + { + \group_begin: + \cs_set_protected:Npn \__um_tmp: {#2} + \__um_char_gmake_mathactive:n {#1} + \char_gset_active_eq:nN {#1} \__um_tmp: + \group_end: } -\cs_new:Nn \__um_copy_fontparam:nnn +\cs_new:Nn \__um_copy_fontdimen:nnN { - \fontdimen #1 \font = \__um_get_fontparam:nn {#2} {#3} + \fontdimen #1 \font = \the \fontdimen #2 #3 \relax } -\cs_new:Nn \__um_zero_fontparam:n +\cs_new:Nn \__um_zero_fontdimen:n { \fontdimen #1 \font = 0pt\relax } -\cs_new:Nn \__um_get_fontparam:nn +\cs_new_protected:Nn \__um_fontdimen_from_param:nn { - \directlua{fontspec.mathfontdimen("l__um_font","#2")} + \fontdimen #1 \font = \directlua{fontspec.mathfontdimen(font.current(),"#2")}\relax } \cs_new:Nn \usv_set:nnn { \tl_const:cn { c__um_#1_#2_usv } {#3} } \cs_new:Nn \__um_to_usv:nn { \use:c { c__um_#1_#2_usv } } @@ -137,13 +160,22 @@ { \tl_remove_once:Nn \@preamblecmds {\do#1} } +\cs_new:Npn \__um_error:n { \msg_error:nn {unicode-math} } +\cs_new:Npn \__um_error:nx { \msg_error:nnx {unicode-math} } +\cs_new:Npn \__um_warning:n { \msg_warning:nn {unicode-math} } +\cs_new:Npn \__um_warning:nnn { \msg_warning:nnxx {unicode-math} } +\cs_new:Npn \__um_log:n { \msg_log:nn {unicode-math} } +\cs_new:Npn \__um_log:nx { \msg_log:nnx {unicode-math} } +\cs_generate_variant:Nn \msg_new:nnn {nnx} +\cs_generate_variant:Nn \msg_new:nnnn {nnxx} +\cs_new:Nn \__um_msg_new:nn { \msg_new:nnx {unicode-math} {#1} { \tl_trim_spaces:n {#2} } } %%^^A%% um-code-variables.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Declaration of all code-level variables used in the package. \bool_new:N \l__um_ot_math_bool \bool_new:N \l__um_init_bool \bool_new:N \l__um_implicit_alph_bool -\bool_new:N \g__um_mainfont_already_set_bool \bool_new:N \g__um_literal_bool \bool_new:N \g__um_upLatin_bool \bool_new:N \g__um_uplatin_bool @@ -168,6 +200,8 @@ \bool_new:N \g__um_mathsf_text_bool \bool_new:N \g__um_mathtt_text_bool \int_new:N \g__um_fam_int +\int_new:N \g__um_fonts_used_int +\int_new:N \l__um_primecount_int \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} @@ -178,17 +212,31 @@ \tl_new:N \l__um_radicals_tl \tl_new:N \l__um_nolimits_tl \tl_new:N \g__um_operator_mathfont_tl -\seq_new:N \l__um_missing_alph_seq -\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 -\clist_new:N \g__um_alphabets_seq -\clist_set:Nn \g__um_alphabets_seq { latin, Latin, greek, Greek, num } -\clist_new:N \g__um_named_ranges_clist +\tl_new:N \g__um_slash_delimiter_usv +\tl_new:N \g__um_mathtable_tl +\tl_new:N \g__um_fontname_tl +\tl_new:N \g__um_mversion_tl +\tl_new:N \g__um_symfont_tl +\tl_new:N \g__um_font_keyval_tl +\tl_new:N \g__um_family_tl +\tl_new:N \g__um_style_tl +\tl_new:N \g__um_remap_style_tl +\tl_new:N \l__um_not_token_name_tl +\tl_new:N \g__um_curr_font_cmd_tl +\tl_new:N \g__um_sqrt_font_cmd_tl +\tl_new:N \g__um_prime_font_cmd_tl +\tl_new:N \g__um_mathparam_store_tl \clist_new:N \g__um_char_nrange_clist \clist_new:N \g__um_unknown_keys_clist \clist_new:N \g__um_alphabet_clist +\clist_new:N \g__um_bad_alpha_clist +\clist_put_right:Nx \g__um_bad_alpha_clist { \tl_to_str:n {bf} } +\clist_put_right:Nx \g__um_bad_alpha_clist { \tl_to_str:n {sf} } +\clist_put_right:Nx \g__um_bad_alpha_clist { \tl_to_str:n {bfsf} } +\seq_new:N \l__um_missing_alph_seq +\seq_new:N \g__um_mathalph_seq +\seq_new:N \g__um_char_range_seq +\seq_new:N \g__um_mclass_range_seq \seq_new:N \g__um_mathclasses_seq \seq_set_from_clist:Nn \g__um_mathclasses_seq { @@ -196,29 +244,20 @@ \mathop, \mathopen,\mathclose, \mathfence,\mathover,\mathunder, - \mathaccent,\mathbotaccent,\mathaccentwide,\mathbotaccentwide + \mathaccent,\mathaccentoverlay,\mathbotaccent,\mathaccentwide,\mathbotaccentwide } - \seq_new:N \g__um_default_mathalph_seq -\seq_new:N \g__um_named_ranges_seq \seq_new:N \g__um_mathstyles_seq -\muskip_new:N \g__um_primekern_muskip -\muskip_gset:Nn \g__um_primekern_muskip { -\thinmuskip/2 }% arbitrary -\int_new:N \l__um_primecount_int \prop_new:N \g__um_supers_prop \prop_new:N \g__um_subs_prop -\tl_new:N \l_not_token_name_tl -\tl_new:N \g__um_slash_delimiter_usv -\tl_new:N \g__um_mathtable_tl -\tl_new:N \g__um_fontname_tl -\tl_new:N \g__um_mversion_tl -\tl_new:N \g__um_symfont_tl -\tl_new:N \g__um_font_keyval_tl -\tl_new:N \g__um_family_tl -\tl_new:N \g__um_style_tl -\tl_new:N \g__um_remap_style_tl +\muskip_new:N \g__um_primekern_muskip +\muskip_gset:Nn \g__um_primekern_muskip { -\thinmuskip/2 }% arbitrary +\fp_new:N \g__um_size_tfsf_fp +\fp_new:N \g__um_size_sfssf_fp +\quark_new:N \q_unicode_math %%^^A%% um-code-api.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% The (underdeveloped) API to interface with the package internals. \cs_new:Nn \unimath_get_mathstyle: { @@ -226,6 +265,7 @@ } %%^^A%% um-code-ui.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% The xparse user interface top-level definitions. \NewDocumentCommand \unimathsetup {m} { \keys_set:nn {unicode-math} {#1} } \NewDocumentCommand \setmathfont { O{} m O{} } @@ -252,19 +292,20 @@ } %%^^A%% um-code-pkgopt.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Package options. \cs_new:Nn \__um_keys_choices:nn - { - \cs_set:Npn \__um_keys_choices_fn:nn { \__um_keys_choices_aux:nnn {#1} } - \use:x - { - \exp_not:N \keys_define:nn {unicode-math} - { - #1 .choice: , - \__um_tl_map_dbl:nN {#2} \__um_keys_choices_fn:nn - } - } - } + { + \cs_set:Npn \__um_keys_choices_fn:nn { \__um_keys_choices_aux:nnn {#1} } + \use:x + { + \exp_not:N \keys_define:nn {unicode-math} + { + #1 .choice: , + \__um_tl_map_dbl:nN {#2} \__um_keys_choices_fn:nn + } + } + } \cs_new:Nn \__um_keys_choices_aux:nnn { #1 / #2 .code:n = { \exp_not:n {#3} } , } \cs_new:Nn \__um_tl_map_dbl:nN { @@ -278,37 +319,37 @@ \__um_tl_map_dbl:Nnn #1 } \__um_keys_choices:nn {mathup} - { - {sym} { \bool_set_false:N \g__um_mathrm_text_bool } - {text} { \bool_set_true:N \g__um_mathrm_text_bool } - } + { + {sym} { \bool_set_false:N \g__um_mathrm_text_bool } + {text} { \bool_set_true:N \g__um_mathrm_text_bool } + } \__um_keys_choices:nn {mathrm} - { - {sym} { \bool_set_false:N \g__um_mathrm_text_bool } - {text} { \bool_set_true:N \g__um_mathrm_text_bool } - } + { + {sym} { \bool_set_false:N \g__um_mathrm_text_bool } + {text} { \bool_set_true:N \g__um_mathrm_text_bool } + } \__um_keys_choices:nn {mathit} - { - {sym} { \bool_set_false:N \g__um_mathit_text_bool } - {text} { \bool_set_true:N \g__um_mathit_text_bool } - } + { + {sym} { \bool_set_false:N \g__um_mathit_text_bool } + {text} { \bool_set_true:N \g__um_mathit_text_bool } + } \__um_keys_choices:nn {mathbf} - { - {sym} { \bool_set_false:N \g__um_mathbf_text_bool } - {text} { \bool_set_true:N \g__um_mathbf_text_bool } - } + { + {sym} { \bool_set_false:N \g__um_mathbf_text_bool } + {text} { \bool_set_true:N \g__um_mathbf_text_bool } + } \__um_keys_choices:nn {mathsf} - { - {sym} { \bool_set_false:N \g__um_mathsf_text_bool } - {text} { \bool_set_true:N \g__um_mathsf_text_bool } - } + { + {sym} { \bool_set_false:N \g__um_mathsf_text_bool } + {text} { \bool_set_true:N \g__um_mathsf_text_bool } + } \__um_keys_choices:nn {mathtt} - { - {sym} { \bool_set_false:N \g__um_mathtt_text_bool } - {text} { \bool_set_true:N \g__um_mathtt_text_bool } - } + { + {sym} { \bool_set_false:N \g__um_mathtt_text_bool } + {text} { \bool_set_true:N \g__um_mathtt_text_bool } + } \__um_keys_choices:nn {normal-style} - { + { {ISO} { \bool_set_false:N \g__um_literal_bool \bool_set_false:N \g__um_upGreek_bool @@ -340,9 +381,9 @@ {literal} { \bool_set_true:N \g__um_literal_bool } - } + } \__um_keys_choices:nn {math-style} - { + { {ISO} { \unimathsetup { nabla=upright, partial=italic, normal-style=ISO, bold-style=ISO, sans-style=italic } @@ -363,9 +404,9 @@ \unimathsetup { colon=literal, nabla=literal, partial=literal, normal-style=literal, bold-style=literal, sans-style=literal } } - } + } \__um_keys_choices:nn {bold-style} - { + { {ISO} { \bool_set_false:N \g__um_bfliteral_bool \bool_set_false:N \g__um_bfupGreek_bool @@ -390,67 +431,71 @@ {literal} { \bool_set_true:N \g__um_bfliteral_bool } - } + } \__um_keys_choices:nn {sans-style} - { - {italic} { \bool_set_false:N \g__um_upsans_bool } - {upright} { \bool_set_true:N \g__um_upsans_bool } - {literal} { \bool_set_true:N \g__um_sfliteral_bool } - } + { + {italic} { \bool_set_false:N \g__um_upsans_bool } + {upright} { \bool_set_true:N \g__um_upsans_bool } + {literal} { \bool_set_true:N \g__um_sfliteral_bool } + } \__um_keys_choices:nn {nabla} - { - {upright} { - \bool_set_false:N \g__um_literal_Nabla_bool - \bool_set_true:N \g__um_upNabla_bool - } - {italic} { - \bool_set_false:N \g__um_literal_Nabla_bool - \bool_set_false:N \g__um_upNabla_bool - } - {literal} { \bool_set_true:N \g__um_literal_Nabla_bool } - } + { + {upright} { + \bool_set_false:N \g__um_literal_Nabla_bool + \bool_set_true:N \g__um_upNabla_bool + } + {italic} { + \bool_set_false:N \g__um_literal_Nabla_bool + \bool_set_false:N \g__um_upNabla_bool + } + {literal} { + \bool_set_true:N \g__um_literal_Nabla_bool + } + } \__um_keys_choices:nn {partial} - { - {upright} { - \bool_set_false:N \g__um_literal_partial_bool - \bool_set_true:N \g__um_uppartial_bool - } - {italic} { - \bool_set_false:N \g__um_literal_partial_bool - \bool_set_false:N \g__um_uppartial_bool - } - {literal} { \bool_set_true:N \g__um_literal_partial_bool } - } + { + {upright} { + \bool_set_false:N \g__um_literal_partial_bool + \bool_set_true:N \g__um_uppartial_bool + } + {italic} { + \bool_set_false:N \g__um_literal_partial_bool + \bool_set_false:N \g__um_uppartial_bool + } + {literal} { + \bool_set_true:N \g__um_literal_partial_bool + } + } \__um_keys_choices:nn {colon} - { - {literal} { \bool_set_true:N \g__um_literal_colon_bool } - {TeX} { \bool_set_false:N \g__um_literal_colon_bool } - } + { + {literal} { \bool_set_true:N \g__um_literal_colon_bool } + {TeX} { \bool_set_false:N \g__um_literal_colon_bool } + } \__um_keys_choices:nn {slash-delimiter} - { - {ascii} { \tl_set:Nn \g__um_slash_delimiter_usv {"002F} } - {frac} { \tl_set:Nn \g__um_slash_delimiter_usv {"2044} } - {div} { \tl_set:Nn \g__um_slash_delimiter_usv {"2215} } - } + { + {ascii} { \tl_set:Nn \g__um_slash_delimiter_usv {"002F} } + {frac} { \tl_set:Nn \g__um_slash_delimiter_usv {"2044} } + {div} { \tl_set:Nn \g__um_slash_delimiter_usv {"2215} } + } \__um_keys_choices:nn {active-frac} - { - {small} - { - \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:} - } + { + {small} + { + \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:} + } - {normalsize} - { - \bool_set_false:N \l__um_smallfrac_bool - \use:c {__um_setup_active_frac:} - } - } + {normalsize} + { + \bool_set_false:N \l__um_smallfrac_bool + \use:c {__um_setup_active_frac:} + } + } \keys_define:nn {unicode-math} { warnings-off .code:n = @@ -460,11 +505,11 @@ } } \__um_keys_choices:nn {trace} - { - {on} {} % default - {debug} { \msg_redirect_module:nnn { unicode-math } { log } { warning } } - {off} { \msg_redirect_module:nnn { unicode-math } { log } { none } } - } + { + {on} {} % default + {debug} { \msg_redirect_module:nnn { unicode-math } { log } { warning } } + {off} { \msg_redirect_module:nnn { unicode-math } { log } { none } } + } \unimathsetup {math-style=TeX} \unimathsetup {slash-delimiter=ascii} \unimathsetup {trace=off} @@ -473,348 +518,362 @@ \ProcessKeysOptions {unicode-math} %%^^A%% um-code-msg.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Definitions of error, warning, and log messages. -\cs_new:Npn \__um_error:n { \msg_error:nn {unicode-math} } -\cs_new:Npn \__um_warning:n { \msg_warning:nn {unicode-math} } -\cs_new:Npn \__um_warning:nnn { \msg_warning:nnxx {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} +\char_set_catcode_space:n {32} +\__um_msg_new:nn {no-tfrac} { - Small~ fraction~ command~ \protect\tfrac\ not~ defined.\\ - Load~ amsmath~ or~ define~ it~ manually~ before~ loading~ unicode-math. + 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} +\__um_msg_new:nn {default-math-font} { - Defining~ the~ default~ maths~ font~ as~ '\l__um_fontname_tl'. + Defining the default maths font as '\l__um_fontname_tl'. } -\msg_new:nnn {unicode-math} {setup-implicit} +\__um_msg_new:nn {setup-implicit} { - Setup~ alphabets:~ implicit~ mode. + Setup alphabets: implicit mode. } -\msg_new:nnn {unicode-math} {setup-explicit} +\__um_msg_new:nn {setup-explicit} { - Setup~ alphabets:~ explicit~ mode. + Setup alphabets: explicit mode. } -\msg_new:nnn {unicode-math} {alph-initialise} +\__um_msg_new:nn {alph-initialise} { - Initialising~ \@backslashchar math#1. + Initialising \@backslashchar math#1. } -\msg_new:nnn {unicode-math} {setup-alph} +\__um_msg_new:nn {setup-alph} { - Setup~ alphabet:~ #1. + Setup alphabet: #1. } -\msg_new:nnn {unicode-math} {no-alphabet} +\__um_msg_new:nn {no-alphabet} { - I~ am~ trying~ to~ set~ up~ alphabet~"#1"~ but~ there~ are~ no~ configuration~ settings~ for~ it.~ - (See~ source~ file~ "unicode-math-alphabets.dtx"~ to~ debug.) + I am trying to set up alphabet"#1" but there are no configuration settings for it. + (See source file "unicode-math-alphabets.dtx" to debug.) } -\msg_new:nnn { unicode-math } { no-named-range } +\__um_msg_new:nn {no-named-range} { - I~ am~ trying~ to~ define~ new~ alphabet~ "#2"~ in~ range~ "#1",~ but~ range~ "#1"~ hasn't~ been~ defined~ yet. + I am trying to define new alphabet "#2" in range "#1", but range "#1" hasn't been defined yet. } -\msg_new:nnn { unicode-math } { missing-alphabets } +\__um_msg_new:nn {missing-alphabets} { - Missing~math~alphabets~in~font~ "\fontname\l__um_font" \\ \\ + Missingmathalphabetsinfont "\fontname\g__um_curr_font_cmd_tl" \\ \\ \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} +\__um_msg_new:nn {macro-expected} { - I've~ expected~ that~ #1~ is~ a~ macro,~ but~ it~ isn't. + I've expected that #1 is a macro, but it isn't. } -\msg_new:nnn {unicode-math} {wrong-meaning} +\__um_msg_new:nn {wrong-meaning} { - I've~ expected~ #1~ to~ have~ the~ meaning~ #3,~ but~ it~ has~ the~ meaning~ #2. + I've expected #1 to have the meaning #3, but it has the meaning #2. } -\msg_new:nnn {unicode-math} {patch-macro} +\__um_msg_new:nn {patch-macro} { - I'm~ going~ to~ patch~ macro~ #1. + I'm going to patch macro #1. } -\msg_new:nnn { unicode-math } { mathtools-overbracket } { - Using~ \token_to_str:N \overbracket\ and~ - \token_to_str:N \underbracket\ from~ - `mathtools'~ package.\\ +\__um_msg_new:nn {mathtools-overbracket} { + Using \token_to_str:N \overbracket\ and + \token_to_str:N \underbracket\ from + `mathtools' package.\\ \\ - Use~ \token_to_str:N \Uoverbracket\ and~ - \token_to_str:N \Uunderbracket\ for~ - original~ `unicode-math'~ definition. + Use \token_to_str:N \Uoverbracket\ and + \token_to_str:N \Uunderbracket\ for + original `unicode-math' definition. } -\msg_new:nnn { unicode-math } { mathtools-colon } { - 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,~ +\__um_msg_new:nn {mathtools-colon} { + 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. + 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,~ +\__um_msg_new:nn {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 \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. + 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. } +\__um_msg_new:nn {bad-cs-in-range} + { + Command `#1` in math range is not recognised as a maths symbol. + Check file "unicode-math-table.tex" for allowable commands. + } +\__um_msg_new:nn {legacy-char-not-supported} + { + Command `#1` is a legacy maths symbol that is not supported by unicode-math. + } +\__um_msg_new:nn {range-not-bf-sf} + { + Range alphabets cannot include alphabets referring to `bf`, `sf`, or `bfsf` + since they relate to input commands not output glyphs. + Use `bfit` or `bfup` (etc.) to specify which. + } +\char_set_catcode_ignore:n {32} %%^^A%% um-code-usv.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> - -\usv_set:nnn {normal} {num} {48} -\usv_set:nnn {normal} {Latin}{"1D434} -\usv_set:nnn {normal} {latin}{"1D44E} -\usv_set:nnn {normal} {Greek}{"1D6E2} -\usv_set:nnn {normal} {greek}{"1D6FC} -\usv_set:nnn {normal}{varTheta} {"1D6F3} -\usv_set:nnn {normal}{epsilon}{"1D716} -\usv_set:nnn {normal}{vartheta} {"1D717} -\usv_set:nnn {normal}{varkappa} {"1D718} -\usv_set:nnn {normal}{phi} {"1D719} -\usv_set:nnn {normal}{varrho} {"1D71A} -\usv_set:nnn {normal}{varpi} {"1D71B} -\usv_set:nnn {normal} {Nabla}{"1D6FB} -\usv_set:nnn {normal} {partial}{"1D715} - -\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}{epsilon}{"3F5} -\usv_set:nnn {up}{vartheta} {"3D1} -\usv_set:nnn {up}{varkappa} {"3F0} -\usv_set:nnn {up}{phi} {"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}{epsilon}{"1D6DC} -\usv_set:nnn {bfup}{vartheta} {"1D6DD} -\usv_set:nnn {bfup}{varkappa} {"1D6DE} -\usv_set:nnn {bfup}{phi} {"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}{epsilon}{"1D716} -\usv_set:nnn {it}{vartheta} {"1D717} -\usv_set:nnn {it}{varkappa} {"1D718} -\usv_set:nnn {it}{phi} {"1D719} -\usv_set:nnn {it}{varrho} {"1D71A} -\usv_set:nnn {it}{varpi} {"1D71B} -\usv_set:nnn {bfit}{varTheta} {"1D72D} -\usv_set:nnn {bfit}{epsilon}{"1D750} -\usv_set:nnn {bfit}{vartheta} {"1D751} -\usv_set:nnn {bfit}{varkappa} {"1D752} -\usv_set:nnn {bfit}{phi} {"1D753} -\usv_set:nnn {bfit}{varrho} {"1D754} -\usv_set:nnn {bfit}{varpi} {"1D755} -\usv_set:nnn {bfsfup}{varTheta} {"1D767} -\usv_set:nnn {bfsfup}{epsilon}{"1D78A} -\usv_set:nnn {bfsfup}{vartheta} {"1D78B} -\usv_set:nnn {bfsfup}{varkappa} {"1D78C} -\usv_set:nnn {bfsfup}{phi} {"1D78D} -\usv_set:nnn {bfsfup}{varrho} {"1D78E} -\usv_set:nnn {bfsfup}{varpi} {"1D78F} -\usv_set:nnn {bfsfit}{varTheta} {"1D7A1} -\usv_set:nnn {bfsfit}{epsilon}{"1D7C4} -\usv_set:nnn {bfsfit}{vartheta} {"1D7C5} -\usv_set:nnn {bfsfit}{varkappa} {"1D7C6} -\usv_set:nnn {bfsfit}{phi} {"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} +%%^^A%% Mapping of mathematical unicode slots for alphabets. + +\usv_set:nnn {normal} {num} {48} +\usv_set:nnn {normal} {Latin} {"1D434} +\usv_set:nnn {normal} {latin} {"1D44E} +\usv_set:nnn {normal} {Greek} {"1D6E2} +\usv_set:nnn {normal} {greek} {"1D6FC} +\usv_set:nnn {normal} {varTheta} {"1D6F3} +\usv_set:nnn {normal} {epsilon} {"1D716} +\usv_set:nnn {normal} {vartheta} {"1D717} +\usv_set:nnn {normal} {varkappa} {"1D718} +\usv_set:nnn {normal} {phi} {"1D719} +\usv_set:nnn {normal} {varrho} {"1D71A} +\usv_set:nnn {normal} {varpi} {"1D71B} +\usv_set:nnn {normal} {Nabla} {"1D6FB} +\usv_set:nnn {normal} {partial} {"1D715} +\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} {epsilon} {"3F5} +\usv_set:nnn {up} {vartheta} {"3D1} +\usv_set:nnn {up} {varkappa} {"3F0} +\usv_set:nnn {up} {phi} {"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} {epsilon} {"1D6DC} +\usv_set:nnn {bfup} {vartheta} {"1D6DD} +\usv_set:nnn {bfup} {varkappa} {"1D6DE} +\usv_set:nnn {bfup} {phi} {"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} {epsilon} {"1D716} +\usv_set:nnn {it} {vartheta} {"1D717} +\usv_set:nnn {it} {varkappa} {"1D718} +\usv_set:nnn {it} {phi} {"1D719} +\usv_set:nnn {it} {varrho} {"1D71A} +\usv_set:nnn {it} {varpi} {"1D71B} +\usv_set:nnn {bfit} {varTheta} {"1D72D} +\usv_set:nnn {bfit} {epsilon} {"1D750} +\usv_set:nnn {bfit} {vartheta} {"1D751} +\usv_set:nnn {bfit} {varkappa} {"1D752} +\usv_set:nnn {bfit} {phi} {"1D753} +\usv_set:nnn {bfit} {varrho} {"1D754} +\usv_set:nnn {bfit} {varpi} {"1D755} +\usv_set:nnn {bfsfup} {varTheta} {"1D767} +\usv_set:nnn {bfsfup} {epsilon} {"1D78A} +\usv_set:nnn {bfsfup} {vartheta} {"1D78B} +\usv_set:nnn {bfsfup} {varkappa} {"1D78C} +\usv_set:nnn {bfsfup} {phi} {"1D78D} +\usv_set:nnn {bfsfup} {varrho} {"1D78E} +\usv_set:nnn {bfsfup} {varpi} {"1D78F} +\usv_set:nnn {bfsfit} {varTheta} {"1D7A1} +\usv_set:nnn {bfsfit} {epsilon} {"1D7C4} +\usv_set:nnn {bfsfit} {vartheta} {"1D7C5} +\usv_set:nnn {bfsfit} {varkappa} {"1D7C6} +\usv_set:nnn {bfsfit} {phi} {"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} %%^^A%% um-code-setchar.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% General assignment of maths symbols. \cs_new:Npn \__um_symbol_setup: { @@ -835,7 +894,7 @@ { \mathord \mathalpha \mathbin \mathrel \mathpunct \mathop \mathfence } {##3} { - \exp_last_unbraced:NNx \cs_gset_eq:NN ##2 { \Ucharcat ##1 ~ 12 ~ } + \exp_last_unbraced:NNx \cs_gset_eq:NN ##2 { \char_generate:nn {##1} {12} } } } \__um_input_math_symbol_table: @@ -875,6 +934,8 @@ { \__um_set_math_overunder:Nnnn #2 {} {#1} {#4} } \mathunder { \__um_set_math_overunder:Nnnn #2 {bottom} {#1} {#4} } + \mathaccentoverlay + { \__um_set_math_accent:Nnnn #2 {overlay~ fixed} {#1} {#4} } } } \edef\mathfence{\string\mathfence} @@ -882,6 +943,7 @@ \edef\mathunder{\string\mathunder} \edef\mathbotaccent{\string\mathbotaccent} \edef\mathaccentwide{\string\mathaccentwide} +\edef\mathaccentoverlay{\string\mathaccentoverlay} \edef\mathbotaccentwide{\string\mathbotaccentwide} \cs_new:Nn \__um_set_big_operator:nnn { @@ -938,72 +1000,67 @@ \cs_gset_protected_nopar:Npx #1 ##1 { \mathop - { \__um_accent:nnn {#2} {#3} {#4} {##1} } + { \__um_accent:nnn {#2} {#3} {#4} {{}##1} } + % TODO: remove braces above ^^ which work around a LuaTeX bug \limits } } %%^^A%% um-code-mathtext.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% The "math text" commands such as `\mathbf` and co. \keys_define:nn {__um_mathface} - { - version .code:n = - { \tl_set:Nn \l__um_mversion_tl {#1} } - } + { + version .tl_set:N = \l__um_mversion_tl + } \cs_set:Nn \__um_setmathfontface:Nnn - { - \tl_clear:N \l__um_mversion_tl + { + \tl_clear:N \l__um_mversion_tl - \keys_set_known:nnN {__um_mathface} {#2} \l__um_keyval_clist + \keys_set_known:nnN {__um_mathface} {#2} \l__um_keyval_clist - \exp_args:Nnx \fontspec_set_family:Nxn \l__um_tmpa_tl - { ItalicFont={}, BoldFont={}, \exp_not:V \l__um_keyval_clist } {#3} + \exp_args:Nnx \fontspec_set_family:Nxn \l__um_tmpa_tl + { ItalicFont={}, BoldFont={}, \exp_not:V \l__um_keyval_clist } {#3} - \tl_if_empty:NT \l__um_mversion_tl - { - \tl_set:Nn \l__um_mversion_tl {normal} - \DeclareMathAlphabet #1 {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault} - } + \tl_if_empty:NT \l__um_mversion_tl + { + \tl_set:Nn \l__um_mversion_tl {normal} + \DeclareMathAlphabet #1 {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault} + } - \SetMathAlphabet #1 {\l__um_mversion_tl} {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault} + \SetMathAlphabet #1 {\l__um_mversion_tl} {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault} - % integrate with fontspec's \setmathrm etc: - \tl_case:Nn #1 - { - \mathrm { \cs_set_eq:NN \g__fontspec_mathrm_tl \l__um_tmpa_tl } - \mathsf { \cs_set_eq:NN \g__fontspec_mathsf_tl \l__um_tmpa_tl } - \mathtt { \cs_set_eq:NN \g__fontspec_mathtt_tl \l__um_tmpa_tl } - } - } + % integrate with fontspec's \setmathrm etc: + \tl_case:Nn #1 + { + \mathrm { \cs_set_eq:NN \g__fontspec_mathrm_tl \l__um_tmpa_tl } + \mathsf { \cs_set_eq:NN \g__fontspec_mathsf_tl \l__um_tmpa_tl } + \mathtt { \cs_set_eq:NN \g__fontspec_mathtt_tl \l__um_tmpa_tl } + } + } \cs_generate_variant:Nn \tl_if_eq:nnT {o} \cs_set:Nn \__fontspec_setmainfont_hook:nn { \tl_if_eq:onT {\g__fontspec_mathrm_tl} {\rmdefault} { \fontspec_set_family:Nnn \g__fontspec_mathrm_tl {Renderer=Basic,#1} {#2} - \SetMathAlphabet\mathrm{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\updefault - \SetMathAlphabet\mathit{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\itdefault - \SetMathAlphabet\mathbf{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\bfdefault\updefault + \__fontspec_setmathrm_hook:nn {#1} {#2} } } - \cs_set:Nn \__fontspec_setsansfont_hook:nn { \tl_if_eq:onT {\g__fontspec_mathsf_tl} {\sfdefault} { \fontspec_set_family:Nnn \g__fontspec_mathsf_tl {Renderer=Basic,#1} {#2} - \SetMathAlphabet\mathsf{normal}\g_fontspec_encoding_tl\g__fontspec_mathsf_tl\mddefault\updefault - \SetMathAlphabet\mathsf{bold} \g_fontspec_encoding_tl\g__fontspec_mathsf_tl\bfdefault\updefault + \__fontspec_setmathsf_hook:nn {#1} {#2} } } - \cs_set:Nn \__fontspec_setmonofont_hook:nn { \tl_if_eq:onT {\g__fontspec_mathtt_tl} {\ttdefault} { \fontspec_set_family:Nnn \g__fontspec_mathtt_tl {Renderer=Basic,#1} {#2} - \SetMathAlphabet\mathtt{normal}\g_fontspec_encoding_tl\g__fontspec_mathtt_tl\mddefault\updefault - \SetMathAlphabet\mathtt{bold} \g_fontspec_encoding_tl\g__fontspec_mathtt_tl\bfdefault\updefault + \__fontspec_setmathtt_hook:nn {#1} {#2} } } \cs_set:Nn \__fontspec_setmathrm_hook:nn @@ -1028,185 +1085,278 @@ \SetMathAlphabet\mathtt{normal}\g_fontspec_encoding_tl\g__fontspec_mathtt_tl\mddefault\updefault \SetMathAlphabet\mathtt{bold} \g_fontspec_encoding_tl\g__fontspec_mathtt_tl\bfdefault\updefault } +\tl_if_eq:onF {\g__fontspec_mathrm_tl} {\rmdefault} { \__fontspec_setmathrm_hook:nn {} {} } +\tl_if_eq:onF {\g__fontspec_mathsf_tl} {\sfdefault} { \__fontspec_setmathsf_hook:nn {} {} } +\tl_if_eq:onF {\g__fontspec_mathtt_tl} {\ttdefault} { \__fontspec_setmathtt_hook:nn {} {} } +\AtBeginDocument + { + \tl_if_eq:onT {\g__fontspec_mathrm_tl} {\rmdefault} { \__fontspec_setmathrm_hook:nn {} {} } + \tl_if_eq:onT {\g__fontspec_mathsf_tl} {\sfdefault} { \__fontspec_setmathsf_hook:nn {} {} } + \tl_if_eq:onT {\g__fontspec_mathtt_tl} {\ttdefault} { \__fontspec_setmathtt_hook:nn {} {} } + } %%^^A%% um-code-main.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Definition of `\setmainfont`. \cs_set:Nn \__um_setmathfont:nn { - \tl_set:Nn \l__um_fontname_tl {#2} + + \__um_init:n {#2} \cs_set_eq:NN \glb@currsize \scan_stop: - \__um_init: \cs_if_exist:cF { S@ \f@size } { \calculate@math@sizes } - \csname S@\f@size\endcsname + \use:c { S@ \f@size } + \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: - \bool_if:nT { \l__um_ot_math_bool && !\g__um_mainfont_already_set_bool } + + \bool_if:NT \l__um_init_bool { + \__um_fontspec_trial_font: \__um_declare_math_sizes: - \__um_fontspec_select_font: - } - \cs_if_exist:cF { sym \l__um_symfont_label_tl } - { - \DeclareSymbolFont{\l__um_symfont_label_tl} - {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault} } - \SetSymbolFont{\l__um_symfont_label_tl}{\l__um_mversion_tl} - {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault} - \str_if_eq_x:nnT {\l__um_mversion_tl} {normal} - { - \SetSymbolFont{\l__um_symfont_label_tl}{bold} - {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault} - } - \bool_if:nT { \l__um_ot_math_bool && !\g__um_mainfont_already_set_bool } + \__um_fontspec_select_font: + \__um_setup_math_fam: + \bool_if:NT \l__um_init_bool { - \bool_set_true:N \g__um_mainfont_already_set_bool \__um_setup_legacy_fam_two: \__um_setup_legacy_fam_three: } + \__um_input_math_symbol_table: + + \bool_if:NT \l__um_init_bool \__um_onceoff_setup: \__um_remap_symbols: \__um_setup_mathactives: \__um_setup_delcodes: \__um_setup_alphabets: - \__um_setup_negations: + + %% TODO: what of the above should only be run for the "default"/"main" font? + + \bool_if:NTF \l__um_init_bool + { + \__um_mathparam_store: + \__um_log:n {default-math-font} + } + { + \__um_mathparam_restore: + } } \AtBeginDocument { \__um_load_lm_if_necessary: } \cs_new:Nn \__um_load_lm_if_necessary: { \cs_if_exist:NF \l__um_fontname_tl { - % TODO: update this when lmmath-bold.otf is released - \setmathfont{latinmodern-math.otf}[BoldFont={latinmodern-math.otf}] - \bool_set_false:N \g__um_mainfont_already_set_bool + \setmathfont{latinmodern-math.otf} + [BoldFont={latinmodern-math.otf}] } } -\cs_new:Nn \__um_init: +\cs_new:Nn \__um_init:n { + \tl_set:Nn \l__um_fontname_tl {#1} \bool_set_true:N \l__um_ot_math_bool - \tl_set:Nn \l__um_mversion_tl {normal} + \tl_set:Nn \l__um_mversion_tl {normal} \tl_set:Nn \l__um_symfont_label_tl {operators} + \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 + \bool_set_true:N \l__um_init_bool - \seq_clear:N \l__um_char_range_seq - \clist_clear:N \l__um_char_nrange_clist - \seq_clear:N \l__um_mathalph_seq + \seq_gclear:N \g__um_char_range_seq + \clist_clear:N \l__um_mathmap_charints_clist + \seq_gclear:N \g__um_mathalph_seq \seq_clear:N \l__um_missing_alph_seq - \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 + + \cs_set_eq:NN \__um_sym:nnn \__um_process_symbol_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_assign_delcode:nn \__um_assign_delcode_noparse:nn + \cs_set_eq:NN \__um_make_mathactive:nNN \__um_make_mathactive_noparse:nNN } +\tl_new:N \g__um_main_font_cmd_tl \cs_new:Nn \__um_declare_math_sizes: { - \fp_compare:nF { \__um_script_style_size:n {ScriptPercentScaleDown} == 0 } + \dim_compare:nF { \fontdimen 10 \g__um_trial_font == 0pt } { \DeclareMathSizes { \f@size } { \f@size } - { \__um_script_style_size:n {ScriptPercentScaleDown} } - { \__um_script_style_size:n {ScriptScriptPercentScaleDown} } + { \__um_fontdimen_to_scale:nN {10} \g__um_trial_font } + { \__um_fontdimen_to_scale:nN {11} \g__um_trial_font } + } + } +\cs_new:Nn \__um_fontspec_trial_font: + { + \tl_set:Nx \l__um_font_keyval_tl + { + Renderer = Basic, + BoldItalicFont = {}, ItalicFont = {}, + Script = Math, + FontAdjustment = { \g__um_luatex_copy_fontdimens_tl }, + \l__um_unknown_keys_clist + } + + \fontspec_set_family:Nxn \l__um_trial_family_tl {\l__um_font_keyval_tl} {\l__um_fontname_tl} + + \group_begin: + \fontfamily { \l__um_trial_family_tl } \selectfont + \__um_fontface_gset_eq:NV \g__um_trial_font \font@name + \fontspec_if_script:nF {math} + { + \bool_gset_false:N \l__um_ot_math_bool + \bool_gset_false:N \l__um_init_bool + } + \group_end: + + } +\cs_new:Nn \__um_fontspec_select_font: + { + \fp_gset:Nn \g__um_size_tfsf_fp { (\f@size +\sf@size )/2 } + \fp_gset:Nn \g__um_size_sfssf_fp { (\sf@size+\ssf@size)/2 } + + \tl_set:Nx \l__um_font_keyval_tl + { + Renderer = Basic, + BoldItalicFont = {}, ItalicFont = {}, + Script = Math, + SizeFeatures = + { + { + Size = \fp_use:N \g__um_size_tfsf_fp - + } , + { + Size = \fp_use:N \g__um_size_sfssf_fp - \fp_use:N \g__um_size_tfsf_fp , + Font = \l__um_script_font_tl , + \l__um_script_features_tl + } , + { + Size = - \fp_use:N \g__um_size_sfssf_fp , + Font = \l__um_sscript_font_tl , + \l__um_sscript_features_tl + } + } , + FontAdjustment = { \g__um_luatex_copy_fontdimens_tl }, + \l__um_unknown_keys_clist } + + \fontspec_set_family:Nxn \l__um_family_tl {\l__um_font_keyval_tl} {\l__um_fontname_tl} + + \int_gincr:N \g__um_fonts_used_int + \group_begin: + \fontfamily { \l__um_family_tl } \selectfont + \__um_fontface_gset_eq:cV {g__um_mathfont_ \int_use:N \g__um_fonts_used_int _font} \font@name + \tl_gset:Nx \g__um_curr_font_cmd_tl { \exp_not:c {g__um_mathfont_ \int_use:N \g__um_fonts_used_int _font} } + \bool_if:NT \l__um_init_bool +{ +\__um_fontface_gset_eq:NV \l__um_font \font@name +} + \fontspec_if_script:nF {math} + { + \bool_gset_false:N \l__um_ot_math_bool + \bool_gset_false:N \l__um_init_bool + } + \group_end: } -\cs_new:Nn \__um_script_style_size:n +\tl_set:Nn \g__um_main_font_cmd_tl { \l__um_font } +\tl_set:Nn \g__um_sqrt_font_cmd_tl { \l__um_font } +\tl_set:Nn \g__um_prime_font_cmd_tl { \l__um_font } +\tl_const:Nn \g__um_luatex_copy_fontdimens_tl { - \fp_eval:n {\directlua{tex.sprint(luaotfload.aux.get_math_dimension("l__um_font","#1"))} * \f@size / 100 } + \__um_fontdimen_from_param:nn {10} {ScriptPercentScaleDown} + \__um_fontdimen_from_param:nn {11} {ScriptScriptPercentScaleDown} + \__um_fontdimen_from_param:nn {15} {AxisHeight} + \__um_fontdimen_from_param:nn {18} {SubscriptShiftDown} + \__um_fontdimen_from_param:nn {20} {SubscriptBaselineDropMin} + \__um_fontdimen_from_param:nn {21} {SuperscriptShiftUp} + \__um_fontdimen_from_param:nn {22} {SuperscriptShiftUpCramped} + \__um_fontdimen_from_param:nn {24} {SuperscriptBaselineDropMax} + \__um_fontdimen_from_param:nn {28} {UpperLimitGapMin} + \__um_fontdimen_from_param:nn {29} {UpperLimitBaselineRiseMin} + \__um_fontdimen_from_param:nn {30} {LowerLimitGapMin} + \__um_fontdimen_from_param:nn {31} {LowerLimitBaselineDropMin} + \__um_fontdimen_from_param:nn {32} {StackTopShiftUp} + \__um_fontdimen_from_param:nn {42} {FractionNumeratorShiftUp} + \__um_fontdimen_from_param:nn {43} {FractionNumeratorDisplayStyleShiftUp} + \__um_fontdimen_from_param:nn {44} {FractionDenominatorShiftDown} + \__um_fontdimen_from_param:nn {45} {FractionDenominatorDisplayStyleShiftDown} + \__um_fontdimen_from_param:nn {48} {FractionRuleThickness} + } +\cs_new:Nn \__um_setup_math_fam: + { + \cs_if_exist:cF { sym \l__um_symfont_label_tl } + { + \DeclareSymbolFont{\l__um_symfont_label_tl} + {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault} + } + \SetSymbolFont{\l__um_symfont_label_tl}{\l__um_mversion_tl} + {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault} + \str_if_eq_x:nnT {\l__um_mversion_tl} {normal} + { + \SetSymbolFont{\l__um_symfont_label_tl}{bold} + {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault} + } } \cs_new:Nn \__um_setup_legacy_fam_two: { - \fontspec_set_family:Nxn \l__um_family_tl + \fontspec_set_family:Nxn \l__um_fam_two_tl { \l__um_font_keyval_tl, Scale=1.00001, FontAdjustment = { - \__um_copy_fontparam:nnn { 8} {43} {FractionNumeratorDisplayStyleShiftUp}\relax - \__um_copy_fontparam:nnn { 9} {42} {FractionNumeratorShiftUp}\relax - \__um_copy_fontparam:nnn {10} {32} {StackTopShiftUp}\relax - \__um_copy_fontparam:nnn {11} {45} {FractionDenominatorDisplayStyleShiftDown}\relax - \__um_copy_fontparam:nnn {12} {44} {FractionDenominatorShiftDown}\relax - \__um_copy_fontparam:nnn {13} {21} {SuperscriptShiftUp}\relax - \__um_copy_fontparam:nnn {14} {21} {SuperscriptShiftUp}\relax - \__um_copy_fontparam:nnn {15} {22} {SuperscriptShiftUpCramped}\relax - \__um_copy_fontparam:nnn {16} {18} {SubscriptShiftDown}\relax - \__um_copy_fontparam:nnn {17} {18} {SubscriptShiftDownWithSuperscript}\relax - \__um_copy_fontparam:nnn {18} {24} {SuperscriptBaselineDropMax}\relax - \__um_copy_fontparam:nnn {19} {20} {SubscriptBaselineDropMin}\relax - \__um_zero_fontparam:n {20} % delim1 = FractionDelimiterDisplaySize - \__um_zero_fontparam:n {21} % delim2 = FractionDelimiterSize - \__um_copy_fontparam:nnn {22} {15} {AxisHeight}\relax + \__um_copy_fontdimen:nnN { 8} {43} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN { 9} {42} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {10} {32} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {11} {45} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {12} {44} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {13} {21} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {14} {21} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {15} {22} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {16} {18} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {17} {18} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {18} {24} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {19} {20} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {22} {15} \g__um_main_font_cmd_tl + \__um_zero_fontdimen:n {20} % delim1 = FractionDelimiterDisplaySize + \__um_zero_fontdimen:n {21} % delim2 = FractionDelimiterSize } } {\l__um_fontname_tl} \SetSymbolFont{symbols}{\l__um_mversion_tl} - {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault} + {\encodingdefault}{\l__um_fam_two_tl}{\mddefault}{\updefault} \str_if_eq_x:nnT {\l__um_mversion_tl} {normal} { \SetSymbolFont{symbols}{bold} - {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault} + {\encodingdefault}{\l__um_fam_two_tl}{\bfdefault}{\updefault} } } \cs_new:Nn \__um_setup_legacy_fam_three: { - \fontspec_set_family:Nxn \l__um_family_tl + \fontspec_set_family:Nxn \l__um_fam_three_tl { \l__um_font_keyval_tl, Scale=0.99999, FontAdjustment = { - \__um_copy_fontparam:nnn { 8} {48} {FractionRuleThickness}\relax - \__um_copy_fontparam:nnn { 9} {28} {UpperLimitGapMin}\relax - \__um_copy_fontparam:nnn {10} {30} {LowerLimitGapMin}\relax - \__um_copy_fontparam:nnn {11} {29} {UpperLimitBaselineRiseMin}\relax - \__um_copy_fontparam:nnn {12} {31} {LowerLimitBaselineDropMin}\relax - \__um_zero_fontparam:n {13} + \__um_copy_fontdimen:nnN { 8} {48} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN { 9} {28} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {10} {30} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {11} {29} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {12} {31} \g__um_main_font_cmd_tl + \__um_zero_fontdimen:n {13} } } {\l__um_fontname_tl} \SetSymbolFont{largesymbols}{\l__um_mversion_tl} - {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault} + {\encodingdefault}{\l__um_fam_three_tl}{\mddefault}{\updefault} \str_if_eq_x:nnT {\l__um_mversion_tl} {normal} { \SetSymbolFont{largesymbols}{bold} - {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault} + {\encodingdefault}{\l__um_fam_three_tl}{\bfdefault}{\updefault} } } -\cs_new:Nn \__um_fontspec_select_font: +\cs_new:Nn \__um_onceoff_setup: { - \tl_set:Nx \l__um_font_keyval_tl { - Renderer = Basic, - BoldItalicFont = {}, 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: + \__um_set_delcode:nnn {operators} {`\.} {\c_zero} } \cs_set:Nn \__um_process_symbol_noparse:nnn { @@ -1214,23 +1364,23 @@ } \cs_set:Nn \__um_process_symbol_parse:nnn { - \__um_if_char_spec:nNNT {#1} {#2} {#3} + \__um_if_char_spec:nNT {#1} {#3} { \__um_process_symbol_noparse:nnn {#1} {#2} {#3} } } -\cs_new:Npn \__um_remap_symbols: +\cs_new:Nn \__um_remap_symbols: { - \__um_remap_symbol:nnn{`\-}{\mathbin}{"02212}% hyphen to minus - \__um_remap_symbol:nnn{`\*}{\mathbin}{"02217}% text asterisk to "centred asterisk" + \__um_remap_symbol:nnn {`\-} {\mathbin} {"2212} + \__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) + \__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_if_char_spec:nNT {#3} {#2} { \__um_remap_symbol_noparse:nnn {#1} {#2} {#3} } } \cs_new:Nn \__um_remap_symbol_noparse:nnn @@ -1240,19 +1390,19 @@ } \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 {"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_if_char_spec:nNT {#1} #3 { \__um_make_mathactive_noparse:nNN {#1} #2 #3 } } \cs_new:Nn \__um_make_mathactive_noparse:nNN @@ -1266,7 +1416,7 @@ } \cs_new:Nn \__um_assign_delcode_parse:nn { - \__um_if_char_spec:nNNT {#2} {\@nil} {\@nil} + \__um_if_char_spec:nNT {#2} \@nil { \__um_assign_delcode_noparse:nn {#1} {#2} } @@ -1274,10 +1424,6 @@ \cs_new:Nn \__um_assign_delcode:n { \__um_assign_delcode:nn {#1} {#1} } \cs_new:Npn \__um_setup_delcodes: { - % ensure \left. and \right. work: - \__um_set_delcode:nnn \l__um_symfont_label_tl {`\.} {\c_zero} - % this is forcefully done to fix a bug -- indicates a larger problem! - \__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 @@ -1321,8 +1467,73 @@ \intcap\intcup\upint\lowint } \tl_set:Nn \l__um_radicals_tl {\sqrt \longdivision} +\cs_set:Nn \__um_mathparam_restore: + { + \check@mathfonts + \tl_use:N \g__um_mathparam_store_tl + } +\cs_set:Nn \__um_mathparam_store: + { + \check@mathfonts + \tl_gset:Nx \g__um_mathparam_store_tl + { + \__um_mathparam_store_aux:N \displaystyle + \__um_mathparam_store_aux:N \textstyle + \__um_mathparam_store_aux:N \scriptstyle + \__um_mathparam_store_aux:N \scriptscriptstyle + } + } +\cs_set:Nn \__um_mathparam_store_aux:N + { + \Umathquad #1 = \the \Umathquad #1 + \Umathaxis #1 = \the \Umathaxis #1 + \Umathoperatorsize #1 = \the \Umathoperatorsize #1 + \Umathoverbarkern #1 = \the \Umathoverbarkern #1 + \Umathoverbarrule #1 = \the \Umathoverbarrule #1 + \Umathoverbarvgap #1 = \the \Umathoverbarvgap #1 + \Umathunderbarkern #1 = \the \Umathunderbarkern #1 + \Umathunderbarrule #1 = \the \Umathunderbarrule #1 + \Umathunderbarvgap #1 = \the \Umathunderbarvgap #1 + \Umathradicalkern #1 = \the \Umathradicalkern #1 + \Umathradicalrule #1 = \the \Umathradicalrule #1 + \Umathradicalvgap #1 = \the \Umathradicalvgap #1 + \Umathradicaldegreebefore #1 = \the \Umathradicaldegreebefore #1 + \Umathradicaldegreeafter #1 = \the \Umathradicaldegreeafter #1 + \Umathradicaldegreeraise #1 = \the \Umathradicaldegreeraise #1 + \Umathstackvgap #1 = \the \Umathstackvgap #1 + \Umathstacknumup #1 = \the \Umathstacknumup #1 + \Umathstackdenomdown #1 = \the \Umathstackdenomdown #1 + \Umathfractionrule #1 = \the \Umathfractionrule #1 + \Umathfractionnumvgap #1 = \the \Umathfractionnumvgap #1 + \Umathfractionnumup #1 = \the \Umathfractionnumup #1 + \Umathfractiondenomvgap #1 = \the \Umathfractiondenomvgap #1 + \Umathfractiondenomdown #1 = \the \Umathfractiondenomdown #1 + \Umathfractiondelsize #1 = \the \Umathfractiondelsize #1 + \Umathlimitabovevgap #1 = \the \Umathlimitabovevgap #1 + \Umathlimitabovebgap #1 = \the \Umathlimitabovebgap #1 + \Umathlimitabovekern #1 = \the \Umathlimitabovekern #1 + \Umathlimitbelowvgap #1 = \the \Umathlimitbelowvgap #1 + \Umathlimitbelowbgap #1 = \the \Umathlimitbelowbgap #1 + \Umathlimitbelowkern #1 = \the \Umathlimitbelowkern #1 + \Umathoverdelimitervgap #1 = \the \Umathoverdelimitervgap #1 + \Umathoverdelimiterbgap #1 = \the \Umathoverdelimiterbgap #1 + \Umathunderdelimitervgap #1 = \the \Umathunderdelimitervgap #1 + \Umathunderdelimiterbgap #1 = \the \Umathunderdelimiterbgap #1 + \Umathsubshiftdrop #1 = \the \Umathsubshiftdrop #1 + \Umathsubshiftdown #1 = \the \Umathsubshiftdown #1 + \Umathsupshiftdrop #1 = \the \Umathsupshiftdrop #1 + \Umathsupshiftup #1 = \the \Umathsupshiftup #1 + \Umathsubsupshiftdown #1 = \the \Umathsubsupshiftdown #1 + \Umathsubtopmax #1 = \the \Umathsubtopmax #1 + \Umathsupbottommin #1 = \the \Umathsupbottommin #1 + \Umathsupsubbottommax #1 = \the \Umathsupsubbottommax #1 + \Umathsubsupvgap #1 = \the \Umathsubsupvgap #1 + \Umathspaceafterscript #1 = \the \Umathspaceafterscript #1 + \Umathconnectoroverlapmin #1 = \the \Umathconnectoroverlapmin #1 + } %%^^A%% um-code-fontopt.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Keyval for `\setmathfont` \keys_define:nn {unicode-math} { @@ -1333,100 +1544,124 @@ } } \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 , - } + { + 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 , + } \keys_define:nn {unicode-math} - { - range .code:n = - { - \bool_set_false:N \l__um_init_bool + { + range .code:n = + { + \bool_set_false:N \l__um_init_bool + \__um_range_init: + \group_begin: + \seq_map_inline:Nn \g__um_mathclasses_seq + { + \cs_set:Npn ##1 { \use_none:n \q_unicode_math \exp_not:N ##1 } + } + \cs_set:Npn \__um_sym:nnn ##1 ##2 ##3 + { + \cs_set:Npn ##2 { \use_none:n \q_unicode_math ##1 } + } + \__um_input_math_symbol_table: + \__um_range_process:n {#1} + \group_end: + } + } +\cs_new:Nn \__um_range_init: + { \int_incr:N \g__um_fam_int \tl_set:Nx \l__um_symfont_label_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 - + \seq_gclear:N \g__um_char_range_seq + \seq_gclear:N \g__um_mclass_range_seq + \seq_gclear:N \g__um_mathalph_seq + } +\cs_new:Nn \__um_range_process:n + { \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_lazy_and:nnTF { \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} } - } - } - } - } - } -\prg_new_conditional:Nnn \__um_if_mathalph_decl:n {TF} - { - \tl_set:Nn \l__um_tmpa_tl {#1} - \tl_clear:N \l__um_tmpb_tl - \tl_clear:N \l__um_tmpc_tl + { + \__um_mathalph_decl:nF {##1} { \__um_range_decl:n {##1} } + } +} +\cs_new:Nn \__um_mathalph_decl:nF + { - \tl_if_in:NnT \l__um_tmpa_tl {->} - { \exp_after:wN \__um_split_arrow:w \l__um_tmpa_tl \q_nil } + \tl_set:Nn \l__um_tmpa_tl {#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_slash:w \l__um_tmpa_tl \q_nil } + \tl_if_in:NnT \l__um_tmpa_tl {->} + { \exp_after:wN \__um_split_arrow:w \l__um_tmpa_tl \q_nil } - \tl_set:Nx \l__um_tmpa_tl { \tl_to_str:N \l__um_tmpa_tl } - \exp_args:NNx \tl_remove_all:Nn \l__um_tmpa_tl { \token_to_str:N \math } - \exp_args:NNx \tl_remove_all:Nn \l__um_tmpa_tl { \token_to_str:N \sym } - \tl_trim_spaces:N \l__um_tmpa_tl + \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 } + \tl_set:Nx \l__um_tmpa_tl { \tl_to_str:N \l__um_tmpa_tl } + \exp_args:NNx \tl_remove_all:Nn \l__um_tmpa_tl { \token_to_str:N \math } + \exp_args:NNx \tl_remove_all:Nn \l__um_tmpa_tl { \token_to_str:N \sym } + \tl_trim_spaces:N \l__um_tmpa_tl - \seq_if_in:NVTF \g__um_named_ranges_seq \l__um_tmpa_tl - { \prg_return_true: } { \prg_return_false: } - } + \tl_if_empty:NT \l__um_tmpc_tl + { \tl_set_eq:NN \l__um_tmpc_tl \l__um_tmpa_tl } + + \clist_if_in:NVT \g__um_bad_alpha_clist \l__um_tmpa_tl { \__um_error:n {range-not-bf-sf} } + + \prop_if_exist:cTF {g__um_named_range_ \l__um_tmpa_tl _prop} + { + \seq_gput_right:Nx \g__um_mathalph_seq + { + { \exp_not:V \l__um_tmpa_tl } + { \exp_not:V \l__um_tmpb_tl } + { \exp_not:V \l__um_tmpc_tl } + } + } + {#2} + } \cs_set:Npn \__um_split_arrow:w #1->#2 \q_nil - { - \tl_set:Nx \l__um_tmpa_tl { \tl_trim_spaces:n {#1} } - \tl_set:Nx \l__um_tmpc_tl { \tl_trim_spaces:n {#2} } - } + { + \tl_set:Nx \l__um_tmpa_tl { \tl_trim_spaces:n {#1} } + \tl_set:Nx \l__um_tmpc_tl { \tl_trim_spaces:n {#2} } + } \cs_set:Npn \__um_split_slash:w #1/#2 \q_nil - { - \tl_set:Nx \l__um_tmpa_tl { \tl_trim_spaces:n {#1} } - \tl_set:Nx \l__um_tmpb_tl { \tl_trim_spaces:n {#2} } - } -\cs_new:Nn \__um_if_char_spec:nNNT + { + \tl_set:Nx \l__um_tmpa_tl { \tl_trim_spaces:n {#1} } + \tl_set:Nx \l__um_tmpb_tl { \tl_trim_spaces:n {#2} } + } +\cs_new_protected:Nn \__um_range_decl:n + { + \bool_lazy_and:nnTF { \tl_if_single_p:n {#1} } { \token_if_cs_p:N #1 } + { + \tl_if_in:VnTF #1 { \q_unicode_math } + { + \seq_if_in:NnTF \g__um_mathclasses_seq {#1} + { \seq_gput_right:Nn \g__um_mclass_range_seq {#1} } + { \seq_gput_right:Nx \g__um_char_range_seq {#1} } + } + { \__um_error:nx {bad-cs-in-range} { \tl_to_str:n {#1} } } + } + { + \seq_gput_right:Nx \g__um_char_range_seq {#1} + } + } +\cs_new:Nn \__um_if_char_spec:nNT { % 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} + \seq_if_in:NnT \g__um_mclass_range_seq {#2} { \use_none_delimit_by_q_nil:w } % character slot: - \seq_map_inline:Nn \l__um_char_range_seq + \seq_map_inline:Nn \g__um_char_range_seq { + \__um_int_if_slot_is_last_in_range:nnT {#1} {##1} + { \seq_gremove_all:Nn \g__um_char_range_seq {##1} } + \__um_int_if_slot_in_range:nnT {#1} {##1} { \seq_map_break:n { \use_none_delimit_by_q_nil:w } } } @@ -1436,12 +1671,17 @@ \q_nil \use:n { - \clist_put_right:Nx \l__um_char_nrange_clist { \int_eval:n {#1} } - #4 + \cs_if_eq:NNT #2 \mathalpha + { + \clist_put_right:Nx \l__um_mathmap_charints_clist { \int_eval:n {#1} } + } + #3 } } \cs_new:Nn \__um_int_if_slot_in_range:nnT - { \__um_numrange_parse:nwT {#1} #2 - \q_nil - \q_stop {#3} } + { + \__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} } @@ -1453,8 +1693,22 @@ \int_compare:nT {#1>=#2} { \int_compare:nT {#1<=#3} {#5} } } } } } +\cs_new:Nn \__um_int_if_slot_is_last_in_range:nnT + { + \__um_numrange_last_parse:nwT {#1} #2 - \q_nil - \q_stop {#3} + } +\cs_set:Npn \__um_numrange_last_parse:nwT #1 #2 - #3 - #4 \q_stop #5 + { + \tl_if_empty:nTF {#4} { \int_compare:nT {#1==#2} {#5} } + { + \tl_if_empty:nTF {#2} { \int_compare:nT {#1==#3} {#5} } + { + \int_compare:nT {#1==#3} {#5} + } } + } %%^^A%% um-code-fontparam.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Cross-platform interface for font parameters \cs_new_protected_nopar:Nn \__um_new_cramped_style:N { @@ -1466,32 +1720,32 @@ \__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 :Nn } - { Umath \l__um_tmpa_tl } -} + { + \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 :Nn } + { Umath \l__um_tmpa_tl } + } \cs_new_protected_nopar:Nn \__um_font_param:nnn - { - \__um_font_param:nnnnn { #1 } { #2 } { #2 } { #3 } { #3 } - } + { + \__um_font_param:nnnnn { #1 } { #2 } { #2 } { #3 } { #3 } + } \cs_new_protected_nopar:Nn \__um_font_param:nn - { - \__um_font_param:nnnnn { #1 } { #2 } { #2 } { #2 } { #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 - } + { + #3 ##1 + } \cs_new_protected_nopar:Npn #2 ##1 ##2 - { - #3 ##1 \dim_eval:n { ##2 } - } + { + #3 ##1 \dim_eval:n { ##2 } + } } \cs_generate_variant:Nn \__um_font_param_aux:NNN { ccc } \__um_font_param:nn { axis } { 15 } @@ -1539,111 +1793,444 @@ \__um_font_param:nn { underbar_rule } { 57 } \__um_font_param:nn { underbar_vgap } { 56 } \__um_font_param:n { connector_overlap_min } -\cs_new:Nn \__um_fontdimen_to_percent:nn - { - \fp_eval:n { \dim_to_decimal:n { \fontdimen #1 #2 } * 65536 / 100 } - } -\cs_new:Nn \__um_fontdimen_to_scale:nn - { - \fp_eval:n {\__um_fontdimen_to_percent:nn {#1} {#2} * \f@size } pt - } -\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 +\cs_new:Nn \__um_fontdimen_to_percent:nN + { + \fp_eval:n { \dim_to_decimal:n { \fontdimen #1 #2 } * 65536 / 100 } + } +\cs_new:Nn \__um_fontdimen_to_scale:nN + { + \fp_eval:n { \__um_fontdimen_to_percent:nN {#1} #2 * \f@size } pt + } +\cs_new:Nn \__um_mathstyle_scale:NnnN + { + \ifx#1\scriptstyle + #2 \__um_fontdimen_to_percent:nN {10} #4 #3 \else - #2 #3 + \ifx#1\scriptscriptstyle + #2 \__um_fontdimen_to_percent:nN {11} #4 #3 + \else + #2 #3 + \fi \fi - \fi - } + } %%^^A%% um-code-mathmap.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Setup of symbol alphabets. -\cs_set:Npn \use@mathgroup #1 #2 - { - \mode_if_math:T % <- not sure if this is really necessary since we've just checked for mmode and raised an error if not! - { - \math@bgroup - \cs_if_eq:cNF {M@\f@encoding} #1 {#1} - \__um_switchto_literal: - \mathgroup #2 \relax - \math@egroup - } - } -\cs_set:Npn \operator@font - { - \__um_switchto_literal: - \@fontswitch {} { \g__um_operator_mathfont_tl } - } -\cs_new:Nn \__um_prepare_mathstyle:n - { - \seq_put_right:Nn \g__um_mathstyles_seq {#1} - \__um_init_alphabet:n {#1} - \cs_set:cpn {__um_sym_#1_aux:n} - { \use:c {__um_switchto_#1:} \math@egroup } - \cs_set_protected:cpx {sym#1} - { - \exp_not:n - { - \math@bgroup - \mode_if_math:F - { - \egroup\expandafter - \non@alpherr\expandafter{\csname sym#1\endcsname\space} - } - \tl_set:Nn \l__um_mathstyle_tl {#1} - } - \exp_not:c {__um_sym_#1_aux:n} - } - } -\cs_set:Nn \__um_init_alphabet:n - { - \__um_log:nx {alph-initialise} {#1} - \cs_set_eq:cN {__um_switchto_#1:} \prg_do_nothing: - } -\cs_new:Nn \__um_new_named_range:n - { - \prop_new:c {g__um_named_range_#1_prop} - } -\clist_set:Nn \g__um_named_ranges_clist - { - up, it, tt, bfup, bfit, bb , bbit, scr, bfscr, cal, bfcal, - frak, bffrak, sfup, sfit, bfsfup, bfsfit, bfsf - } -\clist_map_inline:Nn \g__um_named_ranges_clist - { \__um_new_named_range:n {#1} } +\cs_new:Npn \__um_setup_alphabets: + { + + \bool_if:NTF \l__um_init_bool + { + % IMPLICIT + \__um_log:n {setup-implicit} + \seq_gset_eq:NN \g__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} + \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 + \__um_mathalph_map: + \seq_if_empty:NF \l__um_missing_alph_seq { \__um_log:n { missing-alphabets } } + } + { + \seq_if_empty:NF \g__um_mathalph_seq + { + % 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 + \__um_mathalph_map: + \seq_if_empty:NF \l__um_missing_alph_seq { \__um_log:n { missing-alphabets } } + } + + % INHERIT + \clist_if_empty:NF \l__um_mathmap_charints_clist + { + \seq_gclear:N \g__um_mathalph_seq + \seq_map_inline:Nn \g__um_default_mathalph_seq + { + \tl_set:No \l__um_style_tl { \use_i:nnn ##1 } + \clist_set:No \l__um_alphabet_clist { \use_ii:nnn ##1 } + + \clist_map_inline:Nn \l__um_alphabet_clist + { + \clist_map_inline:cn {g__um_named_slots_ \l__um_style_tl _ ####1 _clist} + { + \clist_map_inline:Nn \l__um_mathmap_charints_clist + { + \__um_int_if_slot_in_range:nnT {################1} {########1} + { + \seq_gput_right:Nn \g__um_mathalph_seq {##1} + \clist_map_break:n { \clist_map_break:n { \clist_map_break: } } + } + } + } + } + } + } + + \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_parse:nnn + \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_parse:nn + \__um_mathalph_map: + } + } +\cs_set:Nn \__um_mathalph_map: + { + \seq_map_inline:Nn \g__um_mathalph_seq + { + \tl_set:No \l__um_style_tl { \use_i:nnn ##1 } + \clist_set:No \l__um_alphabet_clist { \use_ii:nnn ##1 } + \tl_set:No \l__um_remap_style_tl { \use_iii:nnn ##1 } + + % If no set of alphabets is defined: + \clist_if_empty:NT \l__um_alphabet_clist + { + \cs_set_eq:NN \__um_maybe_init_alphabet:n \__um_init_alphabet:n + \prop_get:cnN { g__um_named_range_ \l__um_style_tl _prop } + { default-alpha } \l__um_alphabet_clist + } + + \__um_check_math_alphabet: + \__um_setup_math_alphabet: + } + } +\cs_new:Nn \__um_check_math_alphabet: + { + \clist_map_inline:Nn \l__um_alphabet_clist + { + \tl_set:Nn \l__um_alphabet_tl {##1} + \__um_if_alphabet_exists:nnTF \l__um_style_tl \l__um_alphabet_tl + { + \str_if_eq_x:nnTF {\l__um_alphabet_tl} {misc} + { + \__um_maybe_init_alphabet:n \l__um_style_tl + \clist_map_break: + } + { + \__um_glyph_if_exist:NnT \g__um_curr_font_cmd_tl + { \__um_to_usv:nn {\l__um_style_tl} {\l__um_alphabet_tl} } + { + \__um_maybe_init_alphabet:n \l__um_style_tl + \clist_map_break: + } + } + } + { + \msg_warning:nnx {unicode-math} {no-alphabet} + { \l__um_style_tl / \l__um_alphabet_tl } + } + } + } +\cs_new:Nn \__um_setup_math_alphabet: + { + \clist_map_inline:Nn \l__um_alphabet_clist + { + \tl_set:Nx \l__um_alphabet_tl { \tl_trim_spaces:n {##1} } + + + \__um_if_alphabet_exists:nnT {\l__um_style_tl} {\l__um_alphabet_tl} + { + \exp_args:No \tl_if_eq:nnTF \l__um_alphabet_tl {misc} + { + \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)} + \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl} + } + { + \__um_glyph_if_exist:NnTF \g__um_curr_font_cmd_tl { \__um_to_usv:nn {\l__um_remap_style_tl} {\l__um_alphabet_tl} } + { + \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)} + \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl} + } + { + \bool_if:NTF \l__um_implicit_alph_bool + { + \seq_put_right:Nx \l__um_missing_alph_seq + { + \@backslashchar sym \l__um_style_tl \space + (\tl_use:c{c__um_math_alphabet_name_ \l__um_alphabet_tl _tl}) + } + } + { + \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {up} + } + } + } + } + } + } \cs_new:Nn \__um_new_alphabet_config:nnn - { - \prop_if_exist:cF {g__um_named_range_#1_prop} - { \__um_warning:nnn {no-named-range} {#1} {#2} } + { + \prop_if_exist:cF {g__um_named_range_#1_prop} + { \__um_warning:nnn {no-named-range} {#1} {#2} } - \prop_gput:cnn {g__um_named_range_#1_prop} { alpha_tl } - { - \prop_item:cn {g__um_named_range_#1_prop} { alpha_tl } - {#2} - } - % Q: do I need to bother removing duplicates? + \prop_gput:cnn {g__um_named_range_#1_prop} { alpha_tl } + { + \prop_item:cn {g__um_named_range_#1_prop} { alpha_tl } {#2} + } + % Q: do I need to bother removing duplicates? - \cs_new:cn { __um_config_#1_#2:n } {#3} - } + \cs_new:cn { __um_config_#1_#2:n } + { + \clist_gclear_new:c {g__um_named_slots_#1_#2_clist} + \tl_set:Nn \l__um_curr_named_slot { g__um_named_slots_#1_#2_clist } + #3 + \clist_gremove_duplicates:c {g__um_named_slots_#1_#2_clist} + } + + } \cs_new:Nn \__um_alphabet_config:nnn - { - \use:c {__um_config_#1_#2:n} {#3} - } + { + \use:c {__um_config_#1_#2:n} {#3} + } \prg_new_conditional:Nnn \__um_if_alphabet_exists:nn {T,TF} - { - \cs_if_exist:cTF {__um_config_#1_#2:n} - \prg_return_true: \prg_return_false: - } + { + \cs_if_exist:cTF {__um_config_#1_#2:n} + \prg_return_true: \prg_return_false: + } +\cs_new:Nn \__um_map_char_noparse:nn + { + \__um_set_mathcode:nnnn {#1} {\mathalpha} {\l__um_symfont_label_tl} {#2} + } +\cs_new:Nn \__um_map_char_parse:nn + { + \__um_if_char_spec:nNT {#1} {\mathalpha} + { \__um_map_char_noparse:nn {#1}{#2} } + } +\cs_new:Nn \__um_map_char_single:nnn + { + \__um_map_char_single:nn { \__um_to_usv:nn {#1} {#3} } + { \__um_to_usv:nn {#2} {#3} } + } +\cs_set:Nn \__um_map_chars_range:nnn + { + \int_step_inline:nnnn {0} {1} {#1-1} + { \__um_map_char_single:nn {#2+##1} {#3+##1} } + + \clist_gput_right:cx { \l__um_curr_named_slot } + { \int_eval:n { #3 } - \int_eval:n { #3 + #1-1 } } + } +\cs_new:Nn \__um_map_chars_range:nnnn + { + \__um_map_chars_range:nnn {#1} { \__um_to_usv:nn {#2} {#4} } + { \__um_to_usv:nn {#3} {#4} } + } +\cs_set:Nn \__um_set_normal_char:nnn + { + \__um_usv_if_exist:nnT {#3} {#1} + { + \clist_map_inline:nn {#2} + { + \__um_set_mathalphabet_pos:nnnn {normal} {#1} {##1} {#3} + \__um_map_char_single:nnn {##1} {#3} {#1} + + \clist_gput_right:cx {\l__um_curr_named_slot} + { \int_eval:n { \__um_to_usv:nn {#3} {#1} } } + } + } + } +\cs_new:Nn \__um_set_normal_Latin:nn + { + \clist_map_inline:nn {#1} + { + \__um_set_mathalphabet_Latin:nnn {normal} {##1} {#2} + \__um_map_chars_range:nnnn {26} {##1} {#2} {Latin} + } + } +\cs_new:Nn \__um_set_normal_latin:nn + { + \clist_map_inline:nn {#1} + { + \__um_set_mathalphabet_latin:nnn {normal} {##1} {#2} + \__um_map_chars_range:nnnn {26} {##1} {#2} {latin} + } + } +\cs_new:Nn \__um_set_normal_greek:nn + { + \clist_map_inline:nn {#1} + { + \__um_set_mathalphabet_greek:nnn {normal} {##1} {#2} + \__um_map_chars_range:nnnn {25} {##1} {#2} {greek} + \__um_map_char_single:nnn {##1} {#2} {epsilon} + \__um_map_char_single:nnn {##1} {#2} {vartheta} + \__um_map_char_single:nnn {##1} {#2} {varkappa} + \__um_map_char_single:nnn {##1} {#2} {phi} + \__um_map_char_single:nnn {##1} {#2} {varrho} + \__um_map_char_single:nnn {##1} {#2} {varpi} + \__um_set_mathalphabet_pos:nnnn {normal} {epsilon} {##1} {#2} + \__um_set_mathalphabet_pos:nnnn {normal} {vartheta} {##1} {#2} + \__um_set_mathalphabet_pos:nnnn {normal} {varkappa} {##1} {#2} + \__um_set_mathalphabet_pos:nnnn {normal} {phi} {##1} {#2} + \__um_set_mathalphabet_pos:nnnn {normal} {varrho} {##1} {#2} + \__um_set_mathalphabet_pos:nnnn {normal} {varpi} {##1} {#2} + } + } +\cs_new:Nn \__um_set_normal_Greek:nn + { + \clist_map_inline:nn {#1} + { + \__um_set_mathalphabet_Greek:nnn {normal} {##1} {#2} + \__um_map_chars_range:nnnn {25} {##1} {#2} {Greek} + \__um_map_char_single:nnn {##1} {#2} {varTheta} + \__um_set_mathalphabet_pos:nnnn {normal} {varTheta} {##1} {#2} + } + } +\cs_new:Nn \__um_set_normal_numbers:nn + { + \__um_set_mathalphabet_numbers:nnn {normal} {#1} {#2} + \__um_map_chars_range:nnnn {10} {#1} {#2} {num} + } +\cs_new:Nn \__um_mathmap_noparse:nnn + { + \tl_put_right:cx { __um_switchto_#1: } + { + \__um_set_mathcode:nnnn {#2} {\mathalpha} {\l__um_symfont_label_tl} {#3} + } + } +\cs_new:Nn \__um_mathmap_parse:nnn + { + \exp_args:NNx \clist_if_in:NnT \l__um_mathmap_charints_clist { \int_eval:n {#3} } + { + \__um_mathmap_noparse:nnn {#1} {#2} {#3} + } + } +\cs_new:Nn \__um_set_mathalphabet_char:nnnn + { + \__um_set_mathalphabet_char:nnn {#1} { \__um_to_usv:nn {#2} {#4} } + { \__um_to_usv:nn {#3} {#4} } + } +\cs_new:Nn \__um_set_mathalph_range:nnnn + { + \int_step_inline:nnnn {0} {1} {#1-1} + { \__um_set_mathalphabet_char:nnn {#2} { ##1 + #3 } { ##1 + #4 } } + } +\cs_new:Nn \__um_set_mathalph_range:nnnnn + { + \clist_gput_right:cx { \l__um_curr_named_slot } + { \int_eval:n { \__um_to_usv:nn {#4} {#5} } - \int_eval:n { (#1-1)+\__um_to_usv:nn {#4} {#5} } } + + \__um_set_mathalph_range:nnnn {#1} {#2} { \__um_to_usv:nn {#3} {#5} } + { \__um_to_usv:nn {#4} {#5} } + } +\cs_new:Nn \__um_set_mathalphabet_pos:nnnn + { + \__um_usv_if_exist:nnT {#4} {#2} + { + \clist_map_inline:nn {#3} + { \__um_set_mathalphabet_char:nnnn {#1} {##1} {#4} {#2} } + + \clist_gput_right:cx {\l__um_curr_named_slot} + { \int_eval:n { \__um_to_usv:nn {#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} {epsilon} + \__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} {phi} + \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varrho} + \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varpi} + } + } + +%%^^A%% um-code-sym-commands.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Definition of "math symbol alphabet" commands such as `\symbf` and co. + +\cs_set:Npn \use@mathgroup #1 #2 + { + \mode_if_math:T % <- not sure if this is really necessary since we've just checked for mmode and raised an error if not! + { + \math@bgroup + \cs_if_eq:cNF {M@\f@encoding} #1 {#1} + \__um_switchto_literal: + \mathgroup #2 \relax + \math@egroup + } + } +\cs_set:Npn \operator@font + { + \__um_switchto_literal: + \__um_fontswitch:n { \g__um_operator_mathfont_tl } + } +\cs_set:Nn \__um_fontswitch:n + { + \mode_if_math:T + { + \cs_set_eq:NN \math@bgroup \scan_stop: + \cs_set_eq:NN \__um_group_begin: \scan_stop: + \cs_set:Npn \__um_group_end: + { + \cs_set_eq:NN \__um_group_begin: \__um_group_begin_frozen: + \cs_set_eq:NN \__um_group_end: \__um_group_end_frozen: + \cs_set_eq:NN \math@bgroup \__ummath@bgroup + \cs_set_eq:NN \math@egroup \__ummath@egroup + } + \cs_set_eq:NN \math@egroup \__um_group_end: + #1 \scan_stop: + } + } +\cs_new:Nn \__um_prepare_mathstyle:n + { + \seq_gput_right:Nn \g__um_mathstyles_seq {#1} + \__um_init_alphabet:n {#1} + \cs_set_protected:cpx {sym#1} ##1 + { + \__um_group_begin: + \exp_not:n + { + \mode_if_math:F + { + \exp_args:Nc \non@alpherr {sym#1} + } + \tl_set:Nn \l__um_mathstyle_tl {#1} + } + \exp_not:c {__um_switchto_#1:} ##1 + \__um_group_end: + } + } +\cs_set:Nn \__um_init_alphabet:n + { + \__um_log:nx {alph-initialise} {#1} + \cs_set_eq:cN {__um_switchto_#1:} \prg_do_nothing: + } \cs_new:Nn \__um_default_mathalph:nnn - { - \seq_put_right:Nx \g__um_named_ranges_seq { \tl_to_str:n {#1} } - \seq_put_right:Nn \g__um_default_mathalph_seq {{#1}{#2}{#3}} - \prop_gput:cnn { g__um_named_range_#1_prop } { default-alpha } {#2} - } + { + \prop_new:c {g__um_named_range_#1_prop} + \seq_gput_right:Nn \g__um_default_mathalph_seq {{#1}{#2}{#3}} + \prop_gput:cnn { g__um_named_range_#1_prop } { default-alpha } {#2} + } \__um_default_mathalph:nnn {up } {latin,Latin,greek,Greek,num,misc} {up } \__um_default_mathalph:nnn {it } {latin,Latin,greek,Greek,misc} {it } \__um_default_mathalph:nnn {bb } {latin,Latin,num,misc} {bb } @@ -1662,366 +2249,932 @@ \__um_default_mathalph:nnn {bfsfup} {latin,Latin,greek,Greek,num,misc} {bfsfup} \__um_default_mathalph:nnn {bfsfit} {latin,Latin,greek,Greek,misc} {bfsfit} \clist_map_inline:nn - { - up, it, bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf, - tt, bb, bbit, scr, bfscr, cal, bfcal, frak, bffrak, - normal, literal, sf, bf, - } - { \__um_prepare_mathstyle:n {#1} } + { + up, it, bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf, + tt, bb, bbit, scr, bfscr, cal, bfcal, frak, bffrak, + normal, literal, sf, bf, + } + { + \__um_prepare_mathstyle:n {#1} + } \clist_map_inline:nn - { rm, it, bf, sf, tt } - { \cs_set_eq:cc { mathtext #1 } { math #1 } } + { rm, it, bf, sf, tt } + { \cs_set_eq:cc { mathtext #1 } { math #1 } } \clist_map_inline:nn - { - normal, bb , bbit, scr, bfscr, cal, bfcal, frak, bffrak, tt, - bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf - } - { - \cs_set:cpx { math #1 } { \exp_not:c { sym #1 } } + { + normal, bb , bbit, scr, bfscr, cal, bfcal, frak, bffrak, tt, + bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf + } + { + \cs_set:cpx { math #1 } { \exp_not:c { sym #1 } } + } +\AtBeginDocument + { + \clist_map_inline:nn + { rm, it, bf, sf, tt } + { + \cs_set_protected:cpx { math #1 } + { + \exp_not:n { \bool_if:NTF } \exp_not:c { g__um_ math #1 _text_bool} + { \exp_not:c { mathtext #1 } } + { \exp_not:c { sym #1 } } + } + } + } +\cs_set_protected:Npn \mathup { \mathrm } +\cs_set_protected:Npn \symrm { \symup } + +%%^^A%% um-code-alphabets.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Definitions for setting up the "math symbol alphabets". + +\__um_new_alphabet_config:nnn {up} {num} + { + \__um_set_normal_numbers:nn {up} {#1} + \__um_set_mathalphabet_numbers:nnn {up} {up} {#1} + } + +\__um_new_alphabet_config:nnn {up} {Latin} + { + \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Latin:nn {up} {#1} } + { + \bool_if:NT \g__um_upLatin_bool { \__um_set_normal_Latin:nn {up,it} {#1} } + } + \__um_set_mathalphabet_Latin:nnn {up} {up,it} {#1} + \__um_set_mathalphabet_Latin:nnn {literal} {up} {up} + \__um_set_mathalphabet_Latin:nnn {literal} {it} {it} + } + +\__um_new_alphabet_config:nnn {up} {latin} + { + \bool_if:NTF \g__um_literal_bool { \__um_set_normal_latin:nn {up} {#1} } + { + \bool_if:NT \g__um_uplatin_bool + { + \__um_set_normal_latin:nn {up,it} {#1} + \__um_set_normal_char:nnn {h} {up,it} {#1} + \__um_set_normal_char:nnn {dotlessi} {up,it} {#1} + \__um_set_normal_char:nnn {dotlessj} {up,it} {#1} + } + } + \__um_set_mathalphabet_latin:nnn {up} {up,it}{#1} + \__um_set_mathalphabet_latin:nnn {literal} {up} {up} + \__um_set_mathalphabet_latin:nnn {literal} {it} {it} + } + +\__um_new_alphabet_config:nnn {up} {Greek} + { + \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Greek:nn {up}{#1} } + { + \bool_if:NT \g__um_upGreek_bool { \__um_set_normal_Greek:nn {up,it}{#1} } + } + \__um_set_mathalphabet_Greek:nnn {up} {up,it}{#1} + \__um_set_mathalphabet_Greek:nnn {literal} {up} {up} + \__um_set_mathalphabet_Greek:nnn {literal} {it} {it} + } + +\__um_new_alphabet_config:nnn {up} {greek} + { + \bool_if:NTF \g__um_literal_bool { \__um_set_normal_greek:nn {up} {#1} } + { + \bool_if:NT \g__um_upgreek_bool + { + \__um_set_normal_greek:nn {up,it} {#1} + } + } + \__um_set_mathalphabet_greek:nnn {up} {up,it} {#1} + \__um_set_mathalphabet_greek:nnn {literal} {up} {up} + \__um_set_mathalphabet_greek:nnn {literal} {it} {it} + } + +\__um_new_alphabet_config:nnn {up} {misc} + { + \bool_if:NTF \g__um_literal_Nabla_bool + { + \__um_set_normal_char:nnn {Nabla}{up}{up} + } + { + \bool_if:NT \g__um_upNabla_bool + { + \__um_set_normal_char:nnn {Nabla}{up,it}{up} + } + } + \bool_if:NTF \g__um_literal_partial_bool + { + \__um_set_normal_char:nnn {partial}{up}{up} + } + { + \bool_if:NT \g__um_uppartial_bool + { + \__um_set_normal_char:nnn {partial}{up,it}{up} + } + } + \__um_set_mathalphabet_pos:nnnn {up} {partial} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {up} {Nabla} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {up} {dotlessi} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {up} {dotlessj} {up,it} {#1} + } +\__um_new_alphabet_config:nnn {it} {Latin} + { + \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Latin:nn {it} {#1} } + { + \bool_if:NF \g__um_upLatin_bool { \__um_set_normal_Latin:nn {up,it} {#1} } + } + \__um_set_mathalphabet_Latin:nnn {it} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {it} {latin} + { + \bool_if:NTF \g__um_literal_bool + { + \__um_set_normal_latin:nn {it}{#1} + \__um_set_normal_char:nnn {h}{it}{#1} + } + { + \bool_if:NF \g__um_uplatin_bool + { + \__um_set_normal_latin:nn {up,it} {#1} + \__um_set_normal_char:nnn {h} {up,it} {#1} + \__um_set_normal_char:nnn {dotlessi} {up,it} {#1} + \__um_set_normal_char:nnn {dotlessj} {up,it} {#1} + } + } + \__um_set_mathalphabet_latin:nnn {it} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {it} {dotlessi} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {it} {dotlessj} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {it} {Greek} + { + \bool_if:NTF \g__um_literal_bool + { + \__um_set_normal_Greek:nn {it} {#1} + } + { + \bool_if:NF \g__um_upGreek_bool { \__um_set_normal_Greek:nn {up,it} {#1} } + } + \__um_set_mathalphabet_Greek:nnn {it} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {it} {greek} + { + \bool_if:NTF \g__um_literal_bool + { + \__um_set_normal_greek:nn {it} {#1} + } + { + \bool_if:NF \g__um_upgreek_bool { \__um_set_normal_greek:nn {it,up} {#1} } + } + \__um_set_mathalphabet_greek:nnn {it} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {it} {misc} + { + \bool_if:NTF \g__um_literal_Nabla_bool + { + \__um_set_normal_char:nnn {Nabla} {it} {it} + } + { + \bool_if:NF \g__um_upNabla_bool + { + \__um_set_normal_char:nnn {Nabla} {up,it} {it} + } + } + \bool_if:NTF \g__um_literal_partial_bool + { + \__um_set_normal_char:nnn {partial} {it} {it} + } + { + \bool_if:NF \g__um_uppartial_bool + { + \__um_set_normal_char:nnn {partial} {up,it} {it} + } + } + \__um_set_mathalphabet_pos:nnnn {it} {partial} {up,it}{#1} + \__um_set_mathalphabet_pos:nnnn {it} {Nabla} {up,it}{#1} + } +\__um_new_alphabet_config:nnn {bb} {latin} + { + \__um_set_mathalphabet_latin:nnn {bb} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {bb} {Latin} + { + \__um_set_mathalphabet_Latin:nnn {bb} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {C} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {H} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {N} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {P} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {Q} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {R} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {Z} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {bb} {num} + { + \__um_set_mathalphabet_numbers:nnn {bb} {up} {#1} + } + +\__um_new_alphabet_config:nnn {bb} {misc} + { + \__um_set_mathalphabet_pos:nnnn {bb} {Pi} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {pi} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {Gamma} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {gamma} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {summation} {up} {#1} + } + +\__um_new_alphabet_config:nnn {bbit} {misc} + { + \__um_set_mathalphabet_pos:nnnn {bbit} {D} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bbit} {d} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bbit} {e} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bbit} {i} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bbit} {j} {up,it} {#1} + } +\__um_new_alphabet_config:nnn {scr} {Latin} + { + \__um_set_mathalphabet_Latin:nnn {scr} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {B} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {E} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {F} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {H} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {I} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {L} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {M} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {R} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {scr} {latin} + { + \__um_set_mathalphabet_latin:nnn {scr} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {e} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {g} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {o} {up,it} {#1} + } +\__um_new_alphabet_config:nnn {cal} {Latin} + { + \__um_set_mathalphabet_Latin:nnn {cal} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {cal} {B} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {cal} {E} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {cal} {F} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {cal} {H} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {cal} {I} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {cal} {L} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {cal} {M} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {cal} {R} {up,it} {#1} + } +\__um_new_alphabet_config:nnn {frak} {Latin} + { + \__um_set_mathalphabet_Latin:nnn {frak} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {frak} {C} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {frak} {H} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {frak} {I} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {frak} {R} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {frak} {Z} {up,it} {#1} + } +\__um_new_alphabet_config:nnn {frak} {latin} + { + \__um_set_mathalphabet_latin:nnn {frak} {up,it} {#1} + } +\__um_new_alphabet_config:nnn {sfup} {num} + { + \__um_set_mathalphabet_numbers:nnn {sf} {up} {#1} + \__um_set_mathalphabet_numbers:nnn {sfup} {up} {#1} + } +\__um_new_alphabet_config:nnn {sfup} {Latin} + { + \bool_if:NTF \g__um_sfliteral_bool + { + \__um_set_normal_Latin:nn {sfup} {#1} + \__um_set_mathalphabet_Latin:nnn {sf} {up} {#1} + } + { + \bool_if:NT \g__um_upsans_bool + { + \__um_set_normal_Latin:nn {sfup,sfit} {#1} + \__um_set_mathalphabet_Latin:nnn {sf} {up,it} {#1} + } + } + \__um_set_mathalphabet_Latin:nnn {sfup} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {sfup} {latin} + { + \bool_if:NTF \g__um_sfliteral_bool + { + \__um_set_normal_latin:nn {sfup} {#1} + \__um_set_mathalphabet_latin:nnn {sf} {up} {#1} + } + { + \bool_if:NT \g__um_upsans_bool + { + \__um_set_normal_latin:nn {sfup,sfit} {#1} + \__um_set_mathalphabet_latin:nnn {sf} {up,it} {#1} + } + } + \__um_set_mathalphabet_latin:nnn {sfup} {up,it} {#1} + } +\__um_new_alphabet_config:nnn {sfit} {Latin} + { + \bool_if:NTF \g__um_sfliteral_bool + { + \__um_set_normal_Latin:nn {sfit} {#1} + \__um_set_mathalphabet_Latin:nnn {sf} {it} {#1} + } + { + \bool_if:NF \g__um_upsans_bool + { + \__um_set_normal_Latin:nn {sfup,sfit} {#1} + \__um_set_mathalphabet_Latin:nnn {sf} {up,it} {#1} + } + } + \__um_set_mathalphabet_Latin:nnn {sfit} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {sfit} {latin} + { + \bool_if:NTF \g__um_sfliteral_bool + { + \__um_set_normal_latin:nn {sfit} {#1} + \__um_set_mathalphabet_latin:nnn {sf} {it}{#1} + } + { + \bool_if:NF \g__um_upsans_bool + { + \__um_set_normal_latin:nn {sfup,sfit} {#1} + \__um_set_mathalphabet_latin:nnn {sf} {up,it}{#1} + } + } + \__um_set_mathalphabet_latin:nnn {sfit} {up,it}{#1} + } +\__um_new_alphabet_config:nnn {tt} {num} + { + \__um_set_mathalphabet_numbers:nnn {tt} {up}{#1} + } +\__um_new_alphabet_config:nnn {tt} {Latin} + { + \__um_set_mathalphabet_Latin:nnn {tt} {up,it}{#1} + } +\__um_new_alphabet_config:nnn {tt} {latin} + { + \__um_set_mathalphabet_latin:nnn {tt} {up,it}{#1} + } +\__um_new_alphabet_config:nnn {bfit} {Latin} + { + \bool_if:NF \g__um_bfupLatin_bool + { + \__um_set_normal_Latin:nn {bfup,bfit} {#1} + } + \__um_set_mathalphabet_Latin:nnn {bfit} {up,it}{#1} + \bool_if:NTF \g__um_bfliteral_bool + { + \__um_set_normal_Latin:nn {bfit} {#1} + \__um_set_mathalphabet_Latin:nnn {bf} {it}{#1} + } + { + \bool_if:NF \g__um_bfupLatin_bool + { + \__um_set_normal_Latin:nn {bfup,bfit} {#1} + \__um_set_mathalphabet_Latin:nnn {bf} {up,it}{#1} + } + } + } + +\__um_new_alphabet_config:nnn {bfit} {latin} + { + \bool_if:NF \g__um_bfuplatin_bool + { + \__um_set_normal_latin:nn {bfup,bfit} {#1} + } + \__um_set_mathalphabet_latin:nnn {bfit} {up,it}{#1} + \bool_if:NTF \g__um_bfliteral_bool + { + \__um_set_normal_latin:nn {bfit} {#1} + \__um_set_mathalphabet_latin:nnn {bf} {it}{#1} + } + { + \bool_if:NF \g__um_bfuplatin_bool + { + \__um_set_normal_latin:nn {bfup,bfit} {#1} + \__um_set_mathalphabet_latin:nnn {bf} {up,it}{#1} + } + } + } + +\__um_new_alphabet_config:nnn {bfit} {Greek} + { + \__um_set_mathalphabet_Greek:nnn {bfit} {up,it}{#1} + \bool_if:NTF \g__um_bfliteral_bool + { + \__um_set_normal_Greek:nn {bfit}{#1} + \__um_set_mathalphabet_Greek:nnn {bf} {it}{#1} + } + { + \bool_if:NF \g__um_bfupGreek_bool + { + \__um_set_normal_Greek:nn {bfup,bfit}{#1} + \__um_set_mathalphabet_Greek:nnn {bf} {up,it}{#1} + } + } + } + +\__um_new_alphabet_config:nnn {bfit} {greek} + { + \__um_set_mathalphabet_greek:nnn {bfit} {up,it} {#1} + \bool_if:NTF \g__um_bfliteral_bool + { + \__um_set_normal_greek:nn {bfit} {#1} + \__um_set_mathalphabet_greek:nnn {bf} {it} {#1} + } + { + \bool_if:NF \g__um_bfupgreek_bool + { + \__um_set_normal_greek:nn {bfit,bfup} {#1} + \__um_set_mathalphabet_greek:nnn {bf} {up,it} {#1} + } + } + } + +\__um_new_alphabet_config:nnn {bfit} {misc} + { + \bool_if:NTF \g__um_literal_Nabla_bool + { \__um_set_normal_char:nnn {Nabla} {bfit} {#1} } + { + \bool_if:NF \g__um_upNabla_bool + { \__um_set_normal_char:nnn {Nabla} {bfup,bfit} {#1} } + } + + \bool_if:NTF \g__um_literal_partial_bool + { \__um_set_normal_char:nnn {partial} {bfit} {#1} } + { + \bool_if:NF \g__um_uppartial_bool + { \__um_set_normal_char:nnn {partial} {bfup,bfit} {#1} } + } + + \__um_set_mathalphabet_pos:nnnn {bfit} {partial} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bfit} {Nabla} {up,it} {#1} + + \bool_if:NTF \g__um_literal_partial_bool + { + \__um_set_mathalphabet_pos:nnnn {bf} {partial} {it}{#1} + } + { + \bool_if:NF \g__um_uppartial_bool + { + \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up,it}{#1} + } + } + + \bool_if:NTF \g__um_literal_Nabla_bool + { + \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {it}{#1} + } + { + \bool_if:NF \g__um_upNabla_bool + { + \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {up,it}{#1} + } + } + } +\__um_new_alphabet_config:nnn {bfup} {num} + { + \__um_set_mathalphabet_numbers:nnn {bf} {up} {#1} + \__um_set_mathalphabet_numbers:nnn {bfup} {up} {#1} + } + +\__um_new_alphabet_config:nnn {bfup} {Latin} + { + \bool_if:NT \g__um_bfupLatin_bool + { + \__um_set_normal_Latin:nn {bfup,bfit} {#1} + } + \__um_set_mathalphabet_Latin:nnn {bfup} {up,it} {#1} + \bool_if:NTF \g__um_bfliteral_bool + { + \__um_set_normal_Latin:nn {bfup} {#1} + \__um_set_mathalphabet_Latin:nnn {bf} {up} {#1} + } + { + \bool_if:NT \g__um_bfupLatin_bool + { + \__um_set_normal_Latin:nn {bfup,bfit} {#1} + \__um_set_mathalphabet_Latin:nnn {bf} {up,it} {#1} + } + } } -\AtBeginDocument{ -\clist_map_inline:nn - { rm, it, bf, sf, tt } + +\__um_new_alphabet_config:nnn {bfup} {latin} + { + \bool_if:NT \g__um_bfuplatin_bool + { + \__um_set_normal_latin:nn {bfup,bfit} {#1} + } + \__um_set_mathalphabet_latin:nnn {bfup} {up,it} {#1} + \bool_if:NTF \g__um_bfliteral_bool + { + \__um_set_normal_latin:nn {bfup} {#1} + \__um_set_mathalphabet_latin:nnn {bf} {up} {#1} + } + { + \bool_if:NT \g__um_bfuplatin_bool + { + \__um_set_normal_latin:nn {bfup,bfit} {#1} + \__um_set_mathalphabet_latin:nnn {bf} {up,it} {#1} + } + } + } + +\__um_new_alphabet_config:nnn {bfup} {Greek} + { + \__um_set_mathalphabet_Greek:nnn {bfup} {up,it} {#1} + \bool_if:NTF \g__um_bfliteral_bool + { + \__um_set_normal_Greek:nn {bfup} {#1} + \__um_set_mathalphabet_Greek:nnn {bf} {up} {#1} + } + { + \bool_if:NT \g__um_bfupGreek_bool + { + \__um_set_normal_Greek:nn {bfup,bfit} {#1} + \__um_set_mathalphabet_Greek:nnn {bf} {up,it} {#1} + } + } + } + +\__um_new_alphabet_config:nnn {bfup} {greek} + { + \__um_set_mathalphabet_greek:nnn {bfup} {up,it} {#1} + \bool_if:NTF \g__um_bfliteral_bool + { + \__um_set_normal_greek:nn {bfup} {#1} + \__um_set_mathalphabet_greek:nnn {bf} {up} {#1} + } + { + \bool_if:NT \g__um_bfupgreek_bool + { + \__um_set_normal_greek:nn {bfup,bfit} {#1} + \__um_set_mathalphabet_greek:nnn {bf} {up,it} {#1} + } + } + } + +\__um_new_alphabet_config:nnn {bfup} {misc} + { + \bool_if:NTF \g__um_literal_Nabla_bool + { + \__um_set_normal_char:nnn {Nabla} {bfup} {#1} + } + { + \bool_if:NT \g__um_upNabla_bool + { + \__um_set_normal_char:nnn {Nabla} {bfup,bfit} {#1} + } + } + \bool_if:NTF \g__um_literal_partial_bool + { + \__um_set_normal_char:nnn {partial} {bfup} {#1} + } + { + \bool_if:NT \g__um_uppartial_bool + { + \__um_set_normal_char:nnn {partial} {bfup,bfit} {#1} + } + } + \__um_set_mathalphabet_pos:nnnn {bfup} {partial} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bfup} {Nabla} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bfup} {digamma} {up} {#1} + \__um_set_mathalphabet_pos:nnnn {bfup} {Digamma} {up} {#1} + \__um_set_mathalphabet_pos:nnnn {bf} {digamma} {up} {#1} + \__um_set_mathalphabet_pos:nnnn {bf} {Digamma} {up} {#1} + \bool_if:NTF \g__um_literal_partial_bool + { + \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up} {#1} + } + { + \bool_if:NT \g__um_uppartial_bool + { + \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up,it} {#1} + } + } + \bool_if:NTF \g__um_literal_Nabla_bool + { + \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {up}{#1} + } + { + \bool_if:NT \g__um_upNabla_bool + { + \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {up,it} {#1} + } + } + } +\__um_new_alphabet_config:nnn {bffrak} {Latin} + { + \__um_set_mathalphabet_Latin:nnn {bffrak} {up,it}{#1} + } + +\__um_new_alphabet_config:nnn {bffrak} {latin} + { + \__um_set_mathalphabet_latin:nnn {bffrak} {up,it}{#1} + } +\__um_new_alphabet_config:nnn {bfscr} {Latin} + { + \__um_set_mathalphabet_Latin:nnn {bfscr} {up,it}{#1} + } +\__um_new_alphabet_config:nnn {bfscr} {latin} + { + \__um_set_mathalphabet_latin:nnn {bfscr} {up,it}{#1} + } +\__um_new_alphabet_config:nnn {bfcal} {Latin} + { + \__um_set_mathalphabet_Latin:nnn {bfcal} {up,it}{#1} + } +\__um_new_alphabet_config:nnn {bfsfup} {num} + { + \__um_set_mathalphabet_numbers:nnn {bfsf} {up}{#1} + \__um_set_mathalphabet_numbers:nnn {bfsfup} {up}{#1} + } +\__um_new_alphabet_config:nnn {bfsfup} {Latin} + { + \bool_if:NTF \g__um_sfliteral_bool + { + \__um_set_normal_Latin:nn {bfsfup} {#1} + \__um_set_mathalphabet_Latin:nnn {bfsf} {up}{#1} + } + { + \bool_if:NT \g__um_upsans_bool + { + \__um_set_normal_Latin:nn {bfsfup,bfsfit} {#1} + \__um_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1} + } + } + \__um_set_mathalphabet_Latin:nnn {bfsfup} {up,it}{#1} + } + +\__um_new_alphabet_config:nnn {bfsfup} {latin} + { + \bool_if:NTF \g__um_sfliteral_bool + { + \__um_set_normal_latin:nn {bfsfup} {#1} + \__um_set_mathalphabet_latin:nnn {bfsf} {up}{#1} + } + { + \bool_if:NT \g__um_upsans_bool + { + \__um_set_normal_latin:nn {bfsfup,bfsfit} {#1} + \__um_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1} + } + } + \__um_set_mathalphabet_latin:nnn {bfsfup} {up,it}{#1} + } + +\__um_new_alphabet_config:nnn {bfsfup} {Greek} + { + \bool_if:NTF \g__um_sfliteral_bool + { + \__um_set_normal_Greek:nn {bfsfup}{#1} + \__um_set_mathalphabet_Greek:nnn {bfsf} {up}{#1} + } + { + \bool_if:NT \g__um_upsans_bool + { + \__um_set_normal_Greek:nn {bfsfup,bfsfit}{#1} + \__um_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1} + } + } + \__um_set_mathalphabet_Greek:nnn {bfsfup} {up,it}{#1} + } + +\__um_new_alphabet_config:nnn {bfsfup} {greek} + { + \bool_if:NTF \g__um_sfliteral_bool + { + \__um_set_normal_greek:nn {bfsfup} {#1} + \__um_set_mathalphabet_greek:nnn {bfsf} {up} {#1} + } + { + \bool_if:NT \g__um_upsans_bool + { + \__um_set_normal_greek:nn {bfsfup,bfsfit} {#1} + \__um_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1} + } + } + \__um_set_mathalphabet_greek:nnn {bfsfup} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {bfsfup} {misc} { - \cs_set_protected:cpx { math #1 } + \bool_if:NTF \g__um_literal_Nabla_bool { - \exp_not:n { \bool_if:NTF } \exp_not:c { g__um_ math #1 _text_bool} - { \exp_not:c { mathtext #1 } } - { \exp_not:c { sym #1 } } + \__um_set_normal_char:nnn {Nabla}{bfsfup}{#1} } - }} -\cs_set_protected:Npn \mathup { \mathrm } -\cs_set_protected:Npn \symrm { \symup } -\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} + \bool_if:NT \g__um_upNabla_bool + { + \__um_set_normal_char:nnn {Nabla}{bfsfup,bfsfit}{#1} + } } + \bool_if:NTF \g__um_literal_partial_bool { - \__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 + \__um_set_normal_char:nnn {partial}{bfsfup}{#1} } - - % Now perform the mapping: - \seq_map_inline:Nn \l__um_mathalph_seq { - \tl_set:No \l__um_style_tl { \use_i:nnn ##1 } - \clist_set:No \l__um_alphabet_clist { \use_ii:nnn ##1 } - \tl_set:No \l__um_remap_style_tl { \use_iii:nnn ##1 } - - % If no set of alphabets is defined: - \clist_if_empty:NT \l__um_alphabet_clist + \bool_if:NT \g__um_uppartial_bool { - \cs_set_eq:NN \__um_maybe_init_alphabet:n \__um_init_alphabet:n - \prop_get:cnN { g__um_named_range_ \l__um_style_tl _prop } - { default-alpha } \l__um_alphabet_clist + \__um_set_normal_char:nnn {partial}{bfsfup,bfsfit}{#1} } - - \__um_setup_math_alphabet: } - \seq_if_empty:NF \l__um_missing_alph_seq { \__um_log:n { missing-alphabets } } - } -\cs_new:Nn \__um_setup_math_alphabet: - { - \clist_map_inline:Nn \l__um_alphabet_clist + \__um_set_mathalphabet_pos:nnnn {bfsfup} {partial} {up,it}{#1} + \__um_set_mathalphabet_pos:nnnn {bfsfup} {Nabla} {up,it}{#1} + \bool_if:NTF \g__um_literal_partial_bool + { + \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up}{#1} + } { - \tl_set:Nn \l__um_alphabet_tl {##1} - \__um_if_alphabet_exists:nnTF \l__um_style_tl \l__um_alphabet_tl + \bool_if:NT \g__um_uppartial_bool { - \str_if_eq_x:nnTF {\l__um_alphabet_tl} {misc} - { - \__um_maybe_init_alphabet:n \l__um_style_tl - \clist_map_break: - } - { - \__um_glyph_if_exist:NnT \l__um_font { \__um_to_usv:nn {\l__um_style_tl} {\l__um_alphabet_tl} } - { - \__um_maybe_init_alphabet:n \l__um_style_tl - \clist_map_break: - } - } + \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up,it}{#1} } - { \msg_warning:nnx {unicode-math} {no-alphabet} { \l__um_style_tl / \l__um_alphabet_tl } } } - \clist_map_inline:Nn \l__um_alphabet_clist + \bool_if:NTF \g__um_literal_Nabla_bool + { + \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {up}{#1} + } { - \tl_set:Nx \l__um_alphabet_tl { \tl_trim_spaces:n {##1} } - \cs_if_exist:cT {__um_config_ \l__um_style_tl _ \l__um_alphabet_tl :n} + \bool_if:NT \g__um_upNabla_bool { - \exp_args:No \tl_if_eq:nnTF \l__um_alphabet_tl {misc} - { - \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)} - \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl} - } - { - \__um_glyph_if_exist:NnTF \l__um_font { \__um_to_usv:nn {\l__um_remap_style_tl} {\l__um_alphabet_tl} } - { - \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)} - \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl} - } - { - \bool_if:NTF \l__um_implicit_alph_bool - { - \seq_put_right:Nx \l__um_missing_alph_seq - { - \@backslashchar sym \l__um_style_tl \space - (\tl_use:c{c__um_math_alphabet_name_ \l__um_alphabet_tl _tl}) - } - } - { - \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {up} - } - } - } + \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {up,it}{#1} } } } -\cs_new:Nn \__um_map_char_noparse:nn - { \__um_set_mathcode:nnnn {#1}{\mathalpha}{\l__um_symfont_label_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:nn { \__um_to_usv:nn {#1}{#3} } - { \__um_to_usv:nn {#2}{#3} } - } -\cs_set:Nn \__um_map_chars_range:nnn - { - \int_step_inline:nnnn {0}{1}{#1-1} - { \__um_map_char_single:nn {#2+##1}{#3+##1} } - } -\cs_new:Nn \__um_map_chars_range:nnnn - { - \__um_map_chars_range:nnn {#1} { \__um_to_usv:nn {#2}{#4} } - { \__um_to_usv:nn {#3}{#4} } - } -\cs_set:Nn \__um_set_normal_char:nnn +\__um_new_alphabet_config:nnn {bfsfit} {Latin} { - \__um_usv_if_exist:nnT {#3} {#1} - { - \clist_map_inline:nn {#2} + \bool_if:NTF \g__um_sfliteral_bool + { + \__um_set_normal_Latin:nn {bfsfit} {#1} + \__um_set_mathalphabet_Latin:nnn {bfsf} {it}{#1} + } + { + \bool_if:NF \g__um_upsans_bool { - \__um_set_mathalphabet_pos:nnnn {normal} {#1} {##1} {#3} - \__um_map_char_single:nnn {##1} {#3} {#1} + \__um_set_normal_Latin:nn {bfsfup,bfsfit} {#1} + \__um_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1} } - } - } -\cs_new:Nn \__um_set_normal_Latin:nn - { - \clist_map_inline:nn {#1} - { - \__um_set_mathalphabet_Latin:nnn {normal} {##1} {#2} - \__um_map_chars_range:nnnn {26} {##1} {#2} {Latin} } + \__um_set_mathalphabet_Latin:nnn {bfsfit} {up,it}{#1} } -\cs_new:Nn \__um_set_normal_latin:nn + +\__um_new_alphabet_config:nnn {bfsfit} {latin} { - \clist_map_inline:nn {#1} + \bool_if:NTF \g__um_sfliteral_bool { - \__um_set_mathalphabet_latin:nnn {normal} {##1} {#2} - \__um_map_chars_range:nnnn {26} {##1} {#2} {latin} + \__um_set_normal_latin:nn {bfsfit} {#1} + \__um_set_mathalphabet_latin:nnn {bfsf} {it}{#1} } - } -\cs_new:Nn \__um_set_normal_greek:nn - { - \clist_map_inline:nn {#1} { - \__um_set_mathalphabet_greek:nnn {normal} {##1} {#2} - \__um_map_chars_range:nnnn {25} {##1} {#2} {greek} - \__um_map_char_single:nnn {##1} {#2} {epsilon} - \__um_map_char_single:nnn {##1} {#2} {vartheta} - \__um_map_char_single:nnn {##1} {#2} {varkappa} - \__um_map_char_single:nnn {##1} {#2} {phi} - \__um_map_char_single:nnn {##1} {#2} {varrho} - \__um_map_char_single:nnn {##1} {#2} {varpi} - \__um_set_mathalphabet_pos:nnnn {normal} {epsilon} {##1} {#2} - \__um_set_mathalphabet_pos:nnnn {normal} {vartheta} {##1} {#2} - \__um_set_mathalphabet_pos:nnnn {normal} {varkappa} {##1} {#2} - \__um_set_mathalphabet_pos:nnnn {normal} {phi} {##1} {#2} - \__um_set_mathalphabet_pos:nnnn {normal} {varrho} {##1} {#2} - \__um_set_mathalphabet_pos:nnnn {normal} {varpi} {##1} {#2} + \bool_if:NF \g__um_upsans_bool + { + \__um_set_normal_latin:nn {bfsfup,bfsfit} {#1} + \__um_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1} + } } + \__um_set_mathalphabet_latin:nnn {bfsfit} {up,it}{#1} } -\cs_new:Nn \__um_set_normal_Greek:nn + +\__um_new_alphabet_config:nnn {bfsfit} {Greek} { - \clist_map_inline:nn {#1} + \bool_if:NTF \g__um_sfliteral_bool { - \__um_set_mathalphabet_Greek:nnn {normal} {##1} {#2} - \__um_map_chars_range:nnnn {25} {##1} {#2} {Greek} - \__um_map_char_single:nnn {##1} {#2} {varTheta} - \__um_set_mathalphabet_pos:nnnn {normal} {varTheta} {##1} {#2} + \__um_set_normal_Greek:nn {bfsfit}{#1} + \__um_set_mathalphabet_Greek:nnn {bfsf} {it}{#1} } - } -\cs_new:Nn \__um_set_normal_numbers:nn - { - \__um_set_mathalphabet_numbers:nnn {normal} {#1} {#2} - \__um_map_chars_range:nnnn {10} {#1} {#2} {num} - } -\cs_new:Nn \__um_mathmap_noparse:nnn - { - \clist_map_inline:nn {#2} { - \tl_put_right:cx {__um_switchto_#1:} + \bool_if:NF \g__um_upsans_bool { - \__um_set_mathcode:nnnn {##1} {\mathalpha} {\l__um_symfont_label_tl} {#3} + \__um_set_normal_Greek:nn {bfsfup,bfsfit}{#1} + \__um_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1} } } + \__um_set_mathalphabet_Greek:nnn {bfsfit} {up,it}{#1} } -\cs_new:Nn \__um_mathmap_parse:nnn + +\__um_new_alphabet_config:nnn {bfsfit} {greek} { - \clist_if_in:NnT \l__um_char_nrange_clist {#3} + \bool_if:NTF \g__um_sfliteral_bool { - \__um_mathmap_noparse:nnn {#1}{#2}{#3} + \__um_set_normal_greek:nn {bfsfit} {#1} + \__um_set_mathalphabet_greek:nnn {bfsf} {it} {#1} } - } -\cs_new:Nn \__um_set_mathalphabet_char:nnnn - { - \__um_set_mathalphabet_char:nnn {#1} { \__um_to_usv:nn {#2} {#4} } - { \__um_to_usv:nn {#3} {#4} } - } -\cs_new:Nn \__um_set_mathalph_range:nnnn - { - \int_step_inline:nnnn {0} {1} {#1-1} - { \__um_set_mathalphabet_char:nnn {#2} { ##1 + #3 } { ##1 + #4 } } - } -\cs_new:Nn \__um_set_mathalph_range:nnnnn - { - \__um_set_mathalph_range:nnnn {#1} {#2} { \__um_to_usv:nn {#3} {#5} } - { \__um_to_usv:nn {#4} {#5} } - } -\cs_new:Nn \__um_set_mathalphabet_pos:nnnn - { - \__um_usv_if_exist:nnT {#4} {#2} { - \clist_map_inline:nn {#3} - { \__um_set_mathalphabet_char:nnnn {#1} {##1} {#4} {#2} } + \bool_if:NF \g__um_upsans_bool + { + \__um_set_normal_greek:nn {bfsfup,bfsfit} {#1} + \__um_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1} + } } + \__um_set_mathalphabet_greek:nnn {bfsfit} {up,it} {#1} } -\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 + +\__um_new_alphabet_config:nnn {bfsfit} {misc} { - \clist_map_inline:nn {#2} + \bool_if:NTF \g__um_literal_Nabla_bool { - \__um_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {latin} - \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {h} + \__um_set_normal_char:nnn {Nabla}{bfsfit}{#1} } - } -\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} + \bool_if:NF \g__um_upNabla_bool + { + \__um_set_normal_char:nnn {Nabla}{bfsfup,bfsfit}{#1} + } } - } -\cs_new:Nn \__um_set_mathalphabet_greek:nnn - { - \clist_map_inline:nn {#2} + \bool_if:NTF \g__um_literal_partial_bool { - \__um_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {greek} - \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {epsilon} - \__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} {phi} - \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varrho} - \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varpi} + \__um_set_normal_char:nnn {partial}{bfsfit}{#1} } - } - -%%^^A%% um-code-epilogue.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> - -\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,epsilon,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,phi,chi,psi,omega, - varTheta,varsigma,vartheta,varkappa,varrho,varpi,varepsilon,varphi + \bool_if:NF \g__um_uppartial_bool + { + \__um_set_normal_char:nnn {partial}{bfsfup,bfsfit}{#1} + } } + \__um_set_mathalphabet_pos:nnnn {bfsfit} {partial} {up,it}{#1} + \__um_set_mathalphabet_pos:nnnn {bfsfit} {Nabla} {up,it}{#1} + \bool_if:NTF \g__um_literal_partial_bool { - \tl_set:cx {##1} { \exp_not:c { mit ##1 } } - \tl_set:cx {up ##1} { \exp_not:N \symup \exp_not:c { ##1 } } - \tl_set:cx {it ##1} { \exp_not:N \symit \exp_not:c { ##1 } } + \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {it}{#1} } - } -\cs_if_exist:NF \Uroot - { \cs_new_eq:NN \Uroot \luatexUroot } -\AtBeginDocument{\__um_redefine_radical:} -\cs_new:Nn \__um_redefine_radical: - { - \@ifpackageloaded { amsmath } { } { - \cs_set:Npn \root ##1 \of ##2 + \bool_if:NF \g__um_uppartial_bool { - \Uroot \l__um_radical_sqrt_tl { ##1 } { ##2 } + \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up,it}{#1} } } - } -\cs_new:Npn \__um_define_active_frac:Nw #1 #2/#3 - { - \char_set_catcode_active:N #1 - \__um_char_gmake_mathactive:N #1 - \tl_rescan:nn + \bool_if:NTF \g__um_literal_Nabla_bool { - \catcode`\_=11\relax - \catcode`\:=11\relax + \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {it}{#1} } { - \cs_gset:Npx #1 + \bool_if:NF \g__um_upNabla_bool { - \bool_if:NTF \l__um_smallfrac_bool {\exp_not:N\tfrac} {\exp_not:N\frac} - {#2} {#3} + \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {up,it}{#1} } } } + +%%^^A%% um-code-epilogue.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Assorted definitions to close up. + +\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,epsilon,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,phi,chi,psi,omega, + varTheta,varsigma,vartheta,varkappa,varrho,varpi,varepsilon,varphi + } + { + \tl_set:cx {##1} { \exp_not:c { mit ##1 } } + \tl_set:cx {up ##1} { \exp_not:N \symup \exp_not:c { ##1 } } + \tl_set:cx {it ##1} { \exp_not:N \symit \exp_not:c { ##1 } } + } + } +\AtBeginDocument{ \@ifpackageloaded { amsmath } { } { \__um_redefine_radical: } } +\cs_new:Nn \__um_redefine_radical: + { + \cs_set:Npn \root ##1 \of ##2 + { + \Uroot \l__um_radical_sqrt_tl { ##1 } { ##2 } + } + } +\cs_new:Nn \__um_which_frac:nn + { + \bool_if:NTF \l__um_smallfrac_bool {\tfrac} {\frac} {#1} {#2} + } \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: + { + \__um_mathactive_remap:nn {"2189} { \__um_which_frac:nn {0} {3} } + \__um_mathactive_remap:nn {"2152} { \__um_which_frac:nn {1} {10} } + \__um_mathactive_remap:nn {"2151} { \__um_which_frac:nn {1} {9} } + \__um_mathactive_remap:nn {"215B} { \__um_which_frac:nn {1} {8} } + \__um_mathactive_remap:nn {"2150} { \__um_which_frac:nn {1} {7} } + \__um_mathactive_remap:nn {"2159} { \__um_which_frac:nn {1} {6} } + \__um_mathactive_remap:nn {"2155} { \__um_which_frac:nn {1} {5} } + \__um_mathactive_remap:nn {"00BC} { \__um_which_frac:nn {1} {4} } + \__um_mathactive_remap:nn {"2153} { \__um_which_frac:nn {1} {3} } + \__um_mathactive_remap:nn {"215C} { \__um_which_frac:nn {3} {8} } + \__um_mathactive_remap:nn {"2156} { \__um_which_frac:nn {2} {5} } + \__um_mathactive_remap:nn {"00BD} { \__um_which_frac:nn {1} {2} } + \__um_mathactive_remap:nn {"2157} { \__um_which_frac:nn {3} {5} } + \__um_mathactive_remap:nn {"215D} { \__um_which_frac:nn {5} {8} } + \__um_mathactive_remap:nn {"2154} { \__um_which_frac:nn {2} {3} } + \__um_mathactive_remap:nn {"00BE} { \__um_which_frac:nn {3} {4} } + \__um_mathactive_remap:nn {"2158} { \__um_which_frac:nn {4} {5} } + \__um_mathactive_remap:nn {"215A} { \__um_which_frac:nn {5} {6} } + \__um_mathactive_remap:nn {"215E} { \__um_which_frac:nn {7} {8} } + } +\AtBeginDocument { \__um_setup_active_frac: } \protected\def\to{\rightarrow} \protected\def\le{\leq} \protected\def\ge{\geq} @@ -2051,19 +3204,19 @@ \protected\def\smallint{\mathop{\textstyle\int}\limits} \cs_set_eq:NN \latexe_underbar:n \underbar \renewcommand\underbar - { - \mode_if_math:TF \mathunderbar \latexe_underbar:n - } + { + \mode_if_math:TF \mathunderbar \latexe_underbar:n + } \@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{:} } - } - } + { + % 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{:} } + } + } \protected\def\digamma{\updigamma} \protected\def\Digamma{\upDigamma} \cs_set_protected:Npn \| {\Vert} @@ -2071,47 +3224,77 @@ \cs_set_protected:Npn \cdots {\mathinner{\unicodecdots}} \cs_set_eq:NN \__um_text_slash: \slash \cs_set_protected:Npn \slash - { - \mode_if_math:TF {\mathslash} {\__um_text_slash:} - } -\cs_new:Npn \__um_newnot:N #1 - { - \tl_set:Nx \l_not_token_name_tl { \token_to_str:N #1 } - \exp_args:Nx \tl_if_empty:nF { \tl_tail:V \l_not_token_name_tl } - { - \tl_set:Nx \l_not_token_name_tl { \tl_tail:V \l_not_token_name_tl } - } - \cs_if_exist:cTF { n \l_not_token_name_tl } - { - \use:c { n \l_not_token_name_tl } - } - { - \cs_if_exist:cTF { not \l_not_token_name_tl } + { + \mode_if_math:TF {\mathslash} {\__um_text_slash:} + } +\DeclareDocumentCommand \not {m} + { + \tl_set:Nx \l__um_not_token_name_tl { \cs_to_str:N #1 } + \tl_if_empty:NT \l__um_not_token_name_tl { - \use:c { not \l_not_token_name_tl } + \tl_set:Nx \l__um_not_token_name_tl { \token_to_str:N #1 } } + \cs_if_exist:cTF { not \l__um_not_token_name_tl } { - \__um_oldnot: #1 + \use:c { not \l__um_not_token_name_tl } } - } - } -\cs_set_eq:NN \__um_oldnot: \not -\AtBeginDocument{\cs_set_eq:NN \not \__um_newnot:N} -\cs_new_protected_nopar:Nn \__um_setup_negations: - { - \cs_gset:cpn { not= } { \neq } - \cs_gset:cpn { not< } { \nless } - \cs_gset:cpn { not> } { \ngtr } - \cs_gset:Npn \ngets { \nleftarrow } - \cs_gset:Npn \nsimeq { \nsime } - \cs_gset:Npn \nequal { \ne } - \cs_gset:Npn \nle { \nleq } - \cs_gset:Npn \nge { \ngeq } - \cs_gset:Npn \ngreater { \ngtr } - \cs_gset:Npn \nforksnot { \forks } - } + { + \cs_if_exist:cTF { n \l__um_not_token_name_tl } + { + \use:c { n \l__um_not_token_name_tl } + } + { + \tl_if_eq:nnTF {#1} {$} { \notaccent{} } { \notaccent } #1 + } + } + } +\DeclareDocumentCommand \NewNegationCommand {mm} + { + \__um_set_negation_command:Nnn \cs_new_protected:cpn {#1} {#2} + } +\DeclareDocumentCommand \RenewNegationCommand {mm} + { + \__um_set_negation_command:Nnn \cs_set_protected:cpn {#1} {#2} + } +\cs_set:Nn \__um_set_negation_command:Nnn + { + \tl_set:Nx \l__um_not_token_name_tl { \cs_to_str:N #2 } + \tl_if_empty:NT \l__um_not_token_name_tl + { + \tl_set:Nx \l__um_not_token_name_tl { \token_to_str:N #2 } + } + #1 { not \l__um_not_token_name_tl } { #3 } + } +\NewNegationCommand { = } { \neq } +\NewNegationCommand { < } { \nless } +\NewNegationCommand { > } { \ngtr } +\NewNegationCommand { \gets } { \nleftarrow } +\NewNegationCommand { \simeq } { \nsime } +\NewNegationCommand { \equal } { \ne } +\NewNegationCommand { \le } { \nleq } +\NewNegationCommand { \ge } { \ngeq } +\NewNegationCommand { \greater } { \ngtr } +\NewNegationCommand { \forksnot } { \forks } +\int_step_inline:nnnn {0} {1} {9} + { + \__um_mathactive_remap:nn {"FF10+#1} {\char\int_eval:n{`\0+#1}} + } +\int_step_inline:nnnn {0} {1} {26} + { + \__um_mathactive_remap:nn {"FF21+#1} {\char\int_eval:n{`\A+#1}} + \__um_mathactive_remap:nn {"FF41+#1} {\char\int_eval:n{`\a+#1}} + } +\cs_new:Nn \__um_undeclare_symbol:N + { + \cs_set_protected:Npn #1 + { \__um_error:nx {legacy-char-not-supported} { \token_to_str:N #1 } } + } +\__um_undeclare_symbol:N \arrowvert +\__um_undeclare_symbol:N \Arrowvert +\__um_undeclare_symbol:N \bracevert %%^^A%% um-code-primes.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% The definitions needed for the input of primes. \cs_new:Nn \__um_arg_i_before_egroup:n {#1\egroup} \cs_new:Nn \__um_superscript:n @@ -2133,17 +3316,17 @@ { {1} { \__um_superscript:n {#1} } {2} { - \__um_glyph_if_exist:NnTF \l__um_font {"2033} + \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2033} { \__um_superscript:n {\__um_prime_double_mchar} } { \__um_nprimes:Nn #1 {#2} } } {3} { - \__um_glyph_if_exist:NnTF \l__um_font {"2034} + \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2034} { \__um_superscript:n {\__um_prime_triple_mchar} } { \__um_nprimes:Nn #1 {#2} } } {4} { - \__um_glyph_if_exist:NnTF \l__um_font {"2057} + \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2057} { \__um_superscript:n {\__um_prime_quad_mchar} } { \__um_nprimes:Nn #1 {#2} } } @@ -2158,12 +3341,12 @@ { {1} { \__um_superscript:n {#1} } {2} { - \__um_glyph_if_exist:NnTF \l__um_font {"2036} + \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2036} { \__um_superscript:n {\__um_backprime_double_mchar} } { \__um_nprimes:Nn #1 {#2} } } {3} { - \__um_glyph_if_exist:NnTF \l__um_font {"2037} + \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2037} { \__um_superscript:n {\__um_backprime_triple_mchar} } { \__um_nprimes:Nn #1 {#2} } } @@ -2395,1171 +3578,299 @@ \group_end: %%^^A%% um-code-sscript.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Setup for active chars needed to process subscript/superscript input chars. -\group_begin: \cs_new:Nn \__um_setup_active_superscript:nn - { - \prop_gput:Nnn \g__um_supers_prop {#1} {#2} - \char_set_catcode_active:N #1 - \__um_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} -\__um_setup_active_superscript:nn {^^^^02b0} {h} -\__um_setup_active_superscript:nn {^^^^02b2} {j} -\__um_setup_active_superscript:nn {^^^^02b3} {r} -\__um_setup_active_superscript:nn {^^^^02b7} {w} -\__um_setup_active_superscript:nn {^^^^02b8} {y} + { + \prop_gput:Nxn \g__um_supers_prop { \int_eval:n {#1} } {#2} + \__um_mathactive_remap:nn {#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: + } + } \cs_new:Nn \__um_setup_active_subscript:nn - { - \prop_gput:Nnn \g__um_subs_prop {#1} {#2} - \char_set_catcode_active:N #1 - \__um_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 {^^^^2095} {h} -\__um_setup_active_subscript:nn {^^^^1d62} {i} -\__um_setup_active_subscript:nn {^^^^2c7c} {j} -\__um_setup_active_subscript:nn {^^^^2096} {k} -\__um_setup_active_subscript:nn {^^^^2097} {l} -\__um_setup_active_subscript:nn {^^^^2098} {m} -\__um_setup_active_subscript:nn {^^^^2099} {n} -\__um_setup_active_subscript:nn {^^^^2092} {o} -\__um_setup_active_subscript:nn {^^^^209a} {p} -\__um_setup_active_subscript:nn {^^^^1d63} {r} -\__um_setup_active_subscript:nn {^^^^209b} {s} -\__um_setup_active_subscript:nn {^^^^209c} {t} -\__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 - { - \peek_N_type:TF - { - \group_align_safe_begin: - \__um_scan_sscript_aux:nnN {#1} {#2} - } - {#2} - } -\cs_new:Npn \__um_scan_sscript_aux:nnN #1#2#3 - { - \prop_get:cnNTF {g__um_\l__um_tmpa_tl _prop} {#3} \l__um_tmpb_tl - { - \tl_put_right:NV \l__um_ss_chain_tl \l__um_tmpb_tl - \group_align_safe_end: - #1 - } - { \group_align_safe_end: #2 #3 } - } + { + \prop_gput:Nxn \g__um_subs_prop { \int_eval:n {#1} } {#2} + \__um_mathactive_remap:nn {#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: + } + } +\cs_new:Nn \__um_scan_sscript: + { + \__um_scan_sscript:TF + { \__um_scan_sscript: } + { \__um_sub_or_super:n {\l__um_ss_chain_tl} } + } +\cs_new:Nn \__um_scan_sscript:TF + { + \peek_N_type:TF + { + \group_align_safe_begin: + \__um_scan_sscript_aux:nnN {#1} {#2} + } + {#2} + } +\cs_new:Nn \__um_scan_sscript_aux:nnN + { + \tl_set:Nx \l__um_tmpa_key_tl { \tl_to_str:n {#3} } + \prop_get:cxNTF {g__um_\l__um_tmpa_tl _prop} + { \int_eval:n { \exp_after:wN ` \l__um_tmpa_key_tl } } + \l__um_tmpb_tl + { + \tl_put_right:NV \l__um_ss_chain_tl \l__um_tmpb_tl + \group_align_safe_end: + #1 + } + { \group_align_safe_end: #2 #3 } + } +\__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} +\__um_setup_active_superscript:nn {"02B0} {h} +\__um_setup_active_superscript:nn {"02B2} {j} +\__um_setup_active_superscript:nn {"02B3} {r} +\__um_setup_active_superscript:nn {"02B7} {w} +\__um_setup_active_superscript:nn {"02B8} {y} +\__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 {"2095} {h} +\__um_setup_active_subscript:nn {"1D62} {i} +\__um_setup_active_subscript:nn {"2C7C} {j} +\__um_setup_active_subscript:nn {"2096} {k} +\__um_setup_active_subscript:nn {"2097} {l} +\__um_setup_active_subscript:nn {"2098} {m} +\__um_setup_active_subscript:nn {"2099} {n} +\__um_setup_active_subscript:nn {"2092} {o} +\__um_setup_active_subscript:nn {"209A} {p} +\__um_setup_active_subscript:nn {"1D63} {r} +\__um_setup_active_subscript:nn {"209B} {s} +\__um_setup_active_subscript:nn {"209C} {t} +\__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} %%^^A%% um-code-compat.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Compatibility with 3rd party packages. -\cs_new_protected_nopar:Nn \__um_check_and_fix:NNnnnn - { - \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:Nn \__um_check_and_fix:NNnnn - { - \__um_check_and_fix:NNnnnn #1 #2 { #3 } { #4 } { #5 } { #5 } - } -\cs_new_protected_nopar:Nn \__um_check_and_fix_luatex:NNnnn - { - \__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_up: } - \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 } - } - { - \Uroot \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 - } - \Uroot \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 - } + { + \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 } + } } - } - { #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 * {url} + { + \tl_put_left:Nn \Url@FormatString { \__um_switchto_up: } + \tl_put_right:Nn \UrlSpecials + { + \do \` { \mathchar`\` } + \do \' { \mathchar`\' } + \do \$ { \mathchar`\$ } + \do \& { \mathchar`\& } + } + } \AtEndOfPackageFile * { mathtools } - { + { \cs_set_eq:NN \MToverbracket \overbracket \cs_set_eq:NN \MTunderbracket \underbracket \AtBeginDocument - { - \msg_warning:nn { unicode-math } { mathtools-overbracket } + { + \msg_warning:nn { unicode-math } { mathtools-overbracket } -\def\downbracketfill#1#2 - {% - \edef\l_MT_bracketheight_fdim{.27ex}% - \downbracketend{#1}{#2} + \cs_set:Npn \downbracketfill #1 #2 + { + \tl_set:Nn \l_MT_bracketheight_fdim {.27ex} + \downbracketend {#1} {#2} \leaders \vrule \@height #1 \@depth \z@ \hfill - \downbracketend{#1}{#2}% - } -\def\upbracketfill#1#2 - {% - \edef\l_MT_bracketheight_fdim{.27ex}% - \upbracketend{#1}{#2} - \leaders \vrule \@height \z@ \@depth #1 \hfill - \upbracketend{#1}{#2}% - } -\let\Uoverbracket =\overbracket -\let\Uunderbracket=\underbracket - \let\overbracket =\MToverbracket - \let\underbracket =\MTunderbracket - }% end of AtBeginDocument - \msg_warning:nn { unicode-math } { mathtools-colon } - \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 } - } - -%%^^A%% um-code-alphabets.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> - -\__um_new_alphabet_config:nnn {up} {num} - { - \__um_set_normal_numbers:nn {up} {#1} - \__um_set_mathalphabet_numbers:nnn {up} {up} {#1} - } - -\__um_new_alphabet_config:nnn {up} {Latin} - { - \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Latin:nn {up} {#1} } - { - \bool_if:NT \g__um_upLatin_bool { \__um_set_normal_Latin:nn {up,it} {#1} } - } - \__um_set_mathalphabet_Latin:nnn {up} {up,it} {#1} - \__um_set_mathalphabet_Latin:nnn {literal} {up} {up} - \__um_set_mathalphabet_Latin:nnn {literal} {it} {it} - } - -\__um_new_alphabet_config:nnn {up} {latin} - { - \bool_if:NTF \g__um_literal_bool { \__um_set_normal_latin:nn {up} {#1} } - { - \bool_if:NT \g__um_uplatin_bool - { - \__um_set_normal_latin:nn {up,it} {#1} - \__um_set_normal_char:nnn {h} {up,it} {#1} - \__um_set_normal_char:nnn {dotlessi} {up,it} {#1} - \__um_set_normal_char:nnn {dotlessj} {up,it} {#1} - } - } - \__um_set_mathalphabet_latin:nnn {up} {up,it}{#1} - \__um_set_mathalphabet_latin:nnn {literal} {up} {up} - \__um_set_mathalphabet_latin:nnn {literal} {it} {it} - } - -\__um_new_alphabet_config:nnn {up} {Greek} - { - \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Greek:nn {up}{#1} } - { - \bool_if:NT \g__um_upGreek_bool { \__um_set_normal_Greek:nn {up,it}{#1} } - } - \__um_set_mathalphabet_Greek:nnn {up} {up,it}{#1} - \__um_set_mathalphabet_Greek:nnn {literal} {up} {up} - \__um_set_mathalphabet_Greek:nnn {literal} {it} {it} - } - -\__um_new_alphabet_config:nnn {up} {greek} - { - \bool_if:NTF \g__um_literal_bool { \__um_set_normal_greek:nn {up} {#1} } - { - \bool_if:NT \g__um_upgreek_bool - { - \__um_set_normal_greek:nn {up,it} {#1} - } - } - \__um_set_mathalphabet_greek:nnn {up} {up,it} {#1} - \__um_set_mathalphabet_greek:nnn {literal} {up} {up} - \__um_set_mathalphabet_greek:nnn {literal} {it} {it} - } - -\__um_new_alphabet_config:nnn {up} {misc} - { - \bool_if:NTF \g__um_literal_Nabla_bool - { - \__um_set_normal_char:nnn {Nabla}{up}{up} - } - { - \bool_if:NT \g__um_upNabla_bool - { - \__um_set_normal_char:nnn {Nabla}{up,it}{up} - } - } - \bool_if:NTF \g__um_literal_partial_bool - { - \__um_set_normal_char:nnn {partial}{up}{up} - } - { - \bool_if:NT \g__um_uppartial_bool - { - \__um_set_normal_char:nnn {partial}{up,it}{up} - } - } - \__um_set_mathalphabet_pos:nnnn {up} {partial} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {up} {Nabla} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {up} {dotlessi} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {up} {dotlessj} {up,it} {#1} - } -\__um_new_alphabet_config:nnn {it} {Latin} - { - \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Latin:nn {it} {#1} } - { - \bool_if:NF \g__um_upLatin_bool { \__um_set_normal_Latin:nn {up,it} {#1} } - } - \__um_set_mathalphabet_Latin:nnn {it}{up,it}{#1} - } - -\__um_new_alphabet_config:nnn {it} {latin} - { - \bool_if:NTF \g__um_literal_bool - { - \__um_set_normal_latin:nn {it} {#1} - \__um_set_normal_char:nnn {h}{it}{#1} - } - { - \bool_if:NF \g__um_uplatin_bool - { - \__um_set_normal_latin:nn {up,it} {#1} - \__um_set_normal_char:nnn {h}{up,it}{#1} - \__um_set_normal_char:nnn {dotlessi}{up,it}{#1} - \__um_set_normal_char:nnn {dotlessj}{up,it}{#1} - } - } - \__um_set_mathalphabet_latin:nnn {it} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {it} {dotlessi} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {it} {dotlessj} {up,it} {#1} - } - -\__um_new_alphabet_config:nnn {it} {Greek} - { - \bool_if:NTF \g__um_literal_bool - { - \__um_set_normal_Greek:nn {it}{#1} - } - { - \bool_if:NF \g__um_upGreek_bool { \__um_set_normal_Greek:nn {up,it}{#1} } - } - \__um_set_mathalphabet_Greek:nnn {it} {up,it}{#1} - } - -\__um_new_alphabet_config:nnn {it} {greek} - { - \bool_if:NTF \g__um_literal_bool - { - \__um_set_normal_greek:nn {it} {#1} - } - { - \bool_if:NF \g__um_upgreek_bool { \__um_set_normal_greek:nn {it,up} {#1} } - } - \__um_set_mathalphabet_greek:nnn {it} {up,it} {#1} - } - -\__um_new_alphabet_config:nnn {it} {misc} - { - \bool_if:NTF \g__um_literal_Nabla_bool - { - \__um_set_normal_char:nnn {Nabla}{it}{it} - } - { - \bool_if:NF \g__um_upNabla_bool - { - \__um_set_normal_char:nnn {Nabla}{up,it}{it} - } - } - \bool_if:NTF \g__um_literal_partial_bool - { - \__um_set_normal_char:nnn {partial}{it}{it} - } - { - \bool_if:NF \g__um_uppartial_bool - { - \__um_set_normal_char:nnn {partial}{up,it}{it} - } - } - \__um_set_mathalphabet_pos:nnnn {it} {partial} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {it} {Nabla} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {bb} {latin} - { - \__um_set_mathalphabet_latin:nnn {bb} {up,it}{#1} - } - -\__um_new_alphabet_config:nnn {bb} {Latin} - { - \__um_set_mathalphabet_Latin:nnn {bb} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {bb} {C} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {H} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {N} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {P} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {Q} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {R} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {Z} {up,it} {#1} - } - -\__um_new_alphabet_config:nnn {bb} {num} - { - \__um_set_mathalphabet_numbers:nnn {bb} {up}{#1} - } - -\__um_new_alphabet_config:nnn {bb} {misc} - { - \__um_set_mathalphabet_pos:nnnn {bb} {Pi} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {pi} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {Gamma} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {gamma} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {summation} {up} {#1} - } - -\__um_new_alphabet_config:nnn {bbit} {misc} - { - \__um_set_mathalphabet_pos:nnnn {bbit} {D} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bbit} {d} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bbit} {e} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bbit} {i} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bbit} {j} {up,it} {#1} - } -\__um_new_alphabet_config:nnn {scr} {Latin} - { - \__um_set_mathalphabet_Latin:nnn {scr} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {B}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {E}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {F}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {H}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {I}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {L}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {M}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {R}{up,it}{#1} - } - -\__um_new_alphabet_config:nnn {scr} {latin} - { - \__um_set_mathalphabet_latin:nnn {scr} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {e}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {g}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {o}{up,it}{#1} - } -\__um_new_alphabet_config:nnn {cal} {Latin} - { - \__um_set_mathalphabet_Latin:nnn {cal} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {cal} {B}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {cal} {E}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {cal} {F}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {cal} {H}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {cal} {I}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {cal} {L}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {cal} {M}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {cal} {R}{up,it}{#1} - } -\__um_new_alphabet_config:nnn {frak} {Latin} - { - \__um_set_mathalphabet_Latin:nnn {frak} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {frak} {C}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {frak} {H}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {frak} {I}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {frak} {R}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {frak} {Z}{up,it}{#1} - } -\__um_new_alphabet_config:nnn {frak} {latin} - { - \__um_set_mathalphabet_latin:nnn {frak} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {sfup} {num} - { - \__um_set_mathalphabet_numbers:nnn {sf} {up}{#1} - \__um_set_mathalphabet_numbers:nnn {sfup} {up}{#1} - } -\__um_new_alphabet_config:nnn {sfup} {Latin} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_Latin:nn {sfup} {#1} - \__um_set_mathalphabet_Latin:nnn {sf} {up}{#1} - } - { - \bool_if:NT \g__um_upsans_bool - { - \__um_set_normal_Latin:nn {sfup,sfit} {#1} - \__um_set_mathalphabet_Latin:nnn {sf} {up,it}{#1} - } - } - \__um_set_mathalphabet_Latin:nnn {sfup} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {sfup} {latin} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_latin:nn {sfup} {#1} - \__um_set_mathalphabet_latin:nnn {sf} {up}{#1} - } - { - \bool_if:NT \g__um_upsans_bool - { - \__um_set_normal_latin:nn {sfup,sfit} {#1} - \__um_set_mathalphabet_latin:nnn {sf} {up,it}{#1} - } - } - \__um_set_mathalphabet_latin:nnn {sfup} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {sfit} {Latin} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_Latin:nn {sfit} {#1} - \__um_set_mathalphabet_Latin:nnn {sf} {it}{#1} - } - { - \bool_if:NF \g__um_upsans_bool - { - \__um_set_normal_Latin:nn {sfup,sfit} {#1} - \__um_set_mathalphabet_Latin:nnn {sf} {up,it}{#1} - } - } - \__um_set_mathalphabet_Latin:nnn {sfit} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {sfit} {latin} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_latin:nn {sfit} {#1} - \__um_set_mathalphabet_latin:nnn {sf} {it}{#1} - } - { - \bool_if:NF \g__um_upsans_bool - { - \__um_set_normal_latin:nn {sfup,sfit} {#1} - \__um_set_mathalphabet_latin:nnn {sf} {up,it}{#1} - } - } - \__um_set_mathalphabet_latin:nnn {sfit} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {tt} {num} - { - \__um_set_mathalphabet_numbers:nnn {tt} {up}{#1} - } -\__um_new_alphabet_config:nnn {tt} {Latin} - { - \__um_set_mathalphabet_Latin:nnn {tt} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {tt} {latin} - { - \__um_set_mathalphabet_latin:nnn {tt} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {bfit} {Latin} - { - \bool_if:NF \g__um_bfupLatin_bool - { - \__um_set_normal_Latin:nn {bfup,bfit} {#1} - } - \__um_set_mathalphabet_Latin:nnn {bfit} {up,it}{#1} - \bool_if:NTF \g__um_bfliteral_bool - { - \__um_set_normal_Latin:nn {bfit} {#1} - \__um_set_mathalphabet_Latin:nnn {bf} {it}{#1} - } - { - \bool_if:NF \g__um_bfupLatin_bool - { - \__um_set_normal_Latin:nn {bfup,bfit} {#1} - \__um_set_mathalphabet_Latin:nnn {bf} {up,it}{#1} - } - } - } - -\__um_new_alphabet_config:nnn {bfit} {latin} - { - \bool_if:NF \g__um_bfuplatin_bool - { - \__um_set_normal_latin:nn {bfup,bfit} {#1} - } - \__um_set_mathalphabet_latin:nnn {bfit} {up,it}{#1} - \bool_if:NTF \g__um_bfliteral_bool - { - \__um_set_normal_latin:nn {bfit} {#1} - \__um_set_mathalphabet_latin:nnn {bf} {it}{#1} - } - { - \bool_if:NF \g__um_bfuplatin_bool - { - \__um_set_normal_latin:nn {bfup,bfit} {#1} - \__um_set_mathalphabet_latin:nnn {bf} {up,it}{#1} - } - } - } - -\__um_new_alphabet_config:nnn {bfit} {Greek} - { - \__um_set_mathalphabet_Greek:nnn {bfit} {up,it}{#1} - \bool_if:NTF \g__um_bfliteral_bool - { - \__um_set_normal_Greek:nn {bfit}{#1} - \__um_set_mathalphabet_Greek:nnn {bf} {it}{#1} - } - { - \bool_if:NF \g__um_bfupGreek_bool - { - \__um_set_normal_Greek:nn {bfup,bfit}{#1} - \__um_set_mathalphabet_Greek:nnn {bf} {up,it}{#1} - } - } - } - -\__um_new_alphabet_config:nnn {bfit} {greek} - { - \__um_set_mathalphabet_greek:nnn {bfit} {up,it} {#1} - \bool_if:NTF \g__um_bfliteral_bool - { - \__um_set_normal_greek:nn {bfit} {#1} - \__um_set_mathalphabet_greek:nnn {bf} {it} {#1} - } - { - \bool_if:NF \g__um_bfupgreek_bool - { - \__um_set_normal_greek:nn {bfit,bfup} {#1} - \__um_set_mathalphabet_greek:nnn {bf} {up,it} {#1} - } - } - } - -\__um_new_alphabet_config:nnn {bfit} {misc} - { - \bool_if:NTF \g__um_literal_Nabla_bool - { \__um_set_normal_char:nnn {Nabla}{bfit}{#1} } - { - \bool_if:NF \g__um_upNabla_bool - { \__um_set_normal_char:nnn {Nabla}{bfup,bfit}{#1} } - } - \bool_if:NTF \g__um_literal_partial_bool - { \__um_set_normal_char:nnn {partial}{bfit}{#1} } - { - \bool_if:NF \g__um_uppartial_bool - { \__um_set_normal_char:nnn {partial}{bfup,bfit}{#1} } - } - \__um_set_mathalphabet_pos:nnnn {bfit} {partial} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {bfit} {Nabla} {up,it}{#1} - \bool_if:NTF \g__um_literal_partial_bool - { - \__um_set_mathalphabet_pos:nnnn {bf} {partial} {it}{#1} - } - { - \bool_if:NF \g__um_uppartial_bool - { - \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up,it}{#1} - } - } - \bool_if:NTF \g__um_literal_Nabla_bool - { - \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {it}{#1} - } - { - \bool_if:NF \g__um_upNabla_bool - { - \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {up,it}{#1} - } - } - } -\__um_new_alphabet_config:nnn {bfup} {num} - { - \__um_set_mathalphabet_numbers:nnn {bf} {up}{#1} - \__um_set_mathalphabet_numbers:nnn {bfup} {up}{#1} - } - -\__um_new_alphabet_config:nnn {bfup} {Latin} - { - \bool_if:NT \g__um_bfupLatin_bool - { - \__um_set_normal_Latin:nn {bfup,bfit} {#1} - } - \__um_set_mathalphabet_Latin:nnn {bfup} {up,it}{#1} - \bool_if:NTF \g__um_bfliteral_bool - { - \__um_set_normal_Latin:nn {bfup} {#1} - \__um_set_mathalphabet_Latin:nnn {bf} {up}{#1} - } - { - \bool_if:NT \g__um_bfupLatin_bool - { - \__um_set_normal_Latin:nn {bfup,bfit} {#1} - \__um_set_mathalphabet_Latin:nnn {bf} {up,it}{#1} - } - } - } - -\__um_new_alphabet_config:nnn {bfup} {latin} - { - \bool_if:NT \g__um_bfuplatin_bool - { - \__um_set_normal_latin:nn {bfup,bfit} {#1} - } - \__um_set_mathalphabet_latin:nnn {bfup} {up,it}{#1} - \bool_if:NTF \g__um_bfliteral_bool - { - \__um_set_normal_latin:nn {bfup} {#1} - \__um_set_mathalphabet_latin:nnn {bf} {up}{#1} - } - { - \bool_if:NT \g__um_bfuplatin_bool - { - \__um_set_normal_latin:nn {bfup,bfit} {#1} - \__um_set_mathalphabet_latin:nnn {bf} {up,it}{#1} - } - } - } -\__um_new_alphabet_config:nnn {bfup} {Greek} - { - \__um_set_mathalphabet_Greek:nnn {bfup} {up,it}{#1} - \bool_if:NTF \g__um_bfliteral_bool - { - \__um_set_normal_Greek:nn {bfup}{#1} - \__um_set_mathalphabet_Greek:nnn {bf} {up}{#1} - } - { - \bool_if:NT \g__um_bfupGreek_bool - { - \__um_set_normal_Greek:nn {bfup,bfit}{#1} - \__um_set_mathalphabet_Greek:nnn {bf} {up,it}{#1} - } - } - } - -\__um_new_alphabet_config:nnn {bfup} {greek} - { - \__um_set_mathalphabet_greek:nnn {bfup} {up,it} {#1} - \bool_if:NTF \g__um_bfliteral_bool - { - \__um_set_normal_greek:nn {bfup} {#1} - \__um_set_mathalphabet_greek:nnn {bf} {up} {#1} - } - { - \bool_if:NT \g__um_bfupgreek_bool - { - \__um_set_normal_greek:nn {bfup,bfit} {#1} - \__um_set_mathalphabet_greek:nnn {bf} {up,it} {#1} - } - } - } - -\__um_new_alphabet_config:nnn {bfup} {misc} - { - \bool_if:NTF \g__um_literal_Nabla_bool - { - \__um_set_normal_char:nnn {Nabla}{bfup}{#1} - } - { - \bool_if:NT \g__um_upNabla_bool - { - \__um_set_normal_char:nnn {Nabla}{bfup,bfit}{#1} - } - } - \bool_if:NTF \g__um_literal_partial_bool - { - \__um_set_normal_char:nnn {partial}{bfup}{#1} - } - { - \bool_if:NT \g__um_uppartial_bool - { - \__um_set_normal_char:nnn {partial}{bfup,bfit}{#1} - } - } - \__um_set_mathalphabet_pos:nnnn {bfup} {partial} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {bfup} {Nabla} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {bfup} {digamma} {up}{#1} - \__um_set_mathalphabet_pos:nnnn {bfup} {Digamma} {up}{#1} - \__um_set_mathalphabet_pos:nnnn {bf} {digamma} {up}{#1} - \__um_set_mathalphabet_pos:nnnn {bf} {Digamma} {up}{#1} - \bool_if:NTF \g__um_literal_partial_bool - { - \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up}{#1} - } - { - \bool_if:NT \g__um_uppartial_bool - { - \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up,it}{#1} - } - } - \bool_if:NTF \g__um_literal_Nabla_bool - { - \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {up}{#1} - } - { - \bool_if:NT \g__um_upNabla_bool - { - \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {up,it}{#1} - } - } - } -\__um_new_alphabet_config:nnn {bffrak} {Latin} - { - \__um_set_mathalphabet_Latin:nnn {bffrak} {up,it}{#1} - } - -\__um_new_alphabet_config:nnn {bffrak} {latin} - { - \__um_set_mathalphabet_latin:nnn {bffrak} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {bfscr} {Latin} - { - \__um_set_mathalphabet_Latin:nnn {bfscr} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {bfscr} {latin} - { - \__um_set_mathalphabet_latin:nnn {bfscr} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {bfcal} {Latin} - { - \__um_set_mathalphabet_Latin:nnn {bfcal} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {bfsfup} {num} - { - \__um_set_mathalphabet_numbers:nnn {bfsf} {up}{#1} - \__um_set_mathalphabet_numbers:nnn {bfsfup} {up}{#1} - } -\__um_new_alphabet_config:nnn {bfsfup} {Latin} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_Latin:nn {bfsfup} {#1} - \__um_set_mathalphabet_Latin:nnn {bfsf} {up}{#1} - } - { - \bool_if:NT \g__um_upsans_bool - { - \__um_set_normal_Latin:nn {bfsfup,bfsfit} {#1} - \__um_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1} - } - } - \__um_set_mathalphabet_Latin:nnn {bfsfup} {up,it}{#1} - } - -\__um_new_alphabet_config:nnn {bfsfup} {latin} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_latin:nn {bfsfup} {#1} - \__um_set_mathalphabet_latin:nnn {bfsf} {up}{#1} - } - { - \bool_if:NT \g__um_upsans_bool - { - \__um_set_normal_latin:nn {bfsfup,bfsfit} {#1} - \__um_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1} - } - } - \__um_set_mathalphabet_latin:nnn {bfsfup} {up,it}{#1} - } - -\__um_new_alphabet_config:nnn {bfsfup} {Greek} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_Greek:nn {bfsfup}{#1} - \__um_set_mathalphabet_Greek:nnn {bfsf} {up}{#1} - } - { - \bool_if:NT \g__um_upsans_bool - { - \__um_set_normal_Greek:nn {bfsfup,bfsfit}{#1} - \__um_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1} - } - } - \__um_set_mathalphabet_Greek:nnn {bfsfup} {up,it}{#1} - } - -\__um_new_alphabet_config:nnn {bfsfup} {greek} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_greek:nn {bfsfup} {#1} - \__um_set_mathalphabet_greek:nnn {bfsf} {up} {#1} - } - { - \bool_if:NT \g__um_upsans_bool - { - \__um_set_normal_greek:nn {bfsfup,bfsfit} {#1} - \__um_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1} - } - } - \__um_set_mathalphabet_greek:nnn {bfsfup} {up,it} {#1} - } -\__um_new_alphabet_config:nnn {bfsfup} {misc} - { - \bool_if:NTF \g__um_literal_Nabla_bool - { - \__um_set_normal_char:nnn {Nabla}{bfsfup}{#1} - } - { - \bool_if:NT \g__um_upNabla_bool - { - \__um_set_normal_char:nnn {Nabla}{bfsfup,bfsfit}{#1} - } - } - \bool_if:NTF \g__um_literal_partial_bool - { - \__um_set_normal_char:nnn {partial}{bfsfup}{#1} - } - { - \bool_if:NT \g__um_uppartial_bool - { - \__um_set_normal_char:nnn {partial}{bfsfup,bfsfit}{#1} - } - } - \__um_set_mathalphabet_pos:nnnn {bfsfup} {partial} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {bfsfup} {Nabla} {up,it}{#1} - \bool_if:NTF \g__um_literal_partial_bool - { - \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up}{#1} - } - { - \bool_if:NT \g__um_uppartial_bool - { - \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up,it}{#1} - } - } - \bool_if:NTF \g__um_literal_Nabla_bool - { - \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {up}{#1} - } - { - \bool_if:NT \g__um_upNabla_bool - { - \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {up,it}{#1} - } - } - } -\__um_new_alphabet_config:nnn {bfsfit} {Latin} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_Latin:nn {bfsfit} {#1} - \__um_set_mathalphabet_Latin:nnn {bfsf} {it}{#1} - } - { - \bool_if:NF \g__um_upsans_bool - { - \__um_set_normal_Latin:nn {bfsfup,bfsfit} {#1} - \__um_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1} - } - } - \__um_set_mathalphabet_Latin:nnn {bfsfit} {up,it}{#1} - } + \downbracketend {#1} {#2} + } -\__um_new_alphabet_config:nnn {bfsfit} {latin} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_latin:nn {bfsfit} {#1} - \__um_set_mathalphabet_latin:nnn {bfsf} {it}{#1} - } - { - \bool_if:NF \g__um_upsans_bool - { - \__um_set_normal_latin:nn {bfsfup,bfsfit} {#1} - \__um_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1} - } - } - \__um_set_mathalphabet_latin:nnn {bfsfit} {up,it}{#1} - } + \cs_set:Npn \upbracketfill #1 #2 + { + \tl_set:Nn \l_MT_bracketheight_fdim {.27ex} + \upbracketend {#1} {#2} + \leaders \vrule \@height \z@ \@depth #1 \hfill + \upbracketend {#1} {#2} + } -\__um_new_alphabet_config:nnn {bfsfit} {Greek} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_Greek:nn {bfsfit}{#1} - \__um_set_mathalphabet_Greek:nnn {bfsf} {it}{#1} - } - { - \bool_if:NF \g__um_upsans_bool - { - \__um_set_normal_Greek:nn {bfsfup,bfsfit}{#1} - \__um_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1} + \cs_set_eq:NN \Uoverbracket \overbracket + \cs_set_eq:NN \Uunderbracket \underbracket + \cs_set_eq:NN \overbracket \MToverbracket + \cs_set_eq:NN \underbracket \MTunderbracket } - } - \__um_set_mathalphabet_Greek:nnn {bfsfit} {up,it}{#1} - } + } +\AtEndOfPackageFile * { mathtools } + { + \msg_warning:nn { unicode-math } { mathtools-colon } + \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 } + } -\__um_new_alphabet_config:nnn {bfsfit} {greek} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_greek:nn {bfsfit} {#1} - \__um_set_mathalphabet_greek:nnn {bfsf} {it} {#1} - } - { - \bool_if:NF \g__um_upsans_bool - { - \__um_set_normal_greek:nn {bfsfup,bfsfit} {#1} - \__um_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1} - } - } - \__um_set_mathalphabet_greek:nnn {bfsfit} {up,it} {#1} - } +%%^^A%% um-code-amsmath.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Compatibility with amsmath. -\__um_new_alphabet_config:nnn {bfsfit} {misc} - { - \bool_if:NTF \g__um_literal_Nabla_bool - { - \__um_set_normal_char:nnn {Nabla}{bfsfit}{#1} - } - { - \bool_if:NF \g__um_upNabla_bool - { - \__um_set_normal_char:nnn {Nabla}{bfsfup,bfsfit}{#1} - } - } - \bool_if:NTF \g__um_literal_partial_bool - { - \__um_set_normal_char:nnn {partial}{bfsfit}{#1} - } - { - \bool_if:NF \g__um_uppartial_bool - { - \__um_set_normal_char:nnn {partial}{bfsfup,bfsfit}{#1} - } - } - \__um_set_mathalphabet_pos:nnnn {bfsfit} {partial} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {bfsfit} {Nabla} {up,it}{#1} - \bool_if:NTF \g__um_literal_partial_bool - { - \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {it}{#1} - } - { - \bool_if:NF \g__um_uppartial_bool - { - \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up,it}{#1} - } - } - \bool_if:NTF \g__um_literal_Nabla_bool - { - \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {it}{#1} - } - { - \bool_if:NF \g__um_upNabla_bool - { - \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {up,it}{#1} - } - } - } +\AtEndOfPackageFile * {amsmath} + { + \tl_remove_once:Nn \@begindocumenthook + { + \mathchardef\std@minus\mathcode`\-\relax + \mathchardef\std@equal\mathcode`\=\relax + } + \AtBeginDocument + { + \Umathcharnumdef\std@minus\Umathcodenum`- + \Umathcharnumdef\std@equal\Umathcodenum`= + } + \cs_set:Npn \@cdots {\mathinner{\unicodecdots}} + \cs_set_eq:NN \dotsb@ \cdots + \__um_check_and_fix: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 } + } + { + \Uroot \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:NNnnn \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 + } + \Uroot \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 } + } + } 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 481ebcc00ef..903f6d4e36f 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 @@ -1,4 +1,5 @@ %%^^A%% unicode-math-table.tex -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Source file of the math symbols. \UnicodeMathSymbol{"00021}{\mathexclam }{\mathclose}{exclamation mark}% \UnicodeMathSymbol{"00023}{\mathoctothorpe }{\mathord}{number sign}% @@ -58,7 +59,7 @@ \UnicodeMathSymbol{"0031A}{\droang }{\mathaccent}{left angle above (non-spacing)}% \UnicodeMathSymbol{"00330}{\wideutilde }{\mathbotaccentwide}{under tilde accent (multiple characters and non-spacing)}% \UnicodeMathSymbol{"00332}{\mathunderbar }{\mathbotaccentwide}{combining low line}% -\UnicodeMathSymbol{"00338}{\not }{\mathaccent}{combining long solidus overlay}% +\UnicodeMathSymbol{"00338}{\notaccent }{\mathaccentoverlay}{combining long solidus overlay}% \UnicodeMathSymbol{"0034D}{\underleftrightarrow }{\mathbotaccentwide}{underleftrightarrow accent}% \UnicodeMathSymbol{"00391}{\mupAlpha }{\mathalpha}{capital alpha, greek}% \UnicodeMathSymbol{"00392}{\mupBeta }{\mathalpha}{capital beta, greek}% @@ -119,6 +120,7 @@ \UnicodeMathSymbol{"003F4}{\mupvarTheta }{\mathalpha}{greek capital theta symbol}% \UnicodeMathSymbol{"003F5}{\mupepsilon }{\mathalpha}{greek lunate varepsilon symbol}% \UnicodeMathSymbol{"003F6}{\upbackepsilon }{\mathord}{greek reversed lunate epsilon symbol}% +\UnicodeMathSymbol{"02010}{\mathhyphen }{\mathalpha}{hyphen}% \UnicodeMathSymbol{"02015}{\horizbar }{\mathord}{horizontal bar}% \UnicodeMathSymbol{"02016}{\Vert }{\mathfence}{double vertical bar}% \UnicodeMathSymbol{"02017}{\twolowline }{\mathord}{double low line (spacing)}% @@ -999,7 +1001,7 @@ \UnicodeMathSymbol{"0297F}{\downfishtail }{\mathrel}{down fish tail}% \UnicodeMathSymbol{"02980}{\Vvert }{\mathfence}{triple vertical bar delimiter}% \UnicodeMathSymbol{"02981}{\mdsmblkcircle }{\mathord}{z notation spot}% -\UnicodeMathSymbol{"02982}{\typecolon }{\mathbin}{z notation type colon}% +\UnicodeMathSymbol{"02982}{\typecolon }{\mathrel}{z notation type colon}% \UnicodeMathSymbol{"02983}{\lBrace }{\mathopen}{left white curly bracket}% \UnicodeMathSymbol{"02984}{\rBrace }{\mathclose}{right white curly bracket}% \UnicodeMathSymbol{"02985}{\lParen }{\mathopen}{left white parenthesis}% @@ -2455,7 +2457,7 @@ % the conditions of the LaTeX Project Public License, version 1.3c or higher % (your choice): <http://www.latex-project.org/lppl/>. % ------------------------------------------------ -% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +% Copyright 2006-2018 Will Robertson, LPPL "maintainer" % Copyright 2010-2017 Philipp Stephani % Copyright 2011-2017 Joseph Wright % Copyright 2012-2015 Khaled Hosny 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 index 97ac7035626..d490e0014ae 100644 --- a/Master/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty +++ b/Master/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty @@ -19,11 +19,13 @@ %% um-code-fontopt.dtx (with options: `package,XE') %% um-code-fontparam.dtx (with options: `package,XE') %% um-code-mathmap.dtx (with options: `package,XE') +%% um-code-sym-commands.dtx (with options: `package,XE') +%% um-code-alphabets.dtx (with options: `package,XE') %% um-code-epilogue.dtx (with options: `package,XE') %% um-code-primes.dtx (with options: `package,XE') %% um-code-sscript.dtx (with options: `package,XE') %% um-code-compat.dtx (with options: `package,XE') -%% um-code-alphabets.dtx (with options: `package,XE') +%% um-code-amsmath.dtx (with options: `package,XE') %% ------------------------------------------------ %% The UNICODE-MATH package <wspr.io/unicode-math> %% ------------------------------------------------ @@ -37,19 +39,27 @@ %% Copyright 2012-2015 Khaled Hosny %% ------------------------------------------------ %%^^A%% unicode-math.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Metadata for the package code, including files and versioning \ProvidesPackage{unicode-math-xetex} - [2017/11/18 v0.8i Unicode maths in XeLaTeX and LuaLaTeX] + [2018/01/07 v0.8j Unicode maths in XeLaTeX and LuaLaTeX] %%^^A%% um-code-base.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Definition of unicode-math.sty, which splits and loads according to engine. %%^^A%% um-code-opening.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Assorted initialisation tasks, including some low-level function definitions. \ExplSyntaxOn \cs_set_protected_nopar:Npn \exp_last_unbraced:NNx { \::N \::x_unbraced \::: } \cs_generate_variant:Nn \fontspec_set_family:Nnn {Nx} -\cs_generate_variant:Nn \fontspec_set_fontface:NNnn {NNx} +\cs_generate_variant:Nn \prop_get:NnNTF {cx} +\cs_generate_variant:Nn \tl_if_eq:nnF {o} +\cs_set_eq:NN \__um_group_begin: \group_begin: +\cs_set_eq:NN \__um_group_end: \group_end: +\cs_set_eq:NN \__um_group_begin_frozen: \__um_group_begin: +\cs_set_eq:NN \__um_group_end_frozen: \__um_group_end: \prg_new_conditional:Nnn \__um_glyph_if_exist:Nn {p,TF,T,F} { \etex_iffontchar:D #1 #2 \scan_stop: @@ -58,6 +68,11 @@ \prg_return_false: \fi: } +\cs_set_protected:Nn \__um_fontface_gset_eq:NN + { + \tex_global:D \tex_let:D #1 #2 + } +\cs_generate_variant:Nn \__um_fontface_gset_eq:NN {NV,cV} \cs_set:Npn \__um_set_mathcode:nnnn #1#2#3#4 { \Umathcode \int_eval:n {#1} = @@ -92,23 +107,27 @@ } \cs_new:Nn \__um_char_gmake_mathactive:N { - \global\mathcode `#1 = "8000 \scan_stop: + \tex_global:D \tex_mathcode:D `#1 = "8000 \scan_stop: } \cs_new:Nn \__um_char_gmake_mathactive:n { - \global\mathcode #1 = "8000 \scan_stop: + \tex_global:D \tex_mathcode:D \int_eval:n {#1} = "8000 \scan_stop: } -\cs_new:Nn \__um_copy_fontparam:nnn +\cs_new:Nn \__um_mathactive_remap:nn { - \fontdimen #1 \font = \__um_get_fontparam:nn {#2} {#3} + \group_begin: + \cs_set_protected:Npn \__um_tmp: {#2} + \__um_char_gmake_mathactive:n {#1} + \char_gset_active_eq:nN {#1} \__um_tmp: + \group_end: } -\cs_new:Nn \__um_zero_fontparam:n +\cs_new:Nn \__um_copy_fontdimen:nnN { - \fontdimen #1 \font = 0pt\relax + \fontdimen #1 \font = \the \fontdimen #2 #3 \relax } -\cs_new:Nn \__um_get_fontparam:nn +\cs_new:Nn \__um_zero_fontdimen:n { - \the\fontdimen#1\l__um_font\relax + \fontdimen #1 \font = 0pt\relax } \cs_new:Nn \usv_set:nnn { \tl_const:cn { c__um_#1_#2_usv } {#3} } \cs_new:Nn \__um_to_usv:nn { \use:c { c__um_#1_#2_usv } } @@ -136,13 +155,22 @@ { \tl_remove_once:Nn \@preamblecmds {\do#1} } +\cs_new:Npn \__um_error:n { \msg_error:nn {unicode-math} } +\cs_new:Npn \__um_error:nx { \msg_error:nnx {unicode-math} } +\cs_new:Npn \__um_warning:n { \msg_warning:nn {unicode-math} } +\cs_new:Npn \__um_warning:nnn { \msg_warning:nnxx {unicode-math} } +\cs_new:Npn \__um_log:n { \msg_log:nn {unicode-math} } +\cs_new:Npn \__um_log:nx { \msg_log:nnx {unicode-math} } +\cs_generate_variant:Nn \msg_new:nnn {nnx} +\cs_generate_variant:Nn \msg_new:nnnn {nnxx} +\cs_new:Nn \__um_msg_new:nn { \msg_new:nnx {unicode-math} {#1} { \tl_trim_spaces:n {#2} } } %%^^A%% um-code-variables.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Declaration of all code-level variables used in the package. \bool_new:N \l__um_ot_math_bool \bool_new:N \l__um_init_bool \bool_new:N \l__um_implicit_alph_bool -\bool_new:N \g__um_mainfont_already_set_bool \bool_new:N \g__um_literal_bool \bool_new:N \g__um_upLatin_bool \bool_new:N \g__um_uplatin_bool @@ -167,6 +195,8 @@ \bool_new:N \g__um_mathsf_text_bool \bool_new:N \g__um_mathtt_text_bool \int_new:N \g__um_fam_int +\int_new:N \g__um_fonts_used_int +\int_new:N \l__um_primecount_int \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} @@ -177,17 +207,30 @@ \tl_new:N \l__um_radicals_tl \tl_new:N \l__um_nolimits_tl \tl_new:N \g__um_operator_mathfont_tl -\seq_new:N \l__um_missing_alph_seq -\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 -\clist_new:N \g__um_alphabets_seq -\clist_set:Nn \g__um_alphabets_seq { latin, Latin, greek, Greek, num } -\clist_new:N \g__um_named_ranges_clist +\tl_new:N \g__um_slash_delimiter_usv +\tl_new:N \g__um_mathtable_tl +\tl_new:N \g__um_fontname_tl +\tl_new:N \g__um_mversion_tl +\tl_new:N \g__um_symfont_tl +\tl_new:N \g__um_font_keyval_tl +\tl_new:N \g__um_family_tl +\tl_new:N \g__um_style_tl +\tl_new:N \g__um_remap_style_tl +\tl_new:N \l__um_not_token_name_tl +\tl_new:N \g__um_curr_font_cmd_tl +\tl_new:N \g__um_sqrt_font_cmd_tl +\tl_new:N \g__um_prime_font_cmd_tl \clist_new:N \g__um_char_nrange_clist \clist_new:N \g__um_unknown_keys_clist \clist_new:N \g__um_alphabet_clist +\clist_new:N \g__um_bad_alpha_clist +\clist_put_right:Nx \g__um_bad_alpha_clist { \tl_to_str:n {bf} } +\clist_put_right:Nx \g__um_bad_alpha_clist { \tl_to_str:n {sf} } +\clist_put_right:Nx \g__um_bad_alpha_clist { \tl_to_str:n {bfsf} } +\seq_new:N \l__um_missing_alph_seq +\seq_new:N \g__um_mathalph_seq +\seq_new:N \g__um_char_range_seq +\seq_new:N \g__um_mclass_range_seq \seq_new:N \g__um_mathclasses_seq \seq_set_from_clist:Nn \g__um_mathclasses_seq { @@ -195,29 +238,20 @@ \mathop, \mathopen,\mathclose, \mathfence,\mathover,\mathunder, - \mathaccent,\mathbotaccent,\mathaccentwide,\mathbotaccentwide + \mathaccent,\mathaccentoverlay,\mathbotaccent,\mathaccentwide,\mathbotaccentwide } - \seq_new:N \g__um_default_mathalph_seq -\seq_new:N \g__um_named_ranges_seq \seq_new:N \g__um_mathstyles_seq -\muskip_new:N \g__um_primekern_muskip -\muskip_gset:Nn \g__um_primekern_muskip { -\thinmuskip/2 }% arbitrary -\int_new:N \l__um_primecount_int \prop_new:N \g__um_supers_prop \prop_new:N \g__um_subs_prop -\tl_new:N \l_not_token_name_tl -\tl_new:N \g__um_slash_delimiter_usv -\tl_new:N \g__um_mathtable_tl -\tl_new:N \g__um_fontname_tl -\tl_new:N \g__um_mversion_tl -\tl_new:N \g__um_symfont_tl -\tl_new:N \g__um_font_keyval_tl -\tl_new:N \g__um_family_tl -\tl_new:N \g__um_style_tl -\tl_new:N \g__um_remap_style_tl +\muskip_new:N \g__um_primekern_muskip +\muskip_gset:Nn \g__um_primekern_muskip { -\thinmuskip/2 }% arbitrary +\fp_new:N \g__um_size_tfsf_fp +\fp_new:N \g__um_size_sfssf_fp +\quark_new:N \q_unicode_math %%^^A%% um-code-api.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% The (underdeveloped) API to interface with the package internals. \cs_new:Nn \unimath_get_mathstyle: { @@ -225,6 +259,7 @@ } %%^^A%% um-code-ui.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% The xparse user interface top-level definitions. \NewDocumentCommand \unimathsetup {m} { \keys_set:nn {unicode-math} {#1} } \NewDocumentCommand \setmathfont { O{} m O{} } @@ -251,19 +286,20 @@ } %%^^A%% um-code-pkgopt.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Package options. \cs_new:Nn \__um_keys_choices:nn - { - \cs_set:Npn \__um_keys_choices_fn:nn { \__um_keys_choices_aux:nnn {#1} } - \use:x - { - \exp_not:N \keys_define:nn {unicode-math} - { - #1 .choice: , - \__um_tl_map_dbl:nN {#2} \__um_keys_choices_fn:nn - } - } - } + { + \cs_set:Npn \__um_keys_choices_fn:nn { \__um_keys_choices_aux:nnn {#1} } + \use:x + { + \exp_not:N \keys_define:nn {unicode-math} + { + #1 .choice: , + \__um_tl_map_dbl:nN {#2} \__um_keys_choices_fn:nn + } + } + } \cs_new:Nn \__um_keys_choices_aux:nnn { #1 / #2 .code:n = { \exp_not:n {#3} } , } \cs_new:Nn \__um_tl_map_dbl:nN { @@ -277,37 +313,37 @@ \__um_tl_map_dbl:Nnn #1 } \__um_keys_choices:nn {mathup} - { - {sym} { \bool_set_false:N \g__um_mathrm_text_bool } - {text} { \bool_set_true:N \g__um_mathrm_text_bool } - } + { + {sym} { \bool_set_false:N \g__um_mathrm_text_bool } + {text} { \bool_set_true:N \g__um_mathrm_text_bool } + } \__um_keys_choices:nn {mathrm} - { - {sym} { \bool_set_false:N \g__um_mathrm_text_bool } - {text} { \bool_set_true:N \g__um_mathrm_text_bool } - } + { + {sym} { \bool_set_false:N \g__um_mathrm_text_bool } + {text} { \bool_set_true:N \g__um_mathrm_text_bool } + } \__um_keys_choices:nn {mathit} - { - {sym} { \bool_set_false:N \g__um_mathit_text_bool } - {text} { \bool_set_true:N \g__um_mathit_text_bool } - } + { + {sym} { \bool_set_false:N \g__um_mathit_text_bool } + {text} { \bool_set_true:N \g__um_mathit_text_bool } + } \__um_keys_choices:nn {mathbf} - { - {sym} { \bool_set_false:N \g__um_mathbf_text_bool } - {text} { \bool_set_true:N \g__um_mathbf_text_bool } - } + { + {sym} { \bool_set_false:N \g__um_mathbf_text_bool } + {text} { \bool_set_true:N \g__um_mathbf_text_bool } + } \__um_keys_choices:nn {mathsf} - { - {sym} { \bool_set_false:N \g__um_mathsf_text_bool } - {text} { \bool_set_true:N \g__um_mathsf_text_bool } - } + { + {sym} { \bool_set_false:N \g__um_mathsf_text_bool } + {text} { \bool_set_true:N \g__um_mathsf_text_bool } + } \__um_keys_choices:nn {mathtt} - { - {sym} { \bool_set_false:N \g__um_mathtt_text_bool } - {text} { \bool_set_true:N \g__um_mathtt_text_bool } - } + { + {sym} { \bool_set_false:N \g__um_mathtt_text_bool } + {text} { \bool_set_true:N \g__um_mathtt_text_bool } + } \__um_keys_choices:nn {normal-style} - { + { {ISO} { \bool_set_false:N \g__um_literal_bool \bool_set_false:N \g__um_upGreek_bool @@ -339,9 +375,9 @@ {literal} { \bool_set_true:N \g__um_literal_bool } - } + } \__um_keys_choices:nn {math-style} - { + { {ISO} { \unimathsetup { nabla=upright, partial=italic, normal-style=ISO, bold-style=ISO, sans-style=italic } @@ -362,9 +398,9 @@ \unimathsetup { colon=literal, nabla=literal, partial=literal, normal-style=literal, bold-style=literal, sans-style=literal } } - } + } \__um_keys_choices:nn {bold-style} - { + { {ISO} { \bool_set_false:N \g__um_bfliteral_bool \bool_set_false:N \g__um_bfupGreek_bool @@ -389,67 +425,71 @@ {literal} { \bool_set_true:N \g__um_bfliteral_bool } - } + } \__um_keys_choices:nn {sans-style} - { - {italic} { \bool_set_false:N \g__um_upsans_bool } - {upright} { \bool_set_true:N \g__um_upsans_bool } - {literal} { \bool_set_true:N \g__um_sfliteral_bool } - } + { + {italic} { \bool_set_false:N \g__um_upsans_bool } + {upright} { \bool_set_true:N \g__um_upsans_bool } + {literal} { \bool_set_true:N \g__um_sfliteral_bool } + } \__um_keys_choices:nn {nabla} - { - {upright} { - \bool_set_false:N \g__um_literal_Nabla_bool - \bool_set_true:N \g__um_upNabla_bool - } - {italic} { - \bool_set_false:N \g__um_literal_Nabla_bool - \bool_set_false:N \g__um_upNabla_bool - } - {literal} { \bool_set_true:N \g__um_literal_Nabla_bool } - } + { + {upright} { + \bool_set_false:N \g__um_literal_Nabla_bool + \bool_set_true:N \g__um_upNabla_bool + } + {italic} { + \bool_set_false:N \g__um_literal_Nabla_bool + \bool_set_false:N \g__um_upNabla_bool + } + {literal} { + \bool_set_true:N \g__um_literal_Nabla_bool + } + } \__um_keys_choices:nn {partial} - { - {upright} { - \bool_set_false:N \g__um_literal_partial_bool - \bool_set_true:N \g__um_uppartial_bool - } - {italic} { - \bool_set_false:N \g__um_literal_partial_bool - \bool_set_false:N \g__um_uppartial_bool - } - {literal} { \bool_set_true:N \g__um_literal_partial_bool } - } + { + {upright} { + \bool_set_false:N \g__um_literal_partial_bool + \bool_set_true:N \g__um_uppartial_bool + } + {italic} { + \bool_set_false:N \g__um_literal_partial_bool + \bool_set_false:N \g__um_uppartial_bool + } + {literal} { + \bool_set_true:N \g__um_literal_partial_bool + } + } \__um_keys_choices:nn {colon} - { - {literal} { \bool_set_true:N \g__um_literal_colon_bool } - {TeX} { \bool_set_false:N \g__um_literal_colon_bool } - } + { + {literal} { \bool_set_true:N \g__um_literal_colon_bool } + {TeX} { \bool_set_false:N \g__um_literal_colon_bool } + } \__um_keys_choices:nn {slash-delimiter} - { - {ascii} { \tl_set:Nn \g__um_slash_delimiter_usv {"002F} } - {frac} { \tl_set:Nn \g__um_slash_delimiter_usv {"2044} } - {div} { \tl_set:Nn \g__um_slash_delimiter_usv {"2215} } - } + { + {ascii} { \tl_set:Nn \g__um_slash_delimiter_usv {"002F} } + {frac} { \tl_set:Nn \g__um_slash_delimiter_usv {"2044} } + {div} { \tl_set:Nn \g__um_slash_delimiter_usv {"2215} } + } \__um_keys_choices:nn {active-frac} - { - {small} - { - \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:} - } + { + {small} + { + \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:} + } - {normalsize} - { - \bool_set_false:N \l__um_smallfrac_bool - \use:c {__um_setup_active_frac:} - } - } + {normalsize} + { + \bool_set_false:N \l__um_smallfrac_bool + \use:c {__um_setup_active_frac:} + } + } \keys_define:nn {unicode-math} { warnings-off .code:n = @@ -459,11 +499,11 @@ } } \__um_keys_choices:nn {trace} - { - {on} {} % default - {debug} { \msg_redirect_module:nnn { unicode-math } { log } { warning } } - {off} { \msg_redirect_module:nnn { unicode-math } { log } { none } } - } + { + {on} {} % default + {debug} { \msg_redirect_module:nnn { unicode-math } { log } { warning } } + {off} { \msg_redirect_module:nnn { unicode-math } { log } { none } } + } \unimathsetup {math-style=TeX} \unimathsetup {slash-delimiter=ascii} \unimathsetup {trace=off} @@ -472,348 +512,362 @@ \ProcessKeysOptions {unicode-math} %%^^A%% um-code-msg.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Definitions of error, warning, and log messages. -\cs_new:Npn \__um_error:n { \msg_error:nn {unicode-math} } -\cs_new:Npn \__um_warning:n { \msg_warning:nn {unicode-math} } -\cs_new:Npn \__um_warning:nnn { \msg_warning:nnxx {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} +\char_set_catcode_space:n {32} +\__um_msg_new:nn {no-tfrac} { - Small~ fraction~ command~ \protect\tfrac\ not~ defined.\\ - Load~ amsmath~ or~ define~ it~ manually~ before~ loading~ unicode-math. + 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} +\__um_msg_new:nn {default-math-font} { - Defining~ the~ default~ maths~ font~ as~ '\l__um_fontname_tl'. + Defining the default maths font as '\l__um_fontname_tl'. } -\msg_new:nnn {unicode-math} {setup-implicit} +\__um_msg_new:nn {setup-implicit} { - Setup~ alphabets:~ implicit~ mode. + Setup alphabets: implicit mode. } -\msg_new:nnn {unicode-math} {setup-explicit} +\__um_msg_new:nn {setup-explicit} { - Setup~ alphabets:~ explicit~ mode. + Setup alphabets: explicit mode. } -\msg_new:nnn {unicode-math} {alph-initialise} +\__um_msg_new:nn {alph-initialise} { - Initialising~ \@backslashchar math#1. + Initialising \@backslashchar math#1. } -\msg_new:nnn {unicode-math} {setup-alph} +\__um_msg_new:nn {setup-alph} { - Setup~ alphabet:~ #1. + Setup alphabet: #1. } -\msg_new:nnn {unicode-math} {no-alphabet} +\__um_msg_new:nn {no-alphabet} { - I~ am~ trying~ to~ set~ up~ alphabet~"#1"~ but~ there~ are~ no~ configuration~ settings~ for~ it.~ - (See~ source~ file~ "unicode-math-alphabets.dtx"~ to~ debug.) + I am trying to set up alphabet"#1" but there are no configuration settings for it. + (See source file "unicode-math-alphabets.dtx" to debug.) } -\msg_new:nnn { unicode-math } { no-named-range } +\__um_msg_new:nn {no-named-range} { - I~ am~ trying~ to~ define~ new~ alphabet~ "#2"~ in~ range~ "#1",~ but~ range~ "#1"~ hasn't~ been~ defined~ yet. + I am trying to define new alphabet "#2" in range "#1", but range "#1" hasn't been defined yet. } -\msg_new:nnn { unicode-math } { missing-alphabets } +\__um_msg_new:nn {missing-alphabets} { - Missing~math~alphabets~in~font~ "\fontname\l__um_font" \\ \\ + Missingmathalphabetsinfont "\fontname\g__um_curr_font_cmd_tl" \\ \\ \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} +\__um_msg_new:nn {macro-expected} { - I've~ expected~ that~ #1~ is~ a~ macro,~ but~ it~ isn't. + I've expected that #1 is a macro, but it isn't. } -\msg_new:nnn {unicode-math} {wrong-meaning} +\__um_msg_new:nn {wrong-meaning} { - I've~ expected~ #1~ to~ have~ the~ meaning~ #3,~ but~ it~ has~ the~ meaning~ #2. + I've expected #1 to have the meaning #3, but it has the meaning #2. } -\msg_new:nnn {unicode-math} {patch-macro} +\__um_msg_new:nn {patch-macro} { - I'm~ going~ to~ patch~ macro~ #1. + I'm going to patch macro #1. } -\msg_new:nnn { unicode-math } { mathtools-overbracket } { - Using~ \token_to_str:N \overbracket\ and~ - \token_to_str:N \underbracket\ from~ - `mathtools'~ package.\\ +\__um_msg_new:nn {mathtools-overbracket} { + Using \token_to_str:N \overbracket\ and + \token_to_str:N \underbracket\ from + `mathtools' package.\\ \\ - Use~ \token_to_str:N \Uoverbracket\ and~ - \token_to_str:N \Uunderbracket\ for~ - original~ `unicode-math'~ definition. + Use \token_to_str:N \Uoverbracket\ and + \token_to_str:N \Uunderbracket\ for + original `unicode-math' definition. } -\msg_new:nnn { unicode-math } { mathtools-colon } { - 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,~ +\__um_msg_new:nn {mathtools-colon} { + 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. + 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,~ +\__um_msg_new:nn {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 \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. + 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. } +\__um_msg_new:nn {bad-cs-in-range} + { + Command `#1` in math range is not recognised as a maths symbol. + Check file "unicode-math-table.tex" for allowable commands. + } +\__um_msg_new:nn {legacy-char-not-supported} + { + Command `#1` is a legacy maths symbol that is not supported by unicode-math. + } +\__um_msg_new:nn {range-not-bf-sf} + { + Range alphabets cannot include alphabets referring to `bf`, `sf`, or `bfsf` + since they relate to input commands not output glyphs. + Use `bfit` or `bfup` (etc.) to specify which. + } +\char_set_catcode_ignore:n {32} %%^^A%% um-code-usv.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> - -\usv_set:nnn {normal} {num} {48} -\usv_set:nnn {normal} {Latin}{"1D434} -\usv_set:nnn {normal} {latin}{"1D44E} -\usv_set:nnn {normal} {Greek}{"1D6E2} -\usv_set:nnn {normal} {greek}{"1D6FC} -\usv_set:nnn {normal}{varTheta} {"1D6F3} -\usv_set:nnn {normal}{epsilon}{"1D716} -\usv_set:nnn {normal}{vartheta} {"1D717} -\usv_set:nnn {normal}{varkappa} {"1D718} -\usv_set:nnn {normal}{phi} {"1D719} -\usv_set:nnn {normal}{varrho} {"1D71A} -\usv_set:nnn {normal}{varpi} {"1D71B} -\usv_set:nnn {normal} {Nabla}{"1D6FB} -\usv_set:nnn {normal} {partial}{"1D715} - -\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}{epsilon}{"3F5} -\usv_set:nnn {up}{vartheta} {"3D1} -\usv_set:nnn {up}{varkappa} {"3F0} -\usv_set:nnn {up}{phi} {"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}{epsilon}{"1D6DC} -\usv_set:nnn {bfup}{vartheta} {"1D6DD} -\usv_set:nnn {bfup}{varkappa} {"1D6DE} -\usv_set:nnn {bfup}{phi} {"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}{epsilon}{"1D716} -\usv_set:nnn {it}{vartheta} {"1D717} -\usv_set:nnn {it}{varkappa} {"1D718} -\usv_set:nnn {it}{phi} {"1D719} -\usv_set:nnn {it}{varrho} {"1D71A} -\usv_set:nnn {it}{varpi} {"1D71B} -\usv_set:nnn {bfit}{varTheta} {"1D72D} -\usv_set:nnn {bfit}{epsilon}{"1D750} -\usv_set:nnn {bfit}{vartheta} {"1D751} -\usv_set:nnn {bfit}{varkappa} {"1D752} -\usv_set:nnn {bfit}{phi} {"1D753} -\usv_set:nnn {bfit}{varrho} {"1D754} -\usv_set:nnn {bfit}{varpi} {"1D755} -\usv_set:nnn {bfsfup}{varTheta} {"1D767} -\usv_set:nnn {bfsfup}{epsilon}{"1D78A} -\usv_set:nnn {bfsfup}{vartheta} {"1D78B} -\usv_set:nnn {bfsfup}{varkappa} {"1D78C} -\usv_set:nnn {bfsfup}{phi} {"1D78D} -\usv_set:nnn {bfsfup}{varrho} {"1D78E} -\usv_set:nnn {bfsfup}{varpi} {"1D78F} -\usv_set:nnn {bfsfit}{varTheta} {"1D7A1} -\usv_set:nnn {bfsfit}{epsilon}{"1D7C4} -\usv_set:nnn {bfsfit}{vartheta} {"1D7C5} -\usv_set:nnn {bfsfit}{varkappa} {"1D7C6} -\usv_set:nnn {bfsfit}{phi} {"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} +%%^^A%% Mapping of mathematical unicode slots for alphabets. + +\usv_set:nnn {normal} {num} {48} +\usv_set:nnn {normal} {Latin} {"1D434} +\usv_set:nnn {normal} {latin} {"1D44E} +\usv_set:nnn {normal} {Greek} {"1D6E2} +\usv_set:nnn {normal} {greek} {"1D6FC} +\usv_set:nnn {normal} {varTheta} {"1D6F3} +\usv_set:nnn {normal} {epsilon} {"1D716} +\usv_set:nnn {normal} {vartheta} {"1D717} +\usv_set:nnn {normal} {varkappa} {"1D718} +\usv_set:nnn {normal} {phi} {"1D719} +\usv_set:nnn {normal} {varrho} {"1D71A} +\usv_set:nnn {normal} {varpi} {"1D71B} +\usv_set:nnn {normal} {Nabla} {"1D6FB} +\usv_set:nnn {normal} {partial} {"1D715} +\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} {epsilon} {"3F5} +\usv_set:nnn {up} {vartheta} {"3D1} +\usv_set:nnn {up} {varkappa} {"3F0} +\usv_set:nnn {up} {phi} {"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} {epsilon} {"1D6DC} +\usv_set:nnn {bfup} {vartheta} {"1D6DD} +\usv_set:nnn {bfup} {varkappa} {"1D6DE} +\usv_set:nnn {bfup} {phi} {"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} {epsilon} {"1D716} +\usv_set:nnn {it} {vartheta} {"1D717} +\usv_set:nnn {it} {varkappa} {"1D718} +\usv_set:nnn {it} {phi} {"1D719} +\usv_set:nnn {it} {varrho} {"1D71A} +\usv_set:nnn {it} {varpi} {"1D71B} +\usv_set:nnn {bfit} {varTheta} {"1D72D} +\usv_set:nnn {bfit} {epsilon} {"1D750} +\usv_set:nnn {bfit} {vartheta} {"1D751} +\usv_set:nnn {bfit} {varkappa} {"1D752} +\usv_set:nnn {bfit} {phi} {"1D753} +\usv_set:nnn {bfit} {varrho} {"1D754} +\usv_set:nnn {bfit} {varpi} {"1D755} +\usv_set:nnn {bfsfup} {varTheta} {"1D767} +\usv_set:nnn {bfsfup} {epsilon} {"1D78A} +\usv_set:nnn {bfsfup} {vartheta} {"1D78B} +\usv_set:nnn {bfsfup} {varkappa} {"1D78C} +\usv_set:nnn {bfsfup} {phi} {"1D78D} +\usv_set:nnn {bfsfup} {varrho} {"1D78E} +\usv_set:nnn {bfsfup} {varpi} {"1D78F} +\usv_set:nnn {bfsfit} {varTheta} {"1D7A1} +\usv_set:nnn {bfsfit} {epsilon} {"1D7C4} +\usv_set:nnn {bfsfit} {vartheta} {"1D7C5} +\usv_set:nnn {bfsfit} {varkappa} {"1D7C6} +\usv_set:nnn {bfsfit} {phi} {"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} %%^^A%% um-code-setchar.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% General assignment of maths symbols. \cs_new:Npn \__um_symbol_setup: { @@ -834,7 +888,7 @@ { \mathord \mathalpha \mathbin \mathrel \mathpunct \mathop \mathfence } {##3} { - \exp_last_unbraced:NNx \cs_gset_eq:NN ##2 { \Ucharcat ##1 ~ 12 ~ } + \exp_last_unbraced:NNx \cs_gset_eq:NN ##2 { \char_generate:nn {##1} {12} } } } \__um_input_math_symbol_table: @@ -874,6 +928,8 @@ { \__um_set_math_overunder:Nnnn #2 {} {#1} {#4} } \mathunder { \__um_set_math_overunder:Nnnn #2 {bottom} {#1} {#4} } + \mathaccentoverlay + { \__um_set_math_accent:Nnnn #2 {} {#1} {#4} } } } \edef\mathfence{\string\mathfence} @@ -881,6 +937,7 @@ \edef\mathunder{\string\mathunder} \edef\mathbotaccent{\string\mathbotaccent} \edef\mathaccentwide{\string\mathaccentwide} +\edef\mathaccentoverlay{\string\mathaccentoverlay} \edef\mathbotaccentwide{\string\mathbotaccentwide} \cs_new:Nn \__um_set_big_operator:nnn { @@ -937,72 +994,67 @@ \cs_gset_protected_nopar:Npx #1 ##1 { \mathop - { \__um_accent:nnn {#2} {#3} {#4} {##1} } + { \__um_accent:nnn {#2} {#3} {#4} {{}##1} } + % TODO: remove braces above ^^ which work around a LuaTeX bug \limits } } %%^^A%% um-code-mathtext.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% The "math text" commands such as `\mathbf` and co. \keys_define:nn {__um_mathface} - { - version .code:n = - { \tl_set:Nn \l__um_mversion_tl {#1} } - } + { + version .tl_set:N = \l__um_mversion_tl + } \cs_set:Nn \__um_setmathfontface:Nnn - { - \tl_clear:N \l__um_mversion_tl + { + \tl_clear:N \l__um_mversion_tl - \keys_set_known:nnN {__um_mathface} {#2} \l__um_keyval_clist + \keys_set_known:nnN {__um_mathface} {#2} \l__um_keyval_clist - \exp_args:Nnx \fontspec_set_family:Nxn \l__um_tmpa_tl - { ItalicFont={}, BoldFont={}, \exp_not:V \l__um_keyval_clist } {#3} + \exp_args:Nnx \fontspec_set_family:Nxn \l__um_tmpa_tl + { ItalicFont={}, BoldFont={}, \exp_not:V \l__um_keyval_clist } {#3} - \tl_if_empty:NT \l__um_mversion_tl - { - \tl_set:Nn \l__um_mversion_tl {normal} - \DeclareMathAlphabet #1 {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault} - } + \tl_if_empty:NT \l__um_mversion_tl + { + \tl_set:Nn \l__um_mversion_tl {normal} + \DeclareMathAlphabet #1 {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault} + } - \SetMathAlphabet #1 {\l__um_mversion_tl} {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault} + \SetMathAlphabet #1 {\l__um_mversion_tl} {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault} - % integrate with fontspec's \setmathrm etc: - \tl_case:Nn #1 - { - \mathrm { \cs_set_eq:NN \g__fontspec_mathrm_tl \l__um_tmpa_tl } - \mathsf { \cs_set_eq:NN \g__fontspec_mathsf_tl \l__um_tmpa_tl } - \mathtt { \cs_set_eq:NN \g__fontspec_mathtt_tl \l__um_tmpa_tl } - } - } + % integrate with fontspec's \setmathrm etc: + \tl_case:Nn #1 + { + \mathrm { \cs_set_eq:NN \g__fontspec_mathrm_tl \l__um_tmpa_tl } + \mathsf { \cs_set_eq:NN \g__fontspec_mathsf_tl \l__um_tmpa_tl } + \mathtt { \cs_set_eq:NN \g__fontspec_mathtt_tl \l__um_tmpa_tl } + } + } \cs_generate_variant:Nn \tl_if_eq:nnT {o} \cs_set:Nn \__fontspec_setmainfont_hook:nn { \tl_if_eq:onT {\g__fontspec_mathrm_tl} {\rmdefault} { \fontspec_set_family:Nnn \g__fontspec_mathrm_tl {#1} {#2} - \SetMathAlphabet\mathrm{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\updefault - \SetMathAlphabet\mathit{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\itdefault - \SetMathAlphabet\mathbf{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\bfdefault\updefault + \__fontspec_setmathrm_hook:nn {#1} {#2} } } - \cs_set:Nn \__fontspec_setsansfont_hook:nn { \tl_if_eq:onT {\g__fontspec_mathsf_tl} {\sfdefault} { \fontspec_set_family:Nnn \g__fontspec_mathsf_tl {#1} {#2} - \SetMathAlphabet\mathsf{normal}\g_fontspec_encoding_tl\g__fontspec_mathsf_tl\mddefault\updefault - \SetMathAlphabet\mathsf{bold} \g_fontspec_encoding_tl\g__fontspec_mathsf_tl\bfdefault\updefault + \__fontspec_setmathsf_hook:nn {#1} {#2} } } - \cs_set:Nn \__fontspec_setmonofont_hook:nn { \tl_if_eq:onT {\g__fontspec_mathtt_tl} {\ttdefault} { \fontspec_set_family:Nnn \g__fontspec_mathtt_tl {#1} {#2} - \SetMathAlphabet\mathtt{normal}\g_fontspec_encoding_tl\g__fontspec_mathtt_tl\mddefault\updefault - \SetMathAlphabet\mathtt{bold} \g_fontspec_encoding_tl\g__fontspec_mathtt_tl\bfdefault\updefault + \__fontspec_setmathtt_hook:nn {#1} {#2} } } \cs_set:Nn \__fontspec_setmathrm_hook:nn @@ -1027,180 +1079,251 @@ \SetMathAlphabet\mathtt{normal}\g_fontspec_encoding_tl\g__fontspec_mathtt_tl\mddefault\updefault \SetMathAlphabet\mathtt{bold} \g_fontspec_encoding_tl\g__fontspec_mathtt_tl\bfdefault\updefault } +\tl_if_eq:onF {\g__fontspec_mathrm_tl} {\rmdefault} { \__fontspec_setmathrm_hook:nn {} {} } +\tl_if_eq:onF {\g__fontspec_mathsf_tl} {\sfdefault} { \__fontspec_setmathsf_hook:nn {} {} } +\tl_if_eq:onF {\g__fontspec_mathtt_tl} {\ttdefault} { \__fontspec_setmathtt_hook:nn {} {} } +\AtBeginDocument + { + \tl_if_eq:onT {\g__fontspec_mathrm_tl} {\rmdefault} { \__fontspec_setmathrm_hook:nn {} {} } + \tl_if_eq:onT {\g__fontspec_mathsf_tl} {\sfdefault} { \__fontspec_setmathsf_hook:nn {} {} } + \tl_if_eq:onT {\g__fontspec_mathtt_tl} {\ttdefault} { \__fontspec_setmathtt_hook:nn {} {} } + } %%^^A%% um-code-main.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Definition of `\setmainfont`. \cs_set:Nn \__um_setmathfont:nn { - \tl_set:Nn \l__um_fontname_tl {#2} + + \__um_init:n {#2} \cs_set_eq:NN \glb@currsize \scan_stop: - \__um_init: \cs_if_exist:cF { S@ \f@size } { \calculate@math@sizes } - \csname S@\f@size\endcsname + \use:c { S@ \f@size } + \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: - \bool_if:nT { \l__um_ot_math_bool && !\g__um_mainfont_already_set_bool } + + \bool_if:NT \l__um_init_bool { + \__um_fontspec_trial_font: \__um_declare_math_sizes: - \__um_fontspec_select_font: - } - \cs_if_exist:cF { sym \l__um_symfont_label_tl } - { - \DeclareSymbolFont{\l__um_symfont_label_tl} - {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault} - } - \SetSymbolFont{\l__um_symfont_label_tl}{\l__um_mversion_tl} - {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault} - \str_if_eq_x:nnT {\l__um_mversion_tl} {normal} - { - \SetSymbolFont{\l__um_symfont_label_tl}{bold} - {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault} } - \bool_if:nT { \l__um_ot_math_bool && !\g__um_mainfont_already_set_bool } + \__um_fontspec_select_font: + \__um_setup_math_fam: + \bool_if:NT \l__um_init_bool { - \bool_set_true:N \g__um_mainfont_already_set_bool \__um_setup_legacy_fam_two: \__um_setup_legacy_fam_three: } + \__um_input_math_symbol_table: + + \bool_if:NT \l__um_init_bool \__um_onceoff_setup: \__um_remap_symbols: \__um_setup_mathactives: \__um_setup_delcodes: \__um_setup_alphabets: - \__um_setup_negations: + + %% TODO: what of the above should only be run for the "default"/"main" font? + + \bool_if:NTF \l__um_init_bool + { + \__um_log:n {default-math-font} + } + { + } } \AtBeginDocument { \__um_load_lm_if_necessary: } \cs_new:Nn \__um_load_lm_if_necessary: { \cs_if_exist:NF \l__um_fontname_tl { - % TODO: update this when lmmath-bold.otf is released - \setmathfont{latinmodern-math.otf}[BoldFont={latinmodern-math.otf}] - \bool_set_false:N \g__um_mainfont_already_set_bool + \setmathfont{latinmodern-math.otf} + [BoldFont={latinmodern-math.otf}] } } -\cs_new:Nn \__um_init: +\cs_new:Nn \__um_init:n { + \tl_set:Nn \l__um_fontname_tl {#1} \bool_set_true:N \l__um_ot_math_bool - \tl_set:Nn \l__um_mversion_tl {normal} + \tl_set:Nn \l__um_mversion_tl {normal} \tl_set:Nn \l__um_symfont_label_tl {operators} + \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 + \bool_set_true:N \l__um_init_bool - \seq_clear:N \l__um_char_range_seq - \clist_clear:N \l__um_char_nrange_clist - \seq_clear:N \l__um_mathalph_seq + \seq_gclear:N \g__um_char_range_seq + \clist_clear:N \l__um_mathmap_charints_clist + \seq_gclear:N \g__um_mathalph_seq \seq_clear:N \l__um_missing_alph_seq - \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 + + \cs_set_eq:NN \__um_sym:nnn \__um_process_symbol_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_assign_delcode:nn \__um_assign_delcode_noparse:nn + \cs_set_eq:NN \__um_make_mathactive:nNN \__um_make_mathactive_noparse:nNN } +\tl_new:N \g__um_main_font_cmd_tl \cs_new:Nn \__um_declare_math_sizes: { - \dim_compare:nF { \fontdimen 10 \l__um_font == 0pt } + \dim_compare:nF { \fontdimen 10 \g__um_trial_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} } + { \__um_fontdimen_to_scale:nN {10} \g__um_trial_font } + { \__um_fontdimen_to_scale:nN {11} \g__um_trial_font } + } + } +\cs_new:Nn \__um_fontspec_trial_font: + { + \tl_set:Nx \l__um_font_keyval_tl + { + BoldItalicFont = {}, ItalicFont = {}, + Script = Math, + \l__um_unknown_keys_clist + } + + \fontspec_set_family:Nxn \l__um_trial_family_tl {\l__um_font_keyval_tl} {\l__um_fontname_tl} + + \group_begin: + \fontfamily { \l__um_trial_family_tl } \selectfont + \__um_fontface_gset_eq:NV \g__um_trial_font \font@name + \fontspec_if_script:nF {math} + { + \bool_gset_false:N \l__um_ot_math_bool + \bool_gset_false:N \l__um_init_bool + } + \group_end: + + } +\cs_new:Nn \__um_fontspec_select_font: + { + \fp_gset:Nn \g__um_size_tfsf_fp { (\f@size +\sf@size )/2 } + \fp_gset:Nn \g__um_size_sfssf_fp { (\sf@size+\ssf@size)/2 } + + \tl_set:Nx \l__um_font_keyval_tl + { + BoldItalicFont = {}, ItalicFont = {}, + Script = Math, + SizeFeatures = + { + { + Size = \fp_use:N \g__um_size_tfsf_fp - + } , + { + Size = \fp_use:N \g__um_size_sfssf_fp - \fp_use:N \g__um_size_tfsf_fp , + Font = \l__um_script_font_tl , + \l__um_script_features_tl + } , + { + Size = - \fp_use:N \g__um_size_sfssf_fp , + Font = \l__um_sscript_font_tl , + \l__um_sscript_features_tl + } + } , + \l__um_unknown_keys_clist + } + + \fontspec_set_family:Nxn \l__um_family_tl {\l__um_font_keyval_tl} {\l__um_fontname_tl} + + \int_gincr:N \g__um_fonts_used_int + \group_begin: + \fontfamily { \l__um_family_tl } \selectfont + \__um_fontface_gset_eq:cV {g__um_mathfont_ \int_use:N \g__um_fonts_used_int _font} \font@name + \tl_gset:Nx \g__um_curr_font_cmd_tl { \exp_not:c {g__um_mathfont_ \int_use:N \g__um_fonts_used_int _font} } + \bool_if:NT \l__um_init_bool +{ +\__um_fontface_gset_eq:NV \l__um_font \font@name +} + \fontspec_if_script:nF {math} + { + \bool_gset_false:N \l__um_ot_math_bool + \bool_gset_false:N \l__um_init_bool + } + \group_end: + } +\tl_set:Nn \g__um_main_font_cmd_tl { \l__um_font } +\tl_set:Nn \g__um_sqrt_font_cmd_tl { \l__um_font } +\tl_set:Nn \g__um_prime_font_cmd_tl { \l__um_font } +\cs_new:Nn \__um_setup_math_fam: + { + \cs_if_exist:cF { sym \l__um_symfont_label_tl } + { + \DeclareSymbolFont{\l__um_symfont_label_tl} + {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault} + } + \SetSymbolFont{\l__um_symfont_label_tl}{\l__um_mversion_tl} + {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault} + \str_if_eq_x:nnT {\l__um_mversion_tl} {normal} + { + \SetSymbolFont{\l__um_symfont_label_tl}{bold} + {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault} } } \cs_new:Nn \__um_setup_legacy_fam_two: { - \fontspec_set_family:Nxn \l__um_family_tl + \fontspec_set_family:Nxn \l__um_fam_two_tl { \l__um_font_keyval_tl, Scale=1.00001, FontAdjustment = { - \__um_copy_fontparam:nnn { 8} {43} {FractionNumeratorDisplayStyleShiftUp}\relax - \__um_copy_fontparam:nnn { 9} {42} {FractionNumeratorShiftUp}\relax - \__um_copy_fontparam:nnn {10} {32} {StackTopShiftUp}\relax - \__um_copy_fontparam:nnn {11} {45} {FractionDenominatorDisplayStyleShiftDown}\relax - \__um_copy_fontparam:nnn {12} {44} {FractionDenominatorShiftDown}\relax - \__um_copy_fontparam:nnn {13} {21} {SuperscriptShiftUp}\relax - \__um_copy_fontparam:nnn {14} {21} {SuperscriptShiftUp}\relax - \__um_copy_fontparam:nnn {15} {22} {SuperscriptShiftUpCramped}\relax - \__um_copy_fontparam:nnn {16} {18} {SubscriptShiftDown}\relax - \__um_copy_fontparam:nnn {17} {18} {SubscriptShiftDownWithSuperscript}\relax - \__um_copy_fontparam:nnn {18} {24} {SuperscriptBaselineDropMax}\relax - \__um_copy_fontparam:nnn {19} {20} {SubscriptBaselineDropMin}\relax - \__um_zero_fontparam:n {20} % delim1 = FractionDelimiterDisplaySize - \__um_zero_fontparam:n {21} % delim2 = FractionDelimiterSize - \__um_copy_fontparam:nnn {22} {15} {AxisHeight}\relax + \__um_copy_fontdimen:nnN { 8} {43} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN { 9} {42} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {10} {32} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {11} {45} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {12} {44} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {13} {21} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {14} {21} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {15} {22} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {16} {18} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {17} {18} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {18} {24} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {19} {20} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {22} {15} \g__um_main_font_cmd_tl + \__um_zero_fontdimen:n {20} % delim1 = FractionDelimiterDisplaySize + \__um_zero_fontdimen:n {21} % delim2 = FractionDelimiterSize } } {\l__um_fontname_tl} \SetSymbolFont{symbols}{\l__um_mversion_tl} - {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault} + {\encodingdefault}{\l__um_fam_two_tl}{\mddefault}{\updefault} \str_if_eq_x:nnT {\l__um_mversion_tl} {normal} { \SetSymbolFont{symbols}{bold} - {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault} + {\encodingdefault}{\l__um_fam_two_tl}{\bfdefault}{\updefault} } } \cs_new:Nn \__um_setup_legacy_fam_three: { - \fontspec_set_family:Nxn \l__um_family_tl + \fontspec_set_family:Nxn \l__um_fam_three_tl { \l__um_font_keyval_tl, Scale=0.99999, FontAdjustment = { - \__um_copy_fontparam:nnn { 8} {48} {FractionRuleThickness}\relax - \__um_copy_fontparam:nnn { 9} {28} {UpperLimitGapMin}\relax - \__um_copy_fontparam:nnn {10} {30} {LowerLimitGapMin}\relax - \__um_copy_fontparam:nnn {11} {29} {UpperLimitBaselineRiseMin}\relax - \__um_copy_fontparam:nnn {12} {31} {LowerLimitBaselineDropMin}\relax - \__um_zero_fontparam:n {13} + \__um_copy_fontdimen:nnN { 8} {48} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN { 9} {28} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {10} {30} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {11} {29} \g__um_main_font_cmd_tl + \__um_copy_fontdimen:nnN {12} {31} \g__um_main_font_cmd_tl + \__um_zero_fontdimen:n {13} } } {\l__um_fontname_tl} \SetSymbolFont{largesymbols}{\l__um_mversion_tl} - {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault} + {\encodingdefault}{\l__um_fam_three_tl}{\mddefault}{\updefault} \str_if_eq_x:nnT {\l__um_mversion_tl} {normal} { \SetSymbolFont{largesymbols}{bold} - {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault} + {\encodingdefault}{\l__um_fam_three_tl}{\bfdefault}{\updefault} } } -\cs_new:Nn \__um_fontspec_select_font: +\cs_new:Nn \__um_onceoff_setup: { - \tl_set:Nx \l__um_font_keyval_tl { - BoldItalicFont = {}, 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: + \__um_set_delcode:nnn {operators} {`\.} {\c_zero} } \cs_set:Nn \__um_process_symbol_noparse:nnn { @@ -1208,23 +1331,23 @@ } \cs_set:Nn \__um_process_symbol_parse:nnn { - \__um_if_char_spec:nNNT {#1} {#2} {#3} + \__um_if_char_spec:nNT {#1} {#3} { \__um_process_symbol_noparse:nnn {#1} {#2} {#3} } } -\cs_new:Npn \__um_remap_symbols: +\cs_new:Nn \__um_remap_symbols: { - \__um_remap_symbol:nnn{`\-}{\mathbin}{"02212}% hyphen to minus - \__um_remap_symbol:nnn{`\*}{\mathbin}{"02217}% text asterisk to "centred asterisk" + \__um_remap_symbol:nnn {`\-} {\mathbin} {"2212} + \__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) + \__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_if_char_spec:nNT {#3} {#2} { \__um_remap_symbol_noparse:nnn {#1} {#2} {#3} } } \cs_new:Nn \__um_remap_symbol_noparse:nnn @@ -1234,19 +1357,19 @@ } \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 {"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_if_char_spec:nNT {#1} #3 { \__um_make_mathactive_noparse:nNN {#1} #2 #3 } } \cs_new:Nn \__um_make_mathactive_noparse:nNN @@ -1260,7 +1383,7 @@ } \cs_new:Nn \__um_assign_delcode_parse:nn { - \__um_if_char_spec:nNNT {#2} {\@nil} {\@nil} + \__um_if_char_spec:nNT {#2} \@nil { \__um_assign_delcode_noparse:nn {#1} {#2} } @@ -1268,10 +1391,6 @@ \cs_new:Nn \__um_assign_delcode:n { \__um_assign_delcode:nn {#1} {#1} } \cs_new:Npn \__um_setup_delcodes: { - % ensure \left. and \right. work: - \__um_set_delcode:nnn \l__um_symfont_label_tl {`\.} {\c_zero} - % this is forcefully done to fix a bug -- indicates a larger problem! - \__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 @@ -1317,6 +1436,7 @@ \tl_set:Nn \l__um_radicals_tl {\sqrt \longdivision} %%^^A%% um-code-fontopt.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Keyval for `\setmathfont` \keys_define:nn {unicode-math} { @@ -1327,100 +1447,124 @@ } } \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 , - } + { + 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 , + } \keys_define:nn {unicode-math} - { - range .code:n = - { - \bool_set_false:N \l__um_init_bool + { + range .code:n = + { + \bool_set_false:N \l__um_init_bool + \__um_range_init: + \group_begin: + \seq_map_inline:Nn \g__um_mathclasses_seq + { + \cs_set:Npn ##1 { \use_none:n \q_unicode_math \exp_not:N ##1 } + } + \cs_set:Npn \__um_sym:nnn ##1 ##2 ##3 + { + \cs_set:Npn ##2 { \use_none:n \q_unicode_math ##1 } + } + \__um_input_math_symbol_table: + \__um_range_process:n {#1} + \group_end: + } + } +\cs_new:Nn \__um_range_init: + { \int_incr:N \g__um_fam_int \tl_set:Nx \l__um_symfont_label_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 - + \seq_gclear:N \g__um_char_range_seq + \seq_gclear:N \g__um_mclass_range_seq + \seq_gclear:N \g__um_mathalph_seq + } +\cs_new:Nn \__um_range_process:n + { \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_lazy_and:nnTF { \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} } - } - } - } - } - } -\prg_new_conditional:Nnn \__um_if_mathalph_decl:n {TF} - { - \tl_set:Nn \l__um_tmpa_tl {#1} - \tl_clear:N \l__um_tmpb_tl - \tl_clear:N \l__um_tmpc_tl + { + \__um_mathalph_decl:nF {##1} { \__um_range_decl:n {##1} } + } +} +\cs_new:Nn \__um_mathalph_decl:nF + { - \tl_if_in:NnT \l__um_tmpa_tl {->} - { \exp_after:wN \__um_split_arrow:w \l__um_tmpa_tl \q_nil } + \tl_set:Nn \l__um_tmpa_tl {#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_slash:w \l__um_tmpa_tl \q_nil } + \tl_if_in:NnT \l__um_tmpa_tl {->} + { \exp_after:wN \__um_split_arrow:w \l__um_tmpa_tl \q_nil } - \tl_set:Nx \l__um_tmpa_tl { \tl_to_str:N \l__um_tmpa_tl } - \exp_args:NNx \tl_remove_all:Nn \l__um_tmpa_tl { \token_to_str:N \math } - \exp_args:NNx \tl_remove_all:Nn \l__um_tmpa_tl { \token_to_str:N \sym } - \tl_trim_spaces:N \l__um_tmpa_tl + \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 } + \tl_set:Nx \l__um_tmpa_tl { \tl_to_str:N \l__um_tmpa_tl } + \exp_args:NNx \tl_remove_all:Nn \l__um_tmpa_tl { \token_to_str:N \math } + \exp_args:NNx \tl_remove_all:Nn \l__um_tmpa_tl { \token_to_str:N \sym } + \tl_trim_spaces:N \l__um_tmpa_tl - \seq_if_in:NVTF \g__um_named_ranges_seq \l__um_tmpa_tl - { \prg_return_true: } { \prg_return_false: } - } + \tl_if_empty:NT \l__um_tmpc_tl + { \tl_set_eq:NN \l__um_tmpc_tl \l__um_tmpa_tl } + + \clist_if_in:NVT \g__um_bad_alpha_clist \l__um_tmpa_tl { \__um_error:n {range-not-bf-sf} } + + \prop_if_exist:cTF {g__um_named_range_ \l__um_tmpa_tl _prop} + { + \seq_gput_right:Nx \g__um_mathalph_seq + { + { \exp_not:V \l__um_tmpa_tl } + { \exp_not:V \l__um_tmpb_tl } + { \exp_not:V \l__um_tmpc_tl } + } + } + {#2} + } \cs_set:Npn \__um_split_arrow:w #1->#2 \q_nil - { - \tl_set:Nx \l__um_tmpa_tl { \tl_trim_spaces:n {#1} } - \tl_set:Nx \l__um_tmpc_tl { \tl_trim_spaces:n {#2} } - } + { + \tl_set:Nx \l__um_tmpa_tl { \tl_trim_spaces:n {#1} } + \tl_set:Nx \l__um_tmpc_tl { \tl_trim_spaces:n {#2} } + } \cs_set:Npn \__um_split_slash:w #1/#2 \q_nil - { - \tl_set:Nx \l__um_tmpa_tl { \tl_trim_spaces:n {#1} } - \tl_set:Nx \l__um_tmpb_tl { \tl_trim_spaces:n {#2} } - } -\cs_new:Nn \__um_if_char_spec:nNNT + { + \tl_set:Nx \l__um_tmpa_tl { \tl_trim_spaces:n {#1} } + \tl_set:Nx \l__um_tmpb_tl { \tl_trim_spaces:n {#2} } + } +\cs_new_protected:Nn \__um_range_decl:n + { + \bool_lazy_and:nnTF { \tl_if_single_p:n {#1} } { \token_if_cs_p:N #1 } + { + \tl_if_in:VnTF #1 { \q_unicode_math } + { + \seq_if_in:NnTF \g__um_mathclasses_seq {#1} + { \seq_gput_right:Nn \g__um_mclass_range_seq {#1} } + { \seq_gput_right:Nx \g__um_char_range_seq {#1} } + } + { \__um_error:nx {bad-cs-in-range} { \tl_to_str:n {#1} } } + } + { + \seq_gput_right:Nx \g__um_char_range_seq {#1} + } + } +\cs_new:Nn \__um_if_char_spec:nNT { % 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} + \seq_if_in:NnT \g__um_mclass_range_seq {#2} { \use_none_delimit_by_q_nil:w } % character slot: - \seq_map_inline:Nn \l__um_char_range_seq + \seq_map_inline:Nn \g__um_char_range_seq { + \__um_int_if_slot_is_last_in_range:nnT {#1} {##1} + { \seq_gremove_all:Nn \g__um_char_range_seq {##1} } + \__um_int_if_slot_in_range:nnT {#1} {##1} { \seq_map_break:n { \use_none_delimit_by_q_nil:w } } } @@ -1430,12 +1574,17 @@ \q_nil \use:n { - \clist_put_right:Nx \l__um_char_nrange_clist { \int_eval:n {#1} } - #4 + \cs_if_eq:NNT #2 \mathalpha + { + \clist_put_right:Nx \l__um_mathmap_charints_clist { \int_eval:n {#1} } + } + #3 } } \cs_new:Nn \__um_int_if_slot_in_range:nnT - { \__um_numrange_parse:nwT {#1} #2 - \q_nil - \q_stop {#3} } + { + \__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} } @@ -1447,8 +1596,22 @@ \int_compare:nT {#1>=#2} { \int_compare:nT {#1<=#3} {#5} } } } } } +\cs_new:Nn \__um_int_if_slot_is_last_in_range:nnT + { + \__um_numrange_last_parse:nwT {#1} #2 - \q_nil - \q_stop {#3} + } +\cs_set:Npn \__um_numrange_last_parse:nwT #1 #2 - #3 - #4 \q_stop #5 + { + \tl_if_empty:nTF {#4} { \int_compare:nT {#1==#2} {#5} } + { + \tl_if_empty:nTF {#2} { \int_compare:nT {#1==#3} {#5} } + { + \int_compare:nT {#1==#3} {#5} + } } + } %%^^A%% um-code-fontparam.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Cross-platform interface for font parameters \cs_new_protected_nopar:Nn \__um_new_cramped_style:N { \quark_new:N #1 } @@ -1490,30 +1653,30 @@ \c_two } \cs_new_protected_nopar:Nn \__um_font_param:nnnnn -{ - \__um_font_param_aux:ccnnnn { __um_ #1 :N } { __um_set_ #1 :Nn } - { #2 } { #3 } { #4 } { #5 } -} + { + \__um_font_param_aux:ccnnnn { __um_ #1 :N } { __um_set_ #1 :Nn } + { #2 } { #3 } { #4 } { #5 } + } \cs_new_protected_nopar:Nn \__um_font_param:nnn - { - \__um_font_param:nnnnn { #1 } { #2 } { #2 } { #3 } { #3 } - } + { + \__um_font_param:nnnnn { #1 } { #2 } { #2 } { #3 } { #3 } + } \cs_new_protected_nopar:Nn \__um_font_param:nn - { - \__um_font_param:nnnnn { #1 } { #2 } { #2 } { #2 } { #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 } - } + { + \__um_font_dimen:Nnnnn ##1 { #3 } { #4 } { #5 } { #6 } + } \cs_new_protected_nopar:Npn #2 ##1 ##2 - { - #1 ##1 \dim_eval:n { ##2 } - } + { + #1 ##1 \dim_eval:n { ##2 } + } } \cs_generate_variant:Nn \__um_font_param_aux:NNnnnn { cc } \__um_font_param:nn { axis } { 15 } @@ -1561,111 +1724,444 @@ \__um_font_param:nn { underbar_rule } { 57 } \__um_font_param:nn { underbar_vgap } { 56 } \__um_font_param:n { connector_overlap_min } -\cs_new:Nn \__um_fontdimen_to_percent:nn - { - \fp_eval:n { \dim_to_decimal:n { \fontdimen #1 #2 } * 65536 / 100 } - } -\cs_new:Nn \__um_fontdimen_to_scale:nn - { - \fp_eval:n {\__um_fontdimen_to_percent:nn {#1} {#2} * \f@size } pt - } -\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 +\cs_new:Nn \__um_fontdimen_to_percent:nN + { + \fp_eval:n { \dim_to_decimal:n { \fontdimen #1 #2 } * 65536 / 100 } + } +\cs_new:Nn \__um_fontdimen_to_scale:nN + { + \fp_eval:n { \__um_fontdimen_to_percent:nN {#1} #2 * \f@size } pt + } +\cs_new:Nn \__um_mathstyle_scale:NnnN + { + \ifx#1\scriptstyle + #2 \__um_fontdimen_to_percent:nN {10} #4 #3 \else - #2 #3 + \ifx#1\scriptscriptstyle + #2 \__um_fontdimen_to_percent:nN {11} #4 #3 + \else + #2 #3 + \fi \fi - \fi - } + } %%^^A%% um-code-mathmap.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Setup of symbol alphabets. -\cs_set:Npn \use@mathgroup #1 #2 - { - \mode_if_math:T % <- not sure if this is really necessary since we've just checked for mmode and raised an error if not! - { - \math@bgroup - \cs_if_eq:cNF {M@\f@encoding} #1 {#1} - \__um_switchto_literal: - \mathgroup #2 \relax - \math@egroup - } - } -\cs_set:Npn \operator@font - { - \__um_switchto_literal: - \@fontswitch {} { \g__um_operator_mathfont_tl } - } -\cs_new:Nn \__um_prepare_mathstyle:n - { - \seq_put_right:Nn \g__um_mathstyles_seq {#1} - \__um_init_alphabet:n {#1} - \cs_set:cpn {__um_sym_#1_aux:n} - { \use:c {__um_switchto_#1:} \math@egroup } - \cs_set_protected:cpx {sym#1} - { - \exp_not:n - { - \math@bgroup - \mode_if_math:F - { - \egroup\expandafter - \non@alpherr\expandafter{\csname sym#1\endcsname\space} - } - \tl_set:Nn \l__um_mathstyle_tl {#1} - } - \exp_not:c {__um_sym_#1_aux:n} - } - } -\cs_set:Nn \__um_init_alphabet:n - { - \__um_log:nx {alph-initialise} {#1} - \cs_set_eq:cN {__um_switchto_#1:} \prg_do_nothing: - } -\cs_new:Nn \__um_new_named_range:n - { - \prop_new:c {g__um_named_range_#1_prop} - } -\clist_set:Nn \g__um_named_ranges_clist - { - up, it, tt, bfup, bfit, bb , bbit, scr, bfscr, cal, bfcal, - frak, bffrak, sfup, sfit, bfsfup, bfsfit, bfsf - } -\clist_map_inline:Nn \g__um_named_ranges_clist - { \__um_new_named_range:n {#1} } +\cs_new:Npn \__um_setup_alphabets: + { + + \bool_if:NTF \l__um_init_bool + { + % IMPLICIT + \__um_log:n {setup-implicit} + \seq_gset_eq:NN \g__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} + \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 + \__um_mathalph_map: + \seq_if_empty:NF \l__um_missing_alph_seq { \__um_log:n { missing-alphabets } } + } + { + \seq_if_empty:NF \g__um_mathalph_seq + { + % 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 + \__um_mathalph_map: + \seq_if_empty:NF \l__um_missing_alph_seq { \__um_log:n { missing-alphabets } } + } + + % INHERIT + \clist_if_empty:NF \l__um_mathmap_charints_clist + { + \seq_gclear:N \g__um_mathalph_seq + \seq_map_inline:Nn \g__um_default_mathalph_seq + { + \tl_set:No \l__um_style_tl { \use_i:nnn ##1 } + \clist_set:No \l__um_alphabet_clist { \use_ii:nnn ##1 } + + \clist_map_inline:Nn \l__um_alphabet_clist + { + \clist_map_inline:cn {g__um_named_slots_ \l__um_style_tl _ ####1 _clist} + { + \clist_map_inline:Nn \l__um_mathmap_charints_clist + { + \__um_int_if_slot_in_range:nnT {################1} {########1} + { + \seq_gput_right:Nn \g__um_mathalph_seq {##1} + \clist_map_break:n { \clist_map_break:n { \clist_map_break: } } + } + } + } + } + } + } + + \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_parse:nnn + \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_parse:nn + \__um_mathalph_map: + } + } +\cs_set:Nn \__um_mathalph_map: + { + \seq_map_inline:Nn \g__um_mathalph_seq + { + \tl_set:No \l__um_style_tl { \use_i:nnn ##1 } + \clist_set:No \l__um_alphabet_clist { \use_ii:nnn ##1 } + \tl_set:No \l__um_remap_style_tl { \use_iii:nnn ##1 } + + % If no set of alphabets is defined: + \clist_if_empty:NT \l__um_alphabet_clist + { + \cs_set_eq:NN \__um_maybe_init_alphabet:n \__um_init_alphabet:n + \prop_get:cnN { g__um_named_range_ \l__um_style_tl _prop } + { default-alpha } \l__um_alphabet_clist + } + + \__um_check_math_alphabet: + \__um_setup_math_alphabet: + } + } +\cs_new:Nn \__um_check_math_alphabet: + { + \clist_map_inline:Nn \l__um_alphabet_clist + { + \tl_set:Nn \l__um_alphabet_tl {##1} + \__um_if_alphabet_exists:nnTF \l__um_style_tl \l__um_alphabet_tl + { + \str_if_eq_x:nnTF {\l__um_alphabet_tl} {misc} + { + \__um_maybe_init_alphabet:n \l__um_style_tl + \clist_map_break: + } + { + \__um_glyph_if_exist:NnT \g__um_curr_font_cmd_tl + { \__um_to_usv:nn {\l__um_style_tl} {\l__um_alphabet_tl} } + { + \__um_maybe_init_alphabet:n \l__um_style_tl + \clist_map_break: + } + } + } + { + \msg_warning:nnx {unicode-math} {no-alphabet} + { \l__um_style_tl / \l__um_alphabet_tl } + } + } + } +\cs_new:Nn \__um_setup_math_alphabet: + { + \clist_map_inline:Nn \l__um_alphabet_clist + { + \tl_set:Nx \l__um_alphabet_tl { \tl_trim_spaces:n {##1} } + + + \__um_if_alphabet_exists:nnT {\l__um_style_tl} {\l__um_alphabet_tl} + { + \exp_args:No \tl_if_eq:nnTF \l__um_alphabet_tl {misc} + { + \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)} + \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl} + } + { + \__um_glyph_if_exist:NnTF \g__um_curr_font_cmd_tl { \__um_to_usv:nn {\l__um_remap_style_tl} {\l__um_alphabet_tl} } + { + \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)} + \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl} + } + { + \bool_if:NTF \l__um_implicit_alph_bool + { + \seq_put_right:Nx \l__um_missing_alph_seq + { + \@backslashchar sym \l__um_style_tl \space + (\tl_use:c{c__um_math_alphabet_name_ \l__um_alphabet_tl _tl}) + } + } + { + \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {up} + } + } + } + } + } + } \cs_new:Nn \__um_new_alphabet_config:nnn - { - \prop_if_exist:cF {g__um_named_range_#1_prop} - { \__um_warning:nnn {no-named-range} {#1} {#2} } + { + \prop_if_exist:cF {g__um_named_range_#1_prop} + { \__um_warning:nnn {no-named-range} {#1} {#2} } - \prop_gput:cnn {g__um_named_range_#1_prop} { alpha_tl } - { - \prop_item:cn {g__um_named_range_#1_prop} { alpha_tl } - {#2} - } - % Q: do I need to bother removing duplicates? + \prop_gput:cnn {g__um_named_range_#1_prop} { alpha_tl } + { + \prop_item:cn {g__um_named_range_#1_prop} { alpha_tl } {#2} + } + % Q: do I need to bother removing duplicates? - \cs_new:cn { __um_config_#1_#2:n } {#3} - } + \cs_new:cn { __um_config_#1_#2:n } + { + \clist_gclear_new:c {g__um_named_slots_#1_#2_clist} + \tl_set:Nn \l__um_curr_named_slot { g__um_named_slots_#1_#2_clist } + #3 + \clist_gremove_duplicates:c {g__um_named_slots_#1_#2_clist} + } + + } \cs_new:Nn \__um_alphabet_config:nnn - { - \use:c {__um_config_#1_#2:n} {#3} - } + { + \use:c {__um_config_#1_#2:n} {#3} + } \prg_new_conditional:Nnn \__um_if_alphabet_exists:nn {T,TF} - { - \cs_if_exist:cTF {__um_config_#1_#2:n} - \prg_return_true: \prg_return_false: - } + { + \cs_if_exist:cTF {__um_config_#1_#2:n} + \prg_return_true: \prg_return_false: + } +\cs_new:Nn \__um_map_char_noparse:nn + { + \__um_set_mathcode:nnnn {#1} {\mathalpha} {\l__um_symfont_label_tl} {#2} + } +\cs_new:Nn \__um_map_char_parse:nn + { + \__um_if_char_spec:nNT {#1} {\mathalpha} + { \__um_map_char_noparse:nn {#1}{#2} } + } +\cs_new:Nn \__um_map_char_single:nnn + { + \__um_map_char_single:nn { \__um_to_usv:nn {#1} {#3} } + { \__um_to_usv:nn {#2} {#3} } + } +\cs_set:Nn \__um_map_chars_range:nnn + { + \int_step_inline:nnnn {0} {1} {#1-1} + { \__um_map_char_single:nn {#2+##1} {#3+##1} } + + \clist_gput_right:cx { \l__um_curr_named_slot } + { \int_eval:n { #3 } - \int_eval:n { #3 + #1-1 } } + } +\cs_new:Nn \__um_map_chars_range:nnnn + { + \__um_map_chars_range:nnn {#1} { \__um_to_usv:nn {#2} {#4} } + { \__um_to_usv:nn {#3} {#4} } + } +\cs_set:Nn \__um_set_normal_char:nnn + { + \__um_usv_if_exist:nnT {#3} {#1} + { + \clist_map_inline:nn {#2} + { + \__um_set_mathalphabet_pos:nnnn {normal} {#1} {##1} {#3} + \__um_map_char_single:nnn {##1} {#3} {#1} + + \clist_gput_right:cx {\l__um_curr_named_slot} + { \int_eval:n { \__um_to_usv:nn {#3} {#1} } } + } + } + } +\cs_new:Nn \__um_set_normal_Latin:nn + { + \clist_map_inline:nn {#1} + { + \__um_set_mathalphabet_Latin:nnn {normal} {##1} {#2} + \__um_map_chars_range:nnnn {26} {##1} {#2} {Latin} + } + } +\cs_new:Nn \__um_set_normal_latin:nn + { + \clist_map_inline:nn {#1} + { + \__um_set_mathalphabet_latin:nnn {normal} {##1} {#2} + \__um_map_chars_range:nnnn {26} {##1} {#2} {latin} + } + } +\cs_new:Nn \__um_set_normal_greek:nn + { + \clist_map_inline:nn {#1} + { + \__um_set_mathalphabet_greek:nnn {normal} {##1} {#2} + \__um_map_chars_range:nnnn {25} {##1} {#2} {greek} + \__um_map_char_single:nnn {##1} {#2} {epsilon} + \__um_map_char_single:nnn {##1} {#2} {vartheta} + \__um_map_char_single:nnn {##1} {#2} {varkappa} + \__um_map_char_single:nnn {##1} {#2} {phi} + \__um_map_char_single:nnn {##1} {#2} {varrho} + \__um_map_char_single:nnn {##1} {#2} {varpi} + \__um_set_mathalphabet_pos:nnnn {normal} {epsilon} {##1} {#2} + \__um_set_mathalphabet_pos:nnnn {normal} {vartheta} {##1} {#2} + \__um_set_mathalphabet_pos:nnnn {normal} {varkappa} {##1} {#2} + \__um_set_mathalphabet_pos:nnnn {normal} {phi} {##1} {#2} + \__um_set_mathalphabet_pos:nnnn {normal} {varrho} {##1} {#2} + \__um_set_mathalphabet_pos:nnnn {normal} {varpi} {##1} {#2} + } + } +\cs_new:Nn \__um_set_normal_Greek:nn + { + \clist_map_inline:nn {#1} + { + \__um_set_mathalphabet_Greek:nnn {normal} {##1} {#2} + \__um_map_chars_range:nnnn {25} {##1} {#2} {Greek} + \__um_map_char_single:nnn {##1} {#2} {varTheta} + \__um_set_mathalphabet_pos:nnnn {normal} {varTheta} {##1} {#2} + } + } +\cs_new:Nn \__um_set_normal_numbers:nn + { + \__um_set_mathalphabet_numbers:nnn {normal} {#1} {#2} + \__um_map_chars_range:nnnn {10} {#1} {#2} {num} + } +\cs_new:Nn \__um_mathmap_noparse:nnn + { + \tl_put_right:cx { __um_switchto_#1: } + { + \__um_set_mathcode:nnnn {#2} {\mathalpha} {\l__um_symfont_label_tl} {#3} + } + } +\cs_new:Nn \__um_mathmap_parse:nnn + { + \exp_args:NNx \clist_if_in:NnT \l__um_mathmap_charints_clist { \int_eval:n {#3} } + { + \__um_mathmap_noparse:nnn {#1} {#2} {#3} + } + } +\cs_new:Nn \__um_set_mathalphabet_char:nnnn + { + \__um_set_mathalphabet_char:nnn {#1} { \__um_to_usv:nn {#2} {#4} } + { \__um_to_usv:nn {#3} {#4} } + } +\cs_new:Nn \__um_set_mathalph_range:nnnn + { + \int_step_inline:nnnn {0} {1} {#1-1} + { \__um_set_mathalphabet_char:nnn {#2} { ##1 + #3 } { ##1 + #4 } } + } +\cs_new:Nn \__um_set_mathalph_range:nnnnn + { + \clist_gput_right:cx { \l__um_curr_named_slot } + { \int_eval:n { \__um_to_usv:nn {#4} {#5} } - \int_eval:n { (#1-1)+\__um_to_usv:nn {#4} {#5} } } + + \__um_set_mathalph_range:nnnn {#1} {#2} { \__um_to_usv:nn {#3} {#5} } + { \__um_to_usv:nn {#4} {#5} } + } +\cs_new:Nn \__um_set_mathalphabet_pos:nnnn + { + \__um_usv_if_exist:nnT {#4} {#2} + { + \clist_map_inline:nn {#3} + { \__um_set_mathalphabet_char:nnnn {#1} {##1} {#4} {#2} } + + \clist_gput_right:cx {\l__um_curr_named_slot} + { \int_eval:n { \__um_to_usv:nn {#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} {epsilon} + \__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} {phi} + \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varrho} + \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varpi} + } + } + +%%^^A%% um-code-sym-commands.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Definition of "math symbol alphabet" commands such as `\symbf` and co. + +\cs_set:Npn \use@mathgroup #1 #2 + { + \mode_if_math:T % <- not sure if this is really necessary since we've just checked for mmode and raised an error if not! + { + \math@bgroup + \cs_if_eq:cNF {M@\f@encoding} #1 {#1} + \__um_switchto_literal: + \mathgroup #2 \relax + \math@egroup + } + } +\cs_set:Npn \operator@font + { + \__um_switchto_literal: + \__um_fontswitch:n { \g__um_operator_mathfont_tl } + } +\cs_set:Nn \__um_fontswitch:n + { + \mode_if_math:T + { + \cs_set_eq:NN \math@bgroup \scan_stop: + \cs_set_eq:NN \__um_group_begin: \scan_stop: + \cs_set:Npn \__um_group_end: + { + \cs_set_eq:NN \__um_group_begin: \__um_group_begin_frozen: + \cs_set_eq:NN \__um_group_end: \__um_group_end_frozen: + \cs_set_eq:NN \math@bgroup \__ummath@bgroup + \cs_set_eq:NN \math@egroup \__ummath@egroup + } + \cs_set_eq:NN \math@egroup \__um_group_end: + #1 \scan_stop: + } + } +\cs_new:Nn \__um_prepare_mathstyle:n + { + \seq_gput_right:Nn \g__um_mathstyles_seq {#1} + \__um_init_alphabet:n {#1} + \cs_set_protected:cpx {sym#1} ##1 + { + \__um_group_begin: + \exp_not:n + { + \mode_if_math:F + { + \exp_args:Nc \non@alpherr {sym#1} + } + \tl_set:Nn \l__um_mathstyle_tl {#1} + } + \exp_not:c {__um_switchto_#1:} ##1 + \__um_group_end: + } + } +\cs_set:Nn \__um_init_alphabet:n + { + \__um_log:nx {alph-initialise} {#1} + \cs_set_eq:cN {__um_switchto_#1:} \prg_do_nothing: + } \cs_new:Nn \__um_default_mathalph:nnn - { - \seq_put_right:Nx \g__um_named_ranges_seq { \tl_to_str:n {#1} } - \seq_put_right:Nn \g__um_default_mathalph_seq {{#1}{#2}{#3}} - \prop_gput:cnn { g__um_named_range_#1_prop } { default-alpha } {#2} - } + { + \prop_new:c {g__um_named_range_#1_prop} + \seq_gput_right:Nn \g__um_default_mathalph_seq {{#1}{#2}{#3}} + \prop_gput:cnn { g__um_named_range_#1_prop } { default-alpha } {#2} + } \__um_default_mathalph:nnn {up } {latin,Latin,greek,Greek,num,misc} {up } \__um_default_mathalph:nnn {it } {latin,Latin,greek,Greek,misc} {it } \__um_default_mathalph:nnn {bb } {latin,Latin,num,misc} {bb } @@ -1684,382 +2180,945 @@ \__um_default_mathalph:nnn {bfsfup} {latin,Latin,greek,Greek,num,misc} {bfsfup} \__um_default_mathalph:nnn {bfsfit} {latin,Latin,greek,Greek,misc} {bfsfit} \clist_map_inline:nn - { - up, it, bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf, - tt, bb, bbit, scr, bfscr, cal, bfcal, frak, bffrak, - normal, literal, sf, bf, - } - { \__um_prepare_mathstyle:n {#1} } + { + up, it, bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf, + tt, bb, bbit, scr, bfscr, cal, bfcal, frak, bffrak, + normal, literal, sf, bf, + } + { + \__um_prepare_mathstyle:n {#1} + } \clist_map_inline:nn - { rm, it, bf, sf, tt } - { \cs_set_eq:cc { mathtext #1 } { math #1 } } + { rm, it, bf, sf, tt } + { \cs_set_eq:cc { mathtext #1 } { math #1 } } \clist_map_inline:nn - { - normal, bb , bbit, scr, bfscr, cal, bfcal, frak, bffrak, tt, - bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf - } - { - \cs_set:cpx { math #1 } { \exp_not:c { sym #1 } } + { + normal, bb , bbit, scr, bfscr, cal, bfcal, frak, bffrak, tt, + bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf + } + { + \cs_set:cpx { math #1 } { \exp_not:c { sym #1 } } + } +\AtBeginDocument + { + \clist_map_inline:nn + { rm, it, bf, sf, tt } + { + \cs_set_protected:cpx { math #1 } + { + \exp_not:n { \bool_if:NTF } \exp_not:c { g__um_ math #1 _text_bool} + { \exp_not:c { mathtext #1 } } + { \exp_not:c { sym #1 } } + } + } + } +\cs_set_protected:Npn \mathup { \mathrm } +\cs_set_protected:Npn \symrm { \symup } + +%%^^A%% um-code-alphabets.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Definitions for setting up the "math symbol alphabets". + +\__um_new_alphabet_config:nnn {up} {num} + { + \__um_set_normal_numbers:nn {up} {#1} + \__um_set_mathalphabet_numbers:nnn {up} {up} {#1} + } + +\__um_new_alphabet_config:nnn {up} {Latin} + { + \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Latin:nn {up} {#1} } + { + \bool_if:NT \g__um_upLatin_bool { \__um_set_normal_Latin:nn {up,it} {#1} } + } + \__um_set_mathalphabet_Latin:nnn {up} {up,it} {#1} + \__um_set_mathalphabet_Latin:nnn {literal} {up} {up} + \__um_set_mathalphabet_Latin:nnn {literal} {it} {it} + } + +\__um_new_alphabet_config:nnn {up} {latin} + { + \bool_if:NTF \g__um_literal_bool { \__um_set_normal_latin:nn {up} {#1} } + { + \bool_if:NT \g__um_uplatin_bool + { + \__um_set_normal_latin:nn {up,it} {#1} + \__um_set_normal_char:nnn {h} {up,it} {#1} + \__um_set_normal_char:nnn {dotlessi} {up,it} {#1} + \__um_set_normal_char:nnn {dotlessj} {up,it} {#1} + } + } + \__um_set_mathalphabet_latin:nnn {up} {up,it}{#1} + \__um_set_mathalphabet_latin:nnn {literal} {up} {up} + \__um_set_mathalphabet_latin:nnn {literal} {it} {it} + } + +\__um_new_alphabet_config:nnn {up} {Greek} + { + \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Greek:nn {up}{#1} } + { + \bool_if:NT \g__um_upGreek_bool { \__um_set_normal_Greek:nn {up,it}{#1} } + } + \__um_set_mathalphabet_Greek:nnn {up} {up,it}{#1} + \__um_set_mathalphabet_Greek:nnn {literal} {up} {up} + \__um_set_mathalphabet_Greek:nnn {literal} {it} {it} + } + +\__um_new_alphabet_config:nnn {up} {greek} + { + \bool_if:NTF \g__um_literal_bool { \__um_set_normal_greek:nn {up} {#1} } + { + \bool_if:NT \g__um_upgreek_bool + { + \__um_set_normal_greek:nn {up,it} {#1} + } + } + \__um_set_mathalphabet_greek:nnn {up} {up,it} {#1} + \__um_set_mathalphabet_greek:nnn {literal} {up} {up} + \__um_set_mathalphabet_greek:nnn {literal} {it} {it} + } + +\__um_new_alphabet_config:nnn {up} {misc} + { + \bool_if:NTF \g__um_literal_Nabla_bool + { + \__um_set_normal_char:nnn {Nabla}{up}{up} + } + { + \bool_if:NT \g__um_upNabla_bool + { + \__um_set_normal_char:nnn {Nabla}{up,it}{up} + } + } + \bool_if:NTF \g__um_literal_partial_bool + { + \__um_set_normal_char:nnn {partial}{up}{up} + } + { + \bool_if:NT \g__um_uppartial_bool + { + \__um_set_normal_char:nnn {partial}{up,it}{up} + } + } + \__um_set_mathalphabet_pos:nnnn {up} {partial} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {up} {Nabla} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {up} {dotlessi} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {up} {dotlessj} {up,it} {#1} + } +\__um_new_alphabet_config:nnn {it} {Latin} + { + \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Latin:nn {it} {#1} } + { + \bool_if:NF \g__um_upLatin_bool { \__um_set_normal_Latin:nn {up,it} {#1} } + } + \__um_set_mathalphabet_Latin:nnn {it} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {it} {latin} + { + \bool_if:NTF \g__um_literal_bool + { + \__um_set_normal_latin:nn {it}{#1} + \__um_set_normal_char:nnn {h}{it}{#1} + } + { + \bool_if:NF \g__um_uplatin_bool + { + \__um_set_normal_latin:nn {up,it} {#1} + \__um_set_normal_char:nnn {h} {up,it} {#1} + \__um_set_normal_char:nnn {dotlessi} {up,it} {#1} + \__um_set_normal_char:nnn {dotlessj} {up,it} {#1} + } + } + \__um_set_mathalphabet_latin:nnn {it} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {it} {dotlessi} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {it} {dotlessj} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {it} {Greek} + { + \bool_if:NTF \g__um_literal_bool + { + \__um_set_normal_Greek:nn {it} {#1} + } + { + \bool_if:NF \g__um_upGreek_bool { \__um_set_normal_Greek:nn {up,it} {#1} } + } + \__um_set_mathalphabet_Greek:nnn {it} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {it} {greek} + { + \bool_if:NTF \g__um_literal_bool + { + \__um_set_normal_greek:nn {it} {#1} + } + { + \bool_if:NF \g__um_upgreek_bool { \__um_set_normal_greek:nn {it,up} {#1} } + } + \__um_set_mathalphabet_greek:nnn {it} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {it} {misc} + { + \bool_if:NTF \g__um_literal_Nabla_bool + { + \__um_set_normal_char:nnn {Nabla} {it} {it} + } + { + \bool_if:NF \g__um_upNabla_bool + { + \__um_set_normal_char:nnn {Nabla} {up,it} {it} + } + } + \bool_if:NTF \g__um_literal_partial_bool + { + \__um_set_normal_char:nnn {partial} {it} {it} + } + { + \bool_if:NF \g__um_uppartial_bool + { + \__um_set_normal_char:nnn {partial} {up,it} {it} + } + } + \__um_set_mathalphabet_pos:nnnn {it} {partial} {up,it}{#1} + \__um_set_mathalphabet_pos:nnnn {it} {Nabla} {up,it}{#1} + } +\__um_new_alphabet_config:nnn {bb} {latin} + { + \__um_set_mathalphabet_latin:nnn {bb} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {bb} {Latin} + { + \__um_set_mathalphabet_Latin:nnn {bb} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {C} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {H} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {N} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {P} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {Q} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {R} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {Z} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {bb} {num} + { + \__um_set_mathalphabet_numbers:nnn {bb} {up} {#1} + } + +\__um_new_alphabet_config:nnn {bb} {misc} + { + \__um_set_mathalphabet_pos:nnnn {bb} {Pi} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {pi} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {Gamma} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {gamma} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bb} {summation} {up} {#1} + } + +\__um_new_alphabet_config:nnn {bbit} {misc} + { + \__um_set_mathalphabet_pos:nnnn {bbit} {D} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bbit} {d} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bbit} {e} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bbit} {i} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bbit} {j} {up,it} {#1} + } +\__um_new_alphabet_config:nnn {scr} {Latin} + { + \__um_set_mathalphabet_Latin:nnn {scr} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {B} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {E} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {F} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {H} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {I} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {L} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {M} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {R} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {scr} {latin} + { + \__um_set_mathalphabet_latin:nnn {scr} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {e} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {g} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {scr} {o} {up,it} {#1} + } +\__um_new_alphabet_config:nnn {cal} {Latin} + { + \__um_set_mathalphabet_Latin:nnn {cal} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {cal} {B} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {cal} {E} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {cal} {F} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {cal} {H} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {cal} {I} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {cal} {L} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {cal} {M} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {cal} {R} {up,it} {#1} + } +\__um_new_alphabet_config:nnn {frak} {Latin} + { + \__um_set_mathalphabet_Latin:nnn {frak} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {frak} {C} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {frak} {H} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {frak} {I} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {frak} {R} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {frak} {Z} {up,it} {#1} + } +\__um_new_alphabet_config:nnn {frak} {latin} + { + \__um_set_mathalphabet_latin:nnn {frak} {up,it} {#1} + } +\__um_new_alphabet_config:nnn {sfup} {num} + { + \__um_set_mathalphabet_numbers:nnn {sf} {up} {#1} + \__um_set_mathalphabet_numbers:nnn {sfup} {up} {#1} + } +\__um_new_alphabet_config:nnn {sfup} {Latin} + { + \bool_if:NTF \g__um_sfliteral_bool + { + \__um_set_normal_Latin:nn {sfup} {#1} + \__um_set_mathalphabet_Latin:nnn {sf} {up} {#1} + } + { + \bool_if:NT \g__um_upsans_bool + { + \__um_set_normal_Latin:nn {sfup,sfit} {#1} + \__um_set_mathalphabet_Latin:nnn {sf} {up,it} {#1} + } + } + \__um_set_mathalphabet_Latin:nnn {sfup} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {sfup} {latin} + { + \bool_if:NTF \g__um_sfliteral_bool + { + \__um_set_normal_latin:nn {sfup} {#1} + \__um_set_mathalphabet_latin:nnn {sf} {up} {#1} + } + { + \bool_if:NT \g__um_upsans_bool + { + \__um_set_normal_latin:nn {sfup,sfit} {#1} + \__um_set_mathalphabet_latin:nnn {sf} {up,it} {#1} + } + } + \__um_set_mathalphabet_latin:nnn {sfup} {up,it} {#1} + } +\__um_new_alphabet_config:nnn {sfit} {Latin} + { + \bool_if:NTF \g__um_sfliteral_bool + { + \__um_set_normal_Latin:nn {sfit} {#1} + \__um_set_mathalphabet_Latin:nnn {sf} {it} {#1} + } + { + \bool_if:NF \g__um_upsans_bool + { + \__um_set_normal_Latin:nn {sfup,sfit} {#1} + \__um_set_mathalphabet_Latin:nnn {sf} {up,it} {#1} + } + } + \__um_set_mathalphabet_Latin:nnn {sfit} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {sfit} {latin} + { + \bool_if:NTF \g__um_sfliteral_bool + { + \__um_set_normal_latin:nn {sfit} {#1} + \__um_set_mathalphabet_latin:nnn {sf} {it}{#1} + } + { + \bool_if:NF \g__um_upsans_bool + { + \__um_set_normal_latin:nn {sfup,sfit} {#1} + \__um_set_mathalphabet_latin:nnn {sf} {up,it}{#1} + } + } + \__um_set_mathalphabet_latin:nnn {sfit} {up,it}{#1} + } +\__um_new_alphabet_config:nnn {tt} {num} + { + \__um_set_mathalphabet_numbers:nnn {tt} {up}{#1} + } +\__um_new_alphabet_config:nnn {tt} {Latin} + { + \__um_set_mathalphabet_Latin:nnn {tt} {up,it}{#1} + } +\__um_new_alphabet_config:nnn {tt} {latin} + { + \__um_set_mathalphabet_latin:nnn {tt} {up,it}{#1} + } +\__um_new_alphabet_config:nnn {bfit} {Latin} + { + \bool_if:NF \g__um_bfupLatin_bool + { + \__um_set_normal_Latin:nn {bfup,bfit} {#1} + } + \__um_set_mathalphabet_Latin:nnn {bfit} {up,it}{#1} + \bool_if:NTF \g__um_bfliteral_bool + { + \__um_set_normal_Latin:nn {bfit} {#1} + \__um_set_mathalphabet_Latin:nnn {bf} {it}{#1} + } + { + \bool_if:NF \g__um_bfupLatin_bool + { + \__um_set_normal_Latin:nn {bfup,bfit} {#1} + \__um_set_mathalphabet_Latin:nnn {bf} {up,it}{#1} + } + } + } + +\__um_new_alphabet_config:nnn {bfit} {latin} + { + \bool_if:NF \g__um_bfuplatin_bool + { + \__um_set_normal_latin:nn {bfup,bfit} {#1} + } + \__um_set_mathalphabet_latin:nnn {bfit} {up,it}{#1} + \bool_if:NTF \g__um_bfliteral_bool + { + \__um_set_normal_latin:nn {bfit} {#1} + \__um_set_mathalphabet_latin:nnn {bf} {it}{#1} + } + { + \bool_if:NF \g__um_bfuplatin_bool + { + \__um_set_normal_latin:nn {bfup,bfit} {#1} + \__um_set_mathalphabet_latin:nnn {bf} {up,it}{#1} + } + } + } + +\__um_new_alphabet_config:nnn {bfit} {Greek} + { + \__um_set_mathalphabet_Greek:nnn {bfit} {up,it}{#1} + \bool_if:NTF \g__um_bfliteral_bool + { + \__um_set_normal_Greek:nn {bfit}{#1} + \__um_set_mathalphabet_Greek:nnn {bf} {it}{#1} + } + { + \bool_if:NF \g__um_bfupGreek_bool + { + \__um_set_normal_Greek:nn {bfup,bfit}{#1} + \__um_set_mathalphabet_Greek:nnn {bf} {up,it}{#1} + } + } + } + +\__um_new_alphabet_config:nnn {bfit} {greek} + { + \__um_set_mathalphabet_greek:nnn {bfit} {up,it} {#1} + \bool_if:NTF \g__um_bfliteral_bool + { + \__um_set_normal_greek:nn {bfit} {#1} + \__um_set_mathalphabet_greek:nnn {bf} {it} {#1} + } + { + \bool_if:NF \g__um_bfupgreek_bool + { + \__um_set_normal_greek:nn {bfit,bfup} {#1} + \__um_set_mathalphabet_greek:nnn {bf} {up,it} {#1} + } + } + } + +\__um_new_alphabet_config:nnn {bfit} {misc} + { + \bool_if:NTF \g__um_literal_Nabla_bool + { \__um_set_normal_char:nnn {Nabla} {bfit} {#1} } + { + \bool_if:NF \g__um_upNabla_bool + { \__um_set_normal_char:nnn {Nabla} {bfup,bfit} {#1} } + } + + \bool_if:NTF \g__um_literal_partial_bool + { \__um_set_normal_char:nnn {partial} {bfit} {#1} } + { + \bool_if:NF \g__um_uppartial_bool + { \__um_set_normal_char:nnn {partial} {bfup,bfit} {#1} } + } + + \__um_set_mathalphabet_pos:nnnn {bfit} {partial} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bfit} {Nabla} {up,it} {#1} + + \bool_if:NTF \g__um_literal_partial_bool + { + \__um_set_mathalphabet_pos:nnnn {bf} {partial} {it}{#1} + } + { + \bool_if:NF \g__um_uppartial_bool + { + \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up,it}{#1} + } + } + + \bool_if:NTF \g__um_literal_Nabla_bool + { + \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {it}{#1} + } + { + \bool_if:NF \g__um_upNabla_bool + { + \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {up,it}{#1} + } + } + } +\__um_new_alphabet_config:nnn {bfup} {num} + { + \__um_set_mathalphabet_numbers:nnn {bf} {up} {#1} + \__um_set_mathalphabet_numbers:nnn {bfup} {up} {#1} + } + +\__um_new_alphabet_config:nnn {bfup} {Latin} + { + \bool_if:NT \g__um_bfupLatin_bool + { + \__um_set_normal_Latin:nn {bfup,bfit} {#1} + } + \__um_set_mathalphabet_Latin:nnn {bfup} {up,it} {#1} + \bool_if:NTF \g__um_bfliteral_bool + { + \__um_set_normal_Latin:nn {bfup} {#1} + \__um_set_mathalphabet_Latin:nnn {bf} {up} {#1} + } + { + \bool_if:NT \g__um_bfupLatin_bool + { + \__um_set_normal_Latin:nn {bfup,bfit} {#1} + \__um_set_mathalphabet_Latin:nnn {bf} {up,it} {#1} + } + } } -\AtBeginDocument{ -\clist_map_inline:nn - { rm, it, bf, sf, tt } + +\__um_new_alphabet_config:nnn {bfup} {latin} + { + \bool_if:NT \g__um_bfuplatin_bool + { + \__um_set_normal_latin:nn {bfup,bfit} {#1} + } + \__um_set_mathalphabet_latin:nnn {bfup} {up,it} {#1} + \bool_if:NTF \g__um_bfliteral_bool + { + \__um_set_normal_latin:nn {bfup} {#1} + \__um_set_mathalphabet_latin:nnn {bf} {up} {#1} + } + { + \bool_if:NT \g__um_bfuplatin_bool + { + \__um_set_normal_latin:nn {bfup,bfit} {#1} + \__um_set_mathalphabet_latin:nnn {bf} {up,it} {#1} + } + } + } + +\__um_new_alphabet_config:nnn {bfup} {Greek} + { + \__um_set_mathalphabet_Greek:nnn {bfup} {up,it} {#1} + \bool_if:NTF \g__um_bfliteral_bool + { + \__um_set_normal_Greek:nn {bfup} {#1} + \__um_set_mathalphabet_Greek:nnn {bf} {up} {#1} + } + { + \bool_if:NT \g__um_bfupGreek_bool + { + \__um_set_normal_Greek:nn {bfup,bfit} {#1} + \__um_set_mathalphabet_Greek:nnn {bf} {up,it} {#1} + } + } + } + +\__um_new_alphabet_config:nnn {bfup} {greek} + { + \__um_set_mathalphabet_greek:nnn {bfup} {up,it} {#1} + \bool_if:NTF \g__um_bfliteral_bool + { + \__um_set_normal_greek:nn {bfup} {#1} + \__um_set_mathalphabet_greek:nnn {bf} {up} {#1} + } + { + \bool_if:NT \g__um_bfupgreek_bool + { + \__um_set_normal_greek:nn {bfup,bfit} {#1} + \__um_set_mathalphabet_greek:nnn {bf} {up,it} {#1} + } + } + } + +\__um_new_alphabet_config:nnn {bfup} {misc} + { + \bool_if:NTF \g__um_literal_Nabla_bool + { + \__um_set_normal_char:nnn {Nabla} {bfup} {#1} + } + { + \bool_if:NT \g__um_upNabla_bool + { + \__um_set_normal_char:nnn {Nabla} {bfup,bfit} {#1} + } + } + \bool_if:NTF \g__um_literal_partial_bool + { + \__um_set_normal_char:nnn {partial} {bfup} {#1} + } + { + \bool_if:NT \g__um_uppartial_bool + { + \__um_set_normal_char:nnn {partial} {bfup,bfit} {#1} + } + } + \__um_set_mathalphabet_pos:nnnn {bfup} {partial} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bfup} {Nabla} {up,it} {#1} + \__um_set_mathalphabet_pos:nnnn {bfup} {digamma} {up} {#1} + \__um_set_mathalphabet_pos:nnnn {bfup} {Digamma} {up} {#1} + \__um_set_mathalphabet_pos:nnnn {bf} {digamma} {up} {#1} + \__um_set_mathalphabet_pos:nnnn {bf} {Digamma} {up} {#1} + \bool_if:NTF \g__um_literal_partial_bool + { + \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up} {#1} + } + { + \bool_if:NT \g__um_uppartial_bool + { + \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up,it} {#1} + } + } + \bool_if:NTF \g__um_literal_Nabla_bool + { + \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {up}{#1} + } + { + \bool_if:NT \g__um_upNabla_bool + { + \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {up,it} {#1} + } + } + } +\__um_new_alphabet_config:nnn {bffrak} {Latin} + { + \__um_set_mathalphabet_Latin:nnn {bffrak} {up,it}{#1} + } + +\__um_new_alphabet_config:nnn {bffrak} {latin} + { + \__um_set_mathalphabet_latin:nnn {bffrak} {up,it}{#1} + } +\__um_new_alphabet_config:nnn {bfscr} {Latin} + { + \__um_set_mathalphabet_Latin:nnn {bfscr} {up,it}{#1} + } +\__um_new_alphabet_config:nnn {bfscr} {latin} + { + \__um_set_mathalphabet_latin:nnn {bfscr} {up,it}{#1} + } +\__um_new_alphabet_config:nnn {bfcal} {Latin} + { + \__um_set_mathalphabet_Latin:nnn {bfcal} {up,it}{#1} + } +\__um_new_alphabet_config:nnn {bfsfup} {num} + { + \__um_set_mathalphabet_numbers:nnn {bfsf} {up}{#1} + \__um_set_mathalphabet_numbers:nnn {bfsfup} {up}{#1} + } +\__um_new_alphabet_config:nnn {bfsfup} {Latin} + { + \bool_if:NTF \g__um_sfliteral_bool + { + \__um_set_normal_Latin:nn {bfsfup} {#1} + \__um_set_mathalphabet_Latin:nnn {bfsf} {up}{#1} + } + { + \bool_if:NT \g__um_upsans_bool + { + \__um_set_normal_Latin:nn {bfsfup,bfsfit} {#1} + \__um_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1} + } + } + \__um_set_mathalphabet_Latin:nnn {bfsfup} {up,it}{#1} + } + +\__um_new_alphabet_config:nnn {bfsfup} {latin} + { + \bool_if:NTF \g__um_sfliteral_bool + { + \__um_set_normal_latin:nn {bfsfup} {#1} + \__um_set_mathalphabet_latin:nnn {bfsf} {up}{#1} + } + { + \bool_if:NT \g__um_upsans_bool + { + \__um_set_normal_latin:nn {bfsfup,bfsfit} {#1} + \__um_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1} + } + } + \__um_set_mathalphabet_latin:nnn {bfsfup} {up,it}{#1} + } + +\__um_new_alphabet_config:nnn {bfsfup} {Greek} + { + \bool_if:NTF \g__um_sfliteral_bool + { + \__um_set_normal_Greek:nn {bfsfup}{#1} + \__um_set_mathalphabet_Greek:nnn {bfsf} {up}{#1} + } + { + \bool_if:NT \g__um_upsans_bool + { + \__um_set_normal_Greek:nn {bfsfup,bfsfit}{#1} + \__um_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1} + } + } + \__um_set_mathalphabet_Greek:nnn {bfsfup} {up,it}{#1} + } + +\__um_new_alphabet_config:nnn {bfsfup} {greek} + { + \bool_if:NTF \g__um_sfliteral_bool + { + \__um_set_normal_greek:nn {bfsfup} {#1} + \__um_set_mathalphabet_greek:nnn {bfsf} {up} {#1} + } + { + \bool_if:NT \g__um_upsans_bool + { + \__um_set_normal_greek:nn {bfsfup,bfsfit} {#1} + \__um_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1} + } + } + \__um_set_mathalphabet_greek:nnn {bfsfup} {up,it} {#1} + } + +\__um_new_alphabet_config:nnn {bfsfup} {misc} { - \cs_set_protected:cpx { math #1 } + \bool_if:NTF \g__um_literal_Nabla_bool { - \exp_not:n { \bool_if:NTF } \exp_not:c { g__um_ math #1 _text_bool} - { \exp_not:c { mathtext #1 } } - { \exp_not:c { sym #1 } } + \__um_set_normal_char:nnn {Nabla}{bfsfup}{#1} } - }} -\cs_set_protected:Npn \mathup { \mathrm } -\cs_set_protected:Npn \symrm { \symup } -\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} + \bool_if:NT \g__um_upNabla_bool + { + \__um_set_normal_char:nnn {Nabla}{bfsfup,bfsfit}{#1} + } } + \bool_if:NTF \g__um_literal_partial_bool { - \__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 + \__um_set_normal_char:nnn {partial}{bfsfup}{#1} } - - % Now perform the mapping: - \seq_map_inline:Nn \l__um_mathalph_seq { - \tl_set:No \l__um_style_tl { \use_i:nnn ##1 } - \clist_set:No \l__um_alphabet_clist { \use_ii:nnn ##1 } - \tl_set:No \l__um_remap_style_tl { \use_iii:nnn ##1 } - - % If no set of alphabets is defined: - \clist_if_empty:NT \l__um_alphabet_clist + \bool_if:NT \g__um_uppartial_bool { - \cs_set_eq:NN \__um_maybe_init_alphabet:n \__um_init_alphabet:n - \prop_get:cnN { g__um_named_range_ \l__um_style_tl _prop } - { default-alpha } \l__um_alphabet_clist + \__um_set_normal_char:nnn {partial}{bfsfup,bfsfit}{#1} } - - \__um_setup_math_alphabet: } - \seq_if_empty:NF \l__um_missing_alph_seq { \__um_log:n { missing-alphabets } } - } -\cs_new:Nn \__um_setup_math_alphabet: - { - \clist_map_inline:Nn \l__um_alphabet_clist + \__um_set_mathalphabet_pos:nnnn {bfsfup} {partial} {up,it}{#1} + \__um_set_mathalphabet_pos:nnnn {bfsfup} {Nabla} {up,it}{#1} + \bool_if:NTF \g__um_literal_partial_bool + { + \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up}{#1} + } { - \tl_set:Nn \l__um_alphabet_tl {##1} - \__um_if_alphabet_exists:nnTF \l__um_style_tl \l__um_alphabet_tl + \bool_if:NT \g__um_uppartial_bool { - \str_if_eq_x:nnTF {\l__um_alphabet_tl} {misc} - { - \__um_maybe_init_alphabet:n \l__um_style_tl - \clist_map_break: - } - { - \__um_glyph_if_exist:NnT \l__um_font { \__um_to_usv:nn {\l__um_style_tl} {\l__um_alphabet_tl} } - { - \__um_maybe_init_alphabet:n \l__um_style_tl - \clist_map_break: - } - } + \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up,it}{#1} } - { \msg_warning:nnx {unicode-math} {no-alphabet} { \l__um_style_tl / \l__um_alphabet_tl } } } - \clist_map_inline:Nn \l__um_alphabet_clist + \bool_if:NTF \g__um_literal_Nabla_bool + { + \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {up}{#1} + } { - \tl_set:Nx \l__um_alphabet_tl { \tl_trim_spaces:n {##1} } - \cs_if_exist:cT {__um_config_ \l__um_style_tl _ \l__um_alphabet_tl :n} + \bool_if:NT \g__um_upNabla_bool { - \exp_args:No \tl_if_eq:nnTF \l__um_alphabet_tl {misc} - { - \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)} - \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl} - } - { - \__um_glyph_if_exist:NnTF \l__um_font { \__um_to_usv:nn {\l__um_remap_style_tl} {\l__um_alphabet_tl} } - { - \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)} - \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl} - } - { - \bool_if:NTF \l__um_implicit_alph_bool - { - \seq_put_right:Nx \l__um_missing_alph_seq - { - \@backslashchar sym \l__um_style_tl \space - (\tl_use:c{c__um_math_alphabet_name_ \l__um_alphabet_tl _tl}) - } - } - { - \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {up} - } - } - } + \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {up,it}{#1} } } } -\cs_new:Nn \__um_map_char_noparse:nn - { \__um_set_mathcode:nnnn {#1}{\mathalpha}{\l__um_symfont_label_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:nn { \__um_to_usv:nn {#1}{#3} } - { \__um_to_usv:nn {#2}{#3} } - } -\cs_set:Nn \__um_map_chars_range:nnn - { - \int_step_inline:nnnn {0}{1}{#1-1} - { \__um_map_char_single:nn {#2+##1}{#3+##1} } - } -\cs_new:Nn \__um_map_chars_range:nnnn - { - \__um_map_chars_range:nnn {#1} { \__um_to_usv:nn {#2}{#4} } - { \__um_to_usv:nn {#3}{#4} } - } -\cs_set:Nn \__um_set_normal_char:nnn +\__um_new_alphabet_config:nnn {bfsfit} {Latin} { - \__um_usv_if_exist:nnT {#3} {#1} - { - \clist_map_inline:nn {#2} + \bool_if:NTF \g__um_sfliteral_bool + { + \__um_set_normal_Latin:nn {bfsfit} {#1} + \__um_set_mathalphabet_Latin:nnn {bfsf} {it}{#1} + } + { + \bool_if:NF \g__um_upsans_bool { - \__um_set_mathalphabet_pos:nnnn {normal} {#1} {##1} {#3} - \__um_map_char_single:nnn {##1} {#3} {#1} + \__um_set_normal_Latin:nn {bfsfup,bfsfit} {#1} + \__um_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1} } - } - } -\cs_new:Nn \__um_set_normal_Latin:nn - { - \clist_map_inline:nn {#1} - { - \__um_set_mathalphabet_Latin:nnn {normal} {##1} {#2} - \__um_map_chars_range:nnnn {26} {##1} {#2} {Latin} } + \__um_set_mathalphabet_Latin:nnn {bfsfit} {up,it}{#1} } -\cs_new:Nn \__um_set_normal_latin:nn + +\__um_new_alphabet_config:nnn {bfsfit} {latin} { - \clist_map_inline:nn {#1} + \bool_if:NTF \g__um_sfliteral_bool { - \__um_set_mathalphabet_latin:nnn {normal} {##1} {#2} - \__um_map_chars_range:nnnn {26} {##1} {#2} {latin} + \__um_set_normal_latin:nn {bfsfit} {#1} + \__um_set_mathalphabet_latin:nnn {bfsf} {it}{#1} } - } -\cs_new:Nn \__um_set_normal_greek:nn - { - \clist_map_inline:nn {#1} { - \__um_set_mathalphabet_greek:nnn {normal} {##1} {#2} - \__um_map_chars_range:nnnn {25} {##1} {#2} {greek} - \__um_map_char_single:nnn {##1} {#2} {epsilon} - \__um_map_char_single:nnn {##1} {#2} {vartheta} - \__um_map_char_single:nnn {##1} {#2} {varkappa} - \__um_map_char_single:nnn {##1} {#2} {phi} - \__um_map_char_single:nnn {##1} {#2} {varrho} - \__um_map_char_single:nnn {##1} {#2} {varpi} - \__um_set_mathalphabet_pos:nnnn {normal} {epsilon} {##1} {#2} - \__um_set_mathalphabet_pos:nnnn {normal} {vartheta} {##1} {#2} - \__um_set_mathalphabet_pos:nnnn {normal} {varkappa} {##1} {#2} - \__um_set_mathalphabet_pos:nnnn {normal} {phi} {##1} {#2} - \__um_set_mathalphabet_pos:nnnn {normal} {varrho} {##1} {#2} - \__um_set_mathalphabet_pos:nnnn {normal} {varpi} {##1} {#2} + \bool_if:NF \g__um_upsans_bool + { + \__um_set_normal_latin:nn {bfsfup,bfsfit} {#1} + \__um_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1} + } } + \__um_set_mathalphabet_latin:nnn {bfsfit} {up,it}{#1} } -\cs_new:Nn \__um_set_normal_Greek:nn + +\__um_new_alphabet_config:nnn {bfsfit} {Greek} { - \clist_map_inline:nn {#1} + \bool_if:NTF \g__um_sfliteral_bool { - \__um_set_mathalphabet_Greek:nnn {normal} {##1} {#2} - \__um_map_chars_range:nnnn {25} {##1} {#2} {Greek} - \__um_map_char_single:nnn {##1} {#2} {varTheta} - \__um_set_mathalphabet_pos:nnnn {normal} {varTheta} {##1} {#2} + \__um_set_normal_Greek:nn {bfsfit}{#1} + \__um_set_mathalphabet_Greek:nnn {bfsf} {it}{#1} } - } -\cs_new:Nn \__um_set_normal_numbers:nn - { - \__um_set_mathalphabet_numbers:nnn {normal} {#1} {#2} - \__um_map_chars_range:nnnn {10} {#1} {#2} {num} - } -\cs_new:Nn \__um_mathmap_noparse:nnn - { - \clist_map_inline:nn {#2} { - \tl_put_right:cx {__um_switchto_#1:} + \bool_if:NF \g__um_upsans_bool { - \__um_set_mathcode:nnnn {##1} {\mathalpha} {\l__um_symfont_label_tl} {#3} + \__um_set_normal_Greek:nn {bfsfup,bfsfit}{#1} + \__um_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1} } } + \__um_set_mathalphabet_Greek:nnn {bfsfit} {up,it}{#1} } -\cs_new:Nn \__um_mathmap_parse:nnn + +\__um_new_alphabet_config:nnn {bfsfit} {greek} { - \clist_if_in:NnT \l__um_char_nrange_clist {#3} + \bool_if:NTF \g__um_sfliteral_bool { - \__um_mathmap_noparse:nnn {#1}{#2}{#3} + \__um_set_normal_greek:nn {bfsfit} {#1} + \__um_set_mathalphabet_greek:nnn {bfsf} {it} {#1} } - } -\cs_new:Nn \__um_set_mathalphabet_char:nnnn - { - \__um_set_mathalphabet_char:nnn {#1} { \__um_to_usv:nn {#2} {#4} } - { \__um_to_usv:nn {#3} {#4} } - } -\cs_new:Nn \__um_set_mathalph_range:nnnn - { - \int_step_inline:nnnn {0} {1} {#1-1} - { \__um_set_mathalphabet_char:nnn {#2} { ##1 + #3 } { ##1 + #4 } } - } -\cs_new:Nn \__um_set_mathalph_range:nnnnn - { - \__um_set_mathalph_range:nnnn {#1} {#2} { \__um_to_usv:nn {#3} {#5} } - { \__um_to_usv:nn {#4} {#5} } - } -\cs_new:Nn \__um_set_mathalphabet_pos:nnnn - { - \__um_usv_if_exist:nnT {#4} {#2} { - \clist_map_inline:nn {#3} - { \__um_set_mathalphabet_char:nnnn {#1} {##1} {#4} {#2} } + \bool_if:NF \g__um_upsans_bool + { + \__um_set_normal_greek:nn {bfsfup,bfsfit} {#1} + \__um_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1} + } } + \__um_set_mathalphabet_greek:nnn {bfsfit} {up,it} {#1} } -\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 + +\__um_new_alphabet_config:nnn {bfsfit} {misc} { - \clist_map_inline:nn {#2} + \bool_if:NTF \g__um_literal_Nabla_bool { - \__um_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {latin} - \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {h} + \__um_set_normal_char:nnn {Nabla}{bfsfit}{#1} } - } -\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} + \bool_if:NF \g__um_upNabla_bool + { + \__um_set_normal_char:nnn {Nabla}{bfsfup,bfsfit}{#1} + } } - } -\cs_new:Nn \__um_set_mathalphabet_greek:nnn - { - \clist_map_inline:nn {#2} + \bool_if:NTF \g__um_literal_partial_bool { - \__um_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {greek} - \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {epsilon} - \__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} {phi} - \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varrho} - \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varpi} + \__um_set_normal_char:nnn {partial}{bfsfit}{#1} } - } - -%%^^A%% um-code-epilogue.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> - -\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,epsilon,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,phi,chi,psi,omega, - varTheta,varsigma,vartheta,varkappa,varrho,varpi,varepsilon,varphi + \bool_if:NF \g__um_uppartial_bool + { + \__um_set_normal_char:nnn {partial}{bfsfup,bfsfit}{#1} + } } + \__um_set_mathalphabet_pos:nnnn {bfsfit} {partial} {up,it}{#1} + \__um_set_mathalphabet_pos:nnnn {bfsfit} {Nabla} {up,it}{#1} + \bool_if:NTF \g__um_literal_partial_bool { - \tl_set:cx {##1} { \exp_not:c { mit ##1 } } - \tl_set:cx {up ##1} { \exp_not:N \symup \exp_not:c { ##1 } } - \tl_set:cx {it ##1} { \exp_not:N \symit \exp_not:c { ##1 } } + \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {it}{#1} } - } -\AtBeginDocument{\__um_redefine_radical:} -\cs_new:Nn \__um_redefine_radical: - { - \@ifpackageloaded { amsmath } { } { - \cs_set_nopar:Npn \r@@t ##1 ##2 + \bool_if:NF \g__um_uppartial_bool { - \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 + \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up,it}{#1} } } - } -\cs_new:Npn \__um_define_active_frac:Nw #1 #2/#3 - { - \char_set_catcode_active:N #1 - \__um_char_gmake_mathactive:N #1 - \tl_rescan:nn + \bool_if:NTF \g__um_literal_Nabla_bool { - \catcode`\_=11\relax - \catcode`\:=11\relax + \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {it}{#1} } { - \cs_gset:Npx #1 + \bool_if:NF \g__um_upNabla_bool { - \bool_if:NTF \l__um_smallfrac_bool {\exp_not:N\tfrac} {\exp_not:N\frac} - {#2} {#3} + \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {up,it}{#1} } } } + +%%^^A%% um-code-epilogue.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Assorted definitions to close up. + +\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,epsilon,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,phi,chi,psi,omega, + varTheta,varsigma,vartheta,varkappa,varrho,varpi,varepsilon,varphi + } + { + \tl_set:cx {##1} { \exp_not:c { mit ##1 } } + \tl_set:cx {up ##1} { \exp_not:N \symup \exp_not:c { ##1 } } + \tl_set:cx {it ##1} { \exp_not:N \symit \exp_not:c { ##1 } } + } + } +\AtBeginDocument{ \@ifpackageloaded { amsmath } { } { \__um_redefine_radical: } } +\cs_new:Nn \__um_redefine_radical: + { + \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:NnnN ##1 { \kern } { \fontdimen 63 \g__um_sqrt_font_cmd_tl } \g__um_sqrt_font_cmd_tl + \box_move_up:nn + { + (\box_ht:N \l_tmpa_box - \box_dp:N \l_tmpa_box) * \number \fontdimen 65 \g__um_sqrt_font_cmd_tl / 100 + } + { \box_use:N \rootbox } + \__um_mathstyle_scale:NnnN ##1 { \kern } { \fontdimen 64 \g__um_sqrt_font_cmd_tl } \g__um_sqrt_font_cmd_tl + \box_use_clear:N \l_tmpa_box + } + } +\cs_new:Nn \__um_which_frac:nn + { + \bool_if:NTF \l__um_smallfrac_bool {\tfrac} {\frac} {#1} {#2} + } \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: + { + \__um_mathactive_remap:nn {"2189} { \__um_which_frac:nn {0} {3} } + \__um_mathactive_remap:nn {"2152} { \__um_which_frac:nn {1} {10} } + \__um_mathactive_remap:nn {"2151} { \__um_which_frac:nn {1} {9} } + \__um_mathactive_remap:nn {"215B} { \__um_which_frac:nn {1} {8} } + \__um_mathactive_remap:nn {"2150} { \__um_which_frac:nn {1} {7} } + \__um_mathactive_remap:nn {"2159} { \__um_which_frac:nn {1} {6} } + \__um_mathactive_remap:nn {"2155} { \__um_which_frac:nn {1} {5} } + \__um_mathactive_remap:nn {"00BC} { \__um_which_frac:nn {1} {4} } + \__um_mathactive_remap:nn {"2153} { \__um_which_frac:nn {1} {3} } + \__um_mathactive_remap:nn {"215C} { \__um_which_frac:nn {3} {8} } + \__um_mathactive_remap:nn {"2156} { \__um_which_frac:nn {2} {5} } + \__um_mathactive_remap:nn {"00BD} { \__um_which_frac:nn {1} {2} } + \__um_mathactive_remap:nn {"2157} { \__um_which_frac:nn {3} {5} } + \__um_mathactive_remap:nn {"215D} { \__um_which_frac:nn {5} {8} } + \__um_mathactive_remap:nn {"2154} { \__um_which_frac:nn {2} {3} } + \__um_mathactive_remap:nn {"00BE} { \__um_which_frac:nn {3} {4} } + \__um_mathactive_remap:nn {"2158} { \__um_which_frac:nn {4} {5} } + \__um_mathactive_remap:nn {"215A} { \__um_which_frac:nn {5} {6} } + \__um_mathactive_remap:nn {"215E} { \__um_which_frac:nn {7} {8} } + } +\AtBeginDocument { \__um_setup_active_frac: } \protected\def\to{\rightarrow} \protected\def\le{\leq} \protected\def\ge{\geq} @@ -2089,19 +3148,19 @@ \protected\def\smallint{\mathop{\textstyle\int}\limits} \cs_set_eq:NN \latexe_underbar:n \underbar \renewcommand\underbar - { - \mode_if_math:TF \mathunderbar \latexe_underbar:n - } + { + \mode_if_math:TF \mathunderbar \latexe_underbar:n + } \@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{:} } - } - } + { + % 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{:} } + } + } \protected\def\digamma{\updigamma} \protected\def\Digamma{\upDigamma} \cs_set_protected:Npn \| {\Vert} @@ -2109,47 +3168,77 @@ \cs_set_protected:Npn \cdots {\mathinner{\unicodecdots}} \cs_set_eq:NN \__um_text_slash: \slash \cs_set_protected:Npn \slash - { - \mode_if_math:TF {\mathslash} {\__um_text_slash:} - } -\cs_new:Npn \__um_newnot:N #1 - { - \tl_set:Nx \l_not_token_name_tl { \token_to_str:N #1 } - \exp_args:Nx \tl_if_empty:nF { \tl_tail:V \l_not_token_name_tl } - { - \tl_set:Nx \l_not_token_name_tl { \tl_tail:V \l_not_token_name_tl } - } - \cs_if_exist:cTF { n \l_not_token_name_tl } - { - \use:c { n \l_not_token_name_tl } - } - { - \cs_if_exist:cTF { not \l_not_token_name_tl } + { + \mode_if_math:TF {\mathslash} {\__um_text_slash:} + } +\DeclareDocumentCommand \not {m} + { + \tl_set:Nx \l__um_not_token_name_tl { \cs_to_str:N #1 } + \tl_if_empty:NT \l__um_not_token_name_tl { - \use:c { not \l_not_token_name_tl } + \tl_set:Nx \l__um_not_token_name_tl { \token_to_str:N #1 } } + \cs_if_exist:cTF { not \l__um_not_token_name_tl } { - \__um_oldnot: #1 + \use:c { not \l__um_not_token_name_tl } } - } - } -\cs_set_eq:NN \__um_oldnot: \not -\AtBeginDocument{\cs_set_eq:NN \not \__um_newnot:N} -\cs_new_protected_nopar:Nn \__um_setup_negations: - { - \cs_gset:cpn { not= } { \neq } - \cs_gset:cpn { not< } { \nless } - \cs_gset:cpn { not> } { \ngtr } - \cs_gset:Npn \ngets { \nleftarrow } - \cs_gset:Npn \nsimeq { \nsime } - \cs_gset:Npn \nequal { \ne } - \cs_gset:Npn \nle { \nleq } - \cs_gset:Npn \nge { \ngeq } - \cs_gset:Npn \ngreater { \ngtr } - \cs_gset:Npn \nforksnot { \forks } - } + { + \cs_if_exist:cTF { n \l__um_not_token_name_tl } + { + \use:c { n \l__um_not_token_name_tl } + } + { + \tl_if_eq:nnTF {#1} {$} { \notaccent{} } { \notaccent } #1 + } + } + } +\DeclareDocumentCommand \NewNegationCommand {mm} + { + \__um_set_negation_command:Nnn \cs_new_protected:cpn {#1} {#2} + } +\DeclareDocumentCommand \RenewNegationCommand {mm} + { + \__um_set_negation_command:Nnn \cs_set_protected:cpn {#1} {#2} + } +\cs_set:Nn \__um_set_negation_command:Nnn + { + \tl_set:Nx \l__um_not_token_name_tl { \cs_to_str:N #2 } + \tl_if_empty:NT \l__um_not_token_name_tl + { + \tl_set:Nx \l__um_not_token_name_tl { \token_to_str:N #2 } + } + #1 { not \l__um_not_token_name_tl } { #3 } + } +\NewNegationCommand { = } { \neq } +\NewNegationCommand { < } { \nless } +\NewNegationCommand { > } { \ngtr } +\NewNegationCommand { \gets } { \nleftarrow } +\NewNegationCommand { \simeq } { \nsime } +\NewNegationCommand { \equal } { \ne } +\NewNegationCommand { \le } { \nleq } +\NewNegationCommand { \ge } { \ngeq } +\NewNegationCommand { \greater } { \ngtr } +\NewNegationCommand { \forksnot } { \forks } +\int_step_inline:nnnn {0} {1} {9} + { + \__um_mathactive_remap:nn {"FF10+#1} {\char\int_eval:n{`\0+#1}} + } +\int_step_inline:nnnn {0} {1} {26} + { + \__um_mathactive_remap:nn {"FF21+#1} {\char\int_eval:n{`\A+#1}} + \__um_mathactive_remap:nn {"FF41+#1} {\char\int_eval:n{`\a+#1}} + } +\cs_new:Nn \__um_undeclare_symbol:N + { + \cs_set_protected:Npn #1 + { \__um_error:nx {legacy-char-not-supported} { \token_to_str:N #1 } } + } +\__um_undeclare_symbol:N \arrowvert +\__um_undeclare_symbol:N \Arrowvert +\__um_undeclare_symbol:N \bracevert %%^^A%% um-code-primes.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% The definitions needed for the input of primes. \cs_new:Nn \__um_arg_i_before_egroup:n {#1\egroup} \cs_new:Nn \__um_superscript:n @@ -2171,17 +3260,17 @@ { {1} { \__um_superscript:n {#1} } {2} { - \__um_glyph_if_exist:NnTF \l__um_font {"2033} + \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2033} { \__um_superscript:n {\__um_prime_double_mchar} } { \__um_nprimes:Nn #1 {#2} } } {3} { - \__um_glyph_if_exist:NnTF \l__um_font {"2034} + \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2034} { \__um_superscript:n {\__um_prime_triple_mchar} } { \__um_nprimes:Nn #1 {#2} } } {4} { - \__um_glyph_if_exist:NnTF \l__um_font {"2057} + \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2057} { \__um_superscript:n {\__um_prime_quad_mchar} } { \__um_nprimes:Nn #1 {#2} } } @@ -2196,12 +3285,12 @@ { {1} { \__um_superscript:n {#1} } {2} { - \__um_glyph_if_exist:NnTF \l__um_font {"2036} + \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2036} { \__um_superscript:n {\__um_backprime_double_mchar} } { \__um_nprimes:Nn #1 {#2} } } {3} { - \__um_glyph_if_exist:NnTF \l__um_font {"2037} + \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2037} { \__um_superscript:n {\__um_backprime_triple_mchar} } { \__um_nprimes:Nn #1 {#2} } } @@ -2433,1293 +3522,352 @@ \group_end: %%^^A%% um-code-sscript.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Setup for active chars needed to process subscript/superscript input chars. -\group_begin: \cs_new:Nn \__um_setup_active_superscript:nn - { - \prop_gput:Nnn \g__um_supers_prop {#1} {#2} - \char_set_catcode_active:N #1 - \__um_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} -\__um_setup_active_superscript:nn {^^^^02b0} {h} -\__um_setup_active_superscript:nn {^^^^02b2} {j} -\__um_setup_active_superscript:nn {^^^^02b3} {r} -\__um_setup_active_superscript:nn {^^^^02b7} {w} -\__um_setup_active_superscript:nn {^^^^02b8} {y} + { + \prop_gput:Nxn \g__um_supers_prop { \int_eval:n {#1} } {#2} + \__um_mathactive_remap:nn {#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: + } + } \cs_new:Nn \__um_setup_active_subscript:nn - { - \prop_gput:Nnn \g__um_subs_prop {#1} {#2} - \char_set_catcode_active:N #1 - \__um_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 {^^^^2095} {h} -\__um_setup_active_subscript:nn {^^^^1d62} {i} -\__um_setup_active_subscript:nn {^^^^2c7c} {j} -\__um_setup_active_subscript:nn {^^^^2096} {k} -\__um_setup_active_subscript:nn {^^^^2097} {l} -\__um_setup_active_subscript:nn {^^^^2098} {m} -\__um_setup_active_subscript:nn {^^^^2099} {n} -\__um_setup_active_subscript:nn {^^^^2092} {o} -\__um_setup_active_subscript:nn {^^^^209a} {p} -\__um_setup_active_subscript:nn {^^^^1d63} {r} -\__um_setup_active_subscript:nn {^^^^209b} {s} -\__um_setup_active_subscript:nn {^^^^209c} {t} -\__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 - { - \peek_N_type:TF - { - \group_align_safe_begin: - \__um_scan_sscript_aux:nnN {#1} {#2} - } - {#2} - } -\cs_new:Npn \__um_scan_sscript_aux:nnN #1#2#3 - { - \prop_get:cnNTF {g__um_\l__um_tmpa_tl _prop} {#3} \l__um_tmpb_tl - { - \tl_put_right:NV \l__um_ss_chain_tl \l__um_tmpb_tl - \group_align_safe_end: - #1 - } - { \group_align_safe_end: #2 #3 } - } + { + \prop_gput:Nxn \g__um_subs_prop { \int_eval:n {#1} } {#2} + \__um_mathactive_remap:nn {#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: + } + } +\cs_new:Nn \__um_scan_sscript: + { + \__um_scan_sscript:TF + { \__um_scan_sscript: } + { \__um_sub_or_super:n {\l__um_ss_chain_tl} } + } +\cs_new:Nn \__um_scan_sscript:TF + { + \peek_N_type:TF + { + \group_align_safe_begin: + \__um_scan_sscript_aux:nnN {#1} {#2} + } + {#2} + } +\cs_new:Nn \__um_scan_sscript_aux:nnN + { + \tl_set:Nx \l__um_tmpa_key_tl { \tl_to_str:n {#3} } + \prop_get:cxNTF {g__um_\l__um_tmpa_tl _prop} + { \int_eval:n { \exp_after:wN ` \l__um_tmpa_key_tl } } + \l__um_tmpb_tl + { + \tl_put_right:NV \l__um_ss_chain_tl \l__um_tmpb_tl + \group_align_safe_end: + #1 + } + { \group_align_safe_end: #2 #3 } + } +\__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} +\__um_setup_active_superscript:nn {"02B0} {h} +\__um_setup_active_superscript:nn {"02B2} {j} +\__um_setup_active_superscript:nn {"02B3} {r} +\__um_setup_active_superscript:nn {"02B7} {w} +\__um_setup_active_superscript:nn {"02B8} {y} +\__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 {"2095} {h} +\__um_setup_active_subscript:nn {"1D62} {i} +\__um_setup_active_subscript:nn {"2C7C} {j} +\__um_setup_active_subscript:nn {"2096} {k} +\__um_setup_active_subscript:nn {"2097} {l} +\__um_setup_active_subscript:nn {"2098} {m} +\__um_setup_active_subscript:nn {"2099} {n} +\__um_setup_active_subscript:nn {"2092} {o} +\__um_setup_active_subscript:nn {"209A} {p} +\__um_setup_active_subscript:nn {"1D63} {r} +\__um_setup_active_subscript:nn {"209B} {s} +\__um_setup_active_subscript:nn {"209C} {t} +\__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} %%^^A%% um-code-compat.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Compatibility with 3rd party packages. -\cs_new_protected_nopar:Nn \__um_check_and_fix:NNnnnn - { - \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:Nn \__um_check_and_fix:NNnnn - { - \__um_check_and_fix:NNnnnn #1 #2 { #3 } { #4 } { #5 } { #5 } - } -\cs_new_protected_nopar:Nn \__um_check_and_fix_luatex:NNnnn - { - } -\cs_generate_variant:Nn \__um_check_and_fix_luatex:NNnnn { c } -\AtEndOfPackageFile * {url} - { - \tl_put_left:Nn \Url@FormatString { \__um_switchto_up: } - \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 } - } - { - \Uroot \l__um_radical_sqrt_tl { #1 } { #2 } - } - { - \hbox_set:Nn \rootbox - { - \c_math_toggle_token - \m@th - \scriptscriptstyle { #1 } - \c_math_toggle_token + { + \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 } + } } - \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 - } - \Uroot \l__um_radical_sqrt_tl - { - \box_move_up:nn { \box_wd:N \l_tmpa_box } - { - \hbox:n + } +\AtEndOfPackageFile * {url} + { + \tl_put_left:Nn \Url@FormatString { \__um_switchto_up: } + \tl_put_right:Nn \UrlSpecials + { + \do \` { \mathchar`\` } + \do \' { \mathchar`\' } + \do \$ { \mathchar`\$ } + \do \& { \mathchar`\& } + } + } +\AtEndOfPackageFile * { mathtools } + { + \__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 { - \c_math_toggle_token - \m@th - \mkern -\leftroot@ mu - \box_use:N \rootbox - \mkern \leftroot@ mu - \c_math_toggle_token + \color@setgroup \c_math_toggle_token \m@th + #1 + \dim_zero:N \nulldelimiterspace + \XeTeXradical \c_two_hundred_fifty_five \c_zero { #2 } + \c_math_toggle_token \color@endgroup } - } - } - { #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: - } - } -\AtEndOfPackageFile * { mathtools } - { - \__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 \c_two_hundred_fifty_five \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 + \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 } - } + } \AtEndOfPackageFile * { mathtools } - { + { \cs_set_eq:NN \MToverbracket \overbracket \cs_set_eq:NN \MTunderbracket \underbracket \AtBeginDocument - { - \msg_warning:nn { unicode-math } { mathtools-overbracket } + { + \msg_warning:nn { unicode-math } { mathtools-overbracket } -\def\downbracketfill#1#2 - {% - \edef\l_MT_bracketheight_fdim{.27ex}% - \downbracketend{#1}{#2} + \cs_set:Npn \downbracketfill #1 #2 + { + \tl_set:Nn \l_MT_bracketheight_fdim {.27ex} + \downbracketend {#1} {#2} \leaders \vrule \@height #1 \@depth \z@ \hfill - \downbracketend{#1}{#2}% - } -\def\upbracketfill#1#2 - {% - \edef\l_MT_bracketheight_fdim{.27ex}% - \upbracketend{#1}{#2} - \leaders \vrule \@height \z@ \@depth #1 \hfill - \upbracketend{#1}{#2}% - } -\let\Uoverbracket =\overbracket -\let\Uunderbracket=\underbracket - \let\overbracket =\MToverbracket - \let\underbracket =\MTunderbracket - }% end of AtBeginDocument - \msg_warning:nn { unicode-math } { mathtools-colon } - \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 } - } - -%%^^A%% um-code-alphabets.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> - -\__um_new_alphabet_config:nnn {up} {num} - { - \__um_set_normal_numbers:nn {up} {#1} - \__um_set_mathalphabet_numbers:nnn {up} {up} {#1} - } - -\__um_new_alphabet_config:nnn {up} {Latin} - { - \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Latin:nn {up} {#1} } - { - \bool_if:NT \g__um_upLatin_bool { \__um_set_normal_Latin:nn {up,it} {#1} } - } - \__um_set_mathalphabet_Latin:nnn {up} {up,it} {#1} - \__um_set_mathalphabet_Latin:nnn {literal} {up} {up} - \__um_set_mathalphabet_Latin:nnn {literal} {it} {it} - } - -\__um_new_alphabet_config:nnn {up} {latin} - { - \bool_if:NTF \g__um_literal_bool { \__um_set_normal_latin:nn {up} {#1} } - { - \bool_if:NT \g__um_uplatin_bool - { - \__um_set_normal_latin:nn {up,it} {#1} - \__um_set_normal_char:nnn {h} {up,it} {#1} - \__um_set_normal_char:nnn {dotlessi} {up,it} {#1} - \__um_set_normal_char:nnn {dotlessj} {up,it} {#1} - } - } - \__um_set_mathalphabet_latin:nnn {up} {up,it}{#1} - \__um_set_mathalphabet_latin:nnn {literal} {up} {up} - \__um_set_mathalphabet_latin:nnn {literal} {it} {it} - } - -\__um_new_alphabet_config:nnn {up} {Greek} - { - \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Greek:nn {up}{#1} } - { - \bool_if:NT \g__um_upGreek_bool { \__um_set_normal_Greek:nn {up,it}{#1} } - } - \__um_set_mathalphabet_Greek:nnn {up} {up,it}{#1} - \__um_set_mathalphabet_Greek:nnn {literal} {up} {up} - \__um_set_mathalphabet_Greek:nnn {literal} {it} {it} - } - -\__um_new_alphabet_config:nnn {up} {greek} - { - \bool_if:NTF \g__um_literal_bool { \__um_set_normal_greek:nn {up} {#1} } - { - \bool_if:NT \g__um_upgreek_bool - { - \__um_set_normal_greek:nn {up,it} {#1} - } - } - \__um_set_mathalphabet_greek:nnn {up} {up,it} {#1} - \__um_set_mathalphabet_greek:nnn {literal} {up} {up} - \__um_set_mathalphabet_greek:nnn {literal} {it} {it} - } - -\__um_new_alphabet_config:nnn {up} {misc} - { - \bool_if:NTF \g__um_literal_Nabla_bool - { - \__um_set_normal_char:nnn {Nabla}{up}{up} - } - { - \bool_if:NT \g__um_upNabla_bool - { - \__um_set_normal_char:nnn {Nabla}{up,it}{up} - } - } - \bool_if:NTF \g__um_literal_partial_bool - { - \__um_set_normal_char:nnn {partial}{up}{up} - } - { - \bool_if:NT \g__um_uppartial_bool - { - \__um_set_normal_char:nnn {partial}{up,it}{up} - } - } - \__um_set_mathalphabet_pos:nnnn {up} {partial} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {up} {Nabla} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {up} {dotlessi} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {up} {dotlessj} {up,it} {#1} - } -\__um_new_alphabet_config:nnn {it} {Latin} - { - \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Latin:nn {it} {#1} } - { - \bool_if:NF \g__um_upLatin_bool { \__um_set_normal_Latin:nn {up,it} {#1} } - } - \__um_set_mathalphabet_Latin:nnn {it}{up,it}{#1} - } - -\__um_new_alphabet_config:nnn {it} {latin} - { - \bool_if:NTF \g__um_literal_bool - { - \__um_set_normal_latin:nn {it} {#1} - \__um_set_normal_char:nnn {h}{it}{#1} - } - { - \bool_if:NF \g__um_uplatin_bool - { - \__um_set_normal_latin:nn {up,it} {#1} - \__um_set_normal_char:nnn {h}{up,it}{#1} - \__um_set_normal_char:nnn {dotlessi}{up,it}{#1} - \__um_set_normal_char:nnn {dotlessj}{up,it}{#1} - } - } - \__um_set_mathalphabet_latin:nnn {it} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {it} {dotlessi} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {it} {dotlessj} {up,it} {#1} - } - -\__um_new_alphabet_config:nnn {it} {Greek} - { - \bool_if:NTF \g__um_literal_bool - { - \__um_set_normal_Greek:nn {it}{#1} - } - { - \bool_if:NF \g__um_upGreek_bool { \__um_set_normal_Greek:nn {up,it}{#1} } - } - \__um_set_mathalphabet_Greek:nnn {it} {up,it}{#1} - } - -\__um_new_alphabet_config:nnn {it} {greek} - { - \bool_if:NTF \g__um_literal_bool - { - \__um_set_normal_greek:nn {it} {#1} - } - { - \bool_if:NF \g__um_upgreek_bool { \__um_set_normal_greek:nn {it,up} {#1} } - } - \__um_set_mathalphabet_greek:nnn {it} {up,it} {#1} - } - -\__um_new_alphabet_config:nnn {it} {misc} - { - \bool_if:NTF \g__um_literal_Nabla_bool - { - \__um_set_normal_char:nnn {Nabla}{it}{it} - } - { - \bool_if:NF \g__um_upNabla_bool - { - \__um_set_normal_char:nnn {Nabla}{up,it}{it} - } - } - \bool_if:NTF \g__um_literal_partial_bool - { - \__um_set_normal_char:nnn {partial}{it}{it} - } - { - \bool_if:NF \g__um_uppartial_bool - { - \__um_set_normal_char:nnn {partial}{up,it}{it} - } - } - \__um_set_mathalphabet_pos:nnnn {it} {partial} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {it} {Nabla} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {bb} {latin} - { - \__um_set_mathalphabet_latin:nnn {bb} {up,it}{#1} - } - -\__um_new_alphabet_config:nnn {bb} {Latin} - { - \__um_set_mathalphabet_Latin:nnn {bb} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {bb} {C} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {H} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {N} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {P} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {Q} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {R} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {Z} {up,it} {#1} - } - -\__um_new_alphabet_config:nnn {bb} {num} - { - \__um_set_mathalphabet_numbers:nnn {bb} {up}{#1} - } - -\__um_new_alphabet_config:nnn {bb} {misc} - { - \__um_set_mathalphabet_pos:nnnn {bb} {Pi} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {pi} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {Gamma} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {gamma} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bb} {summation} {up} {#1} - } - -\__um_new_alphabet_config:nnn {bbit} {misc} - { - \__um_set_mathalphabet_pos:nnnn {bbit} {D} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bbit} {d} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bbit} {e} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bbit} {i} {up,it} {#1} - \__um_set_mathalphabet_pos:nnnn {bbit} {j} {up,it} {#1} - } -\__um_new_alphabet_config:nnn {scr} {Latin} - { - \__um_set_mathalphabet_Latin:nnn {scr} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {B}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {E}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {F}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {H}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {I}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {L}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {M}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {R}{up,it}{#1} - } - -\__um_new_alphabet_config:nnn {scr} {latin} - { - \__um_set_mathalphabet_latin:nnn {scr} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {e}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {g}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {scr} {o}{up,it}{#1} - } -\__um_new_alphabet_config:nnn {cal} {Latin} - { - \__um_set_mathalphabet_Latin:nnn {cal} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {cal} {B}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {cal} {E}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {cal} {F}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {cal} {H}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {cal} {I}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {cal} {L}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {cal} {M}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {cal} {R}{up,it}{#1} - } -\__um_new_alphabet_config:nnn {frak} {Latin} - { - \__um_set_mathalphabet_Latin:nnn {frak} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {frak} {C}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {frak} {H}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {frak} {I}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {frak} {R}{up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {frak} {Z}{up,it}{#1} - } -\__um_new_alphabet_config:nnn {frak} {latin} - { - \__um_set_mathalphabet_latin:nnn {frak} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {sfup} {num} - { - \__um_set_mathalphabet_numbers:nnn {sf} {up}{#1} - \__um_set_mathalphabet_numbers:nnn {sfup} {up}{#1} - } -\__um_new_alphabet_config:nnn {sfup} {Latin} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_Latin:nn {sfup} {#1} - \__um_set_mathalphabet_Latin:nnn {sf} {up}{#1} - } - { - \bool_if:NT \g__um_upsans_bool - { - \__um_set_normal_Latin:nn {sfup,sfit} {#1} - \__um_set_mathalphabet_Latin:nnn {sf} {up,it}{#1} - } - } - \__um_set_mathalphabet_Latin:nnn {sfup} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {sfup} {latin} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_latin:nn {sfup} {#1} - \__um_set_mathalphabet_latin:nnn {sf} {up}{#1} - } - { - \bool_if:NT \g__um_upsans_bool - { - \__um_set_normal_latin:nn {sfup,sfit} {#1} - \__um_set_mathalphabet_latin:nnn {sf} {up,it}{#1} - } - } - \__um_set_mathalphabet_latin:nnn {sfup} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {sfit} {Latin} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_Latin:nn {sfit} {#1} - \__um_set_mathalphabet_Latin:nnn {sf} {it}{#1} - } - { - \bool_if:NF \g__um_upsans_bool - { - \__um_set_normal_Latin:nn {sfup,sfit} {#1} - \__um_set_mathalphabet_Latin:nnn {sf} {up,it}{#1} - } - } - \__um_set_mathalphabet_Latin:nnn {sfit} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {sfit} {latin} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_latin:nn {sfit} {#1} - \__um_set_mathalphabet_latin:nnn {sf} {it}{#1} - } - { - \bool_if:NF \g__um_upsans_bool - { - \__um_set_normal_latin:nn {sfup,sfit} {#1} - \__um_set_mathalphabet_latin:nnn {sf} {up,it}{#1} - } - } - \__um_set_mathalphabet_latin:nnn {sfit} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {tt} {num} - { - \__um_set_mathalphabet_numbers:nnn {tt} {up}{#1} - } -\__um_new_alphabet_config:nnn {tt} {Latin} - { - \__um_set_mathalphabet_Latin:nnn {tt} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {tt} {latin} - { - \__um_set_mathalphabet_latin:nnn {tt} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {bfit} {Latin} - { - \bool_if:NF \g__um_bfupLatin_bool - { - \__um_set_normal_Latin:nn {bfup,bfit} {#1} - } - \__um_set_mathalphabet_Latin:nnn {bfit} {up,it}{#1} - \bool_if:NTF \g__um_bfliteral_bool - { - \__um_set_normal_Latin:nn {bfit} {#1} - \__um_set_mathalphabet_Latin:nnn {bf} {it}{#1} - } - { - \bool_if:NF \g__um_bfupLatin_bool - { - \__um_set_normal_Latin:nn {bfup,bfit} {#1} - \__um_set_mathalphabet_Latin:nnn {bf} {up,it}{#1} - } - } - } - -\__um_new_alphabet_config:nnn {bfit} {latin} - { - \bool_if:NF \g__um_bfuplatin_bool - { - \__um_set_normal_latin:nn {bfup,bfit} {#1} - } - \__um_set_mathalphabet_latin:nnn {bfit} {up,it}{#1} - \bool_if:NTF \g__um_bfliteral_bool - { - \__um_set_normal_latin:nn {bfit} {#1} - \__um_set_mathalphabet_latin:nnn {bf} {it}{#1} - } - { - \bool_if:NF \g__um_bfuplatin_bool - { - \__um_set_normal_latin:nn {bfup,bfit} {#1} - \__um_set_mathalphabet_latin:nnn {bf} {up,it}{#1} - } - } - } - -\__um_new_alphabet_config:nnn {bfit} {Greek} - { - \__um_set_mathalphabet_Greek:nnn {bfit} {up,it}{#1} - \bool_if:NTF \g__um_bfliteral_bool - { - \__um_set_normal_Greek:nn {bfit}{#1} - \__um_set_mathalphabet_Greek:nnn {bf} {it}{#1} - } - { - \bool_if:NF \g__um_bfupGreek_bool - { - \__um_set_normal_Greek:nn {bfup,bfit}{#1} - \__um_set_mathalphabet_Greek:nnn {bf} {up,it}{#1} - } - } - } - -\__um_new_alphabet_config:nnn {bfit} {greek} - { - \__um_set_mathalphabet_greek:nnn {bfit} {up,it} {#1} - \bool_if:NTF \g__um_bfliteral_bool - { - \__um_set_normal_greek:nn {bfit} {#1} - \__um_set_mathalphabet_greek:nnn {bf} {it} {#1} - } - { - \bool_if:NF \g__um_bfupgreek_bool - { - \__um_set_normal_greek:nn {bfit,bfup} {#1} - \__um_set_mathalphabet_greek:nnn {bf} {up,it} {#1} - } - } - } - -\__um_new_alphabet_config:nnn {bfit} {misc} - { - \bool_if:NTF \g__um_literal_Nabla_bool - { \__um_set_normal_char:nnn {Nabla}{bfit}{#1} } - { - \bool_if:NF \g__um_upNabla_bool - { \__um_set_normal_char:nnn {Nabla}{bfup,bfit}{#1} } - } - \bool_if:NTF \g__um_literal_partial_bool - { \__um_set_normal_char:nnn {partial}{bfit}{#1} } - { - \bool_if:NF \g__um_uppartial_bool - { \__um_set_normal_char:nnn {partial}{bfup,bfit}{#1} } - } - \__um_set_mathalphabet_pos:nnnn {bfit} {partial} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {bfit} {Nabla} {up,it}{#1} - \bool_if:NTF \g__um_literal_partial_bool - { - \__um_set_mathalphabet_pos:nnnn {bf} {partial} {it}{#1} - } - { - \bool_if:NF \g__um_uppartial_bool - { - \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up,it}{#1} - } - } - \bool_if:NTF \g__um_literal_Nabla_bool - { - \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {it}{#1} - } - { - \bool_if:NF \g__um_upNabla_bool - { - \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {up,it}{#1} - } - } - } -\__um_new_alphabet_config:nnn {bfup} {num} - { - \__um_set_mathalphabet_numbers:nnn {bf} {up}{#1} - \__um_set_mathalphabet_numbers:nnn {bfup} {up}{#1} - } - -\__um_new_alphabet_config:nnn {bfup} {Latin} - { - \bool_if:NT \g__um_bfupLatin_bool - { - \__um_set_normal_Latin:nn {bfup,bfit} {#1} - } - \__um_set_mathalphabet_Latin:nnn {bfup} {up,it}{#1} - \bool_if:NTF \g__um_bfliteral_bool - { - \__um_set_normal_Latin:nn {bfup} {#1} - \__um_set_mathalphabet_Latin:nnn {bf} {up}{#1} - } - { - \bool_if:NT \g__um_bfupLatin_bool - { - \__um_set_normal_Latin:nn {bfup,bfit} {#1} - \__um_set_mathalphabet_Latin:nnn {bf} {up,it}{#1} - } - } - } - -\__um_new_alphabet_config:nnn {bfup} {latin} - { - \bool_if:NT \g__um_bfuplatin_bool - { - \__um_set_normal_latin:nn {bfup,bfit} {#1} - } - \__um_set_mathalphabet_latin:nnn {bfup} {up,it}{#1} - \bool_if:NTF \g__um_bfliteral_bool - { - \__um_set_normal_latin:nn {bfup} {#1} - \__um_set_mathalphabet_latin:nnn {bf} {up}{#1} - } - { - \bool_if:NT \g__um_bfuplatin_bool - { - \__um_set_normal_latin:nn {bfup,bfit} {#1} - \__um_set_mathalphabet_latin:nnn {bf} {up,it}{#1} - } - } - } -\__um_new_alphabet_config:nnn {bfup} {Greek} - { - \__um_set_mathalphabet_Greek:nnn {bfup} {up,it}{#1} - \bool_if:NTF \g__um_bfliteral_bool - { - \__um_set_normal_Greek:nn {bfup}{#1} - \__um_set_mathalphabet_Greek:nnn {bf} {up}{#1} - } - { - \bool_if:NT \g__um_bfupGreek_bool - { - \__um_set_normal_Greek:nn {bfup,bfit}{#1} - \__um_set_mathalphabet_Greek:nnn {bf} {up,it}{#1} - } - } - } - -\__um_new_alphabet_config:nnn {bfup} {greek} - { - \__um_set_mathalphabet_greek:nnn {bfup} {up,it} {#1} - \bool_if:NTF \g__um_bfliteral_bool - { - \__um_set_normal_greek:nn {bfup} {#1} - \__um_set_mathalphabet_greek:nnn {bf} {up} {#1} - } - { - \bool_if:NT \g__um_bfupgreek_bool - { - \__um_set_normal_greek:nn {bfup,bfit} {#1} - \__um_set_mathalphabet_greek:nnn {bf} {up,it} {#1} - } - } - } - -\__um_new_alphabet_config:nnn {bfup} {misc} - { - \bool_if:NTF \g__um_literal_Nabla_bool - { - \__um_set_normal_char:nnn {Nabla}{bfup}{#1} - } - { - \bool_if:NT \g__um_upNabla_bool - { - \__um_set_normal_char:nnn {Nabla}{bfup,bfit}{#1} - } - } - \bool_if:NTF \g__um_literal_partial_bool - { - \__um_set_normal_char:nnn {partial}{bfup}{#1} - } - { - \bool_if:NT \g__um_uppartial_bool - { - \__um_set_normal_char:nnn {partial}{bfup,bfit}{#1} - } - } - \__um_set_mathalphabet_pos:nnnn {bfup} {partial} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {bfup} {Nabla} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {bfup} {digamma} {up}{#1} - \__um_set_mathalphabet_pos:nnnn {bfup} {Digamma} {up}{#1} - \__um_set_mathalphabet_pos:nnnn {bf} {digamma} {up}{#1} - \__um_set_mathalphabet_pos:nnnn {bf} {Digamma} {up}{#1} - \bool_if:NTF \g__um_literal_partial_bool - { - \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up}{#1} - } - { - \bool_if:NT \g__um_uppartial_bool - { - \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up,it}{#1} - } - } - \bool_if:NTF \g__um_literal_Nabla_bool - { - \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {up}{#1} - } - { - \bool_if:NT \g__um_upNabla_bool - { - \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {up,it}{#1} - } - } - } -\__um_new_alphabet_config:nnn {bffrak} {Latin} - { - \__um_set_mathalphabet_Latin:nnn {bffrak} {up,it}{#1} - } - -\__um_new_alphabet_config:nnn {bffrak} {latin} - { - \__um_set_mathalphabet_latin:nnn {bffrak} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {bfscr} {Latin} - { - \__um_set_mathalphabet_Latin:nnn {bfscr} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {bfscr} {latin} - { - \__um_set_mathalphabet_latin:nnn {bfscr} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {bfcal} {Latin} - { - \__um_set_mathalphabet_Latin:nnn {bfcal} {up,it}{#1} - } -\__um_new_alphabet_config:nnn {bfsfup} {num} - { - \__um_set_mathalphabet_numbers:nnn {bfsf} {up}{#1} - \__um_set_mathalphabet_numbers:nnn {bfsfup} {up}{#1} - } -\__um_new_alphabet_config:nnn {bfsfup} {Latin} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_Latin:nn {bfsfup} {#1} - \__um_set_mathalphabet_Latin:nnn {bfsf} {up}{#1} - } - { - \bool_if:NT \g__um_upsans_bool - { - \__um_set_normal_Latin:nn {bfsfup,bfsfit} {#1} - \__um_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1} - } - } - \__um_set_mathalphabet_Latin:nnn {bfsfup} {up,it}{#1} - } - -\__um_new_alphabet_config:nnn {bfsfup} {latin} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_latin:nn {bfsfup} {#1} - \__um_set_mathalphabet_latin:nnn {bfsf} {up}{#1} - } - { - \bool_if:NT \g__um_upsans_bool - { - \__um_set_normal_latin:nn {bfsfup,bfsfit} {#1} - \__um_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1} - } - } - \__um_set_mathalphabet_latin:nnn {bfsfup} {up,it}{#1} - } - -\__um_new_alphabet_config:nnn {bfsfup} {Greek} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_Greek:nn {bfsfup}{#1} - \__um_set_mathalphabet_Greek:nnn {bfsf} {up}{#1} - } - { - \bool_if:NT \g__um_upsans_bool - { - \__um_set_normal_Greek:nn {bfsfup,bfsfit}{#1} - \__um_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1} - } - } - \__um_set_mathalphabet_Greek:nnn {bfsfup} {up,it}{#1} - } - -\__um_new_alphabet_config:nnn {bfsfup} {greek} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_greek:nn {bfsfup} {#1} - \__um_set_mathalphabet_greek:nnn {bfsf} {up} {#1} - } - { - \bool_if:NT \g__um_upsans_bool - { - \__um_set_normal_greek:nn {bfsfup,bfsfit} {#1} - \__um_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1} - } - } - \__um_set_mathalphabet_greek:nnn {bfsfup} {up,it} {#1} - } -\__um_new_alphabet_config:nnn {bfsfup} {misc} - { - \bool_if:NTF \g__um_literal_Nabla_bool - { - \__um_set_normal_char:nnn {Nabla}{bfsfup}{#1} - } - { - \bool_if:NT \g__um_upNabla_bool - { - \__um_set_normal_char:nnn {Nabla}{bfsfup,bfsfit}{#1} - } - } - \bool_if:NTF \g__um_literal_partial_bool - { - \__um_set_normal_char:nnn {partial}{bfsfup}{#1} - } - { - \bool_if:NT \g__um_uppartial_bool - { - \__um_set_normal_char:nnn {partial}{bfsfup,bfsfit}{#1} - } - } - \__um_set_mathalphabet_pos:nnnn {bfsfup} {partial} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {bfsfup} {Nabla} {up,it}{#1} - \bool_if:NTF \g__um_literal_partial_bool - { - \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up}{#1} - } - { - \bool_if:NT \g__um_uppartial_bool - { - \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up,it}{#1} - } - } - \bool_if:NTF \g__um_literal_Nabla_bool - { - \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {up}{#1} - } - { - \bool_if:NT \g__um_upNabla_bool - { - \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {up,it}{#1} - } - } - } -\__um_new_alphabet_config:nnn {bfsfit} {Latin} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_Latin:nn {bfsfit} {#1} - \__um_set_mathalphabet_Latin:nnn {bfsf} {it}{#1} - } - { - \bool_if:NF \g__um_upsans_bool - { - \__um_set_normal_Latin:nn {bfsfup,bfsfit} {#1} - \__um_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1} - } - } - \__um_set_mathalphabet_Latin:nnn {bfsfit} {up,it}{#1} - } + \downbracketend {#1} {#2} + } -\__um_new_alphabet_config:nnn {bfsfit} {latin} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_latin:nn {bfsfit} {#1} - \__um_set_mathalphabet_latin:nnn {bfsf} {it}{#1} - } - { - \bool_if:NF \g__um_upsans_bool - { - \__um_set_normal_latin:nn {bfsfup,bfsfit} {#1} - \__um_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1} - } - } - \__um_set_mathalphabet_latin:nnn {bfsfit} {up,it}{#1} - } + \cs_set:Npn \upbracketfill #1 #2 + { + \tl_set:Nn \l_MT_bracketheight_fdim {.27ex} + \upbracketend {#1} {#2} + \leaders \vrule \@height \z@ \@depth #1 \hfill + \upbracketend {#1} {#2} + } -\__um_new_alphabet_config:nnn {bfsfit} {Greek} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_Greek:nn {bfsfit}{#1} - \__um_set_mathalphabet_Greek:nnn {bfsf} {it}{#1} - } - { - \bool_if:NF \g__um_upsans_bool - { - \__um_set_normal_Greek:nn {bfsfup,bfsfit}{#1} - \__um_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1} + \cs_set_eq:NN \Uoverbracket \overbracket + \cs_set_eq:NN \Uunderbracket \underbracket + \cs_set_eq:NN \overbracket \MToverbracket + \cs_set_eq:NN \underbracket \MTunderbracket } - } - \__um_set_mathalphabet_Greek:nnn {bfsfit} {up,it}{#1} - } + } +\AtEndOfPackageFile * { mathtools } + { + \msg_warning:nn { unicode-math } { mathtools-colon } + \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 } + } -\__um_new_alphabet_config:nnn {bfsfit} {greek} - { - \bool_if:NTF \g__um_sfliteral_bool - { - \__um_set_normal_greek:nn {bfsfit} {#1} - \__um_set_mathalphabet_greek:nnn {bfsf} {it} {#1} - } - { - \bool_if:NF \g__um_upsans_bool - { - \__um_set_normal_greek:nn {bfsfup,bfsfit} {#1} - \__um_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1} - } - } - \__um_set_mathalphabet_greek:nnn {bfsfit} {up,it} {#1} - } +%%^^A%% um-code-amsmath.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Compatibility with amsmath. -\__um_new_alphabet_config:nnn {bfsfit} {misc} - { - \bool_if:NTF \g__um_literal_Nabla_bool - { - \__um_set_normal_char:nnn {Nabla}{bfsfit}{#1} - } - { - \bool_if:NF \g__um_upNabla_bool - { - \__um_set_normal_char:nnn {Nabla}{bfsfup,bfsfit}{#1} - } - } - \bool_if:NTF \g__um_literal_partial_bool - { - \__um_set_normal_char:nnn {partial}{bfsfit}{#1} - } - { - \bool_if:NF \g__um_uppartial_bool - { - \__um_set_normal_char:nnn {partial}{bfsfup,bfsfit}{#1} - } - } - \__um_set_mathalphabet_pos:nnnn {bfsfit} {partial} {up,it}{#1} - \__um_set_mathalphabet_pos:nnnn {bfsfit} {Nabla} {up,it}{#1} - \bool_if:NTF \g__um_literal_partial_bool - { - \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {it}{#1} - } - { - \bool_if:NF \g__um_uppartial_bool - { - \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up,it}{#1} - } - } - \bool_if:NTF \g__um_literal_Nabla_bool - { - \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {it}{#1} - } - { - \bool_if:NF \g__um_upNabla_bool - { - \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {up,it}{#1} - } - } - } +\AtEndOfPackageFile * {amsmath} + { + \tl_remove_once:Nn \@begindocumenthook + { + \mathchardef\std@minus\mathcode`\-\relax + \mathchardef\std@equal\mathcode`\=\relax + } + \AtBeginDocument + { + \Umathcharnumdef\std@minus\Umathcodenum`- + \Umathcharnumdef\std@equal\Umathcodenum`= + } + \cs_set:Npn \@cdots {\mathinner{\unicodecdots}} + \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:NNnnn \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 \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 \g__um_sqrt_font_cmd_tl } + \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 \g__um_sqrt_font_cmd_tl / 100 + } + { \box_use:N \rootbox } + \__um_mathstyle_scale:Nnn #1 { \kern } { \fontdimen 64 \g__um_sqrt_font_cmd_tl } + \mkern \leftroot@ mu + \box_use_clear:N \l_tmpa_box + } + } 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 040e09324d3..e48961537cb 100644 --- a/Master/texmf-dist/tex/latex/unicode-math/unicode-math.sty +++ b/Master/texmf-dist/tex/latex/unicode-math/unicode-math.sty @@ -19,11 +19,13 @@ %% Copyright 2012-2015 Khaled Hosny %% ------------------------------------------------ %%^^A%% unicode-math.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Metadata for the package code, including files and versioning \ProvidesPackage{unicode-math} - [2017/11/18 v0.8i Unicode maths in XeLaTeX and LuaLaTeX] + [2018/01/07 v0.8j Unicode maths in XeLaTeX and LuaLaTeX] %%^^A%% um-code-base.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> +%%^^A%% Definition of unicode-math.sty, which splits and loads according to engine. \ifdefined\XeTeXversion \ifdim\number\XeTeXversion\XeTeXrevision in<0.9998in% @@ -47,9 +49,8 @@ \fi\fi \RequirePackage{expl3,xparse,l3keys2e} \RequirePackage{fontspec} -\RequirePackage{ucharcat} -\RequirePackage{fix-cm} % avoid some warnings (still necessary? check...) \RequirePackage{filehook} +\RequirePackage{fix-cm} \ExplSyntaxOn \sys_if_engine_luatex:T { \RequirePackageWithOptions{unicode-math-luatex} } \sys_if_engine_xetex:T { \RequirePackageWithOptions{unicode-math-xetex} } |