[latex3-commits] [git/LaTeX3-latex3-latex2e] gh252: implementing #252 adding a compressable space between formula and eqn number in fleqn option (d09516dd)

Frank Mittelbach frank.mittelbach at latex-project.org
Tue Feb 18 23:56:03 CET 2020


Repository : https://github.com/latex3/latex2e
On branch  : gh252
Link       : https://github.com/latex3/latex2e/commit/d09516dd20f111f1b6b928832c848d84b48202b2

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

commit d09516dd20f111f1b6b928832c848d84b48202b2
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Tue Feb 18 23:56:03 2020 +0100

    implementing #252
    adding a compressable space between formula and eqn number in fleqn option


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

d09516dd20f111f1b6b928832c848d84b48202b2
 base/changes.txt                  |   8 ++
 base/ltmath.dtx                   |  14 ++-
 base/testfiles/github-0252.lvt    |  24 ++++
 base/testfiles/github-0252.tlg    | 230 ++++++++++++++++++++++++++++++++++++++
 base/testfiles/tlb0010.luatex.tlg |   3 +-
 base/testfiles/tlb0010.tlg        |   3 +-
 6 files changed, 277 insertions(+), 5 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 4a741345..757467a3 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -7,6 +7,14 @@ are not part of the distribution.
 
 2020-02-18  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
+	* ltmath.dtx (subsubsection{Flush left equations}):
+	Make \mathindent a skip register to match
+	amsmath (gh/252)
+	Separate formula and eqn number by a compressable space when
+	fleqn option is in force.
+
+2020-02-18  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
 	* ltfssaxes.dtx:
 	When \fontseriesforce is used do not auto-update the series if the
 	family changes (gh/277)
diff --git a/base/ltmath.dtx b/base/ltmath.dtx
index 18688068..86e62e7b 100644
--- a/base/ltmath.dtx
+++ b/base/ltmath.dtx
@@ -38,7 +38,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltmath.dtx}
-              [2019/08/27 v1.2c LaTeX Kernel (Math Setup)]
+              [2020/02/18 v1.2d LaTeX Kernel (Math Setup)]
 % \iffalse
 %</driver>
 %
@@ -1009,9 +1009,11 @@
 %
 %  \begin{macro}{\mathindent}
 %    The amount of indentation of the equations is stored in a register.
+% \changes{v1.2d}{2020/02/18}{Make \cs{mathindent} a skip register to match
+%     amsmath (gh/252)}
 %    \begin{macrocode}
 %<*fleqn>
-\newdimen\mathindent
+\newskip\mathindent
 %    \end{macrocode}
 %    The setting of |\mathindent| has to be deferred until the class
 %    file has been processed, because |\leftmargini| is still 0pt
@@ -1097,7 +1099,13 @@
        \hb at xt@\linewidth\bgroup $\m at th% $
          \displaystyle
          \hskip\mathindent}%
