From ee61edfd06a1aa466f473bc5b5ee0f44760e0bb6 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 28 Dec 2019 16:13:03 +0900 Subject: new pmdb --- ctan2tds-config.pl | 1 + 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 + texmf-dist/source/latex/pmdb/pmdb.dtx | 476 +++++++++++++++++++ texmf-dist/source/latex/pmdb/pmdb.ins | 60 +++ texmf-dist/tex/latex/pmdb/pmdb.sty | 224 +++++++++ tlpkg/tlpsrc/pmdb.tlpsrc | 0 27 files changed, 1732 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 create mode 100644 texmf-dist/source/latex/pmdb/pmdb.dtx create mode 100644 texmf-dist/source/latex/pmdb/pmdb.ins create mode 100644 texmf-dist/tex/latex/pmdb/pmdb.sty create mode 100644 tlpkg/tlpsrc/pmdb.tlpsrc diff --git a/ctan2tds-config.pl b/ctan2tds-config.pl index 23b76103..c99135bc 100644 --- a/ctan2tds-config.pl +++ b/ctan2tds-config.pl @@ -30,6 +30,7 @@ $special{'graphicxsp'} = '&MAKEdps'; $special{'icon-appr'} = '&MAKEdps'; $special{'eqexam'} = '&MAKEdps'; $special{'bargraph-js'} = '&MAKEdps'; +$special{'pmdb'} = '&MAKEdps'; sub MAKEdps { 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 diff --git a/texmf-dist/source/latex/pmdb/pmdb.dtx b/texmf-dist/source/latex/pmdb/pmdb.dtx new file mode 100644 index 00000000..6a0d2099 --- /dev/null +++ b/texmf-dist/source/latex/pmdb/pmdb.dtx @@ -0,0 +1,476 @@ +%\iffalse +% makeindex -s gglo.ist -o pmdb.gls pmdb.glo +% makeindex -s gind.ist -o pmdb.ind pmdb.idx +%<*copyright> +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% pmdb.sty package,, %% +%% Copyright (C) 2019 D. P. Story %% +%% dpstory@uakron.edu dpstory@acrotex.net %% +%% %% +%% This program can redistributed and/or modified under %% +%% the terms of the LaTeX Project Public License %% +%% Distributed from CTAN archives in directory %% +%% macros/latex/base/lppl.txt; either version 1.2 of the %% +%% License, or (at your option) any later version. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%\NeedsTeXFormat{LaTeX2e} +%\ProvidesPackage{pmdb} +% \ProvidesPackage{pmdb}[2019/12/09 v0.4 Mark for input files] +%<*driver> +\documentclass{ltxdoc} +\usepackage[colorlinks,hyperindex=false,linktocpage,bookmarksnumbered]{hyperref} +\usepackage{calc} +%\def\texorpdfstring#1#2{#1} +%\pdfstringdefDisableCommands{\let\\\textbackslash} +\OnlyDescription % comment out for implementation details +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\gdef\brpr#1{\texttt{\char123\relax#1\char125\relax}} +\let\darg\brpr +\let\env\texttt +\let\opt\texttt +\let\app\textsf +\let\pkg\textsf +\let\uif\textsf +\let\tops\texorpdfstring +\def\EXCL{!} +\def\nmpsep#1{\hskip-\marginparsep\texttt{#1}} +\def\visispace{\symbol{32}} +\def\ameta#1{\ensuremath{\langle\textit{\texttt{#1}}\rangle}} +\def\meta#1{\textsl{\texttt{#1}}} +\def\SUB#1{\ensuremath{{}_{\mbox{\scriptsize\ttfamily#1}}}} +\def\CMD#1{\textbackslash#1} +\makeatletter +\renewcommand{\paragraph} + {\@startsection{paragraph}{4}{0pt}{6pt}{-3pt}{\bfseries}} +\renewcommand{\subparagraph} + {\@startsection{subparagraph}{5}{\parindent}{6pt}{-3pt}% + {\normalfont\normalsize\bfseries}} +\makeatother +\InputIfFileExists{aebdocfmt.def}{\PackageInfo{pmdb}{Inputting aebdocfmt.def}} + {\def\IndexOpt{\DescribeMacro}\def\IndexKey{\DescribeMacro}\let\setupFullwidth\relax + \PackageInfo{pmdb}{aebdocfmt.def cannot be found}} +\begin{document} +\addtolength{\marginparwidth}{3pt} + \GetFileInfo{pmdb.sty} + \title{The \textsf{pmdb} Package} + \author{D. P. Story\\ + Email: \texttt{dpstory@acrotex.net}} + \date{processed \today} + \maketitle +\setcounter{secnumdepth}{5} +\setcounter{tocdepth}{5} +\bgroup +\value{secnumdepth}=3 +\value{tocdepth}=3 + \tableofcontents +\egroup + \DocInput{pmdb.dtx} +\IfFileExists{\jobname.ind}{\newpage\setupFullwidth\par\PrintIndex} + {\paragraph*{Index} The index goes here. Execute + \begin{quote}\texttt{makeindex -s gind.ist -o pmdb.ind pmdb.idx}\end{quote} + on the command line and recompile + \texttt{pmdb.dtx}.} +\IfFileExists{\jobname.gls}{\PrintChanges} + {\paragraph*{Change History} The list of changes goes here. Execute + \begin{quote} + \texttt{makeindex -s gglo.ist -o pmdb.gls pmdb.glo} + \end{quote} + on the command line and recompile \texttt{pmdb.dtx}.} +\end{document} +% +% \fi +% \MakeShortVerb{|} +% \InputIfFileExists{aebdonotindex.def}{\PackageInfo{web}{Inputting aebdonotindex.def}} +% {\PackageInfo{web}{cannot find aebdonotindex.def}} +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% \section{Introduction} +% This package addresses the issue of a poor-man's database. Educators who use {\LaTeX} to construct +% exams and homework sometimes have a collection of problems. Each problem is in its own TEX file. The educator +% creates a document and \cs{inputs} several of these packaged questions. This package attempts to provide some +% ``user interface'' to the questions and provides a mechanism of selecting which questions are to be included in the +% document. +% +%\paragraph*{What does this package do?} For a document that inputs content using the {\LaTeX} command \cs{input}, +%the same content can be input using the command \cs{pmInput} (capitalized). When content is input by \cs{pmInput}, a check +%box is created in the margin at the insertion point of the content. The check boxes so created can be checked or cleared. +%When the user clicks on push button provided by this package, a list of all \emph{selected} \cs{input} statements are listed +%in the JavaScript console. This list can then be copied and pasted into another document the author is developing. If you +%\uif{Ctrl+Click} on a check box, the associated content is opened in the default TEX editor. In this way, the document author +%can see a typeset of the content and decide whether the content should be included in the developing document. +% +%\paragraph*{The DB stage:} When you have a collection of questions (or content) in various files and want to use +%this package to \cs{input} them into your document, the following comments are apropos: +% +%\subparagraph*{PDF creators:} Any PDF creator current in the {\LaTeX} world is valid for use with this package. +% +%\subparagraph*{PDF viewers:} +%The ideal viewer is \app{Acrobat}, however, \app{Adobe Reader} 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; the \uif{Ctrl+Click} feature does not WORK with \app{PDF-XChange Editor}. +% +%\paragraph*{The production stage:} After the document has been assembled (using \pkg{pmdb}), and you build your final document +%(perhaps an \pkg{exerquiz} quiz), the end user can use an appropriate PDF reader. If an \pkg{exerquiz} quiz is used, then +%a minimum of \app{Adobe Acrobat Reader} is required. +% \section{The main code} +% \begin{macrocode} +\edef\th@dquoteCat{\the\catcode`\"} +\catcode`\"=12\relax +\newif\ifpmdbmode \pmdbmodetrue +% \end{macrocode} +%\subsection{Package options and package requirements} +% +%\leavevmode\IndexOpt{dbmode} The default option is \opt{dbmode}. When in effect, check boxes +%appear in the margins at each \cs{pmInput} point. +% \begin{macrocode} +\DeclareOption{dbmode}{\pmdbmodetrue} +% \end{macrocode} +%\leavevmode\IndexOpt[\protect\EXCL]{!dbmode} A convenient way to turn off the creation of the check boxes +%is to simply place an exclamation point (!) in front of the \opt{dbmode} option. +% \begin{macrocode} +\DeclareOption{!dbmode}{\pmdbmodefalse} +% \end{macrocode} +%\leavevmode\IndexOpt{tight} When this option is taken, the checkboxes are tight against the text box +%area. +% \begin{macrocode} +\newif\ifpmdbtight \pmdbtightfalse +\DeclareOption{tight}{\pmdbtighttrue} +% \end{macrocode} +%\leavevmode\IndexOpt[\protect\EXCL]{!tight} The default for the package, the checkboxes are placed +%to extreme left (or right) in the margins. +% \begin{macrocode} +\DeclareOption{!tight}{\pmdbtightfalse} +\ProcessOptions +\RequirePackage{eforms} +% \end{macrocode} +%\subsection{Special attention to Thor} +% One motivation for this package is to support the \pkg{thorshammer} package, to that end +% we make the following assignment, if Thor is not present. +% This is to prevent stoppage: +% if your are inputting a \cs{RespBoxEssay} question that is accompanied by the +% \cs{essayQ} command, defined in \pkg{thorshammer}.\medskip +% \begin{macrocode} +\def\pmdb@ckThor{\@ifundefined{essayQ}{\let\essayQ\@gobble}{}} +\AtBeginDocument{\pmdb@ckThor} +% \end{macrocode} +%\subsection{Form field creation} +% \textbf{Some Booleans and counters} +% \begin{macrocode} +\newif\ifpmdbFP \pmdbFPfalse +\newif\ifpmdbDQs \pmdbDQsfalse +\newcount\pmdb@Cnt +% \end{macrocode} +% +%\subsubsection{Check box creation} +% +%\DescribeMacro\cbSelectInput\nmpsep{\darg{\ameta{path}}} creates a check box with a tool tip of \ameta{path} +%The mouse up action \cs{ccBoxMU} fixes up relative paths, and defines a \uif{Ctrl+Click} action. When the check box +%is so clicked, the \ameta{path} is opened in the default TEX editor. The \ameta{path} can be relative or absolute. +%This command is used within \cs{insertCkBx}; its \ameta{path} argument is passed to it from \cs{insertCkBx}. +% \begin{macrocode} +\def\pmCBPresets#1{\def\pm@CBPresets{#1}} +\pmCBPresets{} +\def\cbSelectInput#1{\checkBox[\TU{#1}\presets{\pm@CBPresets} + \cmd{\bParams{#1}{\the\pmdb@Cnt}\eParams} + \AAmouseup{\ccBoxMU} + ]{pmdbCkBx.\the\pmdb@Cnt}{11bp}{11bp}{On}% + \global\advance\pmdb@Cnt\@ne} +% \end{macrocode} +%\leavevmode\DescribeMacro\insertCkBx\nmpsep{\darg{\ameta{method}}} The argument of this macro describes the method +%of inserting the checkbox. The default definition works well for a straightforward document, where you are inputting +%ordinary {\LaTeX} code (such as sections or chapters).\smallskip +% \begin{macrocode} +\def\insertCkBx#1{\def\@insertCkBx##1{#1}} +% \end{macrocode} +% Placement of check boxes in the margin. \DescribeMacro\pmAlignCB\cs{pmAlignCB} controls the marginpar placement. +% \DescribeMacro\normalCBMargins\cs{normalCBMargins} places it according to the rules of \cs{marginpar}; +% \DescribeMacro\altCBMargins\cs{altCBMargins} alternates the margin placement, forces the check box to the +% extreme left (on odd pages) and extreme right (on even pages). +% \begin{macrocode} +\def\setCBsMarg{% + \ifpmdbtight + \if@reversemargin + \def\pmAlignCBAlt{\ifodd\value{page}\leavevmode\hfill\else\fi}\else + \def\pmAlignCBAlt{\ifodd\value{page}\else\hfill\fi}\fi + \else + \if@reversemargin + \def\pmAlignCBAlt{\ifodd\value{page}\hfil\else\hfil\fi}\else + \def\pmAlignCBAlt{\ifodd\value{page}\hfill\else\fi}\fi + \fi +} +\def\altCBMargins{\let\pmAlignCB\pmAlignCBAlt} +\def\pmAlignCB{% + \if@reversemargin + \ifpmdbtight\hfill\else\fi + \else + \ifpmdbtight\else\hfill\fi + \fi +} +\@ifundefined{chapter}{}{\AtBeginDocument{\setCBsMarg\altCBMargins}} +% \end{macrocode} +% This is the default declaration. It works well when you are inputting content +% that goes into horizontal mode. We insert the check box at the beginning of the +% first paragraph. When you are inputting files that come into a list environment, this method +% does not work satisfactory.\medskip\par\noindent +%\DescribeMacro\InputParas declares that the next \cs{pmInput} macros are for paragraph content. +%This is the default state of the package. %\par\medskip +%\paragraph*{pmInput states} +% \begin{macrocode} +\def\InputParas{%\let\pmAlignCB\relax + \insertCkBx{\ifpmdbmode + \everypar{\marginpar{\pmAlignCB\cbSelectInput{##1}}\global\everypar{}}\fi}} +\InputParas +% \end{macrocode} +%\leavevmode +%\DescribeMacro\InputQuizItems declares that the next \cs{pmInput} macros are for items in +%a \env{quiz} environment of \pkg{exerquiz} +%\changes{v0.4}{2019/12/09}{Modified to work when no points are specified} +% \begin{macrocode} +\newcount\saveQNo \saveQNo\z@ +\def\pmHook@qzItems{% + \let\item@pmOld\item + \def\item@pnNew{\item@pmOld\itemhook\let\item\item@pmOld}% + \let\item\item@pnNew} +\def\InputQuizItems{\let\pmHook\pmHook@qzItems + \saveQNo\z@ + \insertCkBx{\def\cbInQzMargin{\cbSelectInput{##1}}}% + \ItemHook{\leavevmode\ifpmdbmode + \ifnum\saveQNo<\value{eqquestionnoi}% + \marginpar{\pmAlignCB\cbInQzMargin}\fi + \saveQNo=\arabic{eqquestionnoi}\fi}} +% \end{macrocode} +%\leavevmode +%\DescribeMacro\InputItems declares that the next \cs{pmInput} macros are for items in +%an list environment 2019/12/09 v0.4 +%\changes{v0.4}{2019/12/09}{Added \string\cs{InputItems}} +% \begin{macrocode} +\def\pmHook@item{\let\item@pmOld\item + \def\item@pmNew{% + \ifx\pmiarg\@empty + \ifx\pm@Brk\ef@YES + \def\pm@next{\item@pmOld[]}\else + \let\pm@next\item@pmOld + \fi + \else + \def\pm@next{\item@pmOld[\pmiarg]}% + \fi\pm@next\itemhook\let\item\item@pmOld}% + \let\item\item@pmNew +} +\def\ItemHook#1{\def\itemhook{#1}} +\def\InputItems{\let\pmHook\pmHook@item + \insertCkBx{\def\cbInQzMargin{\cbSelectInput{##1}}}% + \ItemHook{\leavevmode\ifpmdbmode + \marginpar{\pmAlignCB\cbInQzMargin}\fi}} +% \end{macrocode} +%\paragraph*{Place check box and input \ameta{path}}\leavevmode\par\medskip +%\noindent +%\DescribeMacro\ckBxInput\nmpsep{\darg{\ameta{path}}} Places the check box and inputs the \ameta{path}. +% \begin{macrocode} +\let\pmHook\relax +\def\ckBxInput#1{\@insertCkBx{#1}% + \ifpmdbDQs\def\donext{\pmHook\input{"#1"}}\else + \def\donext{\pmHook\input{#1}}\fi + \donext} +% \end{macrocode} +%\subsubsection{Push button creation} +%This package provides two form fields that are used for the DB step.\par\medskip +%\noindent +%\DescribeMacro\displayChoices\nmpsep{[\ameta{options}]\darg{\ameta{wd}}\darg{\ameta{ht}}} inserts a push button +%whose action is to display the selections in the console window. The argument \ameta{wd} can be empty, in which +%case, the width of the field is determined from the \cs{CA} key. +% \begin{macrocode} +\def\displayChoiceCA#1{\def\displayChoice@CA{#1}} +\def\displayChoiceTU#1{\def\displayChoice@TU{#1}} +\displayChoiceCA{Display Choices} +\displayChoiceTU{Lists all choices in the console window} +\newcommand{\displayChoices}[3][]{\pushButton[\TU{\displayChoice@TU} + \CA{\displayChoice@CA}#1\AAmouseup{\sldInputs}\protect\AA +]{sldInputs}{#2}{#3}} +% \end{macrocode} +%\DescribeMacro\clrChoices\nmpsep{[\ameta{options}]\darg{\ameta{wd}}\darg{\ameta{ht}}} inserts a push button +% whose action is to clear all check boxes (and underlying JavaScript variables) created by this package. +% The argument \ameta{wd} can be empty, in which +% case, the width of the field is determined from the \cs{CA} key. +% \begin{macrocode} +\def\clrChoicesCA#1{\def\clrChoices@CA{#1}} +\def\clrChoicesTU#1{\def\clrChoices@TU{#1}} +\clrChoicesCA{Clear Choices} +\clrChoicesTU{Clears all check boxes created by pmdb} +\newcommand{\clrChoices}[3][]{\pushButton[\TU{\clrChoices@TU} + \CA{\clrChoices@CA}#1\AAmouseup{\clrAction}\protect\AA +]{sldInputs}{#2}{#3}} +% \end{macrocode} +% +%\subsection{Defining the \cs{pmInput} command} +% +%\DescribeMacro\pmInput\nmpsep{[\ameta{arg}]\darg{\ameta{path}}} is the main user-interface for inputting a file; here, +%the macros name is \cs{pmInput}, ultimately it calls \cs{input} with the same path. Paths with spaces +%must be enclosed in double quotes (|\pmInput{my cool problem.tex}|) and the extensions must always be used. +% \begin{macrocode} +\def\pmInput{\@ifnextchar[%] + {\let\pm@Brk\ef@YES\inputConta} + {\let\pm@Brk\ef@NO\inputConta}} +\let\pm@Brk\ef@NO +\def\inputConta{\bgroup\@makeother\"\inputContb} +\newcommand\inputContb[2][]{\egroup\def\pmiarg{#1}\inputConti#2;;} +% \end{macrocode} +% Determine if double quotation marks are used. +% \begin{macrocode} +\def\inputConti{\@ifnextchar"% + {\global\pmdbDQstrue\removedqs} + {\global\pmdbDQsfalse\removesemis}} +\def\removedqs"#1";;{\inputContii{#1}} +\def\removesemis#1;;{\inputContii{#1}} +% \end{macrocode} +% Determine if this is a full path, we do this by searching for a colon (\texttt:). +% Following the search for the colon, pass on to the final step of \cs{doinput}. +% \begin{macrocode} +\def\inputContii#1{\isItFullPath#1:\@nil\doinput{#1}} +% \end{macrocode} +% A command to detect presence of a colon. +% \begin{macrocode} +\def\isItFullPath#1:#2\@nil{% + \def\@rgii{#2}\ifx\@rgii\@empty + \global\pmdbFPfalse\else + \global\pmdbFPtrue\fi} +% \end{macrocode} +% Final step, if the switch \cs{ifpmdbmode} is true, we insert the check box +% \cs{ckBxInput}; otherwise, we pass \ameta{path} to \cs{input}. +% \begin{macrocode} +\def\doinput#1{\ifpmdbmode\def\donext{\ckBxInput{#1}}\else + \ifpmdbDQs\def\donext{\input{"#1"}}\else + \def\donext{\input{#1}}\fi\fi + \donext} +% \end{macrocode} +% During the development of this package, the original command name used was \cs{Input}. +% There are a few users that use this old definition; the command \cs{Input} is defined +% in other package, in particular in the \pkg{srcltx}. So we allow the use of \cs{Input} +% if \cs{Input} is not otherwise defined. +% \begin{macrocode} +\def\pmInputWarni{\PackageWarningNoLine{pmdb}{The command \string\Input\space + is already defined.\MessageBreak + The checkboxes may not appear in the margins.\MessageBreak + Use the supported command \string\pmInput\space instead}} +\def\pmInputWarnii{\PackageWarningNoLine{pmdb}{Letting + \string\Input\space to \string\pmInput. You are \MessageBreak + encouraged to use the supported\MessageBreak + command \string\pmInput\space instead}} +\def\pmInputChk{\@ifundefined{Input}{\let\Input\pmInput\pmInputWarnii} + {\pmInputWarni}} +\AtBeginDocument{\pmInputChk} +% \end{macrocode} +% +% \section{Field JavaScript} +% \leavevmode +%\DescribeMacro\ccBoxMU +% This is the JavaScript action of the check box, used in \cs{cbSelectInput} +% \begin{macrocode} +\begin{defineJS}[\makeesc\@\catcode`\%=14\relax]{\ccBoxMU} +@ifpmdbFP% +event.target.userName=("@p(1)"); +@else% +% \end{macrocode} +% This part of the code is Windows specific. Don't know enough about Mac OS +% to form the proper path. +% \begin{macrocode} +// device independent path +var pos=this.path.lastIndexOf("/"); +var thispath=this.path.substring(0,pos+1); +% \end{macrocode} +% \enspace\verb|//user/documents/.../myfolder/| +% \begin{macrocode} +pos=this.path.indexOf("/",1); +var drive=thispath.substring(0,pos); +var platform=app.platform; +if (platform=="WIN") +% \end{macrocode} +% \hskip\parindent\enspace\verb|/:/user/documents/.../myfolder/| +% \begin{macrocode} + thispath=drive+":/"+thispath.substring(pos+1); +event.target.userName=thispath+("@p(1)"); +@fi% +if (event.modifier){ + var _to=app.setTimeOut("_restoreCCState('pmdbCkBx.@p(2)');",.05); + try { + aebTrustedFunctions(this,aebLaunchURL, + {cURL: "file://"+event.target.userName}); + } catch(e) { + console.show(); + console.println("The Ctrl+Click action is not supported, % +installation of aeb\_pro.js is required."); + } +} else { + if (event.target.isBoxChecked(0)){ + _oSPaths["pmdbCkBx.@p(2)"]=% +[("@p(1)"),@ifpmdbDQs true@else false@fi]; + _aInputs[@p(2)]=true; + _numInputs++; + }else{ + _oSPaths["pmdbCkBx.@p(2)"]=null; + _aInputs[@p(2)]=false; + _numInputs--; + } + event.target["_boxState"]=!!event.target.isBoxChecked(0); +} +\end{defineJS} +% \end{macrocode} +%\leavevmode +%\DescribeMacro\sldInputs +% This is the mouse up action for a push button. It lists all selected content +% and displays them in the console window of \app{Acrobat/Reader}, used in +% \cs{displayChoices}. +% \begin{macrocode} +\begin{defineJS}[\catcode`\%=14\relax]{\sldInputs} +console.clear();console.show(); +if (_numInputs==0) console.println("No inputs selected"); +else { + for(var i=0;i<_aInputs.length;i++){ + if (!!_aInputs[i]){ + if(_oSPaths["pmdbCkBx."+i][1]) + console.println(% +'\\\\input\{\\"'+(_oSPaths["pmdbCkBx."+i][0])+'\\"\}'); + else + console.println(% +'\\\\input\{'+(_oSPaths["pmdbCkBx."+i][0])+'\}'); + } + } +} +\end{defineJS} +% \end{macrocode} +%\leavevmode +%\DescribeMacro\clrAction +% Mouse up action to clear the check boxes and to re-initialize internal +% internal JS variables. Used in \cs{clrChoices}. +% \begin{macrocode} +\begin{defineJS}{\clrAction} +var _oSPaths=new Object; +var _aInputs=new Array; +var _numInputs=0; +this.resetForm("pmdbCkBx"); +\end{defineJS} +% \end{macrocode} +% \section{Document JavaScript} +% \begin{macrocode} +\begin{insDLJS}{mrki}{Supporting JavaScript for pmdb} +var _oSPaths=new Object; +var _aInputs=new Array; +var _numInputs=0; +function _restoreCCState(fName){ + var f=this.getField(fName); + var _ccState=% +(typeof f["_boxState"]=="undefined")?false:f["_boxState"]; + f["_boxState"]=_ccState; + return f.checkThisBox(0,_ccState); +} +\end{insDLJS} +% \end{macrocode} +% \begin{macrocode} +\catcode`\"=\th@dquoteCat +% +% \end{macrocode} +%\Finale diff --git a/texmf-dist/source/latex/pmdb/pmdb.ins b/texmf-dist/source/latex/pmdb/pmdb.ins new file mode 100644 index 00000000..a0bd3aa2 --- /dev/null +++ b/texmf-dist/source/latex/pmdb/pmdb.ins @@ -0,0 +1,60 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1999-2012 D. P. Story +%% +%% This file is part of the `AcroTeX eDucation Bundle'. +%% ------------------------------------------- +%% +%% It may be distributed under the conditions of the LaTeX Project Public +%% License, either version 1.2 of this license or (at your option) any +%% later version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.2 or later is part of all distributions of LaTeX +%% version 1999/12/01 or later. +%% +%% --------------- start of docstrip commands ------------------ +%% +\def\filedate{2019/11/08} +\def\batchfile{pmdb.ins} + +\input docstrip +\ifx\generate\undefined + \Msg{**********************************************} + \Msg{*} + \Msg{* This installation requires docstrip} + \Msg{* version 2.4 or later.} + \Msg{*} + \Msg{* An older version of docstrip has been input} + \Msg{*} + \Msg{**********************************************} + \errhelp{Move or rename old docstrip.tex and get a newer one.} + \errmessage{Old docstrip in input path} + \batchmode + \csname @@end\endcsname\end +\fi + +\keepsilent +\askforoverwritefalse +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\preamble +\endpreamble + +\generate +{% + \file{pmdb.sty}{\from{pmdb.dtx}{copyright,package}} +} + +\Msg{***************************************************************} +\Msg{*} +\Msg{* \space To finish the installation you have to copy the files } +\Msg{*} +\Msg{* \space *.sty, *.cfg and *.def into a directory searched by TeX} +\Msg{*} +\Msg{***************************************************************} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput diff --git a/texmf-dist/tex/latex/pmdb/pmdb.sty b/texmf-dist/tex/latex/pmdb/pmdb.sty new file mode 100644 index 00000000..ef6419c5 --- /dev/null +++ b/texmf-dist/tex/latex/pmdb/pmdb.sty @@ -0,0 +1,224 @@ +%% +%% This is file `pmdb.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% pmdb.dtx (with options: `copyright,package') +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% pmdb.sty package,, %% +%% Copyright (C) 2019 D. P. Story %% +%% dpstory@uakron.edu dpstory@acrotex.net %% +%% %% +%% This program can redistributed and/or modified under %% +%% the terms of the LaTeX Project Public License %% +%% Distributed from CTAN archives in directory %% +%% macros/latex/base/lppl.txt; either version 1.2 of the %% +%% License, or (at your option) any later version. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{pmdb} + \ProvidesPackage{pmdb}[2019/12/09 v0.4 Mark for input files] +\edef\th@dquoteCat{\the\catcode`\"} +\catcode`\"=12\relax +\newif\ifpmdbmode \pmdbmodetrue +\DeclareOption{dbmode}{\pmdbmodetrue} +\DeclareOption{!dbmode}{\pmdbmodefalse} +\newif\ifpmdbtight \pmdbtightfalse +\DeclareOption{tight}{\pmdbtighttrue} +\DeclareOption{!tight}{\pmdbtightfalse} +\ProcessOptions +\RequirePackage{eforms} +\def\pmdb@ckThor{\@ifundefined{essayQ}{\let\essayQ\@gobble}{}} +\AtBeginDocument{\pmdb@ckThor} +\newif\ifpmdbFP \pmdbFPfalse +\newif\ifpmdbDQs \pmdbDQsfalse +\newcount\pmdb@Cnt +\def\pmCBPresets#1{\def\pm@CBPresets{#1}} +\pmCBPresets{} +\def\cbSelectInput#1{\checkBox[\TU{#1}\presets{\pm@CBPresets} + \cmd{\bParams{#1}{\the\pmdb@Cnt}\eParams} + \AAmouseup{\ccBoxMU} + ]{pmdbCkBx.\the\pmdb@Cnt}{11bp}{11bp}{On}% + \global\advance\pmdb@Cnt\@ne} +\def\insertCkBx#1{\def\@insertCkBx##1{#1}} +\def\setCBsMarg{% + \ifpmdbtight + \if@reversemargin + \def\pmAlignCBAlt{\ifodd\value{page}\leavevmode\hfill\else\fi}\else + \def\pmAlignCBAlt{\ifodd\value{page}\else\hfill\fi}\fi + \else + \if@reversemargin + \def\pmAlignCBAlt{\ifodd\value{page}\hfil\else\hfil\fi}\else + \def\pmAlignCBAlt{\ifodd\value{page}\hfill\else\fi}\fi + \fi +} +\def\altCBMargins{\let\pmAlignCB\pmAlignCBAlt} +\def\pmAlignCB{% + \if@reversemargin + \ifpmdbtight\hfill\else\fi + \else + \ifpmdbtight\else\hfill\fi + \fi +} +\@ifundefined{chapter}{}{\AtBeginDocument{\setCBsMarg\altCBMargins}} +\def\InputParas{%\let\pmAlignCB\relax + \insertCkBx{\ifpmdbmode + \everypar{\marginpar{\pmAlignCB\cbSelectInput{##1}}\global\everypar{}}\fi}} +\InputParas +\newcount\saveQNo \saveQNo\z@ +\def\pmHook@qzItems{% + \let\item@pmOld\item + \def\item@pnNew{\item@pmOld\itemhook\let\item\item@pmOld}% + \let\item\item@pnNew} +\def\InputQuizItems{\let\pmHook\pmHook@qzItems + \saveQNo\z@ + \insertCkBx{\def\cbInQzMargin{\cbSelectInput{##1}}}% + \ItemHook{\leavevmode\ifpmdbmode + \ifnum\saveQNo<\value{eqquestionnoi}% + \marginpar{\pmAlignCB\cbInQzMargin}\fi + \saveQNo=\arabic{eqquestionnoi}\fi}} +\def\pmHook@item{\let\item@pmOld\item + \def\item@pmNew{% + \ifx\pmiarg\@empty + \ifx\pm@Brk\ef@YES + \def\pm@next{\item@pmOld[]}\else + \let\pm@next\item@pmOld + \fi + \else + \def\pm@next{\item@pmOld[\pmiarg]}% + \fi\pm@next\itemhook\let\item\item@pmOld}% + \let\item\item@pmNew +} +\def\ItemHook#1{\def\itemhook{#1}} +\def\InputItems{\let\pmHook\pmHook@item + \insertCkBx{\def\cbInQzMargin{\cbSelectInput{##1}}}% + \ItemHook{\leavevmode\ifpmdbmode + \marginpar{\pmAlignCB\cbInQzMargin}\fi}} +\let\pmHook\relax +\def\ckBxInput#1{\@insertCkBx{#1}% + \ifpmdbDQs\def\donext{\pmHook\input{"#1"}}\else + \def\donext{\pmHook\input{#1}}\fi + \donext} +\def\displayChoiceCA#1{\def\displayChoice@CA{#1}} +\def\displayChoiceTU#1{\def\displayChoice@TU{#1}} +\displayChoiceCA{Display Choices} +\displayChoiceTU{Lists all choices in the console window} +\newcommand{\displayChoices}[3][]{\pushButton[\TU{\displayChoice@TU} + \CA{\displayChoice@CA}#1\AAmouseup{\sldInputs}\protect\AA +]{sldInputs}{#2}{#3}} +\def\clrChoicesCA#1{\def\clrChoices@CA{#1}} +\def\clrChoicesTU#1{\def\clrChoices@TU{#1}} +\clrChoicesCA{Clear Choices} +\clrChoicesTU{Clears all check boxes created by pmdb} +\newcommand{\clrChoices}[3][]{\pushButton[\TU{\clrChoices@TU} + \CA{\clrChoices@CA}#1\AAmouseup{\clrAction}\protect\AA +]{sldInputs}{#2}{#3}} +\def\pmInput{\@ifnextchar[%] + {\let\pm@Brk\ef@YES\inputConta} + {\let\pm@Brk\ef@NO\inputConta}} +\let\pm@Brk\ef@NO +\def\inputConta{\bgroup\@makeother\"\inputContb} +\newcommand\inputContb[2][]{\egroup\def\pmiarg{#1}\inputConti#2;;} +\def\inputConti{\@ifnextchar"% + {\global\pmdbDQstrue\removedqs} + {\global\pmdbDQsfalse\removesemis}} +\def\removedqs"#1";;{\inputContii{#1}} +\def\removesemis#1;;{\inputContii{#1}} +\def\inputContii#1{\isItFullPath#1:\@nil\doinput{#1}} +\def\isItFullPath#1:#2\@nil{% + \def\@rgii{#2}\ifx\@rgii\@empty + \global\pmdbFPfalse\else + \global\pmdbFPtrue\fi} +\def\doinput#1{\ifpmdbmode\def\donext{\ckBxInput{#1}}\else + \ifpmdbDQs\def\donext{\input{"#1"}}\else + \def\donext{\input{#1}}\fi\fi + \donext} +\def\pmInputWarni{\PackageWarningNoLine{pmdb}{The command \string\Input\space + is already defined.\MessageBreak + The checkboxes may not appear in the margins.\MessageBreak + Use the supported command \string\pmInput\space instead}} +\def\pmInputWarnii{\PackageWarningNoLine{pmdb}{Letting + \string\Input\space to \string\pmInput. You are \MessageBreak + encouraged to use the supported\MessageBreak + command \string\pmInput\space instead}} +\def\pmInputChk{\@ifundefined{Input}{\let\Input\pmInput\pmInputWarnii} + {\pmInputWarni}} +\AtBeginDocument{\pmInputChk} +\begin{defineJS}[\makeesc\@\catcode`\%=14\relax]{\ccBoxMU} +@ifpmdbFP% +event.target.userName=("@p(1)"); +@else% +// device independent path +var pos=this.path.lastIndexOf("/"); +var thispath=this.path.substring(0,pos+1); +pos=this.path.indexOf("/",1); +var drive=thispath.substring(0,pos); +var platform=app.platform; +if (platform=="WIN") + thispath=drive+":/"+thispath.substring(pos+1); +event.target.userName=thispath+("@p(1)"); +@fi% +if (event.modifier){ + var _to=app.setTimeOut("_restoreCCState('pmdbCkBx.@p(2)');",.05); + try { + aebTrustedFunctions(this,aebLaunchURL, + {cURL: "file://"+event.target.userName}); + } catch(e) { + console.show(); + console.println("The Ctrl+Click action is not supported, % +installation of aeb\_pro.js is required."); + } +} else { + if (event.target.isBoxChecked(0)){ + _oSPaths["pmdbCkBx.@p(2)"]=% +[("@p(1)"),@ifpmdbDQs true@else false@fi]; + _aInputs[@p(2)]=true; + _numInputs++; + }else{ + _oSPaths["pmdbCkBx.@p(2)"]=null; + _aInputs[@p(2)]=false; + _numInputs--; + } + event.target["_boxState"]=!!event.target.isBoxChecked(0); +} +\end{defineJS} +\begin{defineJS}[\catcode`\%=14\relax]{\sldInputs} +console.clear();console.show(); +if (_numInputs==0) console.println("No inputs selected"); +else { + for(var i=0;i<_aInputs.length;i++){ + if (!!_aInputs[i]){ + if(_oSPaths["pmdbCkBx."+i][1]) + console.println(% +'\\\\input\{\\"'+(_oSPaths["pmdbCkBx."+i][0])+'\\"\}'); + else + console.println(% +'\\\\input\{'+(_oSPaths["pmdbCkBx."+i][0])+'\}'); + } + } +} +\end{defineJS} +\begin{defineJS}{\clrAction} +var _oSPaths=new Object; +var _aInputs=new Array; +var _numInputs=0; +this.resetForm("pmdbCkBx"); +\end{defineJS} +\begin{insDLJS}{mrki}{Supporting JavaScript for pmdb} +var _oSPaths=new Object; +var _aInputs=new Array; +var _numInputs=0; +function _restoreCCState(fName){ + var f=this.getField(fName); + var _ccState=% +(typeof f["_boxState"]=="undefined")?false:f["_boxState"]; + f["_boxState"]=_ccState; + return f.checkThisBox(0,_ccState); +} +\end{insDLJS} +\catcode`\"=\th@dquoteCat +\endinput +%% +%% End of file `pmdb.sty'. diff --git a/tlpkg/tlpsrc/pmdb.tlpsrc b/tlpkg/tlpsrc/pmdb.tlpsrc new file mode 100644 index 00000000..e69de29b -- cgit v1.2.3