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 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}
share|improve this question
    
Would \usepackage[english]{babel} help? –  tohecz Jan 1 '13 at 20:38
add comment

2 Answers

up vote 8 down vote accepted

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
\adddialect\l@ENGLISH\l@english
\makeatother

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

\usepackage[strict,autostyle]{csquotes}
\usepackage[style=ieee,backend=bibtex]{biblatex}
\addbibresource{biblatex-examples.bib}

\usepackage{blindtext}

\nocite{*}

\begin{document}

\Blindtext

\printbibliography

\end{document}
share|improve this answer
    
Thanks! That works very well. –  cacamailg Jan 1 '13 at 22:45
add comment

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.

share|improve this answer
1  
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
add comment

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.