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 wanted to change the name in my beamer slide from Part to Theme.

So in the Google BOK if found:

\renewcommand*{\partname}{Theme}

I could not get to work. Then I start to switch off (%) everything that I added and found that:

\usepackage[english]{babel}

is the holder of the key.

An MWE:

\documentclass[compress,infolines,smaller]{beamer}

%\usepackage[english]{babel}
\useinnertheme[shadow=true]{rounded}
\usecolortheme{beaver}

\renewcommand*{\partname}{Theme}


\begin{document}

\AtBeginLecture{
\begin{frame}
\titlepage
\end{frame}
}

\part{Title}
\begin{frame}<beamer>
\partpage
\end{frame}
\section{test1}
\begin{frame}
Test
\end{frame}

\end{document}

Is there a way to get passed this?

share|improve this question
1  
1  
You can leave it in the preamble using \AtBeginDocument{\renewcommand*{\partname}{Theme}}. –  Gonzalo Medina Aug 2 '12 at 14:54
2  
@Louis: as long as you use only one language putting the definition after \begin{document} will work. But in general it is better to get used to the babel syntax \addto\captionsenglish{...} –  Ulrike Fischer Aug 2 '12 at 14:59
1  
@Ulrike Please write a short answer, possibly including Gonzalo's \AtBeginDocument hint. –  lockstep Aug 9 '12 at 10:50
1  
@lockstep: But Louis didn't accepted my answer. I would always use \addto\caption... and not move the \renewcommand behind \begin{document} or in a \AtBeginDokument. –  Ulrike Fischer Aug 10 '12 at 7:30

1 Answer 1

up vote 4 down vote accepted

This has obviously to do with how babel manages the "fixed tags" such as \partname.

It stores them in a macro called \captions<language> (in this case \captionsenglish) that is executed as part of

\selectlanguage{<language>}

or

\begin{otherlanguage}{<language>}

The \selectlanguage command for the main language of the document is issued together \begin{document}. Thus your \renewcommand does nothing, because it's overridden by what's done by \selectlanguage{english}.

babel has a provision for this:

\addto\captionsenglish{\renewcommand{\partname}{Theme}}

is what you're looking for.


Also \AtBeginDocument{\renewcommand{\partname}{Theme}} would work unless you load babel with more than one language and issue some \selectlanguage command in the document. To make an example:

\documentclass{article}
\usepackage[italian,english]{babel}
\AtBeginDocument{\renewcommand{\partname}{Theme}

\begin{document}
\part{X}
Something in English.

\selectlanguage{italian}
Parole in italiano.

\selectlanguage{english}
\part{Y}
End in English.

\end{document}

would result in

Theme I

Something in English.

Parole in italiano

Part II

End in English.

This wouldn't happen with the \addto\captionsenglish approach.

share|improve this answer
    
Sorry for waiting so long. –  Louis Oct 10 '12 at 0:36

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.