Wednesday, February 16, 2011

natbib-compatible BibTeX style (BST) file for Springer LNCS publications

UPDATE: Additionally, if you prefer "References" instead of "Bibliography", you have to re-define the \bibname macro in your document (e.g., just after you include natbib). Just add a
\rewewcommand\bibname{\refname}
or a
\renewcommand\bibname{References}
and you should be up and running with your desired bibliography name.
For some reason, the folks over at Springer do not like to make their BibTeX style (BST) files natbib compatible. This omission seems egregious when considering the kind of authors that would submit to journals and conferences that use LNCS-style formatting. Springer does provide LaTeX support files for LNCS, but the included BST file is not natbib compatible (because it was not built with natbib and author–year extensions turned on, which are needed in natbib even when numbered references are used). What makes things more difficult is that it is produced by hacking another BST (titto.bst) that was originally generated properly using makebst, and many of the hacks were already implemented natively in merlin.mbs. So much more of the postfix BST language was hacked directly rather than would have been necessary if the correct docstrip driver options were picked in the first place. So that makes it more challenging to reproduce a refactored version with additional natbib functionality without worrying about introducing regressions.

Nevertheless, I've done my best, and I've made the the natbib-compatible result splncsnat.bst available for download. I was able to remove the need for some of the manual editing by a smarter choice of docstrip options, but I still ended up having to create a patch on top of a stock docstrip-generated BST (the docstrip driver splncsnat-unpatched.dbj and patch splncsnat.patch are also available). Hopefully that helps someone out there.
  • splncsnat.bst: natbib-compatible BST file for Springer LNCS-type publications
    Download and place splncsnat.bst in same directory as document's TeX source code. In the TeX preamble of the document, use
    \usepackage[numbers]{natbib}
    \bibliographystyle{splncsnat}
    and then in the text use macros like
    \cite{smith77}       % to get a "[1]" in the text
    \citep{smith77} % to get a "[1]" in the text
    \citet{smith77} % to get a "Smith [1]" in the text
    \citeauthor{smith77} % to get a "Smith" in the text
    The normal \bibliography{FILENAME} can be used at the end of the text where the BBL will be inserted by BibTeX.
  • splncsnat-unpatched.dbj: docstrip driver used to generate splncsnat-unpatched.bst
  • splncsnat.patch: patch used to generate splncsnat.bst from splncsnat-unpatched.bst (assuming version 4.20 [2007/04/24 (PWD, AO, DPC)] of merlin.mbs)
Of course, you need only splncsnat.bst to get up and running.

20 comments:

Anonymous said...

Wow! That was exactly what i was looking for. Thank's a lot for publishing this.

Anonymous said...

Thanks for putting this out in the open! Lack of natbib support is a serious handicap. Hope Springer takes note of this.

Unknown said...

Thank you! This is useful. I noticed two issues though:
* the references should be in order of forst mentioning, not alphabetical,
* (minor) month and URL are added if supplied, while they should not.

Ted Pavlic said...

Roman -- Thanks for the feedback. Do you have a link enumerating the bib conventions you're referring to? If I get a chance, I can try to update the DBJ and BST files to the (new?) conventions.

Regarding the ordering, that actually isn't standard across Springer journals. Different journals have different conventions. It should be easy to edit the DBJ to change the ordering though. Hopefully(?) that won't change things so much to muck up the patch.

I run a pre-processor on a slice of my BIB on each my journal submissions, and that masked off any issues with URL/etc. Again, it should be easy to remove those from the DBJ. Again, hopefully that wouldn't muck up the patch.

Unknown said...

Ted,
there is no explicit statement, though the ordering is clear from the examples. Look here, for example:
http://www.springer.com/cda/content/document/cda_downloaddocument/typeinst.pdf

I'll try to follow your advice, though I have no experience of editing BST. :)

Nathan Collins said...

Thanks! This is really helpful.

Anonymous said...

How do I change the bibliography's section title to "References"? (It's showing up as "Bibliography".) Also, how do I remove the page break before the bibliography? It seems to be automatically adding it.

Ted Pavlic said...

Anonymous -- That's a function of the documentclass that you are using.

If you are using the "article" documentclass, then your references should already be set to use "References" and not "Bibliography." Moreover, the "article" documentclass should not put your references on a separate page.

If you are using a different document class, then the ways to change the references name and whether it appears on a new page depends on that document class. USUALLY, you can change the refname:

\renewcommand\refname{References}

to turn "Bibliography" into "References." Getting rid of the new page before the references is more challenging though. That is in the "thebibliography" environment defined within the document class. It can usually be nulled out by re-defining the environment, but it's a more complicated process that requires customization to the particular document class you are using.

Anonymous said...

Hi Ted,

Thanks for the quick reply. I'm using Springer's LNCS document class (llncs.cls). The only optional argument I'm passing it is a4paper.

The renewcommand trick isn't working to rename the bibliography to "References".

I don't know what is wrong, but I have a feeling I'm doing something profoundly stupid.

Anonymous said...

OK, here's an update: I added sectionbib to the options of natbib, and that removed the page break. Unfortunately, the heading for the biblio is still "Bibliography", even with the \refname override.

Ted Pavlic said...

Anonymous - Sorry for the late reply.

Actually, as it turns out, when you're using natbib, you need to redefine "bibname" and not "refname."

llncs is based on article (in fact, it includes it directly). So this should work:

\renewcommand\bibname{\refname}

Alternatively:

\renewcommand\bibname{References}

should also work.

Anonymous said...

Hello,

Thank you very much for this natbib compatible version of splncs. I just noticed that there is an issue with citations that have no date, as it is adding a ????? Why not just outputting nothing instead.

Cheers

P.S.

Ted Pavlic said...

Anonymous (regarding the ???? dates) -- That's the default for many BST formats. It is rare that citations lack dates, and so it's typically an error. So the ???? tires to point out the error to the author.

To blank out missing years, the "blkyear" line in the splncsnat-unpatched.dbj file needs to be uncommented. Then "latex splncsnat-unpatched.dbj" will generate a BST. You can then try (but I can't guarantee it will work) to apply the patch. That should generate a BST file like you want.

switch said...

Thanks a lot !!!!!!

sparkica said...

Thank you, you save A LOT of my time :)

Jahanzeb said...

Thanks a lot !!! Very useful :)

Anonymous said...

Is possible use this get author year citation, and numbered without brackets bibliography?

Anonymous said...

That was exactly what i was looking for. Thank's a lot for publishing this.
Thank you, you save A LOT of my time :)

Unknown said...

Just what I needed, thanks a lot!!

Inulinux said...

Very helpful!!!