diff options
| author | Sebastian Kuhnert | 2016-11-08 15:16:27 +0000 |
|---|---|---|
| committer | Sebastian Kuhnert | 2016-11-08 15:16:27 +0000 |
| commit | e616d8ef7c606c7c9c45a2fe8cb958e9d632fc67 (patch) | |
| tree | 46da3ab9b85717312dab1cccee0738d94eac6254 | |
| parent | 9467b011517db19bab4d1bba53fe67c442bd4305 (diff) | |
| download | exercisesheets-e616d8ef7c606c7c9c45a2fe8cb958e9d632fc67.tar.gz exercisesheets-e616d8ef7c606c7c9c45a2fe8cb958e9d632fc67.tar.bz2 exercisesheets-e616d8ef7c606c7c9c45a2fe8cb958e9d632fc67.zip | |
exercisesheets.sty: make pdf page labels unique
| -rw-r--r-- | exercisesheets.sty | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/exercisesheets.sty b/exercisesheets.sty index b5a81c7..1f5330c 100644 --- a/exercisesheets.sty +++ b/exercisesheets.sty @@ -357,10 +357,16 @@ \renewcommand{\thepage}{\arabic{page}}%changed for every sheet \setcounter{secnumdepth}{-1} -% make PDF destinations unique: \AfterPackage*{hyperref}{% - \def\theHsection{\arabic{part}.\arabic{section}}% - \def\theHpage{\arabic{part}-\arabic{page}}% + % make PDF destinations unique: + \def\theHsection{\arabic{sheetid}.\arabic{section}}% + \def\theHpage{\arabic{sheetid}-\arabic{page}}% + % + % open bookmarks when typesetting a single sheet + \AtEndPreamble{% + \exsh@checkrange{0}% + \ifexsh@singularrange\hypersetup{bookmarksopen}\fi + }% } % automatic title selection @@ -391,8 +397,10 @@ \title{\exsh@title} \fi } +\newcounter{sheetid}% only used to disambiguate hyperref labels \newenvironment{sheet}[1][]{% \clearpage + \stepcounter{sheetid}% \pgfkeys{exsh,every sheet,#1}% \ifthenelse{\equal{}{\pgfkeysvalueof{/exsh/title}}}{% \numdef\exsh@tmp{\value{part}+1}% |
