mathml/luamml-patches-amsmath.sty

180 lines
3.2 KiB
Plaintext
Raw Normal View History

2021-04-24 16:53:50 +02:00
\ProvidesExplPackage {luamml-patches-amsmath} {2021-04-23} {0.0.1-alpha}
{Feel free to add a description here}
\lua_now:n { require'luamml-amsmath' }
2021-06-18 23:03:39 +02:00
\cs_set:Npn \start@aligned #1#2 {
\RIfM@
\else
\nonmatherr@ { \begin { \@currenvir } }
\fi
\savecolumn@ % Assumption: called inside a group
2021-06-18 23:15:12 +02:00
\luamml_annotate:en {
nucleus = true, core = false
} {
\alignedspace@left
}
2021-06-18 23:03:39 +02:00
\ams@start@box {#1} \bgroup
\maxfields@ #2 \relax
\ifnum \maxfields@ > \m@ne
\multiply \maxfields@ \tw@
\let \math@cr@@@ \math@cr@@@alignedat
\alignsep@ \z@skip
\else
\let \math@cr@@@ \math@cr@@@aligned
\alignsep@ \minalignsep
\fi
\Let@ \chardef \dspbrk@context \@ne
\default@tag
\spread@equation % no-op if already called
\global \column@ \z@
\ialign \bgroup
& \column@plus
\hfil
\strut@
$
\m@th
\displaystyle
{##}
2021-06-22 17:44:18 +02:00
\luamml_flag_save:Nn \displaystyle {mtd}
2021-06-18 23:03:39 +02:00
$
\__luamml_amsmath_add_last_to_row:
\tabskip \z@skip
& \column@plus
$
\m@th
\displaystyle
{
{}
##
}
2021-06-22 17:44:18 +02:00
\luamml_flag_save:Nn \displaystyle {mtd}
2021-06-18 23:03:39 +02:00
$
\__luamml_amsmath_add_last_to_row:
\hfil
\tabskip\alignsep@
\crcr
\ams@return@opt@arg
}
\cs_set:Npn \endaligned {
\crcr
\__luamml_amsmath_save_inner_table:
\egroup
\restorecolumn@
\egroup
\__luamml_amsmath_finalize_inner_table:
}
2021-04-24 16:53:50 +02:00
\cs_set:Npn \align@preamble {
&
\hfil
\strut@
\setboxz@h {
\@lign
$
\m@th
2021-06-18 23:03:39 +02:00
\displaystyle
{##}
2021-04-24 16:53:50 +02:00
\ifmeasuring@
\luamml_flag_ignore:
\else
2021-06-22 17:44:18 +02:00
\luamml_flag_save:Nn \displaystyle {mtd}
2021-04-24 16:53:50 +02:00
\fi
$
}
\ifmeasuring@
\savefieldlength@
2021-04-25 18:09:13 +02:00
\else
2021-04-27 17:33:22 +02:00
\__luamml_amsmath_add_box_to_row:
2021-04-24 16:53:50 +02:00
\fi
\set@field
\tabskip\z@skip
&
\setboxz@h {
\@lign
$
\m@th
\displaystyle
{
{}
##
}
\ifmeasuring@
\luamml_flag_ignore:
\else
2021-06-22 17:44:18 +02:00
\luamml_flag_save:Nn \displaystyle {mtd}
2021-04-24 16:53:50 +02:00
\fi
$
}
\ifmeasuring@
\savefieldlength@
\else
2021-04-27 17:33:22 +02:00
\__luamml_amsmath_add_box_to_row:
2021-04-24 16:53:50 +02:00
\fi
\set@field
\hfil
\tabskip\alignsep@
}
\cs_set:Npn \math@cr@@@align {
\ifst@rred
\nonumber
\fi
\if@eqnsw
\global \tag@true
\fi
\global \advance \row@ \@ne
\add@amps \maxfields@
\omit
\kern -\alignsep@
\iftag@
\setboxz@h {
\@lign
\strut@
{ \make@display@tag }
}
\place@tag
2021-04-27 17:33:22 +02:00
\__luamml_amsmath_set_tag:
2021-04-24 16:53:50 +02:00
\fi
\ifst@rred
\else
\global \@eqnswtrue
\fi
\global \lineht@ \z@
\cr
}
2021-04-27 17:33:22 +02:00
\cs_set:Npn \maketag@@@ #1 {
\hbox {
\m@th
\normalfont
#1
\__luamml_amsmath_save_tag:
}
}
2021-04-24 16:53:50 +02:00
\cs_set:Npn \endalign {
\math@cr
\black@ \totwidth@
2021-04-27 17:33:22 +02:00
\__luamml_amsmath_finalize_table:
2021-04-24 16:53:50 +02:00
\egroup
\ifingather@
\restorealignstate@
\egroup
\nonumber
\ifnum0={\fi\iffalse}\fi
\else
$$
\fi
\ignorespacesafterend
}
2021-05-30 20:37:03 +02:00
\cs_set:Npn \bBigg@ #1 #2 {
{
\ensuremath {
\Uvextensible height~#1 \big@size axis~exact~#2
}
}
}