-
Notifications
You must be signed in to change notification settings - Fork 0
/
ltcaption.sty
executable file
·195 lines (195 loc) · 6.31 KB
/
ltcaption.sty
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
%%
%% This is file `ltcaption.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% ltcaption.dtx (with options: `package')
%%
%% Copyright (C) 1994-2012 Axel Sommerfeldt ([email protected])
%%
%% --------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
%%
%% This work has the LPPL maintenance status "maintained".
%%
%% This Current Maintainer of this work is Axel Sommerfeldt.
%%
%% This work consists of the files caption.ins, caption.dtx, caption2.dtx,
%% caption3.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx, and newfloat.dtx,
%% the derived files caption.sty, caption2.sty, caption3.sty,
%% bicaption.sty, ltcaption.sty, subcaption.sty, and newfloat.sty,
%% and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
%%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesPackage{ltcaption}[2011/09/12 v1.3 longtable captions (AR)]
\@ifpackageloaded{longtable}{}{%
\PackageError{ltcaption}{longtable package not loaded, aborting}{RTFM}}
\providecommand*\LTcaptype{table}
\providecommand*\ext@table{lot}
\@ifundefined{caption@AtBeginDocument}\AtBeginDocument\caption@AtBeginDocument{%
\@ifpackageloaded{listings}{%
\providecommand*\ext@lstlisting{lol}}{}}
\@ifpackageloaded{caption}{}{%
\newskip\LTcapskip \LTcapskip=\abovecaptionskip
\newskip\LTcapleft \LTcapleft=\fill
\newskip\LTcapright \LTcapright=\fill
\newif\ifLTcapmargins \LTcapmarginstrue
\providecommand*\CaptionLabelFont{}
\providecommand*\CaptionTextFont{}
\providecommand*\CaptionLabelSeparator{:}
}
\@ifundefined{caption@AtBeginDocument}\AtBeginDocument\caption@AtBeginDocument{%
\let\ltcaption@ORI@LT@array\LT@array
\renewcommand*\LT@array{%
\let\caption@LT@refstepcounter\refstepcounter
\def\refstepcounter{%
\caption@LTtype\caption@LT@refstepcounter}%
\let\caption@LT@Hrefstepcounter\H@refstepcounter
\def\H@refstepcounter{%
\caption@LTtype\caption@LT@Hrefstepcounter}%
\let\caption@LT@makecurrent\hyper@makecurrent
\def\hyper@makecurrent{%
\caption@LTtype\caption@LT@makecurrent}%
\def\lst@@caption{\relax}%
\ltcaption@ORI@LT@array}}
\newcommand*\caption@LTtype[2]{%
\edef\caption@LT@tempa{#2}%
\ifx\caption@LT@tempa\caption@LT@table
\caption@LT@type#1%
\else
#1{#2}%
\fi}%
\newcommand*\caption@LT@type[1]{%
\expandafter#1\expandafter{\LTcaptype}}
\newcommand*\caption@LT@table{table}%
\long\def\LT@c@ption#1[#2]#3{%
\LT@makecaption#1{\csname fnum@\LTcaptype\endcsname}{#3}%
\def\@tempa{#2}%
\ifx\@tempa\@empty\else
{\let\\\space
\addcontentsline{\csname ext@\LTcaptype\endcsname}{\LTcaptype}%
{\protect\numberline{\csname the\LTcaptype\endcsname}{#2}}}%
\fi
\ignorespaces}
\renewcommand\LT@makecaption[3]{%
\LT@@makecaption{%
\sbox\@tempboxa{%
#1{{\CaptionLabelFont#2\CaptionLabelSeparator} }\CaptionTextFont#3}%
\ifdim\wd\@tempboxa>\hsize
#1{{\CaptionLabelFont#2\CaptionLabelSeparator} }\CaptionTextFont#3%
\else
\hbox to\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\endgraf\vskip\LTcapskip}}
\newcommand\LT@@makecaption[1]{%
\caption@LT@make{\hb@xt@\hsize{%
\ifLTcapmargins
\hspace\LTcapleft
\FBifLTcapwidth{\advance\LTcapwidth-\LTcapleft}%
\else
\hspace\LTleft
\FBifLTcapwidth{\advance\LTcapwidth-\LTleft}%
\fi
\FBifLTcapwidth{\advance\LTcapwidth-%
\ifLTcapmargins\LTcapright\else\LTright\fi}%
\parbox[t]\LTcapwidth{#1}%
\ifLTcapmargins
\hskip\LTcapright
\else
\hskip\LTright
\fi}}}
\AtBeginDocument{\providecommand*\FBifLTcapwidth[1]{}}
\newcommand\caption@LT@make[1]{%
\noalign{\caption@LT@config}%
\expandafter\LT@mcol\expandafter\LT@cols\expandafter{\caption@LTfmt}{%
\hb@xt@\z@{%
\hspace\caption@LTleft
\parbox[t]\linewidth{#1}%
\hspace\caption@LTright}}}%
\newcommand*\caption@LT@config{%
\caption@LT@parse\LTleft\caption@LTleft\caption@ifLTleft
\caption@LT@parse\LTright\caption@LTright\caption@ifLTright
\xdef\caption@LTfmt{%
@{}\caption@ifLTleft{\caption@ifLTright{c}{r}}{l}@{}}}
\newcommand*\caption@LT@parse[3]{%
\let\@pluspart\@undefined
\let\@minuspart\@undefined
\expandafter\caption@LT@parse@\expandafter\@fixpart\the#1 x %
\xdef#2{-\@fixpart
\ifx\@minuspart\@undefined\else
\space\@plus\space\@minuspart
\fi
\ifx\@pluspart\@undefined\else
\space\@minus\space\@pluspart
\fi}%
\let#3\@firstoftwo
\ifx\@pluspart\@undefined
\ifx\@minuspart\@undefined
\let#3\@secondoftwo
\fi
\fi}
\def\caption@LT@parse@#1#2 {%
\edef\@tempa{\@car#2\@nil}%
\if p\@tempa
\def\next{\caption@LT@parse@\@pluspart}%
\else\if m\@tempa
\def\next{\caption@LT@parse@\@minuspart}%
\else\if x\@tempa
\let\next\relax
\else
\def#1{#2}%
\def\next{\caption@LT@parse@ @}%
\fi\fi\fi
\next}
\newenvironment{longtable*}{%
\let\caption@LT@type\@gobble
\let\caption@LT@raisedlink\Hy@raisedlink
\def\Hy@raisedlink{%
\let\Hy@raisedlink\caption@LT@raisedlink
\@gobble}%
\let\ltcaption@ORI@LT@c@ption\LT@c@ption
\def\LT@c@ption##1[##2]##3{%
\ifx##1\@firstofone
\PackageError{ltcaption}%
{Not allowed in longtable* environment}%
{If you do not understand this error, please take a closer
look\MessageBreak at the documentation of the `ltcaption'
package.\MessageBreak \@ehc}%
\else
\ltcaption@ORI@LT@c@ption{##1}[{##2}]{##3}%
\fi}%
\longtable}%
{\endlongtable}
\@ifundefined{@komalongtablefalse}{}{%
\if@komalongtable
\renewcommand{\LT@makecaption}[3]{%
\noalign{%
\if@captionabove
\vskip\belowcaptionskip
\else
\vskip\abovecaptionskip
\fi
}%
\caption@LT@make{%
\@@makecaption{#1}{#2}{#3}%
\endgraf
\if@captionabove
\vskip\abovecaptionskip
\else
\vskip\belowcaptionskip
\fi
}%
}%
\let\LT@@makecaption\@undefined
\fi}
\endinput
%%
%% End of file `ltcaption.sty'.