# How can I improve the kerning of citation footnotes made with natbib?

I'm writing an article that requires the natbib package for citations, and I'm using the super and compress options. Right now I'm "manually" placing the citation outside of punctuation, as in

Hello world.\cite{Knuth}


I've noticed there's an annoying small horizontal space between the punctuation mark and the citation footnote, as shown bracketed by the red lines:

Is there a way to globally change the kerning of the citation footnotes to get rid of these spaces (while keeping them to the right of the punctuation mark)?

Looking around online, there seem to be two promising packages, but both of their manuals are long and forbidding and I haven't been able to find what I'm looking for:

1. microtype has lots of nice kerning customizations. Unfortunately, the default options don't fix the problem, and I'm not sure how to manually change the footnote kerning.

2. fnpct allows extensive customization for actual \footnotes, but does not seem as well adapted for citation footnotes created using the \cite command. Chapter 8 of the manual discusses how to use the package with biblatex's \autocites, but as discussed in this question, I can't get it to work with the natbib package.

Any ideas? I've already written the article manually placing the \cites outside of the punctuation, so I'd prefer a solution that is compatible with this ordering, but if necessary I could manually move them inside the punctuation (as is required for fnpct).

You don't give a minimal document showing exactly what you are doing, but here's a simple solution with two options. The first is a compromise, which will adjust the spacing for all citation commands whether they follow punctuation or not. If that's not acceptable, then you need to define a new version of \cite just for following punctuation, and adjust only that one.

## Version 1

In this version, we just add a negative kern to all the citations independent of whether they follow punctuation or not. If the value you choose for the kern is not too big, this is the simplest solution.

\begin{filecontents*}{\jobname.bib}

@article{Massam2001,
Author = {Diane Massam},
Journal = {Natural Language \& Linguistic Theory},
Pages = {153-197},
Title = {Pseudo Noun Incorporation in {Niuean}},
Volume = {19},
Year = {2001}}

@article{Materna1987,
Author = {P Materna and E Hajicova and P Sgall},
Journal = {Linguistics and Philosophy},
Pages = {101-113},
Title = {Redundant Answers and Topic-Focus Articulation},
Volume = {10},
Year = {1987}}

@article{Matsumoto1995,
Author = {Y Matsumoto},
Journal = {Linguistics and Philosophy},
Pages = {21-60},
Title = {The Conversational Condition On {Horn} Scales},
Volume = {18},
Year = {1995}}

@article{Matsuo1999,
Author = {A Matsuo},
Journal = {Linguistic Inquiry},
Pages = {310-317},
Title = {Reciprocity and Binding in Early Child Grammar},
Volume = {30},
Year = {1999}}

@article{MatsuoDuffield2001,
Author = {Matsuo, Ayumi and Duffield, Nigel},
Journal = {Language Acquisition},
Number = {4},
Pages = {301--327},
Title = {{VP}-ellipsis and anaphora in child language acquisition},
Volume = {9},
Year = {2001}}

@article{Matushansky2008,
Author = {Matushansky, Ora},
Journal = {Linguistics and philosophy},
Number = {5},
Pages = {573--627},
Title = {On the linguistic complexity of proper names},
Volume = {31},
Year = {2008}}
\end{filecontents*}
\documentclass{article}
\usepackage[super,compress]{natbib}
\bibliographystyle{unsrtnat}
\makeatletter
\renewcommand\NAT@open{\kern-2pt}
\makeatother

\begin{document}
Some text.\cite{Materna1987,Matsumoto1995,Matsuo1999}

But without punctuation\cite{Massam2001,MatsuoDuffield2001,Matushansky2008}
\bibliography{\jobname}
\end{document}


## Version 2

In this version we create a new \cite command \pcite which gets used after punctuation and then adjusts the kern only for those cases.

\begin{filecontents*}{\jobname.bib}

@article{Massam2001,
Author = {Diane Massam},
Journal = {Natural Language \& Linguistic Theory},
Pages = {153-197},
Title = {Pseudo Noun Incorporation in {Niuean}},
Volume = {19},
Year = {2001}}

@article{Materna1987,
Author = {P Materna and E Hajicova and P Sgall},
Journal = {Linguistics and Philosophy},
Pages = {101-113},
Title = {Redundant Answers and Topic-Focus Articulation},
Volume = {10},
Year = {1987}}

@article{Matsumoto1995,
Author = {Y Matsumoto},
Journal = {Linguistics and Philosophy},
Pages = {21-60},
Title = {The Conversational Condition On Horn Scales},
Volume = {18},
Year = {1995}}

@article{Matsuo1999,
Author = {A Matsuo},
Journal = {Linguistic Inquiry},
Pages = {310-317},
Title = {Reciprocity and Binding in Early Child Grammar},
Volume = {30},
Year = {1999}}

@article{MatsuoDuffield2001,
Author = {Matsuo, Ayumi and Duffield, Nigel},
Journal = {Language Acquisition},
Number = {4},
Pages = {301--327},
Title = {{VP}-ellipsis and anaphora in child language acquisition},
Volume = {9},
Year = {2001}}

@article{Matushansky2008,
Author = {Matushansky, Ora},
Journal = {Linguistics and philosophy},
Number = {5},
Pages = {573--627},
Title = {On the linguistic complexity of proper names},
Volume = {31},
Year = {2008}}
\end{filecontents*}
\documentclass{article}
\usepackage[super,compress]{natbib}
\bibliographystyle{unsrtnat}
\makeatletter
\newif\ifpcite
\renewcommand\NAT@open{\ifpcite\kern-2pt\else\fi}
\renewcommand\NAT@close{\global\pcitefalse}
\newcommand\pcite{\pcitetrue\cite}
\makeatother

\begin{document}
Some text.\pcite{Materna1987,Matsumoto1995,Matsuo1999}

But without punctuation\cite{Massam2001,MatsuoDuffield2001,Matushansky2008}
\bibliography{\jobname}
\end{document}


• These are nice solutions. I'd been thinking about using xpatch, and you could alternatively put \usepackage{xpatch} then \xpatchcmd{\NAT@citesuper}{\kern \p@}{\kern 0\p@}{}{} (or in place of zero some other number you like). I guess this approach would add more value only if we had a means to test whether the previous character was punctuation, similar to how we can test the next one with \@ifnextchar ... but I'm not aware of a means to do that.
– John
Jun 14 '18 at 20:01
• @John Yes, xpatch is an alternative way to patch the commands, but since this is pretty simple patching, it didn't seem worth the effort. Jun 14 '18 at 20:19