Re: Problem with natbib and crossref



Jan Hla*** wrote:
Alan Ristow wrote:

Then, \citep{hinz00} produces the following entry:
Presumably you mean \citep{foo00}....

Yes, sorry.

Fred Foo, Nothingness. In , Brad Bar (2000), 2000.
I'm afraid you'll have to provide more information. For starters, there
aren't any years in your sample bib entries, so we can't tell where the
2000s are coming from. Neither have you told us what bibliography style
you're using nor how you expect the output to look.

I use the "natbib" package with bibliography style "plainnat.bst".

Here is the minimal example you asked for:

--------------file natbib.tex

In general, it's not a good idea to give your files the same name as a package you're using. Some packages contain .tex files as part of their distribution, and if you use the same name as one of those files then LaTeX might not be able to find the package file it needs. In the case of natbib there's no natbib.tex in the package, so your example continues to run. If you were using pstricks and called your file pstricks.tex, though, you'd likely have problems.

Now what bothers me most is that comma after "In".

I don't see that comma when I run your example. I also see nothing in my plainnat.bst that indicates a comma should be placed after "In". Put \listfiles in your preamble and inspect the .log to see what version of natbib you're running. I have:

*File List*
report.cls 2005/09/16 v1.4f Standard LaTeX document class
size11.clo 2005/09/16 v1.4f Standard LaTeX file (size option)
natbib.sty 2007/02/05 8.0 (PWD)
test.bbl

It's possible that you're using an older version and an upgrade would solve your problem.

I also don't like the
fact that \citet produces the year and it is followed by a repetition of
the year, but I could live with that.

Make a copy of plainnat.bst and save it somewhere that BibTeX can find it. Open the copy and look for "FUNCTION {format.book.crossref}". Near the end of that function you'll see:

" \citet{" * crossref * "}" *

Change \citet to whatever you prefer. (In your current version of plainnat.bst it might also be this line that is producing your stray comma.)

Alternatively, you can run BibTeX with the --min-crossrefs switch to combine your references so that you'll have two complete references instead of two references that refer to a third. With your example, try:

bibtex --min-crossrefs=100 <file>

Using this method, BibTeX will complain that you can't have both authors and editors in a book reference, and will print the authors without the editors. To get around that, you'll have to find a .bst that allows it or create your own .bst (which is most easily done using custombib).

Alan
.