3

This question arises from discussion of my earlier question about URLs and BibTeX, I am looking for a solution that works smoothly with primarily web-based references.

I have .bib files which contain a large number of primarily online sources for which it is essential that information such as the URL, date accessed and date published be included in the bibliography.

Which tools/packages are best able to handle references to web-based sources, and which entry type(s) should I be using in my .bib file?

6
  • 1
    Could you clarify your question? You seem to be conflating at least 2 things. First, there is the issue of the tool-and-package e.g. BibTeX with or without additions such as natbib and with whatever style or BibLaTeX with Biber (preferably) or BibTeX (if necessary). Second, if you use a .bib database file as you would with either of those approaches, there is the question of which entry type is best suited to online sources. But these are different, though connected, questions, and it would be helpful to clarify which interest you. (This is tagged bibtex which suggests NOT biblatex.)
    – cfr
    Nov 9, 2014 at 22:52
  • I've adjusted the tags to reflect the way I understand your question. Feel free to edit again if I've misunderstood. (You are definitely not interested in cross-referencing, though, and your question has nothing to do with your OS or editor.)
    – cfr
    Nov 9, 2014 at 22:54
  • @cfr I am not qualified enough to assess your comment. I am trying to get some sort of holistic understanding over different methods. I have earlier used \url{...} method in references with bibtex, without understanding what is happening. Perhaps you could write an answer explaining different methods?
    – hhh
    Nov 9, 2014 at 23:03
  • 1
    I've tried to clarify your question. Feel free to revert my changes if they do not reflect your intentions.
    – cfr
    Nov 9, 2014 at 23:36
  • I answered your comment but you deleted it?
    – cfr
    Nov 10, 2014 at 1:05

3 Answers 3

6

BibLaTeX, especially when used with Biber, offers the most powerful and sophisticated handling of bibliographies. It has been designed with web resources in mind from the start and offers extremely nice ways to format a range of resources.

For example:

  • all entry types support the url and urldate fields for specifying URLs and dates accessed;
  • all entry types support doi and @article supports eid;
  • dedicated @online entry type for specifically web-based resources;
  • the eprint, eprinttype and eprintclass fields are available which allow much neater, more concise formatting of references for electronic resources e.g. you can use the JSTOR reference rather than giving the full URL and, if hyperref is loaded, the information will be hyperlinked automatically;
  • you can easily extend the eprint facility to cover additional resources.

For example, to add a JSTOR paper, I would use something like this:

@article{some-paper,
  author     = ...
  eprint     = {123456789},
  eprinttype = {jstor},
  ...}

For resources which are not known to BibLaTeX by default, I extend the eprint facility by including additions in a personal biblatex.cfg. For example, here is the code I use for eprinttype gutenberg:

