Fonts & Character Setsbabel package and \renewcommand

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
marijana123456
Posts: 5
Joined: Thu Aug 19, 2010 9:05 am

babel package and \renewcommand

Post by marijana123456 »

Hi, I have problem , when I include babel package, \renewcommand doesn't work any more. Have any idea what can be problem?
Here is the example code:

\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{url}
\usepackage{float}
\usepackage{comment}

\usepackage[T2A,OT1]{fontenc}
\usepackage[ot2enc]{inputenc}
\usepackage[russian,english]{babel}

\renewcommand{\figurename}{slika}

\begin{document}

\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=4cm]{.//slikecad//pk}
\end{center}
\caption{pk}
\end{figure}

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

babel package and \renewcommand

Post by meho_r »

Hi and welcome to the forum.

1. Please read Board rules (pay special attention to section 2).

2. Since your default language is english, \addto\captionsenglish would solve the problem. See the following example (your code, but slightly modified for setting the caption; also book document class and "demo" option for graphicx package are added):

Code: Select all

\documentclass{book}

\usepackage{amsfonts}
\usepackage[demo]{graphicx}% I used "demo" option since you haven't provided the picture you were using
\usepackage{url}
\usepackage{float}
\usepackage{comment}

\usepackage[T2A,OT1]{fontenc}
\usepackage[ot2enc]{inputenc}
\usepackage[russian,english]{babel}

\addto\captionsenglish{%
\renewcommand{\figurename}{slika}}

\begin{document}

\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=4cm]{.//slikecad//pk}
\end{center}
\caption{pk}
\end{figure}

\end{document}
marijana123456
Posts: 5
Joined: Thu Aug 19, 2010 9:05 am

Re: babel package and \renewcommand

Post by marijana123456 »

Thank you, it has solved the problem :)
Post Reply