| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% File: bookmark.dtx |
| 4 |
% Version: 2026-05-21 v1.32 |
| 5 |
% Info: PDF bookmarks |
| 6 |
% |
| 7 |
% Copyright (C) |
| 8 |
% 2007-2011 Heiko Oberdiek |
| 9 |
% 2016-2026 Oberdiek Package Support Group |
| 10 |
% https://github.com/ho-tex/bookmark/issues |
| 11 |
% |
| 12 |
% This work may be distributed and/or modified under the |
| 13 |
% conditions of the LaTeX Project Public License, either |
| 14 |
% version 1.3c of this license or (at your option) any later |
| 15 |
% version. This version of this license is in |
| 16 |
% https://www.latex-project.org/lppl/lppl-1-3c.txt |
| 17 |
% and the latest version of this license is in |
| 18 |
% https://www.latex-project.org/lppl.txt |
| 19 |
% and version 1.3 or later is part of all distributions of |
| 20 |
% LaTeX version 2005/12/01 or later. |
| 21 |
% |
| 22 |
% This work has the LPPL maintenance status "maintained". |
| 23 |
% |
| 24 |
% The Current Maintainers of this work are |
| 25 |
% Heiko Oberdiek and the Oberdiek Package Support Group |
| 26 |
% https://github.com/ho-tex/bookmark/issues |
| 27 |
% |
| 28 |
% This work consists of the main source files bookmark.dtx, |
| 29 |
% and bookmark.ins and the derived files |
| 30 |
% bookmark.sty, bookmark.pdf, |
| 31 |
% bkm-dvipdfm.def, bkm-dvips.def, |
| 32 |
% bkm-pdftex.def, bkm-vtex.def, |
| 33 |
% bookmark-example.tex. |
| 34 |
% |
| 35 |
% Distribution: |
| 36 |
% CTAN:macros/latex/contrib/bookmark/bookmark.dtx |
| 37 |
% CTAN:macros/latex/contrib/bookmark/bookmark.pdf |
| 38 |
% |
| 39 |
% Unpacking: |
| 40 |
% tex/pdftex/pdflatex bookmark.ins |
| 41 |
% |
| 42 |
% Documentation: |
| 43 |
% |
| 44 |
% (pdf)latex bookmark.dtx; ... |
| 45 |
% |
| 46 |
% The class ltxdoc loads the configuration file ltxdoc.cfg |
| 47 |
% if available. Here you can specify further options, e.g. |
| 48 |
% use A4 as paper format: |
| 49 |
% \PassOptionsToClass{a4paper}{article} |
| 50 |
% |
| 51 |
% Program calls to get the documentation (example): |
| 52 |
% pdflatex bookmark.dtx |
| 53 |
% makeindex -s gind.ist bookmark.idx |
| 54 |
% pdflatex bookmark.dtx |
| 55 |
% makeindex -s gind.ist bookmark.idx |
| 56 |
% pdflatex bookmark.dtx |
| 57 |
% |
| 58 |
% Installation: |
| 59 |
% TDS:tex/latex/bookmark/bookmark.sty |
| 60 |
% TDS:tex/latex/bookmark/bkm-dvipdfm.def |
| 61 |
% TDS:tex/latex/bookmark/bkm-dvips.def |
| 62 |
% TDS:tex/latex/bookmark/bkm-pdftex.def |
| 63 |
% TDS:tex/latex/bookmark/bkm-vtex.def |
| 64 |
% TDS:doc/latex/bookmark/bookmark.pdf |
| 65 |
% TDS:doc/latex/bookmark/bookmark-example.tex |
| 66 |
% TDS:source/latex/bookmark/bookmark.dtx |
| 67 |
% |
| 68 |
%<*driver> |
| 69 |
\DocumentMetadata{tagging=on} |
| 70 |
\documentclass{l3in2edoc} |
| 71 |
|
| 72 |
\DeclareDocElement[printtype=\textit{key},idxtype=key,idxgroup=Keys]{Key}{keydecl} |
| 73 |
% they should be robust: |
| 74 |
% |
| 75 |
\NewDocumentCommand\xoption{m}{\textsf{#1\DescribeKey[noprint]{#1}}} |
| 76 |
\RenewDocumentCommand\hook{m}{\texttt{#1\DescribeHook[noprint]{#1}}} |
| 77 |
\newcommand*{\xpackage}[1]{\textsf{#1}} |
| 78 |
\newcommand*{\xmodule}[1]{\textsf{#1}} |
| 79 |
\newcommand*{\xclass}[1]{\textsf{#1}} |
| 80 |
\newcommand*{\xfile}[1]{\texttt{#1}} |
| 81 |
\newcommand*{\xext}[1]{\texttt{.#1}} |
| 82 |
\newcommand*{\xemail}[1]{% |
| 83 |
\textless\texttt{#1}\textgreater% |
| 84 |
} |
| 85 |
\newcommand*{\xnewsgroup}[1]{% |
| 86 |
\href{news:#1}{\nolinkurl{#1}}% |
| 87 |
} |
| 88 |
\newcommand*{\CTANpkg}[1]{% |
| 89 |
\href{http://ctan.org/pkg/#1}{\nolinkurl{CTAN:pkg/#1}}% |
| 90 |
} |
| 91 |
\newcommand*{\CTAN}[1]{% |
| 92 |
\href{https://ctan.org/tex-archive/#1}{\nolinkurl{CTAN:#1}}% |
| 93 |
} |
| 94 |
\providecommand*{\docstrip}{\textsf{docstrip}} |
| 95 |
\providecommand*{\mikTeX}{\hologo{MiKTeX}} |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
\newenvironment{Version}[1] |
| 100 |
{\subsection*[toc={[#1]}]{[#1]}\begin{itemize}} |
| 101 |
{\end{itemize}} |
| 102 |
\newenvironment{History} |
| 103 |
{\section{History}\raggedright}{} |
| 104 |
|
| 105 |
\usepackage{etoolbox} |
| 106 |
% get rid of index entries from macrocode environments |
| 107 |
% |
| 108 |
\ExplSyntaxOn\makeatletter |
| 109 |
\bool_new:N\l__BKM_index_macrocode_bool |
| 110 |
\DeclareKeys [ BKM / doc ] |
| 111 |
{ |
| 112 |
index-macrocode .bool_set:N=\l__BKM_index_macrocode_bool, |
| 113 |
index-macrocode .initial:n=true |
| 114 |
} |
| 115 |
\patchcmd \__codedoc_special_index_aux:nnnnnn |
| 116 |
{\__codedoc_index_codeline_hc:nn} |
| 117 |
{ |
| 118 |
\bool_if:NTF\l__BKM_index_macrocode_bool |
| 119 |
{\__codedoc_index_codeline_hc:nn} |
| 120 |
{\use_none:nn} |
| 121 |
} |
| 122 |
{} |
| 123 |
{\fail} |
| 124 |
\SetKeys[BKM/doc]{index-macrocode=false} |
| 125 |
\ExplSyntaxOff\makeatother |
| 126 |
|
| 127 |
|
| 128 |
\begin{document} |
| 129 |
\DocInput{bookmark.dtx}% |
| 130 |
\end{document} |
| 131 |
%</driver> |
| 132 |
% \fi |
| 133 |
% |
| 134 |
% |
| 135 |
% \title{The \xpackage{bookmark} package} |
| 136 |
% \date{2026-05-21 v1.32} |
| 137 |
% \author{Heiko Oberdiek\thanks |
| 138 |
% {Please report any issues at \url{https://github.com/ho-tex/bookmark/issues}}} |
| 139 |
% |
| 140 |
% \maketitle |
| 141 |
% |
| 142 |
% \begin{abstract} |
| 143 |
% This package implements a new bookmark (outline) organization for |
| 144 |
% package \xpackage{hyperref}. Bookmark properties such |
| 145 |
% as style and color can now be set. Other action types |
| 146 |
% are available (URI, GoToR, Named). The bookmarks are |
| 147 |
% generated in the first compile run. Package \xpackage{hyperref} |
| 148 |
% uses two runs. |
| 149 |
% \end{abstract} |
| 150 |
% |
| 151 |
% \tableofcontents |
| 152 |
% |
| 153 |
% \section{Documentation} |
| 154 |
% |
| 155 |
% \subsection{Introduction} |
| 156 |
% |
| 157 |
% This package \xpackage{bookmark} tries to provide a more modern |
| 158 |
% management for bookmarks: |
| 159 |
% \begin{itemize} |
| 160 |
% \item The bookmarks are already generated in the first \hologo{TeX} compile run. |
| 161 |
% \item The font style and color of the bookmarks can be changed. |
| 162 |
% \item More actions than simple GoTo actions are possible. |
| 163 |
% \end{itemize} |
| 164 |
% |
| 165 |
% In the same way as \xpackage{hyperref} \cite{hyperref} |
| 166 |
% the bookmarks are generated |
| 167 |
% in the order of the bookmark generating macros (\cs{bookmark}). |
| 168 |
% A level number is used to define the tree structure of the bookmarks. |
| 169 |
% The restrictions are less strict: |
| 170 |
% \begin{itemize} |
| 171 |
% \item The level values may jump and omit values. A \cs{subsubsection} |
| 172 |
% may follow a \cs{chapter}. This was an error in \xpackage{hyperref}, |
| 173 |
% that prints a warning and tries to fix this. |
| 174 |
% \item Several bookmarks may point to the same destination. |
| 175 |
% In \xpackage{hyperref} this would mess up the bookmark tree |
| 176 |
% completely, because the algorithm assumes that the destination |
| 177 |
% names are keys (unique). |
| 178 |
% \end{itemize} |
| 179 |
% |
| 180 |
% Note that this package is intended as experimentation platform |
| 181 |
% for bookmark management. Feedback is welcome. Also the interfaces |
| 182 |
% may change in future versions. |
| 183 |
% |
| 184 |
% \subsection{Options} |
| 185 |
% |
| 186 |
% \begin{function}{\bookmarksetup,\bookmarksetupnext,\bookmark} |
| 187 |
% Options can be given at four places: |
| 188 |
% \begin{enumerate} |
| 189 |
% \item \cs{usepackage}|[|\meta{options}|]{bookmark}|\\ |
| 190 |
% This is the only place for driver options |
| 191 |
% and option \xoption{atend}. |
| 192 |
% \item \cs{bookmarksetup}|{|\meta{options}|}|\\ |
| 193 |
% This command is just for setting options. |
| 194 |
% \item \cs{bookmarksetupnext}|{|\meta{options}|}|\\ |
| 195 |
% The options are stored and called after the |
| 196 |
% options of the next \cs{bookmark} command. |
| 197 |
% \item \cs{bookmark}|[|\meta{options}|]{|\meta{title}|}|\\ |
| 198 |
% This command sets the bookmark. The option settings remain |
| 199 |
% limited to this bookmark. |
| 200 |
% \end{enumerate} |
| 201 |
% Exception: Driver options, option \xoption{atend} and |
| 202 |
% options \xoption{draft}\slash\xoption{final} |
| 203 |
% cannot be changed after the package is loaded. |
| 204 |
%\end{function} |
| 205 |
% |
| 206 |
% \subsubsection{Options \xoption{draft} and \xoption{final}} |
| 207 |
% |
| 208 |
% If a \LaTeX\ file is compiled several times, then a little |
| 209 |
% time can be saved, if option \xoption{draft} is used to |
| 210 |
% disable the bookmark stuff of this package. Default is |
| 211 |
% \xoption{final}. |
| 212 |
% Both options are boolean options, without |
| 213 |
% value the value |true| is used. |draft=true| is the same |
| 214 |
% as |final=false|. |
| 215 |
% |
| 216 |
% Options of package \xpackage{bookmark} are local options |
| 217 |
% with the exception of driver options. Therefore \xoption{draft} |
| 218 |
% or \xoption{final} given as class option is not seen by this |
| 219 |
% package. If you want to optimize first \LaTeX\ runs depending |
| 220 |
% on a global \xoption{draft}, then package \xpackage{ifdraft} |
| 221 |
% and \LaTeX's \cs{PassOptionsToPackage} |
| 222 |
% might help in the organization of the preamble, for example: |
| 223 |
%\begin{quote} |
| 224 |
%\begin{verbatim} |
| 225 |
% \documentclass[draft]{article} |
| 226 |
% \usepackage{ifdraft} |
| 227 |
% \ifdraft{% |
| 228 |
% \PassOptionsToPackage{draft}{bookmark}% |
| 229 |
% }{} |
| 230 |
%\end{verbatim} |
| 231 |
%\end{quote} |
| 232 |
% |
| 233 |
% \subsubsection{Driver options} |
| 234 |
% |
| 235 |
% The driver options are now all ignored. |
| 236 |
% If \hologo{VTeX} is detected its driver file will be loaded. |
| 237 |
% If not the package calls the \hologo{LaTeX} command \cs{sys_ensure_backend:} |
| 238 |
% to triggers is backend detection and then inspects \cs{c_sys_backend_str}. |
| 239 |
% This means that for \hologo{pdfTeX}, \hologo{LuaLaTeX}, \hologo{XeTeX} |
| 240 |
% and \hologo{LaTeX} with dvips you don't need to do anything at all. |
| 241 |
% For \hologo{DVIPDFMx} should set the backend globally with one |
| 242 |
% of the following options: |
| 243 |
% \begin{verbatim} |
| 244 |
% \DocumentMetadata{backend=dvipdfmx} %if \DocumentMetadata is used |
| 245 |
% \RequirePackage[backend=dvipdfmx]{pdfmanagement}%if the PDF management is used |
| 246 |
% \documentclass[dvipdfmx]{article} % otherwise |
| 247 |
% \end{verbatim} |
| 248 |
% |
| 249 |
% The current versions of the drivers use \LaTeX-hooks and test if the PDF management |
| 250 |
% is active and so require a format newer than 2022-06-01. |
| 251 |
% |
| 252 |
% \paragraph{Open bookmarks with dvipdfmx.} Older version of |
| 253 |
% the package had an option \xoption{dvipdfmx-outline-open} |
| 254 |
% to activate code which allows to specify the open |
| 255 |
% status of an outline entry. |
| 256 |
% The package now assumes that all used dvipdfmx version are current enough to |
| 257 |
% understand this code and so activates the code always. |
| 258 |
% The option itself will be ignored. |
| 259 |
% |
| 260 |
% |
| 261 |
% \subsubsection{Layout options} |
| 262 |
% |
| 263 |
% \paragraph{Font options.} |
| 264 |
% |
| 265 |
% \begin{description} |
| 266 |
% \item[\xoption{bold}:] The bookmark is shown with a bold font |
| 267 |
% if the PDF viewer supports this (since PDF 1.4). |
| 268 |
% \item[\xoption{italic}:] An italic font is used (since PDF 1.4). |
| 269 |
% \end{description} |
| 270 |
% Both \xoption{bold} and \xoption{italic} can be used together. |
| 271 |
% Using value |false| disables the font option. |
| 272 |
% |
| 273 |
% \paragraph{Color option.} |
| 274 |
% |
| 275 |
% Colored bookmarks are a feature of PDF 1.4, they are not supported |
| 276 |
% by all PDF viewers. |
| 277 |
% \begin{description} |
| 278 |
% \item[\xoption{color}:] Here the color can be given as |
| 279 |
% color specification of packages \xpackage{color} or \xpackage{xcolor}. |
| 280 |
% An empty value means that the color property is not set. |
| 281 |
% The recognized values are |
| 282 |
% \begin{itemize} |
| 283 |
% \item Empty value, no color is set,\\ |
| 284 |
% example: |color={}| |
| 285 |
% \item Explicit color specification of color model rgb,\\ |
| 286 |
% example for red: |color=[rgb]{1,0,0}| |
| 287 |
% \item Explicit color specification of color model gray,\\ |
| 288 |
% example for dark gray: |color=[gray]{0.25}|\\ |
| 289 |
% \item Color expressions like |color=red!50!white|. |
| 290 |
% This requires that either the PDF management or the \xpackage{xcolor} is loaded. |
| 291 |
% \end{itemize} |
| 292 |
% \end{description} |
| 293 |
% |
| 294 |
% \subsubsection{Action options} |
| 295 |
% |
| 296 |
% \begin{description} |
| 297 |
% \item[\xoption{dest}:] Destination name. |
| 298 |
% \item[\xoption{page}:] Page number, first page is 1. |
| 299 |
% \item[\xoption{view}:] View specification, examples:\\ |
| 300 |
% |view={FitB}|, |view={FitH 842}|, |view={XYZ 0 100 null}| |
| 301 |
% Some view specification parameters expect numbers as parameters |
| 302 |
% with unit bp. They can be given either as plain numbers or |
| 303 |
% as length expressions inside \cs{calc}. Expressions of |
| 304 |
% package \xpackage{calc} are supported if the package is loaded. |
| 305 |
% Otherwise \hologo{eTeX}'s \cs{dimexpr} is used. Example:\\ |
| 306 |
% |view={FitH \calc{\paperheight-\topmargin-1in}}|\\ |
| 307 |
% |view={XYZ 0 \calc{\paperheight} null}|\\ |
| 308 |
% Note that \cs{calc} cannot be used for the third parameter |
| 309 |
% of |XYZ|. This parameter is the zoom value, not a length. |
| 310 |
% \item[\xoption{named}:] Named action name:\\ |
| 311 |
% |FirstPage|, |LastPage|, |NextPage|, |PrevPage| |
| 312 |
% \item[\xoption{gotor}:] Name of the external PDF file. |
| 313 |
% \item[\xoption{uri}:] URI specification. |
| 314 |
% \item[\xoption{rawaction}:] Raw action specification. |
| 315 |
% Because these specification depends on the driver this option |
| 316 |
% should not be used. |
| 317 |
% \end{description} |
| 318 |
% The appropriate action for the bookmark is selected by |
| 319 |
% analyzing the specified options. The actions |
| 320 |
% are distinguished by different sets of options: |
| 321 |
% \begin{quote} |
| 322 |
% \begin{tabular}{@{}ll@{}} |
| 323 |
% \textbf{Action} & \textbf{Options}\\ |
| 324 |
% \hline |
| 325 |
% \textsf{GoTo}: & \xoption{dest}\\ |
| 326 |
% \textsf{GoTo}: & \xoption{page} + \xoption{view}\\ |
| 327 |
% \textsf{GoToR}: & \xoption{gotor} + \xoption{dest}\\ |
| 328 |
% \textsf{GoToR}: & \xoption{gotor} + \xoption{page} + \xoption{view}\\ |
| 329 |
% \textsf{Named}: & \xoption{named}\\ |
| 330 |
% \textsf{URI}: & \xoption{uri} |
| 331 |
% \end{tabular} |
| 332 |
% \end{quote} |
| 333 |
% |
| 334 |
% \paragraph{Missing actions.} |
| 335 |
% If the action is missing package \xpackage{bookmark} throws |
| 336 |
% an error message. Depending on the driver (\xoption{pdftex}, |
| 337 |
% \xoption{dvips} and friends) the package detects it quite late |
| 338 |
% at the end of the document. Since version 2011/04/21 v1.21 |
| 339 |
% the package tries printing the line number and file name |
| 340 |
% of the corresponding occurrence of \cs{bookmark}. |
| 341 |
% However, \hologo{TeX} does provide the line number, but |
| 342 |
% unhappily the file name is a secret. The package supports |
| 343 |
% some ways to get the file name: |
| 344 |
% \begin{itemize} |
| 345 |
% \item If \hologo{LuaTeX} (independently from DVI or PDF modes) |
| 346 |
% is running, then its |status.filename| is used automatically. |
| 347 |
% \item Package \cs{currfile} \cite{currfile} redefines \hologo{LaTeX} |
| 348 |
% internals to keep track of the file name. If the package |
| 349 |
% is loaded, then its \cs{currfilepath} is detected and used |
| 350 |
% automatically by package \xpackage{bookmark}. |
| 351 |
% \item The file name can be set manually by option \xoption{scrfile} |
| 352 |
% in \cs{bookmarksetup} or \cs{bookmark}. But be careful, |
| 353 |
% manual setting disables the previous ways for file name |
| 354 |
% detection. And a wrong or missed file name setting might |
| 355 |
% get you a wrong source location in the error message. |
| 356 |
% \end{itemize} |
| 357 |
% |
| 358 |
% \subsubsection{Level options} |
| 359 |
% |
| 360 |
% The order of the bookmark entries are defined by the |
| 361 |
% appearance order of \cs{bookmark} commands. The tree structure |
| 362 |
% is constructed by the property \xoption{level} of the bookmark nodes. |
| 363 |
% The values of \xoption{level} are integers. If the level of a |
| 364 |
% bookmark entry has a higher value than the previous node, then |
| 365 |
% the entry becomes a child of the previous node. The absolute |
| 366 |
% value of the difference does not matter. |
| 367 |
% |
| 368 |
% Package \xpackage{bookmark} remembers the level of the previous |
| 369 |
% bookmark entry in a global property `current level'. |
| 370 |
% |
| 371 |
% The behaviour of the level system can be configured by following |
| 372 |
% options: |
| 373 |
% \begin{description} |
| 374 |
% \item[\xoption{level}:] |
| 375 |
% Sets the level, see the description above. If option \xoption{level} |
| 376 |
% is given without value, then the default behaviour is restored, |
| 377 |
% that the `current level' is used as level value. |
| 378 |
% Since version 2010/10/19 v1.16 package \xpackage{bookmark} |
| 379 |
% also supports names |part|, |section| and other, |
| 380 |
% if the macros \cs{toclevel@part}, \cs{toclevel@section} |
| 381 |
% are defined (done by package \xpackage{hyperref}, see |
| 382 |
% option \xoption{bookmarkdepth}). |
| 383 |
% \item[\xoption{rellevel}:] |
| 384 |
% Sets the level relative to the previous level. |
| 385 |
% A positive value means that the bookmark entry become |
| 386 |
% a child of the previous one. |
| 387 |
% \item[\xoption{keeplevel}:] |
| 388 |
% Use the level, set by \xoption{level} or \xoption{rellevel}, |
| 389 |
% but do not change the global property `current level'. |
| 390 |
% The option can be disabled by setting to |false|. |
| 391 |
% \item[\xoption{startatroot}:] |
| 392 |
% At this time the bookmark tree starts at the top level again. |
| 393 |
% The next bookmark entry is not sorted as child to a previous entry. |
| 394 |
% Example scenario: A document uses part. However there are |
| 395 |
% last chapters that should not be put below the last part: |
| 396 |
% \begin{quote} |
| 397 |
%\begin{verbatim} |
| 398 |
% \documentclass{book} |
| 399 |
% [...] |
| 400 |
% \begin{document} |
| 401 |
% \part{First part} |
| 402 |
% \chapter{First chapter in first part} |
| 403 |
% [...] |
| 404 |
% \part{Second part} |
| 405 |
% \chapter{First chapter in second part} |
| 406 |
% [...] |
| 407 |
% \bookmarksetup{startatroot} |
| 408 |
% \chapter{Index}% does not belong to second part |
| 409 |
% \end{document} |
| 410 |
%\end{verbatim} |
| 411 |
% \end{quote} |
| 412 |
% \end{description} |
| 413 |
% |
| 414 |
% \subsubsection{Style definitions} |
| 415 |
% |
| 416 |
% A style is a group of option settings. It can be defined |
| 417 |
% by macro \cs{bookmarkdefinestyle} and is used by option \xoption{style}. |
| 418 |
% \begin{function}{\bookmarkdefinestyle} |
| 419 |
% \begin{syntax} |
| 420 |
% \cs{bookmarkdefinestyle}\Arg{name}\Arg{key value list} |
| 421 |
% \end{syntax} |
| 422 |
% The \meta{key value list} of option settings is assigned the |
| 423 |
% style \meta{name}. |
| 424 |
% \end{function} |
| 425 |
% |
| 426 |
% \begin{description} |
| 427 |
% \item[\xoption{style}:] |
| 428 |
% The value of option \xoption{style} is the name of a previously |
| 429 |
% defined style. Its option settings are now executed. |
| 430 |
% The options may include option \xoption{style}. |
| 431 |
% Endless recursion by calling the same style recursively |
| 432 |
% is prevented and throws an error. |
| 433 |
% \end{description} |
| 434 |
% |
| 435 |
% \subsubsection{Hook support} |
| 436 |
% |
| 437 |
% A hook is called right after the processing the optional options |
| 438 |
% of macro \cs{bookmark}. |
| 439 |
% \begin{description} |
| 440 |
% \item[\xoption{addtohook}:] |
| 441 |
% Code, given as value to this option is added to the hook. |
| 442 |
% \end{description} |
| 443 |
% |
| 444 |
% \begin{function}{\bookmarkget} |
| 445 |
% \begin{syntax} |
| 446 |
% \cs{bookmarkget}\Arg{option} |
| 447 |
% \end{syntax} |
| 448 |
% \end{function} |
| 449 |
% |
| 450 |
% Macro \cs{bookmarkget} extracts the value of the latest option |
| 451 |
% setting of option \meta{option}. In case of boolean options number |
| 452 |
% one is returned, if the boolean option is enabled, otherwise the |
| 453 |
% result is zero. |
| 454 |
% The resulting numbers can directly be used in \cs{ifnum} or \cs{ifcase}. |
| 455 |
% If you want to have the digits \texttt{0} and \texttt{1}, then |
| 456 |
% prefix \cs{bookmarkget} with \cs{number}. |
| 457 |
% Macro \cs{bookmarkget} is expandable. |
| 458 |
% In case of |
| 459 |
% unsupported options an empty string is returned. |
| 460 |
% Supported boolean options are |
| 461 |
% \begin{quote} |
| 462 |
% \xoption{bold}, |
| 463 |
% \xoption{italic}, |
| 464 |
% \xoption{open} |
| 465 |
% \end{quote} |
| 466 |
% Other supported options: |
| 467 |
% \begin{quote} |
| 468 |
% \xoption{depth}, |
| 469 |
% \xoption{dest}, |
| 470 |
% \xoption{color}, |
| 471 |
% \xoption{gotor}, |
| 472 |
% \xoption{level}, |
| 473 |
% \xoption{named}, |
| 474 |
% \xoption{openlevel}, |
| 475 |
% \xoption{page}, |
| 476 |
% \xoption{rawaction}, |
| 477 |
% \xoption{uri}, |
| 478 |
% \xoption{view}, |
| 479 |
% \end{quote} |
| 480 |
% Additionally the following key is available: |
| 481 |
% \begin{quote} |
| 482 |
% \xoption{text} |
| 483 |
% \end{quote} |
| 484 |
% It returns the text of the outline entry. |
| 485 |
% |
| 486 |
% \paragraph{Option setting.} |
| 487 |
% Inside the hook an option can be set using \cs{bookmarksetup}. |
| 488 |
% |
| 489 |
% \subsection{Compatibility with \xpackage{hyperref}} |
| 490 |
% |
| 491 |
% Package \xpackage{bookmark} automatically disables |
| 492 |
% \xpackage{hyperref}'s bookmarks. However the package |
| 493 |
% uses some of the code of \xpackage{hyperref}. For example, |
| 494 |
% the package redefines the hook \cs{Hy@writebookmark} that |
| 495 |
% \xpackage{hyperref} inserts in \cs{addcontentsline} and |
| 496 |
% other commands. Therefore |
| 497 |
% \xpackage{hyperref}'s bookmarks should not be disabled. |
| 498 |
% |
| 499 |
% Package \xpackage{bookmark} uses \xpackage{hyperref}'s \cs{pdfstringdef} |
| 500 |
% and does not provide a replacement. |
| 501 |
% |
| 502 |
% Some options of \xpackage{hyperref} are also implemented |
| 503 |
% in package \xpackage{bookmark}: |
| 504 |
% \begin{quote} |
| 505 |
% \begin{tabular}{@{}ll@{}} |
| 506 |
% \xpackage{hyperref} & \xpackage{bookmark}\\ |
| 507 |
% \hline |
| 508 |
% \xoption{bookmarksdepth} & \xoption{depth}\\ |
| 509 |
% \xoption{bookmarksopen} & \xoption{open}\\ |
| 510 |
% \xoption{bookmarksopenlevel} & \xoption{openlevel}\\ |
| 511 |
% \xoption{bookmarksnumbered} & \xoption{numbered}\\ |
| 512 |
% \end{tabular} |
| 513 |
% \end{quote} |
| 514 |
% |
| 515 |
% The following commands are also available: |
| 516 |
% \begin{function}{\pdfbookmark,\currentpdfbookmark,\subpdfbookmark,\belowpdfbookmark} |
| 517 |
% \begin{syntax} |
| 518 |
% \cs{pdfbookmark}\oarg{level}\Arg{text}\Arg{name}\\ |
| 519 |
% \cs{currentpdfbookmark}\Arg{text}\Arg{name}\\ |
| 520 |
% \cs{subpdfbookmark}\Arg{text}\Arg{name}\\ |
| 521 |
% \cs{belowpdfbookmark}\Arg{text}\Arg{name} |
| 522 |
% \end{syntax} |
| 523 |
% They are documented in the hyperref documentation. |
| 524 |
% \end{function} |
| 525 |
% |
| 526 |
% \subsection{Adding bookmarks at the end} |
| 527 |
% |
| 528 |
% Package option \xoption{atend} enables the following macro: |
| 529 |
% \begin{function}{\BookmarkAtEnd} |
| 530 |
% \begin{syntax} |
| 531 |
% \cs{BookmarkAtEnd}\Arg{stuff} |
| 532 |
% \end{syntax} |
| 533 |
% \end{function} |
| 534 |
% Macro \cs{BookmarkAtEnd} puts \meta{stuff} at the end |
| 535 |
% of the document. \meta{stuff} means bookmark commands. |
| 536 |
% Example: |
| 537 |
% \begin{quote} |
| 538 |
%\begin{verbatim} |
| 539 |
% \usepackage[atend]{bookmark} |
| 540 |
% \BookmarkAtEnd{% |
| 541 |
% \bookmarksetup{startatroot}% |
| 542 |
% \bookmark[named=LastPage, level=0]{Last page}% |
| 543 |
% } |
| 544 |
%\end{verbatim} |
| 545 |
% \end{quote} |
| 546 |
% |
| 547 |
% Alternatively, option \xoption{startatroot} can be given |
| 548 |
% in \cs{bookmark}: |
| 549 |
% \begin{quote} |
| 550 |
%\begin{verbatim} |
| 551 |
% \BookmarkAtEnd{% |
| 552 |
% \bookmark[ |
| 553 |
% startatroot, |
| 554 |
% named=LastPage, |
| 555 |
% level=0, |
| 556 |
% ]{Last page}% |
| 557 |
% } |
| 558 |
%\end{verbatim} |
| 559 |
% \end{quote} |
| 560 |
% |
| 561 |
% \paragraph{Remarks.} |
| 562 |
% \begin{itemize} |
| 563 |
% \item |
| 564 |
% \cs{BookmarkAtEnd} hides the fact that the method for |
| 565 |
% adding bookmarks at the end of the document depends |
| 566 |
% on the driver. |
| 567 |
% |
| 568 |
% The driver \xoption{pdftex} (used by \hologo{pdfLaTeX} and \hologo{LuaLaTeX} |
| 569 |
% uses the hook \hook{enddocument/afterlastpage} |
| 570 |
% |
| 571 |
% The implementation of the other drivers |
| 572 |
% (\xoption{dvipdfm}, \xoption{xetex}, \xoption{vtex}, \xoption{dvips}) |
| 573 |
% depends on |
| 574 |
% \cs{special} that does not have an effect after the last |
| 575 |
% page. In this case the hook \hook{shipout/lastpage} is used. |
| 576 |
% Two \hologo{LaTeX} runs are necessary at least, because |
| 577 |
% the last page is detected by a reference. |
| 578 |
% |
| 579 |
% \item |
| 580 |
% The time of expansion of the argument of \cs{BookmarkAtEnd} |
| 581 |
% is not specified. This can happen immediately or at the end |
| 582 |
% of the document. |
| 583 |
% \end{itemize} |
| 584 |
% |
| 585 |
% \subsection{Structure destinations} |
| 586 |
% If tagging is activated with |
| 587 |
% \begin{verbatim} |
| 588 |
% \DocumentMetadata{tagging=on} |
| 589 |
% \end{verbatim} |
| 590 |
% the outlines will also use structure destinations, these are destination |
| 591 |
% bound not to a page but to a structure. This works only with \hologo{pdfLaTeX}, \hologo{LuaLaTeX} and |
| 592 |
% \hologo{XeLaTeX}. |
| 593 |
% |
| 594 |
% |
| 595 |
% \subsection{Limitations/ToDos} |
| 596 |
% |
| 597 |
% \begin{itemize} |
| 598 |
% \item Support for missing actions (Launch, \dots). |
| 599 |
% \item Better design for \xpackage{hyperref}'s option |
| 600 |
% \xoption{bookmarkstype}. |
| 601 |
% \end{itemize} |
| 602 |
% |
| 603 |
% \section{Example} |
| 604 |
% |
| 605 |
% \begin{macrocode} |
| 606 |
%<*example> |
| 607 |
% \end{macrocode} |
| 608 |
% \begin{macrocode} |
| 609 |
\documentclass{article} |
| 610 |
\usepackage{xcolor}[2007/01/21] |
| 611 |
\usepackage{hyperref} |
| 612 |
\usepackage[ |
| 613 |
open, |
| 614 |
openlevel=2, |
| 615 |
atend |
| 616 |
]{bookmark}[2019/12/03] |
| 617 |
|
| 618 |
\bookmarksetup{color=blue} |
| 619 |
|
| 620 |
\BookmarkAtEnd{% |
| 621 |
\bookmarksetup{startatroot}% |
| 622 |
\bookmark[named=LastPage, level=0]{End/Last page}% |
| 623 |
\bookmark[named=FirstPage, level=1]{First page}% |
| 624 |
} |
| 625 |
|
| 626 |
\begin{document} |
| 627 |
\section{First section} |
| 628 |
\subsection{Subsection A} |
| 629 |
\begin{figure} |
| 630 |
\hypertarget{fig}{}% |
| 631 |
A figure. |
| 632 |
\end{figure} |
| 633 |
\bookmark[ |
| 634 |
rellevel=1, |
| 635 |
keeplevel, |
| 636 |
dest=fig |
| 637 |
]{A figure} |
| 638 |
\subsection{Subsection B} |
| 639 |
\subsubsection{Subsubsection C} |
| 640 |
\subsection{Umlauts: \"A\"O\"U\"a\"o\"u\ss} |
| 641 |
\newpage |
| 642 |
\bookmarksetup{ |
| 643 |
bold, |
| 644 |
color=[rgb]{1,0,0} |
| 645 |
} |
| 646 |
\section{Very important section} |
| 647 |
\bookmarksetup{ |
| 648 |
italic, |
| 649 |
bold=false, |
| 650 |
color=blue |
| 651 |
} |
| 652 |
\subsection{Italic section} |
| 653 |
\bookmarksetup{ |
| 654 |
italic=false |
| 655 |
} |
| 656 |
\part{Misc} |
| 657 |
\section{Diverse} |
| 658 |
\subsubsection{Subsubsection, omitting subsection} |
| 659 |
\bookmarksetup{ |
| 660 |
startatroot |
| 661 |
} |
| 662 |
\section{Last section outside part} |
| 663 |
\subsection{Subsection} |
| 664 |
\bookmarksetup{ |
| 665 |
color={} |
| 666 |
} |
| 667 |
\begingroup |
| 668 |
\bookmarksetup{level=0, color=green!80!black} |
| 669 |
\bookmark[named=FirstPage]{First page} |
| 670 |
\bookmark[named=LastPage]{Last page} |
| 671 |
\bookmark[named=PrevPage]{Previous page} |
| 672 |
\bookmark[named=NextPage]{Next page} |
| 673 |
\endgroup |
| 674 |
\bookmark[ |
| 675 |
page=2, |
| 676 |
view=FitH 800 |
| 677 |
]{Page 2, FitH 800} |
| 678 |
\bookmark[ |
| 679 |
page=2, |
| 680 |
view=FitBH \calc{\paperheight-\topmargin-1in-\headheight-\headsep} |
| 681 |
]{Page 2, FitBH top of text body} |
| 682 |
\bookmark[ |
| 683 |
uri={http://www.dante.de/}, |
| 684 |
color=magenta |
| 685 |
]{Dante homepage} |
| 686 |
\bookmark[ |
| 687 |
gotor={t.pdf}, |
| 688 |
page=1, |
| 689 |
view={XYZ 0 1000 null}, |
| 690 |
color=cyan!75!black |
| 691 |
]{File t.pdf} |
| 692 |
\bookmark[named=FirstPage]{First page} |
| 693 |
\bookmark[rellevel=1, named=LastPage]{Last page (rellevel=1)} |
| 694 |
\bookmark[named=PrevPage]{Previous page} |
| 695 |
\bookmark[level=0, named=FirstPage]{First page (level=0)} |
| 696 |
\bookmark[ |
| 697 |
rellevel=1, |
| 698 |
keeplevel, |
| 699 |
named=LastPage |
| 700 |
]{Last page (rellevel=1, keeplevel)} |
| 701 |
\bookmark[named=PrevPage]{Previous page} |
| 702 |
\end{document} |
| 703 |
% \end{macrocode} |
| 704 |
% \begin{macrocode} |
| 705 |
%</example> |
| 706 |
% \end{macrocode} |
| 707 |
% |
| 708 |
% \StopEventually{ |
| 709 |
% } |
| 710 |
% |
| 711 |
% \section{Implementation} |
| 712 |
% \DoNotIndex{% |
| 713 |
% \", |
| 714 |
% \(, |
| 715 |
% \), |
| 716 |
% \|, |
| 717 |
% \\, |
| 718 |
% \0, |
| 719 |
% \1, |
| 720 |
% \2, |
| 721 |
% \3, |
| 722 |
% \number |
| 723 |
% } |
| 724 |
% \subsection{Package} |
| 725 |
% |
| 726 |
% \begin{macrocode} |
| 727 |
%<*package> |
| 728 |
\NeedsTeXFormat{LaTeX2e} |
| 729 |
\ProvidesPackage{bookmark}% |
| 730 |
[2026-05-21 v1.32 PDF bookmarks (HO)]% |
| 731 |
% \end{macrocode} |
| 732 |
% |
| 733 |
% \subsubsection{Requirements} |
| 734 |
% |
| 735 |
% \paragraph{\hologo{eTeX}.} |
| 736 |
% |
| 737 |
% \begin{macro}[module=BKM]{\BKM@CalcExpr} |
| 738 |
% \begin{macrocode} |
| 739 |
\begingroup\expandafter\expandafter\expandafter\endgroup |
| 740 |
\expandafter\ifx\csname numexpr\endcsname\relax |
| 741 |
\def\BKM@CalcExpr#1#2#3#4{% |
| 742 |
\begingroup |
| 743 |
\count@=#2\relax |
| 744 |
\advance\count@ by#3#4\relax |
| 745 |
\edef\x{\endgroup |
| 746 |
\def\noexpand#1{\the\count@}% |
| 747 |
}% |
| 748 |
\x |
| 749 |
}% |
| 750 |
\else |
| 751 |
\def\BKM@CalcExpr#1#2#3#4{% |
| 752 |
\edef#1{% |
| 753 |
\the\numexpr#2#3#4\relax |
| 754 |
}% |
| 755 |
}% |
| 756 |
\fi |
| 757 |
% \end{macrocode} |
| 758 |
% \end{macro} |
| 759 |
% |
| 760 |
% \paragraph{Escape features of \hologo{pdfTeX}.} |
| 761 |
% |
| 762 |
% \begin{macro}[module=BKM]{\BKM@EscapeName} |
| 763 |
% \begin{macrocode} |
| 764 |
\def\BKM@EscapeName#1{% |
| 765 |
\ifx#1\@empty |
| 766 |
\else |
| 767 |
\EdefEscapeName#1#1% |
| 768 |
\fi |
| 769 |
}% |
| 770 |
% \end{macrocode} |
| 771 |
% \end{macro} |
| 772 |
% \begin{macro}[module=BKM]{\BKM@EscapeString} |
| 773 |
% \begin{macrocode} |
| 774 |
\def\BKM@EscapeString#1{% |
| 775 |
\ifx#1\@empty |
| 776 |
\else |
| 777 |
\EdefEscapeString#1#1% |
| 778 |
\fi |
| 779 |
}% |
| 780 |
% \end{macrocode} |
| 781 |
% \end{macro} |
| 782 |
% \begin{macro}[module=BKM]{\BKM@EscapeHex} |
| 783 |
% \begin{macrocode} |
| 784 |
\def\BKM@EscapeHex#1{% |
| 785 |
\ifx#1\@empty |
| 786 |
\else |
| 787 |
\EdefEscapeHex#1#1% |
| 788 |
\fi |
| 789 |
}% |
| 790 |
% \end{macrocode} |
| 791 |
% \end{macro} |
| 792 |
% \begin{macro}[module=BKM]{\BKM@UnescapeHex} |
| 793 |
% \begin{macrocode} |
| 794 |
\def\BKM@UnescapeHex#1{% |
| 795 |
\EdefUnescapeHex#1#1% |
| 796 |
}% |
| 797 |
% \end{macrocode} |
| 798 |
% \end{macro} |
| 799 |
% |
| 800 |
% \paragraph{Some helper commands} |
| 801 |
% Replaces some commands from ltxcmds: |
| 802 |
% |
| 803 |
% \begin{macro}[module=BKM]{\BKM@ReturnAfterFi} |
| 804 |
% \begin{macro}[module=BKM]{\BKM@space} |
| 805 |
% \begin{macro}[module=BKM]{\BKM@GlobalAppendToMacro} |
| 806 |
% \begin{macro}[module=BKM]{\BKM@LocalAppendToMacro} |
| 807 |
% \begin{macrocode} |
| 808 |
\ExplSyntaxOn |
| 809 |
\let\BKM@LocalAppendToMacro\tl_put_right:Nn |
| 810 |
\let\BKM@GlobalAppendToMacro\tl_gput_right:Nn |
| 811 |
\ExplSyntaxOff |
| 812 |
\def\BKM@space{ } |
| 813 |
\long\def\BKM@ReturnAfterFi#1\fi{\fi#1} |
| 814 |
% \end{macrocode} |
| 815 |
% \end{macro} |
| 816 |
% \end{macro} |
| 817 |
% \end{macro} |
| 818 |
% \end{macro} |
| 819 |
% |
| 820 |
% \paragraph{Packages.} |
| 821 |
% |
| 822 |
% Don't load packages loaded by \xpackage{hyperref} |
| 823 |
% \begin{macrocode} |
| 824 |
\RequirePackage{hyperref}[2010/06/18] |
| 825 |
% \end{macrocode} |
| 826 |
% |
| 827 |
% \subsubsection{Package options} |
| 828 |
% |
| 829 |
% \begin{macrocode} |
| 830 |
%\DeclareLocalOptions{% |
| 831 |
% atend,% |
| 832 |
% bold,% |
| 833 |
% color,% |
| 834 |
% depth,% |
| 835 |
% dest,% |
| 836 |
% draft,% |
| 837 |
% final,% |
| 838 |
% gotor,% |
| 839 |
% italic,% |
| 840 |
% keeplevel,% |
| 841 |
% level,% |
| 842 |
% named,% |
| 843 |
% numbered,% |
| 844 |
% open,% |
| 845 |
% openlevel,% |
| 846 |
% page,% |
| 847 |
% rawaction,% |
| 848 |
% rellevel,% |
| 849 |
% srcfile,% |
| 850 |
% srcline,% |
| 851 |
% startatroot,% |
| 852 |
% uri,% |
| 853 |
% view,% |
| 854 |
%} |
| 855 |
% \end{macrocode} |
| 856 |
% \begin{macro}{\bookmarksetup} |
| 857 |
% \begin{macrocode} |
| 858 |
\newcommand*{\bookmarksetup}{\SetKeys[BKM]} |
| 859 |
% \end{macrocode} |
| 860 |
% \end{macro} |
| 861 |
% \begin{macro}[module=BKM]{\BKM@setup} |
| 862 |
% \begin{macrocode} |
| 863 |
\def\BKM@setup#1{% |
| 864 |
\bookmarksetup{#1}% |
| 865 |
\ifx\BKM@HookNext\@empty |
| 866 |
\else |
| 867 |
\expandafter\bookmarksetup\expandafter{\BKM@HookNext}% |
| 868 |
\BKM@HookNextClear |
| 869 |
\fi |
| 870 |
\BKM@hook |
| 871 |
\ifBKM@keeplevel |
| 872 |
\else |
| 873 |
\xdef\BKM@currentlevel{\BKM@level}% |
| 874 |
\fi |
| 875 |
} |
| 876 |
% \end{macrocode} |
| 877 |
% \end{macro} |
| 878 |
% |
| 879 |
% \begin{macro}{\bookmarksetupnext} |
| 880 |
% \begin{macrocode} |
| 881 |
\newcommand*{\bookmarksetupnext}[1]{% |
| 882 |
\BKM@GlobalAppendToMacro\BKM@HookNext{,#1}% |
| 883 |
} |
| 884 |
% \end{macrocode} |
| 885 |
% \end{macro} |
| 886 |
% \begin{macro}[module=BKM]{\BKM@HookNextClear} |
| 887 |
% \begin{macrocode} |
| 888 |
\def\BKM@HookNextClear{% |
| 889 |
\global\let\BKM@HookNext\@empty |
| 890 |
} |
| 891 |
% \end{macrocode} |
| 892 |
% \end{macro} |
| 893 |
% \begin{macro}[module=BKM]{\BKM@HookNext} |
| 894 |
% \begin{macrocode} |
| 895 |
\BKM@HookNextClear |
| 896 |
% \end{macrocode} |
| 897 |
% \end{macro} |
| 898 |
% |
| 899 |
% \begin{keydecl}{draft,final} |
| 900 |
% \begin{macrocode} |
| 901 |
\DeclareKeys[BKM] |
| 902 |
{ |
| 903 |
,draft.legacy_if_set:n = BKM@draft |
| 904 |
,final.legacy_if_set_inverse:n = BKM@draft |
| 905 |
,draft.usage:n = load |
| 906 |
,final.usage:n = load |
| 907 |
} |
| 908 |
% \end{macrocode} |
| 909 |
% \end{keydecl} |
| 910 |
% |
| 911 |
% \begin{keydecl}{open} |
| 912 |
% \begin{macrocode} |
| 913 |
\DeclareKeys[BKM] |
| 914 |
{ |
| 915 |
,open.legacy_if_set:n = BKM@open |
| 916 |
,open.initial:e = \ifHy@bookmarksopen true\else false\fi |
| 917 |
} |
| 918 |
% \end{macrocode} |
| 919 |
% \end{keydecl} |
| 920 |
% \begin{macro}[module=BKM]{\bookmark@open} |
| 921 |
% \begin{macrocode} |
| 922 |
\def\bookmark@open{% |
| 923 |
\ifBKM@open\@ne\else\z@\fi |
| 924 |
} |
| 925 |
% \end{macrocode} |
| 926 |
% \end{macro} |
| 927 |
% \begin{keydecl}{openlevel} |
| 928 |
% \begin{macrocode} |
| 929 |
\DeclareKeys[BKM] |
| 930 |
{ |
| 931 |
,openlevel.tl_set:N = \BKM@openlevel |
| 932 |
,openlevel.initial:e = \number\@bookmarksopenlevel |
| 933 |
} |
| 934 |
% \end{macrocode} |
| 935 |
% \end{keydecl} |
| 936 |
% |
| 937 |
|
| 938 |
% \begin{macro}[module=BKM]{\BKM@depth} |
| 939 |
% \begin{macrocode} |
| 940 |
\@ifundefined{Hy@bookmarksdepth}{% |
| 941 |
\def\BKM@depth{\c@tocdepth}% |
| 942 |
}{% |
| 943 |
\let\BKM@depth\Hy@bookmarksdepth |
| 944 |
} |
| 945 |
% \end{macrocode} |
| 946 |
% \end{macro} |
| 947 |
% |
| 948 |
% \begin{keydecl}{depth} |
| 949 |
% \begin{macrocode} |
| 950 |
\DeclareKeys[BKM] |
| 951 |
{ |
| 952 |
,depth.code:n = |
| 953 |
{% |
| 954 |
\edef\BKM@param{#1}% |
| 955 |
\ifx\BKM@param\@empty |
| 956 |
\def\BKM@depth{\c@tocdepth}% |
| 957 |
\else |
| 958 |
\@ifundefined{toclevel@\BKM@param}{% |
| 959 |
\@onelevel@sanitize\BKM@param |
| 960 |
\edef\BKM@temp{\expandafter\@car\BKM@param\@nil}% |
| 961 |
\ifcase 0\expandafter\ifx\BKM@temp-1\fi |
| 962 |
\expandafter\ifnum\expandafter`\BKM@temp>47 % |
| 963 |
\expandafter\ifnum\expandafter`\BKM@temp<58 % |
| 964 |
1% |
| 965 |
\fi |
| 966 |
\fi |
| 967 |
\relax |
| 968 |
\PackageWarning{bookmark}{% |
| 969 |
Unknown document division name (\BKM@param)\MessageBreak |
| 970 |
for option `depth'% |
| 971 |
}% |
| 972 |
\else |
| 973 |
\BKM@SetDepthOrLevel\BKM@depth\BKM@param |
| 974 |
\fi |
| 975 |
}{% |
| 976 |
\BKM@SetDepthOrLevel\BKM@depth{% |
| 977 |
\csname toclevel@\BKM@param\endcsname |
| 978 |
}% |
| 979 |
}% |
| 980 |
\fi |
| 981 |
} |
| 982 |
} |
| 983 |
% \end{macrocode} |
| 984 |
% \end{keydecl} |
| 985 |
% \begin{macro}[module=BKM]{\bookmark@depth} |
| 986 |
% \begin{macrocode} |
| 987 |
\def\bookmark@depth{\BKM@depth} |
| 988 |
% \end{macrocode} |
| 989 |
% \end{macro} |
| 990 |
% |
| 991 |
% \begin{macro}[module=BKM]{\BKM@SetDepthOrLevel} |
| 992 |
% \begin{macrocode} |
| 993 |
\def\BKM@SetDepthOrLevel#1#2{% |
| 994 |
\begingroup |
| 995 |
\setbox\z@=\hbox{% |
| 996 |
\count@=#2\relax |
| 997 |
\expandafter |
| 998 |
}% |
| 999 |
\expandafter\endgroup |
| 1000 |
\expandafter\def\expandafter#1\expandafter{\the\count@}% |
| 1001 |
} |
| 1002 |
% \end{macrocode} |
| 1003 |
% \end{macro} |
| 1004 |
% |
| 1005 |
% \begin{macro}[module=BKM]{\BKM@set@level} |
| 1006 |
% \begin{macrocode} |
| 1007 |
\newcommand\BKM@set@level[1]{% |
| 1008 |
\edef\BKM@param{#1}% |
| 1009 |
\ifx\BKM@param\BKM@MacroCurrentLevel |
| 1010 |
\let\BKM@level\BKM@param |
| 1011 |
\else |
| 1012 |
\@ifundefined{toclevel@\BKM@param}{% |
| 1013 |
\@onelevel@sanitize\BKM@param |
| 1014 |
\edef\BKM@temp{\expandafter\@car\BKM@param\@nil}% |
| 1015 |
\ifcase 0\expandafter\ifx\BKM@temp-1\fi |
| 1016 |
\expandafter\ifnum\expandafter`\BKM@temp>47 % |
| 1017 |
\expandafter\ifnum\expandafter`\BKM@temp<58 % |
| 1018 |
1% |
| 1019 |
\fi |
| 1020 |
\fi |
| 1021 |
\relax |
| 1022 |
\PackageWarning{bookmark}{% |
| 1023 |
Unknown document division name (\BKM@param)\MessageBreak |
| 1024 |
for option `level'% |
| 1025 |
}% |
| 1026 |
\else |
| 1027 |
\BKM@SetDepthOrLevel\BKM@level\BKM@param |
| 1028 |
\fi |
| 1029 |
}{% |
| 1030 |
\BKM@SetDepthOrLevel\BKM@level{% |
| 1031 |
\csname toclevel@\BKM@param\endcsname |
| 1032 |
}% |
| 1033 |
}% |
| 1034 |
\fi |
| 1035 |
} |
| 1036 |
% \end{macrocode} |
| 1037 |
% \end{macro} |
| 1038 |
% |
| 1039 |
% \begin{macro}[module=BKM]{\BKM@level} |
| 1040 |
% \begin{macrocode} |
| 1041 |
\def\BKM@level{\BKM@currentlevel} |
| 1042 |
% \end{macrocode} |
| 1043 |
% \end{macro} |
| 1044 |
% \begin{keydecl}{level} |
| 1045 |
% \begin{macrocode} |
| 1046 |
\DeclareKeys[BKM] |
| 1047 |
{ |
| 1048 |
,level.code:n = \BKM@set@level{#1} |
| 1049 |
,level.default:n = \BKM@currentlevel |
| 1050 |
} |
| 1051 |
% \end{macrocode} |
| 1052 |
% \end{keydecl} |
| 1053 |
% \begin{macro}[module=BKM]{\BKM@MacroCurrentLevel} |
| 1054 |
% \begin{macrocode} |
| 1055 |
\def\BKM@MacroCurrentLevel{\BKM@currentlevel} |
| 1056 |
% \end{macrocode} |
| 1057 |
% \end{macro} |
| 1058 |
% \begin{keydecl}{keeplevel,startatroot} |
| 1059 |
% \begin{macrocode} |
| 1060 |
\DeclareKeys[BKM] |
| 1061 |
{ |
| 1062 |
,keeplevel.legacy_if_set:n = BKM@keeplevel |
| 1063 |
,startatroot.legacy_if_set:n = BKM@startatroot |
| 1064 |
} |
| 1065 |
% \end{macrocode} |
| 1066 |
% \end{keydecl} |
| 1067 |
% \begin{macro}[module=BKM]{\BKM@startatrootfalse} |
| 1068 |
% \begin{macrocode} |
| 1069 |
\def\BKM@startatrootfalse{% |
| 1070 |
\global\let\ifBKM@startatroot\iffalse |
| 1071 |
} |
| 1072 |
% \end{macrocode} |
| 1073 |
% \end{macro} |
| 1074 |
% |
| 1075 |
% \begin{macro}[module=BKM]{\BKM@startatroottrue} |
| 1076 |
% \begin{macrocode} |
| 1077 |
\def\BKM@startatroottrue{% |
| 1078 |
\global\let\ifBKM@startatroot\iftrue |
| 1079 |
} |
| 1080 |
% \end{macrocode} |
| 1081 |
% \end{macro} |
| 1082 |
% \begin{keydecl}{rellevel} |
| 1083 |
% \begin{macrocode} |
| 1084 |
\DeclareKeys[BKM] |
| 1085 |
{ |
| 1086 |
,rellevel.code:n = {\BKM@CalcExpr\BKM@level{#1}+\BKM@currentlevel} |
| 1087 |
} |
| 1088 |
% \end{macrocode} |
| 1089 |
% \end{keydecl} |
| 1090 |
% \begin{macro}[module=BKM]{\bookmark@level} |
| 1091 |
% \begin{macrocode} |
| 1092 |
\def\bookmark@level{\BKM@level} |
| 1093 |
% \end{macrocode} |
| 1094 |
% \end{macro} |
| 1095 |
% \begin{macro}[module=BKM]{\BKM@currentlevel} |
| 1096 |
% \begin{macrocode} |
| 1097 |
\def\BKM@currentlevel{0} |
| 1098 |
% \end{macrocode} |
| 1099 |
% \end{macro} |
| 1100 |
% \begin{keydecl}{numbered} |
| 1101 |
% Make \xpackage{bookmark}'s option \xoption{numbered} an alias |
| 1102 |
% for \xpackage{hyperref}'s \xoption{bookmarksnumbered}. |
| 1103 |
% \begin{macrocode} |
| 1104 |
\DeclareKeys[BKM] |
| 1105 |
{ |
| 1106 |
,numbered.legacy_if_set:n = BKM@numbered |
| 1107 |
,numbered.initial:e = \ifHy@bookmarksnumbered true\else false\fi |
| 1108 |
} |
| 1109 |
\g@addto@macro\BKM@numberedtrue{% |
| 1110 |
\let\ifHy@bookmarksnumbered\iftrue |
| 1111 |
} |
| 1112 |
\g@addto@macro\BKM@numberedfalse{% |
| 1113 |
\let\ifHy@bookmarksnumbered\iffalse |
| 1114 |
} |
| 1115 |
\g@addto@macro\Hy@bookmarksnumberedtrue{% |
| 1116 |
\let\ifBKM@numbered\iftrue |
| 1117 |
} |
| 1118 |
\g@addto@macro\Hy@bookmarksnumberedfalse{% |
| 1119 |
\let\ifBKM@numbered\iffalse |
| 1120 |
} |
| 1121 |
% \end{macrocode} |
| 1122 |
% \end{keydecl} |
| 1123 |
% |
| 1124 |
% \begin{macro}[module=BKM]{\bookmark@numbered} |
| 1125 |
% \begin{macrocode} |
| 1126 |
\def\bookmark@numbered{% |
| 1127 |
\ifBKM@numbered\@ne\else\z@\fi |
| 1128 |
} |
| 1129 |
% \end{macrocode} |
| 1130 |
% \end{macro} |
| 1131 |
% |
| 1132 |
% \paragraph{Redefinitions \xpackage{hyperref}'s options} |
| 1133 |
% |
| 1134 |
% \begin{macro}[module=BKM]{\BKM@PatchHyperrefOption} |
| 1135 |
% \begin{macrocode} |
| 1136 |
\def\BKM@PatchHyperrefOption#1{% |
| 1137 |
\expandafter\BKM@@PatchHyperrefOption\csname KV@Hyp@#1\endcsname% |
| 1138 |
} |
| 1139 |
% \end{macrocode} |
| 1140 |
% \end{macro} |
| 1141 |
% \begin{macro}[module=BKM]{\BKM@@PatchHyperrefOption} |
| 1142 |
% \begin{macrocode} |
| 1143 |
\def\BKM@@PatchHyperrefOption#1{% |
| 1144 |
\expandafter\BKM@@@PatchHyperrefOption#1{##1}\BKM@nil#1% |
| 1145 |
} |
| 1146 |
% \end{macrocode} |
| 1147 |
% \end{macro} |
| 1148 |
% \begin{macro}[module=BKM]{\BKM@@@PatchHyperrefOption} |
| 1149 |
% \begin{macrocode} |
| 1150 |
\def\BKM@@@PatchHyperrefOption#1\BKM@nil#2#3{% |
| 1151 |
\def#2##1{% |
| 1152 |
#1% |
| 1153 |
\bookmarksetup{#3={##1}}% |
| 1154 |
}% |
| 1155 |
} |
| 1156 |
% \end{macrocode} |
| 1157 |
% \end{macro} |
| 1158 |
% \begin{macrocode} |
| 1159 |
\BKM@PatchHyperrefOption{bookmarksopen}{open} |
| 1160 |
\BKM@PatchHyperrefOption{bookmarksopenlevel}{openlevel} |
| 1161 |
\BKM@PatchHyperrefOption{bookmarksdepth}{depth} |
| 1162 |
% \end{macrocode} |
| 1163 |
% |
| 1164 |
% \paragraph{Font style options.} |
| 1165 |
% |
| 1166 |
% Caution: Package \xpackage{bitset} is zero-based, the |
| 1167 |
% PDF specifications starts with one. |
| 1168 |
% \begin{keydecl}{italic,bold} |
| 1169 |
% \begin{macrocode} |
| 1170 |
\bitsetReset{BKM@FontStyle}% |
| 1171 |
\DeclareKeys[BKM] |
| 1172 |
{ |
| 1173 |
,italic.code:n = |
| 1174 |
{ |
| 1175 |
\expandafter\ifx\csname if#1\endcsname\iftrue |
| 1176 |
\bitsetSet{BKM@FontStyle}{0}% |
| 1177 |
\else |
| 1178 |
\bitsetClear{BKM@FontStyle}{0}% |
| 1179 |
\fi |
| 1180 |
} |
| 1181 |
,italic.default:n = true |
| 1182 |
,bold.code:n = |
| 1183 |
{ |
| 1184 |
\expandafter\ifx\csname if#1\endcsname\iftrue |
| 1185 |
\bitsetSet{BKM@FontStyle}{1}% |
| 1186 |
\else |
| 1187 |
\bitsetClear{BKM@FontStyle}{1}% |
| 1188 |
\fi |
| 1189 |
} |
| 1190 |
,bold.default:n = true |
| 1191 |
} |
| 1192 |
% \end{macrocode} |
| 1193 |
% \end{keydecl} |
| 1194 |
% \begin{macro}[module=BKM]{\bookmark@italic} |
| 1195 |
% \begin{macrocode} |
| 1196 |
\def\bookmark@italic{% |
| 1197 |
\ifnum\bitsetGet{BKM@FontStyle}{0}=1 \@ne\else\z@\fi |
| 1198 |
} |
| 1199 |
% \end{macrocode} |
| 1200 |
% \end{macro} |
| 1201 |
% \begin{macro}[module=BKM]{\bookmark@bold} |
| 1202 |
% \begin{macrocode} |
| 1203 |
\def\bookmark@bold{% |
| 1204 |
\ifnum\bitsetGet{BKM@FontStyle}{1}=1 \@ne\else\z@\fi |
| 1205 |
} |
| 1206 |
% \end{macrocode} |
| 1207 |
% \end{macro} |
| 1208 |
% \begin{macro}[module=BKM]{\BKM@PrintStyle} |
| 1209 |
% \begin{macrocode} |
| 1210 |
\def\BKM@PrintStyle{% |
| 1211 |
\bitsetGetDec{BKM@FontStyle}% |
| 1212 |
}% |
| 1213 |
% \end{macrocode} |
| 1214 |
% \end{macro} |
| 1215 |
% |
| 1216 |
% \paragraph{Options for color.} |
| 1217 |
% |
| 1218 |
% If the PDF management is loaded we make use of l3color commands for color expressions, |
| 1219 |
% without it they only work if \xpackage{xcolor} has been loaded. |
| 1220 |
% |
| 1221 |
% \begin{macro}[module=BKM]{\__BKM_color_set:nn,\__BKM_color_set_aux:nwn} |
| 1222 |
% Color keys need to parse color expressions. Two input types are supported: |
| 1223 |
% |color=[rgb]{1,0,.5}| and |color=red!50!blue|. |
| 1224 |
% \begin{macrocode} |
| 1225 |
\ExplSyntaxOn |
| 1226 |
\cs_new_protected:Npn \__BKM_color_set:nn #1 #2 |
| 1227 |
{ |
| 1228 |
\tl_if_head_eq_charcode:nNTF {#2}[ %] |
| 1229 |
{ |
| 1230 |
\__BKM_color_set_aux:nwn { #1 } #2 |
| 1231 |
} |
| 1232 |
{ |
| 1233 |
\color_set:nn {#1} {#2} |
| 1234 |
} |
| 1235 |
} |
| 1236 |
|
| 1237 |
\cs_new_protected:Npn \__BKM_color_set_aux:nwn #1 [#2] #3 |
| 1238 |
{ |
| 1239 |
\color_set:nnn {#1}{#2}{#3} |
| 1240 |
} |
| 1241 |
|
| 1242 |
\cs_generate_variant:Nn \__BKM_color_set:nn {ne} |
| 1243 |
\str_new:N\g__BKM_colormodel_str |
| 1244 |
% \end{macrocode} |
| 1245 |
% \end{macro} |
| 1246 |
%\begin{keydecl}{colormodel} |
| 1247 |
% \begin{macrocode} |
| 1248 |
\keys_define:nn { BKM } |
| 1249 |
{ |
| 1250 |
,colormodel .choices:nn = |
| 1251 |
{rgb,cmyk} |
| 1252 |
{ \str_gset:Nn \g__BKM_colormodel_str {space-sep-#1}} |
| 1253 |
,colormodel .initial:n ={rgb} |
| 1254 |
} |
| 1255 |
% \end{macrocode} |
| 1256 |
% \end{keydecl} |
| 1257 |
% If the PDF management is active, we use the l3color export function. |
| 1258 |
% \begin{keydecl}{color} |
| 1259 |
% \begin{macrocode} |
| 1260 |
\IfPDFManagementActiveTF |
| 1261 |
{ |
| 1262 |
\DeclareKeys[BKM] |
| 1263 |
{ |
| 1264 |
,color.code:n = |
| 1265 |
{ |
| 1266 |
\tl_if_blank:nTF {#1} |
| 1267 |
{ \cs_set_eq:NN\BKM@color\@empty } |
| 1268 |
{ |
| 1269 |
\__BKM_color_set:ne {__BKM/tmpa}{#1} |
| 1270 |
\color_export:nVN |
| 1271 |
{__BKM/tmpa} |
| 1272 |
\g__BKM_colormodel_str |
| 1273 |
\BKM@color |
| 1274 |
} |
| 1275 |
} |
| 1276 |
} |
| 1277 |
} |
| 1278 |
{ |
| 1279 |
\DeclareKeys[BKM] |
| 1280 |
{ |
| 1281 |
,color.code:n = |
| 1282 |
{\HyColor@BookmarkColor{#1}\BKM@color{bookmark}{color}} |
| 1283 |
} |
| 1284 |
} |
| 1285 |
\ExplSyntaxOff |
| 1286 |
% \end{macrocode} |
| 1287 |
% \end{keydecl} |
| 1288 |
% |
| 1289 |
% \begin{macro}[module=BKM]{\BKM@color} |
| 1290 |
% \begin{macrocode} |
| 1291 |
\let\BKM@color\@empty |
| 1292 |
% \end{macrocode} |
| 1293 |
% \end{macro} |
| 1294 |
% \begin{macro}[module=BKM]{\bookmark@color} |
| 1295 |
% \begin{macrocode} |
| 1296 |
\def\bookmark@color{\BKM@color} |
| 1297 |
% \end{macrocode} |
| 1298 |
% \end{macro} |
| 1299 |
% |
| 1300 |
% \subsubsection{Action options} |
| 1301 |
% |
| 1302 |
% \begin{keydecl}{dest,named,uri,gotor,rawaction} |
| 1303 |
% \begin{macrocode} |
| 1304 |
\ExplSyntaxOn |
| 1305 |
\def\BKM@temp#1{% |
| 1306 |
\DeclareKeys[BKM]{#1.tl_set:c = BKM@#1}% |
| 1307 |
\expandafter\edef\csname bookmark@#1\endcsname{% |
| 1308 |
\expandafter\noexpand\csname BKM@#1\endcsname |
| 1309 |
}% |
| 1310 |
} |
| 1311 |
\ExplSyntaxOff |
| 1312 |
% \end{macrocode} |
| 1313 |
% \begin{macro}[module=BKM]{\bookmark@dest} |
| 1314 |
% \begin{macrocode} |
| 1315 |
\BKM@temp{dest} |
| 1316 |
% \end{macrocode} |
| 1317 |
% \end{macro} |
| 1318 |
% \begin{macro}[module=BKM]{\bookmark@named} |
| 1319 |
% \begin{macrocode} |
| 1320 |
\BKM@temp{named} |
| 1321 |
% \end{macrocode} |
| 1322 |
% \end{macro} |
| 1323 |
% \begin{macro}[module=BKM]{\bookmark@uri} |
| 1324 |
% \begin{macrocode} |
| 1325 |
\BKM@temp{uri} |
| 1326 |
% \end{macrocode} |
| 1327 |
% \end{macro} |
| 1328 |
% \begin{macro}[module=BKM]{\bookmark@gotor} |
| 1329 |
% \begin{macrocode} |
| 1330 |
\BKM@temp{gotor} |
| 1331 |
% \end{macrocode} |
| 1332 |
% \end{macro} |
| 1333 |
% \begin{macro}[module=BKM]{\bookmark@rawaction} |
| 1334 |
% \begin{macrocode} |
| 1335 |
\BKM@temp{rawaction} |
| 1336 |
% \end{macrocode} |
| 1337 |
% \end{macro} |
| 1338 |
% \end{keydecl} |
| 1339 |
% \begin{keydecl}{page} |
| 1340 |
% \begin{macrocode} |
| 1341 |
\DeclareKeys[BKM] |
| 1342 |
{ |
| 1343 |
,page.code:n = |
| 1344 |
{% |
| 1345 |
\def\BKM@page{#1}% |
| 1346 |
\ifx\BKM@page\@empty |
| 1347 |
\else |
| 1348 |
\edef\BKM@page{\number\BKM@page}% |
| 1349 |
\ifnum\BKM@page>\z@ |
| 1350 |
\else |
| 1351 |
\PackageError{bookmark}{Page must be positive}\@ehc |
| 1352 |
\def\BKM@page{1}% |
| 1353 |
\fi |
| 1354 |
\fi |
| 1355 |
} |
| 1356 |
} |
| 1357 |
% \end{macrocode} |
| 1358 |
% \end{keydecl} |
| 1359 |
% \begin{macro}[module=BKM]{\BKM@page} |
| 1360 |
% \begin{macrocode} |
| 1361 |
\let\BKM@page\@empty |
| 1362 |
% \end{macrocode} |
| 1363 |
% \end{macro} |
| 1364 |
% \begin{macro}[module=BKM]{\bookmark@page} |
| 1365 |
% \begin{macrocode} |
| 1366 |
\def\bookmark@page{\BKM@@page} |
| 1367 |
% \end{macrocode} |
| 1368 |
% \end{macro} |
| 1369 |
% \begin{keydecl}{view} |
| 1370 |
% \begin{macrocode} |
| 1371 |
\DeclareKeys[BKM] |
| 1372 |
{ |
| 1373 |
,view.code:n = {\BKM@CheckView{#1}} |
| 1374 |
} |
| 1375 |
% \end{macrocode} |
| 1376 |
% \end{keydecl} |
| 1377 |
% \begin{macro}[module=BKM]{\BKM@view} |
| 1378 |
% \begin{macrocode} |
| 1379 |
\let\BKM@view\@empty |
| 1380 |
% \end{macrocode} |
| 1381 |
% \end{macro} |
| 1382 |
% \begin{macro}[module=BKM]{\bookmark@view} |
| 1383 |
% \begin{macrocode} |
| 1384 |
\def\bookmark@view{\BKM@view} |
| 1385 |
% \end{macrocode} |
| 1386 |
% \end{macro} |
| 1387 |
% \begin{macro}[module=BKM]{\BKM@CheckView} |
| 1388 |
% \begin{macrocode} |
| 1389 |
\def\BKM@CheckView#1{% |
| 1390 |
\BKM@CheckViewType#1 \@nil |
| 1391 |
} |
| 1392 |
% \end{macrocode} |
| 1393 |
% \end{macro} |
| 1394 |
% \begin{macro}[module=BKM]{\BKM@CheckViewType} |
| 1395 |
% \begin{macrocode} |
| 1396 |
\def\BKM@CheckViewType#1 #2\@nil{% |
| 1397 |
\def\BKM@type{#1}% |
| 1398 |
\@onelevel@sanitize\BKM@type |
| 1399 |
\BKM@TestViewType{Fit}{}% |
| 1400 |
\BKM@TestViewType{FitB}{}% |
| 1401 |
\BKM@TestViewType{FitH}{% |
| 1402 |
\BKM@CheckParam#2 \@nil{top}% |
| 1403 |
}% |
| 1404 |
\BKM@TestViewType{FitBH}{% |
| 1405 |
\BKM@CheckParam#2 \@nil{top}% |
| 1406 |
}% |
| 1407 |
\BKM@TestViewType{FitV}{% |
| 1408 |
\BKM@CheckParam#2 \@nil{bottom}% |
| 1409 |
}% |
| 1410 |
\BKM@TestViewType{FitBV}{% |
| 1411 |
\BKM@CheckParam#2 \@nil{bottom}% |
| 1412 |
}% |
| 1413 |
\BKM@TestViewType{FitR}{% |
| 1414 |
\BKM@CheckRect{#2}{ }% |
| 1415 |
}% |
| 1416 |
\BKM@TestViewType{XYZ}{% |
| 1417 |
\BKM@CheckXYZ{#2}{ }% |
| 1418 |
}% |
| 1419 |
\@car{% |
| 1420 |
\PackageError{bookmark}{% |
| 1421 |
Unknown view type `\BKM@type',\MessageBreak |
| 1422 |
using `FitH' instead% |
| 1423 |
}\@ehc |
| 1424 |
\def\BKM@view{FitH}% |
| 1425 |
}% |
| 1426 |
\@nil |
| 1427 |
} |
| 1428 |
% \end{macrocode} |
| 1429 |
% \end{macro} |
| 1430 |
% \begin{macro}[module=BKM]{\BKM@TestViewType} |
| 1431 |
% \begin{macrocode} |
| 1432 |
\def\BKM@TestViewType#1{% |
| 1433 |
\def\BKM@temp{#1}% |
| 1434 |
\@onelevel@sanitize\BKM@temp |
| 1435 |
\ifx\BKM@type\BKM@temp |
| 1436 |
\let\BKM@view\BKM@temp |
| 1437 |
\expandafter\@car |
| 1438 |
\else |
| 1439 |
\expandafter\@gobble |
| 1440 |
\fi |
| 1441 |
} |
| 1442 |
% \end{macrocode} |
| 1443 |
% \end{macro} |
| 1444 |
% \begin{macro}[module=BKM]{\BKM@CheckParam} |
| 1445 |
% \begin{macrocode} |
| 1446 |
\def\BKM@CheckParam#1 #2\@nil#3{% |
| 1447 |
\def\BKM@param{#1}% |
| 1448 |
\ifx\BKM@param\@empty |
| 1449 |
\PackageWarning{bookmark}{% |
| 1450 |
Missing parameter (#3) for `\BKM@type',\MessageBreak |
| 1451 |
using 0% |
| 1452 |
}% |
| 1453 |
\def\BKM@param{0}% |
| 1454 |
\else |
| 1455 |
\BKM@CalcParam |
| 1456 |
\fi |
| 1457 |
\edef\BKM@view{\BKM@view\space\BKM@param}% |
| 1458 |
} |
| 1459 |
% \end{macrocode} |
| 1460 |
% \end{macro} |
| 1461 |
% \begin{macro}[module=BKM]{\BKM@CheckRect} |
| 1462 |
% \begin{macrocode} |
| 1463 |
\def\BKM@CheckRect#1#2{% |
| 1464 |
\BKM@@CheckRect#1#2#2#2#2\@nil |
| 1465 |
} |
| 1466 |
% \end{macrocode} |
| 1467 |
% \end{macro} |
| 1468 |
% \begin{macro}[module=BKM]{\BKM@@CheckRect} |
| 1469 |
% \begin{macrocode} |
| 1470 |
\def\BKM@@CheckRect#1 #2 #3 #4 #5\@nil{% |
| 1471 |
\def\BKM@temp{0}% |
| 1472 |
\def\BKM@param{#1}% |
| 1473 |
\ifx\BKM@param\@empty |
| 1474 |
\def\BKM@param{0}% |
| 1475 |
\def\BKM@temp{1}% |
| 1476 |
\else |
| 1477 |
\BKM@CalcParam |
| 1478 |
\fi |
| 1479 |
\edef\BKM@view{\BKM@view\space\BKM@param}% |
| 1480 |
\def\BKM@param{#2}% |
| 1481 |
\ifx\BKM@param\@empty |
| 1482 |
\def\BKM@param{0}% |
| 1483 |
\def\BKM@temp{1}% |
| 1484 |
\else |
| 1485 |
\BKM@CalcParam |
| 1486 |
\fi |
| 1487 |
\edef\BKM@view{\BKM@view\space\BKM@param}% |
| 1488 |
\def\BKM@param{#3}% |
| 1489 |
\ifx\BKM@param\@empty |
| 1490 |
\def\BKM@param{0}% |
| 1491 |
\def\BKM@temp{1}% |
| 1492 |
\else |
| 1493 |
\BKM@CalcParam |
| 1494 |
\fi |
| 1495 |
\edef\BKM@view{\BKM@view\space\BKM@param}% |
| 1496 |
\def\BKM@param{#4}% |
| 1497 |
\ifx\BKM@param\@empty |
| 1498 |
\def\BKM@param{0}% |
| 1499 |
\def\BKM@temp{1}% |
| 1500 |
\else |
| 1501 |
\BKM@CalcParam |
| 1502 |
\fi |
| 1503 |
\edef\BKM@view{\BKM@view\space\BKM@param}% |
| 1504 |
\ifnum\BKM@temp>\z@ |
| 1505 |
\PackageWarning{bookmark}{Missing parameters for `\BKM@type'}% |
| 1506 |
\fi |
| 1507 |
} |
| 1508 |
% \end{macrocode} |
| 1509 |
% \end{macro} |
| 1510 |
% \begin{macro}[module=BKM]{\BKM@CheckXYZ} |
| 1511 |
% \begin{macrocode} |
| 1512 |
\def\BKM@CheckXYZ#1#2{% |
| 1513 |
\BKM@@CheckXYZ#1#2#2#2\@nil |
| 1514 |
} |
| 1515 |
% \end{macrocode} |
| 1516 |
% \end{macro} |
| 1517 |
% \begin{macro}[module=BKM]{\BKM@@CheckXYZ} |
| 1518 |
% \begin{macrocode} |
| 1519 |
\def\BKM@@CheckXYZ#1 #2 #3 #4\@nil{% |
| 1520 |
\def\BKM@param{#1}% |
| 1521 |
\let\BKM@temp\BKM@param |
| 1522 |
\@onelevel@sanitize\BKM@temp |
| 1523 |
\ifx\BKM@param\@empty |
| 1524 |
\let\BKM@param\BKM@null |
| 1525 |
\else |
| 1526 |
\ifx\BKM@temp\BKM@null |
| 1527 |
\else |
| 1528 |
\BKM@CalcParam |
| 1529 |
\fi |
| 1530 |
\fi |
| 1531 |
\edef\BKM@view{\BKM@view\space\BKM@param}% |
| 1532 |
\def\BKM@param{#2}% |
| 1533 |
\let\BKM@temp\BKM@param |
| 1534 |
\@onelevel@sanitize\BKM@temp |
| 1535 |
\ifx\BKM@param\@empty |
| 1536 |
\let\BKM@param\BKM@null |
| 1537 |
\else |
| 1538 |
\ifx\BKM@temp\BKM@null |
| 1539 |
\else |
| 1540 |
\BKM@CalcParam |
| 1541 |
\fi |
| 1542 |
\fi |
| 1543 |
\edef\BKM@view{\BKM@view\space\BKM@param}% |
| 1544 |
\def\BKM@param{#3}% |
| 1545 |
\ifx\BKM@param\@empty |
| 1546 |
\let\BKM@param\BKM@null |
| 1547 |
\fi |
| 1548 |
\edef\BKM@view{\BKM@view\space\BKM@param}% |
| 1549 |
} |
| 1550 |
% \end{macrocode} |
| 1551 |
% \end{macro} |
| 1552 |
% \begin{macro}[module=BKM]{\BKM@null} |
| 1553 |
% \begin{macrocode} |
| 1554 |
\def\BKM@null{null} |
| 1555 |
\@onelevel@sanitize\BKM@null |
| 1556 |
% \end{macrocode} |
| 1557 |
% \end{macro} |
| 1558 |
% |
| 1559 |
% \begin{macro}[module=BKM]{\BKM@CalcParam} |
| 1560 |
% \begin{macrocode} |
| 1561 |
\def\BKM@CalcParam{% |
| 1562 |
\begingroup |
| 1563 |
\let\calc\@firstofone |
| 1564 |
\expandafter\BKM@@CalcParam\BKM@param\@empty\@empty\@nil |
| 1565 |
} |
| 1566 |
% \end{macrocode} |
| 1567 |
% \end{macro} |
| 1568 |
% \begin{macro}[module=BKM]{\BKM@@CalcParam} |
| 1569 |
% \begin{macrocode} |
| 1570 |
\def\BKM@@CalcParam#1#2#3\@nil{% |
| 1571 |
\ifx\calc#1% |
| 1572 |
\@ifundefined{calc@assign@dimen}{% |
| 1573 |
\@ifundefined{dimexpr}{% |
| 1574 |
\setlength{\dimen@}{#2}% |
| 1575 |
}{% |
| 1576 |
\setlength{\dimen@}{\dimexpr#2\relax}% |
| 1577 |
}% |
| 1578 |
}{% |
| 1579 |
\setlength{\dimen@}{#2}% |
| 1580 |
}% |
| 1581 |
\[email protected]\dimen@ |
| 1582 |
\edef\BKM@param{\strip@pt\dimen@}% |
| 1583 |
\expandafter\endgroup |
| 1584 |
\expandafter\def\expandafter\BKM@param\expandafter{\BKM@param}% |
| 1585 |
\else |
| 1586 |
\endgroup |
| 1587 |
\fi |
| 1588 |
} |
| 1589 |
% \end{macrocode} |
| 1590 |
% \end{macro} |
| 1591 |
% |
| 1592 |
% \subsubsection{Option \xoption{atend}} |
| 1593 |
% |
| 1594 |
% \begin{keydecl}{atend} |
| 1595 |
% \begin{macrocode} |
| 1596 |
\DeclareKeys[BKM] |
| 1597 |
{ |
| 1598 |
,atend.legacy_if_set:n = BKM@atend |
| 1599 |
,atend.usage:n = load |
| 1600 |
} |
| 1601 |
% \end{macrocode} |
| 1602 |
% \end{keydecl} |
| 1603 |
% \subsubsection{Option \xoption{style}} |
| 1604 |
% |
| 1605 |
% \begin{macro}{\bookmarkdefinestyle} |
| 1606 |
% \begin{macrocode} |
| 1607 |
\newcommand*{\bookmarkdefinestyle}[2]{% |
| 1608 |
\@ifundefined{BKM@style@#1}{% |
| 1609 |
}{% |
| 1610 |
\PackageInfo{bookmark}{Redefining style `#1'}% |
| 1611 |
}% |
| 1612 |
\@namedef{BKM@style@#1}{#2}% |
| 1613 |
} |
| 1614 |
% \end{macrocode} |
| 1615 |
% \end{macro} |
| 1616 |
% \begin{keydecl}{style} |
| 1617 |
% \begin{macrocode} |
| 1618 |
\DeclareKeys[BKM] |
| 1619 |
{ |
| 1620 |
,style.code:n = {\BKM@StyleCall{#1}} |
| 1621 |
} |
| 1622 |
\newif\ifBKM@ok |
| 1623 |
% \end{macrocode} |
| 1624 |
% \end{keydecl} |
| 1625 |
% \begin{macro}[module=BKM]{\BKM@StyleCall} |
| 1626 |
% \begin{macrocode} |
| 1627 |
\def\BKM@StyleCall#1{% |
| 1628 |
\@ifundefined{BKM@style@#1}{% |
| 1629 |
\PackageWarning{bookmark}{% |
| 1630 |
Ignoring unknown style `#1'% |
| 1631 |
}% |
| 1632 |
}{% |
| 1633 |
% \end{macrocode} |
| 1634 |
% Check style stack. |
| 1635 |
% \begin{macrocode} |
| 1636 |
\BKM@oktrue |
| 1637 |
\edef\BKM@StyleCurrent{#1}% |
| 1638 |
\@onelevel@sanitize\BKM@StyleCurrent |
| 1639 |
\let\BKM@StyleEntry\BKM@StyleEntryCheck |
| 1640 |
\BKM@StyleStack |
| 1641 |
\ifBKM@ok |
| 1642 |
\expandafter\@firstofone |
| 1643 |
\else |
| 1644 |
\PackageError{bookmark}{% |
| 1645 |
Ignoring recursive call of style `\BKM@StyleCurrent'% |
| 1646 |
}\@ehc |
| 1647 |
\expandafter\@gobble |
| 1648 |
\fi |
| 1649 |
{% |
| 1650 |
% \end{macrocode} |
| 1651 |
% Push current style on stack. |
| 1652 |
% \begin{macrocode} |
| 1653 |
\let\BKM@StyleEntry\relax |
| 1654 |
\edef\BKM@StyleStack{% |
| 1655 |
\BKM@StyleEntry{\BKM@StyleCurrent}% |
| 1656 |
\BKM@StyleStack |
| 1657 |
}% |
| 1658 |
% \end{macrocode} |
| 1659 |
% Call style. |
| 1660 |
% \begin{macrocode} |
| 1661 |
\expandafter\expandafter\expandafter\bookmarksetup |
| 1662 |
\expandafter\expandafter\expandafter{% |
| 1663 |
\csname BKM@style@\BKM@StyleCurrent\endcsname |
| 1664 |
}% |
| 1665 |
% \end{macrocode} |
| 1666 |
% Pop current style from stack. |
| 1667 |
% \begin{macrocode} |
| 1668 |
\BKM@StyleStackPop |
| 1669 |
}% |
| 1670 |
}% |
| 1671 |
} |
| 1672 |
% \end{macrocode} |
| 1673 |
% \end{macro} |
| 1674 |
% \begin{macro}[module=BKM]{\BKM@StyleStackPop} |
| 1675 |
% \begin{macrocode} |
| 1676 |
\def\BKM@StyleStackPop{% |
| 1677 |
\let\BKM@StyleEntry\relax |
| 1678 |
\edef\BKM@StyleStack{% |
| 1679 |
\expandafter\@gobbletwo\BKM@StyleStack |
| 1680 |
}% |
| 1681 |
} |
| 1682 |
% \end{macrocode} |
| 1683 |
% \end{macro} |
| 1684 |
% \begin{macro}[module=BKM]{\BKM@StyleEntryCheck} |
| 1685 |
% \begin{macrocode} |
| 1686 |
\def\BKM@StyleEntryCheck#1{% |
| 1687 |
\def\BKM@temp{#1}% |
| 1688 |
\ifx\BKM@temp\BKM@StyleCurrent |
| 1689 |
\BKM@okfalse |
| 1690 |
\fi |
| 1691 |
} |
| 1692 |
% \end{macrocode} |
| 1693 |
% \end{macro} |
| 1694 |
% \begin{macro}[module=BKM]{\BKM@StyleStack} |
| 1695 |
% \begin{macrocode} |
| 1696 |
\def\BKM@StyleStack{} |
| 1697 |
% \end{macrocode} |
| 1698 |
% \end{macro} |
| 1699 |
% |
| 1700 |
% \subsubsection{Options for source file location} |
| 1701 |
% |
| 1702 |
% \begin{keydecl}{srcline,srcfile} |
| 1703 |
% \begin{macrocode} |
| 1704 |
\DeclareKeys[BKM] |
| 1705 |
{ |
| 1706 |
,srcline.tl_set:N = \BKM@srcline |
| 1707 |
,srcfile.tl_set:N = \BKM@srcfile |
| 1708 |
} |
| 1709 |
% \end{macrocode} |
| 1710 |
% \end{keydecl} |
| 1711 |
% \subsubsection{Hook support} |
| 1712 |
% |
| 1713 |
% \begin{macro}[module=BKM]{\BKM@hook} |
| 1714 |
% \begin{macrocode} |
| 1715 |
\def\BKM@hook{} |
| 1716 |
% \end{macrocode} |
| 1717 |
% \end{macro} |
| 1718 |
% \begin{keydecl}{addtohook} |
| 1719 |
% \begin{macrocode} |
| 1720 |
\DeclareKeys[BKM] |
| 1721 |
{ |
| 1722 |
,addtohook.code:n = {\BKM@LocalAppendToMacro\BKM@hook{#1}} |
| 1723 |
} |
| 1724 |
% \end{macrocode} |
| 1725 |
% \end{keydecl} |
| 1726 |
% \begin{macro}{\bookmarkget} |
| 1727 |
% \begin{macrocode} |
| 1728 |
\newcommand*{\bookmarkget}[1]{% |
| 1729 |
\romannumeral0% |
| 1730 |
\@ifundefined{bookmark@#1}{% |
| 1731 |
\BKM@space |
| 1732 |
}{% |
| 1733 |
\expandafter\expandafter\expandafter\BKM@space |
| 1734 |
\csname bookmark@#1\endcsname |
| 1735 |
}% |
| 1736 |
} |
| 1737 |
% \end{macrocode} |
| 1738 |
% \end{macro} |
| 1739 |
% |
| 1740 |
% \subsubsection{Driver setup and loading} |
| 1741 |
% |
| 1742 |
% \paragraph{Driver detection.} |
| 1743 |
% |
| 1744 |
% \begin{macro}[module=BKM]{\BKM@DefineDriverKey} |
| 1745 |
% \begin{macrocode} |
| 1746 |
\def\BKM@DefineDriverKey#1{% |
| 1747 |
\DeclareKeys[BKM] |
| 1748 |
{ |
| 1749 |
,#1.code:n = |
| 1750 |
{\def\BKM@driver{#1}% |
| 1751 |
\PackageWarning{bookmark}{Option '#1' is obsolete |
| 1752 |
and ignored}{}} |
| 1753 |
} |
| 1754 |
} |
| 1755 |
% \end{macrocode} |
| 1756 |
% \end{macro} |
| 1757 |
% \begin{macrocode} |
| 1758 |
\BKM@DefineDriverKey{pdftex} |
| 1759 |
\BKM@DefineDriverKey{dvips} |
| 1760 |
\BKM@DefineDriverKey{dvipdfm} |
| 1761 |
\BKM@DefineDriverKey{dvipdfmx} |
| 1762 |
\BKM@DefineDriverKey{xetex} |
| 1763 |
\BKM@DefineDriverKey{vtex} |
| 1764 |
\DeclareKeys[BKM] |
| 1765 |
{ |
| 1766 |
,dvipdfmx-outline-open.code:n = |
| 1767 |
{% |
| 1768 |
\PackageWarning{bookmark}{Option 'dvipdfmx-outline-open' is obsolete |
| 1769 |
and ignored}{} |
| 1770 |
} |
| 1771 |
,dvipdfmx-outline-open.default:n=true |
| 1772 |
} |
| 1773 |
% \end{macrocode} |
| 1774 |
% \begin{macrocode} |
| 1775 |
\InputIfFileExists{bookmark.cfg}{}{} |
| 1776 |
% \end{macrocode} |
| 1777 |
% |
| 1778 |
% \paragraph{Process options.} |
| 1779 |
% |
| 1780 |
% \begin{macrocode} |
| 1781 |
\let\BKM@raw@classoptionlist\@raw@classoptionslist |
| 1782 |
\let\@raw@classoptionslist\relax |
| 1783 |
\ProcessKeyOptions[BKM] |
| 1784 |
\let\@raw@classoptionslist\BKM@raw@classoptionlist |
| 1785 |
% \end{macrocode} |
| 1786 |
% |
| 1787 |
% \paragraph{Option \xoption{draft}} |
| 1788 |
% |
| 1789 |
% \begin{macrocode} |
| 1790 |
\ifBKM@draft |
| 1791 |
\PackageWarningNoLine{bookmark}{Draft mode on}% |
| 1792 |
\let\bookmarksetup\@gobble |
| 1793 |
\let\BookmarkAtEnd\@gobble |
| 1794 |
\let\bookmarkdefinestyle\@gobbletwo |
| 1795 |
\let\bookmarkget\@gobble |
| 1796 |
\let\pdfbookmark\@undefined |
| 1797 |
\newcommand*{\pdfbookmark}[3][]{}% |
| 1798 |
\let\currentpdfbookmark\@gobbletwo |
| 1799 |
\let\subpdfbookmark\@gobbletwo |
| 1800 |
\let\belowpdfbookmark\@gobbletwo |
| 1801 |
\newcommand*{\bookmark}[2][]{}% |
| 1802 |
\renewcommand*{\Hy@writebookmark}[5]{}% |
| 1803 |
\let\ReadBookmarks\relax |
| 1804 |
\let\BKM@DefGotoNameAction\@gobbletwo % package `hypdestopt' |
| 1805 |
\expandafter\endinput |
| 1806 |
\fi |
| 1807 |
% \end{macrocode} |
| 1808 |
% |
| 1809 |
% \paragraph{Driver loading.} |
| 1810 |
% |
| 1811 |
% \begin{macrocode} |
| 1812 |
\ExplSyntaxOn |
| 1813 |
\ifvtex |
| 1814 |
\def\BKM@driver{vtex} |
| 1815 |
\else |
| 1816 |
\sys_ensure_backend: |
| 1817 |
\str_case:Nn \c_sys_backend_str |
| 1818 |
{ |
| 1819 |
{pdftex} {\def\BKM@driver{pdftex}} |
| 1820 |
{luatex} {\def\BKM@driver{luatex}} |
| 1821 |
{xetex} {\def\BKM@driver{xetex}} |
| 1822 |
{dvipdfmx}{\def\BKM@driver{dvipdfmx}} |
| 1823 |
{dvips} {\def\BKM@driver{dvips}} |
| 1824 |
} |
| 1825 |
\fi |
| 1826 |
\ExplSyntaxOff |
| 1827 |
\InputIfFileExists{bkm-\[email protected]}{}{} |
| 1828 |
% \end{macrocode} |
| 1829 |
% |
| 1830 |
% \subsubsection{Compatibility for \xpackage{hyperref}} |
| 1831 |
% |
| 1832 |
% \begin{macro}{\pdfbookmark} |
| 1833 |
% \begin{macrocode} |
| 1834 |
\let\pdfbookmark\@undefined |
| 1835 |
\newcommand*{\pdfbookmark}[3][0]{% |
| 1836 |
\bookmark[level=#1,dest={#3.#1}]{#2}% |
| 1837 |
\hyper@anchorstart{#3.#1}\hyper@anchorend |
| 1838 |
} |
| 1839 |
% \end{macrocode} |
| 1840 |
% \end{macro} |
| 1841 |
% \begin{macro}{\currentpdfbookmark} |
| 1842 |
% \begin{macrocode} |
| 1843 |
\def\currentpdfbookmark{% |
| 1844 |
\pdfbookmark[\BKM@currentlevel]% |
| 1845 |
} |
| 1846 |
% \end{macrocode} |
| 1847 |
% \end{macro} |
| 1848 |
% \begin{macro}{\subpdfbookmark} |
| 1849 |
% \begin{macrocode} |
| 1850 |
\def\subpdfbookmark{% |
| 1851 |
\BKM@CalcExpr\BKM@CalcResult\BKM@currentlevel+1% |
| 1852 |
\expandafter\pdfbookmark\expandafter[\BKM@CalcResult]% |
| 1853 |
} |
| 1854 |
% \end{macrocode} |
| 1855 |
% \end{macro} |
| 1856 |
% \begin{macro}{\belowpdfbookmark} |
| 1857 |
% \begin{macrocode} |
| 1858 |
\def\belowpdfbookmark#1#2{% |
| 1859 |
\xdef\BKM@gtemp{\number\BKM@currentlevel}% |
| 1860 |
\subpdfbookmark{#1}{#2}% |
| 1861 |
\global\let\BKM@currentlevel\BKM@gtemp |
| 1862 |
} |
| 1863 |
% \end{macrocode} |
| 1864 |
% \end{macro} |
| 1865 |
% |
| 1866 |
% Section number, text, label, level, file |
| 1867 |
% \begin{macro}[module=]{\Hy@writebookmark} |
| 1868 |
% \begin{macrocode} |
| 1869 |
\def\Hy@writebookmark#1#2#3#4#5{% |
| 1870 |
\ifnum#4>\BKM@depth\relax |
| 1871 |
\else |
| 1872 |
\edef\BKM@type{#5}% |
| 1873 |
\ifx\BKM@type\Hy@bookmarkstype |
| 1874 |
\begingroup |
| 1875 |
\ifBKM@numbered |
| 1876 |
\let\numberline\Hy@numberline |
| 1877 |
\let\booknumberline\Hy@numberline |
| 1878 |
\let\partnumberline\Hy@numberline |
| 1879 |
\let\chapternumberline\Hy@numberline |
| 1880 |
\else |
| 1881 |
\let\numberline\@gobble |
| 1882 |
\let\booknumberline\@gobble |
| 1883 |
\let\partnumberline\@gobble |
| 1884 |
\let\chapternumberline\@gobble |
| 1885 |
\fi |
| 1886 |
\bookmark[level=#4,dest={\HyperDestNameFilter{#3}}]{#2}% |
| 1887 |
\endgroup |
| 1888 |
\fi |
| 1889 |
\fi |
| 1890 |
} |
| 1891 |
% \end{macrocode} |
| 1892 |
% \end{macro} |
| 1893 |
% |
| 1894 |
% \begin{macro}[int,module=]{\ReadBookmarks} |
| 1895 |
% \begin{macrocode} |
| 1896 |
\let\ReadBookmarks\relax |
| 1897 |
% \end{macrocode} |
| 1898 |
% \end{macro} |
| 1899 |
% |
| 1900 |
% \begin{macrocode} |
| 1901 |
%</package> |
| 1902 |
% \end{macrocode} |
| 1903 |
% |
| 1904 |
% \subsection{Driver for dvipdfm} |
| 1905 |
% |
| 1906 |
% \begin{macrocode} |
| 1907 |
%<*dvipdfmx> |
| 1908 |
\NeedsTeXFormat{LaTeX2e} |
| 1909 |
\ProvidesFile{bkm-dvipdfmx.def}% |
| 1910 |
[2026-05-21 v1.32 bookmark driver for dvipdfm (HO)]% |
| 1911 |
%</dvipdfmx> |
| 1912 |
% \end{macrocode} |
| 1913 |
% \begin{macrocode} |
| 1914 |
%<*xetex> |
| 1915 |
\NeedsTeXFormat{LaTeX2e} |
| 1916 |
\ProvidesFile{bkm-xetex.def}% |
| 1917 |
[2026-05-21 v1.32 bookmark driver for xetex (HO)]% |
| 1918 |
%</xetex> |
| 1919 |
% \end{macrocode} |
| 1920 |
% \begin{macrocode} |
| 1921 |
%<*dvipdfmx|xetex> |
| 1922 |
% \end{macrocode} |
| 1923 |
% \begin{macro}[int]{\BKM@id} |
| 1924 |
% \begin{macrocode} |
| 1925 |
\newcount\BKM@id |
| 1926 |
\BKM@id=\z@ |
| 1927 |
% \end{macrocode} |
| 1928 |
% \end{macro} |
| 1929 |
% |
| 1930 |
% \begin{macro}[int]{\BKM@0} |
| 1931 |
% \begin{macrocode} |
| 1932 |
\@namedef{BKM@0}{000} |
| 1933 |
% \end{macrocode} |
| 1934 |
% \end{macro} |
| 1935 |
% \begin{macro}[int]{\ifBKM@sw} |
| 1936 |
% \begin{macrocode} |
| 1937 |
\newif\ifBKM@sw |
| 1938 |
% \end{macrocode} |
| 1939 |
% \end{macro} |
| 1940 |
% |
| 1941 |
% \begin{macro}[int]{\BKM@struct@dest} |
| 1942 |
% Support for structure destinations in the outline. |
| 1943 |
% \begin{macrocode} |
| 1944 |
\newcommand\BKM@struct@dest{} |
| 1945 |
\ExplSyntaxOn |
| 1946 |
\IfDocumentMetadataTF |
| 1947 |
{ |
| 1948 |
\tag_if_active:T |
| 1949 |
{ |
| 1950 |
\def\BKM@struct@dest{/[email protected].\BKM@dest} |
| 1951 |
} |
| 1952 |
|
| 1953 |
}{} |
| 1954 |
\ExplSyntaxOff |
| 1955 |
% \end{macrocode} |
| 1956 |
% \end{macro} |
| 1957 |
% |
| 1958 |
% \begin{macro}{\bookmark} |
| 1959 |
% \begin{macrocode} |
| 1960 |
\newcommand*{\bookmark}[2][]{% |
| 1961 |
\if@filesw |
| 1962 |
\begingroup |
| 1963 |
\def\bookmark@text{#2}% |
| 1964 |
\BKM@setup{#1}% |
| 1965 |
\edef\BKM@prev{\the\BKM@id}% |
| 1966 |
\global\advance\BKM@id\@ne |
| 1967 |
\BKM@swtrue |
| 1968 |
\@whilesw\ifBKM@sw\fi{% |
| 1969 |
\def\BKM@abslevel{1}% |
| 1970 |
\ifnum\ifBKM@startatroot\z@\else\BKM@prev\fi=\z@ |
| 1971 |
\BKM@startatrootfalse |
| 1972 |
\expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% |
| 1973 |
0{\BKM@level}\BKM@abslevel |
| 1974 |
}% |
| 1975 |
\BKM@swfalse |
| 1976 |
\else |
| 1977 |
\expandafter\expandafter\expandafter\BKM@getx |
| 1978 |
\csname BKM@\BKM@prev\endcsname |
| 1979 |
\ifnum\BKM@level>\BKM@x@level\relax |
| 1980 |
\BKM@CalcExpr\BKM@abslevel\BKM@x@abslevel+1% |
| 1981 |
\expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% |
| 1982 |
{\BKM@prev}{\BKM@level}\BKM@abslevel |
| 1983 |
}% |
| 1984 |
\BKM@swfalse |
| 1985 |
\else |
| 1986 |
\let\BKM@prev\BKM@x@parent |
| 1987 |
\fi |
| 1988 |
\fi |
| 1989 |
}% |
| 1990 |
\csname HyPsd@XeTeXBigCharstrue\endcsname |
| 1991 |
\pdfstringdef\BKM@title{\bookmark@text}% |
| 1992 |
\edef\BKM@FLAGS{\BKM@PrintStyle}% |
| 1993 |
\let\BKM@action\@empty |
| 1994 |
\ifx\BKM@gotor\@empty |
| 1995 |
\ifx\BKM@dest\@empty |
| 1996 |
\ifx\BKM@named\@empty |
| 1997 |
\ifx\BKM@rawaction\@empty |
| 1998 |
\ifx\BKM@uri\@empty |
| 1999 |
\ifx\BKM@page\@empty |
| 2000 |
\PackageError{bookmark}{Missing action}\@ehc |
| 2001 |
\edef\BKM@action{/Dest[@page1/Fit]}% |
| 2002 |
\else |
| 2003 |
\ifx\BKM@view\@empty |
| 2004 |
\def\BKM@view{Fit}% |
| 2005 |
\fi |
| 2006 |
\edef\BKM@action{/Dest[@page\BKM@page/\BKM@view]}% |
| 2007 |
\fi |
| 2008 |
\else |
| 2009 |
\BKM@EscapeString\BKM@uri |
| 2010 |
\edef\BKM@action{% |
| 2011 |
/A<<% |
| 2012 |
/S/URI% |
| 2013 |
/URI(\BKM@uri)% |
| 2014 |
>>% |
| 2015 |
}% |
| 2016 |
\fi |
| 2017 |
\else |
| 2018 |
\edef\BKM@action{/A<<\BKM@rawaction>>}% |
| 2019 |
\fi |
| 2020 |
\else |
| 2021 |
\BKM@EscapeName\BKM@named |
| 2022 |
\edef\BKM@action{% |
| 2023 |
/A<</S/Named/N/\BKM@named>>% |
| 2024 |
}% |
| 2025 |
\fi |
| 2026 |
\else |
| 2027 |
\BKM@EscapeString\BKM@dest |
| 2028 |
\edef\BKM@action{% |
| 2029 |
/A<<% |
| 2030 |
/S/GoTo% |
| 2031 |
/D(\BKM@dest)% |
| 2032 |
\BKM@struct@dest |
| 2033 |
>>% |
| 2034 |
}% |
| 2035 |
\fi |
| 2036 |
\else |
| 2037 |
\ifx\BKM@dest\@empty |
| 2038 |
\ifx\BKM@page\@empty |
| 2039 |
\def\BKM@page{0}% |
| 2040 |
\else |
| 2041 |
\BKM@CalcExpr\BKM@page\BKM@page-1% |
| 2042 |
\fi |
| 2043 |
\ifx\BKM@view\@empty |
| 2044 |
\def\BKM@view{Fit}% |
| 2045 |
\fi |
| 2046 |
\edef\BKM@action{/D[\BKM@page/\BKM@view]}% |
| 2047 |
\else |
| 2048 |
\BKM@EscapeString\BKM@dest |
| 2049 |
\edef\BKM@action{/D(\BKM@dest)}% |
| 2050 |
\fi |
| 2051 |
\BKM@EscapeString\BKM@gotor |
| 2052 |
\edef\BKM@action{% |
| 2053 |
/A<<% |
| 2054 |
/S/GoToR% |
| 2055 |
/F(\BKM@gotor)% |
| 2056 |
\BKM@action |
| 2057 |
>>% |
| 2058 |
}% |
| 2059 |
\fi |
| 2060 |
\special{pdf:% |
| 2061 |
out |
| 2062 |
[% |
| 2063 |
\ifBKM@open |
| 2064 |
\ifnum\BKM@level<% |
| 2065 |
\expandafter\@firstofone\expandafter |
| 2066 |
{\number\BKM@openlevel} % |
| 2067 |
\else |
| 2068 |
-% |
| 2069 |
\fi |
| 2070 |
\else |
| 2071 |
-% |
| 2072 |
\fi |
| 2073 |
] % |
| 2074 |
\BKM@abslevel |
| 2075 |
<<% |
| 2076 |
/Title(\BKM@title)% |
| 2077 |
\ifx\BKM@color\@empty |
| 2078 |
\else |
| 2079 |
/C[\BKM@color]% |
| 2080 |
\fi |
| 2081 |
\ifnum\BKM@FLAGS>\z@ |
| 2082 |
/F \BKM@FLAGS |
| 2083 |
\fi |
| 2084 |
\BKM@action |
| 2085 |
>>% |
| 2086 |
}% |
| 2087 |
\endgroup |
| 2088 |
\fi |
| 2089 |
} |
| 2090 |
% \end{macrocode} |
| 2091 |
% \end{macro} |
| 2092 |
% \begin{macro}[int]{\BKM@getx} |
| 2093 |
% \begin{macrocode} |
| 2094 |
\def\BKM@getx#1#2#3{% |
| 2095 |
\def\BKM@x@parent{#1}% |
| 2096 |
\def\BKM@x@level{#2}% |
| 2097 |
\def\BKM@x@abslevel{#3}% |
| 2098 |
} |
| 2099 |
% \end{macrocode} |
| 2100 |
% \end{macro} |
| 2101 |
% |
| 2102 |
% \begin{macrocode} |
| 2103 |
%</dvipdfmx|xetex> |
| 2104 |
% \end{macrocode} |
| 2105 |
% |
| 2106 |
% \subsection{Driver for \hologo{VTeX}} |
| 2107 |
% |
| 2108 |
% \begin{macrocode} |
| 2109 |
%<*vtex> |
| 2110 |
\NeedsTeXFormat{LaTeX2e} |
| 2111 |
\ProvidesFile{bkm-vtex.def}% |
| 2112 |
[2026-05-21 v1.32 bookmark driver for VTeX (HO)]% |
| 2113 |
% \end{macrocode} |
| 2114 |
% |
| 2115 |
% \begin{macrocode} |
| 2116 |
\ifvtexpdf |
| 2117 |
\else |
| 2118 |
\PackageWarningNoLine{bookmark}{% |
| 2119 |
The VTeX driver only supports PDF mode% |
| 2120 |
}% |
| 2121 |
\fi |
| 2122 |
% \end{macrocode} |
| 2123 |
% |
| 2124 |
% \begin{macro}[int]{\BKM@id} |
| 2125 |
% \begin{macrocode} |
| 2126 |
\newcount\BKM@id |
| 2127 |
\BKM@id=\z@ |
| 2128 |
% \end{macrocode} |
| 2129 |
% \end{macro} |
| 2130 |
% |
| 2131 |
% \begin{macro}[int]{\BKM@0} |
| 2132 |
% \begin{macrocode} |
| 2133 |
\@namedef{BKM@0}{00} |
| 2134 |
% \end{macrocode} |
| 2135 |
% \end{macro} |
| 2136 |
% \begin{macro}[int]{\ifBKM@sw} |
| 2137 |
% \begin{macrocode} |
| 2138 |
\newif\ifBKM@sw |
| 2139 |
% \end{macrocode} |
| 2140 |
% \end{macro} |
| 2141 |
% |
| 2142 |
% \begin{macro}{\bookmark} |
| 2143 |
% \begin{macrocode} |
| 2144 |
\newcommand*{\bookmark}[2][]{% |
| 2145 |
\if@filesw |
| 2146 |
\begingroup |
| 2147 |
\def\bookmark@text{#2}% |
| 2148 |
\BKM@setup{#1}% |
| 2149 |
\edef\BKM@prev{\the\BKM@id}% |
| 2150 |
\global\advance\BKM@id\@ne |
| 2151 |
\BKM@swtrue |
| 2152 |
\@whilesw\ifBKM@sw\fi{% |
| 2153 |
\ifnum\ifBKM@startatroot\z@\else\BKM@prev\fi=\z@ |
| 2154 |
\BKM@startatrootfalse |
| 2155 |
\def\BKM@parent{0}% |
| 2156 |
\expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% |
| 2157 |
0{\BKM@level}% |
| 2158 |
}% |
| 2159 |
\BKM@swfalse |
| 2160 |
\else |
| 2161 |
\expandafter\expandafter\expandafter\BKM@getx |
| 2162 |
\csname BKM@\BKM@prev\endcsname |
| 2163 |
\ifnum\BKM@level>\BKM@x@level\relax |
| 2164 |
\let\BKM@parent\BKM@prev |
| 2165 |
\expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% |
| 2166 |
{\BKM@prev}{\BKM@level}% |
| 2167 |
}% |
| 2168 |
\BKM@swfalse |
| 2169 |
\else |
| 2170 |
\let\BKM@prev\BKM@x@parent |
| 2171 |
\fi |
| 2172 |
\fi |
| 2173 |
}% |
| 2174 |
\pdfstringdef\BKM@title{\bookmark@text}% |
| 2175 |
\BKM@vtex@title |
| 2176 |
\edef\BKM@FLAGS{\BKM@PrintStyle}% |
| 2177 |
\let\BKM@action\@empty |
| 2178 |
\ifx\BKM@gotor\@empty |
| 2179 |
\ifx\BKM@dest\@empty |
| 2180 |
\ifx\BKM@named\@empty |
| 2181 |
\ifx\BKM@rawaction\@empty |
| 2182 |
\ifx\BKM@uri\@empty |
| 2183 |
\ifx\BKM@page\@empty |
| 2184 |
\PackageError{bookmark}{Missing action}\@ehc |
| 2185 |
\def\BKM@action{!1}% |
| 2186 |
\else |
| 2187 |
\edef\BKM@action{!\BKM@page}% |
| 2188 |
\fi |
| 2189 |
\else |
| 2190 |
\BKM@EscapeString\BKM@uri |
| 2191 |
\edef\BKM@action{% |
| 2192 |
<u=% |
| 2193 |
/S/URI% |
| 2194 |
/URI(\BKM@uri)% |
| 2195 |
>% |
| 2196 |
}% |
| 2197 |
\fi |
| 2198 |
\else |
| 2199 |
\edef\BKM@action{<u=\BKM@rawaction>}% |
| 2200 |
\fi |
| 2201 |
\else |
| 2202 |
\BKM@EscapeName\BKM@named |
| 2203 |
\edef\BKM@action{% |
| 2204 |
<u=% |
| 2205 |
/S/Named% |
| 2206 |
/N/\BKM@named |
| 2207 |
>% |
| 2208 |
}% |
| 2209 |
\fi |
| 2210 |
\else |
| 2211 |
\BKM@EscapeString\BKM@dest |
| 2212 |
\edef\BKM@action{\BKM@dest}% |
| 2213 |
\fi |
| 2214 |
\else |
| 2215 |
\ifx\BKM@dest\@empty |
| 2216 |
\ifx\BKM@page\@empty |
| 2217 |
\def\BKM@page{1}% |
| 2218 |
\fi |
| 2219 |
\ifx\BKM@view\@empty |
| 2220 |
\def\BKM@view{Fit}% |
| 2221 |
\fi |
| 2222 |
\edef\BKM@action{/D[\BKM@page/\BKM@view]}% |
| 2223 |
\else |
| 2224 |
\BKM@EscapeString\BKM@dest |
| 2225 |
\edef\BKM@action{/D(\BKM@dest)}% |
| 2226 |
\fi |
| 2227 |
\BKM@EscapeString\BKM@gotor |
| 2228 |
\edef\BKM@action{% |
| 2229 |
<u=% |
| 2230 |
/S/GoToR% |
| 2231 |
/F(\BKM@gotor)% |
| 2232 |
\BKM@action |
| 2233 |
>>% |
| 2234 |
}% |
| 2235 |
\fi |
| 2236 |
\ifx\BKM@color\@empty |
| 2237 |
\let\BKM@RGBcolor\@empty |
| 2238 |
\else |
| 2239 |
\expandafter\BKM@toRGB\BKM@color\@nil |
| 2240 |
\fi |
| 2241 |
\special{% |
| 2242 |
!outline \BKM@action;% |
| 2243 |
p=\BKM@parent,% |
| 2244 |
i=\number\BKM@id,% |
| 2245 |
s=% |
| 2246 |
\ifBKM@open |
| 2247 |
\ifnum\BKM@level<\BKM@openlevel |
| 2248 |
o% |
| 2249 |
\else |
| 2250 |
c% |
| 2251 |
\fi |
| 2252 |
\else |
| 2253 |
c% |
| 2254 |
\fi,% |
| 2255 |
\ifx\BKM@RGBcolor\@empty |
| 2256 |
\else |
| 2257 |
c=\BKM@RGBcolor,% |
| 2258 |
\fi |
| 2259 |
\ifnum\BKM@FLAGS>\z@ |
| 2260 |
f=\BKM@FLAGS,% |
| 2261 |
\fi |
| 2262 |
t=\BKM@title |
| 2263 |
}% |
| 2264 |
\endgroup |
| 2265 |
\fi |
| 2266 |
} |
| 2267 |
% \end{macrocode} |
| 2268 |
% \end{macro} |
| 2269 |
% \begin{macro}[int]{\BKM@getx} |
| 2270 |
% \begin{macrocode} |
| 2271 |
\def\BKM@getx#1#2{% |
| 2272 |
\def\BKM@x@parent{#1}% |
| 2273 |
\def\BKM@x@level{#2}% |
| 2274 |
} |
| 2275 |
% \end{macrocode} |
| 2276 |
% \end{macro} |
| 2277 |
% \begin{macro}[int]{\BKM@toRGB} |
| 2278 |
% \begin{macrocode} |
| 2279 |
\def\BKM@toRGB#1 #2 #3\@nil{% |
| 2280 |
\let\BKM@RGBcolor\@empty |
| 2281 |
\BKM@toRGBComponent{#1}% |
| 2282 |
\BKM@toRGBComponent{#2}% |
| 2283 |
\BKM@toRGBComponent{#3}% |
| 2284 |
} |
| 2285 |
% \end{macrocode} |
| 2286 |
% \end{macro} |
| 2287 |
% \begin{macro}[int]{\BKM@toRGBComponent} |
| 2288 |
% \begin{macrocode} |
| 2289 |
\def\BKM@toRGBComponent#1{% |
| 2290 |
\dimen@=#1pt\relax |
| 2291 |
\ifdim\dimen@>\z@ |
| 2292 |
\ifdim\dimen@<\p@ |
| 2293 |
\dimen@=255\dimen@ |
| 2294 |
\advance\dimen@ by 32768sp\relax |
| 2295 |
\divide\dimen@ by 65536\relax |
| 2296 |
\dimen@ii=\dimen@ |
| 2297 |
\divide\dimen@ii by 16\relax |
| 2298 |
\edef\BKM@RGBcolor{% |
| 2299 |
\BKM@RGBcolor |
| 2300 |
\BKM@toHexDigit\dimen@ii |
| 2301 |
}% |
| 2302 |
\dimen@ii=16\dimen@ii |
| 2303 |
\advance\dimen@-\dimen@ii |
| 2304 |
\edef\BKM@RGBcolor{% |
| 2305 |
\BKM@RGBcolor |
| 2306 |
\BKM@toHexDigit\dimen@ |
| 2307 |
}% |
| 2308 |
\else |
| 2309 |
\edef\BKM@RGBcolor{\BKM@RGBcolor FF}% |
| 2310 |
\fi |
| 2311 |
\else |
| 2312 |
\edef\BKM@RGBcolor{\BKM@RGBcolor00}% |
| 2313 |
\fi |
| 2314 |
} |
| 2315 |
% \end{macrocode} |
| 2316 |
% \end{macro} |
| 2317 |
% \begin{macro}[int]{\BKM@toHexDigit} |
| 2318 |
% \begin{macrocode} |
| 2319 |
\def\BKM@toHexDigit#1{% |
| 2320 |
\ifcase\expandafter\@firstofone\expandafter{\number#1} % |
| 2321 |
0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or |
| 2322 |
8\or 9\or A\or B\or C\or D\or E\or F% |
| 2323 |
\fi |
| 2324 |
} |
| 2325 |
% \end{macrocode} |
| 2326 |
% \end{macro} |
| 2327 |
% \begin{macrocode} |
| 2328 |
\begingroup |
| 2329 |
\catcode`\|=0 % |
| 2330 |
\catcode`\\=12 % |
| 2331 |
% \end{macrocode} |
| 2332 |
% \begin{macro}[int]{\BKM@vtex@title} |
| 2333 |
% \begin{macrocode} |
| 2334 |
|gdef|BKM@vtex@title{% |
| 2335 |
|@onelevel@sanitize|BKM@title |
| 2336 |
|edef|BKM@title{|expandafter|BKM@vtex@leftparen|BKM@title\(|@nil}% |
| 2337 |
|edef|BKM@title{|expandafter|BKM@vtex@rightparen|BKM@title\)|@nil}% |
| 2338 |
|edef|BKM@title{|expandafter|BKM@vtex@zero|BKM@title\0|@nil}% |
| 2339 |
|edef|BKM@title{|expandafter|BKM@vtex@one|BKM@title\1|@nil}% |
| 2340 |
|edef|BKM@title{|expandafter|BKM@vtex@two|BKM@title\2|@nil}% |
| 2341 |
|edef|BKM@title{|expandafter|BKM@vtex@three|BKM@title\3|@nil}% |
| 2342 |
}% |
| 2343 |
% \end{macrocode} |
| 2344 |
% \end{macro} |
| 2345 |
% \begin{macro}[int]{\BKM@vtex@leftparen} |
| 2346 |
% \begin{macrocode} |
| 2347 |
|gdef|BKM@vtex@leftparen#1\(#2|@nil{% |
| 2348 |
#1% |
| 2349 |
|ifx||#2||% |
| 2350 |
|else |
| 2351 |
(% |
| 2352 |
|BKM@ReturnAfterFi{% |
| 2353 |
|BKM@vtex@leftparen#2|@nil |
| 2354 |
}% |
| 2355 |
|fi |
| 2356 |
}% |
| 2357 |
% \end{macrocode} |
| 2358 |
% \end{macro} |
| 2359 |
% \begin{macro}[int]{\BKM@vtex@rightparen} |
| 2360 |
% \begin{macrocode} |
| 2361 |
|gdef|BKM@vtex@rightparen#1\)#2|@nil{% |
| 2362 |
#1% |
| 2363 |
|ifx||#2||% |
| 2364 |
|else |
| 2365 |
)% |
| 2366 |
|BKM@ReturnAfterFi{% |
| 2367 |
|BKM@vtex@rightparen#2|@nil |
| 2368 |
}% |
| 2369 |
|fi |
| 2370 |
}% |
| 2371 |
% \end{macrocode} |
| 2372 |
% \end{macro} |
| 2373 |
% \begin{macro}[int]{\BKM@vtex@zero} |
| 2374 |
% \begin{macrocode} |
| 2375 |
|gdef|BKM@vtex@zero#1\0#2|@nil{% |
| 2376 |
#1% |
| 2377 |
|ifx||#2||% |
| 2378 |
|else |
| 2379 |
|noexpand|hv@pdf@char0% |
| 2380 |
|BKM@ReturnAfterFi{% |
| 2381 |
|BKM@vtex@zero#2|@nil |
| 2382 |
}% |
| 2383 |
|fi |
| 2384 |
}% |
| 2385 |
% \end{macrocode} |
| 2386 |
% \end{macro} |
| 2387 |
% \begin{macro}[int]{\BKM@vtex@one} |
| 2388 |
% \begin{macrocode} |
| 2389 |
|gdef|BKM@vtex@one#1\1#2|@nil{% |
| 2390 |
#1% |
| 2391 |
|ifx||#2||% |
| 2392 |
|else |
| 2393 |
|noexpand|hv@pdf@char1% |
| 2394 |
|BKM@ReturnAfterFi{% |
| 2395 |
|BKM@vtex@one#2|@nil |
| 2396 |
}% |
| 2397 |
|fi |
| 2398 |
}% |
| 2399 |
% \end{macrocode} |
| 2400 |
% \end{macro} |
| 2401 |
% \begin{macro}[int]{\BKM@vtex@two} |
| 2402 |
% \begin{macrocode} |
| 2403 |
|gdef|BKM@vtex@two#1\2#2|@nil{% |
| 2404 |
#1% |
| 2405 |
|ifx||#2||% |
| 2406 |
|else |
| 2407 |
|noexpand|hv@pdf@char2% |
| 2408 |
|BKM@ReturnAfterFi{% |
| 2409 |
|BKM@vtex@two#2|@nil |
| 2410 |
}% |
| 2411 |
|fi |
| 2412 |
}% |
| 2413 |
% \end{macrocode} |
| 2414 |
% \end{macro} |
| 2415 |
% \begin{macro}[int]{\BKM@vtex@three} |
| 2416 |
% \begin{macrocode} |
| 2417 |
|gdef|BKM@vtex@three#1\3#2|@nil{% |
| 2418 |
#1% |
| 2419 |
|ifx||#2||% |
| 2420 |
|else |
| 2421 |
|noexpand|hv@pdf@char3% |
| 2422 |
|BKM@ReturnAfterFi{% |
| 2423 |
|BKM@vtex@three#2|@nil |
| 2424 |
}% |
| 2425 |
|fi |
| 2426 |
}% |
| 2427 |
% \end{macrocode} |
| 2428 |
% \end{macro} |
| 2429 |
% \begin{macrocode} |
| 2430 |
|endgroup |
| 2431 |
% \end{macrocode} |
| 2432 |
% |
| 2433 |
% \begin{macrocode} |
| 2434 |
%</vtex> |
| 2435 |
% \end{macrocode} |
| 2436 |
% |
| 2437 |
% \subsection{Driver for \hologo{pdfTeX}} |
| 2438 |
% |
| 2439 |
% \begin{macrocode} |
| 2440 |
%<*pdftex> |
| 2441 |
\NeedsTeXFormat{LaTeX2e} |
| 2442 |
\ProvidesFile{bkm-pdftex.def}% |
| 2443 |
[2026-05-21 v1.32 bookmark driver for pdfTeX (HO)]% |
| 2444 |
%</pdftex> |
| 2445 |
% \end{macrocode} |
| 2446 |
% \begin{macrocode} |
| 2447 |
%<*luatex> |
| 2448 |
\NeedsTeXFormat{LaTeX2e} |
| 2449 |
\ProvidesFile{bkm-luatex.def}% |
| 2450 |
[2026-05-21 v1.32 bookmark driver for luaTeX (HO)]% |
| 2451 |
%</luatex> |
| 2452 |
% \end{macrocode} |
| 2453 |
% |
| 2454 |
% \begin{macrocode} |
| 2455 |
%<*pdftex|luatex> |
| 2456 |
% \end{macrocode} |
| 2457 |
% |
| 2458 |
% \begin{macro}[int]{\BKM@DO@entry} |
| 2459 |
% \begin{macrocode} |
| 2460 |
\def\BKM@DO@entry#1#2{% |
| 2461 |
\begingroup |
| 2462 |
\SetKeys[BKM@DO]{#1}% |
| 2463 |
\def\BKM@DO@title{#2}% |
| 2464 |
\ifx\BKM@DO@srcfile\@empty |
| 2465 |
\else |
| 2466 |
\BKM@UnescapeHex\BKM@DO@srcfile |
| 2467 |
\fi |
| 2468 |
\BKM@UnescapeHex\BKM@DO@title |
| 2469 |
\expandafter\expandafter\expandafter\BKM@getx |
| 2470 |
\csname BKM@\BKM@DO@id\endcsname\@empty\@empty |
| 2471 |
\let\BKM@attr\@empty |
| 2472 |
\ifx\BKM@DO@flags\@empty |
| 2473 |
\else |
| 2474 |
\edef\BKM@attr{\BKM@attr/F \BKM@DO@flags}% |
| 2475 |
\fi |
| 2476 |
\ifx\BKM@DO@color\@empty |
| 2477 |
\else |
| 2478 |
\edef\BKM@attr{\BKM@attr/C[\BKM@DO@color]}% |
| 2479 |
\fi |
| 2480 |
\ifx\BKM@attr\@empty |
| 2481 |
\else |
| 2482 |
\edef\BKM@attr{attr{\BKM@attr}}% |
| 2483 |
\fi |
| 2484 |
\let\BKM@action\@empty |
| 2485 |
\ifx\BKM@DO@gotor\@empty |
| 2486 |
\ifx\BKM@DO@dest\@empty |
| 2487 |
\ifx\BKM@DO@named\@empty |
| 2488 |
\ifx\BKM@DO@rawaction\@empty |
| 2489 |
\ifx\BKM@DO@uri\@empty |
| 2490 |
\ifx\BKM@DO@page\@empty |
| 2491 |
\PackageError{bookmark}{% |
| 2492 |
Missing action\BKM@SourceLocation |
| 2493 |
}\@ehc |
| 2494 |
\edef\BKM@action{goto page1{/Fit}}% |
| 2495 |
\else |
| 2496 |
\ifx\BKM@DO@view\@empty |
| 2497 |
\def\BKM@DO@view{Fit}% |
| 2498 |
\fi |
| 2499 |
\edef\BKM@action{goto page\BKM@DO@page{/\BKM@DO@view}}% |
| 2500 |
\fi |
| 2501 |
\else |
| 2502 |
\BKM@UnescapeHex\BKM@DO@uri |
| 2503 |
\BKM@EscapeString\BKM@DO@uri |
| 2504 |
\edef\BKM@action{user{<</S/URI/URI(\BKM@DO@uri)>>}}% |
| 2505 |
\fi |
| 2506 |
\else |
| 2507 |
\BKM@UnescapeHex\BKM@DO@rawaction |
| 2508 |
\edef\BKM@action{% |
| 2509 |
user{% |
| 2510 |
<<% |
| 2511 |
\BKM@DO@rawaction |
| 2512 |
>>% |
| 2513 |
}% |
| 2514 |
}% |
| 2515 |
\fi |
| 2516 |
\else |
| 2517 |
\BKM@EscapeName\BKM@DO@named |
| 2518 |
\edef\BKM@action{% |
| 2519 |
user{<</S/Named/N/\BKM@DO@named>>}% |
| 2520 |
}% |
| 2521 |
\fi |
| 2522 |
\else |
| 2523 |
\BKM@UnescapeHex\BKM@DO@dest |
| 2524 |
\BKM@DefGotoNameAction\BKM@action\BKM@DO@dest |
| 2525 |
\fi |
| 2526 |
\else |
| 2527 |
\ifx\BKM@DO@dest\@empty |
| 2528 |
\ifx\BKM@DO@page\@empty |
| 2529 |
\def\BKM@DO@page{0}% |
| 2530 |
\else |
| 2531 |
\BKM@CalcExpr\BKM@DO@page\BKM@DO@page-1% |
| 2532 |
\fi |
| 2533 |
\ifx\BKM@DO@view\@empty |
| 2534 |
\def\BKM@DO@view{Fit}% |
| 2535 |
\fi |
| 2536 |
\edef\BKM@action{/D[\BKM@DO@page/\BKM@DO@view]}% |
| 2537 |
\else |
| 2538 |
\BKM@UnescapeHex\BKM@DO@dest |
| 2539 |
\BKM@EscapeString\BKM@DO@dest |
| 2540 |
\edef\BKM@action{/D(\BKM@DO@dest)}% |
| 2541 |
\fi |
| 2542 |
\BKM@UnescapeHex\BKM@DO@gotor |
| 2543 |
\BKM@EscapeString\BKM@DO@gotor |
| 2544 |
\edef\BKM@action{% |
| 2545 |
user{% |
| 2546 |
<<% |
| 2547 |
/S/GoToR% |
| 2548 |
/F(\BKM@DO@gotor)% |
| 2549 |
\BKM@action |
| 2550 |
>>% |
| 2551 |
}% |
| 2552 |
}% |
| 2553 |
\fi |
| 2554 |
%<pdftex> \pdfoutline\BKM@attr\BKM@action |
| 2555 |
%<luatex> \pdfextension outline\BKM@attr\BKM@action |
| 2556 |
count\ifBKM@DO@open\else-\fi\BKM@x@childs |
| 2557 |
{\BKM@DO@title}% |
| 2558 |
\endgroup |
| 2559 |
} |
| 2560 |
% \end{macrocode} |
| 2561 |
% \end{macro} |
| 2562 |
% \begin{macro}[int]{\BKM@DefGotoNameAction} |
| 2563 |
% Macro \cs{BKM@DefGotoNameAction} is a hook for |
| 2564 |
% package \xpackage{hypdestopt}. |
| 2565 |
% \begin{macrocode} |
| 2566 |
\def\BKM@DefGotoNameAction#1#2{% |
| 2567 |
\BKM@EscapeString\BKM@DO@dest |
| 2568 |
\edef#1{goto name{#2}}% |
| 2569 |
} |
| 2570 |
% \end{macrocode} |
| 2571 |
% If tagging is active we use also structure destinations. |
| 2572 |
% If hypdestopt is actually used this will be overwritten again. |
| 2573 |
% \begin{macrocode} |
| 2574 |
\ExplSyntaxOn |
| 2575 |
\IfDocumentMetadataTF |
| 2576 |
{ |
| 2577 |
\tag_if_active:T |
| 2578 |
{ |
| 2579 |
\def\BKM@DefGotoNameAction#1#2 |
| 2580 |
{ |
| 2581 |
\BKM@EscapeString\BKM@DO@dest |
| 2582 |
\edef#1{goto~struct~name~{#2}~name~{#2}}% |
| 2583 |
} |
| 2584 |
} |
| 2585 |
}{} |
| 2586 |
\ExplSyntaxOff |
| 2587 |
% \end{macrocode} |
| 2588 |
% \end{macro} |
| 2589 |
% \begin{macrocode} |
| 2590 |
%</pdftex|luatex> |
| 2591 |
% \end{macrocode} |
| 2592 |
% |
| 2593 |
% \begin{macrocode} |
| 2594 |
%<*pdftex|luatex|pdfmark> |
| 2595 |
% \end{macrocode} |
| 2596 |
% \begin{macro}[int]{\BKM@SourceLocation} |
| 2597 |
% \begin{macrocode} |
| 2598 |
\def\BKM@SourceLocation{% |
| 2599 |
\ifx\BKM@DO@srcfile\@empty |
| 2600 |
\ifx\BKM@DO@srcline\@empty |
| 2601 |
\else |
| 2602 |
.\MessageBreak |
| 2603 |
Source: line \BKM@DO@srcline |
| 2604 |
\fi |
| 2605 |
\else |
| 2606 |
\ifx\BKM@DO@srcline\@empty |
| 2607 |
.\MessageBreak |
| 2608 |
Source: file `\BKM@DO@srcfile'% |
| 2609 |
\else |
| 2610 |
.\MessageBreak |
| 2611 |
Source: file `\BKM@DO@srcfile', line \BKM@DO@srcline |
| 2612 |
\fi |
| 2613 |
\fi |
| 2614 |
} |
| 2615 |
% \end{macrocode} |
| 2616 |
% \end{macro} |
| 2617 |
% \begin{macrocode} |
| 2618 |
%</pdftex|luatex|pdfmark> |
| 2619 |
% \end{macrocode} |
| 2620 |
% |
| 2621 |
% \subsection{Drivers with pdfmark specials} |
| 2622 |
% |
| 2623 |
% \subsubsection{Driver dvips} |
| 2624 |
% The dvips driver uses PSfile to include the bookmark to resolve a |
| 2625 |
% clash with pgf, see |
| 2626 |
% https://github.com/pgf-tikz/pgf/issues/944\#issuecomment-723099952 |
| 2627 |
% \begin{macrocode} |
| 2628 |
%<*dvips> |
| 2629 |
\NeedsTeXFormat{LaTeX2e} |
| 2630 |
\ProvidesFile{bkm-dvips.def}% |
| 2631 |
[2026-05-21 v1.32 bookmark driver for dvips (HO)]% |
| 2632 |
% \end{macrocode} |
| 2633 |
% \begin{macro}[int]{\BKM@PSHeaderFile} |
| 2634 |
% \begin{macrocode} |
| 2635 |
\def\BKM@PSHeaderFile#1{% |
| 2636 |
\special{PSfile=#1}% |
| 2637 |
} |
| 2638 |
% \end{macrocode} |
| 2639 |
% \begin{macro}[int]{\BKM@filename} |
| 2640 |
% \begin{macrocode} |
| 2641 |
\def\BKM@filename{\jobname.out.ps} |
| 2642 |
% \end{macrocode} |
| 2643 |
% \end{macro} |
| 2644 |
% \begin{macrocode} |
| 2645 |
\AddToHook{shipout/lastpage}{% |
| 2646 |
\BKM@pdfmark@out |
| 2647 |
\BKM@PSHeaderFile\BKM@filename |
| 2648 |
} |
| 2649 |
% \end{macrocode} |
| 2650 |
% \end{macro} |
| 2651 |
% \begin{macrocode} |
| 2652 |
%</dvips> |
| 2653 |
% \end{macrocode} |
| 2654 |
% |
| 2655 |
% \subsubsection{Common part} |
| 2656 |
% |
| 2657 |
% \begin{macrocode} |
| 2658 |
%<*pdfmark> |
| 2659 |
% \end{macrocode} |
| 2660 |
% |
| 2661 |
% \begin{macro}[int]{\BKM@pdfmark@out} |
| 2662 |
% Do not use package \xpackage{rerunfilecheck} here, because |
| 2663 |
% the file \cs{BKM@filename} is not read during the \hologo{TeX} run. |
| 2664 |
% \begin{macrocode} |
| 2665 |
\def\BKM@pdfmark@out{% |
| 2666 |
\if@filesw |
| 2667 |
\newwrite\BKM@file |
| 2668 |
\immediate\openout\BKM@file=\BKM@filename\relax |
| 2669 |
\BKM@write{\@percentchar!}% |
| 2670 |
\BKM@write{/pdfmark where{pop}}% |
| 2671 |
\BKM@write{% |
| 2672 |
{% |
| 2673 |
/globaldict where{pop globaldict}{userdict}ifelse% |
| 2674 |
/pdfmark/cleartomark load put% |
| 2675 |
}% |
| 2676 |
}% |
| 2677 |
\BKM@write{ifelse}% |
| 2678 |
\else |
| 2679 |
\let\BKM@write\@gobble |
| 2680 |
\let\BKM@DO@entry\@gobbletwo |
| 2681 |
\fi |
| 2682 |
} |
| 2683 |
% \end{macrocode} |
| 2684 |
% \end{macro} |
| 2685 |
% \begin{macro}[int]{\BKM@write} |
| 2686 |
% \begin{macrocode} |
| 2687 |
\def\BKM@write#{% |
| 2688 |
\immediate\write\BKM@file |
| 2689 |
} |
| 2690 |
% \end{macrocode} |
| 2691 |
% \end{macro} |
| 2692 |
% |
| 2693 |
% \begin{macro}[int]{\BKM@DO@entry} |
| 2694 |
% The specification for pdfmark says that |/Color| is the |
| 2695 |
% name of the key for color, however ghostscript only passes |
| 2696 |
% the key into the PDF file, thus the key name must be |/C|. |
| 2697 |
% \begin{macrocode} |
| 2698 |
\def\BKM@DO@entry#1#2{% |
| 2699 |
\begingroup |
| 2700 |
\SetKeys[BKM@DO]{#1}% |
| 2701 |
\ifx\BKM@DO@srcfile\@empty |
| 2702 |
\else |
| 2703 |
\BKM@UnescapeHex\BKM@DO@srcfile |
| 2704 |
\fi |
| 2705 |
\def\BKM@DO@title{#2}% |
| 2706 |
\BKM@UnescapeHex\BKM@DO@title |
| 2707 |
\expandafter\expandafter\expandafter\BKM@getx |
| 2708 |
\csname BKM@\BKM@DO@id\endcsname\@empty\@empty |
| 2709 |
\let\BKM@attr\@empty |
| 2710 |
\ifx\BKM@DO@flags\@empty |
| 2711 |
\else |
| 2712 |
\edef\BKM@attr{\BKM@attr/F \BKM@DO@flags}% |
| 2713 |
\fi |
| 2714 |
\ifx\BKM@DO@color\@empty |
| 2715 |
\else |
| 2716 |
\edef\BKM@attr{\BKM@attr/C[\BKM@DO@color]}% |
| 2717 |
\fi |
| 2718 |
\let\BKM@action\@empty |
| 2719 |
\ifx\BKM@DO@gotor\@empty |
| 2720 |
\ifx\BKM@DO@dest\@empty |
| 2721 |
\ifx\BKM@DO@named\@empty |
| 2722 |
\ifx\BKM@DO@rawaction\@empty |
| 2723 |
\ifx\BKM@DO@uri\@empty |
| 2724 |
\ifx\BKM@DO@page\@empty |
| 2725 |
\PackageError{bookmark}{% |
| 2726 |
Missing action\BKM@SourceLocation |
| 2727 |
}\@ehc |
| 2728 |
\edef\BKM@action{% |
| 2729 |
/Action/GoTo% |
| 2730 |
/Page 1% |
| 2731 |
/View[/Fit]% |
| 2732 |
}% |
| 2733 |
\else |
| 2734 |
\ifx\BKM@DO@view\@empty |
| 2735 |
\def\BKM@DO@view{Fit}% |
| 2736 |
\fi |
| 2737 |
\edef\BKM@action{% |
| 2738 |
/Action/GoTo% |
| 2739 |
/Page \BKM@DO@page |
| 2740 |
/View[/\BKM@DO@view]% |
| 2741 |
}% |
| 2742 |
\fi |
| 2743 |
\else |
| 2744 |
\BKM@UnescapeHex\BKM@DO@uri |
| 2745 |
\BKM@EscapeString\BKM@DO@uri |
| 2746 |
\edef\BKM@action{% |
| 2747 |
/Action<<% |
| 2748 |
/Subtype/URI% |
| 2749 |
/URI(\BKM@DO@uri)% |
| 2750 |
>>% |
| 2751 |
}% |
| 2752 |
\fi |
| 2753 |
\else |
| 2754 |
\BKM@UnescapeHex\BKM@DO@rawaction |
| 2755 |
\edef\BKM@action{% |
| 2756 |
/Action<<% |
| 2757 |
\BKM@DO@rawaction |
| 2758 |
>>% |
| 2759 |
}% |
| 2760 |
\fi |
| 2761 |
\else |
| 2762 |
\BKM@EscapeName\BKM@DO@named |
| 2763 |
\edef\BKM@action{% |
| 2764 |
/Action<<% |
| 2765 |
/Subtype/Named% |
| 2766 |
/N/\BKM@DO@named |
| 2767 |
>>% |
| 2768 |
}% |
| 2769 |
\fi |
| 2770 |
\else |
| 2771 |
\BKM@UnescapeHex\BKM@DO@dest |
| 2772 |
\BKM@EscapeString\BKM@DO@dest |
| 2773 |
\edef\BKM@action{% |
| 2774 |
/Action/GoTo% |
| 2775 |
/Dest(\BKM@DO@dest)cvn% |
| 2776 |
}% |
| 2777 |
\fi |
| 2778 |
\else |
| 2779 |
\ifx\BKM@DO@dest\@empty |
| 2780 |
\ifx\BKM@DO@page\@empty |
| 2781 |
\def\BKM@DO@page{1}% |
| 2782 |
\fi |
| 2783 |
\ifx\BKM@DO@view\@empty |
| 2784 |
\def\BKM@DO@view{Fit}% |
| 2785 |
\fi |
| 2786 |
\edef\BKM@action{% |
| 2787 |
/Page \BKM@DO@page |
| 2788 |
/View[/\BKM@DO@view]% |
| 2789 |
}% |
| 2790 |
\else |
| 2791 |
\BKM@UnescapeHex\BKM@DO@dest |
| 2792 |
\BKM@EscapeString\BKM@DO@dest |
| 2793 |
\edef\BKM@action{% |
| 2794 |
/Dest(\BKM@DO@dest)cvn% |
| 2795 |
}% |
| 2796 |
\fi |
| 2797 |
\BKM@UnescapeHex\BKM@DO@gotor |
| 2798 |
\BKM@EscapeString\BKM@DO@gotor |
| 2799 |
\edef\BKM@action{% |
| 2800 |
/Action/GoToR% |
| 2801 |
/File(\BKM@DO@gotor)% |
| 2802 |
\BKM@action |
| 2803 |
}% |
| 2804 |
\fi |
| 2805 |
\BKM@write{[}% |
| 2806 |
\BKM@write{/Title(\BKM@DO@title)}% |
| 2807 |
\ifnum\BKM@x@childs>\z@ |
| 2808 |
\BKM@write{/Count \ifBKM@DO@open\else-\fi\BKM@x@childs}% |
| 2809 |
\fi |
| 2810 |
\ifx\BKM@attr\@empty |
| 2811 |
\else |
| 2812 |
\BKM@write{\BKM@attr}% |
| 2813 |
\fi |
| 2814 |
\BKM@write{\BKM@action}% |
| 2815 |
\BKM@write{/OUT pdfmark}% |
| 2816 |
\endgroup |
| 2817 |
} |
| 2818 |
% \end{macrocode} |
| 2819 |
% \end{macro} |
| 2820 |
% \begin{macrocode} |
| 2821 |
%</pdfmark> |
| 2822 |
% \end{macrocode} |
| 2823 |
% |
| 2824 |
% \subsection{Common part for \xoption{pdftex} and \xoption{pdfmark}} |
| 2825 |
% |
| 2826 |
% \begin{macrocode} |
| 2827 |
%<*pdftex|luatex|pdfmark> |
| 2828 |
% \end{macrocode} |
| 2829 |
% |
| 2830 |
% \subsubsection{Write auxiliary file} |
| 2831 |
% |
| 2832 |
% \begin{macrocode} |
| 2833 |
\AddToHook{begindocument}{% |
| 2834 |
\immediate\write\@mainaux{\string\providecommand\string\BKM@entry[2]{}}} |
| 2835 |
% \end{macrocode} |
| 2836 |
% |
| 2837 |
% \begin{macro}[int]{\BKM@id} |
| 2838 |
% \begin{macrocode} |
| 2839 |
\newcount\BKM@id |
| 2840 |
\BKM@id=\z@ |
| 2841 |
% \end{macrocode} |
| 2842 |
% \end{macro} |
| 2843 |
% |
| 2844 |
% \begin{macro}[int]{\BKM@0} |
| 2845 |
% \begin{macrocode} |
| 2846 |
\@namedef{BKM@0}{000} |
| 2847 |
% \end{macrocode} |
| 2848 |
% \end{macro} |
| 2849 |
% \begin{macro}[int]{\ifBKM@sw} |
| 2850 |
% \begin{macrocode} |
| 2851 |
\newif\ifBKM@sw |
| 2852 |
% \end{macrocode} |
| 2853 |
% \end{macro} |
| 2854 |
% |
| 2855 |
% \begin{macro}{\bookmark} |
| 2856 |
% \begin{macrocode} |
| 2857 |
\newcommand*{\bookmark}[2][]{% |
| 2858 |
\if@filesw |
| 2859 |
\begingroup |
| 2860 |
\BKM@InitSourceLocation |
| 2861 |
\def\bookmark@text{#2}% |
| 2862 |
\BKM@setup{#1}% |
| 2863 |
\ifx\BKM@srcfile\@empty |
| 2864 |
\else |
| 2865 |
\BKM@EscapeHex\BKM@srcfile |
| 2866 |
\fi |
| 2867 |
\edef\BKM@prev{\the\BKM@id}% |
| 2868 |
\global\advance\BKM@id\@ne |
| 2869 |
\BKM@swtrue |
| 2870 |
\@whilesw\ifBKM@sw\fi{% |
| 2871 |
\ifnum\ifBKM@startatroot\z@\else\BKM@prev\fi=\z@ |
| 2872 |
\BKM@startatrootfalse |
| 2873 |
\expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% |
| 2874 |
0{\BKM@level}0% |
| 2875 |
}% |
| 2876 |
\BKM@swfalse |
| 2877 |
\else |
| 2878 |
\expandafter\expandafter\expandafter\BKM@getx |
| 2879 |
\csname BKM@\BKM@prev\endcsname |
| 2880 |
\ifnum\BKM@level>\BKM@x@level\relax |
| 2881 |
\expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% |
| 2882 |
{\BKM@prev}{\BKM@level}0% |
| 2883 |
}% |
| 2884 |
\ifnum\BKM@prev>\z@ |
| 2885 |
\BKM@CalcExpr\BKM@CalcResult\BKM@x@childs+1% |
| 2886 |
\expandafter\xdef\csname BKM@\BKM@prev\endcsname{% |
| 2887 |
{\BKM@x@parent}{\BKM@x@level}{\BKM@CalcResult}% |
| 2888 |
}% |
| 2889 |
\fi |
| 2890 |
\BKM@swfalse |
| 2891 |
\else |
| 2892 |
\let\BKM@prev\BKM@x@parent |
| 2893 |
\fi |
| 2894 |
\fi |
| 2895 |
}% |
| 2896 |
\pdfstringdef\BKM@title{\bookmark@text}% |
| 2897 |
\edef\BKM@FLAGS{\BKM@PrintStyle}% |
| 2898 |
\csname BKM@HypDestOptHook\endcsname |
| 2899 |
\BKM@EscapeHex\BKM@dest |
| 2900 |
\BKM@EscapeHex\BKM@uri |
| 2901 |
\BKM@EscapeHex\BKM@gotor |
| 2902 |
\BKM@EscapeHex\BKM@rawaction |
| 2903 |
\BKM@EscapeHex\BKM@title |
| 2904 |
\immediate\write\@mainaux{% |
| 2905 |
\string\BKM@entry{% |
| 2906 |
id=\number\BKM@id |
| 2907 |
\ifBKM@open |
| 2908 |
\ifnum\BKM@level<\BKM@openlevel |
| 2909 |
,open% |
| 2910 |
\fi |
| 2911 |
\fi |
| 2912 |
\BKM@auxentry{dest}% |
| 2913 |
\BKM@auxentry{named}% |
| 2914 |
\BKM@auxentry{uri}% |
| 2915 |
\BKM@auxentry{gotor}% |
| 2916 |
\BKM@auxentry{page}% |
| 2917 |
\BKM@auxentry{view}% |
| 2918 |
\BKM@auxentry{rawaction}% |
| 2919 |
\BKM@auxentry{color}% |
| 2920 |
\ifnum\BKM@FLAGS>\z@ |
| 2921 |
,flags=\BKM@FLAGS |
| 2922 |
\fi |
| 2923 |
\BKM@auxentry{srcline}% |
| 2924 |
\BKM@auxentry{srcfile}% |
| 2925 |
}{\BKM@title}% |
| 2926 |
}% |
| 2927 |
\endgroup |
| 2928 |
\fi |
| 2929 |
} |
| 2930 |
% \end{macrocode} |
| 2931 |
% \end{macro} |
| 2932 |
% \begin{macro}[int]{\BKM@getx} |
| 2933 |
% \begin{macrocode} |
| 2934 |
\def\BKM@getx#1#2#3{% |
| 2935 |
\def\BKM@x@parent{#1}% |
| 2936 |
\def\BKM@x@level{#2}% |
| 2937 |
\def\BKM@x@childs{#3}% |
| 2938 |
} |
| 2939 |
% \end{macrocode} |
| 2940 |
% \end{macro} |
| 2941 |
% \begin{macro}[int]{\BKM@auxentry} |
| 2942 |
% \begin{macrocode} |
| 2943 |
\def\BKM@auxentry#1{% |
| 2944 |
\expandafter\ifx\csname BKM@#1\endcsname\@empty |
| 2945 |
\else |
| 2946 |
,#1={\csname BKM@#1\endcsname}% |
| 2947 |
\fi |
| 2948 |
} |
| 2949 |
% \end{macrocode} |
| 2950 |
% \end{macro} |
| 2951 |
% |
| 2952 |
% \begin{macro}[int]{\BKM@InitSourceLocation} |
| 2953 |
% \begin{macrocode} |
| 2954 |
\def\BKM@InitSourceLocation{% |
| 2955 |
\edef\BKM@srcline{\the\inputlineno}% |
| 2956 |
\BKM@LuaTeX@InitFile |
| 2957 |
\ifx\BKM@srcfile\@empty |
| 2958 |
\@ifundefined{currfilepath}{}{% |
| 2959 |
\edef\BKM@srcfile{\currfilepath}% |
| 2960 |
}% |
| 2961 |
\fi |
| 2962 |
} |
| 2963 |
% \end{macrocode} |
| 2964 |
% \end{macro} |
| 2965 |
% \begin{macro}[int]{\BKM@LuaTeX@InitFile} |
| 2966 |
% \begin{macrocode} |
| 2967 |
%<luatex>\def\BKM@LuaTeX@InitFile{% |
| 2968 |
%<luatex> \begingroup |
| 2969 |
%<luatex> \toks@={}% |
| 2970 |
%<luatex> \edef\x{\endgroup |
| 2971 |
%<luatex> \def\noexpand\BKM@srcfile{% |
| 2972 |
%<luatex> \the\expandafter\toks@ |
| 2973 |
%<luatex> \directlua{% |
| 2974 |
%<luatex> if status and status.filename then % |
| 2975 |
%<luatex> tex.settoks('toks@', status.filename)% |
| 2976 |
%<luatex> end% |
| 2977 |
%<luatex> }% |
| 2978 |
%<luatex> }% |
| 2979 |
%<luatex> }\x |
| 2980 |
%<luatex>}% |
| 2981 |
%<pdftex|pdfmark>\let\BKM@LuaTeX@InitFile\relax |
| 2982 |
|
| 2983 |
% \end{macrocode} |
| 2984 |
% \end{macro} |
| 2985 |
% |
| 2986 |
% \subsubsection{Read auxiliary data} |
| 2987 |
% |
| 2988 |
% \begin{macrocode} |
| 2989 |
\DeclareKeys[BKM@DO] |
| 2990 |
{ |
| 2991 |
,id .tl_set:N=\BKM@DO@id |
| 2992 |
,id .initial:n = 0 |
| 2993 |
,open .legacy_if_set:n = BKM@DO@open |
| 2994 |
,flags.tl_set:N=\BKM@DO@flags |
| 2995 |
,color.tl_set:N=\BKM@DO@color |
| 2996 |
,dest .tl_set:N=\BKM@DO@dest |
| 2997 |
,named.tl_set:N=\BKM@DO@named |
| 2998 |
,uri .tl_set:N=\BKM@DO@uri |
| 2999 |
,gotor.tl_set:N=\BKM@DO@gotor |
| 3000 |
,page .tl_set:N=\BKM@DO@page |
| 3001 |
,view .tl_set:N=\BKM@DO@view |
| 3002 |
,rawaction.tl_set:N=\BKM@DO@rawaction |
| 3003 |
,srcline.tl_set:N=\BKM@DO@srcline |
| 3004 |
,srcfile.tl_set:N=\BKM@DO@srcfile |
| 3005 |
} |
| 3006 |
% \end{macrocode} |
| 3007 |
% |
| 3008 |
% \begin{macrocode} |
| 3009 |
\AtBeginDocument{% |
| 3010 |
\let\BKM@entry\BKM@DO@entry |
| 3011 |
} |
| 3012 |
% \end{macrocode} |
| 3013 |
% |
| 3014 |
% \begin{macrocode} |
| 3015 |
%</pdftex|luatex|pdfmark> |
| 3016 |
% \end{macrocode} |
| 3017 |
% |
| 3018 |
% \subsection{Option \xoption{atend}} |
| 3019 |
% |
| 3020 |
% \subsubsection{Hook} |
| 3021 |
% |
| 3022 |
% \begin{macrocode} |
| 3023 |
%<*package> |
| 3024 |
% \end{macrocode} |
| 3025 |
% \begin{macrocode} |
| 3026 |
\ifBKM@atend |
| 3027 |
\else |
| 3028 |
% \end{macrocode} |
| 3029 |
% \begin{macro}{\BookmarkAtEnd} |
| 3030 |
% This is a dummy definition that generates a warning |
| 3031 |
% if option \xoption{atend} has not been given. |
| 3032 |
% \begin{macrocode} |
| 3033 |
\newcommand{\BookmarkAtEnd}[1]{% |
| 3034 |
\PackageWarning{bookmark}{% |
| 3035 |
Ignored, because option `atend' is missing% |
| 3036 |
}% |
| 3037 |
}% |
| 3038 |
% \end{macrocode} |
| 3039 |
% \end{macro} |
| 3040 |
% \begin{macrocode} |
| 3041 |
\expandafter\endinput |
| 3042 |
\fi |
| 3043 |
% \end{macrocode} |
| 3044 |
% \begin{macro}{\BookmarkAtEnd} |
| 3045 |
% \begin{macrocode} |
| 3046 |
\newcommand*{\BookmarkAtEnd}{% |
| 3047 |
\g@addto@macro\BKM@EndHook |
| 3048 |
} |
| 3049 |
% \end{macrocode} |
| 3050 |
% \end{macro} |
| 3051 |
% \begin{macrocode} |
| 3052 |
\let\BKM@EndHook\@empty |
| 3053 |
% \end{macrocode} |
| 3054 |
% \begin{macrocode} |
| 3055 |
%</package> |
| 3056 |
% \end{macrocode} |
| 3057 |
% |
| 3058 |
% \subsubsection{Drivers using hooks at end of document} |
| 3059 |
% |
| 3060 |
% Driver \xoption{pdftex} use the LaTeX hook \hook{enddocument/afterlastpage} |
| 3061 |
% (which is equivalent to the previously used |
| 3062 |
% \cs{AfterLastShipout} of \xpackage{atveryend}'s), |
| 3063 |
% because it still needs the \xext{aux} file. It uses |
| 3064 |
% \cs{pdfoutline} for the bookmarks that can be used after the last page. |
| 3065 |
% \begin{itemize} |
| 3066 |
% \item |
| 3067 |
% Driver \xoption{pdftex} uses \cs{pdfoutline} that can |
| 3068 |
% be used after the last page. |
| 3069 |
% \end{itemize} |
| 3070 |
% \begin{macrocode} |
| 3071 |
%<*pdftex|luatex> |
| 3072 |
\ifBKM@atend |
| 3073 |
\AddToHook{enddocument/afterlastpage}{% |
| 3074 |
\BKM@EndHook |
| 3075 |
}% |
| 3076 |
\fi |
| 3077 |
%</pdftex|luatex> |
| 3078 |
% \end{macrocode} |
| 3079 |
% |
| 3080 |
% \subsubsection{Drivers using \hook{shipout/lastpage}} |
| 3081 |
% |
| 3082 |
% The other drivers implement \cs{bookmark} using \cs{special} |
| 3083 |
% commands. Thus the last bookmarks must be put on the last page, |
| 3084 |
% not afterwards. |
| 3085 |
% \cs{AtEndDocument} cannot be used, because it is too late, the |
| 3086 |
% last page can already be output. Therefore we use the |
| 3087 |
% LaTeX hook \hook{shipout/lastpage}. |
| 3088 |
% At least two \hologo{LaTeX} runs are necessary. |
| 3089 |
% The postscript driver \xoption{dvips} use an external PostScript file |
| 3090 |
% for the bookmarks. The file writing has been moved to the |
| 3091 |
% the last shipout page too to avoid conflicts with pgf. |
| 3092 |
% \begin{macrocode} |
| 3093 |
%<*dvipdfmx|xetex|vtex|pdfmark> |
| 3094 |
\ifBKM@atend |
| 3095 |
\AddToHook{shipout/lastpage}{\BKM@EndHook}% |
| 3096 |
\fi |
| 3097 |
%</dvipdfmx|xetex|vtex|pdfmark> |
| 3098 |
% \end{macrocode} |
| 3099 |
% |
| 3100 |
% \section{Installation} |
| 3101 |
% |
| 3102 |
% \subsection{Download} |
| 3103 |
% |
| 3104 |
% \paragraph{Package.} This package is available on |
| 3105 |
% CTAN\footnote{\CTANpkg{bookmark}}: |
| 3106 |
% \begin{description} |
| 3107 |
% \item[\CTAN{macros/latex/contrib/bookmark/bookmark.dtx}] The source file. |
| 3108 |
% \item[\CTAN{macros/latex/contrib/bookmark/bookmark.ins}] Installation driver. |
| 3109 |
% \item[\CTAN{macros/latex/contrib/bookmark/bookmark.pdf}] Documentation. |
| 3110 |
% \end{description} |
| 3111 |
% |
| 3112 |
% \subsection{Package installation} |
| 3113 |
% |
| 3114 |
% The easiest is to use the package manager from your TeX system. If |
| 3115 |
% you want to install manually: |
| 3116 |
% |
| 3117 |
% \paragraph{Unpacking.} The \xfile{.dtx} file is |
| 3118 |
% \docstrip\ archive. The files are extracted from the \xfile{.dtx} |
| 3119 |
% by compiling the file with some TeX program. |
| 3120 |
% \begin{quote} |
| 3121 |
% \verb|pdflatex bookmark.dtx| |
| 3122 |
% \end{quote} |
| 3123 |
% |
| 3124 |
% \paragraph{TDS.} Now the different files must be moved into |
| 3125 |
% the different directories in your installation TDS tree |
| 3126 |
% (also known as \xfile{texmf} tree): |
| 3127 |
% \begin{quote} |
| 3128 |
% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} |
| 3129 |
% bookmark.sty & tex/latex/bookmark/bookmark.sty\\ |
| 3130 |
% bkm-dvipdfmx.def & tex/latex/bookmark/bkm-dvipdfmx.def\\ |
| 3131 |
% bkm-dvips.def & tex/latex/bookmark/bkm-dvips.def\\ |
| 3132 |
% bkm-pdftex.def & tex/latex/bookmark/bkm-pdftex.def\\ |
| 3133 |
% bkm-luatex.def & tex/latex/bookmark/bkm-luatex.def\\ |
| 3134 |
% bkm-xetex.def & tex/latex/bookmark/bkm-xetex.def\\ |
| 3135 |
% bkm-vtex.def & tex/latex/bookmark/bkm-vtex.def\\ |
| 3136 |
% bookmark.pdf & doc/latex/bookmark/bookmark.pdf\\ |
| 3137 |
% bookmark-example.tex & doc/latex/bookmark/bookmark-example.tex\\ |
| 3138 |
% bookmark.dtx & source/latex/bookmark/bookmark.dtx\\ |
| 3139 |
% \end{tabular} |
| 3140 |
% \end{quote} |
| 3141 |
% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's |
| 3142 |
% TDS installing feature, then some files can already be in the right |
| 3143 |
% place, see the documentation of \docstrip. |
| 3144 |
% |
| 3145 |
% \subsection{Refresh file name databases} |
| 3146 |
% |
| 3147 |
% If your \TeX~distribution |
| 3148 |
% (\hologo{TeXLive}, \hologo{MiKTeX}, \dots) relies on file name databases, you must refresh |
| 3149 |
% these. For example, \hologo{TeXLive}\ users run \verb|texhash| or |
| 3150 |
% \verb|mktexlsr|. |
| 3151 |
% |
| 3152 |
% \paragraph{Generating the documentation.} |
| 3153 |
% You can use the \xfile{.dtx} to generate |
| 3154 |
% the documentation. As the documentation is now tagged, |
| 3155 |
% lua\LaTeX\ should be used and a current \TeX-system is required. |
| 3156 |
% \begin{quote} |
| 3157 |
%\begin{verbatim} |
| 3158 |
% lualatex bookmark.dtx |
| 3159 |
% makeindex -s gind.ist bookmark.idx |
| 3160 |
% lualatex bookmark.dtx |
| 3161 |
% lualatex bookmark.dtx |
| 3162 |
% lualatex bookmark.dtx |
| 3163 |
%\end{verbatim} |
| 3164 |
% \end{quote} |
| 3165 |
% |
| 3166 |
% \begin{thebibliography}{9} |
| 3167 |
% |
| 3168 |
% \bibitem{hyperref} |
| 3169 |
% Sebastian Rahtz, Heiko Oberdiek, The \LaTeX\ project: |
| 3170 |
% \textit{The \xpackage{hyperref} package}; |
| 3171 |
% 2026-04-24 v7.01q; |
| 3172 |
% \CTANpkg{hyperref} |
| 3173 |
% |
| 3174 |
% \bibitem{currfile} |
| 3175 |
% Martin Scharrer: |
| 3176 |
% \textit{The \xpackage{currfile} package}; |
| 3177 |
% 2024/03/14 v1.0. |
| 3178 |
% \CTANpkg{currfile} |
| 3179 |
% |
| 3180 |
% \end{thebibliography} |
| 3181 |
% |
| 3182 |
% \begin{History} |
| 3183 |
% \begin{Version}{2007/02/19 v0.1} |
| 3184 |
% \item |
| 3185 |
% First experimental version. |
| 3186 |
% \end{Version} |
| 3187 |
% \begin{Version}{2007/02/20 v0.2} |
| 3188 |
% \item |
| 3189 |
% Option \xoption{startatroot} added. |
| 3190 |
% \item |
| 3191 |
% Dummies for \cs{pdf(un)escape...} commands added to get |
| 3192 |
% the package basically work for non-\hologo{pdfTeX} users. |
| 3193 |
% \end{Version} |
| 3194 |
% \begin{Version}{2007/02/21 v0.3} |
| 3195 |
% \item |
| 3196 |
% Dependency from \hologo{pdfTeX} 1.30 removed by using package |
| 3197 |
% \xpackage{pdfescape}. |
| 3198 |
% \end{Version} |
| 3199 |
% \begin{Version}{2007/02/22 v0.4} |
| 3200 |
% \item |
| 3201 |
% \xpackage{hyperref}'s \xoption{bookmarkstype} respected. |
| 3202 |
% \end{Version} |
| 3203 |
% \begin{Version}{2007/03/02 v0.5} |
| 3204 |
% \item |
| 3205 |
% Driver options \xoption{vtex} (PDF mode), \xoption{dvipsone}, |
| 3206 |
% and \xoption{textures} added. |
| 3207 |
% \item |
| 3208 |
% Implementation of option \xoption{depth} completed. Division names |
| 3209 |
% are supported, see \xpackage{hyperref}'s |
| 3210 |
% option \xoption{bookmarksdepth}. |
| 3211 |
% \item |
| 3212 |
% \xpackage{hyperref}'s options \xoption{bookmarksopen}, |
| 3213 |
% \xoption{bookmarksopenlevel}, and \xoption{bookmarksdepth} respected. |
| 3214 |
% \end{Version} |
| 3215 |
% \begin{Version}{2007/03/03 v0.6} |
| 3216 |
% \item |
| 3217 |
% Option \xoption{numbered} as alias for \xpackage{hyperref}'s |
| 3218 |
% \xoption{bookmarksnumbered}. |
| 3219 |
% \end{Version} |
| 3220 |
% \begin{Version}{2007/03/07 v0.7} |
| 3221 |
% \item |
| 3222 |
% Dependency from \hologo{eTeX} removed. |
| 3223 |
% \end{Version} |
| 3224 |
% \begin{Version}{2007/04/09 v0.8} |
| 3225 |
% \item |
| 3226 |
% Option \xoption{atend} added. |
| 3227 |
% \item |
| 3228 |
% Option \xoption{rgbcolor} removed. |
| 3229 |
% \verb|rgbcolor=<r> <g> <b>| can be replaced by |
| 3230 |
% \verb|color=[rgb]{<r>,<g>,<b>}|. |
| 3231 |
% \item |
| 3232 |
% Support of recent cvs version (2007-03-29) of dvipdfmx |
| 3233 |
% that extends the \cs{special} for bookmarks to specify |
| 3234 |
% open outline entries. Option \xoption{dvipdfmx-outline-open} |
| 3235 |
% or \cs{SpecialDvipdfmxOutlineOpen} notify the package. |
| 3236 |
% \end{Version} |
| 3237 |
% \begin{Version}{2007/04/25 v0.9} |
| 3238 |
% \item |
| 3239 |
% The syntax of \cs{special} of dvipdfmx, if feature |
| 3240 |
% \xoption{dvipdfmx-outline-open} is enabled, has changed. |
| 3241 |
% Now cvs version 2007-04-25 is needed. |
| 3242 |
% \end{Version} |
| 3243 |
% \begin{Version}{2007/05/29 v1.0} |
| 3244 |
% \item |
| 3245 |
% Bug fix in code for second parameter of XYZ. |
| 3246 |
% \end{Version} |
| 3247 |
% \begin{Version}{2007/07/13 v1.1} |
| 3248 |
% \item |
| 3249 |
% Fix for pdfmark with GoToR action. |
| 3250 |
% \end{Version} |
| 3251 |
% \begin{Version}{2007/09/25 v1.2} |
| 3252 |
% \item |
| 3253 |
% pdfmark driver respects \cs{nofiles}. |
| 3254 |
% \end{Version} |
| 3255 |
% \begin{Version}{2008/08/08 v1.3} |
| 3256 |
% \item |
| 3257 |
% Package \xpackage{flags} replaced by package \xpackage{bitset}. |
| 3258 |
% Now flags are also supported without \hologo{eTeX}. |
| 3259 |
% \item |
| 3260 |
% Hook for package \xpackage{hypdestopt} added. |
| 3261 |
% \end{Version} |
| 3262 |
% \begin{Version}{2008/09/13 v1.4} |
| 3263 |
% \item |
| 3264 |
% Fix for bug introduced in v1.3, package \xpackage{flags} is one-based, |
| 3265 |
% but package \xpackage{bitset} is zero-based. Thus options \xoption{bold} |
| 3266 |
% and \xoption{italic} are wrong in v1.3. (Daniel M\"ullner) |
| 3267 |
% \end{Version} |
| 3268 |
% \begin{Version}{2009/08/13 v1.5} |
| 3269 |
% \item |
| 3270 |
% Except for driver options the other options are now local options. |
| 3271 |
% This resolves a problem with KOMA-Script v3.00 and its option \xoption{open}. |
| 3272 |
% \end{Version} |
| 3273 |
% \begin{Version}{2009/12/06 v1.6} |
| 3274 |
% \item |
| 3275 |
% Use of package \xpackage{atveryend} for drivers \xoption{pdftex} |
| 3276 |
% and \xoption{pdfmark}. |
| 3277 |
% \end{Version} |
| 3278 |
% \begin{Version}{2009/12/07 v1.7} |
| 3279 |
% \item |
| 3280 |
% Use of package \xpackage{atveryend} fixed. |
| 3281 |
% \end{Version} |
| 3282 |
% \begin{Version}{2009/12/17 v1.8} |
| 3283 |
% \item |
| 3284 |
% Support of \xpackage{hyperref} 2009/12/17 v6.79v for \hologo{XeTeX}. |
| 3285 |
% \end{Version} |
| 3286 |
% \begin{Version}{2010/03/30 v1.9} |
| 3287 |
% \item |
| 3288 |
% Package name in an error message fixed. |
| 3289 |
% \end{Version} |
| 3290 |
% \begin{Version}{2010/04/03 v1.10} |
| 3291 |
% \item |
| 3292 |
% Option \xoption{style} and macro \cs{bookmarkdefinestyle} added. |
| 3293 |
% \item |
| 3294 |
% Hook support with option \xoption{addtohook} added. |
| 3295 |
% \item |
| 3296 |
% \cs{bookmarkget} added. |
| 3297 |
% \end{Version} |
| 3298 |
% \begin{Version}{2010/04/04 v1.11} |
| 3299 |
% \item |
| 3300 |
% Bug fix (introduced in v1.10). |
| 3301 |
% \end{Version} |
| 3302 |
% \begin{Version}{2010/04/08 v1.12} |
| 3303 |
% \item |
| 3304 |
% Requires \xpackage{ltxcmds} 2010/04/08. |
| 3305 |
% \end{Version} |
| 3306 |
% \begin{Version}{2010/07/23 v1.13} |
| 3307 |
% \item |
| 3308 |
% Support for \xclass{memoir}'s \cs{booknumberline} added. |
| 3309 |
% \end{Version} |
| 3310 |
% \begin{Version}{2010/09/02 v1.14} |
| 3311 |
% \item |
| 3312 |
% (Local) options \xoption{draft} and \xoption{final} added. |
| 3313 |
% \end{Version} |
| 3314 |
% \begin{Version}{2010/09/25 v1.15} |
| 3315 |
% \item |
| 3316 |
% Fix for option \xoption{dvipdfmx-outline-open}. |
| 3317 |
% \item |
| 3318 |
% Option \xoption{dvipdfmx-outline-open} is set automatically, |
| 3319 |
% if XeTeX $\geq$ 0.9995 is detected. |
| 3320 |
% \end{Version} |
| 3321 |
% \begin{Version}{2010/10/19 v1.16} |
| 3322 |
% \item |
| 3323 |
% Option `startatroot' now acts globally. |
| 3324 |
% \item |
| 3325 |
% Option `level' also accepts names the same way as option `depth'. |
| 3326 |
% \end{Version} |
| 3327 |
% \begin{Version}{2010/10/25 v1.17} |
| 3328 |
% \item |
| 3329 |
% \cs{bookmarksetupnext} added. |
| 3330 |
% \item |
| 3331 |
% Using \cs{kvsetkeys} of package \xpackage{kvsetkeys}, because |
| 3332 |
% \cs{setkeys} of package \xpackage{keyval} is not reentrant. |
| 3333 |
% This can cause problems (unknown keys) with older versions of |
| 3334 |
% hyperref that also uses \cs{setkeys} (found by GL). |
| 3335 |
% \end{Version} |
| 3336 |
% \begin{Version}{2010/11/05 v1.18} |
| 3337 |
% \item |
| 3338 |
% Use of \cs{pdf@ifdraftmode} of package \xpackage{pdftexcmds} for |
| 3339 |
% the default of option \xoption{draft}. |
| 3340 |
% \end{Version} |
| 3341 |
% \begin{Version}{2011/03/20 v1.19} |
| 3342 |
% \item |
| 3343 |
% Use of \cs{dimexpr} fixed, if \hologo{eTeX} is not used. |
| 3344 |
% (Bug found by Martin M\"unch.) |
| 3345 |
% \item |
| 3346 |
% Fix in documentation. Also layout options work without \hologo{eTeX}. |
| 3347 |
% \end{Version} |
| 3348 |
% \begin{Version}{2011/04/13 v1.20} |
| 3349 |
% \item |
| 3350 |
% Bug fix: \cs{BKM@SetDepth} renamed to \cs{BKM@SetDepthOrLevel}. |
| 3351 |
% \end{Version} |
| 3352 |
% \begin{Version}{2011/04/21 v1.21} |
| 3353 |
% \item |
| 3354 |
% Some support for file name and line number in error messages |
| 3355 |
% at end of document (pdfTeX and pdfmark based drivers). |
| 3356 |
% \end{Version} |
| 3357 |
% \begin{Version}{2011/05/13 v1.22} |
| 3358 |
% \item |
| 3359 |
% Change of version 2010/11/05 v1.18 reverted, because otherwise |
| 3360 |
% draftmode disables some \xext{aux} file entries. |
| 3361 |
% \end{Version} |
| 3362 |
% \begin{Version}{2011/09/19 v1.23} |
| 3363 |
% \item |
| 3364 |
% Some \cs{renewcommand}s changed to \cs{def} to avoid trouble |
| 3365 |
% if the commands are not defined, because hyperref stopped early. |
| 3366 |
% \end{Version} |
| 3367 |
% \begin{Version}{2011/12/02 v1.24} |
| 3368 |
% \item |
| 3369 |
% Small optimization in \cs{BKM@toHexDigit}. |
| 3370 |
% \end{Version} |
| 3371 |
% \begin{Version}{2016/05/16 v1.25} |
| 3372 |
% \item |
| 3373 |
% Documentation updates. |
| 3374 |
% \end{Version} |
| 3375 |
% \begin{Version}{2016/05/17 v1.26} |
| 3376 |
% \item |
| 3377 |
% define \cs{pdfoutline} to allow pdftex driver to be used with Lua\TeX. |
| 3378 |
% \end{Version} |
| 3379 |
% \begin{Version}{2019/06/04 v1.27} |
| 3380 |
% \item |
| 3381 |
% unknown style options are ignored (issue 67) |
| 3382 |
% \end{Version} |
| 3383 |
|
| 3384 |
% \begin{Version}{2019/12/03 v1.28} |
| 3385 |
% \item |
| 3386 |
% Documentation updates. |
| 3387 |
% \item adjust package loading (all required packages already loaded |
| 3388 |
% by \xpackage{hyperref}). |
| 3389 |
% \end{Version} |
| 3390 |
% \begin{Version}{2020-11-06 v1.29} |
| 3391 |
% \item Adapted the dvips to avoid a clash with pgf. |
| 3392 |
% https://github.com/pgf-tikz/pgf/issues/944 |
| 3393 |
% \item All drivers now use the new LaTeX hooks |
| 3394 |
% and so require a format 2020-10-01 or newer. |
| 3395 |
% \item Added support for destlabel option of hyperref, https://github.com/ho-tex/bookmark/issues/1 |
| 3396 |
% \item Removed the \xoption{dvipsone} and \xoption{textures} driver. |
| 3397 |
% \item Removed the code for option \xoption{dvipdfmx-outline-open} |
| 3398 |
% and \cs{SpecialDvipdfmxOutlineOpen}. All dvipdfmx version should now support |
| 3399 |
% this out-of-the-box. |
| 3400 |
% \end{Version} |
| 3401 |
% \begin{Version}{2023-12-05 v1.30} |
| 3402 |
% \item Corrected support for option \xoption{bookmarkstype} of |
| 3403 |
% \xpackage{hyperref}, https://github.com/ho-tex/bookmark/issues/4 |
| 3404 |
% \item Added support for structure destinations, https://github.com/ho-tex/bookmark/issues/7 |
| 3405 |
% \end{Version} |
| 3406 |
% \begin{Version}{2023-12-10 v1.31} |
| 3407 |
% \item Simplified the \xfile{.dtx}. It is no longer a self-extracting archive |
| 3408 |
% instead the newly added \xfile{.ins} should be used for installation. |
| 3409 |
% https://github.com/ho-tex/bookmark/issues/7 |
| 3410 |
% \item Removed the now outdated frozen drivers. |
| 3411 |
% \item Removed the dependency to ltxcmds. |
| 3412 |
% \end{Version} |
| 3413 |
% \begin{Version}{2026-05-21 v1.32} |
| 3414 |
% \item Driver options are now obsolete. The backend is detected automatically. |
| 3415 |
% \item Driver files have been renamed to follow the LaTeX kernel. |
| 3416 |
% \item The package uses now the LaTeX key-value system for the options to avoid |
| 3417 |
% option clash errors. |
| 3418 |
% \item The documentation is now tagged. |
| 3419 |
% \end{Version} |
| 3420 |
% \end{History} |
| 3421 |
% |
| 3422 |
% \PrintIndex |
| 3423 |
% |
| 3424 |
% \Finale |
| 3425 |
\endinput |