diff options
author | Karl Berry <karl@freefriends.org> | 2010-11-26 23:34:28 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-11-26 23:34:28 +0000 |
commit | fe6482d3468ca040e53f8e5347548495db754e98 (patch) | |
tree | 316b38cc413c275b5bd568b1d95a68bbda85f5ea /Master/texmf-dist/tex/latex/interfaces/interfaces-hypbmsec.sty | |
parent | 4ccf49d7715d013e1de70c6a44384aeb940c1589 (diff) |
interfaces 2.4 (25nov10)
git-svn-id: svn://tug.org/texlive/trunk@20577 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/interfaces/interfaces-hypbmsec.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/interfaces/interfaces-hypbmsec.sty | 138 |
1 files changed, 134 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/latex/interfaces/interfaces-hypbmsec.sty b/Master/texmf-dist/tex/latex/interfaces/interfaces-hypbmsec.sty index 634714e83fc..2aa94cdacfa 100644 --- a/Master/texmf-dist/tex/latex/interfaces/interfaces-hypbmsec.sty +++ b/Master/texmf-dist/tex/latex/interfaces/interfaces-hypbmsec.sty @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% interfaces : 2010/11/21 v2.3 - interfaces : interfaces with keys for other packages (FC) +%% interfaces : 2010/11/26 v2.4 - interfaces : interfaces with keys for other packages (FC) %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -44,11 +44,141 @@ %% Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> %% \ProvidesPackage{interfaces-hypbmsec} - [2010/11/15 v2.1 lastsection etc. (FC)] + [2010/11/15 v2.1 lastsection (title,anchor, etc. - FC)] \RequirePackage{interfaces-base} +\RequirePackage{gettitlestring} \itf@Check@Package{hypbmsec} -\AfterPackage*{interfaces-titlesec}{% requires interface-titlesec - \input{interfaces-hypbmsec.code.tex}% +\def\itf@hbs@do#1{% + \xdef\itf@hbs@currentname{\expandafter\itf@strip@at\string#1}% + \let\hbs@tocstring\relax % <for starred sections> + \let\hbs@bmstring\relax % <for starred sections> + \@ifstar + {\itf@hbs@ssect#1}% + {\let\hbs@seccmd=#1\hbs@checkarg}% +}% \itf@hbs@do +\let\hbs@do\itf@hbs@do +\itf@patch\pretocmd\hbs@process{% + \itf@hbs@process{#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}% +\long\def\itf@hbs@ssect#1#2{% starred section + \itf@Not@titlesec#1 + {\expandafter\itf@hbs@last@starred\expandafter{\itf@hbs@currentname}{#2}} + {\let\itf@hbs@last\itf@hbs@last@starred@ttl}% <expanded at \ttl@finmarks> + #1*{#2}% +}% \itf@hbs@ssect +\long\def\itf@hbs@process#1{% not starred + \itf@Not@titlesec \hbs@seccmd + {% + \ifdefined\hyper@anchor + \expandafter\itf@hbs@last@nostar@nottl@Hy\expandafter{\itf@hbs@currentname}{#1}% + \else + \expandafter\itf@hbs@last@nostar@nottl\expandafter{\itf@hbs@currentname}{#1}% + \fi + }% + {\let\itf@hbs@last \itf@hbs@last@nostar@ttl}% <expanded at \ttl@finmarks> +}% \itf@hbs@process +\long\def\itf@hbs@last@starred#1#2{% <expanded immediately> + \GetTitleString{#2}\let\itf@hbs@currenttitle\GetTitleStringResult + \begingroup + \let\@elt \itf@resetlastsections + \globaldefs \@ne + \expandafter\let\csname last#1title\endcsname\itf@hbs@currenttitle + \expandafter\let\csname last#1toc\endcsname\@empty + \expandafter\let\csname last#1bookmark\endcsname\@empty + \expandafter\let\csname last#1anchor\endcsname\relax + \let\lastsectionname \itf@hbs@currentname + \csname cl@#1\endcsname + \endgroup +}% \itf@hbs@last@starred +\def\itf@hbs@last@starred@ttl{% <expanded at \ttl@finmarks> + \global\let\itf@hbs@last \@empty + \expandafter\itf@hbs@last@starred + \expandafter\itf@hbs@currentname \expandafter{\ttl@savetitle}% +}% \itf@hbs@last@starred@ttl +\long\def\itf@hbs@last@nostar#1#2{% + \GetTitleString{#2}\let\itf@hbs@currenttitle\GetTitleStringResult + \begingroup + \let\@elt \itf@resetlastsections + \globaldefs \@ne + \expandafter\let\csname last#1title\endcsname\itf@hbs@currenttitle + \expandafter\let\csname last#1toc\expandafter\endcsname + \csname \ifx\hbs@tocstring\relax + itf@hbs@currenttitle\else hbs@tocstring\fi \endcsname + \expandafter\let\csname last#1bookmark\expandafter\endcsname + \csname \ifx\hbs@bmstring\relax + last#1toc\else hbs@bmstring\fi \endcsname + \expandafter\let\csname last#1anchor\endcsname\HyperLocalCurrentHref + \let\lastsectionname \itf@hbs@currentname + \csname cl@#1\endcsname + \endgroup +}% \itf@hbs@last@starred +\def\itf@hbs@last@nostar@ttl{% <expanded at \ttl@finmarks> + \global\let\itf@hbs@last \@empty + \expandafter\itf@hbs@last@nostar + \expandafter\itf@hbs@currentname \expandafter{\ttl@savetitle}% +}% \itf@hbs@last@nostar@ttl +\long\def\itf@hbs@last@nostar@nottl#1#2{% <expanded at \cl@section> + \expandafter\let\expandafter\itf@hbs@cl@ORI\csname cl@#1\endcsname + \expandafter\def\csname cl@#1\endcsname{% + \expandafter\let\csname cl@#1\endcsname\itf@hbs@cl@ORI + \itf@hbs@cl@ORI + \itf@hbs@last@nostar {#1}{#2}}% +}% \itf@hbs@last@nostar@nottl +\long\def\itf@hbs@last@nostar@nottl@Hy#1#2{% <expanded at \hyper@anchorend> + \begingroup + \toks@\expandafter{% + \expandafter\def\expandafter\hyper@anchorend + \expandafter{\hyper@anchorend}% + \itf@hbs@last@nostar{#1}{#2}}% + \edef\x{\endgroup + \def\noexpand\hyper@anchorend{\the\toks@}% + }\x +}% \itf@hbs@last@nostar@nottl@Hy +\def\itf@Not@titlesec#1{\@firstoftwo} +\AfterPackage*{titlesec}{% +\def\itf@Not@titlesec#1{\begingroup + \@onelevel@sanitize#1% + \edef\@tempa{\noexpand\in@ + {\noexpand\@nil \string\ttl@} + {\noexpand\@nil #1}% + }\@tempa + \expandafter\endgroup + \ifin@ \expandafter\@secondoftwo + \else \expandafter\@firstoftwo + \fi +}% \itf@Not@titlesec +}% AfterPackage titlesec +\AfterPackage*{titlesec}{% +\expandafter\def\expandafter\ttl@finmarks\expandafter{% + \expandafter\itf@hbs@last \ttl@finmarks}% +\let\itf@hbs@last \@empty +}% AfterPackage +\def\itf@resetlastsections#1{% + \expandafter\let\csname last#1title\endcsname\relax + \expandafter\let\csname last#1toc\endcsname\relax + \expandafter\let\csname last#1bookmark\endcsname\relax + \expandafter\let\csname last#1anchor\endcsname\relax + \csname cl@#1\endcsname +}% \itf@resetlastsections +\let\lastsectionname\relax +\@for\itf@tp:=part,section,subsection,subsubsection,paragraph,subparagraph% + \do{\expandafter\let\csname last\itf@tp title\endcsname\relax + \expandafter\let\csname last\itf@tp toc\endcsname\relax + \expandafter\let\csname last\itf@tp bookmark\endcsname\relax + \expandafter\let\csname last\itf@tp anchor\endcsname\relax + }% +\AtBeginDocument{\ifundef\chapter{} + {\let\lastchaptertitle\relax + \let\lastchaptertoc\relax + \let\lastchapterbookmark\relax + \let\lastchapteranchor\relax}% }% \endinput %% |