From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- macros/latex/contrib/interfaces/README | 66 + macros/latex/contrib/interfaces/interfaces.dtx | 7840 ++++++++++++++++++++++++ macros/latex/contrib/interfaces/interfaces.ins | 148 + macros/latex/contrib/interfaces/interfaces.pdf | Bin 0 -> 1303605 bytes 4 files changed, 8054 insertions(+) create mode 100644 macros/latex/contrib/interfaces/README create mode 100644 macros/latex/contrib/interfaces/interfaces.dtx create mode 100644 macros/latex/contrib/interfaces/interfaces.ins create mode 100644 macros/latex/contrib/interfaces/interfaces.pdf (limited to 'macros/latex/contrib/interfaces') diff --git a/macros/latex/contrib/interfaces/README b/macros/latex/contrib/interfaces/README new file mode 100644 index 0000000000..3a16fc44ae --- /dev/null +++ b/macros/latex/contrib/interfaces/README @@ -0,0 +1,66 @@ +Interfaces provides a small number of macros to modify the settings +^^^^^^^^^^ of a large number of parameters provided by Most Frequently + Used Packages (MFUP!) for typesetting beautiful documents with LaTeX. + +The macros shares a standardized syntax of the form key=value. The key +names are intuitive: font, top, bottom, left, right, bookmark, bold, +italic, color, twocolumns, title, pagestyle, before, after, indent etc. + +Interfaces DOES NOT provide any new feature, except \repeatcell, +\rowfont, and \bookmarksetup (as long as the bookmark package does not +`steal' them to interfaces... what whould be considered as a favour!) + +A few macros are modified. The complete list is included in +interfaces.pdf, with explainations. + + * * * * +Interfaces is organised in different modules which are loaded after +the master package is loaded. Each module can be loaded separately. + +Commands provided: (each in a distinct module) ----------------------- + +\sectionformat: interface for package titlesec to modify the titles + produced by the sectionning commands (and their bookmarks). + replaces \titleformat, \titlespacing and \titleclass and + is compatible with them. + +\pagesetup: interface for package fancyhdr to modify the current page + style or create new page styles. Replaces \fancypagestyle + \fancyhf, \fancyhfoffset, \renewcommand\headrulewidth etc. + +\tocsetup: interface for package tocloft to fine tune the aspect of + the table of contents, list of figures / of tables. \tocsetup also + applies to \shorttableofcontents provided by the shorttoc package. + Facility to make multi-columns table(s) of contents is included, + give a label for the table of contents/of figures/of tables... + give them a bookmark. Replaces a lot of tocloft' control sequences. + +\repeatcell: to create `dynamic' tabulars, possibly with formulas + computation: \numexpr, \pgfmathparse or \FPeval formulas can be + plugged in the tabular or array, with the possibility to transpose. + ++ some macros to make easier the use of e-TeX \marks registers (useful + with \sectionformat and \pagesetup). + +\trunctext and \htruncadjust are provided in order to take advantage of + the code provided by the package truncate.sty +----------------------------------------------------------------------- + +Interfaces is mainly based on scrlfile.sty ( provided in the Koma- + Script bundle, but Koma-Script classes are not required), on pgfkeys + and etoolbox. + +Interfaces defines some pgfkeys handlers designed specially to make +key-value interfaces for other packages. Using those handlers permit +the design of an interface in a few minutes... (well, good knowledge +of pgfkeys is required ;-) + +. \bookmarksetup is also enhanced with starred keys. + +. Facility to load TikZ libraries and pgf modules is provided via \usetikz. + +. \pgfkeys is enhanced with a new ``default'' value in case the value is blank. + +. scrlfile's \AfterFile and \BeforeFile have starred forms. +----------------------------------------------------------------------- +(c) lppl 2010 FC. \ No newline at end of file diff --git a/macros/latex/contrib/interfaces/interfaces.dtx b/macros/latex/contrib/interfaces/interfaces.dtx new file mode 100644 index 0000000000..c59ed8562b --- /dev/null +++ b/macros/latex/contrib/interfaces/interfaces.dtx @@ -0,0 +1,7840 @@ +% \iffalse meta-comment +%<*driver|install> +\let\CTANLinks=y +\let\interfacesquick=n +% +% interfaces: 2011/02/19 v3.1 - 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-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 +% +% Unpacking: +% (a) If interfaces.ins is present: +% etex interfaces.ins +% (b) Without interfaces.ins: +% etex interfaces.dtx +% (c) If you insist on using LaTeX +% latex \let\install=y\input{interfaces.dtx} +% (quote the arguments according to the demands of your shell) +% +% Documentation: +% (pdf)latex interfaces.dtx +% Copyright (C) 2010 by Florent Chervet +%<*ignore> +\begingroup + \def\x{LaTeX2e}% +\expandafter\endgroup +\ifcase 0\ifx\install y1\fi\expandafter + \ifx\csname processbatchFile\endcsname\relax\else1\fi + \ifx\fmtname\x\else 1\fi\relax +\else\csname fi\endcsname +% +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: 2011/02/19 v3.1 - interfaces: interfaces with keys for other packages (FC)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix \relax +\preamble + +This is a generated file. + +interfaces : 2011/02/19 v3.1 - 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-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 + +\endpreamble +\let\MetaPrefix\DoubleperCent + +\generate{% + \file{interfaces.ins}{\from{interfaces.dtx}{install}}% + \file{interfaces.sty}{\from{interfaces.dtx}{package}}% + \file{interfaces-base.sty}{\from{interfaces.dtx}{base}}% + \file{interfaces-pgfkeys.sty}{\from{interfaces.dtx}{pgfkeys}}% + \file{interfaces-etoolbox.sty}{\from{interfaces.dtx}{etoolbox}}% + \file{interfaces-scrlfile.sty}{\from{interfaces.dtx}{scrlfile}}% + \file{interfaces-LaTeX.sty}{\from{interfaces.dtx}{LaTeX}}% + \file{interfaces-titlesec.sty}{\from{interfaces.dtx}{titlesec}}% + \file{interfaces-hyperref.sty}{\from{interfaces.dtx}{hyperref}}% + \file{interfaces-bookmark.sty}{\from{interfaces.dtx}{bookmark}}% + \file{interfaces-fancyhdr.sty}{\from{interfaces.dtx}{fancyhdr}}% + \file{interfaces-marks.sty}{\from{interfaces.dtx}{marks}}% + \file{interfaces-tocloft.sty}{\from{interfaces.dtx}{tocloft}}% + \file{interfaces-makecell.sty}{\from{interfaces.dtx}{makecell}}% + \file{interfaces-enumitem.sty}{\from{interfaces.dtx}{enumitem}}% + \file{interfaces-hypbmsec.sty}{\from{interfaces.dtx}{hypbmsec}}% + \file{interfaces-truncate.sty}{\from{interfaces.dtx}{truncate}}% + \file{interfaces-tikz.sty}{\from{interfaces.dtx}{tikz}}% + \file{interfaces-umrand.sty}{\from{interfaces.dtx}{umrand}}% + \file{interfaces-environ.sty}{\from{interfaces.dtx}{environ}}% + \file{interfaces-appendix.sty}{\from{interfaces.dtx}{appendix}}% + \file{interfaces-embedfile.sty}{\from{interfaces.dtx}{embedfile}}% +} + +\ifx n\CTANLinks \askforoverwritetrue \fi +\generate{% + \file{interfaces.drv}{\from{interfaces.dtx}{driver}}% +} + +\obeyspaces +\Msg{************************************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* file into a directory searched by TeX:} +\Msg{*} +\Msg{* interfaces.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `interfaces.dtx'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +% +%<*ignore> +\fi +% +%<*driver> +\edef\thisfile{\jobname} +\def\thisinfo{interfaces with keys for other packages} +\def\thisdate{2011/02/19} +\def\thisversion{3.1} +\def\thisVersion{\thisversion\,\textendash\,release} +\def\CTANbaseurl{http://www.ctan.org/tex-archive/} +\def\LocalOrCTAN#1#2{\ifx y\CTANLinks#2\else#1\fi} +\def\LOCALDOC{file:C:/texmf/doc/latex} +\let\loadclass\LoadClass +\def\LoadClass#1{\loadclass[abstracton]{scrartcl}\let\scrmaketitle\maketitle\AtEndOfClass{\let\maketitle\scrmaketitle}} +{\makeatletter{\endlinechar`\^^J\obeyspaces + \gdef\ErrorUpdate#1=#2,{\@ifpackagelater{#1}{#2}{}{\let\CheckDate\errmessage\toks@\expandafter{\the\toks@ + \thisfile-documentation: updates required ! + package #1 must be later than #2 + to compile this documentation.}}}}% + \gdef\CheckDate#1{{\let\CheckDate\relax\toks@{}\@for\x:=\thisfile=\thisdate,#1\do{\expandafter\ErrorUpdate\x,}\CheckDate\expandafter{\the\toks@}}}} +\AtBeginDocument{\CheckDate{tabu=2011/02/19}} +\documentclass[a4paper,oneside]{ltxdoc} +\AtBeginDocument{\DeleteShortVerb{\|}} +\usepackage[latin1]{inputenc} +\usepackage[american]{babel} +\usepackage[T1]{fontenc} +\usepackage{txfonts,times,marvosym,wasysym,nicefrac,numprint,hologo} +\usepackage[scaled=.9]{helvet} +\ifx y\interfacesquick\else +\usepackage[expansion=all,protrusion=none,shrink=50,stretch=20]{microtype}\fi +\PassOptionsToPackage{svgnames}{xcolor} +\usepackage{etoolbox,atveryend,calc} +\usepackage{graphicx,xspace,xcolor,framed} +\usepackage{geometry,lastpage,tocloft,titlesec,hypbmsec,fancyhdr,moresize,relsize,needspace} +\usepackage{enumitem,multirow,makecell,tabularx,booktabs,colortbl,dcolumn,delarray,hhline} +\usepackage[verbose]{linegoal}[2010/12/07] +\usepackage[breakall]{truncate} +\usepackage{appendix} +\usepackage{interfaces}[2010/12/27] +\usepackage{holtxdoc,hyperref,bookmark} +\usepackage{embedfile} +\usepackage{fp} +\usepackage{zref,zref-user,zref-savepos} +\usepackage{enumitem-zref}[2010/12/17] +\usetikz{basic,decorations.pathmorphing} +\csname endofdump\endcsname +\RequirePackage[debugshow]{tabu}[2010/12/28] +\FPmessagestrue +%%\OnlyDescription +\CodelineNumbered +\usepackage{fancyvrb} \fvset{gobble=1,listparameters={\topsep=0pt}} +\lastlinefit999 \widowpenalty5000 \clubpenalty10000 \doublehyphendemerits100000 +\geometry{top=0pt,includehead,headheight=.8cm,headsep=.3cm,bottom=1.2cm,footskip=.5cm,left=2.5cm,right=1cm} +\hypersetup{% + pdftitle={The interfaces package},% + pdfsubject={interfaces with keys for other packages},% + pdfauthor={F. CHERVET},% + pdfpagemode=UseNone,% + colorlinks,linkcolor=reflink,filecolor=reffilecolor,% + pdfstartview={FitH},% + pdfkeywords={tex, e-tex, TeX, e-TeX, eTeX, latex, package, interfaces, marks,% + pgfkeys, scrlfile, etoolbox, titlesec, fancyhdr, tocloft, environ,% + embedfile, hyperref, bookmark, hypbmsec, truncate, tikz,% + makecell, enumitem, appendix, umrand},% + bookmarksopen=true,bookmarksopenlevel=1,% + pdfnewwindow=true} +\embedfile{\thisfile.dtx} +\begin{document} + \DocInput{\thisfile.dtx} +\end{document} +% +% \fi +% +% \CheckSum{6187} +% \CharacterTable +% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +% Digits \0\1\2\3\4\5\6\7\8\9 +% Exclamation \! Double quote \" Hash (number) \# +% Dollar \$ Percent \% Ampersand \& +% Acute accent \' Left paren \( Right paren \) +% Asterisk \* Plus \+ Comma \, +% Minus \- Point \. Solidus \/ +% Colon \: Semicolon \; Less than \< +% Equals \= Greater than \> Question mark \? +% Commercial at \@ Left bracket \[ Backslash \\ +% Right bracket \] Circumflex \^ Underscore \_ +% Grave accent \` Left brace \{ Vertical bar \| +% Right brace \} Tilde \~} +% +% \DoNotIndex{\begin,\CodelineIndex,\CodelineNumbered,\def,\DisableCrossrefs,\~,\@ifpackagelater,\z@,\@ne} +% \DoNotIndex{\DocInput,\documentclass,\EnableCrossrefs,\end,\GetFileInfo} +% \DoNotIndex{\NeedsTeXFormat,\OnlyDescription,\RecordChanges,\usepackage} +% \DoNotIndex{\ProvidesClass,\ProvidesPackage,\ProvidesFile,\RequirePackage} +% \DoNotIndex{\filename,\fileversion,\filedate,\let} +% \DoNotIndex{\@listctr,\@nameuse,\csname,\else,\endcsname,\expandafter} +% \DoNotIndex{\gdef,\global,\if,\item,\newcommand,\nobibliography} +% \DoNotIndex{\par,\providecommand,\relax,\renewcommand,\renewenvironment} +% \DoNotIndex{\stepcounter,\usecounter,\nocite,\fi} +% \DoNotIndex{\@fileswfalse,\@gobble,\@ifstar,\@unexpandable@protect} +% \DoNotIndex{\AtBeginDocument,\AtEndDocument,\begingroup,\endgroup} +% \DoNotIndex{\frenchspacing,\MessageBreak,\newif,\PackageWarningNoLine} +% \DoNotIndex{\protect,\string,\xdef,\ifx,\texttt,\@biblabel,\bibitem} +% \DoNotIndex{\z@,\wd,\wheremsg,\vrule,\voidb@x,\verb,\bibitem} +% \DoNotIndex{\FrameCommand,\MakeFramed,\FrameRestore,\hskip,\hfil,\hfill,\hsize,\hspace,\hss,\hbox,\hb@xt@,\endMakeFramed,\escapechar} +% \DoNotIndex{\do,\date,\if@tempswa,\@tempdima,\@tempboxa,\@tempswatrue,\@tempswafalse,\ifdefined,\ifhmode,\ifmmode,\cr} +% \DoNotIndex{\box,\author,\advance,\multiply,\Command,\outer,\next,\leavevmode,\kern,\title,\toks@,\trcg@where,\tt} +% \DoNotIndex{\the,\width,\star,\space,\section,\subsection,\textasteriskcentered,\textwidth} +% \DoNotIndex{\",\:,\@empty,\@for,\@gtempa,\@latex@error,\@namedef,\@nameuse,\@tempa,\@testopt,\@width,\\,\m@ne,\makeatletter,\makeatother} +% \DoNotIndex{\maketitle,\parindent,\setbox,\x,\kernel@ifnextchar} +% \DoNotIndex{\KVS@CommaComma,\KVS@CommaSpace,\KVS@EqualsSpace,\KVS@Equals,\KVS@Global,\KVS@SpaceEquals,\KVS@SpaceComma,\KVS@Comma} +% \DoNotIndex{\DefineShortVerb,\DeleteShortVerb,\UndefineShortVerb,\MakeShortVerb,\endinput,\Verb,\VerbLines,\T,\x,\y,\U,\tw@,\ttl@,\q,\quad,\ps@} +% \DoNotIndex{\plainfootrulewidth,\plainheadrulewidth,\ProcessOptions,\providerobustcmd,\pgfqkeys,\pgfkeys,\pgfkeysvalueof,\pgfkeysnovalue@text,\pgfkeyslet} +% \DoNotIndex{\pgfkeysifdefined,\pgfkeysEsetvalue,\pgfkeysedef,\pgfkeysdef,\pgfkeyscurrentvalue,\pgfkeyscurrentpath,\pgfkeyscurrentname,\pgfkeyscurrentkey} +% \DoNotIndex{\pgfkeysalso,\pgfkeysaddvalue,\pgfkeys@unknown,\pgfkeys@temp,\pgfkeys@stop,\pgfkeys@split@path,\pgfkeys@empty,\pgfkeys@code,\pgfkeys@case@one} +% \DoNotIndex{\pgfkeys@add@path@as@needed,\parfillskip,\PackageWarning,\PackageInfo,\PackageError,\p@,\P} +% \DoNotIndex{\numexpr,\number,\newrobustcmd,\N,\M,\meaning,\ltx@leavevmode,\ltx@newif,\ltx@secondoftwo,\lowercase,\letcs,\lccode,\LaTeX,\l@,\l@sup,\l@newsection} +% \DoNotIndex{\keep,\jobname,\itf@tp,\itf@thecr,\itf@tempdim,\itf@sum,\itf@rows,\itf@cols,\itf@row,\itf@col,\itf@pgfkeysaddvalue,\itf@pgfkeys@unpack} +% \DoNotIndex{\itf@pgfkeys@exp@call,\itf@pgfkeys@choice,\itf@pgfkeys,\itf@patch@inside,\itf@patch@boundary,\itf@p@gesetup,\itf@number@@@,\itf@number@,\itf@newif} +% \DoNotIndex{\itf@LoadFile,\itf@LoadInterface,\itf@istruncated,\itf@getv@lue,\itf@freespace,\itf@exp@ndonceifcs,\itf@endappendices@pp,\itf@Embed@ne,\itf@EmbedOne} +% \DoNotIndex{\itf@defpreapp,\itf@cnt,\itf@Check@Package,\itf@cft@section@name,\itf@cft@sec@name,\itf@cft@sectionname,\itf@cellfontrow,\itf@cellfontcol,\itf@cell@rowcolkey} +% \DoNotIndex{\itf@cell@getifdefined,\itf@cell@getf@rmula,\itf@BKM@@ref,\itf@BKM@@pageref,\itf@AtEnd,\itf@appendices@pp,\itf@@cellright,\itf@@cellleft,\InputIfFileExists} +% \DoNotIndex{\in@true,\in@false,\in@@,\in@@@,\immediate,\iftrue,\ifnum,\ifin@,\ifdim,\ifcsname,\ifcase,\ifcat,\ifblank,\if@chapter@pp,\if@fancyplain,\if@cftsubfigopt} +% \DoNotIndex{\hyper@anchorend,\hyper@anchorstart,\Hy@raisedlink,\Hy@babelnormalise,\Hy@AnchorName,\hfuzz,\hbs@tocstring,\hbs@bmstring,\hbs@seccmd,\hbs@process,\hbs@do} +% \DoNotIndex{\hbadness,\G@refundefinedtrue,\getpagerefnumber,\expandonce,\ExecuteOptions,\etb@doitem,\enit@a,\enit@b,\endVerb,\endVerbLines,\endappendices} +% \DoNotIndex{\embedthisfile@main,\embedthisfile@all,\document,\docsvlist,\dimexpr,\dimen@,\detokenize,\define@key,\DeclareOption,\D,\crcr,\count@,\catcode,\BKM@startatroottrue} +% \DoNotIndex{\badness,\b,\B,\AtEndPreamble,\AtEndOfPackage,\arraybackslash,\array@prepnext@tok,\csappto,\appto,\appendixpagename,\appendixtocname,\AfterPreamble} +% \DoNotIndex{\AfterEndPreamble,\addcontentsline,\a,\@undefined,\@temptokena,\@tempcnta,\@tempb,\@specialstyle,\@specialpagetrue,\@rightskip,\@ptionlist,\@preamble} +% \DoNotIndex{\@nnil,\@nil,\@makeother,\@listfiles,\@let@token,\@latex@warning,\@input,\@ifundefinedcolor,\@ifundefined,\@ifpackagewith,\@ifnextchar,\@height,\@width,\@depth} +% \DoNotIndex{\@firstoftwo,\@secondoftwo,\@enddocumenthook,\@ehd,\@eha,\@dotoc@pptrue,\@dotoc@ppfalse,\@dopage@pptrue,\@dopage@ppfalse,\@declaredoptions,\@currentHref} +% \DoNotIndex{\@currentlabel,\@currentlabelname,\@currenvir,\@classz,\@chapter@pptrue,\@chapter@ppfalse,\@cftmaketoctitle,\@cftmakelottitle,\@cftmakeloftitle,\@arrayright} +% \DoNotIndex{\@arabic,\@M,\&,\#,\!,\thr@@,\z@skip,\unexpanded,\typeout,\ttl@select,\ttl@savetitle,\ttl@a,\vbox,\preto,\pgfkeyssetvalue,\pgfkeysgetvalue} +% \DoNotIndex{\pgfkeysdefaultpath,\pgfkeys@spdef,\pgfeov,\S,\scr@set@load@hook,\setlist,\romannumeral,\robustify,\renewrobustcmd,\ps@@fancy,\protected,\newlistentry,\newcount} +% \DoNotIndex{\macro,\ltx@ifundefined,\leftmargin,\itf@ttl@get@format,\itf@trunc@width,\itf@trunc@nosuchwidth,\itf@set@bottomtitle@space,\itf@sectionf@rmat} +% \DoNotIndex{\itf@s@LoadFile,\itf@rowloop,\itf@colloop,\itf@patch@,\itf@number@@,\itf@marks@warning,\itf@cft@sectionname,\itf@cft@name,\itf@cellfont,\itf@celltext} +% \DoNotIndex{\itf@cellskip,\itf@cellrow,\itf@cellcol,\itf@cell,\itf@AfterPackage,\input,\IfFileExists,\iffalse,\I,\hrule,\gpreto,\glueexpr,\fancy@gbl} +% \DoNotIndex{\afterassignment,\csxdef,\cslet,\csletcs,\csgdef,\csedef,\csdef,\csappto,\csundef,\csuse,\ClassError,\cl@section,\~} +% \makeatletter +% +% \newcommand*\tikzlabel[2][]{\tikz[{remember picture,#1}]\coordinate ({#2});} +% \colorlet{pkgcolor}{teal} \protected\def\pkgcolor{\color{pkgcolor}} +% \def\descfont{\normalfont\bfseries} +% \newrobustcmd*\FC{{\color{copper}\usefont{T1}{fts}xn FC}} +% \newrobustcmd*\CTANhref[2][macros/latex/contrib/]{^^A +% \href{\CTANbaseurl#1#2}{\nolinkurl{CTAN:#1#2}}^^A +% } +% \newrobustcmd*\thispackage{\@ifstar{\thisp@ckage{}}{\thisp@ckage\Xspace}} +% \def\thisp@ckage#1{\@ifnextchar[\thisp@ckage@opt {\xpackage{\pkgcolor\thisfile}#1}}^^A] +% \def\thisp@ckage@opt #1[#2]{\ifcsundef{r@#2}{\xpackage{\pkgcolor#2}}{\hyperref[{#2}]{\xpackage{\pkgcolor#2}}}#1} +% \def\ThisPackage{\Xpackage{\thisfile}\Xspace} +% \newrobustcmd*\Xpackage[2][macros/latex/contrib/]{\@testopt{\X@package[{#1}]{#2}}{}} +% \def\X@package[#1]#2[#3]{^^A #1=href, #2=name, #3=description (footnote) +% \xpackage{#2\footnote{\noindent\xpackage{#2}: \CTANhref[{#1}]{#2}#3}}^^A +% } +% \def\ThisPackage{\Xpackage{\thisfile}\Xspace} +% \newrobustcmd\doclink[2][]{\ifblank{#1} +% {\hyperref{\LocalOrCTAN{\LOCALDOC/#2/#2.pdf}{\CTANbaseurl/macros/latex/contrib/#2}}{}{}{#2}} +% {\hyperref{#1}{}{}{#2}}% +% } +% \newrobustcmd\ClearPage{\@ifstar{\vfill\null\clearpage}{}} +% \bottomtitles=.1\textheight +% \catcode`\§ \active \def§{\@ifnextchar §{\endgraf\nobreak\vskip-2\parskip}{\endgraf\nobreak\vskip-\parskip}} +% \def\Underbrace#1_#2{$\underbrace{\vtop to2ex{}\hbox{#1}}_{\footnotesize\hbox{#2}}$} +% \newcolumntype{O}{>{\opt}r@{\,=\textellipsis,\hskip.3em}} +% \newcolumntype{o}{>{\opt} r@{\,=\,}} +% \pretocmd\oldstylenums{\fontfamily{cmr}}{}{} +% \newrobustcmd*\thisyear{\begingroup +% \def\thisyear##1/##2\@nil{\endgroup +% \oldstylenums{2010\ifnum##1=2010\else\,\textendash\,##1\fi}% +% }\expandafter\thisyear\thisdate\@nil +% } +% ^^A---------------------------------------------------------------------------- +% \parindent\z@\parskip.4\baselineskip\topsep\parskip\partopsep\z@ +% \newrobustcmd*\macrocodecolor{\color{macrocode}} \definecolor{macrocode}{rgb}{0.05,0.02,0.07} +% \g@addto@macro\macro@font{\macrocodecolor\let\AltMacroFont\macro@font} +% \font\ttMacroFont=cmtt10 scaled 900 +% \def\MacroFont{\ttMacroFont} +% \DefineVerbatimEnvironment{VerbLines}{Verbatim} +% {gobble=1,frame=lines,framesep=6pt,fontfamily=txtt,fontseries=m} +% \DefineVerbatimEnvironment{VerbLines*}{Verbatim} +% {gobble=1,frame=lines,framesep=6pt,fontfamily=txtt,fontseries=m,commandchars=$()} +% \DefineVerbatimEnvironment{Verb}{Verbatim} +% {gobble=1,fontfamily=txtt,fontseries=m} +% \DefineVerbatimEnvironment{Verb*}{Verbatim} +% {gobble=1,fontfamily=txtt,fontseries=m,commandchars=$()} +% \def\smex{\leavevmode\hb@xt@2em{\hfil$\longrightarrow$\hfil}} +% \newcommand\texorpdf[2]{\texorpdfstring{#1{#2}}{#2}} +% \renewcommand*\ttdefault{txtt} +% \newrobustcmd\verbfont{\ttfamily} \let\vb\verbfont ^^A\usefont{T1}\ttdefault\f@series\f@shape} +% \def\meta@font@select{\itshape\verbfont}\let\metafont\meta@font@select +% \newrobustcmd\vbbf{\usefont{T1}{\ttdefault}bn} +% \renewrobustcmd\#[1]{{\usefont{T1}{pcr}{bx}{n}\char`\##1}} +% \newrobustcmd*\grabcs{\leavevmode\hbox\bgroup\bgroup\makeatletter\aftergroup\endgrabcs} +% \def\endgrabcs{\egroup\xspaceverb} +% \renewrobustcmd*\cs{\grabcs\cs@} +% \newrobustcmd*\cs@[2][]{\begingroup\escapechar\m@ne\def\x ##1{\endgroup\texttt{#1{\@backslashchar##1}}}\expandafter\x\expandafter{\string#2}\egroup}% +% \newcommand*\cs@pdf[1]{\@backslashchar\if\@backslashchar\string#1 \else\string#1\fi} +% ^^A% \renewcommand*\cs{\texorpdfstring{\leavevmode\hbox\bgroup\bgroup\makeatletter\cs@} \cs@pdf} +% ^^A% \newcommand*\cs@pdf[1]{\@backslashchar\if\@backslashchar\string#1 \else\string#1\fi} +% ^^A% \providerobustcmd*\cs@[2][\macrocodecolor]{\escapechar\m@ne\edef\@tempa{\noexpand\@backslashchar\string#2}\texttt{#1{\@tempa}}} +% \newrobustcmd*\csbf{\cs[\textbf]} +% ^^A% \newrobustcmd*\csref[2][\macrocodecolor]{{\escapechar\m@ne\edef\my@tempa{\string#2}\edef\x ##1{\noexpand\hyperref{}{declcs}{\my@tempa}{\noexpand\cs[{##1}]{\my@tempa}}}\expandafter}\x{#1}} +% \newrobustcmd*\csref[2][\macrocodecolor]{{\escapechar\m@ne\edef\my@tempa{\string#2}\edef\x ##1{\noexpand\hyperref{}{declcs}{\my@tempa}{\noexpand\cs[{##1}]{\my@tempa}}}\expandafter}\x{#1}} +% \newrobustcmd*\refVersion[2][]{\hyperref[{v#2}]{#1{v#2}}} +% \newrobustcmd*\patchlabel[2][]{\zref@setcurrent{patchtype}{#1}\label{patch-#2}\zref@labelbyprops{patch-#2}{page,default,patchtype}} +% \zref@newprop{patchtype}[]{} +% \newcommand\backslashchar{\@backslashchar} +% \newrobustcmd\CSbf[1]{\textbf{\CS{#1}}} +% \let\doc@meta\meta +% \renewrobustcmd*\meta[2][\macrocodecolor]{\doc@meta{#1{#2}}} +% \renewrobustcmd\declcs[2][]{^^A +% \if@nobreak \par\nobreak +% \else +% \par\addvspace\parskip^^A{.5ex plus 1ex}\noindent +% \needspace{\bottomtitlespace}% +% \fi +% \noindent +% \hspace{-\leftmargini}^^A +% \def\*{\unskip\,\texttt{*}}^^A +% \begin{tabular}{|l|}^^A +% \hline +% \expandafter\SpecialUsageIndex\csname #2\endcsname +% \raisedhyperdef[8pt]{declcs}{#2}{\cs[{#1}]{#2}}^^A +% }^^A +% \renewcommand\enddeclcs{% +% \crcr \hline +% \end{tabular}% +% \nobreak \par \nobreak +% \noindent +% \ignorespacesafterend +% } +% +% \newenvironment{declcs*}{\csname declcs*@begin\endcsname}{}^^A \begin{declcs*} width {num cols}[format]{command name} / width and format are optional +% \csdef{declcs*@begin}#1#{\ifblank{#1} +% {\csdef{declcs*@tabular}{\begin{tabular}}^^A +% \csdef{declcs*@endtabular}{\end{tabular}}} +% {\csdef{declcs*@tabular}{\begin{tabular*}{#1}}^^A +% \csdef{declcs*@endtabular}{\end{tabular*}}}^^A +% \csname declcs*@@begin\endcsname +% }^^A declcs*@begin +% \csedef{declcs*@@begin}#1{\noexpand\@testopt +% {\expandafter\noexpand\csname\@backslashchar declcs*\endcsname{#1}}{}} +% \csdef{\@backslashchar declcs*}#1[#2]#3{^^A +% \par\addvspace{0ex plus1ex}\noindent +% \hspace{-\leftmargini}^^A +% \csuse{declcs*@tabular}{|*{#1}l|}\hline +% \expandafter\SpecialUsageIndex\csname#3\endcsname +% \cs[{#2}]{#3}^^A +% }^^A +% \csdef{enddeclcs*}{^^A +% \crcr\hline +% \csuse{declcs*@endtabular}\nobreak\par\nobreak +% \noindent\ignorespacesafterend +% }^^A enddeclcs* +% \newrobustcmd\keytab[2][ol]{\makecell[tl]{^^A +% \begin{tabu}[t]{#1} +% #2 +% \end{tabu}}} +% \newrobustcmd\xkeytab[2][oX]{\makecell[tl]{^^A +% \begin{tabu} to\linegoal[t]{#1} +% #2 +% \end{tabu}}} +% \def\@makeactive#1{\catcode`#1\active} +% {\@makeactive\* +% \gdef\staractive{\@makeactive\*\def*{\expandafter\stform\string*}\expandafter\let\expandafter\*\expandafter=\string* +% \def\[{{\color{black}[}}\def\]{{\color{black}]}}} +% }% +% +% \newrobustcmd\textttbf[1]{\textbf{\texttt{#1}}} \let\texttbf\textttbf +% \renewrobustcmd*\bf{\bfseries}\newcommand\nnn{\normalfont\mdseries\upshape}\newcommand\nbf{\normalfont\bfseries\upshape} +% \newrobustcmd*\blue{\color{blue}}\newcommand*\red{\color{dr}}\newcommand*\green{\color{green}}\newcommand\rred{\color{red}} +% \newrobustcmd\rrbf{\color{red}\bfseries} +% \definecolor{optional}{rgb}{.67,.33,0.00} \newcommand\opt{\color{optional}} +% \definecolor{copper}{rgb}{0.67,0.33,0.00} \newcommand\copper{\color{copper}} +% \definecolor{dg}{rgb}{0.02,0.29,0.00} \newcommand\dg{\color{dg}} +% \definecolor{db}{rgb}{0,0,0.502} \newcommand\db{\color{db}} +% +% \definecolor{dr}{rgb}{0.75,0.00,0.00} \let\dr\red +% \definecolor{lk}{rgb}{0.2,0.2,0.2} \newrobustcmd\lk{\color{lk}} +% \newrobustcmd\bk{\color{black}}\newcommand\md{\mdseries} +% \newrobustcmd\ie{\emph{ie.}\,} +% \newrobustcmd\etc{{\bk\emph{etc.}}} +% \newrobustcmd\textt[2][]{\texttt{#1#2}} +% \newrobustcmd*\textitbf[1]{\textbf{\itshape#1}} +% \newcommand\cellstrut{}\let\cellstrut\bottopstrut +% \def\M{\@ifstar{\M@i\@firstofone}{\M@i\meta}} +% \def\M@i#1{\@ifnextchar[^^A] +% {\M@square#1} +% {\@ifnextchar(^^A) +% {\M@paren#1} +% {\M@brace#1}}^^A +% } +% \def\M@square#1[#2]{\M@Bracket[{#1{#2}}]} +% \def\M@paren#1(#2){\M@Bracket({#1{#2}})} +% \def\M@brace#1#2{\M@Bracket\{{#1{#2}}\}} +% \def\M@Bracket#1#2#3{{\ttfamily#1#2#3}} +% \newrobustcmd*\OR{{\rred\upshape\textttbf\textbar}} +% \newcommand*\NibRight{{\changefont{encoding=U,fam=ding}\symbol{'035}}} +% \newcommand*\HandRight{{\changefont{enc=U,family=ding}\symbol{'021}}} +% \newcommand*\Pisymbol[1]{{\changefont{enc=U,fam=pzd,ser=m,sha=n}\symbol{#1}}} +% \renewcommand\usepackage{\@ifstar{\use@package[\pkgcolor]}\use@package} +% \renewcommand\LoadInterface[1]{\hbox{\cs[\lk]{LoadInterface}\M*{\xpackage{#1}}}} +% \newrobustcmd\use@package[2][]{\hbox{\cs[\lk]{usepackage}\M*{{\ifcsundef{r@#2}{\xpackage{#1{#2}}}{\hyperref[#2]{\xpackage{#1{#2}}}}}}}} +% \pagesetup[corpus]{% +% head/rule/width=.1pt,head/rule/color=LightSteelBlue, +% left/offset=1cm, +% font=\scriptsize\color[gray]{.35}, +% foot/left/font+=\tiny, +% foot/right/font+=\smaller, +% head/left=The \thispackage\ package -- \thisinfo, +% head/right=\hyperref{}{}{\thefirstmarks{sectionanchor}}{\thefirstmarks{section}}, +% foot/left/offset=.7in, +% foot/left=\vbox to\baselineskip{\vss{{\rotatebox[origin=l]{90}{\thispackage\,[rev.\thisVersion]\,\copyright\,\thisyear\,\lower.4ex\hbox{\pkgcolor\NibRight}\,\FC}}}}, +% foot/right=\oldstylenums{\arabic{page}} / \oldstylenums{\pageref{LastPage}}, +% } +% \pagestyle{corpus} +% \pagesetup[plain]{ +% pagestyle=corpus, +% norules, +% head=, +% foot/left=\vbox to\baselineskip{\vss{{\rotatebox[origin=l]{90}{\thispackage\,[rev.\thisVersion]\,\copyright\,\thisyear\,\lower.4ex\hbox{\pkgcolor\NibRight}\,\FC\quad\xemail{florent.chervet at free.fr}}}}}, +% } +% +% \newrobustcmd*\IMPLEMENTATION{% +% \clearpage +% \hypersetup{bookmarksopenlevel=2} +% ^^A\geometry{top=0pt,includehead,headheight=1cm,headsep=.3cm,bottom=1.2cm,footskip=.5cm,left=2.5cm,right=1cm} +% \newgeometry{top=0pt,includehead,headheight=.8cm,headsep=.3cm,bottom=1.2cm,footskip=.5cm,left=4cm,right=.5cm} +% \pagesetup*{% +% left/offset+=1.5cm, +% right/offset-=.5cm, +% head/left=The \thispackage package (implementation) -- \thisinfo, +% head/right=\hyperref{}{}{\thefirstmarks{subsectionanchor}}{\thefirstmarks{subsection}}, +% }% +% \bookmarksetup{depth=4} +% \sectionformat\section{bookmark={bold*,italic*}} +% \sectionformat\subsection{ +% mark=\marksthe{subsection}{\arabic{section}.\arabic{subsection}\,{\pkgcolor\lower.2ex\hbox{\smaller\NibRight}\,##1}}^^A +% \marksthecs{subsectionanchor}{lastsubsectionanchor}} +% \sectionformat\subsubsection{ +% mark=\marksthe{subsubsection}{##1}\marksthecs{subsubsectionanchor}{lastsubsubsectionanchor}} +% \hfuzz=10pt +% \section{Implementation} \label{sec:implementation}} +% +% \let\plainllap\llap +% \newrobustcmd\macro@llap[1]{\global\let\llap\plainllap\setbox0\hbox{#1}^^A +% \ifdim\wd0>3cm\hbox to\z@{\hss\hbox to3cm{#1\hss}}^^A +% \edef\@tempa{\the\everypar\hskip\dimexpr\the\wd0-3cm\relax\global\everypar{}}% +% \global\everypar\expandafter{\@tempa}^^A +% \else\hbox to\z@{\hss#1}\fi +% \setbox\z@\box\voidb@x} +% \pretocmd\macro{\MacrocodeTopsep=\z@skip\MacroTopsep\z@skip\let\llap\macro@llap\parsep=\z@\topsep=\z@\itemsep=\z@\partopsep\z@}{}{} +% \apptocmd\endmacro{\goodbreak\vskip.3\parskip}{}{} +% +% \newcommand\reflinkcolor{\color{reflink}}\definecolor{reflink}{rgb}{0.49,0.00,0.00} +% \definecolor{reffilecolor}{rgb}{0,.3,0} +% \newrobustcmd*\xspaceverb{\ifnum\catcode`\ =\active\relax\else\expandafter\xspace\fi}^^A not \xspace in verbatim +% \let\Xspace \xspaceverb +% \newrobustcmd*\stform{\@ifnextchar*{\@stform[]\textasteriskcentered\@gobble}\@stform} +% \newrobustcmd*\@stform[2][\string]{\textttbf{\rred#1#2}\Xspace} +% \newrobustcmd*\HR[1][-.2ex]{\leavevmode\raise\dimexpr#1\relax\hbox{\pkgcolor\small\HandRight}} +% \newrobustcmd*\sectitle[2][]{Interface \HR\,\doclink[{#1}]{#2}} +% \def\Section[#1](#2)[#3]#4{% +% \expandafter\providecommand\csname itf@section@#1\endcsname{({#2})[{#3}]{#4}}^^A +% \section({#2})[{#3}]{\hyperdef{sec}{#1}{#4}}^^A +% \label{#1}\label{interfaces-#1}^^A +% } +% \newrobustcmd*\Subsection[1][]{\ifcsundef{itf@section@#1} +% {\errmessage{cle de section #1 non definie!}} +% {\expandafter\expandafter\expandafter\subsection\csname itf@section@#1\endcsname}% +% } +% \sectionformat\section{% +% font=\Large\bfseries, +% label=\llap{\arabic{section}}, +% labelsep=.5em, +% top=12pt minus3pt, +% bottom=4pt plus2pt minus2pt, +% mark=\marksthe{section}{\thesection\,{\pkgcolor\lower.2ex\hbox{\smaller\NibRight}\,#1}} +% \marksthecs{sectionanchor}{lastsectionanchor} , +% } +% \sectionformat\subsection{% +% bottom-=4pt, +% top = 4pt plus1pt minus2pt, +% label={\arabic{section}{\pkgcolor$\cdot$}\arabic{subsection}\,{\pkgcolor\smaller\Ankh}\,}, +% labelsep=0pt, +% break=\allowbreak, +% mark=\marksthe{subsection}{#1}\marksthecs{subsectionanchor}{lastsubsectionanchor}, +% } +% \newrobustcmd*\handler{\@ifstar{\@handler[]}\@handler} +% \newrobustcmd*\@handler[1][\db]{\@@handler{#1}} +% \def\@@handler#1/.#2/{{\leavevmode\ttfamily#1{/$\!\!$.#2}}} +% \makeatother +% ^^A---------------------------------------------------------------------------- +% \deffootnote{1em}{0pt}{\rlap{\textsuperscript{\thefootnotemark}}\kern1em} +% \title{\vspace*{-36pt}\href{http://www.tex.ac.uk/tex-archive/help/Catalogue/entries/interfaces.html}{\HUGE\textbf\thispackage}} +% \author{\small\thisdate~--~version \hyperref[v\thisversion]\thisVersion~--~\xpackage{pgf} v2.1 / \xpackage{pgf} v2.0 compatible} +% \date{} +% \subtitle{\LARGE\thisinfo\endgraf{\small\FC}} +% \maketitle +% +% {\makeatletter\let\@thefnmark\@empty\let\@makefntext\@firstofone +% \footnotetext{\noindent +% This documentation is produced with the \textt{DocStrip} utility.\par +% \begin{tabu}{X[-3]X[-1]X} +% \smex To get the package, &run: &\texttt{etex \thisfile.dtx} \\ +% \smex To get the documentation &run (thrice): &\textt{pdflatex \thisfile.dtx} \\ +% \leavevmode\hphantom\smex To get the index, &run: &\texttt{makeindex -s gind.ist \thisfile.idx} +% \end{tabu}§ +% The \xext{dtx} file is embedded into this pdf file thank to \xpackage{embedfile} by H. Oberdiek.} +% } +% +% \deffootnote{1em}{0pt}{\rlap{\thefootnotemark.}\kern1em} +% \vspace*{-26pt} +% \begin{abstract}\parindent0pt\parskip\medskipamount\leftskip0cm\rightskip\leftskip\lastlinefit0\noindent +% \thispackage provides a small number of user friendly macros to access features implemented in frequently used packages. +% Most of the macros are based on \xpackage{pgfkeys}, hence the ``\textt{key=value}'' syntax. +% +% \thispackage is mainly based on \xpackage{pgfkeys}\footnote{\noindent\xpackage{pgfkeys}: +% \href{http://www.ctan.org/tex-archive/graphics/pgf/base/generic/pgf/utilities}% +% {\nolinkurl{CTAN:graphics/pgf/base/generic/pgf/utilities}}} +% and \xpackage{scrlfile} for its different modules are loaded \cs{AfterPackage}. \eTeX{} is required of course... +% Each interface is actually made as a separate module, which is loaded automatically after its \emph{master package}. +% Adding \usepackage*{interfaces} into your document preamble will make all modules active +% (\ie they will be loaded or not, depending on your document preamble). +% If you prefer not to use all modules, you can load them separately as a package, for example, type: +% \usepackage*{interfaces-titlesec} \textitbf{after} \usepackage{titlesec}. +% A better way is to add \usepackage*{interfaces-base} to your preamble, and then:\, \LoadInterface{titlesec,tocloft}\, +% indifferently before or after \usepackage{titlesec,tocloft}. Another possibility to restrict the modules +% is to give them as options for the main package: +% \cs[\lk]{usepackage}\M*[\xpackage{titlesec,tocloft}]\M*{{\pkgcolor interfaces}}. +% +% \thispackage[interfaces-base] is a mandatory ``module''. It loads \thispackage[interfaces-scrlfile],\, +% \thispackage[interfaces-etoolbox]\footnote{All macros in \thispackage[interfaces-etoolbox] are defined +% with \cs{providecommand} except \cs[\red]{removefromstart} which is used by \csref[\red]{repeatcell}.}\, +% and\, \thispackage[interfaces-pgfkeys]: those are the \emph{system-layer} of \thispackage. +% +% \end{abstract} +% +% \medskip +% \centerline{\lk +% \tikz\draw [decoration=snake,decorate,thick] (0,1) -- ++(5,0); +% \quad \textbf{Example} \quad +% \tikz\draw [cm={-1,0,0,0,(0,0)},anchor=east,decoration=snake,decorate,thick] (0,1) -- ++(5,0); +% } +% {\scriptsize \def\com#1{{\dg\% #1}} +% \def\csred#1{\hyperref{}{declcs}{#1}{\cs[\red]{#1}}} +% \def\csblue#1{\hyperref{}{declcs}{#1}{\cs[\db]{#1}}} +% \begin{SaveVerbatim}[gobble=1,commandchars=$()]{FirstCol} +% $csred(pagesetup)[document]{% +% rules=.5pt, +% foot/left/odd=\arabic{page}, +% foot/right/even=\arabic{page}/\pageref{LastPage}, +% head/font=\color[gray]{.85}\bfseries\small, +% head/left/even=\leftmark, +% head/left=$csblue(thefirstmarks){MiniSection},$com(interfaces-marks) +% } +% $csred(pagesetup)[plain]{$com(for chapters...) +% pagestyle=document,$com(preloaded settings) +% head=, +% foot/left/odd = \roman{page}, +% norules, head/rule=.4pt +% head/center=This is the title, +% } +% $csred(sectionformat)\section[hang]{ +% label=\arabic{section}, +% labelsep=, +% font=\bfseries\Large, +% bookmark={bold,color=blue},$com(interfaces-bookmark) +% top=6pt plus3pt minus2pt, +% bottom=3pt plus2pt, +% break=\marksthecs{section}{($db(lastsectiontoc))},$com(interfaces-hypbmsec) +% mark=$csblue(marksthe){section}{#1},$com(interfaces-marks) +% } +% $csred(sectionformat)\subsection[hang]{ +% label=, labelsep=, +% font=\bfseries, +% bookmark=italic, +% top$stform*=1.2,$com(a 120$% scaling) +% bottom$stform+=0pt plus4pt,$com(add to previous value) +% mark=\markright{#1}, +% } +% \end{SaveVerbatim} +% \begin{SaveVerbatim}[gobble=1,commandchars=$()]{SecondCol} +% $csred(sectionformat)\MiniSection{$com(new sectionning command) +% class=straight[\subparagraph], +% shape=block, +% label=, +% top=3pt plus2pt, bottom=1pt, +% font=\bfseries\sffamily, +% bookmark=off,$com(or false or none) +% break=\allowbreak, +% mark=$csblue(marksthe){MiniSection}{#1},$com(see interfaces-marks) +% } +% $csred(bottomtitles)=.2\textheight +% $csred(tocsetup){ +% depth=3, title=Contents, pagenumbers=on, +% pagestyle=plain,$com(first page style: tocloftpagestyle) +% title/top=1.5ex plus.5ex, +% title/bottom=0pt, +% section/indent=1em, +% section/number/width=1.5em, +% section/font$stform+=\larger\bfseries,$com(append to previous setting) +% section/leaders,section/dotsep, +% subsection/indent=2em, +% subsection/number/width=2.5em, +% subsubsection/font=\scriptsize, +% subsection/leaders,subsection/dotsep,$com(default values) +% subsubsection/pagenumbers=off,$com(no page numbers) +% subsubsection/dotsep=,$com(no leader) +% columns=2,$com(same as twocolumns) +% columns/sep=.5em, +% columns/rule/width=1pt,columns/rule/color=blue, +% label=toc,$com(gives a label to the t.o.c.) +% bookmark={text=Contents,bold},$com(interfaces-bookmark) +% } +% \tableofcontents +% +% \mainmatter \pagestyle{document} +% \end{SaveVerbatim} +% \begin{multicols}{2} +% \UseVerbatim{FirstCol} +% \columnbreak +% \UseVerbatim{SecondCol} +% \end{multicols} +% } +% \clearpage +% +% \tocsetup{ +% title=\leavevmode{\pkgcolor\leaders\hrule height3.4pt depth-3pt\hfill}\quad Contents\quad {\pkgcolor\leaders\hrule height3.4pt depth-3pt\hfill\null}, +% title/bottom=3pt, +% before=\enlargethispage\baselineskip, +% depth=3, +% section/skip=3pt plus2pt minus3pt, +% subsection/skip=-1pt, +% subsection/font+=\smaller, +% subsubsection/font=\scriptsize\normalcolor, +% subsubsection/top=-3pt, +% subsubsection/dotsep=,subsubsection/pagenumbers=off, +% section/leaders,section/dotsep, +% twocolumns, +% columns/rule/color=pkgcolor,columns/rule=.4pt, +% after=\leavevmode{\pkgcolor\hrule height3.4pt depth-3pt\relax}, +% bookmark=bold,% +% bookmark/text=Contents,% +% } +% \tableofcontents +% +% \clearpage \bookmarksetup{startatroot,depth=3} +% \sectionformat\section{bookmark={color=pkgcolor,bold}} +% +% \Section[LaTeX](Interface LaTeX)[Interface \LaTeX{}]{Interface \LaTeX{}} +% +% +% \begin{declcs}[\red]{changefont}\{\staractive\hskip-2cm\keytab{^^A +% encoding\OR enc & changes \cs{fontencoding} \\ +% family\OR fam & changes \cs{fontfamily} \\ +% series\OR ser & changes \cs{fontseries} \\ +% shape\OR sha & changes \cs{fontshape} \\ +% size\OR size*\OR size\stform+\OR size\stform- & changes the font size (default unit is \textt{pt})\\ +% baselineskip\OR baselineskip*\stform+\stform-\OR skip & changes the \cs{baselineskip} for the font \\ +% linespread\OR linespread*\stform+\stform-\OR spread & changes the line spread (a real value) \kern4cm \} } +% \end{declcs} +% +% Example: adds 5\textt{pt} to the font size (\textt{pt} is added if not specified) and scale the \textt{linespread} by \textt{130\%}: +% +% \cs[\red]{changefont}\M*{ {\opt size}\stform+$=5$,spread\stform*$=1.3$} \quad (\cs{selectfont} is included in the macro). +% +% If a key is not specified, the current value remains. +% +% {\small Finally, \cs{changefont} is compatible with \xpackage{hyperref} thank to \cs{pdfstringdefDisableCommands}.} +% +% +% \begin{declcs}[\red]{quickprofile} \meta{number} \M{ code } +% \end{declcs} +% +% \cs{quickprofile} is a quick profiler macro: \M{code} is expanded \meta{number} times +% inside a \cs{vbox}. +% +% +% The macro requires \hologo{pdfTeX} and the \cs\pdfelapsedtime primitive. +% +% +% +% \ClearPage +% \Section[TikZ](Interface TikZ)[Interface TikZ]{Interface TikZ \raise.1ex\hbox{\smaller(\HR\doclink[\LocalOrCTAN{\LOCALDOC/../generic/pgf/pgfmanual.pdf}{\CTANbaseurl/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf}]{\mdseries pgfmanual})}} +% +% \begin{declcs}[\red]{usetikz} +% \{\begin{tabu}[t]{Ol} +% basic &loads \texttt{tikz} with libraries \textt{calc}, \textt{arrows}, \textt{scopes} and \textt{backgrounds} \\ +% all &loads \texttt{tikz} with all packages, pgf-modules and TikZ-libraries \\ +% {\normalcolor any other key} &\makecell[tl]{loads \texttt{tikz} and the specified package, module or library \\ +% using \cs{usepackage}, \cs{usepgfmodule} or \cs{usetizlibrary} \kern2cm\}} +% \end{tabu} +% \end{declcs} +% +% \cs[\red]{usetikz} is a facility provided to load \xpackage{pgf}, \xpackage{tikz}, \xpackage{pgf}-modules, and \xpackage{tikz}-libraries, +% without the need to know if you must use\, \cs{usepackage}\, or\, \cs{usepgfmodule}\, or\, \cs{usetikzlibrary}. +% +% Keys \textt{shorten>} and \textt{shorten<} have been set as aliases to \textt{shorten >} and \textt{shorten <} (original with space) +% and keys \textt{shorten<>} and \textt{shorten <>} have been set to style \textt{shorten >} and \textt{shorten <}. +% +% +% \cs[\red]{usetikz} does not parse options. If you are used to load \xpackage{pgf} with option (f.ex. \textt{version=0.96}), +% please use the syntax: +% \begin{Verb*} +% ($db(\PassOptionsToPackage)){version=0.96}{pgf} +% \end{Verb*} +% \bigskip +% +% \centerline{\bfseries\large\lk +% \tikz\draw [decoration=snake,decorate,thick] (0,1) -- ++(3,0); +% \quad \textsc{\bfseries Memo} \quad +% \tikz\draw [cm={-1,0,0,0,(0,0)},anchor=east,decoration=snake,decorate,thick] (0,1) -- ++(3,0); +% } +% {\footnotesize\arrayrulewidth=.8pt +% \begin{tabu} to\linewidth{>{\columncolor{AliceBlue}}X|[on2pt off1pt]>{\columncolor{LemonChiffon}}X|[on2pt off1pt]*{2}{>{\columncolor{AntiqueWhite}}X}}\firsthline +% \rowfont[c]{\bfseries\sffamily}\bottopstrut +% TikZ/pgf package &pgfmodules &\multicolumn2c{\cellcolor{AntiqueWhite} TikZ libraries} \\ \hline +% pgf &matrix &arrows &decorations.pathreplacing \\ +% pgfmath &plot &chains &decorations.shapes \\ +% pgfcalendar & &er &decorations.text \\ +% pgfplots & &scopes &decorations.markings \\ +% pgfpages & &snakes &decorations.fractals \\ +% tikz & &shapes &decorations.footprints \\ +% & &shapes.misc &positioning,trees \\ +% & &shapes.geometric &automata \\ +% & &shapes.arrows &patterns \\ +% & &shapes.multipart &fadings \\ +% & &shapes.callouts &shadows \\ +% & &shapes.symbols &through \\ +% & &shapes.gates.logic.US &backgrounds \\ +% & &shapes.gates.logic.IEC &petri \\ +% & &decorations &fit \\ +% & &decorations.pathmorphing &mindmap \\ +% & & &folding \\ +% & & &plothandlers \\ +% & & &plotmarks \\ +% & & &calc \\ +% & & &matrix \\ +% \hline +% \end{tabu}} +% +% ^^A{\scriptsize\raggedleft sorry for the blank cell, but I didn't get out with \xpackage{colortbl} and the \cs{multicolumn} entry...\par} +% +% \begin{declcs}[\red]{papergraduate}\M*[options] \qquad displays a graduated paper on the whole page background, \, \\ +% \qquad or inside a \textt{pgfpicture} : \\ +% \cs[\red]{papergraduate} +% [\begin{tabu}[t]{ol} +% x & unit for x axis (default is \textt{1cm}), \\ +% y & unit for y axis (default is \textt{1cm}), \\ +% unit & sets both \textt x and \textt y, \\ +% xcolor & color for horizontal graduations (default is \textt{magenta}), \\ +% ycolor & color for vertical graduations (default is \textt{cyan}) \\ +% color & sets both \textt{xcolor} and \textt{ycolor} \\ +% xrule & \textt{true} (default) or \textt{false}: displays the horizontal rule or not, \\ +% yrule & \textt{true} (default) or \textt{false}: displays the vertical rule or not, \\ +% xrule/font [\stform+,\stform*] & font for the labels on the horizontal rule \\ +% yrule/font [\stform+,\stform*] & font for the labels on the vertical rule \\ +% norule & don't display the rules \\ +% opacity & opacity for the graduations (default $=.25$)\\ +% text opacity & opacity for the rules labels (default =$.8$) \kern2cm] +% \end{tabu} \\ +% \hphantom{\cs{papergraduate}}\quad \M*(coordinate) \qquad \M*(coordinate); +% \end{declcs} +% +% \cs{papergraduate} is close to \xpackage{TikZ} \textt{grid} path and displays a real graduated paper. +% +% When used \emph{outside} of a \textt{pgfpicture}, \cs{papergraduate} alone draws a graduated paper +% as a wallpaper on the current page background (on this page with $x=1 in$ and $y=1 in$). +% +% The code is fast because based on \TeX{} primitive \cs{leaders} (faster than \textt{grid}). +% +% Examples: \papergraduate [x=1in,y=1in,xcolor=Fuchsia,ycolor=Chartreuse] +% +% \begin{multicols}{2} +% \begin{Verb}[commandchars=$<>] +% \tikz{ +% \coordinate (A) at (0,0); +% \papergraduate [opacity=.9] +% (A) ++ (8cm,3.5cm); } +% +% $smaller or \papergraduate (A) to ++ (8cm,3.5cm); +% $smaller or \papergraduate (A) -- ++ (8cm,3.5cm); +% \end{Verb} +% \columnbreak +% \tikz{ +% \coordinate (A) at (0,0); +% \papergraduate [opacity=.9,text opacity=1] (A) ++ (8cm,3.5cm); } +% \end{multicols} +% +% +% +% +% +% +% \clearpage +% \sectionformat\section{bookmark={color=db,bold}} +% \Section[titlesec]({\cs{sectionformat} (titlesec)})[{Interface titlesec: \cs[\red]{sectionformat}}]{\sectitle{titlesec}: \cs[\mdseries\red]{sectionformat}} +% +% \begin{declcs}[\red]{sectionformat}\M*{\cs{section}} \{ \hskip-2em +% \begin{tabu}[t]{OOOOO} +% class &\multicolumn{4}{l}{\textt{page}\OR\textt{top}\OR\textt{straight} \M*[\cs{sup-level}]} \\ +% shape &\multicolumn{4}{l}{\makecell[tl]{% +% \textt{hang}\OR\textt{block}\OR\textt{display}\OR\textt{runin}\OR\textt{leftmargin}\OR\textt{rightmargin}\OR \\ +% \textt{drop}\OR\textt{wrap}\OR\textt{frame}\OR\textt{runinifempty}}} \\ +% font\OR format &label &labelsep\OR sep \\ +% left &right &top &bottom \\ +% before &after &\omit & \omit \\ +% mark &break &thesection &\omit \rlap{\hfill\}} \\ +% \end{tabu} +% \end{declcs} +% +% \newrobustcmd\key[2][\keydefault]{\textt[{#1}]{#2}} \let\keydefault\opt +% +% \cs[\red]{sectionformat} is a \xpackage{pgfkeys}-command for replacement of both \cs{titleformat} and \cs{titlespacing}. +% \textbf{If a key is not given, its value remains the same} while with \cs{titleformat} or \cs{titlespacing}, you must +% specify all values in a rigid order... Moreover, \cs[\red]{sectionformat} can be used concurrently +% with \cs{titleformat} and \cs{titlespacing} (although \cs{sectionformat} is deemed more comfortable, this +% allows to quickly modify some files written without \thispackage.) +% +% Keys corresponding to \TeX{} code (\key{font}, \key{before} or \key{after}) are associated with starred keys and \stform+ keys: +% they append their content to the previous value. Ex: \key{font}\stform+$=$\M*{\cs{larger}} adds \cs{larger} to the previous settings. +% +% For dimensions or skips, the \stform+ key adds, the \stform- key substract and the \stform* key scales. +% +% +% \medskip +% +% \let\keydefault\db +% \def\EQUIV{{\normalcolor$\mathbf\equiv$}} +% +% \centerline{\bfseries\large\lk +% \tikz\draw [decoration=snake,decorate,thick] (0,1) -- ++(3,0); +% \quad \textsc{\bfseries Memo} \quad +% \tikz\draw [cm={-1,0,0,0,(0,0)},anchor=east,decoration=snake,decorate,thick] (0,1) -- ++(3,0); +% } +% {\small +% \begin{tabu} to\linewidth{>{\ttfamily\opt}ll>{\smaller}X}\hline +% class &name of the class &\key{page}=like standard \cs{part}\par\key{top}=like standard \cs{chapter}\par\key{straight}=like standard \cs{section} etc.\par example:\cs[\red]{sectionformat}\cs{subchapter}\M*{\ttfamily{\opt class}=straight[\cs{chapter}]} \\ +% shape &shape &\key{hang}=hanging label (like \cs{section})\par\key{block}=paragraph without formatting (for centered titles)\par\key{display}=like standard \cs{chapter}\par\key{runin}=like standard \cs{paragraph}\par\key{leftmargin}=left margin\par\key{rightmargin}=right margin\par\key{drop}=wraps the text around the title \textsmaller{(the first paragraph should be longer than the title, otherwise, they overlap)}\par\key{wrap}=like \key{drop} but the space reserved for the title is variable\par\key{frame}=like \key{display}+puts the title in frame\par\key{runinifempty}=\key{hang} but no label if the title is empty\par \\ +% font\EQUIV format &format for title &applied to the label and the title \\ +% label &title label &ex: \cs{arabic}\{section\} \\ +% sep \EQUIV labelsep &space between label and title & \\ +% left &left margin &a glue: horizontal space before \\ +% right &right margin &a glue: horizontal space after \\ +% top &vertical space before &a glue: vertical space before \\ +% bottom &vertical space after &a glue: vertical space after \\ +% mark ¯o with 1 parameter &ex \cs{sectionmark}: redefines \cs{...mark}\#1{...} (the argument is the title) \\ +% break ¶meterless macro &ex \cs{sectionbreak} to be executed just before the section command \\ +% thesection &\textt{toc} and \textt{ref} labels&redefines \cs{thesection} \endgraf \cs{thesection}, \cs{thesubsection} \etc. are used to print references and the label in the table of contents \\ +% before &code before title body & \\ +% after &code after title body & \\ +% \hline +% \end{tabu} +% } +% +% +% If the \xpackage{bookmark} package is loaded, with \thispackage[interfaces-bookmark], the following keys are defined for each section: +% +% {\small +% \begin{tabu} to\linewidth{>{\ttfamily\opt}ll>{\smaller}X}\hline +% bookmark/bold &bold bookmark text &the text of the bookmark for that sectionning command will be \textbf{bold} \\ +% bookmark/italic &italic bookmark text &the text of the bookmark for that sectionning command will be in \textit{italic} \\ +% bookmark/color &colored bookmark text &the text of the bookmark for that sectionning command will be {\opt colorized} \\ +% bookmark/off &disable the bookmark &no bookmark for that sectionning command {\small alternatively you may set \texttt{bookmark/level} to a huge value...} \\ +% bookmark/style &use a \emph{style} &the \emph{style} must be previouly declared with \cs{bookmarkdefinestyle} \\ +% bookmark/level &level of the bookmark &defines \cs{toclevel@\meta{sectionname}}, see \xpackage{bookmark} documentation \\ +% \hline +% \end{tabu} +% } +% +% The syntax: \cs[\red]{sectionformat}\cs[\rred]{subsection}\M*{{\opt bookmark}=\M*{bold,italic,color=green,on,view=FitB}} also works. +% +% {\smex\small\itshape Key \textt{bookmark} is an example of a key defined with the handler \handler/.is multiple choice/\,}. +% +% +% +% The starred keys \textt[\opt]{bold}\stform*, \textt[\opt]{italic}\stform*, \textt[\opt]{color}\stform* +% and \textt[\opt]{off}\stform* are also provided. +% For example: +% \begin{Verb*} +% \sectionformat\section{ +% after=\sectionformat\subsection{($opt(bookmark/color))$stform*=red} +% } +% \end{Verb*} +% makes the bookmarks corresponding to the first subsection in each section to be \textcolor{red}{red}. +% If you acertain that there is no bookmark between the one corresponding to the section and the one corresponding +% to its first subsection, then this is the same as: ``\textt{after=\cs{bookmarksetup}\M*{{\opt color\stform*}=red}}''. +% +% \bigskip +% +% \centerline{\bfseries\large\lk +% \tikz\draw [decoration=snake,decorate,thick] (0,1) -- ++(3,0); +% \quad \textsc{\bfseries Example} \quad +% \tikz\draw [cm={-1,0,0,0,(0,0)},anchor=east,decoration=snake,decorate,thick] (0,1) -- ++(3,0); +% } +% {\vspace*{-10pt}\small +% \begin{Verb*}[frame=lines] +% ($red(\sectionformat\section))[$texttbf(hang)]{% ($nnn this is the same as:) shape = hang +% ($opt(font))=\bfseries\scshape, +% ($opt(label))=\Roman{chapter}\ \textbullet\ \arabic{section}, +% ($opt(labelsep))=\widthof{\textbullet}, +% ($opt(bottom))=1ex plus.4ex minus.2ex, +% ($opt(top$stform+))=3pt, +% ($opt(mark))=\markright{$#1},% ($nnn=> this defines ) \def\sectionmark#1{\markright{#1}} +% ($opt(break))=\goodbreak, % ($nnn=> this defines ) \def\sectionbreak{\goodbreak} +% ($opt(thesection))=\Roman{chapter}.\arabic{section}, %($nnn redefines ) \def\thesection{...} +% ($opt(bookmark))={bold,color=blue} } +% \end{Verb*} +% } +% {\small +% \xpackage{titlesec} provides \emph{extended settings} for numberless (\ie starred) sections with the syntax: +% \begin{Verb*} +% \titleformat{name=\section,numberless}{...} +% \end{Verb*} +% +% One swallow does not a summer make, \thispackage[interfaces-titlesec] does not provides this feature in a \textt{key=value} stuff +% but just type: +% \begin{Verb*} +% ($red(\sectionformat))\section$stform*{ key=value } +% \end{Verb*} +% to give to your\, \cs{section}\stform*\, command a special format. Keys \textt[\opt]{label} and \textt[\opt]{labelsep} are not ignored, +% this means that\, \cs{section}\stform*\, can be defined in a way it produces a numbered section! Albeit, this would be weird +% because the \meta{section} counter is not updated for starred sections... +% } +% +% +% Presently, \cs[\red]{sectionformat} does not implement the \emph{extended settings} of \xpackage{titlesec} +% for \textt{odd} and \textt{even} pages. +% +% However, it is always possible to use \cs{sectionformat} concurrently with \cs{titleformat} and \cs{titlespacing}. +% A better way to use different settings for odd and even pages is the use of \cs{ifthispageodd} +% from the \KOMAScript\ classes, or the features provided by \xpackage{changepage.sty}, which is almost the same: +% actually \xpackage{titlesec} test oddity of the \texttbf{page} counter (\ie \TeX{} \cs{count} register nr \textt 0) +% while oddity of \cs{pageref} should be tested... Hence the decision I came not to implement different settings for +% \textt{odd} and \textt{even} pages in \cs{sectionformat}. +% +% \ClearPage +% \begin{declcs}[\red]{bottomtitles}\M{glue\OR percentage of \cs{textheight}} +% \end{declcs} +% +% This globally sets the value of \cs{bottomtitlespace} (see \doclink{titlesec} documentation): +% \begin{Verb*} +% \bottomtitles{.2} ($nnn sets $cs(bottomtitlespace) to) .2\textheight +% \bottomtitles=.2\textheight ($nnn is the same) +% \end{Verb*} +% +% You can globally set a negativ value: \cs{bottomtitles}$\,=-1$ to allow bottom titles. +% +% \ClearPage* +% +% \Section[hyperref](Interface hyperref)[Interface hyperref]{\sectitle[\LocalOrCTAN{\LOCALDOC/hyperref/manual.pdf}{\CTANbaseurl/macros/latex/contrib/hyperref/doc/manual.pdf}]{hyperref}} +% +% \begin{declcs}[\red]{raisedhyperdef}\M[raised dimen]\M{category}\M{name}\M{text} +% \end{declcs} +% +% Package \xpackage{hyperref} provides \cs{hyperdef} and \cs{Hy@raisedlink} but no easy way to insert a ``raised link'' +% with \cs{hyperdef} (or \cs{hypertarget}). +% +% \cs[\red]{raisedhyperdef} can be used exactly like \cs{hyperdef}, but the \textt{pdf}-anchor will be raised of the +% specified dimension. +% +% \ClearPage +% +% \Section[bookmark](Interface bookmark)[Interface bookmark]{\sectitle[\LocalOrCTAN{\LOCALDOC/oberdiek/bookmark}{\CTANbaseurl/macros/latex/contrib/oberdiek/bookmark}]{bookmark}} +% +% A few new keys appear with \thispackage for the command \cs{bookmarksetup}: +% +% \begin{declcs}[\red]{bookmarksetup} +% \{\begin{tabu}[t]{Ol} +% bold\stform* & will make the bookmark text bold, but only for the very next bookmark \\ +% italic\stform* & \emph{idem} for italic \\ +% color\stform* & \emph{idem} for color: the previous color will be restored after the next bookmark \\ +% disable & will disable the bookmarks (the same as \cs{bookmarksetup}\M*{depth=-2}) \\ +% disable\stform* & will disable only the very next bookmark \hfill\rlap\} +% \end{tabu} +% \end{declcs} +% +% Furthermore the following code: +% \begin{Verb*} +% ($red(\sectionformat))\section{($opt(bookmark))={bold,color=blue}} +% ($red(\bookmarksetup)){($opt(color$stform*))=red} +% \section{A lovely red, bold bookmark here!} +% \section{And the following bookmark is blue and bold} +% \end{Verb*} +% will produce a bookmark with attributes: \textt{color=red,bold=true}. In other words, the starred keys of \cs{bookmarksetup} +% overwrite the ``default'' settings of \cs{sectionformat} for the very next bookmark. +% +% {\smaller\itshape Note that this code requires \xpackage{titlesec}, \xpackage{bookmark}, +% \thispackage[interfaces-titlesec] and \thispackage[interfaces-bookmark].\par} +% +% Three new keys are added to the \cs{bookmark} command: +% +% \begin{declcs}[\red]{bookmark}\{\keytab{% +% pageref & the destination of the bookmark is the page referenced \\ +% ref & the destination of the bookmark is the anchor associated to the reference \\ +% atend & the bookmark will be inserted at the end of the document \hfill\rlap\} } +% \end{declcs} +% +% I admit those keys will not be used very often... but imagine you want to put a bookmark at the end, +% which points to the table of contents, then: +% +% \begin{Verb*} +% ($db(\bookmark))[($opt(ref))=TableOfContents,($opt(atend))]{Back To Contents} +% \end{Verb*} +% +% Provided that the label \textt{TableOfContents} has been defined, for example with \csref{tocsetup}, +% if \xpackage{tocloft} and \thispackage[interfaces-tocloft] are loaded: +% \begin{Verb*} +% ($dr(\tocsetup)){label=TableOfContents} ($db(\tableofcontents)) +% \end{Verb*} +% +% The \textt[\opt]{atend} key requires of course that the package \xpackage{bookmark} was loaded +% with the \texttbf{[atend]} option (otherwise, \xfile{bookmark.sty} gives a warning). +% +% +% \ClearPage* +% +% \Section[hypbmsec](Interface hypbmsec)[Interface hypbmsec]{\sectitle[\LocalOrCTAN{\LOCALDOC/oberdiek/hypbmsec}{\CTANbaseurl/macros/latex/contrib/oberdiek/hypbmsec}]{hypbmsec}} +% +% The features provided by \thispackage[interfaces-hypbmsec] are now independant +% of \xpackage{titlesec} and \thispackage[interfaces-titlesec]. +% +% Package \xpackage{hypbmsec} provides extended sectionning commands with the syntax: +% \begin{Verb*} +% \section$string(out$string)[toc]{title} ($nnn or) \section[toc]$string(out$string){title} +% \end{Verb*} +% Where: +% \begin{tabu}{>{\ttfamily}rl} +% \M*(out) &is used for the bookmark (outline) \\ +% \M*[toc] &for tha table and contents and the marks \\ +% \M*{title} &to typeset the section title in the document +% \end{tabu} +% +% +% Internally, \xpackage{hypbmsec} defines \cs{hbs@bmstring} (the string used for the bookmark entry) and +% \cs{hbs@tocstring} (the string used for the table of contents and the marks). +% +% \thispackage takes advantage of this and defines: +% \begin{Verb*} +% ($opt\lastsectiontitle) ($nnn expands to the title of the last) \section +% ($opt\lastsectionbookmark) ($nnn expands to the text of the bookmark for the last) \section +% ($opt\lastsectiontoc) ($nnn expands to the entry of the last) \section ($nnn in the table of contents) +% ($opt\lastsectionanchor) ($nnn expands to the anchor name of the last) \section ($nnn if $xpackage(hyperref) is used) +% \end{Verb*} +% +% Macros for each sectionning command are defined:§ +% \begin{tabu}{XXX} +% \cs[\opt]{lastparttitle} &\cs[\opt]{lastchaptertitle} & \\ +% \cs[\opt]{lastsectiontitle} &\cs[\opt]{lastsubsectiontitle} &\cs[\opt]{lastsubsubsectiontitle} \\ +% \cs[\opt]{lastparagraphtitle} &\cs[\opt]{lastsubparagraphtitle} & \\ +% \end{tabu} +% with their \textt[\opt]{\textellipsis bookmark} and \textt[\opt]{\textellipsis toc} counterparts. +% +% Assignation to those macros is automatic. More precisely, \cs{lastsectiontitle} is defined {\bfseries after \cs{sectionbreak}} +% and {\bfseries before \cs{sectionmark}}: this means that in the fields \textt[\opt]{after} or \textt[\opt]{mark} of \csref{sectionformat}, +% \cs{lastsectiontitle} has been updated yet. While in the fields \textt[\opt]{before}, and \textt[\opt]{break}, \cs{lastsectiontitle} is +% not yet updated. {\smaller(For chapters, this is the same if \xpackage{titlesec} formats the chapter +% titles, \ie if \cs{sectionformat}\cs{chapter} or \cs{titleformat}\cs{chapter} has been invoked. Otherwise, +% \cs{lastchaptertitle}, \cs{lastchapterbookmark} and \cs{lastchaptertoc} are set at \cs{stepcounter}\M*{chapter}.)}. +% +% Values are automatically reset to \csbf{relax} when a section of a superior level is created. +% +% This feature has been implemented essentially to make the use of a \cs{mark} command at \cs{sectionbreak} easier. +% Mark at \cs{sectionbreak} is important to get the correct behaviour for marks described in \thispackage[interfaces-marks] +% (page \pageref{marks} under \csref{ifmarksequal}). With this feature, when a new \cs{section} is created, +% \cs{lastsubsection} is reset to\, \csbf{relax}\, therefore,\, \cs{marksthecs}\M{subsection}\M{lastsubsection} +% will not mark anything. +% +% Another possibility is shown in this document: the header is clickable and has been defined with: +% \begin{Verb*} +% ($dr(\sectionformat))\section{ +% mark=($db(\marksthe)){section}{#1} +% ($db(\marksthecs)){sectionanchor}{lastsectionanchor} +% } +% ($dr(\pagesetup)){ +% head/right=($db(\hyperref)){}{}{($db(\thefirstmarks)){sectionanchor}} +% {($db(\thefirstmarks)){section}} +% } +% \end{Verb*} +% +% \ClearPage* +% +% +% \Section[tocloft]({\cs{tocsetup} (tocloft)})[{Interface tocloft: \cs[\red]{tocsetup}}]{\sectitle{tocloft}: \mdseries\cs[\red]{tocsetup}, \cs[\red]{lofsetup}, \cs[\red]{lotsetup} and \cs[\red]{listofsetup}} +% +% Setting the keys overwrites the previous value, unless the \stform+ key (append code/add for dimensions), the \stform- key (substract) +% or the starred-key\stform* (scale dimensions) is used. \cs[\red]{tocsetup} settings apply to \cs{tableofcontents} and +% also to \cs{shorttableofcontents} (package \xpackage{shorttoc}). \cs[\red]{tocsetup} can be invoked more than once in a document... +% +% \begin{declcs}[\red]{tocsetup}\{\hskip-2.2cm\staractive +% \makecell[tl]{\small +% \begin{tabu}[t]{oX} +% depth &\cs{setcounter}\M\*{tocdepth} {\smaller This is a \LaTeX{} rather than \xpackage{tocloft}'s ...} \endgraf With \thispackage you can change the t.o.c. depth anywhere inside your document, just like bookmarks depths (two runs are required) \\ +% title\OR contentsname &redefines \cs{contentsname} \\ +% title/top\OR title/top\stform+\OR title/top\stform-\OR title/top\stform* &vertical space before the title (set\OR add\OR substract\OR scale) \\ +% title/bottom \OR title/bottom\stform+ \etc &vertical space after the title \\ +% title/font\OR title/font\stform+\OR title/format &the title font (set\OR append code) \\ +% title/color\OR title/font/color &the color of the title (may also be defined in the key \textt{title/font}) \\ +% title/after\OR title/after\stform+ &hook to execute just after the title {\smaller(\cs{cftaftertoctitle}...)} \\ +% parskip\OR parskip\stform+\OR parskip\stform-\OR parskip* \OR parsep &modifies (or add to) \cs{cftparskip} \\ +% dotsep &modifies \cs{cftdotsep} {\smaller if no dimen is specified, $mu$ is assumed, otherwise, conversion to $mu\simeq 1em/18$ is supplied. Default value is $4.5mu$ and blank value is the same as \cs{cftnodots}} \\ +% dot &modifies \cs{cftdot}, the dot used for leaders produced by \cs{cftdotfill} \\ +% pagestyle &page style for the first page (\cs{tocloftpagestyle}) \\ +% mark &the mark command: \cs{cftmarktoc}§ {\small example: \cs{chaptermark}\cs{contentsname}} \\ +% before\OR before*\OR after\OR after* &hooks to execute before or after the command \cs{tableofcontents} \\ \tabucline[on1.5pt off1pt]- +% twocolumns\OR columns\OR multicol &\textt{twocolumns=true} is the same as \textt{columns=2}\, {\footnotesize Makes a multicolumn table of contents. Package \xpackage{multicol} is required!} \\ +% columns/sep\OR columns/sep\stform+\OR columnsep \etc &sets (or add) a \meta{dimen} to \cs{columnsep} \\ +% columns/rule\OR columns/rule\stform+\OR columnseprule \etc &sets (or add) a \meta{dimen} to \cs{columnseprule} \\ +% columns/color\OR columnseprulecolor &modifies \cs{columnseprulecolor} \\ +% multicolsep\OR multicolsep\stform+ \etc &modifies (or add) a \meta{glue} to \cs{multicolsep}§{\small\cs{multicolsep} is the space added before and after \textt{multicol} environment. \textsmaller{default value: $0pt plus 4pt minus 3pt$.}} \\ +% multicols/beforebegin &hook just before \cs{begin}\M*{multicols} \\ +% multicols/afterbegin\OR multicols/begin &hook just after \cs{begin}\M*{multicols} ... \\ +% multicols/beforeend\OR multicols/end\OR multicols/after &hook just before \cs{end}\M*{multicols} ... \\ +% multicols/afterend &... and after the group close by \cs{end}\M*{multicols} \\ \tabucline[on1.5pt off1pt]- +% label &the label for reference to the table of contents \\ +% ref &the reference printed by \cs{ref} when referencing the table of contents {\footnotesize(default is \cs{contentsname}. In any case, \cs{nameref} prints \cs{contentsname}.).} \\ \tabucline[on 1.5pt off1pt]- +% bookmark/text &the bookmark text for the table of contents {\footnotesize(if empty, no bookmark is set)} \\ +% bookmark/bold\OR bookmark/italic\OR bookmark/color &the bookmark style for the table of contents \\ +% bookmark/level &the bookmark level: either a number or \textt[\db]{section} or \textt[\db]{chapter}\endgraf{\footnotesize Default is chapter, or section if the class does not provide chapters.} \hfill\rlap\} +% \end{tabu}} +% \end{declcs}§ +% \textt[\opt]{bookmark} key and sub-keys are available only if the package \xpackage{bookmark} is loaded with \thispackage[interfaces-bookmark]. +% +% The following keys apply to each section levels. Section level names are : +% \texttt{part / chap {\it or} chapter / sec {\it or} section / subsec {\it or} subsection / subsubsec {\it or} subsubsection / +% para {\it or} paragraph / subpara {\it or} subparagraph / fig {\it or} figure / subfig {\it or} subfigure / tab {\it or} table / subtab {\it or} subtable}.§ +% \textcolor{LimeGreen}{\smaller\textbf\textparagraph} may be one of those names (see \doclink{tocloft} documentation). +% \enlargethispage{2\baselineskip}\vspace*{-6pt}\nobreak +% +% \begin{declcs}[\red]{tocsetup}\{\hskip-2.2cm\staractive +% \def\Z{\textcolor{LimeGreen}{\smaller\textbf\textparagraph}\/}% +% \makecell[tl]{\small +% \begin{tabu}[t]{oX} +% \Z/top\OR \Z/top\stform+\OR \Z/skip\OR \Z/beforeskip &modifies (or add to) the vertical \meta{glue} before an entry \\ +% \Z/indent\OR \Z/indent\stform+\OR\Z/indent\stform-\OR\Z/indent* &modifies (or add \etc) the indentation of the entry \\ +% \Z/font\OR \Z/font\stform+ &the font of the \Z\, section title \\ +% \Z/color\OR \Z/font/color &the color of the \Z\, section title (overwrites \textt{linkcolor} if hyper-linked) \\ +% \Z/number/width\OR number/width\stform+ \etc\OR numwidth &modifies the space allowed to typeset the title numbers \\ +% \Z/number/before\OR number/before\stform+\OR presnum &code before the section number \textsmaller{(see pseudo code below)} \\ +% \Z/number/after\OR number/after\stform+ \OR aftersnum &code after the section number \textsmaller{(see pseudo code below)} \\ +% \Z/title/before\OR title/before\stform+ \OR aftersnumb &code before the title (\ie after the section number box) \\ +% \Z/leader\OR\Z/leaders &modifies the leader: \textsmaller{the default is \cs{cftdotfill}\M*{\cs{cft\Z dotsep}}} \\ +% \Z/dotsep &the space (in $mu$) between dots in the leader. Default is \cs{cftdotsep} and blank value is the same as \cs{cftnodots} \\ +% \Z/pagefont\OR \Z/page/font\OR \Z/page/number/font &modifies the font used to typeset the page number \\ +% \Z/page/number/color \OR \Z/page/number/font/color &the color of the page numbers for this section (overwrites \textt{linkcolor} if the page number if hyper-linked) \\ +% \Z/page/after\OR \Z/pagenumber/after\OR afterpnum ¯o expanded after the page number is typeset \kern2cm\} \\ +% \end{tabu}} +% \end{declcs} +% +% \clearpage +% +% \centerline{\bfseries\large\lk +% \tikz\draw [decoration=snake,decorate,thick] (0,1) -- ++(3,0); +% \quad \textsc{\bfseries Memo} \quad +% \tikz\draw [cm={-1,0,0,0,(0,0)},anchor=east,decoration=snake,decorate,thick] (0,1) -- ++(3,0); +% }\par\kern-12pt\vskip1sp +% \begin{Verb*}[frame=lines] +% ($nnn numbered entries are typeset with this pseudo code:) +% {\cftXfont {\cftXpresnum SNUM\cftXaftersnum\hfil} \cftXaftersnumb TITLE}% +% {\cftXleader}{\cftXpagefont PAGE}\cftXafterpnum\par +% ($nnn and for not numbered entries:) +% {\cftXfont TITLE}{\cftXleader}{\cftXpagefont PAGE}\cftXafterpnum\par +% \end{Verb*} +% +% \cs[\red]{lofsetup} and \cs[\red]{lotsetup} behave the same. +% +% \begin{declcs}[\red]{listofsetup}\M{list-name}\M{key=value} +% \end{declcs} +% +% This command is provided to setup the parameters of user-defined lists created with \xpackage{tocloft}'s \cs{newlistof} and +% printed with \cs{listofX} (where\, \textt X\, is the name given to the list). The keys are the same as \csref[\red]{tocsetup}, +% and the sub-keys correspond to the entries. In fact: +% +% \begin{itemize} +% \item \cs{tocsetup} is a shortcut for \cs{listofsetup}\M*{toc} +% \item \cs{lofsetup} is a shortcut for \cs{listofsetup}\M*{lof} \, and +% \item \cs{lotsetup} is a shortcut for \cs{listofsetup}\M*{lot} +% \end{itemize} +% +% Example: +% +% \begin{Verb*} +% \newlistof[section]{answer}{ans}{List of Answers} $tikzlabel(start) +% \newlistentry[answer]{subanswer}{ans}{1} $tikzlabel(stop) +% ($rred(\listofsetup)){ans}{ +% depth=2, % can be changed inside the document body +% title=List of Answers of the section,% modifies the title +% title/font=\Huge, +% answer/font=\Large\bfseries, % font spec. +% subanswer/font=\large\itshape, +% answer/dotsep=3mu, +% subanswer/dotsep=, % no dot +% subanswer/pagenumbers=off, +% } +% \addcontentsline{ans}{answer}{\numberline{1}First answer} +% \addcontentsline{ans}{subanswer}{\numberline{1.1}First sub-answer} +% \listofanswer +% \end{Verb*} +% +% \tikz[remember picture,overlay]\path (start) -- (stop) node [midway,right] {\begin{tabu}\}{X[-1]}. preferably in\\ the preamble\end{tabu}}; +% +% \clearpage +% +% \Section[fancyhdr]({\cs{pagesetup} (fancyhdr)})[{Interface fancyhdr: \cs[\red]{pagesetup}}]{\sectitle{fancyhdr}: \cs[\mdseries\red]{pagesetup}} +% \begin{declcs}[\red]{pagesetup}\M[pagestyle-name]\{\\ \relax\staractive\smaller \def\etc{\omit\hfill\emph{etc.}\hfill}\def\phant{\hphantom{{=\textellipsis\,\hskip.5em}}} +% \begin{tabu} to\linewidth[t]{OOO>{\scriptsize}X} +% \omit\hfill {\opt\ttfamily norule\OR norules}\phant &\omit &\omit &set \cs{headrulewidth} and \cs{footrulewidth} to 0pt \\ +% rule\OR rule/width\[*\stform+\stform-\] &\omit &\omit &set \cs{headrulewidth} and \cs{footrulewidth} to a given value \\ +% rule/color &rule/font &\omit &To change the rule font/color \\ +% headrule &footrule &\omit &redefines \cs{headrule} and \cs{footrule} (no value restores default) \\ +% head/rule/width &foot/rule/width &foot/rule/skip &dimensions \\ +% head/rule/color &foot/rule/color &\omit &for head and foot rules separately \\ +% head/rule/font &foot/rule/font &\omit &\emph{idem} \\ \tabucline[on1.5pt off1pt]- +% head &foot &\omit &header and footer (\cs{fancyhead}/\cs{fancyfoot}) \\ +% left ¢er &right &by position \\ +% head/left &head/center &head/right &for one side documents \\ +% foot/left &foot/center &foot/right &\emph{idem} \\ +% head/left/even &head/left/odd &\omit &for two side documents \\ +% \etc &\etc &\etc & \\ +% foot/right/even &foot/right/odd &\omit & \\ +% inner &head/inner &foot/inner &\textt{inner} is an alias for \textt{right/even, left/odd} \\ +% outer &head/outer &foot/outer &\textt{outer} is an alias for \textt{left/even, right/odd} \\ \tabucline[on1.5pt off1pt]- +% offset &\omit &\omit &changes \cs{fancyhfoffset} \\ +% head/offset &foot/offset &\omit & \\ +% left/offset &right/offset &\omit & \\ +% head/left/even/offset &head/left/odd/offset &\omit &for two side documents \\ +% \etc &\etc &\etc & \\ +% foot/right/even/offset &foot/right/odd/offset &\omit &for two side documents \\ +% inner/offset &head/inner/offset &foot/inner/offset&\textt{inner} is an alias for \textt{right/even, left/odd} \\ +% outer/offset &head/outer/offset &foot/outer/offset&\textt{outer} is an alias for \textt{left/even, right/odd} \\ \tabucline[on1.5pt off1pt]- +% pagestyle &\omit &\omit &load the settings of another page style \hfill\rlap{\}} \\ +% \end{tabu} \\ +% \cs[\red]{pagesetup}\stform*\M[pagestyle-name]\M*{key\,=\,value} +% \end{declcs} +% +% \cs[\red]{pagesetup} resets all headers and footers, rules etc. and modifies the current (active) +% page style depending on the \textt{key=value} pairs. \cs[\red]{pagesetup}\M[page-style] defines (or redefines) +% a page style, starting from default values. When a key is specified with no value, the default is used (f. ex. +% \textt{head/rule} will be \textt{.4pt} and \textt{foot/rule} will be \textt{0pt}). +% +% \cs[\red]{pagesetup}\stform* does not reset current values: keys that are not specified remains the same. +% +% \cs[\red]{pagesetup}\stform*\M[page-style] defines or redefines \meta{page-style},; the normal form starts +% from scratch, while the starred form \cs{pagesetup}\stform* keeps previous values if they are not overwritten, +% and if the \meta{page-style} exists, of course. +% +% \verb+foot/left/odd+ is the same as \verb+odd/foot/left+ etc. but \texttt{twoside} option is not checked... +% Even pages are ignored in \textt{oneside} documents: this is \LaTeX{}, not \xpackage{fancyhdr} nor \thispackage[interfaces-fancyhdr]. +% +% As usual, for dimensions or glues, \stform+, \stform- and \stform* keys are provided for addition, substraction and scaling +% \csuse{@gobble}{(\smaller they are not provided for \textt{offsets} however, for dim reasons..)}. And for code (\textt{font} keys) the +% \stform+ and \stform* keys are provided: both append their content to the previous value. +% +% \clearpage +% +% \Section[marks](Interface marks)[Interface marks]{Interface marks} +% +% \thispackage[interfaces-marks] provides a few macros to make easier the use of \eTeX{} \cs{marks} registers. +% \eTeX{} defines \numprint{32768} marks registers, making the use of them far more comfortable than ``old'' \LaTeX{} \cs{markboth}, +% \cs{markright}, \cs{leftmark} and \cs{rightmark}. Who gets the correct -- I mean \emph{expected} -- result +% with such commands ? Not me, I can say ! +% +% +% \begin{declcs}[\red]{marksthe}\M{named-mark}\M{content} \\ +% \cs[\red]{marksthecs}\M{named-mark}\M{cs-name} +% \end{declcs} +% +% \cs[\red]{marksthe}\M{section}\M{content}\, will mark \meta{content} into a mark register referenced by +% the control sequence \cs{marks@\meta{section}}. \textbf{\meta{content}\, is not expanded}\, +% (You can expand before \cs{marksthe} if you need it). +% +% If the mark \cs{marks@\meta{section}} is not defined, then a new mark register is allocated +% (with \xpackage{etex}-\cs{newmarks}). +% +% \cs[\red]{marksthecs}\M{subsubsection}\M{cs-name}\, will similarly mark the unexpanded content of \cs{cs-name} +% by means of the marks register \cs{marks@\meta{subsubsection}}. \meta{cs-name} is really the +% \textitbf{name of the control sequence}, not the control sequence itself. If \cs{cs-name} is undefined or \cs{relax}, +% nothing is marked, making \cs{marksthecs} suitable to use with \cs{lastsectiontitle} \etc. at \cs{sectionbreak} +% (see \thispackage[interfaces-hypbmsec] p. \pageref{hypbmsec}). +% +% +% \begin{declcs}[\red]{thefirstmarks}\M{named-mark}\textsuperscript{\textsc{expandable}} \\ +% \cs[\red]{thebotmarks}\M{named-mark}\textsuperscript{\textsc{expandable}} \\ +% \cs[\red]{thetopmarks}\M{named-mark}\textsuperscript{\textsc{expandable}} +% \end{declcs} +% +% \begin{description}[font=\mdseries] +% \item[{\cs[\red]{thefirstmarks}\M{chapter}}] expands to \cs{firstmarks}\cs{marks@\meta{chapter}}\, (this is expandable +% in exactly one step of expansion), \ie either the content of the first invocation of \cs{marksthe}\M{chapter} +% on the current page, if \cs{marks} was used on the current page, or the last invocation of \cs{marks} +% if no marks occurs on the current page. +% \item[{\cs[\red]{thebotmarks}\M{chapter}}] expands to \cs{botmarks}\cs{marks@\meta{chapter}}\, \ie the content of the last +% invocation of \cs{marksthe}\M{chapter} (the most recent \cs{marks}). +% \item[{\cs[\red]{thetopmarks}\M{chapter}}] expands to \cs{topmarks}\cs{marks@\meta{chapter}}\, and this is the content of +% \cs{botmarks} at the time \TeX{} shipped out the last page. +% \end{description} +% +% If there is no mark or if the mark register does not exist, expansion is null (\ie nothing is done). +% +% {\small +% Those commands can be used in headers and footers, f.ex: +% \begin{Verb*} +% \sectionformat\section{ +% mark=($red(\marksthe)){section}{\arabic{section}\hskip.4em\textendash\hskip.4em#1}} +% \pagesetup{head/right=($red(\thefirstmarks)){section}} +% \end{Verb*} +% } +% +% \begin{declcs}[\red]{getthemarks}\cs{firstmarks}\OR\cs{botmarks}\OR\cs{topmarks}\M{named-mark}\M*{\cs{control-sequence}} \\ +% \cs[\red]{getthefirstmarks}\M{named-mark}\M*{\cs{control-sequence}} \\ +% \cs[\red]{getthebotmarks}\M{named-mark}\M*{\cs{control-sequence}} \\ +% \cs[\red]{getthetopmarks}\M{named-mark}\M*{\cs{control-sequence}} +% \end{declcs} +% +% You may wish to retrieve the values of \cs{firstmarks}, \cs{botmarks} or \cs{topmarks} into a macro. This is the +% purpose of these commands: \cs{control-sequence} is defined as a parameterless macro whose replacement text is +% the content of the specified marks register. +% +% {\small If the marks register\, \cs{marks@\meta{named-mark}}\, does not exist, the meaning of\, \cs{control-sequence}\, is +% \textt{undefined}. } +% +% \begin{declcs}[\red]{ifmarksequal}\M*{\cs{firstmarks}}\M*{\cs{topmarks}}\M*{named-mark}\M{true}\M{false} +% \end{declcs} +% +% Pretty often, we want to compare the botmarks with firstmarks or the topmarks, to adapt the header and/or footer +% in case those marks are equal or different, \ie in case the page contains a new section title or not: +% +% \cs[\red]{ifmarksequal} expands conditionnally code \M{true} only if the specified marks register to compare are equal, +% otherwise \M{false}. +% +% +% {\small +% \begin{tabu}{!{\textbullet}l@{\,=\,}l!{$\Leftrightarrow$}l} +% \cs{firstmarks} &\cs{botmarks} &there is at most one section title on the current page; \\ +% \cs{topmarks} &\cs{botmarks} &there is no section title on the current page;\\ +% \cs{firstmarks} &\cs{topmarks} &the last section title continues on the current page. +% \end{tabu} +% +% Those assertions are true only if you mark the section title at \cs{sectionmark} and at \cs{sectionbreak}: this is easy when using +% \thispackage[interfaces-hypbmsec]: \cs{sectionformat}\cs{subsection}\M*{break=\cs{marksthecs}\M*{subsection}\M*{lastsubsectiontoc}}. +% +% If the marks register\, \cs{marks@\meta{named-mark}}\, does not exist, the \M{false} part is expanded. +% } \enlargethispage\baselineskip +% +% +% \Section[makecell]({\cs{repeatcell} (makecell)})[{Interface makecell: \cs[\red]{repeatcell}}]{\sectitle{makecell}: \cs[\red]{repeatcell}} +% +% ^^A\subsection{\cs{repeatcell}} +% +% \xpackage{makecell} provides \cs{eline}, \cs{nline}, \cs{Xrows} to fill a table with empty cells, or repeated rows. +% +% \thispackage extends the possibility with \cs{repeatcell}. Although it is of general use, +% \cs{repeatcell} should be used softly in order to keep the \xext{tex} document intelligible (see the examples below). +% +% {\def\${\textt[\pkgcolor]\textdollar} +% While repeating cells, \cs{repeatcell} can also make calculations with: +% \begin{itemize} +% \item \cs{numexpr}, +% \item \$\cs{pgfmath}\$ (\csref{usetikz}\M*{{\opt pgfmath}} required in preamble) +% \item \$\$\cs{FPeval}\$\$ (\usepackage{fp} required in preamble) $\Rightarrow$ use \textt{round} to display the results! +% \end{itemize} +% Inside formulas \cs[\pkgcolor]{row} expands to the current row, \cs[\pkgcolor]{column} to the current column number (\cs{row} and \cs{column} are 1-based +% and relative to \cs{repeatcell}). +% +% \begin{declcs}[\red]{countvalues}\M{comma separated list} +% \end{declcs} +% +% \cs{countvalues}\M{comma separated list} expands to the number of values in the list. This is also the +% number of steps a \LaTeX{} \cs{@for} loop would do on the list: in other words, \textbf{empty values are counted}. +% \cs{countvalues} is provided to allow you to adjust automatically the number of columns of a tabular, +% depending on your data, with the\, \textasteriskcentered\, operator:\, +% \cs{begin}\M*{{\dg\underline{tabular}}}\M*{{\db\textt{\textasteriskcentered\M*{\cs[\red]{countvalues}\cs{list}}\M*{c}}}}. +% +% \cs{countvalue} is purely expandable in one expansion step. The \meta{comma separated list} is expanded once, +% exactly like in \LaTeX{} \cs{@for} {\smaller(\emph{hint:} you can put \cs{@empty} before, to avoid expansion).} +% +% \begin{declcs}[\red]{repeatcell}\M[alignment]\M{columns}\{\small $\leftarrow$ number of columns \emph{or} comma separated list of values \\ \hskip1em +% \xkeytab{^^A +% text &the text to be inserted (repeated) in each cell \\ +% font &the font inside the cell \\ +% rows &the number of rows (default is 1 row) \emph{or} a comma separated list of value: \M*{one,two,three,four,etc.}\quad Empty values \textitbf{are not} ignored. \\ +% cr\OR end &the end-of-row sequence (default is \cs{\backslashchar} but you may want \cs{crcr}\cs{hline} or \cs{tabularnewline}...)\endgraf {\bfseries end of row sequence \textitbf{is never} inserted after the last row.} \\ +% text/row1\OR text/row2\OR text/row3 \etc &If you want to change the text on the specified rows \\ +% text/col1\OR text/col2\OR text/col3 \etc &If you want to change the text on the specified columns \\ +% font/row1\OR font/row2\OR font/row3 \etc &If you want to change the font on the specified rows \\ +% font/col1\OR font/col2\OR font/col3 \etc &If you want to change the font on the specified columns \\ +% cr/row1\OR cr/row2 \OR cr/row3 \etc &If you want to change the end-of-line sequence on the specified rows \\ +% transpose &Do you wish to invert rows and columns ? Then \textt[\opt]{transpose}\textt{=true}\, \textlarger\Smiley. \\ +% {\pkgcolor any other key} &can be used to make calculations using \cs{numexpr} or \$\cs{pgfmathparse}\$ or \$\$\cs{FPeval}\$\$.\quad Pay attention to put your formula inside curly brackets \M*{\$formula\$} if it contains a comma\, \lower.4ex\hbox{\framebox(10,10){,}}\, or an equal\, \lower.4ex\hbox{\framebox(10,10){=}}\, sign! \cellstrut \hfill\rlap{\}} \\ +% } +% \end{declcs} +% } +% \unskip +% \begin{enumerate}[label=\HR] +% \item If \M[alignment] is specified, then each cell is placed into a \cs{makecell}\M[alignment] command. +% \item If both\, \textt[\opt]{text/row$$}\, and\, \textt[\opt]{text/col$$}\, are specified for the same cell, then \xpackage{makecell} \cs{diaghead} +% is used to display the values in a diagonally divided cell. +% \item If you want to see (in the \xext{log} file) the code introduced into the tabular (or array) by \cs[\red]{repeatcell} +% type\, \cs{let}\cs{itf@message}=\cs{message}\, before \cs{repeatcell}. +% \end{enumerate} +% +% +% \textitbf{Formulas:} +% if you say: \textt{{\pkgcolor x}$\,=\,$\textt[\pkgcolor]\$sin(10*\cs[\pkgcolor]{column})\textt[\pkgcolor]\$} for example, then +% the formula is evaluated in each cell with \cs{pgfmath}. The result is stored into the control sequence \cs[\pkgcolor]{x} and +% can be used in \textt[\opt]{text} or in any other following formula. The order in which the computed keys are given determines +% the order of evaluation... \emph{of course!} +% +% If you specify the number of columns (\emph{resp.} of rows) as an integer, then \cs[\red]{repeatcell} works exactly as if +% you gave it a list of integers \M*{$1,2,3,4,...,p$}. +% +% If you specify the rows as a comma separated list of values, the following sequences are also admissible in \textt[\opt]{text}:\par\nobreak +% +% \begin{tabu} to\linewidth{>{\ttfamily}p{\widthof{\cs[\pkgcolor]{C}\cs[\pkgcolor]{column}}}X} +% \cs[\pkgcolor]{R}\cs[\pkgcolor]{row} &refer to the value of the list for the current row. \cs[\pkgcolor]{r} is the same {\smaller(unless you defined a formula named \textt[\pkgcolor]{r}).} \\ +% \cs[\pkgcolor]{R}\M{n} &to the value of the list for row \M{n} \\ +% \end{tabu} +% +% If the number of rows is specified as an integer, then \cs[\pkgcolor]R\cs[\pkgcolor]{row},\, \cs[\pkgcolor]r\, and \,\cs[\pkgcolor]{row} +% are equal (to the current row index). +% +% Similarly if you specify the columns as a comma separated list of values, the following sequences are provided:\par\nobreak +% \begin{tabu} to\linewidth{>{\ttfamily}X[-1m]X[m]} +% \cs[\pkgcolor]{C}\cs[\pkgcolor]{column} &refer to the value of the list for the current column. \cs[\pkgcolor]{c} {\smaller is the same, unless you defined a formula named \textt[\pkgcolor]{c}.} \\ +% \cs[\pkgcolor]{C}\M{m} &to the value of the list for column \M{m} \\ +% \end{tabu} +% +% If the number of columns is specified as an integer, then \cs[\pkgcolor]C\cs[\pkgcolor]{row},\, \cs[\pkgcolor]c\, and\, \cs[\pkgcolor]{col} +% are equal {\smaller(to the current column index)}. +% +% If the values in the lists are numeric, \cs[\pkgcolor]R,\, \cs[\pkgcolor]C,\, \cs[\pkgcolor]r\, and \cs[\pkgcolor]c\, +% can be used in formulas as well, \emph{o{\smaller f c{\smaller our{\smaller se...}}}} +% +% \medskip +% +% \centerline{\bfseries\large\lk +% \tikz\draw [decoration=snake,decorate,thick] (0,1) -- ++(3,0); +% \quad A few examples are better than a 10 pages description !\quad +% \tikz\draw [cm={-1,0,0,0,(0,0)},anchor=east,decoration=snake,decorate,thick] (0,1) -- ++(3,0); +% } +% +% +% \subsection{Conversion to scaled points} +% +% \begin{Verb*} +% \def($db(\listofunits)){ pt , cm , mm , bp , dd , pc , in , cc ,sp } +% \begin{($dg$underline(tabu))}{|>{\bfseries}c|*9{X[mc]|}} \hline +% \thead{units} +% & ($red(\repeatcell))[c]($db(\listofunits)){ ($opt(text)) = \c, font=\bfseries } \\ \hline +% \thead{value in\\ scaled\\ points} +% & ($red(\repeatcell))($db(\listofunits)){% +% ($pkgcolor(sp)) =\number\dimexpr 1($pkgcolor(\c))\relax, +% ($opt(text))=\numprint[sp]($pkgcolor(\sp))} \\ \hline +% \end{($dg$underline(tabu))} +% \end{Verb*} +% +% {\footnotesize +% \def\listofunits{pt,cm,mm,bp,dd,pc,in,cc,sp} +% \noindent +% \begin{tabu}{|>{\bfseries}c|*9{X[mc]|}} \hline +% \thead{units} & \repeatcell\listofunits{text=\c, font=\bfseries } \\ \hline +% \thead{value in \\ scaled\\ points} & \repeatcell\listofunits{ sp=\number\dimexpr1\c\relax, text=\numprint[sp]\sp} \\ \hline +% \end{tabu} +% } +% +% \subsection{Variable length cell} +% +% \begin{Verb}[commandchars=Ł:;] +% \newcommand\FAMILY[3]{% +% \begin{:ŁdgŁunderline:tabu;;}to .4\linewidth{|*3{X[mc]}|} \hline +% Mother & Father & Children \\ \hline +% #1 & #2 & \makecell{:Łred:\repeatcell;;{#3}{text=:Łpkgcolor:\c;;, :Łopt:transpose;;} \\ \hline +% \end{:ŁdgŁunderline:tabu;;}} +% \FAMILY{Johanne}{Georg}{Priscilla,John,Tom} +% \FAMILY{Nut}{Geb}{Isis,Osiris,Seth,Nephthys} +% \end{Verb} +% +% +% \newcommand\FAMILY[3]{^^A +% \begin{tabu} to.4\linewidth{|*3{X[mc]}|} \hline +% Mother & Father & Children \\ \hline +% #1 & #2 & \makecell{\repeatcell[c]{#3}{text=\c,font=\color{green},transpose}} \\ \hline +% \end{tabu}} +% {\footnotesize \centering +% \FAMILY{Johanne}{Georg}{Priscilla,John,Tom} +% \FAMILY{Nout}{Geb}{Isis,Osiris,Seth,Nephthys}\par +% } +% +% +% \subsection{Empty rows} +% +% \begin{tabu*}{X[4m]X[cm]} +% \footnotesize +% \begin{Verbatim} +% \begin{tabu}{*6{|c}|} \hline +% \repeatcell 6{ text/col1=\row, rows=4, end=\\ \hline } \\ \hline +% \end{tabu} +% \end{Verbatim} +% & +% \begin{tabu}{*6{|c}|} \hline +% \repeatcell 6{ text/col1=\row, rows=4, end=\\ \hline } \\ \hline +% \end{tabu} +% \end{tabu*} +% +% +% \begin{tabu*}{X[4m]X[cm]} +% \footnotesize +% \begin{Verbatim} +% \begin{tabu}{*4{|c}|} \hline +% \repeatcell 6{ text/col1=\row, rows=4, end=\\ \hline , transpose} \\ \hline +% \end{tabu} +% \end{Verbatim} +% & +% \begin{tabu}{*4{|c}|} \hline +% \repeatcell 6{ text/col1=\row, rows=4, end=\\ \hline , transpose} \\ \hline +% \end{tabu} +% \end{tabu*} +% +% +% \subsection{color palette} +% \label{repeatcell:colors} +% {\footnotesize +% \begin{Verb*}[commandchars=Ł|+] +% \begin{|ŁdgŁunderline|tabu++}{*4c} +% |Łred|\repeatcell++ {8}{|Łopt|transpose++=true, rows=4, +% red = {$$round(\c/8*255,0)$$}, +% greeni = \red, bluei = \red, +% greenii = {$$round(255-\red,0)$$}, blueii = \red, +% greeniii = \red, blueiii = {$$round(255-\red,0)$$}, +% greeniv = \greenii, blueiv = \blueiii, +% text/row1={\cellcolor[RGB]{\red,\greeni,\bluei}(\red,\greeni,\bluei)}, +% text/row2={\cellcolor[RGB]{\red,\greenii,\blueii}(\red,\greenii,\blueii)}, +% text/row3={\cellcolor[RGB]{\red,\greeniii,\blueiii}(\red,\greeniii,\blueiii)}, +% text/row4={\cellcolor[RGB]{\red,\greeniv,\blueiv}(\red,\greeniv,\blueiv)} } +% \end{|ŁdgŁunderline|tabu++} +% \end{Verb*} +% }§ +% \begin{center}\smaller +% \begin{tabu}{*4c} +% \repeatcell {8}{transpose=true, rows=4, +% red = {$$round(\c/8*255,0)$$}, +% greeni = \red, bluei = \red, +% greenii ={$$round(255-\red,0)$$}, blueii = \red, +% greeniii = \red, blueiii = {$$round(255-\red,0)$$}, +% greeniv = \greenii, blueiv = \blueiii, +% text/row1={\cellcolor[RGB]{\red,\greeni,\bluei}(\red,\greeni,\bluei)}, +% text/row2={\cellcolor[RGB]{\red,\greenii,\blueii}(\red,\greenii,\blueii)}, +% text/row3={\cellcolor[RGB]{\red,\greeniii,\blueiii}(\red,\greeniii,\blueiii)}, +% text/row4={\cellcolor[RGB]{\red,\greeniv,\blueiv}(\red,\greeniv,\blueiv)}, +% } +% \end{tabu} +% \end{center} +% +% {\smaller \textitbf{Note: } \xpackage{makecell} interact very badly with \xpackage{colortbl}. Therefore, with \cs{cellcolor} +% or \cs{rowcolor}, the optional \M[alignment] parameter of \cs[\red]{repeatcell} does not give good results... \xpackage{colortbl} +% remain a rather rough package, and deserve a finer implementation... in future.} +% +% +% \subsection{\xpackage{tabularcalc}-like tables (with \xpackage{dcolumn} package) and \xpackage{pgfmath}} \enlargethispage{2\baselineskip} +% +% {\footnotesize \def\${\textt[\pkgcolor]\textdollar} +% \begin{Verb}[commandchars=Ł:;] +% \def\listofx{ -4 , -2 , 0 , 2.25 , 7 } +% $$\begin{:ŁdgŁunderline:tabu;;}{|c<{\bottopstrut}|*{5}{|D..{5.5}}|} \hline +% :Łred\rowfont;{\large\color{blue}} +% x &:Łred:\repeatcell;;\listofx{ text=\C\column } \\ \hline\hline +% f(x)=2x-3 &:Łred:\repeatcell;;\listofx{ fx = Ł$2*\c-3Ł$, text=\fx } \\ \hline +% x^2 &:Łred:\repeatcell;;\listofx{ xsquare = Ł$\C\column^2Ł$ , text = \xsquare } \\ \hline +% h(x) = \sqrt{x^2+1} &:Łred:\repeatcell;;\listofx{ x=\C\column, hx = {Ł$sqrt(pow(\x,2)+1)Ł$}, text = \hx } \\ \hline +% \end{:ŁdgŁunderline:tabu;;}$$ +% \end{Verb} +% § +% \def\listofx{ -4 , -2 , 0 , 2.25 , 7 } +% $$\begin{tabu}{|c<{\bottopstrut}|*{5}{|D..{5.5}}|} \hline +% \rowfont{\ifmmode$\large$\else\large\fi\color{db}} +% x &\repeatcell\listofx{ text=\C\column } \\ \hline\hline +% f(x)=2x-3 &\repeatcell\listofx{ fx = $2*\c-3$, text=\fx } \\ \hline +% x^2 &\repeatcell\listofx{ xsquare = $\C\column^2$ , text = \xsquare } \\ \hline +% h(x) = \sqrt{x^2+1} &\repeatcell\listofx{ x=\C\column, hx = {$sqrt(pow(\x,2)+1)$}, text = \hx } \\ \hline +% \end{tabu}$$\nobreak +% \centerline{\$\cs{pgfmath}\$ computations}§ +% +% $$\begin{tabu}{|c<{\bottopstrut}|*5{|D..{5.5}}|} \hline +% \rowfont{\ifmmode$\large$\else\large\fi\color{db}} +% x &\repeatcell\listofx{ text=\C\column } \\ \hline\hline +% f(x)=2x-3 &\repeatcell\listofx{ fx = {$$round(2*\c-3,5)$$}, text=\fx } \\ \hline +% x^2 &\repeatcell\listofx{ xsquare = {$$round(abs(\C\column)^2,5)$$} , text = \xsquare } \\ \hline +% h(x) = \sqrt{x^2+1} &\repeatcell\listofx{ x=\C\column, hx = {$$round(root(2,abs(\x)^2+1),5)$$}, text = \hx } \\ \hline +% \end{tabu}$$\nobreak +% \centerline{And the same with \$\$\cs{FPeval}\$\$\, (\xpackage{fp} package)} +% } +% +% \pagebreak +% \subsection{Double entry array: the Body Mass Index} +% {\smaller \def\${\textt[\pkgcolor]\textdollar} +% \begin{Verb}[commandchars=Ł:;] +% \def:Łdb:\weightlist;;{weight in kg, 30, 45, 50, 55, 60, 65, 70, 80, 90, 95, 100, 110, 120} +% \def:Łdb:\heightlist;;{height in cm, 190, 180, 170, 160, 150, 140, 130} +% \colorlet{denutrition}{Crimson} \colorlet{skinniness}{yellow} \colorlet{normal}{LawnGreen} +% \colorlet{obesity}{Moccasin} \colorlet{serious obesity}{DarkOrange} \colorlet{morbid obesity}{Fuchsia} +% \newcommand*\mycolor[1]{\cellcolor{% +% \ifdim#1pt<17pt denutrition\else \ifdim#1pt<19pt skinniness\else \ifdim#1pt<26pt normal\else +% \ifdim#1pt<30pt obesity\else \ifdim#1pt<35pt serious obesity\else morbid obesity\fi\fi\fi\fi\fi}} +% +% \begin{:ŁdgŁunderline:tabu;;}{*{:Łdr:\countvalues;;:Łdb:\heightlist;;}{|c}|} \hline +% :Łdr:\repeatcell;; :Łdb:\heightlist;; {% +% rows = :Łdb:\weightlist;;, +% :Łpkgcolor:height;; = \ifnum\column>1 :Łpkgcolor\c;\else 1\fi, +% :Łpkgcolor:weight;; = \ifnum\row>1 :Łpkgcolor\r;\else 1\fi, +% :Łpkgcolor:BMI;; = {Ł$Ł$round(:Łpkgcolor:\weight;;/((:Łpkgcolor:\height;;/100)^2),1)Ł$Ł$}, +% text = \mycolor{:Łpkgcolor\BMI;}:Łpkgcolor\BMI;, +% text/row1 = :Łpkgcolor\c;, font/row1 = \color{NavyBlue}, cr/row1 = \\ \hline, +% text/col1 = :Łpkgcolor\r;, font/col1 = \color{DarkViolet}, +% } \\ \hline +% \end{:ŁdgŁunderline:tabu;;}\quad +% \begin{:ŁdgŁunderline:tabu;;}{|c|} +% :Łdr:\repeatcell;;{denutrition,skinniness,normal,obesity,serious obesity,morbid obesity}{% +% text=\cellcolor{:Łpkgcolor\c;}{:Łpkgcolor\c;},:Łopt:transpose;;,font=\large\bfseries\bottopstrut} +% \end{:ŁdgŁunderline:tabu;;} +% \end{Verb} +% +% \def\weightlist{weight in kg, 30, 45, 50, 55, 60, 65, 70, 80, 90, 95, 100, 110, 120} +% \def\heightlist{height in cm, 190, 180, 170, 160, 150, 140, 130} +% \colorlet{denutrition}{Crimson} \colorlet{skinniness}{yellow} \colorlet{normal}{LawnGreen} +% \colorlet{obesity}{Moccasin} \colorlet{serious obesity}{DarkOrange} \colorlet{morbid obesity}{Fuchsia} +% \newcommand*\mycolor[1]{\cellcolor{% +% \ifdim#1pt<17pt denutrition\else \ifdim#1pt<19pt skinniness\else \ifdim#1pt<26pt normal\else +% \ifdim#1pt<30pt obesity\else \ifdim#1pt<35pt serious obesity\else morbid obesity\fi\fi\fi\fi\fi}} +% +% \ifx y\interfacesquick \else +% \begin{tabu}{*{\countvalues\heightlist}{|c}|} \hline +% \repeatcell\heightlist{% +% rows=\weightlist, +% height=\ifnum\column>1 \c\else 1\fi, +% weight=\ifnum\row>1 \r\else 1\fi, +% BMI={$$round(\weight/((\height/100)^2),1)$$}, +% text=\mycolor{\BMI}\BMI, +% text/row1=\c, font/row1=\color{NavyBlue}, +% cr/row1=\\ \hline, +% text/col1=\r, font/col1=\color{DarkViolet}, +% } \\ \hline +% \end{tabu}\quad +% \begin{tabu}{|c|} +% \repeatcell{denutrition,skinniness,normal,obesity,serious obesity,morbid obesity}{% +% text=\cellcolor{\c}{\c},transpose,font=\large\bfseries\bottopstrut} +% \end{tabu} +% \medskip +% +% \begin{tabu}{*{\countvalues\weightlist}{|c}|} \hline +% \repeatcell\heightlist{transpose, +% rows=\weightlist, +% height=\ifnum\column>1 \c\else 1\fi, +% weight=\ifnum\row>1 \r\else 1\fi, +% BMI={$$round(\weight/((\height/100)^2),1)$$}, +% text=\mycolor{\BMI}\BMI, +% text/row1=\c, font/row1=\color{NavyBlue}, cr/row1=\\ \hline, +% text/col1=\r, font/col1=\color{DarkViolet}, +% } \\ \hline +% \end{tabu}\par\nobreak +% \centerline{The same with \textt[\opt]{transpose}} +% \fi +% +% \textitbf{Note that \xpackage{fp} computation can be time consuming...} depending on the formula and the number of cells to fill in. +% While preparing first such a table, give to the computed keys a constant value, and plug the formulas only when you are +% satisfied with the displayed tabular... +% } +% +% \ClearPage* +% +% \Section[enumitem](Interface enumitem)[Interface enumitem]{\sectitle{enumitem}: \cs[\red]{setlist}} +% +% \begin{declcs}[\red]{setlist}\hphantom{\stform*}\M*[environment,level,environment,level,\etc]\{\\ +% \hphantom{\cs{setlist}\stform*}\xkeytab[oX]{ +% label &the label to be used \\ +% font &the label font \\ \tabucline[on1.5pt off1pt]- +% topsep &vertical space before the list \\ +% partopsep &vertical space \\ +% parsep &value of \cs{parskip} inside the list \\ +% itemsep &vertical space between two items \\ \tabucline[on1.5pt off1pt]- +% leftmargin &the list left margin \\ +% rightmargin &the list right margin \\ +% listparindent &the value of \cs{parindent} inside the list \\ +% labelwidth &the width of the label box \\ +% labelsep &horizontal space between label and following text \\ +% itemindent &the indentation of the items \kern4cm \} +% } \\ +% \cs[\red]{setlist}\stform*\M[environment,level,environment,level,\etc]\M*{key=value} +% \end{declcs} +% +% Enumerated lists, description lists or itemize lists can be defined by \xpackage{enumitem} +% with the command \cs{newlist}. +% +% For example: \cs{newlist}\M*{mylegal}\M*{enumerate}\M*{10} +% +% The list can be customized with \cs{setlist}, for example: +% \begin{Verb}[fontfamily=cmtt] +% \setlist[mylegal,1]{label*=\arabic*.} +% \setlist[mylegal,2]{label*=\arabic*.} +% \setlist[mylegal,3]{label*=\roman*)} +% \end{Verb} +% +% With \thispackage[interfaces-enumitem] you may specify more than one level at a time in \cs{setlist}, +% (and even more than one environment at a time): +% \begin{Verb}[fontfamily=cmtt] +% \setlist[mylegal,1,2]{label*=\arabic*.} +% \setlist[mylegal,3]{label*=\roman*)} +% \end{Verb} +% +% \ClearPage +% A list can also be \textbf{modified} with \cs[\red]{setlist}\stform*: keys that are not specified remain the same. +% \begin{Verb*}[fontfamily=cmtt] +% \setlist$stform*[mylegal,1,2,3]{align=left,leftmargin=*} +% ($nnn or) +% \setlist$stform*[mylegal]{align=left,leftmargin=*} +% \end{Verb*} +% +% \begin{declcs}[\red]{interitem} +% \end{declcs} +% +% Just like \hologo{AmS} \cs{intertext} in math formul\ae, \cs[\red]{interitem} allows to put some non intented text inside +% a list environment. Example: +% +% \begin{Verb}[commandchars=Ł:;] +% \begin{:ŁdgŁunderline:enumerate;;}[label=\roman*)\,,parsep=0pt] +% \item First item in the enumerate envir +% :Łred:\interitem;; or (intertext) +% \item Second item +% \end{:ŁdgŁunderline:enumerate;;} +% \end{Verb} +% +% The example give in real world: +% \begin{enumerate}[label=\roman*)\,,parsep=0pt] +% \item First item in the enumerate envir +% \interitem or: (intertext) +% \item Second item +% \end{enumerate} +% And the following follows... +% +% \clearpage +% \Section[truncate](Interface truncate)[Interface truncate]{\sectitle{truncate}} +% +% The package \xpackage{truncate} by Donal Arseneau provides the command: +% +% \quad\cs{truncate}\M[TruncateMarker]\M{width}\M{text} +% +% to trunc the given \meta{text} to the specified \meta{width}, by means of \meta{TruncateMarker} if the the truncation occurs. +% +% \begin{declcs}[\red]{trunctext}\M[TruncateMarker]\M{width}\M{text} +% \end{declcs} +% +% \cs[\red]{trunctext}\, is the same as\, \cs{truncate}\, but it leaves \M*{text} to its natural width +% if it has not to be truncated (\ie if \meta{width}$\leq$ \textt{width of }\meta{text}). Example: +% +% \begin{tabu}{>{\ttfamily}rll} +% truncate: &\cs{truncate}\M{5cm}\M{Hello world!} &\fbox{\truncate{5cm}{Hello word!}} \\ +% trunctext: &\cs{trunctext}\M{5cm}\M{Hello world!} &\fbox{\trunctext{5cm}{Hello world!}} +% \end{tabu} +% +% This corresponds to the \M*[fit] option of the \xpackage{truncate} package. +% +% \begin{declcs}[\red]{htruncadjust}\M{total width}\M[$x_1,x_2,\ldots,x_n$]\M{text$_1$,text$_2$,$\ldots$,text$_n$} +% \end{declcs} +% +% This macro will measure the width of\, \textt{text}$_1$,\textt{text}$_2$,$\ldots$,\textt{text}$_n$ and adjust them for truncation: +% +% {\arrayrulewidth=.7pt +% \begin{tabu}{*{5}{|c}|} \hline +% \rowfont[c]{\ttfamily\bfseries}\rowcolor{AliceBlue} +% text & width & adusted width & $\gamma$ (truncated?) & Returned width\\ \hline +% \repeatcell 5{% +% rows=4, +% text/col1=text$_\row$, +% text/col2=$w_\row$, +% text/col3=\Gape[3pt]{$\displaystyle w'_i=\hbox{min}\left(w_\row,\frac{x_\row}{\sum x_i}\times\meta{total width}\right)$}, +% text/col4=\Gape[3pt]{$\gamma_\row=\begin{array}\{{>{\scriptstyle}l>{$\smaller}l<{$}}. 1 & if $w'_\row < w_\row$ \\ 0 & otherwise\end{array}$}, +% text/col5={$\displaystyle\omega_\row = w'_\row + \gamma_\row \cdot \Phi\cdot\frac{x_\row}{\sum \gamma_i\,x_i}$}, +% } \\ \hline +% \rowcolor{OldLace} +% & & $\Phi=${\ttfamily\smaller freespace$=$\meta{total width}}$\displaystyle\mathsmaller{-\sum w'_i}$ +% & +% & $\displaystyle\mathsmaller{ \sum \omega_i \leqslant \meta{total width}} $ +% \\ \hline +% \end{tabu}}§ +% {\raggedleft\scriptsize Another example of a tabular made with \csref[\red]{repeatcell}\par} +% +% The widths can be accessed with\, \cs{htruncwidth}\M{i}\, and then: +% +% {\centering \cs{trunctext}\M[TruncateMarker]\M*{\cs{htruncwidth}\M{i}}\M{text$_i$}.\par} +% +% $x_i$ can be any real number provided that $\displaystyle \sum_i x_i \leqslant$\numprint{16383}$=$\cs{maxdimen} in \textt{points}. +% +% Measuring the widths occur inside a \cs{hbox}, thus \textt{text$_1$},$\ldots$, \textt{text$_n$} can contain +% macros, non expandable material \etc. +% For example: +% +% \cs[\red]{htruncadjust}\M*{4cm}\M*[2,1]\M*{Hello,world}\, will prepare the widths so that their sum does not exceed 4 centimeters, +% and\, $w_1 = 2 \times w_2$. +% +% \cs[\red]{htruncadjust}\M*{4cm}\M*[2,1,2]\M*{The,World,Is flat}\, will prepare the widths so that their sum does not exceed 4 centimeters, +% and\, $w_1 = w_3 = 2 \times w_2$. +% +% If the optional parameters $x_i$ are not given, then they are equal to the natural width of \M*{text$_1$,$\ldots$,text$_n$}. +% In other words,\, \textt{text$_1$,$\ldots$,\textt{text$_n$}}\, are truncated to a width proportional to their natural widths. +% (And the sum of their widths will not exceed \meta{total width}). +% +% This macro has been designed to cleverly truncate the text of headers, when they contain titles on both sides... Usually then, +% there are only two pieces of text whose width have to be adjusted for truncation... +% +% {\footnotesize +% \begin{Verb*} +% \htruncadjust{3cm}{first quite long,second short,third} % natural widths +% \trunctext{\htruncwidth{1}}{first quite long} +% \trunctext{\htruncwidth{2}}{second short} +% \trunctext{\htruncwidth{3}}{third} +% \end{Verb*} +% +% \ClearPage +% +% \htruncadjust{3cm}{first quite long,second short,third} +% \def\TruncateMarker{...} +% {\color{Fuchsia}\qquad \smex \trunctext{\htruncwidth{1}}{first quite long}\trunctext{\htruncwidth{2}}{second short}\trunctext{\htruncwidth{3}}{third} +% \setbox0=\hbox{\trunctext{\htruncwidth{1}}{first quite long}\trunctext{\htruncwidth{2}}{second short}\trunctext{\htruncwidth{3}}{third}} +% \qquad (\htruncwidth 1\,,\,\htruncwidth 2\,,\,\htruncwidth 3\,,\,total=\the\wd0).} +% \begin{Verb*} +% \htruncadjust{3cm}[3,2,2]{first quite long,second short,third} % first is 3/2 of the two others +% \end{Verb*} +% \htruncadjust{3cm}[3,2,2]{first quite long,second short,third} +% {\color{Fuchsia}\qquad \smex \trunctext{\htruncwidth{1}}{first quite long}\trunctext{\htruncwidth{2}}{second short}\trunctext{\htruncwidth{3}}{third} +% \setbox0=\hbox{\trunctext{\htruncwidth{1}}{first quite long}\trunctext{\htruncwidth{2}}{second short}\trunctext{\htruncwidth{3}}{third}} +% \qquad (\htruncwidth 1\,,\,\htruncwidth 2\,,\,\htruncwidth 3\,,\,total=\the\wd0).} +% } +% +% \clearpage +% \sectionformat\section{bookmark={color=black,bold=false}} +% +% \Section[appendix]({\cs{appendices} (appendix)})[{Interface appendix}]{\sectitle{appendix} and the appendices environment} +% +% \xpackage{appendix} provides a way to write appendices inside an environment. This feature is suitable +% for short appendices like the one included in this document. \thispackage[interfaces-appendix] gives an easier +% control on some parameter for the appendix with standard (optional) key names. +% +% \begin{VerbLines*} +% \begin{($dg$underline(appendices))}[% +% ($opt(section)) = section $OR chapter, ($nnn alternatively, the key ) ($opt(chapter)) ($nnn is provided) +% ($opt(title)) = the appendix title, ($nnn if left blank, title is removed: [page] option of $xpackage(appendix)) +% ($opt(intoc)) = true $OR false, ($nnn put an entry in t.o.c. ?) +% ($opt(intoc/title)) = the entry in t.o.c.]($nnn if blank, no title in t.o.c., if no value: the appendix title) +% ($nnn$itshape appendix content ... ) +% \end{($dg$underline(appendices))} +% \end{VerbLines*} +% +% +% +% \Section[embedfile]({\cs{embedthisfile} (embedfile)})[{Interface embedfile: \cs[\red]{embedthisfile}}]{\sectitle[\LocalOrCTAN{\LOCALDOC/oberdiek/embedfile}{\CTANbaseurl/macros/latex/contrib/oberdiek/embedfile}]{embedfile}: \cs[\red\mdseries]{embedthisfile}} +% +% \begin{declcs}{embedthisfile}\\ +% \cs{embedthisfile}\stform* +% \end{declcs} +% +% \cs{embedthisfile} will embed into the final \xext{pdf} file, the current \xext{tex} file and all \xext{tex} files that are included (with \cs{include}) in it. +% If \cs{includeonly} is used, the only files embeded (\ie attached) to the \xext{pdf} file are the ones specified by \cs{includeonly}. +% +% \cs{embedthisfile}\stform* embeds only the main file. +% +% {\smaller +% This macro could disapear from \thispackage[interfaces-embedfile] if it is added to the main package... +% Depending on Mr~Oberdiek moods {\Large\Smiley}.} +% +% +% \Section[environ](Interface environ)[Interface environ]{\sectitle{environ}} +% +% \xpackage{environ} defines \cs{Renewenviron} but I found out it was usefull to have \csbf{ReNewEnviron} (note the case!) +% +% Therefore: \verb+\let\ReNewEnviron\RenewEnviron+ is made by \thispackage (\cs{AfterPackage}\M*{\xpackage{environ}}). +% +% \Section[umrand](Interface umrand)[Interface umrand]{Interface umrand} +% +% \xpackage{umrand} defines the macro \cs{ifnotempty} which is already defined with a different meaning in \xpackage{etextools}. +% \thispackage provides a turn around to avoid redefinition. +% +% For this turn around, \thispackage must be loaded before \xpackage{umrand} (because we use \cs{BeforePackage}\M*{\xpackage{umrand}}). +% This is -- really -- the only exception! +% +% +% +% \ClearPage* +% \bookmarksetup{bold*=true,color*=optional} +% \Section[pgfkeys](Interface pgfkeys)[Interface pgfkeys]{Interface pgfkeys {\smaller\mdseries(\HR\hyperref{\LocalOrCTAN{\LOCALDOC/../generic/pgf/pgfmanual.pdf}{\CTANbaseurl/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf}}{section}{43}{pgfmanual})}} +% +% \xpackage{pgfkeys}'s the base of all... wonderfull and inimitable! {\Large\bfseries\Smiley} +% +% The following handlers allows to build fairly quickly a \textt{key=value} interface for commands in almost any case: +% +% \centerline{\bfseries\large\lk +% \tikz\draw [decoration=snake,decorate,thick] (0,1) -- ++(3,0); +% \quad \textsc{\bfseries Summary} \quad +% \tikz\draw [cm={-1,0,0,0,(0,0)},anchor=east,decoration=snake,decorate,thick] (0,1) -- ++(3,0); +% } +% { +% \def\temp{% +% \handler/.blank/ &Replaces blank value by another value. \\ +% \handler/.is private/ &Throws an error if the key is used in an assignment \\ +% \handler/.store in cs/\, \handler/.estore in cs/ &Like \handler/.store in/\, but with \cs{csname}...\cs{endcsname} \\ +% \handler/.true/\, \handler/.false/,\handler/.on/\, \handler/.off/ &\handler/.is choice/ shortcut for boolean keys \\ +% \handler/.is multiple choice/ &Like \handler/.is choice/ but more than on choice can be selected at a time \\ +% \handler/.is enum/ &\handler/.is choice/ shortcut for enumerated keys\endgraf also provides the \textt{/key\handler/.number/} key to get the numeric index of the selected choice. \\ +% \handler/.store as code/,\handler/.estore as code/ &Stores the given value in the key itself. \stform+ and \stform* keys both append code.\endgraf The same but stores the \emph{expanded value}. \\ +% \handler/.store as code in cs/,\handler/.estore as code in cs/ &Stores the given value in a cs-name rather than in the key. \stform+ and \stform* keys both append code.\endgraf The same but stores the \emph{expanded value}. \\ +% \handler/.store as color/,\handler/.store as color command/ &Stores the color in the key itself.\endgraf The same but stores the color \emph{command}. \\ +% \handler/.store as color in cs/,\handler/.store as color command in cs/ &Stores the color in a cs-name rather than in the key.\endgraf The same but stores the color \emph{command}. \\ +% \handler/.store as number/,\handler/.estore as number/ &Stores an integer in the key (\stform-\, \stform+\, and\, \stform* keys are provided to add, substract and multiply). \\ +% \handler/.store as number in cs/,\handler/.estore as number in cs/ &The same, but stores into a cs-name rather than in the key. \\ +% \handler/.store in counter cs/ &The same, but stores into a \TeX{} counter. \\ +% \handler/.store as glue/,\handler/.estore as glue/ &Stores a glue expression in the key (\stform+\, \stform-\, and\, \stform* keys are provided to add, substract or scale).\endgraf The same, but stores the \emph{computed value} of the glue, not its expression. \\ +% \handler/.store as glue in cs/,\handler/.estore as glue in cs/ &The same, but stores in a given cs-name rather than in the key itself. \\ +% \handler/.store in skip cs/ &The same, but stores the glue inside a \TeX{} \cs{skip} register. \\ +% \handler/.store as dimen/,\handler/.estore as dimen/ &Store a dimen expression in the key (with \stform+\, \stform-\, and\, \stform* keys to add, substract or scale).\endgraf The same, but stores the \emph{computed value} of the dimen, not its expression. \\ +% \handler/.store as dimen in cs/,\handler/.estore as dimen in cs/ &The same, but stores in a given cs-name rather than in the key itself. \\ +% \handler/.store in dimen cs/ &Stores the dimension into a \TeX{} \cs{dimen} register rather than in a macro. \\ +% \handler/.alias/,\handler/.alias\stform*/ &Creates an alias for the key.\endgraf The same, but also creates the alias for the \stform+, \stform- and \stform* keys if they exist. \\ +% } +% +% { +% \smaller +% \csdef{@@handler}#1/.#2/{{\leavevmode +% \begingroup\def\stform##1{}\edef\x{\endgroup\def\noexpand\reference{pgfkeys.#2}}\x +% \ifcsundef{r@\reference}{\ttfamily#1{/$\!\!$.#2}}{\hyperref[\reference]{\ttfamily#1{/$\!\!$.#2}}}}} +% \def\parsetest#1\\#3\END{\makecell[tl]{\repeatcell{#1}{text=\c,transpose}}\\ \ifblank{#3}{}{\tabucline[on1.5pt off0.4pt]- \parsetest #3\END}} +% +% \begin{tabu}{X[-1m]X[m]}\toprule +% \expandafter\parsetest\temp\END +% \bottomrule +% \end{tabu} +% }} +% +% The command \cs[\dg]{pgfkeysmeaning} is provided (with \cs{providecommand}): it expands to the meaning of the given pgfkey. +% +% +% \subsection[/.blank]{Handler definition: \handler/.blank/} +% \label{pgfkeys.blank} +% +% A new handler \handler/.blank/ is defined to allow automatic replacement of empty or blank values by the ``default'' value specified: +% \begin{Verb*} +% \pgfkeys{/base/path/my key$handler*/.code/=The key #1,% +% /base/path/my key$handler/.default/=has its default value!,% +% /base/path/my key$handler/.blank/=was left blank!} +% \pgfkeys{/base/path/my key, ($nnn produces) The key has its default value! +% /base/path/my key=} ($nnn produces) The key was left blank! +% \end{Verb*} +% +% The following make blank value behave the same as default : +% \begin{Verb*} +% \pgfkeys{/base/path/my key$handler/.blank/=\pgfkeysnovalue} +% \end{Verb*} +% +% And If you wish to forbid blank values you can add: +% \begin{Verb*} +% \pgfkeys{/base/path/my key$handler/.value required/} +% \end{Verb*} +% +% With \thispackage[interfaces-pgfkeys] it is also possible to give a \handler/.default/ or/and a \handler/.blank/ +% value to a handler, or on the other hand to say that a handler must have (\handler/.value required/) +% or does not suffer (\handler/.value forbidden/) a value. +% (this feature was not implemented in \xpackage{pgfkeys.code.tex}). +% +% \subsection[/.is private]{Handler definition: \handler/.is private/} +% \label{pgfkeys.is private} +% +% This handler is mainly addressed to package writers. A private key does not suffer any assignment: +% this is a package constant: +% +% \begin{Verb*} +% \pgfkeys{/base/path/@my key$handler/.is private/=mypackage} +% \end{Verb*} +% +% Then any assignment to \textt{@my key} will throw an error, explaining +% that \textt{@my key} is private to the package \xpackage{mypackage}. +% +% \bigskip +% {\smaller Similarly, there is a \handler/.is private to class/ handler (for \cs{ClassError} instead of \cs{PackageError}).\par} +% +% +% \ClearPage +% +% \subsection[/.store in cs, /.estore in cs]{Handler definition: \handler/.store in cs/ and \handler/.estore in cs/} +% \label{pgfkeys.store in cs}\label{pgfkeys.estore in cs} +% +% A new handler \handler/.store in cs/ is defined to store the value of a key in a named control sequence: +% \begin{Verb*} +% \pgfkeys{% +% /base/path/my key$handler/.store in cs/=some word,% ($nnn will define :) \"some word" +% } +% \end{Verb*} +% +% \ClearPage +% \subsection(/.true, /.false etc.)[Boolean keys: /.true, /.false, /.on /.off]{Handlers definition:: \handler/.true/, \handler/.false/, \handler/.on/\/ and \handler/.off/} +% \label{pgfkeys.true}\label{pgfkeys.false}\label{pgfkeys.on}\label{pgfkeys.off} +% +% A key of type \handler/.true/ or \handler/.false/ can take the only values \textt{true} or \textt{false} and +% its default value is \textt{true}\linebreak (unless \handler*/.default/\textt{=false} is explicitly given to \cs{pgfkeys}). +% +% Similarly, a key of type \handler/.on/ or \handler/.off/ can take the only values \textt{on} or \textt{off} and +% its default value is \textt{on}\linebreak (unless \handler*/.default/\textt{=off} is explicitly given to \cs{pgfkeys}). +% +% These are shortcuts and a special case of \handler/.is choice/ keys: +% \begin{Verb*} +% \pgfkeys{ +% my key$handler/.true/ = $nnn code if the value is $texttt(true), +% my key$handler/.false/ = $nnn code if the value is $texttt(false), +% my key2$handler/.on/ = $nnn code if the value is $texttt(on), +% my key2$handler/.off/ = $nnn code if the value is $texttt(off) } +% \end{Verb*} +% +% \subsection[/.is multiple choice]{Handler definition: \handler/.is multiple choice/} +% \label{pgfkeys.is multiple choice} +% +% A key defined with \handler/.is multiple choice/ behaves like a \handler/.is choice/ key but more than +% one choice can be selected at a time: +% \begin{Verb*} +% \pgfkeys{/path$handler*/.cd/, +% format$handler/.is multiple choice/, +% format/bold$handler*/.code/= ..., +% format/italic$handler*/.code/= ..., +% format/color$handler*/.code/= ... } +% \end{Verb*} +% \ClearPage +% +% Possible values for key \textt{format} are restricted to subkeys: \textt{bold}, \textt{italic} and \textt{color}. +% But unlike simple \handler/.is choice/ keys, it is possible to use: +% +% \begin{Verb*} +% \pgfkeys{/path/format={bold,italic,color=...}} +% ($nnn this is the same as:) +% \pgfkeys{/path/format=bold,/path/format=italic,path/format={color=...}} +% \end{Verb*} +% +% {\itshape The \textt{bookmark} key of \csref[\red]{sectionformat} (in \thispackage[interfaces-titlesec]) is a good example.} +% +% \subsection[/.is enum]{Handler definition: \handler/.is enum/} +% \label{pgfkeys.is enum} +% +% A key defined with \handler/.is enum/ behaves like a \handler/.is choice/ key: its possible values are limited +% to sub-keys. The name of the selected sub-key is stored into the key. +% +% \begin{Verb*} +% \pgfkeys{/path$handler*/.cd/, +% enumKey$handler/.is enum/={one,two,three} +% } +% \end{Verb*} +% +% \textt[\opt]{enumKey} can be \textt{one} or \textt{two} or \textt{three} and nothing else. +% \begin{Verb*} +% \pgfkeys{ ($opt enumKey)=two } +% \end{Verb*} +% \topsep=0pt +% \begin{tabbing} +% assigns \textt{two} to the value of the key: \=\cs{pgfkeysvalueof}\M*{{\opt enumKey}} is \textt{two}.\\ +% \> \cs{pgfkeysvalueof}\M*{{\opt enumKey}\handler/.number/} is \texttbf{1} (zero based index) +% \end{tabbing} +% +% \subsection[/.store as code]{Handlers definition: \handler/.store as code/, \handler/.estore as code/} +% \label{pgfkeys.store as code} +% +% This handler stores the value given to the key in the key itself. Furthermore, a starred key \stform* and a \stform+ +% keys are defined such that they append their value to the stored key. +% +% {\small +% \begin{Verb*} +% \pgfkeys{/test$handler/.store as code/, +% /test=some code, +% /test$stform+= the following follows... } +% \end{Verb*} +% } +% Defines the key \textt{/test} so that \cs{pgfkeysvalueof}\M*{/test} expands to \textt{some code}. +% \textt{/test\stform+} appends ``the following follows'' to the previous value of the key. +% (\textt{/test\stform*} does the same). +% +% If you prefer not to have star keys \stform*, or \stform+ keys, or only one of these, just say, for example: +% {\small +% \begin{Verb*} +% \pgfkeys{/test$handler/.store as code/=($rred+)} +% \end{Verb*} +% } +% +% {\itshape This feature is very important for \thispackage: almost any \textt[\opt]{font} keys are defined +% with the handler \handler/.store as code/.} +% +% {\smaller +% \textitbf{A note for programmers:} \handler/.store as code/ defines three keys: \textt{test}, \textt{test}\stform+ and \textt{test}\stform*. +% (The two former are the same). The ``\emph{append code}'' keys (\stform+ and \stform*) call the \emph{main key} \textt{test}. +% This is handy because if you append code to the \emph{main key} (with \xpackage{pgfkeys} \handler/.add code/ +% or \handler/.append code/) then this code will be expanded also in case the \stform+ or \stform* keys are called. +% } +% +% There is also a \handler/.estore as code/ handler which expands the given code before storing it in the key. +% +% \csdef{=cs-name}{{\lk$=$\meta{cs-name}}} +% \subsection[/.store as code in cs]{Handlers definition: \handler/.store as code in cs/\csuse{=cs-name}, \handler/.estore as code in cs/\csuse{=cs-name}} +% \label{pgfkeys.store as code in cs} +% +% This handler works like \handler/.store as code/: the content is stored in the cs-name given as value for the handler, +% but not inside the key itself (useful for \textt{key=value} interfaces to other packages). +% +% The \stform+ and \stform* keys are provided: both append their value to the content of the given control sequence. +% +% Typically, \textt[\opt]{/font} keys are defined this way for interface with other packages. +% +% There is also a \handler/.estore as code in cs/ handler which expands the given code before storing it in the {\lk\meta{cs-name}}.. +% +% \subsection[/.store as color]{Handler definition: \handler/.store as color/} +% \label{pgfkeys.store as color} +% +% When specifying a color, did you say: +% \begin{Verb*} +% color=\color{yellow} color=\normalcolor +% color=blue color=[rgb]{1,0,0} +% \end{Verb*} +% +% In any case, \handler/.store as color/ will transform the value as follow: +% \begin{Verb*} +% color=yellow color=default ($nnn defined by $thispackage* if not already) +% color=blue color=[rgb]{1,0,0} ($nnn defined) \AtBeginDocument +% \end{Verb*} +% +% +% +% In any case, \handler/.store as color command/ will transform the value as follow: +% \begin{Verb*} +% color=\normalcolor color=\color{yellow} +% color=\color{blue} color=\color[rgb]{1,0,0} +% \end{Verb*} +% +% Please! Dont write: \cs{def}\cs{myBlue}\M*{blue} \qquad \textt{color=\cs{myBlue}}. +% +% Use \cs{colorlet}\M*{myBlue}\M*{blue}\, instead, or \cs{definecolor}. +% +% As for code, the color is stored inside the key. +% +% \subsection[/.store as color in cs]{Handler definition: \handler/.store as color in cs/\csuse{=cs-name}} +% \label{pgfkeys.store as color in cs} +% +% The same as \handler/.store as color/, but the color is stored in the given control sequence, rather than in the key itself. +% +% There is also a \handler/.store as color command in cs/ handler. It is used to set the value to \cs{columnseprulecolor} +% by the key \textt{columns/rule/color} of \csref[\red]{tocsetup}. +% +% \ClearPage +% +% \subsection[/.store as number]{Handlers definition: \handler/.store as number/, \handler/.estore as number/} +% \label{pgfkeys.store as number} +% +% \subsection[/.store as number in cs]{Handlers definition: \handler/.store as number in cs/, \handler/.estore as number in cs/} +% \label{pgfkeys.store as number in cs} +% +% \ClearPage +% \subsection(/.store as glue)[/.store as glue]{Handler definition: \handler/.store as glue/} +% \label{pgfkeys.store as glue} +% +% This is quite the same as \handler/.store as code/, but the given code is sourrounded by \cs{glueexpr}...\cs{relax}... +% and is stored inside the key. +% +% Furthermore:§ +% \begin{tabbing} +% \qquad\= the \stform+ key adds to the length:\=\cs{glueexpr} old value $+$ \meta{ argument } \cs{relax}. \\ +% \> the \stform- key substracts:\>\cs{glueexpr} old value $-$ \meta{ argument } \cs{relax} \\ +% \> the \stform* key scales: \> \cs{glueexpr} old value $*$ \meta{ argument } \cs{relax} \\ +% \end{tabbing}§ +% +% The \meta{argument} is \textbf{not expanded} but the content of the key is ready to be used in place +% of a length. Scaling of two forms are allowed: \emph{fractionnal} and \emph{real}. +% \emph{Real} scaling is converted to a fraction of \textt{65536}: +% {\small +% \begin{Verb*} +% \pgfkeys{/test$handler/.store as glue/, +% /test=12pt plus5pt, +% /test$stform*=.5, +% /test$stform+=\parskip, +% /test$stform*=4/6 } +% \pgfkeysmeaning{/test} +% \end{Verb*} +% } +% \pgfkeys{/test/.store as glue,/test=12pt plus5pt,/test*=.5,/test+=\parskip,/test*=4/6} +% +% \smex\qquad \pgfkeysmeaning{/test} +% +% The value of \cs{parskip} is not expanded at \cs{pgfkeys} time, but only when the value of the key +% is used (for an assignment...) +% +% There is also a handler called \handler/.estore as glue/ if you really want the value to be +% expanded (with \cs{the}) at the time of \cs{pgfkeys} setting. +% +% +% \subsection(/.store as dimen)[/.store as dimen]{New handler: \handler/.store as dimen/} +% \label{pgfkeys.store as dimen} +% +% Just like \handler/.store as glue/ but with \cs{dimexpr} instead of \cs{glueexpr}. +% +% There is also a \handler/.estore as dimen/ handler, for immediate expansion. +% +% +% +% \subsection(/.store as glue in cs)[/.store as glue in cs]{New handler: \handler/.store as glue in cs/\csuse{=cs-name}} +% \label{pgfkeys.store as glue in cs} +% +% This is like \handler/.store as glue/ but the the value is assigned to a macro whose name is given, rather than +% in the key itself. Expansion \emph{does not} occur \cs{pgfkeys} time: the macro contains +% the glue definition in \cs{glueexpr}...\cs{relax} expressions. +% +% \stform+ (to add) \stform- (to substract) and \stform* (to scale) keys are provided. +% +% There is also a \handler/.estore as glue in cs/ handler, and expansion occurs when the key is set. +% +% +% \subsection(/.store as dimen in cs)[/.store as dimen in cs]{New handler: \handler/.store as dimen in cs/\csuse{=cs-name}} +% \label{pgfkeys.store as dimen in cs} +% +% Just like \handler/.store as glue in cs/ but with \cs{dimexpr} instead of \cs{glueexpr}. +% \goodbreak +% +% \bookmarksetup{color*=copper} +% \subsection(/.estore as dimen in cs)[/.estore as dimen in cs]{New handler: \handler/.estore as dimen in cs/\csuse{=cs-name}} +% \label{pgfkeys.estore as dimen in cs} +% +% This handler as a particularity: if the value is given without dimension, \textt[\db]{pt} is assumed (that is... \textt{points}). +% +% This is the way the key \textt[\opt]{size} is defined for the command \csref[\red]{changefont} +% (in \thispackage[interfaces-LaTeX]). +% \textt[\opt]{size} defines \cs{f@size}, the macro used by \LaTeX{} to store the font size +% (and \textt{size}\stform+ adds, \textt{size}\stform- substracts, \textt{size}\stform* scales). +% But \cs{f@size} is stored in points, without the mention of the dimension: \textt[\db]{pt}. +% +% With its default units in \textt[\db]{pt}, \handler/.estore as dimen in cs/ is the handler of the situation: +% +% +% \Section[etoolbox](Interface etoolbox)[Interface etoolbox]{\sectitle{etoolbox} - \xpackage{etoolbox}-like commands} +% +% May be they will be added to \xpackage{etoolbox.sty} one day or another... and disapear from \thispackage $\smile$. +% +% \subsection{New macros provided with \cs{providecommand}} +% +% \begin{declcs*}{4}{removefrom}\,\,\,\meta{hook}\M{code} &&&\cs{removefromstart}\meta{hook}\M{code} \\ +% \cs{gremovefrom}\meta{hook}\M{code} &&& \cs{gremovefromstart}\meta{hook}\M{code} \\ +% \cs{eremovefrom}\meta{hook}\M{code} &&& \cs{eremovefromstart}\meta{hook}\M{code} \\ +% \cs{xremovefrom}\meta{hook}\M{code} &&& \cs{xremovefromstart}\meta{hook}\M{code} +% \end{declcs*} +% +% \csbf{removefrom} removes the first occurence of \M{code} from a \meta{hook}. The command is robust.§ +% {\color{red}\M{code} should not contain groups: \M*{...}} but parameter characters are allowed, which need not to be doubled. The match for \M{code} +% inside the replacement text of \meta{hook} is category-code sensitiv. +% +% \begin{tabbing} +% If the \= first occurence of \= \M{code} into \meta{hook} has been removed \\ +% \> then \> \cs{ifin@}\quad\= is set to \cs{iftrue} \\ +% \> otherwise \> \cs{ifin@}\> is set to \cs{iffalse} \quad (\meta{hook} does not contain \M{code}). \\ +% this allows loops of the form:\\ +% \> \cs{in@true}\\ +% \> \cs{@whilesw}\cs{ifin@}\cs{fi}\M*{\cs{removefrom}\meta{hook}\M{code}} +% \end{tabbing} +% +% \begin{enumerate}[label={\HR},leftmargin=*] +% \item \cs{eremovefrom} and \cs{xremovefrom} expand \M{code} before trying to remove it from \meta{hook}. Only \M{code} is expanded, the current replacement text of \meta{hook} is not. +% \item \texttbf g and \texttbf x versions make the assignment to \meta{hook} global. +% \item \cs{removefromstart} remove \M{code} only if it appears at the very beginning of \meta{hook}. +% \end{enumerate} +% +% \Section[scrlfile](Interface scrlfile)[Interface scrlfile]{\sectitle[\LocalOrCTAN{file:C:/texmf/source/latex/koma-script/scrlfile.pdf}{\CTANbaseurl/macros/latex/contrib/koma-script/scrguien.pdf}]{scrlfile}} +% +% \subsection{Star forms for \cs{BeforeFile} and \cs{AfterFile}} +% +% \xpackage{scrlfile} provides \cs{BeforeFile} and \cs{AfterFile} in order to execute some code when a file is loaded. +% The hooks are automatically reset to \cs{relax} after the file has been loaded, in other words, they are expanded at most one only time. +% This can be avoided by using \cs{BeforeFile\stform*} and \cs{AfterFile\stform*}, for example: +% +% \begin{Verb*} +% \BeforeFile($rred$textasteriskcentered){\jobname.toc}{\begin{multicols}{2}} +% \AfterFile($rred$textasteriskcentered){\jobname.toc}{\end{multicols}} +% \end{Verb*} +% The hooks \textsl{before} and \textsl{after} will be executed \textbf{every time} \cs{jobname.toc} is loaded. +% +% This feature is used in \cs[\red]{tocsetup}\M*{twocolumns}. +% +% \subsection{Allowing \cs{BeforeFile} and \cs{AfterFile} when \cs{@input} is invoked} +% +% The hooks \cs{BeforeFile} and \cs{AfterFile} are executed only when the file is loaded with \cs{InputIfFileExists}: indeed this macro is +% redefined by \xpackage{scrlfile}. +% +% \thispackage redefine \cs{@input} in order to execute those hooks also in case \cs{@input} is used: this is useful because +% \xext{toc} files are input with \cs{@input} rather than with \cs{InputIfFileExists}. +% +% \sectionformat\section{bookmark={color*=dr}} +% \section{List of corrected or patched commands} +% +% Here is the complete list of patched commands in other packages. +% +% The modification occurs only if the given module of \thispackage is loaded. +% For example, \cs{addcontentsline} is modified only if packages \xpackage{titlesec} and \xpackage{bookmark} are +% loaded, \textitbf{and if} \thispackage[interfaces-titlesec] and \thispackage[interfaces-bookmark] are loaded. +% +% \makeatletter \newcounter{PatchedCommand} +% \newcolumntype\X{>{\centering\arraybackslash}X} +% \newrobustcmd\PatchedCommand[4][]{\begin{small}\stepcounter{PatchedCommand}% +% \hbox{\llap{\Pisymbol{\number\numexpr181+\value{PatchedCommand}}\,\,} +% \begin{tabu} to\linewidth{|X[c]|c|X[c]|X[c]|c|}\hline +% Patched command &Type & Importance &Module & ref. page \\\hline +% \makecell[l]{\repeatcell{#2}{text=\csbf[\macrocodecolor]{\c},transpose}} +% & +% \zref@ifrefundefined{patch-\itf@getvalue{#2}1} +% {} +% {\itshape\zref[patchtype]{patch-\itf@getvalue{#2}1}}% +% & \ifcase#4\relax \textcolor{dg}{\makecell{minor \\ optimisation or correction}} +% \or \textcolor{db}{\makecell{important\\ but no side effect}} +% \or \textcolor{dr}{\makecell{important}} +% \or {\bfseries\textcolor{red}{major}} +% \else ?? +% \fi +% & +% \makecell{\repeatcell{#3}{transpose,text=\thispackage[{\c}]}} +% & +% \zref@ifrefundefined{patch-\itf@getvalue{#2}1} +% {} +% {\pageref{patch-\itf@getvalue{#2}1}}% +% \\ \hline +% \end{tabu}}\end{small}} +% \makeatother +% +% \begin{smaller} +% +% \subsection[LaTeX]{\LaTeX{}} +% +% \PatchedCommand[LaTeX]{@pkgextension,@clsextension,@ifpackageloaded,@ifclassloaded}{interfaces-LaTeX}{0} +% +% Those commands are replaced by their equivalent in the package \xpackage{ltxcmds}: +% +% \begin{tabu}{*4c} +% \repeatcell{ltx@pkgextension,ltx@clsextension,ltx@ifpackageloaded,ltx@ifclassloaded}{text=\cs{\c}} +% \end{tabu} +% +% This is because \LaTeX{} defines those commands \cs{@onlypreamble}, while the equivalent macros in \xpackage{ltxcmds} +% can be used inside \textt{document} as well. +% +% +% \PatchedCommand[LaTeX]{addcontentsline}{interfaces-titlesec,interfaces-bookmark}{1} +% +% \cs{addcontentsline} does a lot a thing and in particular it expands the \cs{bookmark} command (if the \xpackage{bookmark} package is loaded, +% otherwise it's hyperref). As long as \cs[\red]{sectionformat} can drive the attributes of the bookmark for each section, it is necessary +% to expand \cs{bookmarksetup} with the right options before the section-bookmark is written. +% +% This is achived by \cs{itf@ttl@BKM}, placed at the beginning of \cs{addcontentsline}. +% +% \PatchedCommand[LaTeX]{@input}{interfaces-scrlfile}{1} +% +% The \cs{input} primitive (same as \LaTeX{} control sequence \cs{@@input}) is surrounded by +% \cs{scr@load@hook}\M*{before}...\cs{scr@load@hook}\M*{after}: +% +% \begin{multicols}{2} +% Original: +% \begin{Verb*} +% \def\@input#1{\IfFileExists{#1} +% {\@@input\@filef@und} +% {\typeout{No file #1.}}% +% }% +% \end{Verb*} +% \columnbreak +% Modified: +% \begin{Verb*} +% \renewcommand*\@input[1]{\IfFileExists{#1} +% {\scr@load@hook{before}{#1}% +% \@@input\@filef@und +% \scr@load@hook{after}{#1}} +% {\typeout{No file #1.}}% +% }% +% \end{Verb*} +% \end{multicols} +% +% \subsection[bookmark]{\xpackage{bookmark} \cs{\backslashchar bookmark}} +% +% \PatchedCommand[bookmark]{bookmark}{interfaces-bookmark}{2} +% +% The \stform* keys for \cs{bookmarksetup} (\textt{italic\stform*},\, \textt{color\stform*},\, \textt{bold\stform*},\, and \textt{disable\stform*}) +% are local to the group, but govern only the very next bookmark. +% +% After the bookmark has been written, previous values must be restored at the end of each group until +% the same group level as the one in which the \stform* option has been set is reached (if this group is the main group, +% level \textt0, then a global assignment is made). +% +% Well... this is done at \cs{write}: \cs{immediate}\cs{write}\M*{the bookmark entry} +% is replaced by \cs{itf@BKM@write}\M*{the bookmark entry} to check first: +% \begin{enumerate}[label=\arabic*)\,] +% \item is the bookmark disable ? +% \item is it necessary to restore previous values after write (\ie \cs{aftergroup}) ? +% \end{enumerate} +% +% \subsection[tocloft]{\xpackage{tocloft} \cs{\backslashchar newlistof}} +% +% \PatchedCommand[tocloft]{newlistof}{interfaces-tocloft}{1} +% +% +% +% \ClearPage +% \subsection[colortbl]{\xpackage{colortbl}} +% +% \PatchedCommand[colortbl]{CT@cellc}{interfaces-makecell}{1} +% +% \xpackage{colortbl} modifies the preamble of tabulars: it put each cell in a box, sets the color and then displays the box. +% The example shown page \pageref{repeatcell:colors} does not work without a minor modification: the color specification must +% be expanded short before their usage. +% +% Original: +% \begin{Verb*} +% \def\CT@cellc#1[#2]#3{% +% \expandafter($red(\gdef))\expandafter\CT@cell@color\expandafter{% +% \expandafter\CT@color#1{[#2]}{#3}% +% \global\let\CT@cell@color\relax +% }} +% \end{Verb*} +% Modified: +% \begin{Verb*} +% \def\CT@cellc#1[#2]#3{% #1 is either \@firstofone or \@gobble, [#2]#3 = color spec +% ($red(\xdef))\CT@cell@color{\noexpand\CT@color#1{[{#2}]}{#3}% +% \global\let\noexpand\CT@cell@color\relax}% +% } +% \end{Verb*} +% +% Remember \xpackage{arydshln} must be loaded after \xpackage{colortbl} (this is not due to \thispackage, +% but to the fact that both redefine \cs{@classz} from the \xpackage{array} package). +% +% \subsection[hypbmsec]{\xpackage{hypbmsec}} +% +% \PatchedCommand[hypbmsec]{hbs@do,hbs@process}{interfaces-hypbmsec,interfaces-titlesec}{1} +% +% In order to get \cs{lastsectiontitle}, \cs{lastsectionbookmark} and \cs{lastsectiontoc} updated at the right place +% (\ie \textit{after} \cs{sectionbreak} and \textit{before} \cs{sectionmark}), some \thispackage-macros have to be +% executed: +% \begin{itemize} +% \item at the beginning of \cs{hbs@do} \qquad {\smaller\smex to get the word \textt{section} or \textt{subsection} \etc.} +% \item at the beginning of \cs{hbs@process} \qquad {\smaller\smex to store the next section title, bookmark and toc} +% \end{itemize} +% +% \subsection[enumitem]{\xpackage{enumitem}} +% +% \PatchedCommand[enumitem]{setlist}{interfaces-enumitem}{0} +% +% \cs{setlist} is redefined by \thispackage[interfaces-enumitem] in order to extend the syntax. +% +% \subsection[pgfkeys]{\xfile{pgfkeys.code.tex}} +% +% \PatchedCommand[pgfkeys]{pgfkeys@unpack,pgfkeys@case@three}{interfaces-pgfkeys}{2} +% +% \cs{pgfkeys@unpack} is modified to handle the case of the \handler/.blank/ handler: this is here that +% the value is conditionnally compared against \handler/.default/, \handler/.blank/ or \handler/.value required/. +% +% \cs{pgfkeys@case@three} is modified to allow \underline{handlers} to have \handler/.default/, \handler/.blank/ +% or \handler/.value required/ values. +% +% \cs{pgfkeys@exp@call}: missed a pair of braces around the value in \cs{pgfkeysalso}. Thus +% the code could break if the value contains an equal sign or a comma. Fixed. +% +% \end{smaller} +% +% \bookmarksetup{bold=false,color=black} +% +% +% +% +% \StopEventually{ +% } +% +% \IMPLEMENTATION +% +% \sectionformat\subsection{bookmark/color=pkgcolor} +% \subsection{Interfaces} +% +% The package namespace is \textttbf{\macrocodecolor itf@}. +% +% \begin{macrocode} +%<*package> +\NeedsTeXFormat{LaTeX2e}[2005/12/01] +\ProvidesPackage{interfaces} + [2011/02/19 v3.1 - pgfkeys interfaces - pgf 2.0 et 2.1 (FC)] +% \end{macrocode} +% +% \subsubsection{Requirements} +% +% \begin{macrocode} +\RequirePackage{interfaces-base} +% \end{macrocode} +% +% \subsubsection{The package options / list of interfaces} +% +% \begin{macrocode} +\DeclareOption{LaTeX}{\AtEndOfPackage{\LoadInterface{LaTeX}}} +\DeclareOption{marks}{\AtEndOfPackage{\LoadInterface{marks}}} +\def\itf@tp#1{% + \DeclareOption{#1}{\AtEndOfPackage{\LoadInterface{#1}}}% +}% \itf@tp +\itf@tp{titlesec} +\itf@tp{hyperref} +\itf@tp{bookmark} +\itf@tp{fancyhdr} +\itf@tp{tocloft} +\itf@tp{makecell} +\itf@tp{enumitem} +\itf@tp{hypbmsec} +\itf@tp{environ} +\itf@tp{truncate} +\itf@tp{appendix} +\itf@tp{embedfile} +\if\relax\@ptionlist{interfaces.sty}\relax % no option given + \ExecuteOptions\@declaredoptions % all interfaces are active +\fi +\ProcessOptions +% +% \end{macrocode} +% +% \subsection{Interfaces-base} +% +% \begin{macrocode} +%<*base> +\ProvidesPackage{interfaces-base} + [2011/02/19 v3.1 Interfaces core system layer (FC)] +\RequirePackage{etex,ltxcmds,etoolbox,pgfkeys,scrlfile,infwarerr} +\AtEndOfPackage{% + \RequirePackage{interfaces-etoolbox}% + \RequirePackage{interfaces-scrlfile}% + \RequirePackage{interfaces-pgfkeys} + \RequirePackage{interfaces-tikz}% + \RequirePackage{interfaces-umrand}% There is a \BeforePackage here ! +}% AtEndOfPackage +% \end{macrocode} +% +% \begin{macro}{\LoadInterface} +% Mechanic of \thispackage: each module is loaded \cs{AfterPackage}. +% \begin{macrocode} +\newrobustcmd*\LoadInterface[1]{% + \@for\itf@tp:=#1\do{% + \expandafter\ifx\csname\ifcsname\itf@tp\endcsname + \itf@tp\else relax\fi\endcsname\marks + \RequirePackage{interfaces-marks}% + \else\expandafter\ifx\csname\ifcsname\itf@tp\endcsname + \itf@tp\else relax\fi\endcsname\LaTeX + \RequirePackage{interfaces-LaTeX}% + \else + \expandafter\itf@LoadInterface\expandafter{\itf@tp}% + \fi\fi}% +}% \LoadInterface +\@onlypreamble\LoadInterface +\newrobustcmd*\itf@LoadInterface[1]{\ltx@ifpackageloaded{interfaces-#1} + {} + {\AfterPackage*{#1}{\RequirePackage{interfaces-#1}}}% +}% \itf@LoadInterface +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\newrobustcmd*\itf@Check@Package[1]{\itf@pgfkeys\ltx@ifpackageloaded{#1} + {} + {\PackageError{interfaces-#1} + {The package `#1` must be loaded before `interfaces-#1` + \MessageBreak Please refer to `interfaces.pdf` document + \MessageBreak for correct usage of the `interfaces` package}\@ehd + }% +}% \itf@Check@Package +% \end{macrocode} +% +% \begin{macro}{\itf@AfterPackage} +% This is \cs{AfterPackage}\stform* but it works inside document. +% \xpackage{ltxcmds} provides \cs{ltx@ifpackageloaded} to check if a package is loaded +% and -- unlike \LaTeX's \cs{@ifpackageloaded} -- this macros is not restricted to the document preamble. +% \begin{macrocode} +\newrobustcmd*\itf@AfterPackage[1]{% + \csname\ltx@ifpackageloaded{#1}{ltx@secondoftwo}{@AfterPackage}\endcsname{#1}% +}% \itf@AfterPackage +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{Interfaces patches} +% +% First a warning for loading \xpackage{arydshln} after \xpackage{colortbl}. +% Those packages does not interact properly. +% +% \begin{macrocode} +\AfterPackage{colortbl}{% + {\ltx@ifpackageloaded{arydshln} + {\@PackageWarningNoLine{interfaces-base} + {The package arydshln should be loaded after colortbl + \MessageBreak because both redefine \string\@classz}}% + {}}% +}% AfterPackage colortbl +% \end{macrocode} +% +% +% \begin{macro}{\itf@preapptocmd} +% The need for this macro has rised to make \cs{itf@patch} simpler. +% +% This is also more secure to do \cs{pretocmd} and \cs{apptocmd} in +% the same time, for the result (success or failure) is always the +% same for both. +% \begin{macrocode} +\newrobustcmd*\itf@preapptocmd[5]{% + \pretocmd#1{#2}% + {\apptocmd#1{#3}% + {#4}% + {#5}}% + {#5}% +}% \itf@preapptocmd +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@patch} +% \cs{itf@patch} is used as a prefix to \cs{pretocmd}, \cs{apptocmd} and \cs{patchcmd}. +% +% It's main purpose is to keep the information (\cs{PackageInfo}) in the case +% \usepackage*{interfaces} has been put in a \cs{dump} format. +% +% \cs{PackageInfo} is then deferred \cs{AtBeginDocument} time... +% +% \begin{macrocode} +\def\itf@patch{\@makeother\#\futurelet\itf@tp\itf@patch@} +\def\itf@patch@{\csname itf@patch@% + \ifx\itf@tp\patchcmd inside\else + \ifx\itf@tp\itf@preapptocmd inside\else + boundary\fi\fi + \endcsname +}% \itf@patch@ +\def\itf@patch@boundary#1#2#3#4#5{% + \catcode`\#=6% + \let\itf@tp#2% + #1\itf@tp{#3}% + {\let#2\itf@tp + \AtBeginDocument{#4}% in order to keep this info even after \dump + } + {#5}% +}% \itf@patch@boundary (for \pretocmd and \apptocmd) +\def\itf@patch@inside#1#2#3#4#5#6{% + \catcode`\#=6% + \let\itf@tp#2% + #1\itf@tp{#3}{#4}% + {\ifx#1\patchcmd \itf@patch@inside@{#1}{#3}{#4}\fi + \let#2\itf@tp + \AtBeginDocument{#5}% + } + {#6}% +}% \itf@patch@inside (for \patchcmd) +\def\itf@patch@inside@#1#2#3{% + \loop + \let\@tempa \itf@tp + #1\itf@tp{#2}{#3}{}{}% + \unless\ifx \@tempa\itf@tp + \repeat +}% \itf@patch@inside@ +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Helper macros} +% +% \begin{macrocode} +\newskip\itf@sk +\newmuskip\itf@musk +\newtoks\itf@tk +\newcount\itf@cnt +% \end{macrocode} +% +% \begin{macro}{\itf@strip@at} +% \begin{macro}{\itf@strip@dot} +% \cs{itf@strip@at} removes all until \textt @\, while \cs{itf@strip@dot} removes the fractional part. +% \begin{macrocode} +%% H E L P E R M A C R O S +\begingroup\makeatother + \csgdef{itf@strip@at}#1@{} +\endgroup +\def\itf@strip@dot#1.#2\@nil{#1} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\itf@expandonceifcs} +% This macro is used to expand or not a comma separated list.§ +% USAGE: \cs{itf@expandonceifcs}\cs{macrototest}§ +% \cs{macrototest} is expanded once and its first token $\tau$ is placed into a temporary macro \cs{itf@tp}.§ +% If \cs{macrotest} equals \cs{itf@tp}: \cs{macrotest} is composed of that only token $\tau$, otherwise we leave and do nothing.§ +% Then we test \cs{noexpand}$\tau$ against \cs{relax} with \cs{ifcat}. If \textt{false} $\tau$ cannot be a macro then we leave.§ +% Then we test if $\tau$ is expandable: \cs{ifx}$\tau$=\cs{expandonce}$\tau$, $\tau$ is not expandable and we leave. +% (may be \cs{def}$\tau$\M*{$\tau$} but it's not \textit{expandable}!).§ +% Otherwise,$\tau$ is expandable and \cs{macrotest} contains a single expandable token. +% Thus \cs{macrotest} shall be expanded once:\, \cs{let}\cs{macrotest}=$\tau$. +% +% \begin{macrocode} +\def\itf@expandonceifcs#1{\expandafter\itf@exp@ndonceifcs\expandafter#1#1Q\@nnil} +\def\itf@exp@ndonceifcs#1#2#3\@nnil{% + \def\itf@tp{#2}% + \ifx\itf@tp#1% + \ifcat\relax\noexpand#2% + \expandafter\expandafter\expandafter\remove@to@nnil + \expandafter\ifx\expandafter#2#2\@nnil\else\@nnil\let#1#2\fi + \fi\fi +}% \itf@exp@ndonceifcs +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Numbers} +% +% \begin{macro}{\itf@number} +% \cs{itf@number} tries to get a number from its argument, and stores the result +% into the TeX count register given as first argument. Same syntax as \LaTeX \cs{@defaultunits}. +% +% A number is an integer that can be assigned to a count register, may be followed +% by one or more \cs{relax}. +% +% \begin{macrocode} +%% G E T A N U M B E R (if possible) +%% USAGE: \itf@number\count\relax\@nnil (like \@defaultunits) +\def\itf@number#1#2\relax\@nnil{% \relax is to mimick the syntax of \@defaultunits + \afterassignment\itf@number@#1\number0#2\relax\itf@number@ +} +\def\itf@number@#1\relax#2\itf@number@{% + \ifblank{#1} + {\itf@number@@{}#2\itf@number@@\@nnil + \csname ltx@\ifx\@let@token\itf@number@@ + first\else second\fi oftwo\endcsname} + \ltx@secondoftwo +}% \itf@number@ +\def\itf@number@@#1{\futurelet\@let@token\itf@number@@@} +\def\itf@number@@@{% + \csname \ifx\@let@token\relax itf@number@@% + \else remove@to@nnil% + \fi \endcsname +}% \itf@number@@@ +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Units and math units} +% +% \begin{macro}{\itf@setlength} +% +% To be able to write: \cs{pgfkeys}\M*{key=\cs{widthof\M*{some text}}} (package \xpackage{calc}), +% \thispackage[interfaces-base] defines \cs{itf@setlength}: +% +% \begin{macrocode} +\protected\def\itf@setlength#1#2{#1\glueexpr#2\relax} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@units@scale} +% +% For multiplication of units: \cs{glueexpr}...\cs{relax}*\cs{itf@units@scale}\meta{scaling factor}! +% +% The scaling factor can be a fraction or a real number. Real numbers are approximated by a fraction +% of 65536. +% +% \begin{macrocode} +%% glue * 1.5 = glue * 98302 / 65536 +%% glue * 3/2 = glue * 3/2 +\def\itf@units@scale#1!{\itf@units@scale@normalize#1/\@nnil/\@nil} +\def\itf@units@scale@normalize#1/#2/#3\@nil{% + \ifx#2\@nnil \number\dimexpr#1pt\relax/65536 + \else#1/#2 + \fi +}% \itf@units@scale@normalize +\def\itf@units@scaleNoCalc#1!{\itf@units@scale@normalizeNoCalc#1/\@nnil/\@nil} +\let\itf@units@scale@normalizeNoCalc \itf@units@scale@normalize +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@setlength@calc} +% +% The version for the \xpackage{calc} package. \xpackage{calc} removes stretch +% and shrink components of glues when a scaling operation is done using \cs{real} +% or \cs{ratio}. This limitation is lifted for \textt{key=value} assignments. +% +% \begin{macro}{\itf@units@scale@normalize@calc} +% +% The version of \cs{itf@units@scale@normalize} when using the \xpackage{calc} package. +% +% \cs{ratio} is used. +% +% \begin{macrocode} +\protected\def\itf@setlength@calc#1#2{\begingroup + \let\calc@multiply@by@real \itf@calc@multiply@by@real + \let\calc@Adimen \itf@calc@Askip \let\calc@Bdimen \itf@calc@Bskip + \setlength{#1}{#2}% + \expandafter\endgroup\expandafter#1\the#1\relax +}% \itf@setlength@calc +\def\itf@units@scale@normalize@calc#1/#2/#3\@nil{% + \ifx#2\@nnil 1*\ratio{\dimexpr#1pt\relax}\p@ + \else 1*\ratio{\dimexpr#1pt\relax}/{\dimexpr#2pt\relax}% + \fi +}% \itf@units@scale@normalize@calc +\def\itf@calc@multiply@by@real#1{% + \calc@Bdimen\glueexpr\calc@B*\number\dimexpr#1pt\relax/65536\relax + \calc@B\calc@Bdimen +}% \itf@calc@multiply@by@real +\AfterPackage*{calc}{% + \newskip\itf@calc@Askip \newskip\itf@calc@Bskip + \let\itf@setlength \itf@setlength@calc + \let\itf@units@scale@normalize \itf@units@scale@normalize@calc +}% AfterPackage calc +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\itf@strip@mu} +% +% This is the equivalent of \LaTeX's \cs{strip@pt} but for math units: +% +% \begin{macrocode} +%% U N I T S F O R D I M E N S +\def\itf@strip@mu{\expandafter\itf@rem@mu\the} +{% +\@makeother\M\@makeother\U +\lowercase{% + \gdef\itf@rem@mu#1.#2MU{#1\ifnum#2>\z@.#2\fi}% +}}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@units@pttomu} +% \begin{macro}{\itf@units@mutopt} +% +% $1 mu$ is exactly $1 em / 18$ where the $em$ is taken from \cs{textfont}2. +% +% Thus the scaling: \cs{fontdimen}$6$\cs{textfont}$2*100/1800$. +% +% \begin{macrocode} +%% \skip = \itf@units@mutopt \muskip +\def\itf@units@pttomu#1{\gluetomu\glueexpr + \glueexpr#1\relax*1800/% + \expandafter\itf@strip@dot\the\dimexpr + \fontdimen6\textfont2*100\relax.\@nil + \relax +}% \itf@units@pttomu +\def\itf@units@mutopt#1{\glueexpr + \mutoglue\muexpr#1\relax* + \expandafter\itf@strip@dot\the\dimexpr + \fontdimen6\textfont2*100\relax.\@nil/1800 + \relax +}% \itf@units@mutopt +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\itf@units@mu} +% +% Forces a dimension to be expressed in terms of math units ($mu$), convert if needed. +% \cs{cftdotsep} in \xpackage{tocloft} +% is expressed in math units. +% +% \begin{macrocode} +%% \muskip = \itf@units@mu{ \skip or \muskip or number} +{% +\@makeother\P\@makeother\T\@makeother\S\@makeother\B +\@makeother\C\@makeother\M\@makeother\D\@makeother\I\@makeother\N +\lowercase{% +\gdef\itf@units@mu#1#2{\begingroup + \edef\itf@tp{#2}% + \@tfor\x:={PT}{pt}{PC}{pc}{IN}{in}{BP}{bp}% + {CM}{cm}{MM}{mm}{DD}{dd}{CC}{cc}{SP}{sp}\do{% + \@expandtwoargs\in@\x\itf@tp\ifin@\@break@tfor\fi + }% + \expandafter\endgroup + \ifin@ + #1=\itf@units@pttomu{#2}% + \else + \@defaultunits#1 #2mu\relax\@nnil + \fi +}% \itf@units@mu +}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@units@pt} +% +% Conversely, forces a unit to be expressed in terms of points. Convert (from $mu$) if needed. +% +% \begin{macrocode} +%% \skip = \itf@units@pt( \muskip or \skip or number ) +{% +\@makeother\M\@makeother\U +\lowercase{% +\gdef\itf@units@pt#1#2{\begingroup + \@expandtwoargs\in@{MU}{#2}% + \ifin@\else\@expandtwoargs\in@{mu}{#2}\fi + \expandafter\endgroup + \ifin@ + #1=\itf@units@mutopt{#2}% + \else + \@defaultunits#1 #2pt\relax\@nnil + \fi +}}}% \itf@units@pt +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{Default color} +% +% A trick about \cs{normalcolor}, which refers to \cs{default@color}: +% +% \cs{default@color} is not expressed in terms of a color model. Therefore, it is not +% possible to convert it into a universally correct parameter for the \cs{color} command. +% That's why, for example, \cs{bookmark} ignore blank parameter for \textt{color}: because +% it can do nothing with \cs{normalcolor} ! +% +% Solution: if a color named ``\textt{default}'' has been defined in the preamble, then it is +% used as the default color. Otherwise, we define, \cs{AtBeginDocument} a color named ``default'' +% +% If \xpackage{xcolor} is loaded, an assignment: \cs{colorlet}\M*{default}\M*{.} is made +% \cs{AtBeginDocument}. If only \xpackage{color} is loaded, then \cs{color}\M*{default} +% means \cs{color}\M*{\cs{default@color}} (this syntax is not admissible with \xpackage{xolor}, +% but it works with \xpackage{color}). +% +% \begin{macrocode} +\AtBeginDocument{% + \ltx@ifpackageloaded{xcolor} + {\@ifundefinedcolor{default} + {\colorlet{default}{.}} + {}}% + {\ltx@ifpackageloaded{color} + {\@ifundefined{\string\color @default} + {\expandafter\def\csname\string\color @default\endcsname{\default@color}} + {}}% + {}}% +} +% \end{macrocode} +% +% +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Subsection[LaTeX] +% +% \begin{macrocode} +%<*LaTeX> +\ProvidesPackage{interfaces-LaTeX} + [2011/02/19 v3.1 pgfkeys macros for LaTeX (FC)] +\RequirePackage{interfaces-base} +\itf@pgfkeys +% \end{macrocode} +% +% \subsubsection{\cs{changefont}} +% +% \begin{macro}{\changefont} +% First use of \cs{pgfkeys} handlers \handler/.store as glue in cs/ , \handler/.estore as dimen in cs/... +% The handlers create the \stform+\, \stform-\, and \stform*\, keys automatically. As far as the +% \stform+\, \stform-\, and \stform* keys invoke the main key, it is possible to \handler/.append code/ +% to the main key, without taking care of the \stform+\, \stform-\, and \stform*\, keys. +% +% The \handler/.alias\stform*/ handler creates the aliases for the main key and +% the \stform+\, \stform-\, and \stform*\, keys in one shot. +% +% \begin{macrocode} +\newrobustcmd*\changefont[1]{\itf@pgfkeys + \pgfqkeys{/itf/LaTeX/changefont}{#1}\selectfont +}% \changefont +\AfterPackage*{hyperref} + {\pdfstringdefDisableCommands{\let\changefont\@gobble}} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\pgfqkeys{/itf/LaTeX/changefont}{% + encoding/.code=\fontencoding{#1},encoding/.value required,% + enc/.alias=encoding,% + family/.code=\fontfamily{#1},family/.value required,% + fam/.alias=family,% + series/.code=\fontseries{#1},series/.value required,% + ser/.alias=series,% + shape/.code=\fontshape{#1},shape/.value required,% + sha/.alias=shape,% + size/.estore as dimen in cs=f@size,% + size/.append code=\set@fontsize\f@linespread\f@size\f@baselineskip,% + siz/.alias*=size,% + baselineskip/.estore as glue in cs=f@baselineskip,% + baselineskip/.append code=\set@fontsize\f@linespread\f@size\f@baselineskip,% + skip/.alias*=baselineskip,% + @linespread/.estore as dimen,% + @linespread/.append code= + \pgfkeysgetvalue{/itf/LaTeX/changefont/@linespread}\pgfkeys@temp + \ifx\pgfkeys@temp\@empty \let\pgfkeys@temp \p@ \fi + \edef\f@linespread{\expandafter\rem@pt\pgfkeys@temp}% + \set@fontsize\f@linespread\f@size\f@baselineskip,% + @linespread/.initial=\p@,% + linespread/.code=\@defaultunits\itf@sk #1pt\relax\@nnil + \pgfkeysalso{/itf/LaTeX/changefont/@linespread=\itf@sk},% + linespread+/.code=\@defaultunits\itf@sk #1pt\relax\@nnil + \pgfkeysalso{/itf/LaTeX/changefont/@linespread+=\itf@sk},% + linespread-/.code=\@defaultunits\itf@sk #1pt\relax\@nnil + \pgfkeysalso{/itf/LaTeX/changefont/@linespread-=\itf@sk},% + linespread*/.alias=@linespread*,% + spread/.alias*=linespread,% +}% \pgfkeys definitions for \changefont +\itf@AfterPackage{color}{% + \pgfkeysifdefined{/itf/LaTeX/changefont/color/.@cmd}{} + {\pgfkeys{/itf/LaTeX/changefont/color/.code=\color{#1}}}% +}% AfterPackage color +\itf@AfterPackage{xcolor}{% + \pgfkeysifdefined{/itf/LaTeX/changefont/color/.@cmd}{} + {\pgfkeys{/itf/LaTeX/changefont/color/.code=\color{#1}}}% +}% AfterPackage xcolor +% \end{macrocode} +% +% +% \subsubsection{\cs{quickprofile}} +% +% \begin{macro}{\quickprofile} +% +% \begin{macrocode} +\newrobustcmd*\quickprofile{\begingroup \afterassignment \itf@quickprofile \count@} +\def\itf@quickprofile{\afterassignment \itf@profileloop \toks@} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\def\itf@profileloop{% + \edef\itf@N {\the\count@}\let\itf@n \z@ + \edef\itf@time{\the\pdfelapsedtime}% + \loop + \message{^^JProfiler: step \number\itf@n}% + \setbox\z@=\vbox{{\the\toks@}}% + \count@ \itf@n\advance\count@ \@ne + \ifnum \count@<\itf@N + \edef\itf@n{\the\count@}% + \repeat + \message{^^J(interfaces) quickprofile: Time elapsed for \itf@N\space cycles: + \the\numexpr(\pdfelapsedtime-\itf@time-32767)/65536\relax sec + \the\numexpr\numexpr(\pdfelapsedtime-\itf@time) + -\numexpr(\pdfelapsedtime-\itf@time-32767)/65536\relax*65536\relax + *1000/65536\relax ms}% + \endgroup +}% \itf@profileloop +% \end{macrocode} +% +% +% \begin{macrocode} +% +% \end{macrocode} +% +% +% \Subsection[TikZ] +% +% \begin{macrocode} +%<*tikz> +\ProvidesPackage{interfaces-tikz} + [2011/02/19 v3.1 load tikz libraries easily (FC)] +\RequirePackage{interfaces-base} +\itf@pgfkeys +% \end{macrocode} +% +% \subsubsection{Catcode verifications} +% +% Some languages (french) changes the catcode of punctuations symbols: \textt: and \textt! +% are active, and this is bad for tikz calculations. +% +% \cs{tikzset}\M*{every picture/.style={\cs{@makeother}...}} solves the problem. +% +% \begin{macrocode} +%% Some catcode checking +\AfterPackage*{tikz}{% + \AtEndPreamble{% + \tikzset{every picture/.add style={% + /utils/exec={\@makeother\!\@makeother\:}}{}}% + }% +}% +% \end{macrocode} +% +% \subsubsection{List of pgf/TikZ packages and libraries} +% +% \begin{macro}{\alltikzpackages} +% Record ``modules'' that must be loaded with \cs{usepackage}: +% \begin{macrocode} +\newcommand*\alltikzpackages{% + tikz,pgf,pgfcore,pgfcalendar,pgffor,pgfkeys,pgfpages,pgfrcs,xxcolor,% + pgfplots,pgfsys, + pgfpict2e,fp%%,% + fp required for fixedpointarithmetic +%% tikzexternal,%% needs special setup +%% pgfmath,% pgfmath should not be loaded twice (\pgfmathdeclarefunction) +}% \alltikzpackages +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\allpgfmodules} +% Record modules that must be loaded with \cs{usepgfmodule}: +% \begin{macrocode} +\newcommand*\allpgfmodules{datavisualization,% +decorations,% +matrix,% +oo,% +parser,% +plot,% +shapes,% +snakes% +%%sorting% bug in pgfmodulesorting.code.tex +}% \allpgfmodules +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\alltikzlibraries} +% Record modules that must be loaded with \cs{usetizlibrary}. +% +% If a module is a module is not found in any of the three lists \cs{alltikzpackage},\, +% \cs{allpgfmodules},\, and\, \cs{alltikzlibraries}\, then \cs{usetikzlibrary} is used by default. +% \begin{macrocode} +\newcommand*\alltikzlibraries{3d,% +arrows,% +automata,% +backgrounds,% +calc,% +calendar,% +chains,% +circuits,% +circuits.ee,% +circuits.ee.IEC,% +circuits.logic,% +circuits.logic.CDH,% +circuits.logic.IEC,% +circuits.logic.US,% +datavisualization,% +datavisualization.3d,% +datavisualization.barcharts,% +datavisualization.formats.functions,% +datavisualization.polar,% +datavisualization.sparklines,% +decorations,% +decorations.footprints,% +decorations.fractals,% +decorations.markings,% +decorations.pathmorphing,% +decorations.pathreplacing,% +decorations.shapes,% +decorations.text,% +er,% +%%external,% needs special setup +fadings,% +fit,% +fixedpointarithmetic,% +folding,% +fpu,% +graphs,% +graphs.basic,% +intersections,% +lindenmayersystems,% +matrix,% +mindmap,% +patterns,% +petri,% +plothandlers,% +plotmarks,% +positioning,% +scopes,% +shadings,% +shadows,% +shapes,% +shapes.arrows,% +shapes.callouts,% +shapes.gates.logic.IEC,% +shapes.gates.logic.US,% +shapes.geometric,% +shapes.misc,% +shapes.multipart,% +shapes.symbols,% +snakes,% +spy,% +svg.path,% +through,% +topaths,% +trees,% +turtle% +}% \alltikzlibraries +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{pgfkeys definitions for \cs{usetikz}} +% +% \begin{macrocode} +\pgfqkeys{/itf/tikz}{% + basic/.code={% + \usetikzlibrary{calc,% for coordinate calculations + arrows,% for arrows + backgrounds,% for framed + scopes,% for scopes and shortcut : { [scope] ... } + shapes,% for ellipse shapes of nodes + }% + },% + basic/.value forbidden,% \alltikzpackages + base/.alias=basic,% + all/.code={% + \expandafter\RequirePackage\expandafter{\alltikzpackages}% + \expandafter\usepgfmodule\expandafter{\allpgfmodules}% see pgfcorescopes.code.tex + \expandafter\usetikzlibrary\expandafter{\alltikzlibraries}% from: tikz.code.tex + },% + .unknown/.code=\itf@usetikzcode\pgfkeyscurrentname +}% \pgfkeys for \usetikz +% \end{macrocode} +% +% \begin{macro}{\usetikz} +% \begin{macrocode} +\newrobustcmd*\usetikz[1]{% + \RequirePackage{tikz}% + \ifblank{#1} + {\pgfqkeys{/itf/tikz}{all}} + {\pgfqkeys{/itf/tikz}{#1}}% + \itf@usetikzsetup +}% \usetikz +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@usetikzsetup} +% \begin{macrocode} +\def\itf@usetikzsetup{\itf@pgfkeys + \pgfkeysifdefined{/tikz/shorten>}{}{% + \pgfkeys{/tikz/shorten>/.alias=tikz/shorten >}}% + \pgfkeysifdefined{/tikz/shorten<}{}{% + \pgfkeys{/tikz/shorten}{}{% + \pgfkeys{/tikz/shorten <>/.style={/tikz/shorten >={##1},/tikz/shorten<={##1}}}}% + \pgfkeysifdefined{/tikz/shorten<>}{}{% + \pgfkeys{/tikz/shorten<>/.alias=tikz/shorten <>}}% +}% +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\itf@usetikzcode} +% +% For unknown keys: when a library is referenced. +% +% \begin{macrocode} +\newrobustcmd*\itf@usetikzcode[1]{\begingroup + \edef\x{% + \noexpand\in@{,#1,}{,\alltikzpackages,}% + \noexpand\ifin@ \noexpand\usepackage{#1}% + \noexpand\else + \noexpand\in@{,#1,}{,\allpgfmodules,}% + \noexpand\ifin@ \noexpand\usepgfmodule{#1}% + \noexpand\else \noexpand\usetikzlibrary{#1}% \usetikzlibrary by default + \noexpand\fi + \noexpand\fi + }\expandafter\endgroup\x +}% \itf@usetikzcode +% \end{macrocode} +% \end{macro} +% +% \subsubsection{\cs{papergraduate}} +% +% \begin{macro}{\papergraduate} +% \begin{macrocode} +\newrobustcmd*\papergraduate[1][x=1cm,y=1cm]{% + \ifpgfpicture \expandafter \itf@papergraduate + \else \expandafter \itf@wallpapergraduate + \fi{#1}% +}% \papergraduate +\pgfqkeys{/itf/tikz/papergraduate}{% + xcolor/.store as color,% + xcolor/.default=magenta,% + ycolor/.store as color,% + ycolor/.default=cyan,% + color/.style={xcolor={#1},ycolor={#1}},% + opacity/.initial=.25,opacity/.default=.25,opacity/.blank=.25,% + x/.initial=1cm,x/.default=1cm,% + y/.initial=1cm,y/.default=1cm,% + unit/.style={x={#1},y={#1}},% + units/.alias=unit,xy/.alias=unit,% + xrule/.true=\pgfkeyslet{/itf/tikz/papergraduate/hasHrule}\@firstofone,% + xrule/.false=\pgfkeyslet{/itf/tikz/papergraduate/hasHrule}\@gobble,% + xrule/on/.alias=xrule/true,xrule/off/.alias=xrule/false,% + Hrule/.alias=xrule,% + xrule/font/.store as code,% + xrule/font/.default=\tiny,% + Hrule/font/.alias=xrule/font,% + yrule/.true=\pgfkeyslet{/itf/tikz/papergraduate/hasVrule}\@firstofone,% + yrule/.false=\pgfkeyslet{/itf/tikz/papergraduate/hasVrule}\@gobble,% + yrule/on/.alias=yrule/true,yrule/off/.alias=yrule/false,% + Vrule/.alias=yrule,% + yrule/font/.store as code,% + yrule/font/.default=\tiny,% + Vrule/font/.alias=yrule/font,% + font/.style={xrule/font={#1},yrule/font={#1}},% + rule/font/.alias=font,% + text opacity/.initial=.8,% + text opacity/.default=.8,text opacity/.blank=.8,% + norule/.style={xrule=false,yrule=false},% + norules/.alias=norule,% + @reset/.style={font,xrule,yrule,color,unit,opacity},% +}% keys for \papergraduate options +\def\itf@graduation@vert[#1]#2#3#4#5{% + \node at (0,0) [{inner sep=0pt,outer sep=0pt,anchor=south west, + color=\pgfkeysvalueof{/itf/tikz/papergraduate/ycolor},#1}] {% + \hbox to#2{\leaders + \hbox to\dimexpr\pgf@yy/#4{\hss\vrule height#3 depth\z@ width#5}\hss}}} +\def\itf@graduation@horiz[#1]#2#3#4#5{ + \node at (0,0) [{inner sep=0pt,outer sep=0pt,anchor=north west,yscale=-1, + color=\pgfkeysvalueof{/itf/tikz/papergraduate/xcolor},#1}] {% + \rlap{\vbox to#3{\leaders \vbox to\dimexpr\pgf@xx/#4{% + \kern-\dimexpr#5/2\hrule width#2 depth0pt height#5}\vss}}}} +\def\itf@wallpapergraduate #1{% + \tikz[{remember picture,overlay}]{% + \pgfqkeys{/itf/tikz/papergraduate}{@reset,#1}% + \begin{scope}[{shift=(current page.south west), + x=\pgfkeysvalueof{/itf/tikz/papergraduate/x},% + y=\pgfkeysvalueof{/itf/tikz/papergraduate/y},% + text opacity=\pgfkeysvalueof{/itf/tikz/papergraduate/opacity}}]% + \itf@paper@graduate \paperwidth \paperheight + \end{scope}}% +}% \itf@wallpapergraduate +\def\itf@papergraduate #1#2;{% + \begin{scope}[every node/.style={}]% + \pgfqkeys{/itf/tikz/papergraduate}{@reset,#1}% + \coordinate (itf@papergraduate) at #2; + \@tempdima \pgf@x \@tempdimb \pgf@y + \pgfpointanchor {itf@papergraduate}{center} + \advance\@tempdima -\pgf@x + \ifdim\@tempdima<\z@ \@tempdima \m@ne\@tempdima \fi + \advance\@tempdimb -\pgf@y + \ifdim\@tempdimb<\z@ \@tempdimb \m@ne\@tempdimb \fi + \edef\itf@tp{% + \noexpand\begin{scope}[{shift={(\the\pgf@x,\the\pgf@y)},% + x=\pgfkeysvalueof{/itf/tikz/papergraduate/x},% + y=\pgfkeysvalueof{/itf/tikz/papergraduate/y},% + text opacity=\pgfkeysvalueof{/itf/tikz/papergraduate/opacity}}]% + \noexpand\itf@paper@graduate {\the \@tempdima}{\the \@tempdimb}% + \noexpand\end{scope}% + }\itf@tp + \end{scope}% +}% \paper@graduate +\def\itf@paper@graduate #1#2{\hfuzz\maxdimen\vfuzz\hfuzz\hbadness\@M\vbadness\hbadness + \itf@graduation@horiz [text opacity/.expanded={\tikz@textopacity/2}] {#1}{#2}{10}{.1pt};% + \itf@graduation@horiz []{#1}{#2}{2}{.1pt};% opacity=.25 + \itf@graduation@horiz []{#1}{#2}{1}{.2pt}; + \pgfkeysvalueof{/itf/tikz/papergraduate/hasVrule}{% + \itf@graduation@horiz [black,nearly opaque] {1mm}{#2}{10}{.1pt};% opacity=.75 + \itf@graduation@horiz [black,nearly opaque] {1.5mm}{#2}{2}{.1pt}; + \itf@graduation@horiz [black,opaque] {2mm}{#2}{1}{.1pt}; + \begin{scope}[inner sep=0pt,outer sep=0pt,% + text opacity=\pgfkeysvalueof{/itf/tikz/papergraduate/text opacity},% + font=\pgfkeysvalueof{/itf/tikz/papergraduate/yrule/font}]% + \begingroup + \let\itf@tp \@empty \dimen@\z@ \count@\z@ + \@whiledim \dimen@<#2\do{% + \edef\itf@tp{\itf@tp (3mm,\the\dimen@) node {\the\count@}}% + \advance\count@ \@ne \dimen@ \count@\pgf@xx + }\expandafter\endgroup\expandafter \path \itf@tp; + \end{scope}}% + \itf@graduation@vert [text opacity/.expanded={\tikz@textopacity/2}] {#1}{#2}{10}{.1pt}; + \itf@graduation@vert [] {#1}{#2}{2}{.1pt}; + \itf@graduation@vert [] {#1}{#2}{1}{.2pt}; + \pgfkeysvalueof{/itf/tikz/papergraduate/hasHrule}{% + \itf@graduation@vert [black,nearly opaque] {#1}{1mm}{10}{.1pt}; + \itf@graduation@vert [black,nearly opaque] {#1}{1.5mm}{2}{.1pt}; + \itf@graduation@vert [black,opaque] {#1}{2mm}{1}{.1pt}; + \begin{scope}[inner sep=0pt,outer sep=0pt,% + text opacity=\pgfkeysvalueof{/itf/tikz/papergraduate/text opacity},% + font=\pgfkeysvalueof{/itf/tikz/papergraduate/xrule/font}]% + \begingroup + \let\itf@tp \@empty \dimen@\z@ \count@\z@ + \@whiledim \dimen@<#1\do{% + \edef\itf@tp{\itf@tp (\the\dimen@,3mm) node {\the\count@}}% + \advance\count@ \@ne \dimen@ \count@\pgf@xx + }\expandafter\endgroup\expandafter \path \itf@tp; + \end{scope}}% +}% \itf@paper@graduate +% \end{macrocode} +% \end{macro} +% +% +% +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \sectionformat\subsection{bookmark/color=db} +% \Subsection[titlesec] +% +% \begin{macrocode} +%<*titlesec> +\ProvidesPackage{interfaces-titlesec} + [2011/02/19 v3.1 pgfkeys macros for titlesec (FC)] +\RequirePackage{interfaces-base} +\RequirePackage{auxhook}% +\RequirePackage{gettitlestring} +\itf@Check@Package{titlesec} +% \end{macrocode} +% +% \subsubsection{titlesec modifications} +% +% \begin{macrocode} +%% t i t l e s e c "p a t c h e s" +\robustify\titleclass \robustify\titleformat \robustify\titlespacing +\AddLineBeginMainAux{% + \string\providecommand\string\ttlp@append[2]{}% +} +\BeforeFile*{ttlkeys.def}{% + \expandafter\edef\csname itf@ttlkeys.def\endcsname{% + \catcode32 \the\catcode32\relax + \catcode37 \the\catcode37\relax + \endlinechar\the\endlinechar\relax}% + \catcode37 14\relax % percent=comment (inside .dtx files...) + \catcode32 9\relax % ignore spaces + \endlinechar\m@ne % and line feeds +} +\AfterFile*{ttlkeys.def}{\csname itf@ttlkeys.def\endcsname}% +% \end{macrocode} +% +% \begin{macro}{\ttlh@runinifempty} +% +% A ``new'' shape which behaves like \texttbf{hang} but no paragraph break +% is inserted if the title is empty. Hence the name: \textttbf{runinifempty}. +% \begin{macrocode} +%%----------------------------------------------------------------------------- +%% runinifempty => like hang but no paragraph break (like runin) if title is empty +\def\ttlh@runinifempty{% + \csname ttlh@\ifx\ttl@savetitle\@empty runin\else hang\fi\endcsname +}% \ttlh@runinifempty +% \end{macrocode} +% \end{macro} +% +% \subsubsection{\cs{sectionformat}} +% +% \begin{macro}{\sectionformat} +% \cs{sectionformat}\cs{subsection}\stform*\M[shape]\M{key=value} +% \begin{macrocode} +\newrobustcmd*\sectionformat[1]{\@ifstar + {\itf@sectionformat{#1}{/*}} + {\itf@sectionformat{#1}{}}% +}% \sectionformat +\def\itf@sectionformat#1#2{\@testopt + {\expandafter\expandafter\expandafter% + \itf@sectionf@rmat\expandafter\@gobble\string#1\@nil{#2}}{}% +}% \sectionformat +\def\itf@sectionf@rmat#1\@nil#2[#3]#4{\itf@pgfkeys\ifblank{#3} + {\pgfqkeys{/itf/titlesec/#1#2} + {/itf/titlesec/@setup={#1}{#2},#4,/itf/titlesec/@update={#1}{#2}}} + {\pgfqkeys{/itf/titlesec/#1#2} + {/itf/titlesec/@setup={#1}{#2},#4,shape={#3},/itf/titlesec/@update={#1}{#2}}}% +}% \itf@ttl@sectionformat +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@ttl@setup} +% \begin{macro}{\itf@ttl@getformat} +% \begin{macro}{\itf@ttl@getspacing} +% Macros used to retrieve the values set by \cs{titleformat} and/or \cs{titlespacing}. This allows +% to use \cs{sectionformat} concurrently with \cs{titleformat} and \cs{titlespacing} provided by +% \xpackage{titlesec}. +% \begin{macrocode} +%% private keys @setup and @update +\pgfqkeys{/itf/titlesec}{% + @setup/.code 2 args=\itf@ttl@setup{#1}{#2},% + @update/.code 2 args=\expandafter\itf@ttl@update + \csname#1\endcsname{/itf/titlesec/#1}{#2}% +} +\newrobustcmd*\itf@ttl@setup[2]{% + \pgfkeysifdefined{/itf/titlesec/#1#2/shape}{} + {\itf@ttl@newsection{#1}{#2}}% + \ifcsundef{ttls@#1#2}{}% no previous spacing settings + {\expandafter\expandafter\expandafter% + \itf@ttl@getspacing\csname ttls@#1#2\endcsname{/itf/titlesec/#1#2}}% + \ifcsundef{ttlf@#1#2}{}% no previous format settings + {\ifttl@explicit + \expandafter\expandafter\expandafter% + \itf@ttl@getformat\csname ttlf@#1#2\endcsname{}{/itf/titlesec/#1#2}% + \else + \expandafter\expandafter\expandafter% + \itf@ttl@getformat\csname ttlf@#1#2\endcsname{/itf/titlesec/#1#2}% + \fi}% +}% \itf@ttl@setup +\def\itf@ttl@setkey#1#2{\begingroup + \def\x{\pgfkeysvalueof{#1}}\def\y{#2}% + \expandafter\endgroup\ifx\x\y\else + \pgfkeyssetvalue{#1}{#2}\fi +}% \itf@ttl@setkey +\def\itf@ttl@getspacing#1#2#3#4#5#6{% + \itf@ttl@setkey{#6/left}{#1}% + \itf@ttl@setkey{#6/right}{#2}% + \itf@ttl@setkey{#6/top}{#3}% + \itf@ttl@setkey{#6/bottom}{#4}% + \itf@ttl@setkey{#6/indent first}{#5}% +}% \itf@ttl@getspacing +\def\itf@ttl@getformat#1#2{% + \csname ltx@\ifx\pgfkeysvalueof#1first\else second\fi oftwo\endcsname + {\itf@ttl@get@format{}} + {\itf@ttl@get@format{#1}{#2}}% +}% \itf@ttl@getformat +\def\itf@ttl@get@format#1#2#3#4#5#6#7{% + \if\relax\detokenize{#1}\relax\else + \pgfkeysEsetvalue{#7/shape}{\expandafter\itf@strip@at\string#1}% + \fi + \itf@ttl@setkey{#7/font}{#2}% + \itf@ttl@setkey{#7/label}{#3}% + \itf@ttl@setkey{#7/sep}{#4}% + \itf@ttl@setkey{#7/before}{#5}% + \itf@ttl@setkey{#7/after}{#6}% +}% \itf@ttl@get@format +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\itf@ttl@update} +% This macros plugs the values set before with \cs{pgfkeys} into the +% special macros \cs{ttlf@\meta{section}} (for format) and \cs{ttls@\meta{section}} (for spacing). +% \begin{macrocode} +\newrobustcmd*\itf@ttl@update[3]{% + \ifblank{#3} + {\ttl@getkeys{#1}{titlesec}} + {\ttl@getkeys{name=#1,numberless}{titlesec}}% + \pgfkeysgetvalue{#2#3/shape}\itf@tp + \ifcsundef{ttlh@\itf@tp} + {\begingroup \makeatletter + \InputIfFileExists{\itf@tp.tss}{}{% + \PackageError{titlesec}{Unknown shape}% + {Shapes are defined in files with extension tss\MessageBreak + Either you have misspelled the shape\MessageBreak + or there is no a \itf@tp.tss file}}% + \endgroup} + {}% + \ifttl@explicit \begingroup + \pgfkeysgetvalue{#2#3/before}\pgfkeys@temp + \toks@\expandafter{\pgfkeys@temp}% + \edef\x{\endgroup\def\noexpand\itf@tp####1{\the\toks@}}% + \x \pgfkeyslet{#2#3/before@cmd}\itf@tp + \@temptokena{\csdef{ttlf@\ttl@a}##1}% + \the\@temptokena{% + \pgfkeysvalueof{#2#3/shape@cs}% + {\pgfkeysvalueof{#2#3/font}}% + {\pgfkeysvalueof{#2#3/label}}% + {\pgfkeysvalueof{#2#3/sep}}% + {\pgfkeysvalueof{#2#3/before@cmd}{##1}}% + {\pgfkeysvalueof{#2#3/after}}}% + \else\@temptokena{\csdef{ttlf@\ttl@a}}% + \the\@temptokena{% + \pgfkeysvalueof{#2#3/shape@cs}% + {\pgfkeysvalueof{#2#3/font}}% + {\pgfkeysvalueof{#2#3/label}}% + {\pgfkeysvalueof{#2#3/sep}}% + {\pgfkeysvalueof{#2#3/before}}% + {\pgfkeysvalueof{#2#3/after}}}% + \fi + \csname ttl@compat\ttl@a\endcsname + \ttl@spacing@ii + {\pgfkeysvalueof{#2#3/indent first}}% + {\pgfkeysvalueof{#2#3/left}}% + {\pgfkeysvalueof{#2#3/top}}% + {\pgfkeysvalueof{#2#3/bottom}}% + [\pgfkeysvalueof{#2#3/right}]% +}% \itf@ttl@update +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@ttl@titleclass} +% This macro calls \cs{titleclass} to either: +% \begin{itemize}[itemsep=0pt,topsep=0pt,parsep=0pt] +% \item change the class of an existing sectionning command; +% \interitem or: +% \item create a new sectionning command. +% \end{itemize} +% +% \begin{macrocode} +%%---------------------------------------------------------------------------- +%% t i t l e c l a s s +\newrobustcmd*\itf@ttl@titleclass{\@ifstar + {\itf@ttl@titleclass@i*} + {\itf@ttl@titleclass@i{}}% +}% \itf@ttl@titleclass +\def\itf@ttl@titleclass@i#1#2#3[#4]#5\@nil{\ifblank{#4} + {% + \expandafter\titleclass\csname#2\endcsname{#3}% + } + {% + \expandafter\titleclass\csname#2\endcsname{#3}[{#4}]% #4 = sup-level + \if\relax#1\relax % not starred + \expandafter\expandafter\expandafter% + \itf@ttl@titleclass@ii\expandafter\@gobble\string#4\relax{#2}% \@addtoreset... + \fi + }% + \expandafter\providecommand\csname l@#2\endcsname[2]{}% no entry in toc +}% \itf@ttl@titleclass@i +\def\itf@ttl@titleclass@ii#1\relax#2{% + \ifcsundef{c@#2} + {\newcounter{#2}[{#1}]}% creates counter for #1 + {\@addtoreset{#2}{#1}}% + \csxdef{the#2}{% + \expandafter\noexpand\csname the#1\endcsname + .\noexpand\@arabic\expandafter\noexpand\csname c@#2\endcsname + }% \the#2 + \ifcsundef{l@#1}{}{% + \expandafter\providecommand\csname l@#2\endcsname[2]{% + \csname l@#1\endcsname{##1}{##2}% + }% \l@#2 = \l@newsection is (by default) the same as \l@sup-level + }% +}% \itf@ttl@titleclass@ii +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@ttl@createsection} +% \qquad If \cs{sectionformat} is invoked with an unknown sectionning command (\ie an undefined macro +% as first argument) then \cs{itf@ttl@createsection} is expanded in order to: +% \begin{enumerate}[label=\arabic*),topsep=0pt] +% \item create the new sectionning command with \cs{titleclass}, +% \item create the \xpackage{pgfkeys} keys for this section, +% \item do some additionnal setup if \thispackage[interfaces-hypbmsec] and/or \thispackage[interfaces-tocloft] are loaded. +% \end{enumerate} +% \begin{macrocode} +%%----------------------------------------------------------------------------- +%% C r e a t i n g n e w s e c t i o n s +\def\itf@ttl@createsection#1{% sectionning command undefined: temporarily defined + \expandafter\titleclass\csname#1\endcsname{straight}[*]% in straight class + \itf@AfterPackage{hypbmsec}{% + \AfterPreamble{% + \csletcs{hbs@#1}{#1}% + \csxdef{#1}{\noexpand\hbs@do\expandafter\noexpand\csname hbs@#1\endcsname}% + }% + }% + \itf@AfterPackage{interfaces-tocloft}{% + \itf@cft@newsection{toc}{#1}% + }% + \itf@AfterPackage{interfaces-hypbmsec}{% + \expandafter\let\csname last#1title\endcsname\relax + \expandafter\let\csname last#1bookmark\endcsname\relax + \expandafter\let\csname last#1toc\endcsname\relax + }% +}% \itf@ttl@createsection +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Keys for \cs{sectionformat}} +% +% \begin{macro}{\itf@ttl@newsection} +% This macro creates the \xpackage{pgfkeys} keys for each sectionning command. +% +% The \xpackage{pgfkeys} keys are not created at once, but only when \cs{sectionformat} is invoked first. +% \begin{macrocode} +%%----------------------------------------------------------------------------- +%% D e f i n i n g k e y s f o r e a c h s e c t i o n +\def\itf@ttl@newsection#1#2{% #1=section, #2=/* or empty + \ifcsundef{#1}% sectionning command undefined: temporarily defined in straight class + {\itf@ttl@createsection{#1}} + {}% + \ifblank{#2}{% + \pgfqkeys{/itf/titlesec/#1}{% these keys do not exist for starred sections + class/.code=\itf@ttl@titleclass{#1}##1[]\@nil,% with \@addtoreset + class/.value required,% if sup-level is given + class*/.code=\itf@ttl@titleclass*{#1}##1[]\@nil,% without \@addtoreset + class*/.value required,% even if sup-level is given + shape/.initial=,% initial shapes set by titlesec.sty for not numbered sections. + the#1/.store in cs=the#1,% + the#1/.default=\pgfkeysvalueof{/itf/titlesec/#1/label},% + }} + {% starred section: unless titlesec, we do not put the default shape to hang, + \pgfkeysifdefined{/itf/titlesec/#1/shape}%but to the shape of the not starred + {\pgfkeysgetvalue{/itf/titlesec/#1/shape}\itf@tp}% sectionning command + {\def\itf@tp{hang}}% + \pgfkeyslet{/itf/titlesec/#1#2/shape}\itf@tp% + }% + \pgfqkeys{/itf/titlesec/#1#2}{% + shape/.value required,% + shape@cs/.initial= + \csname ttlh@\pgfkeysvalueof{/itf/titlesec/#1#2/shape}\endcsname,% constant + shape@cs/.is private=interfaces-titlesec,% constant + font/.store as code,% + format/.alias*=font,% + label/.store as code,% + sep/.estore as glue,% + labelsep/.alias*=sep,% + before/.store as code,% + before@cmd/.is private=interfaces-titlesec,% + after/.store as code,% + indent first/.true=\pgfkeyssetvalue{/itf/titlesec/#1#2/indent first}{\@ne},% + indent first/.false=\pgfkeyssetvalue{/itf/titlesec/#1#2/indent first}{\z@},% + identfirst/.alias=indent first,% + indent first=true,% + left/.estore as glue,% + top/.estore as glue,% + bottom/.estore as glue,% + right/.estore as glue,% + break/.code=\ifblank{##1} + {\cslet{#1break}\@empty} + {\protected\csdef{#1break}{##1}},% + break*/.code=\protected\csappto{#1break}{##1},% + break+/.alias=break*,% + mark/.code=\ifblank{##1} + {\cslet{#1mark}\@gobble} + {\protected\long\csdef{#1mark}####1{##1}},% + mark/.default=,% + }% \pgfkeys + \ifblank{#2}{% no default marks for stared (numberless) \section* + \itf@AfterPackage{interfaces-marks}{% requires interfaces-marks + \pgfkeys{/itf/titlesec/#1/mark/.default=\marksthe{#1}{##1}}% + }% AfterPackage interfaces-mark + \itf@AfterPackage{interfaces-bookmark}{% requires interfaces-bookmark + \pgfqkeys{/itf/titlesec/#1}{% does not exist for starred sections + bookmark/.is multiple choice,% + bookmark/level/.estore in cs=toclevel@#1,% depth of the bookmark + bookmark/level/.default=\ifcsvoid{ttll@#1}{99}{\csuse{ttll@#1}},% + bookmark/level/.blank=\ifcsvoid{toclevel@#1} + {\ifcsvoid{ttll@#1}{99}{\csuse{ttll@#1}}}{\csuse{toclevel@#1}},% + bookmark/toclevel/.alias=bookmark/level,% + bookmark/bold/.code=\ifblank{##1} + {\pgfkeyslet{/itf/titlesec/#1/bookmark/bold}\@empty} + {\pgfkeyssetvalue{/itf/titlesec/#1/bookmark/bold}{bold=##1,}},% + bookmark/bold/.default=true,% + bookmark/bold*/.code=\ifblank{##1} + {\pgfkeyslet{/itf/titlesec/#1/bookmark/bold*}\@empty} + {\pgfkeyssetvalue{/itf/titlesec/#1/bookmark/bold*}{bold*=##1,}},% + bookmark/bold*/.default=true,% + bookmark/italic/.code=\ifblank{##1} + {\pgfkeyslet{/itf/titlesec/#1/bookmark/italic}\@empty} + {\pgfkeyssetvalue{/itf/titlesec/#1/bookmark/italic}{italic=##1,}},% + bookmark/italic/.default=true,% + bookmark/italic*/.code=\ifblank{##1} + {\pgfkeyslet{/itf/titlesec/#1/bookmark/italic*}\@empty} + {\pgfkeyssetvalue{/itf/titlesec/#1/bookmark/italic}{italic*=##1,}},% + bookmark/italic*/.default=true,% + bookmark/color/.code=\ifblank{##1} + {\pgfkeyslet{/itf/titlesec/#1/bookmark/color}\@empty} + {\pgfkeyssetvalue{/itf/titlesec/#1/bookmark/color}{color=##1,}},% + bookmark/color/.default=,% + bookmark/color*/.code=\ifblank{##1} + {\pgfkeyslet{/itf/titlesec/#1/bookmark/color*}\@empty} + {\pgfkeyssetvalue{/itf/titlesec/#1/bookmark/color*}{color*=##1,}},% + bookmark/color*/.default=,% + bookmark/on/.code=\pgfkeyssetvalue{/itf/titlesec/#1/bookmark/on}{disable=false,},% + bookmark/on/.value forbidden,% + bookmark/off/.code=\pgfkeyssetvalue{/itf/titlesec/#1/bookmark/on}{disable=true,},% + bookmark/off/.value forbidden,% + bookmark/none/.alias=bookmark/off,% + bookmark/on*/.code=\pgfkeyssetvalue{/itf/titlesec/#1/bookmark/on*}{disable*=false,},% + bookmark/off*/.code=\pgfkeyssetvalue{/itf/titlesec/#1/bookmark/on*}{disable*=true,},% + bookmark/none*/.alias=bookmark/off*,% + bookmark/disable*/.alias=bookmark/off*,% + bookmark/style/.code=\ifblank{##1} + {\pgfkeyslet{/itf/titlesec/#1/bookmark/style}\@empty} + {\pgfkeyssetvalue{/itf/titlesec/#1/bookmark/style}{style=##1,}},% + bookmark/style/.default=,% + bookmark/.unknown/.code=\pgfkeysEsetvalue{/itf/titlesec/#1/bookmark/other} + {\pgfkeyscurrentname={##1}},% + bookmark/bold/.initial=,% + bookmark/bold*/.initial=,% + bookmark/italic/.initial=,% + bookmark/italic*/.initial=,% + bookmark/color/.initial=,% + bookmark/color*/.initial=,% + bookmark/on/.initial=,% + bookmark/on*/.initial=,% + bookmark/style/.initial=,% + }}% \AfterPackage*{interfaces-bookmark} + }% not starred (numberless) \section + {}% starred/numberless \section*: do not create the keys +}% \itf@ttl@newsection +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\addcontentsline (patch)} +% \patchlabel[prepend]{addcontentsline} +% +% \qquad This modification of \cs{addcontentsline} occurs only if both \thispackage[interfaces-bookmark] \textbf{and} +% \thispackage[interfaces-titlesec] are loaded. Implementation of the \textt[\pkgcolor]{bookmark} key and sub-keys +% of \cs{sectionformat} for each sectionning command. +% +% \begin{macrocode} +%% bookmarks styles for sectionning commands: +\@makeother\# +\itf@AfterPackage{interfaces-bookmark}{% + \itf@patch\itf@preapptocmd\addcontentsline % #2=section name in + {\begingroup\itf@ttl@BKM{/itf/titlesec/#2/bookmark}}% \addcontentsline + {\endgroup} + {\@PackageInfoNoLine{interfaces-titlesec} + {\string\addcontentsline\space successfully patched!}} + {\@PackageWarningNoLine{interfaces-titlesec} + {Patch of \string\addcontentsline\space failed + \MessageBreak bookmark-style specs for sections + \MessageBreak will be unavailable}}% +}% AfterPackage interfaces-bookmark +\catcode`\#=6 +\def\itf@ttl@BKM#1{% + \pgfkeysifdefined{#1/.@cmd} + {% + \edef\itf@tp{% do nothing if the keys are not set (shortcut) + \pgfkeysvalueof{#1/bold}% + \pgfkeysvalueof{#1/bold*}% + \pgfkeysvalueof{#1/italic}% + \pgfkeysvalueof{#1/italic*}% + \pgfkeysvalueof{#1/color}% + \pgfkeysvalueof{#1/color*}% + \pgfkeysvalueof{#1/on}% + \pgfkeysvalueof{#1/on*}% + \pgfkeysvalueof{#1/style}}% + \ifx\itf@tp\@empty + \else + \global\pgfkeyslet{#1/bold*}\@empty + \global\pgfkeyslet{#1/italic*}\@empty + \global\pgfkeyslet{#1/color*}\@empty + \global\pgfkeyslet{#1/on*}\@empty + \expandafter\bookmarksetup\expandafter{\itf@tp}% + \pgfkeysifdefined{/itf/bookmark/*}% + {% \bookmarksetup{color*=} overwrites \sectionformat...{bookmark/color*=} + \pgfkeysgetvalue{/itf/bookmark/*}\itf@tp + \expandafter\bookmarksetup\expandafter{\itf@tp}% + } + {}% + \fi} + {}% +}% \itf@ttl@BKM +% \end{macrocode} +% \end{macro} +% +% \subsubsection{\cs{bottomtitles}} +% +% \begin{macro}{\bottomtitles} +% This is a ``skip command'': it can be assigned a number or a skip. +% \begin{macrocode} +%%----------------------------------------------------------------------------- +%% b o t t o m t i t l e s +\newrobustcmd*\bottomtitles{\@ifnextchar\bgroup + \itf@setbottomtitlespace + {\afterassignment\itf@set@bottomtitle@space\itf@sk}% +}% \bottomtitles +\def\itf@setbottomtitlespace#1{% + \@defaultunits\itf@sk#1\textheight\relax\@nnil + \itf@set@bottomtitle@space +}% \itf@setbottomtitlespace +\def\itf@set@bottomtitle@space{\xdef\bottomtitlespace{\the\dimexpr\itf@sk}} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Subsection[hyperref] +% +% \begin{macrocode} +%<*hyperref> +\ProvidesPackage{interfaces-hyperref} + [2011/02/19 v3.1 provides raised hyperdef (FC)] +\RequirePackage{interfaces-base} +\itf@Check@Package{hyperref} +% \end{macrocode} +% +% \begin{macro}{\raisedhyperdef} +% +% The anchor is made with \cs{Hy@raisedlink}. The raised amount is used in \cs{HyperRaiseLinkHook}: +% +% \begin{macrocode} +\newrobustcmd\raisedhyperdef[4][]{\begingroup + \ifblank{#1} + {} + {% + \expandafter\def\expandafter\HyperRaiseLinkHook\expandafter{% + \expandafter\def\expandafter\HyperRaiseLinkHook + \expandafter{\HyperRaiseLinkHook}% restore current definition + \HyperRaiseLinkHook + \advance\noexpand\HyperRaiseLinkLength by\dimexpr#1\relax\relax}% + }% + \ifx \\#2\\\def \Hy@AnchorName {#3}\else + \def \Hy@AnchorName {#2.#3}% + \fi + \ltx@leavevmode + \Hy@raisedlink{\hyper@anchorstart{\Hy@AnchorName}\hyper@anchorend}% + \endgroup + #4% +}% \raisedhyperdef +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Subsection[bookmark] +% +% \begin{macrocode} +%<*bookmark> +\ProvidesPackage{interfaces-bookmark} + [2011/02/19 v3.1 more control on bookmarks (FC)] +\RequirePackage{interfaces-base} +\RequirePackage{interfaces-hyperref} +\RequirePackage{refcount} +\itf@Check@Package{bookmark} +% \end{macrocode} +% +% \patchlabel[modif]{bookmark} +% \begin{macro}{\\bookmark (patch)} +% Implementation of \textt[\opt]{disable},\, and\, starred keys \stform* +% (previous values must be restored after \cs{write}): +% \begin{macrocode} +\expandafter\itf@patch\expandafter\patchcmd\csname\string\bookmark\endcsname + {\immediate\write\@mainaux}{\itf@BKM@write} + {\@PackageInfoNoLine{interfaces-bookmark} + {\expandafter\string\csname\string\bookmark\endcsname\space + successfully patched!}} + {\@PackageWarningNoLine{interfaces-bookmark} + {Command \expandafter\string\csname\string\bookmark\endcsname\space + could not be patched\MessageBreak + Loading of interfaces-bookmark is canceled}% + \endinput} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{star keys\texorpdf\stform* definitions} +% +% \begin{macrocode} +\global\let\itf@BKM@enable\@ne % 0 = disable*, 1=enable, \@M = disable +\pgfqkeys{/itf/bookmark}{% + disable/.true=\global\let\itf@BKM@enable\@M,% + disable/.false=\global\let\itf@BKM@enable\@ne,% + disable*/.true=\global\let\itf@BKM@enable\z@,% + disable*/.false=\global\let\itf@BKM@enable\@ne,% + atend/.true=\ifnum\itf@BKM@enable>0\edef\itf@BKM@enable{\number-\itf@BKM@enable}\fi,% + atend/.false=\ifnum\itf@BKM@enable<0\edef\itf@BKM@enable{\number-\itf@BKM@enable}\fi,% + bold*/.true=\pgfqkeys{/itf/bookmark}{@save={bold=true}},% + bold*/.false=\pgfqkeys{/itf/bookmark}{@save={bold=false}},% + bold*/@blank/.code=\pgfqkeys{/itf/bookmark/@restore}{bold},% + bold*/.blank=@blank,% + italic*/.true=\pgfqkeys{/itf/bookmark}{@save={italic=true}},% + italic*/.false=\pgfkeys{/itf/bookmark}{@save={italic=false}},% + italic*/@blank/.code=\pgfqkeys{/itf/bookmark/@restore}{italic},% + italic*/.blank=@blank,% + color*/.code={\ifblank{#1} + {\pgfqkeys{/itf/bookmark/@restore}{color}} + {\pgfqkeys{/itf/bookmark}{@save={color={#1}}}}% + },% + @save/.code={% + \pgfkeysifdefined{/itf/bookmark/@save/color}{} + {\pgfkeyslet{/itf/bookmark/@save/color}\BKM@color}% + \pgfkeysifdefined{/itf/bookmark/@save/FontStyle}{} + {\pgfkeyslet{/itf/bookmark/@save/FontStyle}\BS@BKM@FontStyle}% + \pgfkeysifdefined{/itf/bookmark/@save/grouplevel}{} + {\pgfkeysEsetvalue{/itf/bookmark/@save/grouplevel}{\the\currentgrouplevel}}% + \pgfkeysaddvalue{/itf/bookmark/*}{}{,#1}% + \bookmarksetup{#1}% + },% + @restore/color/.code=% + \pgfkeysifdefined{/itf/bookmark/@save/color} + {\pgfkeysgetvalue{/itf/bookmark/@save/color}\BKM@color} + {},% + @restore/FontStyle/.code=% + \pgfkeysifdefined{/itf/bookmark/@save/FontStyle} + {\pgfkeysgetvalue{/itf/bookmark/@save/FontStyle}\BS@BKM@FontStyle} + {},% + @restore/.code={% + \pgfkeysifdefined{/itf/bookmark/@save/color} + {\pgfkeysgetvalue{/itf/bookmark/@save/color}\BKM@color} + {}% + \pgfkeysifdefined{/itf/bookmark/@save/FontStyle} + {\pgfkeysgetvalue{/itf/bookmark/@save/FontStyle}\BS@BKM@FontStyle} + {}% + \pgfkeysifdefined{/itf/bookmark/@save/grouplevel} + {% shortcut: \bookmarksetup{bold*} called inside main group (level 0) + \ifnum\pgfkeysvalueof{/itf/bookmark/@save/grouplevel}=\z@ + \global\pgfkeyslet{/itf/bookmark/@save/FontStyle}\@undefined + \global\pgfkeyslet{/itf/bookmark/@save/color}\@undefined + \global\pgfkeyslet{/itf/bookmark/@save/grouplevel}\@undefined + \global\pgfkeyslet{/itf/bookmark/*}\@undefined + \global\let\BKM@color\BKM@color + \global\let\BS@BKM@FontStyle\BS@BKM@FontStyle + \else % restore after each group as needed + \pgfkeyslet{/itf/bookmark/@save/FontStyle}\@undefined + \pgfkeyslet{/itf/bookmark/@save/color}\@undefined + \pgfkeyslet{/itf/bookmark/*}\@undefined + \ifnum\currentgrouplevel>\z@ + \aftergroup\itf@BKM@restore + \else + \pgfkeyslet{/itf/bookmark/@save/grouplevel}\@undefined + \fi\fi + } + {}% + },% + @restore/bold/.code={% bold is "hidden" in \BS@BKM@FontStyle + \begingroup + \edef\itf@tp{\bookmarkget{bold}}% + \pgfqkeys{/itf/bookmark/@restore}{FontStyle}% + \count@=\bookmarkget{bold}% + \edef\itf@tp{\endgroup + \ifnum\itf@tp=\count@ + \else \noexpand\bookmarksetup{% + bold\ifcase\count@ =false\fi}\fi + }\itf@tp},% + @restore/italic/.code={% italic is "hidden" in \BS@BKM@FontStyle + \begingroup + \edef\itf@tp{\bookmarkget{italic}}% + \pgfqkeys{/itf/bookmark/@restore}{FontStyle}% + \count@=\bookmarkget{italic}% + \edef\itf@tp{\endgroup + \ifnum\itf@tp=\count@ + \else \noexpand\bookmarksetup{% + italic\ifcase\count@ =false\fi}\fi + }\itf@tp},% +} +\def\itf@BKM@restore{% + \pgfkeysifdefined{/itf/bookmark/@save/grouplevel} + {\pgfkeysalso{/itf/bookmark/@restore}} + {}% +}% \itf@BKM@restore +%% Plug the BKM keys in the interfaces pgfkeys (not efficient but quickly written...) +\define@key{BKM}{disable}[true]{\itf@pgfkeys\pgfkeysalso{/itf/bookmark/disable={#1}}} +\define@key{BKM}{disable*}[true]{\itf@pgfkeys\pgfkeysalso{/itf/bookmark/disable*={#1}}} +\define@key{BKM}{bold*}[true]{\itf@pgfkeys\pgfkeysalso{/itf/bookmark/bold*={#1}}} +\define@key{BKM}{italic*}[true]{\itf@pgfkeys\pgfkeysalso{/itf/bookmark/italic*={#1}}} +\define@key{BKM}{color*}[]{\itf@pgfkeys\pgfkeysalso{/itf/bookmark/color*={#1}}} +\define@key{BKM}{atend}[true]{\itf@pgfkeys\pgfkeysalso{/itf/bookmark/atend={#1}}}% +% \end{macrocode} +% +% \begin{macro}{\itf@BKM@write} +% \begin{enumerate}[label=\arabic*),topsep=0pt,parsep=0pt,itemsep=0pt] +% \item check if the bookmark is disable +% \item restore previous values in case starred\stform* keys have been set. +% \end{enumerate} +% \begin{macrocode} +\def\itf@BKM@write#1{% + \aftergroup\itf@BKM@restore + \ifcase\itf@BKM@enable + \global\let\itf@BKM@enable\@ne + \or + \immediate\write\@mainaux{#1}% + \else + \ifcase -\itf@BKM@enable % (case -0 = 0 tested before) + \or % (case -1 = enable but At End) + \let\itf@BKM@enable\@ne + \edef\itf@tp{\immediate\write\@mainaux{#1}}% + \expandafter\BookmarkAtEnd\expandafter{\itf@tp}% + \fi + \fi +}% \itf@BKM@write +% \end{macrocode} +% \end{macro} +% +% \subsubsection{\texttt{ref} and \texttt{pageref} keys} +% +% \begin{macro}{\itf@BKM@pageref} +% \begin{macrocode} +%% pageref= key for \bookmark (using refcount : \getpagerefnumber) +\def\itf@BKM@pageref[#1]{% + \expandafter\itf@BKM@@pageref + \csname r@#1\endcsname{#1}% +}% \itf@BKM@pageref +\def\itf@BKM@@pageref#1#2{% + \ifx#1\relax + \protect\G@refundefinedtrue + \@latex@warning{% + Hyper reference `#2' on page \thepage \space undefined + \MessageBreak for bookmark destination page + }% + \fi + \edef\BKM@page{\getrefbykeydefault{#2}{page}{1}}% +}% \itf@BKM@@pageref +\define@key{BKM}{pageref}{% + \Hy@babelnormalise\itf@BKM@pageref[{#1}]} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@BKM@ref} +% \begin{macrocode} +%% ref= key for \bookmark +\def\itf@BKM@ref[#1]{% + \expandafter\itf@BKM@@ref + \csname r@#1\endcsname{#1}% +}% \itf@BKM@ref +\def\itf@BKM@@ref#1#2{% + \ifx#1\relax + \protect\G@refundefinedtrue + \@latex@warning{% + Hyper reference `#2' on page \thepage \space undefined + \MessageBreak for bookmark destination + }% + \def\BKM@dest{??}% + \else + \edef\BKM@dest{\expandafter\@fourthoffive#1\@empty\@empty}% + \fi +}% \BKM@@ref +\define@key{BKM}{ref}{% + \Hy@babelnormalise\itf@BKM@ref[{#1}]} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% +% \Subsection[hypbmsec] +% +% \subsubsection{interfaces-hypbmsec} +% +% \begin{macrocode} +%<*hypbmsec> +\ProvidesPackage{interfaces-hypbmsec} + [2011/02/19 v3.1 lastsection,title,anchor, etc. (FC)] +\RequirePackage{interfaces-base} +\RequirePackage{gettitlestring} +\itf@Check@Package{hypbmsec} +% \end{macrocode} +% +% \begin{macro}{\hbs@do (patch)} +% \patchlabel[redef]{hbs@do} +% \begin{macrocode} +\def\itf@hbs@do#1{% + \xdef\itf@hbs@currentname{\expandafter\itf@strip@at\string#1}% + \let\hbs@tocstring\relax % + \let\hbs@bmstring\relax % + \@ifstar + {\itf@hbs@ssect#1}% + {\let\hbs@seccmd=#1\hbs@checkarg}% +}% \itf@hbs@do +\let\hbs@do\itf@hbs@do +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\hbs@process (patch)} +% \patchlabel[prepend]{hbs@process} +% \begin{macrocode} +\itf@patch\pretocmd\hbs@process{% + \itf@hbs@process{#1}% + }% + {\@PackageInfoNoLine{interfaces-hypbmsec} + {\string\hbs@process\space successfully patched}} + {\@PackageWarningNoLine{interfaces-hypbmsec} + {Command \string\hbs@process\space could not be patched + \MessageBreak loading of `interfaces-hypbmsec` aborted + \MessageBreak \string\lastsection\space will not work}% + \endinput}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@hbs@ssect} +% +% For starred sections: +% +% \begin{macrocode} +\long\def\itf@hbs@ssect#1#2{% starred section + \itf@Not@titlesec#1 + {\expandafter\itf@hbs@last@starred\expandafter{\itf@hbs@currentname}{#2}} + {\let\itf@hbs@last\itf@hbs@last@starred@ttl}% + #1*{#2}% +}% \itf@hbs@ssect +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@hbs@process} +% +% For non-starred sections: +% +% \begin{macrocode} +\long\def\itf@hbs@process#1{% not starred + \itf@Not@titlesec \hbs@seccmd + {% + \ifdefined\hyper@anchor + \expandafter\itf@hbs@last@nostar@nottl@Hy\expandafter{\itf@hbs@currentname}{#1}% + \else + \expandafter\itf@hbs@last@nostar@nottl\expandafter{\itf@hbs@currentname}{#1}% + \fi + }% + {\let\itf@hbs@last \itf@hbs@last@nostar@ttl}% +}% \itf@hbs@process +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@hbs@last@starred} +% +% Update the values of \cs{lastsectiontitle} \etc. for starred sections: +% +% \begin{macrocode} +\long\def\itf@hbs@last@starred#1#2{% + \GetTitleString{#2}\let\itf@hbs@currenttitle\GetTitleStringResult + \begingroup + \let\@elt \itf@resetlastsections + \globaldefs \@ne + \expandafter\let\csname last#1title\endcsname\itf@hbs@currenttitle + \expandafter\let\csname last#1toc\endcsname\@empty + \expandafter\let\csname last#1bookmark\endcsname\@empty + \expandafter\let\csname last#1anchor\endcsname\relax + \let\lastsectionname \itf@hbs@currentname + \csname cl@#1\endcsname + \endgroup +}% \itf@hbs@last@starred +\def\itf@hbs@last@starred@ttl{% + \global\let\itf@hbs@last \@empty + \expandafter\itf@hbs@last@starred + \expandafter\itf@hbs@currentname \expandafter{\ttl@savetitle}% +}% \itf@hbs@last@starred@ttl +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@hbs@last@nostar} +% \begin{macro}{\itf@hbs@last@nostar@ttl} +% \begin{macro}{\itf@hbs@last@nostar@nottl} +% \begin{macro}{\itf@hbs@last@nostar@nottl@Hy} +% +% Update de values of \cs{lastsectiontitle} \etc. for non-starred sections: +% +% \begin{macrocode} +\long\def\itf@hbs@last@nostar#1#2{% + \GetTitleString{#2}\let\itf@hbs@currenttitle\GetTitleStringResult + \begingroup + \let\@elt \itf@resetlastsections + \globaldefs \@ne + \expandafter\let\csname last#1title\endcsname\itf@hbs@currenttitle + \expandafter\let\csname last#1toc\expandafter\endcsname + \csname \ifx\hbs@tocstring\relax + itf@hbs@currenttitle\else hbs@tocstring\fi \endcsname + \expandafter\let\csname last#1bookmark\expandafter\endcsname + \csname \ifx\hbs@bmstring\relax + last#1toc\else hbs@bmstring\fi \endcsname + \expandafter\let\csname last#1anchor\endcsname\HyperLocalCurrentHref + \let\lastsectionname \itf@hbs@currentname + \csname cl@#1\endcsname + \endgroup +}% \itf@hbs@last@starred +\def\itf@hbs@last@nostar@ttl{% + \global\let\itf@hbs@last \@empty + \expandafter\itf@hbs@last@nostar + \expandafter\itf@hbs@currentname \expandafter{\ttl@savetitle}% +}% \itf@hbs@last@nostar@ttl +\long\def\itf@hbs@last@nostar@nottl#1#2{% + \expandafter\let\expandafter\itf@hbs@cl@ORI\csname cl@#1\endcsname + \expandafter\def\csname cl@#1\endcsname{% + \expandafter\let\csname cl@#1\endcsname\itf@hbs@cl@ORI + \itf@hbs@cl@ORI + \itf@hbs@last@nostar {#1}{#2}}% +}% \itf@hbs@last@nostar@nottl +\long\def\itf@hbs@last@nostar@nottl@Hy#1#2{% + \begingroup + \toks@\expandafter{% + \expandafter\def\expandafter\hyper@anchorend + \expandafter{\hyper@anchorend}% + \itf@hbs@last@nostar{#1}{#2}}% + \edef\x{\endgroup + \def\noexpand\hyper@anchorend{\the\toks@}% + }\x +}% \itf@hbs@last@nostar@nottl@Hy +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\itf@Not@titlesec} +% +% Expands to \cs{@firstoftwo} if the section is not formatted by a class of \xpackage{titlesec} package. +% Otherwise (\xpackage{titlesec} formats the given section): expands to \cs{@secondoftwo}. +% +% \begin{macrocode} +\def\itf@Not@titlesec#1{\@firstoftwo} +\AfterPackage*{titlesec}{% +\def\itf@Not@titlesec#1{\begingroup + \@onelevel@sanitize#1% + \edef\@tempa{\noexpand\in@ + {\noexpand\@nil \string\ttl@} + {\noexpand\@nil #1}% + }\@tempa + \expandafter\endgroup + \ifin@ \expandafter\@secondoftwo + \else \expandafter\@firstoftwo + \fi +}% \itf@Not@titlesec +}% AfterPackage titlesec +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\ttl@finmarks} +% +% When \xpackage{titlesec} is used, assignments to \cs{lastsectiontitle}, \cs{lastsubsectiontoc} \etc. +% are done at this point. +% +% \begin{macrocode} +\AfterPackage*{titlesec}{% +\expandafter\def\expandafter\ttl@finmarks\expandafter{% + \expandafter\itf@hbs@last \ttl@finmarks}% +\let\itf@hbs@last \@empty +}% AfterPackage +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@resetlastsections} +% +% Assignments are global (\cs{globaldefs}$ =1$). +% +% \begin{macrocode} +\def\itf@resetlastsections#1{% + \expandafter\let\csname last#1title\endcsname\relax + \expandafter\let\csname last#1toc\endcsname\relax + \expandafter\let\csname last#1bookmark\endcsname\relax + \expandafter\let\csname last#1anchor\endcsname\relax + \csname cl@#1\endcsname +}% \itf@resetlastsections +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\let\lastsectionname\relax +\@for\itf@tp:=part,section,subsection,subsubsection,paragraph,subparagraph% + \do{\expandafter\let\csname last\itf@tp title\endcsname\relax + \expandafter\let\csname last\itf@tp toc\endcsname\relax + \expandafter\let\csname last\itf@tp bookmark\endcsname\relax + \expandafter\let\csname last\itf@tp anchor\endcsname\relax + }% +\AtBeginDocument{\ifundef\chapter{} + {\let\lastchaptertitle\relax + \let\lastchaptertoc\relax + \let\lastchapterbookmark\relax + \let\lastchapteranchor\relax}% +}% +% \end{macrocode} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Subsection[fancyhdr] +% +% \begin{macrocode} +%<*fancyhdr> +\ProvidesPackage{interfaces-fancyhdr} + [2011/02/19 v3.1 pgfkeys macros for fancyhdr (FC)] +\RequirePackage{interfaces-base} +\itf@Check@Package{fancyhdr} +\robustify\fancyhf +\robustify\fancyhfoffset +% \end{macrocode} +% +% \subsubsection{\cs{pagesetup}} +% +% \begin{macro}{\pagesetup} +% \begin{macrocode} +\newrobustcmd*\pagesetup{% + \let\fancy@gbl\relax % Just in case... + \@ifstar + {\itf@pagesetup{}} + {\itf@pagesetup{reset,}}% +}% \pagesetup +\def\itf@pagesetup#1{\@testopt + {\itf@p@gesetup{#1}}{}% +}% \itf@pagesetup +\def\itf@p@gesetup#1[#2]#3{\ifblank{#2} + {% modifies the current page style + \itf@pgfkeys\pgfqkeys{/itf/fancyhdr}{#1#3}\relax\ps@@fancy}% + {% defines or modifies a given page style + \ifblank{#1} + \csappto% star form: keep existing value (if not overwritten) + \csdef% no star form: overwrite (+ reset at \pagestyle time) + {ps@#2}{\itf@pgfkeys\pgfqkeys{/itf/fancyhdr}{#1#3}\relax\ps@@fancy}% + }% +}% \itf@p@gesetup +\pgfqkeys{/itf/pagesetup}{% + @current/.is private=interfaces-fancyhdr,% + @style/.is private=interfaces-fancyhdr,% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pagestyle} +% \begin{macrocode} +\renewrobustcmd*\pagestyle[1]{\ifcsundef{ps@#1} + {\itf@undefinedpagestyle{#1}} + {\csname ps@#1\endcsname}% +}% \pagestyle +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\thispagestyle} +% \begin{macrocode} +\renewrobustcmd*\thispagestyle[1]{\ifcsundef{ps@#1} + {\itf@undefinedpagestyle{#1}} + {\global\@specialpagetrue\gdef\@specialstyle{#1}}% +}% \thispagestyle +\newcommand*\itf@undefinedpagestyle[1]{% + \@latex@error{Undefined page style: #1 + \MessageBreak your command will be ignored}\@eha +}% \itf@undefinedpagestyle +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Keys for \cs{pagesetup}} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.fancy@hf/.code=% + \edef\itf@tp{\pgfkeyscurrentpath}% + \pgfkeysalso{\pgfkeyscurrentpath/.store as code}% + \pgfkeysalso{\pgfkeyscurrentpath/.append code/.expanded=% + \csdef{f@ncy#1}{% + \noexpand\pgfkeysvalueof{\itf@tp/font} + \noexpand\pgfkeysvalueof{\itf@tp}\noexpand\strut}},% +}% handler for fancyhdr interface +\pgfqkeys{/itf/fancyhdr}{% keys for \pagesetup + code/.code={#1},% execution at expansion of \ps@... => \pgfqkeys{...,code={...},...} + pagestyle/.style={code=\pagestyle{#1}},% + page style/.alias=pagestyle,% + load style/.alias=pagestyle,% + head/rule/.store as dimen in cs=headrulewidth,% + head/rule/.default=.4pt,% + head/rule/.blank=\z@,% + head/rulewidth/.alias*=head/rule,% + headrulewidth/.alias*=head/rule,% + head/rule/width/.alias*=head/rule,% + head/rule/font/.store as code,% + head/rule/color/.style={head/rule/font+=\color{#1}},% + headruler/.code=% + \let\headrule\pgfkeyscurrentvalue + \ifx\headrule\@empty\else + \preto\headrule{\bgroup\pgfkeysvalueof{/itf/fancyhdr/head/rule/font}}% + \appto\headrule{\egroup}% + \fi,% + headruler/.default=% + \if@fancyplain\let\headrulewidth\plainheadrulewidth\fi + \hrule\@height\headrulewidth \@width\headwidth + \vskip-\headrulewidth\relax,% + headrule/.alias=headruler,% + headrule,% sets default + foot/rule/.store as dimen in cs=footrulewidth,% + foot/rule/.default=.4pt,% + foot/rule/.blank=\z@,% + foot/rulewidth/.alias*=foot/rule,% + footrulewidth/.alias*=foot/rule,% + foot/rule/width/.alias*=foot/rule,% + foot/rule/font/.store as code,% + foot/rule/color/.style={foot/rule/font+=\color{#1}},% + footruler/.code=% + \let\footrule\pgfkeyscurrentvalue + \ifx\footrule\@empty\else + \preto\footrule{\bgroup\pgfkeysvalueof{/itf/fancyhdr/head/rule/font}}% + \appto\footrule{\egroup} + \fi,% + footruler/.default=% + \if@fancyplain\let\footrulewidth\plainfootrulewidth\fi + \vskip-2\footrulewidth + \hrule\@height\footrulewidth \@width\headwidth\vskip\footrulewidth,% + footrule/.alias=footruler,% + footrule,% sets default + rule/.style={head/rule={#1},foot/rule={#1}},% + rule+/.style={head/rule+={#1},foot/rule+={#1}},% + rule-/.style={head/rule-={#1},foot/rule-={#1}},% + rule*/.style={head/rule*={#1},foot/rule*={#1}},% + rules/.alias*=rule,rulewidth/.alias*=rule,% + rule/width/.alias*=rule,rules/width/.alias*=rule,% + norule/.style={rule=\z@},% + norule/.value forbidden,% + norules/.alias=norule,% + rule/font/.style={head/rule/font={#1},foot/rule/font={#1}},% + rule/font+/.style={head/rule/font+={#1},foot/rule/font+={#1}},% + rule/font*/.alias=rule/font+,% + rules/font/.alias=rule/font, + rules/font+/.alias=rule/font+,% + rules/font*/.alias=rule/font+,% + rule/color/.style={head/rule/color={#1},foot/rule/color={#1}},% + rules/color/.alias=rule/color,% + foot/rule/skip/.estore as glue in cs=footruleskip,% + foot/rule/skip/.default=.3\normalbaselineskip,% + foot/rule/skip/.blank=\z@,% + foot/ruleskip/.alias*=foot/rule/skip,% + footruleskip/.alias*=foot/rule/skip,% + font/.style={head/font={#1},foot/font={#1}},% + font+/.style={head/font+={#1},foot/font+={#1}},% + font*/.alias=font+,% + color/.style={head/color={#1},foot/color={#1},% + head/rule/color={#1},foot/rule/color={#1}},% + head/.style={head/left={#1},head/center={#1},head/right={#1}},% + head+/.style={head/left+={#1},head/center+={#1},head/right+={#1}}, + head*/.alias=head+,% + head/font/.style={head/left/font={#1},head/center/font={#1},head/right/font={#1}},% + head/font+/.style={head/left/font+={#1},head/center/font+={#1},head/right/font+={#1}},% + head/font*/.alias=head/font+,% + head/color/.style={head/left/color={#1},head/center/color={#1},head/right/color={#1},% + head/rule/color={#1}},% + nohead/.style={head=,head/font=,head/rule=,head/rule/font=}, + foot/.style={foot/left={#1},foot/center={#1},foot/right={#1}},% + foot+/.style={foot/left+={#1},foot/center+={#1},foot/right+={#1}}, + foot*/.alias=foot+,% + foot/font/.style={foot/left/font={#1},foot/center/font={#1},foot/right/font={#1}},% + foot/font+/.style={foot/left/font+={#1},foot/center/font+={#1},foot/right/font+={#1}},% + foot/font*/.alias=foot/font+,% + foot/color/.style={foot/left/color={#1},foot/center/color={#1},foot/right/color={#1},% + foot/rule/color={#1}},% + nofoot/.style={foot=,foot/font=,foot/rule=,foot/rule/font=}, + left/.style={head/left={#1},foot/left={#1}},% + left+/.style={head/left+={#1},foot/left+={#1}},% + left*/.alias=left+,% + left/font/.style={head/left/font={#1},foot/left/font={#1}},% + left/font+/.style={head/left/font+={#1},foot/left/font+={#1}},% + left/font*/.alias=left/font+,% + left/color/.style={head/left/color={#1},foot/left/color={#1}},% + center/.style={head/center={#1},foot/center={#1}},% + center+/.style={head/center+={#1},foot/center+={#1}},% + center*/.alias=center+,% + center/font/.style={head/center/font={#1},foot/center/font={#1}},% + center/font+/.style={head/center/font+={#1},foot/center/font+={#1}},% + center/font*/.alias=center/font+,% + center/color/.style={head/center/color={#1},foot/center/color={#1}},% + right/.style={head/right={#1},foot/right={#1}},% + right+/.style={head/right+={#1},foot/right+={#1}},% + right*/.alias=right+,% + right/font/.style={head/right/font={#1},foot/right/font={#1}},% + right/font+/.style={head/right/font+={#1},foot/right/font+={#1}},% + right/font*/.alias=right/font+,% + right/color/.style={head/right/color={#1},foot/right/color={#1}},% + head/left/.style={head/left/even={#1},head/left/odd={#1}},% + head/left+/.style={head/left/even+={#1},head/left/odd+={#1}},% + head/left*/.alias=head/left+,% + head/left/font/.style={head/left/even/font={#1},head/left/odd/font={#1}},% + head/left/font+/.style={head/left/even/font+={#1},head/left/odd/font+={#1}},% + head/left/font*/.alias=head/left/font+,% + head/left/color/.style={head/left/even/color={#1},head/left/odd/color={#1}},% + left/head/.alias*=head/left,% + left/head/font/.alias*=head/left/font,% + left/head/color/.alias=head/left/color,% + head/center/.style={head/center/even={#1},head/center/odd={#1}},% + head/center+/.style={head/center/even+={#1},head/center/odd+={#1}},% + head/center*/.alias=head/center+,% + head/center/font/.style={head/center/even/font={#1},head/center/odd/font={#1}},% + head/center/font+/.style={head/center/even/font+={#1},head/center/odd/font+={#1}},% + head/center/font*/.alias=head/center/font+,% + head/center/color/.style={head/center/even/color={#1},head/center/odd/color={#1}},% + center/head/.alias*=head/center,% + center/head/font/.alias*=head/center/font,% + center/head/color/.alias=head/center/color,% + head/right/.style={head/right/even={#1},head/right/odd={#1}},% + head/right+/.style={head/right/even+={#1},head/right/odd+={#1}},% + head/right*/.alias=head/right+,% + head/right/font/.style={head/right/even/font={#1},head/right/odd/font={#1}},% + head/right/font+/.style={head/right/even/font+={#1},head/right/odd/font+={#1}},% + head/right/font*/.alias=head/right/font+,% + head/right/color/.style={head/right/even/color={#1},head/right/odd/color={#1}},% + right/head/.alias*=head/right,% + right/head/font/.alias*=head/right/font,% + right/head/color/.alias=head/right/color,% + foot/left/.style={foot/left/even={#1},foot/left/odd={#1}},% + foot/left+/.style={foot/left/even+={#1},foot/left/odd+={#1}},% + foot/left*/.alias=foot/left+,% + foot/left/font/.style={foot/left/even/font={#1},foot/left/odd/font={#1}},% + foot/left/font+/.style={foot/left/even/font+={#1},foot/left/odd/font+={#1}},% + foot/left/font*/.alias=foot/left/font+,% + foot/left/color/.style={foot/left/even/color={#1},foot/left/odd/color={#1}},% + left/foot/.alias*=foot/left,% + left/foot/font/.alias*=foot/left/font,% + left/foot/color/.alias=foot/left/color,% + foot/center/.style={foot/center/even={#1},foot/center/odd={#1}},% + foot/center+/.style={foot/center/even+={#1},foot/center/odd+={#1}},% + foot/center*/.alias=foot/center,% + foot/center/font/.style={foot/center/even/font={#1},foot/center/odd/font={#1}},% + foot/center/font+/.style={foot/center/even/font+={#1},foot/center/odd/font+={#1}},% + foot/center/font*/.alias=foot/center/font+,% + foot/center/color/.style={foot/center/even/color={#1},foot/center/odd/color={#1}},% + center/foot/.alias*=foot/center,% + center/foot/font/.alias*=foot/center/font,% + center/foot/color/.alias=foot/center/color,% + foot/right/.style={foot/right/even={#1},foot/right/odd={#1}},% + foot/right+/.style={foot/right/even+={#1},foot/right/odd+={#1}},% + foot/right*/.alias=foot/right+,% + foot/right/font/.style={foot/right/even/font={#1},foot/right/odd/font={#1}},% + foot/right/font+/.style={foot/right/even/font+={#1},foot/right/odd/font+={#1}},% + foot/right/font*/.alias=foot/right/font+,% + foot/right/color/.style={foot/right/even/color={#1},foot/right/odd/color={#1}},% + right/foot/.alias*=foot/right,% + right/foot/font/.alias*=foot/right/font,% + right/foot/color/.alias=foot/right/color,% + head/left/odd/.fancy@hf=olh,% + head/left/odd/font/.store as code,% + head/left/odd/color/.style={head/left/odd/font+=\color{#1}},% + head/odd/left/.alias*=head/left/odd,% + odd/head/left/.alias*=head/left/odd,% + odd/left/head/.alias*=head/left/odd,% + left/odd/head/.alias*=head/left/odd,% + left/head/odd/.alias*=head/left/odd,% + head/odd/left/font/.alias*=head/left/odd/font,% + odd/head/left/font/.alias*=head/left/odd/font,% + odd/left/head/font/.alias*=head/left/odd/font,% + left/odd/head/font/.alias*=head/left/odd/font,% + left/head/odd/font/.alias*=head/left/odd/font,% + head/odd/left/color/.alias=head/left/odd/color,% + odd/head/left/color/.alias=head/left/odd/color,% + odd/left/head/color/.alias=head/left/odd/color,% + left/odd/head/color/.alias=head/left/odd/color,% + left/head/odd/color/.alias=head/left/odd/color,% + head/center/odd/.fancy@hf=och,% + head/center/odd/font/.store as code,% + head/center/odd/color/.style={head/center/odd/font+=\color{#1}},% + head/odd/center/.alias*=head/center/odd,% + odd/head/center/.alias*=head/center/odd,% + odd/center/head/.alias*=head/center/odd,% + center/odd/head/.alias*=head/center/odd,% + center/head/odd/.alias*=head/center/odd,% + head/odd/center/font/.alias*=head/center/odd/font,% + odd/head/center/font/.alias*=head/center/odd/font,% + odd/center/head/font/.alias*=head/center/odd/font,% + center/odd/head/font/.alias*=head/center/odd/font,% + center/head/odd/font/.alias*=head/center/odd/font,% + head/odd/center/color/.alias=head/center/odd/color,% + odd/head/center/color/.alias=head/center/odd/color,% + odd/center/head/color/.alias=head/center/odd/color,% + center/odd/head/color/.alias=head/center/odd/color,% + center/head/odd/color/.alias=head/center/odd/color,% + head/right/odd/.fancy@hf=orh,% + head/right/odd/font/.store as code,% + head/right/odd/color/.style={head/right/odd/font+=\color{#1}},% + head/odd/right/.alias*=head/right/odd,% + odd/head/right/.alias*=head/right/odd,% + odd/right/head/.alias*=head/right/odd,% + right/odd/head/.alias*=head/right/odd,% + right/head/odd/.alias*=head/right/odd,% + head/odd/right/font/.alias*=head/right/odd/font,% + odd/head/right/font/.alias*=head/right/odd/font,% + odd/right/head/font/.alias*=head/right/odd/font,% + right/odd/head/font/.alias*=head/right/odd/font,% + right/head/odd/font/.alias*=head/right/odd/font,% + head/odd/right/color/.alias=head/right/odd/color,% + odd/head/right/color/.alias=head/right/odd/color,% + odd/right/head/color/.alias=head/right/odd/color,% + right/odd/head/color/.alias=head/right/odd/color,% + right/head/odd/color/.alias=head/right/odd/color,% + head/left/even/.fancy@hf=elh,% + head/left/even/font/.store as code,% + head/left/even/color/.style={head/left/even/font+=\color{#1}},% + head/even/left/.alias*=head/left/even,% + even/head/left/.alias*=head/left/even,% + even/left/head/.alias*=head/left/even,% + left/even/head/.alias*=head/left/even,% + left/head/even/.alias*=head/left/even,% + head/even/left/font/.alias*=head/left/even/font,% + even/head/left/font/.alias*=head/left/even/font,% + even/left/head/font/.alias*=head/left/even/font,% + left/even/head/font/.alias*=head/left/even/font,% + left/head/even/font/.alias*=head/left/even/font,% + head/even/left/color/.alias=head/left/even/color,% + even/head/left/color/.alias=head/left/even/color,% + even/left/head/color/.alias=head/left/even/color,% + left/even/head/color/.alias=head/left/even/color,% + left/head/even/color/.alias=head/left/even/color,% + head/center/even/.fancy@hf=ech,% + head/center/even/font/.store as code,% + head/center/even/color/.style={head/center/even/font+=\color{#1}},% + head/even/center/.alias*=head/center/even,% + even/head/center/.alias*=head/center/even,% + even/center/head/.alias*=head/center/even,% + center/even/head/.alias*=head/center/even,% + center/head/even/.alias*=head/center/even,% + head/even/center/font/.alias*=head/center/even/font,% + even/head/center/font/.alias*=head/center/even/font,% + even/center/head/font/.alias*=head/center/even/font,% + center/even/head/font/.alias*=head/center/even/font,% + center/head/even/font/.alias*=head/center/even/font,% + head/even/center/color/.alias=head/center/even/color,% + even/head/center/color/.alias=head/center/even/color,% + even/center/head/color/.alias=head/center/even/color,% + center/even/head/color/.alias=head/center/even/color,% + center/head/even/color/.alias=head/center/even/color,% + head/right/even/.fancy@hf=erh,% + head/right/even/font/.store as code,% + head/right/even/color/.style={head/right/even/font+=\color{#1}},% + head/even/right/.alias*=head/right/even,% + even/head/right/.alias*=head/right/even,% + even/right/head/.alias*=head/right/even,% + right/even/head/.alias*=head/right/even,% + right/head/even/.alias*=head/right/even,% + head/even/right/font/.alias*=head/right/even/font,% + even/head/right/font/.alias*=head/right/even/font,% + even/right/head/font/.alias*=head/right/even/font,% + right/even/head/font/.alias*=head/right/even/font,% + right/head/even/font/.alias*=head/right/even/font,% + head/even/right/color/.alias=head/right/even/color,% + even/head/right/color/.alias=head/right/even/color,% + even/right/head/color/.alias=head/right/even/color,% + right/even/head/color/.alias=head/right/even/color,% + right/head/even/color/.alias=head/right/even/color,% + foot/left/odd/.fancy@hf=olf,% + foot/left/odd/font/.store as code,% + foot/left/odd/color/.style={foot/left/odd/font+=\color{#1}},% + foot/odd/left/.alias*=foot/left/odd,% + odd/foot/left/.alias*=foot/left/odd,% + odd/left/foot/.alias*=foot/left/odd,% + left/odd/foot/.alias*=foot/left/odd,% + left/foot/odd/.alias*=foot/left/odd,% + foot/odd/left/font/.alias*=foot/left/odd/font,% + odd/foot/left/font/.alias*=foot/left/odd/font,% + odd/left/foot/font/.alias*=foot/left/odd/font,% + left/odd/foot/font/.alias*=foot/left/odd/font,% + left/foot/odd/font/.alias*=foot/left/odd/font,% + foot/odd/left/color/.alias=foot/left/odd/color,% + odd/foot/left/color/.alias=foot/left/odd/color,% + odd/left/foot/color/.alias=foot/left/odd/color,% + left/odd/foot/color/.alias=foot/left/odd/color,% + left/foot/odd/color/.alias=foot/left/odd/color,% + foot/center/odd/.fancy@hf=ocf,% + foot/center/odd/font/.store as code,% + foot/center/odd/color/.style={foot/center/odd/font+=\color{#1}},% + foot/odd/center/.alias*=foot/center/odd,% + odd/foot/center/.alias*=foot/center/odd,% + odd/center/foot/.alias*=foot/center/odd,% + center/odd/foot/.alias*=foot/center/odd,% + center/foot/odd/.alias*=foot/center/odd,% + foot/odd/center/font/.alias*=foot/center/odd/font,% + odd/foot/center/font/.alias*=foot/center/odd/font,% + odd/center/foot/font/.alias*=foot/center/odd/font,% + center/odd/foot/font/.alias*=foot/center/odd/font,% + center/foot/odd/font/.alias*=foot/center/odd/font,% + foot/odd/center/color/.alias=foot/center/odd/color,% + odd/foot/center/color/.alias=foot/center/odd/color,% + odd/center/foot/color/.alias=foot/center/odd/color,% + center/odd/foot/color/.alias=foot/center/odd/color,% + center/foot/odd/color/.alias=foot/center/odd/color,% + foot/right/odd/.fancy@hf=orf,% + foot/right/odd/font/.store as code,% + foot/right/odd/color/.style={foot/right/odd/font+=\color{#1}},% + foot/odd/right/.alias*=foot/right/odd,% + odd/foot/right/.alias*=foot/right/odd,% + odd/right/foot/.alias*=foot/right/odd,% + right/odd/foot/.alias*=foot/right/odd,% + right/foot/odd/.alias*=foot/right/odd,% + foot/odd/right/font/.alias*=foot/right/odd/font,% + odd/foot/right/font/.alias*=foot/right/odd/font,% + odd/right/foot/font/.alias*=foot/right/odd/font,% + right/odd/foot/font/.alias*=foot/right/odd/font,% + right/foot/odd/font/.alias*=foot/right/odd/font,% + foot/odd/right/color/.alias=foot/right/odd/color,% + odd/foot/right/color/.alias=foot/right/odd/color,% + odd/right/foot/color/.alias=foot/right/odd/color,% + right/odd/foot/color/.alias=foot/right/odd/color,% + right/foot/odd/color/.alias=foot/right/odd/color,% + foot/left/even/.fancy@hf=elf,% + foot/left/even/font/.store as code,% + foot/left/even/color/.style={foot/left/even/font+=\color{#1}},% + foot/even/left/.alias*=foot/left/even,% + even/foot/left/.alias*=foot/left/even,% + even/left/foot/.alias*=foot/left/even,% + left/even/foot/.alias*=foot/left/even,% + left/foot/even/.alias*=foot/left/even,% + foot/even/left/font/.alias*=foot/left/even/font,% + even/foot/left/font/.alias*=foot/left/even/font,% + even/left/foot/font/.alias*=foot/left/even/font,% + left/even/foot/font/.alias*=foot/left/even/font,% + left/foot/even/font/.alias*=foot/left/even/font,% + foot/even/left/color/.alias=foot/left/even/color,% + even/foot/left/color/.alias=foot/left/even/color,% + even/left/foot/color/.alias=foot/left/even/color,% + left/even/foot/color/.alias=foot/left/even/color,% + left/foot/even/color/.alias=foot/left/even/color,% + foot/center/even/.fancy@hf=ecf,% + foot/center/even/font/.store as code,% + foot/center/even/color/.style={foot/center/even/font+=\color{#1}},% + foot/even/center/.alias*=foot/center/even,% + even/foot/center/.alias*=foot/center/even,% + even/center/foot/.alias*=foot/center/even,% + center/even/foot/.alias*=foot/center/even,% + center/foot/even/.alias*=foot/center/even,% + foot/even/center/font/.alias*=foot/center/even/font,% + even/foot/center/font/.alias*=foot/center/even/font,% + even/center/foot/font/.alias*=foot/center/even/font,% + center/even/foot/font/.alias*=foot/center/even/font,% + center/foot/even/font/.alias*=foot/center/even/font,% + foot/even/center/color/.alias=foot/center/even/color,% + even/foot/center/color/.alias=foot/center/even/color,% + even/center/foot/color/.alias=foot/center/even/color,% + center/even/foot/color/.alias=foot/center/even/color,% + center/foot/even/color/.alias=foot/center/even/color,% + foot/right/even/.fancy@hf=erf,% + foot/right/even/font/.store as code,% + foot/right/even/color/.style={foot/right/even/font+=\color{#1}},% + foot/even/right/.alias*=foot/right/even,% + even/foot/right/.alias*=foot/right/even,% + even/right/foot/.alias*=foot/right/even,% + right/even/foot/.alias*=foot/right/even,% + right/foot/even/.alias*=foot/right/even,% + foot/even/right/font/.alias*=foot/right/even/font,% + even/foot/right/font/.alias*=foot/right/even/font,% + even/right/foot/font/.alias*=foot/right/even/font,% + right/even/foot/font/.alias*=foot/right/even/font,% + right/foot/even/font/.alias*=foot/right/even/font,% + foot/even/right/color/.alias=foot/right/even/color,% + even/foot/right/color/.alias=foot/right/even/color,% + even/right/foot/color/.alias=foot/right/even/color,% + right/even/foot/color/.alias=foot/right/even/color,% + right/foot/even/color/.alias=foot/right/even/color,% + foot/inner/.style={foot/right/even={#1},foot/left/odd={#1}},% + foot/inner+/.style={foot/right/even+={#1},foot/left/odd+={#1}},% + foot/inner*/.alias=foot/inner+,% + foot/inner/font/.style={foot/right/even/font={#1},foot/left/odd/font={#1}},% + foot/inner/color/.style={foot/right/even/color={#1},foot/left/odd/color={#1}},% + foot/inner/font+/.style={foot/right/even/font+={#1},foot/left/odd/font+={#1}},% + foot/inner/font*/.alias=foot/inner/font+,% + inner/foot/.alias*=foot/inner,% + inner/foot/font/.alias*=foot/inner/font,% + inner/foot/color/.alias=foot/inner/color,% + foot/outer/.style={foot/left/even={#1},foot/right/odd={#1}},% + foot/outer+/.style={foot/left/even+={#1},foot/right/odd+={#1}},% + foot/outer*/.alias=foot/outer+,% + foot/outer/font/.style={foot/left/even/font={#1},foot/right/odd/font={#1}},% + foot/outer/color/.style={foot/left/even/color={#1},foot/right/odd/color={#1}},% + foot/outer/font+/.style={foot/left/even/font+={#1},foot/right/odd/font+={#1}},% + foot/outer/font*/.alias=foot/outer/font+,% + outer/foot/.alias*=foot/outer,% + outer/foot/font/.alias*=foot/outer/font,% + outer/foot/color/.alias=foot/outer/color,% + head/inner/.style={head/right/even={#1},head/left/odd={#1}},% + head/inner+/.style={head/right/even+={#1},head/left/odd+={#1}},% + head/inner*/.alias=head/inner+,% + head/inner/font/.style={head/right/even/font={#1},head/left/odd/font={#1}},% + head/inner/color/.style={head/right/even/color={#1},head/left/odd/color={#1}},% + head/inner/font+/.style={head/right/even/font+={#1},head/left/odd/font+={#1}},% + head/inner/font*/.alias=head/inner/font+,% + inner/head/.alias*=head/inner,% + inner/head/font/.alias*=head/inner/font,% + inner/head/color/.alias=head/inner/color,% + head/outer/.style={head/left/even={#1},head/right/odd={#1}},% + head/outer+/.style={head/left/even+={#1},head/right/odd+={#1}},% + head/outer*/.alias=head/outer+,% + head/outer/font/.style={head/left/even/font={#1},head/right/odd/font={#1}},% + head/outer/color/.style={head/left/even/color={#1},head/right/odd/color={#1}},% + head/outer/font+/.style={head/left/even/font+={#1},head/right/odd/font+={#1}},% + head/outer/font*/.alias=head/outer/font+,% + outer/head/.alias*=head/outer,% + outer/head/font/.alias*=head/outer/font,% + outer/head/color/.alias=head/outer/color,% + inner/.style={foot/inner={#1},head/inner={#1}},% + inner+/.style={foot/inner+={#1},head/inner+={#1}},% + inner*/.alias=inner+,% + inner/font/.style={foot/inner/font={#1},head/inner/font={#1}},% + inner/font+/.style={foot/inner/font+={#1},head/inner/font+={#1}},% + inner/font*/.alias=inner/font+,% + inner/color/.style={foot/inner/color={#1},head/inner/color={#1}},% + outer/.style={foot/outer={#1},head/outer={#1}},% + outer+/.style={foot/outer+={#1},head/outer+={#1}},% + outer*/.alias=outer+,% + outer/font/.style={foot/outer/font={#1},head/outer/font={#1}},% + outer/font+/.style={foot/outer/font+={#1},head/outer/font+={#1}},% + outer/font*/.alias=outer/font+,% + outer/color/.style={foot/outer/color={#1},head/outer/color={#1}},% + offset/.style={head/offset={#1},foot/offset={#1}},% + offset+/.style={head/offset+={#1},foot/offset+={#1}},% + offset-/.style={head/offset-={#1},foot/offset-={#1}},% + offset*/.style={head/offset*={#1},foot/offset*={#1}},% + head/offset/.style={head/left/offset={#1},head/right/offset={#1}},% + head/offset+/.style={head/left/offset+={#1},head/right/offset+={#1}},% + head/offset-/.style={head/left/offset-={#1},head/right/offset-={#1}},% + head/offset*/.style={head/left/offset*={#1},head/right/offset*={#1}},% + offset/head/.alias*=head/offset,% + foot/offset/.style={foot/left/offset={#1},foot/right/offset={#1}},% + foot/offset+/.style={foot/left/offset+={#1},foot/right/offset+={#1}},% + foot/offset-/.style={foot/left/offset-={#1},foot/right/offset-={#1}},% + foot/offset*/.style={foot/left/offset*={#1},foot/right/offset*={#1}},% + offset/foot/.alias*=foot/offset,% + odd/offset/.style={left/odd/offset={#1},right/odd/offset={#1}},% + odd/offset+/.style={left/odd/offset+={#1},right/odd/offset+={#1}},% + odd/offset-/.style={left/odd/offset-={#1},right/odd/offset-={#1}},% + offset/odd/.alias*=odd/offset,% + even/offset/.style={left/even/offset={#1},right/even/offset={#1}},% + even/offset+/.style={left/even/offset+={#1},right/even/offset+={#1}},% + even/offset-/.style={left/even/offset-={#1},right/even/offset-={#1}},% + offset/even/.alias*=even/offset,% + left/offset/.style={foot/left/offset={#1},head/left/offset={#1}},% + left/offset+/.style={foot/left/offset+={#1},head/left/offset+={#1}},% + left/offset-/.style={foot/left/offset-={#1},head/left/offset-={#1}},% + left/offset*/.style={foot/left/offset*={#1},head/left/offset*={#1}},% + offset/left/.alias*=left/offset,% + left/even/offset/.style={foot/left/even/offset={#1},head/left/even/offset={#1}},% + left/even/offset+/.style={foot/left/even/offset+={#1},head/left/even/offset+={#1}},% + left/even/offset-/.style={foot/left/even/offset-={#1},head/left/even/offset-={#1}},% + left/even/offset*/.style={foot/left/even/offset*={#1},head/left/even/offset*={#1}},% + left/offset/even/.alias*=left/even/offset,% + even/left/offset/.alias*=left/even/offset,% + even/offset/left/.alias*=left/even/offset,% + offset/even/left/.alias*=left/even/offset,% + offset/left/even/.alias*=left/even/offset,% + left/odd/offset/.style={foot/left/odd/offset={#1},head/left/odd/offset={#1}},% + left/odd/offset+/.style={foot/left/odd/offset+={#1},head/left/odd/offset+={#1}},% + left/odd/offset-/.style={foot/left/odd/offset-={#1},head/left/odd/offset-={#1}},% + left/odd/offset*/.style={foot/left/odd/offset*={#1},head/left/odd/offset*={#1}},% + left/offset/odd/.alias*=left/odd/offset,% + odd/left/offset/.alias*=left/odd/offset,% + odd/offset/left/.alias*=left/odd/offset,% + offset/odd/left/.alias*=left/odd/offset,% + offset/left/odd/.alias*=left/odd/offset,% + right/offset/.style={foot/right/offset={#1},head/right/offset={#1}},% + right/offset+/.style={foot/right/offset+={#1},head/right/offset+={#1}},% + right/offset-/.style={foot/right/offset-={#1},head/right/offset-={#1}},% + right/offset*/.style={foot/right/offset*={#1},head/right/offset*={#1}},% + offset/right/.alias*=right/offset,% + right/even/offset/.style={foot/right/even/offset={#1},head/right/even/offset={#1}},% + right/even/offset+/.style={foot/right/even/offset+={#1},head/right/even/offset+={#1}},% + right/even/offset-/.style={foot/right/even/offset-={#1},head/right/even/offset-={#1}},% + right/even/offset*/.style={foot/right/even/offset*={#1},head/right/even/offset*={#1}},% + right/offset/even/.alias*=right/even/offset,% + even/right/offset/.alias*=right/even/offset,% + even/offset/right/.alias*=right/even/offset,% + offset/even/right/.alias*=right/even/offset,% + offset/right/even/.alias*=right/even/offset,% + right/odd/offset/.style={foot/right/odd/offset={#1},head/right/odd/offset={#1}},% + right/odd/offset+/.style={foot/right/odd/offset+={#1},head/right/odd/offset+={#1}},% + right/odd/offset-/.style={foot/right/odd/offset-={#1},head/right/odd/offset-={#1}},% + right/odd/offset*/.style={foot/right/odd/offset*={#1},head/right/odd/offset*={#1}},% + right/offset/odd/.alias*=right/odd/offset,% + odd/right/offset/.alias*=right/odd/offset,% + odd/offset/right/.alias*=right/odd/offset,% + offset/odd/right/.alias*=right/odd/offset,% + offset/right/odd/.alias*=right/odd/offset,% + head/left/offset/.style={head/left/even/offset={#1},head/left/odd/offset={#1}},% + head/left/offset+/.style={head/left/even/offset+={#1},head/left/odd/offset+={#1}},% + head/left/offset-/.style={head/left/even/offset-={#1},head/left/odd/offset-={#1}},% + head/left/offset*/.style={head/left/even/offset*={#1},head/left/odd/offset*={#1}},% + head/offset/left/.alias*=head/left/offset,% + left/head/offset/.alias*=head/left/offset,% + left/offset/head/.alias*=head/left/offset,% + offset/head/left/.alias*=head/left/offset,% + offset/left/head/.alias*=head/left/offset,% + head/right/offset/.style={head/right/even/offset={#1},head/right/odd/offset={#1}},% + head/right/offset+/.style={head/right/even/offset+={#1},head/right/odd/offset+={#1}},% + head/right/offset-/.style={head/right/even/offset-={#1},head/right/odd/offset-={#1}},% + head/right/offset*/.style={head/right/even/offset*={#1},head/right/odd/offset*={#1}},% + head/offset/right/.alias*=head/right/offset,% + right/head/offset/.alias*=head/right/offset,% + right/offset/head/.alias*=head/right/offset,% + offset/head/right/.alias*=head/right/offset,% + offset/right/head/.alias*=head/right/offset,% + foot/left/offset/.style={foot/left/even/offset={#1},foot/left/odd/offset={#1}},% + foot/left/offset+/.style={foot/left/even/offset+={#1},foot/left/odd/offset+={#1}},% + foot/left/offset-/.style={foot/left/even/offset-={#1},foot/left/odd/offset-={#1}},% + foot/left/offset*/.style={foot/left/even/offset*={#1},foot/left/odd/offset*={#1}},% + foot/offset/left/.alias*=foot/left/offset,% + left/foot/offset/.alias*=foot/left/offset,% + left/offset/foot/.alias*=foot/left/offset,% + offset/foot/left/.alias*=foot/left/offset,% + offset/left/foot/.alias*=foot/left/offset,% + foot/right/offset/.style={foot/right/even/offset={#1},foot/right/odd/offset={#1}},% + foot/right/offset+/.style={foot/right/even/offset+={#1},foot/right/odd/offset+={#1}},% + foot/right/offset-/.style={foot/right/even/offset-={#1},foot/right/odd/offset-={#1}},% + foot/right/offset*/.style={foot/right/even/offset*={#1},foot/right/odd/offset*={#1}},% + foot/offset/right/.alias*=foot/right/offset,% + right/foot/offset/.alias*=foot/right/offset,% + right/offset/foot/.alias*=foot/right/offset,% + offset/foot/right/.alias*=foot/right/offset,% + offset/right/foot/.alias*=foot/right/offset,% + head/left/even/offset/.store in skip cs=f@ncyO@elh,% + head/left/even/offset/.append code=\fancy@setoffs,% + head/even/offset/left/.alias*=head/left/even/offset,% + head/even/left/offset/.alias*=head/left/even/offset,% + head/offset/even/left/.alias*=head/left/even/offset,% + head/offset/left/even/.alias*=head/left/even/offset,% + head/left/offset/even/.alias*=head/left/even/offset,% + left/head/offset/even/.alias*=head/left/even/offset,% + left/head/even/offset/.alias*=head/left/even/offset,% + left/offset/head/even/.alias*=head/left/even/offset,% + left/offset/even/head/.alias*=head/left/even/offset,% + left/even/offset/head/.alias*=head/left/even/offset,% + left/even/head/offset/.alias*=head/left/even/offset,% + even/head/offset/left/.alias*=head/left/even/offset,% + even/head/left/offset/.alias*=head/left/even/offset,% + even/offset/head/left/.alias*=head/left/even/offset,% + even/offset/left/head/.alias*=head/left/even/offset,% + even/left/offset/head/.alias*=head/left/even/offset,% + even/left/head/offset/.alias*=head/left/even/offset,% + offset/head/left/even/.alias*=head/left/even/offset,% + offset/head/even/left/.alias*=head/left/even/offset,% + offset/left/head/even/.alias*=head/left/even/offset,% + offset/left/even/head/.alias*=head/left/even/offset,% + offset/even/left/head/.alias*=head/left/even/offset,% + offset/even/head/left/.alias*=head/left/even/offset,% + head/left/odd/offset/.store in skip cs=f@ncyO@olh,% + head/left/odd/offset/.append code=\fancy@setoffs,% + head/odd/offset/left/.alias*=head/left/odd/offset,% + head/odd/left/offset/.alias*=head/left/odd/offset,% + head/offset/odd/left/.alias*=head/left/odd/offset,% + head/offset/left/odd/.alias*=head/left/odd/offset,% + head/left/offset/odd/.alias*=head/left/odd/offset,% + left/head/offset/odd/.alias*=head/left/odd/offset,% + left/head/odd/offset/.alias*=head/left/odd/offset,% + left/offset/head/odd/.alias*=head/left/odd/offset,% + left/offset/odd/head/.alias*=head/left/odd/offset,% + left/odd/offset/head/.alias*=head/left/odd/offset,% + left/odd/head/offset/.alias*=head/left/odd/offset,% + odd/head/offset/left/.alias*=head/left/odd/offset,% + odd/head/left/offset/.alias*=head/left/odd/offset,% + odd/offset/head/left/.alias*=head/left/odd/offset,% + odd/offset/left/head/.alias*=head/left/odd/offset,% + odd/left/offset/head/.alias*=head/left/odd/offset,% + odd/left/head/offset/.alias*=head/left/odd/offset,% + offset/head/left/odd/.alias*=head/left/odd/offset,% + offset/head/odd/left/.alias*=head/left/odd/offset,% + offset/left/head/odd/.alias*=head/left/odd/offset,% + offset/left/odd/head/.alias*=head/left/odd/offset,% + offset/odd/left/head/.alias*=head/left/odd/offset,% + offset/odd/head/left/.alias*=head/left/odd/offset,% + head/right/even/offset/.store in skip cs=f@ncyO@erh,% + head/right/even/offset/.append code=\fancy@setoffs,% + head/even/offset/right/.alias*=head/right/even/offset,% + head/even/right/offset/.alias*=head/right/even/offset,% + head/offset/even/right/.alias*=head/right/even/offset,% + head/offset/right/even/.alias*=head/right/even/offset,% + head/right/offset/even/.alias*=head/right/even/offset,% + right/head/offset/even/.alias*=head/right/even/offset,% + right/head/even/offset/.alias*=head/right/even/offset,% + right/offset/head/even/.alias*=head/right/even/offset,% + right/offset/even/head/.alias*=head/right/even/offset,% + right/even/offset/head/.alias*=head/right/even/offset,% + right/even/head/offset/.alias*=head/right/even/offset,% + even/head/offset/right/.alias*=head/right/even/offset,% + even/head/right/offset/.alias*=head/right/even/offset,% + even/offset/head/right/.alias*=head/right/even/offset,% + even/offset/right/head/.alias*=head/right/even/offset,% + even/right/offset/head/.alias*=head/right/even/offset,% + even/right/head/offset/.alias*=head/right/even/offset,% + offset/head/right/even/.alias*=head/right/even/offset,% + offset/head/even/right/.alias*=head/right/even/offset,% + offset/right/head/even/.alias*=head/right/even/offset,% + offset/right/even/head/.alias*=head/right/even/offset,% + offset/even/right/head/.alias*=head/right/even/offset,% + offset/even/head/right/.alias*=head/right/even/offset,% + head/right/odd/offset/.store in skip cs=f@ncyO@orh,% + head/right/odd/offset/.append code=\fancy@setoffs,% + head/odd/offset/right/.alias*=head/right/odd/offset,% + head/odd/right/offset/.alias*=head/right/odd/offset,% + head/offset/odd/right/.alias*=head/right/odd/offset,% + head/offset/right/odd/.alias*=head/right/odd/offset,% + head/right/offset/odd/.alias*=head/right/odd/offset,% + right/head/offset/odd/.alias*=head/right/odd/offset,% + right/head/odd/offset/.alias*=head/right/odd/offset,% + right/offset/head/odd/.alias*=head/right/odd/offset,% + right/offset/odd/head/.alias*=head/right/odd/offset,% + right/odd/offset/head/.alias*=head/right/odd/offset,% + right/odd/head/offset/.alias*=head/right/odd/offset,% + odd/head/offset/right/.alias*=head/right/odd/offset,% + odd/head/right/offset/.alias*=head/right/odd/offset,% + odd/offset/head/right/.alias*=head/right/odd/offset,% + odd/offset/right/head/.alias*=head/right/odd/offset,% + odd/right/offset/head/.alias*=head/right/odd/offset,% + odd/right/head/offset/.alias*=head/right/odd/offset,% + offset/head/right/odd/.alias*=head/right/odd/offset,% + offset/head/odd/right/.alias*=head/right/odd/offset,% + offset/right/head/odd/.alias*=head/right/odd/offset,% + offset/right/odd/head/.alias*=head/right/odd/offset,% + offset/odd/right/head/.alias*=head/right/odd/offset,% + offset/odd/head/right/.alias*=head/right/odd/offset,% + foot/left/even/offset/.store in skip cs=f@ncyO@elf,% + foot/left/even/offset/.append code=\fancy@setoffs,% + foot/even/offset/left/.alias*=foot/left/even/offset,% + foot/even/left/offset/.alias*=foot/left/even/offset,% + foot/offset/even/left/.alias*=foot/left/even/offset,% + foot/offset/left/even/.alias*=foot/left/even/offset,% + foot/left/offset/even/.alias*=foot/left/even/offset,% + left/foot/offset/even/.alias*=foot/left/even/offset,% + left/foot/even/offset/.alias*=foot/left/even/offset,% + left/offset/foot/even/.alias*=foot/left/even/offset,% + left/offset/even/foot/.alias*=foot/left/even/offset,% + left/even/offset/foot/.alias*=foot/left/even/offset,% + left/even/foot/offset/.alias*=foot/left/even/offset,% + even/foot/offset/left/.alias*=foot/left/even/offset,% + even/foot/left/offset/.alias*=foot/left/even/offset,% + even/offset/foot/left/.alias*=foot/left/even/offset,% + even/offset/left/foot/.alias*=foot/left/even/offset,% + even/left/offset/foot/.alias*=foot/left/even/offset,% + even/left/foot/offset/.alias*=foot/left/even/offset,% + offset/foot/left/even/.alias*=foot/left/even/offset,% + offset/foot/even/left/.alias*=foot/left/even/offset,% + offset/left/foot/even/.alias*=foot/left/even/offset,% + offset/left/even/foot/.alias*=foot/left/even/offset,% + offset/even/left/foot/.alias*=foot/left/even/offset,% + offset/even/foot/left/.alias*=foot/left/even/offset,% + foot/left/odd/offset/.store in skip cs=f@ncyO@olf,% + foot/left/odd/offset/.append code=\fancy@setoffs,% + foot/odd/offset/left/.alias*=foot/left/odd/offset,% + foot/odd/left/offset/.alias*=foot/left/odd/offset,% + foot/offset/odd/left/.alias*=foot/left/odd/offset,% + foot/offset/left/odd/.alias*=foot/left/odd/offset,% + foot/left/offset/odd/.alias*=foot/left/odd/offset,% + left/foot/offset/odd/.alias*=foot/left/odd/offset,% + left/foot/odd/offset/.alias*=foot/left/odd/offset,% + left/offset/foot/odd/.alias*=foot/left/odd/offset,% + left/offset/odd/foot/.alias*=foot/left/odd/offset,% + left/odd/offset/foot/.alias*=foot/left/odd/offset,% + left/odd/foot/offset/.alias*=foot/left/odd/offset,% + odd/foot/offset/left/.alias*=foot/left/odd/offset,% + odd/foot/left/offset/.alias*=foot/left/odd/offset,% + odd/offset/foot/left/.alias*=foot/left/odd/offset,% + odd/offset/left/foot/.alias*=foot/left/odd/offset,% + odd/left/offset/foot/.alias*=foot/left/odd/offset,% + odd/left/foot/offset/.alias*=foot/left/odd/offset,% + offset/foot/left/odd/.alias*=foot/left/odd/offset,% + offset/foot/odd/left/.alias*=foot/left/odd/offset,% + offset/left/foot/odd/.alias*=foot/left/odd/offset,% + offset/left/odd/foot/.alias*=foot/left/odd/offset,% + offset/odd/left/foot/.alias*=foot/left/odd/offset,% + offset/odd/foot/left/.alias*=foot/left/odd/offset,% + foot/right/even/offset/.store in skip cs=f@ncyO@erf,% + foot/right/even/offset/.append code=\fancy@setoffs,% + foot/even/offset/right/.alias*=foot/right/even/offset,% + foot/even/right/offset/.alias*=foot/right/even/offset,% + foot/offset/even/right/.alias*=foot/right/even/offset,% + foot/offset/right/even/.alias*=foot/right/even/offset,% + foot/right/offset/even/.alias*=foot/right/even/offset,% + right/foot/offset/even/.alias*=foot/right/even/offset,% + right/foot/even/offset/.alias*=foot/right/even/offset,% + right/offset/foot/even/.alias*=foot/right/even/offset,% + right/offset/even/foot/.alias*=foot/right/even/offset,% + right/even/offset/foot/.alias*=foot/right/even/offset,% + right/even/foot/offset/.alias*=foot/right/even/offset,% + even/foot/offset/right/.alias*=foot/right/even/offset,% + even/foot/right/offset/.alias*=foot/right/even/offset,% + even/offset/foot/right/.alias*=foot/right/even/offset,% + even/offset/right/foot/.alias*=foot/right/even/offset,% + even/right/offset/foot/.alias*=foot/right/even/offset,% + even/right/foot/offset/.alias*=foot/right/even/offset,% + offset/foot/right/even/.alias*=foot/right/even/offset,% + offset/foot/even/right/.alias*=foot/right/even/offset,% + offset/right/foot/even/.alias*=foot/right/even/offset,% + offset/right/even/foot/.alias*=foot/right/even/offset,% + offset/even/right/foot/.alias*=foot/right/even/offset,% + offset/even/foot/right/.alias*=foot/right/even/offset,% + foot/right/odd/offset/.store in skip cs=f@ncyO@orf,% + foot/right/odd/offset/.append code=\fancy@setoffs,% + foot/odd/offset/right/.alias*=foot/right/odd/offset,% + foot/odd/right/offset/.alias*=foot/right/odd/offset,% + foot/offset/odd/right/.alias*=foot/right/odd/offset,% + foot/offset/right/odd/.alias*=foot/right/odd/offset,% + foot/right/offset/odd/.alias*=foot/right/odd/offset,% + right/foot/offset/odd/.alias*=foot/right/odd/offset,% + right/foot/odd/offset/.alias*=foot/right/odd/offset,% + right/offset/foot/odd/.alias*=foot/right/odd/offset,% + right/offset/odd/foot/.alias*=foot/right/odd/offset,% + right/odd/offset/foot/.alias*=foot/right/odd/offset,% + right/odd/foot/offset/.alias*=foot/right/odd/offset,% + odd/foot/offset/right/.alias*=foot/right/odd/offset,% + odd/foot/right/offset/.alias*=foot/right/odd/offset,% + odd/offset/foot/right/.alias*=foot/right/odd/offset,% + odd/offset/right/foot/.alias*=foot/right/odd/offset,% + odd/right/offset/foot/.alias*=foot/right/odd/offset,% + odd/right/foot/offset/.alias*=foot/right/odd/offset,% + offset/foot/right/odd/.alias*=foot/right/odd/offset,% + offset/foot/odd/right/.alias*=foot/right/odd/offset,% + offset/right/foot/odd/.alias*=foot/right/odd/offset,% + offset/right/odd/foot/.alias*=foot/right/odd/offset,% + offset/odd/right/foot/.alias*=foot/right/odd/offset,% + offset/odd/foot/right/.alias*=foot/right/odd/offset,% + head/inner/offset/.style={head/right/even/offset={#1},head/left/odd/offset={#1}},% + head/inner/offset+/.style={head/right/even/offset+={#1},head/left/odd/offset+={#1}},% + head/inner/offset-/.style={head/right/even/offset-={#1},head/left/odd/offset-={#1}},% + head/inner/offset*/.style={head/right/even/offset*={#1},head/left/odd/offset*={#1}},% + head/offset/inner/.alias*=head/inner/offset,% + offset/head/inner/.alias*=head/inner/offset,% + offset/inner/head/.alias*=head/inner/offset,% + inner/head/offset/.alias*=head/inner/offset,% + inner/offset/head/.alias*=head/inner/offset,% + head/outer/offset/.style={head/left/even/offset={#1},head/right/odd/offset={#1}},% + head/outer/offset+/.style={head/left/even/offset+={#1},head/right/odd/offset+={#1}},% + head/outer/offset-/.style={head/left/even/offset-={#1},head/right/odd/offset-={#1}},% + head/outer/offset*/.style={head/left/even/offset*={#1},head/right/odd/offset*={#1}},% + head/offset/outer/.alias*=head/outer/offset,% + offset/head/outer/.alias*=head/outer/offset,% + offset/outer/head/.alias*=head/outer/offset,% + outer/head/offset/.alias*=head/outer/offset,% + outer/offset/head/.alias*=head/outer/offset,% + foot/inner/offset/.style={foot/right/even/offset={#1},foot/left/odd/offset={#1}},% + foot/inner/offset+/.style={foot/right/even/offset+={#1},foot/left/odd/offset+={#1}},% + foot/inner/offset-/.style={foot/right/even/offset-={#1},foot/left/odd/offset-={#1}},% + foot/inner/offset*/.style={foot/right/even/offset*={#1},foot/left/odd/offset*={#1}},% + foot/offset/inner/.alias*=foot/inner/offset,% + offset/foot/inner/.alias*=foot/inner/offset,% + offset/inner/foot/.alias*=foot/inner/offset,% + inner/foot/offset/.alias*=foot/inner/offset,% + inner/offset/foot/.alias*=foot/inner/offset,% + foot/outer/offset/.style={foot/left/even/offset={#1},foot/right/odd/offset={#1}},% + foot/outer/offset+/.style={foot/left/even/offset+={#1},foot/right/odd/offset+={#1}},% + foot/outer/offset-/.style={foot/left/even/offset-={#1},foot/right/odd/offset-={#1}},% + foot/outer/offset*/.style={foot/left/even/offset*={#1},foot/right/odd/offset*={#1}},% + foot/offset/outer/.alias*=foot/outer/offset,% + offset/foot/outer/.alias*=foot/outer/offset,% + offset/outer/foot/.alias*=foot/outer/offset,% + outer/foot/offset/.alias*=foot/outer/offset,% + outer/offset/foot/.alias*=foot/outer/offset,% + inner/offset/.style={foot/inner/offset={#1},head/inner/offset={#1}},% + inner/offset+/.style={foot/inner/offset+={#1},head/inner/offset+={#1}},% + inner/offset-/.style={foot/inner/offset-={#1},head/inner/offset-={#1}},% + inner/offset*/.style={foot/inner/offset*={#1},head/inner/offset*={#1}},% + offset/inner/.alias*=inner/offset,% + outer/offset/.style={foot/outer/offset={#1},head/outer/offset={#1}},% + outer/offset+/.style={foot/outer/offset+={#1},head/outer/offset+={#1}},% + outer/offset-/.style={foot/outer/offset-={#1},head/outer/offset-={#1}},% + outer/offset*/.style={foot/outer/offset*={#1},head/outer/offset*={#1}},% + offset/outer/.alias*=outer/offset,% + reset/.style={norule,head=,foot=,offset=\z@,foot/rule/skip,rule/font=,font=},% + reset/.value forbidden,% +}% keys for \pagesetup (stored into token \itf@tk) +\AtBeginDocument{% +\ifdim\headwidth<\z@ +%% This catches the case that \headwidth hasn't been initialized and the +%% case that the user added something to \headwidth in the expectation that +%% it was initialized to \textwidth. We compensate this now. This loses if +%% the user intended to multiply it by a factor. But that case is more +%% likely done by saying something like \headwidth=1.2\textwidth. +%% The doc says you have to change \headwidth after the first call to +%% \pagestyle{fancy}. This code is just to catch the most common cases were +%% that requirement is violated. + \global\advance\headwidth123456789sp\global\advance\headwidth\textwidth +\fi} +% +% \end{macrocode} +% +% \subsection{marks} +% +% \begin{macrocode} +%<*marks> +\ProvidesPackage{interfaces-marks} + [2011/02/19 v3.1 easier use of e-TeX marks (FC)] +\RequirePackage{interfaces-base} +% \end{macrocode} +% +% \begin{macro}{\marksthe} +% \begin{macrocode} +\newrobustcmd\marksthe[2]{% + \ifcsname marks@#1\endcsname \else \itf@marks@new{#1}\fi + {\toks@{#2}\expandafter\marks\csname marks@#1\endcsname{\the\toks@}}% +}% \marksthe +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\marksthecs} +% \begin{macrocode} +\newrobustcmd*\marksthecs[2]{% + \ifcsname marks@#1\endcsname \else \itf@marks@new{#1}\fi + \ifcsundef{#2} + {} + {{\toks@\expandafter\expandafter\expandafter{% + \csname #2\endcsname}% + \expandafter\marks\csname marks@#1\endcsname{\the\toks@}}}% +}% \marksthecs +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@marks@new} +% \begin{macrocode} +\def\itf@marks@new#1{% + \expandafter\newmarks\csname marks@#1\endcsname + \PackageInfo{interfaces-marks}{marks `#1' defined}% +}% \itf@marks@new +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\thefirstmarks} +% \begin{macro}{\thebotmarks} +% \begin{macro}{\thetopmarks} +% +% Purely expandable in exactly one step of expansion. +% +% \begin{macrocode} +\newcommand*\thefirstmarks[1]{\romannumeral + \ifcsname marks@#1\endcsname \expandafter\z@ + \firstmarks\csname marks@#1\expandafter\endcsname + \else \expandafter\z@ + \fi +}% \thefirstmarks +\newcommand*\thebotmarks[1]{\romannumeral + \ifcsname marks@#1\endcsname \expandafter\z@ + \botmarks\csname marks@#1\expandafter\endcsname + \else \expandafter\z@ + \fi +}% \thebotmarks +\newcommand*\thetopmarks[1]{\romannumeral + \ifcsname marks@#1\endcsname \expandafter\z@ + \topmarks\csname marks@#1\expandafter\endcsname + \else \expandafter\z@ + \fi +}% \thetopmarks +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\getthemarks} +% +% \cs{getthemarks}\cs{firstmarks}\M{named-mark}\cs{result} +% +% \begin{macrocode} +%% \getthemarks\firstmarks{section}\macro +\newrobustcmd*\getthemarks[3]{% + \ifcsname marks@#2\endcsname + \edef#3{\unexpanded\expandafter{#1\csname marks@#2\endcsname}}% + \else \let#3\@undefined + \fi +}% \getthemarks +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\getthefirstmarks} +% +% \cs{getthefirstmarks}\M{named-mark}\cs{result}: shortcut for \cs{getthemarks}\cs{firstmarks} +% +% \begin{macro}{\getthebotmarks} +% \begin{macro}{\getthetopmarks} +% \begin{macrocode} +\newrobustcmd*\getthefirstmarks{\getthemarks\firstmarks} +\newrobustcmd*\getthebotmarks{\getthemarks\botmarks} +\newrobustcmd*\getthetopmarks{\getthemarks\topmarks} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\ifmarksequal} +% \begin{macrocode} +%% \ifmarksequal\firstmarks\botmarks{subsection}{ true }{ false } +\newrobustcmd*\ifmarksequal[3]{% + \begingroup + \getthemarks{#1}{#3}\x + \getthemarks{#2}{#3}\y + \expandafter\endgroup + \csname ltx@\ifdefined\x\ifdefined\y + \ifx\x\y first\else + second\fi\else second\fi\else second\fi + oftwo\endcsname +}% \ifmarksequal +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Subsection[tocloft] +% +% \begin{macrocode} +%<*tocloft> +\ProvidesPackage{interfaces-tocloft} + [2011/02/19 v3.1 pgfkeys macros for tocloft (FC)] +\RequirePackage{interfaces-base} +\itf@Check@Package{tocloft} +% \end{macrocode} +% +% \begin{macro}{\tocsetup} +% \begin{macro}{\lofsetup} +% \begin{macro}{\lotsetup} +% \begin{macro}{\listofsetup} +% +% The user commands. +% +% \begin{macrocode} +\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 +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\itf@cft@newlistof} +% +% This macro creates the keys for \textt{toc}, \textt{lof} and \textt{lot}, and is able +% to create the keys for each new list created with \xpackage{tocloft}'s \cs{newlistof}. + +% \begin{macrocode} +\def\itf@cft@newlistof#1#2#3{% +% #1=toc/lof (ext.), +% #2=entry (\newlistof only), +% #3=title (\newlistof only) + \pgfqkeys{/itf/tocloft/#1}{% + depth/.store in counter cs=c@#1depth,% + depth/.append code=\expandafter\global\csname c@#1depth\endcsname + \csname c@#1depth\endcsname + \addtocontents{#1}{\csname c@#1depth\endcsname + \the\csname c@#1depth\endcsname\relax},% + #1depth/.alias*=depth,% + pagestyle/.code=\tocloftpagestyle{##1},% + parskip/.store in skip cs=cftparskip,% + parsep/.alias=parskip,% + mark/.store in cs=cftmark#1,% + marks/.alias=mark,% + 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/skip/.alias*=title/bottom,% + title/font/.store as code in cs=cft#1titlefont,% + title/format/.alias*=title/font,% + title/color/.store as color,% + title/color/.append code=\pgfkeysalso{/itf/tocloft/#1/title/font+={% + \color{\pgfkeysvalueof{/itf/tocloft/#1/title/color}}}},% + title/font/color/.alias=title/color,% + title/format/color/.alias=title/color,% + 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 + \columnsep\pgfkeysvalueof{/itf/tocloft/#1/columns/sep}\relax + \columnseprule\pgfkeysvalueof{/itf/tocloft/#1/columns/rule}\relax + \pgfkeysvalueof{/itf/tocloft/#1/multicols/beforebegin}% + \def\itf@tocloft@aftermulticols{% + \pgfkeysvalueof{/itf/tocloft/#1/multicols/afterend}}% + \begin{multicols}{\pgfkeysvalueof{/itf/tocloft/#1/columns}}% + \pgfkeysgetvalue{/itf/tocloft/#1/columns/rule/color}\columnseprulecolor + \pgfkeysvalueof{/itf/tocloft/#1/multicols/afterbegin}% + }% + \pgfkeyssetvalue{/itf/tocloft/#1/columns/after@hook}{% + \pgfkeysvalueof{/itf/tocloft/#1/multicols/beforeend}% + \aftergroup\itf@tocloft@aftermulticols + \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/.estore as dimen,% + columns/rule/.default=\columnseprule,% + columns/rule,% assign default + columnseprule/.alias*=columns/rule,% + columns/rule/width/.alias*=columns/rule,% + columns/sep/.estore 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,% + columns/color/.alias*=columns/rule/color,% + multicolsep/.estore as glue,% + multicolsep/.default=0pt plus4pt minus3pt,% + multicolsep,% sets default + milticols/beforebegin/.initial=,multicols/beforebegin/.default=,% + multicols/afterbegin/.initial=,multicols/afterbegin/.default=,% + multicols/begin/.alias=multicols/afterbegin,% + multicols/before/.alias=multicols/afterbegin,% + multicols/beforeend/.initial=,multicols/beforeend/.default=,% + multicols/afterend/.initial=,multicols/afterend/.default=,% + multicols/end/.alias=multicols/beforeend,% + multicols/after/.alias=multicols/beforeend,% + }% \pgfkeys + \itf@AfterPackage{interfaces-bookmark}{% + \def\itf@tocloft@bookmark@handler##1##2{% + \pgfkeysEaddvalue{/itf/tocloft/##1/bookmark}{}{,##2}% + \pgfkeysgetvalue{/itf/tocloft/##1/bookmark/text}\itf@tp + \ifx \itf@tp\@empty + \pgfkeyssetvalue{/itf/tocloft/##1/bookmark/text}\contentsname \fi}% + \pgfqkeys{/itf/tocloft/#1}{% + bookmark/.is multiple choice,% + bookmark/bold/.true=\itf@tocloft@bookmark@handler{#1}{bold=true},% + bookmark/bold/.false=\itf@tocloft@bookmark@handler{#1}{bold=false},% + bookmark/italic/.true=\itf@tocloft@bookmark@handler{#1}{italic=true},% + bookmark/italic/.false=\itf@tocloft@bookmark@handler{#1}{italic=false},% + bookmark/color/.code=\itf@tocloft@bookmark@handler{#1}{color={##1}},% + bookmark/level/.code=\pgfkeysEsetvalue{/itf/tocloft/#1/bookmark/level}{% + \ifcsname toclevel@##1\endcsname + \csname toclevel@##1\endcsname + \else##1\fi}% + \itf@tocloft@bookmark@handler{#1}{},% + bookmark/level/.default=-1,% + bookmark/level/.initial=-1,% + 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 + \AfterPreamble{% + \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}{% + title={#3},% + pagenumbers/.true=\@cftpnumon{#2},% + pagenumbers/.false=\@cftpnumoff{#2},% + pagenumbers/on/.alias=pagenumbers/true, + pagenumbers/off/.alias=pagenumbers/false, + pagenumber/.alias=pagenumbers,% + }% + \expandafter\pretocmd\csname @cftmake#1title\expandafter\endcsname + \expandafter{\expandafter\itf@tocloft\csname cft#1title\endcsname{#1}{listof#2}} + {\@PackageInfoNoLine{interfaces-tocloft} + {\expandafter\string\csname @cftmake#1title\endcsname\space + successfully augmented}} + {\@PackageWarningNoLine{interfaces-tocloft} + {\expandafter\string\csname @cftmake#1title\endcsname\space + \space could not be patched + \MessageBreak Keys label and bookmark won't work for \string\listofsetup}}% + \fi +}% \itf@cft@newlistof +% \end{macrocode} +% \end{macro} +% +% Then create the keys for \textt{toc},\, \textt{lof},\, and\, \textt{lot}: +% +% \begin{macrocode} +\itf@cft@newlistof{toc}{}{} +\itf@cft@newlistof{lof}{}{} +\itf@cft@newlistof{lot}{}{} +% \end{macrocode} +% +% \begin{macrocode} +%% Specific to toc only ------------------------------------------------------- +\pgfqkeys{/itf/tocloft/toc}{% + 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 +% \end{macrocode} +% +% \begin{macro}{\itf@cft@sectionname} +% +% This macro converts \textt{subsection} into \textt{subsec} \etc. because of +% \xpackage{tocloft} command names:§ +% \cs{cftbeforesubsecskip},\, \cs{cftsubsecindent} \etc. +% +% And the keys are either \textt[\opt]{subsec}\, or\, \textt[\opt]{subsection}. +% +% \begin{macrocode} +\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\relax #2\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 + \ifx#1\chapter chap\else + #2\fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi +}% \itf@cft@section@name +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%% 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},% +} +% \end{macrocode} +% +% \begin{macro}{\itf@cft@newsection} +% +% This macro creates the keys for each sectionning command. +% +% \begin{macrocode} +\def\itf@cft@newsection{\itf@cft@new@section{/itf/tocloft}} +\def\itf@cft@new@section#1#2#3{% #2 = toc | lof | lot, #3=part / chap / sec / subsec etc. + \pgfqkeys{#1/#2/#3}{% + skip/.cft@length=before.#3.skip,% + beforeskip/.alias*=skip,% + top/.alias*=skip,% + indent/.cft@length=.#3.indent,% + font/.cft@code=.#3.font,% + font/.append code=\pgfkeysalso{/itf/tocloft/#2/#3/pagenumber/font={##1}},% + format/.alias*=font,% + color/.store as color,% + color/.append code=\pgfkeysalso{/itf/tocloft/#2/#3/font+={% + \color{\pgfkeysvalueof{/itf/tocloft/#2/#3/color}}% + \ifdefined\hypersetup \hypersetup{% + linkcolor=\pgfkeysvalueof{/itf/tocloft/#2/#3/color}}% + \fi}},% + font/color/.alias=color,% + format/color/.alias=color,% + number/width/.cft@length=.#3.numwidth,% + numwidth/.alias*=number/width,% + presnum/.cft@code=.#3.presnum,% + number/before/.alias*=presnum,% + aftersnum/.cft@code=.#3.aftersnum,% + number/after/.alias*=aftersnum,% + aftersnumb/.cft@code=.#3.aftersnumb,% + title/before/.alias*=aftersnumb,% + leader/.cft@def=.#3.leader,% + leader/.default=\cftdotfill{\csname\itf@cft@name.#3.dotsep\@nil\endcsname},% + leaders/.alias=leader,% + dotsep/.code={\ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text + \csdef{\itf@cft@name.#3.dotsep\@nil}{\cftdotsep}% + \else + \itf@units@mu\itf@musk{##1}% + \csedef{\itf@cft@name.#3.dotsep\@nil}{\itf@strip@mu\itf@musk}% + \fi},% + dotsep/.blank=\cftnodots,% + nodots/.code=\csdef{\itf@cft@name.#3.dotsep\@nil}{\cftnodots},% + nodots/.value forbidden,% + pagefont/.cft@code=.#3.pagefont,% + page/font/.alias*=pagefont,% + pagenumber/font/.alias*=pagefont,% + pagenumbers/font/.alias*=pagefont,% + page/color/.store as color,% + page/color/.append code=\pgfkeysalso{/itf/tocloft/#2/#3/pagefont+={% + \color{\pgfkeysvalueof{/itf/tocloft/#2/#3/page/color}}% + \ifdefined\hypersetup \hypersetup{% + linkcolor=\pgfkeysvalueof{/itf/tocloft/#2/#3/page/color}}% + \fi}},% + pagenumber/color/.alias=page/color,% + pagenumbers/color/.alias=page/color,% + page/font/color/.alias=page/color,% + pagenumber/font/color/.alias=page/color,% + pagenumbers/font/color/.alias=page/color,% + afterpnum/.cft@code=.#3.afterpnum,% + page/after/.alias*=afterpnum,% + pagenumber/after/.alias*=afterpnum,% + pagenumbers/.on=\@cftpnumon{\itf@cft@secname{#3}},% + pagenumbers/.off=\@cftpnumoff{\itf@cft@secname{#3}},% + pagenumber/.alias=pagenumbers,% + }% \pgfqkeys +}% \itf@cft@new@section +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\@for\itf@tp:=part,chap,chapter,sec,section,subsec,subsection,% + subsubsec,subsubsection,para,paragraph,subpara,subparagraph% + \do{\edef\itf@tp{\noexpand\itf@cft@newsection{toc}{\itf@tp}}\itf@tp}% +\if@cftsubfigopt + \@for\itf@tp:=fig,figure,subfig,subfigure% + \do{\edef\itf@tp{\noexpand\itf@cft@newsection{lof}{\itf@tp}}\itf@tp}% + \@for\itf@tp:=tab,table,subtab,subtable% + \do{\edef\itf@tp{\noexpand\itf@cft@newsection{lot}{\itf@tp}}\itf@tp}% +\else + \@for\itf@tp:=fig,figure% + \do{\edef\itf@tp{\noexpand\itf@cft@newsection{lof}{\itf@tp}}\itf@tp}% + \@for\itf@tp:=tab,table% + \do{\edef\itf@tp{\noexpand\itf@cft@newsection{lot}{\itf@tp}}\itf@tp}% +\fi +% \end{macrocode} +% +% +% \begin{macro}{\@cftmaketoctitle (patch)} +% \begin{macro}{\@cftmakeloftitle (patch)} +% \begin{macro}{\@cftmakelottitle (patch)} +% \begin{macro}{\\newlistof (patch)} +% \patchlabel{@cftmaketoctitle} +% +% \begin{macrocode} +\itf@patch\pretocmd\@cftmaketoctitle + {\itf@tocloft\contentsname{toc}{tableofcontents}} + {\@PackageInfoNoLine{interfaces-tocloft} + {\string\@cftmaketoctitle\space successfully augmented}} + {\@PackageWarningNoLine{interfaces-tocloft} + {\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}} + {\@PackageInfoNoLine{interfaces-tocloft} + {\string\@cftmakeloftitle\space successfully augmented}} + {\@PackageWarningNoLine{interfaces-tocloft} + {\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}} + {\@PackageInfoNoLine{interfaces-tocloft} + {\string\@cftmakelottitle\space successfully augmented}} + {\@PackageWarningNoLine{interfaces-tocloft} + {\string\@cftmakelottitle\space could not be patched + \MessageBreak label and bookmark keys for \string\lotsetup\space won't work}}% +\expandafter\itf@patch\expandafter\patchcmd\csname\string\newlistof\endcsname + {#4}{\csname cft#3title\endcsname} + {\@PackageInfoNoLine{interfaces-tocloft} + {\string\newlistof\space successfully patched}} + {\@PackageWarningNoLine{interfaces-tocloft} + {\string\newlistof\space could not be patched + \MessageBreak \string\listofsetup\space will not work}}% +\expandafter\itf@patch\expandafter\apptocmd\csname\string\newlistof\endcsname + {\itf@cft@newlistof{#3}{#2}{#4}} + {\@PackageInfoNoLine{interfaces-tocloft} + {\string\newlistof\space successfully augmented}} + {\@PackageWarningNoLine{interfaces-tocloft} + {\string\newlistof\space could not be patched + \MessageBreak \string\listofsetup\space will not work}}% +\expandafter\itf@patch\expandafter\apptocmd\csname\string\newlistentry\endcsname + {\itf@cft@newsection{#3}{#2}} + {\@PackageInfoNoLine{interfaces-tocloft} + {\string\newlistentry\space successfully augmented}} + {\@PackageWarningNoLine{interfaces-tocloft} + {\string\newlistentry\space could not be patched + \MessageBreak \string\listofsetup\space will not work}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\itf@cft@label} +% +% \qquad \cs{itf@cft@label} insert the anchor for the table of contents +% and makes the label (if the key \textt{label} of \cs{tocsetup}, \cs{lofsetup} etc. +% has been set to a non empty value. +% +% \begin{macrocode} +\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,% + level=\pgfkeysvalueof{/itf/tocloft/#3/bookmark/level}% + }]{\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}\global\let\itf@tp \relax}% restore original + \aftergroup\itf@tp % simple group introduced by tocloft to print \contentsname +}% \itf@cft@label +% \end{macrocode} +% \end{macro} +% +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Subsection[makecell] +% +% \begin{macrocode} +%<*makecell> +\ProvidesPackage{interfaces-makecell} + [2011/02/19 v3.1 repeatcell to fill in tabulars (FC)] +\RequirePackage{interfaces-base} +\itf@Check@Package{makecell} +\edef\itf@AtEnd{\catcode126 \the\catcode126}% 126 = ~ +\AtEndOfPackage{\itf@AtEnd} +\catcode126 \active % 126 = ~ +% \end{macrocode} +% +% \subsubsection{countvalues} +% +% \begin{macro}{\countvalues} +% +% +% \begin{macrocode} +\def\countvalues#1{\number\numexpr + \expandafter\itf@countvalues\expandafter0#1,\countvalues\@nnil +}% \countvalues +\def\itf@countvalues#1#2,#3{% + \ifx\countvalues#3% + +#1\expandafter\remove@to@nnil + \else + +1\expandafter\itf@countvalues + \fi1#3% +}% \itf@countvalues +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@getvalue} +% +% +% \begin{macrocode} +\def\itf@getvalue #1{\romannumeral -`\q + \expandafter\itf@getv@lue \expandafter0#1,\itf@getvalue} +\def\itf@getv@lue#1#2\itf@getvalue #3{\itf@getv@lu@{#1}{#3-1}#2\itf@getvalue\@nnil} +\def\itf@getv@lu@#1#2#3,#4{% + \ifnum \numexpr#1=\numexpr#2\relax + #3\expandafter\remove@to@nnil + \else\ifx\itf@getvalue#4\@empty + \expandafter\expandafter + \expandafter\remove@to@nnil + \else \expandafter\expandafter + \expandafter\itf@getv@lu@ + \fi\fi{#1+1}{#2}#4% +}% \itf@getv@lu@ +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{\cs{repeatcell}} +% +% \begin{macro}{\repeatcell} +% \begin{macrocode} +\newif\ifitf@celltranspose +\newrobustcmd*\repeatcell{\begingroup \iffalse{\fi \ifnum0=`}\fi \itf@repeatcell} +\newrobustcmd*\itf@repeatcell[3][]{% + \ifblank{#1}% alignment option ? + {\let\itf@makecell\@firstofone} + {\def\itf@makecell##1{\noexpand\makecell[{#1}]{##1}}}% + \countdef\itf@col=100% local + \countdef\itf@row=101% local + \countdef\itf@cnt=102% local + \toksdef\itf@cell=1% local + \itf@pgfkeys + \pgfqkeys{/itf/makecell/repeatcell}{@reset={#2},#3}% + \toks@{\ifnum0=`{}\fi \endgroup}% local + \ifnum\itf@row>\z@ % number + \edef\itf@rowloop{\noexpand\@whilenum\itf@row<\the\itf@row}% + \def\itf@cell@init{\def\r{\row}\let\R\@empty}% + \else % list + \def\itf@rowloop{\@for\r:=\itf@rows}% + \expandafter\def\expandafter\itf@cell@init\expandafter{% + \expandafter\def\expandafter\R\expandafter{% + \expandafter\itf@getvalue\expandafter{\expandafter\@empty\itf@rows}}}% + \fi + \ifnum\itf@col>\z@ % number + \edef\itf@colloop{\noexpand\@whilenum\itf@col<\the\itf@col}% + \expandafter\def\expandafter\itf@cell@init\expandafter{% + \itf@cell@init\def\c{\column}\let\C\@empty}% + \else % list + \def\itf@colloop{\@for\c:=\itf@cols}% + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter\itf@cell@init + \expandafter\expandafter\expandafter{% + \expandafter\itf@cell@init + \expandafter\def\expandafter\C\expandafter{% + \expandafter\itf@getvalue\expandafter{\expandafter\@empty\itf@cols}}}% + \fi + \itf@cell@init % in case they are used in formulas + \ifitf@celltranspose + \itf@col\z@ + \itf@colloop\do{% + \ifnum\itf@col>\z@ + \pgfkeysifdefined{/itf/makecell/repeatcell/cr/row\the\itf@col}% + {\pgfkeysgetvalue{/itf/makecell/repeatcell/cr/row\the\itf@col}\itf@thecr} + {\pgfkeysgetvalue{/itf/makecell/repeatcell/cr}\itf@thecr}% + \toks@\expandafter{\the\expandafter\toks@ \itf@thecr}% + \fi + \advance\itf@col\@ne + \itf@row\z@ + \itf@rowloop\do{% + \advance\itf@row\@ne + \ifnum\itf@row>\@ne + \toks@\expandafter{\the\toks@&}% + \fi + \toks@\expandafter{\the\expandafter\toks@ \itf@cell@init}% + \itf@cell@insert}% rows loop + }% cols loop + \else + \itf@row\z@ + \itf@rowloop\do{% + \ifnum\itf@row>\z@ + \pgfkeysifdefined{/itf/makecell/repeatcell/cr/row\the\itf@row}% + {\pgfkeysgetvalue{/itf/makecell/repeatcell/cr/row\the\itf@row}\itf@thecr} + {\pgfkeysgetvalue{/itf/makecell/repeatcell/cr}\itf@thecr}% + \toks@\expandafter{\the\expandafter\toks@ \itf@thecr}% + \fi + \advance\itf@row\@ne + \itf@col\z@ + \itf@colloop\do{% + \advance\itf@col\@ne + \ifnum\itf@col>\@ne + \toks@\expandafter{\the\toks@&}% + \fi + \toks@\expandafter{\the\expandafter\toks@ \itf@cell@init}% + \itf@cell@insert}% cols loop + }% rows loop + \fi + \itf@message{Code introduced by repeatcell in the \@currenvir:^^J + \the\toks@}% (to see the code...) + \the\toks@ \ignorespaces +}% \itf@repeatcell +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@message} +% \begin{macrocode} +\let\itf@message \@gobble +% \end{macrocode} +% \end{macro} +% +% Now the keys for \cs{repeatcell}: +% \begin{macrocode} +\def\itf@cell@rowcolkey{% + \removefromstart\pgfkeyscurrentname{row}% + \ifin@\else + \removefromstart\pgfkeyscurrentname{col}% + \fi + \ifin@ + \itf@number\itf@cnt\pgfkeyscurrentname\relax\@nnil + {\pgfkeyslet\pgfkeyscurrentkey\pgfkeyscurrentvalue} + \in@false + \fi + \ifin@\else + \pgfkeysvalueof{/errors/unknown key/.@cmd}\pgfkeyscurrentkey + \pgfkeyscurrentvalue + \pgfeov + \fi +}% \itf@cell@rowcolkey +\pgfqkeys{/itf/makecell/repeatcell}{% + font/.store in=\itf@cellfont,% + font/.unknown/.code=\itf@cell@rowcolkey,% + text/.store in=\itf@celltext,% + text/.default=\ifdefined\C\C\column\fi,% + text/.unknown/.code=\itf@cell@rowcolkey,% + cr/.initial=\\,% + cr/.default=\crcr,cr/.blank=\\,% + end/.alias=cr,% + cr/.unknown/.code=\itf@cell@rowcolkey,% + rows/.code=\itf@number\itf@row#1\relax\@nnil + {\ifnum\itf@row<\z@\itf@row\@ne\fi} + {\itf@row\z@ + \def\itf@rows{#1}\itf@expandonceifcs\itf@rows},% + rows/.default=1,rows/.blank=1,% + @cols/.is private=interfaces-makecell,% + column/.is private=interfaces-makecell,% + row/.is private=interfaces-makecell,% + transpose/.is if=itf@celltranspose,% + .unknown/.code=% + \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text \itf@cell@formulaerror{}\z@ \fi + \ifx\pgfkeyscurrentvalue\@empty \itf@cell@formulaerror{}\@ne \fi + \pgfkeysifdefined{\pgfkeyscurrentkey/@calc}% + {\itf@cell@formulaerror{}\tw@} + {\pgfkeyslet{\pgfkeyscurrentkey/@calc}\relax}% + \itf@cell@getformula{#1}% + \pgfkeysEaddvalue{/itf/makecell/repeatcell/@calc}{} + {\the\toks@\expandafter\noexpand\csname\pgfkeyscurrentname\endcsname}% + \expandafter\let\csname\pgfkeyscurrentname\endcsname\@undefined,% + @reset/.code=% #1 are the columns + \itf@celltransposefalse + \let\itf@celltext\@empty + \let\itf@cellfont\@empty + \pgfkeyssetvalue{/itf/makecell/repeatcell/cr}{\\}% + \itf@row\@ne + \pgfkeyssetvalue{/itf/makecell/repeatcell/@calc}{% + \itf@cell@numcalc\itf@col\column + \itf@cell@numcalc\itf@row\row}% + \itf@number\itf@col#1\relax\@nnil + {\ifnum\itf@col<\z@\itf@col\@ne\fi} + {\itf@col\z@ + \def\itf@cols{#1}\itf@expandonceifcs\itf@cols},% +}% keys for \repeatcell +% \end{macrocode} +% +% \begin{macro}{\itf@cell@getformula} +% Determines whether the formula should be evaluated with \cs{numexpr}, with \$\cs{pgfmath}\$ or \$\$\cs{FPeval}\$\$: +% \begin{macrocode} +\def\itf@cell@getformula#1{% + \itf@cell@getf@rmula #1$$$\itf@cell@getformula$\relax\@nnil + \expandafter\ifx\expandafter\toks@\the\toks@ + \itf@cell@formulaerror{#1}\thr@@ + \fi +}% \itf@cell@getformula +\def\itf@cell@getf@rmula #1$#2$#3$#4#5$#6{% + \toks@{\toks@}% + \ifx\itf@cell@getformula #4% + \toks@{\itf@cell@numcalc{#1}}% + \else\ifx $#4% + \ifx\itf@cell@getformula #6% + \ifdefined\pgfmathparse\else\itf@cell@formulaerror{#2}4\fi + \toks@{\itf@cell@pgfcalc{#2}}% + \else\ifx $#6% + \ifdefined\FPeval\else\itf@cell@formulaerror{#3}5\fi + \toks@{\itf@cell@FPcalc{#3}}% + \fi\fi + \fi\fi\remove@to@nnil +}% \itf@cell@getf@rmula +\def\itf@cell@formulaerror#1#2{% + \def\itf@tp{#1}\@onelevel@sanitize\itf@tp + \ifcase#2% 0 + \PackageError{interfaces-makecell} + {Missing formula for key \pgfkeyscurrentname!}\@ehd + \or %1 + \PackageError{interfaces-makecell} + {Computed key \pgfkeyscurrentname\space wes left blank!}\@ehd + \or %2 + \PackageError{interfaces-makecell} + {Duplicate definition for computed key \pgfkeyscurrentname + \MessageBreak\string\repeatcell\space will redefine the key}\@eha + \or %3 + \PackageError{interfaces-makecell} + {Incorrect formula in \string\repeatcell + \MessageBreak Check: \itf@tp + \MessageBreak Take care of commas and equal signs...}\@ehd + \or %4 + \PackageError{interfaces-makecell} + {Formula: \itf@tp + \MessageBreak requires \string\pgfmathparse:\space\string\usetikz{pgfmath}}\@ehd + \or %5 + \PackageError{interfaces-makecell} + {Formula: \itf@tp + \MessageBreak requires \string\FPeval:\space\string\usepackage{fp}}\@ehd + \else + \PackageError{interfaces-makecell} + {Impossible value!}\@ehd + \fi +}% \itf@cell@formulaerror +% \end{macrocode} +% \end{macro} +% \ClearPage* +% +% \begin{macro}{\itf@cell@calc} +% \begin{macro}{\itf@cell@numcalc} +% \begin{macro}{\itf@cell@pgfcalc} +% \begin{macro}{\itf@cell@FPcalc} +% \begin{macrocode} +\protected\def\itf@cell@calc#1#2{% + \edef#1{\def\noexpand#1{#2}}% + \toks@\expandafter{\the\expandafter\toks@ #1}% + #1% +}% \itf@cell@calc +\protected\def\itf@cell@numcalc#1#2{% + \itf@cell@calc#2{\number\numexpr#1}% +}% \itf@cell@numcalc +\protected\def\itf@cell@pgfcalc#1#2{% + \pgfmathparse{#1}% + \itf@cell@calc#2\pgfmathresult +}% \itf@cell@pgfcalc +\protected\def\itf@cell@FPcalc#1#2{% + \begingroup + \hfuzz\maxdimen \vfuzz\hfuzz \hbadness\@M \vbadness\hbadness + \everypar{}\tracinglostchars\z@ + \setbox\z@\vbox{%\FPeval introduces some weird code, hence the calculation in a \vbox + \FPeval\FPresult{#1}% + \expandafter}\expandafter\endgroup + \expandafter\itf@cell@calc\expandafter#2\expandafter{\FPresult}% +}% \itf@cell@FPcalc +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\itf@cell@insert} +% Insert a cell (into the temporary \cs{toks@} token register): +% \begin{macrocode} +\def\itf@cell@getifdefined#1#2{% + \pgfkeysifdefined{/itf/makecell/repeatcell/#1} + {\pgfkeysgetvalue{/itf/makecell/repeatcell/#1}#2} + {\let#2\@empty}% +}% +\def\itf@cell@insert{% + \pgfkeysvalueof{/itf/makecell/repeatcell/@calc}% + \ifx\R\@empty\else + \toks@\expandafter{\the\expandafter\toks@ + \expandafter\def\expandafter\r\expandafter{\r}}% + \fi + \ifx\C\@empty\else + \toks@\expandafter{\the\expandafter\toks@ + \expandafter\def\expandafter\c\expandafter{\c}}% + \fi + \itf@cell@getifdefined{font/row\the\itf@row}\itf@cellfontrow + \itf@cell@getifdefined{font/col\the\itf@col}\itf@cellfontcol + \itf@cell@getifdefined{text/row\the\itf@row}\itf@cellrow + \itf@cell@getifdefined{text/col\the\itf@col}\itf@cellcol + \toks@\expandafter{\the\expandafter\toks@ \itf@cellfont}% + \ifx\itf@cellrow\@empty + \ifx\itf@cellcol\@empty + \itf@cell\expandafter\expandafter\expandafter{% + \expandafter\itf@cellfontcol \itf@cellfontrow}% + \let\itf@tp\itf@celltext + \else + \itf@cell\expandafter{\itf@cellfontcol}% + \let\itf@tp\itf@cellcol + \fi + \else + \ifx\itf@cellcol\@empty + \itf@cell\expandafter{\itf@cellfontrow}% + \let\itf@tp\itf@cellrow + \else + \itf@cell{}% + \ifitf@celltranspose + \edef\itf@tp{\noexpand\itf@diaghead(-2,1)% + {\expandonce\itf@cellfontrow\expandonce\itf@cellrow} + {\expandonce\itf@cellfontcol\expandonce\itf@cellcol}}% + \else + \edef\itf@tp{\noexpand\itf@diaghead(-2,1)% + {\expandonce\itf@cellfontcol\expandonce\itf@cellcol} + {\expandonce\itf@cellfontrow\expandonce\itf@cellrow}}% + \fi + \fi + \fi + \itf@cell\expandafter{\the\expandafter\itf@cell \itf@tp}% + \edef\itf@tp{\itf@makecell{\the\itf@cell}}% + \toks@\expandafter{\the\expandafter\toks@ \itf@tp}% +}% \itf@cell@insert +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@diaghead} +% A helper macro to \xpackage{makecell}'s \cs{diaghead} +% \begin{macrocode} +\def\itf@diaghead(#1)#2#3{% + \begingroup + \edef\itf@tp{\endgroup + \noexpand\diaghead({#1}){\unexpanded{#2 #3}}% + {\unexpanded{#2}} + {\unexpanded{#3}}% + }\itf@tp +}% \itf@diaghead +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{colortbl: patch for \cs{CT@cellc}} +% \patchlabel[corr.]{CT@cellc} +% +% \begin{macro}{\CT@cellc} +% \begin{macrocode} +\AfterPackage*{colortbl}{% +\def\CT@cellc#1[#2]#3{% #1 is either \@firstofone or \@gobble, [#2]#3 = color spec + \xdef\CT@cell@color{\noexpand\CT@color#1{[{#2}]}{#3}% + \global\let\noexpand\CT@cell@color\relax}% +}} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% +% \Subsection[enumitem] +% +% \begin{macrocode} +%<*enumitem> +\ProvidesPackage{interfaces-enumitem} + [2011/02/19 v3.1 more control on lists (FC)] +\RequirePackage{interfaces-base} +\itf@Check@Package{enumitem} +% \end{macrocode} +% +% \begin{macro}{\interitem} +% Like \xpackage{amstext} \cs{intertext}, \cs{interitem} allows to add some non indented text +% inside a list environment: +% \begin{macrocode} +\providerobustcmd*\interitem{% + \item[]\hskip-\leftmargin +}% \interitem +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Key first= as alias to key start=} +% +% A new key \textt{first} is defined in the \xpackage{enumitem} family. This is just an alias +% for the key \textt{start} which sets the first number in an \textt{enumerate} list. +% +% \begin{macrocode} +\define@key{enumitem}{first}[\@ne]{\setkeys{enumitem}{start={#1}}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\setlist (extension, star form)} +% \patchlabel[redef]{setlist} +% \begin{macrocode} +\renewrobustcmd*\setlist{\begingroup \@ifstar + {\let\do\csgappto \itf@setlist} + {\let\do\csgdef \itf@setlist}% +}% \setlist +\newrobustcmd*\itf@setlist[2][0]{% + \let\enit@a\@empty + \let\enit@b\@empty + \@for\x:=#1\do{% + \ifx\x\@empty\else + \itf@number\count@\x\relax\@nnil + {\edef\enit@b{\enit@b,\the\count@}} + {\edef\enit@a{\enit@a,\x}}% + \fi}% + \ifx\enit@a\@empty\def\enit@a{list}\fi + \ifx\enit@b\@empty\def\enit@b{0}\fi + \@for\a:=\enit@a\do{% + \ifx\a\@empty\else + \@for\b:=\enit@b\do{% + \ifx\b\@empty\else + \ifcsundef{end\a} + {\expandafter\itf@setlist@error\expandafter{\a}} + {\do{enit@@\a\romannumeral\b}{,#2}}% + \fi}% + \fi} + \endgroup +}% \itf@setlist +\def\itf@setlist@error#1{% + \PackageError{interfaces-enumitem} + {Environment `#1` is undefined + \MessageBreak Use \string\newlist\space before \string\setlist + \MessageBreak Your command will be ignored}\@eha +}% \itf@setlist@error +% \end{macrocode} +% \end{macro} +% +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Subsection[truncate] +% +% \begin{macrocode} +%<*truncate> +\ProvidesPackage{interfaces-truncate} +% \end{macrocode} +% +% \begin{macro}{\trunctext} +% \cs{trunctext} is like \cs{truncate} but leaves the text to its natural width if possible. +% \begin{macrocode} +\newrobustcmd\trunctext[3][\TruncateMarker]{% do nothing if width of #3 is less than #2 + \begingroup + \hbadness\maxdimen\hfuzz\vsize + \setbox\z@=\hbox to\dimexpr#2\relax\bgroup\color@begingroup + \ignorespaces#3\unskip + \color@endgroup\egroup + \ifnum\badness>\@M \truncate[{#1}]{#2}{#3}% +%% \def\next{\truncate[{#1}]{#2}{#3}}% + \else #3%\def\next{#3}% + \fi + \endgroup +}% \trunctext +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\htruncadjust} +% \begin{macrocode} +\newrobustcmd\htruncadjust[1]{\@testopt + {\itf@htruncadjust{#1}}{}% +}% \htruncadjust +\long\def\itf@htruncadjust#1[#2]#3{%#1=total width, #2=[x_1..x_n], #3=text_1..text_n + \begingroup + \let\itf@trunc@width\@empty + \let\itf@istruncated\@gobble % to remove the first comma + \let\the@dimen\relax + \count@\z@ \dimen@\z@ + \ifblank{#2}% no optional [x_1,...,x_n] parameters + {% + \@for\x:=#3\do{% + \advance \count@ \@ne + \setbox\z@\hbox\bgroup\color@begingroup + \ignorespaces\x\unskip + \color@endgroup\egroup + \dimen\count@ = \wd\z@ + \toks\count@\expandafter{\the\dimen\count@}% + \advance\dimen@ \dimen\count@}% + } + {% + \@for\x:=#2\do{% + \advance \count@ \@ne + \toks\count@\expandafter{\x\p@}% + \advance\dimen@ \x\p@ + \dimen\count@ -\@ne\p@}% + }% + \advance\count@\@ne \dimendef\itf@freespace=\count@ + \advance\count@\@ne \dimendef\itf@tempdim=\count@ + \advance\count@\@ne \dimendef\itf@sum=\count@ + \count@\z@ + \itf@freespace\z@ % free space left when w_i < x_i/sum(x_i) * total + \@for\x:=#3\do{% + \advance \count@ \@ne + \ifdim\dimen@=\z@ \else + \ifdim \dimen\count@<\z@ % not measured before + \setbox\z@\hbox\bgroup\color@begingroup + \ignorespaces\x\unskip + \color@endgroup\egroup + \dimen\count@ = \wd\z@ + \fi + \itf@tempdim = \itf@scaledimen{#1}*\the\toks\count@/\dimen@\relax + \ifdim \dimen\count@ > \itf@tempdim + \dimen\count@ = \itf@tempdim + \edef\itf@istruncated{\itf@istruncated,\the\count@}% + \advance\itf@sum by\the\toks\count@ + \else + \advance\itf@freespace \itf@tempdim + \advance\itf@freespace -\dimen\count@ + \fi + \fi + \edef\itf@trunc@width{\itf@trunc@width\the\count@{\the@dimen\the\count@}}% + }% +%% Free space=\the\itf@freespace\par + \ifdim\itf@freespace > \z@ % reinsert free space proportionally + \ifx\itf@istruncated\@gobble\else + \@for\x:=\itf@istruncated\do{% + \advance\dimen\x by\itf@scaledimen\itf@freespace*\the\toks\x/\itf@sum\relax + }% + \fi\fi + \def\the@dimen{\the\dimen}% + \edef\itf@trunc@width{\itf@trunc@width}% + \expandafter\endgroup + \expandafter\def + \expandafter\itf@trunc@width + \expandafter{\itf@trunc@width}% +%% total=\the\dimexpr#1\relax +}% \itf@htruncadjust +\def\itf@scalefactor#1#2{\strip@pt\dimexpr#1*65536/#2\relax} +\def\itf@scaledimen#1*#2/#3\relax{% + \dimexpr\itf@scalefactor{#2}{#3}\dimexpr#1\relax\relax +}% \itf@scaledimen +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\htruncwidth} +% \begin{macrocode} +\newcommand*\htruncwidth[1]{% purely expandable + \expandafter\itf@htruncwidth\itf@trunc@width\relax\relax\@nnil{#1}% +}% \htruncwidth +\def\itf@htruncwidth#1#2#3\@nnil#4{% + \ifx\relax#1\itf@trunc@nosuchwidth{#4}% + \else\ifnum#1=#4 + #2% + \else + \itf@htruncwidth#3\@nnil{#4}% + \fi\fi +}% \itf@htruncwidth +\def\itf@trunc@nosuchwidth#1{% + \PackageError{interfaces-truncate} + {You requested the width for text nr#1 + \MessageBreak but there is no such text + \MessageBreak Therefore no such width!}\@ehd +}% \itf@trunc@nosuchwidth +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \sectionformat\subsection{bookmark/color=black} +% +% \Subsection[appendix] +% +% \begin{macrocode} +%<*appendix> +\ProvidesPackage{interfaces-appendix} + [2011/02/19 v3.1 easy control of appendices environment (FC)] +\RequirePackage{interfaces-base} +\itf@Check@Package{appendix} +% \end{macrocode} +% +% \begin{macro}{\appendices} +% \begin{macrocode} +\let\itf@appendices@pp\appendices +\let\itf@endappendices@pp\endappendices +\let\itf@appendices@pp\appendices +\let\itf@endappendices@pp\endappendices +\renewenvironment{appendices}[1][]{% + \pgfqkeys{/itf/appendix/appendices}{#1}% + \itf@appendices@pp + } + {\itf@endappendices@pp}% +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\pgfqkeys{/itf/appendix/appendices}{% + title/.store as code in cs=appendixpagename,% + title/.append code=\ifx\appendixpagename\@empty \@dopage@ppfalse + \else \@dopage@pptrue\fi,% + title/.value required,% + intoc/.is if=@dotoc@pp,% + intoc/title/.store as code in cs=appendixtocname,% + intoc/title/.append code=\ifx\appendixtocname\@empty \@dotoc@ppfalse + \else \@dotoc@pptrue\fi,% + intoc/title/.default=\pgfkeysvalueof{/itf/appendix/appendices/title},% + section/.is enum={section,chapter},% + section/.append code={\@chapter@ppfalse + \ifnum\pgfkeysvalueof{/itf/appendix/appendices/section/.number}=\z@ + \else \ifundef\chapter + {\PackageWarning{interfaces-appendix} + {You asked chapter-style appendices but your + \MessageBreak current class does not provide chapters!}} + \@chapter@pptrue + \fi},% + chapter/.style={section=chapter},% + chapter/.value forbidden,% +}% keys for appendices environment +% \end{macrocode} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Subsection[embedfile] +% +% \begin{macrocode} +%<*embedfile> +\ProvidesPackage{interfaces-embedfile} + [2011/02/19 v3.1 easy macros to embed files into pdf (FC)] +\RequirePackage{interfaces-base} +\itf@Check@Package{embedfile} +\newrobustcmd*\embedthisfile{\@ifstar + \embedthisfile@main + \embedthisfile@all +}% \embedthisfile +\@onlypreamble\embedthisfile +\def\embedthisfile@main{\embedfile{\jobname.tex}} +\def\embedthisfile@all{% + \embedthisfile@main + \AfterPreamble{% + \ltx@ifundefined{@listfiles} + {\let\@listfiles \@empty}% to avoid: \global\let\@filelist\relax in \document + {}% + }% + \gpreto\@enddocumenthook{% + \let\do \itf@EmbedOne + \expandafter\docsvlist\expandafter{\@filelist}% + }% +}% \embedthisfile@all +\def\itf@EmbedOne#1{\itf@Embed@ne#1.tex\@nil} +\def\itf@Embed@ne#1.tex#2\@nil{% + \ltx@ifundefined{cp@#1} + {} + {\ifblank{#2} + {} + {\embedfile{#1.tex}}}% +}% \itf@Embed@ne +% +% \end{macrocode} +% +% \Subsection[environ] +% +% \begin{macrocode} +%<*environ> +\ProvidesPackage{interfaces-environ} + [2011/02/19 v3.1 ReNewEnviron = RenewEnviron (FC)] +\RequirePackage{interfaces-base} +\AfterPackage{environ}{ + \ifundef\ReNewEnviron + {\let\ReNewEnviron\RenewEnviron} + {}% +}% +% +% \end{macrocode} +% +% +% \Subsection[umrand] +% +% \begin{macrocode} +%<*umrand> +\ProvidesPackage{interfaces-umrand} + [2011/02/19 v3.1 patch for umrand.sty ifnotempty (FC)] +\RequirePackage{interfaces-base} +\BeforePackage{umrand}{% + \let\itf@newif\newif + \def\itf@tp{\ifnotempty}% + \def\newif#1{\def\x{#1}\ifx\x\itf@tp \expandafter\@gobble + \else\expandafter\ltx@newif\fi{#1}}% +} +\AfterPackage{umrand}{% + \let\newif\itf@newif + \let\itf@newif\@undefined +} +% +% \end{macrocode} +% +% +% \Subsection[scrlfile] +% +% \begin{macrocode} +%<*scrlfile> +\ProvidesPackage{interfaces-scrlfile} + [2011/02/19 v3.1 scrlfile hooks improved (FC)] +\RequirePackage{interfaces-base} +% \end{macrocode} +% +% \begin{macro}{\@pkgextension} +% \begin{macro}{\@clsextension} +% \patchlabel{@pkgextension}\patchlabel{@clsextension} +% In \LaTeX{} they are defined \cs{@onlypreamble}. So we use the \xpackage{ltxcmds} equivalents: +% \begin{macrocode} +\AfterEndPreamble{% + \let\@pkgextension\ltx@pkgextension + \let\@clsextension\ltx@clsextension + \let\@ifpackageloaded\ltx@ifpackageloaded + \let\@ifclassloaded\ltx@ifclassloaded +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\scr@load@hook} +% \begin{macrocode} +\renewrobustcmd*\scr@load@hook[2]{% + \csuse{#2-@#1}% + \ifcsname#2-@#1-\string\keep\endcsname\else\global\csundef{#2-@#1}\fi +}% \scr@load@hook +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\scr@set@load@hook (optimisation)} +% \begin{macrocode} +\renewrobustcmd*\scr@set@load@hook[2]{\csgappto{#2-@#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\BeforeFile} +% \begin{macro}{\AfterFile} +% +% Addition of star forms \stform*: the hooks are not canceled +% after \textt{input} (in case a file is input more than once...) +% +% \begin{macrocode} +\renewrobustcmd*\BeforeFile{\@ifstar + {\itf@s@LoadFile{before}} + {\itf@LoadFile{before}}% +}% \BeforeFile +\renewrobustcmd*\AfterFile{\@ifstar + {\itf@s@LoadFile{after}} + {\itf@LoadFile{after}}% +}% \AfterFile +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macrocode} +\def\itf@s@LoadFile#1#2{% + \global\cslet{#2-@#1-\string\keep}\@empty + \scr@set@load@hook{#1}{#2}% +}% \itf@s@LoadFile +\def\itf@LoadFile#1#2{% + \global\csundef{#2-@#1-\string\keep}% + \scr@set@load@hook{#1}{#2}% +}% \itf@LoadFile +% \end{macrocode} +% +% \begin{macro}{\@input (patch)} +% +% This modification allows \cs{@input} to behaves like \cs{InputIfFileExists} +% as far as hooks are concerned. \patchlabel{@input} +% +% \begin{macrocode} +\renewcommand*\@input[1]{\IfFileExists{#1} + {\scr@load@hook{before}{#1}% + \@@input\@filef@und + \scr@load@hook{after}{#1}}% + {\typeout{No file #1.}}% +}% \@input +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \sectionformat\subsection{bookmark/color*=copper} +% \Subsection[pgfkeys] +% +% \begin{macrocode} +%<*pgfkeys> +\ProvidesPackage{interfaces-pgfkeys} + [2011/02/19 v3.1 pgfkeys handlers definitions (FC)] +\RequirePackage{interfaces-base} +\ifdefined\pgfkeys@ifexecutehandler % pgf version 2.1 +\def\itf@pgfkeys{% + \global\let\pgfkeys@unpack \itf@pgfkeys@unpack + \global\let\pgfkeys@case@three \itf@pgfkeys@case@three + \global\let\pgfkeys@case@three@handleall\itf@pgfkeys@case@three@handleall +}% \itf@pgfkeys +\else +\def\itf@pgfkeys{% + \global\let\pgfkeys@unpack \itf@pgfkeys@unpack + \global\let\pgfkeys@case@three \itf@pgfkeys@case@three + \global\let\pgfkeysaddvalue \itf@pgfkeysaddvalue + \global\let\pgfkeys@exp@call \itf@pgfkeys@exp@call +}% \itf@pgfkeys +\fi +\AtBeginDocument{\itf@pgfkeys \let\itf@pgfkeys \relax} +% \end{macrocode} +% +% \paragraph{Some new pgfkeys macros} +% +% \begin{macro}{\pgfkeysmeaning} +% \begin{macrocode} +\providecommand*\pgfkeysmeaning[1]{\pgfkeysifdefined{#1} + {\expandafter\meaning\csname pgfk@#1\endcsname} + {\meaning\@undefined}% +}% \pgfkeysmeaning +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pgfkeysvalueof@unexpanded} +% \begin{macrocode} +\def\pgfkeysvalueof@unexpanded#1{% + \unexpanded\expandafter\expandafter\expandafter{% + \csname pgfk@#1\endcsname}% +}% \pgfkeysvalueof@unexpanded +% \end{macrocode} +% \end{macro} +% +% \paragraph{Some pgfkeys macros redefinition/corrections} +% +% \begin{macro}{\pgfkeysaddvalue (bug correction)} +% +% Bug in \cs{pgfkeysaddvalue} for pgf v2.0, fixed in v2.1 +% +% \begin{macrocode} +\ifdefined\pgfkeys@ifexecutehandler \else % pgf v2.1: bug fixed +\def\itf@pgfkeysaddvalue#1#2#3{% (pgf v2.0: bug in pgfkeys.code.tex) + \edef\pgfkeys@global@temp{% + \unexpanded{#2}% + \ifcsname pgfk@#1\endcsname + \unexpanded\expandafter\expandafter\expandafter{% + \csname pgfk@#1\endcsname}% + \fi + \unexpanded{#3}}% + \pgfkeyslet{#1}\pgfkeys@global@temp +}% \itf@pgfkeysaddvalue +\fi +% \end{macrocode} +% +% +% \begin{macro}{\pgfkeysEsetvalue} +% \begin{macro}{\pgfkeysEaddvalue} +% \begin{macrocode} +\ifdefined\pgfkeys@ifexecutehandler \long \fi % pgf version 2.1 +\def\pgfkeysEsetvalue#1#2{% + \expandafter\edef\csname pgfk@#1\endcsname{#2}% +}% \pgfkeysEsetvalue +\ifdefined\pgfkeys@ifexecutehandler \long \fi % pgf v2.1 +\def\pgfkeysEaddvalue#1#2#3{% \csepreappto{pgfk@#1}{#2}{#3} + \edef\pgfkeys@global@temp{% + #2% + \ifcsname pgfk@#1\endcsname + \unexpanded\expandafter\expandafter\expandafter{% + \csname pgfk@#1\endcsname}% + \fi + #3}% + \pgfkeyslet{#1}\pgfkeys@global@temp +}% \pgfkeysEaddvalue +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\pgfkeys@exp@call} +% +% Missed the braces around the argument (in case the argument contains a comma or an $=$ sign...): +% +% \begin{macrocode} +%% missed a pair of braces around the argument in pgfkeys.code.tex (pgf v2.0) +%% ( the code could break if it contains = or , ) +\ifdefined\pgfkeys@ifexecutehandler\else % (bug corrected in pgf v2.1) + \def\itf@pgfkeys@exp@call#1{\pgfkeysalso{\pgfkeyscurrentpath={#1}}}% +\fi +% \end{macrocode} +% \end{macro} +% +% \paragraph(/.blank){Handlers \handler/.blank/} +% \patchlabel[redef]{pgfkeys@unpack} +% \begin{macrocode} +%% The value is now checked by \itf@pgfkeys@default@blank@required: +\ifdefined\pgfkeys@ifexecutehandler \long \fi % pgf v2.1 +\def\itf@pgfkeys@unpack#1=#2=#3\pgfkeys@stop{% + \pgfkeys@spdef\pgfkeyscurrentkey{#1}% + \edef\pgfkeyscurrentkey{\pgfkeyscurrentkey}% + \ifx\pgfkeyscurrentkey\pgfkeys@empty + % Skip + \else% + \pgfkeys@add@path@as@needed + \pgfkeys@spdef\pgfkeyscurrentvalue{#2}% + \itf@pgfkeys@default@blank@required % + \pgfkeyscurrentkey % + \pgfkeys@case@one % + \fi +}% \itf@pgfkeys@unpack +% \end{macrocode} +% +% \begin{macro}{\itf@pgfkeys@default@blank@required} +% +% \hskip4cm Handle the case: \handler/.@def/ \smex \handler/.@blank/ \smex \handler/.@def/ ... +% +% \begin{macrocode} +\def\itf@pgfkeys@default@blank@required#1#2{% + \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text% Hmm... no value + \pgfkeysifdefined{#1/.@def}% + {\pgfkeysgetvalue{#1/.@def}\pgfkeyscurrentvalue} + {}% no default, so leave it + \fi + \ifx\pgfkeyscurrentvalue\@empty + \pgfkeysifdefined{#1/.@blank} + {\pgfkeysgetvalue{#1/.@blank}\pgfkeyscurrentvalue} + {}% no /.blank specified + \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text% in case /.blank -> \pgfkeysnovalue + \pgfkeysifdefined{#1/.@def}% + {\pgfkeysgetvalue{#1/.@def}\pgfkeyscurrentvalue} + {}% no default, so leave it + \fi\fi + \ifx\pgfkeyscurrentvalue\pgfkeysvaluerequired + \pgfkeysvalueof{/errors/value required/.@cmd}\pgfkeyscurrentkey + \pgfkeyscurrentvalue + \pgfeov + \else + #2% + \fi +}% \itf@pgfkeys@default@blank@required +% \end{macrocode} +% \end{macro} +% +% \paragraph(/.default){Allowing \handler/.default/ values (and \handler/.blank/ values) for handlers:} +% \patchlabel{pgfkeys@case@three} +% +% \begin{macrocode} +%% To handle the cases of: /handler/.default= /handler/.blank= /handler/.value required, +%% it is necessary to redefine \pgfkeys@case@three +\def\itf@pgfkeys@case@three{% + \pgfkeys@split@path + \pgfkeysifdefined{/handlers/\pgfkeyscurrentname/.@cmd} + {% + \itf@pgfkeys@default@blank@required{/handlers/\pgfkeyscurrentname}% + {\pgfkeysgetvalue{/handlers/\pgfkeyscurrentname/.@cmd}\pgfkeys@code + \expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov}% + } + \pgfkeys@unknown % no handler, thus the key is unknown +}% \itf@pgfkeys@case@three +\ifdefined\pgfkeys@ifexecutehandler + \let\itf@pgfkeys@case@three@handleall \itf@pgfkeys@case@three +\fi +% \end{macrocode} +% +% \bookmarksetup{disable*} +% \paragraph{Loading interfaces modifications for pgfkeys} +% +% \begin{macrocode} +\itf@pgfkeys +% \end{macrocode} +% +% \paragraph(/.alias){Handler definition: \handler/.alias/, \handler/.blank/} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.alias/.code=\itf@pgfkeys@ifaliasexists{#1}{% + \pgfkeysedef\pgfkeyscurrentpath{% + \noexpand\pgfkeysalso{\pgfkeysdefaultpath#1={##1}}}},% + /handlers/.alias/.value required,% + /handlers/.blank/.code=\pgfkeyssetvalue{\pgfkeyscurrentpath/.@blank}{#1},% + /handlers/.blank/.default=\pgfkeysnovalue,% +}% /.alias and /.blank +\def\itf@pgfkeys@ifaliasexists#1#2{% + \pgfkeysifdefined{\pgfkeysdefaultpath#1/.@cmd}{#2} + {\pgfkeysifdefined{\pgfkeysdefaultpath#1} + {#2} + {\itf@pgfkeys@aliaserror{#1}}}% +}% \itf@pgfkeys@ifaliasexists +\def\itf@pgfkeys@aliaserror#1{% + \PackageError{interfaces-pgfkeys} + {You want the key \pgfkeyscurrentpath\space + \MessageBreak to be an alias for \pgfkeysdefaultpath#1 + \MessageBreak but the key \pgfkeysdefaultpath#1 + \MessageBreak is not defined!}\@eha\@gobble +}% \itf@pgfkeys@aliaserror +% \end{macrocode} +% +% \paragraph(/.alias*){Handler definition: \handler/.alias*/} +% +% For use with handlers \handler/.store as glue/ or \handler/.store as glue in cs/ \etc. when a handler +% defines key with \stform* version and/or \stform+ version and/or \stform- versions. +% +% Then, the \handler/.alias*/ handler is a facility to create aliases for starred \stform*, \stform+, \stform- +% keys in a batch (as long as the alias exists, of course). +% +% \begin{macrocode} +\pgfkeys{ + /handlers/.alias*/.code=\itf@pgfkeys@ifaliasexists{#1}{% + \pgfkeysedef\pgfkeyscurrentpath{\noexpand\pgfkeysalso{\pgfkeysdefaultpath#1={##1}}}% + \@tfor\x:=+-*\do{% + \pgfkeysifdefined{\pgfkeysdefaultpath#1\x/.@cmd} + {\pgfkeysedef{\pgfkeyscurrentpath\x}{% + \noexpand\pgfkeysalso{\pgfkeysdefaultpath#1\x={##1}}}} + {}% + }},% + /handlers/.alias*/.value required,% +}% /.alias* +% \end{macrocode} +% +% \paragraph(/.is private){Handler definition: \handler/.is private/} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.is private/.code=\pgfkeysdef\pgfkeyscurrentpath{% + \PackageError{#1}{Key \pgfkeyscurrentkey\space is private + \MessageBreak and should not be modified}\@ehd},% + /handlers/.is private to class/.code=\pgfkeysdef\pgfkeyscurrentpath{% + \ClassError{#1}{Key \pgfkeyscurrentkey\space is private + \MessageBreak and should not be modified}\@ehd}% +}% /.is private +% \end{macrocode} +% +% +% \paragraph(/.true){Handlers definition: \handler/.true/ \handler/.false/ \handler/.on/ \handler/.off/} +% +% \begin{macrocode} +\def\itf@pgfkeys@choice[#1]#2#3{% + \pgfkeys{\pgfkeyscurrentpath/.cd,% + .is choice,% + #2/.code={#3},% + .default/.expanded=\@firstoftwo#1}% +}% \itf@pgfkeys@choice +\pgfkeys{% + /handlers/.true/.code=\itf@pgfkeys@choice[{true}{false}]{true}{#1},% + /handlers/.false/.code=\itf@pgfkeys@choice[{true}{false}]{false}{#1},% + /handlers/.on/.code=\itf@pgfkeys@choice[{on}{off}]{on}{#1},% + /handlers/.off/.code=\itf@pgfkeys@choice[{on}{off}]{off}{#1},% +}% /.true /.false +% \end{macrocode} +% +% \paragraph(/.store in cs, /.estore in cs){Handlers definition: \handler/.store in cs/ \handler/.estore in cs/ etc.} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.store in cs/.code=\pgfkeysdef\pgfkeyscurrentpath{\csdef{#1}{##1}},% + /handlers/.estore in cs/.code=\pgfkeysdef\pgfkeyscurrentpath{\csedef{#1}{##1}},% +}% /.store in cs +% \end{macrocode} +% +% \paragraph(/.store as code){Handler definition: \handler/.store as code/} +% +% \begin{macrocode} +%% /.store as code handlers +\pgfkeys{% + /handlers/.store as code/.code={% + \pgfkeysedef\pgfkeyscurrentpath{% + \noexpand\pgfkeyslet{\pgfkeyscurrentpath}\noexpand\pgfkeyscurrentvalue}% + \pgfkeyslet\pgfkeyscurrentpath\@empty + \pgfkeyslet{\pgfkeyscurrentpath/.@def}\@empty + \@tfor\x:=#1\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \noexpand\pgfkeysalso{\pgfkeyscurrentpath/.expanded={% + \noexpand\pgfkeysvalueof@unexpanded{\pgfkeyscurrentpath}% + \noexpand\unexpanded{##1}}}}% + \pgfkeyslet{\pgfkeyscurrentpath\x/.@def}\@empty + }},% + /handlers/.store as code/.default=*+,% +}% /.store as code +% \end{macrocode} +% +% \paragraph(/.estore as code){Handler definition: \handler/.estore as code/} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.estore as code/.code={% + \pgfkeysedef\pgfkeyscurrentpath{% + \noexpand\pgfkeysEsetvalue{\pgfkeyscurrentpath}{##1}}% + \pgfkeyslet\pgfkeyscurrentpath\@empty + \@tfor\x:=#1\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \noexpand\pgfkeysalso{\pgfkeyscurrentpath/.expanded={% + \noexpand\pgfkeysvalueof@unexpanded{\pgfkeyscurrentpath}% + \noexpand\unexpanded{##1}}}}% + }},% + /handlers/.estore as code/.default=*+,% +}% /.estore as code +% \end{macrocode} +% +% \paragraph(/.store as code in cs){Handler definition: \handler/.store as code in cs/\csuse{=cs-name}} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.store as code in cs/.code={% + \pgfkeysdef\pgfkeyscurrentpath{% + \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text + \else\csdef{#1}{##1}\fi}% + \@tfor\x:=*+\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \noexpand\pgfkeysalso{\pgfkeyscurrentpath/.expanded={% + \noexpand\ifcsname#1\endcsname + \noexpand\expandafter\noexpand\expandonce + \noexpand\csname#1\endcsname + \noexpand\fi + \noexpand\unexpanded{##1}}}}% + \pgfkeyslet{\pgfkeyscurrentpath\x/.@def}\@empty + }},% + /handlers/.store as code in cs/.value required,% +}% /.store as code in cs +\pgfkeys{% + /handlers/.estore as code in cs/.code={% + \pgfkeysdef\pgfkeyscurrentpath{% + \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text + \else\csedef{#1}{##1}\fi}% + \@tfor\x:=*+\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \noexpand\pgfkeysalso{\pgfkeyscurrentpath/.expanded={% + \noexpand\ifcsname#1\endcsname + \noexpand\expandafter\noexpand\expandonce + \noexpand\csname#1\endcsname + \noexpand\fi + \noexpand\unexpanded{##1}}}}% + }},% default if \pgfkeysnovalue which expands to \@empty + /handlers/.estore as code in cs/.value required,% +}% /.estore as code in cs +% \end{macrocode} +% +% \paragraph(/.store as color){Handler definition: \handler/.store as color/} +% +% \begin{macrocode} +\protected\def\itf@pgfk@color#1#2\@nil{% + \ifx\@let@token\color + \def\pgfkeyscurrentvalue{#2}% + \else\ifx\@let@token\normalcolor + \def\pgfkeyscurrentvalue{default}% + \else\ifx\@let@token\pgfkeysnovalue + \def\pgfkeyscurrentvalue{default}% + \fi\fi\fi +}% \itf@pgfk@color +\pgfkeys{% + /handlers/.store as color/.code=% + \pgfkeysedef\pgfkeyscurrentpath{% + \futurelet\noexpand\@let@token\itf@pgfk@color + ##1\noexpand\pgfkeysnovalue\noexpand\@nil + \noexpand\pgfkeyslet{\pgfkeyscurrentpath}\noexpand\pgfkeyscurrentvalue}% +}% /.store as color +% \end{macrocode} +% +% \paragraph(/.store as color in cs){Handler definition: \handler/.store as color in cs/\csuse{=cs-name}} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.store as color in cs/.code=% + \pgfkeysedef\pgfkeyscurrentpath{% + \futurelet\noexpand\@let@token\itf@pgfk@color + ##1\noexpand\pgfkeysnovalue\noexpand\@nil + \cslet{#1}\noexpand\pgfkeyscurrentvalue}% +}% /.store as color in cs +% \end{macrocode} +% +% \paragraph(/.store as color command){Handler definition: \handler/.store as color command/} +% +% \begin{macrocode} +\protected\def\itf@pgfk@colorcmd#1\@nil{% + \ifcat @\noexpand\@let@token + \def\pgfkeyscurrentvalue{\color{#1}}% + \else\ifcat 0\noexpand\@let@token + \def\pgfkeyscurrentvalue{\color{#1}}% + \else\ifx\@let@token\@nil + \let\pgfkeyscurrentvalue\normalcolor + \fi\fi\fi +}% \itf@pgfk@colorcmd +\pgfkeys{% + /handlers/.store as color command/.code=% + \pgfkeysedef\pgfkeyscurrentpath{% + \futurelet\noexpand\@let@token\itf@pgfk@colorcmd + ##1\noexpand\@nil + \noexpand\pgfkeyslet{\pgfkeyscurrentpath}\noexpand\pgfkeyscurrentvalue}% + \pgfkeyssetvalue{\pgfkeyscurrentpath/.@def}\normalcolor +}% /.store as color command +% \end{macrocode} +% +% \paragraph(/.store as color command in cs){Handler definition: \handler/.store as color command in cs/\csuse{=cs-name}} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.store as color command in cs/.code=% + \pgfkeysedef\pgfkeyscurrentpath{% + \futurelet\noexpand\@let@token\itf@pgfk@colorcmd + ##1\noexpand\@nil + \cslet{#1}\noexpand\pgfkeyscurrentvalue}% + \pgfkeyssetvalue{\pgfkeyscurrentpath/.@def}\normalcolor +}% /.store as color command in cs +% \end{macrocode} +% +% \paragraph(/.store as number){Handler definition \handler/.store as number/} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.store as number/.code={% + \pgfkeysedef\pgfkeyscurrentpath{% + \noexpand\pgfkeyssetvalue{\pgfkeyscurrentpath}{\numexpr##1\relax}}% + \pgfkeyslet\pgfkeyscurrentpath\z@ + \pgfkeyslet{\pgfkeyscurrentpath/.@def}\z@ + \pgfkeyslet{\pgfkeyscurrentpath/.@blank}\z@ + \@tfor\x:=#1\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \noexpand\pgfkeysalso{\pgfkeyscurrentpath/.expanded=% + \noexpand\pgfkeysvalueof@unexpanded{\pgfkeyscurrentpath}% + \x + \numexpr\unexpanded{##1}\relax}}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@def}{\if*\x\@ne\else\z@\fi}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@blank}{\if*\x\@ne\else\z@\fi}% + }},% + /handlers/.store as number/.default=+-*,% +}% /.store as number +% \end{macrocode} +% +% \paragraph{/.store as number in cs}{Handler definition: \handler/.store as number in cs/} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.store as number in cs/.code={% + \pgfkeysdef\pgfkeyscurrentpath{% + \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text + \else\csdef{#1}{\numexpr##1\relax}\fi}% + \pgfkeyslet{\pgfkeyscurrentpath/.@blank}\z@ + \@tfor\x:=+-*\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \letcs\noexpand\pgfkeys@temp{% + \noexpand\ifcsname#1\endcsname + #1\noexpand\else\if*\x @ne\else z@\fi\noexpand\fi}% + \edef\noexpand\pgfkeys@temp{% + \noexpand\pgfkeysalso{\pgfkeyscurrentpath={% + \noexpand\expandonce\noexpand\pgfkeys@temp + \x + \numexpr\noexpand\unexpanded{##1}\relax}}% + }\noexpand\pgfkeys@temp}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@def}{\if*\x\@ne\else\z@\fi}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@blank}{\if*\x\@ne\else\z@\fi}% + }},% + /handlers/.store as number in cs/.value required,% +}% /.store as number in cs +% \end{macrocode} +% +% \paragraph(/.estore as number){Handler definition: \handler/.estore as number/} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.estore as number/.code={% + \pgfkeysedef\pgfkeyscurrentpath{% + \noexpand\pgfkeyssetvalue{\pgfkeyscurrentpath}{% + \noexpand\number\numexpr##1\relax}}% + \pgfkeyslet\pgfkeyscurrentpath\z@ + \pgfkeyslet{\pgfkeyscurrentpath/.@def}\z@ + \pgfkeyslet{\pgfkeyscurrentpath/.@blank}\z@ + \@tfor\x:=#1\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \noexpand\pgfkeysalso{\pgfkeyscurrentpath=% + \noexpand\pgfkeysvalueof{\pgfkeyscurrentpath}% + \x + \numexpr##1\relax}}% + }},% + /handlers/.estore as number/.default=+-*,% +}% /.estore as number +% \end{macrocode} +% +% \paragraph(/.estore as number in cs){Handler definition: \handler/.estore as number in cs/} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.estore as number in cs/.code={% + \pgfkeysdef\pgfkeyscurrentpath{% + \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text + \else\csedef{#1}{\number\numexpr##1\relax}\fi}% + \pgfkeyslet{\pgfkeyscurrentpath/.@blank}\z@ + \@tfor\x:=+-*\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \noexpand\pgfkeysalso{\pgfkeyscurrentpath=% + \noexpand\csname\noexpand\ifcsname#1\endcsname + #1\noexpand\else\if*\x @ne\else z@\fi\noexpand\fi\endcsname + \x + \numexpr##1\relax}}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@def}{\if*\x\@ne\else\z@\fi}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@blank}{\if*\x\@ne\else\z@\fi}% + }},% + /handlers/.estore as number in cs/.value required,% +}% /.estore as number in cs +% \end{macrocode} +% +% \paragraph(/.store in counter cs){Handler definition: \handler/.store in counter cs/} +% +% \handler/.store in count cs/ is exactly the same. +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.store in counter cs/.code={% + \pgfkeysdef\pgfkeyscurrentpath{% + \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text + \else\csname#1\endcsname\numexpr##1\relax\fi}% + \pgfkeyslet{\pgfkeyscurrentpath/.@blank}\z@ + \@tfor\x:=+-*\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \noexpand\pgfkeysalso{\pgfkeyscurrentpath=% + \noexpand\csname\noexpand\ifcsname#1\endcsname + #1\noexpand\else\if*\x @ne\else z@\fi\noexpand\fi\endcsname + \x + \numexpr##1\relax}}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@def}{\if*\x\@ne\else\z@\fi}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@blank}{\if*\@ne\else\z@\fi}% + }},% + /handlers/.store in counter cs/.value required,% +}% /.store in counter cs +\pgfkeys{% + /handlers/.store in count cs/.code={% + \pgfkeysdef\pgfkeyscurrentpath{% + \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text + \else\csname#1\endcsname\numexpr##1\relax\fi}% + \pgfkeyslet{\pgfkeyscurrentpath/.@blank}\z@ + \@tfor\x:=+-*\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \noexpand\pgfkeysalso{\pgfkeyscurrentpath=% + \noexpand\csname\noexpand\ifcsname#1\endcsname + #1\noexpand\else\if*\x @ne\else z@\fi\noexpand\fi\endcsname + \x + \numexpr##1\relax}}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@def}{\if*\x\@ne\else\z@\fi}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@blank}{\if*\@ne\else\z@\fi}% + }},% + /handlers/.store in count cs/.value required,% +}% /.store in count cs +% \end{macrocode} +% +% \paragraph(/.store as glue){Handlers definition: \handler/.store as glue/} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.store as glue/.code={% + \pgfkeysedef\pgfkeyscurrentpath{% + \noexpand\pgfkeyssetvalue{\pgfkeyscurrentpath}{\glueexpr##1\relax}}% + \pgfkeyslet\pgfkeyscurrentpath\z@skip + \pgfkeyslet{\pgfkeyscurrentpath/.@def}\z@skip + \pgfkeyslet{\pgfkeyscurrentpath/.@blank}\z@skip + \@tfor\x:=#1\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \noexpand\pgfkeysalso{\pgfkeyscurrentpath/.expanded=% + \noexpand\pgfkeysvalueof@unexpanded{\pgfkeyscurrentpath}% + \x + \if*\x\noexpand\itf@units@scaleNoCalc##1! + \else\glueexpr\noexpand\unexpanded{##1}\relax\fi}}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@def}{\if*\x\@ne\else\z@skip\fi}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@blank}{\if*\x\@ne\else\z@skip\fi}% + }},% + /handlers/.store as glue/.default=+-*,% +}% /.store as glue +% \end{macrocode} +% +% \paragraph(/.store as glue in cs){Handlers definition: \handler/.store as glue in cs/\csuse{=cs-name}} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.store as glue in cs/.code={% + \pgfkeysdef\pgfkeyscurrentpath{% + \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text + \else\csdef{#1}{\glueexpr##1\relax}\fi}% + \pgfkeyslet{\pgfkeyscurrentpath/.@blank}\z@skip + \@tfor\x:=+-*\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \letcs\noexpand\pgfkeys@temp{% + \noexpand\ifcsname#1\endcsname + #1\noexpand\else z@skip\noexpand\fi}% + \edef\noexpand\pgfkeys@temp{% + \noexpand\noexpand\noexpand\pgfkeysalso{\pgfkeyscurrentpath={% + \noexpand\expandonce\noexpand\pgfkeys@temp + \x + \if*\x\noexpand\itf@units@scaleNoCalc##1! + \else\glueexpr\noexpand\unexpanded{##1}\relax\fi}}% + }\noexpand\pgfkeys@temp}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@def}{\if*\x\@ne\else\z@skip\fi}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@blank}{\if*\x\@ne\else\z@skip\fi}% + }},% + /handlers/.store as glue in cs/.value required,% +}% /.store as glue in cs +% \end{macrocode} +% +% \paragraph(/.estore as glue){Handlers definition: \handler/.estore as glue/} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.estore as glue/.code={% + \pgfkeysedef{\pgfkeyscurrentpath}{% + \itf@setlength\itf@sk{##1}% + \noexpand\pgfkeysEsetvalue{\pgfkeyscurrentpath}{% + \noexpand\the\itf@sk}}% + \pgfkeyslet\pgfkeyscurrentpath\z@skip + \pgfkeyslet{\pgfkeyscurrentpath/.@def}\z@skip + \pgfkeyslet{\pgfkeyscurrentpath/.@blank}\z@skip + \@tfor\x:=#1\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \noexpand\pgfkeysalso{\pgfkeyscurrentpath=% + \noexpand\pgfkeysvalueof{\pgfkeyscurrentpath}\x + \if*\x \noexpand\itf@units@scale##1! + \else\glueexpr##1\relax\fi}}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@def}{\if*\x\@ne\else\z@skip\fi}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@blank}{\if*\x\@ne\else\z@skip\fi}% + }},% + /handlers/.estore as glue/.default=+-*,% +}% /.estore as glue +% \end{macrocode} +% +% \paragraph(/.estore as glue in cs){Handlers definition: \handler/.estore as glue in cs/\csuse{=cs-name}} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.estore as glue in cs/.code={% + \pgfkeysdef\pgfkeyscurrentpath{% + \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text + \else\itf@setlength\itf@sk{##1}% + \csedef{#1}{\the\itf@sk}\fi}% + \pgfkeyslet{\pgfkeyscurrentpath/.@blank}\z@skip + \@tfor\x:=+-*\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \noexpand\pgfkeysalso{\pgfkeyscurrentpath=% + \noexpand\csname\noexpand\ifcsname#1\endcsname + #1\noexpand\else z@skip\noexpand\fi\endcsname + \x + \if*\x\noexpand\itf@units@scale##1! + \else\glueexpr##1\relax\fi}}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@def}{\if*\x\@ne\else\z@skip\fi}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@blank}{\if*\x\@ne\else\z@skip\fi}% + }},% + /handlers/.etore as glue in cs/.value required,% +}% /.estore as glue in cs +% \end{macrocode} +% +% \paragraph(/.store in skip cs){Handlers definition: \handler/.store in skip cs/} +% +% This is a variant of \handler/.estore as glue in cs/ when the control sequence in a \cs{skip} (\ie a length). +% The skip is given by its name, not as a control sequence. +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.store in skip cs/.code={% + \pgfkeysdef\pgfkeyscurrentpath{% + \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text + \else\expandafter\itf@setlength\csname#1\endcsname{##1}\fi}% + \pgfkeyslet{/\pgfkeyscurrentpath/.@blank}\z@skip + \@tfor\x:=+-*\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \noexpand\pgfkeysalso{\pgfkeyscurrentpath=% + \csname#1\endcsname % should have been defined as a skip (not expandable) + \x + \if*\x\noexpand\itf@units@scale##1! + \else\glueexpr##1\relax\fi}}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@def}{\if*\x\@ne\else\z@skip\fi}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@blank}{\if*\x\@ne\else\z@skip\fi}% + }},% + /handlers/.store in skip cs/.value required,% +}% /.store in skip cs +% \end{macrocode} +% +% \paragraph(/.store as dimen){Handlers definition: \handler/.store as dimen/} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.store as dimen/.code={% + \pgfkeysedef\pgfkeyscurrentpath{% + \noexpand\pgfkeyssetvalue{\pgfkeyscurrentpath}{\dimexpr##1\relax}}% + \pgfkeyslet\pgfkeyscurrentpath\z@ + \pgfkeyslet{\pgfkeyscurrentpath/.@def}\z@ + \pgfkeyslet{\pgfkeyscurrentpath/.@blank}\z@ + \@tfor\x:=#1\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \noexpand\pgfkeysalso{\pgfkeyscurrentpath/.expanded={% + \noexpand\pgfkeysvalueof@unexpanded{\pgfkeyscurrentpath}% + \x + \if*\x \noexpand\itf@units@scaleNoCalc##1! + \else\dimexpr\noexpand\unexpanded{##1}\relax\fi}}}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@def}{\if*\x\@ne\else\z@\fi}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@blank}{\if*\x\@ne\else\z@\fi}% + }},% + /handlers/.store as dimen/.default=+-*,% +}% /.store as dimen +% \end{macrocode} +% +% \paragraph(/.store as dimen in cs){Handlers definition: \handler/.store as dimen in cs/\csuse{=cs-name}} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.store as dimen in cs/.code={% + \pgfkeysdef\pgfkeyscurrentpath{% + \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text + \else\csdef{#1}{\dimexpr##1\relax}\fi}% + \pgfkeyslet{\pgfkeyscurrentpath/.@blank}\z@ + \@tfor\x:=+-*\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \letcs\noexpand\pgfkeys@temp{% + \noexpand\ifcsname#1\endcsname + #1\noexpand\else z@\noexpand\fi}% + \edef\noexpand\pgfkeys@temp{% + \noexpand\noexpand\noexpand\pgfkeysalso{\pgfkeyscurrentpath={% + \noexpand\expandonce\noexpand\pgfkeys@temp + \x + \if*\x\noexpand\itf@units@scaleNoCalc##1! + \else\dimexpr\noexpand\unexpanded{##1}\relax\fi}}% + }\noexpand\pgfkeys@temp}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@def}{\if*\x\@ne\else\z@\fi}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@blank}{\if*\x\@ne\else\z@\fi}% + }},% + /handlers/.store as dimen in cs/.value required,% +}% /.store as dimen in cs {csname}{+-*} +% \end{macrocode} +% +% \paragraph(/.estore as dimen){Handlers definition: \handler/.estore as dimen/} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.estore as dimen/.code={% + \pgfkeysedef\pgfkeyscurrentpath{% + \itf@setlength\itf@sk{##1}% + \noexpand\pgfkeysEsetvalue{\pgfkeyscurrentpath}{% + \noexpand\the\dimexpr\itf@sk}}% + \pgfkeyslet\pgfkeyscurrentpath\z@ + \pgfkeyslet{\pgfkeyscurrentpath/.@def}\z@ + \pgfkeyslet{\pgfkeyscurrentpath/.@blank}\z@ + \@tfor\x:=#1\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \noexpand\pgfkeysalso{\pgfkeyscurrentpath=% + \noexpand\pgfkeysvalueof{\pgfkeyscurrentpath}\x + \if*\x \noexpand\itf@units@scale##1! + \else \dimexpr##1\relax\fi}}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@def}{\if*\x\@ne\else\z@\fi}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@blank}{\if*\x\@ne\else\z@\fi}% + }},% + /handlers/.estore as dimen/.default=+-*,% +}% /.estore as dimen +% \end{macrocode} +% +% +% \paragraph(/.estore as dimen in cs){Handlers definition: \handler/.estore as dimen in cs/\csuse{=cs-name}} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.estore as dimen in cs/.code={% + \pgfkeysdef\pgfkeyscurrentpath{% + \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text + \else \itf@setlength\itf@sk{##1}% + \csedef{#1}{\the\dimexpr\itf@sk}\fi}% + \pgfkeyslet{\pgfkeyscurrentpath/.@blank}\z@ + \@tfor\x:=+-*\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \noexpand\ifcsname#1\endcsname + \noexpand\@defaultunits \itf@sk + \noexpand\csname#1\endcsname pt\relax\noexpand\@nnil + \noexpand\else \itf@sk \z@ \noexpand\fi + \if*\x + \itf@setlength\itf@sk {\itf@sk*\noexpand\itf@units@scale##1!}% + \else + \noexpand\@defaultunits\@tempdima ##1pt \relax\noexpand\@nnil + \advance\itf@sk\x \@tempdima + \fi + \noexpand\pgfkeysalso{\pgfkeyscurrentpath=\itf@sk}}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@def}{\if*\x\@ne\else\z@\fi}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@blank}{\if*\x\@ne\else\z@\fi}% + }},% + /handlers/.etore as dimen in cs/.value required,% +}% /.estore as dimen in cs +% \end{macrocode} +% +% \paragraph(/.store in dimen cs){Handlers definition: \handler/.store in dimen cs/} +% +% This is a variant of \handler/.store as dimen in cs/ when the control sequence in a \cs{dimen}. +% The dimen is given by its name, not as a control sequence. +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.store in dimen cs/.code={% + \pgfkeysdef\pgfkeyscurrentpath{% + \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text + \else\expandafter\itf@setlength\csname#1\endcsname{##1}\fi}% + \pgfkeyslet{/\pgfkeyscurrentpath/.@blank}\z@ + \@tfor\x:=+-*\do{% + \pgfkeysedef{\pgfkeyscurrentpath\x}{% + \if*\x \else + \noexpand\@defaultunits\itf@sk ##1pt \relax\noexpand\@nnil + \fi + \noexpand\pgfkeysalso{\pgfkeyscurrentpath=% + \csname#1\endcsname % has been defined as a dimen (not expandable) + \x + \if*\x \noexpand\itf@units@scale##1! + \else\itf@sk\fi}}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@def}{\if*\x\@ne\else\z@\fi}% + \pgfkeysEsetvalue{\pgfkeyscurrentpath\x/.@blank}{\if*\x\@ne\else\z@\fi}% + }},% + /handlers/.store in dimen cs/.value required,% +}% /.store in dimen cs +% \end{macrocode} +% +% \paragraph(/.is multiple choice){Handlers definition: \handler/.is multiple choice/} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.is multiple choice/.code=% + \pgfkeys{\pgfkeyscurrentpath/.cd,% + .unknown/.style={% + /errors/unknown choice value=\pgfkeyscurrentkey\pgfkeyscurrentvalue},% + .code=\expandafter\pgfkeys\expandafter{\pgfkeyscurrentkey/.cd,####1}% + },% + /handlers/.is multiple choice/.value forbidden,% +}% /.is multiple choice +% \end{macrocode} +% +% \paragraph(/.is enum){Handlers definition: \handler/.is enum/} +% \begin{macrocode} +\pgfkeys{% + /handlers/.is enum/.code={% + \itf@cnt\z@ + \@for\x:=\pgfkeyscurrentvalue\do{% + \pgfkeysedef{\pgfkeyscurrentpath/\x}{% + \noexpand\pgfkeyssetvalue{\pgfkeyscurrentpath}{\x}% + \noexpand\pgfkeyssetvalue{\pgfkeyscurrentpath/.number}{\the\itf@cnt}}% + \ifnum\itf@cnt=\z@ + \pgfkeyslet{\pgfkeyscurrentpath/.@def}\x + \pgfkeyslet{\pgfkeyscurrentpath/.@blank}\x + \fi + \advance\itf@cnt\@ne + }% + \pgfkeysalso{\pgfkeyscurrentpath/.is choice}},% + /handlers/.is enum/.value required,% +}% /.is enum +% \end{macrocode} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Subsection[etoolbox] +% +% \begin{macrocode} +%<*etoolbox> +\ProvidesPackage{interfaces-etoolbox} + [2011/02/19 v3.1 more etoolbox-like commands (FC)] +\RequirePackage{interfaces-base} +\begingroup\catcode`\&=3 + \long\gdef\etb@doitem#1&{\do{#1}} +\endgroup +% \end{macrocode} +% +% \begin{macro}{\preappto} +% \begin{macro}{\epreappto} +% \begin{macro}{\gpreappto} +% \begin{macro}{\xpreappto} +% \begin{macrocode} +\providerobustcmd\preappto[3]{% + \edef#1{\unexpanded{#2}\ifdefined#1\expandonce#1\fi\unexpanded{#3}}% +}% \preappto +\providerobustcmd\epreappto[3]{% + \edef#1{#2\ifdefined#1\expandonce#1\fi#3}% +}% \epreappto +\providerobustcmd*\gpreappto{\global\preappto} +\providerobustcmd*\xpreappto{\global\epreappto} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\cspreappto} +% \begin{macro}{\csepreappto} +% \begin{macro}{\csgpreappto} +% \begin{macro}{\csxpreappto} +% \begin{macrocode} +\providerobustcmd*\cspreappto[1]{% + \csname itf@\ifcsname#1\endcsname + preappto\else defpreapp\fi\expandafter\endcsname + \csname#1\endcsname +}% \cspreappto +\long\def\itf@preappto#1#2#3{\edef#1{#2\expandonce#1#3}} +\long\def\itf@defpreapp#1#2#3{\edef#1{#2#3}} +\providerobustcmd*\csepreappto[1]{% + \csname itf@\ifcsname#1\endcsname + preappto\else defpreapp\fi\expandafter\endcsname + \csname#1\endcsname +}% \csepreappto +\providerobustcmd*\csgpreappto{\global\cspreappto} +\providerobustcmd*\csxpreappto{\global\csepreappto} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\removefrom} +% \begin{macro}{\eremovefrom} +% \begin{macro}{\gremovefrom} +% \begin{macro}{\xremovefrom} +% \begin{macrocode} +\providerobustcmd\removefrom[2]{\in@false + \long\def\itf@tp##1\itf@tp{% + \in@true + \edef#1{\unexpanded{##1}}% + }\expandafter\itf@removefrom\expandafter{#1}{#2}% +}% \removefrom +\providerobustcmd\eremovefrom[2]{\begingroup + \edef\x{\endgroup\removefrom\noexpand#1{#2}% + }\x +}% \eremovefrom +\providerobustcmd\gremovefrom[2]{% + \removefrom{#1}{#2}% + \global\let#1=#1% +}% \gremovefrom +\providerobustcmd\xremovefrom[2]{% + \eremovefrom{#1}{#2}% + \global\let#1=#1% +}% \xremovefrom +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\itf@removefrom} +% \begin{macrocode} +\long\def\itf@removefrom#1#2{% removes #2 (code) from #1 (hook) + \def\in@@##1#2##2\in@@{\itf@tp##1##2\in@@@}% + \def\in@@@##1\in@@@##2\in@@@{% + \ifx\in@##2\else##1\fi + }\expandafter\in@@@\in@@#1\itf@tp\in@@@#2\in@\in@@ +}% \itf@removefrom +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\removefromstart} +% \begin{macro}{\eremovefromstart} +% \begin{macro}{\gremovefromstart} +% \begin{macro}{\xremovefromstart} +% \begin{macrocode} +\newrobustcmd\removefromstart[2]{\in@false + \long\def\itf@tp##1\itf@tp{% + \in@true + \edef#1{\unexpanded{##1}}% + }\expandafter\itf@removefromstart\expandafter{#1}{#2}% +}% \removefromstart +\providerobustcmd\eremovefromstart[2]{\begingroup + \edef\x{\endgroup\removefromstart\noexpand#1{#2}% + }\x +}% \eremovefromstart +\providerobustcmd\gremovefromstart[2]{% + \removefromstart{#1}{#2}% + \global\let#1=#1% +}% \gremovefromstart +\providerobustcmd\xremovefromstart[2]{% + \eremovefromstart{#1}{#2}% + \global\let#1=#1% +}% \xremovefromstart +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\itf@removefromstart} +% \begin{macrocode} +\long\def\itf@removefromstart#1#2{% removes #2 (code) from #1 (hook) + \long\def\in@@##1#2##2\in@@{##1\in@\itf@tp##2\in@@@}% + \long\def\in@@@##1\in@@@##2\in@@@{% + \ifx\in@##1\fi + }\expandafter\in@@@\in@@#1\itf@tp\in@@@#2\in@@ +}% \itf@removefromstart +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \clearpage\restoregeometry +% \pagesetup*{ +% left/offset-=1.5cm, +% right/offset+=.5cm, +% head/right/font=\small\bfseries\sffamily\pkgcolor, +% head/right=\hyperref{}{}{\thefirstmarks{sectionanchor}}{\thefirstmarks{section}}, +% } +% +% \begin{History} +% +% \sectionformat\subsection[hang]{format=\large\bfseries} +% +% \begin{Version}{2011/02/19 v3.1}\HistLabel{v3.1} +% \item Recompilation of the documentation after \Xpackage{tabu} v2.5 release. +% \end{Version} +% +% \begin{Version}{2011/02/12 v3.0}\HistLabel{v3.0} +% \item \csref{tocsetup}, \csref{lofsetup}, \csref{lotsetup} and \csref{listofsetup}: hooks:\\ +% \textt{multicols/beforebegin}\, \textt{multicols/afterbegin}\, \textt{multicols/beforeend}\, \textt{multicols/afterend} \\ +% added. +% \item New in \thispackage[interfaces-LaTeX]: \csref{quickprofile}. +% \item Modification of \csref{papergraduate}: a non empty setting for \M*[every node\handler/.style/] +% could make the graduation positions to be wrong. +% \item New key in \thispackage[interfaces-enumitem]: \textt{first=} is an alias for \textt{start=}. +% \item \cs{papergraduate}: though the graduations were right, the positionning of the graduated paper on the whole page was not. +% \end{Version} +% +% \begin{Version}{2011/01/19 v2.9}\HistLabel{v2.9} +% \item Modification of the syntax of \csref{papergraduate} to allow the same syntax as \cs{path}.\\ +% + optional arguments for this command. +% \item Some correction on \csref{tocsetup}: \cs{tocsetup}\M*{bookmark=bold} (for example) will automatically +% set \cs{tocsetup}\M*{title=\cs{contentsname}} in no key \textt{title} has been set. Therefore, a bookmark +% is set for the table of contents... +% \end{Version} +% +% \begin{Version}{2011/01/17 v2.8}\HistLabel{v2.8} +% \item New: \csref{papergraduate} in \thispackage[interfaces-TikZ]. +% \end{Version} +% +% \begin{Version}{2010/12/27 v2.6}\HistLabel{v2.6} +% \item \csref{tocsetup}:\\ +% A few new aliases for keys. \\ +% Key \textt{columns/sep} didn't work. Fixed. +% \item Generated file \xfile{interfaces-hypbmsec.code.tex} is empty since version \refVersion{2.5}. +% \item Fixed a bug in \csref{usetikz}\M*{all}: \xpackage{pgfmath} should not be loaded twice because +% of \cs{pgfmathdeclarefunction}... \\ +% + \xfile{pgfmodulesorting.code.tex} removed: bug in the code... +% \item \thispackage[interfaces-TikZ] : keys \textt{shorten>},\, \textt{shorten<},\, and\, \textt{shorten<>}. +% \item Optimisation. +% \end{Version} +% +% \begin{Version}{2010/12/07 v2.5}\HistLabel{v2.5} +% \item \csref{sectionformat} now works with the \textt{explicit} option of package \xpackage{titlesec}. +% (\emph{in} \thispackage[interfaces-titlesec]) +% \item Compatibility with \xpackage{calc} package as been implemented for \xpackage{pgfkeys} handlers: \par +% \begin{tabu}{XXX} +% \handler/.estore as dimen/ &\handler/.estore as dimen in cs/ &\handler/.store in dimen cs/ \\ +% \handler/.estore as glue/ &\handler/.estore as glue in cs/ &\handler/.store in skip cs/ +% \end{tabu} \par +% As a result, it is now possible to write: +% \begin{Verb*} +% \sectionformat\section{labelsep=\widthof{ some text }} +% \tocsetup{ section/pagenumbers/width=\widthof{ 00.00\enspace } } +% \end{Verb*} +% For scaling operations, \thispackage keeps the shrink and stretch components of glues, +% while \xpackage{calc} discard them. +% \item \csref{listofsetup} now works properly (\thispackage[interfaces-tocloft]). +% \item Some \stform+ and \stform* keys added to \thispackage[interfaces-fancyhdr]. +% \item Fix a bug of \xpackage{titlesec} when inside \xext{dtx} files: \cs{input}\M*{ttlkeys.def} +% shall be done with \% as a comment character (\cs{BeforeFile}...\cs{AfterFile} does the trick). +% \end{Version} +% +% \begin{Version}{2010/11/26 v2.4}\HistLabel{v2.4} +% \item \thispackage[interfaces-fancyhdr] : complete key set for header, footer and offset settings \\ +% Now keys like \textt{foot/inner} or \textt{head/outer/offset} are available (ouf!). +% \item \thispackage[interfaces-hypbmsec] has been completely rewritten and is now independant of \xpackage{titlesec} +% and \xpackage{interfaces-titlesec}. \cs{lastsectiontitle} \etc are defined by the mean of +% \cs{GetTitleString} (from H.O. eponym package). \\ +% \thispackage[interfaces-hypbmsec] now provides \cs{lastsectionanchor} when used with \xpackage{hyperref}. +% \item \thispackage[interfaces-marks] revisited: expandable macros \cs{thefirstmarks}, \cs{thebotmarks} and \cs{thetopmarks} +% are now expandable in exactly one step of expansion. \\ +% \cs{marksthe} and \cs{marksthecs} does not use \cs{unexpanded} (better for the \xext{log} file to see the marks). \\ +% Optimization for \cs{getthemarks} with incidence on \csref{ifmarksequal}. +% \item \csref{repeatcell}: modification of the code. \& alignment tab character is not activated +% and the ``dirty trick'' (according to D.~Knuth) \textt{\cs{iffalse}\{\cs{fi} \cs{ifnum}0=`\}\cs{fi}} is used instead. +% \item \csref{htruncadjust} produced an error when used with empty text arguments -- fixed. +% \item Modification in \cs{bottomtitles}: \cs{bottomtitlespace} should be stored as a dimen, not a skip. +% \item \csref{removefromstart} is now a \cs{long} macro. +% \end{Version} +% +% \begin{Version}{2010/11/21 v2.3}\HistLabel{v2.3} +% \item \thispackage[interfaces-fancyhdr] : new keys and new aliases for header, footer and offset settings. +% \end{Version} +% +% \begin{Version}{2010/11/16 v2.2}\HistLabel{v2.2} +% \item Fix a bug in \thispackage[interfaces-tocloft] (key \textt{section/dotsep}). +% \end{Version} +% +% \begin{Version}{2010/11/15 v2.1}\HistLabel{v2.1} +% \item Improved default and blank values for bookmark levels, based on \cs{ttll@\meta{section-name}} +% \item Correction of a bug in \cs{setlist}: missed a comma +% \item Correction of a bug in \thispackage[interfaces-fancyhdr] (fixed in \handler/.fancy@hf/ handler). +% \end{Version} +% +% +% \begin{Version}{2010/10/31 v2.0}\HistLabel{v2.0} +% \item Comptability of \thispackage[interfaces-pgfkeys] with \xpackage{pgf} version 2.1 +% \item Modification of the key \textt{depth} for \csref{tocsetup} to be able to change the t.o.c. +% depth anywhere inside the document (just like bookmarks depths). +% \item handler \handler/.defcounter/ has been replaced by more powerful \handler/.store in counter cs/ +% \end{Version} +% +% \begin{Version}{2010/10/27 v1.2}\HistLabel{v1.2} +% \item \thispackage[interfaces-hypbmsec] needed some corrections. +% \item The \textt{offset} keys for fancyhdr didn't work. Fixed. +% \item Correction of convertion \textt{pt} to \textt{mu} (catcodes...) +% \item Added \xpackage{microtype} to the documentation... +% \end{Version} +% +% +% \begin{Version}{2010/10/20 v1.0}\HistLabel{v1.0} +% \item First version. +% \end{Version} +% +% \end{History} +% +% \begin{appendices}[intoc=true,title=Appendix: README (for CTAN),intoc/title=\textsc{readme},section] +% The \thispackage package provides a small number of macros to modify the settings of a +% large number of parameters provided by Most Frequently Used Package (MFUP) for typesetting +% beautiful document with \LaTeX{}. +% +% \thispackage is organised as different modules which are loaded after the master package is loaded. +% Each module can be loaded separately. +% +% \cs{sectionformat}: interface for package \xpackage{titlesec} to modifies the titles +% produced by the sectionning commands (and their bookmarks). +% +% \cs{pagesetup}: interface for package \xpackage{fancyhdr} to modify the current page style +% or create new page styles. +% +% \cs{tocsetup}: interface for package \xpackage{tocloft} to fine tune the aspect of the table of contents, +% list of figures / of tables. \cs{tocsetup} also applies to \cs{shorttableofcontents} provided +% by the \xpackage{shorttoc} package. +% +% \cs{repeatcell}: to create `dynamic' tabulars, possibly with formula computation (\cs{numexpr}, +% \cs{pgfmathparse} or \cs{FPeval} formulas can be plugged in the tabular or array). +% +% \cs{rowfont}: to modify the font and/or the alignment of each cell in a tabular/array row. +% +% + some macros to make easier the use of \eTeX{} \cs{marks} registers (useful with \cs{sectionformat} +% and \cs{pagesetup}). +% +% \thispackage is mainly based on scrlfile.sty (provided in the Koma-Script bundle, but +% Koma-Script classes are not required), on pgfkeys and etoolbox. +% +% \thispackage defines some pgfkeys handlers designed specially to make key-value interface +% for other packages. Using those handlers allows to make an interface in a few minutes... +% +% +% \end{appendices} +% +% \PrintIndex +% +% \Finale diff --git a/macros/latex/contrib/interfaces/interfaces.ins b/macros/latex/contrib/interfaces/interfaces.ins new file mode 100644 index 0000000000..97154cdc0d --- /dev/null +++ b/macros/latex/contrib/interfaces/interfaces.ins @@ -0,0 +1,148 @@ +%% +%% This is file `interfaces.ins', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% interfaces.dtx (with options: `install') +%% +%% This is a generated file. +%% +%% interfaces : 2011/02/19 v3.1 - 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-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 +%% +\let\CTANLinks=y +\let\interfacesquick=n +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: 2011/02/19 v3.1 - interfaces: interfaces with keys for other packages (FC)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix \relax +\preamble + +This is a generated file. + +interfaces : 2011/02/19 v3.1 - 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-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 + +\endpreamble +\let\MetaPrefix\DoubleperCent + +\generate{% + \file{interfaces.ins}{\from{interfaces.dtx}{install}}% + \file{interfaces.sty}{\from{interfaces.dtx}{package}}% + \file{interfaces-base.sty}{\from{interfaces.dtx}{base}}% + \file{interfaces-pgfkeys.sty}{\from{interfaces.dtx}{pgfkeys}}% + \file{interfaces-etoolbox.sty}{\from{interfaces.dtx}{etoolbox}}% + \file{interfaces-scrlfile.sty}{\from{interfaces.dtx}{scrlfile}}% + \file{interfaces-LaTeX.sty}{\from{interfaces.dtx}{LaTeX}}% + \file{interfaces-titlesec.sty}{\from{interfaces.dtx}{titlesec}}% + \file{interfaces-hyperref.sty}{\from{interfaces.dtx}{hyperref}}% + \file{interfaces-bookmark.sty}{\from{interfaces.dtx}{bookmark}}% + \file{interfaces-fancyhdr.sty}{\from{interfaces.dtx}{fancyhdr}}% + \file{interfaces-marks.sty}{\from{interfaces.dtx}{marks}}% + \file{interfaces-tocloft.sty}{\from{interfaces.dtx}{tocloft}}% + \file{interfaces-makecell.sty}{\from{interfaces.dtx}{makecell}}% + \file{interfaces-enumitem.sty}{\from{interfaces.dtx}{enumitem}}% + \file{interfaces-hypbmsec.sty}{\from{interfaces.dtx}{hypbmsec}}% + \file{interfaces-truncate.sty}{\from{interfaces.dtx}{truncate}}% + \file{interfaces-tikz.sty}{\from{interfaces.dtx}{tikz}}% + \file{interfaces-umrand.sty}{\from{interfaces.dtx}{umrand}}% + \file{interfaces-environ.sty}{\from{interfaces.dtx}{environ}}% + \file{interfaces-appendix.sty}{\from{interfaces.dtx}{appendix}}% + \file{interfaces-embedfile.sty}{\from{interfaces.dtx}{embedfile}}% +} + +\ifx n\CTANLinks \askforoverwritetrue \fi +\generate{% + \file{interfaces.drv}{\from{interfaces.dtx}{driver}}% +} + +\obeyspaces +\Msg{************************************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* file into a directory searched by TeX:} +\Msg{*} +\Msg{* interfaces.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `interfaces.dtx'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +\endinput +%% +%% End of file `interfaces.ins'. diff --git a/macros/latex/contrib/interfaces/interfaces.pdf b/macros/latex/contrib/interfaces/interfaces.pdf new file mode 100644 index 0000000000..9bf4fa35da Binary files /dev/null and b/macros/latex/contrib/interfaces/interfaces.pdf differ -- cgit v1.2.3