summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/probsoln/probsoln-manual.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/probsoln/probsoln-manual.tex')
-rw-r--r--Master/texmf-dist/doc/latex/probsoln/probsoln-manual.tex70
1 files changed, 55 insertions, 15 deletions
diff --git a/Master/texmf-dist/doc/latex/probsoln/probsoln-manual.tex b/Master/texmf-dist/doc/latex/probsoln/probsoln-manual.tex
index c7454082cc1..83f12ca68e6 100644
--- a/Master/texmf-dist/doc/latex/probsoln/probsoln-manual.tex
+++ b/Master/texmf-dist/doc/latex/probsoln/probsoln-manual.tex
@@ -16,7 +16,7 @@
\RecordChanges
\PageIndex
-\CheckSum{1144}
+\CheckSum{1484}
\newcommand*{\dq}[1]{``#1''}
@@ -24,7 +24,7 @@
\MakeShortVerb{"}
\DeleteShortVerb{\|}
- \title{probsoln v3.01:
+ \title{probsoln v3.02:
creating problem sheets optionally with solutions}
\author{Nicola L.C. Talbot\\[10pt]
School of Computing Sciences\\
@@ -33,7 +33,7 @@ Norwich. Norfolk\\
NR4 7TJ. United Kingdom.\\
\url{http://theoval.cmp.uea.ac.uk/~nlct/}}
- \date{2011-08-22}
+ \date{2011-12-10}
\maketitle
\tableofcontents
@@ -66,6 +66,30 @@ default arguments supplied in the problem definition.
problem arguments (default).
\end{description}
+\section{Verbatim}\label{sec:verbatim}
+
+As from version 3.02, problems and solutions may contain verbatim
+text, but you must use the \iterm{fragile}\texttt{fragile} (or
+\texttt{fragile=true}) option for the associated environments.
+
+Alternatively, if most of your problems contain verbatim, you can
+globally set this option using:
+\begin{verbatim}
+\setkeys{probsoln}{fragile}
+\end{verbatim}
+You can switch off this option using \texttt{fragile=false}.
+
+The \texttt{fragile} option writes information to a temporary file.
+This defaults to "\jobname.vrb" but the name may be changed. The
+extension (".vrb") is given by:
+\begin{definition}[\DescribeMacro{\ProbSolnFragileExt}]
+\cs{ProbSolnFragileExt}
+\end{definition}
+The base name (\cs{jobname}) is given by:
+\begin{definition}[\DescribeMacro{\ProbSolnFragileFile}]
+\cs{ProbSolnFragileFile}
+\end{definition}
+
\section{Showing and Hiding Solutions}\label{sec:showanswers}
In addition to the \pkgopt{answers} and \pkgopt{noanswers} package
@@ -93,8 +117,15 @@ Alternatively you can use \ics{ifshowanswers}\ldots\cs{else}\ldots
Assignment 1\ifshowanswers\space (Solution Sheet)\fi
\end{verbatim}
-For longer passages, you can use the environments \DescribeEnv{onlyproblem}\env{onlyproblem}
-and \DescribeEnv{onlysolution}\env{onlysolution}. For example:
+For longer passages, you can use the environments
+\begin{definition}[\DescribeEnv{onlyproblem}]
+\cs{begin}\marg{onlyproblem}\oarg{option}
+\end{definition}
+and
+\begin{definition}[\DescribeEnv{onlysolution}]
+\cs{begin}\marg{onlysolution}\oarg{option}
+\end{definition}
+For example:
\begin{verbatim}
\begin{onlyproblem}%
What is the derivative of $f(x) = x^2$?
@@ -114,17 +145,19 @@ What is the derivative of $f(x) = x^2$?
Solution: $f'(x) = 2x$
\end{onlysolution}
\end{verbatim}
+
\begin{important}
-You can't use verbatim text in the body of the
-\envfmt{onlyproblem} or \envfmt{onlysolution} environments.
-If you need verbatim-like text, then try packages such as
-\sty{alltt}. Remember that you also can't use verbatim
-text in command arguments.
+If you want to include verbatim text in the body of
+\env{onlyproblem} or \env{onlysolution}, you need to specify
+\texttt{fragile} in the optional argument of the environment.
+(See \sectionref{sec:verbatim} for further details.)
\end{important}
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}.
+The optional argument of \envfmt{onlysolution} (and \env{onlyproblem})
+is inherited from the parent \env{defproblem} setting.
\section{General Formatting Commands}\label{sec:formatting}
@@ -237,7 +270,7 @@ 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
+\verb|\begin{defproblem}|\oarg{n}\oarg{default args}\marg{label}\oarg{option}\newline
\meta{definition}\newline
\verb|\end{defproblem}|
\end{definition}
@@ -249,6 +282,14 @@ 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.)
+\begin{important}
+The final optional argument \meta{option} may be \texttt{fragile} to
+indicate that the problem contains verbatim text. Any occurrences of
+\env{onlyproblem} or \env{onlysolution} contained within
+\envfmt{defproblem} are inherited from \envfmt{defproblem}. (See
+\sectionref{sec:verbatim} for further details.)
+\end{important}
+
If \env{defproblem} occurs in the document or is included via
\ics{input} or \ics{include}, then the problem will be added to
the default data set. If \envfmt{defproblem} occurs in an external
@@ -356,10 +397,9 @@ This is a shortcut for:
\end{ttfamily}
\begin{important}
-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 \sty{alltt} package.
+Note that you can't use verbatim text with \cs{newproblem} or
+\cs{newproblem*}. Use the \env{defproblem} environment instead with
+the \texttt{fragile option}.
\end{important}
\section{Using a Problem}\label{sec:useproblem}