# Tilde in author field changes S letter with Estonian babel

Bibtex generates fallowing code to bbl file.

\bibitem{Bell_1964}
J.~S. Bell, \enquote{On the {Einstein-Podolsky-Rosen} paradox,} Physics
\textbf{1}.


and similarly

\bibitem{BellSpeakableAndNot}
J.~S. Bell, \emph{Speakable and Unspeakable in Quantum Mechanics; 2nd ed.}
(Cambridge Univ. Press, Cambridge, 2004), chap. Introduction to the
Hidden-Variable Question, pp. 37--38, Collected papers on quantum philosophy.


Problem is that S is replaced with Š in the output and I don't know why nor how to fix it. I've tried different bibtex formats, encodings and {} placements but problem remains.

I know you could work around this with directly removing ~ in front of S in bbl file or formatting all the name as {J. S. Bell}, but I have lots of references in my thesis and I'd like clean solution.

I have googled a whole day and I really hope you know how to help me.

EDIT: As it turned out, it was babel package shortcuts which is to blame. So now I know minimal example to reproduce the error is as fallows:

\documentclass[12pt]{article}
\usepackage[estonian]{babel} % Estonian babel!
\usepackage[utf8]{inputenc}

\usepackage{filecontents} % Just of infile .bib data
\begin{filecontents*}{\jobname.bib}
@article{Bli74,
author = {Blinder, Alan S.}
}
\end{filecontents*}

\begin{document}

\section{Foobars}
barbarbar \cite{Bli74}
\bibliographystyle{plain}
\bibliography{\jobname}
\end{document}


And corresponding output will be after latex + bibtex + latex + latex:

1 Foobars
barbarbar [1]

Viited
[1] AlanŠ. Blinder.

-
Are you using babel? With what options? –  egreg May 19 '12 at 20:13
Please add information about the bibliography style you use, as well as whether you use babel -- including the language that's been set. It would also be useful if you posted the two bib entries in question. –  Mico May 19 '12 at 20:16
Thanks for your comments. Original problem is already solved. Sry for not including this info beforehand as there was so much related things and I didn't want to include everything just in case. –  Johu May 19 '12 at 21:52
@Johu Minimal examples are important; I guessed Estonian by peeking at your profile page, but there may be many involved variables. Always try producing an example as short as possible that shows the problem. Please, edit the question so that it can be useful to other Estonian users. –  egreg May 19 '12 at 22:03
@egreg I did it. Thanks again for your help! –  Johu May 19 '12 at 22:31

The only explanation is that you're declaring

\usepackage[estonian]{babel}


If you don't need the combinations such as ~S for producing accented Estonian characters, because your document is UTF-8 encoded, then say

\addto\extrasestonian{\let~\nobreakspace}


just after loading babel. If you need the babel shortcuts, then the only options are:

1. Disable the shorthand before typesetting the bibliography

\let~\nobreakspace
\bibliography{<filename>}

2. Remove ~ from the .bib file. It's just a "search and replace", after all, and the ~ there does nothing, as names are surely at the start of a line.

(Note: I changed the way to disable the shortcut as \shorthandoff{~} has an undesired effect.)

-
excellent! This is indeed the issue. As I use UTF-8 I'd like to use option 1, but now it also ignores no breaking white-space meaning of ~. Can it be restored in some way? All of the tildes can be removed from bibtex style but some are still generated by inbuilt bibtex functions and they could be used for the purpose they are meant for. –  Johu May 19 '12 at 21:49
@Johu I changed the code. This should work properly. –  egreg May 19 '12 at 21:58
Thanks! It worked. I'd like to emphesize for others that  \addto\extrasestonian{\let~\nobreakspace} has to be after loading babel as told. –  Johu May 19 '12 at 22:06