Skip to content

Commit

Permalink
fix for #251
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankMittelbach committed Jan 20, 2020
1 parent a6e85f0 commit e83c770
Show file tree
Hide file tree
Showing 11 changed files with 322 additions and 9 deletions.
8 changes: 8 additions & 0 deletions base/changes.txt
Expand Up @@ -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@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@latex-project.org>

* ltfssini.dtx (section{Custom series settings for main document families}):
Expand Down
7 changes: 7 additions & 0 deletions base/doc/ltnews31.tex
Expand Up @@ -519,6 +519,13 @@ \subsection{Ensure that \cs{\textbackslash} remains robust}
%
\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}

Expand Down
10 changes: 8 additions & 2 deletions base/ltfssdcl.dtx
Expand Up @@ -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}
Expand Down Expand Up @@ -1547,9 +1547,15 @@
%<latexrelease>\IncludeInRelease{2019/10/01}%
%<latexrelease> {\set@mathdelimiter}{make delimiters robust}%
\def\set@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@edef}.
% \changes{v3.0t}{2020/01/20}{fix for gh/251}
% \begin{macrocode}
\protected
\xdef#3{\delimiter"\mathchar@type#4\hexnumber@#1#5%
\hexnumber@#2#6 }%
\MakeRobust#3%
% \MakeRobust#3%
}
\@onlypreamble\set@mathdelimiter
%</2ekernel|latexrelease>
Expand Down
14 changes: 11 additions & 3 deletions base/ltoutenc.dtx
Expand Up @@ -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}
Expand Down Expand Up @@ -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@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}
Expand Down
87 changes: 87 additions & 0 deletions 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}
23 changes: 23 additions & 0 deletions 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@edef\Y{\X}
\makeatother

\setbox0\hbox{
$\X$ % => no error
$\Y$ % => ! Missing delimiter (. inserted).
}


{\showoutput \showbox0}

\END

87 changes: 87 additions & 0 deletions 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}
87 changes: 87 additions & 0 deletions 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}
4 changes: 2 additions & 2 deletions required/tools/testfiles/tlb2968.luatex.tlg
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion required/tools/testfiles/tlb2968.tlg
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion required/tools/testfiles/tlb2968.xetex.tlg
Expand Up @@ -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
Expand Down

0 comments on commit e83c770

Please sign in to comment.