# Tag Info

33

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

21

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

20

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

19

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

18

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.

18

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

16

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

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

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

11

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 ... 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 @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 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}% }{% }% } ... 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 ... 9 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}} {}% ... 8 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 ... 7 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. 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 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/ ... 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 ... 6 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 ... 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 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 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 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

With the help of experts, here is one solution that satisfies oai requirements. The oai references require a repository and a number such as, for instance oai:hal.example.com:hal-0000001 that can be used to reconstruct the actual internet address of the document of interest, here : http://hal.example.com/hal-000001/ the eprint and eprinttype fields together ...

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