[latex3-commits] [git/LaTeX3-latex3-latex2e] gh820: first aid fix for #820 (3618447e)

Frank Mittelbach frank.mittelbach at latex-project.org
Fri Nov 4 13:08:14 CET 2022


Repository : https://github.com/latex3/latex2e
On branch  : gh820
Link       : https://github.com/latex3/latex2e/commit/3618447e11628c2d9eb1c73e400d410506c96a9a

>---------------------------------------------------------------

commit 3618447e11628c2d9eb1c73e400d410506c96a9a
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Fri Nov 4 13:08:14 2022 +0100

    first aid fix for #820


>---------------------------------------------------------------

3618447e11628c2d9eb1c73e400d410506c96a9a
 required/firstaid/changes.txt                      |   5 +
 .../latex2e-first-aid-for-external-files.dtx       |  18 ++-
 .../testfiles-TU/firstaid-unicode-math.luatex.tlg} | 171 ++++++++++-----------
 .../testfiles-TU/firstaid-unicode-math.lvt         |  24 +++
 .../testfiles-TU/firstaid-unicode-math.tlg         | 108 +++++++++++++
 5 files changed, 233 insertions(+), 93 deletions(-)

diff --git a/required/firstaid/changes.txt b/required/firstaid/changes.txt
index 3c6cb992..6376a30b 100644
--- a/required/firstaid/changes.txt
+++ b/required/firstaid/changes.txt
@@ -1,3 +1,8 @@
+2022-11-04  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* latex2e-first-aid-for-external-files.dtx (subsection{The unicode-math package first aid}):
+	A first aid for unicode-math used together with the doc package.
+
 2022-10-27	Joseph Wright <Joseph.Wright at latex-project.org>
 
 	* latex2e-first-aid-for-external-files.dtx:
diff --git a/required/firstaid/latex2e-first-aid-for-external-files.dtx b/required/firstaid/latex2e-first-aid-for-external-files.dtx
index 9bc4969b..310e5da9 100644
--- a/required/firstaid/latex2e-first-aid-for-external-files.dtx
+++ b/required/firstaid/latex2e-first-aid-for-external-files.dtx
@@ -111,8 +111,8 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\def\LaTeXFirstAidDate{2022/10/29}
-\def\LaTeXFirstAidVersion{v1.0u}
+\def\LaTeXFirstAidDate{2022/11/04}
+\def\LaTeXFirstAidVersion{v1.0v}
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -353,6 +353,20 @@
 %    \end{macrocode}
 %
 %
+% \subsection{The \pkg{unicode-math} package first aid}
+%
+%    If \pkg{unicode-math} is used together with \pkg{doc} there is a
+%    problem because it changes the mathcodes without adjusting the
+%    use in \pkg{doc} that assume standard settings. Could be fixed on
+%    either side, but as \pkg{unicode-math} is derivating from the
+%    standard, the right place is probably a fix in this package. For
+%    now we do it here. See github/820.
+%    \begin{macrocode}
+\AddToHook{package/unicode-math/after}{%
+  \AddToHook{cmd/mod at math@codes/after}{\mathcode`\|=28796 }}
+%    \end{macrocode}
+%
+%
 %
 %
 % \subsection{The \pkg{pgfpages} and \pkg{pgfmorepages} first aid}
diff --git a/required/tools/testfiles-search/tlb2149-2015.tlg b/required/firstaid/testfiles-TU/firstaid-unicode-math.luatex.tlg
similarity index 50%
copy from required/tools/testfiles-search/tlb2149-2015.tlg
copy to required/firstaid/testfiles-TU/firstaid-unicode-math.luatex.tlg
index dd5760c8..be613217 100644
--- a/required/tools/testfiles-search/tlb2149-2015.tlg
+++ b/required/firstaid/testfiles-TU/firstaid-unicode-math.luatex.tlg
@@ -1,21 +1,41 @@
-This is a generated file for the LaTeX2e validation system.
+This is a generated file for the l3build validation system.
 Don't change this file in any respect.
-(pr2149.doc)
+-> The generic hook 'package/unicode-math/after':
+> Code chunks:
+>     ---
+> Document-level (top-level) code (executed first):
+>     -> \AddToHook {cmd/mod at math@codes/after}{\mathcode `\|=28796 }
+> Extra code for next invocation:
+>     ---
+> Rules:
+>     ---
+> Execution order (after reversal):
+>     ---.
+<recently read> }
+l. ...\ShowHook{package/unicode-math/after}
+LaTeX Font Info:    Font shape `TU/latinmodern-math.otf(2)/m/n' will be
+(Font)              scaled to size 9.00096pt on input line ....
+LaTeX Font Info:    Font shape `TU/latinmodern-math.otf(2)/m/n' will be
+(Font)              scaled to size 6.00064pt on input line ....
+LaTeX Font Info:    Font shape `TU/latinmodern-math.otf(3)/m/n' will be
+(Font)              scaled to size 8.99904pt on input line ....
+LaTeX Font Info:    Font shape `TU/latinmodern-math.otf(3)/m/n' will be
+(Font)              scaled to size 5.99936pt on input line ....
 Completed box being shipped out [1]
