TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm not an English native speaker. All the documents I write are in Spanish. To handle this I use some packages like babel and babelbib for bibliographies. However, this can cause some troubles of incompatibility with for example TikZ, hyperref, etc.

It's interesting that if we change the spanish option, when we call the babel package, by any other language, we get a better support. For example this thread is about some error messages that appear when we use [spanish]{babel} + babelbib.

The only known solution (provided in the same page) is to comment the line 171 in the babelbib.sty package file. My problem is that many documents I write must be compiled by other people, and, unfortunately, people that can't understand what they must do in order to fix the problem with the babelbib package. And I don't want to go to everybody's house to fix that. So, I'm wondering if there is some code that I can put in all my documents to comment line 171 of babelbib.sty at every compilation. If no, what can I do?

share|improve this question
As I already say I'm nonative english speaker. So probably there is many typos. If someone really understand me and there is something wrong in my post, please help me by editing it. – leo Mar 1 '12 at 5:00
Btw, the example mentioned in the last reply in that thread compiles without errors on an up-to-date TeX Live 2011. – Andrey Vihrov Mar 1 '12 at 7:02
up vote 2 down vote accepted

With the current versions of babel the error doesn't show, because the spanish.ldf file has been fixed:

[2011/10/06 v5.0k Spanish support from the babel system]

A test with TeX Live 2010 shows that indeed the problem existed, but it was not a responsibility of babelbib.

The correct fix is thus to update your TeX system. A temporary patch (equivalent to comment out line 171 of babelbib.sty) is to write, after loading babelbib,

\patchcmd\btxselectlanguage{\csname}{\csname TEMPPATCH}{}{}

This will execute the command \csname TEMPPATCHextrasspanish\endcsname, that is equivalent to \relax, instead of \csname extrasspanish\endcsname.

share|improve this answer
Actually is a combination of two bugs, the first one in spanish (fixed), and the second in babelbib, which mangles the switching mechanism of babel because \extrasspanish is used in the wrong context (I don't know whether it has been fixed). So, even if no error is raised, using your trick is always healthy. – Javier Bezos Mar 1 '12 at 14:16
Thanks. I'm avid to test this. Now I'm out and this isn't my personal computer. – leo Mar 1 '12 at 17:06
@JavierBezos Indeed it's not very clear why the package issues \extras<language> immediately before doing \selectlanguage{<language>}, which does \extras<language> by itself. – egreg Mar 1 '12 at 23:48

Your Answer


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.