I'm basically trying to create multiple versions of a worksheet, each with different values for the variables in each question. To do this I'm defining random variables, then each time I compile the values change and I print a "new" version of the worksheet.
I understand how to create the random variables by using \pgfmathsetseed{\pdfrandomseed}
and defining my variables in my desired ranges as e.g. \def\A{pgfrandom{1,10}\pgfmathresult}
The problem I run into is that I want to generate an answer for each problem at the end of the worksheet. But it wants to do the calculation for the answer with a different random value than the one generated in the original question.
e.g. If I say
\def\A{pgfrandom{1,10}\pgfmathresult}
\def\B{pgfrandom{10,20}\pgfmathresult}
\def\answer{\A + \B, \pgfmathresult}
and I ask the question:
What is \A + \B?
\answer
It will produce something like....
What is 2 + 12?
5 + 19, 24
So how do I get it to display the answer a) without showing the calculation itself (i.e. 2 + 12) and b) how do I get it to not re-generate a new random variable when computing the answer?
Sorry, I hope my questions are clear. I'm new to all this. Any help is appreciated. Thanks!
\documentclass{...}
and ending with\end{document}
. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to help you. Help them help you: remove that one hurdle between you and a solution to your problem. – someonr Dec 26 '13 at 15:39