Skip to content

Commit

Permalink
provide \DocumentMetadata{testphase={phase-II,math}}
Browse files Browse the repository at this point in the history
add latex-lab-math.ltx holding math redefinitions
update tests
  • Loading branch information
FrankMittelbach committed Jan 7, 2023
1 parent 7078229 commit 024c564
Show file tree
Hide file tree
Showing 19 changed files with 200 additions and 188 deletions.
171 changes: 171 additions & 0 deletions required/latex-lab/latex-lab-math.dtx
@@ -0,0 +1,171 @@
% \iffalse meta-comment
%
%% File: latex-lab-math.dtx
% Copyright (C) 2023 The LaTeX Project
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
% license or (at your option) any later version. The latest version
% of this license is in the file
%
% https://www.latex-project.org/lppl.txt
%
%
% The development version of the bundle can be found below
%
% https://github.com/latex3/latex2e/required/latex-lab
%
% for those people who are interested or want to report an issue.
%
%<*driver>
\documentclass{l3doc}
\EnableCrossrefs
\CodelineIndex
\begin{document}
\DocInput{latex-lab-math.dtx}
\end{document}
%</driver>
%
% \fi
%
%
% \title{The \texttt{latex-lab-math} code\thanks{}}
% \author{Ulrike Fischer, Frank Mittelbach, Joseph Wright \LaTeX{} Project}
%
% \maketitle
%
% \newcommand\fmi[1]{\begin{quote} TODO: \itshape #1\end{quote}}
% \newcommand\NEW[1]{\marginpar{\mbox{}\hfill\fbox{New: #1}}}
% \providecommand\pkg[1]{\texttt{#1}}
%
% \begin{abstract}
% \end{abstract}
%
% \section{Introduction}
%
% This code implements changes to commands and environments for math
% from the kernel, \pkg{amsmath}, etc.
%
%
%
%
% \StopEventually{\setlength\IndexMin{200pt} \PrintIndex }
%
%
% \section{The Implementation}
%
% \begin{macrocode}
%<*code>
% \end{macrocode}
%
% \subsection{File declaration}
% \begin{macrocode}
\ProvidesFile{latex-lab-math.ltx}
[2023-01-07 v0.1a changes to math cmds and envs]
% \end{macrocode}
%
%
% \begin{macrocode}
\ExplSyntaxOn
% \end{macrocode}
%
%
% \begin{macrocode}
\AddToHook{package/amsmath/after}{%
\def\intertext@{%
\def\intertext##1{%
\ifvmode\else\\\@empty\fi
\noalign{%
\penalty\postdisplaypenalty\vskip\belowdisplayskip
\vbox{
%don't tag during measuring:
\ifmeasuring@\tag_stop:\fi
\normalbaselines
\ifdim\linewidth=\columnwidth
\else \parshape\@ne \@totalleftmargin \linewidth
\fi
% end previous mc
\tag_mc_end_push:
% change to span as we are in a par:
\tagpdfsetup{paratag=Span}%
\noindent\ignorespaces##1\par
% restart MC
\tag_mc_begin_pop:n{}}%
\penalty\predisplaypenalty\vskip\abovedisplayskip%
}%
}}
}
% \end{macrocode}
%
%
% The following is incomplete and only covers one case of \cs{shortintertext}:
% \begin{macrocode}
%\MHInternalSyntaxOn
\AddToHook{package/mathtools/after}{%
\def\MT_shortintertext:n #1{%
\ifvmode\else\\\@empty\fi
\noalign{%
\penalty\postdisplaypenalty\vskip\abovedisplayshortskip
\vskip-\lineskiplimit
\vskip\normallineskiplimit
\vskip\l_MT_above_shortintertext_sep
\vbox{%
\ifmeasuring@\tag_stop:\fi
\normalbaselines
\MH_if_dim:w
\MH_if_dim:w \@totalleftmargin=\z@
\linewidth
\MH_else:
-\maxdimen
\MH_fi:
=\columnwidth
\MH_else:
\parshape\@ne \@totalleftmargin \linewidth
\MH_fi:
% end previous mc
\tag_mc_end_push:
% change to span as we are in a par:
\tagpdfsetup{paratag=Span}%
\noindent\ignorespaces#1\par
% restart MC
\tag_mc_begin_pop:n{}%
}%
\penalty\predisplaypenalty\vskip\abovedisplayshortskip%
\vskip-\lineskiplimit
\vskip\normallineskiplimit
\vskip\l_MT_below_shortintertext_sep
}%
}
\MT_orig_shortintertext_false: %activate
}
%\MHInternalSyntaxOff
% \end{macrocode}
%
%
% \begin{macrocode}
\AddToHook{package/breqn/after}{
\RegisterMathEnvironment{dmath}
\RegisterMathEnvironment{dgroup*}
}
% \end{macrocode}
%
% Not sure why that was set in a test file, mistake?
% \begin{macrocode}
%\AddToHook{package/amsmath/after}{
% \RegisterMathEnvironment{smallmatrix}
%}
% \end{macrocode}
%
% \begin{macrocode}
\AddToHook{package/cases/after}{
\RegisterMathEnvironment{subnumcases}
}
% \end{macrocode}
%
% \begin{macrocode}
\ExplSyntaxOff
%</code>
% \end{macrocode}
%
% \Finale
%
9 changes: 9 additions & 0 deletions required/latex-lab/latex-lab-testphase.dtx
Expand Up @@ -80,5 +80,14 @@
% \begin{macrocode}
%</tagpdf|phase-I|phase-II>
% \end{macrocode}
%
% \begin{macrocode}
%<*math>
\AddToHook{class/after}{%
\input{latex-lab-mathcapture.ltx}%
\input{latex-lab-math.ltx}%
}
%</math>
% \end{macrocode}
% \Finale
%
4 changes: 4 additions & 0 deletions required/latex-lab/latex-lab.ins
Expand Up @@ -72,12 +72,16 @@ where one can also log issues in case there are any.
\generate{\file{tagpdf-latex-lab-testphase.ltx}{\from{latex-lab-testphase.dtx}{tagpdf}}}
\generate{\file{new-or-latex-lab-testphase.ltx}{\from{latex-lab-testphase.dtx}{new-or}}}


\generate{\file{math-latex-lab-testphase.ltx}{\from{latex-lab-testphase.dtx}{math}}}

% support files (the new-or code is a private package to make life easier)

\generate{\file{latex-lab-testphase-new-or.sty}{\from{latex-lab-new-or.dtx}{code}}}
\generate{\file{latex-lab-footmisc.ltx}{\from{latex-lab-footnotes.dtx}{footmisc}}}
\generate{\file{latex-lab-footnotes.ltx}{\from{latex-lab-footnotes.dtx}{kernel}}}
\generate{\file{latex-lab-mathcapture.ltx}{\from{latex-lab-mathcapture.dtx}{kernel}}}
\generate{\file{latex-lab-math.ltx}{\from{latex-lab-math.dtx}{code}}}


\endbatchfile
6 changes: 2 additions & 4 deletions required/latex-lab/testfiles-mathcapture/mathcapture-001.lvt
@@ -1,4 +1,4 @@
\DocumentMetadata{testphase=phase-II}
\DocumentMetadata{testphase={phase-II,math}}

\documentclass{article}

Expand All @@ -9,9 +9,7 @@
\debug_on:n { deprecation }
\ExplSyntaxOff

\makeatletter
\input{latex-lab-mathcapture.ltx}
\makeatother

\ExplSyntaxOn
\math_processor:n
{
Expand Down
5 changes: 1 addition & 4 deletions required/latex-lab/testfiles-mathcapture/mathcapture-002.lvt
@@ -1,4 +1,4 @@
\DocumentMetadata{testphase=phase-II}
\DocumentMetadata{testphase={phase-II,math}}

\documentclass{article}

Expand All @@ -9,9 +9,6 @@
\debug_on:n { deprecation }
\ExplSyntaxOff

\makeatletter
\input{latex-lab-mathcapture.ltx}
\makeatother
\ExplSyntaxOn
\math_processor:n
{
Expand Down
5 changes: 1 addition & 4 deletions required/latex-lab/testfiles-mathcapture/mathcapture-003.lvt
@@ -1,4 +1,4 @@
\DocumentMetadata{testphase=phase-II}
\DocumentMetadata{testphase={phase-II,math}}

\documentclass{article}

Expand All @@ -9,9 +9,6 @@
\debug_on:n { deprecation }
\ExplSyntaxOff

\makeatletter
\input{latex-lab-mathcapture.ltx}
\makeatother
\ExplSyntaxOn
\math_processor:n
{
Expand Down
5 changes: 1 addition & 4 deletions required/latex-lab/testfiles-mathcapture/mathcapture-004.lvt
@@ -1,4 +1,4 @@
\DocumentMetadata{testphase=phase-II}
\DocumentMetadata{testphase={phase-II,math}}

\documentclass{article}

Expand All @@ -9,9 +9,6 @@
\debug_on:n { deprecation }
\ExplSyntaxOff

\makeatletter
\input{latex-lab-mathcapture.ltx}
\makeatother

\ExplSyntaxOn
\math_processor:n
Expand Down
8 changes: 1 addition & 7 deletions required/latex-lab/testfiles-mathcapture/mathcapture-005.lvt
@@ -1,4 +1,4 @@
\DocumentMetadata{testphase=phase-II}
\DocumentMetadata{testphase={phase-II,math}}

\documentclass{article}

Expand All @@ -9,10 +9,6 @@
\debug_on:n { deprecation }
\ExplSyntaxOff

\makeatletter
\input{latex-lab-mathcapture.ltx}
\makeatother

\ExplSyntaxOn
\math_processor:n
{
Expand Down Expand Up @@ -53,8 +49,6 @@
U_i &= u_i
\end{aligned} \end{equation}

\TYPE {-----------------------------------}
\TYPE{==> now a tagpdf issue with \string\intertext}

11-2-23:
\begin{align}
Expand Down
56 changes: 0 additions & 56 deletions required/latex-lab/testfiles-mathcapture/mathcapture-005.tlg
Expand Up @@ -7,61 +7,5 @@ Math env equation*
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}
-----------------------------------
==> now a tagpdf issue with \intertext
-----------------------------------
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 )
Package tagpdf Warning: nested marked content found - mcid 3
! LaTeX Error: Control sequence \g__tag_struct_5_prop already defined.
For immediate help type H <return>.
...
l. ...\end{align}
This is a coding error.
LaTeX has been asked to create a new control sequence '\g__tag_struct_5_prop'
but this name has already been used elsewhere.
The current meaning is:
macro:->\s__prop \__prop_pair:wn Type\s__prop {/StructElem}\__prop_pair:wn
S\s__prop {/P}\__prop_pair:wn P\s__prop {15 0 R}
! LaTeX Error: Control sequence \__tag_struct_output_prop_5:n already defined.
For immediate help type H <return>.
...
l. ...\end{align}
This is a coding error.
LaTeX has been asked to create a new control sequence
'\__tag_struct_output_prop_5:n' but this name has already been used elsewhere.
The current meaning is:
\long macro:#1->\__tag_struct_output_prop_aux:nn {\int_eval:n
{\c@g__tag_struct_abs_int }}{#1}
! LaTeX Error: Control sequence \g__tag_struct_kids_5_seq already defined.
For immediate help type H <return>.
...
l. ...\end{align}
This is a coding error.
LaTeX has been asked to create a new control sequence
'\g__tag_struct_kids_5_seq' but this name has already been used elsewhere.
The current meaning is:
macro:->\s__seq \__seq_item:n {<</Type /MCR /Pg 12 0 R/MCID
1>>}\__seq_item:n {\prop_item:Nn \g__tag_struct_cont_mc_prop {4}}
! LaTeX Error: Control sequence \c__pdf_object___tag/struct/5_int already
(LaTeX) defined.
For immediate help type H <return>.
...
l. ...\end{align}
This is a coding error.
LaTeX has been asked to create a new control sequence
'\c__pdf_object___tag/struct/5_int' but this name has already been used
elsewhere.
The current meaning is:
\mathchar"11
! LaTeX Error: Control sequence \c__pdf_backend_object___tag/struct/5_int
(LaTeX) already defined.
For immediate help type H <return>.
...
l. ...\end{align}
This is a coding error.
LaTeX has been asked to create a new control sequence
'\c__pdf_backend_object___tag/struct/5_int' but this name has already been
used elsewhere.
The current meaning is:
\mathchar"11
Package tagpdf Warning: there is no mc to end at 4
6 changes: 1 addition & 5 deletions required/latex-lab/testfiles-mathcapture/mathcapture-006.lvt
@@ -1,6 +1,6 @@
% mathtool examples ...

\DocumentMetadata{testphase=phase-II}
\DocumentMetadata{testphase={phase-II,math}}

\documentclass{article}

Expand All @@ -11,10 +11,6 @@
\debug_on:n { deprecation }
\ExplSyntaxOff

\makeatletter
\input{latex-lab-mathcapture.ltx}
\makeatother


\ExplSyntaxOn
\math_processor:n
Expand Down

0 comments on commit 024c564

Please sign in to comment.