Babel(spanish)/chicago bibliography style conflicting

babelbibtexnatbibspanish

I am writing some class notes, and babel (with spanish language option) + natbib + chicago bibliography style are producing some undesirable results: they give me the Missing \endcsname inserted. error when I add a volume to a given article I am trying to cite. The class notes are in spanish so I need babel. A minimal working example of my tex file:

\documentclass[10pt]{article}
\usepackage{natbib}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}

\title{min}
\author{none}
\date{today}

\begin{document}

\maketitle
cite the citation \citep{efron1979}

\bibliographystyle{chicago}

\bibliography{biblio.bib}

\end{document}

and my biblio.bib file:

@article{efron1979,
 author={Bradley Efron},
 title={Bootstrap Methods: Another Look at the Jackknife},
 journal={The Annals of Statistics},
 year=1979,
 number=1,
 pages={1-26},
 volume={7}
}

If I remove the volume from the cited work in the .bib file, for some reason, the code works. But these is a very annoying work around: I still get warnings from BibTex, saying that I have a missing volume. What is the proper solution to this?

Best Answer

Given that you use utf8 encoding (notice that this is the default since a while; you do not need to explicitly load inputenc here, although you probably do need the fontenc to set T1), probably you will input ñ as ñ and not as ~n --- one possibility is to disable the shorthands altogether, as in:

\documentclass[10pt]{article}
\usepackage[utf8]{inputenc} % not needed
\usepackage[T1]{fontenc} % this IS needed
\usepackage{natbib}
\usepackage[spanish, es-noshorthands, shorthands=off]{babel}


\title{min}
\author{none}
\date{today}

\begin{document}

\maketitle
cite the citation \citep{efron1979}

\bibliographystyle{chicago}

\bibliography{biblio.bib}

\end{document}

which works. If you have Spanish shorthands in the real bib file, though, that will be more complex --- but in BiBTeX file I advocate for plain TeX syntax everywhere, so you have no surprises...

Disabling the babel shorthands when using spanish will prevent also several other glitches with, for example, TikZ and company.

Related Question