summaryrefslogtreecommitdiff
path: root/texmf-dist/doc/latex/pmdb/pmdb-man.tex
blob: d2a5e950dec8de73fd3d9c864c372c547999f174 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
\documentclass{article}
\usepackage{amstext}
\usepackage[
    web={centertitlepage,designv,forcolorpaper,tight*,latextoc,extended},
%    exerquiz,
%    eforms={usealtadobe,setcorder},
    aebxmp
]{aeb_pro}
\usepackage[ImplMulti]{dljslib}
\usepackage{graphicx,array,fancyvrb}
\usepackage{aeb_mlink}
%\usepackage{myriadpro}
%\usepackage{calibri}
\usepackage[altbullet]{lucidbry}
\usepackage[dbmode]{pmdb}

%\previewOn\pmpvOn
\editSourceOn

\pmCBPresets{\textColor{red}}

\reversemarginpar

\makeatletter
\renewcommand*\l@section[2]{%
  \ifnum \c@tocdepth >\z@
    \addpenalty\@secpenalty
    \addvspace{.75em \@plus\p@}% make less space
    \setlength\@tempdima{1.5em}%
    \begingroup
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode \bfseries
      \advance\leftskip\@tempdima
      \hskip -\leftskip
      #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
    \endgroup
  \fi}
\makeatother

\let\tops\texorpdfstring


\def\FmtMP#1{\marginpar{\small\itshape\raggedleft#1}}

\hfuzz2pt
%\makePDasXOn

%\previewOn\pmpvOn

\def\hardspace{{\fontfamily{cmtt}\selectfont\symbol{32}}}
\let\uif\textsf

\advance\marginparwidth12pt

\usepackage{acroman}
\usepackage[active]{srcltx}

\edef\amtIndent{\the\parindent}

\addtolength{\marginparwidth}{2pt}

\urlstyle{tt}

\def\STRUT{\rule{0pt}{14pt}}

\makeatletter
\newcount\hesheCnt \hesheCnt=-1
\def\heshe{\@ifstar{\heshei}{\global\advance\hesheCnt1\relax\heshei}}
\def\heshei{\ifodd\hesheCnt she\else he\fi}
\def\HeShe{\@ifstar{\HeShei}{\global\advance\hesheCnt1\relax\HeShei}}
\def\HeShei{\ifodd\hesheCnt She\else He\fi}
\def\hisher{\@ifstar{\hisheri}{\global\advance\hesheCnt1\relax\hisheri}}
\def\hisheri{\ifodd\hesheCnt her\else his\fi}
\def\himher{\@ifstar{\himheri}{\global\advance\hesheCnt1\relax\himheri}}
\def\himheri{\ifodd\hesheCnt her\else him\fi}
\makeatother

