summaryrefslogtreecommitdiff
path: root/texmf-dist/doc/latex/fc-arith/examples/fc-acrobat.tex
blob: 235b943192ffbd59fc15a8fde8330e40c2721c59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
\documentclass{article}
%
% This file can be built in one of two wayd, each method requires the Acrobat application, however
%   (1) Using Adobe Distiller: latex, convert DVI to PS, and distill
%   (1) Using pdflatex, luatex, xelatex: insert the useacrobat option into the option list
%       of aeb_pro (2016/12/10 or later)
\usepackage[
    web={usetemplates,pro,usesf},
    useacrobat,
    eforms
]{aeb_pro} %[2016/12/10]
\usepackage{fc_arith}
\margins{.25in}{.25in}{.25in}{.25in}
\screensize{4.3in+25bp}{4.4in}
\textBgColor{webyellow}
\makePDasXOn

\DeclareDocInfo
{
    university={\AcroTeX.Net},
    title={PDF Flash Card: Arithmetic},
    author={D. P. Story, AcroTeX.Net, Northwest Florida State College, The University of Akron},
    email={dpstory@acrotex.net},
    subject={Practice elementary arithmetic operations},
    talksite={\url{www.acrotex.net}},
    version={1.0},
    keywords={AcroTeX.Net, arithmetic, flash cards},
    copyrightStatus=True,
    copyrightNotice={Copyright (C) \the\year, D. P. Story},
    copyrightInfoURL={http://www.acrotex.net}
}
\DeclareInitView{windowoptions={showtitle}}

%
% Set the ranges of the operations
%
\DeclareArithParams
{%
    addT={[2,20]},addB={[5,30]},
    subT={[1,5]},subB={[5,10]},
    mulT={[1,12]},mulB={[1,10]},
    divQ={[1,4]},divB={[1,10]},
}

%
% Optionally insert a logo in the upper right corner using \rheader (part of the running header).
%
\rheader{\parbox[t]{.5in}{\kern0pt\includegraphics[width=\linewidth]{graphics/nwfsc_logo}}}

\begin{MenuFC}
    \fcOptionsMenuItem
    \fcToggleKeypadMenuItem
    \fcMouseKPMenuItem
    \fcTouchKPMenuItem
    \fcAboutFC
\end{MenuFC}

% Import and place icon appearances
\declareMultiImages
{%
    {path=graphics/fc_icons.pdf,page=0,placement=StartAgain}
    {path=graphics/fc_icons.pdf,page=1,placement=[1]StartAgain}
    {path=graphics/fc_icons.pdf,page=2,placement=NewProblem}
    {path=graphics/fc_icons.pdf,page=3,placement=[1]NewProblem}
}

\begin{docassembly}
\insertPreDocAssembly
\end{docassembly}

\parskip0pt\parindent0pt%\previewtrue

\begin{document}

\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
% problem:     top
%          op  bot
%

\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.
%
% These components can be moved around to a new design, thought I don't know what that would
% be.  I have no imagination for design myself.

% when using xetex, we have to squeeze things together to make everything fit on one page
\ifxetex\vskip-2bp\fi
\mbox{\vbox{\smash{\alertbox}\startAgain}\fcSep\inputRegion\fcSep\vbox{\smash{\raisebox{0bp}{\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

% see xetex comments above
\ifxetex\vskip-2bp\fi
\mbox{\cbTiming\fcSep\ansField\fcSep\cbOperation}

\medskip

%
% This calculation computes the width of the previous row of fields, and sets \cs{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
%
% see xetex comments above
\ifxetex\vskip-2bp\fi
\makebox[\fcWidth][s]{\statsFields}

\end{center}
\end{document}