[Tex/LaTex] Modifying RSC bst file

bibtex

I'm using the RSC's (Royal Society of Chemistry) bst file to write my thesis. You can find this file here. But I would like to tweak it just a bit, to add for example the DOI at the end of each reference.

I discovered some interesting lines at the top of the file:

%% #0 turns off the display of the title for articles
%% #1 enables
FUNCTION {default.is.use.title} { #0 }

%% The number of names that force "et al." to be used
FUNCTION {default.etal.number} { #2 }

%% #0 turns off the display of the DOI for articles
%% #1 enables
FUNCTION {default.use.doi.all} { #0 }

So I changed the line about the doi to:

FUNCTION {default.use.doi.all} { #1 }

But nothing changed in my pdf output. I also tried to enable the display of titles, or change the etal number, but once again, I got nowhere. Can you please help me to figure it out ?

Best Answer

The easiest way to alter the inclusion of DOIs is to use the rsc package

\usepackage[usedoi=true]{rsc}

This will send the appropriate setting through to the rsc bibliography style.

If you want to do things 'by hand', this can be done without copying and editing the .bst file by creating the 'special' reference by hand. Add an entry, either in a dedicated .bib file or in your general one for your document, reading

@Control{rsc-control,
  ctrl-use-title   =  "no",
  ctrl-use-doi-all =  "yes",
  ctrl-link-doi    =  "no",
  ctrl-etal-number =  "0",
}

where the settings are pretty obvious. Then add

\nocite{rsc-control}

right at the start of your document and include the appropriate .bib file in your \bibliography line.

This works by passing the settings to rsc.bst as a special citation, which is then picked up and used to alter the output without needing to make a separate renamed coped of rsc.bst for each possible option combination.

Related Question