I need to use cyrillic. I hacked from somewhere the def of \textcyrw
you see below. Everything works fine, but when I need to use \textcyrw
within a section title. It seems that the culprit is hyperref
. Your advise is welcome.
\documentclass[a4paper,10pt]{article}
\usepackage[OT2,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[american,russian,italian]{babel}
\usepackage{hyperref} % no problem without hyperref
\newcommand\cyrillic{%
\renewcommand\rmdefault{wncyr}%
\renewcommand\sfdefault{wncyss}%
\renewcommand\encodingdefault{OT2}%
\normalfont
\selectfont}
\DeclareTextFontCommand{\textcyr}{\cyrillic}
\begin{document}
\section{AAA}
\textcyr{Личное дело} % works fine
\section{\textcyr{Личное дело}} % gives error
\end{document}
The error message I got is:
! Argument of \@sect has an extra }.
<inserted text>
\par
l.- \section{\textcyr{Личное дело}}
----- fixed
the following fixed it, although I am not sure why:
\pdfstringdefDisableCommands{%
\let\textcyr\relax}