From 30e9cda301125dbde368d7bba3331bfd0f8389a1 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 13 Jul 2017 09:26:18 +0900 Subject: add lmacs popupmenu rangen renditions richtext yt4pdf --- texmf-dist/doc/latex/lmacs/README | 16 + texmf-dist/doc/latex/lmacs/lmacs.pdf | Bin 0 -> 40104 bytes texmf-dist/doc/latex/lmacs/lmacs_aeb.def | 45 + texmf-dist/doc/latex/lmacs/lmacs_aeb.js | 8 + texmf-dist/doc/latex/lmacs/lmacs_aeb.tex | 181 ++ texmf-dist/doc/latex/lmacs/lmacs_tst.def | 5 + texmf-dist/doc/latex/lmacs/lmacs_tst.tex | 22 + texmf-dist/doc/latex/popupmenu/README | 19 + texmf-dist/doc/latex/popupmenu/popupmenu.pdf | Bin 0 -> 62982 bytes texmf-dist/doc/latex/rangen/README | 37 + texmf-dist/doc/latex/rangen/randomLIP.tex | 53 + texmf-dist/doc/latex/rangen/randomQ.tex | 27 + texmf-dist/doc/latex/rangen/randomR.tex | 44 + texmf-dist/doc/latex/rangen/randomZ.tex | 38 + texmf-dist/doc/latex/rangen/rangen_fp.tex | 24 + texmf-dist/doc/latex/rangen/rangen_man.pdf | 1432 ++++++++++++++ texmf-dist/doc/latex/rangen/rangen_man.tex | 1563 +++++++++++++++ texmf-dist/doc/latex/rangen/rangen_tst.tex | 280 +++ texmf-dist/doc/latex/renditions/README | 22 + texmf-dist/doc/latex/renditions/renditions.pdf | Bin 0 -> 60135 bytes texmf-dist/doc/latex/richtext/README.md | 14 + .../doc/latex/richtext/examples/richtext_tst.tex | 58 + texmf-dist/doc/latex/richtext/richtextman.pdf | Bin 0 -> 1982477 bytes texmf-dist/doc/latex/yt4pdf/README.md | 21 + texmf-dist/source/latex/lmacs/lmacs.dtx | 138 ++ .../source/latex/popupmenu/examples/pumen_ex.pdf | Bin 0 -> 33971 bytes .../source/latex/popupmenu/examples/pumen_ex.tex | 108 ++ .../latex/popupmenu/examples/pumen_ex_pdftex.tex | 111 ++ texmf-dist/source/latex/popupmenu/popupmenu.dtx | 261 +++ texmf-dist/source/latex/popupmenu/popupmenu.ins | 59 + texmf-dist/source/latex/rangen/rangen.dtx | 1988 ++++++++++++++++++++ texmf-dist/source/latex/rangen/rangen.ins | 64 + texmf-dist/source/latex/renditions/renditions.dtx | 214 +++ texmf-dist/source/latex/renditions/renditions.ins | 59 + texmf-dist/source/latex/renditions/test_ren.tex | 27 + .../source/latex/richtext/doc/richtextman.tex | 1106 +++++++++++ texmf-dist/source/latex/richtext/richtext.dtx | 775 ++++++++ texmf-dist/source/latex/richtext/richtext.ins | 60 + texmf-dist/source/latex/yt4pdf/doc/yt4pdf_man.pdf | Bin 0 -> 347953 bytes texmf-dist/source/latex/yt4pdf/doc/yt4pdf_man.tex | 737 ++++++++ .../source/latex/yt4pdf/examples/config_intacc.def | 29 + .../source/latex/yt4pdf/examples/graphics/MIA9.eps | Bin 0 -> 290523 bytes .../source/latex/yt4pdf/examples/graphics/MIAX.eps | Bin 0 -> 400298 bytes .../yt4pdf/examples/graphics/trustmanager.eps | Bin 0 -> 845442 bytes .../latex/yt4pdf/examples/graphics/yt_icon_sm.eps | Bin 0 -> 558266 bytes .../source/latex/yt4pdf/examples/yt4pdf-1.tex | 93 + .../source/latex/yt4pdf/examples/yt4pdf-2.tex | 152 ++ .../source/latex/yt4pdf/examples/yt4pdf-3.tex | 88 + .../source/latex/yt4pdf/graphics/pdfyt_poster.eps | Bin 0 -> 850618 bytes .../source/latex/yt4pdf/swf/pdf_tube_basic.swf | Bin 0 -> 10470 bytes texmf-dist/source/latex/yt4pdf/yt4pdf.dtx | 629 +++++++ texmf-dist/source/latex/yt4pdf/yt4pdf.ins | 60 + texmf-dist/tex/latex/lmacs/lmacs.sty | 28 + texmf-dist/tex/latex/popupmenu/popupmenu.sty | 83 + texmf-dist/tex/latex/rangen/rangen.sty | 1175 ++++++++++++ texmf-dist/tex/latex/renditions/renditions.sty | 61 + texmf-dist/tex/latex/richtext/richtext.sty | 366 ++++ texmf-dist/tex/latex/yt4pdf/yt4pdf.cfg | 10 + texmf-dist/tex/latex/yt4pdf/yt4pdf.sty | 346 ++++ 59 files changed, 12736 insertions(+) create mode 100644 texmf-dist/doc/latex/lmacs/README create mode 100644 texmf-dist/doc/latex/lmacs/lmacs.pdf create mode 100644 texmf-dist/doc/latex/lmacs/lmacs_aeb.def create mode 100644 texmf-dist/doc/latex/lmacs/lmacs_aeb.js create mode 100644 texmf-dist/doc/latex/lmacs/lmacs_aeb.tex create mode 100644 texmf-dist/doc/latex/lmacs/lmacs_tst.def create mode 100644 texmf-dist/doc/latex/lmacs/lmacs_tst.tex create mode 100644 texmf-dist/doc/latex/popupmenu/README create mode 100644 texmf-dist/doc/latex/popupmenu/popupmenu.pdf create mode 100644 texmf-dist/doc/latex/rangen/README create mode 100644 texmf-dist/doc/latex/rangen/randomLIP.tex create mode 100644 texmf-dist/doc/latex/rangen/randomQ.tex create mode 100644 texmf-dist/doc/latex/rangen/randomR.tex create mode 100644 texmf-dist/doc/latex/rangen/randomZ.tex create mode 100644 texmf-dist/doc/latex/rangen/rangen_fp.tex create mode 100644 texmf-dist/doc/latex/rangen/rangen_man.pdf create mode 100644 texmf-dist/doc/latex/rangen/rangen_man.tex create mode 100644 texmf-dist/doc/latex/rangen/rangen_tst.tex create mode 100644 texmf-dist/doc/latex/renditions/README create mode 100644 texmf-dist/doc/latex/renditions/renditions.pdf create mode 100644 texmf-dist/doc/latex/richtext/README.md create mode 100644 texmf-dist/doc/latex/richtext/examples/richtext_tst.tex create mode 100644 texmf-dist/doc/latex/richtext/richtextman.pdf create mode 100644 texmf-dist/doc/latex/yt4pdf/README.md create mode 100644 texmf-dist/source/latex/lmacs/lmacs.dtx create mode 100644 texmf-dist/source/latex/popupmenu/examples/pumen_ex.pdf create mode 100644 texmf-dist/source/latex/popupmenu/examples/pumen_ex.tex create mode 100644 texmf-dist/source/latex/popupmenu/examples/pumen_ex_pdftex.tex create mode 100644 texmf-dist/source/latex/popupmenu/popupmenu.dtx create mode 100644 texmf-dist/source/latex/popupmenu/popupmenu.ins create mode 100644 texmf-dist/source/latex/rangen/rangen.dtx create mode 100644 texmf-dist/source/latex/rangen/rangen.ins create mode 100644 texmf-dist/source/latex/renditions/renditions.dtx create mode 100644 texmf-dist/source/latex/renditions/renditions.ins create mode 100644 texmf-dist/source/latex/renditions/test_ren.tex create mode 100644 texmf-dist/source/latex/richtext/doc/richtextman.tex create mode 100644 texmf-dist/source/latex/richtext/richtext.dtx create mode 100644 texmf-dist/source/latex/richtext/richtext.ins create mode 100644 texmf-dist/source/latex/yt4pdf/doc/yt4pdf_man.pdf create mode 100644 texmf-dist/source/latex/yt4pdf/doc/yt4pdf_man.tex create mode 100644 texmf-dist/source/latex/yt4pdf/examples/config_intacc.def create mode 100644 texmf-dist/source/latex/yt4pdf/examples/graphics/MIA9.eps create mode 100644 texmf-dist/source/latex/yt4pdf/examples/graphics/MIAX.eps create mode 100644 texmf-dist/source/latex/yt4pdf/examples/graphics/trustmanager.eps create mode 100644 texmf-dist/source/latex/yt4pdf/examples/graphics/yt_icon_sm.eps create mode 100644 texmf-dist/source/latex/yt4pdf/examples/yt4pdf-1.tex create mode 100644 texmf-dist/source/latex/yt4pdf/examples/yt4pdf-2.tex create mode 100644 texmf-dist/source/latex/yt4pdf/examples/yt4pdf-3.tex create mode 100644 texmf-dist/source/latex/yt4pdf/graphics/pdfyt_poster.eps create mode 100644 texmf-dist/source/latex/yt4pdf/swf/pdf_tube_basic.swf create mode 100644 texmf-dist/source/latex/yt4pdf/yt4pdf.dtx create mode 100644 texmf-dist/source/latex/yt4pdf/yt4pdf.ins create mode 100644 texmf-dist/tex/latex/lmacs/lmacs.sty create mode 100644 texmf-dist/tex/latex/popupmenu/popupmenu.sty create mode 100644 texmf-dist/tex/latex/rangen/rangen.sty create mode 100644 texmf-dist/tex/latex/renditions/renditions.sty create mode 100644 texmf-dist/tex/latex/richtext/richtext.sty create mode 100644 texmf-dist/tex/latex/yt4pdf/yt4pdf.cfg create mode 100644 texmf-dist/tex/latex/yt4pdf/yt4pdf.sty (limited to 'texmf-dist') diff --git a/texmf-dist/doc/latex/lmacs/README b/texmf-dist/doc/latex/lmacs/README new file mode 100644 index 00000000..1f8ffdfb --- /dev/null +++ b/texmf-dist/doc/latex/lmacs/README @@ -0,0 +1,16 @@ +lmacs Package--2012/05/30 v1.1 + +This is a simple package designed to clean up command definitions made in +the preamble. You can cut the commands in your preamble and paste them +into a file named myDefs.def, for example. Then insert the following line +to replace what you just removed: + +\usepackage[def=myDefs,!js=myJS]{lmacs} + +The package supports auxiliary files with extensions of .def, .js, and +.cfg. More can easily be added, if needed. Use of an exclamation mark +as shown above cancels the inclusion of that file. + +Now, back to my retirement. + +D. P. Story diff --git a/texmf-dist/doc/latex/lmacs/lmacs.pdf b/texmf-dist/doc/latex/lmacs/lmacs.pdf new file mode 100644 index 00000000..b6745bd4 Binary files /dev/null and b/texmf-dist/doc/latex/lmacs/lmacs.pdf differ diff --git a/texmf-dist/doc/latex/lmacs/lmacs_aeb.def b/texmf-dist/doc/latex/lmacs/lmacs_aeb.def new file mode 100644 index 00000000..1ae975fc --- /dev/null +++ b/texmf-dist/doc/latex/lmacs/lmacs_aeb.def @@ -0,0 +1,45 @@ +% +% This is the preamble content that originally appear in the source file. +% +\title{\texorpdfstring{Acro\!\TeX}{AcroTeX} eDucation Bundle + \texorpdfstring{\\[1ex]}{:}The \textsf{lmacs} Package} +\author{D. P. Story} +\subject{File to demo the lmacs package} +\keywords{LaTeX, hyperref, PDF, exercises, quizzes} +\university{% + Acro\negthinspace\TeX.Net\\ + NORTHWEST FLORIDA STATE COLLEGE\\ + Department of Mathematics} +\email{dpstory@acrotex.net} +\version{1.0} +\copyrightyears{2012} +%\nocopyright +\revisionLabel{} + +\noHeadersOnSectionPage + +\newcounter{probno}[section] +\renewcommand{\theprobno}{\thesection.\arabic{probno}} +% +% Define a problem environment with its own counter. +\newenvironment{problem}{% +\renewcommand\exlabel{Problem}% +\renewcommand\exlabelformat{\textbf{\exlabel\ \theprobno.}}% +\renewcommand\exsllabelformat + {\noexpand\textbf{\exlabel\ \theprobno.}}% +\renewcommand\exrtnlabelformat{$\blacktriangleleft$}% +\renewcommand\exsecrunhead{Solutions to Problems}% +\begin{exercise}[probno]} +{\end{exercise}} + + +% Define a example environment with no counter +\newenvironment{example}{% +\renewcommand\exlabel{Example}% +\renewcommand\exlabelformat{\textbf{\exlabel.}}% +\renewcommand\exrtnlabelformat{$\square$}% +\SolutionsAfter +\begin{exercise}[0]}% +{\end{exercise}} + +\endinput diff --git a/texmf-dist/doc/latex/lmacs/lmacs_aeb.js b/texmf-dist/doc/latex/lmacs/lmacs_aeb.js new file mode 100644 index 00000000..39b2b4f5 --- /dev/null +++ b/texmf-dist/doc/latex/lmacs/lmacs_aeb.js @@ -0,0 +1,8 @@ +% +% Document JavaScript +% +\begin{insDLJS}[makeAlert]{myjs}{Demo Alert Function} +function makeAlert(msg) { + app.alert(msg); +} +\end{insDLJS} diff --git a/texmf-dist/doc/latex/lmacs/lmacs_aeb.tex b/texmf-dist/doc/latex/lmacs/lmacs_aeb.tex new file mode 100644 index 00000000..87d6bfec --- /dev/null +++ b/texmf-dist/doc/latex/lmacs/lmacs_aeb.tex @@ -0,0 +1,181 @@ +% +% This is the file webeqtst.tex that is distributed with the AeB Bundle +% +\documentclass{article} +\usepackage{amsmath} +\usepackage{graphicx} +\usepackage[tight,designi]{web} % dvipsone, dvips, pdftex, dvipdfm +\usepackage{exerquiz} + +\usepackage[def=lmacs_aeb,js=lmacs_aeb]{lmacs} + +\begin{document} + +\maketitle + +\tableofcontents + + +\section{Introduction} + +The \textsf{lmacs} is designed to clean up the preamble of a source file. +For this file, we have +\begin{verbatim} + \usepackage[def=lmacs_aeb,js=lmacs_aeb]{lmacs} +\end{verbatim} +The preamble definitions are in the file \texttt{lmacs\_aeb.def} and a +document JavaScript is imported with the file \texttt{lmacs\_aeb.js}. + +\medskip\noindent We'll test the JavaScript first, press this button: +\pushButton[\CA{Press Me}\A{\JS{% + makeAlert("Hooray for the lmacs package!") +}}]{alertBtn}{}{11bp} + +\medskip\noindent The next section is taken from the file +\texttt{webeqtst.tex}. The problem environment is defined in the file +\texttt{lmacs\_aeb.def}, other definitions and customizations can be found +in that file. + +\medskip\noindent Though I am using the \textsf{web} and \textsf{exerquiz} package, lmacs +does not require them; \textsf{lmacs} is a general purpose package for inputting +local definitions. + +\section{Online Exercises} + +A well-designed sequences of exercises can be of aid to the +student. The \texttt{exercise} environment makes it easy to +produce electronic exercises. By using the \texttt{forpaper} +option, you can also make a paper version of your exercises. + +\begin{exercise} +Evaluate the integral \(\displaystyle\int x^2 e^{2x}\,dx\). +\begin{solution} +We evaluate by \texttt{integration by parts}:\normalsize +\begin{alignat*}{2} + \int x^2 e^{2x}\,dx & + = \tfrac12 x^2 e^{2x} - \int x e^{2x}\,dx &&\quad + \text{$u=x^2$, $dv=e^{2x}\,dx$}\\& + = \tfrac12 x^2 e^{2x} - + \Bigl[\tfrac12 x e^{2x}-\int \tfrac12 e^{2x}\,dx\Bigr] &&\quad + \text{integration by parts}\\& + = \tfrac12 x^2 e^{2x} - \tfrac12 x e^{2x} + \tfrac12\int e^{2x}\,dx &&\quad + \text{$u=x^2$, $dv=e^{2x}\,dx$}\\& + = \tfrac12 x^2 e^{2x} - \tfrac12 x e^{2x} + \tfrac14 e^{2x} &&\quad + \text{integration by parts}\\& + = \tfrac14(2x^2-2x+1)e^{2x} &&\quad + \text{simplify!} +\end{alignat*} +\end{solution} +\end{exercise} + +In the preamble of this document, we defined a \texttt{problem} +environment with its own counter. Here is an example of it. + +\begin{problem} +Is $F(t)=\sin(t)$ an antiderivative of $f(x)=\cos(x)$? Explain +your reasoning. +\begin{solution} +The answer is yes. The definition states that $F$ is an +antiderivative of $f$ if $F'(x)=f(x)$. Note that +$$ + F(t)=\sin(t) \implies F'(t) = \cos(t) +$$ +hence, $F(x) = \cos(x) = f(x)$. +\end{solution} +\end{problem} + +\begin{problem} +Is $F(t)=\sin(t)$ an antiderivative of $f(x)=\cos(x)$? Explain +your reasoning. +\begin{solution} +The answer is yes. The definition states that $F$ is an +antiderivative of $f$ if $F'(x)=f(x)$. Note that +$$ + F(t)=\sin(t) \implies F'(t) = \cos(t) +$$ +hence, $F(x) = \cos(x) = f(x)$. +\end{solution} +\end{problem} + +\noindent By modifying the \texttt{exercise} environment, you can +also create an \texttt{example} environment. The one defined in +the preamble of this document has no associated counter. + +\begin{example} +Give an example of a set that is \textit{clopen}. +\begin{solution} +The real number line is both closed and open in the usual topology of the +real line.% +\end{solution} +\end{example} + +There is a \texttt*-option with the \texttt{exercise} environment, +using it signals the presence of a multiple part exercise +question. The following exercise illustrates this option. + +\begin{exercise}*\label{ex:parts} +Suppose a particle is moving along the $s$-axis, and that its position +at any time $t$ is given by $s=t^2 - 5t + 1$. +\begin{parts} +\item[h]\label{item:part} Find the velocity, $v$, of the particle at any time +$t$. +\begin{solution} +Velocity is the rate of change of position with respect to time. In +symbols: +$$ + v = \frac{ds}{dt} +$$ +For our problem, we have +$$ + v = \frac{ds}{dt} =\frac d{dt}(t^2 - 5t + 1) = 2t-5. +$$ +The velocity at time $t$ is given by $\boxed{v=2t-5}$. +\end{solution} + +\item Find the acceleration, $a$, of the particle at any time $t$. +\begin{solution} +Acceleration is the rate of change of velocity with respect to time. +Thus, +$$ + a = \frac{dv}{dt} +$$ +For our problem, we have +$$ + a = \frac{dv}{dt} =\frac d{dt}(2t-5)=2. +$$ +The acceleration at time $t$ is constant: $\boxed{a=2}$. +\end{solution} +\end{parts} +\end{exercise} + +References can be made to a particular part of an exercise; for example, +``see \hyperref[item:part]{Exercise~\ref*{ex:parts}(\ref*{item:part})}.'' +Part (a) is in \textcolor{webblue}{blue}; the solutions for that part is +``hidden''. This is a new option for the \texttt{exercise} environment. + +There is now an option for listing multipart question in tabular form. +This problem style does not obey the \texttt{solutions\-after} option. + +\begin{exercise}* +Simplify each of the following expressions in the complex number +system. \textit{Note}: $\bar z$ is the conjugate of $z$; +$\operatorname{Re} z$ is the real part of $z$ and +$\operatorname{Im} z$ is the imaginary part of $z$. +\begin{parts}[2] +\item $i^2$ +\begin{solution} $i^2 = -1$ \end{solution} +& +\item $i^3$ \begin{solution} $i^3 = i i^2 = -i$\end{solution} +\\ +\item $z+\bar z$ +\begin{solution} $z+\bar z=\operatorname{Re} z$\end{solution} +& +\item[h] $1/z$ +\begin{solution} +$\displaystyle\frac 1z=\frac 1z\frac{\bar z}{\bar z}=\frac z{z\bar z}=\frac z{|z|^2}$ +\end{solution} +\end{parts} +\end{exercise} + + +\end{document} diff --git a/texmf-dist/doc/latex/lmacs/lmacs_tst.def b/texmf-dist/doc/latex/lmacs/lmacs_tst.def new file mode 100644 index 00000000..83eb8e72 --- /dev/null +++ b/texmf-dist/doc/latex/lmacs/lmacs_tst.def @@ -0,0 +1,5 @@ +% +% preamble definitions for lmacs_tst.tex +% +\newcommand{\myCoolPkg}{\textsf{lmacs} Package} +\endinput diff --git a/texmf-dist/doc/latex/lmacs/lmacs_tst.tex b/texmf-dist/doc/latex/lmacs/lmacs_tst.tex new file mode 100644 index 00000000..cc2acce1 --- /dev/null +++ b/texmf-dist/doc/latex/lmacs/lmacs_tst.tex @@ -0,0 +1,22 @@ +\documentclass{article} + +\usepackage[def=lmacs_tst]{lmacs} + + +\begin{document} + +\section{Introduction} + +The {\myCoolPkg} is designed to clean up the preamble of a source file. +For this file, we have +\begin{verbatim} + \usepackage[def=lmacs_tst]{lmacs} +\end{verbatim} +The preamble definitions are in the file \texttt{lmacs\_tst.def}. For this +demo file, the only definition in \texttt{lmacs\_tst.def} in that of +\texttt{\string\myCoolPkg}. The \texttt{@} character has the catcode of +a letter, since the file is input via \texttt{\string\usepackage}. + + + +\end{document} diff --git a/texmf-dist/doc/latex/popupmenu/README b/texmf-dist/doc/latex/popupmenu/README new file mode 100644 index 00000000..16256c50 --- /dev/null +++ b/texmf-dist/doc/latex/popupmenu/README @@ -0,0 +1,19 @@ +The popupmenu Package + +popupmenu is a LaTeX package used to create a menu structure. This +menu structure (an array of menu items) is passed to the Acrobat +JavaScript method app.popUpMenuEx() method to create a popup menu. +Using the environments defined in this package, and the command +\popUpMenu, you can create and display hierarchical menus. The menu +items can have JavaScript actions associated with them, they can be +marked and dis-enabled. + +The package requires only hyperref. Thus, users of pdftex, dvipdfm, +and dvips can use this package. Two examples are included in the +distribution, additional examples can be found at the AeB Blog + + http://www.math.uakron.edu/~dpstory/aebblog.html + + +D. P. Story +09/27/2010 diff --git a/texmf-dist/doc/latex/popupmenu/popupmenu.pdf b/texmf-dist/doc/latex/popupmenu/popupmenu.pdf new file mode 100644 index 00000000..daf3bbea Binary files /dev/null and b/texmf-dist/doc/latex/popupmenu/popupmenu.pdf differ diff --git a/texmf-dist/doc/latex/rangen/README b/texmf-dist/doc/latex/rangen/README new file mode 100644 index 00000000..6ae2f483 --- /dev/null +++ b/texmf-dist/doc/latex/rangen/README @@ -0,0 +1,37 @@ +The rangen Package + +The rangen package is a package that generates random integers, +rational numbers, and decimal number. Actually, the package uses the +lcg package (by Erich Janka) to generate random integers, while +rangen builds rational numbers and decimal numbers from the +generated integers. My purpose in writing this package was to be +able to create random questions for the quizzes of exerquiz (part of +AeB). Indeed, that is what you can do with this package: Write a +quiz question based on a template (for example, differentiate +$\a x^{\n}$ , where \a and \n are RVs (random variables) generated with +rangen); determine if the user input is correct; and display the +correct answer to the question. + +Beta Testers wanted: The package is still in development. I would +invite anyone interested to test the package, looking for bugs. +Also, suggested features would be appreciated. + +The rangen package requires the insdljs package from AeB. The +package can be used without exerquiz, perhaps there are some +applications to the generation of random numbers. As pointed out in +the documentation, the fp package can be used to manipulate the +numbers created by rangen. + +The home page for rangen is + + http://www.math.uakron.edu/~dpstory/rangen.html + +The home page for AeB is + + http://www.math.uakron.edu/~dpstory/webeq.html + +Comments and suggestions are always gratefully accepted and seriously +considered. + +D. P. Story +09/30/09 diff --git a/texmf-dist/doc/latex/rangen/randomLIP.tex b/texmf-dist/doc/latex/rangen/randomLIP.tex new file mode 100644 index 00000000..99170381 --- /dev/null +++ b/texmf-dist/doc/latex/rangen/randomLIP.tex @@ -0,0 +1,53 @@ +\documentclass{article} +\usepackage[tight,designv]{web} +\usepackage{insdljs} +\usepackage[testmode,quiet]{rangen} +%\usepackage[seed=30,quiet]{rangen} + +\parindent0pt\parskip6pt + +\begin{document} + +\RandomL{\a}{1,-1}$\texttt{\string\a}=\a, \cfmt\a x$ + +\RandomP[index=5]{\a}{1,x,x^2,x^3}$\a$ + +\RandomI{\indx}{5} +\RandomP[index=\indx]{\q}{1+16,\cos(\pi),\pi\sin(\pi),\frac{d}{dx}\frac{1}{2}x^2,{\int \cos(x)\,dx}} + +$\displaystyle\q$ + +\RandomI{\i}{2}\i +\RandomP[index=\i]{\q}{1+16, \frac{d}{dx}\frac{1}{2}x^2} +\RandomP[index=\i]{\a}{17,x} + +$ \q = \a $ + +\RandomP{\q}{1+16,\frac{d}{dx}\frac{1}{2}x^2} +\RandomP[index=\iOf\q]{\a}{17,x} + +$\displaystyle\q = \a $ + +\RandomI{\i}{6}RandomI=\i + +\RandomL[index=1]{\a}{17,\rPI,3/4,\rE,88,1/2}\a\quad index=\iOf{\a} + +\RandomL[index=\i]{\a}{17,\rPI,3/4,\rE,88,1/2}\a\quad index=\iOf{\a} + +\RandomL{\a}{17,\rPI,3/4,\rE,88,1/2}\a\quad index=\iOf{\a} + +In practice, \verb!\RandomI! can be used to select one of n problems. Here, we have +selected the +\RandomI{\i}{6} +\ifcase\i\relax\or +first\or +second\or +third\or +fourth\or +fifth\or +sixth\fi\space problem. + + + + +\end{document} diff --git a/texmf-dist/doc/latex/rangen/randomQ.tex b/texmf-dist/doc/latex/rangen/randomQ.tex new file mode 100644 index 00000000..ec2a9081 --- /dev/null +++ b/texmf-dist/doc/latex/rangen/randomQ.tex @@ -0,0 +1,27 @@ +\documentclass{article} +\usepackage[dvipsone]{insdljs} +\usepackage[testmode,quiet]{rangen} + + +\parindent0pt\parskip6pt + +\begin{document} + +\RandomQ{\a}[16]{1/8}{3/7}$ 1/8 \le \a \le 3/7 $ + +\RandomQ{\b}[7]{\a}{15/16}$\a \le \b$ + +\RandomQ[ne={0,-1}]{\n}{-3}{2/3}$x^{\efmt\n}$ + + +\defineQ{\a}{5}{3}\RandomQ{\b}[8]{\a*}{10}$ \a < \b $ + +\RandomQ{\a}[8]{1}{5}\RandomQ{\b}[8]{\a}{10}$ \a \le \b $ + +\RandomQ{\a}[8]{1}{5}\RandomQ{\b}[8]{1}{\a*}$ \a > \b $ + +\RandomQ{\a}[2]{1}{5}\RandomQ{\b}[8]{1}{\a}$ \a \ge \b $ + +\RandomQ{\a}[2]{1}{5}$\ifnum\typeOf\a=0\relax\cfmt\a\else(\cfmt\a)\fi x$ + +\end{document} diff --git a/texmf-dist/doc/latex/rangen/randomR.tex b/texmf-dist/doc/latex/rangen/randomR.tex new file mode 100644 index 00000000..69f2f2ba --- /dev/null +++ b/texmf-dist/doc/latex/rangen/randomR.tex @@ -0,0 +1,44 @@ +\documentclass{article} +\usepackage[tight,designv]{web} +\usepackage{insdljs} +\usepackage[testmode,quiet]{rangen} + +\parindent0pt\parskip6pt + +\begin{document} + +\RandomR{\a}{-2.3}{2.3}\a + +\RandomL{\a}{17,\rPI,3/4,\rE,88,1/2} + +Choose at random a number from the list \verb!{17,\rPI,3/4,\rE,88,1/2}!: +The choice is $\texttt{\a}$ + +\rule{\linewidth}{.4pt} + + +\defineR{\a}{-4.5}\defineR{\b}{5.343} + +\RandomR[round=2,showzeros]{\c}{\a}{\b} + +Random Real from the interval \texttt{[\a, \b ]} is \texttt{\c} + +\RandomR[round=2]{\a}{0}{10}\RandomR[round=2]{\b}{0}{12} + +\RandomR[round=2]{\c}{\a}{\b} + +A random Real taken from a random interval \texttt{[\a, \b ]} is \texttt{\c} + + +\rule{\linewidth}{.4pt} + + +\RandomR[round=2,showzeros]{\b}{0}{9.5} +\RandomR[round=2]{\a}{-3}{\b} + +We require \verb!\b! to be greater than \texttt{\string\a}: +$ \texttt{\string\b=\b} > \texttt{\a=\string\a} $ + +$\texttt{\string\a}=\a\approx\nOf{\a}/\dOf{\a}$ + +\end{document} diff --git a/texmf-dist/doc/latex/rangen/randomZ.tex b/texmf-dist/doc/latex/rangen/randomZ.tex new file mode 100644 index 00000000..233b8efd --- /dev/null +++ b/texmf-dist/doc/latex/rangen/randomZ.tex @@ -0,0 +1,38 @@ +\documentclass{article} +\usepackage[dvipsone]{insdljs} +\usepackage[testmode,quiet]{rangen} + + + +\parindent0pt\parskip6pt + +\begin{document} + +\RandomZ[ne={0,-1}]{\n}{-2}{2}$x^{\efmt\n}$ + +\RandomZ[ne=\zZero]{\b}{-1}{1} +The value of \texttt{\string\b=\b} and should be +different from zero. Is it? + +\RandomZ{\a}{1}{5}\RandomZ{\b}{\a*}{10}$ \a < \b $ + +\RandomZ{\a}{1}{5}\RandomZ{\b}{\a*}{10}$ \a \le \b $ + +\RandomZ{\a}{1}{5}\RandomZ{\b}{1}{\a*}$ \a > \b $ + +\RandomZ{\a}{1}{5}\RandomZ{\b}{1}{\a}$ \a \ge \b $ + +\RandomZ[ne=0]{\b}{-1}{1}Is \texttt{\string\b}=\b\space zero? + +\RandomL{\a}{-2,4,6,-12,9,5,17}Select a number from a list \texttt{\string\a=\a} + +\RandomS{\si}\RandomS{\sii} +\RandomZ[ne=0]{\a}{-5}{5} +\RandomZ[ne=0]{\b}{1}{5} +\RandomZ[ne=0]{\c}{1}{5} +\RandomZ[ne=0]{\n}{1}{5} + +$ \cfmt\a x^{\efmt\n} \si \cfmt\b x \sii \c $ + + +\end{document} diff --git a/texmf-dist/doc/latex/rangen/rangen_fp.tex b/texmf-dist/doc/latex/rangen/rangen_fp.tex new file mode 100644 index 00000000..e7e4fcff --- /dev/null +++ b/texmf-dist/doc/latex/rangen/rangen_fp.tex @@ -0,0 +1,24 @@ +\documentclass{article} +\usepackage[tight,dvipsone,designv,nodirectory]{web} +\usepackage{insdljs} +\usepackage[testmode,quiet]{rangen} +\usepackage{fp} + +\parindent0pt\parskip6pt + +\begin{document} + +\RandomQ{\a}[6]{2}{4}\RandomQ{\b}[6]{2}{4}\RandomS{\thisop} +\gcd{\dOf\a}{\dOf\b} +\FPeval\lcd{clip((\dOf\a)*(\dOf\b)/\thegcd)} +\FPeval\si{clip(\lcd/(\dOf\a))} +\FPeval\sii{clip(\lcd/(\dOf\b))}\def\thisop{+} +\if\thisop+\FPeval\finalnum{clip((\si)*(\nOf\a)+(\sii)*(\nOf\b))} +\else\FPeval\finalnum{clip((\si)*(\nOf\a)-(\sii)*(\nOf\b))}\fi +\defineQ{\ans}{\finalnum}{\lcd} +$$ +\ds\a \thisop \ds\b = \frac{(\si)(\nOf\a)+(\sii)(\nOf\b)}{\lcd} + = \frac{\finalnum}{\lcd}\ifnum\lcd=\dOf\ans\else =\ds\ans\fi +$$ + +\end{document} diff --git a/texmf-dist/doc/latex/rangen/rangen_man.pdf b/texmf-dist/doc/latex/rangen/rangen_man.pdf new file mode 100644 index 00000000..de23fc12 --- /dev/null +++ b/texmf-dist/doc/latex/rangen/rangen_man.pdf @@ -0,0 +1,1432 @@ +%PDF-1.4 % +367 0 obj <>/AcroForm 368 0 R/Metadata 364 0 R/Names 369 0 R/OCProperties<><><>]/ON[417 0 R]/Order[]/RBGroups[]>>/OCGs[417 0 R]>>/OpenAction<>/Outlines 199 0 R/PageLabels 358 0 R/PageLayout/SinglePage/PageMode/UseNone/Pages 360 0 R/Type/Catalog/ViewerPreferences<<>>>> endobj 368 0 obj <>>>/Fields[29 0 R 450 0 R 436 0 R 432 0 R 424 0 R 429 0 R 124 0 R 139 0 R 486 0 R]>> endobj 364 0 obj <>stream + + + + + application/pdf + rangen_man.tex + + + Documentation for annot_pro from AcroTeX + + + + + The : Random Generation of Integer, Rational, and Real Numbers with Applications to the exercise, quiz, and shortquiz Environments of Exerquiz + + + + + D. P. Story + + + + + Copyright (C) 2016, D. P. Story + + + Acrobat Distiller 15.0 (Windows) + + The AcroTeX eDucation Bundle + 2016-02-20T05:34:56-06:00 + 2016-02-20T05:34:46 + 2016-02-20T05:34:56-06:00 + uuid:868101b7-edf6-4b9c-b714-9714f44eb86a + uuid:9df1dd09-c6a3-4f09-bd5d-0fbb4e95c8a5 + True + http://www.acrotex.net + + + + + + + + + + + + + + + + + + + + + + + + + +endstream endobj 369 0 obj <> endobj 199 0 obj <> endobj 358 0 obj <> endobj 360 0 obj <> endobj 361 0 obj <> endobj 362 0 obj <> endobj 363 0 obj <> endobj 106 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 109 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 112 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 116 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 123 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 136 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 145 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 152 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 155 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 404 0 obj <>stream +HTmk0_}snit +b؇v 'vSo%;Y ^s.tmQ4,}oi7eBQ/\J|v, H,|NЪ %A: +>I%vME aۀRLfps!2B@ILAt +W,[D0FaPF]V=09FK>>>/Resources<>/ExtGState<>/Properties<>/Shading<>>>/Subtype/Form/Type/XObject>>stream +HWݎGߧٮ8 )H/ZA>uN7kob uOwzo|l߽*7߾~+pKۻXk=itn2._*˖o~&7˲w*~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Aǿ=ȼ:ɹ8ʷ6˶5̵5͵6ζ7ϸ9к<Ѿ?DINU\dlvۀ܊ݖޢ)߯6DScs 2F[p(@Xr4Pm8Ww)Km + +endstream endobj 413 0 obj <>stream +HTr@_"͆+*( X9Fv~Lf޼ A_ 0'\;\^ك +{BO;>acͭ6;XZ6Y0\60]Z,d2gV7.,ɐnNc11&tuԾ0 Bs}5=`ZZ.Ԛ*T\wBֆb+7BXlF$v* \rRIKH>ybr-% cJJ + +endstream endobj 414 0 obj <<>> endobj 415 0 obj <> endobj 416 0 obj <> endobj 417 0 obj <>/PageElement<>/Print<>/View<>>>>> endobj 392 0 obj <> endobj 374 0 obj <> endobj 159 0 obj <> endobj 397 0 obj <> endobj 164 0 obj <> endobj 181 0 obj <> endobj 188 0 obj <> endobj 185 0 obj <> endobj 189 0 obj <> endobj 190 0 obj <>stream +hbd`ab`dd pq)MLIK-M,u,*//ɫe!CG7_/~E2={R߷ 122'e$t$V&d8Teg(h$k*ZZ Ԝr5bļHHϼd=+}rJL^r~_~QnbV200l`  ##5wUw3fdF +auu?ڏl|se:]nԙ3ps&y4 +endstream endobj 183 0 obj <> endobj 182 0 obj <> endobj 178 0 obj <>stream +hT=o w~ō:dMU ]@g<ý>stream +hd]L[uVn%5n徰̌01sĘ9& ɲhee-^zu[zK[}o{[E?h$XD¶dF,{2ʢ^4?jrs~k|[/?sxB5,?+(w$Í;G/p5Nsq#[`90!^?4f<1>x>uc/V*Z > +Uk,eGep߄CQ]OWazE֩jjx`(ޠ|[v^ y~d@7{3|w;__#>o< #(5hbv첓Ĝㆽ`ݷ\j-aB!FC0B t&qNvaPl`3ItcxDV.rmYr}e!6IE#pjۭ|U=׀k(IkxS8X L0@_qэ-dMCɆx!ROq Y&c %)̦Iod6,cnI SnM}Κ){"ٺ<]sTξ*qM/!N[!C @! ,&孴5laa:gt$ qGĒ$b$mYoh~W~t?.?E%bbv*om?sMCysZLюF#;. (ǝ1$ }^n'7bIcPu8u-1,{NJ3ptG8 ?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W`F~fB?.9QI P|Q_z̊0msI5K=q!-tIeTI4*ZIDGhӜh77N%XhR5}/5XMz:N+hgOpZlzݱStEԾDWuNP"> +Ŋ%W3U#oF؈P4W2|=#Hfy9].g'>M=B"c=af7t.A.PyNYj=ёa:UہI~vn1O(Zʢ5/,ؐ(5/KkHioH epTԶ{.ZY', iz$8l̳yi:'d%,p.:X1; óT-|p'= +MSi?Mß3F"?X.knR-X',]_ٟzO 3zefYo?s.TZl9l ӥTB Ox +endstream endobj 422 0 obj <> endobj 146 0 obj <>>>/BS<>/DA(/Helv 0 Tf 0 g)/F 4/Ff 1/MK<<>>/P 145 0 R/Parent 486 0 R/Rect[109.854 406.271 111.854 408.271]/Subtype/Widget/Type/Annot>> endobj 147 0 obj <>/F<>/Fo<>/K<>>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/F 4/MK<>/P 145 0 R/Parent 456 0 R/Rect[190.651 230.743 228.651 243.743]/Subtype/Widget/Type/Annot>> endobj 148 0 obj <>/AA<<>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/Ff 65536/H/P/MK<>/P 145 0 R/Parent 444 0 R/Rect[460.678 230.743 480.991 243.743]/Subtype/Widget/Type/Annot>> endobj 149 0 obj <>/AA<<>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/F 4/Ff 65540/MK<>/P 145 0 R/Parent 423 0 R/Rect[479.991 230.743 507.854 243.743]/Subtype/Widget/Type/Annot>> endobj 423 0 obj <> endobj 424 0 obj <> endobj 51 0 obj <>/AA<<>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/F 4/FT/Btn/Ff 65540/MK<>/P 47 0 R/Parent 424 0 R/Rect[463.991 619.368 491.854 632.368]/Subtype/Widget/T(answer)/Type/Annot>> endobj 127 0 obj <>/AA<<>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/F 4/FT/Btn/Ff 65540/MK<>/P 123 0 R/Parent 424 0 R/Rect[479.991 451.799 507.854 464.799]/Subtype/Widget/T(sq2)/Type/Annot>> endobj 142 0 obj <>/AA<<>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/F 4/FT/Btn/Ff 65540/MK<>/P 136 0 R/Parent 424 0 R/Rect[479.991 193.311 507.854 206.31]/Subtype/Widget/T(sq3)/Type/Annot>> endobj 425 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +Hl +0DsKlL\ѫ,Im!CfvlJ `Hi !`!# >yGR{~E!6%(ng{6B_q8&$[=3C\TS~\Eڜ[A7Z:tti1<^ +endstream endobj 227 0 obj <> endobj 229 0 obj <> endobj 426 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +H\ +0DsKMH^ѫ,IՀ$̼!lb0lc sDm`ʷH6,y~ђAOl<[╘~Z; o y +ٓ]tW`(6Ɨ&/3Bڍ2ot 4 +endstream endobj 47 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 427 0 obj <>stream +HWYo7~ׯuQk)ShhC]Eq;V) p~{'gm_,O^\oI&޴n1u_4udqD #Hfh5NhE3z?Χ˩$vV)`始!E@ 9Odx2F)?=f]?fSF1)bD$(Ȋ*wsYs{=yuvذ?x8&}q$@0?:Qw{r$48cO!,>BDN[{es*sI/lu2R"Eez57ԬEi/TG~mLfuܕ]=,'M߁_ta.MmZ9:s*^/_ CUyoo)ŕMD嗥_ek r71c(ς+oҋqz5C #AdFf2]a>j]z}ojO.&`wT4 /p'Qk0懾Qo>:aDYLԣt& S + g(pR#4|LwUB0RD$4NRAZoѴ/ eHOQжYc| )SWϥ-Tv$&3T6Lu=;[cCzx"ـgu͢ +o1Hzob*?dSȐ:T̟lC p HM`8,%rm s)v/Yoj!t;kXΑrB@A-r +Xo^t}[m;'Bhm1571!$zm|ΦnPmUΖeFU,]6 '@ w/\m|{},F\+amkG@9L H?Ag(i` м]X \V{EHmGB4# I#Ykxv{*>lZ+HBĦ,$A>3qp ꡂ!/_ DtYIQuR  PD l_I,ԥvbxl5^]kk`۽S\=.M\]FŶi;Oh m%\Bmd ɕ`ӽ?v_iFaiE8i?[PE'XeY'($t/:Ƥ @:w(\!MED(~SGΠR;J3ud +`xznmJa0T͏ +e$vP) pOA÷BR #ۢE3,Hz7~Ӿ6+|lxw k7XΝI9_ʕv$Ԇ #2ۥ|>6Ih%$qƒaK'4{ʡƂdnQi?u0ٚ; +0] +endstream endobj 172 0 obj <> endobj 174 0 obj <> endobj 177 0 obj <> endobj 175 0 obj <>stream +hTKO Y^JI>b{鴒XJ(];@q`hMA6yZB d:[ u8֦(ٻvOYv+n6' b7h<(KgznK;"X'W >۬g*t +!K(t1U\z:n%+ +,dE'#cG]dZ~z0#=Jօ }r9AImxE8J)!k,jqs hן ~Y +endstream endobj 176 0 obj <>stream +ht{PSWo QIcͽzof:t*,V-]E@#!2 !`0Q4B-bC[ժlݸtڙ39ߜo~}X,z-[7R'(g3ŪoU*B$YbVR 1 ]fs+v+-Sq@[\KW`X5G^]^U(+WVIE)iikD*JUjswZXY".(C)MT듓juR~&?IZȪQѵCV"KIARV$Y<"nڶ% +YUGr$iFz6B1vvئk˚\6A.x0e7~ĥoe2N}QC&K Wp&OyurNow1ȧYanNS t 'r hD<.Lցlp f ("r М(P;'R ь'rT3¿F9̢؇mhKMm-yWRRW`(o-iV،v籎zh :&M(  + ia{JdQD(+`؃B y f߾?<ʚFД[oAfz[u + G NQ< + up7=)}ٓ WU}~vMc- ;;+ F\p5TuIb?\@j\ZR~^-$y9i)'iВ5tSiJ\.CZq/}(K$ZaѨvILIE؈ox>1zn΃0a40y6%W#NK׮' y 'SAOwVqvLK5WG˔gko8p7~@<L|uL{W${.U}koq :&n 63)\'k5;L,q>`ob`mWRڧܺs'V9b8d<[{m}kf@kg#]%]g2Y˜@ׁcqO:F?EчO.e^bPPowvw=. +=?\z:+,A +endstream endobj 428 0 obj <> endobj 48 0 obj <>/F<>/Fo<>/K<>>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/F 4/FT/Tx/MK<>/P 47 0 R/Parent 449 0 R/Rect[233.655 651.747 379.655 664.747]/Subtype/Widget/T(6)/Type/Annot>> endobj 49 0 obj <>/AA<<>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/FT/Btn/Ff 65536/H/P/MK<>/P 47 0 R/Parent 435 0 R/Rect[471.541 651.747 491.854 664.747]/Subtype/Widget/T(6)/Type/Annot>> endobj 50 0 obj <>/AP<>/BS<>/DA(/Helv 9 Tf 1 0 0 rg)/FT/Tx/Ff 1/MK<>/P 47 0 R/Parent 431 0 R/Q 2/Rect[490.854 651.747 507.854 664.747]/Subtype/Widget/T(6)/Type/Annot>> endobj 179 0 obj <>/F<>/K<>>>/AP<>/BS<>/DA(/Helv 9 Tf 1 0 0 rg)/FT/Tx/Ff 1/MK<>/P 47 0 R/Parent 429 0 R/Q 2/Rect[490.854 619.368 507.854 632.368]/Subtype/Widget/T(answer)/Type/Annot>> endobj 52 0 obj <> endobj 53 0 obj <>/Border[0 0 0]/C[0 1 1]/H/I/Rect[150.098 194.088 414.188 205.212]/Subtype/Link/Type/Annot>> endobj 429 0 obj <> endobj 430 0 obj <>/Subtype/Form/Type/XObject>>stream +H235045VH2T0TF +9\fPTH(`%XXa.W@(E6KT!R w5 +endstream endobj 431 0 obj <> endobj 432 0 obj <> endobj 32 0 obj <>/AP<>/BS<>/DA(/Helv 9 Tf 1 0 0 rg)/FT/Tx/Ff 1/MK<>/P 28 0 R/Parent 431 0 R/Q 2/Rect[287.873 355.562 304.873 368.562]/Subtype/Widget/T(1)/Type/Annot>> endobj 35 0 obj <>/AP<>/BS<>/DA(/Helv 9 Tf 1 0 0 rg)/FT/Tx/Ff 1/MK<>/P 28 0 R/Parent 431 0 R/Q 2/Rect[490.854 355.562 507.854 368.562]/Subtype/Widget/T(2)/Type/Annot>> endobj 38 0 obj <>/AP<>/BS<>/DA(/Helv 9 Tf 1 0 0 rg)/FT/Tx/Ff 1/MK<>/P 28 0 R/Parent 431 0 R/Q 2/Rect[490.854 259.767 507.854 272.767]/Subtype/Widget/T(3)/Type/Annot>> endobj 41 0 obj <>/AP<>/BS<>/DA(/Helv 9 Tf 1 0 0 rg)/FT/Tx/Ff 1/MK<>/P 28 0 R/Parent 431 0 R/Q 2/Rect[490.854 221.259 507.854 234.259]/Subtype/Widget/T(4)/Type/Annot>> endobj 44 0 obj <>/AP<>/BS<>/DA(/Helv 9 Tf 1 0 0 rg)/FT/Tx/Ff 1/MK<>/P 28 0 R/Parent 431 0 R/Q 2/Rect[490.854 125.198 507.854 138.198]/Subtype/Widget/T(5)/Type/Annot>> endobj 28 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 433 0 obj <>stream +HWo>--M_."-Тޢrza{wh-s!!/>fy}wm9uM}ˀ@ U^^-m8 +fqx0]-ޭ!Wȿq{9XBE)I譪UmrlB*)6 _|yL_'yG%i죎6R!a7>ggK=_, n\\**#b埲eD_Y"o6ix^g-"/._O~s ybj/9i.A*A |"97D5}UFC~*--uۡ=r؍ xg;ȒEGGa۽1h 1lm*mqQ^K68[ju_u?~veτCu[yt' 4Z 7:/6-Ј-fuwa&TNLXs ƦW.Oڬ>p+Yo(PD1xR$qQTȑ4Gka,g=R,˘)hp@.b8[+'JU n $o_=axy n,, /9x#ḏ2׿[ B7}9 Xv7xڿogvi:qFX2JwҚps!G~fZ0Mb/"Ie(kzK,CD> YM Ptm{5QmAie'±t<п@sCf(f71܍:wh?bB<)5dɋ6'5uQIL -L6j؜2k[Wªgȵ +J #:iBΟ'`+2h\욡ZY+\CᰃBb%MdJbCEmW. 7sVc]Jas D^Q\0Ft_AmJ5ZLÝnES`5ga2D`rN6밓Ӵhg6VB]A<# -MA1C&jz6b@!OTܖc띶LBzKhDe@*S%j{]Q@+ +gK].>,q=9Zn\(67$iT4–V,>W9y8*lE! oNLf2,MAƿg=c N{H')!~_e/* /T +-oyg[{D'&uaPP0{>7$o\*`ISK irt1~Vl\Y 6_v:_Ned}:0fzHB&hM/¬``- 8Q3y bal2[ڎ6 9MCEjHW`mI148t .D59v߈c  4xUIBDM̟LyG! $ -KtOBa=R {ׯ8eAZf&^hd$KpfN:b32;| A{Aa$ Sg1 aͨ+cT(GcP$pyUNC0:vk󟌇i"D p}P<ge纼[Mؙ (ˡbuz40U/Q ?]&q#gHy =aLjp6n0xR> endobj 173 0 obj <> endobj 169 0 obj <> endobj 170 0 obj <>stream +hbd`ab`ddpqw)MLIK-M,u(I+)!CX\NɟYe|Wd%? 112 +hVO+IM/JI,.I,H,JIM+IL23@J0[A#YSPD)8e+)x+$(DE(x%)dX뗗Ue*srspyNF(L @30113fT+]n;w?~Wx'bעwVȵdTgsTTV5Jtv6O$tQA~ii~꺂}__g\n)ſIb>{M每'uwMooh[X|E7f,P['_Jo)>>7]>Eu|O&=666D:TDsd42Z[pܼ%ѫb:NmUȁ0*Ew-:mU;잿cͽ%߅H=..uO|wѮ]W,HcywTi>u*L&}y8p^}QH +endstream endobj 434 0 obj <> endobj 29 0 obj <>>>/BS<>/DA(/Helv 0 Tf 0 g)/F 4/FT/Tx/Ff 1/MK<<>>/P 28 0 R/Rect[109.854 395.797 111.854 397.797]/Subtype/Widget/T(sqIDanswer)/Type/Annot>> endobj 30 0 obj <>/F<>/Fo<>/K<>>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/F 4/FT/Tx/MK<>/P 28 0 R/Parent 449 0 R/Rect[183.892 355.562 221.892 368.562]/Subtype/Widget/T(1)/Type/Annot>> endobj 31 0 obj <>/AA<<>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/FT/Btn/Ff 65536/H/P/MK<>/P 28 0 R/Parent 435 0 R/Rect[268.56 355.562 288.873 368.562]/Subtype/Widget/T(1)/Type/Annot>> endobj 33 0 obj <>/F<>/Fo<>/K<>>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/F 4/FT/Tx/MK<>/P 28 0 R/Parent 449 0 R/Rect[380.113 355.562 418.113 368.562]/Subtype/Widget/T(2)/Type/Annot>> endobj 34 0 obj <>/AA<<>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/FT/Btn/Ff 65536/H/P/MK<>/P 28 0 R/Parent 435 0 R/Rect[471.541 355.562 491.854 368.562]/Subtype/Widget/T(2)/Type/Annot>> endobj 36 0 obj <>/F<>/Fo<>/K<>>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/F 4/FT/Tx/MK<>/P 28 0 R/Parent 449 0 R/Rect[248.114 259.767 394.114 272.767]/Subtype/Widget/T(3)/Type/Annot>> endobj 37 0 obj <>/AA<<>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/FT/Btn/Ff 65536/H/P/MK<>/P 28 0 R/Parent 435 0 R/Rect[471.541 259.767 491.854 272.767]/Subtype/Widget/T(3)/Type/Annot>> endobj 39 0 obj <>/F<>/Fo<>/K<>>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/F 4/FT/Tx/MK<>/P 28 0 R/Parent 449 0 R/Rect[238.963 221.259 384.963 234.259]/Subtype/Widget/T(4)/Type/Annot>> endobj 40 0 obj <>/AA<<>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/FT/Btn/Ff 65536/H/P/MK<>/P 28 0 R/Parent 435 0 R/Rect[471.541 221.259 491.854 234.259]/Subtype/Widget/T(4)/Type/Annot>> endobj 42 0 obj <>/F<>/Fo<>/K<>>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/F 4/FT/Tx/MK<>/P 28 0 R/Parent 449 0 R/Rect[226.895 125.198 372.895 138.198]/Subtype/Widget/T(5)/Type/Annot>> endobj 43 0 obj <>/AA<<>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/FT/Btn/Ff 65536/H/P/MK<>/P 28 0 R/Parent 435 0 R/Rect[471.541 125.198 491.854 138.198]/Subtype/Widget/T(5)/Type/Annot>> endobj 435 0 obj <> endobj 436 0 obj <> endobj 437 0 obj <> endobj 438 0 obj <> endobj 439 0 obj <> endobj 141 0 obj <>/AA<<>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/FT/Btn/Ff 65536/H/P/MK<>/P 136 0 R/Parent 439 0 R/Rect[460.678 193.311 480.991 206.31]/Subtype/Widget/T(1)/Type/Annot>> endobj 440 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +HTA +@ E9_1ɴT +@ۂ-x~3SHO^nWz +1΋ !PKJV`d' O׳R-D]虏,9f\i4#}6˴Cm+wEJ;F|1҅> 0 +endstream endobj 441 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +H4A +@>eрU&@ ~7 KrI2oP\la3&5]<1rXqwޯ4J Te 8o\t +endstream endobj 126 0 obj <>/AA<<>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/FT/Btn/Ff 65536/H/P/MK<>/P 123 0 R/Parent 438 0 R/Rect[460.678 451.799 480.991 464.799]/Subtype/Widget/T(1)/Type/Annot>> endobj 442 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +HD +0Dsԃqw z~i ZݤH! 3Dz;\'Cyi#v5Z*V $qVth1'V%#gyw]34N)_D*n]UǀqH/:'O +* +endstream endobj 443 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +H$A +0DsYObYV>xP +=ef61*TP*JpKFT"\:/j9 ]XWg>K-M'.mh/>6 +endstream endobj 444 0 obj <> endobj 119 0 obj <>/AA<<>>/AP<>/BS<>/H/P/MK<>/P 116 0 R/Parent 444 0 R/Rect[460.678 583.63 480.991 596.63]/Subtype/Widget/Type/Annot>> endobj 445 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +HD +0Dsԃqw z~i ZݤH! 3Dz;\'Cyi#v5Z*V $qVth1'V%#gyw]34N)_D*n]UǀqH/:'O +* +endstream endobj 446 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +H$A +0DsYObYV>xP +=ef61*TP*JpKFT"\:/j9 ]XWg>K-M'.mh/>6 +endstream endobj 447 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +HD +0Dsԃqw z~i ZݤH! 3Dz;\'Cyi#v5Z*V $qVth1'V%#gyw]34N)_D*n]UǀqH/:'O +* +endstream endobj 448 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +H$A +0DsYObYV>xP +=ef61*TP*JpKFT"\:/j9 ]XWg>K-M'.mh/>6 +endstream endobj 449 0 obj <> endobj 450 0 obj <> endobj 451 0 obj <> endobj 452 0 obj <> endobj 453 0 obj <> endobj 140 0 obj <>/F<>/Fo<>/K<>>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/F 4/FT/Tx/MK<>/P 136 0 R/Parent 453 0 R/Rect[226.895 193.311 372.895 206.311]/Subtype/Widget/T(1)/Type/Annot>> endobj 454 0 obj <>/Subtype/Form/Type/XObject>>stream +0 G +0.5 0.5 145 12 re +s + +endstream endobj 125 0 obj <>/F<>/Fo<>/K<>>>/AP<>/BS<>/DA(/Helv 9 Tf 0 g)/F 4/FT/Tx/MK<>/P 123 0 R/Parent 452 0 R/Rect[227.99 451.799 373.99 464.799]/Subtype/Widget/T(1)/Type/Annot>> endobj 455 0 obj <>/Subtype/Form/Type/XObject>>stream +0 G +0.5 0.5 145 12 re +s + +endstream endobj 456 0 obj <>/K<>>>/DA(/Helv 9 Tf 0 g)/FT/Tx/Kids[118 0 R 147 0 R]/Parent 451 0 R/T(1)>> endobj 118 0 obj <>/Fo<>>>/AP<>/BS<>/F 4/MK<>/P 116 0 R/Parent 456 0 R/Rect[190.651 583.63 228.651 596.63]/Subtype/Widget/Type/Annot>> endobj 457 0 obj <>/Subtype/Form/Type/XObject>>stream +0 G +0.5 0.5 37 12 re +s + +endstream endobj 458 0 obj <>/Subtype/Form/Type/XObject>>stream +0 G +0.5 0.5 145 12 re +s + +endstream endobj 459 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +HD +0Dsԃqw z~i ZݤH! 3Dz;\'Cyi#v5Z*V $qVth1'V%#gyw]34N)_D*n]UǀqH/:'O +* +endstream endobj 460 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +H$A +0DsYObYV>xP +=ef61*TP*JpKFT"\:/j9 ]XWg>K-M'.mh/>6 +endstream endobj 461 0 obj <>/Subtype/Form/Type/XObject>>stream +0 G +0.5 0.5 145 12 re +s + +endstream endobj 462 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +HD +0Dsԃqw z~i ZݤH! 3Dz;\'Cyi#v5Z*V $qVth1'V%#gyw]34N)_D*n]UǀqH/:'O +* +endstream endobj 463 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +H$A +0DsYObYV>xP +=ef61*TP*JpKFT"\:/j9 ]XWg>K-M'.mh/>6 +endstream endobj 464 0 obj <>/Subtype/Form/Type/XObject>>stream +0 G +0.5 0.5 145 12 re +s + +endstream endobj 465 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +HD +0Dsԃqw z~i ZݤH! 3Dz;\'Cyi#v5Z*V $qVth1'V%#gyw]34N)_D*n]UǀqH/:'O +* +endstream endobj 466 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +H$A +0DsYObYV>xP +=ef61*TP*JpKFT"\:/j9 ]XWg>K-M'.mh/>6 +endstream endobj 467 0 obj <>/Subtype/Form/Type/XObject>>stream +0 G +0.5 0.5 37 12 re +s + +endstream endobj 468 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +HD +0Dsԃqw z~i ZݤH! 3Dz;\'Cyi#v5Z*V $qVth1'V%#gyw]34N)_D*n]UǀqH/:'O +* +endstream endobj 469 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +H$A +0DsYObYV>xP +=ef61*TP*JpKFT"\:/j9 ]XWg>K-M'.mh/>6 +endstream endobj 470 0 obj <>/Subtype/Form/Type/XObject>>stream +0 G +0.5 0.5 37 12 re +s + +endstream endobj 471 0 obj <>/Subtype/Form/Type/XObject>>stream +H235045VH2T0TF +9\fPTH(`%XXa.W@(E6KT!R w5 +endstream endobj 472 0 obj <>/Subtype/Form/Type/XObject>>stream +H235045VH2T0TF +9\fPTH(`%XXa.W@(E6KT!R w5 +endstream endobj 473 0 obj <>/Subtype/Form/Type/XObject>>stream +H235045VH2T0TF +9\fPTH(`%XXa.W@(E6KT!R w5 +endstream endobj 474 0 obj <>/Subtype/Form/Type/XObject>>stream +H235045VH2T0TF +9\fPTH(`%XXa.W@(E6KT!R w5 +endstream endobj 475 0 obj <>/Subtype/Form/Type/XObject>>stream +H235045VH2T0TF +9\fPTH(`%XXa.W@(E6KT!R w5 +endstream endobj 476 0 obj <>/Subtype/Form/Type/XObject>>stream +H235045VH2T0TF +9\fPTH(`%XXa.W@(E6KT!R w5 +endstream endobj 477 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +HD +0Dsԃqw z~i ZݤH! 3Dz;\'Cyi#v5Z*V $qVth1'V%#gyw]34N)_D*n]UǀqH/:'O +* +endstream endobj 478 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +H$A +0DsYObYV>xP +=ef61*TP*JpKFT"\:/j9 ]XWg>K-M'.mh/>6 +endstream endobj 479 0 obj <>/Subtype/Form/Type/XObject>>stream +0 G +0.5 0.5 145 12 re +s + +endstream endobj 480 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +H\ +0DsKMH^ѫ,IՀ$̼!lb0lc sDm`ʷH6,y~ђAOl<[╘~Z; o y +ٓ]tW`(6Ɨ&/3Bڍ2ot 4 +endstream endobj 120 0 obj <>/AA<<>>/AP<>/BS<>/F 4/MK<>/P 116 0 R/Parent 423 0 R/Rect[479.991 583.63 507.854 596.63]/Subtype/Widget/Type/Annot>> endobj 481 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +H\ +0DsKMH^ѫ,IՀ$̼!lb0lc sDm`ʷH6,y~ђAOl<[╘~Z; o y +ٓ]tW`(6Ɨ&/3Bڍ2ot 4 +endstream endobj 482 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +H\ +0DsKMH^ѫ,IՀ$̼!lb0lc sDm`ʷH6,y~ђAOl<[╘~Z; o y +ٓ]tW`(6Ɨ&/3Bڍ2ot 4 +endstream endobj 483 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +HD +0Dsԃq9*H*?@ mA ~-R&HVx +A#| +]4ħm,h*ĥ1:e_8j^eP6hqf;6rȲ==/r;]Q.0_rr-* +endstream endobj 484 0 obj <>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream +H$ +@ DsKvQAU HA ~K˛QZRURHl19:@%/U-x#M}{連aw__VQ:홤+5eK{d'Y +endstream endobj 485 0 obj <>/Subtype/Form/Type/XObject>>stream +0 G +0.5 0.5 37 12 re +s + +endstream endobj 486 0 obj <>>>/DA(/Helv 0 Tf 0 g)/FT/Tx/Ff 1/Kids[117 0 R 146 0 R]/T(sqIDsq1)>> endobj 117 0 obj <>/BS<>/F 4/MK<<>>/P 116 0 R/Parent 486 0 R/Rect[109.854 653.247 111.854 655.247]/Subtype/Widget/Type/Annot>> endobj 487 0 obj <>stream +HWmo8_bFMZ`oƸ.^hյ%GrHZ>dQ45p^9W57?_FRz翋FV Q4㳘h~׻Q/o? Q wֽ{_~Aj6ڄGn{J44I#μ8Nro(8|D/52fv僬V;)RM> I^F#qfϒd0 Y!v)b9wycf#R%~[lΤOKV 1q?MUNVc!tE Z|0#Ms3_ղ%Ax}J,C{U'B[r\.3 :G\<Nm^ru#7>g fy9.76&RIڵ헠D|Q[D3@y׷a季]̉5X6}T^pQKIͯro.$q/|~oKҦɋ陵1tD(v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mr +endstream endobj 490 0 obj <> endobj 124 0 obj <>>>/BS<>/DA(/Helv 0 Tf 0 g)/F 4/FT/Tx/Ff 1/MK<<>>/P 123 0 R/Rect[109.854 547.005 111.854 549.005]/Subtype/Widget/T(sqIDsq2)/Type/Annot>> endobj 128 0 obj <> endobj 129 0 obj <>/Border[0 0 0]/C[0 1 1]/H/I/Rect[126.89 116.924 453.654 128.048]/Subtype/Link/Type/Annot>> endobj 491 0 obj <>stream +HWYs8~ׯ<Щ&@ڙLUl\j HxUۍ Rn |hy?pa7z|Qu٨ nJue]ͻI0</6˟?vt&G~7'9Nw9F͈sy&hCKs,8a$xnuu1d9G,b.Gnn.";`8sk4ovLDɐ'xblbqpvq=e蟓0&t,hFLFՎ|hŹEZjpbj"ο-;  +xlv|uӲ%x';!h,O Ď݈*..qx]qt\%PG{ga,|) MYIJ$glmʺC53Mzr{;o`O)dTf8W9x.-53ec1w+ q,eCZB~O8+n,!kI΃s{G/jS݄"!C(KoTnU{4 91h}V FeajN24\r!|!" TM٭6+7E}QMLU+KՍb1&" s8ò^O+`.^\`rw}ڵ~nbț֪/ͼ"7&57 TߐVړ s7K=llC8,fpLYbQ< /Hxۓ4:BᰜcϞmy"=L>j-┹hdHG88A@+7j:ކ ${=M$V\r ]s *8X3U [ޭ(o'4~ +c`V =jǶ~Sv\:8v~qi;9lOǬsCGo[}1 &oЌheM!h MC0S!|Tn&&O `|>"z$_>^zEIDtP+l嚶y ]j[B^Vcuzg9 jX9*ӠX\Hs1Q\MG`l +endstream endobj 492 0 obj <> endobj 493 0 obj <>stream +HWYo#7~ׯоͣ ;A$aZݔqv5ʯOERcloU񫃷w/YOqX'륪34]gm?ty¦4'?=馛X};8y_LzAn~0FK8nh D F)|I0]ԓ7?'sp(&fw\`V6]5D]~[v(marQJ<.濋_& Iׇ $78`xJDC'##f1.%ɍ`+$ɔ ;WC=lFYl#dUBbtG߻a!&rvfM-o.'%@é<-c/:$J W' 6X (bWN] "H!1D2v0.&&!ۜG&3L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N$+qأLsUegW3Tx|JuEshh+"53a]Vjؽ$IWWE9ݵ3a#١ +ĥQ!aO4 xW#quнvt#ibȑ i\9PJPi^ F50lQ`B3 +]mݔP~g!h=̮4~NaNw,}GcQؒ) u{ 0cV/͂dž- bg{ j +S2(O@(%P i}濗\36T5!%Y95& +e^U 7m7ƎZЪU]YwnaK 4U#QN)Ԅ> endobj 388 0 obj <> endobj 390 0 obj <> endobj 391 0 obj <>stream +hTn0<S`HbJ"ġ?*iPb,޾Q=cQҶ#w +G[k<5Bq]-AjFJ[ea31~ 6%_ɹЎC:ŋrClc!u6 Ni6)r@kE28V> +'&:肴TϬd4ET{ -cM!TuAM?\B}'')98bwѯɍY +endstream endobj 389 0 obj <>stream +hޤU PSW>TH۩kRUlKj +*Z " <i- BR!`X@Q4RiJk:vfZvOvgvgwfܙ3sOr?$IͶ,MDBVBfNB AE,#bx D(AlϒD8KDj+GȈzMVYdIBeJA=B2J& e,BqP:'IN&͞9Y;ѺRBhߝ[n{|S~4NVQ,.VX-+7!*@@TlP |w|E0_(nuYO_Z.| TJ";sbxA6I~: d`ܛWZo@a =F4#6#1͠mgds_ݾȝM>=d-_{UqUﭵyb{VkdVAſP}_^uv s +&+8g`LZpב/Z̓!ubshx 6DPY"t5&޺c:W[iT$zX1&TKy\p֫ XQސik*o-efoqD9 / E$61#B#%!u*.VE=rP , +`,b*͕C'_.j  [s|1.缒]& b'-jd&,Â/oaH/}iX5u7e0\$]6L5f_Y.Q$3QT!Xӫ%6xI魹FW45u JXr'XBBvnnKoK +x[-\TSTǖ֔;U}-c'*;MrdL+aU# Mz!ƔWmePN7e7YF~+ml[ yey\MB/&|}%(b>b =S|υZi`o3)6@AAel[*\*=x|ܱѥS, 72"Oz~-&asqw|ܭe> endobj 74 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 79 0 obj <>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 82 0 obj <>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 85 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 88 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 91 0 obj <>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 94 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 97 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 100 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 103 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 499 0 obj <>stream +HWYo~ׯCj<6 $h͵bL$CR^p3sfF(Vg9˜lvCV}fx?ՠZu˅]Tw(9%  -g_h.i4\x}XMf6rc/3c9Gf<"J X:~ *wm]f_LH"QfŜ^,k00\{fi8ŝc\*딼7(zƊ$#)uRe\W;Gcj,/N͙3N/9#I;4H؉Ep*Z64g :}Tb9lCd@N=߯T͙+pj} W d2REu:ncxQIȸQé?F?,p!6P `y`1v3Q*5NܟL`.AJȌDQ fYayrHr"BFIZz%qh[[oT#3n/:0Ǐ +Ю=uU~[+4@h2I@wc +Ad8 hP̠'܀IP$=ë}/B4)IC~˔H8|_ {Cmr yc;Te0xݟ$ɎܿrƞOĥu?,W$W~_PBג-ΆoCBΣت;sè1A\ֵCRr^9מs*up.h~p*(qk5oW-M52C6bfs:S]eea}W^]XnAuBq؍hNw`Vş@EUaL@L GB8/^TmS7d>CX9QR"#ھ|tVA䧘 ɣE1A ++gE)sWxW+eZ'j@6k[F{ +0!e`j_ { vؤm0#YXUT@m?'SXڽ93R3"? {Bv!l @V&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nWvҶ(]Df'jKusl__Eˎ{T⊨7ywjo  1[ +=/[{7\xIq6yEBU)(qÇ.ȫJUSC'Q&׼cͺV˲+v]=.ǀ\#v $qO +0 4 +endstream endobj 518 0 obj <> endobj 75 0 obj <> endobj 76 0 obj <> endobj 370 0 obj < 8 \) ? aebTrustedFunctions\( this, aebImportAnFDF, "exerquiz.fdf"\) : this.importAnFDF\("exerquiz.fdf"\);\r\nif\(typeof dljslib == "undefined"\)\r\n \( app.viewerVersion > 8 \) ? aebTru\ stedFunctions\( this, aebImportAnFDF, "dljslib.fdf"\) : this.importAnFDF\("dljslib.fdf"\);\r\nif\(typeof _execXMP == "undefined"\)\r\n \( app.viewerVersion > 8 \) ? aebTrustedFunctions\( this, aebImportAnFDF, "execXMP.fdf"\) : this.importAnFDF\("execXMP.f\ df"\);\r\nif\(typeof partialExpand == "undefined"\)\r\n \( app.viewerVersion > 8 \) ? aebTrustedFunctions\( this, aebImportAnFDF, "partial.fdf"\) : this.importAnFDF\("partial.fdf"\);\r\nif\(typeof _docassembly == "undefined"\)\r\n \( app.viewerVersion > 8\ \) ? aebTrustedFunctions\( this, aebImportAnFDF, "docassembly.fdf"\) : this.importAnFDF\("docassembly.fdf"\);\r\n)/S/JavaScript>>>>/Annots[371 0 R 372 0 R]/Contents 533 0 R/CropBox[0 0 612 791]/MediaBox[0 0 612 792]/Parent 361 0 R/Resources<>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 1 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 56 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 59 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 62 0 obj <>/ExtGState<>/Font<>/ProcSet[/PDF/Text]/XObject<>>>/Rotate 0/Type/Page>> endobj 65 0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ș8ˢ^\xx]xx^[|zMiίJ3f:Z1s!I+q&zɫϋ71a<*p{ 'J#*N` +TUZU幍k0LS}:w3M+.OsjT@TDݱr1  ,ʠ0_t/ɨk3/RӀcԗIi  =cפ[s|'IේD܎7MNU_|5'DXk$:̲[mễ1$,8~V$""ҡrt#  >H:bA:_-?^f/r:TC% e',QMB%T2iv-Dh>J0.eX8}XT^;$29uvtNH DW\UWy̎'SȟC}&_Gn4`Fd3ޕ=\JoM-)Ll?ter$%{~4 ߎ2h~5 0xnZKk}a^v}9` f\1S;&2 0"YS*<'>`9IZ-Kc{g(f.5K|ı8?^YDg/z8$m&y9틞'{#r](F= W=~Ø='">LxO37X`OPr]}B(\2q=<=1uD( c +j6a,lGVuw{]q_}}ӂ< } Moa +&xȄy+"RQ3M<;qClƳ +Aw(/ +61"!ka- B< 2zEs/'@OK'B#i^ _*(]Afɫ*3?Agщja`GS<shN+lBUű(s7#bɝj$ݴ` +;WIlԥӊܽEYʳv=P{Od~4$`P&vT&ڳ3od$z_H`̞þփRj<0ӑH`pأXhHΥ˧Yg'@z dMh4_?f4N|&܎֋0: +endstream endobj 530 0 obj <> endobj 531 0 obj <>stream +HWmo6_0;@kQɄdZI ޏmp<87 *td&r** d=ɜ@@2Ùo_gʼn/= +\p E rV}^/"Ίug9 9{h =A|P)5Tr?dEn&FiFxTkqE/ۥ>\k>vy~?o> endobj 2 0 obj <> endobj 3 0 obj <> endobj 4 0 obj <> endobj 5 0 obj <> endobj 6 0 obj <> endobj 7 0 obj <> endobj 8 0 obj <> endobj 9 0 obj <> endobj 10 0 obj <> endobj 11 0 obj <> endobj 12 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <> endobj 15 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <> endobj 18 0 obj <> endobj 19 0 obj <> endobj 20 0 obj <> endobj 21 0 obj <> endobj 22 0 obj <> endobj 23 0 obj <> endobj 24 0 obj <> endobj 25 0 obj <> endobj 533 0 obj <>stream +HlTko0_DjTU#6iU֢mR6M.q k8K_?6*$cs=ڗT^Ƿ;[+FF\Vu+Mݵ'@ q89,_bX l0W0b gNC(2;4/[0+8S/H…99"iJ)"F.NKM(ɯ3(ͅ3HE%f(I|]6`Hx> sJ0ʰH Ou, +H*V) <'e[v\IsY>jZDŽ)EVn..f2eFWUz(lZ9ّW֧֨J#81|ZŰpFz){6+?;]r*oPc.m:Mig˺Wƅ,p6" 4C^EcڿFSˬ=Mw/HPΓ 2#̉h5޽f^/GH g08:;]W+cupDxx /rݻm$QIg(MnZhQ,kWVkwwFڔףL bJw` /K +endstream endobj 534 0 obj <> endobj 371 0 obj <>/Border[0 0 0]/C[0 1 1]/H/I/Rect[192.485 130.706 289.508 141.83]/Subtype/Link/Type/Annot>> endobj 372 0 obj <>/Border[0 0 0]/C[0 1 1]/H/I/Rect[417.538 132.533 505.002 140.524]/Subtype/Link/Type/Annot>> endobj 359 0 obj <> endobj 200 0 obj <> endobj 201 0 obj <> endobj 202 0 obj <> endobj 203 0 obj <> endobj 204 0 obj <> endobj 205 0 obj <> endobj 206 0 obj <> endobj 207 0 obj <> endobj 208 0 obj <> endobj 209 0 obj <> endobj 210 0 obj <> endobj 211 0 obj <> endobj 212 0 obj <> endobj 213 0 obj <> endobj 214 0 obj <> endobj 215 0 obj <> endobj 216 0 obj <> endobj 217 0 obj <> endobj 218 0 obj <> endobj 219 0 obj <> endobj 220 0 obj <> endobj 221 0 obj <> endobj 222 0 obj <> endobj 223 0 obj <> endobj 224 0 obj <> endobj 230 0 obj <> endobj 535 0 obj <> endobj 536 0 obj <> endobj 537 0 obj <> endobj 538 0 obj <> endobj 539 0 obj <> endobj 540 0 obj <> endobj 541 0 obj <> endobj 542 0 obj <> endobj 543 0 obj <> endobj 544 0 obj <> endobj 545 0 obj <> endobj 546 0 obj <> endobj 547 0 obj <> endobj 548 0 obj <> endobj 549 0 obj <> endobj 550 0 obj <> endobj 551 0 obj <> endobj 552 0 obj <> endobj 553 0 obj <> endobj 554 0 obj <>stream +HWm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obj 235 0 obj <> endobj 236 0 obj <> endobj 237 0 obj <> endobj 238 0 obj <> endobj 239 0 obj <> endobj 240 0 obj <> endobj 241 0 obj <> endobj 242 0 obj <> endobj 243 0 obj <> endobj 244 0 obj <> endobj 245 0 obj <> endobj 246 0 obj <> endobj 247 0 obj <> endobj 248 0 obj <> endobj 249 0 obj <> endobj 250 0 obj <> endobj 251 0 obj <> endobj 252 0 obj <> endobj 253 0 obj <> endobj 254 0 obj <> endobj 255 0 obj <> endobj 256 0 obj <> endobj 257 0 obj <> endobj 258 0 obj <> endobj 259 0 obj <> endobj 260 0 obj <> endobj 261 0 obj <> endobj 262 0 obj <> endobj 263 0 obj <> endobj 264 0 obj <> endobj 265 0 obj <> endobj 266 0 obj <> endobj 267 0 obj <> endobj 268 0 obj <> endobj 269 0 obj <> endobj 270 0 obj <> endobj 271 0 obj <> endobj 272 0 obj <> endobj 273 0 obj <> endobj 274 0 obj <> endobj 275 0 obj <> endobj 276 0 obj <> endobj 277 0 obj <> endobj 278 0 obj <> endobj 279 0 obj <> endobj 280 0 obj <> endobj 281 0 obj <> endobj 282 0 obj <> endobj 283 0 obj <> endobj 284 0 obj <> endobj 285 0 obj <> endobj 286 0 obj <> endobj 287 0 obj <> endobj 288 0 obj <> endobj 289 0 obj <> endobj 290 0 obj <> endobj 291 0 obj <> endobj 292 0 obj <> endobj 293 0 obj <> endobj 294 0 obj <> endobj 295 0 obj <> endobj 296 0 obj <> endobj 297 0 obj <> endobj 298 0 obj <> endobj 299 0 obj <> endobj 300 0 obj <> endobj 301 0 obj <> endobj 302 0 obj <> endobj 303 0 obj <> endobj 304 0 obj <> endobj 305 0 obj <> endobj 306 0 obj <> endobj 307 0 obj <> endobj 308 0 obj <> endobj 309 0 obj <> endobj 310 0 obj <> endobj 311 0 obj <> endobj 312 0 obj <> endobj 313 0 obj <> endobj 314 0 obj <> endobj 315 0 obj <> endobj 316 0 obj <> endobj 317 0 obj <> endobj 318 0 obj <> endobj 319 0 obj <> endobj 320 0 obj <> endobj 321 0 obj <> endobj 322 0 obj <> endobj 323 0 obj <> endobj 324 0 obj <> endobj 325 0 obj <> endobj 326 0 obj <> endobj 327 0 obj <> endobj 328 0 obj <> endobj 329 0 obj <> endobj 330 0 obj <> endobj 331 0 obj <> endobj 332 0 obj <> endobj 333 0 obj <> endobj 334 0 obj <> endobj 335 0 obj <> endobj 336 0 obj <> endobj 337 0 obj <> endobj 338 0 obj <> endobj 339 0 obj <> endobj 340 0 obj <> endobj 341 0 obj <> endobj 342 0 obj <> endobj 343 0 obj <> endobj 344 0 obj <> endobj 345 0 obj <> endobj 346 0 obj <> endobj 347 0 obj <> endobj 348 0 obj <> endobj 349 0 obj <> endobj 350 0 obj <> endobj 351 0 obj <> endobj 352 0 obj <> endobj 353 0 obj <> endobj 354 0 obj <> endobj 355 0 obj <> endobj 356 0 obj <> endobj 357 0 obj <> endobj 225 0 obj [179 0 R] endobj 228 0 obj <> endobj 567 0 obj <> endobj xref +0 568 +0000000000 65535 f +0000161010 00000 n +0000177950 00000 n +0000178075 00000 n +0000178200 00000 n +0000178330 00000 n +0000178460 00000 n +0000178585 00000 n +0000178710 00000 n +0000178835 00000 n +0000178965 00000 n +0000179095 00000 n +0000179226 00000 n +0000179357 00000 n +0000179488 00000 n +0000179619 00000 n +0000179748 00000 n +0000179879 00000 n +0000180015 00000 n +0000180151 00000 n +0000180287 00000 n +0000180418 00000 n +0000180544 00000 n +0000180670 00000 n +0000180801 00000 n +0000180932 00000 n +0000000000 00000 f +0000000000 00000 f +0000082661 00000 n +0000086783 00000 n +0000087019 00000 n +0000087571 00000 n +0000081616 00000 n +0000087937 00000 n +0000088487 00000 n +0000081825 00000 n +0000088852 00000 n +0000089374 00000 n +0000082034 00000 n +0000089785 00000 n +0000090305 00000 n +0000082243 00000 n +0000090716 00000 n +0000091270 00000 n +0000082452 00000 n +0000000000 00000 f +0000000000 00000 f +0000073961 00000 n +0000079223 00000 n +0000079779 00000 n +0000080221 00000 n +0000069315 00000 n +0000080847 00000 n +0000080975 00000 n +0000000000 00000 f +0000000000 00000 f +0000161501 00000 n +0000000000 00000 f +0000000000 00000 f +0000161851 00000 n +0000000000 00000 f +0000000000 00000 f +0000162214 00000 n +0000000000 00000 f +0000000000 00000 f +0000162551 00000 n +0000000000 00000 f +0000000000 00000 f +0000162901 00000 n +0000000000 00000 f +0000000000 00000 f +0000163198 00000 n +0000000000 00000 f +0000000000 00000 f +0000136232 00000 n +0000159504 00000 n +0000159631 00000 n +0000000000 00000 f +0000000000 00000 f +0000136617 00000 n +0000000000 00000 f +0000000000 00000 f +0000136927 00000 n +0000000000 00000 f +0000000000 00000 f +0000137211 00000 n +0000000000 00000 f +0000000000 00000 f +0000137535 00000 n +0000000000 00000 f +0000000000 00000 f +0000137872 00000 n +0000000000 00000 f +0000000000 00000 f +0000138169 00000 n +0000000000 00000 f +0000000000 00000 f +0000138506 00000 n +0000000000 00000 f +0000000000 00000 f +0000138843 00000 n +0000000000 00000 f +0000000000 00000 f +0000139168 00000 n +0000000000 00000 f +0000000000 00000 f +0000005589 00000 n +0000000000 00000 f +0000000000 00000 f +0000005953 00000 n +0000000000 00000 f +0000000000 00000 f +0000006304 00000 n +0000124847 00000 n +0000000000 00000 f +0000000000 00000 f +0000006658 00000 n +0000108172 00000 n +0000098301 00000 n +0000094391 00000 n +0000105531 00000 n +0000000000 00000 f +0000000000 00000 f +0000007010 00000 n +0000117286 00000 n +0000097222 00000 n +0000093205 00000 n +0000070207 00000 n +0000117515 00000 n +0000117643 00000 n +0000000000 00000 f +0000000000 00000 f +0000114239 00000 n +0000115022 00000 n +0000114373 00000 n +0000114653 00000 n +0000007417 00000 n +0000110903 00000 n +0000111030 00000 n +0000111157 00000 n +0000096470 00000 n +0000092047 00000 n +0000071059 00000 n +0000000000 00000 f +0000000000 00000 f +0000007811 00000 n +0000067121 00000 n +0000067348 00000 n +0000067887 00000 n +0000068308 00000 n +0000000000 00000 f +0000000000 00000 f +0000008163 00000 n +0000000000 00000 f +0000000000 00000 f +0000008488 00000 n +0000059047 00000 n +0000000000 00000 f +0000000000 00000 f +0000024046 00000 n +0000029228 00000 n +0000028890 00000 n +0000028509 00000 n +0000038327 00000 n +0000025347 00000 n +0000038802 00000 n +0000039136 00000 n +0000038489 00000 n +0000028626 00000 n +0000085818 00000 n +0000086074 00000 n +0000085555 00000 n +0000076029 00000 n +0000085724 00000 n +0000076682 00000 n +0000077136 00000 n +0000077490 00000 n +0000076829 00000 n +0000027113 00000 n +0000080430 00000 n +0000027407 00000 n +0000025728 00000 n +0000026880 00000 n +0000026821 00000 n +0000061100 00000 n +0000026113 00000 n +0000061833 00000 n +0000061451 00000 n +0000025951 00000 n +0000026188 00000 n +0000026427 00000 n +0000060897 00000 n +0000060399 00000 n +0000127141 00000 n +0000127403 00000 n +0000127775 00000 n +0000128087 00000 n +0000127501 00000 n +0000113772 00000 n +0000005019 00000 n +0000182142 00000 n +0000182229 00000 n +0000182325 00000 n +0000182468 00000 n +0000182580 00000 n +0000182699 00000 n +0000182801 00000 n +0000182940 00000 n +0000183032 00000 n +0000183150 00000 n +0000183254 00000 n +0000183355 00000 n +0000183491 00000 n +0000183600 00000 n +0000183707 00000 n +0000183808 00000 n +0000183971 00000 n +0000184072 00000 n +0000184193 00000 n +0000184298 00000 n +0000184403 00000 n +0000184508 00000 n +0000184613 00000 n +0000184718 00000 n +0000184823 00000 n +0000214955 00000 n +0000000000 00000 f +0000072303 00000 n +0000214982 00000 n +0000072395 00000 n +0000184978 00000 n +0000206327 00000 n +0000207409 00000 n +0000208672 00000 n +0000208722 00000 n +0000208772 00000 n +0000208822 00000 n +0000208872 00000 n +0000208922 00000 n +0000208972 00000 n +0000209022 00000 n +0000209073 00000 n +0000209123 00000 n +0000209173 00000 n +0000209223 00000 n +0000209273 00000 n +0000209323 00000 n +0000209373 00000 n +0000209423 00000 n +0000209473 00000 n +0000209523 00000 n +0000209573 00000 n +0000209624 00000 n +0000209675 00000 n +0000209726 00000 n +0000209777 00000 n +0000209828 00000 n +0000209879 00000 n +0000209928 00000 n +0000209978 00000 n +0000210028 00000 n +0000210078 00000 n +0000210128 00000 n +0000210178 00000 n +0000210228 00000 n +0000210278 00000 n +0000210328 00000 n +0000210378 00000 n +0000210428 00000 n +0000210479 00000 n +0000210530 00000 n +0000210580 00000 n +0000210631 00000 n +0000210682 00000 n +0000210733 00000 n +0000210784 00000 n +0000210835 00000 n +0000210885 00000 n +0000210935 00000 n +0000210985 00000 n +0000211035 00000 n +0000211085 00000 n +0000211135 00000 n +0000211185 00000 n +0000211235 00000 n +0000211285 00000 n +0000211335 00000 n +0000211386 00000 n +0000211437 00000 n +0000211488 00000 n +0000211538 00000 n +0000211589 00000 n +0000211640 00000 n +0000211689 00000 n +0000211738 00000 n +0000211789 00000 n +0000211839 00000 n +0000211890 00000 n +0000211940 00000 n +0000211990 00000 n +0000212040 00000 n +0000212090 00000 n +0000212140 00000 n +0000212190 00000 n +0000212240 00000 n +0000212290 00000 n +0000212340 00000 n +0000212390 00000 n +0000212440 00000 n +0000212490 00000 n +0000212540 00000 n +0000212590 00000 n +0000212640 00000 n +0000212690 00000 n +0000212740 00000 n +0000212790 00000 n +0000212840 00000 n +0000212890 00000 n +0000212940 00000 n +0000212990 00000 n +0000213040 00000 n +0000213090 00000 n +0000213140 00000 n +0000213190 00000 n +0000213240 00000 n +0000213290 00000 n +0000213340 00000 n +0000213391 00000 n +0000213442 00000 n +0000213493 00000 n +0000213544 00000 n +0000213594 00000 n +0000213644 00000 n +0000213694 00000 n +0000213744 00000 n +0000213794 00000 n +0000213844 00000 n +0000213895 00000 n +0000213945 00000 n +0000213995 00000 n +0000214045 00000 n +0000214095 00000 n +0000214145 00000 n +0000214195 00000 n +0000214245 00000 n +0000214295 00000 n +0000214345 00000 n +0000214396 00000 n +0000214445 00000 n +0000214496 00000 n +0000214547 00000 n +0000214598 00000 n +0000214649 00000 n +0000214700 00000 n +0000214751 00000 n +0000214802 00000 n +0000214853 00000 n +0000214904 00000 n +0000005077 00000 n +0000182116 00000 n +0000005115 00000 n +0000005187 00000 n +0000005320 00000 n +0000005455 00000 n +0000000654 00000 n +0000000000 00000 f +0000000000 00000 f +0000000016 00000 n +0000000480 00000 n +0000004964 00000 n +0000159758 00000 n +0000181818 00000 n +0000181972 00000 n +0000000000 00000 f +0000023458 00000 n +0000056317 00000 n +0000056190 00000 n +0000039993 00000 n +0000040989 00000 n +0000040232 00000 n +0000040625 00000 n +0000000000 00000 f +0000122357 00000 n +0000122743 00000 n +0000123457 00000 n +0000122852 00000 n +0000123112 00000 n +0000132612 00000 n +0000132991 00000 n +0000133797 00000 n +0000133137 00000 n +0000133440 00000 n +0000022619 00000 n +0000046757 00000 n +0000048111 00000 n +0000047170 00000 n +0000047720 00000 n +0000024768 00000 n +0000031052 00000 n +0000032413 00000 n +0000031472 00000 n +0000032045 00000 n +0000056354 00000 n +0000000000 00000 f +0000008842 00000 n +0000009624 00000 n +0000018278 00000 n +0000018333 00000 n +0000018378 00000 n +0000018484 00000 n +0000018590 00000 n +0000018627 00000 n +0000019160 00000 n +0000021831 00000 n +0000022286 00000 n +0000022308 00000 n +0000022386 00000 n +0000022463 00000 n +0000056139 00000 n +0000059172 00000 n +0000064879 00000 n +0000064930 00000 n +0000067070 00000 n +0000069146 00000 n +0000069247 00000 n +0000071910 00000 n +0000073579 00000 n +0000074356 00000 n +0000079172 00000 n +0000081149 00000 n +0000081199 00000 n +0000081476 00000 n +0000081571 00000 n +0000083118 00000 n +0000086732 00000 n +0000091710 00000 n +0000091805 00000 n +0000091873 00000 n +0000091931 00000 n +0000091989 00000 n +0000092482 00000 n +0000092862 00000 n +0000093582 00000 n +0000093954 00000 n +0000094292 00000 n +0000094714 00000 n +0000095086 00000 n +0000095424 00000 n +0000095796 00000 n +0000096134 00000 n +0000096229 00000 n +0000096296 00000 n +0000096354 00000 n +0000096412 00000 n +0000097025 00000 n +0000097753 00000 n +0000097950 00000 n +0000098564 00000 n +0000098759 00000 n +0000098956 00000 n +0000099328 00000 n +0000099666 00000 n +0000099863 00000 n +0000100235 00000 n +0000100573 00000 n +0000100770 00000 n +0000101142 00000 n +0000101480 00000 n +0000101675 00000 n +0000102047 00000 n +0000102385 00000 n +0000102580 00000 n +0000102857 00000 n +0000103134 00000 n +0000103411 00000 n +0000103688 00000 n +0000103965 00000 n +0000104242 00000 n +0000104614 00000 n +0000104952 00000 n +0000105149 00000 n +0000106339 00000 n +0000106721 00000 n +0000107103 00000 n +0000107482 00000 n +0000107826 00000 n +0000108021 00000 n +0000108316 00000 n +0000110852 00000 n +0000111384 00000 n +0000117235 00000 n +0000117828 00000 n +0000120171 00000 n +0000120222 00000 n +0000124796 00000 n +0000124974 00000 n +0000130309 00000 n +0000130360 00000 n +0000136181 00000 n +0000139506 00000 n +0000141801 00000 n +0000141852 00000 n +0000144329 00000 n +0000144380 00000 n +0000145772 00000 n +0000145823 00000 n +0000147540 00000 n +0000147591 00000 n +0000149284 00000 n +0000149335 00000 n +0000151050 00000 n +0000151101 00000 n +0000153196 00000 n +0000153247 00000 n +0000154627 00000 n +0000154678 00000 n +0000157165 00000 n +0000157216 00000 n +0000159453 00000 n +0000163508 00000 n +0000165444 00000 n +0000165495 00000 n +0000167754 00000 n +0000167805 00000 n +0000170112 00000 n +0000170163 00000 n +0000172043 00000 n +0000172094 00000 n +0000174429 00000 n +0000174480 00000 n +0000176707 00000 n +0000176758 00000 n +0000177899 00000 n +0000181060 00000 n +0000181767 00000 n +0000185022 00000 n +0000185690 00000 n +0000185736 00000 n +0000185991 00000 n +0000186037 00000 n +0000186083 00000 n +0000186129 00000 n +0000186175 00000 n +0000186221 00000 n +0000186267 00000 n +0000186313 00000 n +0000186377 00000 n +0000186437 00000 n +0000186483 00000 n +0000186650 00000 n +0000186963 00000 n +0000187009 00000 n +0000187055 00000 n +0000187101 00000 n +0000187147 00000 n +0000188524 00000 n +0000189073 00000 n +0000190099 00000 n +0000191560 00000 n +0000192480 00000 n +0000193339 00000 n +0000197799 00000 n +0000198209 00000 n +0000198971 00000 n +0000202871 00000 n +0000204396 00000 n +0000205407 00000 n +0000215060 00000 n +trailer +<<1DDBB348F97C6945A42883A56B114D19>]>> +startxref +215462 +%%EOF diff --git a/texmf-dist/doc/latex/rangen/rangen_man.tex b/texmf-dist/doc/latex/rangen/rangen_man.tex new file mode 100644 index 00000000..cfecd31e --- /dev/null +++ b/texmf-dist/doc/latex/rangen/rangen_man.tex @@ -0,0 +1,1563 @@ +% makeindex < aebpro_man.idx > aebpro_man.ind +\documentclass[12pt]{article} +\usepackage[fleqn]{amsmath} +\usepackage[ + web={centertitlepage,designv,tight*,forcolorpaper, +% usesf, + latextoc,pro}, + aebxmp,exerquiz, + dljslib={equations,ImplMulti,indefIntegral,limitArith,nodec} +]{aeb_pro} +\usepackage{multicol} +\usepackage{array} +%\usepackage{myriadpro} %[usecmtt] +\usepackage[altbullet]{lucidbry} +\usepackage[quiet,testmode]{rangen} % testmode +%\usepackage[quiet,seed=98]{rangen} % 128 +%\usepackage[quiet,seed=135]{rangen} % + +\DeclareInitView +{% + layoutmag={mag=100}, +% windowoptions={fit} +} + + +%\usepackage{makeidx}\makeindex + +\usepackage{acroman} + +\usepackage[active]{srcltx} + +\def\expath{../examples} + +\urlstyle{tt} + +%\def\tutpath{doc/tutorial} +%\def\tutpathi{tutorial} + +\DeclareDocInfo +{ + university={\AcroTeX.Net}, + title={The \texorpdfstring{\pkg{rangen} Package\\[1em]}{: } + Random Generation of Integer, Rational, and Real Numbers with + Applications to the \texttt{exercise}, \texttt{quiz}, and \texttt{shortquiz} Environments of \textsf{Exerquiz}}, + author={D. P. Story}, + email={dpstory@acrotex.net}, + subject={Documentation for annot\textunderscore pro from AcroTeX}, + talksite={\url{www.acrotex.net}}, + version={1.4}, + copyrightStatus=True, + copyrightNotice={Copyright (C) \the\year, D. P. Story}, + copyrightInfoURL={http://www.acrotex.net} +} + +\def\anglemeta#1{\ensuremath{\langle\textit{\texttt{#1}}\rangle}} +\def\meta#1{\textit{\texttt{#1}}} +\let\meta\anglemeta +\def\darg#1{\texttt{\{#1\}}} +\def\takeMeasure{\bgroup\obeyspaces\takeMeasurei} +\def\takeMeasurei#1{\global\setbox\webtempboxi\hbox{\ttfamily#1}\egroup} +\def\bxSize{\wd\webtempboxi+2\fboxsep+2\fboxrule} +\let\pkg\textsf +\let\env\texttt +\let\opt\texttt +\let\app\textsf + +\let\amtIndent\leftmargini +\def\SUB#1{${}_{\text{#1}}$} + +\newdimen\aebdimen \aebdimen 0pt %\advance\aebdimen\partopsep +\newcommand\bVerb[1][]{\begingroup#1\vskip\aebdimen\parindent0pt}% +\def\eVerb{\vskip\aebdimen\endgroup\noindent} + +\makeatletter +\renewcommand{\paragraph} + {\@startsection{paragraph}{4}{0pt}{6pt}{-3pt}{\bfseries}} +\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.5em}} +\renewcommand*\descriptionlabel[1]{\hspace\labelsep + \normalfont #1} +\newcommand{\aebDescriptionlabel}[1]{% + \setlength\dimen@{\amtIndent+\labelsep}% + {\hspace*{\dimen@}#1}} +\makeatother +\newenvironment{aebDescript} + {\begin{list}{}{\setlength{\labelwidth}{0pt}% + \setlength{\leftmargin}{\leftmargin}% + \setlength{\leftmargin}{\leftmargin+\amtIndent}% + \setlength\itemindent{-\leftmargin}% + \let\makelabel\aebDescriptionlabel + }}{\end{list}} + + +\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}} + +\newenvironment{eqComments}[1][\strut]{\smallskip\leftskip-\labelwidth +\item[]\textbf{\textcolor{blue}{#1}}}{\par\smallskip} + +\renewcommand\nodecAlertMsg{% + "A decimal answer is not acceptable here. + Please express your answer using a fraction."} + +%\previewtrue + +%\pagestyle{empty} +%\parindent0pt\parskip\medskipamount + +\definePath\bgPath{"C:/Users/Public/Documents/% + ManualBGs/Manual_BG_Print_AeB.pdf"} +\begin{docassembly} +\addWatermarkFromFile({% + bOnTop: false, + cDIPath: \bgPath +}) +\executeSave() +\end{docassembly} + +\begin{document} + +\maketitle + +\selectColors{linkColor=black} +\tableofcontents +\selectColors{linkColor=webgreen} + +\section{Introduction}\label{s:intro} + +This is a package that I began back in the year 2000 AD; at that +time, I managed to obtain a working version up and running with many +bugs, then forgot about it. Now, in my retirement, I stumbled across +the work and decided to give it another go. + +The \pkg{rangen} package, as the title implies, can (pseudo-)randomly generate +integers, rationals, and real numbers. Generate said numbers using the +\cs{RandomZ}, \cs{RandomQ}, and \cs{RandomR} commands, respectively; in addition +to these, there is \cs{RandomL} for creating a list of numbers, from which one number +is selected at random, and \cs{RandomI} for generating a random index value that can +be used in conjunction with \cs{RandomL}. + +The \AcroTeX{} eDucation Bundle (AeB) contains a package called \textsf{exerquiz} +that is used to create exercises and quizzes. My goal in writing the +\pkg{rangen} package was to integrate it with the quiz system of \textsf{exerquiz} +so that quiz questions could be composed using the ``natural'' syntax of \pkg{rangen}, +each time the source file is {\LaTeX}ed, new random numbers populate the question. To get your +interest, here is an example, + + + +\begingroup\parskip0pt %\previewtrue + +\def\aftershortquizskip{} +\setlength{\multicolsep}{0pt} + +\begin{shortquiz}*[answer] \textbf{\textcolor{blue}{Arithmetic.}} +A simple arithmetic problem, I've created one problem, then copied it to make +two problems. + +\vskip6pt + +\begin{multicols}{2} +\begin{questions} + +% subtraction +\RandomQ{\a}[16]{1/8}{15/16}\RandomQ[ne=\a]{\b}[16]{1/8}{15/16} + +\item $\displaystyle \ds\a - \ds\b = + \RespBoxMath[\rectW{.5in}]{ (\nOf\a * \dOf\b - \nOf\b * \dOf\a )/( \dOf\a * \dOf\b ) }{2}{.0001}{[0,2]}[{priorParse: \Array(nodec,NoAddOrSub)}]$\hfill + \CorrAnsButton{rFrac( rEval( \nOf\a * \dOf\b - \nOf\b * \dOf\a )/rEval( \dOf\a * \dOf\b ) )}*{rngCorrAnsButton}\kern1bp\sqTallyBox + +% subtraction +\RandomQ{\a}[16]{1/8}{15/16}\RandomQ[ne=\a]{\b}[16]{1/8}{15/16} + +\item $\displaystyle \ds\a - \ds\b = + \RespBoxMath[\rectW{.5in}]{ (\nOf\a * \dOf\b - \nOf\b * \dOf\a )/( \dOf\a * \dOf\b ) }{2}{.0001}{[0,2]}[{priorParse: \Array(nodec,NoAddOrSub)}]$\hfill + \CorrAnsButton{rFrac( rEval( \nOf\a * \dOf\b - \nOf\b * \dOf\a )/rEval( \dOf\a * \dOf\b ) )}*{rngCorrAnsButton}\kern1bp\sqTallyBox +\pushquestions +\end{multicols} +\popquestions + +\vskip-6pt + +\begin{eqComments}[Indefinite Integration.] +There are two integration problems, again, the second question is a copy and paste of the first. +The parameters of the problem were, of course, populated by different random numbers. +\end{eqComments} + +\RandomQ{\a}{1/6}{3/2} +\RandomQ{\b}{1/6}{3/2} +\RandomZ{\c}{1}{3} + +\item $\displaystyle\int \cds\a x^2 + \cds\b x + \ds\c\,dx = + \RespBoxMath{(\a/3)x^3+(\b/2) x^2 + \c x}{3}{.0001}{[0,2]}$\hfill + \CorrAnsButton{(rFrac(rEval(\nOf\a)/rEval(3*\dOf\a))) x^3 + + (rFrac(rEval(\nOf\b)/rEval(2*\dOf\b))) x^2 + + \c x + C}*{rngCorrAnsButton}\kern1bp\sqTallyBox + +\RandomQ{\a}{1/6}{3/2} +\RandomQ{\b}{1/6}{3/2} +\RandomZ{\c}{1}{3} + +\item $\displaystyle\int \cds\a x^2 + \cds\b x + \ds\c\,dx = + \RespBoxMath{(\a/3)x^3+(\b/2) x^2 + \c x}{3}{.0001}{[0,2]}$\hfill + \CorrAnsButton{(rFrac(rEval(\nOf\a)/rEval(3*\dOf\a))) x^3 + + (rFrac(rEval(\nOf\b)/rEval(2*\dOf\b))) x^2 + + \c x + C}*{rngCorrAnsButton}\kern1bp\sqTallyBox + +%\vskip-6pt +\vskip-6pt + +\begin{eqComments} +Definite integration can also be posed, but is not illustrated here. +\end{eqComments} + +\vskip-6pt + +\begin{eqComments}[Analytic Geometry.] +Find the equation of the line that passes through $P$ and $Q$. +\end{eqComments} + +\RandomZ{\a}{-10}{9} +\RandomZ{\b}{-10}{9} +\RandomZ{\c}{\a*}{10} +\RandomZ{\d}{\b*}{10} +\defineDepQJS{\m}{\d - \b}{\c - \a}{rFrac(rEval(\nOf\m)/rEval(\dOf\m))} + +\item $P(\,\a, \b\,)$, $Q(\,\c, \d\,)$: + \RespBoxMath{y = \m*x + (\b - \a*\m) }(xy){3}{.0001}{[0,2]x[0,2]}*{ProcRespEq}\hfill + \CorrAnsButton{y = \js\m\space x + rFrac((rEval( \b * \dOf\m - \a*\nOf\m ))/(rEval(\dOf\m)))}*{rngCorrAnsButton}% + \kern1bp\sqTallyBox + +\RandomZ{\a}{-10}{9} +\RandomZ{\b}{-10}{9} +\RandomZ{\c}{\a*}{10} +\RandomZ{\d}{\b*}{10} +\defineDepQJS{\m} {\d - \b} {\c - \a} {rFrac(rEval(\nOf\m)/rEval(\dOf\m))} + +\item $P(\,\a, \b\,)$, $Q(\,\c, \d\,)$: + \RespBoxMath{y = \m*x + (\b - \a*\m) }(xy){3}{.0001}{[0,2]x[0,2]}*{ProcRespEq}\hfill + \CorrAnsButton{y = \js\m\space x + rFrac((rEval( \b * \dOf\m - \a*\nOf\m ))/(rEval(\dOf\m)))}*{rngCorrAnsButton}% + \kern1bp\sqTallyBox\par\kern2pt +\end{questions} +\end{shortquiz}\hfill\sqClearButton\kern1bp\sqTallyTotal +\par\endgroup +\newtopic\noindent +Each time the manual is compiled, a new set of problems of the same type is generated. +This package is pretty impressive, I'm sure you'll agree. \dps + +These examples were taken from the demo file \texttt{rangen\_tst.tex}. + +\section{Requirements} + +The requirements for your {\LaTeX} system, and well as any other +software, is highlighted in this section. + +\subsection{{\LaTeX} Package Requirements} + +The following packages, in addition to the standard {\LaTeX} +distribution, are required: +\begin{enumerate} + \item The \textsf{lcg} package (2008/09/10 v1.2) by Erich Janka. + \item The \textsf{hyperref} package, a recent version. + \item If you want to use \pkg{rangen} to create quizzes, then + \textsf{exerquiz} of \textcolor{blue}{AeB} is required.\footnote{AeB: \url{http://www.math.uakron.edu/~dpstory/webeq.html}} +\end{enumerate} + +\subsection{PDF Creator Requirements} + +The package works for all PDF creators: Acrobat Distiller, pdftex, and dvipdfm. + +\section{Installation} + +Unzip \texttt{rangen.zip} into your {\LaTeX} tree, the folder \texttt{rangen} is constructed +with to contain the installation. + +\section{Package Options} + +Currently, there is only one option, \opt{testmode}. Then this option is used, +each time the file is run, the random number generator of \pkg{lcd} is re-seeded +Normally, the seed is based on the time, the date and other factors; the clock +of the {\TeX} compiler gives the time to the nearest minute, so one must wait at least +a minute before getting a new seed, this is not acceptable when testing a package. +When \opt{testmode} is used, the initial seed is \texttt{seed=1}, and increments +by one thereafter; after the increment, this value is saved to the file +\cs{jobname.seed} and input back in on the next compile. + +Any other options that are passed to \pkg{rangen}, are passed on to the \textsf{lcg} package. +Useful options for \pkg{lcg} are \texttt{quiet} and \texttt{seed=\meta{number}}. + + +\section{Basic Commands} + +This package defines the commands \cs{RandomZ}, +\cs{RandomQ}, and \cs{RandomR}, \cs{RandomL}, and \cs{RandomI}. We describe +these commands in this section. + +For convenience of terminology, a number created by one of the above commands +will be referred to as a RV (random variable). + +\cs{RandomZ} and \cs{RandomQ} use the count registers, so there is a restriction +on the size of any RV generated by these two commands, we must have +\begin{equation*} + -2^{31}+1 \leq \text{RV} \leq 2^{31}-1\implies + -2147483647 \leq \text{RV} \leq 2147483647 +\end{equation*} +For simple applications envisioned for \pkg{rangen}, this range should be plenty +enough. + +The \cs{RandomR} command uses the dimension registers, so a RV generated by +\cs{RandomR} is restricted to +\begin{equation*} + -2^{14} < \text{RV} < 2^{14}\implies + -16384 < \text{RV} < 16384 +\end{equation*} +Again, this is not a package for making floating point calculations, it is a package +for generating integers, rationals, and decimal numbers with an eye towards application +to academic problem generation. Floating point arithmetic can be accomplished using +the \textsf{fp} package; \pkg{rangen} and \textsf{fp} seem to be compatible. + +\subsection{\texorpdfstring{\protect\cs{RandomZ}}{\CMD{RandomZ}}} + +The command \Com{RandomZ} defines a random integer, the syntax is + +\takeMeasure{\string\RandomZ[\meta{key-values}]\darg{\cs{\meta{name}}}\darg{\meta{zLEP}}\darg{\meta{zUEP}}} +\begin{dCmd*}[commandchars=!()]{\bxSize} +\RandomZ[!meta(key-values)]{!cs(!meta(name))}{!meta(zLEP)}{!meta(zUEP)} +\end{dCmd*} +\PD +\begin{description} +\item [\texttt{\meta{key-values}}] The key-value pairs that modify the choice of +the variable. The key-value pairs recognize are +\begin{description} + \item [\texttt{ne=\meta{value}}] Restrict the choice of the random integer by requiring + it \emph{not be equal} to another number, for example, \texttt{ne=0} or \texttt{ne=\cs{b}}. + In the latter case, \cs{b} is a number defined already by either an earlier + \cs{RandomZ} call, or by \Com{defineZ}, discussed later. Multiple restrictions can + be placed as well, for example, if \verb!ne={0,-1}!, \pkg{rangen} selects an integer + different from 0 or -1. +% \item \texttt{formatOne}: A Boolean formatting key for formatting the number 1; +% for example, instead of typesetting \texttt{1x} the correct syntax is to typeset \texttt{x}. +% To obtain this special formatting, you must use +% \cs{fmt} or \cs{ds}, for example \verb!\fmt\a!. Details are described below. +% \item \texttt{formatPMOne}: A Boolean formatting key for formatting the numbers 1 and -1; +% in addition to formatting of the number 1, if the random integer is -1 we want to +% typeset \texttt{-x} not \texttt{-1x}. To obtain this special formatting, you must use +% \cs{fmt} or \cs{ds}, for example \verb!\fmt\a!. Details are described below. +\end{description} +\item[\cs{\meta{name}}] The name of the random integer. For example, + \cs{a}, \cs{b}, etc. +\item [\meta{zLEP}] An integer that is the lower endpoint of the interval + from which the number is randomly selected. The lower endpoint may be + an integer previously calculated by an earlier \cs{RandomZ} call, for + example, \verb!\RandomZ{\b}{\a}{5}!, this will generate an integer + \cs{b} such that $\cs{a}\le\cs{b}\le5$. To get strict inequality, + append an asterisk (\texttt{*}), for example, if the syntax + \verb!\RandomZ{\b}{\a*}{5}! is used, then \pkg{rangen} attempts to + satisfy $\cs{a}<\cs{b}\le5$. The range of \cs{a} should be such that + the upper limit for \cs{a} is less than the upper limit of \cs{b}. When + the endpoint is a number, the \texttt{*} is ignored.\smallskip + + When the lower endpoint is a command created by the commands + \cs{Random\meta{\upshape{Z|Q|R|L}}} or by + \cs{define\meta{\upshape{Z|Q|R}}}, the endpoint is converted to a real + number. + +\item [\meta{zUEP}] An integer that is the upper endpoint of the interval + from which the number is randomly selected. The upper endpoint may be + an integer previously calculated by an earlier \cs{RandomZ} call, for + example, \verb!\RandomZ{\b}{-5}{\a}!, this will generate an integer + \cs{b} such that $-5\le\cs{b}\le\cs{a}$. To get strict inequality, use + the syntax $-5\le\cs{b}\le\cs{a}*$, then \pkg{rangen} attempts to + satisfy $-5\le\cs{b}<\cs{a}$. The range of \cs{a} should be such that + the lower limit for \cs{a} is greater than the lower limit of \cs{b}. + When the endpoint is a number, the \texttt{*} is ignored.\smallskip + + When the upper endpoint is a command created by the commands + \cs{Random\meta{\upshape{Z|Q|R|L}}} or by + \cs{define\meta{\upshape{Z|Q|R}}}, the endpoint is converted to a real + number. + +\end{description} + +\noindent +\textbf{Examples:} +\begin{enumerate} + \item \verb!\RandomZ{\a}{-5}{5}!: \RandomZ{\a}{-5}{5}\cs{a}=\a. To get another + random integer, we repeatedly execute \verb!\RandomZ{\a}{-5}{5}! followed by + \cs{a}, for example, we copy and paste \verb!\RandomZ{\a}{-5}{5}\a! three times to get + \RandomZ{\a}{-5}{5}\a, \RandomZ{\a}{-5}{5}\a, \RandomZ{\a}{-5}{5}\a. + + \item Illustrate \texttt{ne}: Consider + \verb!\RandomZ[ne={0,-1}]{\a}{-5}{5}\a!, copy and paste + repeatedly: \RandomZ[ne={0,-1}]{\a}{-5}{5}\a, + \RandomZ[ne={0,-1}]{\a}{-5}{5}\a, \RandomZ[ne={0,-1}]{\a}{-5}{5}\a, + \RandomZ[ne={0,-1}]{\a}{-5}{5}\a, and + \RandomZ[ne={0,-1}]{\a}{-5}{5}\a. If \pkg{rangen} worked as it + should, the list of five number should not contain a 0 or a -1, + does it? + \item Illustrate $\cs{a}\le\cs{b}$: We use the code +\begin{Verbatim} +\RandomZ{\a}{-5}{5}\RandomZ{\b}{\a}{10}$\a \le \b$ +\end{Verbatim} + We now copy and paste this code: \RandomZ{\a}{-5}{5}\RandomZ{\b}{\a}{10}$\a \le \b$, + \RandomZ{\a}{-5}{5}\RandomZ{\b}{\a}{10}$\a \le \b$. To get strict inequality we execute +\begin{Verbatim} +\RandomZ{\a}{-5}{5}\RandomZ{\b}{\a*}{10}$\a < \b$ +\end{Verbatim} + We now copy and paste this code: \RandomZ{\a}{-5}{5}\RandomZ{\b}{\a*}{10}$\a < \b$, + \RandomZ{\a}{-5}{5}\RandomZ{\b}{\a*}{10}$\a < \b$ +%\item\texttt{formatOne}: We execute the code +%\begin{Verbatim} +%\RandomZ[formatOne]{\a}{1}{3}$\fmt\a x$ +%\end{Verbatim} +% to get \RandomZ[formatOne]{\a}{1}{3}$\fmt\a x$, \RandomZ[formatOne]{\a}{1}{3}$\fmt\a x$, +% \RandomZ[formatOne]{\a}{1}{3}$\fmt\a x$, \RandomZ[formatOne]{\a}{1}{3}$\fmt\a x$. +% Notice the use of the command \cs{fmt}. When \cs{fmt} is present, the special formatting +% is used; there are times when you want the formatting, and other times when you don't it. For example, +% suppose we want \cs{a} to be a constant term, we want $ 1 + x $ not $\phantom{1}+x$, to get this +% we use create \cs{a} as before \verb!\RandomZ[formatOne]{\a}{1}{3}$\a+\fmt\a x$!, but do not use +% the \cs{fmt} on the first term. This gets us \RandomZ[formatOne]{\a}{1}{3}$\a+\fmt\a x$, +% \RandomZ[formatOne]{\a}{1}{3}$\a+\fmt\a x$, \RandomZ[formatOne]{\a}{1}{3}$\a+\fmt\a x$. +% +%\item\texttt{formatPMOne}: We execute the code +%\begin{Verbatim} +%\RandomZ[ne=0,formatPMOne]{\a}{-2}{2}$\fmt\a x$ +%\end{Verbatim} +%to obtain \RandomZ[ne=0,formatPMOne]{\a}{-2}{2}$\fmt\a x$, \RandomZ[ne=0,formatPMOne]{\a}{-2}{2}$\fmt\a x$, +%\RandomZ[ne=0,formatPMOne]{\a}{-2}{2}$\fmt\a x$, \RandomZ[ne=0,formatPMOne]{\a}{-2}{2}$\fmt\a x$. Let us hope +%we get a -1 in one of those generations. +\end{enumerate} + +\paragraph*{Data Type Properties.}\label{dtProperties}When a random number is created, there are several auxiliary commands that are defined. + +\takeMeasure{\string\nOf\darg{\cs{\meta{name}}}\quad\string\dOf\darg{\cs{\meta{name}}}} +\begin{dCmd*}[commandchars=!()]{\bxSize} +\nOf{!cs(!meta(name))}!quad\dOf{!cs(!meta(name))} +\fmt{!cs(!meta(name))}!quad\ds{!cs(!meta(name))} +\end{dCmd*} +\CmdDescription +\begin{description}\def\1{\hspace{-\labelsep}} + \item\1 \cs{nOf\darg{\cs{\meta{name}}}} is the numerator for the number + \cs{\meta{name}}. For an integer this is just \cs{\meta{name}}. This + function becomes important for rational numbers. If \cs{a} is the + rational number 2/3, then \verb!\nOf{\a}=2!. + + \item\1 \cs{dOf\darg{\cs{\meta{name}}}} is the denominator for the number + \cs{\meta{name}}. For an integer this is just \texttt{1}. This + function becomes important for rational numbers. If \cs{a} is the + rational number 2/3, then \verb!\dOf{\a}=3!. + + \item\1 \cs{fmt\darg{\cs{\meta{name}}}} allows for special formatting for + in-line numbers. Without one of the special formatting options, + \cs{fmt}\cs{a} is the same as \cs{a}. + + \item\1 \cs{ds\darg{\cs{\meta{name}}}} allows for special formatting for + display style number. \cs{ds} is relevant for rational numbers. If + \cs{a} represents the rational 1/2, the \cs{a} expanded is 1/2, while + \cs{ds}\cs{a} expanded is $\frac{1}{2}$. The \cs{ds} command also + obeys the formatting options. +\end{description} + + +\subsection{\texorpdfstring{\protect\cs{RandomQ}}{\CMD{RandomQ}}} + +The command \Com{RandomQ} defines a random rational, the syntax is + +\takeMeasure{\small\string\RandomQ[\meta{key-values}]\darg{\cs{\meta{name}}}% +[\meta{max\_denom}]\darg{\meta{qLEP}}\darg{\meta{qUEP}}} +\begin{dCmd*}[commandchars=!(),fontsize=\small]{\bxSize} +\RandomQ[!meta(key-values)]{!cs(!meta(name))}[!meta(max_denom)]{!meta(qLEP)}{!meta(qUEP)} +\end{dCmd*} +\PD +\begin{description}\def\1{\hspace{-\labelsep}} +\item [\meta{key-values}] The key-value pairs that modify the choice of +the variable. The key-value pairs recognize are +\begin{description} + \item [\texttt{ne=\meta{value}}] Restrict the choice of the random rational by requiring + it \emph{not be equal} to another number, for example, \texttt{ne=0} or \texttt{ne=\cs{b}}. + In the latter case, \cs{b} is a number defined already by either an earlier + \cs{RandomQ} call, or by \Com{defineQ}, discussed later. Multiple restrictions can + be placed as well, for example, if \verb!ne={0,-1}!, \pkg{rangen} selects an integer + different from 0 or -1. +% \item \texttt{formatOne}: A Boolean formatting key for formatting the number 1; +% for example, instead of typesetting \texttt{1x} the correct syntax is to typeset \texttt{x}. +% To obtain this special formatting, you must use +% \cs{fmt} or \cs{ds}, for example \verb!\fmt\a!. Details are described below. +% \item \texttt{formatPMOne}: A Boolean formatting key for formatting the numbers 1 and -1; +% in addition to formatting of the number 1, if the random integer is -1 we want to +% typeset \texttt{-x} not \texttt{-1x}. To obtain this special formatting, you must use +% \cs{fmt} or \cs{ds}, for example \verb!\fmt\a!. Details are described below. +\end{description} +\item\1\cs{\meta{name}} is the name of the random rational. For example, +\cs{a}, \cs{b}, etc. + +\item\1\meta{max\_denom} is the largest denominator you want your random + rational to have. For example, \verb!\RandomQ{\a}[9]{1/2}{7/2}!: The + value of \cs{a} is a rational number between 1/2 and 7/2 having a + maximum denominator of 9. If this parameter is not specified, the least + common denominator is used; for the example, that would be 2. To + contrast the two, consider the following examples: +\begin{enumerate} + \item \verb!\RandomQ{\a}[9]{1/2}{7/2}\a!: \RandomQ{\a}[9]{1/2}{7/2}\a, \RandomQ{\a}[9]{1/2}{7/2}\a, + \RandomQ{\a}[9]{1/2}{7/2}\a, and \RandomQ{\a}[9]{1/2}{7/2}\a. + \item \verb!\RandomQ{\a}{1/2}{7/2}\a!: \RandomQ{\a}{1/2}{7/2}\a, \RandomQ{\a}{1/2}{7/2}\a, + \RandomQ{\a}{1/2}{7/2}\a, \RandomQ{\a}{1/2}{7/2}\a. +\end{enumerate} +The fractions are reduced to lowest terms, and represented as an integer if needed. + +Here is more detail on the algorithm used to generate a rational: We illustrate +using the example, \verb!\RandomQ{\a}[9]{1/2}{7/2}!, the details are simplified slightly. +\begin{enumerate} + \item Convert the range so that the endpoints have a denominator of~9. +\begin{alignat*}{2} + &\texttt{LEP}: \frac{1}{2}= \frac{9/2}{9}=\frac{4.5}{9}< \frac{5}{9}&&\quad\text{round up} \\[1em] + &\texttt{UEP}: \frac{7}{2}= \frac{63/2}{9}=\frac{31.5}{9}>\frac{31}{9}&&\quad\text{round down} +\end{alignat*} +\item We randomly choose an integer between 5 and 31, call it \cs{z}; our random +rational is then \texttt{\cs{z}/9}, unless there is an \texttt{*} affixed to one of +both endpoints. +\item If one or both endpoints is itself a random rational (or integer) and the \texttt{*} +character is used, then the lower end of the range is incremented (from 5 to 6) and/or +the upper end is decremented (from 31 to 30). +\item Reduce the fraction obtained in the previous step. +\end{enumerate} + +You can see from this example, there are a lot of choices for the random +integer, there are 27 possibilities between 5 and 32. + +\item\1 \meta{qLEP} is a rational (of the form a/b) that is the lower + endpoint of the interval from which the number is randomly selected. + The lower endpoint may be a rational (or integer) previously calculated + by an earlier \cs{RandomQ} call, for example, + \verb!\RandomQ{\b}{\a}{4/3}!, this will generate an integer \cs{b} such + that $\cs{a}\le\cs{b}\le4/3$. To get strict inequality, use the syntax + \verb!\RandomZ{\b}{\a*}{4/3}!, then \pkg{rangen} attempts to satisfy + $\cs{a}<\cs{b}\le4/3$. The range of \cs{a} should be such that the + upper limit for \cs{a} is less than the upper limit of \cs{b}. When the + endpoint is a number, the \texttt{*} is ignored.\smallskip + + When the lower endpoint is a command created by any of the commands + \cs{Random\meta{\upshape{Z|Q|R|L}}} or \cs{define\meta{\upshape{Z|Q|R}}}, + the endpoint is converted to a real number. + +\item\1\meta{qUEP} is a rational that is the upper endpoint of the interval + from which the number is randomly selected. The upper endpoint may be a + rational (or integer) previously calculated by an earlier \cs{RandomQ} + call, for example, \verb!\RandomQ{\b}{-4/3}{\a}!, this will generate an + integer \cs{b} such that $-4/3\le\cs{b}\le\cs{a}$. To get strict + inequality, use the syntax $-4/3\le\cs{b}\le\cs{a}*$, then \pkg{rangen} + attempts to satisfy $-4/3\le\cs{b}<\cs{a}$. The range of \cs{a} should + be such that the lower limit for \cs{a} is greater than the lower limit + of \cs{b}. When the endpoint is a number, the \texttt{*} is + ignored.\smallskip + + When the upper endpoint is a command created by any of the commands + \cs{Random\meta{\upshape{Z|Q|R|L}}} or \cs{define\meta{\upshape{Z|Q|R}}}, + the endpoint is converted to a real number. +\end{description} + +\paragraph*{Examples} +\begin{enumerate} + \item \verb!\RandomZ{\a}{-5}{5}!: \RandomZ{\a}{-5}{5}\cs{a}=\a. To get + another random integer, we repeatedly execute + \verb!\RandomZ{\a}{-5}{5}! followed by \cs{a}, for example, we copy + and paste \verb!\RandomZ{\a}{-5}{5}\a! three times to get + \RandomZ{\a}{-5}{5}\a, \RandomZ{\a}{-5}{5}\a, + \RandomZ{\a}{-5}{5}\a. + + \item Illustrate \texttt{ne}: Copy and paste +\begin{Verbatim} +\RandomZ[ne={0,-1}]{\a}{-5}{5}\a +\end{Verbatim} + repeatedly to obtain: + \RandomZ[ne={0,-1}]{\a}{-5}{5}\a, \RandomZ[ne={0,-1}]{\a}{-5}{5}\a, + \RandomZ[ne={0,-1}]{\a}{-5}{5}\a, \RandomZ[ne={0,-1}]{\a}{-5}{5}\a, + and \RandomZ[ne={0,-1}]{\a}{-5}{5}\a. If \pkg{rangen} worked as it + should, the list of five number should not contain a 0 or a -1, + does it? + \item Illustrate $\cs{a}\le\cs{b}$: We use the code +\begin{Verbatim} +\RandomZ{\a}{-5}{5}\RandomZ{\b}{\a}{10}$\a \le \b$ +\end{Verbatim} + We now copy and paste this code: \RandomZ{\a}{-5}{5}\RandomZ{\b}{\a}{10}$\a \le \b$, + \RandomZ{\a}{-5}{5}\RandomZ{\b}{\a}{10}$\a \le \b$. To get strict inequality we execute +\begin{Verbatim} +\RandomZ{\a}{-5}{5}\RandomZ{\b}{\a*}{10}$\a < \b$ +\end{Verbatim} + We now copy and paste this code: + \RandomZ{\a}{-5}{5}\RandomZ{\b}{\a*}{10}$\a < \b$, + \RandomZ{\a}{-5}{5}\RandomZ{\b}{\a*}{10}$\a < \b$ +%\item\texttt{formatOne}: We execute the code +%\begin{Verbatim} +%\RandomZ[formatOne]{\a}{1}{3}$\fmt\a x$ +%\end{Verbatim} +% to get \RandomZ[formatOne]{\a}{1}{3}$\fmt\a x$, \RandomZ[formatOne]{\a}{1}{3}$\fmt\a x$, +% \RandomZ[formatOne]{\a}{1}{3}$\fmt\a x$, \RandomZ[formatOne]{\a}{1}{3}$\fmt\a x$. +% Notice the use of the command \cs{fmt}. When \cs{fmt} is present, the special formatting +% is used; there are times when you want the formatting, and other times when you don't it. For example, +% suppose we want \cs{a} to be a constant term, we want $ 1 + x $ not $\phantom{1}+x$, to get this +% we use create \cs{a} as before \verb!\RandomZ[formatOne]{\a}{1}{3}$\a+\fmt\a x$!, but do not use +% the \cs{fmt} on the first term. This gets us \RandomZ[formatOne]{\a}{1}{3}$\a+\fmt\a x$, +% \RandomZ[formatOne]{\a}{1}{3}$\a+\fmt\a x$, \RandomZ[formatOne]{\a}{1}{3}$\a+\fmt\a x$. +% +%\item\texttt{formatPMOne}: We execute the code +%\begin{Verbatim} +%\RandomZ[ne=0,formatPMOne]{\a}{-2}{2}$\fmt\a x$ +%\end{Verbatim} +%to obtain \RandomZ[ne=0,formatPMOne]{\a}{-2}{2}$\fmt\a x$, \RandomZ[ne=0,formatPMOne]{\a}{-2}{2}$\fmt\a x$, +%\RandomZ[ne=0,formatPMOne]{\a}{-2}{2}$\fmt\a x$, \RandomZ[ne=0,formatPMOne]{\a}{-2}{2}$\fmt\a x$. Let us hope +%we get a -1 in one of those generations. + + \item \verb!\RandomQ{\a}{-5/2}{5/2}!: \RandomQ{\a}{-5/2}{5/2}\cs{a}=\a. + We repeatedly copy and paste \verb!\RandomQ{\a}{-5/2}{5/2}\a! three + times to get \RandomQ{\a}{-5/2}{5/2}\a, \RandomQ{\a}{-5/2}{5/2}\a, + \RandomQ{\a}{-5/2}{5/2}\a. + + \item Illustrate \texttt{ne}: + \verb!\RandomQ[ne={0,-1}]{\a}{-5/2}{5/2}\a!, copy and paste this + code repeatedly: \RandomQ[ne={0,-1}]{\a}{-5/2}{5/2}\a, + \RandomQ[ne={0,-1}]{\a}{-5/2}{5/2}\a, + \RandomQ[ne={0,-1}]{\a}{-5/2}{5/2}\a, + \RandomQ[ne={0,-1}]{\a}{-5/2}{5/2}\a, and + \RandomQ[ne={0,-1}]{\a}{-5/2}{5/2}\a. If \pkg{rangen} worked as it + should, the list of five number should not contain a 0 or a -1, + does it? + + \item Illustrate $\cs{a}\le\cs{b}$: We use the code +\begin{Verbatim}[fontsize=\small] +\RandomQ{\a}{-5/2}{5/2}\RandomQ{\b}[4]{\a}{10}$\a \le \b$ +\end{Verbatim} + and copy and paste: \RandomQ{\a}{-5/2}{5/2}\RandomQ{\b}[4]{\a}{10}$\a \le \b$, + \RandomQ{\a}{-5/2}{5/2}\RandomQ{\b}[4]{\a}{10}$\a \le \b$. To get strict inequality we execute +\begin{Verbatim}[fontsize=\small] +\RandomQ{\a}{-5/2}{5/2}\RandomQ{\b}[4]{\a*}{10}$\a < \b$ +\end{Verbatim} + to get \RandomQ{\a}{-5/2}{5/2}\RandomQ{\b}[4]{\a*}{10}$\a < \b$, + \RandomQ{\a}{-5/2}{5/2}\RandomQ{\b}[4]{\a*}{10}$\a < \b$ +%\item\texttt{formatOne}: We execute the code +%\begin{Verbatim} +%\RandomQ[formatOne]{\a}{2/3}{4/3}$\ds\a x$ +%\end{Verbatim} +% to get \RandomQ[formatOne]{\a}{2/3}{4/3}$\ds\a x$, \RandomQ[formatOne]{\a}{2/3}{4/3}$\ds\a x$, +% \RandomQ[formatOne]{\a}{2/3}{4/3}$\ds\a x$, \RandomQ[formatOne]{\a}{2/3}{4/3}$\ds\a x$. +% Notice the use of the command \cs{ds}. When \cs{ds} is present, the special formatting +% is used; there are times when you want the formatting, and other times when you don't it. For example, +% suppose we want \cs{a} to be a constant term, we want $ 1 + x $ not $\phantom{1}+x$, to get this +% we use create \cs{a} as before\\[3pt] +% \verb!\RandomQ[formatOne]{\a}{2/3}{4/3}$\a+\ds\a x$!,\\[3pt] +% but do not use +% the \cs{ds} on the first term. This gets us \RandomQ[formatOne]{\a}{2/3}{4/3}$\a+\ds\a x$, +% \RandomQ[formatOne]{\a}{2/3}{4/3}$\a+\ds\a x$, \RandomQ[formatOne]{\a}{2/3}{4/3}$\a+\ds\a x$. +% +%\item\texttt{formatPMOne}: We execute the code +%\begin{Verbatim} +%\RandomQ[formatPMOne]{\a}{-6/5}{-4/5}$\ds\a x$ +%\end{Verbatim} +%to obtain \RandomQ[formatPMOne]{\a}{-6/5}{-4/5}$\ds\a x$, \RandomQ[formatPMOne]{\a}{-6/5}{-4/5}$\ds\a x$, +%\RandomQ[formatPMOne]{\a}{-6/5}{-4/5}$\ds\a x$, \RandomQ[formatPMOne]{\a}{-6/5}{-4/5}$\ds\a x$. Let us hope +%we get a -1 in one of those generations. +\end{enumerate} +For a rational number, the commands \cs{nOf}, \cs{dOf}, \cs{fmt}, and \cs{ds} are +also defined, see \Nameref{dtProperties}. + +\subsection{\texorpdfstring{\protect\cs{RandomR}}{\CMD{RandomR}}} + +The command \Com{RandomR} defines a random real number, the syntax is + +\takeMeasure{\string\RandomR[\meta{key-values}]\darg{\cs{\meta{name}}}% +\darg{\meta{rLEP}}\darg{\meta{rUEP}}} +\begin{dCmd*}[commandchars=!()]{\bxSize} +\RandomR[!meta(key-values)]{!cs(!meta(name))}{!meta(rLEP)}{!meta(rUEP)} +\end{dCmd*} +\PD +\begin{description}\def\1{\hspace{-\labelsep}} +\item [\meta{key-values}] The key-value pairs that modify the choice of +the variable. The key-value pairs recognize are +\begin{description} + \item [\texttt{round=\meta{value}}] Round the generated real number so + that number of decimal places equals the \meta{value}, the value of + the \texttt{round} key; for example, \texttt{round=2} rounds the + result to 2 decimal places. + + \item [\texttt{showzeros=\meta{\upshape{true|false}}}] Show trailing + zeros, only valid when the \texttt{round} key is used. For example, + \texttt{round=4,showzeros} might yield a result of 3.2300, whereas + without the \texttt{showzeros} key (or with + \texttt{showzeros=false}), the same result would be 3.23. + + \item [\texttt{ne=\meta{value}}] Restrict the choice of the random real + by requiring it \emph{not be equal} to another number real, for + example, \texttt{ne=-1} or \texttt{ne=\cs{b}}. In the latter case, + \cs{b} is a number defined already by either an earlier + \cs{RandomR} call, or by \Com{defineR}, discussed later. Multiple + restrictions can be placed as well, for example, if + \verb!ne={0,-1}!, \pkg{rangen} selects an integer different from 0 + or -1.\smallskip + + Note, comparisons are made \emph{after} rounding. + +\end{description} + +\item\1\cs{\meta{name}} is the name of the random rational. For example, +\cs{a}, \cs{b}, etc. + +\item\1 \meta{rLEP} is a real number (or integer) that is the lower + endpoint of the interval from which the number is randomly selected. + The lower endpoint may be a number previously calculated by an earlier + \cs{RandomR} call, for example, \verb!\RandomR{\b}{\a}{1.3}!, this will + generate an integer \cs{b} such that $\cs{a}\le\cs{b}\le1.3$. To get + strict inequality, use the syntax \verb!\RandomZ{\b}{\a*}{1.3}!, then + \pkg{rangen} attempts to satisfy $\cs{a}<\cs{b}\le4/3$. The range of + \cs{a} should be such that the upper limit for \cs{a} is less than the + upper limit of \cs{b}. When the endpoint is a number, the \texttt{*} is + ignored.\smallskip + + When the lower endpoint is a command created by ant if the command + \cs{Random\meta{\upshape{Z|Q|R|L}}}, or by + \cs{define\meta{\upshape{Z|Q|R}}}, the endpoint is converted to a real + number. + +\item\1 \meta{rUEP} is a real number that is the upper endpoint of the + interval from which the number is randomly selected. The upper endpoint + may be a number previously calculated by an earlier \cs{RandomR} call, + for example, \verb!\RandomR{\b}{-1.3}{\a}!, this will generate an + integer \cs{b} such that $-1.3\le\cs{b}\le\cs{a}$. To get strict + inequality, use the syntax $-1.3\le\cs{b}\le\cs{a}*$, then \pkg{rangen} + attempts to satisfy $-1.3\le\cs{b}<\cs{a}$. The range of \cs{a} should + be such that the lower limit for \cs{a} is greater than the lower limit + of \cs{b}. When the endpoint is a number, the \texttt{*} is + ignored.\smallskip + + When the upper endpoint is a command created by ant if the command + \cs{Random\meta{\upshape{Z|Q|R|L}}}, or by + \cs{define\meta{\upshape{Z|Q|R}}}, the endpoint is converted to a real + number. +\end{description} +The \cs{RandomR} command divides range ($\meta{rUEP}-\meta{rLEP}$) into equal +sub-intervals, and randomly chooses node (an endpoint of one of the +sub-intervals). The number of subdivisions is determined by +\cs{RNGpowerOfTen}, and can be set by \cs{nDivisionsPowerOfTen}. This latter +command takes an integer argument, $n$, $1\le n\le 4$, the number of +subdivisions is then $10^n$. Strictly speaking \cs{RNGpowerOfTen} does not +have to be a power of 10, you can make the definition +\verb!\def\RNGpowerOfTen{16}!, and that should work as well. The default is +\verb!\nDivisionsPowerOfTen{2}!, that is, divide the range into 100 equal +subdivisions. + +\paragraph*{Examples:} + +\begin{enumerate} + \item \verb!\RandomR{\a}{-2.3}{2.3}!: \RandomR{\a}{-2.3}{2.3}\cs{a}=\a. + To obtain more random real numbers, repeatedly execute + \verb!\RandomR{\a}{-2.3}{2.3}! followed by \cs{a}; for example, + \verb!\RandomR{\a}{-2.3}{2.3}\a! repeated three times yields the following: +\begin{equation*} + \RandomR{\a}{-2.3}{2.3}\a,\ \RandomR{\a}{-2.3}{2.3}\a,\ \RandomR{\a}{-2.3}{2.3}\a +\end{equation*} + + \item \texttt{round}: We use \verb!\RandomR[round=4]{\a}{-2}{2}\a! to get +\begin{equation*} + \RandomR[round=4]{\a}{-2}{2}\a,\ \RandomR[round=4]{\a}{-2}{2}\a,\ + \RandomR[round=4]{\a}{-2}{2}\a +\end{equation*} + + \item \texttt{showzeros}: \verb!\RandomR[round=4,showzeros]{\a}{-2}{2}\a!: +\begin{equation*} + \RandomR[round=4,showzeros]{\a}{-2}{2}\a,\ \RandomR[round=4,showzeros]{\a}{-2}{2}\a,\ + \RandomR[round=4,showzeros]{\a}{-2}{2}\a,\ \RandomR[round=4,showzeros]{\a}{-2}{2}\a,\ + \RandomR[round=4,showzeros]{\a}{-2}{2}\a +\end{equation*} + + \item Illustrate $\cs{a}\le\cs{b}$: We use the code +\begin{Verbatim} +\RandomR{\a}{-5}{5}\RandomR{\b}{\a}{10}$\a \le \b$ +\end{Verbatim} + We now copy and paste this code twice: +\begin{equation*} + \RandomR{\a}{-5}{5}\RandomR{\b}{\a}{10}\a \le \b,\ + \RandomR{\a}{-5}{5}\RandomR{\b}{\a}{10}\a \le \b +\end{equation*} +To get strict inequality we execute +\begin{Verbatim} +\RandomR{\a}{-5}{5}\RandomR{\b}{\a*}{10}$\a < \b$ +\end{Verbatim} + We now copy and paste this code a couple of times: +\begin{equation*} + \RandomR{\a}{-5}{5}\RandomR{\b}{\a*}{10} \a < \b,\ + \RandomR{\a}{-5}{5}\RandomR{\b}{\a*}{10} \a < \b +\end{equation*} +For real numbers, there is little chance the two values are equal, but just in case, strict +inequality may be specified in this way. +\end{enumerate} + +\subsection{\texorpdfstring{\protect\cs{RandomL}}{\CMD{RandomL}}} + +The command \Com{RandomL} defines a list of numbers (integer, rational, decimal), +and randomly selects a number from the list. + +\takeMeasure{\string\RandomR[\meta{key-values}]\darg{\cs{\meta{name}}}% +\darg{\meta{n\SUB{1},n\SUB{2},n\SUB{3},...}}}% +\begin{dCmd*}[commandchars=!()]{\bxSize} +\RandomL[!meta(key-values)]{!cs(!meta(name))}{!meta(n!SUB(1),n!SUB(2),n!SUB(3),...)} +\end{dCmd*} + +\PD +\begin{description}\def\1{\hspace{-\labelsep}} +\item [\texttt{\meta{key-values}}] The only key-value pairs recognized is + \texttt{index=\meta{posZ}}. The index is a base-1 index, thus \texttt{index=1} + references the first number in the list. + + The \texttt{index} key can be used to retrieve a particular number from + this list; for example, declaring + \verb!\RandomL[index=2]{\a}{17,1/2,1.3}!, the value of \cs{a} is 1/2. + + The value of \texttt{index} can be any positive integer, even one generated + using \cs{RandomI}. If the value of \texttt{index} is greater than the + number of items in the list, modular arithmetic is performed to put the + index back into the proper range. + + When the \texttt{index} key is not present, a number is randomly selected + from the list. + +\item\1\cs{\meta{name}} is the name of the number generated. The number + generated will be defined as integer, rational, or real; consequently + \cs{nOf}, \cs{dOf}, \cs{fmt}, and \cs{ds} are defined. + +\item \meta{n\SUB{1},n\SUB{2},n\SUB{3},...} A (possibly mixed) list of + numbers. The numbers can be literal (12, 1.2, 3/4), or control + sequences of numbers (commands) defined earlier by \cs{Random\meta{\upshape{Z|Q|R|L}}} + or by \cs{define\meta{\upshape{Z|Q|R}}}. +\end{description} + +\paragraph*{Examples} + +\begin{enumerate} + \item After declaring \verb!\RandomL{\a}{17,3.14,88,3/4,1/2}!, the value + of \cs{a} is \RandomL{\a}{17,3.14,88,3/4,1/2}\texttt{\cs{a} = \a}, + Select a number from this list at random + \RandomL{\a}{17,3.14,88,3/4,1/2}\texttt{\string\a=\a}, again + \RandomL{\a}{17,3.14,88,3/4,1/2}\texttt{\string\a=\a}, and again + \RandomL{\a}{17,3.14,88,3/4,1/2}\texttt{\string\a=\a}. + \item \verb!\RandomL[index=3]{\a}{17,3.14,88,3/4,1/2}\a!, + \RandomL[index=3]{\a}{17,3.14,88,3/4,1/2}\texttt{\string\a=\a}. +\end{enumerate} + +\subsection{\texorpdfstring{\protect\cs{RandomI}}{\CMD{RandomI}}} + +The command \Com{RandomI} defines a list of integers, \verb!{1,2,3...n}! +and randomly selects an integer, thought of as an index value, from the list. + +\takeMeasure{\string\RandomI\darg{\cs{\meta{name}}}\darg{\meta{n}}}% +\begin{dCmd*}[commandchars=!()]{\bxSize} +\RandomI{!cs(!meta(name))}{!meta(n)} +\end{dCmd*} +\PD +\begin{description}\def\1{\hspace{-\labelsep}} + +\item\1\cs{\meta{name}} is the name of the number generated, the number +will be defined as an integer number. + +\item\1 \meta{n} is a positive number greater than 1. The list + \verb!{1,2,3...n}! is implicitly created. +\end{description} + +\paragraph*{Example:} \verb!\RandomI{\indx}{20}\indx! yields \RandomI{\indx}{20}\indx, +\RandomI{\indx}{20}\indx, \RandomI{\indx}{20}\indx, \RandomI{\indx}{20}\indx, when copied +and pasted four times. + +\newtopic\noindent +My thought in creating \cs{RandomI} is to use it in conjunction with +\cs{RandomL} (using the \texttt{index} key). For example, +\begin{Verbatim} + \RandomI{\indx}{4} + \RandomL[index=\indx]{\a}{1/2,1/3,1/4,1/5} + \RandomL[index=\indx]{\b}{5/3,6/5,7/2,5/6} +\begin{equation*} + (\a)+(\b) = +\end{equation*} +\end{Verbatim} + + \RandomI{\indx}{4} + \RandomL[index=\indx]{\a}{1/2,1/3,1/4,1/5} + \RandomL[index=\indx]{\b}{5/3,6/5,7/2,5/6} + +\noindent +This code results in the following arithmetic problem: +\begin{equation*} + (\a)+(\b) = +\end{equation*} +This is probably not a good example of the usage of \cs{RandomI}. See the next section +on \cs{RandomP}. + +\subsection{\texorpdfstring{\protect\cs{RandomP}}{\CMD{RandomP}}} + +The command \Com{RandomP} defines a list of strings (literal expressions), +and randomly selects one from the list. (The ``P'' in \cs{RandomP} stands +for ``Problem.'') + +\takeMeasure{\string\RandomP[\meta{key-values}]\darg{\cs{\meta{name}}}\darg{\meta{list of literals}}}% +\begin{dCmd*}[commandchars=!()]{\bxSize} +\RandomP[!meta(key-values)]{!cs(!meta(name))}{!meta(list of literals)} +\end{dCmd*} + +\PD +\begin{description}\def\1{\hspace{-\labelsep}} + +\item [\texttt{\meta{key-values}}] The only key-value pairs recognized is + \texttt{index=\meta{posZ}}. The index is a base-1 index, thus index=1 + references the first number in the list. + + The \texttt{index} key can be used to retrieve a particular literal from + this list; for example, by executing \verb!\RandomP[index=2]{\a}{d,p,s}!, + the value of \cs{a} is \texttt{p}. + + The value of \texttt{index} can be any positive integer, even one generated + using \cs{RandomI}, or by another list. If the value of \texttt{index} is + greater than the number of items in the list, modular arithmetic is + performed to put the index back into the proper range. + + When the \texttt{index} key is not present, a number is randomly selected + from the list. + +\item\1\cs{\meta{name}} is the name of the literal generated. + +\item\1\meta{list of literals} is a comma-delimited list of literal + strings, selected literal is not interpreted as a number, but is passed + into the definition of \cs{\meta{name}}. +\end{description} + +\paragraph*{Examples} + +\begin{enumerate} + \item Executing \verb!\RandomP{\a}{1+16,\cos(\pi),%!\\ + \verb! \frac{d}{dx}\frac{1}{2}x^2,{\int \cos(x)\,dx}}!\\ + \verb!$\texttt{\string\a} = \a$!, we get + \RandomP[index=5]{\a}{1+16,\cos(\pi),\frac{d}{dx}\frac{1}{2}x^2}% + $\texttt{\string\a} = \a $, and then again, + \RandomP{\a}{1+16,\cos(\pi),\frac{d}{dx}\frac{1}{2}x^2}% + $ \texttt{\string\a} = \a $. + \item Use \cs{RandomI} with \cs{RandomP}. You can create a series + of questions and answers using these two: +\begin{Verbatim}[fontsize=\small] +\RandomI{\indx}{5} +\RandomP[index=\indx]{\q}{1+16,\cos(\pi),\pi\sin(\pi),% + \frac{d}{dx}\frac{1}{2}x^2,{\int \cos(x)\,dx}} +\RandomP[index=\indx]{\a}{17,-1,0,x,\sin(x)+C} +\begin{equation*} + \q = \a +\end{equation*} +\end{Verbatim} + +\RandomI{\indx}{5} +%\typeout{index=\iOf{\indx}}% +\RandomP[index=\indx]{\q}{1+16,\cos(\pi),\pi\sin(\pi),\frac{d}{dx}\frac{1}{2}x^2,{\int \cos(x)\,dx}} +\RandomP[index=\indx]{\a}{17,-1,0,x,\sin(x)+C} + +The execution of these lines becomes +\begin{equation*} + \q = \a +\end{equation*} +You can create a switch to include the answer or not. + +\item There is an alternate approach to this previous example. +Random lists (\cs{RandomL} and \cs{RandomP}) define a macro \cs{iOf}, +the value of which is the index of the item selected (at random). +We can use \cs{iOf} in the above problem as follows: +\begin{Verbatim}[fontsize=\small] +\RandomP{\q}{1+16,\cos(\pi),\pi\sin(\pi),% + \displaystyle\frac{d}{dx}\frac{1}{2}x^2,% + {\int \cos(x)\,dx}} +\RandomP[index=\iOf{\q}]{\a}{17,-1,0,x,\sin(x)+C} +\begin{equation*} + \q = \a +\end{equation*} +\end{Verbatim} +The execution of these lines gives the output\dots +\RandomP{\q}{1+16,\cos(\pi),\pi\sin(\pi),% + \displaystyle\frac{d}{dx}\frac{1}{2}x^2,{\int \cos(x)\,dx}} +\RandomP[index=\iOf{\q}]{\a}{17,-1,0,x,\sin(x)+C} +\begin{equation*} + \q = \a +\end{equation*} +Here, we select the answer to the randomly chosen question. +\end{enumerate} + +\subsection{\texorpdfstring{\protect\cs{RandomS}}{\CMD{RandomS}}} + +The command \cs{RandomS} generates a random sign, either \texttt{+} +or \texttt{-}. This may be useful for creating addition/subtraction +problems. + +\takeMeasure{\string\RandomS[\meta{dec}]\darg{\cs{\meta{name}}}}% +\begin{dCmd*}[commandchars=!()]{\bxSize} +\RandomS[!meta(dec)]{!cs(!meta(name))} +\end{dCmd*} + +\PD +\begin{description}\def\1{\hspace{-\labelsep}} + +\item\1\meta{dec} is a number between 0 and 1. This command generates a + \texttt{+} sign with probability \meta{dec}. The default value is + 0.5. + +\item\1\cs{\meta{name}} is the name that references the generated random sign. + +\end{description} + +\paragraph*{Examples} + +\begin{enumerate} + \item Random addition problem: +\begin{Verbatim} +\RandomZ{\a}{1}{20}\RandomZ{\b}{1}{20}\RandomS{\s} +\begin{equation*} + \a \s \b +\end{equation*} +\end{Verbatim} + +\RandomZ{\a}{1}{20}\RandomZ{\b}{1}{20}\RandomS{\s} + +This code expands to +\begin{equation*} + \a \s \b +\end{equation*} +Whether we add or subtract the summands is determined by the command \cs{s}. + +\item Random Differentiation problem: +\begin{Verbatim} +\RandomQ{\a}[8]{1}{2}\RandomQ{\b}[8]{2}{3} +\RandomZ{\n}{1}{6}\RandomS{\si}\RandomS{\sii} + +Differentiate +\begin{equation*} + \frac{d}{dx}(\bigl (\a) \si (\b) x^{\sii\n}\bigr) +\end{equation*} +\end{Verbatim} + +\RandomQ{\a}[8]{1}{2}\RandomQ{\b}[8]{2}{3} +\RandomZ{\n}{1}{6}\RandomS{\si}\RandomS{\sii} + +Differentiate +\begin{equation*} + \frac{d}{dx}\bigl( (\a) \si (\b) x^{\sii\n}\bigr) +\end{equation*} +\end{enumerate} + +\subsection{Commands that Operate on Numbers} + +Associated with each data type (integer, rational, and real) are several +useful commands \cs{nOf}, \cs{dOf}, \cs{iOf}, \cs{fmt}, and \cs{ds}. + +\subsubsection{\texorpdfstring{\protect\cs{nOf} and \protect\cs{dOf}}{\CMD{nOf} and \CMD{dOf}}} + +For integer, rational, and real numbers \cs{nOf} and \cs{dOf} are +the numerator and denominator, respectively. +\begin{itemize} + \item Integer: \cs{nOf} is the integer, and \cs{dOf} is 1; for example, + define an integer by \verb!\RandomZ{\a}{-5}{5}!,\RandomZ{\a}{-5}{5} \cs{a}=\a, + \verb!\nOf{\a}!=\nOf{\a}, \verb!\dOf{\a}!=\dOf{\a}, as advertised. + + \item Rational: \cs{nOf} is the numerator (an integer), and \cs{dOf} is the + denominator (an integer) of the reduced fraction. For example, define \cs{a} by + \verb!\RandomQ[ne=0]{\a}[9]{-3/2}{3/2}!,\RandomQ[ne=0]{\a}[9]{-3/2}{3/2} then + \begin{equation*} + \cs{a}=\a,\ \verb!\nOf{\a}!=\nOf{\a},\ \text{and}\ \verb!\dOf{\a}!=\dOf{\a}. + \end{equation*} + \item Real: \cs{nOf} is the numerator (an integer), and \cs{dOf} is the + denominator (an integer) of the reduced fraction, after the real is converted + into a rational number. For example, \verb!\RandomR{\a}{.25}{.75}!,\RandomR{\a}{.25}{.75} + then + \begin{equation*} + \cs{a}=\a,\ \verb!\nOf{\a}!=\nOf{\a},\ \text{and}\ \verb!\dOf{\a}!=\dOf{\a} + \end{equation*} + If we round using with \verb!\RandomR[round=2]{\a}{.25}{.75}!, we get + \begin{equation*} + \RandomR[round=2]{\a}{.25}{.75}\cs{a}=\a,\ \verb!\nOf{\a}!=\nOf{\a},\ \text{and}\ \verb!\dOf{\a}!=\dOf{\a} + \end{equation*} +% \cs{a}=\a, \verb!\nOf{\a}!=\nOf{\a}, and \verb!\dOf{\a}!=\dOf{\a} +\end{itemize} + + +\subsubsection{Special Formatting Commands: The \texorpdfstring{\protect\cs{ds}}{\CMD{ds}} +and \texorpdfstring{\protect\cs{fmt}}{\CMD{fmt}} families} + +When a RV, such as \cs{a}, is a rational number type, say \cs{a}=1/3, the command \cs{a} expands +to 1/3. To get a display style formatting of the rational use the \Com{ds} command. +The expansion of \texttt{\$\cs{ds}\cs{a}\$} is $\frac13$. + +We have seen in several examples in which the formatting was not always what we'd like. +Expressions like $x^{1}$ should be $x$, $1x$ should be $x$, $-1x$ should be $-x$. +The formatting commands \cs{cfmt} and \cs{efmt} (and their display style counterparts +\cs{cds} and \cs{eds}) attempt to format the special cases of 1 and -1, as they appear +in an exponent (the `e' variations) and as they appear as a coefficient (the `c' variations). + +All the formatting commands \cs{cfmt}, \cs{efmt}, \cs{ds}, \cs{cds}, and +\cs{eds} take a RV as its argument. +\cs{\meta{\upshape{c|e}}fmt}|\cs{\meta{\upshape{c|e}}ds}\cs{a} expands to +\cs{a} when \cs{a} is not 1 or -1. These cases are covered below. + +\begin{itemize} + \item For \cs{a}=1, + \cs{cfmt}\cs{a}=\cs{efmt}\cs{a}=\cs{cds}\cs{a}=\cs{eds}\cs{a}=\darg{}, + the empty string. Thus, \defineZ{\a}{1}if \cs{a}=\a, and we typeset + \verb!$\a x^{\a}$!, we get $\a x^{\a}$, which is not the standard + way of writing this expression, but if we typeset \verb!$\cfmt\a x^{\efmt\a}$! we get $\cfmt\a x^{\efmt\a}$, which is correct. + Notice that we used \cs{cfmt} on the baseline, and \cs{efmt} in the + exponent. It does not make any difference here, but it does if + \cs{a}=-1, see the next bullet point. + + \item \cs{a}=-1, then + \begin{align*} + &\cs{cfmt}\cs{a}=\cs{cds}\cs{a}=\texttt{-}\quad\text{(minus sign)}\\ + &\cs{efmt}\cs{a}=\cs{eds}\cs{a}=\texttt{-1}\quad\text{(minus one)} + \end{align*} + Returning to the same expression in the previous bullet, if + \defineZ{\a}{-1}\cs{a}=\a, and we typeset + \verb!$\a x^{\a}$!, we get $\a x^{\a}$, which is not the standard way + of writing this expression, but, on the other hand, if we typeset + \verb!$\cfmt\ax^{\efmt\a}$! we get $\cfmt\a x^{\efmt\a}$, which is correct. Notice + the difference cases if I had typeset \verb!$\cfmt\a x^{\cfmt\a}$!, I + would have gotten $\cfmt\a x^{\cfmt\a}$, not good. + + The `c'-variation is used for unitary signs, not binary signs. For example, + \defineZ{\a}{-1}, if \cs{a}=\a, and we typeset \verb!$2 + \cfmt\a x$!, we get + $2 + \cfmt\a x$, which may be fine is some situations, but most of the time + it is not. As a work around, make coefficients positive, and generate a random sign + using \cs{RandomS}; for example, after declaring +\begin{Verbatim} +\RandomS{\s}\RandomZ{\a}{1}{3} +\end{Verbatim} + and typeseting \verb!$2 \s \cfmt\a x$!, we get an addition half the + time and subtraction the other half: \RandomS{\s}\RandomZ{\a}{1}{3}$2 + \s \cfmt\a x$, \RandomS{\s}\RandomZ{\a}{1}{3}$2 \s \cfmt\a x$, + \RandomS{\s}\RandomZ{\a}{1}{3}$2 \s \cfmt\a x$, + \RandomS{\s}\RandomZ{\a}{1}{3}$2 \s \cfmt\a x$, + \RandomS{\s}\RandomZ{\a}{1}{3}$2 \s \cfmt\a x$, + \RandomS{\s}\RandomZ{\a}{1}{3}$2 \s \cfmt\a x$. + + Similarly, the `e'-variation is for unitary sign in the exponent, and + should be used when there is a need for these special format rules. + + \item Random Sign: The formatting commands are defined for a random sign + created by \cs{RandomS} and following the same definitions outline + above. These are of marginal value in this context. +% \item[] \verb!\RandomL{\a}{-1,1}\RandomS{\s}$\a \s x^{\efmt\s x}$! yields the +% expression \RandomL{\a}{-1,1}\RandomS{\s}$\a \s e^{\efmt\a x}$ +\end{itemize} + +\subsubsection{Getting the Data type with \texorpdfstring{\protect\cs{typeOf}}{\CMD{typeOf}}} + +There may be occasions where you want to know the data type of a RV. The \pkg{rangen} +does change the data type in special cases. For example, if \cs{a} is created by +\verb~\cs{RandomQ}{\a}[2]{1}{3}~, and its value happens to be an integer, \pkg{rangen} +changes its type of integer. You can determine the type of a RV with the \cs{typeOf} +command, which takes a RV as its argument, the value of \cs{typeOf} is a nonnegative integer. The following table gives +the values of \cs{typeOf}, and associated data types. +\begin{flushleft} +\hspace{\amtIndent}\begin{tabular}{lc} +Data type & \cs{typeOf}\\\hline +Integer & 0 \\ +Rational & 1 \\ +Real & 2 \\ +Literal & 3 +\end{tabular} +\end{flushleft} + +\paragraph*{A suggested application to \cs{typeOf}.} Suppose, \cs{a} is a rational RV +(for example, \verb!\RandomQ{\a}[2]{1}{3}!), and we want to typeset the +expression \verb!$\cfmt\a x$!. One instance might be +\defineQ{\a}{3}{2}$\cfmt\a x$, this is not good syntax; so we typeset +\verb!$(\cfmt\a) x$! to get $(\cfmt\a) x$, that's good. But if \cs{a} is an +integer, such as 1, 2, or 3, we get \defineQ{\a}{2}{1}$(\cfmt\a) x$, which +contains redundant parentheses. Now we come to the use of \cs{typeof}. We now +typeset the expression +\begin{Verbatim} +$ \ifnum\typeOf\a=0\relax\cfmt\a\else(\cfmt\a)\fi x $ +\end{Verbatim} +If \cs{a} is \emph{not an integer} we get, \defineQ{\a}{3}{2}for \cs{a}=\a, we obtain +$\ifnum\typeOf\a=0\relax\cfmt\a\else(\cfmt\a)\fi x$, but for +\defineQ{\a}{2}{1}for \cs{a}=\a, we get +$\ifnum\typeOf\a=0\relax\cfmt\a\else(\cfmt\a)\fi x$. + +\subsection{\texorpdfstring{\protect\cs{defineZ}}{\CMD{defineZ}}, +\texorpdfstring{\protect\cs{defineQ}}{\CMD{defineQ}}, and +\texorpdfstring{\protect\cs{defineR}}{\CMD{defineR}}} + +The \pkg{rangen} package internally uses \cs{defineZ}, \cs{defineQ}, +and \cs{defineR} to define an integer, a rational number, and a real (decimal) number. +These command may be used by the document author as well to create non-random variables. + +\takeMeasure{\string\defineQ\darg{\cs{\meta{name}}}\darg{\meta{zNumer}}\darg{\meta{zDenom}}}% +\begin{dCmd*}[commandchars=!()]{\bxSize} +\defineZ{!cs(!meta(name))}{!meta(zValue)} +\defineQ{!cs(!meta(name))}{!meta(zNumer)}{!meta(zDenom)} +\defineR{!cs(!meta(name))}{!meta(rValue)} +\end{dCmd*} +Thus, \verb!\defineZ{\a}{17}!\defineZ{\a}{17} defines \cs{a}=\a, \verb!\defineQ{\a}{-3}{2}! +\defineQ{\a}{-3}{2} defines \cs{a}=\a, and \verb!\defineR{\a}{17.88}!\defineR{\a}{17.88} defines +\cs{a}=\a. + +The various properties data types are created by \cs{defineZ}, \cs{defineQ}, +and \cs{defineR}; these are \cs{nOf}, \cs{dOf}, \cs{typeOf}, \cs{ds}, \cs{eds}, +\cs{cds}, \cs{efmt}, and \cs{cfmt}. + +\newtopic\noindent +The following are other important points to remember. +\begin{itemize} +\item \textbf{Positive Denominators.} Notice that if \verb!\defineQ{\a}{3}{-2}!,\defineQ{\a}{3}{-2} then \cs{a}=\a, and +\cs{nOf}\cs{a}=\nOf\a, and \cs{dOf}\cs{a}=\dOf\a. Thus, \pkg{rangen} does not allow a +negative denominator. + +\item \textbf{Automatic Reduction.} If we declare + \verb!\defineQ{\a}{6}{4}!,\defineQ{\a}{6}{4} then \cs{a}=\a, a rational + number is automatically reduced to lowest terms. + +\item \textbf{Re-classification.} If we make the definition \verb!\defineQ{\a}{6}{2}!,\defineQ{\a}{6}{2} then \cs{a}={\a} is reduced +to lowest terms and re-classified as an integer \cs{typeOf}\cs{a}=\typeOf\a~(an integer). +\end{itemize} + +\section{\textsf{rangen} and \textsf{fp}} + +After a little bit of testing, it appears that \textsf{fp} can work with the \texttt{rangen} package. +The \texttt{rangen} package does not provide any command for combining RVs using such operations +as addition, subtraction, multiplication, division, etc. + +The \texttt{rangen} package package does provide several useful commands that \textsf{fp} does not, +these are \cs{reduceFrac}, \cs{gcd}, and \cs{lcm}. + +\Com{reduceFrac} takes two arguments (numerator and denominator), both integers, and attempts to reduce the implied fraction +to lowest terms, and returns the result in two macros \cs{rfNumer} and \cs{rfDenom}. For example, +to reduce the fraction $4/12$, we execute \verb!\reduceFrac{4}{12}!, which returns\reduceFrac{4}{12} \cs{rfNumer}=\rfNumer, and +\cs{rfDenom}=\rfDenom, forming the reduced fraction $\rfNumer/\rfDenom$; thus, +$4/12 = \rfNumer/\rfDenom$. + +The \emph{greatest common divisor} command \cs{gcd} takes two integers as its arguments +and returns its result in the macro \cs{thegcd}. For example, the \verb!\gcd{4,8}! is +\gcd{4}{8}\thegcd, while the \verb!\gcd{4}{6}! is \gcd{4}{6}\thegcd. + +The \emph{least common multiple} command \cs{lcd} takes two integers as its arguments, +and returns its result in the macro \cs{thelcd}. For example, \verb!\lcm{4}{5}! is +\lcm{4}{5}\cs{thelcm}=\thelcm, while, \verb!\lcm{4}{6}! is \lcm{4}{6}\cs{thelcm}=\thelcm. + +The following example illustrates the use of the \texttt{rangen} and \texttt{fp} packages to pose a random +arithmetic problem, and present a detailed solution. +\begin{Verbatim}[fontsize=\footnotesize] +\RandomQ{\a}[6]{2}{4}\RandomQ{\b}[6]{2}{4} +\gcd{\dOf\a}{\dOf\b} +\FPeval\lcd{clip((\dOf\a)*(\dOf\b)/\thegcd)} +\FPeval\si{clip(\lcd/(\dOf\a))} +\FPeval\sii{clip(\lcd/(\dOf\b))} +\FPeval\finalnum{clip((\si)*(\nOf\a)+(\sii)*(\nOf\b))} +\defineQ{\ans}{\finalnum}{\lcd} +$$ + \ds\a \thisop \ds\b = \frac{(\si)(\nOf\a)+(\sii)(\nOf\b)}{\lcd} + = \frac{\finalnum}{\lcd}\ifnum\lcd=\dOf\ans\else =\ds\ans\fi +$$ +\end{Verbatim} +An instance of this code might look like this: +$$ + \frac{8}{3}+\frac{17}{6}=\frac{(2)(8)+(1)(17)}{6}=\frac{33}{6}=\frac{11}{2} +$$ +If there is any reduction of the fraction (brought on by the \cs{defineQ} command), +this additional expression is included. + +\paragraph*{Demo file.} +See the demo file \texttt{rangen\_fp.tex} for a complete example. + +\section{\textsf{rangen} and \textsf{exerquiz}} + +Developing a package for randomly generating numbers that could be +used as a basis for creating random quizzes (see the example back in +\hyperref[s:intro]{Section~\ref*{s:intro}}, page~\pageref*{s:intro}) +was my original motivation for writing the original package back in +the year 2000 AD. In this section, we introduce the techniques that +I've developed for creating random quizzes, and, more importantly, +how to grade them and to exhibit to the user the correct answer. +This system is not a computer algebra system, so, it is difficult, +but not impossible to also supply a solution (a opposed to just the +answer) to the problem as well. + +\paragraph*{Demo file.} Now, let's see how its done! Examples of this section were taken from the +demo file \texttt{rangen\_tst.tex}. + +\subsection{Creating Quizzes using \textsf{rangen}} + + +The \pkg{rangen} package provides three JavaScript functions that are used with \textsf{exerquiz} +quizzes, these are +\begin{itemize} + \item \texttt{rEval(str)}: The function \texttt{rEval} evaluates its + argument. The \texttt{rEval} function searches its argument for + \texttt{rEval} and \texttt{rFrac}, and executes any inner nested + functions first. + \item \texttt{rFrac(str)}: Evaluates a rational number by evaluating + the value of the numerator and denominator separately. The function + \texttt{rFrac} searches its argument for \texttt{rEval} and + \texttt{rFrac}, and executes any inner nested functions first. + \item \texttt{rngCorrAnsButton}: A function that is used to represent + the correct answer to the user. +\end{itemize} +The best way of illustrating these function is by discussing an example or two. + +\renewcommand\titleQuizfmt{\bfseries\color{red}} +\titleQuiz*{Example~1. } +\begin{shortquiz}*[sq1] We create two RVs, \cs{a} and \cs{b} that are rational numbers. We want to +add them, and present the answer as a rational number. +\begin{Verbatim}[fontsize=\small] +\RandomQ{\a}[16]{1/8}{15/16}\RandomQ[ne=\a]{\b}[16]{1/8}{15/16} +\end{Verbatim} +\begin{questions} +\RandomQ{\a}[16]{1/8}{15/16}\RandomQ[ne=\a]{\b}[16]{1/8}{15/16} + +\item $\displaystyle\ds\a - \ds\b = + \RespBoxMath[\rectW{.5in}]{ (\nOf\a * \dOf\b - \nOf\b * \dOf\a )/( \dOf\a * \dOf\b ) }{2}{.0001}{[0,2]}[{priorParse: \Array(nodec,NoAddOrSub)}]$\hfill + \CorrAnsButton{rFrac( rEval( \nOf\a * \dOf\b - \nOf\b * \dOf\a )/rEval( \dOf\a * \dOf\b ) )}*{rngCorrAnsButton}\kern1bp\sqClearButton +\end{questions} +\end{shortquiz} +\vskip-.5\baselineskip +The question is posed using \cs{RespBoxMath}. +\begin{Verbatim}[xleftmargin=20pt,numbers=left,fontsize=\small] +$\displaystyle\ds\a - \ds\b = +\RespBoxMath[\rectW{.5in}]{ + (\nOf\a*\dOf\b-\nOf\b*\dOf\a)/(\dOf\a*\dOf\b)} + {2}{.0001}{[0,2]} + [{priorParse: \Array(nodec,NoAddOrSub)}]$ +\end{Verbatim} +\textsf{Exerquiz} determines whether the user's answer is correct, it by evaluating +the author's answer at randomly selected points. Exerquiz uses the floating point arithmetic +of JavaScript to evaluate the user's answer. The author's correct answer is given +in line (1), and it is just the formula for combining two fractions \cs{a} and \cs{b}; +note the use of \cs{nOf} and \cs{dOf}. Line~(2) is standard parameters for \cs{RespBoxMath}, +the number of random points to use, the precision, and the interval from which to select the +points. Line~(3) specifies a couple of routines from the \textsf{dljslib} package, these +prevent the user from using decimals and rational arithmetic to answer the question. (The latter +function would, for example, prevent the user from copying the question and pasting it into the +answer.) + +Now comes the most interesting part, at least to me: The presentation of the correct +answer to the user. These is where the JavaScript functions \texttt{rEval} and \texttt{rFrac} are used. +The code for the answer button is shown below. +\begin{Verbatim}[xleftmargin=20pt,numbers=left,fontsize=\small] +\CorrAnsButton{rFrac( + rEval(\nOf\a*\dOf\b-\nOf\b*\dOf\a)/rEval(\dOf\a*\dOf\b) +)}*{rngCorrAnsButton} +\end{Verbatim} +Here, this code is broken across several lines to fit on the page. We direct the \cs{CorrAnsButton} +to use the function \texttt{rngCorrAnsButton}, as seen in line~(3). This is a special function +define by \pkg{rangen} to help in the presentation of the answer to the user. + +Keep in mind, the inner-most \texttt{rEval} and \texttt{rFrac} +functions are evaluated first; consequently, the two \texttt{rEval} +functions in line~(2) are evaluated first. These two evaluations +calculate the numerator and denominator separately, this results in +a numerical numerator and denominator. The function \texttt{rFrac} +is then executed on the resulting rational number, this function +reduces the fraction to lowers terms. This final calculation is what +the user sees when the correct answer button is pressed. + +The next example will illustrate a decimal presentation of the answer, and introduces +a new command, \Com{RNGprintf}. + +\titleQuiz*{Example~2. } +\begin{shortquiz}*[sq2] We create four RVs, \cs{a}, \cs{b}, \cs{c}, and \cs{n}, three rational and one integer. +The exponent of the power is rational, hence, we represent a decimal answer to the user. +\begin{Verbatim}[fontsize=\small] +\RandomQ{\a}[8]{1/4}{7/6}\RandomZ{\b}{1}{3} +\RandomQ{\n}[8]{1/2}{3/2}\RandomZ[ne=\zZero]{\c}{-3}{3} +\end{Verbatim} +\begin{questions}\setcounter{eqquestionnoi}{1} +\RandomQ{\a}[8]{1/4}{7/6} +\RandomZ{\b}{1}{3} +\RandomQ{\n}[8]{1/2}{3/2} +\RandomZ[ne=\zZero]{\c}{-3}{3} + +\item $\displaystyle\int_{\a}^{\b} \cfmt\c x^{\efmt\n}\,dx = + \RespBoxMath{\c((\b)^(\n+1)-(\a)^(\n+1))/(\n+1)}{3}{.0001}{[0,2]}$\hfill + \CorrAnsButton{rEval(\c((\b)^(\n+1)-(\a)^(\n+1))/(\n+1))}*{rngCorrAnsButton\RNGprintf{\%.4f}}\kern1bp\sqClearButton +\end{questions} +\end{shortquiz} +\vskip-.5\baselineskip +The question is posed using \cs{RespBoxMath}. +\begin{Verbatim}[xleftmargin=20pt,numbers=left,fontsize=\small] +$\displaystyle\int_{\a}^{\b} \cfmt\c x^{\efmt\n}\,dx = + \RespBoxMath{\c((\b)^(\n+1)-(\a)^(\n+1))/(\n+1)} + {3}{.0001}{[0,2]}$ +\end{Verbatim} +The correct answer is given on line~(2), and is based on the known form of the integrand; here, +we use standard integration formulas. + +The code for the correct answer button has a new element in it +\begin{Verbatim}[xleftmargin=20pt,numbers=left,fontsize=\small] +\CorrAnsButton{rEval( + \c((\b)^(\n+1)-(\a)^(\n+1))/(\n+1) +)}*{rngCorrAnsButton\RNGprintf{\%.4f}}}\kern1bp\sqTallyBox +\end{Verbatim} +The \texttt{rEval} function evaluates the expression on line~(2), the result +is a decimal number. As before, we use the \texttt{rngCorrAnsButton}, but we've +added the \Com{RNGprintf} command to the end of the function name. This is a kludge +that I've developed to be able to format a numerical answer. The \cs{RNGprintf} command +uses the Acrobat JavaScript function \texttt{util.printf}. The argument of \cs{RNGprintf} +is passed to \texttt{util.printf} as its formatting string. Here, we use +\verb!\%.4f!, so the number is presented as a floating point number with four decimal places. +See the documentation of \texttt{util.printf} in the \textsl{JavaScript for Acrobat API Reference.}\footnote +{\url{{http://livedocs.adobe.com/acrobat_sdk/9/Acrobat9_HTMLHelp}}} + + +The final example it the one seen in \Nameref{s:intro}, it uses another new command, +\Com{defineDepQJS}. This command is used to define a new RV as a rational function of other RVs, +and to define special JavaScript formatting, \cs{js}. The results of this command are used +exclusively for JavaScript, and are not meant to be typeset. + +\takeMeasure{\string\defineDepQJS\darg{\cs{\meta{name}}}% +\darg{\meta{numer}}\darg{\meta{denom}}\darg{\meta{script}}}% +\begin{dCmd*}[commandchars=!()]{\bxSize} +\defineDepQJS{!cs(!meta(name))}{!meta(numer)}{!meta(denom)}{!meta(script)} +\end{dCmd*} +\noindent This function defines \cs{\meta{name}} to be +\texttt{(\meta{numer})/(\meta{denom})}. The expression \meta{numer} and +\meta{denom} can be functions of RV defined earlier. The $4^{\text{th}}$ +argument is JavaScript for evaluating \cs{\meta{name}}; \meta{script} is +accessed by \cs{js\cs{\meta{name}}} and is used from within a +\cs{CorrAnsButton}. The $4^{\text{th}}$ argument can include such +commands as \cs{\meta{name}}, \cs{nOf}\cs{\meta{name}}, and +\cs{dOf}\cs{\meta{name}}. An example will perhaps illustrate. + +\titleQuiz*{Example~3. } +\begin{shortquiz}*[sq3] Find the equation of the line that passes through $P$ and $Q$. + +We begin by defining our variables: +\begin{Verbatim}[xleftmargin=20pt,numbers=left,fontsize=\small] +\RandomZ{\a}{-10}{9}\RandomZ{\b}{-10}{9} +\RandomZ{\c}{\a*}{10}\RandomZ{\d}{\b*}{10} +\defineDepQJS{\m}{\d - \b}{\c - \a} + {rFrac(rEval(\nOf\m)/rEval(\dOf\m))} +\defineDepQJS{\yIntercept}{\b - \a*\m}{1} + {rFrac((rEval(\b*\dOf\m-\a*\nOf\m))/(rEval(\dOf\m)))} +\end{Verbatim} +Our big problem is to compute the slope of the line, \cs{m}. I define \cs{m} +as using \cs{defineDepQJS}. The numerator and denominator are those in the +slope calculation, given two points. The expansion of \cs{m} is +\verb!(\d-\b)/(\c-\a)!, and the JavaScript will perform the arithmetic +operations. The expression that is accessed with the \cs{js} is the fourth +argument, line~(4); here, we calculate slope as a rational number. We make a +similar definition for the \cs{yIntercept} of the line. + +Below are the two points \verb!$P(\a, \b)$! and \verb!$Q(\c, \d)$!. +\begin{questions}\setcounter{eqquestionnoi}{2} +\RandomZ{\a}{-10}{9}\RandomZ{\b}{-10}{9} +\RandomZ{\c}{\a*}{10}\RandomZ{\d}{\b*}{10} +\defineDepQJS{\m}{\d - \b}{\c - \a}{rFrac(rEval(\nOf\m)/rEval(\dOf\m))} +\defineDepQJS{\yIntercept}{\b - \a*\m}{1}{rFrac((rEval( \b * \dOf\m - \a*\nOf\m ))/(rEval(\dOf\m)))} + +\item $P(\,\a, \b\,)$, $Q(\,\c, \d\,)$: + \RespBoxMath{y = \m*x + \yIntercept}(xy){3}{.0001}{[0,2]x[0,2]}*{ProcRespEq}\hfill + \CorrAnsButton{y = \js\m\space x + \js\yIntercept}*{rngCorrAnsButton}% + \kern1bp\sqClearButton +\end{questions} +\end{shortquiz} +\vskip-.5\baselineskip +The question is posed using \cs{RespBoxMath}. +\begin{Verbatim}[xleftmargin=20pt,numbers=left,fontsize=\small] +$P(\,\a, \b\,)$, $Q(\,\c, \d\,)$: + \RespBoxMath{y=\m*x + \yIntercept}(xy) + {3}{.0001}{[0,2]x[0,2]}*{ProcRespEq} +\end{Verbatim} +The answer is given in line~(2), and will be evaluated numerically, and compared numerically +with the user's response. + +The code for the correct answer button has a new element in it +\begin{Verbatim}[xleftmargin=20pt,numbers=left,fontsize=\small] +\CorrAnsButton{y = \js\m\space x + \js\yIntercept} + *{rngCorrAnsButton} +\end{Verbatim} +The display of the answer is done using \cs{js}\cs{m} and +\cs{js}\cs{yIntercept} to represent the slope and intercept as a rational +number. + +Think of \cs{defineDepQJS} a convenient way of defining (JavaScript) expressions +that will appear in \cs{RespBoxMath} and for \cs{CorrAnsButton}. + +\subsection{Creating Solutions to Random Quizzes} + +Writing a solution to a question that is based on a formula or template can be difficult. +{\LaTeX} is not a computer algebra system, so the possibilities are limited. Still, +\pkg{rangen} supplies the \texttt{writeRVsTo} environment to support a solution. + +\titleQuiz*{Example~4. } +\begin{shortquiz}*[sq1] We create two RVs, \cs{a} and \cs{b} that are rational numbers. We want to +add them, and present the answer as a rational number. +\begin{Verbatim}[fontsize=\small] +\begin{writeRVsTo}{quizzes} +\RandomQ{\a}[16]{1/8}{15/16}\RandomQ[ne=\a]{\b}[16]{1/8}{15/16} +\end{writeRVsTo} +\end{Verbatim} +We make that same definitions as in \textbf{\textcolor{red}{Example~1}}, but we enclose +these definitions within the \texttt{writeRVsTo}. This environment writes its contents +to the quiz solutions file, and also executes its contents. This way, the definitions are +make both here, and just before the solution to this problem in the solutions file. +\begin{questions}\setcounter{eqquestionnoi}{3} +\begin{writeRVsTo}{quizzes} +\RandomQ{\a}[16]{1/8}{15/16}\RandomQ[ne=\a]{\b}[16]{1/8}{15/16} +\end{writeRVsTo} + +\item $\displaystyle\ds\a + \ds\b = + \RespBoxMath[\rectW{.5in}]{ (\nOf\a * \dOf\b + \nOf\b * \dOf\a )/( \dOf\a * \dOf\b ) }*{2}{.0001}{[0,2]}[{priorParse: \Array(nodec,NoAddOrSub)}]$\hfill + \CorrAnsButton{rFrac( rEval( \nOf\a * \dOf\b + \nOf\b * \dOf\a )/rEval( \dOf\a * \dOf\b ) )}*{rngCorrAnsButton}\kern1bp\sqClearButton +\begin{solution}\relax\RNGadd\a\b\defineQ{\ans}{\rfNumer}{\rfDenom}% +The solution to this problem is +\begin{equation*} + \boxed{\ds\a + \ds\b = \ds\ans} +\end{equation*} +Did I forget to tell you that a simple command \cs{RNGadd} for adding two rational numbers +is defined by \pkg{rangen}. Sorry about that! \dps +\end{solution} +\end{questions} +\end{shortquiz} +\vskip-.5\baselineskip +The verbatim listing of this quiz is +\begin{Verbatim}[fontsize=\footnotesize] +\item $\displaystyle\ds\a + \ds\b = +\RespBoxMath[\rectW{.5in}]{ + (\nOf\a*\dOf\b+\nOf\b*\dOf\a)/(\dOf\a*\dOf\b)}*{2} + {.0001}{[0,2]}[{priorParse: \Array(nodec,NoAddOrSub)}]$\hfill +\CorrAnsButton{rFrac(rEval( + \nOf\a * \dOf\b + \nOf\b * \dOf\a)/rEval(\dOf\a * \dOf\b)) +}*{rngCorrAnsButton}\kern1bp\sqClearButton +\begin{solution}\relax\RNGadd\a\b\defineQ{\ans}{\rfNumer}{\rfDenom}% +The solution to this problem is +\begin{equation*} + \boxed{\ds\a - \ds\b = \ds\ans} +\end{equation*} +Did I forget to tell you that a simple command \cs{RNGadd} +for adding two rational numbers is defined by +\pkg{rangen}. Sorry about that! \dps +\end{solution} +\end{Verbatim} + +\newtopic\noindent +The \texttt{writeRVsTo} has the following syntax + +\takeMeasure{\string\begin\darg{writeRVsTo}\darg{quizzes|exercises}}% +\begin{dCmd*}[commandchars=!()]{\bxSize} +\begin{writeRVsTo}{quizzes|exercises} + !meta(rangen commands creating RVs) +\end{writeRVsTo} +\end{dCmd*} +The argument can be either the string \texttt{quizzes} or \texttt{exercises}. In the first case, +the content of the environment is written to the solutions file for quizzes, and in the latter case, +to the solutions file for the exercises. + +\bigskip + +That's all for now, I simply must get back to my retirement. \dps + +\end{document} diff --git a/texmf-dist/doc/latex/rangen/rangen_tst.tex b/texmf-dist/doc/latex/rangen/rangen_tst.tex new file mode 100644 index 00000000..c89a5964 --- /dev/null +++ b/texmf-dist/doc/latex/rangen/rangen_tst.tex @@ -0,0 +1,280 @@ +\documentclass{article} +\usepackage[fleqn]{amsmath} +\usepackage[tight,designiii,usesf]{web} +\usepackage{exerquiz} +\usepackage[equations,ImplMulti,indefIntegral,limitArith,nodec]{dljslib} +\usepackage[quiet,testmode]{rangen} + +\title{Experiments in Creating Random Problems} +\author{D. P. Story} +\subject{Test file for the rangen Package} +\keywords{LaTeX, rangen, quizzes, random} + +\university{NORTHWEST FLORIDA STATE COLLEGE\\ + Department of Mathematics} +\email{dpstory@acrotex.net} +\version{1.0} + +%\nocopyright +\norevisionLabel +\makeatletter +\def\eq@textFont{/TiRo} +\makeatother + +\everyTextField{\BG{1 1 1}} +\everyCheckBox{\BG{1 1 1}} +\everyRespBoxMath{\rectW{1.9in}\textSize{0}} +\everyRespBoxTxt{\rectW{1.9in}\textSize{0}} + +\newcommand{\cs}[1]{\texttt{\char`\\#1}} + +\renewcommand\nodecAlertMsg{% + "A decimal answer is not acceptable here. + Please express your answer using a fraction."} +\newenvironment{eqComments}[1][\strut]{\smallskip\leftskip-\labelwidth +\item[]\textbf{\textcolor{blue}{#1}}}{\par\smallskip} + +\begin{document} + +\maketitle + +\begin{shortquiz}*[sq] Answer each of the following. Passing is 100\%. + +\begin{questions} + +\begin{eqComments}[Arithmetic]\end{eqComments} + +%% addition +\RandomQ{\a}[9]{1/8}{6/7}\RandomQ{\b}[8]{1/16}{15/16} + +\item $\displaystyle \ds\a + \ds\b = + \RespBoxMath{ (\nOf\a * \dOf\b + \nOf\b * \dOf\a )/( \dOf\a * \dOf\b ) }{2}{.0001}{[0,2]}[{priorParse: \Array(nodec,NoAddOrSub)}]$\hfill + \CorrAnsButton{rFrac( rEval( \nOf\a * \dOf\b + \nOf\b * \dOf\a )/rEval( \dOf\a * \dOf\b ))}*{rngCorrAnsButton}\kern1bp\sqTallyBox + +% subtraction +\RandomQ{\a}[16]{1/16}{15/16}\RandomQ[ne=\a]{\b}[16]{1/8}{15/16} + +\item $\displaystyle \ds\a - \ds\b = + \RespBoxMath{ (\nOf\a * \dOf\b - \nOf\b * \dOf\a )/( \dOf\a * \dOf\b ) }{2}{.0001}{[0,2]}[{priorParse: \Array(nodec,NoAddOrSub)}]$\hfill + \CorrAnsButton{rFrac( rEval( \nOf\a * \dOf\b - \nOf\b * \dOf\a )/rEval( \dOf\a * \dOf\b ) )}*{rngCorrAnsButton}\kern1bp\sqTallyBox + +% subtraction +\RandomQ{\a}[16]{1/8}{15/16}\RandomQ[ne=\a]{\b}[16]{1/8}{15/16} + +\item $\displaystyle \ds\a - \ds\b = + \RespBoxMath{ (\nOf\a * \dOf\b - \nOf\b * \dOf\a )/( \dOf\a * \dOf\b ) }{2}{.0001}{[0,2]}[{priorParse: \Array(nodec,NoAddOrSub)}]$\hfill + \CorrAnsButton{rFrac( rEval( \nOf\a * \dOf\b - \nOf\b * \dOf\a )/rEval( \dOf\a * \dOf\b ) )}*{rngCorrAnsButton}\kern1bp\sqTallyBox + +\begin{eqComments} +This next problem illustrates the use of \cs{RandomL} and \cs{RansomAS}. The summands are +determined from a list of rational numbers. Addition or subtraction of the summands is determined +by \cs{RandomAS}. +\end{eqComments} + +%% Random add/subtr using RandomL and RandomAS +\RandomL{\a}{1/2,2/3,5/3,2/5,6/5}\RandomL{\b}{4/3,3/4,8/7,3/2}\RandomS{\as} + +\item $\displaystyle \ds\a \as \ds\b = + \RespBoxMath{ (\nOf\a * \dOf\b \as \nOf\b * \dOf\a )/( \dOf\a * \dOf\b ) }{2}{.0001}{[0,2]}[{priorParse: \Array(nodec,NoAddOrSub)}]$\hfill + \CorrAnsButton{rFrac( rEval( \nOf\a * \dOf\b \as \nOf\b * \dOf\a )/rEval( \dOf\a * \dOf\b ) )}*{rngCorrAnsButton}\kern1bp\sqTallyBox + + +\begin{eqComments} +This next example illustrates how you can create a solution to a problem. This is a simple +addition problem using the built-in command \cs{qAdd}. Solutions to more advanced problems +might be obtained using the \textsf{fp} package. +\end{eqComments} + +\begin{writeRVsTo}{quizzes} +\RandomQ{\a}[9]{1/8}{6/7}\RandomQ{\b}[7]{1/16}{15/16} +\end{writeRVsTo} + +%% addition +\item $\displaystyle \ds\a + \ds\b = + \RespBoxMath{ (\nOf\a * \dOf\b + \nOf\b * \dOf\a )/( \dOf\a * \dOf\b ) }*{2}{.0001}{[0,2]}[{priorParse: \Array(nodec,NoAddOrSub)}]$\hfill + \CorrAnsButton{rFrac( rEval( \nOf\a * \dOf\b + \nOf\b * \dOf\a )/rEval( \dOf\a * \dOf\b ) )}*{rngCorrAnsButton}\kern1bp\sqTallyBox + +\begin{solution}\relax\RNGadd\a\b\defineQ{\ans}{\rfNumer}{\rfDenom}% +The solution to this problem is +\begin{equation*} + \boxed{\ds\a + \ds\b = \ds\ans} +\end{equation*} +\end{solution} + + +\newpage +\begin{eqComments}[Definite Integrals]\end{eqComments} + +\RandomQ{\a}[8]{1/4}{7/6} +\RandomZ{\b}{1}{3} +\RandomQ{\n}[8]{1/2}{3/2} +\RandomZ[ne=0]{\c}{-3}{3} + +\item $\displaystyle\int_{\a}^{\b} \cfmt\c x^{\efmt\n}\,dx = + \RespBoxMath{\c((\b)^(\n+1)-(\a)^(\n+1))/(\n+1)}{3}{.0001}{[0,2]}$\hfill + \CorrAnsButton{rEval(\c((\b)^(\n+1)-(\a)^(\n+1))/(\n+1))}*{rngCorrAnsButton}\kern1bp\sqTallyBox + + +\RandomQ{\a}{1/6}{2/9} +\RandomZ{\b}{1}{10} +\RandomQ[ne={0,-1}]{\n}[5]{-1}{1} +\RandomZ[ne=0]{\c}{-3}{3} + +\item $\displaystyle\int_{\a}^{\b} \cfmt\c x^{\efmt\n}\,dx = + \RespBoxMath{\c((\b)^(\n+1)-(\a)^(\n+1))/(\n+1)}{3}{.0001}{[0,2]}$\hfill + \CorrAnsButton{rEval(\c((\b)^(\n+1)-(\a)^(\n+1))/(\n+1))}*{rngCorrAnsButton}\kern1bp\sqTallyBox + +\RandomZ{\a}{1}{6} +\RandomZ{\b}{\a*}{8} +\RandomZ{\n}{1}{5} +\RandomZ[ne=0]{\c}{-3}{3} + +\item $\displaystyle\int_{\a}^{\b} \cfmt\c x^{\efmt\n}\,dx = + \RespBoxMath{\c((\b)^(\n+1)-(\a)^(\n+1))/(\n+1)}{3}{.0001}{[0,2]}$\hfill + \CorrAnsButton{rFrac(rEval(\c ( (\b)^(\n+1)-(\a)^(\n+1)))/rEval(\n+1))}*{rngCorrAnsButton}\kern1bp\sqTallyBox + +\RandomZ{\a}{1}{5} +\RandomZ{\b}{\a*}{10} +\RandomQ[ne={0,-1}]{\n}{-3}{2/3} +\RandomZ[ne=0]{\c}{-3}{3} + +\item $\displaystyle\int_{\a}^{\b} \cfmt\c x^{\efmt\n}\,dx = + \RespBoxMath{\c((\b)^(\n+1)-(\a)^(\n+1))/(\n+1)}{3}{.0001}{[0,2]}$\hfill + \CorrAnsButton{rEval(\c((\b)^(\n+1)-(\a)^(\n+1))/(\n+1))}*{rngCorrAnsButton}\kern1bp\sqTallyBox + +\RandomQ{\a}{1/4}{2/3} +\RandomQ{\b}{\a*}{7/6} +\RandomQ[ne={0,-1}]{\n}{-3}{2/3} +\RandomZ[ne=0]{\c}{-3}{3} + +\item $\displaystyle\int_{\a}^{\b} \cfmt\c x^{\efmt\n}\,dx = + \RespBoxMath{\c((\b)^(\n+1)-(\a)^(\n+1))/(\n+1)}{3}{.0001}{[0,2]}$\hfill + \CorrAnsButton{rEval(\c((\b)^(\n+1)-(\a)^(\n+1))/(\n+1))}*{rngCorrAnsButton}\kern1bp\sqTallyBox + +\begin{eqComments} +This next problem was created from random lists of values using \cs{RandomL}. +\end{eqComments} + +\RandomL{\c}{1/6,1/4,1/6,1/2} +\RandomL{\a}{1,2,3,4,5,6} +\ifnum\a=1 + \def\strAns{sin(PI/\dOf\c)} +\else + \def\strAns{(1/\a)(sin(\a*PI/\dOf\c))} +\fi + +\item $\displaystyle\int_0^{\pi/\dOf\c} \cos(\cfmt\a x) \,dx = + \RespBoxMath{(1/\a)(sin(\a*PI/\dOf\c))}{3}{.0001}{[0,2]}$\hfill + \CorrAnsButton{rEval(\strAns)}*{rngCorrAnsButton\RNGprintf{\%.4f}}\kern1bp\sqTallyBox + + +\newpage +\begin{eqComments}[Indefinite Integration]\end{eqComments} + +\RandomQ{\a}{1/6}{3/2} +\RandomQ{\b}{1/6}{3/2} +\RandomZ{\c}{1}{3} + +\item $\displaystyle\int \cds\a x^2 + \ds\b x + \c\,dx = + \RespBoxMath{(\a/3)x^3+(\b/2) x^2 + \c x}{3}{.0001}{[0,2]}$\hfill + \CorrAnsButton{(rFrac(rEval(\nOf\a)/rEval(3*\dOf\a))) x^3 + + (rFrac(rEval(\nOf\b)/rEval(2*\dOf\b))) x^2 + + \c x + C}*{rngCorrAnsButton}\kern1bp\sqTallyBox + +\RandomQ{\a}{1/3}{3} +\RandomQ{\b}{1/6}{3/2} +\RandomZ{\c}{1}{3} + +\item $\displaystyle\int \cds\a x^2 + \ds\b x + \c\,dx = + \RespBoxMath{(\a/3)x^3+(\b/2) x^2 + \c x}{3}{.0001}{[0,2]}$\hfill + \CorrAnsButton{(rFrac(rEval(\nOf\a)/rEval(3*\dOf\a))) x^3 + + (rFrac(rEval(\nOf\b)/rEval(2*\dOf\b))) x^2 + + \c x + C}*{rngCorrAnsButton}\kern1bp\sqTallyBox + +\newpage +\begin{eqComments}[Differentiation]\end{eqComments} + +\RandomQ[ne=0]{\c}[4]{-2}{2} +\RandomQ[ne=0]{\n}[1]{-3}{2} + +\item $\displaystyle \frac{d}{dx} \cds\c x^{\efmt\n} = + \ifnum\nOf\n=\dOf\n + \RespBoxMath{\c}{3}{.0001}{[0,2]}$\hfill + \CorrAnsButton{rFrac(\nOf\c/\dOf\c)}*{rngCorrAnsButton}% + \else + \RespBoxMath{\c*\n*x^(\n-1)}{3}{.0001}{[0,2]}$\hfill + \CorrAnsButton{rFrac(rEval(\nOf\c*\nOf\n)/rEval(\dOf\c*\dOf\n)) + x^(rFrac(rEval(\nOf\n-\dOf\n)/\dOf\n))}*{rngCorrAnsButton}% + \fi + \kern1bp\sqTallyBox + +\begin{eqComments} +This next problem uses a random sign, defined by \cs{RandomS}. +\end{eqComments} + +\RandomQ{\c}[4]{2}{3}\RandomS{\s} +\RandomQ[ne=0]{\n}[2]{-3}{2} + +\item $\displaystyle \frac{d}{dx} \cfmt\s\ds\c x^{\efmt\n} = + \ifnum\nOf\n=\dOf\n + \RespBoxMath{\s\c}{3}{.0001}{[0,2]}$\hfill + \CorrAnsButton{\s\nOf\c/\dOf\c}*{rngCorrAnsButton}% + \else + \RespBoxMath{\s\c*\n*x^(\n-1)}{3}{.0001}{[0,2]}$\hfill + \CorrAnsButton{rFrac(rEval(\s\nOf\c*\nOf\n)/rEval(\dOf\c*\dOf\n)) + x^(rFrac(rEval(\nOf\n-\dOf\n)/\dOf\n))}*{rngCorrAnsButton}% + \fi + \kern1bp\sqTallyBox + + +\RandomQ[ne=0]{\c}[4]{-2}{5} +\RandomQ{\n}[4]{2}{5} + +\item $\displaystyle \frac{d}{dx} \ds\c x^{\efmt\n} = + \ifnum\nOf\n=\dOf\n + \RespBoxMath{\c}{3}{.0001}{[0,2]}$\hfill + \CorrAnsButton{\nOf\c/\dOf\c}*{rngCorrAnsButton}% + \else + \RespBoxMath{\c*\n*x^(\n-1)}{3}{.0001}{[0,2]}$\hfill + \CorrAnsButton{rFrac(rEval(\nOf\c*\nOf\n)/rEval(\dOf\c*\dOf\n)) + x^(rFrac(rEval(\nOf\n-\dOf\n)/\dOf\n))}*{rngCorrAnsButton}% + \fi + \kern1bp\sqTallyBox + +\newpage + +\begin{eqComments}[Analytic Geometry]\end{eqComments} + +\RandomZ{\a}{-10}{9} +\RandomZ{\b}{-10}{9} +\RandomZ{\c}{\a*}{10} +\RandomZ{\d}{\b*}{10} +\defineDepQJS{\m}{\d - \b}{\c - \a}{rFrac(rEval(\nOf\m)/rEval(\dOf\m))} +\defineDepQJS{\yIntercept}{\b - \a*\m}{1}{rFrac((rEval( \b * \dOf\m - \a*\nOf\m ))/(rEval(\dOf\m)))} + + +\item Let $P(\,\a, \b\,)$ be a point and $Q(\,\c, \d\,)$ be a point. Find the equation of the line that + passes through $P$ and $Q$.\par\kern3pt + \RespBoxMath{y = \m*x + \yIntercept }(xy){3}{.0001}{[0,2]x[0,2]}*{ProcRespEq}\hfill + \CorrAnsButton{y = \js\m\space x + \js\yIntercept}*{rngCorrAnsButton}% + \kern1bp\sqTallyBox + +\RandomZ{\a}{-10}{9} +\RandomZ{\b}{-10}{9} +\RandomZ{\c}{\a*}{10} +\RandomZ{\d}{\b*}{10} +\defineDepQJS{\m}{\d - \b}{\c - \a}{rFrac(rEval(\nOf\m)/rEval(\dOf\m))} +\defineDepQJS{\yIntercept}{\b - \a*\m}{1}{rFrac((rEval( \b * \dOf\m - \a*\nOf\m ))/(rEval(\dOf\m)))} + +\item Let $P(\,\a, \b\,)$ be a point and $Q(\,\c, \d\,)$ be a point. Find the equation of the line that + passes through $P$ and $Q$.\par\kern3pt + \RespBoxMath{y = \m*x + (\b - \a*\m) }(xy){3}{.0001}{[0,2]x[0,2]}*{ProcRespEq}\hfill + \CorrAnsButton{y = \js\m\space x + \js\yIntercept}*{rngCorrAnsButton}% + \kern1bp\sqTallyBox + +\end{questions} +\end{shortquiz} +\begin{flushright} +\sqClearButton\kern1bp\sqTallyTotal +\end{flushright} +\end{document} diff --git a/texmf-dist/doc/latex/renditions/README b/texmf-dist/doc/latex/renditions/README new file mode 100644 index 00000000..c6830289 --- /dev/null +++ b/texmf-dist/doc/latex/renditions/README @@ -0,0 +1,22 @@ +The renditions package +Dated: 02/05/10 + +Using the renditions package, you can create many versions, or renditions, of content from the same source file. + +This is a short package sets up comment environments, called renditions. These renditions can be included or excluded according to the value of the rendition option. The basic options of this package are max and rendition, + + \usepackage[max=4,rendition=3]{renditions} + +In the above example, max=4 declares that there are 4 renditions in the document, the option rendition=3 causes the package to include rendition3, and to exclude all the others rendition1, rendition2, and rendition4. + +The renditions package is a stand-alone package, but it was designed for use with the AeB Builder utility. + +The package requires the comment package. + +Now, I simply must get back to my retirement. + +Dr. D. P. Story +www.acrotex.net +dpstory@uakron.edu +dpstory@acrotex.net +02/05/10 diff --git a/texmf-dist/doc/latex/renditions/renditions.pdf b/texmf-dist/doc/latex/renditions/renditions.pdf new file mode 100644 index 00000000..b9f2b423 Binary files /dev/null and b/texmf-dist/doc/latex/renditions/renditions.pdf differ diff --git a/texmf-dist/doc/latex/richtext/README.md b/texmf-dist/doc/latex/richtext/README.md new file mode 100644 index 00000000..dadde345 --- /dev/null +++ b/texmf-dist/doc/latex/richtext/README.md @@ -0,0 +1,14 @@ +The richtext Package +Author: D. P. Story +Dated: 2016/10/03 + +The richtext package is used to create rich text strings that can, in turn, +be inserted into the RV (and V) keys of text field. Currently, only the eforms +package supports the RV key. + +Now, I simply must get back to my retirement. + +D. P. Story +www.acrotex.net +dpstory@uakron.edu +dpstory@acrotex.net diff --git a/texmf-dist/doc/latex/richtext/examples/richtext_tst.tex b/texmf-dist/doc/latex/richtext/examples/richtext_tst.tex new file mode 100644 index 00000000..0f84e599 --- /dev/null +++ b/texmf-dist/doc/latex/richtext/examples/richtext_tst.tex @@ -0,0 +1,58 @@ +\documentclass[12pt]{article} +\usepackage[designiii,forcolorpaper]{web} +\usepackage{eforms} +\usepackage{richtext} + +\let\uif\textsf +\let\app\textsf +\let\pkg\textsf + +\convertcolorspec{named}{webbrown}{HTML}{\htmlWebBrown} + +\parindent0pt \parskip6pt + +\begin{document} + +A single line of \textit{rich text}, one paragraph. + +\rtpara{para1}{A single line of \it{rich text}.} +\textField[\Ff{\FfRichText} \DS{\useDefaultDS}% +\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld1}{3in}{16bp} + +Single paragraph field but with multiple lines of text. Height allows roughly +4 lines of text. + +\rtpara{para1}{\span{ulstyle=2wul,style=bold}{Single paragraph field but with multiple lines of text.} +Height allows roughly 4 lines of text. Let's have more text so we get another line wrap.} +\textField[\Ff{\FfRichText}\Ff{\FfMultiline}\DS{\useDefaultDS} +\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld2}{3in}{16bp*4} + +Multiple paragraph field with multiple lines of text. + +\rtpara[indent=first]{para1}{Now is the time for + \span{style=strikeit,color=ff0000}{\it{\bf{J\374rgen}}} and all good men to + come to the aid of \it{their} \bf{country}. Now is the time for + \span{style=italic}{all good} women to do the same. +} +\rtpara[indent=first]{para2}{This is a second paragraph. I hope we can agree + on what to do next.} +\rtpara[halign=right]{para3}{\span{url=http://www.acrotex.net}{AcroTeX.Net}} + +\setDefaultStyle{myDS}{font={Helvetica,sans-serif},color=\htmlWebBrown} + + +\setRVVContent{myContent} +{ + {para1} + {para2} + {skipline} + {skipline} + {para3} +} + +\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDS{myDS}}%\DS{\useDefaultDS}% +\RV{\useRVContent{myContent}}\V{\useVContent{myContent}}]{rtFld3}{3in}{16\baselineskip} + +\end{document} + diff --git a/texmf-dist/doc/latex/richtext/richtextman.pdf b/texmf-dist/doc/latex/richtext/richtextman.pdf new file mode 100644 index 00000000..c11f86d5 Binary files /dev/null and b/texmf-dist/doc/latex/richtext/richtextman.pdf differ diff --git a/texmf-dist/doc/latex/yt4pdf/README.md b/texmf-dist/doc/latex/yt4pdf/README.md new file mode 100644 index 00000000..5d140014 --- /dev/null +++ b/texmf-dist/doc/latex/yt4pdf/README.md @@ -0,0 +1,21 @@ +The yt4pdf package +Dated: 2016/10/04 + +The yt4pdf package uses the rmannot package to embed a special SWF file to +play the YouTube videos. There is a complete set of buttons that come with +the package to control the video: play, pause, stop loading, rewind, load +a video by its YouTube video ID, and a button to view a video on the +YouTube web site. Adobe Acrobat 9 or later is required to author a +document; only Adobe Reader 9 is need to view the created yt4pdf document. + +The SWF file for playing the YouTube videos was developed by UVSAR +(http://www.uvsar.com/pdftube/) and is based on the YouTube chromeless +player and the YouTube ActionScript 3.0 Player API Reference +(http://code.google.com/apis/youtube/flash_api_reference.html) + +Now, I simply must get back to my retirement. + +Dr. D. P. Story +www.acrotex.net +dpstory@uakron.edu +dpstory@acrotex.net diff --git a/texmf-dist/source/latex/lmacs/lmacs.dtx b/texmf-dist/source/latex/lmacs/lmacs.dtx new file mode 100644 index 00000000..23c3d08a --- /dev/null +++ b/texmf-dist/source/latex/lmacs/lmacs.dtx @@ -0,0 +1,138 @@ +% \iffalse meta-comment +% http://www.texdev.net/2009/10/06/a-model-dtx-file/ +% !TEX program = pdfLaTeX +%<*internal> +\iffalse +% +%<*internal> +\fi +\def\nameofplainTeX{plain} +\ifx\fmtname\nameofplainTeX\else + \expandafter\begingroup +\fi +% +%<*install> +\input docstrip.tex +\keepsilent +\askforoverwritefalse +\preamble +\endpreamble +\ifx\fmtname\nameofplainTeX +\generate{ + \file{\jobname.sty}{\from{\jobname.dtx}{package}} +} +\fi +% +%\endbatchfile +%<*internal> +\ifx\fmtname\nameofplainTeX + \expandafter\endbatchfile\else + \expandafter\endgroup\fi +% +%\NeedsTeXFormat{LaTeX2e} +%\ProvidesPackage{lmacs} +% [2012/05/30 v1.1 Imports local macro files] +%<*driver> +\documentclass{ltxdoc} +%\usepackage{\jobname} +%\usepackage[numbered]{hypdoc} +%\EnableCrossrefs +%\CodelineIndex +%\RecordChanges +\begin{document} + \DocInput{\jobname.dtx} +\end{document} +% +% \fi +% +%\GetFileInfo{\jobname.sty} +% +%\title{The \textsf{\jobname} Package} +%\author{D. P. Story} +%\date{Released \today} +% +%\maketitle +% +%\StopEventually{^^A +% \PrintChanges +% \PrintIndex +%} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% \paragraph*{Description.} This package is used to clean up the +% preamble of {\LaTeX} files. Some preambles have a (large) number of definitions +% in them. To clean up the preamble, move the definitions in the preamble into a separate file, and +% use this package in import them into your preamble. Normally, +% \textsf{lmacs} would have a position that follows all packages for the +% document. +% +% \textsf{lmacs} stands for \underbar{l}ocal \underbar{mac}ro\underbar{s}. Normally, the files referenced are in the same folder +% as the main source file; they should not (but can) be in the search path of {\LaTeX}. +% +% \paragraph*{Demo files:} \texttt{lmacs\_tst.tex} (a simple latex source) +% and \texttt{lmacs\_aeb.tex} (a file that uses the \textsf{web} and \textsf{exerquiz} packages). +% These are found in the \texttt{examples} folder. +% +% \paragraph*{Documentation and Code.} +% We begin by requiring \texttt{kvoptions}, this package does not test for the presence +% of a class file, so we can use it. It allows us to define key-values as options of the +% package. +% \begin{macrocode} +\RequirePackage{kvoptions}[2009/07/21] +% \end{macrocode} +% \begin{macrocode} +% \end{macrocode} +% \begin{macro}{cfg} +% \begin{macro}{def} +% \begin{macro}{js} +% With these keys, you can specify the file with the specified extension be imported. +% For example, the following line +%\begin{verbatim} +% \usepackage[cfg=myconf,def=mydef,js=myjs]{lmacs} +%\end{verbatim} +% will import (using \cs{InputIfFileExists}) the files \texttt{myconf.cfg}, +% \texttt{mydef.def}, and \texttt{myjs.js}. Multiple specifications of the same +% extension is permitted, for example, +%\begin{verbatim} +% \usepackage[def=mydef1,def=mydef2]{lmacs} +%\end{verbatim} +% \begin{macrocode} +\let\LM@inputlist\@empty +% \end{macrocode} +% \cmd{\LM@input} inputs \texttt{\#1.\#2}, while \cmd{\LM@warning} issues +% a package warning if \texttt{\#1.\#2} is not found. +% \begin{macrocode} +\newcommand{\LM@input}[2]{\InputIfFileExists{#1.#2}{}% + {\LM@warning{#1}{#2}}} +\newcommand{\LM@warning}[2]{\PackageWarning{lmacs} + {The file #1.#2 cannot be found}} +% \end{macrocode} +% \DescribeMacro{!cfg}\DescribeMacro{!def}\DescribeMacro{!js}For each of these options, we add the specified file to +% \cs{LM@inputlist}, this will be executed at the end of the package. The three options +% \texttt{!cfg}, \texttt{!def}, \texttt{!js} do nothing, making it easy to include, or +% not include a file. +% \begin{macrocode} +\define@key{lmacs}{cfg}{\g@addto@macro\LM@inputlist{\LM@input{#1}{cfg}}} +\define@key{lmacs}{!cfg}{} +\define@key{lmacs}{def}{\g@addto@macro\LM@inputlist{\LM@input{#1}{def}}} +\define@key{lmacs}{!def}{} +\define@key{lmacs}{js}{\g@addto@macro\LM@inputlist{\LM@input{#1}{js}}} +\define@key{lmacs}{!js}{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macrocode} +\ProcessKeyvalOptions{lmacs} +% \end{macrocode} +% Once the options have been process, we execute the command +% \cs{LM@inputlist} which contains a list of the files to be input. +% \begin{macrocode} +\LM@inputlist +% \end{macrocode} +% \begin{macrocode} +% +% \end{macrocode} +%\Finale diff --git a/texmf-dist/source/latex/popupmenu/examples/pumen_ex.pdf b/texmf-dist/source/latex/popupmenu/examples/pumen_ex.pdf new file mode 100644 index 00000000..c576f284 Binary files /dev/null and b/texmf-dist/source/latex/popupmenu/examples/pumen_ex.pdf differ diff --git a/texmf-dist/source/latex/popupmenu/examples/pumen_ex.tex b/texmf-dist/source/latex/popupmenu/examples/pumen_ex.tex new file mode 100644 index 00000000..6f0acc7a --- /dev/null +++ b/texmf-dist/source/latex/popupmenu/examples/pumen_ex.tex @@ -0,0 +1,108 @@ +\documentclass{article} +\usepackage[designv]{web} +\usepackage{eforms} +\usepackage{popupmenu} + +\title{The \texorpdfstring{\textsf{popupmenu}}{popupmenu} Package Test File} +\author{D. P. Story} +\subject{Test file for the popupmenu Package} +\keywords{LaTeX, popupmenu, Acrobat JavaScript, AcroTeX} + +\university{NORTHWEST FLORIDA STATE COLLEGE\\ + Department of Mathematics} +\email{dpstory@acrotex.net} +\version{1.0} + +%\nocopyright +\norevisionLabel + +% +% This package can be used by users of pdftex, dvipdfm, dvips (with distiller) +% + +\urlPath{\aebhome}{http://www.math.uakron.edu/~dpstory} + +\begin{popupmenu}{AeBMenu} + \item{title=AeB, return=\aebhome/webeq.html} + \item{title=-} + \begin{submenu}{title=AeB Pro Family} + \item{title=Home page,return=\aebhome/aeb_pro.html} + \item{title=Graphicxsp,return=\aebhome/graphicxsp.html} + \end{submenu} + \item{title=eqExam,return=\aebhome/eqexam.html} +\end{popupmenu} + +\begin{popupmenu}{AeBMenuLocal} + \item{title=AeB, return=\aebhome/webeq.html} + \item{title=-} + \begin{submenu}{title=AeB Pro Family,enabled=false} + \item{title=Home page,return=\aebhome/aeb_pro.html} + \item{title=Graphicxsp,return=\aebhome/graphicxsp.html} + \end{submenu} + \item{title=eqExam,return=\aebhome/eqexam.html} +\end{popupmenu} + +% +% This menu was taken from the Acrobat JavaScript API Reference +% as a test of the new popupmenu and submenu environments. +% +\begin{popupmenu}{myMenu} + \item{title=Item 1, marked, enabled=false} + \item{title=-} + \begin{submenu}{title=Item 2} + \item{title={Item 2, Submenu 1}} + \begin{submenu}{title={Item 2, Submenu 2}} + \item{title={Item 2, Submenu 2, Subsubmenu 1}} + \end{submenu} + \end{submenu} + \item{title=Item 3} + \item{title=Item 4} +\end{popupmenu} + +\begin{insDLJS}[AeBMenu]{md}{Menu Data} +\AeBMenu +\myMenu +\end{insDLJS} + +\parindent0pt\parskip6pt + +\begin{document} + +\maketitle + +This file uses the \textsf{eforms} package to create push buttons, +the push button of \textsf{hyperref} can also be used. + +Here is an example taken from the Acrobat JavaScript API Reference: +\pushButton[\CA{My Menu}\AA{\AAMouseEnter{\JS{% +var cChoice = \popUpMenu(myMenu);\r +if ( cChoice != null ) app.alert("You chose the \\""+cChoice+"\\" menu item"); +}}}]{mymenu}{}{11bp} + +We can add a push button with a rollover effect +\pushButton[\CA{Packages}\AA{\AAMouseEnter{\JS{% +var cChoice = \popUpMenu(AeBMenu);\r +if ( cChoice != null ) app.launchURL(cChoice); +}}}]{menu}{}{11bp} + +You can also open the menu with a link: +\setLinkText[\A{\JS{% +var cChoice = \popUpMenu(AeBMenu);\r +if ( cChoice != null ) app.launchURL(cChoice); +}}]{Package}. Links do not have a rollover effect, however, you can use buttons like so: {\setbox0=\hbox{\textcolor{red}{Packages}}% +\makebox[0pt][l]{\pushButton[\W0\BG{}\BC{}\S{S}\AA{\AAMouseEnter{\JS{% +var cChoice = \popUpMenu(AeBMenu);\r if ( cChoice != null ) +app.launchURL(cChoice); }}}]{menu}{\wd0}{\ht0+\dp0}}\unhbox0}. + +This is a version that has a local version of the menu array: +{\setbox0=\hbox{\textcolor{red}{Packages}}% +\makebox[0pt][l]{\pushButton[\W0\BG{}\BC{}\S{S}\AA{\AAMouseEnter{\JS{% +\AeBMenuLocal\r +var cChoice = \popUpMenu(AeBMenuLocal);\r if ( cChoice != null ) +app.launchURL(cChoice);}}}]{menu}{\wd0}{\ht0+\dp0}}\unhbox0} +\end{document} + +This is a version that has a local version of the menu array: +\PushButton[name=hyperbutton,onmouseover={\AeBMenuLocal +var cChoice = \popUpMenu(AeBMenuLocal); if ( cChoice != null ) +app.launchURL(cChoice); }]{Packages} diff --git a/texmf-dist/source/latex/popupmenu/examples/pumen_ex_pdftex.tex b/texmf-dist/source/latex/popupmenu/examples/pumen_ex_pdftex.tex new file mode 100644 index 00000000..3254570d --- /dev/null +++ b/texmf-dist/source/latex/popupmenu/examples/pumen_ex_pdftex.tex @@ -0,0 +1,111 @@ +\documentclass{article} +\usepackage[designv,pdftex]{web} +\usepackage{eforms} +\usepackage{popupmenu} + +\title{The \texorpdfstring{\textsf{popupmenu}}{popupmenu} Package Test File} +\author{D. P. Story} +\subject{Test file for the popupmenu Package} +\keywords{LaTeX, popupmenu, Acrobat JavaScript, AcroTeX} + +\university{NORTHWEST FLORIDA STATE COLLEGE\\ + Department of Mathematics} +\email{dpstory@acrotex.net} +\version{1.0} + +%\nocopyright +\norevisionLabel + +% +% This package can be used by users of pdftex, dvipdfm, dvips (with distiller) +% + +\urlPath{\aebhome}{http://www.math.uakron.edu/~dpstory} + +\begin{popupmenu}{AeBMenu} + \item{title=AeB, return=\aebhome/webeq.html} + \item{title=-} + \begin{submenu}{title=AeB Pro Family} + \item{title=Home page,return=\aebhome/aeb_pro.html} + \item{title=Graphicxsp,return=\aebhome/graphicxsp.html} + \end{submenu} + \item{title=eqExam,return=\aebhome/eqexam.html} +\end{popupmenu} + +\begin{popupmenu}{AeBMenuLocal} + \item{title=AeB, return=\aebhome/webeq.html} + \item{title=-} + \begin{submenu}{title=AeB Pro Family,enabled=false} + \item{title=Home page,return=\aebhome/aeb_pro.html} + \item{title=Graphicxsp,return=\aebhome/graphicxsp.html} + \end{submenu} + \item{title=eqExam,return=\aebhome/eqexam.html} +\end{popupmenu} + +% +% This menu was taken from the Acrobat JavaScript API Reference +% as a test of the new popupmenu and submenu environments. +% +\begin{popupmenu}{myMenu} + \item{title=Item 1, marked, enabled=false} + \item{title=-} + \begin{submenu}{title=Item 2} + \item{title={Item 2, Submenu 1}} + \begin{submenu}{title={Item 2, Submenu 2}} + \item{title={Item 2, Submenu 2, Subsubmenu 1}} + \end{submenu} + \end{submenu} + \item{title=Item 3} + \item{title=Item 4} +\end{popupmenu} + +\begin{insDLJS}[AeBMenu]{md}{Menu Data} +\AeBMenu +\myMenu +\end{insDLJS} + +\newcommand{\cs}[1]{\texttt{\char`\\#1}} + + +\parindent0pt\parskip6pt + +\begin{document} + +\maketitle + +This file uses the \textsf{hyperref} package to create push buttons, +the push button of \textsf{eforms} can also be used. + + +Here is an example taken from the Acrobat JavaScript API Reference, it uses +the \cs{PushButton} command of \textsf{hyperref}. The script is implemented as +a mouse up event, rather than a rollover event as it appears \cs{PushButton} does not +support rollover. There is a \texttt{onmouseover} key that is supposed to work, but it doesn't. +\PushButton[name=mymenu, +onclick={var cChoice = \popUpMenu(myMenu); +if ( cChoice != null ) app.alert("You chose the \eqbs\eqbs""+cChoice+"\eqbs\eqbs" menu item"); +}]{My Menu} + + +Here is the same example, but using \cs{pushButton}, the button command from the eforms package. +It is implemented as a rollover event. +\pushButton[\CA{My Menu}\AA{\AAMouseEnter{\JS{% +var cChoice = \popUpMenu(myMenu);\r +if ( cChoice != null ) app.alert("You chose the \\""+cChoice+"\\" menu item"); +}}}]{mymenu}{}{11bp} + +We can add a push button with a rollover effect +\pushButton[\CA{Packages}\AA{\AAMouseEnter{\JS{% +var cChoice = \popUpMenu(AeBMenu);\r +if ( cChoice != null ) app.launchURL(cChoice); +}}}]{menu}{}{11bp} + +This is a version that has a local version of the \texttt{AeBMenuLocal} array. +If we place the array as field-level JavaScript, we don't need the \textsf{eforms} package. +Again, this is an \texttt{onclick} event. +\PushButton[name=mymenu,onclick={\AeBMenuLocal; +var cChoice = \popUpMenu(AeBMenuLocal); +if ( cChoice != null ) app.launchURL(cChoice);}]{AeB Local Menu} + +Fancier examples can be found at the \textcolor{blue}{AeB Blog} (\url{www.math.uakron.edu/~dpstory/aebblog.html}). +\end{document} diff --git a/texmf-dist/source/latex/popupmenu/popupmenu.dtx b/texmf-dist/source/latex/popupmenu/popupmenu.dtx new file mode 100644 index 00000000..4ca46a31 --- /dev/null +++ b/texmf-dist/source/latex/popupmenu/popupmenu.dtx @@ -0,0 +1,261 @@ +% \iffalse +%<*copyright> +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% popupmenu.sty package, 2009-10-15 %% +%% Copyright (C) 2009 D. P. Story %% +%% dpstory@acrotex.net %% +%% storyd@nwfsc.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. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%\NeedsTeXFormat{LaTeX2e} +%\ProvidesPackage{popupmenu} +% [2010/09/18 v1.0 Provides support for popup menus (dps)] +%<*driver> +\documentclass{ltxdoc} +\usepackage[colorlinks,hyperindex]{hyperref} +\pdfstringdefDisableCommands{\let\\\textbackslash}% +\EnableCrossrefs \CodelineIndex +\OnlyDescription % comment out for implementation details +\begin{document} + \GetFileInfo{popupmenu.sty} + \title{The \textsf{popupmenu} Package} + \author{D. P. Story\\ + Email: \texttt{dpstory@acrotex.net}} + \date{processed \today} + \maketitle + \tableofcontents + \let\Email\texttt + \DocInput{popupmenu.dtx} + \PrintIndex +\end{document} +% +% \fi +% \begin{macrocode} +%<*package> +% \end{macrocode} +% This is a short package that provides environments and commands for building +% a popup menu using JavaScript. The command \cs{popUpMenu} uses the Acrobat JavaScript +% method \texttt{app.popUpMenuEx}. This latter method requires you to pass to it a +% structured menu listing of the menu items to be displayed in the popup menu, and the actions +% to be taken when a menu item is selected. The environments \texttt{popupmenu} and +% \texttt{submenu} are defined for the purpose of creating this hierarchical structure. +% \begin{macrocode} +\RequirePackage{xkeyval} +% \end{macrocode} +% According to the JavaScript manual, the \texttt{app.popUpMenuEx} method takes +% one or more \texttt{MenuItem} objects. The {\LaTeX} access to the properties of this object are documented +% as follows (taken verbatim from the JavaScript reference): +% \begin{macro}{title} +% The menu item name, which is the string to appear on the menu item. The value of +% \texttt{"-"} is reserved to draw a separator line in the menu. +% \begin{macro}{marked} +% (optional) A Boolean value specifying whether the item is to be marked with a +% check. The default is \texttt{false} (not marked). +% \begin{macro}{enabled} +% (optional) A Boolean value specifying whether the item is to appear enabled or +% grayed out. The default is \texttt{true} (enabled). +% \begin{macro}{return} +% (optional) A string to be returned when the menu item is selected. The default is the +% value of cName. +% \begin{macrocode} +\define@key{menustruct}{title}[]{\def\menustruct@title{#1}} +\define@boolkey{menustruct}{marked}[true]{} +\define@boolkey{menustruct}{enabled}[true]{} +\define@key{menustruct}{return}[]{\def\menustruct@return{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% We use the command \cs{pum@holdtoks} to hold the menu items as they are processed +% in the environment, and use \cs{@AddToMenuToks} to add to the items. +% \begin{macrocode} +\let\pum@holdtoks\@empty +\newcommand{\@AddToMenuToks}{\g@addto@macro\pum@holdtoks} +% \end{macrocode} +% \begin{environment}{popupmenu} +% We begin by defining our menu structure using the +% \texttt{popupmenu} environment. Within this environment, +% we list the items in the menu using \cs{item} and +% the \texttt{submenu} menu if there are sub menus. +% +% The \texttt{popupmenu} command requires one parameter, this command is +% used to create both a command and a JavaScript variable. The name is +% passed to the \cs{popUpMenu} command, while the command version of the +% name expands to the menu structure. The menu structure can be placed +% at the document level, or as part of a push button action. +% Here is an example of usage:\par +% \begin{verbatim} +%\urlPath{\aebhome}{http://www.math.uakron.edu/~dpstory} +%\begin{popupmenu}{myMenu} +% \item{title=AeB,return=\aebhome/webeq.html} +% \item{title=-} +% \begin{submenu}{title=AeB Pro Family} +% \item{title=Home page, return=\aebhome/aeb_pro.html} +% \item{title=Graphicxsp, return=\aebhome/graphicxsp.html} +% \end{submenu} +% \item{title=eqExam, return=\aebhome/eqexam.html} +%\end{popupmenu} +%\end{verbatim} +%The above definition can be conveniently placed in the preamble, though it can +% appear anywhere before it is used, obviously. Now to use the menu structure, +% all we need is a push button or link to create a JavaScript action: +%\begin{verbatim} +% \pushButton[\CA{Packages}\AA{\AAMouseEnter{\JS{% +% \myMenu\r +% var cChoice = \popUpMenu(myMenu);\r +% if ( cChoice != null ) app.launchURL(cChoice); +% }}}]{menu}{}{11bp} +%\end{verbatim} +% The above example uses the \textsf{eforms} package, but a push button from \textsf{hyperref} will do too. +% The \texttt{app.popUpMenuEx} method returns the return value, which we, in turn, process. In this +% case, the return is a URL, which we launch. +% +% If we have placed \cs{myMenu} at the document level, the line \verb!\myMenu\r! would not be needed. +% If you are using the same menu several times in the document, put it at the document level to reduce +% file size. +% +% Also, in the above example, you see how the name, \texttt{myMenu}, passed as an argument +% of the popupmenu environment is used as a name and as a command: The name is passed to +% \cs{popUpMenu}, while the command expands to the menu structure that is referenced by the name. +% \begin{macrocode} +% \end{macrocode} +% \begin{macro}{\itemindex} +% We generate the index of each menu item. \cs{itemindex} is +% the index of the menu structure array; for example, +% \cs{itemindex} might expand to \texttt{[0]}, \texttt{[1].oSubMenu[3]}, or \texttt{[2].oSubMenu[3].oSubMenu[0]}. +% If \cs{itemindex} is included in the return value (possibly as an array entry), we can +% know the item the use selected +%\begin{verbatim} +%var aChoice=processMenu(AeBMenu); +%if (aChoice!=null) { +% var thisChoice=aChoice[0]; // this is a string +% var thistitle=eval("AeBMenu"+thisChoice+".cName"); +% app.alert(thistitle); +%} +%\end{verbatim} +% The above code gets the return array, then uses it to get the title of the item +% selected, +% \begin{macrocode} +\newcount\pum@cnt +\def\pum@updateindex{\global\advance\pum@cnt\@ne + \edef\pum@rc{\pum@topindex[\the\pum@cnt]}\edef\itemindex{'\pum@rc'}} +\def\pum@initIndexMenu#1{\global\pum@cnt=-1\relax\edef\pum@rc{#1}% + \edef\pum@topindex{\pum@rc}} +% \end{macrocode} +% \end{macro} +% We are now ready to define the \texttt{popupmenu} environment. The environment +% takes one required parameter, a name that is used as a JavaScript variable. +% This name is also used to create a command. +% \begin{macrocode} +\newenvironment{popupmenu}[1]{\pum@initIndexMenu{}% + \let\pum@holdtoks\@empty + \toks@={\pum@mytab}\@makeother\~ +% \end{macrocode} +% We initialize with a \cs{@gobble}, which eats up the leading comma (,) +% that is placed there by the code below. +% \begin{macrocode} + \gdef\msarg{#1}\@AddToMenuToks{\@gobble}% + \let\item\pum@item +}{% + \expandafter\xdef\csname\msarg\endcsname{% + var \msarg\space = [ \pum@holdtoks^^J];}% +} +% \end{macrocode} +% \end{environment} +% \begin{macro}{\pum@item} +% At the startup of the \texttt{popupmenu} environment, we \verb|\let\item\pum@item|. +% The definition of \cs{pum@item} takes one argument, the properties described above. +% \begin{macrocode} +\newcommand{\pum@item}[1]{\pum@updateindex + \edef\tmp@exp{\noexpand + \setkeys{menustruct}{title,marked=false,enabled,return,#1}}\tmp@exp + \edef\tmp@exp{,^^J\the\toks@ + {cName: "\menustruct@title"% + \ifKV@menustruct@marked, bMarked: true\fi% + \ifKV@menustruct@enabled\else, bEnabled: false\fi% + \ifx\menustruct@return\@empty\else, + cReturn: "\menustruct@return"\fi}}% + \expandafter\@AddToMenuToks\expandafter{\tmp@exp}% +} +% \end{macrocode} +% \end{macro} +% Some technical matters, we need unmatched braces, so we define +% \cs{pum@lbrace} and \cs{pum@rbrace}. +% \begin{macrocode} +\begingroup +\catcode`<=1 \catcode`\>=2 \@makeother\{ \@makeother\} +\gdef\pum@lbrace<{>\gdef\pum@rbrace<}> +\endgroup +\def\pum@mytab{\space\space\space\space} +% \end{macrocode} +% \begin{environment}{submenu} +% Used to create a submenu of a menu item. The top level menu item has no return value, +% it can be marked but cannot be dis-enabled (\texttt{enabled=false}). +% +% The argument of \texttt{submenu} are any of the menu item properties, however, only +% \texttt{title} and \texttt{marked} will be recognized. +% +% The JavaScript property, \texttt{oSubMenu}, of the menu structure passed to +% the method \texttt{app.popUpMenuEx} has no {\LaTeX} counterpart. This property +% key-value pair is automatically inserted by the \texttt{submenu} +% environment. +% \begin{macrocode} +\newenvironment{submenu}[1]{\pum@updateindex + \xdef\saved@pum@cnt{\the\pum@cnt}% + \pum@initIndexMenu{\pum@rc.oSubMenu}\edef\temp@toks{\the\toks@}% + \toks@=\expandafter{\temp@toks\pum@mytab}% + \setkeys{menustruct}{title,marked=false,enabled,return,#1}% + \edef\tmp@exp{,^^J\the\toks@ + \noexpand\pum@lbrace cName: "\menustruct@title"% + \ifKV@menustruct@marked, bMarked: true\fi% + \ifKV@menustruct@enabled\else, bEnabled: false\fi, + oSubMenu:^^J\the\toks@[}% +% \end{macrocode} +% Again, we \cs{@gobble} up the leading comma (,). +% \begin{macrocode} + \expandafter\@AddToMenuToks\expandafter{\tmp@exp\@gobble}% +}{% + \edef\tmp@exp{^^J\the\toks@ ]\pum@rbrace}% + \expandafter\@AddToMenuToks\expandafter{\tmp@exp}% + \global\pum@cnt\saved@pum@cnt +} +% \end{macrocode} +% \end{environment} +% \begin{macro}{\popUpMenu} +% The \cs{popUpMenu} command takes one argument, the name pass to a +% popupmenu environment. The command expands to the \texttt{app.popUpMenuEx} +% method. The document author must then process the return value in some way. +% The argument is enclosed in parentheses, this is so we can use \cs{popUpMenu} +% at the document level, we can pass it an argument there. +% \begin{macrocode} +\def\popUpMenu(#1){app.popUpMenuEx.apply( app, #1 )} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\urlPath} +% A convenience command to save a url path. The string is normalized using +% the \textsf{hyperref} command \cs{hyper@normalise}. Though we don't require +% any other packages, you can't do much unless you use \textsf{hyperref} as well. +% \begin{macrocode} +\providecommand{\urlPath}[1]{\def\pum@urlName{#1}% + \hyper@normalise\pum@urlPath} +\def\pum@urlPath#1{\expandafter\xdef\pum@urlName{#1}} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +% +% \end{macrocode} +% \Finale +\endinput +History: + (2010/09/18 v.8) Replaced \count\z@ by \pun@cnt, and change the + increment to global. The index was not correct when there were several + submenus. + (2009/10/20 v.7) Added \itemindex, which calculates the index of the menu item + selected. Can be passed to the handling code as part of the return value. diff --git a/texmf-dist/source/latex/popupmenu/popupmenu.ins b/texmf-dist/source/latex/popupmenu/popupmenu.ins new file mode 100644 index 00000000..1223d03e --- /dev/null +++ b/texmf-dist/source/latex/popupmenu/popupmenu.ins @@ -0,0 +1,59 @@ +%% +%% 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{2009/10/15} +\def\batchfile{popupmenu.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{popupmenu.sty}{\from{popupmenu.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/rangen/rangen.dtx b/texmf-dist/source/latex/rangen/rangen.dtx new file mode 100644 index 00000000..637775f9 --- /dev/null +++ b/texmf-dist/source/latex/rangen/rangen.dtx @@ -0,0 +1,1988 @@ +%\iffalse +%<*copyright> +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Rangen.sty package, 2016-02-19 %% +%% 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. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%\NeedsTeXFormat{LaTeX2e}[1997/12/01] +%\ProvidesPackage{rangen} +% [2014/10/17 v1.4 Rangen: Generate Random Questions (dps)] +%<*driver> +\documentclass{ltxdoc} +\usepackage[colorlinks,hyperindex]{hyperref} +%\pdfstringdefDisableCommands{\let\\\textbackslash} +%\EnableCrossrefs \CodelineIndex +\begin{document} + \GetFileInfo{rangen.sty} +% \settowidth{\oddsidemargin}{0pt}% +% \setlength{\evensidemargin}{0pt} +% \setlength{\marginparsep}{0pt} +% \setlength{\marginparwidth}{0pt} +% \setlength\textwidth{6in} +% \hoffset=.5in +% \hsize = 6in + \title{\textsf{Rangen}\texorpdfstring{\\}{:} Random Generation of Integer, Rational, and Real Numbers with + Applications to the \texttt{exercise}, \texttt{quiz}, and \texttt{shortquiz} environments of \textsf{Exerquiz}} + \author{D. P. Story\\ + Email: \texttt{dpstory@uakron.edu}} + \date{processed \today} + \maketitle + \tableofcontents + \let\Email\texttt + \DocInput{rangen.dtx} + \PrintIndex +\end{document} +% +% \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 provides some commands for creating randomly generated integers, rational, +% and real numbers. There are options for specifying constraints on the generation of the numbers. +% Companion JavaScript functions are developed to use these random numbers as part of a +% question in a \texttt{shortquiz} or \texttt{quiz}. The syntax of this package can be used +% to pose number-related questions, the JavaScript can be used to create the answer to the +% question based on a formula. You'll have to see it to believe it. +% +% \section{The Main Code} +% +% \subsection{Declare Options} +% +% This package has one option, other options are passed to the really nice \textsf{lcg} Package, +% by Erich Janka (\texttt{janka@utanet.at}). +% \begin{macrocode} +\newcount\seedCnt +\DeclareOption{testmode}{% + \InputIfFileExists{\jobname.seed}{}{\def\thisseed{1}}% + \PassOptionsToPackage{seed=\thisseed}{lcg}% + \AtEndOfPackage{\reseedEachRun}% +} +\def\reseedEachRun{% + \seedCnt=\thisseed + \advance\seedCnt1\relax + \newwrite \rngWrite + \immediate\openout\rngWrite \jobname.seed + \immediate\write\rngWrite{\string\def\string\thisseed{\the\seedCnt}} + \immediate\closeout\rngWrite +} +\def\RNG@Dec{.} +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{lcg}} +\ProcessOptions +\RequirePackage{lcg}[2008/09/10] +% \end{macrocode} +% Save the seed value so we can reproduce the same pseudo-random number sequence. +% \begin{macrocode} +\edef\rng@saveSeed{\the\cr@nd} +% \end{macrocode} +% There are three data types: Integer, Rational, and Real. The following macros +% gives each of these types a numerical value, 0, 1 and 2, respectively. +% \begin{macrocode} +\newcount\loopCnt +\def\maxLoopLimit{10} +\def\typeCodeForz{0} +\def\typeCodeForq{1} +\def\typeCodeForr{2} +% \end{macrocode} +% Some scratch count registers +% \begin{macrocode} +\newcount\rng@cnta +\newcount\rng@cntb +% \end{macrocode} +% A random variable is specified using a control sequence, e.g. \cs{a}. The following macro +% extracts the underlying name of the command, e.g. \verb+\@gtVarName{\a}+ expands to \texttt{a}, +% and returns the name as the expansion of the macro \cs{@varName}. +% \begin{macrocode} +\def\@getVarName#1{% + \edef\@varName{\expandafter\@gobble\string#1}% +} +% \end{macrocode} +% The command \cs{@getVarType} takes one argument, a random variable, e.g., \cs{a}. This +% command defines a macro \cs{varType} which expands to the data type the random variable is. +% \begin{macrocode} +\def\@getVarType#1{% + \@getVarName{#1}\edef\varType{\csname typeof@\@varName\endcsname}} +% \end{macrocode} +% \subsection{GCD and Rational Reduction Commands} +% \begin{macro}{\gcd} +% Here we use Euclid's Algorithm to find the greatest common divisor of two integers. +% \begin{macrocode} +\def\gcd#1#2{{% #1 = a, #2 = b + \ifnum#2=0 \edef\next{#1}\else + \@tempcnta=#1 \@tempcntb=#2 \divide\@tempcnta by\@tempcntb + \multiply\@tempcnta by\@tempcntb % q*b + \@tempcntb=#1 + \advance\@tempcntb by-\@tempcnta % remainder in \@tempcntb + \ifnum\@tempcntb=0 + \@tempcnta=#2 + \ifnum\@tempcnta < 0 \@tempcnta=-\@tempcnta\fi + \xdef\gcd@next{\noexpand% + \def\noexpand\thegcd{\the\@tempcnta}}% + \else + \xdef\gcd@next{\noexpand\gcd{#2}{\the\@tempcntb}}% + \fi + \fi}\gcd@next +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\lcm} +% Now compute the least common multiple +% \begin{macrocode} +\def\lcm#1#2{% #1 = a, #2 = b + \gcd{#1}{#2}% + {\@tempcnta=#1 + \multiply\@tempcnta by#2 + \divide\@tempcnta by\thegcd + \xdef\thelcm{\the\@tempcnta}}% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\amodb} +% Modular arithmetic \texttt{a mod b}, returns its results +% as a macro \cs{retnmod}. +% \begin{macrocode} +\def\amodb#1#2{% #1 = a, #2 = b + {\@tempcnta=#1 + \divide\@tempcnta by#2 + \multiply\@tempcnta by#2 + \@tempcntb=#1 + \advance\@tempcntb by-\@tempcnta + \xdef\retnmod{\the\@tempcntb}}% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\reduceFrac} +% Reduce a fraction to lowest terms. The first argument is the numerator and the second +% argument is the denominator. This command computes the \texttt{gcd} of the two integers, +% divides each by the \texttt{gcd}, and returns the results in the two scratch count +% registers \cs{@tempcnta} and \cs{@tempcntb}. +% \begin{macrocode} +\newcommand\reduceFrac[2] +{% + \gcd{#1}{#2}{\@tempcnta=#1 \divide\@tempcnta by\thegcd + \@tempcntb=#2 \divide\@tempcntb by\thegcd + \ifnum\@tempcntb<0\relax +% \end{macrocode} +% Always have the denominator as positive. +% \begin{macrocode} + \@tempcntb=-\@tempcntb + \@tempcnta=-\@tempcnta + \fi + \xdef\rfNumer{\the\@tempcnta}\xdef\rfDenom{\the\@tempcntb}}% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\convertRatTo} +% Converts a fraction \texttt{a/b} (\texttt{\#1/\#2}) to a denominator of \texttt{\#3}. Will return +% new numerator in \cs{rnd@Cnta} register. This will be exact if +% \texttt{\#2} divides \texttt{\#3}. +% \begin{macrocode} +\def\convertRatTo#1#2#3{{% + \@tempcnta=#3 + \multiply\@tempcnta by#1 + \divide\@tempcnta by#2 + \xdef\rng@retn@num{\the\@tempcnta}% +}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\RNGadd} +% This is the support for rational arithmetic (addition and subtraction). +% Adds two rational numbers, \texttt{\#1} and \texttt{\#2} together. These two rational numbers must have been defined +% already, possibly by \cs{defineQ}. Usage: \verb+\RNGadd\a\b+. This macro returns a rational number: +% the numerator in the \cs{rfNumer} command, and the denominator in the \cs{rfDenom} command. +% For example, +%\begin{verbatim} +%\defineQ\a{1}{3}\defineQ\b{3}{5}\RNGadd\a\b +%\makeatletter +%The sum of $\frac{\nOf\a}{\dOf\a} + \frac{\nOf\b}{\dOf\b} +% = \frac{\rfNumer}{\rfDenom}$ +%\makeatother +%\end{verbatim} +%This code typesets as $\frac{1}{3}+\frac{3}{5}=\frac{14}{15}$. +% \begin{macrocode} +\newcommand\RNGadd[2]{% + \rng@cnta=\nOf#1 \multiply\rng@cnta by\dOf#2 + \rng@cntb=\nOf#2 \multiply\rng@cntb by\dOf#1 + \advance\rng@cnta by\the\rng@cntb + \rng@cntb=\dOf#1 \multiply\rng@cntb by\dOf#2 + \reduceFrac{\the\rng@cnta}{\the\rng@cntb} +} +% \end{macrocode} +% \end{macro} +% This is a simple macro for detecting if the argument \texttt{\#1} +% is a macro or not. Used when interval definitions of the +% \cs{RandomZ/Q/R} macros. +% \begin{macrocode} +\def\rng@isControl#1{\@ifundefined{\expandafter\@gobble\string#1}% + {\let\rng@isC@ntrol=0}{\let\rng@isC@ntrol=1}} +% \end{macrocode} +% This command determines if its argument has an \texttt{*} +% prefixed or post-fixed to its argument. +% If \cs{rng@isStariii} equals \texttt{*}, then an \texttt{*} exists. +% \begin{itemize} +% \item If there is no \texttt{*}, then the argument is \texttt{\#1} +% \item \cs{rng@isStariii} equals \texttt{*}, there is \texttt{*}, +% If the argument has the form \cs{*a}, then \cs{rng@isStari} is \cs{@empty} +% and the argument, stripped of the \texttt{*}, is given as \cs{rng@isStarii} +% \item \cs{rng@isStariii} equals \texttt{*}, there is \texttt{*}, +% If the argument has the form \cs{a*}, then \cs{rng@isStarii} is \cs{@empty} +% and the argument, stripped of the \texttt{*}, is given as \cs{rng@isStari} +%\end{itemize} +% \begin{macrocode} +\def\rng@existStar#1{\rng@existSt@r#1**\@nil} +\def\rng@existSt@r#1*#2*#3\@nil{\def\rng@isStari{#1}% + \def\rng@isStarii{#2}\def\rng@isStariii{#3}% +} +\def\rng@NameEndpoint#1{% + \ifx\rng@isStari\@empty + \edef#1{\expandafter\noexpand\rng@isStarii}% + \else\ifx\rng@isStarii\@empty + \edef#1{\expandafter\noexpand\rng@isStari}% + \fi\fi +} +% \end{macrocode} +% \subsection{Define an Integer and a Rational} +% \begin{macro}{\defineZ} +% Define a integer for use in other macros. +% \begin{macrocode} +\newcommand\defineZ[2] +{% + \@getVarName#1\relax + \expandafter\def\csname typeof@\@varName\endcsname{0}% + \expandafter\edef\csname n@\@varName\endcsname{#2}% + \expandafter\edef\csname d@\@varName\endcsname{1}% + \edef\display@TeXfmt{#2}\edef\inline@TeXfmt{#2}% + \ifnum#2=1\relax\rng@makeOneFmtDefns + \else\ifnum#2=-1\relax\rng@makeMinusOneFmtDefns + \else\rng@makeOtherFmtDefns\fi\fi + \expandafter\let\csname\@varName*\endcsname\display@TeXfmt + \expandafter\let\csname\@varName!\endcsname\inline@TeXfmt + \expandafter\edef\csname\@varName\endcsname{#2}% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\defineQ} +% The following macro defines a rational number. Usage +% \verb+\defineQ\a{1}{2}+. This defines the rational number 1/2 and +% gives it a name, \cs{a}. +% \begin{macrocode} +\newcommand\defineQ[3] +{% + \@getVarName#1\relax + \expandafter\def\csname typeof@\@varName\endcsname{1}% + \expandafter\edef\csname n@\@varName\endcsname{#2}% + \expandafter\edef\csname d@\@varName\endcsname{#3}% + \edef\display@TeXfmt{\frac{#2}{#3}}\edef\inline@TeXfmt{#2/#3}% + \ifnum#2=#3\relax\rng@makeOneFmtDefns + \else\ifnum#2=-#3\relax\rng@makeMinusOneFmtDefns + \else\rng@makeOtherFmtDefns\fi\fi + \expandafter\let\csname\@varName*\endcsname\display@TeXfmt + \expandafter\let\csname\@varName!\endcsname\inline@TeXfmt + \expandafter\edef\csname\@varName\endcsname{#2/#3}% + \simplifyCurrentQ +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\defineR} +% This macro computes: (1) \cs{rng@intpart}; (2) \cs{rng@fracpart}; +% (3) \cs{rndnDec} (the number of decimals of the fractional part); +% (4) \cs{rndPower} (the power of ten determined by \cs{rndnDec}). +% \begin{macrocode} +\newcommand{\defineR}[2]{% + \@getVarName{#1}\RNGparseDec{#2}% + \expandafter\def\csname typeof@\@varName\endcsname{2}% + \reduceFrac{\rng@intpart\rng@fracpart}{\rndPower}% + \expandafter\edef\csname n@\@varName\endcsname{\rfNumer}% + \expandafter\edef\csname d@\@varName\endcsname{\rfDenom}% + \edef\display@TeXfmt{#2}\edef\inline@TeXfmt{#2}% + \ifnum\rfNumer=1\relax\rng@makeOneFmtDefns + \else\ifnum\rfNumer=-1\relax\rng@makeMinusOneFmtDefns + \else\rng@makeOtherFmtDefns\fi\fi + \expandafter\let\csname\@varName*\endcsname\display@TeXfmt + \expandafter\let\csname\@varName!\endcsname\inline@TeXfmt + \expandafter\edef\csname\@varName\endcsname{#2}% + \simplifyCurrentR +} +\newcommand{\simplifyCurrentR}{% + \ifnum\csname d@\@varName\endcsname=1 + \expandafter\defineZ + \csname\@varName\endcsname{\csname n@\@varName\endcsname}\fi +} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\def\rng@makeOneFmtDefns{% +% inline + \expandafter\def\csname\@varName!e\endcsname{}% + \expandafter\def\csname\@varName!c\endcsname{}% +% display + \expandafter\def\csname\@varName*e\endcsname{}% + \expandafter\def\csname\@varName*c\endcsname{}% +} +\def\rng@makeMinusOneFmtDefns{% +% inline + \expandafter\def\csname\@varName!e\endcsname{-1}% + \expandafter\def\csname\@varName!c\endcsname{-}% +% display + \expandafter\def\csname\@varName*e\endcsname{-1}% + \expandafter\def\csname\@varName*c\endcsname{-}% +} +\def\rng@makeOtherFmtDefns{% +% inline + \expandafter\let\csname\@varName!e\endcsname\inline@TeXfmt + \expandafter\let\csname\@varName!c\endcsname\inline@TeXfmt +% display + \expandafter\let\csname\@varName*e\endcsname\display@TeXfmt + \expandafter\let\csname\@varName*c\endcsname\display@TeXfmt +} +% \end{macrocode} +% +% \subsection{Parse a Number} +% +% \subsubsection{Parsing a Rational} +% +% \begin{macro}{\RNGparseRat} +% \begin{macrocode} +\def\RNGparseRat#1{\expandafter\@chkslash#1//\@nil} +\def\@chkslash#1/#2/#3\@nil{% + \def\rng@num{#1}\def\rng@denom{#2}% + \def\rng@parseQ@iii{#3}% + \ifx\rng@denom\@empty\def\rng@denom{1}\fi +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Parsing a Real} +% +% \begin{macro}{\RNGparseDec} +% The argument \texttt{\#1} is a decimal number (or integer) +% This macro computes: (1) \cs{rng@intpart}; (2) \cs{rng@fracpart}; +% (3) \cs{rndnDec} (the number of decimals of the fractional part); +% (4) \cs{rndPower} (the power of ten determined by \cs{rndnDec}). +% These variables will be overwritten the next time this command +% is executed. +% \begin{macrocode} +\newcommand{\RNGparseDec}[1]{\edef\parse@argi{#1}% + \expandafter\@chkdec\parse@argi..\@nil} +\def\@chkdec#1.#2.#3\@nil{% + \def\rng@intpart{#1}\def\rng@fracpart{#2}% + \def\rng@parseR@iii{#3}\rng@getnDec} +\def\rng@getnDec{% + \begingroup + \ifx\rng@fracpart\@empty\gdef\rndnDec{0}\gdef\rndPower{1}\else + \count0=0\relax\count2=1\relax + \expandafter\cntNumDec\rng@fracpart\end\fi + \endgroup} +\def\cntNumDec#1#2\end{% + \advance\count0by1 + \def\rng@arg{#2}% + \ifx\rng@arg\@empty + \xdef\rndnDec{\the\count0}% + \xdef\rndPower{1\@nameuse{rng@tz\the\count0}}% + \let\rng@next\relax + \else + \def\rng@next{\cntNumDec#2\end}% + \fi\rng@next +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\nDivisionsPowerOfTen} +% This is a control of how many nodes to create in an interval +% of real numbers, as defined by \cs{RandomR}. The argument is +% an integer between 1 and 4 inclusive. +% \begin{macrocode} +\newcommand{\nDivisionsPowerOfTen}[1]{% + \begingroup + \count0=#1\relax + \ifnum\count0>4\relax + \PackageError{rangen}{Number of subdivisions too large}% + {Reduce the argument of \string\nDivisionsPowerOfTen.}% + \else + \ifnum\count0<1\relax + \PackageError{rangen}{Number of subdivisions too large}% + {Increase the argument of \string\nDivisionsPowerOfTen.}% + \fi\fi + \xdef\RNGpowerOfTen{1\@nameuse{rng@tz#1}}% + \endgroup +} +\nDivisionsPowerOfTen{2} +% \end{macrocode} +% \end{macro} +%\subsection{Creating Random Things} +%\subsubsection{Random Integer} +% \begin{macro}{\RandomZ} +% Randomly generates an integer in the specified range of values. +%\begin{verbatim} +%[#1] Optional parameter to modify the variable. +% #2 The random variable being defined, e.g., \a +% #3 lower limit of random integer +% #4 upper limit of random integer +%\end{verbatim} +% \begin{macrocode} +\newcommand\RandomZ[4][] +{% + \def\rng@ne@values{}% + \setkeys{rangen}{ne,#1}% +% \end{macrocode} +% Now see if there is an \texttt{*}, and get un-stripped +% argument. +% +% The \cs{rng@isControl} lets \cs{rng@isC@ntrol} to 0 if the arg is undefined, +% and lets \cs{rng@isC@ntrol} to 1 if it is defined. +% Check the left endpoint: +% \begin{macrocode} + \let\rng@CtrlLEP=0\let\rng@CtrlUEP=0% + \let\rng@makeLEPStrict=0\let\rng@makeUEPStrict=0% +% \end{macrocode} +% \paragraph*{Left endpoint.} +% \begin{macrocode} + \rng@existStar{#3}\rng@NameEndpoint{\rng@LEP}% + \if\rng@isStariii*\edef\tmp@exp{% + \noexpand\rng@isControl{\expandafter\noexpand\rng@LEP}}\tmp@exp + \if\rng@isC@ntrol1% a control sequence + \let\rng@CtrlLEP=1\let\rng@makeLEPStrict=1% +% \end{macrocode} +% The LEP is a control sequence with a star, we need to increment the value +% of \cs{rng@LEP} to the next largest integer. +% \begin{macrocode} + \edef\tmp@exp{\noexpand% + \@getVarType{\expandafter\noexpand\rng@LEP}}\tmp@exp + \ifcase\varType % integer + \rng@cnta=\rng@LEP + \or % rational + \rng@dima=\expandafter\nOf\rng@LEP pt + \divide\rng@dima by\expandafter\dOf\rng@LEP + \defineR{\rng@LEP}{\strip@pt\rng@dima}% + \RNGparseDec{\rng@LEP}% + \rng@cnta=\rng@intpart + \or % real + \defineR{\rng@LEP}{\rng@LEP}% + \RNGparseDec{\rng@LEP}% + \rng@cnta=\rng@intpart + \fi + \advance\rng@cnta by1\relax + \defineZ{\rng@LEP}{\the\rng@cnta}% + \else +% \end{macrocode} +% Not a control sequence but has a star +% \begin{macrocode} + \defineZ{\rng@LEP}{\rng@LEP}% + \fi + \else +% \end{macrocode} +% No star, control sequence or not? +% \begin{macrocode} + \rng@isControl{#3}% + \if\rng@isC@ntrol1% control sequence + \let\rng@CtrlLEP=1% + \def\rng@LEP{#3}% + \@getVarType{#3}% + \ifcase\varType % integer + \defineZ{\rng@LEP}{#3}% + \or % rational + \rng@dima=\nOf{#3}pt + \divide\rng@dima by\dOf{#3}% + \defineR{\rng@LEP}{\strip@pt\rng@dima}% + \RNGparseDec{\rng@LEP}% + \defineZ{\rng@LEP}{\rng@intpart}% + \or % real + \defineR{\rng@LEP}{\rng@LEP}% + \RNGparseDec{\rng@LEP}% + \defineZ{\rng@LEP}{\rng@intpart}% + \fi + \else +% \end{macrocode} +% A number, no star +% \begin{macrocode} + \defineZ{\rng@LEP}{#3}% + \fi + \fi +% \end{macrocode} +% \paragraph*{Right endpoint.} +% \begin{macrocode} + \rng@existStar{#4}\rng@NameEndpoint{\rng@UEP}% + \if\rng@isStariii*\edef\tmp@exp{% + \noexpand\rng@isControl{\expandafter\noexpand\rng@UEP}}\tmp@exp + \if\rng@isC@ntrol1% a control sequence + \let\rng@CtrlUEP=1\let\rng@makeUEPStrict=1% +% \end{macrocode} +% The UEP is a control sequence with a star, we need to increment the value +% of \cs{rng@UEP} to the next largest integer. +% \begin{macrocode} + \edef\tmp@exp{\noexpand% + \@getVarType{\expandafter\noexpand\rng@UEP}}\tmp@exp + \ifcase\varType % integer + \rng@cnta=\rng@UEP + \or % rational + \rng@dima=\expandafter\nOf\rng@UEP pt + \divide\rng@dima by\expandafter\dOf\rng@UEP + \defineR{\rng@UEP}{\strip@pt\rng@dima}% + \RNGparseDec{\rng@UEP}% + \rng@cnta=\rng@intpart + \or % real + \defineR{\rng@UEP}{\rng@UEP}% + \RNGparseDec{\rng@UEP}% + \rng@cnta=\rng@intpart + \fi + \advance\rng@cnta by-1\relax + \defineZ{\rng@UEP}{\the\rng@cnta}% + \else +% \end{macrocode} +% Not a control sequence but has a star +% \begin{macrocode} + \defineZ{\rng@UEP}{\rng@UEP}% + \fi + \else +% \end{macrocode} +% No star, control sequence or not? +% \begin{macrocode} + \rng@isControl{#4}% + \if\rng@isC@ntrol1% control sequence + \let\rng@CtrlUEP=1% + \def\rng@UEP{#4}% + \@getVarType{#4}% + \ifcase\varType % integer + \defineZ{\rng@UEP}{#4}% + \or % rational + \rng@dima=\nOf{#4}pt + \divide\rng@dima by\dOf{#4}% + \defineR{\rng@UEP}{\strip@pt\rng@dima}% + \RNGparseDec{\rng@UEP}% + \defineZ{\rng@UEP}{\rng@intpart}% + \or % real + \defineR{\rng@UEP}{\rng@UEP}% + \RNGparseDec{\rng@UEP}% + \defineZ{\rng@UEP}{\rng@intpart}% + \fi + \else +% \end{macrocode} +% A number, no star, assume it is an integer +% \begin{macrocode} + \defineZ{\rng@UEP}{#4}% + \fi + \fi +% \end{macrocode} +% \textbf{To Do.} Check if LEP is less than UEP, if not, notify user. +% Save the random variable, e.g., \cs{a} +% \begin{macrocode} + \def\@currentName{#2}% +% \end{macrocode} +% Record the variable type +% \begin{macrocode} + \@getVarName{#2}% + \expandafter\def\csname typeof@\@varName\endcsname{0}% +% \end{macrocode} +% Save the range of this variable +% \begin{macrocode} + \expandafter\edef\csname first@\@varName\endcsname{\rng@LEP}% + \expandafter\edef\csname last@\@varName\endcsname{\rng@UEP}% +% \end{macrocode} +% Now get a value for the variable using \cs{rand}, defined in \texttt{lcg} +% \begin{macrocode} + \rng@chgrand[first=\rng@LEP,last=\rng@UEP]\rand +% \end{macrocode} +% Now define the integer. +% \begin{macrocode} + \defineZ{#2}{\arabic{rand}}% +% \end{macrocode} +% \paragraph*{Constraints} +% We have a random Z, we now try to satisfy the \texttt{ne} condition. +% +% The macro \cs{rangen@ne} can be of the form \verb!{1,3,4,5}!. We try to +% satisfy all the conditions specified by \cs{rangen@ne} +% \begin{macrocode} + \ifx\rangen@ne\@empty\else\loopCnt=0\relax +% \end{macrocode} +% We will try a total number of \cs{maxLoopLimit} to meet the required +% conditions. +% \begin{macrocode} + \@whilenum\loopCnt<\maxLoopLimit\do{% +% \end{macrocode} +% Set \cs{rng@cnta=1}, if \cs{rng@cnta} is still 1 at the end of this +% loop, the condition is satisfied. +% conditions. +% \begin{macrocode} + \rng@cnta=1\relax +% \end{macrocode} +% We use a \cs{@for} loop to run through all the NE values +% \begin{macrocode} + \@for\ne@@tmp:=\rangen@ne\do{% +% \end{macrocode} +% If the current RV is equal to the current NE value, we fail, so we +% ``and'' a zero into the \cs{rng@cnta} register. +% \begin{macrocode} + \ifnum\value{rand}=\ne@@tmp\relax + \multiply\rng@cnta0\relax + \else +% \end{macrocode} +% \dots otherwise, we ``and'' a one. +% \begin{macrocode} + \multiply\rng@cnta1\relax + \fi + }% +% \end{macrocode} +% If \cs{rng@cnt} is still equal to 1, all conditions have been met, +% in this case we set \verb!\loopCnt=\maxLoopLimit! so we can exit the outer loop. +% \begin{macrocode} + \ifnum\rng@cnta=1\relax % all conditions met + \loopCnt=\maxLoopLimit + \else % if \rng@cnta \ne 1, try again +% \end{macrocode} +% Otherwise, we increment the loop, see if we have gone the limit, if +% not, loop back with a new random choice. +% \begin{macrocode} + \advance\loopCnt1\relax + \ifnum\loopCnt=\maxLoopLimit + \PackageWarning{rangen}{Not all conditions met + after \maxLoopLimit\space tries}% + \else + \rng@chgrand[first=\rng@LEP,last=\rng@UEP]\rand + \fi + \fi + }% + \fi +% \end{macrocode} +% Whether we fail or succeed, we'll go with the last RV. Hopefully, the +% author is aware of the log file, and re-compile, possibly with a +% wider range for the variable, or with a larger value of \cs{maxLoopLimit}. +% +% \begin{macrocode} + \defineZ{#2}{\arabic{rand}}% +} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\def\updateZ#1#2{% + \@getVarName#1\relax + \expandafter\edef\csname\@varName\endcsname{#2}% + \expandafter\edef\csname n@\@varName\endcsname{#2}% + \expandafter\edef\csname d@\@varName\endcsname{1}% +} +% \end{macrocode} +%\subsubsection{Random Rational} +% \begin{macro}{\RandomQ} +% Randomly generate a rational number. The parameters for \cs{RandomQ} are +%\begin{verbatim} +%[#1] Optional parameter to modify the variable. +% #2 The random variable being defined, e.g., \a +%[#3] maximum denominator permitted (optional) +% #4 rational number for lower endpoint of range +% #5 rational number for upper endpoint of range +%\end{verbatim} +% Here, it is assume that the first rational number is less than the second. This macro +% will randomly generate a rational number between rat1 and rat2, with a maximum denominator +% specified in \texttt{\#3}. +% +% \medskip\noindent\textbf{Note: }To allow for random endpoints, if one or both are real numbers, we convert +% them to rational numbers in \cs{@RandomQ}. +% +% We begin by getting the first two parameters: +%\begin{verbatim} +%[#1] Optional parameter to modify the variable. +% #2 The random variable being defined, e.g., \a +%\end{verbatim} +% \begin{macrocode} +\newcommand{\RandomQ}[2][] +{% + \setkeys{rangen}{ne,#1}% + \def\rq@currentName{#2}% + \@RandomQ +} +% \end{macrocode} +% We use \cs{@RandomQ} to get the last three parameters of \cs{RandomQ}. +% If the endpoints are not rational, they are converted to rationals. +%\begin{verbatim} +%[#1] maximum denominator permitted (optional) +% #2 rational number for lower endpoint of range +% #3 rational number for upper endpoint of range +%\end{verbatim} +% \begin{macrocode} +\newcommand{\@RandomQ}[3][] +{% +% \end{macrocode} +% Now see if there is an \texttt{*}, and get un-stripped +% argument. +% +% The \cs{rng@isControl} lets \cs{rng@isC@ntrol} to 0 if the arg is undefined, +% and lets \cs{rng@isC@ntrol} to 1 if it is defined. +% Check the left endpoint: +% \begin{macrocode} + \let\rng@CtrlLEP=0\let\rng@CtrlUEP=0% + \let\rng@makeLEPStrict=0\let\rng@makeUEPStrict=0% +% \end{macrocode} +% \paragraph*{Left endpoint} +% \begin{macrocode} + \rng@existStar{#2}\rng@NameEndpoint{\rng@LEP}% + \if\rng@isStariii*\edef\tmp@exp{\noexpand% + \rng@isControl{\expandafter\noexpand\rng@LEP}}\tmp@exp + \if\rng@isC@ntrol1% a control sequence + \let\rng@CtrlLEP=1\let\rng@makeLEPStrict=1% +% \end{macrocode} +% The LEP is a control sequence we get its type and convert to rational +% \begin{macrocode} + \edef\tmp@exp{\noexpand% + \@getVarType{\expandafter\noexpand\rng@LEP}}\tmp@exp + \ifcase\varType % integer + \defineQ{\rng@LEP}{\rng@LEP}{1}% + \or % rational + \edef\tmp@exp{\noexpand% + \defineQ{\noexpand\rng@LEP}{\expandafter\nOf\rng@LEP}% + {\expandafter\dOf\rng@LEP}}\tmp@exp + \or % real + \defineR{\rng@LEP}{\rng@LEP}% + \RNGparseDec{\rng@LEP}% + \defineQ{\rng@LEP}{\rng@intpart}{\rng@fracpart}% + \fi + \else +% \end{macrocode} +% Not a control sequence but has a star, a number, we assume rational +% \begin{macrocode} + \RNGparseRat{\rng@LEP}% + \defineQ{\rng@UEP}{\rng@intpart}{\rng@fracpart}% + \fi + \else +% \end{macrocode} +% No star, is it a control sequence or not? +% \begin{macrocode} + \rng@isControl{#2}% + \if\rng@isC@ntrol1% a control sequence + \@getVarType{#2}% + \ifcase\varType % integer + \defineQ{\rng@LEP}{#2}{1}% + \or % rational + \defineQ{\rng@LEP}{\nOf{#2}}{\dOf{#2}}% + \or % real + \defineR{\rng@LEP}{#2}% + \RNGparseDec{\rng@LEP}% + \defineQ{\rng@LEP}{\rng@intpart}{\rng@fracpart}% + \fi + \else % a number, required to be rational + \RNGparseRat{#2}% + \defineQ{\rng@LEP}{\rng@num}{\rng@denom}% + \fi + \fi +% \end{macrocode} +% \paragraph*{Right endpoint} +% \begin{macrocode} + \rng@existStar{#3}\rng@NameEndpoint{\rng@UEP}%% + \if\rng@isStariii*% + \edef\tmp@exp{\noexpand% + \rng@isControl{\expandafter\noexpand\rng@UEP}}\tmp@exp + \if\rng@isC@ntrol1% a control sequence + \let\rng@CtrlUEP=1\let\rng@makeUEPStrict=1% +% \end{macrocode} +% The UEP is a control sequence we get its type and convert to rational +% \begin{macrocode} + \edef\tmp@exp{\noexpand% + \@getVarType{\expandafter\noexpand\rng@UEP}}\tmp@exp + \ifcase\varType % integer + \defineQ{\rng@UEP}{\rng@UEP}{1}% + \or % rational + \edef\tmp@exp{\noexpand% + \defineQ{\noexpand\rng@UEP}{\expandafter\nOf\rng@UEP}% + {\expandafter\dOf\rng@UEP}}\tmp@exp + \or % real + \defineR{\rng@UEP}{\rng@UEP}% + \RNGparseDec{\rng@UEP}% + \defineQ{\rng@UEP}{\rng@intpart}{\rng@fracpart}% + \fi + \else +% \end{macrocode} +% Not a control sequence but has a star, a number, we assume rational +% \begin{macrocode} + \RNGparseRat{\rng@UEP}% + \defineQ{\rng@UEP}{\rng@intpart}{\rng@fracpart}% + \fi + \else +% \end{macrocode} +% No star, is it a control sequence or not? +% \begin{macrocode} + \rng@isControl{#3}% + \if\rng@isC@ntrol1% a control sequence + \@getVarType{#3}% + \ifcase\varType % integer + \defineQ{\rng@UEP}{#3}{1}% + \or % rational + \defineQ{\rng@UEP}{\nOf{#3}}{\dOf{#3}}% + \or % real + \defineR{\rng@UEP}{#3}% + \RNGparseDec{\rng@UEP}% + \defineQ{\rng@UEP}{\rng@intpart}{\rng@fracpart}% + \fi + \else % a number, required to be rational + \RNGparseRat{#3}% + \defineQ{\rng@UEP}{\rng@num}{\rng@denom}% + \fi + \fi + \@@RandomQ{#1}{\nOf{\rng@LEP}}{\dOf{\rng@LEP}}% + {\nOf{\rng@UEP}}{\dOf{\rng@UEP}}% +} +% \end{macrocode} +% Once all the parameters have been acquired, and +% any needed conversions are made, we call \cs{@@RandomQ} which +% actually generates the random rational. +%\begin{verbatim} +% #1 maximum denominator permitted +% #2 numerator of first rational +% #3 denominator of first rational +% #4 numerator of second rational +% #5 denominator of second rational +%\end{verbatim} +% \begin{macrocode} +\newcommand{\@@RandomQ}[5] +{% +% \end{macrocode} +% Now take parameters \texttt{\#2}--\texttt{\#5}, and make into two rationals +% \begin{macrocode} + \updateQ\@rqi{#2}{#3}\updateQ\@rqii{#4}{#5}% +% \end{macrocode} +% Find least common multiple between \texttt{\#3}, \texttt{\#5} and \texttt{\#1} +% \begin{macrocode} + \lcm{#3}{#5}\edef\@thelcm{\thelcm}% + \def\@maxDenom{#1}% + \ifx\@maxDenom\@empty\edef\@maxDenom{\@thelcm}\else + \lcm{\@thelcm}{#1}\edef\@thelcm{\thelcm}\fi +% \end{macrocode} +% Now convert all rationals to have a denominator of \cs{@thelcm} +% \begin{macrocode} + \convertRatTo{\nOf\@rqi}{\dOf\@rqi}{\@thelcm}% + \updateQ\@@rqi{\rng@retn@num}{\@thelcm}% + \convertRatTo{\nOf\@rqii}{\dOf\@rqii}{\@thelcm}% + \updateQ\@@rqii{\rng@retn@num}{\@thelcm}% +% \end{macrocode} +% get divisor +% \begin{macrocode} + \rng@cnta=\@thelcm \divide\rng@cnta by\@maxDenom + \edef\@divisor{\the\rng@cnta}% +% \end{macrocode} +% Round up lower limit +% \begin{macrocode} + \rng@cnta=\nOf\@@rqi + \divide\rng@cnta by\@divisor + \advance\rng@cnta by1 +% \end{macrocode} +% Round down the upper limit +% \begin{macrocode} + \rng@cntb=\nOf\@@rqii\divide\rng@cntb by\@divisor +% \end{macrocode} +% If a strict inequality is requested, we creep in a little. +% \begin{macrocode} + \if\rng@makeLEPStrict1\advance\rng@cnta1\relax\fi + \if\rng@makeUEPStrict1\advance\rng@cntb-1\relax\fi +% \end{macrocode} +% construct numerator +% \begin{macrocode} + \expandafter\@getVarName\rq@currentName + \let\save@varName\@varName + \expandafter\edef\csname first@n@\@varName\endcsname{\the\rng@cnta}% + \expandafter\edef\csname last@n@\@varName\endcsname{\the\rng@cntb}% + \expandafter\edef\csname first@d@\@varName\endcsname{\@maxDenom}% + \expandafter\edef\csname last@d@\@varName\endcsname{\@maxDenom}% + \edef\rng@LEP{\csname first@n@\@varName\endcsname}% + \edef\rng@UEP{\csname last@n@\@varName\endcsname}% +%\typeout{\@varName: first=\rng@LEP,last=\rng@UEP}% + \rng@chgrand[first=\rng@LEP,last=\rng@UEP]\rand +% \end{macrocode} +% Record the random variable name, e.g., \cs{a}, ... +% \begin{macrocode} + \let\@currentName\rq@currentName + \expandafter\@getVarName\rq@currentName + \expandafter\defineQ\@currentName{\arabic{rand}}{\@maxDenom}% + \simplifyCurrentQ + \expandafter\defineQ\@currentName{\expandafter\nOf\@currentName}% + {\expandafter\dOf\@currentName}% +% \end{macrocode} +% +% \paragraph*{Constraints} +% +% We now attempt to satisfy the NE constraints. +% \begin{macrocode} + \ifx\rangen@ne\@empty\else\loopCnt=0\relax + \@whilenum\loopCnt<\maxLoopLimit\do{% + \rng@cnta=1\relax + \@for\ne@@tmp:=\rangen@ne\do{% +% \end{macrocode} +% Define a rational by the name of \cs{cmp@Name}, then make it have +% the same denominator as \cs{@currentName}. +% \begin{macrocode} + \let\save@currentName\rq@currentName + \RNGparseRat{\ne@@tmp}% + \defineQ{\cmp@Name}{\rng@num}{\rng@denom}% + \let\@varName\save@varName + \syncronizeQs{\@varName}% + \ifnum\csname n@\@varName\endcsname=\n@cmp@Name + \multiply\rng@cnta0\relax + \else + \multiply\rng@cnta1\relax + \fi + }% + \ifnum\rng@cnta=1\relax % all conditions met + \loopCnt=\maxLoopLimit + \else % if \rng@cnta \ne 1, try again + \advance\loopCnt1\relax + \ifnum\loopCnt=\maxLoopLimit + \PackageWarning{rangen}{Not all conditions met + after \maxLoopLimit\space tries}% + \else + \rng@chgrand[first=\rng@LEP,last=\rng@UEP]\rand + \expandafter\@getVarName\rq@currentName + \expandafter\defineQ\@currentName{\arabic{rand}}% + {\@maxDenom}% + \fi + \fi + }% + \fi + \simplifyCurrentQ + \expandafter\defineQ\@currentName{\expandafter\nOf\@currentName}% + {\expandafter\dOf\@currentName}% +% \end{macrocode} +% If the denominator is equal to 1, let's change the data type to an integer. +% \begin{macrocode} + \let\@currentName\rq@currentName + \expandafter\@getVarName\rq@currentName + \ifnum\csname d@\@varName\endcsname=1\relax\expandafter + \defineZ\@currentName{\expandafter\nOf\@currentName}% + \fi + \simplifyCurrentQ +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\updateQ} +% Updates the value of a rational number, its numerator and denominator +% without changing any of the format macros. +% \begin{macrocode} +\newcommand\updateQ[3] +{% + \@getVarName#1\relax + \expandafter\edef\csname\@varName\endcsname{#2/#3}% + \expandafter\edef\csname n@\@varName\endcsname{#2}% + \expandafter\edef\csname d@\@varName\endcsname{#3}% +} +% \end{macrocode} +% \end{macro} +% A macro for performing routine adjustments on a rational number. +% \begin{macrocode} +\def\simplifyCurrentQ +{% +% \end{macrocode} +% Reduce fraction: Reduce the fraction to its lowest terms. +% \begin{macrocode} + \reduceFrac{\csname n@\@varName\endcsname}% + {\csname d@\@varName\endcsname}% +% \end{macrocode} +% \cs{reduceFrac} returns results in \cs{@tempcnta} and \cs{@tempcntb}, now +% update the numerator and denominator +% \begin{macrocode} + \expandafter\edef\csname n@\@varName\endcsname{\rfNumer}% + \expandafter\edef\csname d@\@varName\endcsname{\rfDenom}% +% \end{macrocode} +% If the numerator is zero, then zero out \cs{@varName} and special format +% \begin{macrocode} + \ifnum\csname n@\@varName\endcsname=0 + \expandafter\edef\csname\@varName\endcsname{0}% + \edef\display@TeXfmt{0}\edef\inline@TeXfmt{0}% + \else +% \end{macrocode} +% If numerator equals denominator, just replace by 1 +% \begin{macrocode} + \ifnum\csname n@\@varName\endcsname=\csname d@\@varName\endcsname + \expandafter\defineZ\csname\@varName\endcsname{1}% + \else +% \end{macrocode} +% If numerator equals -denominator, just replace by -1 +% \begin{macrocode} + \ifnum\csname n@\@varName\endcsname + =-\csname d@\@varName\endcsname + \expandafter\defineZ\csname\@varName\endcsname{-1}% + \else +% \end{macrocode} +% If denominator equals 1, modify value; otherwise, ok. +% \begin{macrocode} + \ifnum\csname d@\@varName\endcsname=1 + \expandafter\defineZ\csname\@varName\endcsname + {\csname n@\@varName\endcsname}% + \else + \expandafter\edef\csname \@varName\endcsname{% + \csname n@\@varName\endcsname/% + \csname d@\@varName\endcsname}% + \edef\display@TeXfmt{% + \frac{\csname n@\@varName\endcsname} + {\csname d@\@varName\endcsname}}% + \edef\inline@TeXfmt{% + \csname n@\@varName\endcsname/% + \csname d@\@varName\endcsname}% + \expandafter\let + \csname\@varName*\endcsname\display@TeXfmt + \fi + \fi + \fi + \fi +} +% \end{macrocode} +% \begin{macro}{\nOf} +% \begin{macro}{\dOf} +% \begin{macro}{\iOf} +% \begin{macro}{\typeOf} +% User access to numerator and denominator of random variables. +% \begin{macrocode} +\newcommand\nOf[1]{\csname n@\expandafter\@gobble\string#1\endcsname} +\newcommand\dOf[1]{\csname d@\expandafter\@gobble\string#1\endcsname} +% \end{macrocode} +% For a variable created by \cs{RandomL}, the index of the number chosen (1-based) +% can be accessed through the \cs{iOf} command. +% \begin{macrocode} +\newcommand{\iOf}[1]{\csname i@\expandafter\@gobble\string#1\endcsname} +% \end{macrocode} +% Get the type of a RV, \cs{ifnum}\cs{typeOf}\cs{a}=0 (integer), 1 (rational), 2 (real), +% 3 (literal, created by \cs{RandomP}). +% \begin{macrocode} +\newcommand\typeOf[1]{% + \csname typeof@\expandafter\@gobble\string#1\endcsname} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +%\subsubsection{Random Real} +% +% We attempt to generate a random real number, in a given interval of real numbers. +% +% The following are some data and switches used by \cs{RandomReal}. +% \begin{macrocode} +\newif\iftrailingzeros\trailingzerosfalse +\@namedef{rng@tz1}{0} +\@namedef{rng@tz2}{00} +\@namedef{rng@tz3}{000} +\@namedef{rng@tz4}{0000} +\@namedef{rng@tz5}{00000} +\@namedef{rng@tz6}{000000} +\@namedef{rng@tz7}{0000000} +\@namedef{rng@tz8}{00000000} +\def\rng@true{true}\def\rng@false{false} +\newdimen\rng@dima +\newdimen\rng@dimb +\newdimen\rng@dimc +% \end{macrocode} +% \begin{macro}{\RandomR} +% Create a real number at random within the given interval. For example, +%\begin{verbatim} +% \RandomR[]{\a}{3.45}{6.45} +%\end{verbatim} +% \begin{macro}{round} +% \begin{macro}{showzeros} +% The key-value pairs recognized by \cs{RandomZ|Q|R}. +% \begin{macrocode} +\define@key{rangen}{ne}[]{\edef\rangen@ne{#1}} +\define@key{rangen}{round}[]{\def\rangen@round{#1}} +\define@key{rangen}{showzeros}[]{\def\rangen@showzeros{#1}% + \ifx\rangen@showzeros\@empty\global\trailingzerostrue\else + \ifx\rangen@showzeros\rng@true\global\trailingzerostrue\else + \global\trailingzerosfalse\fi\fi} +\define@key{rangen}{index}[]{\edef\rangen@index{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +%\begin{verbatim} +%[#1] = options +% #2 = name of real to correct +% #3 = lower endpoint of interval +% #4 = upper endpoint of interval +%\end{verbatim} +% \begin{macrocode} +\newcommand{\RandomR}[4][]{% + \setkeys{rangen}{ne,round,showzeros=false,#1}% +% \end{macrocode} +% Now see if there is an \texttt{*}, and get un-stripped +% argument. +% +% The \cs{rng@isControl} lets \cs{rng@isC@ntrol} to 0 if the arg is undefined, +% and lets \cs{rng@isC@ntrol} to 1 if it is defined. +% Check the left endpoint: +% \begin{macrocode} + \let\rng@CtrlLEP=0\let\rng@CtrlUEP=0% + \let\rng@makeLEPStrict=0\let\rng@makeUEPStrict=0% + \def\rng@lcg@first{0}\edef\rng@lcg@last{\RNGpowerOfTen}% +% \end{macrocode} +% \paragraph{Left endpoint.} Check the left endpoint: +% \begin{macrocode} + \rng@existStar{#3}\rng@NameEndpoint{\rng@LEP}% + \if\rng@isStariii*\edef\tmp@exp{\noexpand% + \rng@isControl{\expandafter\noexpand\rng@LEP}}\tmp@exp + \if\rng@isC@ntrol1% a control sequence + \let\rng@CtrlLEP=1\let\rng@makeLEPStrict=1% + \def\rng@lcg@first{1}% +% \end{macrocode} +% The LEP is a control sequence with a star. Convert LEP to a real +% number as needed. +% \begin{macrocode} + \edef\tmp@exp{\noexpand% + \@getVarType{\expandafter\noexpand\rng@LEP}}\tmp@exp + \ifcase\varType % integer + \defineR{\rng@LEP}{\rng@LEP\RNG@Dec}% + \or % rational + \rng@dima=\expandafter\nOf\rng@LEP pt + \divide\rng@dima by\expandafter\dOf\rng@LEP + \defineR{\rng@LEP}{\strip@pt\rng@dima}% + \or % real + \defineR{\rng@LEP}{\rng@LEP}% + \fi +% \end{macrocode} +% Not a control sequence, but has a star +% \begin{macrocode} + \else + \defineR{\rng@LEP}{\rng@LEP}% + \fi + \else +% \end{macrocode} +% No star, control sequence or not? +% \begin{macrocode} + \rng@isControl{#3}% + \if\rng@isC@ntrol1% control sequence + \let\rng@CtrlLEP=1\def\rng@LEP{#3}% + \@getVarType{#3}% + \ifcase\varType % integer + \defineR{\rng@LEP}{\rng@LEP\RNG@Dec}% + \or % rational + \rng@dima=\nOf{#3}pt + \divide\rng@dima by\dOf{#3}% + \defineR{\rng@LEP}{\strip@pt\rng@dima}% + \or % real + \defineR{\rng@LEP}{\rng@LEP}% + \fi + \else +% \end{macrocode} +% A number, no star, number is required to be real +% \begin{macrocode} + \defineR{\rng@LEP}{#3}% + \fi + \fi +% \end{macrocode} +% \paragraph{Right endpoint.} Check the right endpoint: +% \begin{macrocode} + \rng@existStar{#4}\rng@NameEndpoint{\rng@UEP}% + \if\rng@isStariii*\edef\tmp@exp{\noexpand% + \rng@isControl{\expandafter\noexpand\rng@UEP}}\tmp@exp + \if\rng@isC@ntrol1% a control sequence + \let\rng@CtrlUEP=1\let\rng@makeUEPStrict=1% + \rng@cnta=\rng@lcg@last\advance\rng@cnta-1\relax + \edef\rng@lcg@last{\the\rng@cnta}% +% \end{macrocode} +% The UEP is a control sequence with a star. Convert UEP to a real +% number as needed. +% \begin{macrocode} + \edef\tmp@exp{\noexpand% + \@getVarType{\expandafter\noexpand\rng@UEP}}\tmp@exp + \ifcase\varType % integer + \defineR{\rng@UEP}{\rng@UEP\RNG@Dec}% + \or % rational + \rng@dima=\expandafter\nOf\rng@UEP pt + \divide\rng@dima by\expandafter\dOf\rng@UEP + \defineR{\rng@UEP}{\strip@pt\rng@dima}% + \or % real + \defineR{\rng@UEP}{\rng@UEP}% + \fi +% \end{macrocode} +% Not a control sequence, but has a star +% \begin{macrocode} + \else + \defineR{\rng@UEP}{\rng@UEP}% + \fi + \else +% \end{macrocode} +% No star, control sequence or not? +% \begin{macrocode} + \rng@isControl{#4}% + \if\rng@isC@ntrol1% control sequence + \let\rng@CtrlUEP=1\def\rng@UEP{#4}% + \@getVarType{#4}% + \ifcase\varType % integer + \defineR{\rng@UEP}{\rng@UEP\RNG@Dec}% + \or % rational + \rng@dima=\nOf{#4}pt + \divide\rng@dima by\dOf{#4}% + \defineR{\rng@UEP}{\strip@pt\rng@dima}% + \or % real + \defineR{\rng@UEP}{\rng@UEP}% + \fi + \else +% \end{macrocode} +% A number, no star, number is required to be real +% \begin{macrocode} + \defineR{\rng@UEP}{#4}% + \fi + \fi +% \end{macrocode} +% Prepare to generate the random real +% \begin{macrocode} + \def\@currentName{#2}\@getVarName{#2}% +% \end{macrocode} +% Save upper and lower endpoints where they are expected to be. +% \begin{macrocode} + \expandafter\edef\csname first@\@varName\endcsname{\rng@LEP}% + \expandafter\edef\csname last@\@varName\endcsname{\rng@UEP}% +% \end{macrocode} +% Get a random real, and declare it to be a real number using \cs{defineR}. +% \begin{macrocode} + \rng@getRandomR + \defineR{#2}{\strip@pt\rng@dima}% +% \end{macrocode} +% Round and remove trailing zeros. +% \begin{macrocode} + \ifx\rangen@round\@empty\else + \RNGround{#2}{#2}{\rangen@round}% + \rng@dima=#2pt\relax + \defineR{#2}{\strip@pt\rng@dima}% + \fi +% \end{macrocode} +% \paragraph{Constraints.} Let's try to apply constraints. We only allow one constraint. +% \begin{macrocode} + \ifx\rangen@ne\@empty\else\loopCnt=0\relax + \@whilenum\loopCnt<\maxLoopLimit\do{% + \rng@cnta=1\relax + \@for\ne@@tmp:=\rangen@ne\do{% + \rng@dima=#2pt + \ifdim\rng@dima=\ne@@tmp pt\relax + \multiply\rng@cnta0\relax\else + \multiply\rng@cnta1\relax\fi + }% + \ifnum\rng@cnta=1\relax % all conditions met + \loopCnt=\maxLoopLimit + \else % if \rng@cnta \ne 1, try again + \advance\loopCnt1\relax + \ifnum\loopCnt=\maxLoopLimit + \PackageWarning{rangen}{Not all conditions met + after \maxLoopLimit\space tries}% + \else + \rng@getRandomR + \defineR{#2}{\strip@pt\rng@dima}% +% \end{macrocode} +% Round and remove trailing zeros. +% \begin{macrocode} + \ifx\rangen@round\@empty\else + \RNGround{#2}{#2}{\rangen@round}% + \rng@dima=#2pt\relax + \defineR{#2}{\strip@pt\rng@dima}% + \fi + \fi + \fi + }% + \fi +% \end{macrocode} +% \paragraph{Formatting.} Begin formatting of the real, keys recognized are +% \texttt{round} and \texttt{showzeros}. +% \begin{macrocode} + \rnd@ProcessRealFormat{#2}% +% \end{macrocode} +% We declare our number. +% \begin{macrocode} + \def\@currentName{#2}% + \defineR{#2}{#2}% +} +% \end{macrocode} +% Get a new random real and return it in the \cs{rng@dima} +% \begin{macrocode} +\def\rng@getRandomR{% +% \end{macrocode} +% Put the endpoints in dimension registers so we can subtract them. +% \begin{macrocode} + \rng@dima=\rng@LEP pt + \rng@dimb=\rng@UEP pt +% \end{macrocode} +% Compute the difference between upper and lower, then strip off the \texttt{pt}, +% to make it a decimal number. +% \begin{macrocode} + \advance\rng@dimb-\rng@dima +% \edef\r@getDiff{\strip@pt\rng@dimb}% +% \end{macrocode} +% Get a random integer from the interval 0 to \cs{RNGpowerOfTen}. +% the default value of the latter command is 100, and it can be changed +% using \cs{nDivisionsPowerOfTen}. The idea is to divide the interval +% from the lower bound to the upper bound into \cs{RNGpowerOfTen} nodes, +% and we choose one of these nodes are random. +% +% If the endpoints where strict, then we changed \cs{rng@lcg@first} +% from 0 to 1 (if the lower endpoint is strict); and changed +% \cs{rng@lcg@last} from \cs{RNGpowerOfTen} to \texttt{\string\RNGpowerOfTen-1} +% (if the upper end point is strict). +% \begin{macrocode} + \rng@chgrand[first=\rng@lcg@first,last=\rng@lcg@last]\rand +% \end{macrocode} +% Divide the length of the interval by \cs{RNGpowerOfTen}, +% and store the result in \cs{rng@dimb}, then multiply +% that by \verb!\arabic{rand}!. +% \begin{macrocode} + \divide\rng@dimb by\RNGpowerOfTen\relax + \rng@dimb=\arabic{rand}\rng@dimb +% \end{macrocode} +% Finally, the left-end point is still in \cs{rng@dima} +% we add the result in \cs{rng@dimb} to \cs{rng@dima} +% to compute our random rational. +% \begin{macrocode} + \advance\rng@dima by\rng@dimb +} +\def\rnd@ProcessRealFormat#1{% + \ifx\rangen@round\@empty + \rng@dima=#1pt\relax + \defineR{#1}{\strip@pt\rng@dima}% + \else + \RNGround{#1}{#1}{\rangen@round}% + \rng@dima=#1pt\relax + \defineR{#1}{\strip@pt\rng@dima}% + \iftrailingzeros + {\RNGparseDec{#1}\count0=\decPls\relax + \advance\count0-\rndnDec\relax + \ifnum\count0>0\relax\xdef#1{% + \rng@intpart\RNG@Dec\rng@fracpart% +\@nameuse{rng@tz\the\count0}}% + \fi}% + \defineR{#1}{#1}% + \fi + \fi +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Random Sign} +% \begin{macro}{\RandomS} +% We randomly generate a \texttt{+} or \texttt{-} sign +% for addition and subtraction. The first optional argument +% is a rational number between 0 and 1. The default is \texttt{1/2}. +% This number represents the probably of a \texttt{+} sign. +% \begin{macrocode} +\newcommand{\RandomS}[2][1/2]{% + \RNGparseRat{#1}% + \ifnum\rng@num<0\relax + \PackageError{rangen}{A positive numerator is required}% + {The rational number must be between 0 and 1}\fi + \ifnum\rng@denom<0\relax + \PackageError{rangen}{A positive denominator is required}% + {The rational number must be between 0 and 1}\fi + \ifnum\rng@num>\rng@denom\relax + \PackageError{rangen}{The rational must be between 0 and 1}% + {The rational number must be between 0 and 1}\fi + \rng@chgrand[first=1,last=\rng@denom]\rand + \@getVarName{#2}% + \ifnum\value{rand}>\rng@num\relax\def#2{-}% + \rng@makeMinusOneFmtDefns + \def\display@TeXfmt{-}\def\inline@TeXfmt{-}% + \else\def#2{+}\rng@makeOneFmtDefns + \def\display@TeXfmt{}\def\inline@TeXfmt{}\fi + \expandafter\let\csname\@varName*\endcsname\display@TeXfmt + \expandafter\let\csname\@varName!\endcsname\inline@TeXfmt +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Random Number from a List} +% +% \begin{macro}{\RandomL} +% Select a number of any type from a comma-delimited list. +%\begin{verbatim} +% \RandomL[key-values]{\RV}{} +%\end{verbatim} +% Currently, the only key recognized is the \texttt{index} key. +% If the \texttt{index} key is specified, the number whose index is specified +% is retrieved from the list. +% \begin{macrocode} +\newcommand{\RandomL}[3][]{% + \let\rangen@index\@empty + \setkeys{rangen}{#1}% + \rng@cnta=0\relax\@for\@@tmp:=#3\do{% + \advance\rng@cnta1\relax}\edef\n@rng@listItems{\the\rng@cnta}% + \ifx\rangen@index\@empty + \rng@chgrand[first=1,last=\n@rng@listItems]\rand + \else + \rng@cnta=\rangen@index + \advance\rng@cnta-1\relax + \amodb{\rng@cnta}{\n@rng@listItems}% + \rng@cnta=\retnmod + \advance\rng@cnta1\relax + \value{rand}=\rng@cnta + \fi + \@getVarName{#2}% + \expandafter\edef\csname i@\@varName\endcsname{\arabic{rand}}% + \rng@cnta=0\relax\@for\@@tmp:=#3\do{% + \advance\rng@cnta1\relax\ifnum\rng@cnta=\arabic{rand}% + \edef\rng@choice{\@@tmp}\fi}% + \def\@currentName{#2}% +% \end{macrocode} +% Now, determine the type of this choice, and make appropriate +% data type definition. +% \begin{macrocode} + \RNGparseDec{\rng@choice}% + \if\rng@parseR@iii\RNG@Dec\defineR{#2}{\rng@choice}% + \else\RNGparseRat{\rng@choice}% + \if\rng@parseQ@iii/\defineQ{#2}{\rng@num}{\rng@denom}% + \else\defineZ{#2}{\rng@choice}\fi\fi +} +% \end{macrocode} +% \end{macro} + +% \subsubsection{Random Problem from a List} +% +% \begin{macro}{\RandomP} +% Select a literal from a comma-delimited list of literals. +%\begin{verbatim} +% \RandomP[key-values]{\RV}{} +%\end{verbatim} +% Currently, the only key recognized is the \texttt{index} key. +% If the \texttt{index} key is specified, the number whose index is specified +% is retrieved from the list. +% \begin{macrocode} +\newcommand{\RandomP}[3][]{% + \let\rangen@index\@empty + \setkeys{rangen}{#1}% + \rng@cnta=0\relax\@for\@@tmp:=#3\do{% + \advance\rng@cnta1\relax}\edef\n@rng@listItems{\the\rng@cnta}% + \ifx\rangen@index\@empty + \rng@chgrand[first=1,last=\n@rng@listItems]\rand + \else + \rng@cnta=\rangen@index + \advance\rng@cnta-1\relax + \amodb{\rng@cnta}{\n@rng@listItems}% + \rng@cnta=\retnmod + \advance\rng@cnta1\relax + \value{rand}=\rng@cnta + \fi + \@getVarName{#2}% + \expandafter\edef\csname i@\@varName\endcsname{\arabic{rand}}% + \rng@cnta=0\relax\@for\@@tmp:=#3\do{% + \advance\rng@cnta1\relax\ifnum\rng@cnta=\arabic{rand}% + \rng@toks=\expandafter{\@@tmp}\edef#2{\the\rng@toks}% + \expandafter\def\csname typeof@\@varName\endcsname{3}\fi}% +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Random Index} +% +% \begin{macro}{\RandomI} +% This command creates an implied list of \verb!{1, 2, 3,...,n}!, +% and randomly selects a number from this list. The result is +% defined as an integer, and held in the macro \texttt{\#1}. +%\begin{verbatim} +% \Random{\i}{n} --> select \i from {1, 2, 3,...,n} at random +%\end{verbatim} +%A random index, \cs{i}, created by \cs{RandomI}, can be used +%in the \cs{RandomL} command; for example, +%\begin{verbatim} +% \RandomL[index=\i]{\a}{17,\rPI,3/4,\rE,88,1/2} +%\end{verbatim} +%The value of \cs{a} is determined by the index \cs{i}. +% \begin{macrocode} +\newcommand{\RandomI}[2]{% + \rng@chgrand[first=1,last=#2]\rand + \defineZ{#1}{\arabic{rand}}% + \expandafter\edef\csname i@\@varName\endcsname{\arabic{rand}}% +} +% \end{macrocode} +% \end{macro} +% +% \subsection{Some Constants} +% +% \begin{macro}{\zZero} +% \begin{macro}{\zOne} +% \begin{macro}{\zMinusOne} +% \begin{macro}{\rPI} +% \begin{macro}{\rE} +% Define three convenience integers corresponding to $0$, $1$, and $-1$. +% \begin{macrocode} +\defineZ{\zZero}{0} +\defineZ{\zOne}{1} +\defineZ{\zMinusOne}{-1} +\defineR{\rPI}{3.1415927} +\defineR{\rE}{2.7182818} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% This macro takes \cs{@varName} and \cs{cmp@Name} and converts to the same common +% denominator. This makes it easy to make comparisons between two rational numbers. +% \begin{macrocode} +\def\syncronizeQs#1{\edef\sync@arg{#1}% + \lcm{\csname d@\sync@arg\endcsname}{\d@cmp@Name}% + \edef\@thelcm{\thelcm}% + \convertRatTo{\n@cmp@Name}{\d@cmp@Name}{\@thelcm}% + \updateQ\cmp@Name{\rng@retn@num}{\@thelcm}% + \convertRatTo{\csname n@\sync@arg\endcsname}% + {\csname d@\sync@arg\endcsname}{\@thelcm}\expandafter + \defineQ\csname\sync@arg\endcsname{\rng@retn@num}{\@thelcm}% +} +% \end{macrocode} +% \subsection{Formatting Commands} +% \begin{macro}{\ds} +% \begin{macro}{\eds} +% \begin{macro}{\cds} +% Displays an alternate representation (\textbf display\textbf style) of the random variable. Usage \cs{ds}\cs{a}. +% This displays the contents of \cs{display@TeXfmt} for this variable. The value of \cs{display@TeXfmt} +% is effected by the formatting commands above. +% +% For a rational number \cs{a}, the expression \cs{ds}\cs{a} expands either to the special format representation, or +% to a rational of the form $\frac{p}{q}$. +% \begin{macrocode} +\newcommand\ds[1]{% + \expandafter\csname\expandafter\@gobble\string#1*\endcsname +} +\newcommand\eds[1]{% + \expandafter\csname\expandafter\@gobble\string#1*e\endcsname +} +\newcommand\cds[1]{% + \expandafter\csname\expandafter\@gobble\string#1*c\endcsname +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\fmt} +% \begin{macro}{\efmt} +% \begin{macro}{\cfmt} +% Displays a special format for the random variable. Usage \cs{ds}\cs{a}. +% This displays the contents of \cs{display@TeXfmt} for this variable. +% Same as \cs{ds}, but does not display a display style if there is not +% special formatting. +% +% For a rational number \cs{a}, the expression \cs{ds}\cs{a} expands either to the special format representation, or +% to a rational of the form $p/q$. +% \begin{macrocode} +\newcommand\fmt[1]{% + \expandafter\csname\expandafter\@gobble\string#1!\endcsname +} +\newcommand\efmt[1]{% + \expandafter\csname\expandafter\@gobble\string#1!e\endcsname +} +\newcommand\cfmt[1]{% + \expandafter\csname\expandafter\@gobble\string#1!c\endcsname +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\js} +% Used within \cs{CorrAnsButton} to get a more precise expansion of a variable. Used with variables +% that have been defined using \cs{defineDepVar}. When you say \verb+\js\m+, for example, +% the \cs{eval@JSfmt} is expanded. +% \par\medskip\noindent +% \textbf{Usage:} \verb+\CorrAnsButton*{y = \js\m\space x }+ +% \begin{macrocode} +\newcommand\js[1]{% + \expandafter\csname\expandafter\@gobble\string#1!*\endcsname +} +% \end{macrocode} +% \end{macro} +% +% \subsection{Commands specialized to Reals} + +% \begin{macro}{\RNGround} +% Round \texttt{\#1} to \texttt{\#3} decimal places, and leave result in \texttt{\#2}. +% \begin{macrocode} +\def\RNGround#1#2#3{% + \begingroup + \def\rng@ctrlName{#1}% + \def\rng@sourceName{#2}% + \def\rng@nDecPl{#3}% + \RNGparseDec{#2}% + \ifnum\rndnDec<#3\relax + \xdef\theseDigits{\rng@fracpart}% + \let\rng@next\relax + \else + \count0=0\relax + \gdef\theseDigits{}% + \def\rng@next{\expandafter\@rng@round\rng@fracpart\end}% + \fi + \rng@next + \xdef\decPls{\@ifundefined{save@rng@nDecPl}% + {\rng@nDecPl}{\save@rng@nDecPl}}% + \ifx\theseDigits\@empty + \xdef#1{\rng@intpart}\else + \xdef#1{\rng@intpart\RNG@Dec\theseDigits}\fi + \endgroup +} +\def\@rng@round#1{% + \ifx#1\end\let\rng@next\relax + \else + \ifnum\rng@nDecPl=0\relax + \ifnum#1>4\relax + \count0=\rng@intpart\relax + \ifnum\rng@intpart<0\relax + \advance\count0by-1\relax + \else + \advance\count0by1\relax + \fi + \xdef\rng@intpart{\the\count0}% + \fi + \gdef\theseDigits{}% + \let\rng@next\rng@gobbletoend + \else + \advance\count0by1\relax + \ifnum\count0=\rng@nDecPl\relax + \def\rng@next{\@@rng@round#1}% + \else + \xdef\theseDigits{\theseDigits#1}% + \let\rng@next\@rng@round + \fi + \fi + \fi + \rng@next +} +\def\rng@gobbletoend#1\end{} +\def\@@rng@round#1#2{% + \ifx#2\end% + \xdef\theseDigits{\theseDigits#1}% + \let\rng@next\relax + \else + \ifnum#2>4\relax\count2=#1\relax + \ifnum\count2=9\relax + \count0=\rng@nDecPl\relax + \ifnum\count0=1\relax + \count0=\rng@intpart\relax + \ifnum\rng@intpart<0\relax + \advance\count0by-1\relax + \else + \advance\count0by1\relax + \fi + \xdef\rng@intpart{\the\count0}% + \let\rng@next\rng@gobbletoend + \else + \advance\count0by-1\relax\expandafter + \xdef\rng@sourceName{% + \rng@intpart\RNG@Dec\theseDigits#1}% + \edef\save@rng@nDecPl{\rng@nDecPl}% + \edef\rng@next{\noexpand\RNGround{% + \expandafter\noexpand\rng@ctrlName}% + {\expandafter\noexpand\rng@sourceName}% + {\the\count0}\noexpand\rng@gobbletoend}% + \fi + \else + \advance\count2by1\relax + \xdef\theseDigits{\theseDigits\the\count2}% + \let\rng@next\rng@gobbletoend + \fi + \else % \ifnum#2<=4 + \xdef\theseDigits{\theseDigits#1}% + \let\rng@next\rng@gobbletoend + \fi + \fi + \rng@next +} +% \end{macrocode} +% \end{macro} +% Used with \cs{CorrAnsButton} and \texttt{rngCorrAnsButton}, like so, +%\begin{verbatim} +% \CorrAnsButton{rEval(\strAns)}*{rngCorrAnsButton\RNGprintf{\%.2f}} +%\end{verbatim} +% \begin{macrocode} +\def\RNGprintf#1{("#1",\@gobble} +% \end{macrocode} +% +% \subsection{User Defined Dependent Variables for JavaScript} +% \begin{macro}{\defineDepQJS} +% Define a rational as a function of other integers. This macro defines +% \cs{fmt} and \cs{ds} for the variable, but its primary use it +% for \cs{js}. This command is aimed at the JavaScript side of things +%\begin{verbatim} +%#1 = name of rational to be defined, e.g., \a +%#2 = numerator +%#3 = denominator +%#4 = \js expression for #1 +%\end{verbatim} +% Usage: +%\begin{verbatim} +% \defineDepQJS{\m}{\d-\b}{\c-\a} +% {rFrac(rEval(\nOf\m)/rEval(\dOf\m))} +% ... +% \CorrAnsButton{y = \js\m\space x}*{rngCorrAnsButton}% +%\end{verbatim} +% The above example would calculate equation of the line passing through +% the two points \verb!P(\a,\b)! and \verb!Q(\c,\d)!. The code is used +% in the \cs{CorrAnsButton} to have the answer appear. +% \begin{macrocode} +\newcommand\defineDepQJS[4]{% + \@getVarName#1 + \expandafter\edef\csname\@varName\endcsname{(#2)/(#3)}% + \expandafter\edef\csname n@\@varName\endcsname{(#2)}% + \expandafter\edef\csname d@\@varName\endcsname{(#3)}% + \edef\display@TeXfmt{\csname\@varName\endcsname}% + \edef\inline@TeXfmt{\csname\@varName\endcsname}% + \def\dv@argiv{#4}\ifx\dv@argiv\@empty + \edef\eval@JSfmt{\csname\@varName\endcsname}\else + \edef\eval@JSfmt{#4}\fi + \expandafter\let\csname\@varName!*\endcsname\eval@JSfmt +} +% \end{macrocode} +% \end{macro} +% +% \subsection{Writing RVs to Solution Files} +% \begin{macrocode} +\def\rng@writeCurrentSeed#1{\immediate\write#1{\string\makeatletter + \string\global\string\cr@nd=\the\cr@nd\string\relax + \string\makeatother}} +% \end{macrocode} +% Token register to hold the verbatim contents of the \texttt{writeRVsTo} environment. +% \begin{macrocode} +\newtoks\rng@toks +\def\wrv@ex@solns{exercises}% +\def\wrv@ex@quiz{quizzes}% +% \end{macrocode} +% \begin{environment}{writeRVsTo} +% This environment takes its environment contents and writes it to +% two files, one file is \cs{jobname\_rvs.cut} which is input back +% into the source file immediately. The second parameter +% accepts the string \texttt{exercises} or \texttt{quizzes}, or a write +% handle to write to an auxiliary file. The environment was designed for +% use with the \texttt{exercise}, \texttt{quiz}, and \texttt{shortquiz} environments +% of \textsf{exerquiz}. +% \begin{macrocode} +\newenvironment{writeRVsTo}[2][] +{% + \def\wrv@argii{#2}% + \ifx\wrv@argii\wrv@ex@quiz\let\wrv@out\quiz@solns + \else\ifx\wrv@argii\wrv@ex@solns\let\wrv@out\ex@solns\else + \let\wrv@out#2\fi\fi + \rng@writeCurrentSeed\wrv@out + \rng@toks={}% + \def\verbatim@processline{% + \xdef\rng@temp{\the\rng@toks\the\verbatim@line}% + \global\rng@toks=\expandafter{\rng@temp}}% + \let\do\@makeother\dospecials\catcode`\^^M\active + #1% + \verbatim@start +}{ \immediate\write\wrv@out{\the\rng@toks}% + \newwrite\rng@writeRVs + \immediate\openout\rng@writeRVs\jobname_rvs.cut + \immediate\write\rng@writeRVs{\the\rng@toks}% + \immediate\closeout\rng@writeRVs + \aftergroup\rng@Input@RVs +} +% \end{macrocode} +% \end{environment} +% After the \texttt{writeRVsTo} environment writes the RVs to +% \cs{jobname\_rvs.cut}. The environment executes +% \cs{rng@Input@RVs} to input the file back into the source file. +% \begin{macrocode} +\def\rng@Input@RVs{\InputIfFileExists{\jobname_rvs.cut}{}{}} +% \end{macrocode} +% \subsection{Redefine lcg Package Macro} +% \begin{macrocode} +\def\rng@p@stkeysr@nd{% + \@rderr@nd% last < first -> swap + \cutr@nger@nd% range too big -> cut +} % end of \def\p@stkeysr@nd +\def\rng@chgrand{\@ifnextchar[\rng@chgr@nd{\rng@chgr@nd[]}} +\def\rng@chgr@nd[#1]{% + \@tempcnta=\z@ + \@tempcntb=\z@ + \setkeys{Init}{#1}% + \rng@p@stkeysr@nd% + \@utputr@nd% +} % end of \def\rng@chgrand +% \end{macrocode} +% \subsection{DLJS Support} +% \begin{macrocode} +\begin{insDLJS}[partialExpand]{partial}{Rangen} +var partre = /rEval|rFrac/; +% \end{macrocode} +% The arguments for this function take two forms +% (1) \texttt{fieldname}, \texttt{theanswer} (the default); (2) +% \texttt{theformat}, \texttt{fieldname}, \texttt{theanswer}. The later case +% is created by using the \cs{RNGprintf} command that inserts allows the +% document author to insert a \texttt{printf} formatting template. For example, +%\begin{verbatim} +% \CorrAnsButton{rEval(\strAns)}*{rngCorrAnsButton\RNGprintf{\%.4f}} +%\end{verbatim} +% \begin{macrocode} +function rngCorrAnsButton() +{ + var theprecision,fieldname,theanswer; + if (arguments.length==4) { + var theformat=arguments[0]; + var fieldname=arguments[1]; + var theanswer=arguments[2]; + var thequiz=arguments[3]; + } else { + var fieldname=arguments[0]; + var theanswer=arguments[1]; + var thequiz=arguments[2]; + } + theanswer = partialExpand(0,theanswer); + if (arguments.length==4) + theanswer=util.printf(theformat,eval(theanswer)); + DisplayAnswer(fieldname,theanswer,thequiz); +} +% \end{macrocode} +% The JavaScript function \texttt{partialExpand} searches through \texttt{Ans} in search of +% \texttt{rEval} and \texttt{rFrac}. It calls itself recursively to search for the inner most +% appearances of these two functions. It evaluates these two functions starting with the inner +% most and working its way outward. +% \begin{macrocode} +function partialExpand(level,Ans) +{ + Ans = correctPlusMinus(Ans) + level += 1; +\db console.println("Enter level = " + level +": Ans: " + Ans);\db% + var n=0, m, bP, eP, subExp; + while ( true ) { +\db console.println("Searching a level " + level);\db% + try { m = Ans.match(partre); } + catch (e) { break; } + if ( m != null ) { + bP = m.index + m[0].length; + eP = FindBalP(Ans, bP, true); +\db console.println("bP = " + bP + " : eP = " + eP);\db% + var subExp = Ans.substring(bP+1, eP); +\db console.println("Found \'" + subExp% + + "\' at level = " + level);\db% +% subExp = partialExpand(level, subExp); + // n = beginning of "rEval", + // eP = beginning of balanced parens, + // bP = end of balanced parens + Ans = Ans.substring(0, m.index) + + eval(m[0]+"(level,subExp)") + Ans.substring(eP+1); +\db console.println("level = " + level% + +": New Ans: " + Ans);\db % + } else { + if ( level == 1 ) { +\db console.println("Level 1 break");\db % + break; + } + } + } +\db console.println("Return Ans: " + Ans);\db% + Ans = correctPlusMinus(Ans); + return Ans; +} +% \end{macrocode} +% Evaluates the value of \texttt{Ans}. +% \begin{macrocode} +function rEval(level, Ans) +{ + level += 1; +\db console.println("Enter rEval: level = "% + + level +": Ans: " + Ans);\db% + var n=0, m, bP, eP, subExp; + while ( true ) + { +\db console.println("Searching a level " + level);\db% + try { m = Ans.match(partre); } + catch (e) { break; } + if ( m != null ) { + bP = m.index + m[0].length; + eP = FindBalP(Ans, bP, true); +\db console.println("bP = " + bP + " : eP = " + eP);\db% + var subExp = Ans.substring(bP+1, eP); +\db console.println("Found \'" + subExp% + + "\' at level = " + level);\db% + // n = beginning of "rEval", + // eP = beginning of balanced parens, + // bP = end of balanced parens + Ans = Ans.substring(0, m.index) + +eval(m[0]+"(level,subExp)")+Ans.substring(eP+1); +\db console.println("level = "% + + level +": New Ans: " + Ans);\db % + } else { + Ans = ParseInput(Ans); +\db console.println("Ready to eval at level = "% + + level + ": Ans = " + Ans);\db% + with(Math) { Ans = eval( Ans ) }; +\db console.println("After eval at level = "% + + level + ": Ans = " + Ans);\db% + break; + } + } +\db console.println("Return Ans: " + Ans);\db% + return Ans; +} +% \end{macrocode} +% Evaluates an rational number by evaluating the value of the numerator and denominator separately. +% \begin{macrocode} +function rFrac(level, Ans) +{ + level += 1; +\db console.println("Enter rFrac level = "% + + level +": Ans: " + Ans);\db% + var n=0, m, bP, eP, subExp; + while ( true ) { +\db console.println("Searching a level " + level);\db% + try { m = Ans.match(partre); } + catch (e) { break; } + if ( m != null ) { + bP = m.index + m[0].length; + eP = FindBalP(Ans, bP, true); +\db console.println("bP = "% + + bP + " : eP = " + eP);\db% + var subExp = Ans.substring(bP+1, eP); +\db console.println("Found \'" + subExp% + + "\' at level = " + level);\db% + // n = beginning of "rEval", + // eP = beginning of balanced parens, + // bP = end of balanced parens + Ans = Ans.substring(0, m.index) + + eval(m[0]+"(level,subExp)") + Ans.substring(eP+1); +\db console.println("level = " + level% + +": New Ans: " + Ans);\db % + } else { + var numDenom = Ans.split("/"); + numDenom[0] = eval(numDenom[0]); + numDenom[1] = eval(numDenom[1]); + var g = gcd(numDenom[0], numDenom[1]); + numDenom[0] /= g; + numDenom[1] /= g; + if ( numDenom[1] == 1) + Ans = numDenom[0]; + else + Ans = numDenom.join("/"); +\db console.println("Reduce: " + numDenom.join("/"));\db% + break; + } + } +\db console.println("Return Ans: " + Ans);\db% + return Ans; +} +function correctPlusMinus(Ans) +{ + Ans = "" + Ans; + Ans = Ans.replace(/\s*([\+-])\s*\1\s*/g, " + "); + Ans = Ans.replace(/\s*\+\s*-\s*/g, " - "); +% Ans = Ans.replace(/\s*\+\s*\+\s*/g, " + "); +% Ans = Ans.replace(/\s*-\s*-\s*/g, " + "); + Ans = Ans.replace(/\s*-\s*\+\s*/g, " - "); + return Ans; +} +function gcd(a,b) +{ + var x = a, y = b, r; + while (true) + { + r = x \% y; + if ( r == 0 ) break; + x = y; + y = r; + } + return Math.abs(y); +} +function lcm (a,b) { return (a*b)/gcd(a,b); } +\end{insDLJS} +% +% \end{macrocode} +\endinput diff --git a/texmf-dist/source/latex/rangen/rangen.ins b/texmf-dist/source/latex/rangen/rangen.ins new file mode 100644 index 00000000..c9335e7f --- /dev/null +++ b/texmf-dist/source/latex/rangen/rangen.ins @@ -0,0 +1,64 @@ +%% +%% 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{rangen.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{rangen.sty}{\from{rangen.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/renditions/renditions.dtx b/texmf-dist/source/latex/renditions/renditions.dtx new file mode 100644 index 00000000..e5ec3639 --- /dev/null +++ b/texmf-dist/source/latex/renditions/renditions.dtx @@ -0,0 +1,214 @@ +%\iffalse +%<*copyright> +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Renditions.sty package, 2010-1-29 %% +%% Copyright (C) 1999-2002 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. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% History: Noel Vaillant began developing a better renditions.sty +%% based on my earlier published renditions.sty. Many thanks +%% to him for starting me off. +%%--------------------------------------------------------- +% +%\NeedsTeXFormat{LaTeX2e}[1997/12/01] +%\ProvidesPackage{rendition} +% [2010/01/29 v0.1 rendition: Package for creating multiple renditions from the same source (dps)] +%<*driver> +\documentclass{ltxdoc} +\usepackage{amsmath} +\usepackage[colorlinks,hyperindex]{hyperref} +\usepackage{calc} +%\pdfstringdefDisableCommands{\let\\\textbackslash} +%\EnableCrossrefs \CodelineIndex +\begin{document} +\def\CMD#1{\textbackslash#1} + \GetFileInfo{renditions.sty} + \title{The \textsf{rendition} Package\texorpdfstring{\\[1ex]}{: }Creating multiple renditions (versions)\texorpdfstring{\\[1ex]}{} + from the same source file} + \author{D. P. Story\\ + Email: \texttt{dpstory@uakron.edu}} + \date{processed \today} + \maketitle + \tableofcontents + \let\Email\texttt + \DocInput{renditions.dtx} + \PrintIndex +\end{document} +% +% \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{The \textsf{renditions} Package} +% This is a short package sets up comment environments, called \emph{renditions}. These +% renditions can be included or excluded according to the value of the +% \texttt{rendition} option. The basic options of this package are \texttt{max} and \texttt{rendition} +%\begin{verbatim} +% \usepackage[max=4,rendition=3]{renditions} +%\end{verbatim} +% In the above example, \texttt{max=4} declares that there are 4 renditions in the +% document, the option \texttt{rendition=3} causes the package to include +% \texttt{rendition3}, and to exclude all the others \texttt{rendition1}, \texttt{rendition2}, and \texttt{rendition4}. +% +%The \textsf{renditions} package is a stand-alone package, but it was designed for use with the \textsf{AeB Builder} utility. +% +%Below is an example of a document that uses the \textsf{renditions} package. +% +%\bigskip\noindent\begin{minipage}[t]{.4\linewidth-5pt} +%\begin{verbatim} +%\documentclass{article} +%\usepackage[% +% max=4, +% rendition=3 +%]{renditions} +%\end{verbatim} +%\verb!%\rendition{2}! +%\begin{verbatim} +%\parindent0pt\parskip6pt +% +%\begin{document} +%This is a test file for +%renditions. +% +%\begin{rendition1} +%Rendition 1 +%\end{rendition1} +% +%\begin{rendition2} +%Rendition 2 +%\end{rendition2} +% +%\begin{rendition3} +%Rendition 3 +%\end{rendition3} +% +%\begin{rendition4} +%Rendition 4 +%\end{rendition4} +% +%\end{document} +%\end{verbatim} +%\end{minipage}\hfill +%\begin{minipage}[t]{.6\linewidth-5pt}\parskip\medskipamount +%There are two options for the \textsf{renditions} package: \texttt{max} and \texttt{rendition}. The value of \texttt{max} sets the maximum number of renditions in the document; the value of the \texttt{rendition} key determines which of the renditions is to be typeset. You can also select the rendition using the \cs{rendition} command, as illustrated to the left. (The \cs{rendition} command in the preamble would override the value of the \texttt{rendition} key.) +% +%The various renditions are defined with the \texttt{rendition} environment. +%These environments are just comment environments created by the \textsf{comments} %package, and they are selectively included or excluded depending on the value of %the rendition defined by either the \texttt{rendition} key or the \cs{rendition} command. +% +%The \textsf{rendition} package does modular arithmetic in the case when $\text{rendition} > %\text{max}$. For example, if \texttt{max=4}, and \texttt{rendition=6}, then the rendition %displayed is \texttt{rendition=2}. +% +%There is a third way of setting the value of the rendition parameter, and that is %through the \texttt{rendition.cfg} file. If you create a file with the code +%\begin{verbatim} +% \ExecuteOptionsX{rendition=3} +%\end{verbatim} +%Then \texttt{rendition=3} is used. +%\end{minipage} +% +%\paragraph*{Default values.}The default value of \texttt{max}, if it is not specified is %3, and the default value of \texttt{rendition} if it is not specified is 1. +% +% There should not be a \texttt{rendition} environment with a number, \texttt{}, greater than that specified by \texttt{max}; however, +% if the value of \texttt{rendition} is greater than \texttt{max}, modular arithmetic +% is performed, and the rendition numbered \texttt{rendition} Mod \texttt{max} is used. +% +%\paragraph*{History.} The core of this package was originally developed +% for my online testing system TAOAS (The {Acro\negthinspace\TeX} Online +% Assessment System). In that system, the \texttt{rendition.cfg} approach was used +% to select a rendition to be used. +% +%\section{The Main Code} +% We use xkeyval to create the two options \texttt{max} and \texttt{rendition}. +% \begin{macrocode} +\RequirePackage{xkeyval} +% \end{macrocode} +% \begin{macro}{max} +% The maximum number of renditions present in this file. The value of max +% must be a positive integer, no checking takes place. The default number is +% 3. +% \begin{macro}{rendition} +% The number of the rendition what you want to use for this run of the latex +% compiler. The default number is 1. +% \begin{macrocode} +\DeclareOptionX{max}{\def\ren@numberOf{#1}} +\def\ren@numberOf{3} +\DeclareOptionX{rendition}{\def\thisrendition{#1}} +\def\thisrendition{1} +% \end{macrocode} +% \end{macro} +% \end{macro} +% Input the configuration file, if it exists. This file normally contains +% the line of {\LaTeX} code \verb!\ExecuteOptions{rendition=}! +% \begin{macrocode} +\InputIfFileExists{rendition.cfg}{}{} +% \end{macrocode} +% Process the options. +% \begin{macrocode} +\ProcessOptionsX +% \end{macrocode} +% The comment package is required. +% \begin{macrocode} +\RequirePackage{comment} +% \end{macrocode} +% Based on the value of \texttt{max}, we create the requested number +% of rendition environments: \texttt{rendition1}, \texttt{rendition2},\dots, +% \texttt{rendition}. +% \begin{macrocode} +\let\save@message\message\let\message\@gobble +\@tempcnta=0 +\@whilenum\@tempcnta<\ren@numberOf\do{% + \@tempcntb=\@tempcnta\advance\@tempcntb1 + \edef\temp@exp{\noexpand\excludecomment{rendition\the\@tempcntb}}% + \temp@exp + \expandafter\let\csname Afterver\the\@tempcntb Comment\endcsname\relax + \advance\@tempcnta1 +}\let\message\save@message +% \end{macrocode} +% We include the selected version at the beginning of the document. +% \begin{macrocode} +\AtBeginDocument{\includecomment{rendition\thisrendition}} +% \end{macrocode} +% \begin{macro}{\rendition} +% A convenience macro for setting the current renditions. This +% command defines the command \cs{thisrendition}, which expands +% to the selected rendition number. If the value of \cs{thisredition} +% is greater than \texttt{max} (\cs{ren@numberOf}), modular arithmetic +% is performed, and \cs{thisrendition} is redefined. +% \begin{macrocode} +\def\rendition#1{\def\thisrendition{#1}% + \ifnum\thisrendition>\ren@numberOf + \@tempcnta=\thisrendition + \@tempcntb=\@tempcnta + \advance\@tempcnta-1 \divide\@tempcnta\ren@numberOf + \multiply\@tempcnta\ren@numberOf + \advance\@tempcntb-\@tempcnta + \edef\thisrendition{\the\@tempcntb}% + \typeout{Modular arithmetic applied: ren=\thisrendition}% + \fi +} +\@onlypreamble{\rendition} +% \end{macrocode} +% We execute \cs{rendition} for the selected rendition. +% \begin{macrocode} +\expandafter\rendition\expandafter{\thisrendition} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +% +% \end{macrocode} +% \Finale +\endinput \ No newline at end of file diff --git a/texmf-dist/source/latex/renditions/renditions.ins b/texmf-dist/source/latex/renditions/renditions.ins new file mode 100644 index 00000000..65cdc4b5 --- /dev/null +++ b/texmf-dist/source/latex/renditions/renditions.ins @@ -0,0 +1,59 @@ +%% +%% 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 2010 D. P. Story +%% +%% ------------------------------------------- +%% +%% 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/02/01} +\def\batchfile{renditions.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{renditions.sty}{\from{renditions.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/renditions/test_ren.tex b/texmf-dist/source/latex/renditions/test_ren.tex new file mode 100644 index 00000000..169af9e8 --- /dev/null +++ b/texmf-dist/source/latex/renditions/test_ren.tex @@ -0,0 +1,27 @@ +\documentclass{article} +\usepackage[max=4, rendition=2]{renditions} + +%\rendition{3} + +\parindent0pt\parskip6pt + +\begin{document} +This is a test file for renditions. + +\begin{rendition1} +Rendition 1 +\end{rendition1} + +\begin{rendition2} +Rendition 2 +\end{rendition2} + +\begin{rendition3} +Rendition 3 +\end{rendition3} + +\begin{rendition4} +Rendition 4 +\end{rendition4} + +\end{document} \ No newline at end of file diff --git a/texmf-dist/source/latex/richtext/doc/richtextman.tex b/texmf-dist/source/latex/richtext/doc/richtextman.tex new file mode 100644 index 00000000..7526f9ad --- /dev/null +++ b/texmf-dist/source/latex/richtext/doc/richtextman.tex @@ -0,0 +1,1106 @@ +% makeindex < aebpro_man.idx > aebpro_man.ind +\documentclass[12pt]{article} +\usepackage[fleqn]{amsmath} +\usepackage[ + web={centertitlepage,designv,forcolorpaper,latextoc,pro,addtoHyOpts={pagebackref=false}}, + eforms, +% linktoattachments, + aebxmp +]{aeb_pro} +\usepackage{richtext} +\usepackage{graphicx,array} +%\usepackage{myriadpro} +%\usepackage{calibri} +\usepackage[altbullet]{lucidbry} + +%\previewtrue +%\usepackage{makeidx} +%\makeindex +\usepackage{acroman} +\usepackage[active]{srcltx} + +\setcounter{secnumdepth}{4} +\setcounter{tocdepth}{5} +\makeatletter +\renewcommand*{\theparagraph}{\texorpdfstring{\protect\P\protect\ }{\textparagraph}} +\renewcommand{\paragraph} + {\renewcommand{\@seccntformat}[1]{\theparagraph}% + \@startsection{paragraph}{4}{0pt}{6pt}{-3pt}{\color{\aeb@subsubsectioncolor}\bfseries}} +\renewcommand*\l@paragraph{\@dottedtocline{4}{5.0em}{1em}} %{7.0em}{4.1em}} +\def\chgCurrLblName#1{\def\@currentlabelname{#1}} +\def\echgCurrLblName#1{\edef\@currentlabelname{#1}} +\makeatother + +\getDimsFromGraphic{graphics/dpsweb}{\dpswebW}{\dpswebH} + + +%\urlstyle{rm} +\urlstyle{sf} +\let\uif\textsf +\let\app\textsf +\def\psf#1{\textbf{\textsf{#1}}} +\let\amtIndent\leftmargini + +\convertcolorspec{named}{red}{RGB}{\rgbRed} +\convertcolorspec{named}{blue}{RGB}{\rgbBlue} +\convertcolorspec{named}{red}{HTML}{\htmlRed} +\convertcolorspec{named}{blue}{HTML}{\htmlBlue} +\convertcolorspec{named}{magenta}{RGB}{\rgbMagenta} +\convertcolorspec{named}{magenta}{HTML}{\htmlMagenta} +\convertcolorspec{named}{webbrown}{HTML}{\htmlWebBrown} + +\renewcommand*\descriptionlabel[1]{\hspace\labelsep + \normalfont #1} + + +\DeclareDocInfo +{ + university={Acro\negthinspace\TeX.Net}, + title={\textsf{richtext}: A method of creating rich text strings}, + author={D. P. Story}, + email={dpstory@acrotex.net}, + subject={Documentation for the richtext package from AcroTeX}, + talksite={\url{www.acrotex.net}}, + version={v1.0c, 2016/10/03}, + keywords={AcroTeX, rich text strings}, + 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$}}$} + +\newcount\fldCnt \fldCnt=0 +\def\incFldCnt{\global\advance\fldCnt1\relax} + +\frenchspacing + +\chngDocObjectTo{\newDO}{doc} +\begin{docassembly} +var titleOfManual="The AeB RichText MANUAL"; +var manualfilename="Manual_BG_Print_richtext.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} + +\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} + + +%FreeText +%/C[1.0 1.0 1.0]/Contents(This is test If there a real test, we would all be in trouble.) +%/CreationDate(D:20160909063701-05'00') +%/DA(0.898 0.1333 0.2157 rg /Helv 12 Tf) +%/DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#E52237 ) +%/F 4/M(D:20160909065147-05'00')/NM(f8e9e6b1-1651-4c47-9169-8a47c7af23ff) +%/RC( +%

+% +% This is +% +% test +% +%If there a real test, we would all be in trouble. +%

)/Rect[30.1092 174.763 181.964 251.345]/Subj(Text Box)/Subtype/FreeText/T(dpstory)/Type/Annot>> + + +\section{Introduction} + +Rich text contents for variable text (text fields and editable combo boxes) +and markup annotations was introduced into the PDF specification beginning +with PDF 1.5 (\app{Acrobat} and \app{Adobe Reader} version~6). The rich text +strings are difficult to create for it requires reading from a number of +sources. The \pkg{richtext} package provides commands and documentation +needed to ``easily'' produce such rich strings. We demonstrate the results +using the \pkg{eforms} package (the text field produced by \pkg{hyperref} +does not support rich text). + +References for this material includes the \textsl{PDF +Reference}~\cite{book:pdfspec}, the XFA specification~\cite{webpage:XFASpec}, +and the CSS2 specification~\cite{webpage:CSS2}. Additionally, the \textsl{JavaScript for +Acrobat API Reference}~\cite{tech:AcroJS} covers the JavaScript API for +handling rich text content. + +\section{Preamble: Required packages and options} + +The package has no options and only requires \pkg{xkeyval} and \pkg{ifxetex} packages. +The package can produce rich text strings, but to actually use them, you'll need +the \pkg{eforms} package. + +The package works for all drivers \app{dvips}, \app{pdflatex}, \app{xelatex}, +and \app{luatex}. The \pkg{eforms} package can automatically detect all +drivers except \pkg{dvips}, and that is used by default. + +\section{Creating rich text strings}\label{s:CreateRTS} + +We begin by illustrating the result of the \pkg{richtext} package, consider the rich text field below. + +\rtpara[indent=first]{para1}{Now is the time for +\span{style={bold,italic,strikeit},color=ff0000}{J\374rgen} and all +good men to come to the aid of \it{their} \bf{country}. Now is the time for +\span{style=italic}{all good} women to do the same.} +\rtpara[indent=first]{para2}{With rich text, we can format the text within +the text field. As a reader of this rich text field, you can edit the +contents of the box, feel free to do so.} +\rtpara[halign=right]{para3}{D. P. Story \span{url=http://www.acrotex.net}{AcroTeX.Net}} + +\setRVVContent{myContent}{{para1}{para2}{skipline}{para3}} + +\begin{center} +%\previewtrue +\incFldCnt +\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}%\DS{\useDS{myDS}}% +\RV{\useRVContent{myContent}}\V{\useVContent{myContent}}]{rtFld\the\fldCnt}{4in}{10\baselineskip} +\end{center} + +To edit the field above, click in the field, press \uif{Ctrl+E} or \uif{Cmd+E} (for \app{Mac OS}) to obtain +the \uif{Form Field Text Properties} toolbar. By pressing the \uif{More} button, you can see the additional +properties of the field, as seen in \hyperref[fig:FPtabs]{Figure~\ref*{fig:FPtabs}}. + + +A rich text may have any of several style attributes, many of these are illustrated in the above example. +As a guide to introducing the attributes, we follow the \uif{Form Field Text Properties} dialog box shown +in \hyperref[fig:FPtabs]{Figure~\ref*{fig:FPtabs}}. + +\begin{figure}[htb]\centering\setlength{\fboxsep}{0pt}% +\fbox{\parbox{.5\linewidth-5pt-2\fboxrule}{\includegraphics[width=\linewidth]{graphics/fontprops}}}\hspace{10pt}% +\fbox{\parbox{.5\linewidth-5pt-2\fboxrule}{\includegraphics[width=\linewidth]{graphics/paragraphprops}}}\\[6pt] +\fbox{\parbox{.8\linewidth-2\fboxrule}{\includegraphics[width=\linewidth]{graphics/linkprops}}}% +\caption{The Font, Paragraph and Link tabs}\label{fig:FPtabs} +\end{figure} + +\newtopic\noindent +The basic command for creating a rich text \emph{paragraph} is \cs{rtpara}: +\bVerb\takeMeasure{\string\rtpara[\ameta{Para-Font-attrs}]\darg{\ameta{name}}\darg{\ameta{rich-text-paragraph}}}% +\begin{dCmd}[commandchars=!()]{\bxSize} +\rtpara[!ameta(Para-Font-attrs)]{!ameta(name)}{!ameta(rich-text-paragraph)} +\end{dCmd} +\eVerb where \ameta{Para-Font-attrs} are key-value pairs (in the {\LaTeX} +sense) that are described in \hyperref[s:FLtabs]{Sections~\ref*{s:FLtabs}} +and~\ref{s:Paratab}; these attributes are applied to the paragraph as a +whole. The \ameta{name} is a unique name to be associated with +\ameta{rich-text-paragraph} so it can be referenced later from within a text +field. There are two types of attributes: \uif{Font} and \uif{Paragraph}, as +guided by \hyperref[fig:FPtabs]{Figure~\ref*{fig:FPtabs}}. For convenience, +the \uif{Link} attributes (URLs) are classified as \uif{Font}. The optional +argument of \cs{rtpara} consists of usually \uif{Paragraph} attributes, most +\uif{Font} attributes are also recognized. + +The definition of the first paragraph of the above rich text field reads as +follows: +\begin{Verbatim}[fontsize=\small] +\rtpara[indent=first]{para1}{Now is the time for + \span{style={bold,italic,strikeit},color=ff0000}{J\374rgen} + and all good men to come to the aid of \it{their} + \bf{country}. Now is the time for \span{style=italic} + {all good} women to do the same.} +\end{Verbatim} +In this example, the optional argument for \cs{rtpara} was used to indent the +paragraph. The rich text defined here is named \texttt{para1}. The third +argument, \ameta{rich-text-string}, consists of ordinary text, the \cs{span} +command used to insert special formatting for text, and certain other +`short-cut' markups like \cs{it} and \cs{bf}. Note that the umluat (\"{u}) is +expressed as octal (\cs{374}). + +The \cs{span} command is used to format individual sentence fragments. Its +syntax is, +\bVerb\takeMeasure{\string\span\darg{\ameta{Font-attrs}}\darg{\ameta{rich-text-string}}}% +\begin{dCmd}[commandchars=!()]{\bxSize} +\span[!ameta(Font-attrs)]{!ameta(rich-text-string)} +\end{dCmd} +\eVerb where \ameta{Font-attrs} are \uif{Font} attributes as described in +\hyperref[s:FLtabs]{Sections~\ref*{s:FLtabs}}; these attributes are applied +to the string \ameta{rich-text-string} only. The \cs{span} command, as +described here, is only defined within the third argument +(\ameta{rich-text-paragraph}) of \cs{rtpara}. This is necessary because +\cs{span} is a {\TeX} primitive command, and we must not overwrite its +definition. + +When you create a \emph{rich text string} there is a parallel development of a +\emph{plain text string}, the string without its rich text markup, these two +(rich and plain strings) are used to populate the values of the \psf{RV} and +\psf{V} keys of a text field. When you define a rich text paragraph string +under its own \ameta{name}, you can typeset it (to check the syntax) and its +plain text counterpart using the \cs{useRV\darg{\ameta{name}}} and +\cs{useV\darg{\ameta{name}}} commands. For example, +\begin{quote}\raggedright\ttfamily\makeatletter\def\rt@SC{;\penalty0}% +\rtpara[indent=first]{para1}{Now is the time for +\span{style={bold,italic,strikeit},color=ff0000}{J\string\374rgen} and all +good men to come to the aid of \it{their} \bf{country}. Now is the time for +\span{style=italic}{all good} women to do the same.} +\makeatother +\hspace*{-\leftmargini}\textbf{\cs{useRV\darg{para1}:}}\ \useRV{para1}\\[\baselineskip] +\hspace*{-\leftmargini}\textbf{\cs{useV\darg{para1}:}}\ \useV{para1} +\end{quote} +These commands may also be used to insert the strings into the \psf{RV} and +\psf{V} keys, respectively; though the \pkg{richtext} package offers an +alternative technique. + +\subsection{The \texorpdfstring{\uif{Font}}{Font} and +\texorpdfstring{\uif{Link}}{Link} tabs}\label{s:FLtabs} + +In this section, we cover the \uif{Font} and \uif{Link} tabs, as well as other attributes +not listed on any tab. + +\subsubsection{The \texorpdfstring{\uif{Font}}{Font} tab} + +We discuss the \uif{Font} tab of \hyperref[fig:FPtabs]{Figure~\ref*{fig:FPtabs}}. The +key-value for each of the attributes is given and described briefly. These key-values +may appear as \ameta{Font-attrs} or \ameta{Para-Font-attrs}. +\begin{description} +%The font family used to draw the text. It is an array of family names to be searched for in order. The first +%entry in the array is the font name of the font to use. The second entry is an optional generic family name +%to use if an exact match of the first font is not found. The generic family names are +%symbol, serif, sans-serif, cursive, monospace, fantasy +%The default generic family name is sans-serif. +\item[\uif{Font:}] \texttt{font=\ameta{font\_name}} A font name or a list of + font names to be used to display the enclosed text. The first + entry is the font name of the font to use. The second font name is + typically a generic family name to use if an exact match is not found. + The generic family names are \texttt{symbol}, \texttt{serif}, + \texttt{sans-serif}, \texttt{cursive}, \texttt{monospace}, and + \texttt{fantasy}. The default is \texttt{sans-serif}. If a typeface name + contains white space, enclose it within single quotes (\texttt{'}). +\begin{flushleft}\small %\previewtrue +\verb|\rtpara[font={Arial,sans-serif}]{para1}{This is Arial or a| +\hspace*{20pt}\verb|san-serif substitute.}|\\[3pt] +\rtpara[font={Arial,sans-serif}]{para1}{This is Arial or a san-serif substitute.}% +\incFldCnt\textField[\Ff{\FfRichText}%\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{3in}{16bp}\\[6pt] +\verb|\rtpara{para2}{This is \span{font='Myriad Pro'}| +\hspace*{20pt}\verb|{Myriad Pro} font.}|\\[3pt] +\rtpara{para2}{This is \span{font='Myriad Pro'}{Myriad Pro} font.} +\incFldCnt\textField[\Ff{\FfRichText}%\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para2}}\V{\useV{para2}}]{rtFld\the\fldCnt}{3in}{16bp} +\end{flushleft} +In the second example, only `Myriad Pro' is actually set in the Myriad Pro font; the rest of the sentence +is typeset in the default font, Helvetica in this case. Use \uif{Ctrl+E} (\uif{Cmd+E}) to inspect the properties +of these two fields and verify the fonts are Arial, Myriad Pro, and Helvetica. + +\item[\uif{Size}:] \texttt{size=\ameta{dec\_num}} The size of the font to + be used. The value of \texttt{size} is \ameta{dec\_num}, a (positive) + decimal number. +\begin{flushleft}\small %\previewtrue +\verb|\rtpara[size=12]{para1}{This is 12pt font, while| +\hspace*{20pt}\verb|\span{size=8}{this is 8pt font.} OK?}|\\[6pt] +\rtpara[size=12]{para1}{This is 12pt font, while \span{size=8}{this is 8pt font.} OK?} +\incFldCnt\textField[\Ff{\FfRichText}%\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{3in}{16bp} +\end{flushleft} + +\item[\uif{Baseline Shift:}] \texttt{raise=\ameta{def\_num}} The position of the baseline of the text is determined +by the \texttt{raise} key. \texttt{raise=6.6} raises the baseline \texttt{6.6pt}, while \texttt{raise=-4} lowers +it \texttt{4pt}. +\begin{flushleft}\small +\verb|\rtpara{para1}{This text \span{raise=6.6}{is raised by| +\hspace*{20pt}\verb| 6.6pt} while this text \span{raise=-4}| +\hspace*{20pt}\verb|{is lowed by 4pt.} Back to normal baselines.}|\\[6pt] +\rtpara{para1}{This text \span{raise=6.6}{is raised by 6.6pt} while this text +\span{raise=-4}{is lowed by 4pt.} Back to normal baselines.} +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{3in}{16bp*4} +\end{flushleft} + +\item[\uif{Underline:}] + \texttt{ulstyle=\ameta{\upshape{none|ul|2ul|wul|2wul}}} The + \texttt{ulstyle} key determines the style of underlining, possible values + are \texttt{none} (no underlining), \texttt{ul} (underlining), + \texttt{2ul} (double-line underlining), \texttt{wul} (word underlining), + and \texttt{2wul} (double-line word underlining). +\begin{flushleft}\small %\previewtrue +\verb|\rtpara{para1}{We can \span{ulstyle=ul}{underline in a}| +\hspace*{20pt}\verb|\span{ulstyle=2ul}{number of different ways}| +\hspace*{20pt}\verb|\span{ulstyle=wul}{that catch the}| +\hspace*{20pt}\verb|\span{ulstyle=2wul}{attention of the reader}.|\\[3pt] +\rtpara{para1}{We can \span{ulstyle=ul}{underline in a} \span{ulstyle=2ul}{number of different ways} +\span{ulstyle=wul}{that catch the} \span{ulstyle=2wul}{attention of the reader}.} +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{3in}{16bp*4} +\end{flushleft} + +\item[\uif{Style}:] + \texttt{style=\darg{\upshape{[bold,][italic,][strikeit]}}} Unlike some + of the other (choice) keys, the value of the \texttt{style} key is any + \emph{subset} of the values listed: for example, \texttt{style=bold} + paints the underlying text in bold, \texttt{style=\darg{bold,italic}} + yields bold-italic font, and, for a final example, + \texttt{style=\darg{italic,strikeit}} typesets its text in + strike-through italic. Multiple values must be enclosed in braces + (\darg{}) so that \pkg{xkeyval} can correctly parse them. +\begin{flushleft}\small %\previewtrue +\verb|\rtpara{para1}{To \span{style=bold}{boldly to go} where| +\hspace*{20pt}\verb|\span{style={bold,italic}}{no man has gone}| +\hspace*{20pt}\verb|\span{style={italic,strikeit}}{prior}| +\hspace*{20pt}\verb|\span{style={italic,bold}}{before.}|\\[3pt] +\rtpara{para1}{To \span{style=bold}{boldly to go} where +\span{style={bold,italic}}{no man has gone} +\span{style={italic,strikeit}}{prior}\span{style={italic,bold}}{before.}} +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{3in}{16bp*2} +\end{flushleft} + +\item[\uif{Color:}] + \texttt{color=\ameta{\upshape{\meta{rrggbb}|\darg{rgb(\meta{rrr,ggg,bbb})}}}} + Use this key to color the effected text. There are two + methods of defining color: +\begin{itemize} + \item[(1)] \meta{rrggbb} uses a 2-digit hexadecimal + value for each component; + \item[(2)] \texttt{rgb(\meta{rrr,ggg,bbb})} uses a decimal + value (0--255) for each component. +\end{itemize} + Because the second form contains + commas, it must necessarily be enclosed in braces (\darg{}) to be + correctly parsed by \pkg{xkeyval}. +\begin{flushleft}\small %\previewtrue +\verb|\rtpara{para1}{This is \span{color={rgb(255,0,0)}}{red} and| +\hspace*{20pt}\verb|this is \span{color=0000ff}{blue}.| +\rtpara{para1}{This is \span{color={rgb(255,0,0)}}{red} and this is \span{color=0000ff}{blue}.}\\[3pt] +\incFldCnt\textField[\Ff{\FfRichText}%\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{3in}{16bp} +\end{flushleft} +Things are not as bad as it seems. The \pkg{xcolor} package has the +wonderful command \cs{convertcolorspec} that converts colors between color +models. For example, we might define: +\begin{Verbatim}[fontsize=\small] +\convertcolorspec{named}{red}{RGB}{\rgbRed} +\convertcolorspec{named}{blue}{HTML}{\htmlBlue} +\convertcolorspec{named}{magenta}{RGB}{\rgbMagenta} +\convertcolorspec{named}{magenta}{HTML}{\htmlMagenta} +\end{Verbatim} +We can then use these named colors. +\begin{Verbatim}[fontsize=\small] +\rtpara{para1}{This is \span{color={rgb(\rgbRed)}}{red} and +this is \span{color=\htmlBlue}{blue}. We can do magenta two +ways, using \span{color={rgb(\rgbMagenta)}}{decimal +components} or using \span{color=\htmlMagenta}{hexadecimal +components}.} +\end{Verbatim} +\rtpara{para1}{This is \span{color={rgb(\rgbRed)}}{red} and this +is \span{color=\htmlBlue}{blue}. We can do magenta two ways, +using \span{color={rgb(\rgbMagenta)}}{decimal components} or +using \span{color=\htmlMagenta}{hexadecimal components}.}\par\smallskip +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{3in}{16bp*4}\\[6pt] +% +Notice that \verb|color={rgb(\rgbMagenta)}|, the value of \texttt{color}, is +still enclosed in braces since the expansion of \cs{rgbMagenta} contains +commas. +\end{description} + +\subsubsection{The \texorpdfstring{\uif{Link}}{Link} tab} + +We can create a link within rich text by using the \texttt{url} key from within +the first argument of the \cs{span} command. The syntax is \texttt{url=\ameta{URL}}. +\begin{Verbatim}[fontsize=\small] +\rtpara{para1}{Visit me at \span{url={http://www.acrotex.net}, + font='Courier New'}{http://www.acrotex.net}} +\end{Verbatim} +\begin{quote} +\rtpara{para1}{Visit me at \span{url={http://www.acrotex.net},font='Courier New'}{http://www.acrotex.net}}\par\smallskip +\incFldCnt\textField[\Ff{\FfRichText}%\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{3.5in}{16bp} +\end{quote} +It appears the \app{Acrobat/Reader} applications format a URL in underlined blue. We can override this however. +\begin{Verbatim}[fontsize=\small] +\rtpara{para1}{Visit me at \span{url={http://www.acrotex.net}, + color=\htmlMagenta,ulstyle=none,font='Courier New'} + {http://www.acrotex.net}} +\end{Verbatim} +\begin{quote} +\rtpara{para1}{Visit me at \span{url={http://www.acrotex.net}, + color=\htmlMagenta,ulstyle=none,font='Courier New'} + {http://www.acrotex.net}} +\par\smallskip +\incFldCnt\textField[\Ff{\FfRichText}%\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{3.5in}{16bp} +\end{quote} +Special characters are no problem, with the exception of wrapping a long URL +around to a different line (usually needed for display purposes): +\begin{Verbatim}[fontsize=\small] +\rtpara{para1}{Visit me at + \span{url={http://www.math.uakron.edu/~dpstory/% + acrotex.html#technical}}{AcroTeX at The University + of Akron}} +\end{Verbatim} +\begin{quote} +\rtpara{para1}{Visit me at \span{url={http://www.math.uakron.edu/% + ~dpstory/acrotex.html#technical}} + {AcroTeX at The University of Akron}}\par\smallskip +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{3.5in}{16bp*2} +\end{quote} + +\subsubsection{Miscellaneous markup of the \texorpdfstring{\uif{Font}}{Font} classification} + +There are several other attributes that are not key-values, but are +implemented through {\LaTeX} commands. + +\paragraph[Bold and italic]{Bold and italic.}\chgCurrLblName{Bold and italic}\label{para:BandI} +There are a couple of XHTML +elements that can also be used for bold and italic. +\begin{itemize} + \item \cs{bf\darg{\ameta{text}}} expands to \texttt{\ameta{text}} and places + \ameta{text} in bold font. May be used within a \cs{span} command. + \item \cs{it\darg{\ameta{text}}} expands to \texttt{\ameta{text}} and places + \ameta{text} in italic font. May be used within a \cs{span} command. +\end{itemize} +Both \cs{bf} and \cs{it} are local commands, undefined outside of the third argument +of \cs{rtpara}. Do not code \texttt{\ameta{text}} or \texttt{\ameta{text}} +directly, rather, always use the {\LaTeX} commands \cs{bf} and \cs{it}. \cs{bf} and \cs{it} may be nested. +\begin{Verbatim}[fontsize=\small] +\rtpara{para1}{We \bf{boldly} say that \it{italic} is used for +emphasis, but both \bf{\it{drive home the point}}.} +\end{Verbatim} +\begin{quote} +\rtpara{para1}{We \bf{boldly} say that \it{italic} is used for emphasis, +but both \span{color=\htmlBlue}{\bf{\it{drive home the point}}}.} +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{3.5in}{16bp*2} +\end{quote} + +\paragraph[Subscripts and superscripts]{Subscripts and superscripts.}% +\chgCurrLblName{Subscripts and superscripts}\label{para:SubSup} +Subscripts and superscripts are implemented through +{\LaTeX} commands \cs{sub} and \cs{sup}. +\begin{itemize} + \item \cs{sub\darg{\ameta{text}}} expands to + \texttt{\ameta{text}} and places \ameta{text} as a + subscript. + \item \cs{sup\darg{\ameta{text}}} expands to + \texttt{\ameta{text}} and places \ameta{text} as a + superscript. +\end{itemize} +Both \cs{sub} and \cs{sup} are local commands, undefined outside of the third argument +of \cs{rtpara}. Do not code these raw markups, rather always use \cs{sub} and \cs{sup}. +\begin{Verbatim}[fontsize=\small] +\rtpara{para1}{When we compile $x_2^3$ we get +\it{x}\sub{2}\sup{3}, nicely typeset or would you prefer +\it{x}\sup{3}\sub{2}?} +\end{Verbatim} +\begin{quote} +\rtpara{para1}{When we compile $x_2^3$ we get \it{x}\sub{2}\sup{3}, nicely typeset + or would you prefer \it{x}\sup{3}\sub{2}?} +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{3.5in}{16bp*5/2} +\end{quote} + + + +\subsection{The \texorpdfstring{\uif{Paragraph}}{Paragraph} tab}\label{s:Paratab} + +We begin by following the \uif{Paragraph} tab of +\hyperref[fig:FPtabs]{Figure~\ref*{fig:FPtabs}}. The top-most region on the \uif{Paragraph} tab +is labeled \uif{Alignment}. It consists of two separated regions, the one on the left is \emph{Horizontal Alignment}, +the one on the right is \emph{Vertical Alignment}. +\begin{description} + \item[\uif{Alignment}:]\leavevmode + \begin{description} + \item[Horizontal Alignment:] \texttt{halign=\ameta{\upshape{left|center|right|justify}}}\\The meaning of these + key-values are obvious, we'll illustrate with examples. +\begin{Verbatim}[fontsize=\small] +\rtpara[halign=left]{para1}{This paragraph is left + aligned or flush left. Let's have a few more words + to wrap around.} +\rtpara[halign=center]{para2}{This paragraph is + centered. Let's have a few more words to wrap + around.} +\rtpara[halign=right]{para3}{This paragraph is right + aligned or flush right. Let's have a few more words + to wrap around.} +\rtpara[halign=justify]{para4}{This paragraph is + justified. Space between words are stretched a + little to make this happen. It is adequate for + our purposes.} +\end{Verbatim} +\begin{flushleft} +\rtpara[halign=left]{para1}{This paragraph is left aligned or flush left. Let's have a few more words to wrap around.} +\rtpara[halign=center]{para2}{This paragraph is centered. Let's have a few more words to wrap around.} +\rtpara[halign=right]{para3}{This paragraph is right aligned or flush right. Let's have a few more words to wrap around.} +\rtpara[halign=justify]{para4}{This paragraph is justified. Space + between words are stretched a little to make this happen. It is adequate for our purposes.} +\setRVVContent{myContent}{{para1}{skipline}{para2}{skipline}{para3}{skipline}{para4}} %{skipline} +\setDefaultStyle{myDS}{font={Helvetica,sans-serif},size=10,color=000000}\par\medskip +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDS{myDS}}\RV{\useRVContent{myContent}}\V{\useVContent{myContent}}]{rtFld\the\fldCnt}{3in}{12bp*12} +\end{flushleft} +Horizontal alignment is applied to individual paragraph, unlike vertical alignment. + + \item[Vertical Alignment:] + \texttt{valign=\ameta{\upshape{top|middle|bottom}}} Again, + we shall illustrate by example. +\begin{Verbatim}[fontsize=\small] +\rtpara[valign=top]{para1}{This paragraph is vertically + aligned at the top.} +\rtpara[valign=middle]{para2}{This paragraph is + vertically aligned at the middle.} +\rtpara[valign=bottom]{para3}{This paragraph is + vertically aligned at the bottom.} +\end{Verbatim} +\begin{flushleft} +\rtpara[valign=top]{para1}{This paragraph is vertically aligned at the top.} +\rtpara[valign=middle]{para2}{This paragraph is vertically aligned at the middle.} +\rtpara[valign=bottom]{para3}{This paragraph is vertically aligned at the bottom.} +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{1.5in}{16bp*5}\kern4bp +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para2}}\V{\useV{para2}}]{rtFld\the\fldCnt}{1.5in}{16bp*5}\kern4bp +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para3}}\V{\useV{para3}}]{rtFld\the\fldCnt}{1.5in}{16bp*5}\par\medskip +\end{flushleft} +The \texttt{valign} key seems to apply to all paragraphs in the rich text form field, as illustrated below. +\begin{flushleft} +\setRVVContent{myContent}{{para1}{skipline}{para2}{skipline}{para3}}\par\smallskip %{skipline} +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRVContent{myContent}}\V{\useVContent{myContent}}]{rtFld\the\fldCnt}{4in}{16bp*8}\par\smallskip +\setRVVContent{myContent}{{para2}{skipline}{para1}{skipline}{para3}}\par\smallskip %{skipline} +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRVContent{myContent}}\V{\useVContent{myContent}}]{rtFld\the\fldCnt}{4in}{16bp*8} +\end{flushleft} +The vertical alignment for the whole rich text field obeys the \texttt{valign} key of the first paragraph. + + \item[\uif{Indents:}] Through the \uif{Indents} region of the \uif{Paragraph} tab, left and right margins may be set, + as well as the amount of indent. + \begin{description} + \item[\uif{Left:}] \texttt{margleft=\darg{dec}} The value of \darg{dec} is a nonnegative decimal number, it represents + the number of points to make the left margin. + \item[\uif{Right:}] \texttt{margright=\darg{dec}} The value of \darg{dec} is a nonnegative decimal number, it represents + the number of points to make the right margin. + +\medskip + Below is an example for both \texttt{margleft} and \texttt{margright}. +\begin{Verbatim}[fontsize=\small] +\rtpara[margleft=10,margright=40,halign=justify + ]{para1}{This is the first paragraph, it has + a left margin of 10pt and a right margin of + 40pt.} +\rtpara[halign=justify]{para2}{This is the second + paragraph. We demonstrate that the left and + margins can be applied separately to + paragraphs.} +\end{Verbatim} +\begin{flushleft} +\rtpara[font=10,margleft=10,margright=40,halign=justify]{para1}{This is the first +paragraph, it has a left margin of 10pt and a right margin of 40pt.} +\rtpara[font=10,halign=justify]{para2}{This is the second paragraph. We demonstrate that the +left and margins can be applied separately to paragraphs.} +\setRVVContent{myContent}{{para1}{skipline}{para2}}\par\smallskip %{skipline} +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRVContent{myContent}}\V{\useVContent{myContent}}]{rtFld\the\fldCnt}{4in}{14bp*6} +\end{flushleft} + +\medskip +\item[\uif{First \& By:}] Two key-values: \texttt{indent=\ameta{\upshape{none|first|hanging}}} \& \texttt{indentby=\ameta{dec}} + When \texttt{indent} key is set to \texttt{indent=first}, the first line is indented by an amount of \texttt{\ameta{dec}pt}; similarly, + if \texttt{indent=hanging}, there is a hang indent on the first line by an amount of \texttt{-\ameta{dec}pt} + (the minus sign (\texttt{-}) is automatically applied. The default indent amount it \texttt{12pt}.\smallskip\kern0pt +\begin{Verbatim}[fontsize=\small] +\rtpara[indent=first]{para1}{This paragraph is + indented by the default amount of 12pt.} +\rtpara[indent=first,indentby=24]{para2}{In this + second paragraph, we indent by 24pt, twice + as wide as the default.} +\rtpara[indent=hanging]{par3}{Here we have a third + paragraph, separated from the other two, with + the default hanging indentation.} +\end{Verbatim} +\begin{flushleft} +\rtpara[indent=first]{para1}{This paragraph is indented by the default amount of 12pt.} +\rtpara[indent=first,indentby=24]{para2}{In this second paragraph, we indent by 24pt, twice as wide as the default.} +\rtpara[indent=hanging]{para3}{Here we have a third paragraph, separated from the other two, with +the default hanging indentation.}\par\smallskip +\setRVVContent{myContent}{{para1}{para2}{skipline}{para3}}\par\smallskip %{skipline} +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRVContent{myContent}}\V{\useVContent{myContent}}]{rtFld\the\fldCnt}{3.5in}{16bp*15/2}\par\smallskip +\end{flushleft} + + \end{description} + +\goodbreak + \item[\uif{Spacing:}] + \begin{description} + \item[\uif{Above:}] \texttt{margtop=\ameta{dec}} A value of \ameta{dec} (positive, negative, or zero) adds + vertical space \emph{above} the paragraph.\medskip +\begin{Verbatim}[fontsize=\small] +\rtpara[margtop=12]{para1}{We put 12pt of extra + space above this paragraph.} +\rtpara[margtop=24]{para2}{Extra space above this + paragraph (24pt).} +\end{Verbatim} +\begin{flushleft} +\rtpara[margtop=12]{para1}{We put 12pt of extra space above this paragraph.} +\rtpara[margtop=24]{para2}{Extra space above this paragraph (24pt).} +\setRVVContent{myContent}{{para1}{para2}}\par\medskip %{skipline} +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRVContent{myContent}}\V{\useVContent{myContent}}]{rtFld\the\fldCnt}{3.5in}{16bp*6}\par\smallskip +\end{flushleft} + + \item[\uif{Below:}] \texttt{margbottom=\ameta{dec}} A value of \ameta{dec} (positive, negative, or zero) adds + vertical space below the paragraph.\par\medskip +\begin{Verbatim}[fontsize=\small] +\rtpara[valign=bottom,margbottom=12]{para1}{We put + \span{font=Courier,style=bold}{valign=bottom}, + but bring the paragraph up 12pt from there.} +\end{Verbatim} +\rtpara[valign=bottom,margbottom=12]{para1}{We put \span{font=Courier,style=bold}{valign=bottom}, but bring the +paragraph up 12pt from there.}\par\medskip +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{3.5in}{16bp*6} + +\medskip\goodbreak + \item[\uif{Line Spacing}] Sets the amount of vertical space between baselines. The key-values are +\begin{equation*} + \texttt{linespacing=\ameta{\upshape{single|oneandhalf|double|exact}}} +\end{equation*} + When \texttt{linespacing=exact}, use + \texttt{lineheight=\ameta{dec}} to set the space between baselines. +\begin{flushleft} +\rtpara[linespacing=oneandhalf]{para1}{This +paragraph has line spacing of oneandhalf. We will prattle on to get +some wraparound to the next line.} +\rtpara[linespacing=double]{para2}{This paragraph has double spacing. Once again, we'll +ramble, not prattle, on for several more words.} +\rtpara[linespacing=exact,lineheight=30]{para3}{Let's see what we get here, with +linespacing=exact, lineheight=30. Do we get significant separation between sentences?} +\setRVVContent{myContent}{{para1}{para2}{para3}}\par\medskip %{skipline} +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRVContent{myContent}}\V{\useVContent{myContent}}]{rtFld\the\fldCnt}{\linewidth-2bp}{16bp*12}\par\medskip +\end{flushleft} + +The paragraph declarations for the above rich text field are, +\begin{Verbatim}[fontsize=\small] +\rtpara[linespacing=oneandhalf]{para1}{This + paragraph has line spacing of oneandhalf. We + will prattle on to get some wraparound to the + next line.} +\rtpara[linespacing=double]{para2}{This paragraph + has double spacing. Once again, we'll ramble, + not prattle, on for several more words.} +\rtpara[linespacing=exact,lineheight=30]{para3} + {Let's see what we get here, with + linespacing=exact, lineheight=30. Do we + get significant separation between sentences?} +\end{Verbatim} +\medskip\noindent +The value of \texttt{lineheight}, which gives a `squeezing' effect between lines of the paragraph. + \end{description} + \end{description} +\end{description} + +\subsubsection{Miscellaneous markup for the \texorpdfstring{\protect\uif{Paragraph}}{Paragraph} classification} + +There are several other features that do not fit conveniently anywhere else, so here they are. + +\paragraph[Starting a new line using \texorpdfstring{\protect\cs{br}}{\textbackslash{br}}]% +{Starting a new line using \cs{br}.}\chgCurrLblName{Starting a new line using \protect\cs{br}}\label{para:NewLine} +The \cs{br} command expands to \texttt{
}. It should not be put within +the second argument of the \cs{span} command. As was the case with \cs{bf}, +\cs{it}, \cs{sub}, and \cs{sup}, do not directly code in \texttt{
} for +you will fail. +\begin{Verbatim}[xleftmargin=\amtIndent] +\rtpara{para1}{Let's begin a sentence,\br then we'll + start a new line for no apparent reason.\br\br + Let's double down on the new lines shall we?} +\end{Verbatim} +\begin{quote} +\rtpara{para1}{Let's begin a sentence,\br then we'll + start a new line for no apparent reason.\br\br Let's + double down on the new lines shall we?} +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{3.5in}{16bp*6} +\end{quote} + +\paragraph[Adding spaces with \texorpdfstring{\cs{spc}}{\textbackslash{spc}}]{Adding + spaces with \cs{spc}.}\chgCurrLblName{Adding + spaces with \protect\cs{spc}}\label{para:addSPC} + As with {\TeX} multiple spaces are ignored. To insert additional + `hard' spaces into the data stream, use the \cs{spc} command. (This is a local command that + is undefined outside \cs{rtpara}. +\begin{Verbatim}[xleftmargin=\amtIndent] +\rtpara{para1}{Way to go!\spc\spc\spc\spc The Coach} +\end{Verbatim} +Here we induce four hard spaces. +\begin{quote} +\rtpara{para1}{Way to go!{\spc\spc\spc\spc}The Coach} +\incFldCnt\textField[\Ff{\FfRichText}%\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{3.5in}{16bp} +\end{quote} + +\paragraph[Using the \texorpdfstring{\texttt{raw}}{raw} key]{Using +the \texttt{raw} key.}\chgCurrLblName{Using +the \texttt{raw} key}\label{para:RawKey} +There is another key, the \texttt{raw} key, that can be used +within the optional argument of \cs{rtpara} or within the first argument of \cs{span}. Using this key, +you can pass raw CSS2 markup. +\begin{Verbatim}[xleftmargin=\amtIndent] +\rtpara{para1}{We test the letter-spacing + attribute:\br\br\span{raw=letter-spacing:0.25em;} + {We test the letter-spacing attribute.}} +\end{Verbatim} +\begin{quote} +\rtpara{para1}{We test the letter-spacing attribute:\br\br\span{raw=letter-spacing:0.25em;}{We test the letter-spacing +attribute.}} +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{3.5in}{16bp*6} +\end{quote} +The syntax for a CSS2 attribute is `\texttt{\ameta{key}:\ameta{value};}', that is, keys and values are separated +by a colon (\texttt{:}) and the value is terminated with a semi-colon (\texttt{;}). + +It appears that tab stops work as well, these can be specified using the \texttt{raw} key as well. Refer to the +XFA Specifications~\cite{webpage:XFASpec}. + +\paragraph[Special characters]{Special characters.}\chgCurrLblName{Special characters}\label{para:SpecChars} + The \pkg{richtext} handles special characters pretty well. +Before \cs{rtpara} reads its third argument (\ameta{rich-text-paragraph}), a +number of changes in \cs{catcode}s and redefinitions occur. Within +\cs{rtpara}, the following characters \emph{do not need to be} escaped: +\texttt{\$}, \texttt{\#}, and \texttt{\string~} (tilde). The following +characters \emph{need to be} escaped: \texttt{\cs{<}}, \texttt{\cs{>}}, +\verb|\&|, \verb|\%| (the comment character (\texttt{\%}) retains its +{\LaTeX} meaning), \verb|\{|, and \verb|\}| (the left and right braces have +their usual \TeX/LaTeX{} meaning). The single quote (\texttt{'}) and double quote (\texttt{"}) may +be optionally escaped (to \cs{'} and \cs{"}). Escape them if something goes wrong. Use the +command \cs{cs\darg{\ameta{text}}} to obtain a literal backslash (`\verb|\|'); for example +\verb|\cs{LaTeX}|, shown below, expands to `\texttt{\cs{LaTeX}}'. +\begin{Verbatim}[fontsize=\small] +\rtpara{para1}{We \"test\" \'special\' \bf{characters:} + \<\>\&\{ #\% in \cs{LaTeX} $x^2_4$ becomes + \it{x}\sup{2}\sub{4} \{\}} +\end{Verbatim} +The above \cs{rtpara} paragraph has two forms the \psf{RV} form and the \psf{V} form; these +can be seen by using the \cs{useRV} and \cs{useV} commands. + +\begingroup\raggedright +\makeatletter\def\rt@SC{;\penalty0}\makeatother +\rtpara{para1}{We \"test\" 'special' \bf{characters:} \<\>\&\{ #\% in +\cs{LaTeX} $x^2_4$ becomes \it{x}\sup{2}\sub{4} \{\}} +\begin{quote} +\hspace*{-\leftmargini}\textbf{\cs{useRV\darg{para1}:}} \texttt{\useRV{para1}} + +\hspace*{-\leftmargini}\textbf{\cs{useV\darg{para1}:}} \texttt{\useV{para1}} +\end{quote} +The resulting rich text form field is seen below:\\[3pt] +\makeatletter\def\rt@SC{;}\makeatother +\rtpara{para1}{We \"test\" \'special\' \bf{characters:} \<\>\&\{ #\% in +\cs{LaTeX} $x^2_4$ becomes \it{x}\sup{2}\sub{4} \{\}} +\incFldCnt\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{3in}{16bp*4} +\par\endgroup +\medskip\noindent +That's pretty cool! + +\section{Rich text fields} + +Up to this point in the manual, the discussion has focused on creating rich +text strings. They may be fun to create and look at, but usually we want to +insert them into a text field. The comments here are for \pkg{eforms} +package, having checked with \pkg{hyperref} to see if there is a \psf{RV} +key, there is not. + +To create a rich text field, use the \cs{textField} command of \pkg{eforms}: +\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()] +\textField[\Ff{\FfRichText}\Ff{\FfMultiline} + \DS{!ameta(defaultstyle)}\RV{!ameta(rich-value)}\V{!ameta(value)} +]{!ameta(fld-name)}{!ameta(width)}{!ameta(height)} +\end{Verbatim} +Remove \cs{Ff\darg{\cs{FfMultiline}}} if the field is only a single line. We +discuss the \psf{DS} key (\cs{DS}) key first, followed by the keys \psf{RV} +and \psf{V} (\cs{RV} and \cs{V}). + +\subsection{The \texorpdfstring{\protect\psf{DS}}{DS} key} + +The value of the \psf{DS} key sets the formatting for the text field as a +whole. Most importantly, use it to set the font, text size, and color. +There is a built-in default style, defined below: +\bVerb\takeMeasure{\small\string\newcommand\string\useDefaultDS\darg{font-family:Helvetica,sans-serif;}}% +\begin{dCmd}[fontsize=\small,commandchars=!()]{\bxSize} +\newcommand\useDefaultDS{font-family:Helvetica,sans-serif; + font-size:12.0pt;font-style:normal;font-weight:normal; + text-align:left;color:#000000} +\end{dCmd} +\eVerb You may redefine it to suit your purposes, but this is what +\app{Acrobat}/\app{Adobe Reader} sets as the default style. I would recommend +\cs{setDefaultStyle} to define your own custom default style. \cs{useDefaultDS} is the reason +why most all rich text fields in this document use Helvetica at \texttt{12pt}! Use +\cs{useDefaultDS} as follows, shown in bold font: +\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()] +\textField[\Ff{\FfRichText}\Ff{\FfMultiline} + \DS{!textbf(\useDefaultDS)}\RV{!ameta(rich-value)}\V{!ameta(value)} +]{!ameta(fld-name)}{!ameta(width)}{!ameta(height)} +\end{Verbatim} + +\newtopic\noindent To create a custom default style use \cs{setDefaultStyle}. +\bVerb\takeMeasure{\string\setDefaultStyle\darg{\ameta{name}}\darg{\ameta{Font-Para-attrs}}}% +\begin{dCmd}[commandchars=!()]{\bxSize} +\setDefaultStyle{!ameta(name)}{!ameta(Font-Para-attrs)} +\useDS{!ameta(name)} +\end{dCmd} +Typically, the key-values associated with the \uif{Font} tab, Section~\ref{s:FLtabs}, may be used, +some key-values are removed, such as \texttt{ul}, \texttt{raise}, and \texttt{url}. When you've defined +a custom default style using \cs{setDefaultStyle}, insert \cs{useDS\darg{\ameta{name}}} as the value +of the \psf{DS} key.\incFldCnt +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small,commandchars=!()] +\rtpara{para1}{The font should be \'Myriad Pro\' at 10pt + and the default color of the field is webbrown, a color + defined in the web package.} +\setDefaultStyle{myStyle}{font='Myriad Pro',size=10, + color=!htmlWebBrown} +\textField[\Ff{\FfRichText}\Ff{\FfMultiline} + \DS{!textbf(\useDS{myStyle})}\RV{\useRV{para1}}\V{\useV{para1}} +]{rtFld!the!fldCnt}{3in}{16bp*3} +\end{Verbatim} +\begin{quote} +\rtpara{para1}{The font should be \'Myriad Pro\' at 10pt and the + default color of the field is webbrown, a color defined in the web package.} +\setDefaultStyle{myStyle}{font='Myriad Pro',size=10,color=\htmlWebBrown} +\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDS{myStyle}}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{3in}{16bp*3} +\end{quote} +Note the use of \cs{useRV} and \cs{useV} in the \psf{RV} and \psf{V} fields. +These are discussed in the next section. + +\subsection{The \texorpdfstring{\protect\psf{RV}}{RV} and +\texorpdfstring{\protect\psf{V}}{V} keys} + +The techniques to handle multiple paragraph fields are more complex (but not discouragingly so), +that topic will be taken up after the discussion of single paragraph fields. + +\subsubsection{Single paragraph fields} + +For a single paragraph field, there is only one \cs{repara} defined prior to the field. This string +data (both rich and plain) are inserted into the \cs{RV} and \cs{V} keys using \cs{useRV} and \cs{useV}. We repeat the +previous example, but with the emphasis on \cs{RV} and \cs{V}, and not on \cs{DS}. +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small,commandchars=!()] +\rtpara{para1}{The font should be \'Myriad Pro\' at 10pt + and the default color of the field is webbrown, a + color defined in the web package.} +\setDefaultStyle{myStyle}{font='Myriad Pro',size=10, + color=!htmlWebBrown} +\textField[\Ff{\FfRichText}\Ff{\FfMultiline} + \DS{\useDS{myStyle}}\RV{!textbf(\useRV{para1})}\V{!textbf(\useV{para1})} +]{rtFld!the!fldCnt}{3in}{16bp*3} +\end{Verbatim} +\begin{quote} +\rtpara{para1}{The font should be \'Myriad Pro\' at 10pt and the +default color of the field is webbrown, a color defined in the web package.} +\setDefaultStyle{myStyle}{font='Myriad Pro',size=10,color=\htmlWebBrown} +\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDS{myStyle}}\RV{\useRV{para1}}\V{\useV{para1}}]{rtFld\the\fldCnt}{3in}{16bp*3} +\end{quote} +We declare our rich paragraph string using \cs{rtpara} and name it +\texttt{para1}. We insert two data streams, one into the rich text key +(\cs{RV\darg{useRV\darg{para}}}) and the other into the (plain) text key +(\cs{V\darg{useV\darg{para}}}). + + +\subsubsection{Multiple paragraph fields} + +The strategy is to use several \cs{rtpara} commands to declare several rich +text paragraph. What is the best way to `paste' these paragraphs together? The method +developed is to use \cs{setRVVContent} command. +\bVerb\takeMeasure{\string\setRVVContent\darg{\ameta{name}}\darg{ \darg{\ameta{name\SUB{1}}}\darg{\ameta{name\SUB{2}}}...\darg{\ameta{name\SUB{k}}} }}% +\begin{dCmd}[commandchars=!()]{\bxSize} +\setRVVContent{!ameta(name)}{ {!ameta(name!SUB(1))}{!ameta(name!SUB(2))}...{!ameta(name!SUB(k))} } +\end{dCmd} +\eVerb where \ameta{name\SUB{i}} is the name of a rich text paragraph string, +or is the keyword \texttt{skipline}. The keyword \texttt{skipline} is +case-sensitive, it must be typed exactly. The role \texttt{skipline} plays is to +insert a blank line between paragraphs; \texttt{\darg{skipline}} inserts one +blank line between paragraphs. + +Having composed how the strings are to be put together, we need to insert them into +\psf{RV} and \psf{V}. +\bVerb\takeMeasure{\string\useRVContent\darg{\ameta{name}}}% +\begin{dCmd}[commandchars=!()]{\bxSize} +\useRVContent{!ameta(name)} +\useVContent{!ameta(name)} +\end{dCmd} +\eVerb where \ameta{name} is the name given in a previous \cs{setRVVContent} +command. Insert \cs{useRVContent} as the value of the \psf{RV} key, and +\cs{useVContent} as the value of the \psf{V} key. + +We take as an example, the one from Section~\ref{s:CreateRTS}.\incFldCnt +\begin{Verbatim}[fontsize=\small] +\rtpara[indent=first]{para1}{Now is the time for + \span{style={bold,italic,strikeit},color=ff0000}{J\374rgen} + and all good men to come to the aid of \it{their} + \bf{country}. Now is the time for \span{style=italic} + {all good} women to do the same.} +\rtpara[indent=first]{para2}{With rich text, we can format the + text within the text field. As a reader of this rich text + field, you can edit the contents of the box, feel free to + do so.} +\rtpara[halign=right]{para3}{D. P. Story + \span{url=http://www.acrotex.net}{AcroTeX.Net}} +\end{Verbatim} +Now set the content with \cs{setRVVContent}, naming it \texttt{myContent}. +\begin{Verbatim}[fontsize=\small] +\setRVVContent{myContent}{{para1}{para2}{skipline}{para3}} +\end{Verbatim} +Having done all that, we create our rich text field: +\begin{Verbatim}[fontsize=\small,commandchars=!()] +\begin{center} +\textField[\Ff{\FfRichText}\Ff{\FfMultiline} + \DS{\useDefaultDS} + !textbf(\RV{\useRVContent{myContent}}) + !textbf(\V{\useVContent{myContent}}) +]{rtFld!the!fldCnt}{4in}{10\baselineskip} +\end{center} +\end{Verbatim} +where, the \cs{RV} and \cs{V} keys are highlighted in bold for your viewing pleasure. +The rich text field the result of these declarations. + +\rtpara[indent=first]{para1}{Now is the time for +\span{style={bold,italic,strikeit},color=ff0000}{J\374rgen} and +all good men to come to the aid of \it{their} \bf{country}. Now +is the time for \span{style=italic}{all good} women to do the same.} +\rtpara[indent=first]{para2}{With rich text, we can format the text within +the text field. As a reader of this rich text field, you can edit the +contents of the box, feel free to do so.} +\rtpara[halign=right]{para3}{D. P. Story \span{url=http://www.acrotex.net}{AcroTeX.Net}} + +\setRVVContent{myContent}{{para1}{para2}{skipline}{para3}} + +\begin{center} +%\previewtrue +\incFldCnt +\textField[\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS}%\DS{\useDS{myDS}}% +\RV{\useRVContent{myContent}}\V{\useVContent{myContent}}]{rtFld\the\fldCnt}{4in}{10\baselineskip} +\end{center} + +The argument of \cs{setRVVContent} is pretty robust. In making our declarations, we can type: +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\setRVVContent{myContent} +{ + {para1} + {para2} + {skipline} + {skipline} + {para3} +} +\end{Verbatim} +Note that I've added a \texttt{skipline} so that are two blank lines after the second paragraph +and before the third paragraph. + +\bigskip\noindent +That's about it! Now, back to my retirement. \dps \space (See next page) + +\newpage + +Did I say that you can write captions to figures using rich text? + +\rtpara[valign=bottom,margbottom=12,margleft=12,margright=12]{farewell}{\bf{Thank you} for reviewing the +\span{font=Courier}{richtext} package, I hope you will enjoy exploring +it. Did I say that \span{url=www.acrotex.net,style=bold}{AcroTeX Rocks!}\spc\spc\spc\spc dps} + +\begin{center}\incFldCnt +\makebox[\dpswebW]{\makebox[0pt][l]{\textField[\BC{}\BG{}\autoCenter{n}\Ff{\FfRichText}\Ff{\FfMultiline} +\DS{\useDefaultDS} +\RV{\useRV{farewell}}\V{\useV{farewell}}]{rtFld\the\fldCnt}{\dpswebW}{\dpswebH}}% + \includegraphics{dpsweb}} +\end{center} + +\newpage + +\begin{thebibliography}{[1]}\label{references} +\addcontentsline{toc}{section}{\protect\numberline{}References} +%\backrefparscanfalse +\let\backrefprint\relax +\def\srtln{\vskip-\baselineskip\vskip-\parsep} +\def\lngln{\vskip-\parsep} + +\bibitem{webpage:XFASpec}\hypertarget{references}{}% +Adobe XML Forms Architecture (XFA) Specification, Version 3.3, Adobe Systems, Inc., +Jan.\ 2012\backrefprint + \lngln\hfill{\small\url{partners.adobe.com/public/developer/xml/index_arch.html}} + +\bibitem{webpage:CSS2} +Cascading Style Sheets (CSS 2.2) Specification, Editors: Bert Bos \textsl{et al.}, +World Wide Web Consortium (W3C), June 2011 + \lngln\hfill{\small\url{https://www.w3.org/TR/CSS2/}} + +\bibitem{tech:AcroJS} + JavaScript for Acrobat API Reference, + Adobe Systems, Inc., May 2015 + \lngln\hfill{\small\url{adobe.com/devnet/acrobat/documentation.html}} + +\bibitem{book:pdfspec} + PDF Reference, Sixth Edition, Version 1.7, Adobe Systems, Inc., 2006 + \lngln\hfill{\small\url{adobe.com/devnet/pdf/pdf_reference_archive.html}} + + +\end{thebibliography} + + + +% Adobe XML Forms Architecture (XFA) Specification, version 3.3, Jan. 2012, +% http://partners.adobe.com/public/developer/xml/index_arch.html + +\end{document} + +\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. diff --git a/texmf-dist/source/latex/richtext/richtext.dtx b/texmf-dist/source/latex/richtext/richtext.dtx new file mode 100644 index 00000000..51bb4118 --- /dev/null +++ b/texmf-dist/source/latex/richtext/richtext.dtx @@ -0,0 +1,775 @@ +%\iffalse +%<*copyright> +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% richtext package, %% +%% 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. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%\NeedsTeXFormat{LaTeX2e}[1997/12/01] +%\ProvidesPackage{richtext} +% [2016/10/03 v1.0c richtext: create rich text strings (dps)] +%<*driver> +\documentclass{ltxdoc} +\usepackage[colorlinks,hyperindex=false]{hyperref} +\usepackage{calc} +\let\uif\textsf\let\app\textsf +\let\pkg\textsf\let\env\texttt +\def\psf#1{\textsf{\textbf{#1}}} +%\pdfstringdefDisableCommands{\let\\\textbackslash} +\OnlyDescription % comment out for implementation details +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\InputIfFileExists{aebdocfmt.def}{\PackageInfo{richtext}{Inputting aebdocfmt.def}} + {\def\IndexOpt{\DescribeMacro}\def\IndexKey{\DescribeMacro}\let\setupFullwidth\relax + \PackageInfo{richtext}{aebdocfmt.def cannot be found}} +\begin{document} +\def\CMD#1{\textbackslash#1} + \GetFileInfo{richtext.sty} + \title{\textsf{richtext}: Creating Rich Text Strings} + \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{richtext.dtx} +\IfFileExists{\jobname.ind}{\newpage\setupFullwidth\par\PrintIndex}{\paragraph*{Index} The index goes here.\\Execute + \texttt{makeindex -s gind.ist -o richtext.ind richtext.idx} on the command line and recompile + \texttt{richtext.dtx}.} +\IfFileExists{\jobname.gls}{\PrintChanges}{\paragraph*{Change History} The list of changes goes here.\\Execute + \texttt{makeindex -s gglo.ist -o richtext.gls richtext.glo} on the command line and recompile + \texttt{richtext.dtx}.} +\end{document} +% +% \fi +% \MakeShortVerb{|} +% \InputIfFileExists{aebdonotindex.def}{\PackageInfo{web}{Inputting aebdonotindex.def}} +% {\PackageInfo{web}{cannot find aebdonotindex.def}} +% \begin{macrocode} +%<*package> +\RequirePackage{xkeyval} +\RequirePackage{ifxetex}[2006/08/21] +% \end{macrocode} +% \section{Introduction} +% This package supports the creation of \emph{rich text strings} (a type of pdf string). A +% rich text string is used in a rich text field as the value of the PDF key \psf{RV}. We also support +% the \psf{DS} key which determines the default style. +% +% From the PDF Reference (PDF~1.7), page 1310, ``these rich text strings are fully-formed XML documents that conform to the rich +% text conventions specified for the XML Forms Architecture (XFA) specification, +% which is itself a subset of the XHTML 1.0 specification, augmented with a +% restricted set of CSS2 style attributes.'' +% +% A rich text field may be created using the \pkg{eforms} package, like so +%\begin{verbatim} +% \textField[\Ff{\FfRichText}\Ff{\FfMultiline} +% \DS{}\RV{}\V{} +% ]{}{}{} +%\end{verbatim} +% This package provides commands and methods for `conveniently' create values +% \texttt{} and \texttt{} for \psf{RV} and +% \psf{DS}; additionally, the value \texttt{} of the \psf{V} key is the `plain' text +% value of the field; that is the text with all the formatting stripped out. +% +%\section{Preliminaries} +% \begin{macrocode} +\newif\ifrt@formfield \rt@formfieldtrue +\newif\ifrt@needsbody\rt@needsbodyfalse +\@ifpackageloaded{eforms}% + {\ifxetex\let\@eqV\@eqnuV\fi}{\rt@needsbodytrue} +\providecommand\eq@RV@Body{} +\providecommand\eq@RV@endBody{} +\def\rt@bBody{\ifrt@needsbody\eq@RV@Body\fi} +\def\rt@eBody{\ifrt@needsbody\eq@RV@endBody\fi} +% \end{macrocode} +%\section{Documentation for the \texorpdfstring{\protect\psf{RV}}{RV} key} +% +%We follow the \app{Acrobat} user interface. +%There two tabs of interest \uif{Font} and \uif{paragraph}. +% +%\begin{description} +%\item[Font]\leavevmode +%\begin{description} +% \item[\uif{Text}]\leavevmode +% \begin{itemize} +% \item\uif{Font:} \texttt{} +% \item\uif{Size:} 10 +% \item\uif{Baseline Shift:} 0 points +% \item\uif{Underline:} No Underline, Underline, Double Underline, Word Underline, Word Double Underline +% \item\uif{Style:} Bold, Italic, Strike-through +% \item\uif{Color:} RGB +% \end{itemize} +%\end{description} +%\item[Paragraph]\leavevmode +%\begin{description} +% \item[\uif{Alignment}]\leavevmode +% \begin{itemize} +% \item Horizontal: left, center, right, justify +% \item Vertical: top, middle, bottom +% \end{itemize} +% \item[\uif{Indents}]\leavevmode +% \begin{itemize} +% \item \uif{Left:} 0 points +% \item \uif{Right:} 0 points +% \item \uif{First:} None, First Line, Hanging +% \item \uif{By:} 0 points +% \end{itemize} +% \item[\uif{Spacing}]\leavevmode +% \begin{itemize} +% \item \uif{Above:} 0 points +% \item \uif{Below:} 0 points +% \item \uif{Line Spacing:} Single, 1.5 Lines, Double Lines, Exactly (At: 0 points) +% \end{itemize} +%\end{description} +%\item[Link] \uif{Enter a URL for this link} +%\item[On main Properties Menu bar:] Also supported are subscript (\texttt{\penalty0}) and superscript +%(\texttt{\penalty0})\leavevmode +%\end{description} +% \subsection{The \texorpdfstring{\protect\uif{Font}}{Font} +% and \texorpdfstring{\protect\uif{Link}}{Link} tabs} +% We support the attributes seen in the above list. We further +% support subscripts, superscript, and links in this section. +% \begin{macrocode} +\newif\ifrtfontstyle\rtfontstylefalse +% \end{macrocode} +% The keys of the \texttt{rtFont} key-value family. Supported keys are \texttt{font}, \texttt{size}, \texttt{raise}, \texttt{ulstyle}, +% \texttt{color}, \texttt{url}, and \texttt{style}. Superscripts and subscripts are handled differently. +% \begin{macrocode} +% \end{macrocode} +% The \IndexKey{font}\texttt{font} key's value is a font name, if the name contains a space, it should be enclosed +% in single quotes: \texttt{font=Arial} or \texttt{font='Myriad Pro'}. +% \begin{macrocode} +\define@key{rtFont}{font}[]{\def\rt@argi{#1}\ifx\rt@argi\@empty + \let\rf@font\@empty\else\rtfontstyletrue + \def\rf@font{font-family:#1}\fi} +% \end{macrocode} +% The value of \IndexKey{size}\texttt{size} is the size of the font, as measured in points +% \texttt{font=12pt}, note the use of the entity `\texttt{pt}'. +% \begin{macrocode} +\define@key{rtFont}{size}[]{\def\rt@argi{#1}\ifx\rt@argi\@empty + \let\rf@size\@empty\else\rtfontstyletrue\def\rf@size@num{#1}% + \def\rf@size@pt{#1pt}\def\rf@size{font-size:#1pt}\fi} +\def\rf@size@num{12}\def\rf@size@pt{12pt} +% \end{macrocode} +% The key \IndexOpt{raise}\texttt{raise} corresponds to the user interface item \uif{Baseline Shift}, +% measured in points, for example, \texttt{raise=6pt}. +% \begin{macrocode} +\define@key{rtFont}{raise}[]{\def\rt@argi{#1}\ifx\rt@argi\@empty + \let\rf@raise\@empty\else\rtfontstyletrue + \def\rf@raise{vertical-align:#1pt}\fi} +% \end{macrocode} +% The key \IndexOpt{ulstyle}\texttt{ulstyle} supplies an underline attribute, for example, +% \texttt{ul=word} underlines each word in the span. +% \begin{macrocode} +\define@choicekey+{rtFont}{ulstyle}[\val\nr]% + {none,ul,2ul,wul,2wul}[none]{% + \ifcase\nr\relax + \def\rf@ul{none}\or + \def\rf@ul{underline}\or + \def\rf@ul{double}\or + \def\rf@ul{word}\or + \def\rf@ul{double word}\fi + \rtfontstyletrue +}{} +% \end{macrocode} +% The key \IndexOpt{color}\texttt{color} supplies a color attribute for the text in the span. +% There are two formats: \texttt{rrggbb} (hex) and \texttt{rgb(r,g,b)} (0-255). For example, +% \texttt{color=ff0000} or \texttt{color=rgb(255,0,0)} both color the text red. +% \begin{macrocode} +\def\rt@r{r}\let\rt@One=1 \let\rt@Zero=0 +\def\rt@parseColor#1(#2\@nil{\def\rt@argi{#2}\ifx\rt@argi\@empty +\let\rt@rgbdec\rt@Zero\else\let\rt@rgbdec\rt@One\fi} +\def\rt@gobbletonil#1\@nil{} +\bgroup\@makeother\#\@makeother\&% +\gdef\rt@hashtag{#}\gdef\rt@amp{&}\egroup +\define@key{rtFont}{color}[]{\def\rt@argi{#1}\ifx\rt@argi\@empty + \let\rf@color\@empty\else\rtfontstyletrue + \rt@parseColor#1(\@nil + \if\rt@rgbdec\rt@One + \def\rf@color{color:#1}\else + \def\rf@color{color:\rt@hashtag#1}\fi +\fi} +\let\rf@color\@empty +% \end{macrocode} +% The key \IndexOpt{url}\texttt{url} enable the rich text string to contain +% a URL hypertext link. +% \begin{macrocode} +\define@key{rtFont}{url}[]{\def\rt@argi{#1}\ifx\rt@argi\@empty + \let\rt@url\@empty\else\rtfontstyletrue\def\rt@url{#1}\fi} +% \end{macrocode} +% The \texttt{rtFontStyle} family provides keys \IndexOpt{bold}\texttt{bold}, +% \IndexOpt{italic}\texttt{italic} and \IndexOpt{strikeit}\texttt{strikeit}. +% They are possible values of the \texttt{style} key, define below. The \texttt{style} key +% can take on one or several values. +% \begin{macrocode} +\define@choicekey+{rtFontStyle}{bold}[\val\nr]{normal,bold}[bold]% + {\edef\rfS@bold{\val}}{} +\define@choicekey+{rtFontStyle}{italic}[\val\nr]{normal,italic}[italic]% + {\edef\rfS@italic{\val}}{} +\define@key{rtFontStyle}{strikeit}[]{\def\rfS@strikeit{line-through}} +\let\rfS@normal\@empty\let\rfS@bold\@empty +\let\rfS@italic\@empty\let\rfS@strikeit\@empty +% \end{macrocode} +% Continuing the \texttt{rtFont} family, the \IndexOpt{style}\texttt{style} can take on +% several values: The key-value of \texttt{style=\{bold,italic,strikeit\}} sets the text to bold, italic, +% and strike out. Multiple attributes must be enclosed in parentheses, as shown above. +% \begin{macrocode} +\define@key{rtFont}{style}[]{\def\rt@argi{#1}\ifx\rt@argi\@empty + \let\rf@style\@empty\else\rtfontstyletrue\def\rf@style{#1}\fi} +% \end{macrocode} +% We provide a \IndexKey{raw}\texttt{raw} experimental key. The value of this key is passed through; it must +% be of the proper syntax. +% \begin{macrocode} +\define@key{rtFont}{raw}[]{\def\rt@argi{#1}\ifx\rt@argi\@empty + \let\rf@raw\@empty\else\rtfontstyletrue\def\rf@raw{#1}\fi} +% \end{macrocode} +% The \DescribeMacro{\resetRtFontKeys} is an internal command to reset all keys to their default values. +% \begin{macrocode} +\def\resetRtFontKeys{% rtFont family + \let\rf@font\@empty\let\rf@size\@empty + \let\rf@raise\@empty\let\rf@ul\@empty + \let\rf@color\@empty\let\rf@style\@empty\let\rt@url\@empty + \let\rf@raw\@empty + % rtFontStyle family + \let\rfS@normal\@empty\let\rfS@bold\@empty + \let\rfS@italic\@empty\let\rfS@strikeit\@empty + \rtfontstylefalse} +% \end{macrocode} +% Now give all keys their default values. +% \begin{macrocode} +\resetRtFontKeys +% \end{macrocode} +% As we interpret the rich text string, we must save it properly formatted in both +% rich and plain format. These are macro for accumulating the strings. +% \begin{macrocode} +\newcommand{\@AddToRichText}{\g@addto@macro\rt@RichText} +\newcommand{\@AddToPlainText}{\g@addto@macro\rt@PlainText} +% \end{macrocode} +% Some utility commands +% \begin{macrocode} +\def\rt@excl{!} +\def\rt@csarg#1#2{\expandafter#1\csname#2\endcsname} +% \end{macrocode} +% \begin{macro}{\useRV} +% The \cs{useRV} command expands to the rich string defined by \cs{rtpara} and is used as the value +% of the \psf{RV} key. +% \begin{macro}{\useV} +% The \cs{useV} command expands to the plain string defined by \cs{rtpara} and is used as the value +% of the \psf{V} key. +% \begin{macrocode} +\newcommand{\useRV}[1]{\@nameuse{#1-ri}} +\newcommand{\useV}[1]{\@nameuse{#1-pl}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \DescribeMacro{\rvorvstring}\cmd{rvorvstring} is similar to \cs{texorpdfstring}, the first argument +% is a rich string while the second is a plain string. The two must match correctly, or the PDF reader +% may not display correctly; on error the reader displays the plain text. +% \begin{macrocode} +\newif\if@rvstring \@rvstringfalse +\def\rvorvstring{\if@rvstring + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +% \end{macrocode} +% \paragraph*{Subscripts (\cs{sub}\DescribeMacro{\sub}) and superscripts (\cs{sup}\DescribeMacro{\sup})} There are two versions, one for rich text expansion +% and one for plain text expansion. Within \cs{rtpara} these two are \cs{let} to \cs{sub} and \cs{sup}. +% \begin{macrocode} +\def\rt@sub#1{\rvorvstring{#1}{#1}} +\def\rt@sup#1{\rvorvstring{#1}{#1}} +% \end{macrocode} +% Other supported markup: \cs{br}\DescribeMacro{\br}, \cs{bf}\DescribeMacro{\bf}, and +% \cs{it}\DescribeMacro{it}. +% \begin{macrocode} +\def\rt@br{\rvorvstring{
}{\string\r}} +\def\rt@bf#1{\rvorvstring{#1}{#1}} +\def\rt@it#1{\rvorvstring{#1}{#1}} +\def\rt@spc{\rvorvstring{\rt@amp + \rt@hashtag160\rt@SC}{ }} +% \end{macrocode} +% Some convenience commands +% \begin{macrocode} +\def\rt@SC{;}\def\rt@CN{:}\def\rt@fs{font-style}\def\rt@fw{font-weight} +\def\rt@td{text-decoration} +% \end{macrocode} +% \paragraph*{The \cs{span} command} There are two versions of the \cs{span} command, these +% are \cs{rt@remove@span} for plain text and \cs{rt@span} for rich text strings. +% \begin{macrocode} +\def\rt@remove@span#1#2{#2} +%\let\rt@remove@span\@gobble +% \end{macrocode} +% \begin{macro}{\rt@span} +% This is the internal \cs{span} command, it is \cs{let}\cs{span}\cs{rt@span}. Of course +% \cs{span} is a {\TeX} primitive, so we must be careful not to overwrite it. +% \begin{macrocode} +\def\rt@StyleAttr{\ifx\rf@font\@empty\else\rf@font\rt@SC\fi + \ifx\rf@size\@empty\else\rf@size\rt@SC\fi + \ifrt@formfield\ifx\rf@raise\@empty\else\rf@raise\rt@SC\fi\fi + \ifx\rf@ul\@empty\ifx\rfS@strikeit\@empty\else + \rt@td\rt@CN\rfS@strikeit\rt@SC\fi + \else\rt@td\rt@CN\rf@ul\ifx\rfS@strikeit\@empty\else\space + \rfS@strikeit\fi\rt@SC\fi + \ifx\rfS@bold\@empty\else\rt@fw\rt@CN\rfS@bold\rt@SC\fi + \ifx\rfS@italic\@empty\else\rt@fs\rt@CN\rfS@italic\rt@SC\fi + \ifx\rf@color\@empty\else\rf@color\rt@SC\fi + \ifx\rf@raw\@empty\else\rf@raw\fi} +% \end{macrocode} +% The \DescribeMacro{\span}\cs{span} is let to \cs{rt@span} within the \cs{rtpara} command. +% \changes{v1.0c}{2016/10/03}{Added \string\cs{rt@afterFont} to allow access by \string\pkg{annot\_pro}.} +% \begin{macrocode} +\let\rt@afterFont\relax +\newcommand\rt@span[2]{\resetRtFontKeys + \edef\x{\noexpand\setkeys{rtFont}{#1}}\x\rt@afterFont + \edef\x{\noexpand\setkeys{rtFontStyle}{\rf@style}}\x + \edef\rt@Style@ttr{\rt@StyleAttr}% + \ifx\rt@url\@empty +% \end{macrocode} +% We are processing a regular \cs{span}. +% \begin{macrocode} + \ifx\rt@StyleAttr\@empty\def\x{#2}\else + \edef\x{#2}\fi + \else +% \end{macrocode} +% We are processing a \cs{span} with the \texttt{url} key set. +% \begin{macrocode} + \ifx\rt@StyleAttr\@empty\edef\x{
#2}\else + \edef\x{#2\fi}\fi + \fi +} +% \end{macrocode} +% \end{macro} +% \subsection{The \texorpdfstring{\protect\uif{Paragraph}}{Paragraph} tab} +% We now come to the \cs{rtpara} command, which sets the attributes of the \uif{Paragraph} +% tab. +% \begin{macro}{\rtpara} +% This is how you define a rich text string, through the use of \cs{rtpara}. The command +% takes three options: (1) The optional first takes key-values just defined in the \texttt{rtFont} +% and the \texttt{rtPara} families. +%\begin{verbatim} +% halign: text-align:left|center|right|justify +% valign: text-valign:top|middle|bottom +% top is same as no text-valign attribute (vertical-align) +% Indents: +% Left: margin-left:10pt; +% Right: margin-right:10pt +% First: text-indent: 12pt (Indent) +% text-indent:-12pt; (Hanging) +% None +% Spacing > Line Spacing Line: height:18pt +% Above margin-top:11pt; Below margin-bottom:11pt; +% applies to all text in field, not individual paragraphs +% line-height: pt +% Single Space: line-height:\rt@size +% 1.5 Lines : line-height: 1.8*max(\rt@size) +% Double : line-height: 2.4*max(\rt@size) +% Exact : line-height: pt +%\end{verbatim} +%\paragraph*{Alignment} +% The \IndexKey{halign}\texttt{halign} key effects the horizontal alignment of a paragraph, choices +% are \texttt{left}, \texttt{center}, \texttt{right}, and \texttt{justify}. The default is \texttt{left}. +% \begin{macrocode} +\define@choicekey+{rtPara}{halign}[\val\nr]% + {left,center,right,justify}[left]{% + \ifcase\nr\relax + \def\rt@halign{text-align:left}\or + \def\rt@halign{text-align:center}\or + \def\rt@halign{text-align:right}\or + \def\rt@halign{text-align:justify}\fi + \rtfontstyletrue +}{} +% \end{macrocode} +% The \IndexKey{valign}\texttt{valign} seems to effect all paragraphs in the rich text field. Its value +% determines the vertical placement of the paragraphs: \texttt{top}, \texttt{middle}, and \texttt{bottom}. +% The default is \texttt{top}. +% \begin{macrocode} +\define@choicekey+{rtPara}{valign}[\val\nr]{top,middle,bottom}[top]{% + \ifcase\nr\relax + \def\rt@valign{text-valign:top}\or + \def\rt@valign{text-valign:middle}\or + \def\rt@valign{text-valign:bottom}\fi + \rtfontstyletrue +}{} +\let\rt@halign\@empty\let\rt@valign\@empty +% \end{macrocode} +%\paragraph*{Indents} +% With the \IndexKey{margleft}\texttt{margleft} and \IndexKey{margright}\texttt{margright} +% you set the left and right margins of the effected paragraph. The default is \texttt{0pt}. +% \begin{macrocode} +\define@key{rtPara}{margleft}{\def\rt@margleft{margin-left:#1pt}} +\define@key{rtPara}{margright}{\def\rt@margright{margin-right:#1pt}} +% \end{macrocode} +% The \IndexKey{indent}\texttt{indent} key sets the amount of indent of a paragraph, values +% are \texttt{none}, \texttt{first}, and \texttt{hanging}. The amount of indent is determined +% by the key \IndexKey{indentby}\texttt{indentby}, which is set to \texttt{12pt} by default. +% \begin{macrocode} +\define@choicekey+{rtPara}{indent}[\val\nr]{none,first,hanging}[none]{% + \edef\rt@indenttype{\nr}% +}{} +\define@key{rtPara}{indentby}[12]{\def\rt@indentby{#1pt}} +\let\rt@margleft\@empty\let\rt@margright\@empty +\def\rt@indenttype{0}\def\rt@indentby{12pt} +% \end{macrocode} +%\paragraph*{Spacing} +% With the \IndexKey{margtop}\texttt{margtop} and \IndexKey{margbottom}\texttt{margbottom} +% you set the space above and below a paragraph. The default is \texttt{0pt}. +% \begin{macrocode} +\define@key{rtPara}{margtop}[0]{\def\rt@margtop{#1pt}} +\define@key{rtPara}{margbottom}[0]{\def\rt@margbottom{#1pt}} +\def\rt@margtop{0pt}\def\rt@margbottom{0pt} +% \end{macrocode} +% The \IndexKey{linespacing}\texttt{linespacing} key the spacing +% lines. The default is \texttt{0pt}. Choices are \texttt{single} (spacing), +% \texttt{oneandhalf} (spacing), \texttt{double} (spacing), and \texttt{exact} (spacing). +% \begin{macrocode} +\define@choicekey{rtPara}{linespacing}[\val\nr]% + {single,oneandhalf,double,exact}[single]{%line-height + \edef\rt@linespacingtype{\nr}% + \ifcase\nr + \let\rt@linesp\@empty\or + \setlength{\@tempdima}{1.8pt*\rf@size@num}% + \edef\rt@linesp{\the\@tempdima}\or + \setlength{\@tempdima}{2.4pt*\rf@size@num}% + \edef\rt@linesp{\the\@tempdima}\or + \def\rt@linesp{\rf@size@pt}\fi +}{} +\let\rt@linesp\@empty\def\rt@linespacingtype{0} +% \end{macrocode} +% The \IndexKey{lineheight}\texttt{lineheight} key +% \begin{macrocode} +\define@key{rtPara}{lineheight}[]{\def\rt@lineheight{#1pt}} +\let\rt@lineheight\@empty +% \end{macrocode} +% More convenience definitions. +% \begin{macrocode} +\def\rtp@ti{text-indent}\def\rtp@mt{margin-top} +\def\rtp@mb{margin-bottom}\def\rtp@lh{line-height} +% \end{macrocode} +% We put the parameters all together. +% \begin{macrocode} +\def\rt@ParaAttr{% +% Alignment + \ifx\rt@halign\@empty\else\rt@halign\rt@SC\fi +\ifrt@formfield + \ifx\rt@valign\@empty\else\rt@valign\rt@SC\fi +% Indents + \ifx\rt@margleft\@empty\else\rt@margleft\rt@SC\fi + \ifx\rt@margright\@empty\else\rt@margright\rt@SC\fi + \ifcase\rt@indenttype\space\or + \rtp@ti\rt@CN\rt@indentby\rt@SC\or + \rtp@ti\rt@CN-\rt@indentby\rt@SC\fi +% Spacing + \rtp@mt\rt@CN\rt@margtop\rt@SC\rtp@mb\rt@CN\rt@margbottom\rt@SC + \ifx\rt@linesp\@empty\else + \if\rt@linespacingtype3% + \ifx\rt@lineheight\@empty + \rtp@lh\rt@CN\rt@linesp\rt@SC + \else + \rtp@lh\rt@CN\rt@lineheight\rt@SC + \fi + \else + \rtp@lh\rt@CN\rt@linesp\rt@SC + \fi + \fi +\fi +} +\begingroup +\catcode`\@=0 @catcode`@\=12 +@gdef@rtbs{\} +@endgroup +\def\rt@cs#1{\rvorvstring{\rtbs\rtbs#1}{\string\134#1}} +% \end{macrocode} +% The \DescribeMacro{\rtpara}\cmd{rtpara} takes three arguments. The first optional argument is key-value pairs +% from the \texttt{rtFont} and \texttt{rtPara} families. The second is a name this rich string. The third is the +% rich string itself, with supported markup. +% \changes{v1.0c}{2016/10/03}{Added \string\cs{rt@afterParaFont} to allow access by \string\pkg{annot\_pro}.} +% \begin{macrocode} +\let\rt@afterParaFont\relax +% \end{macrocode} +% \changes{v1.0c}{2016/10/03}{Added \string\cs{rt@dir}} +% (2016/10/03) Added the \texttt{dir} HTML attribute, default is \texttt{"ltr"}. +% \begin{macrocode} +\def\rt@dir{ dir="ltr"} +% \end{macrocode} +% \begin{macrocode} +\newcommand\rtpara[2][]{\begingroup + \setkeys{rtPara,rtFont}{#1}\rt@afterParaFont + \edef\rt@Para@ttr{\rt@ParaAttr\rt@StyleAttr}% + \global\let\rt@RichText\@empty + \global\let\rt@PlainText\@empty + \def\rt@ctrlName{#2}% +% \end{macrocode} +% Before taking the next parameter, we'll make some special definitions. +% \begin{macrocode} + \def\{{\string\{}\def\}{\string\}}% + \def\1{\string\1}\def\2{\string\2}\def\3{\string\3}% + \@makeother\$\@makeother\#\@makeother\^\@makeother\_\@makeother\~% + \@makeother\&\def\&{\rvorvstring{\string&}{\string&}}% req + \@makeother\<\def\<{\rvorvstring{\string<}{\string<}}% req + \@makeother\>\def\>{\rvorvstring{\string>}{\string>}}% + \@makeother\'\def\'{\rvorvstring{\string'}{\string'}}% + \@makeother\"\def\"{\rvorvstring{\string"}{\string"}}% + \let\cs\rt@cs + \rtpara@cont} +% \end{macrocode} +% \cs{rtpara} continues with \cs{rtpara@cont}. +% \begin{macrocode} +\def\rtpara@cont#1{% + \let\sup\rt@sup\let\sub\rt@sub + \let\br\rt@br\let\bf\rt@bf\let\it\rt@it + \let\spc\rt@spc + \let\span\rt@remove@span + \@rvstringfalse + \edef\x{#1}\expandafter\@AddToPlainText\expandafter{\x}% + \let\span\relax + \@rvstringtrue + \rtpara@i#1\span!;\endgroup} +% \end{macrocode} +% Step 1: \cs{rtpara} comes here. +% \begin{macrocode} +\def\rtpara@i#1\span#2;{\def\argii{#2}% + \g@addto@macro\rt@RichText{#1}% + \ifx\argii\rt@excl + \rt@csarg\xdef{\rt@ctrlName-ri}% + {% + \rt@RichText

% + }% + \rt@csarg\xdef{\rt@ctrlName-pl}{\rt@PlainText}% + \let\rt@next\relax + \else + \def\rt@next{\rtpara@ii#2;}% + \fi +\rt@next} +% \end{macrocode} +% Step 2: \cs{rtpara@i} comes here. +% \begin{macrocode} +\def\rtpara@ii#1#2#3;{\def\argii{#2}% + \ifx\argii\rt@excl + \let\rt@next\relax + \else + \let\span\rt@span + \let\br\rt@br\let\bf\rt@bf\let\it\rt@it +% \end{macrocode} +% We have encountered \cs{span\{\}\{\}} and we expand it appropriately. +% \begin{macrocode} + \@rvstringtrue + \span{#1}{#2}\edef\rt@tmp{\noexpand\g@addto@macro + \noexpand\rt@RichText{\x}}\rt@tmp + \rt@csarg\xdef{\rt@ctrlName-ri}% + {% + \rt@RichText

% + }% + \rt@csarg\xdef{\rt@ctrlName-pl}{\rt@PlainText}% + \let\span\relax + \def\rt@next{\rtpara@i#3;}% + \fi\rt@next} +% \end{macrocode} +% \end{macro} +% There is a special definition for \IndexKey{par}\texttt{par} and +% \IndexKey{skipline}\texttt{skipline}, these should be used between paragraphs to add +% a blank line between paragraphs. +% \begin{macrocode} +\rt@csarg\def{par-ri}{}\rt@csarg\def{par-pl}{\string\r} +\rt@csarg\def{skipline-ri}% + {

\rt@amp + \rt@hashtag160;

} +\rt@csarg\def{skipline-pl}{\string\r\space} +\def\rt@skipline{skipline} +\rt@csarg\def{br-ri}{}\rt@csarg\def{br-pl}{\string\r} +% \end{macrocode} +% \section{Documentation for the \texorpdfstring{\psf{DS}}{DS} key} +% The \psf{DS} key sets the default style. According to the JavaScript API for Acrobat reference, +% the default style supports alignment, textFont, (font family, font style, font weight), textColor, +% and textSize +%\begin{verbatim} +% /DS(font: Helvetica,sans-serif 12.0pt;text-align:left;color:#000000) +% f=this.getField("RichText") +% style=f.defaultStyle; +% style.fontFamily; +% style.fontStyle; +% style.fontWeight; +% style.textFont; +% style.alignment; +% style.textColor; +% style.textSize; +%\end{verbatim} +% \begin{macrocode} +\def\rt@DSAttr{\ifx\rf@font\@empty\else\rf@font\rt@SC\fi + \ifx\rf@size\@empty\else\rf@size\rt@SC\fi + \ifx\rf@raise\@empty\else\rf@raise\rt@SC\fi + \ifx\rf@ul\@empty\ifx\rfS@strikeit\@empty\else + \rt@td\rt@CN\rfS@strikeit\rt@SC\fi + \else\rt@td\rt@CN\rf@ul\ifx\rfS@strikeit\@empty\else\space + \rfS@strikeit\fi\rt@SC\fi + \ifx\rfS@bold\@empty\else\rt@fw\rt@CN\rfS@bold\rt@SC\fi + \ifx\rfS@italic\@empty\else\rt@fs\rt@CN\rfS@italic\rt@SC\fi + \ifx\rf@color\@empty\else\rf@color\rt@SC\fi} +% \end{macrocode} +% \begin{macro}{\useDefaultDS} +% A fixed definition for default \psf{DS}. +% \begin{macrocode} +\newcommand\useDefaultDS{font-family:Helvetica,sans-serif;% + font-size:12.0pt;font-style:normal;font-weight:normal;% + text-align:left;color:\rt@hashtag000000} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\setDefaultStyle} +%\begin{verbatim} +% \setDefaultStyle{myDS}{font=Arial,...,color=#ff0000} +%\end{verbatim} +% \begin{macrocode} +\newcommand{\setDefaultStyle}[2]{\begingroup + \edef\x{\noexpand\setkeys{rtFont}{#2}}\x + \edef\x{\noexpand\setkeys{rtFontStyle}{\rf@style}}\x + \ifx\rf@ul\@empty\else + \let\rt@ul\@empty\PackageWarning{richtext}{% + The ul key is not supported within\MessageBreak + \string\setDefaultStyle. Ignoring it}\fi + \ifx\rf@raise\@empty\else + \let\rt@raise\@empty\PackageWarning{richtext}{% + The raise key is not supported within\MessageBreak + \string\setDefaultStyle. Ignoring it}\fi + \ifx\rt@url\@empty\else\let\rf@url\@empty + \PackageWarning{richtext}{% + The url key is not supported within\MessageBreak + \string\setDefaultStyle. Ignoring it}\fi +% \end{macrocode} +% Fill in any missing essential attributes. +% \begin{macrocode} + \ifx\rf@font\@empty + \def\rf@font{font-family:Helvetica,sans-serif}\fi + \ifx\rf@size\@empty\def\rf@size{font-size:\rf@size@pt}\fi + \ifx\rf@color\@empty\def\rf@color{color:\rt@hashtag000000}\fi + \rt@csarg\xdef{#1-DS}{\rt@DSAttr}% +\endgroup} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\useDS} +% \verb!\useDS{}! +% \begin{macrocode} +\newcommand{\useDS}[1]{\@nameuse{#1-DS}} +% \end{macrocode} +% \end{macro} +% \section{Passing the rich content to \texorpdfstring{\psf{RV}}{RV} +% and \texorpdfstring{\psf{V}}{V}} +% \begin{macro}{\setRVVContent} +% |\setRVVContent{{name_1}{name_1}...{name_k}}| or |\setRVVContent{name}| +% \changes{v1.0a}{2016/09/30}{Allow \string\cs{setRVVContent} to have only one argument.} +% \begin{macrocode} +\newif\ifrt@firsttok \rt@firsttoktrue +\newif\ifrt@itsskipline \rt@itsskiplinefalse +% \end{macrocode} +% \cmd{\rt@addtoRVV} is a convenience internal command to add the name \texttt{\#1} +% both to \cs{toks0}, which holds the \psf{RV} string, and to \cs{toks2}, which holds the \psf{V} string. +% \begin{macrocode} +\def\rt@addtoRVV#1{% + \toks4={\useRV{#1}}\edef\rt@tmpRV{\the\toks0\the\toks4}% + \toks4={\useV{#1}}\edef\rt@tmpV{\the\toks2\the\toks4}% + \toks0=\expandafter{\rt@tmpRV}\toks2=\expandafter{\rt@tmpV}% +} +% \end{macrocode} +% We begin \cmd{\setRVVContent} +% \begin{macrocode} +\def\rt@testifbgroup{\@ifnextchar\bgroup + {\let\rt@nultiargs=1\rt@gobbletonil} + {\let\rt@nultiargs=0\rt@gobbletonil}} +\newcommand{\setRVVContent}[2]{\begingroup + \rt@firsttoktrue \rt@itsskiplinefalse + \rt@testifbgroup#2\@nil + \def\contName{#1}\toks0={}\toks2={}\toks4={}% + \if\rt@nultiargs1\def\rt@next{\setRVVContent@i#2;}\else + \def\rt@next{\setRVVContent@i{#2};}\fi\rt@next} +\def\setRVVContent@i#1{\def\rt@argi{#1}% + \ifx\rt@argi\rt@SC +% \end{macrocode} +% If a semi-colon (\cs{rt@SC}), we are finished. Make the definitions +% for \psf{RV} and \psf{V}, and exit. +% \begin{macrocode} + \rt@csarg\xdef{\contName-vcont}{\the\toks0}% + \rt@csarg\xdef{\contName-pcont}{\the\toks2}% + \let\rt@next\endgroup + \else +% \end{macrocode} +% See if the current argument has been declared earlier by \cs{rtpara}. +% If not, we issue a warning and ignore it. +% \begin{macrocode} + \expandafter\ifx\csname #1-ri\endcsname\relax + \PackageWarning{richtext} + {The name '#1' is not declared,\MessageBreak + will ignore it. Check the spelling}% + \def\rt@next{\setRVVContent@i}% + \else +% \end{macrocode} +% We want to automatically induce \texttt{par} between non-\texttt{lineskip} +% tokens. The automatic \texttt{par} goes in prior to the token, so we first +% skip the first token. +% \begin{macrocode} + \ifrt@firsttok\rt@firsttokfalse\else +% \end{macrocode} +% Not the first token, see if it is a \texttt{skipline}, if yes, register it +% as a skip line for the next token. +% \begin{macrocode} + \ifx\rt@argi\rt@skipline + \rt@itsskiplinetrue + \else +% \end{macrocode} +% If the previous token was a \texttt{skipline}, we don't induce a \texttt{par}. +% \begin{macrocode} + \ifrt@itsskipline + \rt@addtoRVV{br}\rt@itsskiplinefalse + \else +% \end{macrocode} +% Finally, if this is not a \texttt{skipline}, and the previous token is not a \texttt{skipline}, +% we induce a \texttt{par}. +% \begin{macrocode} + \rt@addtoRVV{par}% + \fi + \fi + \fi + \rt@addtoRVV{#1}% + \def\rt@next{\setRVVContent@i}% + \fi + \fi\rt@next +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\useRVContent} +% \verb!\useRVConent{}! +% \begin{macro}{\useVContent} +% \verb!\useVConent{}! +% \begin{macrocode} +\def\useRVContent#1{\@nameuse{#1-vcont}} +\def\useVContent#1{\@nameuse{#1-pcont}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macrocode} +% +% \end{macrocode} +\endinput + +% iPad +% Landscape +% w: 7.75in +% h: 5.8in diff --git a/texmf-dist/source/latex/richtext/richtext.ins b/texmf-dist/source/latex/richtext/richtext.ins new file mode 100644 index 00000000..6d01d8e1 --- /dev/null +++ b/texmf-dist/source/latex/richtext/richtext.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-2016 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{2012/01/22} +\def\batchfile{richtext.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{richtext.sty}{\from{richtext.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/yt4pdf/doc/yt4pdf_man.pdf b/texmf-dist/source/latex/yt4pdf/doc/yt4pdf_man.pdf new file mode 100644 index 00000000..5b0bbca6 Binary files /dev/null and b/texmf-dist/source/latex/yt4pdf/doc/yt4pdf_man.pdf differ diff --git a/texmf-dist/source/latex/yt4pdf/doc/yt4pdf_man.tex b/texmf-dist/source/latex/yt4pdf/doc/yt4pdf_man.tex new file mode 100644 index 00000000..97febc04 --- /dev/null +++ b/texmf-dist/source/latex/yt4pdf/doc/yt4pdf_man.tex @@ -0,0 +1,737 @@ +% makeindex < aebpro_man.idx > aebpro_man.ind +\documentclass{article} +\usepackage[fleqn]{amsmath} +\usepackage[ + web={centertitlepage,designv,tight*,usetemplates, + forcolorpaper,latextoc,pro},%usesf, + eforms,aebxmp +]{aeb_pro} +%\usepackage{multicol} +\usepackage{aeb_mlink} +\usepackage{array} +\usepackage[altbullet]{lucidbry} + +\usepackage{makeidx} +\makeindex +\usepackage{acroman} + +\usepackage[active]{srcltx} + +\def\expath{../examples} + +\urlstyle{rm} +\def\pkg{\textsf} +\let\app\textsf +\let\opt\texttt +\let\uif\textsf +\let\env\texttt +\def\meta#1{\textit{\texttt{#1}}} +\def\ameta#1{$\langle\textit{\texttt{#1}}\rangle$} +\newdimen\aebdimen \aebdimen6pt %\partopsep \advance\aebdimen\partopsep +\newcommand\bVerb[1][]{\begingroup#1\vskip\aebdimen\parindent0pt}% +\def\eVerb{\vskip\aebdimen\endgroup\noindent} +\def\SUB#1{\ensuremath{{}_{\text{#1}}}} +\def\darg#1{\texttt{\{#1\}}} +\def\takeMeasure{\bgroup\obeyspaces\takeMeasurei} +\def\takeMeasurei#1{\global\setbox\webtempboxi\hbox{\ttfamily#1}\egroup} +\def\bxSize{\wd\webtempboxi+2\fboxsep+2\fboxrule} +\let\amtIndent\leftmargini +\makeatletter +\def\setDisplayNumber#1#2{\kern0pt + \setlength\abovedisplayshortskip{0pt}% + \setlength\belowdisplayshortskip{0pt}% + \setlength\abovedisplayskip{0pt}% + \setlength\belowdisplayskip{0pt}% + \begin{equation}\label{#2}\end{equation}\kern0pt +} +\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} +\renewcommand*\descriptionlabel[1]{\hspace\labelsep + \normalfont #1} +\setcounter{secnumdepth}{4} +\setcounter{tocdepth}{5} +\renewcommand*{\theparagraph}{\texorpdfstring{\protect\P\protect\ }{\textparagraph}} +\renewcommand{\paragraph} + {\renewcommand{\@seccntformat}[1]{\theparagraph}% + \@startsection{paragraph}{4}{0pt}{6pt}{-3pt}{\color{\aeb@subsubsectioncolor}\bfseries}} +\renewcommand*\l@paragraph{\@dottedtocline{4}{5.0em}{1em}} %{7.0em}{4.1em}} +\def\chgCurrLblName#1{\def\@currentlabelname{#1}} +\def\echgCurrLblName#1{\edef\@currentlabelname{#1}} +\makeatother + + +\newcommand{\YouTube}{\textsf{YouTube}} + + +%\def\tutpath{doc/tutorial} +%\def\tutpathi{tutorial} + +\DeclareDocInfo +{ + university={\AcroTeX.Net}, + title={The \texorpdfstring{\textsf{yt4PDF} Package\\[1em]}{: } + Playing \texorpdfstring{\YouTube}{YouTube} Videos in PDF}, + author={D. P. Story}, + email={dpstory@acrotex.net}, + subject={Playing YouTube Videos in PDF}, + talksite={\url{www.acrotex.net}}, + version={1.1, 2016/10/04}, + keywords={AcroTeX, PDF, YouTube, rmannot}, + 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=-40pt,fontsize=large,color=aeb} %,afterskip=1sp} +\subsectionLayout{indent=-20pt,color=aeb} %,afterskip=1sp} +\subsubsectionLayout{indent=0pt,color=aeb} %,afterskip=1sp} +\subsubDefaultDing{\texorpdfstring{$\bullet$}{\textrm\textbullet}} + +\newenvironment{eqComments}[1][\strut]{\smallskip\leftskip-\labelwidth +\item[]\textbf{\textcolor{blue}{#1}}}{\par\smallskip} + +%\pagestyle{empty} +%\parindent0pt\parskip\medskipamount + +\chngDocObjectTo{\newDO}{doc} +\begin{docassembly} +var titleOfManual="The yt4pdf MANUAL"; +var manualfilename="Manual_BG_Print_yt4pdf.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}\label{s:intro} + + I believe that I was vaguely aware of the \href{http://code.google.com/apis/youtube/flash_api_reference.html} +{{\YouTube} ActionScript 3.0 Player},\footnote{The YouTube AcrionScript 2.0 Player API + has been deprecated as of January 27, 2015; however, it is still supported, for now.} but never pursued it because of my +general lack of interest in {\YouTube} (\url{www.youtube.com}). Recently, I +came across a very nice demo PDF that used the API, see +%\mlhref{http://www.uvsar.com/pdftube/}{PDF Tube - {\YouTube} API wrapper for PDF documents}. +``PDF Tube - {\YouTube} API wrapper for PDF documents'' (the page has +since been removed). +The SWF file and JavaScript are made freely available, so I +downloaded it, and was sufficiently impressed to port the example to +{\LaTeX} using various members of the {Acro\negthinspace\TeX} Fine Family of Software +\verb!:-{)!. The SWF file and JavaScript are due to the good folks at +\textbf{UVSAR} (\url{www.uvsar.com}). The \textbf{UVSAR}'s sample demo also appeared in the forums of +the \href{http://acrobatusers.com/forum/javascript/embed-youtube-video-pdf}{Acrobat User +Community}. + +The \textsf{yt4pdf} package uses the \textsf{rmannot} to embed the \textsf{SWF} +file that plays the {\YouTube} videos. There is a complete set of buttons +that come with the package to control the video: play, pause, stop +loading, rewind, load a video by its {\YouTube} video ID, and a button to +view a video on the {\YouTube} web site.\footnote{Some videos do not allow +embedded playback, and must be viewed on the {\YouTube} web site.} + +% http://acrobatusers.com/news/youtube-widget-acrobat + +\subsection{Sample files} + +The following are the sample files shipped with \textsf{yt4pdf}: +\begin{itemize} + \item \texttt{yt4pdf-1.tex} demonstrates the basic functionality of + the {\YouTube} RMA: the use of the poster, including \cs{ytComboList}, + \cs{ytComboBtn}, and \cs{ytvId}. + \item \texttt{yt4pdf-2.tex} experiments with different ways the + {\YouTube} annotation can be displayed + \begin{itemize} + \item As a small icon, videos are played in a floating window, + buttons displayed in the running footer. + \item[] This one uses a rollover, popup menu system (as opposed to + a combo box). The \textsf{popupmenu} package is used. + \item Using a built-in poster, with the combo box under the + annotation, control buttons in running footer. + \item Same as above, but control buttons moved to a two column + format. + \item Using the custom {\YouTube} for PDF poster with combo box and + control buttons under the RMA. + \end{itemize} + \item \texttt{yt4pdf-3.tex} illustrates the usage of the \texttt{play} and \texttt{load} + keys that are passed in the optional parameter of \cs{ytRmAnnot}. +\end{itemize} +% Advanced examples \href{http://www.math.uakron.edu/~dpstory/aebblog.html}{AeB Blog site}. + +\section{Requirements} + +This package is part of \textsf{AeB Pro}, which means Acrobat Distiller is +used to create the PDF; the package requires \textsf{rmannot}, which +creates rich media annotations. Therefore, we require +\begin{equation*} + \boxed{\text{\large\bfseries Adobe Acrobat, version 9.0 or later}} +\end{equation*} +To use this package, the document author must have AeB and AeB Pro +installed, as well as \textsf{rmannot}. The manual for \textsf{rmannot} +needs to be read closely to properly install it and to function correctly. +I have made \textsf{rmannot} a required package, and recently +have made the \textsf{popupmenu} package required as well. + +\section{Configuring your installation} + +In addition to configuring the \textsf{rmannot} package correctly, the +\textsf{yt4pdf} package needs configuring as well. The \textsf{yt4pdf} package +comes with a configuration file \texttt{yt4pdf.cfg}. Open this file in +your favorite editor to see +\begin{Verbatim}[fontsize=\small] +% yt4pdf config file. Delete the \endinput below and replace the path +% provided with the path to the swf folder of your yt4pdf installation. +% This path is used to locate the pdf_tube_basic.swf file, used to play +% YouTube videos. +\endinput +\renewcommand{\ytFolder}{C:/Users/Public/Documents/My TeX Files/% +tex/latex/aeb/aebpro/yt4pdf/swf} +\end{Verbatim} +Edit this file so that \cs{ytFolder} points to the \texttt{swf} folder on +your computer. + +\section{The Rich Mediation Annotation for {\YouTube}} + +The Rich Media Annotation (RMA) used is \cs{ytRmAnnot}, its definition +uses the command \cs{rmAnnot}, which is defined in the \textsf{rmannot} package. +\bVerb\takeMeasure{\string\ytRmAnnot[\ameta{KV-pairs}]\darg{\ameta{name}}\darg{\ameta{width}}\darg{\ameta{height}}}% +\begin{minipage}{\linewidth} +\begin{minipage}{\bxSize} +\xdef\panelWidth{\the\linewidth}% +\begin{Verbatim}[frame=single,commandchars=!(),rulecolor=\color{red}] +\ytRmAnnot[!ameta(KV-pairs)]{!ameta(name)}{!ameta(width)}{!ameta(height)} +\end{Verbatim} +\end{minipage}\hfill +\begin{minipage}{\linewidth-\panelWidth} +\setDisplayNumber\label{display:ytRmAnnot} +\end{minipage}\end{minipage}\endgroup +\PD +\begin{enumerate} + \item The first (optional) parameter is used to pass the key-value pairs of the + \cs{rmAnnot} command. Additionally, there are two other \ameta{KV-pairs} + recognized, specialized to the \cs{ytRmAnnot} command. + \begin{itemize} + \item \texttt{play=\ameta{vID}} Loads and plays the {\YouTube} video with + video ID of \ameta{vID}. + \item \texttt{load=\ameta{vID}} Loads the specified video's thumbnail + (as specified by \ameta{vID}) and prepares the player to play + the video. The player does not request the \textsf{FLV} until the play + button is pressed. + \end{itemize} + When you want to play a {\YouTube} video when the page containing + the annotation is opened, use the \texttt{play} key; for example + \texttt{play=GZ9e3Dy7obA} causes the video whose video ID is + \texttt{GZ9e3Dy7obA} to play when the page is opened. + + See the manual for the \pkg{rmannot} package for more details on the + key-value pairs that can be passed through the optional first + parameter. + + \item The \ameta{name} parameter is a name used to refer to the + annotation through underlying JavaScript code. The \ameta{name} + should consist of only letters and numbers. The value of this + parameter is placed in the macro \cs{ytCurrRMAName}. This macro is + used internally by the various control buttons. + + \item The width of the annotation. + + \item The height of the annotation. +\end{enumerate} + +\paragraph*{Annot Dimensions.} +The width and height of the {\YouTube} annotation should be \texttt{571bp} +and \texttt{330bp}, respectively, or any re-scaling of these dimensions. + +Examples, +\begin{Verbatim} + \ytRmAnnot[posternote=AcroTeX PDF Tube,play=eNzrn8-JFSE, + deactivated=pageclose]{YouTube1}{571bp}{330bp} +\end{Verbatim} +is a ``full-size'' annotation, while +\begin{Verbatim} + \ytRmAnnot[posternote=AcroTeX PDF Tube,load=eNzrn8-JFSE, + deactivated=pageclose]{YouTube1}{571bp/2}{330bp/2} +\end{Verbatim} +is half that size. The first example above plays a video when +the page is opened, the second example loads the thumbnail, and waits play +the video. + +You can also re-scale using either \cs{resizebox} or +\cs{scalebox} from the \textsf{graphicx} package. +\begin{Verbatim} + \resizebox{2in}{!}{\ytRmAnnot[posternote=AcroTeX PDF Tube, + deactivated=pageclose]{YouTube1}{571bp}{330bp}} +\end{Verbatim} +or, using \cs{scalebox}, +\begin{Verbatim} + \scalebox{.5}{\ytRmAnnot[posternote=AcroTeX PDF Tube, + deactivated=pageclose]{YouTube1}{571bp}{330bp}} +\end{Verbatim} + +\textbf{Running multiple videos at once.} At the time of this writing, the +\pkg{yt4pdf} package is not designed to run more than one video at a +time, that's not saying it cannot be done, however. It is not recommended, +indeed, why would you want to look at two {\YouTube} videos at the same +time? + +For documents with multiple {\YouTube} annotations over +several pages it is recommended, therefore, that the \texttt{deactivated=pageclose} +should be used in the optional parameter list of the \cs{ytRmAnnot} +command. + +\subsection{The \texorpdfstring{\protect\textsf{yt4pdf}}{yt4pdf} Poster} + +The \textsf{rmannot} package provides a standard poster (a gray rectangle +with text in the lower left corner). However, there is an especially +designed poster, designed by the folks at \textbf{UVSAR}. (See +Figure~\ref*{pdfytPoster}, page~\pageref*{pdfytPoster}.) + +\begin{figure}[htb] +\begin{center} + \includegraphics[scale=.5]{./graphics/pdfyt_poster}\\ + \caption{YouTube for PDF poster}\label{pdfytPoster} +\end{center} +\end{figure} + +\goodbreak +\textbf{To use this really cool poster:} +\begin{enumerate} + \item Insert the following line into the preamble, +\begin{Verbatim}[fontsize=\small] + \makePoster[bb=0 0 570.794 329.887]{pdfyt_poster}{pdfyt_poster} +\end{Verbatim} +The optional parameter should remain as it is, it adjusts the bounding +box so that the poster is properly placed. + +\item Use the \texttt{poster} key in the first optional parameter of +\cs{ytRmAnnot}, like so, +\begin{Verbatim} + \ytRmAnnot[poster=pdfyt_poster, + deactivated=pageclose]{YouTube}{571bp}{330bp}} +\end{Verbatim} +\end{enumerate} + +\subsection{Control Buttons} + +The {\YouTube} rich media annotation (as created by \cs{ytRmAnnot}), comes +with six (optional) control buttons. +\bVerb\takeMeasure{\string\ytSelect[\ameta{KV-pairs}]\darg{\ameta{vID}}\darg{\ameta{width}}\darg{\ameta{height}}}% +\begin{minipage}{\bxSize} +\begin{Verbatim}[frame=single,commandchars=!(),rulecolor=\color{red}] +\ytPlayToggle[!ameta(KV-pairs)]{!ameta(width)}{!ameta(height)} +\ytStopLoading[!ameta(KV-pairs)]{!ameta(width)}{!ameta(height)} +\ytMuteToggle[!ameta(KV-pairs)]{!ameta(width)}{!ameta(height)} +\ytRewind[!ameta(KV-pairs)]{!ameta(width)}{!ameta(height)} +\ytSelect[!ameta(KV-pairs)]{!ameta(vID)}{!ameta(width)}{!ameta(height)} +\ytOpenWeb[!ameta(KV-pairs)]{!ameta(width)}{!ameta(height)} +\end{Verbatim} +\end{minipage}\endgroup +\PD The labels are self-explanatory, the \texttt{} parameter is +the standard \textsf{eforms} optional parameter for changing the +appearance of the form. The \ameta{vID} parameter for \cs{ytSelect} is +a {\YouTube} video ID. + +\goodbreak +\CmdDescription We give brief descriptions of each of the six control +buttons. +\begin{itemize} + \item \cs{ytPlayToggle}: + This button has several functions, \textsf{PAUSE}, \textsf{PLAY}, \textsf{BUFFERING}, and \textsf{REPLAY}. + Initially the button label is on \textsf{PAUSE} (pressing it pauses a playing video); + the button label reads \textsf{PLAY} when the video is loaded and paused (pressing it plays or resumes + the video); while the video is loading, the button label is + \textsf{BUFFERING\dots}. After the video finishes playing, the button + label is changed to \textsf{Replay}. + \item \cs{ytStopLoading}: Pressing this button stops the streaming of the currently playing + video. If the video is started again, there will be some buffering before the play begins. + \item \cs{ytMuteToggle}: This button toggles and sound off and on. Button labels are + \textsf{MUTE} and \textsf{UNMUTE}. + \item \cs{ytRewind}: If the video is playing, this button + stops the video, rewinds it to the beginning, and starts play again. If the video + is paused, this button rewinds the video to the beginning, the video remains paused. + \item \cs{ytSelect}: When this button is pressed, a response dialog opens. + The user enters a {\YouTube} video ID into the field. On pressing OK, this video is played. + + \item[] The second parameter \ameta{vID} is the default video + that is displayed in the input box of the response box that opens. + \item[] \textbf{Note:} Some {\YouTube} videos are security + restricted and cannot be played through an embedded player, such as the one used here. + If video ID of a video that does not allow embedded playback, a dialog appears giving + the user the opportunity to view the video on the web. + \item \cs{ytOpenWeb}: The user has the option of pressing this button to view the + current video on the web at \texttt{www.youtube.com}. +\end{itemize} + +The first (optional) parameter can be used to modify the appearance of the +individual buttons. To modify the appearances of the buttons as a group, +use, +\bVerb\takeMeasure{\string\ytBtnPresets\darg{\ameta{KV-pairs}}}% +\begin{minipage}{\bxSize} +\begin{Verbatim}[frame=single,commandchars=!(),rulecolor=\color{red}] +\ytBtnPresets{!ameta(KV-pairs)} +\end{Verbatim} +\end{minipage}\eVerb +The key-value pairs are ones defined for form fields created by the \textsf{eforms} +package. The default definition is, +\begin{Verbatim}[xleftmargin=\amtIndent] +\ytBtnPresets{\BC{.5 0 0}\S{S}\textFont{HeBo}} +\end{Verbatim} + +The second parameter of \cs{ytRmAnnot} is the name to be associated with +that annot; the name of the annot is not known until after the annot is +defined. The command \cs{DeclareYTName}, +\bVerb\takeMeasure{\string\DeclareYTName\darg{\ameta{name}}}% +\begin{minipage}{\bxSize} +\begin{Verbatim}[frame=single,commandchars=!(),rulecolor=\color{red}] +\DeclareYTName{!ameta(name)} +\end{Verbatim} +\end{minipage}\eVerb +allows you to define the name prior to the creation of the annot. This is +useful if you want to place the control buttons above the annot itself. By +specifying the name, the control buttons will know the name of the annot +they are to control. + +\subsection{Controls for playing a {\YouTube} video} + +To actually play a video, you must pass a video ID to the underlying SWF +file. We present two methods here, through links and through a combo box. +One of the example files, \texttt{yt4pdf-2.pdf}, illustrates another method +using a popup menu. + +\subsubsection{Playing a video through a link} + +The command \cs{ytvId} creates a list such that when you click on it, the +video specified by the second parameter of the command is played in the +associated Rich Media annotation created by \cs{ytRmAnnot}. The associated +RMA is the one most recently defined prior to the link. If the link occurs +before the target RMA, you can use \cs{DeclareYTName} to set the name of +the target RMA for the link. +\bVerb\takeMeasure{\string\ytvId[\ameta{KV-pairs}]\darg{\ameta{vID}}\darg{\ameta{text}}}% +\begin{minipage}{\bxSize} +\begin{Verbatim}[frame=single,commandchars=!(),rulecolor=\color{red}] +\ytvId[!ameta(KV-pairs)]{!ameta(vID)}{!ameta(text)} +\end{Verbatim} +\end{minipage}\endgroup +\PD The first parameter takes the usual key-value pairs for links created +by the \textsf{eforms} package. The second parameter is the video ID to be +played. The third parameter is the text to be displayed by the link, +usually the title of the {\YouTube} video. + +\cs{ytvId} loads and plays the specified video; there is an +\texttt{*}-form of this command, +\bVerb\takeMeasure{\string\ytvId*[\ameta{KV-pairs}]\darg{\ameta{vID}}\darg{\ameta{text}}}% +\begin{minipage}{\bxSize} +\begin{Verbatim}[frame=single,commandchars=!(),rulecolor=\color{red}] +\ytvId*[!ameta(KV-pairs)]{!ameta(vID)}{!ameta(text)} +\end{Verbatim} +\end{minipage}\eVerb +When this form is used, the {\YouTube} thumbnail image for the video is +displayed. The player does not +request the video until the play button is pressed. + +You can set the appearances for a all links created by \cs{ytvId} by using +\cs{ytvIdPresets} +\bVerb\takeMeasure{\string\ytvIdPresets\darg{\ameta{KV-pairs}}}% +\begin{minipage}{\bxSize} +\begin{Verbatim}[frame=single,commandchars=!(),rulecolor=\color{red}] +\ytvIdPresets{!ameta(KV-pairs)} +\end{Verbatim} +\end{minipage}\eVerb +The key-value pairs are ones defined for form fields created by the \textsf{eforms} +package. The default definition is +\begin{Verbatim}[xleftmargin=\amtIndent] +\ytvIdPresets{\linktxtcolor{webbrown}} +\end{Verbatim} + +\subsubsection{Playing a video using a combo box} + +You can created a combo box with a play list. There are three commands +that create the combo list, \cs{ytPlayList}, \cs{ytComboList}, and +\cs{ytComboBtn}. +\bVerb\takeMeasure{\string\ytPlayList\darg{\ameta{default\_vId}}\darg{\ameta{playlist}}}% +\begin{minipage}{\bxSize} +\begin{Verbatim}[frame=single,commandchars=!(),rulecolor=\color{red}] +\ytPlayList{!ameta(default_vId)}{!ameta(playlist)} +\end{Verbatim} +\end{minipage}\eVerb +This command sets the play list to be displayed in the combo box, it needs +to be executed before the actual creation of the combo box (using +\cs{ytComboList}). The first parameter is the default video ID, this title +will be initially displayed by the combo box. The \ameta{playlist} is +an array of video IDs and title pairs. The \ameta{playlist} is conveniently defined +within the \cs{declarePlayList} command: +\bVerb\takeMeasure{\string\declarePlayList\darg{\ameta{\cs{plCmd}}}\{\%}% +\begin{minipage}{\bxSize} +\begin{Verbatim}[frame=single,commandchars=!(),rulecolor=\color{red}] +\declarePlayList{!ameta(\plCmd)}{% + !ameta(array-of-vIDs-titles) +} +\end{Verbatim} +\end{minipage}\eVerb The array of video IDs and title pairs are saved under the command name \ameta{plCmd}. +For example +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\declarePlayList{\playList}{% + [(GZ9e3Dy7obA)(Kung-Fu Fighting {(Bruce Lee version)})] + [(eNzrn8-JFSE)(Open at Adobe)] + [(5y9-EVmreU4)(Lori's Corner: Episode \#1)] +} +\end{Verbatim} +The format for each pair is \texttt{[(\ameta{vId})(\ameta{title})]}. Notice that in the case +of the Bruce Lee video, the title itself contains parentheses; to avoid parsing errors when +the \pkg{eforms} package builds the combo box, \emph{enclose these parentheses in a pair of matching braces}. + +In the example above, the array, in its correct format, is loaded +conveniently into a macro \cs{playList} declared through \cs{declarePlayList}. The macro may then be passed as the +second parameter of \cs{ytPlayList}. Thus, an example of the use of +\cs{ytPlayList} is +\begin{Verbatim}[xleftmargin=\amtIndent] +\ytPlayList{eNzrn8-JFSE}{\playList} +\end{Verbatim} + +There is a convenience command, \cs{ytIdTitle}, that is used to build +a \cs{ytPlayList}. +\bVerb\takeMeasure{\string\ytIdTitle\darg{\ameta{vId}}\darg{\ameta{title}}}% +\begin{minipage}{\bxSize} +\begin{Verbatim}[frame=single,commandchars=!(),rulecolor=\color{red}] +\ytIdTitle{!ameta(vId)}{!ameta(title)} +\end{Verbatim} +\end{minipage}\eVerb +The above example can the be re-written as, +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\declarePlayList{\playList}{% + \ytIdTitle{GZ9e3Dy7obA}{Kung-Fu Fighting {(Bruce Lee version)}} + \ytIdTitle{eNzrn8-JFSE}{Open at Adobe} + \ytIdTitle{5y9-EVmreU4}{Lori's Corner: Episode \#1} +} +\end{Verbatim} + +\paragraph*{The combo box.} The syntax for the combo box itself is +\bVerb\takeMeasure{\string\ytComboList[\ameta{KV-pairs}]\darg{\ameta{width}}\darg{\ameta{height}}}% +\begin{minipage}{\bxSize} +\begin{Verbatim}[frame=single,commandchars=!(),rulecolor=\color{red}] +\ytComboList[!ameta(KV-pairs)]{!ameta(width)}{!ameta(height)} +\end{Verbatim} +\end{minipage}\eVerb +The \cs{ytComboList} is a combo box of video Ids and titles. The user +selects a video based on its title, then presses the \textsf{PLAY} button +(see \cs{ytComboBtn} below). This command is executed \emph{before} +\cs{ytComboBtn} to set the play list, and the default value. +\PD\begin{itemize} + \item \ameta{KV-pairs}: (optional) The key-value pairs associated with an + \textsf{eforms} form field, used to change the appearance of the field. + \item \ameta{width}: The width of the combo box + \item \ameta{height}: The height of the combo box +\end{itemize} +The appearance can be changed locally by the optional first parameter. The +command \cs{ytComboListPresets} is used to change all combo lists create +by \cs{ytComboList}. The command takes has one parameter, the key-value +pairs for changing the appearance. The default definition is +\verb!\ytComboListPresets{}!. + +Originally, I visualized only one combo box per page, recently that +mind-set has changed. Should you want several combo boxes, as created by +\cs{ytComboList}, each box must have a unique name. To that end +\bVerb\takeMeasure{\string\ytNewBaseName[\ameta{name}]}% +\begin{minipage}{\bxSize} +\begin{Verbatim}[frame=single,commandchars=!(),rulecolor=\color{red}] +\ytNewBaseName[!ameta(name)] +\ytResetBaseName +\end{Verbatim} +\end{minipage}\eVerb +The first command, \cs{ytNewBaseName}, has one optional parameter, if no +parameter is supplied, then a base name will be generated; otherwise, +the title of the combo box will be based on the \ameta{name} passed to +it. For the command \cs{ytResetBaseName}, the first command effects the JS +and the field name of \cs{ytComboBtn} described below. +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small,commandchars=!()] +\begin{itemize} +\item \ytNewBaseName\relax\ytPlayList{!ameta(default_Id)}{\playListii}% + \ytComboList{2.5in}{11bp}\kern1bp\ytComboBtn{33bp}{11bp} +\item \ytNewBaseName[Listiii]\ytPlayList{!ameta(default_Id)}{\playListiii}% + \ytComboList{2.5in}{11bp}\kern1bp\ytComboBtn{33bp}{11bp} +\end{itemize} +\end{Verbatim} +\textbf{\textcolor{red}{Note:}} Because \cs{ytNewBaseName} has an optional +argument, you should place a \cs{relax} after \cs{ytNewBaseName} to prevent +premature expansion of the \cs{ytplayList} command that follows. + +\newtopic Once the selection has been made from the combo box, the user +can play the selection by pressing the button created by \cs{ytComboBtn}. +\bVerb\takeMeasure{\string\ytComboBtn[\ameta{KV-pairs}]\darg{\ameta{width}}\darg{\ameta{height}}}% +\begin{minipage}{\bxSize} +\begin{Verbatim}[frame=single,commandchars=!(),rulecolor=\color{red}] +\ytComboBtn[!ameta(KV-pairs)]{!ameta(width)}{!ameta(height)} +\end{Verbatim} +\end{minipage}\eVerb +\textbf{\textcolor{red}{Note:}} If you hold down the shift key and click on +the button, the thumbnail poster is loaded, and the player is ready to +play the video. +\PD\begin{itemize} + \item \ameta{KV-pairs}: (optional) The key-value pairs associated with an + \textsf{eforms} form field, used to change the appearance of the field. + \item \ameta{width}: The width of the combo box + \item \ameta{height}: The height of the combo box +\end{itemize} +The appearance can be changed locally by the optional first parameter. The +command \cs{ytComboBtnPresets} is used to change all combo lists create +by \cs{ytComboBtn}. The command takes has one parameter, the key-value +pairs for changing the appearance. The default definition is +\verb!\ytComboBtnPresets{}!. + +\subsection{Using the \textsf{popupmenu} package} + +The \pkg{popupmenu} a required package, \pkg{yt4pdf} adds some commands and +JS to facilitate its usage. The demo file for this feature is +\texttt{yt4pdf-2.tex}, where you will find some comments in the source file. + +In the preamble, we define our menu structure, + +\begin{Verbatim}[numbers=left,xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] +\begin{popupmenu}{YTMenu} + \puIdTitle{Select a You Tube Video}{} % A title has no yt Id + \begin{submenu}{title=Music Videos} + \puIdTitle{Ink Spots - If I didn't care}{rvwfLe6sLis} + \puIdTitle{Ink Spots - My Prayer}{h7KJCns5v3g} + \end{submenu} + \begin{submenu}{title=Adobe Related Videos} + \puIdTitle{Open at Adobe}{eNzrn8-JFSE} + \puIdTitle{Lori's Corner Episode \#1}{5y9-EVmreU4} + \puIdTitle{Intro to PDF Portfolios}{T9Yzo_hlwP0} + \end{submenu} +\end{popupmenu} +\ytPopupMenuData{\YTMenu} +\end{Verbatim} +The \cs{puIdTitle} is a convenience macro to enter the menu data; the +first argument is the title of the {\YouTube} video, the second argument +is the {\YouTube} ID. There may be several \texttt{popupmenu} environments, each +with a different name. After the last such environment, execute the +\cs{ytPopuMenuData} command, seen in line~(12). Its argument is a token +list of all popupmenus; here, we have only one. If there are several, they +are listed as follows: +\begin{Verbatim}[xleftmargin=\leftmargini] +\ytPopupMenuData{\YTMenu\myEduVids\myMusicVids} +\end{Verbatim} + +The menu is displayed as an mouse-over action of button, here is the +verbatim listing from \texttt{yt4pdf-2.tex} + +\begin{Verbatim}[numbers=left,xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] +\DeclareYTName{ytInWindow} +... +\newcommand{\myPBPresets}{% + \CA{YT Menu}\textColor{0 0 1}\W1\BC{}\textSize{0}\S{S} + \AA{\AAMouseEnter{\JS{ytPopupMenu("\ytCurrRMAName",YTMenu)}}}} +\setWindowDimPos{% + position={halign=center,valign=center,hoffset=0,voffset=0}, + width={default=571},height={default=330}}% +\setlength{\pichskip}{3pt} +\parpic(.25in,.25in){% +\parbox{.25in}{\offinterlineskip\resizebox{.25in}{!}{% + \ytRmAnnot[windowed,poster=yt_poster,deactivated=pageclose]% + {ytInWindow}{72bp}{72bp}% +}}} +\pushButton[\presets{\myPBPresets}]{myYTMenu}{20bp}{5bp} +On this page, the You Tube annotation is icon size and the +video is played in a floating window. +\end{Verbatim} +\textbf{Comments:} +\begin{itemize} + \item In line~(1) we declare the name of the {\YouTube} annot to be + used. We do this because we need to use the name before the annot is + defined. The annot itself is not defined until line~(12). + \item Lines~(3)--(5): Define a command to be used for passing the + button attributes for the \texttt{myYTMenu} button (seen in + line~(15)). In line~(5) we define the action for the button; it is a + mouse enter action that executes the \texttt{ytPopupMenu} JS function + defined in the \texttt{yt2pdf} package. This function takes two + arguments, the first is the name of the target Rich Media Annotation + hat will display the videos, this name is \verb!"\ytCurrRMAName"!, + where \cs{ytCurrRMAName} holds the name of the most recent {\YouTube} + annotation. The second argument is the name of the menu data (defined + by the \texttt{popupmenu} environment. + \item Lines~(9)--(14): We create an annot so that it appears as an + icon, the text of the paragraph wraps around the icon. This is what we + do with the \cs{parpic} command. In lines~(12)--(13), we create the + {\YouTube} annot using \cs{ytRmAnnot}. + \item In line~(15) we have a button with a mouse rollover action. Note + we pass the earlier defined presets to this button. +\end{itemize} +See the complete source file in \texttt{yt4pdf-2.tex}. + + +\section{Language localizations} + +The default language for \textsf{yt4pdf} is English; the English strings +that \textsf{yt4pdf} uses are listed below. These can be redefined as +desired. +\begin{Verbatim} +\newcommand{\ytStrPLAY}{PLAY} +\newcommand{\ytStrREPLAY}{REPLAY} +\newcommand{\ytStrPAUSE}{PAUSE} +\newcommand{\ytStrBuffering}{Buffering...} +\newcommand{\ytStrStopLoading}{Stop Loading} +\newcommand{\ytStrMUTE}{MUTE} +\newcommand{\ytStrUNMUTE}{UNMUTE} +\newcommand{\ytStrREWIND}{REWIND} +\newcommand{\ytStrLoadVideo}{Load Video} +\newcommand{\ytStrWatchOnWeb}{Watch on YouTube} +% response dialog box associated with ytSelect() +\newcommand{\ytRespQues}{Enter the YouTube Video ID} +\newcommand{\ytRespTitle}{Load a Video} +\newcommand{\ytRespLabel}{ID:} +% alert error messages +\newcommand{\ytStrErrorVideoNotFound}{Error: Video not found} +\newcommand{\ytStrErrorNoEmbed}{Error: This video does not allow + embedded playback \r\r Would you like to view this video + on the web?} +\newcommand{\ytStrConnecTimedOut}{Connection timed out, try again.} +\end{Verbatim} + +\bigskip + +That's all for now, I simply must get back to my retirement. {\dps} + +\end{document} diff --git a/texmf-dist/source/latex/yt4pdf/examples/config_intacc.def b/texmf-dist/source/latex/yt4pdf/examples/config_intacc.def new file mode 100644 index 00000000..ac2e0f8e --- /dev/null +++ b/texmf-dist/source/latex/yt4pdf/examples/config_intacc.def @@ -0,0 +1,29 @@ +\newpage + +\begin{minipage}[t]{3in}\parindent20pt\small +\noindent\makebox[\linewidth][c]{\bfseries\normalsize\color{blue}Configuring +Preferences}\\[3pt] +To avoid the security alerts when loading FLV files from You Tube, +configure your preferences as described below. + +Start Adobe Reader 9 or later (or Acrobat~9 or later), and open the \textbf{Preferences} +dialog box (located in the menu system by selecting \textbf{Edit +\texttt{>} Preferences} or using the shortcut Ctrl+K); select +\textbf{Trust Manager} from the left-hand \textbf{Categories} panel. On +the right side of the dialog box, press the button labeled \textbf{Change +Settings}, shown below.\par\vspace*{3pt}\centering +\includegraphics[width=\linewidth]{graphics/trustmanager} +\end{minipage}\hfill +\begin{minipage}[t]{\linewidth-3in-10pt}\small +In the \textbf{Manage Internet Access}, make selections as +indicated by the red boxes.\par\medskip +\noindent\makebox[\linewidth][c]{\bfseries\normalsize\color{blue}For Version 9}\\[3pt] +\noindent\makebox[\linewidth][c]{\includegraphics[width=2in]{graphics/MIA9}}\\[3pt] +That is, select \textbf{Allow all web sites}\par\medskip +\noindent\makebox[\linewidth][c]{\bfseries\normalsize\color{blue}For Version 10}\\[3pt] +\noindent\makebox[\linewidth][c]{\includegraphics[width=2in]{graphics/MIAX}}\\[3pt] +\textbf{Allow PDF files to access all web sites}\par\medskip +Exit the dialogs, and try \textbf{YT4PDF}! +\end{minipage} + +\newpage diff --git a/texmf-dist/source/latex/yt4pdf/examples/graphics/MIA9.eps b/texmf-dist/source/latex/yt4pdf/examples/graphics/MIA9.eps new file mode 100644 index 00000000..e68a0a0b Binary files /dev/null and b/texmf-dist/source/latex/yt4pdf/examples/graphics/MIA9.eps differ diff --git a/texmf-dist/source/latex/yt4pdf/examples/graphics/MIAX.eps b/texmf-dist/source/latex/yt4pdf/examples/graphics/MIAX.eps new file mode 100644 index 00000000..71bdbbc0 Binary files /dev/null and b/texmf-dist/source/latex/yt4pdf/examples/graphics/MIAX.eps differ diff --git a/texmf-dist/source/latex/yt4pdf/examples/graphics/trustmanager.eps b/texmf-dist/source/latex/yt4pdf/examples/graphics/trustmanager.eps new file mode 100644 index 00000000..ee141a72 Binary files /dev/null and b/texmf-dist/source/latex/yt4pdf/examples/graphics/trustmanager.eps differ diff --git a/texmf-dist/source/latex/yt4pdf/examples/graphics/yt_icon_sm.eps b/texmf-dist/source/latex/yt4pdf/examples/graphics/yt_icon_sm.eps new file mode 100644 index 00000000..2e6e0ff1 Binary files /dev/null and b/texmf-dist/source/latex/yt4pdf/examples/graphics/yt_icon_sm.eps differ diff --git a/texmf-dist/source/latex/yt4pdf/examples/yt4pdf-1.tex b/texmf-dist/source/latex/yt4pdf/examples/yt4pdf-1.tex new file mode 100644 index 00000000..fac944ab --- /dev/null +++ b/texmf-dist/source/latex/yt4pdf/examples/yt4pdf-1.tex @@ -0,0 +1,93 @@ +\documentclass{article} +\usepackage{amsmath} +% +% the driver line is not necessary if you +% have aebpro.cfg configured to your driver. +% +\usepackage[% + web={designv,pro,tight,usesf,usetemplates}, + eforms,graphicxsp={showembeds},aebxmp +]{aeb_pro} +\usepackage{rmannot} +\usepackage{yt4pdf} +\usepackage{multicol} + +\textBgColor{lightgray} + +\DeclareDocInfo +{ + title=The \texorpdfstring{\textsf{yt4pdf} Package\\[3pt]}{yt4pdf Package: }Demo 1 of You Tube API, + author=D. P. Story, + university=Acro\negthinspace\TeX.Net, + email=dpstory@acrotex.net, + subject={Live streamed video from YouTube.com}, + keywords={You Tube, AeB, rmannot}, + talksite=\url{http://www.acrotex.net}, + talkdate={\today} +} +\talkdateLabel{Published:} + +\def\AcroTeX{Acro\!\TeX} + +\makePoster{pdfyt_poster}{pdfyt_poster} + +\parindent=0pt\parskip6pt +\rheader{} + +\DeclarePageLayout{footskip=29pt} + +\declarePlayList{\playList}{% dps note I've put these parentheses within braces, that was the problem. + \ytIdTitle{Kung-Fu Fighting {(Bruce Lee version)}}{GZ9e3Dy7obA} + \ytIdTitle{Kung-Fu Fighting {(Original, must view on YouTube)}}{jhUkGIsKvn0} + \ytIdTitle{RAF Sculthorpe {(Watch for my Mom!)}}{K7H8QghVs9k} + \ytIdTitle{Rocket Jump}{7XzdZ4KcI8Y} + \ytIdTitle{Abdul And Cleopatra - Jonathan Richman and the Modern Lovers}{mLDF5MBMWHE} +} + +\begin{document} + +\maketitle + +\input{config_intacc.def} + +\begin{center}\bfseries\Large\color{blue}YT4PDF\end{center} + + +%\previewtrue + +\begin{minipage}{571bp/2} +\ytRmAnnot[poster=pdfyt_poster,deactivated=pageclose]{YouTube}{571bp/2}{330bp/2} +\end{minipage}\hfill +\begin{minipage}{\linewidth-290bp-10bp}\centering +\ytPlayToggle{1in}{11bp}\\[3bp] +\ytStopLoading[\textSize{0}]{1in}{11bp}\\[3bp] +\ytMuteToggle{1in}{11bp}\\[3bp] +\ytRewind{1in}{11bp}\\[3bp] +\ytSelect[\textSize{0}]{eNzrn8-JFSE}{1in}{11bp}\\[6bp] +\ytOpenWeb[\textSize{0}]{1in}{11bp} +\end{minipage} + +\medskip + +\begin{flushleft} +\raggedcolumns\bfseries +Favorites to play:\vspace{-.5\baselineskip} +\begin{multicols}{2}\ytPlayList{GZ9e3Dy7obA}{\playList}% +\begin{itemize} +\item \ytComboList{\linewidth-1bp-33bp}{11bp}\kern1bp\ytComboBtn[\TU{Click to play, shift-click to load thumbnail only}]{33bp}{11bp} +\item \ytvId{_iUnOpPEg0w}{TegrityGuy} + +\item \ytvId*{eNzrn8-JFSE}{Open at Adobe} (load thumbnail) + +\columnbreak + +\item \ytvId{q-iiFo-6Vi0}{Digital Signature in 9.0 Pro} +\item \ytvId{5y9-EVmreU4}{Lori's Corner: Episode \#1} +\item \ytvId{T9Yzo_hlwP0}{Intro to PDF Portfolios} +\end{itemize} +\end{multicols} +\end{flushleft} + + + +\end{document} diff --git a/texmf-dist/source/latex/yt4pdf/examples/yt4pdf-2.tex b/texmf-dist/source/latex/yt4pdf/examples/yt4pdf-2.tex new file mode 100644 index 00000000..558b3928 --- /dev/null +++ b/texmf-dist/source/latex/yt4pdf/examples/yt4pdf-2.tex @@ -0,0 +1,152 @@ +\documentclass{article} +\usepackage{amsmath} +% +% the driver line is not necessary if you +% have aebpro.cfg configured to your driver. +% +\usepackage[% + web={designv,pro,tight,usesf,usetemplates}, + eforms,graphicxsp={showembeds},aebxmp +]{aeb_pro} +\usepackage{yt4pdf} +\usepackage{picins} + +% \textBgColor{lightgray} + +\DeclareDocInfo +{ + title=The \texorpdfstring{\textsf{yt4pdf} Package\\[3pt]}{yt4pdf Package: }Demo 2 of You Tube API, + author=D. P. Story, + university=Acro\negthinspace\TeX.Net, + email=dpstory@acrotex.net, + subject={Live streamed video from YouTube.com}, + keywords={You Tube, AeB, rmannot}, + talksite=\url{http://www.acrotex.net}, + talkdate={\today} +} +\talkdateLabel{Published:} + +\def\AcroTeX{Acro\!\TeX} + +\makePoster{pdfyt_poster}{pdfyt_poster} +\makePoster{yt_poster}{graphics/yt_icon_sm} + +\parindent=0pt\parskip6pt +\rheader{} + +\DeclarePageLayout{footskip=15.5pt} + +%\previewtrue + +\declarePlayList{\playList}{% + \ytIdTitle{Kung-Fu Fighting {(Bruce Lee version)}}{GZ9e3Dy7obA} + \ytIdTitle{Kung-Fu Fighting {(Original, must view on YouTube)}}{jhUkGIsKvn0} + \ytIdTitle{RAF Sculthorpe {(Watch for my Mom!)}}{K7H8QghVs9k} + \ytIdTitle{Rocket Jump}{7XzdZ4KcI8Y} +} + +% +% Note: popupmenu package version 1.0 (2010/09/18) or later required here. +% +\begin{popupmenu}{YTMenu} + \puIdTitle{Select a You Tube Video}{} % A title has no yt Id + \begin{submenu}{title=Music Videos} + \puIdTitle{Kung-Fu Fighting (Bruce Lee version)}{GZ9e3Dy7obA} + \puIdTitle{Kung-Fu Fighting (Original, view on You Tube)}{jhUkGIsKvn0} + \puIdTitle{Ink Spots - If I didn't care}{rvwfLe6sLis} + \puIdTitle{Ink Spots - My Prayer}{h7KJCns5v3g} + \end{submenu} + \begin{submenu}{title=Adobe Related Videos} + \puIdTitle{Open at Adobe}{eNzrn8-JFSE} + \puIdTitle{Lori's Corner Episode \#1}{5y9-EVmreU4} + \puIdTitle{Intro to PDF Portfolios}{T9Yzo_hlwP0} + \end{submenu} + \begin{submenu}{title=Action Videos} + \puIdTitle{Rocket Jump}{7XzdZ4KcI8Y} + \puIdTitle{AimBot}{NYGlWjIKoY4} + \puIdTitle{Flower Warfare}{031Dshcnso4} + \puIdTitle{Modern Warfare: Frozen Crossing Pt. 1}{rzQMGMuD1sU} + \puIdTitle{Modern Warfare: Frozen Crossing Pt. 2}{a08ViuvORRM} + \end{submenu} +\end{popupmenu} + +% After defining all menus used with YouTube videos, we declare them using \ytPopupMenuData +% The argument is a token list: \ytPopupMenuData{\myEducationMenu\myFunMenu...} +\ytPopupMenuData{\YTMenu} + +\begin{document} + +\maketitle + +\input{config_intacc.def} + + +\begin{center}\bfseries\Large\color{blue}YT4PDF\end{center} + +\DeclareYTName{ytInWindow} +\ytBtnPresets{\BC{.5 0 0}\W{1}\S{S}\textFont{HeBo}}% +{\setlength{\dimen0}{(\linewidth)/6-1bp}\xdef\ytWidth{\the\dimen0}} %-.5bp +\cfooter{\makebox[\linewidth][c]{\kern1bp\ytPlayToggle{\ytWidth}{11bp}\kern1bp\ytStopLoading[\textSize{0}]{\ytWidth}{11bp}\kern1bp +\ytMuteToggle{\ytWidth}{11bp}\kern1bp\ytRewind{\ytWidth}{11bp}\kern1bp +\ytSelect[\textSize{0}]{eNzrn8-JFSE}{\ytWidth}{11bp}\kern1bp\ytOpenWeb[\textSize{0}]{\ytWidth}{11bp}}} + +\newcommand{\myPBPresets}{\CA{YT Menu}\textColor{0 0 1}\W1\BC{}\textSize{0} + \S{S}\AA{\AAMouseEnter{\JS{ytPopupMenu("\ytCurrRMAName",YTMenu)}}}} + +\setWindowDimPos{position={halign=center,valign=center,hoffset=0,voffset=0}, + width={default=571},height={default=330}}% + +\setlength{\pichskip}{3pt} +\parpic(.25in,.25in){% +\parbox{.25in}{\offinterlineskip\resizebox{.25in}{!} +{\ytRmAnnot[windowed,poster=yt_poster,deactivated=pageclose]{ytInWindow}{72bp}{72bp}}}} +\pushButton[\presets{\myPBPresets}]{myYTMenu}{20bp}{5bp} +On this page, the You Tube annotation is icon size and the video is played +in a floating window. + +Move the window by dragging its title bar. Resize it by dragging the +lower-right corner. Close the window by clicking on the upper-right +corner. + +The \textsf{YT Menu} uses the \textsf{popupmenu} package. Alternatively, +we could just use the combo box that has been used already, but, I thought +we might try something different. + +\newpage + +\ytRmAnnot[posternote=AcroTeX PDF Tube,deactivated=pageclose]{YouTube1}{571bp/2}{330bp/2}\\ +\ytPlayList{GZ9e3Dy7obA}{\playList}\ytComboListPresets{\textSize{9}}% +\ytComboList{(571bp/2)-1bp-33bp}{11bp}\kern1bp\ytComboBtn[\TU{Click to play, shift-click to load thumbnail only}]{33bp}{11bp} + +\newpage +\cfooter{} +\begin{minipage}{571bp/2} +\ytRmAnnot[posternote=AcroTeX PDF Tube,deactivated=pageclose]{YouTube2}{571bp/2}{330bp/2}\\ +\ytPlayList{GZ9e3Dy7obA}{\playList}\ytComboListPresets{\textSize{9}}% +\ytComboList{(571bp/2)-1bp-33bp}{11bp}\kern1bp\ytComboBtn[\TU{Click to play, shift-click to load thumbnail only}]{33bp}{11bp} +\end{minipage}\hfill +\begin{minipage}{\linewidth-290bp-10bp}\centering +\ytPlayToggle{1in}{11bp}\\[3bp] +\ytStopLoading[\textSize{0}]{1in}{11bp}\\[3bp] +\ytMuteToggle{1in}{11bp}\\[3bp] +\ytRewind{1in}{11bp}\\[3bp] +\ytSelect[\textSize{0}]{eNzrn8-JFSE}{1in}{11bp}\\[6bp] +\ytOpenWeb[\textSize{0}]{1in}{11bp} +\end{minipage} + +\newpage + +\begin{center} +\begin{minipage}{571bp/2} +\ytRmAnnot[poster=pdfyt_poster,deactivated=pageclose]{YouTube3}{571bp/2}{330bp/2}\\ +\ytPlayList{GZ9e3Dy7obA}{\playList}\ytComboListPresets{\textSize{9}}% +\ytComboList{(571bp/2)-1bp-33bp}{11bp}\kern1bp\ytComboBtn[\TU{Click to play, shift-click to load thumbnail only}]{33bp}{11bp}\\[1bp] +{\setlength{\dimen0}{(\linewidth+1bp)/6-1bp}\xdef\ytWidth{\the\dimen0}}% +\ytPlayToggle{\ytWidth}{11bp}\kern1bp\ytStopLoading[\textSize{0}]{\ytWidth}{11bp}\kern1bp +\ytMuteToggle{\ytWidth}{11bp}\kern1bp\ytRewind{\ytWidth}{11bp}\kern1bp +\ytSelect[\textSize{0}]{eNzrn8-JFSE}{\ytWidth}{11bp}\kern1bp +\ytOpenWeb[\textSize{0}\CA{View on Web}]{\ytWidth}{11bp} +\end{minipage} +\end{center} + +\end{document} diff --git a/texmf-dist/source/latex/yt4pdf/examples/yt4pdf-3.tex b/texmf-dist/source/latex/yt4pdf/examples/yt4pdf-3.tex new file mode 100644 index 00000000..03625c9f --- /dev/null +++ b/texmf-dist/source/latex/yt4pdf/examples/yt4pdf-3.tex @@ -0,0 +1,88 @@ +%\ytIdTitle{No Ordinary Love - Sade}{_WcWHZc8s2I} +\documentclass{article} +\usepackage{amsmath} +% +% the driver line is not necessary if you +% have aebpro.cfg configured to your driver. +% +\usepackage[% + web={designv,pro,tight,usesf,usetemplates}, + eforms,graphicxsp={showembeds},aebxmp +]{aeb_pro} +\usepackage{yt4pdf} + +%\margins{10bp}{10bp}{.5in}{.5in} % left,right,top, bottom +%\screensize{7.5in}{10in} % height,width dimensions + +\textBgColor{lightgray} + +\DeclareDocInfo +{ + title=The \texorpdfstring{\textsf{yt4pdf} Package\\[3pt]}{yt4pdf Package: }Demo 3 of You Tube API, + author=D. P. Story, + university=Acro\negthinspace\TeX.Net, + email=dpstory@acrotex.net, + subject={Live streamed video from YouTube.com}, + keywords={You Tube, AeB, rmannot}, + talksite=\url{http://www.acrotex.net}, + talkdate={\today} +}\talkdateLabel{Published:} + +\def\AcroTeX{Acro\!\TeX} + +\makePoster{pdfyt_poster}{pdfyt_poster} +\makePoster{yt_poster}{graphics/yt_icon_sm} + +\parindent=0pt\parskip6pt +\rheader{} + +% dps need to change the catcode of subscript (_) before hyperref gets +% chance to look at it. +\declarePlayList{\playList}{% + \ytIdTitle{Kung-Fu Fighting {(Bruce Lee version)}} {GZ9e3Dy7obA} + \ytIdTitle{Kung-Fu Fighting {(Original, must view on YouTube)}}{jhUkGIsKvn0} + \ytIdTitle{RAF Sculthorpe {(Watch for my Mom!)}} {K7H8QghVs9k} + \ytIdTitle{Rocket Jump} {7XzdZ4KcI8Y} + \ytIdTitle{No Ordinary Love - Sade} {_WcWHZc8s2I} +} + +\begin{document} + +\maketitle + +\input{config_intacc.def} + +\begin{center}\bfseries\Large\color{blue}YT4PDF\end{center} + +\ytBtnPresets{\BC{.5 0 0}\W{1}\S{S}\textFont{HeBo}}% + +\resizebox{\linewidth}{!}{\ytRmAnnot[play=eNzrn8-JFSE,poster=pdfyt_poster, + deactivated=pageclose]{ytPlayOnOpen}{571bp}{330bp}}\\ +{\setlength{\dimen0}{(\linewidth-2bp)/6}\xdef\ytWidth{\the\dimen0}}% +\ytPlayToggle{\ytWidth}{11bp}\ytStopLoading{\ytWidth}{11bp}% +\ytMuteToggle{\ytWidth}{11bp}\ytRewind{\ytWidth}{11bp}% +\ytSelect{eNzrn8-JFSE}{\ytWidth}{11bp}\ytOpenWeb[\textSize{0}]{\ytWidth}{11bp}% + +\ytPlayList{GZ9e3Dy7obA}{\playList} + +% We have to disable the RMA so the combo box can be seen above it. +Playlist: \ytComboList[\A{\JS{\thisNamedRMA(ytPlayOnOpen).activated=false;}}]{2.5in}{11bp}\kern1bp\ytComboBtn[\TU{Click to play, shift-click to load thumbnail only}]{33bp}{11bp} + +\newpage +\begin{center}\bfseries\Large\color{blue}YT4PDF\end{center} + +\resizebox{\linewidth}{!}{\ytRmAnnot[load=GZ9e3Dy7obA,poster=pdfyt_poster, + deactivated=pageclose]{ytLoadOnOpen}{571bp}{330bp}}\\ +\ytBtnPresets{\BC{.5 0 0}\W{1}\S{S}\textFont{HeBo}}% +{\setlength{\dimen0}{(\linewidth-2bp)/6}\xdef\ytWidth{\the\dimen0}}% +\ytPlayToggle{\ytWidth}{11bp}\ytStopLoading{\ytWidth}{11bp}% +\ytMuteToggle{\ytWidth}{11bp}\ytRewind{\ytWidth}{11bp}% +\ytSelect{eNzrn8-JFSE}{\ytWidth}{11bp}\ytOpenWeb[\textSize{0}]{\ytWidth}{11bp}% + +\ytPlayList{GZ9e3Dy7obA}{\playList} + +% We have to disable the RMA so the combo box can be seen above it. +Playlist: \ytComboList[\A{\JS{\thisNamedRMA(ytLoadOnOpen).activated=false;}}]{2.5in}{11bp}\kern1bp\ytComboBtn[\TU{Click to play, shift-click to load thumbnail only}]{33bp}{11bp} + + +\end{document} diff --git a/texmf-dist/source/latex/yt4pdf/graphics/pdfyt_poster.eps b/texmf-dist/source/latex/yt4pdf/graphics/pdfyt_poster.eps new file mode 100644 index 00000000..97c7ecd1 Binary files /dev/null and b/texmf-dist/source/latex/yt4pdf/graphics/pdfyt_poster.eps differ diff --git a/texmf-dist/source/latex/yt4pdf/swf/pdf_tube_basic.swf b/texmf-dist/source/latex/yt4pdf/swf/pdf_tube_basic.swf new file mode 100644 index 00000000..5dde7b7c Binary files /dev/null and b/texmf-dist/source/latex/yt4pdf/swf/pdf_tube_basic.swf differ diff --git a/texmf-dist/source/latex/yt4pdf/yt4pdf.dtx b/texmf-dist/source/latex/yt4pdf/yt4pdf.dtx new file mode 100644 index 00000000..4ca3bcc0 --- /dev/null +++ b/texmf-dist/source/latex/yt4pdf/yt4pdf.dtx @@ -0,0 +1,629 @@ +%\iffalse +%<*copyright> +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% yt4pdf.sty package, %% +%% Copyright (C) 2010--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. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%\NeedsTeXFormat{LaTeX2e}[1997/12/01] +%\ProvidesPackage{yt4pdf} +% [2016/10/04 v1.1 yt4pdf: Play You Tube videos in PDF, Acrobat Distiller only (dps)] +%<*driver> +\documentclass{ltxdoc} +\usepackage[colorlinks,hyperindex]{hyperref} +%\pdfstringdefDisableCommands{\let\\\textbackslash} +%\EnableCrossrefs \CodelineIndex +\begin{document} +\def\CMD#1{\textbackslash#1} + \GetFileInfo{yt4pdf.sty} + \title{\textsf{yt4pdf}: Package for playing You Tube Videos} + \author{D. P. Story\\ + Email: \texttt{dpstory@uakron.edu}} + \date{processed \today} + \maketitle + \tableofcontents + \let\Email\texttt + \DocInput{yt4pdf.dtx} + \PrintIndex +\end{document} +% +% \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} +% \end{macrocode} +% \begin{macrocode} +\ProcessOptions +\RequirePackage{rmannot} +\RequirePackage{popupmenu}[2010/09/18] +% \end{macrocode} +% +% \section{Introduction} +% +% I believe that I was vaguely aware of the \href{http://code.google.com/apis/youtube/flash_api_reference.html} +%{YouTube ActionScript 3.0 Player}, but never pursued it because of my +%general lack of interest in You Tube (\url{www.youtube.com}). Recently, I +%became aware of a very nice demo PDF that used the API, see +%\href{http://www.uvsar.com/pdftube/}{PDF Tube - YouTube API wrapper for PDF +%documents}. The SWF file and JavaScript are made freely available, so I +%downloaded it, and was sufficiently impressed to port the example to +%{\LaTeX} using various members of the {Acro\negthinspace\TeX} Fine Family of Software +%\verb!:-{)!. The SWF file and JavaScript are due to the good folks at +%UVSAR (\url{www.uvsar.com}). The UVSAR's sample demo also appeared in the forums of +%the \href{http://acrobatusers.com/forums/aucbb/viewtopic.php?pid=62134}{Acrobat User +%Community}. +% +% \section{Implementation} +% +% \DescribeMacro{\ytFolder} The path to the folder containing +% the \texttt{pdf\_Tube\_basic.swf} file. This path is set through +% the \texttt{yt4pdf.cfg} file. +% \begin{macrocode} +\newcommand{\ytFolder}{C:/Users/Public/Documents/My TeX Files/% +tex/latex/aeb/aebpro/yt4pdf/swf} +% \end{macrocode} +% \DescribeMacro{ytSWF} The path to \texttt{pdf\_Tube\_basic.swf}, used +% as an argument for the \cs{rmAnnot} macro. +% \begin{macrocode} +\saveNamedPath{ytSWF}{\ytFolder/pdf_tube_basic.swf} +% \end{macrocode} +% We input the file \texttt{yt4pdf.cfg} which should contain a re-definition +% of \cs{ytFolder}, the path to the user's installation containing the +% \texttt{pdf\_tube\_basic.swf}. +% \begin{macrocode} +\InputIfFileExists{yt4pdf.cfg}{}{} +% \end{macrocode} +% \subsection{The YouTube RMA} +% In this section, we define \cs{ytRmAnnot}, a rich media annotation, that is used +% to play YouTube videos. +% \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\yt@namegdef#1{\expandafter\gdef\csname #1\endcsname} +\def\yt@namexdef#1{\expandafter\xdef\csname #1\endcsname} +\def\thisNamedRMA(#1){this.getAnnotRichMedia(this.pageNum,"#1")} +% \end{macrocode} +% \DescribeMacro{play} This is a key-value pair for the \cs{ytRmAnnot} command. +% The value of \texttt{play} is a YouTube video ID. When the page the annot is +% on, the video will be played. +% \begin{macrocode} +\define@key{ytRmAnnot}{play}[]{\def\ytrmannot@play{#1}} +\define@key{ytRmAnnot}{load}[]{\def\ytrmannot@load{#1}} +\setkeys{ytRmAnnot}{play,load} +\let\ytCurrRMAName\@empty +% \end{macrocode} +% \begin{macro}{\ytRmAnnot} +% The \cs{ytRmAnnot} creates a rich media annotation using the \textsf{rmannot} package. +% It uses the SWF file \texttt{pdf\_Tube\_basic.swf} referenced here by the name of +% \texttt{ytSWF}. The command takes four parametrs: +% \begin{itemize} +% \item[\texttt{[\#1]}]: The optional first parameter takes the key-value pairs of the +% \cs{rmAnnot} command, plus the \texttt{play} key, defined above. The play key is used +% to set the annot up so it plays automatically when the page is opened. +% \item[\texttt{\#2}]: The name of this annot, unique to the document. This should be +% a ``JavaScript variable.'' The name populates the command \cs{ytCurrRMAName}, which is +% needed for the other commands in this package. +% \item[\texttt{\#3}]: The width of the annot +% \item[\texttt{\#4}]: The height of the annot +% \end{itemize} +% \begin{macrocode} +\newcommand{\ytRmAnnot}[4][]{\begingroup + \@ifundefined{#2@ytrmname}{\yt@namegdef{#2@ytrmname}{#1}}% + {\PackageError{yt2pdf}{The name `#2' is already defined + for\MessageBreak this \string\ytRmAnnot}{Choose a unique + name for this \string\ytRmAnnot, one different from `#2'.}}% + \setkeys*{ytRmAnnot}{#1}\gdef\ytCurrRMAName{#2}% + \ifx\ytrmannot@play\@empty\else + \makebox[0pt][l]{\pushButton[\BC{}\BG{}\S{S} + \AA{\AAPageOpen{aebStartPlayer(\thisNamedRMA(#2),% + "\ytrmannot@play",true);}\AAPageClose{aebCancelWait(false);}} + ]{btnRmAnnot#2}{1bp}{1bp}}\let\ytrmannot@load\@empty\fi + \ifx\ytrmannot@load\@empty + \else\makebox[0pt][l]{\pushButton[\BC{}\BG{}\S{S} + \AA{\AAPageOpen{aebStartPlayer(\thisNamedRMA(#2),% + "\ytrmannot@load",false);}\AAPageClose{aebCancelWait(false);}} + ]{btnRmAnnot#2}{1bp}{1bp}}\fi + \rmAnnot[\XKV@rm,name=#2,enabled=onclick]{#3}{#4}{ytSWF}% + \endgroup +} +% \end{macrocode} +% \end{macro} +% \DescribeMacro{\DeclareYTName} Defines the internal macro +% \cs{ytCurrRMAName}. This command is needed in the case were links, or +% control buttons come before the RMA annot. The first parameter is the +% page on which the target annot resides, the default is the current page. +% The second argument is the name of the target annot. +% code passed is +% \begin{macrocode} +\newcommand{\DeclareYTName}[2][]{\def\argi{#1}% + \ifx\argi\@empty\gdef\ytCurrRMAName{#2}\else + \gdef\ytCurrRMAName{[#1]#2}\fi +} +% \end{macrocode} +% \subsection{Button Controls} +% We present six control buttons for the rm annot +% \begin{macro}{\ytBtnPresets} +% The default appearances of the control buttons. +% \begin{macrocode} +\newcommand{\ytBtnPresets}[1]{\def\yt@Presets{#1}} +\ytBtnPresets{\BC{.5 0 0}\S{S}\textFont{HeBo}\autoCenter{n}} +% \end{macrocode} +% \end{macro} +% The following six commands all take three parameters, the first one optional +%\begin{enumerate} +% \item[\texttt{\#1}:] Standard key-value pairs for modifying the +% appearance of an eforms form field. +% \item[\texttt{\#2}:] +% \texttt{this.getAnnotRichMedia(this.pageNum+1, "YouTube")}. +% \item[\texttt{\#3}:] the width of the button +% \item[\texttt{\#4}:] the height of the button +%\end{enumerate} +% \begin{macro}{\ytPlayToggle} +% This button has several functions: Pause/Play/Buffering. +% Initially the button label is on Pause (pressing it pauses a playing video); +% the button label reads Play when the video is loaded and paused (pressing it plays or resumes +% the video); while the video is loading, the button label is Buffering... +% \begin{macro}{\ytStopLoading} Pressing this button stops the streaming of the currently playing +% video. If the video is started again, there will be some buffering before the play begins. +% \begin{macro}{\ytMuteToggle} This button toggles and sound off and on. Button labels are +% MUTE and UNMUTE. +% \begin{macro}{\ytRewind} If the video is playing, this button +% stops the video, rewinds it to the beginning, and starts play again. If the video +% is paused, this button rewinds the video to the beginning, the video remains paused. +% \begin{macro}{\ytSelect} When this button is pressed, a response dialog opens. +% The user enters a YouTube video ID into the field. On pressing OK, this video is played. +% \item[] \textbf{Note:} Some YouTube videos are security +% restricted and cannot be played through an embedded player, such as the one used here. +% If video ID of a video that does not allow embedded playback, a dialog appears giving +% the use to view the video on the web. +% \begin{macro}{\ytOpenWeb} The user has the option of pressing this button to view the +% currently video on the web at \texttt{www.youtube.com}. +% \begin{macrocode} +% \end{macrocode} +% The \cs{oyt@RMA} command takes the second parameter of each of the six button commands, +% and expands it into the appropriate JS code. +% \begin{macrocode} +\newcommand{\oyt@RMA}[1][this.pageNum]{\oyt@@RMA[#1]} +\def\oyt@@RMA[#1]#2\@nil{\gdef\yt@CurrRMAName{#2}% + \def\yt@rm{this.getAnnotRichMedia(#1,"#2")}} +% \end{macrocode} +% We finally define the six control buttons. +% \begin{macrocode} +\newcommand{\ytPlayToggle}[3][]{% + \expandafter\oyt@RMA\ytCurrRMAName\@nil% + \pushButton[\CA{\ytStrPAUSE}\presets{\yt@Presets}#1 + \A{\JS{ytPlayToggle(\yt@rm);}}]{playToggle}{#2}{#3}% +} +\newcommand{\ytStopLoading}[3][]{% + \expandafter\oyt@RMA\ytCurrRMAName\@nil% + \pushButton[\CA{\ytStrStopLoading}\presets{\yt@Presets}#1 + \A{\JS{\yt@rm.callAS("stopVideo");}}]{vidStop}{#2}{#3}% +} +\newcommand{\ytMuteToggle}[3][]{% + \expandafter\oyt@RMA\ytCurrRMAName\@nil% + \pushButton[\CA{\ytStrMUTE}\presets{\yt@Presets}#1 + \A{\JS{ytMuteToggle(\yt@rm);}}]{muteToggle}{#2}{#3}% +} +\newcommand{\ytRewind}[3][]{% + \expandafter\oyt@RMA\ytCurrRMAName\@nil% + \pushButton[\CA{\ytStrREWIND}\presets{\yt@Presets}#1 + \A{\JS{ytRewind(\yt@rm);}}]{ytRewind}{#2}{#3}% +} +\newcommand{\ytSelect}[4][]{% + \expandafter\oyt@RMA\ytCurrRMAName\@nil% + \pushButton[\CA{\ytStrLoadVideo}\presets{\yt@Presets}#1 + \A{\JS{ytSelect(\yt@rm,"#2");}}]{selectVid}{#3}{#4}% +} +\newcommand{\ytOpenWeb}[3][]{% + \expandafter\oyt@RMA\ytCurrRMAName\@nil% + \pushButton[\CA{\ytStrWatchOnWeb}\presets{\yt@Presets}#1 + \A{\JS{ytOpenWeb(\yt@rm);}}]{playOnWeb}{#2}{#3}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \subsection{Defining a Video Id} +% \subsubsection{Using a Link} +% \begin{macro}{\ytvIdPresets} +% The options for the \cs{ytvId} link. The default is given below in the definition. +% \begin{macro}{\ytvId} +% The \cs{ytvId} is link which when pressed plays the video whose Video Id is passed as +% its second argument. +% \begin{itemize} +% \item[\texttt{[\#1]}:] The name of the annot this video is to play in. When +% this parameter is not specified, the default +% is \cs{ytCurrRMAName}, which is defined by the \cs{ytRmAnnot} macro. +% \item[\texttt{\#2}:] The video Id for the YouTube video to play +% \item[\texttt{\#3}:] The text that displays the link. +%\end{itemize} +% \begin{macrocode} +\newcommand{\ytvIdPresets}[1]{\def\yt@vIdPresets{#1}} +\ytvIdPresets{\linktxtcolor{webbrown}} +\newcommand{\ytvId}{\@ifstar{\def\yt@lnk@play{false}\yt@@vId} + {\def\yt@lnk@play{true}\yt@@vId}} +\newcommand{\yt@@vId}[3][\ytCurrRMAName]{% + \oyt@RMA#1\@nil\setLink[\presets{\yt@vIdPresets} + \A{\JS{aebStartPlayer(\yt@rm,"#2",\yt@lnk@play);}}]{#3}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \subsubsection{Using a Combobox} +% \begin{macro}{\ytComboList} +% The \cs{ytComboList} is a combox box of video Ids and titles. The user selects a +% video based on its title, then presses the PLAY button. The two commands +% \cs{ytComboListPresets} and \cs{ytComboBtnPresets} are used to set the appearances +% of the combo box and the PLAY button. +%\begin{itemize} +% \item[\texttt{[\#1]}:] eforms key-value pairs +% \item[\texttt{\#2}:] The width of the combo box +% \item[\texttt{\#3}:] The height of the combo box +%\end{itemize} +% \begin{macro}{\ytComboBtn} +% A button to play the selection made in the combo box. +% \begin{macro}{\ytPlayList} +% This command is executed before \cs{ytComboBtn} to set the play list, +% and the default value. +% \begin{macrocode} +\newcommand{\ytComboListPresets}[1]{\def\yt@ComboListPresets{#1}} +\newcommand{\ytComboBtnPresets}[1]{\def\yt@ComboBtnPresets{#1}} +\let\yt@ComboListPresets\@empty +\let\yt@ComboBtnPresets\@empty +% \end{macrocode} +% Use the \cs{ytPlayList} to pass the play list to the next combo box +% \begin{macrocode} +\newcommand{\ytPlayList}{\begingroup\@makeother\_\@makeother\' + \ytPlayList@i} +\def\ytPlayList@i#1#2{\gdef\yt@pl@def{#1}\xdef\yt@pl@pl{#2}\endgroup} +% \end{macrocode} +% \begin{macro}{\declarePlayList} +% A video ID may contain characters {\LaTeX} considers special, so we sanitize these +% special characters before reading in the video ID. Near as I can determine, a video +% id consists of 11 characters comprising combinations of letters (A-Z,a-z) numbers +% (0-9) and special characters underscore and hyphen (\_ and -). We sanitize the last two. +%\begin{verbatim} +%\declarePlayList{<\cmd>}{ +% \ytIdTitle{}{} +% ... +% \ytIdTitle{}{} +% } +%\end{verbatim} +%The entries may also be in raw form `|[()()]|'. Note that the two arguments are +%enclosed in parentheses, there is a problem with parsing if \texttt{} itself contains +%parentheses. Within \texttt{} enclose matching parentheses in braces, for example, +%\begin{flushleft}|\ytIdTitle{Kung-Fu Fighting {(Bruce Lee version)}}{GZ9e3Dy7obA}|\end{flushleft} +% \changes{v1.1}{2016/10/04}{Added \string\cs{declarePlayList}} +% \begin{macrocode} +\newcommand{\declarePlayList}{\bgroup + \@makeother\_\@makeother\- + \yt@declarePlayList} +\def\yt@declarePlayList#1#2{% + \gdef#1{#2}\egroup} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\ytIdTitle} +% A convenience command to lay out the playlist, for example, +%\begin{verbatim} +%\declarePlayList{\playListii}{% +% \ytIdTitle{Elfego Baca}{gRwa0MdeqVs} +% \ytIdTitle{Texas John Slaughter}{7yrk1BvtLE8} +% \ytIdTitle{Swamp Fox}{-SBPnw5riLM&NR} +% \ytIdTitle{Zorro Promo}{cKludhxEoJ0} +%} +%\end{verbatim} +% \begin{macrocode} +\newcommand{\ytIdTitle}[2]{[(#2)(#1)]} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\ytNewBaseName} +% \cs{ytNewBaseName} is a not so perfect attempt to fix the problem of having +% multiple combo boxes on one page. The field names need to be distinct. We +% can pass the new field name using this command. +% \begin{macro}{\ytResetBaseName} +% This command resets the field name back to its default value. +% Both of these commands apply to \cs{ytComboList} and to \cs{ytComboBtn}. +% \changes{v1.0}{2011/08/23}{Added \cs{ytBaseName} to pass a field title to +% combo box and controlling play button} +% \begin{macrocode} +\newcount\ytListCnt \ytListCnt=0 +\newcommand{\ytNewBaseName}[1][]{% + \def\yt@argi{#1}\ifx\yt@argi\@empty\global\advance\ytListCnt1\relax + \gdef\yt@BaseName{\yt@CurrRMAName\the\ytListCnt}\else + \gdef\yt@BaseName{\yt@CurrRMAName#1}\fi +} +\newcommand{\ytResetBaseName}{\gdef\yt@BaseName{\yt@CurrRMAName}} +\ytResetBaseName +% \end{macrocode} +% \end{macro} +% \end{macro} +% Now we have the code for \cs{ytComboList} +% \begin{macrocode} +\newcommand{\ytComboList}[3][]{% + \expandafter\oyt@RMA\ytCurrRMAName\@nil% + \comboBox[\DV{\yt@pl@def}\V{\yt@pl@def} + \presets{\yt@ComboListPresets}#1]{ytSelect\yt@BaseName} + {#2}{#3}{\yt@pl@pl}% +} +% \end{macrocode} +% The parameters for \cs{ytComboBtn} are +%\begin{itemize} +% \item[\texttt{[\#1]}:] The the name of the \cs{ytRmAnnot} this selection is to play in +% the default is \cs{ytCurrRMAName}. +% \item[\texttt{\#2}:] The width of the combo box +% \item[\texttt{\#3}:] The height of the combo box +% the array of values and titles. +%\end{itemize} +% \begin{macrocode} +\newcommand{\ytComboBtn}[3][]{% + \expandafter\oyt@RMA\ytCurrRMAName\@nil% + \pushButton[\CA{\ytStrPLAY}\presets{\yt@ComboBtnPresets}#1 + \A{\JS{var f=this.getField("ytSelect\yt@BaseName");\r + aebStartPlayer(\yt@rm,f.value,!event.shift); + }}]{ytSelectBtn\yt@BaseName}{#2}{#3}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \subsection{Support for the \textsf{popupmenu} package} +% \begin{macro}{\ytPopupMenuData} +% A command use to list the popupmenu data. It defines a command +% \cs{ytPopupData} that is used in the JS support for popup menus. +% \begin{macrocode} +\newcommand{\ytPopupMenuData}[1]{{\toks0={// yt4pdf: Begin popup menu data^^J}% + \@tfor\yt@menu:=#1\do{% + \toks2=\expandafter{\yt@menu}% + \edef\@tmp@exp{\the\toks0\the\toks2^^J}% + \toks0=\expandafter{\@tmp@exp}% + }\xdef\ytPopupData{\the\toks0// End of popup menu data}% +}} +\def\ytPopupData{// No popup menu data defined}% +% \begin{macro}{\puIdTitle} +% A convenience macro for entering popupmenu data for youtube videos. +%\begin{verbatim} +%\puIdTitle{\string\"Sea Hunt\string\" TV serie}{MW-IZ67iADU} +%\end{verbatim} +% Note that we must protect the double quote. +% \begin{macrocode} +\newcommand{\puIdTitle}[2]{\item{title={#1},return={[\itemindex,'#2']}}} +% \end{macrocode} +% \end{macro} +% +% \subsection{Strings that can be localized} +% The following strings are used on the buttons, and in the document level JS +% \begin{macrocode} +\newcommand{\ytStrPLAY}{PLAY} +\newcommand{\ytStrREPLAY}{REPLAY} +\newcommand{\ytStrPAUSE}{PAUSE} +\newcommand{\ytStrBuffering}{Buffering...} +\newcommand{\ytStrStopLoading}{Stop Loading} +\newcommand{\ytStrMUTE}{MUTE} +\newcommand{\ytStrUNMUTE}{UNMUTE} +\newcommand{\ytStrREWIND}{REWIND} +\newcommand{\ytStrLoadVideo}{Load Video} +\newcommand{\ytStrWatchOnWeb}{Watch on YouTube} +% response dialog box associated with ytSelect() +\newcommand{\ytRespQues}{Enter the YouTube Video ID} +\newcommand{\ytRespTitle}{Load a Video} +\newcommand{\ytRespLabel}{ID:} +% alert error messages +\newcommand{\ytStrErrorVideoNotFound}{Error: Video not found} +\newcommand{\ytStrErrorNoEmbed}{Error: This video does not allow + embedded playback \r\r Would you like to view this video + on the web?} +\newcommand{\ytStrConnecTimedOut}{Connection timed out, try again.} +% \end{macrocode} +% +% \subsection{Document level JavaScript} +% \begin{macrocode} +\begin{insDLJS*}[ytPlayToggle]{yt} +\begin{newsegment}{yt4PDF: YouTube for PDF JavaScript} +/* + Document-level script for YouTube player + Document-level script for the PDFtube embedded YouTube player + *************************************************************** + Functions to be called by buttons or links on the PDF + in each case, "rm" is the RichMedia annot containing the player + All these are optional and can be renamed or edited as required + *********************************************************** +*/ +// toggle play/pause (button labels updated by event functions) +function ytPlayToggle(rm) { + var ps = rm.callAS("getPlayerState"); + rm.callAS((ps == 1)? "pauseVideo" : "playVideo"); +} +// toggle mute (have to update button labels ourselves) +function ytMuteToggle(rm) { + var im = rm.callAS("isMuted"); + if (im) { + event.target.buttonSetCaption("\ytStrMUTE"); + rm.callAS("unMute"); + } else { + event.target.buttonSetCaption("\ytStrUNMUTE"); + rm.callAS("mute"); + } +} +// Ask the user for the ID number of a new video, and play it +function ytSelect(rm,vID) { + var rsp = app.response({ + cQuestion: "\ytRespQues", + cTitle: "\ytRespTitle", + cDefault: vID, + cLabel: "\ytRespLabel"}); + if (rsp !=null && rsp != "") + aebStartPlayer(rm,rsp,true); // dps +} +// open the video's YouTube page in the web browser +function ytOpenWeb(rm) { + var link = rm.callAS("getVideoUrl"); + if (link != null) { + app.launchURL(link,true); + rm.activated = false; + } +} +// rewind (seek to zero) +function ytRewind(rm) { rm.callAS("seekTo",0); } +/* + ************************************************************ + Functions called by the player itself, in response to events + as the events are "external", the annot is not the target. + These functions must exist and match the names in the SWF. + *********************************************************** +*/ +function ytPlayerReady() { + + // this is the place to load your default video - for example... + console.println(" Player loaded and ready"); + // this.getAnnotsRichMedia(this.pageNum)[0].callAS("loadVideoById", + // "eNzrn8-JFSE",0); + aebStartPlayer.isPlayerReady=true; // dps +} +function ytStateChange(st) { + // Possible values are unstarted (-1), ended (0), playing (1), + // paused (2), buffering (3), video cued (5) + var lbl = ""; + console.println(" State changed to " + st); + if (st == 0) lbl = "\ytStrREPLAY"; + else if (st == 1) lbl = "\ytStrPAUSE"; + else if (st == 3) lbl = "\ytStrBuffering"; + else if (st == 2 || st == 5) lbl = "\ytStrPLAY"; + if (lbl) this.getField("playToggle").buttonSetCaption(lbl); +} +function ytPlaybackQualityChange(str) { + // Possible values are "small", "medium", "large" and "hd720" + console.println(" Quality changed to " + str); +} +function ytProgress(q) { + // q has four properties that you can use to update form fields, + // such as... + //this.getField("currentTime").value = q.CurrentTime; + //this.getField("Duration").value = q.Duration; + //this.getField("BytesLoaded").value = q.BytesLoaded; + //this.getField("BytesTotal").value = q.BytesTotal; +} +function ytError(err) { + // Video cannot be played + console.println(" ERROR code " + err + " received"); + if (err == 100) + app.alert("\ytStrErrorVideoNotFound", 0, 0, "YouTube"); + else { + var resp=app.alert("\ytStrErrorNoEmbed", 1, 3, "YouTube"); + if (resp==4) { + aebCancelWait(false); + ytOpenWeb(aebStartPlayer.annot); + } + } +} +/* + We start the player if the annot is activated, if not, + we set annot.activated=true, and wait for the widget to say it + is ready. When ready, ytPlayerReady() sets + aebStartPlayer.isPlayerReady=true +*/ +function aebStartPlayer(rm,Id,bPlay) { + aebStartPlayer.annot=rm; + if (aebStartPlayer.annot.activated) + aebStartPlayer.annot.callAS(% +(bPlay)?"loadVideoById":"cueVideoById",Id,0); + else { + aebCancelWait(false); + aebStartPlayer.annot.activated=true; + aebStartPlayer.isPlayerReady=false; + aebStartPlayer.twait=app.setInterval(% +'aebWait4Ready(\"'+Id+'\",'+bPlay+');',250); + aebStartPlayer.to=app.setTimeOut("aebCancelWait(true)", 10000); + } +} +aebStartPlayer.isPlayerReady=false; +aebStartPlayer.twait=null; +aebStartPlayer.to=null; +/* + If the player is ready, we start the video, and clear + the setInterval, otherwise, we wait. +*/ +function aebWait4Ready(Id,bPlay) { + if (aebStartPlayer.isPlayerReady) { + aebCancelWait(false); + aebStartPlayer.annot.callAS(% +(bPlay)?"loadVideoById":"cueVideoById",Id,0); + } +} +function aebCancelWait(bNotify) { + var twait=aebStartPlayer.twait; + if (aebStartPlayer.to!=null) + try { app.clearTimeOut(aebStartPlayer.to); } catch(e) {}; + aebStartPlayer.to=null; + if (aebStartPlayer.twait!=null) + try { app.clearInterval(aebStartPlayer.twait); } catch(e) {} + aebStartPlayer.twait=null; + if ( bNotify && twait!=null ) app.alert("\ytStrConnecTimedOut"); +} +\end{newsegment} +\begin{newsegment}{Popup Menu Data and JS} +\ytPopupData +var aChoice; +function ytProcessMenu(aMenu) { + var cChoice = \popUpMenu(aMenu); + if ( cChoice != null ) { + aChoice=eval(cChoice); + if (aChoice[1]=="") return null; + var thisChoice=aChoice[0]; + if (ytProcessMenu.nChoice==undefined) { + ytProcessMenu.nChoice=thisChoice; + eval("aMenu"+ytProcessMenu.nChoice).bMarked=true; + } else { + eval("aMenu"+ytProcessMenu.nChoice).bMarked=false; + var oldnChoice=ytProcessMenu.nChoice; + ytProcessMenu.nChoice=thisChoice; + eval("aMenu"+ytProcessMenu.nChoice).bMarked=(oldnChoice==ytProcessMenu.nChoice)?false:true; + } + return aChoice; + } else return null; +} +function ytPopupMenu(rmaName,ytmenu) { + var aChoice=ytProcessMenu(ytmenu); + var rm=this.getAnnotRichMedia(this.pageNum,rmaName); + if (aChoice!=null) { + if (ytProcessMenu.lastDescrip==undefined) { + aebStartPlayer(rm,aChoice[1],!event.shift); + } else { + if (ytProcessMenu.lastDescrip!=aChoice[1]) { + aebStartPlayer(rm,aChoice[1],!event.shift); + } + } + ytProcessMenu.lastDescrip=aChoice[1]; + } +} +\end{newsegment} +\end{insDLJS*} +% \end{macrocode} +% \begin{macrocode} +% +% \end{macrocode} +\endinput + +rm=this.getAnnotRichMedia(this.pageNum,"YouTube1"); +rm.callAS("cueVideoById", "GZ9e3Dy7obA"); diff --git a/texmf-dist/source/latex/yt4pdf/yt4pdf.ins b/texmf-dist/source/latex/yt4pdf/yt4pdf.ins new file mode 100644 index 00000000..6732fb25 --- /dev/null +++ b/texmf-dist/source/latex/yt4pdf/yt4pdf.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/09/10} +\def\batchfile{yt4pdf.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{yt4pdf.sty}{\from{yt4pdf.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/tex/latex/lmacs/lmacs.sty b/texmf-dist/tex/latex/lmacs/lmacs.sty new file mode 100644 index 00000000..0d49bf26 --- /dev/null +++ b/texmf-dist/tex/latex/lmacs/lmacs.sty @@ -0,0 +1,28 @@ +%% +%% This is file `lmacs.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% lmacs.dtx (with options: `package') +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{lmacs} + [2012/05/21 v1.1 Imports local macro files] +\RequirePackage{kvoptions}[2009/07/21] +\let\LM@inputlist\@empty +\newcommand{\LM@input}[2]{\InputIfFileExists{#1.#2}{}% + {\LM@warning{#1}{#2}}} +\newcommand{\LM@warning}[2]{\PackageWarning{lmacs} + {The file #1.#2 cannot be found}} +\define@key{lmacs}{cfg}{\g@addto@macro\LM@inputlist{\LM@input{#1}{cfg}}} +\define@key{lmacs}{!cfg}{} +\define@key{lmacs}{def}{\g@addto@macro\LM@inputlist{\LM@input{#1}{def}}} +\define@key{lmacs}{!def}{} +\define@key{lmacs}{js}{\g@addto@macro\LM@inputlist{\LM@input{#1}{js}}} +\define@key{lmacs}{!js}{} +\ProcessKeyvalOptions{lmacs} +\LM@inputlist +\endinput +%% +%% End of file `lmacs.sty'. diff --git a/texmf-dist/tex/latex/popupmenu/popupmenu.sty b/texmf-dist/tex/latex/popupmenu/popupmenu.sty new file mode 100644 index 00000000..49dbb8d5 --- /dev/null +++ b/texmf-dist/tex/latex/popupmenu/popupmenu.sty @@ -0,0 +1,83 @@ +%% +%% This is file `popupmenu.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% popupmenu.dtx (with options: `copyright,package') +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% popupmenu.sty package, 2009-10-15 %% +%% Copyright (C) 2009 D. P. Story %% +%% dpstory@acrotex.net %% +%% storyd@nwfsc.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. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{popupmenu} + [2010/09/18 v1.0 Provides support for popup menus (dps)] +\RequirePackage{xkeyval} +\define@key{menustruct}{title}[]{\def\menustruct@title{#1}} +\define@boolkey{menustruct}{marked}[true]{} +\define@boolkey{menustruct}{enabled}[true]{} +\define@key{menustruct}{return}[]{\def\menustruct@return{#1}} +\let\pum@holdtoks\@empty +\newcommand{\@AddToMenuToks}{\g@addto@macro\pum@holdtoks} +\newcount\pum@cnt +\def\pum@updateindex{\global\advance\pum@cnt\@ne + \edef\pum@rc{\pum@topindex[\the\pum@cnt]}\edef\itemindex{'\pum@rc'}} +\def\pum@initIndexMenu#1{\global\pum@cnt=-1\relax\edef\pum@rc{#1}% + \edef\pum@topindex{\pum@rc}} +\newenvironment{popupmenu}[1]{\pum@initIndexMenu{}% + \let\pum@holdtoks\@empty + \toks@={\pum@mytab}\@makeother\~ + \gdef\msarg{#1}\@AddToMenuToks{\@gobble}% + \let\item\pum@item +}{% + \expandafter\xdef\csname\msarg\endcsname{% + var \msarg\space = [ \pum@holdtoks^^J];}% +} +\newcommand{\pum@item}[1]{\pum@updateindex + \edef\tmp@exp{\noexpand + \setkeys{menustruct}{title,marked=false,enabled,return,#1}}\tmp@exp + \edef\tmp@exp{,^^J\the\toks@ + {cName: "\menustruct@title"% + \ifKV@menustruct@marked, bMarked: true\fi% + \ifKV@menustruct@enabled\else, bEnabled: false\fi% + \ifx\menustruct@return\@empty\else, + cReturn: "\menustruct@return"\fi}}% + \expandafter\@AddToMenuToks\expandafter{\tmp@exp}% +} +\begingroup +\catcode`<=1 \catcode`\>=2 \@makeother\{ \@makeother\} +\gdef\pum@lbrace<{>\gdef\pum@rbrace<}> +\endgroup +\def\pum@mytab{\space\space\space\space} +\newenvironment{submenu}[1]{\pum@updateindex + \xdef\saved@pum@cnt{\the\pum@cnt}% + \pum@initIndexMenu{\pum@rc.oSubMenu}\edef\temp@toks{\the\toks@}% + \toks@=\expandafter{\temp@toks\pum@mytab}% + \setkeys{menustruct}{title,marked=false,enabled,return,#1}% + \edef\tmp@exp{,^^J\the\toks@ + \noexpand\pum@lbrace cName: "\menustruct@title"% + \ifKV@menustruct@marked, bMarked: true\fi% + \ifKV@menustruct@enabled\else, bEnabled: false\fi, + oSubMenu:^^J\the\toks@[}% + \expandafter\@AddToMenuToks\expandafter{\tmp@exp\@gobble}% +}{% + \edef\tmp@exp{^^J\the\toks@ ]\pum@rbrace}% + \expandafter\@AddToMenuToks\expandafter{\tmp@exp}% + \global\pum@cnt\saved@pum@cnt +} +\def\popUpMenu(#1){app.popUpMenuEx.apply( app, #1 )} +\providecommand{\urlPath}[1]{\def\pum@urlName{#1}% + \hyper@normalise\pum@urlPath} +\def\pum@urlPath#1{\expandafter\xdef\pum@urlName{#1}} +\endinput +%% +%% End of file `popupmenu.sty'. diff --git a/texmf-dist/tex/latex/rangen/rangen.sty b/texmf-dist/tex/latex/rangen/rangen.sty new file mode 100644 index 00000000..0ab1a585 --- /dev/null +++ b/texmf-dist/tex/latex/rangen/rangen.sty @@ -0,0 +1,1175 @@ +%% +%% This is file `rangen.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% rangen.dtx (with options: `copyright,package') +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Rangen.sty package, 2016-02-19 %% +%% 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. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\NeedsTeXFormat{LaTeX2e}[1997/12/01] +\ProvidesPackage{rangen} + [2014/10/17 v1.4 Rangen: Generate Random Questions (dps)] +\newcount\seedCnt +\DeclareOption{testmode}{% + \InputIfFileExists{\jobname.seed}{}{\def\thisseed{1}}% + \PassOptionsToPackage{seed=\thisseed}{lcg}% + \AtEndOfPackage{\reseedEachRun}% +} +\def\reseedEachRun{% + \seedCnt=\thisseed + \advance\seedCnt1\relax + \newwrite \rngWrite + \immediate\openout\rngWrite \jobname.seed + \immediate\write\rngWrite{\string\def\string\thisseed{\the\seedCnt}} + \immediate\closeout\rngWrite +} +\def\RNG@Dec{.} +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{lcg}} +\ProcessOptions +\RequirePackage{lcg}[2008/09/10] +\edef\rng@saveSeed{\the\cr@nd} +\newcount\loopCnt +\def\maxLoopLimit{10} +\def\typeCodeForz{0} +\def\typeCodeForq{1} +\def\typeCodeForr{2} +\newcount\rng@cnta +\newcount\rng@cntb +\def\@getVarName#1{% + \edef\@varName{\expandafter\@gobble\string#1}% +} +\def\@getVarType#1{% + \@getVarName{#1}\edef\varType{\csname typeof@\@varName\endcsname}} +\def\gcd#1#2{{% #1 = a, #2 = b + \ifnum#2=0 \edef\next{#1}\else + \@tempcnta=#1 \@tempcntb=#2 \divide\@tempcnta by\@tempcntb + \multiply\@tempcnta by\@tempcntb % q*b + \@tempcntb=#1 + \advance\@tempcntb by-\@tempcnta % remainder in \@tempcntb + \ifnum\@tempcntb=0 + \@tempcnta=#2 + \ifnum\@tempcnta < 0 \@tempcnta=-\@tempcnta\fi + \xdef\gcd@next{\noexpand% + \def\noexpand\thegcd{\the\@tempcnta}}% + \else + \xdef\gcd@next{\noexpand\gcd{#2}{\the\@tempcntb}}% + \fi + \fi}\gcd@next +} +\def\lcm#1#2{% #1 = a, #2 = b + \gcd{#1}{#2}% + {\@tempcnta=#1 + \multiply\@tempcnta by#2 + \divide\@tempcnta by\thegcd + \xdef\thelcm{\the\@tempcnta}}% +} +\def\amodb#1#2{% #1 = a, #2 = b + {\@tempcnta=#1 + \divide\@tempcnta by#2 + \multiply\@tempcnta by#2 + \@tempcntb=#1 + \advance\@tempcntb by-\@tempcnta + \xdef\retnmod{\the\@tempcntb}}% +} +\newcommand\reduceFrac[2] +{% + \gcd{#1}{#2}{\@tempcnta=#1 \divide\@tempcnta by\thegcd + \@tempcntb=#2 \divide\@tempcntb by\thegcd + \ifnum\@tempcntb<0\relax + \@tempcntb=-\@tempcntb + \@tempcnta=-\@tempcnta + \fi + \xdef\rfNumer{\the\@tempcnta}\xdef\rfDenom{\the\@tempcntb}}% +} +\def\convertRatTo#1#2#3{{% + \@tempcnta=#3 + \multiply\@tempcnta by#1 + \divide\@tempcnta by#2 + \xdef\rng@retn@num{\the\@tempcnta}% +}} +\newcommand\RNGadd[2]{% + \rng@cnta=\nOf#1 \multiply\rng@cnta by\dOf#2 + \rng@cntb=\nOf#2 \multiply\rng@cntb by\dOf#1 + \advance\rng@cnta by\the\rng@cntb + \rng@cntb=\dOf#1 \multiply\rng@cntb by\dOf#2 + \reduceFrac{\the\rng@cnta}{\the\rng@cntb} +} +\def\rng@isControl#1{\@ifundefined{\expandafter\@gobble\string#1}% + {\let\rng@isC@ntrol=0}{\let\rng@isC@ntrol=1}} +\def\rng@existStar#1{\rng@existSt@r#1**\@nil} +\def\rng@existSt@r#1*#2*#3\@nil{\def\rng@isStari{#1}% + \def\rng@isStarii{#2}\def\rng@isStariii{#3}% +} +\def\rng@NameEndpoint#1{% + \ifx\rng@isStari\@empty + \edef#1{\expandafter\noexpand\rng@isStarii}% + \else\ifx\rng@isStarii\@empty + \edef#1{\expandafter\noexpand\rng@isStari}% + \fi\fi +} +\newcommand\defineZ[2] +{% + \@getVarName#1\relax + \expandafter\def\csname typeof@\@varName\endcsname{0}% + \expandafter\edef\csname n@\@varName\endcsname{#2}% + \expandafter\edef\csname d@\@varName\endcsname{1}% + \edef\display@TeXfmt{#2}\edef\inline@TeXfmt{#2}% + \ifnum#2=1\relax\rng@makeOneFmtDefns + \else\ifnum#2=-1\relax\rng@makeMinusOneFmtDefns + \else\rng@makeOtherFmtDefns\fi\fi + \expandafter\let\csname\@varName*\endcsname\display@TeXfmt + \expandafter\let\csname\@varName!\endcsname\inline@TeXfmt + \expandafter\edef\csname\@varName\endcsname{#2}% +} +\newcommand\defineQ[3] +{% + \@getVarName#1\relax + \expandafter\def\csname typeof@\@varName\endcsname{1}% + \expandafter\edef\csname n@\@varName\endcsname{#2}% + \expandafter\edef\csname d@\@varName\endcsname{#3}% + \edef\display@TeXfmt{\frac{#2}{#3}}\edef\inline@TeXfmt{#2/#3}% + \ifnum#2=#3\relax\rng@makeOneFmtDefns + \else\ifnum#2=-#3\relax\rng@makeMinusOneFmtDefns + \else\rng@makeOtherFmtDefns\fi\fi + \expandafter\let\csname\@varName*\endcsname\display@TeXfmt + \expandafter\let\csname\@varName!\endcsname\inline@TeXfmt + \expandafter\edef\csname\@varName\endcsname{#2/#3}% + \simplifyCurrentQ +} +\newcommand{\defineR}[2]{% + \@getVarName{#1}\RNGparseDec{#2}% + \expandafter\def\csname typeof@\@varName\endcsname{2}% + \reduceFrac{\rng@intpart\rng@fracpart}{\rndPower}% + \expandafter\edef\csname n@\@varName\endcsname{\rfNumer}% + \expandafter\edef\csname d@\@varName\endcsname{\rfDenom}% + \edef\display@TeXfmt{#2}\edef\inline@TeXfmt{#2}% + \ifnum\rfNumer=1\relax\rng@makeOneFmtDefns + \else\ifnum\rfNumer=-1\relax\rng@makeMinusOneFmtDefns + \else\rng@makeOtherFmtDefns\fi\fi + \expandafter\let\csname\@varName*\endcsname\display@TeXfmt + \expandafter\let\csname\@varName!\endcsname\inline@TeXfmt + \expandafter\edef\csname\@varName\endcsname{#2}% + \simplifyCurrentR +} +\newcommand{\simplifyCurrentR}{% + \ifnum\csname d@\@varName\endcsname=1 + \expandafter\defineZ + \csname\@varName\endcsname{\csname n@\@varName\endcsname}\fi +} +\def\rng@makeOneFmtDefns{% + \expandafter\def\csname\@varName!e\endcsname{}% + \expandafter\def\csname\@varName!c\endcsname{}% + \expandafter\def\csname\@varName*e\endcsname{}% + \expandafter\def\csname\@varName*c\endcsname{}% +} +\def\rng@makeMinusOneFmtDefns{% + \expandafter\def\csname\@varName!e\endcsname{-1}% + \expandafter\def\csname\@varName!c\endcsname{-}% + \expandafter\def\csname\@varName*e\endcsname{-1}% + \expandafter\def\csname\@varName*c\endcsname{-}% +} +\def\rng@makeOtherFmtDefns{% + \expandafter\let\csname\@varName!e\endcsname\inline@TeXfmt + \expandafter\let\csname\@varName!c\endcsname\inline@TeXfmt + \expandafter\let\csname\@varName*e\endcsname\display@TeXfmt + \expandafter\let\csname\@varName*c\endcsname\display@TeXfmt +} +\def\RNGparseRat#1{\expandafter\@chkslash#1//\@nil} +\def\@chkslash#1/#2/#3\@nil{% + \def\rng@num{#1}\def\rng@denom{#2}% + \def\rng@parseQ@iii{#3}% + \ifx\rng@denom\@empty\def\rng@denom{1}\fi +} +\newcommand{\RNGparseDec}[1]{\edef\parse@argi{#1}% + \expandafter\@chkdec\parse@argi..\@nil} +\def\@chkdec#1.#2.#3\@nil{% + \def\rng@intpart{#1}\def\rng@fracpart{#2}% + \def\rng@parseR@iii{#3}\rng@getnDec} +\def\rng@getnDec{% + \begingroup + \ifx\rng@fracpart\@empty\gdef\rndnDec{0}\gdef\rndPower{1}\else + \count0=0\relax\count2=1\relax + \expandafter\cntNumDec\rng@fracpart\end\fi + \endgroup} +\def\cntNumDec#1#2\end{% + \advance\count0by1 + \def\rng@arg{#2}% + \ifx\rng@arg\@empty + \xdef\rndnDec{\the\count0}% + \xdef\rndPower{1\@nameuse{rng@tz\the\count0}}% + \let\rng@next\relax + \else + \def\rng@next{\cntNumDec#2\end}% + \fi\rng@next +} +\newcommand{\nDivisionsPowerOfTen}[1]{% + \begingroup + \count0=#1\relax + \ifnum\count0>4\relax + \PackageError{rangen}{Number of subdivisions too large}% + {Reduce the argument of \string\nDivisionsPowerOfTen.}% + \else + \ifnum\count0<1\relax + \PackageError{rangen}{Number of subdivisions too large}% + {Increase the argument of \string\nDivisionsPowerOfTen.}% + \fi\fi + \xdef\RNGpowerOfTen{1\@nameuse{rng@tz#1}}% + \endgroup +} +\nDivisionsPowerOfTen{2} +\newcommand\RandomZ[4][] +{% + \def\rng@ne@values{}% + \setkeys{rangen}{ne,#1}% + \let\rng@CtrlLEP=0\let\rng@CtrlUEP=0% + \let\rng@makeLEPStrict=0\let\rng@makeUEPStrict=0% + \rng@existStar{#3}\rng@NameEndpoint{\rng@LEP}% + \if\rng@isStariii*\edef\tmp@exp{% + \noexpand\rng@isControl{\expandafter\noexpand\rng@LEP}}\tmp@exp + \if\rng@isC@ntrol1% a control sequence + \let\rng@CtrlLEP=1\let\rng@makeLEPStrict=1% + \edef\tmp@exp{\noexpand% + \@getVarType{\expandafter\noexpand\rng@LEP}}\tmp@exp + \ifcase\varType % integer + \rng@cnta=\rng@LEP + \or % rational + \rng@dima=\expandafter\nOf\rng@LEP pt + \divide\rng@dima by\expandafter\dOf\rng@LEP + \defineR{\rng@LEP}{\strip@pt\rng@dima}% + \RNGparseDec{\rng@LEP}% + \rng@cnta=\rng@intpart + \or % real + \defineR{\rng@LEP}{\rng@LEP}% + \RNGparseDec{\rng@LEP}% + \rng@cnta=\rng@intpart + \fi + \advance\rng@cnta by1\relax + \defineZ{\rng@LEP}{\the\rng@cnta}% + \else + \defineZ{\rng@LEP}{\rng@LEP}% + \fi + \else + \rng@isControl{#3}% + \if\rng@isC@ntrol1% control sequence + \let\rng@CtrlLEP=1% + \def\rng@LEP{#3}% + \@getVarType{#3}% + \ifcase\varType % integer + \defineZ{\rng@LEP}{#3}% + \or % rational + \rng@dima=\nOf{#3}pt + \divide\rng@dima by\dOf{#3}% + \defineR{\rng@LEP}{\strip@pt\rng@dima}% + \RNGparseDec{\rng@LEP}% + \defineZ{\rng@LEP}{\rng@intpart}% + \or % real + \defineR{\rng@LEP}{\rng@LEP}% + \RNGparseDec{\rng@LEP}% + \defineZ{\rng@LEP}{\rng@intpart}% + \fi + \else + \defineZ{\rng@LEP}{#3}% + \fi + \fi + \rng@existStar{#4}\rng@NameEndpoint{\rng@UEP}% + \if\rng@isStariii*\edef\tmp@exp{% + \noexpand\rng@isControl{\expandafter\noexpand\rng@UEP}}\tmp@exp + \if\rng@isC@ntrol1% a control sequence + \let\rng@CtrlUEP=1\let\rng@makeUEPStrict=1% + \edef\tmp@exp{\noexpand% + \@getVarType{\expandafter\noexpand\rng@UEP}}\tmp@exp + \ifcase\varType % integer + \rng@cnta=\rng@UEP + \or % rational + \rng@dima=\expandafter\nOf\rng@UEP pt + \divide\rng@dima by\expandafter\dOf\rng@UEP + \defineR{\rng@UEP}{\strip@pt\rng@dima}% + \RNGparseDec{\rng@UEP}% + \rng@cnta=\rng@intpart + \or % real + \defineR{\rng@UEP}{\rng@UEP}% + \RNGparseDec{\rng@UEP}% + \rng@cnta=\rng@intpart + \fi + \advance\rng@cnta by-1\relax + \defineZ{\rng@UEP}{\the\rng@cnta}% + \else + \defineZ{\rng@UEP}{\rng@UEP}% + \fi + \else + \rng@isControl{#4}% + \if\rng@isC@ntrol1% control sequence + \let\rng@CtrlUEP=1% + \def\rng@UEP{#4}% + \@getVarType{#4}% + \ifcase\varType % integer + \defineZ{\rng@UEP}{#4}% + \or % rational + \rng@dima=\nOf{#4}pt + \divide\rng@dima by\dOf{#4}% + \defineR{\rng@UEP}{\strip@pt\rng@dima}% + \RNGparseDec{\rng@UEP}% + \defineZ{\rng@UEP}{\rng@intpart}% + \or % real + \defineR{\rng@UEP}{\rng@UEP}% + \RNGparseDec{\rng@UEP}% + \defineZ{\rng@UEP}{\rng@intpart}% + \fi + \else + \defineZ{\rng@UEP}{#4}% + \fi + \fi + \def\@currentName{#2}% + \@getVarName{#2}% + \expandafter\def\csname typeof@\@varName\endcsname{0}% + \expandafter\edef\csname first@\@varName\endcsname{\rng@LEP}% + \expandafter\edef\csname last@\@varName\endcsname{\rng@UEP}% + \rng@chgrand[first=\rng@LEP,last=\rng@UEP]\rand + \defineZ{#2}{\arabic{rand}}% + \ifx\rangen@ne\@empty\else\loopCnt=0\relax + \@whilenum\loopCnt<\maxLoopLimit\do{% + \rng@cnta=1\relax + \@for\ne@@tmp:=\rangen@ne\do{% + \ifnum\value{rand}=\ne@@tmp\relax + \multiply\rng@cnta0\relax + \else + \multiply\rng@cnta1\relax + \fi + }% + \ifnum\rng@cnta=1\relax % all conditions met + \loopCnt=\maxLoopLimit + \else % if \rng@cnta \ne 1, try again + \advance\loopCnt1\relax + \ifnum\loopCnt=\maxLoopLimit + \PackageWarning{rangen}{Not all conditions met + after \maxLoopLimit\space tries}% + \else + \rng@chgrand[first=\rng@LEP,last=\rng@UEP]\rand + \fi + \fi + }% + \fi + \defineZ{#2}{\arabic{rand}}% +} +\def\updateZ#1#2{% + \@getVarName#1\relax + \expandafter\edef\csname\@varName\endcsname{#2}% + \expandafter\edef\csname n@\@varName\endcsname{#2}% + \expandafter\edef\csname d@\@varName\endcsname{1}% +} +\newcommand{\RandomQ}[2][] +{% + \setkeys{rangen}{ne,#1}% + \def\rq@currentName{#2}% + \@RandomQ +} +\newcommand{\@RandomQ}[3][] +{% + \let\rng@CtrlLEP=0\let\rng@CtrlUEP=0% + \let\rng@makeLEPStrict=0\let\rng@makeUEPStrict=0% + \rng@existStar{#2}\rng@NameEndpoint{\rng@LEP}% + \if\rng@isStariii*\edef\tmp@exp{\noexpand% + \rng@isControl{\expandafter\noexpand\rng@LEP}}\tmp@exp + \if\rng@isC@ntrol1% a control sequence + \let\rng@CtrlLEP=1\let\rng@makeLEPStrict=1% + \edef\tmp@exp{\noexpand% + \@getVarType{\expandafter\noexpand\rng@LEP}}\tmp@exp + \ifcase\varType % integer + \defineQ{\rng@LEP}{\rng@LEP}{1}% + \or % rational + \edef\tmp@exp{\noexpand% + \defineQ{\noexpand\rng@LEP}{\expandafter\nOf\rng@LEP}% + {\expandafter\dOf\rng@LEP}}\tmp@exp + \or % real + \defineR{\rng@LEP}{\rng@LEP}% + \RNGparseDec{\rng@LEP}% + \defineQ{\rng@LEP}{\rng@intpart}{\rng@fracpart}% + \fi + \else + \RNGparseRat{\rng@LEP}% + \defineQ{\rng@UEP}{\rng@intpart}{\rng@fracpart}% + \fi + \else + \rng@isControl{#2}% + \if\rng@isC@ntrol1% a control sequence + \@getVarType{#2}% + \ifcase\varType % integer + \defineQ{\rng@LEP}{#2}{1}% + \or % rational + \defineQ{\rng@LEP}{\nOf{#2}}{\dOf{#2}}% + \or % real + \defineR{\rng@LEP}{#2}% + \RNGparseDec{\rng@LEP}% + \defineQ{\rng@LEP}{\rng@intpart}{\rng@fracpart}% + \fi + \else % a number, required to be rational + \RNGparseRat{#2}% + \defineQ{\rng@LEP}{\rng@num}{\rng@denom}% + \fi + \fi + \rng@existStar{#3}\rng@NameEndpoint{\rng@UEP}%% + \if\rng@isStariii*% + \edef\tmp@exp{\noexpand% + \rng@isControl{\expandafter\noexpand\rng@UEP}}\tmp@exp + \if\rng@isC@ntrol1% a control sequence + \let\rng@CtrlUEP=1\let\rng@makeUEPStrict=1% + \edef\tmp@exp{\noexpand% + \@getVarType{\expandafter\noexpand\rng@UEP}}\tmp@exp + \ifcase\varType % integer + \defineQ{\rng@UEP}{\rng@UEP}{1}% + \or % rational + \edef\tmp@exp{\noexpand% + \defineQ{\noexpand\rng@UEP}{\expandafter\nOf\rng@UEP}% + {\expandafter\dOf\rng@UEP}}\tmp@exp + \or % real + \defineR{\rng@UEP}{\rng@UEP}% + \RNGparseDec{\rng@UEP}% + \defineQ{\rng@UEP}{\rng@intpart}{\rng@fracpart}% + \fi + \else + \RNGparseRat{\rng@UEP}% + \defineQ{\rng@UEP}{\rng@intpart}{\rng@fracpart}% + \fi + \else + \rng@isControl{#3}% + \if\rng@isC@ntrol1% a control sequence + \@getVarType{#3}% + \ifcase\varType % integer + \defineQ{\rng@UEP}{#3}{1}% + \or % rational + \defineQ{\rng@UEP}{\nOf{#3}}{\dOf{#3}}% + \or % real + \defineR{\rng@UEP}{#3}% + \RNGparseDec{\rng@UEP}% + \defineQ{\rng@UEP}{\rng@intpart}{\rng@fracpart}% + \fi + \else % a number, required to be rational + \RNGparseRat{#3}% + \defineQ{\rng@UEP}{\rng@num}{\rng@denom}% + \fi + \fi + \@@RandomQ{#1}{\nOf{\rng@LEP}}{\dOf{\rng@LEP}}% + {\nOf{\rng@UEP}}{\dOf{\rng@UEP}}% +} +\newcommand{\@@RandomQ}[5] +{% + \updateQ\@rqi{#2}{#3}\updateQ\@rqii{#4}{#5}% + \lcm{#3}{#5}\edef\@thelcm{\thelcm}% + \def\@maxDenom{#1}% + \ifx\@maxDenom\@empty\edef\@maxDenom{\@thelcm}\else + \lcm{\@thelcm}{#1}\edef\@thelcm{\thelcm}\fi + \convertRatTo{\nOf\@rqi}{\dOf\@rqi}{\@thelcm}% + \updateQ\@@rqi{\rng@retn@num}{\@thelcm}% + \convertRatTo{\nOf\@rqii}{\dOf\@rqii}{\@thelcm}% + \updateQ\@@rqii{\rng@retn@num}{\@thelcm}% + \rng@cnta=\@thelcm \divide\rng@cnta by\@maxDenom + \edef\@divisor{\the\rng@cnta}% + \rng@cnta=\nOf\@@rqi + \divide\rng@cnta by\@divisor + \advance\rng@cnta by1 + \rng@cntb=\nOf\@@rqii\divide\rng@cntb by\@divisor + \if\rng@makeLEPStrict1\advance\rng@cnta1\relax\fi + \if\rng@makeUEPStrict1\advance\rng@cntb-1\relax\fi + \expandafter\@getVarName\rq@currentName + \let\save@varName\@varName + \expandafter\edef\csname first@n@\@varName\endcsname{\the\rng@cnta}% + \expandafter\edef\csname last@n@\@varName\endcsname{\the\rng@cntb}% + \expandafter\edef\csname first@d@\@varName\endcsname{\@maxDenom}% + \expandafter\edef\csname last@d@\@varName\endcsname{\@maxDenom}% + \edef\rng@LEP{\csname first@n@\@varName\endcsname}% + \edef\rng@UEP{\csname last@n@\@varName\endcsname}% + \rng@chgrand[first=\rng@LEP,last=\rng@UEP]\rand + \let\@currentName\rq@currentName + \expandafter\@getVarName\rq@currentName + \expandafter\defineQ\@currentName{\arabic{rand}}{\@maxDenom}% + \simplifyCurrentQ + \expandafter\defineQ\@currentName{\expandafter\nOf\@currentName}% + {\expandafter\dOf\@currentName}% + \ifx\rangen@ne\@empty\else\loopCnt=0\relax + \@whilenum\loopCnt<\maxLoopLimit\do{% + \rng@cnta=1\relax + \@for\ne@@tmp:=\rangen@ne\do{% + \let\save@currentName\rq@currentName + \RNGparseRat{\ne@@tmp}% + \defineQ{\cmp@Name}{\rng@num}{\rng@denom}% + \let\@varName\save@varName + \syncronizeQs{\@varName}% + \ifnum\csname n@\@varName\endcsname=\n@cmp@Name + \multiply\rng@cnta0\relax + \else + \multiply\rng@cnta1\relax + \fi + }% + \ifnum\rng@cnta=1\relax % all conditions met + \loopCnt=\maxLoopLimit + \else % if \rng@cnta \ne 1, try again + \advance\loopCnt1\relax + \ifnum\loopCnt=\maxLoopLimit + \PackageWarning{rangen}{Not all conditions met + after \maxLoopLimit\space tries}% + \else + \rng@chgrand[first=\rng@LEP,last=\rng@UEP]\rand + \expandafter\@getVarName\rq@currentName + \expandafter\defineQ\@currentName{\arabic{rand}}% + {\@maxDenom}% + \fi + \fi + }% + \fi + \simplifyCurrentQ + \expandafter\defineQ\@currentName{\expandafter\nOf\@currentName}% + {\expandafter\dOf\@currentName}% + \let\@currentName\rq@currentName + \expandafter\@getVarName\rq@currentName + \ifnum\csname d@\@varName\endcsname=1\relax\expandafter + \defineZ\@currentName{\expandafter\nOf\@currentName}% + \fi + \simplifyCurrentQ +} +\newcommand\updateQ[3] +{% + \@getVarName#1\relax + \expandafter\edef\csname\@varName\endcsname{#2/#3}% + \expandafter\edef\csname n@\@varName\endcsname{#2}% + \expandafter\edef\csname d@\@varName\endcsname{#3}% +} +\def\simplifyCurrentQ +{% + \reduceFrac{\csname n@\@varName\endcsname}% + {\csname d@\@varName\endcsname}% + \expandafter\edef\csname n@\@varName\endcsname{\rfNumer}% + \expandafter\edef\csname d@\@varName\endcsname{\rfDenom}% + \ifnum\csname n@\@varName\endcsname=0 + \expandafter\edef\csname\@varName\endcsname{0}% + \edef\display@TeXfmt{0}\edef\inline@TeXfmt{0}% + \else + \ifnum\csname n@\@varName\endcsname=\csname d@\@varName\endcsname + \expandafter\defineZ\csname\@varName\endcsname{1}% + \else + \ifnum\csname n@\@varName\endcsname + =-\csname d@\@varName\endcsname + \expandafter\defineZ\csname\@varName\endcsname{-1}% + \else + \ifnum\csname d@\@varName\endcsname=1 + \expandafter\defineZ\csname\@varName\endcsname + {\csname n@\@varName\endcsname}% + \else + \expandafter\edef\csname \@varName\endcsname{% + \csname n@\@varName\endcsname/% + \csname d@\@varName\endcsname}% + \edef\display@TeXfmt{% + \frac{\csname n@\@varName\endcsname} + {\csname d@\@varName\endcsname}}% + \edef\inline@TeXfmt{% + \csname n@\@varName\endcsname/% + \csname d@\@varName\endcsname}% + \expandafter\let + \csname\@varName*\endcsname\display@TeXfmt + \fi + \fi + \fi + \fi +} +\newcommand\nOf[1]{\csname n@\expandafter\@gobble\string#1\endcsname} +\newcommand\dOf[1]{\csname d@\expandafter\@gobble\string#1\endcsname} +\newcommand{\iOf}[1]{\csname i@\expandafter\@gobble\string#1\endcsname} +\newcommand\typeOf[1]{% + \csname typeof@\expandafter\@gobble\string#1\endcsname} +\newif\iftrailingzeros\trailingzerosfalse +\@namedef{rng@tz1}{0} +\@namedef{rng@tz2}{00} +\@namedef{rng@tz3}{000} +\@namedef{rng@tz4}{0000} +\@namedef{rng@tz5}{00000} +\@namedef{rng@tz6}{000000} +\@namedef{rng@tz7}{0000000} +\@namedef{rng@tz8}{00000000} +\def\rng@true{true}\def\rng@false{false} +\newdimen\rng@dima +\newdimen\rng@dimb +\newdimen\rng@dimc +\define@key{rangen}{ne}[]{\edef\rangen@ne{#1}} +\define@key{rangen}{round}[]{\def\rangen@round{#1}} +\define@key{rangen}{showzeros}[]{\def\rangen@showzeros{#1}% + \ifx\rangen@showzeros\@empty\global\trailingzerostrue\else + \ifx\rangen@showzeros\rng@true\global\trailingzerostrue\else + \global\trailingzerosfalse\fi\fi} +\define@key{rangen}{index}[]{\edef\rangen@index{#1}} +\newcommand{\RandomR}[4][]{% + \setkeys{rangen}{ne,round,showzeros=false,#1}% + \let\rng@CtrlLEP=0\let\rng@CtrlUEP=0% + \let\rng@makeLEPStrict=0\let\rng@makeUEPStrict=0% + \def\rng@lcg@first{0}\edef\rng@lcg@last{\RNGpowerOfTen}% + \rng@existStar{#3}\rng@NameEndpoint{\rng@LEP}% + \if\rng@isStariii*\edef\tmp@exp{\noexpand% + \rng@isControl{\expandafter\noexpand\rng@LEP}}\tmp@exp + \if\rng@isC@ntrol1% a control sequence + \let\rng@CtrlLEP=1\let\rng@makeLEPStrict=1% + \def\rng@lcg@first{1}% + \edef\tmp@exp{\noexpand% + \@getVarType{\expandafter\noexpand\rng@LEP}}\tmp@exp + \ifcase\varType % integer + \defineR{\rng@LEP}{\rng@LEP\RNG@Dec}% + \or % rational + \rng@dima=\expandafter\nOf\rng@LEP pt + \divide\rng@dima by\expandafter\dOf\rng@LEP + \defineR{\rng@LEP}{\strip@pt\rng@dima}% + \or % real + \defineR{\rng@LEP}{\rng@LEP}% + \fi + \else + \defineR{\rng@LEP}{\rng@LEP}% + \fi + \else + \rng@isControl{#3}% + \if\rng@isC@ntrol1% control sequence + \let\rng@CtrlLEP=1\def\rng@LEP{#3}% + \@getVarType{#3}% + \ifcase\varType % integer + \defineR{\rng@LEP}{\rng@LEP\RNG@Dec}% + \or % rational + \rng@dima=\nOf{#3}pt + \divide\rng@dima by\dOf{#3}% + \defineR{\rng@LEP}{\strip@pt\rng@dima}% + \or % real + \defineR{\rng@LEP}{\rng@LEP}% + \fi + \else + \defineR{\rng@LEP}{#3}% + \fi + \fi + \rng@existStar{#4}\rng@NameEndpoint{\rng@UEP}% + \if\rng@isStariii*\edef\tmp@exp{\noexpand% + \rng@isControl{\expandafter\noexpand\rng@UEP}}\tmp@exp + \if\rng@isC@ntrol1% a control sequence + \let\rng@CtrlUEP=1\let\rng@makeUEPStrict=1% + \rng@cnta=\rng@lcg@last\advance\rng@cnta-1\relax + \edef\rng@lcg@last{\the\rng@cnta}% + \edef\tmp@exp{\noexpand% + \@getVarType{\expandafter\noexpand\rng@UEP}}\tmp@exp + \ifcase\varType % integer + \defineR{\rng@UEP}{\rng@UEP\RNG@Dec}% + \or % rational + \rng@dima=\expandafter\nOf\rng@UEP pt + \divide\rng@dima by\expandafter\dOf\rng@UEP + \defineR{\rng@UEP}{\strip@pt\rng@dima}% + \or % real + \defineR{\rng@UEP}{\rng@UEP}% + \fi + \else + \defineR{\rng@UEP}{\rng@UEP}% + \fi + \else + \rng@isControl{#4}% + \if\rng@isC@ntrol1% control sequence + \let\rng@CtrlUEP=1\def\rng@UEP{#4}% + \@getVarType{#4}% + \ifcase\varType % integer + \defineR{\rng@UEP}{\rng@UEP\RNG@Dec}% + \or % rational + \rng@dima=\nOf{#4}pt + \divide\rng@dima by\dOf{#4}% + \defineR{\rng@UEP}{\strip@pt\rng@dima}% + \or % real + \defineR{\rng@UEP}{\rng@UEP}% + \fi + \else + \defineR{\rng@UEP}{#4}% + \fi + \fi + \def\@currentName{#2}\@getVarName{#2}% + \expandafter\edef\csname first@\@varName\endcsname{\rng@LEP}% + \expandafter\edef\csname last@\@varName\endcsname{\rng@UEP}% + \rng@getRandomR + \defineR{#2}{\strip@pt\rng@dima}% + \ifx\rangen@round\@empty\else + \RNGround{#2}{#2}{\rangen@round}% + \rng@dima=#2pt\relax + \defineR{#2}{\strip@pt\rng@dima}% + \fi + \ifx\rangen@ne\@empty\else\loopCnt=0\relax + \@whilenum\loopCnt<\maxLoopLimit\do{% + \rng@cnta=1\relax + \@for\ne@@tmp:=\rangen@ne\do{% + \rng@dima=#2pt + \ifdim\rng@dima=\ne@@tmp pt\relax + \multiply\rng@cnta0\relax\else + \multiply\rng@cnta1\relax\fi + }% + \ifnum\rng@cnta=1\relax % all conditions met + \loopCnt=\maxLoopLimit + \else % if \rng@cnta \ne 1, try again + \advance\loopCnt1\relax + \ifnum\loopCnt=\maxLoopLimit + \PackageWarning{rangen}{Not all conditions met + after \maxLoopLimit\space tries}% + \else + \rng@getRandomR + \defineR{#2}{\strip@pt\rng@dima}% + \ifx\rangen@round\@empty\else + \RNGround{#2}{#2}{\rangen@round}% + \rng@dima=#2pt\relax + \defineR{#2}{\strip@pt\rng@dima}% + \fi + \fi + \fi + }% + \fi + \rnd@ProcessRealFormat{#2}% + \def\@currentName{#2}% + \defineR{#2}{#2}% +} +\def\rng@getRandomR{% + \rng@dima=\rng@LEP pt + \rng@dimb=\rng@UEP pt + \advance\rng@dimb-\rng@dima + \rng@chgrand[first=\rng@lcg@first,last=\rng@lcg@last]\rand + \divide\rng@dimb by\RNGpowerOfTen\relax + \rng@dimb=\arabic{rand}\rng@dimb + \advance\rng@dima by\rng@dimb +} +\def\rnd@ProcessRealFormat#1{% + \ifx\rangen@round\@empty + \rng@dima=#1pt\relax + \defineR{#1}{\strip@pt\rng@dima}% + \else + \RNGround{#1}{#1}{\rangen@round}% + \rng@dima=#1pt\relax + \defineR{#1}{\strip@pt\rng@dima}% + \iftrailingzeros + {\RNGparseDec{#1}\count0=\decPls\relax + \advance\count0-\rndnDec\relax + \ifnum\count0>0\relax\xdef#1{% + \rng@intpart\RNG@Dec\rng@fracpart% +\@nameuse{rng@tz\the\count0}}% + \fi}% + \defineR{#1}{#1}% + \fi + \fi +} +\newcommand{\RandomS}[2][1/2]{% + \RNGparseRat{#1}% + \ifnum\rng@num<0\relax + \PackageError{rangen}{A positive numerator is required}% + {The rational number must be between 0 and 1}\fi + \ifnum\rng@denom<0\relax + \PackageError{rangen}{A positive denominator is required}% + {The rational number must be between 0 and 1}\fi + \ifnum\rng@num>\rng@denom\relax + \PackageError{rangen}{The rational must be between 0 and 1}% + {The rational number must be between 0 and 1}\fi + \rng@chgrand[first=1,last=\rng@denom]\rand + \@getVarName{#2}% + \ifnum\value{rand}>\rng@num\relax\def#2{-}% + \rng@makeMinusOneFmtDefns + \def\display@TeXfmt{-}\def\inline@TeXfmt{-}% + \else\def#2{+}\rng@makeOneFmtDefns + \def\display@TeXfmt{}\def\inline@TeXfmt{}\fi + \expandafter\let\csname\@varName*\endcsname\display@TeXfmt + \expandafter\let\csname\@varName!\endcsname\inline@TeXfmt +} +\newcommand{\RandomL}[3][]{% + \let\rangen@index\@empty + \setkeys{rangen}{#1}% + \rng@cnta=0\relax\@for\@@tmp:=#3\do{% + \advance\rng@cnta1\relax}\edef\n@rng@listItems{\the\rng@cnta}% + \ifx\rangen@index\@empty + \rng@chgrand[first=1,last=\n@rng@listItems]\rand + \else + \rng@cnta=\rangen@index + \advance\rng@cnta-1\relax + \amodb{\rng@cnta}{\n@rng@listItems}% + \rng@cnta=\retnmod + \advance\rng@cnta1\relax + \value{rand}=\rng@cnta + \fi + \@getVarName{#2}% + \expandafter\edef\csname i@\@varName\endcsname{\arabic{rand}}% + \rng@cnta=0\relax\@for\@@tmp:=#3\do{% + \advance\rng@cnta1\relax\ifnum\rng@cnta=\arabic{rand}% + \edef\rng@choice{\@@tmp}\fi}% + \def\@currentName{#2}% + \RNGparseDec{\rng@choice}% + \if\rng@parseR@iii\RNG@Dec\defineR{#2}{\rng@choice}% + \else\RNGparseRat{\rng@choice}% + \if\rng@parseQ@iii/\defineQ{#2}{\rng@num}{\rng@denom}% + \else\defineZ{#2}{\rng@choice}\fi\fi +} + +\newcommand{\RandomP}[3][]{% + \let\rangen@index\@empty + \setkeys{rangen}{#1}% + \rng@cnta=0\relax\@for\@@tmp:=#3\do{% + \advance\rng@cnta1\relax}\edef\n@rng@listItems{\the\rng@cnta}% + \ifx\rangen@index\@empty + \rng@chgrand[first=1,last=\n@rng@listItems]\rand + \else + \rng@cnta=\rangen@index + \advance\rng@cnta-1\relax + \amodb{\rng@cnta}{\n@rng@listItems}% + \rng@cnta=\retnmod + \advance\rng@cnta1\relax + \value{rand}=\rng@cnta + \fi + \@getVarName{#2}% + \expandafter\edef\csname i@\@varName\endcsname{\arabic{rand}}% + \rng@cnta=0\relax\@for\@@tmp:=#3\do{% + \advance\rng@cnta1\relax\ifnum\rng@cnta=\arabic{rand}% + \rng@toks=\expandafter{\@@tmp}\edef#2{\the\rng@toks}% + \expandafter\def\csname typeof@\@varName\endcsname{3}\fi}% +} +\newcommand{\RandomI}[2]{% + \rng@chgrand[first=1,last=#2]\rand + \defineZ{#1}{\arabic{rand}}% + \expandafter\edef\csname i@\@varName\endcsname{\arabic{rand}}% +} +\defineZ{\zZero}{0} +\defineZ{\zOne}{1} +\defineZ{\zMinusOne}{-1} +\defineR{\rPI}{3.1415927} +\defineR{\rE}{2.7182818} +\def\syncronizeQs#1{\edef\sync@arg{#1}% + \lcm{\csname d@\sync@arg\endcsname}{\d@cmp@Name}% + \edef\@thelcm{\thelcm}% + \convertRatTo{\n@cmp@Name}{\d@cmp@Name}{\@thelcm}% + \updateQ\cmp@Name{\rng@retn@num}{\@thelcm}% + \convertRatTo{\csname n@\sync@arg\endcsname}% + {\csname d@\sync@arg\endcsname}{\@thelcm}\expandafter + \defineQ\csname\sync@arg\endcsname{\rng@retn@num}{\@thelcm}% +} +\newcommand\ds[1]{% + \expandafter\csname\expandafter\@gobble\string#1*\endcsname +} +\newcommand\eds[1]{% + \expandafter\csname\expandafter\@gobble\string#1*e\endcsname +} +\newcommand\cds[1]{% + \expandafter\csname\expandafter\@gobble\string#1*c\endcsname +} +\newcommand\fmt[1]{% + \expandafter\csname\expandafter\@gobble\string#1!\endcsname +} +\newcommand\efmt[1]{% + \expandafter\csname\expandafter\@gobble\string#1!e\endcsname +} +\newcommand\cfmt[1]{% + \expandafter\csname\expandafter\@gobble\string#1!c\endcsname +} +\newcommand\js[1]{% + \expandafter\csname\expandafter\@gobble\string#1!*\endcsname +} + +\def\RNGround#1#2#3{% + \begingroup + \def\rng@ctrlName{#1}% + \def\rng@sourceName{#2}% + \def\rng@nDecPl{#3}% + \RNGparseDec{#2}% + \ifnum\rndnDec<#3\relax + \xdef\theseDigits{\rng@fracpart}% + \let\rng@next\relax + \else + \count0=0\relax + \gdef\theseDigits{}% + \def\rng@next{\expandafter\@rng@round\rng@fracpart\end}% + \fi + \rng@next + \xdef\decPls{\@ifundefined{save@rng@nDecPl}% + {\rng@nDecPl}{\save@rng@nDecPl}}% + \ifx\theseDigits\@empty + \xdef#1{\rng@intpart}\else + \xdef#1{\rng@intpart\RNG@Dec\theseDigits}\fi + \endgroup +} +\def\@rng@round#1{% + \ifx#1\end\let\rng@next\relax + \else + \ifnum\rng@nDecPl=0\relax + \ifnum#1>4\relax + \count0=\rng@intpart\relax + \ifnum\rng@intpart<0\relax + \advance\count0by-1\relax + \else + \advance\count0by1\relax + \fi + \xdef\rng@intpart{\the\count0}% + \fi + \gdef\theseDigits{}% + \let\rng@next\rng@gobbletoend + \else + \advance\count0by1\relax + \ifnum\count0=\rng@nDecPl\relax + \def\rng@next{\@@rng@round#1}% + \else + \xdef\theseDigits{\theseDigits#1}% + \let\rng@next\@rng@round + \fi + \fi + \fi + \rng@next +} +\def\rng@gobbletoend#1\end{} +\def\@@rng@round#1#2{% + \ifx#2\end% + \xdef\theseDigits{\theseDigits#1}% + \let\rng@next\relax + \else + \ifnum#2>4\relax\count2=#1\relax + \ifnum\count2=9\relax + \count0=\rng@nDecPl\relax + \ifnum\count0=1\relax + \count0=\rng@intpart\relax + \ifnum\rng@intpart<0\relax + \advance\count0by-1\relax + \else + \advance\count0by1\relax + \fi + \xdef\rng@intpart{\the\count0}% + \let\rng@next\rng@gobbletoend + \else + \advance\count0by-1\relax\expandafter + \xdef\rng@sourceName{% + \rng@intpart\RNG@Dec\theseDigits#1}% + \edef\save@rng@nDecPl{\rng@nDecPl}% + \edef\rng@next{\noexpand\RNGround{% + \expandafter\noexpand\rng@ctrlName}% + {\expandafter\noexpand\rng@sourceName}% + {\the\count0}\noexpand\rng@gobbletoend}% + \fi + \else + \advance\count2by1\relax + \xdef\theseDigits{\theseDigits\the\count2}% + \let\rng@next\rng@gobbletoend + \fi + \else % \ifnum#2<=4 + \xdef\theseDigits{\theseDigits#1}% + \let\rng@next\rng@gobbletoend + \fi + \fi + \rng@next +} +\def\RNGprintf#1{("#1",\@gobble} +\newcommand\defineDepQJS[4]{% + \@getVarName#1 + \expandafter\edef\csname\@varName\endcsname{(#2)/(#3)}% + \expandafter\edef\csname n@\@varName\endcsname{(#2)}% + \expandafter\edef\csname d@\@varName\endcsname{(#3)}% + \edef\display@TeXfmt{\csname\@varName\endcsname}% + \edef\inline@TeXfmt{\csname\@varName\endcsname}% + \def\dv@argiv{#4}\ifx\dv@argiv\@empty + \edef\eval@JSfmt{\csname\@varName\endcsname}\else + \edef\eval@JSfmt{#4}\fi + \expandafter\let\csname\@varName!*\endcsname\eval@JSfmt +} +\def\rng@writeCurrentSeed#1{\immediate\write#1{\string\makeatletter + \string\global\string\cr@nd=\the\cr@nd\string\relax + \string\makeatother}} +\newtoks\rng@toks +\def\wrv@ex@solns{exercises}% +\def\wrv@ex@quiz{quizzes}% +\newenvironment{writeRVsTo}[2][] +{% + \def\wrv@argii{#2}% + \ifx\wrv@argii\wrv@ex@quiz\let\wrv@out\quiz@solns + \else\ifx\wrv@argii\wrv@ex@solns\let\wrv@out\ex@solns\else + \let\wrv@out#2\fi\fi + \rng@writeCurrentSeed\wrv@out + \rng@toks={}% + \def\verbatim@processline{% + \xdef\rng@temp{\the\rng@toks\the\verbatim@line}% + \global\rng@toks=\expandafter{\rng@temp}}% + \let\do\@makeother\dospecials\catcode`\^^M\active + #1% + \verbatim@start +}{ \immediate\write\wrv@out{\the\rng@toks}% + \newwrite\rng@writeRVs + \immediate\openout\rng@writeRVs\jobname_rvs.cut + \immediate\write\rng@writeRVs{\the\rng@toks}% + \immediate\closeout\rng@writeRVs + \aftergroup\rng@Input@RVs +} +\def\rng@Input@RVs{\InputIfFileExists{\jobname_rvs.cut}{}{}} +\def\rng@p@stkeysr@nd{% + \@rderr@nd% last < first -> swap + \cutr@nger@nd% range too big -> cut +} % end of \def\p@stkeysr@nd +\def\rng@chgrand{\@ifnextchar[\rng@chgr@nd{\rng@chgr@nd[]}} +\def\rng@chgr@nd[#1]{% + \@tempcnta=\z@ + \@tempcntb=\z@ + \setkeys{Init}{#1}% + \rng@p@stkeysr@nd% + \@utputr@nd% +} % end of \def\rng@chgrand +\begin{insDLJS}[partialExpand]{partial}{Rangen} +var partre = /rEval|rFrac/; +function rngCorrAnsButton() +{ + var theprecision,fieldname,theanswer; + if (arguments.length==4) { + var theformat=arguments[0]; + var fieldname=arguments[1]; + var theanswer=arguments[2]; + var thequiz=arguments[3]; + } else { + var fieldname=arguments[0]; + var theanswer=arguments[1]; + var thequiz=arguments[2]; + } + theanswer = partialExpand(0,theanswer); + if (arguments.length==4) + theanswer=util.printf(theformat,eval(theanswer)); + DisplayAnswer(fieldname,theanswer,thequiz); +} +function partialExpand(level,Ans) +{ + Ans = correctPlusMinus(Ans) + level += 1; +\db console.println("Enter level = " + level +": Ans: " + Ans);\db% + var n=0, m, bP, eP, subExp; + while ( true ) { +\db console.println("Searching a level " + level);\db% + try { m = Ans.match(partre); } + catch (e) { break; } + if ( m != null ) { + bP = m.index + m[0].length; + eP = FindBalP(Ans, bP, true); +\db console.println("bP = " + bP + " : eP = " + eP);\db% + var subExp = Ans.substring(bP+1, eP); +\db console.println("Found \'" + subExp% + + "\' at level = " + level);\db% + // n = beginning of "rEval", + // eP = beginning of balanced parens, + // bP = end of balanced parens + Ans = Ans.substring(0, m.index) + + eval(m[0]+"(level,subExp)") + Ans.substring(eP+1); +\db console.println("level = " + level% + +": New Ans: " + Ans);\db % + } else { + if ( level == 1 ) { +\db console.println("Level 1 break");\db % + break; + } + } + } +\db console.println("Return Ans: " + Ans);\db% + Ans = correctPlusMinus(Ans); + return Ans; +} +function rEval(level, Ans) +{ + level += 1; +\db console.println("Enter rEval: level = "% + + level +": Ans: " + Ans);\db% + var n=0, m, bP, eP, subExp; + while ( true ) + { +\db console.println("Searching a level " + level);\db% + try { m = Ans.match(partre); } + catch (e) { break; } + if ( m != null ) { + bP = m.index + m[0].length; + eP = FindBalP(Ans, bP, true); +\db console.println("bP = " + bP + " : eP = " + eP);\db% + var subExp = Ans.substring(bP+1, eP); +\db console.println("Found \'" + subExp% + + "\' at level = " + level);\db% + // n = beginning of "rEval", + // eP = beginning of balanced parens, + // bP = end of balanced parens + Ans = Ans.substring(0, m.index) + +eval(m[0]+"(level,subExp)")+Ans.substring(eP+1); +\db console.println("level = "% + + level +": New Ans: " + Ans);\db % + } else { + Ans = ParseInput(Ans); +\db console.println("Ready to eval at level = "% + + level + ": Ans = " + Ans);\db% + with(Math) { Ans = eval( Ans ) }; +\db console.println("After eval at level = "% + + level + ": Ans = " + Ans);\db% + break; + } + } +\db console.println("Return Ans: " + Ans);\db% + return Ans; +} +function rFrac(level, Ans) +{ + level += 1; +\db console.println("Enter rFrac level = "% + + level +": Ans: " + Ans);\db% + var n=0, m, bP, eP, subExp; + while ( true ) { +\db console.println("Searching a level " + level);\db% + try { m = Ans.match(partre); } + catch (e) { break; } + if ( m != null ) { + bP = m.index + m[0].length; + eP = FindBalP(Ans, bP, true); +\db console.println("bP = "% + + bP + " : eP = " + eP);\db% + var subExp = Ans.substring(bP+1, eP); +\db console.println("Found \'" + subExp% + + "\' at level = " + level);\db% + // n = beginning of "rEval", + // eP = beginning of balanced parens, + // bP = end of balanced parens + Ans = Ans.substring(0, m.index) + + eval(m[0]+"(level,subExp)") + Ans.substring(eP+1); +\db console.println("level = " + level% + +": New Ans: " + Ans);\db % + } else { + var numDenom = Ans.split("/"); + numDenom[0] = eval(numDenom[0]); + numDenom[1] = eval(numDenom[1]); + var g = gcd(numDenom[0], numDenom[1]); + numDenom[0] /= g; + numDenom[1] /= g; + if ( numDenom[1] == 1) + Ans = numDenom[0]; + else + Ans = numDenom.join("/"); +\db console.println("Reduce: " + numDenom.join("/"));\db% + break; + } + } +\db console.println("Return Ans: " + Ans);\db% + return Ans; +} +function correctPlusMinus(Ans) +{ + Ans = "" + Ans; + Ans = Ans.replace(/\s*([\+-])\s*\1\s*/g, " + "); + Ans = Ans.replace(/\s*\+\s*-\s*/g, " - "); + Ans = Ans.replace(/\s*-\s*\+\s*/g, " - "); + return Ans; +} +function gcd(a,b) +{ + var x = a, y = b, r; + while (true) + { + r = x \% y; + if ( r == 0 ) break; + x = y; + y = r; + } + return Math.abs(y); +} +function lcm (a,b) { return (a*b)/gcd(a,b); } +\end{insDLJS} +\endinput +%% +%% End of file `rangen.sty'. diff --git a/texmf-dist/tex/latex/renditions/renditions.sty b/texmf-dist/tex/latex/renditions/renditions.sty new file mode 100644 index 00000000..12522f13 --- /dev/null +++ b/texmf-dist/tex/latex/renditions/renditions.sty @@ -0,0 +1,61 @@ +%% +%% This is file `renditions.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% renditions.dtx (with options: `copyright,package') +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Renditions.sty package, 2010-1-29 %% +%% Copyright (C) 1999-2002 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. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% History: Noel Vaillant began developing a better renditions.sty +%% based on my earlier published renditions.sty. Many thanks +%% to him for starting me off. +%%--------------------------------------------------------- +\NeedsTeXFormat{LaTeX2e}[1997/12/01] +\ProvidesPackage{rendition} + [2010/01/29 v0.1 rendition: Package for creating multiple renditions from the same source (dps)] +\RequirePackage{xkeyval} +\DeclareOptionX{max}{\def\ren@numberOf{#1}} +\def\ren@numberOf{3} +\DeclareOptionX{rendition}{\def\thisrendition{#1}} +\def\thisrendition{1} +\InputIfFileExists{rendition.cfg}{}{} +\ProcessOptionsX +\RequirePackage{comment} +\let\save@message\message\let\message\@gobble +\@tempcnta=0 +\@whilenum\@tempcnta<\ren@numberOf\do{% + \@tempcntb=\@tempcnta\advance\@tempcntb1 + \edef\temp@exp{\noexpand\excludecomment{rendition\the\@tempcntb}}% + \temp@exp + \expandafter\let\csname Afterver\the\@tempcntb Comment\endcsname\relax + \advance\@tempcnta1 +}\let\message\save@message +\AtBeginDocument{\includecomment{rendition\thisrendition}} +\def\rendition#1{\def\thisrendition{#1}% + \ifnum\thisrendition>\ren@numberOf + \@tempcnta=\thisrendition + \@tempcntb=\@tempcnta + \advance\@tempcnta-1 \divide\@tempcnta\ren@numberOf + \multiply\@tempcnta\ren@numberOf + \advance\@tempcntb-\@tempcnta + \edef\thisrendition{\the\@tempcntb}% + \typeout{Modular arithmetic applied: ren=\thisrendition}% + \fi +} +\@onlypreamble{\rendition} +\expandafter\rendition\expandafter{\thisrendition} +\endinput +%% +%% End of file `renditions.sty'. diff --git a/texmf-dist/tex/latex/richtext/richtext.sty b/texmf-dist/tex/latex/richtext/richtext.sty new file mode 100644 index 00000000..3541612b --- /dev/null +++ b/texmf-dist/tex/latex/richtext/richtext.sty @@ -0,0 +1,366 @@ +%% +%% This is file `richtext.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% richtext.dtx (with options: `copyright,package') +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% richtext package, %% +%% 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. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\NeedsTeXFormat{LaTeX2e}[1997/12/01] +\ProvidesPackage{richtext} + [2016/10/03 v1.0c richtext: create rich text strings (dps)] +\RequirePackage{xkeyval} +\RequirePackage{ifxetex}[2006/08/21] +\newif\ifrt@formfield \rt@formfieldtrue +\newif\ifrt@needsbody\rt@needsbodyfalse +\@ifpackageloaded{eforms}% + {\ifxetex\let\@eqV\@eqnuV\fi}{\rt@needsbodytrue} +\providecommand\eq@RV@Body{} +\providecommand\eq@RV@endBody{} +\def\rt@bBody{\ifrt@needsbody\eq@RV@Body\fi} +\def\rt@eBody{\ifrt@needsbody\eq@RV@endBody\fi} +\newif\ifrtfontstyle\rtfontstylefalse +\define@key{rtFont}{font}[]{\def\rt@argi{#1}\ifx\rt@argi\@empty + \let\rf@font\@empty\else\rtfontstyletrue + \def\rf@font{font-family:#1}\fi} +\define@key{rtFont}{size}[]{\def\rt@argi{#1}\ifx\rt@argi\@empty + \let\rf@size\@empty\else\rtfontstyletrue\def\rf@size@num{#1}% + \def\rf@size@pt{#1pt}\def\rf@size{font-size:#1pt}\fi} +\def\rf@size@num{12}\def\rf@size@pt{12pt} +\define@key{rtFont}{raise}[]{\def\rt@argi{#1}\ifx\rt@argi\@empty + \let\rf@raise\@empty\else\rtfontstyletrue + \def\rf@raise{vertical-align:#1pt}\fi} +\define@choicekey+{rtFont}{ulstyle}[\val\nr]% + {none,ul,2ul,wul,2wul}[none]{% + \ifcase\nr\relax + \def\rf@ul{none}\or + \def\rf@ul{underline}\or + \def\rf@ul{double}\or + \def\rf@ul{word}\or + \def\rf@ul{double word}\fi + \rtfontstyletrue +}{} +\def\rt@r{r}\let\rt@One=1 \let\rt@Zero=0 +\def\rt@parseColor#1(#2\@nil{\def\rt@argi{#2}\ifx\rt@argi\@empty +\let\rt@rgbdec\rt@Zero\else\let\rt@rgbdec\rt@One\fi} +\def\rt@gobbletonil#1\@nil{} +\bgroup\@makeother\#\@makeother\&% +\gdef\rt@hashtag{#}\gdef\rt@amp{&}\egroup +\define@key{rtFont}{color}[]{\def\rt@argi{#1}\ifx\rt@argi\@empty + \let\rf@color\@empty\else\rtfontstyletrue + \rt@parseColor#1(\@nil + \if\rt@rgbdec\rt@One + \def\rf@color{color:#1}\else + \def\rf@color{color:\rt@hashtag#1}\fi +\fi} +\let\rf@color\@empty +\define@key{rtFont}{url}[]{\def\rt@argi{#1}\ifx\rt@argi\@empty + \let\rt@url\@empty\else\rtfontstyletrue\def\rt@url{#1}\fi} +\define@choicekey+{rtFontStyle}{bold}[\val\nr]{normal,bold}[bold]% + {\edef\rfS@bold{\val}}{} +\define@choicekey+{rtFontStyle}{italic}[\val\nr]{normal,italic}[italic]% + {\edef\rfS@italic{\val}}{} +\define@key{rtFontStyle}{strikeit}[]{\def\rfS@strikeit{line-through}} +\let\rfS@normal\@empty\let\rfS@bold\@empty +\let\rfS@italic\@empty\let\rfS@strikeit\@empty +\define@key{rtFont}{style}[]{\def\rt@argi{#1}\ifx\rt@argi\@empty + \let\rf@style\@empty\else\rtfontstyletrue\def\rf@style{#1}\fi} +\define@key{rtFont}{raw}[]{\def\rt@argi{#1}\ifx\rt@argi\@empty + \let\rf@raw\@empty\else\rtfontstyletrue\def\rf@raw{#1}\fi} +\def\resetRtFontKeys{% rtFont family + \let\rf@font\@empty\let\rf@size\@empty + \let\rf@raise\@empty\let\rf@ul\@empty + \let\rf@color\@empty\let\rf@style\@empty\let\rt@url\@empty + \let\rf@raw\@empty + % rtFontStyle family + \let\rfS@normal\@empty\let\rfS@bold\@empty + \let\rfS@italic\@empty\let\rfS@strikeit\@empty + \rtfontstylefalse} +\resetRtFontKeys +\newcommand{\@AddToRichText}{\g@addto@macro\rt@RichText} +\newcommand{\@AddToPlainText}{\g@addto@macro\rt@PlainText} +\def\rt@excl{!} +\def\rt@csarg#1#2{\expandafter#1\csname#2\endcsname} +\newcommand{\useRV}[1]{\@nameuse{#1-ri}} +\newcommand{\useV}[1]{\@nameuse{#1-pl}} +\newif\if@rvstring \@rvstringfalse +\def\rvorvstring{\if@rvstring + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +\def\rt@sub#1{\rvorvstring{#1}{#1}} +\def\rt@sup#1{\rvorvstring{#1}{#1}} +\def\rt@br{\rvorvstring{
}{\string\r}} +\def\rt@bf#1{\rvorvstring{#1}{#1}} +\def\rt@it#1{\rvorvstring{#1}{#1}} +\def\rt@spc{\rvorvstring{\rt@amp + \rt@hashtag160\rt@SC}{ }} +\def\rt@SC{;}\def\rt@CN{:}\def\rt@fs{font-style}\def\rt@fw{font-weight} +\def\rt@td{text-decoration} +\def\rt@remove@span#1#2{#2} +\def\rt@StyleAttr{\ifx\rf@font\@empty\else\rf@font\rt@SC\fi + \ifx\rf@size\@empty\else\rf@size\rt@SC\fi + \ifrt@formfield\ifx\rf@raise\@empty\else\rf@raise\rt@SC\fi\fi + \ifx\rf@ul\@empty\ifx\rfS@strikeit\@empty\else + \rt@td\rt@CN\rfS@strikeit\rt@SC\fi + \else\rt@td\rt@CN\rf@ul\ifx\rfS@strikeit\@empty\else\space + \rfS@strikeit\fi\rt@SC\fi + \ifx\rfS@bold\@empty\else\rt@fw\rt@CN\rfS@bold\rt@SC\fi + \ifx\rfS@italic\@empty\else\rt@fs\rt@CN\rfS@italic\rt@SC\fi + \ifx\rf@color\@empty\else\rf@color\rt@SC\fi + \ifx\rf@raw\@empty\else\rf@raw\fi} +\let\rt@afterFont\relax +\newcommand\rt@span[2]{\resetRtFontKeys + \edef\x{\noexpand\setkeys{rtFont}{#1}}\x\rt@afterFont + \edef\x{\noexpand\setkeys{rtFontStyle}{\rf@style}}\x + \edef\rt@Style@ttr{\rt@StyleAttr}% + \ifx\rt@url\@empty + \ifx\rt@StyleAttr\@empty\def\x{#2}\else + \edef\x{#2}\fi + \else + \ifx\rt@StyleAttr\@empty\edef\x{#2}\else + \edef\x{#2\fi}\fi + \fi +} +\define@choicekey+{rtPara}{halign}[\val\nr]% + {left,center,right,justify}[left]{% + \ifcase\nr\relax + \def\rt@halign{text-align:left}\or + \def\rt@halign{text-align:center}\or + \def\rt@halign{text-align:right}\or + \def\rt@halign{text-align:justify}\fi + \rtfontstyletrue +}{} +\define@choicekey+{rtPara}{valign}[\val\nr]{top,middle,bottom}[top]{% + \ifcase\nr\relax + \def\rt@valign{text-valign:top}\or + \def\rt@valign{text-valign:middle}\or + \def\rt@valign{text-valign:bottom}\fi + \rtfontstyletrue +}{} +\let\rt@halign\@empty\let\rt@valign\@empty +\define@key{rtPara}{margleft}{\def\rt@margleft{margin-left:#1pt}} +\define@key{rtPara}{margright}{\def\rt@margright{margin-right:#1pt}} +\define@choicekey+{rtPara}{indent}[\val\nr]{none,first,hanging}[none]{% + \edef\rt@indenttype{\nr}% +}{} +\define@key{rtPara}{indentby}[12]{\def\rt@indentby{#1pt}} +\let\rt@margleft\@empty\let\rt@margright\@empty +\def\rt@indenttype{0}\def\rt@indentby{12pt} +\define@key{rtPara}{margtop}[0]{\def\rt@margtop{#1pt}} +\define@key{rtPara}{margbottom}[0]{\def\rt@margbottom{#1pt}} +\def\rt@margtop{0pt}\def\rt@margbottom{0pt} +\define@choicekey{rtPara}{linespacing}[\val\nr]% + {single,oneandhalf,double,exact}[single]{%line-height + \edef\rt@linespacingtype{\nr}% + \ifcase\nr + \let\rt@linesp\@empty\or + \setlength{\@tempdima}{1.8pt*\rf@size@num}% + \edef\rt@linesp{\the\@tempdima}\or + \setlength{\@tempdima}{2.4pt*\rf@size@num}% + \edef\rt@linesp{\the\@tempdima}\or + \def\rt@linesp{\rf@size@pt}\fi +}{} +\let\rt@linesp\@empty\def\rt@linespacingtype{0} +\define@key{rtPara}{lineheight}[]{\def\rt@lineheight{#1pt}} +\let\rt@lineheight\@empty +\def\rtp@ti{text-indent}\def\rtp@mt{margin-top} +\def\rtp@mb{margin-bottom}\def\rtp@lh{line-height} +\def\rt@ParaAttr{% + \ifx\rt@halign\@empty\else\rt@halign\rt@SC\fi +\ifrt@formfield + \ifx\rt@valign\@empty\else\rt@valign\rt@SC\fi + \ifx\rt@margleft\@empty\else\rt@margleft\rt@SC\fi + \ifx\rt@margright\@empty\else\rt@margright\rt@SC\fi + \ifcase\rt@indenttype\space\or + \rtp@ti\rt@CN\rt@indentby\rt@SC\or + \rtp@ti\rt@CN-\rt@indentby\rt@SC\fi + \rtp@mt\rt@CN\rt@margtop\rt@SC\rtp@mb\rt@CN\rt@margbottom\rt@SC + \ifx\rt@linesp\@empty\else + \if\rt@linespacingtype3% + \ifx\rt@lineheight\@empty + \rtp@lh\rt@CN\rt@linesp\rt@SC + \else + \rtp@lh\rt@CN\rt@lineheight\rt@SC + \fi + \else + \rtp@lh\rt@CN\rt@linesp\rt@SC + \fi + \fi +\fi +} +\begingroup +\catcode`\@=0 @catcode`@\=12 +@gdef@rtbs{\} +@endgroup +\def\rt@cs#1{\rvorvstring{\rtbs\rtbs#1}{\string\134#1}} +\let\rt@afterParaFont\relax +\def\rt@dir{ dir="ltr"} +\newcommand\rtpara[2][]{\begingroup + \setkeys{rtPara,rtFont}{#1}\rt@afterParaFont + \edef\rt@Para@ttr{\rt@ParaAttr\rt@StyleAttr}% + \global\let\rt@RichText\@empty + \global\let\rt@PlainText\@empty + \def\rt@ctrlName{#2}% + \def\{{\string\{}\def\}{\string\}}% + \def\1{\string\1}\def\2{\string\2}\def\3{\string\3}% + \@makeother\$\@makeother\#\@makeother\^\@makeother\_\@makeother\~% + \@makeother\&\def\&{\rvorvstring{\string&}{\string&}}% req + \@makeother\<\def\<{\rvorvstring{\string<}{\string<}}% req + \@makeother\>\def\>{\rvorvstring{\string>}{\string>}}% + \@makeother\'\def\'{\rvorvstring{\string'}{\string'}}% + \@makeother\"\def\"{\rvorvstring{\string"}{\string"}}% + \let\cs\rt@cs + \rtpara@cont} +\def\rtpara@cont#1{% + \let\sup\rt@sup\let\sub\rt@sub + \let\br\rt@br\let\bf\rt@bf\let\it\rt@it + \let\spc\rt@spc + \let\span\rt@remove@span + \@rvstringfalse + \edef\x{#1}\expandafter\@AddToPlainText\expandafter{\x}% + \let\span\relax + \@rvstringtrue + \rtpara@i#1\span!;\endgroup} +\def\rtpara@i#1\span#2;{\def\argii{#2}% + \g@addto@macro\rt@RichText{#1}% + \ifx\argii\rt@excl + \rt@csarg\xdef{\rt@ctrlName-ri}% + {% + \rt@RichText

% + }% + \rt@csarg\xdef{\rt@ctrlName-pl}{\rt@PlainText}% + \let\rt@next\relax + \else + \def\rt@next{\rtpara@ii#2;}% + \fi +\rt@next} +\def\rtpara@ii#1#2#3;{\def\argii{#2}% + \ifx\argii\rt@excl + \let\rt@next\relax + \else + \let\span\rt@span + \let\br\rt@br\let\bf\rt@bf\let\it\rt@it + \@rvstringtrue + \span{#1}{#2}\edef\rt@tmp{\noexpand\g@addto@macro + \noexpand\rt@RichText{\x}}\rt@tmp + \rt@csarg\xdef{\rt@ctrlName-ri}% + {% + \rt@RichText

% + }% + \rt@csarg\xdef{\rt@ctrlName-pl}{\rt@PlainText}% + \let\span\relax + \def\rt@next{\rtpara@i#3;}% + \fi\rt@next} +\rt@csarg\def{par-ri}{}\rt@csarg\def{par-pl}{\string\r} +\rt@csarg\def{skipline-ri}% + {

\rt@amp + \rt@hashtag160;

} +\rt@csarg\def{skipline-pl}{\string\r\space} +\def\rt@skipline{skipline} +\rt@csarg\def{br-ri}{}\rt@csarg\def{br-pl}{\string\r} +\def\rt@DSAttr{\ifx\rf@font\@empty\else\rf@font\rt@SC\fi + \ifx\rf@size\@empty\else\rf@size\rt@SC\fi + \ifx\rf@raise\@empty\else\rf@raise\rt@SC\fi + \ifx\rf@ul\@empty\ifx\rfS@strikeit\@empty\else + \rt@td\rt@CN\rfS@strikeit\rt@SC\fi + \else\rt@td\rt@CN\rf@ul\ifx\rfS@strikeit\@empty\else\space + \rfS@strikeit\fi\rt@SC\fi + \ifx\rfS@bold\@empty\else\rt@fw\rt@CN\rfS@bold\rt@SC\fi + \ifx\rfS@italic\@empty\else\rt@fs\rt@CN\rfS@italic\rt@SC\fi + \ifx\rf@color\@empty\else\rf@color\rt@SC\fi} +\newcommand\useDefaultDS{font-family:Helvetica,sans-serif;% + font-size:12.0pt;font-style:normal;font-weight:normal;% + text-align:left;color:\rt@hashtag000000} +\newcommand{\setDefaultStyle}[2]{\begingroup + \edef\x{\noexpand\setkeys{rtFont}{#2}}\x + \edef\x{\noexpand\setkeys{rtFontStyle}{\rf@style}}\x + \ifx\rf@ul\@empty\else + \let\rt@ul\@empty\PackageWarning{richtext}{% + The ul key is not supported within\MessageBreak + \string\setDefaultStyle. Ignoring it}\fi + \ifx\rf@raise\@empty\else + \let\rt@raise\@empty\PackageWarning{richtext}{% + The raise key is not supported within\MessageBreak + \string\setDefaultStyle. Ignoring it}\fi + \ifx\rt@url\@empty\else\let\rf@url\@empty + \PackageWarning{richtext}{% + The url key is not supported within\MessageBreak + \string\setDefaultStyle. Ignoring it}\fi + \ifx\rf@font\@empty + \def\rf@font{font-family:Helvetica,sans-serif}\fi + \ifx\rf@size\@empty\def\rf@size{font-size:\rf@size@pt}\fi + \ifx\rf@color\@empty\def\rf@color{color:\rt@hashtag000000}\fi + \rt@csarg\xdef{#1-DS}{\rt@DSAttr}% +\endgroup} +\newcommand{\useDS}[1]{\@nameuse{#1-DS}} +\newif\ifrt@firsttok \rt@firsttoktrue +\newif\ifrt@itsskipline \rt@itsskiplinefalse +\def\rt@addtoRVV#1{% + \toks4={\useRV{#1}}\edef\rt@tmpRV{\the\toks0\the\toks4}% + \toks4={\useV{#1}}\edef\rt@tmpV{\the\toks2\the\toks4}% + \toks0=\expandafter{\rt@tmpRV}\toks2=\expandafter{\rt@tmpV}% +} +\def\rt@testifbgroup{\@ifnextchar\bgroup + {\let\rt@nultiargs=1\rt@gobbletonil} + {\let\rt@nultiargs=0\rt@gobbletonil}} +\newcommand{\setRVVContent}[2]{\begingroup + \rt@firsttoktrue \rt@itsskiplinefalse + \rt@testifbgroup#2\@nil + \def\contName{#1}\toks0={}\toks2={}\toks4={}% + \if\rt@nultiargs1\def\rt@next{\setRVVContent@i#2;}\else + \def\rt@next{\setRVVContent@i{#2};}\fi\rt@next} +\def\setRVVContent@i#1{\def\rt@argi{#1}% + \ifx\rt@argi\rt@SC + \rt@csarg\xdef{\contName-vcont}{\the\toks0}% + \rt@csarg\xdef{\contName-pcont}{\the\toks2}% + \let\rt@next\endgroup + \else + \expandafter\ifx\csname #1-ri\endcsname\relax + \PackageWarning{richtext} + {The name '#1' is not declared,\MessageBreak + will ignore it. Check the spelling}% + \def\rt@next{\setRVVContent@i}% + \else + \ifrt@firsttok\rt@firsttokfalse\else + \ifx\rt@argi\rt@skipline + \rt@itsskiplinetrue + \else + \ifrt@itsskipline + \rt@addtoRVV{br}\rt@itsskiplinefalse + \else + \rt@addtoRVV{par}% + \fi + \fi + \fi + \rt@addtoRVV{#1}% + \def\rt@next{\setRVVContent@i}% + \fi + \fi\rt@next +} +\def\useRVContent#1{\@nameuse{#1-vcont}} +\def\useVContent#1{\@nameuse{#1-pcont}} +\endinput +%% +%% End of file `richtext.sty'. diff --git a/texmf-dist/tex/latex/yt4pdf/yt4pdf.cfg b/texmf-dist/tex/latex/yt4pdf/yt4pdf.cfg new file mode 100644 index 00000000..7a8e5de8 --- /dev/null +++ b/texmf-dist/tex/latex/yt4pdf/yt4pdf.cfg @@ -0,0 +1,10 @@ +% +% yt4pdf config file. Delete the \endinput below and replace the path +% provided with the path to the swf folder of your yt4pdf installation. This +% path is used to locate the pdf_tube_basic.swf file, used to play YouTube +% videos. +% +\endinput +\renewcommand{\ytFolder}{C:/Users/Public/Documents/My TeX Files/% +tex/latex/aeb/aebpro/yt4pdf/swf} +\endinput diff --git a/texmf-dist/tex/latex/yt4pdf/yt4pdf.sty b/texmf-dist/tex/latex/yt4pdf/yt4pdf.sty new file mode 100644 index 00000000..7aef683a --- /dev/null +++ b/texmf-dist/tex/latex/yt4pdf/yt4pdf.sty @@ -0,0 +1,346 @@ +%% +%% This is file `yt4pdf.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% yt4pdf.dtx (with options: `copyright,package') +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% yt4pdf.sty package, %% +%% Copyright (C) 2010--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. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\NeedsTeXFormat{LaTeX2e}[1997/12/01] +\ProvidesPackage{yt4pdf} + [2016/10/04 v1.1 yt4pdf: Play You Tube videos in PDF, Acrobat Distiller only (dps)] +\RequirePackage{xkeyval} +\ProcessOptions +\RequirePackage{rmannot} +\RequirePackage{popupmenu}[2010/09/18] +\newcommand{\ytFolder}{C:/Users/Public/Documents/My TeX Files/% +tex/latex/aeb/aebpro/yt4pdf/swf} +\saveNamedPath{ytSWF}{\ytFolder/pdf_tube_basic.swf} +\InputIfFileExists{yt4pdf.cfg}{}{} +\def\yt@namegdef#1{\expandafter\gdef\csname #1\endcsname} +\def\yt@namexdef#1{\expandafter\xdef\csname #1\endcsname} +\def\thisNamedRMA(#1){this.getAnnotRichMedia(this.pageNum,"#1")} +\define@key{ytRmAnnot}{play}[]{\def\ytrmannot@play{#1}} +\define@key{ytRmAnnot}{load}[]{\def\ytrmannot@load{#1}} +\setkeys{ytRmAnnot}{play,load} +\let\ytCurrRMAName\@empty +\newcommand{\ytRmAnnot}[4][]{\begingroup + \@ifundefined{#2@ytrmname}{\yt@namegdef{#2@ytrmname}{#1}}% + {\PackageError{yt2pdf}{The name `#2' is already defined + for\MessageBreak this \string\ytRmAnnot}{Choose a unique + name for this \string\ytRmAnnot, one different from `#2'.}}% + \setkeys*{ytRmAnnot}{#1}\gdef\ytCurrRMAName{#2}% + \ifx\ytrmannot@play\@empty\else + \makebox[0pt][l]{\pushButton[\BC{}\BG{}\S{S} + \AA{\AAPageOpen{aebStartPlayer(\thisNamedRMA(#2),% + "\ytrmannot@play",true);}\AAPageClose{aebCancelWait(false);}} + ]{btnRmAnnot#2}{1bp}{1bp}}\let\ytrmannot@load\@empty\fi + \ifx\ytrmannot@load\@empty + \else\makebox[0pt][l]{\pushButton[\BC{}\BG{}\S{S} + \AA{\AAPageOpen{aebStartPlayer(\thisNamedRMA(#2),% + "\ytrmannot@load",false);}\AAPageClose{aebCancelWait(false);}} + ]{btnRmAnnot#2}{1bp}{1bp}}\fi + \rmAnnot[\XKV@rm,name=#2,enabled=onclick]{#3}{#4}{ytSWF}% + \endgroup +} +\newcommand{\DeclareYTName}[2][]{\def\argi{#1}% + \ifx\argi\@empty\gdef\ytCurrRMAName{#2}\else + \gdef\ytCurrRMAName{[#1]#2}\fi +} +\newcommand{\ytBtnPresets}[1]{\def\yt@Presets{#1}} +\ytBtnPresets{\BC{.5 0 0}\S{S}\textFont{HeBo}\autoCenter{n}} +\newcommand{\oyt@RMA}[1][this.pageNum]{\oyt@@RMA[#1]} +\def\oyt@@RMA[#1]#2\@nil{\gdef\yt@CurrRMAName{#2}% + \def\yt@rm{this.getAnnotRichMedia(#1,"#2")}} +\newcommand{\ytPlayToggle}[3][]{% + \expandafter\oyt@RMA\ytCurrRMAName\@nil% + \pushButton[\CA{\ytStrPAUSE}\presets{\yt@Presets}#1 + \A{\JS{ytPlayToggle(\yt@rm);}}]{playToggle}{#2}{#3}% +} +\newcommand{\ytStopLoading}[3][]{% + \expandafter\oyt@RMA\ytCurrRMAName\@nil% + \pushButton[\CA{\ytStrStopLoading}\presets{\yt@Presets}#1 + \A{\JS{\yt@rm.callAS("stopVideo");}}]{vidStop}{#2}{#3}% +} +\newcommand{\ytMuteToggle}[3][]{% + \expandafter\oyt@RMA\ytCurrRMAName\@nil% + \pushButton[\CA{\ytStrMUTE}\presets{\yt@Presets}#1 + \A{\JS{ytMuteToggle(\yt@rm);}}]{muteToggle}{#2}{#3}% +} +\newcommand{\ytRewind}[3][]{% + \expandafter\oyt@RMA\ytCurrRMAName\@nil% + \pushButton[\CA{\ytStrREWIND}\presets{\yt@Presets}#1 + \A{\JS{ytRewind(\yt@rm);}}]{ytRewind}{#2}{#3}% +} +\newcommand{\ytSelect}[4][]{% + \expandafter\oyt@RMA\ytCurrRMAName\@nil% + \pushButton[\CA{\ytStrLoadVideo}\presets{\yt@Presets}#1 + \A{\JS{ytSelect(\yt@rm,"#2");}}]{selectVid}{#3}{#4}% +} +\newcommand{\ytOpenWeb}[3][]{% + \expandafter\oyt@RMA\ytCurrRMAName\@nil% + \pushButton[\CA{\ytStrWatchOnWeb}\presets{\yt@Presets}#1 + \A{\JS{ytOpenWeb(\yt@rm);}}]{playOnWeb}{#2}{#3}% +} +\newcommand{\ytvIdPresets}[1]{\def\yt@vIdPresets{#1}} +\ytvIdPresets{\linktxtcolor{webbrown}} +\newcommand{\ytvId}{\@ifstar{\def\yt@lnk@play{false}\yt@@vId} + {\def\yt@lnk@play{true}\yt@@vId}} +\newcommand{\yt@@vId}[3][\ytCurrRMAName]{% + \oyt@RMA#1\@nil\setLink[\presets{\yt@vIdPresets} + \A{\JS{aebStartPlayer(\yt@rm,"#2",\yt@lnk@play);}}]{#3}} +\newcommand{\ytComboListPresets}[1]{\def\yt@ComboListPresets{#1}} +\newcommand{\ytComboBtnPresets}[1]{\def\yt@ComboBtnPresets{#1}} +\let\yt@ComboListPresets\@empty +\let\yt@ComboBtnPresets\@empty +\newcommand{\ytPlayList}{\begingroup\@makeother\_\@makeother\' + \ytPlayList@i} +\def\ytPlayList@i#1#2{\gdef\yt@pl@def{#1}\xdef\yt@pl@pl{#2}\endgroup} +\newcommand{\declarePlayList}{\bgroup + \@makeother\_\@makeother\- + \yt@declarePlayList} +\def\yt@declarePlayList#1#2{% + \gdef#1{#2}\egroup} +\newcommand{\ytIdTitle}[2]{[(#2)(#1)]} +\newcount\ytListCnt \ytListCnt=0 +\newcommand{\ytNewBaseName}[1][]{% + \def\yt@argi{#1}\ifx\yt@argi\@empty\global\advance\ytListCnt1\relax + \gdef\yt@BaseName{\yt@CurrRMAName\the\ytListCnt}\else + \gdef\yt@BaseName{\yt@CurrRMAName#1}\fi +} +\newcommand{\ytResetBaseName}{\gdef\yt@BaseName{\yt@CurrRMAName}} +\ytResetBaseName +\newcommand{\ytComboList}[3][]{% + \expandafter\oyt@RMA\ytCurrRMAName\@nil% + \comboBox[\DV{\yt@pl@def}\V{\yt@pl@def} + \presets{\yt@ComboListPresets}#1]{ytSelect\yt@BaseName} + {#2}{#3}{\yt@pl@pl}% +} +\newcommand{\ytComboBtn}[3][]{% + \expandafter\oyt@RMA\ytCurrRMAName\@nil% + \pushButton[\CA{\ytStrPLAY}\presets{\yt@ComboBtnPresets}#1 + \A{\JS{var f=this.getField("ytSelect\yt@BaseName");\r + aebStartPlayer(\yt@rm,f.value,!event.shift); + }}]{ytSelectBtn\yt@BaseName}{#2}{#3}% +} +\newcommand{\ytPopupMenuData}[1]{{\toks0={// yt4pdf: Begin popup menu data^^J}% + \@tfor\yt@menu:=#1\do{% + \toks2=\expandafter{\yt@menu}% + \edef\@tmp@exp{\the\toks0\the\toks2^^J}% + \toks0=\expandafter{\@tmp@exp}% + }\xdef\ytPopupData{\the\toks0// End of popup menu data}% +}} +\def\ytPopupData{// No popup menu data defined}% +\newcommand{\puIdTitle}[2]{\item{title={#1},return={[\itemindex,'#2']}}} +\newcommand{\ytStrPLAY}{PLAY} +\newcommand{\ytStrREPLAY}{REPLAY} +\newcommand{\ytStrPAUSE}{PAUSE} +\newcommand{\ytStrBuffering}{Buffering...} +\newcommand{\ytStrStopLoading}{Stop Loading} +\newcommand{\ytStrMUTE}{MUTE} +\newcommand{\ytStrUNMUTE}{UNMUTE} +\newcommand{\ytStrREWIND}{REWIND} +\newcommand{\ytStrLoadVideo}{Load Video} +\newcommand{\ytStrWatchOnWeb}{Watch on YouTube} +\newcommand{\ytRespQues}{Enter the YouTube Video ID} +\newcommand{\ytRespTitle}{Load a Video} +\newcommand{\ytRespLabel}{ID:} +\newcommand{\ytStrErrorVideoNotFound}{Error: Video not found} +\newcommand{\ytStrErrorNoEmbed}{Error: This video does not allow + embedded playback \r\r Would you like to view this video + on the web?} +\newcommand{\ytStrConnecTimedOut}{Connection timed out, try again.} +\begin{insDLJS*}[ytPlayToggle]{yt} +\begin{newsegment}{yt4PDF: YouTube for PDF JavaScript} +/* + Document-level script for YouTube player + Document-level script for the PDFtube embedded YouTube player + *************************************************************** + Functions to be called by buttons or links on the PDF + in each case, "rm" is the RichMedia annot containing the player + All these are optional and can be renamed or edited as required + *********************************************************** +*/ +// toggle play/pause (button labels updated by event functions) +function ytPlayToggle(rm) { + var ps = rm.callAS("getPlayerState"); + rm.callAS((ps == 1)? "pauseVideo" : "playVideo"); +} +// toggle mute (have to update button labels ourselves) +function ytMuteToggle(rm) { + var im = rm.callAS("isMuted"); + if (im) { + event.target.buttonSetCaption("\ytStrMUTE"); + rm.callAS("unMute"); + } else { + event.target.buttonSetCaption("\ytStrUNMUTE"); + rm.callAS("mute"); + } +} +// Ask the user for the ID number of a new video, and play it +function ytSelect(rm,vID) { + var rsp = app.response({ + cQuestion: "\ytRespQues", + cTitle: "\ytRespTitle", + cDefault: vID, + cLabel: "\ytRespLabel"}); + if (rsp !=null && rsp != "") + aebStartPlayer(rm,rsp,true); // dps +} +// open the video's YouTube page in the web browser +function ytOpenWeb(rm) { + var link = rm.callAS("getVideoUrl"); + if (link != null) { + app.launchURL(link,true); + rm.activated = false; + } +} +// rewind (seek to zero) +function ytRewind(rm) { rm.callAS("seekTo",0); } +/* + ************************************************************ + Functions called by the player itself, in response to events + as the events are "external", the annot is not the target. + These functions must exist and match the names in the SWF. + *********************************************************** +*/ +function ytPlayerReady() { + + // this is the place to load your default video - for example... + console.println(" Player loaded and ready"); + // this.getAnnotsRichMedia(this.pageNum)[0].callAS("loadVideoById", + // "eNzrn8-JFSE",0); + aebStartPlayer.isPlayerReady=true; // dps +} +function ytStateChange(st) { + // Possible values are unstarted (-1), ended (0), playing (1), + // paused (2), buffering (3), video cued (5) + var lbl = ""; + console.println(" State changed to " + st); + if (st == 0) lbl = "\ytStrREPLAY"; + else if (st == 1) lbl = "\ytStrPAUSE"; + else if (st == 3) lbl = "\ytStrBuffering"; + else if (st == 2 || st == 5) lbl = "\ytStrPLAY"; + if (lbl) this.getField("playToggle").buttonSetCaption(lbl); +} +function ytPlaybackQualityChange(str) { + // Possible values are "small", "medium", "large" and "hd720" + console.println(" Quality changed to " + str); +} +function ytProgress(q) { + // q has four properties that you can use to update form fields, + // such as... + //this.getField("currentTime").value = q.CurrentTime; + //this.getField("Duration").value = q.Duration; + //this.getField("BytesLoaded").value = q.BytesLoaded; + //this.getField("BytesTotal").value = q.BytesTotal; +} +function ytError(err) { + // Video cannot be played + console.println(" ERROR code " + err + " received"); + if (err == 100) + app.alert("\ytStrErrorVideoNotFound", 0, 0, "YouTube"); + else { + var resp=app.alert("\ytStrErrorNoEmbed", 1, 3, "YouTube"); + if (resp==4) { + aebCancelWait(false); + ytOpenWeb(aebStartPlayer.annot); + } + } +} +/* + We start the player if the annot is activated, if not, + we set annot.activated=true, and wait for the widget to say it + is ready. When ready, ytPlayerReady() sets + aebStartPlayer.isPlayerReady=true +*/ +function aebStartPlayer(rm,Id,bPlay) { + aebStartPlayer.annot=rm; + if (aebStartPlayer.annot.activated) + aebStartPlayer.annot.callAS(% +(bPlay)?"loadVideoById":"cueVideoById",Id,0); + else { + aebCancelWait(false); + aebStartPlayer.annot.activated=true; + aebStartPlayer.isPlayerReady=false; + aebStartPlayer.twait=app.setInterval(% +'aebWait4Ready(\"'+Id+'\",'+bPlay+');',250); + aebStartPlayer.to=app.setTimeOut("aebCancelWait(true)", 10000); + } +} +aebStartPlayer.isPlayerReady=false; +aebStartPlayer.twait=null; +aebStartPlayer.to=null; +/* + If the player is ready, we start the video, and clear + the setInterval, otherwise, we wait. +*/ +function aebWait4Ready(Id,bPlay) { + if (aebStartPlayer.isPlayerReady) { + aebCancelWait(false); + aebStartPlayer.annot.callAS(% +(bPlay)?"loadVideoById":"cueVideoById",Id,0); + } +} +function aebCancelWait(bNotify) { + var twait=aebStartPlayer.twait; + if (aebStartPlayer.to!=null) + try { app.clearTimeOut(aebStartPlayer.to); } catch(e) {}; + aebStartPlayer.to=null; + if (aebStartPlayer.twait!=null) + try { app.clearInterval(aebStartPlayer.twait); } catch(e) {} + aebStartPlayer.twait=null; + if ( bNotify && twait!=null ) app.alert("\ytStrConnecTimedOut"); +} +\end{newsegment} +\begin{newsegment}{Popup Menu Data and JS} +\ytPopupData +var aChoice; +function ytProcessMenu(aMenu) { + var cChoice = \popUpMenu(aMenu); + if ( cChoice != null ) { + aChoice=eval(cChoice); + if (aChoice[1]=="") return null; + var thisChoice=aChoice[0]; + if (ytProcessMenu.nChoice==undefined) { + ytProcessMenu.nChoice=thisChoice; + eval("aMenu"+ytProcessMenu.nChoice).bMarked=true; + } else { + eval("aMenu"+ytProcessMenu.nChoice).bMarked=false; + var oldnChoice=ytProcessMenu.nChoice; + ytProcessMenu.nChoice=thisChoice; + eval("aMenu"+ytProcessMenu.nChoice).bMarked=(oldnChoice==ytProcessMenu.nChoice)?false:true; + } + return aChoice; + } else return null; +} +function ytPopupMenu(rmaName,ytmenu) { + var aChoice=ytProcessMenu(ytmenu); + var rm=this.getAnnotRichMedia(this.pageNum,rmaName); + if (aChoice!=null) { + if (ytProcessMenu.lastDescrip==undefined) { + aebStartPlayer(rm,aChoice[1],!event.shift); + } else { + if (ytProcessMenu.lastDescrip!=aChoice[1]) { + aebStartPlayer(rm,aChoice[1],!event.shift); + } + } + ytProcessMenu.lastDescrip=aChoice[1]; + } +} +\end{newsegment} +\end{insDLJS*} +\endinput +%% +%% End of file `yt4pdf.sty'. -- cgit v1.2.3