Tag Info

29

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*} ...

19

I use the default example bib from current biblatex documentation which is available on every system. 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} \ExecuteBibliographyOptions{doi=false} ...

18

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 ...

17

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.

17

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 ...

15

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 ...

14

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.

13

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 ...

13

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 = ...

12

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 ...

12

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. ...

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

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} ...

10

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 ... 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}}} 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 ... 7 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/ ... 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 ... 6 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}% }{% }% } ... 6 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 ... 5 doi.sty depends upon hyperref. It is generally recommended that hyperref be the last package you load because of the way it redefines various macros (in order to get hyperreferencing to work). So, this is mostly a similar case where the commands needed to get pstricks to work under pdflatex are also redefined by hyperref. You might want to check out ... 5 I stumbled over this issue and it annoyed me as well so I invested some time and came up with a VEEERRRYYY simple little webtool: http://doi-to-bibtex.herokuapp.com I might invest some more time at some point, but got now it just WORKS!! 5 It is possible to obtain the bibliographic information associated with a doi in XML format (except the abstract) via a web query to crossref.org. I've have been following instructions at http://labs.crossref.org/site/quick_and_dirty_api_guide.html and the service works as advertised. 5 I wrote a short program that takes the BIB+AUX files and outputs an HTML file with all DOIs, obtained by querying CrossRef; see the code below. It would be great to modify the program so that the DOIs are written back to the original BIB file. If anyone is willing to help with this, please let me know! The program uses bibtool, as well as the Python package ... 5 In the linked question is used another bibliography driver. EDIT 2: Comment by maetra: I recognized that using this together with any of the author-year styles results in an extra space after the link if no pages are defined. Maybe you know a solution? Solution: In the version 1.6 of biblatex is a small bug in the file authoryear.bbx. The style ... 5 Search-and-replace is possible using BibTeX. The excellent Tame the BeaST suggests INTEGERS{ l } FUNCTION{ string.length } { #1 'l := {duplicate$ duplicate$#1 l substring$ = not} {l #1 + 'l :=} while$pop$ l } STRINGS{replace find text} INTEGERS{find_length} FUNCTION{find.replace} { 'replace := 'find := 'text := find string.length ...

5

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.

5

One way to make BibTeX ignore fields such as doi and issn is to set the BibTeX functions that format these fields to a "dummy" instruction that does nothing at all. These functions (and all other BibTeX functions) are contained in the bibliography style file that's in use. Since you indicate that you use the unsrtnat bibliography style, you could proceed as ...

5

This works fluently, no need to escape any chars. Our macro \xx@doi is only a modification of original \@doi to treat the optional argument. In \x@doi we store the original \@doi so that we can redefine \@doi. \documentclass{article} \usepackage{hyperref} \usepackage{doi} \makeatletter \let\x@doi\@doi \def\@doi{\@ifnextchar[\xx@doi\x@doi} ...

5

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 ...

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