diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/bookmark/bookmark.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/bookmark/bookmark.dtx | 250 |
1 files changed, 100 insertions, 150 deletions
diff --git a/Master/texmf-dist/source/latex/bookmark/bookmark.dtx b/Master/texmf-dist/source/latex/bookmark/bookmark.dtx index 49ed2e897d1..c4431428b95 100644 --- a/Master/texmf-dist/source/latex/bookmark/bookmark.dtx +++ b/Master/texmf-dist/source/latex/bookmark/bookmark.dtx @@ -1,12 +1,12 @@ % \iffalse meta-comment % % File: bookmark.dtx -% Version: 2019/12/03 v1.28 +% Version: 2020-11-06 v1.29 % Info: PDF bookmarks % % Copyright (C) % 2007-2011 Heiko Oberdiek -% 2016-2019 Oberdiek Package Support Group +% 2016-2020 Oberdiek Package Support Group % https://github.com/ho-tex/bookmark/issues % % This work may be distributed and/or modified under the @@ -28,12 +28,15 @@ % This work consists of the main source file bookmark.dtx % and the derived files % bookmark.sty, bookmark.pdf, bookmark.ins, bookmark.drv, -% bkm-dvipdfm.def, bkm-dvips.def, bkm-dvipsone.def, -% bkm-textures.def, bkm-pdftex.def, bkm-vtex.def, +% bkm-dvipdfm.def, bkm-dvips.def, +% bkm-pdftex.def, bkm-vtex.def, +% bkm-dvipdfm-2019-12-03.def, bkm-dvips-2019-12-03.def, +% bkm-pdftex-2019-12-03.def, bkm-vtex-2019-12-03.def, % bookmark-example.tex. % % Distribution: % CTAN:macros/latex/contrib/bookmark/bookmark.dtx +% CTAN:macros/latex/contrib/bookmark/bookmark-frozen.dtx % CTAN:macros/latex/contrib/bookmark/bookmark.pdf % % Unpacking: @@ -66,13 +69,16 @@ % TDS:tex/latex/bookmark/bookmark.sty % TDS:tex/latex/bookmark/bkm-dvipdfm.def % TDS:tex/latex/bookmark/bkm-dvips.def -% TDS:tex/latex/bookmark/bkm-dvipsone.def -% TDS:tex/latex/bookmark/bkm-textures.def % TDS:tex/latex/bookmark/bkm-pdftex.def % TDS:tex/latex/bookmark/bkm-vtex.def +% TDS:tex/latex/bookmark/bkm-dvipdfm-2019-12-03.def +% TDS:tex/latex/bookmark/bkm-dvips-2019-12-03.def +% TDS:tex/latex/bookmark/bkm-pdftex-2019-12-03.def +% TDS:tex/latex/bookmark/bkm-vtex-2019-12-03.def% % TDS:doc/latex/bookmark/bookmark.pdf % TDS:doc/latex/bookmark/bookmark-example.tex % TDS:source/latex/bookmark/bookmark.dtx +% TDS:source/latex/bookmark/bookmark-frozen.dtx % %<*ignore> \begingroup @@ -89,7 +95,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: bookmark 2019/12/03 v1.28 PDF bookmarks (HO)} +\Msg{* Package: bookmark 2020-11-06 v1.29 PDF bookmarks (HO)} \Msg{************************************************************************} \keepsilent @@ -101,11 +107,11 @@ This is a generated file. Project: bookmark -Version: 2019/12/03 v1.28 +Version: 2020-11-06 v1.29 Copyright (C) 2007-2011 Heiko Oberdiek - 2016-2019 Oberdiek Package Support Group + 2016-2020 Oberdiek Package Support Group This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either @@ -124,11 +130,12 @@ Heiko Oberdiek and the Oberdiek Package Support Group https://github.com/ho-tex/bookmark/issues -This work consists of the main source file bookmark.dtx +This work consists of the main source file bookmark.dtx and bookmark-frozen.dtx and the derived files bookmark.sty, bookmark.pdf, bookmark.ins, bookmark.drv, - bkm-dvipdfm.def, bkm-dvips.def, bkm-dvipsone.def, - bkm-textures.def, bkm-pdftex.def, bkm-vtex.def, + bkm-dvipdfm.def, bkm-dvips.def, bkm-pdftex.def, bkm-vtex.def, + bkm-dvipdfm-2019-12-03.def, bkm-dvips-2019-12-03.def, + bkm-pdftex-2019-12-03.def, bkm-vtex-2019-12-03.def, bookmark-example.tex. \endpreamble @@ -141,12 +148,14 @@ and the derived files \file{bookmark.sty}{\from{bookmark.dtx}{package}}% \file{bkm-dvipdfm.def}{\from{bookmark.dtx}{dvipdfm}}% \file{bkm-dvips.def}{\from{bookmark.dtx}{dvips,pdfmark}}% - \file{bkm-dvipsone.def}{\from{bookmark.dtx}{dvipsone,pdfmark}}% - \file{bkm-textures.def}{\from{bookmark.dtx}{textures,pdfmark}}% \file{bkm-pdftex.def}{\from{bookmark.dtx}{pdftex}}% \file{bkm-vtex.def}{\from{bookmark.dtx}{vtex}}% \usedir{doc/latex/bookmark}% \file{bookmark-example.tex}{\from{bookmark.dtx}{example}}% + \file{bkm-pdftex-2019-12-03.def}{\from{bookmark-frozen.dtx}{pdftexfrozen}}% + \file{bkm-dvips-2019-12-03.def}{\from{bookmark-frozen.dtx}{dvipsfrozen}}% + \file{bkm-vtex-2019-12-03.def}{\from{bookmark-frozen.dtx}{vtexfrozen}}% + \file{bkm-dvipdfm-2019-12-03.def}{\from{bookmark-frozen.dtx}{dvipdfmfrozen}}% } \catcode32=13\relax% active space @@ -157,8 +166,9 @@ and the derived files \Msg{* files into a directory searched by TeX:} \Msg{*} \Msg{* bookmark.sty, bkm-dvipdfm.def, bkm-dvips.def,} -\Msg{* bkm-dvipsone.def, bkm-textures.def, bkm-pdftex.def,} -\Msg{* bkm-vtex.def} +\Msg{* bkm-pdftex.def, bkm-vtex.def, bkm-dvipdfm-2019-12-03.def,} +\Msg{* bkm-dvips-2019-12-03.def, bkm-pdftex-2019-12-03.def,} +\Msg{* and bkm-vtex-2019-12-03.def} \Msg{*} \Msg{* To produce the documentation run the file `bookmark.drv'} \Msg{* through LaTeX.} @@ -175,7 +185,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bookmark.drv}% - [2019/12/03 v1.28 PDF bookmarks (HO)]% + [2020-11-06 v1.29 PDF bookmarks (HO)]% \documentclass{ltxdoc} \usepackage{holtxdoc}[2011/11/22] \begin{document} @@ -189,7 +199,7 @@ and the derived files % \GetFileInfo{bookmark.drv} % % \title{The \xpackage{bookmark} package} -% \date{2019/12/03 v1.28} +% \date{2020-11-06 v1.29} % \author{Heiko Oberdiek\thanks % {Please report any issues at \url{https://github.com/ho-tex/bookmark/issues}}} % @@ -287,7 +297,6 @@ and the derived files % \subsubsection{Driver options} % % Supported drivers are \xoption{pdftex}, \xoption{dvips}, -% \xoption{dvipsone}, \xoption{textures}, % \xoption{dvipdfm} (\xoption{xetex}), and \xoption{vtex}. % The \hologo{TeX} engines \hologo{pdfTeX}, \hologo{XeTeX}, % and \hologo{VTeX} are automatically detected. @@ -297,18 +306,18 @@ and the derived files % \begin{quote} % |\def\BookmarkDriverDefault{dvipdfm}| % \end{quote} +% The current versions of the drivers uses new \LaTeX-hooks. If an +% older format than 2020-10-01 is detected frozen versions of +% the previous drivers are used as fallback. +% +% \paragraph{Open bookmarks with dvipdfmx.} Older version of +% the package had an option \xoption{dvipdfmx-outline-open} +% to activate code which allows to specify the open +% status of an outline entry. +% The package now assumes that all used dvipdfmx version are current enough to +% understand this code and so activates the code always. +% The option itself will be ignored. % -% \paragraph{Open bookmarks with dvipdfmx.} Since 2007-04-25 the -% cvs version of dvipmdfmx contains a patch that extends the -% \cs{special} for bookmarks in order to specify the open status of -% an outline entry. Option \xoption{dvipdfmx-outline-open} notifies -% the package that the dvi driver program understands this kind -% of \cs{special}. Alternatively \cs{SpecialDvipdfmxOutlineOpen} -% can be defined as number one in the configuration file or before -% the package is loaded, e.g.: -% \begin{quote} -% |\chardef\SpecialDvipdfmxOutlineOpen=1\relax| -% \end{quote} % % \subsubsection{Layout options} % @@ -396,7 +405,7 @@ and the derived files % unhappily the file name is a secret. The package supports % some ways to get the file name: % \begin{itemize} -% \item If \hologo{LuaTeX} (indenpendently from DVI or PDF modus) +% \item If \hologo{LuaTeX} (independently from DVI or PDF modus) % is running, then its |status.filename| is used automatically. % \item Package \cs{currfile} \cite{currfile} redefines \hologo{LaTeX} % internals to keep track of the file name. If the package @@ -607,12 +616,11 @@ and the derived files % adding bookmarks at the end of the document depends % on the driver. % -% Some drivers -% (\xoption{pdftex}, \xoption{dvips}, \xoption{dvipsone}, -% \xoption{textures}) use package \xpackage{atveryend}'s +% The driver \xoption{pdftex} +% use package \xpackage{atveryend}'s % for this purpose. \cs{AtEndDocument} is too early, % the last page might not been shipped out. Because the \xext{aux} -% file is needed, these drivers use \cs{AfterLastShipout}. +% file is needed, this driver use \cs{AfterLastShipout}. % % The implementation of the other drivers % (\xoption{dvipdfm}, \xoption{xetex}, \xoption{vtex}) @@ -622,6 +630,8 @@ and the derived files % helps. It puts its argument on last page of the document. % Two \hologo{LaTeX} runs are necessary at least, because % the last page is detected by a reference. +% +% \xoption{dvips} uses now the new LaTeX hook \texttt{shipout/lastpage}. % \item % The time of expansion of the argument of \cs{BookmarkAtEnd} % is not specified. This can happen immediately or at the end @@ -752,7 +762,7 @@ and the derived files %<*package> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{bookmark}% - [2019/12/03 v1.28 PDF bookmarks (HO)]% + [2020-11-06 v1.29 PDF bookmarks (HO)]% % \end{macrocode} % % \subsubsection{Requirements} @@ -1622,23 +1632,13 @@ and the derived files % \begin{macrocode} \BKM@DefineDriverKey{pdftex} \BKM@DefineDriverKey{dvips} -\BKM@DefineDriverKey{dvipsone} -\BKM@DefineDriverKey{textures} \BKM@DefineDriverKey{dvipdfm} \BKM@DefineDriverKey{dvipdfmx} \BKM@DefineDriverKey{xetex} \BKM@DefineDriverKey{vtex} \define@key{BKM}{dvipdfmx-outline-open}[true]{% - \expandafter\ifx\csname if#1\expandafter\endcsname - \csname iftrue\endcsname - \chardef\SpecialDvipdfmxOutlineOpen\@ne - \else - \chardef\SpecialDvipdfmxOutlineOpen\z@ - \fi -} -\g@addto@macro\BKM@DisableOptions{% - \DisableKeyvalOption{BKM}{dvipdfmx-outline-open}% -} + \PackageWarning{bookmark}{Option 'dvipdfmx-outline-open' is obsolete + and ignored}{}} % \end{macrocode} % \begin{macro}{\bookmark@driver} % \begin{macrocode} @@ -1709,22 +1709,6 @@ and the derived files % \paragraph{Driver validation and loading.} % % \begin{macrocode} -\newif\ifBKM@DvipdfmxOutlineOpen -\ltx@IfUndefined{SpecialDvipdfmxOutlineOpen}{% - \ifxetex - \ifdim\number\XeTeXversion\XeTeXrevision in<0.9995in % - \else - \chardef\SpecialDvipdfmxOutlineOpen\ltx@one - \BKM@DvipdfmxOutlineOpentrue - \fi - \fi -}{% - \ifnum\SpecialDvipdfmxOutlineOpen>\z@ - \BKM@DvipdfmxOutlineOpentrue - \fi -} -% \end{macrocode} -% \begin{macrocode} \def\BKM@temp{dvipdfmx}% \ifx\BKM@temp\BKM@driver \def\BKM@driver{dvipdfm}% @@ -1778,6 +1762,8 @@ and the derived files \fi \fi \fi +\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} +\IfFormatAtLeastTF{2020/10/01}{}{\edef\BKM@driver{\BKM@driver-2019-12-03}} \InputIfFileExists{bkm-\BKM@driver.def}{}{% \PackageError{bookmark}{% Unsupported driver `\BKM@driver'.\MessageBreak @@ -1843,7 +1829,7 @@ and the derived files \let\partnumberline\@gobble \let\chapternumberline\@gobble \fi - \bookmark[level=#4,dest={#3}]{#2}% + \bookmark[level=#4,dest={\HyperDestNameFilter{#3}}]{#2}% \endgroup \fi \fi @@ -1867,7 +1853,7 @@ and the derived files %<*dvipdfm> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bkm-dvipdfm.def}% - [2019/12/03 v1.28 bookmark driver for dvipdfm (HO)]% + [2020-11-06 v1.29 bookmark driver for dvipdfm (HO)]% % \end{macrocode} % % \begin{macro}{\BKM@id} @@ -1990,7 +1976,7 @@ and the derived files }% \fi \special{pdf:% - out \ifBKM@DvipdfmxOutlineOpen + out [% \ifBKM@open \ifnum\BKM@level<% @@ -2003,7 +1989,6 @@ and the derived files -% \fi ] % - \fi \BKM@abslevel <<% /Title(\BKM@title)% @@ -2042,7 +2027,7 @@ and the derived files %<*vtex> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bkm-vtex.def}% - [2019/12/03 v1.28 bookmark driver for VTeX (HO)]% + [2020-11-06 v1.29 bookmark driver for VTeX (HO)]% % \end{macrocode} % % \begin{macrocode} @@ -2373,7 +2358,7 @@ and the derived files %<*pdftex> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bkm-pdftex.def}% - [2019/12/03 v1.28 bookmark driver for pdfTeX (HO)]% + [2020-11-06 v1.29 bookmark driver for pdfTeX (HO)]% % \end{macrocode} % % \begin{macro}{\BKM@DO@entry} @@ -2529,55 +2514,28 @@ and the derived files %<*dvips> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bkm-dvips.def}% - [2019/12/03 v1.28 bookmark driver for dvips (HO)]% + [2020-11-06 v1.29 bookmark driver for dvips (HO)]% % \end{macrocode} % \begin{macro}{\BKM@PSHeaderFile} % \begin{macrocode} \def\BKM@PSHeaderFile#1{% - \special{header=#1}% + \special{PSfile=#1}% } % \end{macrocode} -% \end{macro} -% \begin{macrocode} -%</dvips> -% \end{macrocode} -% -% \subsubsection{Driver dvipsone} -% -% \begin{macrocode} -%<*dvipsone> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{bkm-dvipsone.def}% - [2019/12/03 v1.28 bookmark driver for dvipsone (HO)]% -% \end{macrocode} -% \begin{macro}{\BKM@PSHeaderFile} +% \begin{macro}{\BKM@filename} % \begin{macrocode} -\def\BKM@PSHeaderFile#1{% - \special{header=#1}% -} +\def\BKM@filename{\jobname.out.ps} % \end{macrocode} % \end{macro} % \begin{macrocode} -%</dvipsone> -% \end{macrocode} -% -% \subsubsection{Driver textures} -% -% \begin{macrocode} -%<*textures> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{bkm-textures.def}% - [2019/12/03 v1.28 bookmark driver for textures (HO)]% -% \end{macrocode} -% \begin{macro}{\BKM@PSHeaderFile} -% \begin{macrocode} -\def\BKM@PSHeaderFile#1{% - \special{prePostScriptfile #1}% -} +\AddToHook{shipout/lastpage}{% + \BKM@pdfmark@out + \BKM@PSHeaderFile\BKM@filename + } % \end{macrocode} % \end{macro} % \begin{macrocode} -%</textures> +%</dvips> % \end{macrocode} % % \subsubsection{Common part} @@ -2585,19 +2543,6 @@ and the derived files % \begin{macrocode} %<*pdfmark> % \end{macrocode} -% \begin{macro}{\BKM@filename} -% \begin{macrocode} -\def\BKM@filename{\jobname.out.ps} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\BKM@PSHeaderFile\BKM@filename -% \end{macrocode} -% -% \begin{macrocode} -\RequirePackage{atveryend}[2009/12/07] -\AfterLastShipout{\BKM@pdfmark@out} -% \end{macrocode} % % \begin{macro}{\BKM@pdfmark@out} % Do not use package \xpackage{rerunfilecheck} here, because @@ -2771,12 +2716,8 @@ and the derived files % \subsubsection{Write auxiliary file} % % \begin{macrocode} -\RequirePackage{auxhook} -% \end{macrocode} -% \begin{macrocode} -\AddLineBeginMainAux{% - \string\providecommand\string\BKM@entry[2]{}% -} +\AddToHook{begindocument}{% + \immediate\write\@mainaux{\string\providecommand\string\BKM@entry[2]{}}} % \end{macrocode} % % \begin{macro}{\BKM@id} @@ -3005,46 +2946,44 @@ and the derived files % % \subsubsection{Drivers using hooks at end of document} % -% The following drivers use package \xpackage{atveryend}'s -% \cs{AfterLastShipout}, because they still need the -% \xext{aux} file. +% Driver \xoption{pdftex} use the LaTeX hook \xoption{enddocument/afterlastpage} +% (which is equivalent to the previously used +% \cs{AfterLastShipout} of \xpackage{atveryend}'s), +% because it still needs the \xext{aux} file. It uses +% uses \cs{pdfoutline} for the bookmakrs that can be used after the last page. % \begin{itemize} % \item % Driver \xoption{pdftex} uses \cs{pdfoutline} that can % be used after the last page. -% \item -% PostScript drivers such as -% \xoption{dvips} use an external PostScript header file -% for the bookmarks. File writing can be done after -% the last shipout page, but before the \xext{aux} file is closed. % \end{itemize} % \begin{macrocode} -%<*pdftex|pdfmark> +%<*pdftex> \ifBKM@atend - \AfterLastShipout{% + \AddToHook{enddocument/afterlastpage}{% \BKM@EndHook }% \fi -%</pdftex|pdfmark> +%</pdftex> % \end{macrocode} % -% \subsubsection{Drivers using \cs{AtEndDvi}} +% \subsubsection{Drivers using \xoption{shipout/lastpage}} % % The other drivers implement \cs{bookmark} using \cs{special} % commands. Thus the last bookmarks must be put on the last page, % not afterwards. % \cs{AtEndDocument} cannot be used, because it is too late, the -% last page can already be output. Therefore we use package -% \xpackage{atenddvi} that uses the help of packages \xpackage{atbegshi} -% and \xpackage{zref}. The argument of \cs{AtEndDvi} is put -% at the end of the last page. At least two \hologo{LaTeX} runs are necessary. -% \begin{macrocode} -%<*dvipdfm|vtex> +% last page can already be output. Therefore we use the +% LaTeX hook \xoption{shipout/lastpage}. +% At least two \hologo{LaTeX} runs are necessary. +% The postscript driver \xoption{dvips} use an external PostScript file +% for the bookmarks. The file writing has been moved to the +% the last shipout page too to avoid conflicts with pgf. +% \begin{macrocode} +%<*dvipdfm|vtex|pdfmark> \ifBKM@atend - \RequirePackage{atenddvi}% - \AtEndDvi{\BKM@EndHook}% + \AddToHook{shipout/lastpage}{\BKM@EndHook}% \fi -%</dvipdfm|vtex> +%</dvipdfm|vtex|pdfmark> % \end{macrocode} % % \section{Installation} @@ -3097,8 +3036,6 @@ and the derived files % bookmark.sty & tex/latex/bookmark/bookmark.sty\\ % bkm-dvipdfm.def & tex/latex/bookmark/bkm-dvipdfm.def\\ % bkm-dvips.def & tex/latex/bookmark/bkm-dvips.def\\ -% bkm-dvipsone.def & tex/latex/bookmark/bkm-dvipsone.def\\ -% bkm-textures.def & tex/latex/bookmark/bkm-textures.def\\ % bkm-pdftex.def & tex/latex/bookmark/bkm-pdftex.def\\ % bkm-vtex.def & tex/latex/bookmark/bkm-vtex.def\\ % bookmark.pdf & doc/latex/bookmark/bookmark.pdf\\ @@ -3424,7 +3361,7 @@ and the derived files % \end{Version} % \begin{Version}{2016/05/17 v1.26} % \item -% define \cs{pdfbookmark} to allow pdftex driver to be used with Lua\TeX. +% define \cs{pdfoutline} to allow pdftex driver to be used with Lua\TeX. % \end{Version} % \begin{Version}{2019/06/04 v1.27} % \item @@ -3434,9 +3371,22 @@ and the derived files % \begin{Version}{2019/12/03 v1.28} % \item % Documentation updates. -% \item adjust package loading (all required packages already loade +% \item adjust package loading (all required packages already loaded % by \xpackage{hyperref}). % \end{Version} +% \begin{Version}{2020-11-06 v1.29} +% \item Adapted the dvips to avoid a clash with pgf. +% https://github.com/pgf-tikz/pgf/issues/944 +% \item All drivers now use the new LaTeX hooks +% and so require a format 2020-10-01 or newer. The older +% drivers are provided as frozen versions and are used if an older +% format is detected. +% \item Added support for destlabel option of hyperref, https://github.com/ho-tex/bookmark/issues/1 +% \item Removed the \xoption{dvipsone} and \xoption{textures} driver. +% \item Removed the code for option \xoption{dvipdfmx-outline-open} +% and \cs{SpecialDvipdfmxOutlineOpen}. All dvipdfmx version should now support +% this out-of-the-box. +% \end{Version} % \end{History} % % \PrintIndex |