Skip to content

Commit

Permalink
move array patch into array.sty
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer committed Jan 29, 2025
1 parent 63f5586 commit 0b587ca
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 110 deletions.
107 changes: 0 additions & 107 deletions required/latex-lab/latex-lab-math.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -955,118 +955,12 @@
% \begin{macrocode}
\sys_if_engine_luatex:TF
{
% \end{macrocode}
% Temporary (!) fixes for endarray, can be removed when array 2.6h is released.
% \begin{macrocode}
\socket_if_exist:nF {tagsupport/math/luamml/array/save}
{
\NewSocket{tagsupport/math/luamml/array/save}{0}
\NewSocket{tagsupport/math/luamml/array/finalize}{0}
\NewSocket{tagsupport/math/luamml/array/initcol}{0}
\NewSocket{tagsupport/math/luamml/array/savecol}{0}
\NewSocket{tagsupport/math/luamml/array/finalizecol}{1}
\AssignSocketPlug{tagsupport/math/luamml/array/finalizecol}{noop}
}
\cs_new_protected:Npn \@@_correct_luamml_array_patches:
{
\AddToHook{package/array/after}
{
\cs_set:Npn \endarray
{
\tbl_crcr:n{endarray}
\tag_socket_use_expandable:n { math/luamml/array/save }
\egroup
\UseTaggingSocket{tbl/finalize}
\tbl_restore_outer_cell_data:
\egroup
\tag_socket_use:n { math/luamml/array/finalize }
\@arrayright
\gdef \@preamble {}
}
\cs_set:Npn \@classz
{
\@classx
\@tempcnta \count@
\prepnext@tok
\@addtopreamble {
\ifcase \@chnum
\hfil
\hskip 1sp
\d@llarbegin
\cs_if_eq:NNTF \d@llarbegin \begingroup {
\insert@column
\d@llarend
} {
\tag_socket_use:n { math/luamml/array/initcol }
\insert@column
\tag_socket_use:n { math/luamml/array/savecol }
\d@llarend
\tag_socket_use:nn { math/luamml/array/finalizecol}{0}
}
\do@row@strut
\hfil
\or
\hskip 1sp
\d@llarbegin
\cs_if_eq:NNTF \d@llarbegin \begingroup {
\insert@column
\d@llarend
} {
\tag_socket_use:n { math/luamml/array/initcol }
\insert@column
\tag_socket_use:n { math/luamml/array/savecol }
\d@llarend
\tag_socket_use:nn { math/luamml/array/finalizecol}{1}
}
\do@row@strut
\hfil
\or
\hfil
\hskip 1sp
\d@llarbegin
\cs_if_eq:NNTF \d@llarbegin \begingroup {
\insert@column
\d@llarend
} {
\tag_socket_use:n { math/luamml/array/initcol }
\insert@column
\tag_socket_use:n { math/luamml/array/savecol }
\d@llarend
\tag_socket_use:nn { math/luamml/array/finalizecol}{2}
}
\do@row@strut
\or
\setbox \ar@mcellbox \vbox \@startpbox { \@nextchar }
\insert@pcolumn
\@endpbox
\ar@align@mcell
\do@row@strut
\or
\vtop \@startpbox { \@nextchar }
\insert@pcolumn
\@endpbox
\do@row@strut
\or
\vbox \@startpbox { \@nextchar }
\insert@pcolumn
\@endpbox
\do@row@strut
\fi
}
\prepnext@tok
}
}
}
% \end{macrocode}
%
% \begin{macrocode}
\AddToHook{begindocument/before}
{
\str_case:on \g_@@_luamml_load_tl
{
{ 1 } {
\RequirePackage { luamml }
\@@_correct_luamml_array_patches:
\AddToHook{begindocument/end}
{
\@@_luamml_activate_write:
Expand All @@ -1084,7 +978,6 @@
\@ifpackageloaded { unicode-math }
{
\RequirePackage { luamml }
\@@_correct_luamml_array_patches:
\AddToHook{begindocument/end}
{
\@@_luamml_activate_write:
Expand Down
30 changes: 28 additions & 2 deletions required/tools/array.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -1969,8 +1969,34 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% {Change both \cs{kern}\cs{z@} to \cs{hskip}1sp for latex/2160}
% \changes{v2.4e}{2016/10/07}{Fixing SX68732}
% \begin{macrocode}
\hskip1sp\d@llarbegin \insert@column \d@llarend \do@row@strut \hfil \or
\hfil\hskip1sp\d@llarbegin \insert@column \d@llarend \do@row@strut \or
\hskip1sp\d@llarbegin
\cs_if_eq:NNTF \d@llarbegin \begingroup
{
\insert@column
\d@llarend
}
{
\tag_socket_use:n { math/luamml/array/initcol }
\insert@column
\tag_socket_use:nn { math/luamml/save/nn }{{}{mtd}}
\d@llarend
\tag_socket_use:nn { math/luamml/array/finalizecol}{1}
}
\do@row@strut \hfil \or
\hfil\hskip1sp\d@llarbegin
\cs_if_eq:NNTF \d@llarbegin \begingroup
{
\insert@column
\d@llarend
}
{
\tag_socket_use:n { math/luamml/array/initcol }
\insert@column
\tag_socket_use:nn { math/luamml/save/nn }{{}{mtd}}
\d@llarend
\tag_socket_use:nn { math/luamml/array/finalizecol}{2}
}
\do@row@strut \or
% \end{macrocode}
% The templates for \texttt{p}, \texttt{m} and \texttt{b} mainly
% consist of a \textsf{box}. In case of \texttt{m} it is generated
Expand Down
1 change: 0 additions & 1 deletion texmf/tex/lualatex/luamml/luamml.sty
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@
\AssignSocketPlug{tagsupport/math/luamml/array/save}{luamml}
\AssignSocketPlug{tagsupport/math/luamml/array/finalize}{luamml}
\AssignSocketPlug{tagsupport/math/luamml/array/initcol}{luamml}
\AssignSocketPlug{tagsupport/math/luamml/array/savecol}{luamml}
\AssignSocketPlug{tagsupport/math/luamml/array/finalizecol}{luamml}
\str_if_exist:cF { l__socket_tagsupport/math/luamml/mtable/finalize_plug_str }
{
Expand Down

0 comments on commit 0b587ca

Please sign in to comment.