# Tag Info

## Hot answers tagged doi

51

Assuming you are using standard styles, use options doi=false,isbn=false,url=false. The manual describes these as 'style-specific' options, as they do depend on the bibliography style in use.

41

Include your DOIs in the BibTeX database under the doi field and include the URLs under the url field; for example: \begin{filecontents*}{test.bib} @article{foo2010, author = "Foo Bar", journal = "J.P.B.", year = 2010, title = "Where the wild things are.", doi = {10.1.1/jpb001}, url = {http://dx.doi.org/10.1.1/jpb001} } \end{filecontents*} ...

28

Crossref has just enabled content-negotiation on their API, where they are able to generate bibtex. Here's an example from their blog curl -LH "Accept: text/bibliography; style=bibtex" http://dx.doi.org/10.1038/nrd842 here's how you'd do it in Ruby open("http://dx.doi.org/10.1038/nrd842","Accept" => "text/bibliography; style=bibtex"){|f| f.each ...

26

One possibility is to extend Herbert's bibmacro to several nested conditions. (The following example contains only placeholder links for the ISBN/ISSN fields because I don't know how this links must be formatted.) With regard to your further issues: I'm not sure if the url field allows to specify several URLs separated by white spaces; if it does, I don't ...

25

I used the default example bib from the current biblatex documentation which is available on every TeX distribution. The two entries have both a doi entry in the bib file: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[backend=biber]{biblatex} \usepackage[colorlinks]{hyperref} \bibliography{biblatex-examples} ...

21

The line number in the error message is the line of the .bbl file that is generated by bibtex, it is not the line of the .bib file. Therefore the question quotes the wrong lines. The line in the error message contains: pp. 225--236, 10.1007/978-0-387-68772-8_18. [Online]. Therefore I think the entry in the .bib file contains doi = ...

20

A minimal change would be to use the plainurl style instead of plainnat. You could also continue to use plainnat and give a suitable definition of \doi (to override the non-hyperlinked version \provided by plainnat), eg: \newcommand*{\doi}[1]{\href{http://dx.doi.org/#1}{doi: #1}} In both cases, just use a doi field in your .bib file.

19

Will Robertson showed how to do it with natbib and hyperref (as requested by the original poster). The most important point is of course to have a doi field in your bib file. Another solution would be to use biblatex instead of natbib. My experience is that biblatexis at the same time very flexible and very stable, especially when some fileds (e.g name or ...

17

The original question is about a standard BibTeX style, but inspired by lockstep I've worked out a biblatex solution as a complement to my other answer. The method here is to add the appropriate prefix to the raw DOI, then test this for equivalence to the URL. The prefix needs to be processed with \detokenize as this is how the URL field is formatted. ...

16

I came across this thread recently while solving a variant of Peter's question. Instead of adding a hyperlink DOI to each of the bibliography items, you may want not to write the DOI explicitly but to make another field of the bibliographic item clickable with an hyperlink to the download location. In some journals, the hyperlink is associated to the ...

16

In my previous answer, there was some confusion between - and _. Well, here is a solution that takes _ as well. I used the doi package. \documentclass{article} \usepackage{doi} \usepackage{hyperref} \begin{document} \renewcommand\doitext{Doi: } \doi{10.1007/978-3-540-70575-8_10} \end{document} Hope this will be useful.

15

Another approach is to define a new format that adds links. This can be used in any bibliography macro that applies the title format. In standard styles there are only two of these macros: title and periodical. You can revert to the original style with \DeclareFieldAlias{<new format name>}{default}. The url field is intended to hold only one URL, so ...

15

You can redefine the bibmacro doi+eprint+url so that the doi field is printed only if the url field is not defined, that is, add the following lines in the preamble: \renewbibmacro*{doi+eprint+url}{% \iftoggle{bbx:doi} {\iffieldundef{url}{\printfield{doi}}{}} {}% \newunit\newblock \iftoggle{bbx:eprint} {\usebibmacro{eprint}} {}% ...

12

The modifications made by urlbst are quite clear, so the change you want is actually not too hard (by BibTeX standards). If you open up your .bst files, you need to search for a function called output.web.refs. It needs modifying to read FUNCTION {output.web.refs} { new.block output.url addeprints eprint empty\$ not and { format.eprint ...

12

If you use biber, this might be best handled with the related entries feature supported by biblatex 2.0+. The preamble below defines a new type of related entry: prelim. This key specifies the localization string, formatting directive and bibliography macro used to set the entries given in the related field. \documentclass{article} ...

11

I didn't manage to test for "sort-of-identical" doi und url fields, but here's a solution using biblatex - url and urldate fields will only be typeset if the respective entry doesn't include a doi field. \documentclass{article} \usepackage{biblatex} \DeclareFieldFormat{url}{% \iffieldundef{doi}{% \mkbibacro{URL}\addcolon\space\url{#1}% }{% }% } ...

11

You can use biblatex source remapping features. The code checks whether the doi field is non-null and if it is it clears the isbn field so that it is not printed. \documentclass{article} \usepackage[backend=biber]{biblatex} \addbibresource{t.bib} \DeclareSourcemap{ \maps[datatype=bibtex]{ \map{ \step[fieldsource=doi,final] ...

11

Alternatively, if you want biblatex not to see these fields at all, use biber 0.9.4/biblatex 1.6 and see section 2.1.1 of the biber manual. You are now able to filter out arbitrary fields (and map them to other fields) before biblatex even sees the data.

10

@Lev: that worked, although DOIs can contain special latex characters like underscores, such as: http://dx.doi.org/10.1007/3-540-08755-9_9 So I modified your hack to: \newcommand*{\doi}[1]{\href{http://dx.doi.org/\detokenize{#1}}{doi: \detokenize{#1}}}

10

Yes it is. The DOI is an identifier similar to an URL that will likely be transferred from the printed document by typing it into some search field. As in a URL it is important to have clearly distinguishable letters as one can in many cases not distinguish between some characters from the context (compare for example the minor "L" and the capital "i" that ...

10

The problem is the underscore _ in a doi. It occurs in line 190 of the LaTeX file (or in the .bbl) not in the .bib file. Search for 10.1007/978-0-387-68772-8_18 in your .bib file. You can use the url package and enclose the entry in \url{10.1007/978-0-387-68772-8_18} to avoid the error. Alternatively you can use a bibtex style that knows about dois.

9

From standard.bbx it is apparent that the doi option setting toggles the value of bbx:doi. Loading biblatex with doi=false essentially invokes \togglefalse{bbx:doi}. To enable doi for just a few \fullfootcite commands, use: \AtNextCite{\toggletrue{bbx:doi}}\fullfootcite{<keys>} Note that use of \AtNextCite is appropriate here because the scope of ...

8

If biber is used as backend, then one can use the \DeclareSourcemap facilities to change fields. For the case at hand a solution is to remap url entries with dx.doi.org as initial part using the following code: \DeclareSourcemap{ \maps[datatype=bibtex]{ \map{ \step[ % copies url to doi field if it starts with http://dx.doi.org/ ...

8

One way to proceed is to create a modified version of the file plainnat.bst, in which the functions that format and print fields such as doi and isbn are reduced to stubs that do nothing: Find the file plainnat.bst in your TeX distribution. Make a copy of this file and call it, say, myplainnat.bst. (Don't edit an original file of the TeX distribution ...

8

Since version 1.7 of biblatex, numbers are no longer breakpoints, but can be re-instated with the biburlnumpenalty counter. \setcounter{biburlnumpenalty}{100} in your preamble should allow a break in the DOI.

8

You can do this via mapping of datasources. The \DeclareSourcemap command \DeclareSourcemap{ \maps[datatype=bibtex]{ \map{ \step[fieldsource=url,final] \step[fieldset=doi,null] } } } processes any bibtex input data and for each item in the bibliograhpy file it executes a number of commands given by \step: the first step ...

7

EDIT: Added Title clickable (1. just the title cickable and 2. the whole reference clickable) 1. Just the Title reference clickable You can redefine the title macro and add the \href to the title using the DeclareFieldFormat. I edited the default definitions in the biblatex.def file. \DeclareFieldFormat{title}{\myhref{\mkbibemph{#1}}} \DeclareFieldFormat ...

7

The option ocgcolorlinks doesn't allow line breaks in links. From hyperref's README Experimental option ‘ocgcolorlinks’ The idea are colored links, when viewed, but printed without colors. ... Main disadvantage: Links cannot be broken across lines. In other words, it is almost the same of the option colorlinks, but with two ...

7

Ad 1: These are package options, i.e., your document preamble would include a line like \usepackage[style=<somebiblatexstyle>,doi=false,isbn=false,url=false]{biblatex} Ad 2: TeX Live 2011 includes all you need to use biblatex. However biblatex is a replacement for (among other packages) natbib. Instead of using natbib and its unsrtnat bibstyle, you ...

7

Technical Limitations The technical limitations of using the DOI as bibkey are that they should not contain a character that has special meaning in the .bib file syntax, that is you cannot have a comma , or curly braces {/} because that will make Biber/BibTeX think the bibkey has ended when it hasn't. Additionally one should be wary of special UTF8 ...

Only top voted, non community-wiki answers of a minimum length are eligible