Link zur Lösung im Übungspaket

Link zur Lösung im Übungspaket

ich erstelle ein Übungsheft mit Hilfe des Übungspakets.

Ich verstehe, dass ich einer Frage ein Label hinzufügen kann, um eine Antwort mit einer bestimmten Frage zu verknüpfen.

ich möchte jedoch unter der Frage einen Link zur Antwort hinzufügen. Er sieht also ungefähr so ​​aus:

Aktuelle Tex-Quelle:

\usepackage[answerdelayed]{exercise}
\begin{Exercise}
What is the value of 2+5?
\end{Exercise}
\begin{Answer}
7
\end{Answer}
<rest of the document>
\shipoutaAnswer

Aktueller Output:

Exercise 1: What is the value of 2 + 5?

<rest of the document>

Solution 1: 7

Gewünschte Ausgabe:

Exercise 1: What is the value of 2 + 5?
<Link to Solution at the end of the document>

<rest of the document>

Solution 1: 7

Antwort1

Das exercisePaket verfügt über eine bestimmte Möglichkeit, das Etikett zu verwalten.

Sehen Sie sich diePaketdokumentationUnterabschnitt 2.4.

\documentclass{article}
\usepackage{hyperref}% you must load it before the exercise package
\usepackage[answerdelayed]{exercise}

\begin{document}
    \begin{Exercise}[label={mylabel}]
        What is the value of 2+5? (To see the answer click here: \refAnswer{\ExerciseLabel})
    \end{Exercise}
    \begin{Answer}[ref=\ExerciseLabel]
        7
    \end{Answer}

    rest of the document
    \newpage % I've added a new page only to clearly show the hyperlink. Of course, you don't need it in your document.

    \shipoutAnswer
\end{document}

Bildbeschreibung hier eingeben

Bildbeschreibung hier eingeben

Antwort2

So was:

\documentclass{article}
\usepackage{exercise}
\usepackage{hyperref}
\begin{document}
\begin{Exercise}
    Some introductory text.
    \Question The first question
\end{Exercise}

See the answer \hyperref[one]{here}.
\newpage
\begin{Answer}[ref=first]
    The answer to question~\ref{first}.\label{one}
\end{Answer}
\end{document}

verwandte Informationen