I'm using the answers
package for an exercises book. I would like to create clickable hyperlinks (in the generated pdf file) from the exercise to the corresponding solution and back from the solution to the exercise.
Here is my ex
(exercise) environment:
\documentclass[12pt, openany]{extbook}
\usepackage{pstricks,pstricks-add,pst-math,pst-xkey}
\usepackage[frenchb]{babel}
\usepackage{slashbox}
\usepackage{graphicx}
\usepackage{amsmath,amssymb,amstext}
\usepackage[latin1]{inputenc}
\usepackage[OT1]{fontenc}
\usepackage{fancybox}
\usepackage{a4wide}
\usepackage{rotating}
\usepackage{epic}
\usepackage{answers}
\usepackage{fancyvrb}
\usepackage{thmbox}
\thmboxoptions{headstyle=\bfseries\boldmath#1 #2~,thickness=0.6pt, cut=false}
\usepackage[hidelinks]{hyperref}
\newcounter{moncompteur}
\newtheorem[M]{exc}[moncompteur]{ \textbf{Exercise}}{}
\newenvironment{ex}{\begin{exc}\normalfont}{\end{exc}}
\Newassociation{sol}{Soln}{corr}
\renewenvironment{Soln}[1]{\par\bigskip\noindent {\bfseries Solution of exercise #1}\quad}{}
Best Answer
You can use the
\hyperlink
,\hypertarget
mechanism provided by thehyperref
package. A little example:Note that I modified the definition of the
ex
theorem-like structure using\theoremstyle{definition}
from theamsthm
package and removed the countermoncompteur
.