# Space after et al. too big

I have a document as

\documentclass[12pt]{article}
\usepackage{natbib}
\bibpunct{(}{)}{,}{a}{}{;}
\makeatletter
\renewcommand*{\NAT@nmfmt}[1]{\textsc{#1}}
\makeatother

\begin{document}
According to \citeauthor{test01} space is important.

According to \citeauthor{test01}\ space is important.
\bibliographystyle{plainnat}
\bibliography{literature}
\end{document}


And a bib file as follows:

@misc{test01,
author = "Jim Jones and Arthur Miller and Jenny Carter",
title = "My title",
year = "1988"
}


In the resulting PDF the space after the et al. is as big as if a new sentence would begin:

How can I tell Latex to automatically use a normal space there?

-
By putting a backslash after \citeauthor{test01}, as you already have. –  Ian Thompson Feb 4 '12 at 14:09
I want to do this automatically. There are several houndred citations and when using \citeauthor I have not idea if the author will get an "et al." ... Moreover, when using \citet the space is within the command. –  Felix Feb 4 '12 at 14:19
We'd like to keep answers separate from questions, so you should write a separate answer instead of editing your answer into the question. –  lockstep Feb 4 '12 at 16:56

A hack that seems to work is the following

\usepackage{xpatch}
\xpatchcmd\citeauthor{\begingroup}{\begingroup\aftergroup\@}{}{}
\makeatletter
\renewcommand*{\NAT@nmfmt}[1]{\textsc{#1\@}}
\makeatother


This shouldn't have adverse effects, as the space factor will be influent only when the citation ends with punctuation.

If the package xpatch is not available, the same effect can be obtained by

\usepackage{etoolbox}
\expandafter\patchcmd\csname citeauthor \endcsname
{\begingroup}{\begingroup\aftergroup\@}{}{}


In case one doesn't redefine \NAT@nmfmt, the following should do:

\let\patched@NAT@nmfmt\NAT@nmfmt
\xpatchcmd{\patchedNAT@nmfmt}{#1}{#1\@}{}{}
\AtBeginDocument{\let\NAT@nmfmt\patchedNAT@nmfmt}


(Note that \xpatchcmd can be changed into \patchcmd, if one prefers.)

Disclaimer: I'm the author of xpatch

-
Thanks I like this suggestion more. But there is the problem of \citet which gives "Author et al. (2000)" :-( There you would have to inject something in the middle ... –  Felix Feb 4 '12 at 17:30
@Felix Just add \@ after #1 in your redefinition of \NAT@nmfmt. –  egreg Feb 4 '12 at 18:04

In merlin.mbs the "et al." is is produced by a function as follows:

FUNCTION {bbl.etal}
{ "et~al." }


Replace this in your generated bst file by

FUNCTION {bbl.etal}
{ "et~al.\@" }


which should do the trick. Perhaps worth reporting to the author as a bug.

Might be that this is overdoing it and what is really necessary are two such functions: one that sets the \spacefactor to 1000 (via \@) and one that doesn't in places where the dot "et al." is both the abbrev as well as a sentence ending period.

In case of plainnat.bst the above doesn't quite work as this bibtex style doesn't capsule the string in a function but uses it directly. Thus in this case one would need to open the bst file in a text editor and change all occurances of "et~al." with "et~al.\@" and then save the result under a new name, e.g., myplain.bst and use this style instead.

The alternative is to update the natbib macro(s) as suggested by @egreg. In either case it is a bug in the natbib system which I think should be brought to Patrick's attention.

-
If I see it correctly, i would have to regenerate the bst? Why did you mention merlin.mbs and not one of the others? I would like to do it within the Latex document. –  Felix Feb 4 '12 at 15:25
good question. I must have looked at two questions in parallel and thought your bst file used was generated from merlin.mbs. But you are right plainnat.bst is produced differently and you would need to replace the occurences of "et al." in that bst file then directly (as for some reason it doesn't use a function but adds them directly). There is no way to do such a thing from inside LaTeX (other than by manually adding \  as suggested by others). --- will update my answer slightly. –  Frank Mittelbach Feb 4 '12 at 15:45
I have patched the plainnat.bst and added to the question above. I think it is not nice, but it at least works. –  Felix Feb 4 '12 at 16:49
I stand corrected. As @egreg showed there is of course also the possibility to update the natbib macros to always issue \@ after them. In either case it is a bug in the natbib system. –  Frank Mittelbach Feb 4 '12 at 17:25
I wrote a Mail to Patrick the natbib maintainer. Linking this discussion. –  Felix Feb 4 '12 at 17:28