diff options
author | Karl Berry <karl@freefriends.org> | 2010-10-25 23:12:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-10-25 23:12:18 +0000 |
commit | d74b95d250c7632cb73e7420db04e2e38adc3827 (patch) | |
tree | fbc6763253fbb9d309da7b613857d782ee5feccb /Master/texmf-dist/tex/latex/interfaces/interfaces-tocloft.sty | |
parent | ec47c1b7880fd4f626f8aa8377e576e03d72c24f (diff) |
new latex package interfaces (25oct10)
git-svn-id: svn://tug.org/texlive/trunk@20206 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/interfaces/interfaces-tocloft.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/interfaces/interfaces-tocloft.sty | 380 |
1 files changed, 380 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/interfaces/interfaces-tocloft.sty b/Master/texmf-dist/tex/latex/interfaces/interfaces-tocloft.sty new file mode 100644 index 00000000000..af838e4294b --- /dev/null +++ b/Master/texmf-dist/tex/latex/interfaces/interfaces-tocloft.sty @@ -0,0 +1,380 @@ +%% +%% 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/10/20 v1.0 - 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-fancyvrb.sty +%% +%% interfaces: interfaces with keys for other packages (FC) +%% Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> +%% +\ProvidesPackage{interfaces-tocloft} + [2010/07/23 v1.0 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,% + 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/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/.defcounter=tocdepth,% + depth/.value required,% + 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,% + lot/pagenumbers/.style={figure/pagenumbers={#1},subfigure/pagenumbers={#1}},% + lot/pagenumber/.alias=lot/pagenumbers,% +}% +\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#1#2{% #1=part / chap / sec / subsec etc., #2 = #1 = toc | lof | lot + \pgfqkeys{/itf/tocloft/#2/#1}{% + skip/.cft@length=before.#1.skip,% + beforeskip/.alias*=skip,% + top/.alias*=skip,% + indent/.cft@length=.#1.indent,% + font/.cft@code=.#1.font,% + font/.append code={\pgfkeysalso{/itf/tocloft/#2/#1/pagenumber/font={##1}}},% + format/.alias*=font,% + number/width/.cft@length=.#1.numwidth,% + numwidth/.alias*=number/width,% + presnum/.cft@code=.#1.presnum,% + number/before/.alias*=presnum,% + aftersnum/.cft@code=.#1.aftersnum,% + number/after/.alias*=aftersnum,% + aftersnumb/.cft@code=.#1.aftersnumb,% + title/before/.alias*=aftersnumb,% + leader/.cft@def=.#1.leader,% + leader/.default=\cftdotfill{\csname\itf@cft@name.#1.dotsep\@nil\endcsname},% + leaders/.alias=leader,% + dotsep/.code={\itf@units@mu\itf@musk{##1}% + \csedef{\itf@cft@name.#1.dotsep\@nil}{\itf@strip@mu\itf@musk}},% + dotsep/.default=\cftdotsep,% + dotsep/.blank=\cftnodots,% + nodots/.code=\csdef{\itf@cft@name.#1.dotsep\@nil}{\cftnodots},% + nodots/.value forbidden,% + pagefont/.cft@code=.#1.pagefont,% + page/font/.alias*=pagefont,% + pagenumber/font/.alias*=pagefont,% + afterpnum/.cft@code=.#1.afterpnum,% + page/after/.alias*=afterpnum,% + pagenumber/after/.alias*=afterpnum,% + pagenumbers/.on=\@cftpnumon{\itf@cft@secname{#1}},% + pagenumbers/.off=\@cftpnumoff{\itf@cft@secname{#1}},% + pagenumber/.alias=pagenumbers,% + }% \pgfqkeys +}% \itf@cft@newsection +\@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 % \@ifpackagewith{tocloft}{subfig} ?? + \@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}}% +\@makeother\# +\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}}% +\catcode`\#=6 +\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'. |