-\vbox(620.0+0.0)x408.0
-.\hbox(0.0+0.0)x0.0
+\vbox(633.0+0.0)x407.0, direction TLT
+.\hbox(0.0+0.0)x0.0, direction TLT
 ..\special{! systemdict /pdfmark known{userdict /?pdfmark systemdict /exec get put}{userdict /?pdfmark systemdict /pop get put userdict /pdfmark systemdict /cleartomark get put}ifelse}
 ..\special{ps:SDict begin [/Producer (dvips + Distiller)/Title ()/Subject ()/Creator (LaTeX with hyperref)/Author ()/Keywords () /DOCINFO pdfmark end}
 ..\special{! /DvipsToPDF{72.27 mul Resolution div} def/PDFToDvips{72.27 div Resolution mul} def/BPToDvips{72 div Resolution mul}def product (Ghostscript) search {pop pop pop revision 927 gt}{pop false} ifelse{/BorderArrayPatch{} def}{/BorderArrayPatch{[exch{dup dup type/integertype eq exch type/realtype eq or{BPToDvips}if}forall]}def} ifelse /HyperBorder {1 PDFToDvips} def/H.V {pdf at hoff pdf at voff null} def/H.B {/Rect[pdf at llx pdf at lly pdf at urx pdf at ury]} def/H.S {currentpoint HyperBorder add /pdf at lly exch def dup DvipsToPDF 72 add /pdf at hoff exch def HyperBorder sub /pdf at llx exch def} def/H.L {2 sub dup/HyperBasePt exch def PDFToDvips /HyperBaseDvips exch def currentpoint HyperBaseDvips sub /pdf at ury exch def/pdf at urx exch def} def/H.A {H.L currentpoint exch pop vsize 72 sub exch DvipsToPDF HyperBasePt sub sub /pdf at voff exch def} def/H.R {currentpoint HyperBorder sub /pdf at ury exch def HyperBorder add /pdf at urx exch def currentpoint exch pop vsize 72 sub exch DvipsToPDF sub /pdf at voff exch def} def}
 .\special{ps:SDict begin /product where{pop product(Distiller)search{pop pop pop version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show grestore}if}{pop}ifelse}{pop}ifelse}if end}
-.\vbox(0.0+0.0)x0.0, glue set - 25.99626fil
-..\kern 0.0
-..\kern 27.0
-..\kern -1.00374
-..\hbox(0.0+0.0)x0.0, glue set - 61.99626fil
-...\kern 0.0
-...\kern 63.0
-...\kern -1.00374
+.\vbox(0.0+0.0)x0.0, glue set - 14.99626fil, direction TLT
+..\kern0.0
+..\kern16.0
+..\kern-1.00374
+..\hbox(0.0+0.0)x0.0, glue set - 60.99626fil, direction TLT
+...\kern0.0
+...\kern62.0
+...\kern-1.00374
 ...\special{color push gray 0}
 ...\special{ps:SDict begin H.S end}
 ...\special{ps:SDict begin H.R end}
