}
{}
{ label }
+
+STRINGS { doiprefix doiurl }
+FUNCTION {init.doi.variables}
+{
+ "http://dx.doi.org/" 'doiurl := % prefix to make URL from DOI
+ "doi:" 'doiprefix := % text prefix printed before DOI ref
+}
INTEGERS { output.state before.all mid.sentence after.sentence after.block }
FUNCTION {init.state.consts}
{ #0 'before.all :=
if$
}
+FUNCTION {make.href}
+{ "\href {" swap$ * "} {\path{" * swap$ * "}}" * }
+
FUNCTION {format.doi}
{ doi empty$
{ "" }
- {
- new.block
- "\doi{" doi * "}" *
- }
+ { doiprefix doi * doiurl doi * make.href }
if$
}
FUNCTION {format.note}
write$ newline$
" \providecommand{\doi}{doi:\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi"
write$ newline$
+ "\expandafter\ifx\csname href\endcsname\relax"
+ write$ newline$
+ " \def\href#1#2{#2} \def\path#1{#1}\fi"
+ write$ newline$
}
EXECUTE {begin.bib}
+EXECUTE {init.doi.variables}
EXECUTE {init.state.consts}
ITERATE {call.type$}
FUNCTION {end.bib}