summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/oberdiek/pdfcolfoot.sty
blob: 473058524dea4a665008bad62d0a2a6353e0c337 (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
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
%%
%% This is file `pdfcolfoot.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% pdfcolfoot.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Project: pdfcolfoot
%% Version: 2016/05/16 v1.3
%% 
%% Copyright (C) 2007, 2012 by
%%    Heiko Oberdiek <heiko.oberdiek at googlemail.com>
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
%% version. This version of this license is in
%%    https://www.latex-project.org/lppl/lppl-1-3c.txt
%% and the latest version of this license is in
%%    https://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status "maintained".
%% 
%% The Current Maintainers of this work are
%% Heiko Oberdiek and the Oberdiek Package Support Group
%% https://github.com/ho-tex/oberdiek/issues
%% 
%% 
%% This work consists of the main source file pdfcolfoot.dtx
%% and the derived files
%%    pdfcolfoot.sty, pdfcolfoot.pdf, pdfcolfoot.ins, pdfcolfoot.drv,
%%    pdfcolfoot-test1.tex.
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{pdfcolfoot}%
  [2016/05/16 v1.3 Color stack for footnotes with pdfTeX (HO)]%
\RequirePackage{pdfcol}[2007/09/09]
\ifpdfcolAvailable
\else
  \PackageInfo{pdfcolfoot}{%
    Loading aborted, because color stacks are not available%
  }%
  \expandafter\endinput
\fi
\pdfcolInitStack{foot}
\newcommand*{\pdfcolfoot@switch}{%
  \pdfcolSwitchStack{foot}%
}
\AtBeginDocument{%
  \newcommand*{\pdfcolfoot@makefntext}{}%
  \let\pdfcolfoot@makefntext\@makefntext
  \renewcommand{\@makefntext}[1]{%
    \pdfcolfoot@makefntext{%
      \if@minipage
      \else
        \pdfcolfoot@switch
      \fi
      #1%
    }%
  }%
}
\newcommand*{\pdfcolfoot@current}{%
  \pdfcolSetCurrent{foot}%
}
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname detokenize\endcsname\relax
  \PackageWarningNoLine{pdfcolfoot}{%
    Missing e-TeX for patching \string\@makecol
  }%
  \expandafter\endinput
\fi
\newif\ifPCF@result
\def\pdfcolfoot@patch#1{%
  \ifx#1\@undefined
  \else
    \ifx#1\relax
    \else
      \begingroup
        \toks@{}%
        \let\on@line\@empty
        \expandafter\PCF@CheckPatched
            \detokenize\expandafter{#1pdfcolfoot@current}\@nil
        \ifPCF@result
          \PackageInfo{pdfcolfoot}{\string#1\space is already patched}%
        \else
          \expandafter\PCF@CanPatch
            \detokenize\expandafter{%
              #1\setbox\@outputbox\vbox{\footnoterule}%
            }%
            \@nil
          \ifPCF@result
            \PackageInfo{pdfcolfoot}{\string#1 is being patched}%
            \expandafter\PCF@PatchA#1\PCF@nil#1%
          \else
            \PackageInfo{pdfcolfoot}{%
              \string#1\space cannot be patched%
            }%
          \fi
        \fi
      \expandafter\endgroup
      \the\toks@
    \fi
  \fi
}
\expandafter\def\expandafter\PCF@CheckPatched
    \expandafter#\expandafter1\detokenize{pdfcolfoot@current}#2\@nil{%
  \ifx\\#2\\%
    \PCF@resultfalse
  \else
    \PCF@resulttrue
  \fi
}
\edef\PCF@BraceLeft{\string{}
\edef\PCF@BraceRight{\string}}
\begingroup
  \edef\x{\endgroup
    \def\noexpand\PCF@CanPatch
        ##1\detokenize{\setbox\@outputbox\vbox}\PCF@BraceLeft
        ##2\detokenize{\footnoterule}##3\PCF@BraceRight
  }%
\x#4\@nil{%
  \ifx\\#2#3#4\\%
    \PCF@resultfalse
  \else
    \PCF@resulttrue
  \fi
}
\def\PCF@PatchA#1\setbox\@outputbox\vbox#2#3\PCF@nil#4{%
  \PCF@PatchB{#1}#2\PCF@nil{#3}#4%
}
\def\PCF@PatchB#1#2\footnoterule#3\PCF@nil#4#5{%
  \toks@{%
    \def#5{%
      #1%
      \setbox\@outputbox\vbox{%
        #2%
        \footnoterule
        \pdfcolfoot@current
        #3%
      }%
      #4%
    }%
  }%
}
\def\pdfcolfoot@all#1{%
  \begingroup
    \let\on@line\@empty
    \PackageInfo{pdfcolfoot}{%
      Patching \string\@makecol\space macros (#1)%
    }%
  \endgroup
  \pdfcolfoot@patch\@makecol
  \pdfcolfoot@patch\@makecol@pptt
  \pdfcolfoot@patch\mem@makecol
  \pdfcolfoot@patch\mem@makecolbf
  \pdfcolfoot@patch\m@mopfootnote
  \pdfcolfoot@patch\@combineinserts
  \pdfcolfoot@patch\ltx@makecol
  \pdfcolfoot@patch\dfn@latex@makecol
  \pdfcolfoot@patch\latex@makecol
  \pdfcolfoot@patch\LS@makecol
  \pdfcolfoot@patch\@LN@orig@makecol
  \pdfcolfoot@patch\org@makecol
  \pdfcolfoot@patch\fn@makecol
}
\AtBeginDocument{\pdfcolfoot@all{AtBeginDocument}}
\pdfcolfoot@all{AtEndOfPackage}
\endinput
%%
%% End of file `pdfcolfoot.sty'.