# “! Missing \endcsname inserted” with babel and natbib

This is puzzling, at least for me. I get a "! Missing \endcsname inserted" error in the following MWE:

\documentclass{article}
\usepackage[UKenglish,italian,french]{babel}
\usepackage{natbib}

\begin{document}
Hello world!~\cite{vim:2008}
\end{document}


If I remove the unbreakable space, or the french option from babel, or the colon from the citation, or the natbib package, everything works fine.

I'm compiling with pdflatex.

What can I do to make them work all together?

• Why would you have ~ at the start of a line? And it's better avoiding colons in labels or citation keys when French is involved. – egreg Oct 24 '15 at 19:56
• @egreg: I don't. I've removed the preceding text for the MWE. My main problem is that I've added "french" to a large existing document, and if I can avoid removing colons from the already existing keys it would be nice, otherwise I'll remove the (few) French words. – Massimo Ortolano Oct 24 '15 at 20:01

Load natbib before babel.

\begin{filecontents*}{\jobname.bib}
@article{vim:2008,
author={X Y},
title={Z},
journal={J},
year=2008,
}
\end{filecontents*}

\documentclass{article}
\usepackage{natbib}
\usepackage[UKenglish,italian,french]{babel}

\begin{document}

x~\cite{vim:2008}

\bibliographystyle{plainnat}
\bibliography{\jobname}
\end{document}