Document ClassesFixing natbib: Putting tie between authors and citation list

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
Ted
Posts: 94
Joined: Sat Jun 23, 2007 4:11 pm

Fixing natbib: Putting tie between authors and citation list

Post by Ted »

I noticed today that when I did a \citet{SK86} near the end of a typeset line, I'd get a textual citation with author at the end of the first line and citation at the beginning of the start of the second line! I THOUGHT natbib was doing the equivalent of:

Code: Select all

\citeauthor{SK86}~\citep{SK86}
but it's ACTUALLY doing the equivalent of

Code: Select all

\citeauthor{SK86}\ \citep{SK86}
That seems silly to me, especially if you're doing superscript citations (in that case, the superscripts have a space between them and the author names, and they might even show up on the beginning of the next line!).

Ideally, the space between author list and citation list would be configurable (and removable in the superscript case). Unfortunately, it's not, and so I put together a few macros to "replace" or "mimic" \citet for tied behavior. I post details at:
Even if natbib gets fixed, I hope that this example helps people see how to deal with multiple optional arguments and/or starred macro definitions.

Note that the \makeatother and \makeatletter are not required if those lines are put into a in a .sty file that is \usepackaged (or a natbib.cfg file that gets included automatically by natbib).
-- Ted [home/blog]

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply