diff options
author | Karl Berry <karl@freefriends.org> | 2011-04-12 22:56:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-04-12 22:56:39 +0000 |
commit | 3c9b5c2960ae2455180bdb3a4e67bf10175b39af (patch) | |
tree | 53ac9731c23e82f60349ec920ed8d816738913dc /Master/texmf-dist/tex/latex/oberdiek/bookmark.sty | |
parent | f437333cf5d63d69f5ab9fd1eb553af4175037d0 (diff) |
oberdiek (12apr11)
git-svn-id: svn://tug.org/texlive/trunk@22061 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/oberdiek/bookmark.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/oberdiek/bookmark.sty | 125 |
1 files changed, 110 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/latex/oberdiek/bookmark.sty b/Master/texmf-dist/tex/latex/oberdiek/bookmark.sty index d7f2e1f616b..d1a108def90 100644 --- a/Master/texmf-dist/tex/latex/oberdiek/bookmark.sty +++ b/Master/texmf-dist/tex/latex/oberdiek/bookmark.sty @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% Copyright (C) 2007-2010 by +%% Copyright (C) 2007-2011 by %% Heiko Oberdiek <heiko.oberdiek at googlemail.com> %% %% This work may be distributed and/or modified under the @@ -34,7 +34,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{bookmark}% - [2010/04/08 v1.12 PDF bookmarks (HO)]% + [2011/03/20 v1.19 PDF bookmarks (HO)]% \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname numexpr\endcsname\relax \def\BKM@CalcExpr#1#2#3#4{% @@ -78,8 +78,10 @@ \RequirePackage{ifpdf}[2009/04/10] \RequirePackage{ifxetex} \RequirePackage{ifvtex}[2008/11/04] -\RequirePackage{hyperref} +\RequirePackage{pdftexcmds}[2010/11/04] +\RequirePackage{hyperref}[2010/06/18] \RequirePackage{auxhook}[2007/04/06] +\RequirePackage{kvsetkeys}[2010/03/01] \RequirePackage{kvoptions}[2009/08/13] \RequirePackage{hycolor}[2008/09/08] \RequirePackage{bitset} @@ -91,6 +93,8 @@ color,% depth,% dest,% + draft,% + final,% gotor,% italic,% keeplevel,% @@ -106,15 +110,36 @@ uri,% view,% } -\newcommand*{\bookmarksetup}{\setkeys{BKM}} +\newcommand*{\bookmarksetup}{\kvsetkeys{BKM}} \def\BKM@setup#1{% \bookmarksetup{#1}% + \ifx\BKM@HookNext\ltx@empty + \else + \expandafter\bookmarksetup\expandafter{\BKM@HookNext}% + \BKM@HookNextClear + \fi \BKM@hook \ifBKM@keeplevel \else \xdef\BKM@currentlevel{\BKM@level}% \fi } +\newcommand*{\bookmarksetupnext}[1]{% + \ltx@GlobalAppendToMacro\BKM@HookNext{,#1}% +} +\def\BKM@HookNextClear{% + \global\let\BKM@HookNext\ltx@empty +} +\BKM@HookNextClear +\DeclareBoolOption{draft} +\DeclareComplementaryOption{final}{draft} +\pdf@ifdraftmode\BKM@drafttrue{} +\def\BKM@DisableOptions{% + \DisableKeyvalOption[action=warning,package=bookmark]% + {BKM}{draft}% + \DisableKeyvalOption[action=warning,package=bookmark]% + {BKM}{final}% +} \DeclareBoolOption[\ifHy@bookmarksopen true\else false\fi]{open} \def\bookmark@open{% \ifBKM@open\ltx@one\else\ltx@zero\fi @@ -131,7 +156,7 @@ \ifx\BKM@param\@empty \def\BKM@depth{\c@tocdepth}% \else - \@ifundefined{toclevel@\BKM@param}{% + \ltx@IfUndefined{toclevel@\BKM@param}{% \@onelevel@sanitize\BKM@param \edef\BKM@temp{\expandafter\@car\BKM@param\@nil}% \ifcase 0\expandafter\ifx\BKM@temp-1\fi @@ -142,29 +167,68 @@ \fi \relax \PackageWarning{bookmark}{% - Unknown document division name (\BKM@param)% + Unknown document division name (\BKM@param)\MessageBreak + for option `depth'% }% \else - \BKM@SetDepth\BKM@param + \BKM@SetDepth\BKM@depth\BKM@param \fi }{% - \BKM@SetDepth{\csname toclevel@\BKM@param\endcsname}% + \BKM@SetDepth\BKM@depth{% + \csname toclevel@\BKM@param\endcsname + }% }% \fi } \def\bookmark@depth{\BKM@depth} -\def\BKM@SetDepth#1{% +\def\BKM@SetDepthOrLevel#1#2{% \begingroup \setbox\z@=\hbox{% - \count@=#1\relax + \count@=#2\relax \expandafter }% \expandafter\endgroup - \expandafter\def\expandafter\BKM@depth\expandafter{\the\count@}% + \expandafter\def\expandafter#1\expandafter{\the\count@}% } \DeclareStringOption[\BKM@currentlevel]{level}[\BKM@currentlevel] +\define@key{BKM}{level}{% + \edef\BKM@param{#1}% + \ifx\BKM@param\BKM@MacroCurrentLevel + \let\BKM@level\BKM@param + \else + \ltx@IfUndefined{toclevel@\BKM@param}{% + \@onelevel@sanitize\BKM@param + \edef\BKM@temp{\expandafter\@car\BKM@param\@nil}% + \ifcase 0\expandafter\ifx\BKM@temp-1\fi + \expandafter\ifnum\expandafter`\BKM@temp>47 % + \expandafter\ifnum\expandafter`\BKM@temp<58 % + 1% + \fi + \fi + \relax + \PackageWarning{bookmark}{% + Unknown document division name (\BKM@param)\MessageBreak + for option `level'% + }% + \else + \BKM@SetDepthOrLevel\BKM@level\BKM@param + \fi + }{% + \BKM@SetDepthOrLevel\BKM@level{% + \csname toclevel@\BKM@param\endcsname + }% + }% + \fi +} +\def\BKM@MacroCurrentLevel{\BKM@currentlevel} \DeclareBoolOption{keeplevel} \DeclareBoolOption{startatroot} +\def\BKM@startatrootfalse{% + \global\let\ifBKM@startatroot\iffalse +} +\def\BKM@startatroottrue{% + \global\let\ifBKM@startatroot\iftrue +} \define@key{BKM}{rellevel}{% \BKM@CalcExpr\BKM@level{#1}+\BKM@currentlevel } @@ -405,7 +469,11 @@ \def\BKM@@CalcParam#1#2#3\@nil{% \ifx\calc#1% \@ifundefined{calc@assign@dimen}{% - \setlength{\dimen@}{\dimexpr#2\relax}% + \@ifundefined{dimexpr}{% + \setlength{\dimen@}{#2}% + }{% + \setlength{\dimen@}{\dimexpr#2\relax}% + }% }{% \setlength{\dimen@}{#2}% }% @@ -418,8 +486,9 @@ \fi } \DeclareBoolOption{atend} -\def\BKM@DisableOptions{% - \DisableKeyvalOption{BKM}{atend}% +\g@addto@macro\BKM@DisableOptions{% + \DisableKeyvalOption[action=warning,package=bookmark]% + {BKM}{atend}% } \newcommand*{\bookmarkdefinestyle}[2]{% \@ifundefined{BKM@style@#1}{% @@ -496,7 +565,8 @@ \def\BKM@driver{#1}% }% \g@addto@macro\BKM@DisableOptions{% - \DisableKeyvalOption{BKM}{#1}% + \DisableKeyvalOption[action=warning,package=bookmark]% + {BKM}{#1}% }% } \BKM@DefineDriverKey{pdftex} @@ -536,8 +606,31 @@ \fi \ProcessKeyvalOptions* \BKM@DisableOptions +\ifBKM@draft + \PackageWarningNoLine{bookmark}{Draft mode on}% + \let\bookmarksetup\ltx@gobble + \let\BookmarkAtEnd\ltx@gobble + \let\bookmarkdefinestyle\ltx@gobbletwo + \let\bookmarkget\ltx@gobble + \renewcommand*{\pdfbookmark}[3][]{}% + \let\currentpdfbookmark\ltx@gobbletwo + \let\subpdfbookmark\ltx@gobbletwo + \let\belowpdfbookmark\ltx@gobbletwo + \newcommand*{\bookmark}[2][]{}% + \renewcommand*{\Hy@writebookmark}[5]{}% + \let\ReadBookmarks\relax + \let\BKM@DefGotoNameAction\ltx@gobbletwo % package `hypdestopt' + \expandafter\endinput +\fi \newif\ifBKM@DvipdfmxOutlineOpen \ltx@IfUndefined{SpecialDvipdfmxOutlineOpen}{% + \ifxetex + \ifdim\number\XeTeXversion\XeTeXrevision in<0.9995in % + \else + \chardef\SpecialDvipdfmxOutlineOpen\ltx@one + \BKM@DvipdfmxOutlineOpentrue + \fi + \fi }{% \ifnum\SpecialDvipdfmxOutlineOpen>\z@ \BKM@DvipdfmxOutlineOpentrue @@ -627,10 +720,12 @@ \begingroup \ifBKM@numbered \let\numberline\Hy@numberline + \let\booknumberline\Hy@numberline \let\partnumberline\Hy@numberline \let\chapternumberline\Hy@numberline \else \let\numberline\@gobble + \let\booknumberline\@gobble \let\partnumberline\@gobble \let\chapternumberline\@gobble \fi |