[latex3-commits] [latex3/latex2e] tagging721: fix for tagging 721 (52e2776e)

github at latex-project.org github at latex-project.org
Mon Sep 30 20:56:20 CEST 2024


Repository : https://github.com/latex3/latex2e
On branch  : tagging721
Link       : https://github.com/latex3/latex2e/commit/52e2776efeabca39a848d081844684b8e81e93a3

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

commit 52e2776efeabca39a848d081844684b8e81e93a3
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Mon Sep 30 18:56:20 2024 +0000

    fix for tagging 721


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

52e2776efeabca39a848d081844684b8e81e93a3
 required/latex-lab/changes.txt                  |  5 +++++
 required/latex-lab/latex-lab-math.dtx           | 29 +++++++++++++++++++------
 required/latex-lab/testfiles-math/mtag-tlc3.tlg | 26 +++++++++++-----------
 3 files changed, 40 insertions(+), 20 deletions(-)

diff --git a/required/latex-lab/changes.txt b/required/latex-lab/changes.txt
index 6973d031..022e476a 100644
--- a/required/latex-lab/changes.txt
+++ b/required/latex-lab/changes.txt
@@ -1,3 +1,8 @@
+2024-09-30  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* latex-lab-math.dtx (subsection{Content grabbing}):
+	Correct logic for inserting below skips after displays (tagging/721)
+
 2024-09-24 Ulrike Fischer <Ulrike.Fischer at latex-project.org>
 	* latex-lab-sec.dtx,latex-lab-footnotes.dtx: 
 	correct and improve footnotes in longtable
diff --git a/required/latex-lab/latex-lab-math.dtx b/required/latex-lab/latex-lab-math.dtx
index 8a68e5f5..fd2d11b8 100644
--- a/required/latex-lab/latex-lab-math.dtx
+++ b/required/latex-lab/latex-lab-math.dtx
@@ -19,8 +19,8 @@
 % for those people who are interested or want to report an issue.
 %
 %
-\def\ltlabmathdate{2024-09-19}
-\def\ltlabmathversion{0.6e}
+\def\ltlabmathdate{2024-09-30}
+\def\ltlabmathversion{0.6f}
 %
 %<*driver>
 \documentclass{l3doc}
@@ -1726,15 +1726,30 @@
 % TODO why is that needed? where is para-tagging disabled?
 %    \begin{macrocode}
     \tagpdfparaOn
+%    \end{macrocode}
+%    The \cs{postdisplaypenalty} was temporarily set to 10000 inside
+%    the display and the \cs{belowdisplayskip} and the
+%    \cs{belowdisplayshortskip} was negated, so whatever was inserted
+%    it should have been a negative skip. Whatever skip was added we
+%    pick it ups value up here, so that we can correct the spacing
+%    after the tagging code was inserted.
+%    \begin{macrocode}
     \l_@@_tmpa_skip \lastskip
     \tag_socket_use:n{math/display/formula/end}
-    \penalty \postdisplaypenalty
 %    \end{macrocode}
-% This reinserts the below display skips. It must be doubled to
-% get the right amount:
+%    Now we add a skip without indroducing a page break possibility,
+%    that should bring the current vertical position back to the point
+%    where \TeX{} would add the penalty and the \enquoet{below skip}.
+% \changes{v0.6f}{2024-09-30}{Correct logic for inserting below skips
+%                             after displays (tagging/721)}
 %    \begin{macrocode}
-  \skip_vertical:n { -\l_@@_tmpa_skip * 2 }
-%
+    \nobreak
+    \skip_vertical:n { -\l__math_tmpa_skip  } % remove the negative belowdisplayskip
+%    \end{macrocode}
+%    Then we finally add the real stuff:
+%    \begin{macrocode}
+    \penalty \postdisplaypenalty
+    \skip_vertical:n { -\l__math_tmpa_skip  } % insert the correct skip
   \@doendpe             % this has no \end{...} to take care of it
 }
 
diff --git a/required/latex-lab/testfiles-math/mtag-tlc3.tlg b/required/latex-lab/testfiles-math/mtag-tlc3.tlg
index 07d55a75..5736ecce 100644
--- a/required/latex-lab/testfiles-math/mtag-tlc3.tlg
+++ b/required/latex-lab/testfiles-math/mtag-tlc3.tlg
@@ -41,14 +41,14 @@ Math env align
 ====>tmpmathcontent=macro:-> &= a^3 + 3a^2b + 3ab^2 + b^3
 ====>result=macro:-> &= a^3 + 3a^2b + 3ab^2 + b^3
 ====>tmpmathcontent=macro:->
+[1
+]
 -----------------------------------
 Math env align
 x^2 + y^2 & = 1 \\ x & = \sqrt {1-y^2}
 ====>first-result=macro:->x^2 + y^2 & = 1 
 ====>first-tmpmathcontent=macro:-> x & = \sqrt {1-y^2}
 ====>formula has subparts
-[1
-]
 ====>result=macro:-> x & = \sqrt {1-y^2}
 ====>tmpmathcontent=macro:->
 -----------------------------------
