diff options
author | Norbert Preining <norbert@preining.info> | 2019-12-04 03:01:14 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-12-04 03:01:14 +0000 |
commit | 05ad7831f64aa0e2fc9eac63816eeafcb0b09708 (patch) | |
tree | 8f9be9175d691ec0db490f6d35bb942bef1d9b45 /macros/latex/contrib/oberdiek | |
parent | b8d4bb76703bcb15578e2b23c5d256532180b894 (diff) |
CTAN sync 201912040301
Diffstat (limited to 'macros/latex/contrib/oberdiek')
-rw-r--r-- | macros/latex/contrib/oberdiek/bookmark.dtx | 3471 | ||||
-rw-r--r-- | macros/latex/contrib/oberdiek/bookmark.pdf | bin | 290659 -> 0 bytes | |||
-rw-r--r-- | macros/latex/contrib/oberdiek/embedfile.dtx | 2141 | ||||
-rw-r--r-- | macros/latex/contrib/oberdiek/embedfile.pdf | bin | 215002 -> 0 bytes |
4 files changed, 0 insertions, 5612 deletions
diff --git a/macros/latex/contrib/oberdiek/bookmark.dtx b/macros/latex/contrib/oberdiek/bookmark.dtx deleted file mode 100644 index 7d9c9c1eec..0000000000 --- a/macros/latex/contrib/oberdiek/bookmark.dtx +++ /dev/null @@ -1,3471 +0,0 @@ -% \iffalse meta-comment -% -% File: bookmark.dtx -% Version: 2019/06/04 v1.27 -% Info: PDF bookmarks -% -% Copyright (C) -% 2007-2011 Heiko Oberdiek -% 2016-2019 Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either -% version 1.3c of this license or (at your option) any later -% version. This version of this license is in -% https://www.latex-project.org/lppl/lppl-1-3c.txt -% and the latest version of this license is in -% https://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of -% LaTeX version 2005/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% The Current Maintainers of this work are -% Heiko Oberdiek and the Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work consists of the main source file bookmark.dtx -% and the derived files -% bookmark.sty, bookmark.pdf, bookmark.ins, bookmark.drv, -% bkm-dvipdfm.def, bkm-dvips.def, bkm-dvipsone.def, -% bkm-textures.def, bkm-pdftex.def, bkm-vtex.def, -% bookmark-example.tex. -% -% Distribution: -% CTAN:macros/latex/contrib/oberdiek/bookmark.dtx -% CTAN:macros/latex/contrib/oberdiek/bookmark.pdf -% -% Unpacking: -% (a) If bookmark.ins is present: -% tex bookmark.ins -% (b) Without bookmark.ins: -% tex bookmark.dtx -% (c) If you insist on using LaTeX -% latex \let\install=y\input{bookmark.dtx} -% (quote the arguments according to the demands of your shell) -% -% Documentation: -% (a) If bookmark.drv is present: -% latex bookmark.drv -% (b) Without bookmark.drv: -% latex bookmark.dtx; ... -% The class ltxdoc loads the configuration file ltxdoc.cfg -% if available. Here you can specify further options, e.g. -% use A4 as paper format: -% \PassOptionsToClass{a4paper}{article} -% -% Programm calls to get the documentation (example): -% pdflatex bookmark.dtx -% makeindex -s gind.ist bookmark.idx -% pdflatex bookmark.dtx -% makeindex -s gind.ist bookmark.idx -% pdflatex bookmark.dtx -% -% Installation: -% TDS:tex/latex/oberdiek/bookmark.sty -% TDS:tex/latex/oberdiek/bkm-dvipdfm.def -% TDS:tex/latex/oberdiek/bkm-dvips.def -% TDS:tex/latex/oberdiek/bkm-dvipsone.def -% TDS:tex/latex/oberdiek/bkm-textures.def -% TDS:tex/latex/oberdiek/bkm-pdftex.def -% TDS:tex/latex/oberdiek/bkm-vtex.def -% TDS:doc/latex/oberdiek/bookmark.pdf -% TDS:doc/latex/oberdiek/bookmark-example.tex -% TDS:source/latex/oberdiek/bookmark.dtx -% -%<*ignore> -\begingroup - \catcode123=1 % - \catcode125=2 % - \def\x{LaTeX2e}% -\expandafter\endgroup -\ifcase 0\ifx\install y1\fi\expandafter - \ifx\csname processbatchFile\endcsname\relax\else1\fi - \ifx\fmtname\x\else 1\fi\relax -\else\csname fi\endcsname -%</ignore> -%<*install> -\input docstrip.tex -\Msg{************************************************************************} -\Msg{* Installation} -\Msg{* Package: bookmark 2019/06/04 v1.27 PDF bookmarks (HO)} -\Msg{************************************************************************} - -\keepsilent -\askforoverwritefalse - -\let\MetaPrefix\relax -\preamble - -This is a generated file. - -Project: bookmark -Version: 2019/06/04 v1.27 - -Copyright (C) - 2007-2011 Heiko Oberdiek - 2016-2019 Oberdiek Package Support Group - -This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either -version 1.3c of this license or (at your option) any later -version. This version of this license is in - https://www.latex-project.org/lppl/lppl-1-3c.txt -and the latest version of this license is in - https://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of -LaTeX version 2005/12/01 or later. - -This work has the LPPL maintenance status "maintained". - -The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - - -This work consists of the main source file bookmark.dtx -and the derived files - bookmark.sty, bookmark.pdf, bookmark.ins, bookmark.drv, - bkm-dvipdfm.def, bkm-dvips.def, bkm-dvipsone.def, - bkm-textures.def, bkm-pdftex.def, bkm-vtex.def, - bookmark-example.tex. - -\endpreamble -\let\MetaPrefix\DoubleperCent - -\generate{% - \file{bookmark.ins}{\from{bookmark.dtx}{install}}% - \file{bookmark.drv}{\from{bookmark.dtx}{driver}}% - \usedir{tex/latex/oberdiek}% - \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/oberdiek}% - \file{bookmark-example.tex}{\from{bookmark.dtx}{example}}% - \nopreamble - \nopostamble -% \usedir{source/latex/oberdiek/catalogue}% -% \file{bookmark.xml}{\from{bookmark.dtx}{catalogue}}% -} - -\catcode32=13\relax% active space -\let =\space% -\Msg{************************************************************************} -\Msg{*} -\Msg{* To finish the installation you have to move the following} -\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{*} -\Msg{* To produce the documentation run the file `bookmark.drv'} -\Msg{* through LaTeX.} -\Msg{*} -\Msg{* Happy TeXing!} -\Msg{*} -\Msg{************************************************************************} - -\endbatchfile -%</install> -%<*ignore> -\fi -%</ignore> -%<*driver> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{bookmark.drv}% - [2019/06/04 v1.27 PDF bookmarks (HO)]% -\documentclass{ltxdoc} -\usepackage{holtxdoc}[2011/11/22] -\begin{document} - \DocInput{bookmark.dtx}% -\end{document} -%</driver> -% \fi -% -% -% \CharacterTable -% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z -% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z -% Digits \0\1\2\3\4\5\6\7\8\9 -% Exclamation \! Double quote \" Hash (number) \# -% Dollar \$ Percent \% Ampersand \& -% Acute accent \' Left paren \( Right paren \) -% Asterisk \* Plus \+ Comma \, -% Minus \- Point \. Solidus \/ -% Colon \: Semicolon \; Less than \< -% Equals \= Greater than \> Question mark \? -% Commercial at \@ Left bracket \[ Backslash \\ -% Right bracket \] Circumflex \^ Underscore \_ -% Grave accent \` Left brace \{ Vertical bar \| -% Right brace \} Tilde \~} -% -% \GetFileInfo{bookmark.drv} -% -% \title{The \xpackage{bookmark} package} -% \date{2019/06/04 v1.27} -% \author{Heiko Oberdiek\thanks -% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} -% -% \maketitle -% -% \begin{abstract} -% This package implements a new bookmark (outline) organization for -% package \xpackage{hyperref}. Bookmark properties such -% as style and color can now be set. Other action types -% are available (URI, GoToR, Named). The bookmarks are -% generated in the first compile run. Package \xpackage{hyperref} -% uses two runs. -% \end{abstract} -% -% \tableofcontents -% -% \section{Documentation} -% -% \subsection{Introduction} -% -% This package \xpackage{bookmark} tries to provide a more modern -% management for bookmarks: -% \begin{itemize} -% \item The bookmarks are already generated in the first \hologo{TeX} compile run. -% \item The font style and color of the bookmarks can be changed. -% \item More actions than simple GoTo actions are possible. -% \end{itemize} -% -% In the same way as \xpackage{hyperref} \cite{hyperref} -% the bookmarks are generated -% in the order of the bookmark generating macros (\cs{bookmark}). -% A level number is used to define the tree structure of the bookmarks. -% The restrictions are less strict: -% \begin{itemize} -% \item The level values may jump and omit values. A \cs{subsubsection} -% may follow a \cs{chapter}. This was an error in \xpackage{hyperref}, -% that prints a warning and tries to fix this. -% \item Several bookmarks may point to the same destination. -% In \xpackage{hyperref} this would mess up the bookmark tree -% completely, because the algorithm assumes that the destination -% names are keys (unique). -% \end{itemize} -% -% Note that this package is intended as experimentation platform -% for bookmark management. Feedback is welcome. Also the interfaces -% may change in future versions. -% -% \subsection{Options} -% -% Options can be given at four places: -% \begin{enumerate} -% \item \cs{usepackage}|[|\meta{options}|]{bookmark}|\\ -% This is the only place for driver options -% and option \xoption{atend}. -% \item \cs{bookmarksetup}|{|\meta{options}|}|\\ -% This command is just for setting options. -% \item \cs{bookmarksetupnext}|{|\meta{options}|}|\\ -% The options are stored and called after the -% options of the next \cs{bookmark} command. -% \item \cs{bookmark}|[|\meta{options}|]{|\meta{title}|}|\\ -% This command sets the bookmark. The option settings remain -% limited to this bookmark. -% \end{enumerate} -% Exception: Driver options, option \xoption{atend} and -% options \xoption{draft}\slash\xoption{final} -% cannot be changed after the package is loaded. -% -% \subsubsection{Options \xoption{draft} and \xoption{final}} -% -% If a \LaTeX\ file is compiled several times, then a little -% time can be saved, if option \xoption{draft} is used to -% disable the bookmark stuff of this package. Default is -% \xoption{final}. -% Both options are boolean options, without -% value the value |true| is used. |draft=true| is the same -% as |final=false|. -% -% Options of package \xpackage{bookmark} are local options -% with the exception of driver options. Therefore \xoption{draft} -% or \xoption{final} given as class option is not seen by this -% package. If you want to optimize first \LaTeX\ runs depending -% on a global \xoption{draft}, then package \xpackage{ifdraft} -% and \LaTeX's \cs{PassOptionsToPackage} -% might help in the organization of the preamble, for example: -%\begin{quote} -%\begin{verbatim} -%\documentclass[draft]{article} -%\usepackage{ifdraft} -%\ifdraft{% -% \PassOptionsToPackage{draft}{bookmark}% -%}{} -%\end{verbatim} -%\end{quote} -% -% \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. -% The default for the DVI drivers is \xoption{dvips}. This can -% be changed in the configuration file \xfile{bookmark.cfg} by -% \cs{BookmarkDriverDefault}, e.g.: -% \begin{quote} -% |\def\BookmarkDriverDefault{dvipdfm}| -% \end{quote} -% -% \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} -% -% \paragraph{Font options.} -% -% \begin{description} -% \item[\xoption{bold}:] The bookmark is shown with a bold font -% if the PDF viewer supports this (since PDF 1.4). -% \item[\xoption{italic}:] An italic font is used (since PDF 1.4). -% \end{description} -% Both \xoption{bold} and \xoption{italic} can be used together. -% Using value |false| disables the font option. -% -% \paragraph{Color option.} -% -% Colored bookmarks are a feature of PDF 1.4, they are not supported -% by all PDF viewers. -% \begin{description} -% \item[\xoption{color}:] Here the color can be given as -% color specification of packages \xpackage{color} or \xpackage{xcolor}. -% An empty value means that the color property is not set. -% Without package \xpackage{xcolor} the recognized values -% are restricted to -% \begin{itemize} -% \item Empty value, no color is set,\\ -% example: |color={}| -% \item Explicit color specification of color model rgb,\\ -% example for red: |color=[rgb]{1,0,0}| -% \item Explicit color specification of color model gray,\\ -% example for dark gray: |color=[gray]{0.25}| -% \end{itemize} -% Note that this restriction also holds if package \xpackage{color} -% is loaded. With \xpackage{xcolor}, however, the full range -% of color specifications can be used. -% \end{description} -% -% \subsubsection{Action options} -% -% \begin{description} -% \item[\xoption{dest}:] Destination name. -% \item[\xoption{page}:] Page number, first page is 1. -% \item[\xoption{view}:] View specification, examples:\\ -% |view={FitB}|, |view={FitH 842}|, |view={XYZ 0 100 null}| -% Some view specification parameters expect numbers as parameters -% with unit bp. They can be given either as plain numbers or -% as length expressions inside \cs{calc}. Expressions of -% package \xpackage{calc} are supported if the package is loaded. -% Otherwise \hologo{eTeX}'s \cs{dimexpr} is used. Example:\\ -% |view={FitH \calc{\paperheight-\topmargin-1in}}|\\ -% |view={XYZ 0 \calc{\paperheight} null}|\\ -% Note that \cs{calc} cannot be used for the third parameter -% of |XYZ|. This parameter is the zoom value, not a length. -% \item[\xoption{named}:] Named action name:\\ -% |FirstPage|, |LastPage|, |NextPage|, |PrevPage| -% \item[\xoption{gotor}:] Name of the external PDF file. -% \item[\xoption{uri}:] URI specification. -% \item[\xoption{rawaction}:] Raw action specification. -% Because these specification depends on the driver this option -% should not be used. -% \end{description} -% The appropriate action for the bookmark is selected by -% analyzing the specified options. The actions -% are distinguished by different sets of options: -% \begin{quote} -% \begin{tabular}{@{}ll@{}} -% \textbf{Action} & \textbf{Options}\\ -% \hline -% \textsf{GoTo}: & \xoption{dest}\\ -% \textsf{GoTo}: & \xoption{page} + \xoption{view}\\ -% \textsf{GoToR}: & \xoption{gotor} + \xoption{dest}\\ -% \textsf{GoToR}: & \xoption{gotor} + \xoption{page} + \xoption{view}\\ -% \textsf{Named}: & \xoption{named}\\ -% \textsf{URI}: & \xoption{uri} -% \end{tabular} -% \end{quote} -% -% \paragraph{Missing actions.} -% If the action is missing package \xpackage{bookmark} throws -% an error message. Depending on the driver (\xoption{pdftex}, -% \xoption{dvips} and friends) the package detects it quite late -% at the end of the document. Since version 2011/04/21 v1.21 -% the package tries printing the line number and file name -% of the corresponding occurence of \cs{bookmark}. -% However, \hologo{TeX} does provide the line number, but -% 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) -% 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 -% is loaded, then its \cs{currfilepath} is detected and used -% automatically by package \xpackage{bookmark}. -% \item The file name can be set manually by option \xoption{scrfile} -% in \cs{bookmarksetup} or \cs{bookmark}. But be careful, -% manual setting disables the previous ways for file name -% detection. And a wrong or missed file name setting might -% get you a wrong source location in the error message. -% \end{itemize} -% -% \subsubsection{Level options} -% -% The order of the bookmark entries are defined by the -% appearance order of \cs{bookmark} commands. The tree structure -% is constructed by the property \xoption{level} of the bookmark nodes. -% The values of \xoption{level} are integers. If the level of a -% bookmark entry has a higher value than the previous node, then -% the entry becomes a child of the previous node. The absolute -% value of the difference does not matter. -% -% Package \xpackage{bookmark} remembers the level of the previous -% bookmark entry in a global property `current level'. -% -% The behaviour of the level system can be configured by following -% options: -% \begin{description} -% \item[\xoption{level}:] -% Sets the level, see the description above. If option \xoption{level} -% is given without value, then the default behaviour is restored, -% that the `current level' is used as level value. -% Since version 2010/10/19 v1.16 package \xpackage{bookmark} -% also supports names |part|, |section| and other, -% if the macros \cs{toclevel@part}, \cs{toclevel@section} -% are defined (done by package \xpackage{hyperref}, see -% option \xoption{bookmarkdepth}). -% \item[\xoption{rellevel}:] -% Sets the level relative to the previous level. -% A positive value means that the bookmark entry become -% a child of the previous one. -% \item[\xoption{keeplevel}:] -% Use the level, set by \xoption{level} or \xoption{rellevel}, -% but do not change the global property `current level'. -% The option can be disabled by setting to |false|. -% \item[\xoption{startatroot}:] -% At this time the bookmark tree starts at the top level again. -% The next bookmark entry is not sorted as child to a previous entry. -% Example scenario: A document uses part. However there are -% last chapters that should not be put below the last part: -% \begin{quote} -%\begin{verbatim} -%\documentclass{book} -%[...] -%\begin{document} -% \part{First part} -% \chapter{First chapter in first part} -% [...] -% \part{Second part} -% \chapter{First chapter in second part} -% [...] -% \bookmarksetup{startatroot} -% \chapter{Index}% does not belong to second part -%\end{document} -%\end{verbatim} -% \end{quote} -% \end{description} -% -% \subsubsection{Style definitions} -% -% A style is a group of option settings. It can be defined -% by macro \cs{bookmarkdefinestyle} and is used by option \xoption{style}. -% \begin{declcs}{bookmarkdefinestyle} \M{name} \M{key value list} -% \end{declcs} -% The \meta{key value list} of option settings is assigned the -% style \meta{name}. -% -% \begin{description} -% \item[\xoption{style}:] -% The value of option \xoption{style} is the name of a previously -% defined style. Its option settings are now executed. -% The options may include option \xoption{style}. -% Endless recursion by calling the same style recursively -% is prevented and throws an error. -% \end{description} -% -% \subsubsection{Hook support} -% -% A hook is called right after the processing the optional options -% of macro \cs{bookmark}. -% \begin{description} -% \item[\xoption{addtohook}:] -% Code, given as value to this option is added to the hook. -% \end{description} -% -% \begin{declcs}{bookmarkget} \M{option} -% \end{declcs} -% Macro \cs{bookmarkget} extracts the value of the latest option -% setting of option \meta{option}. In case of boolean options number -% one is returned, if the boolean option is enabled, otherwise the -% result is zero. -% The resulting numbers can directly be used in \cs{ifnum} or \cs{ifcase}. -% If you want to have the digits \texttt{0} and \texttt{1}, then -% prefix \cs{bookmarkget} with \cs{number}. -% Macro \cs{bookmarkget} is expandable. -% In case of -% unsupported options an empty string is returned. -% Supported boolean options are -% \begin{quote} -% \xoption{bold}, -% \xoption{italic}, -% \xoption{open} -% \end{quote} -% Other supported options: -% \begin{quote} -% \xoption{depth}, -% \xoption{dest}, -% \xoption{color}, -% \xoption{gotor}, -% \xoption{level}, -% \xoption{named}, -% \xoption{openlevel}, -% \xoption{page}, -% \xoption{rawaction}, -% \xoption{uri}, -% \xoption{view}, -% \end{quote} -% Additionally the following key is available: -% \begin{quote} -% \xoption{text} -% \end{quote} -% It returns the text of the outline entry. -% -% \paragraph{Option setting.} -% Inside the hook an option can be set using \cs{bookmarksetup}. -% -% \subsection{Compatibility with \xpackage{hyperref}} -% -% Package \xpackage{bookmark} automatically disables -% \xpackage{hyperref}'s bookmarks. However the package -% uses some of the code of \xpackage{hyperref}. For example, -% the package redefines the hook \cs{Hy@writebookmark} that -% \xpackage{hyperref} inserts in \cs{addcontentsline} and -% other commands. Therefore -% \xpackage{hyperref}'s bookmarks should not be disabled. -% -% Package \xpackage{bookmark} uses \xpackage{hyperref}'s \cs{pdfstringdef} -% and does not provide a replacement. -% -% Some options of \xpackage{hyperref} are also implemented -% in package \xpackage{bookmark}: -% \begin{quote} -% \begin{tabular}{@{}ll@{}} -% \xpackage{hyperref} & \xpackage{bookmark}\\ -% \hline -% \xoption{bookmarksdepth} & \xoption{depth}\\ -% \xoption{bookmarksopen} & \xoption{open}\\ -% \xoption{bookmarksopenlevel} & \xoption{openlevel}\\ -% \xoption{bookmarksnumbered} & \xoption{numbered}\\ -% \end{tabular} -% \end{quote} -% -% The following commands are also available: -% \begin{quote} -% \cs{pdfbookmark}\\ -% \cs{currentpdfbookmark}\\ -% \cs{subpdfbookmark}\\ -% \cs{belowpdfbookmark} -% \end{quote} -% -% \subsection{Adding bookmarks at the end} -% -% Package option \xoption{atend} enables the following macro: -% \begin{declcs}{BookmarkAtEnd} -% \M{stuff} -% \end{declcs} -% Macro \cs{BookmarkAtEnd} puts \meta{stuff} at the end -% of the document. \meta{stuff} means bookmark commands. -% Example: -% \begin{quote} -%\begin{verbatim} -%\usepackage[atend]{bookmark} -%\BookmarkAtEnd{% -% \bookmarksetup{startatroot}% -% \bookmark[named=LastPage, level=0]{Last page}% -%} -%\end{verbatim} -% \end{quote} -% -% Alternatively, option \xoption{startatroot} can be given -% in \cs{bookmark}: -% \begin{quote} -%\begin{verbatim} -%\BookmarkAtEnd{% -% \bookmark[ -% startatroot, -% named=LastPage, -% level=0, -% ]{Last page}% -%} -%\end{verbatim} -% \end{quote} -% -% \paragraph{Remarks.} -% \begin{itemize} -% \item -% \cs{BookmarkAtEnd} hides the fact that the method for -% 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 -% 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}. -% -% The implementation of the other drivers -% (\xoption{dvipdfm}, \xoption{xetex}, \xoption{vtex}) -% depends on -% \cs{special} that does not have an effect after the last -% page. In this case \cs{AtEndDvi} of package \xpackage{atenddvi} -% 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. -% \item -% The time of expansion of the argument of \cs{BookmarkAtEnd} -% is not specified. This can happen immediately or at the end -% of the document. -% \end{itemize} -% -% \subsection{Limitations/ToDos} -% -% \begin{itemize} -% \item Support for missing actions (Launch, \dots). -% \item Better design for \xpackage{hyperref}'s option -% \xoption{bookmarkstype}. -% \end{itemize} -% -% \section{Example} -% -% \begin{macrocode} -%<*example> -% \end{macrocode} -% \begin{macrocode} -\documentclass{article} -\usepackage{xcolor}[2007/01/21] -\usepackage{hyperref} -\usepackage[ - open, - openlevel=2, - atend -]{bookmark}[2019/06/04] - -\bookmarksetup{color=blue} - -\BookmarkAtEnd{% - \bookmarksetup{startatroot}% - \bookmark[named=LastPage, level=0]{End/Last page}% - \bookmark[named=FirstPage, level=1]{First page}% -} - -\begin{document} -\section{First section} -\subsection{Subsection A} -\begin{figure} - \hypertarget{fig}{}% - A figure. -\end{figure} -\bookmark[ - rellevel=1, - keeplevel, - dest=fig -]{A figure} -\subsection{Subsection B} -\subsubsection{Subsubsection C} -\subsection{Umlauts: \"A\"O\"U\"a\"o\"u\ss} -\newpage -\bookmarksetup{ - bold, - color=[rgb]{1,0,0} -} -\section{Very important section} -\bookmarksetup{ - italic, - bold=false, - color=blue -} -\subsection{Italic section} -\bookmarksetup{ - italic=false -} -\part{Misc} -\section{Diverse} -\subsubsection{Subsubsection, omitting subsection} -\bookmarksetup{ - startatroot -} -\section{Last section outside part} -\subsection{Subsection} -\bookmarksetup{ - color={} -} -\begingroup - \bookmarksetup{level=0, color=green!80!black} - \bookmark[named=FirstPage]{First page} - \bookmark[named=LastPage]{Last page} - \bookmark[named=PrevPage]{Previous page} - \bookmark[named=NextPage]{Next page} -\endgroup -\bookmark[ - page=2, - view=FitH 800 -]{Page 2, FitH 800} -\bookmark[ - page=2, - view=FitBH \calc{\paperheight-\topmargin-1in-\headheight-\headsep} -]{Page 2, FitBH top of text body} -\bookmark[ - uri={http://www.dante.de/}, - color=magenta -]{Dante homepage} -\bookmark[ - gotor={t.pdf}, - page=1, - view={XYZ 0 1000 null}, - color=cyan!75!black -]{File t.pdf} -\bookmark[named=FirstPage]{First page} -\bookmark[rellevel=1, named=LastPage]{Last page (rellevel=1)} -\bookmark[named=PrevPage]{Previous page} -\bookmark[level=0, named=FirstPage]{First page (level=0)} -\bookmark[ - rellevel=1, - keeplevel, - named=LastPage -]{Last page (rellevel=1, keeplevel)} -\bookmark[named=PrevPage]{Previous page} -\end{document} -% \end{macrocode} -% \begin{macrocode} -%</example> -% \end{macrocode} -% -% \StopEventually{ -% } -% -% \section{Implementation} -% -% \subsection{Package} -% -% \begin{macrocode} -%<*package> -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{bookmark}% - [2019/06/04 v1.27 PDF bookmarks (HO)]% -% \end{macrocode} -% -% \subsubsection{Requirements} -% -% \paragraph{\hologo{eTeX}.} -% -% \begin{macro}{\BKM@CalcExpr} -% \begin{macrocode} -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname numexpr\endcsname\relax - \def\BKM@CalcExpr#1#2#3#4{% - \begingroup - \count@=#2\relax - \advance\count@ by#3#4\relax - \edef\x{\endgroup - \def\noexpand#1{\the\count@}% - }% - \x - }% -\else - \def\BKM@CalcExpr#1#2#3#4{% - \edef#1{% - \the\numexpr#2#3#4\relax - }% - }% -\fi -% \end{macrocode} -% \end{macro} -% -% \paragraph{Escape features of \hologo{pdfTeX}.} -% -% \begin{macrocode} -\RequirePackage{pdfescape}[2007/03/20] -% \end{macrocode} -% \begin{macro}{\BKM@EscapeName} -% \begin{macrocode} -\def\BKM@EscapeName#1{% - \ifx#1\@empty - \else - \EdefEscapeName#1#1% - \fi -}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@EscapeString} -% \begin{macrocode} -\def\BKM@EscapeString#1{% - \ifx#1\@empty - \else - \EdefEscapeString#1#1% - \fi -}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@EscapeHex} -% \begin{macrocode} -\def\BKM@EscapeHex#1{% - \ifx#1\@empty - \else - \EdefEscapeHex#1#1% - \fi -}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@UnescapeHex} -% \begin{macrocode} -\def\BKM@UnescapeHex#1{% - \EdefUnescapeHex#1#1% -}% -% \end{macrocode} -% \end{macro} -% -% \paragraph{Packages.} -% -% \begin{macrocode} -\RequirePackage{ifpdf}[2009/04/10] -\RequirePackage{ifxetex} -\RequirePackage{ifvtex}[2008/11/04] -\RequirePackage{ifluatex}[2010/03/01] -\RequirePackage{pdftexcmds}[2010/11/04] -\RequirePackage{hyperref}[2010/06/18] -\RequirePackage{auxhook}[2007/04/06] -\RequirePackage{kvsetkeys}[2010/03/01] -\RequirePackage{kvoptions}[2009/08/13] -\RequirePackage{hycolor}[2008/09/08] -\RequirePackage{bitset}[2011/01/30] -\RequirePackage{ltxcmds}[2011/04/14] -% \end{macrocode} -% -% \subsubsection{Package options} -% -% \begin{macrocode} -\SetupKeyvalOptions{family=BKM,prefix=BKM@} -\DeclareLocalOptions{% - atend,% - bold,% - color,% - depth,% - dest,% - draft,% - final,% - gotor,% - italic,% - keeplevel,% - level,% - named,% - numbered,% - open,% - openlevel,% - page,% - rawaction,% - rellevel,% - srcfile,% - srcline,% - startatroot,% - uri,% - view,% -} -% \end{macrocode} -% \begin{macro}{\bookmarksetup} -% \begin{macrocode} -\newcommand*{\bookmarksetup}{\kvsetkeys{BKM}} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@setup} -% \begin{macrocode} -\def\BKM@setup#1{% - \bookmarksetup{#1}% - \ifx\BKM@HookNext\ltx@empty - \else - \expandafter\bookmarksetup\expandafter{\BKM@HookNext}% - \BKM@HookNextClear - \fi - \BKM@hook - \ifBKM@keeplevel - \else - \xdef\BKM@currentlevel{\BKM@level}% - \fi -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\bookmarksetupnext} -% \begin{macrocode} -\newcommand*{\bookmarksetupnext}[1]{% - \ltx@GlobalAppendToMacro\BKM@HookNext{,#1}% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@setupnext} -% \begin{macrocode} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@HookNextClear} -% \begin{macrocode} -\def\BKM@HookNextClear{% - \global\let\BKM@HookNext\ltx@empty -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@HookNext} -% \begin{macrocode} -\BKM@HookNextClear -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\DeclareBoolOption{draft} -\DeclareComplementaryOption{final}{draft} -% \end{macrocode} -% \begin{macro}{\BKM@DisableOptions} -% \begin{macrocode} -\def\BKM@DisableOptions{% - \DisableKeyvalOption[action=warning,package=bookmark]% - {BKM}{draft}% - \DisableKeyvalOption[action=warning,package=bookmark]% - {BKM}{final}% -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\DeclareBoolOption[\ifHy@bookmarksopen true\else false\fi]{open} -% \end{macrocode} -% \begin{macro}{\bookmark@open} -% \begin{macrocode} -\def\bookmark@open{% - \ifBKM@open\ltx@one\else\ltx@zero\fi -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\DeclareStringOption[\maxdimen]{openlevel} -% \end{macrocode} -% \begin{macro}{\BKM@openlevel} -% \begin{macrocode} -\edef\BKM@openlevel{\number\@bookmarksopenlevel} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -%\DeclareStringOption[\c@tocdepth]{depth} -\ltx@IfUndefined{Hy@bookmarksdepth}{% - \def\BKM@depth{\c@tocdepth}% -}{% - \let\BKM@depth\Hy@bookmarksdepth -} -\define@key{BKM}{depth}[]{% - \edef\BKM@param{#1}% - \ifx\BKM@param\@empty - \def\BKM@depth{\c@tocdepth}% - \else - \ltx@IfUndefined{toclevel@\BKM@param}{% - \@onelevel@sanitize\BKM@param - \edef\BKM@temp{\expandafter\@car\BKM@param\@nil}% - \ifcase 0\expandafter\ifx\BKM@temp-1\fi - \expandafter\ifnum\expandafter`\BKM@temp>47 % - \expandafter\ifnum\expandafter`\BKM@temp<58 % - 1% - \fi - \fi - \relax - \PackageWarning{bookmark}{% - Unknown document division name (\BKM@param)\MessageBreak - for option `depth'% - }% - \else - \BKM@SetDepthOrLevel\BKM@depth\BKM@param - \fi - }{% - \BKM@SetDepthOrLevel\BKM@depth{% - \csname toclevel@\BKM@param\endcsname - }% - }% - \fi -} -% \end{macrocode} -% \begin{macro}{\bookmark@depth} -% \begin{macrocode} -\def\bookmark@depth{\BKM@depth} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@SetDepthOrLevel} -% \begin{macrocode} -\def\BKM@SetDepthOrLevel#1#2{% - \begingroup - \setbox\z@=\hbox{% - \count@=#2\relax - \expandafter - }% - \expandafter\endgroup - \expandafter\def\expandafter#1\expandafter{\the\count@}% -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\DeclareStringOption[\BKM@currentlevel]{level}[\BKM@currentlevel] -\define@key{BKM}{level}{% - \edef\BKM@param{#1}% - \ifx\BKM@param\BKM@MacroCurrentLevel - \let\BKM@level\BKM@param - \else - \ltx@IfUndefined{toclevel@\BKM@param}{% - \@onelevel@sanitize\BKM@param - \edef\BKM@temp{\expandafter\@car\BKM@param\@nil}% - \ifcase 0\expandafter\ifx\BKM@temp-1\fi - \expandafter\ifnum\expandafter`\BKM@temp>47 % - \expandafter\ifnum\expandafter`\BKM@temp<58 % - 1% - \fi - \fi - \relax - \PackageWarning{bookmark}{% - Unknown document division name (\BKM@param)\MessageBreak - for option `level'% - }% - \else - \BKM@SetDepthOrLevel\BKM@level\BKM@param - \fi - }{% - \BKM@SetDepthOrLevel\BKM@level{% - \csname toclevel@\BKM@param\endcsname - }% - }% - \fi -} -% \end{macrocode} -% \begin{macro}{\BKM@MacroCurrentLevel} -% \begin{macrocode} -\def\BKM@MacroCurrentLevel{\BKM@currentlevel} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\DeclareBoolOption{keeplevel} -\DeclareBoolOption{startatroot} -% \end{macrocode} -% \begin{macro}{\BKM@startatrootfalse} -% \begin{macrocode} -\def\BKM@startatrootfalse{% - \global\let\ifBKM@startatroot\iffalse -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@startatroottrue} -% \begin{macrocode} -\def\BKM@startatroottrue{% - \global\let\ifBKM@startatroot\iftrue -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\define@key{BKM}{rellevel}{% - \BKM@CalcExpr\BKM@level{#1}+\BKM@currentlevel -} -% \end{macrocode} -% \begin{macro}{\bookmark@level} -% \begin{macrocode} -\def\bookmark@level{\BKM@level} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@currentlevel} -% \begin{macrocode} -\def\BKM@currentlevel{0} -% \end{macrocode} -% \end{macro} -% Make \xpackage{bookmark}'s option \xoption{numbered} an alias -% for \xpackage{hyperref}'s \xoption{bookmarksnumbered}. -% \begin{macrocode} -\DeclareBoolOption[% - \ifHy@bookmarksnumbered true\else false\fi -]{numbered} -\g@addto@macro\BKM@numberedtrue{% - \let\ifHy@bookmarksnumbered\iftrue -} -\g@addto@macro\BKM@numberedfalse{% - \let\ifHy@bookmarksnumbered\iffalse -} -\g@addto@macro\Hy@bookmarksnumberedtrue{% - \let\ifBKM@numbered\iftrue -} -\g@addto@macro\Hy@bookmarksnumberedfalse{% - \let\ifBKM@numbered\iffalse -} -% \end{macrocode} -% \begin{macro}{\bookmark@numbered} -% \begin{macrocode} -\def\bookmark@numbered{% - \ifBKM@numbered\ltx@one\else\ltx@zero\fi -} -% \end{macrocode} -% \end{macro} -% -% \paragraph{Redefinitions \xpackage{hyperref}'s options} -% -% \begin{macro}{\BKM@PatchHyperrefOption} -% \begin{macrocode} -\def\BKM@PatchHyperrefOption#1{% - \expandafter\BKM@@PatchHyperrefOption\csname KV@Hyp@#1\endcsname% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@@PatchHyperrefOption} -% \begin{macrocode} -\def\BKM@@PatchHyperrefOption#1{% - \expandafter\BKM@@@PatchHyperrefOption#1{##1}\BKM@nil#1% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@@@PatchHyperrefOption} -% \begin{macrocode} -\def\BKM@@@PatchHyperrefOption#1\BKM@nil#2#3{% - \def#2##1{% - #1% - \bookmarksetup{#3={##1}}% - }% -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\BKM@PatchHyperrefOption{bookmarksopen}{open} -\BKM@PatchHyperrefOption{bookmarksopenlevel}{openlevel} -\BKM@PatchHyperrefOption{bookmarksdepth}{depth} -% \end{macrocode} -% -% \paragraph{Font style options.} -% -% Caution: Package \xpackage{bitset} is zero-based, the -% PDF specifications starts with one. -% \begin{macrocode} -\bitsetReset{BKM@FontStyle}% -\define@key{BKM}{italic}[true]{% - \expandafter\ifx\csname if#1\endcsname\iftrue - \bitsetSet{BKM@FontStyle}{0}% - \else - \bitsetClear{BKM@FontStyle}{0}% - \fi -}% -\define@key{BKM}{bold}[true]{% - \expandafter\ifx\csname if#1\endcsname\iftrue - \bitsetSet{BKM@FontStyle}{1}% - \else - \bitsetClear{BKM@FontStyle}{1}% - \fi -}% -% \end{macrocode} -% \begin{macro}{\bookmark@italic} -% \begin{macrocode} -\def\bookmark@italic{% - \ifnum\bitsetGet{BKM@FontStyle}{0}=1 \ltx@one\else\ltx@zero\fi -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\bookmark@bold} -% \begin{macrocode} -\def\bookmark@bold{% - \ifnum\bitsetGet{BKM@FontStyle}{1}=1 \ltx@one\else\ltx@zero\fi -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@PrintStyle} -% \begin{macrocode} -\def\BKM@PrintStyle{% - \bitsetGetDec{BKM@FontStyle}% -}% -% \end{macrocode} -% \end{macro} -% -% \paragraph{Options for color.} -% -% \begin{macrocode} -\define@key{BKM}{color}{% - \HyColor@BookmarkColor{#1}\BKM@color{bookmark}{color}% -} -% \end{macrocode} -% \begin{macro}{\BKM@color} -% \begin{macrocode} -\let\BKM@color\@empty -% \end{macrocode} -% \end{macro} -% \begin{macro}{\bookmark@color} -% \begin{macrocode} -\def\bookmark@color{\BKM@color} -% \end{macrocode} -% \end{macro} -% -% \subsubsection{Action options} -% -% \begin{macrocode} -\def\BKM@temp#1{% - \DeclareStringOption{#1}% - \expandafter\edef\csname bookmark@#1\endcsname{% - \expandafter\noexpand\csname BKM@#1\endcsname - }% -} -% \end{macrocode} -% \begin{macro}{\bookmark@dest} -% \begin{macrocode} -\BKM@temp{dest} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\bookmark@named} -% \begin{macrocode} -\BKM@temp{named} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\bookmark@uri} -% \begin{macrocode} -\BKM@temp{uri} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\bookmark@gotor} -% \begin{macrocode} -\BKM@temp{gotor} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\bookmark@rawaction} -% \begin{macrocode} -\BKM@temp{rawaction} -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\define@key{BKM}{page}{% - \def\BKM@page{#1}% - \ifx\BKM@page\@empty - \else - \edef\BKM@page{\number\BKM@page}% - \ifnum\BKM@page>\z@ - \else - \PackageError{bookmark}{Page must be positive}\@ehc - \def\BKM@page{1}% - \fi - \fi -} -% \end{macrocode} -% \begin{macro}{\BKM@page} -% \begin{macrocode} -\let\BKM@page\@empty -% \end{macrocode} -% \end{macro} -% \begin{macro}{\bookmark@page} -% \begin{macrocode} -\def\bookmark@page{\BKM@@page} -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\define@key{BKM}{view}{% - \BKM@CheckView{#1}% -} -% \end{macrocode} -% \begin{macro}{\BKM@view} -% \begin{macrocode} -\let\BKM@view\@empty -% \end{macrocode} -% \end{macro} -% \begin{macro}{\bookmark@view} -% \begin{macrocode} -\def\bookmark@view{\BKM@view} -% \end{macrocode} -% \end{macro} -% \begin{macro}{BKM@CheckView} -% \begin{macrocode} -\def\BKM@CheckView#1{% - \BKM@CheckViewType#1 \@nil -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@CheckViewType} -% \begin{macrocode} -\def\BKM@CheckViewType#1 #2\@nil{% - \def\BKM@type{#1}% - \@onelevel@sanitize\BKM@type - \BKM@TestViewType{Fit}{}% - \BKM@TestViewType{FitB}{}% - \BKM@TestViewType{FitH}{% - \BKM@CheckParam#2 \@nil{top}% - }% - \BKM@TestViewType{FitBH}{% - \BKM@CheckParam#2 \@nil{top}% - }% - \BKM@TestViewType{FitV}{% - \BKM@CheckParam#2 \@nil{bottom}% - }% - \BKM@TestViewType{FitBV}{% - \BKM@CheckParam#2 \@nil{bottom}% - }% - \BKM@TestViewType{FitR}{% - \BKM@CheckRect{#2}{ }% - }% - \BKM@TestViewType{XYZ}{% - \BKM@CheckXYZ{#2}{ }% - }% - \@car{% - \PackageError{bookmark}{% - Unknown view type `\BKM@type',\MessageBreak - using `FitH' instead% - }\@ehc - \def\BKM@view{FitH}% - }% - \@nil -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@TestViewType} -% \begin{macrocode} -\def\BKM@TestViewType#1{% - \def\BKM@temp{#1}% - \@onelevel@sanitize\BKM@temp - \ifx\BKM@type\BKM@temp - \let\BKM@view\BKM@temp - \expandafter\@car - \else - \expandafter\@gobble - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{BKM@CheckParam} -% \begin{macrocode} -\def\BKM@CheckParam#1 #2\@nil#3{% - \def\BKM@param{#1}% - \ifx\BKM@param\@empty - \PackageWarning{bookmark}{% - Missing parameter (#3) for `\BKM@type',\MessageBreak - using 0% - }% - \def\BKM@param{0}% - \else - \BKM@CalcParam - \fi - \edef\BKM@view{\BKM@view\space\BKM@param}% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{BKM@CheckRect} -% \begin{macrocode} -\def\BKM@CheckRect#1#2{% - \BKM@@CheckRect#1#2#2#2#2\@nil -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@@CheckRect} -% \begin{macrocode} -\def\BKM@@CheckRect#1 #2 #3 #4 #5\@nil{% - \def\BKM@temp{0}% - \def\BKM@param{#1}% - \ifx\BKM@param\@empty - \def\BKM@param{0}% - \def\BKM@temp{1}% - \else - \BKM@CalcParam - \fi - \edef\BKM@view{\BKM@view\space\BKM@param}% - \def\BKM@param{#2}% - \ifx\BKM@param\@empty - \def\BKM@param{0}% - \def\BKM@temp{1}% - \else - \BKM@CalcParam - \fi - \edef\BKM@view{\BKM@view\space\BKM@param}% - \def\BKM@param{#3}% - \ifx\BKM@param\@empty - \def\BKM@param{0}% - \def\BKM@temp{1}% - \else - \BKM@CalcParam - \fi - \edef\BKM@view{\BKM@view\space\BKM@param}% - \def\BKM@param{#4}% - \ifx\BKM@param\@empty - \def\BKM@param{0}% - \def\BKM@temp{1}% - \else - \BKM@CalcParam - \fi - \edef\BKM@view{\BKM@view\space\BKM@param}% - \ifnum\BKM@temp>\z@ - \PackageWarning{bookmark}{Missing parameters for `\BKM@type'}% - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@CheckXYZ} -% \begin{macrocode} -\def\BKM@CheckXYZ#1#2{% - \BKM@@CheckXYZ#1#2#2#2\@nil -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@@CheckXYZ} -% \begin{macrocode} -\def\BKM@@CheckXYZ#1 #2 #3 #4\@nil{% - \def\BKM@param{#1}% - \let\BKM@temp\BKM@param - \@onelevel@sanitize\BKM@temp - \ifx\BKM@param\@empty - \let\BKM@param\BKM@null - \else - \ifx\BKM@temp\BKM@null - \else - \BKM@CalcParam - \fi - \fi - \edef\BKM@view{\BKM@view\space\BKM@param}% - \def\BKM@param{#2}% - \let\BKM@temp\BKM@param - \@onelevel@sanitize\BKM@temp - \ifx\BKM@param\@empty - \let\BKM@param\BKM@null - \else - \ifx\BKM@temp\BKM@null - \else - \BKM@CalcParam - \fi - \fi - \edef\BKM@view{\BKM@view\space\BKM@param}% - \def\BKM@param{#3}% - \ifx\BKM@param\@empty - \let\BKM@param\BKM@null - \fi - \edef\BKM@view{\BKM@view\space\BKM@param}% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@null} -% \begin{macrocode} -\def\BKM@null{null} -\@onelevel@sanitize\BKM@null -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\BKM@CalcParam} -% \begin{macrocode} -\def\BKM@CalcParam{% - \begingroup - \let\calc\@firstofone - \expandafter\BKM@@CalcParam\BKM@param\@empty\@empty\@nil -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@@CalcParam} -% \begin{macrocode} -\def\BKM@@CalcParam#1#2#3\@nil{% - \ifx\calc#1% - \@ifundefined{calc@assign@dimen}{% - \@ifundefined{dimexpr}{% - \setlength{\dimen@}{#2}% - }{% - \setlength{\dimen@}{\dimexpr#2\relax}% - }% - }{% - \setlength{\dimen@}{#2}% - }% - \dimen@.99626\dimen@ - \edef\BKM@param{\strip@pt\dimen@}% - \expandafter\endgroup - \expandafter\def\expandafter\BKM@param\expandafter{\BKM@param}% - \else - \endgroup - \fi -} -% \end{macrocode} -% \end{macro} -% -% \subsubsection{Option \xoption{atend}} -% -% \begin{macrocode} -\DeclareBoolOption{atend} -\g@addto@macro\BKM@DisableOptions{% - \DisableKeyvalOption[action=warning,package=bookmark]% - {BKM}{atend}% -} -% \end{macrocode} -% -% \subsubsection{Option \xoption{style}} -% -% \begin{macro}{\bookmarkdefinestyle} -% \begin{macrocode} -\newcommand*{\bookmarkdefinestyle}[2]{% - \@ifundefined{BKM@style@#1}{% - }{% - \PackageInfo{bookmark}{Redefining style `#1'}% - }% - \@namedef{BKM@style@#1}{#2}% -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\define@key{BKM}{style}{% - \BKM@StyleCall{#1}% -} -\newif\ifBKM@ok -% \end{macrocode} -% \begin{macro}{\BKM@StyleCall} -% \begin{macrocode} -\def\BKM@StyleCall#1{% - \@ifundefined{BKM@style@#1}{% - \PackageWarning{bookmark}{% - Ignoring unknown style `#1'% - }% - }{% -% \end{macrocode} -% Check style stack. -% \begin{macrocode} - \BKM@oktrue - \edef\BKM@StyleCurrent{#1}% - \@onelevel@sanitize\BKM@StyleCurrent - \let\BKM@StyleEntry\BKM@StyleEntryCheck - \BKM@StyleStack - \ifBKM@ok - \expandafter\@firstofone - \else - \PackageError{bookmark}{% - Ignoring recursive call of style `\BKM@StyleCurrent'% - }\@ehc - \expandafter\@gobble - \fi - {% -% \end{macrocode} -% Push current style on stack. -% \begin{macrocode} - \let\BKM@StyleEntry\relax - \edef\BKM@StyleStack{% - \BKM@StyleEntry{\BKM@StyleCurrent}% - \BKM@StyleStack - }% -% \end{macrocode} -% Call style. -% \begin{macrocode} - \expandafter\expandafter\expandafter\bookmarksetup - \expandafter\expandafter\expandafter{% - \csname BKM@style@\BKM@StyleCurrent\endcsname - }% -% \end{macrocode} -% Pop current style from stack. -% \begin{macrocode} - \BKM@StyleStackPop - }% - }% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@StyleStackPop} -% \begin{macrocode} -\def\BKM@StyleStackPop{% - \let\BKM@StyleEntry\relax - \edef\BKM@StyleStack{% - \expandafter\@gobbletwo\BKM@StyleStack - }% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@StyleEntryCheck} -% \begin{macrocode} -\def\BKM@StyleEntryCheck#1{% - \def\BKM@temp{#1}% - \ifx\BKM@temp\BKM@StyleCurrent - \BKM@okfalse - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@StyleStack} -% \begin{macrocode} -\def\BKM@StyleStack{} -% \end{macrocode} -% \end{macro} -% -% \subsubsection{Options for source file location} -% -% \begin{macrocode} -\DeclareStringOption{srcline} -\DeclareStringOption{srcfile} -% \end{macrocode} -% -% \subsubsection{Hook support} -% -% \begin{macro}{\BKM@hook} -% \begin{macrocode} -\def\BKM@hook{} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\define@key{BKM}{addtohook}{% - \ltx@LocalAppendToMacro\BKM@hook{#1}% -} -% \end{macrocode} -% -% \begin{macro}{bookmarkget} -% \begin{macrocode} -\newcommand*{\bookmarkget}[1]{% - \romannumeral0% - \ltx@ifundefined{bookmark@#1}{% - \ltx@space - }{% - \expandafter\expandafter\expandafter\ltx@space - \csname bookmark@#1\endcsname - }% -} -% \end{macrocode} -% \end{macro} -% -% \subsubsection{Driver setup and loading} -% -% \paragraph{Driver detection.} -% -% \begin{macro}{\BKM@DefineDriverKey} -% \begin{macrocode} -\def\BKM@DefineDriverKey#1{% - \define@key{BKM}{#1}[]{% - \def\BKM@driver{#1}% - }% - \g@addto@macro\BKM@DisableOptions{% - \DisableKeyvalOption[action=warning,package=bookmark]% - {BKM}{#1}% - }% -} -% \end{macrocode} -% \end{macro} -% \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}% -} -% \end{macrocode} -% \begin{macro}{\bookmark@driver} -% \begin{macrocode} -\def\bookmark@driver{\BKM@driver} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\InputIfFileExists{bookmark.cfg}{}{} -% \end{macrocode} -% \begin{macro}{\BookmarkDriverDefault} -% \begin{macrocode} -\providecommand*{\BookmarkDriverDefault}{dvips} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@driver} -% Lua\TeX\ and pdf\TeX\ share driver. -% \begin{macrocode} -\ifpdf - \def\BKM@driver{pdftex}% - \ifx\pdfoutline\@undefined - \ifx\pdfextension\@undefined\else - \protected\def\pdfoutline{\pdfextension outline } - \fi - \fi -\else - \ifxetex - \def\BKM@driver{dvipdfm}% - \else - \ifvtex - \def\BKM@driver{vtex}% - \else - \edef\BKM@driver{\BookmarkDriverDefault}% - \fi - \fi -\fi -% \end{macrocode} -% \end{macro} -% -% \paragraph{Process options.} -% -% \begin{macrocode} -\ProcessKeyvalOptions* -\BKM@DisableOptions -% \end{macrocode} -% -% \paragraph{Option \xoption{draft}} -% -% \begin{macrocode} -\ifBKM@draft - \PackageWarningNoLine{bookmark}{Draft mode on}% - \let\bookmarksetup\ltx@gobble - \let\BookmarkAtEnd\ltx@gobble - \let\bookmarkdefinestyle\ltx@gobbletwo - \let\bookmarkget\ltx@gobble - \let\pdfbookmark\ltx@undefined - \newcommand*{\pdfbookmark}[3][]{}% - \let\currentpdfbookmark\ltx@gobbletwo - \let\subpdfbookmark\ltx@gobbletwo - \let\belowpdfbookmark\ltx@gobbletwo - \newcommand*{\bookmark}[2][]{}% - \renewcommand*{\Hy@writebookmark}[5]{}% - \let\ReadBookmarks\relax - \let\BKM@DefGotoNameAction\ltx@gobbletwo % package `hypdestopt' - \expandafter\endinput -\fi -% \end{macrocode} -% -% \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}% -\fi -\def\BKM@temp{pdftex}% -\ifpdf - \ifx\BKM@temp\BKM@driver - \else - \PackageWarningNoLine{bookmark}{% - Wrong driver `\BKM@driver', using `pdftex' instead% - }% - \let\BKM@driver\BKM@temp - \fi -\else - \ifx\BKM@temp\BKM@driver - \PackageError{bookmark}{% - Wrong driver, pdfTeX is not running in PDF mode.\MessageBreak - Package loading is aborted% - }\@ehc - \expandafter\expandafter\expandafter\endinput - \fi - \def\BKM@temp{dvipdfm}% - \ifxetex - \ifx\BKM@temp\BKM@driver - \else - \PackageWarningNoLine{bookmark}{% - Wrong driver `\BKM@driver',\MessageBreak - using `dvipdfm' for XeTeX instead% - }% - \let\BKM@driver\BKM@temp - \fi - \else - \def\BKM@temp{vtex}% - \ifvtex - \ifx\BKM@temp\BKM@driver - \else - \PackageWarningNoLine{bookmark}{% - Wrong driver `\BKM@driver',\MessageBreak - using `vtex' for VTeX instead% - }% - \let\BKM@driver\BKM@temp - \fi - \else - \ifx\BKM@temp\BKM@driver - \PackageError{bookmark}{% - Wrong driver, VTeX is not running in PDF mode.\MessageBreak - Package loading is aborted% - }\@ehc - \expandafter\expandafter\expandafter\endinput - \fi - \fi - \fi -\fi -\InputIfFileExists{bkm-\BKM@driver.def}{}{% - \PackageError{bookmark}{% - Unsupported driver `\BKM@driver'.\MessageBreak - Package loading is aborted% - }\@ehc - \endinput -} -% \end{macrocode} -% -% \subsubsection{Compatibility for \xpackage{hyperref}} -% -% \begin{macro}{\pdfbookmark} -% \begin{macrocode} -\let\pdfbookmark\ltx@undefined -\newcommand*{\pdfbookmark}[3][0]{% - \bookmark[level=#1,dest={#3.#1}]{#2}% - \hyper@anchorstart{#3.#1}\hyper@anchorend -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\currentpdfbookmark} -% \begin{macrocode} -\def\currentpdfbookmark{% - \pdfbookmark[\BKM@currentlevel]% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\subpdfbookmark} -% \begin{macrocode} -\def\subpdfbookmark{% - \BKM@CalcExpr\BKM@CalcResult\BKM@currentlevel+1% - \expandafter\pdfbookmark\expandafter[\BKM@CalcResult]% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\belowpdfbookmark} -% \begin{macrocode} -\def\belowpdfbookmark#1#2{% - \xdef\BKM@gtemp{\number\BKM@currentlevel}% - \subpdfbookmark{#1}{#2}% - \global\let\BKM@currentlevel\BKM@gtemp -} -% \end{macrocode} -% \end{macro} -% -% Section number, text, label, level, file -% \begin{macro}{\Hy@writebookmark} -% \begin{macrocode} -\def\Hy@writebookmark#1#2#3#4#5{% - \ifnum#4>\BKM@depth\relax - \else - \def\BKM@type{#5}% - \ifx\BKM@type\Hy@bookmarkstype - \begingroup - \ifBKM@numbered - \let\numberline\Hy@numberline - \let\booknumberline\Hy@numberline - \let\partnumberline\Hy@numberline - \let\chapternumberline\Hy@numberline - \else - \let\numberline\@gobble - \let\booknumberline\@gobble - \let\partnumberline\@gobble - \let\chapternumberline\@gobble - \fi - \bookmark[level=#4,dest={#3}]{#2}% - \endgroup - \fi - \fi -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\ReadBookmarks} -% \begin{macrocode} -\let\ReadBookmarks\relax -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -%</package> -% \end{macrocode} -% -% \subsection{Driver for dvipdfm} -% -% \begin{macrocode} -%<*dvipdfm> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{bkm-dvipdfm.def}% - [2019/06/04 v1.27 bookmark driver for dvipdfm (HO)]% -% \end{macrocode} -% -% \begin{macro}{\BKM@id} -% \begin{macrocode} -\newcount\BKM@id -\BKM@id=\z@ -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\BKM@0} -% \begin{macrocode} -\@namedef{BKM@0}{000} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\ifBKM@sw} -% \begin{macrocode} -\newif\ifBKM@sw -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\bookmark} -% \begin{macrocode} -\newcommand*{\bookmark}[2][]{% - \if@filesw - \begingroup - \def\bookmark@text{#2}% - \BKM@setup{#1}% - \edef\BKM@prev{\the\BKM@id}% - \global\advance\BKM@id\@ne - \BKM@swtrue - \@whilesw\ifBKM@sw\fi{% - \def\BKM@abslevel{1}% - \ifnum\ifBKM@startatroot\z@\else\BKM@prev\fi=\z@ - \BKM@startatrootfalse - \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% - 0{\BKM@level}\BKM@abslevel - }% - \BKM@swfalse - \else - \expandafter\expandafter\expandafter\BKM@getx - \csname BKM@\BKM@prev\endcsname - \ifnum\BKM@level>\BKM@x@level\relax - \BKM@CalcExpr\BKM@abslevel\BKM@x@abslevel+1% - \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% - {\BKM@prev}{\BKM@level}\BKM@abslevel - }% - \BKM@swfalse - \else - \let\BKM@prev\BKM@x@parent - \fi - \fi - }% - \csname HyPsd@XeTeXBigCharstrue\endcsname - \pdfstringdef\BKM@title{\bookmark@text}% - \edef\BKM@FLAGS{\BKM@PrintStyle}% - \let\BKM@action\@empty - \ifx\BKM@gotor\@empty - \ifx\BKM@dest\@empty - \ifx\BKM@named\@empty - \ifx\BKM@rawaction\@empty - \ifx\BKM@uri\@empty - \ifx\BKM@page\@empty - \PackageError{bookmark}{Missing action}\@ehc - \edef\BKM@action{/Dest[@page1/Fit]}% - \else - \ifx\BKM@view\@empty - \def\BKM@view{Fit}% - \fi - \edef\BKM@action{/Dest[@page\BKM@page/\BKM@view]}% - \fi - \else - \BKM@EscapeString\BKM@uri - \edef\BKM@action{% - /A<<% - /S/URI% - /URI(\BKM@uri)% - >>% - }% - \fi - \else - \edef\BKM@action{/A<<\BKM@rawaction>>}% - \fi - \else - \BKM@EscapeName\BKM@named - \edef\BKM@action{% - /A<</S/Named/N/\BKM@named>>% - }% - \fi - \else - \BKM@EscapeString\BKM@dest - \edef\BKM@action{% - /A<<% - /S/GoTo% - /D(\BKM@dest)% - >>% - }% - \fi - \else - \ifx\BKM@dest\@empty - \ifx\BKM@page\@empty - \def\BKM@page{0}% - \else - \BKM@CalcExpr\BKM@page\BKM@page-1% - \fi - \ifx\BKM@view\@empty - \def\BKM@view{Fit}% - \fi - \edef\BKM@action{/D[\BKM@page/\BKM@view]}% - \else - \BKM@EscapeString\BKM@dest - \edef\BKM@action{/D(\BKM@dest)}% - \fi - \BKM@EscapeString\BKM@gotor - \edef\BKM@action{% - /A<<% - /S/GoToR% - /F(\BKM@gotor)% - \BKM@action - >>% - }% - \fi - \special{pdf:% - out \ifBKM@DvipdfmxOutlineOpen - [% - \ifBKM@open - \ifnum\BKM@level<% - \expandafter\ltx@firstofone\expandafter - {\number\BKM@openlevel} % - \else - -% - \fi - \else - -% - \fi - ] % - \fi - \BKM@abslevel - <<% - /Title(\BKM@title)% - \ifx\BKM@color\@empty - \else - /C[\BKM@color]% - \fi - \ifnum\BKM@FLAGS>\z@ - /F \BKM@FLAGS - \fi - \BKM@action - >>% - }% - \endgroup - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@getx} -% \begin{macrocode} -\def\BKM@getx#1#2#3{% - \def\BKM@x@parent{#1}% - \def\BKM@x@level{#2}% - \def\BKM@x@abslevel{#3}% -} -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -%</dvipdfm> -% \end{macrocode} -% -% \subsection{Driver for \hologo{VTeX}} -% -% \begin{macrocode} -%<*vtex> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{bkm-vtex.def}% - [2019/06/04 v1.27 bookmark driver for VTeX (HO)]% -% \end{macrocode} -% -% \begin{macrocode} -\ifvtexpdf -\else - \PackageWarningNoLine{bookmark}{% - The VTeX driver only supports PDF mode% - }% -\fi -% \end{macrocode} -% -% \begin{macro}{\BKM@id} -% \begin{macrocode} -\newcount\BKM@id -\BKM@id=\z@ -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\BKM@0} -% \begin{macrocode} -\@namedef{BKM@0}{00} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\ifBKM@sw} -% \begin{macrocode} -\newif\ifBKM@sw -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\bookmark} -% \begin{macrocode} -\newcommand*{\bookmark}[2][]{% - \if@filesw - \begingroup - \def\bookmark@text{#2}% - \BKM@setup{#1}% - \edef\BKM@prev{\the\BKM@id}% - \global\advance\BKM@id\@ne - \BKM@swtrue - \@whilesw\ifBKM@sw\fi{% - \ifnum\ifBKM@startatroot\z@\else\BKM@prev\fi=\z@ - \BKM@startatrootfalse - \def\BKM@parent{0}% - \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% - 0{\BKM@level}% - }% - \BKM@swfalse - \else - \expandafter\expandafter\expandafter\BKM@getx - \csname BKM@\BKM@prev\endcsname - \ifnum\BKM@level>\BKM@x@level\relax - \let\BKM@parent\BKM@prev - \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% - {\BKM@prev}{\BKM@level}% - }% - \BKM@swfalse - \else - \let\BKM@prev\BKM@x@parent - \fi - \fi - }% - \pdfstringdef\BKM@title{\bookmark@text}% - \BKM@vtex@title - \edef\BKM@FLAGS{\BKM@PrintStyle}% - \let\BKM@action\@empty - \ifx\BKM@gotor\@empty - \ifx\BKM@dest\@empty - \ifx\BKM@named\@empty - \ifx\BKM@rawaction\@empty - \ifx\BKM@uri\@empty - \ifx\BKM@page\@empty - \PackageError{bookmark}{Missing action}\@ehc - \def\BKM@action{!1}% - \else - \edef\BKM@action{!\BKM@page}% - \fi - \else - \BKM@EscapeString\BKM@uri - \edef\BKM@action{% - <u=% - /S/URI% - /URI(\BKM@uri)% - >% - }% - \fi - \else - \edef\BKM@action{<u=\BKM@rawaction>}% - \fi - \else - \BKM@EscapeName\BKM@named - \edef\BKM@action{% - <u=% - /S/Named% - /N/\BKM@named - >% - }% - \fi - \else - \BKM@EscapeString\BKM@dest - \edef\BKM@action{\BKM@dest}% - \fi - \else - \ifx\BKM@dest\@empty - \ifx\BKM@page\@empty - \def\BKM@page{1}% - \fi - \ifx\BKM@view\@empty - \def\BKM@view{Fit}% - \fi - \edef\BKM@action{/D[\BKM@page/\BKM@view]}% - \else - \BKM@EscapeString\BKM@dest - \edef\BKM@action{/D(\BKM@dest)}% - \fi - \BKM@EscapeString\BKM@gotor - \edef\BKM@action{% - <u=% - /S/GoToR% - /F(\BKM@gotor)% - \BKM@action - >>% - }% - \fi - \ifx\BKM@color\@empty - \let\BKM@RGBcolor\@empty - \else - \expandafter\BKM@toRGB\BKM@color\@nil - \fi - \special{% - !outline \BKM@action;% - p=\BKM@parent,% - i=\number\BKM@id,% - s=% - \ifBKM@open - \ifnum\BKM@level<\BKM@openlevel - o% - \else - c% - \fi - \else - c% - \fi,% - \ifx\BKM@RGBcolor\@empty - \else - c=\BKM@RGBcolor,% - \fi - \ifnum\BKM@FLAGS>\z@ - f=\BKM@FLAGS,% - \fi - t=\BKM@title - }% - \endgroup - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@getx} -% \begin{macrocode} -\def\BKM@getx#1#2{% - \def\BKM@x@parent{#1}% - \def\BKM@x@level{#2}% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@toRGB} -% \begin{macrocode} -\def\BKM@toRGB#1 #2 #3\@nil{% - \let\BKM@RGBcolor\@empty - \BKM@toRGBComponent{#1}% - \BKM@toRGBComponent{#2}% - \BKM@toRGBComponent{#3}% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@toRGBComponent} -% \begin{macrocode} -\def\BKM@toRGBComponent#1{% - \dimen@=#1pt\relax - \ifdim\dimen@>\z@ - \ifdim\dimen@<\p@ - \dimen@=255\dimen@ - \advance\dimen@ by 32768sp\relax - \divide\dimen@ by 65536\relax - \dimen@ii=\dimen@ - \divide\dimen@ii by 16\relax - \edef\BKM@RGBcolor{% - \BKM@RGBcolor - \BKM@toHexDigit\dimen@ii - }% - \dimen@ii=16\dimen@ii - \advance\dimen@-\dimen@ii - \edef\BKM@RGBcolor{% - \BKM@RGBcolor - \BKM@toHexDigit\dimen@ - }% - \else - \edef\BKM@RGBcolor{\BKM@RGBcolor FF}% - \fi - \else - \edef\BKM@RGBcolor{\BKM@RGBcolor00}% - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@toHexDigit} -% \begin{macrocode} -\def\BKM@toHexDigit#1{% - \ifcase\expandafter\@firstofone\expandafter{\number#1} % - 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or - 8\or 9\or A\or B\or C\or D\or E\or F% - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\begingroup - \catcode`\|=0 % - \catcode`\\=12 % -% \end{macrocode} -% \begin{macro}{\BKM@vtex@title} -% \begin{macrocode} - |gdef|BKM@vtex@title{% - |@onelevel@sanitize|BKM@title - |edef|BKM@title{|expandafter|BKM@vtex@leftparen|BKM@title\(|@nil}% - |edef|BKM@title{|expandafter|BKM@vtex@rightparen|BKM@title\)|@nil}% - |edef|BKM@title{|expandafter|BKM@vtex@zero|BKM@title\0|@nil}% - |edef|BKM@title{|expandafter|BKM@vtex@one|BKM@title\1|@nil}% - |edef|BKM@title{|expandafter|BKM@vtex@two|BKM@title\2|@nil}% - |edef|BKM@title{|expandafter|BKM@vtex@three|BKM@title\3|@nil}% - }% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@vtex@leftparen} -% \begin{macrocode} - |gdef|BKM@vtex@leftparen#1\(#2|@nil{% - #1% - |ifx||#2||% - |else - (% - |ltx@ReturnAfterFi{% - |BKM@vtex@leftparen#2|@nil - }% - |fi - }% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@vtex@rightparen} -% \begin{macrocode} - |gdef|BKM@vtex@rightparen#1\)#2|@nil{% - #1% - |ifx||#2||% - |else - )% - |ltx@ReturnAfterFi{% - |BKM@vtex@rightparen#2|@nil - }% - |fi - }% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@vtex@zero} -% \begin{macrocode} - |gdef|BKM@vtex@zero#1\0#2|@nil{% - #1% - |ifx||#2||% - |else - |noexpand|hv@pdf@char0% - |ltx@ReturnAfterFi{% - |BKM@vtex@zero#2|@nil - }% - |fi - }% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@vtex@one} -% \begin{macrocode} - |gdef|BKM@vtex@one#1\1#2|@nil{% - #1% - |ifx||#2||% - |else - |noexpand|hv@pdf@char1% - |ltx@ReturnAfterFi{% - |BKM@vtex@one#2|@nil - }% - |fi - }% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@vtex@two} -% \begin{macrocode} - |gdef|BKM@vtex@two#1\2#2|@nil{% - #1% - |ifx||#2||% - |else - |noexpand|hv@pdf@char2% - |ltx@ReturnAfterFi{% - |BKM@vtex@two#2|@nil - }% - |fi - }% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@vtex@three} -% \begin{macrocode} - |gdef|BKM@vtex@three#1\3#2|@nil{% - #1% - |ifx||#2||% - |else - |noexpand|hv@pdf@char3% - |ltx@ReturnAfterFi{% - |BKM@vtex@three#2|@nil - }% - |fi - }% -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -|endgroup -% \end{macrocode} -% -% \begin{macrocode} -%</vtex> -% \end{macrocode} -% -% \subsection{Driver for \hologo{pdfTeX}} -% -% \begin{macrocode} -%<*pdftex> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{bkm-pdftex.def}% - [2019/06/04 v1.27 bookmark driver for pdfTeX (HO)]% -% \end{macrocode} -% -% \begin{macro}{\BKM@DO@entry} -% \begin{macrocode} -\def\BKM@DO@entry#1#2{% - \begingroup - \kvsetkeys{BKM@DO}{#1}% - \def\BKM@DO@title{#2}% - \ifx\BKM@DO@srcfile\@empty - \else - \BKM@UnescapeHex\BKM@DO@srcfile - \fi - \BKM@UnescapeHex\BKM@DO@title - \expandafter\expandafter\expandafter\BKM@getx - \csname BKM@\BKM@DO@id\endcsname\@empty\@empty - \let\BKM@attr\@empty - \ifx\BKM@DO@flags\@empty - \else - \edef\BKM@attr{\BKM@attr/F \BKM@DO@flags}% - \fi - \ifx\BKM@DO@color\@empty - \else - \edef\BKM@attr{\BKM@attr/C[\BKM@DO@color]}% - \fi - \ifx\BKM@attr\@empty - \else - \edef\BKM@attr{attr{\BKM@attr}}% - \fi - \let\BKM@action\@empty - \ifx\BKM@DO@gotor\@empty - \ifx\BKM@DO@dest\@empty - \ifx\BKM@DO@named\@empty - \ifx\BKM@DO@rawaction\@empty - \ifx\BKM@DO@uri\@empty - \ifx\BKM@DO@page\@empty - \PackageError{bookmark}{% - Missing action\BKM@SourceLocation - }\@ehc - \edef\BKM@action{goto page1{/Fit}}% - \else - \ifx\BKM@DO@view\@empty - \def\BKM@DO@view{Fit}% - \fi - \edef\BKM@action{goto page\BKM@DO@page{/\BKM@DO@view}}% - \fi - \else - \BKM@UnescapeHex\BKM@DO@uri - \BKM@EscapeString\BKM@DO@uri - \edef\BKM@action{user{<</S/URI/URI(\BKM@DO@uri)>>}}% - \fi - \else - \BKM@UnescapeHex\BKM@DO@rawaction - \edef\BKM@action{% - user{% - <<% - \BKM@DO@rawaction - >>% - }% - }% - \fi - \else - \BKM@EscapeName\BKM@DO@named - \edef\BKM@action{% - user{<</S/Named/N/\BKM@DO@named>>}% - }% - \fi - \else - \BKM@UnescapeHex\BKM@DO@dest - \BKM@DefGotoNameAction\BKM@action\BKM@DO@dest - \fi - \else - \ifx\BKM@DO@dest\@empty - \ifx\BKM@DO@page\@empty - \def\BKM@DO@page{0}% - \else - \BKM@CalcExpr\BKM@DO@page\BKM@DO@page-1% - \fi - \ifx\BKM@DO@view\@empty - \def\BKM@DO@view{Fit}% - \fi - \edef\BKM@action{/D[\BKM@DO@page/\BKM@DO@view]}% - \else - \BKM@UnescapeHex\BKM@DO@dest - \BKM@EscapeString\BKM@DO@dest - \edef\BKM@action{/D(\BKM@DO@dest)}% - \fi - \BKM@UnescapeHex\BKM@DO@gotor - \BKM@EscapeString\BKM@DO@gotor - \edef\BKM@action{% - user{% - <<% - /S/GoToR% - /F(\BKM@DO@gotor)% - \BKM@action - >>% - }% - }% - \fi - \pdfoutline\BKM@attr\BKM@action - count\ifBKM@DO@open\else-\fi\BKM@x@childs - {\BKM@DO@title}% - \endgroup -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@DefGotoNameAction} -% Macro \cs{BKM@DefGotoNameAction} is a hook for -% package \xpackage{hypdestopt}. -% \begin{macrocode} -\def\BKM@DefGotoNameAction#1#2{% - \BKM@EscapeString\BKM@DO@dest - \edef#1{goto name{#2}}% -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -%</pdftex> -% \end{macrocode} -% -% \begin{macrocode} -%<*pdftex|pdfmark> -% \end{macrocode} -% \begin{macro}{\BKM@SourceLocation} -% \begin{macrocode} -\def\BKM@SourceLocation{% - \ifx\BKM@DO@srcfile\@empty - \ifx\BKM@DO@srcline\@empty - \else - .\MessageBreak - Source: line \BKM@DO@srcline - \fi - \else - \ifx\BKM@DO@srcline\@empty - .\MessageBreak - Source: file `\BKM@DO@srcfile'% - \else - .\MessageBreak - Source: file `\BKM@DO@srcfile', line \BKM@DO@srcline - \fi - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -%</pdftex|pdfmark> -% \end{macrocode} -% -% \subsection{Drivers with pdfmark specials} -% -% \subsubsection{Driver dvips} -% -% \begin{macrocode} -%<*dvips> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{bkm-dvips.def}% - [2019/06/04 v1.27 bookmark driver for dvips (HO)]% -% \end{macrocode} -% \begin{macro}{\BKM@PSHeaderFile} -% \begin{macrocode} -\def\BKM@PSHeaderFile#1{% - \special{header=#1}% -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -%</dvips> -% \end{macrocode} -% -% \subsubsection{Driver dvipsone} -% -% \begin{macrocode} -%<*dvipsone> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{bkm-dvipsone.def}% - [2019/06/04 v1.27 bookmark driver for dvipsone (HO)]% -% \end{macrocode} -% \begin{macro}{\BKM@PSHeaderFile} -% \begin{macrocode} -\def\BKM@PSHeaderFile#1{% - \special{header=#1}% -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -%</dvipsone> -% \end{macrocode} -% -% \subsubsection{Driver textures} -% -% \begin{macrocode} -%<*textures> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{bkm-textures.def}% - [2019/06/04 v1.27 bookmark driver for textures (HO)]% -% \end{macrocode} -% \begin{macro}{\BKM@PSHeaderFile} -% \begin{macrocode} -\def\BKM@PSHeaderFile#1{% - \special{prePostScriptfile #1}% -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -%</textures> -% \end{macrocode} -% -% \subsubsection{Common part} -% -% \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 -% the file \cs{BKM@filename} is not read during the \hologo{TeX} run. -% \begin{macrocode} -\def\BKM@pdfmark@out{% - \if@filesw - \newwrite\BKM@file - \immediate\openout\BKM@file=\BKM@filename\relax - \BKM@write{\@percentchar!}% - \BKM@write{/pdfmark where{pop}}% - \BKM@write{% - {% - /globaldict where{pop globaldict}{userdict}ifelse% - /pdfmark/cleartomark load put% - }% - }% - \BKM@write{ifelse}% - \else - \let\BKM@write\@gobble - \let\BKM@DO@entry\@gobbletwo - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@write} -% \begin{macrocode} -\def\BKM@write#{% - \immediate\write\BKM@file -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\BKM@DO@entry} -% The specification for pdfmark says that |/Color| is the -% name of the key for color, however ghostscript only passes -% the key into the PDF file, thus the key name must be |/C|. -% \begin{macrocode} -\def\BKM@DO@entry#1#2{% - \begingroup - \kvsetkeys{BKM@DO}{#1}% - \ifx\BKM@DO@srcfile\@empty - \else - \BKM@UnescapeHex\BKM@DO@srcfile - \fi - \def\BKM@DO@title{#2}% - \BKM@UnescapeHex\BKM@DO@title - \expandafter\expandafter\expandafter\BKM@getx - \csname BKM@\BKM@DO@id\endcsname\@empty\@empty - \let\BKM@attr\@empty - \ifx\BKM@DO@flags\@empty - \else - \edef\BKM@attr{\BKM@attr/F \BKM@DO@flags}% - \fi - \ifx\BKM@DO@color\@empty - \else - \edef\BKM@attr{\BKM@attr/C[\BKM@DO@color]}% - \fi - \let\BKM@action\@empty - \ifx\BKM@DO@gotor\@empty - \ifx\BKM@DO@dest\@empty - \ifx\BKM@DO@named\@empty - \ifx\BKM@DO@rawaction\@empty - \ifx\BKM@DO@uri\@empty - \ifx\BKM@DO@page\@empty - \PackageError{bookmark}{% - Missing action\BKM@SourceLocation - }\@ehc - \edef\BKM@action{% - /Action/GoTo% - /Page 1% - /View[/Fit]% - }% - \else - \ifx\BKM@DO@view\@empty - \def\BKM@DO@view{Fit}% - \fi - \edef\BKM@action{% - /Action/GoTo% - /Page \BKM@DO@page - /View[/\BKM@DO@view]% - }% - \fi - \else - \BKM@UnescapeHex\BKM@DO@uri - \BKM@EscapeString\BKM@DO@uri - \edef\BKM@action{% - /Action<<% - /Subtype/URI% - /URI(\BKM@DO@uri)% - >>% - }% - \fi - \else - \BKM@UnescapeHex\BKM@DO@rawaction - \edef\BKM@action{% - /Action<<% - \BKM@DO@rawaction - >>% - }% - \fi - \else - \BKM@EscapeName\BKM@DO@named - \edef\BKM@action{% - /Action<<% - /Subtype/Named% - /N/\BKM@DO@named - >>% - }% - \fi - \else - \BKM@UnescapeHex\BKM@DO@dest - \BKM@EscapeString\BKM@DO@dest - \edef\BKM@action{% - /Action/GoTo% - /Dest(\BKM@DO@dest)cvn% - }% - \fi - \else - \ifx\BKM@DO@dest\@empty - \ifx\BKM@DO@page\@empty - \def\BKM@DO@page{1}% - \fi - \ifx\BKM@DO@view\@empty - \def\BKM@DO@view{Fit}% - \fi - \edef\BKM@action{% - /Page \BKM@DO@page - /View[/\BKM@DO@view]% - }% - \else - \BKM@UnescapeHex\BKM@DO@dest - \BKM@EscapeString\BKM@DO@dest - \edef\BKM@action{% - /Dest(\BKM@DO@dest)cvn% - }% - \fi - \BKM@UnescapeHex\BKM@DO@gotor - \BKM@EscapeString\BKM@DO@gotor - \edef\BKM@action{% - /Action/GoToR% - /File(\BKM@DO@gotor)% - \BKM@action - }% - \fi - \BKM@write{[}% - \BKM@write{/Title(\BKM@DO@title)}% - \ifnum\BKM@x@childs>\z@ - \BKM@write{/Count \ifBKM@DO@open\else-\fi\BKM@x@childs}% - \fi - \ifx\BKM@attr\@empty - \else - \BKM@write{\BKM@attr}% - \fi - \BKM@write{\BKM@action}% - \BKM@write{/OUT pdfmark}% - \endgroup -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -%</pdfmark> -% \end{macrocode} -% -% \subsection{Common part for \xoption{pdftex} and \xoption{pdfmark}} -% -% \begin{macrocode} -%<*pdftex|pdfmark> -% \end{macrocode} -% -% \subsubsection{Write auxiliary file} -% -% \begin{macrocode} -\RequirePackage{auxhook} -% \end{macrocode} -% \begin{macrocode} -\AddLineBeginMainAux{% - \string\providecommand\string\BKM@entry[2]{}% -} -% \end{macrocode} -% -% \begin{macro}{\BKM@id} -% \begin{macrocode} -\newcount\BKM@id -\BKM@id=\z@ -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\BKM@0} -% \begin{macrocode} -\@namedef{BKM@0}{000} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\ifBKM@sw} -% \begin{macrocode} -\newif\ifBKM@sw -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\bookmark} -% \begin{macrocode} -\newcommand*{\bookmark}[2][]{% - \if@filesw - \begingroup - \BKM@InitSourceLocation - \def\bookmark@text{#2}% - \BKM@setup{#1}% - \ifx\BKM@srcfile\@empty - \else - \BKM@EscapeHex\BKM@srcfile - \fi - \edef\BKM@prev{\the\BKM@id}% - \global\advance\BKM@id\@ne - \BKM@swtrue - \@whilesw\ifBKM@sw\fi{% - \ifnum\ifBKM@startatroot\z@\else\BKM@prev\fi=\z@ - \BKM@startatrootfalse - \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% - 0{\BKM@level}0% - }% - \BKM@swfalse - \else - \expandafter\expandafter\expandafter\BKM@getx - \csname BKM@\BKM@prev\endcsname - \ifnum\BKM@level>\BKM@x@level\relax - \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% - {\BKM@prev}{\BKM@level}0% - }% - \ifnum\BKM@prev>\z@ - \BKM@CalcExpr\BKM@CalcResult\BKM@x@childs+1% - \expandafter\xdef\csname BKM@\BKM@prev\endcsname{% - {\BKM@x@parent}{\BKM@x@level}{\BKM@CalcResult}% - }% - \fi - \BKM@swfalse - \else - \let\BKM@prev\BKM@x@parent - \fi - \fi - }% - \pdfstringdef\BKM@title{\bookmark@text}% - \edef\BKM@FLAGS{\BKM@PrintStyle}% - \csname BKM@HypDestOptHook\endcsname - \BKM@EscapeHex\BKM@dest - \BKM@EscapeHex\BKM@uri - \BKM@EscapeHex\BKM@gotor - \BKM@EscapeHex\BKM@rawaction - \BKM@EscapeHex\BKM@title - \immediate\write\@mainaux{% - \string\BKM@entry{% - id=\number\BKM@id - \ifBKM@open - \ifnum\BKM@level<\BKM@openlevel - ,open% - \fi - \fi - \BKM@auxentry{dest}% - \BKM@auxentry{named}% - \BKM@auxentry{uri}% - \BKM@auxentry{gotor}% - \BKM@auxentry{page}% - \BKM@auxentry{view}% - \BKM@auxentry{rawaction}% - \BKM@auxentry{color}% - \ifnum\BKM@FLAGS>\z@ - ,flags=\BKM@FLAGS - \fi - \BKM@auxentry{srcline}% - \BKM@auxentry{srcfile}% - }{\BKM@title}% - }% - \endgroup - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@getx} -% \begin{macrocode} -\def\BKM@getx#1#2#3{% - \def\BKM@x@parent{#1}% - \def\BKM@x@level{#2}% - \def\BKM@x@childs{#3}% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@auxentry} -% \begin{macrocode} -\def\BKM@auxentry#1{% - \expandafter\ifx\csname BKM@#1\endcsname\@empty - \else - ,#1={\csname BKM@#1\endcsname}% - \fi -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\BKM@InitSourceLocation} -% \begin{macrocode} -\def\BKM@InitSourceLocation{% - \edef\BKM@srcline{\the\inputlineno}% - \BKM@LuaTeX@InitFile - \ifx\BKM@srcfile\@empty - \ltx@IfUndefined{currfilepath}{}{% - \edef\BKM@srcfile{\currfilepath}% - }% - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\BKM@LuaTeX@InitFile} -% \begin{macrocode} -\ifluatex - \ifnum\luatexversion>36 % - \def\BKM@LuaTeX@InitFile{% - \begingroup - \ltx@LocToksA={}% - \edef\x{\endgroup - \def\noexpand\BKM@srcfile{% - \the\expandafter\ltx@LocToksA - \directlua{% - if status and status.filename then % - tex.settoks('ltx@LocToksA', status.filename)% - end% - }% - }% - }\x - }% - \else - \let\BKM@LuaTeX@InitFile\relax - \fi -\else - \let\BKM@LuaTeX@InitFile\relax -\fi -% \end{macrocode} -% \end{macro} -% -% \subsubsection{Read auxiliary data} -% -% \begin{macrocode} -\SetupKeyvalOptions{family=BKM@DO,prefix=BKM@DO@} -\DeclareStringOption[0]{id} -\DeclareBoolOption{open} -\DeclareStringOption{flags} -\DeclareStringOption{color} -\DeclareStringOption{dest} -\DeclareStringOption{named} -\DeclareStringOption{uri} -\DeclareStringOption{gotor} -\DeclareStringOption{page} -\DeclareStringOption{view} -\DeclareStringOption{rawaction} -\DeclareStringOption{srcline} -\DeclareStringOption{srcfile} -% \end{macrocode} -% -% \begin{macrocode} -\AtBeginDocument{% - \let\BKM@entry\BKM@DO@entry -} -% \end{macrocode} -% -% \begin{macrocode} -%</pdftex|pdfmark> -% \end{macrocode} -% -% \subsection{Option \xoption{atend}} -% -% \subsubsection{Hook} -% -% \begin{macrocode} -%<*package> -% \end{macrocode} -% \begin{macrocode} -\ifBKM@atend -\else -% \end{macrocode} -% \begin{macro}{\BookmarkAtEnd} -% This is a dummy definition that generates a warning -% if option \xoption{atend} has not been given. -% \begin{macrocode} - \newcommand{\BookmarkAtEnd}[1]{% - \PackageWarning{bookmark}{% - Ignored, because option `atend' is missing% - }% - }% -% \end{macrocode} -% \end{macro} -% \begin{macrocode} - \expandafter\endinput -\fi -% \end{macrocode} -% \begin{macro}{\BookmarkAtEnd} -% \begin{macrocode} -\newcommand*{\BookmarkAtEnd}{% - \g@addto@macro\BKM@EndHook -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\let\BKM@EndHook\@empty -% \end{macrocode} -% \begin{macrocode} -%</package> -% \end{macrocode} -% -% \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. -% \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> -\ifBKM@atend - \AfterLastShipout{% - \BKM@EndHook - }% -\fi -%</pdftex|pdfmark> -% \end{macrocode} -% -% \subsubsection{Drivers using \cs{AtEndDvi}} -% -% 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> -\ifBKM@atend - \RequirePackage{atenddvi}% - \AtEndDvi{\BKM@EndHook}% -\fi -%</dvipdfm|vtex> -% \end{macrocode} -% -% \section{Installation} -% -% \subsection{Download} -% -% \paragraph{Package.} This package is available on -% CTAN\footnote{\CTANpkg{bookmark}}: -% \begin{description} -% \item[\CTAN{macros/latex/contrib/oberdiek/bookmark.dtx}] The source file. -% \item[\CTAN{macros/latex/contrib/oberdiek/bookmark.pdf}] Documentation. -% \end{description} -% -% -% \paragraph{Bundle.} All the packages of the bundle `oberdiek' -% are also available in a TDS compliant ZIP archive. There -% the packages are already unpacked and the documentation files -% are generated. The files and directories obey the TDS standard. -% \begin{description} -% \item[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] -% \end{description} -% \emph{TDS} refers to the standard ``A Directory Structure -% for \TeX\ Files'' (\CTANpkg{tds}). Directories -% with \xfile{texmf} in their name are usually organized this way. -% -% \subsection{Bundle installation} -% -% \paragraph{Unpacking.} Unpack the \xfile{oberdiek.tds.zip} in the -% TDS tree (also known as \xfile{texmf} tree) of your choice. -% Example (linux): -% \begin{quote} -% |unzip oberdiek.tds.zip -d ~/texmf| -% \end{quote} -% -% \subsection{Package installation} -% -% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting -% \docstrip\ archive. The files are extracted by running the -% \xfile{.dtx} through \plainTeX: -% \begin{quote} -% \verb|tex bookmark.dtx| -% \end{quote} -% -% \paragraph{TDS.} Now the different files must be moved into -% the different directories in your installation TDS tree -% (also known as \xfile{texmf} tree): -% \begin{quote} -% \def\t{^^A -% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} -% bookmark.sty & tex/latex/oberdiek/bookmark.sty\\ -% bkm-dvipdfm.def & tex/latex/oberdiek/bkm-dvipdfm.def\\ -% bkm-dvips.def & tex/latex/oberdiek/bkm-dvips.def\\ -% bkm-dvipsone.def & tex/latex/oberdiek/bkm-dvipsone.def\\ -% bkm-textures.def & tex/latex/oberdiek/bkm-textures.def\\ -% bkm-pdftex.def & tex/latex/oberdiek/bkm-pdftex.def\\ -% bkm-vtex.def & tex/latex/oberdiek/bkm-vtex.def\\ -% bookmark.pdf & doc/latex/oberdiek/bookmark.pdf\\ -% bookmark-example.tex & doc/latex/oberdiek/bookmark-example.tex\\ -% bookmark.dtx & source/latex/oberdiek/bookmark.dtx\\ -% \end{tabular}^^A -% }^^A -% \sbox0{\t}^^A -% \ifdim\wd0>\linewidth -% \begingroup -% \advance\linewidth by\leftmargin -% \advance\linewidth by\rightmargin -% \edef\x{\endgroup -% \def\noexpand\lw{\the\linewidth}^^A -% }\x -% \def\lwbox{^^A -% \leavevmode -% \hbox to \linewidth{^^A -% \kern-\leftmargin\relax -% \hss -% \usebox0 -% \hss -% \kern-\rightmargin\relax -% }^^A -% }^^A -% \ifdim\wd0>\lw -% \sbox0{\small\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\footnotesize\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\scriptsize\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\tiny\t}^^A -% \ifdim\wd0>\linewidth -% \lwbox -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \end{quote} -% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's -% TDS installing feature, then some files can already be in the right -% place, see the documentation of \docstrip. -% -% \subsection{Refresh file name databases} -% -% If your \TeX~distribution -% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh -% these. For example, \TeX\,Live\ users run \verb|texhash| or -% \verb|mktexlsr|. -% -% \subsection{Some details for the interested} -% -% \paragraph{Unpacking with \LaTeX.} -% The \xfile{.dtx} chooses its action depending on the format: -% \begin{description} -% \item[\plainTeX:] Run \docstrip\ and extract the files. -% \item[\LaTeX:] Generate the documentation. -% \end{description} -% If you insist on using \LaTeX\ for \docstrip\ (really, -% \docstrip\ does not need \LaTeX), then inform the autodetect routine -% about your intention: -% \begin{quote} -% \verb|latex \let\install=y\input{bookmark.dtx}| -% \end{quote} -% Do not forget to quote the argument according to the demands -% of your shell. -% -% \paragraph{Generating the documentation.} -% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate -% the documentation. The process can be configured by the -% configuration file \xfile{ltxdoc.cfg}. For instance, put this -% line into this file, if you want to have A4 as paper format: -% \begin{quote} -% \verb|\PassOptionsToClass{a4paper}{article}| -% \end{quote} -% An example follows how to generate the -% documentation with pdf\LaTeX: -% \begin{quote} -%\begin{verbatim} -%pdflatex bookmark.dtx -%makeindex -s gind.ist bookmark.idx -%pdflatex bookmark.dtx -%makeindex -s gind.ist bookmark.idx -%pdflatex bookmark.dtx -%\end{verbatim} -% \end{quote} -% -% \begin{thebibliography}{9} -% -% \bibitem{hyperref} -% Sebastian Rahtz, Heiko Oberdiek: -% \textit{The \xpackage{hyperref} package}; -% 2011/04/17 v6.82g; -% \CTANpkg{hyperref} -% -% \bibitem{currfile} -% Martin Scharrer: -% \textit{The \xpackage{currfile} package}; -% 2011/01/09 v0.4. -% \CTANpkg{currfile} -% -% \end{thebibliography} -% -% \begin{History} -% \begin{Version}{2007/02/19 v0.1} -% \item -% First experimental version. -% \end{Version} -% \begin{Version}{2007/02/20 v0.2} -% \item -% Option \xoption{startatroot} added. -% \item -% Dummies for \cs{pdf(un)escape...} commands added to get -% the package basically work for non-\hologo{pdfTeX} users. -% \end{Version} -% \begin{Version}{2007/02/21 v0.3} -% \item -% Dependency from \hologo{pdfTeX} 1.30 removed by using package -% \xpackage{pdfescape}. -% \end{Version} -% \begin{Version}{2007/02/22 v0.4} -% \item -% \xpackage{hyperref}'s \xoption{bookmarkstype} respected. -% \end{Version} -% \begin{Version}{2007/03/02 v0.5} -% \item -% Driver options \xoption{vtex} (PDF mode), \xoption{dvipsone}, -% and \xoption{textures} added. -% \item -% Implementation of option \xoption{depth} completed. Division names -% are supported, see \xpackage{hyperref}'s -% option \xoption{bookmarksdepth}. -% \item -% \xpackage{hyperref}'s options \xoption{bookmarksopen}, -% \xoption{bookmarksopenlevel}, and \xoption{bookmarksdepth} respected. -% \end{Version} -% \begin{Version}{2007/03/03 v0.6} -% \item -% Option \xoption{numbered} as alias for \xpackage{hyperref}'s -% \xoption{bookmarksnumbered}. -% \end{Version} -% \begin{Version}{2007/03/07 v0.7} -% \item -% Dependency from \hologo{eTeX} removed. -% \end{Version} -% \begin{Version}{2007/04/09 v0.8} -% \item -% Option \xoption{atend} added. -% \item -% Option \xoption{rgbcolor} removed. -% \verb|rgbcolor=<r> <g> <b>| can be replaced by -% \verb|color=[rgb]{<r>,<g>,<b>}|. -% \item -% Support of recent cvs version (2007-03-29) of dvipdfmx -% that extends the \cs{special} for bookmarks to specify -% open outline entries. Option \xoption{dvipdfmx-outline-open} -% or \cs{SpecialDvipdfmxOutlineOpen} notify the package. -% \end{Version} -% \begin{Version}{2007/04/25 v0.9} -% \item -% The syntax of \cs{special} of dvipdfmx, if feature -% \xoption{dvipdfmx-outline-open} is enabled, has changed. -% Now cvs version 2007-04-25 is needed. -% \end{Version} -% \begin{Version}{2007/05/29 v1.0} -% \item -% Bug fix in code for second parameter of XYZ. -% \end{Version} -% \begin{Version}{2007/07/13 v1.1} -% \item -% Fix for pdfmark with GoToR action. -% \end{Version} -% \begin{Version}{2007/09/25 v1.2} -% \item -% pdfmark driver respects \cs{nofiles}. -% \end{Version} -% \begin{Version}{2008/08/08 v1.3} -% \item -% Package \xpackage{flags} replaced by package \xpackage{bitset}. -% Now flags are also supported without \hologo{eTeX}. -% \item -% Hook for package \xpackage{hypdestopt} added. -% \end{Version} -% \begin{Version}{2008/09/13 v1.4} -% \item -% Fix for bug introduced in v1.3, package \xpackage{flags} is one-based, -% but package \xpackage{bitset} is zero-based. Thus options \xoption{bold} -% and \xoption{italic} are wrong in v1.3. (Daniel M\"ullner) -% \end{Version} -% \begin{Version}{2009/08/13 v1.5} -% \item -% Except for driver options the other options are now local options. -% This resolves a problem with KOMA-Script v3.00 and its option \xoption{open}. -% \end{Version} -% \begin{Version}{2009/12/06 v1.6} -% \item -% Use of package \xpackage{atveryend} for drivers \xoption{pdftex} -% and \xoption{pdfmark}. -% \end{Version} -% \begin{Version}{2009/12/07 v1.7} -% \item -% Use of package \xpackage{atveryend} fixed. -% \end{Version} -% \begin{Version}{2009/12/17 v1.8} -% \item -% Support of \xpackage{hyperref} 2009/12/17 v6.79v for \hologo{XeTeX}. -% \end{Version} -% \begin{Version}{2010/03/30 v1.9} -% \item -% Package name in an error message fixed. -% \end{Version} -% \begin{Version}{2010/04/03 v1.10} -% \item -% Option \xoption{style} and macro \cs{bookmarkdefinestyle} added. -% \item -% Hook support with option \xoption{addtohook} added. -% \item -% \cs{bookmarkget} added. -% \end{Version} -% \begin{Version}{2010/04/04 v1.11} -% \item -% Bug fix (introduced in v1.10). -% \end{Version} -% \begin{Version}{2010/04/08 v1.12} -% \item -% Requires \xpackage{ltxcmds} 2010/04/08. -% \end{Version} -% \begin{Version}{2010/07/23 v1.13} -% \item -% Support for \xclass{memoir}'s \cs{booknumberline} added. -% \end{Version} -% \begin{Version}{2010/09/02 v1.14} -% \item -% (Local) options \xoption{draft} and \xoption{final} added. -% \end{Version} -% \begin{Version}{2010/09/25 v1.15} -% \item -% Fix for option \xoption{dvipdfmx-outline-open}. -% \item -% Option \xoption{dvipdfmx-outline-open} is set automatically, -% if XeTeX $\geq$ 0.9995 is detected. -% \end{Version} -% \begin{Version}{2010/10/19 v1.16} -% \item -% Option `startatroot' now acts globally. -% \item -% Option `level' also accepts names the same way as option `depth'. -% \end{Version} -% \begin{Version}{2010/10/25 v1.17} -% \item -% \cs{bookmarksetupnext} added. -% \item -% Using \cs{kvsetkeys} of package \xpackage{kvsetkeys}, because -% \cs{setkeys} of package \xpackage{keyval} is not reentrant. -% This can cause problems (unknown keys) with older versions of -% hyperref that also uses \cs{setkeys} (found by GL). -% \end{Version} -% \begin{Version}{2010/11/05 v1.18} -% \item -% Use of \cs{pdf@ifdraftmode} of package \xpackage{pdftexcmds} for -% the default of option \xoption{draft}. -% \end{Version} -% \begin{Version}{2011/03/20 v1.19} -% \item -% Use of \cs{dimexpr} fixed, if \hologo{eTeX} is not used. -% (Bug found by Martin M\"unch.) -% \item -% Fix in documentation. Also layout options work without \hologo{eTeX}. -% \end{Version} -% \begin{Version}{2011/04/13 v1.20} -% \item -% Bug fix: \cs{BKM@SetDepth} renamed to \cs{BKM@SetDepthOrLevel}. -% \end{Version} -% \begin{Version}{2011/04/21 v1.21} -% \item -% Some support for file name and line number in error messages -% at end of document (pdfTeX and pdfmark based drivers). -% \end{Version} -% \begin{Version}{2011/05/13 v1.22} -% \item -% Change of version 2010/11/05 v1.18 reverted, because otherwise -% draftmode disables some \xext{aux} file entries. -% \end{Version} -% \begin{Version}{2011/09/19 v1.23} -% \item -% Some \cs{renewcommand}s changed to \cs{def} to avoid trouble -% if the commands are not defined, because hyperref stopped early. -% \end{Version} -% \begin{Version}{2011/12/02 v1.24} -% \item -% Small optimization in \cs{BKM@toHexDigit}. -% \end{Version} -% \begin{Version}{2016/05/16 v1.25} -% \item -% Documentation updates. -% \end{Version} -% \begin{Version}{2016/05/17 v1.26} -% \item -% define \cs{pdfbookmark} to allow pdftex driver to be used with Lua\TeX. -% \end{Version} -% \begin{Version}{2019/06/04 v1.27} -% \item -% unknown style options are ignored (issue 67) -% \end{Version} - -% \end{History} -% -% \PrintIndex -% -% \Finale -\endinput diff --git a/macros/latex/contrib/oberdiek/bookmark.pdf b/macros/latex/contrib/oberdiek/bookmark.pdf Binary files differdeleted file mode 100644 index d465c8285b..0000000000 --- a/macros/latex/contrib/oberdiek/bookmark.pdf +++ /dev/null diff --git a/macros/latex/contrib/oberdiek/embedfile.dtx b/macros/latex/contrib/oberdiek/embedfile.dtx deleted file mode 100644 index f88e4bf2ae..0000000000 --- a/macros/latex/contrib/oberdiek/embedfile.dtx +++ /dev/null @@ -1,2141 +0,0 @@ -% \iffalse meta-comment -% -% File: embedfile.dtx -% Version: 2018/11/01 v2.8 -% Info: Embed files into PDF -% -% Copyright (C) -% 2006-2011 Heiko Oberdiek -% 2016-2019 Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either -% version 1.3c of this license or (at your option) any later -% version. This version of this license is in -% https://www.latex-project.org/lppl/lppl-1-3c.txt -% and the latest version of this license is in -% https://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of -% LaTeX version 2005/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% The Current Maintainers of this work are -% Heiko Oberdiek and the Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% The Base Interpreter refers to any `TeX-Format', -% because some files are installed in TDS:tex/generic//. -% -% This work consists of the main source file embedfile.dtx -% and the derived files -% embedfile.sty, embedfile.pdf, embedfile.ins, embedfile.drv, -% dtx-attach.sty, embedfile-example-plain.tex, -% embedfile-example-collection.tex, embedfile-test1.tex, -% embedfile-test2.tex, embedfile-test3.tex, -% embedfile-test4.tex. -% -% Distribution: -% CTAN:macros/latex/contrib/oberdiek/embedfile.dtx -% CTAN:macros/latex/contrib/oberdiek/embedfile.pdf -% -% Unpacking: -% (a) If embedfile.ins is present: -% tex embedfile.ins -% (b) Without embedfile.ins: -% tex embedfile.dtx -% (c) If you insist on using LaTeX -% latex \let\install=y\input{embedfile.dtx} -% (quote the arguments according to the demands of your shell) -% -% Documentation: -% (a) If embedfile.drv is present: -% latex embedfile.drv -% (b) Without embedfile.drv: -% latex embedfile.dtx; ... -% The class ltxdoc loads the configuration file ltxdoc.cfg -% if available. Here you can specify further options, e.g. -% use A4 as paper format: -% \PassOptionsToClass{a4paper}{article} -% -% Programm calls to get the documentation (example): -% pdflatex embedfile.dtx -% makeindex -s gind.ist embedfile.idx -% pdflatex embedfile.dtx -% makeindex -s gind.ist embedfile.idx -% pdflatex embedfile.dtx -% -% Installation: -% TDS:tex/generic/oberdiek/embedfile.sty -% TDS:tex/generic/oberdiek/dtx-attach.sty -% TDS:doc/latex/oberdiek/embedfile.pdf -% TDS:doc/latex/oberdiek/embedfile-example-plain.tex -% TDS:doc/latex/oberdiek/embedfile-example-collection.tex -% TDS:doc/latex/oberdiek/test/embedfile-test1.tex -% TDS:doc/latex/oberdiek/test/embedfile-test2.tex -% TDS:doc/latex/oberdiek/test/embedfile-test3.tex -% TDS:doc/latex/oberdiek/test/embedfile-test4.tex -% TDS:source/latex/oberdiek/embedfile.dtx -% -%<*ignore> -\begingroup - \catcode123=1 % - \catcode125=2 % - \def\x{LaTeX2e}% -\expandafter\endgroup -\ifcase 0\ifx\install y1\fi\expandafter - \ifx\csname processbatchFile\endcsname\relax\else1\fi - \ifx\fmtname\x\else 1\fi\relax -\else\csname fi\endcsname -%</ignore> -%<*install> -\input docstrip.tex -\Msg{************************************************************************} -\Msg{* Installation} -\Msg{* Package: embedfile 2018/11/01 v2.8 Embed files into PDF (HO)} -\Msg{************************************************************************} - -\keepsilent -\askforoverwritefalse - -\let\MetaPrefix\relax -\preamble - -This is a generated file. - -Project: embedfile -Version: 2018/11/01 v2.8 - -Copyright (C) - 2006-2011 Heiko Oberdiek - 2016-2019 Oberdiek Package Support Group - -This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either -version 1.3c of this license or (at your option) any later -version. This version of this license is in - https://www.latex-project.org/lppl/lppl-1-3c.txt -and the latest version of this license is in - https://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of -LaTeX version 2005/12/01 or later. - -This work has the LPPL maintenance status "maintained". - -The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - - -The Base Interpreter refers to any `TeX-Format', -because some files are installed in TDS:tex/generic//. - -This work consists of the main source file embedfile.dtx -and the derived files - embedfile.sty, embedfile.pdf, embedfile.ins, embedfile.drv, - dtx-attach.sty, embedfile-example-plain.tex, - embedfile-example-collection.tex, embedfile-test1.tex, - embedfile-test2.tex, embedfile-test3.tex, - embedfile-test4.tex. - -\endpreamble -\let\MetaPrefix\DoubleperCent - -\generate{% - \file{embedfile.ins}{\from{embedfile.dtx}{install}}% - \file{embedfile.drv}{\from{embedfile.dtx}{driver}}% - \usedir{tex/generic/oberdiek}% - \file{embedfile.sty}{\from{embedfile.dtx}{package}}% - \usedir{tex/latex/oberdiek}% - \file{dtx-attach.sty}{\from{embedfile.dtx}{dtxattach}}% - \usedir{doc/latex/oberdiek}% - \file{embedfile-example-plain.tex}{\from{embedfile.dtx}{exampleplain}}% - \file{embedfile-example-collection.tex}{\from{embedfile.dtx}{examplecollection}}% -% \usedir{doc/latex/oberdiek/test}% -% \file{embedfile-test1.tex}{\from{embedfile.dtx}{test1}}% -% \file{embedfile-test2.tex}{\from{embedfile.dtx}{test2}}% -% \file{embedfile-test3.tex}{\from{embedfile.dtx}{test3}}% -% \file{embedfile-test4.tex}{\from{embedfile.dtx}{test4}}% - \nopreamble - \nopostamble -% \usedir{source/latex/oberdiek/catalogue}% -% \file{embedfile.xml}{\from{embedfile.dtx}{catalogue}}% -} - -\catcode32=13\relax% active space -\let =\space% -\Msg{************************************************************************} -\Msg{*} -\Msg{* To finish the installation you have to move the following} -\Msg{* files into a directory searched by TeX:} -\Msg{*} -\Msg{* embedfile.sty, dtx-attach.sty} -\Msg{*} -\Msg{* To produce the documentation run the file `embedfile.drv'} -\Msg{* through LaTeX.} -\Msg{*} -\Msg{* Happy TeXing!} -\Msg{*} -\Msg{************************************************************************} - -\endbatchfile -%</install> -%<*ignore> -\fi -%</ignore> -%<*driver> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{embedfile.drv}% - [2018/11/01 v2.8 Embed files into PDF (HO)]% -\documentclass{ltxdoc} -\usepackage{holtxdoc}[2011/11/22] -\begin{document} - \DocInput{embedfile.dtx}% -\end{document} -%</driver> -% \fi -% -% -% \CharacterTable -% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z -% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z -% Digits \0\1\2\3\4\5\6\7\8\9 -% Exclamation \! Double quote \" Hash (number) \# -% Dollar \$ Percent \% Ampersand \& -% Acute accent \' Left paren \( Right paren \) -% Asterisk \* Plus \+ Comma \, -% Minus \- Point \. Solidus \/ -% Colon \: Semicolon \; Less than \< -% Equals \= Greater than \> Question mark \? -% Commercial at \@ Left bracket \[ Backslash \\ -% Right bracket \] Circumflex \^ Underscore \_ -% Grave accent \` Left brace \{ Vertical bar \| -% Right brace \} Tilde \~} -% -% \GetFileInfo{embedfile.drv} -% -% \title{The \xpackage{embedfile} package} -% \date{2018/11/01 v2.8} -% \author{Heiko Oberdiek\thanks -% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} -% -% \maketitle -% -% \begin{abstract} -% This package embeds files to a PDF document. -% Currently the only supported driver is \pdfTeX\ $>=$ 1.30 in PDF mode. -% \end{abstract} -% -% \tableofcontents -% -% \section{Documentation} -% -% \subsection{Introduction} -% -% The PDF format (\cite{pdfspec}) allows the inclusion of files -% inside the PDF document. The included files can be bound to an -% annotation on a page. Or they can be recorded in a sorted -% list of embedded files. The packages \xpackage{attachfile} -% or \xpackage{attachfile2} follow the first approach, this -% package uses the latter method. -% -% \subsubsection{Future development} -% -% My dream is a large package that merges the features of -% all these packages meantioned before: -% \begin{itemize} -% \item Files can be attached to a page. -% \item Files can be attached to the document. -% \item An easy user interface for simple, common tasks and -% beginners. -% \item An interface for the advanced users that want to setup -% every detail. -% \item Support of many drivers (pdftex, dvips, dvipdfm, \dots). -% \item \dots -% \end{itemize} -% However, I have not managed to take the time for this project. -% Instead: -% \begin{itemize} -% \item First I experimented with package \xpackage{attachfile}, -% adding driver support, fixing bugs, \dots. The result is -% currently named as \xpackage{attachfile2}. It uses an external -% script to get file properties (size, date, checksum, \dots). -% \item In order to avoid an external program for getting basic -% file properties I provided a patch ``EscapeAndOther'' for -% pdfTeX that was accepted for version 1.30. -% \item This package closes a gap left by the packages for attaching -% files and allows the embedding of files to the document. -% Also it makes use of the new primitives of \pdfTeX. -% \end{itemize} -% -% \subsection{User interface} -% -% This package \xpackage{embedfile} can be used with both -% \LaTeX\ and \plainTeX. See \autoref{sec:plain} that -% explains the use with \plainTeX\ by an example. -% In \LaTeX\ the package is loaded as usually. There are no options. -% \begin{quote} -% \verb|\usepackage{embedfile}| -% \end{quote} -% -% \begin{declcs}{embedfile} -% |[|\meta{options}|]| \M{file} -% \end{declcs} -% The macro \cs{embedfile} includes file \meta{file} and -% attaches it to the PDF document. At the end of the document -% the sorted list of embedded files are written. Thus you can -% safely use \cs{embedfile} before \verb|\end{document}|. -% Embedding files using \cs{AtEndDocument} will only work, -% if \cs{AtEndDocument} is called before loading the package -% \xpackage{embedfile}. -% -% The \meta{options} are give as key value pairs. The following -% keys are supported: -% \begin{description} -% \item[\xoption{filespec}] -% This allows to override the file name -% that appears in the PDF file. If you are using other than -% simple file names (8-bit, path separators, \dots), look into -% the PDF specification (\cite{pdfspec}). -% There are rules how these file names must be written/encoded. -% Avoid 8-bit characters -% and other special characters, the behaviour is currently undefined. -% Use option \xoption{ucfilespec} for more funny file names. -% The string method, see below, is |escape| since version 2.4. -% -% This name is also used as entry in a name tree -% (see PDF specification: |/EmbeddedFiles|). Therefore the -% value for \xoption{filespec} must be unique among all -% embedded files. Also key \xoption{initialfiles} refers -% to this name, if the file name and the value of \xoption{filespec} -% are different. -% \item[\xoption{ucfilespec}] -% Since PDF 1.7 the file name may be provided in Unicode. -% The conversion of the option value into a PDF string -% is controlled by option \xoption{stringmethod}. -% \item[\xoption{filesystem}] -% This sets the entry \verb|/FS| in -% the file specification dictionary, see PDF specification -% (\cite{pdfspec}). -% Example: \verb|filesystem=URL|. -% \item[\xoption{mimetype}] -% This sets the mime type (\cite{mime}) of the file, -% see \autoref{sec:plain} for examples and \cite{types} -% for a list of officially registered types. -% \item[\xoption{desc}] -% The description for the file. -% \item[\xoption{stringmethod}] -% The package must convert the values of the keys \xoption{ucfilespec} -% and \xoption{desc} into a PDF string (before version 2.4: \xoption{filespec} -% and \xoption{desc}). If \xpackage{hyperref} -% is found, then its \cs{pdfstringdef} will be used, otherwise -% \pdfTeX's \cs{pdfescapestring} is used. Value \verb|psd| -% forces the use of \cs{pdfstringdef}, value \verb|escape| -% the use of \cs{pdfescapestring}. -% \item[\xoption{\meta{key}.value}] Sets the value of a collection -% item property, see section \ref{sec:collection}. -% \item[\xoption{\meta{key}.prefix}] -% Sets the prefix of a collection item property, -% see section \ref{sec:collection}. -% \item[\xoption{id}] -% The value must be an unique name. Macros -% \cs{embedfileifobjectexists} and \cs{embedfilegetobject} -% are using this name later. -% \end{description} -% -% \begin{declcs}{embedfilefinish} -% \end{declcs} -% The list of all embedded files must be added as data structure -% in the PDF file. In case of \LaTeX\ this is automatically done. -% The package uses \cs{AtEndDocument}. Then the list of all -% files should be known. However, \plainTeX\ does not know -% about \cs{AtEndDocument}. Thus the user must call -% \cs{embedfilefinish} at the end of the document -% after the last file is embedded. -% -% \begin{declcs}{embedfilesetup} \M{options} -% \end{declcs} -% Options for \cs{embedfile} and collection support -% can be set in \cs{embedfilesetup}. -% -% \subsection{Collection support (PDF 1.7)} -% \label{sec:collection} -% -% Since PDF 1.7 the embedded files can form a \emph{collection} -% (sometimes referred as \emph{package}), the main document -% is called \emph{cover sheet}. See PDF specification -% 8.2.4 ``Collections'' and 3.10.5 ``Collection items'' \cite{pdfspec}. -% -% Usually Acrobat Reader 7 or 8 shows the -% embedded files in a table at the bottom with the following columns: -% \begin{quote} -% \begin{tabular}{@{}l|l|l|l@{}} -% Name & Description & Modified & Size\\ -% \hline -% \dots & \dots & \dots & \dots\\ -% \end{tabular} -% \end{quote} -% Acrobat Reader 10 shows the embeded files in the left panel -% and adds a new column for the compressed size. -% -% If the files form a collection, then they are displayed -% in a table left or top (depending on option \xoption{view}, -% see \cs{embedfilesetup}). -% -% -% Collection support is enabled automatically, if -% it is used. -% -% \begin{declcs}{embedfilesetup} \M{options} -% \end{declcs} -% The following options are supported in addition -% to options for \cs{embedfile}: -% \begin{description} -% \item[\xoption{view}] -% If the PDF file contains a collection, then Acrobat Reader 8 -% shows a line at the top below the menu bar and the toolbar. -% It shows the current selected file, icons for changing the -% view mode, an options menu. -% The initial mode how the collection is presented is -% set by this option \xoption{view}. -% The following modes/values are supported, the default is |details|: -% \begin{description} -% \item[\texttt{details}] The full collection table is displayed -% at the top below the collection bar. -% \item[\texttt{tile}] The files of the collection are shown -% in tile mode on the left. -% \item[\texttt{hidden}] The collection table is not shown. -% \end{description} -% \item[\xoption{initialfile}] -% Selects the file that is initially presented. Especially -% useful for an embedded PDF file that is then shown instead -% of the cover document. There must be an \cs{embedfile} command -% somewhere whose value for key \xoption{filespec} is used here. -% The \cs{embedfile} command can drop option \xoption{filespec} -% if the file name is not different. -% \end{description} -% -% \begin{declcs}{embedfilefield} \M{key} \M{options} -% \end{declcs} -% Macro \cs{embedfilefield} defines a column/field in the collection table. -% The name of the field is \meta{key}. -% \begin{description} -% \item[\xoption{type}] -% sets the type of the field. The supported values are: -% \begin{description} -% \item[\texttt{text}] A text field. Its value is set in -% \cs{embedfile} by option \xoption{\meta{key}.value}. -% \item[\texttt{date}] A date field. Its value is set in -% \cs{embedfile} by option \xoption{\meta{key}.value}. -% A special format is required, see ``3.8.3 Dates'' \cite{pdfspec}. -% \item[\texttt{number}] A field with an integer or float number. -% Its value is set in \cs{embedfile} by option -% \xoption{\meta{key}.value}. -% \item[\texttt{file}] The file name of the embedded file. -% \item[\texttt{desc}] The description text of the embedded file. It is -% set in \cs{embedfile} by option \xoption{desc}. -% \item[\texttt{moddate}] The modification date of the embedded file. -% \item[\texttt{size}] The size of the embedded file. -% \end{description} -% All types allow the use of a prefix that is disregarded by -% sorting. The prefix for this field is set in \cs{embedfile} by -% option \xoption{\meta{key}.prefix}. -% \item[\xoption{title}] sets the column title. -% \item[\xoption{visible}] controls whether the column is presented: -% \begin{description} -% \item[\texttt{true}] shows the column. -% \item[\texttt{false}] hides the column. -% \end{description} -% Default: \texttt{true} -% \item[\xoption{edit}] -% Allows the editing of field values. Does not seem to have an -% effect for Acrobat Reader. -% \begin{description} -% \item[\texttt{true}] enables the feature, if available (depends -% on the PDF viewer). -% \item[\texttt{false}] disables the feature. -% \end{description} -% Default: \texttt{false} -% \end{description} -% The order of \cs{embedfilefield} statements defines the order -% of the columns. -% -% \begin{declcs}{embedfilesort} \M{key-sort-list} -% \end{declcs} -% The sort order of the embedded files are controlled by -% macro \cs{embedfilesort}. \meta{key-sort-list} defines -% the sort order. The key is a field name defined by \cs{embedfilefield}. -% Its value is either \texttt{ascending} or \texttt{descending}. -% The default is \texttt{ascending}. -% -% \subsection{Export of object references} -% -% Caution: This feature is still experimental. It may be even removed -% in future versions. Therefore feedback would be nice, if someone -% has a useful application for this feature. -% -% Object numbers are saved, if \xoption{id} is given in \cs{embedfile}. -% The following objects are supported: -% \begin{itemize} -% \item \texttt{EmbeddedFile} -% \item \texttt{Filespec} -% \end{itemize} -% -% \begin{declcs}{embedfileifobjectexists} \M{id} \M{type} -% \M{then} \M{else} -% \end{declcs} -% Macro \cs{embedfileifobjectexists} tests whether object of \meta{type} -% is available for the embedded file identified by \meta{id}. -% -% \begin{declcs}{embedfilegetobject} \M{id} \M{type} -% \end{declcs} -% Macro \cs{embedfilegetobject} expands to the full object reference -% object of \meta{type} for the embedded file identified by \meta{id}. -% -% \subsubsection{Example} -% -%\begin{quote} -%\begin{verbatim} -%\embedfile[id={foo}]{foo.pdf} -%\embedfileifobjectexists{foo}{Filespec}{% -% \typeout{% -% FileSpec object for `foo': % -% \embedfilegetobject{foo}{Filespec}% -% }% -%}{% -% \typeout{No Filespec object for `foo'}% -%} -%\end{verbatim} -%\end{quote} -% -% \subsection{Examples} -% \label{sec:examples} -% -% \subsubsection{\plainTeX} -% \label{sec:plain} -% -% The package can be used with \plainTeX. It can be used -% with or without help from \xfile{miniltx.tex}. -% -% If additionally package \xpackage{keyval} (\xpackage{graphicx}) -% is needed, load it first. Then package \xpackage{embedfile} avoids -% a duplicate loading of package \xpackage{keyval}. -% -% Because \plainTeX\ does not provide a hook at end of the document, -% you have to call \cs{embedfilefinish} manually at the end -% after the last embedded file. -% \begin{macrocode} -%<*exampleplain> -%<<END -% Load packages -\input miniltx -% \def\Gin@driver{pdftex.def} -% \input graphicx.sty -\input embedfile.sty -\resetatcatcode - -% default setting -\embedfilesetup{ - mimetype=text/plain -} - -% Embed files -\embedfile[ - filespec=example.tex, - desc={Source code (plain-TeX) of this example} -]{embedfile-example-plain.tex} - -\embedfile[ - desc={Source of package `embedfile'} -]{embedfile.dtx} - -\embedfile[ - mimetype=application/pdf, - desc={Documentation of package `embedfile'} -]{embedfile.pdf} - -% Some text -This example document contains three embedded files. - -% End of document -\embedfilefinish % don't forget -\bye -%END -%</exampleplain> -% \end{macrocode} -% -% \subsubsection{Collection example} -% -% \begin{macrocode} -%<*examplecollection> -%<<END -\NeedsTeXFormat{LaTeX2e} -\documentclass{article} -\usepackage[bookmarks=false]{hyperref} -% provides \pdfstringdef that is then used by `title' and -% other keys. -\usepackage{embedfile}[2018/11/01] -\embedfilesetup{ - view=details, - initialfile=embedfile.pdf -} -\embedfilefield{file}{ - type=file, - title={File name} -} -\embedfilefield{description}{ - type=desc, - title={Description} -} -\embedfilefield{date}{ - type=moddate, - title={Date} -} -\embedfilefield{size}{ - type=size, - title={Size} -} -\embedfilefield{type}{ - type=text, - title={Type}, - visible=false -} -\embedfilesort{ - type, - date=descending -} -\begin{document} -An example for embedded files as collection. -You need Acrobat Reader 8 or higher. - -\embedfile[ - desc={Source file of package `embedfile'}, - description.prefix={Package: }, - type.value={DTX} -]{embedfile.dtx} - -\embedfile[ - desc={Documentation of package `embedfile'}, - description.prefix={Package: }, - type.value={PDF} -]{embedfile.pdf} - -\embedfile[ - desc={The source for this example}, - description.prefix={Example: }, - type.value={TEX} -]{\jobname.tex} - -\end{document} -%END -%</examplecollection> -% \end{macrocode} -% -% \subsection{Package \xpackage{dtx-attach}} -% -% Package \xpackage{dtx-attach} is just a small application of -% package \xpackage{embedfile}. I am using it for the CTAN -% documentation of my packages in \CTANpkg{oberdiek}. -% It also serves as small example for the use of the package with \LaTeX. -% -% \begin{macrocode} -%<*dtxattach> -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{dtx-attach} - [2018/11/01 v2.8 Embed \string\jobname.dtx (HO)]% -\RequirePackage{embedfile}[2018/11/01] -\embedfile[% - stringmethod=escape,% - mimetype=plain/text,% - desc={LaTeX docstrip source archive for package `\jobname'}% -]{\jobname.dtx} -%</dtxattach> -% \end{macrocode} -% -% \StopEventually{ -% } -% -% \section{Implementation} -% -% \begin{macrocode} -%<*package> -% \end{macrocode} -% -% \subsection{Reload check and package identification} -% Reload check, especially if the package is not used with \LaTeX. -% \begin{macrocode} -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode35=6 % # - \catcode39=12 % ' - \catcode44=12 % , - \catcode45=12 % - - \catcode46=12 % . - \catcode58=12 % : - \catcode64=11 % @ - \catcode123=1 % { - \catcode125=2 % } - \expandafter\let\expandafter\x\csname ver@embedfile.sty\endcsname - \ifx\x\relax % plain-TeX, first loading - \else - \def\empty{}% - \ifx\x\empty % LaTeX, first loading, - % variable is initialized, but \ProvidesPackage not yet seen - \else - \expandafter\ifx\csname PackageInfo\endcsname\relax - \def\x#1#2{% - \immediate\write-1{Package #1 Info: #2.}% - }% - \else - \def\x#1#2{\PackageInfo{#1}{#2, stopped}}% - \fi - \x{embedfile}{The package is already loaded}% - \aftergroup\endinput - \fi - \fi -\endgroup% -% \end{macrocode} -% Package identification: -% \begin{macrocode} -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode35=6 % # - \catcode39=12 % ' - \catcode40=12 % ( - \catcode41=12 % ) - \catcode44=12 % , - \catcode45=12 % - - \catcode46=12 % . - \catcode47=12 % / - \catcode58=12 % : - \catcode64=11 % @ - \catcode91=12 % [ - \catcode93=12 % ] - \catcode123=1 % { - \catcode125=2 % } - \expandafter\ifx\csname ProvidesPackage\endcsname\relax - \def\x#1#2#3[#4]{\endgroup - \immediate\write-1{Package: #3 #4}% - \xdef#1{#4}% - }% - \else - \def\x#1#2[#3]{\endgroup - #2[{#3}]% - \ifx#1\@undefined - \xdef#1{#3}% - \fi - \ifx#1\relax - \xdef#1{#3}% - \fi - }% - \fi -\expandafter\x\csname ver@embedfile.sty\endcsname -\ProvidesPackage{embedfile}% - [2018/11/01 v2.8 Embed files into PDF (HO)]% -% \end{macrocode} -% -% \subsection{Catcodes} -% -% \begin{macrocode} -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode123=1 % { - \catcode125=2 % } - \catcode64=11 % @ - \def\x{\endgroup - \expandafter\edef\csname EmFi@AtEnd\endcsname{% - \endlinechar=\the\endlinechar\relax - \catcode13=\the\catcode13\relax - \catcode32=\the\catcode32\relax - \catcode35=\the\catcode35\relax - \catcode61=\the\catcode61\relax - \catcode64=\the\catcode64\relax - \catcode123=\the\catcode123\relax - \catcode125=\the\catcode125\relax - }% - }% -\x\catcode61\catcode48\catcode32=10\relax% -\catcode13=5 % ^^M -\endlinechar=13 % -\catcode35=6 % # -\catcode64=11 % @ -\catcode123=1 % { -\catcode125=2 % } -\def\TMP@EnsureCode#1#2{% - \edef\EmFi@AtEnd{% - \EmFi@AtEnd - \catcode#1=\the\catcode#1\relax - }% - \catcode#1=#2\relax -} -\TMP@EnsureCode{39}{12}% ' -\TMP@EnsureCode{40}{12}% ( -\TMP@EnsureCode{41}{12}% ) -\TMP@EnsureCode{44}{12}% , -\TMP@EnsureCode{46}{12}% . -\TMP@EnsureCode{47}{12}% / -\TMP@EnsureCode{58}{12}% : -\TMP@EnsureCode{60}{12}% < -\TMP@EnsureCode{62}{12}% > -\TMP@EnsureCode{91}{12}% [ -\TMP@EnsureCode{93}{12}% ] -\TMP@EnsureCode{96}{12}% ` -\edef\EmFi@AtEnd{\EmFi@AtEnd\noexpand\endinput} -% \end{macrocode} -% -% \subsection{Tools} -% -% \begin{macro}{\EmFi@RequirePackage} -% \begin{macrocode} -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname RequirePackage\endcsname\relax - \def\EmFi@RequirePackage#1[#2]{% - \input #1.sty\relax - }% -\else - \let\EmFi@RequirePackage\RequirePackage -\fi -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\EmFi@Error} -% \begin{macrocode} -\EmFi@RequirePackage{infwarerr}[2007/09/09]% -\def\EmFi@Error{% - \@PackageError{embedfile}% -} -% \end{macrocode} -% \end{macro} -% -% Luatex compat -% \begin{macrocode} -\ifx\pdfextension\@undefined\else - \protected\def\pdflastobj {\numexpr\pdffeedback lastobj\relax} - \protected\def\pdfnames {\pdfextension names } - \protected\def\pdfobj {\pdfextension obj } - \let\pdfoutput \outputmode -\fi -% \end{macrocode} -% -% \subsection{Check for recent \pdfTeX\ in PDF mode} -% -% Load package \xpackage{ifpdf} and check mode. -% \begin{macrocode} -\EmFi@RequirePackage{ifpdf}[2007/09/09] -\ifpdf -\else - \EmFi@Error{% - Missing pdfTeX in PDF mode% - }{% - Currently other drivers are not supported. % - Package loading is aborted.% - }% - \expandafter\EmFi@AtEnd -\fi% -% \end{macrocode} -% \begin{macrocode} -\EmFi@RequirePackage{pdftexcmds}[2007/11/11] -\EmFi@RequirePackage{ltxcmds}[2010/03/01] -\EmFi@RequirePackage{kvsetkeys}[2010/03/01] -\EmFi@RequirePackage{kvdefinekeys}[2010/03/01] -% \end{macrocode} -% Check version. -% \begin{macrocode} -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname pdf@filesize\endcsname\relax - \EmFi@Error{% - Unsupported pdfTeX version% - }{% - At least version 1.30 is necessary. Package loading is aborted.% - }% - \expandafter\EmFi@AtEnd -\fi% -% \end{macrocode} -% -% \subsection{Strings} -% -% Minimal version of package \xpackage{pdfescape} is 2007/08/27 v1.5 -% because of \cs{EdefSanitize}. -% \begin{macrocode} -\EmFi@RequirePackage{pdfescape}[2007/11/11] -% \end{macrocode} -% -% \begin{macrocode} -\def\EmFi@temp#1{% - \expandafter\EdefSanitize\csname EmFi@S@#1\endcsname{#1}% -} -% \end{macrocode} -% \begin{macro}{\EmFi@details} -% \begin{macrocode} -\EmFi@temp{details}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@tile} -% \begin{macrocode} -\EmFi@temp{tile}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@hidden} -% \begin{macrocode} -\EmFi@temp{hidden}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@S@text} -% \begin{macrocode} -\EmFi@temp{text} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@S@date} -% \begin{macrocode} -\EmFi@temp{date} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@S@number} -% \begin{macrocode} -\EmFi@temp{number} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@S@file} -% \begin{macrocode} -\EmFi@temp{file} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@S@desc} -% \begin{macrocode} -\EmFi@temp{desc} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@S@moddate} -% \begin{macrocode} -\EmFi@temp{moddate} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@S@creationdate} -% \begin{macrocode} -\EmFi@temp{creationdate} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@S@size} -% \begin{macrocode} -\EmFi@temp{size} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@S@ascending} -% \begin{macrocode} -\EmFi@temp{ascending} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@S@descending} -% \begin{macrocode} -\EmFi@temp{descending} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@S@true} -% \begin{macrocode} -\EmFi@temp{true} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@S@false} -% \begin{macrocode} -\EmFi@temp{false} -% \end{macrocode} -% \end{macro} -% -% \subsection{Switches} -% -% \begin{macro}{\ifEmFi@collection} -% \begin{macrocode} -\ltx@newif\ifEmFi@collection -% \end{macrocode} -% \end{macro} -% \begin{macro}{\ifEmFi@sort} -% \begin{macrocode} -\ltx@newif\ifEmFi@sort -% \end{macrocode} -% \end{macro} -% \begin{macro}{\ifEmFi@visible} -% \begin{macrocode} -\ltx@newif\ifEmFi@visible -% \end{macrocode} -% \end{macro} -% \begin{macro}{\ifEmFi@edit} -% \begin{macrocode} -\ltx@newif\ifEmFi@edit -% \end{macrocode} -% \end{macro} -% \begin{macro}{\ifEmFi@item} -% \begin{macrocode} -\ltx@newif\ifEmFi@item -% \end{macrocode} -% \end{macro} -% \begin{macro}{\ifEmFi@finished} -% \begin{macrocode} -\ltx@newif\ifEmFi@finished -% \end{macrocode} -% \end{macro} -% \begin{macro}{\ifEmFi@id} -% \begin{macrocode} -\ltx@newif\ifEmFi@id -% \end{macrocode} -% \end{macro} -% -% \subsection{Key value definitions} -% -% \begin{macro}{\EmFi@GlobalKey} -% \begin{macrocode} -\def\EmFi@GlobalKey#1#2{% - \global\expandafter\let\csname KV@#1@#2\expandafter\endcsname - \csname KV@#1@#2\endcsname -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@GlobalDefaultKey} -% \begin{macrocode} -\def\EmFi@GlobalDefaultKey#1#2{% - \EmFi@GlobalKey{#1}{#2}% - \global\expandafter\let - \csname KV@#1@#2@default\expandafter\endcsname - \csname KV@#1@#2@default\endcsname -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\EmFi@DefineKey} -% \begin{macrocode} -\def\EmFi@DefineKey#1#2{% - \kv@define@key{EmFi}{#1}{% - \expandafter\def\csname EmFi@#1\endcsname{##1}% - }% - \expandafter\def\csname EmFi@#1\endcsname{#2}% -} -% \end{macrocode} -% \end{macro} -% Subtype of the embedded file (optional). -% \begin{macrocode} -\EmFi@DefineKey{mimetype}{} -% \end{macrocode} -% File specification string. -% \begin{macrocode} -\EmFi@DefineKey{filespec}{\EmFi@file} -% \end{macrocode} -% File specification string in Unicode. -% \begin{macrocode} -\EmFi@DefineKey{ucfilespec}{} -% \end{macrocode} -% File system (optional). -% \begin{macrocode} -\EmFi@DefineKey{filesystem}{} -% \end{macrocode} -% Description (optional). -% \begin{macrocode} -\EmFi@DefineKey{desc}{} -% \end{macrocode} -% Method for converting text to PDF strings. -% \begin{macrocode} -\EmFi@DefineKey{stringmethod}{% - \ifx\pdfstringdef\@undefined - escape% - \else - \ifx\pdfstringdef\relax - escape% - \else - psd% - \fi - \fi -} -% \end{macrocode} -% -% Option \xoption{id} as key for object numbers. -% \begin{macrocode} -\kv@define@key{EmFi}{id}{% - \def\EmFi@id{#1}% - \EmFi@idtrue -} -% \end{macrocode} -% \begin{macro}{\EmFi@defobj} -% \begin{macrocode} -\def\EmFi@defobj#1{% - \ifEmFi@id - \expandafter\xdef\csname EmFi@#1@\EmFi@id\endcsname{% - \the\pdflastobj\ltx@space 0 R% - }% - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\embedfileifobjectexists} -% \begin{macrocode} -\def\embedfileifobjectexists#1#2{% - \expandafter\ifx\csname EmFi@#2@#1\endcsname\relax - \expandafter\ltx@secondoftwo - \else - \expandafter\ltx@firstoftwo - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\embedfilegetobject} -% \begin{macrocode} -\def\embedfilegetobject#1#2{% - \embedfileifobjectexists{#1}{#2}{% - \csname EmFi@#2@#1\endcsname - }{% - 0 0 R% - }% -} -% \end{macrocode} -% \end{macro} -% -% Initial view of the collection. -% \begin{macrocode} -\kv@define@key{EmFi}{view}[]{% - \EdefSanitize\EmFi@temp{#1}% - \def\EmFi@next{% - \global\EmFi@collectiontrue - }% - \ifx\EmFi@temp\ltx@empty - \let\EmFi@view\EmFi@S@details - \else\ifx\EmFi@temp\EmFi@S@details - \let\EmFi@view\EmFi@S@details - \else\ifx\EmFi@temp\EmFi@S@tile - \let\EmFi@view\EmFi@S@tile - \else\ifx\EmFi@temp\EmFi@S@hidden - \let\EmFi@view\EmFi@S@hidden - \else - \let\EmFi@next\relax - \EmFi@Error{% - Unknown value `\EmFi@temp' for key `view'.\MessageBreak - Supported values: `details', `tile', `hidden'.% - }\@ehc - \fi\fi\fi\fi - \EmFi@next -} -% \end{macrocode} -% \begin{macrocode} -\EmFi@DefineKey{initialfile}{} -% \end{macrocode} -% -% \begin{macro}{\embedfilesetup} -% \begin{macrocode} -\def\embedfilesetup{% - \ifEmFi@finished - \def\EmFi@next##1{}% - \EmFi@Error{% - \string\embedfilefield\ltx@space after \string\embedfilefinish - }{% - The list of embedded files is already written.% - }% - \else - \def\EmFi@next{% - \kvsetkeys{EmFi}% - }% - \fi - \EmFi@next -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\EmFi@schema} -% \begin{macrocode} -\def\EmFi@schema{} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@order} -% \begin{macrocode} -\gdef\EmFi@order{0} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@@order} -% \begin{macrocode} -\let\EmFi@@order\relax -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@fieldlist} -% \begin{macrocode} -\def\EmFi@fieldlist{} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@sortcase} -% \begin{macrocode} -\def\EmFi@sortcase{0}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\embedfilefield} -% \begin{macrocode} -\def\embedfilefield#1#2{% - \ifEmFi@finished - \EmFi@Error{% - \string\embedfilefield\ltx@space after \string\embedfilefinish - }{% - The list of embedded files is already written.% - }% - \else - \global\EmFi@collectiontrue - \EdefSanitize\EmFi@key{#1}% - \expandafter\ifx\csname KV@EmFi@\EmFi@key.prefix\endcsname\relax - \begingroup - \count@=\EmFi@order - \advance\count@ 1 % - \xdef\EmFi@order{\the\count@}% - \let\EmFi@title\EmFi@key - \let\EmFi@type\EmFi@S@text - \EmFi@visibletrue - \EmFi@editfalse - \kvsetkeys{EmFiFi}{#2}% - \EmFi@convert\EmFi@title\EmFi@title - \xdef\EmFi@schema{% - \EmFi@schema - /\pdf@escapename{\EmFi@key}<<% - /Subtype/% - \ifx\EmFi@type\EmFi@S@date D% - \else\ifx\EmFi@type\EmFi@S@number N% - \else\ifx\EmFi@type\EmFi@S@file F% - \else\ifx\EmFi@type\EmFi@S@desc Desc% - \else\ifx\EmFi@type\EmFi@S@moddate ModDate% - \else\ifx\EmFi@type\EmFi@S@creationdate CreationDate% - \else\ifx\EmFi@type\EmFi@S@size Size% - \else S% - \fi\fi\fi\fi\fi\fi\fi - /N(\EmFi@title)% - \EmFi@@order{\EmFi@order}% - \ifEmFi@visible - \else - /V false% - \fi - \ifEmFi@edit - /E true% - \fi - >>% - }% - \let\do\relax - \xdef\EmFi@fieldlist{% - \EmFi@fieldlist - \do{\EmFi@key}% - }% - \ifx\EmFi@type\EmFi@S@text - \kv@define@key{EmFi}{\EmFi@key.value}{% - \EmFi@itemtrue - \def\EmFi@temp{##1}% - \EmFi@convert\EmFi@temp\EmFi@temp - \expandafter\def\csname EmFi@V@#1% - \expandafter\endcsname\expandafter{% - \expandafter(\EmFi@temp)% - }% - }% - \EmFi@GlobalKey{EmFi}{\EmFi@key.value}% - \else\ifx\EmFi@type\EmFi@S@date - \kv@define@key{EmFi}{\EmFi@key.value}{% - \EmFi@itemtrue - \def\EmFi@temp{##1}% - \EmFi@convert\EmFi@temp\EmFi@temp - \expandafter\def\csname EmFi@V@#1% - \expandafter\endcsname\expandafter{% - \expandafter(\EmFi@temp)% - }% - }% - \EmFi@GlobalKey{EmFi}{\EmFi@key.value}% - \else\ifx\EmFi@type\EmFi@S@number - \kv@define@key{EmFi}{\EmFi@key.value}{% - \EmFi@itemtrue - \expandafter\EdefSanitize\csname EmFi@V@#1\endcsname{ ##1}% - }% - \EmFi@GlobalKey{EmFi}{\EmFi@key.value}% - \fi\fi\fi - \kv@define@key{EmFi}{\EmFi@key.prefix}{% - \EmFi@itemtrue - \expandafter\def\csname EmFi@P@#1\endcsname{##1}% - }% - \EmFi@GlobalKey{EmFi}{\EmFi@key.prefix}% - \kv@define@key{EmFiSo}{\EmFi@key}[ascending]{% - \EdefSanitize\EmFi@temp{##1}% - \ifx\EmFi@temp\EmFi@S@ascending - \def\EmFi@temp{true}% - \else\ifx\EmFi@temp\EmFi@S@descending - \def\EmFi@temp{false}% - \else - \def\EmFi@temp{}% - \EmFi@Error{% - Unknown sort order `\EmFi@temp'.\MessageBreak - Supported values: `\EmFi@S@ascending', % - `\EmFi@S@descending - }\@ehc - \fi\fi - \ifx\EmFi@temp\ltx@empty - \else - \xdef\EmFi@sortkeys{% - \EmFi@sortkeys - /\pdf@escapename{#1}% - }% - \ifx\EmFi@sortorders\ltx@empty - \global\let\EmFi@sortorders\EmFi@temp - \gdef\EmFi@sortcase{1}% - \else - \xdef\EmFi@sortorders{% - \EmFi@sortorders - \ltx@space - \EmFi@temp - }% - \xdef\EmFi@sortcase{2}% - \fi - \fi - }% - \EmFi@GlobalDefaultKey{EmFiSo}\EmFi@key - \endgroup - \else - \EmFi@Error{% - Field `\EmFi@key' is already defined% - }\@ehc - \fi - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\kv@define@key{EmFiFi}{type}{% - \EdefSanitize\EmFi@temp{#1}% - \ifx\EmFi@temp\EmFi@S@text - \let\EmFi@type\EmFi@temp - \else\ifx\EmFi@temp\EmFi@S@date - \let\EmFi@type\EmFi@temp - \else\ifx\EmFi@temp\EmFi@S@number - \let\EmFi@type\EmFi@temp - \else\ifx\EmFi@temp\EmFi@S@file - \let\EmFi@type\EmFi@temp - \else\ifx\EmFi@temp\EmFi@S@desc - \let\EmFi@type\EmFi@temp - \else\ifx\EmFi@temp\EmFi@S@moddate - \let\EmFi@type\EmFi@temp - \else\ifx\EmFi@temp\EmFi@S@creationdate - \let\EmFi@type\EmFi@temp - \else\ifx\EmFi@temp\EmFi@S@size - \let\EmFi@type\EmFi@temp - \else - \EmFi@Error{% - Unknown type `\EmFi@temp'.\MessageBreak - Supported types: `text', `date', `number', `file',\MessageBreak - `desc', `moddate', `creationdate', `size'% - }% - \fi\fi\fi\fi\fi\fi\fi\fi -} -% \end{macrocode} -% \begin{macrocode} -\kv@define@key{EmFiFi}{title}{% - \def\EmFi@title{#1}% -} -% \end{macrocode} -% \begin{macro}{\EmFi@setboolean} -% \begin{macrocode} -\def\EmFi@setboolean#1#2{% - \EdefSanitize\EmFi@temp{#2}% - \ifx\EmFi@temp\EmFi@S@true - \csname EmFi@#1true\endcsname - \else - \ifx\EmFi@temp\EmFi@S@false - \csname EmFi@#1false\endcsname - \else - \EmFi@Error{% - Unknown value `\EmFi@temp' for key `#1'.\MessageBreak - Supported values: `true', `false'% - }\@ehc - \fi - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\kv@define@key{EmFiFi}{visible}[true]{% - \EmFi@setboolean{visible}{#1}% -} -% \end{macrocode} -% \begin{macrocode} -\kv@define@key{EmFiFi}{edit}[true]{% - \EmFi@setboolean{edit}{#1}% -} -% \end{macrocode} -% -% \begin{macro}{\EmFi@sortkeys} -% \begin{macrocode} -\def\EmFi@sortkeys{} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@sortorders} -% \begin{macrocode} -\def\EmFi@sortorders{} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\embedfilesort} -% \begin{macrocode} -\def\embedfilesort{% - \kvsetkeys{EmFiSo}% -} -% \end{macrocode} -% \end{macro} -% -% \subsection{Embed the file} -% -% \begin{macro}{\embedfile} -% \begin{macrocode} -\def\embedfile{% - \ltx@ifnextchar[\EmFi@embedfile{\EmFi@embedfile[]}% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@embedfile} -% \begin{macrocode} -\def\EmFi@embedfile[#1]#2{% - \ifEmFi@finished - \EmFi@Error{% - \string\embedfile\ltx@space after \string\embedfilefinish - }{% - The list of embedded files is already written.% - }% - \else - \begingroup - \def\EmFi@file{#2}% - \kvsetkeys{EmFi}{#1}% - \expandafter\expandafter\expandafter - \ifx\expandafter\expandafter\expandafter - \\\pdf@filesize{\EmFi@file}\\% - \EmFi@Error{% - File `\EmFi@file' not found% - }{% - The unknown file is not embedded.% - }% - \else - \edef\EmFi@@filespec{% - \pdf@escapestring{\EmFi@filespec}% - }% - \ifx\EmFi@ucfilespec\ltx@empty - \let\EmFi@@ucfilespec\ltx@empty - \else - \EmFi@convert\EmFi@ucfilespec\EmFi@@ucfilespec - \fi - \ifx\EmFi@desc\ltx@empty - \let\EmFi@@desc\ltx@empty - \else - \EmFi@convert\EmFi@desc\EmFi@@desc - \fi - \ifEmFi@item - \let\do\EmFi@do - \immediate\pdfobj{% - <<% - \EmFi@fieldlist - >>% - }% - \edef\EmFi@ci{\the\pdflastobj}% - \fi - \immediate\pdfobj stream attr{% - /Type/EmbeddedFile% - \ifx\EmFi@mimetype\ltx@empty - \else - /Subtype/\pdf@escapename{\EmFi@mimetype}% - \fi - /Params<<% - /ModDate(\pdf@filemoddate{\EmFi@file})% - /Size \pdf@filesize{\EmFi@file}% - /CheckSum<\pdf@filemdfivesum{\EmFi@file}>% - >>% - }file{\EmFi@file}\relax - \EmFi@defobj{EmbeddedFile}% - \immediate\pdfobj{% - <<% - /Type/Filespec% - \ifx\EmFi@filesystem\ltx@empty - \else - /FS/\pdf@escapename{\EmFi@filesystem}% - \fi - /F(\EmFi@@filespec)% - \ifx\EmFi@@ucfilespec\ltx@empty - \else - /UF(\EmFi@@ucfilespec)% - \fi - \ifx\EmFi@@desc\ltx@empty - \else - /Desc(\EmFi@@desc)% - \fi - /EF<<% - /F \the\pdflastobj\ltx@space 0 R% - >>% - \ifEmFi@item - /CI \EmFi@ci\ltx@space 0 R% - \fi - >>% - }% - \EmFi@defobj{Filespec}% - \EmFi@add{% - \EmFi@@filespec - }{\the\pdflastobj\ltx@space 0 R}% - \fi - \endgroup - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@do} -% \begin{macrocode} -\def\EmFi@do#1{% - \expandafter\ifx\csname EmFi@P@#1\endcsname\relax - \expandafter\ifx\csname EmFi@V@#1\endcsname\relax - \else - /\pdf@escapename{#1}\csname EmFi@V@#1\endcsname - \fi - \else - /\pdf@escapename{#1}<<% - \expandafter\ifx\csname EmFi@V@#1\endcsname\relax - \else - /D\csname EmFi@V@#1\endcsname - \fi - /P(\csname EmFi@P@#1\endcsname)% - >>% - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\EmFi@convert} -% \begin{macrocode} -\def\EmFi@convert#1#2{% - \ifnum\pdf@strcmp{\EmFi@stringmethod}{psd}=0 % - \pdfstringdef\EmFi@temp{#1}% - \let#2\EmFi@temp - \else - \edef#2{\pdf@escapestring{#1}}% - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\global\let\EmFi@list\ltx@empty -% \end{macrocode} -% \begin{macro}{\EmFi@add} -% Sorting is done by the insertion sort algorithm. -% Probably the sorting could be done more reliable. -% However, the PDF specification is not too clear to me -% regarding precise sorting rules (how to deal with -% different encodings, escaped characters, \dots). -% \begin{macrocode} -\def\EmFi@add#1#2{% - \begingroup - \ifx\EmFi@list\ltx@empty - \xdef\EmFi@list{\noexpand\do{#1}{#2}}% - \else - \def\do##1##2{% - \ifnum\pdf@strcmp{##1}{#1}>0 % - \edef\x{% - \toks@{% - \the\toks@% - \noexpand\do{#1}{#2}% - \noexpand\do{##1}{##2}% - }% - }% - \x - \def\do####1####2{% - \toks@\expandafter{\the\toks@\do{####1}{####2}}% - }% - \def\stop{% - \xdef\EmFi@list{\the\toks@}% - }% - \else - \toks@\expandafter{\the\toks@\do{##1}{##2}}% - \fi - }% - \def\stop{% - \xdef\EmFi@list{\the\toks@\noexpand\do{#1}{#2}}% - }% - \toks@{}% - \EmFi@list\stop - \fi - \endgroup -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\embedfilefinish} -% \begin{macrocode} -\def\embedfilefinish{% - \ifEmFi@finished - \EmFi@Error{% - Too many invocations of \string\embedfilefinish - }{% - The list of embedded files is already written.% - }% - \else - \ifx\EmFi@list\ltx@empty - \else -% \end{macrocode} -% Write |/EmbeddedFiles| entry. -% \begin{macrocode} - \global\EmFi@finishedtrue - \begingroup - \def\do##1##2{% - (##1)##2% - }% - \immediate\pdfobj{% - <<% - /Names[\EmFi@list]% - >>% - }% - \pdfnames{% - /EmbeddedFiles \the\pdflastobj\ltx@space 0 R% - }% - \endgroup -% \end{macrocode} -% Write collection objects. -% \begin{macrocode} - \ifx\EmFi@initialfile\ltx@empty - \else - \EmFi@collectiontrue - \fi - \ifEmFi@collection - \ifx\EmFi@initialfile\ltx@empty - \let\EmFi@@initialfile\ltx@empty - \else - \edef\EmFi@@initialfile{% - \pdf@escapestring{\EmFi@initialfile}% - }% - \fi -% \end{macrocode} -% Look for initial file among the embedded files. -% \begin{macrocode} - \begingroup - \let\f=N% - \def\do##1##2{% - \def\x{##1}% - \ifx\x\EmFi@@initialfile - \let\f=Y% - \let\do\ltx@gobbletwo - \fi - }% - \EmFi@list - \expandafter\endgroup - \ifx\f Y% - \else - \@PackageWarningNoLine{embedfile}{% - Missing initial file `\EmFi@initialfile'\MessageBreak - among the embedded files% - }% - \let\EmFi@initialfile\ltx@empty - \let\EmFi@@initialfile\ltx@empty - \fi - \ifcase\EmFi@sortcase - \def\EmFi@temp{}% - \or - \def\EmFi@temp{% - /S\EmFi@sortkeys - /A \EmFi@sortorders - }% - \else - \def\EmFi@temp{% - /S[\EmFi@sortkeys]% - /A[\EmFi@sortorders]% - }% - \fi - \def\EmFi@@order##1{% - \ifnum\EmFi@order>1 % - /O ##1% - \fi - }% - \immediate\pdfobj{% - <<% - \ifx\EmFi@schema\ltx@empty - \else - /Schema<<\EmFi@schema>>% - \fi - \ifx\EmFi@@initialfile\ltx@empty - \else - /D(\EmFi@@initialfile)% - \fi - \ifx\EmFi@view\EmFi@S@tile - /View/T% - \else\ifx\EmFi@view\EmFi@S@hidden - /View/H% - \fi\fi - \ifx\EmFi@temp\ltx@empty - \EmFi@temp - \else - /Sort<<\EmFi@temp>>% - \fi - >>% - }% - \pdfcatalog{% - /Collection \the\pdflastobj\ltx@space0 R% - }% - \fi - \fi - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname AtEndDocument\endcsname\relax -\else - \AtEndDocument{\embedfilefinish}% -\fi -% \end{macrocode} -% -% \begin{macrocode} -\EmFi@AtEnd% -%</package> -% \end{macrocode} -% -% \section{Test} -% -% \subsection{Catcode checks for loading} -% -% \begin{macrocode} -%<*test1> -% \end{macrocode} -% \begin{macrocode} -\catcode`\{=1 % -\catcode`\}=2 % -\catcode`\#=6 % -\catcode`\@=11 % -\expandafter\ifx\csname count@\endcsname\relax - \countdef\count@=255 % -\fi -\expandafter\ifx\csname @gobble\endcsname\relax - \long\def\@gobble#1{}% -\fi -\expandafter\ifx\csname @firstofone\endcsname\relax - \long\def\@firstofone#1{#1}% -\fi -\expandafter\ifx\csname loop\endcsname\relax - \expandafter\@firstofone -\else - \expandafter\@gobble -\fi -{% - \def\loop#1\repeat{% - \def\body{#1}% - \iterate - }% - \def\iterate{% - \body - \let\next\iterate - \else - \let\next\relax - \fi - \next - }% - \let\repeat=\fi -}% -\def\RestoreCatcodes{} -\count@=0 % -\loop - \edef\RestoreCatcodes{% - \RestoreCatcodes - \catcode\the\count@=\the\catcode\count@\relax - }% -\ifnum\count@<255 % - \advance\count@ 1 % -\repeat - -\def\RangeCatcodeInvalid#1#2{% - \count@=#1\relax - \loop - \catcode\count@=15 % - \ifnum\count@<#2\relax - \advance\count@ 1 % - \repeat -} -\def\RangeCatcodeCheck#1#2#3{% - \count@=#1\relax - \loop - \ifnum#3=\catcode\count@ - \else - \errmessage{% - Character \the\count@\space - with wrong catcode \the\catcode\count@\space - instead of \number#3% - }% - \fi - \ifnum\count@<#2\relax - \advance\count@ 1 % - \repeat -} -\def\space{ } -\expandafter\ifx\csname LoadCommand\endcsname\relax - \def\LoadCommand{\input embedfile.sty\relax}% -\fi -\def\Test{% - \RangeCatcodeInvalid{0}{47}% - \RangeCatcodeInvalid{58}{64}% - \RangeCatcodeInvalid{91}{96}% - \RangeCatcodeInvalid{123}{255}% - \catcode`\@=12 % - \catcode`\\=0 % - \catcode`\%=14 % - \LoadCommand - \RangeCatcodeCheck{0}{36}{15}% - \RangeCatcodeCheck{37}{37}{14}% - \RangeCatcodeCheck{38}{47}{15}% - \RangeCatcodeCheck{48}{57}{12}% - \RangeCatcodeCheck{58}{63}{15}% - \RangeCatcodeCheck{64}{64}{12}% - \RangeCatcodeCheck{65}{90}{11}% - \RangeCatcodeCheck{91}{91}{15}% - \RangeCatcodeCheck{92}{92}{0}% - \RangeCatcodeCheck{93}{96}{15}% - \RangeCatcodeCheck{97}{122}{11}% - \RangeCatcodeCheck{123}{255}{15}% - \RestoreCatcodes -} -\Test -\csname @@end\endcsname -\end -% \end{macrocode} -% \begin{macrocode} -%</test1> -% \end{macrocode} -% -% \subsection{Simple test} -% -% \begin{macrocode} -%<*test2> -\input embedfile.sty\relax -\embedfile[% - stringmethod=escape,% - mimetype=plain/text,% - desc={LaTeX docstrip source archive for package `embedfile'},% - id={embedfile.dtx}% -]{embedfile.dtx} -\nopagenumbers -Test (plain-\TeX): {\tt embedfile.dtx} should be embedded.% - -\def\Test#1{% - \par - \embedfileifobjectexists{embedfile.dtx}{#1}{% - Object #1 (embedfile.dtx): % - \embedfilegetobject{embedfile.dtx}{#1}% - }{% - \errmessage{Missing object #1 (embedfile.dtx)}% - }% -} -\Test{EmbeddedFile} -\Test{Filespec} -\embedfilefinish -\bye -%</test2> -% \end{macrocode} -% \begin{macrocode} -%<*test3> -\NeedsTeXFormat{LaTeX2e} -\let\SavedJobname\jobname -\def\jobname{embedfile} -\RequirePackage{dtx-attach}[2018/11/01] -\let\jobname\SavedJobname -\documentclass{minimal} -\begin{document} - Test (\LaTeX): \texttt{embedfile.dtx} should be embedded.% -\end{document} -%</test3> -% \end{macrocode} -% -% \subsection{Test for \iniTeX} -% -% \begin{macrocode} -%<*test4> -\catcode`\{=1 % -\catcode`\}=2 % -\input ifluatex.sty % -\ifluatex - \directlua{% - tex.enableprimitives('', {% - 'pdflastobj',% - 'pdfnames',% - 'pdfobj',% - 'pdfoutput'% - })% - }% - \ifx\pdfextension\undefined\else - \protected\def\pdflastobj {\numexpr\pdffeedback lastobj\relax} - \protected\def\pdfnames {\pdfextension names } - \protected\def\pdfobj {\pdfextension obj } - \let\pdfoutput \outputmode - \fi -\fi -\pdfoutput=1 % -\input embedfile.sty % -\shipout\hbox{} -\embedfile[% - stringmethod=escape,% - mimetype=plain/text,% - desc={iniTeX source},% -]{\jobname.tex} -\embedfilefinish -\end -%</test4> -% \end{macrocode} -% -% \section{Installation} -% -% \subsection{Download} -% -% \paragraph{Package.} This package is available on -% CTAN\footnote{\CTANpkg{embedfile}}: -% \begin{description} -% \item[\CTAN{macros/latex/contrib/oberdiek/embedfile.dtx}] The source file. -% \item[\CTAN{macros/latex/contrib/oberdiek/embedfile.pdf}] Documentation. -% \end{description} -% -% -% \paragraph{Bundle.} All the packages of the bundle `oberdiek' -% are also available in a TDS compliant ZIP archive. There -% the packages are already unpacked and the documentation files -% are generated. The files and directories obey the TDS standard. -% \begin{description} -% \item[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] -% \end{description} -% \emph{TDS} refers to the standard ``A Directory Structure -% for \TeX\ Files'' (\CTANpkg{tds}). Directories -% with \xfile{texmf} in their name are usually organized this way. -% -% \subsection{Bundle installation} -% -% \paragraph{Unpacking.} Unpack the \xfile{oberdiek.tds.zip} in the -% TDS tree (also known as \xfile{texmf} tree) of your choice. -% Example (linux): -% \begin{quote} -% |unzip oberdiek.tds.zip -d ~/texmf| -% \end{quote} -% -% \subsection{Package installation} -% -% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting -% \docstrip\ archive. The files are extracted by running the -% \xfile{.dtx} through \plainTeX: -% \begin{quote} -% \verb|tex embedfile.dtx| -% \end{quote} -% -% \paragraph{TDS.} Now the different files must be moved into -% the different directories in your installation TDS tree -% (also known as \xfile{texmf} tree): -% \begin{quote} -% \def\t{^^A -% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} -% embedfile.sty & tex/generic/oberdiek/embedfile.sty\\ -% dtx-attach.sty & tex/generic/oberdiek/dtx-attach.sty\\ -% embedfile.pdf & doc/latex/oberdiek/embedfile.pdf\\ -% embedfile-example-plain.tex & doc/latex/oberdiek/embedfile-example-plain.tex\\ -% embedfile-example-collection.tex & doc/latex/oberdiek/embedfile-example-collection.tex\\ -% test/embedfile-test1.tex & doc/latex/oberdiek/test/embedfile-test1.tex\\ -% test/embedfile-test2.tex & doc/latex/oberdiek/test/embedfile-test2.tex\\ -% test/embedfile-test3.tex & doc/latex/oberdiek/test/embedfile-test3.tex\\ -% test/embedfile-test4.tex & doc/latex/oberdiek/test/embedfile-test4.tex\\ -% embedfile.dtx & source/latex/oberdiek/embedfile.dtx\\ -% \end{tabular}^^A -% }^^A -% \sbox0{\t}^^A -% \ifdim\wd0>\linewidth -% \begingroup -% \advance\linewidth by\leftmargin -% \advance\linewidth by\rightmargin -% \edef\x{\endgroup -% \def\noexpand\lw{\the\linewidth}^^A -% }\x -% \def\lwbox{^^A -% \leavevmode -% \hbox to \linewidth{^^A -% \kern-\leftmargin\relax -% \hss -% \usebox0 -% \hss -% \kern-\rightmargin\relax -% }^^A -% }^^A -% \ifdim\wd0>\lw -% \sbox0{\small\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\footnotesize\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\scriptsize\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\tiny\t}^^A -% \ifdim\wd0>\linewidth -% \lwbox -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \end{quote} -% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's -% TDS installing feature, then some files can already be in the right -% place, see the documentation of \docstrip. -% -% \subsection{Refresh file name databases} -% -% If your \TeX~distribution -% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh -% these. For example, \TeX\,Live\ users run \verb|texhash| or -% \verb|mktexlsr|. -% -% \subsection{Some details for the interested} -% -% \paragraph{Unpacking with \LaTeX.} -% The \xfile{.dtx} chooses its action depending on the format: -% \begin{description} -% \item[\plainTeX:] Run \docstrip\ and extract the files. -% \item[\LaTeX:] Generate the documentation. -% \end{description} -% If you insist on using \LaTeX\ for \docstrip\ (really, -% \docstrip\ does not need \LaTeX), then inform the autodetect routine -% about your intention: -% \begin{quote} -% \verb|latex \let\install=y\input{embedfile.dtx}| -% \end{quote} -% Do not forget to quote the argument according to the demands -% of your shell. -% -% \paragraph{Generating the documentation.} -% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate -% the documentation. The process can be configured by the -% configuration file \xfile{ltxdoc.cfg}. For instance, put this -% line into this file, if you want to have A4 as paper format: -% \begin{quote} -% \verb|\PassOptionsToClass{a4paper}{article}| -% \end{quote} -% An example follows how to generate the -% documentation with pdf\LaTeX: -% \begin{quote} -%\begin{verbatim} -%pdflatex embedfile.dtx -%makeindex -s gind.ist embedfile.idx -%pdflatex embedfile.dtx -%makeindex -s gind.ist embedfile.idx -%pdflatex embedfile.dtx -%\end{verbatim} -% \end{quote} -% -% \begin{thebibliography}{9} -% \bibitem{attachfile} -% Scott Pakin: \textit{The \xpackage{attachfile} package}; -% 2005/02/20 v1.2; -% \CTANpkg{attachfile}. -% -% \bibitem{attachfile2} -% Heiko Oberdiek: \textit{The \xpackage{attachfile2} package}; -% 2006/08/16 v2.2; -% \CTAN{macros/latex/contrib/attachfile2/attachfile2.pdf}. -% -% \bibitem{pdfspec} -% Adobe Systems Incorporated: -% \href{http://www.adobe.com/devnet/acrobat/pdfs/pdf_reference.pdf}% -% {\textit{PDF Reference, Sixth Edition, Version 1.7}},% -% Oktober 2006; -% \url{http://www.adobe.com/devnet/pdf/pdf_reference.html}. -% -% \bibitem{mime} -% Network Working Group: RFC 2046, \textit{Multipurpose Internet Mail Extensions (MIME) Part Two: -% Media Types}, November 1996; \url{http://www.rfc-editor.org/}. -% -% \bibitem{types} -% IANA (Internet Assigned Numbers Authority): -% \textit{MIME Media Types}, May 2006; -% \url{http://www.iana.org/assignments/media-types/}. -% -% \end{thebibliography} -% -% \begin{History} -% \begin{Version}{2006/08/16 v1.0} -% \item -% First public version. -% \end{Version} -% \begin{Version}{2007/04/11 v1.1} -% \item -% Line ends sanitized. -% \end{Version} -% \begin{Version}{2007/09/09 v1.2} -% \item -% Fixes for plain-TeX, wrapper for package \xpackage{keyval} added. -% \item -% Catcode section rewritten. -% \end{Version} -% \begin{Version}{2007/10/28 v2.0} -% \item -% Collection support added (PDF 1.7). -% \end{Version} -% \begin{Version}{2007/10/29 v2.1} -% \item -% Export of object references by adding new option \xoption{id} and -% new macros \cs{embedfileifobjectexists} and \cs{embedfilegetobject}. -% \end{Version} -% \begin{Version}{2007/11/11 v2.2} -% \item -% Use of package \xpackage{pdftexcmds} for \LuaTeX\ support. -% \end{Version} -% \begin{Version}{2007/11/25 v2.3} -% \item -% Fix in use of \cs{pdf@filesize}, bug introduced in previous version. -% \end{Version} -% \begin{Version}{2009/09/25 v2.4} -% \item -% Bug fix: If \xpackage{hyperref} is used with option \xoption{unicode}, -% the Unicode encoded file name causes trouble. Therefore \cs{pdfstringdef} -% is now never used for option \xoption{filespec}, always method -% \texttt{escape} is applied (Peter Cibulka). -% \item -% Bug fix for \xoption{initialfile}. -% \item -% Bug fix for file names in \texttt{/EmbeddedFiles}. -% \item -% New option \xoption{ucfilespec} for file name support in Unicode -% (since PDF 1.7). -% \end{Version} -% \begin{Version}{2010/03/01 v2.5} -% \item -% Compatibility for \iniTeX. -% \item -% Package \xpackage{keyval} replaced by packages \xpackage{kvsetkeys} -% and \xpackage{kvdefinekeys} because of compatibility for \iniTeX. -% \item -% TDS location moved from TDS:tex/latex/oberdiek/embedfile.sty to -% TDS:tex/generic/oberdiek/embedfile.sty. -% \end{Version} -% \begin{Version}{2011/04/13 v2.6} -% \item -% Docu fixes (thanks Hans-Martin M\"unch). -% \end{Version} -% \begin{Version}{2016/05/15 v2.7} -% \item -% LuaTeX compatibility -% \end{Version} -% \begin{Version}{2018/11/01 v2.8} -% \item -% Remove luatex85 package depenency. -% \end{Version} -% \end{History} -% -% \PrintIndex -% -% \Finale -\endinput diff --git a/macros/latex/contrib/oberdiek/embedfile.pdf b/macros/latex/contrib/oberdiek/embedfile.pdf Binary files differdeleted file mode 100644 index d7ccbeb198..0000000000 --- a/macros/latex/contrib/oberdiek/embedfile.pdf +++ /dev/null |