1

I have used probsoln for a number of years and have found it incredibly useful. I am sincerely grateful to the author for providing this package. I have used it to specify the inclusion of specific problems and to select random problems, given a specified seed. I would however, like to use all of its capabilities and allow it to automatically exclude problems that have been used within the past number of years. Unfortunately, I am not able to get this functionality to work. When I compile hwk.tex as given below, the first compile executes, but then a second fails. Other than the usual log and aux file, only hwk.prb is generated. I am using a full install of TeXLive 2018.

The minimal primary tex file (hwk.tex) I have tried to use is the following:

\documentclass{article}
\usepackage{probsoln}
\ExcludePreviousFile[2]{hwk.prb}

\begin{document}
\loadrandomproblems[myset]{2}{pdbhwk}
\begin{enumerate}
\foreachproblem[myset]{\item \thisproblem}
\end{enumerate}
\end{document}

The content of the pdbhwk.tex file is the following:

\newproblem{myhwk01}{Problem 01}{$x=1$}
\newproblem{myhwk02}{Problem 02}{$x=2$}
\newproblem{myhwk03}{Problem 03}{$x=3$}
\newproblem{myhwk04}{Problem 04}{$x=4$}
\newproblem{myhwk05}{Problem 05}{$x=5$}
\newproblem{myhwk06}{Problem 06}{$x=6$}

After a pdflatex compile of hwk.tex, the hwk.prb file generated contains the following:

\usedproblem{myminhwk08}{myset}{2018}
\usedproblem{myminhwk04}{myset}{2018}
}{2018}

A subsequent pdflatex compile gives the error indicating Too many }'s.

On a related note, I don't fully understand the two files referred to in the documentation as "The previously used labels file" and the "The current used labels file". Where are these located, if not in the current directory? Any help will be greatly appreciated!

  • 1
    Maybe it works if you don't give the excluded file (hwk.prb) the same name as the current file? For me it worked when I first used \ExcludePreviousFile[2]{othername}, then on the next run comment that line and add \ClearUsedFile{hwk.prb}, then on the next run delete that line and uncomment the \ExcludePreviousFile again. – Marijn Jan 30 '19 at 01:53
  • Thank you @Marijn! Just what was needed to resolve the issue. As I suspected, it was related to misunderstanding of how the previously used and the current used label files behave. When I changed the \ExcludePreviousFile to othername, the output from a PDFLaTeX compile was two files: othername.prb and hwk.prb (which is, as noted in the documentation, jobname.prb). The content of these two files was, for othername.prb, lines of the form \previousproblem{name}{set}{year} and, for jobname.prb, lines of the form \usedproblem{name}{set}{year}. Each line a valid LaTeX command. – Kelly O. Homan Jan 30 '19 at 16:24

0 Answers0