
Simplifiquei o exemplo nas páginas 13 e 14 doprobsoln
documentação do pacotepara fazer a seguinte pergunta:Como posso vincular os problemas às suas soluções?(As soluções já estão vinculadas aos problemas correspondentes.)
MWE (2 arquivos!)
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 tela
Quero "1.1" no link da página 1 para a solução ...
...na página 2. Curta os links "1.1" na página 2 para o exercício na página 1.
Responder1
\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}