Debian Codegraph @

texmf-dist/doc/latex/probsoln/samples/sample2.tex

raw
1 % This file is public domain
2 \documentclass[a4paper]{article}
3
4 \usepackage{probsoln}
5 %uncomment the following line to display the answers
6 \showanswers
7
8 % The following will generate a different set of
9 % problems in subsequent years
10 %\PSNrandseed{\year}
11
12 % The following will generate a different set of
13 % problems on every run (where each run is at
14 % least a minute apart from the previous one)
15 \PSNrandseed{\time}
16
17 \begin{document}
18 \title{Sample Problem Sheet}
19 \author{Nicola Talbot}
20 \maketitle
21
22 \begin{enumerate}
23
24 \newcounter{numproblems}
25 % store a random number from 1 to 3 in the counter numproblems
26 \random{numproblems}{1}{3}
27
28 % selects 1,2 or 3 problems from 1 of the given files:
29 \doforrandN{1}{\file}{prob-1stprncp,prob-implicit}{\selectrandomly{\file}{\value{numproblems}}}
30
31 \item Differentiate the following functions:
32 \input{prob-args}% load database
33 \begin{enumerate}
34 \newcounter{A}
35 \newcounter{B}
36 \newcounter{C}
37 \random{A}{-4}{5}
38 \random{B}{-3}{3}
39 \random{C}{-1}{10}
40 \item \useproblem{diff:quad}{\arabic{A}}{\arabic{B}}{\arabic{C}}
41
42 \random{A}{-5}{5}
43 % make sure its not 0
44 \whiledo{\value{A}=0}{\random{A}{-5}{5}}
45 \item \useproblem{diff:sin}{\arabic{A}}
46 \end{enumerate}
47 \end{enumerate}
48 \end{document}