Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions required/latex-lab/latex-lab-math.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -2928,6 +2928,103 @@
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[no-user-doc]{\eqnarray}
% \begin{macro}[no-user-doc]{\endeqnarray}
% For MathML generation in eqnarray we also need to add some sockets.
% \begin{macrocode}
%<@@=>
\def\eqnarray{%
\stepcounter{equation}%
\def\@currentlabel{\p@equation\theequation}%
\def\@currentcounter{equation}%
\global\@eqnswtrue
\m@th
\global\@eqcnt\z@
\tabskip\@centering
\let\\\@eqncr
\dollardollar@begin\everycr{}\halign to\displaywidth\bgroup
\hskip\@centering
$\displaystyle\tabskip\z@skip{##}%
\UseTaggingSocket{math/luamml/save/nNn}{{}\displaystyle {mtd}}%
$%
\UseTaggingSocket{math/luamml/mtable/finalizecol}{last}%
\@eqnsel
&\global\@eqcnt\@ne\hskip \tw@\arraycolsep \hfil${##}%
\UseTaggingSocket{math/luamml/save/nNn}{{}\displaystyle {mtd}}%
$%
\UseTaggingSocket{math/luamml/mtable/finalizecol}{last}%
\hfil
&\global\@eqcnt\tw@ \hskip \tw@\arraycolsep $\displaystyle{##}%
\UseTaggingSocket{math/luamml/save/nNn}{{} \displaystyle {mtd}}%
$%
\UseTaggingSocket{math/luamml/mtable/finalizecol}{last}%
\hfil\tabskip\@centering
&\global\@eqcnt\thr@@ \hb@xt@\z@\bgroup\hss##\egroup
\UseTaggingSocket{math/luamml/mtable/tag/set}
\tabskip\z@skip
\cr
}
\def\endeqnarray{%
\@@eqncr
\UseExpandableTaggingSocket{math/luamml/mtable/finalize} {eqnarray}%
\egroup
\global\advance\c@equation\m@ne
\dollardollar@end\@ignoretrue
}
\AddToHook{file/fleqn.clo/after}{
\renewenvironment{eqnarray}{%
\stepcounter{equation}%
\def\@currentlabel{\p@equation\theequation}%
\def\@currentcounter{equation}%
\global\@eqnswtrue\m@th
\global\@eqcnt\z@
\tabskip\mathindent
\let\\=\@eqncr
\setlength\abovedisplayskip{\topsep}%
\ifvmode
\addtolength\abovedisplayskip{\partopsep}%
\fi
\addtolength\abovedisplayskip{\parskip}%
\setlength\belowdisplayskip{\abovedisplayskip}%
\setlength\belowdisplayshortskip{\abovedisplayskip}%
\setlength\abovedisplayshortskip{\abovedisplayskip}%
\dollardollar@begin\everycr{}\halign to\linewidth%
\bgroup
\hskip\@centering
$\displaystyle\tabskip\z@skip{##}%
\UseTaggingSocket{math/luamml/save/nNn}{{} \displaystyle {mtd}}%
$%
\UseTaggingSocket{math/luamml/mtable/finalizecol}{last}%
\@eqnsel&%
\global\@eqcnt\@ne \hskip \tw@\arraycolsep \hfil${##}%
\UseTaggingSocket{math/luamml/save/nNn}{{} \displaystyle {mtd}}%
$%
\UseTaggingSocket{math/luamml/mtable/finalizecol}{last}%
\hfil&%
\global\@eqcnt\tw@ \hskip \tw@\arraycolsep $\displaystyle{##}%
\UseTaggingSocket{math/luamml/save/nNn}{{} \displaystyle {mtd}}%
$%
\UseTaggingSocket{math/luamml/mtable/finalizecol}{last}%
\hfil \tabskip\@centering&%
\global\@eqcnt\thr@@
\hb@xt@\z@\bgroup\hss##\egroup
\UseTaggingSocket{math/luamml/mtable/tag/set}
\tabskip\z@skip\cr
}%
{%
\@@eqncr
\UseExpandableTaggingSocket{math/luamml/mtable/finalize} {eqnarray}%
\egroup
\global\advance\c@equation\m@ne
\dollardollar@end
\@ignoretrue
}
}
%<@@=math>
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{Disable math grabbing in the begindocument hook}
% For example amsart uses math to measure text there.
%
Expand Down