2

Having searched fairly thoroughly to solve this problem I came across this answer which solves the problem for URL: Changing predefined words in a biblatex bibliography

Is it possible to perform the same task on the DOI label to give the result shown below:

Reference as it should look

1 Answers1

4

Use this in your preamble:

\usepackage{xpatch} 
\xpatchfieldformat{doi}{\mkbibacro{DOI}}{\bibstring{urlfrom}\addcolon\space\mkbibacro{DOI}}{}{}

or, as suggested by @Moewe:

\usepackage{xpatch}
\xpatchfieldformat{doi}{\mkbibacro{DOI}}{\mkbibacro{DOI}\addcolon\space\bibstring{urlfrom}}{}{}
Bernard
  • 271,350
  • Excellent, I don't have much experience of xpatch but it is working well. I will have to read up on it. – Hugh Williams Dec 06 '15 at 01:03
  • The longest job is to find where the stuff is defined. Actually I'd like to have the possibility to ‘ internationalise’ the code, as ‘ Available from’ is just the bibstring urlfrom, but could find no place in the code where it was used, so I don't know how to call it. – Bernard Dec 06 '15 at 01:10
  • What about \xpatchfieldformat{doi}{\mkbibacro{DOI}}{\bibstring{urlfrom}\addcolon\space\mkbibacro{DOI}}{}{}? Note that normally, I would not advise to patch field formats as they are often short enough to simply change the entire thing, in this case, I have to admit that \DeclareFieldFormat{doi}{% \bibstring{urlfrom}\addcolon\space\mkbibacro{DOI}\addcolon\space \ifhyperref {\href{http://dx.doi.org/#1}{\nolinkurl{#1}}} {\nolinkurl{#1}}} (modulo line breaks) is a bit long. (I also think we're over-using the colon here a fair bit, but OK.) – moewe Dec 06 '15 at 07:15
  • @Moewe: Thank you for recalling me the \bibstring command. I've modified the code accordingly and added your variant suggestion. – Bernard Dec 06 '15 at 11:13
  • I have added @moewe longer answer to my biblatex.cfg – Hugh Williams Dec 06 '15 at 14:09
  • I just noted that in the second suggestion now the order of \mkbibacro{DOI} and \bibstring{urlfrom} seems switched ... – moewe Dec 06 '15 at 17:04
  • @moewe: They are. Isn't it what you you suggested? – Bernard Dec 06 '15 at 17:32
  • @Bernard Did I? – moewe Dec 06 '15 at 17:38