TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I read Hyperlink with answers and have tried to apply the technique to my environments that I have defined using the ntheorem package.

In the MWE below the answer links correctly go to the questions, but the questions do not go to the answers. How can this be fixed?


{\item[\theorem@headerfont \llap{\hyperlink{soln:##2}{##2}}]}% 

% problem environment
\settowidth{\problabel}{\textbf{\theproblem} }%

% solution environment
  {\par{ \hyperlink{prob:#1}{#1}}\quad\hypertarget{soln:#1}{}}%



        First solution.

        second solution.


EDIT: It also helped to have the target first:

    % solution environment
share|improve this question
up vote 1 down vote accepted

I compiled your MWE (TeXlive 2011), and it worked just fine: questions link to answers, and answers link to questions. Did you make a rerun? Could you add a \listfiles before \begin{document} and post the result (especially: which hyperref version did you use)?

share|improve this answer
Thanks very much, that did it. I also changed my compile method from pdflatex to LaTeX, and changed the position of the anchor (see edit above) – cmhughes Aug 27 '11 at 22:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.