Showing posts with label DBJ. Show all posts
Showing posts with label DBJ. Show all posts

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.

Friday, July 06, 2007

Two small bugs in merlin.mbs

UPDATE: I've posted a patch file as well as a patched merlin.mbs that fixes this problem. If you prefer the patch option, execute
patch < merlin-fix-nm-rvvc.patch
in the same directory as your old merlin.mbs file. Be sure you're using the 4.20 (2007/04/24) version of merlin.mbs to start with (search through the file for the ProvidesFile line.

I just sent this to Patrick W. Daly. I think I've found two small bugs in merlin.mbs (from custom-bib), the master bibliography style used to generate many common BST files. They both involve adding an nm-rvvc near some existing nm-rvv lines.

I am referring to the 4.20 version of merlin.mbs. I think this is the latest version of the MBS file.
% \ProvidesFile{merlin.mbs}[2007/04/24 4.20 (PWD, AO, DPC)]
The bugs:
  • In FUNCTION {sort.format.names} (lines 8394--8401)
    %<*!nm-init&!nm-rev&!nm-rev1&!nm-rv&!nm-rvx&!nm-rvcx&!nm-rvv>
    %<!vonx> "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}"
    %<vonx> "{ll{ }}{ ff{ }}{ jj{ }}"
    %</!nm-init&!nm-rev&!nm-rev1&!nm-rv&!nm-rvx&!nm-rvcx&!nm-rvv>
    %<*nm-init|nm-rev|nm-rev1|nm-rv|nm-rvx|nm-rvcx|nm-rvv>
    %<!vonx> "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}"
    %<vonx> "{ll{ }}{ f{ }}{ jj{ }}"
    %</nm-init|nm-rev|nm-rev1|nm-rv|nm-rvx|nm-rvcx|nm-rvv>
    I think this should be:
    %<*!nm-init&!nm-rev&!nm-rev1&!nm-rv&!nm-rvx&!nm-rvcx&!nm-rvv&!nm-rvvc>
    %<!vonx> "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}"
    %<vonx> "{ll{ }}{ ff{ }}{ jj{ }}"
    %</!nm-init&!nm-rev&!nm-rev1&!nm-rv&!nm-rvx&!nm-rvcx&!nm-rvv&!nm-rvvc>
    %<*nm-init|nm-rev|nm-rev1|nm-rv|nm-rvx|nm-rvcx|nm-rvv|nm-rvvc>
    %<!vonx> "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}"
    %<vonx> "{ll{ }}{ f{ }}{ jj{ }}"
    %</nm-init|nm-rev|nm-rev1|nm-rv|nm-rvx|nm-rvcx|nm-rvv|nm-rvvc>
    Otherwise, I think this would cause problems sorting when authors might share last names and first initial.
  • In FUNCTION {format.names.ed} (lines 4908--4929)
    %<*nm-rvv>
    "{f{.}.}" format.name$ duplicate$ empty$ 'skip$
    { tie.or.space.prefix bib.fname.font swap$ * }
    if$
    s nameptr
    "{vv~}{ll}" format.name$ bib.name.font *
    s nameptr
    "{jj}" format.name$ duplicate$ empty$ 'skip$
    { bib.fname.font " " swap$ * }
    if$
    %</nm-rvv>
    %<*!nm-rvv>
    "{ff}" format.name$ duplicate$ empty$ 'skip$
    { tie.or.space.prefix bib.fname.font swap$ * }
    if$
    s nameptr
    "{vv~}{ll}" format.name$ bib.name.font *
    s nameptr
    "{jj}" format.name$ duplicate$ empty$ 'skip$
    { bib.fname.font ", " swap$ * }
    if$
    %</!nm-rvv>
    I think this should be:
    %<*nm-rvv|nm-rvvc>
    "{f{.}.}" format.name$ duplicate$ empty$ 'skip$
    { tie.or.space.prefix bib.fname.font swap$ * }
    if$
    s nameptr
    "{vv~}{ll}" format.name$ bib.name.font *
    s nameptr
    "{jj}" format.name$ duplicate$ empty$ 'skip$
    { bib.fname.font " " swap$ * }
    if$
    %</nm-rvv|nm-rvvc>
    %<*!nm-rvv&!nm-rvvc>
    "{ff}" format.name$ duplicate$ empty$ 'skip$
    { tie.or.space.prefix bib.fname.font swap$ * }
    if$
    s nameptr
    "{vv~}{ll}" format.name$ bib.name.font *
    s nameptr
    "{jj}" format.name$ duplicate$ empty$ 'skip$
    { bib.fname.font ", " swap$ * }
    if$
    %</!nm-rvv&!nm-rvvc>
    That actually looks like it will give a formatting error on output!
So hopefully those'll get fixed, right? Am I missing something? Am I wrong?