diff options
29 files changed, 3365 insertions, 1282 deletions
diff --git a/texmf-dist/doc/latex/acrotex/README.md b/texmf-dist/doc/latex/acrotex/README.md index 52385995..3f16d740 100644 --- a/texmf-dist/doc/latex/acrotex/README.md +++ b/texmf-dist/doc/latex/acrotex/README.md @@ -1,6 +1,6 @@ The AcroTeX eDucation Bundle Author: D. P. Story -Dated: 2018-12-13 +Dated: 2019-03-16 AeB contains the following: @@ -19,6 +19,10 @@ AeB contains the following: 6) Documentation for AeB (AcroTeX eDucatation Bundle) and eForms (including insdljs and dljslib). +What's New (2019/03/16) minor bug fixes; added \bParams/\eParams command pair to pass +arguments to JS code snippets declared within the defineJS environment. Fixed the spacing +problem when dvips is used to compile a doc containing the defineJS environment. + What's New (2018/12/13) More changes in exerquiz to support mi-solns; misc. bug fixes. What's New (2028/12/05) Some changes in exerquiz to support mi-solns. Require aeb-comment diff --git a/texmf-dist/doc/latex/acrotex/aeb_man.pdf b/texmf-dist/doc/latex/acrotex/aeb_man.pdf Binary files differindex c56c66eb..c12efd3f 100644 --- a/texmf-dist/doc/latex/acrotex/aeb_man.pdf +++ b/texmf-dist/doc/latex/acrotex/aeb_man.pdf diff --git a/texmf-dist/doc/latex/acrotex/aeb_man.tex b/texmf-dist/doc/latex/acrotex/aeb_man.tex index 219b214a..ffee27d3 100644 --- a/texmf-dist/doc/latex/acrotex/aeb_man.tex +++ b/texmf-dist/doc/latex/acrotex/aeb_man.tex @@ -1,5 +1,5 @@ %\listfiles -\RequirePackage[!use=preview,!use=usebw]{spdef} +\RequirePackage[!use=preview,!use=efpmca,!use=usebw]{spdef} \documentclass{article} %\usepackage{makeidx,showidx} \usepackage[fleqn]{amsmath} @@ -21,8 +21,6 @@ \DeclareInitView{layoutmag={navitab:UseOutlines}} \xbmksetup{colors={int=red},styles={intbf}} - - \newbox\aebbox \usepackage{acroman} @@ -168,7 +166,8 @@ \def\AcroTeX{Acro\!\TeX} \def\HTML{HTML}\def\FDF{FDF} \def\PDF{PDF}\def\URL{URL} -\let\amtIndent\leftmargini +%\let\amtIndent\leftmargini +\edef\amtIndent{\the\parindent} \def\bNH{\begin{NoHyper}}\def\eNH{\end{NoHyper}} \def\nhnameref#1{\bNH\nameref{#1}\eNH} \def\nhNameref#1{\bNH\Nameref{#1}\eNH} @@ -233,10 +232,10 @@ \university{{\AcroT} Software Development Team} \email{dpstory@acrotex.net} \versionLabel{Dated:} -\version{2018/12/13} +\version{2019/03/16} \copyrightyears{1999-\the\year} \nocopyright -\prepared{2018/12/13} +\prepared{2019/03/16} \revisionLabel{Distribution Dated:} \copyrightStatus{True} @@ -5646,14 +5645,11 @@ well for the \texttt{quiz} environment. \begin{shortquiz*}[TestSQ] Answer this if you can! -\begin{answers}{2} +\begin{answers}{2}\rowsep{3pt} \bChoices \Ans0\label{testsqFirst} This is a possible answer.\eAns - \Ans1\label{testsqSecond} Try this one (the correct one)\eAns - \Ans0 This is an answer.\eAns - \Ans0 Another alternative.\eAns \eChoices \end{answers} @@ -5668,7 +5664,7 @@ Answer this if you can! \graylettersOn \begin{shortquiz*}[TestSQ] Answer this if you can! -\begin{answers}{2} +\begin{answers}{2}\rowsep{3pt} \bChoices \Ans0\label{testsqFirst} This is a possible answer.\eAns \Ans1\label{testsqSecond} Try this one (the correct one).\eAns @@ -6259,7 +6255,7 @@ following questions. \Ans0 none &\Ans0 one &\Ans1 two \end{answers} \end{questions} -\end{quiz}\par +\end{quiz}\vcgBdry \ScoreField\currQuiz %\TextField[name=qz:discr,width=3in,default=\eqScore]{} @@ -6339,7 +6335,7 @@ following questions. \Ans0 none &\Ans0 one &\Ans1 two \end{answers} \end{questions} -\end{quiz*} +\end{quiz*}\vcgBdry \ScoreField{qzdiscrf} @@ -6563,7 +6559,7 @@ answers. \newtopic The arguments of the \cs{Ans} command is the same as those of \cs{Ans} in the \texttt{answers} environment. -\newtopic When the \cs{ScoreField} is used to display results, a manswers +When the \cs{ScoreField} is used to display results, a `manswers' question is correct if and only if all correct answers are checked, and none of the incorrect answers are checked. @@ -6606,22 +6602,22 @@ correction button. The correction button with \begin{quiz}{qzdiscr1l} Using the discriminant, $b^2-4ac$, respond to each of the following questions. -\begin{questions} +\begin{questions}[itemsep=0pt] \item Is the quadratic polynomial $x^2-4x + 3$ irreducible? -\begin{answers}4 +\begin{answers}{4} \Ans0 Yes &\Ans1 No \end{answers} \item Is the quadratic polynomial $2x^2 - 4x + 3 $ irreducible? -\begin{answers}4 +\begin{answers}{4} \Ans1 Yes &\Ans0 No \end{answers} \item How many solutions does the equation $2x^2 - 3x - 2= 0$ have? -\begin{answers}4 +\begin{answers}{4} \Ans0 none &\Ans0 one &\Ans1 two \end{answers} \end{questions} -\end{quiz}\par -\ScoreField{qzdiscr1l}\CorrButton{qzdiscr1l}% +\end{quiz}\quad +\ScoreField{qzdiscr1l}\olBdry\CorrButton{qzdiscr1l}% \medskip %\fcolorbox{blue}{webyellow}{% @@ -6646,9 +6642,9 @@ respond to each of the following questions. \end{center} \end{comment} -\medskip +\newtopic A partial verbatim listing of this quiz follows: -\begin{Verbatim}[xleftmargin=\amtIndent] +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] \begin{quiz}{qzdiscr1l} Using the discriminant, $b^2-4ac$, respond to each of the following questions. \begin{questions} @@ -6656,9 +6652,7 @@ respond to each of the following questions. ............................ ............................ \end{questions} -\end{quiz} - -\ScoreField{qzdiscr1l}\CorrButton{qzdiscr1l} +\end{quiz}\quad\ScoreField{qzdiscr1l}\olBdry\CorrButton{qzdiscr1l} \end{Verbatim} @@ -6706,14 +6700,14 @@ respond to each of the following questions. \Ans0 none &\Ans0 one &\Ans1 two \end{answers} \end{questions} -\end{quiz*}\quad\ScoreField\currQuiz\CorrButton\currQuiz +\end{quiz*}\quad\ScoreField\currQuiz\olBdry\CorrButton\currQuiz \redpoint In the partial verbatim listing that follows, notice the field name has been changed from \texttt{qzdiscr1l}, which is the name of the quiz previous to his one, to \texttt{qzdiscr1f}. Different quizzes must have unique field names. -\begin{Verbatim}[xleftmargin=\amtIndent] +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] \begin{quiz*}{qzdiscr1f} Using the discriminant, $b^2-4ac$, respond to each of the following questions. \begin{questions} @@ -6721,7 +6715,7 @@ respond to each of the following questions. ............................ ............................ \end{questions} -\end{quiz*}\quad\ScoreField\currQuiz\CorrButton\currQuiz +\end{quiz*}\quad\ScoreField\currQuiz\olBdry\CorrButton\currQuiz \end{Verbatim} \redpoint Notice that in this example, the \cs{ScoreField} and the @@ -6833,7 +6827,7 @@ Yes, Donald Knuth was the creator of \TeX. Yes, Leslie Lamport was the creator of \LaTeX. \end{solution} \end{questions} -\end{quiz*}\quad\ScoreField\currQuiz\CorrButton\currQuiz +\end{quiz*}\quad\ScoreField\currQuiz\olBdry\CorrButton\currQuiz \AllowPeeking @@ -6854,7 +6848,7 @@ Here is a partial listing of the above example. Passing is 100\%. \begin{questions} \item Who created \TeX? -\begin{answers}[knuth]4 +\begin{answers}[knuth]{4} \Ans1 Knuth &\Ans0 Lamport &\Ans0 Carlisle &\Ans0 Rahtz \end{answers} \begin{solution} @@ -6862,7 +6856,7 @@ Yes, Donald Knuth was the creator of \TeX. \end{solution} .... \end{questions} -\end{quiz*}\quad\ScoreField\currQuiz\CorrButton\currQuiz +\end{quiz*}\quad\ScoreField\currQuiz\olBdry\CorrButton\currQuiz \end{Verbatim} \redpoint Notice that in the \texttt{answers} environment, an @@ -6947,7 +6941,7 @@ is 100\%. \Ans0 Knuth &\Ans1 Lamport &\Ans0 Carlisle &\Ans0 Rahtz \end{answers} \end{questions} -\end{quiz*}\quad\ScoreField{qzTeX}\CorrButton{qzTeX} +\end{quiz*}\quad\ScoreField{qzTeX}\olBdry\CorrButton{qzTeX} \noindent If desired, we can return to the defaults: \begin{Verbatim}[xleftmargin=\amtIndent] @@ -7094,7 +7088,7 @@ how to use the ``every'' command.${}^{\text{\fnEFormi}}$\def\fnEFormi{\thefootno \begin{quiz*}{qzTeXc} Answer each of the following. Passing is 100\%. -\begin{questions} +\begin{questions}[parsep=0pt] \item What \TeX\ System does Thomas Esser maintain? \begin{answers}4 \Ans0 MiK\TeX &\Ans0 cs\TeX &\Ans1 te\TeX &\Ans0 fp\TeX @@ -7109,8 +7103,8 @@ is 100\%. \end{answers} \end{questions} \end{quiz*}\quad% -\ScoreField[\BC{0 0 1}]{qzTeXc}% - \CorrButton[\BC{0 0 1}% blue border color +\ScoreField[\BC{0 0 1}]{qzTeXc}\olBdry + \CorrButton[\BC{0 0 1}% blue border color \CA{TeX}% Button text \RC{Users}% rollover text \AC{Group}% pushed text @@ -7123,9 +7117,10 @@ is 100\%. \noindent The new part is the customized scoring and correction button. Here is a verbatim listing of the \cs{ScoreField} and \cs{CorrButton} macros. +\goodbreak \begin{Verbatim}[xleftmargin=\amtIndent] -\ScoreField[\BC{0 0 1}]{qz:TeXc}% - \CorrButton[\BC{0 0 1} % blue border color +\ScoreField[\BC{0 0 1}]{qz:TeXc}\olBdry + \CorrButton[\BC{0 0 1} % blue border color \CA{TeX} % Button text \RC{Users} % rollover text \AC{Group} % pushed text @@ -7181,7 +7176,7 @@ Answer each of these to the best of your ability. The answer is false, statistics is interesting but not fun. \end{solution} \end{questions} -\end{quiz}\quad\ScoreField\currQuiz\CorrButton\currQuiz +\end{quiz}\quad\ScoreField\currQuiz\olBdry\CorrButton\currQuiz \noindent The partial verbatim code for the above quiz follows: @@ -7192,7 +7187,7 @@ Answer each of these to the best of your ability. \begin{questions} ... \end{questions} -\end{quiz}\quad\ScoreField\currQuiz\CorrButton\currQuiz +\end{quiz}\quad\ScoreField\currQuiz\olBdry\CorrButton\currQuiz \end{Verbatim} \restoreDefaultQuizHeaders @@ -7376,17 +7371,13 @@ is 100\%.\hfill\smash{\GradeField[\rectH{30bp}\rectW{30bp}\textSize{0}]\currQuiz \item\PTs{6} Name \emph{one} of the two people recognized as a founder of Calculus.\\[1ex] -\RespBoxTxt{0}{0}{4}{Isaac Newton}{Newton}{Gottfried Leibniz}{Leibniz}% +\RespBoxTxt{0}{0}{4}{Isaac Newton}{Newton}{Gottfried Leibniz}{Leibniz}\olBdry \CorrAnsButton{Isaac Newton or Gottfried Leibniz} \end{questions} -\end{quiz*}\quad\ScoreField\currQuiz\CorrButton\currQuiz - -\noindent -Answers: \AnswerField\currQuiz - -\medskip\noindent -Points: \PointsField\currQuiz\ Percent: \PercentField\currQuiz +\end{quiz*}\quad\ScoreField\currQuiz\olBdry\CorrButton\currQuiz\hfill +Answers: \AnswerField\currQuiz\vcgBdry[.5em] +Points:\cgBdry[.5em]\PointsField\currQuiz\cgBdry[.5em]Percent:\cgBdry[.5em]\PercentField\currQuiz %\exPDF{quizpts} See the sample file %\href{\bUrl/webeq_ex.html\#quizpts}{quizpts.tex} for a more @@ -7531,7 +7522,7 @@ Answer these questions truthfully. \end{solution} \end{answers} \end{questions} -\end{quiz}\ScoreField\currQuiz\CorrButton\currQuiz +\end{quiz}\ScoreField\currQuiz\olBdry\CorrButton\currQuiz \begin{flushleft} \fcolorbox{blue}{webyellow}{\begin{minipage}{.67\linewidth} @@ -7621,10 +7612,9 @@ question, however. You can also pose questions that require a text answer: \redpoint\begin{oQuestion}{exTxt2} -Name the probability -distribution popularly referred to as the ``bell-shaped curve''.\\ +Name the probability distribution popularly referred to as the ``bell-shaped curve''.\\[3pt] \RespBoxTxt{0}{0}{4}{Normal}{Normal Distribution}{Gaussian}{Gaussian Distribution} -\end{oQuestion} +\end{oQuestion}\vcgBdry[3pt] See \Nameref{ss:respboxtxt} for details. @@ -7932,12 +7922,12 @@ basic command for posing this type of question is earlier: \begin{oQuestion}{exTxt1} \redpoint Name the probability -distribution popularly referred to as the ``bell-shaped curve''.\\ +distribution popularly referred to as the ``bell-shaped curve''.\\[3pt] \mbox{\strut\RespBoxTxt{0}{0}{4}{Normal}{Normal Distribution}% {Gaussian}{Gaussian Distribution}} %\raisebox{-3bp}{\RespBoxTxt{0}{0}{4}{Normal}{Normal Distribution}% %{Gaussian}{Gaussian Distribution}} -\end{oQuestion} +\end{oQuestion}\vcgBdry[3pt] The underlying JavaScript compares the user's response against acceptable alternatives, as supplied by the author of the @@ -8120,7 +8110,7 @@ than the default variable of $x$. \begin{oQuestion}{sine2} \redpoint Differentiate\\[1ex] $\dfrac d{dt} \sin^2(t) =$ -\RespBoxMath{2*sin(t)*cos(t)}(t){4}{.0001}{0}{1}\kern1bp\CorrAnsButton{2*sin(t)*cos(t)} +\RespBoxMath{2*sin(t)*cos(t)}(t){4}{.0001}{0}{1}\cgBdry\CorrAnsButton{2*sin(t)*cos(t)} \end{oQuestion} \medskip\noindent @@ -8128,7 +8118,7 @@ The listing follows: \begin{Verbatim}[xleftmargin=\amtIndent] \begin{oQuestion}{sine2}\\[1ex] \redpoint Differentiate $\dfrac d{dt} \sin^2(t) =$ -\RespBoxMath{2*sin(t)*cos(t)}(t){4}{.0001}{0}{1}\kern1bp +\RespBoxMath{2*sin(t)*cos(t)}(t){4}{.0001}{0}{1}\cgBdry \CorrAnsButton{2*sin(t)*cos(t)} \end{oQuestion} \end{Verbatim} @@ -8155,7 +8145,7 @@ to the solution. \begin{oQuestion}{sine3} \redpoint Differentiate\\[1ex] $\dfrac d{dt} \sin^2(t) =$ -\RespBoxMath{2*sin(t)*cos(t)}(t)[sine3]{4}{.0001}{0}{1}\kern1bp\CorrAnsButton{2*sin(t)*cos(t)} +\RespBoxMath{2*sin(t)*cos(t)}(t)[sine3]{4}{.0001}{0}{1}\cgBdry\CorrAnsButton{2*sin(t)*cos(t)} \begin{solution} \[ \frac d{dx}\sin^2(x) = 2\sin(x)\cos(x) = \sin(2x) @@ -8206,7 +8196,7 @@ An example of this optional parameter is \redpoint Perform the indicated operation, and enter result into the box.\\[1ex] $ \text{9} + \text{8} =$ -\RespBoxMath{9 + 8}{1}{.0001}{[0,1]}\kern1bp\CorrAnsButton{9 + 8}*{EvalCorrAnsButton}\kern1bp +\RespBoxMath{9 + 8}{1}{.0001}{[0,1]}\cgBdry\CorrAnsButton{9 + 8}*{EvalCorrAnsButton}\cgBdry \sqTallyBox \end{oQuestion} @@ -8217,8 +8207,8 @@ The listing follows: \redpoint Perform the indicated operation, and enter result into the box.\\[1ex] $ 9 + 8 = $ -\RespBoxMath{9 + 8}{1}{.0001}{[0,1]}\kern1bp - \CorrAnsButton{9 + 8}*{EvalCorrAnsButton}\kern1bp +\RespBoxMath{9 + 8}{1}{.0001}{[0,1]}\cgBdry + \CorrAnsButton{9 + 8}*{EvalCorrAnsButton}\cgBdry \sqTallyBox \end{oQuestion} \end{Verbatim} @@ -8234,7 +8224,7 @@ For example, \begin{oQuestion}{sine4} \redpoint \hypertarget{exofT}{Differentiate}\\[1ex] $\dfrac d{dx} \sin^2(x) =$ -\RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{0}{1}\kern1bp\CorrAnsButton{2*sin(x)*cos(x)}\kern1bp +\RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{0}{1}\cgBdry\CorrAnsButton{2*sin(x)*cos(x)}\cgBdry \sqTallyBox \end{oQuestion} @@ -8244,8 +8234,8 @@ The listing follows: \begin{oQuestion}{sine4} \redpoint Differentiate\\[1ex] $\dfrac d{dx} \sin^2(x) =$ -\RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{0}{1}\kern1bp -\CorrAnsButton{2*sin(x)*cos(x)}\kern1bp +\RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{0}{1}\cgBdry +\CorrAnsButton{2*sin(x)*cos(x)}\cgBdry \sqTallyBox \end{oQuestion} \end{Verbatim} @@ -8264,8 +8254,8 @@ insert \cs{sqClearButton}. \begin{oQuestion}{sine5} \redpoint Differentiate\\[1ex] $\dfrac d{dx} \sin^2(x) =$ -\RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{0}{1}\kern1bp\CorrAnsButton{2*sin(x)*cos(x)}\kern1bp -\sqTallyBox\kern1bp\sqClearButton +\RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{0}{1}\kern1bp\CorrAnsButton{2*sin(x)*cos(x)}\cgBdry +\sqTallyBox\cgBdry\sqClearButton \end{oQuestion} @@ -8276,8 +8266,8 @@ The listing follows: \redpoint Differentiate\\[1ex] $\dfrac d{dx} \sin^2(x) =$ \RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{0}{1}% -\CorrAnsButton{2*sin(x)*cos(x)}\kern1bp -\sqTallyBox\kern1bp\sqClearButton +\CorrAnsButton{2*sin(x)*cos(x)}\cgBdry +\sqTallyBox\cgBdry\sqClearButton \end{oQuestion} \end{Verbatim} @@ -8409,7 +8399,7 @@ Answer each of the following. Passing is 100\%. \item $\displaystyle\frac d{dx} \sin^2(x) =$ \RespBoxMath{2*sin(x)*cos(x)}[sinsqx]{4}{.0001}{0}{1}% \hfill\CorrAnsButton{2*sin(x)*cos(x)}% -\kern1bp\sqTallyBox +\cgBdry\sqTallyBox \begin{solution} \[ \frac d{dx}\sin^2(x) = 2\sin(x)\cos(x) = \sin(2x) @@ -8420,7 +8410,7 @@ Answer each of the following. Passing is 100\%. Calculus.\vadjust{\kern3pt}\newline \RespBoxTxt{2}{0}[newton]{5}% {Isaac Newton}{Newton}{I. Newton}{Gottfried Leibniz}{Leibniz}\hfill -\CorrAnsButton{Isaac Newton or Gottfried Leibniz}\kern1bp\sqTallyBox +\CorrAnsButton{Isaac Newton or Gottfried Leibniz}\cgBdry\sqTallyBox \end{questions} \begin{solution} Yes, Isaac Newton and Gottfried Leibniz are considered founders of @@ -8535,9 +8525,8 @@ founders of Calculus. \end{solution} \end{questions} -\end{quiz*}\quad\ScoreField{oQq}\CorrButton{oQq} - -\noindent Answers: \AnswerField{oQq} +\end{quiz*}\quad\ScoreField{oQq}\olBdry\CorrButton{oQq}\vcgBdry +Answers: \AnswerField{oQq} \redpoint The buttons created by \cs{CorrAnsButton} are hidden until the user ends the quiz (and gets scored) and clicks on the @@ -8662,7 +8651,7 @@ Compute the following cross product: % \end{equation*} \end{quiz*}\ $\underset{\text{ScoreField}}{\underbrace{\ScoreField[\DV{}\V{}\rectW{1in}]\currQuiz}}$% - \kern1bp$\underset{\text{PointsField}}{\underbrace{\PointsField[\rectW{1in}]\currQuiz}}$\CorrButton[\CA{Correct}\AC{}\RC{}]\currQuiz + \cgBdry$\underset{\text{PointsField}}{\underbrace{\PointsField[\rectW{1in}]\currQuiz}}$\olBdry\CorrButton[\CA{Correct}\AC{}\RC{}]\currQuiz \hfill Ans: \AnswerField[\rectW{.5in}]\currQuiz \end{minipage} @@ -8950,7 +8939,7 @@ Simplify the following radial expression by factoring out all perfect squares. ),% postParse:\Array(\postDenyForm(/sqrt(\refac{72}|\refac{8})/)% )% - }]\CorrAnsButton{6sqrt(2)}\kern1bp\sqTallyBox + }]\CorrAnsButton{6sqrt(2)}\cgBdry\sqTallyBox \end{equation*} \end{questions} \end{shortquiz} @@ -9111,7 +9100,7 @@ Simplify the following radial expression by factoring out all perfect squares. ),% postParse:\Array(\postDenyForm(/sqrt(\refac{72}|\refac{8})/)% )% - }]\CorrAnsButton{6sqrt(2)}\kern1bp\sqTallyBox + }]\CorrAnsButton{6sqrt(2)}\cgBdry\sqTallyBox \end{equation*} \end{questions} \end{shortquiz} @@ -11677,15 +11666,16 @@ features of the \pkg{web} and \textsf{exerquiz} packages. \texttt{insdljs\_ex.tex} that can be used as a startup test file. \begin{questions} - \item (Version 2.0f) Added a command \cs{previewMiKTeX} which redefines \cs{jsR} and - \cs{jsT} that enables, I hope, the \textsf{yap} previewer to preview - an \textsf{AeB} document. - \item Added the \texttt{defineJS} environment. Use this environment to - write JavaScript for buttons and other form fields. - \item Added the \texttt{execJS} environment. Use this environment to write - ``discardable'' JavaScript that will execute when the newly created document is opened - in the Acrobat Viewer. (The Acrobat Viewer, not the Reader, is required.) - See the demo file \texttt{execjstst.tex}. + \item (Version 2.0f) Added a command \cs{previewMiKTeX} which redefines + \cs{jsR} and \cs{jsT} that enables, I hope, the \textsf{yap} + previewer to preview an \textsf{AeB} document. + \item Added the \texttt{defineJS} environment. Use this environment to + write JavaScript for buttons and other form fields. + \item Added the \texttt{execJS} environment. Use this environment to + write ``discardable'' JavaScript that will execute when the newly + created document is opened in the Acrobat Viewer. (The Acrobat + Viewer, not the Reader, is required.) See the demo file + \texttt{execjstst.tex}. \end{questions} \subsection{dljslib} diff --git a/texmf-dist/doc/latex/acrotex/eformman.pdf b/texmf-dist/doc/latex/acrotex/eformman.pdf Binary files differindex 815f539e..6544303a 100644 --- a/texmf-dist/doc/latex/acrotex/eformman.pdf +++ b/texmf-dist/doc/latex/acrotex/eformman.pdf diff --git a/texmf-dist/doc/latex/acrotex/eformman.tex b/texmf-dist/doc/latex/acrotex/eformman.tex index fc076e18..803f841d 100644 --- a/texmf-dist/doc/latex/acrotex/eformman.tex +++ b/texmf-dist/doc/latex/acrotex/eformman.tex @@ -10,6 +10,10 @@ \usepackage[altbullet]{lucidbry} %\usepackage{myriadpro} +\setlength{\marginparpush}{3pt} + +%\previewOn\pmcaOn + \usepackage{graphicx,array,longtable} %\usepackage[usecmtt]{myriadpro} @@ -17,7 +21,12 @@ \DeclareInitView{layoutmag={navitab:UseOutlines}} \xbmksetup{colors={int=red},styles={intbf}} -%\addtolength{\marginparwidth}{20pt} + +\def\STRUT{\rule{0pt}{14pt}} +\def\negSTRUT{\rule[-8pt]{0pt}{0pt}} +\def\mSTRUT{\makebox[0pt][l]{\phantom{$\frac00$}}} +\let\vrbnormal\sffamily +\let\uif\sffamily %\makeatletter @@ -70,7 +79,7 @@ subject={Documentation for the eforms and insdljs packages}, talksite={\url{www.acrotex.net}}, version={2.0}, - prepared={2018/12/05}, + prepared={2019/03/16}, preparedLabel={Distribution Dated:}, keywords={LaTeX, hyperref, PDF, exercises, quizzes}, copyrightStatus=True, @@ -80,7 +89,9 @@ %\revisionLabel{Distribution Dated:} \def\AEBBook{\textsl{{Acro\!\TeX} eDucation System Tools: {\LaTeX} for interactive PDF documents}} -\setlength{\marginparwidth}{31.25pt} +\setlength{\marginparwidth}{62.5pt} +%\addtolength{\marginparwidth}{6pt} + \renewcommand\hproportionwebtitle{.75} \universityLayout{fontsize=Large,fontfamily=sffamily} @@ -150,7 +161,8 @@ \def\AcroTeX{Acro\!\TeX} \def\HTML{HTML}\def\FDF{FDF} \def\PDF{PDF}\def\URL{URL} -\let\amtIndent\leftmargini +%\let\amtIndent\leftmargini +\edef\amtIndent{\the\parindent} \def\bNH{\begin{NoHyper}}\def\eNH{\end{NoHyper}} \def\nhnameref#1{\bNH\nameref{#1}\eNH} \def\nhNameref#1{\bNH\Nameref{#1}\eNH} @@ -165,19 +177,21 @@ \newenvironment{aebQuote} {\list{}{\leftmargin\amtIndent}% \item\relax}{\endlist} -\newcommand{\FmtMP}[2][0pt]{\mbox{}\marginpar{% +\def\parboxValign{t} +\newcommand{\FmtMP}[2][0pt]{\mbox{}\marginpar{%\raggedleft \raisebox{.5\baselineskip+#1}{% \expandafter\parbox\expandafter[\parboxValign]% {\marginparwidth}{\aebbkFmtMp#2}}}} \def\aebbkFmtMp{\kern0pt\itshape\small - \ifusebw\color{gray}\else\color{blue}\fi - \raggedleft\hspace{0pt}} + \color{blue}\raggedleft\hspace{0pt}} \def\dps{$\mbox{$\mathfrak D$\kern-.3em\mbox{$\mathfrak P$}% \kern-.6em \hbox{$\mathcal S$}}$} \def\FitItIn{\eq@fititin} \def\endredpoint{\FitItIn{{\large\ifusebw\color{black}\else\color{red}\fi$\blacktriangleleft$}}} -\advance\marginparwidth16pt +\def\pb{pushbutton} + +%\advance\marginparwidth16pt \makeatother @@ -408,11 +422,11 @@ or \textsf{exerquiz} package is used, \textsf{eforms} will use the driver defined in these earlier included packages. \newtopic A minimal document is -\begin{Verbatim}[xleftmargin=\amtIndent] +\begin{Verbatim}[xleftmargin=\amtIndent,commandchars={!()}] \documentclass{article} -\usepackage{eforms} % <-- the driver is pdftex or xetex +\usepackage{eforms} % <--!uif( the driver is pdftex, lualatex, or xetex) \begin{document} - % Content containing form fields, such as... + %!uif( Content containing form fields, such as!dots) Don't \pushButton[\CA{Push Me}]{myButton}{}{12bp}, I fall down easily. \end{document} @@ -422,17 +436,62 @@ and passes it the driver, so there is no need to specify \textsf{hyperref}, usually. If you wish to introduce \textsf{hyperref} yourself with specific options, place it before \textsf{eforms}. -If you use the \textsf{exerquiz} package, \textsf{exerquiz} brings -in the \textsf{eforms} package and passes it to the driver. +If you use the \textsf{exerquiz} package, \textsf{exerquiz} brings in the +\textsf{eforms} package and passes the driver to it. \subsection{The \texttt{preview} option} -Use the \texttt{preview} option if you use a \texttt{dvi} previewer -to view your document. When \texttt{preview} is taken, a frame box -is drawn around any form field created by \textsf{eforms}, making -the position of the field visible in the previewer. This makes it -easy to make any additional adjustments for the position of the -field. Turn off this option when you build a PDF file. +%Use the \texttt{preview} option if you use a \texttt{dvi} previewer +%to view your document. + +When the \opt{preview} option is taken, a frame box is drawn around any form +field created by \pkg{eforms}, making the position of the field visible in +the DVI previewer or {\PDF} viewer. Being see to view the position on a form +element enables you to determine whether any additional adjustments are +needed to the position of the field. \emph{Turn off this option} when you build the +final version of your {\PDF} file. + +This option was originally developed for those using a DVI previewer, it is +also useful for those using PDF creators \app{pdflatex}, \app{xelatex}, or +\app{lualatex}. Modern {\LaTeX} users employ quicker {\PDF} viewers such as \app{sumatraPDF} or +\app{PDF-Exchange}; these PDF viewers do not create form appearances as \app{Adobe Reader} and \app{Acrobat} +do; consequently, an outline of the positions of the fields is most welcome. + +The \texttt{preview} option just sets a switch (\cs{ifpreview}\FmtMP{\cs{ifpreview}}), which can conveniently be +turned off and on using the commands \cs{previewOn}\FmtMP{\cs{previewOn}} and \cs{previewOff} +within the document itself. Related to \cs{previewOn} and \cs{previewOff}\FmtMP{\cs{previewOff}} is +the command \cs{pmcaOn}, covered in the next paragraph. + +\paragraph*{Poor man's captions.}\label{para:pmca} + +The \cs{pushButton} command of \pkg{eforms} produces a push +button;\footnote{Push buttons are covered in Section~\ref{s:BtnFlds}, beginning on +page~\pageref{ss:Pbs}.} a common key to use is the \cs{CA} key, the +value of which captions the button. As a companion to \cs{previewOn}, +\pkg{eforms} defines \cs{pmcaOn}\FmtMP{\cs{pmcaOn}} and +\cs{pmcaOff}\FmtMP{\cs{pmcaOff}}; when \cs{previewOn} is in effect, +expanding \cs{pmcaOn} causes the value of the \cs{CA} key to be typeset into +the {\pb} preview; for example,\bgroup\makeatletter +\def\@PMCA{Push Me}\settowidth{\@tempdima}{\,Push Me\,}\edef\x{\the\@tempdima}% +\def\1{\makebox[0pt][l]{\hskip\linewidth\makebox[0pt][r] +{\previewOff\pmcaOff\pushButton[\autoCenter{n}\CA{Push Me}]{pbDemo}{}{13bp}\quad + \previewOn\pmcaOn\ef@Bbox{\x}{13bp}\hspace{40pt}}}}% +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small,commandchars=!()] +!1\pushButton[\CA{Push Me}]{pbDemo}{}{13bp} +\end{Verbatim} +The button on the left is the normal appearance of the push button after +\app{Reader/Acrobat} has supplied its appearance, the ``button'' on the right +is how the button would appear in \app{sumatraPDF}, for example, just after +{\PDF} creation using \app{pdflatex}, \app{xelatex}, or \app{lualatex}, or in +a DVI previewer after latexing.\egroup + +In the modern era of {\LaTeX}, it is customary by some to use +\app{sumatraPDF} or some other {\PDF} viewer during development; however, you +should always open your final {\PDF} (which was built with +\cs{previewOff}\cs{pmcaOff}) in \app{Adobe Reader DC} (or in \app{Acrobat}), +save it to obtain the correct appearances of the fields placed in the +document. + \subsection{The \texttt{useui} option} @@ -529,13 +588,13 @@ characters that have special meaning to {\LaTeX}, these are \texttt{\string~}, \ and \texttt{\&}; each of these may appear as part of a URL, or may appear in JavaScript code. Within the first parameter, these three character can be used freely, without escaping them. -\subsection{Button Fields} +\subsection{Button Fields}\label{s:BtnFlds} Buttons are form elements that the user interacts with using only a mouse. There are three types of buttons: push buttons, check boxes and radio buttons. -\subsubsection{Push Buttons} +\subsubsection{Push Buttons}\label{ss:Pbs} The push button is a button field that has no value, it is neither on nor off. Generally, push buttons are used @@ -2565,7 +2624,7 @@ format={app.alert("Thank you for signing this field.");} \part{Setting the Tab Order} -The \hypertarget{\pkg{taborder}}{taborderPkg} package is an internal AeB package that is called by +The \hypertarget{taborderPkg}{\pkg{taborder}} package is an internal AeB package that is called by both the \textsf{eforms} and the \texttt{annot\_pro packages}. The \texttt{taborder} package sets the tab order for form fields and link annotations (when the link is created by the command \cs{setLink}, defined @@ -3243,23 +3302,21 @@ file, but saves the contents in a token register. The contents of the register are used in defining a macro that expands to the verbatim listing. -\settowidth{\aebdimen}{\ttfamily\string\begin\darg{defineJS}[\anglemeta{tex/latex\_cmds}]\darg{\meta{Cmd}}} +\settowidth{\aebdimen}{\ttfamily\string\begin\darg{defineJS}[\ameta{chngCats}]\darg{\cs{\ameta{cmd}}}} \begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\begin{defineJS}[!anglemeta(tex/latex_cmds)]{!meta(Cmd)} -... -!anglemeta(JavaScript code) -... +\begin{defineJS}[!ameta(chngCats)]{\!ameta(cmd)} +!qquad!ameta(script) \end{defineJS} \end{dCmd} -\PD The \texttt{defineJS} environment takes two parameters, the -first optional. the required parameter is the command name to be -defined. Use the optional first parameter to modify the verbatim -environment, as illustrated in the example below. The -\texttt{defineJS} is a complete verbatim environment: no escape, and -no comment characters are defined. You can use the optional -parameter to create an escape character. You can pretty much use -any character you wish, \emph{except} the usual one `\verb+\+', +\PD The \texttt{defineJS} environment takes two parameters, the first +optional. the required parameter is the command name to be defined. Use the +optional first parameter (\ameta{chngCats}) to modify the verbatim +environment, as illustrated in the example below. The \ameta{script} is saved +under the command name \cs{\ameta{cmd}}. The \texttt{defineJS} is a complete +verbatim environment: no escape, and no comment characters are defined. You +can use the optional parameter to create an escape character; you can pretty +much use any character you wish, \emph{except} the usual one `\verb+\+', backslash. \Example The following example illustrates the usage of the \texttt{defineJS} environment. @@ -3287,11 +3344,75 @@ console.println("Exiting the button area"); \AAMouseExit{\JS{\JSAAX}}} ]{myButton}{30bp}{15bp} \end{dCmd*} -\newtopic The code of \cs{JSAAE} and \cs{JSAAX} are so simple, the \texttt{defineJS} environment -was really not needed. A simple \cs{newcommand} definition would have been sufficient. +\newtopic The code lines of \cs{JSAAE} and \cs{JSAAX} are so simple, \texttt{defineJS} environment +was really not needed. \newtopic See \Nameref{lengthyJS} for an additional example of the use of the \texttt{defineJS} environment. +The \pkg{insdljs} package defines two ``silent'' versions of \env{defineJS}, +\env{@defineJS} and \env{defineJS*}. +\settowidth{\aebdimen}{\ttfamily\string\begin\darg{@defineJS}[\ameta{chngCats}]\darg{\cs{\ameta{cmd}}}} +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{@defineJS}[!ameta(chngCats)]{\!ameta(cmd)} +!qquad!ameta(script) +\end{@defineJS} +!STRUT!vrbnormal !texttt(defineJS*) is a public version !texttt(@defineJS) +!STRUT\begin{defineJS*}[!ameta(chngCats)]{\!ameta(cmd)} +!qquad!ameta(script) +\end{defineJS*} +\end{dCmd} +\medskip\noindent +Use \env{defineJS*} in the body of the document; the command argument \cs{\ameta{cmd}} can be silently +used and redefined in a later \env{defineJS*} environment. +The \env{@defineJS} environment is for package authors. + +\paragraph*{The \texorpdfstring{{\protect\env{defineJS}}}{defineJS}-type environments with arguments.}\label{para:defineJSwArgs} +%\index{defineJS with arguments@\env{defineJS} with arguments} +The \env{defineJS}-type environments do not have parameters/arguments as +normal environments (or commands) do. To enable the ability to modify the +JavaScript code within the environment of \env{defineJS}, the command pair +\cs{bParams}/\allowbreak\cs{eParams} is defined. +\settowidth{\aebdimen}{\ttfamily\string\bParams\darg{\ameta{token\SUB1}}\darg{\ameta{token\SUB2}}...\darg{\ameta{token\SUB{n}}}\string\eParams} +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\bParams{!ameta(token!SUB1)}{!ameta(token!SUB2)}...{!ameta(token!SUB(n))}\eParams +\end{dCmd} +\medskip\noindent When you use one of the \env{defineJS} environments to define field level +JavaScript, you can include symbolic parameters/arguments \cs{p(1)}, \cs{p(2)}, and so +on, within the body of the environment. At the time of expansion of the +command \cs{\ameta{cmd}}, a substitution is made: \cs{p(1)} expands to +\ameta{token\SUB1}, \cs{p(2)} expands to \ameta{token\SUB1}, and so on. Note +that the argument of \cs{p}, which is only locally defined, is enclosed with +\emph{parentheses}. Before continuing with the discussion, consider the following +example. +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small,commandchars={@^\%}] +\begin{defineJS*}[\catcode`\!=0\relax]{\myCode} +var p1=@textbf^!p(1)%, p2=@textbf^!p(2)%; +app.alert("p1 + p2 = " + Number(p1+p2) ); +\end{defineJS*} +\end{Verbatim} +Within the body of a \env{defineJS} environment, there is no escape character +unless you change catcode of another character within the optional argument +of the \env{defineJS} environment. In the above example, the exclamation mark +is declared as the escape. +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small,commandchars={!()}] +\pushButton[\cmd{!textbf(\bParams{1}{16}\eParams)} + \A{\JS{\myCode}}]{pbfld1}{.5in}{11bp} +\end{Verbatim} +When this button is pressed, an alert message appears `\uif{p1 + p2 = 17}'. +We can reuse this code later with other parameters: +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small,commandchars={!()}] +\pushButton[\cmd{!textbf(\bParams{77}{11}\eParams)} + \A{\JS{\myCode}}]{pbfld2}{.5in}{11bp} +\end{Verbatim} +Now the message is `\uif{p1 + p2 = 88}'. + +In both examples, the special key \cs{cmd} is used to pass the +\cs{bParams}/\allowbreak\cs{eParams} command pair into \pkg{eforms}' parsing +stream; this keeps the declaration local. The \hyperlink{cmd}{\cs{cmd}} key is described in +\hyperref[supportedKVs]{Appendix~\ref*{supportedKVs}}, titled `\nameref{supportedKVs}', beginning on \pageref*{supportedKVs}; specifically, +\cs{cmd} is listed in under the heading \textcolor{blue}{Specialized, non-PDF Spec commands}. + + \newpage %\appendix \markright{Appendix} @@ -3376,7 +3497,7 @@ FfRichText? & rich text (PDF 1.5) & text\\ \newpage -\appendixsubsection{Supported Key Variables} +\appendixsubsection{Supported Key Variables}\label{supportedKVs} %\addcontentsline{toc}{appendixsubsection}{\protect\numberline{}Supported Key Variables} Below is a list of the keys supported for modifying the appearance @@ -3539,7 +3660,7 @@ Lock? & This key is used to lock fields after the signature field is &\verb+\Lock{}+\\\hline %------------------------------------------------------------------- %\pagebreak -\multicolumn{3}{l}{\color{blue}Specialized, non-PDF Spec, commands:}\\ +\multicolumn{3}{l}{\color{blue}Specialized, non-PDF Spec commands:}\\ rawPDF? & \texttt{\darg{\ameta{PDF-KVPs}}} If all else fails, you can always introduce key-value pairs through this variable. &\verb+\rawPDF{}+\\ autoCenter? &\texttt{\darg{y|n}} There is a centering code that attempts to give a pleasant @@ -3558,6 +3679,8 @@ symbolchoice? & \texttt{\darg{\ameta{symbol-choice}}} Use this variable to speci be used to globally change the symbol choice as well; for example, \verb+\symbolchoice{check}+, which is the default value.\\ +cmd? &\texttt{\darg{\ameta{cmd-args}}} Passes its argument into the key-value parsing stream, refer +to page~\pageref{para:defineJSwArgs} for an example.\\ linktxtcolor? & \texttt{\darg{\ameta{named-color{\upshape|empty}}}} The value of this variable is a named color and is the color of the link text. Only recognized in link annotations. A value of diff --git a/texmf-dist/doc/latex/acrotex/examples/README.md b/texmf-dist/doc/latex/acrotex/examples/README.md index 357ccb88..d56ccff2 100644 --- a/texmf-dist/doc/latex/acrotex/examples/README.md +++ b/texmf-dist/doc/latex/acrotex/examples/README.md @@ -24,4 +24,4 @@ The AcroTeX Blog (http://www.acrotex.net/blog/) is a great resource for all thin AeB and PDF. Don Story -2016/01/29 +2019/05/21 diff --git a/texmf-dist/doc/latex/acrotex/examples/jquiztst.pdf b/texmf-dist/doc/latex/acrotex/examples/jquiztst.pdf Binary files differindex 7a3dff6c..3f604225 100644 --- a/texmf-dist/doc/latex/acrotex/examples/jquiztst.pdf +++ b/texmf-dist/doc/latex/acrotex/examples/jquiztst.pdf diff --git a/texmf-dist/doc/latex/acrotex/examples/jquiztst.tex b/texmf-dist/doc/latex/acrotex/examples/jquiztst.tex index b3185c1c..c1148c82 100644 --- a/texmf-dist/doc/latex/acrotex/examples/jquiztst.tex +++ b/texmf-dist/doc/latex/acrotex/examples/jquiztst.tex @@ -3,7 +3,6 @@ \usepackage{graphicx} \usepackage [tight, -% dvips, % <- replace with any supported driver designi,%forpaper, navibar ]{web} @@ -27,8 +26,6 @@ Department of Mathematics} %\useBeginQuizButton[\textColor{blue}] \useEndQuizButton[\textColor{blue}] - - % Uncomment this line to require the student % to answer all questions in the quiz before % the quiz is evaluated. @@ -49,7 +46,7 @@ Department of Mathematics} \begin{document} \maketitle -%\tableofcontents +\tableofcontents \section{Math Fill-In Question} @@ -163,13 +160,15 @@ Practice by typing in the answer: \noindent$\dfrac{\text{d}}{\text{d}x} {(x^4 + 1)^{1/2}} = \eqsanitize \underset{\text{\rotatebox{-45}{\rlap{The Response Box}}}} - {\underbrace{\STRUT\efKern{1bp}{0bp}\RespBoxMath{2*x^3*(x^4+1)^(-1/2)}{4}{.0001}{[1,2]}\relax\efKern{1bp}{0bp}}}\kern-1bp + {\underbrace{\STRUT\efKern{1bp}{0bp} + \RespBoxMath{2*x^3*(x^4+1)^(-1/2)}{4}{.0001}{[1,2]}\relax\efKern{1bp}{0bp}}}\kern-1bp \underset{\text{\rotatebox{-45}{\rlap{Answer Button}}}} {\underbrace{\STRUT\efKern{1bp}{0bp}\CorrAnsButton{2*x^3*(x^4+1)^(-1/2)}\efKern{1bp}{0bp}}}\kern-1bp \underset{\text{\rotatebox{-45}{\rlap{Num.\ of incorrect tries}}}} {\underbrace{\STRUT\efKern{1bp}{0bp}\sqTallyBox\relax\efKern{1bp}{0bp}}}\olBdry\efKern{-1bp}{0bp}\sqClearButton$ \end{oQuestion} + \vspace{5\bigskipamount} When a correct answer is input into the response box, the color of @@ -278,7 +277,7 @@ the power rule: In the syntax of this document, \js{2*x*e^(x^2)}. \end{solution} \end{questions} -\end{quiz}\quad\ScoreField\currQuiz\olBdry\eqButton\currQuiz +\end{quiz}\quad\ScoreField\currQuiz\olBdry\CorrButton\currQuiz \noindent Answers: \AnswerField\currQuiz diff --git a/texmf-dist/doc/latex/acrotex/examples/jtxttst.pdf b/texmf-dist/doc/latex/acrotex/examples/jtxttst.pdf Binary files differindex 2d034bfd..8638f825 100644 --- a/texmf-dist/doc/latex/acrotex/examples/jtxttst.pdf +++ b/texmf-dist/doc/latex/acrotex/examples/jtxttst.pdf diff --git a/texmf-dist/doc/latex/acrotex/examples/jtxttst.tex b/texmf-dist/doc/latex/acrotex/examples/jtxttst.tex index eb2747e4..4d78e086 100644 --- a/texmf-dist/doc/latex/acrotex/examples/jtxttst.tex +++ b/texmf-dist/doc/latex/acrotex/examples/jtxttst.tex @@ -152,7 +152,7 @@ Answer each of the following. Passing is 100\%. \item Who was the first president of the United States?\par\kern3pt\noindent \RespBoxTxt{0}{0}[geow]{4}{George Washington}{Washington}{G. Washington}{Geo. Washington}\hfill -\CorrAnsButton{George Washington}\kern1bp\sqTallyBox +\CorrAnsButton{George Washington}\cgBdry\sqTallyBox \begin{solution} Yes, George Washington was the first President of the United States of America. @@ -161,7 +161,7 @@ States of America. \item Name \emph{one} of the two people recognized as a founder of Calculus.\par\kern3pt\noindent \RespBoxTxt{2}{0}{5}{Isaac Newton}{Newton}{I. Newton}{Gottfried Leibniz}{Leibniz}\hfill -\CorrAnsButton{Isaac Newton or Gottfried Leibniz}\kern1bp\sqTallyBox +\CorrAnsButton{Isaac Newton or Gottfried Leibniz}\olBdry\sqTallyBox \item If $f$ is differentiable, then $f$ is continuous. \begin{answers}{4} @@ -171,17 +171,17 @@ Calculus.\par\kern3pt\noindent \item \dPose {4 x^{-1/2}}\RespBoxMath{-2*pow(x,-3/2)}{4}{.0001}{[1,2]}\hfill -\CorrAnsButton{-2*x^(-3/2)}\kern1bp\sqTallyBox +\CorrAnsButton{-2*x^(-3/2)}\olBdry\sqTallyBox \item $\displaystyle\int \frac 1x\,dx = $\space \RespBoxMath{ln(abs(x))}{4}{.0001}{[1,2]}[indefCompare]\hfill -\CorrAnsButton{ln(|x|)}\kern1bp\sqTallyBox +\CorrAnsButton{ln(|x|)}\olBdry\sqTallyBox \end{questions} \end{shortquiz} \begin{flushright} -\sqClearButton\kern1bp\sqTallyTotal +\sqClearButton\olBdry\sqTallyTotal \end{flushright} \newpage @@ -229,7 +229,7 @@ Oh, come on now. You know that $\cos(\pi)=-1$. \end{solution} \end{questions} -\end{quiz}\quad\ScoreField\currQuiz\eqButton\currQuiz +\end{quiz}\quad\ScoreField\currQuiz\olBdry\CorrButton\currQuiz \noindent Answers: \AnswerField\currQuiz diff --git a/texmf-dist/doc/latex/acrotex/examples/webeqtst.pdf b/texmf-dist/doc/latex/acrotex/examples/webeqtst.pdf Binary files differindex f3a8c054..c3cd4090 100644 --- a/texmf-dist/doc/latex/acrotex/examples/webeqtst.pdf +++ b/texmf-dist/doc/latex/acrotex/examples/webeqtst.pdf diff --git a/texmf-dist/doc/latex/acrotex/examples/webeqtst.tex b/texmf-dist/doc/latex/acrotex/examples/webeqtst.tex index 0d0634ec..eb9b806a 100644 --- a/texmf-dist/doc/latex/acrotex/examples/webeqtst.tex +++ b/texmf-dist/doc/latex/acrotex/examples/webeqtst.tex @@ -1,7 +1,7 @@ \documentclass{article} \usepackage{amsmath} \usepackage[tight,designvi]{web} -\usepackage[nosolutions]{exerquiz} +\usepackage{exerquiz} \title{\texorpdfstring{Acro\!\TeX}{AcroTeX} eDucation Bundle \texorpdfstring{\\[1ex]}{:}Exercises and Quizzes} @@ -397,7 +397,7 @@ is 100\%. \Ans0 Knuth &\Ans1 Lamport &\Ans0 Carlisle &\Ans0 Rahtz \end{answers} \end{questions} -\end{quiz}\quad\ScoreField\currQuiz\eqButton\currQuiz +\end{quiz}\quad\ScoreField\currQuiz\CorrButton\currQuiz \medskip We can obtain the forms-style quiz simply by inserting an \texttt* @@ -428,7 +428,7 @@ Yes, it was Donald Knuth who first created \TeX. Yes, it was Leslie Lamport who first created \TeX. \end{solution} \end{questions} -\end{quiz*}\quad\ScoreField\currQuiz\eqButton\currQuiz +\end{quiz*}\quad\ScoreField\currQuiz\CorrButton\currQuiz The ``corrections'' button can be modified to fit your needs. The quiz below queries your knowledge of the people who maintain various freeware @@ -452,8 +452,8 @@ is 100\%. \end{answers} \end{questions} \end{quiz*}\quad -\ScoreField{qzTeXc}% - \eqButton[\BC{0 0 1} % blue border color +\ScoreField{qzTeXc}\cgBdry\relax + \CorrButton[\BC{0 0 1} % blue border color \CA{TeX} % Button text \RC{Users} % rollover text \AC{Group} % pushed text diff --git a/texmf-dist/source/latex/acrotex/eforms.dtx b/texmf-dist/source/latex/acrotex/eforms.dtx index b7fecae8..c74dea98 100644 --- a/texmf-dist/source/latex/acrotex/eforms.dtx +++ b/texmf-dist/source/latex/acrotex/eforms.dtx @@ -16,7 +16,7 @@ %</copyright> %<package>\NeedsTeXFormat{LaTeX2e} %<package>\ProvidesPackage{eforms} -%<package> [2018/11/27 v2.9.22 Provides general eforms support (dps)] +%<package> [2019/03/16 v2.10 Provides general eforms support (dps)] %<*driver> \documentclass{ltxdoc} \usepackage[colorlinks,hyperindex=false]{hyperref}[2012/10/12] @@ -193,6 +193,7 @@ % of \cs{ifpreview}.} % \begin{macrocode} \DeclareOption{preview}{\previewtrue} +\let\insjs@opts\@empty \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{insdljs}} \@ifundefined{ifpreview}{\newif\ifpreview\previewfalse}{} % \end{macrocode} @@ -273,7 +274,7 @@ % \changes{v2.9a}{2016/06/09}{Change in \string\textsf{insdljs} package} % \changes{v2.9g}{2017/01/03}{Change in \string\textsf{insdljs} package} % \begin{macrocode} -\RequirePackage{insdljs}[2017/01/03] % incl conv-xkv +\RequirePackage{insdljs}[2019/02/11] % incl conv-xkv % \end{macrocode} % \changes{v1.0a}{2006/10/03} % { @@ -298,7 +299,7 @@ } \let\ef@YES=y \let\ef@NO=n \let\ef@One=1 \let\ef@Zero=0 -\ifnum\eq@drivername<2 +\ifnum\eq@drivername<2\relax \let\to@usepdfmark\ef@One \RequirePackage[structure]{taborder}\else \let\to@usepdfmark\ef@Zero @@ -341,14 +342,32 @@ % \string\cs{ckboxColor}} % \begin{macrocode} \providecommand\ckboxColor[1]{\def\@rgi{#1}\ifx\@rgi\@empty - \let\ckbox@Color\relax\else - \def\ckbox@Color{\color{#1}}\fi}\let\ckbox@Color\relax + \let\ckbox@Color\relax\else + \def\ckbox@Color{\color{#1}}\fi}\let\ckbox@Color\relax +% \end{macrocode} +% The \DescribeMacro\ef@Bbox\cs{ef@Bbox} command places a rule of width +% \DescribeMacro\efPreviewOnRule\cs{efPreviewOnRule}. When the specified +% dimensions of the bounding rectangle is less than \texttt{2\cs{fboxrule}}, +% we \emph{do not} reduce the dimensions; otherwise, we reduce the width and height +% by \texttt{2\cs{fboxrule}}, this is an attempt to have the preview dimensions +% to correspond to the dimensions of the form field. Following this definition +% \cs{ef@Bbox} is let to \cs{Bbox}. +% \begin{macrocode} +\def\efPreviewOnRule{0.4pt} +\def\PMCA#1{\def\@rgi{#1}\ifx\@rgi\@empty + \let\@PMCA\@empty\else\def\@PMCA{\hb@xt@\z@{\hss#1\hss}}\fi} +\let\@PMCA\@empty \def\ef@Bbox#1#2{\hbox{\ifpreview - \setlength\fboxrule{0.4pt}\setlength\fboxsep{0pt}% - \@tempdima=#1\advance\@tempdima by-\fboxrule - \@tempdimb=#2\advance\@tempdimb by-\fboxrule \ckbox@Color - \fbox{\parbox[b][\@tempdimb][c]{\@tempdima}{\hfill\vfill}}\else - \parbox[b][#2][c]{#1}{\hfill\vfill}\fi}% + \setlength\fboxrule{\efPreviewOnRule}\setlength\fboxsep{0pt}% + \@tempdima=#1\relax + \ifdim\@tempdima<2\fboxrule\else + \advance\@tempdima by-2\fboxrule\fi + \@tempdimb=#2\relax + \ifdim\@tempdimb<2\fboxrule\else + \advance\@tempdimb by-2\fboxrule\fi + \ckbox@Color\fbox{\parbox[b][\@tempdimb][c]{\@tempdima}% + {\vfil\hfil\@PMCA\hfil\vfil}}\else + \parbox[b][#2][c]{#1}{\vfil\hfil\hfil\vfil}\fi}% } \let\Bbox\ef@Bbox %</package> @@ -402,17 +421,17 @@ % \begin{macrocode} \let\ef@passedArgs\@empty \def\processAppArgs#1#2{% - \ifx\end#1% if #1=\end, #2=\@nil. - \let\ef@next\relax - \else + \ifx\end#1% if #1=\end, #2=\@nil. + \let\ef@next\relax + \else % \end{macrocode} % If a token has a value of \cs{@empty} then it has been protected. It is skipped % and there is no user redefinition of that form field attribute allowed. Normally, % this is done for \cs{A} and \cs{AA} to prevent overwriting critical functionality. % \begin{macrocode} - \ifx#1\@empty - \def\ef@next{\processAppArgs}% - \else + \ifx#1\@empty + \def\ef@next{\processAppArgs}% + \else % \end{macrocode} % This is the user interface to the new optional argument of links and forms. If % the key is \cs{ui}, we pass its argument to |\setkeys{eforms}{#2}| to process @@ -420,73 +439,81 @@ % \texttt{fieldflags}, we pass those back to this stream to be analyzed the special cases % that follow for |\F| and |\Ff|. % \begin{macrocode} - \@getCmdName{\ui}\edef\arg@ui{\@CmdName}% - \@getCmdName{#1}% - \ifx\arg@ui\@CmdName - \@ifundefined{@equi}{\PackageError{eforms}% - {The user interface '\string\ui' is not defined!% - \MessageBreak Use the useui option of eforms - and try again}{I said, use the useui option of - eforms and try again!}}{}% - \def\ef@next{\setkeys{eforms}{#2}% - \processAppArgs\presets{\ef@passedArgs}}% - \else + \@getCmdName{\ui}\edef\arg@ui{\@CmdName}% + \@getCmdName{#1}% + \ifx\arg@ui\@CmdName + \@ifundefined{@equi}{\PackageError{eforms}% + {The user interface '\string\ui' is not defined!% + \MessageBreak Use the useui option of eforms + and try again}{I said, use the useui option of + eforms and try again!}}{}% + \def\ef@next{\setkeys{eforms}{#2}% + \processAppArgs\presets{\ef@passedArgs}}% + \else % \end{macrocode} % If current key is |\Ff|, we add its value to the current value of |\Ff|. % We basically are `or-ing' the new value with the old value in the bit field. % \begin{macrocode} - \@getCmdName{\Ff}\edef\arg@Ff{\@CmdName}% - \@getCmdName{#1}% - \ifx\arg@Ff\@CmdName % if \Ff, let's add arguments - \ifx\eq@Ff\@empty\def\eq@FfValue{0}\else - \expandafter\getFfValue\eq@Ff\@nil\fi - \@tempcnta=\eq@FfValue - \def\eq@arg{#2}% - \ifx\eq@arg\@empty\else - \advance\@tempcnta by#2\fi - \edef\eq@Ff{/Ff \the\@tempcnta}% - \def\ef@next{\processAppArgs}% - \else + \@getCmdName{\Ff}\edef\arg@Ff{\@CmdName}% + \@getCmdName{#1}% + \ifx\arg@Ff\@CmdName % if \Ff, let's add arguments + \ifx\eq@Ff\@empty\def\eq@FfValue{0}\else + \expandafter\getFfValue\eq@Ff\@nil\fi + \@tempcnta=\eq@FfValue + \def\eq@arg{#2}% + \ifx\eq@arg\@empty\else + \advance\@tempcnta by#2\fi + \edef\eq@Ff{/Ff \the\@tempcnta}% + \def\ef@next{\processAppArgs}% + \else % \end{macrocode} % If current key is |\F|, we add its value to the current value of |\F|. % We basically are ```or-ing'' new value with the old value in the bit field. % \begin{macrocode} - \@getCmdName{\F}\edef\arg@F{\@CmdName}% - \@getCmdName{#1}% - \ifx\arg@F\@CmdName % if \Ff, let's add arguments - \ifx\eq@F\@empty\def\eq@FValue{0}\else - \expandafter\getFValue\eq@F\@nil\fi - \@tempcnta=\eq@FValue - \def\eq@arg{#2}% - \ifx\eq@arg\@empty\else - \advance\@tempcnta by#2\fi - \edef\eq@F{/F \the\@tempcnta}% - \def\ef@next{\processAppArgs}% - \else + \@getCmdName{\F}\edef\arg@F{\@CmdName}% + \@getCmdName{#1}% + \ifx\arg@F\@CmdName % if \Ff, let's add arguments + \ifx\eq@F\@empty\def\eq@FValue{0}\else + \expandafter\getFValue\eq@F\@nil\fi + \@tempcnta=\eq@FValue + \def\eq@arg{#2}% + \ifx\eq@arg\@empty\else + \advance\@tempcnta by#2\fi + \edef\eq@F{/F \the\@tempcnta}% + \def\ef@next{\processAppArgs}% + \else % \end{macrocode} % If the key we are processing is \cs{presets}, then use \cs{expandafter} to % expand its argument (it is assumed the argument is a macro), then put it back % into the input stream. % \begin{macrocode} - \@getCmdName{\presets}% - \edef\arg@presets{\@CmdName}\@getCmdName{#1}% - \ifx\arg@presets\@CmdName - \def\ef@next{\expandafter\processAppArgs#2}% - \else + \@getCmdName{\presets}% + \edef\arg@presets{\@CmdName}\@getCmdName{#1}% + \ifx\arg@presets\@CmdName + \def\ef@next{\expandafter\processAppArgs#2}% + \else + \@getCmdName{\epresets}% + \edef\arg@epresets{\@CmdName}\@getCmdName{#1}% + \ifx\arg@epresets\@CmdName + \def\ef@next{\let\protect\noexpand + \edef\x{#2}\set@typeset@protect\expandafter + \processAppArgs\x}% dps27 + \else % \end{macrocode} % This is the last, and the most frequent case. We process a common key, one % that is not |\presets|, |\ui|, |\Ff| or |\F|. % \begin{macrocode} - \csname @eq% - \expandafter\@gobble\string#1\endcsname{#2}% - \def\ef@next{\processAppArgs}% - \fi - \fi - \fi + \csname @eq% + \expandafter\@gobble\string#1\endcsname{#2}% + \def\ef@next{\processAppArgs}% + \fi \fi + \fi \fi + \fi \fi - \ef@next + \fi + \ef@next } % \end{macrocode} % Process the field defaults and the `every' changes. Build up the required command @@ -543,6 +570,7 @@ \fi } % \end{macrocode} +% % \subsection{eForm Variables}\label{eformvariables} % % \subsubsection{Key-Value Definitions} @@ -583,10 +611,13 @@ % Added a \string\cs{presets} key to make it easier to dynamically change options% % } % -% \noindent\DescribeMacro{\presets} We define the \texttt{presets} key. The argument of presets is a macro, that is -% expanded and put back into the parsing stream. +% \noindent\DescribeMacro{\presets} We define the \cs{presets} key. The argument of presets is a macro, that is +% expanded and put back into the parsing stream. The \DescribeMacro{\epresets}\cs{epresets} keys is used +% when the properties are to be expanded early. (properties need to be protected \cs{protect}\cs{BG}) +% \changes{v2.9.23}{2019/01/22}{Added \string\cs{epresets} key} % \begin{macrocode} \def\@eqpresets#1{#1}% +\def\@eqepresets#1{#1} % \end{macrocode} % \DescribeMacro{\W} The width of the boundary line. % \begin{macrocode} @@ -875,9 +906,19 @@ \let\eq@AAvalidate\@empty\else \def\eq@AAvalidate{/V<<\JS{#1}>>}\fi} \let\eq@AAvalidate\@empty +% \end{macrocode} +%Additional calculate code, used to add on prior to the user's code +%\changes{v2.9.23}{2019/01/22}{Added \string\cs{AddAAcalculate}} +% \begin{macrocode} +\def\@eqAddAAcalculate#1{\def\eq@arg{#1}\ifx\eq@arg\@empty + \else\def\eq@AAcalculate{;}\fi\def\eq@AddAAcalculate{#1}} +\let\eq@AddAAcalculate\@empty \def\@eqAAcalculate#1{\def\eq@arg{#1}\ifx\eq@arg\@empty - \let\eq@AAcalculate\@empty\else\isCalculatetrue - \def\eq@AAcalculate{/C<<\JS{#1}>>}\fi} + \let\eq@AAcalculate\@empty\else\isCalculatetrue + \ifx\eq@AAcalculate\ef@semicolon + \def\eq@AAcalculate{/C<<\JS{\eq@AddAAcalculate}>>}\else + \def\eq@AAcalculate{/C<<\JS{\eq@AddAAcalculate#1}>>}\fi\fi +} \let\eq@AAcalculate\@empty % \end{macrocode} % \begin{macro}{AApageopen} @@ -1336,6 +1377,12 @@ % \begin{macrocode} \def\@eqrawPDF#1{\def\eq@rawPDF{#1}}\def\eq@rawPDF{} % \end{macrocode} +% An experimental key, used to insert (localalized) definitions or declarations +% into the key-value processor +% \changes{v2.10}{2019/03/16}{added the key \string\cs{cmd}} +% \begin{macrocode} +\def\@eqcmd#1{#1} +% \end{macrocode} % The following is in support for multi-line links % \begin{macrocode} % \end{macrocode} @@ -1532,11 +1579,33 @@ \def\@eqmlcrackinsat#1{\def\eq@mlcrackinsat{#1}} \let\eq@mlcrackinsat\@empty % \end{macrocode} -% \DescribeMacro{\protect} A protect feature for protecting a key from begin changed +% \DescribeMacro{\protect} A key for protecting a key from begin changed % by the user through the optional arguments. % \begin{macrocode} \def\eq@protect#1{\let#1\@empty} % \end{macrocode} +% \leavevmode +% \DescribeMacro{\protectedKeys}\hskip-\marginparsep\texttt{\darg{\ameta{cmd-name}}\darg{\ameta{KV-pairs}}} +% is a key that protects each key in a \pkg{eforms} key-value list; eg, it replaces +% \cs{BG\darg{red}} with \cs{protect\cs{BG\darg{red}}}. The results are saved under the command +% name \cs{\ameta{cmd-name}}. Designed to be used with the \cs{epresets} key, which expands its arguments +% early; the keys are not defined so we prevent them from expanding prior to being passed to +% the parsing mechanism. \cs{protectedKeys} is used in the \pkg{bargraph-js} package. +% \changes{v2.10}{2019/03/16}{Added \string\cs{protectedKeys}} +% \begin{macrocode} +\def\ef@stop{\relax} %\def\ef@relax{\relax} +\def\protectedKeys#1#2{\ef@scratchtoks={}% + \@ifundefined{#1}{}{\PackageWarning{eforms} + {Be aware command name #1 is already\MessageBreak + in use}}\protectedKeys@gettwo#2\ef@stop\relax + \expandafter\edef\csname #1\endcsname{\the\ef@scratchtoks}} +\def\protectedKeys@gettwo#1#2{% + \ifx#1\ef@stop\else\ef@scratchtoks=\expandafter + {\the\ef@scratchtoks\protect#1{#2}}\expandafter + \protectedKeys@gettwo + \fi} +% \end{macrocode} +% % \subsubsection{Support for Hex escapes in PDF names} % \changes{v2.9p}{2017/10/10}{rework the support for Hex escapes in PDF names} % \begin{macrocode} @@ -1825,6 +1894,7 @@ %</hexoctcodes> %<*package> % \end{macrocode} +% % \subsubsection{Parsing PDF Color} % % The command is called by the \cs{textColor} key of a form field, @@ -1951,6 +2021,7 @@ % \end{macrocode} % % \subsection{Support for setting the calculation order} +% % The command \cs{calcOrder}\DescribeMacro{\calcOrder} set the order of calculation % of all calculation fields listed in this comma delimited list. %\begin{verbatim} @@ -2087,7 +2158,9 @@ % \end{macro} % \end{macro} % \end{macro} +% %\subsubsection{Saving Paths} +% % \begin{macro}{\definePath} % A convenience command for saving a path or an URL, usage, %\begin{verbatim} @@ -2240,64 +2313,76 @@ % \begin{macrocode} %\def\ef@btnspcr{\ } \def\ef@btnspcr{} -\def\eq@setButtonProps#1#2{% - \makeJSspecials - \processAppArgs#2\end\@nil % set widget properties +% \end{macrocode} +% For those that do not use Adobe Acrobat products (AA/AR), we offer a `poor man's' +% alternative. When \cs{previewOn} is active, outlines of the form fields are seen +% (been around for years); when \cs{pmcaOn} is active, the caption of the push buttons +% are typeset into the document, centered within the buttons. If opened in AR, AR will +% supply an appearance and these typeset captions are not seen. +%\changes{v2.10}{2019/03/16}{Added \string\cs{pmcaOn} and \string\cs{pmcaOff}} +% \begin{macrocode} +\@ifundefined{ifefpmca}{\newif\ifefpmca\efpmcafalse}{} +\def\pmcaOn{\efpmcatrue} +\def\pmcaOff{\efpmcafalse} +\def\eq@setButtonProps#1#2{\makeJSspecials + \processAppArgs#2\end\@nil % set widget properties % \end{macrocode} % Coordinate the values of \cs{BC} and \cs{W}, if one is empty % the other is too. % \changes{v2.9f}{2017/01/01}{BC=empty iff W=0 or empty} % \begin{macrocode} - \ifx\eq@BC\@empty\@eqW{}\else - \if\eq@W@value0\let\eq@BC\@empty\fi\fi - \Hy@pdfstringfalse - \ifx\eq@rectW\@empty - \ifnum\eq@textSize=0 \else + \ifx\eq@BC\@empty\@eqW{}\else + \if\eq@W@value0\let\eq@BC\@empty\fi\fi + \Hy@pdfstringfalse + \ifx\eq@rectW\@empty + \ifnum\eq@textSize=0 \else % \end{macrocode} % If rectW is nonempty, and textSize is not zero, we calculate with -% width of the caption on the button by first adjusting the for size +% width of the caption on the button by first adjusting the font size % to properly gauge the width of the text. This may not be really accurate % because the font used by tex will no doubt be different from the font used % by the button. % \begin{macrocode} - \dimen@=\eq@textSize bp - \dimen@1.00375\dimen@ - \edef\eq@textSize@pt{\strip@pt\dimen@}% - \fontsize{\eq@textSize@pt}{0}\selectfont - \fi + \dimen@=\eq@textSize bp + \dimen@1.00375\dimen@ + \edef\eq@textSize@pt{\strip@pt\dimen@}% + \fontsize{\eq@textSize@pt}{0}\selectfont + \fi % \end{macrocode} % If the button is beveled, we pad the width by 2 times the width of the border, % the beveled edge taking up a width approx equal to the border. % \begin{macrocode} - \dimen@\eq@W@value bp - \def\eq@S@B{B}\ifx\eq@S@value\eq@S@B - \def\eq@btn@sp{\hbox to2\dimen@{\hfill}}% - \else - \def\eq@btn@sp{\hbox to\dimen@{\hfill}}% - \fi - \expandafter\def\expandafter - \ef@btnspcr\expandafter{\ef@btnspcr\eq@btn@sp}% - \sbox{\eq@tmpbox}{\ef@btnspcr\eq@CA\ef@btnspcr}% - \eq@tmpdima=\wd\eq@tmpbox - \sbox{\eq@tmpbox}{\ef@btnspcr\eq@RC\ef@btnspcr}% - \ifdim\eq@tmpdima>\wd\eq@tmpbox\else - \eq@tmpdima=\wd\eq@tmpbox\fi% - \sbox{\eq@tmpbox}{\ef@btnspcr\eq@AC\ef@btnspcr}% - \ifdim\eq@tmpdima>\wd\eq@tmpbox\else - \eq@tmpdima=\wd\eq@tmpbox\fi + \dimen@\eq@W@value bp + \def\eq@S@B{B}\ifx\eq@S@value\eq@S@B + \def\eq@btn@sp{\hbox to2\dimen@{\hfill}}% + \else + \def\eq@btn@sp{\hbox to\dimen@{\hfill}}% + \fi + \expandafter\def\expandafter + \ef@btnspcr\expandafter{\ef@btnspcr\eq@btn@sp}% + \sbox{\eq@tmpbox}{\ef@btnspcr\eq@CA\ef@btnspcr}% + \eq@tmpdima=\wd\eq@tmpbox + \sbox{\eq@tmpbox}{\ef@btnspcr\eq@RC\ef@btnspcr}% + \ifdim\eq@tmpdima>\wd\eq@tmpbox\else + \eq@tmpdima=\wd\eq@tmpbox\fi% + \sbox{\eq@tmpbox}{\ef@btnspcr\eq@AC\ef@btnspcr}% + \ifdim\eq@tmpdima>\wd\eq@tmpbox\else + \eq@tmpdima=\wd\eq@tmpbox\fi % \end{macrocode} % (2017/01/22) If X-like, increase by 2bp % \changes{v2.9k}{2017/01/22}{If X-like, increase by 2bp} % \begin{macrocode} - \ifmakePDasX\advance\eq@tmpdima2bp\fi - \wd\eq@tmpbox=\eq@tmpdima - \else - \wd\eq@tmpbox=\eq@rectW - \fi + \ifmakePDasX\advance\eq@tmpdima2bp\fi + \wd\eq@tmpbox=\eq@tmpdima + \else % if \eq@rectW is not \@empty + \wd\eq@tmpbox=\eq@rectW + \fi % \end{macrocode} -% (2016/12/22) \cs{ef@djXPD} adjusts the size of the field dimensions, if \cs{makeXasPD} is true. +% (2016/12/22) \cs{ef@djXPD} adjusts the size of the field dimensions, if \cs{makeXasPD} is true.\\ +% (2019/03/16) Insert \cs{PMCA} if \cs{if@efpmca} is true. +% \changes{v2.10}{2019/03/16}{Insert \string\cs{PMCA} if \string\cs{if@efpmca} is true} % \begin{macrocode} - \ef@djXPD#1% dps 12/22 + \ifefpmca\PMCA{\eq@CA}\fi\ef@djXPD#1% } % \end{macrocode} % \end{macro} @@ -2310,22 +2395,21 @@ % #2 are the widget properties %\end{verbatim} % \begin{macrocode} -\def\eq@setWidgetProps#1#2{% - \makeJSspecials - \processAppArgs#2\end\@nil % set widget properties +\def\eq@setWidgetProps#1#2{\makeJSspecials + \processAppArgs#2\end\@nil % set widget properties % \end{macrocode} % Coordinate the values of \cs{BC} and \cs{W}, if one is empty % the other is too. This rule does not apply to links. % \changes{v2.9f}{2017/01/01}{BC=empty iff W=0 or empty} % \begin{macrocode} - \ifx\annot@type@link\annot@type\else - \ifx\eq@BC\@empty\@eqW{}\else - \if\eq@W@value0\let\eq@BC\@empty\fi\fi - \fi + \ifx\annot@type@link\annot@type\else + \ifx\eq@BC\@empty\@eqW{}\else + \if\eq@W@value0\let\eq@BC\@empty\fi\fi + \fi % \end{macrocode} % (2016/12/22) \cs{ef@djXPD} adjusts the size of the field dimensions, if \cs{makeXasPD} is true. % \begin{macrocode} - \ef@djXPD#1% dps 12/22 + \ef@djXPD#1% } % \end{macrocode} % \end{macro} @@ -2378,7 +2462,7 @@ % contiguous (cg). % \changes{v2.9d}{2016/12/22}{Added \string\cs{olBdry} and\string\cs{cgBdry}} % \begin{macrocode} -\newcommand\olBdry{\bgroup\ifxetex % dps 12/22 +\newcommand\olBdry{\bgroup\ifxetex \@tempdima-\g@eq@W@value@bp\relax \edef\@mtkern{\the\@tempdima}\else \@tempdima2bp\relax\advance\@tempdima-\g@eq@W@value@bp\relax % 12/26 @@ -2405,13 +2489,13 @@ \everypar{{\setbox\z@\lastbox}\clubpenalty\@M \everypar=\expandafter{\the\ef@scratchtoks}}} \newcommand\volBdry{\bgroup\parskip0pt\relax\@@par\nointerlineskip - \olBdry\egroup\efSupprIndent} + \olBdry\egroup\efSupprIndent} \newcommand\vcgBdry{\@ifstar{\edef\ef@offset{\the\parskip}\vcgBdry@i} - {\def\ef@offset{0pt}\vcgBdry@i}} + {\def\ef@offset{0pt}\vcgBdry@i}} \newcommand\vcgBdry@i[1][0bp]{\bgroup - \setlength{\ef@dimena}{#1-\ef@offset}\parskip0pt\relax - \par\nointerlineskip\cgBdry[\ef@dimena]% - \egroup\ignorespaces\efSupprIndent} + \setlength{\ef@dimena}{#1-\ef@offset}\parskip0pt\relax + \par\nointerlineskip\cgBdry[\ef@dimena]% + \egroup\ignorespaces\efSupprIndent} % \end{macrocode} % % \subsection{Choice Fields}\label{choice} @@ -2419,20 +2503,20 @@ % This is the form template used for all choice fields, list box and combo box. % \begin{macrocode} \def\common@choiceCode{% - /Subtype/Widget - /T (\Fld@name) - /FT/Ch - \eq@Ff - \eq@F - \eq@TU - \eq@TI - /BS << \eq@W\eq@S >> - /MK <<\eq@R\eq@BC\eq@BG\eq@mkIns>> - /DA (\eq@DA) - /Opt [\eq@Opt] - \eq@DV\eq@V - \eq@A\eq@AA - \eq@rawPDF + /Subtype/Widget + /T (\Fld@name) + /FT/Ch + \eq@Ff + \eq@F + \eq@TU + \eq@TI + /BS << \eq@W\eq@S >> + /MK <<\eq@R\eq@BC\eq@BG\eq@mkIns>> + /DA (\eq@DA) + /Opt [\eq@Opt] + \eq@DV\eq@V + \eq@A\eq@AA + \eq@rawPDF } % \end{macrocode} % Sets the dimensions of the fields/links based on \texttt{\#1} (width) @@ -2472,14 +2556,14 @@ % \end{macrocode} % The final argument of \cs{comboBox} or \cs{listBox} is any of three forms. %\begin{verbatim} -% {[(1)(Socks)][(2)(Shoes)][(3)(Pants)][(4)(Shirts)][(5)(Tie)]} -% {(Socks)(Shoes)(Pants)(Shirts)(Tie)} -% {\passthruCLOpts{% -% [(Euro)<\unicodeStr(myEuro)>]% -% [(Yen)<\unicodeStr(myYen)>] -% [(Sheqel)<\unicodeStr(mySheqel)>]% -% [(Pound)<\unicodeStr(myPound)>]% -% [(Franc)<\unicodeStr(myFranc)>]} +% {[(1)(Socks)][(2)(Shoes)][(3)(Pants)][(4)(Shirts)][(5)(Tie)]} +% {(Socks)(Shoes)(Pants)(Shirts)(Tie)} +% {\passthruCLOpts{% +% [(Euro)<\unicodeStr(myEuro)>]% +% [(Yen)<\unicodeStr(myYen)>]% +% [(Sheqel)<\unicodeStr(mySheqel)>]% +% [(Pound)<\unicodeStr(myPound)>]% +% [(Franc)<\unicodeStr(myFranc)>]} %\end{verbatim} % As long as the first token is not \cs{passthruCLOpts}, the argument may also be % a combination of the first two, such as @@ -2495,14 +2579,14 @@ % the next char is not a left bracket, go to next state. % \begin{macrocode} \def\ef@pdfstrCLOptia{\@ifnextchar[{\expandafter - \ef@pdfstrOptWBii\@gobble}{\ef@pdfstrCLOptb}} + \ef@pdfstrOptWBii\@gobble}{\ef@pdfstrCLOptb}} % \end{macrocode} % If not a left bracket, check for \cs{passthruCLOpts}, which expands to `\texttt{*}'. % If `\texttt{*}', then we pass the whole argument to \cs{eq@Opt} and end parsing. If % not `\texttt{*}', check for parentheses. % \begin{macrocode} \def\ef@pdfstrCLOptb{\@ifstar{\g@addto@macrogobble\eq@Opt} - {\ef@pdfstrOptWPi}} + {\ef@pdfstrOptWPi}} % \end{macrocode} %\changes{v2.6d}{2014/04/26}{Added additional parsing, so spaces % can occur between arguments.} @@ -2512,51 +2596,48 @@ % Following a bracket, the next token can only be a left parenthesis, if not error. % \begin{macrocode} \def\ef@pdfstrOptWBii{% - \@ifnextchar({\ef@pdfstrOptWBiia}{\PackageError{eforms} - {Left parenthesis expected here}{}}% -} + \@ifnextchar({\ef@pdfstrOptWBiia}{\PackageError{eforms} + {Left parenthesis expected here}{}}} % \end{macrocode} % We process the element of the form by pushing \verb![(val)(appr)]! onto the % \cs{eq@Opt} stack. % \begin{macrocode} \def\ef@pdfstrOptWBiia(#1){% - \g@addto@macro\eq@Opt{[(}% - \pdfstringdef\@optTokstemp{#1}% - \expandafter\g@addto@macro\expandafter\eq@Opt - \expandafter{\@optTokstemp}% - \@ifnextchar({\ef@pdfstrOptWBiib}{\PackageError{eforms} - {Left parenthesis expected here}{}}% -} + \g@addto@macro\eq@Opt{[(}% + \pdfstringdef\@optTokstemp{#1}% + \expandafter\g@addto@macro\expandafter\eq@Opt + \expandafter{\@optTokstemp}% + \@ifnextchar({\ef@pdfstrOptWBiib}{\PackageError{eforms} + {Left parenthesis expected here}{}}} % \end{macrocode} % Get the second element of the array, which is enclosed in parentheses. % push its value onto the stack too. % \begin{macrocode} \def\ef@pdfstrOptWBiib(#1){% - \g@addto@macro\eq@Opt{)(}% - \pdfstringdef\@optTokstemp{#1}% - \expandafter\g@addto@macro\expandafter\eq@Opt - \expandafter{\@optTokstemp}% - \g@addto@macro\eq@Opt{)]}% + \g@addto@macro\eq@Opt{)(}% + \pdfstringdef\@optTokstemp{#1}% + \expandafter\g@addto@macro\expandafter\eq@Opt + \expandafter{\@optTokstemp}% + \g@addto@macro\eq@Opt{)]}% % \end{macrocode} % Now after removing the final right bracket, return to the beginning, % which is the \cs{ef@pdfstrCLOpti} command. % \begin{macrocode} - \expandafter\ef@pdfstrCLOpti\@gobble -} + \expandafter\ef@pdfstrCLOpti\@gobble} % \end{macrocode} % Process the purely parentheses version of the array. % \begin{macrocode} \def\ef@pdfstrOptWPi{\@ifnextchar\ef@@nil{\@gobble}{\ef@pdfstrOptWPii}} \def\ef@pdfstrOptWPii(#1){% - \g@addto@macro\eq@Opt{(}% - \pdfstringdef\@optTokstemp{#1}% - \expandafter\g@addto@macro\expandafter\eq@Opt - \expandafter{\@optTokstemp}% - \g@addto@macro\eq@Opt{)}% + \g@addto@macro\eq@Opt{(}% + \pdfstringdef\@optTokstemp{#1}% + \expandafter\g@addto@macro\expandafter\eq@Opt + \expandafter{\@optTokstemp}% + \g@addto@macro\eq@Opt{)}% % \end{macrocode} % Return to the beginning, \cs{ef@pdfstrCLOpti}. % \begin{macrocode} - \ef@pdfstrCLOpti} + \ef@pdfstrCLOpti} % \end{macrocode} % \subsubsection{List Box}\label{listbox} % The main list box code that can be used to build list box commands, such as @@ -2564,17 +2645,23 @@ % \begin{macrocode} \def\annot@type@listbox{listbox} \newcommand\list@@Box[8]{\begingroup - \edef\annot@type{\annot@type@listbox}% - \pdfstringdef\Fld@name{#2}% -% \edef\Fld@name{#2}%\def\eq@Opt{#5}% + \let\nameuse\@nameuse + \edef\annot@type{\annot@type@listbox}% + \pdfstringdef\Fld@name{#2}\dl@paramlocal % \end{macrocode} % Run \texttt{\#5} through \cs{ef@pdfstrCLOpt}. % \begin{macrocode} - \expandafter\ef@pdfstrCLOpt#5\ef@@nil - \eqf@setDimens{#3}{#4}% - \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% - \@processEvery#8\end\noindent#6#7{#1}% -} + \expandafter\ef@pdfstrCLOpt#5\ef@@nil + \eqf@setDimens{#3}{#4}% + \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% + \@processEvery#8\end\noindent#6#7{#1}} +% \end{macrocode} +% \DescribeMacro restores the obey spaces space to its default, +% saved earlier. This command is placed at the end of each of the form field +% commands to reverse the earlier change to \cs{pdfSP}. +% \begin{macrocode} +\bgroup\obeyspaces +\gdef\listBox{\global\let =\dl@sp@ce}\egroup % \end{macrocode} % \begin{macro}{\listBox} %\begin{verbatim} @@ -2584,40 +2671,39 @@ % #4 = the height of the bounding rectangle % #5 = the face values/export values of list. %\end{verbatim} +%\noindent Below are the default settings for the list box % \begin{macrocode} -\def\listBoxDefaults{% - \W{1}\S{I}\F{\FPrint}\BC{0 0 0} -} +\def\listBoxDefaults{\W{1}\S{I}\F{\FPrint}\BC{0 0 0}} % \end{macrocode} +% We \cs{let} space to \cs{pdfSP}, to convert tex space to pdf space (\cs{040}) % We sanitize the optional first parameter. % \begin{macrocode} -\newcommand\listBox{\begingroup - \ef@sanitize@toks\ef@listbox -} -\newcommand{\ef@listbox}[1][]{% - \endgroup\ef@listBox[#1]% -} -\newcommand\ef@listBox[5][]{% - \mbox{\list@@Box{#1}{#2}{#3}{#4}{#5}{}{\eq@setWidgetProps - \eq@choice@driver}{\listBoxDefaults\every@listBox}}% -} +\bgroup\obeyspaces +\gdef\listBox{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@listbox}\egroup +% \end{macrocode} +% Now capture the rest of the parameters, and pass them all to the low +% level \cs{list@@Box}. +% \begin{macrocode} +\newcommand\ef@listbox[5][]{\endgroup + \mbox{\list@@Box{#1}{#2}{#3}{#4}{#5}{}{\eq@setWidgetProps + \eq@choice@driver}{\listBoxDefaults\every@listBox}}} % \end{macrocode} % \end{macro} % \subsubsection{Combo Box}\label{combobox} % \begin{macrocode} \def\annot@type@combobox{combobox} \newcommand\combo@@Box[8]{\begingroup - \edef\annot@type{\annot@type@combobox}% - \@eqFf{\FfCombo}\pdfstringdef\Fld@name{#2}% -% \edef\Fld@name{#2}%\def\eq@Opt{#5}% + \let\nameuse\@nameuse + \edef\annot@type{\annot@type@combobox}% + \@eqFf{\FfCombo}\pdfstringdef\Fld@name{#2}\dl@paramlocal % \end{macrocode} % Run \texttt{\#5} through \cs{ef@pdfstrCLOpt}. % \begin{macrocode} - \expandafter\ef@pdfstrCLOpt#5\ef@@nil - \eqf@setDimens{#3}{#4}% - \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% - \@processEvery#8\end\noindent#6#7{#1}% -} + \expandafter\ef@pdfstrCLOpt#5\ef@@nil + \eqf@setDimens{#3}{#4}% + \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% + \@processEvery#8\end\noindent#6#7{#1}} % \end{macrocode} % \begin{macro}{\comboBox} % A general combo box command. @@ -2628,68 +2714,65 @@ % #4 = the height of the bounding rectangle % #5 = the face values/export values of combo box. %\end{verbatim} +%\noindent The default settings for the \cs{comboBox} % \begin{macrocode} -\def\comboBoxDefaults{% - \W{1}\S{I}\F{\FPrint}\BC{0 0 0} -} +\def\comboBoxDefaults{\W{1}\S{I}\F{\FPrint}\BC{0 0 0}} % \end{macrocode} % We sanitize the optional first parameter. % \begin{macrocode} -\newcommand\comboBox{\begingroup - \ef@sanitize@toks\ef@combobox -} -\newcommand{\ef@combobox}[1][]{% - \endgroup\ef@comboBox[#1]% -} -\newcommand\ef@comboBox[5][]{% - \mbox{\combo@@Box{#1}{#2}{#3}{#4}{#5}{}{\eq@setWidgetProps - \eq@choice@driver}{\comboBoxDefaults\every@comboBox}}% -} +\bgroup\obeyspaces +\gdef\comboBox{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@combobox}\egroup +% \end{macrocode} +% Close group, get rest of the arguments. +% \begin{macrocode} +\newcommand\ef@combobox[5][]{\endgroup + \mbox{\combo@@Box{#1}{#2}{#3}{#4}{#5}{}{\eq@setWidgetProps + \eq@choice@driver}{\comboBoxDefaults\every@comboBox}}} % \end{macrocode} % \end{macro} % \subsection{Button Fields}\label{button} % Here is the field template for push button fields.\par\medskip\noindent -% % (2018/11/10) \cs{eq@APX} determines if \cs{eq@I} is empty, if not we supply the normal appearance % for the button to be the same appearance as set by \cs{eq@I}. % \changes{v2.9.21}{2018/11/10}{Introduce \string\cs{eq@APX} an `intelligent' AP key} % \begin{macrocode} \def\eq@APX{\ifx\eq@I\@empty\eq@AP\else - /AP<< \expandafter\get@NIR\eq@I\@nil\space>>\fi} + /AP<< \expandafter\get@NIR\eq@I\@nil\space>>\fi} \def\get@NIR/#1 #2\@nil{/N #2} \def\common@pushButtonCode{% - /Subtype/Widget - /T (\Fld@name) - /FT/Btn - \eq@Ff - \eq@TU - \eq@H - \eq@F - /BS <<\eq@W\eq@S >> + /Subtype/Widget + /T (\Fld@name) + /FT/Btn + \eq@Ff + \eq@TU + \eq@H + \eq@F + /BS <<\eq@W\eq@S >> % \end{macrocode} % (2018/11/10) Remove conditional \string\cs{eq@AP}, some PDF viewers % use AP to build the normal appearance for buttons. % \changes{v2.9.21}{2018/11/10}{Remove conditional \string\cs{eq@AP} % in \string\cs{common@pushButtonCode}}. % \begin{macrocode} - /MK <<\eq@R\eq@BC\eq@BG% - \ef@kvCA\ef@kvRC\ef@kvAC\eq@IconMK\eq@mkIns>> - \eq@APX - /DA (\eq@DA) - \eq@A\eq@AA - \eq@rawPDF + /MK <<\eq@R\eq@BC\eq@BG% + \ef@kvCA\ef@kvRC\ef@kvAC\eq@IconMK\eq@mkIns>> + \eq@APX + /DA (\eq@DA) + \eq@A\eq@AA + \eq@rawPDF } % \end{macrocode} % Here is the field template for check boxes and radio button fields fields. % \begin{macrocode} \def\common@RadioCheckCode{% - /Subtype/Widget - /T (\Fld@name) - /FT/Btn - \eq@Ff - \eq@F - \eq@TU - /BS <<\eq@W\eq@S>> + /Subtype/Widget + /T (\Fld@name) + /FT/Btn + \eq@Ff + \eq@F + \eq@TU + /BS <<\eq@W\eq@S>> % \end{macrocode} % \changes{v1.0d}{2007/09/01}{% % Corrected a problem with radio buttons. The problem was created by earlier @@ -2698,16 +2781,16 @@ %} % \begin{macrocode} \ifx\eq@AP\@empty - /AP<< /N <<\eq@On<<>>>> >> - \eq@MK + /AP<< /N <<\eq@On<<>>>> >> + \eq@MK \else \eq@AP \fi - /DA (\eq@DA) - \eq@AS - \eq@DV\eq@V - \eq@A\eq@AA - \eq@rawPDF + /DA (\eq@DA) + \eq@AS + \eq@DV\eq@V + \eq@A\eq@AA + \eq@rawPDF } % \end{macrocode} % \subsubsection{Push Button}\label{pushbutton} @@ -2723,14 +2806,14 @@ % \begin{macrocode} \def\annot@type@button{pushbtn} \newcommand\push@@Button[7]{\begingroup - \edef\annot@type{\annot@type@button}% - \pdfstringdef\Fld@name{#2}%\edef\Fld@name{#2}% - \makeJSspecials\ef@preProcDefns - \def\eq@Ff{/Ff \FfPushButton}% - \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% - \eqf@setDimens{#3}{#4}% - \@processEvery#7\end\noindent#5#6{#1}% -} + \let\nameuse\@nameuse + \edef\annot@type{\annot@type@button}% + \pdfstringdef\Fld@name{#2}\dl@paramlocal + \makeJSspecials\ef@preProcDefns + \def\eq@Ff{/Ff \FfPushButton}% + \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% + \eqf@setDimens{#3}{#4}% + \@processEvery#7\end\noindent#5#6{#1}} % \end{macrocode} % \begin{macro}{\pushButton} %\begin{verbatim} @@ -2739,49 +2822,47 @@ %#3 = the width of the bounding rectangle %#4 = the height of the bounding rectangle %\end{verbatim} +%\noindent The default for \cs{pushButton} % \begin{macrocode} \def\pushButtonDefaults{% - \W{1}\S{B}\F{\FPrint}\BC{0 0 0} - \H{P}\BG{.7529 .7529 .7529} -} + \W{1}\S{B}\F{\FPrint}\BC{0 0 0} + \H{P}\BG{.7529 .7529 .7529}} % \end{macrocode} % We sanitize the optional first parameter. +% \changes{v2.10}{2019/03/16}{Implement pdfSP for push button fields} % \begin{macrocode} -\newcommand\pushButton{\begingroup - \ef@sanitize@toks\ef@pushbutton -} -\newcommand{\ef@pushbutton}[1][]{% - \endgroup\ef@pushButton[#1]% -} -\newcommand\ef@pushButton[4][]{% - \mbox{\push@@Button{#1}{#2}{#3}{#4}{}{% - \eq@setButtonProps\eq@Button@driver}% - {\pushButtonDefaults\every@PushButton}}% -} +\bgroup\obeyspaces +\gdef\pushButton{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@pushbutton}\egroup +% \end{macrocode} +% End sanitize group, get the rest of the parameters, pass them to the low-level \cs{push@@Button} +% \begin{macrocode} +\newcommand\ef@pushbutton[4][]{\endgroup + \mbox{\push@@Button{#1}{#2}{#3}{#4}{}{% + \eq@setButtonProps\eq@Button@driver}% + {\pushButtonDefaults\every@PushButton}}} % \end{macrocode} % \end{macro} % \subsubsection{Check Box}\label{checkbox} % The basic command for creating check boxes. % \begin{macrocode} \def\annot@type@checkbox{checkbox} -\newcommand\check@@Box[8] -{% - \begingroup\let\#\ef@Hx - \edef\annot@type{\annot@type@checkbox}% - \pdfstringdef\Fld@name{#2}\@eqAS{Off}% - \def\@eqDV##1{\def\eq@arg{##1}\ifx\eq@arg\@empty\let\eq@DV\@empty - \else\ifpdfmarkup\def\eq@DV{/DV(##1) cvn }\else - \def\eq@DV{/DV/##1}\fi\fi}% - \def\@eqV##1{\def\eq@arg{##1}\ifx\eq@arg\@empty - \let\eq@V\@empty\else\ifpdfmarkup\def\eq@V{/V(##1) cvn }\else - \def\eq@V{/V/##1}\fi\@eqAS{##1}\fi}% - \eqf@setDimens{#3}{#4}% - \ifpdfmarkup\def\eq@On{(#5) cvn }\else - \def\eq@On{/#5}\fi\@eqtextFont{ZaDb}% - \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% - \@eqMK{\eq@R\eq@BC\eq@BG/CA(\symbol@choice)\eq@mkIns}% - \@processEvery#8\end\noindent#6#7{#1}% -} +\newcommand\check@@Box[8]{\begingroup + \let\nameuse\@nameuse + \let\#\ef@Hx\edef\annot@type{\annot@type@checkbox}% + \pdfstringdef\Fld@name{#2}\@eqAS{Off}\dl@paramlocal + \def\@eqDV##1{\def\eq@arg{##1}\ifx\eq@arg\@empty\let\eq@DV\@empty + \else\ifpdfmarkup\def\eq@DV{/DV(##1) cvn }\else + \def\eq@DV{/DV/##1}\fi\fi}% + \def\@eqV##1{\def\eq@arg{##1}\ifx\eq@arg\@empty + \let\eq@V\@empty\else\ifpdfmarkup\def\eq@V{/V(##1) cvn }\else + \def\eq@V{/V/##1}\fi\@eqAS{##1}\fi}% + \eqf@setDimens{#3}{#4}% + \ifpdfmarkup\def\eq@On{(#5) cvn }\else + \def\eq@On{/#5}\fi\@eqtextFont{ZaDb}% + \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% + \@eqMK{\eq@R\eq@BC\eq@BG/CA(\symbol@choice)\eq@mkIns}% + \@processEvery#8\end\noindent#6#7{#1}} % \end{macrocode} % \begin{macro}{\checkBox} %\begin{verbatim} @@ -2791,43 +2872,43 @@ %#4 = the height of the bounding rectangle %#5 = the 'on value' or export value, the default is "Yes". %\end{verbatim} +%\noindent The default for \cs{checkBox} % \begin{macrocode} -\def\checkBoxDefaults{% - \F{\FPrint}\W{1}\S{S}\BC{0 0 0}% -} -\newcommand\checkBox{\begingroup - \ef@sanitize@toks\ef@checkbox -} -\newcommand{\ef@checkbox}[5][]{% - \endgroup\mbox{\check@@Box{#1}{#2}{#3}{#4}{#5}{}{\eq@setWidgetProps - \eq@RadioCheck@driver}{\checkBoxDefaults\every@CheckBox}}% -} +\def\checkBoxDefaults{\F{\FPrint}\W{1}\S{S}\BC{0 0 0}} +% \end{macrocode} +% \begin{macrocode} +\bgroup\obeyspaces +\gdef\checkBox{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@checkbox}\egroup +% \end{macrocode} +% End the sanitizing group, and get the argument, pass them on to +% the low-level command \cs{check@@Box}. +% \begin{macrocode} +\newcommand{\ef@checkbox}[5][]{\endgroup + \mbox{\check@@Box{#1}{#2}{#3}{#4}{#5}{}{\eq@setWidgetProps + \eq@RadioCheck@driver}{\checkBoxDefaults\every@CheckBox}}} % \end{macrocode} % \end{macro} % \subsubsection{Radio Button}\label{radiobutton} % The basic command for creating radio button fields. % \begin{macrocode} -% Basic command for building all radio buttons. -% \end{macrocode} -% \begin{macrocode} \def\annot@type@radio{radiobtn} \newcommand\radio@@Button[8]{\begingroup\let\#\ef@Hx - \edef\annot@type{\annot@type@radio}% - \pdfstringdef\Fld@name{#2}\@eqAS{Off}% -% \edef\Fld@name{#2}\@eqAS{Off}% - \def\@eqDV##1{\def\eq@arg{##1}\ifx\eq@arg\@empty\let\eq@DV\@empty - \else\ifpdfmarkup\def\eq@DV{/DV(##1) cvn }\else - \def\eq@DV{/DV/##1}\fi\fi}% - \def\@eqV##1{\def\eq@arg{##1}\ifx\eq@arg\@empty - \let\eq@V\@empty\else\ifpdfmarkup\def\eq@V{/V(##1) cvn }\else - \def\eq@V{/V/##1}\fi\@eqAS{##1}\fi}% - \eqf@setDimens{#3}{#4}% - \ifpdfmarkup\def\eq@On{(#5) cvn }\else\def\eq@On{/#5}\fi - \def\eq@Ff{/Ff \FfRadio}\@eqtextFont{ZaDb}% - \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% - \@eqMK{\eq@R\eq@BC\eq@BG/CA(\symbol@choice)\eq@mkIns}% - \@processEvery#8\end\noindent#6#7{#1}% -} + \let\nameuse\@nameuse + \edef\annot@type{\annot@type@radio}% + \pdfstringdef\Fld@name{#2}\@eqAS{Off}\dl@paramlocal + \def\@eqDV##1{\def\eq@arg{##1}\ifx\eq@arg\@empty\let\eq@DV\@empty + \else\ifpdfmarkup\def\eq@DV{/DV(##1) cvn }\else + \def\eq@DV{/DV/##1}\fi\fi}% + \def\@eqV##1{\def\eq@arg{##1}\ifx\eq@arg\@empty + \let\eq@V\@empty\else\ifpdfmarkup\def\eq@V{/V(##1) cvn }\else + \def\eq@V{/V/##1}\fi\@eqAS{##1}\fi}% + \eqf@setDimens{#3}{#4}% + \ifpdfmarkup\def\eq@On{(#5) cvn }\else\def\eq@On{/#5}\fi + \def\eq@Ff{/Ff \FfRadio}\@eqtextFont{ZaDb}% + \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% + \@eqMK{\eq@R\eq@BC\eq@BG/CA(\symbol@choice)\eq@mkIns}% + \@processEvery#8\end\noindent#6#7{#1}} % \end{macrocode} % \begin{macro}{\radioButton} %\begin{verbatim} @@ -2837,26 +2918,22 @@ %#4 = the height of the bounding rectangle %#5 = the 'on value' or export value, the default is "Yes" %\end{verbatim} +%\noindent The default for \cs{radioButton} % \begin{macrocode} -\def\radioButtonDefaults -{% - \W{1}\S{S}\BC{0 0 0}\F{\FPrint} -} +\def\radioButtonDefaults{\W{1}\S{S}\BC{0 0 0}\F{\FPrint}} % \end{macrocode} % We sanitize the optional first parameter. % \begin{macrocode} -\newcommand\radioButton{\begingroup - \ef@sanitize@toks\ef@radiobutton -} +\bgroup\obeyspaces +\gdef\radioButton{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@radiobutton}\egroup +% \end{macrocode} +% End sanitize group, get rest of parameters and pass to the low-level +% command \cs{radio@@Button} +% \begin{macrocode} \newcommand{\ef@radiobutton}[5][]{\endgroup - \mbox{\radio@@Button{#1}{#2}{#3}{#4}{#5}{}{\eq@setWidgetProps - \eq@RadioCheck@driver}{\radioButtonDefaults\every@RadioButton}}% -} -\newcommand\ef@radioButton[5][] -{% - \mbox{\radio@@Button{#1}{#2}{#3}{#4}{#5}{}{\eq@setWidgetProps - \eq@RadioCheck@driver}{\radioButtonDefaults\every@RadioButton}}% -} + \mbox{\radio@@Button{#1}{#2}{#3}{#4}{#5}{}{\eq@setWidgetProps + \eq@RadioCheck@driver}{\radioButtonDefaults\every@RadioButton}}} % \end{macrocode} % \end{macro} % @@ -2866,36 +2943,33 @@ % \begin{macrocode} \def\common@TextFieldCode {% - /Subtype/Widget - /T (\Fld@name) - /FT/Tx - \eq@Ff - \eq@F - \eq@Q - \eq@TU - \eq@MaxLen - /BS <<\eq@W\eq@S>> - /MK <<\eq@R\eq@BC\eq@BG\eq@mkIns>> - /DA (\eq@DA) - \eq@DV\eq@V - \eq@RV\eq@DS - \eq@A\eq@AA - \eq@rawPDF + /Subtype/Widget + /T (\Fld@name) + /FT/Tx + \eq@Ff + \eq@F + \eq@Q + \eq@TU + \eq@MaxLen + /BS <<\eq@W\eq@S>> + /MK <<\eq@R\eq@BC\eq@BG\eq@mkIns>> + /DA (\eq@DA) + \eq@DV\eq@V + \eq@RV\eq@DS + \eq@A\eq@AA + \eq@rawPDF } % \end{macrocode} % The basic text field macro for constructing all other text fields. % \begin{macrocode} \def\annot@type@text{textfld} -\newcommand\text@@Field[7] -{% - \begingroup - \edef\annot@type{\annot@type@text}% - \pdfstringdef\Fld@name{#2}\def\eq@Title{#2}% -% \edef\Fld@name{#2}\def\eq@Title{#2}% - \eqf@setDimens{#3}{#4}% - \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% - \@processEvery#7\end\noindent#5#6{#1}% -} +\newcommand\text@@Field[7]{\begingroup + \let\nameuse\@nameuse + \edef\annot@type{\annot@type@text}% + \pdfstringdef\Fld@name{#2}\dl@paramlocal + \def\eq@Title{#2}\eqf@setDimens{#3}{#4}% + \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% + \@processEvery#7\end\noindent#5#6{#1}} % \end{macrocode} % \begin{macro}{\textField} %\begin{verbatim} @@ -2904,26 +2978,23 @@ %#3 = the width of the bounding rectangle %#4 = the height of the bounding rectangle %\end{verbatim} +%\noindent The default for \cs{textField} % \begin{macrocode} -\def\textFieldDefaults -{% - \F{\FPrint}\BC{0 0 0}\W{1}\S{S} -} +\def\textFieldDefaults{\F{\FPrint}\BC{0 0 0}\W{1}\S{S}} % \end{macrocode} % We sanitize the optional first parameter. +% \changes{v2.10}{2019/03/16}{Implement pdfSP for text fields} % \begin{macrocode} -\newcommand\textField{\begingroup - \ef@sanitize@toks\ef@textfield -} -\newcommand{\ef@textfield}[2][]{% - \endgroup\ef@textField[#1]{#2}% -} -\newcommand\ef@textField[4][] -{% - \mbox{\text@@Field{#1}{#2}{#3}{#4}{}% - {\eq@setWidgetProps\eq@TextField}% - {\textFieldDefaults\every@TextField}}% -} +\bgroup\obeyspaces +\gdef\textField{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@textfield}\egroup +% \end{macrocode} +% End group, pass parameters to \cs{text@@Field} +% \begin{macrocode} +\newcommand\ef@textfield[4][]{\endgroup + \mbox{\text@@Field{#1}{#2}{#3}{#4}{}% + {\eq@setWidgetProps\eq@TextField}% + {\textFieldDefaults\every@TextField}}} % \end{macrocode} % Some legacy assignments. % \begin{macrocode} @@ -2938,31 +3009,29 @@ % \begin{macrocode} \def\common@SigFieldCode {% - /Subtype /Widget - /T (\Fld@name) - /FT/Sig - \eq@F - \eq@TU - /BS <<\eq@W\eq@S>> - /MK <<\eq@R\eq@BC\eq@BG\eq@mkIns>> - /DA (\eq@DA) - \eq@Lock - \eq@A\eq@AA - \eq@rawPDF + /Subtype /Widget + /T (\Fld@name) + /FT/Sig + \eq@F + \eq@TU + /BS <<\eq@W\eq@S>> + /MK <<\eq@R\eq@BC\eq@BG\eq@mkIns>> + /DA (\eq@DA) + \eq@Lock + \eq@A\eq@AA + \eq@rawPDF } % \end{macrocode} % The basic text field macro for constructing all other text fields. % \begin{macrocode} \def\annot@type@sig{sigfld} -\newcommand\sig@@Field[7]{% - \begingroup - \edef\annot@type{\annot@type@sig}% - \pdfstringdef\Fld@name{#2}\def\eq@Title{#2}% -% \edef\Fld@name{#2}\def\eq@Title{#2}% - \eqf@setDimens{#3}{#4}% - \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% - \@processEvery#7\end\noindent#5#6{#1}% -} +\newcommand\sig@@Field[7]{\begingroup + \let\nameuse\@nameuse + \edef\annot@type{\annot@type@sig}% + \pdfstringdef\Fld@name{#2}\dl@paramlocal + \def\eq@Title{#2}\eqf@setDimens{#3}{#4}% + \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% + \@processEvery#7\end\noindent#5#6{#1}} % \end{macrocode} % \begin{macro}{\sigField} %\begin{verbatim} @@ -2971,25 +3040,18 @@ %#3 = the width of the bounding rectangle %#4 = the height of the bounding rectangle %\end{verbatim} +%\noindent Defaults for \cs{sigField} % \begin{macrocode} -\def\sigFieldDefaults -{% - \F{\FPrint}\BC{}\BG{}\W{1}\S{S} -} +\def\sigFieldDefaults{\F{\FPrint}\BC{}\BG{}\W{1}\S{S}} % \end{macrocode} % We sanitize the optional first parameter. % \begin{macrocode} -\newcommand\sigField{\begingroup - \ef@sanitize@toks\ef@sigfield -} -\newcommand{\ef@sigfield}[1][]{% - \endgroup\ef@sigField[#1]% -} -\newcommand\ef@sigField[4][] -{% - \mbox{\sig@@Field{#1}{#2}{#3}{#4}{}{\eq@setWidgetProps\eq@SigField}% - {\sigFieldDefaults\every@sigField}}% -} +\bgroup\obeyspaces +\gdef\sigField{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@sigfield}\egroup +\newcommand\ef@sigfield[4][]{\endgroup + \mbox{\sig@@Field{#1}{#2}{#3}{#4}{}{\eq@setWidgetProps\eq@SigField}% + {\sigFieldDefaults\every@sigField}}} % \end{macrocode} % \end{macro} % @@ -3004,11 +3066,11 @@ % \begin{macrocode} \def\common@LinkCode {% - \eq@A % Action - \eq@H % Highlight - \eq@Color % Border color - \link@BS % Border styles - \eq@rawPDF % everything else + \eq@A % Action + \eq@H % Highlight + \eq@Color % Border color + \link@BS % Border styles + \eq@rawPDF % everything else } % \end{macrocode} % \cs{set@@Link} is the low-level link command and is the building block of all the @@ -3024,21 +3086,19 @@ %\end{enumerate} % \begin{macrocode} \def\annot@type@link{link} -\newcommand\set@@Link[7] -{% - \begingroup - \makeJSspecials - \edef\annot@type{\annot@type@link}% - \ef@preProcDefns - \eqf@setDimens{#2}{#3}% - \ifx\eq@rectW\@empty\def\link@@Box{#4}\else - \def\eq@arg{#4}\ifx\eq@arg\@empty - \def\eq@content{\hfill\vfill}\else\def\eq@content{#4}\fi - \def\link@@Box{\parbox[\eq@pos][\eq@rectH][\eq@innerpos]% - {\eq@rectW}{\centering\eq@content}}% - \fi - \@processEvery#7\end\noindent#5#6{#1}% -} +\newcommand\set@@Link[7]{\begingroup + \let\nameuse\@nameuse + \dl@paramlocal + \makeJSspecials + \edef\annot@type{\annot@type@link}% + \ef@preProcDefns + \eqf@setDimens{#2}{#3}% + \ifx\eq@rectW\@empty\def\link@@Box{#4}\else + \def\eq@arg{#4}\ifx\eq@arg\@empty + \def\eq@content{\hfill\vfill}\else\def\eq@content{#4}\fi + \def\link@@Box{\parbox[\eq@pos][\eq@rectH][\eq@innerpos]% + {\eq@rectW}{\centering\eq@content}}\fi + \@processEvery#7\end\noindent#5#6{#1}} % \end{macrocode} % \paragraph{The Visibility of Border of the Link.} We use \textsf{hyperref}'s % option \texttt{colorlinks} to determine if we @@ -3050,10 +3110,9 @@ %\changes{v2.8f}{2016/04/05}{Delay default link color until beginning of document.} % \begin{macrocode} \def\setDef@ultLinkColor{\ifHy@colorlinks - \def\ef@thislinkcolor{\defaultlinkcolor} - \def\ef@colorthislink{\color{\ef@thislinkcolor}}\else - \let\ef@colorthislink\relax\fi -} + \def\ef@thislinkcolor{\defaultlinkcolor}% + \def\ef@colorthislink{\color{\ef@thislinkcolor}}\else + \let\ef@colorthislink\relax\fi} \AtBeginDocument{\setDef@ultLinkColor} % \end{macrocode} % \begin{macro}{\setLink} @@ -3082,10 +3141,11 @@ % \end{macrocode} % If the \texttt{colorlinks} option is in effect with hyperref, we color links when author % uses |\setLinkText|, a command used by many other commands defined in AeB. +% \changes{v2.10}{2019/03/16}{Implement pdfSP for link annotations} % \begin{macrocode} -\newcommand\setLink{\begingroup - \ef@sanitize@toks\ef@setlinktext -} +\bgroup\obeyspaces +\gdef\setLink{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@setlinktext}\egroup % \end{macrocode} % \changes{v2.5b}{2009/12/24}{added path to \string\cs{mlhypertext}} % Added a path to \cs{mlhypertext} of the \textsf{aeb\_mlink} package. When the @@ -3105,31 +3165,28 @@ %In the next line, we \cs{let} \cs{setLinkText} to \cs{setLink} % \begin{macrocode} \let\setLinkText\setLink -\newcommand{\ef@setlinktext}[1][]{% - \endgroup\ef@searchmlLink#1\mlLink\end\@nil - \ifx\ef@mlLink\ef@Zero\def\ef@next{\set@LinkText[#1]}\else - \def\ef@next{\mlhypertext[#1]}\fi\ef@next -} +\newcommand{\ef@setlinktext}[1][]{\endgroup + \ef@searchmlLink#1\mlLink\end\@nil + \ifx\ef@mlLink\ef@Zero\def\ef@next{\set@LinkText[#1]}\else + \def\ef@next{\mlhypertext[#1]}\fi\ef@next} \newcommand\set@LinkText[2][]{% - \set@@Link{#1}{}{}{\ef@colorthislink#2}{}% - {\eq@setWidgetProps{\ef@postProcLinkProps\setLink@driver}}% - {\set@LinkTextDefaults\every@Link}% -} + \set@@Link{#1}{}{}{\ef@colorthislink#2}{}% + {\eq@setWidgetProps{\ef@postProcLinkProps\setLink@driver}}% + {\set@LinkTextDefaults\every@Link}} % \end{macrocode} % Definitions we want make locally to the options parameters; otherwise, % these are undefined. % \begin{macrocode} \def\ef@preProcDefns{% - \def\Win##1{/Win <<##1>>}% - \def\fitpage{\dl@fitpage}\def\actualsize{\dl@actualsize}% - \def\fitwidth{\dl@fitwidth}\def\fitheight{\dl@fitheight}% - \def\fitvisible{\dl@fitvisible}\def\inheritzoom{\dl@inheritzoom}% - \let\rPage\ef@rPage - \edef\Page##1{\ifcase\eq@drivernum - {Page##1}\or - \noexpand\pdfpageref##1\space\space 0 R\or - \noexpand @page##1\fi - }% + \def\Win##1{/Win <<##1>>}% + \def\fitpage{\dl@fitpage}\def\actualsize{\dl@actualsize}% + \def\fitwidth{\dl@fitwidth}\def\fitheight{\dl@fitheight}% + \def\fitvisible{\dl@fitvisible}\def\inheritzoom{\dl@inheritzoom}% + \let\rPage\ef@rPage + \edef\Page##1{\ifcase\eq@drivernum + {Page##1}\or + \noexpand\pdfpageref##1\space\space 0 R\or + \noexpand @page##1\fi}% } % \end{macrocode} % After the properties are processed, the flow comes to |\ef@postProcLinkProps| @@ -3171,28 +3228,24 @@ % \begin{macrocode} \def\set@LinkBboxDefaults{\S{S}\Border{0 0 0}} % \end{macrocode} -% \begin{macrocode} -\newcommand{\setLinkBbox}{\begingroup - \ef@sanitize@toks\ef@linkbbox -} -\newcommand{\ef@linkbbox}[1][]{% - \endgroup\ef@setLinkBbox[#1]% -} -\newcommand{\ef@setLinkBbox}[3][]{% - \@setLinkBbox{#1}{#2}{#3}% -} -\def\@setLinkBbox#1#2#3{\@ifnextchar[{\@@setLinkBbox{#1}{#2}{#3}}% - {\@@setLinkBbox{#1}{#2}{#3}[c]}} -\def\@@setLinkBbox#1#2#3[#4]{% - \@ifnextchar[{\@@@setLinkBbox{#1}{#2}{#3}{#4}}% - {\@@@setLinkBbox{#1}{#2}{#3}{#4}[#4]}% -} +% \changes{v2.10}{2019/03/16}{Implement pdfSP for link annotations} +% \begin{macrocode} +\bgroup\obeyspaces +\gdef\setLinkBbox{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@setLinkbbox}\egroup +\newcommand{\ef@setLinkbbox}[3][]{\endgroup + \@setLinkBbox{#1}{#2}{#3}} +\def\@setLinkBbox#1#2#3{\@ifnextchar[% + {\@@setLinkBbox{#1}{#2}{#3}}% + {\@@setLinkBbox{#1}{#2}{#3}[c]}} +\def\@@setLinkBbox#1#2#3[#4]{\@ifnextchar[% + {\@@@setLinkBbox{#1}{#2}{#3}{#4}}% + {\@@@setLinkBbox{#1}{#2}{#3}{#4}[#4]}} \def\@@@setLinkBbox#1#2#3#4[#5]#6{% - \def\eq@pos{#4}\def\eq@innerpos{#5}% - \set@@Link{#1}{#2}{#3}{\ef@colorthislink#6}% - {\eq@setWidgetProps\setLink@driver}{}% - {\set@LinkBboxDefaults\every@Link}% -} + \def\eq@pos{#4}\def\eq@innerpos{#5}% + \set@@Link{#1}{#2}{#3}{\ef@colorthislink#6}% + {\eq@setWidgetProps\setLink@driver}{}% + {\set@LinkBboxDefaults\every@Link}} % \end{macrocode} % \end{macro} % \begin{macro}{\setLinkPbox} @@ -3206,26 +3259,20 @@ %} % \begin{macrocode} \def\set@LinkPboxDefaults{\S{S}\Border{0 0 0}} -\newcommand\setLinkPbox{\begingroup - \ef@sanitize@toks\ef@linkpbox -} -\newcommand{\ef@linkpbox}[1]{% - \endgroup\ef@setLinkPbox{#1}% -} -\newcommand\ef@setLinkPbox[1]{% - \@setLinkPbox{#1\BS{}}{}{}{\hfill\vfill}% -} +\bgroup\obeyspaces +\gdef\setLinkPbox{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@setLinkpbox}\egroup +\newcommand\ef@setLinkpbox[1]{\endgroup + \@setLinkPbox{#1\BS{}}{}{}{\hfill\vfill}} \def\@setLinkPbox#1#2#3{\@ifnextchar[{\@@setLinkPbox{#1}{#2}{#3}}% - {\@@setLinkPbox{#1}{#2}{#3}[c]}} + {\@@setLinkPbox{#1}{#2}{#3}[c]}} \def\@@setLinkPbox#1#2#3[#4]{% - \@ifnextchar[{\@@@setLinkPbox{#1}{#2}{#3}{#4}}% - {\@@@setLinkPbox{#1}{#2}{#3}{#4}[#4]} -} + \@ifnextchar[{\@@@setLinkPbox{#1}{#2}{#3}{#4}}% + {\@@@setLinkPbox{#1}{#2}{#3}{#4}[#4]}} \def\@@@setLinkPbox#1#2#3#4[#5]#6{% - \def\eq@pos{#4}\def\eq@innerpos{#5}% - \set@@Link{#1}{#2}{#3}{#6}{\eq@setWidgetProps\setLinkPbox@driver}% - {}{\set@LinkPboxDefaults\every@Link}% -} + \def\eq@pos{#4}\def\eq@innerpos{#5}% + \set@@Link{#1}{#2}{#3}{#6}{\eq@setWidgetProps\setLinkPbox@driver}% + {}{\set@LinkPboxDefaults\every@Link}} % \end{macrocode} % \end{macro} % \begin{macrocode} @@ -3650,6 +3697,7 @@ }% } % \end{macrocode}% +% \subsection{Miscellaneous keys} % The \texttt{autocenter}\IndexKey{autocenter} is a feature of eforms. Use \texttt{autocenter=yes} (the default) to center the bounding % box, and use \texttt{autocenter=no} otherwise. % \begin{macrocode} @@ -3682,6 +3730,11 @@ \@eqmlhyph{n}\fi }{} % \end{macrocode} +% \changes{v2.10}{2019/03/16}{Added \string\cs{cmd} to optional args of forms} +% This key passes its argument directly into the stream for processing +% \begin{macrocode} +\define@key{eforms}{cmd}[]{\@eqcmd{#1}} +% \end{macrocode} % Set presets\IndexKey{presets} from inside a \cs{ui} argument. For example, %\begin{verbatim} %\def\myUIOptsi{% @@ -3699,10 +3752,18 @@ %\setLinkText[\ui{presets={\myUIOptsii}}]{Press Me Again!!} %\end{verbatim} % \begin{macrocode} -\define@key{eforms}{presets}{% - \ef@jstoks=\expandafter{#1}% - \edef\ef@temp@expand{\noexpand\setkeys{eforms}{\the\ef@jstoks}}% - \ef@temp@expand +\define@key{eforms}{presets}{\ef@jstoks=\expandafter{#1}% + \edef\ef@temp@expand{\noexpand\setkeys{eforms}{\the\ef@jstoks}}% + \ef@temp@expand +} +% \end{macrocode} +% \changes{v2.10}{2019/03/16}{epresets, the ui counterpart to \string\cs{epresets}} +% epresets, the ui counterpart to \cs{epresets} +% \begin{macrocode} +\define@key{eforms}{epresets}{\ef@jstoks=\expandafter{#1}% + \edef\@rgs{#1}\ef@jstoks=\expandafter{\@rgs}% + \edef\ef@temp@expand{\noexpand\setkeys{eforms}{\the\ef@jstoks}}% + \ef@temp@expand } % \end{macrocode} % \texttt{symbolchoice}\IndexKey{symbolchoice}is used with a checkbox or radio button field. This sets the symbol @@ -4078,7 +4139,7 @@ \def\eq@choice@driver {% \Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \pdf@rect{\lower\eqcenterWidget\ef@Bbox{\eq@rectW}{\eq@rectH}}% @@ -4089,6 +4150,7 @@ /ANN pdfmark \ifisCalculate[ {corder} {\Fld@name} /APPEND pdfmark\fi }\to@insertStrucTabOrder{Form}\endgroup + \dl@restorespcs } % \end{macrocode} % Driver dependent code (distiller) for push button fields. @@ -4097,7 +4159,7 @@ {% \Hy@pdfstringtrue \ifx\eq@rectW\@empty\def\eq@rectW{\wd\eq@tmpbox}\ef@djXPD\fi - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \pdf@rect{\lower\eqcenterWidget\ef@Bbox{\eq@rectW}{\eq@rectH}}% @@ -4105,6 +4167,7 @@ [ \eq@objdef/Rect [pdf@llx pdf@lly pdf@urx pdf@ury] \common@pushButtonCode /ANN pdfmark}\to@insertStrucTabOrder{Form}\endgroup + \dl@restorespcs } % \end{macrocode} % Driver dependent code (distiller) for radio and button fields. @@ -4112,7 +4175,7 @@ \def\eq@RadioCheck@driver {% \Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \ifx\eq@rectW\@empty\def\eq@rectW{\wd\eq@tmpbox}\fi @@ -4121,6 +4184,7 @@ [ \eq@objdef/Rect [pdf@llx pdf@lly pdf@urx pdf@ury] \common@RadioCheckCode /ANN pdfmark}\to@insertStrucTabOrder{Form}\endgroup + \dl@restorespcs } \def\eq@l@check@driver {% @@ -4129,12 +4193,13 @@ [ \eq@objdef/Rect [pdf@llx pdf@lly pdf@urx pdf@ury] \common@RadioCheckCode /ANN pdfmark}\endgroup + \dl@restorespcs } % \end{macrocode} % Driver dependent code for text fields. % \begin{macrocode} \def\eq@TextField{\Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \pdf@rect{\lower\eqcenterWidget\ef@Bbox{\eq@rectW}{\eq@rectH}}% @@ -4145,13 +4210,14 @@ /ANN pdfmark \ifisCalculate[ {corder} {\Fld@name} /APPEND pdfmark\fi }\to@insertStrucTabOrder{Form}\endgroup + \dl@restorespcs } % \end{macrocode} % \changes{v2.5p}{2012/09/25}{Corrected a bug in \string\cs{eq@SigField} for % the dvipdfm-type drivers} % \begin{macrocode} \def\eq@SigField{\Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH % \centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi @@ -4161,6 +4227,7 @@ \common@SigFieldCode /ANN pdfmark }\to@insertStrucTabOrder{Form}\endgroup + \dl@restorespcs } % \end{macrocode} % For processing the \texttt{pdfmark} with distiller, the key \texttt{/Action} is @@ -4183,6 +4250,7 @@ /Subtype /Link /ANN pdfmark}% \to@insertStrucTabOrder{Link}\endgroup + \dl@restorespcs } % \end{macrocode} % (2018/03/22) Defined \cs{pboxRect} to support @@ -4208,6 +4276,7 @@ /Subtype /Link /ANN pdfmark}}% \to@insertStrucTabOrder{Link}\endgroup + \dl@restorespcs } % \end{macrocode} % \begin{macrocode} @@ -4247,45 +4316,49 @@ \def\eq@choice@driver {% \Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \hbox{\pdfstartlink user{\common@choiceCode}% \lower\eqcenterWidget\ef@Bbox{\eq@rectW}{\eq@rectH}\pdfendlink}% \HyField@AddToFields \endgroup + \dl@restorespcs } \def\eq@Button@driver {% \Hy@pdfstringtrue \ifx\eq@rectW\@empty\def\eq@rectW{\wd\eq@tmpbox}\ef@djXPD\fi - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \ifx\eq@rectW\@empty\def\eq@rectW{\wd\eq@tmpbox}\fi - \hbox{\pdfstartlink user{ \common@pushButtonCode }% + \hbox{\pdfstartlink user{\common@pushButtonCode}% \lower\eqcenterWidget\ef@Bbox{\eq@rectW}{\eq@rectH}\pdfendlink}% \endgroup + \dl@restorespcs } \def\eq@RadioCheck@driver {% \Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \ifx\eq@rectW\@empty\def\eq@rectW{\wd\eq@tmpbox}\fi \hbox{\pdfstartlink user{\common@RadioCheckCode}% \lower\eqcenterWidget\ef@Bbox{\eq@rectW}{\eq@rectH}\pdfendlink}% \endgroup + \dl@restorespcs } \def\eq@l@check@driver {% \pdfstartlink user{\common@RadioCheckCode}% \makebox[\eq@tmpdima]{\phantom{\link@@Content}}% \pdfendlink\endgroup + \dl@restorespcs } \def\eq@TextField{\Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \leavevmode @@ -4293,14 +4366,16 @@ \lower\eqcenterWidget\ef@Bbox{\eq@rectW}{\eq@rectH}\pdfendlink}% \HyField@AddToFields \endgroup + \dl@restorespcs } \def\eq@SigField{\Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \leavevmode\hbox{\pdfstartlink user{\common@SigFieldCode}% \lower\eqcenterWidget\ef@Bbox{\eq@rectW}{\eq@rectH}\pdfendlink}% \endgroup + \dl@restorespcs } \def\setLink@driver {% @@ -4311,6 +4386,7 @@ \Hy@colorlink{\@linkcolor}\link@@Box \close@pdflink \endgroup + \dl@restorespcs } \def\ef@setTabOrder{\ifx\ef@taborder\@empty\else \edef\ef@tmp@toks{\the\pdfpageattr\space/Tabs/\ef@taborder}% @@ -4332,20 +4408,12 @@ % (2016/12/22) Removed \cs{ef@adjHWxetex} in favor of \cs{ef@djXPD}. % \changes{v2.9d}{2016/12/22}{Removed \string\cs{ef@adjHWxetex} in favor of \string\cs{ef@djXPD}} % \begin{macrocode} -%\def\ef@adjHWxetex{% -% \setlength{\@tempdima}{\eq@W@value bp}% -% \setlength{\@tempdima}{2\@tempdima}% -% \edef\ef@border@adj{\the\@tempdima}% -% \setlength{\@tempdima}{\eq@rectH+\ef@border@adj}% -% \edef\eq@rectH{\the\@tempdima}% -% \setlength{\@tempdima}{\eq@rectW+\ef@border@adj}% -% \edef\eq@rectW{\the\@tempdima}} \let\ef@adjHWxetex\relax % \end{macrocode} % \begin{macrocode} \def\eq@choice@driver{\ef@adjHWxetex \Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \leavevmode\setbox\pdfm@box=% @@ -4354,14 +4422,16 @@ <<\common@choiceCode>>}\unhbox\pdfm@box\relax% \@pdfm@mark{put @afields @\Fld@name}% record in @afields array \ifisCalculate\@pdfm@mark{put @corder @\Fld@name}\fi -\endgroup} + \dl@restorespcs + \endgroup +} % \end{macrocode} % (2013/06/09) xelatex apparently includes the boundary in its width and height % calculations. So we must too. % \begin{macrocode} \def\eq@Button@driver{\Hy@pdfstringtrue \ifx\eq@rectW\@empty\def\eq@rectW{\wd\eq@tmpbox}\ef@djXPD\fi % 12/22 - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \setbox\pdfm@box=% @@ -4370,9 +4440,10 @@ << \common@pushButtonCode >>}\unhbox\pdfm@box\relax% \@pdfm@mark{put @afields @\Fld@name}% record in @afields array \endgroup + \dl@restorespcs } \def\eq@RadioCheck@driver{\ef@adjHWxetex\Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \ifx\eq@rectW\@empty\def\eq@rectW{\wd\eq@tmpbox}\fi @@ -4381,6 +4452,7 @@ \@pdfm@mark{ann \dvipdfm@setdim <<\common@RadioCheckCode>>}\unhbox\pdfm@box\relax% \endgroup + \dl@restorespcs } \def\eq@l@check@driver{% \setbox\pdfm@box=% @@ -4389,7 +4461,7 @@ \unhbox\pdfm@box\relax\endgroup } \def\eq@TextField{\ef@adjHWxetex\Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \leavevmode\setbox\pdfm@box=% @@ -4399,9 +4471,10 @@ \@pdfm@mark{put @afields @\Fld@name}% record in @afields array \ifisCalculate\@pdfm@mark{put @corder @\Fld@name}\fi \endgroup + \dl@restorespcs } \def\eq@SigField{\ef@adjHWxetex\Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \leavevmode\setbox\pdfm@box=% @@ -4409,6 +4482,7 @@ \@pdfm@mark{ann @\Fld@name\space\dvipdfm@setdim << \common@SigFieldCode >>}\unhbox\pdfm@box\relax% \endgroup + \dl@restorespcs } \def\setLink@driver{% \@eqBS{}\leavevmode @@ -4417,6 +4491,7 @@ \Hy@colorlink{\@linkcolor}\link@@Box\Hy@endcolorlink \@pdfm@mark{eann}% \endgroup + \dl@restorespcs } \def\ef@setTabOrder{\ifx\ef@taborder\@empty\else \@pdfm@mark{ put @thispage << /Tabs/\ef@taborder >> }% diff --git a/texmf-dist/source/latex/acrotex/exerquiz.dtx b/texmf-dist/source/latex/acrotex/exerquiz.dtx index 330a61f8..5f7dc930 100644 --- a/texmf-dist/source/latex/acrotex/exerquiz.dtx +++ b/texmf-dist/source/latex/acrotex/exerquiz.dtx @@ -22,7 +22,7 @@ %<randomize>\ProvidesFile{aebrandom.def} %<sumrytbls>\ProvidesFile{aebsumrytbls.def} %<template>\ProvidesFile{template.def} -%<package|driver|aebjs|eqexam|randomize|sumrytbls|template> [2018/12/13 v8.2.8 % +%<package|driver|aebjs|eqexam|randomize|sumrytbls|template> [2019/02/11 v8.2.9 % %<package> Exerquiz: Exercises and Quizzes for LaTeX/PDF package (dps)] %<driver> Exerquiz documentation driver file (dps)] %<aebjs> Exerquiz document level JavaScript (dps)] @@ -2415,9 +2415,11 @@ % yet to be determined, there are problems when using the \texttt{fortextbook} % option when hiding solutions. %} +%\changes{v8.2.9}{2019/02/11}{\string\let\eqSavedComment\string\dlcomment, \string\dlcomment\space +%is not defined in \string\pkg{insdljs}} % \begin{macrocode} -\let\eqSavedComment\comment -\let\eqSavedEndCommet\endcomment +\let\eqSavedComment\dlcomment +\let\endeqSavedComment\enddlcomment % \end{macrocode} %\changes{v7.4}{2015/03/23}{added \cs{setTabulrSolnEnv}} % \begin{macrocode} @@ -2461,13 +2463,13 @@ % \begin{macrocode} \let\minVspacet@bs\@empty \let\procsoln\eqSavedComment - \let\endprocsoln\eqSavedEndCommet + \let\endprocsoln\endeqSavedComment \def\eq@next{\procsoln}% \else \eq@ckglobalhide \ifeq@hidesolution \let\procsoln\eqSavedComment - \let\endprocsoln\eqSavedEndCommet + \let\endprocsoln\endeqSavedComment \else \ifeq@solutionsafter\else \ifx\eq@@CommonCmd\@empty\else @@ -3939,14 +3941,14 @@ \oField.RightAnsSymbJSLoc=\rghtAnsSymbJSLoc;\fi \ifx\wrngAnsSymbJSLoc\@empty\else\r \oField.WrongAnsSymbJSLoc=\wrngAnsSymbJSLoc;\fi - }}]{sqID\oField}{0bp}{0bp}}% + }}]{sqID\oField}{2bp}{2bp}}% } \def\qz@IDTxtField{\makebox[0pt][l]{\textField[\autoCenter{n}\BC{}\BG{} \S{S}\textSize{0}\Ff{\FfReadOnly} \AA{\AAFormat{if(typeof aQuizzesInDoc=="undefined")\r\t var aQuizzesInDoc=new Array();\r if (aQuizzesInDoc.indexOf("\oField")) aQuizzesInDoc.push("\oField"); - }}]{qzID\oField}{0bp}{0bp}}} + }}]{qzID\oField}{2bp}{2bp}}} %</package> %<*package|eqexam> \let\eqQuizType\relax @@ -4791,7 +4793,7 @@ {\eq@setWidgetProps\setLink@driver}% {\eq@EndQuizLinkDefaults\eq@@EndQuizLinkActions\every@Link}% \makebox[0pt][r]{\textField[\BC{}\autoCenter{n}]% - {htxtfld.\curr@quiz}{0bp}{0bp}}% + {htxtfld.\curr@quiz}{2bp}{2bp}}% \makebox[0pt][r]{\eq@hiddenScoreData\eq@insertHiddenFields}% \global\let\eq@CGI\@empty\ignorespaces } @@ -4846,7 +4848,7 @@ }}}% } \newcommand{\eq@hiddenScoreData}{\makebox[0pt][r]{% - \textField[\BC{}\F{\FHidden}]{ScoreData.\curr@quiz}{0bp}{0bp}}} + \textField[\BC{}\F{\FHidden}]{ScoreData.\curr@quiz}{2bp}{2bp}}} \newcommand\eq@EndQuizButton[1][]{% \ifx\eq@CGI\@empty \let\eq@submitURL\@empty diff --git a/texmf-dist/source/latex/acrotex/exerquiz.ins b/texmf-dist/source/latex/acrotex/exerquiz.ins index d3514d00..5178412c 100644 --- a/texmf-dist/source/latex/acrotex/exerquiz.ins +++ b/texmf-dist/source/latex/acrotex/exerquiz.ins @@ -46,7 +46,7 @@ \generate{% \file{exerquiz.sty}{\from{exerquiz.dtx}{copyright,package}} \file{aebjs.def}{\from{exerquiz.dtx}{copyright,aebjs}} -% \file{eqexam.def}{\from{exerquiz.dtx}{eqexam}} + \file{eqexam.def}{\from{exerquiz.dtx}{eqexam}} \file{aebrandom.def}{\from{exerquiz.dtx}{copyright,randomize}} \file{aebsumrytbls.def}{\from{exerquiz.dtx}{copyright,sumrytbls}} \file{usemcfi.def}{\from{exerquiz.dtx}{copyright,mcfi}} diff --git a/texmf-dist/source/latex/acrotex/insdljs.dtx b/texmf-dist/source/latex/acrotex/insdljs.dtx index 10f62df0..204a4b28 100644 --- a/texmf-dist/source/latex/acrotex/insdljs.dtx +++ b/texmf-dist/source/latex/acrotex/insdljs.dtx @@ -16,7 +16,7 @@ %</copyright> %<package>\NeedsTeXFormat{LaTeX2e} %<package>\ProvidesPackage{insdljs} -%<package> [2018/07/21 v2.4 Insert Document Level JavaScripts (dps)] +%<package> [2019/03/16 v2.4.2 Insert Document Level JavaScripts (dps)] %<*driver> \documentclass{ltxdoc} \usepackage[colorlinks,hyperindex=false]{hyperref} @@ -571,6 +571,11 @@ \def\pdfpageref{\pdffeedback pageref}\fi\fi \RequirePackage{verbatim} % \end{macrocode} +%\changes{v2.4.1}{2019/02/11}{Save \string\cs{comment}\space as \string\cs{dlcomment}} +% \begin{macrocode} +\let\dlcomment\comment +\let\enddlcomment\endcomment +% \end{macrocode} % (2017/01/03) The \pkg{insdljs} package does not use \pkg{conv-xkv} but % is fundamental to other packages (\pkg{eforms}, \pkg{aeb\_pro}) that require % \pkg{insdljs} and \pkg{conv-xkv}. @@ -776,6 +781,24 @@ \gdef\js@@R{\noexpand }} % \end{macrocode} +% We define space\DescribeMacro\pdfSp, left\DescribeMacro\pdfLBr\space and right\DescribeMacro\pdfRBr\space +% braces in pdf (PDFDocEncoding); these are also defined +% in \pkg{exerquiz} but under different names (\cs{eqSP}, \cs{eqLBr}, and \cs{eqRBr}). +% \changes{v2.4.2}{2019/03/16}{Added \string\cs{pdfSP}, and others, and \string\cs{dl@sp@ce}} +% \begin{macrocode} +\def\pdfSPDef{\string\040} +\let\pdfSP\pdfSPDef +\def\pdfLBr{\string\173} +\def\pdfRBr{\string\175} +\def\dl@sp@ce{ } +% \end{macrocode} +% \DescribeMacro\dl@restorespcs restores the obey spaces space to its default, +% saved earlier. This command is placed at the end of each of the form field +% commands to reverse the earlier change to \cs{pdfSP}. +% \begin{macrocode} +\bgroup\obeyspaces +\gdef\dl@restorespcs{\global\let =\dl@sp@ce}\egroup +% \end{macrocode} % \begin{macrocode} \let\dljstfor\@tfor % \end{macrocode} @@ -817,40 +840,37 @@ %{ % A simple command for creating JS strings with unicode \cs{uXXXX}. %} -% The following is the old definition, it is superseded by the ones below. -%\begin{verbatim} -%\newcommand{\defineJSStr}[2]{{% -% \let\protect\noexpand -% \let\jslit\string -% \def\\{\eqbs\eqbs}\def\cs##1{\\\\##1}% -% \def\r{\\r}\def\t{\\t}% -% \def\n{\\n}\def\u{\\u}% -% \xdef#1{"#2"}% -%}} -%\end{verbatim} % \changes{v2.0m}{2013/12/23}{Added \cs{jscsDflt} and \cs{jscsDLJS}, incorporated into \cs{dl@defJSStr}.} % Added \cs{jscsDflt} and \cs{jscsDLJS}, incorporated them into \cs{dl@defJSStr}. % \begin{macrocode} \def\dl@lparen{(}\def\dl@rparen{)} +\def\genericNL{^^J} +\def\defjsLB{\expandafter\pdfmarkLB\@gobblefour} +\def\genericLB{\eqbs\eqbs^^J} +\def\pdfmarkLB{\eqbs^^J} \def\jscsDflt{\let\protect\noexpand\let\jslit\string - \let\~\dl@tilda\let\^\dl@sup - \def\\{\eqbs\eqbs}\def\cs##1{\\\\##1}% - \def\r{\\r}\def\t{\\t}\def\n{\\n}% - \let\{\dl@lBrace\let\}\dl@rBrace - \ifx\jsstr@useUni\dl@One\def\Uni{\\u}\else\def\u{\\u}\fi - \ifx\jsstr@parens\dl@One\let\l@paren\dl@lparen - \let\r@paren\dl@rparen\else - \let\l@paren\@empty\let\r@paren\@empty\fi + \let\~\dl@tilda\let\^\dl@sup + \def\\{\eqbs\eqbs}\def\cs##1{\\\\##1}% + \def\r{\\r}\def\t{\\t}\def\n{\\n}% + \let\{\dl@lBrace\let\}\dl@rBrace + \ifx\jsstr@useUni\dl@One\def\Uni{\\u}\else\def\u{\\u}\fi + \ifx\jsstr@parens\dl@One\let\l@paren\dl@lparen + \let\r@paren\dl@rparen\else + \let\l@paren\@empty\let\r@paren\@empty\fi + \dl@paramlocal\let\LB\genericLB\let\NL\genericNL } \def\jscsDLJS{\let\protect\noexpand\let\jslit\string - \let\~\dl@tilda\let\^\dl@sup - \ifxetex\def\\{\eqbs\eqbs}\else\def\\{\eqbs}\fi\def\cs##1{\\\\##1}% - \def\r{\\r}\def\t{\\t}\def\n{\\n}% - \let\{\dl@lBrace\let\}\dl@rBrace - \ifx\jsstr@useUni\dl@One\def\Uni{\\u}\else\def\u{\\u}\fi - \ifx\jsstr@parens\dl@One\let\l@paren\dl@lparen - \let\r@paren\dl@rparen\else - \let\l@paren\@empty\let\r@paren\@empty\fi + \let\~\dl@tilda\let\^\dl@sup + \ifxetex\def\\{\eqbs\eqbs}\else\def\\{\eqbs}\fi\def\cs##1{\\\\##1}% + \def\r{\\r}\def\t{\\t}\def\n{\\n}% + \let\{\dl@lBrace\let\}\dl@rBrace + \ifx\jsstr@useUni\dl@One\def\Uni{\\u}\else\def\u{\\u}\fi + \ifx\jsstr@parens\dl@One\let\l@paren\dl@lparen + \let\r@paren\dl@rparen\else + \let\l@paren\@empty\let\r@paren\@empty\fi + \ifpdfmarkup\let\LB\pdfmarkLB\else + \let\LB\genericLB\fi + \let\NL\genericNL } \ifpdf\let\jscsDLJS\jscsDflt\fi \let\dl@JSCS\jscsDflt @@ -859,11 +879,13 @@ % at the field level. % When the \texttt{*}-form is used, \texttt{\#2} is passed through \cs{pdfstringdef}, % needed if there are some latex to pdf strings to be converted. +% \changes{v2.4.2}{2019/03/16}{Implement tex to pdf spacing} % \begin{macrocode} -\newcommand{\flJSStr}{\bgroup - \let\dl@JSCS\jscsDflt - \@ifstar{\def\isStar{*}\dl@defJSStr} - {\let\isStar\relax\dl@defJSStr}} +\bgroup\obeyspaces +\gdef\flJSStr{\bgroup\global\let =\pdfSP +\let\dl@JSCS\jscsDflt +\obeyspaces\@ifstar{\def\isStar{*}\dl@defJSStr}% +{\let\isStar\relax\dl@defJSStr}}\egroup \let\fieldJSStr\flJSStr % \end{macrocode} % For backward compatibility, we \cs{let} \cs{defineJSStr} to \cs{flJSStr}. @@ -876,8 +898,8 @@ % needed if there are some latex to pdf strings to be converted. % \begin{macrocode} \newcommand{\dlJSStr}{\bgroup - \@ifstar{\def\isStar{*}\let\dl@JSCS\jscsDLJS\dl@defJSStr} - {\let\isStar\relax\let\dl@JSCS\jscsDLJS\dl@defJSStr}} + \@ifstar{\def\isStar{*}\let\dl@JSCS\jscsDLJS\dl@defJSStr} + {\let\isStar\relax\let\dl@JSCS\jscsDLJS\dl@defJSStr}} % \end{macrocode} % Some simple key-values for both commands above. Both commands, by default, % insert double quotations marks at the beginning and end of the string as a convenience. @@ -894,22 +916,24 @@ \define@key{jsstr}{noquotes}[]{\let\jsstr@quotes\dl@Zero} \define@key{jsstr}{parens}[]{\let\jsstr@parens\dl@One} \define@key{jsstr}{noparens}[]{\let\jsstr@parens\dl@Zero} -\let\jsstr@quotes\dl@One\let\jsstr@parens\dl@One +\let\jsstr@quotes\dl@One\let\jsstr@parens\dl@Zero % noparens the default \define@key{jsstr}{useUni}[]{\let\jsstr@useUni\dl@One} \let\jsstr@useUni\dl@Zero % \end{macrocode} % The common part to both \cs{flJSStr} and \cs{dlJSStr}. +% \changes{v2.4.2}{2019/03/16}{Implement tex to pdf spacing. Remove the use of +% parentheses in \string\cs{dl@defJSStr}.} % \begin{macrocode} \newcommand{\dl@defJSStr}[3][quotes]{\def\dl@argi{#1}\ifx\dl@argi\@empty - \else\ifx\dl@JSCS\jscsDLJS\let\jsstr@parens\dl@Zero\fi - \setkeys{jsstr}{#1}\fi\dl@JSCS - \ifx\jsstr@quotes\dl@One - \xdef#2{\l@paren"#3"\r@paren}\else - \xdef#2{\l@paren#3\r@paren}\fi - \if\isStar*\gdef\dl@afterAction{{\Hy@unicodefalse\expandafter - \pdfstringdef\expandafter#2\expandafter{#2}}}\else - \global\let\dl@afterAction\relax\fi - \aftergroup\dl@afterAction\egroup} + \else\ifx\dl@JSCS\jscsDLJS\let\jsstr@parens\dl@Zero\fi + \setkeys{jsstr}{#1}\fi\dl@JSCS + \ifx\jsstr@quotes\dl@One + \xdef#2{\l@paren"#3"\r@paren}\else + \xdef#2{\l@paren#3\r@paren}\fi + \if\isStar*\gdef\dl@afterAction{{\Hy@unicodefalse\expandafter + \pdfstringdef\expandafter#2\expandafter{#2}}}\else + \global\let\dl@afterAction\relax\fi + \aftergroup\dl@afterAction\egroup\dl@restorespcs} % \end{macrocode} % \end{macro} % \end{macro} @@ -923,7 +947,7 @@ % \end{macro} % % \subsection{A Macro for Debugging JS} -% \begin{macro}{\db...\db} +% \begin{macro}{\db}\hskip-\marginparsep{\,\texttt{...\cs{db}}} % The \cs{db} macro can be used within the \texttt{insDLJS} to insert % addition JS commands to help debug the code. Usage: %\begin{verbatim} @@ -1745,42 +1769,148 @@ %\end{description} % The material within the environment is read verbatim and a new command by the name of \#2 % is defined. +% \changes{v2.4.2}{2019/03/16}{Changed space token to \string\cs{pdfSP} in \string\env{defineJS}} % \begin{macrocode} \newtoks\JStoks -\newenvironment{defineJS}[2][] -{% - \expandafter\@ifundefined\expandafter{% - \expandafter\@gobble\string#2}{}{% - \PackageWarning{insdljs}{The command - \string#2 already defined}}% - \gdef\defineJSArg{#2}\JStoks={}% - \def\verbatim@processline - {% - \xdef\JS@temp{\the\JStoks\the\verbatim@line\defineJSjsR}% - \global\JStoks=\expandafter{\JS@temp}% - }% - \let\do\@makeother\dospecials\catcode`\^^M\active - #1% - \verbatim@start +% \end{macrocode} +% \leavevmode\DescribeMacro{\bParams}\hskip-\marginparsep\texttt{\darg{\ameta{token\SUB1}}\darg{\ameta{token\SUB2}}...\darg{\ameta{token\SUB{n}}}\cs{eParams}} +% The \env{defineJS} environments do not +% have parameters/arguments as a normal environment (or command) do. To enable the ability +% to modify the JavaScript code within the environment of \env{defineJS}, we introduce +% the \cs{bParams}/\allowbreak\cs{eParams} construct. When you use one of the \env{defineJS} environments +% to define field level JavaScript, you can include parameters \cs{p(1)}, \cs{p(2)}, etc., within the body +% of the environment. (Note, within the body, there is no escape character unless you change catcode of another character +% within the optional argument of the \env{defineJS} environments.) +%\begin{verbatim} +% \begin{defineJS}[\catcode`\!=0\relax]{\myCode} +% var p1=!p(1), p2=!p(2); +% app.alert("p1 + p2 = " + Number(p1+p2) ); +% \end{defineJS} +%\end{verbatim} +% The substitution of the parameter values does not take place until the code is expanded (\cs{myCode}) +%\begin{verbatim} +% \bParams{1}{16}\eParams +% \pushButton[\A{\JS{\myCode}}]{pbfld1}{.5in}{11bp} +%\end{verbatim} +%When the button is pressed, an alert box appears and states that `\texttt{p1 + p2 = 17}'. The same code +%can be used later in another button, for example, +%\begin{verbatim} +% \bParams{77}{11}\eParams +% \pushButton[\A{\JS{\myCode}}]{pbfld2}{.5in}{11bp} +%\end{verbatim} +%Using the (new) \cs{cmd} key for \pkg{eforms}, all these declarations can be made locally: +%\begin{verbatim} +% \pushButton[\cmd{\bParams{77}{11}\eParams} +% \A{\JS{\myCode}}]{pbfld3}{.5in}{11bp} +%\end{verbatim} +% The definitions of the parameters are made using an \cs{edef} (using a control +% name, \cs{p@r@m\ameta{cnt}}, that is probably not otherwise used). This last +% command is generally accessed through \DescribeMacro\dl@param\cs{dl@param}. +% Within all +% the form fields, as defined in \pkg{eforms}, +% \DescribeMacro\dl@paramlocal\cs{dl@paramlocal} is expanded within a group; it is +% also expanded within \cs{flJSStr}. Expansion of \cs{dl@paramlocal} \cs{let}s +% \cs{p} to \cs{dl@param}; hence, \cs{p(1)}, \cs{p(2)}, etc., are defined. Great +% care must be used in managing the use of this feature; if you are not careful +% an earlier definition of a parameter is used when it was not meant to be so; +% or a \cs{p(n)} is not defined. +% \begin{macrocode} +\def\dl@param(#1){\csname p@r@m#1\endcsname} +\def\dl@paramlocal{\let\p\dl@param} +% \end{macrocode} +% This command uses the counter \texttt{dljs@cnt} and the token register +% \cs{JStoks}, both of which are used elsewhere in this package; however, +% there should be no conflict in using them here. +% \begin{macrocode} +\let\eParams\relax +% \end{macrocode} +% When there is only one token, the braces, if any, get lost. To avoid +% this, we determine how many tokens there are: one or more. If only one, we +% handle separately, otherwise, we pass the flow on to \cs{bParams@i}. +% \begin{macrocode} +\def\bParams#1{\def\p@r@m{p@r@m}\c@dljs@cnt\z@ + \@ifnextchar\eParams{\expandafter + \def\csname\p@r@m1\endcsname{#1}} + {\bParams@i{#1}}} +% \end{macrocode} +% The main definition of \cs{bParams}, we \cs{def\cs{p@r@m}\ameta{cnt}\darg{\ameta{token}}} +% \begin{macrocode} +\def\bParams@i#1\eParams{\@tfor\x:=#1\do{\advance\c@dljs@cnt\@ne + \JStoks=\expandafter{\x}\expandafter + \edef\csname\p@r@m\the\c@dljs@cnt\endcsname{\the\JStoks}}} +% \end{macrocode} +% Beginning with \pkg{insdljs} dated 2019/03/16, we solve an age-old problem with \app{dvips}: This problem +% is that is wraps code around to th next line, according to some unknown algorithm. Normally this is not +% a problem, but occassionally it will wrap some JavaScript code that breaks the code. Solve this problem, +% we make the space character active, and replace it with \cs{pdfSP} (\cs{040}), which is octal for the space +% character. Now there are no free spaces for \app{dvips} to break the line at in the PS file. The feature +% is turned on by default, and may be turned off with \DescribeMacro\pdfSpacesOff\cs{pdfSpacesOff} +% and back on by \DescribeMacro\pdfSpacesOn\cs{pdfSpacesOn}. +% \begin{macrocode} +\def\pdfSpacesOn{\let\pdfSP\pdfSPDef} +\def\pdfSpacesOff{\let\pdfSP\dl@sp@ce} +% \end{macrocode} +% When you declare a character to be an escape within the optional argument of \env{defineJS}, +% that character may be needed in the code; for example if we say |\catcode`\!=0\relax|, and +% within the JavaScript code you have \texttt{if (x != 0 ) ...}, there is a problem: the JavaScript +% code is broken. As a fix for this problem, you can declare \DescribeMacro\escIs|\escIS{!}|, +% which in turn defines \DescribeMacro\Eschr\cs{Eschr}. the above code +% should then be written as \texttt{if (x !Eschr= 0 ) ...}; messy, but it works. The lines +% below is the recommended method of declaring \cs{escIs}: +%\begin{verbatim} +% \pushButton[\cmd{\escIs{!}\bParams{77}{11}\eParams} +% \A{\JS{\myCode}}]{pbfld2}{.5in}{11bp} +%\end{verbatim} +% These declarations makes everything local to the group within which the button is built. +% \begin{macrocode} +\def\escIs#1{\def\Eschr{#1}} +% \end{macrocode} +% Finally, we get to the definition of \env{defineJS}, and its compatriates. +% \begin{macrocode} +\newenvironment{defineJS}[2][]{% + \expandafter\@ifundefined\expandafter{% + \expandafter\@gobble\string#2}{}{% + \PackageWarning{insdljs}{The command + \string#2 already defined}}% + \gdef\defineJSArg{#2}\JStoks={}% + \def\verbatim@processline{% + \xdef\JS@temp{\the\JStoks\the\verbatim@line\defineJSjsR}% + \global\JStoks=\expandafter{\JS@temp}}% + \let\do\@makeother\dospecials\catcode`\^^M\active +% \end{macrocode} +% We let \cs{space} to \cs{pdfSP}, and declare \cs{obeyspaces}, in this way, the space +% character is active and is equal to \cs{040} (space). +% \begin{macrocode} + \global\let\space\pdfSP\makeatletter\obeyspaces + #1% + \verbatim@start }{\gdef\eq@JStemp{\expandafter\edef\defineJSArg{\the\JStoks}}% - \aftergroup\eq@JStemp} + \global\let\space\dl@sp@ce\aftergroup\eq@JStemp} % \end{macrocode} +% \end{environment} +% \begin{environment}{@defineJS} % Silent version of \texttt{defineJS}, can repeatedly be used to redefine the same % macro. % \begin{macrocode} \newenvironment{@defineJS}[2][] {% - \gdef\defineJSArg{#2}\JStoks={}% - \def\verbatim@processline - {% - \xdef\JS@temp{\the\JStoks\the\verbatim@line\defineJSjsR}% - \global\JStoks=\expandafter{\JS@temp}% - }% - \let\do\@makeother\dospecials\catcode`\^^M\active - #1% - \verbatim@start + \gdef\defineJSArg{#2}\JStoks={}% + \def\verbatim@processline{% + \xdef\JS@temp{\the\JStoks\the\verbatim@line\defineJSjsR}% + \global\JStoks=\expandafter{\JS@temp}}% + \let\do\@makeother\dospecials\catcode`\^^M\active + \global\let\space\pdfSP\makeatletter\obeyspaces + #1% + \verbatim@start }{\gdef\eq@JStemp{\expandafter\edef\defineJSArg{\the\JStoks}}% - \aftergroup\eq@JStemp} + \global\let\space\dl@sp@ce\aftergroup\eq@JStemp} +% \end{macrocode} +% \end{environment} +% \begin{environment}{defineJS*} +% We declare a public version of \env{@defineJS} +% \changes{v2.4.2}{2019/03/16}{define \string\env{defineJS*} a public version of \string\env{@defineJS}} +% \begin{macrocode} +\newenvironment{defineJS*}{\@defineJS}{\end@defineJS} % \end{macrocode} % \end{environment} % An author might want these definitions to be local in definition, so the @@ -2598,7 +2728,7 @@ if(typeof \detectdljs\space == "undefined")\jsR\jsT % creating custom keystroke and formatting events. % \changes{v2.3f}{2017/03/02}{Alternate names for Adobe functions added} % \begin{macrocode} -\begin{insDLJS}{altadbfncs}{eforms: Alternate Adobe Function Names} +\begin{insDLJS}{altadbfncs}{indljs: Alternate Adobe Function Names} var EFNumber_Keystroke=AFNumber_Keystroke; var EFNumber_Format=AFNumber_Format; var EFPercent_Keystroke=AFPercent_Keystroke; diff --git a/texmf-dist/tex/latex/acrotex/aebjs.def b/texmf-dist/tex/latex/acrotex/aebjs.def index d5312af6..ec071992 100644 --- a/texmf-dist/tex/latex/acrotex/aebjs.def +++ b/texmf-dist/tex/latex/acrotex/aebjs.def @@ -18,7 +18,7 @@ %% License, or (at your option) any later version. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ProvidesFile{aebjs.def} - [2018/12/13 v8.2.8 % + [2019/02/11 v8.2.9 % Exerquiz document level JavaScript (dps)] \def\aeb@array{new Array} \def\refac#1{\\(#1\\)}\def\regrp#1{(#1)}\def\rechrclass#1{[#1]} diff --git a/texmf-dist/tex/latex/acrotex/aebrandom.def b/texmf-dist/tex/latex/acrotex/aebrandom.def index a8b8adae..66271ebd 100644 --- a/texmf-dist/tex/latex/acrotex/aebrandom.def +++ b/texmf-dist/tex/latex/acrotex/aebrandom.def @@ -18,7 +18,7 @@ %% License, or (at your option) any later version. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ProvidesFile{aebrandom.def} - [2018/12/13 v8.2.8 % + [2019/02/11 v8.2.9 % Exerquiz support for randomization (dps)] \@ifundefined{nextrandom}{\input{random.tex}}{} \def\nextrandom{\begingroup diff --git a/texmf-dist/tex/latex/acrotex/aebsumrytbls.def b/texmf-dist/tex/latex/acrotex/aebsumrytbls.def index d46fca06..64eac218 100644 --- a/texmf-dist/tex/latex/acrotex/aebsumrytbls.def +++ b/texmf-dist/tex/latex/acrotex/aebsumrytbls.def @@ -18,7 +18,7 @@ %% License, or (at your option) any later version. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ProvidesFile{aebsumrytbls.def} - [2018/12/13 v8.2.8 % + [2019/02/11 v8.2.9 % Exerquiz support for summary tables (dps)] \def\ccatCurrQzWith(#1){\currQuiz#1} \def\pbPopulateSumTable{\pushButton[\W0\BG{}\BC{}\S{S}\autoCenter{n} diff --git a/texmf-dist/tex/latex/acrotex/altadbfncs.def b/texmf-dist/tex/latex/acrotex/altadbfncs.def index 149a6466..5c087517 100644 --- a/texmf-dist/tex/latex/acrotex/altadbfncs.def +++ b/texmf-dist/tex/latex/acrotex/altadbfncs.def @@ -17,7 +17,7 @@ %% macros/latex/base/lppl.txt; either version 1 of the %% %% License, or (at your option) any later version. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\begin{insDLJS}{altadbfncs}{eforms: Alternate Adobe Function Names} +\begin{insDLJS}{altadbfncs}{indljs: Alternate Adobe Function Names} var EFNumber_Keystroke=AFNumber_Keystroke; var EFNumber_Format=AFNumber_Format; var EFPercent_Keystroke=AFPercent_Keystroke; diff --git a/texmf-dist/tex/latex/acrotex/edvipdfm.def b/texmf-dist/tex/latex/acrotex/edvipdfm.def index 85cdfec1..a10fdde7 100644 --- a/texmf-dist/tex/latex/acrotex/edvipdfm.def +++ b/texmf-dist/tex/latex/acrotex/edvipdfm.def @@ -21,7 +21,7 @@ \let\ef@adjHWxetex\relax \def\eq@choice@driver{\ef@adjHWxetex \Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \leavevmode\setbox\pdfm@box=% @@ -30,10 +30,12 @@ <<\common@choiceCode>>}\unhbox\pdfm@box\relax% \@pdfm@mark{put @afields @\Fld@name}% record in @afields array \ifisCalculate\@pdfm@mark{put @corder @\Fld@name}\fi -\endgroup} + \dl@restorespcs + \endgroup +} \def\eq@Button@driver{\Hy@pdfstringtrue \ifx\eq@rectW\@empty\def\eq@rectW{\wd\eq@tmpbox}\ef@djXPD\fi % 12/22 - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \setbox\pdfm@box=% @@ -42,9 +44,10 @@ << \common@pushButtonCode >>}\unhbox\pdfm@box\relax% \@pdfm@mark{put @afields @\Fld@name}% record in @afields array \endgroup + \dl@restorespcs } \def\eq@RadioCheck@driver{\ef@adjHWxetex\Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \ifx\eq@rectW\@empty\def\eq@rectW{\wd\eq@tmpbox}\fi @@ -53,6 +56,7 @@ \@pdfm@mark{ann \dvipdfm@setdim <<\common@RadioCheckCode>>}\unhbox\pdfm@box\relax% \endgroup + \dl@restorespcs } \def\eq@l@check@driver{% \setbox\pdfm@box=% @@ -61,7 +65,7 @@ \unhbox\pdfm@box\relax\endgroup } \def\eq@TextField{\ef@adjHWxetex\Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \leavevmode\setbox\pdfm@box=% @@ -71,9 +75,10 @@ \@pdfm@mark{put @afields @\Fld@name}% record in @afields array \ifisCalculate\@pdfm@mark{put @corder @\Fld@name}\fi \endgroup + \dl@restorespcs } \def\eq@SigField{\ef@adjHWxetex\Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \leavevmode\setbox\pdfm@box=% @@ -81,6 +86,7 @@ \@pdfm@mark{ann @\Fld@name\space\dvipdfm@setdim << \common@SigFieldCode >>}\unhbox\pdfm@box\relax% \endgroup + \dl@restorespcs } \def\setLink@driver{% \@eqBS{}\leavevmode @@ -89,6 +95,7 @@ \Hy@colorlink{\@linkcolor}\link@@Box\Hy@endcolorlink \@pdfm@mark{eann}% \endgroup + \dl@restorespcs } \def\ef@setTabOrder{\ifx\ef@taborder\@empty\else \@pdfm@mark{ put @thispage << /Tabs/\ef@taborder >> }% diff --git a/texmf-dist/tex/latex/acrotex/eforms.sty b/texmf-dist/tex/latex/acrotex/eforms.sty index e8ea97da..b0ff4b6b 100644 --- a/texmf-dist/tex/latex/acrotex/eforms.sty +++ b/texmf-dist/tex/latex/acrotex/eforms.sty @@ -19,7 +19,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{eforms} - [2018/11/27 v2.9.22 Provides general eforms support (dps)] + [2019/03/16 v2.10 Provides general eforms support (dps)] \RequirePackage{ifpdf}[2006/02/20] \RequirePackage{ifxetex}[2006/08/21] \RequirePackage{ifluatex} @@ -71,6 +71,7 @@ \def\eq@driver{dvipsone/dvips} \def\eq@drivercode{epdfmark.def} \DeclareOption{preview}{\previewtrue} +\let\insjs@opts\@empty \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{insdljs}} \@ifundefined{ifpreview}{\newif\ifpreview\previewfalse}{} \providecommand{\previewOn}{\previewtrue} @@ -118,7 +119,7 @@ \g@addto@macro\Hy@FirstPageHook{% \headerps@out{/HyperBorder {1.00375 PDFToDvips} def}} \fi\fi -\RequirePackage{insdljs}[2017/01/03] % incl conv-xkv +\RequirePackage{insdljs}[2019/02/11] % incl conv-xkv \@ifpackageloaded{exerquiz}{}{% \AtBeginDocument{\Form} \AtEndDocument{\csname endForm\endcsname} @@ -132,7 +133,7 @@ } \let\ef@YES=y \let\ef@NO=n \let\ef@One=1 \let\ef@Zero=0 -\ifnum\eq@drivername<2 +\ifnum\eq@drivername<2\relax \let\to@usepdfmark\ef@One \RequirePackage[structure]{taborder}\else \let\to@usepdfmark\ef@Zero @@ -150,74 +151,91 @@ \def\makePDasXOn{\makePDasXtrue\makeXasPDfalse} \def\makePDasXOff{\makePDasXfalse} \providecommand\ckboxColor[1]{\def\@rgi{#1}\ifx\@rgi\@empty - \let\ckbox@Color\relax\else - \def\ckbox@Color{\color{#1}}\fi}\let\ckbox@Color\relax + \let\ckbox@Color\relax\else + \def\ckbox@Color{\color{#1}}\fi}\let\ckbox@Color\relax +\def\efPreviewOnRule{0.4pt} +\def\PMCA#1{\def\@rgi{#1}\ifx\@rgi\@empty + \let\@PMCA\@empty\else\def\@PMCA{\hb@xt@\z@{\hss#1\hss}}\fi} +\let\@PMCA\@empty \def\ef@Bbox#1#2{\hbox{\ifpreview - \setlength\fboxrule{0.4pt}\setlength\fboxsep{0pt}% - \@tempdima=#1\advance\@tempdima by-\fboxrule - \@tempdimb=#2\advance\@tempdimb by-\fboxrule \ckbox@Color - \fbox{\parbox[b][\@tempdimb][c]{\@tempdima}{\hfill\vfill}}\else - \parbox[b][#2][c]{#1}{\hfill\vfill}\fi}% + \setlength\fboxrule{\efPreviewOnRule}\setlength\fboxsep{0pt}% + \@tempdima=#1\relax + \ifdim\@tempdima<2\fboxrule\else + \advance\@tempdima by-2\fboxrule\fi + \@tempdimb=#2\relax + \ifdim\@tempdimb<2\fboxrule\else + \advance\@tempdimb by-2\fboxrule\fi + \ckbox@Color\fbox{\parbox[b][\@tempdimb][c]{\@tempdima}% + {\vfil\hfil\@PMCA\hfil\vfil}}\else + \parbox[b][#2][c]{#1}{\vfil\hfil\hfil\vfil}\fi}% } \let\Bbox\ef@Bbox \let\ef@passedArgs\@empty \def\processAppArgs#1#2{% - \ifx\end#1% if #1=\end, #2=\@nil. - \let\ef@next\relax + \ifx\end#1% if #1=\end, #2=\@nil. + \let\ef@next\relax + \else + \ifx#1\@empty + \def\ef@next{\processAppArgs}% \else - \ifx#1\@empty - \def\ef@next{\processAppArgs}% + \@getCmdName{\ui}\edef\arg@ui{\@CmdName}% + \@getCmdName{#1}% + \ifx\arg@ui\@CmdName + \@ifundefined{@equi}{\PackageError{eforms}% + {The user interface '\string\ui' is not defined!% + \MessageBreak Use the useui option of eforms + and try again}{I said, use the useui option of + eforms and try again!}}{}% + \def\ef@next{\setkeys{eforms}{#2}% + \processAppArgs\presets{\ef@passedArgs}}% + \else + \@getCmdName{\Ff}\edef\arg@Ff{\@CmdName}% + \@getCmdName{#1}% + \ifx\arg@Ff\@CmdName % if \Ff, let's add arguments + \ifx\eq@Ff\@empty\def\eq@FfValue{0}\else + \expandafter\getFfValue\eq@Ff\@nil\fi + \@tempcnta=\eq@FfValue + \def\eq@arg{#2}% + \ifx\eq@arg\@empty\else + \advance\@tempcnta by#2\fi + \edef\eq@Ff{/Ff \the\@tempcnta}% + \def\ef@next{\processAppArgs}% \else - \@getCmdName{\ui}\edef\arg@ui{\@CmdName}% - \@getCmdName{#1}% - \ifx\arg@ui\@CmdName - \@ifundefined{@equi}{\PackageError{eforms}% - {The user interface '\string\ui' is not defined!% - \MessageBreak Use the useui option of eforms - and try again}{I said, use the useui option of - eforms and try again!}}{}% - \def\ef@next{\setkeys{eforms}{#2}% - \processAppArgs\presets{\ef@passedArgs}}% + \@getCmdName{\F}\edef\arg@F{\@CmdName}% + \@getCmdName{#1}% + \ifx\arg@F\@CmdName % if \Ff, let's add arguments + \ifx\eq@F\@empty\def\eq@FValue{0}\else + \expandafter\getFValue\eq@F\@nil\fi + \@tempcnta=\eq@FValue + \def\eq@arg{#2}% + \ifx\eq@arg\@empty\else + \advance\@tempcnta by#2\fi + \edef\eq@F{/F \the\@tempcnta}% + \def\ef@next{\processAppArgs}% + \else + \@getCmdName{\presets}% + \edef\arg@presets{\@CmdName}\@getCmdName{#1}% + \ifx\arg@presets\@CmdName + \def\ef@next{\expandafter\processAppArgs#2}% \else - \@getCmdName{\Ff}\edef\arg@Ff{\@CmdName}% - \@getCmdName{#1}% - \ifx\arg@Ff\@CmdName % if \Ff, let's add arguments - \ifx\eq@Ff\@empty\def\eq@FfValue{0}\else - \expandafter\getFfValue\eq@Ff\@nil\fi - \@tempcnta=\eq@FfValue - \def\eq@arg{#2}% - \ifx\eq@arg\@empty\else - \advance\@tempcnta by#2\fi - \edef\eq@Ff{/Ff \the\@tempcnta}% - \def\ef@next{\processAppArgs}% - \else - \@getCmdName{\F}\edef\arg@F{\@CmdName}% - \@getCmdName{#1}% - \ifx\arg@F\@CmdName % if \Ff, let's add arguments - \ifx\eq@F\@empty\def\eq@FValue{0}\else - \expandafter\getFValue\eq@F\@nil\fi - \@tempcnta=\eq@FValue - \def\eq@arg{#2}% - \ifx\eq@arg\@empty\else - \advance\@tempcnta by#2\fi - \edef\eq@F{/F \the\@tempcnta}% - \def\ef@next{\processAppArgs}% - \else - \@getCmdName{\presets}% - \edef\arg@presets{\@CmdName}\@getCmdName{#1}% - \ifx\arg@presets\@CmdName - \def\ef@next{\expandafter\processAppArgs#2}% - \else - \csname @eq% - \expandafter\@gobble\string#1\endcsname{#2}% - \def\ef@next{\processAppArgs}% - \fi - \fi - \fi + \@getCmdName{\epresets}% + \edef\arg@epresets{\@CmdName}\@getCmdName{#1}% + \ifx\arg@epresets\@CmdName + \def\ef@next{\let\protect\noexpand + \edef\x{#2}\set@typeset@protect\expandafter + \processAppArgs\x}% dps27 + \else + \csname @eq% + \expandafter\@gobble\string#1\endcsname{#2}% + \def\ef@next{\processAppArgs}% + \fi \fi + \fi \fi + \fi \fi - \ef@next + \fi + \ef@next } \def\@processEvery{\edef\eqtemp{}\toks0={}\@@processEvery} \def\@@processEvery#1{% @@ -269,6 +287,7 @@ \ifx\eq@W\@empty\let\link@BS\@empty\fi }\def\link@BS{} \def\@eqpresets#1{#1}% +\def\@eqepresets#1{#1} \def\@eqW#1{\def\eq@arg{#1}\ifx\eq@arg\@empty \let\eq@W\@empty\def\eq@W@value{0}\else \def\eq@W@value{#1}\def\eq@W{/W #1}\fi @@ -407,9 +426,15 @@ \let\eq@AAvalidate\@empty\else \def\eq@AAvalidate{/V<<\JS{#1}>>}\fi} \let\eq@AAvalidate\@empty +\def\@eqAddAAcalculate#1{\def\eq@arg{#1}\ifx\eq@arg\@empty + \else\def\eq@AAcalculate{;}\fi\def\eq@AddAAcalculate{#1}} +\let\eq@AddAAcalculate\@empty \def\@eqAAcalculate#1{\def\eq@arg{#1}\ifx\eq@arg\@empty - \let\eq@AAcalculate\@empty\else\isCalculatetrue - \def\eq@AAcalculate{/C<<\JS{#1}>>}\fi} + \let\eq@AAcalculate\@empty\else\isCalculatetrue + \ifx\eq@AAcalculate\ef@semicolon + \def\eq@AAcalculate{/C<<\JS{\eq@AddAAcalculate}>>}\else + \def\eq@AAcalculate{/C<<\JS{\eq@AddAAcalculate#1}>>}\fi\fi +} \let\eq@AAcalculate\@empty \def\@eqAApageopen#1{\def\eq@arg{#1}\ifx\eq@arg\@empty \let\eq@AApageopen\@empty\else @@ -639,6 +664,7 @@ \let\eq@TI\@empty\else\def\eq@TI{/TI #1}\fi} \def\eq@TI{} \def\@eqrawPDF#1{\def\eq@rawPDF{#1}}\def\eq@rawPDF{} +\def\@eqcmd#1{#1} \def\@eqQuadPoints#1{\def\eq@arg{#1}\ifx\eq@arg\@empty \let\eq@QuadPoints\@empty\else \def\eq@QuadPoints{/QuadPoints {#1}}\fi} @@ -726,6 +752,17 @@ \def\@eqmlcrackinsat#1{\def\eq@mlcrackinsat{#1}} \let\eq@mlcrackinsat\@empty \def\eq@protect#1{\let#1\@empty} +\def\ef@stop{\relax} %\def\ef@relax{\relax} +\def\protectedKeys#1#2{\ef@scratchtoks={}% + \@ifundefined{#1}{}{\PackageWarning{eforms} + {Be aware command name #1 is already\MessageBreak + in use}}\protectedKeys@gettwo#2\ef@stop\relax + \expandafter\edef\csname #1\endcsname{\the\ef@scratchtoks}} +\def\protectedKeys@gettwo#1#2{% + \ifx#1\ef@stop\else\ef@scratchtoks=\expandafter + {\the\ef@scratchtoks\protect#1{#2}}\expandafter + \protectedKeys@gettwo + \fi} \begingroup\catcode`\#=12 \catcode`*=6 \ifpdfmarkup \gdef\ef@Hx*1*2{\@nameuse{efHex*1*2}}\else @@ -918,55 +955,56 @@ \def\ef@djXPD{\ifxetex\ifmakeXasPD\ef@adjrectWH{2bp}\fi \else\ifmakePDasX\ef@adjrectWH{-2bp}\fi\fi} \def\ef@btnspcr{} -\def\eq@setButtonProps#1#2{% - \makeJSspecials - \processAppArgs#2\end\@nil % set widget properties - \ifx\eq@BC\@empty\@eqW{}\else - \if\eq@W@value0\let\eq@BC\@empty\fi\fi - \Hy@pdfstringfalse - \ifx\eq@rectW\@empty - \ifnum\eq@textSize=0 \else - \dimen@=\eq@textSize bp - \dimen@1.00375\dimen@ - \edef\eq@textSize@pt{\strip@pt\dimen@}% - \fontsize{\eq@textSize@pt}{0}\selectfont - \fi - \dimen@\eq@W@value bp - \def\eq@S@B{B}\ifx\eq@S@value\eq@S@B - \def\eq@btn@sp{\hbox to2\dimen@{\hfill}}% - \else - \def\eq@btn@sp{\hbox to\dimen@{\hfill}}% - \fi - \expandafter\def\expandafter - \ef@btnspcr\expandafter{\ef@btnspcr\eq@btn@sp}% - \sbox{\eq@tmpbox}{\ef@btnspcr\eq@CA\ef@btnspcr}% - \eq@tmpdima=\wd\eq@tmpbox - \sbox{\eq@tmpbox}{\ef@btnspcr\eq@RC\ef@btnspcr}% - \ifdim\eq@tmpdima>\wd\eq@tmpbox\else - \eq@tmpdima=\wd\eq@tmpbox\fi% - \sbox{\eq@tmpbox}{\ef@btnspcr\eq@AC\ef@btnspcr}% - \ifdim\eq@tmpdima>\wd\eq@tmpbox\else - \eq@tmpdima=\wd\eq@tmpbox\fi - \ifmakePDasX\advance\eq@tmpdima2bp\fi - \wd\eq@tmpbox=\eq@tmpdima +\@ifundefined{ifefpmca}{\newif\ifefpmca\efpmcafalse}{} +\def\pmcaOn{\efpmcatrue} +\def\pmcaOff{\efpmcafalse} +\def\eq@setButtonProps#1#2{\makeJSspecials + \processAppArgs#2\end\@nil % set widget properties + \ifx\eq@BC\@empty\@eqW{}\else + \if\eq@W@value0\let\eq@BC\@empty\fi\fi + \Hy@pdfstringfalse + \ifx\eq@rectW\@empty + \ifnum\eq@textSize=0 \else + \dimen@=\eq@textSize bp + \dimen@1.00375\dimen@ + \edef\eq@textSize@pt{\strip@pt\dimen@}% + \fontsize{\eq@textSize@pt}{0}\selectfont + \fi + \dimen@\eq@W@value bp + \def\eq@S@B{B}\ifx\eq@S@value\eq@S@B + \def\eq@btn@sp{\hbox to2\dimen@{\hfill}}% \else - \wd\eq@tmpbox=\eq@rectW + \def\eq@btn@sp{\hbox to\dimen@{\hfill}}% \fi - \ef@djXPD#1% dps 12/22 + \expandafter\def\expandafter + \ef@btnspcr\expandafter{\ef@btnspcr\eq@btn@sp}% + \sbox{\eq@tmpbox}{\ef@btnspcr\eq@CA\ef@btnspcr}% + \eq@tmpdima=\wd\eq@tmpbox + \sbox{\eq@tmpbox}{\ef@btnspcr\eq@RC\ef@btnspcr}% + \ifdim\eq@tmpdima>\wd\eq@tmpbox\else + \eq@tmpdima=\wd\eq@tmpbox\fi% + \sbox{\eq@tmpbox}{\ef@btnspcr\eq@AC\ef@btnspcr}% + \ifdim\eq@tmpdima>\wd\eq@tmpbox\else + \eq@tmpdima=\wd\eq@tmpbox\fi + \ifmakePDasX\advance\eq@tmpdima2bp\fi + \wd\eq@tmpbox=\eq@tmpdima + \else % if \eq@rectW is not \@empty + \wd\eq@tmpbox=\eq@rectW + \fi + \ifefpmca\PMCA{\eq@CA}\fi\ef@djXPD#1% } -\def\eq@setWidgetProps#1#2{% - \makeJSspecials - \processAppArgs#2\end\@nil % set widget properties - \ifx\annot@type@link\annot@type\else - \ifx\eq@BC\@empty\@eqW{}\else - \if\eq@W@value0\let\eq@BC\@empty\fi\fi - \fi - \ef@djXPD#1% dps 12/22 +\def\eq@setWidgetProps#1#2{\makeJSspecials + \processAppArgs#2\end\@nil % set widget properties + \ifx\annot@type@link\annot@type\else + \ifx\eq@BC\@empty\@eqW{}\else + \if\eq@W@value0\let\eq@BC\@empty\fi\fi + \fi + \ef@djXPD#1% } \def\ef@sanitize@toks{\@makeother\~\@makeother\#\@makeother\&% \@makeother\"\@makeother\_} \newcommand\efKern[2]{\ifxetex\kern#2\else\kern#1\fi} -\newcommand\olBdry{\bgroup\ifxetex % dps 12/22 +\newcommand\olBdry{\bgroup\ifxetex \@tempdima-\g@eq@W@value@bp\relax \edef\@mtkern{\the\@tempdima}\else \@tempdima2bp\relax\advance\@tempdima-\g@eq@W@value@bp\relax % 12/26 @@ -980,28 +1018,28 @@ \everypar{{\setbox\z@\lastbox}\clubpenalty\@M \everypar=\expandafter{\the\ef@scratchtoks}}} \newcommand\volBdry{\bgroup\parskip0pt\relax\@@par\nointerlineskip - \olBdry\egroup\efSupprIndent} + \olBdry\egroup\efSupprIndent} \newcommand\vcgBdry{\@ifstar{\edef\ef@offset{\the\parskip}\vcgBdry@i} - {\def\ef@offset{0pt}\vcgBdry@i}} + {\def\ef@offset{0pt}\vcgBdry@i}} \newcommand\vcgBdry@i[1][0bp]{\bgroup - \setlength{\ef@dimena}{#1-\ef@offset}\parskip0pt\relax - \par\nointerlineskip\cgBdry[\ef@dimena]% - \egroup\ignorespaces\efSupprIndent} + \setlength{\ef@dimena}{#1-\ef@offset}\parskip0pt\relax + \par\nointerlineskip\cgBdry[\ef@dimena]% + \egroup\ignorespaces\efSupprIndent} \def\common@choiceCode{% - /Subtype/Widget - /T (\Fld@name) - /FT/Ch - \eq@Ff - \eq@F - \eq@TU - \eq@TI - /BS << \eq@W\eq@S >> - /MK <<\eq@R\eq@BC\eq@BG\eq@mkIns>> - /DA (\eq@DA) - /Opt [\eq@Opt] - \eq@DV\eq@V - \eq@A\eq@AA - \eq@rawPDF + /Subtype/Widget + /T (\Fld@name) + /FT/Ch + \eq@Ff + \eq@F + \eq@TU + \eq@TI + /BS << \eq@W\eq@S >> + /MK <<\eq@R\eq@BC\eq@BG\eq@mkIns>> + /DA (\eq@DA) + /Opt [\eq@Opt] + \eq@DV\eq@V + \eq@A\eq@AA + \eq@rawPDF } \def\eqf@setDimens#1#2{\@eqrectW{#1}\@eqrectH{#2}} \let\ef@@nil\relax @@ -1011,348 +1049,291 @@ \def\ef@pdfstrCLOpt{\Hy@unicodefalse\def\eq@Opt{}\ef@pdfstrCLOpti} \def\ef@pdfstrCLOpti{\@ifnextchar\ef@@nil{\@gobble}{\ef@pdfstrCLOptia}} \def\ef@pdfstrCLOptia{\@ifnextchar[{\expandafter - \ef@pdfstrOptWBii\@gobble}{\ef@pdfstrCLOptb}} + \ef@pdfstrOptWBii\@gobble}{\ef@pdfstrCLOptb}} \def\ef@pdfstrCLOptb{\@ifstar{\g@addto@macrogobble\eq@Opt} - {\ef@pdfstrOptWPi}} + {\ef@pdfstrOptWPi}} \def\ef@pdfstrOptWBii{% - \@ifnextchar({\ef@pdfstrOptWBiia}{\PackageError{eforms} - {Left parenthesis expected here}{}}% -} + \@ifnextchar({\ef@pdfstrOptWBiia}{\PackageError{eforms} + {Left parenthesis expected here}{}}} \def\ef@pdfstrOptWBiia(#1){% - \g@addto@macro\eq@Opt{[(}% - \pdfstringdef\@optTokstemp{#1}% - \expandafter\g@addto@macro\expandafter\eq@Opt - \expandafter{\@optTokstemp}% - \@ifnextchar({\ef@pdfstrOptWBiib}{\PackageError{eforms} - {Left parenthesis expected here}{}}% -} + \g@addto@macro\eq@Opt{[(}% + \pdfstringdef\@optTokstemp{#1}% + \expandafter\g@addto@macro\expandafter\eq@Opt + \expandafter{\@optTokstemp}% + \@ifnextchar({\ef@pdfstrOptWBiib}{\PackageError{eforms} + {Left parenthesis expected here}{}}} \def\ef@pdfstrOptWBiib(#1){% - \g@addto@macro\eq@Opt{)(}% - \pdfstringdef\@optTokstemp{#1}% - \expandafter\g@addto@macro\expandafter\eq@Opt - \expandafter{\@optTokstemp}% - \g@addto@macro\eq@Opt{)]}% - \expandafter\ef@pdfstrCLOpti\@gobble -} + \g@addto@macro\eq@Opt{)(}% + \pdfstringdef\@optTokstemp{#1}% + \expandafter\g@addto@macro\expandafter\eq@Opt + \expandafter{\@optTokstemp}% + \g@addto@macro\eq@Opt{)]}% + \expandafter\ef@pdfstrCLOpti\@gobble} \def\ef@pdfstrOptWPi{\@ifnextchar\ef@@nil{\@gobble}{\ef@pdfstrOptWPii}} \def\ef@pdfstrOptWPii(#1){% - \g@addto@macro\eq@Opt{(}% - \pdfstringdef\@optTokstemp{#1}% - \expandafter\g@addto@macro\expandafter\eq@Opt - \expandafter{\@optTokstemp}% - \g@addto@macro\eq@Opt{)}% - \ef@pdfstrCLOpti} + \g@addto@macro\eq@Opt{(}% + \pdfstringdef\@optTokstemp{#1}% + \expandafter\g@addto@macro\expandafter\eq@Opt + \expandafter{\@optTokstemp}% + \g@addto@macro\eq@Opt{)}% + \ef@pdfstrCLOpti} \def\annot@type@listbox{listbox} \newcommand\list@@Box[8]{\begingroup - \edef\annot@type{\annot@type@listbox}% - \pdfstringdef\Fld@name{#2}% - \expandafter\ef@pdfstrCLOpt#5\ef@@nil - \eqf@setDimens{#3}{#4}% - \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% - \@processEvery#8\end\noindent#6#7{#1}% -} -\def\listBoxDefaults{% - \W{1}\S{I}\F{\FPrint}\BC{0 0 0} -} -\newcommand\listBox{\begingroup - \ef@sanitize@toks\ef@listbox -} -\newcommand{\ef@listbox}[1][]{% - \endgroup\ef@listBox[#1]% -} -\newcommand\ef@listBox[5][]{% - \mbox{\list@@Box{#1}{#2}{#3}{#4}{#5}{}{\eq@setWidgetProps - \eq@choice@driver}{\listBoxDefaults\every@listBox}}% -} + \let\nameuse\@nameuse + \edef\annot@type{\annot@type@listbox}% + \pdfstringdef\Fld@name{#2}\dl@paramlocal + \expandafter\ef@pdfstrCLOpt#5\ef@@nil + \eqf@setDimens{#3}{#4}% + \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% + \@processEvery#8\end\noindent#6#7{#1}} +\bgroup\obeyspaces +\gdef\listBox{\global\let =\dl@sp@ce}\egroup +\def\listBoxDefaults{\W{1}\S{I}\F{\FPrint}\BC{0 0 0}} +\bgroup\obeyspaces +\gdef\listBox{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@listbox}\egroup +\newcommand\ef@listbox[5][]{\endgroup + \mbox{\list@@Box{#1}{#2}{#3}{#4}{#5}{}{\eq@setWidgetProps + \eq@choice@driver}{\listBoxDefaults\every@listBox}}} \def\annot@type@combobox{combobox} \newcommand\combo@@Box[8]{\begingroup - \edef\annot@type{\annot@type@combobox}% - \@eqFf{\FfCombo}\pdfstringdef\Fld@name{#2}% - \expandafter\ef@pdfstrCLOpt#5\ef@@nil - \eqf@setDimens{#3}{#4}% - \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% - \@processEvery#8\end\noindent#6#7{#1}% -} -\def\comboBoxDefaults{% - \W{1}\S{I}\F{\FPrint}\BC{0 0 0} -} -\newcommand\comboBox{\begingroup - \ef@sanitize@toks\ef@combobox -} -\newcommand{\ef@combobox}[1][]{% - \endgroup\ef@comboBox[#1]% -} -\newcommand\ef@comboBox[5][]{% - \mbox{\combo@@Box{#1}{#2}{#3}{#4}{#5}{}{\eq@setWidgetProps - \eq@choice@driver}{\comboBoxDefaults\every@comboBox}}% -} + \let\nameuse\@nameuse + \edef\annot@type{\annot@type@combobox}% + \@eqFf{\FfCombo}\pdfstringdef\Fld@name{#2}\dl@paramlocal + \expandafter\ef@pdfstrCLOpt#5\ef@@nil + \eqf@setDimens{#3}{#4}% + \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% + \@processEvery#8\end\noindent#6#7{#1}} +\def\comboBoxDefaults{\W{1}\S{I}\F{\FPrint}\BC{0 0 0}} +\bgroup\obeyspaces +\gdef\comboBox{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@combobox}\egroup +\newcommand\ef@combobox[5][]{\endgroup + \mbox{\combo@@Box{#1}{#2}{#3}{#4}{#5}{}{\eq@setWidgetProps + \eq@choice@driver}{\comboBoxDefaults\every@comboBox}}} \def\eq@APX{\ifx\eq@I\@empty\eq@AP\else - /AP<< \expandafter\get@NIR\eq@I\@nil\space>>\fi} + /AP<< \expandafter\get@NIR\eq@I\@nil\space>>\fi} \def\get@NIR/#1 #2\@nil{/N #2} \def\common@pushButtonCode{% - /Subtype/Widget - /T (\Fld@name) - /FT/Btn - \eq@Ff - \eq@TU - \eq@H - \eq@F - /BS <<\eq@W\eq@S >> - /MK <<\eq@R\eq@BC\eq@BG% - \ef@kvCA\ef@kvRC\ef@kvAC\eq@IconMK\eq@mkIns>> - \eq@APX - /DA (\eq@DA) - \eq@A\eq@AA - \eq@rawPDF + /Subtype/Widget + /T (\Fld@name) + /FT/Btn + \eq@Ff + \eq@TU + \eq@H + \eq@F + /BS <<\eq@W\eq@S >> + /MK <<\eq@R\eq@BC\eq@BG% + \ef@kvCA\ef@kvRC\ef@kvAC\eq@IconMK\eq@mkIns>> + \eq@APX + /DA (\eq@DA) + \eq@A\eq@AA + \eq@rawPDF } \def\common@RadioCheckCode{% - /Subtype/Widget - /T (\Fld@name) - /FT/Btn - \eq@Ff - \eq@F - \eq@TU - /BS <<\eq@W\eq@S>> + /Subtype/Widget + /T (\Fld@name) + /FT/Btn + \eq@Ff + \eq@F + \eq@TU + /BS <<\eq@W\eq@S>> \ifx\eq@AP\@empty - /AP<< /N <<\eq@On<<>>>> >> - \eq@MK + /AP<< /N <<\eq@On<<>>>> >> + \eq@MK \else \eq@AP \fi - /DA (\eq@DA) - \eq@AS - \eq@DV\eq@V - \eq@A\eq@AA - \eq@rawPDF + /DA (\eq@DA) + \eq@AS + \eq@DV\eq@V + \eq@A\eq@AA + \eq@rawPDF } \def\annot@type@button{pushbtn} \newcommand\push@@Button[7]{\begingroup - \edef\annot@type{\annot@type@button}% - \pdfstringdef\Fld@name{#2}%\edef\Fld@name{#2}% - \makeJSspecials\ef@preProcDefns - \def\eq@Ff{/Ff \FfPushButton}% - \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% - \eqf@setDimens{#3}{#4}% - \@processEvery#7\end\noindent#5#6{#1}% -} + \let\nameuse\@nameuse + \edef\annot@type{\annot@type@button}% + \pdfstringdef\Fld@name{#2}\dl@paramlocal + \makeJSspecials\ef@preProcDefns + \def\eq@Ff{/Ff \FfPushButton}% + \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% + \eqf@setDimens{#3}{#4}% + \@processEvery#7\end\noindent#5#6{#1}} \def\pushButtonDefaults{% - \W{1}\S{B}\F{\FPrint}\BC{0 0 0} - \H{P}\BG{.7529 .7529 .7529} -} -\newcommand\pushButton{\begingroup - \ef@sanitize@toks\ef@pushbutton -} -\newcommand{\ef@pushbutton}[1][]{% - \endgroup\ef@pushButton[#1]% -} -\newcommand\ef@pushButton[4][]{% - \mbox{\push@@Button{#1}{#2}{#3}{#4}{}{% - \eq@setButtonProps\eq@Button@driver}% - {\pushButtonDefaults\every@PushButton}}% -} + \W{1}\S{B}\F{\FPrint}\BC{0 0 0} + \H{P}\BG{.7529 .7529 .7529}} +\bgroup\obeyspaces +\gdef\pushButton{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@pushbutton}\egroup +\newcommand\ef@pushbutton[4][]{\endgroup + \mbox{\push@@Button{#1}{#2}{#3}{#4}{}{% + \eq@setButtonProps\eq@Button@driver}% + {\pushButtonDefaults\every@PushButton}}} \def\annot@type@checkbox{checkbox} -\newcommand\check@@Box[8] -{% - \begingroup\let\#\ef@Hx - \edef\annot@type{\annot@type@checkbox}% - \pdfstringdef\Fld@name{#2}\@eqAS{Off}% - \def\@eqDV##1{\def\eq@arg{##1}\ifx\eq@arg\@empty\let\eq@DV\@empty - \else\ifpdfmarkup\def\eq@DV{/DV(##1) cvn }\else - \def\eq@DV{/DV/##1}\fi\fi}% - \def\@eqV##1{\def\eq@arg{##1}\ifx\eq@arg\@empty - \let\eq@V\@empty\else\ifpdfmarkup\def\eq@V{/V(##1) cvn }\else - \def\eq@V{/V/##1}\fi\@eqAS{##1}\fi}% - \eqf@setDimens{#3}{#4}% - \ifpdfmarkup\def\eq@On{(#5) cvn }\else - \def\eq@On{/#5}\fi\@eqtextFont{ZaDb}% - \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% - \@eqMK{\eq@R\eq@BC\eq@BG/CA(\symbol@choice)\eq@mkIns}% - \@processEvery#8\end\noindent#6#7{#1}% -} -\def\checkBoxDefaults{% - \F{\FPrint}\W{1}\S{S}\BC{0 0 0}% -} -\newcommand\checkBox{\begingroup - \ef@sanitize@toks\ef@checkbox -} -\newcommand{\ef@checkbox}[5][]{% - \endgroup\mbox{\check@@Box{#1}{#2}{#3}{#4}{#5}{}{\eq@setWidgetProps - \eq@RadioCheck@driver}{\checkBoxDefaults\every@CheckBox}}% -} +\newcommand\check@@Box[8]{\begingroup + \let\nameuse\@nameuse + \let\#\ef@Hx\edef\annot@type{\annot@type@checkbox}% + \pdfstringdef\Fld@name{#2}\@eqAS{Off}\dl@paramlocal + \def\@eqDV##1{\def\eq@arg{##1}\ifx\eq@arg\@empty\let\eq@DV\@empty + \else\ifpdfmarkup\def\eq@DV{/DV(##1) cvn }\else + \def\eq@DV{/DV/##1}\fi\fi}% + \def\@eqV##1{\def\eq@arg{##1}\ifx\eq@arg\@empty + \let\eq@V\@empty\else\ifpdfmarkup\def\eq@V{/V(##1) cvn }\else + \def\eq@V{/V/##1}\fi\@eqAS{##1}\fi}% + \eqf@setDimens{#3}{#4}% + \ifpdfmarkup\def\eq@On{(#5) cvn }\else + \def\eq@On{/#5}\fi\@eqtextFont{ZaDb}% + \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% + \@eqMK{\eq@R\eq@BC\eq@BG/CA(\symbol@choice)\eq@mkIns}% + \@processEvery#8\end\noindent#6#7{#1}} +\def\checkBoxDefaults{\F{\FPrint}\W{1}\S{S}\BC{0 0 0}} +\bgroup\obeyspaces +\gdef\checkBox{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@checkbox}\egroup +\newcommand{\ef@checkbox}[5][]{\endgroup + \mbox{\check@@Box{#1}{#2}{#3}{#4}{#5}{}{\eq@setWidgetProps + \eq@RadioCheck@driver}{\checkBoxDefaults\every@CheckBox}}} \def\annot@type@radio{radiobtn} \newcommand\radio@@Button[8]{\begingroup\let\#\ef@Hx - \edef\annot@type{\annot@type@radio}% - \pdfstringdef\Fld@name{#2}\@eqAS{Off}% - \def\@eqDV##1{\def\eq@arg{##1}\ifx\eq@arg\@empty\let\eq@DV\@empty - \else\ifpdfmarkup\def\eq@DV{/DV(##1) cvn }\else - \def\eq@DV{/DV/##1}\fi\fi}% - \def\@eqV##1{\def\eq@arg{##1}\ifx\eq@arg\@empty - \let\eq@V\@empty\else\ifpdfmarkup\def\eq@V{/V(##1) cvn }\else - \def\eq@V{/V/##1}\fi\@eqAS{##1}\fi}% - \eqf@setDimens{#3}{#4}% - \ifpdfmarkup\def\eq@On{(#5) cvn }\else\def\eq@On{/#5}\fi - \def\eq@Ff{/Ff \FfRadio}\@eqtextFont{ZaDb}% - \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% - \@eqMK{\eq@R\eq@BC\eq@BG/CA(\symbol@choice)\eq@mkIns}% - \@processEvery#8\end\noindent#6#7{#1}% -} -\def\radioButtonDefaults -{% - \W{1}\S{S}\BC{0 0 0}\F{\FPrint} -} -\newcommand\radioButton{\begingroup - \ef@sanitize@toks\ef@radiobutton -} + \let\nameuse\@nameuse + \edef\annot@type{\annot@type@radio}% + \pdfstringdef\Fld@name{#2}\@eqAS{Off}\dl@paramlocal + \def\@eqDV##1{\def\eq@arg{##1}\ifx\eq@arg\@empty\let\eq@DV\@empty + \else\ifpdfmarkup\def\eq@DV{/DV(##1) cvn }\else + \def\eq@DV{/DV/##1}\fi\fi}% + \def\@eqV##1{\def\eq@arg{##1}\ifx\eq@arg\@empty + \let\eq@V\@empty\else\ifpdfmarkup\def\eq@V{/V(##1) cvn }\else + \def\eq@V{/V/##1}\fi\@eqAS{##1}\fi}% + \eqf@setDimens{#3}{#4}% + \ifpdfmarkup\def\eq@On{(#5) cvn }\else\def\eq@On{/#5}\fi + \def\eq@Ff{/Ff \FfRadio}\@eqtextFont{ZaDb}% + \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% + \@eqMK{\eq@R\eq@BC\eq@BG/CA(\symbol@choice)\eq@mkIns}% + \@processEvery#8\end\noindent#6#7{#1}} +\def\radioButtonDefaults{\W{1}\S{S}\BC{0 0 0}\F{\FPrint}} +\bgroup\obeyspaces +\gdef\radioButton{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@radiobutton}\egroup \newcommand{\ef@radiobutton}[5][]{\endgroup - \mbox{\radio@@Button{#1}{#2}{#3}{#4}{#5}{}{\eq@setWidgetProps - \eq@RadioCheck@driver}{\radioButtonDefaults\every@RadioButton}}% -} -\newcommand\ef@radioButton[5][] -{% - \mbox{\radio@@Button{#1}{#2}{#3}{#4}{#5}{}{\eq@setWidgetProps - \eq@RadioCheck@driver}{\radioButtonDefaults\every@RadioButton}}% -} + \mbox{\radio@@Button{#1}{#2}{#3}{#4}{#5}{}{\eq@setWidgetProps + \eq@RadioCheck@driver}{\radioButtonDefaults\every@RadioButton}}} \def\common@TextFieldCode {% - /Subtype/Widget - /T (\Fld@name) - /FT/Tx - \eq@Ff - \eq@F - \eq@Q - \eq@TU - \eq@MaxLen - /BS <<\eq@W\eq@S>> - /MK <<\eq@R\eq@BC\eq@BG\eq@mkIns>> - /DA (\eq@DA) - \eq@DV\eq@V - \eq@RV\eq@DS - \eq@A\eq@AA - \eq@rawPDF + /Subtype/Widget + /T (\Fld@name) + /FT/Tx + \eq@Ff + \eq@F + \eq@Q + \eq@TU + \eq@MaxLen + /BS <<\eq@W\eq@S>> + /MK <<\eq@R\eq@BC\eq@BG\eq@mkIns>> + /DA (\eq@DA) + \eq@DV\eq@V + \eq@RV\eq@DS + \eq@A\eq@AA + \eq@rawPDF } \def\annot@type@text{textfld} -\newcommand\text@@Field[7] -{% - \begingroup - \edef\annot@type{\annot@type@text}% - \pdfstringdef\Fld@name{#2}\def\eq@Title{#2}% - \eqf@setDimens{#3}{#4}% - \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% - \@processEvery#7\end\noindent#5#6{#1}% -} -\def\textFieldDefaults -{% - \F{\FPrint}\BC{0 0 0}\W{1}\S{S} -} -\newcommand\textField{\begingroup - \ef@sanitize@toks\ef@textfield -} -\newcommand{\ef@textfield}[2][]{% - \endgroup\ef@textField[#1]{#2}% -} -\newcommand\ef@textField[4][] -{% - \mbox{\text@@Field{#1}{#2}{#3}{#4}{}% - {\eq@setWidgetProps\eq@TextField}% - {\textFieldDefaults\every@TextField}}% -} +\newcommand\text@@Field[7]{\begingroup + \let\nameuse\@nameuse + \edef\annot@type{\annot@type@text}% + \pdfstringdef\Fld@name{#2}\dl@paramlocal + \def\eq@Title{#2}\eqf@setDimens{#3}{#4}% + \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% + \@processEvery#7\end\noindent#5#6{#1}} +\def\textFieldDefaults{\F{\FPrint}\BC{0 0 0}\W{1}\S{S}} +\bgroup\obeyspaces +\gdef\textField{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@textfield}\egroup +\newcommand\ef@textfield[4][]{\endgroup + \mbox{\text@@Field{#1}{#2}{#3}{#4}{}% + {\eq@setWidgetProps\eq@TextField}% + {\textFieldDefaults\every@TextField}}} \let\eqTextField\textField \let\calcTextField\textField \def\common@SigFieldCode {% - /Subtype /Widget - /T (\Fld@name) - /FT/Sig - \eq@F - \eq@TU - /BS <<\eq@W\eq@S>> - /MK <<\eq@R\eq@BC\eq@BG\eq@mkIns>> - /DA (\eq@DA) - \eq@Lock - \eq@A\eq@AA - \eq@rawPDF + /Subtype /Widget + /T (\Fld@name) + /FT/Sig + \eq@F + \eq@TU + /BS <<\eq@W\eq@S>> + /MK <<\eq@R\eq@BC\eq@BG\eq@mkIns>> + /DA (\eq@DA) + \eq@Lock + \eq@A\eq@AA + \eq@rawPDF } \def\annot@type@sig{sigfld} -\newcommand\sig@@Field[7]{% - \begingroup - \edef\annot@type{\annot@type@sig}% - \pdfstringdef\Fld@name{#2}\def\eq@Title{#2}% - \eqf@setDimens{#3}{#4}% - \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% - \@processEvery#7\end\noindent#5#6{#1}% -} -\def\sigFieldDefaults -{% - \F{\FPrint}\BC{}\BG{}\W{1}\S{S} -} -\newcommand\sigField{\begingroup - \ef@sanitize@toks\ef@sigfield -} -\newcommand{\ef@sigfield}[1][]{% - \endgroup\ef@sigField[#1]% -} -\newcommand\ef@sigField[4][] -{% - \mbox{\sig@@Field{#1}{#2}{#3}{#4}{}{\eq@setWidgetProps\eq@SigField}% - {\sigFieldDefaults\every@sigField}}% -} +\newcommand\sig@@Field[7]{\begingroup + \let\nameuse\@nameuse + \edef\annot@type{\annot@type@sig}% + \pdfstringdef\Fld@name{#2}\dl@paramlocal + \def\eq@Title{#2}\eqf@setDimens{#3}{#4}% + \def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}% + \@processEvery#7\end\noindent#5#6{#1}} +\def\sigFieldDefaults{\F{\FPrint}\BC{}\BG{}\W{1}\S{S}} +\bgroup\obeyspaces +\gdef\sigField{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@sigfield}\egroup +\newcommand\ef@sigfield[4][]{\endgroup + \mbox{\sig@@Field{#1}{#2}{#3}{#4}{}{\eq@setWidgetProps\eq@SigField}% + {\sigFieldDefaults\every@sigField}}} \def\common@LinkCode {% - \eq@A % Action - \eq@H % Highlight - \eq@Color % Border color - \link@BS % Border styles - \eq@rawPDF % everything else + \eq@A % Action + \eq@H % Highlight + \eq@Color % Border color + \link@BS % Border styles + \eq@rawPDF % everything else } \def\annot@type@link{link} -\newcommand\set@@Link[7] -{% - \begingroup - \makeJSspecials - \edef\annot@type{\annot@type@link}% - \ef@preProcDefns - \eqf@setDimens{#2}{#3}% - \ifx\eq@rectW\@empty\def\link@@Box{#4}\else - \def\eq@arg{#4}\ifx\eq@arg\@empty - \def\eq@content{\hfill\vfill}\else\def\eq@content{#4}\fi - \def\link@@Box{\parbox[\eq@pos][\eq@rectH][\eq@innerpos]% - {\eq@rectW}{\centering\eq@content}}% - \fi - \@processEvery#7\end\noindent#5#6{#1}% -} +\newcommand\set@@Link[7]{\begingroup + \let\nameuse\@nameuse + \dl@paramlocal + \makeJSspecials + \edef\annot@type{\annot@type@link}% + \ef@preProcDefns + \eqf@setDimens{#2}{#3}% + \ifx\eq@rectW\@empty\def\link@@Box{#4}\else + \def\eq@arg{#4}\ifx\eq@arg\@empty + \def\eq@content{\hfill\vfill}\else\def\eq@content{#4}\fi + \def\link@@Box{\parbox[\eq@pos][\eq@rectH][\eq@innerpos]% + {\eq@rectW}{\centering\eq@content}}\fi + \@processEvery#7\end\noindent#5#6{#1}} \def\defaultlinkcolor{\@linkcolor} \def\setDef@ultLinkColor{\ifHy@colorlinks - \def\ef@thislinkcolor{\defaultlinkcolor} - \def\ef@colorthislink{\color{\ef@thislinkcolor}}\else - \let\ef@colorthislink\relax\fi -} + \def\ef@thislinkcolor{\defaultlinkcolor}% + \def\ef@colorthislink{\color{\ef@thislinkcolor}}\else + \let\ef@colorthislink\relax\fi} \AtBeginDocument{\setDef@ultLinkColor} \def\set@LinkTextDefaults{\S{S}\Border{0 0 0}} -\newcommand\setLink{\begingroup - \ef@sanitize@toks\ef@setlinktext -} +\bgroup\obeyspaces +\gdef\setLink{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@setlinktext}\egroup \let\setLinkText\setLink -\newcommand{\ef@setlinktext}[1][]{% - \endgroup\ef@searchmlLink#1\mlLink\end\@nil - \ifx\ef@mlLink\ef@Zero\def\ef@next{\set@LinkText[#1]}\else - \def\ef@next{\mlhypertext[#1]}\fi\ef@next -} +\newcommand{\ef@setlinktext}[1][]{\endgroup + \ef@searchmlLink#1\mlLink\end\@nil + \ifx\ef@mlLink\ef@Zero\def\ef@next{\set@LinkText[#1]}\else + \def\ef@next{\mlhypertext[#1]}\fi\ef@next} \newcommand\set@LinkText[2][]{% - \set@@Link{#1}{}{}{\ef@colorthislink#2}{}% - {\eq@setWidgetProps{\ef@postProcLinkProps\setLink@driver}}% - {\set@LinkTextDefaults\every@Link}% -} + \set@@Link{#1}{}{}{\ef@colorthislink#2}{}% + {\eq@setWidgetProps{\ef@postProcLinkProps\setLink@driver}}% + {\set@LinkTextDefaults\every@Link}} \def\ef@preProcDefns{% - \def\Win##1{/Win <<##1>>}% - \def\fitpage{\dl@fitpage}\def\actualsize{\dl@actualsize}% - \def\fitwidth{\dl@fitwidth}\def\fitheight{\dl@fitheight}% - \def\fitvisible{\dl@fitvisible}\def\inheritzoom{\dl@inheritzoom}% - \let\rPage\ef@rPage - \edef\Page##1{\ifcase\eq@drivernum - {Page##1}\or - \noexpand\pdfpageref##1\space\space 0 R\or - \noexpand @page##1\fi - }% + \def\Win##1{/Win <<##1>>}% + \def\fitpage{\dl@fitpage}\def\actualsize{\dl@actualsize}% + \def\fitwidth{\dl@fitwidth}\def\fitheight{\dl@fitheight}% + \def\fitvisible{\dl@fitvisible}\def\inheritzoom{\dl@inheritzoom}% + \let\rPage\ef@rPage + \edef\Page##1{\ifcase\eq@drivernum + {Page##1}\or + \noexpand\pdfpageref##1\space\space 0 R\or + \noexpand @page##1\fi}% } \def\ef@postProcLinkProps{} \newcommand{\mlsetLink}{\mlhypertext} @@ -1361,48 +1342,37 @@ does nothing unless\MessageBreak the aeb_mlink package is loaded}}{}% #2} \def\set@LinkBboxDefaults{\S{S}\Border{0 0 0}} -\newcommand{\setLinkBbox}{\begingroup - \ef@sanitize@toks\ef@linkbbox -} -\newcommand{\ef@linkbbox}[1][]{% - \endgroup\ef@setLinkBbox[#1]% -} -\newcommand{\ef@setLinkBbox}[3][]{% - \@setLinkBbox{#1}{#2}{#3}% -} -\def\@setLinkBbox#1#2#3{\@ifnextchar[{\@@setLinkBbox{#1}{#2}{#3}}% - {\@@setLinkBbox{#1}{#2}{#3}[c]}} -\def\@@setLinkBbox#1#2#3[#4]{% - \@ifnextchar[{\@@@setLinkBbox{#1}{#2}{#3}{#4}}% - {\@@@setLinkBbox{#1}{#2}{#3}{#4}[#4]}% -} +\bgroup\obeyspaces +\gdef\setLinkBbox{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@setLinkbbox}\egroup +\newcommand{\ef@setLinkbbox}[3][]{\endgroup + \@setLinkBbox{#1}{#2}{#3}} +\def\@setLinkBbox#1#2#3{\@ifnextchar[% + {\@@setLinkBbox{#1}{#2}{#3}}% + {\@@setLinkBbox{#1}{#2}{#3}[c]}} +\def\@@setLinkBbox#1#2#3[#4]{\@ifnextchar[% + {\@@@setLinkBbox{#1}{#2}{#3}{#4}}% + {\@@@setLinkBbox{#1}{#2}{#3}{#4}[#4]}} \def\@@@setLinkBbox#1#2#3#4[#5]#6{% - \def\eq@pos{#4}\def\eq@innerpos{#5}% - \set@@Link{#1}{#2}{#3}{\ef@colorthislink#6}% - {\eq@setWidgetProps\setLink@driver}{}% - {\set@LinkBboxDefaults\every@Link}% -} + \def\eq@pos{#4}\def\eq@innerpos{#5}% + \set@@Link{#1}{#2}{#3}{\ef@colorthislink#6}% + {\eq@setWidgetProps\setLink@driver}{}% + {\set@LinkBboxDefaults\every@Link}} \def\set@LinkPboxDefaults{\S{S}\Border{0 0 0}} -\newcommand\setLinkPbox{\begingroup - \ef@sanitize@toks\ef@linkpbox -} -\newcommand{\ef@linkpbox}[1]{% - \endgroup\ef@setLinkPbox{#1}% -} -\newcommand\ef@setLinkPbox[1]{% - \@setLinkPbox{#1\BS{}}{}{}{\hfill\vfill}% -} +\bgroup\obeyspaces +\gdef\setLinkPbox{\begingroup\global\let =\pdfSP +\ef@sanitize@toks\ef@setLinkpbox}\egroup +\newcommand\ef@setLinkpbox[1]{\endgroup + \@setLinkPbox{#1\BS{}}{}{}{\hfill\vfill}} \def\@setLinkPbox#1#2#3{\@ifnextchar[{\@@setLinkPbox{#1}{#2}{#3}}% - {\@@setLinkPbox{#1}{#2}{#3}[c]}} + {\@@setLinkPbox{#1}{#2}{#3}[c]}} \def\@@setLinkPbox#1#2#3[#4]{% - \@ifnextchar[{\@@@setLinkPbox{#1}{#2}{#3}{#4}}% - {\@@@setLinkPbox{#1}{#2}{#3}{#4}[#4]} -} + \@ifnextchar[{\@@@setLinkPbox{#1}{#2}{#3}{#4}}% + {\@@@setLinkPbox{#1}{#2}{#3}{#4}[#4]}} \def\@@@setLinkPbox#1#2#3#4[#5]#6{% - \def\eq@pos{#4}\def\eq@innerpos{#5}% - \set@@Link{#1}{#2}{#3}{#6}{\eq@setWidgetProps\setLinkPbox@driver}% - {}{\set@LinkPboxDefaults\every@Link}% -} + \def\eq@pos{#4}\def\eq@innerpos{#5}% + \set@@Link{#1}{#2}{#3}{#6}{\eq@setWidgetProps\setLinkPbox@driver}% + {}{\set@LinkPboxDefaults\every@Link}} \input{\eq@drivercode} \inputCalcOrderJS \endinput diff --git a/texmf-dist/tex/latex/acrotex/epdfmark.def b/texmf-dist/tex/latex/acrotex/epdfmark.def index be20a1c6..cac5bc72 100644 --- a/texmf-dist/tex/latex/acrotex/epdfmark.def +++ b/texmf-dist/tex/latex/acrotex/epdfmark.def @@ -23,7 +23,7 @@ \def\eq@choice@driver {% \Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \pdf@rect{\lower\eqcenterWidget\ef@Bbox{\eq@rectW}{\eq@rectH}}% @@ -34,12 +34,13 @@ /ANN pdfmark \ifisCalculate[ {corder} {\Fld@name} /APPEND pdfmark\fi }\to@insertStrucTabOrder{Form}\endgroup + \dl@restorespcs } \def\eq@Button@driver {% \Hy@pdfstringtrue \ifx\eq@rectW\@empty\def\eq@rectW{\wd\eq@tmpbox}\ef@djXPD\fi - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \pdf@rect{\lower\eqcenterWidget\ef@Bbox{\eq@rectW}{\eq@rectH}}% @@ -47,11 +48,12 @@ [ \eq@objdef/Rect [pdf@llx pdf@lly pdf@urx pdf@ury] \common@pushButtonCode /ANN pdfmark}\to@insertStrucTabOrder{Form}\endgroup + \dl@restorespcs } \def\eq@RadioCheck@driver {% \Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \ifx\eq@rectW\@empty\def\eq@rectW{\wd\eq@tmpbox}\fi @@ -60,6 +62,7 @@ [ \eq@objdef/Rect [pdf@llx pdf@lly pdf@urx pdf@ury] \common@RadioCheckCode /ANN pdfmark}\to@insertStrucTabOrder{Form}\endgroup + \dl@restorespcs } \def\eq@l@check@driver {% @@ -68,9 +71,10 @@ [ \eq@objdef/Rect [pdf@llx pdf@lly pdf@urx pdf@ury] \common@RadioCheckCode /ANN pdfmark}\endgroup + \dl@restorespcs } \def\eq@TextField{\Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \pdf@rect{\lower\eqcenterWidget\ef@Bbox{\eq@rectW}{\eq@rectH}}% @@ -81,9 +85,10 @@ /ANN pdfmark \ifisCalculate[ {corder} {\Fld@name} /APPEND pdfmark\fi }\to@insertStrucTabOrder{Form}\endgroup + \dl@restorespcs } \def\eq@SigField{\Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \pdf@rect{\lower\eqcenterWidget\ef@Bbox{\eq@rectW}{\eq@rectH}}% @@ -92,6 +97,7 @@ \common@SigFieldCode /ANN pdfmark }\to@insertStrucTabOrder{Form}\endgroup + \dl@restorespcs } \def\convertAToAction/A#1\@nil{\def\eq@A{/Action#1}} \def\setLink@driver @@ -106,6 +112,7 @@ /Subtype /Link /ANN pdfmark}% \to@insertStrucTabOrder{Link}\endgroup + \dl@restorespcs } \def\pboxRect{/Rect [\par@@Rect]} \def\mllnkcontainer#1{#1} @@ -121,6 +128,7 @@ /Subtype /Link /ANN pdfmark}}% \to@insertStrucTabOrder{Link}\endgroup + \dl@restorespcs } \endinput %% diff --git a/texmf-dist/tex/latex/acrotex/epdftex.def b/texmf-dist/tex/latex/acrotex/epdftex.def index aef1ac3f..0c36ec23 100644 --- a/texmf-dist/tex/latex/acrotex/epdftex.def +++ b/texmf-dist/tex/latex/acrotex/epdftex.def @@ -31,45 +31,49 @@ \def\eq@choice@driver {% \Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \hbox{\pdfstartlink user{\common@choiceCode}% \lower\eqcenterWidget\ef@Bbox{\eq@rectW}{\eq@rectH}\pdfendlink}% \HyField@AddToFields \endgroup + \dl@restorespcs } \def\eq@Button@driver {% \Hy@pdfstringtrue \ifx\eq@rectW\@empty\def\eq@rectW{\wd\eq@tmpbox}\ef@djXPD\fi - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \ifx\eq@rectW\@empty\def\eq@rectW{\wd\eq@tmpbox}\fi - \hbox{\pdfstartlink user{ \common@pushButtonCode }% + \hbox{\pdfstartlink user{\common@pushButtonCode}% \lower\eqcenterWidget\ef@Bbox{\eq@rectW}{\eq@rectH}\pdfendlink}% \endgroup + \dl@restorespcs } \def\eq@RadioCheck@driver {% \Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \ifx\eq@rectW\@empty\def\eq@rectW{\wd\eq@tmpbox}\fi \hbox{\pdfstartlink user{\common@RadioCheckCode}% \lower\eqcenterWidget\ef@Bbox{\eq@rectW}{\eq@rectH}\pdfendlink}% \endgroup + \dl@restorespcs } \def\eq@l@check@driver {% \pdfstartlink user{\common@RadioCheckCode}% \makebox[\eq@tmpdima]{\phantom{\link@@Content}}% \pdfendlink\endgroup + \dl@restorespcs } \def\eq@TextField{\Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \leavevmode @@ -77,14 +81,16 @@ \lower\eqcenterWidget\ef@Bbox{\eq@rectW}{\eq@rectH}\pdfendlink}% \HyField@AddToFields \endgroup + \dl@restorespcs } \def\eq@SigField{\Hy@pdfstringtrue - \if\@vertRotate1 \let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% + \if\@vertRotate1\let\W@temp\eq@rectW\edef\eq@rectW{\eq@rectH}% \edef\eq@rectH{\W@temp}\fi\centerWidget\eq@rectH \ifx\autoCenter\ef@n\eqcenterWidget=0pt\fi \leavevmode\hbox{\pdfstartlink user{\common@SigFieldCode}% \lower\eqcenterWidget\ef@Bbox{\eq@rectW}{\eq@rectH}\pdfendlink}% \endgroup + \dl@restorespcs } \def\setLink@driver {% @@ -95,6 +101,7 @@ \Hy@colorlink{\@linkcolor}\link@@Box \close@pdflink \endgroup + \dl@restorespcs } \def\ef@setTabOrder{\ifx\ef@taborder\@empty\else \edef\ef@tmp@toks{\the\pdfpageattr\space/Tabs/\ef@taborder}% diff --git a/texmf-dist/tex/latex/acrotex/eqexam.def b/texmf-dist/tex/latex/acrotex/eqexam.def new file mode 100644 index 00000000..1cdf0433 --- /dev/null +++ b/texmf-dist/tex/latex/acrotex/eqexam.def @@ -0,0 +1,1734 @@ +%% +%% This is file `eqexam.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% exerquiz.dtx (with options: `eqexam') +%% +\ProvidesFile{eqexam.def} + [2019/02/11 v8.2.9 % + Exerquiz support file for eqexam (dps)] +\let\eq@YES=y \let\eq@NO=n +\let\eq@One=1 \let\eq@Zero=0 +\def\eq@r{r}\let\eq@f=f \let\eq@l=l +\newif\ifeq@noforms \eq@noformsfalse +\newif\ifeq@noquizsolutions \eq@noquizsolutionsfalse +\newif\ifnocorrections \nocorrectionsfalse +\@ifundefined{ifeqe@flextended}{\newif\ifeqe@flextended + \eqe@flextendedfalse}{} +\@ifundefined{ifcont@nnot}{\newif\ifcont@nnot \cont@nnotfalse}{} +\@ifundefined{if@eqalignfilllinestoleft} + {\newif\if@eqalignfilllinestoleft\@eqalignfilllinestoleftfalse}{} +\newif\ifkeepdeclaredvspacing \keepdeclaredvspacingfalse +\newif\ifeq@nolink \eq@nolinkfalse +\def\eq@ckglobalhide{\ifeq@globalshowsolutions\eq@hidesolutionfalse\fi} +\def\hidesymbol{h}\def\Hidesymbol{H} +\newif\iftherearesolutions \therearesolutionsfalse +\newif\ifIsRespBox \global\IsRespBoxfalse +\def\SolutionsAfter{\solutionsAtEndfalse\eq@solutionsaftertrue + \displayworkareafalse\eq@proofingfalse\eq@nolinktrue} +\newif\ifcqSA\cqSAfalse +\def\SolutionsAtEnd{\solutionsAtEndtrue\vspacewithsolnstrue + \eq@solutionsafterfalse\eq@nolinkfalse + \displayworkareafalse\ifvspacewithsolns\eq@nosolutionsfalse\else + \eq@nosolutionstrue\fi\eq@proofingfalse\answerkeyfalse} +\def\NoSpaceToWork{\let\eq@insertverticalspace\eq@NO} +\def\SpaceToWork{\let\eq@insertverticalspace\eq@YES} +\SpaceToWork +\long\def\ifNoSolutions#1#2{% + \ifeq@nosolutions\expandafter#1\else + \expandafter#2\fi} +\newif\ifeq@randomizeChoices \eq@randomizeChoicesfalse +\newif\ifeq@randomizeallChoices \eq@randomizeallChoicesfalse +\def\turnOnRandomize{\eq@randomizeallChoicestrue} +\def\obeyLocalRandomize{\eq@randomizeallChoicesfalse} +\let\saveRandomSeed\relax +\let\inputRandomSeed\relax +\newcommand{\exsolafter}{\eq@exsolafterDefault} +\newcommand{\resetSolnAfterToDefault}{% + \def\exsolafter{\eq@exsolafterDefault}} +\newcommand{\exsolafterDefault}[1]{\def\eq@exsolafterDefault{#1}% + \def\exSolafterDefault{#1}\resetSolnAfterToDefault} +\exsolafterDefault{\textit{Solution}:} +\newcommand{\renameSolnAfterTo}[1]{\def\exsolafter{#1}} +\newcommand{\adjDisplayBelow}{\vskip-\lastskip\vskip-\baselineskip} +\newcommand{\adjDisplayBelowPlus}{\adjDisplayBelow\recoverDisplayBelow} +\def\recoverDisplayBelow{\vskip\belowdisplayskip} +\newcommand\setDefShortQuizLabelName[1]% + {\def\eq@defaultShortQuizLabelName{#1}} +\setDefShortQuizLabelName{Quiz} +\newcommand{\writeToExSolns@}[1]{% + \ifsolutionsonly\else + \ifOKToWriteExamData + \set@display@protect + \immediate\write\ex@solns{#1}\set@typeset@protect + \fi\fi}% +\ifsolutionsonly + \InputIfFileExists{\jobname_xdefs.cut}{% + \typeout{^^JExerquiz|Eqexam: Reading \jobname_xdefs.cut^^J}} + {\PackageWarningNoLine{exerquiz|eqexam}{% + \jobname_xdefs.cut not found.\MessageBreak + Recompile file under the vspacewithsolns\MessageBreak + option, then compile with the solutionsonly\MessageBreak + option}} + \let\writeToExSolns\@gobble +\else + \newwrite\ex@solns \immediate\openout \ex@solns \jobname.sol + \let\writeToExSolns\writeToExSolns@ + \newwrite\eq@xrefdefns + \immediate\openout\eq@xrefdefns\jobname_xdefs.cut +\fi +\let\writeT@ExSolns\writeToExSolns +\newwrite\quiz@solns \immediate\openout \quiz@solns \jobname.qsl +\newcommand{\writeToQzSolns}[1]{\ifOKToWriteExamData\set@display@protect + \immediate\write\quiz@solns{#1}\set@typeset@protect\fi} +\let\writeT@QzSolns\writeToQzSolns +\def\eq@IWAuxOut#1{\immediate\write\@auxout{#1}} +\def\eq@IWDefs#1{\immediate\write\eq@xrefdefns{#1}} +\@ifundefined{ifOKToWriteExamData}{\newif\ifOKToWriteExamData + \OKToWriteExamDatatrue}{} +\def\noSolnWrites{\OKToWriteExamDatafalse} +\def\normalSolnWrites{\OKToWriteExamDatatrue} +\def\bHideSolnIn#1{#1{\protect\iffalse}\noSolnWrites} +\def\eHideSolnIn#1{\normalSolnWrites#1{\protect\fi^^J}} +\newcounter{eqexno} \setcounter{eqexno}{0} +\newcounter{@exno} \setcounter{@exno}{0} % running exno +\newcounter{quizno} \setcounter{quizno}{0} +\renewcommand\thequizno{\alph{quizno}} +\newcounter{eqpointvalue} \setcounter{eqpointvalue}{0} +\newlength\eq@tmplength +\newlength\eqtmplength +\newcounter{questionno} +\newcounter{eqquestionnoi} +\newcounter{eqquestionnoii} +\newcounter{eqquestionnoiii} +\newcount\@eqquestiondepth \@eqquestiondepth=0 +\newcounter{partno} +\newif\ifuseNumForParts\useNumForPartsfalse +\def\alphaParts{\def\partnoFmt{\alph}\useNumForPartsfalse}\alphaParts +\def\numberParts{\def\partnoFmt{\arabic}\useNumForPartstrue} +\renewcommand\thepartno{\partnoFmt{partno}} +\newtoks\eq@scratchtoks +\def\verbatimwrite{\@bsphack + \let\do\@makeother\dospecials + \catcode`\^^M\active \catcode`\^^I=12 + \def\verbatim@processline{% + \immediate\write\verbatim@out + {\the\verbatim@line}}% + \verbatim@start} +\def\endverbatimwrite{\@esphack} +\providecommand\PBS[1]{\let\temp=\\#1\let\\=\temp} +\newcommand{\belowexskip}[1]{\setlength{\eq@tmplength}{#1}% + \edef\eq@exerskip{\noexpand\removelastparskip + \noexpand\vskip\the\eq@tmplength\relax\kern0pt}} +\let\eqexerskip\belowexskip +\belowexskip{\medskipamount} +\newcommand{\aboveexskip}[1]{\setlength{\eq@tmplength}{#1}% + \edef\eq@priorexskip{\noexpand\vskip\the\eq@tmplength\relax + \kern0pt}} +\let\priorexskip\aboveexskip +\aboveexskip{\medskipamount} +\let\eq@postexerciseHook\relax +\newcommand\belowexsolnskip{\protect\medskip} +\def\removelastparskip{\ifdim\parskip>0pt\vskip-\parskip\fi} +\let\marginparpriorhook\@empty % used to material before the exercise +\let\marginparafterhook\@empty % used to material after the exercise +\let\afterlabelhskip\space +\let\exersolnheadhook\@empty +\let\exer@solnheadhook\@empty +\newcommand{\eqexheader} +{% + \mbox{\color{\@nolinkcolor}\if\exerstar*\exlabelformatwp\else + \exlabelformat\fi}% +} +\def\eqexheader@wrapper{\hypertarget{qex.\the@exno}{\eqexheader}} +\newcommand{\partsformat}[1]{\def\eq@partsformat{#1}} +\partsformat{(\hfil\thepartno\hfil)} +\newcommand{\defaultpartsformat}{% + \partsformat{(\hfil\thepartno\hfil)}} +\let\exlisttabheaderpriorhook\@empty +\let\exlisttabheaderafterhook\@empty +\newcommand{\eqexlisttabheader} +{% + \exlisttabheaderpriorhook + \color{\@nolinkcolor}\eq@partsformat +} +\newcount\cq@Cnt +\def\cq@CutName{cq-\the\cq@Cnt.cut} +\let\cq@star\eq@NO +\newif\ifcqqs \cqqstrue +\newif\ifcqIsActive \cqIsActivefalse +\def\cqQS{\@ifstar{\cqQSV}{\cqQSA}} +\def\cqQSA#1#2{\ifcqqs#1\else#2\fi} +\@ifpackageloaded{web}{\@ifundefined{IF@AorBswitch}{% + \PackageWarningNoLine{A version of the web package + dated\MessageBreak 2016/11/03 or later is required + for \string\cqQS}}}{}% +\@ifundefined{webtempboxi}{\newbox\webtempboxi + \newbox\webtempboxii}{} +\providecommand\SHOWTEMPBOXi{\unhbox\webtempboxi} +\providecommand\TRUEACTIONi{\aftergroup\SETTEMPBOXii} +\providecommand\TRUEACTIONia{\aftergroup\SHOWTEMPBOXi} +\providecommand\FALSEACTIONii{\aftergroup\SETTEMPBOXi} +\providecommand\FALSEACTIONiia{\aftergroup\SHOWTEMPBOXi} +\providecommand\SETTEMPBOXi{\IF@AorBswitch\else + \afterassignment\TRUEACTIONia\fi + \setbox\webtempboxi=\hbox} +\providecommand\SETTEMPBOXii{\IF@AorBswitch + \afterassignment\FALSEACTIONiia\fi + \setbox\webtempboxii=\hbox} +\def\cqQSV{\let\IF@AorBswitch\ifcqqs + \IF@AorBswitch + \def\eq@next{\afterassignment\TRUEACTIONi\SETTEMPBOXi}\else + \def\eq@next{\afterassignment\FALSEACTIONii\SETTEMPBOXii}\fi + \eq@next} +\def\eq@turnMessageOff{\let\save@message\message + \let\message\@gobble} +\def\eq@turnMessageOn{\let\message\save@message} +\def\eqCQDeclarations{\cqqsfalse\eq@turnMessageOff + \includecomment{sPage}\excludecomment{qPage}% + \eq@turnMessageOn} +\def\eqTopOfSolnPage{\withinsoldoctrue\cqSAfalse + \eqCQDeclarations} +\def\eqTopOfQslPage{\withinqsldoctrue} +\eq@turnMessageOff +\includecomment{qPage}\excludecomment{sPage} +\eq@turnMessageOn +\newenvironment{cq@CQ} +{% + \global\cqIsActivetrue + \global\advance\cq@Cnt1\relax + \immediate\openout\CommentStream=\cq@CutName + \let\verbatim@out\CommentStream + \verbatimwrite +}{% + \endverbatimwrite + \immediate\closeout\CommentStream + \ifx\cq@star\eq@YES + \xdef\cq@INPUTCUT{\noexpand\cqqstrue + \noexpand\input{\cq@CutName}\noexpand + \def@QuesToSoln}\else + \xdef\cq@INPUTCUT{\noexpand\cqqstrue + \noexpand\input{\cq@CutName}\noexpand + \p@ssQuesToSoln}\fi + \aftergroup\cq@INPUTCUT +} +\newenvironment{cqs@CQ}{\let\cq@star\eq@YES\cq@CQ}{\endcq@CQ} +\def\declCQQuesStr#1{\def\cqQStr{#1}} +\declCQQuesStr{Question} +\def\declCQSolStr#1{\def\cqSStr{#1}} +\declCQSolStr{Solution} +\newcommand\declCQPre[1]{\def\cq@Pre{#1}} +\declCQPre{\emph{\cqQStr}:\space} +\newcommand\declCQPost[1]{\def\cq@Post{#1}} +\declCQPost{\par\medskip\noindent\emph{\cqSStr}:\space\ignorespaces} +\def\cqFmtPasteQues#1{\cq@Pre\input{#1}\cq@Post} +\def\p@ssQuesToSoln{\ifeq@hidesolution\else + \global\terminexchangedtrue % dps cq + \ifeq@solutionsafter\else + \writeT@ExSolns{\protect\decleqterminex{\protect + \cqFmtPasteQues{\cq@CutName}}\eq@commentchar}\fi\fi} +\def\declCopyQues#1{\def\cqCopiedQues{#1}} +\def\def@QuesToSoln{\restoreNormalSolns + \global\terminexchangedfalse % dps cq + \ifeq@hidesolution\else\writeT@ExSolns{\protect + \declCopyQues{\protect\input{\cq@CutName}}}\fi} +\newcommand\restoreNormalSolns{\ifeq@solutionsafter\else + \writeT@ExSolns{\protect\decleqterminex{\protect + \eqterminexDEF}\eq@commentchar}\fi} +\newcommand{\eq@CommonCmd}[1]{\def\eq@@CommonCmd{#1}#1} +\let\eq@@CommonCmd\@empty +\newcommand\gExCommonCmd[1]{\gdef\gEx@CommonCmd{\eq@CommonCmd{#1}}} +\let\gEx@CommonCmd\@empty +\let\endexerhook\@empty +\newenvironment{exercise} +{% + \let\cq\cq@CQ\let\endcq\endcq@CQ + \csarg\let{cq*}\cqs@CQ + \csarg\let{endcq*}\endcqs@CQ + \par\removelastskip\eq@priorexskip\noindent + \let\eqCommonCmd\eq@CommonCmd + \def\eq@argi{eqexno}%% use eqexno counter + \if\eq@exerstarEnv*\def\exerstar{*}\else\def\exerstar{x}\fi + \def\currhideopt{x}% + \@ifnextchar[{\exercise@}% + {\if\exerstar*\def\eq@next{\@exercise}\else + \def\eq@next{\exercise@@}\fi\eq@next}% +}{\eq@postexerciseHook\endexerhook\par + \global\eq@exerciseheadingtrue\removelastskip\eq@exerskip} +\def\exercise@[#1]{\edef\eq@arg{#1}% + \if\eq@arg h\def\currhideopt{h}% + \eq@hidesolutiontrue\eq@nolinktrue% + \ifeq@globalshowsolutions + \eq@hidesolutionfalse\eq@nolinkfalse\fi + \def\eq@next{\@exercise}% h, no *, no counter + \else + \if\eq@arg H% + \edef\currhideopt{\Hidesymbol}% + \eq@hidesolutiontrue\eq@nolinktrue% + \ifeq@globalshowsolutions + \eq@hidesolutionfalse\eq@nolinkfalse + \fi + \def\eq@next{\@exercise}% H, no *, no counter + \else + \def\currhideopt{x}% + \ifx\eq@arg\@empty\else\def\eq@argi{#1}\fi + \if\exerstar*\def\eq@next{\@exercise}\else + \def\eq@next{\exercise@@}\fi + \fi + \fi +\eq@next} +\def\exercise@@{\@ifstar{\def\exerstar{*}\@exercise}{\exercise@@@}} +\def\exercise@@@{\@ifnextchar[{\exercise@@@@}{\@exercise}} +\def\exercise@@@@[#1]{\edef\eq@arg{#1}% + \if\eq@arg h\def\currhideopt{h}% + \eq@hidesolutiontrue\eq@nolinktrue + \ifeq@globalshowsolutions + \eq@hidesolutionfalse\eq@nolinkfalse\fi + \def\eq@next{\@exercise}% h, no *, no counter + \else + \if\eq@arg H\edef\currhideopt{\Hidesymbol}% + \eq@hidesolutiontrue\eq@nolinktrue% + \def\eq@next{\@exercise}% h, no *, no counter + \else + \def\currhideopt{x}% + \PackageWarning{exerquiz}{The option #1 is not recognized} + \let\eq@next\relax + \fi + \fi +\eq@next} +\newif\ifeq@exerciseheading \eq@exerciseheadingtrue +\let\prior@exerSolnHeaderHook\@empty +\newcommand\exerSolnHeader[3]{% + \prior@exerSolnHeaderHook + \ifeqforpaper\else\webnewpage\fi\markright{#1}%\par\noindent% + #3% + \solnhspace +} +\let\solnItemMngt\relax +\let\eqEXt\@gobbletwo +\let\endeqEXt\relax +\let\eqExtArg\@empty +\let\eqFilterArg\@empty +\let\eqExerSolnHeader\@empty +\let\solutionparshape\@empty +\def\eq@pslnaindnt{0pt} +\let\eq@setPrbSolnAftrIndnt\relax +\newcommand{\setPrbSolnAftrIndent}[1]{\ifdim#1=0pt + \def\eq@pslnaindnt{0pt}\let\eq@setPrbSolnAftrIndnt\relax\else + \edef\eq@pslnaindnt{#1}\edef\eq@setPrbSolnAftrIndnt{\expandafter + \noexpand\expandafter\parindent#1\noexpand\relax}\fi} +\newif\if@restorejustify \@restorejustifyfalse +\newcommand\restoreJustifyOn{\@restorejustifytrue} +\newcommand\restoreJustifyOff{\@restorejustifyfalse} +\def\restorejustify{\if@restorejustify + \@rightskip\z@skip \rightskip\@rightskip + \leftskip\z@skip \let\\\@normalcr\fi} +\def\@exercise{% + \global\let\solutionparshape\@empty + \let\verbatim@out=\ex@solns + \if\eq@argi0\else\refstepcounter{\eq@argi}\fi\stepcounter{@exno}% + \if\exerstar*% if exercise with parts + \eq@nolinktrue + \else + \if\currhideopt H% + \else + \ifeq@solutionsafter + \eq@nolinktrue % no link to solution + \else + \eq@ckglobalhide % + \ifeq@hidesolution\else + \global\let\eqExerSolnHeader\eq@@writeexheader + \fi + \fi + \fi + \fi + \ifvmode\ifdim\lastskip>\z@ + \vskip-\lastskip + \fi\fi + \if\exerstar*% + \let\solution\solnexer@woparts + \let\endsolution\endsolnexer@woparts + \let\parts\exercise@parts + \let\endparts\endexercise@parts + \else + \let\solution\solnexer@woparts + \let\endsolution\endsolnexer@woparts + \let\parts\relax + \let\endparts\relax + \if\Hidesymbol h\eq@nolinkfalse\ifeq@solutionsafter + \eq@nolinktrue\fi\fi + \fi + \eq@initializeContAnnot + \ifeq@exerciseheading + \prior@questionsHook\marginparpriorhook\noindent\eqexheader@wrapper + \afterlabelhskip\marginparafterhook\gEx@CommonCmd + \eq@setPrbSolnAftrIndnt\ignorespaces\fi} +\newif\ifterminexchanged \terminexchangedfalse % dps cq +\newcommand\decleqterminex[1]{\def\eqterminex{#1}} +\def\eqterminexDEF{\relax\ignorespaces} +\decleqterminex{\eqterminexDEF} +\newif\ifmakeExSlLocal \makeExSlLocalfalse +\def\makeExSolnsLocalOn{\makeExSlLocaltrue} +\def\makeExSolnsLocalOff{\makeExSlLocalfalse} +\let\eqMrkSoln\@gobble +\def\eqExerSolnHeaderSngl{% + \ifmakeExSlLocal\protect\begingroup^^J\fi + \ifx\eqMrkCpyArg\@empty\else + \protect\eqMrkSoln{\eqMrkCpyArg}\fi + \protect\eqEXt{\eqExtArg}{\eqFilterArg}\protect + \solnItemMngt\protect\exerSolnHeader{\exsecrunhead}{ex.\the@exno}% + {\exsllabelformat}\exer@solnheadhook + \exersolnheadhook\protect\eqterminex} +\def\eq@@writeexheader{\ifeq@hidesolution\else\ifOKToWriteExamData + \set@display@protect + \immediate\write\verbatim@out{\eqExerSolnHeaderSngl}% + \set@typeset@protect\fi\fi} +\def\eqExerSolnHeaderList{% + \ifmakeExSlLocal\protect\begingroup^^J\fi + \ifx\eqMrkCpyArg\@empty\else + \protect\eqMrkSoln{\eqMrkCpyArg}\fi + \protect\eqEXt{\eqExtArg}{\eqFilterArg}\protect + \solnItemMngt\protect\exerSolnHeader{\exsecrunhead}% + {ex.\the@exno\thepartno}{\exsllabelformatwp}% + \exer@solnheadhook\exersolnheadhook\protect\eqterminex} +\def\eq@@writeexheaderlist{\ifeq@hidesolution\else\ifOKToWriteExamData + \set@display@protect\immediate + \write\verbatim@out{\eqExerSolnHeaderList}\set@typeset@protect\fi\fi} +\long\def\setsolnspace#1{\def\newsolnspace{#1}% + \let\solnspace\newsolnspace} +\newif\ifeq@ckSolnVspace \eq@ckSolnVspacetrue +\def\ckSolnOpt{\global\eq@ckSolnVspacetrue} +\def\noSolnOpt{\global\eq@ckSolnVspacefalse} +\let\solnhspace\space +\let\solnspace\space +\let\exsolnonceonlytophook\relax +\def\solnexer@woparts{% + \ifanswerkey\ifeqe@flextended\ifcont@nnot + \ifx\solutionparshape\@empty\else % dpsj8 + \pushEnvir + \everypar{}\if@eqalignfilllinestoleft\else + \parshape=1 \leadinIndent \linewidth\fi + \popEnvir + \fi\fi\fi\fi\def\bLeaveVspace{x}% = no vertical space added + \exsolnonceonlytophook % dps27 + \global\let\exsolnonceonlytophook\relax + \@ifundefined{KV@eqefillLines@bgonly}{} + {\ifKV@eqefillLines@bgonly\ifvmode\else + \par\leavevmode\strut\fi\fi + \ifKV@eqefillLines@outlineonly\leavevmode\strut\fi}% + \ifeq@ckSolnVspace + \def\eq@next{\@ifnextchar[{\solnexer@@woparts}%] + {\solnexer@@woparts[\null]}}\else + \def\eq@next{\solnexer@@woparts[\null]}\fi + \eq@next} +\let\eqPriorVspace\@gobble +\newif\if@eqlinedfiller \@eqlinedfillerfalse +\newcommand{\vspaceFiller}[1]{\vfill} +\newcommand{\vspaceFillerDefault}[1]{\vfill} +\def\eqWriteLine{\hfill} +\def\eq@linesXPgs{% + \begingroup\offinterlineskip\parskip0pt + \@tempcnta=0 + \@whilenum\@tempcnta<\soln@keys@nLines\relax\do + {\vskip0pt\penalty-50\vglue\wlVspace\eqWriteLine + \advance\@tempcnta1\relax}\par\endgroup} +\let\leavevspace\relax % dpsj5 +\newcommand{\vspaceFmt}[1]{% + \ifx\solutionparshape\@empty\else + \advance\linewidth-\leadinIndentPrtSep\fi + \ifdim\sameVspace>0pt + \let\bLeaveVspace\@empty + \def\leavevspace{% + \ifx\eq@insertverticalspace\eq@YES\par\eq@quessolskip + \eqPriorVspace{#1}{\nobreak\noindent + \if@eqlinedfiller + \ifx\soln@keys@nLines\@empty + \def\eq@lines@next{\vspaceFiller{#1}}\else + \def\eq@lines@next{\eq@linesXPgs}\fi + \else + \def\eq@lines@next{\parbox[b][#1][t]{\linewidth} + {\vspaceFiller{#1}}}% + \fi\eq@lines@next}% + \fi + }\expandafter\leavevspace + \fi} +\define@key{soln@keys}{nLines}[]{\def\soln@keys@nLines{#1}} +\let\soln@keys@nLines\@empty +\def\eqKV@errx#1{\xdef\XKV@rm{\@tempa}} +\def\eqSolnForEqexam#1{% + \let\soln@keys@nLines\@empty + \setkeys*{soln@keys}{#1}% + \ifx\soln@keys@nLines\@empty + \ifx\minVspacet@bs\@empty\xdef\sameVspace{\XKV@rm}\else + \xdef\sameVspace{\minVspacet@bs}\fi + \else + \@tempdima\wlVspace + \@tempdima=\soln@keys@nLines\@tempdima + \xdef\sameVspace{\the\@tempdima}% + \ifx\XKV@rm\@empty\else + \if@equsedim\let\soln@keys@nLines\@empty + \xdef\sameVspace{\XKV@rm}\fi + \fi + \fi + \ifx\sameVspace\@empty\gdef\sameVspace{0pt}\fi +} +\def\solnexer@@woparts[#1]{% + \ifcqIsActive\else\ifterminexchanged + \restoreNormalSolns\fi\fi % dps cq + \global\cqIsActivefalse + \def\eq@argi{#1}\def\eq@null{\null}% + \ifx\eq@argi\@empty\gdef\sameVspace{0pt}\else + \ifx\eq@argi\eq@null\gdef\sameVspace{0pt}\else + \@ifundefined{PointsOnLeft}{% + \let\eqKV@errx@SAVE\KV@errx + \let\KV@errx\eqKV@errx\let\XKV@rm\@empty + \edef\temp@exp{\noexpand\setkeys*{soln@keys}{#1}}\temp@exp + \let\KV@errx\eqKV@errx@SAVE + \ifx\soln@keys@nLines\@empty\else + \PackageInfo{exerquiz}{% + nLines key detected in solution environment,\MessageBreak + is not not recognized without eqexam,\MessageBreak + will remove it}% + \let\soln@keys@nLines\@empty\fi + \xdef\sameVspace{\XKV@rm}% + }{\eqSolnForEqexam{#1}}% + \fi\fi + \solnexer@@@woparts +} +\def\solnsafterSkip#1{\setlength{\@tempdima}{#1}% + \edef\solnsafterSkipAmt{\the\@tempdima}% + \def\solutionsafterSkip{\vskip\solnsafterSkipAmt\relax}} +\solnsafterSkip{\smallskipamount} +\def\@solnafterSkipOnce#1{\setlength{\@tempdima}{#1}% + \xdef\@solnafterSkipOnceAmt{\the\@tempdima}}% +\def\@@solnafterSkipOnce{\vskip\@solnafterSkipOnceAmt\relax %dpsj3 + \gdef\@solnafterSkipOnceAmt{0pt}} +\def\@solnafterSkipOnceAmt{0pt} +\def\quessolSkip#1{\setlength{\@tempdima}{#1}% + \edef\eq@quessolskip{\noexpand\vskip\the\@tempdima\relax}} +\def\eq@quessolskip{\vskip\smallskipamount} +\def\eqe@debugVertSkip#1{} +\def\eqe@showEndHere#1{#1} +\def\eqe@setStartSolns{% + \xdef\eq@startSoln{\the\pagetotal}% + \eqe@debugVertSkip{\marginpar{\smash{b[\sameVspace]}}}% +} +\let\eqSavedComment\dlcomment +\let\endeqSavedComment\enddlcomment +\def\setTabulrSolnEnv{% + \@ifundefined{@listii@SAVE}{\global\let\@listii@SAVE\@listii}{}% + \expandafter\def\expandafter\@listii\expandafter{\@listii@SAVE + \leftmargin\leftmarginii \labelwidth\leftmarginii + \advance\labelwidth-\labelsep}% + \def\everyparShape{\everypar{\parshape \@ne 0pt \linewidth}}% + \reset@doendpe{\parshape \@ne 0pt \linewidth}% + \parshape \@ne 0pt \linewidth + \everyparShape +} +\newif\ifthereissolution +\let\priorexsolafterList\@empty +\let\priorexsolafterTab\@empty +\let\priorexsolafterSngl\@empty +\def\eq@Hid{H}\def\eq@hid{h} +\def\solutionafterExCmds#1{\def\@rgi{#1}\ifx\@rgi\@empty + \let\eqSolnExCmds\relax\else + \def\eqSolnExCmds{#1}\fi} +\let\eqSolnExCmds\relax +\def\eq@b@ddCodeSpecialDef#1{#1}% +\let\eq@b@ddCodeSpecial\eq@b@ddCodeSpecialDef +\def\solnexer@@@woparts{\ifeq@solutionsafter\else + \expandafter\begingroup\fi + \global\thereissolutiontrue + \global\let\procsoln\relax + \global\let\endprocsoln\relax + \def\exerwparts@cols{0}% + \let\verbatim@out\ex@solns + \if\currhideopt\eq@Hid + \let\minVspacet@bs\@empty + \let\procsoln\eqSavedComment + \let\endprocsoln\endeqSavedComment + \def\eq@next{\procsoln}% + \else + \eq@ckglobalhide + \ifeq@hidesolution + \let\procsoln\eqSavedComment + \let\endprocsoln\endeqSavedComment + \else + \ifeq@solutionsafter\else + \ifx\eq@@CommonCmd\@empty\else + \set@display@protect + \immediate\write\verbatim@out{\eq@@CommonCmd}% + \set@typeset@protect + \fi + \fi + \let\procsoln\verbatimwrite + \let\endprocsoln\endverbatimwrite + \fi + \def\eq@next{% + \ifeq@solutionsafter + \let\procsoln\relax + \let\endprocsoln\relax + \removelastskip\removelastparskip + \cqSAtrue\eqCQDeclarations + \declCopyQues{\input{\cq@CutName}}% + \ifx\exsolafter\@empty + \ifdim\sameVspace=0pt\eqe@setStartSolns + \else + \solutionsafterSkip + \@@solnafterSkipOnce + \eqe@setStartSolns + \fi + \else\par\kern0pt + \solutionsafterSkip + \@@solnafterSkipOnce + \noindent\strut\eqe@setStartSolns + \fi + \parskip\eqeques@parsep + \ifx\endparts\endexercise@parts@tabular + \eq@setPrbSolnAftrIndnt + \restorejustify + \fi + \ifx\endparts\endexercise@parts@tabular\expandafter + \priorexsolafterTab\else + \ifx\endparts\endexercise@parts@list\expandafter + \priorexsolafterList\else\expandafter + \priorexsolafterSngl\fi\fi + \exsolafter\space\ignorespaces + \solutionparshape + \else + \eqExerSolnHeader + \global\therearesolutionstrue\expandafter\procsoln + \fi + }% + \fi + \eq@b@ddCodeSpecial{\eq@next}% +}% dpsj4 +\let\endsolnexerhook\@empty +\let\pkg@endsolnexerhook\@empty +\let\endsolnexerhookaux\@empty +\def\eq@fititin#1{\noindent\unskip\nobreak\hfill\penalty100 + \hskip1em\hbox{}\nobreak\hfill#1}% +\let\eqfititin\eq@fititin +\bgroup\catcode`\%=12\relax +\gdef\eq@commentchar{%}\egroup +\newcommand\eqExerSolnTrailer{% + \protect\ReturnTo{page.\the\c@page}% + {\protect\mbox{\if\exerstar*\exrtnlabelformatwp\else + \exrtnlabelformat\fi}}% + \protect\endeqEXt\ifeqforpaper\protect\par{\belowexsolnskip}\fi + \eq@commentchar^^J% + \ifmakeExSlLocal\protect\endgroup^^J\fi +} +\let\eq@e@ddCodeSpecialDef\relax % dpsj4 +\let\eq@e@ddCodeSpecial\eq@e@ddCodeSpecialDef % dpsj6 +\let\kdvsp@Restore\relax +\def\eq@clearMrkCpy{\if@targetforextr + \global\let\eqMrkCpyArg\@empty + \global\@targetforextrfalse\fi +} +\def\endsolnexer@woparts{\endprocsoln\eq@e@ddCodeSpecial + \pkg@endsolnexerhook + \eq@clearMrkCpy + \ifeq@solutionsafter\else + \expandafter\endgroup\fi % from \begingroup at \solnexer@@@woparts + \global\let\exsolnonceonlytophook\relax + \ifx\sameVspace\@empty\gdef\sameVspace{0pt}\fi + \ifvspacewithsolns\vspaceFmt{\sameVspace}\else + \ifeq@nosolutions\ifeq@solutionsafter\else + \vspaceFmt{\sameVspace}\fi\fi\fi + \if\currhideopt H% + \ifkeepdeclaredvspacing\vskip\sameVspace\fi + \else + \ifeq@solutionsafter + \ifx\isitleadin\eq@YES\parshape=0 \fi + \if\exerstar*% + \eq@fititin{\mbox{\exrtnlabelformatwp}}\else + \eq@fititin{\mbox{\exrtnlabelformat}}\fi + \ifx\istabularexer\eq@YES\unskip\kern0pt\else\par\fi + \ifx\minVspacet@bs\@empty + \ifkeepdeclaredvspacing + \@tempdima\pagetotal + \advance\@tempdima-\eq@startSoln + \@tempdimb\sameVspace\relax + \ifdim\@tempdimb>1sp\relax + \advance\@tempdimb-\@tempdima + \ifdim\@tempdimb>0pt\vglue\@tempdimb\kern0pt + \let\eqe@showEndHere\@gobble + \edef\tmp@exp{\noexpand\marginpar{\noexpand + \smash{e: adj \the\@tempdimb}}}% + \eqe@debugVertSkip{\tmp@exp}% + \fi + \fi + \fi + \eqe@showEndHere{\eqe@debugVertSkip{\marginpar{\smash{e}}}}% + \fi + \else + \eq@ckglobalhide + \ifeq@hidesolution\else + \endsolnexerhookaux + \writeT@ExSolns{\eqExerSolnTrailer}% + \fi + \fi + \fi + \kdvsp@Restore + \endsolnexerhook\penalty0\relax} +\let\eq@exerstarEnv\relax +\newenvironment{exercise*}{\def\eq@exerstarEnv{*}\exercise} +{\endexercise} +\def\exerwparts@cols{0} +\let\topofpartshook\relax +\let\@listiiredefined\eq@NO +\let\itsExerParts\eq@NO +\newif\if@tableadinitem\@tableadinitemfalse +\newcommand{\tableadin@external}{\PackageError{exerquiz/eqexam} + {The \string\tableadin\space command is designed\MessageBreak + for the problem* environment of eqexam}{Use \string\tableadin\space + in the problem* environment of eqexam.}% +} +\let\tableadin\tableadin@external +\newcommand{\eq@tableadinparts}{\item\relax + \PackageError{exerquiz/eqexam}{The \string\tableadin\space + command is not allowed in the\MessageBreak + parts environment}{Use \string\tableadin\space + in the problem* environment of eqexam.}% +} +\let\istabularexer\eq@NO +\def\exercise@parts{\let\rlspar\relax + \ifx\solutionparshape\@empty + \let\isitleadin\eq@NO + \if@tableadinitem\let\rlspar\@gobbletwo\fi + \else\let\isitleadin\eq@YES\fi + \rlspar\removelastskip\par + \if\isitleadin\eq@YES + \def\eqparts@topsep{0pt}% + \vskip\eqparts@itemsep\relax\fi + \topofpartshook + \let\itsExerParts\eq@YES + \global\let\@listiiredefined\eq@NO + \def\exerwparts@cols{0}\@ifnextchar[% + {% + \if@tableadinitem\else\removelastparskip\fi + \let\endparts\endexercise@parts@tabular\exercise@parts@tabular@}% + {\let\endparts\endexercise@parts@list\exercise@parts@list}} +\def\eq@extralabelsep{0pt} +\newcommand{\setPartsWidth}[1]{\def\parts@indent{\normalfont#1}% + \bgroup\settowidth{\eq@tmpdima}{\parts@indent}% + \xdef\widthOfParts{\the\eq@tmpdima}\egroup} +\setPartsWidth{(d)} +\def\eqe@prtsepPrb{\ } +\providecommand{\prbPrtsep}[1]{\def\eqe@prtsepPrb{#1}} +\providecommand{\exPrtsep}[1]{\def\eqe@prtsepPrb{#1}} +\providecommand{\eqequesparsep}[1]{\def\eqeques@parsep{#1}} +\eqequesparsep{0pt} +\let\prior@parts@hook\@empty +\let\post@parts@hook\@empty +\let\abovepartshook\@empty +\let\belowpartshook\@empty +\let\eqp@rtc@lcm@rk\relax +\let\eq@insertContAnnot\relax +\def\eq@item@common{\eq@insertContAnnot\eqp@rtc@lcm@rk + \def\currhideopt{x}\eq@hidesolutionfalse\eq@nolinkfalse + \@ifnextchar[{\@ckhide}{\eq@item}} +\newcommand{\partsitemsep}[1]{{% + \setlength{\@tempdima}{#1}% + \xdef\eqparts@itemsep{\the\@tempdima}}} +\let\eqpartsitemsep\partsitemsep +\def\eqparts@itemsep{0pt} +\newcommand\partsparsep[1]{{% + \setlength{\@tempdima}{#1}% + \xdef\eqparts@parsep{\the\@tempdima}}} +\def\eqparts@parsep{0pt} +\newcommand\partstopsep[1]{{% + \setlength{\@tempdima}{#1}% + \xdef\eqparts@topsep{\the\@tempdima}}} +\def\eqparts@topsep{3pt} +\newcommand{\leadinitem@external}{\PackageError{exerquiz/eqexam} + {The \string\leadinitem\space command is designed to be\MessageBreak + the first item in the problem*\MessageBreak + environment above the parts environment} + {Use \string\leadinitem\space in the problem* environment.}} +\let\leadinitem\leadinitem@external +\let\itsforleadinitem\eq@NO +\newcommand{\eq@leadinitemparts}{\item\relax + \PackageError{exerquiz/eqexam}{The \string\leadinitem\space + command is not allowed in the\MessageBreak + parts environment} + {Use \string\leadinitem\space in the problem* environment.}} +\def\eq@handleOptArg[#1]{\def\eq@optArg{[#1]}\eq@handleOptArgi} +\def\eq@handleOptArgi{\expandafter + \eq@item@latex\eq@optArg\exlisttabheaderafterhook} +\newif\ifwithinparts +\let\ex@listtabheader@fterhook\@empty +\newenvironment{exercise@parts@list}{% + \settowidth{\eq@tmplength}{\parts@indent}% + \edef\widthOfParts{\the\eq@tmplength}% + \global\let\eqExerSolnHeader\eq@@writeexheaderlist + \eq@initializeContAnnot\eq@nolinkfalse\prior@parts@hook + \abovepartshook\list{\normalfont + \if\Hidesymbol h\eq@nolinkfalse\ifeq@solutionsafter + \eq@nolinktrue\fi\fi + \if\currhideopt H% + \else + \ifeq@solutionsafter + \eq@nolinktrue % no link to solution + \else + \ifeq@nosolutions + \eq@nolinktrue % no link to solution + \else + \eq@ckglobalhide + \ifeq@hidesolution\eq@nolinktrue\else + \global\let\eqExerSolnHeader\eq@@writeexheaderlist + \fi + \fi + \fi + \fi + \makebox[\widthOfParts][r]{\eqexlisttabheader}% +}{% + \usecounter{partno}% + \if\isitleadin\eq@YES + \settowidth{\eq@tmplength}{\parts@indent\eqe@prtsepPrb}% + \xdef\prtsIndntSep{\the\eq@tmplength}% + \if\itsforleadinitem\eqe@YES\setcounter{partno}{\fliPartNo}\else + \setcounter{partno}{1}\fi\fi + \let\leadinitem\eq@leadinitemparts + \let\tableadin\eq@tableadinparts + \global\let\solutionparshape\@empty + \setlength{\topsep}{\eqparts@topsep}% + \setlength{\parskip}{0pt}% + \setlength{\partopsep}{0pt plus 1pt minus 1pt}% + \ifdim\eqeques@parsep=0pt + \setlength{\parsep}{\eqparts@parsep}% + \else + \setlength{\parsep}{\eqeques@parsep}% + \fi + \setlength{\itemsep}{\eqparts@itemsep-\parsep}% + \setlength{\itemindent}{0pt}% + \setlength{\listparindent}{\parindent}% + \settowidth{\labelsep}{\normalfont\eqe@prtsepPrb}% + \addtolength{\labelsep}{\eq@extralabelsep}% + \settowidth{\labelwidth}{\parts@indent}% + \setlength{\leftmargin}{\labelwidth}% + \addtolength{\leftmargin}{\labelsep}% + \let\eq@item@latex\item + \def\eq@item{\@ifnextchar[{\eq@handleOptArg} + {\eq@item@latex\ex@listtabheader@fterhook + \exlisttabheaderafterhook}}% + \def\eqthisenv{parts}\withinpartstrue + \def\item{\ifx\@currenvir\eqthisenv + \def\eq@next{\eq@item@common}\else + \def\eq@next{\eq@item}\fi + \eq@next}% +}}{\endlist\global\let\leadinitem\leadinitem@external + \post@parts@hook\belowpartshook} +\def\eq@initializeContAnnot{\@ifundefined{eqequestions} + {\global\let\eqeCurrProb\relax} + {\xdef\eqeCurrProb{\theeqquestionnoi}}% + \xdef\eq@currProbStartPage{\arabic{page}}} +\define@key{tabp@rts}{nCols}{\def\exerwparts@cols{#1}} +\define@key{tabp@rts}{minVspace}{\def\minVspacet@bs{#1}} +\let\minVspacet@bs\@empty +\def\minVspacetabs#1{\def\minVspacet@bs{#1}} +\def\priorexsolafterTab{\ifkeepdeclaredvspacing + \ifeq@solutionsafter\ifx\minVspacet@bs\@empty\else + \priorexsolafterTab@cont\fi\fi\fi} +\def\priorexsolafterTab@cont{\let\exsolafter@save\exsolafter + \let\exsolafter\@empty + \makebox[0pt][r]{\parbox[t][\minVspacet@bs][t]{0pt} + {\strut\hfill\vfill\strut}}% + \minipage[t]{\linewidth}\exsolafter@save} +\def\pkg@endsolnexerhook{\ifkeepdeclaredvspacing + \ifeq@solutionsafter\ifx\minVspacet@bs\@empty\else + \endminipage\fi\fi\fi} +\def\exercise@parts@tabular@[#1]{% + \inittabMark + \let\eq@insertContAnnot\relax + \let\exerwparts@cols\@empty + \setkeys*{tabp@rts}{#1}\ifx\exerwparts@cols\@empty + \edef\exerwparts@cols{\XKV@rm}\fi + \ifx\minVspacet@bs\@empty\keepdeclaredvspacingfalse\fi + \let\istabularexer\eq@YES + \@tempcnta\exerwparts@cols\relax + \ifnum\@tempcnta<2\relax + \PackageError{exerquiz}{% + The number of columns for parts\MessageBreak + needs to be an integer greater than 1} + {Enter an integer, 2 or larger}\fi + \exercise@parts@tabular} +\newcount\eq@extabColCnt +\def\autotabOn{\let\eq@tabMarkChk\relax% + \PackageInfo{exerquiz/eqexam}{Executing \string\autotabOn}} +\def\autotabOff{\let\eq@tabMarkChk\@gobble + \PackageInfo{exerquiz/eqexam}{Executing \string\autotabOff}} +\autotabOff +\def\inittabMark{\global\eq@extabColCnt=0 } +\def\resettabMark{\global\eq@extabColCnt=1 } +\newcommand\autotabnewline[1][\eqparts@tabrowsep]{% + \ifnum\exerwparts@cols>0\relax + \ifx\eq@tabMarkChk\@gobble + \def\eq@atnext{\expandafter + \tabularnewline\expandafter[#1]}\else + \def\eq@atnext{\resettabMark\tabularnewline + \noalign{\expandafter\kern#1}}\fi + \expandafter\eq@atnext\fi} +\def\eq@tabMark{% + \ifnum\eq@extabColCnt=0\relax + \global\advance\eq@extabColCnt1\relax + \let\eq@next\relax + \else + \ifnum\eq@extabColCnt=1\relax + \let\eq@next\relax + \else + \ifnum\eq@extabColCnt>\exerwparts@cols + \let\eq@next\autotabnewline + \else\def\eq@next{&}\fi + \fi + \fi + \eq@next + \global\advance\eq@extabColCnt1\relax} +\newcommand\partstabcolsep[1]{\def\eq@partstabcolsep{#1}} +\partstabcolsep{1.5pt} +\newcommand\partstabtopsep[1]{\def\eq@partstabtopsep{#1}} +\partstabtopsep{3pt} +\def\eq@vpartstabtopsep{\vskip\eq@partstabtopsep\relax} +\newcommand\partstabrowsep[1]{\setlength{\@tempdima}{#1}% + \edef\eqparts@tabrowsep{\the\@tempdima}} +\partstabrowsep{0pt} +\newenvironment{exercise@parts@tabular}{% + \setcounter{partno}{0}% + \global\let\eqExerSolnHeader\eq@@writeexheaderlist + \def\tablrIndent{\hglue\prtsIndntSep\relax}% + \if\isitleadin\eq@YES + \if$\the\everypar$\let\tablrIndent\relax\fi + \setcounter{partno}{1}\fi + \let\leadinitem\eq@leadinitemparts + \let\tableadin\eq@tableadinparts + \global\let\solutionparshape\@empty + \settowidth{\eq@tmplength}{\parts@indent\eqe@prtsepPrb}% + \xdef\prtsIndntSep{\the\eq@tmplength}% + \sbox{\eq@tmpbox}{\parts@indent}% + \let\eq@item@latex\item + \let\eq@item\item@part@tabular + \def\eqthisenv{parts}\withinpartstrue + \def\item{\ifx\@currenvir\eqthisenv + \def\eq@next{\eq@tabMarkChk\eq@tabMark\eq@item@common}\else + \def\eq@next{\eq@item@latex}\fi + \eq@next}\eq@nolinkfalse + \@ifundefined{@xtabularcr}{\let\@xarraycr\eq@xtabularcr} + {\let\@xtabularcr\eq@xtabularcr}% + \eq@tmpdima=\linewidth + \advance\eq@tmpdima-\prtsIndntSep\relax + \@tempcnta\exerwparts@cols\relax + \advance\@tempcnta-1\relax + \multiply\@tempcnta2\relax + \@tempdima\prtsIndntSep\relax + \divide\@tempdima 2\relax + \edef\halfWidth{\the\@tempdima}% + \advance\@tempdima\eq@partstabcolsep\relax + \tabcolsep\@tempdima + \multiply\@tempdima\@tempcnta + \advance\eq@tmpdima-\@tempdima + \divide\eq@tmpdima by\exerwparts@cols\relax %dpsj3 + \edef\widthOfPartsBox{\the\eq@tmpdima}% dpsj2 + \if@tableadinitem\else\vskip\eq@partstabtopsep\relax\fi + \noindent\normalbaselines\kern0pt + \prior@parts@hook\abovepartshook + \tablrIndent\tabular[t]{@{}*{\exerwparts@cols}{>{\setTabulrSolnEnv + \parskip\eqeques@parsep\relax + \parindent0pt\relax\strut}p{\eq@tmpdima}}@{\hidewidth}}% +}{\endtabular\kern0pt + \@ifundefined{@listii@SAVE}{}{\global\let\@listii\@listii@SAVE + \global\let\@listii@SAVE\relax}% + \post@parts@hook\belowpartshook + \aftergroup\eqe@innermarkpts + \aftergroup\eq@vpartstabtopsep} +\let\eqe@innermarkpts\relax +\def\item@part@tabular{\refstepcounter{partno}% + \ifeq@solutionsafter + \eq@nolinktrue % no link to solution + \else\ifeq@nosolutions + \eq@nolinktrue % no link to solution + \else + \eq@ckglobalhide + \ifeq@hidesolution\eq@nolinktrue\else + \gdef\eqExerSolnHeader{\eq@@writeexheaderlist}% + \fi\fi\fi + \if@restorejustify\restorejustify\else\PBS\raggedright\fi + \settowidth{\eq@tmplength}{\parts@indent\eqe@prtsepPrb}% + \xdef\prtsIndntSep{\the\eq@tmplength}% + \sbox{\eq@tmpbox}{\parts@indent}% + \eq@tmpdima=\wd\eq@tmpbox + \addtolength\eq@tmplength{\eq@extralabelsep}% + \xdef\partshangamount{\the\eq@tmplength}% + \parshape \@ne 0pt \linewidth + \everypar{\parshape \@ne 0pt \linewidth}% + \eq@setPrbSolnAftrIndnt + \makebox[0pt][r]{\eqexlisttabheader\eqe@prtsepPrb}% + \ex@listtabheader@fterhook + \exlisttabheaderafterhook\ignorespaces} +\def\@ckhide[#1]{\edef\eq@arg{#1}% + \def\currhideopt{x}% + \ifx\eq@arg\@empty\else + \if\eq@arg\eq@Hid + \eq@hidesolutiontrue\eq@nolinktrue% + \edef\currhideopt{\Hidesymbol}% + \else + \ifeq@globalshowsolutions\else + \if\eq@arg\eq@hid + \eq@hidesolutiontrue\eq@nolinktrue% + \def\currhideopt{h}% + \fi + \fi + \fi\fi + \eq@item} +\def\tabControlOn{\@ifundefined{@xtabularcr} + {\let\save@@xtabularcr\@xarraycr} + {\let\save@@xtabularcr\@xtabularcr}} +\def\tabControlOff{\@ifundefined{@xtabularcr} + {\let\@xarraycr\save@@xtabularcr} + {\let\@xtabularcr\save@@xtabularcr}} +\AtBeginDocument{\tabControlOn} +\def\eq@xtabularcr{\@ifnextchar[{\save@@xtabularcr} + {\eqe@tab@parts@rowsep}}% +\def\eqe@tab@parts@rowsep{\save@@xtabularcr + \noalign{\expandafter\kern\eqparts@tabrowsep}}% +\let\eqgrii\relax +\let\eqgriii\relax +\def\includeexersolutions{\@ifstar + {\let\resetEXsolns\relax\includeexersolutionsi} + {\def\resetEXsolns{\global\let\include@solutions\relax}% + \includeexersolutionsi}} +\newcommand{\includeexersolutionsi}[1][]{% + \filterFor{#1}\includeexersolutionsii} +\def\includeexersolutionsii{% + \include@solutions + \resetEXsolns + \let\eqFilterArg\@empty +} +\long\def\gobbleToEndEXt#1\endeqEXt{\ifeqforpaper + \expandafter\@gobbletwo\fi} +\newif\if@targetforextr \@targetforextrfalse +\newcommand\filterFor[1]{\def\eqFilterArg{#1}} +\newcommand{\mrkForIns}[1]{\def\eqMrkCpyArg{#1}\global + \@targetforextrtrue\@ifundefined{#1@mfc} + {\global\@namedef{#1@mfc}{}} + {\PackageWarning{exerquiz/eqexam} + {The name '#1' has already been used.\MessageBreak + Please choose another, otherwise results may\MessageBreak + be as unexpected}}\ignorespaces} +\let\eqMrkCpyArg\@empty +\newcommand\inclEXtFilter[2]{\def\eqargii{#2}\ifx\eqargii\eqFilterArg + \else\expandafter\gobbleToEndEXt\fi} +\newcommand\useEXtFilter{\let\eqEXt\inclEXtFilter} +\let\eqsolutionshook\@empty +\let\eq@solutionshook\@empty +\let\priorexsectitle\@empty +\let\priorexslinput\@empty +\def\exerSolnsHeadnToc{\section*{\exsectitle}% + \addcontentsline{toc}{section}{% + \@ifundefined{web@latextoc}{}{% + \ifx\web@latextoc\eq@YES\else + \protect\numberline{}\fi}\exsectitle}} +\@ifpackageloaded{web}{\def\eq@normallheader{\lheader{\rightmark}}} + {\let\eq@normallheader\relax} +\@ifpackageloaded{web}{\def\eq@defaultlheader{\lheader{\aeb@setmarks}}} + {\let\eq@defaultlheader\relax} +\newif\ifExSolutionsSet \ExSolutionsSetfalse +\def\eqExSolFileName{\jobname.sol} +\newcommand{\exerSolnInput} +{% + \@ifundefined{eqe@IWO}{}{\ifsolutionsAtEnd + \eqe@IWO\@auxout{\string\expandafter\string\gdef + \string\csname\space eqExamQuesLastPage\string\endcsname + {\arabic{page}}}\fi}\let\webnewpage\relax + \ifsolutionsonly\else + \bgroup\OKToWriteExamDatatrue + \writeT@ExSolns{\string\endinput}\egroup + \immediate\closeout\ex@solns\fi + \ifeq@nosolutions\else + \iftherearesolutions + \ifsolutionsonly\eq@solutionshook + \eqsolutionshook + \else + \newpage\eq@solutionshook + \eqsolutionshook\markright{}\eq@normallheader + \fi + \markright{\exsectitle}% + \ifx\webnewpage\relax + \def\webnewpage{\global\let\webnewpage\newpage}\fi + \priorexsectitle\exerSolnsHeadnToc\priorexslinput + \InputIfFileExists{\eqExSolFileName} + {\global\ExSolutionsSettrue}{\PackageWarning{exerquiz} + {!!! Solutions to exercises not found}}% + \global\ExSolutionsSetfalse + \newpage\eq@defaultlheader + \fi + \fi +} +\def\include@solutions{% + \exerSolnInput +} +\newcommand{\prior@questionsHook}{} +\let\qMark@Hook\@empty +\let\aebtitleQuiz\@empty +\newcommand{\post@questionsHook}{} +\newcommand{\quesNumColor}[1]{\def\eq@quesNumCol{#1}} +\quesNumColor{blue} +\renewcommand{\theeqquestionnoi}{\arabic{eqquestionnoi}} +\newcommand{\labeleqquestionnoi}{% + \color{\eq@quesNumCol}\bfseries\theeqquestionnoi.} +\renewcommand\theeqquestionnoii{(\alph{eqquestionnoii})} +\newcommand{\labeleqquestionnoii}{% + \color{\eq@quesNumCol}\bfseries\theeqquestionnoii} +\renewcommand\theeqquestionnoiii{(\roman{eqquestionnoiii})} +\newcommand{\labeleqquestionnoiii}{% + \color{\eq@quesNumCol}\bfseries\theeqquestionnoiii} +\define@key{props@ques}{labelwidthTo}% + [\normalsize\normalfont\bfseries00.]% + {\def\propQ@labelwidthTo{#1}} +\define@key{props@ques}{labelwidth}[]{\def\propQ@labelwidth{#1}} +\let\propQ@labelwidth\@empty +\define@key{props@ques}{topsep}[\the\topsep]{\edef\propQ@topsep{#1}} +\define@key{props@ques}{partopsep}[\the\partopsep]% + {\edef\propQ@partopsep{#1}} +\define@key{props@ques}{parsep}[\the\parsep]{\edef\propQ@parsep{#1}} +\define@key{props@ques}{itemsep}[\the\itemsep]{\edef\propQ@itemsep{#1}} +\define@key{props@ques}{labelsepTo}[\normalsize\normalfont\ ]% + {\def\propQ@labelsepTo{#1}} +\define@key{props@ques}{labelsep}[\@empty]{\def\propQ@labelsep{#1}} +\let\propQ@labelsep\@empty +\define@key{props@ques}{color}[blue]{\quesNumColor{#1}} +\setkeys{props@ques}{labelwidthTo,topsep,partopsep,parsep,% + itemsep,labelsepTo,color}% +\newenvironment{questions}[1][] +{% + \ifnum\@eqquestiondepth>\tw@\@toodeep\else + \advance\@eqquestiondepth\@ne\fi + \def\@quesctr{eqquestionno\romannumeral\the\@eqquestiondepth}% + \toks@=\expandafter\expandafter\expandafter{#1}\expandafter + \xdef\csname quesOpts\@quesctr\endcsname{\the\toks@}% + \edef\tempexp{\noexpand\setkeys{props@ques}{\the\toks@}}\tempexp + \list{\qMark@Hook\prior@questionsHook\gdef\eqPTs{1}% + \global\let\eqQT\eq@na% + {\@tempcnta=0 \let\@thispr@b\@empty + \@whilenum\@tempcnta<\@eqquestiondepth\do{\advance\@tempcnta\@ne + \ifx\@thispr@b\@empty\edef\@thispr@b{% + \csname theeqquestionno\romannumeral\the\@tempcnta\endcsname}\else + \edef\@thispr@b{\@thispr@b% + \csname theeqquestionno\romannumeral\the\@tempcnta\endcsname}\fi + }\xdef\@currentQues{\@thispr@b}}% + \makebox[\labelwidth][r]{\normalfont\@nameuse{label\@quesctr}}% + \xdef\eq@pageThisQ{\the\c@page}% + \post@questionsHook}{\usecounter{\@quesctr}% + \ifx\propQ@labelsep\@empty + \settowidth{\labelsep}{\propQ@labelsepTo}\else + \setlength{\labelsep}{\propQ@labelsep}\fi + \ifx\propQ@labelwidth\@empty + \settowidth{\labelwidth}% + {\propQ@labelwidthTo\hspace{\labelsep}}\else + \settowidth{\labelwidth}{\hspace{\propQ@labelwidth}% + \hspace{\labelsep}}\fi + \setlength{\topsep}{\propQ@topsep}% + \setlength{\partopsep}{\propQ@partopsep}% + \ifdim\parskip>\z@\addtolength{\topsep}{-\parskip}\fi + \setlength{\parsep}{\propQ@parsep}% + \setlength{\itemsep}{\propQ@itemsep}% + \setlength{\itemindent}{0pt}% + \setlength{\leftmargin}{\labelwidth}% + }% +}{\endlist} +\def\pushquestions{\expandafter\xdef\csname save\@quesctr\endcsname + {\expandafter\the\csname c@\@quesctr\endcsname}\end{questions}} +\def\popquestions{% + \begin{questions}[\csname quesOpts\@quesctr\endcsname]% + \setcounter{\@quesctr}{\csname save\@quesctr\endcsname}% + \@ifnextchar\popquestions{\item[]}{\@ifnextchar\begin{\item[]}{}}} +\newcommand{\priorsqhook}[1]{\def\sq@priorhook{#1}} +\priorsqhook{} +\newcommand{\abovesqskip}[1]{\def\sq@aboveskip{#1}} +\abovesqskip{\par\medskip} +\long\def\endsqhook#1{\def\sq@afterhook{#1}} +\endsqhook{} +\def\@shortquizCnt{0} +\def\@sqGenBaseName{eqSqBn\@shortquizCnt} +\let\sqhspace\space +\let\ListOfSQuizNames\@empty +\newenvironment{shortquiz} +{% + \xdef\eq@pageThisQ{\the\c@page}% + \let\@currentQues\@empty + {\count0=\@shortquizCnt \advance\count0by1\relax + \xdef\@shortquizCnt{\the\count0}}% + \goodbreak\@ifstar{\sqForms\@shortquiz}% + {\if\aeb@FLOverride\eq@f\def\sqstar{*}\else + \def\sqstar{}\sqLinks\fi\@shortquiz}% +}{\aeb@endshortquiz} +\newenvironment{shortquiz*} +{% + \xdef\eq@pageThisQ{\the\c@page}% + {\count0=\@shortquizCnt\advance\count0by1\relax + \xdef\@shortquizCnt{\the\count0 }}% + \sqForms\@shortquiz +}{\aeb@endshortquiz} +\def\@shortquiz{\@ifnextchar[% + {\@@shortquiz}{\@@shortquiz[\@sqGenBaseName]}} +\def\sq@setCLN#1{\ifx\aebTitleQuiz\@empty + \protected@edef\@currentlabelname{#1}\else + \protected@edef\@currentlabelname{\@currentlabelname}\fi +} +\let\isQZ=q \let\isSQZ=s +\let\eqQuizType\relax +\def\@@shortquiz[#1]{%\begingroup + \gdef\oField{#1}\gdef\curr@quiz{#1}\gdef\currQuiz{#1}% + \edef\tmp@Exp{\noexpand\g@addto@macro\noexpand + \ListOfSQuizNames{,#1}}\tmp@Exp + \global\let\eqQzQuesList\@empty + \let\eq@AddProbToQzQuesList\relax + \edef\@currentlabel{\@shortquizCnt}% + \edef\@currentHref{shortquiz.\@shortquizCnt}% + \global\let\eqQuizType\isSQZ\let\@qzsolndest\@empty + \if\sqstar*\relax + \let\@Ans\Ans@sq@f + \ifx\oField\@empty + \typeout{^^JExerquiz: Base field name required when using + shortquiz with '*' option}% + \PackageInfo{exerquiz}{Assuming link style^^J}% + \let\@Ans\Ans@sq@l + \fi + \else + \let\@Ans\Ans@sq@l + \fi + \setcounter{questionno}{0}% + \let\answers\answers@sq + \let\endanswers\endanswers@sq + \let\manswers\manswers@sq + \let\endmanswers\endmanswers@sq + \let\solution\solution@sq + \let\endsolution\endsolution@sq + \sq@aboveskip\sq@priorhook\ignorespaces +} +\newcommand\belowsqskip[1]{\def\aftershortquizskip{#1}} +\belowsqskip{\medskip} +\def\aeb@endshortquiz{\setcounter{quizno}{0}% + \sq@afterhook + \global\let\sqlabel\eq@sqlabel + \global\let\sqslrtnlabel\eq@sqslrtnlabel + \global\let\sqsllabel\eq@sqsllabel + \par\aftershortquizskip +} +\def\sqLinks{\def\sqstar{}}\sqLinks +\def\sqForms{\def\sqstar{*}} +\let\eq@tq@star\relax +\def\qzPriorSolutionAfterHook{\smallskip} +\let\sqPostHeaderHook\@empty +\let\qPostHeaderHook\@empty +\let\eq@sqPostHeaderHook\@empty +\let\eq@qPostHeaderHook\@empty +\let\prior@eqQt\@empty +\let\prior@eqSQt\@empty +\def\sqsolafterhspace{\space} +\newif\ifmakeQzSlLocal \makeQzSlLocalfalse +\def\makeQzSolnsLocalOn{\makeQzSlLocaltrue} +\def\makeQzSolnsLocalOff{\makeQzSlLocalfalse} +\def\solution@sq{\let\eq@next\relax + \ifx\@qzsolndest\@empty + \PackageWarning{exerquiz}% + {* Solutions unexpected here, will *\MessageBreak + * assume solutionsafter option *}% + \eq@solutionsaftertrue + \fi + \ifeq@solutionsafter + \par\qzPriorSolutionAfterHook\noindent + \if!\sqsolafter!\else + \sqsolafter\sqsolafterhspace\fi\ignorespaces + \else + \global\therearequizsolutionstrue\let\verbatim@out\quiz@solns + \set@display@protect + \immediate\write\verbatim@out{% + \ifmakeQzSlLocal\protect\begingroup^^J\fi + \if\eqQuizType\isQZ + \ifx\prior@eqQt\@empty\else\prior@eqQt\fi + \ifx\eqMrkCpyArg\@empty\else + \protect\eqMrkSoln{\eqMrkCpyArg}\fi + \protect\eqQt{\eqFilterArg}\else + \ifx\prior@eqSQt\@empty\else\prior@eqSQt\fi + \ifx\eqMrkCpyArg\@empty\else + \protect\eqMrkSoln{\eqMrkCpyArg}\fi + \protect\eqSQt{\eqFilterArg}\fi + \protect\quizSolnHeader\if\eqQuizType\isQZ\ifx\allow@peek\eq@NO + [{\curr@quiz}{\currQuizStartPage}]\fi\fi + {\@qzsolndest}{\sqsllabel}\protect\eqterminex + \if\eqQuizType\isQZ\expandafter\eq@qPostHeaderHook + \expandafter\qPostHeaderHook\else + \expandafter\eq@sqPostHeaderHook + \expandafter\sqPostHeaderHook\fi}% + \set@typeset@protect + \expandafter\verbatimwrite\fi +} +\let\qzSolutionsAfterHook\@empty +\def\endsolution@sq +{% + \ifeq@solutionsafter + \eq@fititin{\mbox{\sqslrtnlabel}}\par\qzSolutionsAfterHook + \aftergroup\ignorespaces + \else + \endverbatimwrite + \eq@clearMrkCpy + \ifx\@qzsolndest\@empty\else\set@display@protect + \immediate\write\verbatim@out{\eqSqSolnTrailer}% + \set@typeset@protect + \fi + \fi + \global\let\@qzsolndest\@empty +} +\def\fpAfterSolutionsSkip{\par\medskip} +\let\eqSqSolnTrailerHook\@empty +\let\eqQzSolnTrailerHook\@empty +\newcommand\eqSqSolnTrailer{% + \if\eqQuizType\isQZ + \eqQzSolnTrailerHook + \protect\ReturnTo{page.\eq@pageThisQ}% + {\protect\mbox{\sqslrtnlabel}}\string\endeqQt + \else + \eqSqSolnTrailerHook + \protect\ReturnTo{page.\eq@pageThisQ}% + {\protect\mbox{\sqslrtnlabel}}\string\endeqSQt% + \fi + \ifeqforpaper\protect\fpAfterSolutionsSkip\fi^^J% + \ifmakeQzSlLocal\protect\endgroup^^J\fi +} +\let\eqSQt\@gobble +\let\endeqSQt\relax +\let\eqQt\@gobble +\let\endeqQt\relax +\let\prior@quizSolnHeaderHook\@empty +\newcommand\quizSolnHeader[3][]{% + \prior@quizSolnHeaderHook + \ifeqforpaper\else\webnewpage\fi\noindent + #2% + \solnspace +} +\newif\iftherearequizsolutions \therearequizsolutionsfalse +\let\aeb@FLOverride\relax +\def\includequizsolutions{\@ifstar + {\let\resetQZtsolns\relax\includequizsolutionsi} + {\def\resetQZtsolns{\global\let\include@quizsolutions\relax}% + \includequizsolutionsi}} +\newcommand{\includequizsolutionsi}[1][]{% + \filterFor{#1}\includequizsolutionsii} +\def\includequizsolutionsii{\include@quizsolutions + \resetQZtsolns + \let\eqFilterArg\@empty} +\newcommand\useForms{\def\aeb@FLOverride{f}} +\newcommand\useLinks{\def\aeb@FLOverride{l}} +\newcommand\restoreFLTypeDefault{\global\let\aeb@FLOverride\relax} +\let\aeb@FLOverride\relax +\let\aebtitleQuiz\@empty +\let\aebTitleQuiz\@empty +\def\pushEnvir{\xdef\eq@currenvir{\@currenvir}\endgroup} +\def\popEnvir{\begingroup\@endpefalse + \edef\@currenvir{\eq@currenvir}% + \edef\@currenvline{\on@line}% +} +\def\answers@sq{\parindent0pt + \ifx\solutionparshape\@empty\else + \pushEnvir\par\noindent\expandafter\popEnvir\fi + \stepcounter{questionno}% + \if\sqstar*\relax + \if\aeb@FLOverride\eq@l + \let\@Ans\Ans@sq@l\else + \let\@Ans\Ans@sq@f\fi + \else + \if\aeb@FLOverride\eq@f + \let\@Ans\Ans@sq@f\else + \let\@Ans\Ans@sq@l\fi + \fi + \def\aeb@answerType{r}\@ifnextchar[{\answers@@sq}% + {\@ifstar{\answers@@sq[\curr@quiz.\thequestionno]}{\answers@@sq[]}}} +\def\manswers@sq{\parindent0pt + \@ifundefined{ifuserectforms}{} + {\if\aeb@FLOverride\eq@f\ifuserectforms + \useRectForMC\else\useCircForMC\fi\fi}% + \ifx\solutionparshape\@empty\else + \pushEnvir\par\noindent\expandafter\popEnvir\fi + \stepcounter{questionno}% + \if\sqstar*\relax + \if\aeb@FLOverride\eq@l + \let\@Ans\Ans@ck@sq@l\else + \let\@Ans\Ans@ck@sq@f\fi + \else + \if\aeb@FLOverride\eq@f + \let\@Ans\Ans@ck@sq@f\else + \let\@Ans\Ans@ck@sq@l\fi + \fi + \def\aeb@answerType{c}\@ifnextchar[{\answers@@sq}% + {\@ifstar{\answers@@sq[\curr@quiz.\thequestionno]}{\answers@@sq[]}}} +\let\sq@hwdest\@empty % hard-wired destination +\def\answers@@sq[#1]#2{% + \xdef\aeb@numCols{#2}% + \ifx\sq@hwdest\@empty + \xdef\@qzsolndest{#1}\else + \gdef\@qzsolndest{\sq@hwdest}\fi + \if\aeb@numCols1\gdef\eq@listType{1}\expandafter\answers@sq@list + \else + \gdef\eq@listType{0}\expandafter\answers@@sq@tabular + \fi{\aeb@numCols}} +\def\setMClabelsepDefault#1{\def\eq@hspanner@default{#1}} +\def\setMClabelsep#1{\def\eq@hspanner{#1}} +\setMClabelsep{\ }\setMClabelsepDefault{\ } +\def\resetMClabelsep{\expandafter\setMClabelsep\expandafter + {\eq@hspanner@default}} +\def\eq@lw@l{\eq@l@l\eq@hspanner} +\def\eq@l@l{\normalsize\normalfont(d)} +\def\eq@lw@f{\kern\RadioFieldSize\eq@hspanner} +\@ifundefined{ifwithinsoldoc}{\newif\ifwithinsoldoc\withinsoldocfalse}{} +\@ifundefined{ifwithinqsldoc}{\newif\ifwithinqsldoc\withinqsldocfalse}{} +\let\eq@ansChoiceArray\@empty +\def\eq@recordAnsChoice{% + \ifx\eq@ansChoiceArray\@empty + \edef\tmp@exp{\noexpand\g@addto@macro + \noexpand\eq@ansChoiceArray{"\alph{quizno}"}}\else + \edef\tmp@exp{\noexpand\g@addto@macro + \noexpand\eq@ansChoiceArray{,"\alph{quizno}"}}\fi + \tmp@exp} +\newcommand\Ans@list[2][0]{\gdef\eq@pPTs{#1}\xdef\Ans@choice{#2}% + \item\relax\noindent\if\eq@listType\eq@One + \addtocounter{quizno}{-1}\@ifundefined{ifwithinsoldoc} + {\refstepcounter{quizno}}{\ifwithinsoldoc\stepcounter{quizno}\else + \refstepcounter{quizno}\fi}\fi + \ignorespaces} +\newenvironment{answers@sq@list}[1]{% + \ifx\aeb@answerType\eq@r + \let\endanswers\endanswers@sq@list\else + \let\endmanswers\endanswers@sq@list\fi + \list{\strut\@Ans}{% + \if\sqstar*\relax + \settowidth{\labelwidth}{\eq@lw@f}\else + \settowidth{\labelwidth}{\eq@lw@l}\fi + \setlength{\topsep}{-\parskip+\aboveanswersSkip}% + \setlength{\parsep}{0pt}\setlength{\itemindent}{0pt}% + \setlength{\itemsep}{0pt}\setlength{\partopsep}{0pt}% + \setlength{\listparindent}{\parindent}% + \ifnum\exerwparts@cols>1\relax + \ifx\itsExerParts\eq@YES + \setlength{\leftmargin}{\labelwidth}\else + \setlength{\leftmargin}{\labelwidth+\eqemargin}\fi + \else + \ifx\solutionparshape\@empty + \setlength{\leftmargin}{\labelwidth}\else + \setlength{\leftmargin}{\labelwidth+\eqemargin}\fi + \fi + \setlength{\labelsep}{0pt}% + \def\Ans{\Ans@list}% + }% list +}{\endlist\setcounter{quizno}{0}\eq@answersEndHook} +\newcommand\Ans@tabular[2][0]{\gdef\eq@pPTs{#1}\xdef\Ans@choice{#2}% + \leavevmode\@Ans +} +\newcommand\sqtabsep[1]{\def\eq@argi{#1}\ifx\eq@argi\@empty + \def\sq@tabsep{1.5pt}\else\def\sq@tabsep{#1}\fi} +\sqtabsep{1.5pt} +\def\sqTabPos#1{\def\sq@TabPos{[#1]}}\sqTabPos{} +\def\answers@@sq@tabular#1{% + \ifinner + \ifx\itsExerParts\eq@YES\par\removelastskip + \removelastparskip\vskip\aboveanswersSkip\fi + \else\par\removelastskip\removelastparskip + \vskip\aboveanswersSkip\fi + \noindent\ifnum\exerwparts@cols>1\relax\parshape=0\fi + \tabcolsep=0pt + \eq@tmpdima=\linewidth + \@tempcnta#1\relax + \advance\@tempcnta-1\relax + \multiply\@tempcnta by2 + \@tempdima\sq@tabsep\relax + \multiply\@tempdima\@tempcnta + \advance\eq@tmpdima-\@tempdima + \divide\eq@tmpdima by#1 + \def\Ans{\Ans@tabular}% + \tabcolsep\sq@tabsep\relax + \expandafter\tabular\sq@TabPos{@{}*{#1}{p{\eq@tmpdima}}@{}}}% +\let\eq@save@doendpe\@doendpe +\def\reset@doendpe#1{\global\eq@scratchtoks=\expandafter{#1}% + \gdef\@doendpe{\par\@endpetrue\global\let\@doendpe\eq@save@doendpe + \def\par{\@restorepar + \expandafter\everypar + \expandafter{\the\eq@scratchtoks}\par\@endpefalse}% + \everypar{{\setbox\z@\lastbox}% + \everypar{}\@endpefalse}\the\eq@scratchtoks + }% +} +\newcommand\answersEndHook[1]{\def\eq@answersEndHook{#1}} +\let\eq@answersEndHook\@empty +\def\endanswers@sq{\endtabular\setcounter{quizno}{0}% + \eq@answersEndHook\reset@doendpe{\the\everypar}% + \ifinner\else%\par + \removelastskip + \vspace{\aboveanswersSkip}\@endpetrue\fi +} +\def\endmanswers@sq{\endtabular\setcounter{quizno}{0}% + \eq@answersEndHook\reset@doendpe{\the\everypar}% + \ifinner\else%\par + \removelastskip + \vspace{\aboveanswersSkip}\@endpetrue\fi +} +\def\popiiictm{\special{CTM: pop pop pop}} +\def\aebChoiceAltFmt{\noexpand\ifaebshowgrayletters + \Alph{quizno}\noexpand\else\linkContentFormat\noexpand\fi} +\def\linkContentFormat{% + \if\probstar*\Alph{quizno}\else\alph{quizno}\fi} +\def\linkContentWrapper{(\hfil\linkContentFormat\hfil)}% +\def\Ans@sq@l{% + \leavevmode\if\eq@listType\eq@One\stepcounter{quizno}\else + \@ifundefined{ifwithinsoldoc}{\refstepcounter{quizno}} + {\ifwithinsoldoc\stepcounter{quizno}\else + \refstepcounter{quizno}\fi}\fi\PBS\raggedright + \settowidth{\eq@tmplength}{\eq@lw@l}\sbox{\eq@tmpbox}{\eq@l@l}% + \eq@tmpdima=\wd\eq@tmpbox + \def\link@@Content{\linkContentWrapper}% + \hangindent=\eq@tmplength\hangafter=1\relax + \Ans@sq@l@driver +\eq@hspanner\ignorespaces} +\let\Ans@ck@sq@l\Ans@sq@l +\let\rbf@Opts\@empty +\def\Ans@sq@f{% + \if\eq@listType\eq@One\stepcounter{quizno}\else + \@ifundefined{ifwithinsoldoc}{\refstepcounter{quizno}} + {\ifwithinsoldoc\stepcounter{quizno}\else + \refstepcounter{quizno}\fi}\fi\PBS\raggedright + \settowidth{\eq@tmplength}{\eq@lw@f}% + \eq@tmpdima=\wd\eq@tmpbox% + \hangindent=\eq@tmplength\hangafter=1\relax + \insertGrayLetters % 6.3d + \Ans@sq@f@driver +\eq@hspanner\ignorespaces} +\let\Ans@ck@sq@f\Ans@sq@f +\newskip\aboveanswersSkip +\setlength\aboveanswersSkip{3pt} +\providecommand\graylettersColor{gray} +\def\insertGrayLetters{\ifaebshowgrayletters + \rlap{\makebox[\RadioFieldSize]% + {\textcolor{\graylettersColor}{\Alph{quizno}}}}\else\relax\fi} +\newcount\eq@tabColCnt +\define@key{bchoice}{nCols}{\def\bChoiceNumCols{#1}} +\@for\eqi:=1,2,3,4,5,6,7,8,9,10 \do{\edef\temp@expand@def{% + \noexpand\define@key{bchoice}{\eqi}[\eqi]{% + \noexpand\def\noexpand\bChoiceNumCols{\eqi}}% + }\temp@expand@def +} +\def\bChoiceNumCols{\aeb@numCols} +\define@key{bchoice}{random}[true]{% + \csname if#1\endcsname\eq@randomizeChoicestrue + \else\eq@randomizeChoicesfalse\fi +} +\define@key{bchoice}{label}[]{\xdef\bChoiceLabel{#1}} +\def\bChoices{\@ifnextchar[{\@ansChoices}{\@ansChoices[\aeb@numCols]}} +\def\@ansChoices[#1]% +{% + \global\let\@tempholdSaveAns\@empty %4/5 + \global\let\@tempholdSaveChoice\@empty %4/5 + \global\let\bChoiceLabel\@empty %4/5 + \setkeys{bchoice}{#1}% + \global\eq@tabColCnt=0 + \ifnum\aeb@numCols=1 % list mode + \def\eq@next{\@layoutListAns}\else % tabular mode + \def\eq@next{\@layoutTabularAns{\bChoiceNumCols}}\fi + \eq@next +} +\let\eChoices\relax +\def\@layoutListAns{\@ifnextchar\Ans{\@getListAns}% + {\@lookforendansChoices{\@layoutListAns}}% +} +\newcommand{\eq@saveAns}[2][]{% + \let\eq@next\@@@SaveAnsGobbleAns + \ifx\bChoiceLabel\@empty\else + \def\eq@savedAnsOpt{#1}\def\eq@savedAnsZO{#2}% + \if\eq@savedAnsZO1 \let\eq@next\@@@SaveAns\fi + \fi\eq@next +} +\long\def\@@@SaveAns#1\eAns{% 4/5 + \g@addto@macro\@tempholdSaveAns{\\{\ignorespaces#1}}% + \addtocounter{quizno}{1}% + \edef\temp@expand{\noexpand\g@addto@macro\noexpand + \@tempholdSaveChoice{% + \noexpand\\{\ifx\sqstar\@empty\aebChoiceAltFmt\else + \ifaebshowgrayletters\Alph{quizno}\else + \linkContentFormat\fi\fi}}}\temp@expand + \addtocounter{quizno}{-1}% +} +\newif\ifoxfordcomma \oxfordcommatrue +\def\oxfordCommaOn{\oxfordcommatrue} +\def\oxfordCommaOff{\oxfordcommafalse} +\def\eq@insertComma{% + \ifx\eq@comma\@empty + \ifnum\@nameuse{NumAns\eq@namearg}>2\relax + \def\eq@comma{,}\fi + \else\ifx\eq@insertAnd\@empty\eq@comma\space + \else\ifnum\@tempcnta=\@nameuse{NumAns\eq@namearg}% + \ifoxfordcomma\eq@comma\fi\else\eq@comma\fi\space + \fi + \fi +} +\newcommand\eqAnd{and}\def\eq@insertAnd{% + \ifnum\@nameuse{NumAns\eq@namearg}<2\relax\else + \ifnum\@nameuse{NumAns\eq@namearg}>2\relax + \else\leavevmode\space\fi\eqAnd\space\fi} +\long\def\eq@displayAns#1{\advance\@tempcnta1\relax + \eq@insertComma + \ifnum\@tempcnta=\@nameuse{NumAns\eq@namearg}\eq@insertAnd\fi#1} +\def\eq@displayAlts#1{\advance\@tempcnta1 + \eq@insertComma + \ifnum\@tempcnta=\@nameuse{NumAns\eq@namearg}\eq@insertAnd\fi + \savedAltFmt{#1}} +\def\eq@displayAltsAns#1{\advance\@tempcnta1\relax + \eq@insertComma + \ifnum\@tempcnta=\@nameuse{NumAns\eq@namearg}\eq@insertAnd\fi#1} +\newcommand{\savedAltFmt}[1]{(#1)} +\newcommand{\useSavedAns}{\bgroup\@ifstar{\useSavedAns@i} + {\let\eq@insertAnd\@empty\useSavedAns@i}} +\newcommand{\useSavedAns@i}[2][]{\@tempcnta=0\relax + \def\eq@namearg{#2}\let\label\@gobble + \def\eq@argi{#1}\ifx\eq@argi\@empty + \let\eq@comma\@empty + \let\\\eq@displayAns\@nameuse{SavedAns#2}\else + \@nameuse{SavedAns#2-Idx#1}\fi + \egroup +} +\newcommand{\useSavedAlts}{\bgroup\@ifstar{\useSavedAlts@i} + {\let\eq@insertAnd\@empty\useSavedAlts@i}} +\newcommand{\useSavedAlts@i}[2][]{\@tempcnta=0\relax + \def\eq@namearg{#2}\@nameuse{caseFor#2}% + \def\eq@argi{#1}\ifx\eq@argi\@empty + \let\eq@comma\@empty + \let\\\eq@displayAlts\@nameuse{SavedAlts#2}\else + \savedAltFmt{\@nameuse{SavedAlts#2-Idx#1}}\fi + \egroup +} +\newcommand{\useSavedAltsAns}{\bgroup\@ifstar{\useSavedAltsAns@i} + {\let\eq@insertAnd\@empty\useSavedAltsAns@i}} +\newcommand{\useSavedAltsAns@i}[2][]{\@tempcnta=0\relax + \def\eq@namearg{#2}\@nameuse{caseFor#2}\let\label\@gobble + \def\eq@argi{#1}\ifx\eq@argi\@empty + \let\eq@comma\@empty + \let\\\eq@displayAltsAns\@nameuse{SavedAltsAns#2}\else + \savedAltFmt{\@nameuse{SavedAlts#2-Idx#1}} + \@nameuse{SavedAns#2-Idx#1}\fi + \egroup +} +\newcommand{\useSavedNumAns}[1]{\@nameuse{NumAns#1}} +\long\def\@@@SaveAnsGobbleAns#1\eAns{} % 4/5 +\long\def\@getListAns\Ans#1\eAns{%\@@par %start new paragraph + \eq@saveAns#1\eAns % 4/5 + \Ans#1\vspace{\@rowskip}% + \@layoutListAns +} +\long\def\@lookforendansChoices#1{% + \@ifnextchar\eChoices{\rowsep{\rowsep@default}% + \expandafter\@findendans\@gobble}{\expandafter#1\@gobble}% +} +\def\@layoutTabularAns#1{% + \let\eq@tabSep\@empty + \xdef\numShortCols{#1}% + \ifnum#1>\aeb@numCols \xdef\numShortCols{\aeb@numCols}\fi + \@@layoutTabularAns +} +\def\@@layoutTabularAns{% + \@ifnextchar\Ans{\@getTabAns}% + {\@lookforendansChoices{\@@layoutTabularAns}}% +} +\def\rowsep#1{\gdef\@rowsep{[#1]}\gdef\@rowskip{#1}}% +\rowsep{\rowsep@default} +\def\rowsepDefault#1{\def\rowsep@default{#1}} +\def\rowsep@default{0pt} +\long\def\@getTabAns\Ans#1\eAns{% + \eq@saveAns#1\eAns + \global\advance\eq@tabColCnt1 + \let\@save@tabSep=\eq@tabSep + \ifnum\eq@tabColCnt=\numShortCols + \global\eq@tabColCnt=0 + \xdef\eq@tabSep{\noexpand\\\noalign{\kern\@rowskip\relax}}% + \else + \gdef\eq@tabSep{&}% + \fi + \@ifnextchar\eChoices{\@save@tabSep\Ans#1\rowsep{\rowsep@default} + \expandafter\@findendans\@gobble}% + {\@save@tabSep\Ans#1\@@layoutTabularAns}% +} +\def\@findendans{\@ifnextchar\end{% 4/5 + \ifx\bChoiceLabel\@empty\else + \processLabeledAns\fi + }{\expandafter\@findendans\@gobble}}% +\def\defineEachAns#1{\advance\count0by1\relax + \@temptokena={#1}\csarg\xdef + {SavedAns\bChoiceLabel-Idx\the\count0}{\the\@temptokena}% + \ifsolutionsonly\else + {\let\\\relax\eq@IWDefs{\string + \csarg\string\gdef{SavedAns\bChoiceLabel-Idx\the\count0}% + {\the\@temptokena}}}\fi +} +\def\defineEachChoice#1{\advance\count0by1\relax + \@temptokena={#1}\csarg\xdef + {SavedAlts\bChoiceLabel-Idx\the\count0}% + {\the\@temptokena}\ifsolutionsonly\else + {\let\\\relax\eq@IWDefs{\string + \csarg\string\gdef{SavedAlts\bChoiceLabel-Idx\the\count0}% + {\the\@temptokena}}}\fi +} +\def\processLabeledAns{% + \bgroup + \let\label\@gobble +\if\aeb@FLOverride\eq@l + \global\@namedef{caseFor\bChoiceLabel}{\graylettersOff}\else + \ifaebshowgrayletters + \global\@namedef{caseFor\bChoiceLabel}{\graylettersOn}\else + \global\@namedef{caseFor\bChoiceLabel}{\graylettersOff}\fi +\fi + \toks@=\expandafter{\@tempholdSaveAns}\csarg + \xdef{SavedAns\bChoiceLabel}{\the\toks@}% + \ifsolutionsonly\else{\let\\\relax\eq@IWDefs{\string + \csarg\string\gdef{SavedAns\bChoiceLabel}{\the\toks@}}}\fi + \count0=0\relax\let\\\defineEachAns\the\toks@ + \xdef\@currNCntAns{\the\count0 }\csarg + \xdef{NumAns\bChoiceLabel}{\@currNCntAns}% + \ifsolutionsonly\else{\eq@IWDefs{\string + \csarg\string\gdef{NumAns\bChoiceLabel}{\the\count0 }}}\fi + \toks@=\expandafter{\@tempholdSaveChoice}\csarg + \xdef{SavedAlts\bChoiceLabel}{\the\toks@}% + \ifsolutionsonly\else{\let\\\relax\eq@IWDefs{\string + \csarg\string\gdef{SavedAlts\bChoiceLabel}{\the\toks@}}}\fi + \count0=0\relax\let\\\defineEachChoice\the\toks@ + \count0=1\relax\toks@={}%{\ignorespaces\@gobble}% + \loop + \edef\temp@exp{\the\toks@\noexpand\\{% + \noexpand\useSavedAlts[\the\count0]{\bChoiceLabel} + \noexpand\useSavedAns[\the\count0]{\bChoiceLabel}}}% + \toks@=\expandafter{\temp@exp}% + \ifnum\count0<\@currNCntAns + \advance\count0by1 + \repeat + \csarg\xdef{SavedAltsAns\bChoiceLabel}{\the\toks@}% + \ifsolutionsonly\else{\let\\\relax\eq@IWDefs{\string + \csarg\string\gdef{SavedAltsAns\bChoiceLabel}{\the\toks@}}}\fi + \egroup +} +\def\graylettersOn{\aebshowgrayletterstrue} +\def\graylettersOff{\aebshowgraylettersfalse} +\def\aeb@exiii{\expandafter\expandafter\expandafter} +\def\REF{\@ifstar{\let\isREFstar\eq@One\aeb@REFstar} + {\let\isREFstar\eq@Zero\aeb@REF}} +\def\aeb@REFstar#1{\@ifundefined{r@#1}{\hbox{\reset@font\bfseries ??}} + {\ifaebshowgrayletters\aeb@buildUpperCaseRef{#1}% + \else\ref*{#1}\fi}% +} +\def\aeb@REF#1{\@ifundefined{r@#1}{\hbox{\reset@font\bfseries ??}} + {\ifaebshowgrayletters\aeb@buildUpperCaseRef{#1}% + \else\ref{#1}\fi}% +} +\def\aeb@buildUpperCaseRef#1{% + \xdef\tmp@expand{\aeb@exiii\@firstoftwo\csname r@#1\endcsname}% + \xdef\tmp@expand{\uppercase{\tmp@expand}}\tmp@expand +} +\endinput +%% +%% End of file `eqexam.def'. diff --git a/texmf-dist/tex/latex/acrotex/exerquiz.sty b/texmf-dist/tex/latex/acrotex/exerquiz.sty index e7acef40..c25de9ca 100644 --- a/texmf-dist/tex/latex/acrotex/exerquiz.sty +++ b/texmf-dist/tex/latex/acrotex/exerquiz.sty @@ -19,7 +19,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{exerquiz} - [2018/12/13 v8.2.8 % + [2019/02/11 v8.2.9 % Exerquiz: Exercises and Quizzes for LaTeX/PDF package (dps)] \usepackage{keyval} \RequirePackage{ifpdf}[2006/02/20] @@ -926,8 +926,8 @@ \xdef\eq@startSoln{\the\pagetotal}% \eqe@debugVertSkip{\marginpar{\smash{b[\sameVspace]}}}% } -\let\eqSavedComment\comment -\let\eqSavedEndCommet\endcomment +\let\eqSavedComment\dlcomment +\let\endeqSavedComment\enddlcomment \def\setTabulrSolnEnv{% \@ifundefined{@listii@SAVE}{\global\let\@listii@SAVE\@listii}{}% \expandafter\def\expandafter\@listii\expandafter{\@listii@SAVE @@ -959,13 +959,13 @@ \if\currhideopt\eq@Hid \let\minVspacet@bs\@empty \let\procsoln\eqSavedComment - \let\endprocsoln\eqSavedEndCommet + \let\endprocsoln\endeqSavedComment \def\eq@next{\procsoln}% \else \eq@ckglobalhide \ifeq@hidesolution \let\procsoln\eqSavedComment - \let\endprocsoln\eqSavedEndCommet + \let\endprocsoln\endeqSavedComment \else \ifeq@solutionsafter\else \ifx\eq@@CommonCmd\@empty\else @@ -1716,14 +1716,14 @@ \oField.RightAnsSymbJSLoc=\rghtAnsSymbJSLoc;\fi \ifx\wrngAnsSymbJSLoc\@empty\else\r \oField.WrongAnsSymbJSLoc=\wrngAnsSymbJSLoc;\fi - }}]{sqID\oField}{0bp}{0bp}}% + }}]{sqID\oField}{2bp}{2bp}}% } \def\qz@IDTxtField{\makebox[0pt][l]{\textField[\autoCenter{n}\BC{}\BG{} \S{S}\textSize{0}\Ff{\FfReadOnly} \AA{\AAFormat{if(typeof aQuizzesInDoc=="undefined")\r\t var aQuizzesInDoc=new Array();\r if (aQuizzesInDoc.indexOf("\oField")) aQuizzesInDoc.push("\oField"); - }}]{qzID\oField}{0bp}{0bp}}} + }}]{qzID\oField}{2bp}{2bp}}} \let\eqQuizType\relax \def\@@shortquiz[#1]{%\begingroup \gdef\oField{#1}\gdef\curr@quiz{#1}\gdef\currQuiz{#1}% @@ -2118,7 +2118,7 @@ {\eq@setWidgetProps\setLink@driver}% {\eq@EndQuizLinkDefaults\eq@@EndQuizLinkActions\every@Link}% \makebox[0pt][r]{\textField[\BC{}\autoCenter{n}]% - {htxtfld.\curr@quiz}{0bp}{0bp}}% + {htxtfld.\curr@quiz}{2bp}{2bp}}% \makebox[0pt][r]{\eq@hiddenScoreData\eq@insertHiddenFields}% \global\let\eq@CGI\@empty\ignorespaces } @@ -2159,7 +2159,7 @@ }}}% } \newcommand{\eq@hiddenScoreData}{\makebox[0pt][r]{% - \textField[\BC{}\F{\FHidden}]{ScoreData.\curr@quiz}{0bp}{0bp}}} + \textField[\BC{}\F{\FHidden}]{ScoreData.\curr@quiz}{2bp}{2bp}}} \newcommand\eq@EndQuizButton[1][]{% \ifx\eq@CGI\@empty \let\eq@submitURL\@empty diff --git a/texmf-dist/tex/latex/acrotex/insdljs.sty b/texmf-dist/tex/latex/acrotex/insdljs.sty index 22f2034d..3babe3d7 100644 --- a/texmf-dist/tex/latex/acrotex/insdljs.sty +++ b/texmf-dist/tex/latex/acrotex/insdljs.sty @@ -19,7 +19,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{insdljs} - [2018/07/21 v2.4 Insert Document Level JavaScripts (dps)] + [2019/03/16 v2.4.2 Insert Document Level JavaScripts (dps)] \usepackage{xkeyval} \RequirePackage{ifpdf}[2006/02/20] \RequirePackage{ifxetex}[2006/08/21] @@ -90,6 +90,8 @@ \protected\def\pdfnames{\pdfextension names } \def\pdfpageref{\pdffeedback pageref}\fi\fi \RequirePackage{verbatim} +\let\dlcomment\comment +\let\enddlcomment\endcomment \usepackage{conv-xkv}[2017/01/03] \@ifundefined{dljs@drivernum}{% \@ifundefined{eq@drivernum}{% @@ -146,6 +148,13 @@ {\obeylines % \gdef\js@@R{\noexpand }} +\def\pdfSPDef{\string\040} +\let\pdfSP\pdfSPDef +\def\pdfLBr{\string\173} +\def\pdfRBr{\string\175} +\def\dl@sp@ce{ } +\bgroup\obeyspaces +\gdef\dl@restorespcs{\global\let =\dl@sp@ce}\egroup \let\dljstfor\@tfor \def\jsR{\string\r\string\n} \def\defineJSjsR{\string\r\eqbs^^J} @@ -158,54 +167,63 @@ \newwrite\js@verbatim@out \def\iwvo#1{\immediate\write\js@verbatim@out{#1}} \def\dl@lparen{(}\def\dl@rparen{)} +\def\genericNL{^^J} +\def\defjsLB{\expandafter\pdfmarkLB\@gobblefour} +\def\genericLB{\eqbs\eqbs^^J} +\def\pdfmarkLB{\eqbs^^J} \def\jscsDflt{\let\protect\noexpand\let\jslit\string - \let\~\dl@tilda\let\^\dl@sup - \def\\{\eqbs\eqbs}\def\cs##1{\\\\##1}% - \def\r{\\r}\def\t{\\t}\def\n{\\n}% - \let\{\dl@lBrace\let\}\dl@rBrace - \ifx\jsstr@useUni\dl@One\def\Uni{\\u}\else\def\u{\\u}\fi - \ifx\jsstr@parens\dl@One\let\l@paren\dl@lparen - \let\r@paren\dl@rparen\else - \let\l@paren\@empty\let\r@paren\@empty\fi + \let\~\dl@tilda\let\^\dl@sup + \def\\{\eqbs\eqbs}\def\cs##1{\\\\##1}% + \def\r{\\r}\def\t{\\t}\def\n{\\n}% + \let\{\dl@lBrace\let\}\dl@rBrace + \ifx\jsstr@useUni\dl@One\def\Uni{\\u}\else\def\u{\\u}\fi + \ifx\jsstr@parens\dl@One\let\l@paren\dl@lparen + \let\r@paren\dl@rparen\else + \let\l@paren\@empty\let\r@paren\@empty\fi + \dl@paramlocal\let\LB\genericLB\let\NL\genericNL } \def\jscsDLJS{\let\protect\noexpand\let\jslit\string - \let\~\dl@tilda\let\^\dl@sup - \ifxetex\def\\{\eqbs\eqbs}\else\def\\{\eqbs}\fi\def\cs##1{\\\\##1}% - \def\r{\\r}\def\t{\\t}\def\n{\\n}% - \let\{\dl@lBrace\let\}\dl@rBrace - \ifx\jsstr@useUni\dl@One\def\Uni{\\u}\else\def\u{\\u}\fi - \ifx\jsstr@parens\dl@One\let\l@paren\dl@lparen - \let\r@paren\dl@rparen\else - \let\l@paren\@empty\let\r@paren\@empty\fi + \let\~\dl@tilda\let\^\dl@sup + \ifxetex\def\\{\eqbs\eqbs}\else\def\\{\eqbs}\fi\def\cs##1{\\\\##1}% + \def\r{\\r}\def\t{\\t}\def\n{\\n}% + \let\{\dl@lBrace\let\}\dl@rBrace + \ifx\jsstr@useUni\dl@One\def\Uni{\\u}\else\def\u{\\u}\fi + \ifx\jsstr@parens\dl@One\let\l@paren\dl@lparen + \let\r@paren\dl@rparen\else + \let\l@paren\@empty\let\r@paren\@empty\fi + \ifpdfmarkup\let\LB\pdfmarkLB\else + \let\LB\genericLB\fi + \let\NL\genericNL } \ifpdf\let\jscsDLJS\jscsDflt\fi \let\dl@JSCS\jscsDflt -\newcommand{\flJSStr}{\bgroup - \let\dl@JSCS\jscsDflt - \@ifstar{\def\isStar{*}\dl@defJSStr} - {\let\isStar\relax\dl@defJSStr}} +\bgroup\obeyspaces +\gdef\flJSStr{\bgroup\global\let =\pdfSP +\let\dl@JSCS\jscsDflt +\obeyspaces\@ifstar{\def\isStar{*}\dl@defJSStr}% +{\let\isStar\relax\dl@defJSStr}}\egroup \let\fieldJSStr\flJSStr \let\defineJSStr\flJSStr \newcommand{\dlJSStr}{\bgroup - \@ifstar{\def\isStar{*}\let\dl@JSCS\jscsDLJS\dl@defJSStr} - {\let\isStar\relax\let\dl@JSCS\jscsDLJS\dl@defJSStr}} + \@ifstar{\def\isStar{*}\let\dl@JSCS\jscsDLJS\dl@defJSStr} + {\let\isStar\relax\let\dl@JSCS\jscsDLJS\dl@defJSStr}} \define@key{jsstr}{quotes}[]{\let\jsstr@quotes\dl@One} \define@key{jsstr}{noquotes}[]{\let\jsstr@quotes\dl@Zero} \define@key{jsstr}{parens}[]{\let\jsstr@parens\dl@One} \define@key{jsstr}{noparens}[]{\let\jsstr@parens\dl@Zero} -\let\jsstr@quotes\dl@One\let\jsstr@parens\dl@One +\let\jsstr@quotes\dl@One\let\jsstr@parens\dl@Zero % noparens the default \define@key{jsstr}{useUni}[]{\let\jsstr@useUni\dl@One} \let\jsstr@useUni\dl@Zero \newcommand{\dl@defJSStr}[3][quotes]{\def\dl@argi{#1}\ifx\dl@argi\@empty - \else\ifx\dl@JSCS\jscsDLJS\let\jsstr@parens\dl@Zero\fi - \setkeys{jsstr}{#1}\fi\dl@JSCS - \ifx\jsstr@quotes\dl@One - \xdef#2{\l@paren"#3"\r@paren}\else - \xdef#2{\l@paren#3\r@paren}\fi - \if\isStar*\gdef\dl@afterAction{{\Hy@unicodefalse\expandafter - \pdfstringdef\expandafter#2\expandafter{#2}}}\else - \global\let\dl@afterAction\relax\fi - \aftergroup\dl@afterAction\egroup} + \else\ifx\dl@JSCS\jscsDLJS\let\jsstr@parens\dl@Zero\fi + \setkeys{jsstr}{#1}\fi\dl@JSCS + \ifx\jsstr@quotes\dl@One + \xdef#2{\l@paren"#3"\r@paren}\else + \xdef#2{\l@paren#3\r@paren}\fi + \if\isStar*\gdef\dl@afterAction{{\Hy@unicodefalse\expandafter + \pdfstringdef\expandafter#2\expandafter{#2}}}\else + \global\let\dl@afterAction\relax\fi + \aftergroup\dl@afterAction\egroup\dl@restorespcs} \def\dlTC#1{try{#1}catch(e){}} \def\js@R{\ifcase\dljs@drivernum^^J\else\jsR\fi} \def\db#1\db{\ifx\dljs@debug\dl@YES\space\space\space#1\js@R\fi} @@ -584,36 +602,47 @@ \noexpand\input{\js@Path\dljsBase.djs}}}\@dljstmp } \newtoks\JStoks -\newenvironment{defineJS}[2][] -{% - \expandafter\@ifundefined\expandafter{% - \expandafter\@gobble\string#2}{}{% - \PackageWarning{insdljs}{The command - \string#2 already defined}}% - \gdef\defineJSArg{#2}\JStoks={}% - \def\verbatim@processline - {% - \xdef\JS@temp{\the\JStoks\the\verbatim@line\defineJSjsR}% - \global\JStoks=\expandafter{\JS@temp}% - }% - \let\do\@makeother\dospecials\catcode`\^^M\active - #1% - \verbatim@start +\def\dl@param(#1){\csname p@r@m#1\endcsname} +\def\dl@paramlocal{\let\p\dl@param} +\let\eParams\relax +\def\bParams#1{\def\p@r@m{p@r@m}\c@dljs@cnt\z@ + \@ifnextchar\eParams{\expandafter + \def\csname\p@r@m1\endcsname{#1}} + {\bParams@i{#1}}} +\def\bParams@i#1\eParams{\@tfor\x:=#1\do{\advance\c@dljs@cnt\@ne + \JStoks=\expandafter{\x}\expandafter + \edef\csname\p@r@m\the\c@dljs@cnt\endcsname{\the\JStoks}}} +\def\pdfSpacesOn{\let\pdfSP\pdfSPDef} +\def\pdfSpacesOff{\let\pdfSP\dl@sp@ce} +\def\escIs#1{\def\Eschr{#1}} +\newenvironment{defineJS}[2][]{% + \expandafter\@ifundefined\expandafter{% + \expandafter\@gobble\string#2}{}{% + \PackageWarning{insdljs}{The command + \string#2 already defined}}% + \gdef\defineJSArg{#2}\JStoks={}% + \def\verbatim@processline{% + \xdef\JS@temp{\the\JStoks\the\verbatim@line\defineJSjsR}% + \global\JStoks=\expandafter{\JS@temp}}% + \let\do\@makeother\dospecials\catcode`\^^M\active + \global\let\space\pdfSP\makeatletter\obeyspaces + #1% + \verbatim@start }{\gdef\eq@JStemp{\expandafter\edef\defineJSArg{\the\JStoks}}% - \aftergroup\eq@JStemp} + \global\let\space\dl@sp@ce\aftergroup\eq@JStemp} \newenvironment{@defineJS}[2][] {% - \gdef\defineJSArg{#2}\JStoks={}% - \def\verbatim@processline - {% - \xdef\JS@temp{\the\JStoks\the\verbatim@line\defineJSjsR}% - \global\JStoks=\expandafter{\JS@temp}% - }% - \let\do\@makeother\dospecials\catcode`\^^M\active - #1% - \verbatim@start + \gdef\defineJSArg{#2}\JStoks={}% + \def\verbatim@processline{% + \xdef\JS@temp{\the\JStoks\the\verbatim@line\defineJSjsR}% + \global\JStoks=\expandafter{\JS@temp}}% + \let\do\@makeother\dospecials\catcode`\^^M\active + \global\let\space\pdfSP\makeatletter\obeyspaces + #1% + \verbatim@start }{\gdef\eq@JStemp{\expandafter\edef\defineJSArg{\the\JStoks}}% - \aftergroup\eq@JStemp} + \global\let\space\dl@sp@ce\aftergroup\eq@JStemp} +\newenvironment{defineJS*}{\@defineJS}{\end@defineJS} \newenvironment{localJS}[1][]{}{\ifvmode\else\unskip\fi} \newenvironment{willClose}[1][] {\@defineJS[#1]{\will@Close}} diff --git a/texmf-dist/tex/latex/acrotex/template.def b/texmf-dist/tex/latex/acrotex/template.def index 03d026b5..e6055064 100644 --- a/texmf-dist/tex/latex/acrotex/template.def +++ b/texmf-dist/tex/latex/acrotex/template.def @@ -18,7 +18,7 @@ %% License, or (at your option) any later version. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ProvidesFile{template.def} - [2018/12/13 v8.2.8 % + [2019/02/11 v8.2.9 % Exerquiz template for language support (dps)] %%------------- Instructions ------------------------------------ %% Make your language localizations to this file and rename it to diff --git a/texmf-dist/tex/latex/acrotex/uieforms.def b/texmf-dist/tex/latex/acrotex/uieforms.def index 7f9f1d83..28a40bba 100644 --- a/texmf-dist/tex/latex/acrotex/uieforms.def +++ b/texmf-dist/tex/latex/acrotex/uieforms.def @@ -250,10 +250,15 @@ \ifcase\nr\relax\@eqmlhyph{y}\or \@eqmlhyph{n}\fi }{} -\define@key{eforms}{presets}{% - \ef@jstoks=\expandafter{#1}% - \edef\ef@temp@expand{\noexpand\setkeys{eforms}{\the\ef@jstoks}}% - \ef@temp@expand +\define@key{eforms}{cmd}[]{\@eqcmd{#1}} +\define@key{eforms}{presets}{\ef@jstoks=\expandafter{#1}% + \edef\ef@temp@expand{\noexpand\setkeys{eforms}{\the\ef@jstoks}}% + \ef@temp@expand +} +\define@key{eforms}{epresets}{\ef@jstoks=\expandafter{#1}% + \edef\@rgs{#1}\ef@jstoks=\expandafter{\@rgs}% + \edef\ef@temp@expand{\noexpand\setkeys{eforms}{\the\ef@jstoks}}% + \ef@temp@expand } \define@choicekey{eforms}{symbolchoice}[\val\nr]% {check,circle,cross,diamond,square,star} |