我在使用 acronym 包与 hyperref 结合使用时遇到错误。错误消息为:
! Incomplete \ifnum; all text was ignored after line 83.
下面是 MWE,我不知道发生了什么。
\documentclass[11pt, a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[nohyperlinks, withpage, smaller]{acronym}
\usepackage{lipsum}
\usepackage{hyperref}
\hypersetup{%
pdftitle = {pdftitle},
pdfauthor = {author}
hidelinks,
unicode,
bookmarksopenlevel=Section,
colorlinks=false,
linkcolor=blue,
citecolor=blue,
linktoc=all,pdfa,
bookmarks=true
}
\clubpenalty1000000
\widowpenalty1000000
\displaywidowpenalty1000000
\begin{document}
\tableofcontents
\clearpage
\section*{Abkürzungsverzeichnis}
\lipsum[1]
\begin{acronym}
\acro{AF}[AF]{Access Flow, Shuntfluss}
\acro{AR}[AR]{Access Recirculation, Suntrezirkulation}
\acro{AV}[AV]{Arteriovenöse}
\acro{BVM}[BVM]{Blutvolumenmodul}
\end{acronym}
\ac{BVM}
\section{two}
\lipsum[2] \ac{AV}
\end{document}
答案1
修复就在这里...https://github.com/oetiker/acronym/pull/19不幸的是,如果没有 .aux 文件,则存在另一个问题导致第一次编译失败...因此,在我发布新版本之前也需要解决这个问题。
diff --git a/acronym.dtx b/acronym.dtx
index 2e0378e..fc5013c 100644
--- a/acronym.dtx
+++ b/acronym.dtx
@@ -1254,14 +1254,14 @@ blocks to be tested separately. The latter are commonly indicated as
\ifAC@printonlyused 1%
\else\ifAC@printonlyreused 1%
\else 0\fi\fi%
- =1%
+ =1\relax%
\ifnum%
\ifAC@printonlyused%
\expandafter\ifx\csname acused@#1@once\endcsname\AC@used 1 \else 0 \fi%
\else\ifAC@printonlyreused%
\expandafter\ifx\csname acused@#1@twice\endcsname\AC@used 1 \else 0 \fi%
\else 0 \fi\fi%
- =1%
+ =1\relax%
\item[\protect\AC@hypertarget{#1}{%
\AC@hyperref[acro:#1]{\aclabelfont{#2}\hfill}%
}]\AC@hyperref[acro:#1]{#3}%