The Acrotex Education Bundle: Acrotex Software Development Team
The Acrotex Education Bundle: Acrotex Software Development Team
D. P. Story
© 1999-2007 [email protected]
Prepared: May 10, 2007 Version 6.05
Table of Contents
Preface 7
1 Introduction 7
1.1 A Brief History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 Thanks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2 Getting Started 8
2.1 Unpacking the AcroTEX Bundle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
• Language Localizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
• Installing aeb.js . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 Sample Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3 Package Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.4 LATEXing Your First File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
• For pdftex and dvipdfm Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
• For Distiller Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
6 Hyperref Options 15
7 Running Headers 16
9 Template Options 22
9.1 The usetemplates Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
9.2 The leftpanel and rightpanel Options . . . . . . . . . . . . . . . . . . . . . . 22
10 Navigational Aids 22
10.1 A Navigational Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
10.2 \newNaviIcon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
10.3 Direction Icons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
10.4 \panelNaviGroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
26 List of Options 95
What’s New 98
• Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
• Exerquiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
• insdljs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
• dljslib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
References 103
7
Preface
1. Introduction
The AcroTEX eDucation Bundle, read “AcroTEX Education Bundle”, is a collection of LATEX macro files,
along with various support files and sample files. The overall theme of this bundle is ePublication
in the education sector using LATEX as the authoring application and Adobe’s Portable Document
Format (pdf) as the file format of the output document.
Currently, there are three components to the bundle, with others planned:
1. The web package is used to create an attractive, easy-on-the-eye page layout suitable for the
www (or classroom/conference presentations).
2. The exerquiz package makes it very easy to create interactive exercises and quizzes.
3. The eforms package provides support for PDF form fields.
4. The insdljs package allows for the automatic insertion of document level JavaScript. Docu-
ment authors can use insdljs to customize the processing of the exerquiz quizzes. See the
documentation that accompanies the package (insdljs.dtx) and see also the sample file
jqzspec.tex for an extensive example of how to modify the exerquiz macros. The insdljs
package also has an execJS environment which can be used to create executable and “dis-
cardable” JavaScript; see the .dtx file for details, and the demo file execJStst.tex, which
features an animation built completely from LATEX source lines.
5. The dljslib package is used as a library of JavaScript functions. Some types of question require
special processing. A JavaScript function written to process a particular function can be
stored in the library, then retrieved as needed. See the documentation contained in the file
dljslib.dtx, and try the test file for this package, jslib_ex.tex.
6. The eqExam Package is a stand alone LATEX package for creating exams, quizzes, homework
assignments. It can also be used to create surveys, questionnaires, teacher evaluations, etc.
The package has an email mode and comes with a server-side script that is used to send the
data entered into the form fields to the instructor. See my TEX/LATEX Survey for a demo of this
feature.
The AcroTEX Bundle should be useful to educators who want to post interactive materials for their
students on the www.
Here is an important point that should be emphasized early in this manual. AcroTEX only
supports three ways of producing a pdf document: (1) the Adobe Acrobat Distiller (version 5.0
or higher required ); (2) pdftex; or (3) dvipdfm. In the case of (1), you probably use dvips to
create a postscript file before distilling. Some users have tried to use GhostScript to produce a
pdf document from AcroTEX; this will not work! (You will get the pdf document but not much
functionality.)
Please contact me at [email protected] should you encounter any problems, or have
suggestions to make.
See ‘Getting Started’ on page 8 for instructions on how to get up and running.
The workshop forced me to take many of the basic macros that I had developed in plain TEX and
convert them to LATEX.
Significant additions to the exerquiz were made immediately following the 20th Annual
Conference of the TEX User’s Group (tug), in August, 1999, Vancouver, British Columbia, which I
attended.
The insdljs package was written for the 22nd Annual Conference of the TEX User’s Group (tug),
in August 2001, at the University of Delaware, Newark, Delaware.
The execJS environment was created as a result of some work I did for the Seybold SF
Convention, 2002 (see article at planetPDF); the techniques were first presented to the PDF
public at this convention. My complete presentation from that conference is again available from
planetPDF.
1.2. Thanks
Noel Vaillant, www.probability.net, deserves my thanks for his enthusiasm for the web style
file and his initial work on it inspired me to make a serious effort at writing a LATEX package.
Thanks also goes out to Jean-Michel Sarlat for writing a French version of the web and exerquiz
packages. See his Syracuse Web site. He urged me to include a language option. Thanks also goes
to Michael Wiedmann who suggested a language option many months earlier, but I’m afraid it
landed on deaf ears at the time. These two provided the translations for the french and german
options. (January 1, 2000)
My thanks to Heiko Oberdiek, who took a close look at insdljs. He made several suggestions,
and urged me to make some significant improvements to this package.
2. Getting Started
There has been a new package added to the AcroTEX Bundle, the insdljs package. This package
allows the document or package author to write JavaScripts to the document level JavaScript
section of a PDF document. Exerquiz now uses insdljs to place its JavaScripts into the PDF
document.
The LATEX package files for AcroTEX Bundle consist of web.dtx, web.ins, exerquiz.dtx and
the installation files for each of these packages. Additionally, acrotex.ins installs the whole
distribution.
1. Place all these files in the same directory. This directory must be in the search path of your
LATEX system, perhaps in a separate folder called acrotex.
2. The whole bundle can be unpacked by latexing acrotex.ins. (The other *.ins files are
the installation files for the individual packages, acrotex.ins is the combined installation
file.)
MiKTeX users should not forget to refresh the file name database.
Important: See the next section, Unpacking the AcroTEX Bundle for information on unpacking
the bundle.
3. Place the sample files either in the same folder as the AcroTEX program files, or in another
folder of your choosing. See the section titled ‘Sample Files’ on page 9 for more details on
these.
Getting Started 9
After reading the manual you are then ready to write your own set of tutorials, exams, exercises
and quizzes. DP S
• Language Localizations
In acrotex.ins, the language localizations have been commented out. Just uncomment the
language you intend to use.
Also in the exerquiz.ins file is the line
% \file{template.def}{\from{exerquiz.dtx}{copyright,template}}
Uncomment this line to get the template file, used for developing language localizations.
• Installing aeb.js
The JavaScript file aeb.js is only needed if you use Acrobat Pro 8.1 or later. Increased security in
that version has made it necessary to install a folder JavaScript file. aeb.js raises the “trust” of
certain JS methods used to import document JavaScript into the document just after installation.
The installation of this file is not needed if you use pdftex or dvipdfm, or use a version of Acrobat
prior to 8.1.
Start Acrobat Pro 8.11 or later, and open the console window Advanced > JavaScript >
Debugger (Ctrl+J). Copy and paste the following code into the window.
app.getPath("user","javascript");
Now, this the mouse cursor on the line containing this script, press the Ctrl+Enter key. This
will execute this JavaScript. This JavaScript method returns the path to where aeb.js should be
placed. For example, on my system, the return string is
/C/Documents and Settings/story/
Application Data/Adobe/Acrobat/7.0/JavaScripts
Follow the path to this folder. If the JavaScripts folder does not exist, create it. Finally, copy
aeb.js into this folder. Close Acrobat, then start it again and look under the Tools menu to
verify the presence of the sub-menu AcroTEX Presentation Bundle.
b There are numerous sample/demo files that illustrate various features of the AcroTEX Bundle. View
the pdf document indexofex.pdf, which is an “Index of AcroTEX Examples”. This document
contains a list of all examples, a short description of each, and links to the pdf document and
source file.
1The file will cause no harm if you install it in an earlier version of Acrobat, as early as version 7.
Getting Started 10
\documentclass{article}
\usepackage{amsmath}
\usepackage[dvipdfm,tight,designi]{web}
\usepackage{exerquiz}
For the pdftex application, you simply call pdflatex, and you have your nice pdf document,
ready for review. The insertion of the document level JavaScript is automatic.
For dvipdfm, you LATEX the document, then hit it with dvipdfm, and your ready to review your
pdf document.
\documentclass{article}
\usepackage{amsmath}
\usepackage[dvips,tight,designi]{web}
\usepackage{exerquiz}
When you LATEX the source file you create a .dvi file, and one or more .fdf files. The .fdf files
(e.g., exerquiz.fdf) contain the document level JavaScript that needs to be imported into
your document.
You then convert your .dvi to .ps using either dvips or dvipsone, and distill. Important:
When you distill, save the .pdf back to the same folder in which your source file (.tex) resides
as this is where the .fdf files reside too. Insertion of document level JavaScripts automatically
takes place when you open your newly distilled document in the Acrobat application. (It is
actually Acrobat that imports the scripts, not the Distiller.)
☛ When your document is opened in Acrobat for the first time, the JavaScript contained in the
.fdf files (e.g., exerquiz.fdf) is imported into the document and is stored at the document
level.
Important: Save your document. When you save, the JavaScripts you just imported are also
saved with the document. At this point you can move your pdf to another folder, or to the web.
The document does not need the .fdf files any more.
For distiller users, the AcroTEX eDucation Bundle has many exciting features—the insdljs
and dljslib Packages—whose functionality requires the document author use Acrobat 5.0 or
higher.
12
3.1. Overview
The web package redefines \maketitle and \tableofcontents in a more web friendly way;
it colors the section headings, and inserts \bullets (•) at the \subsubsection level. This, to
my eyes, is very attractive. Additionally, certain navigation devices—a navigation bar and some
direction icons—are included in the package.
There are options for a small collection of drivers: dvipsone, dvips. dvipdfm and pdftex.
The language option redefines certain language dependent elements of the package to other
languages. Currently, the following options are supported: dutch, french, german, italian,
norsk, russian spanish, dansk, polish, finnish, czech, catalan, and brazil. There
is even an option for reformatting the web style to a print format!
The capabilities of the web package and its options are discussed below. Any comments and
suggested improvements (new features) would be greatly appreciated.
\usepackage[<driver_option>,<other_options>]{web}
Basic Package Options 13
Replace <other_options> with any of the options recognized by web; see Section 26 for a
complete list of options. The first and optional argument <driver_option> above defines the
driver to be used; for example,
\usepackage[dvipsone]{web}
Currently, the web package supports five drivers: dvipsone, the dvi-to-ps converter by Y&Y, Inc.,;
dvips, the freeware dvi-to-ps converter; pdftex, the tex-to-pdf application; and dvipdfm,
the dvi-to-pdf application by Mark Wicks, (http://odo.kettering.edu/dvipdfm/); and
the commercial TEX system for the Mac, textures and TEXshop.
The package has been tested using \documentclass{article} and it is strongly recom-
mended that this class be used; however, Web does support the book class as well.
\usepackage[<driver_option>,tight,<other_options>]{web}
This screen version of this manual was typeset with the tight option, the print version was
typeset without it.
The <width> and <height> parameters are the desired screen size of the page. The screen
version of this manual uses
\screensize{3.72in}{4.67in}
The other command, \margins, which determines the desired margins, takes four length pa-
rameters:
\margins[<panel_width>]{<left>}{<right>}{<top>}{<bottom>}
The values of \textheight and \textwidth are computed based on the screen size and the
margins. The margin settings for this document are given below:
\margins{.25in}{.25in}{30pt}{.25in}
The optional first parameter <panel_width> is used to set the width of the panel, if there is
one. The default is 1in.
An important comment about the third parameter <top> is the following: as with pdfscreen,
we put \@Topmargin=<top>. The running header fits within the top margin (this varies from
standard LATEX practice). The web package dimension \web@Topmargin is the distance from the
top of the screen down to the top of the running header. Thus,
15
Also, \web@Topmargin can be used to adjust the positioning of a running header, which is
specified in the \margins command. The default value of \headheight is 8pt, so the value
of \headsep is determined by the above equation. See the web.dtx file for more details.
\usepackage[designi,pdftex]{web}
6. Hyperref Options
The web package loads hyperref into the document and sets some selected options of that
package; therefore, including the hyperref package is not needed in the preamble of your own
document.
Any additional hyperref options that are needed can be introduced into the package using
hyperref’s \hypersetup macro, for example,
\documentclass{article}
\usepackage[dvipsone]{web} % or dvips or pdftex
Documentation of the options that hyperref recognizes can be had by either LATEXing the file
hyperref.dtx, or by getting a copy of the The LATEX Web Companion [5] by Michel Goossens
et al.
7. Running Headers
Beginning with version 3.3 of Web, there are convenience commands setting the running
headers and footers; they are \lheader, \cheader, \rheader, \lfooter, \cfooter, and
\rfooter. Each of these takes a single argument, which is the text for the header or footer in the
position desired. In the standard setup for Web, \lheader, \rheader and \cfooter are used
for, respectively, the current section title, the current page and the navigation bar (if activated).
On occasion you may want to have no running headers at all, this can be accomplished by say-
ing in the preamble, or anywhere, \lheader{}, \cheader{}, and/or \rheader{}. Another
solution is to use the commands \clearHeaders and \restoreHeaders. The command
\clearHeaders first saves the current definitions of the headers then sets the headers to the
empty header. The command \restoreHeaders restores the definitions that were in effect
when the last \clearHeaders was executed.
\universityColor{blue}
\titleColor{black}
\authorColor{black}
For more information on defining named colors, see the documentation of the color or xcolor
packages. A simple example would be
\definecolor{MyOwnColor}{rgb}{0.945,0.87,0.518}
When the pro option is in effect, most all colors can be specified through the \selectColors
command, see ‘Selecting Colors’ on page 38.
• Title Top: The content of the top is determined by the \topTitlePage command. (This
command can be redefined, but it is not recommended.) The \topTitlePage com-
mand expands to three elements: the university (affiliation), the title, and the author(s), in
that order vertically. These are the values of the commands \university, \title and
\author discussed in the previous section.
• Title Middle: The \optionalPageMatter command is used to enter content into this
part of the title page. This middle part is optional; if the \optionalPageMatter com-
mand does not appear in the preamble, then this part of the title page is empty. Here is an
example of usage:
\optionalPageMatter{\vfill
\begin{center}
\fcolorbox{blue}{webyellow}{
\begin{minipage}{.67\linewidth}
\noindent\textcolor{red}{\textbf{Abstract:}} This
file attempts to teach you how to create a simple
\LaTeX\ document.
\end{minipage}}
\end{center}}
The above definition will create the framed box seen below.
The \optionalPageMatter appears just below the \webauthor and above the direc-
tory listing if there is any.
• Title Bottom: Bottom of the title page is controlled by the contents of the command
\titlepageTrailer and consists of the values of the commands \email, \version,
copyrightyears Below is a rough figure depicting the location of the elements found
in the title page trailer.
<copyright notice> \thewebemail
<revision date> \webversion
The definition of these elements are as follows:
\def\maketitle@trailer@ul{\web@copyright\ \web@copyright@symbol\
\webcopyrightyears}
\def\maketitle@trailer@ll{\web@revision\ \@date}
\def\maketitle@trailer@ur{\thewebemail}
\def\maketitle@trailer@lr{\webversion}
The Title Page and TOC 19
\renewcommand\maketitle{...your design...}
\tocindent{20pt}
There is another relevant parameter, \widestNumber. The value of the argument of this com-
mand sets the amount of indentation for the subsection numbers. The default is
\widestNumber{0.0.}
This is a template for the subsection numbers, the default is a one digit section number and a one
digit subsection number. In the preamble of this document, I’ve set \widestNumber{0.00.},
since some subsection numbers have two digits.
The color of the heading of the table of contents is set through
\tocColor{<named_color>}
Specifying a color through this command at any time before the creation of the table of
contents will change the color of the heading. The default is blue.
If you prefer the standard LATEX, the latextoc option can be used.
8.5. The nodirectory Option
The inclusion of \tableofcontents is optional. The article you write may be short, or perhaps
it may just be a collection of exercises and quizzes. In this case, you may not want a table of
contents.
If you do not want a table of contents, you would not include \tableofcontents just after
\begin{document}. Without a table of contents, you may as well turn off the directory listing
on the cover page as well. Use the nodirectory option to do this:
\usepackage[latextoc]{web}
Should you want to go with this option, you might consider including
\hypersetup{linktocpage}
Look at the table of contents with and without this hyperref option to decide which you prefer.
\makeinlinetitle
The command, which can be redefined to your needs, has the following design:
\webtitle
\webuniversity \webauthor \webemail
date \webversion
The table above extends the entire \linewidth, just as the expansion of \makeinlinetitle
does. The values of \webtitle, \webuniversity, \webauthor, \webmail and \webver-
sion are populated by their command counterparts, see Table 1, page 20. The date, as appears
in the lower left row, will expand to the current date, or the value specified by the \date
command.
Below are notes in the case the pro option is in effect:
• If the value of the prepared key is not specified, then date is the current date, otherwise,
date is the one specified as the value of the prepared key.
• If the value of the talksite key is not specified, then \webversion is used. If talksite
is specified, the value of this key is used instead of \webversion.
3 Short documents such as white papers, homework assignments, for example.
22
9. Template Options
The Web Package has three options (and supporting commands) for creating colored back-
grounds, graphics backgrounds, and various overlays.
\usepackage[<driver_option>,navibar]{web}
The result is the navigation bar you see at the bottom of the page.
The toolbar can be turned on or off by the following commands: \NaviBarOn and \Navi-
BarOff. The navigational toolbar at the bottom of the page was generated by the \NaviBarOn.
\NaviBarOff was placed on the next page to turn off the bar. The exact code used on this page
is
\NaviBarOn\AddToShipoutPicture*{\NaviBarOff}
The colors for the navigation bar can be set through the commands \navibarTextColor
and \navibarBgColor. Each take a single argument, a named color. The default colors are
webblue and webgray, respectively.
10.2. \newNaviIcon
The \newNaviIcon can be used to define a navigational icon. The action of the icon can be
to execute a menu item, perform a hyper-jump, or execute the JavaScript code. It takes six
parameters:
Parameters
#1 = m, j, or l
#2 = command name of the new navigational icon
#3 = width of icon
#4 = height of icon
#5 = text to appear in the center of the icon.
#6 = if m: named menu action, e.g., NextPage, PrevPage, etc.
if j: execute JavaScript
if l: \hyperlink{arg} or \href{arg}
Once the \newNaviIcon command is executed, a new icon is defined. The name of this new
icon is the value of parameter #2.
Example:
\newNaviIcon[m]{\myNext}{34pt}{10pt}{Next}{NextPage}
\newNaviIcon[j]{\jsWarning}{34pt}{10pt}{Hi}{app.alert("Hi there")}
\newNaviIcon[l]{\linkJump}{34pt}{10pt}{Go}{\hyperlink{page.1}}
\insertnaviiconhere{\ArrowUp{\hyperlink{webtoc}}}
\insertnaviiconhere{\ArrowUp{link_command}}
\insertnaviiconhere{\ArrowDown{link_command}}
\insertnaviiconhereafter{\ArrowUp{link_command}}
or
24
\insertnaviiconhereafter{\ArrowDown{link_command}}
To discontinue a running arrow icon type
\defaultpageheader
on the page you want the arrow(s) to disappear.
The colors of the direction icons by using the commands \directionIconTextColor and
\directionIconBgColor. Each command takes a named color as its argument; the default
values are webblue and webgray, respectively.
10.4. \panelNaviGroup
When the leftpanel or rightpanel options are chosen, a (navigational) panel is created. The
command \panelNaviGroup can be used to create the standard navigational panel.
See the sample file bgtest.tex for an example of usage.
\usepackage[<driver_opt>,<lang_opt>]{web}
Here, <lang_opt> is one of the following values: dutch, french, german, italian, norsk,
russian, spanish, polish finnish, czech, catalan and brazil.
The web and exerquiz packages seem to be compatible with the babel package; you can use
\documentclass{article}
\usepackage[french]{babel}
\usepackage[dvips,french]{web}
\usepackage{exerquiz}
subject to the usual restrictions on these language packages. (Don’t use characters declared
active by these languages within a \label, or as a field name for a quiz.
The translations for the french option is due to the tremendous efforts of Jean-Michel Sarlat,
and Michael Wiedmann did the translations for the german option.
Using the forpaper option with the latexlayout option will give you the standard LATEX
\textwidth.
The forpaper option also changes the \newpage command to \par\medskip at the end
of each solution—we don’t want to waste paper now, do we?
Finally, there is a boolean switch \ifeqforpaper, which you are free to use to refine the
look your forpaper version.
\prtscr{<print_text>}{<screen_text>}
\begin{forscreen}
....
....
....
\end{forscreen}
\begin{forpaper}
....
....
....
\end{forpaper}
\NewPage
\minPanelWidth{<length>}
Command Location: You can reset the minimal width by executing the command in the pream-
ble before the \screenwidth and \margins commands. Or, place it in the web.cfg.
\AddToTemplate{AEBLogoCenter}
\disableTemplate{AEBLogoCenter}
on any page. (Note: The effects of this command may be not be seen until the following page.)
Turn the template on by typing
\enableTemplate{AEBLogoCenter}
on any page.
For the panel region, there are commands for disabling (\disablePanelTemplate) and
enabling (\enablePanelTemplate) as well. Each of these takes a template_name as an argu-
ment.
There are a number of commands for clearing backgrounds and templates.
\ClearTextTemplate
\ClearPanelTemplate
\ClearBuildPanel
This command will clear the build panel as well as the graphics and field elements that lay on top
of the panel created by the \buildpanel command.
\ClearAllTemplates
\ClearTextTemplateBuffer
\ClearPanelTemplateBuffer
The commands will clear all overlays, including overlays created by \AddToTemplate and
\AddToPanelTemplate.
See the documentation file, web.dtx, for exact definitions of the commands in this section.
15.1. \DeclareDocInfo
The preamble of your document should contain a number of keys that identify the document,
including the title and author of the document. Some of this information is used to con-
struct the title page, some is placed in the pdf, to be displayed in the ‘Description’ tab of the
Document Properties dialog box, which is accessed through the Ctrl+D accelerator key, or
through the menu system File > Document Properties... (for version 8, this is File >
Properties...).
Information is passed through the \DeclareDocInfo command which takes a number of
key-value pairs. This is a simple xkeyval interface to many of the text macros that are defined in
Web.
\DeclareDocInfo{<key-value pairs>}
10. talkdateLabel: Text that precedes the date of the document. The default text for the
talkdate label is Presented:.
11. talksite: Site of the presentation. This field can be used for generally anything, for
example, you could specify your web site.
12. copyrightyears: Year(s) of the copyright of this publication, defaults to this year.
13. prepared: The date of preparation of the document, defaults to the day the file was
compiled (LATEXed). This was formerly the last revision date.
14. preparedLabel: The label that precedes the date prepared. The default is Prepared:.
The old default was Last Revision Date:, and will remain so if the pro option is not
taken.
15. copyrightStatus: If the aebxmp package is loaded for advanced metadata, this key
allows you to set the copyright status. Possible values True, False, or blank (no value,
or the key not listed at all) corresponding to Copyrighted, Public Domain and Unknown,
respectively. The values of this key are case sensitive, so you must enter True and False,
with the first letter capitalized. If aebxmp is not loaded, specifying this key does nothing.
16. copyrightNotice: If the aebxmp package is loaded for advanced metadata, this key
allows you to set copyright notice, short text describing the copyright, perhaps,
17. copyrightInfoURL: If the aebxmp package is loaded for advanced metadata, this key
allows you to set the copyright info url, a url to a page on the web containing a more
detailed description of the copyright. If aebxmp is not loaded, specifying this key does
nothing.
\DeclareDocInfo
{
title=My First Presentation,
author=D. P. Speaker,
university=My University,
[email protected],
talkdate={Dec.\ 17, \the\year},
talksite=The Talking University,
subject=On the Theory of AcroTeX,
keywords={LaTeX, PDF, AcroTeX},
copyrightStatus=False,
copyrightNotice={Copyright D. P. Story, \the\year},
copyrightInfoURL=http://www.acrotex.net
}
• The AeB logo is inserted using \optionalPageMatter. Normally, this macro does noth-
ing unless it is defined. In this example, we have
\optionalPageMatter
{%
\begin{center}
\begin{minipage}{.67\linewidth}
\centering\includegraphics[scale=.5]{AeB_Logo}
\end{minipage}
\end{center}
}
• Finally comes the \titlepageTrailer, a macro that can be redefined (see web.dtx for
its definition. This macro places the other elements at the bottom of the page:
– The copyright year and email address, as given by \email. The color of the email
address is set by urlColor through the command \selectColors. This color
actually sets the color of all external URLs.
– To the right, on the first line of the title page trailer is the value of \talksite. The
color is the default color for text.
– In the lower left is the date of the last revision of the document. The color is the default
color for text.
– In the lower right is the date the talk was given. The color is the default color for text.
Not shown in Figure 2 is the directory, which has been turned off by the nodirectory option
of Web.
My University
My First Document
D. P. Speaker
c 2007 [email protected]
The Talking University
Prepared: January 15, 2007 Presented: Dec. 17, 2007
The title page layout is, of course, defined by the standard \maketitle command, which has
been redefined by the pro option. In Web, the \maketitle has different behaviors, one for
screen and one for paper.
The pro Option 34
\universityLayout{<key-value_pairs>}
\titleLayout{<key-value_pairs>}
\authorLayout{<key-value_pairs>}
1. fontfamily: Font family to use with this element, permissible values are rmfamily,
sffamily, ttfamily.
2. fontseries: Font series to use, possible values are bfseries and mdseries.
3. fontshape: Font shape to use: upshape, itshape, scshape, slshape.
4. fontsize: Font size to use with this element, permissible values are tiny, scriptsize,
footnotesize, small, normalsize. large, Large, LARGE, huge, Huge.
5. halign: Alignment of this element within its enclosing \parbox, permissible values are l
(left aligned), c (centered), r (right aligned). See Example 2 for a visualization of the effects
of the halign key.
6. color: The color of the section title, this can be any named color. The default is blue for
title, and black otherwise.
7. special: Through this key, you can a specify predefined layout for the title elements. Per-
missible values are shadow, framebox, colorbox, fcolorbox, frameboxfit, color-
boxfit, fcolorboxfit, custom, default.
Custom titles can be created by specifying a value of custom. In this case, Web uses
\customUniversity, \customTitle and \customAuthor. These are macros that
take one argument, the code for designing the title. The title is referred to as #1. Depending
on how these custom titles are defined, the other keys may not be obeyed.
8. framecolor: The color of the frame surrounding the subject when the special key has
a value of framebox, fcolorbox frameboxfit or fcolorboxfit.
9. bgcolor: The background (fill color) of the box enclosing this element, when special
has a value of colorbox, fcolorbox, colorboxfit or fcolorboxfit.
The pro Option 35
10. shadowcolor: The color of the shadow, when special has a value of shadow.
11. beforeskip: The amount of skip before the title element.
12. afterskip: The amount of skip after the title element.
13. usefont: Through this key it is possible to specify an arbitrary font and font size. The key
takes five paramters, for example, usefont={OT1}{cmdh}{m}{n}{{16}{16pt}}. The
first four are the arguments of the LATEX’s \usefont, encoding, family, series and shape. The
last argument are the arguments of the LATEX’s \fontsize, size and baselineskip.
If the fifth parameter is empty, no font size is specified, the current default sizes are used.
14. hproportion: Each of the three elements (university, title, author) lie in their own
\parbox, the width of this box is determined by the value of this key, as a proportion
of the total \linewidth. The default for all three is .7. This value can be set to get more or
less “natural” line breaks, without having to insert a new line with a ‘\\’. See Example 2 for
a visualization of the effects of the hproportion key.
15. xhalign: The \parbox of each of the three elements are also placed in a \makebox, ad-
ditional control over positioning can be had by setting this key, which sets the positioning
parameter of \makebox. The default value for xhalign is c, the element is centered. See
Example 2 for a visualization of the effects of the xhalign key.
The demo file web_pro illustrates this command.
The file webpro_titlepg shows the structure of the title page.
Just above the Title Top is a skip that can be used to push the top down. The default value of
this skip is 0pt, but this can be changed through \aboveTopTitleSkip.
\aboveTopTitleSkip{<skip>}
There is one other title page parameter that effects the layout.
\topTitlePageProportion{<0..1>}
university
title
author
optionalpagematter
c 2005 email
talksite
Revision Date: November 8, 2005 Presented: talkdate
\topTitlePageProportion{.5}
\universityLayout{halign=l,color=red}
\titleLayout{halign=r,xhalign=r,hproportion=.4}
\authorLayout{color=webbrown}
In Figure 3, notice that the university is left aligned within its \parbox. For title, the
proportion is changed from the default of .7 to .4, this is manifested by the shorter gray box
(which represents the underlying \parbox); halign and xhalign are both set to r, so the title
appears right aligned within its \parbox, and the \parbox is right aligned within its \makebox,
understand? Finally, for the author key, we change only the color. Swave!
\DesignTitlePageTrailer{<key_values>}
1. ul: The text in the upper left corner of the trailer, the default is
\web@copyright\ \web@copyright@symbol\ \webcopyrightyears\ \thewebemail
2. ur: The text in the upper right corner of the trailer, the default is \aeb@talksite, as
defined by the \talksite command or the talksite key of the \DeclareDocInfo
command.
3. ll: The text in the lower left corner of the trailer, the default is \aeb@Prepared, as defined
by the \prepared command or the prepared key of the \DeclareDocInfo command.
The pro Option 37
4. lr: The text in the lower right corner of the trailer, the default value is \webversion, as
defined by the \version command, by the version key, or by the talkdate key. If
version and talkdate both have values, talkdate is used.
5. textColor: The default color of the text. The default is black.
6. bgColor: The background of the trailer. This is a named color. The default is there is no
color.
7. borderColor: The border color of the trailer. This is a named color. If specified, then
bgColor must have a named color too, otherwise, this key does nothing. The default is
that there is no border color.
8. fboxsep: The previous two keys use \colorbox and \fcolorbox. You can adjust the
parameters \fboxsep through this key. The default is 3pt.
9. fboxrule: The width of the rule created when there are values for bgColor and for
borderColor. This key sets the value of \fboxrule. The default is .4pt.
10. graphic: The value of this key is the base name of a graphic to be used as the background
of the trailer. The graphic is rescaled to the width and the height of the trailer. It also reduces
\linewidth so that the text is \fboxsep from the borders. The default is no graphic. If
the key graphic is specified, then bgColor and borderColor are ignored.
11. fontSize: Set the font size of the text, the default is \footnotesize. This key simply
redefines \trailerFontSize.
12. formatting: Any additional formatting you wish, such as formatting=\bfseries, or
anything that does not cause trouble.
The demo file web_pro illustrates this command.
15.3. The Table of Contents
The pro option also defines \tocLayout for controlling the title of the table of contents.
\tocLayout{<key-value_pairs>}
The key-value pairs are the same as layout commands for the section titles, see‘Section Headings’
on page 39.
Command Location: Place this command in the preamble.
\selectDings{<key-value_pairs>}
When the \noSectionNumbers command is used (‘Section Headings’ on page 39), the entries
in the table of contents have no section number. You can define a ding for each of the three levels
of the table of contents with this command. The key-value entries in the \selectTocDings
command are ignored if \noSectionNumbers is not in effect.
Command Location: Place this (optional) command in the preamble.
The pro Option 38
Key-Value Pairs: The following are the recognized key-value pairs for \selectTocDings
1. dDing: The ding for the first (section) level entry. An example is dDingToc=\ding{072}.
2. ddDing: The ding for the second (subsection) level entry.
3. dddDing: The ding for the third (subsubsection) level entry.
4. dDingColor: The (named) color for the ding of the first level entry. The default is red.
5. ddDingColor: The (named) color for the ding of the first level entry. The default is blue.
6. dddDingColor: The (named) color for the ding of the first level entry. The default is
webgreen.
The demo file web_pro illustrates this command.
15.4. Selecting Colors
The \selectColors command can be used to set the color of most all elements of the docu-
ment that have a color attribute.
\selectColors{<key-values>}
Command Location: There are no restrictions on this command. In the preamble, it will set the
defaults for the entire document.
Key-Value Pairs: Each of the following keys take a named color. Many of these keys have a
command interface as well, these are also noted.
1. universityColor: The color of the value of the \university declaration (see page 30).
The value of \university appears on the title page. The default is blue.
2. titleColor: The color of the value of the \title declaration (see page 30). The value of
\title appears on the title page. The default is black.
3. authorColor: The color of the value of the \author declaration (see page 30). The value
of \author appears on the title page. The default is black.
4. textBgColor: The background color of the text screen. The default is white.
5. panelBgColor: The background color of the navigation panel. The default is white.
6. urlColor: The color of an URL link. The default is webbrown.
7. linkColor: The color of a link. The default is webgreen.
8. fileColor: The color of a link to a local file. The default is webbrown.
There are several other colors as well, these can be set through their interface, see Section 15.5,
page 39, for a discussion of the commands \sectionLayout, \subsectionLayout and
\subsubsectionLayout.
The demo file web_pro illustrates this command.
The pro Option 39
\noSectionNumbers
The command \noSectionNumbers causes Web to remove the usual numbering system for a
LATEX document. This may be useful when preparing a document for presentation, and a number-
ing system is not needed. The default is to use section numbers.
Command Location: The use of this command is restricted to the preamble. The decision must
be made for the whole document at the beginning of the document.
\sectionLayout{<key-values>}
\subsectionLayout{<key-values>}
\subsubsectionLayout{<key-values>}
Command Location: No restriction on the use of this command. In the preamble, you set
the layout for sections for the whole document. In the body of the document, changes occur
immediately starting with the next relevant section.
Key-Value Pairs: Each of these takes the same key-value pairs.
1. fontfamily: Font family to use for the section title, permissible values are rmfamily,
sffamily, ttfamily.
2. fontseries: Font series to use for the section title, values are bfseries and mdseries.
3. fontshape: Font shapes to use for the section title, values are upshape, itshape,
scshape, slshape.
4. fontsize: Font size of the section title, permissible values are tiny, scriptsize, foot-
notesize, small, normalsize. large, Large, LARGE, huge, Huge.
5. halign: Alignment of the section title, permissible values are l (left aligned), c (centered),
r (right aligned).
6. ding: You can specify a ding to display where the section number is usually placed; e.g.,
ding=\ding{066}.
7. color: The color of the section title, this can be any named color. The default is blue.
8. special: Through this key, you can a specify predefined layout for the section titles. Per-
missible values are shadow, framebox, colorbox, fcolorbox, frameboxfit, color-
boxfit, fcolorboxfit, custom, default.
The pro Option 40
Custom section heads can be used by specifying a value of custom. In this case, Web uses
the values of \customSecHead, \customSubsecHead and \customSubsubsecHead.
Each of these macros take one argument, the code for designing the title. The title is referred
to as #1. Depending on how these custom section titles are defined, the other keys may
not be obeyed.
9. framecolor: The color of the frame surrounding the subject when the special key has
a value of framebox, fcolorbox frameboxfit or fcolorboxfit.
10. bgcolor: The background (fill color) of the box enclosing the section title, when special
has a value of colorbox, fcolorbox, colorboxfit or fcolorboxfit.
11. shadowcolor: The color of the shadow, when special has a value of shadow.
12. beforeskip: The amount of skip before the section title.
13. afterskip: The amount of skip after the section title.
14. usefont: Through this key it is possible to specify an arbitrary font and font size. The key
takes five paramters, for example, usefont={OT1}{cmdh}{m}{n}{{16}{16pt}}. The
first four are the arguments of the LATEX’s \usefont, encoding, family, series and shape. The
last argument are the arguments of the LATEX’s \fontsize, size and baselineskip.
If the fifth parameter is empty, no font size is specified, the current default sizes are used.
15. numdingcolor: The color of the section number or ding, if defined. The default is blue.
16. reset: This key attempts to reset changes to their defaults. Permissible values are font
(to reset the font changes only), or all (to reset all the keys).
Example 3: The following example sets the section title with shadows: text is red and shadow is
blue. We center the title horizontally, and specify an after skip of 12pt.
\sectionLayout{%
afterskip=12pt,
halign=c,
color=red,
shadowcolor=blue
}
Similarly for \subsectionLayout and \subsubsectionLayout.
\shadowhoffset{<length>}
\shadowvoffset{<length>}
When special = shadow, shadowing is obtained by typesetting the text twice with differ-
ent colors. The amount of horizontal and vertical offset are controlled by these two commands.
The defaults are \shadowhoffset{.2ex} and \shadowvoffset{-.2ex}.
The interface for writing custom section layouts are the following three commands.
The pro Option 41
\customSecHead{<tex_code>}
\customSubsecHead{<tex_code>}
\customSubsubsecHead{<tex_code>}
\makeatletter
\customSecHead{\vbox{\colorbox{\aeb@sectionbgcolor}
{\color{\aeb@sectioncolor}#1}}}
\sectionLayout{%
special=custom,
halign=l,
bgcolor=red,
color=white
}
\makeatother
The above code is a simplified version of the colorboxfit, a value of the special key.
The demo file web_pro illustrates these commands.
42
\usepackage{exerquiz}
Use exerquiz with the web package:
\usepackage[<driver_option>,<more_options>]{web}
\usepackage[<options>]{exerquiz}
A complete list of the options recognized by exerquiz can be found in Section 26; they are also
discussed below.
No driver option with exerquiz is needed if you are using the web package. (The driver options
for the web package are dvipsone, dvips, pdftex, dvipdfm and textures.)
For the dvipdfm option to work properly you will need dvipdfm, version 0.12.7b or later, and
hyperref, version 6.68a or later.
Use hyperref and exerquiz with either dvipsone or dvips:
\usepackage[<driver_options>,<more_options>]{hyperref}
\usepackage{exerquiz}
In particular, pdfscreen4 , a screen design package written for pdftex by C. V. Radhakrishnan, has
been tested and works correctly with exerquiz. For example,
\usepackage[screen,article,sidebar]{pdfscreen}
\usepackage[pdftex]{exerquiz}
See the sample file eq_pdfs.tex already set up for use with pdfscreen, obtained by download-
ing the zipped file eq_pdfs.zip.
4 CTAN:macros/latex/contrib/supported/pdfscreen
Basic Package Options 44
\usepackage[dvipdfm,<more_options>]{hyperref}
\usepackage[dvipdfm]{exerquiz}
Important Note: Only the exercise environment (the material described in Section 18) is
supported by these two options. None of the quiz environments can be used with these two
options at this time. Y&Y users need to use the dvipsone option if the quiz environment is
needed.
\usepackage[<driver_option>,<more_options>]{hyperref}
\usepackage[<driver_option>,french]{exerquiz}
<driver_option> is any of the drivers: dvipsone, dvips, pdftex, or dvipdfm. Note: the
<driver_option> is not needed with the exerquiz package with dvipsone or dvips.
\usepackage[<options>]{hyperref} % or pdfscreen
\usepackage[forpaper]{exerquiz}
console.println("Function myFunc");
console.println("Parameters: x = " x + ", y = " + y );
console.println("Return Value: retnValue = " + retnValue);
In the above code, I have used the console.println() method, which is only available in
the Acrobat application, not the Reader. For the Reader, one could use app.alert(), but this
method is not well-suited for monitoring values of a large number variables as the script executes.
If you don’t have the full Acrobat, the debug option will not be useful.
Exerquiz just passes this option on to the insdljs package. Additional details on the debug
option can be found there. Within the insDLJS environment, you can place debugging code
lines as follows:
function myFunc(x,y)
{
retnValue = x + y;
\db console.println("Function myFunc");\db%
\db console.println("Parameters: x = " x + ", y = " + y );\db%
\db console.println("Return Value: retnValue = " + retnValue);\db%
return retnValue;
}
Any line that begins with \db and ends with \db is a debugging line. These lines will be included
if the debug option is taken; otherwise they are removed. The‘%’, is the comment character within
the insDLJS environment, and prevents, in this case, the introduction of a carriage return.
Solutions are written verbatim to the auxiliary file \jobname.sol, then input back in near the
end of the document. A hypertext link is created to connect the exercise with the solution.
An exercise with multiple parts can also be defined, with hypertext links to the solutions of
the individual parts of the exercise.
The exercise environment has its own counter (eqexno), but there is an option for using
another counter—or no counter at all. This may be useful for creating a numbered example
environment.
There is an option for placing the solutions immediately after the statement of the problem.
This, again, may be useful for an example environment where you want the solution to the
example to follow the statement, rather than being hypertext-linked to the solution.
Finally, there is an option for hiding solutions, in the following sense: When the hidden option
is used, the solutions are commented out rather then being written to the \jobname.sol file.
Additionally, there is a global option, nohiddensolutions; in this case, when you re-LATEX, the
solutions are written to \jobname.sol, and input back into the document.
\begin{exercise}
Your Question.
\begin{solution}
The Solution to Your Question
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
\end{solution}
\end{exercise}
\begin{exercise}\label{ex:int}%
Evaluate the integral \(\displaystyle\int x^2 e^{2x}\,dx\).
\begin{solution}
We evaluate by \texttt{integration by parts}:
\begin{alignat*}{2}
\int x^2 e^{2x}\,dx &
= \frac12 x^2 e^{2x} - \int x e^{2x}\,dx &&\quad
\text{$u=x^2$, $dv=e^{2x}\,dx$}\\&
... lines removed ...
= \frac14(2x^2-2x+1)e^{2x} &&\quad
\text{simplify!}
\end{alignat*}
\end{solution}
\end{exercise}
The exercise Environment 47
See the demo file webeqtst.tex for a complete listing of this exercise.
Questions and solutions are kept together à la Knuth. The solutions are written to the file
\jobname.sol verbatim then input back using the macro \includeexersolutions.
You can redefine the counter to include the section number. For example, the code
\renewcommand{\theeqexno}{\thesection.\arabic{eqexno}}
can be placed in the preamble of your document. In this case, the above exercise would appear
as Exercise 18.1.
The usual cross-referencing mechanisms for LATEX, i.e., using \ref and \pageref, work as
expected.
For example, the label ‘\label{ex:int}’ was placed just after the \begin{exercise} on
the previous page. Let us now reference Exercise 1, on page 46.
let us now reference Exercise~\ref{ex:int},
on~\pageref{ex:int}.
Of course, the nicer looking variations can be done as well. For example, see Exercise. 1
\hyperref[ex:int]{\textsc{Exercise~\ref*{ex:int}}}
The *-form of \ref was used to turn off the redundant link creation. (hyperref would normally
make the \ref macro into a link.)
An ‘Exercise’ that is also a hypertext link appears in the default color green; if an ‘Exercise’
is not a link, it appears in blue. (The word ‘Exercise’ is not a link if it is an exercise with parts, or
if the nosolutions option is used. Finally, if the web option forpaper is used, color is turned
off and ‘Exercise’ appears in black.
Caveat: There is one problem you might watch for. There is an optional argument to the
solution environment. When LATEX searches the source looking for the optional parameter,
which may not exist, it expands macros looking for a ‘[’. This causes problem when you have
a solution that begins with a math display environment and LATEX prematurely expands such an
environment.
Exercise Write
2. an equation of a line that crosses the x- and y-axes at 1.
To prevent LATEX errors that will stop the compilation, just place a \relax prior to the math
environment. The code for the previous exercise is
\begin{exercise}
Write an equation of a line that crosses
the $x$- and $y$-axes at 1.
\begin{solution}
\relax\begin{equation*}
\boxed{x+y=1}
\end{equation*}
\end{solution}
\end{exercise}
This is only necessary if the solution does not begin with text.
The exercise Environment 48
\begin{exercise*}
Preamble for your multi-parted question.
\begin{parts} % begin listing of the parts
\item First question.
\begin{solution}
Solution to first question.
\end{solution}
...
...
\item Final question.
\begin{solution}
Solution to the final question.
\end{solution}
\end{parts} % end listing of parts
\end{exercise*}
The following exercise illustrates this option. This example appears in the file webeqtst.tex
that comes with this distribution.
Exercise 3. Suppose a particle is moving along the s-axis, and that its position at any time t is
given by s = t2 − 5t + 1.
(a) Find the velocity, v, of the particle at any time t.
(b) Find the acceleration, a, of the particle at any time t.
&
\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}
&
...
\end{solution}
\end{parts}
\end{exercise*}
This problem style does not obey the solutionsafter option. (See the section entitled
‘The solutionsafter Option’ on page 51).
The sample file webeqtst.tex contains this particular example.
18.2. Options of the exercise Environment
• Leaving Vertical Space instead of a Solution
The exercise environment can be used for test construction. Initially, you may want to pose a
questions and leave space beneath for the student to write in an answer.
The solutions environment has an optional parameter for inserting a vertical space.
\begin{exercise}
This is the question.
\begin{solution}[1in] % <-- optional vertical skip
This is the solution.
\end{solution}
\end{exercise}
This vertical space only appears when the nosolutions option is in effect.
Within the context of test construction, write the test (including the solutions), then publish
it with the nosolutions option (leaving vertical spaces as appropriate), then publish the key
with the solutionsafter option. (If solutionsafter and nosolutions both appear in
the option list, solutionsafter overrides nosolutions.)
The optional parameter for the solution is ignored for exercises with parts having a tabular
format (Example 4 is an example of a tabular multipart exercise).
\usepackage[noHiddensolutions]{exerquiz}
This option overrides the local ‘h’ option throughout the document.
\makeatletter
\@addtoreset{eqexno}{section}
\makeatother
\documentclass{article}
\usepackage[pdftex]{web} % dvipsone, dvips or dvipdfm
\usepackage[nosolutions]{exerquiz}
For this kind of application, it might make sense to publish the exercises with the forpaper
option.
the solutions to the exercises appear just after the exercise question. For example,
Exercise Let
7. V be a vector space, show that the zero vector, 0, is unique.
The exercise Environment 52
Solution: Let 0 be a vector that satisfies the axiom of being a zero of the vector space V . We want
to show 0 = 0 . Since 0 is a zero, we have 0 + 0 = 0 . But we are assuming 0 is a zero vector as
well, hence, 0 + 0 = 0. Finally,
0 = 0 + 0 = 0 + 0 = 0
and this completes the proof. Exercise 7
The option solutionsafter is global; all exercises will be typeset this way—unless you
change it within the document using the macros \SolutionsAfter and \SolutionsAtEnd.
This manual was typeset without the solutionsafter option. The above example was typeset
as follows:
Normally, a typical document might have all solutions at the end of the document (the de-
fault behavior), or all solutions following each exercise (solutionsafter option). Mixtures
of these two types can be obtained by using the two commands \SolutionsAfter and
\SolutionsAtEnd.
This feature might be an easy way of typsetting examples. See the example in the section entitled
‘Redesigning the exercise Environment’ on page 52.
The solutionsafter option has no effect on multipart exercises in tabular form; I haven’t
been able to find a convenient way of displaying the solutions after the questions when the
questions are in tabular form.
See the files webeqtst.pdf and hw02.pdf (and their source files) for examples.
• Moving the Solution Set
The solution set, by default, comes last in the file. You can move its positioning by including the
command \includeexersolutions at any point after the last exercise. You’ll note that I have
moved the solutions in this file before the References section, as indicated, for example, by its
position in the table of contents.
2. \exlabelformat: Typesets the exercise label; use it to introduce additional type style such
as boldface, italic, small caps, etc.
\newcommand\exlabelformat{%
{\scshape\exlabel\ \theeqexno.}}
3. \exlabelsol: Expands to the name of the exercise label in the solutions section. Usually its
value is the same as \exlabel.
\newcommand\exlabelsol{\exlabel}
4. \exsllabelformat: The format of the solutions label, the default: \bfseries\exlabel.
\newcommand\exsllabelformat
{\noexpand\textbf{\exlabelsol\ \theeqexno.}}
5. \exrtnlabelformat: This is the label you click on to return from the solution of the
exercise.
\newcommand\exrtnlabelformat{\exlabelsol\ \theeqexno}
6. \exsectitle: The section title of the solutions to the exercises.
\newcommand\exsectitle{Solutions to \exlabel s}
7. \exsecrunhead: The running header for the solution section for the exercises.
\newcommand\exsecrunhead{\exsectitle}
The counter eqexno is used to count exercises. When an exercise environment starts,
this counter is incremented. Normally, the value of this counter figures into the definitions of
\exlabelformat, \exsllabelformat and \exrtnlabelformat. Still, the use of eqexno
is optional; for example, you might want to state a problem just as ‘Special Exercise’, without an
associated exercise number.
Below is an example of redefining the exercise environment. We define a problem envi-
ronment based on the exercise environment.
\newenvironment{problem}{%
\renewcommand\exlabel{Problem}
\renewcommand\exlabelformat{\textbf{\exlabel\ \theeqexno.}}
\renewcommand\exsllabelformat
{\noexpand\textbf{\exlabel\ \theeqexno}}
\renewcommand\exrtnlabelformat{$\blacktriangleleft$}
\renewcommand\exsecrunhead{\exsectitle}
\begin{exercise}}%
{\end{exercise}}
See any standard LATEX reference on how to define a new environment, for example [3].
Here is an example of the new problem environment:
\begin{problem}
This is a question.
\begin{solution}
This is the solution.
\end{solution}
\end{problem}
Two of these commands must be handled with special care, they are \exsllabelformat
and \exrtnlabelformat; formatting such as \textbf or \scseries must be preceded by
a \noexpand. These commands are written to a file, and must be prevented from expanding.
When you use the exercise environment, the counter eqexno is automatically incre-
mented by default. The exercise does have an optional argument for inserting your own
counter.
\begin{exercise}[<ctr>]
.......................
\end{exercise}
Where <ctr> is a counter already defined. This option is useful if you want to use the exercise
environment to create a new environment with its own numbering scheme, as the following
example illustrates.
This example demonstrates how to define an example environment with its own counter. For
examples, we don’t want the solutions to appear at the end of the file, so we’ll use the commands
\SolutionsAfter and \SolutionsAtEnd. All changes are local.
% put a counter in preamble
\newcounter{exampleno}
\newenvironment{example}{%
\renewcommand\exlabel{Example}
\renewcommand\exlabelformat
{\textbf{\exlabel\ \theexampleno.}}
\renewcommand\exrtnlabelformat{$\square$}
\SolutionsAfter
\begin{exercise}[exampleno]}%
{\end{exercise}
\SolutionsAtEnd}
to obtain
Example 1. What is 2 + 2?
Solution: It is well known that 2 + 2 = 4.
The exercise Environment 55
The changes are local to the new example environment. If we have another exercise, we get a
correctly numbered exercise.
Exercise What
9. is 2 + 2?
The command \exsolafter typesets the solution label to the exercise in the case the
solutionsafter option is in effect. \exsolafter defaults to ‘\textit{Solution}:’. You
can redefine it as follows:
\renewcommand\exsolafter{\textsl{L\"osung}:}
This redefinition yields:
Example 2. What is 2 + 2?
Lösung: It is well known that 2 + 2 = 4.
There is a special option to the exercise environment as well,
\begin{exercise}[0]
.......................
\end{exercise}
When the optional argument is 0 rather than a counter. In this case, no counter is associated with
the environment. For example,
\newenvironment{project}{%
\renewcommand\exlabel{Project}
\renewcommand\exlabelformat{\textbf{\exlabel. }}
\renewcommand\exsllabelformat
{\noexpand\textbf{\exlabel\ Hint:}}
\renewcommand\exrtnlabelformat{$\blacktriangleleft$}
\begin{exercise}[0]}%
{\end{exercise}}
Thus, we obtain,
Project. Find a shorter proof of Fermat’s Last Theorem. Do not look at the project hints until
you have finished the project.
The code:
\begin{project}
Find a shorter proof of \textsc{Fermat’s Last Theorem}. Do not
look at the project hints until you have finished the project.
\begin{solution}
There, you didn’t need my help after all.
\end{solution}
\end{project}
Note that the solutions are typeset at the end of the file in the ‘Solutions to Exercises’ section. At
this time, there is no feature for sorting out these different types of environments; they are all
exercise environments, which is what they are.
Finally, see the sample file hw01.tex that illustrates how to change all the labels. The file
also demonstrates how web and exerquiz can be used to post problems on the Internet, or on
paper, with or without solutions included.
56
\begin{shortquiz*}[KublaKhan1]
Was it in Xanadu did Kubla Kahn a stately pleasure dome decree?
\begin{answers}{4}
\Ans1 True & \Ans0 False
\end{answers}
\end{shortquiz*}
True False
Here we have inserted two new commands prior to this last short quiz \sqTurnOffAlerts
and \sqCorrections to change response feedback. The former turns off the alerts and the
latter turns on the corrections: check for a correct answer and an cross for an incorrect answer.
(It doesn’t make sense to \sqTurnOffAlerts without \sqCorrections; \sqCorrections
can be used without turning off the alerts.)
These two commands only apply to a short quiz that uses radio buttons. You can reverse
these two commands with \sqTurnOnAlerts and \sqNoCorrections, respectively. These
settings are the defaults of the shortquiz with check boxes.
\begin{shortquiz}
...Question goes here...
\begin{answers}[<name>]{<num_cols>}
...
\Ans0 <an incorrect answer> &
...
\Ans1 <a correct answer> &
...
\end{answers}
\begin{solution}
...Solution to correct answer goes here...
\end{solution}
\end{shortquiz}
The <name> is a name used to create a hypertext jump to the solution; <name> will be the
“named destination.” As before, <num_cols> is the number of columns to typeset the answers
in.
The following example illustrates the quiz with solution.
Quiz Define a function f (s) = 4s3 and another function F (t) = t4 . Is F an antiderivative of f ?
(a) Yes (b) No
The verbatim listing:
\begin{shortquiz}
Define a function $f(s)=4s^3$ and another
function $F(t)=t^4$. Is $F$ an antiderivative of $f$?
\begin{answers}[quiz:anti]{4}
\Ans1 Yes &\Ans0 No
\end{answers}
\begin{solution}
The answer is ‘Yes’. The definition requires that
$$
F’(x) = f(x) \quad\text{for all $x$,}
The shortquiz Environment 59
$$
well, let’s check it out.
.........................
.........................
Therefore,
$$
F’(x) = 4x^3 = f(x)\quad\text{for all $x$,}
$$
as required by the definition.
\end{solution}
\end{shortquiz}
Note that the choices begin with the \Ans macro followed by a 0 or 1, as described in the
previous pages. The end of the choice is delimited by the \eAns command (which is undefined,
but is used as a argument delimiter). Note that it is not necessary (and would be a mistake) to
place the column delimiter ‘&’, or the end of line command ‘\\’, this is done by the \bChoices
command.
The commands \bChoices and \eChoices can be used within the answers environment
as part of a shortquiz or a quiz environment.
Concerning the example above, the argument of the answers environment is 4 which means
we are going to use the tabular environment with 4 columns. Now within those 4 columns we
The shortquiz Environment 60
are going to only use the first 2 columns (this is the optional argument of \bChoices). If the
optional argument is removed from \bChoices, the choices are typeset in the with 4 columns.
If the argument of \answers is changed to 1, the optional argument of \bChoices is
ignored, and the alternatives are typeset in a one column list environment.
By changing the two parameters (the one for \answers and the one for \bChoices) you
can easily modify how the alternatives are typeset.
\rowsep: Space between rows (or items in list environment) can be adjusted with the
\rowsep command. If you say \rowsep{3pt}, an additional 3pt space is added between rows
or items in a list environment. The default is 0pt. The default is controlled through the command
\rowsepDefault, like so,
\rowsepDefault{0pt}
For example,
\begin{answers}{4}
\rowsep{3pt}
\bChoices[2]
\Ans0 a choice\eAns
\Ans1 another choice\eAns
\Ans0 still another choice\eAns
\Ans0 another\eAns
\Ans0 incoming\eAns
\eChoices
\end{answers}
Do not place this command inside the \bChoices/ \eChoices pair, the above example shows
the optimal placement, just before \bChoices. This separation \rowsep is reset to the default
at the end of the listing. To get a uniform separation between rows across the document, redefine
\rowsepDefault in the preamble, like so,
\rowsepDefault{3pt}
No commands should appear between the pair \bChoices and \eChoices and outside an
\Ans and \eAns pair. All such tokens are gobbled up.
• The questions Environment
The questions environment was designed to work with the quiz environment—taken up in
Section 20 below—but it works equally well with shortquiz.
Using the questions environment, quizzes defined by shortquiz, with/without solutions,
can be mixed together and combined to make a “mini-quiz”. For example,
Quiz Determine the LCD for each of the following.
3x 2
1. 2 3 − 3 2 .
2y z xy z
(a) LCD = 2xy 5 z 5 (b) LCD = 2y 3 z 3
3 3
(c) LCD = 2xy z (d) LCD = 2xy 3 z 5
The shortquiz Environment 61
x+y x2 + y 2
2. − .
3/2
3x y 2 6xy 4
(a) LCD = 18x3/2 y 4 (b) LCD = 6x3/2 y 4
(c) LCD = 18xy 4 (d) LCD = 6xy 4
The first question is given without a solution, the second has a solution attached to it. An
abbreviated verbatim listing follows.
\begin{shortquiz}
Determine the LCD for each of the following.
\begin{questions}
\item $\dfrac{3x}{2y^2z^3}-\dfrac2{xy^3 z^2}$.
\begin{answers}{2}
...
\end{answers}
\item $\dfrac{x+y}{3 x^{3/2}y^2}
-\dfrac{x^2+y^2}{6 x y^4}$.
\begin{answers}[quiz:LCB]{2}
...
\end{answers}
\begin{solution}
If you erred on this one, ... ...
\end{solution}
\end{questions}
\end{shortquiz}
\begin{answers}[quiz:\thequestionno]{4}
...
\end{answers}
\begin{solution}
...
\end{solution}
\end{questions}
\end{shortquiz}
In the example above, \SolutionsAfter was placed before the shortquiz environment
and the \SolutionsAtEnd was placed just after.
This option may be useful in publishing an answer key to a multiple choice quiz. The quiz and
solutions can be created together. The quiz can be published, then later, the quiz with complete
solutions.
\usepackage[proofing]{exerquiz}
When used, a symbol, defined by the command \proofingsymbol, will mark the correct
answers, as defined in your source file. The command \proofingsymbol can be redefined, its
definition is
\newcommand\proofingsymbol{\textcolor{webgreen}{$\bullet$}}
This option works for the quiz environment defined below (page 65), as well.
In support of the showgrayletters option is a new command \REF. \REF acts like the LATEX
command \ref with the hyperref modifications, but it converts the reference to uppercase.
When \ref would typeset the letter ‘a’, for example, \REF would typeset the letter ‘A’. \REF, like
\ref, typesets a hyperref link. Hyperref defines a * version of \ref; \ref* typesets the refer-
ence, but does not create a link; \REF* does the same. When \aebshowgraylettersfalse
is in effect, \REF does not capitalize the reference.
The showgrayletters feature and the \REF command work equally well for the quiz environ-
ment.
Below is an example of this.
Quiz Answer this if you can!
A This is a possible answer. B Try this one (the correct one)
C This is a an answer. D Another alternative.
Reference both (A) and (B).
The code is
\begin{shortquiz*}[TestSQ]
Answer this if you can!
\begin{answers}{2}
\bChoices
\Ans0\label{testsqFirst} This is a possible answer.\eAns
\Ans1\label{testsqSecond} Try this one (the correct one).\eAns
\Ans0 This is a an answer.\eAns
\Ans0 Another alternative.\eAns
\eChoices
\end{answers}
\end{shortquiz*}
\noindent Reference both (\REF{testsqFirst}) and (\REF*{testsqSecond}).
\aebshowgraylettersfalse
Notice that the \ifaebshowgrayletters is not turned to false until after the usage of \REF.
• Changing Titles
You can temporarily change the title for the shortquiz environment by redefining the macro
\sqlabel; for example, the default definition of this macro is
The shortquiz Environment 64
\newcommand\sqlabel{\textcolor{red}{Quiz.}}
You can redefine the default label as well; the default label is the title label that shortquiz uses
when \sqlabel is not present. The default label is \eq@sqlabel and must be redefined using
the macro \renewcommand. The best place for this to be done is the preamble. The syntax:
\makeatletter % make ‘at’=@ a normal letter
\renewcommand\eq@sqlabel{...new code goes here...}
\makeatother % make ‘at’=@ something special(other)
To change the entire document to use ‘Exam’ instead of ‘Quiz’, make the following changes in the
preamble:
\makeatletter
% change default quiz title to ’Exam’
\renewcommand\eq@sqlabel{\textcolor{red}{Exam.}}
% change quiz solutions return label
\renewcommand\eq@sqslrtnlabel{End Exam}
% change solutions label
\renewcommand\eq@sqsllabel{%
\string\textbf{Solution to Exam:}}
\renewcommand\eq@sqslsectitle{Solutions to Exams}
% change default running header for solutions
\renewcommand\eq@qslsecrunhead{Solutions to Exams}
\makeatother
The above commands are ‘global’—they are in effect throughout the entire document. You
can temporarily change these labels using the \sqlabel, \sqslrtnlabel, \sqsllabel
and \sqslsectitle. Note that you cannot temporarily change \eq@qslsecrunhead, the
running label—this should be set in the preamble.
Should you want to make a series of multiple choice questions (using the questions envi-
ronment) and combine them into a sort of review or pretest, a useful idea would be to number
the solutions. The counter that maintains the question number is called questionno. You can
then, for example, define
\renewcommand\eq@sqsllabel{%
\string\textbf{Solution to Question \thequestionno:}}
See the sample files webeqtst.tex and qz01.tex for examples. The later file gives exam-
ples of how to redefine some of the standard shortquiz labels.
Quiz Was it in Xanadu did Kubla Kahn a stately pleasure dome decree?
True False
Return to the defaults, if desired, by then emitting
\everysqRadioButton{}
The short quiz can also have fill-in questions and various other controls, these are described
in Section 21.4, The shortquiz Environment. There too, methods of modifying the appearance
of the form elements are discussed.
\begin{quiz}{quizfieldname}
The preamble to the questions goes here.
\begin{questions}
\item State first question....
\begin{answers}4 % <- num_cols = 4
\Ans0 ... &\Ans1 ... &\Ans0 ... &\Ans0 ...
\end{answers}
...
\item n th question....
\begin{answers}4 % <- 4 column format
\Ans0 ... &\Ans1 ... &\Ans0 ... &\Ans0 ...
\end{answers}
\end{questions}
\end{quiz}
The quiz Environment 66
Following the quiz, or anywhere in the document, place the macro \ScoreField, defined
in exerquiz, to display the results of the quiz:
\ScoreField{quizfieldname}
Important. The value of the parameter of the macro \ScoreField must match the quiz-
fieldname defined in the argument of the quiz environment.
There is a convenience macro, \currQuiz, that holds the name of the current quiz. Thus, we
could have instead typed:
\ScoreField\currQuiz
Read the paragraph entitled ‘The Score Field’ on page 74 for more details on this macro.
• Link-Style Quiz
This style uses links to record the choices to the alternatives. The link method takes up less space
in the pdf file than does the form-style.
Below is an example of a link-style quiz. Instructions should be given to guide the student in
operating the quiz correctly.
Instructions. You must click on‘Begin Quiz’to initialize the quiz. Not doing so brings forth an error
message. When finished, click on ‘End Quiz’.
Begin Quiz Using the discriminant, b2 − 4ac, respond to each of the following questions.
1. Is the quadratic polynomial x2 − 4x + 3 irreducible?
(a) Yes (b) No
2. Is the quadratic polynomial 2x2 − 4x + 3 irreducible?
(a) Yes (b) No
3. How many solutions does the equation 2x2 − 3x − 2 = 0 have?
(a) none (b) one (c) two
End Quiz
Score:
While you are taking the test, and before you click on‘End Quiz’, you can change your answers.
A message box comes out, gives you your original choice, and asks you whether you really want
to change your answer.
• Form-Style Quiz
You may be thinking that such a quiz format—one in which the student cannot see the choices
made—is not very good. It is perhaps adequate for two or three quick questions. For a longer
quiz format, one would like to see a “checkbox” format. A quiz with a checkbox format can be
obtained using the quiz* environment:8
\begin{quiz*}{quizfieldname}
...
...same format as before...
...
\end{quiz*}
Here is the same sample quiz with the form-style option. The only change in the code is the
insertion of the *-option.
Instructions. You must click on ‘Begin Quiz’ to initialize the quiz. Not doing so, brings forth an
error message. When finished, click on ‘End Quiz’.
Begin Quiz Using the discriminant, b2 − 4ac, respond to each of the following questions.
1. Is the quadratic polynomial x2 − 4x + 3 irreducible?
Yes No
2. Is the quadratic polynomial 2x2 − 4x + 3 irreducible?
Yes No
3. How many solutions does the equation 2x2 − 3x − 2 = 0 have?
none one two
8 In previous versions of
exerquiz, there was a *-option for this purpose. The quiz* has replaced the *-option and is
the preferred method, though the *-option is still defined so as not to break previous code.
The quiz Environment 68
End Quiz
Score:
\useBeginQuizLink
\useEndQuizLink
\useBeginButton[\textColor{0 0 1}]
would create a ‘Begin Quiz’ button with blue text for the button label.
\usepackage[proofing]{exerquiz}
When used, a symbol, defined by the command \proofingsymbol, will mark the correct
answers, as defined in your source file. The command \proofingsymbol can be redefined, its
definition is
\newcommand\proofingsymbol{\textcolor{webgreen}{$\bullet$}}
This option works for the shortquiz environments defined above (page 56), as well.
\newcommand\minQuizResp{lowThreshold}
\renewcommand\minQuizResp{highThreshold}
Legend: A ✔ indicates a correct response; a ✘, indicates an incorrect response, in this case, the
correct answer is marked with a ●.
A partial verbatim listing of this quiz follows:
\begin{quiz}{qzdiscr1l} Using the discriminant, $b^2-4ac$,
respond to each of the following questions.
\begin{questions}
............................
............................
............................
\end{questions}
\end{quiz}
\ScoreField{qzdiscr1l}\eqButton{qzdiscr1l}
The macro \eqButton is used to create a nice “correction” button. JavaScript is used to
correct the quiz. The only required argument is the field label that uniquely defines the field in
which the total score is placed. See the section entitled ‘The ‘Correction’ Button’ on page 74 for
more details on how to use this macro.
The \eqButton will not work until the user has clicked on‘End Quiz’. The user can re-take the
quiz simply by clicking on ‘Begin Quiz’, the form fields and JavaScript variables will be cleared.
It is possible to take this form data and submit it to a CGI script for processing. (The data
can be saved to a database, for example.) However, there is no built-in capability for this in the
exerquiz package.
The same quiz can be written in form-style simply by inserting the *-option.
Instructions. You must click on ‘Begin Quiz’ to initialize the quiz. Not doing so, brings forth an
error message. When finished, click on ‘End Quiz’.
The quiz Environment 71
Begin Quiz Using the discriminant, b2 − 4ac, respond to each of the following questions.
1. Is the quadratic polynomial x2 − 4x + 3 irreducible?
Yes No
2. Is the quadratic polynomial 2x2 − 4x + 3 irreducible?
Yes No
3. How many solutions does the equation 2x2 − 3x − 2 = 0 have?
none one two
End Quiz Score: Correct
In the partial verbatim listing that follows, notice the field name has been changed from
qz:discr1-l to qzdiscr1. Different quizzes must have unique field names.
\begin{quiz*}{qzdiscr1f} Using the discriminant, $b^2-4ac$,
respond to each of the following questions.
\begin{questions}
............................
............................
............................
\end{questions}
\end{quiz*}\quad\ScoreField\currQuiz\eqButton\currQuiz
Notice that in this example, the \ScoreField and the \eqButton are positioned following
the ‘End Quiz’; this makes the design more compact and nicer looking.
After the quiz is completed and the corrections button is pressed, the corrections appear. The
correct answer has a green filled circle or a green check; this circle is now outlined by a green
rectangle to indicate that this is a link to the solution. Click on the green dot and jump to the
solution!
Solutions do not have to appear. Some problems can have solutions, while others do not. The
ones with the solutions have the green boundary to indicate a link to the solution.
Here is a partial listing of the above example.
\begin{quiz*}{qzTeXl} Answer each of the following.
Passing is 100\%.
\begin{questions}
\item Who created \TeX?
\begin{answers}[knuth]4
\Ans1 Knuth &\Ans0 Lamport &\Ans0 Carlisle &\Ans0 Rahtz
\end{answers}
\begin{solution}
Yes, Donald Knuth was the creator of \TeX.
\end{solution}
....
\end{questions}
\end{quiz*}\quad\ScoreField\currQuiz\eqButton\currQuiz
Notice that in the answers environment, an optional parameter [knuth] appears. The
value of this parameter is a unique name for the solution to the quiz. Notice also, the solution
environment follows, and is not nested within the answers environment.
\symbolchoice{diamond}
\everyqRadioButton{\textColor{0 0 1 rg}
\BC{.690 .769 .871}\BG{.941 1 .941}}
\everyqRadioButton{}
See the document eFormMan.pdf on eForm Support for complete documentation on how to
modify a field using the optional first argument, and how to use the “every” command.
The colors are inserted into the field using JavaScript, so the color definitions are in the color
space of the JavaScript object model.
The quiz Environment 74
\eqButton[mod_appear]{field_name}
The second parameter is the field name that contains the total score for the quiz (see the above
examples). It also has one optional argument that can be used to modify the appearance of the
button.
In addition to the optional parameter to modify the appearance of the button \eqButton,
there is also a “global” mechanism for modifying the appearance of the button field. These are
Global Modification: \everyButtonField and \everyeqButton
The first one modifies the appearance of every quiz button field, the second can be used to
modify all \eqButtons.
See the document eFormMan.pdf on eForm Support for complete documentation on how to
modify a field using the optional first argument, and how to use the “every” command.
\ScoreField[mod_appear]{field_name}
In the simplest case, \ScoreField takes one argument, as above, the field_name of the
associated quiz. The expansion of \ScoreField produces a read-only text field that is 1.5
inches in width with a red border. The initial text that appears in the field is the expansion of the
macro \eqScore. The expansion of \eqScore depends on the language option: \eqScore
expands to ‘Score:’ by default, to ‘Punkte:’ for the german option and to ‘Score :’ for the french
option.
The macro \ScoreField also has an optional parameter that can be used to modify the
appearance of the text field. Should the document author want to change the basic look of
the text field produced by \ScoreField, just introduce the changes through this optional
parameter.
In addition to the optional parameter for modifying the appearance of the text field, \Score-
Field, there is also a“global”mechanism for modifying the appearance of the button field. These
are
Global Modification: \everyeqTextField and \everyScoreField
The first one modifies the appearance of every quiz text field, the second can be used to modify
all \ScoreFields.
See the document eFormMan.pdf on eForm Support for complete documentation on how to
modify a field using the optional first argument, and how to use the “every” command.
75
The new part is the customized scoring and correction button. Here is a verbatim listing of the
\ScoreField and \eqButton macros.
\ScoreField[\BC{0 0 1}]{qz:TeXc}%
\eqButton[\BC{0 0 1} % blue border color
\CA{TeX} % Button text
\RC{Users} % rollover text
\AC{Group} % pushed text
\textFont{TiRo} % text font: Times Roman
\textSize{10} % text size: 10 point
\textColor{0 0 1 rg} % blue text
\W{1}\S{I} % border width 1, inset button
]{qz:TeXc}
This example—as well as others—appears in webeqtst.tex, a test file that accompanies
the AcroTEX Bundle.
See the file qz02.tex for details and examples of how to modify the quiz titles. The language
files, e.g., eqfr.def and eqde.def, demonstrate how to redefine all variables, including those
listed above.
The demo file jquiztst.tex is an important source of examples and instruction for the
mathematical type question; additionally, the file jtxttst.tex has many examples for the text
type question.
\begin{oQuestion}{<field_name>}
<A math or text open ended question.>
\end{oQuestion}
The environment takes one required argument, a unique name for the question. This name,
field_name, is used by other supporting macros.
• \RespBoxMath: The Math Question
The \RespBoxMath command is used for posing an objective question. This command must
appear in the oQuestion, shortquiz or quiz environments. In this section we discuss only
the oQuestion environment.
The following is a minimal example. Additional enhancements will be discussed in subsequent
sections.
d
Differentiate sin2 (x) =
dx
Objective Style Questions 77
\begin{oQuestion}{sine1}
\redpoint Differentiate $\dfrac d{dx} \sin^2(x) =
\RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{[0,1]}$
\end{oQuestion}
\begin{oQuestion}{multivariate}
\redpoint $\dfrac{\partial}{\partial y} {4 x^2 y^3 }
= \RespBoxMath{12*x^2*y^2}(xy){4}{.0001}{[0,1]x[0,1]}$
\end{oQuestion}
See the file multivar.tex for more examples quizzes involving multivariate problems.
The algorithm used for determining the correctness of the answer entered by the user is very
simple: The user’s answer and the correct answer are evaluated at randomly selected points in an
interval, then compared. If any of the comparisons differ by more than a preselected amount, an
value, if you will, the user’s answer is declared incorrect; otherwise, it is considered correct.9
The command \RespBoxMath takes ten parameters, five optional and five required:
\RespBoxMath[#1]#2(#3)[#4]#5#6#7#8[#9]*#10
Parameters:
#1 : Optional parameter used to modify the appearance of the text field. See the section
entitled The ‘Correction’ Button for examples, and exerquiz.dtx for a listing of all controlling
macros.
#2 : The correct answer to the question. This must be a numerical value, or a function of one
variable. JavaScript Note: In JavaScript, functions such as sin(x) and cos(x) are methods
of the Math object. It is not necessary, however, to type Math.sin(x) or Math.cos(x);
this is done by inserting the expression into a with(Math) group. For example,
with(Math){ 2*sin(x)*cos(x) }.
#3 : An optional parameter, delimited by parentheses, that defines the independent variable; x,
is the default value. Note that this parameter is set off by parentheses. For a multivariate
question, just list the variables in juxtaposition, (xyz).
Beginning with version 5.5 of exerquiz, an alternate method is to delimit with commas
(x,y,n) and include the type of the variables (r:x,r:y,i:n), where "r" means a real
variable and "i" means an integer variable. When a type is not specified explicitly, "r" is
9The idea for evaluating user input in this way comes from Drs. Wlodzimierz Bryc and Stephan Pelikan of The University
of Cincinnati.
Objective Style Questions 78
assumed. The variables must be either of the old style (no commas, no typing) or the new
style. Do not mix the styles.
See the example in ‘Some Enhancements’ on page 81 of the section below and see the
demo file integer_test.tex to demonstrate the new method for specifying variables.
#4 : Optional, a named destination to the solution to the question. If this parameter appears,
then a solution must follow the question, enclosed in a solution environment.
#5 : The number of samples points to be used, usually 3 or 4 is sufficient.
#6 : Precision required, the value, if you will.
#7 : Parameters #7 and #8 are used to define the interval from which to draw the sample
points. There are two forms: (1) #7 is the left-hand endpoint of the interval and #8 is the
right-hand endpoint (the use of #7 and #8 in this form is deprecated); (2) the interval is
defined by standard interval notation, [a,b]. For a multivariate question—one where
parameter #2 lists more than one variable, separate the intervals for each variable by a ‘x’,
[0,2]x[1,2]x[3,4].
#8 : (1) #8 is the right-hand endpoint of the interval (the use of this parameter is deprecated);
(2) in the second case, #8 is not used.
#9 : This optional parameter is the name of a customized comparison function.
Beginning with version 5.5 of exerquiz, this argument can also be a JavaScript object with
at most two properties: priorParse and comp. priorParse is used to insert additional
JavaScript into ProcResp prior to processing the user’s answer; this allows additional
“filtering” of the user’s response. The value of priorParse can either be a single function,
or an array of functions. These functions take UserAns as its argument and return either
null, if UserAns is not acceptable, or true, if it is ok for processing. The value of comp is
the name of the function to be used to compare answers.
See the demo file integer_tst.tex for examples of usage.
#10: (Only detected if following an asterisk, ‘*’) The name of a JavaScript function that is to be
used to process the user input.
For the above example,
\RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{[0,1]}
no optional parameter is specified. The correct answer written in valid JavaScript is given by
2*sin(x)*cos(x); evaluation of the user’s answer is done by randomly selecting 4 points
from the interval [ 0, 1 ]; if the evaluation at any of the 4 points differs from the evaluation of
the correct answer at the same point by more than = 0.0001, the user’s answer is considered
wrong.
Once you choose the question to ask, you must then select the values of the parameters for
\RespBoxMath.
Some Comments:
Objective Style Questions 79
1. The correct answer can be written either with valid JavaScript, or in the same syntax a user
would enter the answer with. The functions and operators are pretty much as expected.
See the demo file jquiztst.tex for some discussion how authors and users should enter their
answers.
2. The interval from which the sample points are taken needs to be chosen with care. The interval
must, obviously, be a subset of the domain of the answer function. Choose an interval away
from any singularities the answer may have.
3. The JavaScript of Acrobat 5.0 does have exception handling, but this has not been incor-
porated into the code yet. Taking advantage of this new capability will be my next project.
Exception handling will give the code protection against user’s entering spurious answers.
For example, based on the correct answer, the author chooses the interval [ 0, 1 ], but the user
enters a function whose domain does not contain the interval, such as (x-1)^(1/2).
See the file jquiztst.pdf for various examples of the math questions. The source code is
available from the main AcroTEX Bundle Web Site
By using the optional first parameter, you can modify the appearance of the field “locally”.
There is also a “global” mechanism as well:
Global Modification: \everyeqTextField, \everyRespBoxMath
The first one modifies the appearance of every quiz text field, and the second can be used to
modify all fields created using \RespBoxMath.
See the document eFormMan.pdf on eForm Support for complete documentation on how to
modify a field using the optional first argument, and how to use the “every” command.
\begin{oQuestion}{exTxt1}
\redpoint Name the probability distribution popularly
referred to as the ‘‘bell-shaped curve’’.\\
\RespBoxTxt{0}{0}{4}{Normal}{Normal Distribution}%
{Gaussian}{Gaussian Distribution}
\end{oQuestion}
Parameters:
Objective Style Questions 80
#1 : Optional parameter used to modify the appearance of the text field. See the section
entitled The ‘Correction’ Button, page 74 for examples, and exerquiz.dtx for a listing of all
controlling macros.
#2 : This required parameter is a number that indicates the filtering method to be used. Per-
missible values of this parameter are
-1: (The default) The author’s and user’s answers are not filtered in any way. (Spaces,
case, and punctuation are preserved.)
0: The author’s and user’s answers are converted to lower case, any white space and
non-word characters are removed.
1: The author’s and user’s answers are converted to lower case, any white space is re-
moved.
2: The author’s and user’s answers are stripped of any white space.
See the JavaScript function eqFilter in exerquiz.dtx for the program code details.
Additional filtering options may be added.
#3 : This parameter a number that indicates the compare method to be used. Permissible values
of this parameter are
0: (The default) The author’s and user’s answers are compared for an exact match. (These
answers are filtered before they are compared.)
1: The user’s response is searched in an attempt to get a substring match with the
author’s alternatives. Additional comparison methods may be added.
See the JavaScript function compareTxt in exerquiz.dtx for the program code details.
#4 : Optional, a named destination to the solution to the question. If this parameter appears,
then a solution must follow the question, enclosed in a solution environment.
#5 : This required parameter is the number of alternative answers that are acceptable. The alter-
native answers are listed immediately after this parameter. (The example above specified
that 4 alternatives follow.)
See the file jtxttst.pdf for examples of the differences between various combinations of filter-
ing rules and comparison methods. The source code is available from AcroTEX Bundle Web Site.
By using the optional first parameter, you can modify the appearance of the field “locally”. There
is also a “global” mechanism as well:
Global Modification: \everyeqTextField and \everyRespBoxTxt
The first mechanism modifies the appearance of every quiz text field, the second can be used to
modify all fields created using \RespBoxTxt.
See the document eFormMan.pdf on eForm Support for complete documentation on how to
modify a field using the optional first argument, and how to use the “every” command.
Objective Style Questions 81
\begin{oQuestion}{sine2}\\[1ex]
\redpoint Differentiate $\dfrac d{dt} \sin^2(t) =$
\RespBoxMath{2*sin(t)*cos(t)}(t){4}{.0001}{0}{1}\kern1bp
\CorrAnsButton{2*sin(t)*cos(t)}
\end{oQuestion}
The \CorrAnsButton takes one parameter, the correct answer. This answer is (usually) the
same as the one given as the second argument (the optional argument is the first) in the
\RespBoxMath command.
The \CorrAnsButton also controls access to the (optional) solution, see the next section.
• Including a Solution
In addition to a correct answer, you can also include a solution to the question. Insert the optional
fourth parameter—fourth for both \RespBoxMath and \RespBoxTxt—into the parameter
list giving the name of the destination to the solution. Follow the question by a solution
environment containing the solution.
The user Shift-Clicks on the \CorrAnsButton to jump to the solution.
Differentiate
d
sin2 (t) = Ans
dt
The listing follows:
\begin{oQuestion}{sine3}\\[1ex]
\redpoint Differentiate $\dfrac d{dt} \sin^2(t) =$
\RespBoxMath{2*sin(t)*cos(t)}(t)[sine3]{4}{.0001}{0}{1}\kern1bp
\CorrAnsButton{2*sin(t)*cos(t)}
\begin{solution}
$$
Objective Style Questions 82
\begin{oQuestion}{sine4}
\redpoint Differentiate\\[1ex]
$\dfrac d{dx} \sin^2(x) =$
\RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{0}{1}\kern1bp
\CorrAnsButton{2*sin(x)*cos(x)}\kern1bp
\sqTallyBox
\end{oQuestion}
The tally box can be used within the oQuestion and shortquiz environments; in the quiz
environment, no tally box is used.
\begin{oQuestion}{sine5}
\redpoint Differentiate\\[1ex]
$\dfrac d{dx} \sin^2(x) =$
\RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{0}{1}%
\CorrAnsButton{2*sin(x)*cos(x)}\kern1bp
\sqTallyBox\kern1bp\sqClearButton
\end{oQuestion}
Notice that I’ve inserted a \kern1bp to separate the two fields \sqTallyBox and \sqClear-
Button. This is to keep their borders from overlapping.
Objective Style Questions 83
Clear
When using objective questions within a shortquiz environment, you must give a unique
field name as an optional argument of the environment. The listing of this example follows:
\begin{shortquiz}[oQsq] % <-- unique field name
Answer each of the following. Passing is 100\%.
\begin{questions}
\end{solution}
\end{questions}
\end{shortquiz}
\begin{flushright}
\sqClearButton\kern1bp\sqTallyTotal %<-- total tally
\end{flushright}
Example Notes:
• Note the optional argument gives this collection of questions a common base name. All
supporting macros use this name.
• In this example, another built-in macro, \sqTallyTotal was used. This macro creates a
text field that accumulates the totals of all the tally boxes.
The shortquiz environment can also be used for a single objective question. Just don’t use
the questions environment within.
\begin{shortquiz}[anExample]
< an objective style question >
\end{shortquiz}
Answers:
The buttons created by \CorrAnsButton are hidden until the user ends the quiz (and gets
scored) and clicks on the corrections button (\eqButton). The \CorrAnsButton should not
be included if there is no \eqButton.
Objective Style Questions 85
If there is a solution to the problem, the “Ans” button is outlined in green. Shift-click on the
“Ans” button to jump to the solution.
The quiz environment requires a field name. This same name is used by the objective style
question as well.
The listing for the above example follows.
\begin{quiz*}{oQq}
Answer each of the following. Passing is 100\%.
\begin{questions}
Notes:
☛ If you miss any one of the three answers, the ScoreField reports back ‘Score: 0 out
of 1’. There is only one question there, to get it correct, you must answer all three inputs
correctly.
☛ Points can be assigned to the individual responses and a score is given based on the validity
of the inputs and the corresponding points. There is a default JavaScript function that scores
the results. The document author can define a custom JavaScript function to have a more
“exotic” method of evaluating the group. See the test file grp_test.tex for details.
☛ Notice that after you take the quiz and click on “Correct” button, the “Ans” button appears
(as usual). If you click repeatedly on this “Ans” button, you can cycle through all answers to
this question; the response box is highlighted (or put in focus) and the answer appears in the
answer field provided.
See the demo file grp_test.tex for the source code of this example, as well as more
technical details of the mathGrp environment.
\documentclass{article}
\usepackage{amsmath,amscd}
\usepackage[tight,pdftex,designi,nodirectory]{web}
\usepackage{exerquiz}
\usepackage[equations]{dljslib} % <--choose equations
Vector Handling There are also JavaScript functions for processing vector answers. See the
sample file jqzspec.tex. Actually this file does not use the JavaScript library, but is more of
a tutorial on how to use \insdljs to write custom JavaScripts to process exerquiz math fill-in
questions.
The preamble of that document could actually be replaced with…
\documentclass{article}
\usepackage{amsmath,amscd}
\usepackage[tight,dvipdfm,designi,nodirectory]{web}
\usepackage{exerquiz}
\usepackage[vectors,indefIntegral]{dljslib}
The vectors option specifies JavaScripts for processing vector questions. The indefIntegral
option is also specified. This is because that in the file jqzspec.tex a comparison function is
developed for properly evaluating questions in which an indefinite integral is expected.
Comma Delimited Answers and Sets The setSupport option of the dljslib Package pro-
vides basic support for math fill-in questions requiring a (unordered) list of comma delimited
numerical or symbolic answers, or for a set. The demo and tutorial file is set_test.tex. See
that file for more details.
In addition to the two above mentioned sets of JavaScripts there are a couple of comparison
functions, one for processing indefinite integrals (see dljs_ex.tex), and the other for using rel-
ative absolute error rather than absolute error. Again, see the documentation of dljslib.dtx
and the sample file jqzspec.tex.
document level JavaScripts reside. This package is a stand-alone package, and does not need
exerquiz, though exerquiz now uses this package to insert its JavaScripts into the document.
See the documentation that accompanies the package (by latexing insdljs.dtx) for details
of how to use the library. Also, see the sample file insdljs_ex.tex for examples that do not
use exerquiz, and the file jqzspec.tex, for examples that do use exerquiz.
if (\minQuizResp(\thequestionno)) {\r\t
var f = this.getField("ScoreField.\curr@quiz");\r\t\t
if ( f != null )\r\t\t\t
this.getField("ScoreField.\curr@quiz").value
=(\eq@QuizTotalMsg);\r\t\t
\eq@submitURL
resetQuiz("\curr@quiz")\r\t
}
The code is a mixture of LATEX macros and JavaScript. You can see from this code, that there
is a submit hook macro provided, \eq@submitURL. Normally, this macro has a definition of
\@empty. A developer needs only redefine this macro accordingly; one would use the Acro-
bat JavaScript method this.submitForm() to do this. See the Acrobat JavaScript Scripting
Reference [1] for more detail about this method.
The code flow above is as follows: (1) Execute this code if the threshold has been met. (See
Setting the Threshold.) The text macro \curr@quiz holds the base name of the current quiz.
Submitting a quiz to a Web Server 90
(2) If the field "ScoreField.\curr@quiz" exists, then write the student’s score to that
field. (This is the “Score: 2 out of 3” that you see in the demo quizzes.)
(3) We then submit with the macro \eq@submitURL. (This would do nothing if its value is
\empty, the default value.) At this point we call a DLJS resetQuiz("\curr@quiz") which
sets some values in an array to indicate the state of this quiz.
\newcommand\FirstName[2]{\textField
[\DV{First Name}\textFont{TiRo}\textSize{10}\textColor{0 0 1 rg}]
{IdInfo.Name.First}{#1}{#2}}
This defines a text field with a name of "IdInfo.Name.First", the two arguments are the
width and height of the field that you want to create. E.g.,
\FirstName{100pt}{10pt}
\textField[#1]#2#3#4
The first (optional) parameter can be used to custom design the field; the second is the name of
the field; the third and fourth are the width and height of the field desired.
See the file eqformman.tex on AcroTEX eForm support for complete documentation on
\textField.
• Gathering Quiz Specific Information with \eqSubmit
In addition to ID information on the one taking the quiz, specific information about what quiz is
being taken and where the results of the quiz are to be stored are needed as well.
Exerquiz provides a basic macro, called \eqSubmit that can be used to gather basic forma-
tion of this type. The definition of it and related commands are given below:
\newcommand\databaseName[1]{\def\db@Name{#1}}\def\db@Name{}
\newcommand\tableName[1]{\def\db@Table{#1}}\def\db@Table{}
\newcommand\eqCGI[1]{\def\eq@CGI{#1}}\def\eq@CGI{}
\newcommand\eqSubmit[3]
{\eqCGI{"#1"}\databaseName{#2}\tableName{#3}}
\eqSubmit{http://www.myschool.edu/cgi-bin/myCGI.cgi}%
{CalcIII}{Quizzes}
\begin{quiz*}{Quiz3} Answer each of the following.
\begin{questions}
...
...
\end{questions}
\end{quiz*}\quad\ScoreField\currQuiz\eqButton\currQuiz
\noindent
Answers: \AnswerField\currQuiz
Any redefinition of \eq@submitURL would then include the values of some or all of these
text parameters:
The last text macro is not gathered by \eqSubmit, but is known at the time \eq@submitURL
is expanded.
Answers:
Points: Percent:
See the sample file quizpts.tex for a more elaborate version of this question, as well as the
source code.
1. \PTs#1: This macro takes one argument, the number of points to be assigned to the current
problem. Place this command immediately after the \item in the questions environment.
For example, in the above quiz we had
\item\PTs{6} Name \emph{one} of the two people recognized
as a founder of Calculus.
2. \PTsHook#1: This macro, which takes one argument, can be used to typeset the points
assigned. and is called by \PTs. The argument is what is to be typeset. The value assigned
the current problem by \PTs is contained within the macro \eqPTs. In the quiz above, we
had
\PTsHook{($\eqPTs^{\text{pts}}$)}
3. There are three other commands that create text fields to display results from a quiz with
points assigned:
• \PointsField[#1]#2: The number of points earned for the quiz, the total points are
also reported. The parameter #2 is the base name of the quiz.
• \PercentField[#1]#2: The percentage score for the quiz. The parameter #1 is the
base name of the quiz.
• \GradeField[#1]#2: The letter grade of the performance on the quiz. The parameter
#2 is the base name of the quiz. The values placed in this field are determined by the
macro \eqGradeScale.
4. \eqGradeScale: This macro sets the grade scale of a quiz, the default definition is
\newcommand\eqGradeScale{"A",[90, 100],"B",[80,90],
"C",[70,80],"D",[60,70],"F",[0,60]}
The ways things are defined now, there can be only one grade scale per document. The
value of \eqGradeScale is a matrix with an even number of elements. The odd numbered
elements are the grades; the even number elements are intervals of percentages (percentages
of the total number of points on the quiz). If the percentage of the score falls into a particular
range, the corresponding grade is assigned.
93
Note, obviously, you can redefine this command. The letter grades do not actually have to be
grades, they can be little messages to the student upon completion of the quiz.
\renewcommand\eqGradeScale{%
"Excellent Work.",[90, 100],
"Solid Effort.",[80,90],
"Fair.",[70,80],
"Needs improvement, better work expected.",[60,70],
"Learning still in progress.",[0,60]
}
• \NoPeeking
If you execute the command \NoPeeking in the preamble of your document, or prior to a quiz,
then any quiz question with solution will be protected somewhat from prying eyes.
In this case, an open page action is placed on the first page of each solution. If the user
(student) tries to view a quiz solution before doing the quiz, the Adobe Reader will automatically
change the page to the page containing the quiz and place an alert box on the screen saying
that viewing the solution before taking the quiz is not permitted.
To resort to the default behavior, use the \AllowPeeking command.
The previous quiz has been surrounded with a \NoPeeking/\AllowPeeking pair. If you
go to one of the solutions to that quiz, you will see what happens. If nothing interesting happens,
read the next red point.
Protection is removed when you click on “End Quiz” and restored when you click on some
“Begin Quiz”.
\usepackage[eqRecord]{eq2db}
The option eqRecord sets up the quiz to use an ASP (Active Server Page) that I have written.
This ASP, named naturally, eqRecord.asp, takes the data and stores it to a database, such as
Microsoft Access.
There is also a custom option. With this option, a developer can write LATEX code to set the
quiz up for submission to a CGI used or written by the developer.
For more details, see eq2dbman.pdf (the absolute URL to this document is eq2dbman.pdf),
the documentation for the distribution. eq2db is available for download at the AcroTEX home
page:
http://www.math.uakron.edu/~dpstory/webeq.html
94
What’s New
The following is a brief enumeration of some of the major new features of the web and exerquiz
packages.
• Web
1. (Version 5.0) The pro option with many user-convenient features, see ‘The pro Option’ on
page 29.
2. (Version 5.0) New Web options of usesf, page 13 and centertitlepage, page 21.
• Exerquiz
No major changes to exerquiz, some minor bug fixes. See the file eqchange.txt for more
details on the change history.
• insdljs
The insdljs Package is a general purpose LATEX package for inserting Acrobat JavaScript into the
document level section of a PDF document. The package features the insDLJS environment.
This environment typically goes in the preamble of a LATEX source file, or in the style files of a LATEX
package. See the documentation contained within the insdljs.dtx file for additional details.
There is a sample file, insdljs_ex.tex that can be used as a startup test file.
1. (Version 2.0f ) Added a command \previewMiKTeX which redefines \jsR and \jsT that
enables, I hope, the yap previewer to preview an AeB document.
• dljslib
The dljslib Package acts as a library of JavaScript functions. Due to the increased programma-
bility of exerquiz and its new-found flexibility, it is possible to write a number of different
routines to handle various kinds of math fill-in questions. These JavaScript functions can be
stored in the library and retrieved when needed. This package requires the insdljs package.
1. There are some major user-contributed JavaScript routines. The following functions, which
are ProcResp-types, were written for an online grading system being developed by Drs.
Bruce Wagner and David Arnold, and Mr. Jacob Miles-Prystowsky. The descriptions given
below were provided by the authors. I want to extend my deep thanks for their contribution!
See the documentation of dljslib.dtx for extended details.
(a) The JS function ProcRespSetFormula grades an unordered list of formulas, such as x,
x^2, x^3.
(b) ProcRespFactors is for grading polynomial factoring questions. If a polynomial factors
as -5x^2(x-4)(x+2), the answer is only unique up to the order of factors and a
change of sign on an even number of factors. For example, it could also be written
as -5x^2(x+2)(x-4) or 5x^2(-x+4)(x+2) or -5(x-4)(x+2)x^2, etc. This script
should grade all of these correctly.
(c) The JS function ProcPoint is almost an exact copy of the JS function ProcVec, but
uses parentheses instead of angle brackets as delimiters. This is for questions that have a
point (x, y) as the answer.
What’s New 99
(d) ProcRespIntervals is for grading questions that have an interval or union of intervals
as the answer.
The sample file for this contribution is dljslib_apw.tex.
2. Added a feature whereby you can create a file libcusopt.opt to declare your own options
for this package. These declarations should be a combination of existing options. For example,
\DeclareOption{procrespgrp}{
\dljsRegister[y]{vectors}\dljsRegister[y]{setSupport}
\dljsRegister[y]{equations}\dljsRegister[y]{intervals}
\dljsRegister[y]{unordered}\dljsRegister[y]{point}
\dljsRegister[y]{factors}\dljsRegister[y]{ImplMulti}
}
creates a new option for dljslib called procrespgrp which bundles together all frequently
used JS functions frequently used. The file libcusopt.opt can be placed in the LATEX search
path, but it’s perhaps best to put it in your source file, so that the options are local to that
folder.
A sample libcusopt.opt is distribued with the AeB, this sample file consists of the example
given above, and is used by the sample file dljslib_apw.tex.
Older New Stuff
3. Added an option limitArith to the dljslib, which limits the use of arithmetic operations
and built-in functions. The demo file for this is limarith.tex.
4. Added setSupport option to dljslib. This gives support to math fill-in questions for process-
ing (1) a set of numerical answers or a comma delimited list of answers; (2) a symbolic set of
answers. The demo file is set_test.tex.
5. Added combinatorics, nodec and noBinFac to the JavaScript library. These additions
are due to Ross Moore and Frances Griffin and were developed for their MacQTEX online test-
ing system. Some of the changes listed in the exerquiz section above were to accommodate
these new functions (for example, having integer variables). Many, many thanks for gener-
ously sharing their JavaScript with the TEX/PDF community. The test file for these features is
integer_tst.tex.
S
Now, I really must get back to retirement. DP
100
Solutions to Exercises
Exercise 1. We evaluate by integration by parts:
1 2 2x
x e dx = x e − xe2x dx
2 2x
u = x2 , dv = e2x dx
2
1 1 1 2x
= x2 e2x − xe2x − e dx integration by parts
2 2 2
1 2 2x 1 2x 1
= x e − xe + e2x dx u = x2 , dv = e2x dx
2 2 2
1 1 1
= x2 e2x − xe2x + e2x integration by parts
2 2 4
1
= (2x2 − 2x + 1)e2x simplify!
4
Exercise 1
Exercise 2.
x+y =1
Exercise 2
Exercise 3(a) Velocity is the rate of change of position with respect to time. In symbols:
ds
v=
dt
For our problem, we have
ds d
v= = (t2 − 5t + 1) = 2t − 5.
dt dt
The velocity at time t is given by v = 2t − 5 .
Exercise 3(b) Acceleration is the rate of change of velocity with respect to time. Thus,
dv
a=
dt
For our problem, we have
dv d
a= = (2t − 5) = 2.
dt dt
The acceleration at time t is constant: a = 2 .
Exercise 4(a) i = −1
2
Exercise 4(b) i = ii = −i
3 2
Exercise 4(c) z + z̄ = Re z
1 1 z̄ z z
Exercise 4(d) = = = 2
z z z̄ z z̄ |z|
Exercise 6(a) v = 2t − 5.
Problem 8. This is the solution.
Exercise 9. It is well known that 2 + 2 = 4. Exercise 9
Project Hint: There, you didn’t need my help after all.
101
Solutions to Quizzes
Solution to Quiz: The answer is ‘Yes’. The definition requires that
F (x) = f (x) for all x,
well, let’s check it out.
The definition of f is f (s) = 4s3 and so f (x) = 4x3 .
The definition of F is F (t) = t4 and so, by the rules of differentiation, F (t) = 4t3 . Thus,
F (x) = 4x3 . Therefore,
F (x) = 4x3 = f (x) for all x,
as required by the definition.
Solution to Quiz: If you erred on this one, more than likely it was on the appropriate multiplicative
constant: 6 not 18. At least that’s what I’m betting on.
The instructions of the LCD Algorithm said to completely factor the denominator. Here’s a list
of the factors
3, x3/2 , y 2 , 2, 3, x, y 4
first term second term
Let’s rearrange them
2, 3, 3, x, x3/2 , y 2 , y 4
Now drop duplicate factors—that’s the 3. Oops! I did mention dropping identical factors, didn’t
I?
2, 3, x, x3/2 , y 2 , y 4
Now, group together all terms which have the same base, then drop, from each of these groups
all terms but the one with the highest power. We obtain then,
2, 3, x3/2 , y 4
The LCD is the product of same:
LCD = (2)(3)x3/2 y 4 = 6x3/2 y 4 .
Solution Notes: Alternative (a) will work as a common denominator, but it is not the least common
denominator. If you use (a), you will be working with larger numbers than is really necessary.
Solution to Quiz: Yes, Donald Knuth was the creator of TEX.
Solution to Quiz: Yes, Leslie Lamport was the creator of LATEX.
Solution to Quiz:
d
sin2 (x) = 2 sin(x) cos(x) = sin(2x)
dx
Solution to Quiz:
d
sin2 (x) = 2 sin(x) cos(x) = sin(2x)
dx
Solution to Quiz: Yes, Isaac Newton and Gottfried Leibniz are considered founders of Calculus.
Solutions to Quizzes 102
Solution to Quiz:
d
sin2 (x) = 2 sin(x) cos(x) = sin(2x)
dx
Solution to Quiz: Yes, Isaac Newton and Gottfried Leibniz are considered founders of Calculus.
103
References
[1] Acrobat JavaScript Scripting Refernce, Technical Note #5431, Version 6.0., Adobe Systems,
Inc., 200
http://partners.adobe.com/asn/acrobat/docs.jsp 89
[2] Leslie Lamport, LATEX: A Document Preparation System (2nd ed.), Addison-Wesley Publishing
Company, 1994, ISBN 0-201-52983-1.
[3] Michel Goossens, Frank Mittelbach and Alexander Samarin, The LATEX Companion, Addison-
Wesley Publishing Company, 1994, ISBN 0-201-54199-8. 53
[4] Michel Goossens, Sebastian Rahtz, and Frank Mittelbach, The LATEX Graphics Companion,
Addison-Wesley Publishing Company, 1997, ISBN 0-201-85469-4.
[5] Michel Goossens, and Rahtz, Sebastian, with Gurari, Eitan, Moore, Ross, and Sutor, Robert,
The LATEX Web Companion, Addison Wesley Longman, Reading, Massachusetts, USA, 1999.
ISBN: 0-201-43311-7. 16
[6] Helmut Kopka and Patrick W. Daly, A Guide to LATEX2e (2nd ed.), Addison-Wesley Publishing
Company, 1995, ISBN 0-201-43777-X.
[7] Donald E. Knuth, The TEXbook, Addison-Wesley Publishing Company, 1987, ISBN 0-201-
13448-9.
[8] Thomas Merz, Web Publishing with Acrobat/PDF, Springer-Verlag Berlin Heidelberg New
York, 1998, ISBN 3-540-63762-1.
[9] D.P. Story, Pdfmarks: Links and Forms, AcroTeX Web Site, 1998,
www.math.uakron.edu/~dpstory/acrotex.html
[10] D.P. Story, Using LATEX to Create Quality PDF Documents for the WWW, AcroTEX Web Site,
1998,
www.math.uakron.edu/~dpstory/acrotex.html 12