Created
August 16, 2012 20:49
-
-
Save ezod/3373556 to your computer and use it in GitHub Desktop.
Patch to add DOI numbers to conference articles without pages in IEEEtranN.bst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /usr/share/texmf-dist/bibtex/bst/IEEEtran/IEEEtranN.bst 2008-09-30 19:18:36.000000000 -0400 | |
+++ IEEEtranNdoi.bst 2012-08-16 16:41:34.000000000 -0400 | |
@@ -146,6 +146,10 @@ | |
FUNCTION {default.name.latex.cmd}{ "" } | |
+% The default DOI prefix. | |
+FUNCTION {default.name.doi.prefix}{ "" } | |
+ | |
+ | |
% The default URL prefix. | |
FUNCTION {default.name.url.prefix}{ "[Online]. Available:" } | |
@@ -274,6 +278,7 @@ | |
chapter | |
day | |
dayfiled | |
+ doi | |
edition | |
editor | |
howpublished | |
@@ -310,6 +315,7 @@ | |
CTLdash_repeated_names | |
CTLname_format_string | |
CTLname_latex_cmd | |
+ CTLname_doi_prefix | |
CTLname_url_prefix | |
} | |
{} | |
@@ -356,6 +362,7 @@ | |
ALTinterwordstretchfactor | |
name.format.string | |
name.latex.cmd | |
+ name.doi.prefix | |
name.url.prefix} | |
@@ -376,6 +383,7 @@ | |
default.ALTinterwordstretchfactor 'ALTinterwordstretchfactor := | |
default.name.format.string 'name.format.string := | |
default.name.latex.cmd 'name.latex.cmd := | |
+ default.name.doi.prefix 'name.doi.prefix := | |
default.name.url.prefix 'name.url.prefix := | |
} | |
@@ -767,8 +775,8 @@ | |
FUNCTION {empty.entry.warn} | |
{ author empty$ title empty$ howpublished empty$ | |
- month empty$ year empty$ note empty$ url empty$ | |
- and and and and and and | |
+ month empty$ year empty$ note empty$ doi empty$ url empty$ | |
+ and and and and and and and | |
{ "all relevant fields are empty in " cite$ * warning$ } | |
'skip$ | |
if$ | |
@@ -1135,6 +1143,8 @@ | |
write$ newline$ | |
"\providecommand{\natexlab}[1]{#1}" | |
write$ newline$ | |
+ "\providecommand{\doi}[1]{DOI:#1}" | |
+ write$ newline$ | |
"\providecommand{\url}[1]{#1}" | |
write$ newline$ | |
"\csname url@samestyle\endcsname" | |
@@ -1958,6 +1968,27 @@ | |
+%% DOI | |
+ | |
+FUNCTION {format.doi} | |
+{ doi empty$ | |
+ { "" } | |
+ { this.to.prev.status | |
+ this.status.std | |
+ cap.yes 'status.cap := | |
+ name.doi.prefix " " * | |
+ "\doi{" * doi * "}" * | |
+ punct.no 'this.status.punct := | |
+ punct.period 'prev.status.punct := | |
+ space.normal 'this.status.space := | |
+ space.normal 'prev.status.space := | |
+ quote.no 'this.status.quote := | |
+ } | |
+ if$ | |
+} | |
+ | |
+ | |
+ | |
%% URL | |
FUNCTION {format.url} | |
@@ -2130,6 +2161,10 @@ | |
format.pages output | |
format.note output | |
format.url output | |
+ pages empty$ | |
+ { format.doi output } | |
+ {} | |
+ if$ | |
fin.entry | |
if.url.std.interword.spacing | |
} | |
@@ -2256,6 +2291,10 @@ | |
if$ | |
format.note output | |
format.url output | |
+ pages empty$ | |
+ { format.doi output } | |
+ {} | |
+ if$ | |
fin.entry | |
if.url.std.interword.spacing | |
} | |
@@ -2399,6 +2438,13 @@ | |
'name.latex.cmd := | |
} | |
if$ | |
+ CTLname_doi_prefix | |
+ missing$ | |
+ { skip$ } | |
+ { CTLname_doi_prefix | |
+ 'name.doi.prefix := | |
+ } | |
+ if$ | |
CTLname_url_prefix | |
missing$ | |
{ skip$ } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There appears to be a bug on https://gist.github.com/ezod/3373556#file-gistfile1-diff-L99 and https://gist.github.com/ezod/3373556#file-gistfile1-diff-L110. With this patch (manually) applied to
IEEEtranS.bst
, and these lines copied to other entry handles too, I was getting no DOIs for articles, conference papers and other entries, except for a few books and theses. Replacing:with
format.doi output
, as in this modified version ofIEEEtran.bst
solves the problem.