Consider the following code:
\documentclass[a4paper,12pt]{book}
\usepackage{amsthm}
\usepackage{hyperref}
\theoremstyle{plain}
\newtheorem{exercise}{Exercise}
\newtheorem{solution}{Solution}
\begin{document}
\begin{exercise}
This is an exercise.
\end{exercise}
\begin{solution}
This is a solution.
\end{solution}
\end{document}
I'd like to:
- Assign the same number to each "exercise" and "solution" pair (possibly via some sort of unique ID they share?);
- Automatically generate hyperlinks from an "exercise" title to its corresponding "solution" and vice versa, so one can easily navigate from a problem to its solution and vice versa.
I'm probably asking for something fairly difficult -- I'd be happy with just the first question. I'm not sure if they should be two separate questions but they seem quite related to me.


exerciseandsolutionalways be next to one another? Or do you plan on puttingsolutions (say) at the end of the document, while theexercises will be part of the main document body? – Werner Nov 04 '14 at 20:58answerspackage (and others) make this possible. You should be able to get the numbering and linking to work with its structure. – Ethan Bolker Nov 07 '14 at 14:51