
Ich versuche, ein bisschen schick zu sein mit demAkronymPaket. Ich habe mehrere Akronyme definiert (ein Beispiel füge ich unten ein) und möchte in meinem Text einen Link zur Akronymdefinition erstellen, allerdings für den ersten Buchstaben des Akronyms und nicht für das ganze.
Mein Akronym ist also „S-Welle“ und ich würde gerne eine Möglichkeit finden, „S“ zu schreiben und es mit dem Akronym zu verknüpfen.
\documentclass{article}
\usepackage{hyperref}
\usepackage{acronym}
\usepackage{lipsum}
\begin{document}
\acused{swave}\acused{pwave}\acused{dwave} % mark as used for this example
I'd like to have the `S' linked to the entry for the acronym `S-wave' in the following sentence.
The system comprises of both S- and \ac{pwave} components. By contrast, the \ac{dwave} contribution is negligible.
\lipsum[3]
\section*{List of acronyms}
\begin{acronym}
\acro{swave}[S-wave]{the $K\pi$ system in a scalar, $J=0$ state}
\acro{pwave}[P-wave]{the $K\pi$ system in a vector, $J=1$ state}
\acro{dwave}[D-wave}{the $K\pi$ system in a tensor, $J=2$ state}
\end{acronym}
\end{document}
Antwort1
Sie können hyperref
Folgendes verwenden \hyperlink{link target}{link text}
:
\hyperlink{swave}{S}
Ein kleiner Vorteil ist die Verwendung acronym
des internen Makros von \AC@hyperlink{link target}{link text}
. Dies hat den kleinen Vorteil, dass ein Fehler ausgegeben wird, wenn hyperref
es nicht geladen wird.
Das einzige, was Sie dann noch brauchen, ist eine passende Hülle
\makeatletter
\newcommand*\aclink{\AC@hyperlink}
\makeatother
Vollständiger Code:
\documentclass{article}
\usepackage{hyperref}
\usepackage{acronym}
\usepackage{lipsum}
\makeatletter
\newcommand*\aclink{\AC@hyperlink}
\makeatother
\begin{document}
\acused{swave}\acused{pwave}\acused{dwave} % mark as used for this example
I'd like to have the `S' linked to the entry for the acronym `S-wave' in the
following sentence.
The system comprises of both \aclink{swave}{S}- and \ac{pwave}
components. By contrast, the \ac{dwave} contribution is negligible.
% or:
The system comprises of both \hyperlink{swave}{S}- and \ac{pwave}
components. By contrast, the \ac{dwave} contribution is negligible.
\lipsum[3]
\section*{List of acronyms}
\begin{acronym}
\acro{swave}[S-wave]{the $K\pi$ system in a scalar, $J=0$ state}
\acro{pwave}[P-wave]{the $K\pi$ system in a vector, $J=1$ state}
\acro{dwave}[D-wave]{the $K\pi$ system in a tensor, $J=2$ state}
\end{acronym}
\newpage\null % add an empty page so we can see the links go to the right place
\end{document}