acro 包和 Greek babel 有问题吗?

acro 包和 Greek babel 有问题吗?

好吧,我需要在我的论文中创建一个首字母缩略词列表,我之前用过这个acronym包。由于我更新了几个包,而我的旧序言有太多错误,我决定创建另一个main.tex文件并在那里重新构建序言。很难做到并订购包以避免错误。一切都很顺利,直到昨天我为几个我用这个包编写的像旁注一样的音符添加了希腊多音调snotez,然后问题就开始了。

起初错误与 babel 和 greek 有关,bunt 现在运行正常。我现在的问题是缩写,而昨天还运行正常。

我的 MWE:

\documentclass[paper=letter,headings=big,bibliography=totoc,DIV=9]{scrbook}
\KOMAoptions{headsepline=true,fontsize=10pt,draft=false}
\usepackage{typearea}
\usepackage[greek.polutoniko,spanish.mexico]{babel}
\usepackage[utf8]{inputenc}
\usepackage[LGR,T1]{fontenc}
\usepackage{snotez}
%%%%%%%%%%%%%%%%%%%%%%%% Acronyms
\usepackage[single=false,macros=false,xspace=false]{acro}
\DeclareAcronym{lbd}{
 short = LBD , 
 long = Lipoproteinas de baja densidad ,
 foreign = Low-Density Lipoprotein
}
\DeclareAcronym{vop}{
 short = VOP , 
 long = Velocidad de onda de pulso ,
 foreign = Pulse Wave Velocity
}
\DeclareAcronym{ifs}{
 short = IFS , 
 long = Interacción fluido-sólido ,
 foreign = Fluid-Solid/Structure Interaction
}

\DeclareAcronym{hgo}{
 short = HGO , 
 long = modelo de Holzapfel-Gasser-Ogden
}

\DeclareAcronym{aha}{
 short = AHA , 
 long = Asociación Americana del Corazón ,
 foreign = American Heart Asociation
}
\DeclareAcronym{wss}{
 short = WSS , 
 long = Esfuerzo cortante de pared ,
 foreign = Wall Shear Stress
}    

\DeclareAcronym{adina}{
 short = ADINA ,
 long  =  Automatic Dynamic Incremental Nonlinear Analysis ,
 class = software
}    

\begin{document}

\minisec{Arteriosclerosis}

Es un término genérico\sidenote{Del griego {\selectlanguage{greek} \textgreek{'arthr'ia}} \emph{arteria} y {\selectlanguage{greek} \textgreek{skl'hrwsic}} \emph{cicatriz, rigidez}.} que fue creado por Jean Georges Chrétien Frédéric Martin Lobstein.

Este capítulo tiene como objetivo proporcionar una descripción de las ecuaciones matemáticas que rigen y el algoritmo desarrollado para la modelación computacional \ac{ifs} del flujo sanguíneo y las geometrías del modelo utilizadas en el estudio.

La \ac{dfc} descompone la geometría en pequeñas celdas y por tanto tiene como objetivo resolver las ecuaciones que rigen para cada celda.

En la actualidad, varios paquetes de software como \ac{adina} proporcionan esta capacidad. Todos estos programas emplean el método de elementos finitos para resolver las ecuaciones de flujo. Este es el método preferido para resolver simulaciones \ac{ifs} de problemas estructurales, ya que es uno de los mejores métodos disponibles. 

\printacronyms[exclude-classes=software]
\printacronyms[include-classes=software, name={Software}]    
\end{document}

当我尝试编译时,出现了一些错误,其中一个错误是:

! Improper alphabetic constant.
<to be read again>
\global
l.186 \cnltx@tmpa
A one-character control sequence belongs after a ` mark.
So I'm essentially inserting \0 here.
! Missing number, treated as zero.
<to be read again>

其他:

! Undefined control sequence.
<argument> 2\0
9/\9/17 v1.1 Trim spaces around a token list
l.6 Trim spaces around a token list]
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

对于第一种情况,我理解错误是因为cnltx之前没有加载该包或其他原因。我没有用过它,我想相信我拥有的几个包中的一个应该加载它。

如果你想查看原始日志文件这里,真正的序言是

答案1

这可能无关紧要,但我babel最初加载包时遇到了问题。我通过之前acro加载解决了这些问题(也许是偶然的)。acrobabel

\documentclass[a4paper,12pt]{scrreprt}  % KOMA report class

\usepackage{acro}  % Define and list acronyms (load before {babel})
\usepackage[greek, UKenglish]{babel}  % Provides language support (load after {acro})

虽然这不是一个非常技术性的答案,但值得一试!

答案2

这是 中的一个错误cnltx-base.sty。问题出在cnltx-base.sty

179 \edef\cnltx@tmpa{\catcode`\%=\the\catcode`\% \catcode`\&=\the\catcode`\&}

代码防御能力不够强的地方;应该

179 \edef\cnltx@tmpa{\catcode`\noexpand\%=\the\catcode`\% \catcode`\noexpand\&=\the\catcode`\& }

\%因此和的含义的可能改变\&不会带来问题。

\&发生的事情是

> \&=macro:
->\LGR-cmd \&\LGR\& .

当 Greek 被加载时,由 触发的这个宏的扩展\edef对于定义来说是完全无用的。第二个没有问题,\&因为它被检查为 扩展的一部分\the,所以 TeX 不会扩展它。

第一个\%不需要\noexpand在它前面,但谨慎一点总是好的。


可能更好的修复不需要恢复类别代码。代码如下cnltx-base.sty(为清晰起见添加了行号)

175 % an idea by Herbert Voß (http://tex.stackexchange.com/a/7183/5049):
176 %   make the test character an (hopefully extremely) unlikely % with
177 %   catcode!=14;  let's make & a temporary comment char
178 %   save both catcodes just in case someone changed the defaults:
179 \edef\cnltx@tmpa{\catcode`\%=\the\catcode`\% \catcode`\&=\the\catcode`\&}
180 \catcode`\%=3
181 \catcode`\&=14
182 & the test:
183 \newcommand*\cnltx@ifisnum[1]{&
184   \iftest{\if%\ifnum9<1#1%\else_\fi}&
185 }
186 \cnltx@tmpa

可以变成

% an idea by Herbert Voß (http://tex.stackexchange.com/a/7183/5049):
%   make the test character an (hopefully extremely) unlikely % with
%   catcode!=14 
% the test:
\begingroup
  \catcode`\$=\thr@@ % ensure it's what we want
  \lccode`\$=`\%
  \lccode`\1=\z@ % just to be really sure
  \lccode`\9=\z@ % just to be really sure
  \lccode`\_=\z@ % just to be really sure
  \lccode`\#=\z@ % just to be really sure
  \lccode`\<=\z@ % just to be really sure
  \lowercase{\endgroup
  \newcommand*\cnltx@ifisnum[1]{%
    \iftest{\if$\ifnum9<1#1$\else_\fi}%
  }%
}

相关内容