\DeclareDocInfo
{
    university={\AcroTeX.Net},
    title={The \textsf{pmdb} Package},
    author={D. P. Story},
    email={dpstory@acrotex.net},
    subject=Documentation for the pmdb package,
    talksite={\url{www.acrotex.net}},
    version={1.0, 2021/06/07},
    Keywords={DB, LaTeX, AcroTeX},
    copyrightStatus=True,
    copyrightNotice={Copyright (C) \the\year, D. P. Story},
    copyrightInfoURL={http://www.acrotex.net}
}

\universityLayout{fontsize=Large}
\titleLayout{fontsize=LARGE}
\authorLayout{fontsize=Large}
\tocLayout{fontsize=Large,color=aeb}
\sectionLayout{indent=-62.5pt,fontsize=large,color=aeb}
\subsectionLayout{indent=-31.25pt,color=aeb}
\subsubsectionLayout{indent=0pt,color=aeb}
\subsubDefaultDing{\tops{$\bullet$}{\textrm\textbullet}}

\def\fnJS{aeb-reader.js}

\chngDocObjectTo{\newDO}{doc}
\begin{docassembly}
var titleOfManual="The pmdb Package";
var manualfilename="Manual_BG_Print_pmdb.pdf";
var manualtemplate="Manual_BG_Brown.pdf"; // Blue, Green, Brown
var _pathToBlank="C:/Users/Public/Documents/ManualBGs/"+manualtemplate;
var doc;
var buildIt=false;
if ( buildIt ) {
  console.println("Creating new " + manualfilename + " file.");
  doc = \appopenDoc({cPath: _pathToBlank, bHidden: true});
  var _path=this.path;
  var pos=_path.lastIndexOf("/");
  _path=_path.substring(0,pos)+"/"+manualfilename;
  \docSaveAs\newDO ({ cPath: _path });
  doc.closeDoc();
  doc = \appopenDoc({cPath: manualfilename, oDoc:this, bHidden: true});
  f=doc.getField("ManualTitle");
  f.value=titleOfManual;
  doc.flattenPages();
  \docSaveAs\newDO({ cPath: manualfilename });
  doc.closeDoc();
} else {
    console.println("Using the current "+manualfilename+" file.");
}
var _path=this.path;
var pos=_path.lastIndexOf("/");
_path=_path.substring(0,pos)+"/"+manualfilename;
\addWatermarkFromFile({
    bOnTop:false,
    bOnPrint:false,
    cDIPath:_path
});
\executeSave();
\end{docassembly}

\begin{document}

\maketitle

\selectColors{linkColor=black}
\tableofcontents
\selectColors{linkColor=webgreen}

%\section{Acknowledgements}
%
%The author would like to acknowledge Thorsten G. (a.k.a., Thor) who proposed
%this workflow and who contributed many ideas, the proposed workflow I found
%to be interesting and worth my time developing the idea; and to J\"{u}rgen G.
%(a.k.a., Loki) who also contributed many good ideas, enthusiasm, questions,
%bug detection, and motivation. High regards and respect to both.
%\begin{flushright}
%D. P. Story (a.k.a., Odon)
%\end{flushright}
%
%\begin{center}
%  \fbox{%
%    \parbox{.67\linewidth}{\textbf{\textcolor{red}{Warning!}} The workflow of the \textsf{thorshammer}
%    package requires the instructor to use \textbf{\textsf{Adobe Acrobat
%    XI}}, or later to build the quizzes for distribution. Only \app{Adobe
%    Reader} is required for the students. Of course, this is the
%    full-featured \app{Adobe Reader} of a desktop or laptop, not the
%    \app{Adobe Reader} found on tablets, smartphones, and such.
%  }}
%\end{center}

\section{Introduction}

This package addresses the issue of a poor-man's database
(\pkg{pmdb}).\footnote{The basic concept for this package was suggested to my
by Thorsten G.} Educators who use {\LaTeX} to construct exams and homework
sometimes have a collection of problems. Each problem is in its own TEX file.
When the educator creates a new exam or homework document, a ``common''
workflow is to \cs{input} several of these prepared questions. This package
attempts to provide a visual ``user interface'' to the questions and to
provide a mechanism for viewing and selecting questions that are to be
included in the document.

\paragraph*{How does this package operate?} For a document that inputs content
using the {\LaTeX} command \cs{input}, the same content can be input using
the command \cs{pmInput}\FmtMP{\cs{pmInput\darg{\ameta{path}}}}, a command
defined in this package. When content is input by \cs{pmInput}, a checkbox is
created in the margin at the insertion point of the content. The checkboxes
so created can be checked (to select the associated content) or cleared (to
de-select the content). When the user clicks on a push button provided by
this package, a list of all \emph{selected} \cs{input} statements is
displayed in the JavaScript console. This list can then be copied and pasted
into another document the author is developing. If you
\uif{Ctrl+Click}\FmtMP{\uif{Ctrl+Click}} on a checkbox, the associated
content is opened in the default browser. For this workflow, the document
author can see a typeset of the content and decide whether the content should
be included in the developing document, and can optionally view the source
file to edit it by clicking on the button or link to the right of the checkbox.

\section{Requirements and options}

\paragraph*{Folder JavaScript.} The `\uif{Ctrl+Click}' action feature
requires the installation of the folder JavaScript file
\texttt{\fnJS}\FmtMP{\texttt{\fnJS}},\footnote{If you don't see a need for
this feature, the installation of \texttt{\fnJS} is not essential.} found in
the \texttt{folder-js} folder of this distribution. This file comes with the
distribution of the \pkg{pmdb} package. If you already have the
\pkg{aeb\_pro} package, you've already installed the file
\texttt{aeb\_pro.js}, which includes the special JavaScript functions use by
\pkg{pmbd}; however, version 1.7\FmtMP{Version 1.7 required} or later of
\texttt{aeb\_pro.js} is required. Download the latest version of
\pkg{aeb\_pro} if Version 1.7 is not on your system already. The installation
procedure of folder JavaScript files is described in the file
\texttt{docs/install\_jsfiles.pdf}. The folder JS file \texttt{\fnJS} (or
\texttt{aeb\_pro.js}) enables the `\uif{Ctrl+Click}' to be operational for
both \app{Adobe Acrobat} (\app{AA}) and \app{Adobe Acrobat Reader}
(\app{AR})\FmtMP{\app{AA} and \app{AR}}. However, when the command
\cs{editSourceOn}\FmtMP{\cs{editSourceOn}} is expanded, a pushbutton appears
to the right of the checkbox; click on this pushbutton opens the content in
the default editor. The use of the button generated by \cs{editSourceOn} requires
neither \texttt{aeb-reader.js} nor \texttt{aeb\_pro.js}.


\paragraph*{Options.} There are four options: \opt{dbmode} and \opt{!dbmode}\FmtMP{\opt{dbmode}\\\relax\opt{!dbmode}},
and \opt{tight} and
\opt{!tight}\FmtMP{\opt{tight}\\\relax\opt{!tight}}.\footnote{These options
set Boolean switches, \cs{ifpmdbmode} and \cs{ifpmdbtight}, the state of
these switches can be changed within the body of the document.} The default
options are \opt{dbmode} and \opt{!tight}. When \opt{dbmode} is in effect,
checkboxes appear in the margins at each \cs{pmInput} point; for the option
\opt{!dbmode}, the checkboxes are not produced. The use of an exclamation
point (!) makes it convenient to turn on or off the creation of the marginal
checkboxes. The default location of the checkboxes are flush left. The
\opt{tight} option places the checkboxes ``tight'' up against the text area.
Refer to the \textbf{\nameref{para:CB}} paragraph for more information.

\paragraph*{Requirements.} The \pkg{eforms} package is required for the creation of
checkboxes and push\-buttons.

\section{The DB stage}

When you have a collection of questions (or content) in various files, this
package enables you to build a document that displays these questions (or
content) in a single `DB' document. Once your DB document is build, you can
use the checkboxes in the margin to select content you want to include in
another document; you can use the \uif{Ctrl+Click} feature to view the source
file of that content as well.

\newtopic\noindent
The following comments are apropos to the creation of a DB document:
\begin{itemize}
\item\textbf{PDF creators:} Any PDF creator current in the {\LaTeX} world
is valid for use with this package.

\item\textbf{PDF viewers:} The ideal viewer is \app{AA}; however, \app{AR}
    and \app{PDF-XChange Editor} can also be used. In the case of
    \app{Adobe Reader}, there is an annoying security dialog box that
    appears each time you use the \uif{Ctrl+Click} feature of the
    checkbox;\footnote{This assumes the file \texttt{\fnJS} is properly
    installed.} the \uif{Ctrl+Click} feature \emph{does not work} with
    \app{PDF-XChange Editor}.

For \uif{AR}\FmtMP{To remove the security warning}, the annoying security
dialog mentioned above is emitted when \app{AR} is in \uif{Protected View}.
To avoid the security dialog, exit \uif{Protected View} as follows:
(1)~open \uif{Preferences} (\uif{Ctrl+K}) of \app{AR}; (2) select
\uif{Security (Enhanced)} from the left panel; and (3) clear the
\uif{Enable Protected Mode at startup} checkbox. For \uif{AA},
\uif{Protected View} set to \uif{Off} by default.
\end{itemize}

\paragraph*{Outline of a DB file.} A DB file is just a {\LaTeX} document that
uses the \pkg{pmdb} package. The document itself uses \cs{pmInput} to input
its content.
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small,commandchars=!()]
\documentclass{article}
\usepackage[forcolorpaper]{web} %!textsf( optional)
% !sffamily( Additional packages that may be required by any content)
% !sffamily( that is input with !texttt(\pmInput). For example, ...)
\usepackage{exerquiz} %!textsf( if needed)
\usepackage[dbmode]{pmdb}
...
\editSourceOn %(!sffamily!space or, )\editSourceOff
%\useEditLnk  %(!sffamily!space !cs(useEditBtn), the default)
...
\begin{document}

% !textsf(Declares input for quiz items)
%\InputQuizItems
% !textsf(Declares input paragraph content)
%\InputParas
% !textsf(Declares input items)
%\InputItems

\pmInput{!ameta(path!SUB1)}

\pmInput{!ameta(path!SUB2)}

...

\pmInput{!ameta(path!SUB(n))}

\displayChoices\quad\clrChoices
\end{document}
\end{Verbatim}
Descriptions of the various commands \cs{pmInput}, \cs{InputQuizItems},
\cs{InputParas}, \cs{InputItems}, \cs{InputProbs}, \cs{editSourceOn}, \cs{displayChocies}, and \cs{clrChoices}
appear later in this documentation.\medskip

\begingroup

\InputParas

\pmCBPresets{\Ff\FfReadOnly}
\editSourceBtn[\TU{View in default editor}\Ff\FfReadOnly\S{S}]{11bp}{11bp}

\pmInput{sample-para.tex}

\endgroup

\paragraph*{Functionality of the boxes in the margin.}
By default, only one box appears in the margins, a checkbox. If the command
\cs{editSourceOn} is in effect, a small pushbutton appears to the left of the
checkbox.
\begin{description}
    \item[checkbox:] Selecting the checkbox (a check mark) appears
        declares that you want that problem (or item) in the document you
        are creating. \uif{Ctrl+Click} opens the source file for viewing
        (not editing) in the default browser. A \uif{Shift+Click} action
        jumps---if \cs{InputQuizItems} is in effect---to the solution
        of the selected item, if a solution is provided. The
        \uif{Ctrl+Click} functionality requires the successful installation
        of the \texttt{aeb-reader.js} or \texttt{aeb\_pro.js} JavaScript
        file.
    \item[pushbutton:] If \cs{editSourceOn} has been expanded prior, a
        little pushbutton appears to the right of the checkbox. Clicking
        the pushbutton opens the default viewer (for a TEX file) and the
        source file is loaded into the viewer for possible editing.
    \item[link annotation:] If \cs{editSourceOn} and \cs{useEditLnk} are
        expanded, a link annotation having the same functionality as the
        pushbutton appears in the margins, in place of the pushbutton.
\end{description}
The checkbox/pushbutton pair above have been disabled for this documentation.
Experience the functionality with the example files, listed below.

\paragraph*{Sample files.}
The four sample files are found in the \texttt{examples} folder:
\begin{itemize}
\item \texttt{tst-qzdb.tex}: The example that motivated the creation of this
    package. Input various quiz questions into an \env{quiz} environment of
    \pkg{exerquiz}.
\item\texttt{tst-paras.tex}: For the \pkg{book} class, we input chapters of
    the book using the command \cs{pmInput}.
\item\texttt{tst-qzdb-paras.tex}: A combination of the two example files
    above, were we declare \cs{InputQuizItems} to input content of a quiz,
    and \cs{InputParas} to input chapters.
\item\texttt{tst-items}: An example that demonstrates the \cs{InputItems}
    input mode.
\item\texttt{tst-eqedb.tex}: An example that demonstrates the \cs{InputProbs}
    input mode.
\end{itemize}



\section{The production stage}

After your DB document has been assembled (using \pkg{pmdb}), you are ready
to use your DB document to select questions (for quizzes) or other content
for insertion into a new document.

Open your DB document in \app{AA} or \app{AR}, and open the source file of
your developing document in your {\LaTeX} editor. Within the DB document, select
questions or content by checking any of the checkboxes in the margin. Now press
the \cs{displayChoices} push button. The \uif{AA} (\app{AR}) console window opens
and displays your choices; for example,
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\input{probs/prob1.tex}
\input{probs/prob4.tex}
\input{probs/prob5.tex}
\end{Verbatim}
These can be copied and pasted into your document. Use the \uif{Ctrl+Click}
feature to view the sources of your choices. It may be you want to modify the
source for your document; (1) edit the DB source snippet you are inputting;
or (2) copy and paste the whole content into your document and make the
needed changes there. Once all content has been referenced by your developing
document, you can compile into a PDF. Done!

\section{Package commands}

The package defines several commands and these are discussed now.
\bVerb\small\takeMeasure{\string\pmInput*[\ameta{arg}]\darg{\ameta{path}}}%
\begin{dCmd}[fontsize=\small,commandchars=!()]{\bxSize}
\pmInput*[!ameta(arg)]{!ameta(path)}
\end{dCmd}
\eVerb Within a DB source document, content is inserted using \cs{pmInput}. This
command both inputs the referenced \ameta{path} (using the {\LaTeX} command
\cs{input}) and places a checkbox in the margin. The \ameta{path} can be a
relative or full path reference. If the \ameta{path}\FmtMP{spaces in \ameta{path} discussed} contains any spaces, the
path needs to be enclosed in \emph{double quotes} (\texttt"); for example,
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\pmInput{"C:/Users/Public/Documents/My TeX Files/tex/%
  latex/aeb/pmdb/examples/chapters/doc2.tex"}
\end{Verbatim}
The optional argument \ameta{arg} is only obeyed when \cs{InputItems} is active and \cs{pmInput} is expanded
within a list environment; \ameta{arg} is passed to the underlying \cs{item} in the list (\cs{item[\ameta{arg}]}). When
the \texttt* option is taken, the rest of the arguments are gobbled and the command does nothing; this is a convenient
way of \emph{not inputting} a \ameta{path}.

\paragraph*{Important requirement:} Unlike the normal \cs{input} command\FmtMP{extension required}, we require the file name to include
the extension, `\texttt{.tex}' in the above example.

\paragraph{Input modes.} There are four `input modes':%\vskip-6pt\par
\bVerb\small\takeMeasure{\string\InputQuizItems}%
\setlength{\eflength}{\widthof{\sffamily(\cs{thQuizName})}}%
\edef\x{\the\eflength}%
\setlength{\eflength}{\bxSize}%
%\def\1{\rlap{\hskip\eflength\rlap{\hskip\x\relax\qquad\cs{def}\cs{thqzname\darg{\ameta{text}}}}\sffamily(\cs{theQuizName})}}
\def\1{\rlap{\hskip\eflength\sffamily(the default)}}
\begin{dCmd}[fontsize=\small,commandchars=!()]{\bxSize}
!1\InputParas
\InputQuizItems
\InputItems
\InputProbs
\end{dCmd}
\eVerb A brief description of each follows.
\begin{description}
  \item [\cs{InputParas}:] Sets the input mode to input `paragraph
      content'. This input mode is suitable for exercises created by the
      \env{exercise} environment of \pkg{exerquiz}, whole paragraphs, or
      whole chapters.
  \item [\cs{InputQuizItems}:] Sets the input mode to input items in a quiz
      (as created by the \env{quiz} environment).
  \item [\cs{InputItems}:] Sets the input mode to input items in a list
      environment.
  \item [\cs{InputProbs}:] Set the input mode to input problems for an exam
  created by the \pkg{eqexam} package.
\end{description}
In all cases, the {\LaTeX} command \cs{marginpar}\FmtMP{\cs{marginpar} used} is used; as a result, the
checkbox appears in the margins when the \cs{marginpar} command is supported; in
particular, \cs{marginpar} does not work in a \env{tabular} environment or a
\env{multicols} environment, for example.

\newtopic\noindent
Below is an example of \cs{InputItems}.\footnote{The marginal form fields have been made readonly
for this documentation.}

\begingroup
\pmCBPresets{\Ff\FfReadOnly}
\editSourceBtn[\TU{View in default editor}\Ff\FfReadOnly\S{S}]{11bp}{11bp}
\editSourceLnk[\cmd{\let\A\noexpand\A}\linktxtcolor{red}
  \A{\JS{app.alert("The link to source file has been removed for this documentation.");}}]{11bp}{11bp}{E}

%\previewOn

\begin{itemize}\pmdbtighttrue\InputItems %\normalmarginpar
\pmInput{sample-item.tex}
\item Another item, not input by \cs{pmInput}
\useEditLnk
\pmInput[*]{sample-item.tex}
\end{itemize}
The verbatim listing is,
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small,commandchars=!()]
\begin{itemize}!textbf(\pmdbtighttrue\InputItems)
\pmInput{sample-item.tex}
\item Another item, not input by \verb|\pmInput|.
!textbf(!string\useEditLnk) %!textsf( Use marginal link for illustrative purposes)
\pmInput[*]{sample-item.tex}
\end{itemize}
\end{Verbatim}
Note the use of the optional argument for the last \cs{pmInput}. Note also
that both \cs{pmdbtighttrue} and \cs{InputItems} are expanded locally. When
\cs{pmdbtighttrue}, the checkboxes appear ``tight'' against the text box
margin (flush right, in this case). You can (locally) move the checkboxes to
the right margin by expanding \cs{normalmarginpar} within the \env{itemize}
environment group.