\DeclareFieldFormat{eprint:gutenberg}{%
  Project\space Gutenberg\space ebook\addcolon\space
    \ifhyperref
        {\href{http://www.gutenberg.org/ebooks/#1}{\nolinkurl{#1}}}
    {\nolinkurl{#1}}}
    \DeclareFieldAlias{eprint:GUTENBERG}{eprint:gutenberg}

Then I can use something like this in my .bib file:

@article{some-ebook,
  author     = ...
  eprint     = {123456789},
  eprinttype = {gutenberg},
  ...}

Additional styles may extend these facilities further and styles are generally easier to customise than is the case for BibTeX files. (You don't need to speak bst to change things!)

You can also use remote databases directly in some cases and use a wider range of downloadable bibliographical database formats. (You are not restricted to .bib files.)

Here is an example based on the sample .bib file supplied with biblatex:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{csquotes}
\usepackage[sort cites=true, backend=biber]{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
  \cite{ctan,kastenholz,baez/article,wilde,baez/online,itzhaki,wassenberg,markey,sigfridsson}
  \printbibliography
\end{document}

Sample online resources with BibLaTeX

To compile:

pdflatex <filename>.tex
biber <filename>
pdflatex <filename>.tex

You could replace pdflatex with latex, xelatex or lualatex as required.

2
  • @hhh If you have MacTeX then you have TeX Live which will behave in the same way independent of your OS and editor. I do not know whether TeXPad has buttons or shortcuts to run biber or whether you can customise this as I am not familiar with it. So that part I cannot answer. (But I would be surprised if it did not provide an easy way to run biber.) But certainly you could produce this result as easily as I can if, for example, you used the command line. [Note that I'm not saying you would need to - I doubt you would. Only that I cannot say for sure about your editor's facilities.]
    – cfr
    Nov 10, 2014 at 1:03
  • Thank you for encouraging +1! Biber works beautifully in TexPad OSX, I made an answer showing all steps in getting it to work here -- always nice to get encouraged and encourage others to awesome results. This will improve my production time so much! Thank you! :)
    – hhh
    Nov 10, 2014 at 1:32
2

Biber works so nicely with TexPad OS X and BibDesk and with a lot of online sources.

Instructions to switch from Bibtex to Biber (source) in TexPad OSX

Typesets and compiles the bibliography file. The underlying bibliography engine is set in the Preferences' window (current options include BibTeX and Biber). Chain: pdfLaTeX BibTeX/Biber pdfLaTeX pdfLaTeX.

enter image description here

Examples

I think Biber is far better to Bibtex with a lot of online material. I don't need to waste time with the \url{...} mess. You can see the result of unmodified references.bib file from BibDesk. In the Bibtex case, I should still do manual edits eating productive time to zero. Biber rules!

Biber

enter image description here

Bibtex

enter image description here

MWE working out of the box with MacTex 2014

\documentclass[11pt]{article}
\usepackage{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@webpage{TAPoverNabuccoDefeatEU,
    Date-Added = {2014-11-09 19:59:57 +0000},
    Date-Modified = {2014-11-09 20:01:28 +0000},
    Lastchecked = {September 21th, 2014},
    Month = {July},
    Title = {TAP Wins on Nabucco: A Total Defeat for the EU},
    Url = {http://eastbook.eu/en/2013/07/material-en/news-en/tap-wins-on-nabucco-a-total-defeat-for-the-eu/},
    Year = {2013}}

@electronic{NordStream,
    Date-Added = {2014-11-09 17:47:19 +0000},
    Date-Modified = {2014-11-09 18:23:12 +0000},
    Lastchecked = {Nov 11th, 2014},
    Title = {NordStream's official website},
    Url = {http://www.nord-stream.com/},
    Bdsk-Url-1 = {http://www.nord-stream.com/}}

@article{EnergyPoliciesReviewEU,
    Author = {International Energy Agency},
    Date-Added = {2014-11-09 20:42:47 +0000},
    Date-Modified = {2014-11-09 20:44:55 +0000},
    Lastchecked = {November 21th, 2014},
    Pages = {62},
    Title = {Energy Policies Review: The European Union},
    Url = {http://www.iea.org/publications/freepublications/publication/eu2008.pdf},
    Year = {2008}}

@url{PohjoinenLaivasto,
    Date-Added = {2014-11-09 17:53:07 +0000},
    Date-Modified = {2014-11-09 17:54:33 +0000},
    Lastchecked = {November 5th, 2014},
    Title = {Pohjoinen laivasto saa yli 40 alusta},
    Url = {http://finnish.ruvr.ru/news/2014_04_08/Pohjoinen-laivasto-saa-yli-40-alusta-6885/},
    Bdsk-Url-1 = {http://finnish.ruvr.ru/news/2014_04_08/Pohjoinen-laivasto-saa-yli-40-alusta-6885/}}
\end{filecontents}

\addbibresource{\jobname.bib}
\begin{document}

\cite{NordStream} and Vessels \cite{PohjoinenLaivasto}.
Gas to the TAP \cite{EnergyPoliciesReviewEU, TAPoverNabuccoDefeatEU}.

\printbibliography
\end{document}
1
  • @cfr precisely :D Useful soft landing to all of my friends, collegues and other perfectionists having the irritating problem with a massive number of online content with the best editor I have found so far :)
    – hhh
    Nov 10, 2014 at 1:44
1

I am gathering here choices about different methods to reference material properly with urls and other webpage-based material.

Choices

  1. @misc entry type and howpublished=\url{...} field with Bibtex, instructions here

  2. BibLatex method as instructed here, I haven't been able to get it compiled nicely

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .