[latex3-commits] [git/LaTeX3-latex3-latex2e] gh643: guard spacefactor setting from math mode issue #643 (0ec963b8)

David Carlisle d.p.carlisle at gmail.com
Sat Oct 16 17:25:56 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : gh643
Link       : https://github.com/latex3/latex2e/commit/0ec963b8bbffd95e6f7b2c5ff1f981287753f44a

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

commit 0ec963b8bbffd95e6f7b2c5ff1f981287753f44a
Author: David Carlisle <d.p.carlisle at gmail.com>
Date:   Sat Oct 16 16:25:56 2021 +0100

    guard spacefactor setting from math mode issue #643


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

0ec963b8bbffd95e6f7b2c5ff1f981287753f44a
 base/changes.txt               |  5 +++++
 base/ltoutenc.dtx              |  5 +++--
 base/testfiles/github-0643.lvt | 19 +++++++++++++++++++
 base/testfiles/github-0643.tlg | 18 ++++++++++++++++++
 4 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index c58b70a6..ffe95f87 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -5,6 +5,11 @@ It is provided for convenience only.  It therefore makes no claims to
 completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
+
+2021-10-16  David Carlisle  <David.Carlisle at latex-project.org>
+
+	* ltoutenc.dtx: guard spacefactor setting in accents gh/643
+
 2021-10-15  Marcel Krüger  <Marcel.Krueger at latex-project.org>
 
 	* ltluatex.dtx:
diff --git a/base/ltoutenc.dtx b/base/ltoutenc.dtx
index 68782d69..61ea3818 100644
--- a/base/ltoutenc.dtx
+++ b/base/ltoutenc.dtx
@@ -44,7 +44,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltoutenc.dtx}
-             [2021/10/13 v2.0w LaTeX Kernel (font encodings)]
+             [2021/10/16 v2.0x LaTeX Kernel (font encodings)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltoutenc.dtx}
@@ -845,10 +845,11 @@
 %    We also ignore \cs{ignorespaces} which has the same issue and may
 %    show up as part of \cs{normalfont} if that is used.
 % \changes{v2.0m}{2019/12/18}{Avoid code that breaks \cs{accent}}
+% \changes{v2.0x}{2021/10/16}{Dont set \cs{spacefactor in math mode gh/643}}
 %    \begin{macrocode}
    \let\maybe at load@fontshape\relax
    \let\ignorespaces\relax
-   \accent#1 #2\egroup\spacefactor\accent at spacefactor}
+   \accent#1 #2\egroup\ifmmode\else\spacefactor\accent at spacefactor\fi}
 %    \end{macrocode}
 %
 %
diff --git a/base/testfiles/github-0643.lvt b/base/testfiles/github-0643.lvt
new file mode 100644
index 00000000..fc12202d
--- /dev/null
+++ b/base/testfiles/github-0643.lvt
@@ -0,0 +1,19 @@
+\documentclass{article}
+\input{test2e}
+\tracinglostchars=3
+
+\begin{document}
+
+% should not get spacefactor error
+\START
+x  \'{a} y
+
+\[
+x  \'{a} y
+\textellipsis
+\]
+
+
+$a \small b$
+
+\end{document}
\ No newline at end of file
diff --git a/base/testfiles/github-0643.tlg b/base/testfiles/github-0643.tlg
new file mode 100644
index 00000000..a5547e15
--- /dev/null
+++ b/base/testfiles/github-0643.tlg
@@ -0,0 +1,18 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+LaTeX Font Info:    External font `cmex10' loaded for size
+(Font)              <7> on input line ....
+LaTeX Font Info:    External font `cmex10' loaded for size
+(Font)              <5> on input line ....
+LaTeX Warning: Command \' invalid in math mode on input line ....
+! Please use \mathaccent for accents in math mode.
+\add at accent ... \let \ignorespaces \relax \accent 
+                                                  #1 #2\egroup \ifmmode \els...
+l. ...x  \'{a}
+              y
+I'm changing \accent to \mathaccent here; wish me luck.
+(Accents are not the same in formulas as they are in text.)
+LaTeX Warning: Command \textellipsis invalid in math mode on input line ...
+LaTeX Font Warning: Command \small invalid in math mode on input line ....
+[1
+] (github-0643.aux)





More information about the latex3-commits mailing list.