summaryrefslogtreecommitdiff
path: root/macros/luatex/generic/luatexja/src/patches/lltjp-array.sty
blob: fa5fe7b933914fc9db461991a69a3a3de4f22de1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
%
% 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