# Problem with spanish and babelbib

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?

-
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

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`,

``````\usepackage{etoolbox}
\patchcmd\btxselectlanguage{\csname}{\csname TEMPPATCH}{}{}
``````

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

-
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