[latex3-commits] [latex3/latex2e] gh1460: change error message (2369c575)

github at latex-project.org github at latex-project.org
Wed Sep 11 15:18:39 CEST 2024


Repository : https://github.com/latex3/latex2e
On branch  : gh1460
Link       : https://github.com/latex3/latex2e/commit/2369c575e6434676f11e834bf250e9f2366dcf0e

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

commit 2369c575e6434676f11e834bf250e9f2366dcf0e
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Wed Sep 11 15:18:39 2024 +0200

    change error message


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

2369c575e6434676f11e834bf250e9f2366dcf0e
 base/changes.txt                      |  5 +++++
 base/lterror.dtx                      | 11 ++++++++++-
 base/ltspace.dtx                      |  8 ++++----
 base/testfiles/github-1460.luatex.tlg |  4 ++--
 base/testfiles/github-1460.tlg        |  4 ++--
 5 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 46cc6f9a..f4303653 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,11 @@ to completeness or accuracy and it contains some references to files that are
 not part of the distribution.
 ================================================================================
 
+2024-09-11  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* lterror.dtx (subsection{Specific errors}):
+	Add error message "Not allowed in LR mode"
+
 2024-09-10  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* ltspace.dtx (subsection{Vertical spacing}):
diff --git a/base/lterror.dtx b/base/lterror.dtx
index 99bdc79e..bc063cec 100644
--- a/base/lterror.dtx
+++ b/base/lterror.dtx
@@ -32,7 +32,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{lterror.dtx}
-             [2021/08/20 v1.2t LaTeX Kernel (errors)]
+             [2024/09/11 v1.2u LaTeX Kernel (errors)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{lterror.dtx}
@@ -766,6 +766,15 @@ Type  H <return>  for immediate help.}%
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\@LRmoderr}
+% A command is not allowed in restrict horizontal mode, i.e., in LR-mode in \LaTeX{} terminology.
+% \changes{v1.2u}{2024/09/11}{Error message added}
+%    \begin{macrocode}
+\gdef\@LRmoderr{%
+  \@latex at error{Not allowed in LR mode}\@ehb}
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\@parmoderr}
 % Occurs in a float environment or a |\marginpar| when
 % encountered in inner vertical mode.
diff --git a/base/ltspace.dtx b/base/ltspace.dtx
index 774357e4..3ed31675 100644
--- a/base/ltspace.dtx
+++ b/base/ltspace.dtx
@@ -862,7 +862,7 @@
 %  described above.
 % \changes{v1.3m}{2020/04/21}{Support calc syntax (gh/152)}
 % \changes{v1.3s}{2024/09/10}{Drop unnecessary \cs{@noitemerr} and
-%    instead generate \cs{@parmodeerr} if we are in restricted hmode (gh/1460)}
+%    instead generate \cs{@LRmoderr} if we are in restricted hmode (gh/1460)}
 %    \begin{macrocode}
 %</2ekernel>
 %<*2ekernel|latexrelease>
@@ -876,7 +876,7 @@
 %    issuing a \cs{par}.
 %    would 
 %    \begin{macrocode}
-  \ifhmode \ifinner \@parmoderr \else \par \fi \fi
+  \ifhmode \ifinner \@LRmoderr \else \par \fi \fi
 %    \end{macrocode}
 %    
 %    \begin{macrocode}
@@ -939,7 +939,7 @@
 % \changes{v1.2c}{1994/11/13}{Recorrected error message}
 % \changes{v1.1h}{2015/01/09}{Donald Arseneau's fix from PR/377703 (latexrelease)}
 % \changes{v1.3s}{2024/09/10}{Drop unnecessary \cs{@noitemerr} and
-%    instead generate \cs{@parmodeerr} if we are in restricted hmode (gh/1460)}
+%    instead generate \cs{@LRmoderr} if we are in restricted hmode (gh/1460)}
 %    \begin{macrocode}
 %</2ekernel>
 %<latexrelease>\IncludeInRelease{2024/11/01}%
@@ -952,7 +952,7 @@
 %    See documentation of \cs{addvspace} for documentation of the next
 %    line of code.
 %    \begin{macrocode}
-  \ifhmode \ifinner \@parmoderr \else \par \fi \fi
+  \ifhmode \ifinner \@LRmoderr \else \par \fi \fi
 %    \end{macrocode}
 %   Fix provided by Donald (though the original fix was not good
 %   enough).  In 2005 Plamen Tanovski discovered that this fix wasn't
diff --git a/base/testfiles/github-1460.luatex.tlg b/base/testfiles/github-1460.luatex.tlg
index eaabfe74..9f891709 100644
--- a/base/testfiles/github-1460.luatex.tlg
+++ b/base/testfiles/github-1460.luatex.tlg
@@ -4,7 +4,7 @@ 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 Error: Not in outer par mode.
+! LaTeX Error: Not allowed in LR mode.
 See the LaTeX manual or LaTeX Companion for explanation.
 Type  H <return>  for immediate help.
  ...                                              
@@ -25,7 +25,7 @@ my insertion and my current dilemma will both disappear.
 l. ...\mbox{How about\addvspace{50pt}hboxes?}
 You've closed more groups than you opened.
 Such booboos are generally harmless, so keep going.
-! LaTeX Error: Not in outer par mode.
+! LaTeX Error: Not allowed in LR mode.
 See the LaTeX manual or LaTeX Companion for explanation.
 Type  H <return>  for immediate help.
  ...                                              
diff --git a/base/testfiles/github-1460.tlg b/base/testfiles/github-1460.tlg
index dd429ad7..b53511e9 100644
--- a/base/testfiles/github-1460.tlg
+++ b/base/testfiles/github-1460.tlg
@@ -4,7 +4,7 @@ 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 Error: Not in outer par mode.
+! LaTeX Error: Not allowed in LR mode.
 See the LaTeX manual or LaTeX Companion for explanation.
 Type  H <return>  for immediate help.
  ...                                              
@@ -25,7 +25,7 @@ my insertion and my current dilemma will both disappear.
 l. ...\mbox{How about\addvspace{50pt}hboxes?}
 You've closed more groups than you opened.
 Such booboos are generally harmless, so keep going.
-! LaTeX Error: Not in outer par mode.
+! LaTeX Error: Not allowed in LR mode.
 See the LaTeX manual or LaTeX Companion for explanation.
 Type  H <return>  for immediate help.
  ...                                              





More information about the latex3-commits mailing list.