[latex3-commits] [git/LaTeX3-latex3-pdfresources] master: start with generic bookmark code (ca4a540)
Ulrike Fischer
fischer at troubleshooting-tex.de
Wed Mar 25 18:52:02 CET 2020
Repository : https://github.com/latex3/pdfresources
On branch : master
Link : https://github.com/latex3/pdfresources/commit/ca4a54067da0388624aa4e6f179e0cd13e1d6262
>---------------------------------------------------------------
commit ca4a54067da0388624aa4e6f179e0cd13e1d6262
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Wed Mar 25 18:52:02 2020 +0100
start with generic bookmark code
>---------------------------------------------------------------
ca4a54067da0388624aa4e6f179e0cd13e1d6262
build.lua | 4 +-
newpackages/bkm-generic.def | 313 ++++++++++++++++++
newpackages/new-bookmark.sty | 760 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 1076 insertions(+), 1 deletion(-)
diff --git a/build.lua b/build.lua
index 8b66519..9326312 100644
--- a/build.lua
+++ b/build.lua
@@ -10,7 +10,9 @@ installfiles = {"*.sty","*.cls","*.def","*.lua"}
sourcefiles = {"*.dtx","*.ins",
"hgeneric-experimental.def",
"tmpl3shipout.sty",
- "newpackages/new-transparent.sty"}
+ "newpackages/new-transparent.sty",
+ "newpackages/new-bookmark.sty",
+ "newpackages/bkm-generic.def"}
checkruns = 3
diff --git a/newpackages/bkm-generic.def b/newpackages/bkm-generic.def
new file mode 100644
index 0000000..5248cc1
--- /dev/null
+++ b/newpackages/bkm-generic.def
@@ -0,0 +1,313 @@
+%%
+%% This is file `bkm-pdftex.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% bookmark.dtx (with options: `pdftex')
+%%
+%% This is a generated file.
+%%
+%% Project: bookmark
+%% Version: 2019/12/03 v1.28
+%%
+%% Copyright (C)
+%% 2007-2011 Heiko Oberdiek
+%% 2016-2019 Oberdiek Package Support Group
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% https://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% https://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainers of this work are
+%% Heiko Oberdiek and the Oberdiek Package Support Group
+%% https://github.com/ho-tex/bookmark/issues
+%%
+%%
+%% This work consists of the main source file bookmark.dtx
+%% and the derived files
+%% bookmark.sty, bookmark.pdf, bookmark.ins, bookmark.drv,
+%% bkm-dvipdfm.def, bkm-dvips.def, bkm-dvipsone.def,
+%% bkm-textures.def, bkm-pdftex.def, bkm-vtex.def,
+%% bookmark-example.tex.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{bkm-generic.def}%
+ [2020/03/25 v1.28 experimental generic bookmark driver (UF)]%
+\def\BKM at DO@entry#1#2{%
+ \begingroup
+ \kvsetkeys{BKM at DO}{#1}%
+ \def\BKM at DO@title{#2}%
+ \ifx\BKM at DO@srcfile\@empty
+ \else
+ \BKM at UnescapeHex\BKM at DO@srcfile
+ \fi
+ \BKM at UnescapeHex\BKM at DO@title
+ \expandafter\expandafter\expandafter\BKM at getx
+ \csname BKM@\BKM at DO@id\endcsname\@empty\@empty
+ \let\BKM at attr\@empty
+ \ifx\BKM at DO@flags\@empty
+ \else
+ \edef\BKM at attr{\BKM at attr/F \BKM at DO@flags}%
+ \fi
+ \ifx\BKM at DO@color\@empty
+ \else
+ \edef\BKM at attr{\BKM at attr/C[\BKM at DO@color]}%
+ \fi
+ \ifx\BKM at attr\@empty
+ \else
+ \edef\BKM at attr{attr{\BKM at attr}}%
+ \fi
+ \let\BKM at action\@empty
+ \ifx\BKM at DO@gotor\@empty
+ \ifx\BKM at DO@dest\@empty
+ \ifx\BKM at DO@named\@empty
+ \ifx\BKM at DO@rawaction\@empty
+ \ifx\BKM at DO@uri\@empty
+ \ifx\BKM at DO@page\@empty
+ \PackageError{bookmark}{%
+ Missing action\BKM at SourceLocation
+ }\@ehc
+ \edef\BKM at action{goto page1{/Fit}}%
+ \else
+ \ifx\BKM at DO@view\@empty
+ \def\BKM at DO@view{Fit}%
+ \fi
+ \edef\BKM at action{goto page\BKM at DO@page{/\BKM at DO@view}}%
+ \fi
+ \else
+ \BKM at UnescapeHex\BKM at DO@uri
+ \BKM at EscapeString\BKM at DO@uri
+ \edef\BKM at action{user{<</S/URI/URI(\BKM at DO@uri)>>}}%
+ \fi
+ \else
+ \BKM at UnescapeHex\BKM at DO@rawaction
+ \edef\BKM at action{%
+ user{%
+ <<%
+ \BKM at DO@rawaction
+ >>%
+ }%
+ }%
+ \fi
+ \else
+ \BKM at EscapeName\BKM at DO@named
+ \edef\BKM at action{%
+ user{<</S/Named/N/\BKM at DO@named>>}%
+ }%
+ \fi
+ \else
+ \BKM at UnescapeHex\BKM at DO@dest
+ \BKM at DefGotoNameAction\BKM at action\BKM at DO@dest
+ \fi
+ \else
+ \ifx\BKM at DO@dest\@empty
+ \ifx\BKM at DO@page\@empty
+ \def\BKM at DO@page{0}%
+ \else
+ \BKM at CalcExpr\BKM at DO@page\BKM at DO@page-1%
+ \fi
+ \ifx\BKM at DO@view\@empty
+ \def\BKM at DO@view{Fit}%
+ \fi
+ \edef\BKM at action{/D[\BKM at DO@page/\BKM at DO@view]}%
+ \else
+ \BKM at UnescapeHex\BKM at DO@dest
+ \BKM at EscapeString\BKM at DO@dest
+ \edef\BKM at action{/D(\BKM at DO@dest)}%
+ \fi
+ \BKM at UnescapeHex\BKM at DO@gotor
+ \BKM at EscapeString\BKM at DO@gotor
+ \edef\BKM at action{%
+ user{%
+ <<%
+ /S/GoToR%
+ /F(\BKM at DO@gotor)%
+ \BKM at action
+ >>%
+ }%
+ }%
+ \fi
+ \pdfoutline\BKM at attr\BKM at action
+ count\ifBKM at DO@open\else-\fi\BKM at x@childs
+ {\BKM at DO@title}%
+ \endgroup
+}
+\def\BKM at DefGotoNameAction#1#2{%
+ \BKM at EscapeString\BKM at DO@dest
+ \edef#1{goto name{#2}}%
+}
+\def\BKM at SourceLocation{%
+ \ifx\BKM at DO@srcfile\@empty
+ \ifx\BKM at DO@srcline\@empty
+ \else
+ .\MessageBreak
+ Source: line \BKM at DO@srcline
+ \fi
+ \else
+ \ifx\BKM at DO@srcline\@empty
+ .\MessageBreak
+ Source: file `\BKM at DO@srcfile'%
+ \else
+ .\MessageBreak
+ Source: file `\BKM at DO@srcfile', line \BKM at DO@srcline
+ \fi
+ \fi
+}
+\RequirePackage{auxhook}
+\AddLineBeginMainAux{%
+ \string\providecommand\string\BKM at entry[2]{}%
+}
+\newcount\BKM at id
+\BKM at id=\z@
+\@namedef{BKM at 0}{000}
+\newif\ifBKM at sw
+\newcommand*{\bookmark}[2][]{%
+ \if at filesw
+ \begingroup
+ \BKM at InitSourceLocation
+ \def\bookmark at text{#2}%
+ \BKM at setup{#1}%
+ \ifx\BKM at srcfile\@empty
+ \else
+ \BKM at EscapeHex\BKM at srcfile
+ \fi
+ \edef\BKM at prev{\the\BKM at id}%
+ \global\advance\BKM at id\@ne
+ \BKM at swtrue
+ \@whilesw\ifBKM at sw\fi{%
+ \ifnum\ifBKM at startatroot\z@\else\BKM at prev\fi=\z@
+ \BKM at startatrootfalse
+ \expandafter\xdef\csname BKM@\the\BKM at id\endcsname{%
+ 0{\BKM at level}0%
+ }%
+ \BKM at swfalse
+ \else
+ \expandafter\expandafter\expandafter\BKM at getx
+ \csname BKM@\BKM at prev\endcsname
+ \ifnum\BKM at level>\BKM at x@level\relax
+ \expandafter\xdef\csname BKM@\the\BKM at id\endcsname{%
+ {\BKM at prev}{\BKM at level}0%
+ }%
+ \ifnum\BKM at prev>\z@
+ \BKM at CalcExpr\BKM at CalcResult\BKM at x@childs+1%
+ \expandafter\xdef\csname BKM@\BKM at prev\endcsname{%
+ {\BKM at x@parent}{\BKM at x@level}{\BKM at CalcResult}%
+ }%
+ \fi
+ \BKM at swfalse
+ \else
+ \let\BKM at prev\BKM at x@parent
+ \fi
+ \fi
+ }%
+ \pdfstringdef\BKM at title{\bookmark at text}%
+ \edef\BKM at FLAGS{\BKM at PrintStyle}%
+ \csname BKM at HypDestOptHook\endcsname
+ \BKM at EscapeHex\BKM at dest
+ \BKM at EscapeHex\BKM at uri
+ \BKM at EscapeHex\BKM at gotor
+ \BKM at EscapeHex\BKM at rawaction
+ \BKM at EscapeHex\BKM at title
+ \immediate\write\@mainaux{%
+ \string\BKM at entry{%
+ id=\number\BKM at id
+ \ifBKM at open
+ \ifnum\BKM at level<\BKM at openlevel
+ ,open%
+ \fi
+ \fi
+ \BKM at auxentry{dest}%
+ \BKM at auxentry{named}%
+ \BKM at auxentry{uri}%
+ \BKM at auxentry{gotor}%
+ \BKM at auxentry{page}%
+ \BKM at auxentry{view}%
+ \BKM at auxentry{rawaction}%
+ \BKM at auxentry{color}%
+ \ifnum\BKM at FLAGS>\z@
+ ,flags=\BKM at FLAGS
+ \fi
+ \BKM at auxentry{srcline}%
+ \BKM at auxentry{srcfile}%
+ }{\BKM at title}%
+ }%
+ \endgroup
+ \fi
+}
+\def\BKM at getx#1#2#3{%
+ \def\BKM at x@parent{#1}%
+ \def\BKM at x@level{#2}%
+ \def\BKM at x@childs{#3}%
+}
+\def\BKM at auxentry#1{%
+ \expandafter\ifx\csname BKM@#1\endcsname\@empty
+ \else
+ ,#1={\csname BKM@#1\endcsname}%
+ \fi
+}
+\def\BKM at InitSourceLocation{%
+ \edef\BKM at srcline{\the\inputlineno}%
+ \BKM at LuaTeX@InitFile
+ \ifx\BKM at srcfile\@empty
+ \ltx at IfUndefined{currfilepath}{}{%
+ \edef\BKM at srcfile{\currfilepath}%
+ }%
+ \fi
+}
+\ifluatex
+ \ifnum\luatexversion>36 %
+ \def\BKM at LuaTeX@InitFile{%
+ \begingroup
+ \ltx at LocToksA={}%
+ \edef\x{\endgroup
+ \def\noexpand\BKM at srcfile{%
+ \the\expandafter\ltx at LocToksA
+ \directlua{%
+ if status and status.filename then %
+ tex.settoks('ltx at LocToksA', status.filename)%
+ end%
+ }%
+ }%
+ }\x
+ }%
+ \else
+ \let\BKM at LuaTeX@InitFile\relax
+ \fi
+\else
+ \let\BKM at LuaTeX@InitFile\relax
+\fi
+\SetupKeyvalOptions{family=BKM at DO,prefix=BKM at DO@}
+\DeclareStringOption[0]{id}
+\DeclareBoolOption{open}
+\DeclareStringOption{flags}
+\DeclareStringOption{color}
+\DeclareStringOption{dest}
+\DeclareStringOption{named}
+\DeclareStringOption{uri}
+\DeclareStringOption{gotor}
+\DeclareStringOption{page}
+\DeclareStringOption{view}
+\DeclareStringOption{rawaction}
+\DeclareStringOption{srcline}
+\DeclareStringOption{srcfile}
+\AtBeginDocument{%
+ \let\BKM at entry\BKM at DO@entry
+}
+\ifBKM at atend
+ \AfterLastShipout{%
+ \BKM at EndHook
+ }%
+\fi
+
+\endinput
+%%
+%% End of file `bkm-pdftex.def'.
diff --git a/newpackages/new-bookmark.sty b/newpackages/new-bookmark.sty
new file mode 100644
index 0000000..a7260a5
--- /dev/null
+++ b/newpackages/new-bookmark.sty
@@ -0,0 +1,760 @@
+%%
+%% This is file `bookmark.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% bookmark.dtx (with options: `package')
+%%
+%% This is a generated file.
+%%
+%% Project: bookmark
+%% Version: 2019/12/03 v1.28
+%%
+%% Copyright (C)
+%% 2007-2011 Heiko Oberdiek
+%% 2016-2019 Oberdiek Package Support Group
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% https://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% https://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainers of this work are
+%% Heiko Oberdiek and the Oberdiek Package Support Group
+%% https://github.com/ho-tex/bookmark/issues
+%%
+%%
+%% This work consists of the main source file bookmark.dtx
+%% and the derived files
+%% bookmark.sty, bookmark.pdf, bookmark.ins, bookmark.drv,
+%% bkm-dvipdfm.def, bkm-dvips.def, bkm-dvipsone.def,
+%% bkm-textures.def, bkm-pdftex.def, bkm-vtex.def,
+%% bookmark-example.tex.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{new-bookmark}%
+ [2020-03-25 experimental version of v1.28 PDF bookmarks (HO)]%
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname numexpr\endcsname\relax
+ \def\BKM at CalcExpr#1#2#3#4{%
+ \begingroup
+ \count@=#2\relax
+ \advance\count@ by#3#4\relax
+ \edef\x{\endgroup
+ \def\noexpand#1{\the\count@}%
+ }%
+ \x
+ }%
+\else
+ \def\BKM at CalcExpr#1#2#3#4{%
+ \edef#1{%
+ \the\numexpr#2#3#4\relax
+ }%
+ }%
+\fi
+\def\BKM at EscapeName#1{%
+ \ifx#1\@empty
+ \else
+ \EdefEscapeName#1#1%
+ \fi
+}%
+\def\BKM at EscapeString#1{%
+ \ifx#1\@empty
+ \else
+ \EdefEscapeString#1#1%
+ \fi
+}%
+\def\BKM at EscapeHex#1{%
+ \ifx#1\@empty
+ \else
+ \EdefEscapeHex#1#1%
+ \fi
+}%
+\def\BKM at UnescapeHex#1{%
+ \EdefUnescapeHex#1#1%
+}%
+\RequirePackage{hyperref}[2010/06/18]
+\SetupKeyvalOptions{family=BKM,prefix=BKM@}
+\DeclareLocalOptions{%
+ atend,%
+ bold,%
+ color,%
+ depth,%
+ dest,%
+ draft,%
+ final,%
+ gotor,%
+ italic,%
+ keeplevel,%
+ level,%
+ named,%
+ numbered,%
+ open,%
+ openlevel,%
+ page,%
+ rawaction,%
+ rellevel,%
+ srcfile,%
+ srcline,%
+ startatroot,%
+ uri,%
+ view,%
+}
+\newcommand*{\bookmarksetup}{\kvsetkeys{BKM}}
+\def\BKM at setup#1{%
+ \bookmarksetup{#1}%
+ \ifx\BKM at HookNext\ltx at empty
+ \else
+ \expandafter\bookmarksetup\expandafter{\BKM at HookNext}%
+ \BKM at HookNextClear
+ \fi
+ \BKM at hook
+ \ifBKM at keeplevel
+ \else
+ \xdef\BKM at currentlevel{\BKM at level}%
+ \fi
+}
+\newcommand*{\bookmarksetupnext}[1]{%
+ \ltx at GlobalAppendToMacro\BKM at HookNext{,#1}%
+}
+\def\BKM at HookNextClear{%
+ \global\let\BKM at HookNext\ltx at empty
+}
+\BKM at HookNextClear
+\DeclareBoolOption{draft}
+\DeclareComplementaryOption{final}{draft}
+\def\BKM at DisableOptions{%
+ \DisableKeyvalOption[action=warning,package=bookmark]%
+ {BKM}{draft}%
+ \DisableKeyvalOption[action=warning,package=bookmark]%
+ {BKM}{final}%
+}
+\DeclareBoolOption[\ifHy at bookmarksopen true\else false\fi]{open}
+\def\bookmark at open{%
+ \ifBKM at open\ltx at one\else\ltx at zero\fi
+}
+\DeclareStringOption[\maxdimen]{openlevel}
+\edef\BKM at openlevel{\number\@bookmarksopenlevel}
+\ltx at IfUndefined{Hy at bookmarksdepth}{%
+ \def\BKM at depth{\c at tocdepth}%
+}{%
+ \let\BKM at depth\Hy at bookmarksdepth
+}
+\define at key{BKM}{depth}[]{%
+ \edef\BKM at param{#1}%
+ \ifx\BKM at param\@empty
+ \def\BKM at depth{\c at tocdepth}%
+ \else
+ \ltx at IfUndefined{toclevel@\BKM at param}{%
+ \@onelevel at sanitize\BKM at param
+ \edef\BKM at temp{\expandafter\@car\BKM at param\@nil}%
+ \ifcase 0\expandafter\ifx\BKM at temp-1\fi
+ \expandafter\ifnum\expandafter`\BKM at temp>47 %
+ \expandafter\ifnum\expandafter`\BKM at temp<58 %
+ 1%
+ \fi
+ \fi
+ \relax
+ \PackageWarning{bookmark}{%
+ Unknown document division name (\BKM at param)\MessageBreak
+ for option `depth'%
+ }%
+ \else
+ \BKM at SetDepthOrLevel\BKM at depth\BKM at param
+ \fi
+ }{%
+ \BKM at SetDepthOrLevel\BKM at depth{%
+ \csname toclevel@\BKM at param\endcsname
+ }%
+ }%
+ \fi
+}
+\def\bookmark at depth{\BKM at depth}
+\def\BKM at SetDepthOrLevel#1#2{%
+ \begingroup
+ \setbox\z@=\hbox{%
+ \count@=#2\relax
+ \expandafter
+ }%
+ \expandafter\endgroup
+ \expandafter\def\expandafter#1\expandafter{\the\count@}%
+}
+\DeclareStringOption[\BKM at currentlevel]{level}[\BKM at currentlevel]
+\define at key{BKM}{level}{%
+ \edef\BKM at param{#1}%
+ \ifx\BKM at param\BKM at MacroCurrentLevel
+ \let\BKM at level\BKM at param
+ \else
+ \ltx at IfUndefined{toclevel@\BKM at param}{%
+ \@onelevel at sanitize\BKM at param
+ \edef\BKM at temp{\expandafter\@car\BKM at param\@nil}%
+ \ifcase 0\expandafter\ifx\BKM at temp-1\fi
+ \expandafter\ifnum\expandafter`\BKM at temp>47 %
+ \expandafter\ifnum\expandafter`\BKM at temp<58 %
+ 1%
+ \fi
+ \fi
+ \relax
+ \PackageWarning{bookmark}{%
+ Unknown document division name (\BKM at param)\MessageBreak
+ for option `level'%
+ }%
+ \else
+ \BKM at SetDepthOrLevel\BKM at level\BKM at param
+ \fi
+ }{%
+ \BKM at SetDepthOrLevel\BKM at level{%
+ \csname toclevel@\BKM at param\endcsname
+ }%
+ }%
+ \fi
+}
+\def\BKM at MacroCurrentLevel{\BKM at currentlevel}
+\DeclareBoolOption{keeplevel}
+\DeclareBoolOption{startatroot}
+\def\BKM at startatrootfalse{%
+ \global\let\ifBKM at startatroot\iffalse
+}
+\def\BKM at startatroottrue{%
+ \global\let\ifBKM at startatroot\iftrue
+}
+\define at key{BKM}{rellevel}{%
+ \BKM at CalcExpr\BKM at level{#1}+\BKM at currentlevel
+}
+\def\bookmark at level{\BKM at level}
+\def\BKM at currentlevel{0}
+\DeclareBoolOption[%
+ \ifHy at bookmarksnumbered true\else false\fi
+]{numbered}
+\g at addto@macro\BKM at numberedtrue{%
+ \let\ifHy at bookmarksnumbered\iftrue
+}
+\g at addto@macro\BKM at numberedfalse{%
+ \let\ifHy at bookmarksnumbered\iffalse
+}
+\g at addto@macro\Hy at bookmarksnumberedtrue{%
+ \let\ifBKM at numbered\iftrue
+}
+\g at addto@macro\Hy at bookmarksnumberedfalse{%
+ \let\ifBKM at numbered\iffalse
+}
+\def\bookmark at numbered{%
+ \ifBKM at numbered\ltx at one\else\ltx at zero\fi
+}
+\def\BKM at PatchHyperrefOption#1{%
+ \expandafter\BKM@@PatchHyperrefOption\csname KV at Hyp@#1\endcsname%
+}
+\def\BKM@@PatchHyperrefOption#1{%
+ \expandafter\BKM@@@PatchHyperrefOption#1{##1}\BKM at nil#1%
+}
+\def\BKM@@@PatchHyperrefOption#1\BKM at nil#2#3{%
+ \def#2##1{%
+ #1%
+ \bookmarksetup{#3={##1}}%
+ }%
+}
+\BKM at PatchHyperrefOption{bookmarksopen}{open}
+\BKM at PatchHyperrefOption{bookmarksopenlevel}{openlevel}
+\BKM at PatchHyperrefOption{bookmarksdepth}{depth}
+\bitsetReset{BKM at FontStyle}%
+\define at key{BKM}{italic}[true]{%
+ \expandafter\ifx\csname if#1\endcsname\iftrue
+ \bitsetSet{BKM at FontStyle}{0}%
+ \else
+ \bitsetClear{BKM at FontStyle}{0}%
+ \fi
+}%
+\define at key{BKM}{bold}[true]{%
+ \expandafter\ifx\csname if#1\endcsname\iftrue
+ \bitsetSet{BKM at FontStyle}{1}%
+ \else
+ \bitsetClear{BKM at FontStyle}{1}%
+ \fi
+}%
+\def\bookmark at italic{%
+ \ifnum\bitsetGet{BKM at FontStyle}{0}=1 \ltx at one\else\ltx at zero\fi
+}
+\def\bookmark at bold{%
+ \ifnum\bitsetGet{BKM at FontStyle}{1}=1 \ltx at one\else\ltx at zero\fi
+}
+\def\BKM at PrintStyle{%
+ \bitsetGetDec{BKM at FontStyle}%
+}%
+\define at key{BKM}{color}{%
+ \HyColor at BookmarkColor{#1}\BKM at color{bookmark}{color}%
+}
+\let\BKM at color\@empty
+\def\bookmark at color{\BKM at color}
+\def\BKM at temp#1{%
+ \DeclareStringOption{#1}%
+ \expandafter\edef\csname bookmark@#1\endcsname{%
+ \expandafter\noexpand\csname BKM@#1\endcsname
+ }%
+}
+\BKM at temp{dest}
+\BKM at temp{named}
+\BKM at temp{uri}
+\BKM at temp{gotor}
+\BKM at temp{rawaction}
+\define at key{BKM}{page}{%
+ \def\BKM at page{#1}%
+ \ifx\BKM at page\@empty
+ \else
+ \edef\BKM at page{\number\BKM at page}%
+ \ifnum\BKM at page>\z@
+ \else
+ \PackageError{bookmark}{Page must be positive}\@ehc
+ \def\BKM at page{1}%
+ \fi
+ \fi
+}
+\let\BKM at page\@empty
+\def\bookmark at page{\BKM@@page}
+\define at key{BKM}{view}{%
+ \BKM at CheckView{#1}%
+}
+\let\BKM at view\@empty
+\def\bookmark at view{\BKM at view}
+\def\BKM at CheckView#1{%
+ \BKM at CheckViewType#1 \@nil
+}
+\def\BKM at CheckViewType#1 #2\@nil{%
+ \def\BKM at type{#1}%
+ \@onelevel at sanitize\BKM at type
+ \BKM at TestViewType{Fit}{}%
+ \BKM at TestViewType{FitB}{}%
+ \BKM at TestViewType{FitH}{%
+ \BKM at CheckParam#2 \@nil{top}%
+ }%
+ \BKM at TestViewType{FitBH}{%
+ \BKM at CheckParam#2 \@nil{top}%
+ }%
+ \BKM at TestViewType{FitV}{%
+ \BKM at CheckParam#2 \@nil{bottom}%
+ }%
+ \BKM at TestViewType{FitBV}{%
+ \BKM at CheckParam#2 \@nil{bottom}%
+ }%
+ \BKM at TestViewType{FitR}{%
+ \BKM at CheckRect{#2}{ }%
+ }%
+ \BKM at TestViewType{XYZ}{%
+ \BKM at CheckXYZ{#2}{ }%
+ }%
+ \@car{%
+ \PackageError{bookmark}{%
+ Unknown view type `\BKM at type',\MessageBreak
+ using `FitH' instead%
+ }\@ehc
+ \def\BKM at view{FitH}%
+ }%
+ \@nil
+}
+\def\BKM at TestViewType#1{%
+ \def\BKM at temp{#1}%
+ \@onelevel at sanitize\BKM at temp
+ \ifx\BKM at type\BKM at temp
+ \let\BKM at view\BKM at temp
+ \expandafter\@car
+ \else
+ \expandafter\@gobble
+ \fi
+}
+\def\BKM at CheckParam#1 #2\@nil#3{%
+ \def\BKM at param{#1}%
+ \ifx\BKM at param\@empty
+ \PackageWarning{bookmark}{%
+ Missing parameter (#3) for `\BKM at type',\MessageBreak
+ using 0%
+ }%
+ \def\BKM at param{0}%
+ \else
+ \BKM at CalcParam
+ \fi
+ \edef\BKM at view{\BKM at view\space\BKM at param}%
+}
+\def\BKM at CheckRect#1#2{%
+ \BKM@@CheckRect#1#2#2#2#2\@nil
+}
+\def\BKM@@CheckRect#1 #2 #3 #4 #5\@nil{%
+ \def\BKM at temp{0}%
+ \def\BKM at param{#1}%
+ \ifx\BKM at param\@empty
+ \def\BKM at param{0}%
+ \def\BKM at temp{1}%
+ \else
+ \BKM at CalcParam
+ \fi
+ \edef\BKM at view{\BKM at view\space\BKM at param}%
+ \def\BKM at param{#2}%
+ \ifx\BKM at param\@empty
+ \def\BKM at param{0}%
+ \def\BKM at temp{1}%
+ \else
+ \BKM at CalcParam
+ \fi
+ \edef\BKM at view{\BKM at view\space\BKM at param}%
+ \def\BKM at param{#3}%
+ \ifx\BKM at param\@empty
+ \def\BKM at param{0}%
+ \def\BKM at temp{1}%
+ \else
+ \BKM at CalcParam
+ \fi
+ \edef\BKM at view{\BKM at view\space\BKM at param}%
+ \def\BKM at param{#4}%
+ \ifx\BKM at param\@empty
+ \def\BKM at param{0}%
+ \def\BKM at temp{1}%
+ \else
+ \BKM at CalcParam
+ \fi
+ \edef\BKM at view{\BKM at view\space\BKM at param}%
+ \ifnum\BKM at temp>\z@
+ \PackageWarning{bookmark}{Missing parameters for `\BKM at type'}%
+ \fi
+}
+\def\BKM at CheckXYZ#1#2{%
+ \BKM@@CheckXYZ#1#2#2#2\@nil
+}
+\def\BKM@@CheckXYZ#1 #2 #3 #4\@nil{%
+ \def\BKM at param{#1}%
+ \let\BKM at temp\BKM at param
+ \@onelevel at sanitize\BKM at temp
+ \ifx\BKM at param\@empty
+ \let\BKM at param\BKM at null
+ \else
+ \ifx\BKM at temp\BKM at null
+ \else
+ \BKM at CalcParam
+ \fi
+ \fi
+ \edef\BKM at view{\BKM at view\space\BKM at param}%
+ \def\BKM at param{#2}%
+ \let\BKM at temp\BKM at param
+ \@onelevel at sanitize\BKM at temp
+ \ifx\BKM at param\@empty
+ \let\BKM at param\BKM at null
+ \else
+ \ifx\BKM at temp\BKM at null
+ \else
+ \BKM at CalcParam
+ \fi
+ \fi
+ \edef\BKM at view{\BKM at view\space\BKM at param}%
+ \def\BKM at param{#3}%
+ \ifx\BKM at param\@empty
+ \let\BKM at param\BKM at null
+ \fi
+ \edef\BKM at view{\BKM at view\space\BKM at param}%
+}
+\def\BKM at null{null}
+\@onelevel at sanitize\BKM at null
+\def\BKM at CalcParam{%
+ \begingroup
+ \let\calc\@firstofone
+ \expandafter\BKM@@CalcParam\BKM at param\@empty\@empty\@nil
+}
+\def\BKM@@CalcParam#1#2#3\@nil{%
+ \ifx\calc#1%
+ \@ifundefined{calc at assign@dimen}{%
+ \@ifundefined{dimexpr}{%
+ \setlength{\dimen@}{#2}%
+ }{%
+ \setlength{\dimen@}{\dimexpr#2\relax}%
+ }%
+ }{%
+ \setlength{\dimen@}{#2}%
+ }%
+ \dimen at .99626\dimen@
+ \edef\BKM at param{\strip at pt\dimen@}%
+ \expandafter\endgroup
+ \expandafter\def\expandafter\BKM at param\expandafter{\BKM at param}%
+ \else
+ \endgroup
+ \fi
+}
+\DeclareBoolOption{atend}
+\g at addto@macro\BKM at DisableOptions{%
+ \DisableKeyvalOption[action=warning,package=bookmark]%
+ {BKM}{atend}%
+}
+\newcommand*{\bookmarkdefinestyle}[2]{%
+ \@ifundefined{BKM at style@#1}{%
+ }{%
+ \PackageInfo{bookmark}{Redefining style `#1'}%
+ }%
+ \@namedef{BKM at style@#1}{#2}%
+}
+\define at key{BKM}{style}{%
+ \BKM at StyleCall{#1}%
+}
+\newif\ifBKM at ok
+\def\BKM at StyleCall#1{%
+ \@ifundefined{BKM at style@#1}{%
+ \PackageWarning{bookmark}{%
+ Ignoring unknown style `#1'%
+ }%
+ }{%
+ \BKM at oktrue
+ \edef\BKM at StyleCurrent{#1}%
+ \@onelevel at sanitize\BKM at StyleCurrent
+ \let\BKM at StyleEntry\BKM at StyleEntryCheck
+ \BKM at StyleStack
+ \ifBKM at ok
+ \expandafter\@firstofone
+ \else
+ \PackageError{bookmark}{%
+ Ignoring recursive call of style `\BKM at StyleCurrent'%
+ }\@ehc
+ \expandafter\@gobble
+ \fi
+ {%
+ \let\BKM at StyleEntry\relax
+ \edef\BKM at StyleStack{%
+ \BKM at StyleEntry{\BKM at StyleCurrent}%
+ \BKM at StyleStack
+ }%
+ \expandafter\expandafter\expandafter\bookmarksetup
+ \expandafter\expandafter\expandafter{%
+ \csname BKM at style@\BKM at StyleCurrent\endcsname
+ }%
+ \BKM at StyleStackPop
+ }%
+ }%
+}
+\def\BKM at StyleStackPop{%
+ \let\BKM at StyleEntry\relax
+ \edef\BKM at StyleStack{%
+ \expandafter\@gobbletwo\BKM at StyleStack
+ }%
+}
+\def\BKM at StyleEntryCheck#1{%
+ \def\BKM at temp{#1}%
+ \ifx\BKM at temp\BKM at StyleCurrent
+ \BKM at okfalse
+ \fi
+}
+\def\BKM at StyleStack{}
+\DeclareStringOption{srcline}
+\DeclareStringOption{srcfile}
+\def\BKM at hook{}
+\define at key{BKM}{addtohook}{%
+ \ltx at LocalAppendToMacro\BKM at hook{#1}%
+}
+\newcommand*{\bookmarkget}[1]{%
+ \romannumeral0%
+ \ltx at ifundefined{bookmark@#1}{%
+ \ltx at space
+ }{%
+ \expandafter\expandafter\expandafter\ltx at space
+ \csname bookmark@#1\endcsname
+ }%
+}
+\def\BKM at DefineDriverKey#1{%
+ \define at key{BKM}{#1}[]{%
+ \def\BKM at driver{#1}%
+ }%
+ \g at addto@macro\BKM at DisableOptions{%
+ \DisableKeyvalOption[action=warning,package=bookmark]%
+ {BKM}{#1}%
+ }%
+}
+\BKM at DefineDriverKey{pdftex}
+\BKM at DefineDriverKey{dvips}
+\BKM at DefineDriverKey{dvipsone}
+\BKM at DefineDriverKey{textures}
+\BKM at DefineDriverKey{dvipdfm}
+\BKM at DefineDriverKey{dvipdfmx}
+\BKM at DefineDriverKey{xetex}
+\BKM at DefineDriverKey{vtex}
+\define at key{BKM}{dvipdfmx-outline-open}[true]{%
+ \expandafter\ifx\csname if#1\expandafter\endcsname
+ \csname iftrue\endcsname
+ \chardef\SpecialDvipdfmxOutlineOpen\@ne
+ \else
+ \chardef\SpecialDvipdfmxOutlineOpen\z@
+ \fi
+}
+\g at addto@macro\BKM at DisableOptions{%
+ \DisableKeyvalOption{BKM}{dvipdfmx-outline-open}%
+}
+\def\bookmark at driver{\BKM at driver}
+\InputIfFileExists{bookmark.cfg}{}{}
+\providecommand*{\BookmarkDriverDefault}{dvips}
+\ifpdf
+ \def\BKM at driver{pdftex}%
+ \ifx\pdfoutline\@undefined
+ \ifx\pdfextension\@undefined\else
+ \protected\def\pdfoutline{\pdfextension outline }
+ \fi
+ \fi
+\else
+ \ifxetex
+ \def\BKM at driver{dvipdfm}%
+ \else
+ \ifvtex
+ \def\BKM at driver{vtex}%
+ \else
+ \edef\BKM at driver{\BookmarkDriverDefault}%
+ \fi
+ \fi
+\fi
+\ProcessKeyvalOptions*
+\BKM at DisableOptions
+\ifBKM at draft
+ \PackageWarningNoLine{bookmark}{Draft mode on}%
+ \let\bookmarksetup\ltx at gobble
+ \let\BookmarkAtEnd\ltx at gobble
+ \let\bookmarkdefinestyle\ltx at gobbletwo
+ \let\bookmarkget\ltx at gobble
+ \let\pdfbookmark\ltx at undefined
+ \newcommand*{\pdfbookmark}[3][]{}%
+ \let\currentpdfbookmark\ltx at gobbletwo
+ \let\subpdfbookmark\ltx at gobbletwo
+ \let\belowpdfbookmark\ltx at gobbletwo
+ \newcommand*{\bookmark}[2][]{}%
+ \renewcommand*{\Hy at writebookmark}[5]{}%
+ \let\ReadBookmarks\relax
+ \let\BKM at DefGotoNameAction\ltx at gobbletwo % package `hypdestopt'
+ \expandafter\endinput
+\fi
+\newif\ifBKM at DvipdfmxOutlineOpen
+\ltx at IfUndefined{SpecialDvipdfmxOutlineOpen}{%
+ \ifxetex
+ \ifdim\number\XeTeXversion\XeTeXrevision in<0.9995in %
+ \else
+ \chardef\SpecialDvipdfmxOutlineOpen\ltx at one
+ \BKM at DvipdfmxOutlineOpentrue
+ \fi
+ \fi
+}{%
+ \ifnum\SpecialDvipdfmxOutlineOpen>\z@
+ \BKM at DvipdfmxOutlineOpentrue
+ \fi
+}
+\def\BKM at temp{dvipdfmx}%
+\ifx\BKM at temp\BKM at driver
+ \def\BKM at driver{dvipdfm}%
+\fi
+\def\BKM at temp{pdftex}%
+\ifpdf
+ \ifx\BKM at temp\BKM at driver
+ \else
+ \PackageWarningNoLine{bookmark}{%
+ Wrong driver `\BKM at driver', using `pdftex' instead%
+ }%
+ \let\BKM at driver\BKM at temp
+ \fi
+\else
+ \ifx\BKM at temp\BKM at driver
+ \PackageError{bookmark}{%
+ Wrong driver, pdfTeX is not running in PDF mode.\MessageBreak
+ Package loading is aborted%
+ }\@ehc
+ \expandafter\expandafter\expandafter\endinput
+ \fi
+ \def\BKM at temp{dvipdfm}%
+ \ifxetex
+ \ifx\BKM at temp\BKM at driver
+ \else
+ \PackageWarningNoLine{bookmark}{%
+ Wrong driver `\BKM at driver',\MessageBreak
+ using `dvipdfm' for XeTeX instead%
+ }%
+ \let\BKM at driver\BKM at temp
+ \fi
+ \else
+ \def\BKM at temp{vtex}%
+ \ifvtex
+ \ifx\BKM at temp\BKM at driver
+ \else
+ \PackageWarningNoLine{bookmark}{%
+ Wrong driver `\BKM at driver',\MessageBreak
+ using `vtex' for VTeX instead%
+ }%
+ \let\BKM at driver\BKM at temp
+ \fi
+ \else
+ \ifx\BKM at temp\BKM at driver
+ \PackageError{bookmark}{%
+ Wrong driver, VTeX is not running in PDF mode.\MessageBreak
+ Package loading is aborted%
+ }\@ehc
+ \expandafter\expandafter\expandafter\endinput
+ \fi
+ \fi
+ \fi
+\fi
+\InputIfFileExists{bkm-generic.def}{}{%
+ \PackageError{bookmark}{%
+ Unsupported driver `\BKM at driver'.\MessageBreak
+ Package loading is aborted%
+ }\@ehc
+ \endinput
+}
+\let\pdfbookmark\ltx at undefined
+\newcommand*{\pdfbookmark}[3][0]{%
+ \bookmark[level=#1,dest={#3.#1}]{#2}%
+ \hyper at anchorstart{#3.#1}\hyper at anchorend
+}
+\def\currentpdfbookmark{%
+ \pdfbookmark[\BKM at currentlevel]%
+}
+\def\subpdfbookmark{%
+ \BKM at CalcExpr\BKM at CalcResult\BKM at currentlevel+1%
+ \expandafter\pdfbookmark\expandafter[\BKM at CalcResult]%
+}
+\def\belowpdfbookmark#1#2{%
+ \xdef\BKM at gtemp{\number\BKM at currentlevel}%
+ \subpdfbookmark{#1}{#2}%
+ \global\let\BKM at currentlevel\BKM at gtemp
+}
+\def\Hy at writebookmark#1#2#3#4#5{%
+ \ifnum#4>\BKM at depth\relax
+ \else
+ \def\BKM at type{#5}%
+ \ifx\BKM at type\Hy at bookmarkstype
+ \begingroup
+ \ifBKM at numbered
+ \let\numberline\Hy at numberline
+ \let\booknumberline\Hy at numberline
+ \let\partnumberline\Hy at numberline
+ \let\chapternumberline\Hy at numberline
+ \else
+ \let\numberline\@gobble
+ \let\booknumberline\@gobble
+ \let\partnumberline\@gobble
+ \let\chapternumberline\@gobble
+ \fi
+ \bookmark[level=#4,dest={#3}]{#2}%
+ \endgroup
+ \fi
+ \fi
+}
+\let\ReadBookmarks\relax
+\ifBKM at atend
+\else
+ \newcommand{\BookmarkAtEnd}[1]{%
+ \PackageWarning{bookmark}{%
+ Ignored, because option `atend' is missing%
+ }%
+ }%
+ \expandafter\endinput
+\fi
+\newcommand*{\BookmarkAtEnd}{%
+ \g at addto@macro\BKM at EndHook
+}
+\let\BKM at EndHook\@empty
+
+\endinput
+%%
+%% End of file `bookmark.sty'.
More information about the latex3-commits
mailing list.