Cyrillic characters in LaTeX

This one caused some headaches here, so recording the solution in case it’s useful to anyone else.

I wanted to include a Cyrillic string (copied and pasted from an email) in a LaTeX document whose default fonts didn’t support Cyrillic, but when I saved and compiled the file it was replaced by a string of question marks instead. After much poking around and experimentation, and with some assistance from Dave who is even more proficient in LaTeX than I, this solved it:

  1. First off, make sure you’re saving your document in UTF-8. (In WinEdt, this is set under Document > Document Settings… > Format.)
  2. In the document preamble, define the font family for cyrillicfont to one that matches your main package’s font (or that is close enough, but supports Cyrillic):

    \usepackage[utf8]{inputenc}
    \usepackage[T2A,T1]{fontenc}
    \usepackage{polyglossia}
    \setdefaultlanguage{english}
    \setotherlanguages{russian}
    \newfontfamily{\cyrillicfont}{Times New Roman}

  3. In the document body, add your Cyrillic content in the second pair of curly brackets of:

    \foreignlanguage{russian}{}

Author: smurphy

Writer, mother, gardener, geek...