3

I am trying to hyperrefan URL using class scrartcl, Bibtex, package natbib and bibliography style authordate1. The paper is characterised as @article in the .bibfile and as the URL entry is not used in @article I inserted it into the entry note. This works all fine but I would like to be able to click onto the URL and be led to the place in the internet. How can this be done? Furthermore, is it possible to hide the ugly URL behind a clickable hyperref, e.g. the DOI behind the journal abbreviation and the ADS (Astrophysics Data System) behind the paper pages?

.bib entry:

% This file was created with JabRef 2.10.
% Encoding: UTF8


@Article{Schwamb2010,
Title                    = {Properties of the Distant Kuiper Belt: Results from the Palomar Distant Solar System Survey},
Author                   = {(Megan E.) Schwamb and (Michael E.) Brown and (David L.) Rabinowitz and Darin Ragozzine},
Journal                  = {The Astrophysical Journal},
Year                     = {2010},

Month                    = {September},
Note                     = {{\url{http://adsabs.harvard.edu/abs/2010ApJ...720.1691S}}},
Number                   = {2},
Pages                    = {1691},
Volume                   = {720},

Doi                      = {http://dx.doi.org/10.1088/0004-637X/720/2/1691},
Timestamp                = {2014.09.21},
Url                      = {http://m.iopscience.iop.org/0004-637X/720/2/1691/pdf/0004-637X_720_2_1691.pdf}
}
  • 1
    Please post a representative bib entry. By the way, the name of the field should probably be note, not notes. Furthermore, it's too general to say that "there is no URL [field] in @article": Which fields are recognized by BibTeX is determined by the bibliography style in use -- here: authordate2. Other bibliography styles (e.g., plainnat) do provide code so that BibTeX can process fields named url in entries of type @article. – Mico Oct 4 '14 at 4:23
  • Isn't there a way around the 'makebst' and keep a bibliography style with an overall appearance of the references while just adding some more informations like URLs, DOI and hyperref these? – Lucas Oct 4 '14 at 10:14
  • The bibliography style file is BibTeX's exclusive source of information on how each entry, and each field within a given entry, should be formatted. If you don't want to use a given style file, all you can do is to either edit it or switch to a different style file altogether. The style file authordate1.bst appears to be quite old, having been changed most recently in March 1990 -- when the Web was still mostly a gleam in Tim Berners-Lee's eyes... Its venerable age (almost certainly) explains why the style file doesn't do anything with fields such as url, doi, and eid, right? – Mico Oct 4 '14 at 10:31
2

You ask:

This works all fine but I would like to be able to click onto the URL and be led to the place in the internet. How can this be done?

It looks like you have one too many pairs of curly braces encasing the contents of the note field. Instead of writing

Note = {{\url{http://adsabs.harvard.edu/abs/2010ApJ...720.1691S}}},

you should write

Note = {\url{http://adsabs.harvard.edu/abs/2010ApJ...720.1691S}},

enter image description here

Incidentally, why do you surround the first names and middle initials of the first three authors -- but not the first name of the fourth author -- with round parentheses?

\documentclass{scrartcl}
\usepackage{natbib,url,hyperref}
\hypersetup{colorlinks,allcolors=blue}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Article{Schwamb2010,
Title                    = {Properties of the Distant Kuiper Belt: Results from the Palomar Distant Solar System Survey},
Author                   = {(Megan E.) Schwamb and (Michael E.) Brown and (David L.) Rabinowitz and Darin Ragozzine},
Journal                  = {The Astrophysical Journal},
Year                     = {2010},

Month                    = {September},
Note                     = {\url{http://adsabs.harvard.edu/abs/2010ApJ...720.1691S}},
Number                   = {2},
Pages                    = {1691},
Volume                   = {720},

Doi                      = {http://dx.doi.org/10.1088/0004-637X/720/2/1691},
Timestamp                = {2014.09.21},
Url                      = {http://m.iopscience.iop.org/0004-637X/720/2/1691/pdf/0004-637X_720_2_1691.pdf}
}
\end{filecontents*}
\begin{document}
\nocite{*}
\bibliographystyle{authordate1}
\bibliography{\jobname}
\end{document}

You also asked:

Furthermore, is it possible to hide the ugly URL behind a clickable hyperref, e.g. the DOI behind the journal abbreviation and the ADS (Astrophysics Data System) behind the paper pages?

This can also be done (though I'm not sure how advisable it is do so...). Just replace the original contents of the journal and pages fields with {\href{...}{original content}. E.g.,

Journal = {\href{http://dx.doi.org/10.1088/0004-637X/720/2/1691}{The Astrophysical Journal}},

and

Pages = {\href{http://adsabs.harvard.edu/abs/2010ApJ...720.1691S}{1691}},

Doing so will generate the following output:

enter image description here

\documentclass{scrartcl}
\usepackage{natbib,url,hyperref}
\hypersetup{colorlinks,allcolors=blue}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Article{Schwamb2010,
Title                    = {Properties of the Distant Kuiper Belt: Results from the Palomar Distant Solar System Survey},
Author                   = {Megan E. Schwamb and Michael E. Brown and David L. Rabinowitz and Darin Ragozzine},
Journal                  = {\href{http://dx.doi.org/10.1088/0004-637X/720/2/1691}{The Astrophysical Journal}},
Year                     = {2010},
Month                    = {September},
Number                   = {2},
Pages                    = {\href{http://adsabs.harvard.edu/abs/2010ApJ...720.1691S}{1691}},
Volume                   = {720},
Timestamp                = {2014.09.21},
}
\end{filecontents*}
\begin{document}
\nocite{*}
\bibliographystyle{authordate1}
\bibliography{\jobname}
\end{document}
  • :Good point with the round parentheses of the last author name. – Lucas Oct 4 '14 at 13:26
  • Concerning the curly brackets around the URL - also good point -, they do not seem to have any effect in the final pdf or create any warning or error so far. – Lucas Oct 4 '14 at 13:27
  • I produce the .bib file with an external programm called JabRef because this expectation: when you insert into your .tex-code the \begin{filescontents}...\end{filescontents} with 30 papers, does your .tex-code not become unpleasantly long and nasty? So what does \jobname.bib actually do and can't you do this external of the .tex-code? – Lucas Oct 4 '14 at 13:32
  • 1
    @Lucas - The filecontents device is just to make the example fully self-contained. For a real example, you'd place the bib entries in a separate file (with extension .bib). You can name your bib file (almost) anything you want; e.g., if you'd name it references.bib, you'd issue the command \bibliography{references} instead of \bibliography{\jobname}. – Mico Oct 4 '14 at 13:35
  • Ah that's what the filecontent-command is for. Great clarification! – Lucas Oct 4 '14 at 22:03
0

Answer to the first question: how can an URL in a note-entry be clickable? By using this command:

note={\url{http://...}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.