Skip to content

Commit

Permalink
Tagging721 (#1479)
Browse files Browse the repository at this point in the history
* fix for tagging 721

* mumble

* picking up one changed test after another

* .. and two more

* and another
  • Loading branch information
FrankMittelbach authored Oct 1, 2024
1 parent f36021a commit ea44ee6
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 30 deletions.
6 changes: 5 additions & 1 deletion required/latex-lab/changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

2024-09-30 Frank Mittelbach <[email protected]>
* latex-lab-math.dtx (subsection{Content grabbing}):
Correct logic for inserting below skips after displays (tagging/721)

2024-09-26 Ulrike Fischer <[email protected]>
* latex-lab-firstaid.dtx: add support for theorems declared with
amsthm, amsart, amsbook, amsproc.
Expand Down Expand Up @@ -27,7 +32,6 @@
engines.

2024-09-02 Frank Mittelbach <[email protected]>

* latex-lab-block.dtx (subsubsection{List tags}):
Do not close LI and LBody if they were never opened because of a
missing \item (issue tagging/641)
Expand Down
31 changes: 23 additions & 8 deletions required/latex-lab/latex-lab-math.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
\tag_socket_use:n{math/display/formula/end}
% \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 \enquote{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
}
Expand Down
4 changes: 2 additions & 2 deletions required/latex-lab/testfiles-LM/LM-3-3.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,6 @@ Package tagpdf Info: closing structure 90 tagged /text-unit
The sequence \g__tag_mc_main_marks_seq contains the items (without outer
braces):
> {e+}
> {62}
> {79}.
> {57}
> {74}.
[2]
4 changes: 3 additions & 1 deletion required/latex-lab/testfiles-math/mathcapture-016.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ Completed box being shipped out [1]
....\OML/cmm/m/it/10 :
...\penalty 10000
...\glue(\belowdisplayskip) -10.0 plus -2.0 minus -5.0
...\penalty 10000
...\glue 10.0 plus 2.0 minus 5.0
...\penalty 0
...\glue 20.0 plus 4.0 minus 10.0
...\glue 10.0 plus 2.0 minus 5.0
...\glue(\parskip) 0.0 plus 1.0
...\glue(\parskip) 0.0
...\glue(\baselineskip) 4.27946
Expand Down
4 changes: 3 additions & 1 deletion required/latex-lab/testfiles-math/mtag-005-intertext.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,10 @@ Completed box being shipped out [1]
...\pdfliteral page{EMC}
...\marks4{e-,7,6,}
...\marks4{e+,7,6,}
...\penalty 10000
...\glue 10.0 plus 2.0 minus 5.0
...\penalty 0
...\glue 20.0 plus 4.0 minus 10.0
...\glue 10.0 plus 2.0 minus 5.0
...\glue -3.60004
...\glue 0.0 plus 1.0fil
...\glue 0.0 plus -1.0fil
Expand Down
26 changes: 13 additions & 13 deletions required/latex-lab/testfiles-math/mtag-tlc3.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -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:->
-----------------------------------
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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
Expand All @@ -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}
Expand All @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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@label@record{mcid-295}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{295}{tagmcid}{\__property_code_tagmcid: }}}
.\marks4{e-,295,322,}
.\marks4{e+,295,322,}
.\write1{\new@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]
Expand Down
12 changes: 9 additions & 3 deletions required/latex-lab/testfiles-table-pdftex/table-016-math.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,10 @@ Completed box being shipped out [1]
...\pdfliteral page{EMC}
...\marks4{e-,9,16,}
...\marks4{e+,9,16,}
...\penalty 10000
...\glue 6.5 plus 3.5 minus 3.0
...\penalty 0
...\glue 13.0 plus 7.0 minus 6.0
...\glue 6.5 plus 3.5 minus 3.0
...\write1{\new@label@record{mcid-10}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{10}{tagmcid}{\__property_code_tagmcid: }}}
...\pdfliteral shipout page{/Formula <</MCID \flag_height:n {__tag/mcid}\flag_raise:n {__tag/mcid} >> BDC}
...\marks4{b-,10,19,Formula,,,}
Expand Down Expand Up @@ -422,8 +424,10 @@ Completed box being shipped out [1]
...\pdfliteral page{EMC}
...\marks4{e-,12,19,}
...\marks4{e+,12,19,}
...\penalty 10000
...\glue 6.5 plus 3.5 minus 3.0
...\penalty 0
...\glue 13.0 plus 7.0 minus 6.0
...\glue 6.5 plus 3.5 minus 3.0
...\write1{\new@label@record{mcid-13}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{13}{tagmcid}{\__property_code_tagmcid: }}}
...\pdfliteral shipout page{/Formula <</MCID \flag_height:n {__tag/mcid}\flag_raise:n {__tag/mcid} >> BDC}
...\marks4{b-,13,22,Formula,,,}
Expand Down Expand Up @@ -543,8 +547,10 @@ Completed box being shipped out [1]
...\pdfliteral page{EMC}
...\marks4{e-,15,22,}
...\marks4{e+,15,22,}
...\penalty 10000
...\glue 6.5 plus 3.5 minus 3.0
...\penalty 0
...\glue 13.0 plus 7.0 minus 6.0
...\glue 6.5 plus 3.5 minus 3.0
...\glue -6.0
...\glue 0.0 plus 1.0fil
...\glue 0.0 plus -1.0fil
Expand Down
9 changes: 8 additions & 1 deletion required/latex-lab/update-math-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ l3build save -cconfig-math \
mathcapture-011 \
mathcapture-012 \
mathcapture-014 \
mathcapture-015 \
mathcapture-016 \
mathcapture-017 \
mathcapture-018 \
mathcapture-019 \
mtag-001 \
mtag-002 \
mtag-tlc3 \
mathcapture-tag-001 \
mtag-003 \
mtag-004
mtag-004 \
mtag-005-intertext


exit

Expand Down

0 comments on commit ea44ee6

Please sign in to comment.