@@ -25,107 +45,76 @@ Completed box being shipped out [1]
 ...\glue 0.0 plus 1.0fil minus 1.0fil
 ..\glue 0.0 plus 1.0fil minus 1.0fil
 .\glue(\lineskip) 0.0
-.\vbox(620.0+0.0)x408.0
-..\glue 27.0
-..\vbox(593.0+0.0)x345.0, shifted 63.0
-...\vbox(12.0+0.0)x345.0, glue set 12.0fil
+.\vbox(633.0+0.0)x407.0, direction TLT
+..\glue 16.0
+..\vbox(617.0+0.0)x345.0, shifted 62.0, direction TLT
+...\vbox(12.0+0.0)x345.0, glue set 12.0fil, direction TLT
 ....\glue 0.0 plus 1.0fil
-....\hbox(0.0+0.0)x345.0
+....\hbox(0.0+0.0)x345.0, direction TLT
 .....\special{color push  Black}
-.....\hbox(0.0+0.0)x345.0
+.....\hbox(0.0+0.0)x345.0, direction TLT
 .....\special{color pop}
 ...\glue 25.0
 ...\glue(\lineskip) 0.0
-...\vbox(526.0+0.0)x345.0, glue set 492.94734fil
-....\mark{{}{}}
+...\vbox(550.0+0.0)x345.0, glue set 534.94287fil, direction TLT
 ....\write-{}
