probsoln: Как связать проблему с ее решением?

probsoln: Как связать проблему с ее решением?

Я упростил пример на стр. 13 и 14probsoln пакет документациизадать следующий вопрос:Как я могу связать проблемы с их решениями?(Решения уже связаны с соответствующими проблемами.)

MWE (2 файла!)

производные.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}

основной.текс

\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}

Скриншот

Я хочу, чтобы на странице 1 была ссылка на решение «1.1»...

введите описание изображения здесь

...на странице 2. Как и «1.1» на странице 2, ссылка на упражнение на странице 1.

введите описание изображения здесь

решение1

\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}

Связанный контент