[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: fix for #251 (e83c770f)

Frank Mittelbach frank.mittelbach at latex-project.org
Mon Jan 20 18:35:37 CET 2020


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/e83c770fab48998cd5532a96ae4e324f31c79fbf

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

commit e83c770fab48998cd5532a96ae4e324f31c79fbf
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Mon Jan 20 18:35:37 2020 +0100

    fix for #251


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

e83c770fab48998cd5532a96ae4e324f31c79fbf
 base/changes.txt                            |  8 +++
 base/doc/ltnews31.tex                       |  7 +++
 base/ltfssdcl.dtx                           | 10 +++-
 base/ltoutenc.dtx                           | 14 ++++-
 base/testfiles/github-0251.luatex.tlg       | 87 +++++++++++++++++++++++++++++
 base/testfiles/github-0251.lvt              | 23 ++++++++
 base/testfiles/github-0251.tlg              | 87 +++++++++++++++++++++++++++++
 base/testfiles/github-0251.xetex.tlg        | 87 +++++++++++++++++++++++++++++
 required/tools/testfiles/tlb2968.luatex.tlg |  4 +-
 required/tools/testfiles/tlb2968.tlg        |  2 +-
 required/tools/testfiles/tlb2968.xetex.tlg  |  2 +-
 11 files changed, 322 insertions(+), 9 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 686a62b4..d9c5101c 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -4,6 +4,14 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 =======================================================================
 
+2020-01-20  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* ltfssdcl.dtx (section{Interface Commands}):
+	\DeclareMathDelimiter needs to use \protected for robustness (gh/251)
+
+	* ltoutenc.dtx (subsubsection{Math material}):
+	\{ and \} need to use \protected for robustness (gh/251)
+
 2020-01-12  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* ltfssini.dtx (section{Custom series settings for main document families}):
diff --git a/base/doc/ltnews31.tex b/base/doc/ltnews31.tex
index e0489652..80411c5f 100644
--- a/base/doc/ltnews31.tex
+++ b/base/doc/ltnews31.tex
@@ -519,6 +519,13 @@ typesetting was used.
 %
 \githubissue{203}
 
+\subsection{Make math delimiters robust in a different way}
+
+Making math delimiters robust caused an issue in some situations. This
+has been corrected.
+%
+\githubissue{251}
+
 
 \subsection{Allow more write streams with \texttt{filecontents} in \LuaTeX}
 
diff --git a/base/ltfssdcl.dtx b/base/ltfssdcl.dtx
index 1c546e92..80181079 100644
--- a/base/ltfssdcl.dtx
+++ b/base/ltfssdcl.dtx
@@ -36,7 +36,7 @@
 %
 %
 \ProvidesFile{ltfssdcl.dtx}
-            [2019/08/27 v3.0s LaTeX Kernel (NFSS Declarative Interface)]
+            [2020/01/20 v3.0t LaTeX Kernel (NFSS Declarative Interface)]
 % \iffalse
 \documentclass{ltxdoc}
 \begin{document}
@@ -1547,9 +1547,15 @@
 %<latexrelease>\IncludeInRelease{2019/10/01}%
 %<latexrelease>                 {\set at mathdelimiter}{make delimiters robust}%
 \def\set at mathdelimiter#1#2#3#4#5#6{%
+%    \end{macrocode}
+%    We use \cs{protected} not \cs{MakeRobust} so that
+%    \verb=\bigl\lfoor= etc.\ works inside \cs{protected at edef}.
+% \changes{v3.0t}{2020/01/20}{fix for gh/251}
+%    \begin{macrocode}
+  \protected
   \xdef#3{\delimiter"\mathchar at type#4\hexnumber@#1#5%
     \hexnumber@#2#6 }%
-  \MakeRobust#3%
+%  \MakeRobust#3%
 }
 \@onlypreamble\set at mathdelimiter
 %</2ekernel|latexrelease>
diff --git a/base/ltoutenc.dtx b/base/ltoutenc.dtx
index fb437d4a..2cfb9411 100644
--- a/base/ltoutenc.dtx
+++ b/base/ltoutenc.dtx
@@ -44,7 +44,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltoutenc.dtx}
-             [2019/12/18 v2.0m LaTeX Kernel (font encodings)]
+             [2020/01/20 v2.0n LaTeX Kernel (font encodings)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltoutenc.dtx}
@@ -1512,8 +1512,16 @@
 %    Some commands can be used in both text and math mode:
 %    \begin{macrocode}
 \DeclareRobustCommand{\$}{\ifmmode\mathdollar\else\textdollar\fi}
