| 1 |
%% |
| 2 |
%% This is file `subcaption.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% subcaption.dtx (with options: `package') |
| 8 |
%% |
| 9 |
%% Copyright (C) 1994-2023 Axel Sommerfeldt ([email protected]) |
| 10 |
%% |
| 11 |
%% https://gitlab.com/axelsommerfeldt/caption |
| 12 |
%% |
| 13 |
%% -------------------------------------------------------------------------- |
| 14 |
%% |
| 15 |
%% This work may be distributed and/or modified under the |
| 16 |
%% conditions of the LaTeX Project Public License, either version 1.3 |
| 17 |
%% of this license or (at your option) any later version. |
| 18 |
%% The latest version of this license is in |
| 19 |
%% http://www.latex-project.org/lppl.txt |
| 20 |
%% and version 1.3 or later is part of all distributions of LaTeX |
| 21 |
%% version 2003/12/01 or later. |
| 22 |
%% |
| 23 |
%% This work has the LPPL maintenance status "maintained". |
| 24 |
%% |
| 25 |
%% This Current Maintainer of this work is Axel Sommerfeldt. |
| 26 |
%% |
| 27 |
%% This work consists of the files |
| 28 |
%% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx, |
| 29 |
%% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx, |
| 30 |
%% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx, |
| 31 |
%% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx, |
| 32 |
%% the derived files |
| 33 |
%% caption.sty, caption-light.sty, caption2.sty, caption3.sty, |
| 34 |
%% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto, |
| 35 |
%% caption-koma.sto, caption-memoir.sto, caption-ntg.sto, |
| 36 |
%% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty. |
| 37 |
%% |
| 38 |
\NeedsTeXFormat{LaTeX2e}[1994/12/01] |
| 39 |
\providecommand\DeclareRelease[3]{} |
| 40 |
\providecommand\DeclareCurrentRelease[2]{} |
| 41 |
\DeclareCurrentRelease{v1}{2007/12/06} |
| 42 |
\ProvidesPackage{subcaption}[2023/07/28 v1.6b Sub-captions (AR)] |
| 43 |
\RequirePackage{caption}[2010/01/09] % we need at least v3.1m |
| 44 |
\newcommand*\subcaption@Info{% |
| 45 |
\PackageInfo{subcaption}} |
| 46 |
\newcommand*\subcaption@Warning{% |
| 47 |
\PackageWarning{subcaption}} |
| 48 |
\newcommand*\subcaption@Error[1]{% |
| 49 |
\PackageError{subcaption}{#1}{\caption@@eh{subcaption}}} |
| 50 |
\providecommand*\caption@@eh[1]{% |
| 51 |
If you do not understand this error, please take a closer look\MessageBreak |
| 52 |
at the documentation of the `#1' package, especially the\MessageBreak |
| 53 |
section about errors.\MessageBreak\@ehc} |
| 54 |
\newcommand*\subcaption@OutsideFloat[1]{% |
| 55 |
\subcaption@Error{\string#1 outside float}} |
| 56 |
\providecommand\setcaptionsubtype{% |
| 57 |
\caption@iftype |
| 58 |
{\@ifstar{\captionsetup{subtype*}}{\captionsetup{subtype}}}% |
| 59 |
{\subcaption@OutsideFloat\setcaptionsubtype}} |
| 60 |
\newenvironment{subcaptiongroup} |
| 61 |
{\caption@iftype |
| 62 |
{\setcaptionsubtype\relax}% |
| 63 |
{\subcaption@OutsideFloat{subcaptiongroup}}} |
| 64 |
{} |
| 65 |
\newenvironment{subcaptiongroup*} |
| 66 |
{\caption@iftype |
| 67 |
{\setcaptionsubtype*}% |
| 68 |
{\subcaption@OutsideFloat{subcaptiongroup*}}} |
| 69 |
{} |
| 70 |
\newcommand*\subcaption@minipage{% |
| 71 |
\kernel@ifnextchar[%] |
| 72 |
\subcaption@iminipage |
| 73 |
{\caption@ifcaption{\subcaption@iminipage[t]}{\subcaption@iminipage[b]}}} |
| 74 |
\def\subcaption@iminipage[#1]{% |
| 75 |
\def\subcaption@tempa{\subcaption@iiminipage{#1}}% |
| 76 |
\caption@withoptargs\subcaption@tempa} |
| 77 |
\newcommand*\subcaption@iiminipage[3]{% |
| 78 |
\let\subcaption@endminipage@hook\@empty |
| 79 |
\if#1B% |
| 80 |
\minipage[b]#2{#3}% |
| 81 |
\def\subcaption@endminipage@hook{\vspace{0pt}}% |
| 82 |
\else\if#1T% |
| 83 |
\minipage[t]#2{#3}% |
| 84 |
\vspace{0pt}% |
| 85 |
\else |
| 86 |
\minipage[#1]#2{#3}% |
| 87 |
\fi\fi |
| 88 |
\@subfloatboxreset |
| 89 |
\setcaptionsubtype\relax} |
| 90 |
\newcommand*\subcaption@endminipage{% |
| 91 |
\subcaption@endminipage@hook |
| 92 |
\endminipage} |
| 93 |
\providecommand*\@subfloatboxreset{} |
| 94 |
\providecommand*\caption@ifcaption{\caption@ifflag2} % caption >= v3.3 < v3.6 |
| 95 |
\providecommand*\caption@ifflag[1]{\@secondoftwo} % caption < v3.3 |
| 96 |
\newenvironment{subcaptionblock}{\subcaption@minipage}{\subcaption@endminipage} |
| 97 |
\newcommand*\subcaption@newminipage[1]{% |
| 98 |
\newenvironment{#1}{\subcaption@minipage@{#1}}{\subcaption@endminipage}} |
| 99 |
\newcommand*\subcaption@minipage@[1]{% |
| 100 |
\caption@iftype |
| 101 |
{\edef\caption@tempa{#1}% |
| 102 |
\edef\caption@tempb{sub\@captype}% |
| 103 |
\ifx\caption@tempa\caption@tempb \else |
| 104 |
\subcaption@Warning{% |
| 105 |
`\caption@tempa' is treated as `\caption@tempb'\MessageBreak}% |
| 106 |
\fi}% |
| 107 |
{\subcaption@OutsideFloat{#1}}% |
| 108 |
\subcaption@minipage} |
| 109 |
\@ifundefined{ForEachCaptionSubType} % caption3 v1.13 |
| 110 |
{\caption@For{subtypelist}{\subcaption@newminipage{sub#1}}} |
| 111 |
{\ForEachCaptionSubType{\subcaption@newminipage{#1}}} |
| 112 |
\@ifundefined{caption@ibox}{% |
| 113 |
\newcommand*\subcaptionbox{% caption v3.1 |
| 114 |
\def\subcaption@tempa{\caption@ibox\setcaptionsubtype\relax}% |
| 115 |
\caption@withoptargs\subcaption@tempa} |
| 116 |
\newcommand\caption@ibox[3]{% |
| 117 |
\kernel@ifnextchar[%] |
| 118 |
{\caption@iibox{#1}{#2}{#3}}% |
| 119 |
{\caption@iibox@{#1}{#2}{#3}}} |
| 120 |
\long\def\caption@iibox#1#2#3[#4]{% |
| 121 |
\@testopt{\caption@iiibox{#1}{#2}{#3}[{#4}]}\captionbox@innerpos@default} |
| 122 |
\long\def\caption@iibox@#1#2#3#4{% |
| 123 |
\setbox\@tempboxa\hbox{#4}% |
| 124 |
\caption@iiibox{#1}{#2}{#3}% |
| 125 |
[\wd\@tempboxa]% |
| 126 |
[\captionbox@innerpos@default]% |
| 127 |
{\unhbox\@tempboxa}} |
| 128 |
\long\def\caption@iiibox#1{% |
| 129 |
\caption@iiiibox{#1}\vbox\vtop} |
| 130 |
\long\def\caption@iiiibox#1#2#3#4#5[#6][#7]#8{% |
| 131 |
\@ifundefined{caption@hj@#7}% |
| 132 |
{\subcaption@Error{Undefined justification `#7'}\@gobble}% |
| 133 |
{\@firstofone}% |
| 134 |
{\begingroup |
| 135 |
#1*% set \caption@position so \caption@iftop expands correctly |
| 136 |
\caption@iftop{% |
| 137 |
\endgroup |
| 138 |
\parbox[t]{#6}{% |
| 139 |
#1\relax |
| 140 |
\caption@setposition t% |
| 141 |
#2{\caption#4{#5}}% |
| 142 |
\captionbox@hrule |
| 143 |
\csname caption@hj@#7\endcsname |
| 144 |
#8}% |
| 145 |
}{% |
| 146 |
\endgroup |
| 147 |
\parbox[b]{#6}{% |
| 148 |
#1\relax |
| 149 |
\caption@setposition b% |
| 150 |
\csname caption@hj@#7\endcsname |
| 151 |
#8% |
| 152 |
\captionbox@hrule |
| 153 |
#3{\caption#4{#5}}}% |
| 154 |
}}} |
| 155 |
\newcommand*\captionbox@innerpos@default{c} |
| 156 |
\newcommand*\captionbox@hrule{\hrule\@height\z@\relax} |
| 157 |
\providecommand*\caption@hj@c{\centering} |
| 158 |
\providecommand*\caption@hj@l{\raggedright} |
| 159 |
\providecommand*\caption@hj@r{\raggedleft} |
| 160 |
\providecommand*\caption@hj@s{} |
| 161 |
}{\@ifundefined{caption@iiibox}{% |
| 162 |
\newcommand*\subcaptionbox{% caption v3.2 |
| 163 |
\def\captionbox@type{subtype}% |
| 164 |
\let\captionbox@settype\setcaptionsubtype |
| 165 |
\caption@withoptargs\caption@box} |
| 166 |
}{% |
| 167 |
\newcommand*\subcaptionbox{% caption >= v3.3 |
| 168 |
\caption@withoptargs{\caption@ibox\setcaptionsubtype}} |
| 169 |
}} |
| 170 |
\g@addto@macro\caption@subtypehook{% |
| 171 |
\ifx\label\subcaption@label \else |
| 172 |
\let\subcaption@ORI@label\label |
| 173 |
\let\label\subcaption@label |
| 174 |
\fi} |
| 175 |
\newcommand*\subcaption@label{% |
| 176 |
\caption@withoptargs\subcaption@@label} |
| 177 |
\newcommand*\subcaption@@label[2]{% |
| 178 |
\@bsphack\begingroup |
| 179 |
\let\@bsphack\relax |
| 180 |
\let\@esphack\relax |
| 181 |
\subcaption@ORI@label#1{#2}% |
| 182 |
\subcaption@prepare@label |
| 183 |
\protected@edef\@currentlabel{\csname thesub\@captype\endcsname}% |
| 184 |
\subcaption@ORI@label{sub@#2}% |
| 185 |
\endgroup\@esphack} |
| 186 |
\newcommand*\subcaption@prepare@label{% |
| 187 |
\let\SK@\@gobbletwo |
| 188 |
\def\SL@showlabels##1{\@nameuse{SL@orig##1}}} |
| 189 |
\DeclareRobustCommand*\subref{% |
| 190 |
\@ifstar |
| 191 |
{\caption@withoptargs\subcaption@ref*}% |
| 192 |
{\caption@withoptargs\@subref}} |
| 193 |
\newcommand*\@subref[2]{% |
| 194 |
\@ifundefined{hyperref}% |
| 195 |
{\subcaption@ref{#1}{#2}}% |
| 196 |
{\hyperref[{#2}]{\subcaption@ref{*#1}{#2}}}} |
| 197 |
\newcommand*\subcaption@ref[2]{% |
| 198 |
\begingroup |
| 199 |
\caption@setoptions{sub}% |
| 200 |
\subcaption@reffmt\p@subref{\ref#1{sub@#2}}% |
| 201 |
\endgroup} |
| 202 |
\newcommand*\p@subref{} |
| 203 |
\DeclareCaptionOption{subrefformat}{\subcaption@setrefformat{#1}} |
| 204 |
\newcommand*\subcaption@setrefformat[1]{% |
| 205 |
\@ifundefined{caption@labelformat@#1}% caption3 v2.x |
| 206 |
{\@ifundefined{caption@lfmt@#1}% caption3 v1.x |
| 207 |
{\@ifundefined{caption@subreffmt@#1}{\subcaption@Error{Undefined label format `#1'}}{}}% |
| 208 |
{\expandafter\let\expandafter\subcaption@reffmt\csname caption@lfmt@#1\endcsname}}% |
| 209 |
{\expandafter\let\expandafter\subcaption@reffmt\csname caption@labelformat@#1\endcsname}% |
| 210 |
\@ifundefined{caption@subreffmt@#1}{}{\caption@setsubrefformat{#1}}} % subfig v1.3 |
| 211 |
\subcaption@setrefformat{simple} |
| 212 |
\DeclareCaptionLabelFormat{subsimple}{#2} |
| 213 |
\DeclareCaptionLabelFormat{subparens}{(#2)} |
| 214 |
\let\caption@setkeys@ORI\caption@setkeys |
| 215 |
\@ifundefined{caption@SetupOptions} % caption3 v1.3 |
| 216 |
{\renewcommand\caption@setkeys[2]{\captionsetup[sub]{#2}}} |
| 217 |
{\caption@SetupOptions{subcaption}{\captionsetup[sub]{#2}}} |
| 218 |
\@ifundefined{caption@smaller} % caption3 v1.7-169 |
| 219 |
{\caption@ExecuteOptions{subcaption}{% |
| 220 |
font+=small,labelformat=parens,labelsep=space,skip=6pt,list=0,hypcap=0}} |
| 221 |
{\caption@ExecuteOptions{subcaption}{% |
| 222 |
font+=smaller,labelformat=parens,labelsep=space,skip=6pt,list=0,hypcap=0}} |
| 223 |
\caption@ProcessOptions*{subcaption} |
| 224 |
\let\caption@setkeys\caption@setkeys@ORI |
| 225 |
\let\caption@setkeys@ORI\@undefined |
| 226 |
\newcommand*\subcaption@DeclareType[1]{% |
| 227 |
\@ifundefined{c@sub#1}% |
| 228 |
{\DeclareCaptionSubType{#1}}% |
| 229 |
{\caption@subtypesource\caption@subtype@source{sub#1}% |
| 230 |
\subcaption@Info{The counter `sub#1' was already defined by\MessageBreak\caption@subtype@source}}} |
| 231 |
\providecommand*\caption@subtypesource[2]{\def#1{a different package}} % caption3 v2.4 |
| 232 |
\@ifundefined{ForEachCaptionType} % caption3 v1.13 |
| 233 |
{\@ifundefined{caption@ForEachType} % caption3 v1.4a |
| 234 |
{\@ifundefined{c@figure}{}{\subcaption@DeclareType{figure}}% |
| 235 |
\@ifundefined{c@table}{}{\subcaption@DeclareType{table}}% |
| 236 |
\caption@For{typelist}{\subcaption@DeclareType{#1}}} |
| 237 |
{\caption@ForEachType{\subcaption@DeclareType{#1}}}} |
| 238 |
{\ForEachCaptionType{\subcaption@DeclareType{#1}}} |
| 239 |
\newcommand*\subcaption@newabbreviation[3]{% |
| 240 |
\newcommand*{#1}{% |
| 241 |
\caption@iftype |
| 242 |
{\setcaptionsubtype*#2}% |
| 243 |
{\subcaption@OutsideFloat#1#3}}% |
| 244 |
\g@addto@macro\caption@subtypehook{\let#1#2}}% needed for caption < 3.6 |
| 245 |
\@onlypreamble\subcaption@newabbreviation |
| 246 |
\@ifundefined{caption@gobble}{% |
| 247 |
\DeclareRobustCommand*\caption@gobble{% caption3 < v1.4 |
| 248 |
\caption@withoptargs\@gobbletwo}% |
| 249 |
}{} |
| 250 |
\@ifclassloaded{memoir}{\let\subcaption\undefined}{} |
| 251 |
\subcaption@newabbreviation\subcaption\caption\caption@gobble |
| 252 |
\subcaption@newabbreviation\phantomsubcaption\phantomcaption\relax |
| 253 |
\subcaption@newabbreviation\subcaptionlistentry\captionlistentry\caption@gobble |
| 254 |
\subcaption@newabbreviation\subcaptiontext\captiontext\caption@gobble |
| 255 |
\providecommand*\caption@subfloatrow@hook{} % caption < v3.7 |
| 256 |
\g@addto@macro\caption@subfloatrow@hook{% |
| 257 |
\let\caption\subcaption |
| 258 |
\let\phantomcaption\phantomsubcaption |
| 259 |
\let\captionlistentry\subcaptionlistentry |
| 260 |
\let\captiontext\subcaptiontext} |
| 261 |
\caption@AtBeginDocument{% |
| 262 |
\begingroup |
| 263 |
\newenvironment{subcaption@memoir@subfloat}{}{}% |
| 264 |
\ifx\subfloat\subcaption@memoir@subfloat |
| 265 |
\endgroup |
| 266 |
% "subfloat" = empty environment, defined by memoir |
| 267 |
\renewcommand*\subfloat{% |
| 268 |
\def\subcaption@currenvir{subfloat}% |
| 269 |
\ifx\@currenvir\subcaption@currenvir |
| 270 |
% emulate (empty) subfloat environment |
| 271 |
\else |
| 272 |
\expandafter\subcaption@subfloat |
| 273 |
\fi}% |
| 274 |
\else |
| 275 |
\endgroup |
| 276 |
\providecommand*\subfloat{\subcaption@subfloat}% |
| 277 |
\fi} |
| 278 |
\newcommand*\subcaption@subfloat{% |
| 279 |
\kernel@ifnextchar[%] |
| 280 |
\subcaption@@subfloat |
| 281 |
\subcaption@subfloat@} |
| 282 |
\long\def\subcaption@@subfloat[#1]{% |
| 283 |
\kernel@ifnextchar[%] |
| 284 |
{\subcaption@@@subfloat{#1}}% |
| 285 |
{\subcaption@@subfloat@\subcaptionbox{#1}}} |
| 286 |
\long\def\subcaption@@@subfloat#1[#2]{% |
| 287 |
\subcaption@@subfloat@{\subcaptionbox[{#1}]}{#2}} |
| 288 |
\long\def\subcaption@@subfloat@#1#2#3{% |
| 289 |
\subcaption@getlabel{#3}% |
| 290 |
#1{#2\caption@thelabel}{\let\label\caption@gobble#3}% |
| 291 |
\subcaption@clrlabel |
| 292 |
\ignorespaces} |
| 293 |
\def\subcaption@subfloat@#1{% |
| 294 |
\setbox\@tempboxa\hbox{#1}% |
| 295 |
\caption@iiiibox |
| 296 |
\setcaptionsubtype |
| 297 |
{\phantomcaption\@gobble}{\phantomcaption\@gobble}% no box with \caption |
| 298 |
{}% no optional arguments for \caption |
| 299 |
{}% no sub-caption |
| 300 |
[\wd\@tempboxa][\captionbox@innerpos@default]% |
| 301 |
{\unhbox\@tempboxa}% |
| 302 |
\ignorespaces} |
| 303 |
\@ifundefined{caption@getlabel}{% |
| 304 |
\newcommand\subcaption@getlabel[1]{% caption3 < v1.7 |
| 305 |
\subcaption@Error{\noexpand\subfloat needs at least caption v3.4}% |
| 306 |
\let\caption@thelabel\relax} |
| 307 |
}{\@ifundefined{caption@@@@getlabel}{% |
| 308 |
\newcommand\subcaption@getlabel[1]{% caption3 >= v1.7 |
| 309 |
\caption@getlabel#1\label{}\@nil} |
| 310 |
}{% |
| 311 |
\newcommand*\subcaption@getlabel{% caption3 >= v2.0 |
| 312 |
\caption@getlabel} |
| 313 |
}} |
| 314 |
\@ifundefined{caption@clrlabel}{% |
| 315 |
\newcommand*\subcaption@clrlabel{\let\caption@thelabel\relax} % caption3 < v2.3 |
| 316 |
}{% |
| 317 |
\newcommand*\subcaption@clrlabel{\caption@clrlabel} % caption3 >= v2.3 |
| 318 |
} |
| 319 |
\endinput |
| 320 |
%% |
| 321 |
%% End of file `subcaption.sty'. |