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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
|
%%
%% This is file `interfaces-tocloft.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% interfaces.dtx (with options: `tocloft')
%%
%% This is a generated file.
%%
%% interfaces : 2010/11/26 v2.4 - interfaces : interfaces with keys for other packages (FC)
%%
%% 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
%%
%% This work consists of the main source file interfaces.dtx
%% and the derived files
%% interfaces.sty, interfaces.pdf, interfaces.ins,
%% interfaces-base.sty,
%% interfaces-LaTeX.sty,
%% interfaces-tikz.sty,
%% interfaces-titlesec.sty,
%% interfaces-hyperref.sty,
%% interfaces-bookmark.sty,
%% interfaces-hypbmsec.sty,interfaces-hypbmsec.code.tex,
%% interfaces-fancyhdr.sty,
%% interfaces-marks.sty,
%% interfaces-tocloft.sty,
%% interfaces-makecell.sty,
%% interfaces-enumitem.sty,
%% interfaces-truncate.sty,
%% interfaces-appendix.sty,
%% interfaces-embedfile.sty,
%% interfaces-environ.sty,
%% interfaces-umrand.sty,
%% interfaces-scrlfile.sty,
%% interfaces-pgfkeys.sty,
%% interfaces-etoolbox.sty
%%
%% interfaces: interfaces with keys for other packages (FC)
%% Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr>
%%
\ProvidesPackage{interfaces-tocloft}
[2010/11/26 v2.4 pgfkeys macros for tocloft (FC)]
\RequirePackage{interfaces-base}
\itf@Check@Package{tocloft}
\itf@pgfkeys
\newrobustcmd\tocsetup[1]{%
\AfterPreamble{\itf@pgfkeys\pgfqkeys{/itf/tocloft/toc}{#1}}%
}% \tocsetup
\newrobustcmd\lofsetup[1]{%
\AfterPreamble{\itf@pgfkeys\pgfqkeys{/itf/tocloft/lof}{#1}}%
}% \lofsetup
\newrobustcmd\lotsetup[1]{%
\AfterPreamble{\itf@pgfkeys\pgfqkeys{/itf/tocloft/lot}{#1}}%
}% \lotsetup
\newrobustcmd\listofsetup[2]{%
\AfterPreamble{\itf@pgfkeys\pgfqkeys{/itf/tocloft/#1}{#2}}%
}% \listofsetup
\def\itf@cft@newlistof#1{%
\pgfqkeys{/itf/tocloft/#1}{%
pagestyle/.code=\tocloftpagestyle{##1},%
parskip/.store in skip cs=cftparskip,%
parsep/.alias=parskip,%
mark/.store in cs=cftmark#1,%
marks/.alias=mark,%
label/.store as code,%
ref/.store as code,%
ref/.initial=\csname cft#1title\endcsname,% overwritten (toc,lof,lot)
ref/.default=\csname cft#1title\endcsname,% overwritten (toc,lof,lot)
ref/.blank=\pgfkeysnovalue,%
title/.store as code in cs=cft#1title,% overwritten below for toc, lof and lot
title/top/.store in skip cs=cftbefore#1titleskip,%
beforetitleskip/.alias*=title/top,%
title/bottom/.store in skip cs=cftafter#1titleskip,%
aftertitleskip/.alias*=title/bottom,%
title/font/.store as code in cs=cft#1titlefont,%
title/format/.alias*=title/font,%
title/after/.store as code in cs=cftafter#1title,%
title/command/.code=\csdef{@cftmake#1title}####1{##1},%
dotsep/.code=\itf@units@mu\itf@musk{##1}% converts to mu
\edef\cftdotsep{\itf@strip@mu\itf@musk},%
dotsep/.default=4.5mu,%
dotsep/.blank=\cftnodots,%
dot/.store in=\cftdot,%
before/.store as code,%
after/.store as code,%
columns/before@hook/.is private=interfaces-tocloft,%
columns/after@hook/.is private=interfaces-tocloft,%
columns/before@hook/.initial=,%
columns/after@hook/.initial=,%
columns/.code={\ltx@ifpackageloaded{multicol}{%
\pgfkeysEsetvalue\pgfkeyscurrentkey{\number##1}%
\ifnum\number##1>\@ne
\pgfkeysgetvalue{/itf/tocloft/#1/columns/before@hook}\itf@tp
\ifx\itf@tp\@empty
\pgfkeyssetvalue{/itf/tocloft/#1/columns/before@hook}{%
\begingroup
\multicolsep\pgfkeysvalueof{/itf/tocloft/#1/multicolsep}\relax
\begin{multicols}{\pgfkeysvalueof{/itf/tocloft/#1/columns}}%
\columnseprule\pgfkeysvalueof{/itf/tocloft/#1/columns/rule}\relax
\columnsep\pgfkeysvalueof{/itf/tocloft/#1/columns/sep}\relax
\pgfkeysgetvalue{/itf/tocloft/#1/columns/rule/color}\columnseprulecolor
\pgfkeysvalueof{/itf/tocloft/#1/multicols/begin}%
}%
\pgfkeyssetvalue{/itf/tocloft/#1/columns/after@hook}{%
\pgfkeysvalueof{/itf/tocloft/#1/multicols/end}%
\end{multicols}
\endgroup
}%
\fi
\else
\pgfkeyslet\pgfkeyscurrentkey\@ne
\pgfkeyslet{/itf/tocloft/#1/columns/before@hook}\@empty
\pgfkeyslet{/itf/tocloft/#1/columns/after@hook}\@empty
\fi}
{\PackageError{interfaces-tocloft}
{Key `columns': package multicol is required}\@eha}%
},%
columns/.default=2,columns/.blank=1,%
multicol/.alias=columns,%
multicols/.alias=columns,%
twocolumns/.true=\pgfkeysalso{columns=2},%
twocolumns/.false=\pgfkeysalso{columns=1},%
columns/rule/.store as dimen,%
columns/rule/.default=\columnseprule,%
columns/rule,% assign default
columnseprule/.alias*=columns/rule,%
columns/rule/width/.alias*=columns/rule,%
columns/sep/.store as dimen,%
columns/sep/.default=\columnsep,%
columns/sep/.blank=10\p@,%
columns/sep,% assign default
columnsep/.alias*=columns/sep,%
columns/rule/color/.store as color command,%
columns/rule/color,% assign default (\normalcolor)
columnseprulecolor/.alias*=columns/rule/color,%
columns/rulecolor/.alias*=columns/rule/color,%
multicolsep/.store as glue,%
multicolsep/.default=0pt plus4pt minus3pt,%
multicolsep,% sets default
multicols/begin/.initial=,multicols/begin/.default=,%
multicols/before/.alias=multicols/begin,%
multicols/end/.initial=,multicols/end/.default=,%
multicols/after/.alias=multicols/end,%
}% \pgfkeys
\itf@AfterPackage{interfaces-bookmark}{%
\pgfqkeys{/itf/tocloft/#1}{%
bookmark/.is multiple choice,%
bookmark/bold/.true=\pgfkeysaddvalue{/itf/tocloft/#1/bookmark}{}{,bold=true},%
bookmark/bold/.false=\pgfkeysaddvalue{/itf/tocloft/#1/bookmark}{}{,bold=false},%
bookmark/italic/.true=\pgfkeysaddvalue{/itf/tocloft/#1/bookmark}{}{,italic=true},%
bookmark/italic/.false=\pgfkeysaddvalue{/itf/tocloft/#1/bookmark}{}{,italic=false},%
bookmark/color/.code=\pgfkeysaddvalue{/itf/tocloft/#1/bookmark}{}{,color={##1}},%
bookmark/level/.code=\pgfkeysEaddvalue{/itf/tocloft/#1/bookmark}{}{level={%
\ifcsname toclevel@##1\endcsname
\csname toclevel@##1\endcsname
\else##1\fi}},%
bookmark/text/.store as code,%
bookmark/text/.default=\contentsname,%
bookmark/.unknown/.code=\pgfkeysEaddvalue{/itf/tocloft/#1/bookmark}
{}{\pgfkeyscurrentname={##1}},%
bookmark/.initial=,%
}% \pgfkeys
}% AfterPackage interfaces-bookmark
%% while making a format \jobname is expanded to the name of the format...
%% Therefore, the following commands must be expanded \AtEndPreamble
\AtEndPreamble{%
\BeforeFile{\jobname.#1}{%
\pgfkeysvalueof{/itf/tocloft/#1/before}%
\pgfkeysvalueof{/itf/tocloft/#1/columns/before@hook}%
}%
\AfterFile{\jobname.#1}{%
\pgfkeysvalueof{/itf/tocloft/#1/columns/after@hook}%
\pgfkeysvalueof{/itf/tocloft/#1/after}%
}%
}%
\ifcsname #1setup\endcsname\else
\pgfqkeys{/itf/tocloft/#1}{%
pagenumbers/.true=\@cftpnumon{#1},%
pagenumbers/.false=\@cftpnumoff{#1},%
pagenumber/.alias=pagenumbers
}%
\expandafter\pretocmd\csname @cftmake#1title\expandafter\endcsname
\expandafter{\expandafter\itf@tocloft\csname cft#1title\endcsname{#1}{listof#1}}
{\PackageInfo{interfaces-tocloft}
{Command \expandafter\string\csname @cftmake#1title\endcsname
successfully augmented}}
{\PackageWarning{interfaces-tocloft}
{Command \expandafter\string\csname @cftmake#1title\endcsname
\space could not be patched
\MessageBreak Keys label and bookmark won't work for \string\listofsetup}}%
\fi
}% \itf@cft@newlistof
\itf@cft@newlistof{toc}
\itf@cft@newlistof{lof}
\itf@cft@newlistof{lot}
%% Specific to toc only -------------------------------------------------------
\pgfqkeys{/itf/tocloft/toc}{%
depth/.store in counter cs=c@tocdepth,%
depth/.append code=
\global\c@tocdepth\c@tocdepth
\addtocontents{toc}{\c@tocdepth\the\c@tocdepth\relax},%
tocdepth/.alias=depth,%
title/.store as code in cs=contentsname,%
contentsname/.alias=title,%
ref/.initial=\contentsname,%
ref/.default=\contentsname,%
pagenumbers/.style={% boolean key
part/pagenumbers={#1},chapter/pagenumbers={#1},section/pagenumbers={#1},%
subsubsection/pagenumbers={#1},subsubsection/pagenumbers={#1},%
paragraph/pagenumbers={#1},subparagraph/pagenumbers={#1}},%
pagenumber/.alias=pagenumbers,%
}%
%% Specific to lof and lot ----------------------------------------------------
\pgfqkeys{/itf/tocloft/lof}{%
title/.store as code in cs=listfigurename,%
listfigurename/.alias=title,%
ref/.initial=\listfigurename,%
ref/.default=\listfigurename,%
}%
\pgfqkeys{/itf/tocloft/lot}{%
title/.store as code in cs=listtablename,%
listtablename/.alias=title,%
ref/.initial=\listtablename,%
ref/.default=\listtablename,%
}%
\if@cftsubfigopt
\pgfqkeys{/itf/tocloft}{%
lof/pagenumbers/.style={figure/pagenumbers={#1},subfigure/pagenumbers={#1}},%
lof/pagenumber/.alias=lof/pagenumbers,%
lof/depth/.store in counter cs=c@lofdepth,%
lof/depth/.append code=\global\c@lofdepth\c@lofdepth
\addtocontents{lof}{\c@lofdepth\the\c@lofdepth\relax},%
lot/pagenumbers/.style={figure/pagenumbers={#1},subfigure/pagenumbers={#1}},%
lot/pagenumber/.alias=lot/pagenumbers,%
lot/depth/.store in counter cs=c@lotdepth,%
lot/depth/.append code=\global\c@lotdepth\c@lotdepth
\addtocontents{lot}{\c@lotdepth\the\c@lotdepth\relax},%
}%
\else
\pgfqkeys{/itf/tocloft}{%
lof/pagenumbers/.style={figure/pagenumbers={#1}},%
lof/pagenumber/.alias=lof/pagenumbers,%
lot/pagenumbers/.style={figure/pagenumbers={#1}},%
lot/pagenumber/.alias=lot/pagenumbers,%
}%
\fi
\def\itf@cft@name#1.#2.#3\@nil{cft#1\itf@cft@secname{#2}#3}
\def\itf@cft@secname#1{%
\expandafter\itf@cft@sec@name\csname#1\endcsname{#1}%
}% \itf@cft@secname
\def\itf@cft@sec@name#1#2{%
\ifx#1\chapter chap\else
\ifx#1\section sec\else
\ifx#1\subsection subsec\else
\ifx#1\subsubsection subsubsec\else
\ifx#1\paragraph para\else
\ifx#1\subparagraph subpara\else
\ifx#1\figure fig\else
\ifx#1\subsubfigure subfig\else
\ifx#1\table tab\else
\ifx#1\subtable subtab\else
#2\fi
\fi\fi\fi\fi\fi\fi\fi\fi\fi
}% \itf@cft@section@name
%% tocloft setup for tables sections :
\pgfkeys{%
/handlers/.cft@def/.style={\pgfkeyscurrentpath/.store in cs=\itf@cft@name #1\@nil},%
/handlers/.cft@code/.style={\pgfkeyscurrentpath/.store as code in cs=\itf@cft@name #1\@nil},%
/handlers/.cft@length/.style={\pgfkeyscurrentpath/.store in skip cs=\itf@cft@name #1\@nil},%
}
\def\itf@cft@newsection{\itf@cft@new@section{/itf/tocloft}}
\def\itf@cft@new@section#1#2#3{% #2=part / chap / sec / subsec etc., #3 = toc | lof | lot
\pgfqkeys{#1/#3/#2}{%
skip/.cft@length=before.#2.skip,%
beforeskip/.alias*=skip,%
top/.alias*=skip,%
indent/.cft@length=.#2.indent,%
font/.cft@code=.#2.font,%
font/.append code={\pgfkeysalso{/itf/tocloft/#3/#2/pagenumber/font={##1}}},%
format/.alias*=font,%
number/width/.cft@length=.#2.numwidth,%
numwidth/.alias*=number/width,%
presnum/.cft@code=.#2.presnum,%
number/before/.alias*=presnum,%
aftersnum/.cft@code=.#2.aftersnum,%
number/after/.alias*=aftersnum,%
aftersnumb/.cft@code=.#2.aftersnumb,%
title/before/.alias*=aftersnumb,%
leader/.cft@def=.#2.leader,%
leader/.default=\cftdotfill{\csname\itf@cft@name.#2.dotsep\@nil\endcsname},%
leaders/.alias=leader,%
dotsep/.code={\ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text
\csdef{\itf@cft@name.#2.dotsep\@nil}{\cftdotsep}%
\else
\itf@units@mu\itf@musk{##1}%
\csedef{\itf@cft@name.#2.dotsep\@nil}{\itf@strip@mu\itf@musk}%
\fi},%
dotsep/.blank=\cftnodots,%
nodots/.code=\csdef{\itf@cft@name.#2.dotsep\@nil}{\cftnodots},%
nodots/.value forbidden,%
pagefont/.cft@code=.#2.pagefont,%
page/font/.alias*=pagefont,%
pagenumber/font/.alias*=pagefont,%
afterpnum/.cft@code=.#2.afterpnum,%
page/after/.alias*=afterpnum,%
pagenumber/after/.alias*=afterpnum,%
pagenumbers/.on=\@cftpnumon{\itf@cft@secname{#2}},%
pagenumbers/.off=\@cftpnumoff{\itf@cft@secname{#2}},%
pagenumber/.alias=pagenumbers,%
}% \pgfqkeys
}% \itf@cft@new@section
\@for\itf@tp:=part,chap,chapter,sec,section,subsec,subsection,%
subsubsec,subsubsection,para,paragraph,subpara,subparagraph%
\do{\expandafter\itf@cft@newsection\expandafter{\itf@tp}{toc}}%
\if@cftsubfigopt
\@for\itf@tp:=fig,figure,subfig,subfigure%
\do{\expandafter\itf@cft@newsection\expandafter{\itf@tp}{lof}}%
\@for\itf@tp:=tab,table,subtab,subtable%
\do{\expandafter\itf@cft@newsection\expandafter{\itf@tp}{lot}}%
\else
\@for\itf@tp:=fig,figure%
\do{\expandafter\itf@cft@newsection\expandafter{\itf@tp}{lof}}%
\@for\itf@tp:=tab,table%
\do{\expandafter\itf@cft@newsection\expandafter{\itf@tp}{lot}}%
\fi
\itf@patch\pretocmd\@cftmaketoctitle
{\itf@tocloft\contentsname{toc}{tableofcontents}}
{\PackageInfo{interfaces-tocloft}
{Command \string\@cftmaketoctitle\space successfully augmented}}
{\PackageWarning{interfaces-tocloft}
{Command \string\@cftmaketoctitle\space could not be patched
\MessageBreak label and bookmark keys for \string\tocsetup\space won't work}}%
\itf@patch\pretocmd\@cftmakeloftitle
{\itf@tocloft\listfigurename{lof}{listoffigures}}
{\PackageInfo{interfaces-tocloft}
{Command \string\@cftmakeloftitle\space successfully augmented}}
{\PackageWarning{interfaces-tocloft}
{Command \string\@cftmakeloftitle\space could not be patched
\MessageBreak label and bookmark keys for \string\lofsetup\space won't work}}%
\itf@patch\pretocmd\@cftmakelottitle
{\itf@tocloft\listtablename{lot}{listoftables}}
{\PackageInfo{interfaces-tocloft}
{Command \string\@cftmakelottitle\space successfully augmented}}
{\PackageWarning{interfaces-tocloft}
{Command \string\@cftmakelottitle\space could not be patched
\MessageBreak label and bookmark keys for \string\lotsetup\space won't work}}%
\itf@patch\apptocmd\newlistentry
{\itf@cft@newlistof{#2}}
{\PackageInfo{interfaces-tocloft}
{Command \string\newlistentry\space successfully augmented}}
{\PackageWarning{interfaces-tocloft}
{Command \string\newlistentry\space could not be patched
\MessageBreak \string\listofsetup\space will not work}}%
\def\itf@tocloft#1#2#3{%
\expandafter\def\expandafter#1\expandafter{%
\expandafter\itf@cft@label
\expandafter#1\expandafter{#1}{#2}{#3}}%
}% \itf@tocloft
\long\def\itf@cft@label#1#2#3#4{%
\def#1{#2}% restore original
\begingroup
\pgfkeysifdefined{/itf/tocloft/#3/bookmark}
{%
\raisedhyperdef{interfaces}{#4}{#2}%
\pgfkeysgetvalue{/itf/tocloft/#3/bookmark/text}\itf@tp
\ifx\itf@tp\@empty\else
\pgfkeysgetvalue{/itf/tocloft/#3/bookmark}\@tempa
\expandafter\bookmark\expandafter[%
\expandafter{\@tempa,dest=interfaces.#4}]%
{\pgfkeysvalueof{/itf/tocloft/#3/bookmark/text}}%
\global\BKM@startatroottrue
\fi}
{#2}%
\pgfkeysgetvalue{/itf/tocloft/#3/label}\itf@tp
\ifx\itf@tp\@empty\else
\def\@currentHref{interfaces.#4}%
\pgfkeysgetvalue{/itf/tocloft/#3/ref}\@currentlabel
\def\@currentlabelname{#2}%
\label{\pgfkeysvalueof{/itf/tocloft/#3/label}}%
\fi
\endgroup
\gdef\itf@tp{\def#1{#2}\let\itf@tp\@undefined}% restore original
\aftergroup\itf@tp % simple group introduced by tocloft to print \contentsname
}% \itf@cft@label
\endinput
%%
%% End of file `interfaces-tocloft.sty'.
|