diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/exercise/exercise.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/exercise/exercise.sty | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/latex/exercise/exercise.sty b/Master/texmf-dist/tex/latex/exercise/exercise.sty index ada490082a6..1a3f6d3005f 100644 --- a/Master/texmf-dist/tex/latex/exercise/exercise.sty +++ b/Master/texmf-dist/tex/latex/exercise/exercise.sty @@ -27,7 +27,7 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{exercise} - [2010/12/14 v1.54 Exercise package (P.Pichaureau)] + [2011/03/13 v1.55 Exercise package (P.Pichaureau)] %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z @@ -159,7 +159,21 @@ \newlength{\subsubQuestionIndent} \setlength{\subsubQuestionIndent}{2.5em} \newcounter{Exercise} +\newcounter{Answer} \gdef\@ExerciseCounter{Exercise} %default exercise counter +\gdef\@AnswerCounter{Answer} %default answer counter +\@ifpackageloaded{hyperref}{ +\def\@setAnswerref#1#2#3#4{% + \ifx#1\relax + \protect\G@refundefinedtrue + \nfss@text{\reset@font\bfseries ??}% + \PackageWarning{exercise}{Reference to Answer of `#3' on page + \thepage \space undefined}% + \else + \hyperref[#4]{\expandafter#2#1}\null + \fi} +\def\refAnswer#1{\expandafter\@setAnswerref\csname r@#1\endcsname\@firstoffive{#1}{#1-Answer}}} +{\let\refAnswer\ref} \newcounter{ExePart}[Exercise] \newcounter{Question}[Exercise] \newcounter{subQuestion}[Question] @@ -590,6 +604,8 @@ \def\@getAnswerInfo{% \if@AnswerRef% \def\theExercise{\ref{\AnswerRef}}% +\refstepcounter{Answer}% +\recordExerciseLabel{\AnswerRef-Answer}% \else \if@AnswerNB \def\ExerciseTitle{}% |