\endgroup

\paragraph*{Marginal Checkboxes.}\label{para:CB} The document produces checkboxes in the margins, you can set
the appearance of the checkboxes using the \cs{pmCBPresets} command.
\bVerb\small\takeMeasure{\string\pmCBPresets\darg{\ameta{opts}}}%
\begin{dCmd}[fontsize=\small,commandchars=!()]{\bxSize}
\pmCBPresets{!ameta(opts)}
\end{dCmd}
\eVerb Pass \pkg{eforms} key-value pairs to the checkboxes through the
argument \ameta{opts}; for example, this document was compiled with
\verb~\pmCBPresets{\textColor{red}}~ declared in the preamble, as a result,
the checks are colored red.

The checkboxes are placed in the margins and hopefully correctly aligned at
the insertion point. For \texttt{article} class-type documents, use of
\cs{reversemarginpar} is recommended. In this case, the checkboxes appear in
the left margin at the extreme left (as seen above). For \texttt{book}
class-type document, the checkboxes alternate between the left and right
margins. The option \opt{tight} can be used to move the checkboxes to the
inner margins of the text block.

\paragraph*{Marginal pushbuttons.} When \cs{editSourceOn} is in effect, a pushbutton
appears to the right of the marginal checkbox. The action of this pushbutton is to open
the source file in the default editor. Modify the appearance using the \cs{editSourceBtn} command:
\bVerb\small\takeMeasure{\string\editSourceBtn[\ameta{opts}]\darg{\ameta{wd}}\darg{\ameta{ht}}}%
\setlength{\eflength}{\bxSize}%
\def\1{\rlap{\hskip\linewidth\textsf{(required for the button to appear)}}}%
\def\2{\rlap{\hskip\linewidth\textsf{(the default)}}}%
\begin{dCmd}[fontsize=\small,commandchars=!()]{\bxSize}
!1\editSourceOn
!2\useEditBtn
\editSourceBtn[!ameta(opts)]{!ameta(wd)}{!ameta(ht)}
\end{dCmd}
\eVerb The first line \cs{editSourceOn} is required for the button to appear;
usually this command is expanded in the preamble, but it can be expanded in
the body of the document to turn on or off (\cs{editSourceOff}). The second
line specifies that pushbutton form field should be used (the default). The
third line is the general syntax; here, \ameta{opts} are key-values that are
passed to the underlying \cs{pushButton} command of \pkg{eforms}.
\bVerb\small\takeMeasure{\string\editSourceBtn[\string\TU\darg{View in default editor}\string\S\darg{S}]\darg{11bp}\darg{11bp}}%
\setlength{\eflength}{\bxSize}%
\def\2{\rlap{\hskip\linewidth\textsf{(the default)}}}%
\begin{pCmd*}[fontsize=\small,commandchars=!()]{\bxSize}
!2\editSourceBtn[\TU{View in default editor}\S{S}]{11bp}{11bp}
\end{pCmd*}
The above is the default definition for the marginal link.


