XeTeXXeLaTeX and Armenian

Information and discussion about XeTeX, an alternative for pdfTeX based on e-Tex
Post Reply
vahagn_iv
Posts: 1
Joined: Tue Nov 01, 2011 9:50 pm

XeLaTeX and Armenian

Post by vahagn_iv »

Hi all,

I'm trying to write a text in Armenian using xelatex. I'm not a specialist of xetex, so, please, forgive me stupid questions.
After some googleing found the following code:

Code: Select all

\documentclass {article}
\usepackage {xltxtra, polyglossia}
\usepackage {fontspec}
\setdefaultlanguage {english}
\newfontface \armfont [Script=Armenian]{DejaVu Sans}
\begin {document}
\title {\armfont{Ինչ-որ հայերեն տեքստ}}
\author {Հեղինակ}
\maketitle

\armfont {Եւ երկիր էր աներևոյթ և անպատրաստ. և խաւար ի վերայ անդնդոց. և Հոգի Աստուծոյ շրջէր ի վերայ ջուրց:

\begin{thebibliography}{99}
 \bibitem{as}
hdsjhdsjdjs
\end{thebibliography}
}

\end{document}
Everything worked well except that the captions remain in english(for the bibliography etc.).
When I changed the setdefaultlanguage to armenian, it turned out that the file gloss-armenian.ldf is not installed by default in /usr/share/texmf-texlive/tex/xelatex/polyglossia
After downloading it and reinstalling xetex I received the following error message:

/usr/share/texmf-texlive/tex/xelatex/polyglossia/gloss-armenian.ldf:4Undefined control sequence \PolyglossiaSetup in the following paragraph:

Code: Select all

\PolyglossiaSetup{armenian}{
  script=Armenian,
  scripttag=armn,
  langtag=HYE,
  hyphennames={armenian},
  hyphenmins={2,2},
  fontsetup=true
}
Replacing it with

Code: Select all

\def\armenian@font{\armfont}
solves the problem and allows to remove \armfont sequences from the document. It is even possible to add captions in gloss-armenian.ldf in armenian, however, only with \armfont putted before them. Like

Code: Select all

\def\captionsarmenian{
   \def\refname{\armfont{Հղումների ցանկ}}
...
}
Everything compiles well but throws wornings
./file.aux:3: armenian@language is not defined on input line 3
./file.aux:6: armenian@language is not defined on input line 6
./file.aux:3: armenian@language is not defined on input line 3
Hope that this information will help.

Thus, can someone explain me how to avoid this warning and can I post the modified file to replace the current one?

My OS is Ubuntu 11.10

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply