To answer my own question:
After I replaced:
regime \citep[][]{Jager2008}.
with:
regime \citep[][]{Jager2008}.
everything works without problems.
Note: I can not see any difference, but the new command was copied from a different location in the latex file (I also copy&pasted the new and old version in here...). This behaviour is reproducable, that means if I click 'undo' and then run again, the same warnings appear again...
The problem is the supplementary pair of braces, which is however necessary for correct sorting. You should try biblatex
, really, because it provides different fields for sorting dates.
A possible patch is to write, after loading natbib
,
\makeatletter
\let\NAT@bare@aux\NAT@bare
\def\NAT@bare#1(#2){%
\begingroup\edef\x{\endgroup
\unexpanded{\NAT@bare@aux#1}(\@firstofone#2)}\x}
\makeatother
This will swallow the offending part, while keeping the correct sorting order.
The problem is in what's presented to LaTeX and natbib
to interpret. If you look at the .bbl
file, you'll see that the entry starts with
\bibitem[Knuth({\noopsort{1973c}}1981)]{book-full}
Now natbib
uses this to produce the results from \citep{book-full}
(or \citet
), by applying various commands. The relevant one (that I found with some grep
search) is \NAT@bare
that requires its arguments in the form
\def\NAT@bare#1(#2)#3(@)#4\@nil#5{%
The relevant part is #1(#2)
, which is derived from the argument to \bibitem
in brackets; natbib
wants to perform a numeric check, assuming that what's in parentheses is the year. But it finds {\noopsort{1973c}}1981
and this breaks off. So I make an alias to the original \NAT@bare
command, calling it \NAT@bare@aux
and do
\def\NAT@bare#1(#2){%
\begingroup\edef\x{\endgroup
\unexpanded{\NAT@bare@aux#1}(\@firstofone#2)}\x}
So, when natbib
wants to execute \NAT@bare
(it's so instructed by other macros), it will take the argument Knuth({\noopsort{1973c}1981}) and perform an
\edef; thus
\x` will be defined as the result of completely expanding
\endgroup\unexpanded{\NAT@bare@aux Knuth}(\@firstofone{\noopsort{1973c}}1981)
The job of \@firstofone
is just to strip the braces, and the expansion of \noopsort{1973c}
is just empty. So at the end LaTeX will see
\NAT@bare@aux Knuth(1981)
which is in the right format. The \endgroup
balances the \begingroup
and vanishes together with the definition of \x
which has already done its job.
If the entry is normal, say \bibitem[Author(2012)]
(by the way, Happy New Year), \x
will be defined as the full expansion of
\endgroup\unexpanded{\NAT@bare@aux Author}(\@firstofone 2012)
and \@firstofone 2
will simply return 2
, so in the end LaTeX will see
\NAT@bare@aux Author(2012)
as it should.
Best Answer
If I try with
then the
.aux
file containsThese entries will be picked up by BibTeX in order to populate the
.bbl
file. Once you run BibTeX and LaTeX again, the entries in the.bbl
file will produce\bibcite
lines in the.aux
file, such asThus you will be able to find the offending
\citation{:}
entry in the.aux
file and guess where the problem is. A binary search can be useful to narrow down the lookup.The warning
can only be issued by BibTeX and it only looks for
\citation
lines in the.aux
file. So if the warning is issued, there is a line of the form\citation{:}
.