summaryrefslogtreecommitdiff
path: root/texmf-dist/source
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2017-07-13 09:30:28 +0900
committerNorbert Preining <norbert@preining.info>2017-07-13 09:30:28 +0900
commit32d0671418a3cc6ad0465b06539ed54d96f77784 (patch)
tree83f9ce9f288adee0aa0af0eddfdccf6d5a47bae7 /texmf-dist/source
parent30e9cda301125dbde368d7bba3331bfd0f8389a1 (diff)
add artthreads cntdwn ecards fc-arith fldigigal
Diffstat (limited to 'texmf-dist/source')
-rw-r--r--texmf-dist/source/latex/artthreads/artthreads.dtx390
-rw-r--r--texmf-dist/source/latex/artthreads/artthreads.ins61
-rw-r--r--texmf-dist/source/latex/cntdwn/cntdwn.dtx1306
-rw-r--r--texmf-dist/source/latex/cntdwn/cntdwn.ins65
-rw-r--r--texmf-dist/source/latex/cntdwn/examples/clock_tst.tex56
-rw-r--r--texmf-dist/source/latex/cntdwn/examples/lngcntdwn_tst.tex62
-rw-r--r--texmf-dist/source/latex/cntdwn/examples/shrtcntdwn_tst.tex79
-rw-r--r--texmf-dist/source/latex/ecards/doc/ecardsman.tex726
-rw-r--r--texmf-dist/source/latex/ecards/ecard.cus9
-rw-r--r--texmf-dist/source/latex/ecards/ecards.dtx1331
-rw-r--r--texmf-dist/source/latex/ecards/ecards.ins65
-rw-r--r--texmf-dist/source/latex/fc-arith/docs/fc_arithman.tex1140
-rw-r--r--texmf-dist/source/latex/fc-arith/fc_arith.dtx2186
-rw-r--r--texmf-dist/source/latex/fc-arith/fc_arith.ins62
-rw-r--r--texmf-dist/source/latex/fldigigal/fldigigal.dtx452
-rw-r--r--texmf-dist/source/latex/fldigigal/fldigigal.ins60
16 files changed, 8050 insertions, 0 deletions
diff --git a/texmf-dist/source/latex/artthreads/artthreads.dtx b/texmf-dist/source/latex/artthreads/artthreads.dtx
new file mode 100644
index 00000000..3eda0771
--- /dev/null
+++ b/texmf-dist/source/latex/artthreads/artthreads.dtx
@@ -0,0 +1,390 @@
+%\iffalse
+%<*copyright>
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% artthreads.sty package, 2016-04-09 %%
+%% Copyright (C) 2016 D. P. Story %%
+%% dpstory@uakron.edu %%
+%% %%
+%% This program can redistributed and/or modified under %%
+%% the terms of the LaTeX Project Public License %%
+%% Distributed from CTAN archives in directory %%
+%% macros/latex/base/lppl.txt; either version 1 of the %%
+%% License, or (at your option) any later version. %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%</copyright>
+%<package>\NeedsTeXFormat{LaTeX2e}[1997/12/01]
+%<package>\ProvidesPackage{artthreads}
+%<package> [2016/04/09 v1.1 Support for article threads (dps)]
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage[colorlinks,hyperindex]{hyperref}
+\usepackage{fancyvrb,array,calc}
+%\pdfstringdefDisableCommands{\let\\\textbackslash}
+%\EnableCrossrefs \CodelineIndex
+\RecordChanges
+\bgroup\ttfamily
+\gdef\brpr#1{\char123\relax#1\char125\relax}\egroup
+\def\ameta#1{\ensuremath{\langle\textsl{\texttt{#1}}\rangle}}
+\def\meta#1{\textsl{\texttt{#1}}}
+\def\SUB#1{\ensuremath{{}_{\mbox{\scriptsize\ttfamily#1}}}}
+\def\cs#1{\texttt{\bslash#1}}
+\DeclareRobustCommand{\tmspace}[3]{%
+ \ifmmode\mskip#1#2\else\kern#1#3\fi\relax}
+\renewcommand{\,}{\tmspace+\thinmuskip{.1667em}}
+\let\thinspace\,
+\renewcommand{\!}{\tmspace-\thinmuskip{.1667em}}
+\let\negthinspace\!
+\renewcommand{\:}{\tmspace+\medmuskip{.2222em}}
+\let\medspace\:
+\newcommand{\negmedspace}{\tmspace-\medmuskip{.2222em}}
+\renewcommand{\;}{\tmspace+\thickmuskip{.2777em}}
+\let\thickspace\;
+\newcommand{\negthickspace}{\tmspace-\thickmuskip{.2777em}}
+\makeatletter
+\renewcommand{\paragraph}
+ {\@startsection{paragraph}{4}{0pt}{6pt}{-3pt}
+ {\normalfont\normalsize\bfseries}}
+\renewenvironment{quote}[1][]
+ {\def\@rgi{#1}\ifx\@rgi\@empty
+ \let\rghtm\@empty\else\def\rghtm{\rightmargin\leftmargin}\fi
+ \list{}{\rghtm} %{\rightmargin\leftmargin}%
+ \item\relax}
+ {\endlist}
+\makeatother
+\begin{document}
+\def\CMD#1{\textbackslash#1}
+ \GetFileInfo{artthreads.sty}
+ \title{\textsf{artthreads}: Support for article threads}
+ \author{D. P. Story\\
+ Email: \texttt{dpstory@acrotex.net}}
+ \date{processed \today}
+ \maketitle
+ \tableofcontents
+ \let\Email\texttt
+ \renewenvironment{theglossary}{%
+ \let\efill\relax
+ \begin{itemize}}{\end{itemize}}
+ \value{GlossaryColumns}=1
+ \DocInput{artthreads.dtx}
+ \PrintIndex
+\end{document}
+%</driver>
+% \fi
+% \MakeShortVerb{|}
+% \StopEventually{}
+%
+% \DoNotIndex{\def,\edef,\gdef,\xdef,\global,\long,\let}
+% \DoNotIndex{\expandafter,\string,\the,\ifx,\else,\fi}
+% \DoNotIndex{\csname,\endcsname,\relax,\begingroup,\endgroup}
+% \DoNotIndex{\DeclareTextCommand,\DeclareTextCompositeCommand}
+% \DoNotIndex{\space,\@empty,\special}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \section{Introduction}
+% This package is used to create \textit{article threads} around blocks of content. Generally,
+% article threads are used with multi-column documents, such as newspapers or newsletters, or
+% anything that uses a multi-column format.
+%
+% The creation of the article threads should occur as the final step of the document composition.
+% There is nothing automatic about placing the threads, {\TeX} does not lend itself to the creation
+% of the threads. For the purpose of placing the threads, the options \texttt{preview} and
+% \texttt{viewMagWin} are integral.
+%
+% \section{Options and Required Packages}
+% \begin{macrocode}
+\RequirePackage{xkeyval}
+\RequirePackage{ifpdf}[2006/02/20]
+\RequirePackage{ifxetex}[2006/08/21]
+\@ifundefined{ifpdfmarkup}{\newif\ifpdfmarkup}{}\pdfmarkupfalse
+\ifpdf\else\ifxetex\else\pdfmarkuptrue\fi\fi
+% \end{macrocode}
+% \paragraph*{Driver options.} Three options, \DescribeMacro{dvips,dvipsone}\texttt{dvips} (the default)
+% and \texttt{dvipsone}, both of which require \textbf{Adobe Distiller}
+% as the PDF creator; the \DescribeMacro{pdftex}\texttt{pdftex} allows for the same functionality
+% for the \textsf{pdflatex} executable. We also support \DescribeMacro{xetex,dvipdfm,dvipdfmx}\texttt{dvipdfm}
+% and its extensions.
+%
+% \paragraph*{Preview options.} The \DescribeMacro{preview}\texttt{preview}
+% option is a carry over from \textsf{eforms}. When selected, all form fields are outlined; useful when
+% setting the location of fields in a dvi previewer. The other option is \texttt{viewMagWin}
+% \DescribeMacro{viewMagWin} will show the viewing windows surrounding the target. This is the rectangle
+% that will be jumped to. Use this option to adjust the size of the window to your needs.
+% When either of the last two options has an exclamation point prior, that means to
+% turn off the switch. You can conveniently use \texttt{viewMagWin} to see the viewing window,
+% then change it to \DescribeMacro{!viewMagWin}\texttt{!viewMagWin} to remove the visible window. Cool.
+% Similarly, you can turn off \texttt{preview} using \DescribeMacro{!preview}\texttt{!preview}.
+% \begin{macrocode}
+% \end{macrocode}
+% All options are passed to the \textsf{fitr} package, which contains a lot of the code
+% used in this package.
+% \begin{macrocode}
+\DeclareOptionX{pdftex}{\PassOptionsToPackage{\CurrentOption}{fitr}}
+% \end{macrocode}
+% Distiller based drivers.
+% \begin{macrocode}
+\DeclareOptionX{dvips}{\PassOptionsToPackage{\CurrentOption}{fitr}}
+\DeclareOptionX{dvipsone}{\PassOptionsToPackage{\CurrentOption}{fitr}}
+% \end{macrocode}
+% \textsf{dvipdfm} and its variants.
+% \begin{macrocode}
+\DeclareOptionX{dvipdfm}{\PassOptionsToPackage{\CurrentOption}{fitr}}
+\DeclareOptionX{dvipdfmx}{\PassOptionsToPackage{\CurrentOption}{fitr}}
+\DeclareOptionX{xetex}{\PassOptionsToPackage{\CurrentOption}{fitr}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareOptionX{preview}{\PassOptionsToPackage{\CurrentOption}{fitr}}
+\DeclareOptionX{!preview}{\PassOptionsToPackage{\CurrentOption}{fitr}}
+\DeclareOptionX{viewMagWin}{\PassOptionsToPackage{\CurrentOption}{fitr}}
+\DeclareOptionX{!viewMagWin}
+ {\PassOptionsToPackage{\CurrentOption}{fitr}}
+\ProcessOptionsX
+% \end{macrocode}
+% \section{The Main Code}
+% We require the package \textsf{fitr}, as we use many commands from that package.
+% We pass all options to \textsf{fitr}.
+% \begin{macrocode}
+\RequirePackage{fitr}[2016/04/04]
+% \end{macrocode}
+% Some scratch counters, lengths, boxes.
+% \begin{macrocode}
+\newif\ifnewarticle
+\newcounter{artthrdcnt}
+\def\CntArt{0}\def\CntArtInfo{0}
+\def\inc@CntMacro#1{{\@tempcnta#1\relax\advance\@tempcnta1\relax
+ \xdef#1{\the\@tempcnta}}}
+\def\artM@rk{[\space}
+% \end{macrocode}
+% \paragraph*{Key-values for \cs{setThreadInfo}} We set up
+% key-values\DescribeMacro{title}\DescribeMacro{author}\DescribeMacro{subject}^^A
+% \DescribeMacro{keywords} for the thread \textsf{Info} dictionary. Only the title
+% is required, that's why a default value of \texttt{thread-<num>} is otherwise provided.
+% \begin{macrocode}
+\define@key{artthrd}{title}[]{\def\threadTitle{#1}}
+ \let\threadTitle\@empty
+\define@key{artthrd}{author}[]{\def\threadAuthor{#1}}
+ \let\threadAuthor\@empty
+\define@key{artthrd}{keywords}[]{\def\threadKeywords{#1}}
+ \let\threadKeywords\@empty
+\define@key{artthrd}{subject}[]{\def\threadSubject{#1}}
+ \let\threadSubject\@empty
+% \end{macrocode}
+% Use \DescribeMacro{\setThreadInfo}\cmd{\setThreadInfo} prior to the opening of a
+% new thread using \cs{cArticle}. Through its key-values, set the title, author,
+% keywords, and subject of the thread. For \textsf{pdftex}, only title is supported.
+% \begin{macrocode}
+\newcommand{\setThreadInfo}[1]{\inc@CntMacro\CntArtInfo
+ \let\threadTitle\@empty\let\threadAuthor\@empty
+ \let\threadKeywords\@empty\let\threadSubject\@empty
+ \setkeys{artthrd}{#1}\ifx\threadTitle\@empty
+ \def\threadTitle{thread-\CntArtInfo}\fi
+}
+\def\bArtErrMsg{When starting a new article thread
+ (\string\cArticle)\MessageBreak
+ first use \string\setThreadInfo\space to set the title,\MessageBreak
+ author, subject, and keywords}
+% \end{macrocode}
+% \paragraph*{Additional key-values for threads} In addition to the key-values provided
+% by \textsf{fitr}, we provide a few more. The two keys
+% \DescribeMacro{addtow}\texttt{addtow} and \DescribeMacro{addtoh}\texttt{addtoh}
+% adds to the reading border of the threads. These are set through the
+% command \DescribeMacro{\setAddToBorder}\cs{setAddToBorder}. For the most part,
+% choices for \texttt{addtow} (add to the width) and \texttt{addtoh} (add to the height)
+% should be set for the whole document. Initially, \texttt{addtow=0,addtoh=0}.
+% \begin{macrocode}
+\define@key{@rtthrd}{addtow}[0]{%
+ \fitr@defaultbp{\artthrd@@addtow}{#1}}
+\def\artthrd@@addtow{0}
+\define@key{@rtthrd}{addtoh}[0]{%
+ \fitr@defaultbp{\artthrd@@addtoh}{#1}}
+\def\artthrd@@addtoh{0}
+\newcommand{\setAddToBorder}[1]{\setkeys{@rtthrd}{#1}}
+% \end{macrocode}
+% The \DescribeMacro{\bArticle}\cmd{\bArticle} is used to start an article thread. The thread
+% may continue with \cs{cArticle}. Both commands have a required argument, consisting of
+% key-values defined by \textsf{fitr}.
+% The following is the syntax, with appropriate keys defined in \texttt{fitr}.
+% \begin{quote}\ttfamily
+% \string\cArticle\char123lift=\ameta{length},width=\ameta{length},height=\ameta{length}\char125
+% \end{quote}
+% \begin{macrocode}
+\newcommand{\bArticle}{\begingroup\inc@CntMacro\CntArt
+ \ifnum\CntArt=\CntArtInfo\relax\else
+ \PackageError{artthreads}{\bArtErrMsg}{See package documentation
+ for \string\setThreadInfo}\fi
+ \newarticletrue\set@rectart
+}
+% \end{macrocode}
+% The only difference between \DescribeMacro{\cArticle}\cmd{\cArticle} and
+% \cmd{\bArticle} is the stepping of the counter \cmd{\CntArt}
+% and the setting of the switch \cmd{ifnewarticle}.
+% \begin{macrocode}
+\newcommand{\cArticle}{\begingroup\newarticlefalse\set@rectart}
+% \end{macrocode}
+% \cmd{\set@rectart} continues \cs{bArticle}/\cs{cArticle}.
+% \begin{macrocode}
+\newcommand{\set@rectart}[1]{\def\fitr@artrect@argi{#1}%
+ \edef\temp@exp{\noexpand\setkeys{fitr}{#1}}\temp@exp
+ \set@@rectart}
+% \end{macrocode}
+% \cmd{\set@@rectart} is the main command for building the thread.
+% \begin{macrocode}
+\def\set@@rectart{\def\fitr@setBL{0pt}%
+ \@ifundefined{ef@Bbox}{\let\fitr@FLB@ction\Bbox}%
+ {\let\fitr@FLB@ction\ef@Bbox}%
+ \get@fitr@dimen{%
+ \parbox[\fitr@@refPt][\fitr@@height]{\fitr@@width}%
+ {\kern0pt\fitr@FLB@ction{\fitr@@width}{\fitr@@height}\kern0pt}%
+ }%
+ \makebox[0pt][l]{\hspace*{\fitr@@shift}\smash{%
+ \raisebox{\fitr@@lift-\fitr@setBL}{%
+% \end{macrocode}
+% Actually insert the thread code here by inserting \cs{setThre@d}.
+% \begin{macrocode}
+ \setThre@d{\artthrd@@addtow}{\artthrd@@addtoh}%
+ \unhbox\fitr@bbox
+ \fitr@urxury@fixup{\artthrd@@addtow}{\artthrd@@addtoh}{}%
+ }}}\setlength{\fboxsep}{0pt}%
+% \end{macrocode}
+% Now place an extended border around the viewing area
+% \begin{macrocode}
+ \ifviewMagWin
+ \fitr@length=\artthrd@@addtow bp
+ \fitr@length=2\fitr@length
+ \addtolength{\fitr@length}{\fitr@@width}%
+ \edef\fitr@@width{\the\fitr@length}%
+ \fitr@length=\artthrd@@addtoh bp
+ \fitr@length=2\fitr@length
+ \addtolength{\fitr@length}{\fitr@@height}%
+ \edef\fitr@@height{\the\fitr@length}%
+ \setlength\fitr@length{-\artthrd@@addtow bp}%
+ \addtolength\fitr@length{\fitr@@shift}%
+ \makebox[0pt][l]{\hspace*{\fitr@length}\smash{%
+ \setlength\fitr@length{\fitr@@lift-\fitr@setBL}%
+ \if\fitr@@refPt b%
+ \addtolength\fitr@length{-\artthrd@@addtoh bp}\else
+ \if\fitr@@refPt t%
+ \addtolength\fitr@length{\artthrd@@addtoh bp}%
+ \fi\fi
+ \raisebox{\fitr@length}%
+ {\fbox{\parbox[\fitr@@refPt][\fitr@@height]%
+ {\fitr@@width}{\kern0pt\hfill\vfill\kern0pt}}}}%
+ }%
+ \fi
+\endgroup}
+% \end{macrocode}
+% \paragraph*{Driver dependent macros} The \cs{ThrBbox} macros perform different tasks
+% depending on the driver.
+% \begin{macrocode}
+\if@fitr@dvipdfm
+% \end{macrocode}
+% For the \textsf{dvipdfm} and friends
+% \begin{macrocode}
+\def\ThrBbox#1#2{%
+ \fitr@length=#1bp
+ \fitr@length=2\fitr@length
+ \advance\fitr@length\wd\fitr@bbox
+ \edef\fitr@xetex@view@width{\the\fitr@length}%
+ \fitr@length=#2bp
+ \advance\fitr@length\ht\fitr@bbox
+ \edef\fitr@xetex@view@height{\the\fitr@length}%
+ \fitr@length=#2bp
+ \advance\fitr@length\dp\fitr@bbox
+ \edef\fitr@xetex@view@depth{\the\fitr@length}%
+}\else\ifx\fitr@driver\fitr@pdftex@driver
+% \end{macrocode}
+% For the \textsf{pdftex} and friends
+% \begin{macrocode}
+\def\ThrBbox#1#2{%
+ \fitr@length=#1bp
+ \fitr@length=2\fitr@length
+ \advance\fitr@length\wd\fitr@bbox
+ \edef\fitr@pdftex@view@width{\the\fitr@length}%
+ \fitr@length=#2bp
+ \advance\fitr@length\ht\fitr@bbox
+ \edef\fitr@pdftex@view@height{\the\fitr@length}%
+ \fitr@length=#2bp
+ \advance\fitr@length\dp\fitr@bbox
+ \edef\fitr@pdftex@view@depth{\the\fitr@length}%
+}\else\ifx\fitr@driver\fitr@dvipsone@driver
+% \end{macrocode}
+% For the \textsf{dvipsone} driver
+% \begin{macrocode}
+\def\ThrBbox#1#2{%
+ currentpoint 2 copy %
+ \the\fitr@depth\space add #2\space PDFtoTeX add % y1
+ exch #1\space PDFtoTeX sub exch % x1
+ 4 2 roll exch
+ \the\fitr@width\space add #1\space PDFtoTeX add exch % x2
+ \the\fitr@height\space sub #2\space PDFtoTeX sub} % y2
+\else\ifx\fitr@driver\fitr@dvips@driver
+% \end{macrocode}
+% For the \textsf{dvips} driver
+% \begin{macrocode}
+\def\ThrBbox#1#2{% Uses \fitr@bbox
+ currentpoint 2 copy %
+ \the\fitr@depth\space SPtoDvips add
+ #2\space BPToDvips add % y1
+ exch #1\space BPToDvips sub exch % x1
+ 4 2 roll exch
+ \the\fitr@width\space SPtoDvips add
+ #1\space BPToDvips add exch % x2
+ \the\fitr@height \space SPtoDvips sub
+ #2\space BPToDvips sub} % y2
+\fi\fi\fi\fi
+% \end{macrocode}
+% \paragraph*{Code to set the thread} The \cs{setThre@d} macros are driver dependent.
+% \begin{macrocode}
+\def\setThre@d#1#2{%
+ \fitr@defaultbp{\aWd}{#1}\fitr@defaultbp{\aHt}{#2}%
+ \edef\tmp@exp{\noexpand\set@rtThrd{\aWd}{\aHt}}\tmp@exp
+}
+\if@fitr@dvipdfm
+% \end{macrocode}
+% For the \textsf{dvipdfm} and friends
+% \begin{macrocode}
+\def\set@rtThrd#1#2{\ThrBbox{#1}{#2}%
+ \smash{\raisebox{-\fitr@xetex@view@height+#2bp}%
+ {\makebox[0pt][l]{\hspace*{-#1bp}%
+ \@pdfm@mark{thread @artthrd\CntArt\space
+ width \fitr@xetex@view@width\space
+ height \fitr@xetex@view@height\space
+ depth \fitr@xetex@view@depth\space
+ << /Title (\threadTitle)
+\ifnewarticle
+ /Author (\threadAuthor)
+ /Subject (\threadSubject)
+ /Keywords (\threadKeywords)
+\fi >>}}}}}\else\ifx\fitr@driver\fitr@pdftex@driver
+% \end{macrocode}
+% \textsf{pdftex} and friends
+% \begin{macrocode}
+\def\set@rtThrd#1#2{\ThrBbox{#1}{#2}%
+ \makebox[0pt][l]{\hspace*{-#1bp}%
+ \pdfthread
+ width \fitr@pdftex@view@width\space
+ height \fitr@pdftex@view@height\space
+ depth \fitr@pdftex@view@depth\space
+ name {\threadTitle}}}\else
+% \end{macrocode}
+% For drivers that use PostScript and the \textbf{pdfmark}.
+% \changes{v1.1}{2016/04/09}{Removed the Page key and dependence on the refcount package}
+% \begin{macrocode}
+\def\set@rtThrd#1#2{\literalps@out{\artM@rk
+ /Rect [\ThrBbox{\artthrd@@addtow}{\artthrd@@addtoh}]
+ /Title (\threadTitle)
+\ifnewarticle
+ /Author (\threadAuthor)
+ /Subject (\threadSubject)
+ /Keywords (\threadKeywords)
+\fi
+ /ARTICLE pdfmark}}
+\fi\fi
+% \end{macrocode}
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%\Finale
+\endinput
diff --git a/texmf-dist/source/latex/artthreads/artthreads.ins b/texmf-dist/source/latex/artthreads/artthreads.ins
new file mode 100644
index 00000000..6d646d87
--- /dev/null
+++ b/texmf-dist/source/latex/artthreads/artthreads.ins
@@ -0,0 +1,61 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1999-2012 D. P. Story
+%%
+%% This file is part of the `AcroTeX eDucation Bundle'.
+%% -------------------------------------------
+%%
+%% It may be distributed under the conditions of the LaTeX Project Public
+%% License, either version 1.2 of this license or (at your option) any
+%% later version. The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.2 or later is part of all distributions of LaTeX
+%% version 1999/12/01 or later.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2016/01/12}
+\def\batchfile{artthreads.ins}
+
+\input docstrip
+\ifx\generate\undefined
+ \Msg{**********************************************}
+ \Msg{*}
+ \Msg{* This installation requires docstrip}
+ \Msg{* version 2.4 or later.}
+ \Msg{*}
+ \Msg{* An older version of docstrip has been input}
+ \Msg{*}
+ \Msg{**********************************************}
+ \errhelp{Move or rename old docstrip.tex and get a newer one.}
+ \errmessage{Old docstrip in input path}
+ \batchmode
+ \csname @@end\endcsname\end
+\fi
+
+\keepsilent
+\askforoverwritefalse
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\preamble
+\endpreamble
+
+\generate
+{%
+ \file{artthreads.sty}{\from{artthreads.dtx}{copyright,package}}
+}
+
+
+\Msg{***************************************************************}
+\Msg{*}
+\Msg{* \space To finish the installation you have to copy the files }
+\Msg{*}
+\Msg{* \space *.sty, *.cfg and *.def into a directory searched by TeX}
+\Msg{*}
+\Msg{***************************************************************}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\endinput
diff --git a/texmf-dist/source/latex/cntdwn/cntdwn.dtx b/texmf-dist/source/latex/cntdwn/cntdwn.dtx
new file mode 100644
index 00000000..acc02bac
--- /dev/null
+++ b/texmf-dist/source/latex/cntdwn/cntdwn.dtx
@@ -0,0 +1,1306 @@
+% \iffalse
+%<*copyright>
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% cntdwn package, 2010-8-2 %%
+%% Copyright (C) 2010 D. P. Story %%
+%% dpstory@uakron.edu %%
+%% %%
+%% This program can redistributed and/or modified under %%
+%% the terms of the LaTeX Project Public License %%
+%% Distributed from CTAN archives in directory %%
+%% macros/latex/base/lppl.txt; either version 1 of the %%
+%% License, or (at your option) any later version. %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%</copyright>
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{cntdwn}
+%<package> [2014/11/26 v.6 countdown support (dps)]
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage[colorlinks,hyperindex]{hyperref}
+\pdfstringdefDisableCommands{\let\\\textbackslash}
+\OnlyDescription
+\EnableCrossrefs
+\CodelineIndex
+\begin{document}
+ \GetFileInfo{cntdwn.sty}
+ \title{cntdwn: A countdown Package}
+ \author{D. P. Story\\
+ Email: \texttt{dpstory@uakron.edu}}
+ \date{processed \today}
+ \maketitle
+ \tableofcontents
+ \let\Email\texttt
+ \DocInput{cntdwn.dtx}
+ \PrintIndex
+\end{document}
+%</driver>
+% \fi
+%
+% \MakeShortVerb{|}
+%
+% \DoNotIndex{\def,\edef,\gdef,\xdef,\global,\long,\let}
+% \DoNotIndex{\expandafter,\string,\the,\ifx,\else,\fi}
+% \DoNotIndex{\csname,\endcsname,\relax,\begingroup,\endgroup}
+% \DoNotIndex{\DeclareTextCommand,\DeclareTextCompositeCommand}
+% \DoNotIndex{\space,\@empty,\special}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% This is a ``countdown'' package that features a countdown field and three events. Each event
+% is fired at designated points in the talk. The length of the talk is preset, it can be started,
+% paused, and stopped. There is an end of talk event as well. All these things are definable by
+% the document author, or the defaults can be taken. Only the length of the talk is required.
+%
+% We support four scenarios:
+% \begin{enumerate}
+% \item short countdown: less than a day. Designed for talks
+% \item short stopwatch: counting up from the start (less than a day)
+% \item long countdown: a countdown to an event, the event is some future date. There is an option
+% that once reached, the countdown will stop, or continue as a ``countup.''
+% \item long stopwatch: count up from the starting time/date
+%\end{enumerate}
+% \begin{macrocode}
+\RequirePackage{xkeyval}
+\def\cntdwn@defaultcode{\makeatletter
+ \InputIfFileExists{shrtcnt.def}{}\makeatother}
+\DeclareOptionX{shortcount}{%
+ \def\cntdwn@shrtcnt{\cntdwn@defaultcode}%
+}
+\let\cntdwn@shrtcnt\@empty
+\DeclareOptionX{longcount}{%
+ \def\cntdwn@lngcnt{\makeatletter
+ \InputIfFileExists{lngcnt.def}{}\makeatother}%
+}
+\let\cntdwn@lngcnt\@empty
+\ProcessOptionsX
+% \end{macrocode}
+% If no options are give, we assume \texttt{shortcount} and
+% input \texttt{shrtcnt.def}.
+% If only \texttt{longcount} is taken, then only \texttt{lngcnt.def} is input.
+% If shortcnt is taken only, we input \texttt{shrtcnt.def}, and if both options
+% are taken, we input \texttt{shrtcnt.def} followed by \texttt{lngcnt.def}.
+% \begin{macrocode}
+\ifx\cntdwn@shrtcnt\@empty
+ \ifx\cntdwn@lngcnt\@empty\AtEndOfPackage{\cntdwn@defaultcode}\else
+ \AtEndOfPackage{\cntdwn@lngcnt}\fi
+\else
+ \AtEndOfPackage{\cntdwn@defaultcode}
+ \ifx\cntdwn@lngcnt\@empty\else\AtEndOfPackage{\cntdwn@lngcnt}\fi
+\fi
+% \end{macrocode}
+% \texttt{\_oTime} is a JovaScript object that we must not let the user
+% ``overwrite'' by allowing him to name a timer with the name \texttt{Time}.
+% \begin{macrocode}
+\@namedef{Time@timername}{Time}
+% \end{macrocode}
+% \cs{cntdwnlTimers} and \cs{cntdwnaTimers} hold the JavaScript timer objects created by
+% \cs{setShortCntDwn}.
+% \begin{macrocode}
+\def\cntdwn@namegdef#1{\expandafter\gdef\csname #1\endcsname}
+\def\cntdwn@namexdef#1{\expandafter\xdef\csname #1\endcsname}
+\let\cntdwnlTimers\@empty
+\let\cntdwnaTimers\@empty
+% \end{macrocode}
+% \paragraph*{Language localizations}
+% \begin{macrocode}
+\newcommand{\cntdwnYear}{year}
+\newcommand{\cntdwnYears}{years}
+\newcommand{\cntdwnDay}{day}
+\newcommand{\cntdwnDays}{days}
+\newcommand{\cntdwnHour}{hour}
+\newcommand{\cntdwnHours}{hours}
+\newcommand{\cntdwnMinute}{minute}
+\newcommand{\cntdwnMinutes}{minutes}
+\newcommand{\cntdwnSecond}{second}
+\newcommand{\cntdwnSeconds}{seconds}
+% \end{macrocode}
+% The following JavaScript is common to both the \texttt{shortcount} and \texttt{longcount} options.
+% \begin{macrocode}
+\begin{insDLJS*}[_timerObjsLoaded]{cntdwncom}
+\begin{newsegment}{CntDwn: DLJS for the cntdwn Package}
+/*
+ Document Level JavaScript for cntdwn
+ D. P. Story copyright 2010
+*/
+var _timerObjsLoaded=true;
+\end{newsegment}
+\begin{newsegment}{CntDwn: Timer Objects}
+var _oTime = new Object;
+ _oTime.second=1000;
+ _oTime.minute=60*_oTime.second;
+ _oTime.hour=60*_oTime.minute;
+ _oTime.day=24*_oTime.hour;
+ _oTime.year = 365*_oTime.day;
+% \end{macrocode}
+% The commands \cs{cntdwnlTimers} and \cs{cntdwnaTimers} expand to objects and array assignments,
+% respectively.
+% \begin{macrocode}
+\cntdwnlTimers
+var aTimers = new Array();
+\cntdwnaTimers
+\end{newsegment}
+\end{insDLJS*}
+% \end{macrocode}
+%\changes{v.6}{2014/11/26}{Replaced the names of the fields that begin with
+%underscore with \cs{CDO}}
+% \begin{macrocode}
+\begingroup
+\catcode`\_12
+\gdef\CDO{_o}
+\endgroup
+%</package>
+%<*shortcnt>
+% \end{macrocode}
+% \section{Short Countdown Commands}
+% We introduce several commands for creating a countdown, for displaying the countdown,
+% and for controlling the countdown.
+%
+% \begin{macro}{\cntdwnopts}
+% Sets the appearances, using \textsf{eforms}, for the interactive buttons
+% \cs{cntdwnStartT}, \cs{cntdwnPauseT}, and \cs{cntdwnStopT}
+% \begin{macrocode}
+\newcommand{\cntdwnopts}[1]{\TU{#1}\H{N}\S{S}\BG{}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\cntdwnDisplay}
+% Displays the count of the (short) countdown.
+% \begin{macrocode}
+\newcommand{\cntdwnDisplay}[4][]{%
+ \expandafter\ifnum\csname#2@autorun\endcsname=1\relax
+ \def\autorun@presets{%
+ \AA{\AAPageOpen{if (!\CDO#2.isCounting&&!\CDO#2.bNotify4)
+ sStartTimer(\CDO#2);}}}\else
+ \let\autorun@presets\@empty\fi
+ \textField[\Ff\FfReadOnly\Q{1}#1\presets{\autorun@presets}
+ ]{\CDO#2.cntdwn.TimeRemaining}{#3}{#4}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\cntdwnStartT}
+% This start button does three things, pushing it starts/resumes the count, shift-clicking
+% starts the count over from the beginning, when the count reaches the first notification
+% time, the button turns green.
+% \begin{macrocode}
+\newcommand{\cntdwnStartT}[4][]{%
+ \pushButton[\presets{\cntdwnopts{Start}}
+ \A{\JS{sStartTimer(\CDO#2);}}#1]{\CDO#2.cntdwn.Notify1}{#3}{#4}}
+% \end{macrocode}
+% \begin{macro}{\cntdwnStart}
+% This button has the same features as \cs{cntdwnStartT} except it is not the target
+% of the code, that is, it \emph{does not turn green} when the first notification time is reached.
+% \begin{macrocode}
+\newcommand{\cntdwnStart}[4][]{%
+ \pushButton[\TU{Start}\A{\JS{sStartTimer(\CDO#2);}}#1
+ ]{\CDO#2.cntdwn.Start}{#3}{#4}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\cntdwnPauseT}
+% This pause button does two things, pushing it pauses the count
+% when the count reaches the second notification
+% time, the button turns yellow.
+% \begin{macrocode}
+\newcommand{\cntdwnPauseT}[4][]{%
+ \pushButton[\presets{\cntdwnopts{Pause}}
+ \A{\JS{sPauseTimer(\CDO#2);}}#1
+ ]{\CDO#2.cntdwn.Notify2}{#3}{#4}}
+% \end{macrocode}
+% \begin{macro}{\cntdwnPause}
+% This button has the same features as \cs{cntdwnPauseT} except it is not the target
+% of the code, that is, it \emph{does not turn yellow} when the second notification time is reached.
+% \begin{macrocode}
+\newcommand{\cntdwnPause}[4][]{%
+ \pushButton[\TU{Pause}\A{\JS{sPauseTimer(\CDO#2);}}#1
+ ]{\CDO#2.cntdwn.Pause}{#3}{#4}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\cntdwnStopT}
+% This stop button does two things, pushing it stops the count
+% and clears `End' fields. When the count reaches the third notification
+% time, the button turns blinks red, and when the end of the time limit
+% is reached, it turns solid red.
+% \begin{macrocode}
+\newcommand{\cntdwnStopT}[4][]{%
+ \pushButton[\presets{\cntdwnopts{Stop}}
+ \A{\JS{sStopTimer(\CDO#2);}}#1
+ ]{\CDO#2.cntdwn.Notify3}{#3}{#4}}
+% \end{macrocode}
+% \begin{macro}{\cntdwnStop}
+% This button has the same features as \cs{cntdwnStopT} except it is not the target
+% of the code, that is, it \emph{does not turn red} when the second notification time is reached.
+% \begin{macrocode}
+\newcommand{\cntdwnStop}[4][]{%
+ \pushButton[\TU{Stop}\A{\JS{sStopTimer(\CDO#2);}}#1
+ ]{\CDO#2.cntdwn.Stop}{#3}{#4}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\cntdwnEndTarget}
+% The default end of time event (\texttt{EndOfTime}) sends a message to a multiline
+% text field. That field can be constructed using \cs{cntdwnEndTarget}
+% \begin{macrocode}
+\newcommand{\cntdwnEndTarget}[4][]{%
+ \textField[\Ff\FfReadOnly\Ff\FfMultiline#1
+ ]{\CDO#2.cntdwn.End}{#3}{#4}}
+% \end{macrocode}
+% \end{macro}
+% \subsection{Defining a short countdown}
+% \begin{macro}{\setShortCntDwn}
+% Use this command to define a timer. It takes two arguments: (1) the name of the timer,
+% which must be unique among all named timers; (2) key-value pairs that define the
+% details of the timer.
+% \begin{macrocode}
+\newcommand{\setShortCntDwn}[2]{\begingroup
+ \@ifundefined{#1@timername}{\cntdwn@namegdef{#1@timername}{#1}}%
+ {\PackageError{cntdwn}{The name `#1' is already defined as a timer
+ variable.}{Choose a unique timer variable name,
+ one different from `#1'.}}%
+ \def\seconds{_oTime.second}\def\minutes{_oTime.minute}%
+ \def\hours{_oTime.hour}%
+ \setkeys{cntdwn}{endmsg,#2}%
+ \cntdwn@namexdef{#1@autorun}{\ctndwn@autorun}%
+% \end{macrocode}
+% An object that holds countdown data. The values in this object are
+%\begin{itemize}
+% \item \texttt{length} $=$ length of the countdown (countup) in minutes
+% \item \texttt{notify1} $=$ time (in minutes) when the first notification is given
+% \item \texttt{notify2} $=$ time (in minutes) when the second notification is given
+% \item \texttt{notify3} $=$ time (in minutes) when the third notification is given
+% \item \texttt{refreshrate} $=$ time (in milliseconds) to refresh (default is 1000)
+% \item \texttt{event1} $=$ the value of this key is a function that is executed when the first notification point is reached
+% \item \texttt{event2} $=$ the value of this key is a function that is executed when the second notification point is reached
+% \item \texttt{event3} $=$ the value of this key is a function that is executed when the third notification point is reached
+% \item \texttt{endEvent} $=$ the value of this key is a function that is executed when the countdown is completed
+%\end{itemize}
+% \begin{macrocode}
+ \def\r{^^J}\def\t{\space\space\space\space}%
+ \cntdwn@namexdef{#1TimerObject}{%
+% \end{macrocode}
+% We build the timer object that contains all the data for running a timer.
+% \begin{macrocode}
+ var _o#1 = {\r\t
+ name: "_o#1",\r\t
+ length: \cntdwn@length,\r\t
+ timeleft: \cntdwn@length,\r\t
+ notify1: \cntdwn@notifyi,\r\t
+ notify2: \cntdwn@notifyii,\r\t
+ notify3: \cntdwn@notifyiii,\r\t
+ refreshrate: \cntdwn@refreshrate,\r\t
+ event1: "\cntdwn@eventi",\r\t
+ event2: "\cntdwn@eventii",\r\t
+ event3: "\cntdwn@eventiii",\r\t
+ endEvent: "\cntdwn@eventiv",\r\t
+ weStopOnEnd: \cntdwn@ifstop,\r\t
+ isStopwatch: \isStopwatch,\r\t
+ startcolor: \cntdwn@startcolor,\r\t
+ pausecolor: \cntdwn@pausecolor,\r\t
+ stopcolor: \cntdwn@stopcolor,\r\t
+ endMsg: "\cntdwn@endmsg",\r\t
+% \end{macrocode}
+% The keys above are determined by \cs{setShortCntDwn}, the ones below have constant
+% initial values.
+% \begin{macrocode}
+ bNotify1:false,\r\t
+ bNotify2:false,\r\t
+ bNotify3:false,\r\t
+ bNotify4:false,\r\t
+ isCounting:false,\r\t
+ bBlinkOn:false,\r\t
+ startTime:0,\r\t
+ pauseTime:0,\r\t
+ EndOfTime:0,\r\t
+ blinkTimeOut:null,\r\t
+ timeout:null\r
+ };
+ }%
+% \end{macrocode}
+% Once the macro is defined, we add it to \cs{cntdwnlTimers}.
+% \begin{macrocode}
+ \ifx\cntdwnlTimers\@empty
+ \else\g@addto@macro\cntdwnlTimers{^^J}\fi
+ \expandafter\g@addto@macro\expandafter\cntdwnlTimers
+ \expandafter{\csname#1TimerObject\endcsname}%
+% \end{macrocode}
+% We also create an associative array named \texttt{aTimers}, here we
+% add the name of the timer to the array.
+% \begin{macrocode}
+ \ifx\cntdwnaTimers\@empty\else\g@addto@macro\cntdwnaTimers{^^J}\fi
+ \g@addto@macro\cntdwnaTimers{aTimers["_o#1"]=_o#1;}%
+ \endgroup}
+\def\thetimername#1{\csname#1@timername\endcsname}
+% \end{macrocode}
+% We require \cs{setShortCntDwn} to be executed only in the preamble, as this
+% command updates the JavaScript code found below.
+% \begin{macrocode}
+\@onlypreamble\setShortCntDwn
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{Key-value Pairs for \texorpdfstring{\cs{setShortCntDwn}}
+% {\textbackslash{setShortCntDwn}}}
+% We define the key-value pairs for \cs{setShortCntDwn}.
+%\par\medskip
+% \DescribeMacro{stopwatch} Determines whether the counter counts up or down.
+% The key \texttt{stopwatch} cause the counter to count up; the default is to
+% countdown (\texttt{stopwatch=false}).
+% \begin{macrocode}
+\define@boolkey{cntdwn}{stopwatch}[true]{%
+ \edef\isStopwatch{\ifKV@cntdwn@stopwatch true\else false\fi}}
+% \end{macrocode}
+% \DescribeMacro{autorun} A boolean, if true, the counter automatically
+% starts when the page is open that contains the counter display
+% (\cs{cntdwnDisplay})
+% \begin{macrocode}
+\define@boolkey{cntdwn}{autorun}[true]{%
+ \edef\ctndwn@autorun{\ifKV@cntdwn@autorun1\else0\fi}}
+% \end{macrocode}
+% \DescribeMacro{length} The length of the count in minutes.
+% \begin{macrocode}
+\define@key{cntdwn}{length}[20*\minutes]{\def\cntdwn@length{#1}}
+% \end{macrocode}
+% \DescribeMacro{notify1}\DescribeMacro{notify2}\DescribeMacro{notify3}
+% \texttt{notify1}, \texttt{notify2}, \texttt{notify2} measured in minutes.
+% When the timer countdowns, we should have \texttt{notify1>notify2>notify3};
+% when counting up, we should have \texttt{notify1<notify2<notify3}.
+% \begin{macrocode}
+\define@key{cntdwn}{notify1}[5*\minutes]{\def\cntdwn@notifyi{#1}}
+\define@key{cntdwn}{notify2}[3*\minutes]{\def\cntdwn@notifyii{#1}}
+\define@key{cntdwn}{notify3}[1*\minutes]{\def\cntdwn@notifyiii{#1}}
+% \end{macrocode}
+% \DescribeMacro{refreshrate} is the refresh rate of the counter, measured in
+% milliseconds. The default is 1000 (1 seconds).
+% \begin{macrocode}
+\define@key{cntdwn}{refreshrate}[1000]{\def\cntdwn@refreshrate{#1}}
+% \end{macrocode}
+% \DescribeMacro{event1}\DescribeMacro{event2}\DescribeMacro{event3}\DescribeMacro{endEvent}
+% When the first, second, third notifications are reached
+% (\texttt{notify1}, \texttt{notify2}, and \texttt{notify3}), events
+% (JavaScript functions) are executed. \textsf{Cntdwn} provides default events,
+% \texttt{sDefNotify1}, \texttt{sDefNotify2}, \texttt{sDefNotify3}, and \texttt{sDefEndEvent},
+% which are defined below in the JavaScript section.
+% \begin{macrocode}
+% events, values are JavaScript function names
+\define@key{cntdwn}{event1}[sDefNotify1]{\def\cntdwn@eventi{#1}}
+\define@key{cntdwn}{event2}[sDefNotify2]{\def\cntdwn@eventii{#1}}
+\define@key{cntdwn}{event3}[sDefNotify3]{\def\cntdwn@eventiii{#1}}
+\define@key{cntdwn}{endEvent}[sDefEndEvent]{\def\cntdwn@eventiv{#1}}
+% \end{macrocode}
+% \DescribeMacro{onfinish} determines what happens to the counter when
+% the time is up. This is a choice key, the permissible values are \texttt{stop}
+% and \texttt{continue}.
+% \begin{macrocode}
+\define@choicekey{cntdwn}{onfinish}[\val\nr]{stop,continue}[stop]{%
+ \ifcase\nr\relax\def\cntdwn@ifstop{true}\or
+ \def\cntdwn@ifstop{false}\fi}
+% \end{macrocode}
+%\DescribeMacro{startcolor}\DescribeMacro{pausecolor}\DescribeMacro{stopcolor}
+% Alert colors for countdown. The values are JavaScript colors.
+% \begin{macrocode}
+\define@key{cntdwn}{startcolor}[color.green]{%
+ \def\cntdwn@startcolor{#1}}
+\define@key{cntdwn}{pausecolor}[color.yellow]{%
+ \def\cntdwn@pausecolor{#1}}
+\define@key{cntdwn}{stopcolor}[color.red]{\def\cntdwn@stopcolor{#1}}
+\newcommand{\cnddwnDefaultEndMsg}{This ends the
+ Presentation, any questions?}
+\define@key{cntdwn}{endmsg}[\cnddwnDefaultEndMsg]{%
+ \def\cntdwn@endmsg{#1}}
+% \end{macrocode}
+% We set the default values of all timers.
+% \begin{macrocode}
+\setkeys{cntdwn}{stopwatch=false,onfinish,length,%
+ notify1,notify2,notify3,refreshrate,startcolor,pausecolor,%
+ stopcolor,event1,event2,event3,endEvent,autorun=false,endmsg}
+% \end{macrocode}
+% \begin{macrocode}
+\begin{insDLJS*}[shrtcntdwn]{shrtcntdwn}
+% \end{macrocode}
+% \begin{macrocode}
+\begin{newsegment}{CntDwn: Countdown JavaScript}
+% \end{macrocode}
+% \subsection{JavaScript for the short countdown}
+% \DescribeEnv{shrtcntdwn} This is the function that performs the countdown.
+% \begin{macrocode}
+function shrtcntdwn(cTimer){
+ var oTimer=aTimers[cTimer];
+ var _delta,nDays,pDays,nHours,pHours,nMinutes,
+ pMinutes,nSeconds,pSeconds,timeValue,isEndReached;
+ _delta=(oTimer.isStopwatch)?new Date()%
+-new Date(oTimer.startTime):new Date(oTimer.EndOfTime)-new Date();
+ oTimer.timeleft=_delta;
+ _delta=(_delta<0)?-_delta:_delta;
+ this.delay=true;
+ nDays = Math.floor(_delta/_oTime.day);
+ pDays = _delta\%_oTime.day;
+ nHours = Math.floor(pDays/_oTime.hour);
+ pHours = pDays\%_oTime.hour;
+ nMinutes = Math.floor(pHours/_oTime.minute );
+ pMinutes = pHours\%_oTime.minute;
+ nSeconds = Math.floor(pMinutes/_oTime.second);
+ pSeconds = pMinutes\%_oTime.second;
+% \end{macrocode}
+% Calculate the time remaining, prefixing single digit numbers with a zero
+% \begin{macrocode}
+ timeValue=((nHours>=1)?((nHours<10)?"0":"")+nHours+":":"")
+ +((nMinutes<10)?"0":"")+nMinutes
+ +":"+((nSeconds<10)?"0":"")+nSeconds;
+ try { this.getField(oTimer.name%
++".cntdwn.TimeRemaining").value= timeValue; }
+ catch(e) {};
+% \end{macrocode}
+% If the difference is negative, we've reached the end of the time period
+% \begin{macrocode}
+ isEndReached=(oTimer.isStopwatch)?oTimer.timeleft>oTimer.length%
+:oTimer.timeleft< 0;
+ if ( isEndReached && !oTimer.bNotify4) {
+ oTimer.bNotify4=true;
+ eval(oTimer.endEvent)(this,cTimer);
+ if (oTimer.weStopOnEnd) {
+ oTimer.isCounting=false;
+ try { app.clearInterval(oTimer.timeout);
+ oTimer.timeout=null; } catch(e){};
+ }
+ try { app.clearInterval(oTimer.blinkTimeOut);
+ oTimer.blinkTimeOut=null; } catch(e){};
+ this.delay=false;this.dirty=false;
+ if (oTimer.weStopOnEnd) return;
+ }
+% \end{macrocode}
+% If difference has reached one of our thresholds, run the notify event action
+% \begin{macrocode}
+ if (oTimer.isStopwatch) {
+ if (!oTimer.bNotify1&&(_delta>oTimer.notify1))
+ {oTimer.bNotify1=true;eval(oTimer.event1)(this,cTimer);}
+ if (!oTimer.bNotify2&&(_delta>oTimer.notify2))
+ {oTimer.bNotify2=true;eval(oTimer.event2)(this,cTimer);}
+ if (!oTimer.bNotify3&&(_delta>oTimer.notify3))
+ {oTimer.bNotify3=true;eval(oTimer.event3)(this,cTimer);}
+ } else {
+ if (!oTimer.bNotify1&&(_delta<oTimer.notify1))
+ {oTimer.bNotify1=true;eval(oTimer.event1)(this,cTimer);}
+ if (!oTimer.bNotify2&&(_delta<oTimer.notify2))
+ {oTimer.bNotify2=true;eval(oTimer.event2)(this,cTimer);}
+ if (!oTimer.bNotify3&&(_delta<oTimer.notify3))
+ {oTimer.bNotify3=true;eval(oTimer.event3)(this,cTimer);}
+ }
+ this.delay=false;this.dirty=false;
+}
+% \end{macrocode}
+% \DescribeEnv{sDefNotify1} The default first notification event.
+% \begin{macrocode}
+function sDefNotify1(doc,cTimer) {
+ var oTimer=aTimers[cTimer];
+ var f = doc.getField(cTimer+".cntdwn.Notify1");
+ if (f!=null) f.fillColor = oTimer.startcolor;
+ app.beep();
+}
+% \end{macrocode}
+% \DescribeEnv{sDefNotify2} The default second notification event.
+% \begin{macrocode}
+function sDefNotify2(doc,cTimer) {
+ var oTimer=aTimers[cTimer];
+ var f = doc.getField(cTimer+".cntdwn.Notify2");
+ if (f!=null) f.fillColor = oTimer.pausecolor;
+ app.beep();
+}
+% \end{macrocode}
+% \DescribeEnv{sDefNotify3} The default third notification event.
+% \begin{macrocode}
+function sDefNotify3(doc,cTimer) {
+ var oTimer=aTimers[cTimer];
+ app.beep();
+ var f = doc.getField(cTimer+".cntdwn.Notify3");
+ if ( f!=null)
+ oTimer.blinkTimeOut=app.setInterval(%
+"_sBlinkRed(\""+cTimer+"\")",500);
+}
+% \end{macrocode}
+% \DescribeEnv{\_sBlinkRed} The default event \texttt{sDefNotify3} calls this function
+% to blink the third notification field.
+% \begin{macrocode}
+function _sBlinkRed(cTimer) {
+ var oTimer=aTimers[cTimer];
+ var f=this.getField(cTimer+".cntdwn.Notify3");
+ f.fillColor = ( oTimer.bBlinkOn )?color.white:oTimer.stopcolor;
+ oTimer.bBlinkOn=!oTimer.bBlinkOn;
+ this.dirty=false;
+}
+% \end{macrocode}
+% \DescribeEnv{sDefEndEvent} The default event of the end of the countdown. This function
+% is fired when the count is completed.
+% This function performs an end of countdown action,
+% here we populate a field announcing the end of the countdown. An animation is
+% possible here too.
+% \begin{macrocode}
+function sDefEndEvent(doc,cTimer) {
+ var oTimer=aTimers[cTimer];
+ var f=doc.getField(cTimer+".cntdwn.Notify3");
+ if (f!=null) f.fillColor = oTimer.stopcolor;
+ f=doc.getField(cTimer+".cntdwn.End");
+ if (f!=null) f.value = oTimer.endMsg;
+}
+% \end{macrocode}
+% \DescribeEnv{sPauseTimer} Pause the timer.
+% \begin{macrocode}
+function sPauseTimer(oTimer) {
+ oTimer.isCounting=false;
+ oTimer.pauseTime=new Date().valueOf();
+ try { app.clearInterval(oTimer.timeout);
+ oTimer.timeout=null; } catch(e){};
+}
+% \end{macrocode}
+% \DescribeEnv{sStopTimer} Stop the timer.
+% \begin{macrocode}
+function sStopTimer(oTimer) {
+ oTimer.isCounting=false;
+ oTimer.startTime=oTimer.pauseTime=0;
+ oTimer.timeleft=oTimer.length;
+ try { app.clearInterval(oTimer.timeout);
+ oTimer.timeout=null; } catch(e){};
+ try { app.clearInterval(oTimer.blinkTimeOut);
+ oTimer.blinkTimeOut=null; } catch(e){};
+ try { this.getField(oTimer.name%
++".cntdwn.Notify1").fillColor = color.white; } catch(e) {}
+ try { this.getField(oTimer.name%
++".cntdwn.Notify2").fillColor = color.white; } catch(e) {}
+ try { this.getField(oTimer.name%
++".cntdwn.Notify3").fillColor = color.white; } catch(e) {}
+ oTimer.bNotify1=oTimer.bNotify2=oTimer.bNotify3%
+=oTimer.bNotify4=false;
+ this.resetForm([oTimer.name]);
+ this.dirty=false;
+}
+% \end{macrocode}
+% \DescribeEnv{sStartTimer} Start the timer.
+% \begin{macrocode}
+function sStartTimer(oTimer) {
+ if (oTimer.isCounting) return;
+ oTimer.isCounting=true;
+ if (oTimer.startTime == 0 || (event.shift) %
+|| (oTimer.weStopOnEnd&&oTimer.bNotify4) ){
+ sStopTimer(oTimer);
+ oTimer.startTime=new Date().valueOf();
+ }
+ oTimer.pauseTime=(oTimer.pauseTime==0)?0:new Date()%
+-new Date(oTimer.pauseTime)+oTimer.refreshrate;
+ oTimer.startTime+=oTimer.pauseTime;
+ if (oTimer.isStopwatch)
+ oTimer.EndOfTime=oTimer.startTime+((event.shift)?oTimer.length%
+:oTimer.timeleft);
+ else
+ oTimer.EndOfTime=new Date().valueOf()%
++((event.shift)?oTimer.length:oTimer.timeleft);
+ oTimer.timeout=app.setInterval(%
+"shrtcntdwn(\""+oTimer.name+"\")",oTimer.refreshrate);
+}
+\end{newsegment}
+\end{insDLJS*}
+%</shortcnt>
+%<*lngcnt>
+% \end{macrocode}
+% \section{Long Countdown Commands}
+% In this section, we countdown to a future event, or count-up from a previous event. These are
+% long countdowns, measured in years, days, hours, minutes, and seconds. We also define a clock
+% timer.
+%
+% \subsection{Define a long countdown}
+%
+% The author can optionally show the current time/date, and the target time/date. The required
+% field is the one that displays the countdown.
+%
+% \begin{macro}{\lcntdwnDisplay} This field is the target of the countdown. It holds
+% the current formatted countdown.
+% \begin{macrocode}
+\newcommand{\lcntdwnDisplay}[4][]{%
+ \let\autorun@presets\@empty
+ \expandafter\ifnum\csname#2@autorun\endcsname=1\relax
+ \edef\autorun@presets{%
+ \AAPageOpen{if (\CDO#2.bAutorunEnabled && \CDO#2.timeout==null) lStartTimer(\CDO#2);}}\fi
+ \expandafter\ifnum\csname#2@autopause\endcsname=1\relax
+ \edef\autorun@presets{\autorun@presets
+ \AAPageClose{if (\CDO#2.timeout!=null) lcntdwnPause(\CDO#2);}}\fi
+ \edef\autorun@presets{\noexpand\AA{\autorun@presets}}%
+ \textField[\Ff\FfReadOnly\textSize{0}#1
+ \presets{\autorun@presets}]%
+ {\CDO#2.lcntdwn.timeToFromEvent}{#3}{#4}}
+% \end{macrocode}
+% \end{macro}
+% \DescribeMacro{\lcntdwnToggle} A simple button to toggle the count off and one.
+% \begin{macrocode}
+\newcommand{\lcntdwnToggle}[4][]{%
+ \pushButton[\TU{Toggle Countdown}\A{\JS{lcntdwnToggle(\CDO#2);}}#1
+ ]{\CDO#2.lcntdwn.Toggle}{#3}{#4}}
+% \end{macrocode}
+% \begin{macro}{\setLongCntDwn}
+% Use this command to define a timer. It takes two arguments: (1) the name of the timer,
+% which must be unique among all named timers; (2) key-value pairs that define the
+% details of the timer.
+% \begin{macrocode}
+\newcommand{\setLongCntDwn}[2]{\begingroup
+ \@ifundefined{#1@timername}{\cntdwn@namegdef{#1@timername}{#1}}%
+ {\PackageError{cntdwn}{The name `#1' is already defined as a timer
+ variable.}{Choose a unique timer variable name,
+ one different from `#1'.}}%
+ \setkeys{lcntdwn}{date,endmsg,#2}%
+ \def\seconds{_oTime.second}\def\minutes{_oTime.minute}%
+ \def\hours{_oTime.hour}\def\days{_oTime.day}%
+ \def\weeks{7*_oTime.day}\def\years{_oTime.year}%
+ \cntdwn@namexdef{#1@autorun}{\lctndwn@autorun}%
+ \cntdwn@namexdef{#1@autopause}{\lctndwn@autopause}%
+ \ifx\lcntdwn@date\@empty\def\lcntdwn@date{1970/01/01}%
+ \PackageWarning{cntdwn}{!!Beware!!
+ The `date' key was not supplied,\MessageBreak
+ using the default date 1970/01/01}\fi
+ \def\r{^^J}\def\t{\space\space\space\space}%
+ \cntdwn@namexdef{#1TimerObject}{%
+% \end{macrocode}
+% We build the timer object that contains all the data for running a timer.
+% \begin{macrocode}
+ var _o#1 = {\r\t
+ name: "_o#1",\r\t
+ pdfdate:"D:\lcntdwn@date\lcntdwn@time\lcntdwn@tz",\r\t
+ target: null,\r\t
+ refreshrate: 1000,\r\t
+ notify1: \lcntdwn@notifyi,\r\t
+ notify2: \lcntdwn@notifyii,\r\t
+ notify3: \lcntdwn@notifyiii,\r\t
+ notify5: \lcntdwn@notifyv,\r\t
+ notify6: \lcntdwn@notifyvi,\r\t
+ notify7: \lcntdwn@notifyvii,\r\t
+ eventhandler: "\lcntdwn@eventhandler",\r\t
+ refreshrate: \lcntdwn@refreshrate,\r\t
+ timedateFunc: "\lcntdwn@timedateFunc",\r\t
+ displayfunc: "\lcntdwn@displayfunc",\r\t
+ endtimecolor: \cntdwn@endtimecolor,\r\t
+ weStopOnEnd: \lcntdwn@ifstop,\r\t
+ endMsg: "\lcntdwn@endmsg",\r\t
+ bAutorunEnabled:\lcntdwn@autorunenabled,\r\t
+% \end{macrocode}
+% The keys above are determined by \cs{setLongCntDwn}, the ones below have constant
+% initial values.
+% \begin{macrocode}
+ bNotify1:false,\r\t
+ bNotify2:false,\r\t
+ bNotify3:false,\r\t
+ bNotify4:false,\r\t
+ bNotify5:false,\r\t
+ bNotify6:false,\r\t
+ bNotify7:false,\r\t
+ lastSignDelta:1,\r\t
+ timeout:null\r
+ };
+ }%
+% \end{macrocode}
+% Once the macro is defined, we add it to \cs{cntdwnlTimers}.
+% \begin{macrocode}
+ \ifx\cntdwnlTimers\@empty
+ \else\g@addto@macro\cntdwnlTimers{^^J}\fi
+ \expandafter\g@addto@macro\expandafter\cntdwnlTimers
+ \expandafter{\csname#1TimerObject\endcsname}%
+% \end{macrocode}
+% We also create an associative array named \texttt{aTimers}, here we
+% add the name of the timer to the array.
+% \begin{macrocode}
+ \ifx\cntdwnaTimers\@empty\else\g@addto@macro\cntdwnaTimers{^^J}\fi
+ \g@addto@macro\cntdwnaTimers{aTimers["_o#1"]=_o#1;}%
+ \endgroup}
+% \end{macrocode}
+% \subsubsection{Key-value Pairs for \texorpdfstring{\cs{setLongCntDwn}}{\textbackslash{setLongCntDwn}}}
+% \end{macro}
+% In the next segment, we parse the \texttt{date} value.
+% \begin{macrocode}
+\def\@lcntdwn@parse@YYYY#1#2#3#4{%
+ {\count0=#1\relax\count0=#2\relax
+ \count0=#3\relax\count0=#4\relax}%
+ \def\lcntdwn@date{#1#2#3#4}%
+ \@ifnextchar\@nil{\@gobbletonil}%
+ {\@ifnextchar/{\expandafter\@lcntdwn@parse@MM\@gobble}%
+ {\def\lcntdwn@date{#1#2#3#4}}}%
+}
+\def\@lcntdwn@parse@MM#1#2{%
+ {\count0=#1\relax\count0=#2\relax}%
+ \edef\lcntdwn@date{\lcntdwn@date#1#2}%
+ \@ifnextchar\@nil{\@gobbletonil}%
+ {\@ifnextchar/{\expandafter\@lcntdwn@parse@DD\@gobble}%
+ {\edef\lcntdwn@date{\lcntdwn@date#1#2}}}%
+}
+\def\@lcntdwn@parse@DD#1#2{%
+ {\count0=#1\relax\count0=#2\relax}%
+ \edef\lcntdwn@date{\lcntdwn@date#1#2}%
+ \@gobbletonil
+}
+% \end{macrocode}
+% In the next segment, we parse the \texttt{time} value.
+% \begin{macrocode}
+\def\@lcntdwn@parse@HH#1#2{%
+ {\count0=#1\relax\count0=#2\relax}%
+ \def\lcntdwn@time{#1#2}
+ \@ifnextchar\@nil{\@gobbletonil}%
+ {\@ifnextchar:{\expandafter\@lcntdwn@parse@mm\@gobble}%
+ {\def\lcntdwn@time{#1#2}}}%
+}
+\def\@lcntdwn@parse@mm#1#2{%
+ {\count0=#1\relax\count0=#2\relax}%
+ \edef\lcntdwn@time{\lcntdwn@time#1#2}%
+ \@ifnextchar\@nil{\@gobbletonil}%
+ {\@ifnextchar:{\expandafter\@lcntdwn@parse@SS\@gobble}%
+ {\edef\lcntdwn@time{\lcntdwn@time#1#2}}}%
+}
+\def\@lcntdwn@parse@SS#1#2{%
+ {\count0=#1\relax\count0=#2\relax}%
+ \edef\lcntdwn@time{\lcntdwn@time#1#2}%
+ \@gobbletonil
+}
+% \end{macrocode}
+% In the next segment, we parse the \texttt{timezone} value.
+% \begin{macrocode}
+% offset from UTC Z|[+-]HHMM
+\def\tz@Z{Z}\def\tz@p{+}\def\tz@m{-}
+\def\lcntdwn@parse@tz{\@ifnextchar\@nil
+ {\let\lcntdwn@tz\@empty}{\@lcntdwn@parse@tz}%
+}
+\def\@lcntdwn@parse@tz#1{%
+ \def\argi{#1}\ifx\argi\tz@Z
+ \def\lcntdwn@tz{Z}\def\@next{\@gobbletonil}%
+ \else\ifx\argi\tz@p\def\lcntdwn@tz{+}%
+ \def\@next{\tz@gethrs}\else
+ \ifx\argi\tz@m\def\lcntdwn@tz{-}%
+ \def\@next{\tz@gethrs}\else
+ \let\lcntdwn@tz\@empty\def\@next{\@gobbletonil}%
+ \fi\fi\fi\@next
+}
+\def\@gobbletonil#1\@nil{}
+\def\tz@gethrs#1#2{{\count0=#1\relax\count0=#2\relax}%
+ \edef\lcntdwn@tz{\lcntdwn@tz#1#2'}%
+ \@ifnextchar\@nil{\@gobbletonil}{\tz@getmnts}}
+\def\tz@getmnts#1#2{{\count0=#1\relax\count0=#2\relax}%
+ \edef\lcntdwn@tz{\lcntdwn@tz#1#2'}\@gobbletonil}
+% \end{macrocode}
+% \begin{macrocode}
+% YYYY/MM/DD
+\define@key{lcntdwn}{date}[]{%
+ \edef\argi{#1}\ifx\argi\@empty
+ \def\lcntdwn@date{}\let\@next\relax\else
+ \def\@next{\expandafter\@lcntdwn@parse@YYYY\argi\@nil}\fi
+ \@next
+}
+% HH:MM:SS
+\define@key{lcntdwn}{time}[]{%
+ \edef\argi{#1}\ifx\argi\@empty
+ \let\lcntdwn@time\@empty\let\@next\relax\else
+ \def\@next{\expandafter\@lcntdwn@parse@HH\argi\@nil}\fi
+ \@next
+}
+% offset from UTC Z|[+-]HHMM
+\define@key{lcntdwn}{tzoffset}[]{%
+ \def\argi{#1}\ifx\argi\@empty
+ \let\lcntdwn@tz\@empty\let\@next\relax\else
+ \def\@next{\lcntdwn@parse@tz#1\@nil}\fi
+ \@next
+}
+\define@boolkey{lcntdwn}{autorun}[true]{%
+ \edef\lctndwn@autorun{\ifKV@lcntdwn@autorun1\else0\fi}}
+\define@boolkey{lcntdwn}{autopause}[true]{%
+ \edef\lctndwn@autopause{\ifKV@lcntdwn@autopause1\else0\fi}}
+\define@boolkey{lcntdwn}{autorunenabled}[true]{%
+ \edef\lcntdwn@autorunenabled{\ifKV@lcntdwn@autorunenabled
+ true\else false\fi}}
+% \end{macrocode}
+% \DescribeMacro{notify1}\DescribeMacro{notify2}\DescribeMacro{notify3}
+% \DescribeMacro{notify5}\DescribeMacro{notify6}\DescribeMacro{notify7}
+% \texttt{notify1}, \texttt{notify2}, \texttt{notify2} are pre-event times.
+% The times must satisfy the relation\texttt{notify1>notify2>notify3}.
+% \texttt{notify5}, \texttt{notify6}, and \texttt{notify7}
+% are post-event times, the must satisf \texttt{notify5<notify6<notify7}.
+% Times are relative to the main event (time 0).
+% \begin{macrocode}
+\define@key{lcntdwn}{notify1}[null]{\def\lcntdwn@notifyi{#1}}
+\define@key{lcntdwn}{notify2}[null]{\def\lcntdwn@notifyii{#1}}
+\define@key{lcntdwn}{notify3}[null]{\def\lcntdwn@notifyiii{#1}}
+\define@key{lcntdwn}{notify5}[null]{\def\lcntdwn@notifyv{#1}}
+\define@key{lcntdwn}{notify6}[null]{\def\lcntdwn@notifyvi{#1}}
+\define@key{lcntdwn}{notify7}[null]{\def\lcntdwn@notifyvii{#1}}
+% \end{macrocode}
+% \begin{environment}{eventhandler}
+% The JavaScript function that handles
+% the event of reaching one of the notification time values.
+% \begin{macrocode}
+% events, values are JavaScript function names
+\define@key{lcntdwn}{eventhandler}[_NoOpt]{%
+ \def\lcntdwn@eventhandler{#1}}
+% \end{macrocode}
+% \end{environment}
+% \DescribeMacro{refreshrate} is the refresh rate of the counter, measured in
+% milliseconds. The default is 1000 (1 second).
+% \begin{macrocode}
+\define@key{lcntdwn}{refreshrate}[1000]{\def\lcntdwn@refreshrate{#1}}
+% \end{macrocode}
+% \DescribeMacro{currtimefunc} This keys allows a document author to define his/her
+% own JS function to display the time and date. The default is to show time and
+% date in separate fields.
+% \begin{macrocode}
+\define@key{lcntdwn}{currtimefunc}[_defaultTimeDateFunc]{%
+ \def\lcntdwn@timedateFunc{#1}}
+% \end{macrocode}
+% \DescribeMacro{displayfunc} This key allows you to define how the display the countdown.
+% Use a clock timer defined by \cs{setClockTimer}, not supported by timers created by
+% \cs{setLongCntDwn}.
+% \begin{macrocode}
+\define@key{lcntdwn}{displayfunc}[_defaultLDisplayFunc]{%
+ \def\lcntdwn@displayfunc{#1}}
+% \end{macrocode}
+% \DescribeMacro{endtimecolor} The color of the count changes when the end time value is reached.
+% the default is \texttt{color.red}, use this key to change the default color.
+% \begin{macrocode}
+\define@key{lcntdwn}{endtimecolor}[color.red]{%
+ \def\cntdwn@endtimecolor{#1}}
+% \end{macrocode}
+% \DescribeMacro{onfinish} A choice key to determine how the timer behave when the
+% end time is reached. Choices are \texttt{stop} or \texttt{continue} (the default).
+% \begin{macrocode}
+\define@choicekey{lcntdwn}{onfinish}[\val\nr]{stop,continue}[stop]{%
+ \ifcase\nr\relax\def\lcntdwn@ifstop{true}\or
+ \def\lcntdwn@ifstop{false}\fi}
+% \end{macrocode}
+% \DescribeMacro{endmsg} When \texttt{onfinish=stop} a message appears in the
+% display, the default message is ``The time has expired.'' This message may be
+% change locally by this key, or globally by redefining the command
+% \cs{lcnddwnDefaultEndMsg}.
+% \begin{macrocode}
+\newcommand{\lcnddwnDefaultEndMsg}{The time has expired}
+\define@key{lcntdwn}{endmsg}[\lcnddwnDefaultEndMsg]{%
+ \def\lcntdwn@endmsg{#1}}
+% \end{macrocode}
+% \paragraph*{Set the defaults for the long countdown}
+% \begin{macrocode}
+\setkeys{lcntdwn}{time,tzoffset,refreshrate,autorun,autopause,%
+ autorunenabled,notify1,notify2,notify3,notify5,notify6,notify7,%
+ eventhandler,endtimecolor,displayfunc,currtimefunc,%
+ onfinish=continue,endmsg}
+% \end{macrocode}
+% \subsection{Creating a clock}
+% A clock is a special timer what displays the current time and date.
+% Clocks defined by \cs{setClockTimer} show local time, by default, but
+% can also show time/date in other time zones.
+% \begin{macro}{\setClockTimer}
+% Set the name and key-value pairs that describe the properties of this clock.
+% \begin{macrocode}
+\newcommand{\setClockTimer}[2]{\begingroup
+ \@ifundefined{#1@timername}{\cntdwn@namegdef{#1@timername}{#1}}%
+ {\PackageError{cntdwn}{The name `#1' is already defined as a timer
+ variable.}{Choose a unique timer variable name,
+ one different from `#1'.}}%
+ \setkeys{lcntdwn}{#2}%
+ \def\seconds{_oTime.second}\def\minutes{_oTime.minute}%
+ \def\hours{_oTime.hour}\def\days{_oTime.day}%
+ \def\weeks{7*_oTime.day}\def\years{_oTime.year}%
+ \cntdwn@namexdef{#1@autorun}{\lctndwn@autorun}%
+ \cntdwn@namexdef{#1@autopause}{\lctndwn@autopause}%
+% \end{macrocode}
+% \begin{macrocode}
+ \def\r{^^J}\def\t{\space\space\space\space}%
+ \cntdwn@namexdef{#1TimerObject}{%
+% \end{macrocode}
+% We build the clock timer object that contains all the data for running the clock.
+% \begin{macrocode}
+ var _o#1 = {\r\t
+ name: "_o#1",\r\t
+ tzoffset:"\lcntdwn@tz",\r\t
+ refreshrate: \lcntdwn@refreshrate,\r\t
+ timedateFunc: "\lcntdwn@timedateFunc",\r\t
+ timeout:null\r
+ };
+ }%
+% \end{macrocode}
+% Once the macro is defined, we add it to \cs{cntdwnlTimers}.
+% \begin{macrocode}
+ \ifx\cntdwnlTimers\@empty
+ \else\g@addto@macro\cntdwnlTimers{^^J}\fi
+ \expandafter\g@addto@macro\expandafter\cntdwnlTimers
+ \expandafter{\csname#1TimerObject\endcsname}%
+% \end{macrocode}
+% We also create an associative array named \texttt{aTimers}, here we
+% add the name of the timer to the array.
+% \begin{macrocode}
+ \ifx\cntdwnaTimers\@empty\else\g@addto@macro\cntdwnaTimers{^^J}\fi
+ \g@addto@macro\cntdwnaTimers{aTimers["_o#1"]=_o#1;}%
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+% \DescribeMacro{\cntdwnclocktime} The text field that displays the time. It is also
+% the one that responds to the \texttt{autorun} and \texttt{autopause} options.
+% \begin{macrocode}
+\newcommand{\cntdwnclocktime}[4][]{%
+ \let\autorun@presets\@empty
+ \expandafter\ifnum\csname#2@autorun\endcsname=1\relax
+ \edef\autorun@presets{%
+ \AAPageOpen{if (\CDO#2.timeout==null) clStartTimer(\CDO#2);}}\fi
+ \expandafter\ifnum\csname#2@autopause\endcsname=1\relax
+ \edef\autorun@presets{\autorun@presets
+ \AAPageClose{if (\CDO#2.timeout!=null) clcntdwnPause(\CDO#2);}}\fi
+ \edef\autorun@presets{\noexpand\AA{\autorun@presets}}%
+ \textField[\Ff\FfReadOnly\Q{1}\textSize{0}#1
+ \presets{\autorun@presets}]%
+ {\CDO#2.clock.time}{#3}{#4}}
+% \end{macrocode}
+% \DescribeMacro{\cntdwnclockdate} The text field that displays the date. This field
+% is optional; both time and date may be displayed on the \cs{cntdwnclocktime} display,
+% this would require a custom value for the \texttt{timedateFunc} property.
+% \begin{macrocode}
+\newcommand{\cntdwnclockdate}[4][]{\textField[%
+ \Ff\FfReadOnly\Q{1}\textSize{0}#1]{\CDO#2.clock.date}{#3}{#4}}
+% \end{macrocode}
+% \DescribeMacro{\clockToggle} A simple button to toggle the clock off and one.
+% \begin{macrocode}
+\newcommand{\clockToggle}[4][]{%
+ \pushButton[\TU{Toggle Countdown}\A{\JS{clockToggle(\CDO#2);}}#1
+ ]{\CDO#2.lcntdwn.Toggle}{#3}{#4}}
+% \end{macrocode}
+% \subsection{JavaScript for long countdowns}
+% \begin{macrocode}
+\begin{insDLJS*}[lngcntdwn]{lngcntdwn}
+\begin{newsegment}{CntDwn: Convert Time Function}
+/*
+ This function converts the PDF Date Format to a JavaScript
+ Date object. The PDF Date Format is specified in section
+ 3.8.3 in the PDF Reference.
+*/
+function pdfDate2oDate( pdfDate ) {
+ // if present, remove the "D:" in format
+ if ( pdfDate.indexOf("D:") != -1 )
+ pdfDate = pdfDate.substring(2);
+ // now see if the O component is there
+ var re = /[\+\-Z]/;
+ var nIndex = pdfDate.search(re);
+ // separate the time date info from the time zone offset info
+ if ( nIndex != -1 ) {
+ var cTimeZone = pdfDate.substring(nIndex);
+ pdfDate = pdfDate.substring(0, nIndex);
+ } else cTimeZone = "";
+ // seg is an array of arrays. The first element is the field width,
+ // the second entry is the default value.
+ var seg = [[4,1970],[2,1],[2,1],[2,0],[2,0],[2,0]];
+ // an array to hold time arguments for the date constructor.
+ var args = new Array();
+ // as we determine the values of the PDF Date Format, push them onto
+ // the args array, if not present, push the default value on.
+ for ( var i=0; i < seg.length; i++) {
+ if ( pdfDate.length > 0 ) {
+ args.push(Number( pdfDate.substring(0, seg[i][0]) ) );
+ pdfDate = pdfDate.substring( seg[i][0] );
+ } else args.push( seg[i][1] );
+ }
+ // adjust month to base zero
+ args[1] = args[1] - 1;
+ // see if there is time zone info
+ var pm = "";
+ if ( cTimeZone.length > 0 ) {
+ pm = cTimeZone.charAt(0);
+ var zoneOffsetHr=Number(cTimeZone.substring(1,3));
+ cTimeZone=cTimeZone.substring(3);
+ var zoneOffsetMin=0;
+ if ( cTimeZone.length > 0 && cTimeZone.charAt(0) == "'" )
+ var zoneOffsetMin = Number( cTimeZone.substring(1,3) );
+ var totalOffset=zoneOffsetHr*60+zoneOffsetMin;
+ totalOffset*= 60000;
+ totalOffset=( pm == "-" )?-1*totalOffset:totalOffset;
+ var msTime=Date.UTC.apply(global,args);
+ msTime = msTime - totalOffset;
+ var d = new Date( msTime );
+ } else {
+ var dateArgs = args.toSource().replace(/[\[\]]/g,"");
+ var d = eval("new Date(" + dateArgs + ")" );
+ }
+ return d
+}
+\end{newsegment}
+\begin{newsegment}{CntDwn: Long Countdown JavaScript}
+function lngcntdwn(cTimer){
+ var _delta,nYears,pYears,nDays,pDays,nHours,pHours,nMinutes,
+ pMinutes,nSeconds,pSeconds,f,thisSignDelta,msYear;
+ var oTimer=aTimers[cTimer];
+ var Clock=new Date();
+ this.delay=true;
+ _delta=oTimer.target-Clock;
+ var o=lCalcYears(oTimer,Clock,_delta);
+ nYears=o.nYears;
+ pYears=o.pYears;
+ _delta=o.delta;
+% \end{macrocode}
+% Having made the correct calculation for the number of years, \texttt{pYears}
+% returns to us ready to calculate the number of days.
+% \begin{macrocode}
+ nDays=Math.floor(pYears/_oTime.day);
+ pDays=pYears\%_oTime.day;
+ nHours=Math.floor(pDays/_oTime.hour);
+ pHours=pDays\%_oTime.hour;
+ nMinutes=Math.floor(pHours/_oTime.minute);
+ pMinutes=pHours\%_oTime.minute;
+ nSeconds=Math.round(pMinutes/_oTime.second);
+ pSeconds=pMinutes\%_oTime.second;
+% \end{macrocode}
+% if \texttt{\_delta = oTimer.target - Clock} is positive, event is in future
+% at this time, if negative, it is in the past.
+% \begin{macrocode}
+ f=this.getField(cTimer+".lcntdwn.timeToFromEvent");
+ thisSignDelta=(_delta<0)?-1:1;
+ if (thisSignDelta*oTimer.lastSignDelta<0&&!oTimer.bNotify4) {
+ if (f!=null) f.textColor=oTimer.endtimecolor;
+ oTimer.bNotify4=true;
+ oTimer.lastSignDelta=thisSignDelta;
+ eval(oTimer.eventhandler)(this,cTimer,4);
+ if (oTimer.weStopOnEnd) {
+ try { app.clearInterval(oTimer.timeout);
+ oTimer.timeout=null; } catch(e){};
+ if (f!=null) f.value=oTimer.endMsg;
+ return;
+ }
+ }
+ if (!oTimer.bNotify4&&_delta>0){ // event in future
+ if (!oTimer.bNotify1&&oTimer.notify1!=null%
+&&_delta<oTimer.notify1) {
+ oTimer.bNotify1=true;
+ eval(oTimer.eventhandler)(this,cTimer,1);
+ } else {
+ if (!oTimer.bNotify2&&oTimer.notify2!=null%
+&&_delta<oTimer.notify2) {
+ oTimer.bNotify2=true;
+ skipCheckB=true;
+ eval(oTimer.eventhandler)(this,cTimer,2);
+ } else {
+ if (!oTimer.bNotify3&&oTimer.notify3!=null%
+&&_delta<oTimer.notify3) {
+ oTimer.bNotify3=true;
+ eval(oTimer.eventhandler)(this,cTimer,3);
+ }
+ }
+ }
+ }
+ if (oTimer.bNotify4&&_delta<0){// event in past
+ var neg_delta=-1*_delta;
+ if (!oTimer.bNotify5&&oTimer.notify5!=null&&%
+neg_delta>oTimer.notify5) {
+ oTimer.bNotify5=true;
+ eval(oTimer.eventhandler)(this,cTimer,5);
+ } else {
+ if (!oTimer.bNotify6&&oTimer.notify6!=null&&%
+neg_delta>oTimer.notify6) {
+ oTimer.bNotify6=true;
+ eval(oTimer.eventhandler)(this,cTimer,6);
+ } else {
+ if (!oTimer.bNotify7&&oTimer.notify7!=null&&%
+neg_delta>oTimer.notify7) {
+ oTimer.bNotify7=true;
+ eval(oTimer.eventhandler)(this,cTimer,7);
+ }
+ }
+ }
+ }
+% \end{macrocode}
+% Display the current time and date, and the countdown.
+% \begin{macrocode}
+% eval(oTimer.timedateFunc)(Clock,cTimer);
+ eval(oTimer.displayfunc)(f,nYears,nDays,nHours,nMinutes,nSeconds);
+ this.delay=false;
+ this.dirty=false;
+}
+function _defaultTimeDateFunc(oTime,cTimer) {
+ try{ this.getField(cTimer+".clock.time").value%
+=util.printd("H:MM:ss",oTime); } catch(e) {};
+ try { this.getField(cTimer+".clock.date").value=%
+util.printd("mm/dd/yyyy", oTime); } catch(e) {};
+}
+function _defaultLDisplayFunc(f,nYears,nDays,nHours,nMinutes,nSeconds) {
+ var strYears=(nYears==0)?""%
+:(""+nYears+((nYears == 1)?" \cntdwnYear, ":" \cntdwnYears, "));
+ var strDays=(nDays== 0)?""%
+:(""+nDays+((nDays==1)?" \cntdwnDay, ":" \cntdwnDays, "));
+ var strHours=(nHours==0)?""%
+:(""+nHours+((nHours==1)?" \cntdwnHour, ":" \cntdwnHours, "));
+ var strMinutes=(nMinutes==0)?""%
+:(""+nMinutes+((nMinutes==1)?" \cntdwnMinute, ":" \cntdwnMinutes, "));
+ var strSeconds=""+nSeconds+((nSeconds<2)?" \cntdwnSecond "%
+:" \cntdwnSeconds ");
+ var cCntDwnDisplay=strYears+strDays+strHours+strMinutes+strSeconds;
+ try { f.value=cCntDwnDisplay; } catch(e) {}
+}
+function lCalcYears(oTimer,Clock,_delta) {
+ var nYears,lengthOfYears,targetpdfdate,targetYear,thisYear,
+ otherYear,currAnnivDate,otherAnnivDate,tCurrAnnivDate,
+ tOtherAnnivDate,msYear=0;
+% \end{macrocode}
+% Get the \texttt{pdfdate} for the target event, and\dots
+% \begin{macrocode}
+ targetpdfdate=oTimer.pdfdate;
+% \end{macrocode}
+% get the target year and the current year. The \texttt{otherYear} is
+% the year previous to the current year, if \texttt{\_delta<0}; otherwise,
+% it is the year following the current year.
+% \begin{macrocode}
+ targetYear=Number(targetpdfdate.substring(2,6));
+ thisYear=Clock.getFullYear();
+ otherYear=(_delta<0)?thisYear-1:thisYear+1;
+% \end{macrocode}
+% Build the \texttt{pdfdate} for the anniversary date in this year, and
+% for the \texttt{other\-Anniv\-Date}.
+% \begin{macrocode}
+ currAnnivDate=targetpdfdate.substring(0,2)%
++thisYear+targetpdfdate.substring(6);
+ otherAnnivDate=targetpdfdate.substring(0,2)%
++otherYear+targetpdfdate.substring(6);
+% \end{macrocode}
+% \texttt{tCurrAnnivDate} is the anniversary date (object) of target event in the current year,
+% and \texttt{tOtherAnnivDate} is either the previous anniversary date (if \texttt{\_delta<0}),
+% or the next anniversary date.
+% \begin{macrocode}
+ tCurrAnnivDate=pdfDate2oDate( currAnnivDate );
+ tOtherAnnivDate=pdfDate2oDate( otherAnnivDate );
+ if (_delta<0) {
+ if ( Clock < tCurrAnnivDate ){
+% \end{macrocode}
+% If we have not reached the anniversary date in the current year, the the number
+% of years that have passed since the target event is based on the date of the target
+% event, and the previous anniversary date of the event.
+% \begin{macrocode}
+ nYears=otherYear-targetYear;
+ lengthOfYears=oTimer.target-tOtherAnnivDate;
+% \end{macrocode}
+% We have reached the anniversary date in the current date. \texttt{nYears}
+% is based on the current year and the year of the target vent.
+% \begin{macrocode}
+ } else {
+ nYears=thisYear-targetYear;
+ lengthOfYears=oTimer.target-tCurrAnnivDate;
+ }
+ } else {// _delta>=0
+ if ( Clock > tCurrAnnivDate ) {
+% \end{macrocode}
+% We have passed the most recent anniversary in this year, so number of years
+% between the current date and the target event (which is in the future) is based
+% on the \texttt{otherYear} (the next anniversary date) and the target year.
+% \begin{macrocode}
+ nYears=targetYear-otherYear;
+ lengthOfYears=oTimer.target-tOtherAnnivDate;
+ } else {
+% \end{macrocode}
+% We have not passed the anniversary in this year, so number of years
+% between the current date and the target event (which is in the future) is based
+% on the \texttt{thisYear} and the target year.
+% \begin{macrocode}
+ nYears=targetYear-thisYear;
+ lengthOfYears=oTimer.target-tCurrAnnivDate;
+ }
+ }
+% \end{macrocode}
+% Now we subtract out the number of years (in milliseconds) from the difference
+% in time between the event and the current time.
+% \begin{macrocode}
+ _delta-=lengthOfYears;
+ pYears=Math.abs(_delta);
+ return {
+ nYears:nYears,
+ pYears:pYears,
+ delta:_delta
+ };
+}
+function lStartTimer(oTimer) {
+ var cTimer=oTimer.name;
+ oTimer.target=pdfDate2oDate(oTimer.pdfdate).getTime();
+ var bWasNotified=oTimer.bNotify4;
+ var _delta=oTimer.target-new Date();
+ oTimer.lastSignDelta=(_delta<0)?-1:1;
+ if ( _delta > 0 ) {
+ oTimer.bNotify1=(_delta<oTimer.notify1);
+ oTimer.bNotify2=(_delta<oTimer.notify2);
+ oTimer.bNotify3=(_delta<oTimer.notify3);
+ } else {
+ oTimer.bNotify4=true;
+ oTimer.bNotify5=(-1*_delta>oTimer.notify5);
+ oTimer.bNotify6=(-1*_delta>oTimer.notify6);
+ oTimer.bNotify7=(-1*_delta>oTimer.notify7);
+ }
+% \end{macrocode}
+% On start up, if the target event has not been notified, we fire up
+% the main event.
+% \begin{macrocode}
+ if (!bWasNotified&&oTimer.bNotify4) {
+ var f=this.getField(cTimer+".lcntdwn.timeToFromEvent");
+ if (f!=null) f.textColor=oTimer.endtimecolor;
+ eval(oTimer.eventhandler)(this,cTimer,4);
+ }
+% \end{macrocode}
+% If we start the timer and we have already passed the main event, and we
+% are to stop on end, we put in the final message, and do not start the counter.
+% \begin{macrocode}
+ if (_delta<0&&oTimer.weStopOnEnd) {
+ f.value=oTimer.endMsg;
+ return;
+ }
+ oTimer.timeout=app.setInterval(%
+"lngcntdwn(\""+cTimer+"\")",oTimer.refreshrate);
+}
+function lcntdwnPause(oTimer) {
+ try { app.clearInterval(oTimer.timeout);
+ oTimer.timeout=null; } catch(e){};
+}
+function lcntdwnToggle(oTimer) {
+ if (oTimer.timeout==null) // stopped or paused
+ lStartTimer(oTimer);
+ else
+ lcntdwnPause(oTimer);
+}
+function _NoOpt(doc,cTimer,nEvent){}
+% \end{macrocode}
+% \subsection{JavaScript to control a clock}
+% Controls for the clock
+% \begin{macrocode}
+function lngClockHandler(cTimer) {
+ var oTimer=aTimers[cTimer];
+ var Clock = new Date();
+ if ( oTimer.tzoffset != "" ) {
+ var localTime = Clock.getTime();
+ var localOffset = Clock.getTimezoneOffset()*60000;
+ // obtain UTC time in msec
+ var utc = localTime + localOffset;
+ var tzoffset=(oTimer.tzoffset=="Z")?0:oTimer.tzoffset;
+ var nonlocal=utc+oTimer.tzoffset;
+ Clock = new Date(nonlocal);
+ }
+ this.delay=true;
+ eval(oTimer.timedateFunc)(Clock,cTimer);
+ this.dirty=false;
+ this.delay=false;
+}
+function clStartTimer(oTimer) {
+ var tzoffset=oTimer.tzoffset;
+ if ( tzoffset !="" && tzoffset !="Z" ) {
+ var sign=tzoffset.charAt(0);
+ offset=tzoffset.substring(1);
+ var a=tzoffset.split("'");
+ var hrs=Number(a[0]);
+ var mins=Number(a[1]);
+ tzoffset=hrs*3600000+mins*60000;
+ tzoffset=((sign=="+")?1:-1)*tzoffset;
+ oTimer.tzoffset=tzoffset;
+ }
+ var cTimer=oTimer.name;
+ oTimer.timeout=app.setInterval(%
+"lngClockHandler(\""+cTimer+"\")",oTimer.refreshrate);
+}
+function clockToggle(oTimer) {
+ if (oTimer.timeout==null) // stopped or paused
+ clStartTimer(oTimer);
+ else
+ lcntdwnPause(oTimer);
+}
+\end{newsegment}
+\end{insDLJS*}
+% \end{macrocode}
+% \begin{macrocode}
+%</lngcnt>
+%<*package>
+%</package>
+% \end{macrocode}
+% \Finale
+\endinput
diff --git a/texmf-dist/source/latex/cntdwn/cntdwn.ins b/texmf-dist/source/latex/cntdwn/cntdwn.ins
new file mode 100644
index 00000000..27fe75d6
--- /dev/null
+++ b/texmf-dist/source/latex/cntdwn/cntdwn.ins
@@ -0,0 +1,65 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1999-2006 D. P. Story
+%%
+%% This file is part of the `AcroTeX eDucation Bundle'.
+%% -------------------------------------------
+%%
+%% It may be distributed under the conditions of the LaTeX Project Public
+%% License, either version 1.2 of this license or (at your option) any
+%% later version. The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.2 or later is part of all distributions of LaTeX
+%% version 1999/12/01 or later.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2010/08/02}
+\def\batchfile{cntdwn.ins}
+%
+% If you can assume that the target audience for the document all have
+% Acrobat Reader 5.0 or later, then chance the following switch to true,
+% else, leave it as false.
+
+\input docstrip
+\ifx\generate\undefined
+ \Msg{**********************************************}
+ \Msg{*}
+ \Msg{* This installation requires docstrip}
+ \Msg{* version 2.4 or later.}
+ \Msg{*}
+ \Msg{* An older version of docstrip has been input}
+ \Msg{*}
+ \Msg{**********************************************}
+ \errhelp{Move or rename old docstrip.tex and get a newer one.}
+ \errmessage{Old docstrip in input path}
+ \batchmode
+ \csname @@end\endcsname\end
+\fi
+
+\keepsilent
+\askforoverwritefalse
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\preamble
+\endpreamble
+
+\generate{%
+ \file{cntdwn.sty}{\from{cntdwn.dtx}{copyright,package}}
+ \file{shrtcnt.def}{\from{cntdwn.dtx}{copyright,shortcnt}}
+ \file{lngcnt.def}{\from{cntdwn.dtx}{copyright,lngcnt}}
+}
+
+\Msg{***************************************************************}
+\Msg{*}
+\Msg{* \space To finish the installation you have to copy the files }
+\Msg{*}
+\Msg{* \space *.sty, *.cfg and *.def into a directory searched by TeX}
+\Msg{*}
+\Msg{***************************************************************}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\endinput
diff --git a/texmf-dist/source/latex/cntdwn/examples/clock_tst.tex b/texmf-dist/source/latex/cntdwn/examples/clock_tst.tex
new file mode 100644
index 00000000..ee2b4f8a
--- /dev/null
+++ b/texmf-dist/source/latex/cntdwn/examples/clock_tst.tex
@@ -0,0 +1,56 @@
+\documentclass{article}
+\usepackage[designvi,usesf,tight]{web}
+\usepackage{eforms}
+\usepackage[longcount]{cntdwn}
+
+\title{The \texttt{cntdwn} Package
+ \texorpdfstring{\\[6pt]}{: }Clock Timers}
+\author{D. P. Story}
+\subject{Demo file illustrating clocks, local and foreign time zones}
+\keywords{AeB, AcroTeX, clocks, countdown, cntdwn package}
+
+\university{Acro\negthinspace\TeX.Net}
+\email{dpstory@acrotex.net}
+\version{1.0}
+\copyrightyears{2010}
+\revisionLabel{}
+
+\setClockTimer{LocalClock}{}
+\setClockTimer{CESTClock}{tzoffset=+0200} % this is summer time, CET is +0100
+
+\parskip6pt\parindent0pt
+
+\begin{document}
+
+\maketitle
+
+The clocks below show local time and date (the time/date your computer
+shows), and the time and date of Central Europe during the summer (CEST), the
+time when this demo file was originally created.
+
+\begin{tabular}{rcc}
+Local Time: &%
+\cntdwnclocktime{LocalClock}{1in}{11bp}&%
+\cntdwnclockdate{LocalClock}{1in}{11bp}\\[3bp]
+CEST: &%
+\cntdwnclocktime{CESTClock}{1in}{11bp}&%
+\cntdwnclockdate{CESTClock}{1in}{11bp}%
+\end{tabular}
+
+In the preamble we have
+\begin{verbatim}
+\setClockTimer{LocalClock}{}
+\setClockTimer{CESTClock}{tzoffset=+0200}
+\end{verbatim}
+and in the body of the document we have
+\begin{verbatim}
+\begin{tabular}{rcc}
+Local Time: &\cntdwnclocktime{LocalClock}{1in}{11bp}&%
+\cntdwnclockdate{LocalClock}{1in}{11bp}\\[3bp]
+CEST: &\cntdwnclocktime{CESTClock}{1in}{11bp}&%
+\cntdwnclockdate{CESTClock}{1in}{11bp}%
+\end{tabular}
+\end{verbatim}
+These commands are available through the \texttt{longcount} option of the \texttt{cntdwn}
+package.
+\end{document}
diff --git a/texmf-dist/source/latex/cntdwn/examples/lngcntdwn_tst.tex b/texmf-dist/source/latex/cntdwn/examples/lngcntdwn_tst.tex
new file mode 100644
index 00000000..e4b0ae7d
--- /dev/null
+++ b/texmf-dist/source/latex/cntdwn/examples/lngcntdwn_tst.tex
@@ -0,0 +1,62 @@
+\documentclass{article}
+\usepackage[designi,usesf]{web}
+\usepackage{eforms}
+\usepackage[longcount]{cntdwn}
+
+\title{The \texttt{cntdwn} Package
+ \texorpdfstring{\\[6pt]}{: }Long Countdown}
+\author{D. P. Story}
+\subject{Demo file illustrating the long countdown of the cntdwn package}
+\keywords{AeB, AcroTeX, clocks, countdown, cntdwn package}
+
+\university{Acro\negthinspace\TeX.Net}
+\email{dpstory@acrotex.net}
+\version{1.0}
+\copyrightyears{2010}
+\revisionLabel{}
+
+\thispagestyle{empty}
+\parindent0pt\parskip6pt
+
+
+\setLongCntDwn{NewYearsLocal}
+{%
+ date=2015/01/01,
+ time=00:01:00,
+ endmsg=Happy New Year from wherever I currently am!,
+ onfinish=stop
+}
+\setLongCntDwn{NewYearsCET}
+{%
+ date=2015/01/01,
+ time=00:01:00,
+ tzoffset=+0100,
+ endmsg=Happy New Year from wherever central Europe!,
+ onfinish=stop
+}
+
+
+\begin{document}
+
+\maketitle
+
+The long countdown shows the time remaining to an event in the (usually
+distant) future.
+
+\begin{tabular}{rc}
+\multicolumn{2}{c}{Time to New Years Day}\\[3bp]
+Local:&\lcntdwnDisplay{NewYearsLocal}{2.5in}{11bp}\\[3bp]
+CET:&\lcntdwnDisplay{NewYearsCET}{2.5in}{11bp}
+\end{tabular}
+
+In central Europe, the two countdowns should read the same, in the U.S.,
+they may differ by at least 5 hours.
+
+When the count has reached 0 seconds, a message appears in the text field
+wishing you a Happy New Year, from Acro\negthinspace\TeX. I hope you stay
+up until 1 second after midnight to see the message. Then, you can set
+the dates to \texttt{2016/01/01} for me, now there's a good fellow.
+
+This code is available through the \texttt{longcount} option of the \texttt{cntdwn} package.
+
+\end{document}
diff --git a/texmf-dist/source/latex/cntdwn/examples/shrtcntdwn_tst.tex b/texmf-dist/source/latex/cntdwn/examples/shrtcntdwn_tst.tex
new file mode 100644
index 00000000..4ebf62ac
--- /dev/null
+++ b/texmf-dist/source/latex/cntdwn/examples/shrtcntdwn_tst.tex
@@ -0,0 +1,79 @@
+\documentclass{article}
+\usepackage[designi,usesf]{web}
+\usepackage{eforms}
+\usepackage{cntdwn}
+
+\title{The \texttt{cntdwn} Package
+ \texorpdfstring{\\[6pt]}{: }Short Countdown}
+\author{D. P. Story}
+\subject{Demo file illustrating the short countdown of the cntdwn package}
+\keywords{AeB, AcroTeX, clocks, countdown, cntdwn package}
+
+\university{Acro\negthinspace\TeX.Net}
+\email{dpstory@acrotex.net}
+\version{1.0}
+\copyrightyears{2010}
+\revisionLabel{}
+
+\thispagestyle{empty}
+\parindent0pt\parskip6pt
+
+\setShortCntDwn{CntDwnTimer}
+{%
+ autorun,
+ length=1*\minutes,
+ notify1=45*\seconds,
+ notify2=30*\seconds,
+ notify3=15*\seconds
+}
+\setShortCntDwn{CntUpTimer}
+{%
+ stopwatch,
+ length=1*\minutes,
+ notify1=15*\seconds,
+ notify2=30*\seconds,
+ notify3=45*\seconds,
+ endmsg=Thank you for trying the cntdwn package from AcroTeX!,
+ onfinish=continue,
+}
+\begin{document}
+
+\maketitle
+
+
+Counting down: Length 1 minute, \texttt{notify1} at 45 seconds, \texttt{notify2} at 30
+seconds, and \texttt{notify3} at 15 seconds.
+
+Time Remaining:
+\cntdwnDisplay{CntDwnTimer}{.5in}{11bp}
+\cntdwnStartT{CntDwnTimer}{11bp}{11bp}
+\cntdwnPauseT{CntDwnTimer}{11bp}{11bp}
+\cntdwnStopT{CntDwnTimer}{11bp}{11bp}
+
+\begin{center}
+\cntdwnEndTarget[\BC{}\textSize{20}\textColor{blue}\Q{1}]{CntDwnTimer}{.67\linewidth}{1in}
+\end{center}
+
+\newpage
+
+Counting up: Length 1 minute, \texttt{notify1} at 15 seconds, \texttt{notify2} at 30
+seconds, and \texttt{notify3} at 45 seconds. This counter set to start
+manually, press the Start button (second from left).
+
+Time Remaining:
+\cntdwnDisplay{CntUpTimer}{.5in}{11bp}
+\cntdwnStartT{CntUpTimer}{11bp}{11bp}
+\cntdwnPauseT{CntUpTimer}{11bp}{11bp}
+\cntdwnStopT{CntUpTimer}{11bp}{11bp}
+
+You can optionally have explicit buttons instead of, or in addition to, the
+three right most buttons:
+\cntdwnStart[\CA{Start}\textSize{7}]{CntUpTimer}{}{9bp}
+\cntdwnPause[\CA{Pause}\textSize{7}]{CntUpTimer}{}{9bp}
+\cntdwnStop[\CA{Stop}\textSize{7}]{CntUpTimer}{}{9bp}
+
+\begin{center}
+\cntdwnEndTarget[\BC{}\textSize{20}\textColor{blue}\Q{1}]{CntUpTimer}{.67\linewidth}{1in}
+\end{center}
+
+\end{document}
diff --git a/texmf-dist/source/latex/ecards/doc/ecardsman.tex b/texmf-dist/source/latex/ecards/doc/ecardsman.tex
new file mode 100644
index 00000000..242ea5e5
--- /dev/null
+++ b/texmf-dist/source/latex/ecards/doc/ecardsman.tex
@@ -0,0 +1,726 @@
+% makeindex < aebpro_man.idx > aebpro_man.ind
+\documentclass{article}
+\usepackage[fleqn]{amsmath}
+\usepackage[
+ web={centertitlepage,designv,forcolorpaper,latextoc,pro},
+ eforms,
+ linktoattachments,
+ aebxmp
+]{aeb_pro}
+\usepackage{graphicx,array}
+%\usepackage{myriadpro}
+%\usepackage{calibri}
+\usepackage[altbullet]{lucidbry}
+
+%\usepackage{makeidx}
+%\makeindex
+\usepackage{acroman}
+\usepackage[active]{srcltx}
+
+%\urlstyle{rm}
+\urlstyle{sf}
+
+\DeclareDocInfo
+{
+ university={NORTHWEST FLORIDA STATE COLLEGE\\
+ Department of Mathematics},
+ title={eCards: Electronic Flash Cards\texorpdfstring{\\[3ex]}{,} Manual of Usage},
+ author={D. P. Story},
+ email={dpstory@acrotex.net},
+ subject={Documentation for the eCards package from AcroTeX},
+ talksite={\url{www.acrotex.net}},
+ version={2.0, 2016/09/03},
+ keywords={AcroTeX, flash cards, interactive},
+ copyrightStatus=True,
+ copyrightNotice={Copyright (C) \the\year, D. P. Story},
+ copyrightInfoURL={http://www.acrotex.net}
+}
+
+\def\dps{$\hbox{$\mathfrak D$\kern-.3em\hbox{$\mathfrak P$}%
+ \kern-.6em \hbox{$\mathcal S$}}$}
+
+\universityLayout{fontsize=Large}
+\titleLayout{fontsize=LARGE}
+\authorLayout{fontsize=Large}
+\tocLayout{fontsize=Large,color=aeb}
+\sectionLayout{indent=-62.5pt,fontsize=large,color=aeb}
+\subsectionLayout{indent=-31.25pt,color=aeb}
+\subsubsectionLayout{indent=0pt,color=aeb}
+\subsubDefaultDing{\texorpdfstring{$\bullet$}{\textrm\textbullet}}
+
+\widestNumber{0.00.}
+%\pagestyle{empty}
+%\parindent0pt\parskip\medskipamount
+
+\def\dps{$\mbox{$\mathfrak D$\kern-.3em\mbox{$\mathfrak P$}%
+ \kern-.6em \hbox{$\mathcal S$}}$}
+
+\frenchspacing
+
+\chngDocObjectTo{\newDO}{doc}
+\begin{docassembly}
+var titleOfManual="The AeB eCards MANUAL";
+var manualfilename="Manual_BG_Print_ecards.pdf";
+var manualtemplate="Manual_BG_Green.pdf"; // Blue, Green, Brown
+var _pathToBlank="C:/Users/Public/Documents/ManualBGs/"+manualtemplate;
+var doc;
+var buildIt=true;
+if ( buildIt ) {
+ console.println("Creating new " + manualfilename + " file.");
+ doc = \appopenDoc({cPath: _pathToBlank, bHidden: true});
+ var _path=this.path;
+ var pos=_path.lastIndexOf("/");
+ _path=_path.substring(0,pos)+"/"+manualfilename;
+ \docSaveAs\newDO ({ cPath: _path });
+ doc.closeDoc();
+ doc = \appopenDoc({cPath: manualfilename, oDoc:this, bHidden: true});
+ f=doc.getField("ManualTitle");
+ f.value=titleOfManual;
+ doc.flattenPages();
+ \docSaveAs\newDO({ cPath: manualfilename });
+ doc.closeDoc();
+} else {
+ console.println("Using the current "+manualfilename+" file.");
+}
+var _path=this.path;
+var pos=_path.lastIndexOf("/");
+_path=_path.substring(0,pos)+"/"+manualfilename;
+\addWatermarkFromFile({
+ bOnTop:false,
+ bOnPrint:false,
+ cDIPath:_path
+});
+\executeSave();
+\end{docassembly}
+
+\begin{document}
+
+\maketitle
+
+\selectColors{linkColor=black}
+\tableofcontents
+\selectColors{linkColor=webgreen}
+
+
+%--------------
+%\usepackage{amsmath}
+%\usepackage[designi,dvipsone,tight,latextoc,nodirectory,usesf]{web}
+%%\usepackage[dvipsone,designi,latextoc,forpaper,nodirectory,usesf]{web}
+%%\usepackage[nocorrections]{exerquiz}
+%\usepackage{verbatim}
+%% \usepackage{longtable,colortbl}
+%% \usepackage{pifont}
+%\usepackage[usecmtt]{myriadpro}
+
+
+
+%\pdfstringdefDisableCommands{\let\!\empty}
+
+% \setlongtables
+
+\def\AcroT{Acro\!\TeX}\def\cAcroT{\textcolor{blue}{\AcroT}}
+\def\AcroEB{\AcroT{} eDucation Bundle}\def\cAcroEB{\textcolor{blue}{\AcroEB}}
+\def\AcroB{\AcroT{} Bundle}\def\cAcroB{\textcolor{blue}{\AcroB}}
+\def\bUrl{http://www.math.uakron.edu/~dpstory}
+
+\hypersetup{linktocpage}
+
+%\newenvironment{sverbatim}
+%{\par\footnotesize\verbatim}{\endverbatim\noindent}
+%
+%\newcommand\redpoint{\par\ifdim\lastskip>0pt\relax\vskip-\lastskip\fi
+%\vskip\medskipamount\noindent
+% \makebox[\parindent][l]{\large\color{red}$\blacktriangleright$}}
+%\newcommand\handpoint{\par\ifdim\lastskip>0pt\relax\vskip-\lastskip\fi
+%\vskip\medskipamount\noindent
+% \makebox[\parindent][l]{\large\color{blue}\ding{042}}}
+
+%\newcommand{\cs}[1]{\texttt{\char`\\#1}}
+
+
+%\begin{document}
+%
+%\maketitle
+%\tableofcontents
+
+\section{Introduction}
+
+The initial version of this package was developed at the request of my colleague, Dr.\ Thomas
+Price for use in the senior honors project of Ms.\ Katie Jones on
+\href{http://www.math.uakron.edu/~teprice/Trig/}{Trig Flash Cards}.
+Upon completion of the honors project, I generalized and extended
+the original package developed specifically for them.
+
+Version~2.0 (2016/07/20) of \app{eCards} brings the package up to date with
+the \pkg{exerquiz} package, which has undergone considerable revision since
+\app{eCards} first appeared. The only changes in the package is its name, the
+package name is \texttt{ecards} rather than \app{eCards}, also,
+\pkg{exerquiz} package dated 2016/04/18 or later is required.
+
+\section{Overview}
+
+We give a graphical overview of \app{eCards} using the demonstration file
+\texttt{ecardstst.tex}. There are three types of pages, excluding the cover
+page: the question page, the hint page, and the answer page.
+
+\begin{figure}[htb]
+\hskip-62.5pt\begin{minipage}{\linewidth+62.5pt}
+\centering
+\includegraphics[width=.32\linewidth]{graphics/ecardstst-panel-ques}\hfill
+\includegraphics[width=.32\linewidth]{graphics/ecardstst-panel-hint}\hfill
+\includegraphics[width=.32\linewidth]{graphics/ecardstst-panel-ans}\hfill
+ \caption{The question, hint, and answer pages with panel}\label{fig:ecards-pan}
+\end{minipage}
+\end{figure}
+
+\hyperref[fig:ecards-pan]{Figure~\ref*{fig:ecards-pan}} shows the demonstration document using the
+\opt{rightpanel} option; the user navigates through the document by pressing
+the links labeled `Hint', `Soln', `Next', and `Prev'.
+
+Using the \opt{usetemplates} option instead of \opt{rightpanel} renders the
+same pages as shown in \hyperref[fig:ecards-nopan]{Figure~\ref*{fig:ecards-nopan}}.
+
+\begin{figure}[htb]
+\hskip-62.5pt\begin{minipage}{\linewidth+62.5pt}
+\centering
+\includegraphics[width=.32\linewidth]{graphics/ecardstst-nopanel-ques}\hfill
+\includegraphics[width=.32\linewidth]{graphics/ecardstst-nopanel-hint}\hfill
+\includegraphics[width=.32\linewidth]{graphics/ecardstst-nopanel-ans}\hfill
+ \caption{The question, hint, and answer pages with no panel}\label{fig:ecards-nopan}
+\end{minipage}
+\end{figure}
+
+In the case of \opt{usetemplates},
+\hyperref[fig:ecards-nopan]{Figure~\ref*{fig:ecards-nopan}}, the user works
+through the cards using the navigation icons in to footer of the page.
+
+When the \opt{listing} option is used along with the \opt{forpaper} option, a
+document suitable for printing is produced. The document contains the
+questions, hints, and solutions for the document author to conveniently
+review. This document is shown in \hyperref[fig:ecards-listing]{Figure~\ref*{fig:ecards-listing}}.
+
+\begin{figure}[htb]\centering\setlength{\fboxsep}{0pt}\fbox
+{\includegraphics[width=.67\linewidth]{graphics/ecardstst-listing}}
+ \caption{The cards with the \texttt{listing} option}\label{fig:ecards-listing}
+\end{figure}
+
+\section{Documentation}
+
+In this section, the major elements of this package are highlighted. For those
+who want to know more, you can peruse the {\LaTeX} code, there are comments
+contained there as well. The document \texttt{ecardstst.tex} illustrates
+most of what you need to know for creating your own electronic flash cards.
+
+\subsection{Preamble: Required packages and options}
+
+\subsubsection{Required packages}
+
+This package depends heavily on the
+\textbf{\href{http://www.math.uakron.edu/~dpstory/webeq.html}
+{Acro\negthinspace\TeX{} eDucation Bundle}}: (1) the \pkg{web} package
+provides page setup, backgrounds, and navigational elements; (2) the
+\pkg{exerquiz} package (dated 2016/04/18 or later) allows you to author the
+questions, both non-responsive and responsive (fill-in and multiple choice);
+and (3) the \pkg{insdljs} packages is the mechanism for introducing
+document-level JavaScripts into the final document.
+
+\subsubsection{Drivers}
+
+The supported drivers are the same as those supported by \pkg{exerquiz}:
+\texttt{dvipsone}, \texttt{dvips}, \texttt{pdftex}, and \texttt{xetex}.
+
+A typical set of packages used for on screen presentation:
+\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
+\usepackage[!ameta(driver_option),tight,rightpanel]{web}
+\usepackage[!ameta(options)]{exerquiz}
+\usepackage[!ameta(options)]{ecards}
+\end{Verbatim}
+where \ameta{driver\_option} is any of the drivers listed above;
+\texttt{pdftex} and \texttt{xetex} are automatically detected so they need
+not be specified; if the driver option \texttt{dvips} is specified in the
+\texttt{web.cfg}, it need not be specified either.
+
+\paragraph*{A note on \app{xetex}.}
+The \app{xetex} application may be set to strip out named destinations that
+are not referenced within the document as a target of a `hard-wired' link.
+The \pkg{ecards} package sets a lot of destinations (or targets) but, in many
+instances, `dynamic' links are employed using the JavaScript method
+\texttt{\textsl{Doc}.gotoNamedDest(\ameta{target})}. In such instances,
+\app{xetex} may strip out these targets; the link or button action may not
+perform the jump to the destination because the destination does not exist.
+If this becomes an issue for your \app{xetex} installation, the
+\textbf{\app{Dvipdfmx} Compatibility Flags} needs to be modified. Search for
+the configuration file \texttt{dvipdfmx.cfg}, open the file. Scroll down to
+the line `\texttt{\%C 0x0000}', beneath it insert `\texttt{C 0x0010}', save
+and close the file.\footnote{MiK\TeX{} discourages the direct editing of the
+file \texttt{dvipdfmx.cfg}, instead, on the command-line prompt type and
+execute `\texttt{initexmf -{}-edit-config-file dvipdfmx}' enabling you to edit
+a local version of the configuration file as described above.} The
+documentation for this bit field is just above the referenced line and an
+explanation of the `\texttt{C 0x0010}' setting is given.
+
+
+\subsubsection{Options}
+
+\paragraph*{\app{eCards} options.}\hskip-\lastskip\
+The \pkg{ecards} package really has only 4 options:
+\begin{enumerate}
+ \item \texttt{nohints}: If you do not want to provide hints in your \app{eCards},
+ use this option. See also the comments in \Nameref{hint}.
+
+ The default is to provide and display hints to each card; when
+ \opt{nohints} is specified in the option list of \pkg{ecards}, no
+ hints provided becomes the default.
+
+ Whether hints are provided or not can be overridden in two ways:
+ through the optional argument of the \env{card} environment
+ (\autopageref{ss:cardEnv}), and through the commands listed next.
+\bVerb\takeMeasure{\string\useNoHints\quad\string\useHints}%
+\begin{dCmd}[commandchars=!()]{\bxSize}
+\useNoHints!quad\useHints
+\end{dCmd}
+\eVerb The commands are used between \env{card} environments to change the
+default usage of hints. When hints are \emph{not provided}, a simple message
+defined by the command \cs{noHintProvided} (see \autopageref{noHintProvided}) appears on the hint page.
+
+ \item \texttt{listing}:\label{listing} This option gives you a printable version of your
+ \app{eCards}. In this way, you can proofread, check your questions, hints,
+ and answers. Suggested packages and options are given below:
+\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
+\usepackage[!ameta(driver_option),forpaper]{web}
+\usepackage[solutionsafter,proofing]{exerquiz}
+\usepackage[listing]{ecards}
+\end{Verbatim}
+This option sets the Boolean \cs{ifecListing} to true; this Boolean is used
+to define optional content. Read \Nameref{ss:cardEnv} for an example of
+using \cs{ifecListing}.
+
+Refer to \hyperref[fig:ecards-listing]{Figure~\ref*{fig:ecards-listing}}
+ for a depiction of an \app{eCards} document under the \opt{listing}
+ option.
+ \item \texttt{memLogo}: The logo, if any, is read and re-read
+ for each page on which it appears. Using this option, the logo
+ is read once and saved in a box for use.
+ \item \texttt{custom}: If this option is included in the option list, the
+ package looks for and inputs the file \texttt{ecard.cus}. This file
+ can be used to customize the environments. This file should be kept
+ in the source directory, not in the {\LaTeX} search path.
+\end{enumerate}
+
+\paragraph*{Other options.}
+Selecting the various options of the \textsf{web} and
+\textsf{exerquiz} packages can give you different looks. It is
+important to be aware of all the options associated with these
+two package; in the paragraphs below, various options are
+discussed that may be useful in \app{eCards}.
+
+\subparagraph*{Useful \pkg{web} package options.}
+There are three background/\penalty0panel options; these are \texttt{usetemplates},
+\texttt{rightpanel} and \texttt{leftpanel}.
+
+Using the \texttt{usetemplates} option does not give you the vertical
+navigation panel, but it does provide background colors; the
+\texttt{rightpanel} and \texttt{leftpanel} given you a vertical panel on the
+right and left, respectively. Use one of these three options only, if any at
+all. Using none of these three will just get you the default white
+background. See the {\AEB} documentation for details.
+
+There are certain ``standard'' page designs, or you can create your own using
+the \cs{margins} and \cs{screensize}; the demo document has
+\begin{Verbatim}
+ \margins{.25in}{.25in}{24pt}{.25in} % left,right,top, bottom
+ \screensize{3.72in}{366.24bp} % height, width
+\end{Verbatim}
+See the \pkg{web} package documentation for details on these and other
+options.
+
+\subparagraph*{Useful \pkg{exerquiz} package options.}
+If you are not using multiple choice or fill-in questions, you should use
+the \texttt{exercisesonly} option. This removes much of the document level JavaScript
+from the PDF document.
+
+For authors that use the full Acrobat~5.0, or the newer Acrobat
+6.0 Standard or Acrobat 6.0 Professional, you can use the
+\texttt{execJS} option. If this option is taken, then when the
+document is first loaded into Acrobat (following distillation, or
+creation using \textsf{dvipdfm} or \textsf{pdftex}), the document
+will be automatically saved; this saves any imported document
+level JavaScript in the document. The document always needs to be saved
+after creation so save the scripts with the document, this does it automatically
+so you can't forget to do it---as one of my colleagues once did.
+
+The \texttt{nosolutions} option removes the \texttt{response} environment
+leaving only the questions. The \texttt{proofing} and \texttt{preview} options
+can be useful for proofreading, as described in the \texttt{\hyperref[listing]{listing}}
+option described above.
+
+\subsubsection{Original customization commands}\label{ss:origCus}
+
+The \app{eCards} defines several (text) commands, there are listed here:
+\begin{itemize}
+\item \cs{cardsFinishedMsg}: When the user has reviewed all the electronic flash cards,
+ an alert dialog appears with a message. The contents of the message are defined by
+ this command. The default is
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\cardsFinishedMsg{You've seen all the cards!}
+\end{Verbatim}
+
+\item \cs{cardColor}, \cs{hintColor}, and \cs{solnColor}: The background colors of various pages.
+The defaults are
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\cardColor{vlightblue}
+\hintColor{cornsilk}
+\solnColor{webyellow}
+\end{Verbatim}
+Additionally, \cs{textBgColor} command is used to define the default
+background color (of the \pkg{web} package). This will be the color of the
+first page, the default is \cs{textBgColor\darg{cornsilk}}. The panel
+background is controlled by the \pkg{web} command \cs{panelBgColor}; for
+example, \cs{panelBgColor\darg{logoblue}}.
+
+\item \cs{ecLogo}: The logo emblem that would appear in the upper portion of the vertical
+ navigational strip. This assumes you are using either the \texttt{rightpanel} or
+ \texttt{leftpanel} option for \textsf{web}. The default is
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\ecLogo{\includegraphics[scale=.4]{graphics/uakron}}
+\end{Verbatim}
+As you can see, the argument of this command is a graphic command, usually the command
+\cs{includegraphics} from the \textsf{graphicx} package.
+
+\item \cs{ecLogoLink}: This is the URL of the link destination that will be placed
+ around the logo. The default is an empty address, in this case, no link is placed
+ around the logo emblem. An example of usage:
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\ecLogoLink{http://www.uakron.edu/}
+\end{Verbatim}
+
+\item \cs{ecHomePage}: This is the URL to a page. This will be used as a link destination
+ of the `Home' button seen on the first page of the \app{eCards} document.
+\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
+\ecHomePage{http://www.math.uakron.edu/~dpstory/acrotex.html}
+\end{Verbatim}
+
+\item \cs{noHintJSAction}: When there are no hints (the document author has taken the
+option \texttt{nohints}, the `hints' button is grayed out, but still functional, with
+no JavaScript action. You can add some action to this button through this command.
+An example of usage is
+\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
+\renewcommand\noHintJSAction{app.alert("No hints provided!")}
+\end{Verbatim}
+\end{itemize}
+\hyperref[s:addiCus]{Section~\ref*{s:addiCus}} lists more customization
+commands, available with version~2 or later of \app{eCards}.
+
+\subsection{\texorpdfstring{\protect\cs{begin\{document\}}}
+{\textbackslash{begin\{document\}}}: Start creating cards}
+
+The process of creating these electronic cards is quite simple, the sections below
+describe the \texttt{card}, \texttt{response}, \texttt{hint} and \texttt{answers} environments.
+
+\subsubsection{The \texttt{card} environment}\label{ss:cardEnv}
+
+The main environment is the \texttt{card} environment, which is used for posing
+questions, offering a hint, and an answer. The \hypertarget{cardsyntax}{syntax} is,
+\bVerb\takeMeasure{\string\begin\darg{card}[hint|nohint]}%
+\begin{dCmd}[commandchars=!()]{\bxSize}
+\begin{card}[hint|nohint]
+ !ameta(a question)
+ \begin{response}
+ \begin{hint}
+ !ameta(a hint)
+ \end{hint}
+ \begin{answer}
+ !ameta(an answer)
+ \end{answer}
+ \end{response}
+\end{card}
+\end{dCmd}
+\eVerb The optional parameter takes one of two keys,
+\texttt{hint} or \texttt{nohint}. Normally, each question contains a hint,
+but there is an option, \texttt{nohints}, for declaring that no hints are to
+be used for the question. You can pass one of these two parameters into the
+\texttt{card} environment to declare there is a hint for this question (in
+the case \texttt{nohints} is selected as an option), or to declare there is
+no hint for this question (in the case \texttt{nohints} \emph{is not} an
+option). If no parameter is passed, it is assumed the question has a hint,
+unless the \texttt{nohints} option is used, in which case it is assumed the
+question has no hint.
+
+Below is the first \env{card} environment for \texttt{ecardstst.tex} showing the nesting
+of the \env{card}, \env{response}, \env{hint}, and \env{answer} environments.
+\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
+\begin{card}
+ Who was the first President of the United States?
+\begin{response}
+ \begin{hint}
+ Legend has it, he chopped down the cherry tree and
+ couldn't tell a lie.
+ \end{hint}
+ \begin{answer}
+ \ifecListing
+ George Washington (1789-1797)
+ \else\centering
+ \includegraphics[scale=.4]{presidents/gw1}\\
+ George Washington\\
+ 1789-1797
+ \fi
+ \end{answer}
+\end{response}
+\end{card}
+\end{Verbatim}
+The role of \cs{ifecListing} is also shown in the above verbatim listing.
+When \opt{listing} is specified, there is no need for the graphic; we use a
+text phrase instead.
+
+
+\newtopic\noindent\textbf{\textcolor{red}{Important.}} You can pose a question which requires
+a verbal response, or one for which there is a choice of
+alternatives, or a fill-in the blank (math or text). See the demo
+file \texttt{ecardstst.tex} for examples.
+
+\subsubsection{The \texttt{response} environment}
+
+Immediately following and nesting within the \env{card} environment is the
+\env{response} environment. This sets things up for the responses to the
+question: the hint and the answer.
+
+\subsubsection{The \texttt{hint} environment}\label{hint}
+
+The first environment to appear within the \texttt{response} is
+the \env{hint} environment. Here you can provide additional
+information to help the student answer the question successfully.
+I've posed a multiple choice or fill-in question, you can simply
+copy the multiple choice or fill-in into the hint, just as I have done
+in the demo file \texttt{ecardstst.tex}.
+
+In this release, hints can be provided for \textbf{all} of the questions or
+for \textbf{none} of the questions. You can enter hints using the \env{hint}
+environment, illustrated \hyperlink{cardsyntax}{above}, or not include a
+\env{hint} environment. When you do not want to include hints---whether
+you've entered the environments or not---use the \opt{nohints} package
+option. This will convert the \env{hint} environment into a \texttt{comments}
+environment, and redefine some of the navigational buttons.
+
+\subsubsection{The \texttt{answer} environment}
+
+After the \env{hint} environment comes the answer environment where the answer to
+the original question can be presented. At the end of this environment, you
+need to back out of the nested environments: \cs{end\darg{answer}},
+\cs{end\darg{response}} and \cs{end\darg{card}}.
+
+\subsection{\texorpdfstring{\protect\cs{end\{document\}}}{\textbackslash{end\{document\}}}}
+
+That's the end! Once you have completed your \app{eCards} file, you are
+ready to create your \app{eCards} PDF document!
+%The \app{eCards} package supports PDF
+%creation using any of the following methods:
+%\begin{enumerate}
+% \item $\text{\texttt{.tex}}\mapsto\text{\texttt{.dvi}}\mapsto\text{\texttt{.ps}}\mapsto\text{\texttt{.pdf}}$.
+% This route uses the \texttt{dvipsone} or \texttt{dvips} option
+% (for the \textsf{web} package), followed by the use of the
+% Acrobat Distiller (Version 5.0 or later suggested).
+% \item $\text{\texttt{.tex}}\mapsto\text{\texttt{.dvi}}\mapsto\text{\texttt{.pdf}}$. Here, you latex the
+% document, then hit the result using \textsf{dvipdfm}. Naturally, you would use the \texttt{dvipdfm}
+% option with the \textsf{web} package.
+% \item $\text{\texttt{.tex}}\mapsto\text{\texttt{.pdf}}$. Here, you use the \texttt{pdftex} option
+% of \textsf{web}, and \textsf{pdflatex} the document.
+%\end{enumerate}
+
+
+\subsection{Additional customization commands}\label{s:addiCus}
+
+Version~2.0 or later has a number of commands designed to customize the look of \app{eCards} without
+having to redefine some of the environments.
+
+\subsubsection{The question page}
+
+In addition to \cs{cardColor}, described briefly in \Nameref{ss:origCus}, the following are also defined
+on the question page.
+\bVerb\takeMeasure{\string\ecAfterQuesSkip\darg{\ameta{skip}}}%
+\edef\x{\the\wd\webtempboxi}%
+\def\1{\hbox to0pt{\hskip\x\relax\quad\normalfont(\texttt{.25in})\hss}}%
+\def\2{\hbox to0pt{\hskip\x\relax\quad\normalfont(\texttt{.85\string\linewidth})\hss}}%
+\takeMeasure{\string\renewcommand\darg{\string\ecQUESTION}\darg{\string\textbf\darg{QUESTION}}}%
+\begin{dCmd}[commandchars=!()]{\bxSize}
+\renewcommand{\ecQUESTION}{\textbf{QUESTION}}
+!1\ecAfterQuesSkip{!ameta(skip)}
+!2\ecQuesWidth{!ameta(length)}
+\end{dCmd}
+\eVerb The \cs{ecQUESTION} command defines the title for the question page;
+the default definition is given. Beneath \cs{ecQUESTION} is a vertical space
+of \ameta{skip} determined by the argument of \cs{ecAfterQuesSkip}, its
+default is given in parenthesis. The content of the question page is
+contained in a minipage of width \ameta{length} determined by the argument of
+\cs{ecQuesWidth}, its default value is given in parenthesis.
+
+\subsubsection{The hint page}
+
+In addition to \cs{hintColor}, described briefly in \Nameref{ss:origCus}, the following are also defined
+on the hint page.
+\bVerb\takeMeasure{\string\ecAfterHintSkip\darg{\ameta{skip}}}%
+\edef\x{\the\wd\webtempboxi}%
+\def\1{\hbox to0pt{\hskip\x\relax\quad\normalfont(\texttt{.25in})\hss}}%
+\def\2{\hbox to0pt{\hskip\x\relax\quad\normalfont(\texttt{.85\string\linewidth})\hss}}%
+\takeMeasure{\string\ecAfterHintSkip\darg{\ameta{skip}}\quad\normalfont(\texttt{.85\string\linewidth})}%
+\begin{dCmd}[commandchars=!()]{\bxSize}
+\renewcommand{\ecHINT}{\textbf{HINT}}
+!1\ecAfterHintSkip{!ameta(skip)}
+!2\ecHintWidth{!ameta(length)}
+\end{dCmd}
+\eVerb The \cs{ecHINT} command defines the title for the hint page;
+the default definition is given. Beneath \cs{ecHINT} is a vertical space
+of \ameta{skip} determined by the argument of \cs{ecAfterHintSkip}, its
+default is given in parenthesis. The content of the question page is
+contained in a minipage of width \ameta{length} determined by the argument of
+\cs{ecHintWidth}, its default value is given in parenthesis.
+
+
+
+When there is no hint provided, the content of the \env{hint} environment is
+not displayed, in its place the command \cs{noHintProvided} is expanded. The
+default definition of which is given below.\phantomsection\label{noHintProvided}
+\bVerb\takeMeasure{\string\renewcommand\darg{\string\noHintProvided}\darg{No hint provided for this question.}}%
+\begin{dCmd}[commandchars=!()]{\bxSize}
+\renewcommand{\noHintProvided}{No hint provided for this question.}
+\end{dCmd}
+\eVerb The command may be redefined as desired in the preamble.
+
+\subsubsection{The answer page}
+
+In addition to \cs{solnColor}, described briefly in \Nameref{ss:origCus}, the following are also defined
+on the answer page.
+\bVerb\takeMeasure{\string\ecAfterAnsSkip\darg{\ameta{skip}}}%
+\edef\x{\the\wd\webtempboxi}%
+\def\1{\hbox to0pt{\hskip\x\relax\quad\normalfont(\texttt{.25in})\hss}}%
+\def\2{\hbox to0pt{\hskip\x\relax\quad\normalfont(\texttt{.85\string\linewidth})\hss}}%
+\takeMeasure{\string\ecAfterAnsSkip\darg{\ameta{skip}}\quad\normalfont(\texttt{.85\string\linewidth})}%
+\begin{dCmd}[commandchars=!()]{\bxSize}
+\renewcommand{\ecANS}{\textbf{ANSWER}}
+!1\ecAfterAnsSkip{!ameta(skip)}
+!2\ecAnsWidth{!ameta(length)}
+\end{dCmd}
+\eVerb The \cs{ecANS} command defines the title for the answer page;
+the default definition is given. Beneath \cs{ecANS} is a vertical space
+of \ameta{skip} determined by the argument of \cs{ecAfterAnsSkip}, its
+default is given in parenthesis. The content of the answer page is
+contained in a minipage of width \ameta{length} determined by the argument of
+\cs{ecAnsWidth}, its default value is given in parenthesis.
+
+\subsubsection{The navigation icons}
+
+The navigation icons have labels on them, which may be redefined for language
+localization. The labels are defined through the arguments of the commands
+below. The arguments given are the default (English) declarations.
+
+\bVerb\takeMeasure{\string\ecHintSolnLabel\darg{Soln} \string\ecRandomLabel\darg{Random}}%
+\begin{dCmd}[commandchars=!()]{\bxSize}
+\ecSolnLabel{Soln} \ecBeginLabel{Begin}
+\ecHintLabel{Hint} \ecHomeLabel{Home}
+\ecNextLabel{Next} \ecFinHomeLabel{Home}
+\ecPrevLabel{Prev} \ecFSLabel{FS}
+\ecHintNextLabel{Next} \ecCloseLabel{Close}
+\ecHintSolnLabel{Soln} \ecRandomLabel{Random}
+\end{dCmd}
+\eVerb The meaning of these commands, it is hoped, is self-evident.
+
+The size of the icons are determined by four commands.
+\bVerb\takeMeasure{\string\renewcommand\string\iconWidthPanel\darg{28pt}}%
+\begin{dCmd}[commandchars=!()]{\bxSize}
+\renewcommand\iconWidth{40pt}
+\renewcommand\iconHeight{15pt}
+\renewcommand\iconWidthPanel{28pt}
+\renewcommand\panelGrpWidth{57pt}
+\end{dCmd}
+\bVerb \cs{iconWidth} and \cs{iconHeight} set the dimensions of the
+navigation icons when a panel option is not taken; \cs{iconWidthPanel} and
+\cs{iconHeight} are the dimensions of the icons when they appear in the panel.
+The \cs{panelGrpWidth} is the overall width of the group of icons in the
+panel.
+
+\subsubsection{The \texttt{listing} option}
+
+There are some minor formatting commands that take effect when the
+\opt{listing} option is used.
+\bVerb\takeMeasure{\string\renewcommand\darg{\string\leadAnsFmtForPaper}\darg{\string\textbf\darg{Ans:\string\thinspace[}}}%
+\begin{dCmd}[commandchars=!()]{\bxSize}
+\renewcommand{\leadAnsFmtForPaper}{\textbf{Ans:\thinspace[}}
+\renewcommand{\trailAnsFmtForPaper}{\textbf{]}}
+\end{dCmd}
+\bVerb The effects of this formatting is seen in
+\hyperref[fig:ecards-listing]{Figure~\ref*{fig:ecards-listing}}; look for the bold
+\texttt{Ans:} in question~4. To remove this formatting, simply redefine the
+two commands
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\renewcommand{\leadAnsFmtForPaper}{}
+\renewcommand{\trailAnsFmtForPaper}{}
+\end{Verbatim}
+No formatting was the standard for \app{eCards} prior to version~2.0.
+
+\subsubsection{Alert messages}
+
+Several alert boxes appear in response to pressing buttons or links, we list
+some of the more important ones. All redefinitions must occur in the preamble
+of the document.
+\bVerb\takeMeasure{\string\renewcommand\string\eqsqrtmsg\darg{"Right!"}}%
+\begin{dCmd}[commandchars=*()]{\bxSize}
+\renewcommand\eqsqrtmsg{"Right!"}
+\renewcommand\eqsqwgmsg{"Wrong!"}
+\end{dCmd}
+\bVerb The above two definitions are from \pkg{exerquiz}, they are the message that appears (in an alert box)
+to indicate to the user that his/her response is correct or wrong.
+
+\bVerb\takeMeasure{\string\renewcommand\darg{\string\nonrandomizedMsg}\darg{The cards will be delivered}}%
+\begin{dCmd}[commandchars=!()]{\bxSize}
+\cardsFinishedMsg{You've seen all the cards!}
+\renewcommand{\pressBeginMsg}{Press the \"Begin\" button to
+ begin viewing the cards.}
+\renewcommand{\randomizedMsg}{The cards will be delivered
+ to you in random order.}
+\renewcommand{\nonrandomizedMsg}{The cards will be delivered
+ to you in their natural order.}
+\end{dCmd}
+\bVerb The first message appears when the user has gone through all the
+cards. The second message appears when the user does not press the
+``\textsf{Begin}'' button. The third and fourth inform the user the state of
+the delivery of the cards; one of these messages appear when the state of the
+``\textsf{Random}'' checkbox is changed.
+
+\subsubsection{Miscellaneous customizations}
+
+The ``\textsf{Random}'' checkbox has a tooltip message that can be
+customized. Below is the default message.
+\bVerb\takeMeasure{\string\renewcommand\darg{\string\toggleRandomizeTU}\{Click to toggle between}%
+\begin{dCmd}[commandchars=!()]{\bxSize}
+\renewcommand{\toggleRandomizeTU}{Click to toggle between
+ random and natural order.}
+\end{dCmd}
+\bVerb
+
+\subsubsection{\texorpdfstring{\protect\pkg{web}}{web} customizations}
+
+The \pkg{web} package has may commands for modifying the look of the PDF page. The author is
+referred to the {\AEB} manual for details.
+
+%\revisionLabel and \versionLabel
+
+
+\bigskip\noindent
+Go to it, and be creative and enjoy! Now, back to my retirement. \dps
+
+\end{document}
+
+\bVerb\takeMeasure{\string\begin\darg{card}[hint|nohint]}%
+\begin{dCmd}[commandchars=!()]{\bxSize}
+\begin{card}[hint|nohint]
+ !ameta(a question)
+ \begin{response}
+ \begin{hint}
+ !ameta(a hint)
+ \end{hint}
+ \begin{answer}
+ !ameta(an answer)
+ \end{answer}
+ \end{response}
+\end{card}
+\end{dCmd}
+\eVerb
diff --git a/texmf-dist/source/latex/ecards/ecard.cus b/texmf-dist/source/latex/ecards/ecard.cus
new file mode 100644
index 00000000..07ae32b6
--- /dev/null
+++ b/texmf-dist/source/latex/ecards/ecard.cus
@@ -0,0 +1,9 @@
+% Customize to your heart's content in this file.
+% Here is a simple example. When the listing option is taken change "Hint" to
+% "Try This!".
+\ifecListing
+\renewcommand{\listing@headHint}
+{%
+ \par\textit{Try this}!\space\ignorespaces
+}
+\fi
diff --git a/texmf-dist/source/latex/ecards/ecards.dtx b/texmf-dist/source/latex/ecards/ecards.dtx
new file mode 100644
index 00000000..7eda9651
--- /dev/null
+++ b/texmf-dist/source/latex/ecards/ecards.dtx
@@ -0,0 +1,1331 @@
+%\iffalse
+%<*copyright>
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% ecards.sty package, %%
+%% Copyright (C) 1999-2016 D. P. Story %%
+%% dpstory@uakron.edu %%
+%% %%
+%% This program can redistributed and/or modified under %%
+%% the terms of the LaTeX Project Public License %%
+%% Distributed from CTAN archives in directory %%
+%% macros/latex/base/lppl.txt; either version 1 of the %%
+%% License, or (at your option) any later version. %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%</copyright>
+%<package>\NeedsTeXFormat{LaTeX2e}[1997/12/01]
+%<package>\ProvidesPackage{ecards}
+%<package> [2016/09/03 v2.0e eCards: An electronic flash cards package (dps)]
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage[colorlinks,hyperindex=false]{hyperref}
+%\pdfstringdefDisableCommands{\let\\\textbackslash}
+\OnlyDescription % comment out for implementation details
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\InputIfFileExists{aebdocfmt.def}{\PackageInfo{ecards}{Inputting aebdocfmt.def}}
+ {\def\IndexOpt{\DescribeMacro}\def\IndexKey{\DescribeMacro}\let\setupFullwidth\relax
+ \PackageInfo{ecards}{aebdocfmt.def cannot be found}}
+\let\pkg\textsf
+\let\env\texttt
+\begin{document}
+ \GetFileInfo{ecards.sty}
+ \title{eCards: Electronic Flash Cards}
+ \author{D. P. Story\\
+ Email: \texttt{dpstory@uakron.edu}}
+ \date{processed \today}
+ \maketitle
+ \tableofcontents
+ \let\Email\texttt
+ \DocInput{ecards.dtx}
+\IfFileExists{\jobname.ind}{\newpage\setupFullwidth\par\PrintIndex}{\paragraph*{Index} The index goes here.\\Execute
+ \texttt{makeindex -s gind.ist -o ecards.ind ecards.idx} on the command line and recompile
+ \texttt{ecards.dtx}.}
+\IfFileExists{\jobname.gls}{\PrintChanges}{\paragraph*{Change History} The list of changes goes here.\\Execute
+ \texttt{makeindex -s gglo.ist -o ecards.gls ecards.glo} on the command line and recompile
+ \texttt{ecards.dtx}.}
+\end{document}
+%</driver>
+% \fi
+% \MakeShortVerb{|}
+% \InputIfFileExists{aebdonotindex.def}{\PackageInfo{web}{Inputting aebdonotindex.def}}
+% {\PackageInfo{web}{cannot find aebdonotindex.def}}
+% \DoNotIndex{\kern}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \changes{v2.0e}{2016/09/03}{Improved documentation in \string\texttt{ecardsman.pdf}}
+%
+% \section{Introduction}
+%
+% The initial version of this package was developed at the request of
+% my colleague, Dr.\ Thomas Price, for use in the senior honors
+% project of Ms.\ Katie Jones on
+% \href{http://www.math.uakron.edu/~teprice/Trig/}{Trig Flash Cards}.
+% Upon completion of the honors project, I generalized and extended
+% the original package developed specifically for them.
+%
+% \section{Documentation}
+%
+% In this section, the major elements of this package are highlighted. For those
+% who want to know more, you can peruse the {\LaTeX} code, there are comments
+% contained there as well.
+%
+% \subsection{Preamble: Required Packages and Options}
+%
+% \subsubsection{Required Packages}
+%
+% This package depends heavily on the
+% \textbf{\href{http://www.math.uakron.edu/~dpstory/webeq.html}
+% {Acro\negthinspace\TeX{} eDucation Bundle}}: (1) the \textsf{web}
+% package provides page setup, backgrounds, and navigation
+% elements; (2) the \textsf{exerquiz} package allows you to author
+% the questions, both non-responsive and responsive (fill-in and
+% multiple choice); and (3) the \textsf{insdljs} packages is the
+% mechanism for introducing document-level JavaScripts into the
+% final document.
+%
+% Each of the packages listed above have their own required packages:
+% \textsf{hyperref}, \textsf{color}, \textsf{verbatim}, \textsf{everyshi}
+% and \textsf{eso-pic}. Theses are all available as part of the standard
+% distribution of {\LaTeX} or through any CTAN site.
+%
+% \subsubsection{Options}
+%
+% \paragraph{eCards options.}\hskip-\lastskip\
+% The \textsf{eCards} package really has only 4 options:
+% \begin{enumerate}
+% \item \texttt{nohints}: If you do not want to provide hints in your eCards,
+% use this option. See also the comments in \Nameref{hint}.
+% \item \texttt{listing}:\label{listing} This option gives you a printable version of your
+% eCards. In this way, you can proofread, check your questions, hints,
+% and answers. Suggested packages and options are given below:
+%\begin{verbatim}
+%\usepackage[<driver_option>,forpaper,tight,nodirectory]{web}
+%\usepackage[solutionsafter,proofing,preview]{exerquiz}
+%\usepackage[listing]{eCards}
+%\end{verbatim}
+% \item \texttt{memLogo}: The logo, if any, is read and re-read
+% for each page on which it appears. Using this option, the logo
+% is read once and saved in a box for use.
+% \item \texttt{custom}: If this option is chosen, the package
+% will look for and input a file \texttt{ecard.cus}. This file can
+% be used to customize the environments. This file should be kept
+% in the source directory, not in the {\LaTeX} search path.
+% \end{enumerate}
+%
+% \paragraph{Other options.}\hskip-\lastskip\
+% Selecting the various options of the \textsf{web} and
+% \textsf{exerquiz} packages can give you different looks. It is
+% important to be aware of all the options associated with these
+% two package; in the paragraphs below, various options are
+% discussed that may be useful in \textsf{eCards}.
+%
+%\paragraph{Useful Web Package Options.}\hskip-\lastskip\
+% There are three background/panel options: \texttt{usetemplates},
+% \texttt{rightpanel} and \texttt{leftpanel}. Using the
+% \texttt{usetemplates} option does not give you the vertical
+% navigation strip, but it does give you the background colors;
+% the \texttt{rightpanel} and \texttt{leftpanel} given you a
+% vertical panel on the right and left, respectively. Use one of
+% these three options only, if any at all. Using none of these three
+% will just get you the default white background.
+%
+%There are certain ``standard'' page designs, or you can create your own using
+%the \cs{margins} and \cs{screensize}; the demo document has
+%\begin{verbatim}
+%\margins{.25in}{.25in}{24pt}{.25in} % left,right,top, bottom
+%\screensize{3.72in}{366.24bp} % height, width
+%\end{verbatim}
+% See the \textsf{Web} package documentation for details on these and other
+% options.
+%
+% \paragraph{Useful Exerquiz Package Options.}\hskip-\lastskip\
+% If you are not using multiple choice or fill-in questions, you should use
+% the \texttt{exercisesonly} option. This removes much of the document level JavaScript
+% from the PDF document.
+%
+% For authors that use the full Acrobat~5.0, or the newer Acrobat
+% 6.0 Standard or Acrobat 6.0 Professional, you can use the
+% \texttt{execJS} option. If this option is taken, then when the
+% document is first loaded into Acrobat (following distillation, or
+% creation using \textsf{dvipdfm} or \textsf{pdftex}), the document
+% will be automatically saved; this saves any imported document
+% level JavaScript in the document. The document always needs to be saved
+% after creation so save the scripts with the document, this does it automatically
+% so you can't forget to do it---as one of my colleagues once did.
+%
+% The \texttt{nosolutions} option removes the \texttt{response} environment
+% leaving only the questions. The \texttt{proofing} and \texttt{preview} options
+% can be useful for proofreading, as described in the \texttt{\hyperref[listing]{listing}}
+% option described above.
+%
+% \subsection{\texorpdfstring{\protect\cs{begin\{document\}}}{\textbackslash begin\{document\}}: Start creating Cards}
+%
+% The process of creating these electronic cards is quite simple, the sections below
+% describe the various environments used.
+%
+% \subsubsection{The \texttt{card} Environment}
+%
+% The main environment is the \texttt{card} environment, which is used for posing
+% questions, offering a hint, and an answer. The \hypertarget{cardsyntax}{syntax} is
+%\begin{verbatim}
+%\begin{card}
+% < a question >
+% \begin{response}
+% \begin{hint}
+% < a hint >
+% \end{hint}
+% \begin{answer}
+% < an answer >
+% \end{answer}
+% \end{response}
+%\end{card}
+%\end{verbatim}
+% \textcolor{red}{Important.} You can pose a question which requires
+% a verbal response, or one for which there is a choice of
+% alternatives, or a fill-in the blank (math or text). See the demo
+% file \texttt{ecardstst.tex} for examples.
+%
+% \subsubsection{The \texttt{response} Environment}
+%
+% Immediately following and nested within the \texttt{card} environment is the \texttt{response}
+% environment. This sets things up for the responses to the question: the hint
+% and the answer.
+%
+% \subsubsection{The \texttt{hint} Environment}\label{hint}
+%
+% The first environment to appear within the \texttt{response} is
+% the \texttt{hint} environment. Here you can provide additional
+% information to help the student answer the question successfully.
+% I've you've posed a multiple choice or fill-in question, you can simply
+% copy the multiple choice or fill-in into the hint, just as I have done
+% in the demo file \texttt{ecardstst.tex}.
+%
+% In this release, hints can be provided for \textbf{all} of the questions or for
+% \textbf{none} of the questions. You can enter hints using the
+% \texttt{hint} environment, illustrated \hyperlink{cardsyntax}{above}, or not include a
+% \texttt{hint} environment. When you do not want to include
+% hints---whether you've entered the environments or not---use the
+% \texttt{nohints} package option. This will convert the
+% \texttt{hint} environment into a \texttt{comments}, and redefined
+% some of the navigation buttons.
+%
+% \subsubsection{\texttt{answer} Environment}
+%
+% After the hint environment comes the answer environment where the answer to the original question
+% can be presented. At the end of this environment, you need to back out of your nest:
+% \verb+\end{answer}+, \verb+\end{response}+ and \verb+\end{card}+.
+%
+% \subsection{\texorpdfstring{\protect\cs{end\{document\}}}{\textbackslash end\{document\}}}
+%
+% \section{Main Code}
+%
+% \subsection{Declare Options}
+%
+% This package builds upon the \textbf{Acro\negthinspace\TeX{} eDucation Bundle}, the options of the
+% \textsf{web} and \textsf{exerquiz} packages can be used with with \textsf{eCards}. Additional options
+% are declared below.
+% The logo, if any, is read and re-read for each page on which it appears. Using the \texttt{memLogo}\IndexOpt{memLogo}
+% option, the logo is read once and saved in a box for use.
+% \begin{macrocode}
+\let\ec@YES=y \let\ec@NO=n
+\DeclareOption{memLogo}{\let\@memLogo\ec@YES}
+\let\@memLogo\ec@NO
+% \end{macrocode}
+% The \texttt{listing}\IndexOpt{listing} gives a listing of questions, hints, and answers. When used in conjunction
+% with various \textsf{exerquiz} options, this option can be used to review all cards and answers.
+% Suggested options:
+%\begin{verbatim}
+%\usepackage[<driver_option>,forpaper,tight]{web}
+%\usepackage[solutionsafter,proofing]{exerquiz}
+%\usepackage[memLogo,listing]{ecards}
+%\end{verbatim}
+% The boolean switch \cs{ecListing} can be used to get a better looking listing by removing
+% graphics---see the demo file \texttt{ecardstst.tex}.
+% \begin{macrocode}
+\DeclareOption{listing}{\ecListingtrue}
+\newif\ifecListing \ecListingfalse
+% \end{macrocode}
+% If \texttt{custom}\IndexOpt{custom} option is chosen, the package will look for and input a file \texttt{ecard.cus}.
+% This file can be used to customize the environments. This file should be kept in the
+% source directory, not in the {\LaTeX} search path.
+% \begin{macrocode}
+\DeclareOption{custom}{\let\@ecCustom\ec@YES}
+\let\@ecCustom\ec@NO
+% \end{macrocode}
+% In some applications, the author may not want to have hints provided, so, compile
+% the document with the \texttt{nohints}\IndexOpt{nohints} option.
+% \begin{macrocode}
+\DeclareOption{nohints}{\def\opts@ecNoHints{nohint}%
+\def\defaultecNoHints{\useNoHints}\defaultecNoHints}
+\newif\ifisQues \isQuesfalse
+% \end{macrocode}
+% \DescribeMacro{\useNoHints} is a user accessible command for changing the default setting of whether
+% to provide a hint or not. It must be expanded outside the \env{card} environment. The \cs{useNoHints}
+% command starts a new page unless the \texttt{listing} option has been taken. The \cs{newpage} enables
+% the navigation panel to get state of the hint correctly.
+% \begin{macrocode}
+\def\useNoHints{\ifecListing\else\newpage\fi\ecUseNoHints}
+% \end{macrocode}
+% \changes{v2.0a}{2016/07/23}{For the Hint page, changed the address to conform to what works
+% in the new exerquiz, \cs{hintDest} (\string\texttt{ex\cs{exnoCard}} rather than \string\texttt{ex.\cs{exnoCard}}),
+% same for \cs{solnDest}}
+% Changed the destinations for \cs{hintDest} and \cs{solnDest}.
+%
+% The \cs{ecUseNoHints} is an ``internal'' command used within the \env{card}
+% environment and in the solutions file; it is also the continuation of \cs{useNoHints}.
+% \changes{v2.0d}{2016/08/02}{Added \string\cs{ecUseNoHints} and \string\cs{ecUseHints}}
+% \begin{macrocode}
+\def\ecUseNoHints{\ifisQues
+ \expandafter\def\else\expandafter\gdef\fi\opts@ecNoHints{nohint}%
+ \global\let\@ecNoHints\ec@YES
+ \gdef\hintDest{ex\exnoCard}\gdef\solnDest{ex\exnoCard.s}%
+ \gdef\hintDestJS{ex.\exnoCard}\gdef\quesDestJS{ex.\exnoCard}%
+}
+% \end{macrocode}
+% \DescribeMacro{\useHints} is a user accessible command for changing the default setting of whether
+% to provide a hint or not. It must be expanded outside the \env{card} environment. The \cs{useHints}
+% command starts a new page unless the \texttt{listing} option has been taken. The \cs{newpage} enables
+% the navigation panel to get state of the hint correctly.
+% \begin{macrocode}
+\def\useHints{\ifecListing\else\newpage\fi\ecUseHints}
+% \end{macrocode}
+% The \cs{ecUseHints} is an ``internal'' command used within the \env{card}
+% environment and in the solutions file; it is also the continuation of \cs{useHints}.
+% \begin{macrocode}
+\def\ecUseHints{\ifisQues
+ \expandafter\def\else\expandafter\gdef\fi\opts@ecNoHints{hint}%
+ \global\let\@ecNoHints\ec@NO
+ \gdef\hintDest{ex\exnoCard}\gdef\solnDest{ex\exnoCard.s}%
+ \gdef\hintDestJS{ex.\exnoCard}\gdef\quesDestJS{qex.\exnoCard}%
+}
+\def\opts@ecNoHints{hint}
+\def\defaultecNoHints{\useHints}
+\defaultecNoHints
+% \end{macrocode}
+% To present the cards are presented to the user in their natural order, rather
+% than in a randomized order, use the \texttt{notrandomized}\IndexOpt{notrandomized} option.
+% \begin{macrocode}
+\DeclareOption{notrandomized}{\def\israndomized{false}
+ \def\cbInitState{Off}}
+\def\israndomized{true}
+\def\cbInitState{randomOrder}
+% \end{macrocode}
+% \subsection{ProcessOptions and Required Packages}
+% \begin{macrocode}
+\ProcessOptions
+\RequirePackage{web}
+\RequirePackage{exerquiz}[2016/04/18]
+% \end{macrocode}
+% \subsection{String Data}
+% \begin{macro}{\cardsFinishedMsg}
+% When user finishes the cards, a message appears announcing that event. The
+% \cs{cardsFinishedMsg} holds the content of that message.
+% \begin{macrocode}
+\newcommand{\cardsFinishedMsg}[1]{\def\CARDSFINISHED{#1}}
+\cardsFinishedMsg{You've seen all the cards!}
+% \end{macrocode}
+% \end{macro}
+% \subsection{Colors for Backgrounds}
+% Some definitions for coloring the background page for the question page, the
+% hint page and the answer page.
+% \begin{macrocode}
+\textBgColor{cornsilk}
+\def\cardColor#1{\def\@cardColor{#1}}
+\def\hintColor#1{\def\@hintColor{#1}}
+\def\solnColor#1{\def\@solnColor{#1}}
+% \end{macrocode}
+% Default colors
+% \begin{macrocode}
+\cardColor{vlightblue}
+\hintColor{cornsilk}
+\solnColor{webyellow}
+% \end{macrocode}
+% \subsection{Modifying Exerquiz Environments}
+% \begin{macrocode}
+% \let\web@copyright\@gobble
+\let\exnoCard\the@exno
+\let\web@rightheader\@empty
+\def\io#1{\immediate\write\@auxout{#1}}
+% \end{macrocode}
+% \subsubsection{Modify the \texttt{exercise} Environment}
+% The \cs{endsolnexerhookaux} macro gets executed just prior to the end of the
+% solution environment, but before the final trailer is written to the .sol file. Here,
+% we use it to insert a navigation bar at the bottom of the solution page.
+% \begin{macrocode}
+\def\endsolnexerhookaux{%
+ \ifnum\@panelconfig=0\relax
+ \immediate\write\verbatim@out
+ {\string\insNaviBar*{\hfil\string\NextCard\string\ %
+ \string\PrevCard\string\ \string\ToggleOrder\hfil}}%
+ \fi
+}
+\def\include@solutions{%
+ \let\webnewpage\relax
+ \immediate\closeout\ex@solns
+ \ifeq@nosolutions\else
+ \iftherearesolutions\newpage\markright{\exsecrunhead}%
+ \ifx\webnewpage\relax
+ \def\webnewpage{\let\webnewpage\newpage}%
+ \fi
+ \eqsolutionshook
+ \addcontentsline{toc}{section}
+ {\protect\numberline{}\exsectitle}%
+ \input{\jobname.sol}%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% Write the total number of questions (cards) to the aux file.
+% \begin{macrocode}
+\AtEndDocument{\io{\string\gdef\string\totalCards{\exnoCard}}\clearpage}
+% \end{macrocode}
+% This macro holds the number of cards composed.
+% \begin{macrocode}
+\def\theNumCards{\csname totalCards\endcsname}
+% \end{macrocode}
+% \cs{nMarker} identifies the type of page, 0 for a question, 1 for a hint, 2 for a solution
+% \begin{macrocode}
+\let\ec@Zero=0 \let\ec@One=1 \let\ec@Two=2
+\def\ec@Ques{0}\def\ec@Hint{1}\def\ec@Soln{2}
+\def\nMarkerSet#1{\gdef\nMarker{#1}}
+\nMarkerSet\ec@Ques
+% \end{macrocode}
+% Redefine \cs{ReturnTo} so there is no link, we encourage the user to use the navigation
+% buttons.
+% \begin{macrocode}
+\def\ReturnTo#1#2{\eq@fititin#2}
+% \end{macrocode}
+% Miscellaneous macro definitions associated with the \textsf{exercise} environment.
+% \begin{macrocode}
+\renewcommand\exsecrunhead{}
+\renewcommand\exlabel{}
+\renewcommand\exsectitle{}
+% \end{macrocode}
+%\changes{v2.0a}{2016/07/23}{Added modified formatting for the \string\texttt{proofing} option
+% of \string\textsf{exerquiz}}
+% Modified formatting for the \texttt{proofing} option of \textsf{exerquiz}. Added two new commands
+% \DescribeMacro{\leadAnsFmtForPaper}\cs{leadAnsFmtForPaper}
+% and \DescribeMacro\trailAnsFmtForPaper\cs{trailAnsFmtForPaper}.
+% \changes{v2.0c}{2016/07/29}{Added forpaper formatting}
+% \begin{macrocode}
+\newcommand{\leadAnsFmtForPaper}{\textbf{Ans:\thinspace[}}
+\newcommand{\trailAnsFmtForPaper}{\textbf{]}}
+\def\math@correctAnswer{\unskip\ifeqforpaper\leadAnsFmtForPaper\fi
+ {\ttfamily\color{\@proofingsymbolColor}\spaceskip=2pt\xspaceskip=2pt
+ \expandafter\gobbleMacro\meaning\eqCorrectAns}%
+ \ifeqforpaper\trailAnsFmtForPaper\fi
+}
+\def\txt@correctAnswer{\unskip\ifeqforpaper\textbf{Ans:\thinspace[}\fi
+ {\ttfamily\color{\@proofingsymbolColor}%
+ \spaceskip=2pt\xspaceskip=2pt
+ \expandafter\gobbleTxt\meaning\rbTxtAlt}\ifeqforpaper\textbf{]}\fi
+}
+% \end{macrocode}
+%
+% \subsubsection{The \texttt{multiChoice} Environment}
+%
+% The \texttt{multiChoice} environment is an \texttt{answer} environment (of \textsf{exerquiz} placed within
+% an \texttt{oQuestion} environment (\textsf{exerquiz}).
+%
+% \begin{environment}{multiChoice}
+% An environment for posing a multiple choice question, based on the \texttt{shortquiz} environment
+% of \textsf{exerquiz}.
+% \begin{macrocode}
+\newenvironment{multiChoice}[1]{\par
+ \if\nMarker\ec@Ques
+ \def\sqWrongRespJS{app.alert(\eqsqwgmsg,3);
+ this.gotoNamedDest("\hintDestJS");}%
+ \fi
+% \end{macrocode}
+% \changes{v2.0}{2016/07/20}{\string\cs{sq@IDTxtField} in the new \string\textsf{exerquiz} is enclosed in an \string\cs{makebox},
+% text normally follows it, but here is does not, so we'll have to compensate.}
+% \changes{v2.0}{2016/07/20}{Remove \string\texttt{shortquiz} environment, replace with \string\texttt{oQuestion}}
+% \cs{sq@IDTxtField} in the new \textsf{exerquiz} is enclosed in an \cs{makebox},
+% text normally follows it, but here is does not, so we'll have to compensate.
+% \begin{macrocode}
+ \vskip-\baselineskip % dps
+ \begin{oQuestion}{\if\nMarker\ec@Ques\hintDest
+ \ifisHint.h\fi\else\solnDest\fi}%
+ \begin{answers}[\solnDest]{#1}%
+}{%
+ \end{answers}
+ \end{oQuestion}
+}
+% \end{macrocode}
+% \end{environment}
+%
+% \subsubsection{The \texttt{fillIn} Environment}
+%
+% The \texttt{fillIn} environment is modified \texttt{oQuestion} environment (\textsf{exerquiz}),
+% within which the commands \cs{RespBoxMath} and \cs{RespBoxTxt} (\textsf{exerquiz}) are defined.
+%
+% Set the appearance of any text fields that the author might use.
+% \begin{macrocode}
+\ifecListing
+ \ifeq@proofing
+ \everyRespBoxTxt{\Ff\FfReadOnly\BG{}\BC{}}
+ \everyRespBoxMath{\Ff\FfReadOnly\BG{}\BC{}}\else
+ \everyRespBoxTxt{\BG{1 1 1}}\everyRespBoxMath{\BG{1 1 1}}\fi
+\else
+ \everyRespBoxTxt{\BG{1 1 1}}\everyRespBoxMath{\BG{1 1 1}}
+\fi
+% \end{macrocode}
+% \begin{environment}{fillIn}
+% The \texttt{fillIn} environment one to pose a fill in type question, either
+% text or math. Based on the \texttt{oQuestion} environment of \textsf{exerquiz}.
+% \begin{macrocode}
+\newenvironment{fillIn}{%
+ \def\RespBoxTxtOnBlur{ecOnBlurRespBox(retn, \exnoCard, \nMarker);}%
+ \begin{oQuestion}{\if\nMarker\ec@Ques\hintDest\else\solnDest\fi}%
+}{\end{oQuestion}}
+% \end{macrocode}
+% \end{environment}
+%
+% \subsection{New Environments}
+% \subsubsection{The \texttt{card} Environment}
+% \begin{environment}{card}
+% This is the main environment for writing questions, hints and answers. This environment
+% encloses all. It is based on the \texttt{exercise} environment of \textsf{exerquiz}.
+% \begin{macrocode}
+\def\ec@isHint{hint}
+\def\ec@isNoHint{nohint}
+\def\ec@HintsWarning{\PackageWarning{ecards}
+ {The use of \string\useHints\space and \string\useNoHints
+ \MessageBreak is prohibited, ignoring this use}}
+\def\ec@BadArgWarning{\PackageWarning{ecards}
+ {The argument `\ec@rgi' is not an acceptable option.\MessageBreak
+ Will use `hint' instead}}
+\def\ecInfoToSolns{\string\def\string\exnoCard{\exnoCard}%
+ \string\def\string\solndest{\solnDest}%
+ \expandafter\string\ec@thisHintOpt
+ \string\nMarkerSet{\ec@Hint}\string\defineSoln}
+\newenvironment{card}[1][\opts@ecNoHints]{\newpage\isQuestrue
+% \end{macrocode}
+% We redefine \cs{useHints} and \cs{useNoHints} to a warning message within the \env{card}
+% environment.
+% \begin{macrocode}
+ \let\useHints\ec@HintsWarning\let\useNoHints\ec@HintsWarning
+ \edef\ec@rgi{#1}\ifx\ec@rgi\ec@isHint
+ \def\ec@thisHintOpt{\ecUseHints}\else
+ \ifx\ec@rgi\ec@isNoHint
+ \def\ec@thisHintOpt{\ecUseNoHints}\else
+% \end{macrocode}
+% The user did not pass a recognized option (neither \texttt{hint} nor \texttt{nohint}),
+% use \texttt{hint} instead and send a warning to the log.
+% \begin{macrocode}
+ \def\ec@thisHintOpt{\ecUseHints}%
+ \ec@BadArgWarning
+ \fi
+ \fi
+ \xdef\ecLoc@lSt@te{\ec@rgi}%
+ \ec@thisHintOpt\nMarkerSet\ec@Ques
+ \def\eqexheader{\noindent}%
+ \renewcommand\exsllabelformat{\protect\noindent}%
+ \renewcommand\exrtnlabelformat{}%
+ \renewcommand\exsecrunhead{}%
+ \let\afterlabelhskip\@empty
+ \def\exersolnheadhook{\ecInfoToSolns}%
+ \begin{exercise}
+ \textBgColor{\@cardColor}%
+ \headCard
+}{%
+ \tailCard
+ \end{exercise}%
+ \ifnum\@panelconfig=0\relax\aftergroup\cardNaviBar\fi
+}
+% \end{macrocode}
+% \end{environment}
+% \DescribeMacro\headCard\cs{headCard} determines the design of the question page. Can re-design.
+% \changes{v2.0c}{2016/07/29}{Added after skips and widths for questions page}
+% Use \DescribeMacro\ecAfterQuesSkip\cs{ecAfterQuesSkip} to change the vertical distance after \textbf{QUESTIONS}
+% and the content below. Use \DescribeMacro\ecQuesWidth\cs{ecQuesWidth} to set the width of
+% the minipage on the question page.
+% \begin{macrocode}
+\def\ecAfterQuesSkip#1{{\setlength{\@tempdima}{#1}%
+ \xdef\ec@fterQuesSkip{\the\@tempdima}}}
+\ecAfterQuesSkip{.25in}
+\def\ecQuesWidth#1{\def\ec@QuesWidth{#1}}
+\ecQuesWidth{.85\linewidth}
+\def\ecSetQuesWidth{\setlength{\@tempdima}{\ec@QuesWidth}%
+ \edef\ec@QuesWidth{\the\@tempdima}}
+% \end{macrocode}
+% Use the \DescribeMacro{\ecQUESTION} command to format the question page.
+% \changes{v2.0c}{2016/07/29}{Added \string\cs{ecQUESTION}}
+% \begin{macrocode}
+\newcommand{\ecQUESTION}{\textbf{QUESTION}}
+\newcommand{\headCard}{%
+ \vspace*{\stretch{.1}}%
+ \begin{center}\ecSetQuesWidth
+ \Large\ecQUESTION\par\vspace*{\ec@fterQuesSkip}%
+ \begin{minipage}{\ec@QuesWidth}%
+ \large\noindent\ignorespaces
+}
+% \end{macrocode}
+% \begin{macro}{\tailCard}
+% Complete any environments begun by \cs{headCard}
+% \begin{macrocode}
+\newcommand{\tailCard}{%
+ \end{minipage}
+ \end{center}
+ \par\vspace{\stretch{2}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{The \texttt{response} Environment}
+% \begin{environment}{response}
+% Nested within the \texttt{card} environment is the
+% \texttt{response} environment, which, in turn, contains the
+% \texttt{hint} and \texttt{answer} environments. This basically
+% the \texttt{solution} environment for an \texttt{exercise} of
+% \textsf{exerquiz}.
+% \begin{macrocode}
+\newenvironment{response}{\solnexer@woparts[]} %dps
+ {\endsolnexer@woparts}
+% \end{macrocode}
+% \end{environment}
+% \begin{environment}{hint}
+% Place this environment within the \texttt{response}
+% environment and \textit{before} the \texttt{answer} environment.
+% \begin{macrocode}
+\newif\ifisHint \isHintfalse
+\newenvironment{hint}{%
+ \isHinttrue
+ \if\@ecNoHints\ec@YES\textBgColor{\@hintColor}\headHint
+ \centering\noHintProvided\tailHint\expandafter\ec@comment@hint
+ \else\expandafter\ec@hint\fi}{%
+ \if\@ecNoHints\ec@YES\expandafter\endec@comment@hint
+ \else\expandafter\endec@hint\fi}
+% \end{macrocode}
+% \begin{macro}{\noHintProvided}
+% A short typeset message that appears on hint pages when there is no hint
+% available.
+% \begin{macrocode}
+\newcommand{\noHintProvided}{No hint provided for this question.}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\newenvironment{ec@comment@hint}{\comment}{%
+ \endcomment
+ \ifnum\@panelconfig=0\relax
+ \insNaviBar{\hfill\hintSoln\ \hintNextCard\ %
+ \PrevCard\ \ToggleOrder\hfill}\fi
+ \newpage\nMarkerSet{\ec@Soln}\noindent\hypertarget{\solndest}{}%
+}
+\newenvironment{ec@hint}{%
+ \textBgColor{\@hintColor}%
+ \headHint
+}{%
+ \tailHint
+ \ifnum\@panelconfig=0\relax
+ \insNaviBar{\hfill\hintSoln\ \hintNextCard\ %
+ \PrevCard\ \ToggleOrder\hfill}\fi
+ \newpage\nMarkerSet{\ec@Soln}\noindent\hypertarget{\solndest}{}%
+}
+% \end{macrocode}
+% \end{environment}
+% Use \DescribeMacro\headHint\cs{headHint} to design he hint page. \DescribeMacro{\ecAfterHintSkip}\cs{ecAfterHintSkip}
+% sets the vertical skip following the header (HINT). \DescribeMacro\ecHintWidth\cs{ecHintWidth} sets the width
+% of the minipage on the HINT page.
+% \changes{v2.0c}{2016/07/29}{Added after skips and widths for hints page}
+% \begin{macrocode}
+\def\ecAfterHintSkip#1{{\setlength{\@tempdima}{#1}%
+ \xdef\ec@fterHintSkip{\the\@tempdima}}}
+\ecAfterHintSkip{.25in}
+\def\ecHintWidth#1{\def\ec@HintWidth{#1}}
+\ecHintWidth{.85\linewidth}
+\def\ecSetHintWidth{\setlength{\@tempdima}{\ec@HintWidth}%
+ \edef\ec@HintWidth{\the\@tempdima}}
+% \end{macrocode}
+% Use the \DescribeMacro{\ecHINT}\cs{ecHint} command to format the hint page.
+% \changes{v2.0c}{2016/07/29}{Added \string\cs{ecHINT}}
+% \begin{macrocode}
+\newcommand{\ecHINT}{\textbf{HINT}}
+\newcommand{\headHint}{%
+ \vspace*{\stretch{.1}}%
+ \begin{center}\ecSetHintWidth
+ \Large\ecHINT\par\vspace*{\ec@fterHintSkip}%
+ \begin{minipage}{\ec@HintWidth}%
+ \large\noindent\ignorespaces
+}
+% \end{macrocode}
+% \begin{macro}{\tailHint}
+% Close any environments begun in \cs{headHint}
+% \begin{macrocode}
+\newcommand{\tailHint}{%
+ \end{minipage}
+ \end{center}
+ \par\vspace{\stretch{2}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{The \texttt{answer} Environment}
+% \begin{environment}{answer}
+% The \texttt{answer} environment follows the \texttt{hint}, also listed within
+% the \texttt{response} environment.
+% \begin{macrocode}
+\newenvironment{answer}{%
+ \textBgColor{\@solnColor}%
+ \headAnswer
+}{\tailAnswer}
+% \end{macrocode}
+% \end{environment}
+% \DescribeMacro\headAnswer Use \cs{headAnswer} to design of the answer page. \DescribeMacro\ecAfterAnsSkip
+% \cs{ecAfterAnsSkip} sets the vertical skip following the header (ANSWER). \DescribeMacro\ecAnsWidth
+% sets the width of the minipage on the ANSWER page.
+% \changes{v2.0c}{2016/07/29}{Added after skips and widths for answers page}
+% \begin{macrocode}
+\def\ecAfterAnsSkip#1{{\setlength{\@tempdima}{#1}%
+ \xdef\ec@fterAnsSkip{\the\@tempdima}}}
+\ecAfterAnsSkip{.25in}
+\def\ecAnsWidth#1{\def\ec@AnsWidth{#1}}
+\ecAnsWidth{.85\linewidth}
+\def\ecSetAnsWidth{\setlength{\@tempdima}{\ec@AnsWidth}%
+ \edef\ec@AnsWidth{\the\@tempdima}}
+% \end{macrocode}
+% Use the \DescribeMacro{\ecANS} command to format the hint page.
+% \changes{v2.0c}{2016/07/29}{Added \string\cs{ecANS}}
+% \begin{macrocode}
+\newcommand{\ecANS}{\textbf{ANSWER}}
+\newcommand{\headAnswer}{%
+ \vspace*{\stretch{.1}}%
+ \begin{center}\ecSetAnsWidth
+ \Large\ecANS\par\vspace*{\ec@fterAnsSkip}%
+ \begin{minipage}[t]{\ec@AnsWidth}%
+ \large\noindent\ignorespaces}
+% \end{macrocode}
+% \begin{macro}{\tailAnswer}
+% Close any environments opened by \cs{headAnswer}
+% \begin{macrocode}
+\newcommand{\tailAnswer}{%
+ \end{minipage}
+ \end{center}
+ \vspace*{\stretch{2}}
+}
+% \end{macrocode}
+% \end{macro}
+% \subsection{Navigation Support}
+%
+% In this section we build navigation support. The \DescribeMacro\iconWidth\cs{iconWidth} and
+% \DescribeMacro\iconHeight\cs{iconHeight} are the width and height of the icons as they appear
+% on the bottom of the page. When using a panel option, the width vale is reset, see \cs{iconWidthPanel}
+% and \cs{panelGrpWidth}.
+% \begin{macrocode}
+\newcommand\iconWidth{40pt}\newcommand\iconHeight{15pt}
+% \end{macrocode}
+% \begin{macro}{\ecHomePage}
+% \begin{macro}{\ecLogo}
+% \begin{macro}{\ecLogoLink}
+% \cs{ecHomePage}, for the `Home' button, and \cs{ecLogo}, for the logo. The argument
+% for \cs{ecLogo} should be a LaTeX graphics command such as \cs{includegraphics}. See
+% the default for an example. With \cs{ecLogoLink}, you can optionally associate a link
+% with your logo.
+% \begin{macrocode}
+\def\ecHomePage{\hyper@normalise\ec@HomePage}
+\def\ec@HomePage#1{\def\@ecHomePage{#1}}
+\ecHomePage{http://www.math.uakron.edu/~dpstory/acrotex.html}
+\def\ecLogo#1{\def\@ecLogo{#1}}
+\ecLogo{\includegraphics[scale=.4]{graphics/uakron}}
+\def\ecLogoLink{\hyper@normalise\ec@LogoLink}
+\def\ec@LogoLink#1{\def\@ecLogoLink{#1}}
+\let\@ecLogoLink\@empty
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Toggle between Random and Nonrandom Delivery}
+%
+% \begin{macro}{\toggleRandomize}
+% \begin{macro}{\randomizedMsg}
+% \begin{macro}{\nonrandomizedMsg}
+% \begin{macro}{\toggleRandomizeTU}
+% We provide a push button for toggling between random mode and nonrandom mode.
+% The button resets the cards and alerts the user.
+% \begin{macrocode}
+\newcommand{\randomizedMsg}{The cards will be delivered
+ to you in random order.}
+\newcommand{\nonrandomizedMsg}{The cards will be delivered
+ to you in their natural order.}
+\newcommand{\toggleRandomizeTU}{%
+ Click to toggle between random and natural order.}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Define JS Actions for Icons}
+% Below are some JavaScript definitions that are used for navigation.
+% \begin{macrocode}
+\def\makeesc#1{\catcode`#1=0\relax}
+% \end{macrocode}
+% \DescribeMacro{\fsJS}\noindent
+% Action for the fullscreen button `FS'.
+% \begin{macrocode}
+\begin{defineJS}{\fsJS}
+if (app.viewerVersion < 5.0)
+ app.fullscreen = !app.fullscreen
+else {
+ app.fs.cursor = cursor.visible;
+ app.fs.defaultTransition = "";
+ app.fs.useTimer = false;
+ app.fs.isFullScreen = !app.fs.isFullScreen;
+}
+\end{defineJS}
+% \end{macrocode}
+% \subsubsection{Define Navigation Icons}
+% Some navigation icons, \cs{newNaviIcon} is defined in the \textsf{Web Package}.
+% \begin{macrocode}
+% if nohint option is used, this is the JS action when hint is clicked.
+\newcommand\noHintJSAction{}
+\def\NaviIconActionJS#1{\ifecListing
+ \if\nMarker\ec@Ques\else
+ this.gotoNamedDest("\quesDestJS");\fi
+ \else
+ #1;
+ \fi
+}
+% \end{macrocode}
+%\changes{v2.0c}{2016/07/29}{Added labels for navigation icons to make customization easier}
+% \begin{macro}{\ecSolnLabel}
+% \begin{macro}{\ecHintLabel}
+% \begin{macro}{\ecNextLabel}
+% \begin{macro}{\ecPrevLabel}
+% \begin{macro}{\ecHintNextLabel}
+% \begin{macro}{\ecHintSolnLabel}
+% \begin{macro}{\ecBeginLabel}
+% \begin{macro}{\ecHomeLabel}
+% \begin{macro}{\ecFinHomeLabel}
+% \begin{macro}{\ecFSLabel}
+% \begin{macro}{\ecCloseLabel}
+% \begin{macro}{\ecRandomLabel}
+% Define labels for navigation icons to make customization easier.
+% \begin{macrocode}
+\def\ec@defineLabel#1#2#3{\def#1{#2 #3}}
+\newcommand{\ecSolnLabel}[2][\footnotesize]
+ {\ec@defineLabel\ec@SolnLabel{#1}{#2}}
+\ecSolnLabel{Soln}
+\newcommand{\ecHintLabel}[2][\footnotesize]
+ {\ec@defineLabel\ec@HintLabel{#1}{#2}}
+\ecHintLabel{Hint}
+\newcommand{\ecNextLabel}[2][\footnotesize]
+ {\ec@defineLabel\ec@NextLabel{#1}{#2}}
+\ecNextLabel{Next}
+\newcommand{\ecPrevLabel}[2][\footnotesize]
+ {\ec@defineLabel\ec@PrevLabel{#1}{#2}}
+\ecPrevLabel{Prev}
+\newcommand{\ecHintNextLabel}[2][\footnotesize]
+ {\ec@defineLabel\ec@HintNextLabel{#1}{#2}}
+\ecHintNextLabel{Next}
+\newcommand{\ecHintSolnLabel}[2][\footnotesize]
+ {\ec@defineLabel\ec@HintSolnLabel{#1}{#2}}
+\ecHintSolnLabel{Soln}
+\newcommand{\ecBeginLabel}[2][\footnotesize]
+ {\ec@defineLabel\ec@BeginLabel{#1}{#2}}
+\ecBeginLabel{Begin}
+\newcommand{\ecHomeLabel}[2][\footnotesize]
+ {\ec@defineLabel\ec@HomeLabel{#1}{#2}}
+\ecHomeLabel{Home}
+\newcommand{\ecFinHomeLabel}[2][\footnotesize]
+ {\ec@defineLabel\ec@FinHomeLabel{#1}{#2}}
+\ecFinHomeLabel{Home}
+\newcommand{\ecFSLabel}[2][\footnotesize]
+ {\ec@defineLabel\ec@FSLabel{#1}{#2}}
+\ecFSLabel{FS}
+\newcommand{\ecCloseLabel}[2][\footnotesize]
+ {\ec@defineLabel\ec@CloseLabel{#1}{#2}}
+\ecCloseLabel{Close}
+\newcommand{\ecRandomLabel}[2][\footnotesize]
+ {\ec@defineLabel\ec@RandomLabel{#1}{#2}}
+\ecRandomLabel{Random}
+% \end{macrocode}
+% The definitions of the navigation icons, \cs{newNaviIcon} is defined in the \pkg{web} package.
+% \begin{macrocode}
+\newNaviIcon[j]{\Soln}\iconWidth\iconHeight{\ec@SolnLabel}
+ {\NaviIconActionJS{this.gotoNamedDest("\solnDest")}}
+\newNaviIcon[j]{\Hint}\iconWidth\iconHeight{\ec@HintLabel}
+ {\if\@ecNoHints\ec@YES\noHintJSAction\else
+ \NaviIconActionJS{this.gotoNamedDest("\hintDestJS")}\fi} % dps
+\newNaviIcon[j]{\NextCard}\iconWidth\iconHeight{\ec@NextLabel}
+ {\NaviIconActionJS{getNextCard()}}
+\newNaviIcon[j]{\PrevCard}\iconWidth\iconHeight{\ec@PrevLabel}
+ {\NaviIconActionJS{getPrevCard()}}
+\newNaviIcon[j]{\hintNextCard}\iconWidth\iconHeight
+ {\ec@HintNextLabel}{getNextCard();}
+\newNaviIcon[j]{\hintSoln}\iconWidth\iconHeight{\ec@HintSolnLabel}
+ {\NaviIconActionJS{this.gotoNamedDest("\solndest")}}
+\newNaviIcon[j]{\Begin}\iconWidth\iconHeight
+ {\ec@BeginLabel}{beginECards();}
+\newNaviIcon[l]{\Home}\iconWidth\iconHeight{\ec@HomeLabel}
+ {\ifnum\arabic{page}=1\relax\def\ec@next{\href{\@ecHomePage}}\else
+ \def\ec@next{\hyperlink{page.1}}\fi\ec@next}
+\newNaviIcon[j]{\Finished}\iconWidth\iconHeight{\ec@FinHomeLabel}
+ {resetToFirstPage();}
+\newNaviIcon[j]{\FullScreen}\iconWidth\iconHeight
+ {\ec@FSLabel}{\fsJS}
+\newNaviIcon[j]{\Close}\iconWidth\iconHeight{\ec@CloseLabel}
+ {closeCards=true; app.execMenuItem("Close")}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macrocode}
+\def\ec@CB@toggleOrder{%
+ \checkBox[\A{\JS{toggleOrder();}}\DV{\cbInitState}\V{\cbInitState}%
+ \TU{\toggleRandomizeTU}\textSize{0}\textColor{1 0 0}
+ \BC{0 0 .8}]{eccbtoggleorder}{9bp}{9bp}{randomOrder}}
+\providecommand{\nopNaviIcon}[4]{%
+ \def#1{{\setlength{\fboxsep}{0pt}%
+ \web@colorbox@w@transparency{\@menuBgColor}%
+ {\parbox[c][#3][c]{#2}%
+ {\normalsize\centering\color{\@menucolor}#4}}%
+ }}%
+}
+\nopNaviIcon{\fpToggleOrder}\iconWidth\iconHeight
+ {\ec@RandomLabel\space\ec@CB@toggleOrder}
+\nopNaviIcon{\ToggleOrder}\iconWidth\iconHeight
+ {\footnotesize\ec@CB@toggleOrder}
+% \end{macrocode}
+% If \cs{@memLogo} has a value of `y', then the logo is put in a box and copied
+% onto each page; otherwise, the logo is read from its file on each page.
+% \begin{macrocode}
+\edef\@@Logo{\if\@memLogo\ec@YES\relax
+ \noexpand\unhcopy\noexpand\Logo\else\noexpand\@ecLogo\fi}
+% \end{macrocode}
+% Build the button panel for the navigation bar. Can re-design as desired.
+% \changes{v2.0b}{2016/07/27}{Added \string\cs{iconWidthPanel} and \string\cs{panelGrpWidth}}
+% Use \DescribeMacro{\iconWidthPanel}\cs{iconWidthPanel} to set the width of a panel button, and
+% \DescribeMacro\panelGrpWidth\cs{panelGrpWidth} to set the width of the group of buttons.
+% \begin{macrocode}
+\newcommand\iconWidthPanel{28pt}
+\newcommand\panelGrpWidth{57pt}
+\ifnum\@panelconfig>0\relax
+% \end{macrocode}
+% if \cs{@panelconfig} (a macro defined in \textsf{web}, is positive, then the author has chosen
+% a left or a right navigation panel. So, we must build a panel.
+% \begin{macro}{\panelNaviGroup}
+% This is the group of panel buttons used for navigation purposes.
+% \begin{macrocode}
+ \renewcommand\panelNaviGroup {%
+ \def\iconWidth{\iconWidthPanel}%
+ \ifnum\thepage=1\relax
+ \parbox[c]{\panelGrpWidth}
+ {%
+ \Begin\hfill\FullScreen\\
+ \Close\hfill\Home\\
+ \let\iconWidth\linewidth
+ \fpToggleOrder
+ }%
+ \else
+ \parbox[c]{\panelGrpWidth}
+ {%
+ {\ifecListing\else\if\nMarker\ec@Ques
+ \if\@ecNoHints\ec@YES
+ \navibarTextColor{lightblue}\fi
+ \else
+ \navibarTextColor{lightblue}\fi\fi\Hint}\hfill
+ {\if\nMarker\ec@Soln
+ \navibarTextColor{lightblue}\fi\Soln}\\
+ \NextCard\hfill\PrevCard\\
+ \ToggleOrder\hfill\Finished
+ }%
+ \fi
+ }
+% \end{macrocode}
+% \end{macro}
+% If \cs{@memLogo} is `y', create a new box, read logo with \cs{@ecLogo}, and store
+% in box
+% \begin{macrocode}
+ \newbox\Logo
+ \if\@memLogo\ec@YES\relax
+ \AtBeginDocument{\global\setbox\Logo=\hbox{\@ecLogo}}%
+ \fi
+% \end{macrocode}
+% \begin{macro}{\buildpanel}
+% The \cs{buildpanel} command is defined in the \pkg{web} package and determines the layout of
+% the vertical navigation panel. You can re-design your own. \DescribeMacro{\raiseLogoBy}\cs{raiseLogoBy}
+% may be used to adjust the vertical position of the logo.
+% \changes{v2.0b}{2016/07/27}{Added \string\cs{raiseLogoBy}}
+% \begin{macrocode}
+\def\raiseLogoBy#1{{\setlength\@tempdima{#1}%
+ \xdef\r@iseLogoBy{\the\@tempdima}}}\raiseLogoBy{0pt}
+ \buildpanel{\raisebox{\r@iseLogoBy}{\ifx\@ecLogoLink\@empty\@@Logo
+ \else\href{\@ecLogoLink}{\@@Logo}\fi}%
+ \par\vspace{\stretch{1}}%
+ \rotatebox{-90}{\aebLogo}%
+ \par\vspace{\stretch{1}}%
+ \panelNaviGroup
+ }
+% \end{macrocode}
+% \end{macro}
+% Delay the expansion of the \cs{newNaviIcon} macro for the solution page
+% \begin{macrocode}
+ \def\defineSoln{\newNaviIcon[j]{\Soln}\iconWidth\iconHeight
+ {\ec@SolnLabel}{%
+ \NaviIconActionJS{this.gotoNamedDest("\solndest")}}%
+ \def\sqWrongRespJS{app.alert(\eqsqwgmsg,3);
+ this.gotoNamedDest("\solndest");}%
+ }
+\else
+% \end{macrocode}
+% \begin{macro}{\cardNavibar}
+% \cs{@panelconfig} must be zero, the author does not want a navigation panel, so well
+% put buttons at the bottom of each page to navigate by.
+% Standard navigation bar.
+% \begin{macrocode}
+ \def\cardNaviBar{\insNaviBar{\hfill
+ \if\@ecNoHints\ec@NO\Hint\ \fi\Soln\ \NextCard\
+ \PrevCard\ \ToggleOrder\ \Home\hfill}}
+ \def\defineSoln{\newNaviIcon[j]{\Soln}\iconWidth\iconHeight
+ {\ec@SolnLabel}{%
+ \NaviIconActionJS{this.gotoNamedDest("\solndest")}}%
+ \def\sqWrongRespJS{app.alert(\eqsqwgmsg,3);
+ this.gotoNamedDest("\solndest");}%
+ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\fi
+% \end{macrocode}
+%
+%\subsection{Close Page Action}
+%
+% We tap into \textsf{eforms} through the \cs{@CloseAction} macro. If \texttt{aeb\_pro}
+% is used, the document author may overwrite this definition.
+%
+% \begin{macrocode}
+\newcommand{\pressBeginMsg}{Press the \eqbs\eqbs"Begin\eqbs\eqbs"
+ button to begin viewing the cards.}
+\ifecListing\else
+\thisPageAction{\JS{}}{\JS{if (!closeCards&&!beginPressed){\jsR\jsT
+ var b=app.setTimeOut("this.pageNum=0;
+ app.alert(pressBeginMsg);",50);\jsR}}}
+\fi
+% \end{macrocode}
+% \subsection{Document Level JavaScript}
+% Insert document level JavaScripts to get the functionality of randomly selected questions.
+%
+% \smallskip\noindent If author has used the \texttt{nodljs} or \texttt{exercises} only, then
+% we need to turn the \textsf{insdljs} package back on by emitting
+% \begin{macrocode}
+\let\importdljs=y
+% \end{macrocode}
+% This is the JavaScript to control the eCards action. Some global variables followed by the
+% \texttt{getNextCard()} method.
+% \begin{macrocode}
+\begin{insDLJS}[isCardloaded]{flashcrd}{Flash Card JS}
+var isCardloaded=true;
+var closeCards=false;
+var beginPressed=false;
+var maxNumberCards = Math.pow(10,Math.ceil(%
+Math.LOG10E*Math.log(\theNumCards)));
+var aCardsNaturalOrder=new Array();
+var aCardsRandomOrder=new Array();
+var aCardsViewOrder;
+var ptrCards=0;
+var cardsFinished = "\CARDSFINISHED";
+var pressBeginMsg = "\pressBeginMsg";
+var isRandomized=\israndomized;
+% \end{macrocode}
+% Get the next card, and notify the user if all cards have been viewed.
+% \begin{macrocode}
+function getNextCard() {
+ numCards = \theNumCards;
+ if ( ptrCards == numCards ) {
+ app.alert(cardsFinished,3);
+ resetToFirstPage();
+ } else {
+ ptrCards+=1;
+ this.gotoNamedDest("qex."+aCardsViewOrder[ptrCards]);
+ }
+}
+% \end{macrocode}
+% Get the previous card.
+% \begin{macrocode}
+function getPrevCard() {
+ if ( ptrCards <= 1 ) {
+% this.gotoNamedDest("page.1");
+ resetToFirstPage();
+ } else {
+ ptrCards-=1;
+ this.gotoNamedDest("qex."+aCardsViewOrder[ptrCards]);
+ }
+}
+% \end{macrocode}
+% We also define a function \texttt{ecOnBlurRespBox()} to
+% correctly control the page changes: If a wrong answer is given, then we go to
+% the hint or the solution depending on whether user is responding to the original
+% question or to the hint.
+% \begin{macrocode}
+function ecOnBlurRespBox (retn, exnoCard, nMarker) {
+ if (retn != null) {
+ if (retn) {
+ app.alert(\eqsqrtmsg,3);
+ var dest = "ex" + exnoCard + ".s"; // dps
+ this.gotoNamedDest(dest);
+ } else {
+ app.alert(\eqsqwgmsg,3);
+ if (nMarker==0) {
+ var dest = "ex." + exnoCard; // dps
+ this.gotoNamedDest(dest);
+ }
+ else {
+ var dest = "ex" + exnoCard + ".s"; // dps
+ this.gotoNamedDest(dest);
+ }
+ }
+ } else {
+ var str = event.target.value.toString();
+ if (str.replace(/\s/g,"") == "")
+ event.target.strokeColor = \defaultColorJSDef; // dps
+ }
+}
+% \end{macrocode}
+% This executes when the user clicks the begin link.
+% \begin{macrocode}
+function beginECards() {
+ PrepareViewingOrder();
+ beginPressed=true;
+ getNextCard();
+ var f, g, bState;
+ f=this.getField("eccbtoggleorder");
+ bState=f.isBoxChecked(0);
+ this.resetForm();
+ f.checkThisBox(0,bState);
+ for (var card=1; card<=\theNumCards; card++) {// dps
+ f = this.getField("obj.ex"+card);
+ if ( f != null ) {
+ g = f.getArray();
+ for (var i = 0; i < g.length; i++)
+ g[i].strokeColor = \defaultColorJSDef; // dps
+ }
+ }
+}
+% \end{macrocode}
+% Sets \texttt{ptrCards} to 0, then builds two new matrices,
+% \texttt{aCardsNaturalOrder} consisting of the numbers 1,2,...\cs{theNumCards},
+% and \texttt{aCardsRandomOrder}. If \texttt{isRandomized} is \texttt{true},
+% \texttt{aCardsViewOrder} is set to \texttt{aCardsRandomOrder}, otherwise it is set
+% to \texttt{aCardsNaturalOrder}.
+% \begin{macrocode}
+function PrepareViewingOrder() {
+ ptrCards=0;
+ var i, rand;
+ for (i=0; i<=\theNumCards; i++) {
+ aCardsNaturalOrder[i]=i;
+ aCardsRandomOrder[i]=i;
+ }
+% \end{macrocode}
+% We randomize the entries in \texttt{aCardsRandomOrder}, which at this moment
+% is the same as \texttt{aCardsNaturalOrder}.
+% \begin{macrocode}
+ for (i=1; i<=\theNumCards; i++) {
+ var rand = Math.random();
+ rand *= maxNumberCards;
+ rand = Math.ceil(rand);
+ rand = rand \% \theNumCards;
+ rand += 1;
+ temp = aCardsRandomOrder[i];
+ aCardsRandomOrder[i]=aCardsRandomOrder[rand];
+ aCardsRandomOrder[rand]=temp;
+ }
+ aCardsViewOrder=(isRandomized)?aCardsRandomOrder:aCardsNaturalOrder;
+}
+% \end{macrocode}
+% Toggles between viewing the cards in random order and their natural order.
+% \begin{macrocode}
+function toggleOrder() {
+ isRandomized=!isRandomized;
+ if (aCardsNaturalOrder.length==0) PrepareViewingOrder();
+ if (isRandomized) {
+ for (var i=1; i<=\theNumCards; i++)
+ if (aCardsRandomOrder[i]==ptrCards) break;
+ ptrCards=i;
+ aCardsViewOrder=aCardsRandomOrder;
+ app.alert("\randomizedMsg");
+ } else {
+ ptrCards=aCardsViewOrder[ptrCards];
+ aCardsViewOrder=aCardsNaturalOrder;
+ app.alert("\nonrandomizedMsg");
+ }
+}
+function resetToFirstPage() {
+ this.gotoNamedDest("page.1");
+ beginPressed=false;
+}
+\end{insDLJS}
+% \end{macrocode}
+% If we have the \texttt{listing} option taken, then we import the \texttt{ecardslist.def}
+% file to redefine portions of the \texttt{card} environment.
+% just the Adobe Reader.
+% \begin{macrocode}
+\ifecListing\input{ecardslist.def}\fi
+% \end{macrocode}
+% If document author wants to modify these environments, s/he can place redefinitions in
+% \texttt{ecard.cus}.
+% \begin{macrocode}
+\if\@ecCustom\ec@YES\InputIfFileExists{ecard.cus}{}{}\fi
+%</package>
+% \end{macrocode}
+% \subsection{Support for the \texttt{listing} option}
+% When the \texttt{listing} option is taken, we list out the questions, hints, and answers.
+% In this section, a number of environments and commands are defined, the name of each
+% begin with `\texttt{listing@}'. The document author can \cs{renewcommand} there to
+% create a printed listing of easy review. If you say
+%\begin{verbatim}
+%\usepackage[forpaper,tight]{web}
+%\usepackage[solutionsafter,proofing]{exerquiz}
+%\usepackage[memLogo,listing]{ecards}
+%\end{verbatim}
+% then the multiple choice and fill-in questions will display the correct answers. Place any
+% customizations in a text field named \texttt{ecard.cus}, and use the \texttt{custom}
+% option.
+% \subsubsection{The \texttt{card} Environment}
+% \begin{macrocode}
+%<*listing>
+% \end{macrocode}
+% \begin{environment}{card}
+% This is the main environment for writing questions, hints and answers. This environment
+% encloses all.
+% \begin{macrocode}
+\newcounter{ecCnt}
+\let\exsolafter\@empty
+\eqexerskip{0pt}
+\newenvironment{listing@card}[1][\opts@ecNoHints]{%
+ \isQuestrue\let\useHints\ec@HintsWarning
+ \let\useNoHint\ec@HintsWarning\edef\ec@rgi{#1}%
+ \ifx\ec@rgi\ec@isHint
+ \def\ec@thisHintOpt{\ecUseHints}\else
+ \ifx\ec@rgi\ec@isNoHint
+ \def\ec@thisHintOpt{\ecUseNoHints}\else
+ \def\ec@thisHintOpt{\ecUseHints}\ec@BadArgWarning
+ \fi\fi
+ \ec@thisHintOpt\nMarkerSet{\ec@Ques}%
+ \stepcounter{ecCnt}%
+ \def\eqexheader{\noindent}%
+ \renewcommand\exsllabelformat{\protect\noindent}%
+ \renewcommand\exrtnlabelformat{}%
+ \renewcommand\exsecrunhead{}%
+ \let\afterlabelhskip\@empty
+ \def\exersolnheadhook{\ecInfoToSolns}%
+ \begin{exercise}%
+ \textBgColor{\@cardColor}%
+ \headCard
+}{%
+ \tailCard
+ \end{exercise}%
+}
+% \end{macrocode}
+% \end{environment}
+% \begin{macro}{\headCard}
+% The design of the question page. Can re-design.
+% \begin{macrocode}
+\newcommand{\listing@headCard}{\ifeqforpaper
+ \makebox[0pt][r]{\textbf{\arabic{ecCnt}.\thinspace}}\else
+ \makebox[0pt][r]{\textbf{\hyperlink{ex.\exnoCard}%
+ {\arabic{ecCnt}.\thinspace}}}\fi\ignorespaces}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\tailCard}
+% Complete any environments begun by \cs{headCard}
+% \begin{macrocode}
+\newcommand{\listing@tailCard}{\removelastskip\par} % dps
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{The \texttt{response} Environment}
+% \begin{environment}{response}
+% Nested within the \texttt{card} environment is the
+% \texttt{response} environment, which, in turn, contains the
+% \texttt{hint} and \texttt{answer} environments. This basically
+% the \texttt{solution} environment for an \texttt{exercise} of
+% \textsf{exerquiz}.
+% \begin{macrocode}
+\def\setSolutionsAfterSkip{\expandafter
+ \def\expandafter\solutionsafterSkip
+ \expandafter{\solutionsafterSkip\kern0pt}}
+\AtBeginDocument{\setSolutionsAfterSkip}
+\newenvironment{listing@response}
+ {\solutionsafterSkip\solnexer@woparts[]}{\endsolnexer@woparts}
+% \end{macrocode}
+% \end{environment}
+% \begin{environment}{hint}
+% Right now, a hint is required. Place this environment within the \texttt{response}
+% environment and \textit{before} the \texttt{answer} environment.
+% \begin{macrocode}
+\newenvironment{listing@hint}{%
+ \textBgColor{\@hintColor}%
+ \headHint
+}{\tailHint}
+% \end{macrocode}
+% \end{environment}
+% \begin{macro}{\headHint}
+% The design of the hint page. Can re-design.
+% \begin{macrocode}
+\newcommand{\listing@headHint}{%
+ \par\textit{Hint}:\space\ignorespaces}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\tailHint}
+% Close any environments begun in \cs{headHint}
+% \begin{macrocode}
+\newcommand{\listing@tailHint}{}
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{The \texttt{answer} Environment}
+% \begin{macro}{\headAnswer}
+% The design of the answer page. Can re-design.
+% \end{macro}
+% \begin{environment}{answer}
+% The \texttt{answer} environment follows the \texttt{hint}, also listed within
+% the \texttt{response} environment.
+% \begin{macrocode}
+\newenvironment{listing@answer}{%
+ \textBgColor{\@solnColor}%
+ \headAnswer
+}{\tailAnswer}
+% \end{macrocode}
+% \end{environment}
+% \begin{macrocode}
+\newcommand{\listing@headAnswer}{%
+ \par\textit{Answer}:\space\ignorespaces}
+% \end{macrocode}
+% \begin{macro}{\tailAnswer}
+% Close any environments opened by \cs{headAnswer}
+% \begin{macrocode}
+\newcommand{\listing@tailAnswer}{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\def\ec@redefForListing{%
+ \let\card\listing@card
+ \let\endcard\endlisting@card
+ \let\headCard\listing@headCard
+ \let\tailCard\listing@tailCard
+ \let\response\listing@response % dps
+ \let\endresponse\endlisting@response % dps
+ \let\headhint\listing@hint
+ \let\endhint\listing@endhint
+ \let\headHint\listing@headHint
+ \let\tailHint\listing@tailHint
+ \let\answer\listing@answer
+ \let\endanswer\listing@endanswer
+ \let\headAnswer\listing@headAnswer
+ \let\tailAnswer\listing@tailAnswer
+}
+\AtBeginDocument{\ec@redefForListing}
+%</listing>
+% \end{macrocode}
+\endinput
diff --git a/texmf-dist/source/latex/ecards/ecards.ins b/texmf-dist/source/latex/ecards/ecards.ins
new file mode 100644
index 00000000..2ff91dbe
--- /dev/null
+++ b/texmf-dist/source/latex/ecards/ecards.ins
@@ -0,0 +1,65 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1999-2002 D. P. Story
+%%
+%% This file is part of the `Web and Exerquiz Distribution'.
+%% -------------------------------------------
+%%
+%% It may be distributed under the conditions of the LaTeX Project Public
+%% License, either version 1.2 of this license or (at your option) any
+%% later version. The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.2 or later is part of all distributions of LaTeX
+%% version 1999/12/01 or later.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2001/05/26}
+\def\batchfile{ecards.ins}
+%
+% If you can assume that the target audience for the document all have
+% Acrobat Reader 5.0 or later, then chance the following switch to true,
+% else, leave it as false.
+
+\input docstrip
+\ifx\generate\undefined
+ \Msg{**********************************************}
+ \Msg{*}
+ \Msg{* This installation requires docstrip}
+ \Msg{* version 2.4 or later.}
+ \Msg{*}
+ \Msg{* An older version of docstrip has been input}
+ \Msg{*}
+ \Msg{**********************************************}
+ \errhelp{Move or rename old docstrip.tex and get a newer one.}
+ \errmessage{Old docstrip in input path}
+ \batchmode
+ \csname @@end\endcsname\end
+\fi
+
+\keepsilent
+\askforoverwritefalse
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\preamble
+\endpreamble
+
+\generate
+{%
+ \file{ecards.sty}{\from{ecards.dtx}{copyright,package}}
+ \file{ecardslist.def}{\from{ecards.dtx}{copyright,listing}}
+}
+
+\Msg{***************************************************************}
+\Msg{*}
+\Msg{* \space To finish the installation you have to copy the files }
+\Msg{*}
+\Msg{* \space *.sty, *.cfg and *.def into a directory searched by TeX}
+\Msg{*}
+\Msg{***************************************************************}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\endinput
diff --git a/texmf-dist/source/latex/fc-arith/docs/fc_arithman.tex b/texmf-dist/source/latex/fc-arith/docs/fc_arithman.tex
new file mode 100644
index 00000000..5a770dd4
--- /dev/null
+++ b/texmf-dist/source/latex/fc-arith/docs/fc_arithman.tex
@@ -0,0 +1,1140 @@
+% makeindex < aebpro_man.idx > aebpro_man.ind
+\documentclass{article}
+\usepackage[fleqn]{amsmath}
+\usepackage[%
+ web={centertitlepage,designv,
+ forcolorpaper,latextoc,pro,useui},
+ exerquiz,aebxmp
+]{aeb_pro}
+\usepackage{aeb_mlink}
+\usepackage[altbullet]{lucidbry}
+%\usepackage{myriadpro}
+
+\usepackage{graphicx,array,longtable}
+%\usepackage[usecmtt]{myriadpro}
+
+%\def\uif#1{\textbf{\textsf{{#1}}}}
+\let\uif\textsf
+
+\newdimen\totaltextwidth
+\totaltextwidth=\fullscreenwidth
+\advance\totaltextwidth\oddsidemargin
+\renewcommand{\webheadwrapper}[1]{%
+ \hspace{-\oddsidemargin}%
+ \makebox[\totaltextwidth][s]{#1}\hss
+}
+
+\setlongtables
+
+\usepackage{acroman}
+
+\usepackage[active]{srcltx}
+
+\urlstyle{rm}
+
+\newcommand{\prodName}{\textsf{PDF Flash Card}}
+\newcommand{\sprodName}{\textsf{Flash Card}}
+\newcommand{\ssprodName}{\textsf{Builder}}
+
+\DeclareDocInfo
+{
+ university={\AcroTeX.Net},
+ title={\prodName: Arithmetic},
+ author={D. P. Story},
+ email={dpstory@acrotex.net},
+ subject={Documentation for AeB Exam Builder},
+ talksite={\url{www.acrotex.net}},
+ version={v1.0f, 2017/01/16},
+ keywords={LaTeX, PDF, AcroTeX, PDF Flash Card, Arithmetic},
+ copyrightStatus=True,
+ copyrightNotice={Copyright (C) \the\year, D. P. Story},
+ copyrightInfoURL={http://www.acrotex.net}
+}
+
+\renewcommand\hproportionwebtitle{.75}
+\universityLayout{fontsize=Large,fontfamily=sffamily}
+\titleLayout{fontsize=LARGE,fontfamily=sffamily}
+\authorLayout{fontsize=Large,fontfamily=sffamily}
+\tocLayout{fontsize=Large,color=aeb,fontfamily=sffamily}
+\sectionLayout{indent=-62.5pt,fontsize=large,color=aeb,fontfamily=sffamily}
+\subsectionLayout{indent=-31.25pt,color=aeb,fontfamily=sffamily}
+\subsubsectionLayout{indent=0pt,color=aeb,fontfamily=sffamily}
+\subsubDefaultDing{\texorpdfstring{$\bullet$}{\textrm\textbullet}}
+
+\def\verygoodbreak{%
+\vskip0pt plus1in\goodbreak\vskip0pt plus-1in}
+
+\hyphenation{Java-Script}
+
+\def\AcroT{Acro\!\TeX}\def\cAcroT{{\textcolor{blue}{\AcroT}}}
+\def\AcroEB{\AcroT{} eDucation Bundle}\def\cAcroEB{\textcolor{blue}{\AcroEB}}
+\def\AcroB{\AcroT{} Bundle}\def\cAcroB{\textcolor{blue}{\AcroB}}
+\def\bUrl{http://www.math.uakron.edu/~dpstory}
+
+\makeatletter
+\let\bslash=\@backslashchar
+\renewcommand{\paragraph}{\@startsection{paragraph}{4}{0pt}{6pt}{-3pt}{\bfseries}}
+
+% Begin definition of \appendixsubsection
+\newcounter{appendixsubsection} %\setcounter{appendixsubsection}{0}
+\def\theappendixsubsection{\Alph{appendixsubsection}}
+\def\theHappendixsubsection{\Alph{appendixsubsection}}
+\newcommand\appendixsubsection{%
+ \renewcommand{\@seccntformat}[1]{\csname the##1\endcsname.\enspace}%
+ \@startsection{appendixsubsection}{1}{\z@}%
+ {-2.5ex\@plus -1ex \@minus -.2ex}%
+ {1ex \@plus .2ex}%
+ {\normalfont\normalsize\bfseries\color{blue}}}
+\let\appendixsubsectionmark=\@gobble
+\expandafter\def\csname toclevel@appendixsubsection\endcsname{1}
+
+\let\l@appendixsubsection=\l@section
+\def\web@appendixsubsection#1#2#3{\web@parse#1\\\par\penalty-50 \hspace*{\@tempdima}\mbox{}%
+ \textbf{\makebox[0pt][r]{\makebox[\@tempdima][r]{\hyperlink{#3}{\numberline.\enspace}}}\web@title}\endgraf}
+% end definition of appendixsubsection
+
+\makeatother
+
+\hypersetup{linktocpage}
+
+%\newenvironment{sverbatim}
+%{\par\footnotesize\verbatim}{\endverbatim}
+
+%\newcommand\redpoint{\par\ifdim\lastskip>0pt\relax\vskip-\lastskip\fi
+%\vskip\medskipamount\noindent
+% \makebox[\parindent][l]{\large\color{red}$\blacktriangleright$}}
+%\newcommand\handpoint{\par\ifdim\lastskip>0pt\relax\vskip-\lastskip\fi
+%\vskip\medskipamount\noindent
+% \makebox[\parindent][l]{\large\color{blue}\ding{042}}}
+%\newcommand\newtopic{\par\ifdim\lastskip>0pt\relax\vskip-\lastskip\fi
+%\vskip\medskipamount\noindent
+%}
+
+\def\cs#1{\texttt{\bslash#1}}
+\def\Cs#1{\hyperlink{#1}{\cs{#1}}}
+\def\tableCs#1{\hyperlink{table#1}{\cs{#1}}}
+\def\targ#1#2?{\hypertarget{#2}{\bslash#2}#1}
+
+\def\dps{$\mbox{$\mathfrak D$\kern-.3em\mbox{$\mathfrak P$}%
+ \kern-.6em \hbox{$\mathcal S$}}$}
+
+\def\eForm{\textsf{eForm}}
+
+
+\def\OpenToHere{\OpenAction{\JS{this.gotoNamedDest("Here")}}}
+\def\OpenHere{\hypertarget{Here}{\strut}}%\OpenToHere
+
+\nocopyright
+\norevisionLabel
+\makeatletter
+%\let\web@copyright\@gobble
+\let\web@revision\@gobble
+\renewcommand\webdirectory
+{%
+ \par\ifeqforpaper\else\minimumskip\fi\vspace{\stretch{1}}%
+ \begin{flushleft}\textbf{\large\web@directory}%
+ \vspace{-3pt}
+ \begin{itemize}\setlength{\itemsep}{-3pt}%
+ \bfseries
+ \item \leavevmode\hyperlink{webtoc}{\web@toc}%
+ \item \web@article
+ \item[] \rule[2pt]{2.25in}{.4pt}
+ \item \textsf{\href{apb_man.pdf}{APB}} Documentation
+ \item \href{webeqman.pdf}{\AcroEB} Documentation
+ \end{itemize}
+ \end{flushleft}
+}
+\renewcommand\titlepageTrailer
+{%
+ \webversion
+% \web@copyright\ \copyright\ \webcopyrightyears\ \webversion
+ \hfill\url{http://www.acrotex.net}\\
+ \web@revision\ \@date \hfill\href{mailto:\webemail}{\webemail}
+}
+\renewcommand\titlepageTrailer
+{%
+ \href{mailto:\webemail}{\webemail}
+% \web@copyright\ \copyright\ \webcopyrightyears\ \webversion
+ \hfill\url{http://www.acrotex.net}\\
+ \web@revision\ \@date \hfill\webversion
+}
+\makeatother
+
+\newcounter{exampleno}
+\def\theexampleno{\arabic{exampleno}}
+\newcommand\Example{\refstepcounter{exampleno}%
+\paragraph*{Example~\arabic{exampleno}.}}
+
+\definecolor{aeb}{rgb}{0.24,0.38,0.68}%bleu
+\universityColor{aeb}
+\tocColor{aeb}
+
+\everyCheckBox{\BC{.690 .769 .871}\BG{.941 1 .941}\textColor{1 0 0}}
+\everyRadioButton{\BC{.690 .769 .871}\BG{.941 1 .941}\textColor{0 0 1}\symbolchoice{star}}
+
+%\optionalPageMatter{%
+%\begin{center}
+%\hspace*{1in}\fbox{\begin{minipage}{.4\linewidth}\huge\bfseries
+%Documentation still\\under construction
+%\end{minipage}}
+%\end{center}
+%}
+
+
+%\definePath\bgPath{"C:/Users/Public/Documents/ManualBGs/Manual_BG_Print_AeB.pdf"}
+%\definePath\bgPath{"C:/Users/Public/Documents/ManualBGs/Manual_BG_Print_Games.pdf"}
+
+\chngDocObjectTo{\newDO}{doc}
+\begin{docassembly}
+var titleOfManual="The fc_arith MANUAL";
+var manualfilename="Manual_BG_Print_fetchbib.pdf";
+var manualtemplate="Manual_BG_Brown.pdf"; // Blue, Green, Brown
+var _pathToBlank="C:/Users/Public/Documents/ManualBGs/"+manualtemplate;
+var doc;
+var buildIt=false;
+if ( buildIt ) {
+ console.println("Creating new " + manualfilename + " file.");
+ doc = \appopenDoc({cPath: _pathToBlank, bHidden: true});
+ var _path=this.path;
+ var pos=_path.lastIndexOf("/");
+ _path=_path.substring(0,pos)+"/"+manualfilename;
+ \docSaveAs\newDO ({ cPath: _path });
+ doc.closeDoc();
+ doc = \appopenDoc({cPath: manualfilename, oDoc:this, bHidden: true});
+ f=doc.getField("ManualTitle");
+ f.value=titleOfManual;
+ doc.flattenPages();
+ \docSaveAs\newDO({ cPath: manualfilename });
+ doc.closeDoc();
+} else {
+ console.println("Using the current "+manualfilename+" file.");
+}
+var _path=this.path;
+var pos=_path.lastIndexOf("/");
+_path=_path.substring(0,pos)+"/"+manualfilename;
+\addWatermarkFromFile({
+ bOnTop:false,
+ bOnPrint:false,
+ cDIPath:_path
+});
+\executeSave();
+\end{docassembly}
+\begin{document}
+
+\maketitle
+
+
+\selectColors{linkColor=black}
+
+\tableofcontents
+
+\selectColors{linkColor=webgreen}
+
+
+\section{Introduction}
+
+The \textsf{fc\_arith} package is used to create an electronic ``flash card'' used to drill a student on elementary arithmetic, addition, subtraction, multiplication, and division. There are options for setting the range of the numbers to be used to randomly select numbers that appear in the arithmetic problem. Numbers can be set to 0, 1, or 2 decimal places. There is an optional timing mechanism that can be used to test a student's quickness in solving problems. There is a collection of fields used to tally the student's work on the arithmetic problems.
+
+\paragraph*{History.} This is a re-work of an earlier PDF on drilling arithmetic problems. At that time, I took a blank PDF page and used the user interface of Acrobat to build the flash card.
+
+In this version, I've taken the original flash card and developed a {\LaTeX} package for generating the flash card, added a number of customization options, and many other enhancements.
+
+\begin{figure}[htb]
+\begin{center}\setlength{\fboxsep}{0pt}
+\fbox{\includegraphics[scale=.9]{graphics/fc04_a}}\\
+\caption{\prodName: Arithmetic}\label{fcaritha}
+\end{center}
+\end{figure}
+
+\section{Requirements and Options}
+
+In this section, we review the requirements to build your own custom
+flash card, and describe the package options available.
+
+\subsection{Requirements}
+
+The package is designed to be used with either a \textsf{Acrobat Distiller}
+or a \textsf{pdflatex} workflow. The only true requirements are
+\begin{itemize}
+\item The \textsf{eforms} package (version 2.5c or later, 2010/03/21 or
+later), a package distributed with AeB (the {Acro\!\TeX} eDucation Bundle%
+\footnote{\url{http://www.math.uakron.edu/~dpstory/webeq.html}}
+
+\item The \textsf{popupmenu} package
+ \footnote{\url{http://mirror.ctan.org/macros/latex/contrib/popupmenu/}}
+ which creates a menu system.
+
+\end{itemize}
+
+\redpoint Sample files: \texttt{fc-acrobat.tex} and \texttt{fc-noacrobat.tex}.
+
+\newtopic\noindent I recommend the use of the \textsf{web} package to design your
+page, just as the sample files do. Enhancements include the use of the
+\textsf{aeb\_pro} package; see the sample file \texttt{fc-acrobat.tex} for an
+illustration of the use of \textsf{aeb\_pro}.
+
+\subsection{PDF Creators}
+
+Any of the PDF creators used by the {\LaTeX} community
+(\app{dvips/Distiller}, \app{pdflatex}, \app{lualatex}, and \app{xelatex})
+may be used to build a {\prodName} document, as is demonstrated by the sample files
+\texttt{fc-acrobat.tex} and \texttt{fc-noacrobat.tex}. Users who prefer
+\app{pdflatex}, \app{lualatex}, and \app{xelatex} but own the \app{Acrobat}
+application may want to look at the sample file \texttt{fc-acrobat.tex}.
+
+\subsection{Options}
+
+\begin{enumerate}
+
+\item\texttt{allownegsub}: The original arithmetic flash card did not allow
+ a negative difference, if this option is used, the differences are
+ allowed to be negative. The default is to not to allow negative
+ differences.
+
+\item \texttt{nomenu}: There is a menu, labeled \uif{Settings},
+ that allows the user change the range of the numbers generated by the
+ flash card, set the number of decimal places, allows the user to toggle
+ the \uif{Keypad} on and off, and so on. For further details
+ see \Nameref{settings}.
+
+ If this option is used, the menu does not appear. The default is for it to appear.
+
+\item \texttt{showkeypadlink}: The \texttt{showkeypadlink} option generates
+ a link with a label of \uif{Toggle Keypad} just above the
+ keypad. Clicking the link toggles the visibility of the keypad.
+
+ This option is useful if the \texttt{nomenu} option is taken, but
+ you want the keypad available to users.
+
+\item \texttt{operations}: Gives the ability to declare what operations
+ flash card should show. Supported operations are \texttt{add},
+ \texttt{sub}, \texttt{mul}, \texttt{div}. For example,
+\begin{Verbatim}[xleftmargin=\amtIndent]
+operations={add,sub}
+\end{Verbatim}
+ creates a flash card in which only addition and subtraction problems
+ are available.
+
+ The default is to make available all operations.
+
+
+\item \texttt{notimedscores}: As can be seen in
+ \hyperref[fcaritha]{Figure~\ref*{fcaritha}}, page~\pageref*{fcaritha},
+ the flash card has many fields that key of the user's performance. One
+ of these is the \uif{Timed Scores} row; this row gives a
+ score based on time required to answer the problem correctly. Some
+ teachers may not want such pressure placed on their students, so if
+ this option is taken, the row is not generated.
+
+\end{enumerate}
+
+\section{The Components of the \sprodName}
+
+We describe the elements of the flash card as they appear, from top to
+bottom, in \hyperref[fcaritha]{Figure~\ref*{fcaritha}},
+page~\pageref*{fcaritha}.
+
+\subsection{Settings}\label{settings}
+
+The \uif{Settings} menu, which can be removed with the
+\texttt{nomenu} option, consists of five menu items:
+\uif{Options}, \uif{Toggle Keypad},
+\uif{Mouse Friendly Keypad}, \uif{Touch Friendly
+Keypad}, and \uif{About PDF Flash Cards}, see the figure below.
+
+\begin{figure}[htb]
+\begin{center}\setlength{\fboxsep}{0pt}
+\fbox{\includegraphics[scale=.75]{graphics/menu_settings}}\\
+\caption{The \texorpdfstring{\protect\uif{Settings}}{Settings} menu}\label{menuSettings}
+\end{center}
+\end{figure}
+
+The labeling for the \uif{Settings} menu is modified using the
+command \cs{fcSettings}, the default definition is
+\verb!\newcommand{\fcSettings}{Settings}!. The color of the link is set by
+the command \cs{fcSettingsColor}, the default definition of which is
+\verb!\newcommand{\fcSettingsColor}{black}!.
+
+\paragraph*{The \env{MenuFC} environment.} The \uif{Settings} menu is created by the environment seen below and found the
+the demonstration files of this distribution. The \env{MenuFC} is a special environment
+defined in \pkg{fc\_arith} to enclose the menu items.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\begin{MenuFC}
+ \fcOptionsMenuItem
+ \fcToggleKeypadMenuItem
+ \fcMouseKPMenuItem
+ \fcTouchKPMenuItem
+ \fcAboutFC
+\end{MenuFC}
+\end{Verbatim}
+You can exclude some of the menu items listed above. From
+Figure~\ref{menuSettings}, the \uif{Mouse Friendly Keypad} and
+\uif{Touch Friendly Keypad} items are initially grayed out. They
+become active when \uif{Toggle Keypad} is selected. The
+\uif{Touch Friendly Keypad} is larger than the
+\uif{Mouse Friendly Keypad} and fits fat fingers better. See
+\mlNameref{toggleKp} for additional information on the keypad.
+
+The names of the menu items may be localized to your own language.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\renewcommand\fcOptionsMenuItemTitle{Options}
+\renewcommand\fcToggleKeypadMenuItemTitle{Toggle Keypad}
+\renewcommand\fcMouseKPMenuItemTitle{Touch Friendly Keypad}
+\renewcommand\fcTouchKPMenuItemTitle{Mouse Friendly Keypad}
+\renewcommand\fcAboutFCTitle{About PDF Flash Cards}
+\end{Verbatim}
+The default English title defines are shown. All can be redefined in the preamble or in the
+customization file \texttt{fc\_custom.def}, discussed in \hyperref[s:CusStrs]{Section~\ref*{s:CusStrs}}.
+
+\subparagraph*{Adding custom menu items.} You can also add custom menu items,
+but some effort. Suppose we want to add an item titled \uif{AcroTeX.Net}. The
+special environment generates a \env{popupmenu} environment, as defined by
+the \pkg{popupmenu} package. We use the \cs{item} command, as defined within
+a \env{popupmenu} environment and assign values for \texttt{title} and
+\texttt{return}. The value of \texttt{return} is any string, but
+\pkg{fc\_arith} puts a restriction on its value: it must not be 0, 1, 2, 3,
+or 4, for these values are used by the preexistent menu items.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\begin{MenuFC}
+ \fcOptionsMenuItem
+ \fcToggleKeypadMenuItem
+ \fcMouseKPMenuItem
+ \fcTouchKPMenuItem
+ \item{title=AcroTeX.Net Home,return=acrotexhome}
+ \item{title=AcroTeX.Net Blog,return=acrotexblog}
+ \fcAboutFC
+\end{MenuFC}
+\end{Verbatim}
+The \env{MenuFC} environment occurs in the preamble of your document. Then to associate an action
+with the use selecting this new item, add the following code to the preamble as well:
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\begin{insDLJS}{cmfc}{Custom Menu Events}
+function processCustomFcMenu(n) {
+ // n=the return value of the selected item
+ switch(n) {
+ case "acrotexhome":
+ app.launchURL("http://www.acrotex.net",false);
+ break;
+ case "acrotexblog":
+ app.launchURL("http://blog.acrotex.net",false);
+ break;
+ }
+}
+\end{insDLJS}
+\end{Verbatim}
+Here I use the JavaScript \texttt{switch} operator to take the incoming
+argument \texttt{n} (the return value) and associating an action. If the
+user-defined \texttt{processCustomerFcMenu()} is created, \pkg{fc\_arith}
+passes the code scream from the function \texttt{processFcMenu()}, which
+handles all the predefined menu items, to \texttt{processCustomerFcMenu()}.
+
+With these definitions, when the user selects `\uif{AcroTeX.Net Home}', the
+default browser opens and loads the page \url{http://www.acrotex.net}. This
+technique is illustrated in the file \texttt{fc\_noacrobat.tex}.
+
+
+
+\subsubsection{Options}\label{options}
+
+The \uif{Options} menu item calls forth the
+\uif{Options} dialog box,
+\hyperref[menuOptions]{Figure~\ref*{menuOptions}},
+page~\pageref*{menuOptions}. Through this dialog box, you can set the
+intervals from which random numbers are drawn, and their precision.
+
+\paragraph*{Addition, Subtraction, Multiplication.} We handle these three
+operations in the same way, so we explain them together. For these three
+we have a top number and a bottom number.
+\begin{quote}%\large
+\begin{tabular}{rc@{ }rc@{ }rc@{ }r}
+top & & $14$ & & $17$ & & $12$ \\
+bottom &$+$& $2$ &$-$& $4$ &$\times$& $7$ \\
+\end{tabular}
+\end{quote}
+In the dialog box, you can set the range (the interval) of numbers from which
+randomly generated numbers are taken. For example, the
+\hyperref[menuOptions]{Figure~\ref*{menuOptions}} on
+page~\pageref*{menuOptions} specifies that for \textsf{Addition} problems, the top
+value should come from a range of $2$ to $20$, the bottom range is $5$ to
+$30$, and there should be no decimal places (hence, for this example, we
+deal with integer arithmetic). {\prodName} supports at most two decimal places.
+
+\begin{figure}[htb]
+\begin{center}\setlength{\fboxsep}{0pt}
+\fbox{\includegraphics[scale=.75]{graphics/options}}\\
+\caption{The \texorpdfstring{\protect\uif{Options}}{Options} dialog box}\label{menuOptions}
+\end{center}
+\end{figure}
+
+\paragraph*{Division.} Division is handled separately because of the way the
+problem is generated. Rather than randomly generating the top and bottom
+values as is done for addition, subtraction, and multiplication, the
+\textsf{fc\_arith} package randomly generates the \emph{quotient} and
+\emph{divisor}, then calculates the dividend
+\begin{equation*}
+ \text{dividend}=\text{quotient}\times\text{divisor}
+\end{equation*}
+This leads to the assurance of a clean division problem with no nasty
+rounding, or infinite decimal expansions ($ 1/3 0.33333\dots $). It is a
+design decision made for the original \prodName, where the targeted audience was
+elementary school age students.
+
+The top is now the dividend and the bottom is the divisor, but in the
+\uif{Options} dialog box, \uif{Range Top} and
+\uif{Range Bottom} is replaced by \uif{Range
+Quotient} and \uif{Range Divisor} to reflect the different way
+of generating the division problem.
+
+\redpoint The dialog box retains the settings only during the current session
+of Adobe Reader. The Reader does not have the ability to save data so once
+the {\sprodName} is closed, the data is lost.
+
+\subsubsection{Toggle Keypad}\label{toggleKp}
+
+Selecting the \uif{Toggle Keypad} submenu item toggles the
+keypad, which is initially hidden, see
+\hyperref[menuKeypad]{Figure~\ref*{menuKeypad}}. The keyboard input region is
+changed to read only, the student can only enter through the keypad.
+
+The touch friendly keypad is larger by an amount of 5 points. This can be changed
+if you feel the touch friendly is not large enough by the command \cs{amtChngMouToTou}.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand\amtChngMouToTou{5}
+\end{Verbatim}
+The default definition is given above, use \cs{renewcommand} to change this,
+keeping in mind a larger keypad may go beyond the page. Some positioning
+adjustments may be needed.
+
+\begin{figure}[htb]
+\begin{center}\setlength{\fboxsep}{0pt}
+\fbox{\includegraphics[scale=1]{graphics/keypad}}\\
+\caption{The \texorpdfstring{\protect\uif{Keypad}}{Keypad}}\label{menuKeypad}
+\end{center}
+\end{figure}
+
+\subsubsection{About PDF Flash Card}\label{aboutFC}
+
+Some information about the {\prodName}.
+
+\subsection{The \texorpdfstring{\protect\cs{arithProb}}
+{\CMD{arithProb}} Command}
+
+The \cs{arithProb} command is a trio of form fields laid out to display an
+arithmetic problem, see
+\hyperref[arithprob]{Figure~\ref*{arithprob}},\begin{NoHyper}\footnote{Figure~\ref*{arithprob}
+shows an outline of the fields so you can see their relative
+positions.}\end{NoHyper} and \hyperref[fcannot]{Figure~\ref*{fcannot}},
+page~\pageref*{fcannot}.
+
+\begin{figure}[htb]
+\begin{center}\setlength{\fboxsep}{0pt}
+\fbox{\includegraphics[scale=1]{graphics/arithprob}}\\
+\caption{The \cs{arithProb} Command}\label{arithprob}
+\end{center}
+\end{figure}
+
+The three fields and their descriptions follow:
+\begin{itemize}
+ \item \texttt{top}: The name of this text field is \texttt{top}, and it
+ holds the upper most number in the problem (this number is called
+ by different names depending on the operation, we'll just call it
+ the top number).
+ \item \texttt{bottom}: The name of this text field is \texttt{bottom},
+ and it holds the lower number in the problem.
+ \item \texttt{operation}: The name of this text field is
+ \texttt{operation}.
+\end{itemize}
+The top and bottom fields use a monospace font (courier-bold) so that when
+there are decimal numbers involved, the numbers will align properly.
+
+\begin{figure}[htb]
+\begin{center}\setlength{\fboxsep}{0pt}
+\fbox{\includegraphics[scale=.5]{graphics/fc_annot}}\\
+\caption{The \prodName, Annotated}\label{fcannot}
+\end{center}
+\end{figure}
+
+
+
+\paragraph*{Appearance Parameters for \cs{arithProb}.} The three fields are
+bundled together as a unit, which makes it difficult to set the appearance of
+each individual field, unless you want to redefine \cs{arithProb}. There are,
+however, several commands available to make some adjustments to meet your
+needs.
+\begin{itemize}
+ \item \cs{tBGNoBorder}: This is a command that holds various
+ \textsf{eform} key-value pairs that are passed to these three
+ fields. The default definition of \cs{tBGNoBorder} is
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\tBGNoBorder}{\BC{}\BG{}\autoCenter{n}
+ \textSize{0}\textColor{1 0 0}\Ff\FfReadOnly}
+\end{Verbatim}
+ This set of parameters gives a field with transparent border and
+ background, auto-adjusting font size, red text, and with a readonly
+ attribute. This command can be redefined.
+ \item \cs{monoSpaceFont}: These three fields use a monospace font, you
+ can change this font using \cs{monoSpaceFont}. The default
+ definition is
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\monoSpaceFont}{CoBo}
+\end{Verbatim}
+ which is courier-bold.
+ \item \cs{setDimOf}: The \cs{setDimOf} can be used to set the
+ dimensions of these fields. The command takes three parameters,
+ field name, width and height. The default definitions for these
+ three fields are
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\setDimOf{top}{1in}{0.62in}
+\setDimOf{operation}{.38in}{.62in}
+\setDimOf{bottom}{1in}{0.62in}
+\end{Verbatim}
+Note that the dimensions of \texttt{top} and \texttt{bottom} are the same,
+as they are supposed to align vertically.
+\end{itemize}
+
+\subsection{The \texorpdfstring{\protect\cs{inputRegion}} {\CMD{inputRegion}} Command}
+
+When the keypad field is hidden (see the \Nameref{keypad}), the user inputs
+the response to the arithmetic problem into the field titled \texttt{result}.
+This field is placed on the flash card using the \cs{inputRegion} command;
+this field is usually placed immediately beneath the \cs{arithProb} command
+so that the \texttt{result} field is aligned vertically with the \texttt{top}
+and \texttt{bottom} fields.
+
+The syntax for \cs{inputRegion} is
+\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
+\inputRegion[!ameta(eform_parameters)]
+\end{Verbatim}
+The default appearance properties are pre-defined as
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\cBGNoBorder}{\Q{1}\BC{}\BG{}\autoCenter{n}
+ \textSize{0}\textColor{0 0 0}\BG{.75 .75 .75}
+ \Ff\FfReadOnly}
+\end{Verbatim}
+You can redefine \cs{cBGNoBorder}, or you can introduce a few changes through
+the optional parameter.
+
+The dimensions of the \texttt{result} fields can be set using \cs{setDimOf}.
+The default definition is
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\setDimOf{result}{1.38in}{0.62in}
+\end{Verbatim}
+The \texttt{0.62in} is the same width used for the \texttt{top} and \texttt{bottom} fields.
+
+\subsection{The \texorpdfstring{\protect\cs{startAgain}}{\CMD{startAgain}}
+ and \texorpdfstring{\protect\cs{newCard}} {\CMD{newCard}} Command}\label{startAgainnewCard}
+
+The \cs{newCard} command generates a push button named \texttt{NewProblem},
+when pushed, a new arithmetic is randomly generated. The \cs{startAgain}
+command creates a push button named \texttt{StartAgain}, when pushed, all
+fields are cleared, and any JS variables are re-initialized. The syntax for
+these two fields is
+\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
+\startAgain[!ameta(eform_parameters)]
+\newCard[!ameta(eform_parameters)]
+\end{Verbatim}
+The default appearance properties are pre-defined as
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\tBGNoBorderI}{\BC{}\BG{}\autoCenter{n}
+ \textSize{0}\textColor{1 0 0}}
+\end{Verbatim}
+You can redefine \cs{tBGNoBorderI}, or you can introduce a few changes
+through the optional parameter.
+
+The dimensions of \texttt{NewProblem} and \texttt{StartAgain} can be set
+using \cs{setDimOf}. The default definition is
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\setDimOf{StartAgain}{0.88in}{0.62in}
+\setDimOf{NewProblem}{0.88in}{0.62in}
+\end{Verbatim}
+The text font used by these two fields is determined by the command
+\cs{fieldFont}. The default definition of \cs{fieldFont} is
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\fieldFont}{Helv}
+\end{Verbatim}
+The name for the font should be one of the 13 basic fonts, or a PostScript
+font. In the latter case, most likely, the Acrobat Distiller is needed for
+PDF creation.
+
+\subsection{The \texorpdfstring{\protect\cs{alertbox}}{\CMD{alertbox}} Command}\label{alertbox}
+
+The \cs{alertbox} command creates a transparent text field named
+\texttt{alertbox}, which displays \uif{Right!} and \uif{Wrong!}
+messages. The syntax for this field is
+\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
+\alertbox[!ameta(eform_parameters)]
+\end{Verbatim}
+The default appearance properties are pre-defined as
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\tBGNoBorder}{\BC{}\BG{}\autoCenter{n}
+ \textSize{0}\textColor{1 0 0}\Ff\FfReadOnly}
+\end{Verbatim}
+You can redefine \cs{tBGNoBorder}, or you can introduce a few changes through
+the optional parameter.
+
+The dimensions of \texttt{alertbox} can be set using \cs{setDimOf}. The default definition is
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\setDimOf{alertbox}{.88in}{.62in}
+\end{Verbatim}
+
+\subsection{The \texorpdfstring{\protect\cs{Keypad}}{\CMD{Keypad}} Command}\label{keypad}
+
+The \cs{Keypad} creates a number of fields in the form of a keypad, see
+\hyperref[keypad]{Figure~\ref*{keypad}}. When the keypad is visible, the
+result field (created by \cs{inputRegion}) is read-only.
+
+\begin{figure}[htb]
+\begin{quote}
+\settowidth{\totaltextwidth}{Figure 0: The Keypad}
+\begin{minipage}{\totaltextwidth}\centering
+\setlength{\fboxsep}{0pt}
+\fbox{\includegraphics[scale=.6]{graphics/keypad}}\\
+\caption{The Keypad}\label{keypad}
+\end{minipage}
+\end{quote}
+\end{figure}
+
+\newtopic\noindent
+The default appearance properties are pre-defined as
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\tBGNoBorder}{\BC{}\BG{}\autoCenter{n}
+ \textSize{0}\textColor{1 0 0}\Ff\FfReadOnly}
+\end{Verbatim}
+You can redefine \cs{tBGNoBorder}, or you can introduce a few changes through the optional parameter.
+
+The dimension of each key is based on the value of \cs{szNum}, the default definition is
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\szNum}{14bp}
+\end{Verbatim}
+The default appearance properties are pre-defined as
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\myNumPadI}{\F\FHidden\autoCenter{n}
+ \textSize{8}\textFont{\fieldFont}\S{S}}
+\end{Verbatim}
+You can redefine \cs{myNumPadI}.
+
+The labeling for the \uif{Enter} and \uif{Back} keys can be redefined as well, their definitions are
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\kpBack}{Back}
+\newcommand{\kpEnter}{Enter}
+\end{Verbatim}
+
+\subsection{The \texorpdfstring{\protect\cs{cbTiming}}{\CMD{cbTiming}} Command}\label{cbTiming}
+
+The \cs{cbTiming} command creates a combo box, named \texttt{TimeDelay}, that
+lists a menu of time values for the user to practice against. The default is
+\uif{No Timing}.
+
+\paragraph*{Rules for Timed Responses.} When \uif{No Timing} is in effect,
+if the student correctly answers the problem in the time allotted, credit is
+awarded; otherwise, no credit is given. When another time setting is in
+effect, the same rule applies as above, except no credit is awarded if the
+time is up, even if the response is correct. Click on the push button labeled
+\uif{Timed Scores} to see the rules for awarding the points, depicted in Figure~\ref*{fig:timedscores}.
+
+\begin{figure}[htb]\centering
+\setlength{\fboxsep}{0pt}
+\fbox{\includegraphics[scale=.6]{graphics/timedscores}}\\
+\caption{The timed scores dialog box}\label{fig:timedscores}
+\end{figure}
+
+The strings of this dialog box may be localize to another language, refer to \hyperref[s:CusStrs]{Section~\ref*{s:CusStrs}}
+for details.
+
+\newtopic\noindent\textbf{Note:} The original idea behind the timed scores is to have
+students compete against each other. For example, for addition, let each
+student attempt $10$ problems, the highest score wins! Try this with
+\uif{No Timing} first, then start decreasing the time value
+progressively down to $5\,\text{sec}$. Who is the fastest with the mostest!
+
+The syntax for \cs{cbTiming} is
+\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
+\cbTiming[!ameta(eform_parameters)]
+\end{Verbatim}
+The default appearance properties are pre-defined as
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\cBGBorder}{\BC{0 0 0}\BG{.75 .75 .75}
+ \autoCenter{n}\textSize{0}\textColor{0 0 0}}
+\end{Verbatim}
+You can redefine \cs{cBGBorder}, or you can introduce a few changes through
+the optional parameter.
+
+The dimensions of \texttt{TimeDelay} field can be set using \cs{setDimOf}:
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\setDimOf{TimeDelay}{0.9in}{0.24in}
+\end{Verbatim}
+The font used in the list box is determined by the value of \cs{fieldFont},
+the default definition is \verb!\newcommand{\fieldFont}{Helv}!.
+
+The string \uif{No Timing} can be modified using \cs{fcNoTiming}:
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\fcNoTiming}{No Timing}
+\end{Verbatim}
+
+
+\subsection{The \texorpdfstring{\protect\cs{ansField}}{\CMD{ansField}} Command}\label{ansField}
+
+The \cs{ansField} creates a text field named \texttt{ansregion}; the field
+holds the correct answer to the problem.
+
+The syntax for \cs{cbTiming} is
+\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
+\ansField[!ameta(eform_parameters)]
+\end{Verbatim}
+The appearance of this field can be modified using \cs{cBGNoBorder}; the default definition is,
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\cBGNoBorder}{\Q{1}\BC{}\BG{}\autoCenter{n}
+ \textSize{0}\textColor{0 0 0}\BG{.75 .75 .75}\Ff\FfReadOnly}
+\end{Verbatim}
+This can be redefined as desired.
+
+The dimensions of \texttt{ansregion} can be set be \cs{setDimOf}:
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\setDimOf{ansregion}{.87in+10bp}{.24in}
+\end{Verbatim}
+Notice that a little arithmetic on dimensions is used, this is because the
+\textsf{fc\_arith} package inputs the \textsf{calc} package.
+
+The \texttt{ansregion} has a formatting string, it prepends \texttt{Answer:}
+to the correct answer. You can change this word using the command
+\cs{fmtAnswer} the definition of which is
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\fmtAnswer}{Answer:}
+\end{Verbatim}
+
+\subsection{The \texorpdfstring{\protect\cs{cbOperation}}{\CMD{cbOperation}} Command}\label{cbOperation}
+
+The \cs{cbOperation} command creates a combo box, named
+\texttt{ChooseOperation}, that lists a menu of arithmetic operations for the
+user to select.
+
+The syntax for \cs{cbOperation} is
+\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
+\cbOperation[!ameta(eform_parameters)]
+\end{Verbatim}
+The default appearance properties are pre-defined as
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\cBGBorder}{\BC{0 0 0}\BG{.75 .75 .75}
+ \autoCenter{n}\textSize{0}\textColor{0 0 0}}
+\end{Verbatim}
+You can redefine \cs{cBGBorder}, or you can introduce a few changes through
+the optional parameter.
+
+The dimensions of \texttt{ChooseOperation} field can be set using \cs{setDimOf}:
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\setDimOf{ChooseOperation}{1.38in-10bp}{0.24in}
+\end{Verbatim}
+The font used in the list box is determined by the value of \cs{fieldFont},
+the default definition is \verb!\newcommand{\fieldFont}{Helv}!.
+
+The strings used in the combo box can be modified by redefining the following commands:
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\fcAddition}{Addition}
+\newcommand{\fcSubtraction}{Subtraction}
+\newcommand{\fcMultiplication}{Multiplication}
+\newcommand{\fcDivision}{Division}
+\end{Verbatim}
+
+\subsection{The \texorpdfstring{\protect\cs{statsFields}}{\CMD{statsFields}} Command}\label{statsFields}
+
+The \cs{statsField} command creates a number of fields that hold the
+statistics of the user's attempts at answering arithmetic problems.
+
+The following definitions are used.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\setDimOf{fcSF}{0.37in}{0.25in}
+\newcommand{\statsFieldOpColor}{1 0 0}
+\newcommand{\statsFieldColor}{blue}
+\end{Verbatim}
+The first is to set the dimensions of each field, they all have the same
+dimension. The second sets the color for the operations of $+$, $-$, $\times$
+and \char247; the default color for the labeling of these operations is red
+(\verb!{1 0 0}! in the RGB color space. The \cs{statsFieldColor} is a color
+of typeset content and its default is \texttt{blue}. (\cs{statsFieldOpColor}
+is used in form fields, while \cs{statsFieldColor} is {\LaTeX}ed.)
+
+\section{Other Customizations}
+
+In this section, we itemize various other customizations not already mentioned.
+
+\subsection{Setting the Range and Decimal}
+
+The command \cs{DeclareArithParams}---executed in the preamble only---is
+used to set the start-up parameters of the \uif{Options} menu
+\hyperref[menuOptions]{Figure~\ref*{menuOptions}} on
+page~\pageref*{menuOptions}.\footnote{If the \texttt{nomenu} option is
+taken, the parameters are still used, but user has no way of changing
+them.}
+
+The \cs{DeclareArithParams} takes a series of key-values. We classify the
+keys by function: setting the intervals and setting the decimal places.
+\begin{itemize}
+ \item \textbf{Setting the intervals.} Each of these keys takes an
+ interval of the form \texttt{[a,b]}. Because there is a comma in the
+ interval notation, the interval needs to be enclosed in braces, like
+ so \verb!{[a,b]}!.
+ \begin{itemize}
+ \item \textbf{Addition:} \verb!addT={[a,b]}!, \verb!addB={[a,b]}!
+ \item \textbf{Subtraction:} \verb!subT={[a,b]}!, \verb!subB={[a,b]}!
+ \item \textbf{Multiplication:} \verb!mulT={[a,b]}!, \verb!mulB={[a,b]}!
+ \item \textbf{Division:} \verb!divQ={[a,b]}!, \verb!divB={[a,b]}!
+ \end{itemize}
+ \item {Setting the decimal places.} The value of these keys take any
+ of three values \texttt{none}, \texttt{1}, or \texttt{2}. In all
+ cases, the default is \texttt{none}.
+ \begin{itemize}
+ \item \textbf{Addition:} \verb!addDecT=none|1|2!, \verb!addDecB=none|1|2!
+ \item \textbf{Subtraction:} \verb!subDecT=none|1|2!, \verb!subDecB=none|1|2!
+ \item \textbf{Multiplication:} \verb!mulT=none|1|2!, \verb!mulDecB=none|1|2!
+ \item \textbf{Division:} \verb!divDecQ=none|1|2!, \verb!divDecB=none|1|2!
+ \end{itemize}
+\end{itemize}
+
+The default definitions are
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\DeclareArithParams
+{%
+ addT={[0,100]},addB={[0,100]},
+ subT={[0,100]},subB={[0,100]},
+ mulT={[0,100]},mulB={[0,10]},
+ divQ={[0,10]},divB={[0,10]},
+}
+\end{Verbatim}
+The decimal points are all set to \texttt{none}, by default.
+
+\newtopic\noindent Below is a complete example of setting all parameters.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\DeclareArithParams
+{%
+ addT={[2,20]},addB={[5,30]},
+ addDecT=none,addDecB=2,
+ subT={[1,5]},subB={[5,10]},
+ subDecT=1,subDecB=2,
+ mulT={[1,12]},mulB={[1,10]},
+ mulDecT=1,mulDecB=2,
+ divQ={[1,4]},divB={[1,10]},
+ divDecQ=1,divDecB=2,
+}
+\end{Verbatim}
+
+\subsection{Customization Strings}\label{s:CusStrs}
+
+The following English strings are used in {\sprodName}. These can all be redefined.
+
+\newtopic\noindent The following is a message that appears in an alert box when your time is up.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\timeUpMsg}{Your Time is UP!}
+\end{Verbatim}
+These next two are the default messages in the \texttt{alertbox} text field.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\rightMsg}{Right!}
+\newcommand{\wrongMsg}{Wrong!}
+\end{Verbatim}
+The text on the \texttt{StartAgain} and \texttt{NewProblem}.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\startAgainMsg}{Start Again}
+\newcommand{\newCardMsg}{New Card}
+\end{Verbatim}
+The formatting of the \texttt{ansfield}.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\fmtAnswer}{Answer:}
+\end{Verbatim}
+Labels that appear on the key pad.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\kpBack}{Back}
+\newcommand{\kpEnter}{Enter}
+\end{Verbatim}
+The default setting for the \texttt{TimeDelay} combo box.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\fcNoTiming}{No Timing}
+\end{Verbatim}
+The listing of arithmetic operations in to combo box titled \texttt{ChooseOperation}.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\fcAddition}{Addition}
+\newcommand{\fcSubtraction}{Subtraction}
+\newcommand{\fcMultiplication}{Multiplication}
+\newcommand{\fcDivision}{Division}
+\end{Verbatim}
+The text of the menu that, by default, appears in the upper left-corner.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\fcSettings}{Settings}
+\renewcommand\fcOptionsMenuItemTitle{Options}
+\renewcommand\fcToggleKeypadMenuItemTitle{Toggle Keypad}
+\renewcommand\fcMouseKPMenuItemTitle{Touch Friendly Keypad}
+\renewcommand\fcTouchKPMenuItemTitle{Mouse Friendly Keypad}
+\renewcommand\fcAboutFCTitle{About PDF Flash Cards}
+\end{Verbatim}
+Some text strings that are part of the \cs{statsField} set.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand{\toggleKeypad}{Toggle Keypad}
+\newcommand{\operation}{Operation}
+\newcommand{\numCorrect}{Number Correct}
+\newcommand{\numAttempted}{Number Attempted}
+\newcommand{\percentCorrect}{Percentage Correct}
+\newcommand{\timedScores}{Timed Scores}
+\end{Verbatim}
+Some strings in the timed scores dialog box (Figure~\ref{fig:timedscores}).
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\def\fctCharWidth{22}
+\def\fctInstr{"Points are awarded, based on time,
+ for successfully solving a problem:"}
+\def\fctTimeElapsed{"Time elapsed"}
+\def\fctPoints{"Points"}
+\def\fctLessThanV{"Less than 5 sec"}
+\def\fctLessThanVPoints{6}
+\def\fctBtwnVAndX{"Between 5 and 10 sec"}
+\def\fctBtwnVAndXPoints{5}
+\def\fctBtwnXAndXV{"Between 10 and 15 sec"}
+\def\fctBtwnXAndXVPoints{4}
+\def\fctBtwnXVAndXX{"Between 15 and 20 sec"}
+\def\fctBtwnXVAndXXPoints{3}
+\def\fctBtwnXXAndXXV{"Between 20 and 25 sec"}
+\def\fctBtwnXXAndXXVPoints{2}
+\def\fctGtrXXV{"Greater than 25 sec"}
+\def\fctGtrXXVPoints{1}
+\end{Verbatim}
+The following are the strings used for the naming the clusters of the \uif{Settings > Options} menu.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand\fcAdditionName{\fcAddition}
+\newcommand\fcSubtractionName{\fcSubtraction}
+\newcommand\fcMultiplicationName{\fcMultiplication}
+\newcommand\fcDivisionName{\fcDivision}
+\end{Verbatim}
+If the \uif{Settings} control is available, but the \env{MenuFC} environment was not
+used to create any menu items, an alert box appears when the use presses the
+\uif{Settings} control with the following message on it.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand\fcMenuFCMsg{No menu items to display}
+\end{Verbatim}
+Various tool tips that appear on various controls.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand\toggleKeyPadBtnColor{0 0 1}
+\newcommand\toggleKeyPadBtnTooltip{Click to toggle keypad,
+ shift-click to toggle between mouse and touch keypads}
+\newcommand{\fcSettingsTooltip}{Click for a dropdown menu
+ of menu choices}
+\newcommand{\cbTimingToolip}{Select a time challenge from
+ the dropdown menu}
+\newcommand{\cbOperationTooltip}{Choose an arithmetic
+ operation to practice}
+\newcommand{\timeScoresTooltip}{Click to see how points
+ are assigned}
+\end{Verbatim}
+The strings to localize the \uif{Timed Scores} dialog box. You may have to increase
+the value of \cs{fcOptTextWidth} from 80 (pixels) to something larger if your language strings
+are much longer than their English counterparts.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+\newcommand\fcOptTextWidth{80}
+\newcommand\fcOptTopRange{Range Top}
+\newcommand\fcOptBottomRange{Range Bottom}
+\newcommand\fcOptTopRangeDiv{Range Quotient}
+\newcommand\fcOptBottomRangeDiv{Range Divisor}
+\newcommand\fcOptTo{ to }
+\newcommand\fcOptAllowNegNumber{Allow Negative Subtraction}
+\newcommand\fcOptDecimal{Decimals:}
+\newcommand\fcOptDecimalNone{none}
+\end{Verbatim}
+All this customization commands are listed in \texttt{fc-strings.txt}. There they can be
+redefined and copy and pasted into the file \texttt{fc\_custom.def}.
+
+\newtopic\noindent\textbf{\textcolor{red}{Customization.}} Any change in language
+strings can be put in the file \texttt{fc\_custom.def}. Such a file is input,
+if found, at the end of the package.
+
+\section{Suggested Layout}
+
+The files \texttt{fc-acrobat.tex} and \texttt{fc-noacrobat.tex} contain the
+original layout of {\prodName}. We include that layout in this manual for
+completeness sake.
+
+\begin{Verbatim}[fontsize=\small]
+%
+% Design your own title
+%
+\begin{center}
+{%
+ \LARGE\bfseries\color{blue}PDF Flash Cards\\[1ex]
+ Elementary Arithmetic
+}
+
+%
+% The arithmetic problem, \arithProb: top, bottom and operation.
+% This command is REQUIRED. This command generates three text fields
+% stacked so that form a standard arithmetic
+%
+
+\arithProb
+
+%
+% \alertbox is a text field where a right or wrong message is
+% written--REQUIRED
+%
+% \startAgain clears the statistics field, re-initializes a
+% variables--REQUIRED
+%
+% \inputRegion is where the user enters his/her answer--REQUIRED
+%
+% \Keypad allows user to enter answer with mouse--OPTIONAL
+%
+% \newCard random selects a new arithmetic problem (add, sub, mul, div)
+% depending on the combo box \cbOperation, described below--REQUIRED
+%
+% These components can be moved around to a new design, though I don't
+% know what that would be. I have no imagination for design myself.
+%
+\mbox{\vbox{\smash{\alertbox}\startAgain}\fcSep
+ \inputRegion\fcSep\vbox{\smash{\raisebox{4bp}{\Keypad}}\newCard}}
+
+\medskip
+%
+% \cbTiming is combo box use to set a time limit on answer the
+% problem--OPTIONAL
+%
+% There is also a package option, notimedscores, that removes timing
+% calculations from the PDF, no statistics, no alerts. The option
+% notimedscores makes the combo box created y \cbTiming into a readonly
+% field.
+%
+% \ansField is the field the user enters his/her answer into---REQUIRED
+%
+% \cbOperation a combo box to select what operation to use---REQUIRED
+%
+\mbox{\cbTiming\fcSep\ansField\fcSep\cbOperation}
+
+\medskip
+
+%
+% This calculation computes the width of the previous row of fields, and
+% sets \fcWidth, a dimension in this package, to that width.
+%
+\settowidth{\fcWidth}{\cbTiming\fcSep\ansField\fcSep\cbOperation}
+%
+% \statsFields is a collection of text fields to display user
+% statistics---OPTIONAL
+%
+\makebox[\fcWidth][s]{\statsFields}
+
+\end{center}
+\end{Verbatim}
+\end{document}
+
+Added
+\newcommand\toggleKeyPadBtnColor{0 0 1}
+\newcommand\toggleKeyPadBtnTooltip{Click to toggle keypad, shift-click
+ to toggle between mouse and touch keypads}
+\newcommand{\fcSettingsTooltip}{Click for a dropdown menu of menu choices}
+\newcommand{\cbTimingToolip}{Select a time challenge from the dropdown menu}
+\newcommand{\cbOperationTooltip}{Choose an arithmetic operation to practice}
+\newcommand{\timeScoresTooltip}{Click to see how points are assigned}
+
+\newcommand\fcOptTextWidth{80}
+\newcommand\fcOptTopRange{Range Top}
+\newcommand\fcOptBottomRange{Range Bottom}
+\newcommand\fcOptTopRangeDiv{Range Quotient}
+\newcommand\fcOptBottomRangeDiv{Range Divisor}
+\newcommand\fcOptTo{ to }
+\newcommand\fcOptAllowNegNumber{Allow Negative Subtraction}
+\newcommand\fcOptDecimal{Decimals:}
+\newcommand\fcOptDecimalNone{none}
+
+\newcommand\fcMenuFCMsg{No menu items to display}
diff --git a/texmf-dist/source/latex/fc-arith/fc_arith.dtx b/texmf-dist/source/latex/fc-arith/fc_arith.dtx
new file mode 100644
index 00000000..bb32ebba
--- /dev/null
+++ b/texmf-dist/source/latex/fc-arith/fc_arith.dtx
@@ -0,0 +1,2186 @@
+%\iffalse
+%<*copyright>
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% fc_arith.sty package, %%
+%% Copyright (C) 1999-2017 D. P. Story %%
+%% dpstory@uakron.edu %%
+%% %%
+%% This program can redistributed and/or modified under %%
+%% the terms of the LaTeX Project Public License %%
+%% Distributed from CTAN archives in directory %%
+%% macros/latex/base/lppl.txt; either version 1.2 of %%
+%% the License, or (at your option) any later version. %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%</copyright>
+%<package>\NeedsTeXFormat{LaTeX2e}[1997/12/01]
+%<package>\ProvidesPackage{fc_arith}
+%<package> [2017/01/16 v1.0f fc_arith: PDF flash cards for arithmetic drill (dps)]
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage[colorlinks,hyperindex=false]{hyperref}
+%\def\texorpdfstring#1#2{#1}
+%\pdfstringdefDisableCommands{\let\\\textbackslash}
+\OnlyDescription % comment out for implementation details
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\InputIfFileExists{aebdocfmt.def}{\PackageInfo{fc_arith}{Inputting aebdocfmt.def}}
+ {\def\IndexOpt{\DescribeMacro}\def\IndexKey{\DescribeMacro}\let\setupFullwidth\relax
+ \PackageInfo{fc_arith}{aebdocfmt.def cannot be found}}
+\begin{document}
+\def\CMD#1{\textbackslash#1}
+ \GetFileInfo{fc_arith.sty}
+ \title{fc\_arith: Flash Cards for Arithmetic}
+ \author{D. P. Story\\
+ Email: \texttt{dpstory@uakron.edu}}
+ \date{processed \today}
+ \maketitle
+ \tableofcontents
+ \DocInput{fc_arith.dtx}
+\IfFileExists{\jobname.ind}{\newpage\setupFullwidth\par\PrintIndex}{\paragraph*{Index} The index goes here.\\Execute
+ \texttt{makeindex -s gind.ist -o fc\_arith.ind fc\_arith.idx} on the command line and recompile
+ \texttt{fc\_arith.dtx}.}
+\IfFileExists{\jobname.gls}{\PrintChanges}{\paragraph*{Change History} The list of changes goes here.\\Execute
+ \texttt{makeindex -s gglo.ist -o fc\_arith.gls fc\_arith.glo} on the command line and recompile
+ \texttt{fc\_arith.dtx}.}
+\end{document}
+%</driver>
+% \fi
+% \MakeShortVerb{|}
+% \InputIfFileExists{aebdonotindex.def}{\PackageInfo{web}{Inputting aebdonotindex.def}}
+% {\PackageInfo{web}{cannot find aebdonotindex.def}}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%\section{Package Options}
+% \begin{macrocode}
+\RequirePackage{xkeyval}
+\RequirePackage{ifxetex}
+\RequirePackage{calc}
+\let\fc@YES=y \let\fc@NO=n
+% \end{macrocode}
+% The original\IndexOpt{allownegsub} arithmetic flash cards did not allow a negative difference,
+% if this option is used, the differences are allowed to be negative.
+% \changes{v1.0}{2016/12/03}{Put Allow Subtraction in Options menu}
+% \changes{v1.0f}{2017/01/16}{Incorporated \string\cs{olBdry} into code, using eforms dated 2017/01/15}
+% \begin{macrocode}
+\DeclareOptionX{allownegsub}{\def\fcAllowNegSub{true}}
+\def\fcAllowNegSub{false}
+% \end{macrocode}
+% \begin{macro}{nomenu}
+% The menu allows to user to change the range of the numbers, using this
+% option removes the menu.
+% \begin{macrocode}
+\DeclareOptionX{nomenu}{\let\fc@usemenu\fc@NO}
+\let\fc@usemenu\fc@YES
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{operations}
+% Give the ability to declare what operations FC should show. Supported operations
+% are add, sub, mul, div. The default is all operations.
+% \begin{macrocode}
+\DeclareOptionX{operations}[add,sub,mul,div]{\def\fc@operations{#1}}
+\def\fc@operations{add,sub,mul,div}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{showkeypadlink}
+% If the \texttt{nomenu} option is taken, you can select the \texttt{showkepadlink} so the
+% user can toggle the keypad.
+% \begin{macrocode}
+\DeclareOptionX{showkeypadlink}{\let\fc@keypadlink\fc@YES}
+\let\fc@keypadlink\fc@NO
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{notimedscores}
+% Do not tally timed scores. Some may not want the pressure!
+% \begin{macrocode}
+\DeclareOptionX{notimedscores}{%
+ \def\fcTimedScores{false}
+ \let\fc@timedscores\fc@NO
+}
+\def\fcTimedScores{true}
+\let\fc@timedscores\fc@YES
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\ProcessOptionsX
+\RequirePackage{eforms}[2017/01/15]
+\RequirePackage{popupmenu}
+% \end{macrocode}
+%\section{Main Code}
+% \begin{macrocode}
+\newdimen\fcWidth
+% \end{macrocode}
+% The keys for the \texttt{fcopera} family are defined here. These are used
+% with the \texttt{operations} option. These define the \texttt{add},
+% \texttt{sub}, \texttt{mul}, and \texttt{div} operations.
+% \begin{macrocode}
+\define@boolkey{fcopera}{add}[true]{}
+\define@boolkey{fcopera}{sub}[true]{}
+\define@boolkey{fcopera}{mul}[true]{}
+\define@boolkey{fcopera}{div}[true]{}
+% \end{macrocode}
+% We take the macro \cs{fc@operations} defined by the \texttt{operations} option, set
+% the corresponding keys for the \texttt{fcopera} family.
+% \begin{macrocode}
+\edef\fc@expand{\noexpand\setkeys{fcopera}{\fc@operations}}\fc@expand
+% \end{macrocode}
+% \begin{macro}{\DeclareArithParams}
+% The builder of this arithmetic flash cards can hard-wire the ranges. Here is an
+% example of usage:
+%\begin{verbatim}
+%\DeclareArithParams
+%{%
+% addT={[2,20]},addB={[5,30]},
+% addDecT=none,addDecB=2,
+% subT={[1,5]},subB={[5,10]},
+% subDecT=1,subDecB=2,
+% mulT={[1,12]},mulB={[1,10]},
+% mulDecT=1,mulDecB=2,
+% divQ={[1,4]},divB={[1,10]},
+% divDecQ=1,divDecB=2
+%}
+%\end{verbatim}
+% Below are defined the keys used by \cs{DeclareArithParams}.
+% \begin{macrocode}
+\define@key{fcarithparams}{addT}[{[0,100]}]{\def\fcAddTParams{#1}}
+\define@key{fcarithparams}{addB}[{[0,100]}]{\def\fcAddBParams{#1}}
+\define@choicekey{fcarithparams}{addDecT}[\val\nr]{none,1,2}[none]{%
+ \edef\fcaddDecT{\nr}}{}
+\define@choicekey{fcarithparams}{addDecB}[\val\nr]{none,1,2}[none]{%
+ \edef\fcaddDecB{\nr}}{}
+\define@key{fcarithparams}{subT}[{[0,100]}]{\def\fcSubTParams{#1}}
+\define@key{fcarithparams}{subB}[{[0,100]}]{\def\fcSubBParams{#1}}
+\define@choicekey{fcarithparams}{subDecT}[\val\nr]{none,1,2}[none]{%
+ \edef\fcsubDecT{\nr}}{}
+\define@choicekey{fcarithparams}{subDecB}[\val\nr]{none,1,2}[none]{%
+ \edef\fcsubDecB{\nr}}{}
+\define@key{fcarithparams}{mulT}[{[0,100]}]{\def\fcMulTParams{#1}}
+\define@key{fcarithparams}{mulB}[{[0,10]}]{\def\fcMulBParams{#1}}
+\define@choicekey{fcarithparams}{mulDecT}[\val\nr]{none,1,2}[none]{%
+ \edef\fcmulDecT{\nr}}{}
+\define@choicekey{fcarithparams}{mulDecB}[\val\nr]{none,1,2}[none]{%
+ \edef\fcmulDecB{\nr}}{}
+\define@key{fcarithparams}{divQ}[{[0,10]}]{\def\fcDivQParams{#1}}
+\define@key{fcarithparams}{divB}[{[0,10]}]{\def\fcDivBParams{#1}}
+\define@choicekey{fcarithparams}{divDecQ}[\val\nr]{none,1,2}[none]{%
+ \edef\fcdivDecQ{\nr}}{}
+\define@choicekey{fcarithparams}{divDecB}[\val\nr]{none,1,2}[none]{%
+ \edef\fcdivDecB{\nr}}{}
+% \end{macrocode}
+% We set the defaults for these keys.
+% \begin{macrocode}
+\setkeys{fcarithparams}{addT,addB,subT,subB,mulT,mulB,divQ,divB,%
+ addDecT,addDecB,subDecT,subDecB,mulDecT,mulDecB,divDecQ,divDecB}
+\newcommand{\DeclareArithParams}[1]{\setkeys{fcarithparams}{#1}}
+\@onlypreamble\DeclareArithParams
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\timeUpMsg}
+% \begin{macro}{\rightMsg}
+% \begin{macro}{\wrongMsg}
+% \begin{macro}{\startAgainMsg}
+% \begin{macro}{\newCardMsg}
+% Strings that can be redefined; the meanings are obvious.
+% \begin{macrocode}
+\newcommand{\timeUpMsg}{Your Time is UP!}
+\newcommand{\rightMsg}{Right!}
+\newcommand{\wrongMsg}{Wrong!}
+\newcommand{\startAgainMsg}{Start Again}
+\newcommand{\newCardMsg}{New Card}
+\newcommand{\toggleKeypad}{Toggle Keypad}
+\newcommand{\operation}{Operation}
+\newcommand{\numCorrect}{Number Correct}
+\newcommand{\numAttempted}{Number Attempted}
+\newcommand{\percentCorrect}{Percentage Correct}
+\newcommand{\timedScores}{Timed Scores}
+\newcommand{\fmtAnswer}{Answer:}
+\newcommand{\kpDec}{.}
+\newcommand{\kpMinus}{-}
+\newcommand{\kpBack}{Back}
+\newcommand{\kpEnter}{Enter}
+\newcommand{\fcNoTiming}{No Timing}
+\newcommand{\fcAddition}{Addition}
+\newcommand{\fcSubtraction}{Subtraction}
+\newcommand{\fcMultiplication}{Multiplication}
+\newcommand{\fcDivision}{Division}
+\newcommand{\fcSettings}{Settings}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\FCMenu}
+% This is the menu system, it is normally placed in the running header
+% on the left, though this can be changed.
+% \begin{macrocode}
+\newcommand{\fcSettingsColor}{0 0 0}
+\newcommand{\fcSettingsTooltip}{Click for a dropdown menu
+ of menu choices}
+\newcommand{\FCMenu}{\smash{\hbox{\pushButton[\textSize{8}\H{O}
+ \textColor{\fcSettingsColor}
+ \CA{\fcSettings\space}\S{S}\BC{}\BG{}\TU{\fcSettingsTooltip}
+ \A{\JS{processFcMenu();}}]{fcSettingsBtn}{}{11bp}\kern0pt}}}
+%\newcommand{\FCMenu}{\mbox{\setLinkText[\linktxtcolor{\fcSettingsColor}
+% \A{\JS{processFcMenu();}}]{\fcSettings}}}
+ \ifx\fc@usemenu\fc@YES\lheader{\FCMenu}\rheader{}\else
+\lheader{}\rheader{}\fi
+% \end{macrocode}
+% \begin{environment}{MenuFC}
+% We set up a \texttt{fcMenu} environment for specifying menu items. This is to be sure
+% the name of the popup menu is correct, we expect a name of `fcMenu'
+% as the argument of \texttt{popupmenu} environment.
+% \changes{v0.99}{2016/12/02}{Added new environment}
+% \begin{macrocode}
+\newenvironment{MenuFC}{\begin{popupmenu}{fcMenu}}
+{\end{popupmenu}}
+\def\fcMenu{// No menu items selected in the MenuFC environment}
+% \end{macrocode}
+% \end{environment}
+% We set up some standard menu items, these are referred by their command names:
+%\begin{verbatim}
+% \begin{fcMenu}
+% \fcOptionsMenuItem
+% \fcToggleKeypadMenuItem
+% \fcMouseKPMenuItem
+% \fcTouchKPMenuItem
+% \fcAboutFC
+% \end{fcMenu}
+%\end{verbatim}
+%The five commands listed above and defined below should not be redefined; however their
+%title fields are accessible through the commands ending in `\texttt{Title}' below.
+%\changes{v0.99}{2016/12/02}{Add commands to customize the menu}
+% \begin{macrocode}
+\def\fcOptionsMenuItem{\item{title=\fcOptionsMenuItemTitle,return=0}}
+% \end{macrocode}
+% \DescribeMacro{\fcOptionsMenuItemTitle} is the title for the `Options' menu item
+% \begin{macrocode}
+\newcommand\fcOptionsMenuItemTitle{Options}
+\def\fcToggleKeypadMenuItem{\item{title=\fcToggleKeypadMenuItemTitle,%
+ marked=false,return=1}}
+% \end{macrocode}
+% \DescribeMacro{\fcToggleKeypadMenuItemTitle} is the title for the `Keypad' menu item
+% \begin{macrocode}
+\newcommand\fcToggleKeypadMenuItemTitle{Toggle Keypad}
+\def\fcTouchKPMenuItem{\item{title=\fcTouchKPMenuItemTitle,%
+ marked=false,enabled=false,return=3}}
+% \end{macrocode}
+% \DescribeMacro{\fcTouchKPMenuItemTitle} is the title for the `Touch keypad' menu item
+% \begin{macrocode}
+\newcommand\fcTouchKPMenuItemTitle{Touch Friendly Keypad}
+\def\fcMouseKPMenuItem{\item{title=\fcMouseKPMenuItemTitle,%
+ marked=true,enabled=false,return=4}}
+% \end{macrocode}
+% \DescribeMacro{\fcMouseKPMenuItemTitle} is the title for the `Mouse keypad' menu item
+% \begin{macrocode}
+\newcommand\fcMouseKPMenuItemTitle{Mouse Friendly Keypad}
+\def\fcAboutFC{\item{title=\fcAboutFCTitle, return=2}}
+% \end{macrocode}
+% \DescribeMacro{\fcAboutFCTitle} is the title for the `About' menu item
+% \begin{macrocode}
+\newcommand\fcAboutFCTitle{About PDF Flash Cards}
+% \end{macrocode}
+% \end{macro}
+% \subsection{The form fields}
+% \begin{macro}{\tBGNoBorder}
+% \begin{macro}{\tBGNoBorderI}
+% \begin{macro}{\cBGNoBorder}
+% \begin{macro}{\cBGBorder}
+% \begin{macro}{\myNumPad}
+% Some preset formatting for the various fields. May be redefined.
+% \begin{macrocode}
+\newcommand{\tBGNoBorder}{\BC{}\BG{}\autoCenter{n}\textSize{0}
+ \textColor{1 0 0}\Ff\FfReadOnly}
+\newcommand{\tBGNoBorderI}{\BC{}\BG{}\autoCenter{n}\textSize{0}
+ \textColor{0 0 0}}
+\newcommand{\cBGNoBorder}{\Q{1}\BC{}\BG{}\autoCenter{n}\textSize{0}
+ \textColor{0 0 0}\BG{.75 .75 .75}\Ff\FfReadOnly}
+\newcommand{\cBGBorder}{\BC{0 0 0}\BG{.75 .75 .75}\autoCenter{n}
+ \textSize{0}\textColor{0 0 0}}
+\newcommand{\myNumPadI}{\F\FHidden\autoCenter{n}\textSize{8}
+ \textFont{\fieldFont}\S{S}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\setDimOf}
+% \begin{macro}{\monoSpaceFont}
+% \begin{macro}{\fieldFont}
+% The following are some customization commands, used for setting field properties that
+% are not included in the presets.
+% \begin{macrocode}
+\newcommand{\setDimOf}[3]{\@namedef{widthOf#1}{#2}%
+ \@namedef{heightOf#1}{#3}}
+\newcommand{\monoSpaceFont}{CoBo}
+\newcommand{\fieldFont}{Helv}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\arithProb}
+% \cs{arithProb} consists of three fields: \texttt{top}, \texttt{operation}, and \texttt{bottom},
+% these three fields are bundled together as a single unit. We use \textbf{courier-bold} for the \texttt{top} and \texttt{bottom}
+% so we can align the decimal points, if there are any.
+% \begin{macrocode}
+\setDimOf{top}{1in}{0.62in}
+\setDimOf{operation}{.38in}{.62in}
+\setDimOf{bottom}{1in}{0.62in}
+\newcommand{\arithProb}{\mbox{\vbox{\offinterlineskip
+ \hbox{\hspace*{\@nameuse{widthOfoperation}}%
+ \textField[\presets{\tBGNoBorder}
+ \textFont{\monoSpaceFont}\Q{2}]{top}%
+ {\@nameuse{widthOf\Fld@name}}{\@nameuse{heightOf\Fld@name}}%
+ }%
+ \hbox{%
+ \textField[\presets{\tBGNoBorder}
+ \textSize{25}\Q{1}]{operation}{\@nameuse{widthOf\Fld@name}}%
+ {\@nameuse{heightOf\Fld@name}}%
+ \textField[\presets{\tBGNoBorder}
+ \textFont{\monoSpaceFont}\Q{2}]{bottom}%
+ {\@nameuse{widthOf\Fld@name}}{\@nameuse{heightOf\Fld@name}}%
+ }}}%
+}
+% \end{macrocode}
+% \end{macro}
+% More components of these flash cards and can be placed anywhere.
+% \begin{macro}{\alertbox}
+% displays the ``Right/Wrong'' message;
+% \begin{macro}{\startAgain}
+% is a button for starting all over again, it takes an icon;
+% \begin{macro}{\inputRegion}
+% is where the user inputs his/her answer;
+% \begin{macro}{\newCard}
+% is a push button for randomly geneating a new problem. These different elements
+% \begin{macrocode}
+\setDimOf{alertbox}{.88in}{.62in}
+\setDimOf{StartAgain}{0.88in}{0.62in}
+\setDimOf{result}{1.38in}{0.62in}
+\setDimOf{NewProblem}{0.88in}{0.62in}
+\newcommand{\alertbox}[1][]{\hbox{\textField[\presets{\tBGNoBorder}
+ \textSize{0}#1]{alertbox}{\@nameuse{widthOf\Fld@name}}%
+ {\@nameuse{heightOf\Fld@name}}}}
+\@ifundefined{if@useacrobat}{\let\placeImageOpts\@empty}
+{\def\placeImageOpts{\FB{false}\I{null}\TP{2}}}
+\newcommand{\startAgain}[1][]{\hbox{%
+ \expandafter\pushButton\expandafter[\placeImageOpts
+ \presets{\tBGNoBorderI}\textFont{\fieldFont}\S{S}
+ \textSize{12}\CA{\startAgainMsg}\AC{\startAgainMsg}#1
+ \A{\JS{startAgain();}}]{StartAgain}{\@nameuse{widthOf\Fld@name}}%
+ {\@nameuse{heightOf\Fld@name}}}}
+\newcommand{\inputRegion}[1][]{\hbox{\textField[\presets{\cBGNoBorder}
+ \Ff{-\FfReadOnly}\Q{2}#1\AA{\AAValidate{validateResult();}
+ \AAKeystroke{fcNumber_Keystroke(numDecimals,1,0,0,"",true);}
+ \AAFormat{try{%
+ fcNumber_Format(numDecimals,1,0,0,"",true);}catch(e){}}}
+ ]{result}{\@nameuse{widthOf\Fld@name}}%
+ {\@nameuse{heightOf\Fld@name}}}}
+\newcommand{\newCard}[1][]{\hbox{%
+ \expandafter\pushButton\expandafter[\placeImageOpts
+ \textSize{12}\presets{\tBGNoBorderI}\textFont{\fieldFont}\S{S}
+ \CA{\newCardMsg}\AC{\newCardMsg}#1\A{\JS{newCard();}}
+ ]{NewProblem}{\@nameuse{widthOf\Fld@name}}%
+ {\@nameuse{heightOf\Fld@name}}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\cbTiming}
+% \begin{macro}{\ansField}
+% \begin{macro}{\cbOperation}
+% \cs{cbTiming} is a dropdown menu for timing; \cs{ansField} is a text field where
+% the correct answers are written; \cs{cbOperation} is a dropdown menu of operations.
+% \changes{v0.99}{2016/12/02}{Corrected problem with \string\cs{cbOperation} due to
+% changes in \string\textsf{eforms}.}
+% \begin{macrocode}
+% {\@nameuse{widthOf\Fld@name}}{\@nameuse{heightOf\Fld@name}}
+\setDimOf{TimeDelay}{0.9in}{0.24in}
+\setDimOf{ansregion}{.87in+10bp}{.24in}
+\setDimOf{ChooseOperation}{1.38in-10bp}{0.24in}
+\edef\isReadOnlyTiming{\ifx\fc@timedscores\fc@NO
+ \noexpand\Ff{\FfReadOnly}\fi}
+\newcommand{\cbTimingToolip}{Select a time challenge
+ from the dropdown menu}
+\newcommand{\cbTiming}[1][]{\hbox{%
+ \expandafter\comboBox\expandafter[\isReadOnlyTiming
+ \presets{\cBGBorder}\textFont{\fieldFont}\V{600000}\DV{600000}#1
+ \TU{\cbTimingToolip}\AA{\AAKeystroke{%
+ if (!event.willCommit) timelimit=event.changeEx;}}
+ ]{TimeDelay}{\@nameuse{widthOf\Fld@name}}%
+ {\@nameuse{heightOf\Fld@name}}{%
+ [(600000)(\fcNoTiming)][(30)(30 sec)][(25)(25 sec)][(20)(20 sec)]%
+ [(15)(15 sec)][(10)(10 sec)][(5)(\space\space 5 sec)]}}%
+}
+\newcommand{\ansField}[1][]{\hbox{\textField[\presets{\cBGNoBorder}\Q{2}
+ #1\AA{\AAFormat{%
+ if (event.value!="") {\r
+ try{fcNumber_Format(numDecimals,1,0,0,"",true);\r
+ event.value=("\fmtAnswer\space")+event.value;}catch(e){};}}}
+ ]{ansregion}{\@nameuse{widthOf\Fld@name}}%
+ {\@nameuse{heightOf\Fld@name}}}%
+}
+% \end{macrocode}
+% \DescribeMacro{\cbOpDefault} is used to set the default operation
+% correct values are \texttt{a}, \texttt{s}, \texttt{m}, \texttt{d}
+% \begin{macrocode}
+\let\fc@addAbbr=a\let\fc@subAbbr=s
+\let\fc@mulAbbr=m\let\fc@divAbbr=d
+\newcommand{\cbOpDefault}[1]{\def\cbOpDef@ult{#1}%
+ \if\cbOpDef@ult\fc@addAbbr\else\if\cbOpDef@ult\fc@subAbbr\else
+ \if\cbOpDef@ult\fc@mulAbbr\else\if\cbOpDef@ult\fc@divAbbr\else
+ \ifKV@fcopera@add\def\cbOpDef@ult{a}\else
+ \ifKV@fcopera@sub\def\cbOpDef@ult{s}\else
+ \ifKV@fcopera@mul\def\cbOpDef@ult{m}\else
+ \ifKV@fcopera@div\def\cbOpDef@ult{d}\else
+ \PackageError{fc_arith}{There are no selected arithmetic
+ operations}{}\fi\fi\fi\fi
+ \PackageWarning{fc_arith}{Value of \string\cbOpDefault\space
+ not recognized,\MessageBreak will use `\cbOpDef@ult'}%
+ \fi\fi\fi\fi
+}
+\cbOpDefault{a}
+\newcommand{\cbOperationTooltip}{Choose an arithmetic operation
+ to practice}
+\newcommand{\cbOperation}[1][]{%
+ \edef\cbvOptChoices{\ifKV@fcopera@add[(a)(\fcAddition)]\fi
+ \ifKV@fcopera@sub[(s)(\fcSubtraction)]\fi
+ \ifKV@fcopera@mul[(m)(\fcMultiplication)]\fi
+ \ifKV@fcopera@div[(d)(\fcDivision)]\fi}%
+ \hbox{\comboBox[\presets{\cBGBorder}\textFont{\fieldFont}
+ \TU{\cbOperationTooltip}
+ \V{\cbOpDef@ult}\DV{\cbOpDef@ult}#1]{ChooseOperation}%
+ {\@nameuse{widthOf\Fld@name}}%
+ {\@nameuse{heightOf\Fld@name}}{\cbvOptChoices}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \cs{szNum} is the width and height of a keypad button.
+% \begin{macrocode}
+\newcommand{\szNum}{14bp}
+% \end{macrocode}
+% \begin{macro}{\Keypad}
+% A keypad for the user to enter responses using the mouse only. Cool!
+% \begin{macrocode}
+\newcommand\toggleKeyPadBtnColor{0 0 1}
+\newcommand\toggleKeyPadBtnTooltip{Click to toggle keypad, shift-click
+ to toggle between mouse and touch keypads}
+\def\toggleKeyPadBtn{\pushButton[\textSize{6}\CA{\toggleKeypad}\H{O}
+ \TU{\toggleKeyPadBtnTooltip}\textColor{\toggleKeyPadBtnColor}
+ \S{S}\BC{}\BG{}\A{\JS{%
+ if (event.shift)\r\t
+ if (bTouchFriendly)\r\t\t
+ makeMouseFriendly();\r\t
+ else\r\t\t
+ makeTouchFriendly();\r\t
+ else\r\t
+ ToggleKeyPad();\r
+}}]{toggleKeyPadBtn}{}{8bp}}%
+\newcommand{\Keypad}{%
+ \vbox{\offinterlineskip\ifx\fc@keypadlink\fc@YES
+ \setlength{\fcWidth}{4bp+\szNum*4}%
+ \hbox to\fcWidth{\hfill\toggleKeyPadBtn\hfill}\vskip2bp\fi
+ \hbox{\pushButton[\presets{\myNumPadI}\CA{7}
+ \A{\JS{addDigit(7)}}]{num7}{\szNum}{\szNum}\olBdry
+ \pushButton[\presets{\myNumPadI}\CA{8}
+ \A{\JS{addDigit(8)}}]{num8}{\szNum}{\szNum}\olBdry
+ \pushButton[\presets{\myNumPadI}\CA{9}
+ \A{\JS{addDigit(9)}}]{num9}{\szNum}{\szNum}}\olBdry
+ \hbox{\pushButton[\presets{\myNumPadI}\CA{4}
+ \A{\JS{addDigit(4)}}]{num4}{\szNum}{\szNum}\olBdry
+ \pushButton[\presets{\myNumPadI}\CA{5}
+ \A{\JS{addDigit(5)}}]{num5}{\szNum}{\szNum}\olBdry
+ \pushButton[\presets{\myNumPadI}\CA{6}
+ \A{\JS{addDigit(6)}}]{num6}{\szNum}{\szNum}}\olBdry
+ \hbox{\pushButton[\presets{\myNumPadI}\CA{1}
+ \A{\JS{addDigit(1)}}]{num1}{\szNum}{\szNum}\olBdry
+ \pushButton[\presets{\myNumPadI}\CA{2}
+ \A{\JS{addDigit(2)}}]{num2}{\szNum}{\szNum}\olBdry
+ \pushButton[\presets{\myNumPadI}\CA{3}
+ \A{\JS{addDigit(3)}}]{num3}{\szNum}{\szNum}}\olBdry
+ \hbox{\edef\w@dj{\ifmakeXasPD1bp\else\ifxetex-1bp\else-1bp\fi\fi}%
+ \pushButton[\presets{\myNumPadI}\CA{0}
+ \A{\JS{addDigit(0)}}]{num0}{\w@dj+\szNum*2}{\szNum}\olBdry
+ \pushButton[\presets{\myNumPadI}\CA{\kpDec}
+ \A{\JS{addDigit("Dec")}}]{Dec}{\szNum}{\szNum}\olBdry
+ \smash{\vbox{\edef\w@dj{\ifmakeXasPD1bp\else\ifxetex-1bp\else-1bp\fi\fi}%
+ \hbox{\pushButton[\presets{\myNumPadI}\CA{\kpMinus}
+ \A{\JS{addDigit("Minus")}}
+ ]{Minus}{\szNum}{\szNum}}\olBdry
+ \hbox{\pushButton[\presets{\myNumPadI}\CA{\kpBack}
+ \textSize{0}\A{\JS{addDigit("Back")}}
+ ]{Back}{\szNum}{\szNum}}\olBdry
+ \hbox{\pushButton[\presets{\myNumPadI}\CA{\kpEnter}
+ \textSize{0}\A{\JS{addDigit("Enter")}}
+ ]{Enter}{\szNum}{\w@dj+\szNum*2}}%
+ }}}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \cs{fcSep} is a standard separation between elements.
+% \begin{macrocode}
+\def\fcSep{\quad}
+% \end{macrocode}
+% \begin{macro}{\statsFields}
+% A collection of fields that summarize the attempts at responding to the arithmetic
+% problem.
+% \begin{macrocode}
+\setDimOf{fcSF}{0.37in}{0.25in}
+\newcommand{\statsFieldOpColor}{1 0 0}
+\newcommand{\statsFieldColor}{blue}
+\newcommand{\timeScoresTooltip}{Click to see how points are assigned}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand{\statsFields}{%
+% \end{macrocode}
+% The Addition column
+% \begin{macrocode}
+\ifKV@fcopera@add
+ \vbox{\offinterlineskip
+ \hbox{\textField[\presets{\cBGNoBorder}
+ \textColor{\statsFieldOpColor}\V{+}\DV{+}\Q{1}
+ ]{AddScore1}{\widthOffcSF}{\heightOffcSF}}\olBdry
+ \hbox{\textField[\presets{\cBGNoBorder}
+ ]{AddScore2}{\widthOffcSF}{\heightOffcSF}}\olBdry
+ \hbox{\textField[\presets{\cBGNoBorder}
+ ]{AddScore3}{\widthOffcSF}{\heightOffcSF}}\olBdry
+ \hbox{\textField[\presets{\cBGNoBorder}
+ ]{AddScore4}{\widthOffcSF}{\heightOffcSF}}%
+\ifx\fc@timedscores\fc@YES\olBdry
+ \hbox{\textField[\presets{\cBGNoBorder}
+ ]{AddScore5}{\widthOffcSF}{\heightOffcSF}}%
+\fi
+ }\fcSep
+\fi
+% \end{macrocode}
+% The Subtraction column
+% \begin{macrocode}
+\ifKV@fcopera@sub
+\vbox{\offinterlineskip
+ \hbox{\textField[\presets{\cBGNoBorder}
+ \textColor{\statsFieldOpColor}\V{-}\DV{-}\Q{1}
+ ]{SubScore1}{\widthOffcSF}{\heightOffcSF}}\olBdry
+ \hbox{\textField[\presets{\cBGNoBorder}]{SubScore2}%
+ {\widthOffcSF}{\heightOffcSF}}\olBdry
+ \hbox{\textField[\presets{\cBGNoBorder}]{SubScore3}%
+ {\widthOffcSF}{\heightOffcSF}}\olBdry
+ \hbox{\textField[\presets{\cBGNoBorder}]{SubScore4}{\widthOffcSF}%
+ {\heightOffcSF}}
+\ifx\fc@timedscores\fc@YES\olBdry
+ \hbox{\textField[\presets{\cBGNoBorder}]{SubScore5}{\widthOffcSF}%
+ {\heightOffcSF}}
+\fi
+ }\fcSep
+\fi
+% \end{macrocode}
+% The Multiplication column
+% \begin{macrocode}
+\ifKV@fcopera@mul
+\vbox{\offinterlineskip
+ \hbox{\textField[\presets{\cBGNoBorder}
+ \textColor{\statsFieldOpColor}\V{x}\DV{x}\Q{1}
+ ]{MulScore1}{\widthOffcSF}{\heightOffcSF}}\olBdry
+ \hbox{\textField[\presets{\cBGNoBorder}]{MulScore2}{\widthOffcSF}%
+ {\heightOffcSF}}\olBdry
+ \hbox{\textField[\presets{\cBGNoBorder}]{MulScore3}{\widthOffcSF}%
+ {\heightOffcSF}}\olBdry
+ \hbox{\textField[\presets{\cBGNoBorder}]{MulScore4}{\widthOffcSF}%
+ {\heightOffcSF}}
+\ifx\fc@timedscores\fc@YES\olBdry
+ \hbox{\textField[\presets{\cBGNoBorder}]{MulScore5}{\widthOffcSF}%
+ {\heightOffcSF}}
+\fi
+ }\fcSep
+\fi
+% \end{macrocode}
+% The Division column
+% \begin{macrocode}
+\ifKV@fcopera@div
+\vbox{\offinterlineskip
+ \hbox{\textField[\presets{\cBGNoBorder}
+ \textColor{\statsFieldOpColor}
+ \uV{FEFF00F7}\uDV{FEFF00F7}\Q{1}
+ ]{DivScore1}{\widthOffcSF}%
+ {\heightOffcSF}}\olBdry
+ \hbox{\textField[\presets{\cBGNoBorder}]{DivScore2}{\widthOffcSF}%
+ {\heightOffcSF}}\olBdry
+ \hbox{\textField[\presets{\cBGNoBorder}]{DivScore3}{\widthOffcSF}%
+ {\heightOffcSF}}\olBdry
+ \hbox{\textField[\presets{\cBGNoBorder}]{DivScore4}{\widthOffcSF}%
+ {\heightOffcSF}}
+\ifx\fc@timedscores\fc@YES\olBdry
+ \hbox{\textField[\presets{\cBGNoBorder}]{DivScore5}{\widthOffcSF}%
+ {\heightOffcSF}}
+\fi
+ }\fcSep
+\fi
+% \end{macrocode}
+% Description column
+% \begin{macrocode}
+\vbox{\offinterlineskip
+ \hbox{\parbox[b][.25in][c]{.75in}{%
+ \textcolor{blue}{\operation}\hfill}}
+ \hbox{\parbox[b][.25in][c]{1.25in}{%
+ \textcolor{blue}{\numCorrect}\hfill}}
+ \hbox{\parbox[b][.25in][c]{1.25in}{%
+ \textcolor{blue}{\numAttempted}\hfill}}
+ \hbox{\parbox[b][.25in][c]{1.25in}{%
+ \textcolor{blue}{\percentCorrect}\hfill}}
+\ifx\fc@timedscores\fc@YES
+ \hbox{\textField[\presets{\cBGNoBorder}
+ \textColor{\statsFieldOpColor}
+ ]{ScoreTotal}{.51in}{.25in}\kern1bp
+ \makebox[0pt][l]{\pushButton[\presets{\tBGNoBorder}
+ \Ff{-\FfReadOnly}\S{S}\H{I}\textSize{10}
+ \TU{\timeScoresTooltip}
+ \A{\JS{docTimeScores();}}]{Descrip5}{1in}{.25in}}%
+ \parbox[b][.25in][c]{1in}{%
+ \centering\textcolor{blue}{\timedScores}}}%
+\fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%\section{JavaScript Code}
+% \begin{macrocode}
+\edef\bFCa{/\ifKV@fcopera@add/\else*\fi}
+\edef\eFCa{\ifKV@fcopera@add/\else*\fi/}
+\edef\bFCs{/\ifKV@fcopera@sub/\else*\fi}
+\edef\eFCs{\ifKV@fcopera@sub/\else*\fi/}
+\edef\bFCm{/\ifKV@fcopera@mul/\else*\fi}
+\edef\eFCm{\ifKV@fcopera@mul/\else*\fi/}
+\edef\bFCd{/\ifKV@fcopera@div/\else*\fi}
+\edef\eFCd{\ifKV@fcopera@div/\else*\fi/}
+% \end{macrocode}
+% Language localizations for \cs{fcTimedScoresDialog}
+% \begin{macrocode}
+\def\fctCharWidth{22}
+\def\fctInstr{"Points are awarded, based on time,
+ for successfully solving a problem:"}
+\def\fctTimeElapsed{"Time elapsed"}
+\def\fctPoints{"Points"}
+\def\fctLessThanV{"Less than 5 sec"}
+\def\fctLessThanVPoints{6}
+\def\fctBtwnVAndX{"Between 5 and 10 sec"}
+\def\fctBtwnVAndXPoints{5}
+\def\fctBtwnXAndXV{"Between 10 and 15 sec"}
+\def\fctBtwnXAndXVPoints{4}
+\def\fctBtwnXVAndXX{"Between 15 and 20 sec"}
+\def\fctBtwnXVAndXXPoints{3}
+\def\fctBtwnXXAndXXV{"Between 20 and 25 sec"}
+\def\fctBtwnXXAndXXVPoints{2}
+\def\fctGtrXXV{"Greater than 25 sec"}
+\def\fctGtrXXVPoints{1}
+% \end{macrocode}
+% \DescribeMacro{\amtChngMoToTou} is the amount of increase on dimensions of the transition
+% from the mouse keypad to the touch keypad.
+% \begin{macrocode}
+\newcommand\amtChngMouToTou{5}
+% \end{macrocode}
+% Language localizations for \texttt{fcDialog}.
+% \begin{macrocode}
+\newcommand\fcOptTextWidth{80}
+\newcommand\fcOptTopRange{Range Top}
+\newcommand\fcOptBottomRange{Range Bottom}
+\newcommand\fcOptTopRangeDiv{Range Quotient}
+\newcommand\fcOptBottomRangeDiv{Range Divisor}
+\newcommand\fcOptTo{ to }
+\newcommand\fcOptAllowNegNumber{Allow Negative Subtraction}
+\newcommand\fcOptDecimal{Decimals:}
+\newcommand\fcOptDecimalNone{none}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\fcMenuFCMsg{No menu items to display}
+% \end{macrocode}
+% Cluster names
+% \begin{macrocode}
+\newcommand\fcAdditionName{\fcAddition}
+\newcommand\fcSubtractionName{\fcSubtraction}
+\newcommand\fcMultiplicationName{\fcMultiplication}
+\newcommand\fcDivisionName{\fcDivision}
+% \end{macrocode}
+% Now for the \textbf{Document JavaScript} for this document
+% \begin{macrocode}
+\begin{insDLJS*}{fcjs}
+\begin{newsegment}{data}
+var _loadfcjs=true;
+var t, b, o, r, c, oAlert;
+function getFieldObjects()
+{
+ t=this.getField("top");
+ b=this.getField("bottom");
+ o=this.getField("operation");
+ r=this.getField("result");
+ c=this.getField("ChooseOperation");
+ oAlert=this.getField("alertbox");
+ useKeyPad = (this.getField("Enter").display==display.visible);
+}
+var turnoff=false;
+var bUpdateField=true;
+var timedScores=\fcTimedScores;
+var fcAllowNegSub=\fcAllowNegSub;
+var useKeyPad = false;
+var decimalPressed = false;
+var keypadInput=false;
+var operand='a';
+var NumAddCorr=0;
+var NumAddTried=0;
+var NumSubCorr=0;
+var NumSubTried=0;
+var NumMulCorr=0;
+var NumMulTried=0;
+var NumDivCorr=0;
+var NumDivTried=0;
+timelimit=600000;
+var mybegin;
+getFieldObjects();
+var numDecimals=0;
+var addDecT = \fcaddDecT, addDecB = \fcaddDecB;
+var addT_a = Number(\fcAddTParams[0]);
+var addT_b = Number(\fcAddTParams[1]);
+var addB_a = Number(\fcAddBParams[0]);
+var addB_b = Number(\fcAddBParams[1]);
+var subDecT = \fcsubDecT, subDecB = \fcsubDecB;
+var subT_a = Number(\fcSubTParams[0]);
+var subT_b = Number(\fcSubTParams[1]);
+var subB_a = Number(\fcSubBParams[0]);
+var subB_b = Number(\fcSubBParams[1]);
+var mulDecT = \fcmulDecT, mulDecB = \fcmulDecB;
+var mulT_a = Number(\fcMulTParams[0]);
+var mulT_b = Number(\fcMulTParams[1]);
+var mulB_a = Number(\fcMulBParams[0]);
+var mulB_b = Number(\fcMulBParams[1]);
+% \end{macrocode}
+% Here, Q corresponds to the quotient, and B corresponds to the divisor
+% \begin{macrocode}
+var divDecQ = \fcdivDecQ, divDecB = \fcdivDecB;
+var divQ_a = Number(\fcDivQParams[0]);
+var divQ_b = Number(\fcDivQParams[1]);
+var divB_a = Number(\fcDivBParams[0]);
+var divB_b = Number(\fcDivBParams[1]);
+\end{newsegment}
+\begin{newsegment}{updatescore}
+function updatescore(f,t) {
+ // console.println(t);
+ var points=0;
+ if(t<=5) points=6;
+ if((t>5)&&(t<=10)) points=5;
+ if((t>10)&&(t<=15)) points=4;
+ if((t>15)&&(t<=20)) points=3;
+ if((t>20)&&(t<=25)) points=2;
+ if(t>25) points=1;
+ var oField=this.getField(f);
+ if ( oField != null ) {
+ oField.value+=points;
+ this.getField("ScoreTotal").value+=points;
+ }
+}
+function docTimeScores() {
+ app.execDialog(fcTimedScoresDialog);
+}
+var fcTimedScoresDialog =
+{
+ // set a default value for radio button field
+ initialize: function(dialog) {
+ },
+ // when user presses "Ok", this handler will execute first
+ commit: function(dialog) {
+ },
+ // The Dialog Description
+ description:
+ {
+ name: "PDF Flash Cards - Timed Scores",
+ align_children: "align_left",
+ elements:
+ [
+ {
+ type: "view",
+ align_children: "align_left",
+ elements:
+ [
+ {
+ type: "view",
+ align_children: "align_row",
+ elements:
+ [
+ {
+ type: "static_text",
+ item_id: "instr",
+ name: \fctInstr
+ }
+ ]
+ },
+ {
+ type: "view",
+ align_children: "align_row",
+ elements:
+ [
+ {
+ type: "gap",
+ width: 10
+ },
+ {
+ type: "static_text",
+ item_id: "hr01",
+ char_width: \fctCharWidth,
+ font: "dialog",
+ bold: true,
+ name: \fctTimeElapsed
+ },
+ {
+ type: "static_text",
+ item_id: "hr02",
+ font: "dialog",
+ bold: true,
+ name: \fctPoints
+ },
+ ]
+ },
+ {
+ type: "view",
+ align_children: "align_row",
+ elements:
+ [
+ {
+ type: "gap",
+ width: 10
+ },
+ {
+ type: "static_text",
+ item_id: "st11",
+ char_width: \fctCharWidth,
+ name: \fctLessThanV
+ },
+ {
+ type: "static_text",
+ item_id: "st12",
+ name: " \fctLessThanVPoints"
+ },
+ ]
+ },
+ {
+ type: "view",
+ align_children: "align_row",
+ elements:
+ [
+ {
+ type: "gap",
+ width: 10
+ },
+ {
+ type: "static_text",
+ item_id: "st21",
+ char_width: \fctCharWidth,
+ name: \fctBtwnVAndX
+ },
+ {
+ type: "static_text",
+ item_id: "st22",
+ name: " \fctBtwnVAndXPoints"
+ },
+ ]
+ },
+//---
+ {
+ type: "view",
+ align_children: "align_row",
+ elements:
+ [
+ {
+ type: "gap",
+ width: 10
+ },
+ {
+ type: "static_text",
+ item_id: "st31",
+ char_width: \fctCharWidth,
+ name: \fctBtwnXAndXV
+ },
+ {
+ type: "static_text",
+ item_id: "st32",
+ name: " \fctBtwnXAndXVPoints"
+ },
+ ]
+ },
+//---
+ {
+ type: "view",
+ align_children: "align_row",
+ elements:
+ [
+ {
+ type: "gap",
+ width: 10
+ },
+ {
+ type: "static_text",
+ item_id: "st41",
+ char_width: \fctCharWidth,
+ name: \fctBtwnXVAndXX
+ },
+ {
+ type: "static_text",
+ item_id: "st42",
+ name: " \fctBtwnXVAndXXPoints"
+ },
+ ]
+ },
+ ]
+ },
+//---
+ {
+ type: "view",
+ align_children: "align_row",
+ elements:
+ [
+ {
+ type: "gap",
+ width: 10
+ },
+ {
+ type: "static_text",
+ item_id: "st51",
+ char_width: \fctCharWidth,
+ name: \fctBtwnXXAndXXV
+ },
+ {
+ type: "static_text",
+ item_id: "st52",
+ name: " \fctBtwnXXAndXXVPoints"
+ },
+ ]
+ },
+//---
+ {
+ type: "view",
+ align_children: "align_row",
+ elements:
+ [
+ {
+ type: "gap",
+ width: 10
+ },
+ {
+ type: "static_text",
+ item_id: "st61",
+ char_width: \fctCharWidth,
+ name: \fctGtrXXV
+ },
+ {
+ type: "static_text",
+ item_id: "st62",
+ name: " \fctGtrXXVPoints"
+ },
+ ]
+ },
+//---
+ {
+ type: "view",
+ align_children: "align_row",
+ elements:
+ [
+ {
+ alignment: "align_right",
+ type: "ok",
+ }
+ ]
+ }
+ ]
+ }
+}
+function validateResult()
+{
+ var oField, MsgFlag, calculation;
+ if (!turnoff && !keypadInput) {
+ MsgFlag=false;
+ this.delay=true;
+ var mynow=new Date();
+ var elapsedtime = (Date.parse(mynow)-Date.parse(mybegin))/1000;
+ var timeelapsed = (elapsedtime>timelimit);
+ switch (operand) {
+ case 'a':
+ oField = this.getField("AddScore2");
+ bUpdateField = ( oField != null );
+ calculation=util.printf("\%."+numDecimals+"f",%
+(t.value+b.value));
+% calculation=t.value+b.value;
+% calculation=Number(t.value)+Number(b.value);
+ if(timeelapsed) {
+ if (timedScores) app.alert("\timeUpMsg",3);
+ if (bUpdateField) oField.value=NumAddCorr;
+ } else {
+% if(Number(event.value)==calculation) {
+ if((1*event.value)==calculation) {
+ MsgFlag=true;
+ if ( bUpdateField ) {
+ oField.value=++NumAddCorr;
+ updatescore("AddScore5",elapsedtime);
+ }
+ }
+ else
+ if ( bUpdateField ) oField.value=NumAddCorr;
+ }
+ oField = this.getField("AddScore3");
+ if (oField != null ) oField.value=++NumAddTried;
+ oField = this.getField("AddScore4");
+ if (oField != null ) oField.value = util.printf("\%.0f",%
+(NumAddCorr/NumAddTried)*100);
+ break;
+ case 's':
+ oField=this.getField("SubScore2");
+ bUpdateField = ( oField != null );
+ calculation=util.printf("\%."+numDecimals+"f",
+ (t.value-b.value));
+% calculation=t.value-b.value;
+% calculation=Number(t.value)-Number(b.value);
+ if(timeelapsed) {
+ if (timedScores) app.alert("\timeUpMsg",3);
+ if (bUpdateField) oField.value=NumSubCorr;
+ } else {
+% if(Number(event.value)==calculation) {
+ if((1*event.value)==calculation) {
+ MsgFlag=true;
+ if ( bUpdateField ) {
+ oField.value=++NumSubCorr;
+ updatescore("SubScore5",elapsedtime);
+ }
+ } else
+ if ( bUpdateField ) oField.value=NumSubCorr;
+ }
+ oField=this.getField("SubScore3");
+ if (oField != null) oField.value=++NumSubTried;
+ oField=this.getField("SubScore4");
+ if (oField != null) oField.value=util.printf("\%.0f",%
+(NumSubCorr/NumSubTried)*100);
+ break;
+ case 'm':
+ oField=this.getField("MulScore2");
+ bUpdateField = ( oField != null );
+ calculation=util.printf("\%."+numDecimals+"f",%
+(t.value*b.value));
+ if(timeelapsed) {
+ if (timedScores) app.alert("\timeUpMsg",3);
+ if (bUpdateField) oField.value=NumMulCorr;
+ } else {
+ if((1*event.value)==calculation) {
+% if(Number(event.value)==Number(calculation)) {
+ MsgFlag=true;
+ if (bUpdateField) {
+ oField.value=++NumMulCorr;
+ updatescore("MulScore5",elapsedtime);
+ }
+ } else
+ if (bUpdateField) oField.value=NumMulCorr;
+ }
+ oField=this.getField("MulScore3");
+ if (oField != null) oField.value=++NumMulTried;
+ oField=this.getField("MulScore4");
+ if (oField != null) oField.value=util.printf("\%.0f",%
+(NumMulCorr/NumMulTried)*100);
+ break;
+ case 'd':
+ oField=this.getField("DivScore2");
+ bUpdateField = ( oField != null );
+% calculation=t.value/b.value;
+ calculation=util.printf("\%."+numDecimals+"f",%
+t.value/b.value);
+ if(timeelapsed) {
+ if (timedScores) app.alert("\timeUpMsg",3);
+ if (bUpdateField) oField.value=NumDivCorr;
+ } else {
+% if(Number(event.value)==Number(calculation)) {
+ if((1*event.value)==calculation) {
+ MsgFlag=true;
+ if (bUpdateField) {
+ oField.value=++NumDivCorr;
+ updatescore("DivScore5",elapsedtime);
+ }
+ } else
+ if ( bUpdateField ) oField.value=NumDivCorr;
+ }
+ oField = this.getField("DivScore3");
+ if (oField != null) oField.value=++NumDivTried;
+ oField = this.getField("DivScore4");
+ if (oField != null) oField.value=util.printf("\%.0f",%
+(NumDivCorr/NumDivTried)*100);
+ break;
+ }
+ if(!timeelapsed) {
+ if(MsgFlag) {
+ oAlert.textColor=color.blue;
+ oAlert.value="\rightMsg";
+ } else {
+ oAlert.textColor=color.red;
+ oAlert.value="\wrongMsg";
+ }
+ }
+ this.getField("ansregion").value=calculation;
+ this.getField("NewProblem").setFocus() ;
+ this.delay=false;
+ }
+}
+function startAgain() {
+ getFieldObjects();
+ turnoff=true;
+ this.resetForm();
+% \end{macrocode}
+% (2016/12/10) Added \texttt{timelimit} to list of variables to reset
+% \changes{v1.0e}{2016/12/10}{Added \string\texttt{timelimit} to list of variables to reset}
+% \begin{macrocode}
+ timelimit=600000;
+ event.rc=false;
+ operand='+';
+ NumAddCorr=0;
+ NumAddTried=0;
+ NumSubCorr=0;
+ NumSubTried=0;
+ NumMulCorr=0;
+ NumMulTried=0;
+ NumDivCorr=0;
+ NumDivTried=0;
+}
+function newCard() {
+ turnoff=true;
+ this.resetForm(["result","top","bottom","ansregion","alertbox"]);
+ operand = c.value;
+ switch (operand)
+ {
+ case 'a':
+ {
+ o.value='+'; // addDecT
+ numDecimals = Math.max(addDecT,addDecB);
+ var topTemplate = "\%."+addDecT+"f";
+ var botTemplate = "\%."+addDecB+"f";
+ var matchTemplate = "\%."+ numDecimals +"f";
+ var m=util.printf(topTemplate,%
+(addT_b-addT_a)*Math.random()+addT_a);
+ var n=util.printf(botTemplate,%
+(addB_b-addB_a)*Math.random()+addB_a);
+ m=util.printf(matchTemplate,m);
+ n=util.printf(matchTemplate,n);
+ var nWidth=(m.length < n.length) ? n.length : m.length;
+ var commonTemplate = "\%"+nWidth+"."+numDecimals+"f";
+ t.value=util.printf(commonTemplate,m);
+ b.value=util.printf(commonTemplate,n);
+ break;
+ }
+ case 's':
+ {
+ o.value="-";
+ numDecimals = Math.max(subDecT,subDecB);
+ var topTemplate = "\%."+subDecT+"f";
+ var botTemplate = "\%."+subDecB+"f";
+ var matchTemplate = "\%."+ numDecimals +"f";
+ var m=util.printf(topTemplate,%
+(subT_b-subT_a)*Math.random()+subT_a);
+ var n=util.printf(botTemplate,%
+(subB_b-subB_a)*Math.random()+subB_a);
+ m=util.printf(matchTemplate,m);
+ n=util.printf(matchTemplate,n);
+ var nWidth=(m.length < n.length) ? n.length : m.length;
+ var commonTemplate = "\%"+nWidth+"."+numDecimals+"f";
+ var bSwitch=( (!fcAllowNegSub) && (n-m>0) );
+ t.value=util.printf(commonTemplate,(bSwitch)?n:m);
+ b.value=util.printf(commonTemplate,(bSwitch)?m:n);
+ break;
+ }
+ case 'm':
+ {
+ o.value='x';
+ numDecimals=Math.max(mulDecT,mulDecB);
+ var topTemplate = "\%."+mulDecT+"f";
+ var botTemplate = "\%."+mulDecB+"f";
+ var matchTemplate = "\%."+ numDecimals +"f";
+ var m=util.printf(topTemplate,%
+(mulT_b-mulT_a)*Math.random()+mulT_a);
+ var n=util.printf(botTemplate,%
+(mulB_b-mulB_a)*Math.random()+mulB_a);
+ m=util.printf(matchTemplate,m);
+ n=util.printf(matchTemplate,n);
+ var nWidth=(m.length < n.length) ? n.length : m.length;
+ var commonTemplate = "\%"+nWidth+"."+numDecimals+"f";
+ t.value=util.printf(commonTemplate,m);
+ b.value=util.printf(commonTemplate,n);
+ numDecimals = mulDecT + mulDecB;
+ break;
+ }
+ case 'd':
+ {
+ o.value='\string\367'
+ numDecimals=divDecQ+divDecB;
+% numDecimals=Math.max(divDecQ,divDecB);
+ var topTemplate = "\%."+divDecQ+"f";
+ var botTemplate = "\%."+divDecB+"f";
+ var matchTemplate = "\%."+ numDecimals +"f";
+ var n,m;
+ var quotient=util.printf(topTemplate,%
+divQ_a + (divQ_b-divQ_a)*Math.random());
+ for(n=util.printf(botTemplate,%
+divB_a + (divB_b-divB_a)*Math.random());
+ n==0; n=util.printf("\%.0f",%
+divB_a + (divB_b-divB_a)*Math.random()));
+ m=util.printf(matchTemplate,quotient*n);
+ n=util.printf(matchTemplate,n);
+ var nWidth=(m.length < n.length) ? n.length : m.length;
+ var commonTemplate = "\%"+nWidth+"."+numDecimals+"f";
+ t.value=util.printf(commonTemplate,m);
+ b.value=util.printf(commonTemplate,n);
+ numDecimals = divDecQ;
+ break;
+ }
+ }
+ // console.println("operation = " + o.value);
+ turnoff=false;
+ if (!useKeyPad) r.readonly=false;
+ mybegin=new Date();
+ try{ r.setFocus(); } catch(e) {}
+}
+function addDigit(n) {
+ if (oAlert.value != "") return;
+ switch (n) {
+ case "Enter":
+ var tmp_value=r.valueAsString;
+ this.resetForm(["result"]);
+ keypadInput=false;
+ r.value = tmp_value;
+ break;
+ case "Back":
+ keypadInput=true;
+ var tmp_value=r.valueAsString;
+ if (tmp_value != "")
+ r.value = tmp_value.substring(0,tmp_value.length-1);
+ break;
+ case "Dec":
+ keypadInput=true;
+ var v=r.valueAsString;
+ v = v + ".";
+ r.value = v;
+ break;
+ case "Minus":
+ keypadInput=true;
+ var v=r.valueAsString;
+ if (r.value < 0 ) {
+ v = String(Math.abs(v));
+ } else v = "-" + v;
+ r.value = v;
+ break;
+ default:
+ keypadInput=true;
+ v=r.valueAsString;
+ v = v + String(n);
+ r.value = v;
+ }
+}
+function ToggleKeyPad() {
+ useKeyPad = !useKeyPad;
+ if ( typeof fcMenu == "object") {
+ for (var i=0; i<fcMenu.length; i++) {
+ if (fcMenu[i].cReturn=="1") fcMenu[i].bMarked=useKeyPad;
+ if (fcMenu[i].cReturn=="3") fcMenu[i].bEnabled=useKeyPad;
+ if (fcMenu[i].cReturn=="4") fcMenu[i].bEnabled=useKeyPad;
+ }
+ }
+ this.delay=true;
+ if (useKeyPad) {
+ for (var i=0; i<= 9; i++)
+ this.getField("num"+i).display=display.visible;
+ this.getField("Back").display=display.visible;
+ this.getField("Enter").display=display.visible;
+ this.getField("Dec").display=display.visible;
+ this.getField("Minus").display=display.visible;
+ this.getField("result").readonly=true;
+ } else {
+ for (var i=0; i<= 9; i++)
+ this.getField("num"+i).display=display.hidden;
+ this.getField("Back").display=display.hidden;
+ this.getField("Enter").display=display.hidden;
+ this.getField("Dec").display=display.hidden;
+ this.getField("Minus").display=display.hidden;
+ this.getField("result").readonly=false;
+ }
+ this.delay=false;
+ getFieldObjects();
+
+}
+\end{newsegment}
+\begin{newsegment}{Custom Keystroke for Numbers}
+function fcNumber_Keystroke(nDec,sepStyle,negStyle,currStyle,
+ strCurrency,bCurrencyPrepend) {
+ if (turnoff) return;
+ var v = t.valueAsString;
+ if ( v == "")
+ { event.rc=false; this.resetForm(["result"]); }
+ else
+ if ( event.value != "-" && event.value != ".")
+ AFNumber_Keystroke(nDec,sepStyle,negStyle,currStyle,
+ strCurrency,bCurrencyPrepend);
+}
+function fcNumber_Format(nDec,sepStyle,negStyle,currStyle,
+ strCurrency,bCurrencyPrepend) {
+ if ( !useKeyPad && event.value != "-" && event.value != ".")
+ AFNumber_Format(nDec,sepStyle,negStyle,currStyle,
+ strCurrency,bCurrencyPrepend);
+}
+\end{newsegment}
+\begin{newsegment}{Touch or Mouse Friendly}
+var aKPFieldNames=new Array ("num0",
+ "num1","num4","num7","Dec","Enter",
+ "num2","num5","num8","num3","num6","num9",
+ "Back","Minus");
+var _tDlt=\amtChngMouToTou;
+var bTouchFriendly=false;
+function makeTouchFriendly() {
+ if (!useKeyPad||bTouchFriendly) return;
+ bTouchFriendly=true;
+ var indexTouch=-1, indexMouse;
+ if ( typeof fcMenu == "object") {
+ for ( var i=0; i<fcMenu.length; i++) {
+ if (fcMenu[i].cReturn=="3") indexTouch=i;
+ if (fcMenu[i].cReturn=="4") indexMouse=i;
+ }
+ if (indexTouch!=-1) {
+ fcMenu[indexTouch].bMarked=bTouchFriendly;
+ fcMenu[indexMouse].bMarked=!bTouchFriendly;
+ }
+ }
+ var r;
+ this.delay=true;
+ var TKP=this.getField("toggleKeyPadBtn");
+ var bMovTKP=(TKP!=null);
+ if (bMovTKP) {
+ var tkpRect=TKP.rect;
+ tkpRect=[tkpRect[0]+2*_tDlt,tkpRect[1]+%
+4*_tDlt,tkpRect[2]+2*_tDlt,tkpRect[3]+4*_tDlt];
+ TKP.rect=tkpRect;
+ }
+ for (var i=0; i<aKPFieldNames.length; i++) {
+ f=this.getField(aKPFieldNames[i]);
+ r=f.rect;
+ switch(i) {
+ case 0:
+ r=[r[0],r[1]+_tDlt,r[2]+2*_tDlt,r[3]];
+ break;
+ case 1: // num1 left edge
+ r=[r[0],r[1]+2*_tDlt,r[2]+_tDlt,r[3]+_tDlt];
+ break;
+ case 2: // num4 left edge
+ r=[r[0],r[1]+3*_tDlt,r[2]+_tDlt,r[3]+2*_tDlt];
+ break;
+ case 3: // num7 left edge
+ r=[r[0],r[1]+4*_tDlt,r[2]+_tDlt,r[3]+3*_tDlt];
+ break;
+ case 4: // Dec
+ r=[r[0]+2*_tDlt,r[1]+_tDlt,r[2]+3*_tDlt,r[3]];
+ break;
+ case 5: // Enter lower edge
+ r=[r[0]+3*_tDlt,r[1]+2*_tDlt,r[2]+4*_tDlt,r[3]];
+ break;
+ case 6: // num2
+ r=[r[0]+_tDlt,r[1]+2*_tDlt,r[2]+2*_tDlt,r[3]+_tDlt];
+ break;
+ case 7: // num5
+ r=[r[0]+_tDlt,r[1]+3*_tDlt,r[2]+2*_tDlt,r[3]+2*_tDlt];
+ break;
+ case 8: // num8
+ r=[r[0]+_tDlt,r[1]+4*_tDlt,r[2]+2*_tDlt,r[3]+3*_tDlt];
+ break;
+ case 9: // num2
+ r=[r[0]+2*_tDlt,r[1]+2*_tDlt,r[2]+3*_tDlt,r[3]+_tDlt];
+ break;
+ case 10: // num6
+ r=[r[0]+2*_tDlt,r[1]+3*_tDlt,r[2]+3*_tDlt,r[3]+2*_tDlt];
+ break;
+ case 11: // num9
+ r=[r[0]+2*_tDlt,r[1]+4*_tDlt,r[2]+3*_tDlt,r[3]+3*_tDlt];
+ break;
+ case 12: // Back (right edge)
+ r=[r[0]+3*_tDlt,r[1]+3*_tDlt,r[2]+4*_tDlt,r[3]+2*_tDlt];
+ break;
+ case 13: // Minus (right edge)
+ r=[r[0]+3*_tDlt,r[1]+4*_tDlt,r[2]+4*_tDlt,r[3]+3*_tDlt];
+ break;
+ }
+ f.rect=r;
+ }
+ this.delay=false;
+}
+function makeMouseFriendly() {
+ if (!useKeyPad||!bTouchFriendly) return;
+ bTouchFriendly=false;
+ var indexTouch=-1, indexMouse;
+ if ( typeof fcMenu == "object") {
+ for ( var i=0; i<fcMenu.length; i++) {
+ if (fcMenu[i].cReturn=="3") indexTouch=i;
+ if (fcMenu[i].cReturn=="4") indexMouse=i;
+ }
+ if (indexTouch != -1) {
+ fcMenu[indexTouch].bMarked=bTouchFriendly;
+ fcMenu[indexMouse].bMarked=!bTouchFriendly;
+ }
+ }
+ var r;
+ this.delay=true;
+ var TKP=this.getField("toggleKeyPadBtn");
+ var bMovTKP=(TKP!=null);
+ if (bMovTKP) {
+ var tkpRect=TKP.rect;
+ tkpRect=[tkpRect[0]-2*_tDlt,tkpRect[1]-%
+4*_tDlt,tkpRect[2]-2*_tDlt,tkpRect[3]-4*_tDlt];
+ TKP.rect=tkpRect;
+ }
+ for (var i=0; i<aKPFieldNames.length; i++) {
+ f=this.getField(aKPFieldNames[i]);
+ r=f.rect;
+ switch(i) {
+ case 0: // 0
+ r=[r[0],r[1]-_tDlt,r[2]-2*_tDlt,r[3]];
+ break;
+ case 1: // num1 left edge
+ r=[r[0],r[1]-2*_tDlt,r[2]-_tDlt,r[3]-_tDlt];
+ break;
+ case 2: // num4 left edge
+ r=[r[0],r[1]-3*_tDlt,r[2]-_tDlt,r[3]-2*_tDlt];
+ break;
+ case 3: // num7 left edge
+ r=[r[0],r[1]-4*_tDlt,r[2]-_tDlt,r[3]-3*_tDlt];
+ break;
+ case 4: // Dec
+ r=[r[0]-2*_tDlt,r[1]-_tDlt,r[2]-3*_tDlt,r[3]];
+ break;
+ case 5: // Enter lower edge
+ r=[r[0]-3*_tDlt,r[1]-2*_tDlt,r[2]-4*_tDlt,r[3]];
+ break;
+ case 6: // num2
+ r=[r[0]-_tDlt,r[1]-2*_tDlt,r[2]-2*_tDlt,r[3]-_tDlt];
+ break;
+ case 7: // num5
+ r=[r[0]-_tDlt,r[1]-3*_tDlt,r[2]-2*_tDlt,r[3]-2*_tDlt];
+ break;
+ case 8: // num8
+ r=[r[0]-_tDlt,r[1]-4*_tDlt,r[2]-2*_tDlt,r[3]-3*_tDlt];
+ break;
+ case 9: // num2
+ r=[r[0]-2*_tDlt,r[1]-2*_tDlt,r[2]-3*_tDlt,r[3]-_tDlt];
+ break;
+ case 10: // num6
+ r=[r[0]-2*_tDlt,r[1]-3*_tDlt,r[2]-3*_tDlt,r[3]-2*_tDlt];
+ break;
+ case 11: // num9
+ r=[r[0]-2*_tDlt,r[1]-4*_tDlt,r[2]-3*_tDlt,r[3]-3*_tDlt];
+ break;
+ case 12: // Back (right edge)
+ r=[r[0]-3*_tDlt,r[1]-3*_tDlt,r[2]-4*_tDlt,r[3]-2*_tDlt];
+ break;
+ case 13: // Minus (right edge)
+ r=[r[0]-3*_tDlt,r[1]-4*_tDlt,r[2]-4*_tDlt,r[3]-3*_tDlt];
+ break;
+ }
+ f.rect=r;
+ }
+ this.delay=false;
+% getFieldObjects();
+}
+\end{newsegment}
+\begin{newsegment}{Option Dialog Box}
+var fcDialog =
+{
+ // set a default value for radio button field
+ initialize: function(dialog) {
+ var addDT="AT0" + String(addDecT);
+ var addDB="AB0" + String(addDecB);
+ var subDT="ST0" + String(subDecT);
+ var subDB="SB0" + String(subDecB);
+ var mulDT="MT0" + String(mulDecT);
+ var mulDB="MB0" + String(mulDecB);
+ var divDQ="DQ0" + String(divDecQ);
+ var divDB="DB0" + String(divDecB);
+ var radioString = addDT +": true, " + addDB +": true, "
+ + subDT + ": true, " + subDB + ": true, "
+ + mulDT + ": true, " + mulDB + ": true, "
+ + divDQ + ": true, " + divDB + ": true ";
+//console.println("radioString="+radioString);
+ eval("dialog.load({" + radioString + "})");
+ dialog.load({
+ // Populate the addition first
+ "aT_a": util.printf("\%.0f",addT_a),
+ "aT_b": util.printf("\%.0f",addT_b),
+ "aB_a": util.printf("\%.0f",addB_a),
+ "aB_b": util.printf("\%.0f",addB_b),
+ // subtraction
+ "sT_a": util.printf("\%.0f",subT_a),
+ "sT_b": util.printf("\%.0f",subT_b),
+ "sB_a": util.printf("\%.0f",subB_a),
+ "sB_b": util.printf("\%.0f",subB_b),
+ "nsCB": fcAllowNegSub,
+ // multiplication
+ "mT_a": util.printf("\%.0f",mulT_a),
+ "mT_b": util.printf("\%.0f",mulT_b),
+ "mB_a": util.printf("\%.0f",mulB_a),
+ "mB_b": util.printf("\%.0f",mulB_b),
+ // division
+ "dQ_a": util.printf("\%.0f",divQ_a),
+ "dQ_b": util.printf("\%.0f",divQ_b),
+ "dB_a": util.printf("\%.0f",divB_a),
+ "dB_b": util.printf("\%.0f",divB_b)
+ });
+ },
+ // when user presses "Ok", this handler will execute first
+ commit: function(dialog) {
+ var results = dialog.store();
+ addT_a = Math.round(results["aT_a"]);
+ addT_b = Math.round(results["aT_b"]);
+ addB_a = Math.round(results["aB_a"]);
+ addB_b = Math.round(results["aB_b"]);
+ for (var i=0; i < 3; i++)
+ if (results["AT0"+i]) { addDecT = i; break; }
+ for (var i=0; i < 3; i++)
+ if (results["AB0"+i]) { addDecB = i; break; }
+ // subtraction
+ subT_a = Math.round(results["sT_a"]);
+ subT_b = Math.round(results["sT_b"]);
+ subB_a = Math.round(results["sB_a"]);
+ subB_b = Math.round(results["sB_b"]);
+ for (var i=0; i < 3; i++)
+ if (results["ST0"+i]) { subDecT = i; break; }
+ for (var i=0; i < 3; i++)
+ if (results["SB0"+i]) { subDecB = i; break; }
+ fcAllowNegSub = results["nsCB"];
+ // multiplication
+ mulT_a = Math.round(results["mT_a"]);
+ mulT_b = Math.round(results["mT_b"]);
+ mulB_a = Math.round(results["mB_a"]);
+ mulB_b = Math.round(results["mB_b"]);
+ for (var i=0; i < 3; i++)
+ if (results["MT0"+i]) { mulDecT = i; break; }
+ for (var i=0; i < 3; i++)
+ if (results["MB0"+i]) { mulDecB = i; break; }
+ // division
+ divQ_a = Math.round(results["dQ_a"]);
+ divQ_b = Math.round(results["dQ_b"]);
+ divB_a = Math.round(results["dB_a"]);
+ divB_b = Math.round(results["dB_b"]);
+ for (var i=0; i < 3; i++)
+ if (results["DQ0"+i]) { divDecQ = i; break; }
+ for (var i=0; i < 3; i++)
+ if (results["DB0"+i]) { divDecB = i; break; }
+ },
+ // The Dialog Description
+ description:
+ {
+ name: "PDF Flash Cards - Options",
+ align_children: "align_left",
+ elements:
+ [
+\bFCa
+ { // The Addition Cluster
+ type: "cluster",
+ name: "\fcAdditionName",
+ item_id: "add",
+ align_children: "align_left",
+ elements:
+ [
+ {
+ type: "view",
+ align_children: "align_row",
+ elements:
+ [
+ {
+ type: "static_text",
+ item_id: "addRngT",
+ width: \fcOptTextWidth,
+ name: "\fcOptTopRange"
+ },
+ {
+ item_id: "aT_a",
+ type: "edit_text",
+ alignment: "align_fill",
+ width: 40,
+ height: 20
+ },
+ {
+ type: "static_text",
+ item_id: "addRngToT",
+ name: "\fcOptTo"
+ },
+ {
+ item_id: "aT_b",
+ type: "edit_text",
+ alignment: "align_fill",
+ width: 40,
+ height: 20
+ },
+ {
+ type: "view",
+ align_children: "align_distribute",
+ elements:
+ [
+ {
+ type: "static_text",
+ item_id: "aDcT",
+ name: "\fcOptDecimal"
+ },
+ {
+ type: "radio",
+ item_id: "AT00",
+ group_id: "AddT",
+ name: "\fcOptDecimalNone"
+ },
+ {
+ type: "radio",
+ item_id: "AT01",
+ group_id: "AddT",
+ name: "1",
+ },
+ {
+ type: "radio",
+ item_id: "AT02",
+ group_id: "AddT",
+ name: "2",
+ },
+ ]
+ },
+ ]
+ },
+ {
+ type: "view",
+ align_children: "align_row",
+ elements:
+ [
+ {
+ type: "static_text",
+ item_id: "addRngB",
+ width: \fcOptTextWidth,
+ name: "\fcOptBottomRange"
+ },
+ {
+ item_id: "aB_a",
+ type: "edit_text",
+ alignment: "align_fill",
+ width: 40,
+ height: 20
+ },
+ {
+ type: "static_text",
+ item_id: "addRngToB",
+ name: "\fcOptTo"
+ },
+ {
+ item_id: "aB_b",
+ type: "edit_text",
+ alignment: "align_fill",
+ width: 40,
+ height: 20
+ },
+ {
+ type: "view",
+ align_children: "align_distribute",
+ elements:
+ [
+ {
+ type: "static_text",
+ item_id: "aDcB",
+ name: "\fcOptDecimal"
+ },
+ {
+ type: "radio",
+ item_id: "AB00",
+ group_id: "AddB",
+ name: "\fcOptDecimalNone"
+ },
+ {
+ type: "radio",
+ item_id: "AB01",
+ group_id: "AddB",
+ name: "1",
+ },
+ {
+ type: "radio",
+ item_id: "AB02",
+ group_id: "AddB",
+ name: "2",
+ },
+ ]
+ },
+ ]
+ }
+ ]
+ }, // End Addition Cluster
+\eFCa
+\bFCs
+ { // The Subtraction Cluster
+ type: "cluster",
+ name: "\fcSubtractionName",
+ item_id: "sub",
+ align_children: "align_left",
+ elements:
+ [
+ {
+ type: "view",
+ align_children: "align_row",
+ elements:
+ [
+ {
+ type: "static_text",
+ item_id: "subRngT",
+ width: \fcOptTextWidth,
+ name: "\fcOptTopRange"
+ },
+ {
+ item_id: "sT_a",
+ type: "edit_text",
+ alignment: "align_fill",
+ width: 40,
+ height: 20
+ },
+ {
+ type: "static_text",
+ item_id: "subRngToT",
+ name: "\fcOptTo"
+ },
+ {
+ item_id: "sT_b",
+ type: "edit_text",
+ alignment: "align_fill",
+ width: 40,
+ height: 20
+ },
+ {
+ type: "view",
+ align_children: "align_distribute",
+ elements:
+ [
+ {
+ type: "static_text",
+ item_id: "sDT",
+ name: "\fcOptDecimal"
+ },
+ {
+ type: "radio",
+ item_id: "ST00",
+ group_id: "SubT",
+ name: "\fcOptDecimalNone"
+ },
+ {
+ type: "radio",
+ item_id: "ST01",
+ group_id: "SubT",
+ name: "1",
+ },
+ {
+ type: "radio",
+ item_id: "ST02",
+ group_id: "SubT",
+ name: "2",
+ },
+ ]
+ },
+ ]
+ },
+ {
+ type: "view",
+ align_children: "align_row",
+ elements:
+ [
+ {
+ type: "static_text",
+ item_id: "subRngB",
+ width: \fcOptTextWidth,
+ name: "\fcOptBottomRange"
+ },
+ {
+ item_id: "sB_a",
+ type: "edit_text",
+ alignment: "align_fill",
+ width: 40,
+ height: 20
+ },
+ {
+ type: "static_text",
+ item_id: "subRngToB",
+ name: "\fcOptTo"
+ },
+ {
+ item_id: "sB_b",
+ type: "edit_text",
+ alignment: "align_fill",
+ width: 40,
+ height: 20
+ },
+ {
+ type: "view",
+ align_children: "align_distribute",
+ elements:
+ [
+ {
+ type: "static_text",
+ item_id: "sDcB",
+ name: "\fcOptDecimal"
+ },
+ {
+ type: "radio",
+ item_id: "SB00",
+ group_id: "SubB",
+ name: "\fcOptDecimalNone"
+ },
+ {
+ type: "radio",
+ item_id: "SB01",
+ group_id: "SubB",
+ name: "1",
+ },
+ {
+ type: "radio",
+ item_id: "SB02",
+ group_id: "SubB",
+ name: "2",
+ },
+ ]
+ },
+ ]
+ },
+//--
+ {
+ type: "view",
+ align_children: "align_row",
+ elements:
+ [
+ {
+ type: "static_text",
+ item_id: "nSub",
+ name: "\fcOptAllowNegNumber"
+ },
+ {
+ type:"check_box",
+ item_id: "nsCB"
+ }
+ ]
+ }
+//--
+ ]
+ }, // End Subtraction Cluster
+\eFCs
+\bFCm
+ { // The Multiplication Cluster
+ type: "cluster",
+ name: "\fcMultiplicationName",
+ item_id: "mul",
+ align_children: "align_left",
+ elements:
+ [
+ {
+ type: "view",
+ align_children: "align_row",
+ elements:
+ [
+ {
+ type: "static_text",
+ item_id: "mulRngT",
+ width: \fcOptTextWidth,
+ name: "\fcOptTopRange"
+ },
+ {
+ item_id: "mT_a",
+ type: "edit_text",
+ alignment: "align_fill",
+ width: 40,
+ height: 20
+ },
+ {
+ type: "static_text",
+ item_id: "mulRngToT",
+ name: "\fcOptTo"
+ },
+ {
+ item_id: "mT_b",
+ type: "edit_text",
+ alignment: "align_fill",
+ width: 40,
+ height: 20
+ },
+ {
+ type: "view",
+ align_children: "align_distribute",
+ elements:
+ [
+ {
+ type: "static_text",
+ item_id: "mDcT",
+ name: "\fcOptDecimal"
+ },
+ {
+ type: "radio",
+ item_id: "MT00",
+ group_id: "MulT",
+ name: "\fcOptDecimalNone"
+ },
+ {
+ type: "radio",
+ item_id: "MT01",
+ group_id: "MulT",
+ name: "1",
+ },
+ {
+ type: "radio",
+ item_id: "MT02",
+ group_id: "MulT",
+ name: "2",
+ },
+ ]
+ },
+ ]
+ },
+ {
+ type: "view",
+ align_children: "align_row",
+ elements:
+ [
+ {
+ type: "static_text",
+ item_id: "mulRngB",
+ width: \fcOptTextWidth,
+ name: "\fcOptBottomRange"
+ },
+ {
+ item_id: "mB_a",
+ type: "edit_text",
+ alignment: "align_fill",
+ width: 40,
+ height: 20
+ },
+ {
+ type: "static_text",
+ item_id: "mulRngToB",
+ name: "\fcOptTo"
+ },
+ {
+ item_id: "mB_b",
+ type: "edit_text",
+ alignment: "align_fill",
+ width: 40,
+ height: 20
+ },
+ {
+ type: "view",
+ align_children: "align_distribute",
+ elements:
+ [
+ {
+ type: "static_text",
+ item_id: "mDcB",
+ name: "\fcOptDecimal"
+ },
+ {
+ type: "radio",
+ item_id: "MB00",
+ group_id: "MulB",
+ name: "\fcOptDecimalNone"
+ },
+ {
+ type: "radio",
+ item_id: "MB01",
+ group_id: "MulB",
+ name: "1",
+ },
+ {
+ type: "radio",
+ item_id: "MB02",
+ group_id: "MulB",
+ name: "2",
+ },
+ ]
+ },
+ ]
+ }
+ ]
+ }, // End Multiplication Cluster
+\eFCm
+\bFCd
+ { // The Division Cluster
+ type: "cluster",
+ name: "\fcDivisionName",
+ item_id: "div",
+ align_children: "align_left",
+ elements:
+ [
+ {
+ type: "view",
+ align_children: "align_row",
+ elements:
+ [
+ {
+ type: "static_text",
+ item_id: "divRngQ",
+ width: \fcOptTextWidth,
+ name: "\fcOptTopRangeDiv"
+ },
+ {
+ item_id: "dQ_a",
+ type: "edit_text",
+ alignment: "align_fill",
+ width: 40,
+ height: 20
+ },
+ {
+ type: "static_text",
+ item_id: "divRngToT",
+ name: "\fcOptTo"
+ },
+ {
+ item_id: "dQ_b",
+ type: "edit_text",
+ alignment: "align_fill",
+ width: 40,
+ height: 20
+ },
+ {
+ type: "view",
+ align_children: "align_distribute",
+ elements:
+ [
+ {
+ type: "static_text",
+ item_id: "dDcQ",
+ name: "\fcOptDecimal"
+ },
+ {
+ type: "radio",
+ item_id: "DQ00",
+ group_id: "DivQ",
+ name: "\fcOptDecimalNone"
+ },
+ {
+ type: "radio",
+ item_id: "DQ01",
+ group_id: "DivQ",
+ name: "1",
+ },
+ {
+ type: "radio",
+ item_id: "DQ02",
+ group_id: "DivQ",
+ name: "2",
+ },
+ ]
+ },
+ ]
+ },
+ {
+ type: "view",
+ align_children: "align_row",
+ elements:
+ [
+ {
+ type: "static_text",
+ item_id: "divRngB",
+ width: \fcOptTextWidth,
+ name: "\fcOptBottomRangeDiv"
+ },
+ {
+ item_id: "dB_a",
+ type: "edit_text",
+ alignment: "align_fill",
+ width: 40,
+ height: 20
+ },
+ {
+ type: "static_text",
+ item_id: "divRngToB",
+ name: "\fcOptTo"
+ },
+ {
+ item_id: "dB_b",
+ type: "edit_text",
+ alignment: "align_fill",
+ width: 40,
+ height: 20
+ },
+ {
+ type: "view",
+ align_children: "align_distribute",
+ elements:
+ [
+ {
+ type: "static_text",
+ item_id: "dDcB",
+ name: "\fcOptDecimal"
+ },
+ {
+ type: "radio",
+ item_id: "DB00",
+ group_id: "DivB",
+ name: "\fcOptDecimalNone"
+ },
+ {
+ type: "radio",
+ item_id: "DB01",
+ group_id: "DivB",
+ name: "1",
+ },
+ {
+ type: "radio",
+ item_id: "DB02",
+ group_id: "DivB",
+ name: "2",
+ },
+ ]
+ },
+ ]
+ }
+ ]
+ }, // End Division Cluster
+\eFCd
+ {
+ type: "view",
+ align_children: "align_row",
+ elements:
+ [
+ {
+ alignment: "align_right",
+ type: "ok_cancel",
+ }
+ ]
+ }
+ ]
+ }
+}
+\end{newsegment}
+\end{insDLJS*}
+\begin{insDLJS}[fcMenu]{fcmd}{Menu Data}
+\fcMenu
+function processFcMenu() {
+ if ( (typeof fcMenu == "object") && fcMenu.length!=0 ) {
+ var cChoice = \popUpMenu(fcMenu);
+ if ( cChoice != null ) {
+ switch(cChoice) {
+ case "0": app.execDialog(fcDialog);
+ break;
+ case "1": ToggleKeyPad();
+ break;
+ case "2": app.execMenuItem("GeneralInfo");
+ break;
+ case "3": makeTouchFriendly();
+ break;
+ case "4": makeMouseFriendly();
+ break;
+ default:
+ if ( typeof processCustomFcMenu == "function" )
+ processCustomFcMenu(cChoice);
+ return;
+ }
+ }
+ } else app.alert("\fcMenuFCMsg");
+}
+\end{insDLJS}
+% \end{macrocode}
+% \begin{macrocode}
+\InputIfFileExists{fc_custom.def}{}{}
+% \end{macrocode}
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
diff --git a/texmf-dist/source/latex/fc-arith/fc_arith.ins b/texmf-dist/source/latex/fc-arith/fc_arith.ins
new file mode 100644
index 00000000..dcf5c0c2
--- /dev/null
+++ b/texmf-dist/source/latex/fc-arith/fc_arith.ins
@@ -0,0 +1,62 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1999-2006 D. P. Story
+%%
+%% This file is part of the `AcroTeX eDucation Bundle'.
+%% -------------------------------------------
+%%
+%% It may be distributed under the conditions of the LaTeX Project Public
+%% License, either version 1.2 of this license or (at your option) any
+%% later version. The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.2 or later is part of all distributions of LaTeX
+%% version 1999/12/01 or later.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2010/03/17}
+\def\batchfile{fc_arith.ins}
+\input docstrip
+
+\ifx\generate\undefined
+ \Msg{**********************************************}
+ \Msg{*}
+ \Msg{* This installation requires docstrip}
+ \Msg{* version 2.4 or later.}
+ \Msg{*}
+ \Msg{* An older version of docstrip has been input}
+ \Msg{*}
+ \Msg{**********************************************}
+ \errhelp{Move or rename old docstrip.tex and get a newer one.}
+ \errmessage{Old docstrip in input path}
+ \batchmode
+ \csname @@end\endcsname\end
+\fi
+
+\keepsilent
+\askforoverwritefalse
+%\askonceonly
+%\usedir{tex/latex/hyperref}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\preamble
+\endpreamble
+
+\generate{%
+ \file{fc_arith.sty}{\from{fc_arith.dtx}{copyright,package}}
+ \file{fc_arith.drv}{\from{fc_arith.dtx}{copyright,driver}}
+}
+
+\Msg{***************************************************************}
+\Msg{*}
+\Msg{* \space To finish the installation you have to copy the files }
+\Msg{*}
+\Msg{* \space *.sty, *.cfg and *.def into a directory searched by TeX}
+\Msg{*}
+\Msg{***************************************************************}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\endinput
diff --git a/texmf-dist/source/latex/fldigigal/fldigigal.dtx b/texmf-dist/source/latex/fldigigal/fldigigal.dtx
new file mode 100644
index 00000000..520d1bdf
--- /dev/null
+++ b/texmf-dist/source/latex/fldigigal/fldigigal.dtx
@@ -0,0 +1,452 @@
+%\iffalse
+%<*copyright>
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% fldigigal.sty package, 2010-23-10 %%
+%% Copyright (C) 2010 D. P. Story %%
+%% dpstory@uakron.edu %%
+%% %%
+%% This program can redistributed and/or modified under %%
+%% the terms of the LaTeX Project Public License %%
+%% Distributed from CTAN archives in directory %%
+%% macros/latex/base/lppl.txt; either version 1 of the %%
+%% License, or (at your option) any later version. %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%</copyright>
+%<package>\NeedsTeXFormat{LaTeX2e}[1997/12/01]
+%<package>\ProvidesPackage{fldigigal}
+%<package> [2010/12/29 v0.5c fldigigal: Create a Flash Digital Gallery, Acrobat Distiller only (dps)]
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage[colorlinks,hyperindex]{hyperref}
+%\pdfstringdefDisableCommands{\let\\\textbackslash}
+%\EnableCrossrefs \CodelineIndex
+\begin{document}
+\def\CMD#1{\textbackslash#1}
+ \GetFileInfo{fldigigal.sty}
+ \title{\textsf{fldigigal}: Package for creating a Flash Digital Gallery}
+ \author{D. P. Story\\
+ Email: \texttt{dpstory@uakron.edu}}
+ \date{processed \today}
+ \maketitle
+ \tableofcontents
+ \let\Email\texttt
+ \DocInput{fldigigal.dtx}
+ \PrintIndex
+\end{document}
+%</driver>
+% \fi
+% \MakeShortVerb{|}
+% \StopEventually{}
+%
+% \DoNotIndex{\def,\edef,\gdef,\xdef,\global,\long,\let}
+% \DoNotIndex{\expandafter,\string,\the,\ifx,\else,\fi}
+% \DoNotIndex{\csname,\endcsname,\relax,\begingroup,\endgroup}
+% \DoNotIndex{\DeclareTextCommand,\DeclareTextCompositeCommand}
+% \DoNotIndex{\space,\@empty,\special}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% \begin{macrocode}
+\RequirePackage{xkeyval}
+\RequirePackage{rmannot}[2010/12/22]
+% \end{macrocode}
+%
+% \section{Introduction}
+%
+% \section{Implementation}
+% This package offers the \LaTeX/Distiller user the ability to create
+% \emph{Flash Photo Galleries}. There are several photo gallery layouts
+% to select from, and some dynamic options that can be specified. The
+% digital photographs (\textsf{JPG}, \textsf{PNG}, or \textsf{GIF}) may
+% be embedded in the PDF document, or may reside online and referenced by
+% an \textsf{URL}.
+%
+% \begin{macro}{\fdgFolder} The path to the folder containing
+% the the \textsf{SWF} files of this distribution. This path is set through
+% the \texttt{fldigigal.cfg} file.
+% \begin{macrocode}
+\newcommand{\fdgFolder}{C:/Users/Public/Documents/My TeX Files/%
+ tex/latex/aeb/aebpro/fldigigal/swf}
+% \end{macrocode}
+% \end{macro}
+% We input the file \texttt{fldigigal.cfg} which should contain a re-definition
+% of the command \cs{fdgFolder}, the path to the Flash Digital Gallery \textsf{SWFs}.
+% \begin{macrocode}
+\InputIfFileExists{fldigigal.cfg}{}{}
+% \end{macrocode}
+% \subsection{Main Code}
+% In this section we define the \cs{fdgXmlList} and \cs{fgRmAnnot}, and their
+% supporting cast of characters.
+% \begin{macrocode}
+% \end{macrocode}
+% An internal command for getting the rma object based on the current page and the
+% name of the annot.
+% \begin{macrocode}
+\def\fdg@namegdef#1{\expandafter\gdef\csname #1\endcsname}
+\def\fdg@namexdef#1{\expandafter\xdef\csname #1\endcsname}
+% \end{macrocode}
+% We define \cs{fdg@iso}, which, within the \cs{image} command, we declare that
+% \verb!\let\iso\fdg@iso!, defining the \cs{iso} command to enter special characters
+% in the \texttt{caption} attribute.
+% \begin{macrocode}
+{\catcode`\#=12 \catcode`\&=12 \catcode`\!=6
+ \gdef\fdg@iso!1{&#!1;}
+}
+% \end{macrocode}
+% \begin{macro}{\fdgXmlList}
+% The \cs{fdgXmlList} command describes the photos to be displayed in the
+% digital gallery. Here is an example of the structure:
+%\begin{verbatim}
+%\fdgXmlList[showcount]{myDigis}{%
+% \image{path=\myPhotosLocal/Chrysanthemum.jpg,caption=Chrysanthemum}
+% \image{path=\myPhotosLocal/Desert.jpg,caption=Desert}
+% \image{path=\myPhotosOnline/Hydrangeas.jpg,caption=Hydrangeas,online}
+% \image{path=\myPhotosOnline/Jellyfish.jpg,caption=Jellyfish,online}
+% \image{path=\myPhotosOnline/Koala.jpg,caption=Koala,online}
+% \image{path=\myPhotosOnline/Lighthouse.jpg,caption=Lighthouse,online}
+% \image{path=\myPhotosOnline/Penguins.jpg,caption=Penguins,online}
+% \image{path=\myPhotosOnline/Tulips.jpg,caption=Tulips,online}
+%}
+%\end{verbatim}
+% The first optional argument takes any optional arguments; at this time, the
+% only option is \texttt{showcount}, where the photo number and total number of
+% photos is displayed, e.g. \texttt{(2 of 8)}. The default is not to show the count.
+% The second parameter is the unique name of the gallery. The third parameter consists
+% of any number of image specifications. The \cs{image} command has three properties:
+% \texttt{path}, \texttt{caption}, and \texttt{online}. These are describe
+% in more detail below.
+% \begin{macro}{path} The absolute path (url) to the photo; the path may be on a local
+% hard drive, or on the Internet. Paths may (should) be defined using the
+% the \cs{definePath}, defined in the \texttt{eforms} package.
+%\begin{verbatim}
+% \definePath{\myPhotosOnline}{%
+% http://www.math.uakron.edu/~dpstory/photos/pa_demo}
+% \definePath{\myPhotosLocal}{%
+% C:/Users/Public/Pictures/Sample Pictures}
+%\end{verbatim}
+% \begin{macrocode}
+\define@key{fdgxml}{path}[]{\def\fdg@pa@path{#1}}
+% \end{macrocode}
+% \end{macro}
+% \DescribeMacro{caption} A (short) string that describes the photo. If the
+% \texttt{caption} key is not present, the filename of the digital photo is used.
+% \begin{macrocode}
+\define@key{fdgxml}{caption}[]{\def\fdg@pa@caption{#1}}
+% \end{macrocode}
+% \DescribeMacro{online} A Boolean key, which if true, signals that the path
+% to the photo is on the Internet (\texttt{http://}). If the \texttt{online} key is not
+% present, the path is assumed to be local, and the photo will be embedded in the PDF.
+% \begin{macrocode}
+\define@boolkey{fdgxml}{online}[true]{}
+% \end{macrocode}
+% We set the global defaults of these key-value pairs.
+% \begin{macrocode}
+\setkeys{fdgxml}{path,caption,online=false}
+% \end{macrocode}
+% We use this counter to count the digis as they are defined by the \cs{image}
+% macro.
+% \begin{macrocode}
+\newcount\cntdigis
+% \end{macrocode}
+% \DescribeMacro{\image} There are two definitions of the \cs{image} command:
+% \cs{fdg@cnt@images} and \cs{fdg@image}.\par\medskip\noindent
+% \cs{fdg@cnt@images} counts the number of images.
+% \begin{macrocode}
+\def\fdg@cnt@images#1{\advance\cntdigis1 }
+% \end{macrocode}
+% \cs{fdg@image} does all the work in writing the photo information to an XML file.
+% \begin{macrocode}
+\def\fdg@image#1{\begingroup
+ \let\Name\rma@resource\let\urlName\rma@urlresource
+ \setkeys{fdgxml}{#1}%
+ \global\advance\cntdigis1
+% \end{macrocode}
+% We expand the internal name of the digital resource. The name has the form
+% \texttt{Im<number>(<name>)}.
+% \begin{macrocode}
+ \edef\@digiImgName{Im\the\cntdigis(\fdg@CurrDigiName)}%
+% \end{macrocode}
+% Use \cs{saveNamedPath} to save this name and path.
+% \begin{macrocode}
+ \saveNamedPath{\@digiImgName}{\fdg@pa@path}%
+% \end{macrocode}
+% Get the basename and extension using the \cs{Name} command.
+% \begin{macrocode}
+ \edef\fdg@NamedExp{\expandafter\Name\expandafter{\@digiImgName}}%
+% \end{macrocode}
+% If the caption is empty, use the \texttt{basename.ext}
+% \begin{macrocode}
+ \ifx\fdg@pa@caption\@empty\def\fdg@pa@caption{\fdg@NamedExp}\fi
+% \end{macrocode}
+% If \texttt{online} is true, write the full url path to the xml using
+% the \cs{urlName} macro.
+% \begin{macrocode}
+ \ifKV@fdgxml@online
+ \edef\fdg@urlNamedExp{%
+ \expandafter\urlName\expandafter{\@digiImgName}}%
+ \fdg@IWVO{\space\space\space\space
+ <image title='\fdg@pa@caption\fdg@cntOf{\the\cntdigis}'>%
+ \fdg@urlNamedExp</image>
+ }%
+ \else
+% \end{macrocode}
+% If online is not listed, or is set to \texttt{false} we embed. We
+% accumulate all resources that are embedded in \cs{fdg@embededResources}
+% \begin{macrocode}
+ \toks0=\expandafter{\fdg@embededResources}%
+ \ifx\fdg@embededResources\@empty
+ \xdef\fdg@embededResources{\@digiImgName}\else
+ \xdef\fdg@embededResources{\the\toks0,\@digiImgName}\fi
+ \fdg@IWVO{\space\space\space\space
+ <image title='\fdg@pa@caption\fdg@cntOf{\the\cntdigis}'>%
+ \fdg@NamedExp</image>
+ }%
+ \fi
+\endgroup}
+% \end{macrocode}
+% Convenience macro for writing to the XML file
+% \begin{macrocode}
+\def\fdg@IWVO{\immediate\write\verbatim@out}
+% \end{macrocode}
+% A (internal) interface to the digi resources. The one argument
+% is the name of the gallery these digis are associated with.
+% \begin{macrocode}
+\def\embededResources#1{\csname #1ERs\endcsname}
+% \end{macrocode}
+% The internal name of the xmlList. The argument is the name of the gallery.
+% \begin{macrocode}
+\def\xmlListiv#1{xmlList4#1}
+% \end{macrocode}
+% \begin{macro}{\fdgcntOf}
+% The internal command for writing the photo count is \cs{fdg@cntOf}. Initially,
+% we \cs{let} \cs{fdg@cntOf} to \cs{@gobble}
+% \begin{macrocode}
+\let\fdg@cntOf\@gobble
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand{\fdgcntOf}[1]{\space(#1 of \fdg@numDigis)}
+% \end{macrocode}
+% \end{macro}
+% The options of \cs{fdgXmlList}. If \texttt{true} the photo number is displayed, if \texttt{false},
+% the default, no photo number is displayed.\par\medskip\noindent
+% \DescribeMacro{showcount} When the \texttt{showcount} option is specified, we \cs{let} \cs{fdg@cntOf}
+% to \cs{fdgcntOf}. The command may be redefined. The first argument is the photo
+% number, the command \cs{fdg@numDigis} expands to the total number of photos.
+% \begin{macrocode}
+\define@boolkey{fdgXML}{showcount}[true]{%
+ \ifKV@fdgXML@showcount\let\fdg@cntOf\fdgcntOf\else
+ \let\fdg@cntOf\@gobble\fi
+}
+% \end{macrocode}
+%\DescribeMacro{nowrite} When we set this switch, we \cs{let}
+% \cs{fdg@IWVO} to \cs{@gobble}, and do not open a \cs{newwrite} stream.
+% \begin{macrocode}
+\define@boolkey{fdgXML}{nowrite}[true]{}
+% \end{macrocode}
+% Set the defaults for he \cs{fdgXML} family.
+% \begin{macrocode}
+\setkeys{fdgXML}{showcount=false,nowrite=false}
+% \end{macrocode}
+% Finally, we have the definition of \cs{fdgXmlList}.
+% \begin{macrocode}
+\newcommand{\fdgXmlList}[3][]{%
+\begingroup
+ \setkeys{fdgXML}{#1}%
+ \ifKV@fdgXML@nowrite\let\fdg@IWVO\@gobble\fi
+ \cntdigis=0 \gdef\fdg@embededResources{}%
+ \ifKV@fdgXML@nowrite\else
+ \newwrite \fdg@writexmllist
+ \immediate\openout \fdg@writexmllist=#2.xml
+ \let\verbatim@out\fdg@writexmllist
+ \fi
+% \end{macrocode}
+% Open he photos xml file and write the top level
+% \begin{macrocode}
+ \fdg@IWVO{<photos>}%
+ \@ifundefined{#2@fdgdigis}{%
+ \fdg@namegdef{#2@fdgdigis}{#2}%
+ \def\fdg@CurrDigiName{#2}%
+ }{\PackageError{fldigigal}{Name already chosen}}%
+% \end{macrocode}
+% The \texttt{\#3} parameter contains the \cs{image} listing.
+% we first count the number of images using \cs{fdg@cnt@images}.
+% \begin{macrocode}
+ \let\image\fdg@cnt@images#3%
+ \edef\fdg@numDigis{\the\cntdigis}%
+% \end{macrocode}
+% Now, we repeat, but this time with \cs{fdg@image}.
+% \begin{macrocode}
+ \def\'{&apos;}\let\iso\fdg@iso
+ \cntdigis=0 \let\image\fdg@image#3%
+% \end{macrocode}
+% Close out XML List
+% \begin{macrocode}
+ \fdg@IWVO{</photos>}%
+ \ifKV@fdgXML@nowrite\else
+ \immediate\closeout \fdg@writexmllist
+ \fi
+\endgroup
+% \end{macrocode}
+% Save the path to the newly created xml list under the name
+% \texttt{xmlList4<name>}
+% \begin{macrocode}
+ \saveNamedPath{xmlList4#2}{\pathToSource/#2.xml}%
+% \end{macrocode}
+% Define a command to save the embedded resources.
+% \begin{macrocode}
+ \fdg@namexdef{#2ERs}{\ifx\fdg@embededResources\@empty\else,\fi
+ \fdg@embededResources}%
+}
+\@onlypreamble{\fdgXmlList}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\fgRmannot}
+% This is the command that actually places the SWF. It uses the \cs{rmAnnot} command
+% from the \textsf{rmannot} package.
+% \paragraph*{Define Key-Value Pairs.} We declare two keys for \cs{fgRmannot}: \texttt{gallery} and \texttt{flashvars}.
+% We use gallery to select the gallery (layout), and flashvars to set some basic
+% parameters of the SWF.
+% \begin{macrocode}
+\define@key{fgRmAnnot}{flashvars}[]{\def\fgRmAnnot@flashvars{&#1}}
+\let\fgRmAnnot@flashvars\@empty
+\define@key{fgRmAnnot}{galleryopts}[]{\def\fgRmAnnot@galleryopts{#1}}
+% \end{macrocode}
+% The `\cs{saveNamePath}' definitions for the three supported galleries.
+% I have a custom gallery for no apparent reason (actually, if I want to
+% create and test a new gallery, I can set it up to use the \texttt{custom} key.
+% \begin{macrocode}
+\saveNamedPath{fdg_vt1}{\fdgFolder/fdg_vt1.swf}
+\saveNamedPath{fdg_ht1}{\fdgFolder/fdg_ht1.swf}
+\saveNamedPath{fdg_nt1}{\fdgFolder/fdg_nt1.swf}
+\saveNamedPath{custom}{\fdgFolder/fdg_vt1.swf}
+% \end{macrocode}
+% \paragraph*{fgGalleryOpts keys.}We now define the key value pairs for the \texttt{fgGalleryOpts} family.
+% These are the keys as listed by \texttt{galleryopts}.
+%
+% \DescribeMacro{gallery} At this time, we offer four choices for a design, more to follow as I learn
+% more about Flash Pro CS5.
+% \begin{macrocode}
+\define@choicekey+{fgGalleryOpts}{gallery}[\val\nr]%
+ {vthumbs1,hthumbs1,nothumbs1,custom}[vthumbs1]{%
+ \ifcase\nr\relax
+ \def\fgGalleryOpts@gallery{fdg_vt1}\or
+ \def\fgGalleryOpts@gallery{fdg_ht1}\or
+ \def\fgGalleryOpts@gallery{fdg_nt1}\or
+ \def\fgGalleryOpts@gallery{custom}\fi
+}{}
+% \end{macrocode}
+% \DescribeMacro{trans} Some standard transitions for the photos.
+% \begin{macrocode}
+\define@choicekey+{fgGalleryOpts}{trans}[\val\nr]%
+ {Blinds,Fade,Fly,Iris,Photo,PixelDissolve,Rotate,%
+ Squeeze,Wipe,Zoom,Random}[Random]{%
+ \edef\fgGalleryOpts@trans{\val}%
+}{}
+\let\fgGalleryOpts@trans\@empty
+% \end{macrocode}
+% \DescribeMacro{delay} The amount of delay between the automatic display of
+% a new photo. The default is 6 (seconds)
+% \begin{macrocode}
+\define@key{fgGalleryOpts}{delay}[6]{\def\fgGalleryOpts@delay{#1}}
+\let\fgGalleryOpts@delay\@empty
+% \end{macrocode}
+% \DescribeMacro{auto} A Boolean switch, which if \texttt{true}, the photos are displayed
+% automatically, the delay is determined by the \texttt{delay} key. The default is \texttt{auto=true}.
+% \begin{macrocode}
+\define@boolkey{fgGalleryOpts}{auto}[true]{%
+ \edef\fgGalleryOpts@auto{\ifKV@fgGalleryOpts@auto
+ true\else false\fi}}
+% \end{macrocode}
+% \DescribeMacro{transOn} A Boolean switch, which if \texttt{true}, a transition effect is used to transition
+% between photos.
+% \begin{macrocode}
+\define@boolkey{fgGalleryOpts}{transOn}[true]{%
+ \edef\fgGalleryOpts@transOn{\ifKV@fgGalleryOpts@transOn
+ true\else false\fi}}
+% \end{macrocode}
+% \DescribeMacro{captionalign} For all galleries except for \texttt{fdg\_nt1} we can align
+% the position of the caption: \texttt{left}, \texttt{right}, or \texttt{center}. The default is \texttt{left}.
+% \begin{macrocode}
+\define@choicekey+{fgGalleryOpts}{captionalign}[\val\nr]%
+ {left,right,center}[left]{%
+ \edef\fgGalleryOpts@captionalign{\val}%
+}{}
+\let\fgGalleryOpts@captionalign\@empty
+% \end{macrocode}
+% \DescribeMacro{nocaptions} A Boolean switch, which if \texttt{true}, no caption is written the the caption bar.
+% The default is \texttt{false}, captions are written.
+% \begin{macrocode}
+\define@boolkey{fgGalleryOpts}{nocaptions}[true]{%
+ \edef\fgGalleryOpts@nocaptions{\ifKV@fgGalleryOpts@nocaptions
+ true\else false\fi}}
+% \end{macrocode}
+% \DescribeMacro{nocaptionstext} If \texttt{nocaptions} is set to \texttt{true}, the value of this
+% key is used as the caption for all the photos. If \texttt{nocaptionstext} is not listed, or has not value, the empty
+% string is used.
+% \begin{macrocode}
+\define@key{fgGalleryOpts}{nocaptionstext}[]{%
+ \def\fgGalleryOpts@nocaptionstext{#1}}
+% \end{macrocode}
+% Global defaults for the \texttt{fgGalleryOpts} family.
+% \begin{macrocode}
+\setkeys{fgGalleryOpts}{gallery,transOn,auto=true,nocaptions=false,nocaptionstext}
+% \end{macrocode}
+% \DescribeMacro{\fgRmAnnot} Now for the definition of \cs{fgRmAnnot}.
+% \begin{macrocode}
+\newcommand{\fgRmAnnot}[2][]{\begingroup
+ \@ifundefined{#2@fdgdigis}%
+ {\PackageError{fldigigal}{The name `#2' is not defined
+ for\MessageBreak this \string\fgRmAnnot}{Gallery names
+ are defined using \string\fdgXmlList}}%
+% \end{macrocode}
+% We get the key-value pairs for the \texttt{fgRmAnnot} family, then
+% within the \texttt{galleryopts} key, we process those options as well.
+% \begin{macrocode}
+ \setkeys*{fgRmAnnot}{#1}\edef\XKV@rm@saved{\XKV@rm}%
+ \edef\tmp@setkeysEx{\noexpand\setkeys{fgGalleryOpts}%
+ {\fgRmAnnot@galleryopts}}\tmp@setkeysEx
+% \end{macrocode}
+% We build part of the \texttt{flashvars} that correspond to this application.
+% The macro \cs{merged@flashvars} merges the flash variables entered directly
+% by the document author to control the \cs{rmAnnot}.
+% \begin{macrocode}
+ \edef\merged@flashvars{\fgRmAnnot@flashvars%
+ \ifKV@fgGalleryOpts@auto\else&%
+ auto=\fgGalleryOpts@auto\fi
+ \ifx\fgGalleryOpts@delay\@empty\else&%
+ delay=\fgGalleryOpts@delay\fi
+ \ifx\fgGalleryOpts@trans\@empty\else&%
+ transitionType=\fgGalleryOpts@trans\fi
+ \ifKV@fgGalleryOpts@transOn\else&%
+ transitionOn=\fgGalleryOpts@transOn\fi
+ \ifx\fgGalleryOpts@captionalign\@empty\else&%
+ captionalign=\fgGalleryOpts@captionalign\fi
+ \ifKV@fgGalleryOpts@nocaptions&%
+ nocaptions=\fgGalleryOpts@nocaptions%
+ \ifx\gGalleryOpts@nocaptionstext\@empty\else&%
+ nocaptionstext=\fgGalleryOpts@nocaptionstext\fi\fi
+ }%
+% \end{macrocode}
+% OK, now we create an \cs{rmAnnot} with the desired parameters.
+% We populate the \texttt{flashvars} key.
+% \begin{macrocode}
+ \rmAnnot[\XKV@rm@saved,
+ flashvars={xmlPath=\Name{\xmlListiv{#2}}\merged@flashvars},%
+ resources={\xmlListiv{#2}\embededResources{#2}}%
+ ]{320bp}{240bp}{\fgGalleryOpts@gallery}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+\endinput
+History:
+ (2010/12/29 v0.5c) the auto option did not have a default value, fixed
+ (2010/12/25 v0.5b) version date referenced for the rmannot package was
+ incorrect, should read 2010/12/22.
+ (2010/12/25 v0.5a) remove some spurious spaces, and changed the size
+ of \fgRmAnnot from 640bp x 480bp to 320bp x 240bp
+ (2010/12/23 v0.5) First publication
diff --git a/texmf-dist/source/latex/fldigigal/fldigigal.ins b/texmf-dist/source/latex/fldigigal/fldigigal.ins
new file mode 100644
index 00000000..caeb7d5b
--- /dev/null
+++ b/texmf-dist/source/latex/fldigigal/fldigigal.ins
@@ -0,0 +1,60 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1999-2006 D. P. Story
+%%
+%% This file is part of the `AcroTeX eDucation Bundle'.
+%% -------------------------------------------
+%%
+%% It may be distributed under the conditions of the LaTeX Project Public
+%% License, either version 1.2 of this license or (at your option) any
+%% later version. The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.2 or later is part of all distributions of LaTeX
+%% version 1999/12/01 or later.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2010/12/18}
+\def\batchfile{fldigigal.ins}
+
+\input docstrip
+\ifx\generate\undefined
+ \Msg{**********************************************}
+ \Msg{*}
+ \Msg{* This installation requires docstrip}
+ \Msg{* version 2.4 or later.}
+ \Msg{*}
+ \Msg{* An older version of docstrip has been input}
+ \Msg{*}
+ \Msg{**********************************************}
+ \errhelp{Move or rename old docstrip.tex and get a newer one.}
+ \errmessage{Old docstrip in input path}
+ \batchmode
+ \csname @@end\endcsname\end
+\fi
+
+\keepsilent
+\askforoverwritefalse
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\preamble
+\endpreamble
+
+\generate
+{%
+ \file{fldigigal.sty}{\from{fldigigal.dtx}{copyright,package}}
+}
+
+\Msg{***************************************************************}
+\Msg{*}
+\Msg{* \space To finish the installation you have to copy the files }
+\Msg{*}
+\Msg{* \space *.sty, *.cfg and *.def into a directory searched by TeX}
+\Msg{*}
+\Msg{***************************************************************}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\endinput