# Language problems with biblatex and babel

I am trying to use biblatex with IEEEtran and babel, however I am having an error: Package babel Error: You haven't defined the language ENGLISH yet.. With regular Bibtex everything works as usual. The MWE is the following:

\documentclass[english]{IEEEtran}

\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[strict,autostyle]{csquotes}
\usepackage[style=ieee,backend=bibtex]{biblatex}
\bibliography{/usr/local/texlive/2012/texmf-dist/doc/latex/biblatex-ieee/biblatex-ieee.bib}

\usepackage{blindtext}

\begin{document}

\Blindtext

\nocite{*}
\printbibliography

\end{document}

-
Would \usepackage[english]{babel} help? –  tohecz Jan 1 '13 at 20:38

The error seems indeed to be caused by the combination biblatex/babel/IEEEtran -- your example (with an appropriate .bib file) works with the article class. A workaround is to fake an ENGLISH (uppercase) dialect for the english language.

\documentclass[english]{IEEEtran}

\usepackage{babel}

\makeatletter
\makeatother

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[strict,autostyle]{csquotes}
\usepackage[style=ieee,backend=bibtex]{biblatex}

\usepackage{blindtext}

\nocite{*}

\begin{document}

\Blindtext

\printbibliography

\end{document}

-
Thanks! That works very well. –  cacamailg Jan 1 '13 at 22:45

The problem is that IEEEtran.cls changes the meaning of \markboth applying yet another \MakeUppercase, to which

\protect\foreignlanguage{english}{%
\protect\bbl@restore@actives\MakeUppercase{\refname}}


is passed, resulting in LaTeX trying to do

\foreignlanguage{ENGLISH}


which gives the error. This is caused by \printbibliography, but is not a responsibility of biblatex, only by a not so wise redefinition of \markboth

One can notice that \refname is already passed to \MakeUppercase.

You have two choices:

1. change the bad redefinition of \markboth:

\makeatletter
\def\markboth#1#2{%
\def\leftmark{\@IEEEcompsoconly{\sffamily}#1}%
\def\rightmark{\@IEEEcompsoconly{\sffamily}#2}}
\makeatother


The IEEEtran definition has \MakeUppercase{#1} and \MakeUppercase{#2}.

2. enable a fake ENGLISH language referring to english:

\makeatletter
\let\l@ENGLISH\l@english
\makeatother


Just put one of the two pieces of code in the preamble of your document. Probably the second one is the safest.

-
Thanks! The second solution is really the safest, and similar to the one provided by lockstep. I will prefer the lockstep solution since it uses a babel command and not the more generic \let. –  cacamailg Jan 1 '13 at 22:48
@cacamailg Yes, probably the people at IEEE would remove your definition, just to find them in trouble; so they would remove the call to babel and also to csquotes, ruining your pretty formatting. :( –  egreg Jan 1 '13 at 22:50
Yes, and they would also remove biblatex :(. –  cacamailg Jan 1 '13 at 23:02