diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/oberdiek/bookmark.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/oberdiek/bookmark.dtx | 214 |
1 files changed, 121 insertions, 93 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/bookmark.dtx b/Master/texmf-dist/source/latex/oberdiek/bookmark.dtx index 4b754fb8c24..379880c333a 100644 --- a/Master/texmf-dist/source/latex/oberdiek/bookmark.dtx +++ b/Master/texmf-dist/source/latex/oberdiek/bookmark.dtx @@ -72,7 +72,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: bookmark 2007/02/20 v0.2 PDF bookmarks (HO)} +\Msg{* Package: bookmark 2007/02/22 v0.4 PDF bookmarks (HO)} \Msg{************************************************************************} \keepsilent @@ -140,7 +140,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bookmark.drv}% - [2007/02/20 v0.2 PDF bookmarks (HO)] + [2007/02/22 v0.4 PDF bookmarks (HO)] \documentclass{ltxdoc} \usepackage{holtxdoc} \begin{document} @@ -170,7 +170,7 @@ and the derived files % \GetFileInfo{bookmark.drv} % % \title{The \xpackage{bookmark} package} -% \date{2007/02/20 v0.2} +% \date{2007/02/22 v0.4} % \author{Heiko Oberdiek\\\xemail{oberdiek@uni-freiburg.de}} % % \maketitle @@ -335,7 +335,7 @@ and the derived files % \item[\xoption{startatroot}:] % At this time the bookmark tree starts at the top level again. % The next bookmark entry is not sorted as child to a previous entry. -% Example szenario: A document uses part. However there are +% Example scenario: A document uses part. However there are % last chapters that should not be put below the last part: % \begin{quote} %\begin{verbatim} @@ -393,9 +393,6 @@ and the derived files % \begin{itemize} % \item Support for missing drivers (V\TeX, \dots). % \item Support for missing actions (Launch, \dots). -% \item Replacements for \cs{pdfescapehex}, \cs{pdfescapestring}, -% \dots\ for other \TeX\ engines than pdf\TeX. -% \item \xpackage{hyperref}'s \xoption{bookmarkstype}. % \item Adding bookmarks at the end of the document % is difficult for \xoption{dvipdfm}, because the \cs{special} % must go into a page. The problem can be solved by two runs @@ -512,30 +509,34 @@ and the derived files %<*package> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{bookmark}% - [2007/02/20 v0.2 PDF bookmarks (HO)] + [2007/02/22 v0.4 PDF bookmarks (HO)] % \end{macrocode} % % \subsubsection{Requirements} % % \begin{macrocode} -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname pdfescapehex\endcsname\relax - \PackageWarningNoLine{bookmark}{% - Some features of pdfTeX 1.30 are missing that\MessageBreak - protect some arguments. Replacements for these\MessageBreak - features are not implemented. Thus the pdf file\MessageBreak - can become invalid or the .aux file breaks% - }% - \let\BKM@escapename\@firstofone - \let\BKM@escapestring\@firstofone - \let\BKM@escapehex\@firstofone - \let\BKM@unescapehex\@firstofone -\else - \let\BKM@escapename\pdfescapename - \let\BKM@escapestring\pdfescapestring - \let\BKM@escapehex\pdfescapehex - \let\BKM@unescapehex\pdfunescapehex -\fi +\RequirePackage{pdfescape}% +\def\BKM@EscapeName#1{% + \ifx#1\@empty + \else + \EdefEscapeName#1#1% + \fi +}% +\def\BKM@EscapeString#1{% + \ifx#1\@empty + \else + \EdefEscapeString#1#1% + \fi +}% +\def\BKM@EscapeHex#1{% + \ifx#1\@empty + \else + \EdefEscapeHex#1#1% + \fi +}% +\def\BKM@UnescapeHex#1{% + \EdefUnescapeHex#1#1% +}% % \end{macrocode} % % \paragraph{Packages.} @@ -915,18 +916,21 @@ and the derived files \renewcommand*{\Hy@writebookmark}[5]{% \ifnum#4>\Hy@bookmarksdepth\relax \else - \begingroup - \ifHy@bookmarksnumbered - \let\numberline\Hy@numberline - \let\partnumberline\Hy@numberline - \let\chapternumberline\Hy@numberline - \else - \let\numberline\@gobble - \let\partnumberline\@gobble - \let\chapternumberline\@gobble - \fi - \bookmark[level=#4,dest={#3}]{#2}% - \endgroup + \def\BKM@type{#5}% + \ifx\BKM@type\Hy@bookmarkstype + \begingroup + \ifHy@bookmarksnumbered + \let\numberline\Hy@numberline + \let\partnumberline\Hy@numberline + \let\chapternumberline\Hy@numberline + \else + \let\numberline\@gobble + \let\partnumberline\@gobble + \let\chapternumberline\@gobble + \fi + \bookmark[level=#4,dest={#3}]{#2}% + \endgroup + \fi \fi } % \end{macrocode} @@ -945,7 +949,7 @@ and the derived files %<*dvipdfm> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bkm-dvipdfm.def}% - [2007/02/20 v0.2 bookmark driver for dvipdfm (HO)] + [2007/02/22 v0.4 bookmark driver for dvipdfm (HO)] % \end{macrocode} % % \begin{macrocode} @@ -1012,10 +1016,11 @@ and the derived files \edef\BKM@action{/Dest[@page\BKM@page/\BKM@view]}% \fi \else + \BKM@EscapeString\BKM@uri \edef\BKM@action{% /A<<% /S/URI% - /URI(\BKM@escapestring{\BKM@uri})% + /URI(\BKM@uri)% >>% }% \fi @@ -1023,15 +1028,17 @@ and the derived files \edef\BKM@action{/A<<\BKM@rawaction>>}% \fi \else + \BKM@EscapeName\BKM@named \edef\BKM@action{% - /A<</S/Named/N/\BKM@escapename{\BKM@named}>>% + /A<</S/Named/N/\BKM@named>>% }% \fi \else + \BKM@EscapeString\BKM@dest \edef\BKM@action{% /A<<% /S/GoTo% - /D(\BKM@escapestring{\BKM@dest})% + /D(\BKM@dest)% >>% }% \fi @@ -1047,12 +1054,14 @@ and the derived files \fi \edef\BKM@action{/D[\BKM@page/\BKM@view]}% \else - \edef\BKM@action{/D(\BKM@escapestring{\BKM@dest})}% + \BKM@EscapeString\BKM@dest + \edef\BKM@action{/D(\BKM@dest)}% \fi + \BKM@EscapeString\BKM@gotor \edef\BKM@action{% /A<<% /S/GoToR% - /F(\BKM@escapestring{\BKM@gotor})% + /F(\BKM@gotor)% \BKM@action >>% }% @@ -1093,14 +1102,15 @@ and the derived files %<*pdftex> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bkm-pdftex.def}% - [2007/02/20 v0.2 bookmark driver for pdftex (HO)] + [2007/02/22 v0.4 bookmark driver for pdftex (HO)] % \end{macrocode} % % \begin{macrocode} \def\BKM@DO@entry#1#2{% \begingroup \setkeys{BKM@DO}{#1}% - \edef\BKM@DO@title{\BKM@unescapehex{#2}}% + \def\BKM@DO@title{#2}% + \BKM@UnescapeHex\BKM@DO@title \expandafter\expandafter\expandafter\BKM@getx \csname BKM@\BKM@DO@id\endcsname\@empty\@empty \let\BKM@attr\@empty @@ -1132,24 +1142,29 @@ and the derived files \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}})>>}}% + \BKM@UnescapeHex\BKM@DO@uri + \BKM@EscapeString\BKM@DO@uri + \edef\BKM@action{user{<</S/URI/URI(\BKM@DO@uri)>>}}% \fi \else + \BKM@UnescapeHex\BKM@DO@rawaction \edef\BKM@action{% user{% <<% - \BKM@unescapehex{\BKM@DO@rawaction}% + \BKM@DO@rawaction >>% }% }% \fi \else + \BKM@EscapeName\BKM@DO@named \edef\BKM@action{% - user{<</S/Named/N/\BKM@escapename{\BKM@DO@named}>>}% + user{<</S/Named/N/\BKM@DO@named>>}% }% \fi \else + \BKM@UnescapeHex\BKM@DO@dest + \BKM@EscapeString\BKM@DO@dest \edef\BKM@action{goto name{\BKM@DO@dest}}% \fi \else @@ -1164,13 +1179,17 @@ and the derived files \fi \edef\BKM@action{/D[\BKM@DO@page/\BKM@DO@view]}% \else - \edef\BKM@action{/D(\BKM@escapestring{\BKM@DO@dest})}% + \BKM@UnescapeHex\BKM@DO@dest + \BKM@EscapeString\BKM@DO@dest + \edef\BKM@action{/D(\BKM@DO@dest)}% \fi + \BKM@UnescapeHex\BKM@DO@gotor + \BKM@EscapeString\BKM@DO@gotor \edef\BKM@action{% user{% <<% /S/GoToR% - /F(\BKM@escapestring{\BKM@unescapehex{\BKM@DO@gotor}})% + /F(\BKM@DO@gotor)% \BKM@action >>% }% @@ -1193,7 +1212,7 @@ and the derived files %<*dvips> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bkm-dvips.def}% - [2007/02/20 v0.2 bookmark driver for dvips (HO)] + [2007/02/22 v0.4 bookmark driver for dvips (HO)] % \end{macrocode} % % \begin{macrocode} @@ -1231,7 +1250,8 @@ and the derived files \def\BKM@DO@entry#1#2{% \begingroup \setkeys{BKM@DO}{#1}% - \edef\BKM@DO@title{\BKM@unescapehex{#2}}% + \def\BKM@DO@title{#2}% + \BKM@UnescapeHex\BKM@DO@title \expandafter\expandafter\expandafter\BKM@getx \csname BKM@\BKM@DO@id\endcsname\@empty\@empty \let\BKM@attr\@empty @@ -1267,32 +1287,38 @@ and the derived files }% \fi \else + \BKM@UnescapeHex\BKM@DO@uri + \BKM@EscapeString\BKM@DO@uri \edef\BKM@action{% /Action<<% /Subtype/URI% - /URI(\BKM@escapestring{\BKM@unescapehex{\BKM@DO@uri}})% + /URI(\BKM@DO@uri)% >>% }% \fi \else + \BKM@UnescapeHex\BKM@DO@rawaction \edef\BKM@action{% /Action<<% - \BKM@unescapehex{\BKM@DO@rawaction}% + \BKM@DO@rawaction >>% }% \fi \else + \BKM@EscapeName\BKM@DO@named \edef\BKM@action{% /Action<<% /Subtype/Named% - /N/\BKM@escapename{\BKM@DO@named}% + /N/\BKM@DO@named >>% }% \fi \else + \BKM@UnescapeHex\BKM@DO@dest + \BKM@EscapeString\BKM@DO@dest \edef\BKM@action{% /Action/GoTo% - /Dest(\BKM@escapestring{\BKM@DO@dest})cvn% + /Dest(\BKM@DO@dest)cvn% }% \fi \else @@ -1308,13 +1334,17 @@ and the derived files /View[/\BKM@DO@view]% }% \else + \BKM@UnescapeHex\BKM@DO@dest + \BKM@EscapeString\BKM@DO@dest \edef\BKM@action{% - /Dest(\BKM@escapestring{\BKM@DO@dest})cvn% + /Dest(\BKM@DO@dest)cvn% }% \fi + \BKM@UnescapeHex\BKM@DO@gotor + \BKM@EscapeString\BKM@DO@gotor \edef\BKM@action{% /Action/GoToR% - /F(\BKM@escapestring{\BKM@unescapehex{\BKM@DO@gotor}})% + /F(\BKM@DO@gotor)% \BKM@action }% \fi @@ -1406,6 +1436,11 @@ and the derived files }% \pdfstringdef\BKM@title{#2}% \edef\BKM@FLAGS{\printflags{BKM@style}}% + \BKM@EscapeHex\BKM@dest + \BKM@EscapeHex\BKM@uri + \BKM@EscapeHex\BKM@gotor + \BKM@EscapeHex\BKM@rawaction + \BKM@EscapeHex\BKM@title \immediate\write\@mainaux{% \string\BKM@entry{% id=\number\BKM@id @@ -1414,42 +1449,18 @@ and the derived files ,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 + \BKM@auxentry{dest}% + \BKM@auxentry{named}% + \BKM@auxentry{uri}% + \BKM@auxentry{gotor}% + \BKM@auxentry{page}% + \BKM@auxentry{view}% + \BKM@auxentry{rawaction}% + \BKM@auxentry{color}% \ifnum\BKM@FLAGS>\z@ ,flags=\BKM@FLAGS \fi - \ifx\BKM@color\@empty - \else - ,color={\BKM@color}% - \fi - }{\BKM@escapehex{\BKM@title}}% + }{\BKM@title}% }% \endgroup \fi @@ -1462,6 +1473,14 @@ and the derived files \def\BKM@x@childs{#3}% } % \end{macrocode} +% \begin{macrocode} +\def\BKM@auxentry#1{% + \expandafter\ifx\csname BKM@#1\endcsname\@empty + \else + ,#1={\csname BKM@#1\endcsname}% + \fi +} +% \end{macrocode} % % \subsubsection{Read auxiliary data} % @@ -1598,6 +1617,15 @@ and the derived files % Dummies for \cs{pdf(un)escape...} commands added to get % the package basically work for non-pdfTeX users. % \end{Version} +% \begin{Version}{2007/02/21 v0.3} +% \item +% Dependency from \pdfTeX\ 1.30 removed by using package +% \xpackage{pdfescape}. +% \end{Version} +% \begin{Version}{2007/02/22 v0.4} +% \item +% \xpackage{hyperref}'s \xoption{bookmarkstype} respected. +% \end{Version} % \end{History} % % \PrintIndex |