Skip to content

Commit 6dc3bbb

Browse files
committed
include olfileinfo in .prb file to make references work without hard-coding part, chapter, section
1 parent aa13067 commit 6dc3bbb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sty/open-logic-defer.sty

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@
3030
\Newassociation{prob}{probdeferred}{\jobname}
3131
\Newassociation{probtag}{probdeferredtag}{\jobname}
3232

33+
\newcommand*{\olprobsavefileid}{\Writetofile{\jobname}{\string\olfileid{\theolpart}{\theolchapter}{\theolsection}}}
34+
3335
% every prob environment, execute \ifproblems\ifproblemswrite
3436

35-
\pretocmd{\prob}{\ifproblems\ifproblemswrite}{}{}
36-
\pretocmd{\probtag}{\ifproblems\ifproblemswrite}{}{}
37+
\pretocmd{\prob}{\olprobsavefileid\ifproblems\ifproblemswrite}{}{}
38+
\pretocmd{\probtag}{\olprobsavefileid\ifproblems\ifproblemswrite}{}{}
3739

3840
% probdeferred and probdeferredtag are just wrappers for theorem
3941
% environments which do the actual typesetting. answers.sty writes
@@ -93,7 +95,7 @@
9395
\renewcommand{\memendofchapterhook}{%
9496
\Closesolutionfile{\jobname}
9597
\Opensolutionfile{\jobname}
96-
\Writetofile{\jobname}{
98+
\Writetofile{\jobname}{%
9799
\string\renewcommand*{\string\probch}{\thechapter}
98100
\string\setcounter{probd}{0}}
99101
\let\ifproblems\makeifproblemsprint}

0 commit comments

Comments
 (0)