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 have a LaTeX document with hyperref and appendix packages that fails to build. But if I switch off either appendix or hyperref everything works fine.

\documentclass[14pt]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english,russian]{babel}
\usepackage[toc,page,title,titletoc]{appendix}
\usepackage{hyperref}
\begin{document}

\hypersetup{pdftex, colorlinks=true, linkcolor=blue, citecolor=blue, filecolor=blue, urlcolor=blue, pdftitle=, pdfauthor=, pdfsubject=, pdfkeywords=}

\renewcommand{\appendixtocname}{Приложения}
\renewcommand{\appendixpagename}{Приложения}
\renewcommand{\appendixname}{Приложениe}

\tableofcontents
\pagebreak
\section{тест}

\begin{appendices}


\renewcommand{\thesection}{\arabic{section}.}

\section{Тест}
\pagebreak
\section{Схема устройства}


\end{appendices}

\end{document}

Generated error:

./test.out
! Undefined control sequence.
<argument> \T 
          2A\CYRP \T 2A\cyrr \T 2A\cyri \T 2A\cyrl \T 2A\cyro \T 2A\cyrz...

Is there any possibility to use them together?

share|improve this question

migrated from stackoverflow.com Jan 19 '12 at 20:22

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 4 down vote accepted

Quite hard problem. The guilty party is appendix that does some definitions that become incompatible with the way Russian is managed by Babel.

\documentclass[12pt]{article}

\usepackage[T2A,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,russian]{babel}
\usepackage[toc,page,title,titletoc]{appendix}
\usepackage{hyperref,bookmark}
\hypersetup{
  colorlinks=true,
  linkcolor=blue,
  citecolor=blue,
  filecolor=blue,
  urlcolor=blue,
  % pdftitle=,
  % pdfauthor=,
  % pdfsubject=,
  % pdfkeywords=
}

\renewcommand{\appendixtocname}{Приложения}
\renewcommand{\appendixpagename}{Приложения}
\renewcommand{\appendixname}{Приложние}
\makeatletter
\let\oriAlph\Alph
\let\orialph\alph
\renewcommand{\@resets@pp}{\par
  \@ppsavesec
  \stepcounter{@pps}
  \setcounter{section}{0}%
  \if@chapter@pp
    \setcounter{chapter}{0}%
    \renewcommand\@chapapp{\appendixname}%
    \renewcommand\thechapter{\@Alph\c@chapter}%
  \else
    \setcounter{subsection}{0}%
    \renewcommand\thesection{\@Alph\c@section}%
  \fi
  \if@pphyper
    \if@chapter@pp
      \renewcommand{\theHchapter}{\theH@pps.\oriAlph{chapter}}%
    \else
      \renewcommand{\theHsection}{\theH@pps.\oriAlph{section}}%
    \fi
    \def\Hy@chapapp{appendix}%
  \fi
  \restoreapp
}
\makeatother

\begin{document}


\tableofcontents
\pagebreak
\section{тест}

\begin{appendices}


\renewcommand{\thesection}{\arabic{section}.}

\section{Тест}
\pagebreak
\section{Схема устройства}


\end{appendices}

\end{document}

Note that it's better to load fontenc before inputenc.

share|improve this answer
    
Why is it better to load fontenc before inputenc? (Apologies if if this has already been answered elsewhere.) –  lockstep Jan 19 '12 at 21:54
3  
The utf8 option for inputenc analyzes the loaded output encodings and takes appropriate actions. –  egreg Jan 19 '12 at 22:03

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.