texlive[48116] Master/texmf-dist: xbmks (30jun18)

commits+karl at tug.org commits+karl at tug.org
Sat Jun 30 23:05:48 CEST 2018


Revision: 48116
          http://tug.org/svn/texlive?view=revision&revision=48116
Author:   karl
Date:     2018-06-30 23:05:48 +0200 (Sat, 30 Jun 2018)
Log Message:
-----------
xbmks (30jun18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/xbmks/README.md
    trunk/Master/texmf-dist/doc/latex/xbmks/docs/xbmks.pdf
    trunk/Master/texmf-dist/doc/latex/xbmks/docs/xbmksman.pdf
    trunk/Master/texmf-dist/doc/latex/xbmks/docs/xbmksman.tex
    trunk/Master/texmf-dist/doc/latex/xbmks/examples/doc1.pdf
    trunk/Master/texmf-dist/doc/latex/xbmks/examples/doc1.tex
    trunk/Master/texmf-dist/doc/latex/xbmks/examples/doc2.pdf
    trunk/Master/texmf-dist/doc/latex/xbmks/examples/doc2.tex
    trunk/Master/texmf-dist/doc/latex/xbmks/examples/master.pdf
    trunk/Master/texmf-dist/doc/latex/xbmks/examples/master.tex
    trunk/Master/texmf-dist/doc/latex/xbmks/examples/stand-alone.tex
    trunk/Master/texmf-dist/source/latex/xbmks/xbmks.dtx
    trunk/Master/texmf-dist/source/latex/xbmks/xbmks.ins
    trunk/Master/texmf-dist/tex/latex/xbmks/xbmks-pdfmark.def
    trunk/Master/texmf-dist/tex/latex/xbmks/xbmks-pdftex.def
    trunk/Master/texmf-dist/tex/latex/xbmks/xbmks-xetex.def
    trunk/Master/texmf-dist/tex/latex/xbmks/xbmks.sty

Removed Paths:
-------------
    trunk/Master/texmf-dist/tex/latex/xbmks/xbmks-luatex.def

Modified: trunk/Master/texmf-dist/doc/latex/xbmks/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xbmks/README.md	2018-06-30 00:23:50 UTC (rev 48115)
+++ trunk/Master/texmf-dist/doc/latex/xbmks/README.md	2018-06-30 21:05:48 UTC (rev 48116)
@@ -1,6 +1,6 @@
 The xbmks Package
 Author: D. P. Story 
-Dated: 2018/06/13
+Dated: 2018/06/25
 
 Short description: Create a cross-document bookmark tree. 
 
@@ -15,6 +15,10 @@
 
 PDF Creator: no restrictions, use dvips->distiller|ps2pdf, pdflatex, 
 lualatex, or xelatex.
+
+What's New (2018/06/25) Defined new commands for creating bookmarks for which 
+arbitrary actions, color and style can be applied. These commands build on 
+hyperref's bookmark commands. 
  
 What's New (2018/06/13) Corrected a misspelling in the driver specification 
 for pdfmark. Now allow the docbundle key to be empty or missing; in this 

Modified: trunk/Master/texmf-dist/doc/latex/xbmks/docs/xbmks.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/xbmks/docs/xbmksman.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/xbmks/docs/xbmksman.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xbmks/docs/xbmksman.tex	2018-06-30 00:23:50 UTC (rev 48115)
+++ trunk/Master/texmf-dist/doc/latex/xbmks/docs/xbmksman.tex	2018-06-30 21:05:48 UTC (rev 48116)
@@ -17,8 +17,10 @@
 %\usepackage{calibri}
 \usepackage[altbullet]{lucidbry}
 
-\xbmksetup{colors={intdoc=red},style={intbf}}
+\DeclareInitView{layoutmag={navitab:UseOutlines}}
 
+\xbmksetup{colors={int=red},styles={intbf}}
+
 \addtolength{\marginparwidth}{20pt}
 
 %\previewtrue
@@ -39,7 +41,7 @@
 \def\echgCurrLblName#1{\edef\@currentlabelname{#1}}
 \makeatother
 
-\getDimsFromGraphic{graphics/dpsweb}{\dpswebW}{\dpswebH}
+%\getDimsFromGraphic{graphics/dpsweb}{\dpswebW}{\dpswebH}
 
 
 %\urlstyle{rm}
@@ -47,7 +49,8 @@
 \let\uif\textsf
 \let\app\textsf
 \def\psf#1{\textbf{\textsf{#1}}}
-\let\amtIndent\leftmargini
+%\let\amtIndent\leftmargini
+\edef\amtIndent{\the\parindent}
 
 \renewcommand*\descriptionlabel[1]{\hspace\labelsep
     \normalfont #1}
@@ -56,13 +59,13 @@
 \DeclareDocInfo
 {
     university={Acro\negthinspace\TeX.Net},
-    title={The \textsf{xbmks} package\texorpdfstring{\\}{:}Cross-document bookmarks},
+    title={The \textsf{xbmks} package\texorpdfstring{\\}{: }Cross-document bookmarks},
     author={D. P. Story},
     email={dpstory at acrotex.net},
-    subject={Documentation for the richtext package from AcroTeX},
+    subject={Documentation for the xbmks package from AcroTeX: cross-document bookmarks},
     talksite={\url{www.acrotex.net}},
-    version={v1.1, 2018/06/13},
-    keywords={AcroTeX, rich text strings},
+    version={2.0.1, 2018/06/25},
+    Keywords={AcroTeX, bookmarks, cross-document, document bundle},
     copyrightStatus=True,
     copyrightNotice={Copyright (C) \the\year, D. P. Story},
     copyrightInfoURL={http://www.acrotex.net}
@@ -132,6 +135,15 @@
 
 \maketitle
 
+\pdfbookmarkx[1]{Title Page}[action={\Named{FirstPage}}]{TitlePage}
+\pdfbookmarkx[1]{Links to AcroTeX.Net}[action={/S/GoTo/D(undefined)},%
+  color=magenta,style={bf}]{acrotex}
+\belowpdfbookmarkx{http://www.acrotex.net}[action={\URI{http://www.acrotex.net}},%
+  color=magenta,style={bf}]{home}
+\belowpdfbookmarkx{http://blog.acrotex.net}[action={\URI{http://blog.acrotex.net}},%
+  color=magenta,style={bf}]{blog}
+
+
 \selectColors{linkColor=black}
 \tableofcontents
 \selectColors{linkColor=webgreen}
@@ -143,7 +155,6 @@
 
 \hypersetup{linktocpage}
 
-
 \section{Introduction}
 
 It has been more than a couple decades ago (counting back from 2018), I wrote
@@ -175,15 +186,15 @@
 \opt{dvips} is the default, so there is actually  no need to pass the driver
 option.
 
-\section{The preamble command \texorpdfstring{\protect\cs{xbmksetup}}{\textbackslash{xbmksetup}}}
+\section{The preamble command \texorpdfstring{\protect\cs{xbmksetup}}{\textbackslash{xbmksetup}}}\label{s:xbmksetup}
 
 The only user command is \cs{xbmksetup}:
-\bVerb\def\1{\qquad}\takeMeasure{\1colors=\darg{intdoc=\ameta{color},extdoc=\ameta{color}},}%
+\bVerb\def\1{\qquad}\takeMeasure{\1docbundle=\darg{\ameta{doc\SUB1},\ameta{doc\SUB2},...,\ameta{doc\SUB{n}}},}%
 \begin{dCmd}[commandchars=!()]{\bxSize}
 \xbmksetup{%
 !1docbundle={!ameta(doc!SUB1),!ameta(doc!SUB2),...,!ameta(doc!SUB(n))},
-!1colors={intdoc=!ameta(color),extdoc=!ameta(color)},
-!1style={intbf,extbf,intit,extit}
+!1colors={int=!ameta(color),ext=!ameta(color)},
+!1styles={intbf,extbf,intit,extit}
 }
 \end{dCmd}
 \eVerb You have a collection of files (as specified by the \texttt{docbundle}
@@ -222,11 +233,11 @@
 \textbf{Empty or missing \texttt{docbundle} key.} If this key is missing,
 then it is assigned a value of \cs{jobname}. As a result, normal bookmarks
 are generated for the document \cs{jobname}; however, as an extra benefit,
-the other keys are obeyed (\texttt{colors} and \texttt{style}). See the
+the other keys are obeyed (\texttt{colors} and \texttt{styles}). See the
 sample file \texttt{stand-alone.tex} found in the \texttt{examples} file.
 This manual uses the \pkg{xbmks} package with,
 \begin{Verbatim}[xleftmargin=\amtIndent]
-\xbmksetup{colors={intdoc=red},style={intbf}}
+\xbmksetup{colors={int=red},styles={intbf}}
 \end{Verbatim}
   \item[\texttt{colors}] (Optional) For any given document in the bundle,
       there are two types of links in the bookmarks, a link to an item in
@@ -233,27 +244,27 @@
       the current (or internal) document, or a link to an external document
       (within the bundle of documents).
   \begin{itemize}
-      \item \texttt{intdoc=\ameta{color}}, where \ameta{color} is an rgb
+      \item \texttt{int=\ameta{color}}, where \ameta{color} is an rgb
           color. This specifies the color of the link for an internal
           jump within the current document. Specify the color
           using the syntax \texttt{\darg{[rgb]{\ameta{r},\ameta{g},\ameta{b}}}};
           for example,
 \begin{Verbatim}[xleftmargin=\amtIndent]
-colors={intdoc={[rgb]{0,.6,0}}
+colors={int={[rgb]{0,.6,0}}
 \end{Verbatim}
 or, if the \pkg{xcolor} package is loaded, \emph{named colors} may be used.
-    \item\texttt{extdoc=\ameta{color}}, where \ameta{color} is an rgb
+    \item\texttt{ext=\ameta{color}}, where \ameta{color} is an rgb
         color. This specifies the color of the link for an external jump
           to another member of the document bundle. Color specification is the
-          same as for \texttt{intdoc}:
+          same as for \texttt{int}:
 \begin{Verbatim}[xleftmargin=\amtIndent]
-colors={intdoc=red,extdoc=blue}
+colors={int=red,ext=blue}
 \end{Verbatim}
 In the above example, we assume \pkg{xcolor} is loaded and specify the
 colors accordingly.
 
-\textbf{The default color.} If you declare \texttt{intdoc} (or
-\texttt{extdoc}) without a value, you get the default, which is the color
+\textbf{The default color.} If you declare \texttt{int} (or
+\texttt{ext}) without a value, you get the default, which is the color
 key is not specified within the PDF document. The \texttt{color} key is
 optional, in which case, you get the default color. What is the default
 color? Well, its either white or black, depending on the \textsf{Display
@@ -263,34 +274,33 @@
 When you specify a color, be aware that what looks good in the \emph{light
 theme} may not be so visible in a \emph{dark theme}.
   \end{itemize}
-  \item[\texttt{style}] (Optional) The Adobe PDF viewer applications also
+  \item[\texttt{styles}] (Optional) The Adobe PDF viewer applications also
       support a bold and italics style. These can be specified for the
       internal and external documents.
   \begin{itemize}
-    \item Internal style (valueless) keys are \texttt{intbf} and \texttt{intit}; zero, one, or
+    \item Internal styles (valueless) keys are \texttt{intbf} and \texttt{intit}; zero, one, or
     two of these may be specified,
 \begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
-style={intbf}         % !normalfont(bold font)
-style={intit}         % !normalfont(italics font)
-style={intbf,intit}   % !normalfont(bold and italics font)
+styles={intbf}         % !normalfont(bold font)
+styles={intit}         % !normalfont(italics font)
+styles={intbf,intit}   % !normalfont(bold and italics font)
 \end{Verbatim}
-  \item External style (valueless) keys are \texttt{extbf} and \texttt{extit}; zero, one, or
+  \item External styles (valueless) keys are \texttt{extbf} and \texttt{extit}; zero, one, or
     two of these may be specified,
 \begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
-style={extbf}         % !normalfont(bold font)
-style={extit}         % !normalfont(italics font)
-style={extbf,extit}   % !normalfont(bold and italics font)
+styles={extbf}         % !normalfont(bold font)
+styles={extit}         % !normalfont(italics font)
+styles={extbf,extit}   % !normalfont(bold and italics font)
 \end{Verbatim}
   \end{itemize}
-Of course, all these keys are specified or not, in the \texttt{style} key:
+Of course, all these keys are specified or not, in the \texttt{styles} key:
 \begin{Verbatim}[xleftmargin=\amtIndent]
-style={intbf,extit}
+styles={intbf,extit}
 \end{Verbatim}
 Here, we specify bold font for the current document and an italics for an
 internal document.
 \end{description}
 
-
 \newtopic\noindent\textbf{Point of personal preference.} After experimenting with
 various combinations of colors and styles with combinations of themes
 (light and dark) I prefer no color specified with bold font for the current
@@ -300,11 +310,114 @@
 \begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
 \xbmksetup{%
 !1docbundle={!ameta(doc!SUB1),!ameta(doc!SUB2),...,!ameta(doc!SUB(n))},
-!1style={intbf}
+!1styles={intbf}
 }
 \end{Verbatim}
 seems to be a reasonable choice of key-values.
 
+\section{Creating bookmarks with other actions}
+
+The \pkg{hyperref} package provides commands (\cs{pdfbookmark},
+\cs{currentpdfbookmark}, \cs{subpdfbookmark}, and \cs{belowpdfbookmark})
+designed to create bookmarks that jump to a specified destination in the
+current document. The \pkg{xbmks} package now defines similar commands in
+which arbitrary actions may be defined.
+\bVerb\def\1{\qquad}\takeMeasure{\string\pdfbookmarkx[\ameta{level}]\darg{\ameta{text}}[\ameta{KV-pairs}]\darg{\ameta{name}}}%
+\begin{dCmd}[commandchars=!()]{\bxSize}
+\pdfbookmarkx[!ameta(level)]{!ameta(text)}[!ameta(KV-pairs)]{!ameta(name)}
+\currentpdfbookmarkx{!ameta(text)}[!ameta(KV-pairs)]{!ameta(name)}
+\subpdfbookmarkx{!ameta(text)}[!ameta(KV-pairs)]{!ameta(name)}
+\belowpdfbookmarkx{!ameta(text)}[!ameta(KV-pairs)]{!ameta(name)}
+\end{dCmd}
+\bVerb If the optional \ameta{KV-pairs} argument is not present, the command
+behaves just like its \pkg{hyperref} counterpart; \ameta{name} is used to
+create a destination (or anchor) for the ordinary bookmark link. If
+\ameta{KV-pairs} is specified, no anchor is created, but \ameta{name} is used
+to associate the \ameta{action} with the bookmark.
+
+\paragraph*{Description of the commands}\leavevmode
+\begin{aebDescript}
+   \item[\cs{pdfbookmarkx}] Creates a bookmark at level \ameta{level} in the
+       outline tree hierarchy.
+   \item[\cs{currentpdfbookmarkx}] The command creates a bookmark at the current
+       bookmark level in the outline tree.
+   \item[\cs{subpdfbookmarkx}] Reduces the current bookmark level by one,
+       then creates the bookmark at that level. The reduced level is the
+       new current bookmark level.
+   \item[\cs{belowpdfbookmarkx}] Creates a bookmark at one level below the
+       current bookmark level without changing the value of the current
+       bookmark level.
+\end{aebDescript}
+
+\paragraph*{Description of the \ameta{KV-pairs} argument.} The \ameta{KV-pairs} argument
+accepts up to three key-value pairs:
+\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
+action=!ameta(PDF-action),color=!ameta(color),style=!ameta(!upshape(bf|it))
+\end{Verbatim}
+Notice that \texttt{color} and \texttt{style} are in the singular, as opposed to the plural
+as they were in description of the key-value pairs for \cs{xbmksetup}, back on page~\pageref{s:xbmksetup}.
+\begin{aebDescript}
+  \item[\texttt{action=\ameta{PDF-action}}] \ameta{PDF-action}
+is raw PDF action code. I decided to just keep it simple. Consult Section 8.5 titled `Actions',
+in particular, read Section~8.5.3 on `Action Types' of the \textsl{PDF Reference Sixth Edition, Version 1.7}.\footnote
+{\url{https://www.adobe.com/devnet/pdf/pdf_reference_archive.html}} A general
+syntax for the \ameta{action} is,
+\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
+/S!ameta(action-type)!ameta(other-key-values)
+\end{Verbatim}
+Common action-types are \texttt{/URI}, \texttt{/JavaScript}, \texttt{/Named}, and \texttt{/GoToR}.
+Below are some examples, the ones that appear in the demo files.
+\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
+\belowpdfbookmarkx{http://www.acrotex.net}
+  [action={/S/URI/URI(http://www.acrotex.net)}]{home}
+\currentpdfbookmarkx{Current: Hello world!}
+  [action={/S/JavaScript/JS(app.alert("Hello World!");)}]{bmk1}
+\subpdfbookmarkx{Sub: First Page}[/S/Named/N/FirstPage]{bmk2}
+\belowpdfbookmarkx{Go to doc1, page 1}
+  [action={/S/GoToR/F(doc1.pdf)/D[1 /Fit]}]{gotor}
+\end{Verbatim}
+
+\textbf{When \pkg{eforms} is loaded.} The \pkg{eforms} package defines
+some helper commands for common action types, these are \cs{URI}, \cs{JS},
+\cs{Named}, and \cs{GoToR}. The above examples are then written as,
+\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
+\belowpdfbookmarkx{http://www.acrotex.net}
+  [action={\URI{http://www.acrotex.net}}]{home}
+\currentpdfbookmarkx{Current: Hello world!}
+  [action={\JS{app.alert("Hello World!");}}]{bmk1}
+\subpdfbookmarkx{Sub: First Page}
+  [action={\Named{FirstPage}{]{bmk2}
+\belowpdfbookmarkx{Go to doc1, page 1}
+  [action={\GoToR/F(doc1.pdf)/D[1 /Fit]}]{gotor}
+\end{Verbatim}
+
+\item[\texttt{color=\ameta{color}}] The value of this key determines the
+    color of the link. The value of \ameta{color} was described in the
+    \texttt{colors} key. If this key is not specified, the value \texttt{int}
+    or \texttt{ext} of the \texttt{colors} key is used, as appropriate. When
+    the value of the \texttt{color} key is specified, the link receives the
+    \ameta{color} across all documents in the bundle.
+
+\item[\texttt{style=\ameta{\upshape{bf|it}}}] The value of this key
+    determines the style (\texttt{bf} -- bold, \texttt{it} -- italics); the
+    keys may be used together \texttt{style=\darg{bf,it}} gives bold italics
+    font. When \texttt{style} is not specified, the value of the \texttt{styles}
+    key is used. When \texttt{style} is specified, the same style is assigned
+    across all documents in the bundle.
+\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
+\belowpdfbookmarkx{http://www.acrotex.net}
+  [action={\URI{http://www.acrotex.net}},
+   color=magenta,style=bf]{home}
+\end{Verbatim}
+This bookmark is colored magenta in bold across all documents in the bundle.
+\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
+\belowpdfbookmarkx{http://www.acrotex.net}
+  [action={\URI{http://www.acrotex.net}}]{home}
+\end{Verbatim}
+This bookmark takes on the colors and styles declared by the \texttt{colors}
+and \texttt{styles} keys.
+\end{aebDescript}
+
 \section{Workflow}
 
 Given that you have a collection of files that are to contain a common set of

Modified: trunk/Master/texmf-dist/doc/latex/xbmks/examples/doc1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/xbmks/examples/doc1.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xbmks/examples/doc1.tex	2018-06-30 00:23:50 UTC (rev 48115)
+++ trunk/Master/texmf-dist/doc/latex/xbmks/examples/doc1.tex	2018-06-30 21:05:48 UTC (rev 48116)
@@ -1,7 +1,7 @@
 \documentclass[12pt]{article}
 \usepackage{xcolor}
 %\usepackage{xr-hyper}
-\usepackage[bookmarksopen]{hyperref}
+\usepackage[bookmarksopen,bookmarksnumbered]{hyperref}
 \usepackage{xbmks}
 
 
@@ -10,8 +10,9 @@
 %\externaldocument[m-]{master}
 %\externaldocument[d2-]{doc2}
 
+% just for laughs, we transfer the last section number from master
+\setcounter{section}{2}
 
-
 \begin{document}
 
 \section{Doc 1: Sec 1}\label{sec1}
@@ -18,6 +19,11 @@
 
 Some content goes here.
 
+\belowpdfbookmarkx{Home page}[action={/S/URI/URI(http://www.acrotex.net)},%
+  color=magenta,style={it}
+]{home}
+
+
 \newpage
 
 \subsection{Doc 1: subSec 1}

Modified: trunk/Master/texmf-dist/doc/latex/xbmks/examples/doc2.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/xbmks/examples/doc2.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xbmks/examples/doc2.tex	2018-06-30 00:23:50 UTC (rev 48115)
+++ trunk/Master/texmf-dist/doc/latex/xbmks/examples/doc2.tex	2018-06-30 21:05:48 UTC (rev 48116)
@@ -1,9 +1,13 @@
 \documentclass[12pt]{article}
 \usepackage{xcolor}
 %\usepackage{xr-hyper}
-\usepackage[bookmarksopen]{hyperref}
+\usepackage[bookmarksopen,bookmarksnumbered]{hyperref}
 \usepackage{xbmks}
 
+% just for laughs, we transfer the last section number from doc2
+\setcounter{section}{4}
+
+
 % the xr-hyper package may also be used if you have
 % cross document links within the body of the doc
 %\externaldocument[m-]{master}
@@ -13,6 +17,9 @@
 
 \section{Doc 2: Sec 1}
 
+\belowpdfbookmarkx{Home page}[action={/S/URI/URI(http://www.acrotex.net)},%
+  color=magenta,style={bf}]{home}
+
 Some content goes here.
 
 \newpage

Modified: trunk/Master/texmf-dist/doc/latex/xbmks/examples/master.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/xbmks/examples/master.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xbmks/examples/master.tex	2018-06-30 00:23:50 UTC (rev 48115)
+++ trunk/Master/texmf-dist/doc/latex/xbmks/examples/master.tex	2018-06-30 21:05:48 UTC (rev 48116)
@@ -1,7 +1,8 @@
 \documentclass[12pt]{article}
 \usepackage{xcolor}
 %\usepackage{xr-hyper}
-\usepackage[bookmarksopen]{hyperref}
+\usepackage[bookmarksopen,bookmarksnumbered]{hyperref}
+%\usepackage{eforms}
 \usepackage{xbmks}
 
 % the xr-hyper package may also be used if you have
@@ -18,8 +19,8 @@
 % of option choices.
 \xbmksetup{%
   docbundle={master,doc1,doc2},
-  colors={intdoc=red,extdoc},
-  style={intbf}
+  colors={int=red,ext},
+  styles={intbf}
 }
 
 \begin{document}
@@ -26,14 +27,62 @@
 
 \maketitle
 
+\tableofcontents
+
+% color and style specified. This will be how these entries are displayed across 
+% all documents in the bundle
+\pdfbookmarkx[1]{http://blog.acrotex.net}[action={/S/URI/URI(http://blog.acrotex.net)},%
+  color=magenta,style={bf}]{blog}
+\currentpdfbookmarkx{http://www.acrotex.net}[action={/S/URI/URI(http://www.acrotex.net)},%
+  color=magenta,style={bf}]{home}
+\currentpdfbookmarkx{First page}[action={/S/Named/N/FirstPage},%
+  color=magenta,style={bf}]{First}
+\currentpdfbookmarkx{Last page}[action={/S/Named/N/LastPage},%
+  color=magenta,style={bf}]{Last}
+
+% the eforms versions of the above
+%\pdfbookmarkx[1]{http://blog.acrotex.net}[action={\URI{http://blog.acrotex.net}},%
+%  color=magenta,style={bf}]{blog}
+%\currentpdfbookmarkx{http://www.acrotex.net}[action={\URI{http://www.acrotex.net}},%
+%  color=magenta,style={bf}]{home}
+%\currentpdfbookmarkx{First page}[action={\Named{FirstPage}},%
+%  color=magenta,style={bf}]{First}
+%\currentpdfbookmarkx{Last page}[action={\Named{LastPage}},%
+%  color=magenta,style={bf}]{Last}
+
 \section{Master One}
 
 Some content goes here.
 
+% color and style not specified, this bookmark will take on the default
+% color and style as declared in the \xbmksetup command.
+\belowpdfbookmarkx{JavaScript Action}[%
+  action={/S/JavaScript/JS(app.alert("Hello World!\\n\\nAnnounced from the document "
+  + this.documentFileName);)}]{jsa}
+
+% eforms version
+%\belowpdfbookmarkx{JavaScript Action}[
+%  action={\JS{app.alert("Hello World!\\n\\nAnnounced from the document "
+%  + this.documentFileName);}]{jsa}
+
+% color and style not specified, this bookmark will take on the default
+% color and style as declared in the \xbmksetup command.
+\belowpdfbookmarkx{Go to doc1, page 2}[action={/S/GoToR/F(doc1.pdf)/D[1 /Fit]}]{gotor1}
+% eforms version
+%\belowpdfbookmarkx{Go to doc1, page 2}[action={\GoToR/F(doc1.pdf)/D[1 /Fit]}]{gotor}
+
+\hypersetup{bookmarksopen=false}
+% This next bookmark is a title only, the actions is to jump to an destination not defined
+\subpdfbookmarkx{Sub: Optional Bookmarks}[action={/S/GoTo/D(undefined)}]{optBmks}
+\belowpdfbookmarkx{doc1, page 3}[action={/S/GoToR/F(doc1.pdf)/D[2 /Fit]}]{gotor2}
+\belowpdfbookmarkx{doc2, page 2}[action={/S/GoToR/F(doc2.pdf)/D[1 /Fit]}]{gotor3}
+\hypersetup{bookmarksopen=true}
+
 \subsection{Master One: subSec 1}
 
 Some content goes here.
 
+
 \newpage
 
 
@@ -41,7 +90,6 @@
 
 Some content goes here.
 
-
 \subsection{Master Two: subSec 1}
 
 Some content goes here.

Modified: trunk/Master/texmf-dist/doc/latex/xbmks/examples/stand-alone.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xbmks/examples/stand-alone.tex	2018-06-30 00:23:50 UTC (rev 48115)
+++ trunk/Master/texmf-dist/doc/latex/xbmks/examples/stand-alone.tex	2018-06-30 21:05:48 UTC (rev 48116)
@@ -8,8 +8,8 @@
 
 \xbmksetup{%
 %  docbundle={\jobname},
-  colors={intdoc=red,extdoc},
-  style={intbf}
+  colors={int=red,ext},
+  styles={intbf}
 }
 
 \begin{document}
@@ -18,11 +18,11 @@
 
 \section{Section One}
 
-When the \texttt{docbundle} key is either empty or is not present, \textsf{xbmks} sets it
-to \verb~\jobname~. No cross-document bookmarks are generated because there was no specification
-for creating (multiple values for \texttt{docbundle}); instead, we obtain a standard document
+When the \texttt{docbundle} key is either empty or is not present, \textsf{xbmks} sets its value
+to \verb~\jobname~. No cross-document bookmarks are generated because there is no ``bundle'' specified
+(multiple values for \texttt{docbundle} are needed); instead, we obtain a standard document
 with bookmarks, but the color and style of of the bookmarks are controlled by the \texttt{colors}
-and \texttt{style} keys, as seen in the preamble.
+and \texttt{styles} keys, as seen in the preamble.
 
 \subsection{Section One: subSec 1}
 

Modified: trunk/Master/texmf-dist/source/latex/xbmks/xbmks.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/xbmks/xbmks.dtx	2018-06-30 00:23:50 UTC (rev 48115)
+++ trunk/Master/texmf-dist/source/latex/xbmks/xbmks.dtx	2018-06-30 21:05:48 UTC (rev 48116)
@@ -16,7 +16,7 @@
 %</copyright>
 %<package>\NeedsTeXFormat{LaTeX2e}[1997/12/01]
 %<package>\ProvidesPackage{xbmks}
-%<package> [2018/06/13 v1.1 xbmks: Cross-document bookmarks (dps)]
+%<package> [2018/06/25 v2.0.1 xbmks: Cross-document bookmarks (dps)]
 %<*driver>
 \documentclass{ltxdoc}
 \usepackage{xcolor}
@@ -23,7 +23,7 @@
 \usepackage[colorlinks,hyperindex=false,bookmarksopen]{hyperref}
 \usepackage{fancyvrb,array,calc}
 \usepackage{xbmks}
-\xbmksetup{colors={intdoc=red},style={intbf}}
+\xbmksetup{colors={int=red},styles={intbf}}
 %\pdfstringdefDisableCommands{\let\\\textbackslash}
 \EnableCrossrefs
 \CodelineIndex
@@ -145,8 +145,8 @@
 %\begin{quote}\ttfamily\obeylines
 %\string\xbmksetup\darg{%
 %\qquad docbundle=\darg{\ameta{doc\SUB1},\ameta{doc\SUB2},...,\ameta{doc\SUB{n}}},
-%\qquad colors=\darg{intdoc=\ameta{color},extdoc=\ameta{color}},
-%\qquad style=\darg{intbf,extbf,intit,extit}
+%\qquad colors=\darg{int=\ameta{color},ext=\ameta{color}},
+%\qquad styles=\darg{intbf,extbf,intit,extit}
 %}
 %\end{quote}
 %This command must appear in one and only one of the document bundle, perhaps one
@@ -155,32 +155,59 @@
 %members of the document bundle, as specified by the \texttt{dobundle} key. The base names
 %of the document bundle must match the name given to it by \cs{jobname}, exact spelling, case
 %sensitive.
+%
+%\paragraph*{Key-values for \cs{xbmksetup}.} The keys belonging to the \texttt{xbmksetup} family:
+%\IndexOpt{docbundle}\texttt{docbundle}, \IndexOpt{colors}\texttt{colors}, and \IndexOpt{styles}\texttt{styles}.
 %    \begin{macrocode}
 \define at key{xbmksetup}{docbundle}[]{\def\x at bmks@docs{#1}}
 \let\x at bmks@docs\@empty
 \define at key{xbmksetup}{colors}[]{\def\x at bmks@colors{#1}}
 \let\x at bmks@colors\@empty
-\define at key{xbmksetup}{style}[]{\def\x at bmks@style{#1}}
-\let\x at bmks@style\@empty
-\define at key{xbmk at colors}{intdoc}[]{%
-  \HyColor at BookmarkColor{#1}{\xbmks at intdoc}{xbmks}{intdoc}%
-  \ifx\xbmks at intdoc\@empty\else
-  \edef\xbmks at intdoc{/C[\xbmks at intdoc]}\fi
+\define at key{xbmksetup}{styles}[]{\def\x at bmks@styles{#1}}
+\let\x at bmks@styles\@empty
+%    \end{macrocode}
+%\subparagraph*{Values for the key \texttt{colors}.} The value recognized are
+%\begin{quote}\ttfamily
+%  colors=\darg{int=\ameta{color},ext=\ameta{color}}
+%\end{quote}
+%If the value of \texttt{int} or \texttt{ext} is empty, then the PDF viewer's default
+%colors are using (black).
+%    \begin{macrocode}
+\define at key{xbmk at colors}{int}[]{%
+  \HyColor at BookmarkColor{#1}{\xbmks at intC}{xbmks}{int}%
+  \ifx\xbmks at intC\@empty\else
+  \edef\xbmks at intC{/C[\xbmks at intC]}\fi
 }
-\let\xbmks at intdoc\@empty
-\define at key{xbmk at colors}{extdoc}[]{%
-  \HyColor at BookmarkColor{#1}{\xbmks at extdoc}{xbmks}{extdoc}%
-  \ifx\xbmks at extdoc\@empty\else
-  \edef\xbmks at extdoc{/C[\xbmks at extdoc]}\fi
+\let\xbmks at intC\@empty
+\define at key{xbmk at colors}{ext}[]{%
+  \HyColor at BookmarkColor{#1}{\xbmks at extC}{xbmks}{ext}%
+  \ifx\xbmks at extC\@empty\else
+  \edef\xbmks at extC{/C[\xbmks at extC]}\fi
 }
-\let\xbmks at extdoc\@empty
+\let\xbmks at extC\@empty
 \let\xbmks at Yes=y \let\xbmks at No=n
-\define at boolkey{xbmk at style}{intbf}[true]{} %\ifKV at xbmk@style at intbf
-\define at boolkey{xbmk at style}{extbf}[true]{}
-\define at boolkey{xbmk at style}{intit}[true]{}
-\define at boolkey{xbmk at style}{extit}[true]{}
+%    \end{macrocode}
+%\subparagraph*{Values for the key \texttt{colors}.} The value recognized are
+%\begin{quote}\ttfamily
+%  styles=\darg{intbf,intit,extbf,extit}
+%\end{quote}
+%These are valueless keys (Boolean keys, actually).  \texttt{intbf} means the interior document bookmarks
+%are set in bold while \texttt{intbf,intit} creates bold and italic font.
+%    \begin{macrocode}
+\define at boolkey{xbmk at styles}{intbf}[true]{}
+\define at boolkey{xbmk at styles}{extbf}[true]{}
+\define at boolkey{xbmk at styles}{intit}[true]{}
+\define at boolkey{xbmk at styles}{extit}[true]{}
+%    \end{macrocode}
+%    We evaluate the values of \cs{xbmksetup} by getting the values of
+%    the \texttt{xbmksetup} family.
+%    \begin{macrocode}
 \newcommand{\xbmksetup}[1]{\setkeys{xbmksetup}{#1}%
   \ifx\x at bmks@docs\@empty
+%    \end{macrocode}
+%     If there is no \texttt{docbundle} is specified, we use \cs{jobname} as its
+%     value.
+%    \begin{macrocode}
     \PackageInfo{xbmks}{The docbundle key of \string\xbmksetup\space
     is empty,\MessageBreak
     I will give it a value of `\jobname',\MessageBreak
@@ -188,6 +215,12 @@
     \def\xbmks at next{\write at xbmks@cfg{docbundle={\jobname},#1}}\else
     \def\xbmks at next{\write at xbmks@cfg{#1}}\fi\xbmks at next
 }
+%    \end{macrocode}
+%    We write the key-values of \cs{xbmksetup} to the hard drive in the file
+%    \texttt{xbmks.cfg}, this is \cs{xbmksetupi\darg{\ameta{KVPairs}}}. \cs{xbmksetupi}
+%    is defined below, it is the command that actually does the heavy lifting in
+%    processing the key-values.
+%    \begin{macrocode}
 \def\write at xbmks@cfg#1{%
   \newwrite\xbmks at setup \immediate\openout \xbmks at setup xbmks.cfg
   \set at display@protect
@@ -195,64 +228,227 @@
   \set at typeset@protect
   \immediate\closeout\xbmks at setup
 }
+%    \end{macrocode}
+%    \cs{xbmksetupi} is an internal command that sets the key-values across all files in the \texttt{docbundle}.
+%    \begin{macrocode}
 \newcommand{\xbmksetupi}[1]{%
   \setkeys{xbmksetup}{#1}%
-    \edef\@exp at for{\noexpand\docbundle{\x at bmks@docs}}\expandafter
-    \@exp at for
-    \edef\@exp at keys{\noexpand
-      \setkeys{xbmk at colors}{\x at bmks@colors}}\@exp at keys
-    \edef\@exp at keys{\noexpand
-      \setkeys{xbmk at style}{\x at bmks@style}}\@exp at keys
-      \def\xbmk at intF{}%
-      \ifKV at xbmk@style at intit
-        \ifKV at xbmk@style at intbf
-          \def\xbmk at intF{/F 3}%
-        \else
-          \def\xbmk at intF{/F 1}%
-        \fi
-      \else
-        \ifKV at xbmk@style at intbf
-          \def\xbmk at intF{/F 2}%
-        \fi
-      \fi
-      \def\xbmk at extF{}%
-      \ifKV at xbmk@style at extit
-        \ifKV at xbmk@style at extbf
-          \def\xbmk at extF{/F 3}%
-        \else
-          \def\xbmk at extF{/F 1}%
-        \fi
-      \else
-        \ifKV at xbmk@style at extbf
-          \def\xbmk at extF{/F 2}%
-        \fi
-      \fi
+  \edef\x{\noexpand\x at docbundle{\x at bmks@docs}}\x
+  \edef\x{\noexpand
+    \setkeys{xbmk at colors}{\x at bmks@colors}}\x
+  \edef\x{\noexpand
+    \setkeys{xbmk at styles}{\x at bmks@styles}}\x
+  \let\xbmk at intF\@empty
+  \ifKV at xbmk@styles at intit
+    \ifKV at xbmk@styles at intbf
+      \def\xbmk at intF{/F 3}\else
+      \def\xbmk at intF{/F 1}\fi
+  \else
+    \ifKV at xbmk@styles at intbf
+      \def\xbmk at intF{/F 2}\fi
+  \fi
+  \let\xbmk at extF\@empty
+  \ifKV at xbmk@styles at extit
+    \ifKV at xbmk@styles at extbf
+      \def\xbmk at extF{/F 3}\else
+      \def\xbmk at extF{/F 1}\fi
+  \else
+    \ifKV at xbmk@styles at extbf
+      \def\xbmk at extF{/F 2}\fi
+  \fi
 }
 %    \end{macrocode}
 %    \end{macro}
-%    \begin{macro}{\docbundle}
+%    \begin{macro}{\x at docbundle}
 %    is a comma-delimited list of document base names:
 %\begin{quote}\ttfamily\obeylines
-%\string\docbundle\darg{\ameta{doc\SUB1},\ameta{doc\SUB2},...,\ameta{doc\SUB{n}}}
+%\string\x at docbundle\darg{\ameta{doc\SUB1},\ameta{doc\SUB2},...,\ameta{doc\SUB{n}}}
 %\end{quote}
-%This command is called internally by \cs{xbmksetup}.
+%This command is called internally by \cs{xbmksetupi}.
 %    \begin{macrocode}
-\def\xbmk at csarg#1#2{\expandafter#1\csname#2\endcsname}
+\def\xbmkcsarg#1#2{\expandafter#1\csname#2\endcsname}
 \xdef\xbmk at cnt{0}
-\newcommand{\docbundle}[1]{\bgroup
+\newcommand{\x at docbundle}[1]{\bgroup
   \def\thisDoc{\jobname}\count\z@=0 %
   \edef\@tmpexp{\noexpand\@for\noexpand\@arg:=#1}%
-  \@tmpexp\do{%
-    \advance\count\z@ by 1\relax
-    \edef\@tmpexp{\noexpand\xbmk at recordDoc{\@arg}}\@tmpexp
+  \@tmpexp\do{\advance\count\z@ by 1\relax
+    \edef\x{\noexpand\xbmk at recordDoc{\@arg}}\x
+    \edef\x{\noexpand\xbmk at docID{\@arg}}\x
   }%
   \xdef\xbmk at cnt{\the\count\z@}\egroup
 }
 \newcommand{\xbmk at recordDoc}[1]{%
-  \xbmk at csarg\xdef{xbmk at doc\the\count\z@}{#1}}
+  \xbmkcsarg\xdef{xbmk at doc\the\count\z@}{#1}}
 %    \end{macrocode}
+%    Because we are bringing in multiple outline files, there may be duplicate anchor names.
+%    We assign each file in the document bundle a unique ID `\texttt{x1\ameta{anchor}}', `\texttt{x2\ameta{anchor}}', etc.
+%    The IDs are ultimately assigned through \cs{pdfbookmarkx}.
+%    \begin{macrocode}
+\newcommand{\xbmk at docID}[1]{%
+  \xbmkcsarg\xdef{x#1}{x\the\count\z@}}
+\xbmkcsarg\xdef{x\jobname}{x0}
+%    \end{macrocode}
 %    \end{macro}
+%
+%    \section{Extending bookmarks to arbitrary actions}
+%
+%    It is possible to create bookmarks with arbitrary actions, just as the \pkg{bookmark}
+%    package, does. Here we try to use \pkg{hyperref}'s native bookmark support. The
+%    \pkg{hyperref} commands \cs{pdfbookmark}, \cs{currentbookmark}, \cs{subpdfbookmark}, and
+%    \cs{belowpdfbookmark} are modified.
+%    \begin{macro}{\pdfbookmarkx}\hskip-\marginparsep\,
+%    \texttt{[\ameta{level}]\darg{\ameta{text}}[\ameta{xbmkskeys-kvp}]\darg{\ameta{name}}}\\
+%    Defines a bookmark at \ameta{level}. If \ameta{level} is not provided, the level 1 is assumed.
+%    We write to the outline file the action desired for this bookmark.
+%    \cs{currentAction} is defined below. We do not set an anchor; if the
+%    document author wants an anchor, he should use \cs{pdfbookmark}. As with
+%    \cs{pdfbookmark}, the \cs{pdfbookmarkx} should not normally be directly
+%    used.
+%    \paragraph*{Key-values for the `\cs{...bookmarkx}' commands.} Recognized keys are
+%    \IndexKey{action}\texttt{action}, \IndexKey{color}\texttt{color}, and \IndexKey{style}\texttt{style}.
+%    Note that these keys are singular, as opposed to \texttt{colors} and \texttt{styles} defined in the
+%    \texttt{xbmksetup} family. This is the \texttt{xbmkskeys} family.
+%    \changes{v2.0}{2018/06/21}{Added `\string\cs{...bookmarkx} commands}
+%    \changes{v2.0.1}{2018/06/25}{Added key-values for action, color, and style for custom `\string\cs{...bookmarkx} commands}
 %    \begin{macrocode}
+\define at key{xbmkskeys}{action}{\def\x at bmks@action{#1}}
+\let\x at bmks@action\@empty
+\define at key{xbmkskeys}{color}[]{%
+  \HyColor at BookmarkColor{#1}{\x at bmks@C}{xbmks}{color}%
+  \ifx\x at bmks@C\@empty\else
+  \edef\x at bmks@C{/C[\x at bmks@C]}\fi
+}
+\let\x at bmks@C\@empty
+\define at key{xbmkskeys}{style}[]{%
+  \edef\x{\noexpand\setkeys{xbmks at style}{#1}}\x
+  \let\x at bmks@F\@empty
+  \ifKV at xbmks@style at it
+    \ifKV at xbmks@style at bf
+      \def\x at bmks@F{/F 3}\else
+      \def\x at bmks@F{/F 1}\fi
+  \else
+    \ifKV at xbmks@style at bf
+      \def\x at bmks@F{/F 2}\fi
+  \fi
+}
+\let\x at bmks@F\@empty
+%    \end{macrocode}
+%    The \texttt{style} key takes zero, one, or two values, these are \texttt{bf} and \texttt{it}.
+%    \begin{macrocode}
+\define at boolkey{xbmks at style}{bf}[true]{}
+\define at boolkey{xbmks at style}{it}[true]{}
+\def\x at rollCFIntoActionBmrk#1{%
+  \xbmkcsarg\ifx{X_#1}\relax
+    \let\x at bmks@C\@empty\let\x at bmks@F\@empty\fi
+  \ifx\xbmk at J\xbmk at filename
+    \ifx\x at bmks@C\@empty\let\thisCol\xbmks at intC\else
+      \let\thisCol\x at bmks@C\fi
+    \ifx\x at bmks@F\@empty\let\thisF\xbmk at intF\else
+      \let\thisF\x at bmks@F\fi
+  \else
+    \ifx\x at bmks@C\@empty\let\thisCol\xbmks at extC\else
+      \let\thisCol\x at bmks@C\fi
+    \ifx\x at bmks@F\@empty\let\thisF\xbmk at extF\else
+      \let\thisF\x at bmks@F\fi
+  \fi
+  \global\let\x at bmks@C\@empty\global\let\x at bmks@F\@empty
+}
+%    \end{macrocode}
+%    We finally arrive at \cs{pdfbookmarkx} command.
+%    \begin{macrocode}
+\newcommand\pdfbookmarkx[2][0]{%
+  \@ifnextchar[%]
+    {\pdfbookmarkx at i{#1}{#2}}
+    {\pdfbookmarkx at i{#1}{#2}[]}}
+\def\pdfbookmarkx at i#1#2[#3]#4{% level, title, action, name
+  \def\x at rgiii{#3}\ifx\x at rgiii\@empty
+%    \end{macrocode}
+% if there is no action, treat as a destination
+%    \begin{macrocode}
+    \Hy at writebookmark{}{#2}{#4.#1}{#1}{toc}%
+    \hyper at anchorstart{#4.#1}\hyper at anchorend
+  \else
+  \protected at write\@outlinefile{}{%
+    \string\nextAction% assign doc ID
+      {\@nameuse{x\jobname}#4.#1}{#3}}%
+  \Hy at writebookmark{}{#2}{\@nameuse{x\jobname}#4.#1}{#1}{toc}%
+  \fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\currentpdfbookmarkx}
+%    \hskip-\marginparsep\,\texttt{\darg{\ameta{text}}[\ameta{xbmkskeys-kvp}]\darg{\ameta{name}}}\\
+%    The \texttt{action=\ameta{action}} is raw PDF code, for example,
+%\begin{quote}\ttfamily
+%\string\currentpdfbookmarkx[/S/URI/URI(http://www.acrotex.net)]\\\null
+%\qquad\darg{http://www.acrotex.net}\darg{home}
+%\end{quote}
+%   The command creates a bookmark at the current
+%   bookmark level in the outline tree and associates the specified \ameta{action}. The argument
+%   \ameta{text} appears in the bookmark panel. The \ameta{name} is used for identification purposes.
+%    \begin{macrocode}
+\newcommand{\currentpdfbookmarkx}[1]{%
+  \@ifnextchar[%]
+    {\currentpdfbookmarkx at i{#1}}
+    {\currentpdfbookmarkx at i{#1}[]}}
+\def\currentpdfbookmarkx at i#1[#2]#3{%
+  \pdfbookmarkx[\Hy at currentbookmarklevel]{#1}[{#2}]{#3}}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\subpdfbookmarkx}
+%    \hskip-\marginparsep\,\texttt{\darg{\ameta{text}}[\ameta{\ameta{xbmkskeys-kvp}}]\darg{\ameta{name}}}\\
+%    Reduces the current bookmark level by one, then creates
+%    the bookmark at that level. The reduced level is the new current
+%    bookmark level.
+%    \begin{macrocode}
+\newcommand{\subpdfbookmarkx}[1]{%
+  \@ifnextchar[%]
+    {\subpdfbookmarkx at i{#1}}
+    {\subpdfbookmarkx at i{#1}[]}}
+\def\subpdfbookmarkx at i#1[#2]#3{%
+  \@tempcnta\Hy at currentbookmarklevel
+  \Hy at StepCount\@tempcnta
+  \expandafter
+  \pdfbookmarkx\expandafter[\the\@tempcnta]{#1}[{#2}]{#3}}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\belowpdfbookmarkx}
+%    \hskip-\marginparsep\,\texttt{\darg{\ameta{text}}[\ameta{xbmkskeys-kvp}]\darg{\ameta{name}}}\\
+%    Creates a bookmark at one level below the current
+%    bookmark level without changing the value of the current bookmark
+%    level.
+%    \begin{macrocode}
+\newcommand{\belowpdfbookmarkx}[1]{%
+  \@ifnextchar[%]
+    {\belowpdfbookmarkx at i{#1}}
+    {\belowpdfbookmarkx at i{#1}[]}}
+\def\belowpdfbookmarkx at i#1[#2]#3{%
+  \@tempcnta\Hy at currentbookmarklevel
+  \Hy at StepCount\@tempcnta
+  \expandafter
+  \pdfbookmarkx\expandafter[\the\@tempcnta]{#1}[{#2}]{#3}%
+  \advance\@tempcnta by -1 %
+  \xdef\Hy at currentbookmarklevel{\the\@tempcnta}}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\nextAction at i}
+%     \hskip-\marginparsep\,\texttt{\darg{\ameta{anchor.level}}\darg{\ameta{xbmkskeys-kvp}}}\\
+%     This command is used internally, the document author need not do anything.
+%     The command \cs{nextAction} is \cs{let} to \cs{nextAction at i} just prior to when
+%     the outline file is input; and is \cs{let} to \cs{@gobbletwo}, otherwise.
+%    \begin{macrocode}
+\def\nextAction at i#1#2{\@ifundefined{X_#1}{%
+    \setkeys{xbmkskeys}{#2}%
+    \xbmkcsarg\xdef{X_#1}{\x at bmks@action}%
+    }{\global\xbmkcsarg\let{X_#1}\relax
+    \PackageWarning{xbmks}
+    {The anchor name `#1' is already defined,\MessageBreak
+    change this name, the bookmark will be created\MessageBreak
+    but it will have no associated action}}}
+%    \end{macrocode}
+%    \end{macro}
+%    These commands are implemented in the driver dependent sections.
+%    \begin{macrocode}
 % End package
 %</package>
 %<*pdfmark>
@@ -264,7 +460,7 @@
 %    \begin{macrocode}
 \def\ReadBookmarks{%
   \pdf at ifdraftmode{}{%
-    \begingroup
+    \begingroup\def\\{\@backslashchar\@backslashchar}% dps
       \def\calc at bm@number##1{%
       \@tempcnta=\check at bm@number{##1}\relax
       \advance\@tempcnta by 1 %
@@ -298,29 +494,48 @@
           \def\@@BOOKMARK[##1][##2]##3##4##5{%
             \calc at bm@number{##5}%
           }%
+          \let\nextAction\@gobbletwo
           \InputIfFileExists{\xbmk at filename.out}{}{}%
           \def\@@BOOKMARK[##1][##2]##3##4##5{%
             \def\Hy at temp{##4}%
-            \ifx\xbmk at J\xbmk at filename
-              \pdfmark{%
-                pdfmark=/OUT,%
-                Count={##2\check at bm@number{##3}},%
-                Raw={\xbmks at intdoc\xbmk at intF},%
-                Dest={##3},%
-                Title=\expandafter\strip at prefix\meaning\Hy at temp
-              }%
+%    \end{macrocode}
+%    If `\texttt{X\_\#\#3}' is undefined (\cs{relax}), it is a  normal bookmark.
+%    \begin{macrocode}
+            \xbmkcsarg\ifx{X_##3}\relax
+              \ifx\xbmk at J\xbmk at filename
+                \pdfmark{%
+                  pdfmark=/OUT,%
+                  Count={##2\check at bm@number{##3}},%
+                  Raw={\xbmks at intC\xbmk at intF},%
+                  Dest={##3},%
+                  Title=\expandafter\strip at prefix\meaning\Hy at temp
+                }%
+              \else
+                \pdfmark{%
+                  pdfmark=/OUT,%
+                  Count={##2\check at bm@number{##3}},%
+                  Raw={\xbmks at extC\xbmk at extF},%
+                  Action=/GoToR,%
+                  File={\xbmk at filename.pdf},%
+                  Dest={##3},%
+                  Title=\expandafter\strip at prefix\meaning\Hy at temp
+                }%
+              \fi
             \else
+%    \end{macrocode}
+%    The anchor has an `\texttt{X\_}' definition, it is a bookmark created
+%    from one of the `\texttt{bookmarkx}' commands. We treat this as a separate case.
+%    \begin{macrocode}
+              \x at rollCFIntoActionBmrk{##3}%
               \pdfmark{%
                 pdfmark=/OUT,%
                 Count={##2\check at bm@number{##3}},%
-                Raw={\xbmks at extdoc\xbmk at extF},%
-                Action=/GoToR,%
-                File={\xbmk at filename.pdf},%
-                Dest={##3},%
+                Raw={/Action<<\@nameuse{X_##3}>>\thisCol\thisF},%
                 Title=\expandafter\strip at prefix\meaning\Hy at temp
               }%
             \fi
-          }%
+          }% bookmark
+          \let\nextAction\nextAction at i
           \InputIfFileExists{\xbmk at filename.out}{}{}%
           \egroup
         }% \@whilenum
@@ -347,7 +562,7 @@
 %<*pdftex>
 \def\ReadBookmarks{%
   \pdf at ifdraftmode{}{%
-    \begingroup
+    \begingroup\def\\{\@backslashchar\@backslashchar}% dps
     \def\calc at bm@number##1{%
       \@tempcnta=\check at bm@number{##1}\relax
       \advance\@tempcnta by 1 %
@@ -377,8 +592,6 @@
     \begingroup
     \def\WriteBookmarks{0}%
     \count\z@=0\relax
-%    \toks0=\expandafter{\jobname}%
-%    \edef\xbmk at J{\the\toks0}%
     \edef\xbmk at J{\jobname}%
     \@whilenum \count\z@<\xbmk at cnt\relax\do{%
       \advance\count\z@ by 1 %
@@ -389,26 +602,44 @@
       \gdef\@@BOOKMARK[##1][##2]##3##4##5{%
         \calc at bm@number{##5}%
       }%
+      \let\nextAction\@gobbletwo
       \InputIfFileExists{\xbmk at filename.out}{}{}%
       \gdef\@@BOOKMARK[##1][##2]##3##4##5{%
         \def\Hy at temp{##4}%
         \Hy at pstringdef\Hy at pstringName{\HyperDestNameFilter{##3}}%
-        \ifx\xbmk at J\xbmk at filename
-          \Hy at OutlineName{\xbmks at intdoc\xbmk at intF}{<</S/GoTo%
-            /D(\Hy at pstringName)>>}{%
-            ##2\check at bm@number{\Hy at pstringName}%
-          }{%
-            \expandafter\strip at prefix\meaning\Hy at temp
-          }%
+        \xbmkcsarg\ifx{X_##3}\relax
+%    \end{macrocode}
+%     Ordinary bookmark
+%    \begin{macrocode}
+          \ifx\xbmk at J\xbmk at filename
+            \Hy at OutlineName{\xbmks at intC\xbmk at intF}{<</S/GoTo%
+              /D(\Hy at pstringName)>>}{%
+              ##2\check at bm@number{\Hy at pstringName}%
+            }{%
+              \expandafter\strip at prefix\meaning\Hy at temp
+            }%
+          \else
+            \Hy at OutlineName{\xbmks at extC\xbmk at extF}{<</S/GoToR%
+              /F(\xbmk at filename.pdf)/D(\Hy at pstringName)>>}{%
+              ##2\check at bm@number{##3}%
+            }{%
+              \expandafter\strip at prefix\meaning\Hy at temp
+            }%
+          \fi
         \else
-          \Hy at OutlineName{\xbmks at extdoc\xbmk at extF}{<</S/GoToR%
-            /F(\xbmk at filename.pdf)/D(\Hy at pstringName)>>}{%
-            ##2\check at bm@number{##3}%
+%    \end{macrocode}
+%     Bookmark created by one of the `\texttt{...bookmarkx} commands
+%    \begin{macrocode}
+          \x at rollCFIntoActionBmrk{##3}%
+          \Hy at OutlineName{\thisCol\thisF}
+          {<<\@nameuse{X_##3}>>}{%
+              ##2\check at bm@number{\Hy at pstringName}%
           }{%
             \expandafter\strip at prefix\meaning\Hy at temp
           }%
         \fi
       }% bookmark
+      \let\nextAction\nextAction at i
       \InputIfFileExists{\xbmk at filename.out}{}{}%
       \egroup
     } % \@whilenum
@@ -435,7 +666,7 @@
 %    \begin{macrocode}
 \def\ReadBookmarks{%
   \pdf at ifdraftmode{}{%
-    \begingroup
+    \begingroup\def\\{\@backslashchar\@backslashchar}% dps
       \def\calc at bm@number##1{%
         \@tempcnta=\check at bm@number{##1}\relax
         \advance\@tempcnta by 1 %
@@ -469,37 +700,44 @@
           \def\@@BOOKMARK[##1][##2]##3##4##5{%
             \calc at bm@number{##5}%
           }%
+          \let\nextAction\@gobbletwo
           \InputIfFileExists{\xbmk at filename.out}{}{}%
           \def\@@BOOKMARK[##1][##2]##3##4##5{%
             \def\Hy at temp{##4}%
             \Hy at pstringdef\Hy at pstringName{\HyperDestNameFilter{##3}}%
+            \x at rollCFIntoActionBmrk{##3}%
             \@pdfm at mark{%
               outline \ifHy at DvipdfmxOutlineOpen
-                      [%
-                      \ifnum##21>\z@
-                      \else
-                        -%
-                      \fi
-                      ] %
-                    \fi
+                [\ifnum##21>\z@\else-\fi] \fi
               ##1<<%
-                /Title(\expandafter\strip at prefix\meaning\Hy at temp)%
+              /Title(\expandafter\strip at prefix\meaning\Hy at temp)%
+              \xbmkcsarg\ifx{X_##3}\relax
+%    \end{macrocode}
+%     Ordinary bookmark
+%    \begin{macrocode}
                 \ifx\xbmk at J\xbmk at filename
                   /A<<%
                     /S/GoTo%
                     /D(\Hy at pstringName)%
                   >>%
-                  \xbmks at intdoc\xbmk at intF
                 \else
                   /A<<%
                     /S/GoToR/F(\xbmk at filename.pdf)%
                     /D(\Hy at pstringName)%
                   >>%
-                  \xbmks at extdoc\xbmk at extF
                 \fi
+              \else
+%    \end{macrocode}
+%     Bookmark created by one of the \texttt{\string\...bookmarkx} commands
+%    \begin{macrocode}
+                /A<<\@nameuse{X_##3}>>
+              \fi
+              \thisCol\thisF
               >>%
             }% \@pdfm at mark
+            \let\thisC\@empty\let\thisF\@empty
           }% bookmark
+          \let\nextAction\nextAction at i
           \InputIfFileExists{\xbmk at filename.out}{}{}%
           \egroup
         }% \@whilenum

Modified: trunk/Master/texmf-dist/source/latex/xbmks/xbmks.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/xbmks/xbmks.ins	2018-06-30 00:23:50 UTC (rev 48115)
+++ trunk/Master/texmf-dist/source/latex/xbmks/xbmks.ins	2018-06-30 21:05:48 UTC (rev 48116)
@@ -46,7 +46,6 @@
     \file{xbmks.sty}{\from{xbmks.dtx}{copyright,package}}
     \file{xbmks-pdfmark.def}{\from{xbmks.dtx}{copyright,pdfmark}}
     \file{xbmks-pdftex.def}{\from{xbmks.dtx}{copyright,pdftex}}
-    \file{xbmks-luatex.def}{\from{xbmks.dtx}{copyright,luatex}}
     \file{xbmks-xetex.def}{\from{xbmks.dtx}{copyright,xetex}}
 }
 

Deleted: trunk/Master/texmf-dist/tex/latex/xbmks/xbmks-luatex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xbmks/xbmks-luatex.def	2018-06-30 00:23:50 UTC (rev 48115)
+++ trunk/Master/texmf-dist/tex/latex/xbmks/xbmks-luatex.def	2018-06-30 21:05:48 UTC (rev 48116)
@@ -1,22 +0,0 @@
-%%
-%% This is file `xbmks-luatex.def',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% xbmks.dtx  (with options: `copyright,luatex')
-%% 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% xbmks.sty package,                                    %%
-%% Copyright (C) 2016--2018                              %%
-%%   dpstory at uakron.edu                                  %%
-%%                                                       %%
-%% This program can redistributed and/or modified under  %%
-%% the terms of the LaTeX Project Public License         %%
-%% Distributed from CTAN archives in directory           %%
-%% macros/latex/base/lppl.txt; either version 1.2 of the %%
-%% License, or (at your option) any later version.       %%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\endinput
-%%
-%% End of file `xbmks-luatex.def'.

Modified: trunk/Master/texmf-dist/tex/latex/xbmks/xbmks-pdfmark.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xbmks/xbmks-pdfmark.def	2018-06-30 00:23:50 UTC (rev 48115)
+++ trunk/Master/texmf-dist/tex/latex/xbmks/xbmks-pdfmark.def	2018-06-30 21:05:48 UTC (rev 48116)
@@ -19,7 +19,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \def\ReadBookmarks{%
   \pdf at ifdraftmode{}{%
-    \begingroup
+    \begingroup\def\\{\@backslashchar\@backslashchar}% dps
       \def\calc at bm@number##1{%
       \@tempcnta=\check at bm@number{##1}\relax
       \advance\@tempcnta by 1 %
@@ -53,29 +53,41 @@
           \def\@@BOOKMARK[##1][##2]##3##4##5{%
             \calc at bm@number{##5}%
           }%
+          \let\nextAction\@gobbletwo
           \InputIfFileExists{\xbmk at filename.out}{}{}%
           \def\@@BOOKMARK[##1][##2]##3##4##5{%
             \def\Hy at temp{##4}%
-            \ifx\xbmk at J\xbmk at filename
-              \pdfmark{%
-                pdfmark=/OUT,%
-                Count={##2\check at bm@number{##3}},%
-                Raw={\xbmks at intdoc\xbmk at intF},%
-                Dest={##3},%
-                Title=\expandafter\strip at prefix\meaning\Hy at temp
-              }%
+            \xbmkcsarg\ifx{X_##3}\relax
+              \ifx\xbmk at J\xbmk at filename
+                \pdfmark{%
+                  pdfmark=/OUT,%
+                  Count={##2\check at bm@number{##3}},%
+                  Raw={\xbmks at intC\xbmk at intF},%
+                  Dest={##3},%
+                  Title=\expandafter\strip at prefix\meaning\Hy at temp
+                }%
+              \else
+                \pdfmark{%
+                  pdfmark=/OUT,%
+                  Count={##2\check at bm@number{##3}},%
+                  Raw={\xbmks at extC\xbmk at extF},%
+                  Action=/GoToR,%
+                  File={\xbmk at filename.pdf},%
+                  Dest={##3},%
+                  Title=\expandafter\strip at prefix\meaning\Hy at temp
+                }%
+              \fi
             \else
+              \x at rollCFIntoActionBmrk{##3}%
               \pdfmark{%
                 pdfmark=/OUT,%
                 Count={##2\check at bm@number{##3}},%
-                Raw={\xbmks at extdoc\xbmk at extF},%
-                Action=/GoToR,%
-                File={\xbmk at filename.pdf},%
-                Dest={##3},%
+                Raw={/Action<<\@nameuse{X_##3}>>\thisCol\thisF},%
                 Title=\expandafter\strip at prefix\meaning\Hy at temp
               }%
             \fi
-          }%
+          }% bookmark
+          \let\nextAction\nextAction at i
           \InputIfFileExists{\xbmk at filename.out}{}{}%
           \egroup
         }% \@whilenum

Modified: trunk/Master/texmf-dist/tex/latex/xbmks/xbmks-pdftex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xbmks/xbmks-pdftex.def	2018-06-30 00:23:50 UTC (rev 48115)
+++ trunk/Master/texmf-dist/tex/latex/xbmks/xbmks-pdftex.def	2018-06-30 21:05:48 UTC (rev 48116)
@@ -19,7 +19,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \def\ReadBookmarks{%
   \pdf at ifdraftmode{}{%
-    \begingroup
+    \begingroup\def\\{\@backslashchar\@backslashchar}% dps
     \def\calc at bm@number##1{%
       \@tempcnta=\check at bm@number{##1}\relax
       \advance\@tempcnta by 1 %
@@ -59,26 +59,38 @@
       \gdef\@@BOOKMARK[##1][##2]##3##4##5{%
         \calc at bm@number{##5}%
       }%
+      \let\nextAction\@gobbletwo
       \InputIfFileExists{\xbmk at filename.out}{}{}%
       \gdef\@@BOOKMARK[##1][##2]##3##4##5{%
         \def\Hy at temp{##4}%
         \Hy at pstringdef\Hy at pstringName{\HyperDestNameFilter{##3}}%
-        \ifx\xbmk at J\xbmk at filename
-          \Hy at OutlineName{\xbmks at intdoc\xbmk at intF}{<</S/GoTo%
-            /D(\Hy at pstringName)>>}{%
-            ##2\check at bm@number{\Hy at pstringName}%
-          }{%
-            \expandafter\strip at prefix\meaning\Hy at temp
-          }%
+        \xbmkcsarg\ifx{X_##3}\relax
+          \ifx\xbmk at J\xbmk at filename
+            \Hy at OutlineName{\xbmks at intC\xbmk at intF}{<</S/GoTo%
+              /D(\Hy at pstringName)>>}{%
+              ##2\check at bm@number{\Hy at pstringName}%
+            }{%
+              \expandafter\strip at prefix\meaning\Hy at temp
+            }%
+          \else
+            \Hy at OutlineName{\xbmks at extC\xbmk at extF}{<</S/GoToR%
+              /F(\xbmk at filename.pdf)/D(\Hy at pstringName)>>}{%
+              ##2\check at bm@number{##3}%
+            }{%
+              \expandafter\strip at prefix\meaning\Hy at temp
+            }%
+          \fi
         \else
-          \Hy at OutlineName{\xbmks at extdoc\xbmk at extF}{<</S/GoToR%
-            /F(\xbmk at filename.pdf)/D(\Hy at pstringName)>>}{%
-            ##2\check at bm@number{##3}%
+          \x at rollCFIntoActionBmrk{##3}%
+          \Hy at OutlineName{\thisCol\thisF}
+          {<<\@nameuse{X_##3}>>}{%
+              ##2\check at bm@number{\Hy at pstringName}%
           }{%
             \expandafter\strip at prefix\meaning\Hy at temp
           }%
         \fi
       }% bookmark
+      \let\nextAction\nextAction at i
       \InputIfFileExists{\xbmk at filename.out}{}{}%
       \egroup
     } % \@whilenum

Modified: trunk/Master/texmf-dist/tex/latex/xbmks/xbmks-xetex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xbmks/xbmks-xetex.def	2018-06-30 00:23:50 UTC (rev 48115)
+++ trunk/Master/texmf-dist/tex/latex/xbmks/xbmks-xetex.def	2018-06-30 21:05:48 UTC (rev 48116)
@@ -19,7 +19,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \def\ReadBookmarks{%
   \pdf at ifdraftmode{}{%
-    \begingroup
+    \begingroup\def\\{\@backslashchar\@backslashchar}% dps
       \def\calc at bm@number##1{%
         \@tempcnta=\check at bm@number{##1}\relax
         \advance\@tempcnta by 1 %
@@ -53,37 +53,38 @@
           \def\@@BOOKMARK[##1][##2]##3##4##5{%
             \calc at bm@number{##5}%
           }%
+          \let\nextAction\@gobbletwo
           \InputIfFileExists{\xbmk at filename.out}{}{}%
           \def\@@BOOKMARK[##1][##2]##3##4##5{%
             \def\Hy at temp{##4}%
             \Hy at pstringdef\Hy at pstringName{\HyperDestNameFilter{##3}}%
+            \x at rollCFIntoActionBmrk{##3}%
             \@pdfm at mark{%
               outline \ifHy at DvipdfmxOutlineOpen
-                      [%
-                      \ifnum##21>\z@
-                      \else
-                        -%
-                      \fi
-                      ] %
-                    \fi
+                [\ifnum##21>\z@\else-\fi] \fi
               ##1<<%
-                /Title(\expandafter\strip at prefix\meaning\Hy at temp)%
+              /Title(\expandafter\strip at prefix\meaning\Hy at temp)%
+              \xbmkcsarg\ifx{X_##3}\relax
                 \ifx\xbmk at J\xbmk at filename
                   /A<<%
                     /S/GoTo%
                     /D(\Hy at pstringName)%
                   >>%
-                  \xbmks at intdoc\xbmk at intF
                 \else
                   /A<<%
                     /S/GoToR/F(\xbmk at filename.pdf)%
                     /D(\Hy at pstringName)%
                   >>%
-                  \xbmks at extdoc\xbmk at extF
                 \fi
+              \else
+                /A<<\@nameuse{X_##3}>>
+              \fi
+              \thisCol\thisF
               >>%
             }% \@pdfm at mark
+            \let\thisC\@empty\let\thisF\@empty
           }% bookmark
+          \let\nextAction\nextAction at i
           \InputIfFileExists{\xbmk at filename.out}{}{}%
           \egroup
         }% \@whilenum

Modified: trunk/Master/texmf-dist/tex/latex/xbmks/xbmks.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xbmks/xbmks.sty	2018-06-30 00:23:50 UTC (rev 48115)
+++ trunk/Master/texmf-dist/tex/latex/xbmks/xbmks.sty	2018-06-30 21:05:48 UTC (rev 48116)
@@ -19,7 +19,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \NeedsTeXFormat{LaTeX2e}[1997/12/01]
 \ProvidesPackage{xbmks}
- [2018/06/13 v1.1 xbmks: Cross-document bookmarks (dps)]
+ [2018/06/25 v2.0.1 xbmks: Cross-document bookmarks (dps)]
 \RequirePackage{xkeyval}
 \RequirePackage{ifpdf}[2006/02/20]
 \RequirePackage{ifxetex}[2006/08/21]
@@ -44,25 +44,25 @@
 \let\x at bmks@docs\@empty
 \define at key{xbmksetup}{colors}[]{\def\x at bmks@colors{#1}}
 \let\x at bmks@colors\@empty
-\define at key{xbmksetup}{style}[]{\def\x at bmks@style{#1}}
-\let\x at bmks@style\@empty
-\define at key{xbmk at colors}{intdoc}[]{%
-  \HyColor at BookmarkColor{#1}{\xbmks at intdoc}{xbmks}{intdoc}%
-  \ifx\xbmks at intdoc\@empty\else
-  \edef\xbmks at intdoc{/C[\xbmks at intdoc]}\fi
+\define at key{xbmksetup}{styles}[]{\def\x at bmks@styles{#1}}
+\let\x at bmks@styles\@empty
+\define at key{xbmk at colors}{int}[]{%
+  \HyColor at BookmarkColor{#1}{\xbmks at intC}{xbmks}{int}%
+  \ifx\xbmks at intC\@empty\else
+  \edef\xbmks at intC{/C[\xbmks at intC]}\fi
 }
-\let\xbmks at intdoc\@empty
-\define at key{xbmk at colors}{extdoc}[]{%
-  \HyColor at BookmarkColor{#1}{\xbmks at extdoc}{xbmks}{extdoc}%
-  \ifx\xbmks at extdoc\@empty\else
-  \edef\xbmks at extdoc{/C[\xbmks at extdoc]}\fi
+\let\xbmks at intC\@empty
+\define at key{xbmk at colors}{ext}[]{%
+  \HyColor at BookmarkColor{#1}{\xbmks at extC}{xbmks}{ext}%
+  \ifx\xbmks at extC\@empty\else
+  \edef\xbmks at extC{/C[\xbmks at extC]}\fi
 }
-\let\xbmks at extdoc\@empty
+\let\xbmks at extC\@empty
 \let\xbmks at Yes=y \let\xbmks at No=n
-\define at boolkey{xbmk at style}{intbf}[true]{} %\ifKV at xbmk@style at intbf
-\define at boolkey{xbmk at style}{extbf}[true]{}
-\define at boolkey{xbmk at style}{intit}[true]{}
-\define at boolkey{xbmk at style}{extit}[true]{}
+\define at boolkey{xbmk at styles}{intbf}[true]{}
+\define at boolkey{xbmk at styles}{extbf}[true]{}
+\define at boolkey{xbmk at styles}{intit}[true]{}
+\define at boolkey{xbmk at styles}{extit}[true]{}
 \newcommand{\xbmksetup}[1]{\setkeys{xbmksetup}{#1}%
   \ifx\x at bmks@docs\@empty
     \PackageInfo{xbmks}{The docbundle key of \string\xbmksetup\space
@@ -81,50 +81,134 @@
 }
 \newcommand{\xbmksetupi}[1]{%
   \setkeys{xbmksetup}{#1}%
-    \edef\@exp at for{\noexpand\docbundle{\x at bmks@docs}}\expandafter
-    \@exp at for
-    \edef\@exp at keys{\noexpand
-      \setkeys{xbmk at colors}{\x at bmks@colors}}\@exp at keys
-    \edef\@exp at keys{\noexpand
-      \setkeys{xbmk at style}{\x at bmks@style}}\@exp at keys
-      \def\xbmk at intF{}%
-      \ifKV at xbmk@style at intit
-        \ifKV at xbmk@style at intbf
-          \def\xbmk at intF{/F 3}%
-        \else
-          \def\xbmk at intF{/F 1}%
-        \fi
-      \else
-        \ifKV at xbmk@style at intbf
-          \def\xbmk at intF{/F 2}%
-        \fi
-      \fi
-      \def\xbmk at extF{}%
-      \ifKV at xbmk@style at extit
-        \ifKV at xbmk@style at extbf
-          \def\xbmk at extF{/F 3}%
-        \else
-          \def\xbmk at extF{/F 1}%
-        \fi
-      \else
-        \ifKV at xbmk@style at extbf
-          \def\xbmk at extF{/F 2}%
-        \fi
-      \fi
+  \edef\x{\noexpand\x at docbundle{\x at bmks@docs}}\x
+  \edef\x{\noexpand
+    \setkeys{xbmk at colors}{\x at bmks@colors}}\x
+  \edef\x{\noexpand
+    \setkeys{xbmk at styles}{\x at bmks@styles}}\x
+  \let\xbmk at intF\@empty
+  \ifKV at xbmk@styles at intit
+    \ifKV at xbmk@styles at intbf
+      \def\xbmk at intF{/F 3}\else
+      \def\xbmk at intF{/F 1}\fi
+  \else
+    \ifKV at xbmk@styles at intbf
+      \def\xbmk at intF{/F 2}\fi
+  \fi
+  \let\xbmk at extF\@empty
+  \ifKV at xbmk@styles at extit
+    \ifKV at xbmk@styles at extbf
+      \def\xbmk at extF{/F 3}\else
+      \def\xbmk at extF{/F 1}\fi
+  \else
+    \ifKV at xbmk@styles at extbf
+      \def\xbmk at extF{/F 2}\fi
+  \fi
 }
-\def\xbmk at csarg#1#2{\expandafter#1\csname#2\endcsname}
+\def\xbmkcsarg#1#2{\expandafter#1\csname#2\endcsname}
 \xdef\xbmk at cnt{0}
-\newcommand{\docbundle}[1]{\bgroup
+\newcommand{\x at docbundle}[1]{\bgroup
   \def\thisDoc{\jobname}\count\z@=0 %
   \edef\@tmpexp{\noexpand\@for\noexpand\@arg:=#1}%
-  \@tmpexp\do{%
-    \advance\count\z@ by 1\relax
-    \edef\@tmpexp{\noexpand\xbmk at recordDoc{\@arg}}\@tmpexp
+  \@tmpexp\do{\advance\count\z@ by 1\relax
+    \edef\x{\noexpand\xbmk at recordDoc{\@arg}}\x
+    \edef\x{\noexpand\xbmk at docID{\@arg}}\x
   }%
   \xdef\xbmk at cnt{\the\count\z@}\egroup
 }
 \newcommand{\xbmk at recordDoc}[1]{%
-  \xbmk at csarg\xdef{xbmk at doc\the\count\z@}{#1}}
+  \xbmkcsarg\xdef{xbmk at doc\the\count\z@}{#1}}
+\newcommand{\xbmk at docID}[1]{%
+  \xbmkcsarg\xdef{x#1}{x\the\count\z@}}
+\xbmkcsarg\xdef{x\jobname}{x0}
+\define at key{xbmkskeys}{action}{\def\x at bmks@action{#1}}
+\let\x at bmks@action\@empty
+\define at key{xbmkskeys}{color}[]{%
+  \HyColor at BookmarkColor{#1}{\x at bmks@C}{xbmks}{color}%
+  \ifx\x at bmks@C\@empty\else
+  \edef\x at bmks@C{/C[\x at bmks@C]}\fi
+}
+\let\x at bmks@C\@empty
+\define at key{xbmkskeys}{style}[]{%
+  \edef\x{\noexpand\setkeys{xbmks at style}{#1}}\x
+  \let\x at bmks@F\@empty
+  \ifKV at xbmks@style at it
+    \ifKV at xbmks@style at bf
+      \def\x at bmks@F{/F 3}\else
+      \def\x at bmks@F{/F 1}\fi
+  \else
+    \ifKV at xbmks@style at bf
+      \def\x at bmks@F{/F 2}\fi
+  \fi
+}
+\let\x at bmks@F\@empty
+\define at boolkey{xbmks at style}{bf}[true]{}
+\define at boolkey{xbmks at style}{it}[true]{}
+\def\x at rollCFIntoActionBmrk#1{%
+  \xbmkcsarg\ifx{X_#1}\relax
+    \let\x at bmks@C\@empty\let\x at bmks@F\@empty\fi
+  \ifx\xbmk at J\xbmk at filename
+    \ifx\x at bmks@C\@empty\let\thisCol\xbmks at intC\else
+      \let\thisCol\x at bmks@C\fi
+    \ifx\x at bmks@F\@empty\let\thisF\xbmk at intF\else
+      \let\thisF\x at bmks@F\fi
+  \else
+    \ifx\x at bmks@C\@empty\let\thisCol\xbmks at extC\else
+      \let\thisCol\x at bmks@C\fi
+    \ifx\x at bmks@F\@empty\let\thisF\xbmk at extF\else
+      \let\thisF\x at bmks@F\fi
+  \fi
+  \global\let\x at bmks@C\@empty\global\let\x at bmks@F\@empty
+}
+\newcommand\pdfbookmarkx[2][0]{%
+  \@ifnextchar[%]
+    {\pdfbookmarkx at i{#1}{#2}}
+    {\pdfbookmarkx at i{#1}{#2}[]}}
+\def\pdfbookmarkx at i#1#2[#3]#4{% level, title, action, name
+  \def\x at rgiii{#3}\ifx\x at rgiii\@empty
+    \Hy at writebookmark{}{#2}{#4.#1}{#1}{toc}%
+    \hyper at anchorstart{#4.#1}\hyper at anchorend
+  \else
+  \protected at write\@outlinefile{}{%
+    \string\nextAction% assign doc ID
+      {\@nameuse{x\jobname}#4.#1}{#3}}%
+  \Hy at writebookmark{}{#2}{\@nameuse{x\jobname}#4.#1}{#1}{toc}%
+  \fi
+}
+\newcommand{\currentpdfbookmarkx}[1]{%
+  \@ifnextchar[%]
+    {\currentpdfbookmarkx at i{#1}}
+    {\currentpdfbookmarkx at i{#1}[]}}
+\def\currentpdfbookmarkx at i#1[#2]#3{%
+  \pdfbookmarkx[\Hy at currentbookmarklevel]{#1}[{#2}]{#3}}
+\newcommand{\subpdfbookmarkx}[1]{%
+  \@ifnextchar[%]
+    {\subpdfbookmarkx at i{#1}}
+    {\subpdfbookmarkx at i{#1}[]}}
+\def\subpdfbookmarkx at i#1[#2]#3{%
+  \@tempcnta\Hy at currentbookmarklevel
+  \Hy at StepCount\@tempcnta
+  \expandafter
+  \pdfbookmarkx\expandafter[\the\@tempcnta]{#1}[{#2}]{#3}}
+\newcommand{\belowpdfbookmarkx}[1]{%
+  \@ifnextchar[%]
+    {\belowpdfbookmarkx at i{#1}}
+    {\belowpdfbookmarkx at i{#1}[]}}
+\def\belowpdfbookmarkx at i#1[#2]#3{%
+  \@tempcnta\Hy at currentbookmarklevel
+  \Hy at StepCount\@tempcnta
+  \expandafter
+  \pdfbookmarkx\expandafter[\the\@tempcnta]{#1}[{#2}]{#3}%
+  \advance\@tempcnta by -1 %
+  \xdef\Hy at currentbookmarklevel{\the\@tempcnta}}
+\def\nextAction at i#1#2{\@ifundefined{X_#1}{%
+    \setkeys{xbmkskeys}{#2}%
+    \xbmkcsarg\xdef{X_#1}{\x at bmks@action}%
+    }{\global\xbmkcsarg\let{X_#1}\relax
+    \PackageWarning{xbmks}
+    {The anchor name `#1' is already defined,\MessageBreak
+    change this name, the bookmark will be created\MessageBreak
+    but it will have no associated action}}}
 \InputIfFileExists{xbmks.cfg}{}{}
 \@ifpackageloaded{bookmark}{\PackageWarningNoLine{xbmks}{The
   bookmark package is not supported;\MessageBreak



More information about the tex-live-commits mailing list