probsoln: ¿Cómo vincular el problema con su solución?

probsoln: ¿Cómo vincular el problema con su solución?

Simplifiqué el ejemplo de las páginas 13 y 14 delprobsoln documentación del paquetepara hacer la siguiente pregunta:¿Cómo puedo vincular los problemas con sus soluciones?(Las soluciones ya están vinculadas con los problemas correspondientes).

MWE (¡2 archivos!)

derivados.tex

\begin{defproblem}{cosxsqsinx}%
\begin{onlyproblem}%
$y = \cos(x^2)\sin x$.%
\end{onlyproblem}%
\begin{onlysolution}%
\[\frac{dy}{dx} = -\sin(x^2)2x\sin x + \cos(x^2)\cos x\]
\end{onlysolution}%
\end{defproblem}

principal.tex

\documentclass{report}

\usepackage{probsoln}
\usepackage[colorlinks,linkcolor=blue]{hyperref}

\begin{document}

\hideanswers

\chapter{Differentiation}
% randomly select 25 problems from derivatives.tex and add to
% the data set called 'deriv'
\loadrandomproblems[deriv]{1}{derivatives}
% Display the problems
\renewcommand{\theenumi}{\thechapter.\arabic{enumi}}
\begin{enumerate}
\foreachproblem[deriv]{\item\label{prob:\thisproblemlabel}\thisproblem}
\end{enumerate}
% You may need to change \theenumi back here

\appendix
\chapter{Solutions}
\showanswers
\begin{itemize}
\foreachdataset{\thisdataset}{%
\foreachproblem[\thisdataset]{\item[\ref{prob:\thisproblemlabel}]\thisproblem}
}
\end{itemize}

\end{document}

Captura de pantalla

Quiero el enlace "1.1" en la página 1 a la solución...

ingrese la descripción de la imagen aquí

...en la página 2. Al igual que "1.1" en la página 2, se vincula al ejercicio en la página 1.

ingrese la descripción de la imagen aquí

Respuesta1

\documentclass{report}

\usepackage{probsoln}
\usepackage[colorlinks,linkcolor=blue]{hyperref}

\begin{document}

\hideanswers

\chapter{Differentiation}
% randomly select 25 problems from derivatives.tex and add to
% the data set called 'deriv'
\loadrandomproblems[deriv]{1}{derivatives}
% Display the problems
\renewcommand{\theenumi}{\thechapter.\arabic{enumi}}
\begin{enumerate}
\foreachproblem[deriv]{%
 \item[{\refstepcounter{enumi}\label{prob:\thisproblemlabel}%
        \hyperref[sol:\thisproblemlabel]{\theenumi}}]
       \thisproblem}
\end{enumerate}
% You may need to change \theenumi back here

\appendix
\chapter{Solutions}
\showanswers
\begin{itemize}
\foreachdataset{\thisdataset}{%
\foreachproblem[\thisdataset]{%
 \item[\ref{prob:\thisproblemlabel}\phantomsection\label{sol:\thisproblemlabel}]\thisproblem}
}
\end{itemize}

\end{document}

información relacionada