-\DeclareRobustCommand{\{}{\ifmmode\lbrace\else\textbraceleft\fi}
-\DeclareRobustCommand{\}}{\ifmmode\rbrace\else\textbraceright\fi}
+%    \end{macrocode}
+%    We use \cs{protected} not \cs{DeclareRobustCommand} so that
+%    \verb=\bigl\{= etc.\ works inside \cs{protected at edef}.
+% \changes{v2.0n}{2020/01/20}{fix for gh/251}
+%    \begin{macrocode}
+\protected\def\{{\ifmmode\lbrace\else\textbraceleft\fi}
+\protected\def\}{\ifmmode\rbrace\else\textbraceright\fi}
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
 \DeclareRobustCommand{\P}{\ifmmode\mathparagraph\else\textparagraph\fi}
 \DeclareRobustCommand{\S}{\ifmmode\mathsection\else\textsection\fi}
 \DeclareRobustCommand{\dag}{\ifmmode{\dagger}\else\textdagger\fi}
diff --git a/base/testfiles/github-0251.luatex.tlg b/base/testfiles/github-0251.luatex.tlg
new file mode 100644
index 00000000..9dbc65aa
--- /dev/null
+++ b/base/testfiles/github-0251.luatex.tlg
@@ -0,0 +1,87 @@
+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 ....
+> \box...=
+\hbox(14.5001+9.50012)x75.82195, direction TLT
+.\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111
+.\mathon
+.\hbox(8.50005+3.50006)x5.83336, direction TLT
+..\mathon
+..\hbox(8.50005+3.50006)x5.83336, direction TLT
+...\hbox(0.39998+11.60013)x5.83336, shifted -8.10007, direction TLT
+....\OMX/cmex/m/n/5 ^^H
+...\vbox(8.5+0.0)x0.0, direction TLT
+...\hbox(0.0+0.0)x0.0, shifted -2.5, direction TLT
+..\mathoff
+.\OML/cmm/m/it/10 a
+.\hbox(8.50005+3.50006)x5.83336, direction TLT
+..\mathon
+..\hbox(8.50005+3.50006)x5.83336, direction TLT
+...\hbox(0.39998+11.60013)x5.83336, shifted -8.10007, direction TLT
+....\OMX/cmex/m/n/5 ^^I
+...\vbox(8.5+0.0)x0.0, direction TLT
+...\hbox(0.0+0.0)x0.0, shifted -2.5, direction TLT
+..\mathoff
+.\hbox(14.5001+9.50012)x5.83336, direction TLT
+..\mathon
+..\hbox(14.5001+9.50012)x5.83336, direction TLT
+...\hbox(0.39998+23.60025)x5.83336, shifted -14.10013, direction TLT
+....\OMX/cmex/m/n/5 ^^V
+...\vbox(14.5+0.0)x0.0, direction TLT
+...\hbox(0.0+0.0)x0.0, shifted -2.5, direction TLT
+..\mathoff
+.\OML/cmm/m/it/10 b
+.\hbox(14.5001+9.50012)x5.83336, direction TLT
+..\mathon
+..\hbox(14.5001+9.50012)x5.83336, direction TLT
+...\hbox(0.39998+23.60025)x5.83336, shifted -14.10013, direction TLT
+....\OMX/cmex/m/n/5 ^^W
+...\vbox(14.5+0.0)x0.0, direction TLT
+...\hbox(0.0+0.0)x0.0, shifted -2.5, direction TLT
+..\mathoff
+.\mathoff
+.\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111
+.\mathon
+.\hbox(8.50005+3.50006)x5.83336, direction TLT
+..\mathon
+..\hbox(8.50005+3.50006)x5.83336, direction TLT
+...\hbox(0.39998+11.60013)x5.83336, shifted -8.10007, direction TLT
+....\OMX/cmex/m/n/5 ^^H
+...\vbox(8.5+0.0)x0.0, direction TLT
+...\hbox(0.0+0.0)x0.0, shifted -2.5, direction TLT
+..\mathoff
+.\OML/cmm/m/it/10 a
+.\hbox(8.50005+3.50006)x5.83336, direction TLT
+..\mathon
+..\hbox(8.50005+3.50006)x5.83336, direction TLT
+...\hbox(0.39998+11.60013)x5.83336, shifted -8.10007, direction TLT
+....\OMX/cmex/m/n/5 ^^I
+...\vbox(8.5+0.0)x0.0, direction TLT
+...\hbox(0.0+0.0)x0.0, shifted -2.5, direction TLT
+..\mathoff
+.\hbox(14.5001+9.50012)x5.83336, direction TLT
+..\mathon
+..\hbox(14.5001+9.50012)x5.83336, direction TLT
+...\hbox(0.39998+23.60025)x5.83336, shifted -14.10013, direction TLT
+....\OMX/cmex/m/n/5 ^^V
+...\vbox(14.5+0.0)x0.0, direction TLT
+...\hbox(0.0+0.0)x0.0, shifted -2.5, direction TLT
+..\mathoff
+.\OML/cmm/m/it/10 b
+.\hbox(14.5001+9.50012)x5.83336, direction TLT
+..\mathon
+..\hbox(14.5001+9.50012)x5.83336, direction TLT
+...\hbox(0.39998+23.60025)x5.83336, shifted -14.10013, direction TLT
+....\OMX/cmex/m/n/5 ^^W
+...\vbox(14.5+0.0)x0.0, direction TLT
+...\hbox(0.0+0.0)x0.0, shifted -2.5, direction TLT
+..\mathoff
+.\mathoff
+.\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111
+! OK.
+<to be read again> 
+}
+l. ...{\showoutput \showbox0}
diff --git a/base/testfiles/github-0251.lvt b/base/testfiles/github-0251.lvt
new file mode 100644
index 00000000..f16a0aee
--- /dev/null
+++ b/base/testfiles/github-0251.lvt
@@ -0,0 +1,23 @@
+\documentclass{article}
+
+\input{test2e}
+
+\begin{document}
+
+\START
+
+\makeatletter
+\def\X{\bigl\{ a \bigr\} \biggl\lfloor b \biggr\rfloor}
+\protected at edef\Y{\X}
+\makeatother
+
+\setbox0\hbox{
+$\X$ % => no error
+$\Y$ % => ! Missing delimiter (. inserted).
+}
+
+
+{\showoutput \showbox0}
+
+\END
+
diff --git a/base/testfiles/github-0251.tlg b/base/testfiles/github-0251.tlg
new file mode 100644
index 00000000..24feede5
--- /dev/null
+++ b/base/testfiles/github-0251.tlg
@@ -0,0 +1,87 @@
+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 ....
+> \box...=
+\hbox(14.5001+9.50012)x75.82195
+.\glue 3.33333 plus 1.66666 minus 1.11111
+.\mathon
+.\hbox(8.50005+3.50006)x5.83336
+..\mathon
+..\hbox(8.50005+3.50006)x5.83336
+...\hbox(0.39998+11.60013)x5.83336, shifted -8.10007
+....\OMX/cmex/m/n/5 ^^H
+...\vbox(8.5+0.0)x0.0
+...\hbox(0.0+0.0)x0.0, shifted -2.5
+..\mathoff
+.\OML/cmm/m/it/10 a
+.\hbox(8.50005+3.50006)x5.83336
+..\mathon
+..\hbox(8.50005+3.50006)x5.83336
+...\hbox(0.39998+11.60013)x5.83336, shifted -8.10007
+....\OMX/cmex/m/n/5 ^^I
+...\vbox(8.5+0.0)x0.0
+...\hbox(0.0+0.0)x0.0, shifted -2.5
+..\mathoff
+.\hbox(14.5001+9.50012)x5.83336
+..\mathon
+..\hbox(14.5001+9.50012)x5.83336
+...\hbox(0.39998+23.60025)x5.83336, shifted -14.10013
+....\OMX/cmex/m/n/5 ^^V
+...\vbox(14.5+0.0)x0.0
+...\hbox(0.0+0.0)x0.0, shifted -2.5
+..\mathoff
+.\OML/cmm/m/it/10 b
+.\hbox(14.5001+9.50012)x5.83336
+..\mathon
+..\hbox(14.5001+9.50012)x5.83336
+...\hbox(0.39998+23.60025)x5.83336, shifted -14.10013
+....\OMX/cmex/m/n/5 ^^W
+...\vbox(14.5+0.0)x0.0
+...\hbox(0.0+0.0)x0.0, shifted -2.5
+..\mathoff
+.\mathoff
+.\glue 3.33333 plus 1.66666 minus 1.11111
+.\mathon
+.\hbox(8.50005+3.50006)x5.83336
+..\mathon
+..\hbox(8.50005+3.50006)x5.83336
+...\hbox(0.39998+11.60013)x5.83336, shifted -8.10007
+....\OMX/cmex/m/n/5 ^^H
+...\vbox(8.5+0.0)x0.0
+...\hbox(0.0+0.0)x0.0, shifted -2.5
+..\mathoff
+.\OML/cmm/m/it/10 a
+.\hbox(8.50005+3.50006)x5.83336
+..\mathon
+..\hbox(8.50005+3.50006)x5.83336
+...\hbox(0.39998+11.60013)x5.83336, shifted -8.10007
+....\OMX/cmex/m/n/5 ^^I
+...\vbox(8.5+0.0)x0.0
+...\hbox(0.0+0.0)x0.0, shifted -2.5
+..\mathoff
+.\hbox(14.5001+9.50012)x5.83336
+..\mathon
+..\hbox(14.5001+9.50012)x5.83336
+...\hbox(0.39998+23.60025)x5.83336, shifted -14.10013
+....\OMX/cmex/m/n/5 ^^V
+...\vbox(14.5+0.0)x0.0
+...\hbox(0.0+0.0)x0.0, shifted -2.5
+..\mathoff
+.\OML/cmm/m/it/10 b
+.\hbox(14.5001+9.50012)x5.83336
+..\mathon
+..\hbox(14.5001+9.50012)x5.83336
+...\hbox(0.39998+23.60025)x5.83336, shifted -14.10013
+....\OMX/cmex/m/n/5 ^^W
+...\vbox(14.5+0.0)x0.0
+...\hbox(0.0+0.0)x0.0, shifted -2.5
+..\mathoff
+.\mathoff
+.\glue 3.33333 plus 1.66666 minus 1.11111
+! OK.
+<to be read again> 
+                   }
+l. ...{\showoutput \showbox0}
diff --git a/base/testfiles/github-0251.xetex.tlg b/base/testfiles/github-0251.xetex.tlg
new file mode 100644
index 00000000..24feede5
--- /dev/null
+++ b/base/testfiles/github-0251.xetex.tlg
@@ -0,0 +1,87 @@
+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 ....
+> \box...=
+\hbox(14.5001+9.50012)x75.82195
+.\glue 3.33333 plus 1.66666 minus 1.11111
+.\mathon
+.\hbox(8.50005+3.50006)x5.83336
+..\mathon
+..\hbox(8.50005+3.50006)x5.83336
+...\hbox(0.39998+11.60013)x5.83336, shifted -8.10007
+....\OMX/cmex/m/n/5 ^^H
+...\vbox(8.5+0.0)x0.0
+...\hbox(0.0+0.0)x0.0, shifted -2.5
+..\mathoff
+.\OML/cmm/m/it/10 a
+.\hbox(8.50005+3.50006)x5.83336
+..\mathon
+..\hbox(8.50005+3.50006)x5.83336
+...\hbox(0.39998+11.60013)x5.83336, shifted -8.10007
+....\OMX/cmex/m/n/5 ^^I
+...\vbox(8.5+0.0)x0.0
+...\hbox(0.0+0.0)x0.0, shifted -2.5
+..\mathoff
+.\hbox(14.5001+9.50012)x5.83336
+..\mathon
+..\hbox(14.5001+9.50012)x5.83336
+...\hbox(0.39998+23.60025)x5.83336, shifted -14.10013
+....\OMX/cmex/m/n/5 ^^V
+...\vbox(14.5+0.0)x0.0
+...\hbox(0.0+0.0)x0.0, shifted -2.5
+..\mathoff
+.\OML/cmm/m/it/10 b
+.\hbox(14.5001+9.50012)x5.83336
+..\mathon
+..\hbox(14.5001+9.50012)x5.83336
+...\hbox(0.39998+23.60025)x5.83336, shifted -14.10013
+....\OMX/cmex/m/n/5 ^^W
+...\vbox(14.5+0.0)x0.0
+...\hbox(0.0+0.0)x0.0, shifted -2.5
+..\mathoff
+.\mathoff
+.\glue 3.33333 plus 1.66666 minus 1.11111
+.\mathon
+.\hbox(8.50005+3.50006)x5.83336
+..\mathon
+..\hbox(8.50005+3.50006)x5.83336
+...\hbox(0.39998+11.60013)x5.83336, shifted -8.10007
+....\OMX/cmex/m/n/5 ^^H
+...\vbox(8.5+0.0)x0.0
+...\hbox(0.0+0.0)x0.0, shifted -2.5
+..\mathoff
+.\OML/cmm/m/it/10 a
+.\hbox(8.50005+3.50006)x5.83336
+..\mathon
+..\hbox(8.50005+3.50006)x5.83336
+...\hbox(0.39998+11.60013)x5.83336, shifted -8.10007
+....\OMX/cmex/m/n/5 ^^I
+...\vbox(8.5+0.0)x0.0
+...\hbox(0.0+0.0)x0.0, shifted -2.5
+..\mathoff
+.\hbox(14.5001+9.50012)x5.83336
+..\mathon
+..\hbox(14.5001+9.50012)x5.83336
+...\hbox(0.39998+23.60025)x5.83336, shifted -14.10013
+....\OMX/cmex/m/n/5 ^^V
+...\vbox(14.5+0.0)x0.0
+...\hbox(0.0+0.0)x0.0, shifted -2.5
+..\mathoff
+.\OML/cmm/m/it/10 b
+.\hbox(14.5001+9.50012)x5.83336
+..\mathon
+..\hbox(14.5001+9.50012)x5.83336
+...\hbox(0.39998+23.60025)x5.83336, shifted -14.10013
+....\OMX/cmex/m/n/5 ^^W
+...\vbox(14.5+0.0)x0.0
+...\hbox(0.0+0.0)x0.0, shifted -2.5
+..\mathoff
+.\mathoff
+.\glue 3.33333 plus 1.66666 minus 1.11111
+! OK.
+<to be read again> 
+                   }
+l. ...{\showoutput \showbox0}
diff --git a/required/tools/testfiles/tlb2968.luatex.tlg b/required/tools/testfiles/tlb2968.luatex.tlg
index 92e8abf4..4ea0f1e9 100644
--- a/required/tools/testfiles/tlb2968.luatex.tlg
+++ b/required/tools/testfiles/tlb2968.luatex.tlg
@@ -61,8 +61,8 @@ Completed box being shipped out [1]
 .....\localleftbox=null
 .....\localrightbox=null
 ....\hbox(0.0+0.0)x15.0, direction TLT
