summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/probsoln/probsoln.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/probsoln/probsoln.dtx')
-rw-r--r--Master/texmf-dist/source/latex/probsoln/probsoln.dtx124
1 files changed, 91 insertions, 33 deletions
diff --git a/Master/texmf-dist/source/latex/probsoln/probsoln.dtx b/Master/texmf-dist/source/latex/probsoln/probsoln.dtx
index 0468d92c632..9b4593b23b0 100644
--- a/Master/texmf-dist/source/latex/probsoln/probsoln.dtx
+++ b/Master/texmf-dist/source/latex/probsoln/probsoln.dtx
@@ -1,15 +1,15 @@
%\iffalse
-% probsoln.dtx generated using makedtx version 0.94b (c) Nicola Talbot
+% probsoln.dtx generated using makedtx version 1.1 (c) Nicola Talbot
% Command line args:
-% -macrocode ".+\.tex"
-% -comment ".+\.tex"
+% -doc "probsoln-manual.tex"
% -src "(.+)\.(sty)\Z=>\1.\2"
% -src "(sample.*)\.(tex)\Z=>\1.\2"
% -src "(prob-.*)\.(tex)\Z=>\1.\2"
-% -doc "probsoln-manual.tex"
+% -comment ".+\.tex"
+% -macrocode ".+\.tex"
% -author "Nicola Talbot"
% probsoln
-% Created on 2013/3/13 15:28
+% Created on 2017/7/10 11:58
%\fi
%\iffalse
%<*package>
@@ -32,7 +32,7 @@
%\fi
% \iffalse
% Doc-Source file to use with LaTeX2e
-% Copyright (C) 2013 Nicola Talbot, all rights reserved.
+% Copyright (C) 2017 Nicola Talbot, all rights reserved.
% \fi
% \iffalse
%<*driver>
@@ -54,7 +54,7 @@
\RecordChanges
\PageIndex
-\CheckSum{1822}
+\CheckSum{1830}
\newcommand*{\dq}[1]{``#1''}
@@ -66,16 +66,12 @@
%\MakeShortVerb{"}
%\DeleteShortVerb{\|}
%
-% \title{probsoln v3.04:
+% \title{probsoln v3.05:
%creating problem sheets optionally with solutions}
-% \author{Nicola L.C. Talbot\\[10pt]
-%School of Computing Sciences\\
-%University of East Anglia\\
-%Norwich. Norfolk\\
-%NR4 7TJ. United Kingdom.\\
-%\url{http://theoval.cmp.uea.ac.uk/~nlct/}}
-%
-% \date{2012-08-23}
+% \author{Nicola L.C. Talbot\\
+%\url{http://www.dickimaw-books.com/}}
+%
+% \date{2017-07-10}
% \maketitle
%\tableofcontents
%
@@ -95,6 +91,11 @@
%In this way, one file can either produce the student's version or
%the teacher's version.
%
+%You may want to consider using \sty{datatool} with \app{datatooltk}
+%instead of \styfmt{probsoln}. See
+%\href{http://www.dickimaw-books.com/latex/admin/html/datatoolexam.shtml}{Using
+%the \styfmt{datatool} Package for Exams or Assignment Sheets}.
+%
%\section{Package Options}\label{sec:pkgopt}
%The following options may be passed to this package:
%\begin{description}
@@ -376,6 +377,11 @@
%\end{onlysolution}
%\end{defproblem}
%\end{verbatim}
+%\begin{important}
+%If you don't use \cs{thisproblem} or you don't
+%use the package option \pkgopt{usedefaultargs}, then you must supply
+%the arguments.
+%\end{important}
%
%\begin{definition}[\DescribeMacro{\newproblem}]
%\cs{newproblem}\oarg{n}\oarg{default args}\marg{label}\marg{problem}\marg{solution}
@@ -393,11 +399,11 @@
%\end{ttfamily}
%For example:
%\begin{verbatim}
-%\newproblem[1]{diffsin}{%
-% \(f(x) = \sin(#1x)\)
+%\newproblem[1]{diffcos}{%
+% \(f(x) = \cos(#1x)\)
%}%
%{%
-% \(f'(x) = #1\cos(#1x)\)
+% \(f'(x) = -#1\sin(#1x)\)
%}
%\end{verbatim}
%is equivalent to
@@ -520,18 +526,33 @@
%list}.
%
%\begin{definition}[\DescribeMacro{\loadrandomproblems}]
-%\cs{loadrandomproblems}\oarg{data set}\marg{n}\marg{filename}
+%\cs{loadrandomproblems}\oarg{data set}\marg{n}\marg{filenames}
%\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,
-%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 \meta{n} problems
-%defined in \meta{filename}.
+%This randomly loads \meta{n} problems from the comma-separated
+%list\footnote{The list form was added to v3.05. Earlier versions
+%only allow a single filename.}
+%of \meta{filenames} and adds them to the given data set. If
+%\meta{data set} 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
+%\meta{n} problems defined across the given list of files.
+%
+%Note that there's a difference between
+%\begin{verbatim}
+%\loadrandomproblems{5}{problemset1}
+%\loadrandomproblems{5}{problemset2}
+%\end{verbatim}
+%and
+%\begin{verbatim}
+%\loadrandomproblems{10}{problemset1,problemset2}
+%\end{verbatim}
+%In the first case, the data set will contain 5 problems randomly
+%selected from \texttt{problemset1} and 5 problems randomly selected
+%from \texttt{problemset2}. Whereas in the second case, the data set
+%will contain 10 problems randomly selected across both files.
%
%\begin{definition}[\DescribeMacro{\loadrandomexcept}]
-%\cs{loadrandomexcept}\oarg{data
-%set}\marg{n}\marg{filename}\marg{exception list}
+%\cs{loadrandomexcept}\oarg{data set}\marg{n}\marg{filenames}\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}.
@@ -711,7 +732,7 @@
%\begin{definition}[\DescribeMacro{\foreachsolution}]
%\cs{foreachsolution}\oarg{data set}\marg{body}
%\end{definition}
-%This is equivalent to \cs{foreachsolution}, but only iterates
+%This is equivalent to \cs{foreachproblem}, 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
@@ -967,7 +988,7 @@
% \end{macrocode}
% Identify this package and version:
% \begin{macrocode}
-\ProvidesPackage{probsoln}[2012/08/23 v3.04 (NLCT)]
+\ProvidesPackage{probsoln}[2017/07/10 v3.05 (NLCT)]
% \end{macrocode}
% Required packages:
%\changes{3.01}{2011/08/22}{substr package no longer required}
@@ -1490,7 +1511,7 @@
% which stores a comma-separated list of labels for each problem
% associated with that data base. Each problem \meta{label} is
% stored in the macro
-% \cs{prob@data@}\meta{name}"@"\meta{name}"@"\meta{label}. Problems
+% \cs{prob@data@}\meta{name}"@"\meta{label}. Problems
% loaded from an external file using \cs{loadproblems} are added
% to the specified data base. Any problems that are defined in the
% document or are \cs{input}ed from another file (without the
@@ -2345,7 +2366,11 @@ Please specify (e.g. \csname @prob@getargs@eg@\romannumeral#1\endcsname):}%
% \begin{macrocode}
\let\prob@do@defproblem=\prob@add@currentlabel
\firstpasstrue
- \input{#3}%
+% \end{macrocode}
+%\changes{3.05}{2017/07/10}{allow comma-separated list of file names}
+%Allow a comma-separated list of file names.
+% \begin{macrocode}
+ \@for\@thisfile:=#3\do{\input{\@thisfile}}%
% \end{macrocode}
% Shuffle labels.
% \begin{macrocode}
@@ -2422,7 +2447,7 @@ Please specify (e.g. \csname @prob@getargs@eg@\romannumeral#1\endcsname):}%
% \begin{macrocode}
\let\prob@do@defproblem=\prob@do@selectedproblem
\firstpassfalse
- \input{#3}%
+ \@for\@thisfile:=#3\do{\input{\@thisfile}}%
% \end{macrocode}
% Move them from the reserved data base into the required data base
% in the order specified by \cs{prob@selectedlabels}
@@ -3353,6 +3378,39 @@ Differentiate the following functions:
%\fi
%\iffalse
% \begin{macrocode}
+%<*sample9.tex>
+% \end{macrocode}
+%\fi
+%\iffalse
+% \begin{macrocode}
+ % This file is public domain
+\documentclass[a4paper]{article}
+
+\usepackage{probsoln}
+ % uncomment the following line to display the answers
+ % \showanswers
+
+ % Load 10 problems randomly selected from the given files
+\loadrandomproblems{10}{prob-1stprncp,prob-easy,prob-implicit,prob-probspaces}
+
+\begin{document}
+\title{Sample Problem Sheet}
+\author{Nicola Talbot}
+\maketitle
+
+\begin{enumerate}
+ \foreachproblem{\item \thisproblem}
+\end{enumerate}
+\end{document}
+% \end{macrocode}
+%\fi
+%\iffalse
+% \begin{macrocode}
+%</sample9.tex>
+% \end{macrocode}
+%\fi
+%\iffalse
+% \begin{macrocode}
%<*prob-1stprncp.tex>
% \end{macrocode}
%\fi