@@ -99,13 +99,13 @@ Math env equation*
 ====>first-result=macro:->\begin {rcases} \bm {B}' &=-c\nabla \times \bm {E} \\ \bm {E}' &=c\nabla \times \bm {B} - 4\pi \bm {J}\, \end {rcases} \quad \text {Maxwell's equations}
 ====>first-tmpmathcontent=macro:->
 ====>formula has no subparts
+[2]
 -----------------------------------
 Math env equation
 \begin {aligned} V_j &= v_j & X_i &= x_i - q_i x_j & &= u_j + \sum _{i\ne j} q_i \\ V_i &= v_i - q_i v_j & X_j &= x_j & U_i &= u_i \end {aligned}
 ====>first-result=macro:->\begin {aligned} V_j &= v_j & X_i &= x_i - q_i x_j & &= u_j + \sum _{i\ne j} q_i \\ V_i &= v_i - q_i v_j & X_j &= x_j & U_i &= u_i \end {aligned}
 ====>first-tmpmathcontent=macro:->
 ====>formula has no subparts
-[2]
 -----------------------------------
 Math env align
 A_1 &= N_0 (\lambda ; \Omega ') - \phi ( \lambda ; \Omega ') \\ A_2 &= \phi (\lambda ; \Omega ') \phi (\lambda ; \Omega ) \\ \intertext {and finally} A_3 &= \mathcal {N} (\lambda ; \omega )
@@ -159,11 +159,11 @@ f &= g \label {eq:2A} \\ f' &= g' \label {eq:2B} \\ \mathcal {L}f &= \mathcal {L
 ====>first-result=macro:->f &= g \label {eq:2A} 
 ====>first-tmpmathcontent=macro:-> f' &= g' \label {eq:2B} \\ \mathcal {L}f &= \mathcal {L}g + K \label {eq:2C}
 ====>formula has subparts
+[3]
 ====>result=macro:-> f' &= g' \label {eq:2B} 
 ====>tmpmathcontent=macro:-> \mathcal {L}f &= \mathcal {L}g + K \label {eq:2C}
 ====>result=macro:-> \mathcal {L}f &= \mathcal {L}g + K \label {eq:2C}
 ====>tmpmathcontent=macro:->
-[3]
 -----------------------------------
 Math env align
 A_1 &= N_0 (\lambda ; \Omega ') - \phi ( \lambda ; \Omega ') \\ A_2 &= \phi (\lambda ; \Omega ') \, \phi (\lambda ; \Omega ) \tag *{ALSO (\theequation )} \\ A_3 &= \mathcal {N} (\lambda ; \omega )
@@ -214,6 +214,7 @@ Math env multline
 ====>tmpmathcontent=macro:-> \text {Last line of the multline}
 ====>result=macro:-> \text {Last line of the multline}
 ====>tmpmathcontent=macro:->
+[4]
 -----------------------------------
 Math env multline
 \tag {2} \sum _{t \in \mathbf {T}} \int _a^t \biggl \lbrace \int _a^t f(t - x)^2 \, g(y)^2 \,dx \biggr \rbrace \,dy \\ = \sum _{t \notin \mathbf {T}} \int _t^a \biggl \lbrace g(y)^2 \int _t^a f(x)^2 \,dx \biggr \rbrace \,dy
@@ -228,7 +229,6 @@ Math env gather*
 ====>first-result=macro:->\begin {matrix} 0 & 1 \\ 1 & 0 \end {matrix} \quad \begin {pmatrix} 0 & -i \\ i & 0 \end {pmatrix} 
 ====>first-tmpmathcontent=macro:->[10pt] \begin {bmatrix} 0 & -1 \\ 1 & 0 \end {bmatrix} \quad \begin {Bmatrix} 1 & 0 \\ 0 & -1 \end {Bmatrix} \\[10pt] \begin {vmatrix} a & b \\ c & d \end {vmatrix} \quad \begin {Vmatrix} i & 0 \\ 0 & -i \end {Vmatrix}
 ====>formula has subparts
-[4]
 ====>result=macro:->[10pt] \begin {bmatrix} 0 & -1 \\ 1 & 0 \end {bmatrix} \quad \begin {Bmatrix} 1 & 0 \\ 0 & -1 \end {Bmatrix} 
 ====>tmpmathcontent=macro:->[10pt] \begin {vmatrix} a & b \\ c & d \end {vmatrix} \quad \begin {Vmatrix} i & 0 \\ 0 & -i \end {Vmatrix}
 ====>result=macro:->[10pt] \begin {vmatrix} a & b \\ c & d \end {vmatrix} \quad \begin {Vmatrix} i & 0 \\ 0 & -i \end {Vmatrix}
@@ -251,6 +251,7 @@ Math env equation*
 ====>first-result=macro:->0 \xleftarrow [\zeta ]{} F \times \Delta (n - 1) \xrightarrow {\partial _0 \alpha (b)} E^{\partial _0 b}
 ====>first-tmpmathcontent=macro:->
 ====>formula has no subparts
+[5]
 -----------------------------------
 Math env align*
 u & \equiv v + 1 \mod {n^2} \\ u & \equiv v + 1 \bmod {n^2} \\ u & = v + 1 \pmod {n^2} \\ u & = v + 1 \pod {n^2}
@@ -281,7 +282,6 @@ A \xLeftarrow {\ x} B \xRightarrow [y\ ]{} C \xLeftrightarrow [y]{\ x\ } D \\ A
 ====>tmpmathcontent=macro:-> \xmapsto {x>0} A \xleftrightarrow [\text {letters}]{} Z
 ====>result=macro:-> \xmapsto {x>0} A \xleftrightarrow [\text {letters}]{} Z
 ====>tmpmathcontent=macro:->
-[5]
 -----------------------------------
 Math env gather*
 \ropen {a,d}=\closed {a,b} + \lopen {b,c} + \dotsb \\[3pt] \open {\frac {a}{b}} \approx \open *{\frac {a}{b}} \neq \closed [\Bigg ]{x}
@@ -312,6 +312,7 @@ A \xlongequal [\text {characters}]{ +12 } M \xLongrightarrow [\text {characters}
 ====>first-result=macro:->A \xlongequal [\text {characters}]{ +12 } M \xLongrightarrow [\text {characters}]{\text {more}} Z 
 ====>first-tmpmathcontent=macro:-> 0 \xrightarrow {x} \epsilon \xlongrightarrow {x} 1 \\ \xLongleftarrow {1} \xLongrightarrow {2} \xlongleftarrow {3} \xlongrightarrow {4} \xlongleftrightarrow {5}
 ====>formula has subparts
+[6]
 ====>result=macro:-> 0 \xrightarrow {x} \epsilon \xlongrightarrow {x} 1 
 ====>tmpmathcontent=macro:-> \xLongleftarrow {1} \xLongrightarrow {2} \xlongleftarrow {3} \xlongrightarrow {4} \xlongleftrightarrow {5}
 ====>result=macro:-> \xLongleftarrow {1} \xLongrightarrow {2} \xlongleftarrow {3} \xlongrightarrow {4} \xlongleftrightarrow {5}
@@ -338,7 +339,6 @@ Math env gather
 ====>tmpmathcontent=macro:-> \bCSb {a} \cdot \bS {c} = \bS {a} \times \bS {c}
 ====>result=macro:-> \bCSb {a} \cdot \bS {c} = \bS {a} \times \bS {c}
 ====>tmpmathcontent=macro:->
-[6]
 -----------------------------------
 Math env equation*
 \overset {*}{X} > \underset {*}{X} \overunderset {\mathsf {def}}{\mathsf {loc.}}{\iff } \sideset {}{'}\sum _{a,b \in \mathbf {R^*}} \overset {a}{\underset {b}{X}} = X
@@ -375,6 +375,7 @@ f(x)=a_0+a_1x+a_2x^2+ \overbrace [B]{a_3x^3 + a_4x^4 + \dots + a_{i-1}x^{i-1} +
 ====>first-result=macro:->f(x)=a_0+a_1x+a_2x^2+ \overbrace [B]{a_3x^3 + a_4x^4 + \dots + a_{i-1}x^{i-1} + \enspace } ^{\text {some explanation}} 
 ====>first-tmpmathcontent=macro:-> \overbrace [e]{\enspace a_ix^i + a_{i+1}x^{i+1}} + \dots + a_{n-1}x^{n-1}
 ====>formula has subparts
+[7]
 ====>result=macro:-> \overbrace [e]{\enspace a_ix^i + a_{i+1}x^{i+1}} + \dots + a_{n-1}x^{n-1}
 ====>tmpmathcontent=macro:->
 Overfull \hbox (9.0542pt too wide) detected at line 434
@@ -526,16 +527,15 @@ Overfull \hbox (9.0542pt too wide) detected at line 434
 .....\mathoff
 ....\glue(\tabskip) 0.0
 .\pdfliteral page{EMC}
-.\marks4{e-,294,322,}
-.\marks4{e+,294,322,}
-.\write1{\new at label@record{mcid-295}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{295}{tagmcid}{\__property_code_tagmcid: }}}
+.\marks4{e-,295,322,}
+.\marks4{e+,295,322,}
+.\write1{\new at label@record{mcid-296}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{296}{tagmcid}{\__property_code_tagmcid: }}}
 .\pdfliteral shipout page{/Formula <</MCID \flag_height:n {__tag/mcid}\flag_raise:n {__tag/mcid} >> BDC}
-.\marks4{b-,295,323,Formula,,,}
-.\marks4{b+,295,323,Formula,,,}
+.\marks4{b-,296,323,Formula,,,}
+.\marks4{b+,296,323,Formula,,,}
 .\mathoff
 .\glue 0.0 plus 1.0fil
 )
-[7]
 [8]
 [9]
 [10]





More information about the latex3-commits mailing list.