-        {$\hfil % $
+%    \end{macrocode}
+%    Ensure that there is at least a space between formula and
+%    equation number so that they don't bump in each other.
+% \changes{v1.2d}{2020/02/18}{Separate formula and eqn number by at
+%    least a space in fleqn option}
+%    \begin{macrocode}
+        {$\hskip .3em minus.3em\hfil % $
          \displaywidth\linewidth\hbox{\@eqnnum}%
        \egroup
      \endtrivlist}
diff --git a/base/testfiles/github-0252.lvt b/base/testfiles/github-0252.lvt
new file mode 100644
index 00000000..a43d074f
--- /dev/null
+++ b/base/testfiles/github-0252.lvt
@@ -0,0 +1,24 @@
+\documentclass [fleqn]{article}
+
+\input{test2e}
+
+\setlength\textwidth{4cm}
+\setlength\parindent{0pt}
+
+\showoutput
+
+\begin{document}
+
+\START
+
+A line of text starting at left margin.
+\begin{equation} a = b \end{equation}
+
+\begin{equation} a = 1234567890123 \end{equation}
+
+
+\setlength\mathindent{\leftmargini minus \leftmargini}
+
+\begin{equation} a = 1234567890123 \end{equation}
+
+\end{document}
diff --git a/base/testfiles/github-0252.tlg b/base/testfiles/github-0252.tlg
new file mode 100644
index 00000000..be058126
--- /dev/null
+++ b/base/testfiles/github-0252.tlg
@@ -0,0 +1,230 @@
+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 ....
+Overfull \hbox (7.58614pt too wide) detected at line 17
+$ \OML/cmm/m/it/10 a \OT1/cmr/m/n/10 = 1234567890123$  []
+\hbox(7.5+2.5)x113.81102, glue set - 1.0
+.\mathon
+.\glue 25.00003
+.\OML/cmm/m/it/10 a
+.\glue(\thickmuskip) 2.77771 plus 2.77771
+.\OT1/cmr/m/n/10 =
+.\glue(\thickmuskip) 2.77771 plus 2.77771
+.\OT1/cmr/m/n/10 1
+.\OT1/cmr/m/n/10 2
+.\OT1/cmr/m/n/10 3
+.\OT1/cmr/m/n/10 4
+.\OT1/cmr/m/n/10 5
+.\OT1/cmr/m/n/10 6
+.\OT1/cmr/m/n/10 7
+.\OT1/cmr/m/n/10 8
+.\OT1/cmr/m/n/10 9
+.\OT1/cmr/m/n/10 0
+.\OT1/cmr/m/n/10 1
+.\OT1/cmr/m/n/10 2
+.\OT1/cmr/m/n/10 3
+.\mathoff
+.\glue 3.00003 minus 3.00003
+.\glue 0.0 plus 1.0fil
+.\hbox(7.5+2.5)x12.77782
+..\OT1/cmr/m/n/10 (
+..\OT1/cmr/m/n/10 2
+..\OT1/cmr/m/n/10 )
+Completed box being shipped out [1]
+\vbox(633.0+0.0)x175.81102
+.\glue 16.0
+.\vbox(617.0+0.0)x113.81102, shifted 62.0
+..\vbox(12.0+0.0)x113.81102, glue set 12.0fil
+...\glue 0.0 plus 1.0fil
+...\hbox(0.0+0.0)x113.81102
+..\glue 25.0
+..\glue(\lineskip) 0.0
+..\vbox(550.0+0.0)x113.81102, glue set 453.9515fil
+...\write-{}
+...\glue(\topskip) 3.05556
+...\hbox(6.94444+1.94444)x113.81102, glue set 0.68077
+....\hbox(0.0+0.0)x0.0
+....\OT1/cmr/m/n/10 A
+....\glue 3.33333 plus 1.66498 minus 1.11221
+....\OT1/cmr/m/n/10 l
+....\OT1/cmr/m/n/10 i
+....\OT1/cmr/m/n/10 n
+....\OT1/cmr/m/n/10 e
+....\glue 3.33333 plus 1.66666 minus 1.11111
+....\OT1/cmr/m/n/10 o
+....\OT1/cmr/m/n/10 f
+....\glue 3.33333 plus 1.66666 minus 1.11111
+....\OT1/cmr/m/n/10 t
+....\OT1/cmr/m/n/10 e
+....\OT1/cmr/m/n/10 x
+....\OT1/cmr/m/n/10 t
+....\glue 3.33333 plus 1.66666 minus 1.11111
+....\OT1/cmr/m/n/10 s
+....\OT1/cmr/m/n/10 t
+....\OT1/cmr/m/n/10 a
+....\OT1/cmr/m/n/10 r
+....\OT1/cmr/m/n/10 t
+....\OT1/cmr/m/n/10 i
+....\OT1/cmr/m/n/10 n
+....\OT1/cmr/m/n/10 g
+....\glue 3.33333 plus 1.66666 minus 1.11111
+....\OT1/cmr/m/n/10 a
+....\OT1/cmr/m/n/10 t
+....\glue(\rightskip) 0.0
+...\penalty 300
+...\glue(\baselineskip) 3.11111
+...\hbox(6.94444+1.94444)x113.81102, glue set 62.94978fil
+....\OT1/cmr/m/n/10 l
+....\OT1/cmr/m/n/10 e
+....\OT1/cmr/m/n/10 f
+....\OT1/cmr/m/n/10 t
+....\glue 3.33333 plus 1.66666 minus 1.11111
+....\OT1/cmr/m/n/10 m
+....\OT1/cmr/m/n/10 a
+....\OT1/cmr/m/n/10 r
+....\OT1/cmr/m/n/10 g
+....\OT1/cmr/m/n/10 i
+....\OT1/cmr/m/n/10 n
+....\OT1/cmr/m/n/10 .
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\penalty 10000
+...\glue 8.0 plus 3.0 minus 4.0
+...\glue(\parskip) 0.0 plus 1.0
+...\glue(\baselineskip) 2.55556
+...\hbox(7.5+2.5)x113.81102
+....\hbox(0.0+0.0)x0.0
+.....\glue 0.0
+.....\glue 0.0
+.....\glue -5.0
+.....\hbox(0.0+0.0)x0.0
+.....\glue 5.0
+....\penalty 0
+....\hbox(7.5+2.5)x113.81102, glue set 50.12238fil
+.....\mathon
+.....\glue 25.00003
+.....\OML/cmm/m/it/10 a
+.....\glue(\thickmuskip) 2.77771 plus 2.77771
+.....\OT1/cmr/m/n/10 =
+.....\glue(\thickmuskip) 2.77771 plus 2.77771
+.....\OML/cmm/m/it/10 b
+.....\mathoff
+.....\glue 3.00003 minus 3.00003
+.....\glue 0.0 plus 1.0fil
+.....\hbox(7.5+2.5)x12.77782
+......\OT1/cmr/m/n/10 (
+......\OT1/cmr/m/n/10 1
+......\OT1/cmr/m/n/10 )
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\penalty 0
+...\glue 8.0 plus 2.0 minus 4.0
+...\glue -10.5 plus -2.0 minus -4.0
+...\penalty 10000
+...\glue 2.5
+...\glue 8.0 plus 2.0 minus 4.0
+...\glue -8.0 plus -2.0 minus -4.0
+...\glue 10.0 plus 4.0 minus 5.0
+...\glue(\parskip) 0.0 plus 1.0
+...\glue(\baselineskip) 2.0
+...\hbox(7.5+2.5)x113.81102
+....\hbox(0.0+0.0)x0.0
+.....\glue 0.0
+.....\glue 0.0
+.....\glue -5.0
+.....\hbox(0.0+0.0)x0.0
+.....\glue 5.0
+....\penalty 0
+....\hbox(7.5+2.5)x113.81102, glue set - 1.0
+.....\mathon
+.....\glue 25.00003
+.....\OML/cmm/m/it/10 a
+.....\glue(\thickmuskip) 2.77771 plus 2.77771
+.....\OT1/cmr/m/n/10 =
+.....\glue(\thickmuskip) 2.77771 plus 2.77771
+.....\OT1/cmr/m/n/10 1
+.....\OT1/cmr/m/n/10 2
+.....\OT1/cmr/m/n/10 3
+.....\OT1/cmr/m/n/10 4
+.....\OT1/cmr/m/n/10 5
+.....\OT1/cmr/m/n/10 6
+.....\OT1/cmr/m/n/10 7
+.....\OT1/cmr/m/n/10 8
+.....\OT1/cmr/m/n/10 9
+.....\OT1/cmr/m/n/10 0
+.....\OT1/cmr/m/n/10 1
+.....\OT1/cmr/m/n/10 2
+.....\OT1/cmr/m/n/10 3
+.....\mathoff
+.....\glue 3.00003 minus 3.00003
+.....\glue 0.0 plus 1.0fil
+.....\hbox(7.5+2.5)x12.77782
+......\OT1/cmr/m/n/10 (
+......\OT1/cmr/m/n/10 2
+......\OT1/cmr/m/n/10 )
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\penalty 0
+...\glue 10.0 plus 3.0 minus 5.0
+...\glue -12.5 plus -3.0 minus -5.0
+...\penalty 10000
+...\glue 2.5
+...\glue 10.0 plus 3.0 minus 5.0
+...\glue(\parskip) 0.0 plus 1.0
+...\glue(\baselineskip) 2.0
+...\hbox(7.5+2.5)x113.81102
+....\hbox(0.0+0.0)x0.0
+.....\glue 0.0
+.....\glue 0.0
+.....\glue -5.0
+.....\hbox(0.0+0.0)x0.0
+.....\glue 5.0
+....\penalty 0
+....\hbox(7.5+2.5)x113.81102, glue set - 0.37808
+.....\mathon
+.....\glue 25.00003 minus 25.00003
+.....\OML/cmm/m/it/10 a
+.....\glue(\thickmuskip) 2.77771 plus 2.77771
+.....\OT1/cmr/m/n/10 =
+.....\glue(\thickmuskip) 2.77771 plus 2.77771
+.....\OT1/cmr/m/n/10 1
+.....\OT1/cmr/m/n/10 2
+.....\OT1/cmr/m/n/10 3
+.....\OT1/cmr/m/n/10 4
+.....\OT1/cmr/m/n/10 5
+.....\OT1/cmr/m/n/10 6
+.....\OT1/cmr/m/n/10 7
+.....\OT1/cmr/m/n/10 8
+.....\OT1/cmr/m/n/10 9
+.....\OT1/cmr/m/n/10 0
+.....\OT1/cmr/m/n/10 1
+.....\OT1/cmr/m/n/10 2
+.....\OT1/cmr/m/n/10 3
+.....\mathoff
+.....\glue 3.00003 minus 3.00003
+.....\glue 0.0 plus 1.0fil
+.....\hbox(7.5+2.5)x12.77782
+......\OT1/cmr/m/n/10 (
+......\OT1/cmr/m/n/10 3
+......\OT1/cmr/m/n/10 )
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\penalty 0
+...\glue 10.0 plus 3.0 minus 5.0
+...\glue -2.5
+...\glue 0.0 plus 1.0fil
+...\glue 0.0
+...\glue 0.0 plus 0.0001fil
+..\glue(\baselineskip) 23.55556
+..\hbox(6.44444+0.0)x113.81102, glue set 54.4055fil
+...\glue 0.0 plus 1.0fil
+...\OT1/cmr/m/n/10 1
+...\glue 0.0 plus 1.0fil
+(github-0252.aux)
diff --git a/base/testfiles/tlb0010.luatex.tlg b/base/testfiles/tlb0010.luatex.tlg
index c861160d..af0a5885 100644
--- a/base/testfiles/tlb0010.luatex.tlg
+++ b/base/testfiles/tlb0010.luatex.tlg
@@ -288,7 +288,7 @@ Completed box being shipped out [1]
 .....\hbox(0.0+0.0)x0.0, direction TLT
 .....\glue 5.0
 ....\penalty 0
-....\hbox(8.64003+2.5)x345.0, glue set 296.302fil, direction TLT
+....\hbox(8.64003+2.5)x345.0, glue set 293.30194fil, direction TLT
 .....\mathon
 .....\glue 25.00003
 .....\OML/cmm/m/it/10 ^^K
@@ -296,6 +296,7 @@ Completed box being shipped out [1]
 .....\hbox(4.51111+0.0)x4.48613, shifted -4.12892, direction TLT
 ......\OT1/cmr/m/n/7 3
 .....\mathoff
+.....\glue 3.00003 minus 3.00003
 .....\glue 0.0 plus 1.0fil
 .....\hbox(7.5+2.5)x12.77782, direction TLT
 ......\OT1/cmr/m/n/10 (
diff --git a/base/testfiles/tlb0010.tlg b/base/testfiles/tlb0010.tlg
index 548331cd..94af5045 100644
--- a/base/testfiles/tlb0010.tlg
+++ b/base/testfiles/tlb0010.tlg
@@ -278,7 +278,7 @@ Completed box being shipped out [1]
 .....\hbox(0.0+0.0)x0.0
 .....\glue 5.0
 ....\penalty 0
-....\hbox(8.64003+2.5)x345.0, glue set 296.30199fil
+....\hbox(8.64003+2.5)x345.0, glue set 293.30196fil
 .....\mathon
 .....\glue 25.00003
 .....\OML/cmm/m/it/10 ^^K
@@ -286,6 +286,7 @@ Completed box being shipped out [1]
 .....\hbox(4.51111+0.0)x4.48613, shifted -4.12892
 ......\OT1/cmr/m/n/7 3
 .....\mathoff
+.....\glue 3.00003 minus 3.00003
 .....\glue 0.0 plus 1.0fil
 .....\hbox(7.5+2.5)x12.77782
 ......\OT1/cmr/m/n/10 (





More information about the latex3-commits mailing list.