blob: cee4efba27e26eddc3229e8b0c96c3c6eb1f1186 (
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
|
%
% plcollcell.sty
% written by Hironobu Yamashita (@aminophen)
%
% This package is part of the plautopatch bundle.
% https://github.com/aminophen/plautopatch
%
% This package is expected to be compatible with
% * collcell.sty
% (2011/02/27 v0.5)
% * plarray.sty in platex-tools
% (2018/03/12 v0.1e -- 2018/10/27 v0.1h)
%
\NeedsTeXFormat{pLaTeX2e}
\ProvidesPackage{plcollcell}
[2020/05/05 v0.1 Tabular extension package for pLaTeX/upLaTeX]
\RequirePackageWithOptions{collcell}
\RequirePackage{plarray}% collcell.sty requires array.sty
%% code from plarray.sty (for pLaTeX2e 2018/03/09 or later)
\def\plclcl@insert@column{%
\the@toks \the \@tempcnta
\relax \pltx@next@inhibitglue
\ignorespaces \@sharp \unskip \removejfmglue
\the@toks \the \count@ \relax}
% -- check
\ifx\insert@column\plclcl@insert@column\else
\PackageWarningNoLine{pxcollcell}
{Patch to \noexpand\collectcell unsupported}
\expandafter\endinput
\fi \let\plclcl@insert@column\@undefined
%% \plclcl@patch@cmd\CMD{<orig>}{<new>}
\@onlypreamble\plclcl@patch@cmd
\def\plclcl@patch@cmd#1#2#3{%
\def\plclcl@next##1#2##2\plclcl@mark##3\plclcl@fin{%
\ifx\plclcl@mark##3\plclcl@mark
\let\plclcl@fragment\relax
\else
\def\plclcl@fragment{##2}%
\def#1{##1#3##2}%
\fi}%
\expandafter\plclcl@next#1\plclcl@mark#2\plclcl@mark\plclcl@fin}
% -- prepend (TODO: \kern0pt enables \inhibitglue effect. why?)
\plclcl@patch@cmd\collcell@beforeuser
{\ignorespaces}
{\kern0pt\inhibitglue\ignorespaces}
\ifx\plclcl@fragment\relax
\PackageWarningNoLine{pxcollcell}
{Patch to \noexpand\collcell@beforeuser failed}
\fi
%% code from collcell.sty
\def\plclcl@collectcell#1#2\ignorespaces{%
\begingroup
\collect@cell@count\z@
\collect@cell@toks{}%
\let\collect@cell@spaces\empty
\def\collect@cell@end{%
\expandafter\endgroup
\expandafter\collcell@beforeuser
\expandafter\ccell@swap\expandafter{\the\collect@cell@toks}{#1}%
\collcell@afteruser
}%
\collect@cell@look#2%
}
% -- check
\ifx\collectcell\plclcl@collectcell\else
\PackageWarningNoLine{pxcollcell}
{Patching \noexpand\collect@cell@arg but maybe unsafe}
\fi \let\plclcl@collectcell\@undefined
% -- redefine to skip \relax\pltx@next@inhibitglue
\def\collectcell#1#2\relax\pltx@next@inhibitglue\ignorespaces{%
\begingroup
\collect@cell@count\z@
\collect@cell@toks{}%
\let\collect@cell@spaces\empty
\def\collect@cell@end{%
\expandafter\endgroup
\expandafter\collcell@beforeuser
\expandafter\ccell@swap\expandafter{\the\collect@cell@toks}{#1}%
\collcell@afteruser
}%
\collect@cell@look#2%
}
%% code from collcell.sty
\def\plclcl@collect@cell@arg#1{%
\cc@case
\\{\collect@cell@cr#1}%
\end{\collect@cell@checkend}%
\csname{\collect@cell@checkcsname}%
\unskip{%
\let\collect@cell@spaces\empty
%\collect@cell@addarg{#1}% do not include the \unskip
\collect@cell@look%
}%
\@sharp{%
\expandafter\collect@cell@addarg\expandafter{#1}%
\collect@cell@look
}%
\collectcell{%
\advance\collect@cell@count by \@ne
\collect@cell@addcc%
}%
\endcollectcell{%
\ifnum\collect@cell@count=\z@
\expandafter\collect@cell@end
\else
\expandafter\endgroup
\expandafter\collect@cell@addarg\expandafter
{\expandafter{\the\collect@cell@toks}}%
\advance\collect@cell@count by \m@ne%
\expandafter\collect@cell@look
\fi
}%
\cci{%
\collect@cell@look
}%
\default{%
\expandafter\ccell@swap\expandafter
{\csname endtabular*\endcsname\endtabular\endarray}{\in@{#1}}%
\ifin@
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
{\collect@cell@cr\\#1}%
{%
\collect@cell@addarg{#1}%
\collect@cell@look
}%
}%
\endcc@case
}
% -- check
\ifx\collect@cell@arg\plclcl@collect@cell@arg\else
\PackageWarningNoLine{pxcollcell}
{Patching \noexpand\collect@cell@arg but maybe unsafe}
\fi \let\plclcl@collect@cell@arg\@undefined
% -- redefine to skip \removejfmglue
\def\collect@cell@arg#1{%
\cc@case
\\{\collect@cell@cr#1}%
\end{\collect@cell@checkend}%
\csname{\collect@cell@checkcsname}%
\unskip{%
\let\collect@cell@spaces\empty
%\collect@cell@addarg{#1}% do not include the \unskip
\collect@cell@look%
}%
\@sharp{%
\expandafter\collect@cell@addarg\expandafter{#1}%
\collect@cell@look
}%
\collectcell{%
\advance\collect@cell@count by \@ne
\collect@cell@addcc%
}%
\endcollectcell{%
\ifnum\collect@cell@count=\z@
\expandafter\collect@cell@end
\else
\expandafter\endgroup
\expandafter\collect@cell@addarg\expandafter
{\expandafter{\the\collect@cell@toks}}%
\advance\collect@cell@count by \m@ne%
\expandafter\collect@cell@look
\fi
}%
\cci{%
\collect@cell@look
}%
%%% BEGIN
\removejfmglue{%
\collect@cell@look
}%
%%% END
\default{%
\expandafter\ccell@swap\expandafter
{\csname endtabular*\endcsname\endtabular\endarray}{\in@{#1}}%
\ifin@
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
{\collect@cell@cr\\#1}%
{%
\collect@cell@addarg{#1}%
\collect@cell@look
}%
}%
\endcc@case
}
%% all done
\endinput
|