土耳其语 babel 和缩写包问题

土耳其语 babel 和缩写包问题

当使用babel-turkish带有包的包时acronym,会产生以下错误:

! 缺少 \endcsname 插入。\relax l.9 \AC@undonewlabel{acro:GSM}

代码如下:

\documentclass[12pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} % also latin5
\usepackage[turkish,shorthands=:!]{babel}
\usepackage{mathpazo}
\usepackage{lipsum}
\usepackage[printonlyused,withpage]{acronym}

\begin{document}

\chapter{A}

In the early nineties, \ac{GSM} was deployed in many European countries. 
\acf{GSM} offered for the first time international roaming for mobile 
subscribers. The \acs{GSM}’s use of \ac{TDMA} as its communication standard was 
debated at length. And every now and then there are big discussion whether 
\ac{CDMA} should have  been chosen over \ac{TDMA}.


\begin{acronym}[TDMA]
 \acro{CDMA}{Code Division Multiple Access}
 \acro{GSM}{Global System for Mobile communication}
 \acro{NA}[\ensuremath{N_{\mathrm A}}]
 {Number of Avogadro\acroextra{ (see \S\ref{Chem})}}
 \acro{NAD+}[NAD\textsuperscript{+}]{Nicotinamide Adenine Dinucleotide}
 \acro{NUA}{Not Used Acronym}
 \acro{TDMA}{Time Division Multiple Access}
 \acro{UA}{Used Acronym}
 \acro{lox}[\ensuremath{LOX}]{Liquid Oxygen}%
 \acro{lh2}[\ensuremath{LH_2}]{Liquid Hydrogen}%
 \acro{IC}{Integrated Circuit}%
 \acro{BUT}{Block Under Test}%
 \acrodefplural{BUT}{Blocks Under Test}%
 \end{acronym}
\end{document}

当我注释掉该行时\usepackage[turkish,shorthands=:!]{babel},一切都正常了。为什么会导致错误?感谢您的宝贵时间。

答案1

acronym包在其内部标签中使用了冒号,这与 设定的活动冒号相冲突babel-turkish。冒号没有什么特别之处,所以我们可以将其更改为其他内容,可能是独一无二的。我选择了@@@@

\documentclass[12pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} % also latin5
\usepackage[turkish,shorthands=:!]{babel}
\usepackage{mathpazo}
\usepackage{lipsum}
\usepackage[printonlyused,withpage]{acronym}

\usepackage{xpatch}

\makeatletter
\xpatchcmd{\AC@@acro}{:}{@@@@}{}{}
\xpatchcmd{\AC@@acro}{:}{@@@@}{}{}
\xpatchcmd{\AC@placelabel}{:}{@@@@}{}{}
\makeatother

\begin{document}

\chapter{A}

In the early nineties, \ac{GSM} was deployed in many European countries. 
\acf{GSM} offered for the first time international roaming for mobile 
subscribers. The \acs{GSM}’s use of \ac{TDMA} as its communication standard was 
debated at length. And every now and then there are big discussion whether 
\ac{CDMA} should have  been chosen over \ac{TDMA}.


\begin{acronym}[TDMA]
 \acro{CDMA}{Code Division Multiple Access}
 \acro{GSM}{Global System for Mobile communication}
 \acro{NA}[\ensuremath{N_{\mathrm A}}]
 {Number of Avogadro\acroextra{ (see \S\ref{Chem})}}
 \acro{NAD+}[NAD\textsuperscript{+}]{Nicotinamide Adenine Dinucleotide}
 \acro{NUA}{Not Used Acronym}
 \acro{TDMA}{Time Division Multiple Access}
 \acro{UA}{Used Acronym}
 \acro{lox}[\ensuremath{LOX}]{Liquid Oxygen}%
 \acro{lh2}[\ensuremath{LH_2}]{Liquid Hydrogen}%
 \acro{IC}{Integrated Circuit}%
 \acro{BUT}{Block Under Test}%
 \acrodefplural{BUT}{Blocks Under Test}%
 \end{acronym}
\end{document}

相关内容