Tag Info

Hot answers tagged

38

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.


37

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


23

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


23

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


23

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


19

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

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


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


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


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


13

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


13

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


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


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


10

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


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

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


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

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


8

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

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

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.


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

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



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