I am trying to do a book which has its main language as Russian. The problem is that on the second compiler run on TeXShop (LaTeX document) when it needs to create the bookmarks in Russian, it struggles with the characters for some reason. This same code works when I use it with a text in English, so I need to figure out how to handle the Russian.

This is a shortened example of my code:

\usepackage[left=1cm, right=1cm, top=1.5cm, bottom=1cm]{geometry}

    % Titlepage
    \author{} \date{}
    \pdfbookmark[0]{Title Page}{title}

\pdfbookmark[1]{1}{Бытие1}\noindent\Large{Глава 1}\\\\
\normalsize 1 \Large \indent В начале сотворил Бог небо и землю.\\
\normalsize 2 \Large \indent Земля же была безвидна и пуста, и тьма над бездною, и Дух Божий носился над водою.\\

\pdfbookmark[1]{2}{Бытие2}\noindent\Large{Глава 2}\\\\
\normalsize 1 \Large \indent Так совершены небо и земля и все воинство их.\\
\normalsize 2 \Large \indent И совершил Бог к седьмому дню дела Свои, которые Он делал, и почил в день седьмый от всех дел Своих, которые делал.
\newpage\pdfbookmark[0]{1-e Иоанна}{1-e Иоанна}\noindent\\
\vspace{0.15cm}\textbf{\Huge{1-e Иоанна}}\vspace{0.00cm}\\
\pdfbookmark[1]{1}{1-e Иоанна1}\noindent\Large{Глава 1}\\\\
\normalsize 1 \Large \indent О том, что было от начала, что мы слышали, что видели своими очами, что рассматривали и что осязали руки наши, о Слове жизни, –\\
\normalsize 2 \Large \indent ибо жизнь явилась, и мы видели и свидетельствуем, и возвещаем вам сию вечную жизнь, которая была у Отца и явилась нам, –\\

\pdfbookmark[1]{2}{1-e Иоанна2}\noindent\Large{Глава 2}\\\\
\normalsize 1 \Large \indent Дети мои! сие пишу вам, чтобы вы не согрешали; а если бы кто согрешил, то мы имеем ходатая пред Отцем, Иисуса Христа, праведника;\\
\normalsize 2 \Large \indent Он есть умилостивление за грехи наши, и не только за наши, но и за грехи всего мира.\

This is a small part of the log output showing the error:

Package: gettitlestring 2010/12/03 v1.4 Cleanup title references (HO)
) \c@section@level=\count108 ) LaTeX Info: Redefining \ref on input
line 18. LaTeX Info: Redefining \pageref on input line 18. LaTeX Info:
Redefining \nameref on input line 18.

(./ATest.out ./ATest.out:3: Undefined control sequence.  \T 
              2B\CYRB \T 2B\cyrery \T 2B\cyrt \T 2B\cyri \T 2B\cyre .0
l.3 ...2B\cyrery \T2B\cyrt \T2B\cyri \T2B\cyre .0}
                                                  % 3 ? 
./ATest.out:3: Missing \endcsname inserted.  
                   \T2B\CYRB  l.3 ...2B\cyrery \T2B\cyrt \T2B\cyri
\T2B\cyre .0}
                                                  % 3 ? 
./ATest.out:3: Undefined control sequence.  \T 
              2B\CYRB \T 2B\cyrery \T 2B\cyrt \T 2B\cyri \T 2B\cyre .0
l.3 ...2B\cyrery \T2B\cyrt \T2B\cyri \T2B\cyre .0}
                                                  % 3 ?
  • Welcome to TeX.sx! You don't have to sign with your name since it automatically appears in the lower right corner of your post. Commented Aug 6, 2011 at 11:11

2 Answers 2


Your original problem is solved by avoiding Cyrillic in PDF bookmark names. The reason for this is that with inputenc UTF-8 characters are something more than just characters. Instead of




However, it is easier to use the higher level \addcontentsline command, which not only adds an entry to the PDF TOC, but also to the LaTeX's primary table of contents, should it be printed:


If you are going to do much work in Russian, you can also consider using the XeTeX engine instead of the default pdfTeX. XeTeX supports Unicode natively and allows to load any TrueType or OpenType font. Since XeTeX doesn't rely on tricks to work with UTF-8 and rather processes Unicode-encoded text directly, it is also possible to use Cyrillic (or any other) characters in PDF bookmark names and control sequence names (compile with xelatex instead of pdflatex or latex; polyglossia is the XeLaTeX replacement for babel):



\newfontfamily\russianfont[Ligatures=TeX]{CMU Serif}


\pdfbookmark{Ещё проверка}{Название закладки}


See also this, this and this question.

Finally, I should also note that using low-level formatting commands over and over is not a good style and will soon bite you. You should, perhaps after reading some LaTeX tutorials (try also this exceptionally good, if not a bit old, book in Russian), define commands with semantic names and use them. You may also want to look at the titlesec package.

  • Thanks Andrey, I've implemented your suggestions and it works great. I appreciate the help.
    – McGafter
    Commented Aug 10, 2011 at 11:45

For same purpose I load the hyperref package with the option unicode independantly of input encodings.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .