2

I am using polyglossia and eledmac to typeset a Tibetan document. I'm running into problems when using eledmac's xxref. It seems the numbers it expects are not in the right format, since they are changed by polyglossia into Tibetan numerals.

For example, the following document does not compile properly after the second run of xelatex on it (the first two runs actually work well):

\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}

The error message I get is this (the example above is in a file called test.tex):

Section 1 (./test.1)
! Missing number, treated as zero.
<to be read again> 
                   ༡
l.25 \pend

And the file test.1 contains:

\@l[1][༡]
\@lab
\@l[1][༡]
\@lab
\@ref[3][
]

I suppose that the problem is that xxref somehow sees a tibetan numeral, which I suppose is due to polyglossia changing the numbering system.

So my question is:

  1. Can I do something to make polyglossia not change the numbering system, or otherwise
  2. how could I set up eledmac to accept these linenumbers as arguments?

If I switch the default and other language, the document compiles nicely.

I.e.:

\setdefaultlanguage{english}
\setotherlanguage{tibetan}

In this case the line numbers are Arabic numerals.

And, fyi, the packages loaded here:

 *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
 ***********
  • I get no error; note that you seem to have a partially broken distribution, because graphics.cfg loads dvips.def and not xetex.def. Also your makecmds.sty is outdated: on my system I have makecmds.sty 2009/09/03 v1.0a. – egreg Apr 17 '14 at 14:03
  • I also confirm that wit a up texlive distribution I get no error. – Maïeul Apr 17 '14 at 14:52
  • Thank you for looking at this, I updated the question a bit: I have troubles on the third and subsequent runs. Even with the frozen texlive 2013 distribution (except for eledmac from github), it's not working. Were you using the 2014 distribution when it worked for you? – patrick Apr 18 '14 at 10:18
  • @patrick Actually I now get the error. – egreg Apr 18 '14 at 10:34
2

The problem is that the Tibetan module for Polyglossia redefines \@arabic with a non expandable construction, while eledmac relies on it to be expandable.

A possible solution is to call

\setmainlanguage[numerals=arabic]{tibetan}

and use a font that has Arabic numerals.

\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}

enter image description here

If you need Tibetan numerals for the page number or the section numbers, some more tricks should be used.

  • Thank you, that works (and is the answer to part 1 of the question). The main thing seems to be the numerals=arabic, which I didn't know was possible for Tibetan. Then it actually works also with the other font, Tibetan Machine Uni. It would be nice, though not necessary, to also have the option of Tibetan numerals. – patrick Apr 18 '14 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.