summaryrefslogtreecommitdiff
path: root/texmf-dist/source/latex/acrotex
diff options
context:
space:
mode:
Diffstat (limited to 'texmf-dist/source/latex/acrotex')
-rw-r--r--texmf-dist/source/latex/acrotex/eforms.dtx1445
-rw-r--r--texmf-dist/source/latex/acrotex/exerquiz.dtx4025
-rw-r--r--texmf-dist/source/latex/acrotex/insdljs.dtx1033
-rw-r--r--texmf-dist/source/latex/acrotex/web.dtx3920
4 files changed, 5463 insertions, 4960 deletions
diff --git a/texmf-dist/source/latex/acrotex/eforms.dtx b/texmf-dist/source/latex/acrotex/eforms.dtx
index 7133e60f..bc21d96c 100644
--- a/texmf-dist/source/latex/acrotex/eforms.dtx
+++ b/texmf-dist/source/latex/acrotex/eforms.dtx
@@ -4,7 +4,7 @@
%<*copyright>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% eForms package, %%
-%% Copyright (C) 2002-2019 D. P. Story %%
+%% Copyright (C) 2002-2020 D. P. Story %%
%% dpstory@uakron.edu %%
%% %%
%% This program can redistributed and/or modified under %%
@@ -16,10 +16,11 @@
%</copyright>
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{eforms}
-%<package> [2019/10/23 v2.3.2 Provides general eforms support (dps)]
+%<package> [2020/12/14 v2.4.1 Provides general eforms support (dps)]
%<*driver>
\documentclass{ltxdoc}
\usepackage[colorlinks,hyperindex=false]{hyperref}[2012/10/12]
+\usepackage{fancyvrb}
\pdfstringdefDisableCommands{\let\\\textbackslash}
\OnlyDescription
\EnableCrossrefs
@@ -31,14 +32,20 @@
\let\env\texttt
\let\opt\texttt
\let\app\textsf
+\let\key\texttt
+\let\uif\textsf
\def\visispace{\symbol{32}}
\def\ameta#1{\ensuremath{\langle\textit{\texttt{#1}}\rangle}}
\def\meta#1{\textsl{\texttt{#1}}}
\def\SUB#1{\ensuremath{{}_{\mbox{\scriptsize\ttfamily#1}}}}
\def\ltag{<}\def\rtag{>}
\let\app\textsf\let\pkg\textsf
+\let\tops\texorpdfstring
+\makeatletter
+\let\@latex@warning\@gobble
+\makeatother
\InputIfFileExists{aebdocfmt.def}{\PackageInfo{eforms}{Inputting aebdocfmt.def}}
- {\def\IndexOpt{\DescribeMacro}\def\IndexKey{\DescribeMacro} \let\setupFullwidth\relax
+ {\def\IndexOpt{\DescribeMacro}\def\IndexKey{\DescribeMacro}\let\setupFullwidth\relax
\PackageInfo{eforms}{aebdocfmt.def cannot be found}}
\begin{document}
\GetFileInfo{eforms.sty}
@@ -70,13 +77,12 @@
%
% \section{Introduction}
%
-% This {\LaTeX} code was originally part of the \textsf{exerquiz} package.
-% I decided it would be useful to others if I separated the two and make
-% the forms part of \pkg{exerquiz} into a separate package. The
-% \pkg{eforms} package is now a part of the \textsf{{Acro\TeX} eDucation
-% Bundle} and is called by \pkg{exerquiz}, but it is now a stand alone
-% package for others who may want to use PDF form fields and JavaScript
-% interactivity.
+% \textbf{Form Response Files.}
+% The \pkg{eforms} package supports the creation of \app{Acrobat} \hyperref[formsSupport]{form fields},
+% as well as the creation of \hyperref[linkSupport]{link annotations}. Most all features of fields and links are supported, though
+% for some features, such as signatures and tabbing, the \app{Acrobat/\allowbreak Distiller} pair is needed.
+% Inserting PDF form fields into your document creates a \emph{Form Response File}, to use the latest
+% nomenclature of \app{Adobe}.
%
% \section{Package Options}
%
@@ -161,7 +167,7 @@
\def\eq@drivercode{edvipdfm.def}\def\ef@driver{xetex}%
}
% \end{macrocode}
-% \IndexOpt{textures}
+% \leavevmode\IndexOpt{textures}^^A%
% This option, and testing are due to Ross Moore 3/6/02
% \begin{macrocode}
\DeclareOption{textures}{%
@@ -243,7 +249,7 @@
}%
}
% \end{macrocode}
-% \begin{macrocode}
+% \begin{macrocode}`
\ProcessOptions
\ifx\ef@driver\@empty
\PackageError{eforms}%
@@ -258,18 +264,31 @@
\edef\ef@CatChngs{\the\catcode`\$}
\@makeother\$\relax
\newlength\eflength
+% \end{macrocode}
+% To support a variations of \app{dvipdfm}, we change the logic from
+% \cs{ifxetex} to |\ifnum\eq@drivernum=2\relax|, a driver number of 2
+% includes \app{dvipdfm} and all its variants.
+% \changes{v2.3.4}{2020/07/05}{Change logic from \string\cs{ifxetex} to
+% \string\cs{ifnum}\string\cs{eq@drivernum=2\string\relax}}
+% \begin{macrocode}
\@ifundefined{ifpdfmarkup}{\newif\ifpdfmarkup}{}\pdfmarkupfalse
-\ifpdf\else\ifxetex\else\pdfmarkuptrue\fi\fi
+\ifpdf\else\ifnum\eq@drivernum=2\relax\else\pdfmarkuptrue\fi\fi
\RequirePackage{hyperref}
% \end{macrocode}
% Changed \textsf{hyperref} definitions/parameters to add \texttt{1bp} rather than \texttt{1pt} around a form field
% or link.
% \changes{v2.9e}{2016/12/22}{Changed hyperref to add 1bp rather than 1pt}
+% \changes{v2.3.4}{2020/07/05}{Change logic from \string\cs{ifxetex} to
+% \string\cs{ifnum}\string\cs{eq@drivernum=2\string\relax}}
% \begin{macrocode}
-\ifxetex\else\ifpdf\pdflinkmargin1bp\relax\else
+\ifnum\eq@drivernum=2\relax
+\else
+ \ifpdf\pdflinkmargin1bp\relax
+ \else
\g@addto@macro\Hy@FirstPageHook{%
\headerps@out{/HyperBorder {1.00375 PDFToDvips} def}}
-\fi\fi
+ \fi
+\fi
% \end{macrocode}
% Changed the requirement for \textsf{insdljs}
% \changes{v2.9a}{2016/06/09}{Change in \string\textsf{insdljs} package}
@@ -279,17 +298,17 @@
% \end{macrocode}
% \changes{v1.0a}{2006/10/03}
% {
-% If \string\textsf{exerquiz} is not loaded, we do an automatic begin and end of Form.
+% If \string\pkg{exerquiz} is not loaded, we do an automatic begin and end of Form.
% Also, if \string\textsf{exerquiz} is loaded, then we use the driver declared in
-% \string\textsf{exerquiz}; otherwise, we set the default to 0
+% \string\pkg{exerquiz}; otherwise, we set the default to 0
% (\string\texttt{dvipsone}/\string\texttt{dvips}).
% }
-% If exerquiz is not loaded, we insert |\begin{Form}| and |\end{Form}|,
+% If \pkg{exerquiz} is not loaded, we insert |\begin{Form}| and |\end{Form}|,
% and if undefined, we set the default driver.
% \begin{macrocode}
\@ifpackageloaded{exerquiz}{}{%
- \AtBeginDocument{\Form}
- \AtEndDocument{\csname endForm\endcsname}
+ \AtBeginDocument{\Form}%
+ \AtEndDocument{\@nameuse{endForm}}
}
\@ifpackageloaded{aeb_pro}{}{%
\newcommand{\taggedPDF}{%
@@ -312,12 +331,19 @@
% \end{macrocode}
% When the \texttt{preview} option is used, draw a frame box
% around the \textit{inner} bounding rectangle.
+%
+% \paragraph*{Utility commands, boxes, dimension and token registers}
% \begin{macrocode}
%<*package>
\def\csarg#1#2{\expandafter#1\csname#2\endcsname}
\@ifundefined{eq@tmpbox}{\newsavebox{\eq@tmpbox}}{}
\@ifundefined{eq@tmpdima}{\newdimen\eq@tmpdima}{}
\@ifundefined{eq@tmpdimb}{\newdimen\eq@tmpdimb}{}
+% \end{macrocode}
+% Define new dimension of \cs{b@} which is assigned a value of 1bp.
+% \changes{v2.3.6}{2020/10/10}{Defined new dimension \string\cs{b@} (1bp)}
+% \begin{macrocode}
+\newdimen\b@ \b@=1bp
\newlength\ef@dimena
\newtoks\ef@scratchtoks
% \end{macrocode}
@@ -391,31 +417,7 @@
% The public version of \cs{ef@Bbox} is simply \DescribeMacro\Bbox\cs{Bbox}.
% \begin{macrocode}
\let\Bbox\ef@Bbox
-%</package>
% \end{macrocode}
-% \section{eForms Support}
-% \begin{macrocode}
-%<*package>
-% \end{macrocode}
-% Listed below are the various types of form objects available in PDF.
-%\begin{itemize}
-% \item \hyperref[button]{Button}
-% \begin{itemize}
-% \item \hyperref[pushbutton]{Push buttons}
-% \item \hyperref[checkbox]{Check boxes}
-% \item \hyperref[radiobutton]{Radio Buttons}
-% \end{itemize}
-% \item \hyperref[textfield]{Text Fields}
-% \item \hyperref[choice]{Choice Fields}
-% \begin{itemize}
-% \item \hyperref[listbox]{list box}
-% \item \hyperref[combobox]{combo box}
-% \end{itemize}
-%\item \hyperref[sigfield]{Signature Fields}
-%\end{itemize}
-% \normalcolor
-%
-% \subsection{Some utility commands}
% The following two commands were created as a convenience to changing the definition of certain
% JavaScript actions. Use \cs{efsave} to save the original definition of the action, then redefine the action,
% the later, restore the JS action to its original definition.\par\medskip\noindent
@@ -438,6 +440,37 @@
% has the same definition as |\x| does. Now |\x| is free to be redefined. Later in the document,
% we can say |\efrestore\x\from\y| (eg, |\let\x\y|). Now the
% definition of |\x| has its original definition (at the time when it was saved).
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+% \section{\tops{\app}{}{Adobe} Forms Support}\label{formsSupport}
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% Listed below are the various types of form objects available in PDF.
+%\par\medskip\noindent
+%\begin{minipage}{.67\linewidth}\raggedcolumns
+%\begin{multicols}{2}
+%\begin{itemize}
+% \item \hyperref[button]{Button}
+% \begin{itemize}
+% \item \hyperref[pushbutton]{Push buttons}
+% \item \hyperref[checkbox]{Check boxes}
+% \item \hyperref[radiobutton]{Radio Buttons}
+% \end{itemize}
+% \item \hyperref[textfield]{Text Fields}
+% \item \hyperref[choice]{Choice Fields}
+% \begin{itemize}
+% \item \hyperref[listbox]{list box}
+% \item \hyperref[combobox]{combo box}
+% \end{itemize}
+%\item \hyperref[sigfield]{Signature Fields}
+%\end{itemize}
+%\end{multicols}
+%\end{minipage}
+%
+%\bigskip
+%
%
% \subsection{Process Key-Value Pairs: Main Macro}\label{procArgs}
%
@@ -455,10 +488,10 @@
% \cs{@eq\ameta{name}\darg{\ameta{arg}}}. Each of the macros \cs{@eq\ameta{name}} must be
% defined. Such a macro defines another macro as follows
% \cs{def\string\eq@\ameta{name}\darg{\ameta{arg}}}. For example if the user enters the token
-% pair |\RC{Users}|, \cmd{\processAppArgs} will construct
-% |\@eqRC|, with argument |{Users}|, this macro will be
-% executed, which expands to |\def\eq@RC{Users}|. The macro
-% \cmd{\eq@RC} may then be used within the construction of the
+% pair |\TU{|\ameta{text}|}|, \cmd{\processAppArgs} will construct
+% |\@eqTU|, with argument |{|\ameta{text}|}|, this macro will be
+% executed, which expands to |\def\eq@TU{/TU(|\ameta{text}|)}| (a simplified definition). The macro
+% \cmd{\eq@TU} is then be used within the construction of the
% widget object.\medskip
%
% \noindent
@@ -478,11 +511,7 @@
% 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
-% \@getCmdName{#1}\PackageWarning{eforms}
-% {Redefining the \eqbs\@CmdName\space key is not allowed}%
- \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
@@ -563,7 +592,7 @@
% the argument of \cs{presets} is a macro of the form \cs{csname}/\cs{endcsname}.
% An ordinary \cs{presets} does not work, we must use \cs{epresets}:
%\begin{verbatim}
-% \expandafter\def\csname fld1\endcsname#1{\protect\BG{#1}}
+% \csarg\def{fld1}#1{\protect\BG{#1}}
% \textField[\epresets{\nameuse{fld1}{yellow}}]{mytxt}{2in}{13bp}
%\end{verbatim}
%In the above example we use \cs{nameuse} rather than \cs{@nameuse}, since in a recent
@@ -572,7 +601,7 @@
%\begin{verbatim}
% \protectedKeys{pKeys}{\BG{red}\BC{blue}}
%% \nameuse is expanded within the argument below, where it is defined
-% \expandafter\def\csname fld2\endcsname{\nameuse{pKeys}}
+% \csarg\def{fld2}{\nameuse{pKeys}}
% \pushButton[\CA{Push Me}\epresets{\nameuse{fld2}}]{pb1}{}{13bp}
%\end{verbatim}
%where \cs{protectedKeys} is used to protected each of the keys in its argument.
@@ -582,7 +611,7 @@
\ifx\arg@epresets\@CmdName
\def\ef@next{\let\protect\noexpand
\edef\x{#2}\set@typeset@protect\expandafter
- \processAppArgs\x}% dps27
+ \processAppArgs\x}%
\else
% \end{macrocode}
% This is the last, and the most frequent case. We process an ordinary key, one
@@ -604,16 +633,13 @@
% Process the field defaults and the `every' changes. Build up the required command
% in a token list, then execute.
% \begin{macrocode}
-\def\@processEvery{\edef\eqtemp{}\toks0={}\@@processEvery}
-\def\@@processEvery#1{%
- \ifx#1\end\def\ef@next{\the\toks0 }%
- \else
- \edef\eqtemp{\the\toks0 }%
- \toks0=\expandafter{\eqtemp
- \expandafter\processAppArgs#1\end\@nil}%
- \def\ef@next{\@@processEvery}%
- \fi
- \ef@next
+\def\@processEvery{\edef\eqtemp{}\toks@={}\@@processEvery}
+\def\@@processEvery#1{\ifx#1\end
+ \def\ef@next{\the\toks@}\else
+ \edef\eqtemp{\the\toks@}%
+ \toks@=\expandafter{\eqtemp\expandafter
+ \processAppArgs#1\end\@nil}%
+ \def\ef@next{\@@processEvery}\fi\ef@next
}
% \end{macrocode}
% \begin{macrocode}
@@ -625,36 +651,79 @@
% inline form fields.}
% \begin{macrocode}
\def\centerWidget#1{%
- \ifeq@inlineCenter
+ \ifeq@inlineCenter
% \end{macrocode}
% Inline form field, do a better job at centering it.
% \begin{macrocode}
- \eqcenterWidget=#1\relax
- \eqcenterWidget=.5\eqcenterWidget
- \ifnum\eq@textSize=0\relax
- \dimen@=-\eq@textSizeDefault bp\else
- \dimen@=-\eq@textSize bp\fi
- \dimen@=0.9167\dimen@ % 11/12
- \dimen@=.5\dimen@
- \advance\dimen@\eq@W@value bp
- \ifx\eq@S\@empty\else
- \def\eq@S@cmp{B}%
- \ifx\eq@S@value\eq@S@cmp
- \advance\dimen@ by \eq@W@value bp
- \else
- \def\eq@S@cmp{I}%
- \ifx\eq@S@value\eq@S@cmp
- \advance\dimen@ by \eq@W@value bp
- \else\advance\dimen@ by 1bp
- \fi\fi\fi
- \advance\eqcenterWidget by \dimen@
+ \eqcenterWidget=#1\relax
+ \eqcenterWidget=.5\eqcenterWidget
+ \ifnum\eq@textSize=0\relax
+ \dimen@=-\eq@textSizeDefault\b@\else
+ \dimen@=-\eq@textSize\b@\fi
+ \dimen@=0.9167\dimen@ % 11/12
+ \dimen@=.5\dimen@
+ \advance\dimen@\eq@W@value\b@
+ \ifx\eq@S\@empty\else
+ \def\eq@S@cmp{B}%
+ \ifx\eq@S@value\eq@S@cmp
+ \advance\dimen@ by \eq@W@value\b@
+ \else
+ \def\eq@S@cmp{I}%
+ \ifx\eq@S@value\eq@S@cmp
+ \advance\dimen@ by \eq@W@value\b@
+ \else\advance\dimen@\b@
+ \fi\fi\fi
+ \advance\eqcenterWidget\dimen@
+ \else
+ \eqcenterWidget=#1\relax
+ \eqcenterWidget=.5\eqcenterWidget
+ \advance\eqcenterWidget-4\b@
+ \fi
+}
+% \end{macrocode}
+% \begin{macro}{\ef@optscale}
+% This macro supports the \texttt{width}, \texttt{height}, and \texttt{scale} option keys for forms.
+% We obey these three keys in the order listed above.
+% \changes{v2.3.5}{2020/09/15}{Added \string\cs{ef@optscale}}
+% \begin{macrocode}
+\def\ef@optscale{%
+ \ifx\eq@width\@empty
+ \ifx\eq@height\@empty
+ \ifx\eq@scalefactor\@empty
+ \else
+% \end{macrocode}
+% Re-scale using scale factor of \cs{eq@scale}.
+% \begin{macrocode}
+ \@tempdima\eq@scalefactor\p@
+ \ifdim\@tempdima<\z@\edef\eq@scalefactor{-\eq@scalefactor}\fi
+ \setlength{\eflength}{\eq@rectH*\real{\eq@scalefactor}}%
+ \edef\eq@rectH{\the\eflength}%
+ \setlength{\eflength}{\eq@rectW*\real{\eq@scalefactor}}%
+ \xdef\eq@rectW{\the\eflength}%
+ \fi
\else
- \eqcenterWidget=#1\relax
- \eqcenterWidget=.5\eqcenterWidget
- \advance\eqcenterWidget by -4bp
+% \end{macrocode}
+% Re-scale according to height.
+% \begin{macrocode}
+ \setlength{\eflength}{\eq@rectH}%
+ \ifdim\eflength>\z@
+ \setlength{\eflength}{\eq@height*\ratio{\eq@rectW}{\eq@rectH}}%
+ \edef\eq@rectW{\the\eflength}\edef\eq@rectH{\eq@height}%
+ \fi
\fi
+ \else
+% \end{macrocode}
+% Re-scale according to width.
+% \begin{macrocode}
+ \setlength{\eflength}{\eq@rectW}%
+ \ifdim\eflength>\z@
+ \setlength{\eflength}{\eq@width*\ratio{\eq@rectH}{\eq@rectW}}%
+ \edef\eq@rectH{\the\eflength}\edef\eq@rectW{\eq@width}%
+ \fi
+ \fi
}
% \end{macrocode}
+% \end{macro}
%
% \subsection{\textsf{eforms} key-values}\label{eformvariables}
%
@@ -694,17 +763,23 @@
\ifx\eq@W\@empty\let\link@BS\@empty\fi
}\def\link@BS{}
% \end{macrocode}
-% \changes{v1.0e}{2008/03/04}
-% {
-% Added a \string\cs{presets} key to make it easier to dynamically change options%
-% }
+% \noindent\DescribeMacro{\presets}\hskip-\marginparsep\texttt{\darg{\meta{\cs{cmd}}}}
+% We define the \cs{presets} key. The argument of \key{presets} is a macro (\meta{\cs{cmd}}) consisting of key-value pairs.
+% The macro \meta{\cs{cmd}} expanded by \cs{expandafter}
+% and put back into the parsing stream.\par\medskip
+% \changes{v1.0e}{2008/03/04}{%
+% Added a \string\cs{presets} key to make it easier to dynamically change options}
%
-% \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}
+% \noindent \DescribeMacro{\epresets}\hskip-\marginparsep\texttt{\darg{\meta{\cs{cmd}}}} The \cs{epresets} key is used
+% when the properties are to be expanded early. The command argument \meta{\cs{cmd}} is fully expanded within
+% an \cs{edef}; as a result, the keys need to be protected, for example, |\epresets{\protect\BC{red}}|.
+% The command \cs{protectedKeys} can be used to protect the keys to all the key-value pairs.
+% \changes{v2.9.23}{2019/01/22}{Added \string\cs{epresets} key}\par\medskip
+%
+% \noindent Both \cs{presets} and \cs{epresets} are handled within the \cs{proccessAppArgs} macro;
+% the definitions below actually do nothing and are never expanded.
% \begin{macrocode}
-\def\@eqpresets#1{#1}%
+\def\@eqpresets#1{#1}
\def\@eqepresets#1{#1}
% \end{macrocode}
% \DescribeMacro{\W} The width of the boundary line.
@@ -716,9 +791,9 @@
% (2016/12/22) Add a global value for boundary width, used to adjust the spacing between form fields
% \changes{v2.9d}{2016/12/22}{Add a global value for boundary width}
% \begin{macrocode}
- \xdef\g@eq@W@value@bp{\eq@W@value bp}}
+ \xdef\g@eq@W@value@bp{\eq@W@value\b@}}
\def\eq@W{}\def\eq@W@value{0}
-\def\g@eq@W@valu@bp{0bp} % dps 12/22
+\def\g@eq@W@valu@bp{0bp}
% \end{macrocode}
% \DescribeMacro{\S} Line style, values are \texttt{S} (solid), \texttt{D} (dashed),
% \texttt{B} (beveled), \texttt{I} (inset), \texttt{U} (underlined)
@@ -897,24 +972,81 @@
\def\@eqmlLink#1{\def\eq@arg{#1}\ifx\eq@arg\ef@true
\let\ef@mlLink\ef@One\else\let\ef@mlLink\ef@Zero\fi}
% \end{macrocode}
-% \DescribeMacro{\Lock} The Lock key is used with signature fields, currently, there is
-% no nice user interface to this key. Typical entries are
-%\begin{verbatim}
-% \Lock{/Action/All} % all fields in the doc
-% \Lock{/Action/Include % include all fields listed in Fields
-% /Fields [(field1)(field2)...]}
-% \Lock{/Action/Exclude % exclude all fields listed in Fields
-% /Fields [(field1)(field2)...]}
-%\end{verbatim}
+% \DescribeMacro{\Lock} The \cs{Lock} key is used with signature fields.
+% We allow the document author to either use raw PDF markup, or the simplified
+% \pkg{eforms} key-value or UF key-values. To do this, we determine if
+% \texttt{/Action} appears somewhere in the argument, if yes, then it is raw;
+% otherwise, it is key-value markup.
+% \begin{macrocode}
+\def\ef@searchAction#1/Action#2\@nil{\def
+ \ef@argii{#2}\ifx\ef@argii\ef@end\let\ef@Action\ef@One\else
+ \let\ef@Action\ef@Zero\fi}
+% \end{macrocode}
+% The definition of \cs{@eqLock}, we determine if raw or KV-Pairs.
% \begin{macrocode}
\def\@eqLock#1{\def\eq@arg{#1}\ifx\eq@arg\@empty
- \let\eq@Lock\@empty\else\def\eq@Lock{/Lock <<#1>>}\fi}
-\def\eq@Lock{}
+ \let\eq@Lock\@empty\else\def\lckArgs{#1}%
+ \ef@searchAction#1/Action\end\@nil
+ \ifx\ef@Action\ef@One\def\ef@next{\let\Action\lckAction#1}\else
+ \let\ef@next\relax\fi\ef@next
+ \def\eq@Lock{/Lock <<\lckArgs>>}\fi}
+\let\eq@Lock\@empty
+% \end{macrocode}
+%Various examples using \emph{raw PDF markup} follow:
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars={!~@},codes={\catcode`\%=9}]
+%\Lock{/Action/All} !% !textsf~all fields in the doc@
+%\Lock{/Action/Include !% !textsf~include all fields listed in Fields@
+% /Fields [(field1)(field2)...]}
+%\Lock{/Action/Exclude !% !textsf~exclude all fields listed in Fields@
+% /Fields [(field1)(field2)...]}
+%\end{Verbatim}
+% A simplified syntax for the arguments of \cs{Lock}; sample
+% syntax for the same three examples above are,
+%\changes{v2.3.6}{2020/10/10}{Addition support for the \string\cs{Lock} key}
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars={!~@},codes={\catcode`\%=9}]
+%\Lock{\Action\All}
+%\Lock{\Action\IncludeFields{field1,field2,...}}
+%\Lock{\Action\ExcludeFields{field1,field2,...}}
+%\end{Verbatim}
+%The code for the simplified markup for the \cs{Lock} key.
+% \begin{macrocode}
+\def\lckAll{\All}
+\def\lckIncludeFields{\IncludeFields}
+\def\lckExcludeFields{\ExcludeFields}
+\def\lckActionTst#1{\let\X\ef@Yes#1}%
+\def\lckAction#1{\def\@rgi{#1}\ifx\@rgi\lckAll
+ \def\lckArgs{/Action/All}\let\ef@next\relax\else
+ \ifx\@rgi\lckIncludeFields
+ \def\ef@next{\lckGetFieldsFor{Include}}\else
+ \ifx\@rgi\lckExcludeFields
+ \def\ef@next{\lckGetFieldsFor{Exclude}}\else
+ \PackageWarning{eforms}%
+ {The argument of the \string\Lock key\MessageBreak
+ is not correctly expressed. Review the documentation}%
+ \fi
+ \fi
+\fi\ef@next
+}
+\def\lckGetFieldsFor#1#2{\@temptokena={}\@for\@fld:={#2}\do
+ {\edef\@etmp{\the\@temptokena(\@fld)}%
+ \@temptokena=\expandafter{\@etmp}%
+ }\edef\lckArgs{/Action/#1/Fields[\the\@temptokena]}%
+}
% \end{macrocode}
+% Another option that is included in the Signed tab is titled ``This script executes
+% when field is signed.''
+% This is an option that, through the user interface, is mutually exclusive from
+% locking fields. This option appears to be implemented through the format event.
+% For example,
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%codes={\catcode`\%=9}]
+%\AAformat={app.alert("Thank you for signing this field.");}
+%\end{Verbatim}
%\paragraph*{Additional Actions.}
-% We search for \cs{AACalculate}.
-% The \cs{ef@searchCalc} searches for \cs{AACalculate}. If, for some reason,
-% \cs{AA\-Cal\-cu\-late} is within a pair of braces, this search will not find it,
+% \cs{ef@searchCalc} searches for the \cs{AACalculate} token. If, for some reason,
+% \cs{AACalculate} is within a pair of braces, this search will not find it,
% so don't group \cs{AACalculate} within braces, there is no reason to do so
% anyway. If we find \cs{AACalculate}, we set \cs{isCalculate} to \texttt{true}, which is normally
% \texttt{false}.
@@ -1058,16 +1190,26 @@
\def\@eqDA#1{\def\eq@DA{#1}}
\def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}%
% \end{macrocode}
-% \DescribeMacro{\textFont} PDF form font
+% \DescribeMacro{\textFont} PDF form font. This is a simple assignment; we define
+% \DescribeMacro{\textFontDefault}\cs{textFontDefault} to conveniently change the default font over
+% all form fields, with the exception of checkboxes and radio button fields. The default
+% is \uif{Helv}.
+% \changes{v2.4.1}{2020/12/14}{Defined \string\cs{eqtextFontDefault}}
% \begin{macrocode}
\def\@eqtextFont#1{\def\eq@textFont{/#1}}
-\def\eq@textFont{/Helv}
+\def\textFontDefault#1{\def\eq@textFontDefault{#1}
+ \def\eq@textFont{/#1}}
+\textFontDefault{Helv}
% \end{macrocode}
-% \DescribeMacro{\textSize} PDF form text size
+% \DescribeMacro{\textSize} PDF form text size. This is a simple assignment; we define
+% \DescribeMacro{\textSizeDefault}\cs{textSizeDefault} to conveniently change the default font size for all
+% form fields, including checkboxes and radio buttons. The default is 9 (points).
+% \changes{v2.4.1}{2020/12/14}{Defined \string\cs{eqtextSizeDefault}}
% \begin{macrocode}
\def\@eqtextSize#1{\def\eq@textSize{#1}}
-\def\eq@textSizeDefault{9}
-\edef\eq@textSize{\eq@textSizeDefault}
+\def\textSizeDefault#1{\def\eq@textSizeDefault{#1}
+ \def\eq@textSize{#1}}
+\textSizeDefault{9}
% \end{macrocode}
% \DescribeMacro{\RV} Rich text value
%\changes{v2.5l}{2011/01/28}{%
@@ -1135,8 +1277,6 @@
% of the combo box (only), the code below \cs{let}s \cs{eq@DV} to \cs{@empty} in enhanced
% preview mode, for combo boxes only.
% \begin{macrocode}
-% \ifx\annot@type\annot@type@combobox
-% \ifefpmpv\let\eq@DV\@empty\fi\fi
\makespecialJS\fi\fi}\def\eq@DV{}
% \end{macrocode}
% \DescribeMacro{\nuDV} \cs{@eqnuDV} is the old definition of DV. This version does not
@@ -1248,7 +1388,9 @@
\let\eq@Ff\@empty\else\def\eq@Ff{/Ff #1}\fi}
\def\eq@Ff{}
% \end{macrocode}
-% \paragraph*{keys specific to text fields:} \texttt{MaxLen}
+% \goodbreak
+% \paragraph*{Keys specific to text fields:} The following keys are specific to
+% text fields.
% \begin{macrocode}
% \end{macrocode}
% \DescribeMacro{\MaxLen} text fields only. Restricts number of characters
@@ -1259,15 +1401,16 @@
\def\eq@MaxLen{}
% \end{macrocode}
% \DescribeMacro{\H} Highlight, used in button fields and link annotation. Possible values
-% are None, Push, Outline, Invert (respectively, \verb!\H{N}!, \verb!\H{P}!,
-% \verb!\H{O}!, \verb!\H{I}!)
-% The default highlighting is invert (I).
+% are None, Push, Outline, Invert (respectively, |\H{N}|, |\H{P}|,
+% |\H{O}|, |\H{I}|)
+% The default highlighting is invert (\texttt{I}).
% \begin{macrocode}
\def\@eqH#1{\def\eq@arg{#1}\ifx\eq@arg\@empty
\let\eq@H\@empty\else\def\eq@H{/H/#1}\fi}\def\eq@H{}
% \end{macrocode}
% \paragraph*{Appearance characteristics dictionary:}
-% \texttt{MK=R, BC, BG, CA, RC, AC, I, RI, IX, IF, TP}
+% \texttt{MK\,=\,R,\,BC,\,BG,\,CA,\,RC,\,AC,\,I,\,RI,\allowbreak\,IX,\,IF,^^A
+% \,TP}
% \begin{macrocode}
% \end{macrocode}
% \DescribeMacro{\MK} A dictionary containing other keys
@@ -1596,7 +1739,8 @@
% \end{macrocode}
% \begin{macro}{\rectH}
% \begin{macro}{\rectW}
-% Use to set the height and width of a widget.
+% Used to set the height and width of a widget, useful when the width and height arguments
+% of the widget is not accessible.
% \begin{macrocode}
\def\@eqrectH#1{\def\eq@rectH{#1}\ifx\eq@rectH\@empty\else
\setlength\eflength\eq@rectH\edef\eq@rectH{\the\eflength}\fi}
@@ -1605,6 +1749,29 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \begin{macro}{\width}
+% Re-scale the widget to have a specified width, keeping the height in proportion
+% \changes{v2.3.5}{2020/09/15}{Added \string\pkg{eforms} keys \string\texttt{width}, \string\texttt{height},
+% and \string\texttt{scale}}
+% \begin{macrocode}
+\def\@eqwidth#1{\def\eq@width{#1}}
+\let\eq@width\@empty
+% \end{macrocode}
+% \begin{macro}{\height}
+% Re-scale the widget to have a specified height, keeping the height in proportion
+% \begin{macrocode}
+\def\@eqheight#1{\def\eq@height{#1}}
+\let\eq@height\@empty
+% \end{macrocode}
+% \begin{macro}{\scale}
+% Re-scale the widget by a scale factor.
+% \begin{macrocode}
+\def\@eqscalefactor#1{\def\eq@scalefactor{#1}}
+\let\eq@scalefactor\@empty
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
% \DescribeMacro{\objdef} Insert an indirect reference (ps only drivers). The value of this
% key must be unique throughout the whole document.
% This is a \textbf{pdfmark} feature that inserts a references to this COS object,
@@ -1766,33 +1933,37 @@
\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
+% \DescribeMacro{\protectedKeys}\hskip-\marginparsep\texttt{*\darg{\ameta{cmd-name}}\darg{\ameta{KV-pairs}}}
+% is a command that protects each key in a \pkg{eforms} key-value list; eg, it replaces
+% \cs{BC\darg{red}} with \cs{protect\cs{BC\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.
+% the parsing mechanism. \cs{protectedKeys} is used in the \pkg{bargraph-js} package. If \cs{\ameta{cmd-name}}
+% is already defined, a warning message is written to the TEX LOG, unless the \texttt*-option is taken.
% \changes{v2.10}{2019/03/16}{Added \string\cs{protectedKeys}}
% \begin{macrocode}
-% \end{macrocode}
-% \DescribeMacro{\multigroupradios} Declares whether there are multiple sets of radio button groups
-% with the same names and values,
-% \begin{macrocode}
-\def\@eqmultigroupradios#1{\let\ef@multigroupradios\ef@YES}
-\let\ef@multigroupradios\ef@NO
-% \end{macrocode}
-% \begin{macrocode}
-\def\ef@stop{\relax} %\def\ef@relax{\relax}
-\def\protectedKeys#1#2{\ef@scratchtoks={}%
- \@ifundefined{#1}{}{\PackageWarning{eforms}
+\def\ef@stop{\relax}
+\let\isst@r\ef@NO
+\def\protectedKeys{\@ifstar
+ {\let\isst@r\ef@YES\protectedKeys@i}
+ {\let\isst@r\ef@NO\protectedKeys@i}%
+}
+\def\protectedKeys@i#1#2{\ef@scratchtoks={}%
+ \@ifundefined{#1}{}{\ifx\isst@r\ef@NO\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}}
+ in use}\fi}\protectedKeys@gettwo#2\ef@stop\relax
+ \csarg\edef{#1}{\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}
+% \DescribeMacro{\multigroupradios} Declares whether there are multiple sets of
+% radio button groups with the same names and values,
+% \begin{macrocode}
+\def\@eqmultigroupradios#1{\let\ef@multigroupradios\ef@YES}
+\let\ef@multigroupradios\ef@NO
+% \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}
@@ -2258,13 +2429,14 @@
%
% \begin{macro}{\JS}
% \begin{macro}{\Named}
-% \begin{macro}{\URI}
% \begin{macro}{\Next}
% \begin{macro}{\toggleAttachmentsPanel}
% Convenience commands for writing JavaScript and for executing named events.
+% \changes{v2.3.5}{2020/11/20}{Remove \string\cs{URI} from \string\pkg{eforms}, already
+% defined in \string\pkg{insdljs}. (Jason G.)}
% \begin{macrocode}
\providecommand{\JS}[1]{/S/JavaScript/JS(#1)}
-\newcommand{\URI}[1]{/S/URI/URI(#1)}
+%\newcommand{\URI}[1]{/S/URI/URI(#1)}
\providecommand{\Named}[1]{/S/Named/N/#1}
\newcommand{\Next}[1]{/Next<<#1>>}
\providecommand{\toggleAttachmentsPanel}[2]{%
@@ -2275,7 +2447,6 @@
% \end{macro}
% \end{macro}
% \end{macro}
-% \end{macro}
% When entering triggers into the AA dictionary, use these commands (all the ones of
% the form \cs{AA<Name>}. These all have one argument, the action to take, usually
% a JavaScript action. There is now a routine in the parsing of the AA dictionary
@@ -2382,7 +2553,7 @@
%Hidden (and does not print) &|\F\FHidden|
%\end{tabular}
%
-%\subsubsection{Field Flags /Ff Definitions}\label{Ff}
+%\subsubsection{Field Flags \texttt{/Ff} Definitions}\label{Ff}
% \begin{macrocode}
\def\FfReadOnly{1} % all
\def\FfRequired{2} % all
@@ -2485,8 +2656,8 @@
\edef\eq@rectH{\the\eflength}%
\fi
}
-\def\ef@djXPD{\ifxetex\ifmakeXasPD\ef@adjrectWH{2bp}\fi
- \else\ifmakePDasX\ef@adjrectWH{-2bp}\fi\fi}
+\def\ef@djXPD{\ifxetex\ifmakeXasPD\ef@adjrectWH{2\b@}\fi
+ \else\ifmakePDasX\ef@adjrectWH{-2\b@}\fi\fi}
% \end{macrocode}
% \begin{macro}{\eq@setButtonProps}
% This macro measure the width of the largest text on defined for the
@@ -2496,10 +2667,14 @@
% #1 is the driver specific macro to build the button widget
% #2 are the button properties
%\end{verbatim}
+%\DescribeMacro\btnSpcr\hskip-\marginparsep\texttt{\darg{\ameta{content}}} Adds space on either
+%side of a pushbutton caption; the amount of the spacing is the width of \ameta{content} in the current
+%current font, the fontsize is the one determined by the \cs{textSize} key.
%\changes{v2.5m}{2012/01/27}{Added \string\cs{ef@btnspcr} to give user
% ability to adjust the spacing around text for a button.}
+% \changes{v2.3.5}{2020/09/15}{Added \string\cs{tbnSpcr} to populate \string\cs{eq@btnspcr}}
% \begin{macrocode}
-%\def\ef@btnspcr{\ }
+\def\btnSpcr#1{\def\ef@btnspcr{#1}}
\def\ef@btnspcr{}
% \end{macrocode}
% \subsubsection{Enhanced preview}\label{pmpv}
@@ -2562,10 +2737,35 @@
% \changes{v2.11}{2019/05/24}{Enhanced preview introduced}
%
% \subsubsection{Set push button properties}
-% \begin{macrocode}
+% \leavevmode\DescribeMacro\ef@adjcapfont^^A
+% When \cs{pmpvOn} is expanded, the caption text is previewed, we try to adjust
+% the typeset caption font size to match the font size used by the push button.
+% \changes{v2.3.5}{2020/09/15}{Added \string\cs{ef@adjcapfont}}
+% \begin{macrocode}
+\def\ef@adjcapfont{%
+ \dimen@=\eq@textSize\b@
+ \dimen@1.00375\dimen@
+ \edef\eq@textSize@pt{\strip@pt\dimen@}%
+ \fontsize{\eq@textSize@pt}{0}\selectfont
+}
\def\eq@setButtonProps#1#2{\makeJSspecials
\processAppArgs#2\end\@nil % set widget properties
% \end{macrocode}
+% If \cs{eq@rectW} is not a positive dimension, mark it as empty.
+% \changes{v2.3.5}{2020/09/15}{If \string\cs{rectW} is not a positive dimension,
+% make it empty for push buttons.}
+% \begin{macrocode}
+ \ifx\eq@rectW\@empty\else
+ \ifdim\eq@rectW>0pt \else\let\eq@rectW\@empty\fi\fi
+% \end{macrocode}
+% Re-scale dimensions as requested. If \cs{eq@rectW} is empty, then the width is calculated
+% from the \cs{CA} key; re-scaling is ignored in this case.
+% \changes{v2.3.5}{2020/09/15}{Added \string\cs{ef@optscale}}
+% \changes{v2.3.5}{2020/09/15}{If \string\cs{rectW} is not a positive dimension,
+% make it empty for push buttons.}
+% \begin{macrocode}
+ \ifx\eq@rectW\@empty\else\expandafter\ef@optscale\fi
+% \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}
@@ -2576,22 +2776,19 @@
\ifx\eq@rectW\@empty
\ifnum\eq@textSize=0 \else
% \end{macrocode}
-% If \cs{rectW} is nonempty, and \cs{textSize} is not zero, we calculate with
+% If \cs{rectW} is empty and \cs{textSize} is not zero, we calculate with
% 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
+ \ef@adjcapfont
\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
+ \dimen@\eq@W@value\b@
\def\eq@S@B{B}\ifx\eq@S@value\eq@S@B
\def\eq@btn@sp{\hbox to2\dimen@{\hfill}}%
\else
@@ -2612,7 +2809,7 @@
% (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
+ \ifmakePDasX\advance\eq@tmpdima2\b@\fi
\wd\eq@tmpbox=\eq@tmpdima
\else % if \eq@rectW is not \@empty
\wd\eq@tmpbox=\eq@rectW
@@ -2629,7 +2826,10 @@
% \begin{macrocode}
\ifx\ef@isBGtransparent\ef@YES
\let\ef@kvCA\@empty\fi
- \ifx\ef@CApv\ef@YES\PMPV{\eq@CA}\fi\fi
+% \end{macrocode}
+% Adjust the font size for the preview text.
+% \begin{macrocode}
+ \ifx\ef@CApv\ef@YES\ef@adjcapfont\PMPV{\eq@CA}\fi\fi
\ef@djXPD#1%
}
% \end{macrocode}
@@ -2652,6 +2852,11 @@
% \changes{v2.9f}{2017/01/01}{BC=empty iff W=0 or empty}
% \begin{macrocode}
\ifx\annot@type@link\annot@type\else
+% \end{macrocode}
+% Re-scale dimensions as requested
+% \changes{v2.3.5}{2020/09/15}{Added \string\cs{ef@optscale}}
+% \begin{macrocode}
+ \ef@optscale
\ifx\eq@BC\@empty\@eqW{}\else
\if\eq@W@value0\let\eq@BC\@empty\fi\fi
\fi
@@ -2701,13 +2906,14 @@
% \begin{macro}{\efKern}
% A convenience macro to adjust spacing between fields.
%\begin{itemize}
-% \item \texttt{\#1} is the spacing for ps/pdftex drivers
-% \item \texttt{\#2} is the spacing for xetex
+% \item \texttt{\#1} is the spacing for non-\app{xelatex} apps
+% \item \texttt{\#2} is the spacing for \app{xelatex}
%\end{itemize}
-%Unlike ps/pdftex, xetex includes the border width as part of the bounding rectangle
-%dimensions. As a result, this wider boundary is known to {\TeX} as it lays out the line. For
-% ps/pdftex, the boundary width is invisible to {\TeX}. The command \cs{ef@adjHWxetex} tries to
-% adjust the dimensions for xetex so the form field dimensions are the over all platforms. The boundary
+% The \app{xelatex} application includes the border width as part of the bounding rectangle
+%dimensions; all other PDF creators do not include the border as part of the dimensions
+%of the bounding rectangle. As a result, this wider boundary is known to {\TeX} as it lays out the line. For
+% non-\app{xelatex} applications, the boundary width is \emph{invisible} to {\TeX}. The command \cs{ef@adjHWxetex} tries to
+% adjust the dimensions for \app{xelatex} so the form field dimensions are the same over all platforms. The boundary
% is still ``visible'' in {\TeX} space.
%
%\paragraph*{Sample uses:}
@@ -2721,6 +2927,7 @@
\newcommand\efKern[2]{\ifxetex\kern#2\else\kern#1\fi}
% \end{macrocode}
% \end{macro}
+% The use of \cs{efKern} has been largely subsumed by \cs{olBdry} and \cs{cgBdry}, however.
% \DescribeMacro{\olBdry}\cs{olBdry} and \DescribeMacro{\cgBdry}\cs{cgBdry}
% are convenience commands to setting the gap between two contiguous fields.
% \cs{olBdry} gives positions the fields so that the boundary lines overlap
@@ -2729,19 +2936,23 @@
% \changes{v2.9d}{2016/12/22}{Added \string\cs{olBdry} and\string\cs{cgBdry}}
% \begin{macrocode}
\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
- \edef\@mtkern{\the\@tempdima}\fi\kern\@mtkern\egroup
+ \@tempdima-\g@eq@W@value@bp
+ \edef\@mtkern{\the\@tempdima}\else
+ \@tempdima2\b@\advance\@tempdima-\g@eq@W@value@bp
+ \edef\@mtkern{\the\@tempdima}\fi\kern\@mtkern\egroup
}
% \end{macrocode}
-% (2017/01/15) Add optional argument to \cs{cgBdry}
+% \DescribeMacro\cgBdry\hskip-\marginparsep\texttt{[\ameta{length}]}
+% This command inserts spacing between to fields so they are
+% contiguous (boundary-to-boundary); it insert additional space based in the
+% optional argument \ameta{length}. Normally, when the boundaries are the same
+% color, \cs{olBdry} is used; otherwise, \cs{cgBdry} looks best.
% \changes{v2.9h}{2017/01/15}{Add optional argument to \string\cs{cgBdry}}
% \begin{macrocode}
-\newcommand\cgBdry[1][0bp]{\bgroup\def\ef@rgi{#1}\ifx\ef@rgi\@empty
- \def\ef@rgi{0bp}\fi\setlength{\@tempdima}{\ef@rgi}%
- \ifxetex\else\addtolength{\@tempdima}{2bp}\fi
- \kern\@tempdima\egroup\ignorespaces}
+\newcommand\cgBdry[1][0\b@]{\bgroup\def\ef@rgi{#1}\ifx\ef@rgi\@empty
+ \def\ef@rgi{0\b@}\fi\setlength{\@tempdima}{\ef@rgi}%
+ \ifxetex\else\addtolength{\@tempdima}{2\b@}\fi
+ \kern\@tempdima\egroup\ignorespaces}
% \end{macrocode}
% \DescribeMacro{\volBdry}\cs{volBdry} and \DescribeMacro{\vcgBdry}\cs{vcgBdry}
% are convenience commands to setting the gap between two vertically oriented fields.
@@ -2749,11 +2960,13 @@
% (ol) and \cs{vcgBdry} positions the field so the boundary lines are
% contiguous (cg).
% \changes{v2.9h}{2017/01/15}{Added \string\cs{volBdry} and\string\cs{vcgBdry}}
-% \changes{v2.9n}{2017/09/04}{Added \string\cs{efSupprIndent}}.
+% \changes{v2.9n}{2017/09/04}{Added \string\cs{efSupprIndent}}
+% \changes{v2.3.3}{2020/04/15}{Use \string\cs{toks@} in \string\cs{efSupprIndent};
+% use of \string\cs{ef@scratchtoks} proved to be a problem.}
% \begin{macrocode}
-\newcommand{\efSupprIndent}{\ef@scratchtoks=\expandafter{\the\everypar}%
+\newcommand{\efSupprIndent}{\toks@=\expandafter{\the\everypar}%
\everypar{{\setbox\z@\lastbox}\clubpenalty\@M
- \everypar=\expandafter{\the\ef@scratchtoks}}}
+ \everypar=\expandafter{\the\toks@}}}
\newcommand\volBdry{\bgroup\parskip0pt\relax\@@par\nointerlineskip
\olBdry\egroup\efSupprIndent}
\newcommand\vcgBdry{\@ifstar{\edef\ef@offset{\the\parskip}\vcgBdry@i}
@@ -2908,13 +3121,30 @@
\ef@pdfstrCLOpti}
% \end{macrocode}
% \subsubsection{List Box}\label{listbox}
+%
+%\changes{v2.4}{2020/11/28}{Allow \cs{list@@Box} to obey \string\cs{pdfStringsOn}}
+%
% The main list box code that can be used to build list box commands, such as
% \cs{listBox}, defined below. Within
% the optional argument, the following aliases are used: \cs{nameuse} for \cs{@nameuse}
% and \cs{tops} for \cs{texorpdfstring}.
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars=!(),codes={\catcode`\%=9}]
+%#1 = !textsf(optional, used to enter any modification of the appearance/actions)
+%#2 = !textsf(the title of the button field)
+%#3 = !textsf(the width of the bounding rectangle)
+%#4 = !textsf(the height of the bounding rectangle)
+%#5 = !textsf(list of key-values for list/combo box)
+%#6 = !textsf(not used)
+%#7 = !textsf(set props and driver macros)
+%#8 = !textsf(every macros)
+%\end{Verbatim}
% \begin{macrocode}
\def\annot@type@listbox{listbox}
-\newcommand\list@@Box[8]{\begingroup
+\bgroup\obeyspaces
+\gdef\list@@Box{\begingroup\global\let =\pdfSP
+\ef@sanitize@toks\list@@@Box}\egroup
+\newcommand\list@@@Box[8]{\endgroup\begingroup
\let\nameuse\@nameuse\let\tops\texorpdfstring
\edef\annot@type{\annot@type@listbox}%
\pdfstringdef\Fld@name{#2}\dl@paramlocal
@@ -2926,22 +3156,20 @@
\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}
-% #1 = optional, used to enter any modification of the appearance/actions
-% #2 = the title of the list box field
-% #3 = the width of the bounding rectangle
-% #4 = the height of the bounding rectangle
-% #5 = the face values/export values of list.
-%\end{verbatim}
+% \begin{macro}{\listBox}\hskip-\marginparsep
+% \texttt{[\ameta{options}]\darg{\ameta{fld-name}}\darg{\ameta{wd}}^^A
+% \darg{\ameta{ht}}\darg{\ameta{face-export-list}}} The user interface to creating a list box field.
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars=!(),codes={\catcode`\%=9}]
+%#1 = !textsf(optional, used to enter any modification of the appearance/actions)
+%#2 = !textsf(the title of the list box field)
+%#3 = !textsf(the width of the bounding rectangle)
+%#4 = !textsf(the height of the bounding rectangle)
+%#5 = !textsf(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}}
@@ -2962,11 +3190,28 @@
% \end{macrocode}
% \end{macro}
% \subsubsection{Combo Box}\label{combobox}
+%
+%\changes{v2.4}{2020/11/28}{Allow \cs{combo@@Box} to obey \string\cs{pdfStringsOn}}
+%
% Within the optional argument, the following aliases are used: \cs{nameuse} for \cs{@nameuse}
% and \cs{tops} for \cs{texorpdfstring}.
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars=!(),codes={\catcode`\%=9}]
+%#1 = !textsf(optional, used to enter any modification of the appearance/actions)
+%#2 = !textsf(the title of the button field)
+%#3 = !textsf(the width of the bounding rectangle)
+%#4 = !textsf(the height of the bounding rectangle)
+%#5 = !textsf(list of key-values for list/combo box)
+%#6 = !textsf(not used)
+%#7 = !textsf(set props and driver macros)
+%#8 = !textsf(every macros)
+%\end{Verbatim}
% \begin{macrocode}
\def\annot@type@combobox{combobox}
-\newcommand\combo@@Box[8]{\begingroup
+\bgroup\obeyspaces
+\gdef\combo@@Box{\begingroup\global\let =\pdfSP
+\ef@sanitize@toks\combo@@@Box}\egroup
+\newcommand\combo@@@Box[8]{\endgroup\begingroup
\let\nameuse\@nameuse\let\tops\texorpdfstring
\edef\annot@type{\annot@type@combobox}%
\@eqFf{\FfCombo}\pdfstringdef\Fld@name{#2}\dl@paramlocal
@@ -2979,15 +3224,18 @@
\def\eq@DA{\eq@textFont\space\eq@textSize\space Tf \eq@textColor}%
\@processEvery#8\end\noindent#6#7{#1}}
% \end{macrocode}
-% \begin{macro}{\comboBox}
+% \begin{macro}{\comboBox}\hskip-\marginparsep
+% \texttt{[\ameta{options}]\darg{\ameta{fld-name}}\darg{\ameta{wd}}^^A
+% \darg{\ameta{ht}}\darg{\ameta{face-export-list}}}\\
% A general combo box command.
-%\begin{verbatim}
-% #1 = optional, used to enter any modification of the appearance/actions
-% #2 = the title of the radio field
-% #3 = the width of the bounding rectangle
-% #4 = the height of the bounding rectangle
-% #5 = the face values/export values of combo box.
-%\end{verbatim}
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars=!(),codes={\catcode`\%=9}]
+%#1 = !textsf(optional, used to enter any modification of the appearance/actions)
+%#2 = !textsf(the title of the radio field)
+%#3 = !textsf(the width of the bounding rectangle)
+%#4 = !textsf(the height of the bounding rectangle)
+%#5 = !textsf(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}}
@@ -3124,26 +3372,44 @@
% when setting the dimensions of this widget. Made the same
% changes for all AcroForm elements and for linking.
%}
+%\changes{v2.4}{2020/11/28}{Rewrite of \string\cs{push@@Button} to support \string\cs{pdfSpacesOn}}
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars=!(),codes={\catcode`\%=9}]
+%#1 = !textsf(optional, used to enter any modification of the appearance/actions)
+%#2 = !textsf(the title of the button field)
+%#3 = !textsf(the width of the bounding rectangle)
+%#4 = !textsf(the height of the bounding rectangle)
+%#5 = !textsf(not used)
+%#6 = !textsf(set props and driver macros)
+%#7 = !textsf(every macros)
+%\end{Verbatim}
% \begin{macrocode}
\def\annot@type@button{pushbtn}
-\newcommand\push@@Button[7]{\begingroup
- \let\nameuse\@nameuse\let\tops\texorpdfstring
+\bgroup\obeyspaces
+\gdef\push@@Button{\begingroup\global\let =\pdfSP
+\ef@sanitize@toks\push@@@Button}\egroup
+\newcommand\push@@@Button[7]{\endgroup\begingroup
+ \let\nameuse\@nameuse\let\tops\texorpdfstring%
\edef\annot@type{\annot@type@button}%
- \pdfstringdef\Fld@name{#2}\dl@paramlocal
- \makeJSspecials\ef@preProcDefns
+ \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}
-%#1 = optional, used to enter any modification of the appearance/actions
-%#2 = the title of the button field
-%#3 = the width of the bounding rectangle
-%#4 = the height of the bounding rectangle
-%\end{verbatim}
-%\noindent The default for \cs{pushButton}
+% \hskip-\marginparsep\texttt{[\ameta{options}]\darg{\ameta{fld-name}}\darg{\ameta{wd}}\darg{\ameta{ht}}}
+% The user command for creating a push button form field.
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars=!(),codes={\catcode`\%=9}]
+%#1 = !textsf(optional, used to enter any modification of the appearance/actions)
+%#2 = !textsf(the title of the button field)
+%#3 = !textsf(the width of the bounding rectangle)
+%#4 = !textsf(the height of the bounding rectangle)
+%\end{Verbatim}
+%The defaults for \cs{pushButton}
% \begin{macrocode}
\def\pushButtonDefaults{%
\W{1}\S{B}\F{\FPrint}\BC{0 0 0}
@@ -3168,11 +3434,28 @@
% The basic command for creating check boxes. For \emph{enhanced preview} we define
% \DescribeMacro\pmpvMrk\cs{pmpvMrk\darg{mrk}}, which defines \cs{pmpv@mrk} that is eventually
% used in the core of \cs{ef@Bbox}.
+%\changes{v2.4}{2020/11/28}{Rewrite of \string\cs{check@@Box} to support \string\cs{pdfSpacesOn}}
% \begin{macrocode}
\def\pmpvMrk#1{\def\pmpv@mrk{#1}}
\pmpvMrk{X}
+% \end{macrocode}
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars=!(),codes={\catcode`\%=9}]
+%#1 = !textsf(optional, used to enter any modification of the appearance/actions)
+%#2 = !textsf(the title of the button field)
+%#3 = !textsf(the width of the bounding rectangle)
+%#4 = !textsf(the height of the bounding rectangle)
+%#5 = !textsf(the `on' value, usually Yes)
+%#6 = !textsf(not used)
+%#7 = !textsf(set props and driver macros)
+%#8 = !textsf(every macros)
+%\end{Verbatim}
+% \begin{macrocode}
\def\annot@type@checkbox{checkbox}
-\newcommand\check@@Box[8]{\begingroup
+\bgroup\obeyspaces
+\gdef\check@@Box{\begingroup\global\let =\pdfSP
+\ef@sanitize@toks\check@@@Box}\egroup
+\newcommand\check@@@Box[8]{\endgroup\begingroup
\let\nameuse\@nameuse\let\tops\texorpdfstring
\let\#\ef@Hx\edef\annot@type{\annot@type@checkbox}%
\pdfstringdef\Fld@name{#2}\@eqAS{Off}\dl@paramlocal
@@ -3195,13 +3478,17 @@
\@processEvery#8\end\noindent#6#7{#1}}
% \end{macrocode}
% \begin{macro}{\checkBox}
-%\begin{verbatim}
-%#1 = optional, used to enter any modification of the appearance/actions
-%#2 = the title of the check box field
-%#3 = the width of the bounding rectangle
-%#4 = the height of the bounding rectangle
-%#5 = the 'on value' or export value, the default is "Yes".
-%\end{verbatim}
+% \hskip-\marginparsep\texttt{[\ameta{options}]\darg{\ameta{fld-name}}\darg{\ameta{wd}}^^A
+% \darg{\ameta{ht}}\darg{\ameta{on-value}}}
+% The user interface for creating a check box.
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars=!(),codes={\catcode`\%=9}]
+%#1 = !textsf(optional, used to enter any modification of the appearance/actions)
+%#2 = !textsf(the title of the check box field)
+%#3 = !textsf(the width of the bounding rectangle)
+%#4 = !textsf(the height of the bounding rectangle)
+%#5 = !textsf(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}}
@@ -3226,7 +3513,7 @@
% is available when \DescribeMacro\useNewRadiosOff\cmd{\useNewRadiosOff} is expanded. This is the default.
%
% When \DescribeMacro\useNewRadiosOn\cmd{\useNewRadiosOn} is expanded, the new code for radio buttons is used.
-% As a result, you need t\emph{hree compiles} to bring the AUX files up to date. The AUX files now
+% As a result, you need \emph{three compiles} to bring the AUX files up to date. The AUX files now
% contain PDF object references to radio buttons. Because this new scheme degrades the experience
% of creating radio buttons (heavy I/O usage), use this option if you and the consumers of your PDF\emph{ do not use}
% Adobe PDF viewers (on a desktop/laptop).
@@ -3234,6 +3521,7 @@
% Use the default setting (\cmd{\useNewRadiosOff}) when you will view the PDF in AA/AR and save it; otherwise, if the PDF is to be viewed in non-conforming
% PDF readers, never having been saved using AA/AR, use the \cmd{\useNewRadiosOn} setting.
% \changes{v2.3}{2019/06/14}{Rewrote radio buttons so they work in non-conforming PDF readers}
+% \changes{v2.4}{2020/11/28}{Rewrite of \string\cs{radio@@Button} to support \string\cs{pdfSpacesOn}}
%
% \medskip\noindent\textbf{Discussion.} The default scheme is to create the radio buttons \begin{quote}\footnotesize
% \cs{radioButton\darg{\ameta{name}}\darg{\ameta{width}}\darg{\ameta{height}}} ...\\
@@ -3287,38 +3575,33 @@
% \begin{macrocode}
\def\ef@NewRadiosLateOpts{%
% \end{macrocode}
-% We do nothing if the new scheme is not being used.
-% \begin{macrocode}
- \ifuseNewRadios
-% \end{macrocode}
% If this is a multi-group radio button field that work independently, we adjust the `on' value, as in this case,
% the `on' value is referenced by an index, 0, 1, 2,...
% \begin{macrocode}
- \@nameuse{multigroup@\Fld@name}%
- \ifx\ef@multigroupradios\ef@YES
- \ifpdfmarkup
- \def\eq@On{(\@nameuse{radioindex@\Fld@name}) cvn }\else
- \def\eq@On{/\@nameuse{radioindex@\Fld@name}}\fi
- \expandafter\ifx\csname OnVal@\Fld@name\endcsname\relax
- \@eqAS{Off}\else % today
- \ifnum\@nameuse{OnVal@\Fld@name}=%
- \@nameuse{radioindex@\Fld@name}\relax
- \@eqAS{\@nameuse{radioindex@\Fld@name}}\else\@eqAS{Off}\fi\fi
- \else
- \edef\x{\@nameuse{OnVal@\Fld@name}}%
- \ifx\x\ef@thisChoice\@eqAS{\@nameuse{OnVal@\Fld@name}}\else
- \@eqAS{Off}\fi
- \fi
+ \@nameuse{multigroup@\Fld@name}%
+ \ifx\ef@multigroupradios\ef@YES
+ \ifpdfmarkup
+ \def\eq@On{(\@nameuse{radioindex@\Fld@name}) cvn }\else
+ \def\eq@On{/\@nameuse{radioindex@\Fld@name}}\fi
+ \expandafter\ifx\csname OnVal@\Fld@name\endcsname\relax
+ \@eqAS{Off}\else % today
+ \ifnum\@nameuse{OnVal@\Fld@name}=%
+ \@nameuse{radioindex@\Fld@name}\relax
+ \@eqAS{\@nameuse{radioindex@\Fld@name}}\else\@eqAS{Off}\fi\fi
+ \else
+ \edef\x{\@nameuse{OnVal@\Fld@name}}%
+ \ifx\x\ef@thisChoice\@eqAS{\@nameuse{OnVal@\Fld@name}}\else
+ \@eqAS{Off}\fi
+ \fi
% \end{macrocode}
% If these are groups of radio button fields that light up in unison, we
% take to get the \cs{/AS} entry right.
% \begin{macrocode}
- \@nameuse{uniradios@\Fld@name}%
- \ifx\isRadiosInUnison\ef@YES
- \edef\x{\@nameuse{value@\Fld@name}}%
- \ifx\x\ef@thisChoice\expandafter\@eqAS
- \expandafter{\ef@thisChoice}\else\@eqAS{Off}\fi
- \fi
+ \@nameuse{uniradios@\Fld@name}%
+ \ifx\isRadiosInUnison\ef@YES
+ \edef\x{\@nameuse{value@\Fld@name}}%
+ \ifx\x\ef@thisChoice\expandafter\@eqAS
+ \expandafter{\ef@thisChoice}\else\@eqAS{Off}\fi
\fi
}
% \end{macrocode}
@@ -3359,8 +3642,23 @@
% \end{macrocode}
% Finally, we arrive at the low-level radio button command, where
% changes for the 2019/06/14 version have been made.
+%The arguments for this command are,
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars=!(),codes={\catcode`\%=9}]
+%#1 = !textsf(optional, used to enter any modification of the appearance/actions)
+%#2 = !textsf(the title of the button field)
+%#3 = !textsf(the width of the bounding rectangle)
+%#4 = !textsf(the height of the bounding rectangle)
+%#5 = !textsf(the `on' value, usually Yes)
+%#6 = !textsf(not used)
+%#7 = !textsf(set props and driver macros)
+%#8 = !textsf(every macros)
+%\end{Verbatim}
% \begin{macrocode}
-\newcommand\radio@@Button[8]{\begingroup\let\#\ef@Hx
+\bgroup\obeyspaces
+\gdef\radio@@Button{\begingroup\global\let =\pdfSP
+\ef@sanitize@toks\radio@@@Button}\egroup
+\newcommand\radio@@@Button[8]{\endgroup\begingroup\let\#\ef@Hx
\let\nameuse\@nameuse\let\tops\texorpdfstring
\edef\annot@type{\annot@type@radio}%
\pdfstringdef\Fld@name{#2}%
@@ -3419,15 +3717,18 @@
\@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}
-%#1 = optional, used to enter any modification of the appearance/actions
-%#2 = the title of the radio button field
-%#3 = the width of the bounding rectangle
-%#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{macro}{\radioButton}\hskip-\marginparsep\texttt{[\ameta{options}]\darg{\ameta{fld-name}}\darg{\ameta{wd}}^^A
+% \darg{\ameta{ht}}\darg{\ameta{on-value}}}
+% User interface to creating a radio button.
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars=!(),codes={\catcode`\%=9}]
+%#1 = !textsf(optional, used to enter any modification of the appearance/actions)
+%#2 = !textsf(the title of the radio button field)
+%#3 = !textsf(the width of the bounding rectangle)
+%#4 = !textsf(the height of the bounding rectangle)
+%#5 = !textsf(the `on value' or export value, the default is "Yes")
+%\end{Verbatim}
+%The default for \cs{radioButton}
% \begin{macrocode}
\def\radioButtonDefaults{\W{1}\S{S}\BC{0 0 0}\F{\FPrint}}
% \end{macrocode}
@@ -3451,6 +3752,7 @@
% The template for a text field. Within
% the optional argument, the following aliases are used: \cs{nameuse} for \cs{@nameuse}
% and \cs{tops} for \cs{texorpdfstring}.
+%\changes{v2.4}{2020/11/28}{Rewrite of \string\cs{text@@Field} to support \string\cs{pdfSpacesOn}}
% \begin{macrocode}
\def\common@TextFieldCode
{%
@@ -3472,9 +3774,23 @@
}
% \end{macrocode}
% The basic text field macro for constructing all other text fields.
+%The arguments for this command are,
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars=!(),codes={\catcode`\%=9}]
+%#1 = !textsf(optional, used to enter any modification of the appearance/actions)
+%#2 = !textsf(the title of the button field)
+%#3 = !textsf(the width of the bounding rectangle)
+%#4 = !textsf(the height of the bounding rectangle)
+%#5 = !textsf(not used)
+%#6 = !textsf(set props and driver macros)
+%#7 = !textsf(every macros)
+%\end{Verbatim}
% \begin{macrocode}
\def\annot@type@text{textfld}
-\newcommand\text@@Field[7]{\begingroup
+\bgroup\obeyspaces
+\gdef\text@@Field{\begingroup\global\let =\pdfSP
+\ef@sanitize@toks\text@@@Field}\egroup
+\newcommand\text@@@Field[7]{\endgroup\begingroup
\let\nameuse\@nameuse\let\tops\texorpdfstring
\edef\annot@type{\annot@type@text}%
\pdfstringdef\Fld@name{#2}\dl@paramlocal
@@ -3482,14 +3798,17 @@
\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}
-%#1 = optional, used to enter any modification of the appearance/actions
-%#2 = the title of the text field
-%#3 = the width of the bounding rectangle
-%#4 = the height of the bounding rectangle
-%\end{verbatim}
-%\noindent The default for \cs{textField}
+% \begin{macro}{\textField}\hskip-\marginparsep
+% \texttt{[\ameta{options}]\darg{\ameta{fld-name}}\darg{\ameta{wd}}^^A
+% \darg{\ameta{ht}}} The user interface to creating a text field.
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars=!(),codes={\catcode`\%=9}]
+%#1 = !textsf(optional, used to enter any modification of the appearance/actions)
+%#2 = !textsf(the title of the text field)
+%#3 = !textsf(the width of the bounding rectangle)
+%#4 = !textsf(the height of the bounding rectangle)
+%\end{Verbatim}
+%\noindent The defaults for \cs{textField}
% \begin{macrocode}
\def\textFieldDefaults{\F{\FPrint}\BC{0 0 0}\W{1}\S{S}}
% \end{macrocode}
@@ -3519,6 +3838,7 @@
% The template for a signature field. Within
% the optional argument, the following aliases are used: \cs{nameuse} for \cs{@nameuse}
% and \cs{tops} for \cs{texorpdfstring}.
+%\changes{v2.4}{2020/11/28}{Rewrite of \string\cs{sig@@Field} to support \string\cs{pdfSpacesOn}}
% \begin{macrocode}
\def\common@SigFieldCode
{%
@@ -3536,9 +3856,23 @@
}
% \end{macrocode}
% The basic text field macro for constructing all other text fields.
+%The arguments for this command are,
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars=!(),codes={\catcode`\%=9}]
+%#1 = !textsf(optional, used to enter any modification of the appearance/actions)
+%#2 = !textsf(the title of the button field)
+%#3 = !textsf(the width of the bounding rectangle)
+%#4 = !textsf(the height of the bounding rectangle)
+%#5 = !textsf(not used)
+%#6 = !textsf(set props and driver macros)
+%#7 = !textsf(every macros)
+%\end{Verbatim}
% \begin{macrocode}
\def\annot@type@sig{sigfld}
-\newcommand\sig@@Field[7]{\begingroup
+\bgroup\obeyspaces
+\gdef\sig@@Field{\begingroup\global\let =\pdfSP
+\ef@sanitize@toks\sig@@@Field}\egroup
+\newcommand\sig@@@Field[7]{\endgroup\begingroup
\let\nameuse\@nameuse\let\tops\texorpdfstring
\edef\annot@type{\annot@type@sig}%
\pdfstringdef\Fld@name{#2}\dl@paramlocal
@@ -3546,14 +3880,17 @@
\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}
-%#1 = optional, used to enter any modification of the appearance/actions
-%#2 = the title of the text field
-%#3 = the width of the bounding rectangle
-%#4 = the height of the bounding rectangle
-%\end{verbatim}
-%\noindent Defaults for \cs{sigField}
+% \begin{macro}{\sigField}\hskip-\marginparsep
+% \texttt{[\ameta{options}]\darg{\ameta{fld-name}}\darg{\ameta{wd}}^^A
+% \darg{\ameta{ht}}} The user interface to creating a signature field.
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars=!(),codes={\catcode`\%=9}]
+%#1 = !textsf(optional, used to enter any modification of the appearance/actions)
+%#2 = !textsf(the title of the text field)
+%#3 = !textsf(the width of the bounding rectangle)
+%#4 = !textsf(the height of the bounding rectangle)
+%\end{Verbatim}
+%Defaults for \cs{sigField}
% \begin{macrocode}
\def\sigFieldDefaults{\F{\FPrint}\BC{}\BG{}\W{1}\S{S}}
% \end{macrocode}
@@ -3568,12 +3905,13 @@
% \end{macrocode}
% \end{macro}
%
-% \section{Additional Link Support}
+% \section{Additional Link Support}\label{linkSupport}
%
% The links in \textsf{hyperref} are not sufficiently general to
% allow actions other than jumping. I've included a general link
% that increases the usage of the links provided by
% \textsf{hyperref}.
+%\changes{v2.4}{2020/11/28}{Rewrite of \string\cs{set@@Link} to support \string\cs{pdfSpacesOn}}
% \paragraph{Common Link Code.} All the link commands eventually come back
% to this template for constructing a link annotation.
% \begin{macrocode}
@@ -3588,7 +3926,7 @@
% \end{macrocode}
% \cs{set@@Link} is the low-level link command and is the building block of all the
% other, more user-friendly link commands. Takes seven parameters:
-%\begin{enumerate}
+%\begin{enumerate}\sffamily
%\item[\texttt{\#1}:] Optional arguments to modify the appearance and actions of the link.
%\item[\texttt{\#2}:] The width of the bounding rectangle.
%\item[\texttt{\#3}:] The height of the bounding rectangle.
@@ -3599,7 +3937,10 @@
%\end{enumerate}
% \begin{macrocode}
\def\annot@type@link{link}
-\newcommand\set@@Link[7]{\begingroup
+\bgroup\obeyspaces
+\gdef\set@@Link{\begingroup\global\let =\pdfSP
+\ef@sanitize@toks\set@@@Link}\egroup
+\newcommand\set@@@Link[7]{\endgroup\begingroup
\let\nameuse\@nameuse\let\tops\texorpdfstring
\dl@paramlocal
\makeJSspecials
@@ -3628,18 +3969,19 @@
\let\ef@colorthislink\relax\fi}
\AtBeginDocument{\setDef@ultLinkColor}
% \end{macrocode}
-% \begin{macro}{\setLink}
+% \begin{macro}{\setLink}\hskip-\marginparsep\texttt{[\ameta{options}]\darg{\ameta{text}}}
% \cs{setLink} is the basic high-level link command, it is used to surround text
% with a link annotation.
-% \begin{macro}{\setLinkText}
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars={!~@},codes={\catcode`\%=9}]
+%\setLink[\A{\JS{this.pageNum=6;}}\Color{1 0 0}]{Go There!}
+%\end{Verbatim}
+% \begin{macro}{\setLinkText}\hskip-\marginparsep\texttt{[\ameta{options}]\darg{\ameta{text}}}
% \cs{setLinkText} is a synonym for \cs{setLink}.
-% \begin{macro}{\mlhypertext}
+% \begin{macro}{\mlhypertext}\hskip-\marginparsep\texttt{[\ameta{options}]\darg{\ameta{text}}}
% A command defined in the \pkg{aeb\_mlink} package.
-% \begin{macro}{\mlsetLink}
+% \begin{macro}{\mlsetLink}\hskip-\marginparsep\texttt{[\ameta{options}]\darg{\ameta{text}}}
% \cs{mlsetLink} expands to \cs{mlhypertext}
-%\begin{verbatim}
-% \setLink[\A{\JS{this.pageNum=6;}}\Color{1 0 0}]{Go There!}
-%\end{verbatim}
% \paragraph{Link Parameters.} These high-level links takes two parameters, one of which
% is optional.
%\begin{enumerate}
@@ -3723,12 +4065,13 @@
% \end{macro}
% \begin{macro}{\setLinkBbox}
% Set a link around a |\parbox|.
-%\begin{verbatim}
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%codes={\catcode`\%=9}]
%\setLinkBbox [\Color{1 0 0}}]{50bp}{30bp}[b]{\centering Press Me!}
-%\end{verbatim}
+%\end{Verbatim}
% \paragraph{Link Parameters.} There are four parameters, two of which
% are optional.
-%\begin{enumerate}
+%\begin{enumerate}\sffamily
%\item[\texttt{[\#1]}:] Optional key-value pairs to change the appearance or action
% of this link.
%\item[\texttt{\#2}:] The width of the \cs{parbox}.
@@ -3806,10 +4149,6 @@
% \begin{macrocode}
%<*userinterface>
% \end{macrocode}
-% Let's bring in the \textsf{xkeyval} package.
-% \begin{macrocode}
-%\usepackage{xkeyval}
-% \end{macrocode}
% The |\ui| interface is undefined if the \texttt{useui} option is not taken. We use this fact
% to send a message to the user that using |\ui| most accompany the \texttt{useui}.
% \begin{macrocode}
@@ -3829,7 +4168,7 @@
% \begin{macrocode}
\def\getargs#1#2{\def\aeb@argi{#1}\def\aeb@argii{#2}}
\def\labelRef#1{\@ifundefined{r@#1}{Doc-Start}
- {\aeb@exiii\@fourthoffive\csname r@#1\endcsname}}
+ {\aeb@exiii\@fourthoffive\csname r@#1\endcsname}}
\def\aeb@exiii{\expandafter\expandafter\expandafter}
\newtoks\ef@flagtoks
\newtoks\ef@jstoks
@@ -3847,25 +4186,25 @@
% \begin{macrocode}
\define@choicekey{eforms}{border}[\val\nr]{visible,invisible}
{%
- \ifcase\nr
+ \ifcase\nr
% \end{macrocode}
% Author has chosen a visible border |\eq@W@buffered|.
% \begin{macrocode}
- \def\eq@visibleborder{1}%
- \ifx\eq@W\@empty
- \ifx\eq@W@buffered\@empty\@eqW{1}\else
- \@eqW{\eq@W@buffered}\fi
- \else
- \ifnum\eq@W@value=0 \@eqW{1}\fi
- \ifx\eq@W@buffered\@empty\else
- \@eqW{\eq@W@buffered}\fi
- \fi
- \@eqBorder{0 0 \eq@W@value}%
- \or
- % author has chosen invisible border
- \def\eq@visibleborder{0}\@eqW{}%
- \@eqBorder{0 0 0}\@eqBC{}%
+ \def\eq@visibleborder{1}%
+ \ifx\eq@W\@empty
+ \ifx\eq@W@buffered\@empty\@eqW{1}\else
+ \@eqW{\eq@W@buffered}\fi
+ \else
+ \ifnum\eq@W@value=0 \@eqW{1}\fi
+ \ifx\eq@W@buffered\@empty\else
+ \@eqW{\eq@W@buffered}\fi
\fi
+ \@eqBorder{0 0 \eq@W@value}%
+ \or
+ % author has chosen invisible border
+ \def\eq@visibleborder{0}\@eqW{}%
+ \@eqBorder{0 0 0}\@eqBC{}%
+ \fi
}
% \end{macrocode}
% This choice key is for the \texttt{linewidth}\IndexKey{linewidth} of a link or form. The user interface choices
@@ -3874,62 +4213,66 @@
% \begin{macrocode}
\define@choicekey{eforms}{linewidth}[\val\nr]{thin,medium,thick}
{%
- \ifx\annot@type\annot@type@link
+ \ifx\annot@type\annot@type@link
% \end{macrocode}
% This is a link, so, depending on whether the color package is loaded, we show or don't
% show the boundary, depending on the explicate choices of the author
% \begin{macrocode}
- \ifx\eq@visibleborder\@empty
+ \ifx\eq@visibleborder\@empty
% \end{macrocode}
% Author has not committed to a border type, so we'll assume the default
% \begin{macrocode}
- \ifnum\eq@bordervisibledefault=0
+ \ifnum\eq@bordervisibledefault=0
% \end{macrocode}
% A color package is loaded, use invisible border by default.
% \begin{macrocode}
- \edef\eq@W@buffered{\ifcase\nr 1\or2\or3\fi}%
- \@eqW{}%
- \else
+ \edef\eq@W@buffered{\ifcase\nr 1\or2\or3\fi}%
+ \@eqW{}%
+ \else
% \end{macrocode}
% No color is loaded, show the border.
% \begin{macrocode}
- \ifcase\nr \@eqW{1}\or\@eqW{2}\or
- \@eqW{3}\else\@eqW{1}\fi\@eqBorder{0 0 \eq@W@value}%
- \fi
- \else
+ \ifcase\nr\@eqW{1}\or\@eqW{2}\or
+ \@eqW{3}\else\@eqW{1}\fi
+ \@eqBorder{0 0 \eq@W@value}%
+ \fi
+ \else
% \end{macrocode}
% Author has set the border type before line width, we'll do what the
% author wants. If invisible, ignore |\W|, if visible obey |\W|.
% \begin{macrocode}
- \ifnum\eq@visibleborder=1 % visible border
- \ifcase\nr \@eqW{1}\or\@eqW{2}\or
- \@eqW{3}\else\@eqW{1}\fi\@eqBorder{0 0 \eq@W@value}%
- \fi
- \fi
- \else
+ \ifnum\eq@visibleborder=1 % visible border
+ \ifcase\nr\@eqW{1}\or\@eqW{2}\or
+ \@eqW{3}\else\@eqW{1}\fi
+ \@eqBorder{0 0 \eq@W@value}%
+ \fi
+ \fi
+ \else
% \end{macrocode}
% This is not a link, its a form, so things are easier. The invisible border will override
% the linewidth. If the author wants a border, s/he better get her/his act together and
% remove \texttt{border=invisible}.
% \begin{macrocode}
- \ifx\eq@visibleborder\@empty
+ \ifx\eq@visibleborder\@empty
% \end{macrocode}
% If the value of |\eq@visibleborder|, author has not used the border key at this time,
% so just set the \texttt{linewidth} as stated.
% \begin{macrocode}
- \ifcase\nr \@eqW{1}\or\@eqW{2}\or
- \@eqW{3}\else\@eqW{1}\fi\@eqBorder{0 0 \eq@W@value}%
- \edef\eq@W@buffered{\ifcase\nr 1\or2\or3\fi}%
- \else
+ \ifcase\nr \@eqW{1}\or\@eqW{2}\or
+ \@eqW{3}\else\@eqW{1}\fi
+ \@eqBorder{0 0 \eq@W@value}%
+ \edef\eq@W@buffered{\ifcase\nr1\or2\or3\fi}%
+ \else
% \end{macrocode}
% The author has used the border key, so we don't need to save this value.
% \begin{macrocode}
- \ifnum\eq@visibleborder>0
- \ifcase\nr \@eqW{1}\or\@eqW{2}\or
- \@eqW{3}\else\@eqW{1}\fi\@eqBorder{0 0 \eq@W@value}%
- \fi
- \fi
+ \ifnum\eq@visibleborder>0
+ \ifcase\nr \@eqW{1}\or\@eqW{2}\or
+ \@eqW{3}\else\@eqW{1}\fi
+ \@eqBorder{0 0 \eq@W@value}%
+ \fi
\fi
+ \fi
}
\let\eq@visibleborder\@empty
\let\eq@W@buffered\@empty
@@ -3995,7 +4338,7 @@
% of the field can be set, such visibility, printability, readonly,
% orientation, captions (for button), values, default values, etc.
% can be set.
-%
+%\par\medskip\noindent
% The \texttt{annotflags}\IndexKey{annotflags} is a bit field, possible values are \texttt{hidden}, \texttt{print},
% \texttt{-print}, \texttt{noview}, and \texttt{lock}. Multiple values can
% be specified. The values are ``or-ed'' together. Most all forms are printable
@@ -4004,19 +4347,19 @@
% locked, so the field cannot be moved through the UI.
% \begin{macrocode}
\define@key{eforms}{annotflags}[]{\ef@flagtoks={}%
- \setkeys{annotflags}{#1}}
+ \setkeys{annotflags}{#1}}
\@tfor\ef@flagopts:={{hidden}{FHidden}}{{print}{FPrint}}{{noprint}%
- {FNoPrint}}{{-print}{FNoPrint}}{{noview}{FNoView}}{{lock}{FLock}}%
- \do{\expandafter\getargs\ef@flagopts
- \edef\temp@expand@def{%
- \noexpand\define@key{annotflags}{\aeb@argi}[true]{%
- \noexpand\ef@flagtoks=%
- \noexpand\expandafter{\noexpand\ef@passedArgs}%
- \noexpand\edef\noexpand\ef@passedArgs{\noexpandiii%
- \F{\noexpandiii\csname\aeb@argii\noexpandiii\endcsname}%
- \noexpand\the\noexpand\ef@flagtoks}%
- }%
- }\temp@expand@def
+ {FNoPrint}}{{-print}{FNoPrint}}{{noview}{FNoView}}{{lock}{FLock}}%
+ \do{\expandafter\getargs\ef@flagopts
+ \edef\temp@expand@def{\noexpand
+ \define@key{annotflags}{\aeb@argi}[true]{%
+ \noexpand\ef@flagtoks=\noexpand
+ \expandafter{\noexpand\ef@passedArgs}%
+ \noexpand\edef\noexpand\ef@passedArgs{\noexpandiii
+ \F{\noexpandiii\@nameuse{\aeb@argii\noexpandiii}}%
+ \noexpand\the\noexpand\ef@flagtoks}%
+ }%
+ }\temp@expand@def
}
% \end{macrocode}
% A large number of fields that sets a number of properties of a field. Some of these
@@ -4024,40 +4367,39 @@
% These appear in the first of the paired groups listed below. Normally, a document
% author would not specify \texttt{radio}, \texttt{pushbutton} or \texttt{combo}.
% These properties are used
-% by eforms to construct a radio button field, a push button and a combo box.
+% by \pkg{eforms} to construct a radio button field, a push button and a combo box.
% The others can be used as appropriate.
% \begin{macrocode}
\define@key{eforms}{fieldflags}[]{\ef@flagtoks={}%
- \setkeys{fieldflags}{#1}}
+ \setkeys{fieldflags}{#1}}
\@tfor\ef@flagopts:={{readonly}{FfReadOnly}}{{required}{FfRequired}}%
- {{noexport}{FfNoExport}}{{multiline}{FfMultiline}}%
- {{password}{FfPassword}}{{notoggleoff}{FfNoToggleToOff}}%
- {{radio}{FfRadio}}{{pushbutton}{FfPushButton}}{{combo}{FfCombo}}%
- {{edit}{FfEdit}}{{sort}{FfSort}}{{fileselect}{FfFileSelect}}%
- {{multiselect}{FfMultiSelect}}{{nospellcheck}{FfDoNotSpellCheck}}%
- {{noscrolling}{FfDoNotScroll}}{{comb}{FfComb}}%
- {{radiosinunison}{FfRadiosInUnison}}%
- {{commitonchange}{FfCommitOnSelChange}}{{richtext}{FfRichText}}\do{%
- \expandafter\getargs\ef@flagopts
- \edef\temp@expand@def{%
- \noexpand\define@key{fieldflags}{\aeb@argi}[true]%
- {%
- \noexpand\ef@flagtoks=\noexpand\expandafter{%
- \noexpand\ef@passedArgs}%
- \noexpand\edef\noexpand\ef@passedArgs{\noexpandiii%
- \Ff{\noexpandiii\csname\aeb@argii\noexpandiii\endcsname}%
- \noexpand\the\noexpand\ef@flagtoks}%
- }%
- }\temp@expand@def
+ {{noexport}{FfNoExport}}{{multiline}{FfMultiline}}%
+ {{password}{FfPassword}}{{notoggleoff}{FfNoToggleToOff}}%
+ {{radio}{FfRadio}}{{pushbutton}{FfPushButton}}{{combo}{FfCombo}}%
+ {{edit}{FfEdit}}{{sort}{FfSort}}{{fileselect}{FfFileSelect}}%
+ {{multiselect}{FfMultiSelect}}{{nospellcheck}{FfDoNotSpellCheck}}%
+ {{noscrolling}{FfDoNotScroll}}{{comb}{FfComb}}%
+ {{radiosinunison}{FfRadiosInUnison}}%
+ {{commitonchange}{FfCommitOnSelChange}}{{richtext}{FfRichText}}\do{%
+ \expandafter\getargs\ef@flagopts
+ \edef\temp@expand@def{\noexpand
+ \define@key{fieldflags}{\aeb@argi}[true]{\noexpand
+ \ef@flagtoks=\noexpand\expandafter{\noexpand
+ \ef@passedArgs}\noexpand
+ \edef\noexpand\ef@passedArgs{\noexpandiii
+ \Ff{\noexpandiii\@nameuse{\aeb@argii\noexpandiii}}%
+ \noexpand\the\noexpand\ef@flagtoks}%
+ }%
+ }\temp@expand@def
}
% \end{macrocode}
% Enter a text value to appear as a tool tip\IndexKey{tooltip}. For example,
-% \texttt{tooltip={Hi, press me and see what happens!}}. Enclose in
+% \texttt{tooltip={\darg{\textsf{Hi, press me and see what happens!}}}}. Enclose in
% parentheses if the text string contains a comma.
% \begin{macrocode}
\define@key{eforms}{tooltip}{\@eqTU{#1}}
% \end{macrocode}
-% The default value\IndexKey{default}\IndexKey{defaultstyle} of a field (text, list, combobox) what is used
+% The default value\IndexKey{default}\IndexKey{defaultstyle} of a field (text, list, combo box) what is used
% when the field is reset. Example: \texttt{default=Name}
% \begin{macrocode}
\define@key{eforms}{default}{\@eqDV{#1}}
@@ -4111,14 +4453,7 @@
% The color of the text\IndexKey{textcolor} in the field. This can be in \textsf{G}, \textsf{RGB} or \textsf{CMYK} color
% space.
% \begin{macrocode}
-\define@key{eforms}{textcolor}{%
- \@eqtextColor{#1}%
-% \aeb@cntargs#1 \\\relax
-% \ifcase\aeb@nArgs\relax\or
-% \@eqtextColor{#1 g}\or\or
-% \@eqtextColor{#1 rg}\or
-% \@eqtextColor{#1 k}\fi
-}
+\define@key{eforms}{textcolor}{\@eqtextColor{#1}}
% \end{macrocode}
% Use \texttt{maxlength}\IndexKey{maxlength} to limit the number of characters input into a text field.
% Example: \texttt{maxlength=12}.
@@ -4133,43 +4468,44 @@
\define@key{eforms}{rollappr}{\@eqRI{#1}}
\define@key{eforms}{downappr}{\@eqIX{#1}}
\define@choicekey{eforms}{layout}[\val\nr]{labelonly,icononly,%
- icontop,iconbottom,iconleft,iconright,labelover}{%
- \ifx\annot@type\annot@type@button
- \expandafter\@eqTP\expandafter{\nr}\fi}{}
+ icontop,iconbottom,iconleft,iconright,labelover}{%
+ \ifx\annot@type\annot@type@button\expandafter
+ \@eqTP\expandafter{\nr}\fi}{}
% \end{macrocode}
% Scaling keys, \texttt{scalewhen}\IndexKey{scalewhen} and \texttt{scale}\IndexKey{scale}
% \begin{macrocode}
\define@choicekey{eforms}{scalewhen}[\val\nr]{always,never,%
- iconbig,iconsmall}{%
- \ifx\annot@type\annot@type@button
- \ifcase\nr\relax
- \def\eq@@SW{A}\or
- \def\eq@@SW{N}\or
- \def\eq@@SW{B}\or
- \def\eq@@SW{S}\else
- \def\eq@@SW{A}\fi
- \expandafter\@eqSW\expandafter{\eq@@SW}\fi}{}
+ iconbig,iconsmall}{%
+ \ifx\annot@type\annot@type@button
+ \ifcase\nr\relax
+ \def\eq@@SW{A}\or
+ \def\eq@@SW{N}\or
+ \def\eq@@SW{B}\or
+ \def\eq@@SW{S}\else
+ \def\eq@@SW{A}\fi
+ \expandafter\@eqSW\expandafter{\eq@@SW}\fi}{}
\define@choicekey{eforms}{scale}[\val\nr]{proportional,%
- nonproportional}{%
- \ifx\annot@type\annot@type@button
- \ifcase\nr\relax
- \def\eq@@ST{P}\or
- \def\eq@@ST{A}\else
- \def\eq@@ST{P}\fi
- \expandafter\@eqST\expandafter{\eq@@ST}\fi}{}
+ nonproportional}{%
+ \ifx\annot@type\annot@type@button
+ \ifcase\nr\relax
+ \def\eq@@ST{P}\or
+ \def\eq@@ST{A}\else
+ \def\eq@@ST{P}\fi
+ \expandafter\@eqST\expandafter{\eq@@ST}\fi}{}
% \end{macrocode}
% Positioning keys, \texttt{position}\IndexKey{position} and \texttt{fitbounds}\IndexKey{fitbounds}
% \begin{macrocode}
\define@key{eforms}{position}{\@eqPA{#1}}
\define@choicekey{eforms}{fitbounds}[\val\nr]{true,false}[true]{%
- \ifx\annot@type\annot@type@button
+ \ifx\annot@type\annot@type@button
\ifcase\nr\relax
- \def\eq@@FB{true}\or
- \def\eq@@FB{false}\else
- \def\eq@@FB{false}\fi
- \expandafter\@eqFB\expandafter{\eq@@FB}\fi}{}
+ \def\eq@@FB{true}\or
+ \def\eq@@FB{false}\else
+ \def\eq@@FB{false}\fi
+ \expandafter\@eqFB\expandafter{\eq@@FB}\fi}{}
% \end{macrocode}
-% This set of key-values\IndexKey{norm}\IndexKey{roll}\IndexKey{down} are designed to fill in the AP dictionary for the check box
+% This set of key-values\IndexKey{norm}\IndexKey{roll}\IndexKey{down} are
+% designed to fill in the AP dictionary for the check box
% and the radio button field.
%\begin{verbatim}
% appr={norm={on={},off={}}},roll={on={},off={}}},down={on={},off={}}}}
@@ -4180,10 +4516,10 @@
\define@key{efappr}{roll}[]{\def\efappr@roll{#1}}
\define@key{efappr}{down}[]{\def\efappr@down{#1}}
\setkeys{efappr}{norm,roll,down}
-\define@key{efappr@state}{on}[]{%
- \expandafter\def\csname \ef@state @on\endcsname{#1}}
-\define@key{efappr@state}{off}[]{%
- \expandafter\def\csname \ef@state @off\endcsname{#1}}
+\define@key{efappr@state}{on}[]{\expandafter
+ \def\csname \ef@state @on\endcsname{#1}}
+\define@key{efappr@state}{off}[]{\expandafter
+ \def\csname \ef@state @off\endcsname{#1}}
\let\norm@on\@empty\let\norm@off\@empty
\let\roll@on\@empty\let\roll@off\@empty
\let\down@on\@empty\let\down@off\@empty
@@ -4192,22 +4528,22 @@
% and the radio button field.
%\begin{macrocode}
\define@key{eforms}{appr}{\setkeys{efappr}{#1}%
- \def\ef@state{norm}%
- \edef\ef@edef@tmp{\noexpand\setkeys{efappr@state}{\efappr@norm}}%
- \ef@edef@tmp\def\ef@state{roll}%
- \edef\ef@edef@tmp{\noexpand\setkeys{efappr@state}{\efappr@roll}}%
- \ef@edef@tmp\def\ef@state{down}%
- \edef\ef@edef@tmp{\noexpand\setkeys{efappr@state}{\efappr@down}}%
- \ef@edef@tmp\def\eq@AP{%
- /AP<<
- \ifx\efappr@norm\@empty\else/N <<
- \eq@On\space{\norm@on}/Off {\norm@off}>>\fi
- \ifx\efappr@roll\@empty\else/R <<
- \eq@On\space{\roll@on}/Off {\roll@off}>>\fi
- \ifx\efappr@down\@empty\else/D <<
- \eq@On\space{\down@on}/Off {\down@off}>>\fi
- \space>>
- }%
+ \def\ef@state{norm}%
+ \edef\ef@edef@tmp{\noexpand\setkeys{efappr@state}{\efappr@norm}}%
+ \ef@edef@tmp\def\ef@state{roll}%
+ \edef\ef@edef@tmp{\noexpand\setkeys{efappr@state}{\efappr@roll}}%
+ \ef@edef@tmp\def\ef@state{down}%
+ \edef\ef@edef@tmp{\noexpand\setkeys{efappr@state}{\efappr@down}}%
+ \ef@edef@tmp\def\eq@AP{%
+ /AP<<%
+ \ifx\efappr@norm\@empty\else/N <<%
+ \eq@On\space{\norm@on}/Off {\norm@off}>>\fi
+ \ifx\efappr@roll\@empty\else/R <<%
+ \eq@On\space{\roll@on}/Off {\roll@off}>>\fi
+ \ifx\efappr@down\@empty\else/D <<%
+ \eq@On\space{\down@on}/Off {\down@off}>>\fi
+ \space>>
+ }%
}
% \end{macrocode}%
% \subsection{Miscellaneous keys}
@@ -4216,31 +4552,31 @@
% \begin{macrocode}
\define@choicekey{eforms}{autocenter}[\val\nr]{yes,no}
{%
- \ifcase\nr\relax\@eqautoCenter{y}\or
- \@eqautoCenter{n}\fi
+ \ifcase\nr\relax\@eqautoCenter{y}\or
+ \@eqautoCenter{n}\fi
}{}
\define@choicekey{eforms}{inline}[\val\nr]{yes,no}
{%
- \ifcase\nr\relax\@eqinline{y}\or
- \@eqinline{n}\fi
+ \ifcase\nr\relax\@eqinline{y}\or
+ \@eqinline{n}\fi
}{}
\define@choicekey{eforms}{mlfix}[\val\nr]{yes,no}
{%
- \ifcase\nr\relax\@eqmlfix{y}\or
- \@eqmlfix{n}\fi
+ \ifcase\nr\relax\@eqmlfix{y}\or
+ \@eqmlfix{n}\fi
}{}
\define@choicekey{eforms}{importicons}[\val\nr]{yes,no}
{%
- \ifcase\nr\relax\@eqimportIcons{y}\or
- \@eqimportIcons{n}\fi
+ \ifcase\nr\relax\@eqimportIcons{y}\or
+ \@eqimportIcons{n}\fi
}{}
\define@key{eforms}{mlstrut}[\strut]{\@eqmlstrut{#1}}
\define@key{eforms}{mlcrackat}[]{\@eqmlcrackat{#1}}
\define@key{eforms}{mlcrackinat}[]{\@eqmlcrackinsat{#1}}
\define@choicekey{eforms}{mlhyph}[\val\nr]{yes,no}
{%
- \ifcase\nr\relax\@eqmlhyph{y}\or
- \@eqmlhyph{n}\fi
+ \ifcase\nr\relax\@eqmlhyph{y}\or
+ \@eqmlhyph{n}\fi
}{}
% \end{macrocode}
% \changes{v2.10}{2019/03/16}{Added \string\cs{cmd} to optional args of forms}
@@ -4279,33 +4615,77 @@
\ef@temp@expand
}
% \end{macrocode}
-% \texttt{symbolchoice}\IndexKey{symbolchoice}is used with a checkbox or radio button field. This sets the symbol
+% \texttt{symbolchoice}\IndexKey{symbolchoice} is used with a checkbox or radio button field. This sets the symbol
% that appears in the field with the box is checked, choices are
% \texttt{check}, \texttt{circle}, \texttt{cross}, \texttt{diamond},
% \texttt{square}, and \texttt{star}.
% \begin{macrocode}
\define@choicekey{eforms}{symbolchoice}[\val\nr]%
- {check,circle,cross,diamond,square,star}
- {\expandafter\@eqsymbolchoice\expandafter{\val}}{}
+ {check,circle,cross,diamond,square,star}
+ {\expandafter\@eqsymbolchoice\expandafter{\val}}{}
+% \end{macrocode}
+%\paragraph*{Set rectangle keys}
+%The dimensions of the bounding rectangle is generally passed to the widget
+%using required arguments; however, for \pkg{exerquiz}, those arguments are
+%not directly accessible. The \IndexKey{rectW}\key{rectW} and \IndexKey{rectH}\key{rectH}
+%may be used to pass the dimensions of the rectangle through the optional
+%optional argument of the field.
+% \begin{macrocode}
+\define@key{eforms}{rectW}{\@eqrectW{#1}}
+\define@key{eforms}{rectH}{\@eqrectH{#1}}
+% \end{macrocode}
+%\paragraph*{Resizing keys}
+%These keys resize the field while preserving the aspect ratio; these are
+%\IndexKey{width}\key{width}, \IndexKey{height}\key{height}, and \IndexKey{scalefactor}\key{scalefactor}
+% \begin{macrocode}
+\define@key{eforms}{width}{\@eqwidth{#1}}
+\define@key{eforms}{height}{\@eqheight{#1}}
+\define@key{eforms}{scalefactor}{\@eqscalefactor{#1}}
% \end{macrocode}
%
% \subsection{The Signed Tab}
%
% A signature field has a signed tab. On that tab is an option to mark a set of fields
-% as readonly (locked). The locked key controls that option.
+% as readonly (locked). The locked key controls that option.\medskip
%
-% The \texttt{lock}\IndexKey{lock} key is used with signature fields, currently, there is
-% no nice user interface to this key. Typical entries are
-%\begin{verbatim}
-% lock={/Action/All} % lock all fields in the doc
-% lock={/Action/Include % lock all fields listed in Fields
-% /Fields [(field1)(field2)...]}
-% lock={/Action/Exclude % lock all fields not listed in Fields
-% /Fields [(field1)(field2)...]}
-%\end{verbatim}
+% {\noindent}The \texttt{lock}\IndexKey{lock} key is used with signature fields.
+% Typical entries, using \emph{raw PDF markup}, are,
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars={!~@},codes={\catcode`\%=9}]
+%lock={/Action/All} !% !textsf~lock all fields in the doc@
+%lock={/Action/Include !% !textsf~lock all fields listed in Fields@
+% /Fields [(field1)(field2)...]}
+%lock={/Action/Exclude !% !textsf~lock all fields not listed in Fields@
+% /Fields [(field1)(field2)...]}
+%\end{Verbatim}
+%Simplified syntax for UF key-values:
+%\changes{v2.3.6}{2020/10/10}{Addition support for the \string\texttt{lock} key}
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars={!~@},codes={\catcode`\%=9}]
+%lock={action=all} !% !textsf~lock all fields in the doc@
+%lock={action=include,
+% fields={field1,field2,...}}!% !textsf~lock all fields listed in Fields@
+%lock={action=exclude,
+% fields{field1,field2,...}} !% !textsf~lock all fields not listed in Fields@
+%\end{Verbatim}
%
% \begin{macrocode}
-\define@key{eforms}{lock}{\@eqLock{#1}}
+\define@key{eforms}{lock}{\setkeys{lckflds}{#1}%
+ \ifx\lckFlds\@empty
+ \edef\ActnArgs{\noexpand\Action\noexpand\All}\else
+ \edef\ActnArgs{\noexpand\Action\expandafter
+ \noexpand\lckActnArg{\lckFlds}}\fi
+ \expandafter\@eqLock\expandafter{\ActnArgs}%
+}
+\define@choicekey{lckflds}{action}[\val\nr]{all,include,exclude}
+{%
+ \ifcase\nr\relax
+ \def\lckActnArg{\All}\or
+ \def\lckActnArg{\IncludeFields}\or
+ \def\lckActnArg{\ExcludeFields}\fi
+}{}
+\define@key{lckflds}{fields}{\def\lckFlds{#1}}
+\let\lckFlds\@empty
% \end{macrocode}
%
% Another option that is included in the Signed tab is titled ``This script executes
@@ -4344,18 +4724,13 @@
% Jump within the file
\def\ef@subtype{/S/GoTo }%
\ifcase\eq@drivernum
- \def\ef@formatpage{{Page\ef@page}}%
- \or
- \def\ef@formatpage{\pdfpageref\ef@page\space\space 0 R}%
- \or
- \def\ef@formatpage{@page\ef@page}%
- \fi
+ \def\ef@formatpage{{Page\ef@page}}\or
+ \def\ef@formatpage{\pdfpageref\ef@page\space\space 0 R}\or
+ \def\ef@formatpage{@page\ef@page}\fi
\let\ef@open\@empty
\let\ef@formatfile\@empty
\else
% Jump to another PDF
-% \ifx\ef@linktxtcolor@set0%
-% \def\ef@thislinkcolor{\@filecolor}\fi
\def\ef@subtype{/S/GoToR }%
\count0=\ef@page\advance\count0by-1
\edef\ef@formatpage{\the\count0 }%
@@ -4364,25 +4739,21 @@
\ifx\ef@goto@targetdest\@empty
\ifx\ef@labeldest\@empty
% we will jump to a page, it might be the default page
- \expandafter\@eqA\expandafter{\ef@subtype
- /D[\ef@formatpage\ef@view]%
- \ef@formatfile\ef@open}%
- \else
+ \expandafter\@eqA\expandafter{\ef@subtype
+ /D[\ef@formatpage\ef@view]\ef@formatfile\ef@open}\else
% jump to a label
- \expandafter\@eqA\expandafter{\ef@subtype%
- /D (\labelRef{\ef@labeldest})%
- \ef@formatfile\ef@open}%
- \fi
+ \expandafter\@eqA\expandafter{\ef@subtype%
+ /D (\labelRef{\ef@labeldest})%
+ \ef@formatfile\ef@open}\fi
\else
% jump to a target
- \expandafter\@eqA\expandafter{\ef@subtype%
- /D (\ef@goto@targetdest)%
- \ef@formatfile\ef@open}%
+ \expandafter\@eqA\expandafter{\ef@subtype%
+ /D (\ef@goto@targetdest)\ef@formatfile\ef@open}%
\fi
\else % go to url
\ifx\ef@goto@openparams\@empty
- \@eqA{/S/URI/URI(\ef@goto@url)}\else
- \@eqA{/S/URI/URI(\ef@goto@url\#\ef@goto@openparams)}%
+ \@eqA{/S/URI/URI(\ef@goto@url)}\else
+ \@eqA{/S/URI/URI(\ef@goto@url\#\ef@goto@openparams)}%
\fi
\fi
}
@@ -4458,7 +4829,7 @@
% \begin{macrocode}
\define@choicekey{efgoto}{open}[\val\nr]{userpref,new,existing}
{%
- \ifcase\nr\relax
+ \ifcase\nr\relax
\let\ef@open\@empty\or
\def\ef@open{/NewWindow true }\or
\def\ef@open{/NewWindow false }\fi
@@ -4479,20 +4850,20 @@
% (2017/01/03) Use \cs{cxkvsetkeys} for \texttt{launch}
% \changes{v2.9g}{2017/01/03}{Use \string\cs{cxkvsetkeys} for \string\texttt{launch}}
% \begin{macrocode}
- \cxkvsetkeys{eflaunch}{#1}%
- \@eqA{/S/Launch\ifx\ef@launch@file\@empty\else
- /F(\ef@launch@file)\fi\ef@launch@open
- \ifx\ef@launch@win\@empty\else
- /Win<<\ifx\ef@launchwin@file\@empty
- /F(\ef@launch@file)\else/F(\ef@launchwin@file)\fi
- \ifx\ef@launchwin@params\@empty\else
- /P(\ef@launchwin@params)\fi
- \ifx\ef@launchwin@open\@empty\else
- /O(\ef@launchwin@open)\fi
- \ifx\ef@launchwin@dir\@empty\else
- /D(\ef@launchwin@dir)\fi>>
- \fi
- }%
+ \cxkvsetkeys{eflaunch}{#1}%
+ \@eqA{/S/Launch\ifx\ef@launch@file\@empty\else
+ /F(\ef@launch@file)\fi\ef@launch@open
+ \ifx\ef@launch@win\@empty\else
+ /Win<<\ifx\ef@launchwin@file\@empty
+ /F(\ef@launch@file)\else/F(\ef@launchwin@file)\fi
+ \ifx\ef@launchwin@params\@empty\else
+ /P(\ef@launchwin@params)\fi
+ \ifx\ef@launchwin@open\@empty\else
+ /O(\ef@launchwin@open)\fi
+ \ifx\ef@launchwin@dir\@empty\else
+ /D(\ef@launchwin@dir)\fi>>
+ \fi
+ }%
}
% \end{macrocode}
% The value of the \texttt{file} key can be an application or a file. If a
@@ -4510,7 +4881,7 @@
% \begin{macrocode}
\define@choicekey{eflaunch}{open}[\val\nr]{userpref,new,existing}
{%
- \ifcase\nr\relax
+ \ifcase\nr\relax
\let\ef@launch@open\@empty\or
\def\ef@launch@open{/NewWindow true }\or
\def\ef@launch@open{/NewWindow false }\fi
@@ -4558,7 +4929,7 @@
% The \texttt{js}\IndexKey{js} key is used to execute JavaScript actions on a mouse up trigger.
% The argument is a JavaScript text string: |js={app.alert("Hello World!"}|.
% The value of \texttt{js} may be a macro containing JavaScript, which would include
-% a macro created by the \texttt{defineJS} environment of \textsf{insdljs}.
+% a macro created by the \env{defineJS} environment of \textsf{insdljs}.
% \begin{macrocode}
\define@key{eforms}{js}[]{\@eqA{\JS{#1}}}
% \end{macrocode}
@@ -4586,18 +4957,18 @@
% \end{itemize}
% \begin{macrocode}
\@tfor\ef@AActions:={{mouseup}{AAmouseup}}{{mousedown}{AAmousedown}}%
- {{onenter}{AAmouseenter}}{{onexit}{AAmouseexit}}%
- {{onfocus}{AAonfocus}}{{onblur}{AAonblur}}%
- {{format}{AAformat}}{{keystroke}{AAkeystroke}}%
- {{validate}{AAvalidate}}{{calculate}{AAcalculate}}%
- {{pageopen}{AApageopen}}{{pageclose}{AApageclose}}%
- {{pagevisible}{AApagevisible}}%
- {{pageinvisible}{AApageinvisible}}\do{%
- \expandafter\getargs\ef@AActions\ef@jstoks={#1}%
- \edef\temp@expand@def{\noexpand\define@key{eforms}{\aeb@argi}[]%
- {\noexpand\csname @eq\aeb@argii\noexpand\endcsname%
- {\the\ef@jstoks}}}%
- \temp@expand@def
+ {{onenter}{AAmouseenter}}{{onexit}{AAmouseexit}}%
+ {{onfocus}{AAonfocus}}{{onblur}{AAonblur}}%
+ {{format}{AAformat}}{{keystroke}{AAkeystroke}}%
+ {{validate}{AAvalidate}}{{calculate}{AAcalculate}}%
+ {{pageopen}{AApageopen}}{{pageclose}{AApageclose}}%
+ {{pagevisible}{AApagevisible}}%
+ {{pageinvisible}{AApageinvisible}}\do{%
+ \expandafter\getargs\ef@AActions\ef@jstoks={#1}%
+ \edef\temp@expand@def{\noexpand\define@key{eforms}{\aeb@argi}[]%
+ {\noexpand\csname @eq\aeb@argii\noexpand\endcsname%
+ {\the\ef@jstoks}}}%
+ \temp@expand@def
}
% \end{macrocode}
% The \texttt{objdef}\IndexKey{objdef} key is used to create indirect references to the form field.
@@ -4612,13 +4983,9 @@
% \end{macrocode}
%
% \section{Input Driver Specific Code}
-% Now bring in driver dependent macros. The macros defined are
-% the answer macros for the \texttt{shortquiz} environment and most all
-% for the \texttt{quiz} environment. These macros make heavy use of
-% JavaScript. The method of introducing these JavaScripts and
-% PDF code related elements depends on the driver.
-% \changes{v2.9j}{2017/01/22}{\string\cs{eq@rectH} and \string\cs{eq@rectW} pass through \string\cs{setlength}
-% to enable arithmetic for the arguments of those commands}
+% Now bring in driver dependent macros that support form fields.
+% \changes{v2.9j}{2017/01/22}{\string\cs{eq@rectH} and \string\cs{eq@rectW} pass
+% through \string\cs{setlength} to enable arithmetic for the arguments of those commands}
% \begin{macrocode}
%<*package>
% \end{macrocode}
@@ -4746,7 +5113,7 @@
\fi
\fi
\fi
- \ef@NewRadiosLateOpts
+ \ifuseNewRadios\expandafter\ef@NewRadiosLateOpts\fi
\ifx\eq@rectW\@empty\def\eq@rectW{\wd\eq@tmpbox}\fi
\pdf@rect{\lower\eqcenterWidget\ef@Bbox{\eq@rectW}{\eq@rectH}}%
\literalps@out{\AEB@psMrk
@@ -4988,7 +5355,7 @@
\fi
\fi
\fi
- \ef@NewRadiosLateOpts
+ \ifuseNewRadios\expandafter\ef@NewRadiosLateOpts\fi
\ifx\eq@rectW\@empty\def\eq@rectW{\wd\eq@tmpbox}\fi
\hbox{\pdfstartlink user{\common@RadioCode}%
\lower\eqcenterWidget\ef@Bbox{\eq@rectW}{\eq@rectH}\pdfendlink}%
@@ -5159,7 +5526,7 @@
\fi
\fi
\fi
- \ef@NewRadiosLateOpts
+ \ifuseNewRadios\expandafter\ef@NewRadiosLateOpts\fi
\ifx\eq@rectW\@empty\def\eq@rectW{\wd\eq@tmpbox}\fi
\HyField@AdvanceAnnotCount
\setbox\pdfm@box=%
@@ -5262,42 +5629,42 @@
var debugCalc=false;
ef_setCalcOrder.lastIndex=0;
function ef_setCalcOrder (a) {
- var o1, o2, f;
- while ( a.length > 0) {
- if (a.length > 1) {
- f=a.shift();
- o1=this.getField(f);
- if ( o1 == null ) {
- ef_CalcOrderErr(f);
- continue;
- }
- f = a[0];
- o2=this.getField(f);
- if ( o2 == null ) {
- ef_CalcOrderErr(f);
- a.shift();
- continue;
- }
- if ( o2.calcOrderIndex < o1.calcOrderIndex ) {
- o2.calcOrderIndex=o1.calcOrderIndex+1;
- ef_setCalcOrder.lastIndex=o2.calcOrderIndex;
- }
- } else {
- f=a.shift();
- o1=this.getField(f);
- if ( o1 == null ) {
- ef_CalcOrderErr(f);
- continue;
- }
- o1.calcOrderIndex=ef_setCalcOrder.lastIndex;
- }
+ var o1, o2, f;
+ while ( a.length > 0) {
+ if (a.length > 1) {
+ f=a.shift();
+ o1=this.getField(f);
+ if ( o1 == null ) {
+ ef_CalcOrderErr(f);
+ continue;
+ }
+ f = a[0];
+ o2=this.getField(f);
+ if ( o2 == null ) {
+ ef_CalcOrderErr(f);
+ a.shift();
+ continue;
+ }
+ if ( o2.calcOrderIndex < o1.calcOrderIndex ) {
+ o2.calcOrderIndex=o1.calcOrderIndex+1;
+ ef_setCalcOrder.lastIndex=o2.calcOrderIndex;
+ }
+ } else {
+ f=a.shift();
+ o1=this.getField(f);
+ if ( o1 == null ) {
+ ef_CalcOrderErr(f);
+ continue;
+ }
+ o1.calcOrderIndex=ef_setCalcOrder.lastIndex;
}
+ }
}
function ef_CalcOrderErr(f) {
- console.show(); app.beep(0);
- console.println("calcOrder: the field \""+ f
- + "\" does not exist in this document, skipping it.\n\n"
- + "calcOrder: Check the case sensitive spelling of the field.");
+ console.show(); app.beep(0);
+ console.println("calcOrder: the field \""+ f
+ + "\" does not exist in this document, skipping it.\n\n"
+ + "calcOrder: Check the case sensitive spelling of the field.");
}
var _EfCalcOrder=\efCalcOrder;
ef_setCalcOrder(_EfCalcOrder);
diff --git a/texmf-dist/source/latex/acrotex/exerquiz.dtx b/texmf-dist/source/latex/acrotex/exerquiz.dtx
index d75879e0..f478c87f 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> [2020/03/14 v8.5.10 %
+%<package|driver|aebjs|eqexam|randomize|sumrytbls|template> [2021/01/20 v8.6.2 %
%<package> Exerquiz: Exercises and Quizzes for LaTeX/PDF package (dps)]
%<driver> Exerquiz documentation driver file (dps)]
%<aebjs> Exerquiz document level JavaScript (dps)]
@@ -51,6 +51,7 @@
\let\env\texttt
\let\opt\texttt
\let\app\textsf
+\let\uif\textsf
\def\nmpsep#1{\hskip-\marginparsep\texttt{#1}}
\def\visispace{\symbol{32}}
\def\ameta#1{\ensuremath{\langle\textit{\texttt{#1}}\rangle}}
@@ -98,15 +99,21 @@
% \end{macrocode}
%\changes{v8.2.8}{2018/12/13}{The SOL file is now written entirely when there is no solution option specified}
% (v8.0 dated 2017/08/08) This version introduces multi-letter variables and what I'll term `alternate appearances'.
-% This is a major addition, changes are marked by \texttt{dps17} for future reference in case something goes wrong.
% \changes{v8.0}{2017/08/08}{Introduce multi-letter variables and alternate appearances. Changes
% made are marked by `\texttt{dps17}' throughout the DTX.}
% \changes{v7.7k}{2016/04/18}{Minor bug fixes, improved driver recognition}
% \changes{v7.7j}{2016/04/05}{Change in eforms to 2016/04/05 v2.8f}
%
+% \section{Introduction}
+%
+% The \pkg{exerquiz} package provides support for the creation of exercises and quizzes
+% with or without solutions. These are PDF form and link based. The packages provides ``intelligent'' evaluation
+% of the students' responses. This package also provides code for the \pkg{eqexam} package so that these
+% two packages are consistent in their approach.
+%
% \section{Package options and setup}\label{options}
%
-% Introduce a number of useful options for \textsl{exerquiz}.
+% Introduce a number of useful options for \pkg{exerquiz}.
% \subsection{Options for paper, solutions, JavaScript and preview}
% \begin{macrocode}
% Begin package segment
@@ -121,16 +128,17 @@
\RequirePackage{ifluatex}
\@ifundefined{exqtable}{\def\exqtable{table}}{}
\IfFileExists{xcolor.sty}{%
- \def\eq@ColorPackage{xcolor}%
- \PassOptionsToPackage{\exqtable,hyperref}{xcolor}}
- {\def\eq@ColorPackage{color}}
+ \def\eq@ColorPackage{xcolor}%
+ \PassOptionsToPackage{\exqtable,hyperref}{xcolor}}
+ {\def\eq@ColorPackage{color}}
% \end{macrocode}
-% \IndexOpt{noxcolor} An option to force
+% \leavevmode\IndexOpt{noxcolor}^^A
+% An option to force
% the use of the \textsf{color} package.
% \begin{macrocode}
\DeclareOption{noxcolor}{\def\eq@ColorPackage{color}}
% \end{macrocode}
-% \IndexOpt{forpaper}\IndexOpt{forcolorpaper}
+% \leavevmode\IndexOpt{forpaper}\IndexOpt{forcolorpaper}^^A
% Pass the |monochrome| option to the color package
%\changes{v6.06a}{2007/04/09}
%{
@@ -146,7 +154,7 @@
\AtBeginDocument{\ifnum\eq@drivernum=4 \else\AllowPeeking\fi}
}
% \end{macrocode}
-% \IndexOpt{preview}
+% \leavevmode\IndexOpt{preview}^^A
% With this option, the bounding boxes of all form fields appear in the
% dvi preview. Use this option of properly positioning your fields, then
% remove this option on the final build of the document. This option is no
@@ -154,13 +162,13 @@
% \begin{macrocode}
\DeclareOption{preview}{\PassOptionsToPackage{preview}{eforms}}
% \end{macrocode}
-% \IndexOpt{nosolutions}
+% \leavevmode\IndexOpt{nosolutions}^^A
% With the option, the solutions to the exercises are not
% included in the typeset document.
% \begin{macrocode}
\DeclareOption{nosolutions}{\eq@nosolutionstrue\eq@nolinktrue}
% \end{macrocode}
-% \IndexOpt{noquizolutions}
+% \leavevmode\IndexOpt{noquizolutions}^^A
% No solutions for quizzes (shortquiz and quiz environments).
% \begin{macrocode}
\DeclareOption{noquizsolutions}{\eq@noquizsolutionstrue\eq@nolinktrue}
@@ -177,7 +185,7 @@
\DeclareOption{online}{\let\eq@online\eq@YES}
\let\eq@online\eq@NO
% \end{macrocode}
-% \IndexOpt{nohiddensolutions}\IndexOpt{noHiddensolutions}
+% \leavevmode\IndexOpt{nohiddensolutions}\IndexOpt{noHiddensolutions}^^A
% Overrides any hidden solutions specified with the \texttt{exercise}
% environment.
% \begin{macrocode}
@@ -185,12 +193,12 @@
\DeclareOption{noHiddensolutions}%
{\eq@globalshowsolutionstrue\AtBeginDocument{\def\Hidesymbol{h}}}
% \end{macrocode}
-% \IndexOpt{solutionsafter}
+% \leavevmode\IndexOpt{solutionsafter}^^A
% Solutions will appear after the statement of the exercise.
% \begin{macrocode}
\DeclareOption{solutionsafter}{\eq@solutionsaftertrue\eq@nolinktrue}
% \end{macrocode}
-% \IndexOpt{solutionsonly}
+% \leavevmode\IndexOpt{solutionsonly}^^A
% Here is a highly specialized option, put in at the request of a former friend.
%\changes{v6.2f}{2007/12/21}{Added a solutionsonly option}
% \begin{macrocode}
@@ -202,7 +210,7 @@
\newif\ifsolutionsonly\solutionsonlyfalse
\@ifundefined{ifanswerkey}{\newif\ifanswerkey\answerkeyfalse}{}
% \end{macrocode}
-% \IndexOpt{contsolns}
+% \leavevmode\IndexOpt{contsolns}^^A
% This option requires both \textsf{web} and \textsf{exerquiz}. The package
% tests for the presence of the \textsf{web} and whether webheadings pagestyle
% is used.
@@ -214,25 +222,25 @@
\def\contsolnsErrorMsg{\PackageWarning{exerquiz}{contsolns option,
cannot find file contsolns.def}}
% \end{macrocode}
-% \IndexOpt{nocorrections}
+% \leavevmode\IndexOpt{nocorrections}^^A
% The code for correcting the |quiz| environment is
% not written; this results in a smaller file.
% \begin{macrocode}
\DeclareOption{nocorrections}{\nocorrectionstrue}
% \end{macrocode}
-% \IndexOpt{proofing}
+% \leavevmode\IndexOpt{proofing}^^A
% An option for marking the correct answers for shortquiz and quiz
% \begin{macrocode}
\DeclareOption{proofing}{\eq@proofingtrue}
% \end{macrocode}
-% \IndexOpt{showgrayletters}
+% \leavevmode\IndexOpt{showgrayletters}^^A
% When this option is in effect, capital letters in gray appear under
% the multiple choice question boxes of quizzes.
% \begin{macrocode}
\newif\ifaebshowgrayletters\aebshowgraylettersfalse
\DeclareOption{showgrayletters}{\aebshowgrayletterstrue}
% \end{macrocode}
-% \IndexOpt{vspacewithsolns}
+% \leavevmode\IndexOpt{vspacewithsolns}^^A
% This is for the \texttt{vspacewithsolns} option designed for
% \textsf{eqexam}, but can be used in \textsf{exerquiz}. The switch
% \cs{ifvspacewithsolns} is defined in \textsf{eqexam}, and we only
@@ -253,7 +261,7 @@
\providecommand\displayworkareaOn{\displayworkareatrue}
\providecommand\displayworkareaOff{\displayworkareafalse}
% \end{macrocode}
-% \IndexOpt{nodljs}
+% \leavevmode\IndexOpt{nodljs}^^A
% An option for excluding all DLJS from the document. Useful with the
% \texttt{forpaper} option, or a document destined to be printed. Pass
% on to insdljs package.
@@ -261,24 +269,24 @@
\DeclareOption{nodljs}{\PassOptionsToPackage{nodljs}{insdljs}%
\AtEndOfPackage{\let\importdljs\eq@YES}}
% \end{macrocode}
-% \IndexOpt{execAfter}
+% \leavevmode\IndexOpt{execAfter}^^A
% Execute any JS defined within the \texttt{execJS} environment. Works only for
% authors using Acrobat 5.0 or Acrobat Approval.
% \begin{macrocode}
\DeclareOption{execJS}{\PassOptionsToPackage{execJS}{insdljs}}
% \end{macrocode}
-% \IndexOpt{exercisesonly}
+% \leavevmode\IndexOpt{exercisesonly}^^A
% If the document author wants only to create a series of exercises, no quizzes, there is no
% need for the Document-level JavaScript. So, we have a couple of convenience options.
% \begin{macrocode}
\DeclareOption{exercisesonly}{\PassOptionsToPackage{nodljs}{insdljs}}
% \end{macrocode}
-% \IndexOpt{debug}
+% \leavevmode\IndexOpt{debug}^^A
% An option for debugging JavaScript. Pass on to insdljs package.
% \begin{macrocode}
\DeclareOption{debug}{\PassOptionsToPackage{debug}{insdljs}}
% \end{macrocode}
-% \IndexOpt{allowrandomize}
+% \leavevmode\IndexOpt{allowrandomize}^^A
% Beginning with version 6.1 of \textsf{exerquiz}, it is possible to randomize
% the choices in a multiple choice question. These choices must be set off
% by the command \cs{bChoices}/\cs{eChoices} pair. The command \cs{bChoices} now has
@@ -289,7 +297,8 @@
{\PackageInfo{exerquiz}{inputting aebrandom.def}}
{cannot find aebrandom.def}}
% \end{macrocode}
-% \IndexOpt{usesumrytbls}
+% \leavevmode\IndexOpt{usesumrytbls}^^A
+% The declare the use of summary tables
% \begin{macrocode}
\newif \ifusesumrytbls \usesumrytblsfalse
\DeclareOption{usesumrytbls}{\usesumrytblstrue
@@ -365,7 +374,7 @@
\PassOptionsToPackage{xetex}{eforms}%
}
% \end{macrocode}
-% \IndexOpt{textures}
+% \leavevmode\IndexOpt{textures}^^A
% This option, and testing are due to Ross Moore 3/6/02
% \begin{macrocode}
\DeclareOption{textures}{\def\eq@drivernum{3}%
@@ -374,7 +383,7 @@
\PassOptionsToPackage{textures}{eforms}%
}
% \end{macrocode}
-% \IndexOpt{dviwindo}
+% \leavevmode\IndexOpt{dviwindo}^^A
% Set \cmd{\eq@noformstrue}, this inserts an \cmd{\endinput} just after
% the end of the |exercise| environment. No quizzes for
% \texttt{dviwindo}.
@@ -388,7 +397,7 @@
% \def\eq@drivernum{5}
% \def\eq@driver{dvipsone/dvips}
% \def\eq@driver{no driver specified}
-% \IndexOpt{unicode}
+% \leavevmode\IndexOpt{unicode}^^A
% Passes the unicode option to \textsf{hyperref}.
% \changes{v6.3}{2008/03/19}
% {
@@ -397,7 +406,7 @@
% \begin{macrocode}
\DeclareOption{unicode}{\PassOptionsToPackage{unicode}{hyperref}}
% \end{macrocode}
-% \IndexOpt{useui}
+% \leavevmode\IndexOpt{useui}^^A
% Passes the useui option to eforms. With this option,
% the key-value pairs \textsl{\'{a} la xkeyval} can be used.
% \changes{v6.3}{2008/03/19}
@@ -419,7 +428,7 @@
% \begin{macrocode}
\let\LangRedefinitions\relax
% \end{macrocode}
-% \IndexOpt{french}
+% \leavevmode\IndexOpt{french}^^A
% Translations due to Jean-Michel SARLAT.
% \begin{macrocode}
\DeclareOption{french}{%
@@ -428,7 +437,7 @@
{\PackageInfo{exerquiz}{French Option: Cannot find the file
eqfr.def, using the default, English.}}}}
% \end{macrocode}
-% \IndexOpt{german}
+% \leavevmode\IndexOpt{german}^^A
% Translation due to Michael Wiedmann.
% \begin{macrocode}
\DeclareOption{german}{%
@@ -437,7 +446,7 @@
{\PackageInfo{exerquiz}{German Option: Kann die Datei eqde.def
nicht finden, benutze Default, Englisch.}}}}
% \end{macrocode}
-% \IndexOpt{norsk}
+% \leavevmode\IndexOpt{norsk}^^A
% Translation due to Hans Fredrik Nordhaug.
% \begin{macrocode}
\DeclareOption{norsk}{%
@@ -446,7 +455,7 @@
{\PackageInfo{exerquiz}{Norsk Option: Cannot find the file eqno.def,
using the default, English.}}}}
% \end{macrocode}
-% \IndexOpt{dutch}
+% \leavevmode\IndexOpt{dutch}^^A
% Translation due to Henny Wilbrink
% \begin{macrocode}
\DeclareOption{dutch}{%
@@ -455,7 +464,7 @@
{\PackageInfo{exerquiz}{Dutch Option: Kan bestand eqnl.def niet
vinden, gebruik default, Engels.}}}}
% \end{macrocode}
-% \IndexOpt{spanish}
+% \leavevmode\IndexOpt{spanish}^^A
% Translation due to Pedro Luis Luque
% \begin{macrocode}
\DeclareOption{spanish}{%
@@ -464,7 +473,7 @@
{\PackageInfo{exerquiz}{Spanish Option: Opci\'on Espa\~nola: no puede
encontrar el fichero eqes.def, usar\'a por defecto, English.}}}}
% \end{macrocode}
-% \IndexOpt{italian}
+% \leavevmode\IndexOpt{italian}^^A
% Translation due to PierLuigi Zezza
% \begin{macrocode}
\DeclareOption{italian}{%
@@ -473,7 +482,7 @@
{\PackageInfo{exerquiz}{pzione Italiano: Non trovo il file eqit.def,
utilizzo quello di default, English.}}}}
% \end{macrocode}
-% \IndexOpt{russian}
+% \leavevmode\IndexOpt{russian}^^A
% Translation due to Sergei V. Znamenskii
% \begin{macrocode}
\DeclareOption{russian}{%
@@ -486,7 +495,7 @@
{\PackageInfo{exerquiz}{Russian Option: Cannot find the file
eqru.def, using the default, English.}}}}
% \end{macrocode}
-% \IndexOpt{dansk}
+% \leavevmode\IndexOpt{dansk}^^A
% Translation due to Erik Leimand
% \begin{macrocode}
\DeclareOption{dansk}{%
@@ -495,7 +504,7 @@
{\PackageInfo{exerquiz}{Dansk Option: Cannot find the file eqda.def,
using the default, English.}}}}
% \end{macrocode}
-% \IndexOpt{polish}
+% \leavevmode\IndexOpt{polish}^^A
% Translation due to Jerzy Mycielski
% \begin{macrocode}
\DeclareOption{polish}{%
@@ -504,7 +513,7 @@
{\PackageInfo{exerquiz}{Polish Option: Cannot find the file
eqpo.def, using the default, English.}}}}
% \end{macrocode}
-% \IndexOpt{finnish}
+% \leavevmode\IndexOpt{finnish}^^A
% Translation due to Paivi Porras
% \begin{macrocode}
\DeclareOption{finnish}{%
@@ -513,7 +522,7 @@
{\PackageInfo{exerquiz}{Finnish Option: Cannot find the file
eqfin.def, using the default, English.}}}}
% \end{macrocode}
-% \IndexOpt{catalan}
+% \leavevmode\IndexOpt{catalan}^^A
% Translation due to Ramon Ballester
% \begin{macrocode}
\DeclareOption{catalan}{%
@@ -522,7 +531,7 @@
{\PackageInfo{exerquiz}{Catalan Option: Cannot find the file
eqcat.def, using the default, English.}}}}
% \end{macrocode}
-% \IndexOpt{czech}
+% \leavevmode\IndexOpt{czech}^^A
% Translation due to Robert Marik
% \begin{macrocode}
\DeclareOption{czech}{%
@@ -531,7 +540,7 @@
{\PackageInfo{exerquiz}{Czech Option: Cannot find the file eqcz.def,
using the default, English.}}}}
% \end{macrocode}
-% \IndexOpt{brazil}
+% \leavevmode\IndexOpt{brazil}^^A
% Translation due to Koichi Sameshima
% \begin{macrocode}
\DeclareOption{brazil}{%
@@ -541,7 +550,7 @@
n\~ao foi poss\'ivel encontrar o arquivo eqbr.def, usaremos
o padr\~ao, English.}}}}
% \end{macrocode}
-% \IndexOpt{turkish}
+% \leavevmode\IndexOpt{turkish}^^A
% Translation due to Mahmut Ko\c{c}ak
% \begin{macrocode}
\DeclareOption{turkish}{%
@@ -690,6 +699,7 @@
% \begin{macrocode}
\newif\ifeq@randomizeChoices \eq@randomizeChoicesfalse
\newif\ifeq@randomizeallChoices \eq@randomizeallChoicesfalse
+\newif\if@DoNotRandomize \@DoNotRandomizefalse
% \end{macrocode}
% \begin{macro}{\turnOnRandomize}
% \begin{macro}{\obeyLocalRandomize}
@@ -705,6 +715,20 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \begin{macro}{\doNotRandomizeChoices}
+% \begin{macro}{\allowRandomizedChoices}
+% These two commands allow for finer control over whether to randomize choices
+% or not. Expanding \cs{doNoRandomizeChoices} overrides the \opt{allowrandomize}
+% option; whereas \cs{allowRandomizedChoices} restores the original behavior
+% set by the \opt{allowrandomize} option.
+% \changes{v8.6.2}{2021/01/20}{Added \string\cs{doNoRandomizeChoices} and
+% \string\cs{allowRandomizedChoices}}
+% \begin{macrocode}
+\def\doNotRandomizeChoices{\@DoNotRandomizetrue}
+\def\allowRandomizedChoices{\@DoNotRandomizefalse}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
% These\DescribeMacro{\saveRandomSeed}\DescribeMacro{\inputRandomSeed} two
% commands are used when the \texttt{allowrandomize} option is in effect, Until
% then, they do nothing. See the definition in \autoref{randomize}.
@@ -3717,8 +3741,8 @@
% \section{Common code for quizzes.}
% Here, we include a few commands common to both
% quiz environments.
-%
-% Colors used by \textsf{exerquiz}: \texttt{webgreen} normally defined in \textsf{web}
+%\medskip\par\noindent
+% Colors used by \textsf{exerquiz}: \texttt{webgreen} normally defined in \textsf{web}.
% \begin{macrocode}
\definecolor{webgreen}{rgb}{0,.6,0}
% \end{macrocode}
@@ -3786,23 +3810,25 @@
\define@key{props@ques}{labelwidth}[]{\def\propQ@labelwidth{#1}}
\let\propQ@labelwidth\@empty
% \end{macrocode}
-% \IndexKey{topsep}\texttt{topsep}, \IndexKey{partopsep}\texttt{partopsep},
+% \leavevmode\IndexKey{topsep}^^A
+% \texttt{topsep}, \IndexKey{partopsep}\texttt{partopsep},
% \IndexKey{parsep}\texttt{parsep}, and \IndexKey{itemsep}\texttt{itemsep}.
% \begin{macrocode}
\define@key{props@ques}{topsep}[\the\topsep]{\edef\propQ@topsep{#1}}
\define@key{props@ques}{partopsep}[\the\partopsep]%
- {\edef\propQ@partopsep{#1}}
+ {\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}}
% \end{macrocode}
-% \IndexKey{labelsepTo}\texttt{labelsepTo} and \IndexKey{labelsep}\texttt{labelsep}
+% \leavevmode\IndexKey{labelsepTo}\texttt{labelsepTo} and \IndexKey{labelsep}\texttt{labelsep}
% \begin{macrocode}
\define@key{props@ques}{labelsepTo}[\normalsize\normalfont\ ]%
- {\def\propQ@labelsepTo{#1}}
+ {\def\propQ@labelsepTo{#1}}
\define@key{props@ques}{labelsep}[\@empty]{\def\propQ@labelsep{#1}}
\let\propQ@labelsep\@empty
% \end{macrocode}
-% \IndexKey{color}\texttt{color}
+% \leavevmode\IndexKey{color}^^A
+% A color key set the color of the numbers in a question environment.
% \begin{macrocode}
\define@key{props@ques}{color}[blue]{\quesNumColor{#1}}
% \end{macrocode}
@@ -3814,42 +3840,41 @@
% Now we begin the \texttt{questions} environment. There is an optional parameter
% wherein we pass the key-value pairs defined above.
% \begin{macrocode}
-\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
- \insE@rlyAtQues\gdef\eqPTs{1}%
- \global\let\eqQT\eq@na%
+\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
+ \insE@rlyAtQues\gdef\eqPTs{1}%
+ \global\let\eqQT\eq@na%
% \end{macrocode}
% (06/06/10) We create a macro \cs{@currentQues} that holds the current
% problem number 2(a)(i), for example.
% \begin{macrocode}
- {\@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}%
+ {\@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}%
% \end{macrocode}
% We set the list parameter for the \texttt{questions} environment.
% \begin{macrocode}
\ifx\propQ@labelsep\@empty
- \settowidth{\labelsep}{\propQ@labelsepTo}\else
- \setlength{\labelsep}{\propQ@labelsep}\fi
+ \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
+ \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
@@ -3951,10 +3976,10 @@
% \begin{macrocode}
\newenvironment{shortquiz*}
{%
- \xdef\eq@pageThisQ{\the\c@page}%
- {\eqtmpcnta\@shortquizCnt\relax\advance\eqtmpcnta\@ne
- \xdef\@shortquizCnt{\the\eqtmpcnta}}%
- \sqForms\@shortquiz
+ \xdef\eq@pageThisQ{\the\c@page}%
+ {\eqtmpcnta\@shortquizCnt\relax\advance\eqtmpcnta\@ne
+ \xdef\@shortquizCnt{\the\eqtmpcnta}}%
+ \sqForms\@shortquiz
}{\aeb@endshortquiz}
% \end{macrocode}
% Determines if the next argument is optional, if yes, we pass to
@@ -3962,7 +3987,7 @@
% continue to \cs{@@shortquiz}.
% \begin{macrocode}
\def\@shortquiz{\@ifnextchar[%
- {\@@shortquiz}{\@@shortquiz[\@sqGenBaseName]}}
+ {\@@shortquiz}{\@@shortquiz[\@sqGenBaseName]}}
% \end{macrocode}
% \end{environment}
% \cs{@@shortquiz} continues the parsing of \texttt{shortquiz} and \texttt{shortquiz*}.
@@ -3970,8 +3995,8 @@
% as a delimited parameter \texttt{\#1}.
% \begin{macrocode}
\def\sq@setCLN#1{\ifx\aebTitleQuiz\@empty
- \protected@edef\@currentlabelname{#1}\else
- \protected@edef\@currentlabelname{\@currentlabelname}\fi
+ \protected@edef\@currentlabelname{#1}\else
+ \protected@edef\@currentlabelname{\@currentlabelname}\fi
}
% \end{macrocode}
% (2013/09/29) Added \cs{isQZ} and \cs{isSQZ}
@@ -3979,37 +4004,53 @@
\let\isQZ=q \let\isSQZ=s
%</package|eqexam>
%<*package>
-\def\sq@IDTxtField{\makebox[0pt][l]{\textField[\autoCenter{n}\BC{}\BG{}
- \S{S}\textSize{0}\Ff{\FfReadOnly}
- \AA{\AAFormat{%
- if (typeof \oField=="undefined")\r\t
- var \oField=new Object;\r
- \oField.Grp={};
- \ifx\defaultColorJSLoc\@empty\else\r
- \oField.DefaultColorJSLoc=\defaultColorJSLoc;\fi
- \ifx\rghtColorJSLoc\@empty\else\r
- \oField.RightColorJSLoc=\rghtColorJSLoc;\fi
- \ifx\wrngColorJSLoc\@empty\else\r
- \oField.WrongColorJSLoc=\wrngColorJSLoc;\fi
- \ifx\rghtAnsSymbJSLoc\@empty\else\r
- \oField.RightAnsSymbJSLoc=\rghtAnsSymbJSLoc;\fi
- \ifx\wrngAnsSymbJSLoc\@empty\else\r
- \oField.WrongAnsSymbJSLoc=\wrngAnsSymbJSLoc;\fi
-}}]{sqID\oField}{2bp}{2bp}}%
-}
-\def\qz@IDTxtField{\makebox[0pt][l]{\textField[\autoCenter{n}\BC{}\BG{}
+% \end{macrocode}
+% The hidden ID field for a short-quiz
+% \begin{macrocode}
+\def\sq@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");\r
+ \AA{\AAFormat{%
+ if\eqSP(typeof\eqSP\oField=="undefined")\eqSP
+ var\eqSP\oField=new\eqSP Object;\r
+ \oField.Grp={};%
+ \ifx\defaultColorJSLoc\@empty\else\r
+ \oField.DefaultColorJSLoc=\defaultColorJSLoc;\fi
+ \ifx\rghtColorJSLoc\@empty\else\r
+ \oField.RightColorJSLoc=\rghtColorJSLoc;\fi
+ \ifx\wrngColorJSLoc\@empty\else\r
+ \oField.WrongColorJSLoc=\wrngColorJSLoc;\fi
+ \ifx\rghtAnsSymbJSLoc\@empty\else\r
+ \oField.RightAnsSymbJSLoc=\rghtAnsSymbJSLoc;\fi
+ \ifx\wrngAnsSymbJSLoc\@empty\else\r
+ \oField.WrongAnsSymbJSLoc=\wrngAnsSymbJSLoc;\fi
+ }}]{sqID\oField}{2bp}{2bp}}%
+}
+% \end{macrocode}
+% The \uif{Format} code for the hidden quiz ID text field.
+%\changes{v8.6}{2020/11/29}{\string\cs{qz@IDTxtField}: Format code now in \string\env{defineJS}}
+% \begin{macrocode}
+\begin{defineJS}[\makeesc\!\makecmt\%]{\qzIDFmt}
+if(typeof aQuizzesInDoc=="undefined")
+ var aQuizzesInDoc=new Array();
+if (aQuizzesInDoc.indexOf("!oField"))
+ aQuizzesInDoc.push("!oField");
% \end{macrocode}
% (2019/06/22) Added in declaration of quiz object.
%\changes{v8.2.12}{2019/06/22}{Added declaration of quiz object}
% \begin{macrocode}
- if (typeof \oField=="undefined")\r\t
- var \oField=new Object;\r
- }}]{qzID\oField}{2bp}{2bp}}}
+if (typeof !oField=="undefined")
+ var !oField=new Object;
+\end{defineJS}
+% \end{macrocode}
+% The hidden text field for quizzes. The role of this field is to initialize things
+% for the associated quiz. This field has \uif{Format} code (\cs{qzIDFmt}), and the \app{Reader} will
+% execute this code when the page is opened. The code creates a new array \texttt{aQuizzesInDoc}, if needed,
+% and adds this quiz to the list of quizzes in the doc. Refer to \cs{qzIDFmt} above.
+% \begin{macrocode}
+\def\qz@IDTxtField{\makebox[0pt][l]{\textField[\autoCenter{n}\BC{}\BG{}
+ \S{S}\textSize{0}\Ff{\FfReadOnly}
+ \AA{\AAFormat{\qzIDFmt}}]{qzID\oField}{2bp}{2bp}}}
%</package>
%<*package|eqexam>
\let\eqQuizType\relax
@@ -4030,7 +4071,7 @@
\let\@Ans\Ans@sq@f
\ifx\oField\@empty
\typeout{^^JExerquiz: Base field name required when using
- shortquiz with '*' option}%
+ shortquiz with '*' option}%
\PackageInfo{exerquiz}{Assuming link style^^J}%
\let\@Ans\Ans@sq@l
\fi
@@ -4060,21 +4101,21 @@
% a \cs{@gobbletwo}, this eats up the next two tokens that immediately
% follow \cs{sqlabel} in the beginning of the \texttt{shortquiz} environment.
% \begin{macrocode}
- \def\sqlabel{\aebtitleQuiz\@gobbletwo}%
+ \def\sqlabel{\aebtitleQuiz\@gobbletwo}%
\fi
% \end{macrocode}
% When the online (or email) options are used in eqexam, the \cs{hypertarget}
% command is adding vertical space. Normally \cs{sqlabel} is empty, so we don't
% need \cs{hypertarget} in this case here.
% \begin{macrocode}
- \sq@aboveskip\sq@priorhook
- \@ifundefined{PointsOnLeft}%
- {\sq@setCLN{\eq@defaultShortQuizLabelName}%
- \ifx\sqlabel\@empty\else\noindent\fi
- \hypertarget{sqH\@currentHref}{}\sq@IDTxtField
- \ifx\sqlabel\@empty\else\expandafter
- \sqlabel\expandafter\sqhspace\fi
- {\set@typeset@protect\aebtitleQuiz}}{}\ignorespaces
+ \sq@aboveskip\sq@priorhook
+ \@ifundefined{PointsOnLeft}%
+ {\sq@setCLN{\eq@defaultShortQuizLabelName}%
+ \ifx\sqlabel\@empty\else\noindent\fi
+ \hypertarget{sqH\@currentHref}{}\sq@IDTxtField
+ \ifx\sqlabel\@empty\else\expandafter
+ \sqlabel\expandafter\sqhspace\fi
+ {\set@typeset@protect\aebtitleQuiz}}{}\ignorespaces
%</package>
%<eqexam> \sq@aboveskip\sq@priorhook\ignorespaces
%<*package|eqexam>
@@ -4336,19 +4377,19 @@
% \begin{macrocode}
\let\prior@quizSolnHeaderHook\@empty
\newcommand\quizSolnHeader[3][]{%
- \prior@quizSolnHeaderHook
- \ifeqforpaper\else\webnewpage\fi\noindent
+ \prior@quizSolnHeaderHook
+ \ifeqforpaper\else\webnewpage\fi\noindent
%</package|eqexam>
%<*package>
- \def\eq@argi{#1}%
- \ifx\eq@argi\@empty\else\noPeek#1\fi
- \hypertarget{#2}{#3}\relax
+ \def\eq@argi{#1}%
+ \ifx\eq@argi\@empty\else\noPeek#1\fi
+ \hypertarget{#2}{#3}\relax
%</package>
%<*eqexam>
- #2%
+ #2%
%</eqexam>
%<*package|eqexam>
- \solnspace
+ \solnspace
}
%</package|eqexam>
%<*package>
@@ -4378,7 +4419,7 @@
% when he is not authorized to).
% \begin{macrocode}
\def\noPeekAction#1#2{%
- /AA <</O<</S/JavaScript/JS(noPeek("#1",#2))>> >>
+ /AA <</O<</S/JavaScript/JS(noPeek("#1",#2))>> >>
}
%</package>
%<*package|eqexam>
@@ -4399,14 +4440,14 @@
% \cmd{\relax}.
% \begin{macrocode}
\def\includequizsolutions{\@ifstar
- {\let\resetQZtsolns\relax\includequizsolutionsi}
- {\def\resetQZtsolns{\global\let\include@quizsolutions\relax}%
- \includequizsolutionsi}}
+ {\let\resetQZtsolns\relax\includequizsolutionsi}
+ {\def\resetQZtsolns{\global\let\include@quizsolutions\relax}%
+ \includequizsolutionsi}}
\newcommand{\includequizsolutionsi}[1][]{%
- \filterFor{#1}\includequizsolutionsii}
+ \filterFor{#1}\includequizsolutionsii}
\def\includequizsolutionsii{\include@quizsolutions
- \resetQZtsolns
- \let\eqFilterArg\@empty}
+ \resetQZtsolns
+ \let\eqFilterArg\@empty}
%</package|eqexam>
%<*package>
% \end{macrocode}
@@ -4460,11 +4501,11 @@
% \begin{macrocode}
\newcommand{\quizSolnInput}
{%
- \global\let\webnewpage\relax
- \bgroup\OKToWriteExamDatatrue
- \writeT@QzSolns{\string\endinput}\egroup
- \immediate\closeout\quiz@solns
- \ifeq@noquizsolutions\else
+ \global\let\webnewpage\relax
+ \bgroup\OKToWriteExamDatatrue
+ \writeT@QzSolns{\string\endinput}\egroup
+ \immediate\closeout\quiz@solns
+ \ifeq@noquizsolutions\else
% \end{macrocode}
% If there are quiz solutions, we start a new page, and clear the right mark.
% We execute \cmd{\eq@normallheader} which sets the running left header,
@@ -4473,30 +4514,30 @@
% with \cmd{\sqslsecrunhead}, makes it easier to define running headers
% when solutions are filtered.
% \begin{macrocode}
- \iftherearequizsolutions\newpage\markright{}%
- \eq@normallheader\markright{\sqslsecrunhead}%
- \ifx\webnewpage\relax
- \def\webnewpage{\global\let\webnewpage\newpage}\fi
+ \iftherearequizsolutions\newpage\markright{}%
+ \eq@normallheader\markright{\sqslsecrunhead}%
+ \ifx\webnewpage\relax
+ \def\webnewpage{\global\let\webnewpage\newpage}\fi
% \end{macrocode}
% Here we have various prior commands, and the setting of the
% section title.
% \begin{macrocode}
- \priorsqslsectitle\quizSolnsHeadnToc\priorsqslinput
+ \priorsqslsectitle\quizSolnsHeadnToc\priorsqslinput
% \end{macrocode}
% Now input the solution file \cmd{\jobname.qsl}.
% \begin{macrocode}
- \InputIfFileExists{\jobname.qsl}{}%
- {!!! Solutions to quizzes not found}
+ \InputIfFileExists{\jobname.qsl}{}%
+ {!!! Solutions to quizzes not found}
% \end{macrocode}
% A hook for hanging things
% \begin{macrocode}
- \eqqzsolutionshook
+ \eqqzsolutionshook
% \end{macrocode}
% Reset the running header cleanly
% \begin{macrocode}
- \newpage\eq@defaultlheader
- \fi
+ \newpage\eq@defaultlheader
\fi
+ \fi
}
% \end{macrocode}
% The internal command that insert solutions. This command
@@ -4540,35 +4581,35 @@
% \cs{defaultquiztype}.
% \begin{macrocode}
\newcommand{\quiztype}[1]{%
- \def\@quiztype{#1}\def\aeb@FLOverride{#1}}
+ \def\@quiztype{#1}\def\aeb@FLOverride{#1}}
\let\@quiztype\@empty
\newcommand{\defaultquiztype}{\let\@quiztype\@empty
- \let\aeb@FLOverride\relax}
+ \let\aeb@FLOverride\relax}
\let\aeb@FLOverride\relax
% \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macrocode}
\def\@setFormLinkType{%
- \if\qstar*%
- \ifx\aeb@FLOverride\relax%
- \def\@@quiztype{f}%
- \else
- \if\aeb@FLOverride l\def\@@quiztype{l}\else
- \def\@@quiztype{f}\fi
- \fi
+ \if\qstar*%
+ \ifx\aeb@FLOverride\relax%
+ \def\@@quiztype{f}%
\else
- \ifx\aeb@FLOverride\relax
- \def\@@quiztype{l}%
- \else
- \if\aeb@FLOverride f\def\@@quiztype{f}\else
- \def\@@quiztype{l}\fi
- \fi
+ \if\aeb@FLOverride l\def\@@quiztype{l}\else
+ \def\@@quiztype{f}\fi
\fi
+ \else
+ \ifx\aeb@FLOverride\relax
+ \def\@@quiztype{l}%
+ \else
+ \if\aeb@FLOverride f\def\@@quiztype{f}\else
+ \def\@@quiztype{l}\fi
+ \fi
+ \fi
}
\def\setdefault@Ans{\@setFormLinkType
- \expandafter\global\expandafter
- \let\expandafter\@Ans\expandafter=\csname Ans@\@@quiztype\endcsname
+ \expandafter\global\expandafter
+ \let\expandafter\@Ans\expandafter=\csname Ans@\@@quiztype\endcsname
}
% \end{macrocode}
% \begin{macro}{\useForms}
@@ -4626,36 +4667,36 @@
% question label, i.e., \texttt{2(a)(ii)}. These two lines are repeated for
% the \texttt{oQuestion} and \texttt{shortquiz} environments.
% \begin{macrocode}
- \xdef\eq@pageThisQ{\the\c@page}%
- \let\@currentQues\@empty
- \global\let\eqQzQuesList\@empty
- \global\let\pointValuesArray\@empty
+ \xdef\eq@pageThisQ{\the\c@page}%
+ \let\@currentQues\@empty
+ \global\let\eqQzQuesList\@empty
+ \global\let\pointValuesArray\@empty
% \end{macrocode}
% Initialize \texttt{ptypeArray} to track problem types better
% \changes{v7.7m}{2016/07/04}{Initialize \string\texttt{ptypeArray} to track problem types better}
% \begin{macrocode}
- \global\let\ptypeArray\@empty
+ \global\let\ptypeArray\@empty
% \end{macrocode}
% Initialize \texttt{corrAnsArray} to track the correct answers
% \changes{v7.7n}{2016/07/06}{Initialize \string\texttt{ptypeArray} to track problem types better}
% \begin{macrocode}
- \global\let\corrAnsArray\@empty
+ \global\let\corrAnsArray\@empty
% \end{macrocode}
% Update the internal quiz counter.
% \begin{macrocode}
- {\eqtmpcnta\@quizCnt\advance\eqtmpcnta\@ne
- \xdef\@quizCnt{\the\eqtmpcnta}}%
+ {\eqtmpcnta\@quizCnt\advance\eqtmpcnta\@ne
+ \xdef\@quizCnt{\the\eqtmpcnta}}%
% \end{macrocode}
% We try to support {\LaTeX}'s cross-referencing system by defining
% \cs{@currentlabel}, \cs{@currentHlabel}, and \cs{@currentlabelname}.
% \begin{macrocode}
- \edef\@currentlabel{\@quizCnt}%
- \edef\@currentHref{quiz.\@quizCnt}%
- \sq@setCLN{\eq@defaultQuizLabelName}%
- \setcounter{eqpointvalue}{0}\setcounter{questionno}{0}%
- \eq@initializeServerSubmit
- \global\let\eqQuizType\isQZ %\tabcolsep=0pt
- \gdef\eqPTs{1}\global\let\eqQT\eq@na
+ \edef\@currentlabel{\@quizCnt}%
+ \edef\@currentHref{quiz.\@quizCnt}%
+ \sq@setCLN{\eq@defaultQuizLabelName}%
+ \setcounter{eqpointvalue}{0}\setcounter{questionno}{0}%
+ \eq@initializeServerSubmit
+ \global\let\eqQuizType\isQZ %\tabcolsep=0pt
+ \gdef\eqPTs{1}\global\let\eqQT\eq@na
% \end{macrocode}
% \changes{v6.3u}{2010/11/04}{%
% Added \cs{xdef}\cs{oField}\texttt{\{\#2\}}, this is
@@ -4663,31 +4704,32 @@
% Add \cs{listOfQuizNames} to track quizzes
% \changes{v7.8k}{2017/07/25}{Added \string\cs{listOfQuizNames} to track quizzes}
% \begin{macrocode}
- \g@addto@macro\ListOfQuizNames{,#2}%
- \gdef\quiz@total{#2}\xdef\curr@quiz{#2}\xdef\oField{#2}%
- \xdef\currQuiz{#2}\xdef\currQuizStartPage{\thepage}%
- \xdef\aPointType{0}%
+ \g@addto@macro\ListOfQuizNames{,#2}%
+ \gdef\quiz@total{#2}\xdef\curr@quiz{#2}\xdef\oField{#2}%
+ \xdef\currQuiz{#2}\xdef\currQuizStartPage{\thepage}%
+ \xdef\aPointType{0}%
% \end{macrocode}
% (2013/12/20) Pass \cs{bqlabelISO} through \cs{pdfstringdef}.
% \begin{macrocode}
- \def\fieldJSStr@CMD{\fieldJSStr*[noquotes]\bqlabelISO}%
- \expandafter\fieldJSStr@CMD\expandafter{\bqlabelISO}%
- \ifx\@quiztype\@empty\gdef\@@quiztype{#1}\else
- \xdef\@@quiztype{\@quiztype}\fi
- \let\@qzsolndest\@empty
- \let\answers\answers@q\let\endanswers\endanswers@q
- \let\manswers\manswers@q\let\endmanswers\endanswers@q
- \let\solution\solution@sq\let\endsolution\endsolution@sq
- \expandafter%
- \xdef\csname titleOf\currQuiz\endcsname{\aebTitleQuiz}%
+ \def\fieldJSStr@CMD{\flJSStr*[noquotes]\bqlabelISO}%
+ \expandafter\fieldJSStr@CMD\expandafter{\bqlabelISO}%
+ \ifx\@quiztype\@empty\gdef\@@quiztype{#1}\else
+ \xdef\@@quiztype{\@quiztype}\fi
+ \let\@qzsolndest\@empty
+ \let\answers\answers@q\let\endanswers\endanswers@q
+ \let\manswers\manswers@q\let\endmanswers\endanswers@q
+ \let\solution\solution@sq\let\endsolution\endsolution@sq
+ \expandafter
+ \xdef\csname titleOf\currQuiz\endcsname{\aebTitleQuiz}%
% \end{macrocode}
% Modified the destination name of \cs{hypertarget} to avoid deplicate
% destinations. Did the same thing for the \texttt{shortquiz}.
% \changes{v7.8a}{2016/12/07}{Modified destination name of \string\cs{hypertarget}}
% \begin{macrocode}
- \q@aboveskip\q@priorhook\noindent\hypertarget{qzH\@currentHref}{}%
- \eq@beginQuiz\qhspace{\set@typeset@protect\aebtitleQuiz}%
- \ignorespaces}
+ \q@aboveskip\q@priorhook\noindent\hypertarget{qzH\@currentHref}{}%
+ \eq@beginQuiz\qhspace{\set@typeset@protect\aebtitleQuiz}%
+ \ignorespaces
+}
% \end{macrocode}
% Here is the end for the \texttt{quiz} and \texttt{quiz*} environments. The
% \cs{eq@prior@endQuiz} can be used for whatever purposes a
@@ -4740,78 +4782,114 @@
% Use a button instead of a link for begin quiz
% \begin{macrocode}
\newcommand\useBeginQuizButton[1][]
- {\renewcommand\eq@beginQuiz{\eq@BeginQuizButton[#1]}}
+ {\renewcommand\eq@beginQuiz{\eq@BeginQuizButton[#1]}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\useEndQuizButton}
% Use a button instead of a link for end quiz
% \begin{macrocode}
\newcommand\useEndQuizButton[1][]
- {\renewcommand\eq@endQuiz{\eq@EndQuizButton[#1]}}
+ {\renewcommand\eq@endQuiz{\eq@EndQuizButton[#1]}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\useBeginQuizLink}
% Use a link begin quiz (the default)
% \begin{macrocode}
\newcommand\useBeginQuizLink
- {\renewcommand\eq@beginQuiz{\eq@BeginQuizLink}}
+ {\renewcommand\eq@beginQuiz{\eq@BeginQuizLink}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\useEndQuizLink}
% Use a link end quiz (the default)
% \begin{macrocode}
\newcommand\useEndQuizLink
- {\renewcommand\eq@endQuiz{\eq@EndQuizLink}}
+ {\renewcommand\eq@endQuiz{\eq@EndQuizLink}}
% \end{macrocode}
% \end{macro}
-% \begin{macrocode}
-%\def\listOfQuizzes{}
-%\def\listOfSubmitQuizzes{}
-%\def\initializeAllSubmitQuizzes{}
-% \end{macrocode}
% \begin{macro}{\@initQuiz}
-% \begin{macro}{\priorInitQuiz}
-% \begin{macro}{\postInitQuiz}
% \cs{@initQuiz} is executed when you click on `Begin Quiz'. Included here are some
% macro hooks for insert code prior to, and after the quiz initialization. This
% command appears in the commands \cs{eq@@BeginQuizLinkActions} and \cs{eq@@BeginQuizButtonActions} below.
%\changes{v7.0}{2014/11/05}{Added some JS: lstOfQuizzes is an object
% listing all quizzes in the document, the value is the quiz object. We add properties
% isSubmitted and initializeWith to the quiz object.}
+%\changes{v8.6.1}{2020/12/30}{Changed the comparison method for \string\cs{priorInitQuiz} and
+% \string\cs{postInitQuiz} to reflect their \string\cs{newcommand} definition.}
% \begin{macrocode}
\newcommand\@initQuiz{%
- var \curr@quiz=new Object();\jsR
- lstOfQuizzes["\curr@quiz"]=\curr@quiz;\jsR
- \curr@quiz.oAlertCheck={bAfterValue:false};\jsR
- \curr@quiz.Grp={};
- \ifx\defaultColorJSLoc\@empty\else\jsR
- \oField.DefaultColorJSLoc=\defaultColorJSLoc;\fi
- \ifx\rghtColorJSLoc\@empty\else\jsR
- \oField.RightColorJSLoc=\rghtColorJSLoc;\fi
- \ifx\wrngColorJSLoc\@empty\else\jsR
- \oField.WrongColorJSLoc=\wrngColorJSLoc;\fi
- \ifx\partialColorJSLoc\@empty\else\jsR
- \oField.PartialColorJSLoc=\partialColorJSLoc;\fi
- \ifx\rghtAnsSymbJSLoc\@empty\else\jsR
- \oField.RightAnsSymbJSLoc=\rghtAnsSymbJSLoc;\fi
- \ifx\wrngAnsSymbJSLoc\@empty\else\jsR
- \oField.WrongAnsSymbJSLoc=\wrngAnsSymbJSLoc;\fi
- \ifx\corrAnsSymbJSLoc\@empty\else\jsR
- \oField.CorrAnsSymbJSLoc=\corrAnsSymbJSLoc;\fi
- \ifx\eqGradeScaleLoc\@empty\else\jsR
- \oField.GradeScaleLoc=new Array(\eqGradeScaleLoc);\fi
- \ifx\eqCorrLocalChoiceFully\@empty\else\jsR % dpsf07
- \oField.fullyCorrectLoc=\eqCorrLocalChoiceFully;\fi
- \ifx\priorInitQuiz\@empty\else\jsR\priorInitQuiz\fi %\jsR
- InitializeQuiz("\curr@quiz",\ifnocorrections0\else1\fi);
- \ifx\eq@CGI\@empty\jsR\curr@quiz.isSubmitted=false;\else
- \jsR\curr@quiz.isSubmitted=true;\fi
- \jsR\curr@quiz.initializeWith=%
-'InitializeQuiz("\curr@quiz",\ifnocorrections0\else1\fi);'
- \ifx\postInitQuiz\@empty\else\jsR\postInitQuiz\fi
-}
-% \end{macrocode}
-% \cs{priorInitQuiz} and \cs{postInitQuiz} are hooks that allow a document author to
+ var\eqSP\curr@quiz=new Object();\jsR
+ lstOfQuizzes["\curr@quiz"]=\curr@quiz;\jsR
+ \curr@quiz.oAlertCheck={bAfterValue:false};\jsR
+ \curr@quiz.Grp={};%
+ \ifx\defaultColorJSLoc\@empty\else\jsR
+ \oField.DefaultColorJSLoc=\defaultColorJSLoc;\fi
+ \ifx\rghtColorJSLoc\@empty\else\jsR
+ \oField.RightColorJSLoc=\rghtColorJSLoc;\fi
+ \ifx\wrngColorJSLoc\@empty\else\jsR
+ \oField.WrongColorJSLoc=\wrngColorJSLoc;\fi
+ \ifx\partialColorJSLoc\@empty\else\jsR
+ \oField.PartialColorJSLoc=\partialColorJSLoc;\fi
+ \ifx\rghtAnsSymbJSLoc\@empty\else\jsR
+ \oField.RightAnsSymbJSLoc=\rghtAnsSymbJSLoc;\fi
+ \ifx\wrngAnsSymbJSLoc\@empty\else\jsR
+ \oField.WrongAnsSymbJSLoc=\wrngAnsSymbJSLoc;\fi
+ \ifx\corrAnsSymbJSLoc\@empty\else\jsR
+ \oField.CorrAnsSymbJSLoc=\corrAnsSymbJSLoc;\fi
+ \ifx\eqGradeScaleLoc\@empty\else\jsR
+ \oField.GradeScaleLoc=new Array(\eqGradeScaleLoc);\fi
+ \ifx\eqCorrLocalChoiceFully\@empty\else\jsR
+ \oField.fullyCorrectLoc=\eqCorrLocalChoiceFully;\fi
+ \if$\priorInitQuiz$\else\jsR\priorInitQuiz\fi\jsR
+ InitializeQuiz("\curr@quiz",\ifnocorrections0\else1\fi);%
+ \ifx\eq@CGI\@empty\jsR\curr@quiz.isSubmitted=false;\else
+ \jsR\curr@quiz.isSubmitted=true;\fi
+ \jsR\curr@quiz.initializeWith=%
+ 'InitializeQuiz("\curr@quiz",\ifnocorrections0\else1\fi);';%
+ \if$\postInitQuiz$\else\jsR\postInitQuiz\fi%
+}
+% \end{macrocode}
+% The following is the \env{defineJS} version of \cs{@initQuiz}. This is experiemental
+% for now, not yet implemented.
+%\begin{verbatim}
+%\begin{defineJS}[\makeesc\!\makecmt\%]{\@initQuiz}
+%var !curr@quiz=new Object();
+%lstOfQuizzes["!curr@quiz"]=!curr@quiz;
+%!curr@quiz.oAlertCheck={bAfterValue:false};
+%!curr@quiz.Grp={};%
+%!ifx!defaultColorJSLoc!@empty!else
+%!oField.DefaultColorJSLoc=!defaultColorJSLoc;!fi%
+%!ifx!rghtColorJSLoc!@empty!else
+%!oField.RightColorJSLoc=!rghtColorJSLoc;!fi%
+%!ifx!wrngColorJSLoc!@empty!else
+%!oField.WrongColorJSLoc=!wrngColorJSLoc;!fi%
+%!ifx!partialColorJSLoc!@empty!else
+%!oField.PartialColorJSLoc=!partialColorJSLoc;!fi%
+%!ifx!rghtAnsSymbJSLoc!@empty!else
+%!oField.RightAnsSymbJSLoc=!rghtAnsSymbJSLoc;!fi%
+%!ifx!wrngAnsSymbJSLoc!@empty!else
+%!oField.WrongAnsSymbJSLoc=!wrngAnsSymbJSLoc;!fi%
+%!ifx!corrAnsSymbJSLoc!@empty!else
+%!oField.CorrAnsSymbJSLoc=!corrAnsSymbJSLoc;!fi%
+%!ifx!eqGradeScaleLoc!@empty!else
+%!oField.GradeScaleLoc=new Array(!eqGradeScaleLoc);!fi%
+%!ifx!eqCorrLocalChoiceFully!@empty!else
+%!oField.fullyCorrectLoc=!eqCorrLocalChoiceFully;!fi%
+%!if$!priorInitQuiz$!else
+%!priorInitQuiz!fi%
+%InitializeQuiz("!curr@quiz",!ifnocorrections0!else1!fi);%
+%!ifx!eq@CGI!@empty
+%!curr@quiz.isSubmitted=false;!else
+%!curr@quiz.isSubmitted=true;!fi
+%!curr@quiz.initializeWith=%
+%'InitializeQuiz("!curr@quiz",!ifnocorrections0!else1!fi);';%
+%!if$!postInitQuiz$!else
+%!postInitQuiz!fi
+%\end{defineJS}
+%\end{verbatim}
+% \end{macro}
+% \begin{macro}{\priorInitQuiz}
+% \begin{macro}{\postInitQuiz}
+% These two commands are hooks that allow a document author to
% execute JavaScript just prior to initializing the quiz and just after. These appear in
% \cs{eq@@BeginQuizLinkActions} and \cs{eq@@BeginQuizButtonActions} below.
% \begin{macrocode}
@@ -4820,24 +4898,32 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
-% \end{macro}
-% Here are a couple of macros used with `End Quiz', and are used for
+% Here are a couple\DescribeMacro{\eq@submitURL}\DescribeMacro{\eq@insertHiddenFields}{}
+% of macros that appear in `\uif{End Quiz}', and are used for
% submitting quiz results to a web server.
% \begin{macrocode}
\let\eq@submitURL\@empty
\let\eq@insertHiddenFields\@empty
% \end{macrocode}
+% \begin{macro}{\priorSubmitQuiz}
+% \begin{macro}{\postSubmitQuiz}
+% These two commands are defined in this package, but are use in \pkg{eq2db}.
+% \begin{macrocode}
+\newcommand\priorSubmitQuiz{}
+\newcommand\postSubmitQuiz{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
%
% \subsubsection{With Links}
%
% \begin{macro}{\eq@BeginQuizLink}
-% Begin quiz with links
+% `\uif{Begin Quiz}' with links
% \begin{macrocode}
\def\eq@@BeginQuizLinkActions{\A{\JS{\@initQuiz}}}
\def\eq@BeginQuizLinkDefaults{\Border{0 0 0}}
\let\bqlabelFmt\@empty
-\def\eq@BeginQuizLink{%
- \qz@IDTxtField
+\def\eq@BeginQuizLink{\qz@IDTxtField
\set@@Link{}{}{}{\color{\@linkcolor}\bqlabelFmt\bqlabel}{}%
{\eq@setWidgetProps\setLink@driver}%
{\eq@BeginQuizLinkDefaults\eq@@BeginQuizLinkActions\every@Link}%
@@ -4846,47 +4932,22 @@
% \end{macro}
% \begin{macro}{\eq@EndQuizLink}
% Code the the link version of `End Quiz'.
+% \changes{v8.6}{2020/11/29}{Action for End Quiz Lnk now a \string\env{defineJS} env}
% \begin{macrocode}
-\newcommand\priorSubmitQuiz{}
-\newcommand\postSubmitQuiz{}
-\def\eq@@EndQuizLinkActions{\A{\JS{%
- if (!isQuizInitialized("\curr@quiz"))\jsR\jsT
- eqAppAlert(InitMsg("\bqlabelISO"),3);\jsR
- else {\jsR\jsT
- if (\minQuizResp(\thequestionno)) {\jsR\jsT\jsT
- \curr@quiz.PtValues=new %
- Array(\pointValuesArray);\jsR\jsT\jsT
- ProbType = [\ptypeArray];\jsR\jsT\jsT
-\if@inclkey
- \curr@quiz.CorrAns=(new %
- Array(\corrAnsArray));\jsR\jsT\jsT
-\fi
- DisplayQuizResults("\curr@quiz",\theeqpointvalue,%
- \thequestionno);\jsR\jsT\jsT
- var h=this.getField("ScoreData.\curr@quiz");\jsR\jsT\jsT
- h.value=Score+";"+NQuestions+";"%
- +ptScore+";"+NPointTotal;\jsR\jsT\jsT
- \eq@submitURL
- \postSubmitQuiz
- \jsT\jsT resetQuiz("\curr@quiz");\jsR\jsT
- }\jsR
- }}}%
-}
+\def\eq@@EndQuizLinkActions{\A{\JS{\eQzBtnActns}}}
\def\eq@EndQuizLinkDefaults{\Border{0 0 0}}
\let\eqlabelFmt\@empty
-\def\eq@EndQuizLink
-{%
- \ifx\eq@CGI\@empty
- \let\eq@submitURL\@empty
- \let\eq@insertHiddenFields\@empty
- \fi
- \set@@Link{}{}{}{\color{\@linkcolor}\eqlabelFmt\eqlabel}{}%
- {\eq@setWidgetProps\setLink@driver}%
- {\eq@EndQuizLinkDefaults\eq@@EndQuizLinkActions\every@Link}%
- \makebox[0pt][r]{\textField[\BC{}\autoCenter{n}]%
- {htxtfld.\curr@quiz}{2bp}{2bp}}%
- \makebox[0pt][r]{\eq@hiddenScoreData\eq@insertHiddenFields}%
- \global\let\eq@CGI\@empty\ignorespaces
+\def\eq@EndQuizLink{%
+ \ifx\eq@CGI\@empty
+ \let\eq@submitURL\@empty
+ \let\eq@insertHiddenFields\@empty\fi
+ \set@@Link{}{}{}{\color{\@linkcolor}\eqlabelFmt\eqlabel}{}%
+ {\eq@setWidgetProps\setLink@driver}%
+ {\eq@EndQuizLinkDefaults\eq@@EndQuizLinkActions\every@Link}%
+ \makebox[0pt][r]{\textField[\BC{}\autoCenter{n}]%
+ {htxtfld.\curr@quiz}{2bp}{2bp}}%
+ \makebox[0pt][r]{\eq@hiddenScoreData\eq@insertHiddenFields}%
+ \global\let\eq@CGI\@empty\ignorespaces
}
% \end{macrocode}
% \end{macro}
@@ -4896,10 +4957,11 @@
% \begin{macro}{\eq@BeginQuizButton}
% This is the button when the user wants button rather than link for the
% \texttt{quiz} environment.
+% \changes{v8.6}{2020/11/29}{Action for End Quiz Btn now a \string\env{defineJS} env}
% \begin{macrocode}
\def\BeginQuizButtonDefaults{%
- \CA{\bqlabel}\H{P}\F{\FPrint}
- \BC{1 0 0}\BG{.7529 .7529 .7529}\W{1}\S{B}}
+ \CA{\bqlabel}\H{P}\F{\FPrint}
+ \BC{1 0 0}\BG{.7529 .7529 .7529}\W{1}\S{B}}
\def\eq@@BeginQuizButtonActions{\A{\JS{\@initQuiz}}}
\newcommand\eq@BeginQuizButton[1][]{%
\mbox{\qz@IDTxtField\push@@Button{#1}{beginQuiz.\curr@quiz}{}%
@@ -4910,41 +4972,41 @@
% \end{macrocode}
% \end{macro}
% \begin{macro}{\eq@EndQuizButton}
-% The `End Quiz' code for Links
-% \begin{macrocode}
-\def\EndQuizButtonDefaults{%
- \CA{\eqlabel}\F{\FPrint}\BC{1 0 0}
- \BG{.7529 .7529 .7529}\W{1}\S{B}\H{P}}
-\def\eq@@EndQuizButtonActions{\A{\JS{%
- if (!isQuizInitialized("\curr@quiz"))\jsR\jsT
- eqAppAlert(InitMsg("\bqlabelISO"),3);\jsR
- else {\jsR\jsT
- if (\minQuizResp(\thequestionno)&&_ModalNotOn){\jsR\jsT\jsT
- \curr@quiz.PtValues=(new %
- Array(\pointValuesArray));\jsR\jsT\jsT
- ProbType=[\ptypeArray];\jsR\jsT\jsT
-\if@inclkey
- \curr@quiz.CorrAns=(new %
- Array(\corrAnsArray));\jsR\jsT\jsT
-\fi
- DisplayQuizResults("\curr@quiz",\theeqpointvalue,%
- \thequestionno);\jsR\jsT\jsT
- var h=this.getField("ScoreData.\curr@quiz");\jsR\jsT\jsT
- h.value=Score+";"+NQuestions+";"%
- +ptScore+";"+NPointTotal;\jsR\jsT\jsT
- \eq@submitURL
- \postSubmitQuiz
- \jsT\jsT resetQuiz("\curr@quiz");\jsR\jsT
- }\jsR
- }}}%
+% The `End Quiz' code
+% \begin{macrocode}
+\begin{defineJS}[\makeesc\*\makecmt\%]{\eQzBtnActns}
+if (!isQuizInitialized("*curr@quiz"))
+ eqAppAlert(InitMsg("*bqlabelISO"),3);
+else {
+ if (*minQuizResp(*thequestionno)&&_ModalNotOn){
+ *curr@quiz.PtValues=new Array(*pointValuesArray);
+ ProbType=[*ptypeArray];%
+*if@inclkey
+ *curr@quiz.CorrAns=new Array(*corrAnsArray);*fi
+ DisplayQuizResults("*curr@quiz",*theeqpointvalue,%
+*thequestionno);
+ var h=this.getField("ScoreData.*curr@quiz");
+ h.value=Score+";"+NQuestions+";"%
++ptScore+";"+NPointTotal;%
+*ifx*eq@submitURL*empty*else
+ *eq@submitURL*fi%
+*if$*postSubmitQuiz$*else
+ *postSubmitQuiz*fi
+ resetQuiz("*curr@quiz");
+ }
}
+\end{defineJS}
+\def\EndQuizButtonDefaults{%
+ \CA{\eqlabel}\F{\FPrint}\BC{1 0 0}
+ \BG{.7529 .7529 .7529}\W{1}\S{B}\H{P}}
+\def\eq@@EndQuizButtonActions{%
+ \A{\JS{\eQzBtnActns}}}
\newcommand{\eq@hiddenScoreData}{\makebox[0pt][r]{%
\textField[\BC{}\F{\FHidden}]{ScoreData.\curr@quiz}{2bp}{2bp}}}
\newcommand\eq@EndQuizButton[1][]{%
\ifx\eq@CGI\@empty
\let\eq@submitURL\@empty
- \let\eq@insertHiddenFields\@empty
- \fi
+ \let\eq@insertHiddenFields\@empty\fi
\mbox{\push@@Button{#1}{endQuiz.\curr@quiz}{}%
{\DefaultHeightOfWidget}{\eq@protect\A}%
{\eq@setButtonProps\eq@Button@driver}%
@@ -4959,8 +5021,8 @@
% \begin{macro}{\eqCGI}
% \begin{macro}{\eqSubmit}
% These four commands give general support for submitting quiz data
-% to a web server for storage in a database. Use in my \textsf{eq2db} Package
-% which I have not completed yet. (2014/09/14) Sanitized first argument of \cs{eqSubmit}.
+% to a web server for storage in a database. Use in the \pkg{eq2db} package.
+% (2014/09/14) Sanitized first argument of \cs{eqSubmit}.
% \begin{macrocode}
\newcommand\databaseName[1]{\gdef\db@Name{#1}}\def\db@Name{}
\newcommand\tableName[1]{\gdef\db@Table{#1}}\def\db@Table{}
@@ -5974,24 +6036,22 @@ if (isEndQuizPushed("@eqBaseName")){
% here, then goes to |\Ans@sq@l@driver| the rest of the code that depends on the
% driver.
% \begin{macrocode}
-\def\sqWrongRespJS{OnBlurRespBox( false, "\oField" );}
-\def\sqRightRespJS{OnBlurRespBox( true, "\oField" );}
+\def\sqWrongRespJS{OnBlurRespBox(false,"\oField");}
+\def\sqRightRespJS{OnBlurRespBox(true,"\oField");}
\def\Ans@sq@l@Actions
{%
- \A{\if\Ans@choice1
- \JS{\sqRightRespJS}
- \ifx\@qzsolndest\@empty\else
- \ifeq@solutionsafter\else
- /Next <</S/GoTo/D(\@qzsolndest)>>
- \fi
+ \A{\if\Ans@choice\eq@One\JS{\sqRightRespJS}
+ \ifx\@qzsolndest\@empty\else
+ \ifeq@solutionsafter\else
+ /Next <</S/GoTo/D(\@qzsolndest)>>
\fi
+ \fi
\else
\JS{\sqWrongRespJS\jsR
\ifx\oField\@empty\else
- updateTally("\oField.\thequestionno");
- \fi}%
+ updateTally("\oField.\thequestionno");\fi}%
\fi
- }%
+ }%
}
% \end{macrocode}
% \end{macro}
@@ -6047,6 +6107,7 @@ if (isEndQuizPushed("@eqBaseName")){
% \end{macrocode}
% \end{macro}
% \subsubsection{Form Style}
+% \subsubsection{Answers for the \texttt{answers} and \texttt{manswers} Environment}
% \begin{macro}{\Ans@sq@f}
% For the link multiple choice type question. The driver independent stuff starts
% here, then goes to |\Ans@sq@f@driver| the rest of the code that depends on the
@@ -6073,28 +6134,46 @@ if (isEndQuizPushed("@eqBaseName")){
\def\sqNoCorrections{\let\@sqAlertsOnly\eq@One}
\def\sqCorrections{\let\@sqAlertsOnly\eq@Zero}
\sqNoCorrections
-\def\Ans@sq@f@ActionsTrue{%
- \if\@sqTurnOffAlerts1OnBlurRespBox(true,"\oField");\jsR\fi
- \ifx\@qzsolndest\@empty\else\ifeq@solutionsafter\else
- jmpToNamedDest("\oField","\@qzsolndest",%
- \if\@sqTurnOffAlerts00\else1\fi);\fi
- \fi\eqAddAAMouseUpMC}
-\def\Ans@sq@f@ActionsFalse{%
- \if\@sqTurnOffAlerts1OnBlurRespBox(false,"\oField" );\jsR\fi
- \ifx\oField\@empty\else
- updateTally("\oField.\thequestionno");
- \fi\jsR\eqAddAAMouseUpMC}
+% \end{macrocode}
+% JavaScript code for the mouse up action for the \emph{correct} choice of the radio button field
+% (\texttt{mc.\ameta{fld-name}.\ameta{q-num}}) for the form version of a multiple choice question of a \texttt{shortquiz}.
+% \begin{macrocode}
+\begin{defineJS}[\makeesc\*\makecmt\%]{\Ans@sq@f@ActionsTrue}
+*ifx*@sqTurnOffAlerts*eq@One%
+OnBlurRespBox(true,"*oField");
+*fi%
+var qzSolnDest="*@qzsolndest";
+var solnAfter=*ifeq@solutionsafter%
+true*else%
+false*fi;
+if ((qzSolnDest!="") && !solnAfter) %
+jmpToNamedDest("*oField","*@qzsolndest",%
+*ifx*@sqTurnOffAlerts*eq@Zero0*else1*fi);%
+*ifx*eqAddAAMouseUpMC*empty*else
+*eqAddAAMouseUpMC*fi
+\end{defineJS}
+% \end{macrocode}
+% JavaScript code for the mouse up action for the \emph{incorrect} choice of the radio button field
+% (\texttt{mc.\ameta{fld-name}.q-num}) for the form version of a multiple choice question of a \texttt{shortquiz}.
+% \begin{macrocode}
+\begin{defineJS}[\makeesc\*\makecmt\%]{\Ans@sq@f@ActionsFalse}
+*ifx*@sqTurnOffAlerts*eq@One%
+OnBlurRespBox(false,"*oField");
+*fi%
+var qzSolnDest="*@qzsolndest";
+if( qzSolnDest!="") updateTally("*oField.*thequestionno");%
+*ifx*eqAddAAMouseUpMC*empty*else
+*eqAddAAMouseUpMC*fi
+\end{defineJS}
% \end{macrocode}
% The actions for the form version of a multiple choice question of a \texttt{shortquiz}.
% \begin{macrocode}
-\def\Ans@sq@f@Actions{\A{\if\Ans@choice\eq@One
- \JS{\Ans@sq@f@ActionsTrue}\else
- \JS{\Ans@sq@f@ActionsFalse}\fi}%
- \AAmousedown{updateTally.downState=!!event.target.isBoxChecked%
- (\arabic{quizno}-1);}}
+\def\Ans@sq@f@Actions{\AAmouseup{\if\Ans@choice\eq@One
+ \Ans@sq@f@ActionsTrue\else\Ans@sq@f@ActionsFalse\fi}
+ \AAmousedown{updateTally.downState=!!event.target.isBoxChecked%
+ (\arabic{quizno}-1);}}
\def\Ans@proofing#1{\ifeq@proofing\if\Ans@choice1\relax
- \llap{\@proofingsymbol\,\hskip#1\relax}%
- \fi\fi}
+ \llap{\@proofingsymbol\,\hskip#1\relax}\fi\fi}
% \end{macrocode}
%\DescribeMacro{\sqRghtSymbChoice}\DescribeMacro{\sqRghtSymbColor} for the \texttt{shortquiz}
% environment, these first two commands assign the right symbol (default check) and
@@ -6102,19 +6181,19 @@ if (isEndQuizPushed("@eqBaseName")){
% does the same thing for the wrong answer.
% \begin{macrocode}
\def\sqRghtSymbChoice#1{\chooseJSsymbol*{#1}%
- \ifx\eq@retnStyle\@empty
- \edef\sq@corrsymch{\sqRghtSymbChoiceDef}\else
- \edef\sq@corrsymch{#1}\fi}
+ \ifx\eq@retnStyle\@empty
+ \edef\sq@corrsymch{\sqRghtSymbChoiceDef}\else
+ \edef\sq@corrsymch{#1}\fi}
\def\sqRghtSymbColor#1{\edef\eq@arg{#1}\ifx\eq@arg\@empty
- \edef\sq@corrsymcol{\sqRghtSymbColorDef}\else
- \edef\sq@corrsymcol{#1}\fi}
+ \edef\sq@corrsymcol{\sqRghtSymbColorDef}\else
+ \edef\sq@corrsymcol{#1}\fi}
\def\sqWrngSymbChoice#1{\chooseJSsymbol*{#1}%
- \ifx\eq@retnStyle\@empty
- \edef\sq@wrgsymch{\sqWrngSymbChoiceDef}\else
- \edef\sq@wrgsymch{#1}\fi}
+ \ifx\eq@retnStyle\@empty
+ \edef\sq@wrgsymch{\sqWrngSymbChoiceDef}\else
+ \edef\sq@wrgsymch{#1}\fi}
\def\sqWrngSymbColor#1{\edef\eq@arg{#1}\ifx\eq@arg\@empty
- \edef\sq@wrgsymcol{\sqWrngSymbColorDef}\else
- \edef\sq@wrgsymcol{#1}\fi}
+ \edef\sq@wrgsymcol{\sqWrngSymbColorDef}\else
+ \edef\sq@wrgsymcol{#1}\fi}
\def\sqRghtSymbChoiceDef{check}
\def\sqRghtSymbColorDef{0 .6 0 rg}
\def\sqWrngSymbChoiceDef{cross}
@@ -6124,8 +6203,8 @@ if (isEndQuizPushed("@eqBaseName")){
\edef\sq@wrgsymch{\sqWrngSymbChoiceDef}
\edef\sq@wrgsymcol{\sqWrngSymbColorDef}
\def\sqResetSymbToDef{%
- \sqRghtSymbChoice{}\sqRghtSymbColor{}%
- \sqWrngSymbChoice{}\sqWrngSymbColor{}%
+ \sqRghtSymbChoice{}\sqRghtSymbColor{}%
+ \sqWrngSymbChoice{}\sqWrngSymbColor{}%
}
% \end{macrocode}
%\DescribeMacro{\qChoiceSymb}\DescribeMacro{\qChoiceColor} for the \texttt{quiz}
@@ -6133,12 +6212,12 @@ if (isEndQuizPushed("@eqBaseName")){
% color (default webgreen).
% \begin{macrocode}
\def\qChoiceSymb#1{\chooseJSsymbol*{#1}%
- \ifx\eq@retnStyle\@empty
- \edef\qz@chksymb{\qChoiceSymbDef}\else
- \edef\qz@chksymb{#1}\fi}
+ \ifx\eq@retnStyle\@empty
+ \edef\qz@chksymb{\qChoiceSymbDef}\else
+ \edef\qz@chksymb{#1}\fi}
\def\qChoiceColor#1{\edef\eq@arg{#1}\ifx\eq@arg\@empty
- \edef\qz@chksymbcol{\qChoiceColorDef}\else
- \edef\qz@chksymbcol{#1}\fi}
+ \edef\qz@chksymbcol{\qChoiceColorDef}\else
+ \edef\qz@chksymbcol{#1}\fi}
\def\qChoiceSymbDef{check}
\def\qChoiceColorDef{0 0 0 rg}
\edef\qz@chksymb{\qChoiceSymbDef}
@@ -6146,43 +6225,44 @@ if (isEndQuizPushed("@eqBaseName")){
%</package>
%<*package|eqexam>
\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
+\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
%</package|eqexam>
% \end{macrocode}
%\changes{v6.7d}{2013/05/27}{added \cs{rbf@Opts} to hardwire choices.}
% \begin{macrocode}
%<*package>
- \if\Ans@choice\eq@One
- \def\rbf@Opts{\symbolchoice{\sq@corrsymch}%
- \textColor{\sq@corrsymcol}}\else
- \def\rbf@Opts{\symbolchoice{\sq@wrgsymch}%
- \textColor{\sq@wrgsymcol}}\fi
+ \if\Ans@choice\eq@One
+ \def\rbf@Opts{\symbolchoice{\sq@corrsymch}%
+ \textColor{\sq@corrsymcol}}\else
+ \def\rbf@Opts{\symbolchoice{\sq@wrgsymch}%
+ \textColor{\sq@wrgsymcol}}\fi
%</package>
%<*package|eqexam>
- \settowidth{\eq@tmplength}{\eq@lw@f}%
- \eq@tmpdima=\wd\eq@tmpbox%
- \hangindent=\eq@tmplength\hangafter=1\relax
- \insertGrayLetters % 6.3d
+ \settowidth{\eq@tmplength}{\eq@lw@f}%
+ \eq@tmpdima=\wd\eq@tmpbox%
+ \hangindent=\eq@tmplength\hangafter=1\relax
+ \insertGrayLetters
%</package|eqexam>
%<*eqexam>
- \Ans@sq@f@driver
+ \Ans@sq@f@driver
%</eqexam>
%<*package>
- \mbox{\expandafter\radio@@Button\expandafter{\rbf@Opts}%
- {mc.\oField.\thequestionno}%
- {\RadioFieldSize}{\RadioFieldSize}%
- {\Ans@choice\alph{quizno}}{\eq@protect\A}%
- {\eq@setWidgetProps\eq@Radio@driver}%
- {\@@Ans@sq@f@Defaults\Ans@sq@f@Actions\every@RadioButton
- \every@sqRadioButton}}%
- \Ans@proofing{\RadioFieldSize}%
+ \mbox{\expandafter\radio@@Button\expandafter{\rbf@Opts}%
+ {mc.\oField.\thequestionno}%
+ {\RadioFieldSize}{\RadioFieldSize}%
+ {\Ans@choice\alph{quizno}}{\eq@protect\A}%
+ {\eq@setWidgetProps\eq@Radio@driver}%
+ {\@@Ans@sq@f@Defaults\Ans@sq@f@Actions\every@RadioButton
+ \every@sqRadioButton}}%
+ \Ans@proofing{\RadioFieldSize}%
%</package>
%<*package|eqexam>
-\eq@hspanner\ignorespaces}
+ \eq@hspanner\ignorespaces}
%</package|eqexam>
%<*package>
% \end{macrocode}
@@ -6194,87 +6274,108 @@ if (isEndQuizPushed("@eqBaseName")){
%
%</package>
%<*eqexam>
-% dps 4/16/05
\let\Ans@ck@sq@f\Ans@sq@f
%</eqexam>
%<*package>
-\def\@@Ans@ck@sq@f@Defaults
-{%
- \BC{0 0 0}\Ff{\FfNoToggleToOff}
- \F{\FPrint}\textSize{12}\textColor{0 g}\W{1}
+\def\@@Ans@ck@sq@f@Defaults{%
+ \BC{0 0 0}\Ff{\FfNoToggleToOff}
+ \F{\FPrint}\textSize{12}\textColor{0 g}\W{1}
}
\begingroup
\catcode`\&=12
\gdef\eq@AND{&&}
\endgroup
-\def\Ans@ck@sq@f@ActionsTrue{%
- var fName=event.target.name;\jsR
- var g=this.getField("mc.\oField.\thequestionno");\jsR
- var a=g.getArray();\jsR
- for (var i=0; i<a.length; i++)\jsR\jsT
- if ( a[i].isBoxChecked(0) \eq@AND\space
- a[i].value.charAt(0)==0)\jsR\jsT\jsT
- a[i].checkThisBox(0,false);\jsR
- \if\@sqTurnOffAlerts1OnBlurRespBox(%
- true,"\oField");\jsR\fi
- \ifx\@qzsolndest\@empty\else
- \ifeq@solutionsafter\else
- % if all correct answers are check, jump to solution
- for (var i=0; i<a.length; i++){\jsR\jsT
- if ( a[i].exportValues[0].charAt(0)==1 \eq@AND\space
- !a[i].isBoxChecked(0))\jsR\jsT\jsT
- break;\jsR
- }\jsR
- if (i>=a.length) jmpToNamedDest("\oField","\@qzsolndest",%
- \if\@sqTurnOffAlerts00\else1\fi);
- \fi
- \fi\eqAddAAMouseUpMS}
-\def\Ans@ck@sq@f@ActionsFalse{%
- var fName=event.target.name;\jsR
- var g=this.getField("mc.\oField.\thequestionno");\jsR
- var a=g.getArray();\jsR
- for (var i=0; i<a.length; i++)\jsR
- {\jsR\jsT
- if (a[i].value.charAt(0)==0) {\jsR\jsT\jsT
- if ( fName != a[i].name )\jsR\jsT\jsT\jsT
- a[i].checkThisBox(0,false);\jsR\jsT
- }\jsR
- }\jsR
- \if\@sqTurnOffAlerts1OnBlurRespBox( false, "\oField" );\fi
- \ifx\oField\@empty\else
- updateTally("\oField.\thequestionno");
- \fi\eqAddAAMouseUpMS}
+% \end{macrocode}
+% Mouse up action for a \emph{correct answer box} (a checkbox) to MS question of short-quiz
+% (field name: \texttt{mc.\ameta{fld-name}.\ameta{ques-num}}.\ameta{choice-num})
+% \begin{macrocode}
+\begin{defineJS}[\makeesc\*\makecmt\%]{\Ans@ck@sq@f@ActionsTrue}
+var fName=event.target.name;
+var g=this.getField("mc.*oField.*thequestionno");
+var a=g.getArray();
+for (var i=0; i<a.length; i++)
+ if ( (a[i].isBoxChecked(0)) && %
+(a[i].value.charAt(0)==0) )
+ a[i].checkThisBox(0,false);%
+*ifx*@sqTurnOffAlerts*eq@One%
+OnBlurRespBox(true,"*oField");
+*fi%
+var qzSolnDest="*@qzsolndest";
+var solnAfter=*ifeq@solutionsafter%
+true*else%
+false*fi;
+if ( (qzSolnDest != "") && !solnAfter ) {
+ for (var i=0; i<a.length; i++){
+ if ((a[i].exportValues[0].charAt(0)==1) && %
+(!a[i].isBoxChecked(0))) break;
+ }
+}
+if (i>=a.length) jmpToNamedDest("*oField","*@qzsolndest",%
+*ifx*@sqTurnOffAlerts*eq@Zero0*else1*fi);%
+*ifx*eqAddAAMouseUpMS*empty*else
+*eqAddAAMouseUpMS*fi
+\end{defineJS}
+% \end{macrocode}
+% Mouse up action for a \emph{incorrect answer box} (a checkbox) to MS question of short-quiz
+% (field name: \texttt{mc.\ameta{fld-name}.\ameta{ques-num}}.\ameta{choice-num})
+% \begin{macrocode}
+\begin{defineJS}[\makeesc\*\makecmt\%]{\Ans@ck@sq@f@ActionsFalse}
+var fName=event.target.name;
+var g=this.getField("mc.*oField.*thequestionno");
+var a=g.getArray();
+for (var i=0; i<a.length; i++) {
+ if (a[i].value.charAt(0)==0) {
+ if ( fName != a[i].name )
+ a[i].checkThisBox(0,false);
+ }
+}%
+*ifx*@sqTurnOffAlerts*eq@One%
+OnBlurRespBox(false,"*oField");
+*fi%
+*ifx*oField*@empty*else
+updateTally("*oField.*thequestionno");*fi%
+*ifx*eqAddAAMouseUpMS*empty*else
+*eqAddAAMouseUpMS*fi
+\end{defineJS}
+% \end{macrocode}
+% Set all actions for check box for a MS question of a short-quiz
+% (field name: \texttt{mc.\ameta{fld-name}.\ameta{ques-num}}.\ameta{choice-num})
+% \begin{macrocode}
\def\Ans@ck@sq@f@Actions{%
- \A{\if\Ans@choice\eq@One
- \JS{\Ans@ck@sq@f@ActionsTrue}\else
- \JS{\Ans@ck@sq@f@ActionsFalse}\fi}%
+ \AAmouseup{\if\Ans@choice\eq@One
+ \Ans@ck@sq@f@ActionsTrue\else
+ \Ans@ck@sq@f@ActionsFalse\fi}
\AAmousedown{updateTally.downState=!!event.target.isBoxChecked(0);}}
-\def\Ans@ck@sq@f{%
- \if\eq@listType\eq@One\stepcounter{quizno}\else
- \@ifundefined{ifwithinsoldoc}{\refstepcounter{quizno}}
- {\ifwithinsoldoc\stepcounter{quizno}\else
- \refstepcounter{quizno}\fi}\fi\PBS\raggedright
- \if\Ans@choice1%
- \def\rbf@Opts{\symbolchoice{\sq@corrsymch}%
- \textColor{\sq@corrsymcol}}\else
- \def\rbf@Opts{\symbolchoice{\sq@wrgsymch}%
- \textColor{\sq@wrgsymcol}}\fi
- \settowidth{\eq@tmplength}{\eq@lw@f}%
- \eq@tmpdima=\wd\eq@tmpbox%
- \hangindent=\eq@tmplength\hangafter=1\relax
- \insertGrayLetters % 6.3d
- \mbox{\expandafter\check@@Box\expandafter{\rbf@Opts}%
- {mc.\oField.\thequestionno.\arabic{quizno}}%
- {\RadioFieldSize}{\RadioFieldSize}
- {\Ans@choice\alph{quizno}}{\eq@protect\A}%
- {\eq@setWidgetProps\eq@Check@driver}%
- {\@@Ans@ck@sq@f@Defaults\Ans@ck@sq@f@Actions\every@CheckBox
- \every@sqCheckBox}}%
- \Ans@proofing{\RadioFieldSize}%
-\eq@hspanner\ignorespaces}
% \end{macrocode}
-% \end{macro}
-% \subsection{For \texttt{quiz}}
+% The check boxes to a MS question in an \env{manswers} environment of a short-quiz; the name of this field
+% |mc.\oField.\thequestionno.\arabic{quizno}|.
+% \begin{macrocode}
+\def\Ans@ck@sq@f{\if\eq@listType\eq@One
+ \stepcounter{quizno}\else
+ \@ifundefined{ifwithinsoldoc}{\refstepcounter{quizno}}
+ {\ifwithinsoldoc\stepcounter{quizno}\else
+ \refstepcounter{quizno}\fi}\fi\PBS\raggedright
+ \if\Ans@choice\eq@One
+ \def\rbf@Opts{\symbolchoice{\sq@corrsymch}%
+ \textColor{\sq@corrsymcol}}\else
+ \def\rbf@Opts{\symbolchoice{\sq@wrgsymch}%
+ \textColor{\sq@wrgsymcol}}\fi
+ \settowidth{\eq@tmplength}{\eq@lw@f}\eq@tmpdima\wd\eq@tmpbox
+ \hangindent\eq@tmplength\hangafter\@ne % dps
+ \insertGrayLetters % 6.3d
+ \mbox{\expandafter\check@@Box\expandafter{\rbf@Opts}%
+ {mc.\oField.\thequestionno.\arabic{quizno}}%
+ {\RadioFieldSize}{\RadioFieldSize}
+ {\Ans@choice\alph{quizno}}{\eq@protect\A}%
+ {\eq@setWidgetProps\eq@Check@driver}%
+ {\@@Ans@ck@sq@f@Defaults\Ans@ck@sq@f@Actions\every@CheckBox
+ \every@sqCheckBox}}%
+ \Ans@proofing{\RadioFieldSize}%
+ \eq@hspanner\ignorespaces
+}
+% \end{macrocode}
+% \end{macro}
+% \subsection{For the \texttt{quiz} environment}
% \subsubsection{The \texttt{answers} and \texttt{manswers} Environment}
% \begin{macro}{answers}
% This is the answers environment for the \texttt{quiz}
@@ -6304,51 +6405,51 @@ if (isEndQuizPushed("@eqBaseName")){
\newif\ifeqshowOutOf \eqshowOutOffalse
\def\showOutOfinSmryTbl{false}
\def\eq@recordThesePTs{%
- \ifx\pointValuesArray\@empty
- \edef\ptsValue{\showOutOfinSmryTbl,\eqPTs}\else
- \edef\ptsValue{,\eqPTs}\fi
- \expandafter\g@addto@macro\expandafter\pointValuesArray
- \expandafter{\ptsValue}}
+ \ifx\pointValuesArray\@empty
+ \edef\ptsValue{\showOutOfinSmryTbl,\eqPTs}\else
+ \edef\ptsValue{,\eqPTs}\fi
+ \expandafter\g@addto@macro\expandafter\pointValuesArray
+ \expandafter{\ptsValue}}
% \end{macrocode}
% \changes{v7.7m}{2016/07/04}{Added \string\texttt{ptypeArray} to track problem types better}
% \begin{macrocode}
\let\ptypeArray\@empty
\def\eq@recordProbType{%
- \ifx\ptypeArray\@empty
- \edef\tmp@exp{\noexpand\g@addto@macro
- \noexpand\ptypeArray{null,"\eqQT"}}\else
- \edef\tmp@exp{\noexpand\g@addto@macro
- \noexpand\ptypeArray{,"\eqQT"}}\fi
- \tmp@exp
+ \ifx\ptypeArray\@empty
+ \edef\tmp@exp{\noexpand\g@addto@macro
+ \noexpand\ptypeArray{null,"\eqQT"}}\else
+ \edef\tmp@exp{\noexpand\g@addto@macro
+ \noexpand\ptypeArray{,"\eqQT"}}\fi
+ \tmp@exp
}
\let\corrAnsArray\@empty
\def\eq@recordCorrAns#1{%
- \ifx\corrAnsArray\@empty
- \edef\tmp@exp{\noexpand\g@addto@macro
- \noexpand\corrAnsArray{null,#1}}\else
- \edef\tmp@exp{\noexpand\g@addto@macro
- \noexpand\corrAnsArray{,#1}}\fi
- \tmp@exp
+ \ifx\corrAnsArray\@empty
+ \edef\tmp@exp{\noexpand\g@addto@macro
+ \noexpand\corrAnsArray{null,#1}}\else
+ \edef\tmp@exp{\noexpand\g@addto@macro
+ \noexpand\corrAnsArray{,#1}}\fi
+ \tmp@exp
}
\def\aeb@answerType@r{r}
\def\aeb@answerType@c{c}
\newcommand\answers@q{%
- \eq@AddProbToQzQuesList
- \def\aeb@answerType{r}\setdefault@Ans\eq@recordThesePTs
- \eq@recordProbType
- \addtocounter{eqpointvalue}{\eqPTs}\stepcounter{questionno}%
- \def\aeb@thisType{"mc"}\@ifnextchar[{\answers@@q}%
- {\@ifstar{\answers@@q[\curr@quiz.\thequestionno]}{\answers@@q[]}}%
+ \eq@AddProbToQzQuesList
+ \def\aeb@answerType{r}\setdefault@Ans\eq@recordThesePTs
+ \eq@recordProbType
+ \addtocounter{eqpointvalue}{\eqPTs}\stepcounter{questionno}%
+ \def\aeb@thisType{"mc"}\@ifnextchar[{\answers@@q}%
+ {\@ifstar{\answers@@q[\curr@quiz.\thequestionno]}{\answers@@q[]}}%
}
\def\answers@@q[#1]#2{\global\let\eq@ansChoiceArray\@empty
- \xdef\aeb@numCols{#2}\edef\eqtmp{\aPointType}%
- \xdef\aPointType{\eqtmp,[\eqPTs,\aeb@thisType]}%
- \ifx\q@hwdest\@empty
- \xdef\@qzsolndest{#1}\else
- \gdef\@qzsolndest{\q@hwdest}\fi
- \ifnum\aeb@numCols=1
- \gdef\eq@listType{1}\expandafter\answers@q@list\else
- \gdef\eq@listType{0}\expandafter\answers@q@tabular\fi{\aeb@numCols}%
+ \xdef\aeb@numCols{#2}\edef\eqtmp{\aPointType}%
+ \xdef\aPointType{\eqtmp,[\eqPTs,\aeb@thisType]}%
+ \ifx\q@hwdest\@empty
+ \xdef\@qzsolndest{#1}\else
+ \gdef\@qzsolndest{\q@hwdest}\fi
+ \ifnum\aeb@numCols=1
+ \gdef\eq@listType{1}\expandafter\answers@q@list\else
+ \gdef\eq@listType{0}\expandafter\answers@q@tabular\fi{\aeb@numCols}%
}
% \end{macrocode}
% \end{macro}
@@ -6372,59 +6473,58 @@ if (isEndQuizPushed("@eqBaseName")){
% #2 = number of columns in the tabular environment
%\end{verbatim}
% \begin{macrocode}
-\newcommand\manswers@q
-{%
- \eq@AddProbToQzQuesList
- \def\aeb@answerType{c}\@setFormLinkType
- \global\expandafter\let\expandafter\@Ans
- \expandafter=\csname Ans@ck@\@@quiztype\endcsname
- \eq@recordThesePTs\eq@recordProbType
- \addtocounter{eqpointvalue}{\eqPTs}\stepcounter{questionno}%
- \def\aeb@thisType{"ms"}\@ifnextchar[{\answers@@q}%
- {\@ifstar{\answers@@q[\curr@quiz.\thequestionno]}{\answers@@q[]}}%
+\newcommand\manswers@q{%
+ \eq@AddProbToQzQuesList
+ \def\aeb@answerType{c}\@setFormLinkType
+ \global\expandafter\let\expandafter\@Ans
+ \expandafter=\csname Ans@ck@\@@quiztype\endcsname
+ \eq@recordThesePTs\eq@recordProbType
+ \addtocounter{eqpointvalue}{\eqPTs}\stepcounter{questionno}%
+ \def\aeb@thisType{"ms"}\@ifnextchar[{\answers@@q}%
+ {\@ifstar{\answers@@q[\curr@quiz.\thequestionno]}{\answers@@q[]}}%
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\newenvironment{answers@q@list}[1]{%
- \ifx\aeb@answerType\eq@r
- \let\endanswers\endanswers@q@list\else
- \let\endmanswers\endanswers@q@list\fi
- \list{\strut\@Ans}{%
- \if\qstar*\relax
- \if\aeb@FLOverride\eq@l
- \settowidth{\labelwidth}{\eq@lw@l}\else
- \settowidth{\labelwidth}{\eq@lw@f}\fi
- \else
- \if\aeb@FLOverride\eq@f
- \settowidth{\labelwidth}{\eq@lw@f}\else
- \settowidth{\labelwidth}{\eq@lw@l}\fi
- \fi
- \setlength{\topsep}{-\parskip+\aboveanswersSkip}%
- \setlength{\parsep}{0pt}\setlength{\itemindent}{0pt}%
- \setlength{\listparindent}{\parindent}%
- \setlength{\leftmargin}{\labelwidth}%
- \setlength{\labelsep}{0pt}%
- \def\Ans{\Ans@list}%
- }%
+ \ifx\aeb@answerType\eq@r
+ \let\endanswers\endanswers@q@list\else
+ \let\endmanswers\endanswers@q@list\fi
+ \list{\strut\@Ans}{%
+ \if\qstar*\relax
+ \if\aeb@FLOverride\eq@l
+ \settowidth{\labelwidth}{\eq@lw@l}\else
+ \settowidth{\labelwidth}{\eq@lw@f}\fi
+ \else
+ \if\aeb@FLOverride\eq@f
+ \settowidth{\labelwidth}{\eq@lw@f}\else
+ \settowidth{\labelwidth}{\eq@lw@l}\fi
+ \fi
+ \setlength{\topsep}{-\parskip+\aboveanswersSkip}%
+ \setlength{\parsep}{0pt}\setlength{\itemindent}{0pt}%
+ \setlength{\listparindent}{\parindent}%
+ \setlength{\leftmargin}{\labelwidth}%
+ \setlength{\labelsep}{0pt}%
+ \def\Ans{\Ans@list}%
+ }%
}{\endlist\setcounter{quizno}{0}%
- \eq@answersEndHook
- \setdefault@Ans
- \ifx\aeb@answerType\aeb@answerType@r
+ \eq@answersEndHook
+ \setdefault@Ans
+ \ifx\aeb@answerType\aeb@answerType@r
% \end{macrocode}
% If this is a MC question, we record the author's correct answer
% \begin{macrocode}
- \eq@recordCorrAns{\eq@ansChoiceArray}\ifwithinMCFI
+ \eq@recordCorrAns{\eq@ansChoiceArray}\ifwithinMCFI
% \end{macrocode}
% If within a \cs{bMCFI}/\cs{eMCFI} command pair, we also record
% the author's correct answer.
% \begin{macrocode}
- \eq@recordCorrAns{\s@veCorrAnsMCFI}\fi\else
+ \eq@recordCorrAns{\s@veCorrAnsMCFI}\fi\else
% \end{macrocode}
% If this is a MS question, we record the author's correct answer as an array
% \begin{macrocode}
- \eq@recordCorrAns{[\eq@ansChoiceArray]}\fi
- \global\let\eqlimselTo\@empty
+ \eq@recordCorrAns{[\eq@ansChoiceArray]}\fi
+ \global\let\eqlimselTo\@empty
}
% \end{macrocode}
% \begin{macrocode}
@@ -6433,52 +6533,50 @@ if (isEndQuizPushed("@eqBaseName")){
\qztabsep{1.5pt}
\def\qzTabPos#1{\def\qz@TabPos{[#1]}}\qzTabPos{}
\def\answers@q@tabular#1{%
- \ifinner\else\par\removelastparskip\vspace{\aboveanswersSkip}\fi
- \eq@tmpdima=\linewidth
- \@tempcnta#1\relax
+ \ifinner\else\par\removelastparskip\vspace{\aboveanswersSkip}\fi
+ \eq@tmpdima=\linewidth
+ \@tempcnta#1\relax
% n-1
- \advance\@tempcnta-1\relax
+ \advance\@tempcnta\m@ne
% 2(n-1)
- \multiply\@tempcnta by2
- \@tempdima\qz@tabsep\relax
+ \multiply\@tempcnta\tw@
+ \@tempdima\qz@tabsep\relax
% 2*(n-1)*\qz@tabsep
- \multiply\@tempdima\@tempcnta
+ \multiply\@tempdima\@tempcnta
% \linewidth-(n-1)*\qz@tabsep
- \advance\eq@tmpdima-\@tempdima
+ \advance\eq@tmpdima-\@tempdima
% (\linewidth-(n-1)*\qz@tabsep)/n
- \divide\eq@tmpdima by#1
-% \begin{macrocode}
- \tabcolsep\qz@tabsep\relax
- \def\Ans{\Ans@tabular}%
- \ifx\aeb@answerType\eq@r
- \let\endanswers\endanswers@q@tabular\else
- \let\endmanswers\endanswers@q@tabular\fi
- \noindent\expandafter
- \tabular\qz@TabPos{@{}*{#1}{p{\eq@tmpdima}}@{}}%
+ \divide\eq@tmpdima by#1
+ \tabcolsep\qz@tabsep\relax
+ \def\Ans{\Ans@tabular}%
+ \ifx\aeb@answerType\eq@r
+ \let\endanswers\endanswers@q@tabular\else
+ \let\endmanswers\endanswers@q@tabular\fi
+ \noindent\expandafter
+ \tabular\qz@TabPos{@{}*{#1}{p{\eq@tmpdima}}@{}}%
}
% \end{macrocode}
% \begin{macro}{\endanswers}
% Again, we put \verb+\let\endanswers=\endanswers@q+.
% \begin{macrocode}
-\def\endanswers@q@tabular
-{%
- \endtabular\setcounter{quizno}{0}%
- \eq@answersEndHook
- \setdefault@Ans
- \ifx\aeb@answerType\aeb@answerType@r
+\def\endanswers@q@tabular{%
+ \endtabular\setcounter{quizno}{0}%
+ \eq@answersEndHook
+ \setdefault@Ans
+ \ifx\aeb@answerType\aeb@answerType@r
% \end{macrocode}
% If this is a MC question, we record the author's correct answer
% \begin{macrocode}
- \eq@recordCorrAns{\eq@ansChoiceArray}\ifwithinMCFI
+ \eq@recordCorrAns{\eq@ansChoiceArray}\ifwithinMCFI
% \end{macrocode}
% If within the MCFI command pair, we record the author's fill-in as well.
% \begin{macrocode}
- \eq@recordCorrAns{\s@veCorrAnsMCFI}\fi\else
+ \eq@recordCorrAns{\s@veCorrAnsMCFI}\fi\else
% \end{macrocode}
% If this is a MS question, we record the author's correct answer as an array
% \begin{macrocode}
- \eq@recordCorrAns{[\eq@ansChoiceArray]}\fi
- \global\let\eqlimselTo\@empty
+ \eq@recordCorrAns{[\eq@ansChoiceArray]}\fi
+ \global\let\eqlimselTo\@empty
}
% \end{macrocode}
% \end{macro}
@@ -6489,75 +6587,73 @@ if (isEndQuizPushed("@eqBaseName")){
% \begin{macrocode}
\let\qRadionActionsHook\@empty
\def\Ans@@l@Actions{\A{\JS{%
- this.getField("mc.\curr@quiz.\thequestionno").value
- = "\Ans@choice\alph{quizno}";\jsR
+ this.getField("mc.\curr@quiz.\thequestionno").value\eqSP
+ =\eqSP"\Ans@choice\alph{quizno}";\jsR
RecordPointValue([0,\eqPTs,\eq@pPTs],\thequestionno);\jsR
RecordProblemType("\eqQT",\thequestionno);\jsR
ProcessQuestion(\Ans@choice,"\alph{quizno}",\thequestionno,%
-\arabic{quizno},"\curr@quiz",0,\ifnocorrections0\else1\fi,%
-"\bqlabelISO"\if\eqQuizType\isQZ\ifx\eq@online\eq@YES
-\ifeq@noquizsolutions\else,1\fi\fi\fi);\qRadionActionsHook}}%
+ \arabic{quizno},"\curr@quiz",0,\ifnocorrections0\else1\fi,%
+ "\bqlabelISO"\if\eqQuizType\isQZ\ifx\eq@online\eq@YES
+ \ifeq@noquizsolutions\else,1\fi\fi\fi);\qRadionActionsHook}}%
}
-\def\Ans@r@l@Defaults
-{%
- \BC{}\S{S}\W{1}\Ff{\FfNoToggleToOff}\F{\FPrint}
- \textSize{12}\textColor{0 g}\Ff{\FfReadOnly}
+\def\Ans@r@l@Defaults{%
+ \BC{}\S{S}\W{1}\Ff{\FfNoToggleToOff}\F{\FPrint}
+ \textSize{12}\textColor{0 g}\Ff{\FfReadOnly}
}
\def\Ans@l{\leavevmode\if\eq@listType1\stepcounter{quizno}%
- \else\refstepcounter{quizno}\fi\PBS\raggedright
- \settowidth{\eq@tmplength}{\eq@lw@l}\sbox{\eq@tmpbox}{\eq@l@l}%
- \hangindent=\eq@tmplength\hangafter=1\relax
- \eq@tmpdima=\wd\eq@tmpbox
- \def\link@@Content{(\hfil\linkContentFormat\hfil)}%
-% begin dps changes 12/19/03
-% \end{macrocode}
-% (2013/10/24) Imperative that radio button has no boundary line.
-% \begin{macrocode}
- \def\late@options{\BC{}}%
-\if\Ans@choice1\relax\eq@recordAnsChoice\fi
- \makebox[0pt][l]{\radio@@Button{}{mc.\curr@quiz.\thequestionno}%
- {\eq@tmpdima}{\RadioFieldSize}{\Ans@choice\alph{quizno}}%
- {\eq@protect\A}{\eq@setWidgetProps\eq@l@check@driver}%
- {\Ans@r@l@Defaults\every@RadioButton
- \every@qRadioButton\late@options}}%
-% end dps changes 12/19/03
- \set@@Link{}{}{}%
+ \else\refstepcounter{quizno}\fi\PBS\raggedright
+ \settowidth{\eq@tmplength}{\eq@lw@l}\sbox{\eq@tmpbox}{\eq@l@l}%
+ \hangindent=\eq@tmplength\hangafter=1\relax
+ \eq@tmpdima=\wd\eq@tmpbox
+ \def\link@@Content{(\hfil\linkContentFormat\hfil)}%
+% \end{macrocode}
+% (2013/10/24) Imperative that radio button have no boundary line.
+% \begin{macrocode}
+ \def\late@options{\BC{}}%
+ \if\Ans@choice\eq@One\relax\eq@recordAnsChoice\fi
+ \makebox[0pt][l]{\radio@@Button{}{mc.\curr@quiz.\thequestionno}%
+ {\eq@tmpdima}{\RadioFieldSize}{\Ans@choice\alph{quizno}}%
+ {\eq@protect\A}{\eq@setWidgetProps\eq@l@check@driver}%
+ {\Ans@r@l@Defaults\every@RadioButton
+ \every@qRadioButton\late@options}}%
+ \set@@Link{}{}{}%
{\makebox[\eq@tmpdima]{\color{\@linkcolor}\link@@Content}}%
{\eq@protect\A}{\eq@setWidgetProps\setLink@driver}%
{\set@LinkTextDefaults\Ans@@l@Actions\every@Link}%
- \ifnocorrections\else
- \if\Ans@choice1\relax
- \edef\Ans@c@l@Choice{\noexpand\DV{Yes}%
- \ifx\@qzsolndest\@empty
- \noexpand\Ff{\FfReadOnly}%
- \else % there is a solution
- \ifeq@noquizsolutions
- \noexpand\Ff{\FfReadOnly}%
- \else
- \noexpand\A{\noexpand\quiz@SolutionActionHook}%
- \fi
- \fi
- }%
- \else
- \def\Ans@c@l@Choice{\Ff{\FfReadOnly}\BC{}}%
- \fi
- \def\late@options{\BC{}}%
- \if\Ans@choice1\relax
- \ifx\@qzsolndest\@empty\else
- \ifeq@noquizsolutions\else
- \edef\late@options{\noexpand\BC{\solution@Color}}%
- \fi
- \fi
+ \ifnocorrections\else
+ \if\Ans@choice\eq@One
+ \edef\Ans@c@l@Choice{\noexpand\DV{Yes}%
+ \ifx\@qzsolndest\@empty
+ \noexpand\Ff{\FfReadOnly}%
+ \else % there is a solution
+ \ifeq@noquizsolutions\noexpand
+ \Ff{\FfReadOnly}%
+ \else\noexpand
+ \A{\noexpand\quiz@SolutionActionHook}%
+ \fi
+ \fi
+ }%
+ \else
+ \def\Ans@c@l@Choice{\Ff{\FfReadOnly}\BC{}}%
+ \fi
+ \def\late@options{\BC{}}%
+ \if\Ans@choice\eq@One
+ \ifx\@qzsolndest\@empty\else
+ \ifeq@noquizsolutions\else
+ \edef\late@options{\noexpand\BC{\solution@Color}}%
+ \fi
\fi
- \makebox[0pt][r]{\check@@Box{}%
- {mcq.\curr@quiz.\thequestionno.\arabic{quizno}}%
- {\eq@tmpdima}{0pt}{Yes}{}% \@tempdimb
- {\eq@setWidgetProps\eq@l@check@driver}%
- {\Ans@c@f@Defaults\Ans@c@l@Choice\every@RadioButton
- \every@qRadioButton\late@options}}%
\fi
- \Ans@proofing{\eq@tmpdima}%
-\eq@hspanner\ignorespaces}
+ \makebox[0pt][r]{\check@@Box{}%
+ {mcq.\curr@quiz.\thequestionno.\arabic{quizno}}%
+ {\eq@tmpdima}{0pt}{Yes}{}% \@tempdimb
+ {\eq@setWidgetProps\eq@l@check@driver}%
+ {\Ans@c@f@Defaults\Ans@c@l@Choice\every@RadioButton
+ \every@qRadioButton\late@options}}%
+ \fi
+ \Ans@proofing{\eq@tmpdima}\eq@hspanner
+ \ignorespaces
+}
% \end{macrocode}
% \end{macro}
% Now for the code to support the \texttt{manswers} environment for link style.
@@ -6566,74 +6662,75 @@ if (isEndQuizPushed("@eqBaseName")){
% a checkbox, on top of that a link (that the user interacts with) and on top another check box.
% \begin{macrocode}
\def\Ans@ck@@l@Actions{\A{\JS{%
- var ckfName="mck.\curr@quiz.\thequestionno.\arabic{quizno}";\jsR
- var ckf = this.getField(ckfName);\jsR
- ckf.checkThisBox(0,!ckf.isBoxChecked(0));\jsR
- var _bOK=true;\jsR
-\ifx\eqlimselTo\@empty\else _bOK = LimitSelection(\eqlimselTo,%
-"mck.\curr@quiz.\thequestionno","\arabic{quizno}");\jsR\fi
-if (_bOK) {\jsR\jsT
- var aPMSretn=ProcessMultiSelection(\Ans@choice,"\alph{quizno}",%
-\thequestionno,\arabic{quizno},"\curr@quiz",\eqPTs,\eq@pPTs);\jsR\jsT
- RecordProblemType("\eqQT",\thequestionno);\jsR\jsT
- ProcessQuestion(aPMSretn[0],aPMSretn[1],\thequestionno,%
-\arabic{quizno},"\curr@quiz",0,\ifnocorrections0\else1\fi,%
-"\bqlabelISO"\if\eqQuizType\isQZ\ifx\eq@online\eq@YES
-\ifeq@noquizsolutions\else,1\fi\fi\fi);\jsR
-}
- }}
-}
-\def\Ans@ck@l@Defaults
-{%
- \BC{}\S{S}\W{1}\H{N}\Ff{\FfNoToggleToOff}
- \textSize{12}\textColor{0 g}\Ff{\FfReadOnly}
+ var\eqSP ckfName="mck.\curr@quiz.\thequestionno.\arabic{quizno}";\jsR
+ var\eqSP ckf = this.getField(ckfName);\jsR
+ ckf.checkThisBox(0,!ckf.isBoxChecked(0));\jsR
+ var\eqSP _bOK=true;\jsR
+\ifx\eqlimselTo\@empty\else
+ _bOK=LimitSelection(\eqlimselTo,%
+ "mck.\curr@quiz.\thequestionno","\arabic{quizno}");\jsR
+\fi
+ if(_bOK)\eqSP{\jsR\jsT
+ var\eqSP aPMSretn=ProcessMultiSelection(\Ans@choice,"\alph{quizno}",%
+ \thequestionno,\arabic{quizno},"\curr@quiz",%
+ \eqPTs,\eq@pPTs);\jsR\jsT
+ RecordProblemType("\eqQT",\thequestionno);\jsR\jsT
+ ProcessQuestion(aPMSretn[0],aPMSretn[1],\thequestionno,%
+ \arabic{quizno},"\curr@quiz",0,\ifnocorrections0\else1\fi,%
+ "\bqlabelISO"\if\eqQuizType\isQZ\ifx\eq@online\eq@YES
+ \ifeq@noquizsolutions\else,1\fi\fi\fi);\jsR
+ }}}%
}
-\def\Ans@ck@l{%
- \leavevmode\if\eq@listType1\stepcounter{quizno}%
- \else\refstepcounter{quizno}\fi
- \if\Ans@choice1\eq@recordAnsChoice\fi\PBS\raggedright
- \settowidth{\eq@tmplength}{\eq@lw@l}\sbox{\eq@tmpbox}{\eq@l@l}%
- \hangindent=\eq@tmplength\hangafter=1\relax
- \eq@tmpdima=\wd\eq@tmpbox
- \def\link@@Content{(\hfil\linkContentFormat\hfil)}%
-% begin dps changes 12/19/03
- \makebox[0pt][l]{%
- \check@@Box{}{mck.\curr@quiz.\thequestionno.\arabic{quizno}}%
- {\eq@tmpdima}{\RadioFieldSize}{\Ans@choice\alph{quizno}}%
- {\eq@protect\A}{\eq@setWidgetProps\eq@l@check@driver}%
- {\Ans@ck@l@Defaults\every@RadioButton
- \every@qckCheckbox}}%
-% end dps changes 12/19/03
- \set@@Link{}{}{}%
+\def\Ans@ck@l@Defaults{%
+ \BC{}\S{S}\W{1}\H{N}\Ff{\FfNoToggleToOff}
+ \textSize{12}\textColor{0 g}\Ff{\FfReadOnly}
+}
+\def\Ans@ck@l{\leavevmode
+ \if\eq@listType1\stepcounter{quizno}%
+ \else\refstepcounter{quizno}\fi
+ \if\Ans@choice\eq@One\eq@recordAnsChoice\fi
+ \PBS\raggedright
+ \settowidth{\eq@tmplength}{\eq@lw@l}\sbox{\eq@tmpbox}{\eq@l@l}%
+ \hangindent\eq@tmplength\hangafter\@ne
+ \eq@tmpdima\wd\eq@tmpbox
+ \def\link@@Content{(\hfil\linkContentFormat\hfil)}%
+ \makebox[0pt][l]{%
+ \check@@Box{}{mck.\curr@quiz.\thequestionno.\arabic{quizno}}%
+ {\eq@tmpdima}{\RadioFieldSize}{\Ans@choice\alph{quizno}}%
+ {\eq@protect\A}{\eq@setWidgetProps\eq@l@check@driver}%
+ {\Ans@ck@l@Defaults\every@RadioButton
+ \every@qckCheckbox}}%
+ \set@@Link{}{}{}%
{\makebox[\eq@tmpdima]{\color{\@linkcolor}\link@@Content}}%
{\eq@protect\A}{\eq@setWidgetProps\setLink@driver}%
{\set@LinkTextDefaults\Ans@ck@@l@Actions\every@Link}%
- \ifnocorrections\else
- \if\Ans@choice1\relax
- \edef\Ans@c@l@Choice{\noexpand\DV{Yes}%
- \ifx\@qzsolndest\@empty\noexpand\BC{}%
- \noexpand\Ff{\FfReadOnly}%
- \else % there is a solution
- \ifeq@noquizsolutions
- \noexpand\BC{}\noexpand\Ff{\FfReadOnly}%
- \else
- \noexpand\BC{\solution@Color}%
- \noexpand\A{\noexpand\quiz@SolutionActionHook}%
- \fi
- \fi
- }%
- \else
- \def\Ans@c@l@Choice{\Ff{\FfReadOnly}\BC{}}%
+ \ifnocorrections\else
+ \if\Ans@choice\eq@One
+ \edef\Ans@c@l@Choice{\noexpand\DV{Yes}%
+ \ifx\@qzsolndest\@empty\noexpand\BC{}%
+ \noexpand\Ff{\FfReadOnly}%
+ \else % there is a solution
+ \ifeq@noquizsolutions
+ \noexpand\BC{}\noexpand\Ff{\FfReadOnly}%
+ \else
+ \noexpand\BC{\solution@Color}%
+ \noexpand\A{\noexpand\quiz@SolutionActionHook}%
+ \fi
\fi
- \makebox[0pt][r]{\check@@Box{}%
- {mcq.\curr@quiz.\thequestionno.\arabic{quizno}}%
- {\eq@tmpdima}{0pt}{Yes}{}%
- {\eq@setWidgetProps\eq@l@check@driver}%
- {\Ans@c@f@Defaults\Ans@c@l@Choice\every@RadioButton
- \every@qRadioButton}}%
+ }%
+ \else
+ \def\Ans@c@l@Choice{\Ff{\FfReadOnly}\BC{}}%
\fi
- \Ans@proofing{\eq@tmpdima}%
-\eq@hspanner\ignorespaces}
+ \makebox[0pt][r]{\check@@Box{}%
+ {mcq.\curr@quiz.\thequestionno.\arabic{quizno}}%
+ {\eq@tmpdima}{0pt}{Yes}{}%
+ {\eq@setWidgetProps\eq@l@check@driver}%
+ {\Ans@c@f@Defaults\Ans@c@l@Choice\every@RadioButton
+ \every@qRadioButton}}%
+ \fi
+ \Ans@proofing{\eq@tmpdima}\eq@hspanner
+ \ignorespaces
+}
% \end{macrocode}
% \end{macro}
% \subsubsection{Form Style}
@@ -6642,32 +6739,35 @@ if (_bOK) {\jsR\jsT
% here, then goes to |\Ans@f@driver| the rest of the code that depends on the
% driver.
% \begin{macrocode}
-\def\Ans@f{\leavevmode\if\eq@listType1\stepcounter{quizno}%
- \else\refstepcounter{quizno}\fi
- \PBS\raggedright\Ans@@f}
-\def\Ans@r@f@Defaults
-{%
- \BC{0 0 0}\S{S}\W{1}\Ff{\FfNoToggleToOff}
- \F{\FPrint}\textSize{12}\textColor{0 g}
+\def\Ans@f{\leavevmode
+ \if\eq@listType1\stepcounter{quizno}\else
+ \refstepcounter{quizno}\fi
+ \PBS\raggedright\Ans@@f}
+\def\Ans@r@f@Defaults{%
+ \BC{0 0 0}\S{S}\W{1}\Ff{\FfNoToggleToOff}
+ \F{\FPrint}\textSize{12}\textColor{0 g}
}
+% \end{macrocode}
% Action of the radio button field
+% \begin{macrocode}
\def\Ans@r@f@Actions{\A{\JS{%
- RecordPointValue([0,\eqPTs,\eq@pPTs],\thequestionno);\jsR
- RecordProblemType("\eqQT",\thequestionno);\jsR
- ProcessQuestion(\Ans@choice,"\alph{quizno}",\thequestionno,%
- \arabic{quizno},"\curr@quiz",0,\ifnocorrections0\else1\fi,%
- "\bqlabelISO"\if\eqQuizType\isQZ\ifx\eq@online\eq@YES
- \ifeq@noquizsolutions\else,1\fi\fi\fi);\qRadionActionsHook}}
+ RecordPointValue([0,\eqPTs,\eq@pPTs],\thequestionno);\jsR
+ RecordProblemType("\eqQT",\thequestionno);\jsR
+ ProcessQuestion(\Ans@choice,"\alph{quizno}",\thequestionno,%
+ \arabic{quizno},"\curr@quiz",0,\ifnocorrections0\else1\fi,%
+ "\bqlabelISO"\if\eqQuizType\isQZ\ifx\eq@online\eq@YES
+ \ifeq@noquizsolutions\else,1\fi\fi\fi);\qRadionActionsHook}}
}
+% \end{macrocode}
% Action of the check box underlying the radio button field
+% \begin{macrocode}
\def\quiz@SolutionActionHook{%
- /S/GoTo/D(\@qzsolndest)/Next<<\JS{this.resetForm(%
- ["mcq.\curr@quiz.\thequestionno.\arabic{quizno}"]);}>>
+ /S/GoTo/D(\@qzsolndest)/Next<<\JS{this.resetForm(%
+ ["mcq.\curr@quiz.\thequestionno.\arabic{quizno}"]);}>>
}
-\def\Ans@c@f@Defaults
-{%
- \BC{0 0 0}\S{S}\W{1}\F{\FHidden}\textSize{12}
- \textColor{0 g}\symbolchoice{circle}
+\def\Ans@c@f@Defaults{%
+ \BC{0 0 0}\S{S}\W{1}\F{\FHidden}\textSize{12}
+ \textColor{0 g}\symbolchoice{circle}
}
% \end{macrocode}
% \changes{v6.05d}{2007/04/14}
@@ -6687,64 +6787,60 @@ if (_bOK) {\jsR\jsT
% \begin{macrocode}
\providecommand\graylettersColor{gray}
\def\insertGrayLetters{\ifaebshowgrayletters
- \rlap{\makebox[\RadioFieldSize]%
- {\textcolor{\graylettersColor}{\Alph{quizno}}}}\else\relax\fi}
+ \rlap{\makebox[\RadioFieldSize]%
+ {\textcolor{\graylettersColor}{\Alph{quizno}}}}\else\relax\fi}
%</package|eqexam>
%<*package>
-\def\Ans@@f
-{%
- \settowidth{\eq@tmplength}{\eq@lw@f}%
- \hangindent=\eq@tmplength\hangafter=1
- \bottomOfAnsfStack\insertGrayLetters
-% dps add
- \edef\rbf@Opts{\ifaeb@usecircles\else
- \noexpand\symbolchoice{\qz@chksymb}\fi
- \noexpand\textColor{\qz@chksymbcol}}%
- \if\Ans@choice1\eq@recordAnsChoice\fi
- \mbox{\expandafter\radio@@Button\expandafter{\rbf@Opts}%
- {mc.\curr@quiz.\thequestionno}%
- {\RadioFieldSize}{\RadioFieldSize}{\Ans@choice\alph{quizno}}%
- {\eq@protect\A}{\eq@setWidgetProps\eq@Radio@driver}%
- {\Ans@r@f@Defaults\Ans@r@f@Actions\every@RadioButton
- \every@qRadioButton\insert@circlesymbol}}%
- \let\late@options\@empty
- \ifnocorrections\else
- \if\Ans@choice1\relax
- \edef\Ans@c@f@Choice{\noexpand\DV{Yes}%
- \ifx\@qzsolndest\@empty\noexpand\Ff{\FfReadOnly}%
- \else
- \ifeq@noquizsolutions
- \noexpand\Ff{\FfReadOnly}%
- \else
- \noexpand\A{\noexpand\quiz@SolutionActionHook}%
- \fi
- \fi
- }%
- \else
- \def\Ans@c@f@Choice{\Ff{\FfReadOnly}}%
+\def\Ans@@f{%
+ \settowidth{\eq@tmplength}{\eq@lw@f}%
+ \hangindent=\eq@tmplength\hangafter=1
+ \bottomOfAnsfStack\insertGrayLetters
+ \edef\rbf@Opts{\ifaeb@usecircles\else
+ \noexpand\symbolchoice{\qz@chksymb}\fi
+ \noexpand\textColor{\qz@chksymbcol}}%
+ \if\Ans@choice\eq@One\eq@recordAnsChoice\fi
+ \mbox{\expandafter\radio@@Button\expandafter{\rbf@Opts}%
+ {mc.\curr@quiz.\thequestionno}%
+ {\RadioFieldSize}{\RadioFieldSize}{\Ans@choice\alph{quizno}}%
+ {\eq@protect\A}{\eq@setWidgetProps\eq@Radio@driver}%
+ {\Ans@r@f@Defaults\Ans@r@f@Actions\every@RadioButton
+ \every@qRadioButton\insert@circlesymbol}}%
+ \let\late@options\@empty
+ \ifnocorrections\else
+ \if\Ans@choice\eq@One
+ \edef\Ans@c@f@Choice{\noexpand\DV{Yes}%
+ \ifx\@qzsolndest\@empty\noexpand\Ff{\FfReadOnly}\else
+ \ifeq@noquizsolutions
+ \noexpand\Ff{\FfReadOnly}\else
+ \noexpand\A{\noexpand\quiz@SolutionActionHook}\fi
\fi
+ }%
+ \else
+ \def\Ans@c@f@Choice{\Ff{\FfReadOnly}}%
+ \fi
% \end{macrocode}
% \changes{v6.7h}{2013/08/19}{When the \cs{useMCCircles} is used, the boundary
% color is transparent. We try a fix for this to show the colored solution
% boundary. The fix uses the \cs{late@options} commands.}
% \begin{macrocode}
- \ifaeb@usecircles\def\late@options{\BC{}}\fi
- \if\Ans@choice1\relax
- \ifx\@qzsolndest\@empty\else
- \ifeq@noquizsolutions\else
- \edef\late@options{\noexpand\BC{\solution@Color}}%
- \fi
- \fi
+ \ifaeb@usecircles\def\late@options{\BC{}}\fi
+ \if\Ans@choice\eq@One
+ \ifx\@qzsolndest\@empty\else
+ \ifeq@noquizsolutions\else
+ \edef\late@options{\noexpand\BC{\solution@Color}}%
\fi
- \makebox[0pt][r]{\check@@Box{}%
- {mcq.\curr@quiz.\thequestionno.\arabic{quizno}}%
- {\RadioFieldSize}{\RadioFieldSize}{Yes}{}%
- {\eq@setWidgetProps\eq@Check@driver}%
- {\Ans@c@f@Defaults\Ans@c@f@Choice\every@CheckBox
- \every@qCheckBox\late@options}}%
+ \fi
\fi
- \Ans@proofing{\RadioFieldSize}%
-\eq@hspanner\ignorespaces}
+ \makebox[0pt][r]{\check@@Box{}%
+ {mcq.\curr@quiz.\thequestionno.\arabic{quizno}}%
+ {\RadioFieldSize}{\RadioFieldSize}{Yes}{}%
+ {\eq@setWidgetProps\eq@Check@driver}%
+ {\Ans@c@f@Defaults\Ans@c@f@Choice\every@CheckBox
+ \every@qCheckBox\late@options}}%
+ \fi
+ \Ans@proofing{\RadioFieldSize}\eq@hspanner
+ \ignorespaces
+}
% \end{macrocode}
% \DescribeMacro{\limitSelectionTo} limits the selection to the number specified
% by its argument for multiple selection questions.
@@ -6755,108 +6851,108 @@ if (_bOK) {\jsR\jsT
% \begin{macro}{\Ans@ck@f}
% The support for multiple selection answers within the \texttt{manswers} environment.
% \begin{macrocode}
-\def\Ans@ck@f{\leavevmode\if\eq@listType1\stepcounter{quizno}%
- \else\refstepcounter{quizno}\fi
- \if\Ans@choice1\eq@recordAnsChoice\fi
- \PBS\raggedright\Ans@@ck@f}
-\def\Ans@ck@f@Defaults
-{%
- \BC{0 0 0}\S{S}\W{1}\Ff{\FfNoToggleToOff}
- \textSize{12}\textColor{0 g}
+\def\Ans@ck@f{\leavevmode
+ \if\eq@listType1\stepcounter{quizno}%
+ \else\refstepcounter{quizno}\fi
+ \if\Ans@choice\eq@One\eq@recordAnsChoice\fi
+ \PBS\raggedright\Ans@@ck@f}
+\def\Ans@ck@f@Defaults{%
+ \BC{0 0 0}\S{S}\W{1}\Ff{\FfNoToggleToOff}
+ \textSize{12}\textColor{0 g}
}
+% \end{macrocode}
% Action of the radio button field
-\def\Ans@ck@f@Actions
-{%
- \A{\JS{%
+% \begin{macrocode}
+\def\Ans@ck@f@Actions{%
+ \A{\JS{%
% \end{macrocode}
% Here is limit the number of selections. If \cs{eqlimselTo} is nonempty,
% we call \texttt{LimitSelection()} to count the number of checks in this
% current field. If too many, we uncheck the current effort and inform the
% user.
% \begin{macrocode}
- var _bOK=true;\jsR
-\ifx\eqlimselTo\@empty\else _bOK = LimitSelection(\eqlimselTo,%
-"mck.\curr@quiz.\thequestionno","\arabic{quizno}");\jsR\fi
+ var\eqSP_bOK=true;\jsR
+\ifx\eqlimselTo\@empty\else
+ _bOK\eqSP=\eqSP LimitSelection(\eqlimselTo,%
+ "mck.\curr@quiz.\thequestionno","\arabic{quizno}");\jsR\fi
% \end{macrocode}
% As a result of the previous changes, we make this a condition:
% if the JavaScript function \texttt{LimitSelection()} returns false, we do not execute. The default
% value is \texttt{\_bOK=true}.
% \begin{macrocode}
-if (_bOK) {\jsR\jsT
- var aPMSretn=ProcessMultiSelection(\Ans@choice,"\alph{quizno}",%
-\thequestionno,\arabic{quizno},"\curr@quiz",\eqPTs,\eq@pPTs);\jsR\jsT
- RecordProblemType("\eqQT",\thequestionno);\jsR\jsT
- ProcessQuestion(aPMSretn[0],aPMSretn[1],\thequestionno,%
-\arabic{quizno},"\curr@quiz",0,\ifnocorrections0\else1\fi,%
-"\bqlabelISO"\if\eqQuizType\isQZ\ifx\eq@online\eq@YES
-\ifeq@noquizsolutions\else,1\fi\fi\fi);\jsR
-}}}%
+ if(_bOK)\eqSP{\jsR\jsT
+ var aPMSretn=ProcessMultiSelection(\Ans@choice,"\alph{quizno}",%
+ \thequestionno,\arabic{quizno},"\curr@quiz",%
+ \eqPTs,\eq@pPTs);\jsR\jsT
+ RecordProblemType("\eqQT",\thequestionno);\jsR\jsT
+ ProcessQuestion(aPMSretn[0],aPMSretn[1],\thequestionno,%
+ \arabic{quizno},"\curr@quiz",0,\ifnocorrections0\else1\fi,%
+ "\bqlabelISO"\if\eqQuizType\isQZ\ifx\eq@online\eq@YES
+ \ifeq@noquizsolutions\else,1\fi\fi\fi);\jsR
+ }}}%
}
+% \end{macrocode}
% Action of the check box underlying the radio button field
-\def\quiz@SolutionActionHook{%
- /S/GoTo/D(\@qzsolndest)/Next<<\JS{this.resetForm(%
-["mcq.\curr@quiz.\thequestionno.\arabic{quizno}"]);}>>
+% \begin{macrocode}
+\def\quiz@SolutionActionHook{/S/GoTo/D(\@qzsolndest)%
+ /Next<<\JS{this.resetForm([%
+ "mcq.\curr@quiz.\thequestionno.\arabic{quizno}"]);}>>
}
% \end{macrocode}
% \cs{Ans@@ck@f} is the definition of the \cs{Ans} command within the
% \texttt{manswers} environment.
% \begin{macrocode}
-\def\Ans@@ck@f
-{%
- \settowidth{\eq@tmplength}{\eq@lw@f}%
- \hangindent=\eq@tmplength\hangafter=1
- \bottomOfAnsfStack\insertGrayLetters
+\def\Ans@@ck@f{%
+ \settowidth{\eq@tmplength}{\eq@lw@f}%
+ \hangindent\eq@tmplength\hangafter\@ne
+ \bottomOfAnsfStack\insertGrayLetters
% \end{macrocode}
% The bottom most checkbox
% \begin{macrocode}
- \bottomOfAnsfStack\insertGrayLetters
-% dps add
-\def\cbf@Opts{\symbolchoice{\qz@chksymb}%
+ \bottomOfAnsfStack\insertGrayLetters
+ \def\cbf@Opts{\symbolchoice{\qz@chksymb}%
\textColor{\qz@chksymbcol}}%
- \mbox{\expandafter\check@@Box\expandafter{\cbf@Opts}%
- {mck.\curr@quiz.\thequestionno.\arabic{quizno}}%
- {\RadioFieldSize}{\RadioFieldSize}{\Ans@choice\alph{quizno}}%
- {\eq@protect\A}{\eq@setWidgetProps\eq@Check@driver}%
- {\Ans@ck@f@Defaults\Ans@ck@f@Actions\every@RadioButton
- \every@qckCheckbox}}%
- \ifnocorrections\else
- \if\Ans@choice1\relax
- \edef\Ans@c@f@Choice{\noexpand\DV{Yes}%
- \ifx\@qzsolndest\@empty\noexpand\Ff{\FfReadOnly}%
- \else
- \ifeq@noquizsolutions
- \noexpand\Ff{\FfReadOnly}%
- \else
- \noexpand\A{\noexpand\quiz@SolutionActionHook}%
- \fi
- \fi
- }%
- \else
- \def\Ans@c@f@Choice{\Ff{\FfReadOnly}}%
- \fi
- \let\late@options\@empty
- \if\Ans@choice1\relax
- \ifx\@qzsolndest\@empty\else
- \ifeq@noquizsolutions\else
- \edef\late@options{\noexpand\BC{\solution@Color}}%
- \fi
- \fi
+ \mbox{\expandafter\check@@Box\expandafter{\cbf@Opts}%
+ {mck.\curr@quiz.\thequestionno.\arabic{quizno}}%
+ {\RadioFieldSize}{\RadioFieldSize}{\Ans@choice\alph{quizno}}%
+ {\eq@protect\A}{\eq@setWidgetProps\eq@Check@driver}%
+ {\Ans@ck@f@Defaults\Ans@ck@f@Actions\every@RadioButton
+ \every@qckCheckbox}}%
+ \ifnocorrections\else
+ \if\Ans@choice\eq@One
+ \edef\Ans@c@f@Choice{\noexpand\DV{Yes}%
+ \ifx\@qzsolndest\@empty\noexpand\Ff{\FfReadOnly}\else
+ \ifeq@noquizsolutions
+ \noexpand\Ff{\FfReadOnly}\else
+ \noexpand\A{\noexpand\quiz@SolutionActionHook}\fi
\fi
+ }%
+ \else
+ \def\Ans@c@f@Choice{\Ff{\FfReadOnly}}%
+ \fi
+ \let\late@options\@empty
+ \if\Ans@choice\eq@One
+ \ifx\@qzsolndest\@empty\else
+ \ifeq@noquizsolutions\else
+ \edef\late@options{\noexpand\BC{\solution@Color}}\fi
+ \fi
+ \fi
% \end{macrocode}
% The top most checkbox
% \begin{macrocode}
- \makebox[0pt][r]{\check@@Box{}%
- {mcq.\curr@quiz.\thequestionno.\arabic{quizno}}%
- {\RadioFieldSize}{\RadioFieldSize}{Yes}{}%
- {\eq@setWidgetProps\eq@Check@driver}%
- {\Ans@c@f@Defaults\Ans@c@f@Choice\every@CheckBox
+ \makebox[0pt][r]{\check@@Box{}%
+ {mcq.\curr@quiz.\thequestionno.\arabic{quizno}}%
+ {\RadioFieldSize}{\RadioFieldSize}{Yes}{}%
+ {\eq@setWidgetProps\eq@Check@driver}%
+ {\Ans@c@f@Defaults\Ans@c@f@Choice\every@CheckBox
% \end{macrocode}
% (2012/12/22) Replace \cs{every@qRadioButton} with \cs{every@qCheckBox}.
% \begin{macrocode}
- \every@qCheckBox\late@options}}%
- \fi
- \Ans@proofing{\RadioFieldSize}%
-\eq@hspanner\ignorespaces}
+ \every@qCheckBox\late@options}}%
+ \fi
+ \Ans@proofing{\RadioFieldSize}\eq@hspanner
+ \ignorespaces
+}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
@@ -6914,9 +7010,9 @@ if (_bOK) {\jsR\jsT
% \begin{macrocode}
\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
+ \noexpand\define@key{bchoice}{\eqi}[\eqi]{%
+ \noexpand\def\noexpand\bChoiceNumCols{\eqi}}%
+ }\temp@expand@def
}
% \end{macrocode}
% The number of columns specified in the answers environment is saved as the value
@@ -6927,8 +7023,8 @@ if (_bOK) {\jsR\jsT
% This is the definition of the random key\IndexKey{random}, a boolean.
% \begin{macrocode}
\define@key{bchoice}{random}[true]{%
- \csname if#1\endcsname\eq@randomizeChoicestrue
- \else\eq@randomizeChoicesfalse\fi
+ \csname if#1\endcsname\eq@randomizeChoicestrue
+ \else\eq@randomizeChoicesfalse\fi
}
% \end{macrocode}
% \changes{v6.3x}{2011/04/05}{%
@@ -6949,20 +7045,19 @@ if (_bOK) {\jsR\jsT
% \end{macrocode}
% If \cs{numCols} is $1$, we use a list environment, otherwise, a tabular is used.
% \begin{macrocode}
-\def\@ansChoices[#1]%
-{%
+\def\@ansChoices[#1]{%
% \end{macrocode}
% We initialize some variables that the new label option uses.
% \begin{macrocode}
- \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
+ \global\let\@tempholdSaveAns\@empty %4/5
+ \global\let\@tempholdSaveChoice\@empty %4/5
+ \global\let\bChoiceLabel\@empty %4/5
+ \setkeys{bchoice}{#1}%
+ \global\eq@tabColCnt=\z@
+ \ifnum\aeb@numCols=\@ne % list mode
+ \def\eq@next{\@layoutListAns}\else % tabular mode
+ \def\eq@next{\@layoutTabularAns{\bChoiceNumCols}}\fi
+ \eq@next
}
\let\eChoices\relax
% \end{macrocode}
@@ -6973,7 +7068,7 @@ if (_bOK) {\jsR\jsT
% should be \cs{eChoices}.)
% \begin{macrocode}
\def\@layoutListAns{\@ifnextchar\Ans{\@getListAns}%
- {\@lookforendansChoices{\@layoutListAns}}%
+ {\@lookforendansChoices{\@layoutListAns}}%
}
% \end{macrocode}
% \changes{v6.3x}{2011/04/05}{%
@@ -6989,11 +7084,11 @@ if (_bOK) {\jsR\jsT
% to \cs{@@@SaveAns}; otherwise, it gobbles all leftovers.
% \begin{macrocode}
\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
+ \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
}
% \end{macrocode}
% \cs{@@@SaveAns} collects the answer to the problem, and placed
@@ -7001,21 +7096,21 @@ if (_bOK) {\jsR\jsT
% the alternative letter as well in \cs{@tempholdSaveChoice}.
% \begin{macrocode}
\long\def\@@@SaveAns#1\eAns{% 4/5
- \g@addto@macro\@tempholdSaveAns{\\{\ignorespaces#1}}%
+ \g@addto@macro\@tempholdSaveAns{\\{\ignorespaces#1}}%
% \end{macrocode}
% This code is expanded before the \cs{Ans} command is, so we'll simulate
% incrementing the \texttt{quizno} counter, \dots
% \begin{macrocode}
- \addtocounter{quizno}{1}%
- \edef\temp@expand{\noexpand\g@addto@macro\noexpand
+ \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
+ \noexpand\\{\ifx\sqstar\@empty\aebChoiceAltFmt\else
+ \ifaebshowgrayletters\Alph{quizno}\else
+ \linkContentFormat\fi\fi}}}\temp@expand
% \end{macrocode}
% and decrement when we are finished adding to the token list.
% \begin{macrocode}
- \addtocounter{quizno}{-1}%
+ \addtocounter{quizno}{-1}%
}
% \end{macrocode}
% \cs{eq@displayAns} is \cs{let} to \verb!\\!. Definition and name may change.
@@ -7035,29 +7130,30 @@ if (_bOK) {\jsR\jsT
\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
+ \ifx\eq@comma\@empty
+ \ifnum\@nameuse{NumAns\eq@namearg}>\tw@
+ \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}
+ \ifnum\@nameuse{NumAns\eq@namearg}<\tw@\else
+ \ifnum\@nameuse{NumAns\eq@namearg}>\tw@\relax
+ \else\leavevmode\space\fi\eqAnd\space\fi
+}
+\long\def\eq@displayAns#1{\advance\@tempcnta\@ne
+ \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}}
+ \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}
+ \eq@insertComma
+ \ifnum\@tempcnta=\@nameuse{NumAns\eq@namearg}\eq@insertAnd\fi#1}
% \end{macrocode}
% \begin{macro}{\useSavedAns}
% \begin{macro}{\useSavedAlts}
@@ -7073,35 +7169,35 @@ if (_bOK) {\jsR\jsT
% \begin{macrocode}
\newcommand{\savedAltFmt}[1]{(#1)}
\newcommand{\useSavedAns}{\bgroup\@ifstar{\useSavedAns@i}
- {\let\eq@insertAnd\@empty\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
+ \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}}
+ {\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
+ \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}}
+ {\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
+ \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}}
% \end{macrocode}
@@ -7110,21 +7206,21 @@ if (_bOK) {\jsR\jsT
% \end{macro}
% \end{macro}
% \begin{macrocode}
-\long\def\@@@SaveAnsGobbleAns#1\eAns{} % 4/5
+\long\def\@@@SaveAnsGobbleAns#1\eAns{}
% \end{macrocode}
% This command gets, and sets the list of alternatives
% \begin{macrocode}
-\long\def\@getListAns\Ans#1\eAns{%\@@par %start new paragraph
+\long\def\@getListAns\Ans#1\eAns{%\@@par
% \end{macrocode}
% We record the list as we process each item.
% \begin{macrocode}
- \eq@saveAns#1\eAns % 4/5
- \Ans#1\vspace{\@rowskip}%
- \@layoutListAns
+ \eq@saveAns#1\eAns
+ \Ans#1\vspace{\@rowskip}%
+ \@layoutListAns
}
\long\def\@lookforendansChoices#1{%
- \@ifnextchar\eChoices{\rowsep{\rowsep@default}%
- \expandafter\@findendans\@gobble}{\expandafter#1\@gobble}%
+ \@ifnextchar\eChoices{\rowsep{\rowsep@default}%
+ \expandafter\@findendans\@gobble}{\expandafter#1\@gobble}%
}
% \end{macrocode}
% The argument is the number of columns to typeset, this number
@@ -7132,10 +7228,10 @@ if (_bOK) {\jsR\jsT
% environment.
% \begin{macrocode}
\def\@layoutTabularAns#1{%
- \let\eq@tabSep\@empty
- \xdef\numShortCols{#1}%
- \ifnum#1>\aeb@numCols \xdef\numShortCols{\aeb@numCols}\fi
- \@@layoutTabularAns
+ \let\eq@tabSep\@empty
+ \xdef\numShortCols{#1}%
+ \ifnum#1>\aeb@numCols \xdef\numShortCols{\aeb@numCols}\fi
+ \@@layoutTabularAns
}
% \end{macrocode}
% If the next token is \cs{Ans} we grab its all stuff between
@@ -7145,98 +7241,99 @@ if (_bOK) {\jsR\jsT
% should be \cs{eChoices}.)
% \begin{macrocode}
\def\@@layoutTabularAns{%
- \@ifnextchar\Ans{\@getTabAns}%
- {\@lookforendansChoices{\@@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}%
+ \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}%
}
% \end{macrocode}
% This command, I think, is executed after we've found the \cs{eChoices}.
% \begin{macrocode}
-\def\@findendans{\@ifnextchar\end{% 4/5
+\def\@findendans{\@ifnextchar\end{%
% \end{macrocode}
% If there is a \cs{bChoiceLabel} we process the alternatives.
% \begin{macrocode}
- \ifx\bChoiceLabel\@empty\else
- \processLabeledAns\fi
- }{\expandafter\@findendans\@gobble}}%
+ \ifx\bChoiceLabel\@empty\else
+ \processLabeledAns\fi
+ }{\expandafter\@findendans\@gobble}}%
% \end{macrocode}
% The command that processes the alternatives.
% \changes{v6.7g}{2013/08/09}{Changed \texttt{\#1} to \cs{the}\cs{@temptokena} Fixing
% a nasty bug. Reported by Christopher C.}
% \begin{macrocode}
\def\defineEachAns#1{\advance\eqtmpcnta\@ne
- \@temptokena={#1}\csarg\xdef
- {SavedAns\bChoiceLabel-Idx\the\eqtmpcnta}{\the\@temptokena}%
- \ifsolutionsonly\else
- {\let\\\relax\eq@IWDefs{\string
- \csarg\string\gdef{SavedAns\bChoiceLabel-Idx\the\eqtmpcnta}%
- {\the\@temptokena}}}\fi
+ \@temptokena={#1}\csarg\xdef
+ {SavedAns\bChoiceLabel-Idx\the\eqtmpcnta}{\the\@temptokena}%
+ \ifsolutionsonly\else
+ {\let\\\relax\eq@IWDefs{\string
+ \csarg\string\gdef{SavedAns\bChoiceLabel-Idx\the\eqtmpcnta}%
+ {\the\@temptokena}}}%
+ \fi
}
\def\defineEachChoice#1{\advance\eqtmpcnta\@ne
- \@temptokena={#1}\csarg\xdef
- {SavedAlts\bChoiceLabel-Idx\the\eqtmpcnta}%
- {\the\@temptokena}\ifsolutionsonly\else
- {\let\\\relax\eq@IWDefs{\string
- \csarg\string
- \gdef{SavedAlts\bChoiceLabel-Idx\the\eqtmpcnta}%
- {\the\@temptokena}}}\fi
+ \@temptokena={#1}\csarg\xdef
+ {SavedAlts\bChoiceLabel-Idx\the\eqtmpcnta}%
+ {\the\@temptokena}\ifsolutionsonly\else
+ {\let\\\relax\eq@IWDefs{\string
+ \csarg\string
+ \gdef{SavedAlts\bChoiceLabel-Idx\the\eqtmpcnta}%
+ {\the\@temptokena}}}\fi
}
\def\processLabeledAns{%
- \bgroup
- \let\label\@gobble
+ \bgroup
+ \let\label\@gobble
% \end{macrocode}
% \changes{v7.7c}{2015/10/08}{Added memory for the case}
% \begin{macrocode}
-\if\aeb@FLOverride\eq@l
- \global\@namedef{caseFor\bChoiceLabel}{\graylettersOff}\else
- \ifaebshowgrayletters
+ \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
- \eqtmpcnta\z@\let\\\defineEachAns\the\toks@
- \xdef\@currNCntAns{\the\eqtmpcnta}\csarg
- \xdef{NumAns\bChoiceLabel}{\@currNCntAns}%
- \ifsolutionsonly\else{\eq@IWDefs{\string
- \csarg\string\gdef{NumAns\bChoiceLabel}{\the\eqtmpcnta}}}\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
- \eqtmpcnta\z@\relax\let\\\defineEachChoice\the\toks@
- \eqtmpcnta\@ne\toks@={}%{\ignorespaces\@gobble}%
- \loop
- \edef\temp@exp{\the\toks@\noexpand\\{%
- \noexpand\useSavedAlts[\the\eqtmpcnta]{\bChoiceLabel}
- \noexpand\useSavedAns[\the\eqtmpcnta]{\bChoiceLabel}}}%
- \toks@=\expandafter{\temp@exp}%
- \ifnum\eqtmpcnta<\@currNCntAns\relax
- \advance\eqtmpcnta\@ne
- \repeat
- \csarg\xdef{SavedAltsAns\bChoiceLabel}{\the\toks@}%
- \ifsolutionsonly\else{\let\\\relax\eq@IWDefs{\string
- \csarg\string\gdef{SavedAltsAns\bChoiceLabel}{\the\toks@}}}\fi
- \egroup
+ \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
+ \eqtmpcnta\z@\let\\\defineEachAns\the\toks@
+ \xdef\@currNCntAns{\the\eqtmpcnta}\csarg
+ \xdef{NumAns\bChoiceLabel}{\@currNCntAns}%
+ \ifsolutionsonly\else{\eq@IWDefs{\string
+ \csarg\string\gdef{NumAns\bChoiceLabel}{\the\eqtmpcnta}}}\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
+ \eqtmpcnta\z@\relax\let\\\defineEachChoice\the\toks@
+ \eqtmpcnta\@ne\toks@={}%{\ignorespaces\@gobble}%
+ \loop
+ \edef\temp@exp{\the\toks@\noexpand\\{%
+ \noexpand\useSavedAlts[\the\eqtmpcnta]{\bChoiceLabel}
+ \noexpand\useSavedAns[\the\eqtmpcnta]{\bChoiceLabel}}}%
+ \toks@=\expandafter{\temp@exp}%
+ \ifnum\eqtmpcnta<\@currNCntAns\relax
+ \advance\eqtmpcnta\@ne
+ \repeat
+ \csarg\xdef{SavedAltsAns\bChoiceLabel}{\the\toks@}%
+ \ifsolutionsonly\else{\let\\\relax\eq@IWDefs{\string
+ \csarg\string\gdef{SavedAltsAns\bChoiceLabel}{\the\toks@}}}\fi
+ \egroup
}
% \end{macrocode}
% \end{macro}
@@ -7264,7 +7361,7 @@ if (_bOK) {\jsR\jsT
% We redefine \cs{nextrandom} from \texttt{random.tex} to save the initializing seed.
% \begin{macrocode}
\def\nextrandom{\begingroup
- \ifnum\randomi<\@ne % then initialize with time
+ \ifnum\randomi<\@ne % then initialize with time
\global\randomi\time
\global\multiply\randomi388 \global\advance\randomi\year
\global\multiply\randomi31 \global\advance\randomi\day
@@ -7276,16 +7373,16 @@ if (_bOK) {\jsR\jsT
% \changes{v6.7f}{2013/08/03}{Save the initial seed value to \cs{eqInitSeedValue}.}
% \begin{macrocode}
\xdef\InitSeedValue{\the\randomi}%
- \fi
- \count@ii\randomi
- \divide\count@ii 127773 % modulus = multiplier * 127773 + 2836
- \count@\count@ii
- \multiply\count@ii 127773
- \global\advance\randomi-\count@ii % random mod 127773
- \global\multiply\randomi 16807
- \multiply\count@ 2836
- \global\advance\randomi-\count@
- \ifnum\randomi<\z@ \global\advance\randomi 2147483647\relax\fi
+ \fi
+ \count@ii\randomi
+ \divide\count@ii 127773 % modulus = multiplier * 127773 + 2836
+ \count@\count@ii
+ \multiply\count@ii 127773
+ \global\advance\randomi-\count@ii % random mod 127773
+ \global\multiply\randomi 16807
+ \multiply\count@ 2836
+ \global\advance\randomi-\count@
+ \ifnum\randomi<\z@\global\advance\randomi 2147483647\relax\fi
\endgroup
}
% \end{macrocode}
@@ -7311,29 +7408,31 @@ if (_bOK) {\jsR\jsT
% Added support for randomizing the multiple choices, requires the use of \cs{bChoices}
% and \cs{eChoices}.
% }
-% \begin{macrocode}
-\def\@ansChoices[#1]%
-{%
- \global\let\@tempholdSaveAns\@empty % 5/24
- \global\let\@tempholdSaveChoice\@empty % 5/24
- \global\let\bChoiceLabel\@empty % 5/24
- \ifeq@randomizeallChoices
- \setkeys{bchoice}{#1,random=true}\else
- \setkeys{bchoice}{#1}\fi
- \global\eq@tabColCnt=0
- \ifeq@randomizeChoices\expandafter\@@bChoices
- \else\expandafter\@@ansChoices\fi
+% \changes{v8.6.2}{2021/01/20}{Incorporated \string\cs{if@DoNotRandomize}
+% into the \string\cs{@ansChoices} macro for MC and MS questions}
+% \begin{macrocode}
+\def\@ansChoices[#1]{%
+ \global\let\@tempholdSaveAns\@empty
+ \global\let\@tempholdSaveChoice\@empty
+ \global\let\bChoiceLabel\@empty
+ \ifeq@randomizeallChoices
+ \setkeys{bchoice}{#1,random=true}\else
+ \setkeys{bchoice}{#1}\fi
+ \global\eq@tabColCnt=\z@
+ \if@DoNotRandomize\eq@randomizeChoicesfalse\fi
+ \ifeq@randomizeChoices\expandafter\@@bChoices
+ \else\expandafter\@@ansChoices\fi
}
% \end{macrocode}
% This is actually the old \cs{@ansChoices} only slightly modified.
% \begin{macrocode}
\def\@@ansChoices{%
- \ifnum\aeb@numCols=1 % list mode
- \def\eq@next{\@layoutListAns}%
- \else % tabular mode
- \edef\eq@next{\noexpand\@layoutTabularAns{\bChoiceNumCols}}%
- \fi
- \eq@next
+ \ifnum\aeb@numCols=\@ne % list mode
+ \def\eq@next{\@layoutListAns}%
+ \else % tabular mode
+ \edef\eq@next{\noexpand\@layoutTabularAns{\bChoiceNumCols}}%
+ \fi
+ \eq@next
}
% \end{macrocode}
% The following are some registers to hold integers and tokens.
@@ -7348,21 +7447,21 @@ if (_bOK) {\jsR\jsT
% otherwise, we're finished.
% \begin{macrocode}
\def\@@bChoices{\gdef\@temphold{}\gdef\@tempholdrandom{}%
- \gdef\@tempholdfreeze{}\aeb@searchfortoken{\@getAns}%
+ \gdef\@tempholdfreeze{}\aeb@searchfortoken{\@getAns}%
}
\def\aeb@searchfortoken#1{%
- \@ifnextchar\Ans{\advance\aeb@numChoices1\relax#1}
- {\@ifnextchar\eFreeze{\expandafter\@getFreezeAns\@gobble}
- {\@ifnextchar\par{\def\@@temp{\aeb@searchfortoken{#1}}%
- \expandafter\@@temp\@gobble}{\@eChoices}}}%
+ \@ifnextchar\Ans{\advance\aeb@numChoices1\relax#1}
+ {\@ifnextchar\eFreeze{\expandafter\@getFreezeAns\@gobble}
+ {\@ifnextchar\par{\def\@@temp{\aeb@searchfortoken{#1}}%
+ \expandafter\@@temp\@gobble}{\@eChoices}}}%
}
% \end{macrocode}
% The non-frozen questions will be held in the macro \cs{@temphold}.
% We keep track of the number of choices using the counter \cs{aeb@numChoices}.
% \begin{macrocode}
\long\def\@getAns\Ans#1\eAns{%
- \g@addto@macro\@temphold{{\Ans#1\eAns}}%
- \aeb@searchfortoken{\@getAns}%
+ \g@addto@macro\@temphold{{\Ans#1\eAns}}%
+ \aeb@searchfortoken{\@getAns}%
}
% \end{macrocode}
% We've encountered \cs{eFreeze}, if the next token is \cs{Ans}, go get the
@@ -7374,14 +7473,14 @@ if (_bOK) {\jsR\jsT
% in the macro \cs{@tempholdfreeze}.
% \begin{macrocode}
\long\def\@@getFreezeAns\Ans#1\eAns{%
- \g@addto@macro\@tempholdfreeze{\Ans#1\eAns}%
- \aeb@searchfortoken{\@@getFreezeAns}%
+ \g@addto@macro\@tempholdfreeze{\Ans#1\eAns}%
+ \aeb@searchfortoken{\@@getFreezeAns}%
}
% \end{macrocode}
% When we are finished finding all the choices, we come here to randomize the choices.
% \begin{macrocode}
\long\def\@eChoices#1\eChoices{%
- \aeb@randomizeChoices{\the\aeb@numChoices}%
+ \aeb@randomizeChoices{\the\aeb@numChoices}%
}
% \end{macrocode}
% The routine that randomizes the choices. Basically, we use \texttt{random.tex} to get
@@ -7391,46 +7490,46 @@ if (_bOK) {\jsR\jsT
% here \cs{aeb@hold} is used as a scratch token register.
% \begin{macrocode}
\def\aeb@randomizeChoices#1{%
- \setrannum{\aeb@ranChoice}{1}{#1}
- \eqtmpcnta\z@\aeb@hold=\expandafter{\@temphold}\def\@temphold{}%
- \expandafter\@tfor\expandafter
- \@temp\expandafter:\expandafter=\the\aeb@hold \do {%
- \advance\eqtmpcnta\@ne
- \ifnum\eqtmpcnta=\aeb@ranChoice\relax
- \aeb@hold=\expandafter\expandafter\expandafter
- {\expandafter\@tempholdrandom\@temp}%
- \edef\@tempholdrandom{\the\aeb@hold}%
- \else
- \aeb@hold=\expandafter\expandafter\expandafter
- {\expandafter\@temphold\expandafter{\@temp}}%
- \edef\@temphold{\the\aeb@hold}%
- \fi
- }%
+ \setrannum{\aeb@ranChoice}{1}{#1}
+ \eqtmpcnta\z@\aeb@hold=\expandafter{\@temphold}\def\@temphold{}%
+ \expandafter\@tfor\expandafter
+ \@temp\expandafter:\expandafter=\the\aeb@hold \do {%
+ \advance\eqtmpcnta\@ne
+ \ifnum\eqtmpcnta=\aeb@ranChoice\relax
+ \aeb@hold=\expandafter\expandafter\expandafter
+ {\expandafter\@tempholdrandom\@temp}%
+ \edef\@tempholdrandom{\the\aeb@hold}%
+ \else
+ \aeb@hold=\expandafter\expandafter\expandafter
+ {\expandafter\@temphold\expandafter{\@temp}}%
+ \edef\@temphold{\the\aeb@hold}%
+ \fi
+ }%
% \end{macrocode}
% We repeat this process a total of \cs{aeb@numChoices}, the original count of the number
% of choices. Once finished, we go to \cs{aeb@finishedRandomizing} to lay out the
% randomized choices for typesetting.
% \begin{macrocode}
- \aeb@numChoices=#1
- \advance\aeb@numChoices-1
- \ifnum\aeb@numChoices=0\relax
- \def\aeb@next{\aeb@finishedRandomizing}\else
- \def\aeb@next{\aeb@randomizeChoices{\the\aeb@numChoices}}\fi
- \aeb@next
+ \aeb@numChoices=#1
+ \advance\aeb@numChoices\m@ne
+ \ifnum\aeb@numChoices=\z@
+ \def\aeb@next{\aeb@finishedRandomizing}\else
+ \def\aeb@next{\aeb@randomizeChoices{\the\aeb@numChoices}}\fi
+ \aeb@next
}
% \end{macrocode}
% This command assembles the questions held in random order in the command \cs{@tempholdrandom} and
% the frozen ones held in \cs{@tempholdfreeze}, and lays out the choices for typesetting.
% \begin{macrocode}
\def\aeb@finishedRandomizing{%
- \aeb@hold=\expandafter\expandafter\expandafter
- {\expandafter\@tempholdrandom\@tempholdfreeze}%
- \gdef\@temphold{}\gdef\@tempholdrandom{}\gdef\@tempholdfreeze{}%
- \edef\finished@Randomizing{%
- \noexpand\@@ansChoices
- \the\aeb@hold
- \noexpand\eChoices}%
- \finished@Randomizing
+ \aeb@hold=\expandafter\expandafter\expandafter
+ {\expandafter\@tempholdrandom\@tempholdfreeze}%
+ \gdef\@temphold{}\gdef\@tempholdrandom{}\gdef\@tempholdfreeze{}%
+ \edef\finished@Randomizing{%
+ \noexpand\@@ansChoices
+ \the\aeb@hold
+ \noexpand\eChoices}%
+ \finished@Randomizing
}
% \end{macrocode}
% \begin{macro}{\saveRandomSeed}
@@ -7455,21 +7554,20 @@ if (_bOK) {\jsR\jsT
% by \textsf{ran\_toks}. Now, there share a common aux file and common initial and final
% seeds.
% \begin{macrocode}
-%\def\saveRandomSeed{\AtEndDocument{\eq@writeRandomData}}
\def\saveRandomSeed{\PackageInfo{exerquiz}
- {The command \string\saveRandomSeed\space
- is deprecated.\MessageBreak Seed automatically saved}}
+ {The command \string\saveRandomSeed\space
+ is deprecated.\MessageBreak Seed automatically saved}}
% \end{macrocode}
% I \cs{let} the commands in this file to the companion commands in \textsf{ran\_toks} file.
% The user can use either set of commands \cs{inputRandomSeed} or \cs{useLastSeed} as one
% pair and \cs{useRandomSeed} and \cs{useThisSeed} as the other pair.
% \begin{macrocode}
\@ifpackageloaded{ran_toks}{%
- \let\inputRandomSeed\useLastAsSeed
- \let\useRandomSeed\useThisSeed
+ \let\inputRandomSeed\useLastAsSeed
+ \let\useRandomSeed\useThisSeed
}{%
- \def\inputRandomSeed{\eq@readRandomData}%
- \def\useRandomSeed#1{\saveseedfalse\randomi=#1}%
+ \def\inputRandomSeed{\eq@readRandomData}%
+ \def\useRandomSeed#1{\saveseedfalse\randomi=#1}%
}
\def\InitSeedValue{\the\randomi} % dps
\@ifundefined{ifsaveseed}{\newif\ifsaveseed\saveseedtrue}{} % dps
@@ -7478,40 +7576,39 @@ if (_bOK) {\jsR\jsT
% \end{macro}
% \end{macro}
% \begin{macrocode}
-\def\eq@writeRandomData
-{%
- \ifsaveseed
- \@ifundefined{saveseedinfo}{\newwrite\saveseedinfo}{}
- \immediate\openout \saveseedinfo \jobname_rt.sav
- \let\verbatim@out\saveseedinfo
- \def\eqrt@msgi{initializing seed value}%
- \def\eqrt@msgii{last random number used}%
- \uccode`c=`\%\uppercase{%
- \immediate\write\verbatim@out
- {\InitSeedValue\space c \eqrt@msgi}%
- \immediate\write\verbatim@out
- {\the\randomi\space c \eqrt@msgii}%
- }\immediate\closeout\saveseedinfo
- \fi
+\def\eq@writeRandomData{%
+ \ifsaveseed
+ \@ifundefined{saveseedinfo}{\newwrite\saveseedinfo}{}
+ \immediate\openout \saveseedinfo \jobname_rt.sav
+ \let\verbatim@out\saveseedinfo
+ \def\eqrt@msgi{initializing seed value}%
+ \def\eqrt@msgii{last random number used}%
+ \uccode`c=`\%\uppercase{%
+ \immediate\write\verbatim@out
+ {\InitSeedValue\space c \eqrt@msgi}%
+ \immediate\write\verbatim@out
+ {\the\randomi\space c \eqrt@msgii}%
+ }\immediate\closeout\saveseedinfo
+ \fi
}
\AtEndDocument{\eq@writeRandomData}
% \end{macrocode}
% Save the data to the file \cs{jobname\_ran.sav}.
% \begin{macrocode}
\def\eq@readRandomData{\IfFileExists{\jobname_rt.sav}{%
- \PackageInfo{exerquiz}{Inputting \jobname_rt.sav}%
- \@ifundefined{readsavfile}{\newread\readsavfile}{}%
- \openin\readsavfile=\jobname_rt.sav
- \read\readsavfile to \InitSeedValue
- \read\readsavfile to \eqlastRandomNum
- \closein\readsavfile
- \randomi=\eqlastRandomNum
- \xdef\InitSeedValue{\the\randomi}%
- \immediate\closeout\readsavfile
+ \PackageInfo{exerquiz}{Inputting \jobname_rt.sav}%
+ \@ifundefined{readsavfile}{\newread\readsavfile}{}%
+ \openin\readsavfile=\jobname_rt.sav
+ \read\readsavfile to \InitSeedValue
+ \read\readsavfile to \eqlastRandomNum
+ \closein\readsavfile
+ \randomi=\eqlastRandomNum
+ \xdef\InitSeedValue{\the\randomi}%
+ \immediate\closeout\readsavfile
}{%
- \PackageInfo{exerquiz}{\jobname_rt.sav cannot
- be found, \MessageBreak
- using the random initializer}%
+ \PackageInfo{exerquiz}{\jobname_rt.sav cannot
+ be found, \MessageBreak
+ using the random initializer}%
}}
% \end{macrocode}
% \begin{macrocode}
@@ -7551,27 +7648,27 @@ if (_bOK) {\jsR\jsT
%}
% \begin{macrocode}
\def\REF{\@ifstar{\let\isREFstar\eq@One\aeb@REFstar}
- {\let\isREFstar\eq@Zero\aeb@REF}}
+ {\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}%
+ {\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}%
+ {\ifaebshowgrayletters\aeb@buildUpperCaseRef{#1}%
+ \else\ref{#1}\fi}%
}
%</package|eqexam>
%<*eqexam>
\def\aeb@buildUpperCaseRef#1{%
- \xdef\tmp@expand{\aeb@exiii\@firstoftwo\csname r@#1\endcsname}%
- \xdef\tmp@expand{\uppercase{\tmp@expand}}\tmp@expand
+ \xdef\tmp@expand{\aeb@exiii\@firstoftwo\csname r@#1\endcsname}%
+ \xdef\tmp@expand{\uppercase{\tmp@expand}}\tmp@expand
}
%</eqexam>
%<*package>
\def\aeb@buildUpperCaseRef#1{%
- \xdef\tmp@expand{\aeb@exiii\@firstoffive\csname r@#1\endcsname}%
- \xdef\tmp@expand{\uppercase{\tmp@expand}}%
- \if\isREFstar\eq@One\tmp@expand\else\hyperref[#1]{\tmp@expand}\fi
+ \xdef\tmp@expand{\aeb@exiii\@firstoffive\csname r@#1\endcsname}%
+ \xdef\tmp@expand{\uppercase{\tmp@expand}}%
+ \if\isREFstar\eq@One\tmp@expand\else\hyperref[#1]{\tmp@expand}\fi
}
% \end{macrocode}
% \end{macro}
@@ -7600,10 +7697,10 @@ if (_bOK) {\jsR\jsT
% \begin{macrocode}
\let\insert@circlesymbol\@empty
\def\useMCCircles{\useForms
- \ifaeb@usecircles\else
- \global\aeb@usecirclestrue
- \gdef\insert@circlesymbol{\symbolchoice{circle}}%
- \fi
+ \ifaeb@usecircles\else
+ \global\aeb@usecirclestrue
+ \gdef\insert@circlesymbol{\symbolchoice{circle}}%
+ \fi
}
% \end{macrocode}
% \end{macro}
@@ -7613,9 +7710,9 @@ if (_bOK) {\jsR\jsT
% to their values prior to the last invocation of \cs{useMCCircles}.
% \begin{macrocode}
\def\useMCRects{\useForms
- \ifaeb@usecircles\global\aeb@usecirclesfalse
- \global\let\insert@circlesymbol\@empty
- \fi
+ \ifaeb@usecircles\global\aeb@usecirclesfalse
+ \global\let\insert@circlesymbol\@empty
+ \fi
}
\let\useMCCRects\useMCRects
% \end{macrocode}
@@ -7667,26 +7764,25 @@ if (_bOK) {\jsR\jsT
% question label, i.e., \texttt{2(a)(ii)}. These two lines are repeated for
% the \texttt{shortquiz} and \texttt{quiz} environments.
% \begin{macrocode}
- \let\@currentQues\@empty
- \xdef\eq@pageThisQ{\the\c@page}%
- \global\let\eqQzQuesList\@empty
- \xdef\oField{#1}\xdef\curr@quiz{#1}\xdef\currQuiz{#1}%
- \g@addto@macro\ListOfSQuizNames{,#1}\let\@qzsolndest\@empty
-% \stepcounter{questionno}%
- \let\eqQuizType\isSQZ\gdef\eqPTs{1}\global\let\eqQT\eq@na
- \let\answers\answers@sq
- \let\endanswers\endanswers@sq
- \let\manswers\manswers@sq
- \let\endmanswers\endmanswers@sq
- \let\solution\solution@sq
- \let\endsolution\endsolution@sq
- \noindent\oqpriorhook\sq@IDTxtField\ifx\aebTitleQuiz\@empty
- \else\aebtitleQuiz\fi\ignorespaces
+ \let\@currentQues\@empty
+ \xdef\eq@pageThisQ{\the\c@page}\global
+ \let\eqQzQuesList\@empty
+ \xdef\oField{#1}\xdef\curr@quiz{#1}\xdef\currQuiz{#1}%
+ \g@addto@macro\ListOfSQuizNames{,#1}\let\@qzsolndest\@empty
+ \let\eqQuizType\isSQZ\gdef\eqPTs{1}\global\let\eqQT\eq@na
+ \let\answers\answers@sq
+ \let\endanswers\endanswers@sq
+ \let\manswers\manswers@sq
+ \let\endmanswers\endmanswers@sq
+ \let\solution\solution@sq
+ \let\endsolution\endsolution@sq
+ \noindent\oqpriorhook\sq@IDTxtField\ifx\aebTitleQuiz\@empty
+ \else\aebtitleQuiz\fi\ignorespaces
}{%
- \global\let\aebtitleQuiz\@empty
- \global\let\aebTitleQuiz\@empty
- \global\let\eq@tq@star\relax
- \aftergroup\ignorespaces
+ \global\let\aebtitleQuiz\@empty
+ \global\let\aebTitleQuiz\@empty
+ \global\let\eq@tq@star\relax
+ \aftergroup\ignorespaces
}
\def\oSolution#1{\edef\@qzsolndest{#1}}
% \end{macrocode}
@@ -7833,11 +7929,11 @@ if (_bOK) {\jsR\jsT
% \begin{macrocode}
\def\eq@rpl#1#2{_rplVarsBy('#1','#2')@} % dps17
% \end{macrocode}
-% A variation on the objective style math problem, is to initially populate the response box with an
+% \textbf{Correcting an incorrect entry.} A variation on the objective style math problem is to initially populate the response box with an
% incorrect answer and ask the student to correct it. (Good for future teachers.) The problem type set
% straightforward when multi-variables are not used, just specify the \cs{V} and \cs{DV} keys in the
-% optional argument of \cs{RespBoxMath}. When multi-variables are used, we have to precede the question
-% with \DescribeMacro{\setInitAltAppr}\cs{setInitAltAppr}. There are two variations, the first is for
+% optional argument of \cs{RespBoxMath}. When multi-variables are used, we enclose the question
+% with \DescribeMacro{\bInitAltAppr}\cs{bInitAltAppr}/\allowbreak\DescribeMacro{\eInitAltAppr}\cs{eInitAltAppr}. There are two variations, the first is for
% a non-\app{dvips/Distiller} workflow (document JavaScript are embedded at the creation of the PDF;
% the second variation is with Distiller, where the document JavaScript is embedded with \app{Acrobat}
% after the creation of the PDF. In the latter case, the JavaScript functions used below (\texttt{processMathVars},
@@ -7845,13 +7941,17 @@ if (_bOK) {\jsR\jsT
% opened in \app{Acrobat}. As a result, an exception is thrown. When the exception is thrown,
% \texttt{app.setTimeOut} gives a delay and the field is reset after 25 milliseconds, this causes
% the \emph{initial} alternate appearance to appear, if that is desired.
-% \changes{v8.1a}{2017/09/03}{Add \string\cs{setInitAltAppr} for setting the initial alternate appearance}
+% \changes{v8.1a}{2017/09/03}{Added \string\cs{bInitAltAppr}/\string\allowbreak\string\cs{eInitAltAppr}
+% command pair for setting the initial alternate appearance}
+% \begin{macrocode}
+\ifnum\eq@drivernum=\z@
+ \def\RorRT{\r\t}\else\def\RorRT{\r}\fi
+% \end{macrocode}
+% The following commands are in support of the \cs{bInitAltAppr}/\allowbreak\cs{eInitAltAppr} command pair.
% \begin{macrocode}
-\ifnum\eq@drivernum=0\def\RorRT{\r\t}\else\def\RorRT{\r}\fi
\def\toAltApprCnt{0}\def\toAltApprVar{_toAltAppr\toAltApprCnt}
\def\toAltApprCntInc{{\@tempcnta=\toAltApprCnt\relax
- \advance\@tempcnta1\relax
- \xdef\toAltApprCnt{\the\@tempcnta}}}
+ \advance\@tempcnta\@ne\xdef\toAltApprCnt{\the\@tempcnta}}}
\def\setCoreInitAltAppr{%
var\eqSP_substVars=\indepVars;\RorRT
var\eqSP_mathVars=processMathVars(_substVars);\RorRT
@@ -7859,10 +7959,18 @@ if (_bOK) {\jsR\jsT
event.value=RespBoxAppr(event);\RorRT
getSubstValue.aSubsts=[];%
}
+% \end{macrocode}
+% \leavevmode\DescribeMacro{\bInitAltAppr}\DescribeMacro{\eInitAltAppr} This command pair
+% are used to set the initial value of a \cs{RespBoxMath} field.
+% See the {Acro\negthinspace\TeX} article \url{http://www.acrotex.net/blog/?p=1335}
+% for a discussion of the use of \cs{bInitAltAppr}/\allowbreak
+% \cs{bInitAltAppr}.
+% An alternate method is to use \cs{formatInitAltApprs} directly
+% \begin{macrocode}
\def\bInitAltAppr{\ifShowAppr
\def\ShowApprSAVE{true}\toAltApprCntInc\ShowApprfalse
- \def\eqAddAAFormat{\ifnum\eq@drivernum=0try\eqLBr\RorRT\fi
- \setCoreInitAltAppr\ifnum\eq@drivernum=0 \r\eqRBr catch(e){\RorRT
+ \def\eqAddAAFormat{\ifnum\eq@drivernum=\z@ try\eqLBr\RorRT\fi
+ \setCoreInitAltAppr\ifnum\eq@drivernum=\z@\r\eqRBr catch(e){\RorRT
var\eqSP\toAltApprVar=%
app.setTimeOut('this.resetForm("'+event.target.name+'");%
app.clearTimeOut(\toAltApprVar);',250);\r}\fi}\else
@@ -7875,61 +7983,85 @@ if (_bOK) {\jsR\jsT
% \changes{v6.4c}{2011/07/01}{\cs{RespBoxMath} now records its lists of
% independent variables under the global variable \texttt{\_mathVars}.}
% \begin{macrocode}
-\def\AAKqRespBoxMath{%
+\begin{defineJS}[\makeesc\*\makecmt\%]{\AAKqRespBoxMath}
% \end{macrocode}
% \cs{AAKqRespBoxMath} is the default keystroke action script for \cs{RespBoxMath}
% \begin{macrocode}
- if(event.willCommit){\r\t
- RecordPointValue(\eqPTs,\thequestionno\ifx\grpquestions1,%
-\thegrpquestionno,\grpPointValue,\grpTotalWeight,%
-"\grpEvalFunction"\fi);\r\t
- RecordProblemType("\eqQT",\thequestionno);\r\t
+if(event.willCommit){
+ RecordPointValue(*eqPTs,*thequestionno*ifx*grpquestions*eq@One,%
+*thegrpquestionno,*grpPointValue,*grpTotalWeight,%
+"*grpEvalFunction"*fi);
+ RecordProblemType("*eqQT",*thequestionno);
% \end{macrocode}
% If there are substitute variables, \cs{ifSubstVars} is true, and the script below
% are the lines developed in support of multi-letter variables.
% \begin{macrocode}
-\ifSubstVars % dps17
- var\eqSP_substVars=\indepVars;\r\t
- var\eqSP_mathVars=processMathVars(_substVars);\r\t
- var\eqSP_substValue=getSubstValue(_substVars,event.value);\r\t
- var\eqSP_substAns=getSubstValue(_substVars,"\eqCorrectAns");\r\t
- var\eqSP retn=\processJSfunc(\rbArgs,%
- \compareJSfunc,_substValue);\r\t
-\else
- var\eqSP_mathVars=\indepVars;\r\t
- var\eqSP retn=\processJSfunc(\rbArgs,\compareJSfunc);\r\t
-\fi
- ProcUserResp(retn,event.value,\thequestionno,%
-0\ifx\grpquestions1,\thegrpquestionno\fi);\r
- }\r
- if (!isQuizInitialized("\currQuiz")) {\r\t
- \eqObjAlert eqAppAlert(InitMsg("\bqlabelISO"),3);\r\t
- event.rc = false;\r
- }
+*ifSubstVars%
+ var _substVars=*indepVars;
+ var _mathVars=processMathVars(_substVars);
+ var _substValue=getSubstValue(_substVars,event.value);
+ var _substAns=getSubstValue(_substVars,"*eqCorrectAns");
+ var retn=*processJSfunc(*rbArgs,%
+ *compareJSfunc,_substValue);*else%
+ var _mathVars=*indepVars;
+ var retn=*processJSfunc(*rbArgs,*compareJSfunc);*fi
+ ProcUserResp(retn,event.value,*thequestionno,0%
+*ifx*grpquestions*eq@One,*thegrpquestionno*fi);
+}
+if (!isQuizInitialized("*currQuiz")) {
+ *eqObjAlert*eqAppAlert(InitMsg("*bqlabelISO"),3);
+ event.rc = false;%
+*ifx*eqAddAAKeystroke*@empty*else
+*eqAddAAKeystroke*fi
}
-\def\RespBoxMathDefaults
-{%
- \BC{0 0 0}\S{S}\textColor{0 g}\F{\FPrint}\W{1}
+\end{defineJS}
+\def\RespBoxMathDefaults{%
+ \BC{0 0 0}\S{S}\textColor{0 g}\F{\FPrint}\W{1}
}
-\def\moreRespBoxMathDefaults
-{%
- \edef\@moreRespBoxMathDefaults{%
- \if\eqQuizType\isQZ\ifx\eq@online\eq@YES
- \ifeq@noquizsolutions
- \else\noexpand\Ff{\FfReadOnly}\fi\fi\fi
- }%
+\def\moreRespBoxMathDefaults{%
+ \edef\@moreRespBoxMathDefaults{%
+ \if\eqQuizType\isQZ\ifx\eq@online\eq@YES
+ \ifeq@noquizsolutions
+ \else\noexpand\Ff{\FfReadOnly}\fi\fi\fi
+ }%
}
\let\eqAddAAFormat\@empty
% \end{macrocode}
% \DescribeMacro{\eqSP}\cs{eqSP} is a space character to keep \textsf{dvips} from breaking lines at space.
% \begin{macrocode}
-\def\eqSP{\string\040} % dps17
+\def\eqSP{\string\040}
\def\eqLBr{\string\173}
\def\eqRBr{\string\175}
+% \end{macrocode}
+% Keystroke action for \cs{RespBoxMath}.
+% \begin{macrocode}
+\begin{defineJS}[\makeesc\!\makecmt\%]{\rbmAAKey}
+if(event.willCommit) {
+!ifSubstVars%
+% \end{macrocode}
+% If there are multi-letter variables (\cs{SubstVarstrue}), we insert the code developed.
+% \begin{macrocode}
+ var _substVars=!indepVars;
+ var _mathVars=processMathVars(_substVars);
+ var _substValue=getSubstValue(_substVars,event.value);
+ var _substAns=getSubstValue(_substVars,"!eqCorrectAns");
+ var retn=!processJSfunc(!rbArgs,%
+!compareJSfunc,_substValue);!else%
+ var _mathVars=!indepVars;
+ var retn=!processJSfunc(!rbArgs,!compareJSfunc);!fi%
+!ifx!@sqTurnOffAlerts!eq@One
+ OnBlurRespBox(retn,"!curr@quiz");!fi%
+!ifx!eqAddAAKeystroke!@empty!else
+!eqAddAAKeystroke!fi
+}
+\end{defineJS}
+% \end{macrocode}
+% The actions of \cs{RespBoxMath}
+% \begin{macrocode}
\def\@@RespBoxMathActions{%
\AA{\if\eqQuizType\isQZ
- \AAKeystroke{\AAKqRespBoxMath\eqAddAAKeystroke}
- \AAFormat{\ifShowAppr\ifSubstVars\ifarrowDelim % dps17
+ \AAKeystroke{\AAKqRespBoxMath}
+ \AAFormat{\ifShowAppr\ifSubstVars\ifarrowDelim
% \end{macrocode}
% The \texttt{RespBoxApp()} JavaScript function replaces the multi-letter variable (\texttt{alpha}, for example)
% with its appearance (|\\u03B1|, eg).
@@ -7937,31 +8069,8 @@ if (_bOK) {\jsR\jsT
try{event.value=RespBoxAppr(event);}catch(e){}\r
\fi\fi\fi\eqAddAAFormat}
\else
- \AAKeystroke{if(event.willCommit) {\r\t
-\ifSubstVars%
-% \end{macrocode}
-% If there are multi-letter variables (\cs{SubstVarstrue}), we insert the code developed.
-% \begin{macrocode}
- var\eqSP_substVars=\indepVars;\r\t
- var\eqSP_mathVars=processMathVars(_substVars);\r\t
- var\eqSP_substValue=getSubstValue(_substVars,event.value);\r\t
- var\eqSP_substAns=getSubstValue(_substVars,"\eqCorrectAns");\r\t
- var\eqSP retn=\processJSfunc(\rbArgs,%
- \compareJSfunc,_substValue);\r\t
-\else
- var\eqSP_mathVars=\indepVars;\r\t
- var\eqSP retn=\processJSfunc(\rbArgs,\compareJSfunc);
-\fi
-\if\@sqTurnOffAlerts1%
- OnBlurRespBox(retn,"\curr@quiz");
-\fi
-% \end{macrocode}
-% Moved \cs{eqAAKeystrokArg} from the conditional to the position below.
-% \changes{v7.8i}{2017/07/21}{Moved \string\cs{eqAAKeystrokArg}}
-% \begin{macrocode}
- \eqAddAAKeystroke\r
- }}
- \AAFormat{\ifShowAppr\ifSubstVars\ifarrowDelim % dps17
+ \AAKeystroke{\rbmAAKey}
+ \AAFormat{\ifShowAppr\ifSubstVars\ifarrowDelim
try{event.value=RespBoxAppr(event);}catch(e){}\r\fi\fi\fi
\eqAddAAFormat}%
\AAOnFocus{\JS{var retn = null;}}%
@@ -8052,13 +8161,13 @@ if (_bOK) {\jsR\jsT
\def\defaultRDPrecision#1{\def\eq@defaultRDPrecision{#1}}
\defaultRDPrecision{1E-14}
% \end{macrocode}
-% dps/change 02/23/07 Here we try to implement a suggest of Bruce Wagner. If the tolerance
+% dps/change 02/23/07 Here we try to implement a suggestion of Bruce Wagner. If the tolerance
% is set to zero, then use \texttt{reldiffCompare} as the default compare, and set the tolerance
% to some small value. Here, the small value is the value of the command
% \cs{eq@defaultRDPrecision} which can be set by \cs{defaultRDPrecision}. The default definition
% is \verb!\defaultRDPrecision{1E-14}!.
% \begin{macrocode}
-\newif\ifarrowDelim\arrowDelimfalse % dps17
+\newif\ifarrowDelim\arrowDelimfalse
% \end{macrocode}
% The problem is to detect when \cs{indepVars} contains the arrow notation (\verb~->~), this signals
% that the appearance of the user's response is to be replaced by another appearance. The command
@@ -8198,32 +8307,40 @@ if (_bOK) {\jsR\jsT
% \cs{RespBoxMath} continues here
% \begin{macrocode}
\def\@eq@RespB@x#1(#2)[#3]#4#5#6{\xdef\@qzsolndest{#3}% dps17
- \gdef\indepVars{"#2"}\isFrstrpl#2\@nil\if\frstIsrpl\eq@YES
- \def\@IVi{#2}\else\expandafter\def\expandafter
- \@IVi\expandafter{#2}\fi\edef\@IVii{#2}\ifx\@IVi\@IVii
+ \gdef\indepVars{"#2"}\isFrstrpl#2\@nil
+ \if\frstIsrpl\eq@YES
+ \def\@IVi{#2}\else\expandafter\def\expandafter
+ \@IVi\expandafter{#2}\fi
+ \edef\@IVii{#2}%
+ \ifx\@IVi\@IVii
% \end{macrocode}
% If \cs{indepVars} (\texttt{\#2}) does not contain \cs{rpl}, the two versions
% of \cs{@IVi} and \cs{@IVii} should compare favorably. If they differ, the difference
% is due to the presence of \cs{rpl}.
% \begin{macrocode}
- \global\SubstVarsfalse\else\global\SubstVarstrue
- \isAltApprSpec{#2}\fi
+ \global\SubstVarsfalse
+ \else
+ \global\SubstVarstrue
+ \isAltApprSpec{#2}%
+ \fi
% \end{macrocode}
% \textbf{Counting number of variables.} We count the number of independent variables.
% \begin{macrocode}
- \cntVars{#2}\def\eq@precision{#5}%
- \ifx\eq@precision\eq@ZERO
- \def\eq@defaultCompare{reldiffCompare}%
+ \cntVars{#2}\def\eq@precision{#5}%
+ \ifx\eq@precision\eq@ZERO
+ \def\eq@defaultCompare{reldiffCompare}%
% \end{macrocode}
% (2017/01/11) Replace \texttt{\#1} by \cs{eqCorrectAns} to delay expansion
% \changes{v7.8d}{2017/01/11}{Replace \string\texttt{\#1} by \string\cs{eqCorrectAns} to delay expansion}
% \begin{macrocode}
- \def\rbArgstmp{\rbFlag,% dps17
- \ifSubstVars_substAns\else"#1"\fi,#4,%
- \eq@defaultRDPrecision}\else
- \def\eq@defaultCompare{diffCompare}%
- \def\rbArgstmp{\rbFlag,% dps17
- \ifSubstVars_substAns\else"#1"\fi,#4,#5}\fi
+ \def\rbArgstmp{\rbFlag,%
+ \ifSubstVars_substAns\else"#1"\fi,#4,%
+ \eq@defaultRDPrecision}%
+ \else
+ \def\eq@defaultCompare{diffCompare}%
+ \def\rbArgstmp{\rbFlag,%
+ \ifSubstVars_substAns\else"#1"\fi,#4,#5}%
+ \fi
% \end{macrocode}
% We have arrived at the first of possibly two parameters that define the interval(s)
% from which to sample random points. There are two forms, the old style (deprecated)
@@ -8232,7 +8349,7 @@ if (_bOK) {\jsR\jsT
% (10/10/11) To support \cs{viidna}, we expand \texttt{\#6} first before passing it
% to the command \cs{@checkforInterval}.
% \begin{macrocode}
- \edef\eq@ixparam{#6}\expandafter\eq@chkivIntrvls\eq@ixparam\\%
+ \edef\eq@ixparam{#6}\expandafter\eq@chkivIntrvls\eq@ixparam\\%
}
% \end{macrocode}
% \DescribeMacro{\viidna} is used with the \texttt{satisfyEq} for the seventh parameter,
@@ -8240,7 +8357,6 @@ if (_bOK) {\jsR\jsT
% stop compilation.
% \begin{macrocode}
\def\viidna{[0,1]}
-%\def\viidna{[]}
% \end{macrocode}
% If the next token is a `\texttt[', then that signals the beginning of an interval
% such as \texttt{[a,b]}, must be the new style. The second parameter is not
@@ -8319,10 +8435,8 @@ if (_bOK) {\jsR\jsT
% \changes{v8.2}{2018/03/18}{Corrected \string\cs{eq@recordCorrAns}}
% \changes{v8.2.1}{2018/03/19}{If not a math group, record this data}
% \begin{macrocode}
-\ifx\grpquestions\eq@Zero
- \eq@recordCorrAns{"\eqCorrectAns"}% 2018/03/18
-% \eq@recordCorrAns{("\eqCorrectAns")}% 01/11
-\fi
+ \ifx\grpquestions\eq@Zero
+ \eq@recordCorrAns{"\eqCorrectAns"}\fi
\ifeq@proofing\makebox[0pt][l]{\space\math@correctAnswer}\fi
\eq@TextField % send to the driver-dependent macro
% \end{macrocode}
@@ -8394,71 +8508,74 @@ if (_bOK) {\jsR\jsT
% Pick up any parameters that would modify the appearance of this text field.
% \begin{macrocode}
\def\RespBoxTxtOnBlur{OnBlurRespBox(%
- \if\@sqTurnOffAlerts1retn\else null\fi,"\curr@quiz");}
+ \ifx\@sqTurnOffAlerts\eq@One
+ retn\else null\fi,"\curr@quiz");}
+\def\eqObjAlertIfFalse{if (false) }
\def\eqObjAlert{%
\ifx\eqQuizType\isQZ\ifx\eq@online\eq@YES\ifeq@noquizsolutions
- \else if (false) \fi\fi\fi}
-\begin{defineJS}[%
- \catcode`\@=0\relax\catcode`\%=14\relax]{\AAKqRespBoxTxt}
+ \else\eqObjAlertIfFalse\fi\fi\fi}
+\def\eqAppAlert{eqAppAlert}
+% \end{macrocode}
+% Keystroke action for \cs{RespBoxTxt}
+% \begin{macrocode}
+\begin{defineJS}[\makeesc\*\makecmt\%]{\AAKqRespBoxTxt}
if(event.willCommit){
- RecordPointValue(@eqPTs,@thequestionno@ifx@grpquestions1,%
-@thegrpquestionno,@grpPointValue,@grpTotalWeight,%
-"@grpEvalFunction"@fi);
- RecordProblemType("@eqQT",@thequestionno);
- var retn = ProcRespTxt(@rbTxtAlt);
- ProcUserResp(retn,event.value,@thequestionno,%
-0@ifx@grpquestions1,@thegrpquestionno@fi);
-}
-if (!isQuizInitialized("@currQuiz")) {
- @eqObjAlert@space eqAppAlert(InitMsg("@bqlabelISO"),3);
+ RecordPointValue(*eqPTs,*thequestionno*ifx*grpquestions*eq@One,%
+*thegrpquestionno,*grpPointValue,*grpTotalWeight,%
+"*grpEvalFunction"*fi);
+ RecordProblemType("*eqQT",*thequestionno);
+ var retn = ProcRespTxt(*rbTxtAlt);
+ ProcUserResp(retn,event.value,*thequestionno,0%
+*ifx*grpquestions*eq@One,*thegrpquestionno*fi);
+}
+if (!isQuizInitialized("!currQuiz")) {
+ *eqObjAlert*eqAppAlert(InitMsg("*bqlabelISO"),3);
event.rc = false;
}
\end{defineJS}
-\def\RespBoxTxtDefaults
-{%
+\def\RespBoxTxtDefaults{%
\BC{0 0 0}\W{1}\S{S}\textColor{0 g}\F{\FPrint}%
}
-\def\moreRespBoxTxtDefaults
-{%
+\def\moreRespBoxTxtDefaults{%
\edef\@moreRespBoxTxtDefaults{%
\if\eqQuizType\isQZ\ifx\eq@online\eq@YES
\ifeq@noquizsolutions\else
\noexpand\Ff{\FfReadOnly}\fi\fi\fi
}%
}
-\def\@@RespBoxTxtActions
-{%
+\begin{defineJS}[\makeesc\!\makecmt\%]{\rbtAAKey}
+if(event.willCommit) {
+ var retn = ProcRespTxt(!rbTxtAlt);%
+!ifx!@sqTurnOffAlerts!eq@One
+ !RespBoxTxtOnBlur!fi%
+!ifx!eqAddAAKeystroke!@empty!else
+!eqAddAAKeystroke!fi
+}
+\end{defineJS}
+\def\@@RespBoxTxtActions{%
\AA{\if\eqQuizType\isQZ
% \end{macrocode}
-% Added \cs{eqAAKeystrokArg} to \cs{@@RespBoxTxtActions}
-% \changes{v7.8i}{2017/07/21}{Added \string\cs{eqAAKeystrokArg} to \string\cs{@@RespBoxTxtActions}}
+% Added \cs{eqAddAAKeystroke} to \cs{@@RespBoxTxtActions}
+% \changes{v7.8i}{2017/07/21}{Added \string\cs{eqAddAAKeystroke} to \string\cs{@@RespBoxTxtActions}}
% \begin{macrocode}
\AAKeystroke{\AAKqRespBoxTxt\eqAddAAKeystroke}
\AAFormat{\eqAddAAFormat}
\else
- \AAKeystroke{%
- if(event.willCommit) {\r\t
- retn = ProcRespTxt(\rbTxtAlt);\r
- \if\@sqTurnOffAlerts1
- \t\RespBoxTxtOnBlur\r\fi
- \eqAddAAKeystroke\r
- }%
- }
+ \AAKeystroke{\rbtAAKey}
\AAFormat{\eqAddAAFormat}
- \AAOnFocus{\JS{var retn = null;}}
+ \AAOnFocus{\JS{var\eqSP retn=null;}}
% \end{macrocode}
% (2005/12/02) A fix for Acro7.0, a change in the blur event, must
% move this event to keystroke so behavior is the same as in previous
% versions.
% \begin{macrocode}
- \if\@sqTurnOffAlerts0%
+ \ifx\@sqTurnOffAlerts\eq@Zero
\AAOnBlur{\JS{\RespBoxTxtOnBlur}}\fi
\fi
}
}
\def\annot@subtype@rbt{rbt}
-\newcommand\@RespBoxTxt[1][]
-{%
+\newcommand\@RespBoxTxt[1][]{%
\edef\annot@subtype{\annot@subtype@rbt}%
\eq@AddProbToQzQuesList
\ifx\grpquestions\eq@Zero\addtocounter{eqpointvalue}{\eqPTs}\fi
@@ -8511,7 +8628,7 @@ if (!isQuizInitialized("@currQuiz")) {
\def\eq@argi{-1}\fi\fi\fi
\def\eq@argii{#2}\ifx\eq@argii\eq@ONE\else\def\eq@argii{0}\fi
\begingroup
- \ifnum\eq@argii=1\relax
+ \ifnum\eq@argii=\@ne
% \end{macrocode}
% local definitions: \DescribeMacro{\rexpStr}\cs{rexpStr},
% \DescribeMacro{\\<RegEXP>}|\\|, and \DescribeMacro{\word}\cs{word}.
@@ -8528,37 +8645,37 @@ if (!isQuizInitialized("@currQuiz")) {
#4\space instead}{Enter a positive integer.}\fi
}
\def\@argRead#1{\xdef\jsTempArgs{\txtAltList}%
- \ifx\txtAltList\@empty\xdef\txtAltList{"#1"}\else
- \xdef\txtAltList{\jsTempArgs,"#1"}\fi\@@argRead}
+ \ifx\txtAltList\@empty\xdef\txtAltList{"#1"}\else
+ \xdef\txtAltList{\jsTempArgs,"#1"}\fi\@@argRead}
\def\@@argRead{\advance\eqtmpcnta\m@ne
- \ifnum\eqtmpcnta=\z@
- \def\eq@next{\endgroup
- \xdef\rbTxtAlt{\rbTxtAlt,\txtAltList}%
- \if\grpquestions\eq@Zero
- \ifwithinMCFI
- \xdef\s@veCorrAnsMCFI{[\txtAltList]}\else
- \eq@recordCorrAns{[\txtAltList]}\fi
- \else
+ \ifnum\eqtmpcnta=\z@
+ \def\eq@next{\endgroup
+ \xdef\rbTxtAlt{\rbTxtAlt,\txtAltList}%
+ \if\grpquestions\eq@Zero
+ \ifwithinMCFI
+ \xdef\s@veCorrAnsMCFI{[\txtAltList]}\else
+ \eq@recordCorrAns{[\txtAltList]}\fi
+ \else
% \end{macrocode}
% \changes{v7.8a}{2016/11/18}{Fixed a typo, \string\texttt{...AnsArrayi} should be
% \string\texttt{...AnsGrpAnsArray}}
% Fixed typo, changed \cs{eq@recordGrpAnsArrayi} to \cs{eq@recordGrpAnsArray}.
% \begin{macrocode}
- \eq@recordGrpAnsArray{[\txtAltList]}%
- \fi
- \eq@@RespBoxTxt
- }%
- \else
- \def\eq@next{\@argRead}%
- \fi\eq@next
+ \eq@recordGrpAnsArray{[\txtAltList]}%
+ \fi
+ \eq@@RespBoxTxt
+ }%
+ \else
+ \def\eq@next{\@argRead}%
+ \fi\eq@next
}
\def\eq@@RespBoxTxt{%
- \ifeq@proofing\makebox[0pt][l]{\space\txt@correctAnswer}\fi
- \eq@TextField
+ \ifeq@proofing\makebox[0pt][l]{\space\txt@correctAnswer}\fi
+ \eq@TextField
% \end{macrocode}
% Closing of the \cs{hbox} begun above.
% \begin{macrocode}
- \egroup
+ \egroup
}
% \end{macrocode}
% If the \texttt{proofing} option is specified, then we type out the author's list of
@@ -8566,8 +8683,8 @@ if (!isQuizInitialized("@currQuiz")) {
% \begin{macrocode}
\def\gobbleTxt#1>#2,#3,#4,{}
\gdef\txt@correctAnswer{\ttfamily\color{\@proofingsymbolColor}%
- \spaceskip=2pt\xspaceskip=2pt
- \expandafter\gobbleTxt\meaning\rbTxtAlt
+ \spaceskip=2pt\xspaceskip=2pt
+ \expandafter\gobbleTxt\meaning\rbTxtAlt
}
% \end{macrocode}
% \end{macro}
@@ -8607,134 +8724,160 @@ if (!isQuizInitialized("@currQuiz")) {
% that $4$ alternatives follow.)
% \end{description}
% \begin{macrocode}
-\begin{defineJS}[%
- \catcode`\@=0\relax\catcode`\%=14\relax]{\AAKqRespBoxTxtPC}
+\begin{defineJS}[\makeesc\*\makecmt\%]{\AAKqRespBoxTxtPC}
if(event.willCommit){
- RecordPointValue(@eqPTs,@thequestionno@ifx@grpquestions1,%
-@thegrpquestionno,@grpPointValue,@grpTotalWeight,%
-"@grpEvalFunction"@fi);
- RecordProblemType("@eqQT",@thequestionno);
- var retn = ProcRespTxtPC(@rbTxtAlt);
-@ifx@grpquestions1%
-ProbValue[@thequestionno][3+@thegrpquestionno]%
-=ProcRespTxtPC.txtPCpCr;@else%
-ProbValue[@thequestionno]=ProcRespTxtPC.txtPCpCr;@fi
- ProcUserResp(retn,event.value,@thequestionno,0%
-@ifx@grpquestions1,@thegrpquestionno@fi);
-}
-if (!isQuizInitialized("@currQuiz")) {
- @eqObjAlert@space eqAppAlert(InitMsg("@bqlabelISO"),3);
- event.rc = false;
+ RecordPointValue(*eqPTs,*thequestionno*ifx*grpquestions*eq@One,%
+*thegrpquestionno,*grpPointValue,*grpTotalWeight,%
+"*grpEvalFunction"*fi);
+ RecordProblemType("*eqQT",*thequestionno);
+ var retn = ProcRespTxtPC(*rbTxtAlt);
+*ifx*grpquestions*eq@One%
+ ProbValue[*thequestionno][3+*thegrpquestionno]%
+=ProcRespTxtPC.txtPCpCr;*else%
+ ProbValue[*thequestionno]=ProcRespTxtPC.txtPCpCr;*fi
+ ProcUserResp(retn,event.value,*thequestionno,0%
+*ifx*grpquestions*eq@One,*thegrpquestionno*fi);
+}
+if (!isQuizInitialized("*currQuiz")) {
+ *eqObjAlert*eqAppAlert(InitMsg("*bqlabelISO"),3);
+ event.rc = false;
}
\end{defineJS}
-\def\@@RespBoxTxtPCActions
-{%
- \AA{\if\eqQuizType\isQZ
- \AAKeystroke{\AAKqRespBoxTxtPC}
- \else
- \AAKeystroke{%
- if(event.willCommit) {\r\t
- retn = ProcRespTxtPC(\rbTxtAlt);\r
-\if\@sqTurnOffAlerts1%
- \t\RespBoxTxtOnBlur\r
-\fi
- }%
- }
- \AAOnFocus{\JS{var retn = null;}}
-\if\@sqTurnOffAlerts0%
- \AAOnBlur{\JS{\RespBoxTxtOnBlur}}%
-\fi
- \fi
- }
+\begin{defineJS}[\makeesc\!\makecmt\%]{\rbtPCAAKey}
+if(event.willCommit) {
+ retn = ProcRespTxtPC(!rbTxtAlt);%
+!ifx!@sqTurnOffAlerts!eq@One
+ !RespBoxTxtOnBlur!fi%
+}
+\end{defineJS}
+\def\@@RespBoxTxtPCActions{%
+ \AA{%
+ \if\eqQuizType\isQZ
+ \AAKeystroke{\AAKqRespBoxTxtPC}
+ \else
+ \AAKeystroke{\rbtPCAAKey}
+ \AAOnFocus{\JS{var\eqSP retn=null;}}
+ \ifx\@sqTurnOffAlerts\eq@Zero
+ \AAOnBlur{\JS{\RespBoxTxtOnBlur}}\fi
+ \fi
+ }
}
% \end{macrocode}
% Here is the beginning of \cs{RespBoxTxtPC}.
% \begin{macrocode}
\newcommand{\RespBoxTxtPC}{\def\rbFlag{0}\@RespBoxTxtPC}
\def\annot@subtype@rbtpc{rbtpc}
-\newcommand\@RespBoxTxtPC[1][]
-{%
- \edef\annot@subtype{\annot@subtype@rbtpc}%
- \eq@AddProbToQzQuesList
- \smallskip\ifx\grpquestions\eq@Zero
- \addtocounter{eqpointvalue}{\eqPTs}\fi
- \if\eqQuizType\isQZ\def\rbFlag{1}\global\IsRespBoxtrue
- \ifx\grpquestions\eq@One
- \stepcounter{grpquestionno}%
- \def\Fld@name{%
- grpobj.\curr@quiz.\thequestionno.\thegrpquestionno}%
- \else
- \eq@recordThesePTs\eq@recordProbType
- \edef\eqtmp{\aPointType}%
- \xdef\aPointType{\eqtmp,[\eqPTs,"text"]}%
- \stepcounter{questionno}%
- \def\Fld@name{obj.\curr@quiz.\thequestionno}%
- \fi
+\newcommand\@RespBoxTxtPC[1][]{%
+ \edef\annot@subtype{\annot@subtype@rbtpc}%
+ \eq@AddProbToQzQuesList
+ \smallskip\ifx\grpquestions\eq@Zero
+ \addtocounter{eqpointvalue}{\eqPTs}\fi
+ \if\eqQuizType\isQZ\def\rbFlag{1}\global\IsRespBoxtrue
+ \ifx\grpquestions\eq@One
+ \stepcounter{grpquestionno}%
+ \def\Fld@name{%
+ grpobj.\curr@quiz.\thequestionno.\thegrpquestionno}%
\else
- \stepcounter{questionno}%
- \def\Fld@name{obj.\oField.\thequestionno}%
+ \eq@recordThesePTs\eq@recordProbType
+ \edef\eqtmp{\aPointType}%
+ \xdef\aPointType{\eqtmp,[\eqPTs,"text"]}%
+ \stepcounter{questionno}%
+ \def\Fld@name{obj.\curr@quiz.\thequestionno}%
\fi
- \moreRespBoxTxtDefaults
- \leavevmode\hbox\bgroup\text@@Field{#1}{\Fld@name}%
- {\RBW}{\DefaultHeightOfWidget}%
- {\eq@protect\AA}{\eq@setWidgetProps\@@RespBoxTxtPC}%
- {\RespBoxTxtDefaults\@moreRespBoxTxtDefaults
- \@@RespBoxTxtPCActions\every@eqTextField\every@RespBoxTxt}%
+ \else
+ \stepcounter{questionno}%
+ \def\Fld@name{obj.\oField.\thequestionno}%
+ \fi
+ \moreRespBoxTxtDefaults
+ \leavevmode\hbox\bgroup\text@@Field{#1}{\Fld@name}%
+ {\RBW}{\DefaultHeightOfWidget}%
+ {\eq@protect\AA}{\eq@setWidgetProps\@@RespBoxTxtPC}%
+ {\RespBoxTxtDefaults\@moreRespBoxTxtDefaults
+ \@@RespBoxTxtPCActions\every@eqTextField\every@RespBoxTxt}%
}
\def\@@RespBoxTxtPC#1{\@ifnextchar[{\@@@RespBoxTxtPC{#1}}
- {\@ifstar{\@@@RespBoxTxtPC{#1}[\curr@quiz.\thequestionno]}%
- {\@@@RespBoxTxtPC{#1}[]}}}
+ {\@ifstar{\@@@RespBoxTxtPC{#1}[\curr@quiz.\thequestionno]}%
+ {\@@@RespBoxTxtPC{#1}[]}}}
\def\@@@RespBoxTxtPC#1[#2]#3{\xdef\@qzsolndest{#2}%
\begingroup
% \end{macrocode}
% We make special definitions for retrieving the parameters.
% \begin{macrocode}
- \def\rexpStr##1{\eqbs\eqbs\eqbs\eqbs##1}%
- \def\\##1{\eqbs\eqbs\eqbs\eqbs##1}%
- \def\word##1{\\b##1\\b}\def\any{@any@}
- \gdef\rbTxtAlt{\rbFlag,#1,1}% force sub-string match
- \global\let\txtAltList\@empty
- \eqtmpcnta=#3\relax\ifnum\eqtmpcnta>\z@\expandafter\@argReadPC\else
- \PackageError{exerquiz}{%
- The third required parameter of
- \string\RespBoxTxtPC\MessageBreak
- is required to be a positive integer.
- You entered\MessageBreak #3\space instead}
- {Enter a positive integer.}\fi
+ \def\rexpStr##1{\eqbs\eqbs\eqbs\eqbs##1}%
+ \def\\##1{\eqbs\eqbs\eqbs\eqbs##1}%
+ \def\word##1{\\b##1\\b}\def\any{@any@}
+ \gdef\rbTxtAlt{\rbFlag,#1,1}% force sub-string match
+ \global\let\txtAltList\@empty
+ \eqtmpcnta=#3\relax\ifnum\eqtmpcnta>\z@\expandafter\@argReadPC\else
+ \PackageError{exerquiz}{%
+ The third required parameter of
+ \string\RespBoxTxtPC\MessageBreak
+ is required to be a positive integer.
+ You entered\MessageBreak #3\space instead}
+ {Enter a positive integer.}\fi
}
% \end{macrocode}
% \texttt{\#1=<num>}, partial credit for this answer, \texttt{\#2=word}.
% \begin{macrocode}
\newcommand\@argReadPC[2][0]{\xdef\jsTempArgs{\txtAltList}%
- \ifx\txtAltList\@empty\xdef\txtAltList{["#2",#1]}\else
- \xdef\txtAltList{\jsTempArgs,["#2",#1]}\fi\@@argReadPC}
+ \ifx\txtAltList\@empty\xdef\txtAltList{["#2",#1]}\else
+ \xdef\txtAltList{\jsTempArgs,["#2",#1]}\fi\@@argReadPC}
\def\@@argReadPC{\advance\eqtmpcnta\m@ne
- \ifnum\eqtmpcnta=\z@
- \def\eq@next{\endgroup
- \xdef\rbTxtAlt{\rbTxtAlt,\txtAltList}%
- \if\grpquestions\eq@Zero
- \ifwithinMCFI
- \xdef\s@veCorrAnsFCFI{[\txtAltList]}\else
- \eq@recordCorrAns{[\txtAltList]}\fi
- \else
- \eq@recordGrpAnsArray{[\txtAltList]}%
- \fi
- \eq@@RespBoxTxtPC
- }%
- \else
- \def\eq@next{\@argReadPC}%
- \fi\eq@next
+ \ifnum\eqtmpcnta=\z@
+ \def\eq@next{\endgroup
+ \xdef\rbTxtAlt{\rbTxtAlt,\txtAltList}%
+ \if\grpquestions\eq@Zero
+ \ifwithinMCFI
+ \xdef\s@veCorrAnsFCFI{[\txtAltList]}\else
+ \eq@recordCorrAns{[\txtAltList]}\fi
+ \else
+ \eq@recordGrpAnsArray{[\txtAltList]}%
+ \fi
+ \eq@@RespBoxTxtPC
+ }%
+ \else
+ \def\eq@next{\@argReadPC}%
+ \fi\eq@next
}
-\def\eq@@RespBoxTxtPC{%
- \ifeq@proofing\makebox[0pt][l]{\space\txt@correctAnswer}\fi
- \eq@TextField
+\def\eq@@RespBoxTxtPC{\ifeq@proofing
+ \makebox[0pt][l]{\space\txt@correctAnswer}\fi
+ \eq@TextField
% \end{macrocode}
% Closing of the \cs{hbox} begun above.
% \begin{macrocode}
- \egroup
+ \egroup
}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\SpellCheck}\hskip-\marginparsep\texttt{[\ameta{options}]}
+% This command is designed to be used with text fill-in questions; the action of this button
+% allows the user to correct spelling, but it does record the number of initially misspelled words.
+% The placement of this field is after the text field (\cs{RespBoxTxt} or \cs{RespBoxTxtPC}) so
+% it can pick up on the field name. The root name of this field is \texttt{spl}. Two helper commands
+% are defined: \DescribeMacro{\splChkCA}\cmd{\splChkCA} and \DescribeMacro{\splChkTU}\cmd{\splChkTU}.
+% \changes{v8.5.11}{2020/11/11}{Added \string\cs{SpellCheck}}
+% \begin{macrocode}
+\def\afterSplChkActn#1{\def\@fterSplChkActn{\r #1}}
+\let\@fterSplChkActn\@empty
+\newcommand{\splChkCA}{Check}
+\newcommand{\splChkTU}{Check spelling}
+\newcommand\SpellCheck[1][]{%
+ \pushButton[\CA{\splChkCA}\TU{\splChkTU}\S{S}
+ #1\A{\JS{%
+ \ifx\grpquestions\eq@One
+ var targetFldName=%
+ "grpobj.\curr@quiz.\thequestionno.\thegrpquestionno";
+ \else
+ \ifx\annot@subtype\annot@subtype@rbe
+ var targetFldName="essay.\curr@quiz.\thequestionno";
+ \else
+ var targetFldName="obj.\curr@quiz.\thequestionno";
+ \fi
+ \fi\r
+ var splErrors=checkTheSpelling(targetFldName);\@fterSplChkActn
+ }}]{spl.\curr@quiz.\thequestionno}{}{11bp}}
+% \end{macrocode}
+% \end{macro}
%\subsection{Essay Fill-In}
% \begin{macro}{\RespBoxEssay}
% Here is a simple text field with a multi-line attribute for entering
@@ -8747,7 +8890,7 @@ if (!isQuizInitialized("@currQuiz")) {
% \string\RespBoxEssay[\ameta{opts}]*\darg{\ameta{wd}}\darg{\ameta{ht}}
% \end{quote}
% The second argument declares the problem has a \env{solution} file; we define the target
-% of the solution twh ways: an explicite \ameta{dest} string, or an star (\texttt*), where
+% of the solution twh ways: an explicit \ameta{dest} string, or an star (\texttt*), where
% the destination is automatically named. If you use \ameta{dest}, you must have
% a frist optional, even if its only \texttt{[]}, to correctly parse this construction.
% \changes{v8.3}{2019/08/13}{\string\env{solution} environment now defined for
@@ -8757,47 +8900,46 @@ if (!isQuizInitialized("@currQuiz")) {
{%
\BC{0 0 0}\W{1}\S{S}\Ff{\FfMultiline}\rawPDF{}%
}
-\def\@@RespBoxEssayActions
-{%
- \AA{\if\eqQuizType\isQZ
- \AAKeystroke{%
- if(event.willCommit){\jsR\jsT
- RecordPointValue(\eqPTs,\thequestionno);\jsR\jsT
- RecordProblemType("\eqQT",\thequestionno);\jsR %\jsT
- }\jsR
- if (!isQuizInitialized("\curr@quiz")) {\jsR\jsT
- \eqObjAlert\space eqAppAlert(%
- InitMsg("\bqlabelISO"),3);\jsR\jsT
- event.rc = false;\jsR
- }%
- }%
- \fi
- }
+\def\@@RespBoxEssayActions{\AA{%
+ \if\eqQuizType\isQZ
+ \AAKeystroke{%
+ if(event.willCommit){\jsR\jsT
+ RecordPointValue(\eqPTs,\thequestionno);\jsR\jsT
+ RecordProblemType("\eqQT",\thequestionno);\jsR %\jsT
+ }\jsR
+ if (!isQuizInitialized("\curr@quiz")) {\jsR\jsT
+ \eqObjAlert\space eqAppAlert(%
+ InitMsg("\bqlabelISO"),3);\jsR\jsT
+ event.rc = false;\jsR
+ }%
+ }%
+ \fi}%
}
% \RespBoxEssay[opt][dest]|*{wd}{ht}
-\newcommand\RespBoxEssay[1][]{\def\rbe@rgi{#1}\RespBoxEssay@i}
+\def\annot@subtype@rbe{rbe}
+\newcommand\RespBoxEssay[1][]{\edef\annot@subtype{\annot@subtype@rbe}%
+ \def\rbe@rgi{#1}\RespBoxEssay@i}
\def\RespBoxEssay@i{\@ifnextchar[%]
{\RespBoxEssay@ii}
{\@ifstar{\RespBoxEssay@ii[\curr@quiz.\thequestionno]}}%
{\RespBoxEssay@ii[]}%
}
% \RespBoxEssay#1[dest]{wd}{ht}
-\newcommand\RespBoxEssay@ii[3][]
-{%
- \smallskip\addtocounter{eqpointvalue}{\eqPTs}%
+\newcommand\RespBoxEssay@ii[3][]{%
+ \smallskip\addtocounter{eqpointvalue}{\eqPTs}%
% \end{macrocode}
% (2019/06/26) Added \cs{eq@AddProbToQzQuesList} for \cs{RespBoxEssay}
% \changes{v8.2.13}{2019/06/26}{Added \string\cs{eq@AddProbToQzQuesList} for \string\cs{RespBoxEssay}}
% \begin{macrocode}
- \eq@AddProbToQzQuesList
- \stepcounter{questionno}%
- \xdef\@qzsolndest{#1}%
- \edef\eqtmp{\aPointType}\xdef\aPointType{\eqtmp,[\eqPTs,"essay"]}%
- \expandafter\mbox\expandafter{\expandafter\text@@Field
- \expandafter{\rbe@rgi}{essay.\curr@quiz.\thequestionno}{#2}{#3}%
- {\eq@protect\AA}{\eq@setWidgetProps
- \eq@TextField}{\RespBoxEssayDefaults\@@RespBoxEssayActions
- \every@eqTextField}}%
+ \eq@AddProbToQzQuesList
+ \stepcounter{questionno}%
+ \xdef\@qzsolndest{#1}%
+ \edef\eqtmp{\aPointType}\xdef\aPointType{\eqtmp,[\eqPTs,"essay"]}%
+ \expandafter\mbox\expandafter{\expandafter\text@@Field
+ \expandafter{\rbe@rgi}{essay.\curr@quiz.\thequestionno}{#2}{#3}%
+ {\eq@protect\AA}{\eq@setWidgetProps
+ \eq@TextField}{\RespBoxEssayDefaults\@@RespBoxEssayActions
+ \every@eqTextField}}%
}
% \end{macrocode}
% \end{macro}
@@ -8812,21 +8954,19 @@ if (!isQuizInitialized("@currQuiz")) {
\@ifundefined{calcOrder}{%
\ifpdf\def\@@sqTallyBoxActions{%
\AA{\AAValidate{getTotalTally("\oField");}}}\fi}{}
-\def\sqTallyBoxDefaults
-{%
+\def\sqTallyBoxDefaults{%
\BC{0 0 0}\W{1}\textColor{1 0 0 rg}\S{I}\Q{2}\Ff{\FfReadOnly}
}
\ifpdf\def\@@sqTallyBoxActions{%
- \AA{\AAValidate{getTotalTally("\oField");}}}\else
- \let\@@sqTallyBoxActions\@empty
+ \AA{\AAValidate{getTotalTally("\oField");}}}\else
+ \let\@@sqTallyBoxActions\@empty
\fi
-\newcommand\sqTallyBox[1][]
-{%
- \mbox{\text@@Field{#1}{tally.\oField.\thequestionno}%
- {\TBW}{\DefaultHeightOfWidget}%
- {}{\eq@setWidgetProps\eq@TextField}%
- {\sqTallyBoxDefaults\@@sqTallyBoxActions\every@eqTextField
- \every@sqTallyBox}}%
+\newcommand\sqTallyBox[1][]{%
+ \mbox{\text@@Field{#1}{tally.\oField.\thequestionno}%
+ {\TBW}{\DefaultHeightOfWidget}%
+ {}{\eq@setWidgetProps\eq@TextField}%
+ {\sqTallyBoxDefaults\@@sqTallyBoxActions\every@eqTextField
+ \every@sqTallyBox}}%
}
% \end{macrocode}
% \end{macro}
@@ -8835,28 +8975,24 @@ if (!isQuizInitialized("@currQuiz")) {
% \texttt{shortquiz} environment. Takes on optional parameter; this
% parameter can be used to modify the appearance of the fields.
% \begin{macrocode}
-\def\sqTallyTotalDefaults
-{%
- \rawPDF{}\W{1}\BC{0 0 0}\S{I}\textColor{1 0 0 rg}%
- \Q{2}\Ff{\FfReadOnly}%
+\def\sqTallyTotalDefaults{%
+ \rawPDF{}\W{1}\BC{0 0 0}\S{I}\textColor{1 0 0 rg}%
+ \Q{2}\Ff{\FfReadOnly}%
}
-\def\@@sqTallyTotalActions
-{%
- \AA{%
- \AAKeystroke{AFNumber_Keystroke(0,0,0,0,"",true);}
- \AAFormat{AFNumber_Format(0,0,0,0,"",true);}
- \AACalculate{%
- AFSimple_Calculate("SUM",new Array("tally.\oField"));
- }}
-}
-\newcommand\sqTallyTotal[1][]
-{%
- \mbox{\text@@Field{#1}{tallytotal.\oField}{\TBW}%
- {\DefaultHeightOfWidget}{\eq@protect\AA}%
-% {\eq@setWidgetProps\eq@calcTextField}%
- {\eq@setWidgetProps\eq@TextField}%
- {\sqTallyTotalDefaults\@@sqTallyTotalActions\every@eqTextField
- \every@sqTallyTotal}}%
+\def\@@sqTallyTotalActions{%
+ \AA{%
+ \AAKeystroke{AFNumber_Keystroke(0,0,0,0,"",true);}
+ \AAFormat{AFNumber_Format(0,0,0,0,"",true);}
+ \AACalculate{%
+ AFSimple_Calculate("SUM",new Array("tally.\oField"));
+ }}%
+}
+\newcommand\sqTallyTotal[1][]{%
+ \mbox{\text@@Field{#1}{tallytotal.\oField}{\TBW}%
+ {\DefaultHeightOfWidget}{\eq@protect\AA}%
+ {\eq@setWidgetProps\eq@TextField}%
+ {\sqTallyTotalDefaults\@@sqTallyTotalActions\every@eqTextField
+ \every@sqTallyTotal}}%
}
% \end{macrocode}
% \end{macro}
@@ -8888,96 +9024,95 @@ if (!isQuizInitialized("@currQuiz")) {
%\end{verbatim}
% Here, we call a function to evaluate the answer for us.
% \begin{macrocode}
-\def\CorrAnsButtonDefaults
-{%
- \CA{\eq@local@CorrAnsButton}\W{1}\S{S}
- \BC{0 0 0}\BG{.7529 .7529 .7529}\H{P}
+\def\CorrAnsButtonDefaults{%
+ \CA{\eq@local@CorrAnsButton}\W{1}\S{S}
+ \BC{0 0 0}\BG{.7529 .7529 .7529}\H{P}
}
\def\normalCABtnBC{0 0 0}
\def\qCorrAnsButtonActionHook{\JS{%
\ifx\@qzsolndest\@empty\else
- if (event.shift)\jsR\jsT
+ if(event.shift)\jsR\jsT
this.gotoNamedDest("\@qzsolndest");\jsR
else {\jsR\jsT\fi
% \end{macrocode}
% The script for the \cs{CorrAnsButton} accommodates multi-letter variables
% \begin{macrocode}
-\ifShowAppr % dps17
+\ifShowAppr
\ifarrowDelim
- if (typeof event.target.appr=="undefined")\r\JST\t
+ if(typeof event.target.appr=="undefined")\r\JST\t
event.target.appr=false;\r\JST
event.target.appr=!event.target.appr;\r\JST
- if (event.target.appr) {\r\t\JST
- var _substVars=\indepVars;\r\t\JST
- var _substAns=getSubstValue(_substVars,"\CorrectAns");\r\t\JST
- var value=RespBoxAppr("\CorrectAns");\r\JST
- } else value="\CorrectAns";\r\JST
+ if(event.target.appr) {\r\t\JST
+ var\eqSP_substVars=\indepVars;\r\t\JST
+ var\eqSP_substAns=getSubstValue(_substVars,"\CorrectAns");\r\t\JST
+ var\eqSP value=RespBoxAppr("\CorrectAns");\r\JST
+ } else\eqSP var\eqSP value="\CorrectAns";\r\JST
\else
- value="\CorrectAns";\r\JST
+ var\eqSP value="\CorrectAns";\r\JST
\fi
\else
- value="\CorrectAns";\r\JST
+ var\eqSP value="\CorrectAns";\r\JST
\fi
\processJSfunc("Ans.\curr@quiz",value,\currQuiz);\r
-\ifx\@qzsolndest\@empty\else % dps17
+\ifx\@qzsolndest\@empty\else
}\fi
}}
- \def\sqCorrAnsButtonActionHook
- {%
- \JS{%
% \end{macrocode}
-% Allow local definition the reset color for response boxes. The reset color
-% is normally black (\cs{eqDefaultColor}). Now if \cs{sqCorrAnsResetBC} is none
-% empty, we put it in as a property of the \cs{oField} object.
+% \leavevmode\DescribeMacro{\sqCorrAnsCode}
+% The JavaScript code for \cs{CorrAnsButton} now in a \env{defineJS} env.
+% \changes{v8.6}{2020/11/29}{code for \string\cs{CorrAnsButton} now in a \string\env{defineJS} env}
+% \begin{macrocode}
+\begin{defineJS}[\makeesc\!\makecmt\%]{\sqCorrAnsCode}
+!ifx!@qzsolndest!@empty%
+!processJSfunc("obj.!oField.!thequestionno","!CorrectAns",%
+!currQuiz);!else%
+if (event.shift) this.gotoNamedDest("!@qzsolndest");
+else !processJSfunc("obj.!oField.!thequestionno","!CorrectAns",%
+!currQuiz);!fi
+\end{defineJS}
+\def\sqCorrAnsButtonActionHook{\JS{\sqCorrAnsCode}}
+% \end{macrocode}
+% \leavevmode\DescribeMacro{\CorrAnsButton}
+% The definition of \cs{CorrAnsButton}
% \begin{macrocode}
- \ifx\@qzsolndest\@empty\else
- if (event.shift)\jsR\jsT
- this.gotoNamedDest("\@qzsolndest");\jsR
- else\jsR\jsT
- \fi
- \processJSfunc("obj.\oField.\thequestionno","\CorrectAns",%
-\currQuiz);
- }%
- }
\newcommand\CorrAnsButton[1][]{\eq@@CorrAnsButton{#1}}
\def\eq@@CorrAnsButton#1#2{\bgroup\makeJSspecials % 1/12
- \@ifstar{\eq@@@CorrAnsButton{#1}{#2}}{%
- \eq@@@CorrAnsButton{#1}{#2}{DisplayAnswer}}%
-}
+ \@ifstar{\eq@@@CorrAnsButton{#1}{#2}}{%
+ \eq@@@CorrAnsButton{#1}{#2}{DisplayAnswer}}}
\def\eq@@@CorrAnsButton#1#2#3{\gdef\CorrectAns{#2}%
- \def\processJSfunc{#3}\ifx\@qzsolndest\@empty\let\JST\@empty\else
- \let\JST\jsT\fi % dps17
- \ifx\eq@ProcRespIntervals\g@processJSfunc % 01/11
- \let\@inmathwarn@SAVE\@inmathwarn\let\@inmathwarn\@gobble
+ \def\processJSfunc{#3}\ifx\@qzsolndest\@empty\let\JST\@empty\else
+ \let\JST\jsT\fi % dps17
+ \ifx\eq@ProcRespIntervals\g@processJSfunc % 01/11
+ \let\@inmathwarn@SAVE\@inmathwarn\let\@inmathwarn\@gobble
% \end{macrocode}
% When the response function is \texttt{ProcRespIntervals}, there may be unbalanced parentheses, we'll
% pass \cs{CorrectAns} through \cs{pdfstringdef} to escape them.
% \begin{macrocode}
- \pdfstringdef{\CorrectAns}{\CorrectAns}%
- \let\@inmathwarn\@inmathwarn@SAVE\fi
+ \pdfstringdef{\CorrectAns}{\CorrectAns}%
+ \let\@inmathwarn\@inmathwarn@SAVE\fi
\if\eqQuizType\isQZ\def\Fld@name{corr.\curr@quiz.\thequestionno}%
\else\def\Fld@name{corr.\oField.\thequestionno}\fi
\if\eqQuizType\isQZ
- \edef\@@CorrAnsButtonActions{\noexpand\F{\FHidden}%
- \ifx\@qzsolndest\@empty%\noexpand\BC{\normalCABtnBC}%
- \else\noexpand\BC{\solution@Color}\fi
- \noexpand\A{\noexpand\qCorrAnsButtonActionHook}}%
- \ifeq@noquizsolutions\else % dps17 (\let\rpl\eq@rpl)
- \mbox{\let\rpl\eq@rpl
- \push@@Button{#1}{\Fld@name}{}{\DefaultHeightOfWidget}%
- {\eq@protect\A}{\eq@setButtonProps\eq@Button@driver}%
- {\CorrAnsButtonDefaults\@@CorrAnsButtonActions
- \every@ButtonField\every@CorrAnsButton}}%
- \fi
+ \edef\@@CorrAnsButtonActions{\noexpand\F{\FHidden}%
+ \ifx\@qzsolndest\@empty%\noexpand\BC{\normalCABtnBC}%
+ \else\noexpand\BC{\solution@Color}\fi
+ \noexpand\A{\noexpand\qCorrAnsButtonActionHook}}%
+ \ifeq@noquizsolutions\else % dps17 (\let\rpl\eq@rpl)
+ \mbox{\let\rpl\eq@rpl
+ \push@@Button{#1}{\Fld@name}{}{\DefaultHeightOfWidget}%
+ {\eq@protect\A}{\eq@setButtonProps\eq@Button@driver}%
+ {\CorrAnsButtonDefaults\@@CorrAnsButtonActions
+ \every@ButtonField\every@CorrAnsButton}}%
+ \fi
\else
\edef\@@CorrAnsButtonActions{%
\ifx\@qzsolndest\@empty%\noexpand\BC{\normalCABtnBC}
\else\noexpand\BC{\solution@Color}\fi
\noexpand\A{\noexpand\sqCorrAnsButtonActionHook}}%
\mbox{\push@@Button{#1}{\Fld@name}{}{\DefaultHeightOfWidget}%
- {\eq@protect\A}{\eq@setButtonProps\eq@Button@driver}%
- {\CorrAnsButtonDefaults\@@CorrAnsButtonActions
- \every@ButtonField\every@CorrAnsButton}}%
+ {\eq@protect\A}{\eq@setButtonProps\eq@Button@driver}%
+ {\CorrAnsButtonDefaults\@@CorrAnsButtonActions
+ \every@ButtonField\every@CorrAnsButton}}%
\fi
\egroup
}
@@ -9003,41 +9138,40 @@ if (!isQuizInitialized("@currQuiz")) {
}
% \end{macrocode}
% In an attempt to supply some custom colors for the shortquiz, we
-% define \cmd{\sqRespBoxResetColor}. It determines the clear
-% \begin{macrocode}
-\def\@@sqClearButtonActions
-{%
- \A{\JS{ProcessIt = false;\jsR
- if ( typeof \oField\space== "undefined" )\jsR\jsT
- \oField\space= new Object;\jsR
- if (typeof appAlerts["\oField"] == "undefined")\jsR\jsT
- appAlerts["\oField"] = new Object;\jsR
- this.resetForm(new Array("mc.\oField","obj.\oField",%
- "tally.\oField","grpobj.\oField"));\jsR
- var f = this.getField("obj.\oField");\jsR
+% define \cmd{\sqRespBoxResetColor}. It determines the clear color
+% \changes{v8.6}{2020/11/29}{Rewrote SQ clear button using \string\env{defineJS} env}
+% \begin{macrocode}
+\begin{defineJS}[\makeesc\*\makecmt\%]{\@@sqClearButtonJSCode}
+ProcessIt = false;
+if ( typeof *oField == "undefined" )
+ *oField = new Object;
+if (typeof appAlerts["*oField"] == "undefined")
+ appAlerts["*oField"] = new Object;
+this.resetForm(new Array("mc.*oField","obj.*oField",%
+"tally.*oField","grpobj.*oField"));
+var f = this.getField("obj.*oField");
+if ( f != null ) f.strokeColor=*ifx*defaultColorJSLoc*@empty%
+*defaultColorJS*else*defaultColorJSLoc*fi;
+f = this.getField("grpobj.*oField");
% \end{macrocode}
% Here, we give the user an opportunity to designate the color
% of the response boxes when they are reset by the \cs{sqClearButton}.
% The default is to use \cs{eqDefaultColor}.
% \begin{macrocode}
- if ( f != null ) f.strokeColor=\ifx\defaultColorJSLoc\@empty
-\defaultColorJS\else\defaultColorJSLoc\fi;\jsR
- f = this.getField("grpobj.\oField");\jsR
- if ( f != null ) f.strokeColor=\ifx\defaultColorJSLoc\@empty
-\defaultColorJS\else\defaultColorJSLoc\fi;\jsR
- f = this.getField("rbmarkup.\oField");\jsR
- if ( f != null ) f.display=display.hidden;\jsR
- \oField.Grp = {};\jsR
- appAlerts["\oField"].bAfterValue=false;\jsR
- ProcessIt=true;}%
- }
-}
-\newcommand\sqClearButton[1][]
-{%
- \mbox{\push@@Button{#1}{clear.\oField}{}{\DefaultHeightOfWidget}%
- {\eq@protect\A}{\eq@setButtonProps\eq@Button@driver}%
- {\sqClearButtonDefaults\@@sqClearButtonActions\every@ButtonField
- \every@sqClearButton}}%
+if ( f != null ) f.strokeColor=*ifx*defaultColorJSLoc*@empty%
+*defaultColorJS*else*defaultColorJSLoc*fi;
+f = this.getField("rbmarkup.*oField");
+if ( f != null ) f.display=display.hidden;
+*oField.Grp = {};
+appAlerts["*oField"].bAfterValue=false;
+ProcessIt=true;
+\end{defineJS}
+\def\@@sqClearButtonActions{\A{\JS{\@@sqClearButtonJSCode}}}
+\newcommand\sqClearButton[1][]{%
+ \mbox{\push@@Button{#1}{clear.\oField}{}{\DefaultHeightOfWidget}%
+ {\eq@protect\A}{\eq@setButtonProps\eq@Button@driver}%
+ {\sqClearButtonDefaults\@@sqClearButtonActions\every@ButtonField
+ \every@sqClearButton}}%
}
% \end{macrocode}
% \end{macro}
@@ -9048,49 +9182,43 @@ if (!isQuizInitialized("@currQuiz")) {
% the student cannot enter another answer in the text field, and the input that is already
% there will be the one that is counted has the student's response.
% \begin{macrocode}
-\def\PromptButtonDefaults
-{%
- \CA{\eq@local@CorrAnsButton}\W{1}\S{S}\BC{0 0 0}
- \BG{.7529 .7529 .7529}\H{P}
+\def\PromptButtonDefaults{%
+ \CA{\eq@local@CorrAnsButton}\W{1}\S{S}\BC{0 0 0}
+ \BG{.7529 .7529 .7529}\H{P}
}
\newcommand{\promptButtonMsg}{%
- "Would you like to see the correct answer at this time? "\r\t\t
- + "Your current answer will be the one that will be scored. "\r\t\t
- + "If you click on \\"Yes\\",
- you will not be able to change your answer."
+ "Would you like to see the correct answer at this time? "\r\t\t
+ + "Your current answer will be the one that will be scored. "\r\t\t
+ + "If you click on \\"Yes\\",
+ you will not be able to change your answer."
}
\newcommand{\AnsPromptBtnStr}{Answer:\space}
-\def\PromptButtonActionHook
-{%
- \JS{%
- if (!isQuizInitialized("\currQuiz")) {\r\t
- eqAppAlert(InitMsg("\bqlabelISO"),3);\r\t
- event.rc=false;\r
- } else {\r\t
- if ( !\currQuiz.oAlertCheck.bAfterValue ) {\r\t
- var resp=eqAppAlert({\r\t\t
- cMsg:\promptButtonMsg,\r\t\t
- nIcon: 2, nType: 2,\r\t\t
- cTitle: ("AcroTeX Prompt Message"),\r\t\t
- oCheckbox: \currQuiz.oAlertCheck\r\t
- });\r\t
- }\r
+\begin{defineJS}[\makeesc\*\makecmt\%]{\PromptButtonActionCode}
+if (!isQuizInitialized("*currQuiz")) {
+ eqAppAlert(InitMsg("*bqlabelISO"),3);
+ event.rc=false;
+} else {
+ if ( !*currQuiz.oAlertCheck.bAfterValue ) {
+ var resp=eqAppAlert({
+ cMsg:*promptButtonMsg,
+ nIcon: 2, nType: 2,
+ cTitle: ("AcroTeX Prompt Message"),
+ oCheckbox: *currQuiz.oAlertCheck
+ });
+ }
% \end{macrocode}
% Correction to the if condition below
% \changes{v7.8d}{2017/01/11}{Correction to the if condition in \string\cs{PromptButtonActionHook}}
% \begin{macrocode}
- if ( promptQuiz.oAlertCheck.bAfterValue || resp==4 )\r\t
- {\r\t\t
- var field=this.getField(%
- "obj.\currQuiz.\thequestionno");\r\t\t
- field.readonly=true;\r\t\t
- field=this.getField("Ans.\currQuiz");\r\t\t
- if (field!=null)
- field.value = "\AnsPromptBtnStr\PromptAns";\r\t
- }\r
- }
- }%
+ if ( promptQuiz.oAlertCheck.bAfterValue || resp==4 ) {
+ var field=this.getField("obj.*currQuiz.*thequestionno");
+ field.readonly=true;
+ field=this.getField("Ans.*currQuiz");
+ if (field!=null) field.value = ("*AnsPromptBtnStr*PromptAns");
+ }
}
+\end{defineJS}
+\def\PromptButtonActionHook{\JS{\PromptButtonActionCode}}
% \end{macrocode}
% This button takes the standard two arguments
% \begin{flushleft}
@@ -9098,22 +9226,21 @@ if (!isQuizInitialized("@currQuiz")) {
% \texttt{\#2}: Prompt answer
% \end{flushleft}
% \begin{macrocode}
-\newcommand\@PromptButton[2][]
-{%
- \def\PromptAns{#2}\if\eqQuizType\isQZ
- \def\Fld@name{promptButton.\curr@quiz.\thequestionno}%
- \else\def\Fld@name{promptButton.\oField.\thequestionno}\fi
- \if\eqQuizType\isQZ
- \def\@@PromptButtonActions{%
- \A{\PromptButtonActionHook}}%
- \mbox{\push@@Button{#1}{\Fld@name}{}%
- {\DefaultHeightOfWidget}{\eq@protect\A}%
- {\eq@setButtonProps\eq@Button@driver}%
- {\PromptButtonDefaults\@@PromptButtonActions
- \every@ButtonField\every@CorrAnsButton}}%
- \else\PackageWarning{exerquiz}{The \string\PromptButton
- is for quiz questions only.}
- \fi
+\newcommand\@PromptButton[2][]{%
+ \def\PromptAns{#2}\if\eqQuizType\isQZ
+ \def\Fld@name{promptButton.\curr@quiz.\thequestionno}%
+ \else\def\Fld@name{promptButton.\oField.\thequestionno}\fi
+ \if\eqQuizType\isQZ
+ \def\@@PromptButtonActions{%
+ \A{\PromptButtonActionHook}}%
+ \mbox{\push@@Button{#1}{\Fld@name}{}%
+ {\DefaultHeightOfWidget}{\eq@protect\A}%
+ {\eq@setButtonProps\eq@Button@driver}%
+ {\PromptButtonDefaults\@@PromptButtonActions
+ \every@ButtonField\every@CorrAnsButton}}%
+ \else\PackageWarning{exerquiz}{The \string\PromptButton
+ is for quiz questions only.}
+ \fi
}
% \end{macrocode}
% \end{macro}
@@ -9122,7 +9249,7 @@ if (!isQuizInitialized("@currQuiz")) {
% \cs{CorrAnsButton} as the answer provided by the author.
% \begin{macrocode}
\newcommand{\PromptButton}{\makebox[0pt][r] % assumes xcolor
- {\@PromptButton[\textColor{1 0 0 rg}]{\CorrectAns}}}
+ {\@PromptButton[\textColor{1 0 0 rg}]{\CorrectAns}}}
% \end{macrocode}
% \begin{environment}{mathGrp}
% An environment for enclosing a collection of math/text fill-ins that are to be grouped
@@ -9138,162 +9265,128 @@ if (!isQuizInitialized("@currQuiz")) {
% \begin{macrocode}
\let\eq@ansGrpArray\@empty
\def\eq@recordGrpAnsArray#1{%
- \ifx\eq@ansGrpArray\@empty
- \edef\tmp@exp{\noexpand\g@addto@macro
- \noexpand\eq@ansGrpArray{#1}}\else
- \edef\tmp@exp{\noexpand\g@addto@macro
- \noexpand\eq@ansGrpArray{,#1}}\fi
- \tmp@exp
+ \ifx\eq@ansGrpArray\@empty
+ \edef\tmp@exp{\noexpand\g@addto@macro
+ \noexpand\eq@ansGrpArray{#1}}\else
+ \edef\tmp@exp{\noexpand\g@addto@macro
+ \noexpand\eq@ansGrpArray{,#1}}\fi
+ \tmp@exp
}
\let\grpquestions\eq@Zero
\def\mathGrp{\global\let\eq@ansGrpArray\@empty
- \@ifnextchar[{\@imathGrp}{\@imathGrp[groupEval]}}
+ \@ifnextchar[{\@imathGrp}{\@imathGrp[groupEval]}}
\def\@imathGrp[#1]{\def\argi{#1}%
- \@ifnextchar[{\@iimathGrp}{\@iimathGrp[]}}
+ \@ifnextchar[{\@iimathGrp}{\@iimathGrp[]}}
\def\@iimathGrp[#1]{\def\argii{#1}%
- \eq@AddProbToQzQuesList
- \global\let\grpquestions\eq@One
- \setcounter{grpquestionno}{0}%
- \stepcounter{questionno}%
- \xdef\beginGrp{\thequestionno}%
- \xdef\grpPointValue{\eqPTs}%
- \eq@recordThesePTs\eq@recordProbType
- \if\eqQuizType\isQZ
- \edef\eqtmp{\aPointType}%
- \xdef\aPointType{\eqtmp,[\eqPTs,"grp"]}\fi
- \addtocounter{eqpointvalue}{\eqPTs}%
- \ifx\argii\@empty
- \xdef\grpTotalWeight{\eqPTs}%
- \xdef\grpEvalFunction{\argi}%
- \else
- \xdef\grpTotalWeight{\argi}%
- \xdef\grpEvalFunction{\argii}%
- \fi
+ \eq@AddProbToQzQuesList
+ \global\let\grpquestions\eq@One
+ \setcounter{grpquestionno}{0}%
+ \stepcounter{questionno}%
+ \xdef\beginGrp{\thequestionno}%
+ \xdef\grpPointValue{\eqPTs}%
+ \eq@recordThesePTs\eq@recordProbType
+ \if\eqQuizType\isQZ
+ \edef\eqtmp{\aPointType}%
+ \xdef\aPointType{\eqtmp,[\eqPTs,"grp"]}\fi
+ \addtocounter{eqpointvalue}{\eqPTs}%
+ \ifx\argii\@empty
+ \xdef\grpTotalWeight{\eqPTs}%
+ \xdef\grpEvalFunction{\argi}%
+ \else
+ \xdef\grpTotalWeight{\argi}%
+ \xdef\grpEvalFunction{\argii}%
+ \fi
}
\def\endmathGrp{\global\let\grpquestions\eq@Zero
- \eq@recordCorrAns{[\eq@ansGrpArray]}%
- \xdef\endGrp{\thequestionno}}
+ \eq@recordCorrAns{[\eq@ansGrpArray]}%
+ \xdef\endGrp{\thequestionno}}
% \end{macrocode}
% \end{environment}
% \begin{macro}{\CorrAnsButtonGrp}
% The correct answer button for grouped questions.
+% \changes{v8.6}{2020/11/29}{Action for group answer btn now a \string\env{defineJS} env}
% \begin{macrocode}
-\def\CorrAnsButtonGrpDefaults
-{%
- \CA{\eq@local@CorrAnsButton}\W{1}\S{S}\BC{0 0 0}
- \BG{.7529 .7529 .7529}\H{P}
+\def\CorrAnsButtonGrpDefaults{%
+ \CA{\eq@local@CorrAnsButton}\W{1}\S{S}\BC{0 0 0}
+ \BG{.7529 .7529 .7529}\H{P}
}
-\def\CorrAnsButtonGrpActionHook{\JS{%
-\ifx\@qzsolndest\@empty\else
- if (event.shift)\jsR\jsT
- this.gotoNamedDest("\@qzsolndest");\jsR
- else\jsR
-\fi
- {\jsR\jsT
- var aCorrectAns=\CorrectAns;\jsR\jsT
- var beginGrp = 1;\jsR\jsT
- grpOffset = beginGrp;\jsR\jsT
-% if ( typeof \currQuiz == "undefined" ) {\jsR\jsT\jsT
-% \currQuiz = new Object;\jsR\jsT\jsT
-% \currQuiz.Grp = {};\jsR\jsT
-% }\jsR\jsT
- if ( \currQuiz.Grp==null ) \currQuiz.Grp = {};\jsR\jsT
- if (typeof \currQuiz.Grp["\thequestionno"]=="undefined")\jsR\jsT
- {\jsR\jsT\jsT
- \currQuiz.Grp["\thequestionno"] = {offset: 0};\jsR\jsT\jsT
- var f = this.getField(%
- "grpobj.\curr@quiz.\thequestionno."
- + grpOffset)\jsR\jsT\jsT
+\begin{defineJS}[\makeesc\!\makecmt\%]{\cabGrpActn}
+!ifx!@qzsolndest!@empty!else%
+if (event.shift) this.gotoNamedDest("!@qzsolndest");
+else !fi%
+{
+ var aCorrectAns=!CorrectAns;
+ var beginGrp=1;
+ var grpOffset=beginGrp;
+ if(!currQuiz.Grp==null)!currQuiz.Grp={};
+ if(typeof !currQuiz.Grp["!thequestionno"]=="undefined")
+ {
+ !currQuiz.Grp["!thequestionno"]={offset:0};
+ } else {
+ !currQuiz.Grp["!thequestionno"].offset=%
+++(!currQuiz.Grp["!thequestionno"].offset)!%aCorrectAns.length;
+ grpOffset=beginGrp%
++!currQuiz.Grp["!thequestionno"].offset;
+ }
+ var f=this.getField("grpobj.!curr@quiz.!thequestionno." %
++ grpOffset);
% \end{macrocode}
% When the field is readonly, then we cannot set the focus. We'll remove the readonly, set focus, then
-% reset readonly to true again; however, we must wait a little for \texttt{setFocus} to finish.
-% \begin{macrocode}
- if ( f.readonly ) {\jsR\jsT\jsT
- f.readonly = false;\jsR\jsT\jsT
- f.setFocus();\jsR\jsT\jsT
- eqDelay = app.setTimeOut(%
- "f.readonly = true;
- app.clearTimeOut(eqDelay);",10);\jsR\jsT
- } else f.setFocus();\jsR\jsT
- }\jsR\jsT
- else \jsR\jsT
- {\jsR\jsT\jsT
- \currQuiz.Grp["\thequestionno"].offset =
- ++\currQuiz.Grp["\thequestionno"].offset
- \% aCorrectAns.length;\jsR\jsT\jsT
- grpOffset = beginGrp
- + \currQuiz.Grp["\thequestionno"].offset;\jsR\jsT\jsT
- var f = this.getField("grpobj.\curr@quiz.\thequestionno."
- + grpOffset);\jsR\jsT\jsT
- if ( f.readonly ) {\jsR\jsT\jsT
- f.readonly = false;\jsR\jsT\jsT
- f.setFocus();\jsR\jsT\jsT
- eqDelay = app.setTimeOut("f.readonly = true;
- app.clearTimeOut(eqDelay);",10);\jsR\jsT
- } else f.setFocus();\jsR\jsT
- }\jsR\jsT
-\if\eqQuizType\isQZ
- DisplayAnswer("Ans.\curr@quiz",
- aCorrectAns[\currQuiz.Grp["\thequestionno"].offset],%
-\currQuiz);
-%\ifx\sqCorrAnsResetBC\@empty\else,\currQuiz\fi);\jsR
-\else
-% \end{macrocode}
-% Allow local definition the reset color for response boxes. The reset color
-% is normally black (\cs{eqDefaultColor}). Now if \cs{sqCorrAnsResetBC} is none
-% empty, we put it in as a property of the \cs{oField} object.
-% \begin{macrocode}
-%\ifx\sqCorrAnsResetBC\@empty\else
-% if ( typeof \oField=="undefined")\jsR\jsT\jsT
-% var \oField = new Object;\jsR\jsT
-% \oField.CorrAnsResetBC=\sqCorrAnsResetBC;\jsR\jsT
-%\fi
- DisplayAnswer("grpobj.\oField.\thequestionno."+ grpOffset,
- aCorrectAns[\currQuiz.Grp["\thequestionno"].offset],%
-\oField);\jsR
-\fi
- }
-}}
-\newcommand\CorrAnsButtonGrp[2][]
-{%
- \makeStringArray{#2}%
- \edef\CorrectAns{\stringArray}%
- \if\eqQuizType\isQZ\def\Fld@name{corr.\curr@quiz.\thequestionno}%
- \else\edef\currQuiz{\oField}%
+% reset readonly to true again; however, we must wait a little for !texttt{setFocus} to finish.
+% \begin{macrocode}
+ if(f.readonly){
+ f.readonly=false;
+ f.setFocus();
+ eqDelay=app.setTimeOut(%
+"f.readonly=true;app.clearTimeOut(eqDelay);",10);
+ } else f.setFocus();
+!if!eqQuizType!isQZ%
+ DisplayAnswer("Ans.!curr@quiz",%
+aCorrectAns[!currQuiz.Grp["!thequestionno"].offset],!currQuiz);!else%
+ DisplayAnswer("grpobj.!oField.!thequestionno."+ grpOffset,%
+aCorrectAns[!currQuiz.Grp["!thequestionno"].offset],!oField);!fi
+}
+\end{defineJS}
+\def\CorrAnsButtonGrpActionHook{\JS{\cabGrpActn}}
+\newcommand\CorrAnsButtonGrp[2][]{%
+ \makeStringArray{#2}%
+ \edef\CorrectAns{\stringArray}%
+ \if\eqQuizType\isQZ\def\Fld@name{corr.\curr@quiz.\thequestionno}%
+ \else\edef\currQuiz{\oField}%
\def\Fld@name{corr.\oField.\thequestionno}\fi
- \if\eqQuizType\isQZ
- \edef\@@CorrAnsButtonGrpActions{\noexpand\F{\FHidden}%
- \ifx\@qzsolndest\@empty%\noexpand\BC{\normalCABtnBC}
- \else\noexpand\BC{\solution@Color}\fi
- \noexpand\A{\noexpand\CorrAnsButtonGrpActionHook}}%
- \ifeq@noquizsolutions\else
- \mbox{\push@@Button{#1}{\Fld@name}{}{\DefaultHeightOfWidget}%
- {\eq@protect\A}{\eq@setButtonProps\eq@Button@driver}%
- {\CorrAnsButtonGrpDefaults\@@CorrAnsButtonGrpActions
- \every@ButtonField\every@CorrAnsButton}}%
- \fi
- \else
- \edef\@@CorrAnsButtonGrpActions{%
- \ifx\@qzsolndest\@empty%\noexpand\BC{\normalCABtnBC}
- \else\noexpand\BC{\solution@Color}\fi
- \noexpand\A{\noexpand\CorrAnsButtonGrpActionHook}}%
- \mbox{\push@@Button{#1}{\Fld@name}{}{\DefaultHeightOfWidget}%
- {\eq@protect\A}{\eq@setButtonProps\eq@Button@driver}%
- {\CorrAnsButtonGrpDefaults\@@CorrAnsButtonGrpActions
- \every@ButtonField\every@CorrAnsButton}}%
- \fi
+ \if\eqQuizType\isQZ
+ \edef\@@CorrAnsButtonGrpActions{\noexpand\F{\FHidden}%
+ \ifx\@qzsolndest\@empty
+ \else\noexpand\BC{\solution@Color}\fi
+ \noexpand\A{\noexpand\CorrAnsButtonGrpActionHook}}%
+ \ifeq@noquizsolutions\let\x\relax\else
+ \def\x{\mbox{\push@@Button{#1}{\Fld@name}{}%
+ {\DefaultHeightOfWidget}{\eq@protect\A}%
+ {\eq@setButtonProps\eq@Button@driver}%
+ {\CorrAnsButtonGrpDefaults\@@CorrAnsButtonGrpActions
+ \every@ButtonField\every@CorrAnsButton}}}\fi\x
+ \else
+ \edef\@@CorrAnsButtonGrpActions{%
+ \ifx\@qzsolndest\@empty%\noexpand\BC{\normalCABtnBC}
+ \else\noexpand\BC{\solution@Color}\fi
+ \noexpand\A{\noexpand\CorrAnsButtonGrpActionHook}}%
+ \mbox{\push@@Button{#1}{\Fld@name}{}{\DefaultHeightOfWidget}%
+ {\eq@protect\A}{\eq@setButtonProps\eq@Button@driver}%
+ {\CorrAnsButtonGrpDefaults\@@CorrAnsButtonGrpActions
+ \every@ButtonField\every@CorrAnsButton}}%
+ \fi
}
\def\makeStringArray#1{\def\stringArray{[}\@makeStringArray#1,\@nil}
\def\@makeStringArray#1,#2\@nil{%
- \edef\eq@temp{\stringArray}\def\argii{#2}%
- \ifx\argii\@empty
- \edef\stringArray{\eq@temp"#1"]}%
- \def\eq@next{}%
- \else
- \edef\stringArray{\eq@temp"#1",}%
- \def\eq@next{\@makeStringArray#2\@nil}%
- \fi
- \eq@next
+ \edef\eq@temp{\stringArray}\def\argii{#2}%
+ \ifx\argii\@empty
+ \edef\stringArray{\eq@temp"#1"]}%
+ \def\eq@next{}%
+ \else
+ \edef\stringArray{\eq@temp"#1",}%
+ \def\eq@next{\@makeStringArray#2\@nil}%
+ \fi
+ \eq@next
}
% \end{macrocode}
% \end{macro}
@@ -9314,15 +9407,14 @@ if (!isQuizInitialized("@currQuiz")) {
\let\@currentQues\@empty
\let\eqQzQuesList\@empty
\def\eq@AddProbToQzQuesList{%
- \edef\eq@tmpExp{\noexpand\g@addto@macro%
+ \edef\eq@tmpExp{\noexpand\g@addto@macro%
% \end{macrocode}
% Cosmetic change replaced \cs{noexpand} with \cs{string}.
% \changes{v8.2.15}{2019/08/06}{replace \string\cs{noexpand} with \string\cs{string}}
% \changes{v8.5.4}{2019/11/03}{Reverted to \string\cs{noexpand}}
% \begin{macrocode}
- \noexpand\eqQzQuesList{\noexpand
- \@eqListExp{\@currentQues}{\the\c@page}}}%
-% \@eqListExp{\@currentQues}{\thepage}}}%
+ \noexpand\eqQzQuesList{\noexpand
+ \@eqListExp{\@currentQues}{\the\c@page}}}%
% \end{macrocode}
% We add to the list only if we are not within a \texttt{mathGrp} environment.
% \begin{macrocode}
@@ -9348,9 +9440,9 @@ if (!isQuizInitialized("@currQuiz")) {
% the page that contains the button, the JS is executes.
% \begin{macrocode}
\def\pbPopulateSumTable{\pushButton[\W0\BG{}\BC{}\S{S}\autoCenter{n}
- \TU{\thequestionno}\Ff{\FfReadOnly}
- \AA{\AAPageVisible{try{popVisitsTbl("\currQuiz",\thequestionno)}%
- catch(e){}}}]{\currQuiz activateSC}{0pt}{0pt}}
+ \TU{\thequestionno}\Ff{\FfReadOnly}
+ \AA{\AAPageVisible{try{popVisitsTbl("\currQuiz",\thequestionno)}%
+ catch(e){}}}]{\currQuiz activateSC}{0pt}{0pt}}
% \end{macrocode}
% (2013/12/29) Here are some ideas to think about. Each change in the response to a question
% can execute the following code. I've put the needed information in the tooltip
@@ -9411,28 +9503,28 @@ if (!isQuizInitialized("@currQuiz")) {
%\end{description}
% \begin{macrocode}
\define@key{smrytbl}{ntables}{%
- \@tempcntb=#1
- \ifnum\@tempcntb<1 \@tempcntb=1 \fi
- \ifnum\@tempcntb>3 \@tempcntb=3 \fi
- \edef\smrytbl@ntables{\the\@tempcntb}%
+ \@tempcntb=#1
+ \ifnum\@tempcntb<\@ne\@tempcntb=\@ne\fi
+ \ifnum\@tempcntb>\thr@@\@tempcntb=\thr@@\fi
+ \edef\smrytbl@ntables{\the\@tempcntb}%
}
\def\smrytbl@ntables{2}
\define@key{smrytbl}{showmarkup}[true]{%
- \csname if#1\endcsname\eqshowmarkuptrue
- \else\eqshowmarkupfalse\fi
+ \csname if#1\endcsname\eqshowmarkuptrue
+ \else\eqshowmarkupfalse\fi
}
\newif\ifsmrytbl@corrections\smrytbl@correctionstrue
\define@key{smrytbl}{nocorrections}[true]{%
- \csname if#1\endcsname\smrytbl@correctionsfalse
- \else\smrytbl@correctionstrue\fi
+ \csname if#1\endcsname\smrytbl@correctionsfalse
+ \else\smrytbl@correctionstrue\fi
}
\define@key{smrytbl}{showOutOf}[true]{%
- \csname if#1\endcsname\eqshowOutOftrue\def\stfmtType{OO}%
- \gdef\showOutOfinSmryTbl{true}\let\stmarkupbox\relax
- \else
- \eqshowOutOffalse\let\stfmtType\@empty
- \gdef\showOutOfinSmryTbl{false}%
- \fi
+ \csname if#1\endcsname\eqshowOutOftrue\def\stfmtType{OO}%
+ \gdef\showOutOfinSmryTbl{true}\let\stmarkupbox\relax
+ \else
+ \eqshowOutOffalse\let\stfmtType\@empty
+ \gdef\showOutOfinSmryTbl{false}%
+ \fi
}
\let\stfmtType\@empty
\define@key{smrytbl}{setDimens}[]{#1}
@@ -9442,61 +9534,60 @@ if (!isQuizInitialized("@currQuiz")) {
% Finally we come to the definition of \cs{displaySumryTbl}.
% \begin{macrocode}
\newcommand{\displaySumryTbl}[2][]{%
- \begingroup\edef\currQuiz{#2}\edef\oField{#2}\edef\curr@quiz{#2}%
- \setkeys{smrytbl}{#1}%
- \eqtmpcnta\smrytbl@ntables\relax
+ \begingroup\edef\currQuiz{#2}\edef\oField{#2}\edef\curr@quiz{#2}%
+ \setkeys{smrytbl}{#1}%
+ \eqtmpcnta\smrytbl@ntables\relax
% \end{macrocode}
% We accept only 1 or 2 as an argument, we put it in \cs{count0},
% if not an integer, we'll stop the compile. If the argument is not 1,
% we force a value of 2.
% \begin{macrocode}
-% \ifnum\eqtmpcnta=\@ne\else\eqtmpcnta\tw@\fi
- \eq@rowcnt\z@\@tempcntb=\value{questionno}%
+ \eq@rowcnt\z@\@tempcntb=\value{questionno}%
% \end{macrocode}
% We calculate the number of rows in the first column, in case
% of a two column table. When the number of questions is odd,
% the the left-hand table will have one more entry than the right-hand
% column.
% \begin{macrocode}
- \ifnum\eqtmpcnta=\tw@
- \divide\@tempcntb\tw@
- \advance\@tempcntb\ifodd\value{questionno}2\else1\fi
- \xdef\@beginSecCol{\the\@tempcntb}%
- \advance\@tempcntb-1\relax
- \fi
+ \ifnum\eqtmpcnta=\tw@
+ \divide\@tempcntb\tw@
+ \advance\@tempcntb\ifodd\value{questionno}\tw@\else\@ne\fi
+ \xdef\@beginSecCol{\the\@tempcntb}\advance
+ \@tempcntb\m@ne
+ \fi
% \end{macrocode}
% Three table support
% \begin{macrocode}
- \ifnum\eqtmpcnta=\thr@@
- \edef\eq@n{\the\@tempcntb}%
- \divide\@tempcntb\eqtmpcnta
- \edef\eq@q{\the\@tempcntb}%
- \@tempcnta=\@tempcntb\multiply\@tempcnta3
- \edef\eq@p{\the\@tempcnta}%
- \@tempcnta=\eq@n
- \advance\@tempcnta-\eq@p\relax
- \ifnum\@tempcnta=\z@
- \@tempcntb=\eq@q \advance\@tempcntb\@ne
- \xdef\@beginSecCol{\the\@tempcntb}%
- \advance\@tempcntb\eq@q\relax
- \xdef\@beginThrdCol{\the\@tempcntb}%
- \else\ifnum\@tempcnta=\@ne
- \@tempcntb=\eq@q \advance\@tempcntb\@ne
- \edef\nB@lCols{\the\@tempcntb}%
- \advance\@tempcntb\@ne
- \xdef\@beginSecCol{\the\@tempcntb}%
- \advance\@tempcntb\eq@q\relax
- \xdef\@beginThrdCol{\the\@tempcntb}%
- \else\ifnum\@tempcnta=2\relax
- \@tempcntb=\eq@q \advance\@tempcntb1
- \edef\nB@lCols{\the\@tempcntb}%
- \advance\@tempcntb\@ne
- \xdef\@beginSecCol{\the\@tempcntb}%
- \advance\@tempcntb\nB@lCols
- \xdef\@beginThrdCol{\the\@tempcntb}%
- \fi\fi\fi
- \@tempcntb=\eq@n
- \fi
+ \ifnum\eqtmpcnta=\thr@@
+ \edef\eq@n{\the\@tempcntb}%
+ \divide\@tempcntb\eqtmpcnta
+ \edef\eq@q{\the\@tempcntb}%
+ \@tempcnta=\@tempcntb\multiply\@tempcnta3
+ \edef\eq@p{\the\@tempcnta}%
+ \@tempcnta=\eq@n
+ \advance\@tempcnta-\eq@p\relax
+ \ifnum\@tempcnta=\z@
+ \@tempcntb=\eq@q \advance\@tempcntb\@ne
+ \xdef\@beginSecCol{\the\@tempcntb}%
+ \advance\@tempcntb\eq@q\relax
+ \xdef\@beginThrdCol{\the\@tempcntb}%
+ \else\ifnum\@tempcnta=\@ne
+ \@tempcntb=\eq@q \advance\@tempcntb\@ne
+ \edef\nB@lCols{\the\@tempcntb}%
+ \advance\@tempcntb\@ne
+ \xdef\@beginSecCol{\the\@tempcntb}%
+ \advance\@tempcntb\eq@q\relax
+ \xdef\@beginThrdCol{\the\@tempcntb}%
+ \else\ifnum\@tempcnta=\tw@
+ \@tempcntb=\eq@q \advance\@tempcntb\@ne
+ \edef\nB@lCols{\the\@tempcntb}%
+ \advance\@tempcntb\@ne
+ \xdef\@beginSecCol{\the\@tempcntb}%
+ \advance\@tempcntb\nB@lCols
+ \xdef\@beginThrdCol{\the\@tempcntb}%
+ \fi\fi\fi
+ \@tempcntb=\eq@n
+ \fi
% \end{macrocode}
% We \cs{let} \cs{@eqListExp} to \cs{@@eqListExp}, defined below.
% \begin{macrocode}
@@ -9513,9 +9604,9 @@ if (!isQuizInitialized("@currQuiz")) {
% This is a definition of \cs{@eqListExp}. It appears in the
% token list \cs{eqQzQuesList}. A typical entry in \cs{eqQzQuesList} is
% of the form
-%\begin{verbatim}
-% \@eqListExp{<question_label>}{\thepage}
-%\end{verbatim}
+%\begin{quote}\ttfamily
+%\string\@eqListExp\darg{\ameta{question\_label}}\darg{\string\thepage}
+%\end{quote}
% We use the two arguments to construct a table of three columns: Question (consisting
% of the question label); Responded (a checkbox that is checked if that question was answered);
% and Page (a hypertext link to the page containing he question). The command may be redefined
@@ -9525,8 +9616,8 @@ if (!isQuizInitialized("@currQuiz")) {
% headings (may be redefined).
% \begin{macrocode}
\def\eq@begintab{%
- \begin{tabular}[t]{lcc}\sumryTblQ&\sumryTblR&\sumryTblP\\\sthline
- {\Large\strut}}
+ \begin{tabular}[t]{lcc}\sumryTblQ&\sumryTblR&\sumryTblP\\\sthline
+ {\Large\strut}}
% \end{macrocode}
% \DescribeMacro{\sthline}\cmd{\sthline}
% is a user hook to change the appearance of the horizontal line, such
@@ -9563,12 +9654,13 @@ if (!isQuizInitialized("@currQuiz")) {
% and stMarkup text field.
% \begin{macrocode}
\def\st@scndclmn{%
- \checkBox[\Ff{\FfReadOnly}]%
- {\ccatCurrQzWith(SanityCheck).\the\eq@rowcnt}%
- {\markupHeight}{\markupHeight}{Yes}\ifeqshowmarkup
- \stmarkupbox{\sumrytblCkMUsep\textField[%
- \Ff\FfReadOnly\BC{}\textColor{\pcMarkupColor}%
- \textSize{\stmarkupTextSize}\autoCenter{n}%
+ \checkBox[\Ff{\FfReadOnly}]
+ {\ccatCurrQzWith(SanityCheck).\the\eq@rowcnt}
+ {\markupHeight}{\markupHeight}{Yes}%
+ \ifeqshowmarkup
+ \stmarkupbox{\sumrytblCkMUsep\textField[%
+ \Ff\FfReadOnly\BC{}\textColor{\pcMarkupColor}
+ \textSize{\stmarkupTextSize}\autoCenter{n}]
% \end{macrocode}
% Key to being able to have duplicated summary fields with different \texttt{showOutOf}
% options is the naming of the text field. If \texttt{showOutOf=false}, the default,
@@ -9576,18 +9668,19 @@ if (!isQuizInitialized("@currQuiz")) {
% text field is named \cs{currQuizSanityCheckOOPts}. When the Correct button is pressed,
% the JavaScript function \texttt{correctSumryTbl()} checks for the existence of each of
% these two fields, and populates them properly formatted. The command \cs{stfmtType} is
-% either \cs{empty} or \cs{OO}.
+% either \cs{@empty} or \cs{OO}.
% \begin{macrocode}
- ]{\ccatCurrQzWith(SanityCheck\stfmtType Pts).\the\eq@rowcnt}%
- {\stmarkupWidth}{\stmarkupHeight}}\fi
+ {\ccatCurrQzWith(SanityCheck\stfmtType Pts).\the\eq@rowcnt}%
+ {\stmarkupWidth}{\stmarkupHeight}}%
+ \fi
}
% \end{macrocode}
% \textbf{Third column.} The third column of the table consisting of a link to the
% page that contains the question.
% \begin{macrocode}
\def\st@thrdclmn#1{%
- \setLink[\linktxtcolor{\@linkcolor}
- \A{\JS{this.pageNum=(#1-1)}}]{\sumrytbllinkHook{#1}}}
+ \setLink[\linktxtcolor{\@linkcolor}
+ \A{\JS{this.pageNum=(#1-1)}}]{\sumrytbllinkHook{#1}}}
% \end{macrocode}
% Now for the definition of \cs{@@eqListExp} which does the work in the table.
% \begin{macrocode}
@@ -9597,20 +9690,20 @@ if (!isQuizInitialized("@currQuiz")) {
% when the page becomes visible, and we expand \cs{eq@begintab}, which
% is a \texttt{tabular} environment.
% \begin{macrocode}
- \ifnum\eq@rowcnt=\@ne
- \pbPopulateSumTable\ifsmrytbl@corrections\else
- \pbDoNoCorrectSumryTbl\fi\expandafter\eq@begintab\fi
+ \ifnum\eq@rowcnt=\@ne
+ \pbPopulateSumTable\ifsmrytbl@corrections\else
+ \pbDoNoCorrectSumryTbl\fi\expandafter\eq@begintab\fi
% \end{macrocode}
% If it is the two table solution, and the row number equals the calculated
% value of the first row of the second table, we emit another
% \cs{eq@begintab}.
% \begin{macrocode}
- \ifnum\eqtmpcnta>\@ne\ifnum\eq@rowcnt=\@beginSecCol\relax
- \eq@endtab\expandafter\sumrytablesep\expandafter\eq@begintab
- \fi\fi
- \ifnum\eqtmpcnta=\thr@@\ifnum\eq@rowcnt=\@beginThrdCol\relax
- \eq@endtab\expandafter\sumrytablesep\expandafter\eq@begintab
- \fi\fi
+ \ifnum\eqtmpcnta>\@ne\ifnum\eq@rowcnt=\@beginSecCol\relax
+ \eq@endtab\expandafter\sumrytablesep\expandafter\eq@begintab
+ \fi\fi
+ \ifnum\eqtmpcnta=\thr@@\ifnum\eq@rowcnt=\@beginThrdCol\relax
+ \eq@endtab\expandafter\sumrytablesep\expandafter\eq@begintab
+ \fi\fi
% \end{macrocode}
% We layout a row of the table, problem label, checkbox, and page.
% \begin{macrocode}
@@ -9619,9 +9712,7 @@ if (!isQuizInitialized("@currQuiz")) {
% We set the \cs{eq@endtab} at the bottom of the first table,
% and at the bottom of the second table.
% \begin{macrocode}
-% \ifnum\count0=\tw@\ifnum\eq@rowcnt=\@tempcntb
-% \expandafter\eq@endtab\fi\fi
- \ifnum\eq@rowcnt=\thequestionno\relax\expandafter\eq@endtab\fi
+ \ifnum\eq@rowcnt=\value{questionno}\expandafter\eq@endtab\fi
}
% \end{macrocode}
%
@@ -9640,18 +9731,18 @@ if (!isQuizInitialized("@currQuiz")) {
% total number of questions.
% \begin{macrocode}
\def\writeProListAux{%
- \eq@IWAuxOut{\string
- \csarg\string\gdef{\currQuiz QzQuesList}{\eqQzQuesList}}%
- \eq@IWAuxOut{\string
- \csarg\string\gdef{\currQuiz nQuestions}{\thequestionno}}%
+ \eq@IWAuxOut{\string
+ \csarg\string\gdef{\currQuiz QzQuesList}{\eqQzQuesList}}%
+ \eq@IWAuxOut{\string
+ \csarg\string\gdef{\currQuiz nQuestions}{\thequestionno}}%
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\def\setParamSumryTblAux{%
- \edef\eqQzQuesList{\@nameuse{\currQuiz QzQuesList}}%
- \@ifundefined{\currQuiz nQuestions}{}{%
- \value{questionno}=\@nameuse{\currQuiz nQuestions}}%
+ \edef\eqQzQuesList{\@nameuse{\currQuiz QzQuesList}}%
+ \@ifundefined{\currQuiz nQuestions}{}{%
+ \value{questionno}=\@nameuse{\currQuiz nQuestions}}%
}
% \end{macrocode}
% \begin{environment}{sumryTblAux}
@@ -9676,7 +9767,7 @@ if (!isQuizInitialized("@currQuiz")) {
% quiz.
% \begin{macrocode}
\newenvironment{sumryTblAux}[1]{%
- \DeclareQuiz{#1}\setParamSumryTblAux}{}%
+ \DeclareQuiz{#1}\setParamSumryTblAux}{}%
% \end{macrocode}
% \end{environment}
% \begin{macrocode}
@@ -9686,41 +9777,40 @@ if (!isQuizInitialized("@currQuiz")) {
% \end{macrocode}
% \subsection{Posing MC/math fill-in questions}
% \begin{macrocode}
-\def\bMCFI{%
- \withinMCFItrue
- \ifx\qRadionActionsHook\@empty
- \let\qRadionActionsHook@SAVE\@empty
- \def\qRadionActionsHook{\jsR
- qRadioButtonMCFI(\Ans@choice,"\currQuiz",\thequestionno);}\else
- \let\qRadionActionsHook@SAVE\qRadionActionsHook
- \def\qRadionActionsHook{\qRadionActionsHook@SAVE\jsR
- qRadioButtonMCFI(\Ans@choice,"\currQuiz",\thequestionno);}\fi
- \ifx\every@RespBoxMath\@empty
- \let\every@RespBoxMath@SAVE\@empty
- \def\every@RespBoxMath{%
- \AddAAKeystroke{mcfiKeyStroke("\currQuiz",\thequestionno);}}%
- \else
- \let\every@RespBoxMath@SAVE\every@RespBoxMath
- \expandafter\def\expandafter\every@RespBoxMath\expandafter{%
- \every@RespBoxMath@SAVE
- \AddAAKeystroke{mcfiKeyStroke("\currQuiz",\thequestionno);}}%
- \fi
+\def\bMCFI{\withinMCFItrue
+ \ifx\qRadionActionsHook\@empty
+ \let\qRadionActionsHook@SAVE\@empty
+ \def\qRadionActionsHook{\jsR
+ qRadioButtonMCFI(\Ans@choice,"\currQuiz",\thequestionno);}\else
+ \let\qRadionActionsHook@SAVE\qRadionActionsHook
+ \def\qRadionActionsHook{\qRadionActionsHook@SAVE\jsR
+ qRadioButtonMCFI(\Ans@choice,"\currQuiz",\thequestionno);}\fi
+ \ifx\every@RespBoxMath\@empty
+ \let\every@RespBoxMath@SAVE\@empty
+ \def\every@RespBoxMath{%
+ \AddAAKeystroke{mcfiKeyStroke("\currQuiz",\thequestionno);}}%
+ \else
+ \let\every@RespBoxMath@SAVE\every@RespBoxMath
+ \expandafter\def\expandafter\every@RespBoxMath\expandafter
+ {\every@RespBoxMath@SAVE
+ \AddAAKeystroke{mcfiKeyStroke("\currQuiz",\thequestionno);}}%
+ \fi
}
\def\eMCFI{%
- \ifx\qRadionActionsHook@SAVE\@empty
- \let\qRadionActionsHook\@empty\else
- \let\qRadionActionsHook\qRadionActionsHook@SAVE\fi
- \ifx\every@RespBoxMath@SAVE\@empty
- \let\every@RespBoxMath\@empty\else
- \let\every@RespBoxMath\every@RespBoxMath@SAVE\fi
- \withinMCFIfalse
+ \ifx\qRadionActionsHook@SAVE\@empty
+ \let\qRadionActionsHook\@empty\else
+ \let\qRadionActionsHook\qRadionActionsHook@SAVE\fi
+ \ifx\every@RespBoxMath@SAVE\@empty
+ \let\every@RespBoxMath\@empty\else
+ \let\every@RespBoxMath\every@RespBoxMath@SAVE\fi
+ \withinMCFIfalse
}
\def\eqNA{-43252452452}
\@ifundefined{text}{\let\MCFIMarkup@BOX\mbox}{\let\MCFIMarkup@BOX\text}
\newcommand\mcfiMarkupfmt{\cgBdry
- ${}^{\MCFIMarkup@BOX{\aeb@creditmarkup}}$}
+ ${}^{\MCFIMarkup@BOX{\aeb@creditmarkup}}$}
\def\mcfiMarkup{\addtocounter{questionno}{-1}\mcfiMarkupfmt
- \stepcounter{questionno}}
+ \stepcounter{questionno}}
%</mcfi>
%<*package>
% \end{macrocode}
@@ -9748,8 +9838,8 @@ if (!isQuizInitialized("@currQuiz")) {
% the color without commas. For example |\solutionColor{0 .6 0}|
% \begin{macrocode}
\newcommand{\solutionColor}[1]{\def\eq@argi{#1}\ifx\eq@argi\@empty
- \def\solution@Color{\solutionColorDef}\else
- \def\solution@Color{#1}\fi}
+ \def\solution@Color{\solutionColorDef}\else
+ \def\solution@Color{#1}\fi}
\newcommand{\solutionColorDef}{0 .6 0}
\solutionColor{\solutionColorDef}
% \end{macrocode}
@@ -9766,19 +9856,19 @@ if (!isQuizInitialized("@currQuiz")) {
\def\eq@getCmdName#1#2{\edef#1{\expandafter\@gobble\string#2}}
\def\eq@getfirst#1#2\@nil{\def\eq@argi{#1}}
\def\eq@checkValidityModel#1{%
- \if#1g\else\if#1r\else\if#1c\else
- \PackageError{exerquiz}
- {JavaScript does not support this model}
- {Use a named color from one of the models gray, rgb, or cmyk.}
- \fi\fi\fi
+ \if#1g\else\if#1r\else\if#1c\else
+ \PackageError{exerquiz}
+ {JavaScript does not support this model}
+ {Use a named color from one of the models gray, rgb, or cmyk.}
+ \fi\fi\fi
}
\def\eq@jsSetColorMsg#1#2{\PackageWarning{exerquiz}
- {The argument `#2' of \string#1\MessageBreak
- is not of the right form.\MessageBreak Using the default}}
+ {The argument `#2' of \string#1\MessageBreak
+ is not of the right form.\MessageBreak Using the default}}
\def\eqModelInfo#1#2{%
- \uppercase{\def\eq@ucmodel{#1}}\def\eq@modelspec{#2}%
- \eq@getfirst#1\@nil\eq@ResetModelForGray{\eq@argi}%
- \eq@checkValidityModel{\eq@argi}%
+ \uppercase{\def\eq@ucmodel{#1}}\def\eq@modelspec{#2}%
+ \eq@getfirst#1\@nil\eq@ResetModelForGray{\eq@argi}%
+ \eq@checkValidityModel{\eq@argi}%
}
\def\eq@ResetModelForGray#1{\if#1g\def\eq@ucmodel{G}\fi}
% \end{macrocode}
@@ -9786,40 +9876,40 @@ if (!isQuizInitialized("@currQuiz")) {
% as the first two tokens.
% \begin{macrocode}
\def\eq@checkRawJSColor#1{%
- \edef\eq@argi{#1}\ifx\eq@argi\@empty
- \def\eq@next{\let\eq@rawJSCol\eq@YES}\else
- \def\eq@next{\expandafter\eq@@checkRawJSColor#1\@nil}\fi\eq@next
+ \edef\eq@argi{#1}\ifx\eq@argi\@empty
+ \def\eq@next{\let\eq@rawJSCol\eq@YES}\else
+ \def\eq@next{\expandafter\eq@@checkRawJSColor#1\@nil}\fi\eq@next
}
\def\eq@@checkRawJSColor#1#2#3\@nil{\let\eq@rawJSCol\eq@NO
- \let\eqpredefineJSCol\eq@NO
- \if[#1\if#2"\let\eq@rawJSCol\eq@YES\fi\fi
- \ifx\eq@rawJSCol\eq@NO\if#1c\if#2o\let\eq@rawJSCol\eq@YES
- \let\eqpredefineJSCol\eq@YES\fi\fi\fi
+ \let\eqpredefineJSCol\eq@NO
+ \if[#1\if#2"\let\eq@rawJSCol\eq@YES\fi\fi
+ \ifx\eq@rawJSCol\eq@NO\if#1c\if#2o\let\eq@rawJSCol\eq@YES
+ \let\eqpredefineJSCol\eq@YES\fi\fi\fi
}
\def\eq@jsColorWXColori#1#2{\edef\eq@colorDefn{#2}%
- \ifx\eq@colorDefn\@empty
- \ifx\is@Defined\eq@YES
- \edef\eq@colorDefn{\csname\cmdName Def\endcsname}\else
- \PackageError{exerquiz}{JS color \string#1 has an
- empty definition}{}\fi
- \fi
- \eq@checkRawJSColor{\eq@colorDefn}%
- \ifx\eq@rawJSCol\eq@NO
- \extractcolorspec{\eq@colorDefn}{\eq@tmp@color}%
- \expandafter\eqModelInfo\eq@tmp@color
- \edef#1{["\eq@ucmodel",\eq@modelspec]}%
- \else\edef#1{\eq@colorDefn}\fi
+ \ifx\eq@colorDefn\@empty
+ \ifx\is@Defined\eq@YES
+ \edef\eq@colorDefn{\csname\cmdName Def\endcsname}\else
+ \PackageError{exerquiz}{JS color \string#1 has an
+ empty definition}{}\fi
+ \fi
+ \eq@checkRawJSColor{\eq@colorDefn}%
+ \ifx\eq@rawJSCol\eq@NO
+ \extractcolorspec{\eq@colorDefn}{\eq@tmp@color}%
+ \expandafter\eqModelInfo\eq@tmp@color
+ \edef#1{["\eq@ucmodel",\eq@modelspec]}%
+ \else\edef#1{\eq@colorDefn}\fi
}
\def\eq@jsColorWOXColori#1#2{\def\eq@colorDefn{#2}%
- \ifx\eq@colorDefn\@empty
- \ifx\is@Defined\eq@YES
- \edef\eq@colorDefn{\csname cmdName Def\endcsname}\else
- \PackageError{exerquiz}{JS color \string#1 has an
- empty definition}{}\fi
- \fi
- \eq@checkRawJSColor{\eq@colorDefn}%
- \ifx\eq@rawJSCol\eq@YES\edef#1{\eq@colorDefn}\else
- \eq@jsSetColorMsg{#1}{#2}\fi
+ \ifx\eq@colorDefn\@empty
+ \ifx\is@Defined\eq@YES
+ \edef\eq@colorDefn{\csname cmdName Def\endcsname}\else
+ \PackageError{exerquiz}{JS color \string#1 has an
+ empty definition}{}\fi
+ \fi
+ \eq@checkRawJSColor{\eq@colorDefn}%
+ \ifx\eq@rawJSCol\eq@YES\edef#1{\eq@colorDefn}\else
+ \eq@jsSetColorMsg{#1}{#2}\fi
}
% \end{macrocode}
% \DescribeMacro{\jsColor} General command for defining a JavaScript Color, and support commands for
@@ -9837,13 +9927,13 @@ if (!isQuizInitialized("@currQuiz")) {
% When \textsf{xcolor} is not used, only the JavaScript format is allowed.
% \begin{macrocode}
\def\jsColor#1#2{\eq@getCmdName{\cmdName}{#1}%
- \let\is@Defined\eq@YES
- \expandafter\ifx\csname\cmdName\endcsname\relax
- \PackageWarning{exerquiz}{\string#1 is not a command used by
- exerquiz.\MessageBreak Will define it anyway}%
- \let\is@Defined\eq@NO\fi
- \HyColor@IfXcolor{\eq@jsColorWXColori{#1}{#2}}%
- {\eq@jsColorWOXColori{#1}{#2}}%
+ \let\is@Defined\eq@YES
+ \expandafter\ifx\csname\cmdName\endcsname\relax
+ \PackageWarning{exerquiz}{\string#1 is not a command used by
+ exerquiz.\MessageBreak Will define it anyway}%
+ \let\is@Defined\eq@NO\fi
+ \HyColor@IfXcolor{\eq@jsColorWXColori{#1}{#2}}%
+ {\eq@jsColorWOXColori{#1}{#2}}%
}
% \end{macrocode}
% \begin{macrocode}
@@ -9855,10 +9945,10 @@ if (!isQuizInitialized("@currQuiz")) {
% (\string\texttt{eqcolor})}
% \begin{macrocode}
\@ifundefined{jsColor}{%
- \InputIfFileExists{eqcolor.def}{\PackageInfo{exerquiz}
- {Inputting eqcolor.def}}
- {\PackageError{exerquiz}{cannot find eqcolor.def}
- {Refresh your file name database and try again.}}
+ \InputIfFileExists{eqcolor.def}{\PackageInfo{exerquiz}
+ {Inputting eqcolor.def}}
+ {\PackageError{exerquiz}{cannot find eqcolor.def}
+ {Refresh your file name database and try again.}}
}{}
% \end{macrocode}
%
@@ -9897,26 +9987,26 @@ if (!isQuizInitialized("@currQuiz")) {
% These must be declared in the preamble.
% \begin{macrocode}
\def\chooseJSsymbol{\@ifstar{\let\eq@isstar\eq@YES\chooseJSsymboli}
- {\let\eq@isstar\eq@NO\chooseJSsymboli}}
+ {\let\eq@isstar\eq@NO\chooseJSsymboli}}
\def\chooseJSsymboli#1{\lowercase{\edef\eq@arg{#1}}%
- \def\eq@carg{check}\ifx\eq@arg\eq@carg
- \def\eq@retnStyle{style.ch}\else
- \def\eq@carg{cross}\ifx\eq@arg\eq@carg
- \def\eq@retnStyle{style.cr}\else
- \def\eq@carg{diamond}\ifx\eq@arg\eq@carg
- \def\eq@retnStyle{style.di}\else
- \def\eq@carg{circle}\ifx\eq@arg\eq@carg
- \def\eq@retnStyle{style.ci}\else
- \def\eq@carg{star}\ifx\eq@arg\eq@carg
- \def\eq@retnStyle{style.st}\else
- \def\eq@carg{square}\ifx\eq@arg\eq@carg
- \def\eq@retnStyle{style.sq}\else
- \let\eq@retnStyle\@empty
- \ifx\eq@isstar\eq@NO\PackageWarning{exerquiz}
- {Argument `#1' not recognized.\MessageBreak
- Permissible values are check, cross, diamond,\MessageBreak
- circle, star, square. Will use the default}\fi
- \fi\fi\fi\fi\fi\fi
+ \def\eq@carg{check}\ifx\eq@arg\eq@carg
+ \def\eq@retnStyle{style.ch}\else
+ \def\eq@carg{cross}\ifx\eq@arg\eq@carg
+ \def\eq@retnStyle{style.cr}\else
+ \def\eq@carg{diamond}\ifx\eq@arg\eq@carg
+ \def\eq@retnStyle{style.di}\else
+ \def\eq@carg{circle}\ifx\eq@arg\eq@carg
+ \def\eq@retnStyle{style.ci}\else
+ \def\eq@carg{star}\ifx\eq@arg\eq@carg
+ \def\eq@retnStyle{style.st}\else
+ \def\eq@carg{square}\ifx\eq@arg\eq@carg
+ \def\eq@retnStyle{style.sq}\else
+ \let\eq@retnStyle\@empty
+ \ifx\eq@isstar\eq@NO\PackageWarning{exerquiz}
+ {Argument `#1' not recognized.\MessageBreak
+ Permissible values are check, cross, diamond,\MessageBreak
+ circle, star, square. Will use the default}\fi
+ \fi\fi\fi\fi\fi\fi
}
% \end{macrocode}
% \begin{macro}{\setRightAnsSymb}
@@ -9928,41 +10018,38 @@ if (!isQuizInitialized("@currQuiz")) {
% The check style when the use chooses the incorrect answer.
% (def: \texttt{style.cr})
% \begin{macrocode}
-%\def\defineAnsStyle#1#2{%
-% \eq@getCmdName{\cmdName}{#1}\let\is@Defined\eq@YES
-%}
\newcommand\setRghtAnsSymb[1]{\chooseJSsymbol{#1}%
- \ifx\eq@retnStyle\@empty\else
- \edef\rghtAnsSymbJS{\eq@retnStyle}%
- \edef\rghtAnsSymb{\eq@carg}\fi}
+ \ifx\eq@retnStyle\@empty\else
+ \edef\rghtAnsSymbJS{\eq@retnStyle}%
+ \edef\rghtAnsSymb{\eq@carg}\fi}
\def\rghtAnsSymbJS{style.ch}
\def\rghtAnsSymb{check}
\newcommand\setCorrAnsSymb[1]{\chooseJSsymbol{#1}%
- \ifx\eq@retnStyle\@empty\else
- \edef\corrAnsSymbJS{\eq@retnStyle}%
- \edef\corrAnsSymb{\eq@carg}\fi}
+ \ifx\eq@retnStyle\@empty\else
+ \edef\corrAnsSymbJS{\eq@retnStyle}%
+ \edef\corrAnsSymb{\eq@carg}\fi}
\def\corrAnsSymbJS{style.ci}
\def\corrAnsSymb{circle}
\newcommand\setWrngAnsSymb[1]{\chooseJSsymbol{#1}%
- \ifx\eq@retnStyle\@empty\else
- \edef\wrngAnsSymbJS{\eq@retnStyle}%
- \edef\wrngAnsSymb{\eq@carg}\fi}
+ \ifx\eq@retnStyle\@empty\else
+ \edef\wrngAnsSymbJS{\eq@retnStyle}%
+ \edef\wrngAnsSymb{\eq@carg}\fi}
\def\wrngAnsSymbJS{style.cr}
\def\wrngAnsSymb{cross}
\def\setRghtAnsSymbLoc#1{\chooseJSsymbol*{#1}%
- \ifx\eq@retnStyle\@empty
- \let\rghtAnsSymbJSLoc\@empty\else
- \edef\rghtAnsSymbJSLoc{\eq@retnStyle}\fi
+ \ifx\eq@retnStyle\@empty
+ \let\rghtAnsSymbJSLoc\@empty\else
+ \edef\rghtAnsSymbJSLoc{\eq@retnStyle}\fi
}
\def\setCorrAnsSymbLoc#1{\chooseJSsymbol*{#1}%
- \ifx\eq@retnStyle\@empty
- \let\corrAnsSymbJSLoc\@empty\else
- \edef\corrAnsSymbJSLoc{\eq@retnStyle}\fi
+ \ifx\eq@retnStyle\@empty
+ \let\corrAnsSymbJSLoc\@empty\else
+ \edef\corrAnsSymbJSLoc{\eq@retnStyle}\fi
}
\def\setWrngAnsSymbLoc#1{\chooseJSsymbol*{#1}%
- \ifx\eq@retnStyle\@empty
- \let\wrngAnsSymbJSLoc\@empty\else
- \edef\wrngAnsSymbJSLoc{\eq@retnStyle}\fi
+ \ifx\eq@retnStyle\@empty
+ \let\wrngAnsSymbJSLoc\@empty\else
+ \edef\wrngAnsSymbJSLoc{\eq@retnStyle}\fi
}
\let\rghtAnsSymbJSLoc\@empty
\let\rghtAnsSymbJSLocDef\@empty
@@ -10078,6 +10165,7 @@ if (!isQuizInitialized("@currQuiz")) {
%\end{flushleft}
% Define a special value (\cs{formatInitAltApprs}) for \cs{AddAAFormat} used in initializing \cs{RespBoxMath} problems,
% where there are alternate appearances.
+% See \url{http://www.acrotex.net/blog/?p=1335} for a discussion of the use of \cs{formatInitAltApprs}.
% \changes{v8.1a}{2017/09/03}{Define a special value (\string\cs{formatInitAltApprs}) for \string\cs{AddAAFormat}}
% \begin{macrocode}
\def\formatInitAltApprs{\formatInitAltApprs}
@@ -10170,7 +10258,7 @@ if (!isQuizInitialized("@currQuiz")) {
%}
% \begin{macrocode}
\def\@eqAddAAKeystroke#1{\def\argi{#1}\ifx\argi\@empty
- \def\eqAddAAKeystroke{}\else\def\eqAddAAKeystroke{#1}\fi} %\r
+ \def\eqAddAAKeystroke{}\else\def\eqAddAAKeystroke{#1}\fi} %\r
\def\eqAddAAKeystroke{}
% \end{macrocode}
% \end{macro}
@@ -10182,10 +10270,10 @@ if (!isQuizInitialized("@currQuiz")) {
% and \string\cs{@eqAddAAMouseUpMS}}
% \begin{macrocode}
\def\@eqAddAAMouseUpMC#1{\def\argi{#1}\ifx\argi\@empty
- \def\eqAddAAMouseUpMC{}\else\def\eqAddAAMouseUpMC{#1}\fi}
+ \def\eqAddAAMouseUpMC{}\else\def\eqAddAAMouseUpMC{#1}\fi}
\def\eqAddAAMouseUpMC{}
\def\@eqAddAAMouseUpMS#1{\def\argi{#1}\ifx\argi\@empty
- \def\eqAddAAMouseUpMS{}\else\def\eqAddAAMouseUpMS{#1}\fi}
+ \def\eqAddAAMouseUpMS{}\else\def\eqAddAAMouseUpMS{#1}\fi}
\def\eqAddAAMouseUpMS{}
% \end{macrocode}
% \end{macro}
@@ -10203,17 +10291,15 @@ if (!isQuizInitialized("@currQuiz")) {
% #4 = the height of the bounding rectangle
%\end{verbatim}
% \begin{macrocode}
-\def\eqIconDefaults
-{%
- \rawPDF{}\S{}\mkIns{/TP 1}\W{}
- \CA{}\RC{}\AC{}\BC{}\BG{}\H{N}
- \textColor{0 g}\Ff{\FfReadOnly}
+\def\eqIconDefaults{%
+ \rawPDF{}\S{}\mkIns{/TP 1}\W{}
+ \CA{}\RC{}\AC{}\BC{}\BG{}\H{N}
+ \textColor{0 g}\Ff{\FfReadOnly}
}
-\newcommand\eqIcon[4][]
-{%
- \mbox{\push@@Button{#1}{#2}{#3}{#4}{}{\eq@setButtonProps
- \eq@Button@driver}{\eqIconDefaults\every@ButtonField
- \every@eqIcon}}%
+\newcommand\eqIcon[4][]{%
+ \mbox{\push@@Button{#1}{#2}{#3}{#4}{}{\eq@setButtonProps
+ \eq@Button@driver}{\eqIconDefaults\every@ButtonField
+ \every@eqIcon}}%
}
% \end{macrocode}
% \end{macro}
@@ -10235,15 +10321,8 @@ if (!isQuizInitialized("@currQuiz")) {
% \begin{macrocode}
\def\aeb@array{new Array}
% \end{macrocode}
-% The following definitions are associated with \texttt{requireForm()}, the JS function
-% defined below.
-% \begin{macrocode}
-%\newcommand{\defaultReqFormMsg}{%
-% "The expression is not in the expected form."}
-% \end{macrocode}
% (07/16/11) Some definitions that may be used by \texttt{requireForm}, a \cs{RespMathBox} filter
% \begin{macrocode}
-%\def\refac(#1){\\(#1\\)}\def\regrp(#1){(#1)}\def\rechrclass(#1){[#1]}
\def\refac#1{\\(#1\\)}\def\regrp#1{(#1)}\def\rechrclass#1{[#1]}
\def\redm{\\.}\def\remul{\\*}\def\rediv{\\/}\def\repow{\\^}
\def\redigit{\\d}\def\reany{.}\def\rebstr{\string^}\def\reestr{\string$}
@@ -10254,9 +10333,6 @@ if (!isQuizInitialized("@currQuiz")) {
% (10/07/11) Some convenience commands to simplifying the use of the \texttt{priorParse}
% and \texttt{postParse} filters.
% \begin{macrocode}
-%\def\preDenyForm(#1){\Array(denyForm,#1)}
-%\def\preReqForm(#1){\Array(requireForm,#1)}
-%\def\postDenyForm(#1){\Array(requireFormNot,#1)}
\def\preReqForm{\Array(requireForm,\@gobble}
\def\preDenyForm{\Array(denyForm,\@gobble}
\def\postDenyForm{\Array(requireFormNot,\@gobble}
@@ -10268,7 +10344,7 @@ if (!isQuizInitialized("@currQuiz")) {
% of the no peeking alert box.
% \begin{macrocode}
\newcommand{\noPeekArgs}[1]{%
- \def\NoPeekAlert{eqAppAlert(#1)}}\def\newNoPeekArgs{}
+ \def\NoPeekAlert{eqAppAlert(#1)}}\def\newNoPeekArgs{}
\def\NoPeekAlert{eqAppAlert(\noPeekMsg,3)}
% \end{macrocode}
% \begin{macrocode}
@@ -10281,7 +10357,7 @@ if (!isQuizInitialized("@currQuiz")) {
\def\corrChoiceFullyOff{\def\eqCorrChoiceFully{false}}
\corrChoiceFullyOn
% \end{macrocode}
-% Implement a local version of full corrections of MS and MS
+% Implement a local version of full corrections of MC and MS
% \changes{v8.1l}{2018/02/07}{Add local version of \string\cs{corrChoiceFullOn}}
% \begin{macrocode}
\def\corrLocalChoiceFullyOn{\def\eqCorrLocalChoiceFully{true}}
@@ -10354,7 +10430,6 @@ var pi = Math.PI;
var replaceExclaim = \replaceexclaim;
var negPointsAllowed = \negpointsallowed;
var negPointsMarkupAllowed = \negpointsmarkupallowed;
-%var aQuizControl = new Array();
var aQuizControl = new Object;
var RightWrong=new Array();
var ProbValue = new Array();
@@ -11745,6 +11820,38 @@ function eqFilter(filterMethod) {
return this.toString();
}
}
+% \end{macrocode}
+% JavaScript support of spell checking command |\SpellCheck|
+% \changes{v8.5.11}{2020/11/11}{JavaScript support of spell checking command \string\cs{SpellCheck}}.
+% Returns the number of misspelled words, but allows user to to correct.
+% \begin{macrocode}
+function checkTheSpelling(targetFieldName) {
+ var spellChkCnt=0;
+% var thisName=event.target.name;
+% \end{macrocode}
+% The root name of the \cs{SpellCheck} field is \texttt{spl}. Here we replace
+% the root name with \texttt{obj} to get the field name of the previous \cs{RespBoxTxt(PC)}
+% field. For the \texttt{spell.checkWord()} method, \app{PDF-XChange Editor} returns \texttt{undefined}.
+% This (spell checking) is a AR/AA feature only.
+% \begin{macrocode}
+% var fName = "obj"+thisName.substring(3);
+% var f=this.getField(fName);
+% if (f==null) fName="grpobj"+thisName.substring(3);
+ var f=this.getField(targetFieldName);
+ var value=f.value;
+ var valueStrip = value.replace(/\s+/g,"");
+ if ( valueStrip != "" ) {
+ aBrk=value.split(/\s+/);
+ for (var i=0; i<aBrk.length; i++){
+ var word=aBrk[i];
+ var aRetnSC=spell.checkWord(word);
+ if (aRetnSC!=null) spellChkCnt++;
+ }
+ var corrdStr=spell.checkText(value);
+ f.value=corrdStr;
+ }
+ return spellChkCnt;
+}
\end{newsegment}
% \end{macrocode}
% \subsection{Multiple Choice Questions}
@@ -11836,12 +11943,12 @@ function InitializeQuiz(qtfield,mark) {
ProcessIt = false;
aQuizControl[qtfield] = 1;
this.resetForm(["ScoreField." + qtfield,"mc."+qtfield,
- "obj."+qtfield,"mck."+qtfield,"Ans."+qtfield,
- "PointsField."+qtfield,"PercentField."+qtfield,
- "essay."+qtfield,"GradeField."+qtfield,
- "grpobj."+qtfield,"qMark."+qtfield, qtfield+"SanityCheck",
- qtfield+"SanityCheckPts",qtfield+"SanityCheckOOPts",
- "rbmarkup."+qtfield]);
+ "obj."+qtfield,"mck."+qtfield,"Ans."+qtfield,
+ "PointsField."+qtfield,"PercentField."+qtfield,
+ "essay."+qtfield,"GradeField."+qtfield,
+ "grpobj."+qtfield,"qMark."+qtfield, qtfield+"SanityCheck",
+ qtfield+"SanityCheckPts",qtfield+"SanityCheckOOPts",
+ "rbmarkup."+qtfield]);
ProcessIt = true;
var f = this.getField("qMark."+qtfield);
if ( f != null ) f.display = display.hidden;
@@ -11990,16 +12097,16 @@ function DisplayQuizResults(qtfield,nPointTotal,nQuestions)
NPointTotal=nPointTotal; NQuestions=nQuestions;
for (var i=1; i < RightWrong.length; i++)
{
- if ( (typeof RightWrong[i] == "object" ) %
-&& ( RightWrong[i][0] == "grp" ) ) {
+ if ( (typeof RightWrong[i] == "object" ) && %
+( RightWrong[i][0] == "grp" ) ) {
// grouped question
- Score += GrpRight(RightWrong[i], i, qtfield);
- var aWeights = ProbValue[i].slice(2);
- var evalGrpJS = eval(ProbValue[i][1]);
- var evalGrpJSValue = evalGrpJS(this,qtfield,i,
- RightWrong[i],aWeights);
- ProbDist[i] = evalGrpJSValue;
- ptScore = ptScore + evalGrpJSValue;
+ Score += GrpRight(RightWrong[i], i, qtfield);
+ var aWeights = ProbValue[i].slice(2);
+ var evalGrpJS = eval(ProbValue[i][1]);
+ var evalGrpJSValue = evalGrpJS(this,qtfield,i,
+ RightWrong[i],aWeights);
+ ProbDist[i] = evalGrpJSValue;
+ ptScore = ptScore + evalGrpJSValue;
} else {
if (typeof RightWrong[i] == "object") {
if ( RightWrong[i][0] == 1 ) {
@@ -12018,20 +12125,21 @@ function DisplayQuizResults(qtfield,nPointTotal,nQuestions)
% If the user receives negative points, we change it to zero points.
% \changes{v8.5.9}{2020/02/21}{If the user receives negative points, we change it to zero points.}
% \begin{macrocode}
- if (!negPointsAllowed && !negPointsMarkupAllowed) if (ProbDist[i]<0) ProbDist[i]=0
+ if (!negPointsAllowed && %
+!negPointsMarkupAllowed && (ProbDist[i]<0) ) ProbDist[i]=0;
}
ptScore += (1*ProbDist[i]);
}
} else {
if (RightWrong[i]==1) {
Score++;
- ProbDist[i] = ( typeof ProbValue[i] == "object") ?
- 1*ProbValue[i][1] : 1*ProbValue[i];
+ ProbDist[i] = ( typeof ProbValue[i] == "object") ? %
+1*ProbValue[i][1] : 1*ProbValue[i];
ptScore += (1*ProbDist[i]);
}
else {
- ProbDist[i] = ( typeof ProbValue[i] == "object") ?
- 1*ProbValue[i][2] : 0;
+ ProbDist[i] = ( typeof ProbValue[i] == "object") ? %
+1*ProbValue[i][2] : 0;
ptScore += (1*ProbDist[i]);
}
}
@@ -12158,7 +12266,7 @@ function ProcessQuestion (key,letterresp,probno,
function correctQuiz(qtfield,nQuestions)
{
% \end{macrocode}
-% (2019/10/14) If \texttt{oRecordOfQuizData} is present (from \pkg{eq-save}, we use that data from the quiz.
+% (2019/10/14) If \texttt{oRecordOfQuizData} is present (from \pkg{eq-save}), we use that data from the quiz.
% \changes{v8.5.1}{2019/10/14}{Incorporated oRecordOfQuizData into correctQuiz()}
% \begin{macrocode}
var bROQD=(typeof oRecordOfQuizData=="object");
@@ -12439,6 +12547,12 @@ quizno,qtfield,pts,ppts) {
var retn = [ [ scoreThisProblem, passKey ], letterResponses ] ;
return retn;
}
+% \end{macrocode}
+% \leavevmode\IndexJS{LimitSelection}\hskip-\marginparsep\texttt{(\ameta{n},\ameta{fname},\ameta{index}}
+% This function supports the \cs{limitSelectionTo\darg{\ameta{n}}} command. The function determines
+% whether the user has chosen more than \ameta{n} in a MS choice field. The widget that activated this
+% function is \texttt{\ameta{fname}.\ameta{index}}.
+% \begin{macrocode}
function LimitSelection(n,fname,k) {
var f = this.getField(fname);
var g = f.getArray();
@@ -12941,6 +13055,9 @@ function qRadioButtonMCFI(key,qname,n) {
R\texorpdfstring{\'}{\string\351}ponses}
\renewcommand\eq@local@RC{Correctes}
\renewcommand\eq@local@AC{SVP !}
+\dlJSStr*[noquotes]{\limSelWarningMsg}{"Pour cette question,
+ vous \u00EAtes autoris\'{e} \`{a} faire au plus "
+ + n + " s\'{e}lections."}
%</eqfr>
% \end{macrocode}
% \subsection{German}
@@ -13060,7 +13177,7 @@ function qRadioButtonMCFI(key,qname,n) {
+ " sonst wird diese Antwort als falsch gewertet."}
\dlJSStr*[noquotes]{\limSelWarningMsg}{"F\"{u}r diese Aufgabe k\"{o}nnen
sie h\"{o}chstens " + n + " ausw\string\344hlen."}
-\fieldJSStr*[noquotes]{\promptButtonMsg}{%
+\flJSStr*[noquotes]{\promptButtonMsg}{%
"M\"{o}chten Sie die richtige Antwort jetzt sehen?"
+ " Ihre derzeitige Antwort ist diejenige, die gewertet wird."
+ " Wenn Sie auf \\"Yes\\" klicken, k\"{o}nnen Sie ihre Antwort
@@ -13131,6 +13248,9 @@ function qRadioButtonMCFI(key,qname,n) {
\renewcommand\eq@local@AC{%
V\texorpdfstring{\ae}{\string\346}r
s\texorpdfstring{\r}{\string\345}snill!}
+\dlJSStr*[noquotes]{\limSelWarningMsg}{"For dette sp\string\370rsm\string\345let
+ har du lov til \string\345 gj\string\370re p\string\345 det meste "
+ + n + " valg."}
%</eqno>
% \end{macrocode}
% \subsection{Dutch}
@@ -13219,6 +13339,8 @@ function qRadioButtonMCFI(key,qname,n) {
\renewcommand\eq@local@CA{Corrigeer}
\renewcommand\eq@local@RC{Mijn Antwoorden!}
\renewcommand\eq@local@AC{AUB!}
+\dlJSStr*[noquotes]{\limSelWarningMsg}{"Voor deze vraag mag je maximaal "
+ + n + " selecties maken."}
%</eqnl>
% \end{macrocode}
% \subsection{Spanish}
@@ -13304,6 +13426,9 @@ function qRadioButtonMCFI(key,qname,n) {
\renewcommand\eq@local@CA{Correctas}
\renewcommand\eq@local@RC{Mis Respuestas!}
\renewcommand\eq@local@AC{Por Favor!}
+\dlJSStr*[noquotes]{\limSelWarningMsg}{"Para esta pregunta,
+ se le permite hacer como m\'{a}ximo "
+ + n + " selecciones."}
%</eqes>
% \end{macrocode}
% \subsection{Italian}
@@ -13393,6 +13518,9 @@ function qRadioButtonMCFI(key,qname,n) {
\renewcommand\eq@local@CA{Correggere}
\renewcommand\eq@local@RC{Le mie risposte!}
\renewcommand\eq@local@AC{Per favore!}
+\dlJSStr*[noquotes]{\limSelWarningMsg}{"Per questa domanda,
+ \`{e} possibile effettuare al massimo "
+ + n + " selezioni."}
%</eqit>
% \end{macrocode}
% \subsection{Russian}
@@ -13483,12 +13611,9 @@ function qRadioButtonMCFI(key,qname,n) {
\renewcommand\eq@sqslrtnlabel{\^{a}{\aa}ð\'{\i}\'{o}\`{o}\"{u}\~{n}\"{y}}
% User access to shortquiz label
\renewcommand\sqslrtnlabel{\eq@sqslrtnlabel}
-
\cyrCommand\eqsqslrtnlabel{\^{E} \^{o}\^{\i}ð\`{\i}\'{o}\"{e}%
\`{e}ð\^{\i}\^{a}\^{e}{\aa} \c{c}\`{a}\"{a}\`{a}\'{\i}\`{e}\"{y}}
\renewcommand\eq@sqslrtnlabel{\eqsqslrtnlabel}
-
-
% Here is the default quiz label.
% No formatting allowed
% For Example: \renewcommand\eq@bqlabel{D\'ebut} (French)
@@ -13693,6 +13818,9 @@ function qRadioButtonMCFI(key,qname,n) {
\renewcommand\eq@local@AC{%
V\texorpdfstring{\ae}{\string\346}r
s\texorpdfstring{\r}{\string\345}god!}
+\dlJSStr*[noquotes]{\limSelWarningMsg}{"Til dette sp\string\370rgsm\string\345l,
+ er du lov til at g\string\370re h\string\370jst "
+ + n + " valg."}
%</eqda>
% \end{macrocode}
% \subsection{Polish}
@@ -13779,6 +13907,9 @@ function qRadioButtonMCFI(key,qname,n) {
\renewcommand\eq@local@RC{Moje odpowiedzi!}
\renewcommand\eq@local@AC{Prosze!}
%\renewcommand\eq@local@AC{Prosz\k{e}!}
+\dlJSStr*[noquotes]{\limSelWarningMsg}{"Na to pytanie,
+ mo\u017Cesz dokona\u0107 co najwy\u017Cej "
+ + n + " wybor\string\363w."}
%</eqpo>
% \end{macrocode}
% \subsection{Finnish}
@@ -13840,6 +13971,9 @@ function qRadioButtonMCFI(key,qname,n) {
\renewcommand\eq@local@CA{Oikein}
\renewcommand\eq@local@RC{Omat vastaukset!}
\renewcommand\eq@local@AC{Ole hyv\string\344!}}
+\dlJSStr*[noquotes]{\limSelWarningMsg}{"T\string\344h\string\344n
+ kysymykseen, voit tehd\string\344 enint\string\344\string\344n "
+ + n + " valintoja."}
%</eqfin>
% \end{macrocode}
% \subsection{catalan}
@@ -13925,6 +14059,9 @@ function qRadioButtonMCFI(key,qname,n) {
\renewcommand\eq@local@CA{Correctes}
\renewcommand\eq@local@RC{Les meves Respostes!}
\renewcommand\eq@local@AC{Si us plau!}
+\dlJSStr*[noquotes]{\limSelWarningMsg}{"Per a aquesta pregunta,
+ se li permet fer com a m\`{a}xim "
+ + n + " seleccions."}
%</eqcat>
% \end{macrocode}
%
@@ -14050,6 +14187,9 @@ function qRadioButtonMCFI(key,qname,n) {
+ "Kliknete-li na \\"Yes\\", uvidite spravnou odpoved, ale svou
stavajici odpoved na tuto otazku uz nebudete moct zmenit."
}
+\dlJSStr*[noquotes]{\limSelWarningMsg}{"Pro tuto ot\string\341zku
+ m\u016F\u017Eete prov\'{e}st maxim\'{a}ln\u011B "
+ + n + " v\u00FDb\u0115ry."}
%</eqcz>
% \end{macrocode}
% \subsection{brazil}
@@ -14141,6 +14281,9 @@ function qRadioButtonMCFI(key,qname,n) {
\renewcommand\eq@local@CA{Corretas}
\renewcommand\eq@local@RC{Minhas Respostas!}
\renewcommand\eq@local@AC{Por Favor!}
+\dlJSStr*[noquotes]{\limSelWarningMsg}{"Pro tuto ot\string\341zku
+ m\u016F\u017Eete prov\'{e}st maxim\'{a}ln\u011B "
+ + n + " v\u00FDb\u0115ry."}
%</eqbr>
% \end{macrocode}
% \subsection{turkish}
@@ -14233,6 +14376,8 @@ function qRadioButtonMCFI(key,qname,n) {
\renewcommand\eq@local@CA{Dogru}
\renewcommand\eq@local@RC{Benim Cevaplar\protect\u0131m!}
\renewcommand\eq@local@AC{L\protect\374tfen!}
+\dlJSStr*[noquotes]{\limSelWarningMsg}{"Bu soru i\u00E7in, en fazla "
+ + n + " se\u00E7im yapmak i\u00E7in izin verilir."}
%</eqtr>
% \end{macrocode}
% \Finale
diff --git a/texmf-dist/source/latex/acrotex/insdljs.dtx b/texmf-dist/source/latex/acrotex/insdljs.dtx
index 12b507ce..d53aeb6b 100644
--- a/texmf-dist/source/latex/acrotex/insdljs.dtx
+++ b/texmf-dist/source/latex/acrotex/insdljs.dtx
@@ -4,7 +4,7 @@
%<*copyright>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% insdljs.sty package, %%
-%% Copyright (C) 2001-2019 D. P. Story %%
+%% Copyright (C) 2001-2020 D. P. Story %%
%% dpstory@uakron.edu %%
%% %%
%% This program can redistributed and/or modified under %%
@@ -16,7 +16,7 @@
%</copyright>
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{insdljs}
-%<package> [2019/10/30 v2.4.8 Insert Document Level JavaScripts (dps)]
+%<package> [2020/12/20 v2.5 Insert Document Level JavaScripts (dps)]
%<*driver>
\documentclass{ltxdoc}
\usepackage[colorlinks,hyperindex=false]{hyperref}
@@ -470,7 +470,7 @@
% \begin{macrocode}
\let\isOpenAction\dl@NO
% \end{macrocode}
-% \IndexOpt{nodljs}
+% \leavevmode\IndexOpt{nodljs}^^A
% Option to cancel the insertion of DLJS, useful for a document meant to be
% printed only, or one that does not use the \texttt{shortquiz} or
% \texttt{quiz} environments, for example.
@@ -483,7 +483,7 @@
\let\firstdljs\dl@YES
\let\dljspresent\dl@NO
% \end{macrocode}
-% \IndexOpt{debug}
+% \leavevmode\IndexOpt{debug}^^A
% Use this option to help debug DLJS.
% \begin{macrocode}
\DeclareOptionX{debug}{\let\dljs@debug\dl@YES}
@@ -507,24 +507,24 @@
% We set the driver, according to the following algorithm.
% \begin{macrocode}
\@ifpackageloaded{web}{%
- \ExecuteOptionsX{\eq@driver@name}%
+ \ExecuteOptionsX{\eq@driver@name}%
}{%
- \@ifpackageloaded{eforms}{%
- \ExecuteOptionsX{\ef@driver}%
- }{%
- \ifpdf\ExecuteOptionsX{pdftex}\else
- \ifxetex\ExecuteOptionsX{xetex}\else
- \@ifundefined{l@tex@@@@driver}{\ExecuteOptionsX{dvips}}
- {\ExecuteOptionsX{dvipsone}}\fi\fi
- }%
+ \@ifpackageloaded{eforms}{%
+ \ExecuteOptionsX{\ef@driver}%
+ }{%
+ \ifpdf\ExecuteOptionsX{pdftex}\else
+ \ifxetex\ExecuteOptionsX{xetex}\else
+ \@ifundefined{l@tex@@@@driver}{\ExecuteOptionsX{dvips}}
+ {\ExecuteOptionsX{dvipsone}}\fi\fi
+ }%
}
% \end{macrocode}
-% \leavevmode\IndexOpt{reqjs}
+% \leavevmode\IndexOpt{reqjs}^^A
% Beginning with PDF 1.7, a document can specify requirements, here we declare
% the document uses JavaScripts. The option \texttt{reqjs} is taken by default,
% that is, JavaScripts are required for this document
-%
-% \DescribeMacro{!reqjs}
+% \medskip\par\noindent
+% \DescribeMacro{!reqjs}^^A
% The option \texttt{!reqis} turns off this feature; that is, there is no notification
% via the \textsf{YMB} (\textsf{Yellow Message Bar}) that Javascripts are used in the document, and the
% document may not function as designed.
@@ -545,10 +545,10 @@
% the usealtadobe option}
% \begin{macrocode}
\DeclareOptionX{usealtadobe}{\let\usedAdbFuncs\dl@YES
- \def\inputAltAdbFncs{\InputIfFileExists{altadbfncs.def}
- {\PackageInfo{insdljs}{Inputting code for usealtadobe option}}
- {\PackageWarning{insdljs}{Cannot find altadbfncs.def.\MessageBreak
- Reinstall or refresh your file name database.}}}}
+\def\inputAltAdbFncs{\InputIfFileExists{altadbfncs.def}
+ {\PackageInfo{insdljs}{Inputting code for usealtadobe option}}
+ {\PackageWarning{insdljs}{Cannot find altadbfncs.def.\MessageBreak
+ Reinstall or refresh your file name database.}}}}
\let\usedAdbFuncs\dl@NO
\let\inputAltAdbFncs\relax
% \end{macrocode}
@@ -564,14 +564,13 @@
% \end{macrocode}
% Issue a package error if there is no driver specified or implied.
% \begin{macrocode}
-\@ifundefined{dljs@drivernum}{%
- \PackageError{insdljs}%
- {You have not specified dvips, dvipsone, pdftex,\MessageBreak
- dvipdfm, dvipdfmx, or xetex in the option list
- \MessageBreak of the insdljs package}
- {Place one of the drivers dvips, dvipsone, pdftex, dvipdfm,
- dvipdfmx, or xetex
- \MessageBreak in the option list of the insdljs package.}
+\@ifundefined{dljs@drivernum}{\PackageError{insdljs}%
+ {You have not specified dvips, dvipsone, pdftex,\MessageBreak
+ dvipdfm, dvipdfmx, or xetex in the option list
+ \MessageBreak of the insdljs package}
+ {Place one of the drivers dvips, dvipsone, pdftex, dvipdfm,
+ dvipdfmx, or xetex
+ \MessageBreak in the option list of the insdljs package.}
}{}
% \end{macrocode}
% \subsection{Required Packages}
@@ -583,7 +582,6 @@
% \begin{macrocode}
\@ifundefined{ifpdfmarkup}{\newif\ifpdfmarkup}{}\pdfmarkupfalse
\ifpdf\else\ifxetex\else\pdfmarkuptrue\fi\fi
-% \begin{macrocode}
\RequirePackage{hyperref}
% \end{macrocode}
% LuaTeX v0.85 has made some changes to primitives, the definition below follows
@@ -593,8 +591,8 @@
% \changes{v2.3a}{2016/07/31}{Added luatex85 definition of \string\cs{pdfpageref}}
% \begin{macrocode}
\ifpdf\ifx\pdfextension\@undefined\else
- \protected\def\pdfnames{\pdfextension names }
- \def\pdfpageref{\pdffeedback pageref}\fi\fi
+ \protected\def\pdfnames{\pdfextension names }
+ \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}}
@@ -612,37 +610,37 @@
% Last minute adjustments in the driver.
% \begin{macrocode}
\@ifundefined{dljs@drivernum}{%
- \@ifundefined{eq@drivernum}{%
- \PackageWarning{insdljs}
- {No driver specified, will check for pdftex.}
- \@ifundefined{pdfoutput}{%
- \@ifundefined{@pdfm@mark}{\def\eq@drivernum{2}%
- \def\dljs@drivernum{1}\let\isOpenAction\dl@NO
- \PackageWarning{insdljs}{No pdftex, but detected dvipdfm}}%
- {\PackageWarning{insdljs}{Neither pdftex nor dvipdfm,
- assuming dvips/dvipsone.}%
- \def\eq@drivernum{0}\def\dljs@drivernum{0}%
- \let\isOpenAction\dl@YES}
- }{%
- \ifcase\pdfoutput
- \def\eq@drivernum{1}\def\dljs@drivernum{1}%
- \let\isOpenAction\dl@NO
- \PackageInfo{insdljs}{Pdftex detected.}%
- \else
- \def\eq@drivernum{0}\def\dljs@drivernum{0}%
- \let\isOpenAction\dl@YES
- \PackageWarning{insdljs}{Pdftex engine detected,
- but is outputting dvi. Assuming dvips as the driver.}%
- \fi
- }%
+ \@ifundefined{eq@drivernum}{%
+ \PackageWarning{insdljs}
+ {No driver specified, will check for pdftex.}
+ \@ifundefined{pdfoutput}{%
+ \@ifundefined{@pdfm@mark}{\def\eq@drivernum{2}%
+ \def\dljs@drivernum{1}\let\isOpenAction\dl@NO
+ \PackageWarning{insdljs}{No pdftex, but detected dvipdfm}}%
+ {\PackageWarning{insdljs}{Neither pdftex nor dvipdfm,
+ assuming dvips/dvipsone.}%
+ \def\eq@drivernum{0}\def\dljs@drivernum{0}%
+ \let\isOpenAction\dl@YES}
}{%
- \begingroup
- \count0=\eq@drivernum
- \xdef\dljs@drivernum{\ifcase\count0 0\or1\or2\or0\else0\fi}
- \ifnum\dljs@drivernum=0\global\let\isOpenAction\dl@YES
- \else\global\let\isOpenAction\dl@NO\fi
- \endgroup
+ \ifcase\pdfoutput
+ \def\eq@drivernum{1}\def\dljs@drivernum{1}%
+ \let\isOpenAction\dl@NO
+ \PackageInfo{insdljs}{Pdftex detected.}%
+ \else
+ \def\eq@drivernum{0}\def\dljs@drivernum{0}%
+ \let\isOpenAction\dl@YES
+ \PackageWarning{insdljs}{Pdftex engine detected,
+ but is outputting dvi. Assuming dvips as the driver.}%
+ \fi
}%
+ }{%
+ \begingroup
+ \count0=\eq@drivernum
+ \xdef\dljs@drivernum{\ifcase\count0 0\or1\or2\or0\else0\fi}
+ \ifnum\dljs@drivernum=0\global\let\isOpenAction\dl@YES
+ \else\global\let\isOpenAction\dl@NO\fi
+ \endgroup
+ }%
}{}
% \end{macrocode}
% I've always had problems with the pdftex option and inserting open page actions.
@@ -653,7 +651,7 @@
% This approach seems to work.
% \begin{macrocode}
\ifnum\dljs@drivernum=1\relax
- \RequirePackage{everyshi}
+ \RequirePackage{everyshi}
\fi
% \end{macrocode}
% If \texttt{reqjs} is in effect, we execute the following code, otherwise, we
@@ -663,10 +661,10 @@
\def\AEB@psMrk{[%]
\space}
\ifx\dl@reqJS\dl@YES
- \def\dl@@reqJS{/Type/Requirement/S/EnableJavaScripts}
- \ifpdf\pdfcatalog{\dl@@reqJS}\else
- \ifxetex\immediate\@pdfm@mark{put @catalog <<\dl@@reqJS>>}\else
- \literalps@out{\AEB@psMrk{Catalog} <<\dl@@reqJS>> /PUT pdfmark}\fi\fi
+ \def\dl@@reqJS{/Type/Requirement/S/EnableJavaScripts}
+ \ifpdf\pdfcatalog{\dl@@reqJS}\else
+ \ifxetex\immediate\@pdfm@mark{put @catalog <<\dl@@reqJS>>}\else
+ \literalps@out{\AEB@psMrk{Catalog} <<\dl@@reqJS>> /PUT pdfmark}\fi\fi
\fi
% \end{macrocode}
% Added switch to mark whether djs is inserted
@@ -789,18 +787,62 @@
%
%\subsection{Begin Code}
%
-% Some control sequences that are useful for formatting JavaScript.
-% \begin{macro}{\JS}
-% \begin{macro}{\Named}
-% A convenience command for writing JavaScript.
+% Some control sequences that are useful for various
+% actions. All appear within the \cs{A} key, eg, |\A{\JS{var x=17;}}|. Note the arguments
+% of some are delimited by parentheses, others by braces. Sorry for the inconsistency,
+% but these evolved over a period of years. Some keys require additional arguments which
+% are typically inserted in raw form; eg, |\A{\GoToR(|\ameta{dest}|)/F(example.pdf)}|.
+% \begin{macro}{\JS}\hskip-\marginparsep\texttt{\darg{\ameta{code}}}
+% A convenience command for writing a JavaScript action
% \begin{macrocode}
\providecommand\JS[1]{/S/JavaScript/JS(#1)}
-\providecommand\Named[1]{/S/Named/N/#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Named}\hskip-\marginparsep\texttt{\darg{\ameta{name}}}
+% A named action, eg, |\A{\Named{NextPage}}|
+% \begin{macrocode}
+\providecommand{\Named}[1]{/S/Named/N/#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\GoTo}\hskip-\marginparsep\texttt{(\ameta{name})}
+% A go-to-action; eg, |\A{\GoTo(|\ameta{dest}|)}|. The argument can actually be a name
+% (enclosed in parentheses), a byte string, or an array.
+% \begin{macrocode}
\providecommand{\GoTo}{/S/GoTo/D}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\GoToD}\hskip-\marginparsep\texttt{(\ameta{name})}
+% A go-to-action destination; eg, |\A{\GoToD(|\ameta{dest}|)}| (same as \cs{GoTo})
+% \begin{macrocode}
\providecommand{\GoToD}{/S/GoTo/D}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\GoToR}\hskip-\marginparsep\texttt{(\ameta{name})/F(\ameta{file-spec})} A go-to-remote action,
+% where \ameta{name} is the destination in the remote file \ameta{file-spec}; eg, |\A{\GoToR(|\ameta{dest}|)/F(example.pdf)}|
+%
+% \begin{macrocode}
\providecommand{\GoToR}{/S/GoToR}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\Thread}\hskip-\marginparsep\texttt{\darg{\ameta{thread-title}}}
+% \changes{v2.4.9}{2020/07/09}{Added \string\Thread}
+% A thread action; this command is used in the \pkg{artthreads} package.
+% \begin{macrocode}
+\providecommand{\Thread}[1]{/S/Thread/D(#1)}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\URI}\hskip-\marginparsep\texttt{\darg{\ameta{string}}}
+% A URI action, eg, |\A{\URI{http://www.example.com}}|
+% \begin{macrocode}
+\providecommand{\URI}[1]{/S/URI/URI(#1)}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Launch}\hskip-\marginparsep\texttt{\darg{\ameta{file-spec}}}
+% \changes{v2.5}{2020/12/20}{Added \string\Launch}
+% A launch action
+% \begin{macrocode}
+\providecommand{\Launch}[1]{/Launch/F(#1)}
+% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\def\previewMiKTeX{\def\jsR{\string\r}\def\jsT{\string\t}}
@@ -808,16 +850,30 @@
\gdef\js@@R{\noexpand
}}
% \end{macrocode}
-% We define space\DescribeMacro\pdfSp, left\DescribeMacro\pdfLBr\space and right\DescribeMacro\pdfRBr\space
+% We define space\DescribeMacro\pdfSp, left\DescribeMacro\pdfLBr, and right \DescribeMacro\pdfRBr
% 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}}
+% \changes{v2.4.10}{2020/11/28}{\string\cs{pdfSpacesOn} on by default,
+% only for \string\app{dvips}; otherwise, \string\cs{pdfSpacesOff}}
% \begin{macrocode}
\def\pdfSPDef{\string\040}
-\let\pdfSP\pdfSPDef
+\def\dl@sp@ce{ }
+% \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 the next line, according to some unknown algorithm. Normally this is not
+% a problem, but occasionally 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}
+\pdfSpacesOff
+\ifpdf\else\ifxetex\else\pdfSpacesOn\fi\fi
\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
@@ -826,18 +882,24 @@
\bgroup\obeyspaces
\gdef\dl@restorespcs{\global\let =\dl@sp@ce}\egroup
% \end{macrocode}
+% \cs{dljstfor} is used in the \texttt{cc4js} segment.
% \begin{macrocode}
\let\dljstfor\@tfor
% \end{macrocode}
-% 2012/06/20 Change the following code so there are no special cases.
+% \leavevmode\DescribeMacro{\dfnJSCR}\hskip-\marginparsep\texttt{\darg{\ameta{eol}}}
+% A help macro to define \cs{dfnJSR} in a convenient way; \cs{dfnJSR} is
+% used in the \env{defineJS} environment.
+% \changes{v2.5}{2020/12/20}{Helper commands \string\cs{dfnJSCR} to define
+% \string\cs{defineJSjsR} and \cs{dfnJSCRDef} to set default.}
% \begin{macrocode}
+\def\dfnJSCR#1{\gdef\dfnJSR{#1}\gdef\defineJSjsR{#1}}
+\def\dfnJSCRDef{\dfnJSCR{\string\r\eqbs^^J}}
+\dfnJSCRDef
\def\jsR{\string\r\string\n}
-%\def\jsR{\string\r\eqbs\js@@R}
-\def\defineJSjsR{\string\r\eqbs^^J}
% \end{macrocode}
-% \changes{v2.0l}{2012/11/10}{Added \cs{jsN}}
% \cs{r} is recognized by hyperref when \cs{pdfstringdef} is used. Hyperref
-% then modifies the expansion of \cs{r}. So, we'll use \cs{n} is those situations.
+% then modifies the expansion of \cs{r}. So, we'll use \cs{n} in those situations.
+% \changes{v2.0l}{2012/11/10}{Added \cs{jsN}}
% \begin{macrocode}
\def\jsN{\string\n}
{\catcode`\^^I\active %
@@ -872,7 +934,7 @@
% \begin{macrocode}
\def\dl@lparen{(}\def\dl@rparen{)}
\def\genericNL{^^J}
-\def\defjsLB{\expandafter\pdfmarkLB\@gobblefour}
+\def\defjsLB{\gobiv}
\def\genericLB{\eqbs\eqbs^^J}
\def\pdfmarkLB{\eqbs^^J}
\def\jscsDflt{\let\protect\noexpand\let\jslit\string
@@ -1014,13 +1076,12 @@
% This verbatim is used internally to write the \texttt{.djs} files, containing
% the JavaScript.
% \begin{macrocode}
-\newenvironment{js@verbatimwrite}% writes to current \js@verbatim@out
- {%
- \@bsphack
- \let\do\@makeother\dospecials\catcode`\^^M\active
- \def\verbatim@processline{%
- \immediate\write\js@verbatim@out{\the\verbatim@line}}%
- \verbatim@start}{\@esphack}
+\newenvironment{js@verbatimwrite}{% writes to current \js@verbatim@out
+ \@bsphack
+ \let\do\@makeother\dospecials\catcode`\^^M\active
+ \def\verbatim@processline{\immediate
+ \write\js@verbatim@out{\the\verbatim@line}}\verbatim@start
+}{\@esphack}
% \end{macrocode}
% Unlike the example of verbatimwrite in the \texttt{verbatim} package, we do not
% automatically close the stream when we finish out \texttt{js@verbatimwrite} environment.
@@ -1066,39 +1127,38 @@
\begingroup
\catcode`\~=\active \lccode`\~=`\^^M
\lowercase{\endgroup
- \def\eqverbatim@#1~{\verbatim@@#1*end\@nil}%
- \def\eqverbatim@@#1*end{%
- \verbatim@addtoline{#1}%
- \futurelet\dl@next\eqverbatim@@@}%
- \def\eqverbatim@@@#1\@nil{%
- \ifx\dl@next\@nil
- \verbatim@processline
- \verbatim@startline
- \let\dl@next\eqverbatim@
- \else
- \def\@tempa##1*end\@nil{##1}%
- \@temptokena{*end}%
- \def\dl@next{\expandafter\verbatim@test\@tempa#1\@nil~}%
- \fi\dl@next}%
+ \def\eqverbatim@#1~{\verbatim@@#1*end\@nil}%
+ \def\eqverbatim@@#1*end{%
+ \verbatim@addtoline{#1}%
+ \futurelet\dl@next\eqverbatim@@@}%
+ \def\eqverbatim@@@#1\@nil{%
+ \ifx\dl@next\@nil
+ \verbatim@processline
+ \verbatim@startline
+ \let\dl@next\eqverbatim@
+ \else
+ \def\@tempa##1*end\@nil{##1}%
+ \@temptokena{*end}%
+ \def\dl@next{\expandafter\verbatim@test\@tempa#1\@nil~}%
+ \fi\dl@next}%
}%
\def\jsexpverbatimwrite
{% writes to current \js@verbatim@out
- \@bsphack
-% \escapechar=-1%
- \ccpdfmark
- \catcode`\<=12 \catcode`\>=12
- \input{dljscc.def}%
-% Attempt to redefine some macros from the the verbatim package
- \let\verbatim@=\eqverbatim@
- \let\verbatim@@=\eqverbatim@@
- \let\verbatim@@@=\eqverbatim@@@
+ \@bsphack
+ \ccpdfmark
+ \catcode`\<=12 \catcode`\>=12
+ \input{dljscc.def}%
+% Attempt to redefine some macros from the verbatim package
+ \let\verbatim@=\eqverbatim@
+ \let\verbatim@@=\eqverbatim@@
+ \let\verbatim@@@=\eqverbatim@@@
% end redefine of verbatim package
- \let\do\@makeother\eqdospecials%
- \catcode`\^^M=\active\catcode`\^^I=12%
- \def\verbatim@processline{%
- \edef\expVerb{\the\verbatim@line}%
- \immediate\write\js@verbatim@out{\expVerb}}%
- \verbatim@start%
+ \let\do\@makeother\eqdospecials%
+ \catcode`\^^M=\active\catcode`\^^I=12%
+ \def\verbatim@processline{%
+ \edef\expVerb{\the\verbatim@line}%
+ \immediate\write\js@verbatim@out{\expVerb}}%
+ \verbatim@start%
}
\def\endjsexpverbatimwrite{\immediate\closeout\js@verbatim@out\@esphack}
% \end{macrocode}
@@ -1140,21 +1200,21 @@
\gdef\dl@tilda<\string~> \gdef\dl@sup<\string^>
\endgroup
\def\makeJSspecials{%
- \def\\{\eqbs\eqbs}% % define \\ to be \\
- \let\jslit\string
+ \def\\{\eqbs\eqbs}% % define \\ to be \\
+ \let\jslit\string
% \end{macrocode}
% \changes{v2.0n}{2014/05/20}{Remake the definition of \cs{\char`\{} and \cs{\char`\}}}
% In an attempt to avoid the use of \verb~\jslit\{~ and \verb~\jslit\}~, we remake
% the definition of \verb~\{} and \verb~\}~.
% \begin{macrocode}
- \let\{\dl@lBrace\let\}\dl@rBrace
+ \let\{\dl@lBrace\let\}\dl@rBrace
% \end{macrocode}
% \changes{v2.1}{2015/07/12}{\cs{let} \cs{u} to \cs{@empty}.}
% \cs{let} \cs{u} to \cs{@empty}.
% \begin{macrocode}
- \let\u\@empty
- \def\({\eqbs(}\def\){\eqbs)}%
- \makespecialJS % make \r=\jsR and \t=\jsT
+ \let\u\@empty
+ \def\({\eqbs(}\def\){\eqbs)}%
+ \makespecialJS % make \r=\jsR and \t=\jsT
}
% \end{macrocode}
% \subsection{Open Document Actions}\label{opendocactions}
@@ -1180,12 +1240,12 @@
\def\dl@inheritzoom{/XYZ 0 0 0}
\def\dl@mag#1{/XYZ null null #1}
\edef\dl@Page#1{\ifcase\dljs@drivernum
- {Page#1}\or\noexpand\pdfpageref#1\space\space 0 R\or
- @page#1\fi}
+ {Page#1}\or\noexpand\pdfpageref#1\space\space 0 R\or
+ @page#1\fi}
\def\dl@preProcDefns{\let\Page\dl@Page\let\mag\dl@mag
- \let\fitpage\dl@fitpage\let\actualsize\dl@actualsize
- \let\fitwidth\dl@fitwidth\let\fitheight\dl@fitheight
- \let\fitvisible\dl@fitvisible\let\inheritzoom\dl@inheritzoom
+ \let\fitpage\dl@fitpage\let\actualsize\dl@actualsize
+ \let\fitwidth\dl@fitwidth\let\fitheight\dl@fitheight
+ \let\fitvisible\dl@fitvisible\let\inheritzoom\dl@inheritzoom
}
\let\aeb@additionalOpenAction\@empty
\let\aeb@addActionCode\@empty
@@ -1205,42 +1265,42 @@
%\end{verbatim}
% \begin{macrocode}
\newcommand{\addToDocOpen}[1]{%
- \ifx\aebpFA\dl@NO
- \g@addto@macro\aebpopentoks{#1}%
- \def\aeb@additionalOpenAction{/Next {pubAddToDocOpen}}%
+ \ifx\aebpFA\dl@NO
+ \g@addto@macro\aebpopentoks{#1}%
+ \def\aeb@additionalOpenAction{/Next {pubAddToDocOpen}}%
\ifpdf
- \def\aeb@addActionCode{\immediate\pdfobj{<<
- \aebpopentoks\aebp@rightDelimiters >>}%
- \edef\addActionObj{\the\pdflastobj\space 0 R}}%
+ \def\aeb@addActionCode{\immediate\pdfobj{<<
+ \aebpopentoks\aebp@rightDelimiters >>}%
+ \edef\addActionObj{\the\pdflastobj\space 0 R}}%
\else\ifxetex
- \def\aeb@addActionCode{\immediate
- \@pdfm@mark{obj @objAddActionObj
- << \aebpopentoks\aebp@rightDelimiters >> }}%
- \def\addActionObj{@objAddActionObj}%
+ \def\aeb@addActionCode{\immediate
+ \@pdfm@mark{obj @objAddActionObj
+ << \aebpopentoks\aebp@rightDelimiters >> }}%
+ \def\addActionObj{@objAddActionObj}%
\else % postscript
- \def\aeb@addActionCode{\literalps@out{%
- \AEB@psMrk/_objdef {pubAddToDocOpen}
- /type/dict /OBJ pdfmark^^J%
- \AEB@psMrk{pubAddToDocOpen} <<
- \aebpopentoks\aebp@rightDelimiters >> /PUT pdfmark}}%
- \def\addActionObj{{pubAddToDocOpen}}%
+ \def\aeb@addActionCode{\literalps@out{%
+ \AEB@psMrk/_objdef {pubAddToDocOpen}
+ /type/dict /OBJ pdfmark^^J%
+ \AEB@psMrk{pubAddToDocOpen} <<
+ \aebpopentoks\aebp@rightDelimiters >> /PUT pdfmark}}%
+ \def\addActionObj{{pubAddToDocOpen}}%
\fi\fi
- \global\let\aebpFA\dl@YES
- \let\@pdfstartview\@empty
- \else
- \edef\aebp@dljstmp{\aebp@rightDelimiters}%
- \xdef\aebp@rightDelimiters{\aebp@dljstmp >> }%
- \g@addto@macro\aebpopentoks{/Next << #1 }%
- \fi
+ \global\let\aebpFA\dl@YES
+ \let\@pdfstartview\@empty
+ \else
+ \edef\aebp@dljstmp{\aebp@rightDelimiters}%
+ \xdef\aebp@rightDelimiters{\aebp@dljstmp >> }%
+ \g@addto@macro\aebpopentoks{/Next << #1 }%
+ \fi
}
\def\dljs@OpenActions{/OpenAction \addActionObj}
\def\dljs@setOpenActions{\bgroup\makeJSspecials\dl@preProcDefns
- \aeb@addActionCode
- \ifpdf\pdfcatalog{\dljs@OpenActions}\else
- \ifxetex\immediate
- \@pdfm@mark{put @catalog <<\dljs@OpenActions>>}\else
- \literalps@out{\AEB@psMrk
- {Catalog} <<\dljs@OpenActions>> /PUT pdfmark}\fi\fi\egroup}
+ \aeb@addActionCode
+ \ifpdf\pdfcatalog{\dljs@OpenActions}\else
+ \ifxetex\immediate
+ \@pdfm@mark{put @catalog <<\dljs@OpenActions>>}\else
+ \literalps@out{\AEB@psMrk
+ {Catalog} <<\dljs@OpenActions>> /PUT pdfmark}\fi\fi\egroup}
% \end{macrocode}
% If \textsf{aeb\_pro} is not loaded, we set the open actions. If \textsf{aeb\_pro}
% is loaded, we do nothing for \textsf{aeb\_pro} has its own contributions to the
@@ -1248,8 +1308,8 @@
% \changes{v2.3d}{2017/01/08}{Use \cs{aebpFA} to detect open actions}
% \begin{macrocode}
\@ifpackageloaded{aeb_pro}{}
- {\AtBeginDocument{\ifx\aebpFA\dl@YES\expandafter
- \dljs@setOpenActions\fi}}
+ {\AtBeginDocument{\ifx\aebpFA\dl@YES\expandafter
+ \dljs@setOpenActions\fi}}
% \end{macrocode}
%
% \subsection{Open Page Actions}\label{openaction}
@@ -1267,18 +1327,17 @@
% \begin{macrocode}
\let\@CloseAction\@empty
\def\@OAction@pdfmark{\literalps@out{%
- \AEB@psMrk{ThisPage} << /AA << /O << \theFirstAction\space
- \opentoks\@rightDelimiters >> \@CloseAction >> >> /PUT pdfmark}}
+ \AEB@psMrk{ThisPage} << /AA << /O << \theFirstAction\space
+ \opentoks\@rightDelimiters >> \@CloseAction >> >> /PUT pdfmark}}
\def\@POAction@pdfmark{\literalps@out{%
- \AEB@psMrk{ThisPage} << /AA << \@thisOpenAction
- \@thisCloseAction >> >> /PUT pdfmark}%
+ \AEB@psMrk{ThisPage} << /AA << \@thisOpenAction
+ \@thisCloseAction >> >> /PUT pdfmark}%
}
\def\@OAction@pdftex{%
- \ifx\isOpenAction\dl@YES
- \xdef\pdftexOAction{/AA << /O << \theFirstAction\space
- \opentoks\@rightDelimiters >> \@CloseAction >>}%
- \AtNextShipout{\pdfpageattr=\expandafter{\pdftexOAction}}%
- \fi
+ \ifx\isOpenAction\dl@YES
+ \xdef\pdftexOAction{/AA << /O << \theFirstAction\space
+ \opentoks\@rightDelimiters >> \@CloseAction >>}%
+ \AtNextShipout{\pdfpageattr=\expandafter{\pdftexOAction}}\fi
}
\def\@POAction@pdftex{%
\xdef\thisPageActionpdftex{/AA << \@thisOpenAction
@@ -1289,29 +1348,29 @@
% For \textsf{dvipdfm}
% \begin{macrocode}
\def\@OAction@dvipdfm{\ifx\isOpenAction\dl@YES
- \@pdfm@mark{put @thispage << /AA << /O << \theFirstAction\space
- \opentoks\@rightDelimiters >> \@CloseAction >> >>}\fi
+ \@pdfm@mark{put @thispage << /AA << /O << \theFirstAction\space
+ \opentoks\@rightDelimiters >> \@CloseAction >> >>}\fi
}
\def\@POAction@dvipdfm{%
- \@pdfm@mark{put @thispage << /AA << \@thisOpenAction
- \@thisCloseAction >> >>}%
+ \@pdfm@mark{put @thispage << /AA << \@thisOpenAction
+ \@thisCloseAction >> >>}%
}
% \end{macrocode}
% Now we choose the one appropriate to the user's driver option.
% \begin{macrocode}
\ifcase\dljs@drivernum
- \let\@OAction\@OAction@pdfmark
- \let\@POAction\@POAction@pdfmark
- \gdef\theFirstAction{/S/JavaScript/JS (\the\importfdftoks)}
- \let\isOpenAction\dl@YES
+ \let\@OAction\@OAction@pdfmark
+ \let\@POAction\@POAction@pdfmark
+ \gdef\theFirstAction{/S/JavaScript/JS (\the\importfdftoks)}
+ \let\isOpenAction\dl@YES
\or
- \let\@OAction\@OAction@pdftex
- \let\@POAction\@POAction@pdftex
- \AtBeginDocument{\@OAction@pdftex}
+ \let\@OAction\@OAction@pdftex
+ \let\@POAction\@POAction@pdftex
+ \AtBeginDocument{\@OAction@pdftex}
\or
- \let\@OAction\@OAction@dvipdfm
- \let\@POAction\@POAction@dvipdfm
- \AtBeginDocument{\@OAction@dvipdfm}
+ \let\@OAction\@OAction@dvipdfm
+ \let\@POAction\@POAction@dvipdfm
+ \AtBeginDocument{\@OAction@dvipdfm}
\fi
% \end{macrocode}
% \begin{macro}{\OpenAction}
@@ -1350,7 +1409,6 @@
%\end{verbatim}
%\cs{opentoks} accumulates the ``action''.
% \begin{macrocode}
-%\newtoks\opentoks \opentoks={}
\def\opentoks{}
% \end{macrocode}
% The open action is really not meant for anything too fancy, such as searching using regular
@@ -1360,14 +1418,14 @@
% open page action.
% \begin{macrocode}
\def\makespecialJS{%
- \let\r\jsR\let\t\jsT\let\n\jsN}
+ \let\r\jsR\let\t\jsT\let\n\jsN}
\def\@rightDelimiters{}
% \end{macrocode}
% If the next token is \cs{Next} then we gobble it up, and begin \cs{@OpenAction}
% otherwise we begin \cs{@OpenAction}. This allows the ``chaining'' as illustrated above.
% \begin{macrocode}
\def\OpenAction{\@ifnextchar\Next
- {\expandafter\@OpenAction\@gobble}{\@OpenAction}}
+ {\expandafter\@OpenAction\@gobble}{\@OpenAction}}
% \end{macrocode}
% \cs{@OpenAction}: This is the macro that actually does the work. We differentiate between whether the
% current argument \texttt{\#1} is the first of all open actions, or not. If the former,
@@ -1376,23 +1434,23 @@
% the \cs{opentoks} token register.
% \begin{macrocode}
\def\@OpenAction#1{%
- \ifx\isOpenAction\dl@NO
- {\makespecialJS\xdef\theFirstAction{#1}}%
- \global\let\isOpenAction\dl@YES
- \else
- \edef\dljstmp{\@rightDelimiters}%
- \xdef\@rightDelimiters{\dljstmp >> }%
- {\makespecialJS\xdef\dljstmp{\opentoks /Next << #1 }}%
- \xdef\opentoks{\dljstmp}%
- \fi
- \@nextOpenAction
+ \ifx\isOpenAction\dl@NO
+ {\makespecialJS\xdef\theFirstAction{#1}}%
+ \global\let\isOpenAction\dl@YES
+ \else
+ \edef\dljstmp{\@rightDelimiters}%
+ \xdef\@rightDelimiters{\dljstmp >> }%
+ {\makespecialJS\xdef\dljstmp{\opentoks /Next << #1 }}%
+ \xdef\opentoks{\dljstmp}%
+ \fi
+ \@nextOpenAction
}
% \end{macrocode}
% As its last act, \cs{@OpenAction} calls \cs{@nextOpenAction}, which is nearly identical to
% \cs{OpenAction}, except if there is no \cs{Next} token, the macro terminates.
% \begin{macrocode}
\def\@nextOpenAction{\@ifnextchar\Next{\expandafter
- \@OpenAction\@gobble}{}}
+ \@OpenAction\@gobble}{}}
% \end{macrocode}
% \end{macro}
% Here is a last example that uses the \texttt{insDLJS} environment and the \cs{OpenAction} command. This code
@@ -1427,58 +1485,56 @@
% The first argument is on open page action, the second one is a closed page action.
% \begin{macrocode}
\def\protectJSCtrls{\def\r{\string\r\string\n}%
- \def\t{\string\t}\def\n{\string\n}}
+ \def\t{\string\t}\def\n{\string\n}}
\def\dljs@tstlp{\@ifnextchar\bgroup
- {\let\dljs@multi\dl@YES\dljs@tstlpi}%
- {\let\dljs@multi\dl@NO\dljs@tstlpi}}
+ {\let\dljs@multi\dl@YES\dljs@tstlpi}%
+ {\let\dljs@multi\dl@NO\dljs@tstlpi}}
\def\dljs@tstlpi#1\@nil{}%
% #1=arg, #2=O|C, #3=cmd
-\def\dljs@bldScript#1#2#3{{%
- \dljs@tstlp#1\@nil
- \ifx\dljs@multi\dl@NO{\protectJSCtrls\xdef#3{/#2<<#1>>}}\else
- \toks0={}\let\dljs@rAngles\@empty\count0=0
- \@tfor\dljs@arg:=#1\do{%
- \ifnum\count0=0
- \toks0=\expandafter{\dljs@arg}\else
- \toks2=\expandafter{\dljs@arg}%
- \edef\holdtokstmp{\the\toks0
- /Next<<\the\toks2 }%
- \edef\dljs@rAngles{\dljs@rAngles\space>>}%
- \toks0=\expandafter{\holdtokstmp}%
- \fi
- \advance\count0by1
- }%
- {\protectJSCtrls\xdef#3{/#2<<\the\toks0 \dljs@rAngles>>}%
- \xdef#3{#3}}%
- \fi
-}}
+\def\dljs@bldScript#1#2#3{\bgroup
+ \dljs@tstlp#1\@nil
+ \ifx\dljs@multi\dl@NO{\protectJSCtrls\xdef#3{/#2<<#1>>}}\else
+ \toks0={}\let\dljs@rAngles\@empty\count0=0
+ \@tfor\dljs@arg:=#1\do{%
+ \ifnum\count0=0
+ \toks0=\expandafter{\dljs@arg}\else
+ \toks2=\expandafter{\dljs@arg}%
+ \edef\holdtokstmp{\the\toks0
+ /Next<<\the\toks2 }%
+ \edef\dljs@rAngles{\dljs@rAngles\space>>}%
+ \toks0=\expandafter{\holdtokstmp}%
+ \fi
+ \advance\count0by\@ne
+ }{\protectJSCtrls\xdef#3{/#2<<\the\toks0 \dljs@rAngles>>}%
+ \xdef#3{#3}}%
+ \fi
+\egroup}
\newcommand{\thisPageAction}[2]{%
- \let\@CloseAction\@empty
- \let\@thisOpenAction\@empty
- \let\@thisCloseAction\@empty
- \def\dljs@argi{#1}\def\dljs@argii{#2}%
+ \let\@CloseAction\@empty
+ \let\@thisOpenAction\@empty
+ \let\@thisCloseAction\@empty
+ \def\dljs@argi{#1}\def\dljs@argii{#2}%
% \end{macrocode}
% On the first page, \cs{OpenAction} is used to process the open action
% \begin{macrocode}
- \ifnum\value{page}=1\relax
- \ifx\dljs@argii\@empty\else
- \dljs@bldScript{#2}{C}{\@CloseAction}\fi
- \ifx\dljs@argi\@empty\else\dljs@tstlp#1\@nil
- \ifx\dljs@multi\dl@NO\OpenAction{#1}\else
- \@tfor\dljs@arg:=#1\do{\expandafter
- \OpenAction\expandafter{\dljs@arg}%
- }\fi
- \fi
- \else
+ \ifnum\value{page}=1\relax
+ \ifx\dljs@argii\@empty\else
+ \dljs@bldScript{#2}{C}{\@CloseAction}\fi
+ \ifx\dljs@argi\@empty\else\dljs@tstlp#1\@nil
+ \ifx\dljs@multi\dl@NO\OpenAction{#1}\else
+ \@tfor\dljs@arg:=#1\do{\expandafter
+ \OpenAction\expandafter{\dljs@arg}%
+ }\fi\fi
+ \else
% \end{macrocode}
% If this is not the first page, we just populate the \texttt{/O} dictionary
% \begin{macrocode}
- \ifx\dljs@argi\@empty\else
- \dljs@bldScript{#1}{O}{\@thisOpenAction}\fi
- \ifx\dljs@argii\@empty\else
- \dljs@bldScript{#2}{C}{\@thisCloseAction}\fi
- \@POAction
- \fi
+ \ifx\dljs@argi\@empty\else
+ \dljs@bldScript{#1}{O}{\@thisOpenAction}\fi
+ \ifx\dljs@argii\@empty\else
+ \dljs@bldScript{#2}{C}{\@thisCloseAction}\fi
+ \@POAction
+ \fi
}
% \end{macrocode}
% \subsection{The \texttt{insDLJS} Environments}
@@ -1544,10 +1600,10 @@
\let\insdljsloadVar\@empty
\newenvironment{insDLJS}[3][]
{%
- \gdef\detectdljs{#1}\gdef\dljsBase{#2}%
- \ifxetex{\def\1{\string\1}\def\2{\string2}%
- \def\3{\string\3}\xdef\dljsName{#3}}\else
- \Hy@unicodefalse\pdfstringdef{\dljsName}{#3}\fi
+ \gdef\detectdljs{#1}\gdef\dljsBase{#2}%
+ \ifxetex{\def\1{\string\1}\def\2{\string2}%
+ \def\3{\string\3}\xdef\dljsName{#3}}\else
+ \Hy@unicodefalse\pdfstringdef{\dljsName}{#3}\fi
% \end{macrocode}
% If the optional argument is not passed,
% we generate one for the user.
@@ -1555,32 +1611,32 @@
% we generate one for the user.}
% \begin{macrocode}
\ifx\detectdljs\@empty
- \stepcounter{dljs@cnt}%
- \xdef\detectdljs{_bInsdljsload\arabic{dljs@cnt}}%
- \edef\insdljsloadVar{var \detectdljs=true;}%
- \addtocounter{dljs@cnt}{-1}%
+ \stepcounter{dljs@cnt}%
+ \xdef\detectdljs{_bInsdljsload\arabic{dljs@cnt}}%
+ \edef\insdljsloadVar{var \detectdljs=true;}%
+ \addtocounter{dljs@cnt}{-1}%
\fi
- \global\let\multisegments\dl@NO\setcounter{dljssegs}{2}%
- \global\dljsobjtoks={}%
- \expandafter\ifx\csname dljs\dljsBase\endcsname\relax
- \else\@insjserrDuplicate\fi
- \ifcase\dljs@drivernum
- \let\insert@DLJS=\insert@DLJS@pdfmark
- \let\endinsDLJS=\endinsert@DLJS@pdfmark
- \let\newsegment=\newsegment@pdfmark
- \let\endnewsegment=\endnewsegment@pdfmark
- \or
- \let\insert@DLJS=\insert@DLJS@pdftex
- \let\endinsDLJS=\endinsert@DLJS@pdftex
- \let\newsegment=\newsegment@pdftex
- \let\endnewsegment=\endnewsegment@pdftex
- \or
- \let\insert@DLJS=\insert@DLJS@dvipdfm
- \let\endinsDLJS=\endinsert@DLJS@dvipdfm
- \let\newsegment=\newsegment@dvipdfm
- \let\endnewsegment=\endnewsegment@dvipdfm
- \fi
- \insert@DLJS
+ \global\let\multisegments\dl@NO\setcounter{dljssegs}{2}%
+ \global\dljsobjtoks={}\expandafter
+ \ifx\csname dljs\dljsBase\endcsname\relax
+ \else\@insjserrDuplicate\fi
+ \ifcase\dljs@drivernum
+ \let\insert@DLJS=\insert@DLJS@pdfmark
+ \let\endinsDLJS=\endinsert@DLJS@pdfmark
+ \let\newsegment=\newsegment@pdfmark
+ \let\endnewsegment=\endnewsegment@pdfmark
+ \or
+ \let\insert@DLJS=\insert@DLJS@pdftex
+ \let\endinsDLJS=\endinsert@DLJS@pdftex
+ \let\newsegment=\newsegment@pdftex
+ \let\endnewsegment=\endnewsegment@pdftex
+ \or
+ \let\insert@DLJS=\insert@DLJS@dvipdfm
+ \let\endinsDLJS=\endinsert@DLJS@dvipdfm
+ \let\newsegment=\newsegment@dvipdfm
+ \let\endnewsegment=\endnewsegment@dvipdfm
+ \fi
+ \insert@DLJS
}{}
% \end{macrocode}
%
@@ -1634,7 +1690,7 @@
% \begin{macrocode}
\newenvironment{insDLJS*}[2][]
{%
- \gdef\detectdljs{#1}\gdef\dljsBase{#2}%
+ \gdef\detectdljs{#1}\gdef\dljsBase{#2}%
% \end{macrocode}
% If the optional argument is not passed,
% we generate one for the user.
@@ -1642,43 +1698,40 @@
% we generate one for the user.}
% \begin{macrocode}
\ifx\detectdljs\@empty
- \stepcounter{dljs@cnt}%
- \xdef\detectdljs{_bInsdljsload\arabic{dljs@cnt}}%
- \edef\insdljsloadVar{var \detectdljs=true;}%
- \addtocounter{dljs@cnt}{-1}%
+ \stepcounter{dljs@cnt}%
+ \xdef\detectdljs{_bInsdljsload\arabic{dljs@cnt}}%
+ \edef\insdljsloadVar{var \detectdljs=true;}%
+ \addtocounter{dljs@cnt}{-1}%
\fi
- \global\let\multisegments\dl@YES\setcounter{dljssegs}{2}%
- \global\dljsobjtoks={}%
- \expandafter\ifx\csname dljs\dljsBase\endcsname\relax
- \else\@insjserrDuplicate\fi
- \ifcase\dljs@drivernum
- \let\insert@DLJS=\insert@DLJS@pdfmark
- \expandafter
- \let\csname endinsDLJS*\endcsname\endinsert@DLJS@pdfmark
- \let\newsegment=\newsegment@pdfmark
- \let\endnewsegment=\endnewsegment@pdfmark
- \or
- \let\insert@DLJS=\insert@DLJS@pdftex
- \expandafter
- \let\csname endinsDLJS*\endcsname\endinsert@DLJS@pdftex
- \let\newsegment=\newsegment@pdftex
- \let\endnewsegment=\endnewsegment@pdftex
- \or
- \let\insert@DLJS=\insert@DLJS@dvipdfm
- \expandafter
- \let\csname endinsDLJS*\endcsname\endinsert@DLJS@dvipdfm
- \let\newsegment=\newsegment@dvipdfm
- \let\endnewsegment=\endnewsegment@dvipdfm
- \fi
- \insert@DLJS
+ \global\let\multisegments\dl@YES\setcounter{dljssegs}{2}%
+ \global\dljsobjtoks={}%
+ \expandafter\ifx\csname dljs\dljsBase\endcsname\relax
+ \else\@insjserrDuplicate\fi
+ \ifcase\dljs@drivernum
+ \let\insert@DLJS=\insert@DLJS@pdfmark\expandafter
+ \let\csname endinsDLJS*\endcsname\endinsert@DLJS@pdfmark
+ \let\newsegment=\newsegment@pdfmark
+ \let\endnewsegment=\endnewsegment@pdfmark
+ \or
+ \let\insert@DLJS=\insert@DLJS@pdftex\expandafter
+ \let\csname endinsDLJS*\endcsname\endinsert@DLJS@pdftex
+ \let\newsegment=\newsegment@pdftex
+ \let\endnewsegment=\endnewsegment@pdftex
+ \or
+ \let\insert@DLJS=\insert@DLJS@dvipdfm\expandafter
+ \let\csname endinsDLJS*\endcsname\endinsert@DLJS@dvipdfm
+ \let\newsegment=\newsegment@dvipdfm
+ \let\endnewsegment=\endnewsegment@dvipdfm
+ \fi
+ \insert@DLJS
}{}
\def\@insjserrDuplicate{%
- \typeout{^^J! insdljs Package error.}
- \typeout{! insDLJS environment: On line number \the\inputlineno,}
- \typeout{! the base name `\dljsBase' has already been chosen.}
- \typeout{! A DLJS earlier defined has been overwritten!}
- \typeout{! Choose another name for the first required argument}
- \typeout{! of the insDLJS environment.^^J}
+ \typeout{^^J! insdljs Package error.}
+ \typeout{! insDLJS environment: On line number \the\inputlineno,}
+ \typeout{! the base name `\dljsBase' has already been chosen.}
+ \typeout{! A DLJS earlier defined has been overwritten!}
+ \typeout{! Choose another name for the first required argument}
+ \typeout{! of the insDLJS environment.^^J}
}
% \end{macrocode}
% \end{macro}
@@ -1708,18 +1761,18 @@
% \begin{macrocode}
\let\DLspecialDefs\@empty
\def\fdfAfterheader#1{%
- \iwvo{\string\begingroup\string\efdlspecials}
- \iwvo{\string\DLspecialDefs\string#1}
- \iwvo{\string\isdljstrue}
- \iwvo{\string\makeatletter}
- \iwvo{\string\immediate\string\openout\string
+ \iwvo{\string\begingroup\string\efdlspecials}
+ \iwvo{\string\DLspecialDefs\string#1}
+ \iwvo{\string\isdljstrue}
+ \iwvo{\string\makeatletter}
+ \iwvo{\string\immediate\string\openout\string
\js@verbatim@out=\string\js@Path\space\dljsBase.fdf}%
- \iwvo{\string\begin{jsexpverbatimwrite}}
- \iwvo{\string\firstFDFline}
- \iwvo{1 0 obj}
- \iwvo{<< /FDF << /JavaScript << /Doc 2 0 R /After 3 0 R >> >> >> }
- \iwvo{endobj}
- \iwvo{2 0 obj}
+ \iwvo{\string\begin{jsexpverbatimwrite}}
+ \iwvo{\string\firstFDFline}
+ \iwvo{1 0 obj}
+ \iwvo{<< /FDF << /JavaScript << /Doc 2 0 R /After 3 0 R >> >> >> }
+ \iwvo{endobj}
+ \iwvo{2 0 obj}
% \end{macrocode}
% When a non-Distiller workflow, ensure execJSs are listed first.
% \changes{v2.2h}{2016/06/09}{When a non-Distiller workflow, ensure execJSs are listed first}
@@ -1753,34 +1806,34 @@
\def\restoreDLspecialDefs{\let\DLspecialDefs\@empty}
\newenvironment{execJS}[2][\relax]
{%
- \def\x{#1}\ifx\x\@empty\def\x{\relax}\fi
- \gdef\detectdljs{\string_#2}\gdef\dljsBase{#2}%
- \global\dljsobjtoks={}%
- \expandafter\gdef\csname dljs\dljsBase\endcsname{}%
- \ifx\importdljs\dl@YES\ifx\execjs\dl@YES
- \ifx\dl@gopro\dl@YES
- \ifnum\dljs@drivernum=0\relax
- \addImportAnFDF\importAnFDFTemplate
- \else
- \OpenAction{/S/JavaScript/JS (\importAnFDFTemplate)}%
- \fi\fi
+ \def\x{#1}\ifx\x\@empty\def\x{\relax}\fi
+ \gdef\detectdljs{\string_#2}\gdef\dljsBase{#2}%
+ \global\dljsobjtoks={}%
+ \expandafter\gdef\csname dljs\dljsBase\endcsname{}%
+ \ifx\importdljs\dl@YES\ifx\execjs\dl@YES
+ \ifx\dl@gopro\dl@YES
+ \ifnum\dljs@drivernum=0\relax
+ \addImportAnFDF\importAnFDFTemplate
+ \else
+ \OpenAction{/S/JavaScript/JS (\importAnFDFTemplate)}%
\fi\fi
- \immediate\openout \js@verbatim@out \js@Path\dljsBase.djs
- \expandafter\fdfAfterheader\expandafter{\x}%
- \js@verbatimwrite
+ \fi\fi
+ \immediate\openout \js@verbatim@out \js@Path\dljsBase.djs
+ \expandafter\fdfAfterheader\expandafter{\x}%
+ \js@verbatimwrite
}{%
- \fdfendstreamobj
- \endjs@verbatimwrite
- \fdftrailer
+ \fdfendstreamobj
+ \endjs@verbatimwrite
+ \fdftrailer
% \end{macrocode}
% Added \cs{restoreDLspecialsDefs} to restore \cs{DLspecialDefs} to its default of \cs{@empty}.
% \changes{v2.4.4}{2019/07/14}{Added \string\cs{restoreDLspecialsDefs}}
% \begin{macrocode}
- \iwvo{\string\restoreDLspecialDefs}%
- \closejs@verbatim@out
- \expandafter\xdef\csname\dljsBase OBJ\endcsname{\the\dljsobjtoks}%
- \edef\@dljstmp{\noexpand\AtBeginDocument{%
- \noexpand\input{\js@Path\dljsBase.djs}}}\@dljstmp
+ \iwvo{\string\restoreDLspecialDefs}%
+ \closejs@verbatim@out
+ \expandafter\xdef\csname\dljsBase OBJ\endcsname{\the\dljsobjtoks}%
+ \edef\@dljstmp{\noexpand\AtBeginDocument{%
+ \noexpand\input{\js@Path\dljsBase.djs}}}\@dljstmp
% \end{macrocode}
%\changes{v2.2g}{2016/05/11}{Removed \string\cs{AtBeginDocument} code
%from the \string\texttt{execJS} environment. This causes problems with
@@ -1825,7 +1878,7 @@
% 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}
+% \begin{defineJS}[\makeesc\!]{\myCode}
% var p1=!p(1), p2=!p(2);
% app.alert("p1 + p2 = " + Number(p1+p2) );
% \end{defineJS}
@@ -1882,58 +1935,61 @@
\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 the 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}
% \DescribeMacro{\dlcombine}\hskip-\marginparsep\texttt{(\#1)(\#2)}
-% Within the \env{defineJS} environment, spaces are obeyed, at time, we want to says
-% \verb*|@currQuiz MyField|, for example. which within \env{defineJS} gets expanded to
+% (In this discussion, it is assumed `\texttt{@}' is the escape character
+% within \env{defineJS}.)
+% Within the \env{defineJS} environment, spaces are obeyed; at times, we want to say
+% \verb*|@currQuiz MyField|, for example, which within \env{defineJS} gets expanded to
% \verb*|q1 MyField|, not \texttt{q1MyField} as it should be. To solve this and other
% problems like it, use \verb|@dlcombine(@currQuiz)(MyField)| which does expand
-% to the intended expression. (In this discussion, it is assumed \texttt{@} is the escape character
-% within \env{defineJS}.)
+% to the intended expression.
% \changes{v2.4.3}{2019/06/27}{Added \string\cs{dlcombine}}
% \begin{macrocode}
\def\dlcombine(#1)(#2){#1#2}
% \end{macrocode}
+% \DescribeMacro{\dlcontig}\hskip-\marginparsep\texttt{(\#1)} Perhaps a better method than
+% just described (\cs{dlcombine}) is to have a single argument delimited by parentheses.
+% Thus \verb|@currQuiz@dlcontig(MyField)| also produces \texttt{q1MyField}.
+% \begin{macrocode}
+\def\dlcontig(#1){#1}
+% \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
+% that character may be needed in the code; for example if we declare |\makeesc\!|, and
+% within the JavaScript code we have \texttt{if (x != 0 )...}, 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}:
+% which in turn defines \DescribeMacro\Eschr\cs{Eschr} to expand to `\texttt!'. The above code
+% may then be written as \texttt{if (x !Eschr= 0 )...}; messy, but it works. The lines
+% below are 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.
+% These declarations make everything local to the group within which the button is built.
% \begin{macrocode}
\def\escIs#1{\def\Eschr{#1}}
% \end{macrocode}
% \DescribeMacro\makeesc\hskip-\marginparsep\texttt{\cs{\ameta{char}}}
% \cs{dl@makeesc} is a helper command that sets the escape character,
-% Within the \env{defineJS} environments, it is \cs{let} to \DescribeMacro\makeesc\cs{makeesc};
-% eg, |\makeesc\@|
+% Within the \env{defineJS} environments, it is \cs{let} to \cs{makeesc};
+% eg, |\makeesc\!|.
% \changes{v2.4.3}{2019/06/27}{Added \string\cs{dl@makeesc}}
% \begin{macrocode}
\def\dl@makeesc#1{\catcode`#1=0\relax}
% \end{macrocode}
-% \leavevmode\DescribeMacro\dlgobToFi Used to format \env{defineJS} content
-% when a conditional leaves an empty space; for example,
+% \DescribeMacro\makecmt\hskip-\marginparsep\texttt{\cs{\ameta{char}}} Likewise,
+% you can conviently declare the comment character, if any; eg, |\makecmt\%|.
+% \changes{v2.4.10}{2020/11/28}{Added \string\cs{dl@makecmt}}
+% \begin{macrocode}
+\def\dl@makecmt#1{\catcode`#1=14\relax}
+% \end{macrocode}
+% \paragraph*{Incorporating {\LaTeX} conditionals in \env{defineJS}.} {\LaTeX} conditionals
+% need to be handled carefull so as not to produce any specious spaces. Normally, there is
+% a comment character declared (|\makecmt\%|). Use the comment character to suppress the beginning
+% of a new line until it is known whether there is content on that next line. Eg,
%\begin{verbatim}
-%\begin{defineJS}[%
-% \makeesc\*\catcode`\%=14\relax]{\X}
-%var w=1;
-%*ifx*Y*@empty*dlgobToFi*else%
+%\begin{defineJS}[\makeesc\*\makecmt\%]{\X}
+%var w=1;%
+%*ifx*Y*@empty*else
%var x=1;
%var y=1;*fi
%var z=1;
@@ -1951,59 +2007,97 @@
%var y=1;
%var z=1;
%\end{verbatim}
+% The following two commands are no longer used by this package.
% \changes{v2.4.8}{2019/10/30}{Added \string\cs{dlgobToFi} to help format
% \string\env{defineJS} code}
% \begin{macrocode}
-\def\dlgobToFi#1\fi{\defjsLB}
+\def\dlgobToFi#1\fi{\fi\defjsLB}
+\let\gobiv\@gobblefour
% \end{macrocode}
-% Finally, we get to the definition of \env{defineJS}, and its compatriates.
+% \textbf{Typesetting content with the \cs{typeset} keyword macro.}
+% To aid typesetting the contents of a \env{defineJS} environment,
+% the keyword macro \DescribeMacro{\typeset}\cs{typeset}, which is defined only within the environment,
+% can be used. Pass \cs{typeset} to \env{defineJS} through the optional argument.
+% \changes{v2.5}{2020/12/20}{Added the command \string\cs{typeset} to typeset the
+% contents of the \string\env{defineJS} environment}
% \begin{macrocode}
-\newenvironment{defineJS}[2][]{%
- \let\makeesc\dl@makeesc
- \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
+\newif\ifdlfortypeset \dlfortypesetfalse
+% \end{macrocode}
+% The macro \cs{dl@typesetthis} defined here, is the external version of the local command
+% \cs{typeset}. It globally sets the switch \cs{ifdlfortypeset} to true and defines the value
+% of \cs{dfnJSR} and the legacy command \cs{defineJSjsR}. For \cs{dfnJSCR}, we use only {\TeX}
+% primitives to maintain compatibilty with the now defunct YandY System, which I still use.
+% \begin{macrocode}
+\def\dl@typesetthis{\global\dlfortypesettrue
+ \dfnJSCR{\hfil\break\null}}
+% \end{macrocode}
+% Next, we define some components common to all define-js environments. First, we initialize
+% the environment with several \cs{let}s.
+% \begin{macrocode}
+\def\@initdfnJS{\let\jsFrstLne\dl@One\let\makeesc\dl@makeesc
+ \let\makecmt\dl@makecmt\let\typeset\dl@typesetthis}
+% \end{macrocode}
+% (2020/12/20) Insert \cs{defineJSJsR} (an alias of \cs{dfnJSR}) at the \emph{beginning} of the second line
+% onward. This gives better formatting of the code within the editor, without
+% an empty final line.
+% \changes{v2.5}{2020/12/20}{Modified \string\cs{verbatim@line} in \string\env{defineJS}}
+% \begin{macrocode}
+\def\@vrbsetupdfnJS{\def\verbatim@processline{\ifx\jsFrstLne\dl@One
+ \let\jsFrstLne\dl@Zero
+ \xdef\JS@temp{\the\JStoks\the\verbatim@line}\else
+ \xdef\JS@temp{\the\JStoks\defineJSjsR\the\verbatim@line}\fi
+ \global\JStoks=\expandafter{\JS@temp}}%
+ \let\do\@makeother\dospecials\catcode`\^^M\active}
+% \end{macrocode}
+% We \cs{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). Start the verbatim environment.
+% \begin{macrocode}
+\def\b@vrbdfnJS#1{\global\let\space\pdfSP\makeatletter\obeyspaces%
+% \end{macrocode}
+% Pass the first argument here. If this environment is for typesetting,
+% initialize the tokens \cs{JStoks} to be in a group, and such. The insertion
+% of \cs{dl@paramlocal} is to support the \cs{bParams}/\allowbreak\cs{eParams} construct.
+% \begin{macrocode}
+ #1\ifdlfortypeset\global\JStoks={\bgroup\leavevmode\dl@paramlocal}\fi%
+ \verbatim@start}
% \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).
+% The end of the environment code
% \begin{macrocode}
- \global\let\space\pdfSP\makeatletter\obeyspaces
- #1%
- \verbatim@start
-}{\gdef\eq@JStemp{\expandafter\edef\defineJSArg{\the\JStoks}}%
- \global\let\space\dl@sp@ce\aftergroup\eq@JStemp}
+\def\e@vrbdfnJS{\gdef\eq@JStemp{\ifdlfortypeset\global
+ \JStoks=\expandafter{\the\JStoks\egroup}\fi\expandafter
+ \edef\defineJSArg{\the\JStoks}\global
+ \dlfortypesetfalse}\global\let\space\dl@sp@ce\aftergroup\eq@JStemp}
+% \end{macrocode}
+% Finally, we get to the definition of \env{defineJS}, and its compatriates.
+% \begin{macrocode}
+\newenvironment{defineJS}[2][]{\@initdfnJS
+ \expandafter\@ifundefined\expandafter{%
+ \expandafter\@gobble\string#2}{}{\PackageWarning{insdljs}
+ {The command \string#2 already defined}}%
+ \gdef\defineJSArg{#2}\global\JStoks={}%
+ \@vrbsetupdfnJS
+ \b@vrbdfnJS{#1}}{\e@vrbdfnJS}
% \end{macrocode}
% \end{environment}
% \begin{environment}{@defineJS}
% Silent version of \texttt{defineJS}, can repeatedly be used to redefine the same
-% macro.
+% macro. Note: |\makeesc\@| cannot be declared with the \env{@defineJS} environment.
% \begin{macrocode}
-\newenvironment{@defineJS}[2][]
-{%
- \let\makeesc\dl@makeesc
- \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}}%
- \global\let\space\dl@sp@ce\aftergroup\eq@JStemp}
+\newenvironment{@defineJS}[2][]{\@initdfnJS
+ \gdef\defineJSArg{#2}\global\JStoks={}%
+ \@vrbsetupdfnJS
+ \b@vrbdfnJS{#1}}{\e@vrbdfnJS}
% \end{macrocode}
% \end{environment}
% \begin{environment}{defineJS*}
-% We declare a public version of \env{@defineJS}
+% A silent public version of \env{defineJS}.
+% The \env{defineJS*} environment cannot use |\makeesc\*| in its optional argument.
% \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}
+\newenvironment{defineJS*}[2][]{\@initdfnJS
+ \gdef\defineJSArg{#2}\global\JStoks={}%
+ \@vrbsetupdfnJS
+ \b@vrbdfnJS{#1}}{\e@vrbdfnJS}
% \end{macrocode}
% \end{environment}
% An author might want these definitions to be local in definition, so the
@@ -2050,33 +2144,33 @@
{\end@defineJS}
\let\did@Print\@empty
\def\dljs@willDidActions{/AA <<
- \ifx\test@will@Close\@empty\else/WC <<
- \JS{\will@Close} >>\fi
- \ifx\test@will@Save\@empty\else/WS <<
- \JS{\will@Save} >>\fi
- \ifx\test@did@Save\@empty\else/DS <<
- \JS{\did@Save} >>\fi
- \ifx\test@will@Print\@empty\else/WP <<
- \JS{\will@Print} >>\fi
- \ifx\test@did@Print\@empty\else/DP <<
- \JS{\did@Print} >>\fi
- >>
+ \ifx\test@will@Close\@empty\else/WC <<
+ \JS{\will@Close} >>\fi
+ \ifx\test@will@Save\@empty\else/WS <<
+ \JS{\will@Save} >>\fi
+ \ifx\test@did@Save\@empty\else/DS <<
+ \JS{\did@Save} >>\fi
+ \ifx\test@will@Print\@empty\else/WP <<
+ \JS{\will@Print} >>\fi
+ \ifx\test@did@Print\@empty\else/DP <<
+ \JS{\did@Print} >>\fi
+ >>
}
\newcommand\dljs@setDocActions{%
- \edef\test@will@Close{\will@Close}%
- \edef\test@will@Save{\will@Save}%
- \edef\test@did@Save{\did@Save}%
- \edef\test@will@Print{\will@Print}%
- \edef\test@did@Print{\did@Print}%
+ \edef\test@will@Close{\will@Close}%
+ \edef\test@will@Save{\will@Save}%
+ \edef\test@did@Save{\did@Save}%
+ \edef\test@will@Print{\will@Print}%
+ \edef\test@did@Print{\did@Print}%
% \end{macrocode}
% Driver dependent code to put any document actions into the additional actions
% dictionary of the document catalog.
% \begin{macrocode}
- \ifpdf\pdfcatalog{\dljs@willDidActions}\else
- \ifxetex\immediate
- \@pdfm@mark{put @catalog <<\dljs@willDidActions>>}\else
- \literalps@out{\AEB@psMrk
- {Catalog} <<\dljs@willDidActions>> /PUT pdfmark}\fi\fi
+ \ifpdf\pdfcatalog{\dljs@willDidActions}\else
+ \ifxetex\immediate
+ \@pdfm@mark{put @catalog <<\dljs@willDidActions>>}\else
+ \literalps@out{\AEB@psMrk
+ {Catalog} <<\dljs@willDidActions>> /PUT pdfmark}\fi\fi
}
\@ifpackageloaded{aeb_pro}{}
{\AtBeginDocument{\dljs@setDocActions}}
@@ -2107,7 +2201,7 @@
\iwvo{\string\isdljstrue}
\iwvo{\string\makeatletter}
\iwvo{\string\immediate\string\openout\string
- \js@verbatim@out=\string\js@Path\space\dljsBase.fdf}%
+ \js@verbatim@out=\string\js@Path\space\dljsBase.fdf}%
\iwvo{\string\begin{jsexpverbatimwrite}}
\iwvo{\string\firstFDFline}
\iwvo{1 0 obj}
@@ -2115,7 +2209,7 @@
\iwvo{endobj}
\iwvo{2 0 obj}
\iwvo{[ \string\csname\string\@gobble\space\dljsBase%
- OBJ\string\endcsname]}
+ OBJ\string\endcsname]}
\iwvo{endobj}
}
\def\fdfbeginstreamobj
@@ -2130,10 +2224,9 @@
%\changes{v2.0k}{2012/06/21}{If the user has not passed the optional
% name, we generated one for him, now we insert it into the \texttt{stream}.}
% \begin{macrocode}
- \ifx\insdljsloadVar\@empty\else
- \iwvo{\insdljsloadVar}
- \global\let\insdljsloadVar\@empty
- \fi
+ \ifx\insdljsloadVar\@empty\else
+ \iwvo{\insdljsloadVar}
+ \global\let\insdljsloadVar\@empty\fi
}
\def\fdfendstreamobj{%
\iwvo{endstream}
@@ -2174,20 +2267,18 @@ if(typeof \detectdljs\space == "undefined")\jsR\jsT
% through a trusted function.
%}
% \begin{macrocode}
- ( app.viewerVersion > 8 ) ? %
- aebTrustedFunctions( this, aebImportAnFDF, %
- "\js@Path\dljsBase.fdf") : %
- this.importAnFDF("\js@Path\dljsBase.fdf");\jsR
+ ( app.viewerVersion > 8 ) ? %
+ aebTrustedFunctions( this, aebImportAnFDF, %
+ "\js@Path\dljsBase.fdf") : %
+ this.importAnFDF("\js@Path\dljsBase.fdf");\jsR
}
% \end{macrocode}
% Add in another template into \cmd{\importfdftoks}.
% \begin{macrocode}
\def\addImportAnFDF#1{%
- \ifx\importdljs\dl@YES
-% \let\jsR\relax\let\jsT\relax
- \edef\importAnFDFtmp{\the\importfdftoks#1}%
- \global\importfdftoks=\expandafter{\importAnFDFtmp}%
- \fi
+ \ifx\importdljs\dl@YES
+ \edef\importAnFDFtmp{\the\importfdftoks#1}%
+ \global\importfdftoks=\expandafter{\importAnFDFtmp}\fi
}
% \end{macrocode}
% This is used by \texttt{insert@DLJS@pdfmark} and is placed
@@ -2201,47 +2292,47 @@ if(typeof \detectdljs\space == "undefined")\jsR\jsT
% authorized way.
% \begin{macrocode}
\newenvironment{newsegment@pdfmark}[1]{%
- \addtocounter{dljssegs}{1}%
- \addtocounter{dljs@cnt}{1}%
- \Hy@unicodefalse\pdfstringdef{\dljsName}{#1}%
- \edef\@dljstmp{\the\dljsobjtoks(\dljsName)
- \thedljssegs\space 0 R\space}
- \global\dljsobjtoks=\expandafter{\@dljstmp}
- \fdfbeginstreamobj
- \js@verbatimwrite
+ \addtocounter{dljssegs}{1}\addtocounter{dljs@cnt}{1}%
+ \Hy@unicodefalse\pdfstringdef{\dljsName}{#1}%
+ \edef\@dljstmp{\the\dljsobjtoks(\dljsName)
+ \thedljssegs\space 0 R\space}%
+ \global\dljsobjtoks=\expandafter{\@dljstmp}%
+ \fdfbeginstreamobj
+ \js@verbatimwrite
}{%
- \fdfendstreamobj
- \endjs@verbatimwrite
+ \fdfendstreamobj
+ \endjs@verbatimwrite
}
\def\insert@DLJS@pdfmark{%
- \global\let\dljspresent\dl@YES
- \expandafter\gdef\csname dljs\dljsBase\endcsname{}%
- \ifx\importdljs\dl@YES\ifx\dl@gopro\dl@YES
- \addImportAnFDF\importAnFDFTemplate
- \fi\fi
- \immediate\openout \js@verbatim@out \js@Path\dljsBase.djs
- \fdfheader
- \ifx\multisegments\dl@NO\expandafter
- \newsegment\expandafter{\expandafter\dljsName\expandafter}\fi
+ \global\let\dljspresent\dl@YES
+ \expandafter\gdef\csname dljs\dljsBase\endcsname{}%
+ \ifx\importdljs\dl@YES\ifx\dl@gopro\dl@YES
+ \addImportAnFDF\importAnFDFTemplate\fi\fi
+ \immediate\openout \js@verbatim@out \js@Path\dljsBase.djs
+ \fdfheader
+ \ifx\multisegments\dl@NO\expandafter
+ \newsegment\expandafter{\expandafter\dljsName\expandafter}\fi
}
\def\endinsert@DLJS@pdfmark{%
- \ifx\importdljs\dl@YES
- \ifx\multisegments\dl@NO\expandafter\endnewsegment\fi
- \fdftrailer
- \closejs@verbatim@out
- \expandafter\xdef\csname\dljsBase%
- OBJ\endcsname{\the\dljsobjtoks}%
- \edef\@dljstmp{\noexpand\AtBeginDocument{%
- \noexpand\input{\js@Path\dljsBase.djs}}}%
- \@dljstmp
- \ifx\firstdljs\dl@YES
- \AtBeginDocument{\edef\@dljstmp{\importAnFDF}%
- \@dljstmp}\global\let\firstdljs\dl@NO
- \fi
+ \ifx\importdljs\dl@YES
+ \ifx\multisegments\dl@NO\expandafter\endnewsegment\fi
+ \fdftrailer
+ \closejs@verbatim@out
+ \expandafter\xdef\csname\dljsBase%
+ OBJ\endcsname{\the\dljsobjtoks}%
+ \edef\@dljstmp{\noexpand\AtBeginDocument{%
+ \noexpand\input{\js@Path\dljsBase.djs}}}%
+ \@dljstmp
+ \ifx\firstdljs\dl@YES
+ \AtBeginDocument{\edef\@dljstmp{\importAnFDF}%
+ \@dljstmp}\global\let\firstdljs\dl@NO
\fi
+ \fi
}
% \end{macrocode}
+%
% \subsection{For \texttt{pdftex}/\texttt{dvipdfm}}
+%
% Again, we break the problem of creating DLJS into four parts: \cmd{\begindljs},
% \cmd{\enddljs}, the code itself, driver dependent material, \cmd{\write@pdftex@obj}
% and \cmd{\write@dvipdfm@obj}.
@@ -2358,9 +2449,8 @@ if(typeof \detectdljs\space == "undefined")\jsR\jsT
% of the PDF document. This code is inserted into the document in \texttt{insert@DLJS@pdftex}
% using \cmd{\AtEndDocument}.
% \begin{macrocode}
-\def\setDLJSRef@pdftex
-{%
- \noexpand\immediate\noexpand\pdfobj {%
+\def\setDLJSRef@pdftex{\noexpand
+ \immediate\noexpand\pdfobj {%
<< /Names [\the\importfdftoks] >> }%
\edef\noexpand\objNames{\noexpand\the\noexpand\pdflastobj\space 0 R}%
\pdfnames {/JavaScript \noexpand\objNames}%
@@ -2371,8 +2461,7 @@ if(typeof \detectdljs\space == "undefined")\jsR\jsT
% \begin{macrocode}
\newenvironment{newsegment@dvipdfm}[1]
{%
- \addtocounter{dljssegs}{1}%
- \addtocounter{dljs@cnt}{1}%
+ \addtocounter{dljssegs}{1}\addtocounter{dljs@cnt}{1}%
\edef\tmp{^^J\string\immediate\string
\csname\space @pdfm@mark\string\endcsname
{obj @obj\dljsBase\roman{dljssegs}\space << /S/JavaScript%
diff --git a/texmf-dist/source/latex/acrotex/web.dtx b/texmf-dist/source/latex/acrotex/web.dtx
index 473c39cc..0704cade 100644
--- a/texmf-dist/source/latex/acrotex/web.dtx
+++ b/texmf-dist/source/latex/acrotex/web.dtx
@@ -25,8 +25,19 @@
%<*driver>
\documentclass{ltxdoc}
\usepackage[colorlinks,hyperindex=false]{hyperref}
-%\def\texorpdfstring#1#2{#1}
-%\pdfstringdefDisableCommands{\let\\\textbackslash}
+\usepackage{fancyvrb}
+\gdef\darg#1{\texttt{\char123\relax#1\char125\relax}}
+\def\CMD#1{\textbackslash#1}
+\let\pkg\textsf
+\let\opt\texttt
+\let\env\texttt
+\let\app\textsf
+\let\uif\textsf
+\def\nmpsep#1{\hskip-\marginparsep\texttt{#1}}
+\def\visispace{\symbol{32}}
+\def\ameta#1{\ensuremath{\langle\textit{\texttt{#1}}\rangle}}
+\def\meta#1{\textsl{\texttt{#1}}}
+\def\SUB#1{\ensuremath{{}_{\mbox{\scriptsize\ttfamily#1}}}}
\OnlyDescription % comment out for implementation details
\EnableCrossrefs
\CodelineIndex
@@ -35,9 +46,6 @@
{\def\IndexOpt{\DescribeMacro}\def\IndexKey{\DescribeMacro}\let\setupFullwidth\relax
\PackageInfo{web}{aebdocfmt.def cannot be found}}
\begin{document}
-\def\CMD#1{\textbackslash#1}
-\let\pkg\textsf
-\let\opt\texttt
\addtolength{\marginparwidth}{3pt}
\GetFileInfo{web.sty}
\title{Web: A Screen Design Package}
@@ -85,8 +93,8 @@
% \subsection{Drivers Supported}
% \begin{macrocode}
\IfFileExists{xcolor.sty}{%
- \def\eq@ColorPackage{xcolor}%
- \PassOptionsToPackage{xcolor}{table,hyperref}%
+ \def\eq@ColorPackage{xcolor}%
+ \PassOptionsToPackage{xcolor}{table,hyperref}%
}{\def\eq@ColorPackage{color}}
% \end{macrocode}
% Force package to use \textsf{color}.\IndexOpt{noxcolor}
@@ -106,20 +114,21 @@
\let\i@web@ddtoHyOpts\@empty
\let\eq@driver@name\@empty
\let\web@YES=y \let\web@NO=n
+\let\web@One=1 \let\web@Zero=0
% \end{macrocode}
-% \textsf{dvipsone}\IndexOpt{dvipsone}\space is the dvi-to-ps driver of the YandY system that I still
+% \leavevmode\IndexOpt{dvipsone}\textsf{dvipsone} is the dvi-to-ps driver of the YandY system that I still
% use, I hate to give it up. Even I have not used the \IndexOpt{dviwindo}\texttt{dviwindo} option
% for many years, and is obsolete.
% \begin{macrocode}
\DeclareOptionX{dvipsone}{%
- \def\eq@drivernum{0}\def\eq@driver@name{dvipsone}%
+ \def\eq@drivernum{0}\def\eq@driver@name{dvipsone}%
% \end{macrocode}
% Below is the original definition of \cs{web@set@paper}, this has now
% changed with \texttt{v4.2j} to accommodate \cs{addtoWebHeight} and
% \cs{addtoWebWidth}.
%\begin{verbatim}
-% \def\web@set@paper{%
-% \special{papersize=\the\paperwidth,\the\paperheight}}%
+% \def\web@set@paper{%
+% \special{papersize=\the\paperwidth,\the\paperheight}}%
%\end{verbatim}
% \changes{v4.2j}{2012/05/11}{In support of \string\cs{addtoWebHeight}, we introduce
% the pagesize special at the beginning of the document. Changes are in the
@@ -127,48 +136,45 @@
% The revised definition of \cs{web@set@paper}, we now set the papersize
% at the beginning of the document.
% \begin{macrocode}
- \let\web@set@paper\@empty
- \@namedef{papersize@for@\eq@driver@name}{\AtBeginDocument{%
- \special{papersize=\the\paperwidth,\the\paperheight}}}%
+ \let\web@set@paper\@empty
+ \@namedef{papersize@for@\eq@driver@name}{\AtBeginDocument
+ {\special{papersize=\the\paperwidth,\the\paperheight}}}%
}
\DeclareOptionX{dviwindo}{%
- \def\eq@drivernum{4}\def\eq@driver@name{dviwindo}%
- \@namedef{papersize@for@\eq@driver@name}{\def\web@set@paper{%
- \special{papersize=\the\paperwidth,\the\paperheight}}}%
+ \def\eq@drivernum{4}\def\eq@driver@name{dviwindo}%
+ \@namedef{papersize@for@\eq@driver@name}{\def\web@set@paper
+ {\special{papersize=\the\paperwidth,\the\paperheight}}}%
}
% \end{macrocode}
% Various extensions of \textsf{dvipdfm}, the dvi-to-pdf driver.\IndexOpt{dvipdfm}\IndexOpt{dvipdfmx}\IndexOpt{xetex}
% \begin{macrocode}
\DeclareOptionX{dvipdfm}{%
- \def\eq@drivernum{2}\def\eq@driver@name{dvipdfm}%
- \web@opts@xdvipdfmx
+ \def\eq@drivernum{2}\def\eq@driver@name{dvipdfm}\web@opts@xdvipdfmx
}
% \end{macrocode}
%\changes{v4.3}{2012/06/20}{Added \string\texttt{dvipdfmx} and \string\texttt{xetex} options}
% \begin{macrocode}
\DeclareOptionX{dvipdfmx}{%
- \def\eq@drivernum{2}\def\eq@driver@name{dvipdfmx}%
- \web@opts@xdvipdfmx
+ \def\eq@drivernum{2}\def\eq@driver@name{dvipdfmx}\web@opts@xdvipdfmx
}
% \end{macrocode}
% \begin{macrocode}
\DeclareOptionX{xetex}{%
- \def\eq@drivernum{2}\def\eq@driver@name{xetex}%
- \web@opts@xdvipdfmx
+ \def\eq@drivernum{2}\def\eq@driver@name{xetex}\web@opts@xdvipdfmx
}
% \end{macrocode}
% \begin{macrocode}
\newcommand{\web@opts@xdvipdfmx}{%
- \@namedef{papersize@for@\eq@driver@name}%
- {\def\web@set@paper{\AtBeginDvi{%
- \special{papersize=\the\paperwidth,\the\paperheight}}}}%
+ \@namedef{papersize@for@\eq@driver@name}%
+ {\def\web@set@paper{\AtBeginDvi
+ {\special{papersize=\the\paperwidth,\the\paperheight}}}}%
}
% \end{macrocode}
% \texttt{dvips}\IndexOpt{dvips} is the dvi-to-ps driver.
% \begin{macrocode}
\DeclareOptionX{dvips}{%
- \def\eq@drivernum{0}\def\eq@driver@name{dvips}%
- \def\i@web@ddtoHyOpts{setpagesize=false}%
+ \def\eq@drivernum{0}\def\eq@driver@name{dvips}%
+ \def\i@web@ddtoHyOpts{setpagesize=false}%
% \end{macrocode}
% The old definition of \cs{web@set@paper}
%\begin{verbatim}
@@ -177,9 +183,9 @@
%\end{verbatim}
% New definitions (\texttt{v4.2j}). See comments for the \texttt{dvipsone} option.
% \begin{macrocode}
- \let\web@set@paper\@empty
- \@namedef{papersize@for@\eq@driver@name}{\AtBeginDocument{%
- \special{papersize=\the\paperwidth,\the\paperheight}}}%
+ \let\web@set@paper\@empty
+ \@namedef{papersize@for@\eq@driver@name}{\AtBeginDocument
+ {\special{papersize=\the\paperwidth,\the\paperheight}}}%
}
% \end{macrocode}
% \texttt{pdftex}\IndexOpt{pdftex} is for users of \textsf{pdflatex}.
@@ -201,19 +207,17 @@
% The `\texttt{textures}\IndexOpt{textures}' option was contributed by Ross Moore. {(2003/3/6)}
% \begin{macrocode}
\DeclareOptionX{textures}{%
- \def\eq@drivernum{3}\def\eq@driver@name{textures}%
- \@namedef{papersize@for@\eq@driver@name}%
- {\def\web@set@paper{\bgroup
- \dimen2=\origpaperheight \advance\dimen2 by -\topmargin
- \dimen0\dimen2 \advance\dimen0-\paperheight
- \xdef\@pdfpagescrop{0 \strip@pt\dimen0 \space
- \strip@pt\paperwidth\space \strip@pt\dimen2}%
- \egroup}%
- \AtEndOfPackage{%
- \edef\origpaperwidth{\the\paperwidth}%
- \edef\origpaperheight{\the\paperheight}%
- }%
- }%
+ \def\eq@drivernum{3}\def\eq@driver@name{textures}%
+ \@namedef{papersize@for@\eq@driver@name}%
+ {\def\web@set@paper{\bgroup
+ \dimen2=\origpaperheight \advance\dimen2 by -\topmargin
+ \dimen0\dimen2 \advance\dimen0-\paperheight
+ \xdef\@pdfpagescrop{0 \strip@pt\dimen0 \space
+ \strip@pt\paperwidth\space \strip@pt\dimen2}%
+ \egroup}\AtEndOfPackage
+ {\edef\origpaperwidth{\the\paperwidth}%
+ \edef\origpaperheight{\the\paperheight}}%
+ }%
}
% \end{macrocode}
%\subsection{Paper Option}
@@ -240,15 +244,15 @@
% \IndexOpt{nobullets}^^A
% \begin{macrocode}
\DeclareOptionX{latexlayout}{%
- \let\web@layout\web@NO\ExecuteOptionsX{forcolorpaper}}
+ \let\web@layout\web@NO\ExecuteOptionsX{forcolorpaper}}
\DeclareOptionX{uselatexsectioning}{%
- \web@sectioningfalse
+ \web@sectioningfalse
}
\newif\ifweb@sectioning \web@sectioningtrue
\DeclareOptionX{weblikeclass}{%
- \ExecuteOptionsX{latexlayout}%
- \ExecuteOptionsX{nobullets}%
- \ExecuteOptionsX{uselatexsectioning}%
+ \ExecuteOptionsX{latexlayout}%
+ \ExecuteOptionsX{nobullets}%
+ \ExecuteOptionsX{uselatexsectioning}%
}
\DeclareOptionX{nodirectory}{\let\web@directory@option\web@NO}
\DeclareOptionX{usedirectory}{\let\web@directory@option\web@YES}
@@ -266,48 +270,46 @@
% of parameters).
% \begin{macrocode}
\def\web@MargScrDimOpts#1#2#3#4#5#6{%
- \margins{#1}{#2}{#3}{#4} % left,right,top, bottom
- \screensize{#5}{#6} % height, width
+ \margins{#1}{#2}{#3}{#4} % left,right,top, bottom
+ \screensize{#5}{#6} % height, width
% \end{macrocode}
% We save the current settings, then change \cs{margins} and \cs{screensize}
% to gobble their arguments up if used again.
% \begin{macrocode}
-% \let\margins@web@save\margins
-% \let\screensize@web@save\screensize
- \let\margins\@@margins\let\screensize\@gobbletwo
+ \let\margins\@@margins\let\screensize\@gobbletwo
}
% \end{macrocode}
% The original design concept for various dimensions.\IndexOpt{designi...designvix}
% \begin{macrocode}
\DeclareOptionX{designi}{\AtEndOfPackage{%
- \web@MargScrDimOpts{.25in}{.25in}{24pt}{.25in}{3.736in}{4.67in}}}
+ \web@MargScrDimOpts{.25in}{.25in}{24pt}{.25in}{3.736in}{4.67in}}}
\DeclareOptionX{designii}{\AtEndOfPackage{%
- \web@MargScrDimOpts{.25in}{.25in}{24pt}{.25in}{4.5in}{5in}}}
+ \web@MargScrDimOpts{.25in}{.25in}{24pt}{.25in}{4.5in}{5in}}}
\DeclareOptionX{designiii}{\AtEndOfPackage{%
- \web@MargScrDimOpts{.25in}{.25in}{24pt}{.25in}{5in}{6in}}}
+ \web@MargScrDimOpts{.25in}{.25in}{24pt}{.25in}{5in}{6in}}}
\DeclareOptionX{designiv}{\AtEndOfPackage{%
- \web@MargScrDimOpts{.25in}{.25in}{24pt}{.25in}{4in}{5in}}}
+ \web@MargScrDimOpts{.25in}{.25in}{24pt}{.25in}{4in}{5in}}}
\DeclareOptionX{designv}{\AtEndOfPackage{%
- \web@MargScrDimOpts{.25in}{.25in}{24pt}{.25in}{4.5in}{6in}}}
+ \web@MargScrDimOpts{.25in}{.25in}{24pt}{.25in}{4.5in}{6in}}}
\DeclareOptionX{designvi}{\AtEndOfPackage{%
- \web@MargScrDimOpts{.25in}{.25in}{24pt}{.25in}{4.17in}{4.67in}}}
+ \web@MargScrDimOpts{.25in}{.25in}{24pt}{.25in}{4.17in}{4.67in}}}
\DeclareOptionX{designvii}{\AtEndOfPackage{%
- \web@MargScrDimOpts{.5in}{.5in}{24pt}{.5in}{7.5in}{10in}}}
+ \web@MargScrDimOpts{.5in}{.5in}{24pt}{.5in}{7.5in}{10in}}}
\DeclareOptionX{designviii}{\AtEndOfPackage{%
- \web@MargScrDimOpts{.5in}{.5in}{24pt}{.5in}{3.75in}{6.67in}}}
+ \web@MargScrDimOpts{.5in}{.5in}{24pt}{.5in}{3.75in}{6.67in}}}
\DeclareOptionX{designix}{\AtEndOfPackage{%
- \web@MargScrDimOpts{.5in}{.5in}{24pt}{.5in}{3.75in}{6in}}}
+ \web@MargScrDimOpts{.5in}{.5in}{24pt}{.5in}{3.75in}{6in}}}
% \end{macrocode}
% The \texttt{usesf}\IndexOpt{usesf} option makes the default font sans serif.
% Popular for presentations.
% \begin{macrocode}
\DeclareOptionX{usesf}{%
- \def\aeb@defaultfamily{\sffamily}
- \def\itdefault{sl}
- \renewcommand{\familydefault}{\sfdefault}
- \selectfont
- \renewcommand\labelitemi{\textrm{\textbullet}}
- \AtEndOfPackage{\def\web@copyright@symbol{\textrm{\copyright}}}
+ \def\aeb@defaultfamily{\sffamily}
+ \def\itdefault{sl}
+ \renewcommand{\familydefault}{\sfdefault}
+ \selectfont
+ \renewcommand\labelitemi{\textrm{\textbullet}}
+ \AtEndOfPackage{\def\web@copyright@symbol{\textrm{\copyright}}}
}
\def\aeb@defaultfamily{\rmfamily}
% \end{macrocode}
@@ -339,19 +341,19 @@
% \changes{v6.0m}{2016/08/19}{Added \string\texttt{addtoHyOpts*} option}
% \begin{macrocode}
\define@choicekey+{webHyOpts}{pdfencoding}[\val\nr]%
- {auto,pdfdoc,unicode}[pdfdoc]{\edef\web@Hypdfencoding{\val}}
- {\PackageWarning{web}{Bad choice for pdfencoding,
- permissible values\MessageBreak
- are auto, pdfdoc, and unicode.\MessageBreak Try again}}
+ {auto,pdfdoc,unicode}[pdfdoc]{\edef\web@Hypdfencoding{\val}}
+ {\PackageWarning{web}{Bad choice for pdfencoding,
+ permissible values\MessageBreak
+ are auto, pdfdoc, and unicode.\MessageBreak Try again}}
\let\web@Hypdfencoding\@empty
\let\u@web@ddtoHyOpts\@empty
\let\u@web@ddtoHySetup\@empty
\def\web@addtoHyOpts#1{\g@addto@macro\u@web@ddtoHyOpts{#1}}
\def\web@addtoHySetup#1{\g@addto@macro\u@web@ddtoHySetup{#1}}
\define@key{web.sty}{addtoHyOpts}[]{%
- \setkeys*{webHyOpts}{#1}\web@addtoHyOpts{#1}}
+ \setkeys*{webHyOpts}{#1}\web@addtoHyOpts{#1}}
\define@key{web.sty}{addtoHyOpts*}[]{%
- \setkeys*{webHyOpts}{#1}\web@addtoHySetup{#1}}
+ \setkeys*{webHyOpts}{#1}\web@addtoHySetup{#1}}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -388,7 +390,6 @@
\let\webpro@loaded\web@NO
\def\loadwebpro{\InputIfFileExists{webpro.def}{}{}}
% \end{macrocode}
-%
% When you take the \texttt{draft}\IndexOpt{draft} option, graphic overlays are not allowed. This is useful
% when you rely heavily on graphic overlays, but during the development phase,
% don't need to read and re-read your overlays. The defined background colors
@@ -407,9 +408,9 @@
% \begin{macrocode}
\DeclareOptionX{usetemplates}{\def\@usetemplates{1}}
\DeclareOptionX{leftpanel}%
- {\def\@panelconfig{1}\def\@usetemplates{1}}
+ {\def\@panelconfig{1}\def\@usetemplates{1}}
\DeclareOptionX{rightpanel}%
- {\def\@panelconfig{2}\def\@usetemplates{1}}
+ {\def\@panelconfig{2}\def\@usetemplates{1}}
% \end{macrocode}
% Normally, the templates feature is removed
% when the \texttt{forpaper} or \texttt{forcolorpaper} open is used. There may be
@@ -418,24 +419,21 @@
% \begin{macrocode}
\newif\iftemplatesforpaper \templatesforpaperfalse
\DeclareOptionX{templatesforpaper}{\templatesforpapertrue
- \ExecuteOptionsX{forcolorpaper}}
+ \ExecuteOptionsX{forcolorpaper}}
% \end{macrocode}
% Here we come to a couple of options, \IndexOpt{rightpanelprt}\IndexOpt{leftpanelprt}
% \texttt{rightpanelprt} and \texttt{leftpanelprt}, I remember nothing about.
% apparently, these are \texttt{rightpanel} and \texttt{leftpanel} options for screen mode only.
% \begin{macrocode}
-\DeclareOptionX{rightpanelprt}{%
- \ifeqforpaper\else\ExecuteOptionsX{rightpanel}\fi
-}
-\DeclareOptionX{leftpanelprt}{%
- \ifeqforpaper\else\ExecuteOptionsX{leftpanel}\fi
-}
+\DeclareOptionX{rightpanelprt}{\ifeqforpaper\else
+ \ExecuteOptionsX{rightpanel}\fi}
+\DeclareOptionX{leftpanelprt}{\ifeqforpaper\else
+ \ExecuteOptionsX{leftpanel}\fi}
% \end{macrocode}
% \DescribeMacro{\templatedefaults} sets the defaults for the template code.
% \begin{macrocode}
\def\templatedefaults{\def\@panelsep{0pt}\def\@usetemplates{0}%
- \def\@panelconfig{0}\def\@textX{0}\def\@panelX{0}%
-}
+ \def\@panelconfig{0}\def\@textX{0}\def\@panelX{0}}
\templatedefaults
% \end{macrocode}
% \subsection{Miscellaneous Options}
@@ -462,10 +460,10 @@
% definitions are used.
% \begin{macrocode}
\DeclareOptionX{uselatexparts}{%
- \AtEndOfPackage{\@ifundefined{part}{}{\let\part\web@save@part}}}
+ \AtEndOfPackage{\@ifundefined{part}{}{\let\part\web@save@part}}}
\DeclareOptionX{uselatexchapters}{%
- \AtEndOfPackage{\@ifundefined{chapter}{}
- {\let\chapter\web@save@chapter}}}
+ \AtEndOfPackage{\@ifundefined{chapter}{}
+ {\let\chapter\web@save@chapter}}}
% \end{macrocode}
% \subsection{Language Options}
% The \texttt{french}\IndexOpt{french} option
@@ -515,8 +513,7 @@
% \end{macrocode}
% The \texttt{norsk}\IndexOpt{norsk} option
% \begin{macrocode}
-\DeclareOptionX{norsk}{%
- \AtEndOfPackage{%
+\DeclareOptionX{norsk}{\AtEndOfPackage{%
\def\today{\ifcase\month\or Januar
\or Februar \or Mars \or April
\or Mai \or Juni \or Juli \or August
@@ -537,68 +534,65 @@
% \end{macrocode}
% The \texttt{dutch}\IndexOpt{dutch} option
% \begin{macrocode}
-\DeclareOptionX{dutch}{%
- \AtEndOfPackage{%
+\DeclareOptionX{dutch}{\AtEndOfPackage{%
\def\today{\the\day~\ifcase\month\or januari
- \or februari \or maart \or april
- \or mei \or juni \or juli \or augustus
- \or september \or oktober \or november
- \or december \fi \space \the\year}
- \def\web@versionlabel{Versie}
- \def\web@toc{Inhoudsopgave}
- \def\web@continued{vervolg}
- \def\web@article{Begin \hyperlink{\web@Start.1}{Artikel}}
- \def\web@directory{Overzicht}
- \def\web@revision{Laatste wijziging:}
- \def\web@copyright{Copyright}
- \def\web@section{Sectie}
- \def\web@back{Terug}
- \def\web@doc{Doc}}
+ \or februari \or maart \or april
+ \or mei \or juni \or juli \or augustus
+ \or september \or oktober \or november
+ \or december \fi \space \the\year}
+ \def\web@versionlabel{Versie}
+ \def\web@toc{Inhoudsopgave}
+ \def\web@continued{vervolg}
+ \def\web@article{Begin \hyperlink{\web@Start.1}{Artikel}}
+ \def\web@directory{Overzicht}
+ \def\web@revision{Laatste wijziging:}
+ \def\web@copyright{Copyright}
+ \def\web@section{Sectie}
+ \def\web@back{Terug}
+ \def\web@doc{Doc}}
\PassOptionsToPackage{dutch}{exerquiz}
}
% \end{macrocode}
% The \texttt{spanish}\IndexOpt{spanish} option
% \begin{macrocode}
-\DeclareOptionX{spanish}{%
- \AtEndOfPackage{%
- \def\today{\the\day\ de \ifcase\month\or Enero
- \or Febrero \or Marzo \or Abril
- \or Mayo \or Junio \or Julio \or Agosto
- \or Septiembre \or Octubre \or Noviembre
- \or Deciembre \fi de \the\year}
- \renewcommand\web@versionlabel{Versi\noexpand\'{o}n}
- \renewcommand\web@toc{Tabla de Contenido}
- \renewcommand\web@continued{cont.}
- \renewcommand\web@article{Inicio
- \hyperlink{\web@Start.1}{Art\'{\i}culo}}
- \renewcommand\web@directory{Directorio}
- \renewcommand\web@revision{Actualizado el:}
- \renewcommand\web@copyright{Copyright}
- \renewcommand\web@section{Secci\'on}
- \renewcommand\web@back{Volver}
- \renewcommand\web@doc{Doc}}
+\DeclareOptionX{spanish}{\AtEndOfPackage{%
+ \def\today{\the\day\ de \ifcase\month\or Enero
+ \or Febrero \or Marzo \or Abril
+ \or Mayo \or Junio \or Julio \or Agosto
+ \or Septiembre \or Octubre \or Noviembre
+ \or Deciembre \fi de \the\year}
+ \renewcommand\web@versionlabel{Versi\noexpand\'{o}n}
+ \renewcommand\web@toc{Tabla de Contenido}
+ \renewcommand\web@continued{cont.}
+ \renewcommand\web@article{Inicio
+ \hyperlink{\web@Start.1}{Art\'{\i}culo}}
+ \renewcommand\web@directory{Directorio}
+ \renewcommand\web@revision{Actualizado el:}
+ \renewcommand\web@copyright{Copyright}
+ \renewcommand\web@section{Secci\'on}
+ \renewcommand\web@back{Volver}
+ \renewcommand\web@doc{Doc}}
\PassOptionsToPackage{spanish}{exerquiz}
}
% \end{macrocode}
% The \texttt{italian}\IndexOpt{italian} option
% \begin{macrocode}
-\DeclareOptionX{italian}{%
- \AtEndOfPackage{%
- \def\today{\ifcase\month\or Gennaio
- \or Febbraio \or Marzo \or Aprile
- \or Maggio \or Giugno \or Luglio \or Agosto
- \or Settembre \or Ottobre \or Novembre
- \or Dicembre \fi \the\day, \the\year}
- \renewcommand\web@versionlabel{Versione}
- \renewcommand\web@toc{Indice}
- \renewcommand\web@continued{cont.}
- \renewcommand\web@article{Inizio \hyperlink{\web@Start.1}{Articolo}}
- \renewcommand\web@directory{Directory}
- \renewcommand\web@revision{Data Ultima Revisione:}
- \renewcommand\web@copyright{Copyright}
- \renewcommand\web@section{Sezione}
- \renewcommand\web@back{Back}
- \renewcommand\web@doc{Doc}}
+\DeclareOptionX{italian}{\AtEndOfPackage{%
+ \def\today{\ifcase\month\or Gennaio
+ \or Febbraio \or Marzo \or Aprile
+ \or Maggio \or Giugno \or Luglio \or Agosto
+ \or Settembre \or Ottobre \or Novembre
+ \or Dicembre \fi \the\day, \the\year}
+ \renewcommand\web@versionlabel{Versione}
+ \renewcommand\web@toc{Indice}
+ \renewcommand\web@continued{cont.}
+ \renewcommand\web@article{Inizio \hyperlink{\web@Start.1}{Articolo}}
+ \renewcommand\web@directory{Directory}
+ \renewcommand\web@revision{Data Ultima Revisione:}
+ \renewcommand\web@copyright{Copyright}
+ \renewcommand\web@section{Sezione}
+ \renewcommand\web@back{Back}
+ \renewcommand\web@doc{Doc}}
\PassOptionsToPackage{italian}{exerquiz}
}
% \end{macrocode}
@@ -613,28 +607,27 @@
% \CYRN,\cyra,\cyrch,\cyra,\cyrl,\cyro,\CYRS,\CYRP,\CYRV,\CYRN,\CYRCH,
% \cyrp,\cyrz,\cyrz,\cyrzh,\CYRK,\cyrishrt,\cyrsftsn}
% \begin{macrocode}
-\DeclareOptionX{russian}{%
- \ExecuteOptionsX{unicode}%
+\DeclareOptionX{russian}{\ExecuteOptionsX{unicode}%
\AtEndOfPackage{%
\def\today{\the\day\ \ifcase\month
- \or \cyrya\cyrn\cyrv\cyra\cyrr\cyrya
- \or \cyrf\cyre\cyrv\cyrr\cyra\cyrl\cyrya
- \or \cyrm\cyra\cyrr\cyrt\cyra
- \or \cyra\cyrp\cyrr\cyre\cyrl\cyrya
- \or \cyrm\cyra\cyrya
- \or \cyri\cyryu\cyrn\cyrya
- \or \cyri\cyryu\cyrl\cyrya
- \or \cyra\cyrv\cyrg\cyru\cyrs\cyrt\cyra
- \or \cyrs\cyre\cyrn\cyrt\cyrya\cyrb\cyrr\cyrya
- \or \cyro\cyrk\cyrt\cyrya\cyrb\cyrr\cyrya
- \or \cyrn\cyro\cyrya\cyrb\cyrr\cyrya
- \or \cyrd\cyre\cyrk\cyrya\cyrb\cyrr\cyrya \fi{ }%
- \the\year\ \cyrg.}
+ \or \cyrya\cyrn\cyrv\cyra\cyrr\cyrya
+ \or \cyrf\cyre\cyrv\cyrr\cyra\cyrl\cyrya
+ \or \cyrm\cyra\cyrr\cyrt\cyra
+ \or \cyra\cyrp\cyrr\cyre\cyrl\cyrya
+ \or \cyrm\cyra\cyrya
+ \or \cyri\cyryu\cyrn\cyrya
+ \or \cyri\cyryu\cyrl\cyrya
+ \or \cyra\cyrv\cyrg\cyru\cyrs\cyrt\cyra
+ \or \cyrs\cyre\cyrn\cyrt\cyrya\cyrb\cyrr\cyrya
+ \or \cyro\cyrk\cyrt\cyrya\cyrb\cyrr\cyrya
+ \or \cyrn\cyro\cyrya\cyrb\cyrr\cyrya
+ \or \cyrd\cyre\cyrk\cyrya\cyrb\cyrr\cyrya \fi{ }%
+ \the\year\ \cyrg.}
\gdef\eq@protected##1##2{{\ifhmode ##2\else
- \ifvmode ##2\else\ifinner##2\else\noexpand ##1\fi\fi\fi}}%
+ \ifvmode ##2\else\ifinner##2\else\noexpand ##1\fi\fi\fi}}%
\def\cyrCommand##1##2{\def##1{\eq@protected##1{##2}}}%
\cyrCommand\web@toc{\CYRO\cyrg\cyrl\cyra\cyrv\cyrl\cyre\cyrn%
- \cyri\cyre}
+ \cyri\cyre}
\cyrCommand\web@continued{\cyrp\cyrr\cyro\cyrd\cyro\cyrl%
\cyrzh\cyre\cyrn\cyri\cyre}
\cyrCommand\web@article{\CYRN\cyra\cyrch\cyra\cyrl\cyro{ }%
@@ -645,8 +638,6 @@
\cyrCommand\web@revision{\CYRP\cyro\cyrs\cyrl\cyre\cyrd\cyrn%
\cyrya\cyrya{ }\cyrr\cyre\cyrv\cyri\cyrz\cyri\cyrya:}
\let\web@copyright\@gobble
-% \cyrCommand\web@copyright{%\CYRK\cyro\cyrp\cyri\cyrr\cyra%
-% \cyrishrt\cyrt}%In Russian publications only the symbol presents
\cyrCommand\web@versionlabel{\CYRV\cyre\cyrr\cyrs\cyri\cyrya}
\cyrCommand\web@back{\CYRN\cyra\cyrz\cyra\cyrd}
\cyrCommand\web@section{\CYRCH\cyra\cyrs\cyrt\cyrsftsn}}
@@ -655,8 +646,7 @@
% \end{macrocode}
% The \texttt{dansk}\IndexOpt{dansk} option
% \begin{macrocode}
-\DeclareOptionX{dansk}{%
- \AtEndOfPackage{%
+\DeclareOptionX{dansk}{\AtEndOfPackage{%
\def\today{\ifcase\month\or Januar
\or Februar \or Marts \or April
\or Maj \or Juni \or Juli \or August
@@ -678,33 +668,31 @@
% \end{macrocode}
% The \texttt{polish}\IndexOpt{polish} option
% \begin{macrocode}
-\DeclareOptionX{polish}{%
- \AtEndOfPackage{%
- \def\today{\ifcase\month\or {Stycze\'{n}}
- \or Luty \or Marzec \or {Kwiecie\'{n}}
- \or Maj \or Czerwiec \or Lipiec \or {\'{S}ierpie\'{n}}
- \or {Wrzesie\'{n}} \or {Pa\'{z}dziernik} \or Listopad
- \or {Grudzie\'{n}} \fi \the\day, \the\year}
- \renewcommand\web@versionlabel{Wersja}
- \renewcommand\web@toc{Spis Tre\'{s}ci}
- \renewcommand\web@continued{verte}
- \renewcommand\web@article{Pocz\k{a}tek do
- \hyperlink{\web@Start.1}{Tekstu}}
- \renewcommand\web@directory{Zawarto\'{s}\'{c}}
- \renewcommand\web@revision{Ostatnia zmiana:}
- \renewcommand\web@copyright{Copyright}
- \renewcommand\web@section{Cze\'{s}\'{c}}
- % Label Navibar
- \renewcommand\web@back{Wstecz}
- \renewcommand\web@doc{Dok}} % restricted to three characters
- \PassOptionsToPackage{polish}{exerquiz}
+\DeclareOptionX{polish}{\AtEndOfPackage{%
+ \def\today{\ifcase\month\or {Stycze\'{n}}
+ \or Luty \or Marzec \or {Kwiecie\'{n}}
+ \or Maj \or Czerwiec \or Lipiec \or {\'{S}ierpie\'{n}}
+ \or {Wrzesie\'{n}} \or {Pa\'{z}dziernik} \or Listopad
+ \or {Grudzie\'{n}} \fi \the\day, \the\year}
+ \renewcommand\web@versionlabel{Wersja}
+ \renewcommand\web@toc{Spis Tre\'{s}ci}
+ \renewcommand\web@continued{verte}
+ \renewcommand\web@article{Pocz\k{a}tek do
+ \hyperlink{\web@Start.1}{Tekstu}}
+ \renewcommand\web@directory{Zawarto\'{s}\'{c}}
+ \renewcommand\web@revision{Ostatnia zmiana:}
+ \renewcommand\web@copyright{Copyright}
+ \renewcommand\web@section{Cze\'{s}\'{c}}
+% Label Navibar
+ \renewcommand\web@back{Wstecz}
+ \renewcommand\web@doc{Dok}}% restricted to three characters
+ \PassOptionsToPackage{polish}{exerquiz}
}
% \end{macrocode}
% The \texttt{finnish}\IndexOpt{finnish} option
% \begin{macrocode}
-\DeclareOptionX{finnish}{%
- \AtEndOfPackage{%
- % Recouvrement de \today
+\DeclareOptionX{finnish}{\AtEndOfPackage{%
+% Recouvrement de \today
\def\today{\the\day\ \ifcase\month\or Tammikuu
\or Helmikuu \or Maaliskuu \or Huhtikuu
\or Toukokuu \or Kes\"{a}kuu \or Hein\"{a}kuu \or Elokuu
@@ -724,30 +712,28 @@
% \end{macrocode}
% The \texttt{catalan}\IndexOpt{catalan} option
% \begin{macrocode}
-\DeclareOptionX{catalan}{%
- \AtEndOfPackage{%
- \def\today{\the\day\ de \ifcase\month\or Gener
- \or Febrer \or Mar\c{c} \or Abril
- \or Maig \or Juny \or Juliol \or Agost
- \or Setembre \or Octubre \or Novembre
- \or Desembre \fi de \the\year}
- \renewcommand\web@versionlabel{Versi\noexpand\'{o}}
- \renewcommand\web@toc{Taula de Contingut}
- \renewcommand\web@continued{cont.}
- \renewcommand\web@article{Inici \hyperlink{\web@Start.1}{Article}}
- \renewcommand\web@directory{Directori}
- \renewcommand\web@revision{Actualizat el:}
- \renewcommand\web@copyright{Copyright}
- \renewcommand\web@section{Secci\'o}
- \renewcommand\web@back{Tornar}
- \renewcommand\web@doc{Doc}}
- \PassOptionsToPackage{catalan}{exerquiz}
+\DeclareOptionX{catalan}{\AtEndOfPackage{%
+ \def\today{\the\day\ de \ifcase\month\or Gener
+ \or Febrer \or Mar\c{c} \or Abril
+ \or Maig \or Juny \or Juliol \or Agost
+ \or Setembre \or Octubre \or Novembre
+ \or Desembre \fi de \the\year}
+ \renewcommand\web@versionlabel{Versi\noexpand\'{o}}
+ \renewcommand\web@toc{Taula de Contingut}
+ \renewcommand\web@continued{cont.}
+ \renewcommand\web@article{Inici \hyperlink{\web@Start.1}{Article}}
+ \renewcommand\web@directory{Directori}
+ \renewcommand\web@revision{Actualizat el:}
+ \renewcommand\web@copyright{Copyright}
+ \renewcommand\web@section{Secci\'o}
+ \renewcommand\web@back{Tornar}
+ \renewcommand\web@doc{Doc}}
+ \PassOptionsToPackage{catalan}{exerquiz}
}
% \end{macrocode}
% The \texttt{czech}\IndexOpt{czech} option
% \begin{macrocode}
-\DeclareOptionX{czech}{%
- \AtEndOfPackage{%
+\DeclareOptionX{czech}{\AtEndOfPackage{%
\def\today{\number\day. \ifcase\month\or ledna\or \'unora\or
b\v{r}ezna\or dubna\or kv\v{e}tna\or \v{c}ervna\or \v{c}ervence\or
srpna\or z\'a\v{r}\'\i\or \v{r}\'{\i}jna\or listopadu\or prosince\fi
@@ -767,31 +753,29 @@
% \end{macrocode}
% The \texttt{brazil}\IndexOpt{brazil} option
% \begin{macrocode}
-\DeclareOptionX{brazil}{%
- \AtEndOfPackage{%
- \def\today{\the\day\ de \ifcase\month\or janeiro
- \or fevereiro \or mar\c{c}o \or abril
- \or maio \or junho \or julho \or agosto
- \or setembro \or outubro \or novembro
- \or dezembro \fi de \the\year}
- \renewcommand\web@versionlabel{Vers\~{a}o}
- \renewcommand\web@toc{Tabela de Conte\'{u}do}
- \renewcommand\web@continued{cont.}
- \renewcommand\web@article{Inicie o
- \hyperlink{\web@Start.1}{Artigo}}
- \renewcommand\web@directory{Diret\'{o}rio}
- \renewcommand\web@revision{Atualizado em:}
- \renewcommand\web@copyright{Copyright}
- \renewcommand\web@section{Se\c{c}\noexpand\~{a}o}
- \renewcommand\web@back{Voltar}
- \renewcommand\web@doc{Doc}}
+\DeclareOptionX{brazil}{\AtEndOfPackage{%
+ \def\today{\the\day\ de \ifcase\month\or janeiro
+ \or fevereiro \or mar\c{c}o \or abril
+ \or maio \or junho \or julho \or agosto
+ \or setembro \or outubro \or novembro
+ \or dezembro \fi de \the\year}
+ \renewcommand\web@versionlabel{Vers\~{a}o}
+ \renewcommand\web@toc{Tabela de Conte\'{u}do}
+ \renewcommand\web@continued{cont.}
+ \renewcommand\web@article{Inicie o
+ \hyperlink{\web@Start.1}{Artigo}}
+ \renewcommand\web@directory{Diret\'{o}rio}
+ \renewcommand\web@revision{Atualizado em:}
+ \renewcommand\web@copyright{Copyright}
+ \renewcommand\web@section{Se\c{c}\noexpand\~{a}o}
+ \renewcommand\web@back{Voltar}
+ \renewcommand\web@doc{Doc}}
\PassOptionsToPackage{brazil}{exerquiz}
}
% \end{macrocode}
% The \texttt{turkish}\IndexOpt{turkish} option
% \begin{macrocode}
-\DeclareOptionX{turkish}{%
- \ExecuteOptionsX{unicode}%
+\DeclareOptionX{turkish}{\ExecuteOptionsX{unicode}%
\AtEndOfPackage{%
%======> Modification : Mahmut Ko\c{c}ak
\def\today{\the\day\ \ifcase\month\or Ocak
@@ -816,23 +800,20 @@
% Unknown options are passed to the color package
% \begin{macrocode}
\DeclareOptionX*{\PassOptionsToPackage{\CurrentOption}
- {\eq@ColorPackage}}
+ {\eq@ColorPackage}}
% \end{macrocode}
% We use \textsf{xcolor} if available.
% \begin{macrocode}
-\@ifpackageloaded{xcolor}%
-{%
- \@ifpackagelater{xcolor}{2004/07/04}{}
- {%
- \PackageError{web}{%
- *************************************************\MessageBreak
- * Your Version of `xcolor.sty' is too old!\MessageBreak
- * You need the version from 2004/07/04 or newer\MessageBreak
- * or use: \string\usepackage[noxcolor]{web}\MessageBreak
- * or \string\documentclass[noxcolor]{article}\MessageBreak
- *************************************************}{}%
- }%
-}{}
+\@ifpackageloaded{xcolor}{%
+ \@ifpackagelater{xcolor}{2004/07/04}{}{%
+ \PackageError{web}{%
+ *************************************************\MessageBreak
+ * Your Version of `xcolor.sty' is too old!\MessageBreak
+ * You need the version from 2004/07/04 or newer\MessageBreak
+ * or use: \string\usepackage[noxcolor]{web}\MessageBreak
+ * or \string\documentclass[noxcolor]{article}\MessageBreak
+ *************************************************}{}%
+}}{}
% \end{macrocode}
% \section{Main Code}
% \subsection{Switches}
@@ -862,11 +843,10 @@
% a bullet. This is only obeyed when the \texttt{pro} option is in effect.
% \begin{macrocode}
\newif\if@defaultsubsubding \@defaultsubsubdingtrue
-\def\forceSubSubNumbers{%
- \ifx\web@latextoc\web@YES\else
- \PackageWarning{webpro}{\string\forSubSubNumbers\space
- requested,\MessageBreak I'm adding the option of latextoc}\fi
- \let\web@latextoc\web@YES\@defaultsubsubdingfalse
+\def\forceSubSubNumbers{\ifx\web@latextoc\web@YES\else
+ \PackageWarning{webpro}{\string\forSubSubNumbers\space
+ requested,\MessageBreak I'm adding the option of latextoc}\fi
+ \let\web@latextoc\web@YES\@defaultsubsubdingfalse
}
% \end{macrocode}
% \end{macro}
@@ -962,7 +942,7 @@
% then ignore the \texttt{unicode} option.
% \begin{macrocode}
\ifx\web@Hypdfencoding\@empty\else
- \let\aeb@useunicode\@gobble\fi
+ \let\aeb@useunicode\@gobble\fi
% \end{macrocode}
% We use a utility command, taken and renamed from the \texttt{comment} package.
% \begin{macrocode}
@@ -1008,20 +988,20 @@
% (2016/07/22) We do not pass the driver to \pkg{hyperref} in the cases the driver
% is \texttt{pdftex} or \texttt{xetex}.
% \begin{macrocode}
- \ifpdf\else\ifxetex\else\eq@driver@name,\fi\fi
- bookmarks,bookmarksnumbered,bookmarksopen,%
- colorlinks,\aeb@useunicode,linkcolor=webgreen,%
- filecolor=webbrown,citecolor=webgreen,%
- urlcolor=webbrown,pagebackref,pdfpagemode=UseNone,%
- pdfstartview=Fit,pdfpagelayout=SinglePage%
+ \ifpdf\else\ifxetex\else\eq@driver@name,\fi\fi
+ bookmarks,bookmarksnumbered,bookmarksopen,%
+ colorlinks,\aeb@useunicode,linkcolor=webgreen,%
+ filecolor=webbrown,citecolor=webgreen,%
+ urlcolor=webbrown,pagebackref,pdfpagemode=UseNone,%
+ pdfstartview=Fit,pdfpagelayout=SinglePage%
% \end{macrocode}
% (2016/08/19) Moved the following code to the end of the option list so these options can override
% earlier options in the list.
% \changes{v6.0m}{2016/08/19}{Moved user and internal options for \string\pkg{hyperref} to end of option list so they
% can override earlier options.}
% \begin{macrocode}
- \ifx\u@web@ddtoHyOpts\@empty\else,\u@web@ddtoHyOpts\fi
- \ifx\i@web@ddtoHyOpts\@empty\else,\i@web@ddtoHyOpts\fi]{hyperref}%
+ \ifx\u@web@ddtoHyOpts\@empty\else,\u@web@ddtoHyOpts\fi
+ \ifx\i@web@ddtoHyOpts\@empty\else,\i@web@ddtoHyOpts\fi]{hyperref}%
}
% \end{macrocode}
% If the option \texttt{xhyperref} is taken, \textsf{hyperref} is not input by this
@@ -1030,10 +1010,10 @@
% and its placement in \string\cs{w@isHyLoaded}.}
% \begin{macrocode}
\def\w@isHyLoaded{\@ifpackageloaded{hyperref}{}{\PackageError{web}
- {The xhyperref option used, but hyperref is not\MessageBreak
- already loaded. Will load hyperref with the options\MessageBreak
- chosen by web}{Remove xhyperref or load hyperref prior to the web
- package.}\web@RequireHyperref}%
+ {The xhyperref option used, but hyperref is not\MessageBreak
+ already loaded. Will load hyperref with the options\MessageBreak
+ chosen by web}{Remove xhyperref or load hyperref prior to the web
+ package.}\web@RequireHyperref}%
}
% \end{macrocode}
% Now if the \opt{xhyperref} option \emph{is not taken}, we load \pkg{hyperref}; otherwise, if \pkg{hyperref}
@@ -1041,10 +1021,10 @@
% options.
% \begin{macrocode}
\if@web@hyperref\expandafter\web@RequireHyperref\else
- \expandafter\w@isHyLoaded\fi
+ \expandafter\w@isHyLoaded\fi
\ifx\u@web@ddtoHySetup\@empty\else\edef\x{\noexpand\hypersetup
{\u@web@ddtoHySetup}}\expandafter\x\fi
-% \end{macrocode}
+% \end{macrocode}
% We declare that `The AcroTeX eDucation Bundle' is the pdf creator.
% \begin{macrocode}
\def\@pdfcreator{The AcroTeX eDucation Bundle}
@@ -1062,14 +1042,14 @@
% If the user specifies the use of templates, we assume they are going
% to do some graphical work, so we include \textsf{graphicx}.
% \begin{macrocode}
-\ifnum\@usetemplates=1\relax
+\ifnum\@usetemplates=\@ne\relax
\def\x{\RequirePackage{graphicx}}\expandafter\x\fi
% \end{macrocode}
% If the user specifies an option requiring templates, then we better
% load \textsf{eso-pic}, which itself requires \textsf{everyshi} or \textsf{atbegshi}.
% \begin{macrocode}
-\ifnum\@usetemplates=1\relax
- \RequirePackage{eso-pic}
+\ifnum\@usetemplates=\@ne
+ \RequirePackage{eso-pic}
% \end{macrocode}
% Here is a fix for \textsf{dvipdfm}. If using templates, then we need to
% redefine the way we set the page size using \textsf{eso-pic}. We also need
@@ -1078,28 +1058,24 @@
% size special will be in the \cs{ESO@HookII} macro, it needs to
% execute (once) before \cs{ESO@HookI} is executed.
% \begin{macrocode}
- \ifnum\eq@drivernum=2\relax
- \def\web@set@paper{\AddToShipoutPicture*{%
- \special{papersize=\the\paperwidth,\the\paperheight}}}%
+ \ifnum\eq@drivernum=\tw@
+ \def\web@set@paper{\AddToShipoutPicture*{%
+ \special{papersize=\the\paperwidth,\the\paperheight}}}%
% \end{macrocode}
% We use some code from \textsf{hyperref} to set the page size.
% \begin{macrocode}
- \AtBeginShipoutFirst{%
- \begingroup
- \@ifundefined{stockwidth}{%
- \ifx\special@paper\@empty
- \special{papersize=\the\paperwidth,\the\paperheight}%
- \else
- \special{papersize=\special@paper}%
- \fi
- }{%
- \ifdim\stockwidth=\z@
- \else
- \special{papersize=\the\stockwidth,\the\stockheight}%
- \fi
- }%
- \endgroup
+ \AtBeginShipoutFirst{%
+ \begingroup
+ \@ifundefined{stockwidth}{%
+ \ifx\special@paper\@empty
+ \special{papersize=\the\paperwidth,\the\paperheight}\else
+ \special{papersize=\special@paper}\fi
+ }{%
+ \ifdim\stockwidth=\z@\else
+ \special{papersize=\the\stockwidth,\the\stockheight}\fi
}%
+ \endgroup
+ }%
% \end{macrocode}
% \changes{v4.2d}{2009/11/22}{Modifications to use
% new \string\textsf{eso-pic}}
@@ -1109,38 +1085,38 @@
% The new version of \textsf{eso-pic} does not define \cs{@ShipoutPicture}.
% If \cs{@Ship\-out\-Pic\-ture} defined, so we use some of the old code.
% \begin{macrocode}
- \renewcommand{\@ShipoutPicture}{%
- \bgroup
- \@tempswafalse%
- \ifx\ESO@HookI\@empty\else\@tempswatrue\fi%
- \ifx\ESO@HookII\@empty\else\@tempswatrue\fi%
- \if@tempswa%
- \@tempdima=1in\@tempdimb=-\@tempdima%
- \advance\@tempdimb\paperheight
- \@ifundefined{stockwidth}{}{%
- \advance\@tempdima+\trimedge%
- \advance\@tempdima+\paperwidth%
- \advance\@tempdima-\stockwidth%
- \if@twoside\ifodd\c@page\else%
- \advance\@tempdima-2\trimedge%
- \advance\@tempdima-\paperwidth%
- \advance\@tempdima+\stockwidth%
- \fi\fi%
- \advance\@tempdimb+\trimtop}%
- \unitlength=1pt%
- \global\setbox\@cclv\vbox{%
- \vbox{\let\protect\relax
- \pictur@(0,0)%
- (\strip@pt\@tempdima,\strip@pt\@tempdimb)%
- \ESO@HookII\ESO@HookI\global\let\ESO@HookII\@empty%
- \endpicture}%
- \box\@cclv%
- }%
- \fi
- \egroup
- }%
- }%
- \fi
+ \renewcommand{\@ShipoutPicture}{%
+ \bgroup
+ \@tempswafalse%
+ \ifx\ESO@HookI\@empty\else\@tempswatrue\fi%
+ \ifx\ESO@HookII\@empty\else\@tempswatrue\fi%
+ \if@tempswa%
+ \@tempdima=1in\@tempdimb=-\@tempdima%
+ \advance\@tempdimb\paperheight
+ \@ifundefined{stockwidth}{}{%
+ \advance\@tempdima+\trimedge%
+ \advance\@tempdima+\paperwidth%
+ \advance\@tempdima-\stockwidth%
+ \if@twoside\ifodd\c@page\else%
+ \advance\@tempdima-2\trimedge%
+ \advance\@tempdima-\paperwidth%
+ \advance\@tempdima+\stockwidth%
+ \fi\fi\advance\@tempdimb+\trimtop
+ }%
+ \unitlength=1pt%
+ \global\setbox\@cclv\vbox{%
+ \vbox{\let\protect\relax
+ \pictur@(0,0)%
+ (\strip@pt\@tempdima,\strip@pt\@tempdimb)%
+ \ESO@HookII\ESO@HookI\global\let\ESO@HookII\@empty%
+ \endpicture}%
+ \box\@cclv%
+ }%
+ \fi
+ \egroup
+ }% shipout
+ }% ifundefined shipout
+ \fi
\fi
% \end{macrocode}
% A useful command for separating two arguments. Use in \texttt{webpro} section, and by \texttt{aeb\_pro} as well.
@@ -1196,24 +1172,20 @@
% \end{macrocode}
% Modified version of the \cs{InitLayout} macro from pdfscreen.
% \begin{macrocode}
-\def\InitLayout
-{%
- \ifeqforpaper\else
- \setlength\headheight{\websetheadheight}
- \hoffset=0pt \voffset=0pt
- \fi
- \ifeqforpaper\else
+\def\InitLayout{%
+ \ifeqforpaper\else
+ \setlength\headheight{\websetheadheight}
+ \hoffset=0pt \voffset=0pt
{\@tempdima=\paperwidth
- \addtolength{\@tempdima}{-\@Leftmargin}%
- \addtolength{\@tempdima}{-\@Rightmargin}%
- \xdef\fullscreenwidth{\the\@tempdima}}%
- \fi
- \ifx\web@layout\web@YES\else\templatedefaults\fi
- \ifeqforpaper\else
- \setlength{\textwidth}{\paperwidth}
- \setlength{\textheight}{\paperheight}
- \addtolength{\textheight}{-\@Topmargin}
- \addtolength{\textheight}{-\@Bottommargin}
+ \addtolength{\@tempdima}{-\@Leftmargin}%
+ \addtolength{\@tempdima}{-\@Rightmargin}%
+ \xdef\fullscreenwidth{\the\@tempdima}}\fi
+ \ifx\web@layout\web@YES\else\templatedefaults\fi
+ \ifeqforpaper\else
+ \setlength{\textwidth}{\paperwidth}
+ \setlength{\textheight}{\paperheight}
+ \addtolength{\textheight}{-\@Topmargin}
+ \addtolength{\textheight}{-\@Bottommargin}
% \end{macrocode}
%\begin{verbatim}
%\topmargin = \web@Topmargin - 1in
@@ -1221,57 +1193,57 @@
% so \headsep = \@Topmargin - \headheight - \web@Topmargin (\topmargin)
%\end{verbatim}
% \begin{macrocode}
- \setlength{\headsep}{\@Topmargin}
- \addtolength\headsep{-\headheight}
- \setlength{\topmargin}{\web@Topmargin}
- \addtolength\headsep{-\topmargin}
- \addtolength\headsep{\web@additionalheadsep}
- \addtolength{\topmargin}{-1in}
- \setlength\footskip{\@Bottommargin}
- \addtolength{\footskip}{-\web@footskip} % depth of navibar
- \ifcase\@panelconfig
- \setlength{\oddsidemargin}{\@Leftmargin}
- \setlength{\evensidemargin}{\@Leftmargin}
- \or
- \setlength{\oddsidemargin}{\@panelwidth}
- \setlength{\evensidemargin}{\@panelwidth}
- \or
- \setlength{\oddsidemargin}{\@Leftmargin}
- \setlength{\evensidemargin}{\@Leftmargin}
- \fi
- \addtolength{\evensidemargin}{-1in}
- \addtolength{\oddsidemargin}{-1in}
+ \setlength{\headsep}{\@Topmargin}
+ \addtolength\headsep{-\headheight}
+ \setlength{\topmargin}{\web@Topmargin}
+ \addtolength\headsep{-\topmargin}
+ \addtolength\headsep{\web@additionalheadsep}
+ \addtolength{\topmargin}{-1in}
+ \setlength\footskip{\@Bottommargin}
+ \addtolength{\footskip}{-\web@footskip} % depth of navibar
+ \ifcase\@panelconfig
+ \setlength{\oddsidemargin}{\@Leftmargin}
+ \setlength{\evensidemargin}{\@Leftmargin}
+ \or
+ \setlength{\oddsidemargin}{\@panelwidth}
+ \setlength{\evensidemargin}{\@panelwidth}
+ \or
+ \setlength{\oddsidemargin}{\@Leftmargin}
+ \setlength{\evensidemargin}{\@Leftmargin}
+ \fi
+ \addtolength{\evensidemargin}{-1in}
+ \addtolength{\oddsidemargin}{-1in}
\fi
\ifx\web@layout\web@YES
- \ifcase\@panelconfig
- \addtolength{\textwidth}{-\@Leftmargin}
- \addtolength{\textwidth}{-\@Rightmargin}
- \or % leftpanel
- \addtolength{\textwidth}{-\@panelwidth}
- \addtolength{\textwidth}{-\@Rightmargin}
- \or % rightpanel
- \addtolength{\textwidth}{-\@panelwidth}
- \addtolength{\textwidth}{-\@Leftmargin}
+ \ifcase\@panelconfig
+ \addtolength{\textwidth}{-\@Leftmargin}
+ \addtolength{\textwidth}{-\@Rightmargin}
+ \or % leftpanel
+ \addtolength{\textwidth}{-\@panelwidth}
+ \addtolength{\textwidth}{-\@Rightmargin}
+ \or % rightpanel
+ \addtolength{\textwidth}{-\@panelwidth}
+ \addtolength{\textwidth}{-\@Leftmargin}
+ \fi
+ \ifnum\@usetemplates=\@ne
+ \setlength{\textscreenwidth}{\paperwidth}
+ \def\@textX{0}
+ \ifnum\@panelconfig=\@ne % leftpanel
+ \addtolength{\textwidth}{-\@panelsep}
+ \addtolength{\oddsidemargin}{\@panelsep}
+ \addtolength{\evensidemargin}{\@panelsep}
+ \addtolength{\textscreenwidth}{-\@panelwidth}
+ \def\@textX{\strip@pt\@panelwidth}
+ \def\@panelX{0}
\fi
- \ifnum\@usetemplates=1\relax
- \setlength{\textscreenwidth}{\paperwidth}
- \def\@textX{0}
- \ifnum\@panelconfig=1 % leftpanel
- \addtolength{\textwidth}{-\@panelsep}
- \addtolength{\oddsidemargin}{\@panelsep}
- \addtolength{\evensidemargin}{\@panelsep}
- \addtolength{\textscreenwidth}{-\@panelwidth}
- \def\@textX{\strip@pt\@panelwidth}
- \def\@panelX{0}
- \fi
- \ifnum\@panelconfig=2 % rightpanel
- \addtolength{\textwidth}{-\@panelsep}
- \addtolength{\textscreenwidth}{-\@panelwidth}
- \def\@textX{0}
- \def\@panelX{\strip@pt\textscreenwidth}
- \fi
- \calculatefullwidth
+ \ifnum\@panelconfig=\tw@ % rightpanel
+ \addtolength{\textwidth}{-\@panelsep}
+ \addtolength{\textscreenwidth}{-\@panelwidth}
+ \def\@textX{0}
+ \def\@panelX{\strip@pt\textscreenwidth}
\fi
+ \calculatefullwidth
+ \fi
\fi
}
% \end{macrocode}
@@ -1300,30 +1272,26 @@
%
% The commands seems only effect with the \textsf{dvipsone} driver.
% \begin{macrocode}
-\def\@convLtoP#1#2{%
- \afterassignment\@convLtoP@i\dimen@#2bp\relax{#1}{#2}}
+\def\@convLtoP#1#2{\afterassignment
+ \@convLtoP@i\dimen@#2bp\relax{#1}{#2}}
\def\@convLtoP@i#1\relax#2#3{%
- \if!#1!%
- \def#2{#3}%
- \else
- \dimen@.99626\dimen@
- \edef#2{\strip@pt\dimen@}%
- \fi}
+ \if!#1!\def#2{#3}\else
+ \dimen@.99626\dimen@\edef#2{\strip@pt\dimen@}\fi}
\providecommand\setPageDevice[3][600]{\bgroup
- \@convLtoP{\width}{#2}\@convLtoP{\height}{#3}
- \ifpdfmarkup\headerps@out{<< /HWResolution [#1 #1] %
- /PageSize [\width\space\height] >> setpagedevice}\else
- \PackageWarning{web}{This is a distiller only command,\MessageBreak
+ \@convLtoP{\width}{#2}\@convLtoP{\height}{#3}
+ \ifpdfmarkup\headerps@out{<< /HWResolution [#1 #1] %
+ /PageSize [\width\space\height] >> setpagedevice}\else
+ \PackageWarning{web}{This is a distiller only command,\MessageBreak
ignoring \string\setPageDevice}\fi\egroup}
% \end{macrocode}
%\DescribeMacro\allowTransparency sets the \textbf{AllowTransparency} key of
% the distiller to \textbf{true}. We do this with \texttt{setdistillerparams}.
% \begin{macrocode}
\providecommand\allowTransparency{\bgroup
- \ifpdfmarkup\headerps@out{<< %
- /AllowTransparency true >> setdistillerparams}\else
- \PackageWarning{web}{This is a distiller only command,\MessageBreak
- ignoring \string\allowTransparency}\fi\egroup}
+ \ifpdfmarkup\headerps@out{<< %
+ /AllowTransparency true >> setdistillerparams}\else
+ \PackageWarning{web}{This is a distiller only command,\MessageBreak
+ ignoring \string\allowTransparency}\fi\egroup}
\@onlypreamble\setPageDevice
\@onlypreamble\allowTransparency
% \end{macrocode}
@@ -1342,29 +1310,27 @@
%\end{verbatim}
% \begin{macrocode}
\def\screensize#1#2{%
- \def\webSaveSSDim{{#1}{#2}}%
- \begingroup
+ \def\webSaveSSDim{{#1}{#2}}%
+ \begingroup
\ifeqforpaper
- \ifx\web@layout\web@YES
- \setlength{\@tempdima}{#2}%
- \global\textwidth\@tempdima
- \addtolength{\@tempdima}{-\@Leftmargin}%
- \addtolength{\@tempdima}{-\@Rightmargin}%
- \xdef\fullscreenwidth{\the\@tempdima}%
- \else
- \xdef\fullscreenwidth{\the\textwidth}%
- \fi
+ \ifx\web@layout\web@YES
+ \setlength{\@tempdima}{#2}\global
+ \textwidth\@tempdima
+ \addtolength{\@tempdima}{-\@Leftmargin}%
+ \addtolength{\@tempdima}{-\@Rightmargin}%
+ \xdef\fullscreenwidth{\the\@tempdima}\else
+ \xdef\fullscreenwidth{\the\textwidth}\fi
\else
- \setlength{\@tempdima}{#1}%
- \global\paperheight\@tempdima
- \setlength{\@tempdima}{#2}%
- \global\paperwidth\@tempdima
+ \setlength{\@tempdima}{#1}\global
+ \paperheight\@tempdima
+ \setlength{\@tempdima}{#2}\global
+ \paperwidth\@tempdima
\fi
- \endgroup
- \web@papersize@settrue
- \web@set@paper % dps modified
- \let\screensize\@gobbletwo
- \InitLayout
+ \endgroup
+ \web@papersize@settrue
+ \web@set@paper
+ \let\screensize\@gobbletwo
+ \InitLayout
}
% \end{macrocode}
% Save a secret copy of screensize for use by APB
@@ -1403,9 +1369,9 @@
% }
% \begin{macrocode}
\newcommand{\setScreensizeFromGraphic}[2][]{%
- \getDimsFromGraphic[#1]{#2}%
+ \getDimsFromGraphic[#1]{#2}%
{\web@graphicScreenWidth}{\web@graphicScreenHeight}%
- \screensize{\web@graphicScreenHeight}{\web@graphicScreenWidth}%
+ \screensize{\web@graphicScreenHeight}{\web@graphicScreenWidth}%
}
\@onlypreamble\setScreensizeFromGraphic
% \end{macrocode}
@@ -1414,7 +1380,7 @@
% This command uses the graphicx package. It loads a graphic
% into a box and measures its dimensions.
% \changes{v4.1a}{2008/07/06}
-% {
+% {%
% Added the command \string\cs{getDimsFromGraphic} as a helper command for
% \string\cs{setScreensizeFromGraphic}, but also useful as
% stand alone as well.
@@ -1422,17 +1388,17 @@
%
%\medskip\noindent The parameters are:
%\begin{enumerate}
-% \item[]\texttt{[\#1]}: Optional argument that is passed to \cs{graphicx} package
+% \item[]\texttt{[\#1]}: Optional argument that is passed to \cs{includegraphics} command
% \item[]\texttt{\#2}: The path to the graph to be read
% \item[]\texttt{\#3}: A control sequence to be used to hold the width
% \item[]\texttt{\#4}: A control sequence to be used to hold the height
%\end{enumerate}
% \begin{macrocode}
-\newcommand{\getDimsFromGraphic}[4][]{{%
- \setbox0=\hbox{\includegraphics[draft,#1]{#2}}%
- \dimen@=\dp0 \advance\dimen@\ht0
- \xdef#3{\the\wd0 }\xdef#4{\the\dimen@}%
-}}
+\newcommand{\getDimsFromGraphic}[4][]{\bgroup
+ \setbox\z@=\hbox{\includegraphics[draft,#1]{#2}}%
+ \dimen@=\dp\z@ \advance\dimen@\ht\z@
+ \xdef#3{\the\wd\z@ }\xdef#4{\the\dimen@}\egroup
+}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\addtoWebHeight}
@@ -1446,34 +1412,34 @@
% \begin{macrocode}
\def\web@getSSDims#1#2{\edef\web@@height{#1}\edef\web@@width{#2}}
\def\addToWebHWError{\PackageError{web}{%
- You must declare screen size first by using\MessageBreak
- the \string\screensize\space command, or by declaring \MessageBreak
- a design in the web option list}%
- {Do as is suggested in error message!}}
+ You must declare screen size first by using\MessageBreak
+ the \string\screensize\space command, or by declaring \MessageBreak
+ a design in the web option list}%
+ {Do as is suggested in error message!}}
\newcommand{\addtoWebHeight}[1]{%
% \end{macrocode}
% If the \cmd{\screensize} has already been set, it has been
% \cmd{\let} to \cmd{\@gobbletwo}. We use this to detect the error
% of not already declaring page dimensions.
% \begin{macrocode}
- \ifx\screensize\@gobbletwo
- \expandafter\web@getSSDims\webSaveSSDim
+ \ifx\screensize\@gobbletwo
+ \expandafter\web@getSSDims\webSaveSSDim
% \end{macrocode}
% Even though \cmd{\screensize} has already been expanded and is now
% \cs{let} to \cs{@gobbletwo}, we can use our saved version of
% \cs{screensize} that no one knows about.
% \begin{macrocode}
- \screensize@web@save{\web@@height+#1}{\web@@width}%
- \else\addToWebHWError\fi
+ \screensize@web@save{\web@@height+#1}{\web@@width}%
+ \else\addToWebHWError\fi
}
% \end{macrocode}
% \cs{addtoWebWidth} works the same way as \cmd{\addtoWebHeight}.
% \begin{macrocode}
\newcommand{\addtoWebWidth}[1]{%
- \ifx\screensize\@gobbletwo
- \expandafter\web@getSSDims\webSaveSSDim
- \screensize@web@save{\web@@height}{\web@@width+#1}%
- \else\addToWebHWError\fi
+ \ifx\screensize\@gobbletwo
+ \expandafter\web@getSSDims\webSaveSSDim
+ \screensize@web@save{\web@@height}{\web@@width+#1}%
+ \else\addToWebHWError\fi
}
% \end{macrocode}
% Expand in preamble only.
@@ -1496,18 +1462,17 @@
% #5 = bottom margin
%\end{verbatim}
% \begin{macrocode}
-\newcommand{\@margins}[5][\web@minpanelwidth]
-{%
- \def\webSaveMargDim{[#1]{#2}{#3}{#4}{#5}}%
- \setlength{\@panelwidth}{#1}%
- \ifdim\@panelwidth<\web@minpanelwidth
- \setlength{\@panelwidth}{\web@minpanelwidth}\fi
- \setlength{\@Leftmargin}{#2}%
- \setlength{\@Rightmargin}{#3}%
- \setlength{\@Topmargin}{#4}%
- \setlength{\@Bottommargin}{#5}%
- \web@margins@settrue
- \InitLayout
+\newcommand{\@margins}[5][\web@minpanelwidth]{%
+ \def\webSaveMargDim{[#1]{#2}{#3}{#4}{#5}}%
+ \setlength{\@panelwidth}{#1}%
+ \ifdim\@panelwidth<\web@minpanelwidth
+ \setlength{\@panelwidth}{\web@minpanelwidth}\fi
+ \setlength{\@Leftmargin}{#2}%
+ \setlength{\@Rightmargin}{#3}%
+ \setlength{\@Topmargin}{#4}%
+ \setlength{\@Bottommargin}{#5}%
+ \web@margins@settrue
+ \InitLayout
}
\let\margins\@margins
\let\margins@web@save\margins
@@ -1528,40 +1493,40 @@
% This line adds .25in to each of the side margins.
% \begin{macrocode}
\newcommand\get@MargDim[5][]{%
- \def\currPanelWidth{#1}%
- \def\currLeftMarg{#2}\def\currRightMarg{#3}%
- \def\currTopMarg{#4}\def\currBottomMarg{#5}}
+ \def\currPanelWidth{#1}%
+ \def\currLeftMarg{#2}\def\currRightMarg{#3}%
+ \def\currTopMarg{#4}\def\currBottomMarg{#5}}
\newcommand{\resetmargins}[5][\web@minpanelwidth]{%
- \expandafter\get@MargDim\webSaveMargDim
- \begingroup
- \let\incby\currPanelWidth
- \def\web@arg{#1}\ifx\web@arg\@empty
- \setlength{\@tempdima}{\currPanelWidth}\else
- \setlength{\@tempdima}{#1}\fi
- \xdef\newPanelWidth{\the\@tempdima}%
- \let\incby\currLeftMarg
- \def\web@arg{#2}\ifx\web@arg\@empty
- \setlength{\@tempdima}{\currLeftMarg}\else
- \setlength{\@tempdima}{#2}\fi
- \xdef\newLeftMarg{\the\@tempdima}%
- \let\incby\currRightMarg
- \def\web@arg{#3}\ifx\web@arg\@empty
- \setlength{\@tempdima}{\currRightMarg}\else
- \setlength{\@tempdima}{#3}\fi
- \xdef\newRightMarg{\the\@tempdima}%
- \let\incby\currTopMarg
- \def\web@arg{#4}\ifx\web@arg\@empty
- \setlength{\@tempdima}{\currTopMarg}\else
- \setlength{\@tempdima}{#4}\fi
- \xdef\newTopMarg{\the\@tempdima}%
- \let\incby\currBottomMarg
- \def\web@arg{#4}\ifx\web@arg\@empty
- \setlength{\@tempdima}{\currBottomMarg}\else
- \setlength{\@tempdima}{#5}\fi
- \xdef\newBottomMarg{\the\@tempdima}%
- \endgroup
- \margins@web@save[\newPanelWidth]{\newLeftMarg}{\newRightMarg}
- {\newTopMarg}{\newBottomMarg}
+ \expandafter\get@MargDim\webSaveMargDim
+ \begingroup
+ \let\incby\currPanelWidth
+ \def\web@arg{#1}\ifx\web@arg\@empty
+ \setlength{\@tempdima}{\currPanelWidth}\else
+ \setlength{\@tempdima}{#1}\fi
+ \xdef\newPanelWidth{\the\@tempdima}%
+ \let\incby\currLeftMarg
+ \def\web@arg{#2}\ifx\web@arg\@empty
+ \setlength{\@tempdima}{\currLeftMarg}\else
+ \setlength{\@tempdima}{#2}\fi
+ \xdef\newLeftMarg{\the\@tempdima}%
+ \let\incby\currRightMarg
+ \def\web@arg{#3}\ifx\web@arg\@empty
+ \setlength{\@tempdima}{\currRightMarg}\else
+ \setlength{\@tempdima}{#3}\fi
+ \xdef\newRightMarg{\the\@tempdima}%
+ \let\incby\currTopMarg
+ \def\web@arg{#4}\ifx\web@arg\@empty
+ \setlength{\@tempdima}{\currTopMarg}\else
+ \setlength{\@tempdima}{#4}\fi
+ \xdef\newTopMarg{\the\@tempdima}%
+ \let\incby\currBottomMarg
+ \def\web@arg{#4}\ifx\web@arg\@empty
+ \setlength{\@tempdima}{\currBottomMarg}\else
+ \setlength{\@tempdima}{#5}\fi
+ \xdef\newBottomMarg{\the\@tempdima}%
+ \endgroup
+ \margins@web@save[\newPanelWidth]{\newLeftMarg}{\newRightMarg}
+ {\newTopMarg}{\newBottomMarg}%
}
\@onlypreamble\resetscreensize
% \end{macrocode}
@@ -1574,7 +1539,6 @@
% \cs{maketitle} and ends up in the doc info section of the PDF file.
% \begin{macrocode}
\let\web@save@title\title
-%\def\title{\@ifnextchar[{\@title}{\@title[]}}
\def\title{\@ifnextchar[{\@web@title}{\@web@title[]}}
% \end{macrocode}
% \begin{macro}{\webtitle}
@@ -1584,8 +1548,8 @@
% \begin{macrocode}
%\def\@title[#1]#2{\gdef\webtitle{#2}\hypersetup{pdftitle={#2}}%
\def\@web@title[#1]#2{\gdef\webtitle{#2}\hypersetup{pdftitle={#2}}%
- \def\webArg{#1}\ifx\webArg\@empty\gdef\shortwebtitle{#2}\else
- \gdef\shortwebtitle{#1}\fi\web@save@title{#2}}
+ \def\webArg{#1}\ifx\webArg\@empty\gdef\shortwebtitle{#2}\else
+ \gdef\shortwebtitle{#1}\fi\web@save@title{#2}}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1595,7 +1559,6 @@
% doc info of the PDF file.
% \begin{macrocode}
\let\web@saved@author\author
-%\def\author#1{\gdef\webauthor{#1}\hypersetup{pdfauthor={#1}}}
\def\author#1{\gdef\webauthor{#1}\hypersetup{pdfauthor={#1}}%
\web@saved@author{#1}}
% \end{macrocode}
@@ -1606,9 +1569,9 @@
% \begin{macrocode}
\def\subject{\@ifnextchar[{\@subject}{\@subject[]}}
\def\@subject[#1]#2{%
- \def\webArg{#1}\ifx\webArg\@empty\gdef\shortwebsubject{#2}\else
- \gdef\shortwebsubject{#1}\fi\gdef\websubject{#2}%
- \hypersetup{pdfsubject={#2}}}
+ \def\webArg{#1}\ifx\webArg\@empty\gdef\shortwebsubject{#2}\else
+ \gdef\shortwebsubject{#1}\fi\gdef\websubject{#2}%
+ \hypersetup{pdfsubject={#2}}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\email}
@@ -1639,9 +1602,9 @@
% A version or revision number.
% \begin{macrocode}
\def\version#1{\gdef\web@version@value{#1}%
- \edef\webversion{\ifx\web@version@value\@empty\else
- \noexpand\web@versionlabel\noexpand\
- \noexpand\web@version@value\fi}%
+ \edef\webversion{\ifx\web@version@value\@empty\else
+ \noexpand\web@versionlabel\noexpand\
+ \noexpand\web@version@value\fi}%
}
\let\web@version@value\@empty
\def\versionLabel#1{\def\web@versionlabel{#1}}
@@ -1729,16 +1692,16 @@
\providecommand\FALSEACTIONii{\aftergroup\SETTEMPBOXi}
\providecommand\FALSEACTIONiia{\aftergroup\SHOWTEMPBOXi}
\providecommand\SETTEMPBOXi{\IF@AorBswitch\else
- \afterassignment\TRUEACTIONia\fi
- \setbox\webtempboxi=\hbox}
+ \afterassignment\TRUEACTIONia\fi
+ \setbox\webtempboxi=\hbox}
\providecommand\SETTEMPBOXii{\IF@AorBswitch
- \afterassignment\FALSEACTIONiia\fi
- \setbox\webtempboxii=\hbox}
+ \afterassignment\FALSEACTIONiia\fi
+ \setbox\webtempboxii=\hbox}
\def\prtscrV{\let\IF@AorBswitch\ifeqforpaper
- \ifeqforpaper
- \def\web@next{\afterassignment\TRUEACTIONi\SETTEMPBOXi}\else
- \def\web@next{\afterassignment\FALSEACTIONii\SETTEMPBOXii}\fi
- \web@next}
+ \ifeqforpaper
+ \def\web@next{\afterassignment\TRUEACTIONi\SETTEMPBOXi}\else
+ \def\web@next{\afterassignment\FALSEACTIONii\SETTEMPBOXii}\fi
+ \web@next}
% \end{macrocode}
% \end{macro}
%\subsubsection{\texorpdfstring{\protect\cs{optionalPageMatter}}{\CMD{optionalPageMatter}}}
@@ -1754,8 +1717,7 @@
\newcommand{\web@aboveOptPgMatDef}{\minimumskip\vspace{\stretch{1}}}
\newcommand{\aboveOPMvspace}{\web@aboveOptPgMatDef}
\newcommand{\optionalPageMatter}[2][\web@aboveOptPgMatDef]{%
- \def\aboveOPMvspace{#1}\def\optionalpagematter{#2}%
-}
+ \def\aboveOPMvspace{#1}\def\optionalpagematter{#2}}
\def\optionalpagematter{}
% \end{macrocode}
% \end{macro}
@@ -1765,7 +1727,7 @@
% to adjust the hyperlink target appropriately.
% \begin{macrocode}
\@ifundefined{thechapter}
- {\def\web@Start{section}}{\def\web@Start{chapter}}
+ {\def\web@Start{section}}{\def\web@Start{chapter}}
% \end{macrocode}
% \subsubsection{\texorpdfstring{\protect\cs{maketitle}}{\CMD{maketitle}} and the Directory}
% In this section we define \cs{maketitle}. You can \cs{renewcommand} this
@@ -1806,15 +1768,14 @@
% \begin{macrocode}
\newcommand{\trailerFontSize}{\footnotesize}
\def\maketitle@trailer@ul{\web@copyright\ \web@copyright@symbol\
- \webcopyrightyears}
+ \webcopyrightyears}
\def\maketitle@trailer@ll{\web@revision\ \@date}
\def\maketitle@trailer@ur{\thewebemail}
\def\maketitle@trailer@lr{\webversion}
-\newcommand{\titlepageTrailer}
-{%
- \makebox[\linewidth]{\parbox{\linewidth}{%
- \maketitle@trailer@ul\hfill\maketitle@trailer@ur\\
- \maketitle@trailer@ll\hfill\maketitle@trailer@lr}}%
+\newcommand{\titlepageTrailer}{%
+ \makebox[\linewidth]{\parbox{\linewidth}{%
+ \maketitle@trailer@ul\hfill\maketitle@trailer@ur\\
+ \maketitle@trailer@ll\hfill\maketitle@trailer@lr}}%
}
% \end{macrocode}
% \end{macro}
@@ -1832,21 +1793,21 @@
% \begin{macro}{\afterDirMatter}
% The code that places the directory on the title page.
% \begin{macrocode}
-\newcommand{\webdirectory}{%
- \par\ifeqforpaper\else\minimumskip\fi\vspace{\stretch{1}}%
- \web@priorDirMatter
- \begin{flushleft}{\web@formatWordDirectory\web@directory}%
- \web@priorDirList
- \vspace{\vspaceAfterDirName}%
- \begin{itemize}\setlength{\itemsep}{-3pt}\web@formatDirectoryItems
- \ifx\web@removeDirTOC\web@YES\else\item\relax\dirTOCItem\fi
- \ifx\web@removeDirArticle\web@YES\else
- \item\relax\dirArticleItem\fi
- \web@addtoDirList
- \end{itemize}
- \web@afterDirList
- \end{flushleft}
- \web@afterDirMatter
+\newcommand{\webdirectory}{\par
+ \ifeqforpaper\else\minimumskip\fi\vspace{\stretch{1}}%
+ \web@priorDirMatter
+ \begin{flushleft}{\web@formatWordDirectory\web@directory}%
+ \web@priorDirList
+ \vspace{\vspaceAfterDirName}%
+ \begin{itemize}\setlength{\itemsep}{-3pt}\web@formatDirectoryItems
+ \ifx\web@removeDirTOC\web@YES\else\item\relax\dirTOCItem\fi
+ \ifx\web@removeDirArticle\web@YES\else
+ \item\relax\dirArticleItem\fi
+ \web@addtoDirList
+ \end{itemize}
+ \web@afterDirList
+ \end{flushleft}
+ \web@afterDirMatter
}
% \end{macrocode}
% (02/10/2009) We include some additional commands to give control over the
@@ -1921,32 +1882,33 @@
% \begin{macro}{\topTitlePage}
% The top of the title page. This command lays out the university, the title and the author.
% \begin{macrocode}
-\newcommand{\topTitlePage}
-{%
+\newcommand{\topTitlePage}{%
% \end{macrocode}
% Have \cs{webuniversity} centered across the top of the title page.
% \begin{macrocode}
- \vglue\web@aboveTopTitleSkip
- \noindent\makebox[\linewidth]{%
- \parbox{\hproportionwebuniversity\linewidth}%
- {\bfseries\color{\webuniversity@color}\ifeqforpaper\large\fi
- \centering\webuniversity}}\par\ifeqforpaper\else\minimumskip\fi
- \vspace{\stretch{1}}%
+ \vglue\web@aboveTopTitleSkip
+ \noindent\makebox[\linewidth]{%
+ \parbox{\hproportionwebuniversity\linewidth}%
+ {\bfseries\color{\webuniversity@color}\ifeqforpaper\large\fi
+ \centering\webuniversity}}\par\ifeqforpaper\else\minimumskip\fi
+ \vspace{\stretch{1}}\noindent
% \end{macrocode}
% Now place the title (\cs{webtitle})
% \begin{macrocode}
- \noindent\makebox[\linewidth]{%
- \parbox{\hproportionwebtitle\linewidth}%
- {\bfseries\color{\webtitle@color}\ifeqforpaper\Large\else
- \large\fi\centering\webtitle}}\par\ifeqforpaper
- \vspace{2\baselineskip}\else\minimumskip\vspace{\stretch{1}}\fi
+ \makebox[\linewidth]{%
+ \parbox{\hproportionwebtitle\linewidth}%
+ {\bfseries\color{\webtitle@color}\ifeqforpaper\Large\else
+ \large\fi\centering\webtitle}}\par
+ \ifeqforpaper
+ \vspace{2\baselineskip}\else\minimumskip\vspace{\stretch{1}}\fi
+ \noindent
% \end{macrocode}
% Now place the author (\cs{webauthor})
% \begin{macrocode}
- \noindent\makebox[\linewidth]{%
- \parbox{\hproportionwebauthor\linewidth}%
- {\bfseries\color{\webauthor@color}\ifeqforpaper
- \large\fi\centering\webauthor}}
+ \makebox[\linewidth]{%
+ \parbox{\hproportionwebauthor\linewidth}%
+ {\bfseries\color{\webauthor@color}\ifeqforpaper
+ \large\fi\centering\webauthor}}
}
% \end{macrocode}
% \end{macro}
@@ -1958,39 +1920,36 @@
\newcommand{\allowHeadingsTitlePage}{\let\web@titlepagestyle\@gobble}
\def\web@titlepagestyle#1{#1}
\newcommand{\coverpagemargin}{1in}
-\newcommand{\maketitlepreamble}
-{%
- \web@titlepagestyle{\thispagestyle{empty}}%
- \ifeqforpaper\if@centertitlepage
- \begingroup
+\newcommand{\maketitlepreamble}{%
+ \web@titlepagestyle{\thispagestyle{empty}}%
+ \ifeqforpaper\if@centertitlepage
+ \begingroup % closes in \maketitlepostamble
% \end{macrocode}
% We center the content on the title page, much better than before.
% \changes{v4.4}{2012/08/26}{No code to center the cover page content.}
% \begin{macrocode}
- \if@centertitlepagefull
- \@tempdima=\coverpagemargin
- \else
- \@tempdima\paperwidth
- \advance\@tempdima-\textwidth
- \@tempdima=.5\@tempdima
- \edef\coverpagemargin{\the\@tempdima}%
- \fi
- \@tempdimb\paperwidth
- \addtolength{\@tempdimb}{-2\@tempdima}%
- \edef\fullscreenwidth{\the\@tempdimb}%
- \linewidth\fullscreenwidth
- \textwidth\fullscreenwidth
- \hfuzz\linewidth
- \setlength{\oddsidemargin}{\coverpagemargin-1in}%
- \setlength{\evensidemargin}{\oddsidemargin}%
- \marginparsep=0pt
- \marginparwidth=0pt
- \parindent0pt
+ \if@centertitlepagefull
+ \@tempdima=\coverpagemargin
+ \else
+ \@tempdima\paperwidth
+ \advance\@tempdima-\textwidth
+ \@tempdima=.5\@tempdima
+ \edef\coverpagemargin{\the\@tempdima}%
+ \fi
+ \@tempdimb\paperwidth
+ \addtolength{\@tempdimb}{-2\@tempdima}%
+ \edef\fullscreenwidth{\the\@tempdimb}%
+ \linewidth\fullscreenwidth
+ \textwidth\fullscreenwidth
+ \hfuzz\linewidth
+ \setlength{\oddsidemargin}{\coverpagemargin-1in}%
+ \setlength{\evensidemargin}{\oddsidemargin}%
+ \marginparsep=0pt
+ \marginparwidth=0pt
+ \parindent0pt
\fi\fi
}
-\newcommand{\maketitlepostamble}
-{%
- \newpage
+\newcommand{\maketitlepostamble}{\newpage
\ifeqforpaper\if@centertitlepage\endgroup\fi\fi
}
% \end{macrocode}
@@ -2000,40 +1959,39 @@
% Redefining \LaTeX's \cs{maketitle}. Looks a little complicated, but this is only because
% we have the forpaper design as well as the screen design defined here.
% \begin{macrocode}
-\newcommand{\web@maketitle}
-{%
- \maketitlepreamble
- \ifeqforpaper\vspace*{2\baselineskip}\else
+\newcommand{\web@maketitle}{%
+ \maketitlepreamble
+ \ifeqforpaper\vspace*{2\baselineskip}\else
% \end{macrocode}
% If not for paper, restrict title and author to \cs{titleauthorproportion} of the page
% \begin{macrocode}
- \vbox to\titleauthorproportion\textheight\bgroup\fi
+ \vbox to\titleauthorproportion\textheight\bgroup\fi
% \end{macrocode}
% \begin{macrocode}
- \topTitlePage
+ \topTitlePage
% \end{macrocode}
% \begin{macrocode}
- \ifeqforpaper\else\egroup\fi % end of \vbox for title and author
+ \ifeqforpaper\else\egroup\fi % end of \vbox for title and author
% \end{macrocode}
% Now place the \cs{optionalpagematter}
% \begin{macrocode}
- \ifx\optionalpagematter\@empty\par\else
- \begingroup\par
- \aboveOPMvspace
- \noindent\parbox{\linewidth}{\optionalpagematter}%
- \par\endgroup\fi
- \vspace{\stretch{1}}
+ \ifx\optionalpagematter\@empty\par\else
+ \begingroup\par
+ \aboveOPMvspace
+ \noindent\parbox{\linewidth}{\optionalpagematter}%
+ \par\endgroup\fi
+ \vspace{\stretch{1}}
% \end{macrocode}
% Insert the directory, as desired.
% \begin{macrocode}
- \ifx\web@directory@option\web@YES\web@directory@hook\webdirectory\fi
- \par\ifeqforpaper\else\minimumskip\fi\vspace{\stretch{1}}
+ \ifx\web@directory@option\web@YES\web@directory@hook\webdirectory\fi
+ \par\ifeqforpaper\else\minimumskip\fi\vspace{\stretch{1}}
% \end{macrocode}
% Insert the ``bottom matter''.
% \begin{macrocode}
- \vfill\noindent\begingroup
- \trailerFontSize\titlepageTrailer\par\endgroup
- \maketitlepostamble
+ \vfill\noindent\begingroup
+ \trailerFontSize\titlepageTrailer\par\endgroup
+ \maketitlepostamble
}
\let\web@save@maketitle\maketitle
\let\maketitle\web@maketitle
@@ -2046,28 +2004,26 @@
% A convenience command for making a simple in line title.
%}
% \begin{macrocode}
-\newcommand{\makeinlinetitle}
-{%
- \noindent\makebox[\linewidth][c]{%
- \bfseries\color{\webtitle@color}\webtitle}
- \makebox[\linewidth]{%
- \shortstack[l]{\strut\\
- \makebox[0pt][l]{\webuniversity}\\
- \makebox[0pt][l]{%
- \@ifundefined{aeb@prepared}
- {\@date}{\aeb@prepared}%
- }%
- }\hfill
- \shortstack[c]{\strut\webauthor\\\strut}\hfill
- \shortstack[r]{\strut\makebox[0pt][r]{\thewebemail}\\
- \makebox[0pt][r]{%
- \@ifundefined{aeb@talksite}{\webversion}
- {\ifx\aeb@talksite\@empty\webversion
- \else\aeb@talksite\fi}%
- }%
- }%
+\newcommand{\makeinlinetitle}{\noindent
+ \makebox[\linewidth][c]{%
+ \bfseries\color{\webtitle@color}\webtitle}
+ \makebox[\linewidth]{%
+ \shortstack[l]{\strut\\
+ \makebox[0pt][l]{\webuniversity}\\
+ \makebox[0pt][l]{\@ifundefined{aeb@prepared}
+ {\@date}{\aeb@prepared}%
+ }%
+ }\hfill
+ \shortstack[c]{\strut\webauthor\\\strut}\hfill
+ \shortstack[r]{\strut\makebox[0pt][r]{\thewebemail}\\
+ \makebox[0pt][r]{%
+ \@ifundefined{aeb@talksite}{\webversion}
+ {\ifx\aeb@talksite\@empty\webversion
+ \else\aeb@talksite\fi}%
+ }%
}%
- \bigskip
+ }%
+ \bigskip
}
% \end{macrocode}
% \end{macro}
@@ -2079,9 +2035,7 @@
% Try to squeeze a little more in per page.
% \begin{macrocode}
\ifeqforpaper\else
- \clubpenalty=50
- \widowpenalty=50
-\fi
+ \clubpenalty=50 \widowpenalty=50 \fi
% \end{macrocode}
% \subsection{Tight Settings}
%
@@ -2103,142 +2057,142 @@
\def\w@ppp#1#2#3{#1\p@ \@plus#2\p@ \@minus#3\p@}
\def\w@zpp#1#2{\z@ \@plus#1\p@ \@minus#2\p@}
\def\tightsettings@z{%
- \setlength\partopsep{\w@ppp{2}{}{}} % unchanged
- \def\web@listi{\leftmargin\leftmargini
- \parsep \w@ppp{2}{2}{}% 4+2-1
- \topsep \w@ppp{2}{1}{}% 8+2-4
- \itemsep\w@ppp{2}{1}{}}% 4+2-1
- \let\@listi\web@listi
- \let\@listI\@listi
- \@listi
- \def\web@listii {\leftmargin\leftmarginii
- \labelwidth\leftmarginii
- \advance\labelwidth-\labelsep
- \topsep \w@zpp{}{}% 4+2-1
- \parsep \w@zpp{}{}% 2+1-1
- \itemsep \parsep}% unchanged
- \def\web@listiii{\leftmargin\leftmarginiii
- \labelwidth\leftmarginiii
- \advance\labelwidth-\labelsep
- \topsep \w@zpp{}{}% 2+1-1
+ \setlength\partopsep{\w@ppp{2}{}{}} % unchanged
+ \def\web@listi{\leftmargin\leftmargini
+ \parsep \w@ppp{2}{2}{}% 4+2-1
+ \topsep \w@ppp{2}{1}{}% 8+2-4
+ \itemsep\w@ppp{2}{1}{}}% 4+2-1
+ \let\@listi\web@listi
+ \let\@listI\@listi
+ \@listi
+ \def\web@listii {\leftmargin\leftmarginii
+ \labelwidth\leftmarginii
+ \advance\labelwidth-\labelsep
+ \topsep \w@zpp{}{}% 4+2-1
+ \parsep \w@zpp{}{}% 2+1-1
+ \itemsep \parsep}% unchanged
+ \def\web@listiii{\leftmargin\leftmarginiii
+ \labelwidth\leftmarginiii
+ \advance\labelwidth-\labelsep
+ \topsep \w@zpp{}{}% 2+1-1
% \end{macrocode}
% Uncommented text now commented out.
% \changes{v6.0o}{2017/01/20}{Uncommented text, now commented out}
% \begin{macrocode}
- \parsep \z@ % unchanged
- \partopsep \w@ppp{}{}{}% unchanged
- \itemsep \topsep}% unchanged
- \let\@listii\web@listii
- \let\@listiii\web@listiii
- \renewcommand\web@normalsize{%
- \@setfontsize\normalsize\@xpt\@xiipt
- \abovedisplayskip \w@ppp{5}{3}{}% 10+2-5
- \abovedisplayshortskip \w@zpp{3}{0}% unchanged
- \belowdisplayshortskip \w@ppp{3}{2}{2}% 6+3-3
- \belowdisplayskip \abovedisplayskip
- \let\@listi\@listI}%
- \let\normalsize\web@normalsize
- \normalsize
+ \parsep \z@ % unchanged
+ \partopsep \w@ppp{}{}{}% unchanged
+ \itemsep \topsep
+ }% unchanged
+ \let\@listii\web@listii
+ \let\@listiii\web@listiii
+ \renewcommand\web@normalsize{%
+ \@setfontsize\normalsize\@xpt\@xiipt
+ \abovedisplayskip \w@ppp{5}{3}{}% 10+2-5
+ \abovedisplayshortskip \w@zpp{3}{0}% unchanged
+ \belowdisplayshortskip \w@ppp{3}{2}{2}% 6+3-3
+ \belowdisplayskip \abovedisplayskip
+ \let\@listi\@listI}%
+ \let\normalsize\web@normalsize
+ \normalsize
}
% \end{macrocode}
% \paragraph*{Tight settings for \texttt{11pt}}
% \begin{macrocode}
\def\tightsettings@i{%
- \setlength\partopsep{\w@ppp{2}{}{}}% 3+1-1
- \def\web@listi{\leftmargin\leftmargini
- \parsep \w@ppp{2.5}{2}{}% 4.5+2-1
- \topsep \w@ppp{4.5}{1.5}{2.5}% 9+3-5
- \itemsep \w@ppp{2.5}{}{}}% 4.5+2-1
- \let\@listi\web@listi
- \let\@listI\@listi
- \@listi
- \def\web@listii {\leftmargin\leftmarginii
- \labelwidth\leftmarginii
- \advance\labelwidth-\labelsep
- \topsep \w@ppp{}{}{}% 4.5+2-1
- \parsep \w@ppp{}{}{}% 2+1-1
- \itemsep \parsep}% unchanged
- \def\web@listiii{\leftmargin\leftmarginiii
- \labelwidth\leftmarginiii
- \advance\labelwidth-\labelsep
- \topsep \w@ppp{}{}{}% 2+1-1
- \parsep \z@ % unchanged
- \partopsep \w@ppp{}{}{}% unchanged
- \itemsep \topsep}% unchanged
- \let\@listii\web@listii
- \let\@listiii\web@listiii
- \renewcommand\web@normalsize{%
- \@setfontsize\normalsize\@xipt{13.6}%
- \abovedisplayskip \w@ppp{5.5}{3}{3}% 11+3-6
- \abovedisplayshortskip \w@zpp{}{0}% unchanged
- \belowdisplayshortskip \w@ppp{4}{2}{2}% 6.5+3.5-3
- \belowdisplayskip \abovedisplayskip
- \let\@listi\@listI}%
- \let\normalsize\web@normalsize
- \normalsize
+ \setlength\partopsep{\w@ppp{2}{}{}}% 3+1-1
+ \def\web@listi{\leftmargin\leftmargini
+ \parsep \w@ppp{2.5}{2}{}% 4.5+2-1
+ \topsep \w@ppp{4.5}{1.5}{2.5}% 9+3-5
+ \itemsep \w@ppp{2.5}{}{}}% 4.5+2-1
+ \let\@listi\web@listi
+ \let\@listI\@listi
+ \@listi
+ \def\web@listii {\leftmargin\leftmarginii
+ \labelwidth\leftmarginii
+ \advance\labelwidth-\labelsep
+ \topsep \w@ppp{}{}{}% 4.5+2-1
+ \parsep \w@ppp{}{}{}% 2+1-1
+ \itemsep \parsep}% unchanged
+ \def\web@listiii{\leftmargin\leftmarginiii
+ \labelwidth\leftmarginiii
+ \advance\labelwidth-\labelsep
+ \topsep \w@ppp{}{}{}% 2+1-1
+ \parsep \z@ % unchanged
+ \partopsep \w@ppp{}{}{}% unchanged
+ \itemsep \topsep}% unchanged
+ \let\@listii\web@listii
+ \let\@listiii\web@listiii
+ \renewcommand\web@normalsize{%
+ \@setfontsize\normalsize\@xipt{13.6}%
+ \abovedisplayskip \w@ppp{5.5}{3}{3}% 11+3-6
+ \abovedisplayshortskip \w@zpp{}{0}% unchanged
+ \belowdisplayshortskip \w@ppp{4}{2}{2}% 6.5+3.5-3
+ \belowdisplayskip \abovedisplayskip
+ \let\@listi\@listI}%
+ \let\normalsize\web@normalsize
+ \normalsize
}
% \end{macrocode}
% \paragraph*{Tight settings for \texttt{12pt}}
% \begin{macrocode}
\def\tightsettings@ii{%
- \setlength\partopsep{\w@ppp{3}{2}{2}}% unchanged
- \def\web@listi{\leftmargin\leftmargini
- \parsep \w@ppp{3}{2}{}% 5+2.5-1
- \topsep \w@ppp{5}{2}{3}% 10+4-6
- \itemsep\w@ppp{2.5}{}{}}% 5+2.5-1
- \let\@listi\web@listi
- \let\@listI\@listi
- \@listi
- \def\web@listii {\leftmargin\leftmarginii
- \labelwidth\leftmarginii
- \advance\labelwidth-\labelsep
- \topsep \w@ppp{2.5}{}{}% 5+2.5-1
- \parsep \w@ppp{2}{}{}% 2.5+1-1
- \itemsep \parsep}% unchanged
- \def\web@listiii{\leftmargin\leftmarginiii
- \labelwidth\leftmarginiii
- \advance\labelwidth-\labelsep
- \topsep \w@ppp{1.5}{}{}% 2.5+1-1
- \parsep \z@ % unchanged
- \partopsep \w@ppp{}{}{}% unchanged
- \itemsep \topsep}% unchanged
- \let\@listii\web@listii
- \let\@listiii\web@listiii
- \renewcommand\web@normalsize{%
- \@setfontsize\normalsize\@xiipt{14.5}%
- \abovedisplayskip \w@ppp{6}{1.5}{3.5}% 12+3-7
- \abovedisplayshortskip \w@zpp{3}{0}% unchanged
- \belowdisplayshortskip \w@ppp{4}{2}{2}% 6.5+3.5-3
- \belowdisplayskip \abovedisplayskip
- \let\@listi\@listI}%
- \let\normalsize\web@normalsize
- \normalsize
+ \setlength\partopsep{\w@ppp{3}{2}{2}}% unchanged
+ \def\web@listi{\leftmargin\leftmargini
+ \parsep \w@ppp{3}{2}{}% 5+2.5-1
+ \topsep \w@ppp{5}{2}{3}% 10+4-6
+ \itemsep\w@ppp{2.5}{}{}}% 5+2.5-1
+ \let\@listi\web@listi
+ \let\@listI\@listi
+ \@listi
+ \def\web@listii {\leftmargin\leftmarginii
+ \labelwidth\leftmarginii
+ \advance\labelwidth-\labelsep
+ \topsep \w@ppp{2.5}{}{}% 5+2.5-1
+ \parsep \w@ppp{2}{}{}% 2.5+1-1
+ \itemsep \parsep}% unchanged
+ \def\web@listiii{\leftmargin\leftmarginiii
+ \labelwidth\leftmarginiii
+ \advance\labelwidth-\labelsep
+ \topsep \w@ppp{1.5}{}{}% 2.5+1-1
+ \parsep \z@ % unchanged
+ \partopsep \w@ppp{}{}{}% unchanged
+ \itemsep \topsep}% unchanged
+ \let\@listii\web@listii
+ \let\@listiii\web@listiii
+ \renewcommand\web@normalsize{%
+ \@setfontsize\normalsize\@xiipt{14.5}%
+ \abovedisplayskip \w@ppp{6}{1.5}{3.5}% 12+3-7
+ \abovedisplayshortskip \w@zpp{3}{0}% unchanged
+ \belowdisplayshortskip \w@ppp{4}{2}{2}% 6.5+3.5-3
+ \belowdisplayskip \abovedisplayskip
+ \let\@listi\@listI}%
+ \let\normalsize\web@normalsize
+ \normalsize
}
% \end{macrocode}
% Select \DescribeMacro{\tightsettings}\cs{tightsettings} according to point size
% \begin{macrocode}
\def\tightsettings{\@ifstar{\ifeqforpaper\else\tightsettings@cont\fi}
- {\tightsettings@cont}}
+ {\tightsettings@cont}}
\def\tightsettings@cont{\let\web@tight\web@YES
- \ifcase\@ptsize
- \tightsettings@z\or
- \tightsettings@i\or
- \tightsettings@ii
- \fi
+ \ifcase\@ptsize
+ \tightsettings@z\or
+ \tightsettings@i\or
+ \tightsettings@ii\fi
}
% \end{macrocode}
% Restore to normal document class settings using
% \DescribeMacro{\restorenormalsettings}\cs{restorenormalsettings}.
% \begin{macrocode}
\def\restorenormalsettings{\let\web@tight\web@NO
- \let\@listi\web@save@listi
- \let\@listii\web@save@listii
- \let\@listiii\web@save@listiii
- \let\normalsize\web@save@normalsize
- \let\partopsep\web@save@partopsep
- \let\@listI\@listi
- \@listi
- \normalsize
+ \let\@listi\web@save@listi
+ \let\@listii\web@save@listii
+ \let\@listiii\web@save@listiii
+ \let\normalsize\web@save@normalsize
+ \let\partopsep\web@save@partopsep
+ \let\@listI\@listi
+ \@listi
+ \normalsize
}
% \end{macrocode}
% \subsection{Navgation Aids}
@@ -2259,15 +2213,14 @@
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
-\newcommand{\newNaviIcon}[1][\@empty]
-{%
- \ifx#1m\let\web@next\@newNaviIconMenu
- \else\ifx#1j\let\web@next\@newNaviIconJS
- \else\ifx#1l\let\web@next\@newNaviIconLink
- \else\ifx#1\@empty\let\web@next\@newNaviIconLink
- \else\let\web@next\relax
- \PackageWarning{web}{\string\newNaviIcon: unknown first parameter}
- \fi\fi\fi\fi\web@next
+\newcommand{\newNaviIcon}[1][\@empty]{%
+ \ifx#1m\let\web@next\@newNaviIconMenu
+ \else\ifx#1j\let\web@next\@newNaviIconJS
+ \else\ifx#1l\let\web@next\@newNaviIconLink
+ \else\ifx#1\@empty\let\web@next\@newNaviIconLink
+ \else\let\web@next\relax
+ \PackageWarning{web}{\string\newNaviIcon: unknown first parameter}
+ \fi\fi\fi\fi\web@next
}
% \end{macrocode}
% \begin{macro}{\@newNaviIconMenu}
@@ -2287,15 +2240,14 @@
% is determined by \cs{@menuBgColor}.
% \begin{macrocode}
\def\web@colorbox@w@transparency#1{%
- \ifx#1\@empty\setlength{\fboxrule}{0pt}\let\aeb@next\fbox\else
- \def\aeb@next{\colorbox{#1}}\fi\aeb@next}
-\newcommand{\@newNaviIconMenu}[6][I]
-{%
- \def#2{{\setlength{\fboxsep}{0pt}\def\@pdfhighlight{/#1}%
- \Acrobatmenu{#6}{\web@colorbox@w@transparency{\@menuBgColor}{%
- \parbox[c][#4][c]{#3}%
- {\normalsize\centering\color{\@menucolor}#5}}}%
- }}%
+ \ifx#1\@empty\setlength{\fboxrule}{0pt}\let\aeb@next\fbox\else
+ \def\aeb@next{\colorbox{#1}}\fi\aeb@next}
+\newcommand{\@newNaviIconMenu}[6][I]{%
+ \def#2{{\setlength{\fboxsep}{0pt}\def\@pdfhighlight{/#1}%
+ \Acrobatmenu{#6}{\web@colorbox@w@transparency{\@menuBgColor}{%
+ \parbox[c][#4][c]{#3}%
+ {\normalsize\centering\color{\@menucolor}#5}}}%
+ }}%
}
% \end{macrocode}
% \end{macro}
@@ -2314,44 +2266,43 @@
% The color of the text is controlled by \cs{navibarTextColor}, and the background color
% is determined by \cs{@menuBgColor}.
% \begin{macrocode}
-\newcommand{\@newNaviIconJS}[6][I]
-{%
- \ifcase\eq@drivernum
- \def#2{{\setlength{\fboxsep}{0pt}%
- \pdf@rect{\web@colorbox@w@transparency{\@menuBgColor}%
- {\parbox[c][#4][c]{#3}%
- {\normalsize\centering\color{\@menucolor}#5}}}%
- \literalps@out{%
- [ /Rect [pdf@llx pdf@lly pdf@urx pdf@ury]
- /Border [ 0 0 0 ]/H/#1\space
- /Action <</S/JavaScript/JS (#6) >>
- /Subtype/Link
- /ANN pdfmark}%
- }}%
- \or
- \def#2{{\setlength{\fboxsep}{0pt}%
- \leavevmode\pdfstartlink
- attr {/Border [0 0 0 ] /H/#1}%
- user{ /Subtype /Link
- /A << /S/JavaScript/JS (#6) >>}%
- \web@colorbox@w@transparency{\@menuBgColor}%
- {\parbox[c][#4][c]{#3}%
- {\normalsize\centering\color{\@menucolor}#5}}%
- \pdfendlink
- }}%
- \or
- \def#2{{\setlength{\fboxsep}{0pt}%
- \@pdfm@mark{bann
- <<
- /Border [0 0 0 ] /H/#1\space
- /Subtype /Link
- /A << /S/JavaScript/JS (#6) >>
- >>}\web@colorbox@w@transparency{\@menuBgColor}%
- {\parbox[c][#4][c]{#3}%
- {\normalsize\centering\color{\@menucolor}#5}}%
- \@pdfm@mark{eann}%
- }}%
- \fi
+\newcommand{\@newNaviIconJS}[6][I]{%
+ \ifcase\eq@drivernum
+ \def#2{{\setlength{\fboxsep}{0pt}%
+ \pdf@rect{\web@colorbox@w@transparency{\@menuBgColor}%
+ {\parbox[c][#4][c]{#3}%
+ {\normalsize\centering\color{\@menucolor}#5}}}%
+ \literalps@out{%
+ [ /Rect [pdf@llx pdf@lly pdf@urx pdf@ury]
+ /Border [ 0 0 0 ]/H/#1\space
+ /Action <</S/JavaScript/JS (#6) >>
+ /Subtype/Link
+ /ANN pdfmark}%
+ }}%
+ \or
+ \def#2{{\setlength{\fboxsep}{0pt}%
+ \leavevmode\pdfstartlink
+ attr {/Border [0 0 0 ] /H/#1}%
+ user{ /Subtype /Link
+ /A << /S/JavaScript/JS (#6) >>}%
+ \web@colorbox@w@transparency{\@menuBgColor}%
+ {\parbox[c][#4][c]{#3}%
+ {\normalsize\centering\color{\@menucolor}#5}}%
+ \pdfendlink
+ }}%
+ \or
+ \def#2{{\setlength{\fboxsep}{0pt}%
+ \@pdfm@mark{bann
+ <<
+ /Border [0 0 0 ] /H/#1\space
+ /Subtype /Link
+ /A << /S/JavaScript/JS (#6) >>
+ >>}\web@colorbox@w@transparency{\@menuBgColor}%
+ {\parbox[c][#4][c]{#3}%
+ {\normalsize\centering\color{\@menucolor}#5}}%
+ \@pdfm@mark{eann}%
+ }}%
+ \fi
}
% \end{macrocode}
% \end{macro}
@@ -2374,13 +2325,12 @@
% The color of the text is controlled by \cs{navibarTextColor}, and the background color
% is determined by \cs{@menuBgColor}.
% \begin{macrocode}
-\newcommand{\@newNaviIconLink}[6][I]
-{%
- \def#2{{\setlength{\fboxsep}{0pt}\def\@pdfhighlight{/#1}%
- #6{\web@colorbox@w@transparency{\@menuBgColor}%
- {\parbox[c][#4][c]{#3}%
- {\normalsize\centering\color{\@menucolor}#5}}}%
- }}%
+\newcommand{\@newNaviIconLink}[6][I]{%
+ \def#2{{\setlength{\fboxsep}{0pt}\def\@pdfhighlight{/#1}%
+ #6{\web@colorbox@w@transparency{\@menuBgColor}%
+ {\parbox[c][#4][c]{#3}%
+ {\normalsize\centering\color{\@menucolor}#5}}}%
+ }}%
}
% \end{macrocode}
% \begin{macrocode}
@@ -2388,7 +2338,7 @@
\def\insert@webtoc{\web@TOC\ }
\def\web@TocText{Toc}
\newNaviIcon[l]{\web@TOC}{\web@nb@width}{\web@nb@height}
- {\footnotesize\web@TocText}{\hyperlink{webtoc}}
+ {\footnotesize\web@TocText}{\hyperlink{webtoc}}
% \end{macrocode}
% Some icon definitions that are used in the navigation bar that appears at the bottom of the page.
% \begin{macrocode}
@@ -2396,80 +2346,81 @@
\newcommand\navibariconHeight[1]{\def\web@nb@height{#1}}
\navibariconWidth{34pt}\navibariconHeight{10pt}
\@newNaviIconMenu{\web@FirstPage}{\web@nb@width}{\web@nb@height}
- {\web@FirstPageText}{FirstPage}
+ {\web@FirstPageText}{FirstPage}
\def\web@FirstPageText{$\blacktriangleleft\blacktriangleleft$}
\@newNaviIconMenu{\web@LastPage}{\web@nb@width}{\web@nb@height}
- {\web@LastPageText}{LastPage}
+ {\web@LastPageText}{LastPage}
\def\web@LastPageText{$\blacktriangleright\blacktriangleright$}
\@newNaviIconMenu{\web@PrevPage}{\web@nb@width}{\web@nb@height}
- {\web@PrevPageText}{PrevPage}
+ {\web@PrevPageText}{PrevPage}
\def\web@PrevPageText{$\blacktriangleleft$}
\@newNaviIconMenu{\web@NextPage}{\web@nb@width}{\web@nb@height}
- {\web@NextPageText}{NextPage}
+ {\web@NextPageText}{NextPage}
\def\web@NextPageText{$\blacktriangleright$}
\@newNaviIconMenu{\web@GoBack}{\web@nb@width}{\web@nb@height}
- {\footnotesize\web@back}{GoBack}
+ {\footnotesize\web@back}{GoBack}
\@newNaviIconMenu{\web@GoBackDoc}{\web@nb@width}{\web@nb@height}
- {$\blacktriangleleft$\ \footnotesize\web@doc}{GoBackDoc}
+ {$\blacktriangleleft$\ \footnotesize\web@doc}{GoBackDoc}
\@newNaviIconMenu{\web@GoForwardDoc}{\web@nb@width}{\web@nb@height}
- {\footnotesize\web@doc\ \normalsize$\blacktriangleright$}
- {GoForwardDoc}
+ {\footnotesize\web@doc\ \normalsize$\blacktriangleright$}
+ {GoForwardDoc}
\@newNaviIconMenu{\web@FS}{\web@nb@width}{\web@nb@height}
- {\footnotesize\web@FSText}{FullScreen}
+ {\footnotesize\web@FSText}{FullScreen}
\def\web@FSText{FS}
\@newNaviIconMenu{\web@GoToPage}{\web@nb@width}{\web@nb@height}
- {\footnotesize\web@GoToPageText}{GoToPage}
+ {\footnotesize\web@GoToPageText}{GoToPage}
\def\web@GoToPageText{Page...}
% \end{macrocode}
% \begin{macro}{\web@navigationbar}
% The navigation bar, this can be redefined.
% \begin{macrocode}
\newcommand\web@navigationbar{%
-\hfil\bfseries\footnotesize
-\insertwebtoc
-\web@FirstPage\
-\web@LastPage\
-\web@PrevPage\
-\web@NextPage\
-\web@GoBack
-%\web@GoBackDoc\
-%\web@GoForwardDoc
-\hfil}
+ \hfil\bfseries\footnotesize
+ \insertwebtoc
+ \web@FirstPage\
+ \web@LastPage\
+ \web@PrevPage\
+ \web@NextPage\
+ \web@GoBack
+ %\web@GoBackDoc\
+ %\web@GoForwardDoc
+ \hfil
+}
% \end{macrocode}
% \end{macro}
% Here are some icon buttons for the panel, if a panel is desired.
% \begin{macrocode}
-\newcommand{\panelgroupWidth}[1]{%
- \global\let\chkpanelgroup\web@chkpanelgroup
- \def\web@pg@width{#1}}
-\newcommand{\panelgroupHeight}[1]{%
- \global\let\chkpanelgroup\web@chkpanelgroup
- \def\web@pg@height{#1}}
-\newcommand{\panelgroupSep}[1]{%
- \global\let\chkpanelgroup\web@chkpanelgroup
- \def\web@pg@sep{#1}}
+\newcommand{\panelgroupWidth}[1]{\global
+ \let\chkpanelgroup\web@chkpanelgroup
+ \def\web@pg@width{#1}}
+\newcommand{\panelgroupHeight}[1]{\global
+ \let\chkpanelgroup\web@chkpanelgroup
+ \def\web@pg@height{#1}}
+\newcommand{\panelgroupSep}[1]{\global
+ \let\chkpanelgroup\web@chkpanelgroup
+ \def\web@pg@sep{#1}}
\@newNaviIconMenu{\panel@FirstPage}{\web@pg@width}{\web@pg@height}
- {\web@FirstPageText}{FirstPage}
+ {\web@FirstPageText}{FirstPage}
\@newNaviIconMenu{\panel@LastPage}{\web@pg@width}{\web@pg@height}
- {\web@LastPageText}{LastPage}
+ {\web@LastPageText}{LastPage}
\@newNaviIconMenu{\panel@PrevPage}{\web@pg@width}{\web@pg@height}
- {\web@PrevPageText}{PrevPage}
+ {\web@PrevPageText}{PrevPage}
\@newNaviIconMenu{\panel@NextPage}{\web@pg@width}{\web@pg@height}
- {\web@NextPageText}{NextPage}
+ {\web@NextPageText}{NextPage}
\@newNaviIconMenu{\panel@GoBack}{\web@pg@width}{\web@pg@height}
- {\footnotesize\web@back}{GoBack}
+ {\footnotesize\web@back}{GoBack}
\@newNaviIconMenu{\panel@GoBackDoc}{\web@pg@width}{\web@pg@height}
- {$\blacktriangleleft$\,\footnotesize\web@doc}{GoBackDoc}
+ {$\blacktriangleleft$\,\footnotesize\web@doc}{GoBackDoc}
\@newNaviIconMenu{\panel@GoForwardDoc}{\web@pg@width}{\web@pg@height}
- {\footnotesize\web@doc\,\normalsize$\blacktriangleright$}
- {GoForwardDoc}
+ {\footnotesize\web@doc\,\normalsize$\blacktriangleright$}
+ {GoForwardDoc}
\@newNaviIconMenu{\panel@Close}{\web@pg@width}{\web@pg@height}
- {\footnotesize Close}{Close}
+ {\footnotesize Close}{Close}
\def\web@CloseText{Close}
\@newNaviIconMenu{\panel@FS}{\web@pg@width}{\web@pg@height}
- {\footnotesize\web@FSText}{FullScreen}
+ {\footnotesize\web@FSText}{FullScreen}
\@newNaviIconMenu{\panel@GoToPage}{\web@pg@width}{\web@pg@height}
- {\footnotesize\web@GoToPageText}{GoToPage}
+ {\footnotesize\web@GoToPageText}{GoToPage}
% \end{macrocode}
% A check to see if the panel group is too wide.
% \begin{macrocode}
@@ -2478,7 +2429,8 @@
\ifdim\@tempdima>\@panelwidth\PackageError{web}{Width of
\string\panelNaviGroup\space is wider than the panel}{}\else
\xdef\panelNavigroupWidth{\the\@tempdima}\fi
- \egroup\global\let\chkpanelgroup\@empty
+ \egroup
+ \global\let\chkpanelgroup\@empty
}
\panelgroupWidth{28pt}\panelgroupHeight{15pt}
\panelgroupSep{2pt}
@@ -2487,15 +2439,13 @@
% Standard navigation group for a panel.
% \begin{macrocode}
\newcommand\panelNaviGroup{\chkpanelgroup
- \parbox[c]{\panelNavigroupWidth}{%
- \offinterlineskip
- \panelIconGroup
- }%
-}
+ \parbox[c]{\panelNavigroupWidth}{%
+ \offinterlineskip
+ \panelIconGroup}}
\newcommand{\panelIconGroup}{%
- \panel@FirstPage\hfill\panel@LastPage\\[\panelrowsep]
- \panel@PrevPage\hfill\panel@NextPage\\[\panelrowsep]
- \panel@GoBack\hfill\panel@Close
+ \panel@FirstPage\hfill\panel@LastPage\\[\panelrowsep]
+ \panel@PrevPage\hfill\panel@NextPage\\[\panelrowsep]
+ \panel@GoBack\hfill\panel@Close
}
% \end{macrocode}
% \begin{macro}{\insNaviBar}
@@ -2524,37 +2474,37 @@
% \begin{macrocode}
\def\web@ifOnThisPage#1#2{\ifnum\c@page=\@thispage\relax
#1\else#2\fi}
-\newcommand{\insertnaviiconhere}[1]
-{%
- \xdef\@thispage{\the\c@page}%
- \def\web@insToRight{%
- \ifeqforpaper\makebox[0pt][l]{\ifdim\marginparsep>0pt\relax
- \hspace{\marginparsep}\else\ \fi#1}\else
- \makebox[0pt][l]{%
- \ifnum\@panelconfig=2\relax
- \hspace{\@panelsep}\else
- \hspace{\@Rightmargin}\fi
- \makebox[0pt][r]{#1}}\fi
- }\expandafter\rheader\expandafter
- {\expandafter\web@ifOnThisPage
- \expandafter{\web@rightheader\web@insToRight}%
- {\web@defaultrightheader}}%
+\newcommand{\insertnaviiconhere}[1]{%
+ \xdef\@thispage{\the\c@page}%
+ \def\web@insToRight{%
+ \ifeqforpaper
+ \makebox[0pt][l]{\ifdim\marginparsep>\z@
+ \hspace{\marginparsep}\else\ \fi#1}\else
+ \makebox[0pt][l]{%
+ \ifnum\@panelconfig=\tw@
+ \hspace{\@panelsep}\else
+ \hspace{\@Rightmargin}\fi
+ \makebox[0pt][r]{#1}}\fi
+ }\expandafter\rheader\expandafter
+ {\expandafter\web@ifOnThisPage
+ \expandafter{\web@rightheader\web@insToRight}%
+ {\web@defaultrightheader}}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\insertnaviiconhereafter}
% Inserts a direction icon on the current page, and every page thereafter.
% \begin{macrocode}
-%\def\insertnaviiconhereafter#1{\lheader{#1}}
\def\insertnaviiconhereafter#1{\def\web@insToLeft{%
- \ifeqforpaper\makebox[0pt][r]{#1\ifdim\marginparsep>0pt\relax
- \hspace{\marginparsep}\else\ \fi}\else
+ \ifeqforpaper
+ \makebox[0pt][r]{#1\ifdim\marginparsep>\z@
+ \hspace{\marginparsep}\else\ \fi}\else
\makebox[0pt][r]{\makebox[0pt][l]{#1}%
- \ifnum\@panelconfig=1\relax
- \hspace{\@panelsep}\else
- \hspace{\@Leftmargin}\fi}\fi
- }\expandafter\lheader\expandafter
- {\expandafter\web@insToLeft\web@lhead}}
+ \ifnum\@panelconfig=\@ne
+ \hspace{\@panelsep}\else
+ \hspace{\@Leftmargin}\fi}\fi
+ }\expandafter\lheader\expandafter
+ {\expandafter\web@insToLeft\web@lhead}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\removehereaftericon}
@@ -2571,23 +2521,21 @@
%\insertnaviiconhere{\ArrowUp{\href{http://www.adobe.com/}}}
%\end{verbatim}
% \begin{macrocode}
-\newcommand\ArrowUp[1]
-{%
- \normalsize\ifeqforpaper
- \setlength{\fboxsep}{6pt}\else
- \setlength{\fboxsep}{4pt}\fi
- \raisebox{\depth-\fboxsep}[0pt][0pt]{%
- #1{\web@colorbox@w@transparency{\web@directionIconBgColor}%
- {\textcolor{\web@directionIconTextColor}{$\bigl\Uparrow$}}}}%
-}
-\newcommand\ArrowDown[1]
-{%
- \normalsize\ifeqforpaper
- \setlength{\fboxsep}{6pt}\else
- \setlength{\fboxsep}{4pt}\fi
- \raisebox{\depth-\fboxsep}[0pt][0pt]{%
- #1{\web@colorbox@w@transparency{\web@directionIconBgColor}%
- {\textcolor{\web@directionIconTextColor}{$\bigl\Downarrow$}}}}%
+\newcommand\ArrowUp[1]{%
+ \normalsize\ifeqforpaper
+ \setlength{\fboxsep}{6pt}\else
+ \setlength{\fboxsep}{4pt}\fi
+ \raisebox{\depth-\fboxsep}[0pt][0pt]{%
+ #1{\web@colorbox@w@transparency{\web@directionIconBgColor}%
+ {\textcolor{\web@directionIconTextColor}{$\bigl\Uparrow$}}}}%
+}
+\newcommand\ArrowDown[1]{%
+ \normalsize\ifeqforpaper
+ \setlength{\fboxsep}{6pt}\else
+ \setlength{\fboxsep}{4pt}\fi
+ \raisebox{\depth-\fboxsep}[0pt][0pt]{%
+ #1{\web@colorbox@w@transparency{\web@directionIconBgColor}%
+ {\textcolor{\web@directionIconTextColor}{$\bigl\Downarrow$}}}}%
}
% \end{macrocode}
% \end{macro}
@@ -2657,25 +2605,25 @@
% Here we offer a simple mechanism for saving and restoring running headers.
% \begin{macrocode}
\newcommand{\clearHeaders}{%
- \let\web@lhead@save\web@lhead
- \let\web@chead@save\web@chead
- \let\web@rightheader@save\web@rightheader
- \let\web@lhead\@empty\let\web@chead\@empty
- \let\web@rightheader\@empty}
+ \let\web@lhead@save\web@lhead
+ \let\web@chead@save\web@chead
+ \let\web@rightheader@save\web@rightheader
+ \let\web@lhead\@empty\let\web@chead\@empty
+ \let\web@rightheader\@empty}
\newcommand{\restoreHeaders}{%
- \let\web@lhead\web@lhead@save
- \let\web@chead\web@chead@save
- \let\web@rightheader\web@rightheader@save}
+ \let\web@lhead\web@lhead@save
+ \let\web@chead\web@chead@save
+ \let\web@rightheader\web@rightheader@save}
\newcommand{\clearFooters}{%
- \let\web@lfoot@save\web@lfoot
- \let\web@cfoot@save\web@cfoot
- \let\web@rfoot@save\web@lfoot
- \let\web@lfoot\@empty\let\web@cfoot\@empty
- \let\web@rfoot\@empty}
+ \let\web@lfoot@save\web@lfoot
+ \let\web@cfoot@save\web@cfoot
+ \let\web@rfoot@save\web@lfoot
+ \let\web@lfoot\@empty\let\web@cfoot\@empty
+ \let\web@rfoot\@empty}
\newcommand{\restoreFooters}{%
- \let\web@lfoot\web@lfoot@save
- \let\web@cfoot\web@cfoot@save
- \let\web@rfoot\web@rfoot@save}
+ \let\web@lfoot\web@lfoot@save
+ \let\web@cfoot\web@cfoot@save
+ \let\web@rfoot\web@rfoot@save}
% \end{macrocode}
% You can use this command to insert additional formatting into the running header.
% For example, \verb!\headerformat{\bfseries\color{red}}!.
@@ -2700,18 +2648,17 @@
\let\webfootwrapper\@empty
\newcommand{\headWrapper}[1]{\def\webheadwrapper##1{#1}}
\newcommand{\footWrapper}[1]{\def\webfootwrapper##1{#1}}
-\newcommand{\ps@webheadings}
-{%
- \renewcommand{\@oddhead}{\webheadwrapper{%
- \normalfont\ifeqforpaper\else\footnotesize\fi
- \web@headerprivate\web@headerhook\web@lhead\hfil\web@chead\hfil
- \web@rightheader}}
- \renewcommand{\@evenhead}{\@oddhead}
- \renewcommand{\@oddfoot}{\webfootwrapper{%
- \normalfont\ifeqforpaper\else\footnotesize\fi
- \web@footerprivate\web@footerhook\web@lfoot\hfil
- \web@cfoot\hfil\web@rfoot}}
- \renewcommand{\@evenfoot}{\@oddfoot}
+\newcommand{\ps@webheadings}{%
+ \renewcommand{\@oddhead}{\webheadwrapper{%
+ \normalfont\ifeqforpaper\else\footnotesize\fi
+ \web@headerprivate\web@headerhook\web@lhead\hfil\web@chead\hfil
+ \web@rightheader}}
+ \renewcommand{\@evenhead}{\@oddhead}
+ \renewcommand{\@oddfoot}{\webfootwrapper{%
+ \normalfont\ifeqforpaper\else\footnotesize\fi
+ \web@footerprivate\web@footerhook\web@lfoot\hfil
+ \web@cfoot\hfil\web@rfoot}}
+ \renewcommand{\@evenfoot}{\@oddfoot}
}
% \end{macrocode}
% \end{macro}
@@ -2719,7 +2666,7 @@
% header
% \begin{macrocode}
\renewcommand{\sectionmark}[1]{%
- \markboth{}{\web@section\ \thesection: #1}}
+ \markboth{}{\web@section\ \thesection: #1}}
% \end{macrocode}
% \begin{macro}{\noHeadersOnSectionPage}
% \begin{macro}{\headersOnSectionPage}
@@ -2739,18 +2686,18 @@
% on the same page as the beginning of a section.
% \begin{macrocode}
\newcommand{\noHeadersOnSectionPage}{%
- \gdef\web@headerpolicy{%
- \expandafter\aeb@gettopmark\topmark{}{}%
- \expandafter\aeb@getbotmark\botmark{}{}%
- \ifx\aeb@topmark\aeb@botmark\rightmark\fi
- }%
+ \gdef\web@headerpolicy{%
+ \expandafter\aeb@gettopmark\topmark{}{}%
+ \expandafter\aeb@getbotmark\botmark{}{}%
+ \ifx\aeb@topmark\aeb@botmark\rightmark\fi
+ }%
}
% \end{macrocode}
% The default is to show no headers on a page with a section in it.
% \begin{macrocode}
\noHeadersOnSectionPage
\newcommand{\headersOnSectionPage}{%
- \gdef\web@headerpolicy{\rightmark}%
+ \gdef\web@headerpolicy{\rightmark}%
}
\def\aeb@gettopmark#1#2{\def\aeb@topmark{#2}}
\def\aeb@getbotmark#1#2{\def\aeb@botmark{#2}}
@@ -2768,10 +2715,10 @@
% \changes{v4.4a}{2012/08/31}{Introduce \string\cs{ifweb@sectioning} switch}
% \begin{macrocode}
\newcommand{\sectionColor}[1]{\def\web@sectionsColorOld{#1}
- \def\aeb@sectioncolor{#1}}
+ \def\aeb@sectioncolor{#1}}
\sectionColor{blue}
\def\web@inputsectiondefs{\InputIfFileExists{websec.def}{}
- {\PackageError{web}{Cannot find the file websec.def}{}}
+ {\PackageError{web}{Cannot find the file websec.def}{}}
}
\ifweb@sectioning\expandafter\web@inputsectiondefs\fi
%</package>
@@ -2780,26 +2727,26 @@
\renewcommand*\thesubsection{\thesection.\arabic{subsection}}
\renewcommand*{\thesubsubsection}{\textbullet}
\renewcommand{\section}{\renewcommand{\@seccntformat}[1]{%
- \@nameuse{the##1}\web@finalDot\enspace}%
- \@startsection{section}{1}{\z@}%
- {-3ex\@plus -1ex \@minus-.2ex}%
- {1ex\@plus .2ex}% 6pt
- {\noindent\normalfont\normalsize\bfseries
- \color{\web@sectionsColorOld}}}%
+ \@nameuse{the##1}\web@finalDot\enspace}%
+ \@startsection{section}{1}{\z@}%
+ {-3ex\@plus -1ex \@minus-.2ex}%
+ {1ex\@plus .2ex}% 6pt
+ {\noindent\normalfont\normalsize\bfseries
+ \color{\web@sectionsColorOld}}}%
\renewcommand{\subsection}{\renewcommand{\@seccntformat}[1]{%
- \@nameuse{the##1}\web@finalDot\enspace}%
- \@startsection{subsection}{2}{\z@}%
- {-2.5ex\@plus -1ex \@minus -.2ex}%
- {1ex\@plus .2ex}%
- {\noindent\normalfont\normalsize\bfseries
- \color{\web@sectionsColorOld}}}
+ \@nameuse{the##1}\web@finalDot\enspace}%
+ \@startsection{subsection}{2}{\z@}%
+ {-2.5ex\@plus -1ex \@minus -.2ex}%
+ {1ex\@plus .2ex}%
+ {\noindent\normalfont\normalsize\bfseries
+ \color{\web@sectionsColorOld}}}
\renewcommand{\subsubsection}{%
- \renewcommand{\@seccntformat}[1]{\color{\web@sectionsColorOld}\large
- $\bullet$\enspace}%
- \@startsection{subsubsection}{3}{\z@}%
- {-2ex\@plus -1ex \@minus -.2ex}%
- {.5ex\@plus .2ex}%
- {\noindent\normalfont\normalsize\bfseries}}
+ \renewcommand{\@seccntformat}[1]{\color{\web@sectionsColorOld}\large
+ $\bullet$\enspace}%
+ \@startsection{subsubsection}{3}{\z@}%
+ {-2ex\@plus -1ex \@minus -.2ex}%
+ {.5ex\@plus .2ex}%
+ {\noindent\normalfont\normalsize\bfseries}}
% \end{macrocode}
% We define our own \cs{part} command, and reserve it as \cs{@webpart}.
% Commands for handing the \cs{part} format. The formatting of
@@ -2808,8 +2755,7 @@
\def\tocPartTitle#1{\def\web@tocPartTitle##1{#1}}
\tocPartTitle{\thepart\hspace{1em}#1}
\newcommand\@webpart{\secdef\web@@part\web@@spart}
-\def\web@@part[#1]#2{%
- \newpage
+\def\web@@part[#1]#2{\newpage
\def\@currentlabelname{#1}%
\ifnum\Hy@secnum@part>\c@secnumdepth
\phantomsection
@@ -2826,14 +2772,13 @@
\@afterheading
}
\def\web@@spart#1{%
- \Hy@GlobalStepCount\Hy@linkcounter
- \xdef\@currentHref{part*.\the\Hy@linkcounter}%
- \Hy@raisedlink{%
- \hyper@anchorstart{\@currentHref}\hyper@anchorend
- }{\web@makesparthead{#1}}%
- \nobreak
- \vskip 1ex
- \@afterheading
+ \Hy@GlobalStepCount\Hy@linkcounter
+ \xdef\@currentHref{part*.\the\Hy@linkcounter}%
+ \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend
+ }{\web@makesparthead{#1}}%
+ \nobreak
+ \vskip 1ex
+ \@afterheading
}
\let\web@save@part\part
\let\part\@webpart
@@ -2846,29 +2791,28 @@
% looks in the document.
% \begin{macrocode}
\newcommand{\formatPartTitle}[1]{%
- \def\web@formatPartTitle##1{#1}}
-\def\web@defaultFormatPartTitle#1{%
- \large\bfseries
- \ifnum \c@secnumdepth >\m@ne
- \partname~\thepart:\space
- \fi#1}
+ \def\web@formatPartTitle##1{#1}}
+\def\web@defaultFormatPartTitle#1{\large\bfseries
+ \ifnum \c@secnumdepth >\m@ne
+ \partname~\thepart:\space
+ \fi#1}
\let\web@formatPartTitle\web@defaultFormatPartTitle
\newcommand{\restorePartTitleFormat}{%
- \let\web@formatPartTitle\web@defaultFormatPartTitle}
+ \let\web@formatPartTitle\web@defaultFormatPartTitle}
\def\noPartNumbers{\formatPartTitle{\large\bfseries##1}%
- \tocPartTitle{##1}}
+ \tocPartTitle{##1}}
\def\web@makeparthead#1{%
- \parindent\z@\raggedright
- \interlinepenalty \@M
- \normalfont
- \web@formatPartTitle{#1}%
- \markboth{}{}\par
+ \parindent\z@\raggedright
+ \interlinepenalty \@M
+ \normalfont
+ \web@formatPartTitle{#1}%
+ \markboth{}{}\par
}
\def\web@makesparthead#1{%
- \parindent\z@\raggedright
- \interlinepenalty \@M
- \normalfont
- \large\bfseries #1\par
+ \parindent\z@\raggedright
+ \interlinepenalty \@M
+ \normalfont
+ \large\bfseries #1\par
}
% \end{macrocode}
% \end{macro}
@@ -2878,94 +2822,91 @@
% Here's the same thing for \cs{chapter}.
% \begin{macrocode}
\@ifundefined{chapter}{}{%
- \newcommand\@webchapter{%
- \global\@topnum\z@
- \@afterindentfalse
- \secdef\web@@chapter\web@@schapter
- }
- \let\web@save@chapter\chapter
- \let\chapter\@webchapter
- \def\web@@chapter[#1]#2{%
- \def\@currentlabelname{#1}%
- \def\Hy@next{%
- \Hy@GlobalStepCount\Hy@linkcounter
- \xdef\@currentHref{\Hy@chapapp*.\the\Hy@linkcounter}%
- \Hy@raisedlink{%
- \hyper@anchorstart{\@currentHref}\hyper@anchorend
- }%
- }%
- \ifnum\c@secnumdepth>\m@ne
- \@ifundefined{if@mainmatter}%
- \iftrue{\@nameuse{if@mainmatter}}%
- \let\Hy@next\relax
- \fi
- \fi
- \Hy@next
- \ifnum \c@secnumdepth >\m@ne
- \if@mainmatter
- \refstepcounter{chapter}%
- \typeout{\@chapapp\space\thechapter.}%
- \addcontentsline{toc}{chapter}%
- {\protect\numberline{\thechapter}#1}%
- \else
- \addcontentsline{toc}{chapter}{{}{}#1}%
- \fi
- \else
- \addcontentsline{toc}{chapter}{{}{}#1}%
- \fi
- \chaptermark{#1}%
- \addtocontents{lof}{\protect\addvspace{10\p@}}%
- \addtocontents{lot}{\protect\addvspace{10\p@}}%
- \if@twocolumn
- \@topnewpage[\web@makechapterhead{#2}]%
- \else
- \web@makechapterhead{#2}%
- \@afterheading
- \fi
- }
- \def\web@@schapter#1{%
- \if@twocolumn
- \@topnewpage[\@makeschapterhead{#1}]%
- \else
- \web@makeschapterhead{#1}%
- \@afterheading
- \fi
- }
+ \newcommand\@webchapter{%
+ \global\@topnum\z@
+ \@afterindentfalse
+ \secdef\web@@chapter\web@@schapter
+ }
+ \let\web@save@chapter\chapter
+ \let\chapter\@webchapter
+ \def\web@@chapter[#1]#2{%
+ \def\@currentlabelname{#1}%
+ \def\Hy@next{%
+ \Hy@GlobalStepCount\Hy@linkcounter
+ \xdef\@currentHref{\Hy@chapapp*.\the\Hy@linkcounter}%
+ \Hy@raisedlink{%
+ \hyper@anchorstart{\@currentHref}\hyper@anchorend
+ }%
+ }%
+ \ifnum\c@secnumdepth>\m@ne
+ \@ifundefined{if@mainmatter}%
+ \iftrue{\@nameuse{if@mainmatter}}%
+ \let\Hy@next\relax
+ \fi
+ \fi
+ \Hy@next
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \refstepcounter{chapter}%
+ \typeout{\@chapapp\space\thechapter.}%
+ \addcontentsline{toc}{chapter}%
+ {\protect\numberline{\thechapter}#1}%
+ \else
+ \addcontentsline{toc}{chapter}{{}{}#1}%
+ \fi
+ \else
+ \addcontentsline{toc}{chapter}{{}{}#1}%
+ \fi
+ \chaptermark{#1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\web@makechapterhead{#2}]%
+ \else
+ \web@makechapterhead{#2}%
+ \@afterheading
+ \fi
+ }
+ \def\web@@schapter#1{%
+ \if@twocolumn
+ \@topnewpage[\@makeschapterhead{#1}]%
+ \else
+ \web@makeschapterhead{#1}%
+ \@afterheading
+ \fi
+ }
% \end{macrocode}
% \begin{macro}{\web@makechapterhead}
% \begin{macro}{\web@makeschapterhead}
% These commands can be redefined to format who the part text
% looks in the document.
% \begin{macrocode}
- \long\def\formatChapterNumber#1{\def\web@formatChapterNumber{#1}}
- \formatChapterNumber{\large\bfseries
- \@chapapp\space\thechapter\par\nobreak}
- \long\def\formatChapterTitle#1{\def\web@formatChapterTitle##1{#1}}
- \formatChapterTitle{%
- \interlinepenalty\@M
- \noindent\hspace{1em}\large\bfseries#1\par\nobreak
- }
- \def\web@makechapterhead#1{%
- \vspace{3\p@}{%
- \parindent\z@ \raggedright \normalfont
- \ifnum \c@secnumdepth >\m@ne
- \if@mainmatter
- \web@formatChapterNumber
- \fi
- \fi
- \web@formatChapterTitle{#1}%
- \vskip 12\p@
- }%
- }
- \def\web@makeschapterhead#1{%
- \vspace{3\p@}{%
- \parindent\z@\raggedright
- \normalfont
- \interlinepenalty\@M
- \large\bfseries #1\par\nobreak
- \vskip 12\p@
- }%
- }
+ \long\def\formatChapterNumber#1{\def\web@formatChapterNumber{#1}}
+ \formatChapterNumber{\large\bfseries
+ \@chapapp\space\thechapter\par\nobreak}
+ \long\def\formatChapterTitle#1{\def\web@formatChapterTitle##1{#1}}
+ \formatChapterTitle{%
+ \interlinepenalty\@M
+ \noindent\hspace{1em}\large\bfseries#1\par\nobreak
+ }
+ \def\web@makechapterhead#1{%
+ \vspace{3\p@}{%
+ \parindent\z@ \raggedright \normalfont
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter\web@formatChapterNumber\fi
+ \fi
+ \web@formatChapterTitle{#1}\vskip 12\p@
+ }%
+ }
+ \def\web@makeschapterhead#1{%
+ \vspace{3\p@}{%
+ \parindent\z@\raggedright
+ \normalfont
+ \interlinepenalty\@M
+ \large\bfseries #1\par\nobreak
+ \vskip 12\p@
+ }%
+ }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2976,16 +2917,14 @@
% \end{macrocode}
% \begin{macrocode}
\def\aebwritelastpage{%
- \immediate\write\@auxout{%
-% \string\expandafter\string\gdef
-% \string\csname\space aebLastPage\string\endcsname{\arabic{page}}}%
- \string\w@csarg\string\gdef{aebLastPage}{\arabic{page}}}%
+ \immediate\write\@auxout{%
+ \string\w@csarg\string\gdef{aebLastPage}{\arabic{page}}}%
}
% \end{macrocode}
% \begin{macrocode}
\AtEndDocument{%
- \clearpage\addtocounter{page}{-1}\aebwritelastpage
- \addtocounter{page}{1}}
+ \clearpage\addtocounter{page}{-1}\aebwritelastpage
+ \addtocounter{page}{1}}
% \end{macrocode}
% \subsection{\texorpdfstring{\protect\cs{useFullWidthForPaper}}{\CMD{useFullWidthForPaper}}}
%
@@ -3011,12 +2950,12 @@
\def\useFullWidthForPaper{\ifeqforpaper
\setlength{\textwidth}{\paperwidth-2in}
\setlength{\textheight}
- {\paperheight-2in-\footskip-\topmargin-\headheight-\headsep}
+ {\paperheight-2in-\footskip-\topmargin-\headheight-\headsep}
\oddsidemargin=0pt
\evensidemargin=0pt
\marginparsep=0pt
\marginparwidth=0pt
- \fi
+ \fi
}
% \end{macrocode}
% \end{macro}
@@ -3025,23 +2964,24 @@
% option is used, and the \texttt{templatesforpaper} option is not taken.
% \begin{macrocode}
\def\maxtextscreentext{%
- \iftemplatesforpaper\else\ifeqforpaper
- \ifnum\@usetemplates=1
- \ifnum\@panelconfig=1 % left panel
- \setlength{\oddsidemargin}%
- {\@panelwidth+\@panelsep-1in}%
- \setlength{\textwidth}%
- {\paperwidth-\@panelwidth-\@panelsep-%
- \marginparwidth-\marginparsep}%
- \else\ifnum\@panelconfig=2 % right panel
- \setlength{\oddsidemargin}{0in}%
- \setlength{\textwidth}%
- {\paperwidth-\@panelwidth-\@panelsep-%
- \oddsidemargin-\marginparwidth-\marginparsep}%
- \else
- \useFullWidthForPaper
- \fi\fi\fi
- \fi\fi
+ \iftemplatesforpaper\else\ifeqforpaper
+ \ifnum\@usetemplates=\@ne
+ \ifnum\@panelconfig=\@ne % left panel
+ \setlength{\oddsidemargin}%
+ {\@panelwidth+\@panelsep-1in}%
+ \setlength{\textwidth}%
+ {\paperwidth-\@panelwidth-\@panelsep-%
+ \marginparwidth-\marginparsep}%
+ \else
+ \ifnum\@panelconfig=\tw@ % right panel
+ \setlength{\oddsidemargin}{0in}%
+ \setlength{\textwidth}%
+ {\paperwidth-\@panelwidth-\@panelsep-%
+ \oddsidemargin-\marginparwidth-\marginparsep}%
+ \else
+ \useFullWidthForPaper
+ \fi\fi\fi
+ \fi\fi
}
% \end{macrocode}
%
@@ -3053,11 +2993,11 @@
% \changes{v4.4}{2012/08/26}{Added the command \string\cs{centertextonpage}}
% \begin{macrocode}
\newcommand{\centertextonpage}{%
- \ifeqforpaper\AtBeginDocument{\web@centertextonpage}\fi}
+ \ifeqforpaper\AtBeginDocument{\web@centertextonpage}\fi}
\def\web@centertextonpage{%
- \setlength{\oddsidemargin}{\paperwidth-\textwidth-2in}%
- \oddsidemargin=.5\oddsidemargin
- \evensidemargin=\oddsidemargin
+ \setlength{\oddsidemargin}{\paperwidth-\textwidth-2in}%
+ \oddsidemargin=.5\oddsidemargin
+ \evensidemargin=\oddsidemargin
}
% \end{macrocode}
% \end{macro}
@@ -3098,13 +3038,15 @@
% If the user asks for the \texttt{latextoc} option, but wants bullets, we
% adjust things so the bullets look good.
% \begin{macrocode}
-\ifx\web@latextoc\web@YES\ifx\web@bullets\web@YES%
+\ifx\web@latextoc\web@YES
+ \ifx\web@bullets\web@YES
\@ifundefined{chapter} {%
- \renewcommand*\l@subsubsection{\@dottedtocline{3}{3.8em}{1.2em}}
+ \renewcommand*\l@subsubsection{\@dottedtocline{3}{3.8em}{1.2em}}
}{%
- \renewcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{1.2em}}
+ \renewcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{1.2em}}
}%
-\fi\fi
+ \fi
+\fi
% \end{macrocode}
% \begin{macrocode}
\def\tocColor#1{\def\web@tocColor{#1}\def\aeb@toccolor{#1}}
@@ -3122,59 +3064,58 @@
\def\web@Tocpagestyle#1{#1}
\let\web@latextoc@save\tableofcontents
\ifx\web@bullets\web@YES
-\def\tableofcontents
-{%
- \global\let\insertwebtoc\insert@webtoc
+ \def\tableofcontents{\global
+ \let\insertwebtoc\insert@webtoc
\def\contentsname{\web@toc}%
\pdfbookmark[1]{\web@toc}{toc}%
- \web@Tocpagestyle{\thispagestyle{empty}}%
- \markright{{\normalfont\small \web@toc\ (\web@continued)}}%
- \@ifundefined{sectionToc}{%
- \begin{center}\hypertarget{webtoc}{}%
- \normalfont\bfseries\Large\color{\web@tocColor}%
- \contentsname
- \end{center}
- }{\sectionToc{\web@toc}}\par
+ \web@Tocpagestyle{\thispagestyle{empty}}%
+ \markright{{\normalfont\small \web@toc\ (\web@continued)}}%
+ \@ifundefined{sectionToc}{%
+ \begin{center}\hypertarget{webtoc}{}%
+ \normalfont\bfseries\Large\color{\web@tocColor}%
+ \contentsname
+ \end{center}
+ }{\sectionToc{\web@toc}}\par
\ifx\web@latextoc\web@YES
- \@starttoc{toc}% LaTeX toc listing with page numbers
+ \@starttoc{toc}% LaTeX toc listing with page numbers
\else
- \noindent\webtableofcontents
+ \noindent\webtableofcontents
\fi
\newpage
-}
+ }
\else
- \PackageInfo{web}{No Bullets Requested}
- \def\tableofcontents{%
- \begingroup
- \def\contentsname{\web@toc}%
- \let\web@save@mkboth\@mkboth
- \def\@mkboth{\protect\hypertarget{webtoc}{}\web@save@mkboth}%
- \ifx\web@finalDot\@empty\else
- \def\numberline##1{\hb@xt@\@tempdima{##1.\hfil}}\fi
- \web@latextoc@save
- \endgroup\newpage
- }
- \renewcommand\subsubsection{\renewcommand{\@seccntformat}[1]{%
- \@nameuse{the##1}\web@finalDot\enspace}
- \@startsection{subsubsection}{3}{\z@}%
- {-2ex\@plus -1ex \@minus -.2ex}{.5ex \@plus .2ex}%
- {\noindent\normalfont\normalsize\bfseries}}
- \renewcommand*{\thesubsubsection}
- {\thesubsection.\arabic{subsubsection}}
+ \PackageInfo{web}{No Bullets Requested}
+ \def\tableofcontents{%
+ \begingroup
+ \def\contentsname{\web@toc}%
+ \let\web@save@mkboth\@mkboth
+ \def\@mkboth{\protect\hypertarget{webtoc}{}\web@save@mkboth}%
+ \ifx\web@finalDot\@empty\else
+ \def\numberline##1{\hb@xt@\@tempdima{##1.\hfil}}\fi
+ \web@latextoc@save
+ \endgroup
+ \newpage
+ }
+ \renewcommand\subsubsection{\renewcommand{\@seccntformat}[1]{%
+ \@nameuse{the##1}\web@finalDot\enspace}
+ \@startsection{subsubsection}{3}{\z@}%
+ {-2ex\@plus -1ex \@minus -.2ex}{.5ex \@plus .2ex}%
+ {\noindent\normalfont\normalsize\bfseries}}
+ \renewcommand*{\thesubsubsection}
+ {\thesubsection.\arabic{subsubsection}}
\fi
% \end{macrocode}
% \DescribeMacro{\widestNumber}\DescribeMacro{\tocIndent}
% \DescribeMacro{\tocIndentByNumber} These are used for
% setting the amount of indentation for the \cs{webtableofcontents}
% \begin{macrocode}
-\def\widestNumber#1{%
- \def\widest@Number{#1\ }}
+\def\widestNumber#1{\def\widest@Number{#1\ }}
\widestNumber{0.0.}
\newcommand{\tocIndent}[1]{\def\toc@indent{#1}}
\tocIndent{20pt}
\def\tocIndentByNumber#1{{%
- \settowidth{\@tempdima}{\normalfont\textbf{#1\ }}%
- \xdef\toc@indent{\the\@tempdima}%
+ \settowidth{\@tempdima}{\normalfont\textbf{#1\ }}%
+ \xdef\toc@indent{\the\@tempdima}%
}}
\tocIndentByNumber{00.}
% \end{macrocode}
@@ -3186,21 +3127,20 @@
% \DescribeMacro{\webtableofcontents} is the table of contents for
% the \texttt{web} package.
% \begin{macrocode}
-\def\webtableofcontents
-{%
- \begingroup
+\def\webtableofcontents{%
+ \begingroup
% \end{macrocode}
% Sample line from .aux
%\begin{verbatim}
-% \contentsline {section}{\numberline {1}Introduction}{4}{section.1}
-% \contentsline {section}{\numberline {}References}{56}{section*.1}
+% \contentsline {section}{\numberline {1}Introduction}{4}{section.1}
+% \contentsline {section}{\numberline {}References}{56}{section*.1}
% #1 #2 #3
%\end{verbatim}
% \begin{macrocode}
\global\let\isChapter\web@NO
\parskip0pt\parindent\toc@indent\relax
\settowidth{\@tempdima}{\normalfont
- \textbf{\widest@Number}}%
+ \textbf{\widest@Number}}%
\@tempdimb\@tempdima
\advance\@tempdimb by\parindent
\edef\web@subsubSecIndent{\the\@tempdimb}%
@@ -3208,19 +3148,20 @@
\let\numberline\web@numberline
\let\contentsline\web@contentsline
\def\web@section##1##2##3{\web@parse##1\\%
- \web@toc@section{##1}{##2}{##3}}%
+ \web@toc@section{##1}{##2}{##3}}%
\def\web@subsection##1##2##3{\web@parse##1\\%
- \web@toc@subsection{##1}{##2}{##3}}%
+ \web@toc@subsection{##1}{##2}{##3}}%
\def\web@subsubsection##1##2##3{\web@parse##1\\%
- \web@toc@subsubsection{##1}{##2}{##3}}%
+ \web@toc@subsubsection{##1}{##2}{##3}}%
\def\web@part##1##2##3{\web@toc@part{##1}{##2}{##3}}%
\def\web@chapter##1##2##3{\web@parse##1\\%
- \web@toc@chapter{##1}{##2}{##3}}%
+ \web@toc@chapter{##1}{##2}{##3}}%
\@starttoc{toc}%
\setlength{\@tempdimb}{\ifx\isChapter\web@YES
- \parindent+\web@subsubSecIndent\else\web@subsubSecIndent\fi}%
+ \parindent+\web@subsubSecIndent\else\web@subsubSecIndent\fi}%
\leftskip\@tempdimb
- \par\endgroup
+ \par
+ \endgroup
}
% \end{macrocode}
% \begin{macro}{\web@toc@part}
@@ -3234,85 +3175,72 @@
% \begin{macrocode}
\def\web@numberline#1{\makebox[0pt]{#1\enspace}}%
\def\web@contentsline#1#2#3#4{%
- \@nameuse{web@#1}{#2}{#3}{#4}}%
+ \@nameuse{web@#1}{#2}{#3}{#4}}%
\def\web@parse#1#2#3\\{%
- \def\web@title{#3}\def\numberline{#2}}%
+ \def\web@title{#3}\def\numberline{#2}}%
\def\web@toc@part#1#2#3{\par\noindent
- {\bfseries\hyperlink{#3}{#1}}\par\smallskip}
+ {\bfseries\hyperlink{#3}{#1}}\par\smallskip}
\def\web@toc@chapter#1#2#3{\global\let\isChapter\web@YES
- \par\mbox{}{\bfseries
- \ifx\numberline\@empty
- \@ifundefined{d@DingToc}{\hyperlink{#3}{\web@title}}
- {%
- \ifx\d@DingToc\@empty
- \hyperlink{#3}{\web@title}%
- \else
- \if\aeb@use@section@numbers0\relax
- \makebox[0pt][r]{\color{\d@DingTocColor}%
- \d@DingToc\space}\hyperlink{#3}{\web@title}%
- \else
- \hyperlink{#3}{\web@title}%
- \fi
- \fi
- }%
+ \par\mbox{}{\bfseries
+ \ifx\numberline\@empty
+ \@ifundefined{d@DingToc}{\hyperlink{#3}{\web@title}}{%
+ \ifx\d@DingToc\@empty
+ \hyperlink{#3}{\web@title}%
\else
- \makebox[0pt][r]{\hyperlink{#3}{%
- \numberline\web@finalDot}\space}\web@title
- \fi}\par\smallskip
+ \if\aeb@use@section@numbers\web@Zero
+ \makebox[0pt][r]{\color{\d@DingTocColor}%
+ \d@DingToc\space}\hyperlink{#3}{\web@title}\else
+ \hyperlink{#3}{\web@title}\fi
+ \fi
+ }%
+ \else
+ \makebox[0pt][r]{\hyperlink{#3}{%
+ \numberline\web@finalDot}\space}\web@title
+ \fi}\par\smallskip
}
-%\def\web@toc@chapter#1#2#3{\global\let\isChapter\web@YES
-% \par\mbox{}{\bfseries\makebox[0pt][r]{\hyperlink{#3}%
-% {\numberline\web@finalDot}\space}\web@title}\par\smallskip
-%}
\def\web@toc@section#1#2#3{\penalty-500\par
- \hspace*{\if\isChapter y\parindent\else0pt\fi}\mbox{}{\bfseries
- \ifx\numberline\@empty
- \@ifundefined{d@DingToc}{\hyperlink{#3}{\web@title}}
- {%
- \ifx\d@DingToc\@empty
- \hyperlink{#3}{\web@title}%
- \else
- \if\aeb@use@section@numbers0\relax
- \makebox[0pt][r]{\color{\d@DingTocColor}%
- \d@DingToc\space}\hyperlink{#3}{\web@title}%
- \else
- \hyperlink{#3}{\web@title}%
- \fi
- \fi
- }%
- \else
- \makebox[0pt][r]{\hyperlink{#3}{%
- \numberline\web@finalDot}\space}\web@title
- \fi}\endgraf
+ \hspace*{\if\isChapter y\parindent\else0pt\fi}\mbox{}{\bfseries
+ \ifx\numberline\@empty
+ \@ifundefined{d@DingToc}{\hyperlink{#3}{\web@title}}{%
+ \ifx\d@DingToc\@empty
+ \hyperlink{#3}{\web@title}%
+ \else
+ \if\aeb@use@section@numbers\web@Zero
+ \makebox[0pt][r]{\color{\d@DingTocColor}%
+ \d@DingToc\space}\hyperlink{#3}{\web@title}\else
+ \hyperlink{#3}{\web@title}\fi
+ \fi
+ }%
+ \else
+ \makebox[0pt][r]{\hyperlink{#3}{%
+ \numberline\web@finalDot}\space}\web@title
+ \fi}\endgraf
}%
\def\web@toc@subsection#1#2#3{\par
- \setlength{\@tempdimb}{\ifx\isChapter\web@YES
- \parindent+\@tempdima\else\@tempdima\fi}%
- \penalty-50 \hspace*{\@tempdimb}\mbox{}{\bfseries
- \ifx\numberline\@empty
- \@ifundefined{dd@DingToc}{\hyperlink{#3}{\web@title}}
- {%
- \ifx\dd@DingToc\@empty
- \hyperlink{#3}{\web@title}%
- \else
- \makebox[0pt][r]{\color{\dd@DingTocColor}%
- \dd@DingToc\space}\hyperlink{#3}{\web@title}%
- \fi
- }%
- \else
- \makebox[0pt][r]{\makebox[\@tempdima][l]%
- {\hyperlink{#3}{\numberline\web@finalDot}}}\web@title
- \fi}\endgraf
-}%
+ \setlength{\@tempdimb}{\ifx\isChapter\web@YES
+ \parindent+\@tempdima\else\@tempdima\fi}%
+ \penalty-50 \hspace*{\@tempdimb}\mbox{}{\bfseries
+ \ifx\numberline\@empty
+ \@ifundefined{dd@DingToc}{\hyperlink{#3}{\web@title}}{%
+ \ifx\dd@DingToc\@empty
+ \hyperlink{#3}{\web@title}\else
+ \makebox[0pt][r]{\color{\dd@DingTocColor}%
+ \dd@DingToc\space}\hyperlink{#3}{\web@title}\fi
+ }%
+ \else
+ \makebox[0pt][r]{\makebox[\@tempdima][l]%
+ {\hyperlink{#3}{\numberline\web@finalDot}}}\web@title
+ \fi}\endgraf
+}
\def\web@toc@subsubsection#1#2#3{%
- \def\numberline{\strut$\bullet$}%
- \setlength{\@tempdimb}{\ifx\isChapter\web@YES
- \parindent+\web@subsubSecIndent\else\web@subsubSecIndent\fi}%
- \leftskip\@tempdimb\noindent\unskip\mbox{}\penalty-50
- \@ifundefined{ddd@DingToc}{}{%
- \if\aeb@use@section@numbers0\relax\ifx\ddd@DingToc\@empty\else
+ \def\numberline{\strut$\bullet$}%
+ \setlength{\@tempdimb}{\ifx\isChapter\web@YES
+ \parindent+\web@subsubSecIndent\else\web@subsubSecIndent\fi}%
+ \leftskip\@tempdimb\noindent\unskip\mbox{}\penalty-50
+ \@ifundefined{ddd@DingToc}{}{%
+ \if\aeb@use@section@numbers\web@Zero\ifx\ddd@DingToc\@empty\else
\def\numberline{\color{\ddd@DingTocColor}\strut\ddd@DingToc}%
-\fi\fi}\hyperlink{#3}{\numberline}~\web@title\
+ \fi\fi}\hyperlink{#3}{\numberline}~\web@title\
}%
% \end{macrocode}
% \end{macro}
@@ -3362,14 +3290,12 @@
% background. The command \cs{template} defines \cs{web@template}, which is a text macro
% that actually holds the name of the current graphic.
% \begin{macrocode}
-\newcommand{\template}[2][]
-{%
- \ifweb@allowtemplates
- \def\web@argi{#1}\ifx\web@argi\@empty
- \xdef\web@template@opt@args{\web@addtotemplateArgs}%
- \else\xdef\web@template@opt@args{\web@addtotemplateArgs,#1}%
- \fi\gdef\web@template{#2}%
- \fi
+\newcommand{\template}[2][]{%
+ \ifweb@allowtemplates
+ \def\web@argi{#1}\ifx\web@argi\@empty
+ \xdef\web@template@opt@args{\web@addtotemplateArgs}\else
+ \xdef\web@template@opt@args{\web@addtotemplateArgs,#1}\fi
+ \gdef\web@template{#2}\fi
}
% \end{macrocode}
% The text macro \cs{web@template} holds the name of the current graphic. It starts off as
@@ -3408,36 +3334,34 @@
% background.
% \begin{macrocode}
\let\listAddToTemplates\@empty
-\newcommand{\AddToTemplate}[1]
-{%
- \global\w@csarg\let{eqTmpl#1}\web@YES
- {\toks@=\expandafter{\listAddToTemplates}%
- \xdef\listAddToTemplates{\the\toks@\noexpand\\{#1}}}%
- \ifweb@allowtemplates
- \@AddToTextTemplate{%
+\newcommand{\AddToTemplate}[1]{%
+ \global\w@csarg\let{eqTmpl#1}\web@YES
+ {\toks@=\expandafter{\listAddToTemplates}%
+ \xdef\listAddToTemplates{\the\toks@\noexpand\\{#1}}}%
+ \ifweb@allowtemplates
+ \@AddToTextTemplate{%
+ \w@csarg\ifx{eqTmpl#1}\web@YES
+ \fboxsep=0pt\setlength{\unitlength}{1pt}%
+ \put(\@textX,0){\@nameuse{#1}}%
+ \fi
+ }%
+ \else
+ \w@csarg\ifx{#1}\BGColorAndGraphic
+ \@AddToTextTemplate{%
\w@csarg\ifx{eqTmpl#1}\web@YES
- \fboxsep=0pt\setlength{\unitlength}{1pt}%
- \put(\@textX,0){\@nameuse{#1}}%
- \fi
- }%
- \else
- \w@csarg\ifx{#1}\BGColorAndGraphic
- \@AddToTextTemplate{%
- \w@csarg\ifx{eqTmpl#1}\web@YES
- \fboxsep=0pt\setlength{\unitlength}{1pt}%
- \put(\@textX,0){\@nameuse{#1}}%
- \fi
- }%
- \fi
- \w@csarg\ifx{#1}\BGColorAndGraphicFullWidth
- \@AddToTextTemplate{%
- \w@csarg\ifx{eqTmpl#1}\web@YES
- \fboxsep=0pt\setlength{\unitlength}{1pt}%
- \put(\@textX,0){\@nameuse{#1}}%
- \fi
- }%
+ \fboxsep=0pt\setlength{\unitlength}{1pt}%
+ \put(\@textX,0){\@nameuse{#1}}%
\fi
+ }%
\fi
+ \w@csarg\ifx{#1}\BGColorAndGraphicFullWidth
+ \@AddToTextTemplate{%
+ \w@csarg\ifx{eqTmpl#1}\web@YES
+ \fboxsep=0pt\setlength{\unitlength}{1pt}%
+ \put(\@textX,0){\@nameuse{#1}}\fi
+ }%
+ \fi
+ \fi
}
% \end{macrocode}
% \end{macro}
@@ -3454,15 +3378,15 @@
% passing the empty argument (\verb~{}~) yields the default for \cs{xBld}.
% \begin{macrocode}
\newcommand\placeTemplateInLayer[2][webTextBG]{%
- \@ifpackageloaded{aeb_pro}
- {\@ifundefined{xBld}{\PackageWarning{web}
- {The uselayers option
- of aeb_pro is\MessageBreak required with
- \string\placeTemplateInLayer}}
- {\def\b@webTextLayer{\xBld[#2]{#1}}%
- \def\e@webTextLayer{\eBld}}}%
- {\PackageWarning{web}{\string\placeTemplateInLayer\space
- requires the\MessageBreak aeb_pro package}}%
+ \@ifpackageloaded{aeb_pro}
+ {\@ifundefined{xBld}{\PackageWarning{web}
+ {The uselayers option
+ of aeb_pro is\MessageBreak required with
+ \string\placeTemplateInLayer}}
+ {\def\b@webTextLayer{\xBld[#2]{#1}}%
+ \def\e@webTextLayer{\eBld}}}%
+ {\PackageWarning{web}{\string\placeTemplateInLayer\space
+ requires the\MessageBreak aeb_pro package}}%
}
\let\b@webTextLayer\@empty \let\e@webTextLayer\@empty
\newcommand{\BGColorAndGraphic}{%
@@ -3471,20 +3395,20 @@
% up the first argument of the \cs{colorbox}, which is the color. This is what \cs{gobblembox}
% does, it gobbles up the next token, and inserts a \cs{mbox}.
% \begin{macrocode}
- \b@webTextLayer\web@colorbox@w@transparency{\web@textBgColor}%
+ \b@webTextLayer\web@colorbox@w@transparency{\web@textBgColor}%
+ {%
+ \parbox[b][\paperheight]{\textscreenwidth}%
{%
- \parbox[b][\paperheight]{\textscreenwidth}%
- {%
- \ifx\web@template\@empty
- \hfill\vfill
- \else
- \hfuzz=1pt\vfuzz=1pt\expandafter
- \includegraphics\expandafter[\web@template@opt@args,%
- width=\textscreenwidth,height=\paperheight]%
- {\web@template}
- \fi
- }%
- }\e@webTextLayer
+ \ifx\web@template\@empty
+ \hfill\vfill
+ \else
+ \hfuzz=1pt\vfuzz=1pt\expandafter
+ \includegraphics\expandafter[\web@template@opt@args,%
+ width=\textscreenwidth,height=\paperheight]%
+ {\web@template}
+ \fi
+ }%
+ }\e@webTextLayer
}
% \end{macrocode}
% \end{macro}
@@ -3509,33 +3433,32 @@
% background.
% \begin{macrocode}
\let\listAddToPanelTemplates=\@empty
-\newcommand{\AddToPanelTemplate}[1]
-{%
- \global\w@csarg\let{eqPanTmpl#1}\web@YES
- {\toks@=\expandafter{\listAddToPanelTemplates}%
- \xdef\listAddToPanelTemplates{\the\toks@\noexpand\\{#1}}}%
- \ifweb@allowtemplates
+\newcommand{\AddToPanelTemplate}[1]{%
+ \global\w@csarg\let{eqPanTmpl#1}\web@YES
+ {\toks@=\expandafter{\listAddToPanelTemplates}%
+ \xdef\listAddToPanelTemplates{\the\toks@\noexpand\\{#1}}}%
+ \ifweb@allowtemplates
\@AddToPanelTemplate{%
\w@csarg\ifx{eqPanTmpl#1}\web@YES
\fboxsep=0pt\setlength{\unitlength}{1pt}%
\put(\@panelX,0){\@nameuse{#1}}\fi
}%
- \else
- \w@csarg\ifx{#1}\stdPanelBG
- \@AddToPanelTemplate{%
- \w@csarg\ifx{eqPanTmpl#1}\web@YES
- \fboxsep=0pt\setlength{\unitlength}{1pt}%
- \put(\@panelX,0){\@nameuse{#1}}\fi
- }%
- \fi
- \w@csarg\ifx{#1}\stdbldpanel
- \@AddToPanelTemplate{%
- \w@csarg\ifx{eqPanTmpl#1}\web@YES
- \fboxsep=0pt\setlength{\unitlength}{1pt}%
- \put(\@panelX,0){\@nameuse{#1}}\fi
- }%
- \fi
+ \else
+ \w@csarg\ifx{#1}\stdPanelBG
+ \@AddToPanelTemplate{%
+ \w@csarg\ifx{eqPanTmpl#1}\web@YES
+ \fboxsep=0pt\setlength{\unitlength}{1pt}%
+ \put(\@panelX,0){\@nameuse{#1}}\fi
+ }%
+ \fi
+ \w@csarg\ifx{#1}\stdbldpanel
+ \@AddToPanelTemplate{%
+ \w@csarg\ifx{eqPanTmpl#1}\web@YES
+ \fboxsep=0pt\setlength{\unitlength}{1pt}%
+ \put(\@panelX,0){\@nameuse{#1}}\fi
+ }%
\fi
+ \fi
}
% \end{macrocode}
% \end{macro}
@@ -3545,17 +3468,15 @@
% case, we use \texttt{natwidth} and \texttt{natheight} as the width and height parameters
% in \cs{includegraphics}.
% \begin{macrocode}
-\newcommand{\paneltemplate}[2][]
-{%
- \ifweb@allowtemplates\def\web@argi{#1}%
- \ifx\web@argi\@empty
- \edef\web@paneltemplate@opt@args{%
- \web@addtopaneltemplateArgs}%
- \else
- \edef\web@paneltemplate@opt@args{%
- \web@addtopaneltemplateArgs,#1}%
- \fi\gdef\web@paneltemplate{#2}%
- \fi
+\newcommand{\paneltemplate}[2][]{%
+ \ifweb@allowtemplates\def\web@argi{#1}%
+ \ifx\web@argi\@empty
+ \edef\web@paneltemplate@opt@args
+ {\web@addtopaneltemplateArgs}\else
+ \edef\web@paneltemplate@opt@args
+ {\web@addtopaneltemplateArgs,#1}\fi
+ \gdef\web@paneltemplate{#2}%
+ \fi
}
% \end{macrocode}
% \end{macro}
@@ -3570,7 +3491,7 @@
% \begin{macrocode}
\def\addtopaneltemplateArgs#1{\gdef\web@addtopaneltemplateArgs{#1}}
\def\clearpaneltemplateArgs{%
- \global\let\web@addtopaneltemplateArgs=\@empty}
+ \global\let\web@addtopaneltemplateArgs=\@empty}
\let\web@addtopaneltemplateArgs=\@empty
\let\panel@scaletype\@empty
% \end{macrocode}
@@ -3581,9 +3502,8 @@
% Use this command to override the default.
% \begin{macrocode}
\newcommand\panelsep[1]{\bgroup
- \setlength\@tempdima{#1}%
- \xdef\@panelsep{\the\@tempdima}\egroup}
-%\def\@panelsep{10bp}
+ \setlength\@tempdima{#1}%
+ \xdef\@panelsep{\the\@tempdima}\egroup}
\panelsep{10bp}
\def\panelSep{\@panelsep}
% \end{macrocode}
@@ -3595,44 +3515,44 @@
% |\panelwidth{1in}|
% \begin{macrocode}
\newcommand{\panelwidth}[1]{%
- \let\web@next\relax
- \iftemplatesforpaper\else\ifnum\@panelconfig>0
+ \let\web@next\relax
+ \iftemplatesforpaper\else\ifnum\@panelconfig>\z@
% \end{macrocode}
% (2013/09/13) This command only has effect if there is a panel option and if the \cs{templates\-for\-paper}
% option is not in effect.
% \begin{macrocode}
- \ifnum\@panelconfig=1 % left panel
+ \ifnum\@panelconfig=\@ne % left panel
% \end{macrocode}
% (2013/09/13) One of the problems that I've just overcome it with the \cs{panelwidth} command.
% there was always problems about changing the widths of the panel. The solutions is to
% reverse the current effects of the last \cs{InitLayout} before calling \cs{InitLayout}
% with the new panel width. Seems to work. We do this for the left panel and the right panel.
% \begin{macrocode}
- \ifx\web@layout\web@YES
- \addtolength{\textwidth}{\@panelwidth}%
- \addtolength{\textwidth}{\@Rightmargin}%
- \fi
- \addtolength{\textwidth}{\@panelsep}%
- \addtolength{\oddsidemargin}{-\@panelsep}%
- \addtolength{\evensidemargin}{-\@panelsep}%
- \addtolength{\textscreenwidth}{\@panelwidth}%
- \fi
- \ifnum\@panelconfig=2 % panel right
- \ifx\web@layout\web@YES
- \addtolength{\textwidth}{\@panelwidth}%
- \addtolength{\textwidth}{\@Leftmargin}%
- \fi
- \addtolength{\textwidth}{\@panelsep}%
- \addtolength{\textscreenwidth}{\@panelwidth}%
- \fi
+ \ifx\web@layout\web@YES
+ \addtolength{\textwidth}{\@panelwidth}%
+ \addtolength{\textwidth}{\@Rightmargin}%
+ \fi
+ \addtolength{\textwidth}{\@panelsep}%
+ \addtolength{\oddsidemargin}{-\@panelsep}%
+ \addtolength{\evensidemargin}{-\@panelsep}%
+ \addtolength{\textscreenwidth}{\@panelwidth}%
+ \fi
+ \ifnum\@panelconfig=\tw@ % panel right
+ \ifx\web@layout\web@YES
+ \addtolength{\textwidth}{\@panelwidth}%
+ \addtolength{\textwidth}{\@Leftmargin}%
+ \fi
+ \addtolength{\textwidth}{\@panelsep}%
+ \addtolength{\textscreenwidth}{\@panelwidth}%
+ \fi
% \end{macrocode}
% Now record the new panel width and call \cs{InitLayout}
% \begin{macrocode}
- \setlength{\@panelwidth}{#1}%
- \ifdim\@panelwidth<\web@minpanelwidth
- \setlength{\@panelwidth}{\web@minpanelwidth}\fi
- \def\web@next{\InitLayout}%
- \fi\fi\web@next
+ \setlength{\@panelwidth}{#1}%
+ \ifdim\@panelwidth<\web@minpanelwidth
+ \setlength{\@panelwidth}{\web@minpanelwidth}\fi
+ \def\web@next{\InitLayout}%
+ \fi\fi\web@next
}
% \end{macrocode}
% \end{macro}
@@ -3647,26 +3567,25 @@
% need for a background color.
% \begin{macrocode}
\newcommand\placePanelTemplateInLayer[2][webPanelBG]{%
- \@ifpackageloaded{aeb_pro}
- {\@ifundefined{xBld}{\PackageWarning{web}
- {The uselayers option
- of aeb_pro is\MessageBreak required with
- \string\placePanelTemplateInLayer}}
- {\def\b@webPanelLayer{\xBld[#2]{#1}}%
- \def\e@webPanelLayer{\eBld}}}%
- {\PackageWarning{web}{\string\placePanelTemplateInLayer\space
- requires the\MessageBreak aeb_pro package}}%
+ \@ifpackageloaded{aeb_pro}
+ {\@ifundefined{xBld}{\PackageWarning{web}
+ {The uselayers option
+ of aeb_pro is\MessageBreak required with
+ \string\placePanelTemplateInLayer}}
+ {\def\b@webPanelLayer{\xBld[#2]{#1}}%
+ \def\e@webPanelLayer{\eBld}}}%
+ {\PackageWarning{web}{\string\placePanelTemplateInLayer\space
+ requires the\MessageBreak aeb_pro package}}%
}
\let\b@webPanelLayer\@empty \let\e@webPanelLayer\@empty
-\newcommand\stdPanelBG
-{%
- \b@webPanelLayer\web@colorbox@w@transparency{\web@panelBgColor}%
- {\parbox[b][\paperheight]{\@panelwidth}%
- {\ifx\web@paneltemplate\@empty\hfill\vfill\else
- \hfuzz=1pt\vfuzz=1pt\expandafter
- \includegraphics\expandafter[\web@paneltemplate@opt@args,%
- width=\@panelwidth,height=\paperheight]%
- {\web@paneltemplate}\fi}}\e@webPanelLayer
+\newcommand\stdPanelBG{%
+ \b@webPanelLayer\web@colorbox@w@transparency{\web@panelBgColor}%
+ {\parbox[b][\paperheight]{\@panelwidth}%
+ {\ifx\web@paneltemplate\@empty\hfill\vfill\else
+ \hfuzz=1pt\vfuzz=1pt\expandafter
+ \includegraphics\expandafter[\web@paneltemplate@opt@args,%
+ width=\@panelwidth,height=\paperheight]%
+ {\web@paneltemplate}\fi}}\e@webPanelLayer
}
% \end{macrocode}
% Enter \cs{stdPanelBG} into the panel template stack. Any
@@ -3683,19 +3602,16 @@
% The \cs{stdbldpanel} is the macro that actually builds the objects on top of the
% background.
% \begin{macrocode}
-\newcommand{\buildpanel}[1]
-{%
- \gdef\stdbldpanel
- {%
- \parbox[b][\paperheight]{\@panelwidth}%
- {%
- \normalsfcodes\normalfont\normalsize
- \spaceskip=0pt\xspaceskip=0pt
- \par\medskip\vfil
- \centering#1%
- \par\medskip\vfil
- }%
+\newcommand{\buildpanel}[1]{%
+ \gdef\stdbldpanel{%
+ \parbox[b][\paperheight]{\@panelwidth}{%
+ \normalsfcodes\normalfont\normalsize
+ \spaceskip=0pt\xspaceskip=0pt
+ \par\medskip\vfil
+ \centering#1%
+ \par\medskip\vfil
}%
+ }%
}
% \end{macrocode}
% \end{macro}
@@ -3711,13 +3627,13 @@
% top (for logo); middle (for other content); bottom (for navigation panel)
% \begin{macrocode}
\newcommand{\useStandardPanel}{%
- \buildpanel{%
- \web@panel@top
- \par\vspace{\stretch{1}}%
- \web@panel@middle
- \par\vspace{\stretch{1}}%
- \web@panel@bottom
- }%
+ \buildpanel{%
+ \web@panel@top
+ \par\vspace{\stretch{1}}%
+ \web@panel@middle
+ \par\vspace{\stretch{1}}%
+ \web@panel@bottom
+ }%
}
\newcommand{\panelTop}[1]{\def\web@panel@top{#1}}
\panelTop{}
@@ -3730,20 +3646,18 @@
% \begin{macro}{\ClearTextTemplate}
% Clear the text template
% \begin{macrocode}
-\newcommand{\ClearTextTemplate}
-{%
- \global\let\web@textBgColor\@empty
- \global\let\web@template\@empty
+\newcommand{\ClearTextTemplate}{%
+ \global\let\web@textBgColor\@empty
+ \global\let\web@template\@empty
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\ClearPanelTemplate}
% Clear the panel template
% \begin{macrocode}
-\newcommand{\ClearPanelTemplate}
-{%
- \global\let\web@panelBgColor\@empty
- \global\let\web@paneltemplate\@empty
+\newcommand{\ClearPanelTemplate}{%
+ \global\let\web@panelBgColor\@empty
+ \global\let\web@paneltemplate\@empty
}
% \end{macrocode}
% \end{macro}
@@ -3751,25 +3665,24 @@
% Clear the panel template
% \begin{macrocode}
\newcommand{\ClearBuildPanel}
- {\global\let\stdbldpanel\@empty}
+ {\global\let\stdbldpanel\@empty}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\ClearAllTemplates}
% Clear both text and panel templates
% \begin{macrocode}
-\newcommand{\ClearAllTemplates}
-{%
- \ClearTextTemplate
- \ClearPanelTemplate
+\newcommand{\ClearAllTemplates}{%
+ \ClearTextTemplate
+ \ClearPanelTemplate
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\newcommand{\ClearTextTemplateBuffer}
- {\global\let\web@textTemplate\@empty}
+ {\global\let\web@textTemplate\@empty}
\newcommand{\ClearPanelTemplateBuffer}
- {\global\let\web@panelTemplate\@empty}
+ {\global\let\web@panelTemplate\@empty}
% \end{macrocode}
% (06/15/05) The following two commands save and clears all design elements, and enables
% the restoring of the design state.
@@ -3781,30 +3694,29 @@
% respectively. The twist here is that even though these basic elements have been redefined,
% there original ones can be restored using \cs{restoreElements}.
% \begin{macrocode}
-\newcommand{\saveElements}[1]
-{%
- \begingroup
- \global\w@csarg\let{web@SaveTmpls#1}\@empty
- \toks@={}%
- \def\web@addtoSaveToks##1{%
- \edef\web@let{\global\expandafter
- \let\expandafter\noexpand\csname#1##1\endcsname=%
- \expandafter\noexpand\csname##1\endcsname}%
- \web@let
- \edef\web@SaveTmpls{\the\toks@\noexpand\\{##1}%
- \expandafter\noexpand\csname#1##1\endcsname}%
- \toks@=\expandafter{\web@SaveTmpls}%
- }%
- \web@addtoSaveToks{web@textBgColor}%
- \web@addtoSaveToks{web@template}%
- \web@addtoSaveToks{stdbldpanel}%
- \web@addtoSaveToks{web@panelBgColor}%
- \web@addtoSaveToks{web@paneltemplate}%
- \w@csarg\xdef{web@SaveTmpls#1}{\the\toks@}%
- \endgroup
+\newcommand{\saveElements}[1]{%
+ \begingroup
+ \global\w@csarg\let{web@SaveTmpls#1}\@empty
+ \toks@={}%
+ \def\web@addtoSaveToks##1{%
+ \edef\web@let{\global\expandafter
+ \let\expandafter\noexpand\csname#1##1\endcsname=%
+ \expandafter\noexpand\csname##1\endcsname}%
+ \web@let
+ \edef\web@SaveTmpls{\the\toks@\noexpand\\{##1}%
+ \expandafter\noexpand\csname#1##1\endcsname}%
+ \toks@=\expandafter{\web@SaveTmpls}%
+ }%
+ \web@addtoSaveToks{web@textBgColor}%
+ \web@addtoSaveToks{web@template}%
+ \web@addtoSaveToks{stdbldpanel}%
+ \web@addtoSaveToks{web@panelBgColor}%
+ \web@addtoSaveToks{web@paneltemplate}%
+ \w@csarg\xdef{web@SaveTmpls#1}{\the\toks@}%
+ \endgroup
}
\newcommand{\saveClearElements}[1]{%
- \saveElements{#1}\ClearAllTemplates\ClearBuildPanel
+ \saveElements{#1}\ClearAllTemplates\ClearBuildPanel
}
% \end{macrocode}
% \end{macro}
@@ -3814,11 +3726,11 @@
% a name.
% \begin{macrocode}
\newcommand{\restoreElements}[1]{%
- \ClearAllTemplates\ClearBuildPanel
- \begingroup
- \toks@=\expandafter{\csname web@SaveTmpls#1\endcsname}%
- \def\\##1##2{\global\w@csarg\let{##1}=##2}\the\toks@
- \endgroup
+ \ClearAllTemplates\ClearBuildPanel
+ \begingroup
+ \toks@=\expandafter{\csname web@SaveTmpls#1\endcsname}%
+ \def\\##1##2{\global\w@csarg\let{##1}=##2}\the\toks@
+ \endgroup
}
% \end{macrocode}
% \end{macro}
@@ -3828,18 +3740,17 @@
% only those templates added in by \cs{AddToTemplate}.
% \changes{v6.0k}{2016/06/14}{Fixed error in def of \string\cs{\string\cs{}}}
% \begin{macrocode}
-\newcommand{\disableScreens}[1]
-{%
- \begingroup
+\newcommand{\disableScreens}[1]{%
+ \begingroup
\toks@=\expandafter{\listAddToTemplates}%
\toks2={}%
\def\\##1{\w@csarg\ifx{eqTmpl##1}\web@YES
- \disableTemplate{##1}%
- \xdef\web@saveAddTo{\the\toks2 \noexpand\\{##1}}%
- \toks2=\expandafter{\web@saveAddTo}\fi}%
+ \disableTemplate{##1}%
+ \xdef\web@saveAddTo{\the\toks2 \noexpand\\{##1}}%
+ \toks2=\expandafter{\web@saveAddTo}\fi}%
\the\toks@
- \endgroup
- \w@csarg\let{web@DisabledTmpls#1}\web@saveAddTo
+ \endgroup
+ \w@csarg\let{web@DisabledTmpls#1}\web@saveAddTo
}
% \end{macrocode}
% \end{macro}
@@ -3848,12 +3759,11 @@
% under a name, the required argument. Includes
% only those templates added in by \cs{AddToTemplate}.
% \begin{macrocode}
-\newcommand{\restoreScreens}[1]
-{%
- \begingroup
- \toks@=\expandafter{\csname web@DisabledTmpls#1\endcsname}%
- \def\\##1{\enableTemplate{##1}}\the\toks@
- \endgroup
+\newcommand{\restoreScreens}[1]{%
+ \begingroup
+ \toks@=\expandafter{\csname web@DisabledTmpls#1\endcsname}%
+ \def\\##1{\enableTemplate{##1}}\the\toks@
+ \endgroup
}
% \end{macrocode}
% \end{macro}
@@ -3862,18 +3772,17 @@
% saves the list under a name, the required argument. Includes
% only those templates added in by \cs{AddToPanelTemplate}.
% \begin{macrocode}
-\newcommand{\disablePanels}[1]
-{%
- \begingroup
+\newcommand{\disablePanels}[1]{%
+ \begingroup
\toks@ = \expandafter{\listAddToPanelTemplates}%
\toks2 = {}%
\def\\##1{\w@csarg\ifx{eqPanTmpl##1}\web@YES
- \disablePanelTemplate{##1}%
- \xdef\web@saveAddTo{\the\toks2 \noexpand\\{##1}}%
- \toks2 =\expandafter{\web@saveAddTo}\fi}%
+ \disablePanelTemplate{##1}%
+ \xdef\web@saveAddTo{\the\toks2 \noexpand\\{##1}}%
+ \toks2 =\expandafter{\web@saveAddTo}\fi}%
\the\toks@
- \endgroup
- \global\w@csarg\let{web@DisabledPanelTmpls#1}\web@saveAddTo
+ \endgroup
+ \global\w@csarg\let{web@DisabledPanelTmpls#1}\web@saveAddTo
}
% \end{macrocode}
% \end{macro}
@@ -3882,24 +3791,23 @@
% under a name, the required argument. Includes
% only those templates added in by \cs{AddToPanelTemplate}.
% \begin{macrocode}
-\newcommand{\restorePanels}[1]
-{%
- \begingroup
- \toks@=\expandafter{\csname web@DisabledPanelTmpls#1\endcsname}%
- \def\\##1{\enablePanelTemplate{##1}}\the\toks@
- \endgroup
+\newcommand{\restorePanels}[1]{%
+ \begingroup
+ \toks@=\expandafter{\csname web@DisabledPanelTmpls#1\endcsname}%
+ \def\\##1{\enablePanelTemplate{##1}}\the\toks@
+ \endgroup
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\newcommand{\disableTemplate}[1]{{%
- \global\w@csarg\let{eqTmpl#1}\web@NO}}
+ \global\w@csarg\let{eqTmpl#1}\web@NO}}
\newcommand{\enableTemplate}[1]{{%
- \global\w@csarg\let{eqTmpl#1}\web@YES}}
+ \global\w@csarg\let{eqTmpl#1}\web@YES}}
\newcommand{\disablePanelTemplate}[1]{{%
- \global\w@csarg\let{eqPanTmpl#1}\web@NO}}
+ \global\w@csarg\let{eqPanTmpl#1}\web@NO}}
\newcommand{\enablePanelTemplate}[1]{{%
- \global\w@csarg\let{eqPanTmpl#1}\web@YES}}
+ \global\w@csarg\let{eqPanTmpl#1}\web@YES}}
% \end{macrocode}
% \subsubsection{Support for full-width pages}
% (2013/01/10) When one of the panel options is taken the with of the text screen is reduced.
@@ -3912,19 +3820,19 @@
% We calculate some adjustment values that depend on whether we are left or right panel.
% \begin{macrocode}
\def\calculatefullwidth{%
- \ifeqforpaper
- \let\fullscreenwidthadj\@empty
- \else
- \ifnum\@panelconfig=1\relax % leftpanel
- \bgroup
+ \ifeqforpaper
+ \let\fullscreenwidthadj\@empty
+ \else
+ \ifnum\@panelconfig=\@ne % leftpanel
+ \bgroup
\setlength{\@tempdima}{-\@panelwidth-\@panelsep+\@Leftmargin}%
\xdef\web@leftMargAdj{\the\@tempdima}%
\setlength{\@tempdima}{-\@panelwidth-\@panelsep+\@Rightmargin}%
\xdef\web@rightMargAdj{\the\@tempdima}%
- \egroup
- \def\fullscreenwidthadj{\hspace{\web@leftMargAdj}}%
- \fi
+ \egroup
+ \def\fullscreenwidthadj{\hspace{\web@leftMargAdj}}%
\fi
+ \fi
}
% \end{macrocode}
% \DescribeMacro{\makeFullwidthhead}
@@ -3933,19 +3841,19 @@
% \cs{fullscreenwidthadj}.
% \begin{macrocode}
\newcommand{\makeFullwidthhead}{%
- \global\let\web@save@oddhead\@oddhead
- \renewcommand{\@oddhead}{\fullscreenwidthadj
- \hbox to\fullscreenwidth{\normalfont\footnotesize
- \web@headerhook\web@lhead\hfil\web@chead\hfil
- \web@rightheader}\hss}%
+ \global\let\web@save@oddhead\@oddhead
+ \renewcommand{\@oddhead}{\fullscreenwidthadj
+ \hbox to\fullscreenwidth{\normalfont\footnotesize
+ \web@headerhook\web@lhead\hfil\web@chead\hfil
+ \web@rightheader}\hss}%
}
% \end{macrocode}
% \DescribeMacro{\restoreSavedHead} restores previously saved header
% (saved by \cs{makeFullwidthhead}.
% \begin{macrocode}
\newcommand{\restoreSavedHead}{%
- \global\let\@oddhead\web@save@oddhead
- \let\web@save@oddhead\@empty
+ \global\let\@oddhead\web@save@oddhead
+ \let\web@save@oddhead\@empty
}
% \end{macrocode}
% \begin{environment}{Fullwidthtext}
@@ -3955,31 +3863,32 @@
% in the \textsf{eqexam} package.
% \begin{macrocode}
\def\webNotPaneledWarning{%
- The Fullwidthtext environment is valid only\MessageBreak
- for a paneled document, ignoring this\MessageBreak
- environment}
+ The Fullwidthtext environment is valid only\MessageBreak
+ for a paneled document, ignoring this\MessageBreak
+ environment}
\newenvironment{Fullwidthtext}{%
- \ifnum\@panelconfig=0\relax
- \PackageWarning{web}{\webNotPaneledWarning}%
- \let\web@next\relax
- \else
- \def\web@next{%
- \enableTemplate{BGColorAndGraphicFullWidth}%
- \list{}{%
- \setlength{\textwidth}{\fullscreenwidth}%
- \setlength{\linewidth}{\fullscreenwidth}%
- \setlength{\itemindent}{0pt}\setlength{\itemsep}{0pt}%
- \setlength{\topsep}{0pt}\setlength{\parsep}{0pt}%
- \setlength{\listparindent}{\parindent}%
- \setlength{\leftmargin}{\web@leftMargAdj}%
- \setlength{\rightmargin}{-\web@rightMargAdj}%
- }\item\relax}%
- \fi\web@next
+ \ifnum\@panelconfig=\@ne
+ \PackageWarning{web}{\webNotPaneledWarning}%
+ \let\web@next\relax
+ \else
+ \def\web@next{%
+ \enableTemplate{BGColorAndGraphicFullWidth}%
+ \list{}{%
+ \setlength{\textwidth}{\fullscreenwidth}%
+ \setlength{\linewidth}{\fullscreenwidth}%
+ \setlength{\itemindent}{0pt}\setlength{\itemsep}{0pt}%
+ \setlength{\topsep}{0pt}\setlength{\parsep}{0pt}%
+ \setlength{\listparindent}{\parindent}%
+ \setlength{\leftmargin}{\web@leftMargAdj}%
+ \setlength{\rightmargin}{-\web@rightMargAdj}%
+ }\item\relax}%
+ \fi\web@next
}{%
- \ifnum\@panelconfig=0\relax\let\web@next\relax\else
- \def\web@next{\endlist\newpage
- \disableTemplate{BGColorAndGraphicFullWidth}}%
- \fi\web@next
+ \ifnum\@panelconfig=\z@
+ \let\web@next\relax\else
+ \def\web@next{\endlist\newpage
+ \disableTemplate{BGColorAndGraphicFullWidth}}%
+ \fi\web@next
}
% \end{macrocode}
% \end{environment}
@@ -3987,24 +3896,24 @@
% ``full page mode.''
% \begin{macrocode}
\newcommand{\pushToFullWidthPage}{%
- \ifnum\@panelconfig>0\relax
- \disableScreens{gofullwidth}%
- \disablePanels{gofullwidth}%
- \makeFullwidthhead
- \let\web@save@footwrapper\webfootwrapper
- \def\webfootwrapper{\fullscreenwidthadj
- \makebox[\fullscreenwidth]}%
- \fi
- \begin{Fullwidthtext}
+ \ifnum\@panelconfig>\z@
+ \disableScreens{gofullwidth}%
+ \disablePanels{gofullwidth}%
+ \makeFullwidthhead
+ \let\web@save@footwrapper\webfootwrapper
+ \def\webfootwrapper{\fullscreenwidthadj
+ \makebox[\fullscreenwidth]}%
+ \fi
+ \begin{Fullwidthtext}
}
\newcommand{\popFromFullWidthPage}{%
- \end{Fullwidthtext}
- \ifnum\@panelconfig>0\relax
- \restoreScreens{gofullwidth}%
- \restorePanels{gofullwidth}%
- \restoreSavedHead
- \let\webfootwrapper\web@save@footwrapper
- \fi
+ \end{Fullwidthtext}
+ \ifnum\@panelconfig>\z@
+ \restoreScreens{gofullwidth}%
+ \restorePanels{gofullwidth}%
+ \restoreSavedHead
+ \let\webfootwrapper\web@save@footwrapper
+ \fi
}
% \end{macrocode}
% \DescribeMacro{\addtofullwidthtemplateArgs}\DescribeMacro{\clearfullwidthtemplateArgs}
@@ -4024,41 +3933,39 @@
% \end{macrocode}
% \begin{macrocode}
\let\web@fullwidthtemplate\@empty
-\newcommand{\fullwidthtemplate}[2][]
-{%
- \ifweb@allowtemplates
- \def\web@arg{#1}\ifx\web@argi\@empty
- \xdef\web@fullwidthtemplate@opt@args
- {\web@addtofullwidthtemplateArgs}%
- \else
- \xdef\web@fullwidthtemplate@opt@args
- {\web@addtofullwidthtemplateArgs,#1}%
- \fi\gdef\web@fullwidthtemplate{#2}%
- \fi
+\newcommand{\fullwidthtemplate}[2][]{%
+ \ifweb@allowtemplates
+ \def\web@arg{#1}\ifx\web@argi\@empty
+ \xdef\web@fullwidthtemplate@opt@args
+ {\web@addtofullwidthtemplateArgs}%
+ \else
+ \xdef\web@fullwidthtemplate@opt@args
+ {\web@addtofullwidthtemplateArgs,#1}%
+ \fi\gdef\web@fullwidthtemplate{#2}%
+ \fi
}
% \end{macrocode}
% \DescribeMacro{\B{GColorAndGraphicFullWidth}} handles the full-width page
% when left or right panels are in effect.
% \begin{macrocode}
-\newcommand\BGColorAndGraphicFullWidth
-{%
- \put(-\@textX,0){%
- \web@colorbox@w@transparency{\web@fullwidthBgColor}%
- {%
- \parbox[b][\paperheight]{\paperwidth}%
- {%
- \ifx\web@fullwidthtemplate\@empty
- \hfill\vfill
- \else
- \hfuzz=1pt\vfuzz=1pt
- \expandafter\includegraphics\expandafter
- [\web@fullwidthtemplate@opt@args,%
- width=\paperwidth,height=\paperheight]%
- {\web@fullwidthtemplate}%
- \fi
- }%
- }%
+\newcommand\BGColorAndGraphicFullWidth{%
+ \put(-\@textX,0){%
+ \web@colorbox@w@transparency{\web@fullwidthBgColor}%
+ {%
+ \parbox[b][\paperheight]{\paperwidth}%
+ {%
+ \ifx\web@fullwidthtemplate\@empty
+ \hfill\vfill
+ \else
+ \hfuzz=1pt\vfuzz=1pt
+ \expandafter\includegraphics\expandafter
+ [\web@fullwidthtemplate@opt@args,%
+ width=\paperwidth,height=\paperheight]%
+ {\web@fullwidthtemplate}%
+ \fi
+ }%
}%
+ }%
}
% \end{macrocode}
% Here we ``register'' this template with the ``template handler'', and then
@@ -4070,19 +3977,19 @@
% \end{macrocode}
% \subsubsection{\texorpdfstring{\protect\cs{AddToShipoutPicture}}{\CMD{AddToShipoutPicture}}}
% \begin{macrocode}
-\ifnum\@usetemplates>0
- \ifnum\@panelconfig>0
+\ifnum\@usetemplates>\z@
+ \ifnum\@panelconfig>\z@
% \end{macrocode}
% If the user calls for a left or right panel, then we issue separate templates.
% \begin{macrocode}
- \AtBeginDocument{%
- \AddToShipoutPicture{\web@textTemplate\web@panelTemplate}}
- \else
+ \AtBeginDocument{%
+ \AddToShipoutPicture{\web@textTemplate\web@panelTemplate}}
+ \else
% \end{macrocode}
% otherwise, we use only the \cs{web@textTemplate}
% \begin{macrocode}
- \AtBeginDocument{\AddToShipoutPicture{\web@textTemplate}}
- \fi
+ \AtBeginDocument{\AddToShipoutPicture{\web@textTemplate}}
+ \fi
\fi
% \end{macrocode}
% \begin{macrocode}
@@ -4118,7 +4025,7 @@
%\end{verbatim}
% \begin{macrocode}
\newcommand{\DeclareDocInfo}[1]{\setkeys{aebDocInfo}{#1}%
- \ifx\web@talkdate@value\@empty\else\let\webversion\webtalkdate\fi}
+ \ifx\web@talkdate@value\@empty\else\let\webversion\webtalkdate\fi}
\@onlypreamble\DeclareDocInfo
% \end{macrocode}
% \end{macro}
@@ -4171,27 +4078,27 @@
% \changes{v4.2h}{2012/01/13}{Added new keys for this set}
% \begin{macrocode}
\define@key{aebDocInfo}{Title}[]%
- {\@ifpackageloaded{aebxmp}{\Title{#1}}{}}
+ {\@ifpackageloaded{aebxmp}{\Title{#1}}{}}
\define@key{aebDocInfo}{authors}[]%
- {\@ifpackageloaded{aebxmp}{\Authors{#1}}{}}
+ {\@ifpackageloaded{aebxmp}{\Authors{#1}}{}}
\define@key{aebDocInfo}{Subject}[]%
- {\@ifpackageloaded{aebxmp}{\Subject{#1}}{\subject{#1}}}
+ {\@ifpackageloaded{aebxmp}{\Subject{#1}}{\subject{#1}}}
\define@key{aebDocInfo}{Keywords}[]%
- {\@ifpackageloaded{aebxmp}{\Keywords{#1}}{\keywords{#1}}}
+ {\@ifpackageloaded{aebxmp}{\Keywords{#1}}{\keywords{#1}}}
\define@key{aebDocInfo}{lang}[]%
- {\@ifpackageloaded{aebxmp}{\metaLang{#1}}{}}
+ {\@ifpackageloaded{aebxmp}{\metaLang{#1}}{}}
\define@key{aebDocInfo}{copyrightStatus}[]%
- {\@ifpackageloaded{aebxmp}{\copyrightStatus{#1}}{}}
+ {\@ifpackageloaded{aebxmp}{\copyrightStatus{#1}}{}}
\define@key{aebDocInfo}{copyrightNotice}[]%
- {\@ifpackageloaded{aebxmp}{\copyrightNotice{#1}}{}}
+ {\@ifpackageloaded{aebxmp}{\copyrightNotice{#1}}{}}
\define@key{aebDocInfo}{copyrightInfoURL}[]%
- {\@ifpackageloaded{aebxmp}{\copyrightInfoURL{#1}}{}}
+ {\@ifpackageloaded{aebxmp}{\copyrightInfoURL{#1}}{}}
\define@key{aebDocInfo}{authortitle}[]%
- {\@ifpackageloaded{aebxmp}{\authortitle{#1}}{}}
+ {\@ifpackageloaded{aebxmp}{\authortitle{#1}}{}}
\define@key{aebDocInfo}{descriptionwriter}[]%
- {\@ifpackageloaded{aebxmp}{\descriptionwriter{#1}}{}}
+ {\@ifpackageloaded{aebxmp}{\descriptionwriter{#1}}{}}
\define@key{aebDocInfo}{customProperties}[]%
- {\@ifpackageloaded{aebxmp}{\customProperties{#1}}{}}
+ {\@ifpackageloaded{aebxmp}{\customProperties{#1}}{}}
% \end{macrocode}
%
% \subsection{\texorpdfstring{\protect\cs{DeclarePageLayout}}{\CMD{DeclarePageLayout}}}
@@ -4221,39 +4128,35 @@
% footer.
% \begin{macrocode}
\newcommand{\DeclarePageLayout}[1]{\save@prtscr
- \setkeys{web@pl}{topmargin,headheight,marginparsep,%
- marginparwidth,marginparpush,webfootskip}%
-% \setkeys{web@pl}{#1}%
- \protected@edef\web@temp{\noexpand\setkeys{web@pl}{#1}}%
- \web@temp\save@prtscr
-% \setkeys{web@pl}{#1}%
- \ifx\web@pl@screensize\@empty\else
- \expandafter\screensize\web@pl@screensize\fi
- \ifx\web@pl@margins\@empty\else
- \expandafter\margins\web@pl@margins\fi
- \ifeqforpaper\else
- \ifdim\@Leftmargin<\@Rightmargin
- \ifdim\marginparwidth>\@Leftmargin
- \setlength{\marginparwidth}
- {\@Leftmargin-2\marginparsep}%
- \fi
- \else
- \ifdim\marginparwidth>\@Rightmargin
- \setlength{\marginparwidth}
- {\@Rightmargin-2\marginparsep}%
- \fi
- \fi
- \fi
- \ifeqforpaper\else
- \ifdim\@Bottommargin<\web@footskip\relax\PackageError{web}{%
- Error in the value of the webfootskip key\MessageBreak
- of the \string\DeclarePageLayout\space command.\MessageBreak
- The bottom margin must be larger then\MessageBreak
- the value of webfootskip}{%
- Increase the size of the bottom margin,\MessageBreak
- or decrease the value of webfootskip.}\else
- \fi
+ \setkeys{web@pl}{topmargin,headheight,marginparsep,%
+ marginparwidth,marginparpush,webfootskip}%
+ \protected@edef\web@temp{\noexpand\setkeys{web@pl}{#1}}%
+ \web@temp\save@prtscr
+ \ifx\web@pl@screensize\@empty\else
+ \expandafter\screensize\web@pl@screensize\fi
+ \ifx\web@pl@margins\@empty\else
+ \expandafter\margins\web@pl@margins\fi
+ \ifeqforpaper\else
+ \ifdim\@Leftmargin<\@Rightmargin
+ \ifdim\marginparwidth>\@Leftmargin
+ \setlength{\marginparwidth}
+ {\@Leftmargin-2\marginparsep}\fi
+ \else
+ \ifdim\marginparwidth>\@Rightmargin
+ \setlength{\marginparwidth}
+ {\@Rightmargin-2\marginparsep}\fi
\fi
+ \fi
+ \ifeqforpaper\else
+ \ifdim\@Bottommargin<\web@footskip\relax\PackageError{web}{%
+ Error in the value of the webfootskip key\MessageBreak
+ of the \string\DeclarePageLayout\space command.\MessageBreak
+ The bottom margin must be larger then\MessageBreak
+ the value of webfootskip}{%
+ Increase the size of the bottom margin,\MessageBreak
+ or decrease the value of webfootskip.}\fi
+ \fi
+ \InitLayout
}
\@onlypreamble\DeclarePageLayout
% \end{macrocode}
@@ -4270,8 +4173,8 @@
\define@key{web@pl}{margins}[]{\def\web@pl@margins{#1}}
\let\web@pl@margins\@empty
\define@choicekey+{web@pl}{design}[\val\nr]{designi,designii,%
- designiii,designiv,designv,designvi,designvii,designviii,designix}{%
- \ifcase\nr\relax
+ designiii,designiv,designv,designvi,designvii,designviii,designix}{%
+ \ifcase\nr\relax
\web@MargScrDimOpts{.25in}{.25in}{24pt}{.25in}{3.736in}{4.67in}\or
\web@MargScrDimOpts{.25in}{.25in}{24pt}{.25in}{4.5in}{5in}\or
\web@MargScrDimOpts{.25in}{.25in}{24pt}{.25in}{5in}{6in}\or
@@ -4281,22 +4184,22 @@
\web@MargScrDimOpts{.5in}{.5in}{24pt}{.5in}{7.5in}{10in}\or
\web@MargScrDimOpts{.5in}{.5in}{24pt}{.5in}{3.75in}{6.67in}\or
\web@MargScrDimOpts{.5in}{.5in}{24pt}{.5in}{3.75in}{6in}\fi
- }{\PackageWarning{webpro}{%
- Bad choice for design, use designi--designvix. Try again}}
+ }{\PackageWarning{webpro}{%
+ Bad choice for design, use designi--designvix. Try again}}
\define@choicekey+{web@pl}{screensizeOf}[\val\nr]{designi,designii,%
- designiii,designiv,designv,designvi,designvii,designviii,designix}{%
- \ifcase\nr\relax
- \screensize{3.736in}{4.67in}\or
- \screensize{4.5in}{5in}\or
- \screensize{5in}{6in}\or
- \screensize{4in}{5in}\or
- \screensize{4.5in}{6in}\or
- \screensize{4.17in}{4.67in}\or
- \screensize{7.5in}{10in}\or
- \screensize{3.75in}{6.67in}\or
- \screensize{3.75in}{6in}\fi
- }{\PackageWarning{webpro}{%
- Bad choice for screensizeOf, use designi--designvix. Try again}}
+ designiii,designiv,designv,designvi,designvii,designviii,designix}{%
+ \ifcase\nr\relax
+ \screensize{3.736in}{4.67in}\or
+ \screensize{4.5in}{5in}\or
+ \screensize{5in}{6in}\or
+ \screensize{4in}{5in}\or
+ \screensize{4.5in}{6in}\or
+ \screensize{4.17in}{4.67in}\or
+ \screensize{7.5in}{10in}\or
+ \screensize{3.75in}{6.67in}\or
+ \screensize{3.75in}{6in}\fi
+ }{\PackageWarning{webpro}{%
+ Bad choice for screensizeOf, use designi--designvix. Try again}}
\define@key{web@pl}{headheight}[8pt]{\def\websetheadheight{#1}}
% \end{macrocode}
%Key-values of \cs{DeclarePageLayout} continues.
@@ -4307,20 +4210,18 @@
%\IndexKey{evensidemargin}
% \begin{macrocode}
\define@key{web@pl}{topmargin}[\prtscr{\the\topmargin}{8pt}]{%
- \edef\web@argi{#1}\ifx\web@argi\@empty
- \edef\web@argi{\prtscr{\the\topmargin}{8pt}}\fi
- \ifeqforpaper
- \setlength{\topmargin}{\web@argi}%
- \else
- \setlength{\web@Topmargin}{\web@argi}%
- \fi}
+ \edef\web@argi{#1}\ifx\web@argi\@empty
+ \edef\web@argi{\prtscr{\the\topmargin}{8pt}}\fi
+ \ifeqforpaper
+ \setlength{\topmargin}{\web@argi}\else
+ \setlength{\web@Topmargin}{\web@argi}\fi}
\define@key{web@pl}{textwidth}[345pt]{\setlength{\textwidth}{#1}}
\define@key{web@pl}{textheight}[43\baselineskip]%
- {\setlength{\textheight}{#1}}
+ {\setlength{\textheight}{#1}}
\define@key{web@pl}{oddsidemargin}[63pt]%
- {\setlength{\oddsidemargin}{#1}}
+ {\setlength{\oddsidemargin}{#1}}
\define@key{web@pl}{evensidemargin}[63pt]%
- {\setlength{\evensidemargin}{#1}}
+ {\setlength{\evensidemargin}{#1}}
% \end{macrocode}
% More key-values of \cs{DeclarePageLayout}.
%\IndexKey{marginparsep}
@@ -4333,23 +4234,23 @@
%\IndexKey{additionalheadsep}
% \begin{macrocode}
\define@key{web@pl}{marginparsep}[\prtscr{\the\marginparsep}{11pt}]{%
- \edef\web@argi{#1}\ifx\web@argi\@empty
- \edef\web@argi{\prtscr{\the\marginparsep}{11pt}}\fi
- \setlength{\marginparsep}{\web@argi}}
+ \edef\web@argi{#1}\ifx\web@argi\@empty
+ \edef\web@argi{\prtscr{\the\marginparsep}{11pt}}\fi
+ \setlength{\marginparsep}{\web@argi}}
\define@key{web@pl}{marginparwidth}%
- [\prtscr{\the\marginparwidth}{.25in}]{%
- \edef\web@argi{#1}\ifx\web@argi\@empty
- \edef\web@argi{\prtscr{\the\marginparwidth}{.25in}}\fi
- \setlength{\marginparwidth}{\web@argi}}
+ [\prtscr{\the\marginparwidth}{.25in}]{%
+ \edef\web@argi{#1}\ifx\web@argi\@empty
+ \edef\web@argi{\prtscr{\the\marginparwidth}{.25in}}\fi
+ \setlength{\marginparwidth}{\web@argi}}
\define@key{web@pl}{marginparpush}[5pt]{%
- \setlength{\marginparpush}{#1}}
+ \setlength{\marginparpush}{#1}}
\define@key{web@pl}{webfootskip}[4pt]{%
- \def\web@footskip{#1}}
+ \def\web@footskip{#1}}
\define@key{web@pl}{footskip}[30pt]{\setlength{\footskip}{#1}}
\define@key{web@pl}{panelwidth}[1in]{\panelwidth{#1}}
\define@key{web@pl}{panelsep}[10pt]{\panelsep{#1}}
\define@key{web@pl}{additionalheadsep}[0pt]%
- {\def\web@additionalheadsep{#1}}
+ {\def\web@additionalheadsep{#1}}
% \end{macrocode}
% \end{macro}
%
@@ -4369,32 +4270,32 @@
% default. The alignment is set by \cs{halignuniversity}. The UI for this
% value is the \texttt{xhalign} key of \cs{universityLayout}.
% \begin{macrocode}
- \vglue\web@aboveTopTitleSkip
- \noindent\makebox[\linewidth][\halignuniversity]{\parbox{%
- \hproportionwebuniversity\linewidth}%
- {\sectionUniversity{\webuniversity}}}%
- \par\ifeqforpaper\else\minimumskip\fi
- \vspace{\stretch{1}}%
+ \vglue\web@aboveTopTitleSkip\noindent
+ \makebox[\linewidth][\halignuniversity]{\parbox{%
+ \hproportionwebuniversity\linewidth}%
+ {\sectionUniversity{\webuniversity}}}\par
+ \ifeqforpaper\else\minimumskip\fi
+ \vspace{\stretch{1}}\noindent
% \end{macrocode}
% Have \cs{webtitle} centered across the top of the title page, by
% default. The alignment is set by \cs{haligntitle}. The UI for this
% value is the \texttt{xhalign} key of \cs{titleLayout}.
% \begin{macrocode}
- \noindent\makebox[\linewidth][\haligntitle]%
- {\parbox{\hproportionwebtitle\linewidth}%
- {\sectionTitle{\webtitle}}}%
- \par\ifeqforpaper\vspace{2\baselineskip}\else
- \minimumskip\vspace{\stretch{1}}\fi
+ \makebox[\linewidth][\haligntitle]%
+ {\parbox{\hproportionwebtitle\linewidth}%
+ {\sectionTitle{\webtitle}}}%
+ \par\ifeqforpaper\vspace{2\baselineskip}\else
+ \minimumskip\vspace{\stretch{1}}\fi\noindent
% \end{macrocode}
% Have \cs{webauthor} centered across the top of the title page, by
% default. The alignment is set by \cs{halignauthor}. The UI for this
% value is the \texttt{xhalign} key of \cs{authorLayout}.
% \begin{macrocode}
- \noindent\makebox[\linewidth][\halignauthor]%
- {\parbox{\hproportionwebauthor\linewidth}%
- {\sectionAuthor{\webauthor}}}
- \par\ifeqforpaper\vspace{2\baselineskip}\else
- \minimumskip\vspace{\stretch{1}}\fi
+ \makebox[\linewidth][\halignauthor]%
+ {\parbox{\hproportionwebauthor\linewidth}%
+ {\sectionAuthor{\webauthor}}}
+ \par\ifeqforpaper\vspace{2\baselineskip}\else
+ \minimumskip\vspace{\stretch{1}}\fi
}
\newcommand{\topTitlePageProportion}[1]{\def\titleauthorproportion{#1}}
% \end{macrocode}
@@ -4408,13 +4309,13 @@
% \begin{macrocode}
\renewcommand{\titlepageTrailer}
{%
- \webtpTrailerWrapper{\makebox[\web@tp@linewidth]{%
- \parbox{\web@tp@linewidth}{%
- \ifx\tpTrailer@textcolor\@empty\else
- \color{\tpTrailer@textcolor}\fi\web@tpTrailer@formatting
- \maketitle@trailer@ul\hfill\maketitle@trailer@ur\\
- \maketitle@trailer@ll\hfill\maketitle@trailer@lr
- }}}%
+ \webtpTrailerWrapper{\makebox[\web@tp@linewidth]{%
+ \parbox{\web@tp@linewidth}{%
+ \ifx\tpTrailer@textcolor\@empty\else
+ \color{\tpTrailer@textcolor}\fi\web@tpTrailer@formatting
+ \maketitle@trailer@ul\hfill\maketitle@trailer@ur\\
+ \maketitle@trailer@ll\hfill\maketitle@trailer@lr
+ }}}%
}
% \end{macrocode}
% \end{macro}
@@ -4423,7 +4324,7 @@
% the default.
% \begin{macrocode}
\def\maketitle@trailer@ul{\web@copyright\ \web@copyright@symbol\
- \webcopyrightyears\ \thewebemail}
+ \webcopyrightyears\ \thewebemail}
\def\maketitle@trailer@ll{\aeb@Prepared}
\def\maketitle@trailer@ur{\aeb@talksite}
\def\maketitle@trailer@lr{\webversion}
@@ -4438,12 +4339,12 @@
\def\web@tp@linewidth{\linewidth}
% \end{macrocode}
% Key-values of \cmd{\DesignTitlePageTrailer}
-% \IndexKey{ul}
-% \IndexKey{ll}
-% \IndexKey{ur}
-% \IndexKey{lr}
-% \IndexKey{textColor}
-% \IndexKey{bgColor}
+% \IndexKey{ul}^^A
+% \IndexKey{ll}^^A
+% \IndexKey{ur}^^A
+% \IndexKey{lr}^^A
+% \IndexKey{textColor}^^A
+% \IndexKey{bgColor}^^A
% \begin{macrocode}
\define@key{tpTrailer}{ul}{\def\maketitle@trailer@ul{#1}}
\define@key{tpTrailer}{ll}{\def\maketitle@trailer@ll{#1}}
@@ -4452,12 +4353,12 @@
\define@key{tpTrailer}{textColor}{\def\tpTrailer@textcolor{#1}}
\define@key{tpTrailer}{bgColor}{\def\web@tpTrailerBgColor{#1}}
% \end{macrocode}
-% Key-values of \cmd{\DesignTitlePageTrailer}
-% \IndexKey{borderColor}
-% \IndexKey{fboxsep}
-% \IndexKey{fboxrule}
-% \IndexKey{graphic}
-% \IndexKey{namedgraphic}
+% More key-values of \cmd{\DesignTitlePageTrailer}
+% \IndexKey{borderColor}^^A
+% \IndexKey{fboxsep}^^A
+% \IndexKey{fboxrule}^^A
+% \IndexKey{graphic}^^A
+% \IndexKey{namedgraphic}^^A
% \begin{macrocode}
\define@key{tpTrailer}{borderColor}{\def\web@tpTrailerBorderColor{#1}}
\define@key{tpTrailer}{fboxsep}{\def\web@tpTrailerfboxsep{#1}}
@@ -4466,71 +4367,71 @@
\define@key{tpTrailer}{namedgraphic}{%
\def\web@tpTrailer@namedgraphic{#1}}
% \end{macrocode}
-% Key-values of \cmd{\DesignTitlePageTrailer}
-% \IndexKey{fontSize}
+% Key-values of \cmd{\DesignTitlePageTrailer}, continued.
+% \IndexKey{fontSize}^^A
% \IndexKey{formatting}
-% \IndexKey{raise}
+% \IndexKey{raise}^^A
% \begin{macrocode}
\define@key{tpTrailer}{fontSize}{\renewcommand{\trailerFontSize}{#1}}
\define@key{tpTrailer}{formatting}{\def\web@tpTrailer@formatting{#1}}
\define@key{tpTrailer}{raise}{\def\web@tpTrailer@raise{#1}}
\newcommand{\DesignTitlePageTrailer}[1]
{%
- \setkeys{tpTrailer}{fboxsep=3pt,fboxrule=.4pt}%
- \setkeys{tpTrailer}{#1}%
- \setlength{\fboxsep}{\web@tpTrailerfboxsep}%
- \setlength{\fboxrule}{\web@tpTrailerfboxrule}%
- \let\web@tp@graphic\web@NO
- \ifx\web@tpTrailer@graphic\@empty
- \ifx\web@tpTrailer@namedgraphic\@empty\else
- \let\web@tp@graphic\web@YES\fi
- \else\let\web@tp@graphic\web@YES\fi
- \ifx\web@tp@graphic\web@NO\relax
- \ifx\web@tpTrailerBgColor\@empty
- \def\grfbox@spec##1{##1}%
- \else
- \ifx\web@tpTrailerBorderColor\@empty
- \def\web@tp@linewidth{\linewidth-2\fboxsep}%
- \def\grfbox@spec{\colorbox{\web@tpTrailerBgColor}}%
- \else
- \def\web@tp@linewidth{%
- \linewidth-2\fboxsep-2\fboxrule}%
- \def\grfbox@spec{\fcolorbox{\web@tpTrailerBorderColor}%
- {\web@tpTrailerBgColor}}%
- \fi
- \fi
- \def\webtpTrailerWrapper##1{\smash{\raisebox
- {\web@tpTrailer@raise}{\grfbox@spec{##1}}}}%
+ \setkeys{tpTrailer}{fboxsep=3pt,fboxrule=.4pt}%
+ \setkeys{tpTrailer}{#1}%
+ \setlength{\fboxsep}{\web@tpTrailerfboxsep}%
+ \setlength{\fboxrule}{\web@tpTrailerfboxrule}%
+ \let\web@tp@graphic\web@NO
+ \ifx\web@tpTrailer@graphic\@empty
+ \ifx\web@tpTrailer@namedgraphic\@empty\else
+ \let\web@tp@graphic\web@YES\fi
+ \else\let\web@tp@graphic\web@YES\fi
+ \ifx\web@tp@graphic\web@NO\relax
+ \ifx\web@tpTrailerBgColor\@empty
+ \def\grfbox@spec##1{##1}%
\else
- \@ifundefined{graphicxbox}{\begingroup
- \gdef\webtpTrailerWrapper##1{%
- \edef\web@tmp@opt{\ifx\web@tpTrailer@namedgraphic\@empty\else
- name=\web@tpTrailer@namedgraphic,\fi}%
- \def\web@tp@linewidth{\linewidth-2\fboxsep}%
- \setbox0=\hbox{##1}%
- \noindent\makebox[0pt][l]{%
- \smash{\raisebox{-\dp0-\fboxsep+\web@tpTrailer@raise}{%
- \expandafter\includegraphics\expandafter[\web@tmp@opt
- width=\wd0+2\fboxsep,%
- height=\dp0+\ht0+2\fboxsep]{\web@tpTrailer@graphic}}%
- }}\kern\fboxsep\smash{%
- \raisebox{\web@tpTrailer@raise}{\unhbox0\relax}}%
- }%
- \endgroup}{%
- \xdef\grfbox@spec{%
- \ifx\web@tpTrailerBorderColor\@empty
- \noexpand\graphicxbox\else
- \noexpand\fgraphicxbox{\web@tpTrailerBorderColor}\fi
- \ifx\web@tpTrailer@namedgraphic\@empty\else
- [name=\web@tpTrailer@namedgraphic]\fi}%
- \gdef\webtpTrailerWrapper##1{%
- \edef\web@tp@linewidth{%
- \linewidth-2\fboxsep\ifx\web@tpTrailerBorderColor\@empty
- \else-2\fboxrule\fi}%
- \smash{\raisebox{\web@tpTrailer@raise}{%
- \grfbox@spec{\web@tpTrailer@graphic}{##1}}}}%
- }%
+ \ifx\web@tpTrailerBorderColor\@empty
+ \def\web@tp@linewidth{\linewidth-2\fboxsep}%
+ \def\grfbox@spec{\colorbox{\web@tpTrailerBgColor}}%
+ \else
+ \def\web@tp@linewidth{%
+ \linewidth-2\fboxsep-2\fboxrule}%
+ \def\grfbox@spec{\fcolorbox{\web@tpTrailerBorderColor}%
+ {\web@tpTrailerBgColor}}%
+ \fi
\fi
+ \def\webtpTrailerWrapper##1{\smash{\raisebox
+ {\web@tpTrailer@raise}{\grfbox@spec{##1}}}}%
+ \else
+ \@ifundefined{graphicxbox}{\begingroup
+ \gdef\webtpTrailerWrapper##1{%
+ \edef\web@tmp@opt{\ifx\web@tpTrailer@namedgraphic\@empty\else
+ name=\web@tpTrailer@namedgraphic,\fi}%
+ \def\web@tp@linewidth{\linewidth-2\fboxsep}%
+ \setbox0=\hbox{##1}%
+ \noindent\makebox[0pt][l]{%
+ \smash{\raisebox{-\dp0-\fboxsep+\web@tpTrailer@raise}{%
+ \expandafter\includegraphics\expandafter[\web@tmp@opt
+ width=\wd0+2\fboxsep,%
+ height=\dp0+\ht0+2\fboxsep]{\web@tpTrailer@graphic}}%
+ }}\kern\fboxsep\smash{%
+ \raisebox{\web@tpTrailer@raise}{\unhbox0\relax}}%
+ }%
+ \endgroup}{%
+ \xdef\grfbox@spec{%
+ \ifx\web@tpTrailerBorderColor\@empty
+ \noexpand\graphicxbox\else
+ \noexpand\fgraphicxbox{\web@tpTrailerBorderColor}\fi
+ \ifx\web@tpTrailer@namedgraphic\@empty\else
+ [name=\web@tpTrailer@namedgraphic]\fi}%
+ \gdef\webtpTrailerWrapper##1{%
+ \edef\web@tp@linewidth{%
+ \linewidth-2\fboxsep\ifx\web@tpTrailerBorderColor\@empty
+ \else-2\fboxrule\fi}%
+ \smash{\raisebox{\web@tpTrailer@raise}{%
+ \grfbox@spec{\web@tpTrailer@graphic}{##1}}}}%
+ }%
+ \fi
}
% \end{macrocode}
% \end{macro}
@@ -4547,36 +4448,36 @@
% This value can be set by direct definition, or through the helper command
% \cs{topTitlePageProportion}.
% \begin{macrocode}
- \maketitlepreamble
+ \maketitlepreamble
% \end{macrocode}
% \begin{macrocode}
- \ifeqforpaper\vspace*{2\baselineskip}\else
+ \ifeqforpaper\vspace*{2\baselineskip}\else
\vbox to\titleauthorproportion\textheight\bgroup\fi
% \end{macrocode}
% \begin{macrocode}
- \topTitlePage
+ \topTitlePage
% \end{macrocode}
% \begin{macrocode}
- \ifeqforpaper\else\egroup\fi % end of \vbox for title and author
+ \ifeqforpaper\else\egroup\fi % end of \vbox for title and author
% \end{macrocode}
% Now place the \cs{optionalpagematter}
% \begin{macrocode}
- \begingroup\par
- \aboveOPMvspace
- \noindent\parbox{\linewidth}{\optionalpagematter}%
- \par\endgroup
- \par\vspace{\stretch{1}}
+ \begingroup\par
+ \aboveOPMvspace\noindent
+ \parbox{\linewidth}{\optionalpagematter}\par
+ \endgroup
+ \par\vspace{\stretch{1}}
% \end{macrocode}
% Insert the directory, as desired.
% \begin{macrocode}
- \ifx\web@directory@option\web@YES\web@directory@hook\webdirectory\fi
- \par\ifeqforpaper\else\minimumskip\fi\vspace{\stretch{1}}
+ \ifx\web@directory@option\web@YES\web@directory@hook\webdirectory\fi
+ \par\ifeqforpaper\else\minimumskip\fi\vspace{\stretch{1}}%
% \end{macrocode}
% Insert the ``bottom matter''.
% \begin{macrocode}
- \vfill\noindent\begingroup\trailerFontSize\titlepageTrailer
- \par\endgroup
- \maketitlepostamble
+ \vfill\noindent\begingroup\trailerFontSize\titlepageTrailer
+ \par\endgroup
+ \maketitlepostamble
}
\let\web@maketitle@save\maketitle
\let\maketitle\web@maketitle
@@ -4601,7 +4502,7 @@
% to describe where this talk occurred.
% \begin{macrocode}
\def\talkdate#1{\gdef\web@talkdate@value{#1}%
- \edef\webtalkdate{\ifx\web@talkdate@value\@empty
+ \edef\webtalkdate{\ifx\web@talkdate@value\@empty
\else\noexpand\web@talkdatelabel\ #1\fi}}
\let\web@talkdate@value\@empty
%\def\talkdateLabel#1{\def\web@versionlabel{#1}}
@@ -4618,48 +4519,50 @@
% \IndexKey{reset}
% \begin{macrocode}
\define@choicekey+{aebsection}{reset}[\val\nr]{font,all}{%
- \ifcase\nr\relax
- \aeb@reset@section@fonts\or
- \aeb@reset@section@all\fi
+ \ifcase\nr\relax
+ \aeb@reset@section@fonts\or
+ \aeb@reset@section@all
+ \fi
}{\PackageWarning{webpro}{Bad choice for reset, permissible values
are font and all. Try again}}
% \end{macrocode}
% Section headings
-% \IndexKey{type}
-% \IndexKey{special}
+% \IndexKey{type}^^A
+% \IndexKey{special}^^A
% \begin{macrocode}
\define@choicekey+{aebsection}{type}[\val\nr]{section,subsection,%
- subsubsection,university,title,author,toc}%
+ subsubsection,university,title,author,toc}%
{%
- \edef\aeb@section@type{#1}%
- \edef\aeb@section@typeIndex{\nr}%
+ \edef\aeb@section@type{#1}%
+ \edef\aeb@section@typeIndex{\nr}%
}{}{}
\define@key{aebsection}{special}{%
- \edef\aeb@temp@expand{%
- \noexpand\XKV@cc+[\noexpand\val\noexpand\nr]{#1}}%
- \aeb@temp@expand{shadow,framebox,colorbox,fcolorbox,frameboxfit,%
- colorboxfit,fcolorboxfit,colorboxfitrule,custom,default}%
+ \edef\aeb@temp@expand{%
+ \noexpand\XKV@cc+[\noexpand\val\noexpand\nr]{#1}}%
+ \aeb@temp@expand{shadow,framebox,colorbox,fcolorbox,frameboxfit,%
+ colorboxfit,fcolorboxfit,colorboxfitrule,custom,default}%
{%
\ifcase\nr\relax
- \w@csarg\let{aeb@\aeb@section@type @special}\aeb@shadowHead\or
- \w@csarg\let{aeb@\aeb@section@type @special}\aeb@frameboxHead\or
- \w@csarg\let{aeb@\aeb@section@type @special}\aeb@colorboxHead\or
- \w@csarg\let{aeb@\aeb@section@type @special}\aeb@fcolorboxHead\or
- \w@csarg\let{aeb@\aeb@section@type @special}\aeb@frameboxfitHead\or
- \w@csarg\let{aeb@\aeb@section@type @special}\aeb@colorboxfitHead\or
- \w@csarg\let{aeb@\aeb@section@type @special}
- \aeb@fcolorboxfitHead\or
- \w@csarg\let{aeb@\aeb@section@type @special}
- \aeb@colorboxfitruleHead\or
- \edef\aeb@temp{\noexpand\def\expandafter\noexpand
+ \w@csarg\let{aeb@\aeb@section@type @special}\aeb@shadowHead\or
+ \w@csarg\let{aeb@\aeb@section@type @special}\aeb@frameboxHead\or
+ \w@csarg\let{aeb@\aeb@section@type @special}\aeb@colorboxHead\or
+ \w@csarg\let{aeb@\aeb@section@type @special}\aeb@fcolorboxHead\or
+ \w@csarg\let{aeb@\aeb@section@type @special}\aeb@frameboxfitHead\or
+ \w@csarg\let{aeb@\aeb@section@type @special}\aeb@colorboxfitHead\or
+ \w@csarg\let{aeb@\aeb@section@type @special}
+ \aeb@fcolorboxfitHead\or
+ \w@csarg\let{aeb@\aeb@section@type @special}
+ \aeb@colorboxfitruleHead\or
+ \edef\aeb@temp{\noexpand\def\expandafter\noexpand
\csname aeb@\aeb@section@type @special\endcsname{\expandafter
- \noexpand\csname aeb@\aeb@section@type @customHead\endcsname}}%
- \aeb@temp\or
- \w@csarg\let{aeb@\aeb@section@type @special}\@empty\fi
+ \noexpand\csname aeb@\aeb@section@type @customHead\endcsname}}%
+ \aeb@temp\or
+ \w@csarg\let{aeb@\aeb@section@type @special}\@empty
+ \fi
}{%
- \PackageWarning{webpro}{Bad choice for special, permissible values
- are shadow, framebox, colorbox, fcolorbox, custom and default.
- Try again}}%
+ \PackageWarning{webpro}{Bad choice for special, permissible values
+ are shadow, framebox, colorbox, fcolorbox, custom and default.
+ Try again}}%
}
\@tfor\@@tmp:={section}{subsection}{subsubsection}%
{university}{title}{author}{toc}\do{%
@@ -4693,86 +4596,87 @@
% The command\DescribeMacro{\aeb@frameboxHead} for \texttt{special=framebox}.
% \begin{macrocode}
\def\aeb@frameboxHead#1{%
- \begingroup
+ \begingroup
\@tempdima=\linewidth
\advance\@tempdima-2\fboxsep
\advance\@tempdima-2\fboxrule
\edef\@@aeb@sectionframecolor
- {\@nameuse{aeb@\aeb@section@type framecolor}}%
+ {\@nameuse{aeb@\aeb@section@type framecolor}}%
\edef\@@aeb@sectioncolor
- {\@nameuse{aeb@\aeb@section@type color}}%
- \setbox0\vbox{\hsize=\@tempdima#1}\color{\@@aeb@sectionframecolor}%
- \framebox{\color{\@@aeb@sectioncolor}\copy0}%
- \endgroup
+ {\@nameuse{aeb@\aeb@section@type color}}%
+ \setbox\z@\vbox{\hsize=\@tempdima#1}%
+ \color{\@@aeb@sectionframecolor}%
+ \framebox{\color{\@@aeb@sectioncolor}\copy\z@}%
+ \endgroup
}
% \end{macrocode}
% The command\DescribeMacro{\aeb@colorboxHead} for \texttt{special=colorbox}.
% \begin{macrocode}
\def\aeb@colorboxHead#1{%
- \begingroup
+ \begingroup
\@tempdima=\linewidth
\advance\@tempdima-2\fboxsep
- \setbox0\vbox{\hsize=\@tempdima#1}%
+ \setbox\z@\vbox{\hsize=\@tempdima#1}%
\edef\@@aeb@sectionbgcolor
{\@nameuse{aeb@\aeb@section@type bgcolor}}%
- \colorbox{\@@aeb@sectionbgcolor}{\copy0}%
- \endgroup
+ \colorbox{\@@aeb@sectionbgcolor}{\copy\z@}%
+ \endgroup
}
% \end{macrocode}
% The command\DescribeMacro{\aeb@fcolorboxHead} for \texttt{special=fcolorbox}.
% \begin{macrocode}
\def\aeb@fcolorboxHead#1{%
- \begingroup
- \@tempdima=\linewidth
+ \begingroup
+ \@tempdima=\linewidth
\advance\@tempdima-2\fboxsep
\advance\@tempdima-2\fboxrule
- \setbox0\vbox{\hsize=\@tempdima#1}%
+ \setbox\z@\vbox{\hsize=\@tempdima#1}%
\edef\@@aeb@sectionbgcolor
- {\@nameuse{aeb@\aeb@section@type bgcolor}}%
+ {\@nameuse{aeb@\aeb@section@type bgcolor}}%
\fcolorbox{\aeb@sectionframecolor}%
- {\@@aeb@sectionbgcolor}{\copy0}
- \endgroup
+ {\@@aeb@sectionbgcolor}{\copy\z@}
+ \endgroup
}
% \end{macrocode}
% The command\DescribeMacro{\aeb@frameboxfitHead} for \texttt{special=frameboxfit}.
% \begin{macrocode}
\def\aeb@frameboxfitHead#1{%
- \begingroup
+ \begingroup
\edef\@@aeb@sectionframecolor
- {\@nameuse{aeb@\aeb@section@type framecolor}}%
+ {\@nameuse{aeb@\aeb@section@type framecolor}}%
\edef\@@aeb@sectioncolor
- {\@nameuse{aeb@\aeb@section@type color}}%
+ {\@nameuse{aeb@\aeb@section@type color}}%
\vbox{\color{\@@aeb@sectionframecolor}%
\framebox{\color{\@@aeb@sectioncolor}#1}}%
- \endgroup
+ \endgroup
}
% \end{macrocode}
% The command\DescribeMacro{\aeb@colorboxfitHead} for \texttt{special=colorboxfit}.
% \begin{macrocode}
\def\aeb@colorboxfitHead#1{%
- \begingroup
+ \begingroup
\edef\@@aeb@sectioncolor
- {\@nameuse{aeb@\aeb@section@type color}}%
+ {\@nameuse{aeb@\aeb@section@type color}}%
\edef\@@aeb@sectionbgcolor
- {\@nameuse{aeb@\aeb@section@type bgcolor}}%
+ {\@nameuse{aeb@\aeb@section@type bgcolor}}%
\vbox{\colorbox{\@@aeb@sectionbgcolor}%
- {\color{\@@aeb@sectioncolor}#1}}%
- \endgroup
+ {\color{\@@aeb@sectioncolor}#1}}%
+ \endgroup
}
% \end{macrocode}
% The command\DescribeMacro{\aeb@fcolorboxfitHead} for \texttt{special=fcolorboxfit}.
% \begin{macrocode}
\def\aeb@fcolorboxfitHead#1{%
- \begingroup
+ \begingroup
\edef\@@aeb@sectioncolor
- {\@nameuse{aeb@\aeb@section@type color}}%
+ {\@nameuse{aeb@\aeb@section@type color}}%
\edef\@@aeb@sectionbgcolor
- {\@nameuse{aeb@\aeb@section@type bgcolor}}%
+ {\@nameuse{aeb@\aeb@section@type bgcolor}}%
\edef\@@aeb@sectionframecolor
- {\@nameuse{aeb@\aeb@section@type framecolor}}%
+ {\@nameuse{aeb@\aeb@section@type framecolor}}%
\vbox{\fcolorbox{\@@aeb@sectionframecolor}{\@@aeb@sectionbgcolor}%
- {\color{\@@aeb@sectioncolor}#1}}%
- \endgroup
+ {\color{\@@aeb@sectioncolor}#1}}%
+ \endgroup
}
% \end{macrocode}
% Here we define \DescribeMacro{\shadowhoffset}\cs{shadowhoffset} and
@@ -4786,95 +4690,95 @@
% \end{macrocode}
% The command\DescribeMacro{\aeb@shadowHead} for \texttt{special=shadow}.
% \begin{macrocode}
-\def\aeb@shadowHead#1{% dps1
- \begingroup
+\def\aeb@shadowHead#1{%
+ \begingroup
\edef\@@aeb@sectionshadowcolor
- {\@nameuse{aeb@\aeb@section@type shadowcolor}}%
+ {\@nameuse{aeb@\aeb@section@type shadowcolor}}%
\edef\@@aeb@sectioncolor
- {\@nameuse{aeb@\aeb@section@type color}}%
- \setbox0\vbox{\Shadowtrue\hsize=\linewidth #1}%
- \wd0\z@\dp0\z@\relax\raisebox{\aeb@shadowvoffset}%
+ {\@nameuse{aeb@\aeb@section@type color}}%
+ \setbox\z@\vbox{\Shadowtrue\hsize=\linewidth #1}%
+ \wd\z@\z@\dp\z@\z@\raisebox{\aeb@shadowvoffset}%
{\hbox to\z@{\kern\aeb@shadowhoffset%
\Shadowtrue\color{\@@aeb@sectionshadowcolor}
- \box0\hss}}%
- \setbox0\vbox{\Shadowfalse\hsize=\linewidth #1}\box0
- \endgroup
+ \box\z@\hss}}\setbox\z@
+ \vbox{\Shadowfalse\hsize=\linewidth #1}\box\z@
+ \endgroup
}
% \end{macrocode}
% \texttt{usefont}\IndexKey{usefont} allows for a custom shift in font for the title.
% it takes four argument, each of which are enclosed in braces:
-%\begin{verbatim}
-% {<fontencoding>}{<fontfamily>}{<fontseries>}{<fontshape>}
-% {{<fontsize>}{<skip>}}
-%\end{verbatim}
+%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars={!()},codes={\catcode`\%=9}]
+% {!ameta(fontencoding)}{!ameta(fontfamily)}{!ameta(fontseries)}{!ameta(fontshape)}
+% {{!ameta(fontsize)}{!ameta(skip)}}
+%\end{Verbatim}
% \begin{macrocode}
\define@key{aebsection}{usefont}{%
- \w@csarg\def{aeb@\aeb@section@type @usefont}{\aeb@usefont#1}}
+ \w@csarg\def{aeb@\aeb@section@type @usefont}{\aeb@usefont#1}}
\@tfor\@@tmp:={section}{subsection}{subsubsection}
-{university}{title}{author}{toc}\do{%
+ {university}{title}{author}{toc}\do{%
\w@csarg\let{aeb@\@@tmp @usefont}\@empty}
\def\aeb@usefont#1#2#3#4#5{\def\aeb@usefontargv{#5}%
- \ifx\aeb@usefontargv\@empty
+ \ifx\aeb@usefontargv\@empty
% \end{macrocode}
% If the fifth parameter is empty, no font size is specified, we'll
% use the default sizes. We gobble up the next three tokens in the
% definition of \cs{section}, excluding the token that sets size.
% \begin{macrocode}
- \def\aeb@next{\expandafter\@gobble\@gobbletwo}%
- \else
+ \def\aeb@next{\expandafter\@gobble\@gobbletwo}%
+ \else
% \end{macrocode}
% If the fifth parameter is not empty, font size is specified,
% we'll gobble up the next four tokens in the
% definition of \cs{section}, including the token that sets size.
% \begin{macrocode}
- \def\aeb@next{\expandafter\@gobbletwo\@gobbletwo}%
- \fi
- \fontencoding{#1}\fontfamily{#2}%
- \fontseries{#3}\fontshape{#4}\ifx\aeb@usefontargv\@empty\else
- \fontsize#5\fi\selectfont\aeb@next
+ \def\aeb@next{\expandafter\@gobbletwo\@gobbletwo}%
+ \fi
+ \fontencoding{#1}\fontfamily{#2}%
+ \fontseries{#3}\fontshape{#4}\ifx\aeb@usefontargv\@empty\else
+ \fontsize#5\fi\selectfont\aeb@next
}
% \end{macrocode}
% Font related keys.\IndexKey{fontfamily}\IndexKey{fontseries}\IndexKey{fontshape}
% \begin{macrocode}
\define@key{aebsection}{fontfamily}{%
- \edef\aeb@temp@expand{\noexpand\XKV@cc+{#1}}%
- \aeb@temp@expand{rmfamily,sffamily,ttfamily}{%
- \w@csarg\def{aeb@\aeb@section@type @fontfamily}{\@nameuse{#1}}%
+ \edef\aeb@temp@expand{\noexpand\XKV@cc+{#1}}%
+ \aeb@temp@expand{rmfamily,sffamily,ttfamily}{%
+ \w@csarg\def{aeb@\aeb@section@type @fontfamily}{\@nameuse{#1}}%
}{\PackageWarning{webpro}{Bad choice for fontfamily, permissible values
- are rmfamily, sffamily and ttfamily. Try again}}%
-}
+ are rmfamily, sffamily and ttfamily. Try again}}}
\@tfor\@@tmp:={section}{subsection}{subsubsection}{university}{title}%
-{author}{toc}\do{\w@csarg\let{aeb@\@@tmp @fontfamily}\aeb@defaultfamily}
+ {author}{toc}\do
+ {\w@csarg\let{aeb@\@@tmp @fontfamily}\aeb@defaultfamily}
\define@key{aebsection}{fontseries}{%
- \edef\aeb@temp@expand{\noexpand\XKV@cc+{#1}}%
- \aeb@temp@expand{bfseries,mdseries}{%
- \w@csarg\def{aeb@\aeb@section@type @fontseries}{\@nameuse{#1}}%
+ \edef\aeb@temp@expand{\noexpand\XKV@cc+{#1}}%
+ \aeb@temp@expand{bfseries,mdseries}{%
+ \w@csarg\def{aeb@\aeb@section@type @fontseries}{\@nameuse{#1}}%
}{\PackageWarning{webpro}{Bad choice for fontseries, permissible values
- are bfseries and mdseries. Try again}}%
-}
+ are bfseries and mdseries. Try again}}}
\@tfor\@@tmp:={section}{subsection}{subsubsection}{university}{title}%
-{author}{toc}\do{\w@csarg\let{aeb@\@@tmp @fontseries}\bfseries}
+ {author}{toc}\do{\w@csarg\let{aeb@\@@tmp @fontseries}\bfseries}
\define@key{aebsection}{fontshape}{%
- \edef\aeb@temp@expand{\noexpand\XKV@cc+{#1}}%
- \aeb@temp@expand{upshape,itshape,scshape,slshape}{%
- \w@csarg\def{aeb@\aeb@section@type @fontshape}{\@nameuse{#1}}%
+ \edef\aeb@temp@expand{\noexpand\XKV@cc+{#1}}%
+ \aeb@temp@expand{upshape,itshape,scshape,slshape}{%
+ \w@csarg\def{aeb@\aeb@section@type @fontshape}{\@nameuse{#1}}%
}{\PackageWarning{webpro}{Bad choice for fontshape, permissible values
are upshape, itshape, scshape and slshape. Try again}}%
}
\@tfor\@@tmp:={section}{subsection}{subsubsection}{university}{title}%
-{author}{toc}\do{\w@csarg\let{aeb@\@@tmp @fontshape}\upshape}
+ {author}{toc}\do{\w@csarg\let{aeb@\@@tmp @fontshape}\upshape}
\define@key{aebsection}{fontsize}{%
- \edef\aeb@temp@expand{\noexpand\XKV@cc+{#1}}%
- \aeb@temp@expand{tiny,scriptsize,footnotesize,%
- small,normalsize,large,Large,LARGE,huge,Huge}{%
- \w@csarg\def{aeb@\aeb@section@type @fontsize}{\@nameuse{#1}}%
+ \edef\aeb@temp@expand{\noexpand\XKV@cc+{#1}}%
+ \aeb@temp@expand{tiny,scriptsize,footnotesize,%
+ small,normalsize,large,Large,LARGE,huge,Huge}{%
+ \w@csarg\def{aeb@\aeb@section@type @fontsize}{\@nameuse{#1}}%
}{\PackageWarning{webpro}{Bad choice for fontsize, permissible values
- are tiny, scriptsize, footnotesize, small, normalsize,
- large, Large, LARGE, huge and Huge. Try again}}%
+ are tiny, scriptsize, footnotesize, small, normalsize,
+ large, Large, LARGE, huge and Huge. Try again}}%
}
\@tfor\@@tmp:={{section}{\normalsize}}{{subsection}{\normalsize}}%
-{{subsubsection}{\normalsize}}{{university}{\normalsize}}%
-{{title}{\large}}{{author}{\normalsize}}{{toc}{\small}}\do{%
+ {{subsubsection}{\normalsize}}{{university}{\normalsize}}%
+ {{title}{\large}}{{author}{\normalsize}}{{toc}{\small}}\do{%
\expandafter\getargs\@@tmp
\edef\aeb@temp{\global\noexpand
\let\expandafter\noexpand\csname aeb@\aeb@argi @fontsize\endcsname
@@ -4884,23 +4788,22 @@
% Alignment related keys\IndexKey{halign}
% \begin{macrocode}
\define@key{aebsection}{halign}{%
- \edef\aeb@temp@expand{%
- \noexpand\XKV@cc+[\noexpand\val\noexpand\nr]{#1}}%
- \aeb@temp@expand{l,c,r}{%
- \ifcase\nr\relax
- \w@csarg\let{aeb@\aeb@section@type @halign}\raggedright\or
- \w@csarg\let{aeb@\aeb@section@type @halign}\centering\or
- \w@csarg\let{aeb@\aeb@section@type @halign}\raggedleft\fi
+ \edef\aeb@temp@expand{\noexpand
+ \XKV@cc+[\noexpand\val\noexpand\nr]{#1}}%
+ \aeb@temp@expand{l,c,r}{%
+ \ifcase\nr\relax
+ \w@csarg\let{aeb@\aeb@section@type @halign}\raggedright\or
+ \w@csarg\let{aeb@\aeb@section@type @halign}\centering\or
+ \w@csarg\let{aeb@\aeb@section@type @halign}\raggedleft\fi
}{\PackageWarning{webpro}{Bad choice for halign, permissible values
are l, c and r. Try again}}%
}
\@tfor\@@tmp:={\aeb@section@halign\raggedright}
-{\aeb@subsection@halign\raggedright}
-{\aeb@subsubsection@halign\raggedright}
-{\aeb@university@halign\centering}
-{\aeb@title@halign\centering}{\aeb@author@halign\centering}%
-{\aeb@toc@halign\centering}\do
-{%
+ {\aeb@subsection@halign\raggedright}
+ {\aeb@subsubsection@halign\raggedright}
+ {\aeb@university@halign\centering}
+ {\aeb@title@halign\centering}{\aeb@author@halign\centering}%
+ {\aeb@toc@halign\centering}\do{%
\expandafter\getargs\@@tmp
\edef\aeb@temp{\noexpand\let\expandafter\noexpand\aeb@argi
\expandafter\noexpand\aeb@argii}\aeb@temp
@@ -4909,20 +4812,20 @@
% Color, rule, and ding related keys\IndexKey{ding}\IndexKey{color}\IndexKey{ruleheight}%
% \IndexKey{ruleheigtht}\IndexKey{numdingcolor}
% \begin{macrocode}
-\define@key{aebsection}{ding}{\if\aeb@use@section@numbers0
- \webtoksi=\expandafter{\expandafter\protect
- \expandafter\web@sel@sec@col\expandafter{\aeb@section@type}#1\ }%
- \w@csarg\edef{aeb@\aeb@section@type Num}##1{\the\webtoksi}%
- \else\PackageWarning{webpro}{The ding key is not available with a
- section numbering system,\MessageBreak
- ignoring request for a ding.}\fi
+\define@key{aebsection}{ding}{\if\aeb@use@section@numbers\web@Zero
+ \webtoksi=\expandafter{\expandafter\protect
+ \expandafter\web@sel@sec@col\expandafter{\aeb@section@type}#1\ }%
+ \w@csarg\edef{aeb@\aeb@section@type Num}##1{\the\webtoksi}%
+ \else\PackageWarning{webpro}{The ding key is not available with a
+ section numbering system,\MessageBreak
+ ignoring request for a ding.}\fi
}
\define@key{aebsection}{color}{%
- \w@csarg\def{aeb@\aeb@section@type color}{#1}}
+ \w@csarg\def{aeb@\aeb@section@type color}{#1}}
\define@key{aebsection}{ruleheight}{%
- \w@csarg\def{aeb@\aeb@section@type ruleheight}{#1}}
+ \w@csarg\def{aeb@\aeb@section@type ruleheight}{#1}}
\define@key{aebsection}{numdingcolor}{%
- \w@csarg\def{aeb@\aeb@section@type numdingcolor}{#1}}
+ \w@csarg\def{aeb@\aeb@section@type numdingcolor}{#1}}
% \end{macrocode}
% Section color defaults
% \begin{macrocode}
@@ -4966,7 +4869,7 @@
\def\aeb@authorframecolor{blue}
\def\aeb@tocframecolor{blue}
\define@key{aebsection}{bgcolor}{%
- \w@csarg\def{aeb@\aeb@section@type bgcolor}{#1}}
+ \w@csarg\def{aeb@\aeb@section@type bgcolor}{#1}}
\def\aeb@sectionbgcolor{cornsilk}
\def\aeb@subsectionbgcolor{cornsilk}
\def\aeb@subsubsectionbgcolor{cornsilk}
@@ -4975,7 +4878,7 @@
\def\aeb@authorbgcolor{cornsilk}
\def\aeb@tocbgcolor{cornsilk}
\define@key{aebsection}{shadowcolor}{%
- \w@csarg\def{aeb@\aeb@section@type shadowcolor}{#1}}
+ \w@csarg\def{aeb@\aeb@section@type shadowcolor}{#1}}
\def\aeb@sectionshadowcolor{black}
\def\aeb@subsectionshadowcolor{black}
\def\aeb@subsubsectionshadowcolor{black}
@@ -4987,9 +4890,9 @@
% Indent\IndexKey{indent}
% \begin{macrocode}
\define@key{aebsection}{indent}[0pt]{%
- \edef\web@argi{#1}\ifx\web@argi\@empty
- \def\web@argi{0pt}\fi
- \w@csarg\edef{aeb@\aeb@section@type @indent}{\web@argi}}
+ \edef\web@argi{#1}\ifx\web@argi\@empty
+ \def\web@argi{0pt}\fi
+ \w@csarg\edef{aeb@\aeb@section@type @indent}{\web@argi}}
\def\aeb@section@indent{\z@}
\def\aeb@subsection@indent{\z@}
\def\aeb@subsubsection@indent{\z@}
@@ -5001,7 +4904,7 @@
%Other keys\IndexKey{beforeskip}\IndexKey{afterskip}
% \begin{macrocode}
\define@key{aebsection}{beforeskip}{%
- \w@csarg\def{aeb@\aeb@section@type @beforeskip}{#1}}
+ \w@csarg\def{aeb@\aeb@section@type @beforeskip}{#1}}
\def\aeb@section@beforeskip{-3ex\@plus -1ex \@minus-.2ex}
\def\aeb@subsection@beforeskip{-2.5ex\@plus -1ex \@minus -.2ex}
\def\aeb@subsubsection@beforeskip{-2ex\@plus -1ex \@minus -.2ex}
@@ -5010,7 +4913,7 @@
\def\aeb@author@beforeskip{-1ex\@plus -1ex \@minus-.2ex}
\def\aeb@toc@beforeskip{-3ex\@plus -1ex \@minus-.2ex}
\define@key{aebsection}{afterskip}{%
- \w@csarg\def{aeb@\aeb@section@type @afterskip}{#1}}
+ \w@csarg\def{aeb@\aeb@section@type @afterskip}{#1}}
\def\aeb@section@afterskip{1ex\@plus .2ex}
\def\aeb@subsection@afterskip{1ex\@plus .2ex}
\def\aeb@subsubsection@afterskip{.5ex\@plus .2ex}
@@ -5032,9 +4935,9 @@
% the title or author. This alignment will be across the width of the text region.
% \begin{macrocode}
\define@key{aebsection}{xhalign}{%
- \edef\aeb@temp@expand{\noexpand\XKV@cc+{#1}}%
- \aeb@temp@expand{l,c,r}{%
- \w@csarg\def{halign\aeb@section@type}{#1}%
+ \edef\aeb@temp@expand{\noexpand\XKV@cc+{#1}}%
+ \aeb@temp@expand{l,c,r}{%
+ \w@csarg\def{halign\aeb@section@type}{#1}%
}{\PackageWarning{webpro}{Bad choice for xhalign, permissible values
are l, c and r. Try again}}%
}
@@ -5053,58 +4956,56 @@
% \end{macrocode}
% Commands that hold the reset values.
% \begin{macrocode}
-\def\aeb@reset@section@fonts{%
- \normalfont\normalsize
- \ifcase\aeb@section@typeIndex\relax
- \let\aeb@section@usefont\@empty
- \let\aeb@section@fontfamily\aeb@defaultfamily
- \let\aeb@section@fontseries\bfseries
- \let\aeb@section@fontshape\upshape
- \let\aeb@section@fontsize\Large
- \or
- \let\aeb@subsection@usefont\@empty
- \let\aeb@subsection@fontfamily\aeb@defaultfamily
- \let\aeb@subsection@fontseries\bfseries
- \let\aeb@subsection@fontshape\upshape
- \let\aeb@subsection@fontsize\large
- \or
- \let\aeb@subsubsection@usefont\@empty
- \let\aeb@subsubsection@fontfamily\aeb@defaultfamily
- \let\aeb@subsubsection@fontseries\bfseries
- \let\aeb@subsubsection@fontshape\upshape
- \let\aeb@subsubsection@fontsize\normalsize
- \fi
+\def\aeb@reset@section@fonts{\normalfont\normalsize
+ \ifcase\aeb@section@typeIndex\relax
+ \let\aeb@section@usefont\@empty
+ \let\aeb@section@fontfamily\aeb@defaultfamily
+ \let\aeb@section@fontseries\bfseries
+ \let\aeb@section@fontshape\upshape
+ \let\aeb@section@fontsize\Large
+ \or
+ \let\aeb@subsection@usefont\@empty
+ \let\aeb@subsection@fontfamily\aeb@defaultfamily
+ \let\aeb@subsection@fontseries\bfseries
+ \let\aeb@subsection@fontshape\upshape
+ \let\aeb@subsection@fontsize\large
+ \or
+ \let\aeb@subsubsection@usefont\@empty
+ \let\aeb@subsubsection@fontfamily\aeb@defaultfamily
+ \let\aeb@subsubsection@fontseries\bfseries
+ \let\aeb@subsubsection@fontshape\upshape
+ \let\aeb@subsubsection@fontsize\normalsize
+ \fi
}
-\def\aeb@reset@section@all{%
- \aeb@reset@section@fonts
- \ifcase\aeb@section@typeIndex\relax
- \let\aeb@section@halign\raggedright
- \def\aeb@sectioncolor{blue}%
- \def\aeb@sectionshadowcolor{black}%
- \let\aeb@section@special=\@empty
- \def\aeb@section@beforeskip{-3ex\@plus -1ex \@minus-.2ex}%
- \def\aeb@section@afterskip{1ex\@plus .2ex}%
- \def\aeb@sectionframecolor{blue}%
- \def\aeb@sectionframecolor{cornsilk}%
- \or
- \let\aeb@subsection@halign\raggedright
- \def\aeb@subsectioncolor{blue}%
- \def\aeb@subsectionshadowcolor{black}%
- \let\aeb@subsection@special=\@empty
- \def\aeb@subsection@beforeskip{-2.5ex\@plus-1ex \@minus-.2ex}%
- \def\aeb@subsection@afterskip{1ex\@plus .2ex}%
- \def\aeb@subsectionframecolor{blue}%
- \def\aeb@subsectionframecolor{cornsilk}%
- \or
- \let\aeb@subsubsection@halign\raggedright
- \def\aeb@subsubsectioncolor{blue}%
- \def\aeb@subsubsectionshadowcolor{black}%
- \let\aeb@subsubsection@special=\@empty
- \def\aeb@subsubsection@beforeskip{-2ex\@plus-1ex \@minus-.2ex}%
- \def\aeb@subsubsection@afterskip{1ex\@plus .2ex}%
- \def\aeb@subsubsectionframecolor{blue}%
- \def\aeb@subsubsectionframecolor{cornsilk}%
- \fi
+\def\aeb@reset@section@all{\aeb@reset@section@fonts
+ \ifcase\aeb@section@typeIndex\relax
+ \let\aeb@section@halign\raggedright
+ \def\aeb@sectioncolor{blue}%
+ \def\aeb@sectionshadowcolor{black}%
+ \let\aeb@section@special=\@empty
+ \def\aeb@section@beforeskip{-3ex\@plus -1ex \@minus-.2ex}%
+ \def\aeb@section@afterskip{1ex\@plus .2ex}%
+ \def\aeb@sectionframecolor{blue}%
+ \def\aeb@sectionframecolor{cornsilk}%
+ \or
+ \let\aeb@subsection@halign\raggedright
+ \def\aeb@subsectioncolor{blue}%
+ \def\aeb@subsectionshadowcolor{black}%
+ \let\aeb@subsection@special=\@empty
+ \def\aeb@subsection@beforeskip{-2.5ex\@plus-1ex \@minus-.2ex}%
+ \def\aeb@subsection@afterskip{1ex\@plus .2ex}%
+ \def\aeb@subsectionframecolor{blue}%
+ \def\aeb@subsectionframecolor{cornsilk}%
+ \or
+ \let\aeb@subsubsection@halign\raggedright
+ \def\aeb@subsubsectioncolor{blue}%
+ \def\aeb@subsubsectionshadowcolor{black}%
+ \let\aeb@subsubsection@special=\@empty
+ \def\aeb@subsubsection@beforeskip{-2ex\@plus-1ex \@minus-.2ex}%
+ \def\aeb@subsubsection@afterskip{1ex\@plus .2ex}%
+ \def\aeb@subsubsectionframecolor{blue}%
+ \def\aeb@subsubsectionframecolor{cornsilk}%
+ \fi
}
% \end{macrocode}
% Here I've taken the \cs{section} command, as defined in \textsf{web},
@@ -5112,91 +5013,92 @@
% This helps to keep track of the page of the current section; used
% with the panel table of contents.
% \begin{macrocode}
-\renewcommand{\section}{% dps1
- \renewcommand{\@seccntformat}[1]{\aeb@sectionNum{##1}}%
- \@startsection{section}{1}{\aeb@section@indent}%
- {\aeb@section@beforeskip}{\aeb@section@afterskip}%
- {\noindent\xdef\aeb@sectionpage{\the\c@page}%
- \def\aeb@section@type{section}%
- \aeb@section@usefont\aeb@section@fontfamily\aeb@section@fontseries
- \aeb@section@fontshape\aeb@section@fontsize\aeb@section@halign
- \color{\aeb@sectioncolor}\aeb@section@special}}
-\renewcommand\subsection{% dps1
- \renewcommand{\@seccntformat}[1]{\aeb@subsectionNum{##1}}%
- \@startsection{subsection}{2}{\aeb@subsection@indent}%
- {\aeb@subsection@beforeskip}{\aeb@subsection@afterskip}%
- {\noindent\def\aeb@section@type{subsection}%
- \aeb@subsection@usefont\aeb@subsection@fontfamily
- \aeb@subsection@fontseries\aeb@subsection@fontshape
- \aeb@subsection@fontsize\aeb@subsection@halign
- \color{\aeb@subsectioncolor}\aeb@subsection@special}}
+\renewcommand{\section}{%
+ \renewcommand{\@seccntformat}[1]{\aeb@sectionNum{##1}}%
+ \@startsection{section}{1}{\aeb@section@indent}%
+ {\aeb@section@beforeskip}{\aeb@section@afterskip}%
+ {\noindent\xdef\aeb@sectionpage{\the\c@page}%
+ \def\aeb@section@type{section}%
+ \aeb@section@usefont\aeb@section@fontfamily\aeb@section@fontseries
+ \aeb@section@fontshape\aeb@section@fontsize\aeb@section@halign
+ \color{\aeb@sectioncolor}\aeb@section@special}}
+\renewcommand\subsection{%
+ \renewcommand{\@seccntformat}[1]{\aeb@subsectionNum{##1}}%
+ \@startsection{subsection}{2}{\aeb@subsection@indent}%
+ {\aeb@subsection@beforeskip}{\aeb@subsection@afterskip}%
+ {\noindent\def\aeb@section@type{subsection}%
+ \aeb@subsection@usefont\aeb@subsection@fontfamily
+ \aeb@subsection@fontseries\aeb@subsection@fontshape
+ \aeb@subsection@fontsize\aeb@subsection@halign
+ \color{\aeb@subsectioncolor}\aeb@subsection@special}}
\def\subsubDefaultDing#1{\def\web@subsubDefaultDing{{#1}}}
\subsubDefaultDing{\textrm\textbullet}
-\renewcommand\subsubsection{% dps1
- \renewcommand{\@seccntformat}[1]{\aeb@subsubsectionNum{##1}}%
- \@startsection{subsubsection}{3}{\aeb@subsubsection@indent}%
- {\aeb@subsubsection@beforeskip}{\aeb@subsubsection@afterskip}%
- {\noindent\def\aeb@section@type{subsubsection}%
- \aeb@subsubsection@usefont\aeb@subsubsection@fontfamily
- \aeb@subsubsection@fontseries\aeb@subsubsection@fontshape
- \aeb@subsubsection@fontsize\aeb@subsubsection@halign
- \color{\aeb@subsubsectioncolor}\aeb@subsubsection@special}}
+\renewcommand\subsubsection{%
+ \renewcommand{\@seccntformat}[1]{\aeb@subsubsectionNum{##1}}%
+ \@startsection{subsubsection}{3}{\aeb@subsubsection@indent}%
+ {\aeb@subsubsection@beforeskip}{\aeb@subsubsection@afterskip}%
+ {\noindent\def\aeb@section@type{subsubsection}%
+ \aeb@subsubsection@usefont\aeb@subsubsection@fontfamily
+ \aeb@subsubsection@fontseries\aeb@subsubsection@fontshape
+ \aeb@subsubsection@fontsize\aeb@subsubsection@halign
+ \color{\aeb@subsubsectioncolor}\aeb@subsubsection@special}}
\renewcommand*\thesection{%
- \if\aeb@use@section@numbers1\arabic{section}\fi}
+ \if\aeb@use@section@numbers\web@One\arabic{section}\fi}
\renewcommand*\thesubsection{%
- \if\aeb@use@section@numbers1\thesection.\arabic{subsection}\fi}
+ \if\aeb@use@section@numbers\web@One\thesection.\arabic{subsection}\fi}
\renewcommand*{\thesubsubsection}{%
- \if\aeb@use@section@numbers1%
- \if@defaultsubsubding\web@subsubDefaultDing
- \else\thesubsection.\arabic{subsubsection}\fi
- \fi}
+ \if\aeb@use@section@numbers\web@One
+ \if@defaultsubsubding\web@subsubDefaultDing
+ \else\thesubsection.\arabic{subsubsection}\fi
+ \fi
+}
% \end{macrocode}
% We attempt to format the university, title and author in the same way as
% we do the sections
% \begin{macrocode}
\newcommand{\sectionTitle}{\aeb@sectionTitle*}
\newcommand{\aeb@sectionTitle}{%
- \renewcommand{\@seccntformat}[1]{\aeb@titleNum{##1}}%
- \@startsection{section}{1}{\aeb@title@indent}%
- {\aeb@title@beforeskip}{\aeb@title@afterskip}%
- {\xdef\aeb@titlepage{\the\c@page}\def\aeb@section@type{title}%
- \aeb@title@usefont\aeb@title@fontfamily\aeb@title@fontseries
- \aeb@title@fontshape\aeb@title@fontsize\aeb@title@halign
- \ifx\webtitle@color\@empty\else\color{\aeb@titlecolor}\fi
- \aeb@title@special}}
+ \renewcommand{\@seccntformat}[1]{\aeb@titleNum{##1}}%
+ \@startsection{section}{1}{\aeb@title@indent}%
+ {\aeb@title@beforeskip}{\aeb@title@afterskip}%
+ {\xdef\aeb@titlepage{\the\c@page}\def\aeb@section@type{title}%
+ \aeb@title@usefont\aeb@title@fontfamily\aeb@title@fontseries
+ \aeb@title@fontshape\aeb@title@fontsize\aeb@title@halign
+ \ifx\webtitle@color\@empty\else\color{\aeb@titlecolor}\fi
+ \aeb@title@special}}
\newcommand{\sectionAuthor}{\aeb@sectionAuthor*}
\newcommand{\aeb@sectionAuthor}{%
- \renewcommand{\@seccntformat}[1]{\aeb@authorNum{##1}}%
- \@startsection{section}{1}{\aeb@author@indent}%
- {\aeb@author@beforeskip}{\aeb@author@afterskip}%
- {\xdef\aeb@titlepage{\the\c@page}\def\aeb@section@type{author}%
- \aeb@author@usefont\aeb@author@fontfamily\aeb@author@fontseries
- \aeb@author@fontshape\aeb@author@fontsize\aeb@author@halign
- \ifx\webauthor@color\@empty\else\color{\aeb@authorcolor}\fi
- \aeb@author@special}}
+ \renewcommand{\@seccntformat}[1]{\aeb@authorNum{##1}}%
+ \@startsection{section}{1}{\aeb@author@indent}%
+ {\aeb@author@beforeskip}{\aeb@author@afterskip}%
+ {\xdef\aeb@titlepage{\the\c@page}\def\aeb@section@type{author}%
+ \aeb@author@usefont\aeb@author@fontfamily\aeb@author@fontseries
+ \aeb@author@fontshape\aeb@author@fontsize\aeb@author@halign
+ \ifx\webauthor@color\@empty\else\color{\aeb@authorcolor}\fi
+ \aeb@author@special}}
\newcommand{\sectionUniversity}{\aeb@sectionUniversity*}
\newcommand{\aeb@sectionUniversity}{%
- \renewcommand{\@seccntformat}[1]{\aeb@universityNum{##1}}%
- \@startsection{section}{1}{\aeb@university@indent}%
- {\aeb@university@beforeskip}{\aeb@university@afterskip}%
- {\xdef\aeb@titlepage{\the\c@page}\def\aeb@section@type{university}%
- \aeb@university@usefont\aeb@university@fontfamily
- \aeb@university@fontseries\aeb@university@fontshape
- \aeb@university@fontsize\aeb@university@halign
- \ifx\webuniversity@color\@empty\else
- \color{\aeb@universitycolor}\fi\aeb@university@special}}
+ \renewcommand{\@seccntformat}[1]{\aeb@universityNum{##1}}%
+ \@startsection{section}{1}{\aeb@university@indent}%
+ {\aeb@university@beforeskip}{\aeb@university@afterskip}%
+ {\xdef\aeb@titlepage{\the\c@page}\def\aeb@section@type{university}%
+ \aeb@university@usefont\aeb@university@fontfamily
+ \aeb@university@fontseries\aeb@university@fontshape
+ \aeb@university@fontsize\aeb@university@halign
+ \ifx\webuniversity@color\@empty\else
+ \color{\aeb@universitycolor}\fi\aeb@university@special}}
\newcommand{\sectionToc}{\aeb@sectionToc*}
\newcommand{\aeb@sectionToc}{%
- \renewcommand{\@seccntformat}[1]{\aeb@tocNum{##1}}%
- \@startsection{section}{1}{\aeb@toc@indent}%
- {\aeb@toc@beforeskip}{\aeb@toc@afterskip}%
- {\hypertarget{webtoc}{}%
- \xdef\aeb@titlepage{\the\c@page}\def\aeb@section@type{toc}%
- \aeb@toc@usefont\aeb@toc@fontfamily
- \aeb@toc@fontseries\aeb@toc@fontshape
- \aeb@toc@fontsize\aeb@toc@halign
- \ifx\aeb@toccolor\@empty\else
- \color{\aeb@toccolor}\fi\aeb@toc@special}}
+ \renewcommand{\@seccntformat}[1]{\aeb@tocNum{##1}}%
+ \@startsection{section}{1}{\aeb@toc@indent}%
+ {\aeb@toc@beforeskip}{\aeb@toc@afterskip}%
+ {\hypertarget{webtoc}{}%
+ \xdef\aeb@titlepage{\the\c@page}\def\aeb@section@type{toc}%
+ \aeb@toc@usefont\aeb@toc@fontfamily
+ \aeb@toc@fontseries\aeb@toc@fontshape
+ \aeb@toc@fontsize\aeb@toc@halign
+ \ifx\aeb@toccolor\@empty\else
+ \color{\aeb@toccolor}\fi\aeb@toc@special}}
% \end{macrocode}
%
% \subsection{Layout Commands}\label{sectionLayout}
@@ -5213,20 +5115,20 @@
% globally reset the values. Here we process the keys devoted to the section layout.
% \begin{macrocode}
\def\save@prtscr{\global\let\prtscr@save\prtscr
- \global\let\prtscr\prtscrA}
+ \global\let\prtscr\prtscrA}
\def\restore@prtscr{\global\let\prtscr\prtscr@save}
\newcommand{\sectionLayout}[1]{\save@prtscr
- \setkeys{aebsection}{type=section,color=blue,ruleheight=1pt}%
- \protected@edef\aeb@temp{\noexpand\setkeys{aebsection}{#1}}%
- \aeb@temp\restore@prtscr}
+ \setkeys{aebsection}{type=section,color=blue,ruleheight=1pt}%
+ \protected@edef\x{\noexpand\setkeys{aebsection}{#1}}\x
+ \aeb@temp\restore@prtscr}
\newcommand{\subsectionLayout}[1]{\save@prtscr
- \setkeys{aebsection}{type=subsection,color=blue,ruleheight=1pt}%
- \protected@edef\aeb@temp{\noexpand\setkeys{aebsection}{#1}}%
- \aeb@temp\restore@prtscr}
+ \setkeys{aebsection}{type=subsection,color=blue,ruleheight=1pt}%
+ \protected@edef\x{\noexpand\setkeys{aebsection}{#1}}\x
+ \aeb@temp\restore@prtscr}
\newcommand{\subsubsectionLayout}[1]{\save@prtscr
- \setkeys{aebsection}{type=subsubsection,color=blue,ruleheight=1pt}%
- \protected@edef\aeb@temp{\noexpand\setkeys{aebsection}{#1}}%
- \aeb@temp\restore@prtscr}
+ \setkeys{aebsection}{type=subsubsection,color=blue,ruleheight=1pt}%
+ \protected@edef\x{\noexpand\setkeys{aebsection}{#1}}\x
+ \aeb@temp\restore@prtscr}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -5239,24 +5141,24 @@
% title and author on the title page of the presentation.
% \begin{macrocode}
\newcommand{\universityLayout}[1]{\save@prtscr
- \setkeys{aebsection}{type=university}%
- \protected@edef\aeb@temp{\noexpand\setkeys{aebsection}{#1}}%
- \aeb@temp\restore@prtscr}
+ \setkeys{aebsection}{type=university}%
+ \protected@edef\x{\noexpand\setkeys{aebsection}{#1}}\x
+ \aeb@temp\restore@prtscr}
\universityLayout{fontsize={\prtscrA{large}{normalsize}}}
\newcommand{\titleLayout}[1]{\save@prtscr
- \setkeys{aebsection}{type=title}%
- \protected@edef\aeb@temp{\noexpand\setkeys{aebsection}{#1}}%
- \aeb@temp\restore@prtscr}
+ \setkeys{aebsection}{type=title}%
+ \protected@edef\x{\noexpand\setkeys{aebsection}{#1}}\x
+ \aeb@temp\restore@prtscr}
\titleLayout{fontsize={\prtscrA{Large}{normalsize}}}
\newcommand{\authorLayout}[1]{\save@prtscr
- \setkeys{aebsection}{type=author}%
- \protected@edef\aeb@temp{\noexpand\setkeys{aebsection}{#1}}%
- \aeb@temp\restore@prtscr}
+ \setkeys{aebsection}{type=author}%
+ \protected@edef\x{\noexpand\setkeys{aebsection}{#1}}\x
+ \aeb@temp\restore@prtscr}
\authorLayout{fontsize={\prtscrA{large}{normalsize}}}
\newcommand{\tocLayout}[1]{\save@prtscr
- \setkeys{aebsection}{type=toc,color=\web@tocColor}%
- \protected@edef\aeb@temp{\noexpand\setkeys{aebsection,aebToc}{#1}}%
- \aeb@temp\restore@prtscr}
+ \setkeys{aebsection}{type=toc,color=\web@tocColor}%
+ \protected@edef\x{\noexpand\setkeys{aebsection,aebToc}{#1}}\x
+ \aeb@temp\restore@prtscr}
\tocLayout{fontsize=Large}
% \end{macrocode}
% \end{macro}
@@ -5274,8 +5176,8 @@
% below, and also in the \texttt{ding} key from the \texttt{aebsection} family.
% \begin{macrocode}
\def\web@sel@sec@col#1{\ifShadow
- \color{\@nameuse{aeb@#1shadowcolor}}\else
- \color{\@nameuse{aeb@#1numdingcolor}}\fi}
+ \color{\@nameuse{aeb@#1shadowcolor}}\else
+ \color{\@nameuse{aeb@#1numdingcolor}}\fi}
% \end{macrocode}
% \begin{macro}{\useSectionNumbers}
% \begin{macro}{\noSectionNumbers}
@@ -5285,29 +5187,29 @@
% value at no, i.e., I've executed \cs{noSectionNumbers}.
% \begin{macrocode}
\newcommand{\useSectionNumbers}
-{% dps1
- \let\aeb@use@section@numbers1\relax
- \def\aeb@sectionNum##1{\protect\web@sel@sec@col{section}%
- \@nameuse{the##1}\web@finalDot\ }%
- \def\aeb@subsectionNum##1{\protect\web@sel@sec@col{subsection}%
- \@nameuse{the##1}\web@finalDot\ }%
- \def\aeb@subsubsectionNum##1{%
- \protect\web@sel@sec@col{subsubsection}%
+{%
+ \let\aeb@use@section@numbers\web@One
+ \def\aeb@sectionNum##1{\protect
+ \web@sel@sec@col{section}\@nameuse{the##1}\web@finalDot\ }%
+ \def\aeb@subsectionNum##1{\protect
+ \web@sel@sec@col{subsection}\@nameuse{the##1}\web@finalDot\ }%
+ \def\aeb@subsubsectionNum##1{\protect
+ \web@sel@sec@col{subsubsection}%
\@nameuse{the##1}\if@defaultsubsubding\else\web@finalDot\fi\ }%
\def\sectionmark##1{\markright{##1}}%
}
\newcommand{\noSectionNumbers}
{%
- \ifx\web@latextoc\web@YES
- \PackageInfo{web}{The nobullets or latextoc option
- taken,\MessageBreak
- ignoring \string\noSectionNumbers}%
- \else
- \let\aeb@use@section@numbers0\relax
- \let\aeb@sectionNum\@gobble
- \let\aeb@subsectionNum\@gobble
- \let\aeb@subsubsectionNum\@gobble
- \fi
+ \ifx\web@latextoc\web@YES
+ \PackageInfo{web}{The nobullets or latextoc option
+ taken,\MessageBreak
+ ignoring \string\noSectionNumbers}%
+ \else
+ \let\aeb@use@section@numbers\web@Zero
+ \let\aeb@sectionNum\@gobble
+ \let\aeb@subsectionNum\@gobble
+ \let\aeb@subsubsectionNum\@gobble
+ \fi
}
\useSectionNumbers
% \end{macrocode}
@@ -5331,11 +5233,11 @@
% \IndexKey{urlColor}
% \begin{macrocode}
\define@key{aebcolordesign}{universityColor}{\universityColor{#1}}
- \def\aeb@universitycolor{\webuniversity@color}
+ \def\aeb@universitycolor{\webuniversity@color}
\define@key{aebcolordesign}{titleColor}{\titleColor{#1}}
- \def\aeb@titlecolor{\webtitle@color}
+ \def\aeb@titlecolor{\webtitle@color}
\define@key{aebcolordesign}{authorColor}{\authorColor{#1}}
- \def\aeb@authorcolor{\webauthor@color}
+ \def\aeb@authorcolor{\webauthor@color}
\define@key{aebcolordesign}{textBgColor}{\textBgColor{#1}}
\define@key{aebcolordesign}{panelBgColor}{\panelBgColor{#1}}
\define@key{aebcolordesign}{linkColor}{\def\@linkcolor{#1}}
@@ -5391,7 +5293,7 @@
\ddDingTocColor{blue}
\dddDingTocColor{webgreen}
\@tfor\@@tmp:={d@DingToc}{dd@DingToc}{ddd@DingToc}\do
- {\w@csarg\let{\@@tmp}\@empty}
+ {\w@csarg\let{\@@tmp}\@empty}
% \end{macrocode}
% \begin{macro}{\selectTocDings}
% This is an \textsf{xkeyval} interface to setting the dings used by
@@ -5411,9 +5313,9 @@
% the dings there.
% \begin{macrocode}
\def\@setTocDings{%
- \ifx\d@DingToc\@empty\else\dDing{\d@DingToc}\fi
- \ifx\dd@DingToc\@empty\else\ddDing{\dd@DingToc}\fi
- \ifx\ddd@DingToc\@empty\else\dddDing{\ddd@DingToc}\fi
+ \ifx\d@DingToc\@empty\else\dDing{\d@DingToc}\fi
+ \ifx\dd@DingToc\@empty\else\ddDing{\dd@DingToc}\fi
+ \ifx\ddd@DingToc\@empty\else\dddDing{\ddd@DingToc}\fi
}
% \end{macrocode}
% \end{macro}% Now, if for paper\dots
@@ -5426,9 +5328,9 @@
% comment environments one \texttt{forpaper} and another for
% \texttt{forscreen}.
% \begin{macrocode}
- \includecomment{forpaper}\excludecomment{forscreen}
+ \includecomment{forpaper}\excludecomment{forscreen}
\else
- \includecomment{forscreen}\excludecomment{forpaper}
+ \includecomment{forscreen}\excludecomment{forpaper}
\fi
% \end{macrocode}
% \end{environment}
@@ -5444,16 +5346,16 @@
% D. P. Story
%
\newcommand{\setupFullwidth}{%
- \setlength{\textwidth}{\paperwidth}%
- \advance\textwidth-2in
- \setlength{\linewidth}{\textwidth}%
- \setlength{\columnseprule}{0pt}%
- \setlength{\oddsidemargin}{0in}%
- \setlength{\evensidemargin}{0in}%
+ \setlength{\textwidth}{\paperwidth}%
+ \advance\textwidth-2in
+ \setlength{\linewidth}{\textwidth}%
+ \setlength{\columnseprule}{0pt}%
+ \setlength{\oddsidemargin}{0in}%
+ \setlength{\evensidemargin}{0in}%
}
\makeatletter
\def\clindx{\ifcodeline@index\expandafter\@firstoftwo\else
- \expandafter\@secondoftwo\fi}
+ \expandafter\@secondoftwo\fi}
\GlossaryPrologue{\section{Change History}}
\IndexPrologue{\section{Index}\hfuzz\linewidth
\parbox{\linewidth}{Numbers written in italic