2

I need to change the table of contents name (into Russian). I have already read answers to similar questions How to change the title of ToC? and Strange behaviour on redefining \contentsname, but the following code doesn't work (table of contents titled as 'Contents').

\documentclass[a4paper,12pt]{report}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsthm,amssymb,amsmath}
\usepackage[russian,english]{babel}

\usepackage[title,titletoc]{appendix}

\addto\captionsrussian{\renewcommand{\contentsname}{Содержание}}

How to fix this problem?

2
  • Try tex.stackexchange.com/a/183435/120578 ... It is a duplicate... (Some times the non-accepted answers providing the solution that works in our case)
    – koleygr
    Nov 9, 2019 at 18:30
  • 1
    Oh ... I think that you are using the wrong order in the babel loading of languages (english is your default this way)... Or you should define \captionsenglish instead...
    – koleygr
    Nov 9, 2019 at 18:45

1 Answer 1

1

This works:

\documentclass[a4paper,12pt]{report}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsthm,amssymb,amsmath}
\usepackage[english,russian]{babel}

\usepackage[title,titletoc]{appendix}

\addto\captionsrussian{\renewcommand{\contentsname}{Содержание}}
\begin{document}
\tableofcontents
\section{Test}
\end{document}

This also works:

\documentclass[a4paper,12pt]{report}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsthm,amssymb,amsmath}
\usepackage[russian,english]{babel}

\usepackage[title,titletoc]{appendix}

\addto\captionsenglish{\renewcommand{\contentsname}{Содержание}}
\begin{document}
\tableofcontents
\section{Test}
\end{document}

Your problem was that you was starting with english as the default language and you had changed the \contentsname for russian language.

The default language by babel package is the one loaded last in its options.

2
  • Thanks, indeed both methods work. I tried combination \usepackage[english, russian]{babel} but compilation failed and I had the error 'Command \CYRF is unavailable in encoding OT1'. I think it's because previously I tried to compile \usepackage[russian,english]{babel}.
    – richrow
    Nov 9, 2019 at 19:17
  • 1
    Happy that worked for you... Have a nice night.
    – koleygr
    Nov 9, 2019 at 19:20

You must log in to answer this question.

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