\paragraph*{Marginal links.} As an alternative to using marginal pushbuttons, \pkg{pmdb} also
provides link annotations. When \cs{editSourceOn} is expanded\FmtMP{\cs{useEditLnk} and \cs{useEditBtn} discussed}, marginal
buttons appear in the margin, by default. To obtain link annotations also
expand the macro \cs{useEditLnk} (\cs{useEditBtn} is the default). Use
\cs{editSourceLnk} to customized the link:
\bVerb\small\takeMeasure{\string\editSourceLnk[\ameta{opts}]\darg{\ameta{wd}}\darg{\ameta{ht}}\darg{\ameta{txt}}}%
\setlength{\eflength}{\bxSize}\def\2{\rlap{\hskip\linewidth\textsf{(the default)}}}%
\def\1{\rlap{\hskip\linewidth\textsf{(required for the link to appear)}}}%
\begin{dCmd}[fontsize=\small,commandchars=!()]{\bxSize}
!1\editSourceOn
\editSourceLnk
\editSourceLnk[!ameta(opts)]{!ameta(wd)}{!ameta(ht)}{!ameta(txt)}
\end{dCmd}
\eVerb where \ameta{opts} are key-values that are passed to the underlying
link command \cs{setLink} of \pkg{eforms}. The dimensions provided should be
the same as those used by the marginal checkboxes so they are properly
aligned.