-....\write4{\indexentry{documentclass\protect \{foils\protect \}=\verb!*+\docum
-en\ETC.}
+....\write4{\indexentry{documentclass\{foils\}=\verb!*+\documentclass\{foils\}+
+|u\ETC.}
 ....\penalty 10000
 ....\glue(\parfillskip) 0.0 plus 1.0fil
 ....\glue(\rightskip) 0.0
diff --git a/required/tools/testfiles/tlb2968.tlg b/required/tools/testfiles/tlb2968.tlg
index 1a5cf39e..8d262c76 100644
--- a/required/tools/testfiles/tlb2968.tlg
+++ b/required/tools/testfiles/tlb2968.tlg
@@ -50,7 +50,7 @@ Completed box being shipped out [1]
 ...\glue(\topskip) 10.0
 ...\hbox(0.0+0.0)x345.0, glue set 330.0fil
 ....\hbox(0.0+0.0)x15.0
-....\write4{\indexentry{documentclass\protect \{foils\protect \}=\verb!*+\documen\ETC.}
+....\write4{\indexentry{documentclass\{foils\}=\verb!*+\documentclass\{foils\}+|u\ETC.}
 ....\penalty 10000
 ....\glue(\parfillskip) 0.0 plus 1.0fil
 ....\glue(\rightskip) 0.0
diff --git a/required/tools/testfiles/tlb2968.xetex.tlg b/required/tools/testfiles/tlb2968.xetex.tlg
index eced3ac6..ca2c76be 100644
--- a/required/tools/testfiles/tlb2968.xetex.tlg
+++ b/required/tools/testfiles/tlb2968.xetex.tlg
@@ -50,7 +50,7 @@ Completed box being shipped out [1]
 ...\glue(\topskip) 10.0
 ...\hbox(0.0+0.0)x345.0, glue set 330.0fil
 ....\hbox(0.0+0.0)x15.0
-....\write4{\indexentry{documentclass\protect \{foils\protect \}=\verb!*+\documen\ETC.}
+....\write4{\indexentry{documentclass\{foils\}=\verb!*+\documentclass\{foils\}+|u\ETC.}
 ....\penalty 10000
 ....\glue(\parfillskip) 0.0 plus 1.0fil
 ....\glue(\rightskip) 0.0





More information about the latex3-commits mailing list