-....\special{ps:SDict begin [/PageMode /UseOutlines/Page 1/View [/FitBH -135.76054] /DOCVIEW pdfmark end}
+....\special{ps:SDict begin [/PageMode /UseOutlines/Page 1/View [/FitBH 667.19638] /DOCVIEW pdfmark end}
 ....\special{ps:SDict begin [ {Catalog}<<>> /PUT pdfmark end}
 ....\special{ps:SDict begin H.S end}
 ....\special{ps:SDict begin 12 H.A end}
 ....\special{ps:SDict begin [/View [/XYZ H.V]/Dest (Doc-Start) cvn /DEST pdfmark end}
-....\glue(\topskip) 1.60004
-....\hbox(8.39996+3.60004)x345.0, glue set 326.33333fil
-.....\hbox(8.39996+3.60004)x0.0
-......\glue 0.0
-......\glue 0.0
-......\glue -5.0
-......\hbox(8.39996+3.60004)x0.0
-.......\special{color push  Black}
-.......\hbox(8.39996+3.60004)x0.0, glue set - 23.62473fil
-........\glue 0.0 plus 1.0fil minus 1.0fil
-........\hbox(0.0+0.0)x0.0
-.........\hbox(0.0+0.0)x0.0, shifted -9.22218
-........\rule(8.39996+3.60004)x0.0
-........\OT1/cmtt/m/n/9 \
-........\OT1/cmtt/m/n/9 T
-........\OT1/cmtt/m/n/9 e
-........\OT1/cmtt/m/n/9 s
-........\OT1/cmtt/m/n/9 t
-.......\special{color pop}
-......\glue 5.0
-.....\penalty 0
-.....\OT1/cmr/m/n/10 T
-.....\kern-0.83334
-.....\OT1/cmr/m/n/10 e
-.....\OT1/cmr/m/n/10 s
-.....\OT1/cmr/m/n/10 t
+....\glue(\topskip) 3.25
+....\hbox(6.75+2.25)x345.0, glue set 273.1979fil, direction TLT
+.....\glue(\leftskip) 6.67801
+.....\localpar
+......\localinterlinepenalty=0
+......\localbrokenpenalty=0
+......\localleftbox=null
+......\localrightbox=null
+.....\hbox(0.0+0.0)x0.0, direction TLT
+.....\mathon
+.....\TU/latinmodern-math.otf(1)/m/n/9 ⟨
+.....\hbox(6.75+2.25)x34.49704, direction TLT
+......\TU/lmss/m/n/9 f
+......\TU/lmss/m/n/9 i
+......\TU/lmss/m/n/9 l
+......\TU/lmss/m/n/9 e
+......\TU/lmss/m/n/9 a
+......\TU/lmss/m/n/9 |
+......\TU/lmss/m/n/9 f
+......\TU/lmss/m/n/9 i
+......\TU/lmss/m/n/9 l
+......\TU/lmss/m/n/9 e
+......\TU/lmss/m/n/9 b
+.....\TU/latinmodern-math.otf(1)/m/n/9 ⟩
+.....\mathoff
 .....\penalty 10000
-.....\glue(\parfillskip) 0.0 plus 1.0fil
-.....\glue(\rightskip) 0.0
-....\penalty 10000
-....\glue 3.0 plus 2.2 minus 1.0
-....\penalty 0
-....\glue(\parskip) 0.0
-....\glue(\parskip) 0.0
-....\glue(\baselineskip) 1.14996
-....\hbox(6.25+0.74998)x345.0, glue set 267.44524fil
-.....\glue(\leftskip) 6.68059
-.....\hbox(0.0+0.0)x0.0
-.....\OT1/cmtt/m/n/9 \
-.....\OT1/cmtt/m/n/9 l
-.....\OT1/cmtt/m/n/9 e
-.....\OT1/cmtt/m/n/9 t
-.....\OT1/cmtt/m/n/9 \
-.....\OT1/cmtt/m/n/9 T
-.....\OT1/cmtt/m/n/9 e
-.....\OT1/cmtt/m/n/9 s
-.....\OT1/cmtt/m/n/9 t
-.....\OT1/cmtt/m/n/9 \
-.....\OT1/cmtt/m/n/9 r
-.....\OT1/cmtt/m/n/9 e
-.....\OT1/cmtt/m/n/9 l
-.....\OT1/cmtt/m/n/9 a
-.....\OT1/cmtt/m/n/9 x
+.....\glue(\spaceskip) 4.725
+.....\TU/lmtt/m/sl/9 t
+.....\TU/lmtt/m/sl/9 e
+.....\TU/lmtt/m/sl/9 s
+.....\TU/lmtt/m/sl/9 t
 .....\penalty 10000
 .....\glue(\parfillskip) 0.0 plus 1.0fil
 .....\glue(\rightskip) 0.0
 ....\penalty 0
 ....\penalty -51
-....\glue 3.0 plus 1.2 minus 1.0
-....\glue -3.0 plus -1.2 minus -1.0
-....\glue 3.0 plus 1.2 minus 1.0
-....\glue -3.74998 plus -1.2 minus -1.0
-....\penalty -51
-....\glue 0.74998
-....\glue 3.0 plus 1.2 minus 1.0
-....\glue -3.0 plus -1.2 minus -1.0
-....\glue 9.0 plus 3.0 minus 3.0
-....\glue -0.74998
+....\glue 5.0 plus 2.2 minus 2.0
+....\glue -2.25
 ....\glue 0.0 plus 1.0fil
 ....\glue 0.0
 ....\glue 0.0 plus 0.0001fil
-...\glue(\baselineskip) 23.55556
-...\hbox(6.44444+0.0)x345.0
+...\glue(\baselineskip) 23.34
+...\hbox(6.66+0.0)x345.0, direction TLT
 ....\special{color push  Black}
-....\hbox(6.44444+0.0)x345.0, glue set 170.0fil
+....\hbox(6.66+0.0)x345.0, glue set 170.0fil, direction TLT
 .....\glue 0.0 plus 1.0fil
-.....\OT1/cmr/m/n/10 1
+.....\TU/lmr/m/n/10 1
 .....\glue 0.0 plus 1.0fil
 ....\special{color pop}
-.\kern 0.0
-(tlb2149-2015.aux)
-Package rerunfilecheck Info: File `tlb2149-2015.out' has not changed.
+.\kern0.0
+(firstaid-unicode-math.aux)
+Package rerunfilecheck Info: File `firstaid-unicode-math.out' has not changed.
 (rerunfilecheck)             Checksum: D41D8CD98F00B204E9800998ECF8427E;0.
-Package rerunfilecheck Info: File `tlb2149-2015.hd' has not changed.
+Package rerunfilecheck Info: File `firstaid-unicode-math.hd' has not changed.
 (rerunfilecheck)             Checksum: D41D8CD98F00B204E9800998ECF8427E;0.
diff --git a/required/firstaid/testfiles-TU/firstaid-unicode-math.lvt b/required/firstaid/testfiles-TU/firstaid-unicode-math.lvt
new file mode 100644
index 00000000..6c57de10
--- /dev/null
+++ b/required/firstaid/testfiles-TU/firstaid-unicode-math.lvt
@@ -0,0 +1,24 @@
+
+\documentclass{article}
+
+\input{regression-test}
+
+
+\START
+
+\ShowHook{package/unicode-math/after}
+
+\OMIT
+\usepackage{doc}
+\usepackage{unicode-math} %  To produce a \mathcode change
+
+\showoutput
+
+\begin{document}
+
+\TIMO
+
+    \begin{macrocode}
+%<filea|fileb> test
+%    \end{macrocode}
+\end{document}
diff --git a/required/firstaid/testfiles-TU/firstaid-unicode-math.tlg b/required/firstaid/testfiles-TU/firstaid-unicode-math.tlg
new file mode 100644
index 00000000..eb65d632
--- /dev/null
+++ b/required/firstaid/testfiles-TU/firstaid-unicode-math.tlg
@@ -0,0 +1,108 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+-> The generic hook 'package/unicode-math/after':
+> Code chunks:
+>     ---
+> Document-level (top-level) code (executed first):
+>     -> \AddToHook {cmd/mod at math@codes/after}{\mathcode `\|=28796 }
+> Extra code for next invocation:
+>     ---
+> Rules:
+>     ---
+> Execution order (after reversal):
+>     ---.
+<recently read> }
+l. ...\ShowHook{package/unicode-math/after}
+LaTeX Font Info:    Font shape `TU/latinmodern-math.otf(2)/m/n' will be
+(Font)              scaled to size 9.00096pt on input line ....
+LaTeX Font Info:    Font shape `TU/latinmodern-math.otf(2)/m/n' will be
+(Font)              scaled to size 6.00064pt on input line ....
+LaTeX Font Info:    Font shape `TU/latinmodern-math.otf(2)/m/n' will be
+(Font)              scaled to size 5.00053pt on input line ....
+LaTeX Font Info:    Font shape `TU/latinmodern-math.otf(3)/m/n' will be
+(Font)              scaled to size 8.99904pt on input line ....
+LaTeX Font Info:    Font shape `TU/latinmodern-math.otf(3)/m/n' will be
+(Font)              scaled to size 5.99936pt on input line ....
+LaTeX Font Info:    Font shape `TU/latinmodern-math.otf(3)/m/n' will be
+(Font)              scaled to size 4.99947pt on input line ....
+Completed box being shipped out [1]
+\vbox(633.0+0.0)x407.0
+.\hbox(0.0+0.0)x0.0
+..\special{pdf:docinfo<</Title()/Subject()/Creator(LaTeX with hyperref)/Author()/Keywords()>>}
+.\vbox(0.0+0.0)x0.0, glue set - 14.99626fil
+..\kern 0.0
+..\kern 16.0
+..\kern -1.00374
+..\hbox(0.0+0.0)x0.0, glue set - 60.99626fil
+...\kern 0.0
+...\kern 62.0
+...\kern -1.00374
+...\special{pdf:dest (page.1) [@thispage /XYZ @xpos @ypos null]}
+...\penalty 10000
+...\glue 0.0 plus 1.0fil minus 1.0fil
+..\glue 0.0 plus 1.0fil minus 1.0fil
+.\glue(\lineskip) 0.0
+.\vbox(633.0+0.0)x407.0
+..\glue 16.0
+..\vbox(617.0+0.0)x345.0, shifted 62.0
+...\vbox(12.0+0.0)x345.0, glue set 12.0fil
+....\glue 0.0 plus 1.0fil
+....\hbox(0.0+0.0)x345.0
+.....\special{color push  Black}
+.....\hbox(0.0+0.0)x345.0
+.....\special{color pop}
+...\glue 25.0
+...\glue(\lineskip) 0.0
+...\vbox(550.0+0.0)x345.0, glue set 534.94286fil
+....\write-{}
+....\special{pdf:majorversion 1}
+....\special{pdf:minorversion 5}
+....\special{pdf:docview<</OpenAction[@page1/FitBH 667.19638]/PageMode/UseOutlines>>}
+....\special{pdf:dest (Doc-Start) [@thispage /XYZ @xpos @ypos null]}
+....\glue(\topskip) 3.25
+....\hbox(6.75+2.25)x345.0, glue set 273.19794fil
+.....\glue(\leftskip) 6.67801
+.....\hbox(0.0+0.0)x0.0
+.....\mathon
+.....\TU/latinmodern-math.otf(1)/m/n/9 glyph#2579
+.....\hbox(6.75+2.25)x34.49704
+......\TU/lmss/m/n/9 glyph#55
+......\TU/lmss/m/n/9 glyph#66
+......\TU/lmss/m/n/9 glyph#72
+......\TU/lmss/m/n/9 glyph#50
+......\TU/lmss/m/n/9 glyph#28
+......\TU/lmss/m/n/9 glyph#37
+......\TU/lmss/m/n/9 glyph#55
+......\TU/lmss/m/n/9 glyph#66
+......\TU/lmss/m/n/9 glyph#72
+......\TU/lmss/m/n/9 glyph#50
+......\TU/lmss/m/n/9 glyph#35
+.....\TU/latinmodern-math.otf(1)/m/n/9 glyph#2580
+.....\mathoff
+.....\penalty 10000
+.....\glue 4.725
+.....\TU/lmtt/m/sl/9 test
+.....\penalty 10000
+.....\glue(\parfillskip) 0.0 plus 1.0fil
+.....\glue(\rightskip) 0.0
+....\penalty 0
+....\penalty -51
+....\glue 5.0 plus 2.2 minus 2.0
+....\glue -2.25
+....\glue 0.0 plus 1.0fil
+....\glue 0.0
+....\glue 0.0 plus 0.0001fil
+...\glue(\baselineskip) 23.34
+...\hbox(6.66+0.0)x345.0
+....\special{color push  Black}
+....\hbox(6.66+0.0)x345.0, glue set 170.0fil
+.....\glue 0.0 plus 1.0fil
+.....\TU/lmr/m/n/10 1
+.....\glue 0.0 plus 1.0fil
+....\special{color pop}
+.\kern 0.0
+(firstaid-unicode-math.aux)
+Package rerunfilecheck Info: File `firstaid-unicode-math.out' has not changed.
+(rerunfilecheck)             Checksum: D41D8CD98F00B204E9800998ECF8427E;0.
+Package rerunfilecheck Info: File `firstaid-unicode-math.hd' has not changed.
+(rerunfilecheck)             Checksum: D41D8CD98F00B204E9800998ECF8427E;0.





More information about the latex3-commits mailing list.