probsoln package FAQ

I get an error when I put a command definition in my database when using \selectrandomly 🔗

\selectrandomly inputs the database twice, so any command definition will be read twice, causing an error. You can use the switch \iffirstpass to prevent the error. For example:

\iffirstpass
\newcommand{\mycmd}{}
\fi
However it is generally not a good idea to put anything other than problem definitions (\newproblem or defproblem) within the database. Note that if you use \loadallproblems, \loadselectedproblems or \loadrandomproblems, the file will be loaded within a group, so any commands in the file that occur outside of problem definitions will only have a local effect.

2020-07-03 11:15:46


Permalink: https://www.dickimaw-books.com/faq.php?id=158
Alternative link: https://www.dickimaw-books.com/faq.php?itemlabel=prscmdinfile

Category: probsoln package
Topic: Error Messages