| 1 |
%% |
| 2 |
%% This is file `caption-koma.sto', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% caption-koma.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 |
\ProvidesFile{caption-koma.sto}[2023/09/08 v2.0e Adaption of the caption package to the KOMA-Script document classes (AR)] |
| 40 |
\expandafter\let\expandafter\caption@koma@setcapwidth |
| 41 |
\csname\string\setcapwidth\endcsname |
| 42 |
\@namedef{\string\setcapwidth}[#1]#2{% |
| 43 |
\caption@koma@setcapwidth[{#1}]{#2}% |
| 44 |
\caption@setcapwidth@opt{#1}% |
| 45 |
\caption@setcapwidth} |
| 46 |
\newcommand*\caption@setcapwidth@opt[1]{} |
| 47 |
\AtCaptionPackage{\renewcommand*\caption@setcapwidth@opt[1]{% |
| 48 |
\ifx\\#1\\\else |
| 49 |
\caption@ifdefined\cap@margin{% |
| 50 |
\def\@tempa{captionbeside}% |
| 51 |
\ifx\@tempa\@currenvir\else\caption@Warning{% |
| 52 |
Ignoring optional argument [#1] of \string\setcapwidth\MessageBreak}% |
| 53 |
\fi}{}% |
| 54 |
\fi}} |
| 55 |
\newcommand*\caption@setcapwidth{% |
| 56 |
\captionsetup{width=\cap@width}} |
| 57 |
\def\caption@tempa{\hsize}% |
| 58 |
\ifx\caption@tempa\cap@width \else |
| 59 |
\caption@setcapwidth |
| 60 |
\fi |
| 61 |
\expandafter\let\expandafter\caption@koma@setcapmargin |
| 62 |
\csname\string\@setcapmargin\endcsname |
| 63 |
\@namedef{\string\@setcapmargin}[#1]#2{% |
| 64 |
\caption@koma@setcapmargin[{#1}]{#2}% |
| 65 |
\caption@setcapmargin} |
| 66 |
\expandafter\let\expandafter\caption@koma@@setcapmargin |
| 67 |
\csname\string\@@setcapmargin\endcsname |
| 68 |
\@namedef{\string\@@setcapmargin}[#1]#2{% |
| 69 |
\caption@koma@@setcapmargin[{#1}]{#2}% |
| 70 |
\caption@setcapmargin} |
| 71 |
\newcommand*\caption@setcapmargin{% |
| 72 |
\begingroup |
| 73 |
\let\onelinecaptionsfalse\relax |
| 74 |
\def\@twoside{0}% |
| 75 |
\def\if@twoside{\def\@twoside{1}\iffalse}% |
| 76 |
\cap@margin |
| 77 |
\def\@tempa{\endgroup}% |
| 78 |
\ifx\cap@left\hfill\else\ifx\cap@right\hfill\else |
| 79 |
\def\hspace##1##{\@firstofone}% |
| 80 |
\edef\@tempa{\endgroup |
| 81 |
\noexpand\captionsetup{% |
| 82 |
twoside=\@twoside,slc=0,% |
| 83 |
margin={\cap@left,\cap@right}}}% |
| 84 |
\fi\fi |
| 85 |
\@tempa} |
| 86 |
\ifx\cap@margin\relax \else |
| 87 |
\caption@setcapmargin |
| 88 |
\fi |
| 89 |
\let\caption@koma@setcapindent\@setcapindent |
| 90 |
\renewcommand*\@setcapindent[1]{% |
| 91 |
\caption@koma@setcapindent{#1}% |
| 92 |
\caption@setcapindent} |
| 93 |
\let\caption@koma@@setcapindent\@@setcapindent |
| 94 |
\renewcommand*\@@setcapindent[1]{% |
| 95 |
\caption@koma@@setcapindent{#1}% |
| 96 |
\caption@setcapindent} |
| 97 |
\newcommand*\caption@setcapindent{% |
| 98 |
\captionsetup{indent=\ifdim\cap@indent<\z@\z@\else\cap@indent\fi}} |
| 99 |
\caption@ifdefined\cap@indent{\caption@setcapindent}{} |
| 100 |
\DeclareCaptionSinglelinecheck{koma}{% |
| 101 |
\ifonelinecaptions |
| 102 |
\expandafter\@firstoftwo |
| 103 |
\else |
| 104 |
\expandafter\@secondoftwo |
| 105 |
\fi} |
| 106 |
\SetCaptionDefault{singlelinecheck}{koma} |
| 107 |
\g@addto@macro\onelinecaptionstrue{\caption@setsinglelinecheck{koma}} |
| 108 |
\g@addto@macro\onelinecaptionsfalse{\caption@setsinglelinecheck{koma}} |
| 109 |
\DeclareCaptionFormat{koma}[#1#2#3\par]{% |
| 110 |
\ifdofullc@p |
| 111 |
\caption@useformat{hang}{#1}{#2}{#3}% |
| 112 |
\else |
| 113 |
#1#2% |
| 114 |
\ifdim\cap@indent<\z@ |
| 115 |
\par |
| 116 |
\noindent\hspace*{-\cap@indent}% |
| 117 |
\else\if@capbreak |
| 118 |
\par |
| 119 |
\fi\fi |
| 120 |
#3\par |
| 121 |
\fi} |
| 122 |
\SetCaptionDefault{format}{koma} |
| 123 |
\DeclareCaptionLabelFormat{koma}{\bothIfFirst{#1}{\nobreakspace}#2\autodot} |
| 124 |
\SetCaptionFallback{labelformat}{koma} |
| 125 |
\DeclareCaptionLabelSeparator{koma}{\captionformat} |
| 126 |
\SetCaptionDefault{labelseparator}{koma} |
| 127 |
\DeclareCaptionFont{scr@font}{\scr@fnt@caption} |
| 128 |
\DeclareCaptionFont{scr@labelfont}{\scr@fnt@captionlabel} |
| 129 |
\SetCaptionDefault{font}{scr@font} |
| 130 |
\SetCaptionDefault{labelfont}{scr@labelfont} |
| 131 |
\g@addto@macro\@captionabovetrue{\caption@setposition{t}}% |
| 132 |
\g@addto@macro\@captionabovefalse{\caption@setposition{b}}% |
| 133 |
\if@captionabove |
| 134 |
\@captionabovetrue |
| 135 |
\else |
| 136 |
\@captionabovefalse |
| 137 |
\fi |
| 138 |
\AfterCaptionPackage{\caption@AtBeginLongtable{% |
| 139 |
\def\@captionabovetrue{\LT@captionsetup{position=t}}% |
| 140 |
\def\@captionabovefalse{\LT@captionsetup{position=b}}}} |
| 141 |
\g@addto@macro\@tablecaptionabovetrue{\captionsetup*[table]{position=t}}% |
| 142 |
\g@addto@macro\@tablecaptionabovefalse{\captionsetup*[table]{position=b}}% |
| 143 |
\if@tablecaptionabove |
| 144 |
\@tablecaptionabovetrue |
| 145 |
\else |
| 146 |
\@tablecaptionabovefalse |
| 147 |
\fi |
| 148 |
\@ifundefined{@figurecaptionabovetrue}{}{% |
| 149 |
\g@addto@macro\@figurecaptionabovetrue{\captionsetup*[figure]{position=t}}% |
| 150 |
\g@addto@macro\@figurecaptionabovefalse{\captionsetup*[figure]{position=b}}% |
| 151 |
\if@figurecaptionabove |
| 152 |
\@figurecaptionabovetrue |
| 153 |
\else |
| 154 |
\@figurecaptionabovefalse |
| 155 |
\fi} |
| 156 |
\AtCaptionPackage{% |
| 157 |
\let\caption@koma@figureposition\KV@caption@figureposition |
| 158 |
\DeclareCaptionOption{figureposition}{% |
| 159 |
\caption@WarningNoLine{% |
| 160 |
Option `figureposition=#1' has no effect\MessageBreak |
| 161 |
when used with a KOMA-Script document class}% |
| 162 |
\caption@koma@figureposition{#1}} |
| 163 |
\let\caption@koma@tableposition\KV@caption@tableposition |
| 164 |
\DeclareCaptionOption{tableposition}{% |
| 165 |
\caption@WarningNoLine{% |
| 166 |
Option `tableposition=#1' has no effect\MessageBreak |
| 167 |
when used with a KOMA-Script document class}% |
| 168 |
\caption@koma@tableposition{#1}}} |
| 169 |
\AtBeginDocument{\let\scr@caption\caption} |
| 170 |
\endinput |
| 171 |
%% |
| 172 |
%% End of file `caption-koma.sto'. |