Debian Codegraph @

texmf-dist/doc/latex/xbmks/docs/xbmksman.tex

raw
1 %
2 % Need some discussion on workflow
3 %
4 % makeindex < aebpro_man.idx > aebpro_man.ind
5 \documentclass[10pt]{article}
6 \usepackage[fleqn]{amsmath}
7 \usepackage[
8 web={centertitlepage,designv,forcolorpaper,latextoc,pro,addtoHyOpts={pagebackref=false}},
9 eforms,
10 % linktoattachments,
11 aebxmp
12 ]{aeb_pro}
13 \usepackage{aeb_mlink}
14 \usepackage{graphicx,array}
15 %\usepackage{myriadpro}
16 %\usepackage{calibri}
17 \usepackage[altbullet]{lucidbry}
18
19 \usepackage{xbmks}
20 \DeclareInitView{layoutmag={navitab:UseOutlines}}
21 \xbmksetup{colors={int=red},styles={intbf}}
22
23 \addtolength{\marginparwidth}{20pt}
24
25 %\previewtrue
26 %\usepackage{makeidx}
27 %\makeindex
28 \usepackage{acroman}
29 \usepackage[active]{srcltx}
30
31 \setcounter{secnumdepth}{4}
32 \setcounter{tocdepth}{5}
33 \makeatletter
34 \renewcommand*{\theparagraph}{\texorpdfstring{\protect\P\protect\ }{\textparagraph}}
35 \renewcommand{\paragraph}
36 {\renewcommand{\@seccntformat}[1]{\theparagraph}%
37 \@startsection{paragraph}{4}{0pt}{6pt}{-3pt}{\color{\aeb@subsubsectioncolor}\bfseries}}
38 \renewcommand*\l@paragraph{\@dottedtocline{4}{5.0em}{1em}} %{7.0em}{4.1em}}
39 \def\chgCurrLblName#1{\def\@currentlabelname{#1}}
40 \def\echgCurrLblName#1{\edef\@currentlabelname{#1}}
41 \makeatother
42
43 %\getDimsFromGraphic{graphics/dpsweb}{\dpswebW}{\dpswebH}
44
45
46 %\urlstyle{rm}
47 \urlstyle{sf}
48 \let\uif\textsf
49 \let\app\textsf
50 \def\psf#1{\textbf{\textsf{#1}}}
51 %\let\amtIndent\leftmargini
52 \edef\amtIndent{\the\parindent}
53
54 \renewcommand*\descriptionlabel[1]{\hspace\labelsep
55 \normalfont #1}
56
57
58 \DeclareDocInfo
59 {
60 university={Acro\negthinspace\TeX.Net},
61 title={The \textsf{xbmks} package\texorpdfstring{\\}{: }Cross-document bookmarks},
62 author={D. P. Story},
63 email={[email protected]},
64 subject={Documentation for the xbmks package from AcroTeX: cross-document bookmarks},
65 talksite={\url{www.acrotex.net}},
66 version={2.0.3, 2020/01/16},
67 Keywords={AcroTeX, bookmarks, cross-document, document bundle},
68 copyrightStatus=True,
69 copyrightNotice={Copyright (C) \the\year, D. P. Story},
70 copyrightInfoURL={http://www.acrotex.net}
71 }
72
73 \def\dps{$\hbox{$\mathfrak D$\kern-.3em\hbox{$\mathfrak P$}%
74 \kern-.6em \hbox{$\mathcal S$}}$}
75
76 \universityLayout{fontsize=Large}
77 \titleLayout{fontsize=LARGE}
78 \authorLayout{fontsize=Large}
79 \tocLayout{fontsize=Large,color=aeb}
80 \sectionLayout{indent=-62.5pt,fontsize=large,color=aeb}
81 \subsectionLayout{indent=-31.25pt,color=aeb}
82 \subsubsectionLayout{indent=0pt,color=aeb}
83 \subsubDefaultDing{\texorpdfstring{$\bullet$}{\textrm\textbullet}}
84
85 \widestNumber{0.00.}
86 %\pagestyle{empty}
87 %\parindent0pt\parskip\medskipamount
88
89 \def\dps{$\mbox{$\mathfrak D$\kern-.3em\mbox{$\mathfrak P$}%
90 \kern-.6em \hbox{$\mathcal S$}}$}
91
92 \newcount\fldCnt \fldCnt=0
93 \def\incFldCnt{\global\advance\fldCnt1\relax}
94
95 \frenchspacing
96
97 \chngDocObjectTo{\newDO}{doc}
98 \begin{docassembly}
99 var titleOfManual="The xbmks package MANUAL";
100 var manualfilename="Manual_BG_Print_xbmks.pdf";
101 var manualtemplate="Manual_BG_Brown.pdf"; // Blue, Green, Brown
102 var _pathToBlank="C:/Users/Public/Documents/ManualBGs/"+manualtemplate;
103 var doc;
104 var buildIt=false;
105 if ( buildIt ) {
106 console.println("Creating new " + manualfilename + " file.");
107 doc = \appopenDoc({cPath: _pathToBlank, bHidden: true});
108 var _path=this.path;
109 var pos=_path.lastIndexOf("/");
110 _path=_path.substring(0,pos)+"/"+manualfilename;
111 \docSaveAs\newDO ({ cPath: _path });
112 doc.closeDoc();
113 doc = \appopenDoc({cPath: manualfilename, oDoc:this, bHidden: true});
114 f=doc.getField("ManualTitle");
115 f.value=titleOfManual;
116 doc.flattenPages();
117 \docSaveAs\newDO({ cPath: manualfilename });
118 doc.closeDoc();
119 } else {
120 console.println("Using the current "+manualfilename+" file.");
121 }
122 var _path=this.path;
123 var pos=_path.lastIndexOf("/");
124 _path=_path.substring(0,pos)+"/"+manualfilename;
125 \addWatermarkFromFile({
126 bOnTop:false,
127 bOnPrint:false,
128 cDIPath:_path
129 });
130 \executeSave();
131 \end{docassembly}
132
133 \begin{document}
134
135 \maketitle
136
137 \pdfbookmarkx[1]{Title Page}[action={\Named{FirstPage}}]{TitlePage}
138 \pdfbookmarkx[1]{Links to AcroTeX.Net}[action={/S/GoTo/D(undefined)},%
139 color=magenta,style={bf}]{acrotex}
140 \belowpdfbookmarkx{http://www.acrotex.net}[action={\URI{http://www.acrotex.net}},%
141 color=magenta,style={bf}]{home}
142 \belowpdfbookmarkx{http://blog.acrotex.net}[action={\URI{http://blog.acrotex.net}},%
143 color=magenta,style={bf}]{blog}
144
145
146 \selectColors{linkColor=black}
147 \tableofcontents
148 \selectColors{linkColor=webgreen}
149
150 \def\AcroT{Acro\!\TeX}\def\cAcroT{\textcolor{blue}{\AcroT}}
151 \def\AcroEB{\AcroT{} eDucation Bundle}\def\cAcroEB{\textcolor{blue}{\AcroEB}}
152 \def\AcroB{\AcroT{} Bundle}\def\cAcroB{\textcolor{blue}{\AcroB}}
153 \def\bUrl{http://www.math.uakron.edu/~dpstory}
154
155 \hypersetup{linktocpage}
156
157 \section{Introduction}
158
159 It has been more than a couple decades ago (counting back from 2018), I wrote
160 two mathematics tutorials:
161 \textsl{\href{http://www.math.uakron.edu/~dpstory/e-calculus.html}{eCalculus}}
162 and
163 \textsl{\mlhref{http://www.math.uakron.edu/~dpstory/mpt_home.html}{Algebra
164 Review in Ten Lessons}}. The tutorials consisted of a number of lessons, each
165 lesson was in a separate PDF. The bookmarks of each lesson contained the
166 table of contents \emph{for the whole tutorial}. A student, in theory, could
167 then jump from one lesson to another by selecting a topic of interest from
168 the bookmarks. In the intervening years I have not seen a {\LaTeX} package
169 for merging the table of contents of a set of PDFs and merge them in this
170 each member of the set. The \pkg{xbmks} package attempts to reproduce this
171 feature.
172
173 \section{Required packages and options}
174
175 The only requirement is the \pkg{hyperref} package; there is a negative
176 requirement, the \pkg{bookmark} package is not supported. If it is detected
177 within a \pkg{xbmks} document, normal non-cross-document bookmarks are
178 produced.
179
180 The only options are driver options, these are \opt{dvips} (\app{Acrobat
181 Distiller} or \app{ps2pdf} can be used as the PDF creator), \opt{pdftex} (and
182 \opt{luatex}, which is treated the same as \opt{pdftex}), and \opt{xetex}. Of
183 course, this is a {\LaTeX} package, so the `la' versions of these applications
184 need to be used. The package auto-detects \app{pdftex} and \app{xetex}, and
185 \opt{dvips} is the default, so there is actually no need to pass the driver
186 option.
187
188 \section{The preamble command \texorpdfstring{\protect\cs{xbmksetup}}{\textbackslash{xbmksetup}}}\label{s:xbmksetup}
189
190 The only user command is \cs{xbmksetup}:
191 \bVerb\def\1{\qquad}\takeMeasure{\1docbundle=\darg{\ameta{doc\SUB1},\ameta{doc\SUB2},...,\ameta{doc\SUB{n}}},}%
192 \begin{dCmd}[commandchars=!()]{\bxSize}
193 \xbmksetup{%
194 !1docbundle={!ameta(doc!SUB1),!ameta(doc!SUB2),...,!ameta(doc!SUB(n))},
195 !1colors={int=!ameta(color),ext=!ameta(color)},
196 !1styles={intbf,extbf,intit,extit}
197 }
198 \end{dCmd}
199 \eVerb You have a collection of files (as specified by the \texttt{docbundle}
200 key) that you want to merge the bookmarks together so they appear in all the
201 files. However, the \cs{xbmksetup} only appears \textbf{in one and only one
202 of the documents}, perhaps the one that you think of as the main file.\footnote{The main file is the first one
203 listed in the value of the \texttt{docbundle} key.} The
204 argument of \cs{xbmksetup} are written to the file \texttt{xbmks.cfg} and
205 input back into each of the files as they are compiled. This is needed so
206 that across all files in the document bundle, they all obey the very same
207 options.
208
209 \paragraph*{Description of the key-values}
210 \begin{description}
211 \item[\texttt{docbundle}] (Optional) The value of this key, if present,
212 is a comma-delimited list of base names that are a part of this
213 document collection, or bundle. For example,
214 \begin{Verbatim}[xleftmargin=\amtIndent]
215 docbundle={lesson1,lesson2,lesson3,lesson4}
216 \end{Verbatim}
217 The order the bookmarks are listed in each file of the document bundle is the same order
218 the files are listed in \texttt{docbundle}; in this above example, the bookmarks for
219 \texttt{lesson1} are listed first, than those of \texttt{lesson2}, and so on.
220
221 The first document listed (\texttt{lesson1}) is where the \cs{xbmksetup}
222 commend is placed. This file might be thought of as the `main' file.
223
224 \textbf{\textcolor{red}{Important:}} It is extremely important to list the
225 base names the using the same spelling and case as the \cs{jobname} command
226 returns in each of the bundle collection. When each file is compiled,
227 \pkg{xbmks} tries to determine which in the list of \texttt{docbundle}
228 files is the one currently being compiled; it is necessary in order to
229 create a internal jump or an external jump. If anything goes wrong, be sure
230 to check the spelling of each file listed.
231
232 \textbf{Empty or missing \texttt{docbundle} key.} If this key is missing,
233 then it is assigned a value of \cs{jobname}. As a result, normal bookmarks
234 are generated for the document \cs{jobname}; however, as an extra benefit,
235 the other keys are obeyed (\texttt{colors} and \texttt{styles}). See the
236 sample file \texttt{stand-alone.tex} found in the \texttt{examples} file.
237 This manual uses the \pkg{xbmks} package with,
238 \begin{Verbatim}[xleftmargin=\amtIndent]
239 \xbmksetup{colors={int=red},styles={intbf}}
240 \end{Verbatim}
241 \item[\texttt{colors}] (Optional) For any given document in the bundle,
242 there are two types of links in the bookmarks, a link to an item in
243 the current (or internal) document, or a link to an external document
244 (within the bundle of documents).
245 \begin{itemize}
246 \item \texttt{int=\ameta{color}}, where \ameta{color} is an rgb
247 color. This specifies the color of the link for an internal
248 jump within the current document. Specify the color
249 using the syntax \texttt{\darg{[rgb]{\ameta{r},\ameta{g},\ameta{b}}}};
250 for example,
251 \begin{Verbatim}[xleftmargin=\amtIndent]
252 colors={int={[rgb]{0,.6,0}}
253 \end{Verbatim}
254 or, if the \pkg{xcolor} package is loaded, \emph{named colors} may be used.
255 \item\texttt{ext=\ameta{color}}, where \ameta{color} is an rgb
256 color. This specifies the color of the link for an external jump
257 to another member of the document bundle. Color specification is the
258 same as for \texttt{int}:
259 \begin{Verbatim}[xleftmargin=\amtIndent]
260 colors={int=red,ext=blue}
261 \end{Verbatim}
262 In the above example, we assume \pkg{xcolor} is loaded and specify the
263 colors accordingly.
264
265 \textbf{The default color.} If you declare \texttt{int} (or
266 \texttt{ext}) without a value, you get the default, which is the color
267 key is not specified within the PDF document. The \texttt{color} key is
268 optional, in which case, you get the default color. What is the default
269 color? Well, its either white or black, depending on the \textsf{Display
270 Theme}. The PDF viewer (\app{Acrobat} and \app{Acrobat Reader DC}
271 automatically switch colors when the theme is changed).
272
273 When you specify a color, be aware that what looks good in the \emph{light
274 theme} may not be so visible in a \emph{dark theme}.
275 \end{itemize}
276 \item[\texttt{styles}] (Optional) The Adobe PDF viewer applications also
277 support a bold and italics style. These can be specified for the
278 internal and external documents.
279 \begin{itemize}
280 \item Internal styles (valueless) keys are \texttt{intbf} and \texttt{intit}; zero, one, or
281 two of these may be specified,
282 \begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
283 styles={intbf} % !normalfont(bold font)
284 styles={intit} % !normalfont(italics font)
285 styles={intbf,intit} % !normalfont(bold and italics font)
286 \end{Verbatim}
287 \item External styles (valueless) keys are \texttt{extbf} and \texttt{extit}; zero, one, or
288 two of these may be specified,
289 \begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
290 styles={extbf} % !normalfont(bold font)
291 styles={extit} % !normalfont(italics font)
292 styles={extbf,extit} % !normalfont(bold and italics font)
293 \end{Verbatim}
294 \end{itemize}
295 Of course, all these keys are specified or not, in the \texttt{styles} key:
296 \begin{Verbatim}[xleftmargin=\amtIndent]
297 styles={intbf,extit}
298 \end{Verbatim}
299 Here, we specify bold font for the current document and an italics for an
300 internal document.
301 \end{description}
302
303 \newtopic\noindent\textbf{Point of personal preference.} After experimenting with
304 various combinations of colors and styles with combinations of themes
305 (light and dark) I prefer no color specified with bold font for the current
306 document and plain font for any external document. I think it's important to
307 make it clear in the bookmark panel which are internal and which are
308 external. The bold font tells the same story independent of theme. Thus,\def\1{\qquad}%
309 \begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
310 \xbmksetup{%
311 !1docbundle={!ameta(doc!SUB1),!ameta(doc!SUB2),...,!ameta(doc!SUB(n))},
312 !1styles={intbf}
313 }
314 \end{Verbatim}
315 seems to be a reasonable choice of key-values.
316
317 \section{Creating bookmarks with other actions}
318
319 The \pkg{hyperref} package provides commands (\cs{pdfbookmark},
320 \cs{currentpdfbookmark}, \cs{subpdfbookmark}, and \cs{belowpdfbookmark})
321 designed to create bookmarks that jump to a specified destination in the
322 current document. The \pkg{xbmks} package now defines similar commands in
323 which arbitrary actions may be defined.
324 \bVerb\def\1{\qquad}\takeMeasure{\string\pdfbookmarkx[\ameta{level}]\darg{\ameta{text}}[\ameta{KV-pairs}]\darg{\ameta{name}}}%
325 \begin{dCmd}[commandchars=!()]{\bxSize}
326 \pdfbookmarkx[!ameta(level)]{!ameta(text)}[!ameta(KV-pairs)]{!ameta(name)}
327 \currentpdfbookmarkx{!ameta(text)}[!ameta(KV-pairs)]{!ameta(name)}
328 \subpdfbookmarkx{!ameta(text)}[!ameta(KV-pairs)]{!ameta(name)}
329 \belowpdfbookmarkx{!ameta(text)}[!ameta(KV-pairs)]{!ameta(name)}
330 \end{dCmd}
331 \bVerb If the optional \ameta{KV-pairs} argument is not present, the command
332 behaves just like its \pkg{hyperref} counterpart; \ameta{name} is used to
333 create a destination (or anchor) for the ordinary bookmark link. If
334 \ameta{KV-pairs} is specified, no anchor is created, but \ameta{name} is used
335 to associate the \ameta{action} with the bookmark.
336
337 \paragraph*{Description of the commands}\leavevmode
338 \begin{aebDescript}
339 \item[\cs{pdfbookmarkx}] Creates a bookmark at level \ameta{level} in the
340 outline tree hierarchy.
341 \item[\cs{currentpdfbookmarkx}] The command creates a bookmark at the current
342 bookmark level in the outline tree.
343 \item[\cs{subpdfbookmarkx}] Reduces the current bookmark level by one,
344 then creates the bookmark at that level. The reduced level is the
345 new current bookmark level.
346 \item[\cs{belowpdfbookmarkx}] Creates a bookmark at one level below the
347 current bookmark level without changing the value of the current
348 bookmark level.
349 \end{aebDescript}
350
351 \paragraph*{Description of the \ameta{KV-pairs} argument.} The \ameta{KV-pairs} argument
352 accepts up to three key-value pairs:
353 \begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
354 action=!ameta(PDF-action),color=!ameta(color),style=!ameta(!upshape(bf|it))
355 \end{Verbatim}
356 Notice that \texttt{color} and \texttt{style} are in the singular, as opposed to the plural
357 as they were in description of the key-value pairs for \cs{xbmksetup}, back on page~\pageref{s:xbmksetup}.
358 \begin{aebDescript}
359 \item[\texttt{action=\ameta{PDF-action}}] \ameta{PDF-action}
360 is raw PDF action code. I decided to just keep it simple. Consult Section 8.5 titled `Actions',
361 in particular, read Section~8.5.3 on `Action Types' of the \textsl{PDF Reference Sixth Edition, Version 1.7}.\footnote
362 {\url{https://www.adobe.com/devnet/pdf/pdf_reference_archive.html}} A general
363 syntax for the \ameta{action} is,
364 \begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
365 /S!ameta(action-type)!ameta(other-key-values)
366 \end{Verbatim}
367 Common action-types are \texttt{/URI}, \texttt{/JavaScript}, \texttt{/Named}, and \texttt{/GoToR}.
368 Below are some examples, the ones that appear in the demo files.
369 \begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
370 \belowpdfbookmarkx{http://www.acrotex.net}
371 [action={/S/URI/URI(http://www.acrotex.net)}]{home}
372 \currentpdfbookmarkx{Current: Hello world!}
373 [action={/S/JavaScript/JS(app.alert("Hello World!");)}]{bmk1}
374 \subpdfbookmarkx{Sub: First Page}[/S/Named/N/FirstPage]{bmk2}
375 \belowpdfbookmarkx{Go to doc1, page 1}
376 [action={/S/GoToR/F(doc1.pdf)/D[1 /Fit]}]{gotor}
377 \end{Verbatim}
378
379 \textbf{When \pkg{eforms} is loaded.} The \pkg{eforms} package defines
380 some helper commands for common action types, these are \cs{URI}, \cs{JS},
381 \cs{Named}, and \cs{GoToR}. The above examples are then written as,
382 \begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
383 \belowpdfbookmarkx{http://www.acrotex.net}
384 [action={\URI{http://www.acrotex.net}}]{home}
385 \currentpdfbookmarkx{Current: Hello world!}
386 [action={\JS{app.alert("Hello World!");}}]{bmk1}
387 \subpdfbookmarkx{Sub: First Page}
388 [action={\Named{FirstPage}{]{bmk2}
389 \belowpdfbookmarkx{Go to doc1, page 1}
390 [action={\GoToR/F(doc1.pdf)/D[1 /Fit]}]{gotor}
391 \end{Verbatim}
392
393 \item[\texttt{color=\ameta{color}}] The value of this key determines the
394 color of the link. The value of \ameta{color} was described in the
395 \texttt{colors} key. If this key is not specified, the value \texttt{int}
396 or \texttt{ext} of the \texttt{colors} key is used, as appropriate. When
397 the value of the \texttt{color} key is specified, the link receives the
398 \ameta{color} across all documents in the bundle.
399
400 \item[\texttt{style=\ameta{\upshape{bf|it}}}] The value of this key
401 determines the style (\texttt{bf} -- bold, \texttt{it} -- italics); the
402 keys may be used together \texttt{style=\darg{bf,it}} gives bold italics
403 font. When \texttt{style} is not specified, the value of the \texttt{styles}
404 key is used. When \texttt{style} is specified, the same style is assigned
405 across all documents in the bundle.
406 \begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
407 \belowpdfbookmarkx{http://www.acrotex.net}
408 [action={\URI{http://www.acrotex.net}},
409 color=magenta,style=bf]{home}
410 \end{Verbatim}
411 This bookmark is colored magenta in bold across all documents in the bundle.
412 \begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
413 \belowpdfbookmarkx{http://www.acrotex.net}
414 [action={\URI{http://www.acrotex.net}}]{home}
415 \end{Verbatim}
416 This bookmark takes on the colors and styles declared by the \texttt{colors}
417 and \texttt{styles} keys.
418 \end{aebDescript}
419
420 \section{Workflow}
421
422 Given that you have a collection of files that are to contain a common set of
423 bookmarks, how exactly do you do this? Basically, you treat them the same way
424 as you would when you use the \pkg{xy-hyper} package, used for creating cross
425 document links.
426
427 \paragraph*{Steps to build the document bundle}\leavevmode
428
429 \begin{enumerate}
430 \item Compile each document at least twice without deleting any
431 auxiliary files, more if you are using \pkg{xr-hyper}; in
432 particular, without deleting any \textsf{OUT} outline files created
433 by \pkg{hyperref}.
434
435 In terms of order of compilation, compile the main file first (the
436 one that contains the \cs{xbmksetup} command); this will write the
437 \texttt{xbmks.cfg} file and it will be available to the other files
438 in the bundle as you compile them.
439
440 \item All files have been compiled twice, now compile them one more
441 time so they can input the updated \textsf{OUT} files of the
442 collection and the \texttt{xbmks.cfg} configuration file that
443 contains your setup options for the whole collection.
444 \item If you are using \app{pdflatex}, \app{lualatex}, or
445 \app{xelatex}, you are done; otherwise, convert each DVI file to PS
446 using \app{dvips}. Finally, convert each PS file in the collection
447 to PDF using \app{Acrobat Distiller} or \app{ps2pdf}.
448 \item Delete all auxiliary file, including \texttt{xbmks.cfg} if you wish.
449 \end{enumerate}
450 If you are on \app{Windows OS}, you can use the
451 \app{\href{http://www.acrotex.net/builders/}{AeB Builder}} utility to build
452 the entire bundle of
453 documents.\footnote{\url{http://www.acrotex.net/builders/}} In that utility,
454 you would select the \app{External cross-references} option, found on the
455 user-interface.
456
457 \paragraph*{Sample files.} The demonstration files are found in the \texttt{examples} folder. The
458 \pkg{xcolor} package is used, otherwise, the packages used are minimal.
459
460
461 \newtopic\noindent Now, back to my retirement. \dps
462
463
464
465 \end{document}