Is it possible/not too complicated to add doi support to an already existing bibtex style file? I must be googling the wrong keywords as I can't seem to find much about it. I'm currently using this style
http://waugh.cchem.berkeley.edu/thesis/prsty.bst
Which styles natively support doi links? Perhaps one has a similar look and I won't need to write any low level TeX.
Thanks
BibTeX, biblatex and biber ⇒ Add DOI support to .bst file
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Add DOI support to .bst file
Not a solution, only a hint. Some styles of the natbib package offer a »DOI« field. Perhaps you can dig in the code and incorporate the relevant parts into the concerned style.
Alternatively you could try to mimic the style by means of the biblatex package. I'm not very familiar with that but its said to allow customizations in many ways.
Best regards
Thorsten
Alternatively you could try to mimic the style by means of the biblatex package. I'm not very familiar with that but its said to allow customizations in many ways.
Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Add DOI support to .bst file
This is by no means a general solution as I have only done it for articles, but I have modified the original bibtex style file so that the volume and page are a link to the address of the doi number given. My modifications require the use of the hyperref package.
I'll outline what I have done so hopefully others can modify their own bst files.
Firstly, at the top of the bst file there isThe option of a doi field needs to be added here. I think it can go anywhere, but I put it last
Next we need to tell bibtex/latex what to do with the information in this field. As mentioned I have only altered it for the articles. Here is the original code, starting on L614, with the lines I will change highlighted
Here is what I have changed it to
The doi field is checked, and if it is empty the volume and page are display in the original way, if it has information in it then the \href{address}{link name} command is used with the volume and page displayed as before, but they now act as a link to the doi.
I don't understand the bibtex language well enough to fully explain, but the asterisks(*) at the end of the line concatenate the literal strings and variables. I had to use trial and error to get the correct number.
That's it, simple!
I'll outline what I have done so hopefully others can modify their own bst files.
Firstly, at the top of the bst file there is
Code: Select all
ENTRY
{ address
...
volume
year
}
{}
{ label }
Code: Select all
ENTRY
{ address
...
volume
year
doi
}
{}
{ label }
Code: Select all
FUNCTION {article}
{ output.bibitem
"author" format.authors #1 push.string.check
"journal" journal #0 add.string.check " " *
output
%%%%%%%%%%
format.vol.page #0 push.string
%%%%%%%%%%
" " *
"date" format.date paren #0 add.string.check
note empty$
'skip$
{ ", " * note lc.first.letter * }
if$
fin.entry
crossref empty$
'skip$
{ "See Ref.\ \cite{" crossref "}." * * write$ newline$ }
if$
}
Code: Select all
FUNCTION {article}
{ output.bibitem
"author" format.authors #1 push.string.check
"journal" journal #0 add.string.check " " *
output
%%%%%%%%%%%
doi empty$
{format.vol.page #0 push.string}
{"\href{http://dx.doi.org/" doi "}{" format.vol.page "}" #0 push.string * * * *}
if$
%%%%%%%%%%%
" " *
"date" format.date paren #0 add.string.check
note empty$
'skip$
{ ", " * note lc.first.letter * }
if$
fin.entry
crossref empty$
'skip$
{ "See Ref.\ \cite{" crossref "}." * * write$ newline$ }
if$
}
I don't understand the bibtex language well enough to fully explain, but the asterisks(*) at the end of the line concatenate the literal strings and variables. I had to use trial and error to get the correct number.
That's it, simple!

Last edited by php1ic on Sun Sep 19, 2010 2:58 pm, edited 1 time in total.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Add DOI support to .bst file
Now that the problem seems to be solved, please be so kind and mark the topic accordingly as clearly written in the Board Rules. Otherwise tell us what is missing You are not new to the forum so by now you should know that.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10