Skip to content

Commit

Permalink
avoid infinite loop on math alphabet error #501 (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcarlisle committed Feb 15, 2021
1 parent 3fded07 commit 1a2ac41
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
5 changes: 5 additions & 0 deletions base/changes.txt
Expand Up @@ -6,6 +6,11 @@ completeness or accuracy and it contains some references to files that
are not part of the distribution.
================================================================================

2021-02-15 David Carlisle <David.Carlisle@latex-project.org>

* ltfssdcl.dtx: two additional \expandafter to avoid infinite
loop on not in math error. (gh/501)

2021-02-11 Frank Mittelbach <Frank.Mittelbach@latex-project.org>

* classes.dtx (subsubsection{Itemize}):
Expand Down
8 changes: 6 additions & 2 deletions base/ltfssdcl.dtx
Expand Up @@ -36,7 +36,7 @@
%
%
\ProvidesFile{ltfssdcl.dtx}
[2021/01/15 v3.0v LaTeX Kernel (NFSS Declarative Interface)]
[2021/02/15 v3.0w LaTeX Kernel (NFSS Declarative Interface)]
% \iffalse
\documentclass{ltxdoc}
\begin{document}
Expand Down Expand Up @@ -490,7 +490,11 @@
in version \math@version}%
\@eha
\fi
\else \expandafter\non@alpherr\fi
% \end{macrocode}
% extra \cs{expandafter} to remove the \cs{expandafter} added below
% \changes{v3.0w}{2021/02/115}{fix for (gh/501)}
% \begin{macrocode}
\else \expandafter\expandafter\expandafter\non@alpherr\fi
% \end{macrocode}
% If the legacy interface is used, e.g., \verb=$\sf -1$= the math
% alphabet \verb=#1= does not take an argument so we better do not
Expand Down
14 changes: 14 additions & 0 deletions base/testfiles/github-0501.lvt
@@ -0,0 +1,14 @@
\documentclass{article}

\input{test2e}

\begin{document}

\START

% should give a single error on \mathit
% not loop errors on \expandafter

\mathit{x}

\END
9 changes: 9 additions & 0 deletions base/testfiles/github-0501.tlg
@@ -0,0 +1,9 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
! LaTeX Error: \mathit allowed only in math mode.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l. ...\mathit{x}
You're in trouble here. Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.

0 comments on commit 1a2ac41

Please sign in to comment.