diff options
author | Karl Berry <karl@freefriends.org> | 2010-10-25 23:12:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-10-25 23:12:18 +0000 |
commit | d74b95d250c7632cb73e7420db04e2e38adc3827 (patch) | |
tree | fbc6763253fbb9d309da7b613857d782ee5feccb /Master/texmf-dist/source/latex/interfaces | |
parent | ec47c1b7880fd4f626f8aa8377e576e03d72c24f (diff) |
new latex package interfaces (25oct10)
git-svn-id: svn://tug.org/texlive/trunk@20206 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/interfaces')
-rw-r--r-- | Master/texmf-dist/source/latex/interfaces/interfaces.drv | 109 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/interfaces/interfaces.dtx | 6928 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/interfaces/interfaces.ins | 150 |
3 files changed, 7187 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/interfaces/interfaces.drv b/Master/texmf-dist/source/latex/interfaces/interfaces.drv new file mode 100644 index 00000000000..20c3635f9b5 --- /dev/null +++ b/Master/texmf-dist/source/latex/interfaces/interfaces.drv @@ -0,0 +1,109 @@ +%% +%% This is file `interfaces.drv', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% interfaces.dtx (with options: `driver') +%% +%% This is a generated file. +%% +%% interfaces : 2010/10/20 v1.0 - interfaces : interfaces with keys for other packages (FC) +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% +%% This work consists of the main source file interfaces.dtx +%% and the derived files +%% interfaces.sty, interfaces.pdf, interfaces.ins, +%% interfaces-base.sty, +%% interfaces-LaTeX.sty, +%% interfaces-tikz.sty, +%% interfaces-titlesec.sty, +%% interfaces-hyperref.sty, +%% interfaces-bookmark.sty, +%% interfaces-hypbmsec.sty,interfaces-hypbmsec.code.tex, +%% interfaces-fancyhdr.sty, +%% interfaces-marks.sty, +%% interfaces-tocloft.sty, +%% interfaces-makecell.sty, +%% interfaces-enumitem.sty, +%% interfaces-truncate.sty, +%% interfaces-appendix.sty, +%% interfaces-embedfile.sty, +%% interfaces-environ.sty, +%% interfaces-umrand.sty, +%% interfaces-scrlfile.sty, +%% interfaces-pgfkeys.sty, +%% interfaces-etoolbox.sty, +%% interfaces-fancyvrb.sty +%% +%% interfaces: interfaces with keys for other packages (FC) +%% Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> +%% +\let\CTANLinks=y +\edef\thisfile{\jobname} +\def\thisinfo{interfaces with keys for other packages (\FC)} +\def\thisdate{2010/10/20} +\def\thisversion{1.0} +\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}} +\documentclass[a4paper,oneside]{ltxdoc} +\usepackage[latin1]{inputenc} +\usepackage[american]{babel} +\usepackage[T1]{fontenc} +\PassOptionsToPackage{svgnames}{xcolor} +\usepackage{etoolbox,geometry,lastpage,tocloft,titlesec,graphicx,xspace,tabularx} +\usepackage{fancyhdr,nicefrac,xcolor,bbding,moresize,relsize,embedfile} +\usepackage{enumitem,framed,multirow,txfonts,makecell,enumitem,atveryend,marvosym,pifont} +\usepackage{booktabs} +\usepackage{calc} +\usepackage{colortbl,arydshln,dcolumn,delarray} +\usepackage{hypbmsec} +\usepackage{linegoal} +\usepackage{numprint} +\usepackage[breakall]{truncate} +\usepackage{appendix} +\usepackage[hyperindex=false,pdfusetitle,colorlinks,pdfpagelabels,pdfencoding=auto]{hyperref} +\usepackage{interfaces-base} +\LoadInterface{LaTeX,titlesec,bookmark,marks,fancyhdr,tocloft,makecell,enumitem,appendix,truncate} +\usepackage{fp} +\usepackage{zref,zref-user,zref-savepos} +\csname endofdump\endcsname +%%\FPmessagesfalse +\usepackage{times} +\usepackage{holtxdoc} +\usepackage{hhline} +\CodelineNumbered +\usepackage{fancyvrb} \fvset{gobble=1} +\usetikz{basic,decorations.pathmorphing} +\lastlinefit999 \widowpenalty5000 \clubpenalty10000 \doublehyphendemerits100000 +\geometry{top=1.5cm,headheight=1cm,headsep=.3cm,bottom=1.4cm,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},% + hyperindex=true,% + pdfkeywords={tex, e-tex, latex, package, interfaces, pgfkeys,% + scrlfile, titlesec, fancyhdr, tocloft, environ,% + fancyvrb, embedfile, bookmark, hypbmsec, truncate,% + umrand},% + bookmarksopen=true,bookmarksopenlevel=1,% + pdfnewwindow=true} +\usepackage{bookmark} +\embedfile{\thisfile.dtx} +\begin{document} + \DocInput{\thisfile.dtx} +\end{document} +\endinput +%% +%% End of file `interfaces.drv'. diff --git a/Master/texmf-dist/source/latex/interfaces/interfaces.dtx b/Master/texmf-dist/source/latex/interfaces/interfaces.dtx new file mode 100644 index 00000000000..422ef8a57e3 --- /dev/null +++ b/Master/texmf-dist/source/latex/interfaces/interfaces.dtx @@ -0,0 +1,6928 @@ +% \iffalse meta-comment +% interfaces : 2010/10/20 v1.0 - interfaces with keys for other packages (FC) +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3 of this license or (at your option) any later +% version. The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% +% This work consists of the main source file interfaces.dtx +% and the derived files +% interfaces.sty, interfaces.pdf, interfaces.ins, +% interfaces-base.sty, +% interfaces-LaTeX.sty, +% interfaces-tikz.sty, +% interfaces-titlesec.sty, +% interfaces-hyperref.sty, +% interfaces-bookmark.sty, +% interfaces-hypbmsec.sty,interfaces-hypbmsec.code.tex, +% interfaces-fancyhdr.sty, +% interfaces-marks.sty, +% interfaces-tocloft.sty, +% interfaces-makecell.sty, +% interfaces-enumitem.sty, +% interfaces-truncate.sty, +% interfaces-appendix.sty, +% interfaces-embedfile.sty, +% interfaces-environ.sty, +% interfaces-umrand.sty, +% interfaces-scrlfile.sty, +% interfaces-pgfkeys.sty, +% interfaces-etoolbox.sty, +% interfaces-fancyvrb.sty +% +% 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 <florent.chervet@free.fr> +%<*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 +%</ignore> +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: 2010/10/20 v1.0 - interfaces: interfaces with keys for other packages (FC)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +interfaces : 2010/10/20 v1.0 - interfaces : interfaces with keys for other packages (FC) + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3 of this license or (at your option) any later +version. The latest version of this license is in + http://www.latex-project.org/lppl.txt + +This work consists of the main source file interfaces.dtx +and the derived files + interfaces.sty, interfaces.pdf, interfaces.ins, + interfaces-base.sty, + interfaces-LaTeX.sty, + interfaces-tikz.sty, + interfaces-titlesec.sty, + interfaces-hyperref.sty, + interfaces-bookmark.sty, + interfaces-hypbmsec.sty,interfaces-hypbmsec.code.tex, + interfaces-fancyhdr.sty, + interfaces-marks.sty, + interfaces-tocloft.sty, + interfaces-makecell.sty, + interfaces-enumitem.sty, + interfaces-truncate.sty, + interfaces-appendix.sty, + interfaces-embedfile.sty, + interfaces-environ.sty, + interfaces-umrand.sty, + interfaces-scrlfile.sty, + interfaces-pgfkeys.sty, + interfaces-etoolbox.sty, + interfaces-fancyvrb.sty + +interfaces: interfaces with keys for other packages (FC) +Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> + +\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-hypbmsec.code.tex}{\from{interfaces.dtx}{hypbmsec.code.tex}}% + \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}}% + \file{interfaces-fancyvrb.sty}{\from{interfaces.dtx}{fancyvrb}}% +} + +\askforoverwritetrue +\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 +%</install> +%<*ignore> +\fi +%</ignore> +%<*driver> +\let\CTANLinks=y +\edef\thisfile{\jobname} +\def\thisinfo{interfaces with keys for other packages (\FC)} +\def\thisdate{2010/10/20} +\def\thisversion{1.0} +\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}} +\documentclass[a4paper,oneside]{ltxdoc} +\usepackage[latin1]{inputenc} +\usepackage[american]{babel} +\usepackage[T1]{fontenc} +\PassOptionsToPackage{svgnames}{xcolor} +\usepackage{etoolbox,geometry,lastpage,tocloft,titlesec,graphicx,xspace,tabularx} +\usepackage{fancyhdr,nicefrac,xcolor,bbding,moresize,relsize,embedfile} +\usepackage{enumitem,framed,multirow,txfonts,makecell,enumitem,atveryend,marvosym,pifont} +\usepackage{booktabs} +\usepackage{calc} +\usepackage{colortbl,arydshln,dcolumn,delarray} +\usepackage{hypbmsec} +\usepackage{linegoal} +\usepackage{numprint} +\usepackage[breakall]{truncate} +\usepackage{appendix} +\usepackage[hyperindex=false,pdfusetitle,colorlinks,pdfpagelabels,pdfencoding=auto]{hyperref} +\usepackage{interfaces-base} +\LoadInterface{LaTeX,titlesec,bookmark,marks,fancyhdr,tocloft,makecell,enumitem,appendix,truncate} +\usepackage{fp} +\usepackage{zref,zref-user,zref-savepos} +\csname endofdump\endcsname +%%\FPmessagesfalse +\usepackage{times} +\usepackage{holtxdoc} +\usepackage{hhline} +\CodelineNumbered +\usepackage{fancyvrb} \fvset{gobble=1} +\usetikz{basic,decorations.pathmorphing} +\lastlinefit999 \widowpenalty5000 \clubpenalty10000 \doublehyphendemerits100000 +\geometry{top=1.5cm,headheight=1cm,headsep=.3cm,bottom=1.4cm,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},% + hyperindex=true,% + pdfkeywords={tex, e-tex, latex, package, interfaces, pgfkeys,% + scrlfile, titlesec, fancyhdr, tocloft, environ,% + fancyvrb, embedfile, bookmark, hypbmsec, truncate,% + umrand},% + bookmarksopen=true,bookmarksopenlevel=1,% + pdfnewwindow=true} +\usepackage{bookmark} +\embedfile{\thisfile.dtx} +\begin{document} + \DocInput{\thisfile.dtx} +\end{document} +%</driver> +% \fi +% +% \CheckSum{5834} +% +% \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} +% \makeatletter +% +% +% \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{\@testopt{\thisp@ck@ge{#1}}{\thisfile}} +% \def\thisp@ck@ge#1[#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}{}} +% \renewcommand\bottomtitlespace{.2\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{##1\ifnum##1=\year\else\,\textendash\,\the\year\fi}% +% }\expandafter\thisyear\thisdate\@nil +% } +% ^^A---------------------------------------------------------------------------- +% \parindent\z@\parskip.4\baselineskip\topsep\parskip\partopsep\z@ +% \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}} +% \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}} +% \renewrobustcmd*\cs[2][\macrocodecolor]{\texorpdfstring{\mbox{\vb#1\expandafter\@gobble\string\\#2}}{\@backslashchar#2}} +% \newrobustcmd*\csref[2][\macrocodecolor]{$\leadsto$\hyperref{}{declcs}{#2}{\cs[{#1}]{#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}}} +% \newrobustcmd\csbf[2][\macrocodecolor]{\texorpdfstring{\textbf{\cs[{#1}]{#2}}}{\@backslashchar#2}} +% \let\doc@meta\meta +% \renewrobustcmd*\meta[2][\macrocodecolor]{\doc@meta{#1{#2}}} +% \newrobustcmd\hyperdefanchor[2][\z@]{^^A +% \ifdim#1>\z@ +% \edef\HyperRaiseLinkHook{^^A +% \def\noexpand\HyperRaiseLinkHook{\expandonce\HyperRaiseLinkHook}^^A% restore current definition +% \advance\noexpand\HyperRaiseLinkLength by\dimexpr#1\relax\relax}^^A +% \fi +% \Hy@raisedlink{\hyper@anchorstart{#2}\hyper@anchorend}^^A +% } +% \renewrobustcmd\declcs[2][]{^^A +% \par\addvspace\parskip^^A{.5ex plus 1ex}\noindent +% \goodbreak +% \noindent +% \hspace{-\leftmargini}^^A +% \def\*{\unskip\,\texttt{*}}^^A +% \begin{tabular}{|l|}^^A +% \hline +% \expandafter\SpecialUsageIndex\csname #2\endcsname +% \hyperdefanchor[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{tabular}[t]{#1} +% #2 +% \end{tabular}}} +% \newrobustcmd\xkeytab[2][oX]{\makecell[tl]{^^A +% \begin{tabularx}\linegoal[t]{#1} +% #2 +% \end{tabularx}}} +% \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}} +% \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*{{#1{\xpackage{#2}}}}}} +% \pagesetup[corpus]{% +% head/rule/width=.4pt, +% head/font=\footnotesize\color[gray]{.35},% +% foot/font=\scriptsize\color[gray]{.35},% +% head/left=The \thispackage package -- \thisinfo,% +% head/right=\thefirstmarks{section},% +% foot/left=\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=, +% } +% +% \newrobustcmd*\macrocodecolor{\color{macrocode}}\definecolor{macrocode}{rgb}{0.00,0.00,0.10} +% \newrobustcmd*\IMPLEMENTATION{% +% \clearpage +% \hypersetup{bookmarksopenlevel=2} +% ^^A\geometry{top=1.5cm,headheight=1cm,headsep=.3cm,bottom=1.4cm,footskip=.5cm,left=2.5cm,right=1cm} +% \newgeometry{top=1.5cm,headheight=1cm,headsep=.3cm,bottom=1.4cm,footskip=.5cm,left=4cm,right=.5cm} +% \pagesetup*{% +% pagestyle=corpus, +% head/left=The \thispackage package (implementation) -- \thisinfo, +% head/right/font+=\smaller, +% head/right=\thefirstmarks{subsection}, +% }% +% \bookmarksetup{depth=4} +% \sectionformat\section{mark=,bookmark={bold*,italic*}} +% \sectionformat\subsection{mark=\marksthe{subsection}{\arabic{section}.\arabic{subsection}\,{\pkgcolor\lower.2ex\hbox{\smaller\NibRight}}\,##1}} +% \sectionformat\subsubsection{mark=\marksthe{subsubsection}{##1}} +% \section{Implementation} \label{sec:implementation}} +% \let\plainllap\llap +% \newrobustcmd\macro@llap[1]{\let\llap\plainllap\setbox\z@\hbox{#1}\ifdim\wd\z@>3cm\hbox to\z@{\hss\hbox to3cm{#1\hss}}\else\hbox to\z@{\hss#1}\fi\setbox\z@\box\voidb@x} +% \pretocmd\macro{\let\llap\macro@llap}{}{} +% \apptocmd\endmacro{\goodbreak}{}{} +% +% \newcommand\reflinkcolor{\color{reflink}}\definecolor{reflink}{rgb}{0.49,0.00,0.00} +% \definecolor{reffilecolor}{rgb}{0,.3,0} +% \newrobustcmd*\stform{\@ifnextchar*{\@stform[]\textasteriskcentered\@gobble}\@stform} +% \newrobustcmd*\@stform[2][\string]{\textttbf{\rred#1#2}\ifnum\catcode`\ =\active\relax\else\expandafter\xspace\fi}^^A not \xspace in verbatim +% \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}}% +% \section({#2})[{#3}]{#4}% +% } +% \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}}, +% } +% \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}, +% } +% \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}\mdseries The {\bfseries\thispackage\footnotemark}\kern.6em package} +% \author{\tiny\xemail{florent.chervet at free.fr}} +% \date{\thisdate~--~version \thisversion} +% \subtitle{\thisinfo} +% \maketitle +% +% \makeatletter\begingroup\let\@thefnmark\@empty\let\@makefntext\@firstofone +% \footnotetext{\noindent +% This documentation is produced with the +DocStrip+ utility. +% \begin{tabbing} +% \qquad\=\smex\=To get the documentation, \= run (thrice):\quad\= \texttt{pdflatex \thisfile.dtx} \\ +% \qquad\>\>To get the index, \> run:\>\texttt{makeindex -s gind.ist \thisfile.idx} \\ +% \>\smex\>To get the package, \> run:\> \texttt{etex \thisfile.dtx} +% \end{tabbing}§ +% The \xext{dtx} file is embedded into this pdf file thank to \xpackage{embedfile} by H. Oberdiek.} +% \endgroup\makeatother +% +% \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 base 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*{interface-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}} +% \begin{SaveVerbatim}[gobble=1,commandchars=$()]{FirstCol} +% ($red(\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=($db(\thefirstmarks)){MiniSection},$com(interfaces-marks) +% } +% ($red(\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, +% } +% ($red(\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=\goodbreak, +% mark=\markboth{#1}{#1},% +% } +% ($red(\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}, +% } +% ($red(\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=($db(\marksthe)){MiniSection}{#1},$com(see interfaces-marks) +% } +% ($red(\bottomtitles))=.2\textheight +% \end{SaveVerbatim} +% \begin{SaveVerbatim}[gobble=1,commandchars=$()]{SecondCol} +% ($red(\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, +% subsubsection/pagenumbers=off,$com(no page numbers) +% subsubsection/dotsep=,$com(no leader) +% columns=2,$com(same as twocolumns) +% columns/sep=.5em, +% columns/rule=1pt,columns/rule/color=blue, +% } +% \tableofcontents +% +% \mainmatter \pagestyle{document} +% \end{SaveVerbatim} +% \begin{multicols}{2} +% \UseVerbatim{FirstCol} +% \UseVerbatim{SecondCol} +% \end{multicols} +% } +% \clearpage +% +% \tocsetup{ +% title=\leavevmode\leaders\hrule height3.4pt depth-3pt\hfill\quad Contents\quad \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, +% after=\vskip12pt\nobreak\hrule height3.4pt depth-3pt\relax, +% bookmark=bold,% +% bookmark/text=Contents,% +% } +% ^^A\bookmark[page=\value{page},view={FitBH \hypercalcbp\textheight},bold=true]{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) \kern5cm \} } +% \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]{rowfont}\M[alignment]\M{font specification} +% \end{declcs} +% +% \cs[\red]{rowfont} modifies the font for each cell in a row of a tabular or array. +% +% \cs[\red]{rowfont} specifications have priority over column specifications, exactly like \cs{rowcolor} has priority +% over \cs{columncolor} in the \xpackage{colortbl} package. +% +% The implementation must be compatible with all packages that are compatible with the \xpackage{array} package, +% which is required (\cs[\red]{rowfont} is not defined if the standard package \xpackage{array.sty} is not loaded). +% In particular, \cs{rowfont} compatibility has been tested with success with \xpackage{colortbl}, \xpackage{hhline}, +% \xpackage{arydshln}, \xpackage{tabularx}, \xpackage{longtable}, \xpackage{delarray}, \xpackage{dcolumn}, \xpackage{ragged2e}... +% +% The alignment of each cell in one row can also be changed to: \topsep=0pt +% \begin{center} +% \begin{tabular}{>{\pkgcolor\ttfamily}r@{\,$=$\,}l!{\qquad\itshape\smaller or\, for \xpackage{ragged2e} settings: }>{\pkgcolor\ttfamily}r} +% l &left &L \\ +% c ¢er &C \\ +% r &right &R \\ +% j &justify &J \\ +% \end{tabular} +% \end{center} +% +% Any other value for the optional \meta{alignment} parameter is silently ignored. If \xpackage{ragged2e} is not loaded, +% \textt[\pkgcolor]L\, \textt[\pkgcolor]R\, \textt[\pkgcolor]C\, and\, \textt[\pkgcolor]J\, are synonymous with the +% lowercase equivalent. +% +% \bigskip +% +% \centerline{\lk +% \tikz\draw [decoration=snake,decorate,thick] (0,1) -- ++(3,0); +% \quad \textsc{\scshape Example with package \xpackage{colortbl}} \quad +% \tikz\draw [cm={-1,0,0,0,(0,0)},anchor=east,decoration=snake,decorate,thick] (0,1) -- ++(3,0); +% } +% {\footnotesize +% \begin{Verb*} +% \begin{($dg$underline(tabular))}{|l|>{($db(\columncolor)){Salmon}\itshape\mdseries}c|lcr|} \hline +% ($db(\rowcolor)){GreenYellow}($red(\rowfont)){\bfseries} +% <-------- type --------> &<-- center --> &<-- left --> &<-- center --> &<-- right --> \\\hline +% normal &1 &2 &3 &4 \\ +% ($db(\rowcolor)){LightSkyBlue}%($itshape$lk overwrites \columncolor) +% ($red(\rowfont))[($pkgcolor(l))]{\itshape} +% to left &1 &2 &3 &4 \\ +% ($red(\rowfont))[($pkgcolor(c))]{\sffamily\bfseries}%($itshape$lk overwrites \mdseries) +% to center &1 &2 &3 &4 \\ +% ($db(\rowcolor)){MediumSpringGreen} +% ($red(\rowfont))[($pkgcolor(r))]{\larger\upshape\bottopstrut}%($itshape$lk overwrites \itshape) +% to right &1 &2 &3 &4 \\\hline +% \end{($dg$underline(tabular))} +% \end{Verb*} +% } +% \medskip +% +% \begin{center} +% \begin{tabular}{|l|>{\columncolor{Salmon}\itshape\mdseries}c|lcr|} \hline +% \rowcolor{GreenYellow}\rowfont\bfseries +% <-------- type --------> &<-- center --> &<-- left --> &<-- center --> &<-- right --> \\\hline +% normal &1 &2 &3 &4 \\ +% \rowcolor{LightSkyBlue} +% \rowfont[l]{\itshape} +% to left &1 &2 &3 &4 \\ +% \rowfont[c]{\sffamily\bfseries} +% to center &1 &2 &3 &4 \\ +% \rowcolor{MediumSpringGreen} +% \rowfont[r]{\larger\upshape\bottopstrut} +% to right &1 &2 &3 &4 \\\hline +% \end{tabular}\par +% {\raggedleft\scriptsize A very bad looking example !\par} +% \end{center} +% \pagebreak +% +% Limitations for the alignment parameter: +% \begin{itemize}^^A[topsep=0pt,parsep=0pt,itemsep=0pt] +% \item The alignment parameter is essentially provided to format the first title line of the tabular in ``one shot'' and +% in simple cases. Otherwise, prefer \cs{thead} (package \xpackage{makecell}) for each title cell. +% \item be aware that changing the alignment with \cs{rowfont} in a row whose cells contains +% tabulars or arrays will give poor results (but \cs{multicolumn}, \cs{makecell} and \csref[\red]{repeatcell} +% have their own alignment parameter). +% \item Changing the alignment with \cs{rowfont} in mathematical mode (\ie in arrays) does not work presently +% \item Avoid the \xpackage{ragged2e} settings if you don't know the package \xpackage{ragged2e} very well. +% It contains a lot of parameters for paragraph glues and indentations... +% \end{itemize} +% +% +% \bigbreak +% \centerline{\lk +% \quad \textsc{\scshape Example for paragraph columns (with package \xpackage{colortbl} as well)} \quad +% }\nobreak +% {\arrayrulewidth=.8pt +% \def\parag#1{This is a paragraph, not too long and not excessively short, to see what happens with {\color{red}\textttbf{m columns}} {\color{Blue} initially #1}} +% \def\tabtest{\parag {justified} & \parag {raggedright} & \parag {centering} & \parag {raggedleft}} \def\colwidth{.18\linewidth} +% \begin{center}\scriptsize +% \begin{tabular}{|l|>{\columncolor{Beige}}m{\colwidth}|>{\columncolor{Lavender}\raggedright\arraybackslash}m{\colwidth}|>{\columncolor{MintCream}\centering\arraybackslash}m{\colwidth}|>{\columncolor{OldLace}\raggedleft\arraybackslash}m{\colwidth}|} \hline +% \rowfont{\larger\bfseries} +% Initial & m column & \cs{raggedright} m column & \cs{centering} m column & \cs{raggedleft} m column \\ \hline +% \rowcolor{Honeydew} +% normal & \tabtest \\ \hline +% \rowfont[L]{\itshape} +% to left& \tabtest \\ \hline +% \rowfont[C]{\bfseries} +% to center& \tabtest \\ \hline +% \rowfont[R]{\slshape} +% to right& \tabtest \\ \hline +% \rowfont[J]{} +% to justify& \tabtest \\ \hline +% \end{tabular} +% \end{center} +% } +% +% \bigbreak +% {% +% \centerline{\lk +% \tikz\draw [decoration=snake,decorate,thick] (0,1) -- ++(3,0); +% \quad \textsc{\scshape Explanations for \LaTeX en} \quad +% \tikz\draw [cm={-1,0,0,0,(0,0)},anchor=east,decoration=snake,decorate,thick] (0,1) -- ++(3,0); +% }\nobreak +% \footnotesize +% \xpackage{array} defines the preamble of each tabular with a pseudo code like: +% \begin{Verb*} +% \hskip...\d@llarbegin \the\toks i \ignorespaces #\unskip \the\toks i+1 \relax\d@llarend... & +% \end{Verb*} +% where {\ttfamily\cs{toks} i} and {\ttfamily\cs{toks} i+1} contain user defined commands placed before (left side of) +% and after (right side of) each column specification, for example: \topsep=0pt +% \begin{center} +% \begin{tikzpicture} +% \node (L) at (1,1) {$\underbrace{\hbox{>\M*{\cs{bfseries}\cs{color}\M*{red}}}}$} +% node [anchor=west] (r) at (L.east) {\raise.5ex\hbox{\larger r}} +% node [anchor=west] (R) at (r.east) {$\underbrace{\hbox{<\M*{\cs{color}\M*{black}\cs ,\cs\$}}}$} +% node [anchor=center] at (L.south) {\cs{toks}<$i$>} +% node [anchor=center] at (R.south) {\cs{toks}<$i+1$>}; +% \end{tikzpicture} +% \end{center} +% +% There are also other types of ``pseudo code'' for \texttbf p and \texttbf m columns, and for special \texttbf @ +% and \texttbf ! columns but the implementation is the same. For more details, please refer to the implementation part. +% +% \thispackage append to each such \cs{toks}\meta{$i$} a control sequence named \cs{itf@cellleft} and to each +% such \cs{toks}\meta{$i+1$} a control sequence named \cs{itf@cellright}, similar to \cs{@arrayleft} and \cs{@arrayright} +% for the whole tabular. +% Those control sequences can be globally modified in order to change the font (with \cs{itf@cellleft}) in each cell +% in a row. \cs{itf@cellright} is also used when modifying the alignment for the row. +% +% Both \cs{itf@cellleft} and \cs{itf@cellright} are equal to \cs{@empty}, unless \cs{rowfont} is used. Therefore, +% +% } +% +% This implementation is fair, and compatible with \xpackage{colortbl}, \xpackage{tabularx}, \xpackage{arydshln}, \xpackage{hhline}, +% \xpackage{longtable},\xpackage{delarray}, \xpackage{dcolumn} and certainly any package compatible with \xpackage{array}. +% +% {\bfseries\macrocodecolor However, you must know that \xpackage{arydshln} does not like special \textt @\, and\, \textt !\, columns. +% If you encounter problems with \textt @\, or\, \textt !\, columns while \xpackage{arydshln} is loaded +% (that is, the vertical lines are not correctly positionned), it's not the fault of \thispackage... } +% +% +% \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{tabular}[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{tabular} +% \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}. +% +% \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\def\theadfont{\bfseries\sffamily} \letcs\rowcolor{@gobble}\letcs\columncolor{@gobble}\arrayrulewidth=.8pt +% \begin{tabularx}\linewidth{>{\columncolor{AliceBlue}}X:>{\columncolor{LemonChiffon}}X:*{2}{>{\columncolor{AntiqueWhite}}X}}\firsthline +% \rowcolor{white} \thead{TikZ/pgf package} &\thead{pgfmodules} &\multicolumn{2}{c}{\thead{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{tabularx}} +% +% {\scriptsize\raggedleft sorry for the blank cell, but I didn't get out with \xpackage{colortbl} and the \cs{multicolumn} entry...\par} +% +% \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{tabular}[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{tabular} +% \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. +% \clearpage +% +% \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] +% $cs[$red](sectionformat)$cs[$rred](section)[$texttbf(hang)]{% ($nnn this is the same as:) shape = hang +% ($opt font)=\bfseries\scshape, +% ($opt label)=\Roman{chapter}\ \textbullet\ \arabic{section}, +% ($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{...} +% \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[interface-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... +% } +% \let\keydefault\db +% \def\EQUIV{{\normalcolor$\mathbf\equiv$}} +% +% \medskip +% +% \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{tabularx}\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{tabularx} +% } +% +% +% If the \xpackage{bookmark} package is loaded, with \thispackage[interfaces-bookmark], the following keys are defined for each section: +% +% {\small +% \begin{tabularx}\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{tabularx} +% } +% +% 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/\,}. +% \pagebreak +% +% +% The starred keys \textt[\opt]{bold}\stform*, \textt[\opt]{italic}\stform* and \textt[\opt]{color}\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 +% +% 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 sets the value of \cs{bottomtitlespace} (see \doclink{titlesec} documentation): +% \begin{Verb*} +% \bottomtitles{.2} ($nnn set $cs(bottomtitlespace) to) .2\textheight +% \bottomtitles=.2\textheight ($nnn is the same) +% \end{Verb*} +% +% You can 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{tabular}[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{tabular} +% \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] requires \thispackage[interfaces-titlesec], +% and therefore the \xpackage{titlesec} package: when using \thispackage with automatic module loading, +% (or while invoking \LoadInterface{hypbmsec}), this module is loaded only after both +% \xpackage{titlesec.sty} and \xpackage{hypbmsec.sty}. +% +% 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{tabular}{>{\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{tabular} +% +% +% 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) +% \end{Verb*} +% +% Macros for each sectionning command are defined:§ +% \begin{tabularx}\linewidth{XXX} +% \cs[\opt]{lastparttitle} &\cs[\opt]{lastchaptertitle} & \\ +% \cs[\opt]{lastsectiontitle} &\cs[\opt]{lastsubsectiontitle} &\cs[\opt]{lastsubsubsectiontitle} \\ +% \cs[\opt]{lastparagraphtitle} &\cs[\opt]{lastsubparagraphtitle} & \\ +% \end{tabularx} +% 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}}. {\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 empty 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. +% I leave the reader to his thoughts about the necessity of such \cs{marks} in certain situations... +% +% \ClearPage* +% +% +% \Section[tocloft]({\cs{tocsetup} (tocloft)})[{Interface tocloft: \cs[\red]{tocsetup}}]{\sectitle{tocloft}: \mdseries\cs[\red]{tocsetup}, \cs[\red]{lofsetup} and \cs[\red]{lotsetup}} +% +% 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{tabularx}\linewidth[t]{oX} +% depth &\cs{setcounter}\M\*{tocdepth} {\smaller This is a \LaTeX{} rather than \xpackage{tocloft}'s ...} \\ +% 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* &the title font (set\OR append code) \\ +% title/after\OR title/after* &hook to execute just after the title {\smaller(\cs{cftaftertoctitle}...)} \\ +% parskip\OR parskip\stform+ \etc \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} \\\hdashline[1.5pt/1pt] +% 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. Its default value is \textt{0pt plus 4pt minus 3pt}.} \\ +% multicols/begin\OR twocolums/before &hooks just after \cs{begin}\texttt{\{multicols\}} ... \\ +% multicols/end\OR twocolums/after &... and before \cs{end}\texttt{\{multicols\}} \\\hdashline[1.5pt/1pt] +% 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}.).} \\\hdashline[1.5pt/1pt] +% 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{tabularx}} +% \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). +% +% +% \begin{declcs}[\red]{tocsetup}\{\\ +% \staractive\def\Z{\textcolor{LimeGreen}{\smaller\textbf\textparagraph}\/}% +% \makecell[tl]{\small +% \begin{tabularx}\linewidth[t]{>{\opt}r@{\,=\,}X} +% \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* &the font of the \Z\, section title \\ +% \Z/number/width\OR number/width\stform+\OR numwidth &modifies the space allowed to typeset the title numbers \\ +% \Z/number/before\OR number/before*\OR presnum &code before the section number \textsmaller{(see pseudo code below)} \\ +% \Z/number/after\OR number/after*\OR aftersnum &code after the section number \textsmaller{(see pseudo code below)} \\ +% \Z/title/before\OR title/before*\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}\texttt{\{\cs{cft\Z dotsep}\}}} \\ +% \Z/dotsep &the space (in $mu$) between dots in the leader. \textsmaller{Default is \cs{cftdotsep} and blank value is the same as \cs{cftnodots}} \\ +% \Z/pagefont\OR \Z/page/font\OR \Z/pagenumber/font &modifies the font used to typeset the page number \\ +% \Z/page/after\OR \Z/pagenumber/after\OR afterpnum ¯o expanded after the page number is typeset \kern2cm\} \\ +% \end{tabularx}} +% \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}, +% but there is no sub-keys for \textt{section}, \textt{subsection} \etc. +% +% \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{tabularx}\linewidth[t]{OOO>{\scriptsize}X} +% \omit\hfill {\opt\ttfamily norule}\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} \\\hdashline[1.5pt/1pt] +% 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 & \\\hdashline[1.5pt/1pt] +% 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 \\ +% pagestyle &\omit &\omit &load the settings of another page style \hfill\rlap{\}} \\ +% \end{tabularx} \\ +% \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. +% +% \Section[marks](Interface marks)[Interface marks]{Interface marks} +% +% \thispackage[interface-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. +% +% +% \begin{declcs}[\red]{thefirstmarks}\M{named-mark} \\ +% \cs[\red]{thebotmarks}\M{named-mark} \\ +% \cs[\red]{thetopmarks}\M{named-mark} +% \end{declcs} +% +% \begin{description}[font=\mdseries] +% \item[{\cs[\red]{thefirstmarks}\M{chapter}}] expands to \cs{firstmarks}\cs{marks@\meta{chapter}}\, (this is expandable), \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{tabular}{!{\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{tabular} +% +% 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] and \cs{lastsectiontitle}... +% +% 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\begin{tabular} +% 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{\}} \\ +% }^^A\end{tabular} +% \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$<i>$}\, and\, \textt[\opt]{text/col$<i>$}\, 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{tabularx}\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{tabularx} +% +% 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{tabularx}\linewidth{>{\ttfamily}m{\widthof{\cs[\pkgcolor]{C}\cs[\pkgcolor]{column}}}X} +% \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{tabularx} +% +% 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...}}}} +% +% \textbf{Important note:} The mechanism of \cs{halign} does not allow to insert tab alignment characters into the arguments of \cs[\red]{repeatcell}. +% Therefore, to be able to define a \textt[\opt]{text} key containing a tabular or array, the \textt{\textbf\& alignment tab character} is activated +% (\texttt{catcode 13}) at the beginning of \cs{repeatcell}. This activation has no effect if \cs{repeatcell} is in the replacement text of one of your macro, +% because the category code of \texttbf\& is fixed at the time your macro was read. Thus, use the control sequence \cs[\red]{tab} instead of \texttbf\& in this case. +% \cs[\red]{tab} is only defined during the time \cs[\red]{repeatcell} does its job. +% +% \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(tabular))}{|>{\bfseries}c|*{9}{|r}|} \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(tabular))} +% \end{Verb*} +% +% {\footnotesize +% \def\listofunits{pt,cm,mm,bp,dd,pc,in,cc,sp} +% \begin{tabular}{|>{\bfseries}c|r*{9}{|r}|} \hline +% \thead{units} & \repeatcell[c]\listofunits{ text=\c, font=\bfseries } \\ \hline +% \thead{value in \\ scaled\\ points} & \repeatcell\listofunits{ sp=\number\dimexpr1\c\relax, text=\numprint[sp]\sp} \\ \hline +% \end{tabular} +% } +% +% \subsection{Variable length cell} +% +% \begin{Verb}[commandchars=Ł:;] +% \newcommand\FAMILY[3]{% +% \begin{:ŁdgŁunderline:tabular;;}{|*{3}{>{\centering\arraybackslash}m{.12\linewidth}}|} \hline +% Mother & Father & Children \\ \hline +% #1 & #2 & \makecell{:Łred:\repeatcell;;{#3}{text=:Łpkgcolor:\c;;, :Łopt:transpose;;} \\ \hline +% \end{:ŁdgŁunderline:tabular;;}} +% \FAMILY{Johanne}{Georg}{Priscilla,John,Tom} +% \FAMILY{Nut}{Geb}{Isis,Osiris,Seth,Nephthys} +% \end{Verb} +% +% +% \newcommand\FAMILY[3]{^^A +% \begin{tabular}{|*{3}{>{\centering\arraybackslash}m{.12\linewidth}}|} \hline +% Mother & Father & Children \\ \hline +% #1 & #2 & \makecell{\repeatcell[c]{#3}{text=\c,font=\color{green},transpose}} \\ \hline +% \end{tabular}} +% {\footnotesize \centering +% \FAMILY{Johanne}{Georg}{Priscilla,John,Tom} +% \FAMILY{Nout}{Geb}{Isis,Osiris,Seth,Nephthys}\par +% } +% +% +% \subsection{Empty rows} +% +% {\footnotesize +% \begin{Verb*} +% \begin{tabular}{*{6}{|c}|} \hline +% \repeatcell 6{ text/col1=\row, rows=4, end=\\ \hline } \\ \hline +% \end{tabular} +% \begin{tabular}{*{4}{|c}|} \hline +% \repeatcell 6{ text/col1=\row, rows=4, end=\\ \hline , ($opt(transpose))} \\ \hline +% \end{tabular} +% \end{Verb*} +% +% \begin{tabular}{*{6}{|c}|} \hline +% \repeatcell 6{ text/col1=\row, rows=4, end=\\ \hline } \\ \hline +% \end{tabular} \qquad +% \begin{tabular}{*{4}{|c}|} \hline +% \repeatcell 6{ text/col1=\row, rows=4, end=\\ \hline , transpose } \\ \hline +% \end{tabular} +% +% } +% +% \subsection{color palette} +% \label{repeatcell:colors} +% {\footnotesize +% \begin{Verb*}[commandchars=Ł|+] +% \begin{|ŁdgŁunderline|tabular++}{*{4}c} +% |Ł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|tabular++} +% \end{Verb*} +% }§ +% \begin{center}\smaller +% \begin{tabular}{*{4}{c}} +% \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{tabular} +% \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\baselineskip +% +% {\footnotesize \def\${\textt[\pkgcolor]\textdollar} +% \begin{Verb}[commandchars=Ł:;] +% \def\listofx{ -4 , -2 , 0 , 2.25 , 7 } +% $$\begin{:ŁdgŁunderline:array;;}{|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:array;;}$$ +% \end{Verb} +% § +% \def\listofx{ -4 , -2 , 0 , 2.25 , 7 } +% $$\begin{array}{|c<{\bottopstrut}|*{5}{|D..{5.5}}|} \hline +% \rowfont{\large\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{array}$$ +% \centerline{\$\cs{pgfmath}\$ computations}§ +% +% $$\begin{array}{|c<{\bottopstrut}|*{5}{|D..{5.5}}|} \hline +% \rowfont{\large\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{array}$$ +% \centerline{And the same with \$\$\cs{FPeval}\$\$\, (\xpackage{fp} package)} +% } +% +% \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:tabular;;}{*{:Ł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:tabular;;}\quad +% \begin{:ŁdgŁunderline:tabular;;}{|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:tabular;;} +% \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}} +% +% \iftrue ^^A set to true to compute. +% \begin{tabular}{*{\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{tabular}\quad +% \begin{tabular}{|c|} +% \repeatcell{denutrition,skinniness,normal,obesity,serious obesity,morbid obesity}{% +% text=\cellcolor{\c}{\c},transpose,font=\large\bfseries\bottopstrut} +% \end{tabular} +% \medskip +% +% \begin{tabular}{*{\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{tabular}\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]\{\\ +% \hphantom{\cs{setlist}\stform*}\smaller\xkeytab[olX]{ +% ^^A\begin{tabular} +% label &the label to be used \\ +% font &the label font \\\hdashline[1.5pt/1pt] +% topsep &vertical space before the list \\ +% partopsep &vertical space \\ +% parsep &value of \cs{parskip} inside the list \\ +% itemsep &vertical space between two items \\\hdashline[1.5pt/1pt] +% 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 +% ^^A\end{tabular} +% } \\ +% \cs[\red]{setlist}\stform*\M[environment,level]\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} +% +% {\def\AMS{{$\cal A$\kern-.1667em\lower.5ex\hbox{$\cal M$}\kern-.125em$\cal S$}} +% Just like \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... +% +% \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{tabular}{>{\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{tabular} +% +% 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{tabular}{*{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{tabular}}§ +% {\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*} +% +% \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).} +% } +% +% +% \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[interface-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/ &replace 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/ &store value (\emph{expanded value}) in the key. Created \stform+ and \stform* keys to append code \\ +% \handler/.store as code in cs/, \handler/.estore as code in cs/ &store value (\emph{expanded value}) in a cs-name rather than in the key. Created \stform+ and \stform* keys to append code \\ +% \handler/.store as color/, \handler/.store as color command/ &store the color (\emph{the color command}) in the key. \\ +% \handler/.store as color in cs/, \handler/.store as color command in cs/ &the same, store in the cs-name rather than in the key \\ +% \handler/.store as number/, \handler/.estore as number/ &store 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/.defcounter/ &the same, but stores into a \LaTeX{} counter \\ +% \handler/.store as glue/, \handler/.estore as glue/ &store a glue in the key (\stform+\, \stform-\, and\, \stform* keys are provided to add, substract or scale) \\ +% \handler/.store as glue in cs/, \handler/.estore as glue in cs/ &the same, store in a given named control sequence \\ +% \handler/.store as dimen/, \handler/.estore as dimen/ &store a dimen in the key (with \stform+\, \stform-\, and\, \stform* keys for addition, substraction and scaling) \\ +% \handler/.store as dimen in cs/, \handler/.estore as dimen in cs/ &the same, store in a given named control sequence rather than in the key itself \\ } +% +% \smaller +% \def\parsetest#1\\#3\END{\makecell[tl]{\repeatcell{#1}{text=\c,transpose}}\\ \ifblank{#3}{}{\hdashline[1.5pt/0.4pt] \parsetest #3\END}} +% \begin{tabularx}\linewidth{lX}\toprule +% \expandafter\parsetest\temp\END +% \bottomrule +% \end{tabularx} +% } +% +% 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/} +% +% 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[interface-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/} +% +% 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/} +% 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/} +% +% 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/} +% +% 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[interface-titlesec]) is a good example.} +% +% \subsection[/.is enum]{Handler definition: \handler/.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/} +% +% 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}} +% +% 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/} +% +% 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}} +% +% 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/} +% +% \subsection[/.store as number in cs]{Handlers definition: \handler/.store as number in cs/, \handler/.estore as number in cs/} +% +% \ClearPage +% \subsection(/.store as glue)[/.store as glue]{Handler definition: \handler/.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/} +% +% 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}} +% +% 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}} +% +% 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}} +% +% 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[interface-titlesec] and \thispackage[interface-bookmark] are loaded. +% +% \makeatletter \newcounter{PatchedCommand} +% \newcolumntype\X{>{\centering\arraybackslash}X} +% \newrobustcmd\PatchedCommand[4][]{\begingroup\small \stepcounter{PatchedCommand}% +% \hbox{\llap{\ding{\number\numexpr181+\value{PatchedCommand}}\,\,} +% \begin{tabularx}\linewidth{|\X|c|\X|\X|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{tabularx}}\endgroup} +% \makeatother +% +% \begingroup\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{tabular}{*{4}{c}} +% \repeatcell{ltx@pkgextension,ltx@clsextension,ltx@ifpackageloaded,ltx@ifclassloaded}{text=\cs{\c}} +% \end{tabular} +% +% 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}{interface-titlesec,interface-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}{interface-scrlfile}{1} +% +% The \cs{input} primitive (saved by \LaTeX{} in 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[array]{\xpackage{array}} +% +% \PatchedCommand[array]{prepnext@tok}{interfaces-makecell}{1} +% +% \cs{prepnext@tok} is replaced by \cs{itf@prepnext@tok} for the purpose of inserting \cs{itf@celllalign} and \cs{itfcellleft} +% at the left edge of each cell in a tabular and \cs{itf@cellright} \cs{itf@cellralign} at the right edge of each cell. +% +% This allows \cs{rowfont} to change the font (and optionally the alignment) for all cells in a tabular or array row. +% +% \subsection[bookmark]{\xpackage{bookmark} \cs{\backslashchar bookmark}} +% +% \PatchedCommand[bookmark]{bookmark}{interface-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 reach (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} +% +% \ClearPage +% \subsection[colortbl]{\xpackage{colortbl}} +% +% \PatchedCommand[colortbl]{CT@cellc,endarray}{interface-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*} +% +% \csbf{endarray}: missed \cs{@arrayleft} in the redefinition of \xpackage{colortbl}, then +% compatibility with \xpackage{delarray} is broken. Bug fixed by \thispackage[interfaces-base]. +% +% Same problem for \xpackage{arydshln} who redefines \cs{endarray}, taking care of \xpackage{colortbl} +% but not of \xpackage{delarray}. Bug fixed by \thispackage[interfaces-base]. +% +% 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} +% +% \PatchedCommand[hypbmsec]{ttl@select}{interfaces-hypbmsec,interfaces-titlesec}{1} +% +% The update of \cs{lastsectiontitle}, \cs{lastsectionbookmark} and \cs{lastsectiontoc} occurs at the beginning of \cs{ttl@select}. +% At that time, those macros receive the values for the current section that were stored at the beginning of \cs{hbs@process}. +% +% \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,pgfkeys@exp@call}{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. +% +% +% \endgroup ^^A \smaller +% \bookmarksetup{bold=false,color=black} +% +% +% +% +% \StopEventually{ +% } +% +% \IMPLEMENTATION +% +% \sectionformat\subsection{bookmark/color=pkgcolor} +% \subsection{Interfaces} +% +% The package namespace is \textttbf{\db itf@}. +% +% \begin{macrocode} +%<*package> +\NeedsTeXFormat{LaTeX2e}[2005/12/01] +\ProvidesPackage{interfaces} + [2010/10/20 v1.0 - pgfkeys macros for other packages (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} +\itf@tp{fancyvrb} +\if\relax\@ptionlist{interfaces.sty}\relax % no option given + \ExecuteOptions\@declaredoptions % all interfaces are active +\fi +\ProcessOptions +%</package> +% \end{macrocode} +% +% \subsection{Interfaces-base} +% +% \begin{macrocode} +%<*base> +\ProvidesPackage{interfaces-base} + [2010/10/10 v1.0 Basic macros for interfaces package (FC)] +\RequirePackage{etex,ltxcmds,etoolbox,pgfkeys,scrlfile} +\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]{\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{Bug Fixes} +% +% David Carlisle's \xpackage{colortbl} is not compatible with David Carlisle's \xpackage{delarray}!! +% +% Bug Fixed by \thispackage[interfaces-base]. At the same time, the bug exist as well in \xpackage{arydshln} +% and we fix it. +% +% \begin{macro}{\endarray} +% \patchlabel{endarray} +% \begin{macrocode} +\AfterPackage*{colortbl}{% + \renewcommand*\endarray{% + \crcr \egroup \egroup \@arrayright \gdef\@preamble{}\CT@end}% +}% AfterPackage colortbl +\AfterPackage*{arydshln}{% + \ltx@ifpackageloaded{colortbl} + {% colortbl + \def\endarray{% + \adl@endarray \egroup \adl@arrayrestore \CT@end \egroup %<original> + \@arrayright % <FC> + \gdef\@preamble{}% <FC> + }% + } + {% no colortbl + \def\endarray{% + \adl@endarray \egroup \adl@arrayrestore \egroup %<original> + \@arrayright % <FC> + \gdef\@preamble{}% <FC> + }% + }% +}% AfterPackage arydshln +% \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} + {\PackageWarning{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{\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{% + \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{% + \let\itf@tp#2% + #1\itf@tp{#3}{#4}% + {\let#2\itf@tp + \AtBeginDocument{#5}% + } + {#6}% +}% \itf@patch@inside (for \patchcmd) +% \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<text>\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@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} +\begingroup \@makeother\M\@makeother\U + \lowercase{% + \gdef\itf@rem@mu#1.#2MU{#1\ifnum#2>\z@.#2\fi}% + }% +\endgroup +% \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} +\def\itf@units@mu#1#2{\begingroup\@makeother\P + \@makeother\T\@makeother\S\@makeother\B\@makeother\C + \@makeother\M\@makeother\D\@makeother\I\@makeother\N + \edef\itf@tp{#2}% + \lowercase{\@tfor\x:={PT}{PC}{IN}{BP}{CM}{MM}{DD}{CC}{SP}\do}{% + \@expandtwoargs\in@\x\itf@tp\ifin@\expandafter\@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 ) +\def\itf@units@pt#1#2{\begingroup\@makeother\M\@makeother\U + \lowercase{\@expandtwoargs\in@{MU}}{#2}% + \expandafter\endgroup + \ifin@ + #1=\itf@units@mutopt{#2}% + \else + \@defaultunits#1 #2pt\relax\@nnil + \fi +}% \itf@units@pt +% \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@normalize +% \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} +%</base> +% \end{macrocode} +% +% \Subsection[LaTeX] +% +% \begin{macrocode} +%<*LaTeX> +\ProvidesPackage{interfaces-LaTeX} + [2010/10/10 v1.0 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/.store as glue in cs=f@baselineskip,% + baselineskip/.append code=\set@fontsize\f@linespread\f@size\f@baselineskip,% + skip/.alias*=baselineskip,% + linespread/.estore as dimen in cs=f@linespread,% + linespread/.add code={\ifx\f@linespread\@empty\let\f@linespread\@ne\fi}% + {\edef\f@linespread{\expandafter\rem@pt\f@linespread}% + \set@fontsize\f@linespread\f@size\f@baselineskip},% + linespread+/.prefix code=\ifx\f@linespread\@empty\let\f@linespread\@ne\fi,% + linespread-/.prefix code=\ifx\f@linespread\@empty\let\f@linespread\@ne\fi,% + linespread*/.prefix code=\ifx\f@linespread\@empty\let\f@linespread\@ne\fi,% + spread/.alias*=linespread,% +}% \pgfkeys definitions for \changefont +% \end{macrocode} +% +% \subsubsection{\cs{rowfont}} +% +% \begin{macro}{\rowfont} +% +% \cs{rowfont} uses the control sequences \cs{itf@celllalign}, \cs{itf@cellleft}, \cs{itf@cellright}\linebreak +% and \cs{itf@cellralign} which have been placed on purpose into the user-defined tokens inserted +% in any preamble by the \xpackage{array} package. +% +% \cs{itf@celllalign} and \cs{itf@cellralign} are used to modify the alignment. If the optional +% \M[alignment] parameter of \cs{rowfont} is not specified, then those control sequence expand +% to \cs{@empty}. +% +% \cs{itf@cellleft} contains the font-modification information. +% +% Placement of those control sequences into the user-tokens that are inserted in the preamble +% by the \xpackage{array} package is explained below under the macro \cs{itf@prepnext@tok}. +% +% \begin{macrocode} +\newtoks\itf@everycr@tok % better than colortbl turnaround for \everycr +\newcommand*\rowfont{\noalign{\ifnum0=`}\fi\itf@rowfont} +\newrobustcmd*\itf@rowfont[2][]{% + \global\itf@everycr@tok\everycr + \global\let\itf@@cellleft\itf@cellleft + \global\let\itf@@cellright\itf@cellright + \gdef\itf@cellfont{#2}% + \ifcsname itf@cell@#1\endcsname % row alignment + \csname itf@cell@#1\endcsname + \else\lowercase{% + \ifcsname itf@cell@#1\endcsname + \csname itf@cell@#1\endcsname + \fi + }\fi + \toks@\expandafter{\itf@cellleft\itf@cellfont}% inside \noalign group ok + \xdef\itf@cellleft{\the\toks@}% + \global\everycr\expandafter\expandafter\expandafter{% + \expandafter\the\expandafter\everycr\expandafter\itf@rowfont@reset}% + \ifnum0=`{\fi}% end of noalign group +}% \rowfont +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@rowfont@reset} +% This macro resets \cs{itf@celllalign},\, \cs{itf@cellleft},\, \cs{itf@cellright},\, \cs{itf@cellralign}\, and\, +% \cs{everycr} to the value they had before the expansion of \cs{rowfont}. +% +% It expands when a new row is inserted into the tabular or array. +% \begin{macrocode} +\def\itf@rowfont@reset{% + \noalign{% + \global\let\itf@cellleft\itf@@cellleft + \global\let\itf@cellright\itf@@cellright + \global\let\itf@cellfont\@empty + \global\let\itf@celllalign\@empty + \global\let\itf@cellralign\@empty + \global\everycr\itf@everycr@tok + \global\itf@everycr@tok{}% + }% +}% \itf@rowfont@reset +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@prepnext@tok} +% \patchlabel[prepend]{prepnext@tok}\label{itf@prepnext@tok} +% +% \cs{itf@prepnext@tok} will replace \cs{prepnext@tok} (in \xfile{array.sty}): its purpose is to add +% the control sequences \cs{itf@celllalign},\, \cs{itf@cellleft},\, \cs{itf@cellright}\, and\, \cs{itf@cellralign}\, +% at the right position in the ``preamble'' for \cs{halign}. Those control sequences are not inserted directly +% into the preamble, but by the means of the user-tokens placed there by the \xpackage{array} package. +% +% The package \xpackage{array} defines a macro \cs{prenext@tok} to initialize each user-token +% inserted at both side of each ``normal'' column. For ``special`' \texttbf @ and \texttbf ! columns, +% there is only one token. \topsep=0pt +% \begin{center} +% \begin{tikzpicture} +% \node (L) at (1,1) {$\underbrace{\hbox{>\M*{\cs{bfseries}\cs{color}\M*{red}}}}$} +% node [anchor=west] (r) at (L.east) {\raise.5ex\hbox{\larger r}} +% node [anchor=west] (R) at (r.east) {$\underbrace{\hbox{<\M*{\cs{color}\M*{black}\cs ,\cs\$}}}$} +% node [anchor=center] at (L.south) {\cs{toks}<$i$>} +% node [anchor=center] at (R.south) {\cs{toks}<$i+1$>}; +% \end{tikzpicture} +% \end{center} +% +% When a column is inserted in the tabular preamble (\cs{@preamble}), the \TeX{} counter \cs{count@} +% is equal to $i+1$ (\ie the right token) and the counter \cs{@tempcnta} is equal to $i$ (\ie the left token). +% If the column is special (\ie \texttbf @ or \texttbf !) \cs{@tempcnta} is not updated. +% +% Thus, when a new token is ``prepared'' by \cs{prepnext@tok}: +% \begin{description} +% \item[either: $\mathbf{i=}$\cs{count@}$\,=$\cs{@tempcnta}]: the token to prepare (\ie \cs{toks}$<i+1>$) +% is the right one of a ``normal'' column. The switch \cs{ifitf@cellright} is set to \textt{true}. \\ +% The \emph{previous} token (\cs{toks}$<i>=$\cs{toks}\cs{count@}) is necessarily the left one of this ``normal'' column: +% we prepend \cs{itf@celllalign} and append \cs{itf@cellleft} to this token (\cs{toks}$<i>$). +% This token is finished and will not changed afterwards. +% +% \item[or: $\mathbf{i=}$\cs{count@}$\,=$\cs{@tempcnta}$+1$]: the token to prepare (\cs{toks}$<i+1>$) is either the left one of a normal column, +% or the single one of a special\, \texttbf @ or \texttbf !\, column.\\ +% If the switch \cs{ifitf@cellright} is true, then the \emph{previous} token \cs{toks}$<i>$ is the right one of the last inserted column +% (which was a ``normal'' column, thus):, \cs{itf@cellright}\cs{itf@cellralign}\, is appended to it, and the switch +% \cs{ititf@cellright} is reset to \texttt{false}. +% May be \cs{prepnext@tok} will be expanded again (by \cs{save@decl}): if it happens, +% then again\, \cs{count@}$\,=$\cs{@tempcnta}$+1$\, (same case) but \cs{ifitf@cellright} is \textt{false} and nothing is changed. +% +% \item[else:] The token to prepare (which is \cs{toks}$<i+1>=$\cs{toks}\cs{count@}$+1$), cannot be the right one of a ``normal'' column: +% \cs{ifitf@cellright} is set to \textt{false}. \\ +% The fact that\, $\vert$\cs{count@}$-$\cs{@tempcnta}$\vert>1$\, tells us that the previous token \cs{toks}$<i>$ +% is necessarily the single one of a ``special''\, \texttbf @ or \texttbf !\, column. We don't modify this token, as +% long as \emph{special columns are always inserted as is}:\, \cs{rowcolor} has no effect on special +% columns, nor\, \cs{rowfont}. +% \end{description} +% Thereafter, the original initialisation sequence occurs: \cs{advance}\cs{count@}\textt{ by}\cs{@ne} and initialize the token +% to prepare (\cs{toks}\cs{count@}$\,=$\cs{toks}$<i+1>$) to an empty one. +% +% \begin{macrocode} +\newif\ifitf@cellright +\def\itf@prepnext@tok{% only if array is loaded + \itf@cnt = \count@ + \advance \itf@cnt -\@tempcnta + \ifcase \itf@cnt % (case 0): previous token is left + \itf@cellrighttrue % consequently the token to prepare is right ! + \toks\count@\expandafter{% augment the previous (left) token + \expandafter\itf@celllalign + \the\toks\count@ + \itf@cellleft}% + \or % (case 1) + \ifitf@cellright % previous token is right + \itf@cellrightfalse% consequently the token to prepare is not right ! + \toks\count@=\expandafter{% augment the previous (right) token + \the\toks\count@ + \itf@cellright + \itf@cellralign}% + \fi + \else % special column: do not change the token + \itf@cellrightfalse % the token to prepare cannot be right ! + \fi + \advance \count@ \@ne \toks\count@{}% \prepnext@tok original def +}% \itf@prepnext@tok +\AfterPackage*{array}{% + \global\let\array@prepnext@tok\prepnext@tok % frozen original definition + \global\let\prepnext@tok\itf@prepnext@tok +}% \AfterPackage*{array} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@cellleft} +% \begin{macro}{\itf@celllalign} +% \begin{macro}{\itf@cellright} +% \begin{macro}{\itf@cellralign} +% \begin{macro}{\itf@cellfont} +% First initialisation to \cs{@empty}. +% \begin{macrocode} +\let\itf@cellleft\@empty +\let\itf@cellright\@empty +\def\itf@celllalign{\itf@cellleft}% the row font spec. applies to pre-column material +\let\itf@cellralign\@empty +\let\itf@cellfont\@empty +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\itf@cell@l} +% \begin{macro}{\itf@cell@c} +% \begin{macro}{\itf@cell@r} +% \begin{macro}{\itf@cell@j} +% Setup macros to modify the alignment. The skips inserted to make the standard alignment +% specified in the \textt{tabular} preamble are not the same with standard \xpackage{array} tabulars +% and \xpackage{colortbl} tabulars, hence the switch \cs{ifitf@colortbl}. +% \begin{macrocode} +\let\ifitf@colortbl\iffalse +\AfterPackage*{colortbl}{\let\ifitf@colortbl\iftrue} +\def\itf@cell@l{% force alignment to left + \gdef\itf@celllalign{\itf@removehfil + \raggedright\arraybackslash + \itf@cellleft}% + \gdef\itf@cellralign{\itf@flush1\itf@ignorehfil}% + \toks@\expandafter{\itf@cellleft\raggedright\arraybackslash}% local (noalign group) + \xdef\itf@cellleft{\the\toks@}% +}% \itf@cell@l +\def\itf@cell@c{% force alignment to center + \gdef\itf@celllalign{\itf@removehfil + \centering\arraybackslash + \itf@flush{.5}\itf@cellleft}% + \gdef\itf@cellralign{\itf@flush{.5}\itf@ignorehfil}% + \toks@\expandafter{\itf@cellleft\centering\arraybackslash}% local (noalign group) + \xdef\itf@cellleft{\the\toks@}% +}% \itf@cell@c +\def\itf@cell@r{% force alignment to right + \gdef\itf@celllalign{\itf@removehfil + \raggedleft\arraybackslash + \itf@flush1\itf@cellleft}% + \gdef\itf@cellralign{\itf@ignorehfil}% + \toks@\expandafter{\itf@cellleft\raggedleft\arraybackslash}% local (noalign group) + \xdef\itf@cellleft{\the\toks@}% +}% \itf@cell@r +\def\itf@cell@j{% force justification (for p, m, b columns) + \gdef\itf@celllalign{\itf@justify\itf@cellleft}% + \global\let\itf@cellralign\@empty + \toks@\expandafter{\itf@cellleft\itf@justify}% local (noalign group) + \xdef\itf@cellleft{\the\toks@}% +}% \itf@cell@j +\def\itf@justify{% + \leftskip\z@skip \@rightskip\leftskip \rightskip\@rightskip + \parfillskip\@flushglue +}% \itf@justify +\AfterPackage*{ragged2e}{% +\def\itf@cell@L{% force alignment to left (ragged2e) + \gdef\itf@celllalign{\itf@removehfil + \RaggedRight\arraybackslash + \itf@cellleft}% + \gdef\itf@cellralign{\itf@flush1\itf@ignorehfil}% + \toks@\expandafter{\itf@cellleft\RaggedRight\arraybackslash}% + \xdef\itf@cellleft{\the\toks@}% +}% \itf@cell@L +\def\itf@cell@C{% force alignment to center (ragged2e) + \gdef\itf@celllalign{\itf@removehfil + \Centering\arraybackslash + \itf@flush{.5}\itf@cellleft}% + \gdef\itf@cellralign{\itf@flush{.5}\itf@ignorehfil}% + \toks@\expandafter{\itf@cellleft\Centering\arraybackslash}% + \xdef\itf@cellleft{\the\toks@}% +}% \itf@cell@C +\def\itf@cell@R{% force alignment to right (ragged2e) + \gdef\itf@celllalign{\itf@removehfil + \RaggedLeft\arraybackslash + \itf@flush1\itf@cellleft}% + \gdef\itf@cellralign{\itf@ignorehfil}% + \toks@\expandafter{\itf@cellleft\RaggedLeft\arraybackslash}% + \xdef\itf@cellleft{\the\toks@}% +}% \itf@cell@R +\def\itf@cell@J{% force justification (ragged2e) + \gdef\itf@celllallign{\justifying\arraybackslash\itf@cellleft}% + \global\let\itf@cellralign\@empty + \toks@\expandafter{\itf@cellleft\justifying\arraybackslash}% + \xdef\itf@cellleft{\the\toks@}% +}% \itf@cell@J +}% AfterPackage ragged2e +\def\itf@flush#1{% + \ifitf@colortbl % colortbl uses \hfill rather than \hfil + \hskip \ifnum\currentgrouptype>13 \stretch{#1}% + \else\ifdim#1pt<1pt \itf@cellskip + \else \stretch{#1} + \fi\fi \relax + \else % array.sty + \ifnum \currentgrouptype>13\relax + \hfil \hskip1sp + \fi + \fi +}% \itf@flush +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\itf@removehfil} +% \begin{macro}{\itf@ignorehfil} +% \cs{itf@removehfil} removes (eventually) the infinite stretchable glue inserted +% \emph{before} the cell (in the preamble of \cs{halign}) to make the column alignment. +% +% \cs{itf@ignorehfil} removes (eventually) the infinite stretchable glue inserted +% \emph{after} the cell (in the preamble of \cs{halign}) to make the column alignment. +% \begin{macrocode} +\newskip\itf@cellskip +\let\itf@hfil\hfil +\let\itf@hfill\hfill +\let\itf@hskip\hskip +\def\itf@removehfil{% + \ifitf@colortbl + \unkern \itf@cellskip = \lastskip + \ifnum\gluestretchorder\itf@cellskip = \tw@ \hskip-\itf@cellskip + \else \itf@cellskip = \z@skip + \fi + \else + \ifdim\lastskip=1sp\unskip\fi + \ifnum\gluestretchorder\lastskip = \@ne + \hfilneg % \hfilneg for array.sty but not for colortbl... + \fi + \fi +}% \itf@removehfil +\def\itf@nohfil{% \hfil -> do nothing + restore original \hfil + \def\hfil{\let\hfil\itf@hfil}% local to (alignment template) group +}% \itf@nohfil +\AfterPackage*{colortbl}{% + \def\itf@nohfil{% + \def\hfil{\let\hfil\itf@hfil}% local to (alignment template) group + \def\hfill{\let\hfill\itf@hfill}% (colortbl uses \hfill) pfff... + \def\hskip##1\relax{\let\hskip\itf@hskip}}% local +}% AfterPackage colortbl +\def\itf@ignorehfil{% + \aftergroup\itf@nohfil +}% \itf@ignorehfil +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macrocode} +%</LaTeX> +% \end{macrocode} +% +% \Subsection[TikZ] +% +% \begin{macrocode} +%<*tikz> +\ProvidesPackage{interfaces-tikz} + [2010/09/21 v1.0 load of 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{% + pgf,pgfmath,pgfcalendar,pgfplots,pgfpages,tikz% +}% \alltikzpackages +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\allpgfmodules} +% Record modules that must be loaded with \cs{usepgfmodule}: +% \begin{macrocode} +\newcommand*\allpgfmodules{matrix,plot} +% \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{% + arrows,% + chains,% + er,% + scopes,% + snakes,% + shapes,% + shapes.misc,% + shapes.geometric,% + shapes.arrows,% + shapes.multipart,% + shapes.callouts,% + shapes.symbols,% + shapes.gates.logic.US,% + shapes.gates.logic.IEC,% + decorations,% + decorations.pathmorphing,% + decorations.pathreplacing,% + decorations.shapes,% + decorations.text,% + decorations.markings,% + decorations.fractals,% + decorations.footprints,% + positioning,trees,% + automata,% + patterns,% + fadings,% + shadows,% + through,% + backgrounds,% + petri,% + fit,% + mindmap,% + folding,% + plothandlers,% + plotmarks,% + calc,% + matrix% +%% topath,placements,% +}% \alltikzlibraries +% \end{macrocode} +% \end{macro} +% +% \subsubsection{pgfkeys definitions for \cs{usetikz}} +% +% \begin{macrocode} +\pgfqkeys{/itf/tikz}{% + basic/.code={% + \usetikzlibrary{calc,% + arrows,% for arrows + backgrounds,% for framed + scopes% for scopes and shortcut : { [scope] ... } + }% + },% + 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@pgfkeys% overwritten by \input primitive otherwise +}% \usetikz +% \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} +% \begin{macrocode} +%</tikz> +% \end{macrocode} +% +% \sectionformat\subsection{bookmark/color=db} +% \Subsection[titlesec] +% +% \begin{macrocode} +%<*titlesec> +\ProvidesPackage{interfaces-titlesec} + [2010/10/20 v1.0 pgfkeys macros for titlesec (FC)] +\RequirePackage{interfaces-base} +\RequirePackage{auxhook}% for fix for \ttlp@append (odd/even pages, not implemented in interfaces) +\itf@Check@Package{titlesec} +\itf@pgfkeys +% \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}{% + \catcode32 9\relax % ignore spaces + \count@\endlinechar\endlinechar\m@ne % and line feeds +} +\AfterFile*{ttlkeys.def}{% restore spaces and line feeds + \catcode32 10\relax + \endlinechar\count@ +} +% \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},shape={#3},#4,/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 + {\expandafter\expandafter\expandafter% + \itf@ttl@getformat\csname ttlf@#1#2\endcsname{/itf/titlesec/#1#2}}% +}% \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\@temptokena{\csdef{ttlf@\ttl@a}##1}% + \else\@temptokena{\csdef{ttlf@\ttl@a}}% + \fi + \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}}}% + \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}% subsection\relax{article} => \@addtoreset{article}{subsection} + \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}{% + \AtBeginDocument{% + \csletcs{hbs@#1}{#1}% + \csxdef{#1}{\noexpand\hbs@do\expandafter\noexpand\csname hbs@#1\endcsname}% + }% + }% + \itf@AfterPackage{interfaces-tocloft}{% + \itf@cft@newsection{#1}{toc}% + }% + \itf@AfterPackage{interfaces-hypbmsec}{% + \cslet{last#1title}\@empty + \cslet{last#1bookmark}\@empty + \cslet{last#1toc}\@empty + }% +}% \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/numberless 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 (numberless) 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=interface-titlesec,% constant + font/.store as code,% + format/.alias*=font,% + label/.store as code,% + sep/.estore as glue,% + labelsep/.alias*=sep,% + before/.store as code,% + 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\apptocs{#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=,% + bookmark/level/.blank=\ifcsvoid{toclevel@#1}{99}{\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/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/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} + {\PackageInfo{interfaces-titlesec} + {Command \string\addcontentsline\space successfully patched!}} + {\PackageWarning{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/style}}% + \ifx\itf@tp\@empty + \else + \global\pgfkeyslet{#1/bold*}\@empty + \global\pgfkeyslet{#1/italic*}\@empty + \global\pgfkeyslet{#1/color*}\@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{\edef\bottomtitlespace{\the\itf@sk}} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%</titlesec> +% \end{macrocode} +% +% \Subsection[hyperref] +% +% \begin{macrocode} +%<*hyperref> +\ProvidesPackage{interfaces-hyperref} + [2010/08/08 v1.0 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} +%</hyperref> +% \end{macrocode} +% +% \Subsection[bookmark] +% +% \begin{macrocode} +%<*bookmark> +\ProvidesPackage{interfaces-bookmark} + [2010/09/08 v1.0 more control on bookmarks (FC)] +\RequirePackage{interfaces-base} +\RequirePackage{interfaces-hyperref} +\RequirePackage{refcount} +\itf@Check@Package{bookmark} +\itf@pgfkeys +% \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} + {\PackageInfo{interfaces-bookmark} + {Command \expandafter\string\csname\string\bookmark\endcsname\space + successfully patched!}} + {\PackageWarning{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\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={% +%% \pgfqkeys{/itf/bookmark/@restore}{color,FontStyle}% repeating the following lines + \pgfkeysifdefined{/itf/bookmark/@save/color}% is quicker than setting a /.style ... + {\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} +%</bookmark> +% \end{macrocode} +% +% \Subsection[hypbmsec] +% +% \subsubsection{interfaces-hypbmsec} +% +% \begin{macrocode} +%<*hypbmsec> +\ProvidesPackage{interfaces-hypbmsec} + [2010/10/05 v1.0 lastsection etc. (FC)] +\RequirePackage{interfaces-base} +\itf@Check@Package{hypbmsec} +\AfterPackage*{interfaces-titlesec}{% requires interface-titlesec + \input{interfaces-hypbmsec.code.tex}% +}% +%</hypbmsec> +% \end{macrocode} +% +% \subsubsection{interfaces-hypbmsec.code.tex} +% +% \begin{macrocode} +%<*hypbmsec.code.tex> +\ProvidesFile{hypbmsec.code.tex} + [2010/10/05 v1.0 code for interfaces-hypbmsec (FC)] +% \end{macrocode} +% +% \begin{macro}{\hbs@do (patch)} +% \patchlabel[prepend]{hbs@do} +% \begin{macrocode} +\itf@patch\pretocmd\hbs@do{% + \edef\itf@tp{\expandafter\itf@strip@at\string#1}% + }% + {\PackageInfo{interfaces-hypbmsec} + {Command \string\hbs@do\space successfully patched}} + {\PackageWarning{interfaces-hypbmsec} + {Command \string\hbs@do\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}{\hbs@process (patch)} +% \patchlabel[prepend]{hbs@process} +% \begin{macrocode} +\itf@patch\pretocmd\hbs@process{% + \itf@hbs@next{#1}% + }% + {\PackageInfo{interfaces-hypbmsec} + {Command \string\hbs@process\space successfully patched}} + {\PackageWarning{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@next} +% \begin{macrocode} +\long\def\itf@hbs@next#1{% + \csdef{itf@next\itf@tp title}{#1}% + \ifx\hbs@tocstring\relax + \csletcs{itf@next\itf@tp toc}{itf@next\itf@tp}% + \else + \cslet{itf@next\itf@tp toc}\hbs@tocstring + \fi + \ifx\hbs@bmstring\relax + \csletcs{itf@next\itf@tp bookmark}{itf@next\itf@tp toc}% + \else + \cslet{itf@next\itf@tp bookmark}\hbs@bmstring + \fi + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter + \expandafter\itf@hbs@chkclass + \expandafter\expandafter\expandafter\string + \expandafter\hbs@seccmd\string\ttl@\@nil + {} + {\expandafter\itf@last@from@next\expandafter{\itf@tp}}% +}% \itf@hbs@next +\edef\itf@tp{% + \long\def\noexpand\itf@hbs@chkclass##1\string\ttl@##2\noexpand\@nil{% + \noexpand\ifblank{##1}% + }% \itf@hbs@chkclass +}\itf@tp +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ttl@select (patch)} +% \patchlabel[prepend]{ttl@select} +% \begin{macrocode} +\itf@patch\pretocmd\ttl@select{% + \itf@last@from@next{#1}} + {\PackageInfo{interfaces-hypbmsec} + {Command \string\ttl@select\space successfully patched}} + {\PackageWarning{interfaces-hypbmsec} + {Command \string\ttl@select\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@last@from@next} +% \begin{macrocode} +\def\itf@last@from@next#1{% + \expandafter\let\csname last#1title\expandafter\endcsname + \csname itf@next#1title\endcsname + \expandafter\let\csname itf@last#1toc\expandafter\endcsname + \csname itf@next#1toc\endcsname + \expandafter\let\csname last#1bookmark\expandafter\endcsname + \csname itf@next#1bookmark\endcsname + \expandafter\def\csname lastsectionname\endcsname{#1}% +}% \itf@last@from@next +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%%----------------------------------------------------------------------------- +%% \lastsection reinitialization (at \stepcounter-> \cl@section) +\def\itf@hbs@resetlast#1{% + \ifcsname last#1\endcsname + \global\expandafter\let + \csname last#1\endcsname\@empty + \fi +}% \itf@hbs@resetlast +\def\itf@hbs@reset#1{% + \itf@hbs@resetlast{#1title}% + \itf@hbs@resetlast{#1bookmark}% + \itf@hbs@resetlast{#1toc}% + \csuse{cl@#1}% +}% \itf@hbs@reset +% \end{macrocode} +% +% \begin{macrocode} +\let\ltx@stpelt\@stpelt +\def\itf@hbs@stpelt#1{% + \let\@elt\itf@hbs@reset + \@elt{#1}% + \let\@elt\itf@stpelt +}% \itf@hbs@stpelt +\def\itf@stpelt#1{% + \ltx@stpelt{#1}% + \itf@hbs@stpelt{#1}% +}% \itf@stpelt +\let\@stpelt\itf@stpelt +%%----------------------------------------------------------------------------- +% \end{macrocode} +% +% \begin{macrocode} +\@for\itf@tp:=part,section,subsection,subsubsection,paragraph,subparagraph% + \do{\global\expandafter\let\csname last\itf@tp title\endcsname\@empty + \global\expandafter\let\csname last\itf@tp toc\endcsname\@empty + \global\expandafter\let\csname last\itf@tp bookmark\endcsname\@empty}% +\AtBeginDocument{\ifundef\chapter{} + {\global\let\lastchaptertitle\@empty + \global\let\lastchaptertoc\@empty + \global\let\lastchapterbookmark\@empty}% +}% +% \end{macrocode} +% +% \begin{macrocode} +%</hypbmsec.code.tex> +% \end{macrocode} +% +% \Subsection[fancyhdr] +% +% \begin{macrocode} +%<*fancyhdr> +\ProvidesPackage{interfaces-fancyhdr} + [2010/07/22 v1.0 pgfkeys macros for fancyhdr (FC)] +\RequirePackage{interfaces-base} +\itf@Check@Package{fancyhdr} +\itf@pgfkeys +\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=% + \pgfkeysalso{\pgfkeyscurrentpath/.store as code=}% + \csedef{f@ncy#1}{% + \noexpand\pgfkeysvalueof{\pgfkeyscurrentpath/font} + \noexpand\pgfkeysvalueof{\pgfkeyscurrentpath}\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+,% + rule/color/.style={head/rule/color={#1},foot/rule/color={#1}},% + foot/rule/skip/.store as glue in cs=footruleskip,% + foot/rule/skip/.default=.3\normalbaselineskip,% + foot/rule/skip/.blank=\z@,% + foot/ruleskip/.alias*=foot/rule/skip,% => puis les alias&style: /.alias 2 args=/foot/rule/skip{/subkey1,/subkey2,/sub/key3,/sub/key4,...} + footruleskip/.alias*=foot/rule/skip,% crée aussi les alias pour les sous clés + font/.style={head/font={#1},foot/font={#1}},% + head/.style={head/left={#1},head/center={#1},head/right={#1}},% + 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}},% + nohead/.style={head=,head/font=,head/rule=}, + foot/.style={foot/left={#1},foot/center={#1},foot/right={#1}},% + 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}},% + nofoot/.style={foot=,foot/font=,foot/rule=}, + left/.style={head/left={#1},foot/left={#1}},% + left/font/.style={head/left/font={#1},foot/left/font={#1}},% + left/font+/.style={head/left/font+={#1},foot/left/font+={#1}},% + center/.style={head/center={#1},foot/center={#1}},% + center/font/.style={head/center/font={#1},foot/center/font={#1}},% + center/font+/.style={head/center/font+={#1},foot/center/font+={#1}},% + right/.style={head/right={#1},foot/right={#1}},% + right/font/.style={head/right/font={#1},foot/right/font={#1}},% + right/font+/.style={head/right/font+={#1},foot/right/font+={#1}},% + head/left/.style={head/left/even={#1},head/left/odd={#1}},% + 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/center/.style={head/center/even={#1},head/center/odd={#1}},% + 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/right/.style={head/right/even={#1},head/right/odd={#1}},% + 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}},% + foot/left/.style={foot/left/even={#1},foot/left/odd={#1}},% + 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/center/.style={foot/center/even={#1},foot/center/odd={#1}},% + 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/right/.style={foot/right/even={#1},foot/right/odd={#1}},% + 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}},% + head/left/odd/.fancy@hf=olh,% + head/left/odd/font/.store as code=+,% + odd/head/left/.alias=head/left/odd,% + odd/head/left/font/.alias*=head/left/odd/font,% + head/odd/left/.alias=head/left/odd,% + head/odd/left/font/.alias*=head/left/odd/font,% + head/center/odd/.fancy@hf=och,% + head/center/odd/font/.store as code=+,% + odd/head/center/.alias=head/center/odd,% + odd/head/center/font/.alias*=head/center/odd/font,% + head/odd/center/.alias=head/center/odd,% + head/odd/center/font/.alias*=head/center/odd/font,% + head/right/odd/.fancy@hf=orh,% + head/right/odd/font/.store as code=+,% + odd/head/right/.alias=head/right/odd,% + odd/head/right/font/.alias*=head/right/odd/font,% + head/odd/right/.alias=head/right/odd,% + head/odd/right/font/.alias*=head/right/odd/font,% + head/left/even/.fancy@hf=elh,% + head/left/even/font/.store as code=+,% + even/head/left/.alias=head/left/even,% + even/head/left/font/.alias*=head/left/even/font,% + head/even/left/.alias=head/left/even,% + head/even/left/font/.alias*=head/left/even/font,% + head/center/even/.fancy@hf=ech,% + head/center/even/font/.store as code=+,% + even/head/center/.alias=head/center/even,% + even/head/center/font/.alias*=head/center/even/font,% + head/even/center/.alias=head/center/even,% + head/even/center/font/.alias*=head/center/even/font,% + head/right/even/.fancy@hf=erh,% + head/right/even/font/.store as code=+,% + even/head/right/.alias=head/right/even,% + even/head/right/font/.alias*=head/right/even/font,% + head/even/right/.alias=head/right/even,% + even/head/right/font/.alias*=head/right/even/font,% + foot/left/odd/.fancy@hf=olf,% + foot/left/odd/font/.store as code=+,% + odd/foot/left/.alias=foot/left/odd,% + odd/foot/left/font/.alias*=foot/left/odd/font,% + foot/odd/left/.alias=foot/left/odd,% + foot/odd/left/font/.alias*=foot/left/odd/font,% + foot/center/odd/.fancy@hf=ocf,% + foot/center/odd/font/.store as code=+,% + odd/foot/center/.alias=foot/center/odd,% + odd/foot/center/font/.alias*=foot/center/odd/font,% + foot/odd/center/.alias=foot/center/odd,% + foot/odd/center/font/.alias*=foot/center/odd/font,% + foot/right/odd/.fancy@hf=orf,% + foot/right/odd/font/.store as code=+,% + odd/foot/right/.alias=foot/right/odd,% + odd/foot/right/font/.alias*=foot/right/odd/font,% + odd/foot/right/.alias=foot/right/odd,% + odd/foot/right/font/.alias*=foot/right/odd/font,% + foot/left/even/.fancy@hf=elf,% + foot/left/even/font/.store as code=+,% + even/foot/left/.alias=foot/left/even,% + even/foot/left/font/.alias*=foot/left/even/font,% + foot/even/left/.alias=foot/left/even,% + foot/even/left/font/.alias*=foot/left/even/font,% + foot/center/even/.fancy@hf=ecf,% + foot/center/even/font/.store as code=+,% + even/foot/center/.alias=foot/center/even,% + even/foot/center/font/.alias*=foot/center/even/font,% + foot/even/center/.alias=foot/center/even,% + foot/even/center/font/.alias*=foot/center/even/font,% + foot/right/even/.fancy@hf=erf,% + foot/right/even/font/.store as code=+,% + even/foot/right/.alias=foot/right/even,% + even/foot/right/font/.alias*=foot/right/even/font,% + foot/even/right/.alias=foot/right/even,% + foot/even/right/font/.alias*=foot/right/even/font,% + offset/.style={head/offset={#1},foot/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}},% + offset/foot/.alias=foot/offset,% + head/left/offset/.style={head/left/even/offset={#1},head/left/odd/offset={#1}},% + offset/head/left/.alias=head/left/offset,% + head/right/offset/.style={head/right/even/offset={#1},head/right/odd/offset={#1}},% + offset/head/right/.alias=head/right/offset,% + foot/left/offset/.style={foot/left/even/offset={#1},foot/left/odd/offset={#1}},% + offset/foot/left/.alias=foot/left/offset,% + foot/right/offset/.style={foot/right/even/offset={#1},foot/right/odd/offset={#1}},% + offset/foot/right/.alias=foot/right/offset,% + head/left/even/offset/.store in skip cs=f@ncyO@elh,% + offset/head/left/even/.alias=head/left/even/offset,% + head/left/odd/offset/.store in skip cs=f@ncyO@olh,% + offset/head/left/odd/.alias=head/left/odd/offset,% + head/right/even/offset/.store in skip cs=f@ncyO@erh,% + offset/head/right/even/.alias=head/right/even/offset,% + head/right/odd/offset/.store in skip cs=f@ncyO@orh,% + offset/head/right/odd/.alias=head/right/odd/offset,% + foot/left/even/offset/.store in skip cs=f@ncyO@elf,% + offset/foot/left/even/.alias=foot/left/even/offset,% + foot/left/odd/offset/.store in skip cs=f@ncyO@olf,% + offset/foot/left/odd/.alias=foot/left/odd/offset,% + foot/right/even/offset/.store in skip cs=f@ncyO@erf,% + offset/foot/right/even/.alias=foot/right/even/offset,% + foot/right/odd/offset/.store in skip cs=f@ncyO@orf,% + offset/foot/right/odd/.alias=foot/right/odd/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} +%</fancyhdr> +% \end{macrocode} +% +% \subsection{marks} +% +% \begin{macrocode} +%<*marks> +\ProvidesPackage{interfaces-marks} + [2010/10/12 v1.0 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 + \expandafter\marks\csname marks@#1\endcsname{\unexpanded{#2}}% +}% \marksthe +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\marksthecs} +% \begin{macrocode} +\newrobustcmd*\marksthecs[2]{% + \ifcsname marks@#1\endcsname\else + \itf@marks@new{#1}% + \fi + \expandafter\marks\csname marks@#1\endcsname{% + \unexpanded\expandafter\expandafter\expandafter{% + \csname#2\endcsname}}% +}% \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} + {New marks `#1' defined} +}% \itf@marks@warning +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\thefirstmarks} +% \begin{macro}{\thebotmarks} +% \begin{macro}{\thetopmarks} +% \begin{macrocode} +\newcommand*\thefirstmarks[1]{% + \ifcsname marks@#1\endcsname + \expandafter\firstmarks\csname marks@#1\endcsname + \fi +}% \thefirstmarks +\newcommand*\thebotmarks[1]{% + \ifcsname marks@#1\endcsname + \expandafter\botmarks\csname marks@#1\endcsname + \fi +}% \thebotmarks +\newcommand*\thetopmarks[1]{% + \ifcsname marks@#1\endcsname + \expandafter\topmarks\csname marks@#1\endcsname + \fi +}% \thetopmarks +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\getthemarks} +% \begin{macrocode} +%% \getthemarks\firstmarks{section}\macro +\newrobustcmd*\getthemarks[3]{% + \ifcsname marks@#2\endcsname + \expandafter\itf@getthemarks\expandafter#1\csname marks@#2\endcsname{#3}% + \else \let#3\@undefined + \fi +}% \getthemarks +\def\itf@getthemarks#1#2#3{% + \expandafter\def\expandafter#3\expandafter{#1#2}% +}% \itf@getthemarks +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\getthefirstmarks} +% \begin{macro}{\getthebotmarks} +% \begin{macro}{\getthetopmarks} +% \begin{macrocode} +\newrobustcmd*\getthefirstmarks[2]{\getthemarks\firstmarks{#1}{#2}} +\newrobustcmd*\getthebotmarks[2]{\getthemarks\botmarks{#1}{#2}} +\newrobustcmd*\getthetopmarks[2]{\getthemarks\topmarks{#1}{#2}} +% \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}\@tempa + \getthemarks{#2}{#3}\@tempb + \expandafter\endgroup + \csname ltx@\ifdefined\@tempa\ifdefined\@tempb + \ifx\@tempa\@tempb first\else + second\fi\else + second\fi\else + second\fi + oftwo\endcsname +}% \ifmarksequal +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%</marks> +% \end{macrocode} +% +% \Subsection[tocloft] +% +% \begin{macrocode} +%<*tocloft> +\ProvidesPackage{interfaces-tocloft} + [2010/07/23 v1.0 pgfkeys macros for tocloft (FC)] +\RequirePackage{interfaces-base} +\itf@Check@Package{tocloft} +\itf@pgfkeys +% \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{% + \pgfqkeys{/itf/tocloft/#1}{% + pagestyle/.code=\tocloftpagestyle{##1},% + parskip/.store in skip cs=cftparskip,% + parsep/.alias=parskip,% + mark/.store in cs=cftmark#1,% + marks/.alias=mark,% + label/.store as code,% + ref/.store as code,% + ref/.initial=\csname cft#1title\endcsname,% overwritten (toc,lof,lot) + ref/.default=\csname cft#1title\endcsname,% overwritten (toc,lof,lot) + ref/.blank=\pgfkeysnovalue,% + title/.store as code in cs=cft#1title,% overwritten below for toc, lof and lot + title/top/.store in skip cs=cftbefore#1titleskip,% + beforetitleskip/.alias*=title/top,% + title/bottom/.store in skip cs=cftafter#1titleskip,% + aftertitleskip/.alias*=title/bottom,% + title/font/.store as code in cs=cft#1titlefont,% + title/format/.alias*=title/font,% + title/after/.store as code in cs=cftafter#1title,% + dotsep/.code=\itf@units@mu\itf@musk{##1}% converts to mu + \edef\cftdotsep{\itf@strip@mu\itf@musk},% + dotsep/.default=4.5mu,% + dotsep/.blank=\cftnodots,% + dot/.store in=\cftdot,% + before/.store as code,% + after/.store as code,% + columns/before@hook/.is private=interfaces-tocloft,% + columns/after@hook/.is private=interfaces-tocloft,% + columns/before@hook/.initial=,% + columns/after@hook/.initial=,% + columns/.code={\ltx@ifpackageloaded{multicol}{% + \pgfkeysEsetvalue\pgfkeyscurrentkey{\number##1}% + \ifnum\number##1>\@ne + \pgfkeysgetvalue{/itf/tocloft/#1/columns/before@hook}\itf@tp + \ifx\itf@tp\@empty + \pgfkeyssetvalue{/itf/tocloft/#1/columns/before@hook}{% + \begingroup + \multicolsep\pgfkeysvalueof{/itf/tocloft/#1/multicolsep}\relax + \begin{multicols}{\pgfkeysvalueof{/itf/tocloft/#1/columns}}% + \columnseprule\pgfkeysvalueof{/itf/tocloft/#1/columns/rule}\relax + \columnsep\pgfkeysvalueof{/itf/tocloft/#1/columns/sep}\relax + \pgfkeysgetvalue{/itf/tocloft/#1/columns/rule/color}\columnseprulecolor + \pgfkeysvalueof{/itf/tocloft/#1/multicols/begin}% + }% + \pgfkeyssetvalue{/itf/tocloft/#1/columns/after@hook}{% + \pgfkeysvalueof{/itf/tocloft/#1/multicols/end}% + \end{multicols} + \endgroup + }% + \fi + \else + \pgfkeyslet\pgfkeyscurrentkey\@ne + \pgfkeyslet{/itf/tocloft/#1/columns/before@hook}\@empty + \pgfkeyslet{/itf/tocloft/#1/columns/after@hook}\@empty + \fi} + {\PackageError{interfaces-tocloft} + {Key `columns': package multicol is required}\@eha}% + },% + columns/.default=2,columns/.blank=1,% + multicol/.alias=columns,% + multicols/.alias=columns,% + twocolumns/.true=\pgfkeysalso{columns=2},% + twocolumns/.false=\pgfkeysalso{columns=1},% + columns/rule/.store as dimen,% + columns/rule/.default=\columnseprule,% + columns/rule,% assign default + columnseprule/.alias*=columns/rule,% + columns/sep/.store as dimen,% + columns/sep/.default=\columnsep,% + columns/sep/.blank=10\p@,% + columns/sep,% assign default + columnsep/.alias*=columns/sep,% + columns/rule/color/.store as color command,% + columns/rule/color,% assign default (\normalcolor) + columnseprulecolor/.alias*=columns/rule/color,% + columns/rulecolor/.alias*=columns/rule/color,% + multicolsep/.store as glue,% + multicolsep/.default=0pt plus4pt minus3pt,% + multicolsep,% sets default + multicols/begin/.initial=,multicols/begin/.default=,% + multicols/before/.alias=multicols/begin,% + multicols/end/.initial=,multicols/end/.default=,% + multicols/after/.alias=multicols/end,% + }% \pgfkeys + \itf@AfterPackage{interfaces-bookmark}{% + \pgfqkeys{/itf/tocloft/#1}{% + bookmark/.is multiple choice,% + bookmark/bold/.true=\pgfkeysaddvalue{/itf/tocloft/#1/bookmark}{}{,bold=true},% + bookmark/bold/.false=\pgfkeysaddvalue{/itf/tocloft/#1/bookmark}{}{,bold=false},% + bookmark/italic/.true=\pgfkeysaddvalue{/itf/tocloft/#1/bookmark}{}{,italic=true},% + bookmark/italic/.false=\pgfkeysaddvalue{/itf/tocloft/#1/bookmark}{}{,italic=false},% + bookmark/color/.code=\pgfkeysaddvalue{/itf/tocloft/#1/bookmark}{}{,color={##1}},% + bookmark/level/.code=\pgfkeysEaddvalue{/itf/tocloft/#1/bookmark}{}{level={% + \ifcsname toclevel@##1\endcsname + \csname toclevel@##1\endcsname + \else##1\fi}},% + bookmark/text/.store as code,% + bookmark/text/.default=\contentsname,% + bookmark/.unknown/.code=\pgfkeysEaddvalue{/itf/tocloft/#1/bookmark}{}{\pgfkeyscurrentname={##1}},% + bookmark/.initial=,% + }% \pgfkeys + }% AfterPackage interfaces-bookmark + %% while making a format \jobname is expanded to the name of the format... Therefore, the following commands must be expanded \AtEndPreamble + \AtEndPreamble{% + \BeforeFile{\jobname.#1}{% + \pgfkeysvalueof{/itf/tocloft/#1/before}% + \pgfkeysvalueof{/itf/tocloft/#1/columns/before@hook}% + }% + \AfterFile{\jobname.#1}{% + \pgfkeysvalueof{/itf/tocloft/#1/columns/after@hook}% + \pgfkeysvalueof{/itf/tocloft/#1/after}% + }% + }% + \ifcsname #1setup\endcsname\else + \pgfqkeys{/itf/tocloft/#1}{% + pagenumbers/.true=\@cftpnumon{#1},% + pagenumbers/.false=\@cftpnumoff{#1},% + pagenumber/.alias=pagenumbers + }% + \expandafter\pretocmd\csname @cftmake#1title\expandafter\endcsname + \expandafter{\expandafter\itf@tocloft\csname cft#1title\endcsname{#1}{listof#1}} + {\PackageInfo{interfaces-tocloft} + {Command \expandafter\string\csname @cftmake#1title\endcsname + successfully augmented}} + {\PackageWarning{interfaces-tocloft} + {Command \expandafter\string\csname @cftmake#1title\endcsname + \space could not be patched + \MessageBreak Keys label and bookmark won't work for \string\listofsetup}}% + \fi +}% \itf@cft@newlistof +% \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}{% + depth/.defcounter=tocdepth,% + depth/.value required,% + tocdepth/.alias=depth,% + title/.store as code in cs=contentsname,% + contentsname/.alias=title,% + ref/.initial=\contentsname,% + ref/.default=\contentsname,% + pagenumbers/.style={% boolean key + part/pagenumbers={#1},chapter/pagenumbers={#1},section/pagenumbers={#1},% + subsubsection/pagenumbers={#1},subsubsection/pagenumbers={#1},% + paragraph/pagenumbers={#1},subparagraph/pagenumbers={#1}},% + pagenumber/.alias=pagenumbers,% +}% +%% Specific to lof and lot ---------------------------------------------------- +\pgfqkeys{/itf/tocloft/lof}{% + title/.store as code in cs=listfigurename,% + listfigurename/.alias=title,% + ref/.initial=\listfigurename,% + ref/.default=\listfigurename,% +}% +\pgfqkeys{/itf/tocloft/lot}{% + title/.store as code in cs=listtablename,% + listtablename/.alias=title,% + ref/.initial=\listtablename,% + ref/.default=\listtablename,% +}% +\if@cftsubfigopt +\pgfqkeys{/itf/tocloft}{% + lof/pagenumbers/.style={figure/pagenumbers={#1},subfigure/pagenumbers={#1}},% + lof/pagenumber/.alias=lof/pagenumbers,% + lot/pagenumbers/.style={figure/pagenumbers={#1},subfigure/pagenumbers={#1}},% + lot/pagenumber/.alias=lot/pagenumbers,% +}% +\else +\pgfqkeys{/itf/tocloft}{% + lof/pagenumbers/.style={figure/pagenumbers={#1}},% + lof/pagenumber/.alias=lof/pagenumbers,% + lot/pagenumbers/.style={figure/pagenumbers={#1}},% + lot/pagenumber/.alias=lot/pagenumbers,% +}% +\fi +% \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\chapter chap\else + \ifx#1\section sec\else + \ifx#1\subsection subsec\else + \ifx#1\subsubsection subsubsec\else + \ifx#1\paragraph para\else + \ifx#1\subparagraph subpara\else + \ifx#1\figure fig\else + \ifx#1\subsubfigure subfig\else + \ifx#1\table tab\else + \ifx#1\subtable subtab\else + #2\fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi +}% \itf@cft@section@name +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Specific handlers for \xpackage{tocloft}} +% +% \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 create the keys for each sectionning command. +% +% \begin{macrocode} +\def\itf@cft@newsection#1#2{% #1=part / chap / sec / subsec etc., #2 = #1 = toc | lof | lot + \pgfqkeys{/itf/tocloft/#2/#1}{% + skip/.cft@length=before.#1.skip,% + beforeskip/.alias*=skip,% + top/.alias*=skip,% + indent/.cft@length=.#1.indent,% + font/.cft@code=.#1.font,% + font/.append code={\pgfkeysalso{/itf/tocloft/#2/#1/pagenumber/font={##1}}},% + format/.alias*=font,% + number/width/.cft@length=.#1.numwidth,% + numwidth/.alias*=number/width,% + presnum/.cft@code=.#1.presnum,% + number/before/.alias*=presnum,% + aftersnum/.cft@code=.#1.aftersnum,% + number/after/.alias*=aftersnum,% + aftersnumb/.cft@code=.#1.aftersnumb,% + title/before/.alias*=aftersnumb,% + leader/.cft@def=.#1.leader,% + leader/.default=\cftdotfill{\csname\itf@cft@name.#1.dotsep\@nil\endcsname},% + leaders/.alias=leader,% + dotsep/.code={\itf@units@mu\itf@musk{##1}% + \csedef{\itf@cft@name.#1.dotsep\@nil}{\itf@strip@mu\itf@musk}},% + dotsep/.default=\cftdotsep,% + dotsep/.blank=\cftnodots,% + nodots/.code=\csdef{\itf@cft@name.#1.dotsep\@nil}{\cftnodots},% + nodots/.value forbidden,% + pagefont/.cft@code=.#1.pagefont,% + page/font/.alias*=pagefont,% + pagenumber/font/.alias*=pagefont,% + afterpnum/.cft@code=.#1.afterpnum,% + page/after/.alias*=afterpnum,% + pagenumber/after/.alias*=afterpnum,% + pagenumbers/.on=\@cftpnumon{\itf@cft@secname{#1}},% + pagenumbers/.off=\@cftpnumoff{\itf@cft@secname{#1}},% + pagenumber/.alias=pagenumbers,% + }% \pgfqkeys +}% \itf@cft@newsection +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\@for\itf@tp:=part,chap,chapter,sec,section,subsec,subsection,% + subsubsec,subsubsection,para,paragraph,subpara,subparagraph% + \do{\expandafter\itf@cft@newsection\expandafter{\itf@tp}{toc}}% +\if@cftsubfigopt % \@ifpackagewith{tocloft}{subfig} ?? + \@for\itf@tp:=fig,figure,subfig,subfigure% + \do{\expandafter\itf@cft@newsection\expandafter{\itf@tp}{lof}}% + \@for\itf@tp:=tab,table,subtab,subtable% + \do{\expandafter\itf@cft@newsection\expandafter{\itf@tp}{lot}}% +\else + \@for\itf@tp:=fig,figure% + \do{\expandafter\itf@cft@newsection\expandafter{\itf@tp}{lof}}% + \@for\itf@tp:=tab,table% + \do{\expandafter\itf@cft@newsection\expandafter{\itf@tp}{lot}}% +\fi +% \end{macrocode} +% +% +% \begin{macro}{@cftmaketoctitle (patch)} +% \begin{macro}{@cftmakeloftitle (patch)} +% \begin{macro}{@cftmakelottitle (patch)} +% \begin{macro}{newlistentry (patch)} +% \patchlabel{@cftmaketoctitle} +% +% \begin{macrocode} +\itf@patch\pretocmd\@cftmaketoctitle + {\itf@tocloft\contentsname{toc}{tableofcontents}} + {\PackageInfo{interfaces-tocloft} + {Command \string\@cftmaketoctitle\space successfully augmented}} + {\PackageWarning{interfaces-tocloft} + {Command \string\@cftmaketoctitle\space could not be patched + \MessageBreak label and bookmark keys for \string\tocsetup\space won't work}}% +\itf@patch\pretocmd\@cftmakeloftitle + {\itf@tocloft\listfigurename{lof}{listoffigures}} + {\PackageInfo{interfaces-tocloft} + {Command \string\@cftmakeloftitle\space successfully augmented}} + {\PackageWarning{interfaces-tocloft} + {Command \string\@cftmakeloftitle\space could not be patched + \MessageBreak label and bookmark keys for \string\lofsetup\space won't work}}% +\itf@patch\pretocmd\@cftmakelottitle + {\itf@tocloft\listtablename{lot}{listoftables}} + {\PackageInfo{interfaces-tocloft} + {Command \string\@cftmakelottitle\space successfully augmented}} + {\PackageWarning{interfaces-tocloft} + {Command \string\@cftmakelottitle\space could not be patched + \MessageBreak label and bookmark keys for \string\lotsetup\space won't work}}% +\@makeother\# +\itf@patch\apptocmd\newlistentry + {\itf@cft@newlistof{#2}} + {\PackageInfo{interfaces-tocloft} + {Command \string\newlistentry\space successfully augmented}} + {\PackageWarning{interfaces-tocloft} + {Command \string\newlistentry\space could not be patched + \MessageBreak \string\listofsetup\space will not work}}% +\catcode`\#=6 +% \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}]% + {\pgfkeysvalueof{/itf/tocloft/#3/bookmark/text}}% + \global\BKM@startatroottrue + \fi} + {#2}% + \pgfkeysgetvalue{/itf/tocloft/#3/label}\itf@tp + \ifx\itf@tp\@empty\else + \def\@currentHref{interfaces.#4}% + \pgfkeysgetvalue{/itf/tocloft/#3/ref}\@currentlabel + \def\@currentlabelname{#2}% + \label{\pgfkeysvalueof{/itf/tocloft/#3/label}}% + \fi + \endgroup + \gdef\itf@tp{\def#1{#2}\let\itf@tp\@undefined}% restore original + \aftergroup\itf@tp % simple group introduced by tocloft to print \contentsname +}% \itf@cft@label +% \end{macrocode} +% \end{macro} +% +% +% \begin{macrocode} +%</tocloft> +% \end{macrocode} +% +% \Subsection[makecell] +% +% \begin{macrocode} +%<*makecell> +\ProvidesPackage{interfaces-makecell} + [2010/10/12 v1.0 more control on tabular cells (FC)] +\RequirePackage{interfaces-base} +\itf@Check@Package{makecell} +\edef\itf@AtEnd{\catcode126 \the\catcode126}% 126 = ~ +\AtEndOfPackage{\itf@AtEnd} +\catcode126 \active % 126 = ~ +\itf@pgfkeys +% \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\@nnil{% + \ifx\countvalues#3% + +#1\expandafter\remove@to@nnil + \else + +1\expandafter\itf@countvalues + \fi1#3\@nnil +}% \itf@countvalues +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itf@getvalue} +% \begin{macrocode} +\def\itf@getvalue#1#2{% + \romannumeral-`\q\expandafter\itf@getv@lue\expandafter0#1,\itf@getvalue\@nil{#2-1}\@nnil +}% \itf@getvalue +\def\itf@getv@lue#1#2,#3\@nil#4\@nnil{% + \ifnum\numexpr#1=\numexpr#4\relax + #2\expandafter\remove@to@nnil + \else\ifx\itf@getvalue#3% + \expandafter\expandafter\expandafter\remove@to@nnil + \else + \expandafter\expandafter\expandafter\itf@getv@lue + \fi\fi{#1+1}#3\@nil#4\@nnil +}% \itf@getv@lue +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{\cs{repeatcell}} +% +% \begin{macro}{\repeatcell} +% \begin{macrocode} +\newif\ifitf@celltranspose +\def\itf@ampactive{% + \def\tab{&}% + \lccode`\~=38\lowercase{\def~{&}}% +}% \itf@ampactive +\newrobustcmd*\repeatcell{\begingroup + \let\tab\relax + \catcode38\active + \itf@repeatcell +}% \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@{}% 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\expandafter\expandafter{% + \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\expandafter\expandafter{% + \expandafter\the\expandafter\toks@ + \itf@cell@init\itf@ampactive}% + \itf@cell@insert}% + }% + \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\expandafter\expandafter{% + \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\expandafter\expandafter{% + \expandafter\the\expandafter\toks@ + \itf@cell@init\itf@ampactive}% + \itf@cell@insert}% + }% + \fi + \itf@message{Code introduced by repeatcell in the \@currenvir:\the\toks@}% (to see the code...) + \expandafter\endgroup\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,% (order of evaluation => "undefined cs") + @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\expandafter\expandafter{% + \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 + \setbox\z@\vbox{%\FPeval introduces some weird code, hence the calculation in a \vbox + \FPeval\FPresult{#1}% + \global\let\FPresult\FPresult}% + \endgroup + \itf@cell@calc#2\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\expandafter\expandafter{% + \expandafter\the\expandafter\toks@ + \expandafter\def\expandafter\r\expandafter{\r}}% + \fi + \ifx\C\@empty\else + \toks@\expandafter\expandafter\expandafter{% + \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\expandafter\expandafter{% + \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\expandafter\expandafter{% + \expandafter\the\expandafter\itf@cell\itf@tp}% + \edef\itf@tp{\itf@makecell{\the\itf@cell}}% + \toks@\expandafter\expandafter\expandafter{% + \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{% + \noexpand\diaghead({#1}){\unexpanded{#2 #3}}% + {\unexpanded{#2}} + {\unexpanded{#3}}}% + \expandafter\endgroup\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} +%</makecell> +% \end{macrocode} +% +% +% \Subsection[enumitem] +% +% \begin{macrocode} +%<*enumitem> +\ProvidesPackage{interfaces-enumitem} + [2010/10/12 v1.0 more control on lists (FC)] +\RequirePackage{interfaces-base} +\itf@Check@Package{enumitem} +\itf@pgfkeys +% \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}{\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} +%</enumitem> +% \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{\ignorespaces#3\unskip}% + \ifnum\badness>\@M + \def\next{\truncate[{#1}]{#2}{#3}}% + \else \def\next{#3}% + \fi + \expandafter\endgroup\next +}% \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{\ignorespaces\x\unskip}% + \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@ %%dimen0=\the\dimen@\quad\number\dimen@\par + \itf@freespace\z@ % free space left when w_i < x_i/sum(x_i) * total + \@for\x:=#3\do{% + \advance \count@ \@ne + \ifdim \dimen\count@<\z@ % not measured before + \setbox\z@=\hbox{\ignorespaces\x\unskip}% + \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 + \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/\number#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} +%</truncate> +% \end{macrocode} +% +% \sectionformat\subsection{bookmark/color=black} +% +% \subsection{interface fancyvrb} +% +% \begin{macrocode} +%<*fancyvrb> +\ProvidesPackage{interfaces-fancyvrb} + [2010/08/22 v1.0 Custom verbatim environments (FC)] +\RequirePackage{interfaces-base} +\itf@Check@Package{fancyvrb} +\itf@pgfkeys +\def\itf@tp#1{% +\DefineVerbatimEnvironment{itf:VerbLines}{Verbatim} + {gobble=#1,frame=lines,framesep=6pt,fontseries=m} +\DefineVerbatimEnvironment{itf:Verb}{Verbatim} + {gobble=#1,fontseries=m} +\DefineVerbatimEnvironment{itf:Verb*}{Verbatim} + {gobble=#1,fontseries=m,commandchars=$()} +} +\ltx@ifpackageloaded{doc} + {\itf@tp{1}} + {\itf@tp{0}} +\AtBeginDocument{% +\ifdefined\VerbLines\else +\ifdefined\endVerbLines\else + \letcs\VerbLines{itf:VerbLines}% + \letcs\endVerbLines{enditf:VerbLines}% +\fi\fi +\ifdefined\Verb\else\ifdefined\endVerb\else + \letcs\Verb{itf:Verb}% + \letcs\endVerb{enditf:Verb}% +\fi\fi +\ifcsname Verb*\endcsname\else +\ifcsname endVerb*\endcsname\else + \csletcs{Verb*}{itf:Verb*}% + \csletcs{endVerb*}{enditf:Verb*}% +\fi\fi +} +%</fancyvrb> +% \end{macrocode} +% +% \Subsection[appendix] +% +% \begin{macrocode} +%<*appendix> +\ProvidesPackage{interfaces-appendix} + [2010/10/20 v1.0 easy control of appendices environment (FC)] +\RequirePackage{interfaces-base} +\itf@Check@Package{appendix} +\itf@pgfkeys +% \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={% + \ifcase\pgfkeysvalueof{/itf/appendix/appendices/section/.number}\relax + \@chapter@ppfalse\or\@chapter@pptrue\fi + \if@chapter@pp\ifundef\chapter{% + \PackageError{interfaces-appendix} + {You asked chapter-style appendices but your + \MessageBreak current class does not provide chapters!}\@eha + \pgfkeysalso{/itf/appendix/appendices/section}}{}% + \fi},% + chapter/.style={section=chapter},% + chapter/.value forbidden,% +}% keys for appendices environment +% \end{macrocode} +% +% \begin{macrocode} +%</appendix> +% \end{macrocode} +% +% \Subsection[embedfile] +% +% \begin{macrocode} +%<*embedfile> +\ProvidesPackage{interfaces-embedfile} + [2010/06/20 v1.0 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\@fileslist\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 +%</embedfile> +% \end{macrocode} +% +% \Subsection[environ] +% +% \begin{macrocode} +%<*environ> +\ProvidesPackage{interfaces-environ} + [2010/07/23 v1.0 ReNewEnviron = RenewEnviron (FC)] +\RequirePackage{interfaces-base} +\AfterPackage{environ}{ + \ifundef\ReNewEnviron + {\let\ReNewEnviron\RenewEnviron} + {}% +}% +%</environ> +% \end{macrocode} +% +% +% \Subsection[umrand] +% +% \begin{macrocode} +%<*umrand> +\ProvidesPackage{interfaces-umrand} + [2010/07/23 v1.0 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 +} +%</umrand> +% \end{macrocode} +% +% +% \Subsection[scrlfile] +% +% \begin{macrocode} +%<*scrlfile> +\ProvidesPackage{interfaces-scrlfile} + [2010/08/09 v1.0 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} +%</scrlfile> +% \end{macrocode} +% +% \sectionformat\subsection{bookmark/color*=copper} +% \Subsection[pgfkeys] +% +% \subsubsection{interfaces-pgfkeys} +% +% \begin{macrocode} +%<*pgfkeys> +\ProvidesPackage{interfaces-pgfkeys} + [2010/10/22 v1.1 pgfkeys handlers definitions (FC)] +\RequirePackage{interfaces-base} +\AtEndOfPackage{% + \let\itf@pgfkeys@unpack\pgfkeys@unpack + \let\itf@pgfkeys@case@three\pgfkeys@case@three + \let\itf@pgfkeys@exp@call\pgfkeys@exp@call + \let\itf@pgfkeysaddvalue\pgfkeysaddvalue +}% AtEndOfPackage +\def\itf@pgfkeys{% + \global\let\pgfkeys@unpack\itf@pgfkeys@unpack + \global\let\pgfkeys@case@three\itf@pgfkeys@case@three + \global\let\pgfkeys@exp@call\itf@pgfkeys@exp@call + \global\let\pgfkeysaddvalue\itf@pgfkeysaddvalue +}% \itf@pgfkeys +\AtBeginDocument{% + \itf@pgfkeys + \let\itf@pgfkeys\relax +}% AtBeginDocument +% \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}% +}% +% \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}{\pgfkeysEsetvalue} +% \begin{macro}{\pgfkeysaddvalue (bug correction)} +% \begin{macro}{\pgfkeysEaddvalue} +% \begin{macrocode} +\newrobustcmd*\pgfkeysEsetvalue[2]{% + \expandafter\edef\csname pgfk@#1\endcsname{#2}% +}% \pgfkeysEsetvalue +\renewrobustcmd*\pgfkeysaddvalue[3]{% \cspreappto{pgfk@#1}{#2}{#3} (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 +}% \pgfkeysaddvalue +\newrobustcmd*\pgfkeysEaddvalue[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 +}% \pgfkeysaddvalue +% \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 ( code could break if it contains = or , ) +\def\pgfkeys@exp@call#1{\pgfkeysalso{\pgfkeyscurrentpath={#1}}} +% \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: +\def\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 % <FC> + \pgfkeyscurrentkey % <FC> + \pgfkeys@case@one % <FC> + \fi +}% \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 +\renewcommand*\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 +}% \pgfkeys@case@three +% \end{macrocode} +% +% \paragraph(/.alias){Handlers 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*){Handlers 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){Handlers 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){Handlers 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){Handlers 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){Handlers definition: \handler/.store as color/, \handler/.store as color command/} +% +% \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){Handlers 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}\pgfkeyscurrentvalue}% +}% /.store as color in cs +% \end{macrocode} +% +% \paragraph(/.store as color command){Handlers 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){Handlers 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){Handlers definition \handler/.store as number/} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.store as number/.code={% + \pgfkeysedef\pgfkeyscurrentpath{% + \normalcolor\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(/.estore as number){Handlers definition: \handler/.estore as number/} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.estore as number/.code={% + \pgfkeysedef\pgfkeyscurrentpath{% + \noexpand\pgfkeyssetvalue{\pgfkeyscurrentpath}{\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{/.store as number in cs}{Handlers 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 z@\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 in cs){Handlers 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 z@\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(/.defcounter){Handlers definition: \handler/.defcounter/} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.defcounter/.code=\pgfkeysdef\pgfkeyscurrentpath{\defcounter{#1}{##1}}% +}% /.defcounter +% \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@scale##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(/.estore as glue){Handlers definition: \handler/.estore as glue/} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.estore as glue/.code={% + \pgfkeysedef{\pgfkeyscurrentpath}{% + \noexpand\pgfkeysEsetvalue{\pgfkeyscurrentpath}{% + \noexpand\the\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=% + \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(/.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@scale##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(/.estore as dimen){Handlers definition: \handler/.estore as dimen/} +% +% \begin{macrocode} +\pgfkeys{% + /handlers/.estore as dimen/.code={% + \pgfkeysedef\pgfkeyscurrentpath{% + \noexpand\pgfkeysEsetvalue{\pgfkeyscurrentpath}{% + \noexpand\the\dimexpr##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 + \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(/.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\pgfkeysalso{\pgfkeyscurrentpath={% + \noexpand\expandonce\noexpand\pgfkeys@temp + \x + \if*\x\noexpand\itf@units@scale##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 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\csedef{#1}{\the\glueexpr##1\relax}\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/.store 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\csname#1\endcsname\glueexpr##1\relax\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 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{% + \ifcsname#1\endcsname#1\else z@\fi}% + \edef\noexpand\pgfkeys@temp{% + \noexpand\pgfkeysalso{\pgfkeyscurrentpath={% + \noexpand\expandonce\noexpand\pgfkeys@temp + \x + \if*\x\noexpand\itf@units@scale##1! + \else\dimexpr\noexpand\unexpanded{##1}\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 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 \@defaultunits\itf@sk ##1pt\relax\@nnil + \csedef{#1}{\the\dimexpr\itf@sk\relax}\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@sk\dimexpr\itf@sk*\noexpand\itf@units@scale##1!\relax + \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\csname#1\endcsname\dimexpr##1\relax\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 % should have 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} +%</pgfkeys> +% \end{macrocode} +% +% \Subsection[etoolbox] +% +% \begin{macrocode} +%<*etoolbox> +\ProvidesPackage{interfaces-etoolbox} + [2010/06/10 some 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 + \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} +\def\itf@removefromstart#1#2{% removes #2 (code) from #1 (hook) + \def\in@@##1#2##2\in@@{##1\in@\itf@tp##2\in@@@}% + \def\in@@@##1\in@@@##2\in@@@{% + \ifx\in@##1\fi + }\expandafter\in@@@\in@@#1\itf@tp\in@@@#2\in@@ +}% \itf@remove@fromstart +% \end{macrocode} +% \end{macro} +%---------------------------------------------------------------------------- +% \begin{macrocode} +%</etoolbox> +% \end{macrocode} +% +% +% \begin{History} +% +% \begin{Version}{2010/10/20 v1.0} +% \item First version. +% \end{Version} +% +% +% \begin{Version}{2010/10/20 v1.0} +% \item First version. +% \end{Version} +% +% \end{History} +% +% \begin{thebibliography}{9} +% +% \bibitem{docstrip} +% \textit{The \xpackage{docstrip} program}; +% 2009/09/25 v2.5d; +% \CTAN{macros/latex/base/}. +% +% \bibitem{many others...} +% \textit{some packages...} +% \end{thebibliography} +% +% \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} +% +% \clearpage\restoregeometry +% \pagesetup*{ +% head/right=\leftmark, +% head/right/font=\normalsize\bfseries\sffamily\pkgcolor +% } +% +% \PrintIndex +% +% \Finale diff --git a/Master/texmf-dist/source/latex/interfaces/interfaces.ins b/Master/texmf-dist/source/latex/interfaces/interfaces.ins new file mode 100644 index 00000000000..b6465c1eb4e --- /dev/null +++ b/Master/texmf-dist/source/latex/interfaces/interfaces.ins @@ -0,0 +1,150 @@ +%% +%% 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 : 2010/10/20 v1.0 - interfaces : interfaces with keys for other packages (FC) +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% +%% This work consists of the main source file interfaces.dtx +%% and the derived files +%% interfaces.sty, interfaces.pdf, interfaces.ins, +%% interfaces-base.sty, +%% interfaces-LaTeX.sty, +%% interfaces-tikz.sty, +%% interfaces-titlesec.sty, +%% interfaces-hyperref.sty, +%% interfaces-bookmark.sty, +%% interfaces-hypbmsec.sty,interfaces-hypbmsec.code.tex, +%% interfaces-fancyhdr.sty, +%% interfaces-marks.sty, +%% interfaces-tocloft.sty, +%% interfaces-makecell.sty, +%% interfaces-enumitem.sty, +%% interfaces-truncate.sty, +%% interfaces-appendix.sty, +%% interfaces-embedfile.sty, +%% interfaces-environ.sty, +%% interfaces-umrand.sty, +%% interfaces-scrlfile.sty, +%% interfaces-pgfkeys.sty, +%% interfaces-etoolbox.sty, +%% interfaces-fancyvrb.sty +%% +%% interfaces: interfaces with keys for other packages (FC) +%% Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> +%% +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: 2010/10/20 v1.0 - interfaces: interfaces with keys for other packages (FC)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +interfaces : 2010/10/20 v1.0 - interfaces : interfaces with keys for other packages (FC) + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3 of this license or (at your option) any later +version. The latest version of this license is in + http://www.latex-project.org/lppl.txt + +This work consists of the main source file interfaces.dtx +and the derived files + interfaces.sty, interfaces.pdf, interfaces.ins, + interfaces-base.sty, + interfaces-LaTeX.sty, + interfaces-tikz.sty, + interfaces-titlesec.sty, + interfaces-hyperref.sty, + interfaces-bookmark.sty, + interfaces-hypbmsec.sty,interfaces-hypbmsec.code.tex, + interfaces-fancyhdr.sty, + interfaces-marks.sty, + interfaces-tocloft.sty, + interfaces-makecell.sty, + interfaces-enumitem.sty, + interfaces-truncate.sty, + interfaces-appendix.sty, + interfaces-embedfile.sty, + interfaces-environ.sty, + interfaces-umrand.sty, + interfaces-scrlfile.sty, + interfaces-pgfkeys.sty, + interfaces-etoolbox.sty, + interfaces-fancyvrb.sty + +interfaces: interfaces with keys for other packages (FC) +Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> + +\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-hypbmsec.code.tex}{\from{interfaces.dtx}{hypbmsec.code.tex}}% + \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}}% + \file{interfaces-fancyvrb.sty}{\from{interfaces.dtx}{fancyvrb}}% +} + +\askforoverwritetrue +\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'. |