diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/oberdiek/bkm-pdftex.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/oberdiek/bkm-pdftex.def | 236 |
1 files changed, 236 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/oberdiek/bkm-pdftex.def b/Master/texmf-dist/tex/latex/oberdiek/bkm-pdftex.def new file mode 100644 index 00000000000..1295407ba63 --- /dev/null +++ b/Master/texmf-dist/tex/latex/oberdiek/bkm-pdftex.def @@ -0,0 +1,236 @@ +%% +%% 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. +%% +%% Copyright (C) 2007 by Heiko Oberdiek <oberdiek@uni-freiburg.de> +%% +%% 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 +%% 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". +%% +%% This Current Maintainer of this work is Heiko Oberdiek. +%% +%% 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-pdftex.def, +%% bookmark-example.tex. +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{bkm-pdftex.def}% + [2007/02/20 v0.2 bookmark driver for pdftex (HO)] +\def\BKM@DO@entry#1#2{% + \begingroup + \setkeys{BKM@DO}{#1}% + \edef\BKM@DO@title{\BKM@unescapehex{#2}}% + \expandafter\expandafter\expandafter\BKM@getx + \csname BKM@\BKM@DO@id\endcsname\@empty\@empty + \let\BKM@attr\@empty + \ifx\BKM@DO@flags\@empty + \else + \edef\BKM@attr{\BKM@attr/F \BKM@DO@flags}% + \fi + \ifx\BKM@DO@color\@empty + \else + \edef\BKM@attr{\BKM@attr/C[\BKM@DO@color]}% + \fi + \ifx\BKM@attr\@empty + \else + \edef\BKM@attr{attr{\BKM@attr}}% + \fi + \let\BKM@action\@empty + \ifx\BKM@DO@gotor\@empty + \ifx\BKM@DO@dest\@empty + \ifx\BKM@DO@named\@empty + \ifx\BKM@DO@rawaction\@empty + \ifx\BKM@DO@uri\@empty + \ifx\BKM@DO@page\@empty + \PackageError{bookmark}{Missing action}\@ehc + \edef\BKM@action{goto page1{/Fit}}% + \else + \ifx\BKM@DO@view\@empty + \def\BKM@DO@view{Fit}% + \fi + \edef\BKM@action{goto page\BKM@DO@page{/\BKM@DO@view}}% + \fi + \else + \edef\BKM@action{user{<</S/URI/URI(% + \BKM@escapestring{\BKM@unescapehex{\BKM@DO@uri}})>>}}% + \fi + \else + \edef\BKM@action{% + user{% + <<% + \BKM@unescapehex{\BKM@DO@rawaction}% + >>% + }% + }% + \fi + \else + \edef\BKM@action{% + user{<</S/Named/N/\BKM@escapename{\BKM@DO@named}>>}% + }% + \fi + \else + \edef\BKM@action{goto name{\BKM@DO@dest}}% + \fi + \else + \ifx\BKM@DO@dest\@empty + \ifx\BKM@DO@page\@empty + \def\BKM@DO@page{0}% + \else + \edef\BKM@DO@page{\the\numexpr\BKM@DO@page-1\relax}% + \fi + \ifx\BKM@DO@view\@empty + \def\BKM@DO@view{Fit}% + \fi + \edef\BKM@action{/D[\BKM@DO@page/\BKM@DO@view]}% + \else + \edef\BKM@action{/D(\BKM@escapestring{\BKM@DO@dest})}% + \fi + \edef\BKM@action{% + user{% + <<% + /S/GoToR% + /F(\BKM@escapestring{\BKM@unescapehex{\BKM@DO@gotor}})% + \BKM@action + >>% + }% + }% + \fi + \pdfoutline\BKM@attr\BKM@action + count\ifBKM@DO@open\else-\fi\BKM@x@childs + {\BKM@DO@title}% + \endgroup +} +\RequirePackage{auxhook} +\AddLineBeginMainAux{% + \string\providecommand\string\BKM@entry[2]{}% +} +\newcount\BKM@id +\BKM@id=\z@ +\def\BKM@0{000} +\newif\ifBKM@sw +\newcommand*{\bookmark}[2][]{% + \if@filesw + \begingroup + \bookmarksetup{#1}% + \ifBKM@keeplevel + \else + \xdef\BKM@currentlevel{\BKM@level}% + \fi + \edef\BKM@prev{\the\BKM@id}% + \global\advance\BKM@id\@ne + \BKM@swtrue + \@whilesw\ifBKM@sw\fi{% + \ifnum\ifBKM@startatroot\z@\else\BKM@prev\fi=\z@ + \global\BKM@startatrootfalse + \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% + 0{\BKM@level}0% + }% + \BKM@swfalse + \else + \expandafter\expandafter\expandafter\BKM@getx + \csname BKM@\BKM@prev\endcsname + \ifnum\BKM@level>\BKM@x@level\relax + \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% + {\BKM@prev}{\BKM@level}0% + }% + \ifnum\BKM@prev>\z@ + \expandafter\xdef\csname BKM@\BKM@prev\endcsname{% + {\BKM@x@parent}{\BKM@x@level}{% + \the\numexpr\BKM@x@childs+1\relax + }% + }% + \fi + \BKM@swfalse + \else + \let\BKM@prev\BKM@x@parent + \fi + \fi + }% + \pdfstringdef\BKM@title{#2}% + \edef\BKM@FLAGS{\printflags{BKM@style}}% + \immediate\write\@mainaux{% + \string\BKM@entry{% + id=\number\BKM@id + \ifBKM@open + \ifnum\BKM@level<\BKM@openlevel + ,open% + \fi + \fi + \ifx\BKM@dest\@empty + \else + ,dest={\BKM@dest}% + \fi + \ifx\BKM@named\@empty + \else + ,named={\BKM@named}% + \fi + \ifx\BKM@uri\@empty + \else + ,uri={\BKM@escapehex{\BKM@uri}}% + \fi + \ifx\BKM@gotor\@empty + \else + ,gotor={\BKM@escapehex{\BKM@gotor}}% + \fi + \ifx\BKM@page\@empty + \else + ,page=\BKM@page + \fi + \ifx\BKM@view\@empty + \else + ,view={\BKM@view}% + \fi + \ifx\BKM@rawaction\@empty + \else + ,rawaction={\BKM@escapehex{\BKM@rawaction}}% + \fi + \ifnum\BKM@FLAGS>\z@ + ,flags=\BKM@FLAGS + \fi + \ifx\BKM@color\@empty + \else + ,color={\BKM@color}% + \fi + }{\BKM@escapehex{\BKM@title}}% + }% + \endgroup + \fi +} +\def\BKM@getx#1#2#3{% + \def\BKM@x@parent{#1}% + \def\BKM@x@level{#2}% + \def\BKM@x@childs{#3}% +} +\SetupKeyvalOptions{family=BKM@DO,prefix=BKM@DO@} +\DeclareStringOption[0]{id} +\DeclareBoolOption{open} +\DeclareStringOption{flags} +\DeclareStringOption{color} +\DeclareStringOption{dest} +\DeclareStringOption{named} +\DeclareStringOption{uri} +\DeclareStringOption{gotor} +\DeclareStringOption{page} +\DeclareStringOption{view} +\DeclareStringOption{rawaction} +\AtBeginDocument{% + \let\BKM@entry\BKM@DO@entry +} +\endinput +%% +%% End of file `bkm-pdftex.def'. |