I am writing a thesis and I want to have two abstracts in different languages, English and Catalan. I started with a thesis template from my university (only in English) and then added the Babel package. I can successfully create two abstracts in different languages, but I'm not managing to change the name of the second Abstract to "Resum". Found online that Babel changes renewcommand so this is the solution for most people:
\addto{\captionscatalan}{\renewcommand{\abstractname}{Resum}}
This does not work for me, though, as the second one still appears as "Abstract". This is how I defined them:
\documentclass[a4paper, oneside]{discothesis}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english,catalan]{babel}
\begin{document}
%Abstract in English
\begin{abstract}
Abstract
\end{abstract}
%Abstract in Catalan
\begin{abstract}
\selectlanguage{catalan}
\addto{\captionscatalan}{\renewcommand{\abstractname}{Resum}}
Resum
\end{abstract}
\selectlanguage{english}
\end{document}
Also tried defining my own environment and got exactly the same result:
\documentclass[a4paper, oneside]{discothesis}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english,catalan]{babel}
\newenvironment{poliabstract}[1]
{\renewcommand{\abstractname}{#1}\begin{abstract}}
{\end{abstract}}
\begin{document}
\selectlanguage{english}
\begin{poliabstract}{Abstract}
Abstract in english
\end{poliabstract}
\selectlanguage{catalan}
\begin{poliabstract}{Resum}
Resum en català
\end{poliabstract}
\selectlanguage{english}
\end{document}
The abstract is defined in this way in the cls file, haven't touched anything from the template file:
\newenvironment{abstract}
{\chapter*{Abstract}}
{\vfill %kai
\noindent %kai
\ifx \@keywords \@empty
\relax
\else
{\bf Keywords:} \@keywords \\[6pt] %tobias
\fi
%
\ifx \@categories \@empty
\relax
\else
{\bf CR Categories:} \@categories %tobias
\fi
\addcontentsline{toc}{chapter}{Abstract}
}
abstract
in your template doesn't use\abstractname
but defines the title simply as unnumbered chapter. You can't change it the way you try it. Furthermore, beside this uncommon way of setting the abstract title the abstract definition of your template uses commands which are not recommended to use anymore l like\bf
. Thus, the whole template may be debatable. Do you have to use it?