Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have this code which I compile with xelatex.

\documentclass[a4paper]{article}
\usepackage{polyglossia}
\newfontfamily{\armenianfont}{DejaVu Serif}
\setmainlanguage{armenian}

\begin{document}
հայերեն english
$հայերեն english հայերեն$
\end{document}

The Armenian words inside $$ do not appear in the resulting PDF file.

How do I correct this?

share|improve this question
    
Welcome to TeX.SX! You mean that you would like to use Armenian letters as math variables? –  egreg Dec 29 '13 at 11:12
    
@egreg Thanks! Yes, exactly. –  user2529583 Dec 29 '13 at 11:12
    
+1 for the idea. However, it might be confusing for non-Armenian readers... –  Dror Dec 29 '13 at 11:39
    
@Dror: the armenian text is going to be confusing for this non-armenian. i suspect there's a sub-text "this document is for readers who can read armenian"... –  wasteofspace Dec 29 '13 at 13:59
add comment

1 Answer 1

up vote 11 down vote accepted

You have to define a symbol font and assign a math code to the Armenian letters.

Here's how one could do it; it's important that the code is just after the \newfontfamily command. You can use another font, provided it has the required glyphs. Probably the best approach is to use a different name altogether, maybe pointing to the same font:

\documentclass[a4paper]{article}
\usepackage{polyglossia}
\newfontfamily{\armenianfont}{DejaVu Serif}

\newfontfamily{\armenianmathfont}{DejaVu Serif}
\ExplSyntaxOn
\DeclareSymbolFont{armenianletters}{\g_fontspec_encoding_tl}{\l_fontspec_family_tl}{m}{it}
\int_step_inline:nnnn { "531 } { 1 } { "556 }
 {
  \Umathcode #1 = "0 \symarmenianletters #1 % low level call
 }
\int_step_inline:nnnn { "561 } { 1 } { "587 }
 {
  \Umathcode #1 = "0 \symarmenianletters #1
 }
\ExplSyntaxOff

\setmainlanguage{armenian}

\begin{document}


Text: հայերեն english

Math: $հայերեն english հայերեն^2$
\end{document}

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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