summaryrefslogtreecommitdiff
path: root/texmf-dist/doc/latex/fc-arith/examples/fc-noacrobat.tex
blob: 793a1b45a2aee97e29ccf20973d232b66402997e (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
\documentclass{article}
\usepackage[usetemplates,pro,usesf]{web}
\usepackage{eforms}
\usepackage{fc_arith} % showkeypadlink
\margins{.25in}{.25in}{.25in}{.25in}
\screensize{4.3in+25bp}{4.4in}
\textBgColor{webyellow}

\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},
}

\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
    \item{title=AcroTeX.Net Home,return=acrotexhome}
    \item{title=AcroTeX.Net Blog,return=acrotexblog}
    \fcAboutFC
\end{MenuFC}

% In this example, when processCustomFcMenu is called n should be 5. An arbitrary
% list of menu items may be specified and processed in this way.
\begin{insDLJS}{cmfc}{Custom Menu Events}
function processCustomFcMenu(n) {
    switch(n) {
        case "acrotexhome":
            app.launchURL("http://www.acrotex.net",false);
            break;
        case "acrotexblog":
            app.launchURL("http://blog.acrotex.net",false);
            break;
    }
}
\end{insDLJS}


\parskip0pt\parindent0pt

\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.

\ifxetex\vskip-4bp\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

\ifxetex\vskip-4bp\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
%
\ifxetex\vskip-4bp\fi
\makebox[\fcWidth][s]{\statsFields}

\end{center}
\end{document}