From 1f05122edd891a75b0c057209e9ff46a265d3119 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 31 Jul 2011 21:24:14 +0000 Subject: unicode-math (31jul11) git-svn-id: svn://tug.org/texlive/trunk@23287 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/unicode-math/Makefile | 62 ++- .../unicode-math/testfiles/F-arrow-accents.ltx | 11 + .../unicode-math/testfiles/L-sscale-dimen.ltx | 12 + .../source/latex/unicode-math/testfiles/L700a.ltx | 10 - .../source/latex/unicode-math/testfiles/L700b.ltx | 10 - .../source/latex/unicode-math/testfiles/L700c.ltx | 11 - .../source/latex/unicode-math/testfiles/L700d.ltx | 11 - .../source/latex/unicode-math/testfiles/X401a.ltx | 3 +- .../source/latex/unicode-math/testfiles/X502b.ltx | 1 + .../latex/unicode-math/testfiles/X601b.ignore.pdf | Bin 0 -> 11791 bytes .../latex/unicode-math/testfiles/X601f.ignore.pdf | Bin 0 -> 2954 bytes .../source/latex/unicode-math/testfiles/X700a.ltx | 8 - .../source/latex/unicode-math/testfiles/X700b.ltx | 8 - .../unicode-math/testfiles/umtest-suite-F.tex | 38 +- .../unicode-math/testfiles/umtest-suite-L.tex | 5 +- .../unicode-math/testfiles/umtest-suite-X.tex | 4 - .../latex/unicode-math/unicode-math-testsuite.ltx | 11 +- .../source/latex/unicode-math/unicode-math.dtx | 550 +++++++++++---------- 18 files changed, 386 insertions(+), 369 deletions(-) create mode 100644 Master/texmf-dist/source/latex/unicode-math/testfiles/F-arrow-accents.ltx create mode 100644 Master/texmf-dist/source/latex/unicode-math/testfiles/L-sscale-dimen.ltx delete mode 100644 Master/texmf-dist/source/latex/unicode-math/testfiles/L700a.ltx delete mode 100644 Master/texmf-dist/source/latex/unicode-math/testfiles/L700b.ltx delete mode 100644 Master/texmf-dist/source/latex/unicode-math/testfiles/L700c.ltx delete mode 100644 Master/texmf-dist/source/latex/unicode-math/testfiles/L700d.ltx create mode 100644 Master/texmf-dist/source/latex/unicode-math/testfiles/X601b.ignore.pdf create mode 100644 Master/texmf-dist/source/latex/unicode-math/testfiles/X601f.ignore.pdf delete mode 100644 Master/texmf-dist/source/latex/unicode-math/testfiles/X700a.ltx delete mode 100644 Master/texmf-dist/source/latex/unicode-math/testfiles/X700b.ltx (limited to 'Master/texmf-dist/source/latex') diff --git a/Master/texmf-dist/source/latex/unicode-math/Makefile b/Master/texmf-dist/source/latex/unicode-math/Makefile index c8c6e60b096..b75e1574945 100644 --- a/Master/texmf-dist/source/latex/unicode-math/Makefile +++ b/Master/texmf-dist/source/latex/unicode-math/Makefile @@ -50,13 +50,15 @@ SUITE = $(PKG)-testsuite XMPL = unimath-example.ltx SYM = unimath-symbols -COPY = cp -a +COPY = cp -a +MKTEXLSR = mktexlsr testdir=testfiles builddir=build tds=$(builddir)/$(PKG).tds UPDATE = `which dtx-update` || true # TODO: generalise +SPEAKFAIL := `say 'Test failed!'` || true # Mac OS X only? # these files end up in the CTAN directory: @@ -68,12 +70,13 @@ BUILDDOC = $(addprefix $(builddir)/,$(DOC)) # -LTXSOURCE = $(PKG).sty $(TBL) +LTXSOURCE = $(PKG).sty $(PKG).lua $(TBL) # and this is how the TDS zip file is produced: INSFILES = \ $(tds)/tex/latex/$(PKG)/unicode-math.sty \ + $(tds)/tex/latex/$(PKG)/unicode-math.lua \ $(tds)/tex/latex/$(PKG)/unicode-math-table.tex OTHERFILES = \ @@ -117,6 +120,11 @@ $(builddir)/$(PKG).sty: $(builddir)/$(PKG).dtx cd $(builddir) && \ tex $(PKG).dtx > /dev/null ; +$(builddir)/$(PKG).lua: $(builddir)/$(PKG).dtx + echo "Updating $@" + cd $(builddir) && \ + tex $(PKG).dtx > /dev/null ; + $(builddir)/$(PKG).pdf: $(builddir)/$(PKG).dtx $(BUILDSOURCE) cd $(builddir) && \ xelatex $(PKG).dtx && \ @@ -144,15 +152,6 @@ $(builddir)/README: $(builddir)/README.markdown mv -f $< $@ -# Test suite PDF - -$(builddir)/$(SUITE).pdf: $(builddir)/$(SUITE).ltx $(BUILDSUITE) $(builddir)/$(testdir) - cd $(builddir) && \ - xelatex $(SUITE).ltx - - - - ##### CTAN INSTALLATION ##### TDS = $(builddir)/$(PKG).tds.zip @@ -164,13 +163,13 @@ $(TDS): $(tds)/$(PKG).tds.zip $(tds)/$(PKG).tds.zip: $(TDSFILES) cd $(tds); \ - zip -r $(PKG).tds.zip ./* -x *.DS_Store -x *.safe.pdf + zip -r $(PKG).tds.zip ./* -x *.DS_Store -x *.safe.pdf *.ignore.pdf ctan: $(BUILDCTAN) tds cd $(builddir); \ zip -r \ ../$(PKG).zip $(CTANFILES) $(PKG).tds.zip \ - -x *.DS_Store -x *.safe.pdf + -x *.DS_Store -x *.safe.pdf *.ignore.pdf $(tds)/doc/latex/$(PKG)/% \ $(tds)/tex/latex/$(PKG)/% \ @@ -189,7 +188,7 @@ TEXMFLOCAL=$(shell kpsewhich --var-value TEXMFLOCAL) install: $(INSFILES) if test -n "$(TEXMFHOME)" ; then \ echo "Installing in '$(TEXMFHOME)'."; \ - $(COPY) $(tds)/* $(TEXMFHOME); \ + $(COPY) $(tds)/* $(TEXMFHOME) && $(MKTEXLSR); \ else \ echo "Cannot locate your home texmf tree. Specify manually with\n\n make install TEXMFHOME=/path/to/texmf\n" ; \ false ; \ @@ -198,7 +197,7 @@ install: $(INSFILES) install-sys: $(INSFILES) if test -n "$(TEXMFLOCAL)" ; then \ echo "Installing in '$(TEXMFLOCAL)'."; \ - $(COPY) $(tds)/* $(TEXMFLOCAL); \ + $(COPY) $(tds)/* $(TEXMFLOCAL) && $(MKTEXLSR); \ else \ echo "Cannot locate your system-wide local texmf tree. Specify manually with\n\n make install TEXMFLOCAL=/path/to/texmf\n" ; \ false ; \ @@ -247,13 +246,11 @@ COMPARE_OPTS = -density 300x300 -metric ae -fuzz 35% # Redefine this to print output if you need: REDIRECT = > /dev/null -LTXSOURCE = $(NAME).sty +LTXSOURCE = $(NAME).sty $(NAME).lua TESTLIST = umtest-suite-X.tex umtest-suite-L.tex umtest-suite-F.tex -SUITESOURCE = \ - $(testdir)/umtest-preamble.tex \ - $(testdir)/$(TESTLIST) +SUITESOURCE = $(addprefix $(testdir)/,umtest-preamble.tex $(TESTLIST)) TESTOUT = $(wildcard $(testdir)/*.safe.pdf) BUILDTESTSRC = $(subst $(testdir)/,$(builddir)/,$(subst .safe.pdf,.ltx,$(TESTOUT))) @@ -270,19 +267,26 @@ BUILDSUITE = $(subst $(testdir)/,$(builddir)/,$(SUITESOURCE)) BUILDFILES = $(BUILDSOURCE) $(BUILDSUITE) $(BUILDTESTSRC) $(BUILDTESTTARGET) +# Test suite PDF + +$(builddir)/$(SUITE).pdf: $(builddir)/$(SUITE).ltx $(BUILDSUITE) + cd $(builddir) && \ + xelatex $(SUITE).ltx + + #### All tests #### foo: echo $(BUILDTESTTARGET) check: $(TESTLIST) - + $(TESTLIST): $(BUILDFILES) cd $(testdir) && \ - ls X*.ltx | sed -e 's/\(.*\).ltx/\\inserttest{\1}/g' > umtest-suite-X.tex && \ - ls L*.ltx | sed -e 's/\(.*\).ltx/\\inserttest{\1}/g' > umtest-suite-L.tex && \ - ls F*.ltx | sed -e 's/\(.*\).ltx/\\inserttest{\1}/g' > umtest-suite-F.tex; - + ls X*.safe.pdf | sed -e 's/\(.*\).safe.pdf/\\inserttest{\1}/g' > umtest-suite-X.tex && \ + ls L*.safe.pdf | sed -e 's/\(.*\).safe.pdf/\\inserttest{\1}/g' > umtest-suite-L.tex && \ + ls F*.safe.pdf | sed -e 's/\(.*\).safe.pdf/\\inserttest{\1}/g' > umtest-suite-F.tex; + $(builddir)/%: $(testdir)/% @mkdir -p $(builddir); \ $(COPY) $< $@ @@ -294,17 +298,17 @@ $(builddir)/%: % #### Generating new tests #### -lonelystub = $(shell cd $(testdir); ls | egrep '[XL].(.*\.ltx)|[XL].(.*\.safe\.pdf)' | cut -d . -f 1 | uniq -u ) +lonelystub = $(shell cd $(testdir); ls | egrep '[XL].(.*\.ltx)$$|[XL].(.*\.safe\.pdf)$$' | cut -d . -f 1 | uniq -u ) lonelyfile = $(addsuffix .safe.pdf,$(lonelystub)) lonelypath = $(addprefix $(testdir)/,$(lonelyfile)) lonelytest = $(addprefix $(builddir)/,$(addsuffix .pdf,$(lonelystub))) -Xlonelystub = $(shell cd $(testdir); ls | egrep -o '(F.*\.ltx)|(F.*-X\.safe\.pdf)' | sed -e s/-X.safe.pdf// -e s/.ltx// | uniq -u | uniq ) +Xlonelystub = $(shell cd $(testdir); ls | egrep -o '(F.*\.ltx)$$|(F.*-X\.safe\.pdf)$$' | sed -e s/-X.safe.pdf// -e s/.ltx// | uniq -u | uniq ) Xlonelyfile = $(addsuffix -X.safe.pdf,$(Xlonelystub)) Xlonelypath = $(addprefix $(testdir)/,$(Xlonelyfile)) Xlonelytest = $(addprefix $(builddir)/,$(addsuffix -X.pdf,$(Xlonelystub))) -Llonelystub = $(shell cd $(testdir); ls | egrep -o '(F.*\.ltx)|(F.*-L\.safe\.pdf)' | sed -e s/-L.safe.pdf// -e s/.ltx// | uniq -u | uniq ) +Llonelystub = $(shell cd $(testdir); ls | egrep -o '(F.*\.ltx)$$|(F.*-L\.safe\.pdf)$$' | sed -e s/-L.safe.pdf// -e s/.ltx// | uniq -u | uniq ) Llonelyfile = $(addsuffix -L.safe.pdf,$(Llonelystub)) Llonelypath = $(addprefix $(testdir)/,$(Llonelyfile)) Llonelytest = $(addprefix $(builddir)/,$(addsuffix -L.pdf,$(Llonelystub))) @@ -333,6 +337,7 @@ $(builddir)/F%-L.diff.pdf: $(builddir)/F%-L.pdf echo 'F$*: Test passed.' ; \ else \ echo 'F$*: Test failed.' ; \ + $(SPEAKFAIL) ; \ false ; \ fi @@ -346,6 +351,7 @@ $(builddir)/F%-X.diff.pdf: $(builddir)/F%-X.pdf echo 'F$*: Test passed.' ; \ else \ echo 'F$*: Test failed.' ; \ + $(SPEAKFAIL) ; \ false ; \ fi @@ -374,6 +380,7 @@ $(builddir)/L%.diff.pdf: $(builddir)/L%.pdf echo 'L$*: Test passed.' ; \ else \ echo 'L$*: Test failed.' ; \ + $(SPEAKFAIL) ; \ false ; \ fi @@ -387,6 +394,7 @@ $(builddir)/X%.diff.pdf: $(builddir)/X%.pdf echo 'X$*: Test passed.' ; \ else \ echo 'X$*: Test failed.' ; \ + $(SPEAKFAIL) ; \ false ; \ fi diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/F-arrow-accents.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-arrow-accents.ltx new file mode 100644 index 00000000000..cc06384349e --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/F-arrow-accents.ltx @@ -0,0 +1,11 @@ +\input{umtest-preamble} +\usepackage{unicode-math} +\begin{document} +\setmathfont{XITS Math} +\[ \vec a \quad \vec{a} \quad \vec{abc} \quad +\overrightarrow{abc} \quad \underrightarrow{abc} \] + +\setmathfont{Cambria Math} +\[ \vec a \quad \vec{a} \quad \vec{abc} \quad +\overrightarrow{abc} \quad \underrightarrow{abc} \] +\end{document} diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/L-sscale-dimen.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/L-sscale-dimen.ltx new file mode 100644 index 00000000000..1b872f322da --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/L-sscale-dimen.ltx @@ -0,0 +1,12 @@ +\input{umtest-preamble} +\usepackage{unicode-math} +\setmathfont{XITS Math} +\begin{document} +$ $ \\ +\number \fontdimen 10 \textfont 0 \\ +\number \fontdimen 11 \textfont 0 \\ +\number \fontdimen 10 \scriptfont 0 \\ +\number \fontdimen 11 \scriptfont 0 \\ +\number \fontdimen 10 \scriptscriptfont 0 \\ +\number \fontdimen 11 \scriptscriptfont 0 +\end{document} diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/L700a.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/L700a.ltx deleted file mode 100644 index 28868210678..00000000000 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/L700a.ltx +++ /dev/null @@ -1,10 +0,0 @@ -\input{umtest-preamble} -\usepackage{unicode-math} -\setmathfont{Cambria Math} -\begin{document} -\[ \vec a \quad \vec{a} \quad \vec{abc} \quad \overrightarrow{abc} \quad \underrightarrow{abc} \] -\unimathsetup{growing-accents} -\[ \vec a \quad \vec{a} \quad \vec{abc} \quad \overrightarrow{abc} \quad \underrightarrow{abc} \] -\unimathsetup{growing-accents=false} -\[ \vec a \quad \vec{a} \quad \vec{abc} \quad \overrightarrow{abc} \quad \underrightarrow{abc} \] -\end{document} diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/L700b.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/L700b.ltx deleted file mode 100644 index af89c35a6b1..00000000000 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/L700b.ltx +++ /dev/null @@ -1,10 +0,0 @@ -\input{umtest-preamble} -\usepackage{unicode-math} -\setmathfont{XITS Math} -\begin{document} -\[ \vec a \quad \vec{a} \quad \vec{abc} \quad \overrightarrow{abc} \quad \underrightarrow{abc} \] -\unimathsetup{growing-accents} -\[ \vec a \quad \vec{a} \quad \vec{abc} \quad \overrightarrow{abc} \quad \underrightarrow{abc} \] -\unimathsetup{growing-accents=false} -\[ \vec a \quad \vec{a} \quad \vec{abc} \quad \overrightarrow{abc} \quad \underrightarrow{abc} \] -\end{document} diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/L700c.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/L700c.ltx deleted file mode 100644 index af47d54e42a..00000000000 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/L700c.ltx +++ /dev/null @@ -1,11 +0,0 @@ -\input{umtest-preamble} -\let\luatexversion\relax -\newcount\luatexversion -\luatexversion=64 -\usepackage{unicode-math} -\setmathfont{Cambria Math} -\begin{document} -\[ \vec a \quad \vec{a} \quad \vec{abc} \quad \overrightarrow{abc} \quad \underrightarrow{abc} \] -\unimathsetup{growing-accents} -\[ \vec a \quad \vec{a} \quad \vec{abc} \quad \overrightarrow{abc} \quad \underrightarrow{abc} \] -\end{document} diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/L700d.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/L700d.ltx deleted file mode 100644 index 6dfae728bbc..00000000000 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/L700d.ltx +++ /dev/null @@ -1,11 +0,0 @@ -\input{umtest-preamble} -\let\luatexversion\relax -\newcount\luatexversion -\luatexversion=64 -\usepackage{unicode-math} -\setmathfont{XITS Math} -\begin{document} -\[ \vec a \quad \vec{a} \quad \vec{abc} \quad \overrightarrow{abc} \quad \underrightarrow{abc} \] -\unimathsetup{growing-accents} -\[ \vec a \quad \vec{a} \quad \vec{abc} \quad \overrightarrow{abc} \quad \underrightarrow{abc} \] -\end{document} diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/X401a.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/X401a.ltx index ae6c67abf76..301b74de02f 100644 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/X401a.ltx +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/X401a.ltx @@ -1,8 +1,9 @@ \input{umtest-preamble} \usepackage{unicode-math} +\setmathfont{XITS Math} \begin{document} -\[ x=1.23 \quad x=1,23\] + \setmathfont{Cambria Math} diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/X502b.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/X502b.ltx index ab050d52225..bcc6473e823 100644 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/X502b.ltx +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/X502b.ltx @@ -1,5 +1,6 @@ \input{umtest-preamble} \usepackage{unicode-math} +\setmathfont{XITS Math} \begin{document} Default: \[ diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/X601b.ignore.pdf b/Master/texmf-dist/source/latex/unicode-math/testfiles/X601b.ignore.pdf new file mode 100644 index 00000000000..ebb5c2dbc98 Binary files /dev/null and b/Master/texmf-dist/source/latex/unicode-math/testfiles/X601b.ignore.pdf differ diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/X601f.ignore.pdf b/Master/texmf-dist/source/latex/unicode-math/testfiles/X601f.ignore.pdf new file mode 100644 index 00000000000..d8d62dd116f Binary files /dev/null and b/Master/texmf-dist/source/latex/unicode-math/testfiles/X601f.ignore.pdf differ diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/X700a.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/X700a.ltx deleted file mode 100644 index 07da2c389bd..00000000000 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/X700a.ltx +++ /dev/null @@ -1,8 +0,0 @@ -\input{umtest-preamble} -\usepackage{unicode-math} -\setmathfont{Cambria Math} -\begin{document} -\[ \vec a \quad \vec{a} \quad \vec{abc} \quad \overrightarrow{abc} \quad \underrightarrow{abc} \] -\unimathsetup{growing-accents} -\[ \vec a \quad \vec{a} \quad \vec{abc} \quad \overrightarrow{abc} \quad \underrightarrow{abc} \] -\end{document} diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/X700b.ltx b/Master/texmf-dist/source/latex/unicode-math/testfiles/X700b.ltx deleted file mode 100644 index c87804947b0..00000000000 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/X700b.ltx +++ /dev/null @@ -1,8 +0,0 @@ -\input{umtest-preamble} -\usepackage{unicode-math} -\setmathfont{XITS Math} -\begin{document} -\[ \vec a \quad \vec{a} \quad \vec{abc} \quad \overrightarrow{abc} \quad \underrightarrow{abc} \] -\unimathsetup{growing-accents} -\[ \vec a \quad \vec{a} \quad \vec{abc} \quad \overrightarrow{abc} \quad \underrightarrow{abc} \] -\end{document} diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-F.tex b/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-F.tex index d18da7aa8e6..2a2b99cbe4c 100644 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-F.tex +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-F.tex @@ -1,12 +1,26 @@ -\inserttest{F-alph-spaces} -\inserttest{F-mathstyle-french} -\inserttest{F-mathstyle-iso} -\inserttest{F-mathstyle-literal} -\inserttest{F-mathstyle-tex} -\inserttest{F-mathstyle-upright} -\inserttest{F-primes-1} -\inserttest{F-primes-2} -\inserttest{F-primes-back} -\inserttest{F-slash-delim-2} -\inserttest{F-sqrt-n} -\inserttest{F-sqrt} +\inserttest{F-alph-spaces-L} +\inserttest{F-alph-spaces-X} +\inserttest{F-arrow-accents-L} +\inserttest{F-arrow-accents-X} +\inserttest{F-mathstyle-french-L} +\inserttest{F-mathstyle-french-X} +\inserttest{F-mathstyle-iso-L} +\inserttest{F-mathstyle-iso-X} +\inserttest{F-mathstyle-literal-L} +\inserttest{F-mathstyle-literal-X} +\inserttest{F-mathstyle-tex-L} +\inserttest{F-mathstyle-tex-X} +\inserttest{F-mathstyle-upright-L} +\inserttest{F-mathstyle-upright-X} +\inserttest{F-primes-1-L} +\inserttest{F-primes-1-X} +\inserttest{F-primes-2-L} +\inserttest{F-primes-2-X} +\inserttest{F-primes-back-L} +\inserttest{F-primes-back-X} +\inserttest{F-slash-delim-2-L} +\inserttest{F-slash-delim-2-X} +\inserttest{F-sqrt-L} +\inserttest{F-sqrt-X} +\inserttest{F-sqrt-n-L} +\inserttest{F-sqrt-n-X} diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-L.tex b/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-L.tex index 7ef82bff9b9..9783d45465d 100644 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-L.tex +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-L.tex @@ -1,3 +1,4 @@ +\inserttest{L-sscale-dimen} \inserttest{L600a} \inserttest{L600b} \inserttest{L600c} @@ -11,7 +12,3 @@ \inserttest{L604b} \inserttest{L650a} \inserttest{L650b} -\inserttest{L700a} -\inserttest{L700b} -\inserttest{L700c} -\inserttest{L700d} diff --git a/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-X.tex b/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-X.tex index e35257c0316..4bc92dec7cb 100644 --- a/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-X.tex +++ b/Master/texmf-dist/source/latex/unicode-math/testfiles/umtest-suite-X.tex @@ -113,13 +113,9 @@ \inserttest{X600d} \inserttest{X600f} \inserttest{X601a} -\inserttest{X601b} -\inserttest{X601f} \inserttest{X604a} \inserttest{X604b} \inserttest{X610f} \inserttest{X620b} \inserttest{X650a} \inserttest{X650b} -\inserttest{X700a} -\inserttest{X700b} diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-testsuite.ltx b/Master/texmf-dist/source/latex/unicode-math/unicode-math-testsuite.ltx index 4c3afd702cb..e6e0d845bd8 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math-testsuite.ltx +++ b/Master/texmf-dist/source/latex/unicode-math/unicode-math-testsuite.ltx @@ -9,13 +9,13 @@ \newcommand\inserttest[1]{% \subsection{Test #1} \begin{minipage}{0.5\textwidth} - \VerbatimInput{testfiles/#1.ltx} + \VerbatimInput{#1\prefix.ltx} \end{minipage} \hfill \begin{minipage}{8cm+4pt} \fboxsep=1pt \fboxrule=1pt - \fbox{\includegraphics[width=8cm]{testfiles/#1\prefix.safe.pdf}} + \fbox{\includegraphics[width=8cm]{../testfiles/#1\prefix.safe.pdf}} \end{minipage} } @@ -37,16 +37,15 @@ When the test suite is run, the new output is compared pixel by pixel with that \section{Test files for both engines} -\def\prefix{-L} -\input{testfiles/umtest-suite-F.tex} +\input{umtest-suite-F.tex} \def\prefix{} \section{Lua\LaTeX\ test files} -\input{testfiles/umtest-suite-L.tex} +\input{umtest-suite-L.tex} \section{\XeLaTeX\ test files} -\input{testfiles/umtest-suite-X.tex} +\input{umtest-suite-X.tex} \end{document} \ No newline at end of file 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 fdaa2e6d29a..b6121b84d02 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx @@ -6,7 +6,19 @@ \begingroup \input docstrip.tex \keepsilent -\preamble +\let\MetaPrefix\DoubleperCent +\declarepreamble\texpreamble +Copyright 2006-2011 Will Robertson +Copyright 2010-2011 Philipp Stephani + +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): . + +This work is "author-maintained" by Will Robertson. +\endpreamble +\def\MetaPrefix{--} +\declarepreamble\luapreamble Copyright 2006-2011 Will Robertson Copyright 2010-2011 Philipp Stephani @@ -18,11 +30,17 @@ This work is "author-maintained" by Will Robertson. \endpreamble \nopostamble \askforoverwritefalse +\let\MetaPrefix\DoubleperCent +\usepreamble\texpreamble \generate{\file{unicode-math.sty}{ \from{unicode-math.dtx}{preamble} \from{unicode-math.dtx}{msg} \from{unicode-math.dtx}{package,stix} }} +\def\MetaPrefix{--} +\usepreamble\luapreamble +\generate{\file{unicode-math.lua}{\from{unicode-math.dtx}{lua}}} +\let\MetaPrefix\DoubleperCent \nopreamble \def\tempa{plain} \ifx\tempa\fmtname\endgroup\expandafter\bye\fi @@ -32,7 +50,7 @@ This work is "author-maintained" by Will Robertson. % %\ProvidesPackage{unicode-math} %<*preamble> - [2011/01/29 v0.5d Unicode maths in XeLaTeX and LuaLaTeX] + [2011/07/31 v0.5e Unicode maths in XeLaTeX and LuaLaTeX] % %<*internal> \documentclass[a4paper]{ltxdoc} @@ -138,11 +156,13 @@ This work is "author-maintained" by Will Robertson. % \end{verbatim} % \end{quote} % -% Two OpenType maths fonts are included by default in \TeX\ Live 2010: -% Asana Math and XITS Math. These can be loaded directly with their filename +% Three OpenType maths fonts are included by default in \TeX\ Live 2011: +% Latin Modern Math, Asana Math, and XITS Math. +% These can be loaded directly with their filename % with both \XeLaTeX\ and \LuaLaTeX; resp., % \begin{quote} % \begin{verbatim} +% \setmathfont{lmmath-regular.otf} % \setmathfont{Asana-Math.otf} % \setmathfont{xits-math.otf} % \end{verbatim} @@ -150,6 +170,9 @@ This work is "author-maintained" by Will Robertson. % Other OpenType maths fonts may be loaded in the usual way; please see the % \pkg{fontspec} documentation for more information. % +% Once the package is loaded, traditional TFM-based fonts are not supported any more; +% you can only switch to a different OpenType math font using the \cs{setmathfont} command. +% % % \subsection{Package options} % Package options may be set when the package as loaded or at any later @@ -259,7 +282,7 @@ This work is "author-maintained" by Will Robertson. % \seclabel{range} % % There will probably be few cases where a single Unicode maths font suffices -% (simply due to glyph coverage). The upcoming \STIX\ font comes to mind as a +% (simply due to glyph coverage). The \STIX\ font comes to mind as a % possible exception. It will therefore be necessary to delegate specific % Unicode ranges of glyphs to separate fonts: % \codeline{\cmd\setmathfont|[range=|\meta{unicode range}|,|\meta{font features}|]|\marg{font name}} @@ -631,10 +654,10 @@ This work is "author-maintained" by Will Robertson. % \subsubsection{Epsilon and phi: $\epsilon$ vs.\ $\varepsilon$ and $\phi$ vs.\ $\varphi$} % \seclabel{vargreek-shape} % -% \TeX\ defines \cs{epsilon} to look like $\varepsilon$ and \cs{varepsilon} to -% look like $\epsilon$. The Unicode glyph directly after delta and before zeta -% is `epsilon' and looks like $\epsilon$; there is a subsequent variant of -% epsilon that looks like $\varepsilon$. This creates a problem. People who +% \TeX\ defines \cs{epsilon} to look like $\epsilon$ and \cs{varepsilon} to +% look like $\varepsilon$. By constrast, the Unicode glyph directly after delta and before zeta +% is `epsilon' and looks like $\varepsilon$; there is a subsequent variant of +% epsilon that looks like $\epsilon$. This creates a problem. People who % use Unicode input won't want their glyphs transforming; \TeX\ users will be % confused that what they think as `normal epsilon' is actual the `variant % epsilon'. And the same problem exists for `phi'. @@ -702,22 +725,8 @@ This work is "author-maintained" by Will Robertson. % \begin{figure}\centering % \fbox{\fontspec{Charis SIL}\Large % A -% ^^^^2070 -% ^^^^00b9 -% ^^^^00b2 -% ^^^^00b3 -% ^^^^2074 -% ^^^^2075 -% ^^^^2076 -% ^^^^2077 -% ^^^^2078 -% ^^^^2079 -% ^^^^207a -% ^^^^207b -% ^^^^207c -% ^^^^207d -% ^^^^207e -% ^^^^2071 +% ^^^^2070 ^^^^00b9 ^^^^00b2 ^^^^00b3 ^^^^2074 ^^^^2075 ^^^^2076 ^^^^2077 +% ^^^^2078 ^^^^2079 ^^^^207a ^^^^207b ^^^^207c ^^^^207d ^^^^207e ^^^^2071 % ^^^^207f % Z} % \caption{ @@ -733,34 +742,10 @@ This work is "author-maintained" by Will Robertson. % \begin{figure}\centering % \fbox{\fontspec{Charis SIL}\Large % A -% ^^^^2080 -% ^^^^2081 -% ^^^^2082 -% ^^^^2083 -% ^^^^2084 -% ^^^^2085 -% ^^^^2086 -% ^^^^2087 -% ^^^^2088 -% ^^^^2089 -% ^^^^208a -% ^^^^208b -% ^^^^208c -% ^^^^208d -% ^^^^208e -% ^^^^2090 -% ^^^^2091 -% ^^^^1d62 -% ^^^^2092 -% ^^^^1d63 -% ^^^^1d64 -% ^^^^1d65 -% ^^^^2093 -% ^^^^1d66 -% ^^^^1d67 -% ^^^^1d68 -% ^^^^1d69 -% ^^^^1d6a +% ^^^^2080 ^^^^2081 ^^^^2082 ^^^^2083 ^^^^2084 ^^^^2085 ^^^^2086 ^^^^2087 +% ^^^^2088 ^^^^2089 ^^^^208a ^^^^208b ^^^^208c ^^^^208d ^^^^208e ^^^^2090 +% ^^^^2091 ^^^^1d62 ^^^^2092 ^^^^1d63 ^^^^1d64 ^^^^1d65 ^^^^2093 ^^^^1d66 +% ^^^^1d67 ^^^^1d68 ^^^^1d69 ^^^^1d6a % Z} % \caption{ % The Unicode subscripts supported as input characters. @@ -1048,7 +1033,7 @@ This work is "author-maintained" by Will Robertson. \RequirePackage{l3keys2e} \RequirePackage{fontspec}[2010/10/25] \RequirePackage{catchfile} -\RequirePackage{trimspaces} +\RequirePackage{trimspaces}% I'd like to incorporate this into expl3... \RequirePackage{fix-cm} % avoid some warnings \RequirePackage{filehook}[2011/01/03] % \end{macrocode} @@ -1058,6 +1043,20 @@ This work is "author-maintained" by Will Robertson. \ExplSyntaxOn % \end{macrocode} % +% \paragraph{Forwards compatibility} +% \begin{macrocode} +\cs_if_exist:NF \char_set_catcode_other:N + { + \cs_set_eq:NN \c_math_toggle_token \c_math_shift_token + \cs_set_eq:NN \char_set_catcode_other:N \char_make_other:N + \cs_set_eq:NN \char_set_catcode_active:N \char_make_active:N + \cs_set_eq:NN \char_set_catcode_active:n \char_make_active:n + \cs_set_eq:NN \char_set_catcode_escape:N \char_make_escape:N + \cs_set_eq:NN \char_set_catcode_math_superscript:N + \char_make_math_superscript:N + } +% \end{macrocode} +% % \paragraph{Extra \pkg{expl3} variants} % \begin{macrocode} \cs_generate_variant:Nn \tl_put_right:Nn {cx} @@ -1073,14 +1072,17 @@ This work is "author-maintained" by Will Robertson. \cs:w #3 \exp_after:wN \cs_end: \cs:w #4 \cs_end: } +\cs_new_protected_nopar:Npn \bool_const:Nn #1 #2 { + \bool_new:N #1 + \bool_set:Nn #1 { #2 } +} % \end{macrocode} % % % \paragraph{Conditionals} % Engine capabilities: % \begin{macrocode} -\bool_new:N \c_um_have_fixed_accents_bool -\bool_set:Nn \c_um_have_fixed_accents_bool { +\bool_const:Nn \c_um_have_fixed_accents_bool { \c_luatex_is_engine_bool && \int_compare_p:n { \luatexversion > 64 } } % \end{macrocode} @@ -1170,6 +1172,9 @@ This work is "author-maintained" by Will Robertson. \um_cs_compat:n {radical} \um_cs_compat:n {mathaccent} \um_cs_compat:n {delimiter} +\luatex_if_engine:T { + \RequirePackage { lualatex-math } [ 2011/05/05 ] +} % \end{macrocode} % % \subsubsection{Function variants} @@ -1178,8 +1183,40 @@ This work is "author-maintained" by Will Robertson. \cs_generate_variant:Nn \fontspec_select:nn {x} % \end{macrocode} % +% \subsubsection{\Hologo{LuaLaTeX} module} +% +% We create a \pkg{luatexbase} module that contains Lua functions for use with \hologo{LuaLaTeX}. % \begin{macrocode} +\luatex_if_engine:T { + \RequirePackage { luatexbase } + \RequirePackage { luaotfload } [ 2010/11/26 ] + \RequireLuaModule { unicode-math } [ 2011/04/23 ] +} % +%<*lua> +local err, warn, info, log = luatexbase.provides_module({ + name = "unicode-math", + date = "2011/04/23", + version = 0.1, + description = "Unicode math typesetting for LuaLaTeX", + author = "Khaled Hosny, Will Robertson, Philipp Stephani", + licence = "LPPL v1.3+" +}) +% \end{macrocode} +% \LuaTeX\ does not provide interface to accessing +% \texttt{(Script)ScriptPercentScaleDown} math constants, so we +% emulate \XeTeX\ behaviour by setting \cs{fontdimen10} and +% \cs{fontdimen11}. +% \begin{macrocode} +local function set_sscale_dimens(fontdata) + local mc = fontdata.MathConstants + if mc then + fontdata.parameters[10] = mc.ScriptPercentScaleDown or 70 + fontdata.parameters[11] = mc.ScriptScriptPercentScaleDown or 50 + end +end +luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_dimens, "unicode_math.set_sscale_dimens") +% % \end{macrocode} % % (Error messages and warning definitions go here from the |msg| chunk @@ -2072,33 +2109,33 @@ This work is "author-maintained" by Will Robertson. } \mathopen { \tl_if_in:NnTF \l_um_radicals_tl {#2} { - \cs_gset:cpx {\cs_to_str:N #2 sign} { \um_radical:nn {#1} {#4} } + \cs_gset_protected_nopar:cpx {\cs_to_str:N #2 sign} { \um_radical:nn {#1} {#4} } \tl_set:cn {l_um_radical_\cs_to_str:N #2_tl} {\use:c{sym #1}~ #4} }{ \um_set_delcode:nnn {#1} {#4} {#4} \um_set_mathcode:nnn {#4} \mathopen {#1} - \cs_gset:Npx #2 { \um_delimiter:Nnn \mathopen {#1} {#4} } + \cs_gset_protected_nopar:Npx #2 { \um_delimiter:Nnn \mathopen {#1} {#4} } } } \mathclose { \um_set_delcode:nnn {#1} {#4} {#4} \um_set_mathcode:nnn {#4} \mathclose {#1} - \cs_gset:Npx #2 { \um_delimiter:Nnn \mathclose {#1} {#4} } + \cs_gset_protected_nopar:Npx #2 { \um_delimiter:Nnn \mathclose {#1} {#4} } } \mathaccent { - \cs_gset:Npx #2 { \um_accent:Nnn #3 {#1} {#4} } + \cs_gset_protected_nopar:Npx #2 { \um_accent:Nnn #3 {#1} {#4} } } \mathfence { \um_set_mathcode:nnn {#4} {#3} {#1} \um_set_delcode:nnn {#1} {#4} {#4} - \cs_gset:cpx {l \cs_to_str:N #2} { \um_delimiter:Nnn \mathopen {#1} {#4} } - \cs_gset:cpx {r \cs_to_str:N #2} { \um_delimiter:Nnn \mathclose {#1} {#4} } + \cs_gset_protected_nopar:cpx {l \cs_to_str:N #2} { \um_delimiter:Nnn \mathopen {#1} {#4} } + \cs_gset_protected_nopar:cpx {r \cs_to_str:N #2} { \um_delimiter:Nnn \mathclose {#1} {#4} } } \mathover { % LuaTeX only - \cs_set:Npn #2 ##1 { \mathop { \um_overbrace:nnn {#1} {#4} {##1} } \limits } + \cs_set_protected_nopar:Npn #2 ##1 { \mathop { \um_overbrace:nnn {#1} {#4} {##1} } \limits } } \mathunder { % LuaTeX only - \cs_set:Npn #2 ##1 { \mathop { \um_underbrace:nnn {#1} {#4} {##1} } \limits } + \cs_set_protected_nopar:Npn #2 ##1 { \mathop { \um_underbrace:nnn {#1} {#4} {##1} } \limits } } }{ \um_set_mathcode:nnn {#4} {#3} {#1} @@ -2144,7 +2181,7 @@ This work is "author-maintained" by Will Robertson. % \begin{macrocode} \cs_new:Npn \um_set_big_operator:nnn #1#2#3 { \group_begin: - \char_make_active:n {#3} + \char_set_catcode_active:n {#3} \char_gmake_mathactive:n {#3} \um_active_char_set:wc #3 \q_nil { \cs_to_str:N #2 _sym } \group_end: @@ -2173,16 +2210,16 @@ This work is "author-maintained" by Will Robertson. % input only. % \begin{macrocode} \cs_set:Npn \um_set_mathcode:nnnn #1#2#3#4 { - \Umathcode \intexpr_eval:n {#1} = - \mathchar@type#2 \csname sym#3\endcsname \intexpr_eval:n {#4} \scan_stop: + \Umathcode \int_eval:n {#1} = + \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#4} \scan_stop: } \cs_set:Npn \um_set_mathcode:nnn #1#2#3 { - \Umathcode \intexpr_eval:n {#1} = - \mathchar@type#2 \csname sym#3\endcsname \intexpr_eval:n {#1} \scan_stop: + \Umathcode \int_eval:n {#1} = + \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#1} \scan_stop: } \cs_set:Npn \um_set_mathchar:NNnn #1#2#3#4 { \Umathchardef #1 = - \mathchar@type#2 \csname sym#3\endcsname \intexpr_eval:n {#4} \scan_stop: + \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#4} \scan_stop: } \cs_new:Npn \um_set_delcode:nnn #1#2#3 { \Udelcode#2 = \csname sym#1\endcsname #3 @@ -2196,7 +2233,7 @@ This work is "author-maintained" by Will Robertson. \xetex_or_luatex:nnn { \cs_new:Npn \um_accent:Nnn #1#2#3 } { \Umathaccent \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop: } { - \Umathaccent \um_accent_keyword: \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop: + \Umathaccent \c_um_accent_keyword_tl \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop: } \luatex_if_engine:T { \cs_new_nopar:Npn \um_wide_top_accent:Nnn #1 #2 #3 { @@ -2206,11 +2243,9 @@ This work is "author-maintained" by Will Robertson. \cs_new_nopar:Npn \um_wide_bottom_accent:Nnn #1 #2 #3 { \Umathaccent bottom~ \mathchar@type #1 \use:c { sym #2 } #3 \scan_stop: } - \cs_new_protected_nopar:Npn \um_accent_keyword: { - \bool_if:NF \l_um_growing_accents_bool { fixed~ } - } + \tl_const:Nn \c_um_accent_keyword_tl { fixed } } { - \cs_new_nopar:Npn \um_accent_keyword: { } + \tl_const:Nn \c_um_accent_keyword_tl { } } } % \end{macrocode} @@ -2263,6 +2298,38 @@ This work is "author-maintained" by Will Robertson. % % \subsection{The main \cs{setmathfont} macro} % +% \begin{macro}{\um_saved_ltxe_glb_settings:} +% Save the original definition of \cmd{\glb@settings} in a macro. +% \begin{macrocode} +\cs_new_eq:NN \um_saved_ltxe_glb_settings: \glb@settings +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\glb@settings} +% We issue an error if the user tried to typeset math before setting a font. +% \begin{macrocode} +\CheckCommand * \glb@settings { + \expandafter\ifx\csname S@\f@size\endcsname\relax + \calculate@math@sizes + \fi + \csname S@\f@size\endcsname + \ifmath@fonts + \begingroup + \escapechar\m@ne + \csname mv@\math@version \endcsname + \globaldefs\@ne + \math@fonts + \let \glb@currsize \f@size + \endgroup + \the\every@math@size + \fi +} +\cs_set_protected_nopar:Npn \glb@settings { + \msg_error:nn { unicode-math } { no-font-selected } +} +% \end{macrocode} +% \end{macro} +% % 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. @@ -2279,6 +2346,10 @@ This work is "author-maintained" by Will Robertson. % \begin{macrocode} \let\glb@currsize\relax % \end{macrocode} +% \item Restore \LaTeXe\ kernel macro to apply settings instead of giving an error. +% \begin{macrocode} + \cs_set_eq:NN \glb@settings \um_saved_ltxe_glb_settings: +% \end{macrocode} % \item To start with, assume we're defining the font for every math symbol character. % \begin{macrocode} \bool_set_true:N \l_um_init_bool @@ -2298,6 +2369,7 @@ This work is "author-maintained" by Will Robertson. % \item Grab the current size information % (is this robust enough? Maybe it should be preceded by \cmd\normalsize). % \begin{macrocode} + \cs_if_exist:cF { S@ \f@size } { \calculate@math@sizes } \csname S@\f@size\endcsname % \end{macrocode} % \item Set the name of the math version being defined. @@ -2338,7 +2410,7 @@ This work is "author-maintained" by Will Robertson. % \end{itemize} % \begin{macrocode} \bool_if:NTF \l_um_init_bool { - \tl_set:Nn \um_symfont_tl {um_allsym} + \tl_set:Nn \um_symfont_tl {operators} \msg_trace:nnx {unicode-math} {default-math-font} {#2} \cs_set_eq:NN \_um_sym:nnn \um_process_symbol_noparse:nnn \cs_set_eq:NN \um_set_mathalphabet_char:Nnn \um_mathmap_noparse:Nnn @@ -3025,6 +3097,7 @@ This work is "author-maintained" by Will Robertson. } % \end{macrocode} % +% % \begin{macro}{\um_if_mathalph_decl:nTF} % Possible forms of input:\\ % |\mathscr|\\ @@ -3040,7 +3113,7 @@ This work is "author-maintained" by Will Robertson. % in the general case. % \begin{macrocode} \prg_new_conditional:Nnn \um_if_mathalph_decl:n {TF} { - \KV_remove_surrounding_spaces:nw {\tl_set:Nf\l_um_tmpa_tl} #1 \q_nil + \tl_set:Nx \l_um_tmpa_tl { \trim@spaces@noexp {#1} } \tl_clear:N \l_um_tmpb_tl \tl_clear:N \l_um_tmpc_tl \tl_if_in:NnT \l_um_tmpa_tl {->} { @@ -3130,7 +3203,7 @@ This work is "author-maintained" by Will Robertson. % \cmd\mathbf\ (\etc) \cmd\mathchar\ remappings. % \begin{macrocode} \if@tempswa - \clist_put_right:Nx \l_um_char_num_range_clist { \intexpr_eval:n {#1} } + \clist_put_right:Nx \l_um_char_num_range_clist { \int_eval:n {#1} } #4 \fi \fi @@ -3162,7 +3235,7 @@ This work is "author-maintained" by Will Robertson. % \end{tabular} % \begin{macrocode} \expandafter\ifx\expandafter\@marker\@tempb\relax - \intexpr_compare:nT {#4=#1} \@tempswatrue + \int_compare:nT {#4=#1} \@tempswatrue \else % \end{macrocode} % \begin{tabular}{@{}ll} @@ -3177,7 +3250,7 @@ This work is "author-maintained" by Will Robertson. % \end{tabular} % \begin{macrocode} \ifx\@empty\@tempb - \intexpr_compare:nT {#4>#1-1} \@tempswatrue + \int_compare:nT {#4>#1-1} \@tempswatrue \else % \end{macrocode} % \begin{tabular}{@{}ll} @@ -3192,7 +3265,7 @@ This work is "author-maintained" by Will Robertson. % \end{tabular} % \begin{macrocode} \ifx\@empty\@tempa - \intexpr_compare:nT {#4<#2+1} \@tempswatrue + \int_compare:nT {#4<#2+1} \@tempswatrue % \end{macrocode} % \begin{tabular}{@{}ll} % \hline @@ -3206,8 +3279,8 @@ This work is "author-maintained" by Will Robertson. % \end{tabular} % \begin{macrocode} \else - \intexpr_compare:nT {#4>#1-1} { - \intexpr_compare:nT {#4<#2+1} \@tempswatrue + \int_compare:nT {#4>#1-1} { + \int_compare:nT {#4<#2+1} \@tempswatrue } \fi \fi @@ -4541,15 +4614,15 @@ This work is "author-maintained" by Will Robertson. % back into their original meaning after the group has ended and |^|'s catcode returns to normal. % \begin{macrocode} \begingroup - \char_make_other:N \^ + \char_set_catcode_other:N \^ \cs_gset:Npn \um_cs_set_eq_active_char:Nw #1 = "#2 \q_nil { \lowercase{ \tl_rescan:nn { - \char_make_other:N \{ - \char_make_other:N \} - \char_make_other:N \& - \char_make_other:N \% - \char_make_other:N \$ + \char_set_catcode_other:N \{ + \char_set_catcode_other:N \} + \char_set_catcode_other:N \& + \char_set_catcode_other:N \% + \char_set_catcode_other:N \$ }{ \global\let#1=^^^^^#2 } @@ -4586,7 +4659,7 @@ This work is "author-maintained" by Will Robertson. \AtBeginDocument{\um_define_math_chars:} \cs_set:Nn \um_define_math_chars: { \group_begin: - \char_make_math_superscript:N \^ + \char_set_catcode_math_superscript:N \^ \cs_set:Npn \_um_sym:nnn ##1##2##3 { \bool_if:nF { \cs_if_eq_p:NN ##3 \mathaccent || \cs_if_eq_p:NN ##3 \mathopen || @@ -4596,7 +4669,7 @@ This work is "author-maintained" by Will Robertson. \um_cs_set_eq_active_char:Nw ##2 = ##1 \q_nil \ignorespaces } } - \char_make_other:N \# + \char_set_catcode_other:N \# \um_input_math_symbol_table: \group_end: } @@ -4606,8 +4679,8 @@ This work is "author-maintained" by Will Robertson. % \begin{macrocode} \group_begin: \lccode`\*=`\\ - \char_make_escape:N \| - \char_make_other:N \\ + \char_set_catcode_escape:N \| + \char_set_catcode_other:N \\ |lowercase{ |AtBeginDocument{ |let|backslash=* @@ -4889,7 +4962,7 @@ This work is "author-maintained" by Will Robertson. \AtBeginDocument{\um_define_prime_commands: \um_define_prime_chars:} \cs_set:Nn \um_define_prime_commands: { \cs_set_eq:NN \prime \um_prime_single_mchar - \cs_set_eq:NN \drime \um_prime_double_mchar + \cs_set_eq:NN \dprime \um_prime_double_mchar \cs_set_eq:NN \trprime \um_prime_triple_mchar \cs_set_eq:NN \qprime \um_prime_quad_mchar \cs_set_eq:NN \backprime \um_backprime_single_mchar @@ -4897,15 +4970,15 @@ This work is "author-maintained" by Will Robertson. \cs_set_eq:NN \backtrprime \um_backprime_triple_mchar } \group_begin: - \char_make_active:N \' - \char_make_active:N \` - \char_make_active:n {"2032} - \char_make_active:n {"2033} - \char_make_active:n {"2034} - \char_make_active:n {"2057} - \char_make_active:n {"2035} - \char_make_active:n {"2036} - \char_make_active:n {"2037} + \char_set_catcode_active:N \' + \char_set_catcode_active:N \` + \char_set_catcode_active:n {"2032} + \char_set_catcode_active:n {"2033} + \char_set_catcode_active:n {"2034} + \char_set_catcode_active:n {"2057} + \char_set_catcode_active:n {"2035} + \char_set_catcode_active:n {"2036} + \char_set_catcode_active:n {"2037} \cs_gset:Nn \um_define_prime_chars: { \cs_set_eq:NN ' \um_scan_sup_prime: \cs_set_eq:NN ^^^^2032 \um_scan_sup_prime: @@ -4934,11 +5007,11 @@ This work is "author-maintained" by Will Robertson. % \begin{macrocode} \cs_set_nopar:Npn \r@@t ##1 ##2 { \hbox_set:Nn \l_tmpa_box { - \c_math_shift_token + \c_math_toggle_token \m@th ##1 \sqrtsign { ##2 } - \c_math_shift_token + \c_math_toggle_token } \um_mathstyle_scale:Nnn ##1 { \kern } { \fontdimen 63 \l_um_font @@ -5035,7 +5108,7 @@ This work is "author-maintained" by Will Robertson. % \begin{macrocode} \cs_set:Npn \um_setup_active_superscript:nn #1#2 { \prop_gput:Nxn \g_um_supers_prop {\meaning #1} {#2} - \char_make_active:N #1 + \char_set_catcode_active:N #1 \char_gmake_mathactive:N #1 \scantokens{ \cs_gset:Npn #1 { @@ -5071,7 +5144,7 @@ This work is "author-maintained" by Will Robertson. % \begin{macrocode} \cs_set:Npn \um_setup_active_subscript:nn #1#2 { \prop_gput:Nxn \g_um_subs_prop {\meaning #1} {#2} - \char_make_active:N #1 + \char_set_catcode_active:N #1 \char_gmake_mathactive:N #1 \scantokens{ \cs_gset:Npn #1 { @@ -5186,7 +5259,7 @@ This work is "author-maintained" by Will Robertson. % % \begin{macrocode} \cs_new:Npn \um_define_active_frac:Nw #1 #2/#3 { - \char_make_active:N #1 + \char_set_catcode_active:N #1 \char_gmake_mathactive:N #1 \tl_rescan:nn { \catcode`\_=11\relax @@ -5250,6 +5323,7 @@ This work is "author-maintained" by Will Robertson. \def\lor{\vee} \def\owns{\ni} \def\gets{\leftarrow} +\def\mathring{\ocirc} % \end{macrocode} % These are somewhat odd: (and their usual Unicode uprightness does not match their amssymb glyphs) % \begin{macrocode} @@ -5391,28 +5465,6 @@ This work is "author-maintained" by Will Robertson. % \end{macro} % \end{macro} % -% \paragraph{\LaTeXe\ kernel} -% \cs{frac} can be patched for \LuaTeX, but \cs{choose}, \cs{brack} and \cs{brace} should be discouraged. -% Probably these fixes (and the analogous \pkg{amsmath} fixes below) should go into \pkg{luatextra} or a similar \LuaLaTeX\ package. -% \begin{macrocode} -\luatex_if_engine:T { - \AtBeginDocument{\um_patch_amsmath:} - \cs_set:Nn \um_patch_amsmath: { - \@ifpackageloaded { amsmath } { } { - \um_check_and_fix:NNnnn \frac \cs_set_nopar:Npn { ##1 ##2 } { - { - \begingroup ##1 \endgroup \over ##2 - } - } { - { - \luatexUstack { \group_begin: ##1 \group_end: \over ##2 } - } - } - } - } -} -% \end{macrocode} -% % \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 @@ -5438,12 +5490,14 @@ This work is "author-maintained" by Will Robertson. % 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_in:Nn \@begindocumenthook { - \mathchardef\std@minus\mathcode`\-\relax - \mathchardef\std@equal\mathcode`\=\relax + \xetex_if_engine:T { + \tl_remove_in:Nn \@begindocumenthook { + \mathchardef\std@minus\mathcode`\-\relax + \mathchardef\std@equal\mathcode`\=\relax + } + \def\std@minus{\Umathcharnum\Umathcodenum`\-\relax} + \def\std@equal{\Umathcharnum\Umathcodenum`\=\relax} } - \def\std@minus{\Umathcharnum\Umathcodenum`\-\relax} - \def\std@equal{\Umathcharnum\Umathcodenum`\=\relax} % \end{macrocode} % % \begin{macrocode} @@ -5452,83 +5506,60 @@ This work is "author-maintained" by Will Robertson. % \end{macrocode} % This isn't as clever as the \pkg{amsmath} definition but I think it works: % \begin{macrocode} - \def \resetMathstrut@ {% - \setbox\z@\hbox{$($}%) - \ht\Mathstrutbox@\ht\z@ \dp\Mathstrutbox@\dp\z@ + \xetex_if_engine:T { + \def \resetMathstrut@ {% + \setbox\z@\hbox{$($}%) + \ht\Mathstrutbox@\ht\z@ \dp\Mathstrutbox@\dp\z@ + } } % \end{macrocode} % The |subarray| environment uses inappropriate font dimensions. % \begin{macrocode} - \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 { + \xetex_if_engine:T { + \um_check_and_fix:NNnnn \subarray \cs_set:Npn { #1 } { + \vcenter + \bgroup + \Let@ + \restore@math@cr + \default@tag + \baselineskip \fontdimen 10~ \scriptfont \tw@ + \advance \baselineskip \fontdimen 12~ \scriptfont \tw@ + \lineskip \thr@@ \fontdimen 8~ \scriptfont \thr@@ + \lineskiplimit \lineskip + \ialign + \bgroup + \ifx c #1 \hfil \fi + $ \m@th \scriptstyle ## $ + \hfil + \crcr + } { + \vcenter + \c_group_begin_token + \Let@ + \restore@math@cr + \default@tag + \skip_set:Nn \baselineskip { % \end{macrocode} % Here we use stack top shift + stack bottom shift, which sounds reasonable. % \begin{macrocode} - \um_stack_num_up:N \scriptstyle - + \um_stack_denom_down:N \scriptstyle - } + \um_stack_num_up:N \scriptstyle + + \um_stack_denom_down:N \scriptstyle + } % \end{macrocode} % Here we use the minimum stack gap. % \begin{macrocode} - \lineskip \um_stack_vgap:N \scriptstyle - \lineskiplimit \lineskip - \ialign - \c_group_begin_token - \token_if_eq_meaning:NNT c #1 { \hfil } - \c_math_shift_token - \m@th - \scriptstyle - \c_parameter_token \c_parameter_token - \c_math_shift_token - \hfil - \crcr - } -% \end{macrocode} -% For \LuaTeX, \cs{frac} and \cs{genfrac} should use \cs{Ustack} for correct math style selection. -% \begin{macrocode} - \um_check_and_fix_luatex:cNnnn { frac~ } \cs_set:Npn { #1 #2 } { - { - \begingroup #1 \endgroup \@@over #2 - } - } { - { - \luatexUstack { \group_begin: #1 \group_end: \@@over #2 } - } - } - \um_check_and_fix_luatex:NNnnn \@genfrac \cs_set_nopar:Npn { - #1 #2 #3 #4 #5 - } { - { - #1 { \begingroup #4 \endgroup #2 #3 \relax #5 } - } - } { - { - #1 { - \luatexUstack { - \group_begin: #4 \group_end: #2 #3 \scan_stop: #5 - } - } + \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 } } % \end{macrocode} @@ -5552,10 +5583,10 @@ This work is "author-maintained" by Will Robertson. \luatexUroot \l_um_radical_sqrt_tl { #1 } { #2 } } { \hbox_set:Nn \rootbox { - \c_math_shift_token + \c_math_toggle_token \m@th \scriptscriptstyle { #1 } - \c_math_shift_token + \c_math_toggle_token } \mathchoice { \r@@t \displaystyle { #2 } } @@ -5579,21 +5610,21 @@ This work is "author-maintained" by Will Robertson. \boxz@ } { \hbox_set:Nn \l_tmpa_box { - \c_math_shift_token + \c_math_toggle_token \m@th #1 \mskip \uproot@ mu - \c_math_shift_token + \c_math_toggle_token } \luatexUroot \l_um_radical_sqrt_tl { \box_move_up:nn { \box_wd:N \l_tmpa_box } { \hbox:n { - \c_math_shift_token + \c_math_toggle_token \m@th \mkern -\leftroot@ mu \box_use:N \rootbox \mkern \leftroot@ mu - \c_math_shift_token + \c_math_toggle_token } } } { @@ -5601,18 +5632,18 @@ This work is "author-maintained" by Will Robertson. } } { \hbox_set:Nn \l_tmpa_box { - \c_math_shift_token + \c_math_toggle_token \m@th #1 \sqrtsign { #2 } - \c_math_shift_token + \c_math_toggle_token } \hbox_set:Nn \l_tmpb_box { - \c_math_shift_token + \c_math_toggle_token \m@th #1 \mskip \uproot@ mu - \c_math_shift_token + \c_math_toggle_token } \mkern -\leftroot@ mu \um_mathstyle_scale:Nnn #1 { \kern } { @@ -5711,62 +5742,58 @@ This work is "author-maintained" by Will Robertson. % % \begin{macrocode} \AtEndOfPackageFile * { mathtools } { - \um_check_and_fix:NNnnnn \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 + \xetex_if_engine:T { + \um_check_and_fix:NNnnn \MT_cramped_internal:Nn \cs_set_nopar:Npn { #1 #2 } { + \sbox \z@ { + $ + \m@th + #1 + \nulldelimiterspace = \z@ + \radical \z@ { #2 } + $ + } + \ifx #1 \displaystyle + \dimen@ = \fontdimen 8 \textfont 3 + \advance \dimen@ .25 \fontdimen 5 \textfont 2 \else - \ifx #1 \scriptstyle - \scriptfont + \dimen@ = 1.25 \fontdimen 8 + \ifx #1 \textstyle + \textfont \else - \scriptscriptfont + \ifx #1 \scriptstyle + \scriptfont + \else + \scriptscriptfont + \fi \fi + 3 \fi - 3 - \fi - \advance \dimen@ -\ht\z@ - \ht\z@ = -\dimen@ - \box\z@ - } { -% \end{macrocode} -% \LuaTeX\ has primitives for setting material in cramped mode (thanks to Khaled Hosny for pointing this out). -% Note we don’t use \cs{mathstyle} since we want to patch only a single command. -% \begin{macrocode} - \use:c { luatexcramped \cs_to_str:N #1 } #2 - } { + \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. % \begin{macrocode} - \hbox_set:Nn \l_tmpa_box { - \color@setgroup - \c_math_shift_token - \m@th - #1 - \dim_zero:N \nulldelimiterspace - \radical \c_zero { #2 } - \c_math_shift_token - \color@endgroup - } - \box_set_ht:Nn \l_tmpa_box { - \box_ht:N \l_tmpa_box + \hbox_set:Nn \l_tmpa_box { + \color@setgroup + \c_math_toggle_token + \m@th + #1 + \dim_zero:N \nulldelimiterspace + \radical \c_zero { #2 } + \c_math_toggle_token + \color@endgroup + } + \box_set_ht:Nn \l_tmpa_box { + \box_ht:N \l_tmpa_box % \end{macrocode} % Here we use the radical vertical gap. % \begin{macrocode} - - \um_radical_vgap:N #1 + - \um_radical_vgap:N #1 + } + \box_use_clear:N \l_tmpa_box } - \box_use_clear:N \l_tmpa_box } % \end{macrocode} % @@ -5887,6 +5914,15 @@ This work is "author-maintained" by Will Robertson. { Setup~ alphabet:~ #1. } +\msg_new:nnnn { unicode-math } { no-font-selected } { + You've~ loaded~ the~ unicode-math~ package,~ but~ you~ forgot~ to~ select \\ + a~ Unicode~ math~ font.~ Please~ select~ one~ with~ the~ \token_to_str:N \setmathfont \\ + command. +} { + Loading~ the~ unicode-math~ package~ without~ using~ a~ Unicode~ math~ font \\ + is~ not~ supported.~ Either~ select~ a~ Unicode~ math~ font,~ or~ don't~ load \\ + the~ unicode-math~ package. +} \msg_new:nnn {unicode-math} {macro-expected} { I've~ expected~ that~ #1~ is~ a~ macro,~ but~ it~ isn't. -- cgit v1.2.3