\bVerb\small\takeMeasure{\string\editSourceLnk[\string\linktxtcolor\darg{red}\string\H\darg{N}]\darg{11bp}\darg{11bp}\darg{E}}%
\setlength{\eflength}{\bxSize}%
\def\2{\rlap{\hskip\linewidth\textsf{(the default)}}}%
\begin{pCmd*}[fontsize=\small,commandchars=!()]{\bxSize}
!2\editSourceLnk[\linktxtcolor{red}\H{N}]{11bp}{11bp}{E}
\end{pCmd*}
The above is the default definition for the marginal button.


\paragraph*{Pushbuttons.} The package defines two push buttons that should be utilized
in your DB document. They can be placed at the end of the document, or in a
running footer.

\bVerb\small\takeMeasure{\string\displayChoices[\ameta{opts}]\darg{\ameta{wd}}\darg{\ameta{ht}}}%
\begin{dCmd}[fontsize=\small,commandchars=!()]{\bxSize}
\displayChoices[!ameta(opts)]{!ameta(wd)}{!ameta(ht)}
\clrChoices[!ameta(opts)]{!ameta(wd)}{!ameta(ht)}
\end{dCmd}
\eVerb The \cs{displayChoices} command displays the choices made in the
console window of \app{AA/\allowbreak AR}, while \cs{clrChoices} clears all
the marginal checkboxes. For example,
\begin{quote}
\begin{tabular}{@{}ll}
\displayChoices{}{11bp}&\clrChoices{}{11bp}\\[3bp]
\footnotesize\cs{displayChoices\darg{}\darg{11bp}}&
\footnotesize\cs{clrChoices\darg{}\darg{11bp}}
\end{tabular}
\end{quote}
The \ameta{opts} argument is to modify the appearance of the buttons. There are several supporting,
convenience commands associate with \cs{displayChoices} and \cs{clrChoices}:
\bVerb\small\takeMeasure{\string\displayChoiceCA\darg{\ameta{string}}}%
%\setlength{\eflength}{\widthof{\sffamily(\cs{thQuizName})}}%
%\edef\x{\the\eflength}%
\setlength{\eflength}{\bxSize}%
\def\1{\rlap{\hskip\eflength\sffamily(Display Choices)}}
\def\2{\rlap{\hskip\eflength\sffamily(Display all choices in the console window)}}
\def\3{\rlap{\hskip\eflength\sffamily(Clear Choices)}}
\def\4{\rlap{\hskip\eflength\sffamily(Clear all checkboxes created by pmdb)}}
%{Display Choices}
%{Lists all choices in the console window}
%{Clear Choices}
%{Clears all checkboxes created by pmdb}
\begin{dCmd}[fontsize=\small,commandchars=!()]{\bxSize}
!1\displayChoiceCA{!ameta(string)}
!2\displayChoiceTU{!ameta(string)}
!3\clrChoicesCA{!ameta(string)}
!4\clrChoicesTU{!ameta(string)}
\end{dCmd}
\eVerb The `CA' commands place captions on the buttons; the `TU' commands
defines tool tips for the buttons. The strings shown in parentheses to the
right are the default declarations for each of the commands.

