diff options
author | Karl Berry <karl@freefriends.org> | 2011-04-17 22:39:42 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-04-17 22:39:42 +0000 |
commit | 28e4833279c49989c8090e430ae116426000128b (patch) | |
tree | 9ae4a7a4c634468a3db43c1610d8d5839de6bffa /Master/texmf-dist/tex/latex/exercise | |
parent | 9645fdc665d2bd438bfe8e5e616f0381f4ab5e45 (diff) |
exercise 1.55 (17apr11)
git-svn-id: svn://tug.org/texlive/trunk@22107 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/exercise')
-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{}% |