summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/plautopatch/plextarydshln.sty
blob: ac0059c5e46669747e2dc61ee04b73ceb5f12541 (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
%
% plextarydshln.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
%   * arydshln.sty
%     (2004/08/31 v1.71 -- 2019/02/21 v1.76)
%   * plext.sty in platex
%     (2001/09/26 v1.2  -- 2018/10/07 v1.2k)
%

%% package declaration
\NeedsTeXFormat{pLaTeX2e}
\ProvidesPackage{plextarydshln}
  [2018/10/20 v0.4 Merge plext and arydshln]
\RequirePackage{plext}
\RequirePackage{plarydshln}

%% handle package compatibility issues beforehand
%  Note: The "arydshln" manual requests users to load
%        the following packages *before* arydshln,
%        to ensure compatibility:
%          array, longtable, colortab, colortbl.
%        So, hoping that users are clever enough to load
%        them before plextarydshln, load known patches
%        at this point when they are detected.
\@ifpackageloaded{array}{\RequirePackage{plextarray}}{}
\@ifpackageloaded{colortbl}{\RequirePackage{plextcolortbl}}{}
%  Note: The following package is not necessarily loaded
%        before arydshln; but handle the incompatibility
%        if loaded before plextarydshln.
\@ifpackageloaded{delarray}{\RequirePackage{plextdelarray}}{}

%% patching internal code for arydshln.sty and plext.sty
%
\let\adl@p@array\p@array
\def\p@array{\adl@everyvbox\everyvbox
        \everyvbox{\adl@arrayinit \the\adl@everyvbox \everyvbox\adl@everyvbox}%
        \ifadl@inactive \adl@inactivate \else \adl@activate \fi
        \let\adl@noalign\noalign
        \adl@p@array}
\def\endarray{\adl@endarray \egroup \adl@arrayrestore \egroup
   \@end@alignbox \csname @arrayright\endcsname}
%
%% done

%% compatibility with colortbl.sty
%
\@ifpackageloaded{colortbl}{\@firstofone}{\@gobble}
{% = colortbl.sty loaded
\def\endarray{\adl@endarray \egroup \adl@arrayrestore \CT@end \egroup
   \@end@alignbox \csname @arrayright\endcsname}%
}% =
%
%% done

\endinput