1
\usepackage[english, russian]{babel}

\renewcommand{\thefigure}{5.1}
\begin{figure}[h!]
\centering
\includegraphics[width=8cm]{Fig 8.5.1}
\caption{}
\label{Fig 8.5.1}
\end{figure}

The label should be Fig: 5.1

This is the image output. The figure caption should be in English but all my images are now captioned/labelled in Russian. The format for my image is "Fig: 5.1" but the language has somehow changed for the image numbering too. How do I fix this? I have tried searching online but have been unable to find a way out.

6
  • 3
    You have set Russian as the main language. Is that what you want? Sep 16 at 5:55
  • Nope. My main language is English but I had a few lines of Russian that I needed to write so I used "\usepackage[english, russian]{babel}" I thought this would allow me to write in English and Russian. Everything else seems right but the figures are not being labeled properly. Sep 16 at 5:58
  • 5
    As explained in the manual, the main language is the last one. Just reverse them. Sep 16 at 6:04
  • Oh, no wonder I could not find a way out to something that simple. I reversed them but I couldn't write in Russian so I added "\selectlanguage{russian}" before each russian sentence to make it work. And it did! Thank you for your help. I am fairly new to this so I needed help with such a simple task. Sep 16 at 6:37
  • 1
    do you really want \renewcommand{\thefigure}{5.1} ? that disables all latex numbering??? Sep 16 at 8:32

1 Answer 1

2

If your main language is English, you should call babel as

\usepackage[russian,english]{babel}

because the last named language will be the main one. Or you can specify main=

\usepackage[main=english,russian]{babel}

and in this case the order is irrelevant.

If you want to insert some phrases in Russian, you shouldn't go the \selectlanguage{russian} way. There are \foreignlanguage and otherlanguage* for this. In the example below, quote is just by way of example.

\documentclass{article}
\usepackage[T2A,T1]{fontenc}
\usepackage[main=english,russian]{babel}

\begin{document}

The Russian phrase \foreignlanguage{russian}{Привет, мир} means
`Hello, world' in English.

If you have longer passages in Russian, such as a quotation,
you can do as follows
\begin{otherlanguage*}{russian}
\begin{quote}
Все счастливые семьи похожи друг на друга, каждая 
несчастливая семья несчастлива по-своему.
\end{quote}
\end{otherlanguage*}

\begin{figure}[htp]
\centering

\fbox{\rule{0pt}{30pt}\rule{30pt}{0pt}}

\caption{A figure}

\end{figure}

\end{document}

enter image description here

1
  • Thank you so much! This was very detailed. I did the exact thing and it worked. It was the first time that I wrote LaTeX in two languages. I am really grateful for your time and help. Problem fixed! Sep 18 at 8:06

You must log in to answer this question.

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