I'm new to LaTeX and completing someone else's work. I'm using MiKTeX 2.9 on Windows 10.
I am trying to create clickable hyperlinks from in-text exercises to their solutions in an appendix. I would like to not have to define a solution environment or use the answers package, as only a random selection of exercises have solutions and I'd like the exercise and solution numbers to match up. Currently I'm using hyperref to refer to exercises from their solutions, but I don't know how to label the solutions and reference them in the exercises as well without messing up the numbering.
Here's what I'm working with:
\documentclass{article} \usepackage[colorlinks, backref]{hyperref} \newtheorem{exercise}{Exercise} \begin{document} \begin{exercise}\label{ex:one} exercise text \end{exercise} \begin{exercise} exercise without solution \end{exercise} \begin{exercise}\label{ex:three} exercise text \end{exercise} {Exercise}~\ref{ex:one} solution text {Exercise}~\ref{ex:three} solution text \end{document} Any advice would be much appreciated.


answerspackage, as only a random selection of exercises have solutions and I'd like the exercise and solution numbers to match up.” I don't get what either environments or theanswerspackage have to do with possibly not matching numbers of exercises and solutions…