长/短格式首字母缩略词的超级引用

长/短格式首字母缩略词的超级引用

我正在使用acronym-package 创建文档中使用的首字母缩略词列表。在某些情况下,我宁愿使用长格式,并用逗号而不是括号分隔短格式。

使用\acl{}\acs{}有效,但不会标记超级引用的位置,如 MWE 所示:

\documentclass[11pt]{article}
\usepackage{hyperref}
\usepackage[printonlyused, withpage]{acronym}

\begin{document}
\begin{acronym}[AC1]
    \acro{AC1}{Acronym 1}
    \acro{AC2}{Acronym 2}
    \acro{AC3}{Acronym 3}
\end{acronym}

I would like to introduce an acronym in brackets and comma-separated (\acl{AC1}, \acs{AC1}) but
still mark the position for the hyper-reference. However, a warning is produced instead of the
reference as it would be for \ac{AC2}.
\end{document}

这将返回一个警告:Hyper reference 'acro:AC1' on page 1 undefined。有没有办法在标记参考位置的同时产生相同的输出?

答案1

您可以手动放置所需的标签:

\documentclass[11pt]{article}
\usepackage{hyperref}
\usepackage[printonlyused, withpage]{acronym}
\makeatletter
\let\ACplacelabel\AC@placelabel
\makeatother
\begin{document}
\begin{acronym}[AC1]
    \acro{AC1}{Acronym 1}
    \acro{AC2}{Acronym 2}
    \acro{AC3}{Acronym 3}
\end{acronym}

I would like to introduce an acronym in brackets and comma-separated (\ACplacelabel{AC1}\acl{AC1}, \acs{AC1}) but
still mark the position for the hyper-reference. However, a warning is produced instead of the
reference as it would be for \ac{AC2}.
\end{document}

相关内容