diff options
author | Karl Berry <karl@freefriends.org> | 2011-08-24 00:09:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-08-24 00:09:20 +0000 |
commit | 00e6529c140ad1858c21526e6f8044aabb399270 (patch) | |
tree | 39e376e2630a9135fa211e3945879224c4c8e83b /Master/texmf-dist/doc/latex/probsoln | |
parent | 9acea66f478ccf41a96c04350796f74e5e74757e (diff) |
probsoln 3.01 (22aug11)
git-svn-id: svn://tug.org/texlive/trunk@23668 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/probsoln')
30 files changed, 3156 insertions, 1814 deletions
diff --git a/Master/texmf-dist/doc/latex/probsoln/CHANGES b/Master/texmf-dist/doc/latex/probsoln/CHANGES index d360323d06f..831d13648ec 100644 --- a/Master/texmf-dist/doc/latex/probsoln/CHANGES +++ b/Master/texmf-dist/doc/latex/probsoln/CHANGES @@ -1,5 +1,25 @@ probsoln package versions: +version 3.01: + + * Problems may now contain floats in their definition + + * Problems with arguments may now specify a default argument + to be used with \foreachproblem and new package option + "usedefaultargs" + + * Added \foreachsolution + + * Fixed bug in random number generator when n = 7. (Use + \PSNuseoldrandom to ensure compatibility with older versions.) + + * \loadrandomproblems generates a warning instead of an error + when more problems are requested than the maximum number + + * Added \loadexceptproblems and \loadrandomexcept + + * substr package no longer required + Version 3.0: Rewrote package to use data sets to make it easy to reuse problems so that the solutions can be placed in a different section of the document to the questions. diff --git a/Master/texmf-dist/doc/latex/probsoln/INSTALL b/Master/texmf-dist/doc/latex/probsoln/INSTALL new file mode 100644 index 00000000000..e6d2957df13 --- /dev/null +++ b/Master/texmf-dist/doc/latex/probsoln/INSTALL @@ -0,0 +1,61 @@ +INSTALLATION + +If you have downloaded the probsoln package using the TeX Directory +Structure (TDS), that is you have downloaded an archive containing +doc, tex and source directories, you need to follow the +"Installing from TDS" instructions below. + +If you have downloaded the following files: + +probsoln.dtx +probsoln.ins + +You need to follow the "Installing from DTX and INS" instructions +below. + +For further information on installing LaTeX packages see: + +http://www.tex.ac.uk/cgi-bin/texfaq2html?label=installthings + +INSTALLING FROM TDS +=================== + +Files in tex and doc directories should go in the +corresponding TEXMF directories (for example, /usr/share/texmf-local/ +or C:\localtexmf\). + +*Remember to refresh TeX's database* + + +INSTALLING FROM DTX AND INS +=========================== + +Run LaTeX on probsoln.ins to generate the probsoln.sty and the +sample files: + +latex probsoln.ins + +To create the package documentation (probsoln.pdf): + +pdflatex probsoln.dtx +makeindex -s gind.ist probsoln.idx +pdflatex probsoln.dtx +pdflatex probsoln.dtx + +If TEXMF denotes the base directory of your local TeX installation (e.g. +/usr/share/texmf-local/ or C:\localtexmf\) then create the following +directories (if they don't already exist): + +TEXMF/doc/latex/probsoln +TEXMF/doc/latex/probsoln/samples +TEXMF/tex/latex/probsoln + +Move the sample files (*.tex) to TEXMF/doc/latex/probsoln/sample/ + +Move the documentation (*.pdf) to TEXMF/doc/latex/probsoln/ + +Move probsoln.sty to TEXMF/tex/latex/probsoln/ + + +*Remember to refresh TeX's database* + diff --git a/Master/texmf-dist/doc/latex/probsoln/README b/Master/texmf-dist/doc/latex/probsoln/README index a6da627ffdd..7eb0964cf5b 100644 --- a/Master/texmf-dist/doc/latex/probsoln/README +++ b/Master/texmf-dist/doc/latex/probsoln/README @@ -1,6 +1,6 @@ -LaTeX Package : probsoln v 3.0 +LaTeX Package : probsoln v3.01 -Last Modified : 26 Aug 2008 +Last Modified : 2011-08-22 Author : Nicola L.C. Talbot @@ -19,6 +19,11 @@ the problems can be defined along with the problem, making it easy to generate the solution sheet from the same source code. +Required packages: + +ifthen +amsmath + To extract the code do: latex probsoln.ins diff --git a/Master/texmf-dist/doc/latex/probsoln/probsoln-manual.css b/Master/texmf-dist/doc/latex/probsoln/probsoln-manual.css new file mode 100644 index 00000000000..0581f0a1a53 --- /dev/null +++ b/Master/texmf-dist/doc/latex/probsoln/probsoln-manual.css @@ -0,0 +1,217 @@ + +/* start css.sty */ +.ec-lmr-17{font-size:170%;} +.ec-lmr-12{font-size:120%;} +.ec-lmtt-12{font-size:120%; font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmtt-9{font-size:90%; font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.rm-lmr-8x-x-95{font-size:76%;} +.lmmi-8x-x-95{font-size:76%;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmr-9{font-size:90%;} +.ec-lmr-8{font-size:80%;} +p.noindent { text-indent: 0em } +td p.noindent { text-indent: 0em; margin-top:0em; } +p.nopar { text-indent: 0em; } +p.indent{ text-indent: 1.5em } +@media print {div.crosslinks {visibility:hidden;}} +a img { border-top: 0; border-left: 0; border-right: 0; } +center { margin-top:1em; margin-bottom:1em; } +td center { margin-top:0em; margin-bottom:0em; } +.Canvas { position:relative; } +img.math{vertical-align:middle;} +li p.indent { text-indent: 0em } +li p:first-child{ margin-top:0em; } +li p:last-child, li div:last-child { margin-bottom:0.5em; } +li p~ul:last-child, li p~ol:last-child{ margin-bottom:0.5em; } +.enumerate1 {list-style-type:decimal;} +.enumerate2 {list-style-type:lower-alpha;} +.enumerate3 {list-style-type:lower-roman;} +.enumerate4 {list-style-type:upper-alpha;} +div.newtheorem { margin-bottom: 2em; margin-top: 2em;} +.obeylines-h,.obeylines-v {white-space: nowrap; } +div.obeylines-v p { margin-top:0; margin-bottom:0; } +.overline{ text-decoration:overline; } +.overline img{ border-top: 1px solid black; } +td.displaylines {text-align:center; white-space:nowrap;} +.centerline {text-align:center;} +.rightline {text-align:right;} +div.verbatim {font-family: monospace; white-space: nowrap; text-align:left; clear:both; } +.fbox {padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; } +div.fbox {display:table} +div.center div.fbox {text-align:center; clear:both; padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; } +div.minipage{width:100%;} +div.center, div.center div.center {text-align: center; margin-left:1em; margin-right:1em;} +div.center div {text-align: left;} +div.flushright, div.flushright div.flushright {text-align: right;} +div.flushright div {text-align: left;} +div.flushleft {text-align: left;} +.underline{ text-decoration:underline; } +.underline img{ border-bottom: 1px solid black; margin-bottom:1pt; } +.framebox-c, .framebox-l, .framebox-r { padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; } +.framebox-c {text-align:center;} +.framebox-l {text-align:left;} +.framebox-r {text-align:right;} +span.thank-mark{ vertical-align: super } +span.footnote-mark sup.textsuperscript, span.footnote-mark a sup.textsuperscript{ font-size:80%; } +div.footnotes{border-top:solid 1px black; border-bottom:solid 1px black; padding-bottom:1ex; padding-top:0.5ex; margin-right:15%; margin-top:2ex; font-style:italic; font-size:85%;} +div.footnotes p{margin-top:0; margin-bottom:0; text-indent:0;} +div.tabular, div.center div.tabular {text-align: center; margin-top:0.5em; margin-bottom:0.5em; } +table.tabular td p{margin-top:0em;} +table.tabular {margin-left: auto; margin-right: auto;} +td p:first-child{ margin-top:0em; } +td p:last-child{ margin-bottom:0em; } +div.td00{ margin-left:0pt; margin-right:0pt; } +div.td01{ margin-left:0pt; margin-right:5pt; } +div.td10{ margin-left:5pt; margin-right:0pt; } +div.td11{ margin-left:5pt; margin-right:5pt; } +table[rules] {border-left:solid black 0.4pt; border-right:solid black 0.4pt; } +td.td00{ padding-left:0pt; padding-right:0pt; } +td.td01{ padding-left:0pt; padding-right:5pt; } +td.td10{ padding-left:5pt; padding-right:0pt; } +td.td11{ padding-left:5pt; padding-right:5pt; } +table[rules] {border-left:solid black 0.4pt; border-right:solid black 0.4pt; } +.hline hr, .cline hr{ height : 1px; margin:0px; } +.tabbing-right {text-align:right;} +span.TEX {letter-spacing: -0.125em; } +span.TEX span.E{ position:relative;top:0.5ex;left:-0.0417em;} +a span.TEX span.E {text-decoration: none; } +span.LATEX span.A{ position:relative; top:-0.5ex; left:-0.4em; font-size:85%;} +span.LATEX span.TEX{ position:relative; left: -0.4em; } +div.float, div.figure {margin-left: auto; margin-right: auto;} +div.float img {text-align:center;} +div.figure img {text-align:center;} +.marginpar {width:20%; float:right; text-align:left; margin-left:auto; margin-top:0.5em; font-size:85%; text-decoration:underline;} +.marginpar p{margin-top:0.4em; margin-bottom:0.4em;} +table.equation {width:100%;} +.equation td{text-align:center; } +td.equation { margin-top:1em; margin-bottom:1em; } +td.equation-label { width:5%; text-align:center; } +td.eqnarray4 { width:5%; white-space: normal; } +td.eqnarray2 { width:5%; } +table.eqnarray-star, table.eqnarray {width:100%;} +div.eqnarray{text-align:center;} +div.array {text-align:center;} +div.pmatrix {text-align:center;} +table.pmatrix {width:100%;} +span.pmatrix img{vertical-align:middle;} +div.pmatrix {text-align:center;} +table.pmatrix {width:100%;} +span.bar-css {text-decoration:overline;} +img.cdots{vertical-align:middle;} +.partToc a, .partToc, .likepartToc a, .likepartToc {line-height: 200%; font-weight:bold; font-size:110%;} +.index-item, .index-subitem, .index-subsubitem {display:block} +div.caption {text-indent:-2em; margin-left:3em; margin-right:1em; text-align:left;} +div.caption span.id{font-weight: bold; white-space: nowrap; } +h1.partHead{text-align: center} +p.bibitem { text-indent: -2em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; } +p.bibitem-p { text-indent: 0em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; } +.paragraphHead, .likeparagraphHead { margin-top:2em; font-weight: bold;} +.subparagraphHead, .likesubparagraphHead { font-weight: bold;} +.quote {margin-bottom:0.25em; margin-top:0.25em; margin-left:1em; margin-right:1em; text-align:justify;} +.verse{white-space:nowrap; margin-left:2em} +div.maketitle {text-align:center;} +h2.titleHead{text-align:center;} +div.maketitle{ margin-bottom: 2em; } +div.author, div.date {text-align:center;} +div.thanks{text-align:left; margin-left:10%; font-size:85%; font-style:italic; } +.quotation {margin-bottom:0.25em; margin-top:0.25em; margin-left:1em; } +.abstract p {margin-left:5%; margin-right:5%;} +div.abstract {width:100%;} +table.multicols { width:100%; margin-left:1em; margin-top:1em; margin-bottom:1em; } +.equation td{text-align:center; } +.equation-star td{text-align:center; } +table.equation-star { width:100%; } +table.equation { width:100%; } +table.align, table.alignat, table.xalignat, table.xxalignat, table.flalign {width:100%; margin-left:5%; white-space: nowrap;} +table.align-star, table.alignat-star, table.xalignat-star, table.flalign-star {margin-left:auto; margin-right:auto; white-space: nowrap;} +td.align-label { width:5%; text-align:center; } +td.align-odd { text-align:right; padding-right:0.3em;} +td.align-even { text-align:left; padding-right:0.6em;} +table.multline, table.multline-star {width:100%;} +td.gather {text-align:center; } +table.gather {width:100%;} +div.gather-star {text-align:center;} +div.important { background-color:red; } +/* end css.sty */ + diff --git a/Master/texmf-dist/doc/latex/probsoln/probsoln-manual.html b/Master/texmf-dist/doc/latex/probsoln/probsoln-manual.html index 74e787ec6b0..6f33dd7f12c 100644 --- a/Master/texmf-dist/doc/latex/probsoln/probsoln-manual.html +++ b/Master/texmf-dist/doc/latex/probsoln/probsoln-manual.html @@ -1,993 +1,2159 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> - -<!--Converted with LaTeX2HTML 2002 (1.67) -original version by: Nikos Drakos, CBLU, University of Leeds -* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan -* with significant contributions from: - Jens Lippmann, Marek Rouchal, Martin Wilck and others --> -<HTML> -<HEAD> -<TITLE>probsoln v3.0: creating problem sheets optionally with solutions</TITLE> -<META NAME="description" CONTENT="probsoln v3.0: creating problem sheets optionally with solutions"> -<META NAME="keywords" CONTENT="probsoln-manual"> -<META NAME="resource-type" CONTENT="document"> -<META NAME="distribution" CONTENT="global"> - -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> -<META NAME="Generator" CONTENT="LaTeX2HTML v2002"> -<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> - - -</HEAD> - -<BODY > -<A NAME="top"></A> - -<P> - -<P> - - <H1 ALIGN="CENTER">probsoln v3.0: creating problem sheets optionally with solutions</H1> -<P ALIGN="CENTER"><STRONG>Nicola L.C. Talbot -<BR> -<BR> -School of Computing Sciences -<BR> -University of East Anglia -<BR> -Norwich. Norfolk -<BR> -NR4 7TJ. United Kingdom. -<BR><TT><A NAME="tex2html1" - HREF="http://theoval.cmp.uea.ac.uk/~nlct/">http://theoval.cmp.uea.ac.uk/~nlct/</A></TT></STRONG></P> -<P ALIGN="CENTER"><STRONG>26th August 2008</STRONG></P> -<BR> - -<H2><A NAME="SECTION00010000000000000000"> -Contents</A> -</H2> -<!--Table of Contents--> - -<UL> -<LI><A NAME="tex2html16" - HREF="probsoln-manual.html#SECTION00020000000000000000">1 Introduction</A> -<LI><A NAME="tex2html17" - HREF="probsoln-manual.html#SECTION00030000000000000000">2 Package Options</A> -<LI><A NAME="tex2html18" - HREF="probsoln-manual.html#SECTION00040000000000000000">3 Showing and Hiding Solutions</A> -<LI><A NAME="tex2html19" - HREF="probsoln-manual.html#SECTION00050000000000000000">4 General Formatting Commands</A> -<LI><A NAME="tex2html20" - HREF="probsoln-manual.html#SECTION00060000000000000000">5 Defining a Problem</A> -<LI><A NAME="tex2html21" - HREF="probsoln-manual.html#SECTION00070000000000000000">6 Using a Problem</A> -<LI><A NAME="tex2html22" - HREF="probsoln-manual.html#SECTION00080000000000000000">7 Loading Problems From External Files</A> -<LI><A NAME="tex2html23" - HREF="probsoln-manual.html#SECTION00090000000000000000">8 Iterating Through Datasets</A> -<LI><A NAME="tex2html24" - HREF="probsoln-manual.html#SECTION000100000000000000000">9 Random Number Generator</A> -<LI><A NAME="tex2html25" - HREF="probsoln-manual.html#SECTION000110000000000000000">10 Compatibility With Versions Prior to 3.0</A> -<LI><A NAME="tex2html26" - HREF="probsoln-manual.html#SECTION000120000000000000000">Index</A> -</UL> -<!--End of Table of Contents--> -<P> - -<H1><A NAME="SECTION00020000000000000000"> -1 Introduction</A> -</H1> -The <TT>probsoln</TT> package is designed for teachers or -lecturers who want to create problem sheets for their -students. This package was designed with specifically -mathematics problems in mind, but can be used for other -subjects as well. The idea is to create a file containing a -large number of problems with their solutions which can be -read in by LaTeX, and then select a number of problems to -typeset. This means that once the database has been set up, -each year you can easily create a new problem sheet that is -sufficiently different from the previous year, thus -preventing the temptation of current students seeking out -the previous year's students, and checking out their -answers. There is also an option that can be passed to the -package to determine whether or not the solutions should be -printed. In this way, one file can either produce the -student's version or the teacher's version. - -<P> -<A HREF="probsoln-manual.html#top">Top</A> - -<P> - -<H1><A NAME="SECTION00030000000000000000"></A><A NAME="sec:pkgopt"></A> -<BR> -2 Package Options -</H1> -The following options may be passed to this package: -<DL> -<DT><STRONG><TT>answers</TT><A NAME="673"></A></STRONG></DT> -<DD>Show the answers -</DD> -<DT><STRONG><TT>noanswers</TT><A NAME="676"></A></STRONG></DT> -<DD>Don't show the answers (default) -</DD> -<DT><STRONG><TT>draft</TT><A NAME="679"></A></STRONG></DT> -<DD>Display the label and dataset name when a problem is used -</DD> -<DT><STRONG><TT>final</TT><A NAME="682"></A></STRONG></DT> -<DD>Don't display label and dataset name when a problem is used -</DD> -</DL> - -<P> -<A HREF="probsoln-manual.html#top">Top</A> - -<P> - -<H1><A NAME="SECTION00040000000000000000"></A><A NAME="sec:showanswers"></A> -<BR> -3 Showing and Hiding Solutions -</H1> - -<P> -In addition to the <TT>answers</TT><A NAME="688"></A> and <TT>noanswers</TT><A NAME="691"></A> package -options, it is also possible to show or suppress the solutions -using <TT>\showanswers</TT> and -<TT>\hideanswers</TT>, respectively. -The boolean variable <TT>showanswers</TT><A NAME="694"></A> determines whether the -answers should be displayed. You can use this value with the -<TT>ifthen</TT><A NAME="697"></A> package to specify different text depending on -whether the solutions should be displayed. For example: -<PRE> -Assignment 1\ifthenelse{\boolean{showanswers}}{ (Solution Sheet)}{} -</PRE> -Alternatively you can use <TT>\ifshowanswers</TT><A NAME="700"></A>...<TT>\else</TT>... -<TT>\fi</TT>: -<PRE> -Assignment 1\ifshowanswers\space (Solution Sheet)\fi -</PRE> - -<P> -For longer passages, you can use the environments <A NAME="1547"></A><TT>onlyproblem</TT> -and <A NAME="1551"></A><TT>onlysolution</TT>. For example: -<PRE> +<a + id="top"></a><?xml version="1.0" encoding="iso-8859-1" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<!--http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd--> +<html xmlns="http://www.w3.org/1999/xhtml" +> +<head><title>probsoln v3.01: creating problem sheets optionally with solutions</title> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> +<meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)" /> +<meta name="originator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)" /> +<!-- xhtml,fn-in,css-in --> +<meta name="src" content="probsoln-manual.tex" /> +<meta name="date" content="2011-08-22 22:11:00" /> + +<style type="text/css"> +<!-- + +/* start css.sty */ +.ec-lmr-17{font-size:170%;} +.ec-lmr-12{font-size:120%;} +.ec-lmtt-12{font-size:120%; font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-12{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmtt-10{ font-family: monospace;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmss-10{ font-family: sans-serif;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmssbx-10{ font-family: sans-serif; font-weight: bold;} +.ec-lmtt-9{font-size:90%; font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.ec-lmtt-9{ font-family: monospace;} +.rm-lmr-8x-x-95{font-size:76%;} +.lmmi-8x-x-95{font-size:76%;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmr-9{font-size:90%;} +.ec-lmr-8{font-size:80%;} +p.noindent { text-indent: 0em } +td p.noindent { text-indent: 0em; margin-top:0em; } +p.nopar { text-indent: 0em; } +p.indent{ text-indent: 1.5em } +@media print {div.crosslinks {visibility:hidden;}} +a img { border-top: 0; border-left: 0; border-right: 0; } +center { margin-top:1em; margin-bottom:1em; } +td center { margin-top:0em; margin-bottom:0em; } +.Canvas { position:relative; } +img.math{vertical-align:middle;} +li p.indent { text-indent: 0em } +li p:first-child{ margin-top:0em; } +li p:last-child, li div:last-child { margin-bottom:0.5em; } +li p~ul:last-child, li p~ol:last-child{ margin-bottom:0.5em; } +.enumerate1 {list-style-type:decimal;} +.enumerate2 {list-style-type:lower-alpha;} +.enumerate3 {list-style-type:lower-roman;} +.enumerate4 {list-style-type:upper-alpha;} +div.newtheorem { margin-bottom: 2em; margin-top: 2em;} +.obeylines-h,.obeylines-v {white-space: nowrap; } +div.obeylines-v p { margin-top:0; margin-bottom:0; } +.overline{ text-decoration:overline; } +.overline img{ border-top: 1px solid black; } +td.displaylines {text-align:center; white-space:nowrap;} +.centerline {text-align:center;} +.rightline {text-align:right;} +div.verbatim {font-family: monospace; white-space: nowrap; text-align:left; clear:both; } +.fbox {padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; } +div.fbox {display:table} +div.center div.fbox {text-align:center; clear:both; padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; } +div.minipage{width:100%;} +div.center, div.center div.center {text-align: center; margin-left:1em; margin-right:1em;} +div.center div {text-align: left;} +div.flushright, div.flushright div.flushright {text-align: right;} +div.flushright div {text-align: left;} +div.flushleft {text-align: left;} +.underline{ text-decoration:underline; } +.underline img{ border-bottom: 1px solid black; margin-bottom:1pt; } +.framebox-c, .framebox-l, .framebox-r { padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; } +.framebox-c {text-align:center;} +.framebox-l {text-align:left;} +.framebox-r {text-align:right;} +span.thank-mark{ vertical-align: super } +span.footnote-mark sup.textsuperscript, span.footnote-mark a sup.textsuperscript{ font-size:80%; } +div.footnotes{border-top:solid 1px black; border-bottom:solid 1px black; padding-bottom:1ex; padding-top:0.5ex; margin-right:15%; margin-top:2ex; font-style:italic; font-size:85%;} +div.footnotes p{margin-top:0; margin-bottom:0; text-indent:0;} +div.tabular, div.center div.tabular {text-align: center; margin-top:0.5em; margin-bottom:0.5em; } +table.tabular td p{margin-top:0em;} +table.tabular {margin-left: auto; margin-right: auto;} +td p:first-child{ margin-top:0em; } +td p:last-child{ margin-bottom:0em; } +div.td00{ margin-left:0pt; margin-right:0pt; } +div.td01{ margin-left:0pt; margin-right:5pt; } +div.td10{ margin-left:5pt; margin-right:0pt; } +div.td11{ margin-left:5pt; margin-right:5pt; } +table[rules] {border-left:solid black 0.4pt; border-right:solid black 0.4pt; } +td.td00{ padding-left:0pt; padding-right:0pt; } +td.td01{ padding-left:0pt; padding-right:5pt; } +td.td10{ padding-left:5pt; padding-right:0pt; } +td.td11{ padding-left:5pt; padding-right:5pt; } +table[rules] {border-left:solid black 0.4pt; border-right:solid black 0.4pt; } +.hline hr, .cline hr{ height : 1px; margin:0px; } +.tabbing-right {text-align:right;} +span.TEX {letter-spacing: -0.125em; } +span.TEX span.E{ position:relative;top:0.5ex;left:-0.0417em;} +a span.TEX span.E {text-decoration: none; } +span.LATEX span.A{ position:relative; top:-0.5ex; left:-0.4em; font-size:85%;} +span.LATEX span.TEX{ position:relative; left: -0.4em; } +div.float, div.figure {margin-left: auto; margin-right: auto;} +div.float img {text-align:center;} +div.figure img {text-align:center;} +.marginpar {width:20%; float:right; text-align:left; margin-left:auto; margin-top:0.5em; font-size:85%; text-decoration:underline;} +.marginpar p{margin-top:0.4em; margin-bottom:0.4em;} +table.equation {width:100%;} +.equation td{text-align:center; } +td.equation { margin-top:1em; margin-bottom:1em; } +td.equation-label { width:5%; text-align:center; } +td.eqnarray4 { width:5%; white-space: normal; } +td.eqnarray2 { width:5%; } +table.eqnarray-star, table.eqnarray {width:100%;} +div.eqnarray{text-align:center;} +div.array {text-align:center;} +div.pmatrix {text-align:center;} +table.pmatrix {width:100%;} +span.pmatrix img{vertical-align:middle;} +div.pmatrix {text-align:center;} +table.pmatrix {width:100%;} +span.bar-css {text-decoration:overline;} +img.cdots{vertical-align:middle;} +.partToc a, .partToc, .likepartToc a, .likepartToc {line-height: 200%; font-weight:bold; font-size:110%;} +.index-item, .index-subitem, .index-subsubitem {display:block} +div.caption {text-indent:-2em; margin-left:3em; margin-right:1em; text-align:left;} +div.caption span.id{font-weight: bold; white-space: nowrap; } +h1.partHead{text-align: center} +p.bibitem { text-indent: -2em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; } +p.bibitem-p { text-indent: 0em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; } +.paragraphHead, .likeparagraphHead { margin-top:2em; font-weight: bold;} +.subparagraphHead, .likesubparagraphHead { font-weight: bold;} +.quote {margin-bottom:0.25em; margin-top:0.25em; margin-left:1em; margin-right:1em; text-align:justify;} +.verse{white-space:nowrap; margin-left:2em} +div.maketitle {text-align:center;} +h2.titleHead{text-align:center;} +div.maketitle{ margin-bottom: 2em; } +div.author, div.date {text-align:center;} +div.thanks{text-align:left; margin-left:10%; font-size:85%; font-style:italic; } +.quotation {margin-bottom:0.25em; margin-top:0.25em; margin-left:1em; } +.abstract p {margin-left:5%; margin-right:5%;} +div.abstract {width:100%;} +table.multicols { width:100%; margin-left:1em; margin-top:1em; margin-bottom:1em; } +.equation td{text-align:center; } +.equation-star td{text-align:center; } +table.equation-star { width:100%; } +table.equation { width:100%; } +table.align, table.alignat, table.xalignat, table.xxalignat, table.flalign {width:100%; margin-left:5%; white-space: nowrap;} +table.align-star, table.alignat-star, table.xalignat-star, table.flalign-star {margin-left:auto; margin-right:auto; white-space: nowrap;} +td.align-label { width:5%; text-align:center; } +td.align-odd { text-align:right; padding-right:0.3em;} +td.align-even { text-align:left; padding-right:0.6em;} +table.multline, table.multline-star {width:100%;} +td.gather {text-align:center; } +table.gather {width:100%;} +div.gather-star {text-align:center;} +div.important { background-color:red; } +/* end css.sty */ + + +--> +</style> +</head><body +> + <div class="maketitle"> + + + + + + + +<h2 class="titleHead">probsoln v3.01: creating problem sheets optionally +with solutions</h2> + <div class="author" ><span +class="ec-lmr-12">Nicola L.C. Talbot</span> +<br /> <span +class="ec-lmr-12">School of Computing Sciences</span> +<br /> <span +class="ec-lmr-12">University of East Anglia</span> +<br /> <span +class="ec-lmr-12">Norwich. Norfolk</span> +<br /> <span +class="ec-lmr-12">NR4 7TJ. United Kingdom.</span> +<br /><a +href="http://theoval.cmp.uea.ac.uk/~nlct/" class="url" ><span +class="ec-lmtt-12">http://theoval.cmp.uea.ac.uk/~nlct/</span></a></div><br /> +<div class="date" ><span +class="ec-lmr-12">2011-08-22</span></div> + </div> + <h3 class="likesectionHead"><a + id="x1-1000"></a>Contents</h3> + <div class="tableofcontents"> + <span class="sectionToc" >1 <a +href="#x1-20001" id="QQ2-1-2">Introduction</a></span> +<br /> <span class="sectionToc" >2 <a +href="#x1-30002" id="QQ2-1-3">Package Options</a></span> +<br /> <span class="sectionToc" >3 <a +href="#x1-40003" id="QQ2-1-4">Showing and Hiding Solutions</a></span> +<br /> <span class="sectionToc" >4 <a +href="#x1-50004" id="QQ2-1-5">General Formatting Commands</a></span> +<br /> <span class="sectionToc" >5 <a +href="#x1-60005" id="QQ2-1-6">Defining a Problem</a></span> +<br /> <span class="sectionToc" >6 <a +href="#x1-70006" id="QQ2-1-7">Using a Problem</a></span> +<br /> <span class="sectionToc" >7 <a +href="#x1-80007" id="QQ2-1-8">Loading Problems From External Files</a></span> +<br /> <span class="sectionToc" >8 <a +href="#x1-90008" id="QQ2-1-9">Iterating Through Datasets</a></span> +<br /> <span class="sectionToc" >9 <a +href="#x1-100009" id="QQ2-1-10">Random Number Generator</a></span> +<br /> <span class="sectionToc" >10 <a +href="#x1-1100010" id="QQ2-1-11">Compatibility With Versions Prior to 3.0</a></span> +<br /> <span class="sectionToc" ><a +href="#Q1-1-12">Index</a></span> + </div> +<!--l. 40--><p class="noindent" > +</p> + <h3 class="sectionHead"><span class="titlemark">1 </span> <a + id="x1-20001"></a>Introduction</h3> +<!--l. 41--><p class="noindent" >The <span +class="ec-lmss-10">probsoln </span>package is designed for teachers or lecturers who want to create problem +sheets for their students. This package was designed with mathematics problems in +mind, but can be used for other subjects as well. The idea is to create a file +containing a large number of problems with their solutions which can be read in +by <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span +class="E">E</span>X</span></span>, and then select a number of problems to typeset. This means + + + +that once the database has been set up, each year you can easily create a new +problem sheet that is sufficiently different from the previous year, thus preventing +the temptation of current students seeking out the previous year’s students, +and checking out their answers. There is also an option that can be passed to +the package to determine whether or not the solutions should be printed. In +this way, one file can either produce the student’s version or the teacher’s +version. +</p><!--l. 56--><p class="noindent" > +</p> +<!--l. 56--><p class="noindent" ><a +href="#top">Top</a></p><h3 class="sectionHead"><span class="titlemark">2 </span> <a + id="x1-30002"></a>Package Options</h3> +<!--l. 57--><p class="noindent" >The following options may be passed to this package: + </p><dl class="description"><dt class="description"> +<span +class="ec-lmssbx-10">answers</span><a + id="dx1-3001"></a> </dt><dd +class="description">Show the answers + </dd><dt class="description"> +<span +class="ec-lmssbx-10">noanswers</span><a + id="dx1-3002"></a> </dt><dd +class="description">Don’t show the answers (default) + </dd><dt class="description"> +<span +class="ec-lmssbx-10">draft</span><a + id="dx1-3003"></a> </dt><dd +class="description">Display the label and dataset name when a problem is used + </dd><dt class="description"> +<span +class="ec-lmssbx-10">final</span><a + id="dx1-3004"></a> </dt><dd +class="description">Don’t display label and dataset name when a problem is used + </dd><dt class="description"> +<span +class="ec-lmssbx-10">usedefaultargs</span><a + id="dx1-3005"></a> </dt><dd +class="description">Make <span +class="ec-lmtt-10">\thisproblem</span><a + id="dx1-3006"></a> use the default arguments supplied in the + problem definition. + </dd><dt class="description"> +<span +class="ec-lmssbx-10">nousedefaultargs</span><a + id="dx1-3007"></a> </dt><dd +class="description">Make <span +class="ec-lmtt-10">\thisproblem</span><a + id="dx1-3008"></a> prompt for problem arguments (default).</dd></dl> +<!--l. 69--><p class="noindent" > +</p> +<!--l. 69--><p class="noindent" ><a +href="#top">Top</a></p><h3 class="sectionHead"><span class="titlemark">3 </span> <a + id="x1-40003"></a>Showing and Hiding Solutions</h3> +<!--l. 71--><p class="noindent" >In addition to the <span +class="ec-lmss-10">answers</span><a + id="dx1-4001"></a> and <span +class="ec-lmss-10">noanswers</span><a + id="dx1-4002"></a> package options, it is also possible to show or +suppress the solutions using +</p><!--l. 74--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\showanswers</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-4003"></a> <span +class="ec-lmtt-10">\showanswers </span></div><hr> +</p><!--l. 76--><p class="noindent" > +and +</p><!--l. 78--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\hideanswers</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-4004"></a> <span +class="ec-lmtt-10">\hideanswers </span></div><hr> +</p><!--l. 80--><p class="noindent" > +respectively. +</p><!--l. 83--><p class="indent" > The boolean variable <span +class="ec-lmss-10">showanswers</span><a + id="dx1-4005"></a> determines whether the answers should be +displayed. You can use this value with the <span +class="ec-lmss-10">ifthen</span><a + id="dx1-4006"></a> package to specify different text +depending on whether the solutions should be displayed. For example: + + + +</p> + <div class="verbatim" id="verbatim-1"> +Assignment 1\ifthenelse{\boolean{showanswers}}{ (Solution Sheet)}{} +</div> +<!--l. 89--><p class="nopar" > Alternatively you can use <span +class="ec-lmtt-10">\ifshowanswers</span><a + id="dx1-4007"></a>…<span +class="ec-lmtt-10">\else</span>…<span +class="ec-lmtt-10">\fi</span>: + + + +</p> + <div class="verbatim" id="verbatim-2"> +Assignment 1\ifshowanswers\space (Solution Sheet)\fi +</div> +<!--l. 94--><p class="nopar" > +</p><!--l. 96--><p class="indent" > For longer passages, you can use the environments <span class="marginpar"><span +class="ec-lmtt-9">onlyproblem</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-4008"></a><a + id="dx1-4009"></a><span +class="ec-lmss-10">onlyproblem</span><a + id="dx1-4010"></a><a + id="dx1-4011"></a> and +<span class="marginpar"><span +class="ec-lmtt-9">onlysolution</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-4012"></a><a + id="dx1-4013"></a><span +class="ec-lmss-10">onlysolution</span><a + id="dx1-4014"></a><a + id="dx1-4015"></a>. For example: + + + +</p> + <div class="verbatim" id="verbatim-3"> \begin{onlyproblem}% -What is the derivative of $f(x) = x^2$? -\end{onlyproblem}% -\begin{onlysolution}% -$f'(x) = 2x$ -\end{onlysolution} -</PRE> -The above will only display the question if <TT>showanswers</TT><A NAME="705"></A> -is false and will only display the solution if <TT>showanswers</TT><A NAME="708"></A> -is true. If you want the question to appear in the answer -sheet as well as the solution, then don't put the question in -the <TT>onlyproblem</TT> environment: -<PRE> -What is the derivative of $f(x) = x^2$? -\begin{onlysolution}% -Solution: $f'(x) = 2x$ -\end{onlysolution} -</PRE> -<B>NOTE:</B> You can't use verbatim text in the body of the -<TT>onlyproblem</TT><A NAME="712"></A> or <TT>onlysolution</TT><A NAME="715"></A> environments. -If you need verbatim-like text, then try packages such as -<TT>alltt</TT><A NAME="718"></A>. Remember that you also can't use verbatim -text in command arguments. - -<P> -<A HREF="probsoln-manual.html#top">Top</A> - -<P> - -<H1><A NAME="SECTION00050000000000000000"></A><A NAME="sec:formatting"></A> -<BR> -4 General Formatting Commands -</H1> - -<P> -The commands and environments described in this section are -provided to assist formatting problems and their solutions. -<A NAME="1556"></A> -<BR CLEAR="ALL"> -<HR><code>\begin{solution}</code><I>text</I><code>\end{solution}</code> -<BR CLEAR="ALL"> -<HR>This is equivalent to -<code>\par\noindent\textbf{\solutionname}:</code><I>text</I> -where <TT>\solutionname</TT> defaults -to "Solution". Note that you must place the <TT>solution</TT> -environment inside the <TT>onlysolution</TT><A NAME="725"></A> environment or -between <TT>\ifshowanswers</TT><A NAME="728"></A>...<TT>\fi</TT> to ensure that it -is suppressed when the solutions are not wanted. (See -<A HREF="probsoln-manual.html#sec:showanswers">Showing and -Hiding Solutions</A>.) - -<P> -Note that the <TT>probsoln</TT> package will only define the -<TT>solution</TT> environment if it is not already defined. - -<P> -<A NAME="1560"></A> -<BR CLEAR="ALL"> -<HR><code>\begin{textenum}</code>...<code>\end{textenum}</code> -<BR CLEAR="ALL"> -<HR>The <TT>textenum</TT> environment is like the <TT>enumerate</TT><A NAME="734"></A> -environment but is in-line. It uses the same counter that the -<TT>enumerate</TT> environment would use at that level so the -question can be compact but the answer can use <TT>enumerate</TT> -instead. For example: -<PRE> + <br />What is the derivative of $f(x) = x^2$? + <br />\end{onlyproblem}% + <br />\begin{onlysolution}% + <br />$f’(x) = 2x$ + <br />\end{onlysolution} +</div> +<!--l. 105--><p class="nopar" > The above will only display the question if <span +class="ec-lmss-10">showanswers</span><a + id="dx1-4016"></a> is false and will only display +the solution if <span +class="ec-lmss-10">showanswers</span><a + id="dx1-4017"></a> is true. If you want the question to appear in the answer +sheet as well as the solution, then don’t put the question in the <span +class="ec-lmss-10">onlyproblem</span><a + id="dx1-4018"></a><a + id="dx1-4019"></a> +environment: + + + +</p> + <div class="verbatim" id="verbatim-4"> +What is the derivative of $f(x) = x^2$? + <br />\begin{onlysolution}% + <br />Solution: $f’(x) = 2x$ + <br />\end{onlysolution} +</div> +<!--l. 116--><p class="nopar" > +</p><!--l. 117--><p class="indent" > <div class="important" title="Important Note"> You can’t use verbatim text in the body of the <span +class="ec-lmss-10">onlyproblem </span>or <span +class="ec-lmss-10">onlysolution</span> +environments. If you need verbatim-like text, then try packages such as <span +class="ec-lmss-10">alltt</span><a + id="dx1-4020"></a>. Remember +that you also can’t use verbatim text in command arguments. </div> +</p><!--l. 123--><p class="noindent" > +</p><!--l. 125--><p class="indent" > If you use <span +class="ec-lmss-10">onlysolution </span>within the <span +class="ec-lmss-10">defproblem</span><a + id="dx1-4021"></a><a + id="dx1-4022"></a> environment, the problem will be +tagged as having a solution and will be added to the list used by <span +class="ec-lmtt-10">\foreachsolution</span><a + id="dx1-4023"></a>. +</p><!--l. 129--><p class="noindent" > +</p> +<!--l. 129--><p class="noindent" ><a +href="#top">Top</a></p><h3 class="sectionHead"><span class="titlemark">4 </span> <a + id="x1-50004"></a>General Formatting Commands</h3> +<!--l. 131--><p class="noindent" >The commands and environments described in this section are provided to assist +formatting problems and their solutions. +</p><!--l. 133--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">solution</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-5001"></a><a + id="dx1-5002"></a> <span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\begin{solution}</span></span></span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">text</span><span +class="lmsy-10">⟩</span><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\end{solution}</span></span></span> </div><hr> +</p><!--l. 135--><p class="noindent" > +By default, this is equivalent to <spacer type=vertical size=10><span class="obeylines-h"> + <br /><span class="verb"><span +class="ec-lmtt-10">\par\noindent\textbf{\solutionname}:</span><span +class="ec-lmtt-10"> </span></span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">text</span><span +class="lmsy-10">⟩</span> + <br /><spacer type=vertical size=10></span> +where <span class="marginpar"><span +class="ec-lmtt-9">\solutionname</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-5003"></a><span +class="ec-lmtt-10">\solutionname </span>defaults to “Solution”. Note that you must +place the <span +class="ec-lmss-10">solution</span><a + id="dx1-5004"></a><a + id="dx1-5005"></a> environment inside the <span +class="ec-lmss-10">onlysolution </span>environment or between +<span +class="ec-lmtt-10">\ifshowanswers</span><a + id="dx1-5006"></a>…<span +class="ec-lmtt-10">\fi </span>to ensure that it is suppressed when the solutions are not wanted. +(See <a +href="#x1-40003">§3 </a><a +href="#x1-40003">Showing and Hiding Solutions<!--tex4ht:ref: sec:showanswers --></a>.) +</p><!--l. 148--><p class="indent" > Note that the <span +class="ec-lmss-10">probsoln </span>package will only define the <span +class="ec-lmss-10">solution</span><a + id="dx1-5007"></a><a + id="dx1-5008"></a> environment if it is not +already defined. +</p><!--l. 151--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">textenum</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-5009"></a><a + id="dx1-5010"></a> <span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\begin{textenum}</span></span></span><span +class="ec-lmtt-10">…</span><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\end{textenum}</span></span></span> </div><hr> +</p><!--l. 153--><p class="noindent" > +The <span +class="ec-lmss-10">textenum </span>environment is like the <span +class="ec-lmss-10">enumerate</span><a + id="dx1-5011"></a><a + id="dx1-5012"></a> environment but is in-line. It uses +the same counter that the <span +class="ec-lmss-10">enumerate </span>environment would use at that level so +the question can be compact but the answer can use <span +class="ec-lmss-10">enumerate </span>instead. For +example: + + + +</p> + <div class="verbatim" id="verbatim-5"> \begin{onlyproblem}% -Differentiate the following: -\begin{textenum} -\item $f(x)=2^x$; -\item $f(x)=\cot(x)$ -\end{textenum} -\end{onlyproblem} -\begin{onlysolution} -\begin{enumerate} -\item -\begin{align*} -f(x) &= 2^x = \exp(\ln(x^2)) =\exp(2\ln(x))\\ -f'(x) &= \exp(2\ln(x))\times \frac{2}{x}\\ - &= f(x)\frac{2}{x} -\end{align*} -\item -\begin{align*} -f(x) &= \cot(x) = (\tan(x))^{-2}\\ -f'(x) &= -(\tan(x))^{-2}\times\sec^2(x)\\ -&=-\csc^2x -\end{align*} -\end{enumerate} -\end{onlysolution} -</PRE> -In this example, the items in the question are brief, so an -<TT>enumerate</TT><A NAME="739"></A> environment would result in a lot of -unnecessary white space, -but the answers require more space, so an <TT>enumerate</TT> -environment is more appropriate. Since the <TT>textenum</TT><A NAME="743"></A> -environment uses the same counters as the <TT>enumerate</TT> -environment, the question and answer sheets use consistent -labelling. Note that there are other packages available on -CTAN that you can use to create in-line lists. Check the -<A NAME="tex2html2" - HREF="http://www.tex.ac.uk/tex-archive/help/Catalogue/bytopic.html#enumeration">TeX -Catalogue</A> for -further details. - -<P> - -<BR CLEAR="ALL"> -<HR><TT>\correctitem</TT><A NAME="747"></A> -<BR><TT>\incorrectitem</TT><A NAME="750"></A> -<BR CLEAR="ALL"> -<HR>You can use the commands <TT>\correctitem</TT> and <TT>\incorrectitem</TT> -in place of <TT>\item</TT><A NAME="753"></A>. If the solutions are suppressed, these -commands behave in the same way as <TT>\item</TT>, otherwise they -format the item label using one of the commands: - -<BR CLEAR="ALL"> -<HR><TT>\correctitemformat</TT><A NAME="756"></A><TT>{</TT><EM>label</EM><TT>}</TT> -<BR><TT>\incorrectitemformat</TT><A NAME="759"></A><TT>{</TT><EM>label</EM><TT>}</TT> -<BR CLEAR="ALL"> -<HR>For example: -<PRE> -Under which of the following functions does $S=\{a_1,a_2\}$ -become a probability space? -\begin{enumerate} -\incorrectitem $P(a_1)=\frac{1}{3}$, $P(a_2)=\frac{1}{2}$ -\correctitem $P(a_1)=\frac{3}{4}$, $P(a_2)=\frac{1}{4}$ -\correctitem $P(a_1)=1$, $P(a_2)=0$ -\incorrectitem $P(a_1)=\frac{5}{4}$, $P(a_2)=-\frac{1}{4}$ -\end{enumerate} -</PRE> - -<P> -<A HREF="probsoln-manual.html#top">Top</A> - -<P> - -<H1><A NAME="SECTION00060000000000000000"></A><A NAME="sec:defproblem"></A> -<BR> -5 Defining a Problem -</H1> - -<P> -It is possible to construct a problem sheet with solutions using -the commands described in the previous sections, however it is -also possible to define a set of problems for later use. In this -way you can create an external file containing many problems some -or all of which can be loaded and used in a document. The -<TT>probsoln</TT> package has a default data set labelled -"default" in which you can store problems or you can create -multiple data sets. You can then iterate through each problem -in a problem set. You can use a previously defined problem more -than once, which means that by judicious use of <TT>onlyproblem</TT><A NAME="766"></A>, -<TT>onlysolution</TT><A NAME="769"></A> or the <TT>showanswers</TT><A NAME="772"></A> boolean variable -in conjunction with <TT>\showanswers</TT><A NAME="775"></A> and <TT>\hideanswers</TT><A NAME="778"></A>, -you can print the solutions in a different location to the -questions (for example in an appendix). - -<P> -<A NAME="1565"></A> -<BR CLEAR="ALL"> -<HR><code>\begin{defproblem}</code><TT>[</TT><EM>n</EM><TT>]{</TT><EM>label</EM><TT>}</TT><I>definition</I><code>\end{defproblem}</code> -<BR CLEAR="ALL"> -<HR>This defines the problem whose label is given by <I>label</I>. -The label must be unique for a given data set and should not -contain active characters. (Active characters include the special -characters such as $ and &, but some packages may make other -symbols active. For example, the <TT>ngerman</TT><A NAME="781"></A> and <TT>babel</TT><A NAME="784"></A> -packages make certain punctuation active. Check the relevant -package documentation for details.) - -<P> -If <TT>defproblem</TT> occurs in the document or is included via -<TT>\input</TT> or <TT>\include</TT>, then the problem will be added to -the default data set. If <TT>defproblem</TT> occurs in an external -file that is loaded using one of the commands defined in -<A HREF="probsoln-manual.html#sec:load">Loading Problems From -External Files</A> then the problem will be added to -the specified data set. - -<P> -The contents of the <TT>defproblem</TT> environment should be the -text that defines the problem. This may include any of the -commands defined in -<A HREF="probsoln-manual.html#sec:showanswers">Showing and Hiding -Solutions</A> and <A HREF="probsoln-manual.html#sec:formatting">General Formatting -Commands</A>. - -<P> -The problem may optionally take <I>n</I> arguments (where -<I>n</I> is from 0 to 9). The arguments can be referenced -in the definition via <TT>#1</TT>,...,<TT>#9</TT>. -If <I>n</I> is omitted then the problem doesn't take any -arguments. -The following example defines a problem with one argument: -<PRE> -\begin{defproblem}[1]{diffsin} -Differentiate $f(x)=\sin(#1x)$. -\begin{onlysolution}% -\begin{solution} -$f'(x) = #1\cos(#1x)$ -\end{solution} -\end{onlysolution} -\end{defproblem} -</PRE> - -<P> - -<BR CLEAR="ALL"> -<HR><TT>\newproblem</TT><A NAME="790"></A><TT>[</TT><EM>n</EM><TT>]{</TT><EM>label</EM><TT>}{</TT><EM>problem</EM><TT>}{</TT><EM>solution</EM><TT>}</TT> -<BR CLEAR="ALL"> -<HR>This is a shortcut command for: -<TT> -<TT>\begin</TT>{defproblem}<TT>[</TT><EM>n</EM><TT>]{</TT><EM>label</EM><TT>}</TT>% -<I>problem</I>% -<TT>\begin</TT>{onlysolution}% -<TT>\begin</TT>{solution}% -<I>solution</I>% -<TT>\end</TT>{solution}% -<TT>\end</TT>{onlysolution}% -<TT>\end</TT>{defproblem} -</TT> + <br />  Differentiate the following: + <br />  \begin{textenum} + <br />    \item $f(x)=2^x$; \item $f(x)=\cot(x)$ + <br />  \end{textenum} + <br />\end{onlyproblem} + <br />\begin{onlysolution} + <br />  \begin{enumerate} + <br />  \item + <br />    \begin{align*} + <br />    f(x) &= 2^x = \exp(\ln(x^2)) =\exp(2\ln(x))\\ + <br />    f’(x) &= \exp(2\ln(x))\times \frac{2}{x}\\ + <br />      &= f(x)\frac{2}{x} + <br />    \end{align*} + <br />  \item + <br />    \begin{align*} + <br />    f(x) &= \cot(x) = (\tan(x))^{-2}\\ + <br />    f’(x) &= -(\tan(x))^{-2}\times\sec^2(x)\\ + <br />    &=-\csc^2x + <br />    \end{align*} + <br />  \end{enumerate} + <br />\end{onlysolution} +</div> +<!--l. 182--><p class="nopar" > In this example, the items in the question are brief, so an <span +class="ec-lmss-10">enumerate</span><a + id="dx1-5013"></a><a + id="dx1-5014"></a> environment +would result in a lot of unnecessary white space, but the answers require more space, so +an <span +class="ec-lmss-10">enumerate </span>environment is more appropriate. Since the <span +class="ec-lmss-10">textenum </span>environment uses +the same counters as the <span +class="ec-lmss-10">enumerate </span>environment, the question and answer sheets use +consistent labelling. Note that there are other packages available on CTAN +that you can use to create in-line lists. Check the <a +href="http://www.tex.ac.uk/tex-archive/help/Catalogue/bytopic.html#enumeration" >TeX Catalogue</a> for further +details. +</p><!--l. 194--><p class="indent" > <span class="marginpar"><span +class="ec-lmtt-9">\correctitem</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-5015"></a><span class="marginpar"><span +class="ec-lmtt-9">\incorrectitem</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-5016"></a> +</p><!--l. 196--><p class="indent" > <hr><div title="Definition"><span +class="ec-lmtt-10">\correctitem</span><br +class="newline" /><span +class="ec-lmtt-10">\incorrectitem </span></div><hr> +</p><!--l. 198--><p class="noindent" > +You can use the commands <span +class="ec-lmtt-10">\correctitem </span>and <span +class="ec-lmtt-10">\incorrectitem </span>in place of +<span +class="ec-lmtt-10">\item</span><a + id="dx1-5017"></a>. If the solutions are suppressed, these commands behave in the same way +as <span +class="ec-lmtt-10">\item</span>, otherwise they format the item label using one of the commands: +<span class="marginpar"><span +class="ec-lmtt-9">\correctitemformat</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-5018"></a><span class="marginpar"><span +class="ec-lmtt-9">\incorrectitemformat</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-5019"></a> +</p><!--l. 205--><p class="indent" > <hr><div title="Definition"><span +class="ec-lmtt-10">\correctitemformat{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">label</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}</span><br +class="newline" /><span +class="ec-lmtt-10">\incorrectitemformat{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">label</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">} </span></div><hr> +</p><!--l. 207--><p class="noindent" > For example: -<PRE> + + + +</p> + <div class="verbatim" id="verbatim-6"> +Under which of the following functions does $S=\{a_1,a_2\}$ + <br />become a probability space? + <br />\begin{enumerate} + <br />\incorrectitem $P(a_1)=\frac{1}{3}$, $P(a_2)=\frac{1}{2}$ + <br />\correctitem $P(a_1)=\frac{3}{4}$, $P(a_2)=\frac{1}{4}$ + <br />\correctitem $P(a_1)=1$, $P(a_2)=0$ + <br />\incorrectitem $P(a_1)=\frac{5}{4}$, $P(a_2)=-\frac{1}{4}$ + <br />\end{enumerate} +</div> +<!--l. 218--><p class="nopar" > The default definition of <span +class="ec-lmtt-10">\correctitemformat </span>puts a frame around the label. +</p><!--l. 222--><p class="noindent" > +</p> +<!--l. 222--><p class="noindent" ><a +href="#top">Top</a></p><h3 class="sectionHead"><span class="titlemark">5 </span> <a + id="x1-60005"></a>Defining a Problem</h3> +<!--l. 224--><p class="noindent" >It is possible to construct a problem sheet with solutions using the commands described +in the previous sections, however it is also possible to define a set of problems for later +use. In this way you can create an external file containing many problems some or all of +which can be loaded and used in a document. The <span +class="ec-lmss-10">probsoln </span>package has a default data +set labelled “default” in which you can store problems. Alternatively, you can +create multiple data sets. You can then iterate through each problem in a +problem set. You can use a previously defined problem more than once, which +means that by judicious use of <span +class="ec-lmss-10">onlyproblem</span><a + id="dx1-6001"></a><a + id="dx1-6002"></a>, <span +class="ec-lmss-10">onlysolution</span><a + id="dx1-6003"></a><a + id="dx1-6004"></a> or the <span +class="ec-lmss-10">showanswers</span><a + id="dx1-6005"></a> +boolean variable in conjunction with <span +class="ec-lmtt-10">\showanswers</span><a + id="dx1-6006"></a> and <span +class="ec-lmtt-10">\hideanswers</span><a + id="dx1-6007"></a>, you can +print the solutions in a different location to the questions (for example in an +appendix). +</p><!--l. 239--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">defproblem</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-6008"></a><a + id="dx1-6009"></a> <span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\begin{defproblem}</span></span></span><span +class="ec-lmtt-10">[</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">][</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">default args</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">]{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">label</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}</span><br +class="newline" /><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">definition</span><span +class="lmsy-10">⟩</span><br +class="newline" /><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\end{defproblem}</span></span></span> </div><hr> +</p><!--l. 243--><p class="noindent" > +This defines the problem whose label is given by <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">label</span><span +class="lmsy-10">⟩</span>. The label must be unique for a +given data set and should not contain active characters or a comma. (Active characters +include the special characters such as $ and &, but some packages may make other +symbols active, such as the colon (:) character. For example, the <span +class="ec-lmss-10">ngerman</span><a + id="dx1-6010"></a> and <span +class="ec-lmss-10">babel</span><a + id="dx1-6011"></a> +packages make certain punctuation active. Check the relevant package documentation +for details.) +</p><!--l. 252--><p class="indent" > If <span +class="ec-lmss-10">defproblem</span><a + id="dx1-6012"></a><a + id="dx1-6013"></a> occurs in the document or is included via <span +class="ec-lmtt-10">\input</span><a + id="dx1-6014"></a> or <span +class="ec-lmtt-10">\include</span><a + id="dx1-6015"></a>, then +the problem will be added to the default data set. If <span +class="ec-lmss-10">defproblem </span>occurs in an external +file that is loaded using one of the commands defined in <a +href="#x1-80007">§7 </a><a +href="#x1-80007">Loading Problems +From External Files<!--tex4ht:ref: sec:load --></a> then the problem will be added to the specified data +set. +</p><!--l. 259--><p class="indent" > The contents of the <span +class="ec-lmss-10">defproblem</span><a + id="dx1-6016"></a><a + id="dx1-6017"></a> environment should be the text that defines the +problem. This may include any of the commands defined in <a +href="#x1-40003">§3 </a><a +href="#x1-40003">Showing and Hiding +Solutions<!--tex4ht:ref: sec:showanswers --></a> and <a +href="#x1-50004">§4 </a><a +href="#x1-50004">General Formatting Commands<!--tex4ht:ref: sec:formatting --></a>. +</p><!--l. 264--><p class="indent" > The problem may optionally take <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩ </span>arguments (where <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩ </span>is from 0 to 9). The + + + +arguments can be referenced in the definition via <span +class="ec-lmtt-10">#1</span>,…,<span +class="ec-lmtt-10">#9</span>. If <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩ </span>is omitted then the +problem doesn’t take any arguments. The following example defines a problem with one +argument: + + + +</p> + <div class="verbatim" id="verbatim-7"> +\begin{defproblem}[1]{diffsin} + <br />Differentiate $f(x)=\sin(#1x)$. + <br />\begin{onlysolution}% + <br />  \begin{solution} + <br />    $f’(x) = #1\cos(#1x)$ + <br />  \end{solution} + <br />\end{onlysolution} + <br />\end{defproblem} +</div> +<!--l. 279--><p class="nopar" > +</p><!--l. 281--><p class="indent" > The second optional argument <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">default args</span><span +class="lmsy-10">⟩ </span>supplies default problem arguments +that will automatically be used within <span +class="ec-lmtt-10">\thisproblem</span><a + id="dx1-6018"></a> when used in <span +class="ec-lmtt-10">\foreachproblem</span><a + id="dx1-6019"></a> +in conjunction with the package option <span +class="ec-lmss-10">usedefaultargs</span><a + id="dx1-6020"></a>. (See <a +href="#x1-90008">§8 </a><a +href="#x1-90008">Iterating Through +Datasets<!--tex4ht:ref: sec:foreach --></a>.) For example: + + + +</p> + <div class="verbatim" id="verbatim-8"> +\begin{defproblem}[1][{2}]{diffsin} + <br />Differentiate $f(x)=\sin(#1x)$. + <br />\begin{onlysolution}% + <br />  \begin{solution} + <br />    $f’(x) = #1\cos(#1x)$ + <br />  \end{solution} + <br />\end{onlysolution} + <br />\end{defproblem} +</div> +<!--l. 295--><p class="nopar" > +</p><!--l. 297--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\newproblem</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-6021"></a> <span +class="ec-lmtt-10">\newproblem[</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">][</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">default args</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">]{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">label</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">problem</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">solution</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}</span> +</div><hr> +</p><!--l. 299--><p class="noindent" > +This is a shortcut command for: <span class="obeylines-h"> + <span +class="ec-lmtt-10">\begin{defproblem}[</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">][</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">default args</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">]{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">label</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}%</span> + <br /><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">problem</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">%</span> + <br /><span +class="ec-lmtt-10">\begin{onlysolution}%</span> + <br /><span +class="ec-lmtt-10">\begin{solution}%</span> + <br /><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">solution</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">%</span> + <br /><span +class="ec-lmtt-10">\end{solution}%</span> + <br /><span +class="ec-lmtt-10">\end{onlysolution}%</span> + <br /><span +class="ec-lmtt-10">\end{defproblem}</span></span> +</p><!--l. 311--><p class="indent" > For example: + + + +</p> + <div class="verbatim" id="verbatim-9"> \newproblem[1]{diffsin}{% -\(f(x) = \sin(#1x)\) -}{% -\(f'(x) = #1\cos(#1x)\) -} -</PRE> -is equivalent to -<PRE> + <br />  \(f(x) = \sin(#1x)\) + <br />}% + <br />{% + <br />  \(f’(x) = #1\cos(#1x)\) + <br />} +</div> +<!--l. 319--><p class="nopar" > is equivalent to + + + +</p> + <div class="verbatim" id="verbatim-10"> \begin{defproblem}[1]{diffcos}% -\(f(x) = \cos(#1x)\) -\begin{onlysolution}% -\begin{solution}% -\(f'(x) = -#1\sin(#1x)\) -\end{solution}% -\end{onlysolution}% -\end{defproblem} -</PRE> -(In this example, the argument will need to be a positive number -to avoid a double minus in the answer. If you want to perform -floating point arithmetic on the arguments, then try the -<TT>fp</TT><A NAME="793"></A> package.) - -<P> - -<BR CLEAR="ALL"> -<HR><TT>\newproblem*</TT><A NAME="796"></A><TT>[</TT><EM>n</EM><TT>]{</TT><EM>label</EM><TT>}{</TT><EM>definition</EM><TT>}</TT> -<BR CLEAR="ALL"> -<HR>This is a shortcut for: -<TT> -<TT>\begin</TT>{defproblem}<TT>[</TT><EM>n</EM><TT>]{</TT><EM>label</EM><TT>}</TT>% -<I>definition</I>% -<TT>\end</TT>{defproblem} -</TT> - -<P> -<B>NOTE:</B> Verbatim text must not be used in the contents of <TT>defproblem</TT><A NAME="799"></A> -or in any of the arguments to <TT>\newproblem</TT> or -<TT>\newproblem*</TT>. If you need verbatim-like text consider using -<TT>\texttt</TT> or the <TT>alltt</TT><A NAME="802"></A> package. - -<P> -<A HREF="probsoln-manual.html#top">Top</A> - -<P> - -<H1><A NAME="SECTION00070000000000000000"></A><A NAME="sec:useproblem"></A> -<BR> -6 Using a Problem -</H1> - -<P> -Once you have defined a problem using <TT>defproblem</TT><A NAME="808"></A> or -<TT>\newproblem</TT> (see -<A HREF="probsoln-manual.html#sec:defproblem">Defining a -Problem</A>), you can later display the problem -using: - -<BR CLEAR="ALL"> -<HR><TT>\useproblem</TT><A NAME="811"></A><TT>[</TT><EM>data set</EM><TT>]{</TT><EM>label</EM><TT>}{</TT><EM>arg<SUB>1</SUB></EM><TT>}</TT>... -<TT>{</TT><EM>arg<SUB>N</SUB></EM><TT>}</TT> -<BR CLEAR="ALL"> -<HR>where <I>data set</I> is the name of the data set that contains -the problem (the default data set is used if omitted), -<I>label</I> is the label identifying the required problem and -<I>arg<SUB>1</SUB></I>, ..., -<I>arg<SUB>N</SUB></I> -are the arguments to pass to the problem, if the problem was -defined to have arguments (where N is the number -of arguments specified when the problem was defined). - -<P> -For example, in the previous section the problem <TT>diffcos</TT> -was defined to have one argument, so it can be used as follows: -<PRE> + <br />  \(f(x) = \cos(#1x)\) + <br />\begin{onlysolution}% + <br />  \begin{solution}% + <br />    \(f’(x) = -#1\sin(#1x)\) + <br />  \end{solution}% + <br />\end{onlysolution}% + <br />\end{defproblem} +</div> +<!--l. 330--><p class="nopar" > (In this example, the argument will need to be a positive number to avoid a double +minus in the answer. If you want to perform floating point arithmetic on the arguments, +then try the <span +class="ec-lmss-10">fp</span><a + id="dx1-6022"></a> or <span +class="ec-lmss-10">pgfmath</span><a + id="dx1-6023"></a> packages.) +</p><!--l. 336--><p class="indent" > Alternatively, if you want to supply default arguments to use when iterating through +problems with <span +class="ec-lmtt-10">\foreachproblem</span><a + id="dx1-6024"></a>: + + + +</p> + <div class="verbatim" id="verbatim-11"> +\newproblem[1][{3}]{diffsin}{% + <br />  \(f(x) = \sin(#1x)\) + <br />}% + <br />{% + <br />  \(f’(x) = #1\cos(#1x)\) + <br />} +</div> +<!--l. 345--><p class="nopar" > +</p><!--l. 348--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\newproblem*</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-6025"></a> <span +class="ec-lmtt-10">\newproblem*[</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">][</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">default args</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">]{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">label</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">definition</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}</span> +</div><hr> +</p><!--l. 350--><p class="noindent" > +This is a shortcut for: <span class="obeylines-h"> + <span +class="ec-lmtt-10">\begin{defproblem}[</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">][</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">default args</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">]{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">label</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}%</span> + <br /><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">definition</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">%</span> + <br /><span +class="ec-lmtt-10">\end{defproblem}</span></span> +</p><!--l. 358--><p class="indent" > <div class="important" title="Important Note"> Verbatim text must not be used in the contents of <span +class="ec-lmss-10">defproblem</span><a + id="dx1-6026"></a><a + id="dx1-6027"></a> or in any of the +arguments to <span +class="ec-lmtt-10">\newproblem </span>or <span +class="ec-lmtt-10">\newproblem*</span>. If you need verbatim-like text consider +using <span +class="ec-lmtt-10">\texttt </span>or the <span +class="ec-lmss-10">alltt</span><a + id="dx1-6028"></a> package. </div> +</p><!--l. 363--><p class="noindent" > +</p><!--l. 365--><p class="noindent" > +</p> +<!--l. 365--><p class="noindent" ><a +href="#top">Top</a></p><h3 class="sectionHead"><span class="titlemark">6 </span> <a + id="x1-70006"></a>Using a Problem</h3> +<!--l. 367--><p class="noindent" >Once you have defined a problem using <span +class="ec-lmss-10">defproblem</span><a + id="dx1-7001"></a><a + id="dx1-7002"></a> or <span +class="ec-lmtt-10">\newproblem</span><a + id="dx1-7003"></a> (see <a +href="#x1-60005">§5 </a><a +href="#x1-60005">Defining a +Problem<!--tex4ht:ref: sec:defproblem --></a>), you can later display the problem using: +</p><!--l. 370--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\useproblem</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-7004"></a> <span +class="ec-lmtt-10">\useproblem[</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">data set</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">]{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">label</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">arg</span><sub><span +class="rm-lmr-8x-x-95">1</span></sub><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}</span><span +class="ec-lmtt-10">…{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">arg</span><sub><span +class="lmmi-8x-x-95">N</span></sub><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">} </span></div><hr> +</p><!--l. 373--><p class="noindent" > +where <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">data set</span><span +class="lmsy-10">⟩ </span>is the name of the data set that contains the problem (the default data +set is used if omitted), <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">label</span><span +class="lmsy-10">⟩ </span>is the label identifying the required problem and <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">arg</span><sub><span +class="rm-lmr-8x-x-95">1</span></sub><span +class="lmsy-10">⟩</span>, …, +<span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">arg</span><sub><span +class="lmmi-8x-x-95">N</span></sub><span +class="lmsy-10">⟩ </span>are the arguments to pass to the problem, if the problem was defined to have +arguments (where <span +class="lmmi-10">N </span>is the number of arguments specified when the problem was +defined). +</p><!--l. 382--><p class="indent" > For example, in the previous section the problem <span +class="ec-lmtt-10">diffcos </span>was defined to have one +argument, so it can be used as follows: + + + +</p> + <div class="verbatim" id="verbatim-12"> \useproblem{diffcos}{3} -</PRE> -This will be equivalent to: -<PRE> -\(f(x) = \cos(3x)\) -\begin{onlysolution}% -\begin{solution}% -\(f'(x) = -3\sin(3x)\) -\end{solution}% -\end{onlysolution}% -</PRE> - -<P> -<A HREF="probsoln-manual.html#top">Top</A> - -<P> - -<H1><A NAME="SECTION00080000000000000000"></A><A NAME="sec:load"></A> -<BR> -7 Loading Problems From External Files -</H1> - -<P> -You can store all your problem definitions (see -<A HREF="probsoln-manual.html#sec:defproblem">Defining New -Problems</A>) in an external file. -These problems can all be appended to the default data set by -including the file via <TT>\input</TT><A NAME="817"></A> or they can be appended -to other data sets using one of the commands described below. -Once you have loaded all the required problems, you can -iterate through the data sets using the commands described -in <A HREF="probsoln-manual.html#sec:foreach">Iterating -Through Datasets</A>. Note that the commands below -will create a new data set, if the named data set doesn't +</div> +<!--l. 386--><p class="nopar" > This will be equivalent to: + + + +</p> + <div class="verbatim" id="verbatim-13"> +\(f(x) = \cos(3x)\) + <br />\begin{onlysolution}% + <br />\begin{solution}% + <br />\(f’(x) = -3\sin(3x)\) + <br />\end{solution}% + <br />\end{onlysolution}% +</div> +<!--l. 395--><p class="nopar" > +</p><!--l. 397--><p class="noindent" > +</p> +<!--l. 397--><p class="noindent" ><a +href="#top">Top</a></p><h3 class="sectionHead"><span class="titlemark">7 </span> <a + id="x1-80007"></a>Loading Problems From External Files</h3> +<!--l. 399--><p class="noindent" >You can store all your problem definitions (see <a +href="#x1-60005">§5 </a><a +href="#x1-60005">Defining a Problem<!--tex4ht:ref: sec:defproblem --></a>) in an external +file. These problems can all be appended to the default data set by including the file via +<span +class="ec-lmtt-10">\input</span><a + id="dx1-8001"></a> or they can be appended to other data sets using one of the commands +described below. Once you have loaded all the required problems, you can iterate +through the data sets using the commands described in <a +href="#x1-90008">§8 </a><a +href="#x1-90008">Iterating Through Datasets<!--tex4ht:ref: sec:foreach --></a>. +Note that the commands below will create a new data set, if the named data set doesn’t exist. - -<P> - -<BR CLEAR="ALL"> -<HR><TT>\loadallproblems</TT><A NAME="820"></A><TT>[</TT><EM>data set</EM><TT>]{</TT><EM>filename</EM><TT>}</TT> -<BR CLEAR="ALL"> -<HR>This will load all problems defined in <I>filename</I> and -append them to the specified data set, in the order in which -they are defined in the file. If <I>data set</I> is -omitted, the default data set will be used. If <I>data set</I> -doesn't exist, it will be created. - -<P> - -<BR CLEAR="ALL"> -<HR><TT>\loadselectedproblems</TT><A NAME="823"></A><TT>[</TT><EM>data set</EM><TT>]{</TT><EM>labels</EM><TT>}{</TT><EM>filename</EM><TT>}</TT> -<BR CLEAR="ALL"> -<HR>This is like <TT>\loadproblems</TT>, but only those problems whose -label is listed in the comma-separated list <I>labels</I> are -loaded. For example, if I have some problems defined in the -file <TT>derivatives.tex</TT>, then -<PRE> +</p><!--l. 410--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\loadallproblems</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-8002"></a> <span +class="ec-lmtt-10">\loadallproblems[</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">data set</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">]{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">filename</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">} </span></div><hr> +</p><!--l. 412--><p class="noindent" > +This will load all problems defined in <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">filename</span><span +class="lmsy-10">⟩ </span>and append them to the specified +data set, in the order in which they are defined in the file. If <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">data set</span><span +class="lmsy-10">⟩ </span>is +omitted, the default data set will be used. If <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">data set</span><span +class="lmsy-10">⟩ </span>doesn’t exist, it will be +created. +</p><!--l. 419--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\loadselectedproblems</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-8003"></a> <span +class="ec-lmtt-10">\loadselectedproblems[</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">data set</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">]{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">labels</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">filename</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}</span> +</div><hr> +</p><!--l. 421--><p class="noindent" > +This is like <span +class="ec-lmtt-10">\loadallproblems</span>, but only those problems whose label is listed in the +comma-separated list <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">labels</span><span +class="lmsy-10">⟩ </span>are loaded. For example, if I have some problems defined +in the file <span +class="ec-lmtt-10">derivatives.tex</span>, then + + + +</p> + <div class="verbatim" id="verbatim-14"> \loadselectedproblems{diffsin,diffcos}{derivatives} -</PRE> -will only load the problems whose labels are <TT>diffsin</TT> -and <TT>diffcos</TT>, respectively. All the other problems in -the file will remain undefined. - -<P> - -<BR CLEAR="ALL"> -<HR><TT>\loadrandomproblems</TT><A NAME="826"></A><TT>[</TT><EM>data set</EM><TT>]{</TT><EM>n</EM><TT>}{</TT><EM>filename</EM><TT>}</TT> -<BR CLEAR="ALL"> -<HR>This randomly loads <I>n</I> problems from <I>filename</I> and -adds them to the given data set. If <I>data set</I> is omitted, -the default data set is assumed. Note that the problems will be -added to the data set in a random order, not in the order in -which they were defined. There must be at least <I>n</I> problems -defined in <I>filename</I>. - -<P> -<B>NOTE:</B> It is generally not a good idea to place anything in -<I>filename</I> that is not inside the body of <TT>defproblem</TT><A NAME="829"></A> -or in the arguments to <TT>\newproblem</TT><A NAME="832"></A> or <TT>\newproblem*</TT><A NAME="835"></A>. -All the commands in this section input the external file within -a local scope, so commands definitions would need to be made -global to have any effect. In addition, <TT>\loadrandomproblems</TT> -has to load each file twice, which means that anything outside -a problem definition will be parsed twice. - -<P> - -<P> -<A HREF="probsoln-manual.html#top">Top</A> - -<P> - -<H1><A NAME="SECTION00090000000000000000"></A><A NAME="sec:foreach"></A> -<BR> -8 Iterating Through Datasets -</H1> - -<P> -Once you have defined all your problems for a given data set, -you can use an individual problem with <TT>\useproblem</TT><A NAME="841"></A> -(see <A HREF="probsoln-manual.html#sec:useproblem">Using a -Problem</A>) but it is more likely that you will -want to iterate through all the problems so that you don't need -to remember the labels of all the problems you have defined. - -<P> - -<BR CLEAR="ALL"> -<HR><TT>\foreachproblem</TT><A NAME="844"></A><TT>[</TT><EM>data set</EM><TT>]{</TT><EM>body</EM><TT>}</TT> -<BR CLEAR="ALL"> -<HR>This does <I>body</I> for each problem in the given data set. -If <I>data set</I> is omitted, the default data set is used. -Within <I>body</I> you can use -<TT>\thisproblem</TT> to use the -current problem and <TT>\thisproblemlabel</TT> -to access the current label. If the problem requires arguments, -you will be prompted for them, so if you want to use this -approach you will need to use LaTeX in interactive mode. If -you do provide arguments, they will be stored in the event that -you need to iterate through the data set again. The -arguments will be included in <TT>\thisproblem</TT>, so you only -need to use <TT>\thisproblem</TT> without having to specify -<TT>\useproblem</TT><A NAME="847"></A>. For example, to iterate through all problems -in the default data set: -<PRE> +</div> +<!--l. 428--><p class="nopar" > will only load the problems whose labels are <span +class="ec-lmtt-10">diffsin </span>and <span +class="ec-lmtt-10">diffcos</span>, respectively. All +the other problems in the file will remain undefined. +</p><!--l. 433--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\loadexceptproblems</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-8004"></a> <span +class="ec-lmtt-10">\loadexceptproblems[</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">data set</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">]{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">exception list</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">filename</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}</span> +</div><hr> +</p><!--l. 435--><p class="noindent" > +This is the reverse of <span +class="ec-lmtt-10">\loadselectedproblems</span>. This loads all problems except those +whose labels are listed in <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">exception list</span><span +class="lmsy-10">⟩</span>. +</p><!--l. 440--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\loadrandomproblems</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-8005"></a> <span +class="ec-lmtt-10">\loadrandomproblems[</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">data set</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">]{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">filename</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}</span> +</div><hr> +</p><!--l. 442--><p class="noindent" > +This randomly loads <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩ </span>problems from <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">filename</span><span +class="lmsy-10">⟩ </span>and adds them to the given data +set. If <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">data set</span><span +class="lmsy-10">⟩ </span>is omitted, the default data set is assumed. Note that the +problems will be added to the data set in a random order, not in the order +in which they were defined. There must be at least <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩ </span>problems defined in +<span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">filename</span><span +class="lmsy-10">⟩</span>. +</p><!--l. 450--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\loadrandomexcept</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-8006"></a> <span +class="ec-lmtt-10">\loadrandomexcept[</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">data set</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">]{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">filename</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">exception</span> +<span +class="ec-lmri-10">list</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">} </span></div><hr> +</p><!--l. 453--><p class="noindent" > +This is similar to <span +class="ec-lmtt-10">\loadrandomproblems </span>except that it won’t load those problems +whose labels are listed in <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">exception list</span><span +class="lmsy-10">⟩</span>. +</p><!--l. 457--><p class="indent" > Note that the random number generator has been modified in version 3.01 in order +to fix a bug. If you want to ensure that your random numbers are compatible with +earlier versions, you can switch to the old generator using +</p><!--l. 461--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\PSNuseoldrandom</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-8007"></a> <span +class="ec-lmtt-10">\PSNuseoldrandom </span></div><hr> +</p><!--l. 463--><p class="noindent" > +</p><!--l. 465--><p class="indent" > <div class="important" title="Important Note"> It is generally not a good idea to place anything in <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">filename</span><span +class="lmsy-10">⟩ </span>that is not inside the +body of <span +class="ec-lmss-10">defproblem</span><a + id="dx1-8008"></a><a + id="dx1-8009"></a> or in the arguments to <span +class="ec-lmtt-10">\newproblem</span><a + id="dx1-8010"></a> or <span +class="ec-lmtt-10">\newproblem*</span><a + id="dx1-8011"></a>. All +the commands in this section input the external file within a local scope, so +command definitions would need to be made global to have any effect. In addition, +<span +class="ec-lmtt-10">\loadrandomproblems </span>has to load each file twice, which means that anything outside a +problem definition will be parsed twice. </div> +</p><!--l. 474--><p class="noindent" > +</p><!--l. 476--><p class="noindent" > +</p> +<!--l. 476--><p class="noindent" ><a +href="#top">Top</a></p><h3 class="sectionHead"><span class="titlemark">8 </span> <a + id="x1-90008"></a>Iterating Through Datasets</h3> +<!--l. 478--><p class="noindent" >Once you have defined all your problems for a given data set, you can use an individual +problem with <span +class="ec-lmtt-10">\useproblem</span><a + id="dx1-9001"></a> (see <a +href="#x1-70006">§6 </a><a +href="#x1-70006">Using a Problem<!--tex4ht:ref: sec:useproblem --></a>) but it is more likely that you will +want to iterate through all the problems so that you don’t need to remember the labels +of all the problems you have defined. + + + +</p><!--l. 484--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\foreachproblem</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-9002"></a> <span +class="ec-lmtt-10">\foreachproblem[</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">data set</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">]{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">body</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">} </span></div><hr> +</p><!--l. 486--><p class="noindent" > +This does <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">body</span><span +class="lmsy-10">⟩ </span>for each problem in the given data set. If <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">data set</span><span +class="lmsy-10">⟩ </span>is omitted, the +default data set is used. Within <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">body</span><span +class="lmsy-10">⟩ </span>you can use +</p><!--l. 490--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\thisproblem</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-9003"></a> <span +class="ec-lmtt-10">\thisproblem </span></div><hr> +</p><!--l. 492--><p class="noindent" > +to use the current problem and +</p><!--l. 494--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\thisproblemlabel</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-9004"></a> <span +class="ec-lmtt-10">\thisproblemlabel </span></div><hr> +</p><!--l. 496--><p class="noindent" > +to access the current label. If the problem requires arguments, and no default +arguments were supplied in the problem definition or the package option <span +class="ec-lmss-10">usedefaultargs</span><a + id="dx1-9005"></a> +was not used, then you will be prompted for arguments, so if you want to use this +approach you will need to use <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span +class="E">E</span>X</span></span> in interactive mode. If you do provide +arguments, they will be stored in the event that you need to iterate through the data +set again. The arguments will be included in <span +class="ec-lmtt-10">\thisproblem</span>, so you only need to use +<span +class="ec-lmtt-10">\thisproblem </span>without having to specify <span +class="ec-lmtt-10">\useproblem</span><a + id="dx1-9006"></a>. +</p><!--l. 508--><p class="indent" > For example, to iterate through all problems in the default data set: + + + +</p> + <div class="verbatim" id="verbatim-15"> \begin{enumerate} -\foreachproblem{\item\thisproblem} -\end{enumerate} -</PRE> - -<P> - -<BR CLEAR="ALL"> -<HR><TT>\foreachdataset</TT><A NAME="850"></A><TT>{</TT><EM>cmd</EM><TT>}{</TT><EM>body</EM><TT>}</TT> -<BR CLEAR="ALL"> -<HR>This does <I>body</I> for each of the defined data sets. Within -<I>body</I>, <I>cmd</I> will be set to the name of the current -data set. For example, to display all problems in all data sets: -<PRE> + <br />\foreachproblem{\item\thisproblem} + <br />\end{enumerate} +</div> +<!--l. 514--><p class="nopar" > +</p><!--l. 516--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\foreachsolution</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-9007"></a> <span +class="ec-lmtt-10">\foreachsolution[</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">data set</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">]{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">body</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">} </span></div><hr> +</p><!--l. 518--><p class="noindent" > +This is equivalent to <span +class="ec-lmtt-10">\foreachsolution</span>, but only iterates through problems that +contain the <span +class="ec-lmss-10">onlysolution</span><a + id="dx1-9008"></a><a + id="dx1-9009"></a> environment. Note that you still need to use <span +class="ec-lmtt-10">\showanswers</span><a + id="dx1-9010"></a> or +the <span +class="ec-lmss-10">answers</span><a + id="dx1-9011"></a> package option for the contents of the <span +class="ec-lmss-10">onlysolution</span><a + id="dx1-9012"></a><a + id="dx1-9013"></a> environment to +appear. +</p><!--l. 525--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\foreachdataset</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-9014"></a> <span +class="ec-lmtt-10">\foreachdataset{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">cmd</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">body</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">} </span></div><hr> +</p><!--l. 527--><p class="noindent" > +This does <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">body</span><span +class="lmsy-10">⟩ </span>for each of the defined data sets. Within <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">body</span><span +class="lmsy-10">⟩</span>, <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">cmd</span><span +class="lmsy-10">⟩ </span>will be set to +the name of the current data set. For example, to display all problems in all data +sets: + + + +</p> + <div class="verbatim" id="verbatim-16"> \begin{enumerate} -\foreachdataset{\thisdataset}{% -\foreachproblem[\thisdataset]{\item\thisproblem}} -\end{enumerate} -</PRE> - -<P> -Suppose I have two external files called -<TT>derivatives.tex</TT> and <TT>probspaces.tex</TT> which -define problems using both <TT>onlyproblem</TT><A NAME="853"></A> and -<TT>onlysolution</TT><A NAME="856"></A> for example: -<PRE> + <br />\foreachdataset{\thisdataset}{% + <br />\foreachproblem[\thisdataset]{\item\thisproblem}} + <br />\end{enumerate} +</div> +<!--l. 536--><p class="nopar" > +</p><!--l. 538--><p class="indent" > Suppose I have two external files called <span +class="ec-lmtt-10">derivatives.tex </span>and <span +class="ec-lmtt-10">probspaces.tex</span> +which define problems using both <span +class="ec-lmss-10">onlyproblem</span><a + id="dx1-9015"></a><a + id="dx1-9016"></a> and <span +class="ec-lmss-10">onlysolution</span><a + id="dx1-9017"></a><a + id="dx1-9018"></a> for example: + + + +</p> + <div class="verbatim" id="verbatim-17"> \begin{defproblem}{cosxsqsinx}% -\begin{onlyproblem}% -$y = \cos(x^2)\sin x$.% -\end{onlyproblem}% -\begin{onlysolution}% -\[\frac{dy}{dx} = -\sin(x^2)2x\sin x + \cos(x^2)\cos x\] -\end{onlysolution}% -\end{defproblem} -</PRE> -I can write a document that creates two data sets, one for -the derivative problems and one for the problems about -probability spaces. I can then use <TT>\hideanswers</TT><A NAME="859"></A> and -iterate through the require data set to produce the problems. -Later, I can use <TT>\showanswers</TT><A NAME="862"></A> and iterate over all problems defined in both data -sets to produce the chapter containing all the answers. When -displaying the questions, I have taken advantage of the fact that -I can cross-reference items within an <TT>enumerate</TT><A NAME="865"></A> environment, -and redefined <TT>\theenumi</TT><A NAME="868"></A> to label the questions according to -the chapter. The cross-reference label is constructed from -the problem label and is referenced in the answer section to -ensure that the answers have the same label as the questions. -<PRE> + <br />\begin{onlyproblem}% + <br />$y = \cos(x^2)\sin x$.% + <br />\end{onlyproblem}% + <br />\begin{onlysolution}% + <br />\[\frac{dy}{dx} = -\sin(x^2)2x\sin x + \cos(x^2)\cos x\] + <br />\end{onlysolution}% + <br />\end{defproblem} +</div> +<!--l. 551--><p class="nopar" > I can write a document that creates two data sets, one for the derivative problems and +one for the problems about probability spaces. I can then use <span +class="ec-lmtt-10">\hideanswers</span><a + id="dx1-9019"></a> and iterate +through the require data set to produce the problems. Later, I can use <span +class="ec-lmtt-10">\showanswers</span><a + id="dx1-9020"></a> +and iterate over all problems defined in both data sets to produce the chapter +containing all the answers. When displaying the questions, I have taken advantage of +the fact that I can cross-reference items within an <span +class="ec-lmss-10">enumerate</span><a + id="dx1-9021"></a><a + id="dx1-9022"></a> environment, +and redefined <span +class="ec-lmtt-10">\theenumi</span><a + id="dx1-9023"></a> to label the questions according to the chapter. The +cross-reference label is constructed from the problem label and is referenced +in the answer section to ensure that the answers have the same label as the +questions. + + + +</p> + <div class="verbatim" id="verbatim-18"> \documentclass{report} -\usepackage{probsoln} -\begin{document} -\hideanswers -\chapter{Differentiation} -% randomly select 25 problems from derivatives.tex and add to -% the data set called 'deriv' -\loadrandomproblems[deriv]{25}{derivatives} - -% Display the problems -\renewcommand{\theenumi}{\thechapter.\arabic{enumi}} -\begin{enumerate} -\foreachproblem[deriv]{\item\label{prob:\thisproblemlabel}\thisproblem} -\end{enumerate} -% You may need to change \theenumi back here - -\chapter{Probability Spaces} -% randomly select 25 problems from probspaces.tex and add to -% the data set called 'spaces' -\loadrandomproblems[spaces]{25}{probspaces} - -% Display the problems -\renewcommand{\theenumi}{\thechapter.\arabic{enumi}} -\begin{enumerate} -\foreachproblem[spaces]{\item\label{prob:\thisproblemlabel}\thisproblem} -\end{enumerate} -% You may need to change \theenumi back here - -\appendix - -\chapter{Solutions} -\showanswers -\begin{itemize} -\foreachdataset{\thisdataset}{% -\foreachproblem[\thisdataset]{\item[\ref{prob:\thisproblemlabel}]\thisproblem} -} -\end{itemize} - -\end{document} -</PRE> - -<P> - -<P> -<A HREF="probsoln-manual.html#top">Top</A> - -<P> - -<H1><A NAME="SECTION000100000000000000000"></A><A NAME="sec:random"></A> -<BR> -9 Random Number Generator -</H1> - -<P> -This package provides a pseudo-random number generator that is used -by <TT>\loadrandomproblems</TT><A NAME="874"></A>. - -<P> - -<BR CLEAR="ALL"> -<HR><TT>\PSNrandseed</TT><A NAME="877"></A><TT>{</TT><EM>n</EM><TT>}</TT> -<BR CLEAR="ALL"> -<HR>This sets the seed to <I>n</I> which must be a non-zero integer. -For example, to generate a different set of random numbers -every time you LaTeX your document,<A NAME="tex2html3" - HREF="#foot462"><SUP>1</SUP></A> put the following in your -preamble: -<PRE> + <br />\usepackage{probsoln} + <br />\begin{document} + <br />\hideanswers + <br />\chapter{Differentiation} + <br /> randomly select 25 problems from derivatives.tex and add to + <br /> the data set called ’deriv’ + <br />\loadrandomproblems[deriv]{25}{derivatives} + <br /> Display the problems + <br />\renewcommand{\theenumi}{\thechapter.\arabic{enumi}} + <br />\begin{enumerate} + <br />\foreachproblem[deriv]{\item\label{prob:\thisproblemlabel}\thisproblem} + <br />\end{enumerate} + <br /> You may need to change \theenumi back here + <br />\chapter{Probability Spaces} + <br /> randomly select 25 problems from probspaces.tex and add to + <br /> the data set called ’spaces’ + <br />\loadrandomproblems[spaces]{25}{probspaces} + <br /> Display the problems + <br />\renewcommand{\theenumi}{\thechapter.\arabic{enumi}} + <br />\begin{enumerate} + <br />\foreachproblem[spaces]{\item\label{prob:\thisproblemlabel}\thisproblem} + <br />\end{enumerate} + <br /> You may need to change \theenumi back here + <br />\appendix + <br />\chapter{Solutions} + <br />\showanswers + <br />\begin{itemize} + <br />\foreachdataset{\thisdataset}{% + <br />\foreachproblem[\thisdataset]{\item[\ref{prob:\thisproblemlabel}]\thisproblem} + <br />} + <br />\end{itemize} + <br />\end{document} +</div> +<!--l. 604--><p class="nopar" > +</p><!--l. 606--><p class="noindent" > +</p> +<!--l. 606--><p class="noindent" ><a +href="#top">Top</a></p><h3 class="sectionHead"><span class="titlemark">9 </span> <a + id="x1-100009"></a>Random Number Generator</h3> +<!--l. 608--><p class="noindent" >This package provides a pseudo-random number generator that is used by +<span +class="ec-lmtt-10">\loadrandomproblems</span><a + id="dx1-10001"></a>. As noted earlier the random number generator has been + + + +modified in version 3.01 in order to fix a bug. If you want to ensure that your random +numbers are compatible with earlier versions, you can switch to the old generator +using +</p><!--l. 613--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\PSNuseoldrandom</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-10002"></a> <span +class="ec-lmtt-10">\PSNuseoldrandom </span></div><hr> +</p><!--l. 615--><p class="noindent" > +</p><!--l. 617--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\PSNrandseed</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-10003"></a> <span +class="ec-lmtt-10">\PSNrandseed{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">} </span></div><hr> +</p><!--l. 619--><p class="noindent" > +This sets the seed to <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩ </span>which must be a non-zero integer. For example, to +generate a different set of random numbers every time you <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span +class="E">E</span>X</span></span> your +document,<span class="footnote-mark"><a +href="#fn1x0" id="fn1x0-bk"><sup class="textsuperscript">1</sup></a></span><a + id="x1-10004f1"></a> +put the following in your preamble: + + + +</p> + <div class="verbatim" id="verbatim-19"> \PSNrandseed{\time} -</PRE> -or to generate a different set of random numbers every year you -LaTeX your document: -<PRE> +</div> +<!--l. 627--><p class="nopar" > or to generate a different set of random numbers every year you <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span +class="E">E</span>X</span></span> your +document: + + + +</p> + <div class="verbatim" id="verbatim-20"> \PSNrandseed{\year} -</PRE> - -<P> - -<BR CLEAR="ALL"> -<HR><TT>\PSNgetrandseed</TT><A NAME="880"></A><TT>{</TT><EM>register</EM><TT>}</TT> -<BR CLEAR="ALL"> -<HR>This stores the current seed in the count register specified by -<I>register</I>. -For example: -<PRE> +</div> +<!--l. 632--><p class="nopar" > +</p><!--l. 634--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\PSNgetrandseed</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-10005"></a> <span +class="ec-lmtt-10">\PSNgetrandseed{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">register</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">} </span></div><hr> +</p><!--l. 636--><p class="noindent" > +This stores the current seed in the count register specified by <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">register</span><span +class="lmsy-10">⟩</span>. For +example: + + + +</p> + <div class="verbatim" id="verbatim-21"> \newcount\myseed -\PSNgetrandseed{\myseed} -</PRE> - -<P> - -<BR CLEAR="ALL"> -<HR><TT>\PSNrandom</TT><A NAME="883"></A><TT>{</TT><EM>register</EM><TT>}{</TT><EM>n</EM><TT>}</TT> -<BR CLEAR="ALL"> -<HR>Generates a random integer from 1 to <I>n</I> and stores in -the count register specified by <I>register</I>. For example, -the following generates an integer from 1 to 10 and stores it -in the register <TT>\myreg</TT>: -<PRE> + <br />\PSNgetrandseed{\myseed} +</div> +<!--l. 643--><p class="nopar" > +</p><!--l. 645--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\PSNrandom</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-10006"></a> <span +class="ec-lmtt-10">\PSNrandom{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">register</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">} </span></div><hr> +</p><!--l. 647--><p class="noindent" > +Generates a random integer from 1 to <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩ </span>and stores in the count register specified by +<span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">register</span><span +class="lmsy-10">⟩</span>. For example, the following generates an integer from 1 to 10 and stores it in +the register <span +class="ec-lmtt-10">\myreg</span>: + + + +</p> + <div class="verbatim" id="verbatim-22"> \newcount\myreg -\PSNrandom{\myreg}{10} -</PRE> - -<P> - -<BR CLEAR="ALL"> -<HR><TT>\random</TT><A NAME="886"></A><TT>{</TT><EM>counter</EM><TT>}{</TT><EM>min</EM><TT>}{</TT><EM>max</EM><TT>}</TT> -<BR CLEAR="ALL"> -<HR>Generates a random integer from <I>min</I> to <I>max</I> and -stores in the given counter. For example, the following generates -a random number between 3 and 8 (inclusive) and stores it in -the counter <TT>myrand</TT>. -<PRE> + <br />\PSNrandom{\myreg}{10} +</div> +<!--l. 655--><p class="nopar" > +</p><!--l. 657--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\random</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-10007"></a> <span +class="ec-lmtt-10">\random{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">counter</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">min</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">max</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">} </span></div><hr> +</p><!--l. 659--><p class="noindent" > +Generates a random integer from <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">min</span><span +class="lmsy-10">⟩ </span>to <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">max</span><span +class="lmsy-10">⟩ </span>and stores in the given counter. For +example, the following generates a random number between 3 and 8 (inclusive) and +stores it in the counter <span +class="ec-lmtt-10">myrand</span>. + + + +</p> + <div class="verbatim" id="verbatim-23"> \newcounter{myrand} -\random{myrand}{3}{8} -</PRE> - -<P> - -<BR CLEAR="ALL"> -<HR><TT>\doforrandN</TT><A NAME="889"></A><TT>{</TT><EM>n</EM><TT>}{</TT><EM>cmd</EM><TT>}{</TT><EM>list</EM><TT>}{</TT><EM>text</EM><TT>}</TT> -<BR CLEAR="ALL"> -<HR>Randomly selects <I>n</I> values from the comma-separated list -given by <I>list</I> and iterates through this subset. On -each iteration it sets <I>cmd</I> to the current value and -does <I>text</I>. For example, the following will load a -randomly selected problem from two of the listed files (where -<TT>file1.tex</TT>, <TT>file2.tex</TT> and <TT>file3.tex</TT> -are files containing at least one problem): -<PRE> + <br />\random{myrand}{3}{8} +</div> +<!--l. 667--><p class="nopar" > +</p><!--l. 669--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\doforrandN</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-10008"></a> <span +class="ec-lmtt-10">\doforrandN{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">cmd</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">list</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">text</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">} </span></div><hr> +</p><!--l. 671--><p class="noindent" > +Randomly selects <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩ </span>values from the comma-separated list given by <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">list</span><span +class="lmsy-10">⟩ </span>and iterates +through this subset. On each iteration it sets <span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">cmd</span><span +class="lmsy-10">⟩ </span>to the current value and does +<span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">text</span><span +class="lmsy-10">⟩</span>. For example, the following will load a randomly selected problem from two of the +listed files (where <span +class="ec-lmtt-10">file1.tex</span>, <span +class="ec-lmtt-10">file2.tex </span>and <span +class="ec-lmtt-10">file3.tex </span>are files containing at least +one problem): + + + +</p> + <div class="verbatim" id="verbatim-24"> \doforrandN{2}{\thisfile}{file1,file2,file3}{% -\loadrandomproblems{1}{\thisfile}} -</PRE> - -<P> - -<P> -<A HREF="probsoln-manual.html#top">Top</A> - -<P> - -<H1><A NAME="SECTION000110000000000000000"> -10 Compatibility With Versions Prior to 3.0</A> -</H1> - -<P> -Version 3.0 of the <TT>probsoln</TT> package completely changed the -structure of the package, but the commands described in this -section have been provided to maintain compatibility with -earlier versions. The only problems that are likely to occur are -those where commands are contained within groups. This will -effect any commands that are contained in external files that are -outside of the arguments to <TT>\newproblem</TT><A NAME="896"></A> and <TT>\newproblem*</TT><A NAME="899"></A>. -However, since the external files had to be parsed twice in -order to load the problems, this shouldn't be an issue as adding -anything other than problem definitions in those files would -be problematic anyway. - -<P> -The other likely difference is where the random generator is -used in a group. This includes commands such as -<TT>\selectrandomly</TT><A NAME="902"></A>. For example, if your document contained -something like: -<PRE> + <br />\loadrandomproblems{1}{\thisfile}} +</div> +<!--l. 682--><p class="nopar" > +</p><!--l. 684--><p class="noindent" > +</p> +<!--l. 684--><p class="noindent" ><a +href="#top">Top</a></p><h3 class="sectionHead"><span class="titlemark">10 </span> <a + id="x1-1100010"></a>Compatibility With Versions Prior to 3.0</h3> +<!--l. 686--><p class="noindent" >Version 3.0 of the <span +class="ec-lmss-10">probsoln</span><a + id="dx1-11001"></a> package completely changed the structure of the package, +but the commands described in this section have been provided to maintain +compatibility with earlier versions. The only problems that are likely to occur +are those where commands are contained within groups. This will effect any +commands that are contained in external files that are outside of the arguments to +<span +class="ec-lmtt-10">\newproblem</span><a + id="dx1-11002"></a> and <span +class="ec-lmtt-10">\newproblem*</span><a + id="dx1-11003"></a>. However, since the external files had to be +parsed twice in order to load the problems, this shouldn’t be an issue as adding +anything other than problem definitions in those files would be problematic +anyway. +</p><!--l. 698--><p class="indent" > The other likely difference is where the random generator is used in a group. This +includes commands such as <span +class="ec-lmtt-10">\selectrandomly</span><a + id="dx1-11004"></a>. For example, if your document +contained something like: + + + +</p> + <div class="verbatim" id="verbatim-25"> \begin{enumerate} -\selectrandomly{file1}{8} - -\item Solve the following: -\begin{enumerate} -\selectrandomly{file2}{4} -\end{enumerate} - -\selectrandomly{file3}{2} -\end{enumerate} -</PRE> -Then using versions prior to v3.0 will produce a different -set of random numbers since the second <TT>\selectrandomly</TT> -is in a different level of grouping. If you want to ensure -that the document produces exactly the same random set with -the new version as with the old version, you will need to -get and set the random number seed. For example, the above -would need to be modified so that it becomes: -<PRE> + <br />\selectrandomly{file1}{8} + <br />\item Solve the following: + <br />\begin{enumerate} + <br />\selectrandomly{file2}{4} + <br />\end{enumerate} + <br />\selectrandomly{file3}{2} + <br />\end{enumerate} +</div> +<!--l. 713--><p class="nopar" > Then using versions prior to v3.0 will produce a different set of random numbers since +the second <span +class="ec-lmtt-10">\selectrandomly </span>is in a different level of grouping. If you want to +ensure that the document produces exactly the same random set with the +new version as with the old version, you will need to get and set the random +number seed. For example, the above would need to be modified so that it +becomes: + + + +</p> + <div class="verbatim" id="verbatim-26"> \begin{enumerate} -\selectrandomly{file1}{8} + <br />\selectrandomly{file1}{8} + <br />\item Solve the following: + <br />\newcount\oldseed + <br />\PSNgetrandseed{\oldseed} + <br />\begin{enumerate} + <br />\selectrandomly{file2}{4} + <br />\end{enumerate} + <br />\PSNrandseed{\oldseed} + <br />\selectrandomly{file3}{2} + <br />\end{enumerate} +</div> +<!--l. 735--><p class="nopar" > +</p><!--l. 737--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\selectrandomly</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-11005"></a> <span +class="ec-lmtt-10">\selectrandomly{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">filename</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">} </span></div><hr> +</p><!--l. 739--><p class="noindent" > +This is now equivalent to: <span class="obeylines-h"> + <span +class="ec-lmtt-10">{\loadrandomproblems[</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">filename</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">]{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">n</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">filename</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}}%</span> + <br /><span +class="ec-lmtt-10">\foreachproblem[</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">filename</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">]{\PSNitem\thisproblem\endPSNitem}</span></span> +</p><!--l. 746--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +class="ec-lmtt-9">\selectallproblems</span><span +class="ec-lmtt-9"> </span></span><a + id="dx1-11006"></a> <span +class="ec-lmtt-10">\selectallproblems{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">filename</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">} </span></div><hr> +</p><!--l. 748--><p class="noindent" > +This is now equivalent to: <span class="obeylines-h"> + <span +class="ec-lmtt-10">{\loadallproblems[</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">filename</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">]{</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">filename</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">}}%</span> + <br /><span +class="ec-lmtt-10">\foreachproblem[</span><span +class="lmsy-10">⟨</span><span +class="ec-lmri-10">filename</span><span +class="lmsy-10">⟩</span><span +class="ec-lmtt-10">]{\PSNitem\thisproblem\endPSNitem}</span></span> +</p><!--l. 755--><p class="indent" > Note that in both the above cases, a new data set is created with the same name as +the file name. + + + +</p><!--l. 758--><p class="indent" > <a + id="likesection.1"></a><a + id="Q1-1-12"></a> +</p> +<!--l. 2--><p class="noindent" ><a +href="#top">Top</a></p><h3 class="likesectionHead"><a + id="x1-1200010"></a>Index</h3> +<!--l. 4--><p class="noindent" > <span +class="ec-lmbx-10">A</span> +</p> + <div class="theindex"><span class="index-item"><span +class="ec-lmss-10">alltt </span>package  <a +href="probsoln-manual.html#dx1-4020" >1</a>, <a +href="probsoln-manual.html#dx1-6028" >2</a> <br /></span> +<p class="theindex"> <span +class="ec-lmbx-10">B</span> +<span class="index-item"><span +class="ec-lmss-10">babel </span>package  <a +href="probsoln-manual.html#dx1-6011" >3</a> <br /></span> +</p><p class="theindex"> <span +class="ec-lmbx-10">C</span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\correctitem</span></span></span>  <a +href="probsoln-manual.html#dx1-5015" ><span +class="ec-lmri-10">4</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\correctitemformat</span></span></span>  <a +href="probsoln-manual.html#dx1-5018" ><span +class="ec-lmri-10">5</span></a> <br /></span> +</p><p class="theindex"> <span +class="ec-lmbx-10">D</span> +<span class="index-item"><span +class="ec-lmtt-10">defproblem </span>(environment)  <a +href="probsoln-manual.html#dx1-4021" ><span class="underline">6</span></a>, <a +href="probsoln-manual.html#dx1-6008" ><span +class="ec-lmri-10">7</span></a>, <a +href="probsoln-manual.html#dx1-6012" ><span class="underline">8</span></a>, <a +href="probsoln-manual.html#dx1-6016" ><span class="underline">9</span></a>, <a +href="probsoln-manual.html#dx1-6026" ><span class="underline">10</span></a>, <a +href="probsoln-manual.html#dx1-7001" ><span class="underline">11</span></a>, <a +href="probsoln-manual.html#dx1-8008" ><span class="underline">12</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\doforrandN</span></span></span>  <a +href="probsoln-manual.html#dx1-10008" ><span +class="ec-lmri-10">13</span></a> <br /></span> +</p><p class="theindex"> <span +class="ec-lmbx-10">E</span> +<span class="index-item"><span +class="ec-lmtt-10">enumerate </span>(environment)  <a +href="probsoln-manual.html#dx1-5011" ><span class="underline">14</span></a>, <a +href="probsoln-manual.html#dx1-5013" ><span class="underline">15</span></a>, <a +href="probsoln-manual.html#dx1-9021" ><span class="underline">16</span></a> <br /></span> +<span class="index-item">environments:<br /></span> +<span class="index-subitem">    <span +class="ec-lmtt-10">defproblem</span>  <a +href="probsoln-manual.html#dx1-4022" ><span class="underline">17</span></a>, <a +href="probsoln-manual.html#dx1-6009" ><span +class="ec-lmri-10">18</span></a>, <a +href="probsoln-manual.html#dx1-6013" ><span class="underline">19</span></a>, <a +href="probsoln-manual.html#dx1-6017" ><span class="underline">20</span></a>, <a +href="probsoln-manual.html#dx1-6027" ><span class="underline">21</span></a>, <a +href="probsoln-manual.html#dx1-7002" ><span class="underline">22</span></a>, <a +href="probsoln-manual.html#dx1-8009" ><span class="underline">23</span></a> <br /></span> +<span class="index-subitem">    <span +class="ec-lmtt-10">enumerate</span>  <a +href="probsoln-manual.html#dx1-5012" ><span class="underline">24</span></a>, <a +href="probsoln-manual.html#dx1-5014" ><span class="underline">25</span></a>, <a +href="probsoln-manual.html#dx1-9022" ><span class="underline">26</span></a> <br /></span> +<span class="index-subitem">    <span +class="ec-lmtt-10">onlyproblem</span>  <a +href="probsoln-manual.html#dx1-4009" ><span +class="ec-lmri-10">27</span></a>, <a +href="probsoln-manual.html#dx1-4011" ><span class="underline">28</span></a>, <a +href="probsoln-manual.html#dx1-4019" ><span class="underline">29</span></a>, <a +href="probsoln-manual.html#dx1-6002" ><span class="underline">30</span></a>, <a +href="probsoln-manual.html#dx1-9016" ><span class="underline">31</span></a> <br /></span> +<span class="index-subitem">    <span +class="ec-lmtt-10">onlysolution</span>  <a +href="probsoln-manual.html#dx1-4013" ><span +class="ec-lmri-10">32</span></a>, <a +href="probsoln-manual.html#dx1-4015" ><span class="underline">33</span></a>, <a +href="probsoln-manual.html#dx1-6004" ><span class="underline">34</span></a>, <a +href="probsoln-manual.html#dx1-9009" ><span class="underline">35</span></a>, <a +href="probsoln-manual.html#dx1-9013" ><span class="underline">36</span></a>, <a +href="probsoln-manual.html#dx1-9018" ><span class="underline">37</span></a> <br /></span> +<span class="index-subitem">    <span +class="ec-lmtt-10">solution</span>  <a +href="probsoln-manual.html#dx1-5002" ><span +class="ec-lmri-10">38</span></a>, <a +href="probsoln-manual.html#dx1-5005" ><span class="underline">39</span></a>, <a +href="probsoln-manual.html#dx1-5008" ><span class="underline">40</span></a> <br /></span> +<span class="index-subitem">    <span +class="ec-lmtt-10">textenum</span>  <a +href="probsoln-manual.html#dx1-5010" ><span +class="ec-lmri-10">41</span></a> <br /></span> +</p><p class="theindex"> <span +class="ec-lmbx-10">F</span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\foreachdataset</span></span></span>  <a +href="probsoln-manual.html#dx1-9014" ><span +class="ec-lmri-10">42</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\foreachproblem</span></span></span>  <a +href="probsoln-manual.html#dx1-6019" ><span class="underline">43</span></a>, <a +href="probsoln-manual.html#dx1-6024" ><span class="underline">44</span></a>, <a +href="probsoln-manual.html#dx1-9002" ><span +class="ec-lmri-10">45</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\foreachsolution</span></span></span>  <a +href="probsoln-manual.html#dx1-4023" ><span class="underline">46</span></a>, <a +href="probsoln-manual.html#dx1-9007" ><span +class="ec-lmri-10">47</span></a> <br /></span> +<span class="index-item"><span +class="ec-lmss-10">fp </span>package  <a +href="probsoln-manual.html#dx1-6022" >48</a> <br /></span> +</p><p class="theindex"> <span +class="ec-lmbx-10">H</span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\hideanswers</span></span></span>  <a +href="probsoln-manual.html#dx1-4004" ><span +class="ec-lmri-10">49</span></a>, <a +href="probsoln-manual.html#dx1-6007" ><span class="underline">50</span></a>, <a +href="probsoln-manual.html#dx1-9019" ><span class="underline">51</span></a> <br /></span> +</p><p class="theindex"> <span +class="ec-lmbx-10">I</span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\ifshowanswers</span></span></span>  <a +href="probsoln-manual.html#dx1-4007" ><span class="underline">52</span></a>, <a +href="probsoln-manual.html#dx1-5006" ><span class="underline">53</span></a> <br /></span> + + + +<span class="index-item"><span +class="ec-lmss-10">ifthen </span>package  <a +href="probsoln-manual.html#dx1-4006" >54</a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\include</span></span></span>  <a +href="probsoln-manual.html#dx1-6015" ><span class="underline">55</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\incorrectitem</span></span></span>  <a +href="probsoln-manual.html#dx1-5016" ><span +class="ec-lmri-10">56</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\incorrectitemformat</span></span></span>  <a +href="probsoln-manual.html#dx1-5019" ><span +class="ec-lmri-10">57</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\input</span></span></span>  <a +href="probsoln-manual.html#dx1-6014" ><span class="underline">58</span></a>, <a +href="probsoln-manual.html#dx1-8001" ><span class="underline">59</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\item</span></span></span>  <a +href="probsoln-manual.html#dx1-5017" ><span class="underline">60</span></a> <br /></span> +</p><p class="theindex"> <span +class="ec-lmbx-10">L</span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\loadallproblems</span></span></span>  <a +href="probsoln-manual.html#dx1-8002" ><span +class="ec-lmri-10">61</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\loadexceptproblems</span></span></span>  <a +href="probsoln-manual.html#dx1-8004" ><span +class="ec-lmri-10">62</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\loadrandomexcept</span></span></span>  <a +href="probsoln-manual.html#dx1-8006" ><span +class="ec-lmri-10">63</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\loadrandomproblems</span></span></span>  <a +href="probsoln-manual.html#dx1-8005" ><span +class="ec-lmri-10">64</span></a>, <a +href="probsoln-manual.html#dx1-10001" ><span class="underline">65</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\loadselectedproblems</span></span></span>  <a +href="probsoln-manual.html#dx1-8003" ><span +class="ec-lmri-10">66</span></a> <br /></span> +</p><p class="theindex"> <span +class="ec-lmbx-10">N</span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\newproblem</span></span></span>  <a +href="probsoln-manual.html#dx1-6021" ><span +class="ec-lmri-10">67</span></a>, <a +href="probsoln-manual.html#dx1-7003" ><span class="underline">68</span></a>, <a +href="probsoln-manual.html#dx1-8010" ><span class="underline">69</span></a>, <a +href="probsoln-manual.html#dx1-11002" ><span class="underline">70</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\newproblem*</span></span></span>  <a +href="probsoln-manual.html#dx1-6025" ><span +class="ec-lmri-10">71</span></a>, <a +href="probsoln-manual.html#dx1-8011" ><span class="underline">72</span></a>, <a +href="probsoln-manual.html#dx1-11003" ><span class="underline">73</span></a> <br /></span> +<span class="index-item"><span +class="ec-lmss-10">ngerman </span>package  <a +href="probsoln-manual.html#dx1-6010" >74</a> <br /></span> +</p><p class="theindex"> <span +class="ec-lmbx-10">O</span> +<span class="index-item"><span +class="ec-lmtt-10">onlyproblem </span>(environment)  <a +href="probsoln-manual.html#dx1-4008" ><span +class="ec-lmri-10">75</span></a>, <a +href="probsoln-manual.html#dx1-4010" ><span class="underline">76</span></a>, <a +href="probsoln-manual.html#dx1-4018" ><span class="underline">77</span></a>, <a +href="probsoln-manual.html#dx1-6001" ><span class="underline">78</span></a>, <a +href="probsoln-manual.html#dx1-9015" ><span class="underline">79</span></a> <br /></span> +<span class="index-item"><span +class="ec-lmtt-10">onlysolution </span>(environment)  <a +href="probsoln-manual.html#dx1-4012" ><span +class="ec-lmri-10">80</span></a>, <a +href="probsoln-manual.html#dx1-4014" ><span class="underline">81</span></a>, <a +href="probsoln-manual.html#dx1-6003" ><span class="underline">82</span></a>, <a +href="probsoln-manual.html#dx1-9008" ><span class="underline">83</span></a>, <a +href="probsoln-manual.html#dx1-9012" ><span class="underline">84</span></a>, <a +href="probsoln-manual.html#dx1-9017" ><span class="underline">85</span></a> <br /></span> +</p><p class="theindex"> <span +class="ec-lmbx-10">P</span> +<span class="index-item">package options:<br /></span> +<span class="index-subitem">    <span +class="ec-lmss-10">answers</span>  <a +href="probsoln-manual.html#dx1-3001" ><span class="underline">86</span></a>, <a +href="probsoln-manual.html#dx1-4001" ><span class="underline">87</span></a>, <a +href="probsoln-manual.html#dx1-9011" ><span class="underline">88</span></a> <br /></span> +<span class="index-subitem">    <span +class="ec-lmss-10">draft</span>  <a +href="probsoln-manual.html#dx1-3003" ><span class="underline">89</span></a> <br /></span> +<span class="index-subitem">    <span +class="ec-lmss-10">final</span>  <a +href="probsoln-manual.html#dx1-3004" ><span class="underline">90</span></a> <br /></span> +<span class="index-subitem">    <span +class="ec-lmss-10">noanswers</span>  <a +href="probsoln-manual.html#dx1-3002" ><span class="underline">91</span></a>, <a +href="probsoln-manual.html#dx1-4002" ><span class="underline">92</span></a> <br /></span> +<span class="index-subitem">    <span +class="ec-lmss-10">nousedefaultargs</span>  <a +href="probsoln-manual.html#dx1-3007" ><span class="underline">93</span></a> <br /></span> +<span class="index-subitem">    <span +class="ec-lmss-10">usedefaultargs</span>  <a +href="probsoln-manual.html#dx1-3005" ><span class="underline">94</span></a>, <a +href="probsoln-manual.html#dx1-6020" ><span class="underline">95</span></a>, <a +href="probsoln-manual.html#dx1-9005" ><span class="underline">96</span></a> <br /></span> +<span class="index-item"><span +class="ec-lmss-10">pgfmath </span>package  <a +href="probsoln-manual.html#dx1-6023" >97</a> <br /></span> +<span class="index-item"><span +class="ec-lmss-10">probsoln </span>package  <a +href="probsoln-manual.html#dx1-11001" >98</a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\PSNgetrandseed</span></span></span>  <a +href="probsoln-manual.html#dx1-10005" ><span +class="ec-lmri-10">99</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\PSNrandom</span></span></span>  <a +href="probsoln-manual.html#dx1-10006" ><span +class="ec-lmri-10">100</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\PSNrandseed</span></span></span>  <a +href="probsoln-manual.html#dx1-10003" ><span +class="ec-lmri-10">101</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\PSNuseoldrandom</span></span></span>  <a +href="probsoln-manual.html#dx1-8007" ><span +class="ec-lmri-10">102</span></a>, <a +href="probsoln-manual.html#dx1-10002" ><span +class="ec-lmri-10">103</span></a> <br /></span> +</p><p class="theindex"> <span +class="ec-lmbx-10">R</span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\random</span></span></span>  <a +href="probsoln-manual.html#dx1-10007" ><span +class="ec-lmri-10">104</span></a> <br /></span> +</p><p class="theindex"> <span +class="ec-lmbx-10">S</span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\selectallproblems</span></span></span>  <a +href="probsoln-manual.html#dx1-11006" ><span +class="ec-lmri-10">105</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\selectrandomly</span></span></span>  <a +href="probsoln-manual.html#dx1-11004" ><span class="underline">106</span></a>, <a +href="probsoln-manual.html#dx1-11005" ><span +class="ec-lmri-10">107</span></a> <br /></span> + + + +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\showanswers</span></span></span>  <a +href="probsoln-manual.html#dx1-4003" ><span +class="ec-lmri-10">108</span></a>, <a +href="probsoln-manual.html#dx1-6006" ><span class="underline">109</span></a>, <a +href="probsoln-manual.html#dx1-9010" ><span class="underline">110</span></a>, <a +href="probsoln-manual.html#dx1-9020" ><span class="underline">111</span></a> <br /></span> +<span class="index-item"><span +class="ec-lmss-10">showanswers </span>boolean variable  <a +href="probsoln-manual.html#dx1-4005" >112</a>, <a +href="probsoln-manual.html#dx1-4016" >113</a>, <a +href="probsoln-manual.html#dx1-4017" >114</a>, <a +href="probsoln-manual.html#dx1-6005" >115</a> <br /></span> +<span class="index-item"><span +class="ec-lmtt-10">solution </span>(environment)  <a +href="probsoln-manual.html#dx1-5001" ><span +class="ec-lmri-10">116</span></a>, <a +href="probsoln-manual.html#dx1-5004" ><span class="underline">117</span></a>, <a +href="probsoln-manual.html#dx1-5007" ><span class="underline">118</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\solutionname</span></span></span>  <a +href="probsoln-manual.html#dx1-5003" ><span +class="ec-lmri-10">119</span></a> <br /></span> +</p><p class="theindex"> <span +class="ec-lmbx-10">T</span> +<span class="index-item"><span +class="ec-lmtt-10">textenum </span>(environment)  <a +href="probsoln-manual.html#dx1-5009" ><span +class="ec-lmri-10">120</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\theenumi</span></span></span>  <a +href="probsoln-manual.html#dx1-9023" ><span class="underline">121</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\thisproblem</span></span></span>  <a +href="probsoln-manual.html#dx1-3006" ><span class="underline">122</span></a>, <a +href="probsoln-manual.html#dx1-3008" ><span class="underline">123</span></a>, <a +href="probsoln-manual.html#dx1-6018" ><span class="underline">124</span></a>, <a +href="probsoln-manual.html#dx1-9003" ><span +class="ec-lmri-10">125</span></a> <br /></span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\thisproblemlabel</span></span></span>  <a +href="probsoln-manual.html#dx1-9004" ><span +class="ec-lmri-10">126</span></a> <br /></span> +</p><p class="theindex"> <span +class="ec-lmbx-10">U</span> +<span class="index-item"><span class="obeylines-h"><span class="verb"><span +class="ec-lmtt-10">\useproblem</span></span></span>  <a +href="probsoln-manual.html#dx1-7004" ><span +class="ec-lmri-10">127</span></a>, <a +href="probsoln-manual.html#dx1-9001" ><span class="underline">128</span></a>, <a +href="probsoln-manual.html#dx1-9006" ><span class="underline">129</span></a> <br /></span> +</p></div> + <div class="footnotes"><!--l. 623--><p class="indent" > <span class="footnote-mark"><a +href="#fn1x0-bk" id="fn1x0"><sup class="textsuperscript">1</sup></a></span><span +class="ec-lmr-8">assuming you leave at least a minute between runs.</span></p> </div> + +</body></html> + + + -\item Solve the following: -\newcount\oldseed -\PSNgetrandseed{\oldseed} -\begin{enumerate} -\selectrandomly{file2}{4} -\end{enumerate} -\PSNrandseed{\oldseed} - -\selectrandomly{file3}{2} -\end{enumerate} -</PRE> - -<P> - -<BR CLEAR="ALL"> -<HR><TT>\selectrandomly</TT><A NAME="905"></A><TT>{</TT><EM>filename</EM><TT>}{</TT><EM>n</EM><TT>}</TT> -<BR CLEAR="ALL"> -<HR>This is now equivalent to: -<TT> -{<TT>\loadrandomproblems[</TT><EM>filename</EM><TT>]{</TT><EM>n</EM><TT>}{</TT><EM>filename</EM><TT>}</TT>}% -<TT>\foreachproblem[</TT><EM>filename</EM><TT>]{</TT><EM><TT>\PSNitem\thisproblem\endPSNitem</TT></EM><TT>}</TT> -</TT> - -<P> - -<BR CLEAR="ALL"> -<HR><TT>\selectallproblems</TT><A NAME="908"></A><TT>{</TT><EM>filename</EM><TT>}</TT> -<BR CLEAR="ALL"> -<HR>This is now equivalent to: -<TT> -{<TT>\loadallproblems[</TT><EM>filename</EM><TT>]{</TT><EM>filename</EM><TT>}</TT>}% -<TT>\foreachproblem[</TT><EM>filename</EM><TT>]{</TT><EM><TT>\PSNitem\thisproblem\endPSNitem</TT></EM><TT>}</TT> -</TT> - -<P> -Note that in both the above cases, a new data set is created -with the same name as the file name. - -<P> - -<P> -<A HREF="probsoln-manual.html#top">Top</A> - -<P> - -<P> -<BR> - -<H2><A NAME="SECTION000120000000000000000"> -Index</A> -</H2><DL COMPACT> -<DT><STRONG><TT>alltt</TT></STRONG> -<DD><A HREF="probsoln-manual.html#718">3</A> - | <A HREF="probsoln-manual.html#802">5</A> -<DT><STRONG><TT>babel</TT></STRONG> -<DD><A HREF="probsoln-manual.html#784">5</A> -<DT><STRONG><TT>\correctitem</TT></STRONG> -<DD><A HREF="probsoln-manual.html#747">4</A> -<DT><STRONG><TT>\correctitemformat</TT></STRONG> -<DD><A HREF="probsoln-manual.html#756">4</A> -<DT><STRONG><TT>defproblem</TT> environment</STRONG> -<DD><A HREF="probsoln-manual.html#1565">5</A> - | <A HREF="probsoln-manual.html#799">5</A> - | <A HREF="probsoln-manual.html#808">6</A> - | <A HREF="probsoln-manual.html#829">7</A> -<DT><STRONG><TT>\doforrandN</TT></STRONG> -<DD><A HREF="probsoln-manual.html#889">9</A> -<DT><STRONG><TT>enumerate</TT> environment</STRONG> -<DD><A HREF="probsoln-manual.html#734">4</A> - | <A HREF="probsoln-manual.html#739">4</A> - | <A HREF="probsoln-manual.html#865">8</A> -<DT><STRONG><TT>\foreachdataset</TT></STRONG> -<DD><A HREF="probsoln-manual.html#850">8</A> -<DT><STRONG><TT>\foreachproblem</TT></STRONG> -<DD><A HREF="probsoln-manual.html#844">8</A> -<DT><STRONG><TT>fp</TT></STRONG> -<DD><A HREF="probsoln-manual.html#793">5</A> -<DT><STRONG><TT>\hideanswers</TT></STRONG> -<DD><A HREF="probsoln-manual.html#778">5</A> - | <A HREF="probsoln-manual.html#859">8</A> -<DT><STRONG><TT>\ifshowanswers</TT></STRONG> -<DD><A HREF="probsoln-manual.html#700">3</A> - | <A HREF="probsoln-manual.html#728">4</A> -<DT><STRONG><TT>ifthen</TT></STRONG> -<DD><A HREF="probsoln-manual.html#697">3</A> -<DT><STRONG><TT>\incorrectitem</TT></STRONG> -<DD><A HREF="probsoln-manual.html#750">4</A> -<DT><STRONG><TT>\incorrectitemformat</TT></STRONG> -<DD><A HREF="probsoln-manual.html#759">4</A> -<DT><STRONG><TT>\input</TT></STRONG> -<DD><A HREF="probsoln-manual.html#817">7</A> -<DT><STRONG><TT>\item</TT></STRONG> -<DD><A HREF="probsoln-manual.html#753">4</A> -<DT><STRONG><TT>\loadallproblems</TT></STRONG> -<DD><A HREF="probsoln-manual.html#820">7</A> -<DT><STRONG><TT>\loadrandomproblems</TT></STRONG> -<DD><A HREF="probsoln-manual.html#826">7</A> - | <A HREF="probsoln-manual.html#874">9</A> -<DT><STRONG><TT>\loadselectedproblems</TT></STRONG> -<DD><A HREF="probsoln-manual.html#823">7</A> -<DT><STRONG><TT>\newproblem</TT></STRONG> -<DD><A HREF="probsoln-manual.html#790">5</A> - | <A HREF="probsoln-manual.html#832">7</A> - | <A HREF="probsoln-manual.html#896">10</A> -<DT><STRONG><TT>\newproblem*</TT></STRONG> -<DD><A HREF="probsoln-manual.html#796">5</A> - | <A HREF="probsoln-manual.html#835">7</A> - | <A HREF="probsoln-manual.html#899">10</A> -<DT><STRONG><TT>ngerman</TT></STRONG> -<DD><A HREF="probsoln-manual.html#781">5</A> -<DT><STRONG><TT>onlyproblem</TT> environment</STRONG> -<DD><A HREF="probsoln-manual.html#1547">3</A> - | <A HREF="probsoln-manual.html#712">3</A> - | <A HREF="probsoln-manual.html#766">5</A> - | <A HREF="probsoln-manual.html#853">8</A> -<DT><STRONG><TT>onlysolution</TT> environment</STRONG> -<DD><A HREF="probsoln-manual.html#1551">3</A> - | <A HREF="probsoln-manual.html#715">3</A> - | <A HREF="probsoln-manual.html#725">4</A> - | <A HREF="probsoln-manual.html#769">5</A> - | <A HREF="probsoln-manual.html#856">8</A> -<DT><STRONG>package options</STRONG> -<DD><DL COMPACT> -<DT><STRONG><TT>answers</TT></STRONG> -<DD><A HREF="probsoln-manual.html#673">2</A> - | <A HREF="probsoln-manual.html#688">3</A> -<DT><STRONG><TT>draft</TT></STRONG> -<DD><A HREF="probsoln-manual.html#679">2</A> -<DT><STRONG><TT>final</TT></STRONG> -<DD><A HREF="probsoln-manual.html#682">2</A> -<DT><STRONG><TT>noanswers</TT></STRONG> -<DD><A HREF="probsoln-manual.html#676">2</A> - | <A HREF="probsoln-manual.html#691">3</A> -</DL> -<DT><STRONG><TT>\PSNgetrandseed</TT></STRONG> -<DD><A HREF="probsoln-manual.html#880">9</A> -<DT><STRONG><TT>\PSNrandom</TT></STRONG> -<DD><A HREF="probsoln-manual.html#883">9</A> -<DT><STRONG><TT>\PSNrandseed</TT></STRONG> -<DD><A HREF="probsoln-manual.html#877">9</A> -<DT><STRONG><TT>\random</TT></STRONG> -<DD><A HREF="probsoln-manual.html#886">9</A> -<DT><STRONG><TT>\selectallproblems</TT></STRONG> -<DD><A HREF="probsoln-manual.html#908">10</A> -<DT><STRONG><TT>\selectrandomly</TT></STRONG> -<DD><A HREF="probsoln-manual.html#902">10</A> - | <A HREF="probsoln-manual.html#905">10</A> -<DT><STRONG><TT>\showanswers</TT></STRONG> -<DD><A HREF="probsoln-manual.html#775">5</A> - | <A HREF="probsoln-manual.html#862">8</A> -<DT><STRONG><TT>showanswers</TT> boolean variable</STRONG> -<DD><A HREF="probsoln-manual.html#694">3</A> - | <A HREF="probsoln-manual.html#705">3</A> - | <A HREF="probsoln-manual.html#708">3</A> - | <A HREF="probsoln-manual.html#772">5</A> -<DT><STRONG>\textttsolution environment</STRONG> -<DD><A HREF="probsoln-manual.html#1556">4</A> -<DT><STRONG><TT>textenum</TT> environment</STRONG> -<DD><A HREF="probsoln-manual.html#1560">4</A> - | <A HREF="probsoln-manual.html#743">4</A> -<DT><STRONG><TT>\theenumi</TT></STRONG> -<DD><A HREF="probsoln-manual.html#868">8</A> -<DT><STRONG><TT>\useproblem</TT></STRONG> -<DD><A HREF="probsoln-manual.html#811">6</A> - | <A HREF="probsoln-manual.html#841">8</A> - | <A HREF="probsoln-manual.html#847">8</A> - -</DL> -<P> -<A HREF="probsoln-manual.html#top">Top</A> -<BR><HR><H4>Footnotes</H4> -<DL> -<DT><A NAME="foot462">... document,</A><A - HREF="probsoln-manual.html#tex2html3"><SUP>1</SUP></A></DT> -<DD>assuming you -leave at least a minute between runs. - -</DD> -</DL> -<BR><HR> - -</BODY> -</HTML> diff --git a/Master/texmf-dist/doc/latex/probsoln/probsoln-manual.tex b/Master/texmf-dist/doc/latex/probsoln/probsoln-manual.tex index aae8befbed2..c7454082cc1 100644 --- a/Master/texmf-dist/doc/latex/probsoln/probsoln-manual.tex +++ b/Master/texmf-dist/doc/latex/probsoln/probsoln-manual.tex @@ -1,99 +1,31 @@ -\documentclass[a4paper]{ltxdoc} +\documentclass[a4paper]{nlctdoc} + +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{lmodern} +\usepackage{color} +\usepackage{creatdtx} +\usepackage{probsoln} + \usepackage[colorlinks, bookmarks, hyperindex=false, pdfauthor={Nicola L.C. Talbot}, pdftitle={probsoln: creating problem sheets optionally with solutions}]{hyperref} +\doxitem{Option}{option}{package options} -\usepackage{color} -\usepackage{creatdtx} -\ifmakedtx{ -\usepackage{probsoln} \RecordChanges \PageIndex -\CheckSum{886} - -\renewcommand{\usage}[1]{\textit{\hyperpage{#1}}} -\renewcommand{\main}[1]{\hyperpage{#1}} -\newcommand{\see}[2]{\emph{see} #1} -\makeatletter -\def\index@prologue{\section*{Index}} -\makeatother -\CodelineNumbered -\newcommand{\dq}[1]{``#1''} - -\definecolor{defbackground}{rgb}{0.8,1,1} - -\newsavebox\defsbox -\newlength\defwidth -\newenvironment{definition}{% -\setlength{\fboxsep}{4pt}\setlength{\fboxrule}{1.25pt}% -\begin{lrbox}{\defsbox}% -\setlength\defwidth\linewidth -\addtolength\defwidth{-2\fboxrule}% -\addtolength\defwidth{-2\fboxsep}% -\begin{minipage}{\defwidth}\flushleft -}{% -\end{minipage} -\end{lrbox}% -\vskip10pt -\noindent -\fcolorbox{black}{defbackground}{\usebox\defsbox}% -\vskip10pt -} +\CheckSum{1144} -\newlength\boxlength -\newsavebox\importantbox -\newenvironment{important}{% -\setlength{\fboxrule}{4pt}% -\setlength\boxlength{\linewidth}% -\addtolength\boxlength{-2\fboxsep}% -\addtolength\boxlength{-2\fboxrule}% -\begin{lrbox}{\importantbox}% -\begin{minipage}{\boxlength}% -}{\end{minipage}\end{lrbox}% -\par\vskip10pt\noindent -\fcolorbox{red}{white}{\usebox{\importantbox}}\par\vskip10pt} -} -{ -\usepackage{html} -\usepackage{makeidx} -\renewcommand{\LaTeX}{LaTeX} -\renewcommand{\LaTeXe}{LaTeX2e} -\newcommand{\dq}[1]{"#1"} -\newenvironment{important}{\textbf{NOTE:} }{} -\newenvironment{definition}{\htmlrule}{\htmlrule} -\html{\newcommand{\SpecialMainIndex}[1]{\index{#1@\cs{#1}}}} -} - -\newcommand*{\ics}[1]{\cs{#1}\SpecialMainIndex{#1}} +\newcommand*{\dq}[1]{``#1''} -\ifmakedtx{ -\newcommand{\pkgopt}[1]{\textsf{#1}\index{package options>#1=\textsf{#1}|hyperpage}} -\newcommand*{\sty}[1]{\textsf{#1}} -\newcommand*{\isty}[1]{\sty{#1}\index{#1 package=\sty{#1} package|hyperpage}} -\newcommand*{\env}[1]{\textsf{#1}} -\newcommand{\ienv}[1]{\env{#1}\index{#1 environment=\env{#1} environment|hyperpage}} -\newcommand*{\bool}[1]{\textsf{#1}\index{#1 boolean variable=\textsf{#1} boolean variable|hyperpage}} -\newcommand{\csdef}[1]{\cs{#1}} -} -{ -\newcommand{\pkgopt}[1]{\texttt{#1}\index{package options!#1@\texttt{#1}}} -\newcommand{\sty}[1]{\texttt{#1}} -\newcommand{\isty}[1]{\sty{#1}\index{#1@\sty{#1}}} -\newcommand{\env}[1]{\texttt{#1}} -\newcommand{\ienv}[1]{\env{#1}\index{#1 environment@\env{#1} environment}} -\newcommand*{\bool}[1]{\texttt{#1}\index{#1 boolean variable@\texttt{#1} boolean variable}} -\newcommand{\csdef}[1]{\ics{#1}} -\renewcommand{\DescribeEnv}[1]{\index{#1 environment@\env{#1} environment}} -\newcommand{\toTop}{\mbox{}\par\htmlref{Top}{top}} -} - -\begin{document}\ifmakedtx{}{\label{top}} +\begin{document} \MakeShortVerb{"} \DeleteShortVerb{\|} - \title{probsoln v3.0: creating problem sheets optionally with solutions} + \title{probsoln v3.01: +creating problem sheets optionally with solutions} \author{Nicola L.C. Talbot\\[10pt] School of Computing Sciences\\ University of East Anglia\\ @@ -101,28 +33,25 @@ Norwich. Norfolk\\ NR4 7TJ. United Kingdom.\\ \url{http://theoval.cmp.uea.ac.uk/~nlct/}} - \date{26th August 2008} + \date{2011-08-22} \maketitle \tableofcontents \section{Introduction} -The \sty{probsoln} package is designed for teachers or -lecturers who want to create problem sheets for their -students. This package was designed with specifically -mathematics problems in mind, but can be used for other -subjects as well. The idea is to create a file containing a -large number of problems with their solutions which can be -read in by \LaTeX, and then select a number of problems to -typeset. This means that once the database has been set up, -each year you can easily create a new problem sheet that is -sufficiently different from the previous year, thus -preventing the temptation of current students seeking out -the previous year's students, and checking out their -answers. There is also an option that can be passed to the -package to determine whether or not the solutions should be -printed. In this way, one file can either produce the -student's version or the teacher's version. -\ifmakedtx{}{\toTop} +The \styfmt{probsoln} package is designed for teachers or lecturers +who want to create problem sheets for their students. This package +was designed with mathematics problems in mind, but can be used for +other subjects as well. The idea is to create a file containing a +large number of problems with their solutions which can be read in +by \LaTeX, and then select a number of problems to typeset. This +means that once the database has been set up, each year you can +easily create a new problem sheet that is sufficiently different +from the previous year, thus preventing the temptation of current +students seeking out the previous year's students, and checking out +their answers. There is also an option that can be passed to the +package to determine whether or not the solutions should be printed. +In this way, one file can either produce the student's version or +the teacher's version. \section{Package Options}\label{sec:pkgopt} The following options may be passed to this package: @@ -131,18 +60,29 @@ The following options may be passed to this package: \item[\pkgopt{noanswers}] Don't show the answers (default) \item[\pkgopt{draft}] Display the label and dataset name when a problem is used \item[\pkgopt{final}] Don't display label and dataset name when a problem is used +\item[\pkgopt{usedefaultargs}] Make \ics{thisproblem} use the +default arguments supplied in the problem definition. +\item[\pkgopt{nousedefaultargs}] Make \ics{thisproblem} prompt for +problem arguments (default). \end{description} -\ifmakedtx{}{\toTop} \section{Showing and Hiding Solutions}\label{sec:showanswers} In addition to the \pkgopt{answers} and \pkgopt{noanswers} package options, it is also possible to show or suppress the solutions -using \DescribeMacro{\showanswers}\cs{showanswers} and -\DescribeMacro{\hideanswers}\cs{hideanswers}, respectively. +using +\begin{definition}[\DescribeMacro{\showanswers}] +\cs{showanswers} +\end{definition} +and +\begin{definition}[\DescribeMacro{\hideanswers}] +\cs{hideanswers} +\end{definition} +respectively. + The boolean variable \bool{showanswers} determines whether the answers should be displayed. You can use this value with the -\isty{ifthen} package to specify different text depending on +\sty{ifthen} package to specify different text depending on whether the solutions should be displayed. For example: \begin{verbatim} Assignment 1\ifthenelse{\boolean{showanswers}}{ (Solution Sheet)}{} @@ -176,87 +116,85 @@ Solution: $f'(x) = 2x$ \end{verbatim} \begin{important} You can't use verbatim text in the body of the -\ienv{onlyproblem} or \ienv{onlysolution} environments. +\envfmt{onlyproblem} or \envfmt{onlysolution} environments. If you need verbatim-like text, then try packages such as -\isty{alltt}. Remember that you also can't use verbatim +\sty{alltt}. Remember that you also can't use verbatim text in command arguments. \end{important} -\ifmakedtx{}{\toTop} + +If you use \envfmt{onlysolution} within the \env{defproblem} +environment, the problem will be tagged as having a solution +and will be added to the list used by \ics{foreachsolution}. \section{General Formatting Commands}\label{sec:formatting} The commands and environments described in this section are provided to assist formatting problems and their solutions. -\DescribeEnv{solution} -\begin{definition} +\begin{definition}[\DescribeEnv{solution}] \verb|\begin{solution}|\meta{text}\verb|\end{solution}| \end{definition} -This is equivalent to -\verb|\par\noindent\textbf{\solutionname}:|\meta{text} +By default, this is equivalent to +\begin{display} +\verb|\par\noindent\textbf{\solutionname}: |\meta{text} +\end{display} where \DescribeMacro{\solutionname}\cs{solutionname} defaults -to \dq{Solution}. Note that you must place the \env{solution} -environment inside the \ienv{onlysolution} environment or +to \dq{\solutionname}. Note that you must place the \env{solution} +environment inside the \envfmt{onlysolution} environment or between \ics{ifshowanswers}\ldots\cs{fi} to ensure that it is suppressed when the solutions are not wanted. (See -\ifmakedtx{\autoref{sec:showanswers}}{\htmlref{Showing and -Hiding Solutions}{sec:showanswers}}.) +\sectionref{sec:showanswers}.) -Note that the \sty{probsoln} package will only define the +Note that the \styfmt{probsoln} package will only define the \env{solution} environment if it is not already defined. -\DescribeEnv{textenum} -\begin{definition} +\begin{definition}[\DescribeEnv{textenum}] \verb|\begin{textenum}|\ldots\verb|\end{textenum}| \end{definition} -The \env{textenum} environment is like the \ienv{enumerate} +The \envfmt{textenum} environment is like the \env{enumerate} environment but is in-line. It uses the same counter that the -\env{enumerate} environment would use at that level so the -question can be compact but the answer can use \env{enumerate} +\envfmt{enumerate} environment would use at that level so the +question can be compact but the answer can use \envfmt{enumerate} instead. For example: \begin{verbatim} \begin{onlyproblem}% -Differentiate the following: -\begin{textenum} -\item $f(x)=2^x$; -\item $f(x)=\cot(x)$ -\end{textenum} + Differentiate the following: + \begin{textenum} + \item $f(x)=2^x$; \item $f(x)=\cot(x)$ + \end{textenum} \end{onlyproblem} \begin{onlysolution} -\begin{enumerate} -\item -\begin{align*} -f(x) &= 2^x = \exp(\ln(x^2)) =\exp(2\ln(x))\\ -f'(x) &= \exp(2\ln(x))\times \frac{2}{x}\\ - &= f(x)\frac{2}{x} -\end{align*} -\item -\begin{align*} -f(x) &= \cot(x) = (\tan(x))^{-2}\\ -f'(x) &= -(\tan(x))^{-2}\times\sec^2(x)\\ -&=-\csc^2x -\end{align*} -\end{enumerate} + \begin{enumerate} + \item + \begin{align*} + f(x) &= 2^x = \exp(\ln(x^2)) =\exp(2\ln(x))\\ + f'(x) &= \exp(2\ln(x))\times \frac{2}{x}\\ + &= f(x)\frac{2}{x} + \end{align*} + \item + \begin{align*} + f(x) &= \cot(x) = (\tan(x))^{-2}\\ + f'(x) &= -(\tan(x))^{-2}\times\sec^2(x)\\ + &=-\csc^2x + \end{align*} + \end{enumerate} \end{onlysolution} \end{verbatim} In this example, the items in the question are brief, so an -\ienv{enumerate} environment would result in a lot of -unnecessary white space, -but the answers require more space, so an \env{enumerate} -environment is more appropriate. Since the \ienv{textenum} -environment uses the same counters as the \env{enumerate} -environment, the question and answer sheets use consistent -labelling. Note that there are other packages available on -CTAN that you can use to create in-line lists. Check the -\ifmakedtx{\href{http://www.tex.ac.uk/tex-archive/help/Catalogue/bytopic.html\#enumeration}{TeX -Catalogue}}{\htmladdnormallink{TeX -Catalogue}{http://www.tex.ac.uk/tex-archive/help/Catalogue/bytopic.html\#enumeration}} for -further details. +\env{enumerate} environment would result in a lot of unnecessary +white space, but the answers require more space, so an +\envfmt{enumerate} environment is more appropriate. Since the +\envfmt{textenum} environment uses the same counters as the +\envfmt{enumerate} environment, the question and answer sheets use +consistent labelling. Note that there are other packages available +on CTAN that you can use to create in-line lists. Check the +\urlfootref{http://www.tex.ac.uk/tex-archive/help/Catalogue/bytopic.html\#enumeration}{TeX +Catalogue} for further details. \DescribeMacro{\correctitem}\DescribeMacro{\incorrectitem} \begin{definition} -\csdef{correctitem}\\ -\csdef{incorrectitem} +\cs{correctitem}\\ +\cs{incorrectitem} \end{definition} You can use the commands \cs{correctitem} and \cs{incorrectitem} in place of \ics{item}. If the solutions are suppressed, these @@ -264,8 +202,8 @@ commands behave in the same way as \cs{item}, otherwise they format the item label using one of the commands: \DescribeMacro{\correctitemformat}\DescribeMacro{\incorrectitemformat} \begin{definition} -\csdef{correctitemformat}\marg{label}\\ -\csdef{incorrectitemformat}\marg{label} +\cs{correctitemformat}\marg{label}\\ +\cs{incorrectitemformat}\marg{label} \end{definition} For example: \begin{verbatim} @@ -278,52 +216,50 @@ become a probability space? \incorrectitem $P(a_1)=\frac{5}{4}$, $P(a_2)=-\frac{1}{4}$ \end{enumerate} \end{verbatim} -\ifmakedtx{}{\toTop} +The default definition of \cs{correctitemformat} puts a frame around +the label. \section{Defining a Problem}\label{sec:defproblem} -It is possible to construct a problem sheet with solutions using -the commands described in the previous sections, however it is -also possible to define a set of problems for later use. In this -way you can create an external file containing many problems some -or all of which can be loaded and used in a document. The -\sty{probsoln} package has a default data set labelled -\dq{default} in which you can store problems or you can create -multiple data sets. You can then iterate through each problem -in a problem set. You can use a previously defined problem more -than once, which means that by judicious use of \ienv{onlyproblem}, -\ienv{onlysolution} or the \bool{showanswers} boolean variable -in conjunction with \ics{showanswers} and \ics{hideanswers}, -you can print the solutions in a different location to the -questions (for example in an appendix). - -\DescribeEnv{defproblem} -\begin{definition} -\verb|\begin{defproblem}|\oarg{n}\marg{label}\meta{definition}\verb|\end{defproblem}| +It is possible to construct a problem sheet with solutions using the +commands described in the previous sections, however it is also +possible to define a set of problems for later use. In this way you +can create an external file containing many problems some or all of +which can be loaded and used in a document. The \styfmt{probsoln} +package has a default data set labelled \dq{default} in which you +can store problems. Alternatively, you can create multiple data +sets. You can then iterate through each problem in a problem set. +You can use a previously defined problem more than once, which means +that by judicious use of \env{onlyproblem}, \env{onlysolution} or +the \bool{showanswers} boolean variable in conjunction with +\ics{showanswers} and \ics{hideanswers}, you can print the solutions +in a different location to the questions (for example in an +appendix). + +\begin{definition}[\DescribeEnv{defproblem}] +\verb|\begin{defproblem}|\oarg{n}\oarg{default args}\marg{label}\newline +\meta{definition}\newline +\verb|\end{defproblem}| \end{definition} -This defines the problem whose label is given by \meta{label}. -The label must be unique for a given data set and should not -contain active characters. (Active characters include the special -characters such as \$ and \&, but some packages may make other -symbols active. For example, the \isty{ngerman} and \isty{babel} -packages make certain punctuation active. Check the relevant -package documentation for details.) +This defines the problem whose label is given by \meta{label}. The +label must be unique for a given data set and should not contain +active characters or a comma. (Active characters include the special characters +such as \$ and \&, but some packages may make other symbols active, +such as the colon (:) character. For example, the \sty{ngerman} and +\sty{babel} packages make certain punctuation active. Check the +relevant package documentation for details.) If \env{defproblem} occurs in the document or is included via -\cs{input} or \cs{include}, then the problem will be added to -the default data set. If \env{defproblem} occurs in an external +\ics{input} or \ics{include}, then the problem will be added to +the default data set. If \envfmt{defproblem} occurs in an external file that is loaded using one of the commands defined in -\ifmakedtx{\autoref{sec:load}}{\htmlref{Loading Problems From -External Files}{sec:load}} then the problem will be added to +\sectionref{sec:load} then the problem will be added to the specified data set. -The contents of the \env{defproblem} environment should be the -text that defines the problem. This may include any of the -commands defined in -\ifmakedtx{\autoref{sec:showanswers} and -\autoref{sec:formatting}}{\htmlref{Showing and Hiding -Solutions}{sec:showanswers} and \htmlref{General Formatting -Commands}{sec:formatting}}. +The contents of the \env{defproblem} environment should be the text +that defines the problem. This may include any of the commands +defined in \sectionref{sec:showanswers} and +\sectionref{sec:formatting}. The problem may optionally take \meta{n} arguments (where \meta{n} is from 0 to 9). The arguments can be referenced @@ -335,20 +271,35 @@ The following example defines a problem with one argument: \begin{defproblem}[1]{diffsin} Differentiate $f(x)=\sin(#1x)$. \begin{onlysolution}% -\begin{solution} -$f'(x) = #1\cos(#1x)$ -\end{solution} + \begin{solution} + $f'(x) = #1\cos(#1x)$ + \end{solution} \end{onlysolution} \end{defproblem} \end{verbatim} -\DescribeMacro{\newproblem} -\begin{definition} -\csdef{newproblem}\oarg{n}\marg{label}\marg{problem}\marg{solution} +The second optional argument \meta{default args} supplies +default problem arguments that will automatically be used within +\ics{thisproblem} when used in \ics{foreachproblem} in conjunction +with the package option \pkgopt{usedefaultargs}. (See \sectionref{sec:foreach}.) +For example: +\begin{verbatim} +\begin{defproblem}[1][{2}]{diffsin} +Differentiate $f(x)=\sin(#1x)$. +\begin{onlysolution}% + \begin{solution} + $f'(x) = #1\cos(#1x)$ + \end{solution} +\end{onlysolution} +\end{defproblem} +\end{verbatim} + +\begin{definition}[\DescribeMacro{\newproblem}] +\cs{newproblem}\oarg{n}\oarg{default args}\marg{label}\marg{problem}\marg{solution} \end{definition} This is a shortcut command for: \begin{ttfamily}\obeylines -\cs{begin}\{defproblem\}\oarg{n}\marg{label}\% +\cs{begin}\{defproblem\}\oarg{n}\oarg{default args}\marg{label}\% \meta{problem}\% \cs{begin}\{onlysolution\}\% \cs{begin}\{solution\}\% @@ -360,65 +311,72 @@ This is a shortcut command for: For example: \begin{verbatim} \newproblem[1]{diffsin}{% -\(f(x) = \sin(#1x)\) -}{% -\(f'(x) = #1\cos(#1x)\) + \(f(x) = \sin(#1x)\) +}% +{% + \(f'(x) = #1\cos(#1x)\) } \end{verbatim} is equivalent to \begin{verbatim} \begin{defproblem}[1]{diffcos}% -\(f(x) = \cos(#1x)\) + \(f(x) = \cos(#1x)\) \begin{onlysolution}% -\begin{solution}% -\(f'(x) = -#1\sin(#1x)\) -\end{solution}% + \begin{solution}% + \(f'(x) = -#1\sin(#1x)\) + \end{solution}% \end{onlysolution}% \end{defproblem} \end{verbatim} (In this example, the argument will need to be a positive number to avoid a double minus in the answer. If you want to perform floating point arithmetic on the arguments, then try the -\isty{fp} package.) +\sty{fp} or \sty{pgfmath} packages.) -\DescribeMacro{\newproblem*} -\begin{definition} -\csdef{newproblem*}\oarg{n}\marg{label}\marg{definition} +Alternatively, if you want to supply default arguments to use when +iterating through problems with \ics{foreachproblem}: +\begin{verbatim} +\newproblem[1][{3}]{diffsin}{% + \(f(x) = \sin(#1x)\) +}% +{% + \(f'(x) = #1\cos(#1x)\) +} +\end{verbatim} + + +\begin{definition}[\DescribeMacro{\newproblem*}] +\cs{newproblem*}\oarg{n}\oarg{default args}\marg{label}\marg{definition} \end{definition} This is a shortcut for: \begin{ttfamily}\obeylines -\cs{begin}\{defproblem\}\oarg{n}\marg{label}\% +\cs{begin}\{defproblem\}\oarg{n}\oarg{default args}\marg{label}\% \meta{definition}\% \cs{end}\{defproblem\} \end{ttfamily} \begin{important} -Verbatim text must not be used in the contents of \ienv{defproblem} +Verbatim text must not be used in the contents of \env{defproblem} or in any of the arguments to \cs{newproblem} or \cs{newproblem*}. If you need verbatim-like text consider using -\cs{texttt} or the \isty{alltt} package. +\cs{texttt} or the \sty{alltt} package. \end{important} -\ifmakedtx{}{\toTop} \section{Using a Problem}\label{sec:useproblem} -Once you have defined a problem using \ienv{defproblem} or -\cs{newproblem} (see -\ifmakedtx{\autoref{sec:defproblem}}{\htmlref{Defining a -Problem}{sec:defproblem}}), you can later display the problem -using: -\DescribeMacro{\useproblem} -\begin{definition} -\csdef{useproblem}\oarg{data set}\marg{label}\marg{arg\ifmakedtx{$_1$}{\HTMLcode{SUB}{1}}}\ldots -\marg{arg\ifmakedtx{$_N$}{\HTMLcode{SUB}{N}}} +Once you have defined a problem using \env{defproblem} or +\ics{newproblem} (see \sectionref{sec:defproblem}), you can +later display the problem using: +\begin{definition}[\DescribeMacro{\useproblem}] +\cs{useproblem}\oarg{data set}\marg{label}\marg{arg$_1$}\ldots +\marg{arg$_N$} \end{definition} where \meta{data set} is the name of the data set that contains the problem (the default data set is used if omitted), \meta{label} is the label identifying the required problem and -\meta{arg\ifmakedtx{$_1$}{\HTMLcode{SUB}{1}}}, \ldots, -\meta{arg\ifmakedtx{$N$}{\HTMLcode{SUB}{N}}} +\meta{arg$_1$}, \ldots, \meta{arg$_N$} are the arguments to pass to the problem, if the problem was -defined to have arguments (where \ifmakedtx{$N$}{N} is the number +defined to have arguments (where $N$ is the number of arguments specified when the problem was defined). For example, in the previous section the problem \texttt{diffcos} @@ -435,26 +393,22 @@ This will be equivalent to: \end{solution}% \end{onlysolution}% \end{verbatim} -\ifmakedtx{}{\toTop} \section{Loading Problems From External Files}\label{sec:load} You can store all your problem definitions (see -\ifmakedtx{\autoref{sec:defproblem}}{\htmlref{Defining New -Problems}{sec:defproblem}}) in an external file. +\sectionref{sec:defproblem}) in an external file. These problems can all be appended to the default data set by including the file via \ics{input} or they can be appended to other data sets using one of the commands described below. Once you have loaded all the required problems, you can iterate through the data sets using the commands described -in \ifmakedtx{\autoref{sec:foreach}}{\htmlref{Iterating -Through Datasets}{sec:foreach}}. Note that the commands below +in \sectionref{sec:foreach}. Note that the commands below will create a new data set, if the named data set doesn't exist. -\DescribeMacro{\loadallproblems} -\begin{definition} -\csdef{loadallproblems}\oarg{data set}\marg{filename} +\begin{definition}[\DescribeMacro{\loadallproblems}] +\cs{loadallproblems}\oarg{data set}\marg{filename} \end{definition} This will load all problems defined in \meta{filename} and append them to the specified data set, in the order in which @@ -462,11 +416,10 @@ they are defined in the file. If \meta{data set} is omitted, the default data set will be used. If \meta{data set} doesn't exist, it will be created. -\DescribeMacro{\loadselectedproblems} -\begin{definition} -\csdef{loadselectedproblems}\oarg{data set}\marg{labels}\marg{filename} +\begin{definition}[\DescribeMacro{\loadselectedproblems}] +\cs{loadselectedproblems}\oarg{data set}\marg{labels}\marg{filename} \end{definition} -This is like \cs{loadproblems}, but only those problems whose +This is like \cs{loadallproblems}, but only those problems whose label is listed in the comma-separated list \meta{labels} are loaded. For example, if I have some problems defined in the file \texttt{derivatives.tex}, then @@ -477,9 +430,15 @@ will only load the problems whose labels are \texttt{diffsin} and \texttt{diffcos}, respectively. All the other problems in the file will remain undefined. -\DescribeMacro{\loadrandomproblems} -\begin{definition} -\csdef{loadrandomproblems}\oarg{data set}\marg{n}\marg{filename} +\begin{definition}[\DescribeMacro{\loadexceptproblems}] +\cs{loadexceptproblems}\oarg{data set}\marg{exception list}\marg{filename} +\end{definition} +This is the reverse of \cs{loadselectedproblems}. This loads all +problems except those whose labels are listed in \meta{exception +list}. + +\begin{definition}[\DescribeMacro{\loadrandomproblems}] +\cs{loadrandomproblems}\oarg{data set}\marg{n}\marg{filename} \end{definition} This randomly loads \meta{n} problems from \meta{filename} and adds them to the given data set. If \meta{data set} is omitted, @@ -488,45 +447,65 @@ added to the data set in a random order, not in the order in which they were defined. There must be at least \meta{n} problems defined in \meta{filename}. +\begin{definition}[\DescribeMacro{\loadrandomexcept}] +\cs{loadrandomexcept}\oarg{data +set}\marg{n}\marg{filename}\marg{exception list} +\end{definition} +This is similar to \cs{loadrandomproblems} except that it won't load +those problems whose labels are listed in \meta{exception list}. + +Note that the random number generator has been modified in version +3.01 in order to fix a bug. If you want to ensure that your random +numbers are compatible with earlier versions, you can switch to the +old generator using +\begin{definition}[\DescribeMacro{\PSNuseoldrandom}] +\cs{PSNuseoldrandom} +\end{definition} + \begin{important} It is generally not a good idea to place anything in -\meta{filename} that is not inside the body of \ienv{defproblem} +\meta{filename} that is not inside the body of \env{defproblem} or in the arguments to \ics{newproblem} or \ics{newproblem*}. All the commands in this section input the external file within -a local scope, so commands definitions would need to be made +a local scope, so command definitions would need to be made global to have any effect. In addition, \cs{loadrandomproblems} has to load each file twice, which means that anything outside a problem definition will be parsed twice. \end{important} -\ifmakedtx{}{\toTop} - \section{Iterating Through Datasets}\label{sec:foreach} -Once you have defined all your problems for a given data set, -you can use an individual problem with \ics{useproblem} -(see \ifmakedtx{\autoref{sec:useproblem}}{\htmlref{Using a -Problem}{sec:useproblem}}) but it is more likely that you will -want to iterate through all the problems so that you don't need -to remember the labels of all the problems you have defined. +Once you have defined all your problems for a given data set, you +can use an individual problem with \ics{useproblem} (see +\sectionref{sec:useproblem}) but it is more likely that you will +want to iterate through all the problems so that you don't need to +remember the labels of all the problems you have defined. -\DescribeMacro{\foreachproblem} -\begin{definition} -\csdef{foreachproblem}\oarg{data set}\marg{body} +\begin{definition}[\DescribeMacro{\foreachproblem}] +\cs{foreachproblem}\oarg{data set}\marg{body} \end{definition} This does \meta{body} for each problem in the given data set. If \meta{data set} is omitted, the default data set is used. Within \meta{body} you can use -\DescribeMacro{\thisproblem}\cs{thisproblem} to use the -current problem and \DescribeMacro{\thisproblemlabel}\cs{thisproblemlabel} +\begin{definition}[\DescribeMacro{\thisproblem}] +\cs{thisproblem} +\end{definition} +to use the current problem and +\begin{definition}[\DescribeMacro{\thisproblemlabel}] +\cs{thisproblemlabel} +\end{definition} to access the current label. If the problem requires arguments, -you will be prompted for them, so if you want to use this +and no default arguments were supplied in the problem definition or +the package option \pkgopt{usedefaultargs} was not used, then +you will be prompted for arguments, so if you want to use this approach you will need to use \LaTeX\ in interactive mode. If you do provide arguments, they will be stored in the event that you need to iterate through the data set again. The arguments will be included in \cs{thisproblem}, so you only need to use \cs{thisproblem} without having to specify -\ics{useproblem}. For example, to iterate through all problems +\ics{useproblem}. + +For example, to iterate through all problems in the default data set: \begin{verbatim} \begin{enumerate} @@ -534,9 +513,17 @@ in the default data set: \end{enumerate} \end{verbatim} -\DescribeMacro{\foreachdataset} -\begin{definition} -\csdef{foreachdataset}\marg{cmd}\marg{body} +\begin{definition}[\DescribeMacro{\foreachsolution}] +\cs{foreachsolution}\oarg{data set}\marg{body} +\end{definition} +This is equivalent to \cs{foreachsolution}, but only iterates +through problems that contain the \env{onlysolution} environment. +Note that you still need to use \ics{showanswers} or the +\pkgopt{answers} package option for the contents of the +\env{onlysolution} environment to appear. + +\begin{definition}[\DescribeMacro{\foreachdataset}] +\cs{foreachdataset}\marg{cmd}\marg{body} \end{definition} This does \meta{body} for each of the defined data sets. Within \meta{body}, \meta{cmd} will be set to the name of the current @@ -550,8 +537,8 @@ data set. For example, to display all problems in all data sets: Suppose I have two external files called \texttt{derivatives.tex} and \texttt{probspaces.tex} which -define problems using both \ienv{onlyproblem} and -\ienv{onlysolution} for example: +define problems using both \env{onlyproblem} and +\env{onlysolution} for example: \begin{verbatim} \begin{defproblem}{cosxsqsinx}% \begin{onlyproblem}% @@ -569,7 +556,7 @@ iterate through the require data set to produce the problems. Later, I can use \ics{showanswers} and iterate over all problems defined in both data sets to produce the chapter containing all the answers. When displaying the questions, I have taken advantage of the fact that -I can cross-reference items within an \ienv{enumerate} environment, +I can cross-reference items within an \env{enumerate} environment, and redefined \ics{theenumi} to label the questions according to the chapter. The cross-reference label is constructed from the problem label and is referenced in the answer section to @@ -616,16 +603,19 @@ ensure that the answers have the same label as the questions. \end{document} \end{verbatim} -\ifmakedtx{}{\toTop} - \section{Random Number Generator}\label{sec:random} This package provides a pseudo-random number generator that is used -by \ics{loadrandomproblems}. +by \ics{loadrandomproblems}. As noted earlier the random number +generator has been modified in version 3.01 in order to fix a bug. +If you want to ensure that your random numbers are compatible with +earlier versions, you can switch to the old generator using +\begin{definition}[\DescribeMacro{\PSNuseoldrandom}] +\cs{PSNuseoldrandom} +\end{definition} -\DescribeMacro{\PSNrandseed} -\begin{definition} -\csdef{PSNrandseed}\marg{n} +\begin{definition}[\DescribeMacro{\PSNrandseed}] +\cs{PSNrandseed}\marg{n} \end{definition} This sets the seed to \meta{n} which must be a non-zero integer. For example, to generate a different set of random numbers @@ -641,9 +631,8 @@ or to generate a different set of random numbers every year you \PSNrandseed{\year} \end{verbatim} -\DescribeMacro{\PSNgetrandseed} -\begin{definition} -\csdef{PSNgetrandseed}\marg{register} +\begin{definition}[\DescribeMacro{\PSNgetrandseed}] +\cs{PSNgetrandseed}\marg{register} \end{definition} This stores the current seed in the count register specified by \meta{register}. @@ -653,9 +642,8 @@ For example: \PSNgetrandseed{\myseed} \end{verbatim} -\DescribeMacro{\PSNrandom} -\begin{definition} -\csdef{PSNrandom}\marg{register}\marg{n} +\begin{definition}[\DescribeMacro{\PSNrandom}] +\cs{PSNrandom}\marg{register}\marg{n} \end{definition} Generates a random integer from 1 to \meta{n} and stores in the count register specified by \meta{register}. For example, @@ -666,9 +654,8 @@ in the register \cs{myreg}: \PSNrandom{\myreg}{10} \end{verbatim} -\DescribeMacro{\random} -\begin{definition} -\csdef{random}\marg{counter}\marg{min}\marg{max} +\begin{definition}[\DescribeMacro{\random}] +\cs{random}\marg{counter}\marg{min}\marg{max} \end{definition} Generates a random integer from \meta{min} to \meta{max} and stores in the given counter. For example, the following generates @@ -679,9 +666,8 @@ the counter \texttt{myrand}. \random{myrand}{3}{8} \end{verbatim} -\DescribeMacro{\doforrandN} -\begin{definition} -\csdef{doforrandN}\marg{n}\marg{cmd}\marg{list}\marg{text} +\begin{definition}[\DescribeMacro{\doforrandN}] +\cs{doforrandN}\marg{n}\marg{cmd}\marg{list}\marg{text} \end{definition} Randomly selects \meta{n} values from the comma-separated list given by \meta{list} and iterates through this subset. On @@ -695,8 +681,6 @@ are files containing at least one problem): \loadrandomproblems{1}{\thisfile}} \end{verbatim} -\ifmakedtx{}{\toTop} - \section{Compatibility With Versions Prior to 3.0} Version 3.0 of the \sty{probsoln} package completely changed the @@ -750,32 +734,27 @@ would need to be modified so that it becomes: \end{enumerate} \end{verbatim} -\DescribeMacro{\selectrandomly} -\begin{definition} -\csdef{selectrandomly}\marg{filename}\marg{n} +\begin{definition}[\DescribeMacro{\selectrandomly}] +\cs{selectrandomly}\marg{filename}\marg{n} \end{definition} This is now equivalent to: \begin{ttfamily}\obeylines \{\cs{loadrandomproblems}\oarg{filename}\marg{n}\marg{filename}\}\% -\cs{foreachproblem}\oarg{filename}\marg{\cs{PSNitem}\cs{thisproblem}\cs{endPSNitem}} +\cs{foreachproblem}\oarg{filename}\{\cs{PSNitem}\cs{thisproblem}\cs{endPSNitem}\} \end{ttfamily} -\DescribeMacro{\selectallproblems} -\begin{definition} -\csdef{selectallproblems}\marg{filename} +\begin{definition}[\DescribeMacro{\selectallproblems}] +\cs{selectallproblems}\marg{filename} \end{definition} This is now equivalent to: \begin{ttfamily}\obeylines \{\cs{loadallproblems}\oarg{filename}\marg{filename}\}\% -\cs{foreachproblem}\oarg{filename}\marg{\cs{PSNitem}\cs{thisproblem}\cs{endPSNitem}} +\cs{foreachproblem}\oarg{filename}\{\cs{PSNitem}\cs{thisproblem}\cs{endPSNitem}\} \end{ttfamily} Note that in both the above cases, a new data set is created with the same name as the file name. -\ifmakedtx{}{\toTop} - \StopEventually{\clearpage\phantomsection\addcontentsline{toc}{section}{Index}\PrintIndex} -\ifmakedtx{}{\printindex\toTop} \end{document} diff --git a/Master/texmf-dist/doc/latex/probsoln/probsoln.pdf b/Master/texmf-dist/doc/latex/probsoln/probsoln.pdf Binary files differindex 4d5494880fd..86b7d6baf6a 100644 --- a/Master/texmf-dist/doc/latex/probsoln/probsoln.pdf +++ b/Master/texmf-dist/doc/latex/probsoln/probsoln.pdf diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/1stprncp.tex b/Master/texmf-dist/doc/latex/probsoln/samples/1stprncp.tex deleted file mode 100644 index 514abf57763..00000000000 --- a/Master/texmf-dist/doc/latex/probsoln/samples/1stprncp.tex +++ /dev/null @@ -1,61 +0,0 @@ - % These all involve differentiating from 1st principles - -\newproblem{dfp:xcube}{% -Differentiate $f(x) = x^3$ with respect to $x$ by first principles.}{% -\begin{eqnarray*} -\frac{dy}{dx} & = & \lim_{\Delta x\rightarrow 0}\frac{f(x+\Delta x) - f(x)}{\Delta x}\\ - & = & \lim_{\Delta x\rightarrow 0}\frac{(x+\Delta x)^3-x^3}{\Delta x}\\ - & = & \lim_{\Delta x\rightarrow 0}\frac{(x+\Delta x)(x^2+2x\Delta x+(\Delta x)^2)-x^3}{\Delta x}\\ - & = & \lim_{\Delta x\rightarrow 0}\frac{x^3+3x^2\Delta x+3x(\Delta x)^2+(\Delta x)^3-x^3}{\Delta x}\\ - & = & \lim_{\Delta x\rightarrow 0}\frac{3x^2\Delta x+3x(\Delta x)^2+(\Delta x)^3}{\Delta x}\\ - & = & \lim_{\Delta x\rightarrow 0}3x^2+3x\Delta x + (\Delta x)^2\\ - & = & 3x^2 -\end{eqnarray*}} - -\newproblem{dfp:Ioverxsq}{% -Differentiate $\displaystyle f(x) = \frac{1}{x^2}$ with respect to $x$ by first principles.}{% -\begin{eqnarray*} -\frac{df}{dx} & = & \lim_{\Delta x\rightarrow 0}\frac{\frac{1}{(x+\Delta x)^2}-\frac{1}{x^2}}{\Delta x}\\ - & = & \lim_{\Delta x\rightarrow 0}\frac{\frac{x^2-(x+\Delta x)^2}{x^2(x+\Delta x)^2}}{\Delta x}\\ - & = & \lim_{\Delta x\rightarrow 0}\frac{x^2-(x^2+2x\Delta x+(\Delta x)^2)}{x^2\Delta x(x+\Delta x)^2}\\ - & = & \lim_{\Delta x\rightarrow 0}\frac{-2x\Delta x-(\Delta x)^2}{x^2\Delta x(x+\Delta x)^2}\\ - & = & \lim_{\Delta x\rightarrow 0}\frac{-2x-\Delta x}{x^2(x+\Delta x)^2}\\ - & = & \frac{-2x}{x^2x^2}\\ - & = & -\frac{2}{x^3} -\end{eqnarray*}} - -\newproblem{dfp:sqrtx}{% -Differentiate from first principles $f(x) = \surd x$}{% -\begin{eqnarray*} -\frac{df}{dx} & = & \lim_{\Delta x\rightarrow 0}\frac{\sqrt{x+\Delta x}-\surd x}{\Delta x}\\ - & = & \lim_{\Delta x\rightarrow 0}\frac{(\sqrt{x+\Delta x}-\surd x)(\sqrt{x+\delta x}+\surd x)}{\Delta x(\sqrt{x+\Delta x}+\surd x)}\\ - & = & \lim_{\Delta x\rightarrow 0}\frac{x+\Delta x - x}{\Delta x(\sqrt{x+\Delta x}+\surd x)}\\ - & = & \lim_{\Delta x\rightarrow 0}\frac{\Delta x}{\Delta x(\sqrt{x+\Delta x}+\Delta x)}\\ - & = & \lim_{\Delta x\rightarrow 0}\frac{1}{\sqrt{x+\Delta x}+\surd x}\\ - & = & \frac{1}{2\surd x} -\end{eqnarray*}} - -\newproblem{dfp:cons}{% -Differentiate from first principles $f(x) = c$ where $c$ is a constant.}{% -\begin{eqnarray*} -\frac{df}{dx} & = & \lim_{\Delta x\rightarrow 0}\frac{c-c}{\Delta x}\\ - & = & \lim_{\Delta x\rightarrow 0}0\\ - & = & 0 -\end{eqnarray*}} - -\newproblem{dfp:cosx}{% -Given -\begin{eqnarray*} -\lim_{x \rightarrow 0} \frac{\cos x - 1}{x} & = & 0\\ -\lim_{x \rightarrow 0} \frac{\sin x}{x} & = & 1 -\end{eqnarray*} -differentiate from first principles $f(x) = \cos x$.}{% -\begin{eqnarray*} -\frac{df}{dx} & = & \lim_{\Delta x \rightarrow 0}\frac{f(x + \Delta x) - f(x)}{\Delta x}\\ - & = & \lim_{\Delta x \rightarrow 0} \frac{\cos(x + \Delta x) - \cos(x)}{\Delta x}\\ - & = & \lim_{\Delta x \rightarrow 0} \frac{\cos x\cos\Delta x - \sin x\sin\Delta x - \cos x}{\Delta x}\\ - & = & \lim_{\Delta x \rightarrow 0} \frac{\cos x(\cos\Delta x - 1) - \sin x\sin\Delta x}{\Delta x}\\ - & = & \cos x\lim_{\Delta x \rightarrow 0}\frac{\cos\Delta x - 1}{\Delta x} - - \sin x\lim_{\Delta x \rightarrow 0}\frac{\sin\Delta x}{\Delta x}\\ - & = & -1 \qquad\mbox{(using given results)} -\end{eqnarray*}} diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/args.tex b/Master/texmf-dist/doc/latex/probsoln/samples/args.tex deleted file mode 100644 index 77278d86530..00000000000 --- a/Master/texmf-dist/doc/latex/probsoln/samples/args.tex +++ /dev/null @@ -1,45 +0,0 @@ - % These problems require arguments - - % Arguments: #1->a_2, #2->a_1 and #3->a_0 - % (Arguments must be integers) -\newcount\ctr -\newproblem[3]{diff:quad}{% -\(f(x) = -\ifnum#1=0 -\else -\ifnum#1=1\else#1\fi x^2 -\fi -\ifnum#2=0 -\else -\ifnum#2>0 \ifnum#1=0 \else + \fi \fi -\ifnum#2=1\else#2\fi x -\fi -\ifnum#3=0 -\else -\ifnum#3>0 \ifnum#2=0 \ifnum#1=0 \else + \fi \else + \fi\fi -#3 -\fi\) -}{% -\(f'(x) = -\ifnum#1=0 -\else -\ctr=2 -\multiply\ctr by #1 -\the\ctr x -\fi -\ifnum#2=0 -\else -\ifnum#2>0 \ifnum#1=0 \else + \fi \fi -#2 -\fi - % print 0 if both #1 and #2 are 0 -\ifnum#1=0 \ifnum#2=0 0 \fi\fi -\) -} - -\newproblem[1]{diff:sin}{% -\(f(x) = \sin(#1x)\) -}{% -\(f'(x) = #1\cos(#1x)\) -} - diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/easy.tex b/Master/texmf-dist/doc/latex/probsoln/samples/easy.tex deleted file mode 100644 index 0833f7e9527..00000000000 --- a/Master/texmf-dist/doc/latex/probsoln/samples/easy.tex +++ /dev/null @@ -1,85 +0,0 @@ - % These are all easy differentiation problems - -\newproblem{diffeasy:gpowh}{% -\(f(x) = g(x)^{h(x)}.\)}{% -\begin{eqnarray*} -f(x) & = & e^{\ln g(x)^{h(x)}}\\ - & = & e^{h(x)\ln g(x)}\\ -f'(x) & = & e^{h(x)\ln g(x)}(h'(x)\ln g(x) + h(x)\frac{g'(x)}{g(x)})\\ - & = & g(x)^{h(x)}(h'(x)\ln g(x) + \frac{h(x)g'(x)}{g(x)}) -\end{eqnarray*}} - -\newproblem{diffeasy:arcsin}{% -\(y = \arcsin(x)\)}{% -\[\sin(y) = x\] -diff. w.r.t. $x$: -\begin{eqnarray*} -\cos y \frac{dy}{dx} & = & 1\\ -\frac{dy}{dx} & = & \frac{1}{\cos y}\\ - & = & \frac{1}{\sqrt{1 - \sin^2y}}\\ - & = & \frac{1}{\sqrt{1-x^2}}. -\end{eqnarray*}} - -\newproblem{diffeasy:arccos}{% -$y = \arccos x$.}{% -\(\cos y = x\) -diff. w.r.t. $x$: -\begin{eqnarray*} --\sin y \frac{dy}{dx} & = & 1\\ -\frac{dy}{dx} & = & \frac{-1}{\sin y}\\ - & = & \frac{-1}{\sqrt{1-\cos^2y}}\\ - & = & \frac{-1}{\sqrt{1-x^2}} -\end{eqnarray*}} - -\newproblem{diffeasy:tan}{% -\(y = \tan x\)}{% -\begin{eqnarray*} -y & = & \tan x\\ - & = & \frac{\sin x}{\cos x}\\ -\frac{dy}{dx} & = & \frac{\cos x}{\cos x} + \sin x\times\frac{-1}{\cos^2x}\times -\sin x\\ - & = & 1 + \tan^2x\\ - & = & \sec^2x. -\end{eqnarray*}} - -\newproblem{diffeasy:arctan}{% -\(y = \arctan x = \tan^{-1}x\)}{% -\[\tan y = x\] -diff w.r.t. $x$: -\begin{eqnarray*} -\sec^2y\frac{dy}{dx} & = & 1\\ -\frac{dy}{dx} & = & \frac{1}{\sec^2y}\\ - & = & \frac{1}{1+\tan^2y}\\ - & = & \frac{1}{1+x^2} -\end{eqnarray*}} - -\newproblem{diffeasy:cot}{% -\(y = (\tan x)^{-1} = \cot x\)}{% -\begin{eqnarray*} -\frac{dy}{dx} & = & -(\tan x)^{-2}\sec^2x\\ - & = & -\frac{\cos^2x}{\sin^2x}\cdot\frac{1}{\cos^2x}\\ - & = & \frac{-1}{\sin^2x}\\ - & = & -\csc^2x. -\end{eqnarray*}} - -\newproblem{diffeasy:cosxsqsinx}{% -$y = \cos(x^2)\sin x$.}{% -\[\frac{dy}{dx} = -\sin(x^2)2x\sin x + \cos(x^2)\cos x\]} - -\newproblem{diffeasy:xlnx}{% -$y = (x+1)\ln(x+1)$.}{% -\begin{eqnarray*} -\frac{dy}{dx} & = & \ln(x+1) + \frac{x+1}{x+1}\\ - & = & 1 + \ln(x+1). -\end{eqnarray*}} - -\newproblem{diffeasy:glng}{% -$f(x) = g(x)\ln(g(x))$.}{% -\begin{eqnarray*} -f'(x) & = & g'(x)\ln(g(x)) + \frac{g(x)}{g(x)}g'(x)\\ - & = & g'(x)(1+\ln(g(x))). -\end{eqnarray*}} - -\newproblem{diffeasy:sinx/x}{% -$y = \frac{\sin x}{x}$.}{% -\[\frac{dy}{dx} = \frac{\cos x}{x} - \frac{\sin x}{x^2}\]} - diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/easy2.tex b/Master/texmf-dist/doc/latex/probsoln/samples/easy2.tex deleted file mode 100644 index 9958efcb41c..00000000000 --- a/Master/texmf-dist/doc/latex/probsoln/samples/easy2.tex +++ /dev/null @@ -1,135 +0,0 @@ - % These are all easy differentiation problems - -\begin{defproblem}{diffeasy:gpowh}% -\begin{onlyproblem}% -\(f(x) = g(x)^{h(x)}.\)% -\end{onlyproblem}% -\begin{onlysolution}% -\begin{eqnarray*} -f(x) & = & e^{\ln g(x)^{h(x)}}\\ - & = & e^{h(x)\ln g(x)}\\ -f'(x) & = & e^{h(x)\ln g(x)}(h'(x)\ln g(x) + h(x)\frac{g'(x)}{g(x)})\\ - & = & g(x)^{h(x)}(h'(x)\ln g(x) + \frac{h(x)g'(x)}{g(x)}) -\end{eqnarray*}% -\end{onlysolution}% -\end{defproblem} - -\begin{defproblem}{diffeasy:arcsin}% -\begin{onlyproblem}% -\(y = \arcsin(x)\)% -\end{onlyproblem}% -\begin{onlysolution}% -\[\sin(y) = x\] -diff. w.r.t. $x$: -\begin{eqnarray*} -\cos y \frac{dy}{dx} & = & 1\\ -\frac{dy}{dx} & = & \frac{1}{\cos y}\\ - & = & \frac{1}{\sqrt{1 - \sin^2y}}\\ - & = & \frac{1}{\sqrt{1-x^2}}. -\end{eqnarray*} -\end{onlysolution}% -\end{defproblem} - -\begin{defproblem}{diffeasy:arccos}% -\begin{onlyproblem}% -$y = \arccos x$.% -\end{onlyproblem}% -\begin{onlysolution}% -\(\cos y = x\) -diff. w.r.t. $x$: -\begin{eqnarray*} --\sin y \frac{dy}{dx} & = & 1\\ -\frac{dy}{dx} & = & \frac{-1}{\sin y}\\ - & = & \frac{-1}{\sqrt{1-\cos^2y}}\\ - & = & \frac{-1}{\sqrt{1-x^2}} -\end{eqnarray*} -\end{onlysolution}% -\end{defproblem} - -\begin{defproblem}{diffeasy:tan}% -\begin{onlyproblem}% -\(y = \tan x\)% -\end{onlyproblem} -\begin{onlysolution}% -\begin{eqnarray*} -y & = & \tan x\\ - & = & \frac{\sin x}{\cos x}\\ -\frac{dy}{dx} & = & \frac{\cos x}{\cos x} + \sin x\times\frac{-1}{\cos^2x}\times -\sin x\\ - & = & 1 + \tan^2x\\ - & = & \sec^2x. -\end{eqnarray*} -\end{onlysolution}% -\end{defproblem} - -\begin{defproblem}{diffeasy:arctan}% -\begin{onlyproblem}% -\(y = \arctan x = \tan^{-1}x\)% -\end{onlyproblem}% -\begin{onlysolution}% -\[\tan y = x\] -diff w.r.t. $x$: -\begin{eqnarray*} -\sec^2y\frac{dy}{dx} & = & 1\\ -\frac{dy}{dx} & = & \frac{1}{\sec^2y}\\ - & = & \frac{1}{1+\tan^2y}\\ - & = & \frac{1}{1+x^2} -\end{eqnarray*} -\end{onlysolution}% -\end{defproblem} - -\begin{defproblem}{diffeasy:cot}% -\begin{onlyproblem}% -\(y = (\tan x)^{-1} = \cot x\)% -\end{onlyproblem} -\begin{onlysolution}% -\begin{eqnarray*} -\frac{dy}{dx} & = & -(\tan x)^{-2}\sec^2x\\ - & = & -\frac{\cos^2x}{\sin^2x}\cdot\frac{1}{\cos^2x}\\ - & = & \frac{-1}{\sin^2x}\\ - & = & -\csc^2x. -\end{eqnarray*} -\end{onlysolution}% -\end{defproblem} - -\begin{defproblem}{diffeasy:cosxsqsinx}% -\begin{onlyproblem}% -$y = \cos(x^2)\sin x$.% -\end{onlyproblem}% -\begin{onlysolution}% -\[\frac{dy}{dx} = -\sin(x^2)2x\sin x + \cos(x^2)\cos x\] -\end{onlysolution}% -\end{defproblem} - -\begin{defproblem}{diffeasy:xlnx}% -\begin{onlyproblem}% -$y = (x+1)\ln(x+1)$. -\end{onlyproblem}% -\begin{onlysolution}% -\begin{eqnarray*} -\frac{dy}{dx} & = & \ln(x+1) + \frac{x+1}{x+1}\\ - & = & 1 + \ln(x+1). -\end{eqnarray*} -\end{onlysolution} -\end{defproblem} - -\begin{defproblem}{diffeasy:glng}% -\begin{onlyproblem}% -$f(x) = g(x)\ln(g(x))$. -\end{onlyproblem} -\begin{onlysolution}% -\begin{eqnarray*} -f'(x) & = & g'(x)\ln(g(x)) + \frac{g(x)}{g(x)}g'(x)\\ - & = & g'(x)(1+\ln(g(x))). -\end{eqnarray*} -\end{onlysolution}% -\end{defproblem} - -\begin{defproblem}{diffeasy:sinx/x} -\begin{onlyproblem}% -$y = \frac{\sin x}{x}$. -\end{onlyproblem} -\begin{onlysolution}% -\[\frac{dy}{dx} = \frac{\cos x}{x} - \frac{\sin x}{x^2}\] -\end{onlysolution}% -\end{defproblem} - diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/implicit.tex b/Master/texmf-dist/doc/latex/probsoln/samples/implicit.tex deleted file mode 100644 index 7f37fe0041f..00000000000 --- a/Master/texmf-dist/doc/latex/probsoln/samples/implicit.tex +++ /dev/null @@ -1,41 +0,0 @@ - % These are all implicit differentiation problems - -\newproblem{imd:circ}{% -Find the gradient of the unit circle ($x^2 + y^2 = 1$).}{% -Differentiating with respect to $x$ gives: -\begin{eqnarray*} -2x + 2y\frac{dy}{dx} & = & 0\\ -\frac{dy}{dx} & = & \frac{-2x}{2y}\\ - & = & \frac{-x}{\sqrt{1-x^2}}. -\end{eqnarray*}} - -\newproblem{imd:ysq:xcuov2mx}{% -Find $\frac{dy}{dx}$, given -\begin{displaymath} -y^2 = \frac{x^3}{2-x} -\end{displaymath}}{% -Differentiating both sides w.r.t.\ $x$: -\begin{eqnarray*} -2y\frac{dy}{dx} & = & \frac{(2-x)3x^2 - x^3(-1)}{(2-x)^2}\\ - & = & \frac{3x^2(2-x) + x^3}{(2-x)^2}\\ - & = & \frac{6x^2 - 3x^3 + x^3}{(2-x)^2}\\ - & = & \frac{6x^2-2x^3}{(2-x)^2}\\ - & = & 2x^2\frac{3-x}{(2-x)^2} -\end{eqnarray*} -Therefore -\begin{displaymath} -y\frac{dy}{dx} = x^2\frac{3-x}{(2-x)^2} -\end{displaymath}} - -\newproblem{imd:exy:IIxay}{% -Differentiate w.r.t.\ $x$: -\begin{displaymath} -e^{xy} = 2x + y -\end{displaymath}}{% -Differentiating both sides w.r.t.\ $x$: -\begin{eqnarray*} -e^{xy}(1y + x\frac{dy}{dx}) & = & 2 + \frac{dy}{dx}\\ -xe^{xy}\frac{dy}{dx} - \frac{dy}{dx} & = & 2 - ye^{xy} \\ -\frac{dy}{dx}(xe^{xy}-1) & = & 2 - ye^{xy}\\ -\frac{dy}{dx} & = & \frac{2-ye^{xy}}{xe^{xy}-1} -\end{eqnarray*}} diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/mchoice.tex b/Master/texmf-dist/doc/latex/probsoln/samples/mchoice.tex deleted file mode 100644 index 7add557a680..00000000000 --- a/Master/texmf-dist/doc/latex/probsoln/samples/mchoice.tex +++ /dev/null @@ -1,34 +0,0 @@ -\newproblem{mc:prod}{% -Which of the following is the derivative of $x\sin(x)$? -(Circle the correct answer.) -\ifthenelse{\boolean{showanswers}}{}% -{\begin{description} -\item[A] $\sin(x)$ -\item[B] $x\cos(x)$ -\item[C] $\sin(x) + x\cos(x)$ -\end{description} -}}{% -\begin{description} -\item[A] $\sin(x)$ -\item[B] $x\cos(x)$ -\item[\textcircled{C}] $\sin(x) + x\cos(x)$ (product rule). -\end{description} -} - -\newproblem{mc:quot}{% -Which of the following is the derivative of $\frac{\sin(x)}{x}$? -(Circle the correct answer.) -\ifthenelse{\boolean{showanswers}}{}% -{\begin{description} -\item[A] $\sin(x)$ -\item[B] $\cos(x)$ -\item[C] $\frac{\cos(x)x-\sin(x)}{x^2}$ -\end{description} -}}{% -\begin{description} -\item[A] $\sin(x)$ -\item[B] $\cos(x)$ -\item[\textcircled{C}] $\frac{\cos(x)x-\sin(x)}{x^2}$ -(quotient rule) -\end{description} -} diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/newdata.tex b/Master/texmf-dist/doc/latex/probsoln/samples/newdata.tex deleted file mode 100644 index 82179a34ef0..00000000000 --- a/Master/texmf-dist/doc/latex/probsoln/samples/newdata.tex +++ /dev/null @@ -1,26 +0,0 @@ -\begin{defproblem}{sample} -\begin{onlyproblem} -Differentiate $y=\sin x$ -\end{onlyproblem} -\begin{onlysolution} -$y'=\cos x$ -\end{onlysolution} -\end{defproblem} - -\begin{defproblem}[1]{sample2} -\begin{onlyproblem} -Differentiate $y = \sin(#1x)$ -\end{onlyproblem} -\begin{onlysolution} -$y'=#1\cos #1x$ -\end{onlysolution} -\end{defproblem} - -\begin{defproblem}{sample3} -\begin{onlyproblem} -Differentiate $y = x^2$. -\end{onlyproblem} -\begin{onlysolution} -$y' = 2x$ -\end{onlysolution} -\end{defproblem} diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/nosoln.tex b/Master/texmf-dist/doc/latex/probsoln/samples/nosoln.tex deleted file mode 100644 index 96ea6438aaa..00000000000 --- a/Master/texmf-dist/doc/latex/probsoln/samples/nosoln.tex +++ /dev/null @@ -1,7 +0,0 @@ - % these problems don't have solutions - -\newproblem*{oop}{Describe what is meant by object-oriented -programming.} - -\newproblem*{inheritance}{Describe what is meant by the term -\emph{inheritance} in object-oriented programming. Use examples.} diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/probspaces.tex b/Master/texmf-dist/doc/latex/probsoln/samples/probspaces.tex deleted file mode 100644 index 48f7c3c53d8..00000000000 --- a/Master/texmf-dist/doc/latex/probsoln/samples/probspaces.tex +++ /dev/null @@ -1,31 +0,0 @@ - % Finite probability spaces -\newproblem{weightedcoin}{% -A coin is weighted so that heads is four times as likely -as tails. Find the probability that: -\begin{textenum} -\item tails appears, -\item heads appears -\end{textenum}}{% -Let $p=P(T)$, then $P(H)=4p$. We require $P(H)+P(T)=1$, -so $4p+p=1$, hence $p=\frac{1}{5}$. Therefore: -\begin{textenum} -\item $P(T)=\frac{1}{5}$, -\item $P(H)=\frac{4}{5}$ -\end{textenum}} - -\newproblem*{validprobspaces}{% -Under which of the following functions does -$S=\{a_1,a_2\}$ become a probability space? -\par -\begin{textenum} -\begin{tabular}{ll} -\incorrectitem $P(a_1)=\frac{1}{3}$, $P(a_2)=\frac{1}{2}$ -& -\correctitem $P(a_1)=\frac{3}{4}$, $P(a_2)=\frac{1}{4}$ -\\ -\correctitem $P(a_1)=1$, $P(a_2)=0$ -& -\incorrectitem $P(a_1)=\frac{5}{4}$, $P(a_2)=-\frac{1}{4}$ -\end{tabular} -\end{textenum} -} diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/probspaces2.tex b/Master/texmf-dist/doc/latex/probsoln/samples/probspaces2.tex deleted file mode 100644 index 26839b65293..00000000000 --- a/Master/texmf-dist/doc/latex/probsoln/samples/probspaces2.tex +++ /dev/null @@ -1,41 +0,0 @@ - % Finite probability spaces -\begin{defproblem}{weightedcoin} -\begin{onlyproblem}% -A coin is weighted so that heads is four times as likely -as tails. Find the probability that: -\begin{textenum} -\item tails appears, -\item heads appears -\end{textenum} -\end{onlyproblem} -\begin{onlysolution}% -Let $p=P(T)$, then $P(H)=4p$. We require $P(H)+P(T)=1$, -so $4p+p=1$, hence $p=\frac{1}{5}$. Therefore: -\begin{textenum} -\item $P(T)=\frac{1}{5}$, -\item $P(H)=\frac{4}{5}$ -\end{textenum} -\end{onlysolution} -\end{defproblem} - -\begin{defproblem}{validprobspaces} -\begin{onlyproblem}% -Under which of the following functions does -$S=\{a_1,a_2\}$ become a probability space? -\par -\begin{textenum} -\begin{tabular}{ll} -\item $P(a_1)=\frac{1}{3}$, $P(a_2)=\frac{1}{2}$ -& -\item\label{validprobspacescorrect1} $P(a_1)=\frac{3}{4}$, $P(a_2)=\frac{1}{4}$ -\\ -\item\label{validprobspacescorrect2} $P(a_1)=1$, $P(a_2)=0$ -& -\item $P(a_1)=\frac{5}{4}$, $P(a_2)=-\frac{1}{4}$ -\end{tabular} -\end{textenum} -\end{onlyproblem}% -\begin{onlysolution}% -\ref{validprobspacescorrect1} and \ref{validprobspacescorrect2}% -\end{onlysolution} -\end{defproblem} diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/sample.pdf b/Master/texmf-dist/doc/latex/probsoln/samples/sample.pdf Binary files differnew file mode 100644 index 00000000000..bd16cbf85ad --- /dev/null +++ b/Master/texmf-dist/doc/latex/probsoln/samples/sample.pdf diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/sample.tex b/Master/texmf-dist/doc/latex/probsoln/samples/sample.tex index e80c8dff020..6627c165ae4 100644 --- a/Master/texmf-dist/doc/latex/probsoln/samples/sample.tex +++ b/Master/texmf-dist/doc/latex/probsoln/samples/sample.tex @@ -1,3 +1,52 @@ +%% +%% This is file `sample.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% probsoln.dtx (with options: `sample.tex,package') +%% +%% probsoln.dtx +%% Copyright 2011 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files probsoln.dtx and probsoln.ins and the derived files probsoln.sty, sample.tex, sample2.tex, sample3.tex, sample4.tex, sample5.tex, sample6.tex, sample7.tex, prob-1stprncp.tex, prob-args.tex, prob-easy.tex, prob-easy2.tex, prob-implicit.tex, prob-mchoice.tex, prob-mixed.tex, prob-newdata.tex, prob-nosoln.tex, prob-probspaces.tex, prob-probspaces2.tex, prob-tabmchoice.tex. +%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% randomly select 25 problems from derivatives.tex and add to +%% the data set called 'deriv' +%% Display the problems +%% You may need to change \theenumi back here +%% randomly select 25 problems from probspaces.tex and add to +%% the data set called 'spaces' +%% Display the problems +%% You may need to change \theenumi back here + % This file is public domain \documentclass[a4paper]{article} \usepackage{probsoln} @@ -5,9 +54,32 @@ \showanswers % The following will generate a different set of - % problems in subsequent years + % problems each year %\PSNrandseed{\year} -\PSNrandseed{2007} + + % Load 1 problem randomly selected from the given file + % and store in database 'firstprinciples': +\loadrandomproblems[firstprinciples]{1}{prob-1stprncp} + + % Load 5 problems randomly selected from the given file + % and store in database 'easy': +\loadrandomproblems[easy]{5}{prob-easy} + + % Load 2 problems randomly selected from the given file + % and store in database 'implicit': +\loadrandomproblems[implicit]{2}{prob-implicit} + + % Load 2 problems randomly selected from the given file + % and store in database 'probspaces': +\loadrandomproblems[probspaces]{2}{prob-probspaces} + + % Load 1 problem randomly selected from the given file + % and store in database 'mchoice': +\loadrandomproblems[mchoice]{1}{prob-mchoice} + + % Load 1 problem randomly selected from the given file + % and store in database 'nosoln': +\loadrandomproblems[nosoln]{1}{prob-nosoln} \begin{document} \title{Sample Problem Sheet} @@ -16,27 +88,27 @@ \begin{enumerate} % Differentiation from first principles -\selectrandomly{1stprncp}{1} + \foreachproblem[firstprinciples]{\item \thisproblem} \item Differentiate the following functions: -\newcount\oldseed -\PSNgetrandseed\oldseed \begin{enumerate} -\selectrandomly{easy}{5} + \foreachproblem[easy]{\item \thisproblem} \end{enumerate} -\PSNrandseed\oldseed % Implicit differentiation -\selectrandomly{implicit}{2} +\foreachproblem[implicit]{\item \thisproblem} % Finite probability spaces -\selectrandomly{probspaces}{2} +\foreachproblem[probspaces]{\item \thisproblem} % Multiple choice question -\selectrandomly{mchoice}{1} +\foreachproblem[mchoice]{\item \thisproblem} % select one essay style question that doesn't come with a solution -\selectrandomly{nosoln}{1} +\foreachproblem[nosoln]{\item \thisproblem} \end{enumerate} \end{document} +\endinput +%% +%% End of file `sample.tex'. diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/sample2.pdf b/Master/texmf-dist/doc/latex/probsoln/samples/sample2.pdf Binary files differnew file mode 100644 index 00000000000..dc760dd57ad --- /dev/null +++ b/Master/texmf-dist/doc/latex/probsoln/samples/sample2.pdf diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/sample2.tex b/Master/texmf-dist/doc/latex/probsoln/samples/sample2.tex index e82656c9f3a..8054e753e8d 100644 --- a/Master/texmf-dist/doc/latex/probsoln/samples/sample2.tex +++ b/Master/texmf-dist/doc/latex/probsoln/samples/sample2.tex @@ -1,3 +1,52 @@ +%% +%% This is file `sample2.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% probsoln.dtx (with options: `sample2.tex,package') +%% +%% probsoln.dtx +%% Copyright 2011 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files probsoln.dtx and probsoln.ins and the derived files probsoln.sty, sample.tex, sample2.tex, sample3.tex, sample4.tex, sample5.tex, sample6.tex, sample7.tex, prob-1stprncp.tex, prob-args.tex, prob-easy.tex, prob-easy2.tex, prob-implicit.tex, prob-mchoice.tex, prob-mixed.tex, prob-newdata.tex, prob-nosoln.tex, prob-probspaces.tex, prob-probspaces2.tex, prob-tabmchoice.tex. +%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% randomly select 25 problems from derivatives.tex and add to +%% the data set called 'deriv' +%% Display the problems +%% You may need to change \theenumi back here +%% randomly select 25 problems from probspaces.tex and add to +%% the data set called 'spaces' +%% Display the problems +%% You may need to change \theenumi back here + % This file is public domain \documentclass[a4paper]{article} \usepackage{probsoln} @@ -25,10 +74,10 @@ \random{numproblems}{1}{3} % selects 1,2 or 3 problems from 1 of the given files: -\doforrandN{1}{\file}{1stprncp,implicit}{\selectrandomly{\file}{\value{numproblems}}} +\doforrandN{1}{\file}{prob-1stprncp,prob-implicit}{\selectrandomly{\file}{\value{numproblems}}} \item Differentiate the following functions: -\input{args}% load database +\input{prob-args}% load database \begin{enumerate} \newcounter{A} \newcounter{B} @@ -45,3 +94,6 @@ \end{enumerate} \end{enumerate} \end{document} +\endinput +%% +%% End of file `sample2.tex'. diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/sample3.pdf b/Master/texmf-dist/doc/latex/probsoln/samples/sample3.pdf Binary files differnew file mode 100644 index 00000000000..91812c4451a --- /dev/null +++ b/Master/texmf-dist/doc/latex/probsoln/samples/sample3.pdf diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/sample3.tex b/Master/texmf-dist/doc/latex/probsoln/samples/sample3.tex index 35252593b33..f5020372ce4 100644 --- a/Master/texmf-dist/doc/latex/probsoln/samples/sample3.tex +++ b/Master/texmf-dist/doc/latex/probsoln/samples/sample3.tex @@ -1,3 +1,52 @@ +%% +%% This is file `sample3.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% probsoln.dtx (with options: `sample3.tex,package') +%% +%% probsoln.dtx +%% Copyright 2011 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files probsoln.dtx and probsoln.ins and the derived files probsoln.sty, sample.tex, sample2.tex, sample3.tex, sample4.tex, sample5.tex, sample6.tex, sample7.tex, prob-1stprncp.tex, prob-args.tex, prob-easy.tex, prob-easy2.tex, prob-implicit.tex, prob-mchoice.tex, prob-mixed.tex, prob-newdata.tex, prob-nosoln.tex, prob-probspaces.tex, prob-probspaces2.tex, prob-tabmchoice.tex. +%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% randomly select 25 problems from derivatives.tex and add to +%% the data set called 'deriv' +%% Display the problems +%% You may need to change \theenumi back here +%% randomly select 25 problems from probspaces.tex and add to +%% the data set called 'spaces' +%% Display the problems +%% You may need to change \theenumi back here + % This file is public domain \documentclass[a4paper]{article} \usepackage{longtable} @@ -17,8 +66,11 @@ \begin{document} \begin{longtable}{lrrrl} -\bfseries Question & \bfseries A & \bfseries B & +\bfseries Question & \bfseries A & \bfseries B & \bfseries C & \ifshowanswers \bfseries Reason\fi\\ -\selectrandomly{tabmchoice}{2} +\selectrandomly{prob-tabmchoice}{2} \end{longtable} \end{document} +\endinput +%% +%% End of file `sample3.tex'. diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/sample4.pdf b/Master/texmf-dist/doc/latex/probsoln/samples/sample4.pdf Binary files differnew file mode 100644 index 00000000000..c454080cde7 --- /dev/null +++ b/Master/texmf-dist/doc/latex/probsoln/samples/sample4.pdf diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/sample4.tex b/Master/texmf-dist/doc/latex/probsoln/samples/sample4.tex index f82eef21182..46456dc0590 100644 --- a/Master/texmf-dist/doc/latex/probsoln/samples/sample4.tex +++ b/Master/texmf-dist/doc/latex/probsoln/samples/sample4.tex @@ -1,16 +1,72 @@ +%% +%% This is file `sample4.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% probsoln.dtx (with options: `sample4.tex,package') +%% +%% probsoln.dtx +%% Copyright 2011 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files probsoln.dtx and probsoln.ins and the derived files probsoln.sty, sample.tex, sample2.tex, sample3.tex, sample4.tex, sample5.tex, sample6.tex, sample7.tex, prob-1stprncp.tex, prob-args.tex, prob-easy.tex, prob-easy2.tex, prob-implicit.tex, prob-mchoice.tex, prob-mixed.tex, prob-newdata.tex, prob-nosoln.tex, prob-probspaces.tex, prob-probspaces2.tex, prob-tabmchoice.tex. +%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% randomly select 25 problems from derivatives.tex and add to +%% the data set called 'deriv' +%% Display the problems +%% You may need to change \theenumi back here +%% randomly select 25 problems from probspaces.tex and add to +%% the data set called 'spaces' +%% Display the problems +%% You may need to change \theenumi back here + % This file is public domain \documentclass[a4paper]{article} \usepackage{probsoln} - % Sample file illustrating use of \selectallproblems + % Sample file illustrating use of \loadallproblems % All problems defined in specified file will be used % in order of definition -\showanswers + \loadallproblems{prob-easy} + %\loadselectedproblems{diffeasy:gpowh,diffeasy:arccos}{prob-easy} + %\loadexceptproblems{diffeasy:gpowh,diffeasy:arccos}{prob-easy} + + \showanswers \begin{document} Differentiate the following functions: \begin{enumerate} -\selectallproblems{easy} + \foreachproblem{\item \thisproblem} \end{enumerate} \end{document} +\endinput +%% +%% End of file `sample4.tex'. diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/sample5.pdf b/Master/texmf-dist/doc/latex/probsoln/samples/sample5.pdf Binary files differnew file mode 100644 index 00000000000..0b18bf6d483 --- /dev/null +++ b/Master/texmf-dist/doc/latex/probsoln/samples/sample5.pdf diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/sample5.tex b/Master/texmf-dist/doc/latex/probsoln/samples/sample5.tex index 531170b1d6d..5ad29c56fb0 100644 --- a/Master/texmf-dist/doc/latex/probsoln/samples/sample5.tex +++ b/Master/texmf-dist/doc/latex/probsoln/samples/sample5.tex @@ -1,13 +1,61 @@ +%% +%% This is file `sample5.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% probsoln.dtx (with options: `sample5.tex,package') +%% +%% probsoln.dtx +%% Copyright 2011 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files probsoln.dtx and probsoln.ins and the derived files probsoln.sty, sample.tex, sample2.tex, sample3.tex, sample4.tex, sample5.tex, sample6.tex, sample7.tex, prob-1stprncp.tex, prob-args.tex, prob-easy.tex, prob-easy2.tex, prob-implicit.tex, prob-mchoice.tex, prob-mixed.tex, prob-newdata.tex, prob-nosoln.tex, prob-probspaces.tex, prob-probspaces2.tex, prob-tabmchoice.tex. +%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% randomly select 25 problems from derivatives.tex and add to +%% the data set called 'deriv' +%% Display the problems +%% You may need to change \theenumi back here +%% randomly select 25 problems from probspaces.tex and add to +%% the data set called 'spaces' +%% Display the problems +%% You may need to change \theenumi back here + % This file is public domain \documentclass[a4paper]{report} \usepackage{probsoln} \begin{document} - \hideanswers \chapter{Easy Problems} -\loadrandomproblems[easyproblems]{5}{easy2} +\loadrandomproblems[easyproblems]{5}{prob-easy2} \renewcommand{\theenumi}{\thechapter.\arabic{enumi}} \begin{enumerate} @@ -15,7 +63,7 @@ \end{enumerate} \chapter{Probability Spaces} -\loadrandomproblems[probspaces]{2}{probspaces2} +\loadrandomproblems[probspaces]{2}{prob-probspaces2} \renewcommand{\theenumi}{\thechapter.\arabic{enumi}} \begin{enumerate} @@ -32,3 +80,6 @@ \end{enumerate} \end{document} +\endinput +%% +%% End of file `sample5.tex'. diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/sample6.tex b/Master/texmf-dist/doc/latex/probsoln/samples/sample6.tex new file mode 100644 index 00000000000..6719c02088f --- /dev/null +++ b/Master/texmf-dist/doc/latex/probsoln/samples/sample6.tex @@ -0,0 +1,62 @@ +%% +%% This is file `sample6.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% probsoln.dtx (with options: `sample6.tex,package') +%% +%% probsoln.dtx +%% Copyright 2011 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files probsoln.dtx and probsoln.ins and the derived files probsoln.sty, sample.tex, sample2.tex, sample3.tex, sample4.tex, sample5.tex, sample6.tex, sample7.tex, prob-1stprncp.tex, prob-args.tex, prob-easy.tex, prob-easy2.tex, prob-implicit.tex, prob-mchoice.tex, prob-mixed.tex, prob-newdata.tex, prob-nosoln.tex, prob-probspaces.tex, prob-probspaces2.tex, prob-tabmchoice.tex. +%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% randomly select 25 problems from derivatives.tex and add to +%% the data set called 'deriv' +%% Display the problems +%% You may need to change \theenumi back here +%% randomly select 25 problems from probspaces.tex and add to +%% the data set called 'spaces' +%% Display the problems +%% You may need to change \theenumi back here +\documentclass{article} + +\usepackage[usedefaultargs]{probsoln} + +\loadallproblems{prob-args} + +\begin{document} +\begin{enumerate} +\foreachproblem{\item \thisproblem} +\end{enumerate} +\end{document} +\endinput +%% +%% End of file `sample6.tex'. diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/sample7.tex b/Master/texmf-dist/doc/latex/probsoln/samples/sample7.tex new file mode 100644 index 00000000000..8bf5b5ecc67 --- /dev/null +++ b/Master/texmf-dist/doc/latex/probsoln/samples/sample7.tex @@ -0,0 +1,71 @@ +%% +%% This is file `sample7.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% probsoln.dtx (with options: `sample7.tex,package') +%% +%% probsoln.dtx +%% Copyright 2011 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files probsoln.dtx and probsoln.ins and the derived files probsoln.sty, sample.tex, sample2.tex, sample3.tex, sample4.tex, sample5.tex, sample6.tex, sample7.tex, prob-1stprncp.tex, prob-args.tex, prob-easy.tex, prob-easy2.tex, prob-implicit.tex, prob-mchoice.tex, prob-mixed.tex, prob-newdata.tex, prob-nosoln.tex, prob-probspaces.tex, prob-probspaces2.tex, prob-tabmchoice.tex. +%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% randomly select 25 problems from derivatives.tex and add to +%% the data set called 'deriv' +%% Display the problems +%% You may need to change \theenumi back here +%% randomly select 25 problems from probspaces.tex and add to +%% the data set called 'spaces' +%% Display the problems +%% You may need to change \theenumi back here +\documentclass{article} + +\usepackage{tikz} +\usepackage{probsoln} + +\loadallproblems{prob-mixed} + +\begin{document} +\section{Exercises} +\begin{enumerate} + \foreachproblem{\item\label{q-\thisproblemlabel} \thisproblem} +\end{enumerate} + +\section{Solutions} +\showanswers + +\begin{enumerate} + \foreachsolution{\item[\ref{q-\thisproblemlabel}] \thisproblem} +\end{enumerate} +\end{document} +\endinput +%% +%% End of file `sample7.tex'. diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/tabmchoice.tex b/Master/texmf-dist/doc/latex/probsoln/samples/tabmchoice.tex deleted file mode 100644 index 39cd1f10e41..00000000000 --- a/Master/texmf-dist/doc/latex/probsoln/samples/tabmchoice.tex +++ /dev/null @@ -1,16 +0,0 @@ - % These problems are designed to be placed in a - % tabular environment - % -\newproblem{tab:1}{% -What is $(3+2)\times5$? & -25 \ifshowanswers\selected\else\notselected\fi & -13 \notselected & -10 \notselected & -}{Brackets come first}% - -\newproblem{tab:2}{% -What is $-1+2\times3$? & -3 \notselected & --7 \notselected & -5 \ifshowanswers\selected\else\notselected\fi & -}{Multiplication comes first}% |