summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/caption/caption-light.sty
blob: bf5300291a93a7dea1dcef6be581c8c8d6a6d779 (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
%%
%% This is file `caption-light.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% caption-light.dtx  (with options: `package')
%% 
%% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
%% 
%% https://gitlab.com/axelsommerfeldt/caption
%% 
%% --------------------------------------------------------------------------
%% 
%% 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, caption-light.dtx, caption2.dtx, caption3.dtx,
%%   caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
%%   caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
%%   caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
%% the derived files
%%   caption.sty, caption-light.sty, caption2.sty, caption3.sty,
%%   caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
%%   caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
%%   caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
%% and the user manuals
%%   caption-deu.tex, caption-eng.tex, caption-rus.tex.
%% 
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesPackage{caption-light}[2020/08/24 v1.0 Customizing captions (AR)]
\RequirePackage{caption3}[2020/08/23] % needs v2.0 or newer
\caption@ifbool{documentclass}{}{%
  \caption@WarningNoLine{%
    Unknown document class (or package),\MessageBreak
    standard defaults will be used}}
\@ifpackageloaded{caption2}{%
  \caption@Error{%
    You can't use both, the (obsolete) caption2 *and*\MessageBreak
    the caption-light package}%
  \endinput
}{}
\caption@SetupOptions{caption-light}{\caption@setkeys{caption}{#2}}
\caption@ProcessOptions*{caption-light}
\caption@ifdefined\caption@makecaption
  {\caption@Info{\noexpand\caption@makecaption is already defined}%
   \endinput}{}
\long\def\caption@makecaption#1#2{%
  \caption@iftop\caption@belowskip\caption@aboveskip
  \caption@labelseparator % defines \caption@iflabelfont and \caption@labelsep
  \caption@singlelinecheck
    {\sbox\@tempboxa{\caption@@makecaption{#1}{#2}}%
     \ifdim \wd\@tempboxa >\hsize}%
    {\iftrue}%
    \caption@@makecaption{#1}{#2}\par
  \else
    \global \@minipagefalse
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \caption@iftop\caption@aboveskip\caption@belowskip}
\newcommand\caption@@makecaption[2]{%
  \caption@applyfont
  {\captionlabelfont #1}%
  {\caption@iflabelfont\captionlabelfont
   \relax\caption@labelsep}%
  {\captiontextfont #2}}
\let\@makecaption\caption@makecaption
\caption@AtBeginDocument{%
  \DeclareCaptionOption{type}{\setcaptiontype{#1}}%
  \DeclareCaptionOption{type*}{\setcaptiontype*{#1}}%
}
\newcommand*\setcaptiontype{%
  \caption@teststar{\def\@captype}{}{}}
\caption@AtBeginDocument{%
  \def\captionof{\caption@teststar\caption@of{\caption*}\caption}}
\newcommand*\caption@of[2]{\setcaptiontype*{#2}#1}
\endinput
%%
%% End of file `caption-light.sty'.