\section{Comments on portability}

The functionality of the document (with the exception of the \uif{Ctrl+Click}
feature) is platform independent; however, to be of any value, the DB files
must accompany the DB document. As long as all references to DB files are
\emph{relative paths} the DB document can be ported elsewhere along with the
supporting DB files. Just ZIP the whole folder containing the DB document and
all DB files. They can now be moved to another computer system, unzipped, and
total functionality attained. For the \uif{Ctrl+Click} feature to work, the
\texttt{\fnJS} file must also be installed. However, recall that the use of
the marginal edit button or link annotation does not require installation of
a JavaScript file.

\section{Final comments}

The method of producing the checkboxes in the margins work for many of the
situations that arise in producing a {\LaTeX} document; the four
`input modes' \cs{InputParas}, \cs{InputQuizItems}, \cs{InputProbs}, and
\cs{InputItems}, however, may fail in some situations. By studying the DTX file perhaps
you can create more input modes that solve your problem.

\newtopic\noindent
It has been lovely, but now I must return to my retirement. \dps

\end{document}

\bVerb\small\takeMeasure{\string\distrQuizzes\darg{\darg{*\ameta{path\SUB1}}\darg{*\ameta{path\SUB2}}...\darg{*\ameta{path\SUB{num}}}}}%
\begin{dCmd}[fontsize=\small,commandchars=!()]{\bxSize}
\useNameToCustomize
\enumQuizzes{!ameta(num)}
\instrPath{!ameta(path)}
\classPath{!ameta(path)}
\distrQuizzes{{*!ameta(path!SUB1)}{*!ameta(path!SUB2)}...{*!ameta(path!SUB(num))}}
\end{dCmd}
\eVerb