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'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)

share|improve this question

1 Answer 1

easiest fix is to ensure the cyrillic strings in the class file use T2A encoding rather than OT1

\def\mybibname{\fontencoding{T2A}\selectfont
\CYRL\cyri\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyra}
\def\myshortname{%%%
\fontencoding{T2A}\selectfont
  \CYRM\cyro\cyrd\cyre\cyrl.
  \cyri{}
  \cyra\cyrn\cyra\cyrl\cyri\cyrz{}
  \cyri\cyrn\cyrf\cyro\cyrr\cyrm.
  \cyrs\cyri\cyrs\cyrt\cyre\cyrm.{}
}
\def\mylongname{%%%
\fontencoding{T2A}\selectfont
  \CYRM\cyro\cyrd\cyre\cyrl\cyri\cyrr\cyro\cyrv\cyra\cyrn\cyri\cyre{}
  \cyri{}
  \cyra\cyrn\cyra\cyrl\cyri\cyrz{}
  \cyri\cyrn\cyrf\cyro\cyrr\cyrm\cyra\cyrc\cyri\cyro\cyrn\cyrn\cyrery\cyrh{}
  \cyrs\cyri\cyrs\cyrt\cyre\cyrm{}
}
\def\myrecname{\fontencoding{T2A}\selectfont
\cyrp\cyro\cyrl\cyru\cyrch\cyre\cyrn\cyra}
\def\myvolname{\fontencoding{T2A}\selectfont
\CYRT.}
\def\myUDCname{\fontencoding{T2A}\selectfont
\CYRU\CYRD\CYRK}
share|improve this answer
    
This certainly fixes the problem. I'd still like to know why. Why is this required in one situation, but not in a very similar one. Do you think I can be said to be caused by a bug in latex or is this somehow "by design"? –  Ark-kun Dec 9 '12 at 1:11

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.