我正在使用 polyglossia 和 eledmac 排版藏文文档。使用 eledmac 的 xxref 时遇到了问题。它期望的数字似乎格式不正确,因为 polyglossia 将它们转换为藏文数字。
例如,以下文档在第二次运行 xelatex 之后无法正确编译(前两次运行实际上运行良好):
\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{tibetan}
\setotherlanguage{english}
\usepackage{fontspec}
\newfontfamily\tibetanfont[Script=Tibetan,Scale=1.3]{Tibetan Machine Uni}
\usepackage{eledmac}
\firstlinenum{1}
\linenumincrement{1}
\listfiles
\begin{document}
\begin{tibetan}
\beginnumbering
\pstart
ཀ་ \edlabel{start}ཁ་ ག་ ང།
\pend
\pstart
ཅ་ \edlabel{end}\edtext{ཆ་}{\lemma{ཁ་...ཆ་}\xxref{start}{end}\Afootnote{འོ་ན།}} ཇ་ ཉ།
\pend
\endnumbering
\end{tibetan}
\end{document}
我收到的错误消息是这样的(上面的例子在一个名为 test.tex 的文件中):
Section 1 (./test.1)
! Missing number, treated as zero.
<to be read again>
༡
l.25 \pend
文件 test.1 包含:
\@l[1][༡]
\@lab
\@l[1][༡]
\@lab
\@ref[3][
]
我认为问题在于 xxref 以某种方式看到了藏文数字,我认为这是由于多语种改变了数字系统。
我的问题是:
- 我可以做些什么让 polyglossia 不改变数字系统,或者其他
- 我该如何设置 eledmac 来接受这些行号作为参数?
如果我切换默认语言和其他语言,文档就可以很好地编译。
IE:
\setdefaultlanguage{english}
\setotherlanguage{tibetan}
在这种情况下,行号是阿拉伯数字。
仅供参考,这里加载的软件包:
*File List*
article.cls 2007/10/19 v1.4h Standard LaTeX document class
size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
polyglossia.sty 2013/06/27 v1.33.4 Babel replacement for XeLaTeX and LuaTeX
etoolbox.sty 2011/01/03 v2.1 e-TeX tools for LaTeX
etex.sty 1998/03/26 v2.0 eTeX basic definition package (PEB)
makecmds.sty 2009/09/03 v1.0a extra command making commands
xkeyval.sty 2012/10/14 v2.6b package option processing (HA)
xkeyval.tex 2012/10/14 v2.6b key=value parser (HA)
fontspec.sty 2013/05/20 v2.3c Font selection for XeLaTeX and LuaLaTeX
expl3.sty 2014/01/07 v4646 L3 Experimental code bundle wrapper
l3names.sty 2014/01/04 v4640 L3 Namespace for primitives
l3bootstrap.sty 2014/01/04 v4640 L3 Experimental bootstrap code
l3basics.sty 2014/01/04 v4642 L3 Basic definitions
l3expan.sty 2014/01/04 v4642 L3 Argument expansion
l3tl.sty 2013/12/27 v4625 L3 Token lists
l3seq.sty 2013/12/14 v4623 L3 Sequences and stacks
l3int.sty 2013/08/02 v4583 L3 Integers
l3quark.sty 2013/12/14 v4623 L3 Quarks
l3prg.sty 2014/01/04 v4642 L3 Control structures
l3clist.sty 2013/07/28 v4581 L3 Comma separated lists
l3token.sty 2013/08/25 v4587 L3 Experimental token manipulation
l3prop.sty 2013/12/14 v4623 L3 Property lists
l3msg.sty 2013/07/28 v4581 L3 Messages
l3file.sty 2013/10/13 v4596 L3 File and I/O operations
l3skip.sty 2013/07/28 v4581 L3 Dimensions and skips
l3keys.sty 2013/12/08 v4614 L3 Experimental key-value interfaces
l3fp.sty 2014/01/04 v4642 L3 Floating points
l3box.sty 2013/07/28 v4581 L3 Experimental boxes
l3coffins.sty 2013/12/14 v4624 L3 Coffin code layer
l3color.sty 2012/08/29 v4156 L3 Experimental color support
l3luatex.sty 2013/07/28 v4581 L3 Experimental LuaTeX-specific functions
l3candidates.sty 2014/01/06 v4643 L3 Experimental additions to l3kernel
ifpdf.sty 2011/01/30 v2.3 Provides the ifpdf switch (HO)
xparse.sty 2013/12/31 v4634 L3 Experimental document command parser
fontspec-patches.sty 2013/05/20 v2.3c Font selection for XeLaTeX and LuaLaTe
X
fixltx2e.sty 2006/09/13 v1.1m fixes to LaTeX
fontspec-xetex.sty 2013/05/20 v2.3c Font selection for XeLaTeX and LuaLaTeX
fontenc.sty
eu1enc.def 2010/05/27 v0.1h Experimental Unicode font encodings
eu1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
xunicode.sty 2011/09/09 v0.981 provides access to latin accents and many oth
er characters in Unicode lower plane
eu1lmss.fd 2009/10/30 v1.6 Font defs for Latin Modern
graphicx.sty 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
trig.sty 1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live
xetex.def 2014/04/07 v0.99 LaTeX color/graphics driver for XeTeX (RRM/JK)
fontspec.cfg
ifluatex.sty 2010/03/01 v1.3 Provides the ifluatex switch (HO)
gloss-tibetan.ldf polyglossia: module for tibetan
gloss-english.ldf polyglossia: module for english
eledmac.sty 2014/04/14 v1.10.5 LaTeX port of EDMAC
xargs.sty 2008/03/22 v1.1 extended macro definitions (mpg)
suffix.sty 2006/07/15 1.5 Variant command support
xstring.sty 2013/10/13 v1.7c String manipulations (C Tellechea)
t3cmr.fd 2001/12/31 TIPA font definitions
test.1
***********
答案1
问题在于,藏文多语模块用\@arabic
不可扩展的结构进行了重新定义,但eledmac
依赖于它来实现可扩展性。
一个可能的解决方案是调用
\setmainlanguage[numerals=arabic]{tibetan}
并使用带有阿拉伯数字的字体。
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage[numerals=arabic]{tibetan}
\setotherlanguage{english}
\usepackage{fontspec}
\newfontfamily\tibetanfont[Script=Tibetan,Scale=1.3]{Kaiti SC}
\usepackage{eledmac}
\firstlinenum{1}
\linenumincrement{1}
\listfiles
\begin{document}
\beginnumbering
\pstart
ཀ་ \edlabel{start}ཁ་ ག་ ང།
\pend
\pstart
ཅ་ \edlabel{end}\edtext{ཆ་}{\lemma{ཁ་...ཆ་}\xxref{start}{end}\Afootnote{འོ་ན།}} ཇ་ ཉ།
\pend
\endnumbering
\end{document}
如果需要使用藏文数字来标示页码或章节编号,则需要使用一些技巧。