From ee61edfd06a1aa466f473bc5b5ee0f44760e0bb6 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 28 Dec 2019 16:13:03 +0900 Subject: new pmdb --- texmf-dist/doc/latex/pmdb/README.md | 33 ++ .../doc/latex/pmdb/examples/chapters/doc1.tex | 5 + .../doc/latex/pmdb/examples/chapters/doc2.tex | 7 + texmf-dist/doc/latex/pmdb/examples/exrs/ex1.tex | 9 + .../doc/latex/pmdb/examples/items/sample-item.tex | 1 + texmf-dist/doc/latex/pmdb/examples/probs/prob1.tex | 5 + texmf-dist/doc/latex/pmdb/examples/probs/prob2.tex | 4 + texmf-dist/doc/latex/pmdb/examples/probs/prob3.tex | 4 + texmf-dist/doc/latex/pmdb/examples/probs/prob4.tex | 3 + texmf-dist/doc/latex/pmdb/examples/probs/prob5.tex | 11 + texmf-dist/doc/latex/pmdb/examples/probs/prob6.tex | 68 +++ texmf-dist/doc/latex/pmdb/examples/tst-items.tex | 37 ++ texmf-dist/doc/latex/pmdb/examples/tst-paras.tex | 40 ++ .../doc/latex/pmdb/examples/tst-qzdb-paras.tex | 92 ++++ texmf-dist/doc/latex/pmdb/examples/tst-qzdb.tex | 83 ++++ texmf-dist/doc/latex/pmdb/folder-js/aeb-reader.js | 50 ++ texmf-dist/doc/latex/pmdb/install_jsfiles.pdf | Bin 0 -> 220856 bytes texmf-dist/doc/latex/pmdb/pmdb-man.pdf | Bin 0 -> 243694 bytes texmf-dist/doc/latex/pmdb/pmdb-man.tex | 508 +++++++++++++++++++++ texmf-dist/doc/latex/pmdb/pmdb.pdf | Bin 0 -> 262160 bytes texmf-dist/doc/latex/pmdb/sample-item.tex | 4 + texmf-dist/doc/latex/pmdb/sample-para.tex | 7 + 22 files changed, 971 insertions(+) create mode 100644 texmf-dist/doc/latex/pmdb/README.md create mode 100644 texmf-dist/doc/latex/pmdb/examples/chapters/doc1.tex create mode 100644 texmf-dist/doc/latex/pmdb/examples/chapters/doc2.tex create mode 100644 texmf-dist/doc/latex/pmdb/examples/exrs/ex1.tex create mode 100644 texmf-dist/doc/latex/pmdb/examples/items/sample-item.tex create mode 100644 texmf-dist/doc/latex/pmdb/examples/probs/prob1.tex create mode 100644 texmf-dist/doc/latex/pmdb/examples/probs/prob2.tex create mode 100644 texmf-dist/doc/latex/pmdb/examples/probs/prob3.tex create mode 100644 texmf-dist/doc/latex/pmdb/examples/probs/prob4.tex create mode 100644 texmf-dist/doc/latex/pmdb/examples/probs/prob5.tex create mode 100644 texmf-dist/doc/latex/pmdb/examples/probs/prob6.tex create mode 100644 texmf-dist/doc/latex/pmdb/examples/tst-items.tex create mode 100644 texmf-dist/doc/latex/pmdb/examples/tst-paras.tex create mode 100644 texmf-dist/doc/latex/pmdb/examples/tst-qzdb-paras.tex create mode 100644 texmf-dist/doc/latex/pmdb/examples/tst-qzdb.tex create mode 100644 texmf-dist/doc/latex/pmdb/folder-js/aeb-reader.js create mode 100644 texmf-dist/doc/latex/pmdb/install_jsfiles.pdf create mode 100644 texmf-dist/doc/latex/pmdb/pmdb-man.pdf create mode 100644 texmf-dist/doc/latex/pmdb/pmdb-man.tex create mode 100644 texmf-dist/doc/latex/pmdb/pmdb.pdf create mode 100644 texmf-dist/doc/latex/pmdb/sample-item.tex create mode 100644 texmf-dist/doc/latex/pmdb/sample-para.tex (limited to 'texmf-dist/doc/latex') diff --git a/texmf-dist/doc/latex/pmdb/README.md b/texmf-dist/doc/latex/pmdb/README.md new file mode 100644 index 00000000..aa2763ff --- /dev/null +++ b/texmf-dist/doc/latex/pmdb/README.md @@ -0,0 +1,33 @@ +The pmdb Package +Author: D. P. Story +Dated: 2019-12-09 + +This "poor man's database" (pmdb) package promotes a workflow +for building exams, homework, and other content. The package +supports the creation of a PDF document, which is a database of +problems (or content) to be included in a target document. The +package inserts checkboxes into the margins of the DB document; +the instructor can select which which of the problems are to be +included in the target document by checking one ore more of the +checkboxes. By clicking the special \displayChoices control, the +selected content is copied into the AR/AA console window in the +form of \input statements (\input{prob1.tex}, eg), which is then +be copied and pasted into the target document. By pressing +Ctrl+Click while hovering over a checkbox, the associated +content is loaded into the default application, possibly a LaTeX +editor. For the Ctrl+Click feature to work, the file +aeb-reader.js needs to be installed. As the filename suggests, +this file will work for Adobe Acrobat Reader (DC), as well as +for the magnificent Adobe Acrobat itself. + +Enjoy! + +Now, I must get back to my retirement. + + +D. P. Story +www.acrotex.net +dpstory@uakron.edu +dpstory@acrotex.net + + diff --git a/texmf-dist/doc/latex/pmdb/examples/chapters/doc1.tex b/texmf-dist/doc/latex/pmdb/examples/chapters/doc1.tex new file mode 100644 index 00000000..c7c94fe4 --- /dev/null +++ b/texmf-dist/doc/latex/pmdb/examples/chapters/doc1.tex @@ -0,0 +1,5 @@ +\chapter{The first chapter} + +This is `doc1'.\medskip + +\endinput diff --git a/texmf-dist/doc/latex/pmdb/examples/chapters/doc2.tex b/texmf-dist/doc/latex/pmdb/examples/chapters/doc2.tex new file mode 100644 index 00000000..927dcbef --- /dev/null +++ b/texmf-dist/doc/latex/pmdb/examples/chapters/doc2.tex @@ -0,0 +1,7 @@ +\chapter{The second chapter} + +This is `doc2' + +\bigskip\noindent dps + +\endinput diff --git a/texmf-dist/doc/latex/pmdb/examples/exrs/ex1.tex b/texmf-dist/doc/latex/pmdb/examples/exrs/ex1.tex new file mode 100644 index 00000000..47798a66 --- /dev/null +++ b/texmf-dist/doc/latex/pmdb/examples/exrs/ex1.tex @@ -0,0 +1,9 @@ +\begin{exercise} +Solve: $\displaystyle\lim_{n\to\infty} \frac{2n}{3n+1}$ +\begin{solution} +We have, +\[ + \lim_{n\to\infty} \frac{2n}{3n+1} = \frac{2}{3+\frac{1}{n}}=\fbox{$\displaystyle\frac23$} +\] +\end{solution} +\end{exercise} \ No newline at end of file diff --git a/texmf-dist/doc/latex/pmdb/examples/items/sample-item.tex b/texmf-dist/doc/latex/pmdb/examples/items/sample-item.tex new file mode 100644 index 00000000..19b72cd5 --- /dev/null +++ b/texmf-dist/doc/latex/pmdb/examples/items/sample-item.tex @@ -0,0 +1 @@ +\item This is content destined for an list environment, but input by \verb|\pmItem|. diff --git a/texmf-dist/doc/latex/pmdb/examples/probs/prob1.tex b/texmf-dist/doc/latex/pmdb/examples/probs/prob1.tex new file mode 100644 index 00000000..30efb7bb --- /dev/null +++ b/texmf-dist/doc/latex/pmdb/examples/probs/prob1.tex @@ -0,0 +1,5 @@ + \item \PTs{3} + Which of these are true ? +\begin{answers}{4} +\Ans1 True & \Ans0 False +\end{answers} \ No newline at end of file diff --git a/texmf-dist/doc/latex/pmdb/examples/probs/prob2.tex b/texmf-dist/doc/latex/pmdb/examples/probs/prob2.tex new file mode 100644 index 00000000..033fe41f --- /dev/null +++ b/texmf-dist/doc/latex/pmdb/examples/probs/prob2.tex @@ -0,0 +1,4 @@ + \item \PTs{4} Select which of the following is true. +\begin{answers}{4} +\Ans1 True &\Ans0 False &\Ans0 Maybe &\Ans0 Sometimes +\end{answers} diff --git a/texmf-dist/doc/latex/pmdb/examples/probs/prob3.tex b/texmf-dist/doc/latex/pmdb/examples/probs/prob3.tex new file mode 100644 index 00000000..1f446293 --- /dev/null +++ b/texmf-dist/doc/latex/pmdb/examples/probs/prob3.tex @@ -0,0 +1,4 @@ + \item\PTs{2} $9+8=\RespBoxMath{17}*{1}{.0001}{[0,1]}$ +\begin{solution} +Everyone knows $9+8=17$, did you? +\end{solution} diff --git a/texmf-dist/doc/latex/pmdb/examples/probs/prob4.tex b/texmf-dist/doc/latex/pmdb/examples/probs/prob4.tex new file mode 100644 index 00000000..924d5da0 --- /dev/null +++ b/texmf-dist/doc/latex/pmdb/examples/probs/prob4.tex @@ -0,0 +1,3 @@ +\essayQ{5} % num points assigned +\item\PTs{5} Write a short history of Acro\negthinspace\TeX.\par +\RespBoxEssay{\linewidth}{1in} diff --git a/texmf-dist/doc/latex/pmdb/examples/probs/prob5.tex b/texmf-dist/doc/latex/pmdb/examples/probs/prob5.tex new file mode 100644 index 00000000..3cd855f3 --- /dev/null +++ b/texmf-dist/doc/latex/pmdb/examples/probs/prob5.tex @@ -0,0 +1,11 @@ +\item\PTs{3} Which of the following are numbers? +\begin{manswers}{6} +\bChoices + \Ans[-1]{0}d\eAns + \Ans[1]{1}17\eAns + \Ans[-1]{0}p\eAns + \Ans[1]{1}88\eAns + \Ans[-1]{0}s\eAns + \Ans[1]{1}105\eAns +\eChoices +\end{manswers} \ No newline at end of file diff --git a/texmf-dist/doc/latex/pmdb/examples/probs/prob6.tex b/texmf-dist/doc/latex/pmdb/examples/probs/prob6.tex new file mode 100644 index 00000000..04af8810 --- /dev/null +++ b/texmf-dist/doc/latex/pmdb/examples/probs/prob6.tex @@ -0,0 +1,68 @@ +\multipartquestion + + \item\PTs{20} Answer each of the following multiple + selection problems. Each correct answer is worth $3$ + points, and each incorrect answer is worth $-2$ points. + \begin{questions} + + +\rowsep{3pt} + + \item\PTs{9} Select which people who served as a President + of the United States. (Select all correct choices.) + + \begin{manswers}{2}% + \bChoices + \Ans[-2]{0} Henry Clay\eAns + \Ans[-2]{0} Ben Franklin\eAns + \Ans[3]{1}\label{aj} Andrew Jackson\eAns + \Ans[3]{1}\label{rr} Ronald Reagan\eAns + \Ans[-2]{0} George Meade\eAns + \Ans[3]{1}\label{gc} Grover Cleveland\eAns + \Ans[-2]{0} John Jay\eAns + \Ans[-2]{0} Paul Revere\eAns + \eChoices + \end{manswers} + +%\ifwithdesign\promoteNewPageHere[6\baselineskip]\fi + +\rowsep{3pt} + + \item\PTs{9} Select which people who served as a Chancellor of the + German Republic. (Select all correct choices.) + \begin{manswers}{2}% + \bChoices[2] + \Ans[-2]{0} Gustav Heinemann\eAns + \Ans[-2]{0} Theodor Heu{\ss}\eAns + \Ans[3]{1} Konrad Adenauer\eAns + \Ans[-2]{0} Richard von Weizs\"{a}cker\eAns + \Ans[3]{1} Willy Brandt\eAns + \Ans[-2]{0} Heinrich L\"{u}bke\eAns + \Ans[-2]{0} Roman Herzog\eAns + \Ans[3]{1} Ludwig Erhard\eAns + \eChoices + \end{manswers} + +%\promoteNewPageHere{4\baselineskip} +\rowsep{3pt} + + \item\PTs{2} If you select all choices in part~(a), you will + receive $-1$ points as a penalty for bad guessing. \textbf{Question:} + Determine the \emph{number of correct choices} in part~(a)? + \begin{answers}*{4} + \bChoices + \Ans0 1\eAns + \Ans0 2\eAns + \Ans1 3\eAns + \Ans0 4\eAns + \Ans0 5\eAns + \Ans0 6\eAns + \Ans0 7\eAns + \Ans0 8\eAns + \eChoices + \end{answers} +\begin{solution} +Let $x$ be the number of correct answers, then $ 3x - 2(8-x) = -1 $. Solving this simple +equation we get $ x = 3 $. +\end{solution} + \end{questions} diff --git a/texmf-dist/doc/latex/pmdb/examples/tst-items.tex b/texmf-dist/doc/latex/pmdb/examples/tst-items.tex new file mode 100644 index 00000000..46b25a10 --- /dev/null +++ b/texmf-dist/doc/latex/pmdb/examples/tst-items.tex @@ -0,0 +1,37 @@ +\documentclass{article} +\usepackage[forcolorpaper]{web} +\usepackage[dbmode,!tight]{pmdb} + +\previewOn + +\reversemarginpar + +\InputItems + +\begin{document} + +\noindent +The \texttt{itemize} environment +\begin{itemize} + \item One\marginpar{One} + \item Two\marginpar{Two} + \pmInput{items/sample-item.tex} +\end{itemize} + +\medskip\noindent +The \texttt{environment} environment +\begin{enumerate} + \item One\marginpar{One} + \item Two\marginpar{Two} + \pmInput{items/sample-item.tex} +\end{enumerate} + +\medskip\noindent +The \texttt{description} environment +\begin{description} + \item[First item] One\marginpar{One} + \item[Second item] Two\marginpar{Two} + \pmInput[Third item]{items/sample-item.tex} +\end{description} + +\end{document} \ No newline at end of file diff --git a/texmf-dist/doc/latex/pmdb/examples/tst-paras.tex b/texmf-dist/doc/latex/pmdb/examples/tst-paras.tex new file mode 100644 index 00000000..550e58db --- /dev/null +++ b/texmf-dist/doc/latex/pmdb/examples/tst-paras.tex @@ -0,0 +1,40 @@ +% Requires Version 1.7 of aeb_pro.js +% Checkbox: Maintain an array of paths selected; unchecking removes that item from the path. +\documentclass{book} +\usepackage{eforms} +\usepackage[dbmode]{pmdb} + +%\usepackage{srcltx} + +%\previewOn\pmpvOn + +% The default input mode +%\InputParas + +\def\cs#1{\texttt{\eqbs#1}} + +\begin{document} + +\chapter*{Preface} + +In this package, \cs{pmInput} is defined. This package command places a checkbox +in the margins and executes an \cs{input} command. + +\medskip\noindent\textbf{Rules to live by}\begin{itemize} + \item Always include the extension: \texttt{doc1.tex} not \texttt{doc1}. + \item If the path contains spaces, enclose the path in double quotes, like so, + \texttt{"my doc1.tex"}, not \texttt{my doc1.tex}. +\end{itemize} + + +% Adjust paths as needed +\pmInput{chapters/doc1.tex} + +%\input{"my doc2.tex"} +\pmInput{"C:/Users/Public/Documents/My TeX Files/tex/latex/aeb/pmdb/examples/chapters/doc2.tex"} + +\medskip\noindent +\displayChoices{}{11bp}\cgBdry[1em]\clrChoices{}{11bp} + +\end{document} + diff --git a/texmf-dist/doc/latex/pmdb/examples/tst-qzdb-paras.tex b/texmf-dist/doc/latex/pmdb/examples/tst-qzdb-paras.tex new file mode 100644 index 00000000..eb6807eb --- /dev/null +++ b/texmf-dist/doc/latex/pmdb/examples/tst-qzdb-paras.tex @@ -0,0 +1,92 @@ +\documentclass{book} +\usepackage{amstext} +\usepackage[forcolorpaper]{web} +\usepackage{exerquiz}[2019/12/17] +\usepackage[dbmode,!tight]{pmdb} + +\reversemarginpar + +\def\cs#1{\texttt{\eqbs#1}} + +\useBeginQuizButton[\CA{Begin}] +\useEndQuizButton[\CA{End}] + +%\previewOn\pmpvOn + +\rfooter{\dirTOCItem} % \dirTOCItem from web + +% Make quiz solutions into a chapter* event +\InputQzSolnsLevel*[ch:Qz]{chapter} % exerquiz 2019/12/17 + + +\title{Poor Man's Database} +\author{D. P. Story} +\email{dpstory@acrotex.net} + +\optionalPageMatter{\begin{center} + \fbox{\begin{minipage}{.67\linewidth} + This file demonstrates how to input both quiz items and paragraph content. + Two commands are defined \cs{InputQuizItems} and \cs{InputParas} to make it + convenient to switch between the two modes of input. + \end{minipage}} +\end{center}} + +\begin{document} + +\maketitle + +\tableofcontents + +\chapter{The quizzes} + +\section{Section 1} + +Expand the \cs{InputQuizItems} here. + +\InputQuizItems + +\begin{quiz*}{myquiz1} +Solve each of these problems, passing is 100\%. +\begin{questions} + +\pmInput{probs/prob1.tex} + +\pmInput{probs/prob2.tex} + +\pmInput{probs/prob3.tex} + +\end{questions} +\end{quiz*} + +\section{Section 2} + +\begin{quiz*}{myquiz2} +Solve each of these problems, passing is 100\%. +\begin{questions} + +\pmInput{probs/prob4.tex} + +\pmInput{probs/prob6.tex} + +\pmInput{probs/prob5.tex} + +\end{questions} +\end{quiz*} %\ScoreField\currQuiz\CorrButton\currQuiz + +\medskip\noindent +\displayChoices{}{11bp} + + +\medskip\noindent +Expand the \cs{InputParas} here. +\InputParas + +\pmInput{chapters/doc1.tex} + +%\input{"my doc2.tex"} +\pmInput{"C:/Users/Public/Documents/My TeX Files/tex/latex/aeb/pmdb/examples/chapters/doc2.tex"} + +\medskip\noindent +\displayChoices{}{11bp}\cgBdry[1em]\clrChoices{}{11bp} + +\end{document} \ No newline at end of file diff --git a/texmf-dist/doc/latex/pmdb/examples/tst-qzdb.tex b/texmf-dist/doc/latex/pmdb/examples/tst-qzdb.tex new file mode 100644 index 00000000..ac1898a8 --- /dev/null +++ b/texmf-dist/doc/latex/pmdb/examples/tst-qzdb.tex @@ -0,0 +1,83 @@ +\documentclass{article} +\usepackage{amstext} +\usepackage[forcolorpaper]{web} +\usepackage{exerquiz} +\usepackage[dbmode,!tight]{pmdb} + +\reversemarginpar + +\pmCBPresets{\textColor{red}} + +%\previewOn\pmpvOn + +\title{Poor man's DB demo} +\author{D. P. Story} +\email{dpstory@acrotex.net} +\version{1.0} +\norevisionLabel + + +\PTsHook{($\eqPTs^{\text{pts}}$)} + +\def\cs#1{\texttt{\eqbs#1}} +\rfooter{\dirTOCItem} +\lfooter{\displayChoices{}{11bp}\cgBdry[1em]\clrChoices{}{11bp}} +\useBeginQuizButton[\CA{Begin}] +\useEndQuizButton[\CA{End}] + +\useMCCircles + +% Declares input for quiz items +\InputQuizItems + + +\begin{document} + +\maketitle +\tableofcontents + +\section{Section 1} + +Expand the \cs{InputQuizItems} here. + +\begin{quiz*}{myquiz1} +Solve each of these problems, passing is 100\%. +\begin{questions} + +\pmInput{probs/prob1.tex} + +\pmInput{probs/prob2.tex} + +\pmInput{probs/prob3.tex} + +\end{questions} +\end{quiz*} + +\section{Section 2} + +%\InputQuizItems + + +\begin{quiz*}{myquiz2} +Solve each of these problems, passing is 100\%. +\begin{questions} + +\pmInput{probs/prob4.tex} + +\pmInput{probs/prob6.tex} + +\pmInput{probs/prob5.tex} + +\end{questions} +\end{quiz*} %\ScoreField\currQuiz\CorrButton\currQuiz + +\section{Section 3} + +Here, we input an \textsf{exercise} environment, we do so in `paragraph mode' by expanding +\cs{InputParas} first. + +\InputParas + +\pmInput{exrs/ex1.tex} + +\end{document} \ No newline at end of file diff --git a/texmf-dist/doc/latex/pmdb/folder-js/aeb-reader.js b/texmf-dist/doc/latex/pmdb/folder-js/aeb-reader.js new file mode 100644 index 00000000..87783f86 --- /dev/null +++ b/texmf-dist/doc/latex/pmdb/folder-js/aeb-reader.js @@ -0,0 +1,50 @@ +/* + AEB Adobe Acrobat Reader JavaScript Methods + + Copyright (C) 2019 AcroTeX.Net + D. P. Story + http://www.acrotex.net + + Version 1.0 +*/ +// console.println("Version 1.0 (Reader DC)"); +if ( typeof aebTrustedFunctions == "undefined") { + aebTrustedFunctions = app.trustedFunction( function ( doc, oFunction, oArgs ) + { + app.beginPriv(); + var retn = oFunction( oArgs, doc ); + app.endPriv(); + return retn; + }); +} +aebSaveAs = app.trustPropagatorFunction( function ( oArgs, doc ) +{ + app.beginPriv(); + app.execMenuItem("Save"); + app.endPriv(); +}); +aebDocSaveAs = app.trustPropagatorFunction( function ( oArgs, doc ) +{ + var Msg=function(e){return (aebDocSaveAs.msg==undefined)?("Doc SaveAs Error: " + e.toString()):aebDocSaveAs.msg;} + var Action=function(){return ((aebDocSaveAs.action==undefined)?null:eval(aebDocSaveAs.action));} + app.beginPriv(); + try { + return retn = doc.saveAs(oArgs); + } catch(e){console.println(Msg(e));Action();} + app.endPriv(); + aebDocSaveAs.msg=undefined; + aebDocSaveAs.action=undefined; +}); +aebBrowseForDoc = app.trustPropagatorFunction( function ( oArgs ) +{ + app.beginPriv(); + return retn = app.browseForDoc(oArgs); + app.endPriv(); +}); +aebLaunchURL=app.trustPropagatorFunction ( function ( oArgs ) +{ + app.beginPriv(); + var retn = app.launchURL(oArgs); + app.endPriv(); +}); + diff --git a/texmf-dist/doc/latex/pmdb/install_jsfiles.pdf b/texmf-dist/doc/latex/pmdb/install_jsfiles.pdf new file mode 100644 index 00000000..d55c3e30 Binary files /dev/null and b/texmf-dist/doc/latex/pmdb/install_jsfiles.pdf differ diff --git a/texmf-dist/doc/latex/pmdb/pmdb-man.pdf b/texmf-dist/doc/latex/pmdb/pmdb-man.pdf new file mode 100644 index 00000000..2405eb3c Binary files /dev/null and b/texmf-dist/doc/latex/pmdb/pmdb-man.pdf differ diff --git a/texmf-dist/doc/latex/pmdb/pmdb-man.tex b/texmf-dist/doc/latex/pmdb/pmdb-man.tex new file mode 100644 index 00000000..d9e387e5 --- /dev/null +++ b/texmf-dist/doc/latex/pmdb/pmdb-man.tex @@ -0,0 +1,508 @@ +\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 + +\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={0.4, 2019/12/09}, + 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 TEX editor. 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. + +\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}}. + +\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 +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 check + box;\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} % optional +% !sffamily Additional packages that may be required by any content +% !sffamily that is !texttt(\pmInput). For example, ... +\usepackage{exerquiz} % if needed +\usepackage[dbmode]{pmdb} +... +\begin{document} + +% Declares input for quiz items +%\InputQuizItems +% Declares input paragraph content +%\InputParas +% 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{displayChocies}, and \cs{clrChoices} +appear later in this documentation.\medskip + +\pmInput{sample-para.tex} + +\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. +\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. + +\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 three `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 +\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. +\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} + + +\begin{itemize}\pmdbtighttrue\InputItems %\normalmarginpar +\pmInput{sample-item.tex} +\item Another item, not input by \cs{pmInput} +\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|. +\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. + + +\paragraph*{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*{Push buttons.} 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 \cs{displayChoices} displays the choices made in the console window of \app{AA/AR}, while +\cs{clrChoices} clears all the marginal checkboxes. For example, +\begin{quote} +\begin{tabular}{@{}ll} +\displayChoices{}{11bp}&\clrChoices{}{11bp}\\ +\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(Lists all choices in the console window)}} +\def\3{\rlap{\hskip\eflength\sffamily(Clear Choices)}} +\def\4{\rlap{\hskip\eflength\sffamily(Clears 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. + +\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; however, the three +`input modes' \cs{InputParas}, \cs{InputQuizItems}, and \cs{InputItems} may +fail in some situations. By studying the DTX file perhaps you can create more +input modes that solve your problem. + +\newtopic\noindent +It was 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 diff --git a/texmf-dist/doc/latex/pmdb/pmdb.pdf b/texmf-dist/doc/latex/pmdb/pmdb.pdf new file mode 100644 index 00000000..9c3394b4 Binary files /dev/null and b/texmf-dist/doc/latex/pmdb/pmdb.pdf differ diff --git a/texmf-dist/doc/latex/pmdb/sample-item.tex b/texmf-dist/doc/latex/pmdb/sample-item.tex new file mode 100644 index 00000000..21d93a9e --- /dev/null +++ b/texmf-dist/doc/latex/pmdb/sample-item.tex @@ -0,0 +1,4 @@ +\item +This is content destined for an list environment and was input by \verb|\pmInput|. + +\endinput diff --git a/texmf-dist/doc/latex/pmdb/sample-para.tex b/texmf-dist/doc/latex/pmdb/sample-para.tex new file mode 100644 index 00000000..c70612cc --- /dev/null +++ b/texmf-dist/doc/latex/pmdb/sample-para.tex @@ -0,0 +1,7 @@ +These methods are not restricted to inputting quiz items or whole +chapters. This paragraph was input into the main document with +\cs{pmInput\darg{sample-para.tex}}. Note the check box in the left margin. If +you have \texttt{aeb-reader.js} or \texttt{aeb\_pro.js} properly installed, you can \uif{Ctrl+Click} to +see this paragraph at the source. + +\endinput -- cgit v1.2.3