I'm creating a paper using the class file supplied by the journal (mais.cls). The journal is Russian, so it has Russian title, Russian page titles etc.
I have a .tex file containing only Latin characters that compiles without errors. When I add a single (English) word to the end of the text (increasing the number of lines, but not the number of pages) I suddenly receive many errors like this during the compilation.
! LaTeX Error: Command \CYRE unavailable in encoding OT1.
The problem seems to be related to the page header on the even pages (excluding the title page). The page header is in Russian and is defined in the class style file. Somehow latex stops loving it depending on the number of lines on the page.
I'm using the latest version of MikTeX 2.9 (and the problem was also manifesting itself in older version). The encodings are set like this:
\usepackage[cp1251]{inputenc}
\usepackage[english,russian]{babel}
\usepackage[T2A]{fontenc}
Why does this happen? Is the problem in the style of in latex? How to prevent the errors?
I've uploaded the MWE (working/not working examples and the class style) with all logs and the resulting .pdf files to https://skydrive.live.com/redir?resid=E4ECA4072D08CEE5!2645 (archive: https://skydrive.live.com/redir?resid=E4ECA4072D08CEE5!2646)