%
% lltjp-array.sty
%

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{lltjp-array}[2024-07-21 Patch to array for LuaTeX-ja]

\@ifpackageloaded{array}{\def\lltjp@array@array@loaded{1}}{\let\lltjp@array@array@loaded\relax}

\RequirePackage{etoolbox,array}

\patchcmd\insert@column{%
   \ignorespaces\@sharp\unskip
}{%
   \ltj@sharp
}{}{% >=2024-06-01
  \def\ltj@sharp{\relax\pltx@next@inhibitglue\ltjfakeboxbdd\ignorespaces\@sharp\textonly@unskip\ltjfakeboxbdd}
  \patchcmd\insert@column{%
     \ignorespaces\@sharp\textonly@unskip
  }{%
     \ltj@sharp
  }{}{}
}

\@ifpackageloaded{lltjext}{}{%
%% remove extra \xkanjiskip (pLaTeX2e 2016/04/17)
\ifnum0<0\lltjp@array@array@loaded
  \patchcmd{\@tabular}{\leavevmode}{\leavevmode\null}{}{}
  \patchcmd{\@tabular}{\leavevmode\null\null}{\leavevmode\null}{}{}
  \apptocmd{\endtabular}{\null}{}{}
  \let\lltjp@array@array@loaded\undefined
\fi
\expandafter \let \csname endtabular*\endcsname = \endtabular
}
\endinput
