325

I'm using bibtex for my bibliography in LaTeX. I have some URL's I need to cite in the paper. How do I add URLs into the .bib file?

A typical section in my .bib file looks like this:

@conference{eigenfacepaper,
  title={{Face recognition using eigenfaces}},
  author={Turk, M. and Pentland, A.},
  booktitle={Proc. IEEE Conf. on Computer Vision and Pattern Recognition},
  volume={591},
  year={1991}
}

I tried some misc sections in bibtex but they don't show up in my document.

1

6 Answers 6

385

The last time I cited a URL, I used a BibTeX entry of the following form:

@misc{bworld,
  author = {Ingo Lütkebohle},
  title = {{BWorld Robot Control Software}},
  howpublished = "\url{http://aiweb.techfak.uni-bielefeld.de/content/bworld-robot-control-software/}",
  year = {2008}, 
  note = "[Online; accessed 19-July-2008]"
}

If that does not show up, then it might indeed be a problem with your BibTeX style (or you forgot to \usepackage{url} or \usepackage{hyperref} in your main .tex file).

8
  • 60
    Don't forget to add \usepackage{url} in your tex file; doesn't work for me otherwise.
    – nedned
    Commented May 3, 2010 at 2:49
  • 38
    \usepackage{hyperref} is rather more powerful and flexible than \usepackage{url}.
    – Mohan
    Commented Oct 18, 2012 at 15:23
  • 3
    Is it wise, or even appropriate, to use both? Or will they clash at some point? Commented Feb 18, 2016 at 10:38
  • Are double brackets in title usefull? Or typed there by mistake?
    – koleygr
    Commented Jul 1, 2017 at 19:51
  • 4
    @koleygr I think they stop the automatic capitalization from changing the title (so BWorld stays BWorld and doesn't become Bworld)
    – David
    Commented Jul 2, 2017 at 9:41
76

You need to

 \usepackage{url}

and then

 howpublished={\url{http://my.url.com/}},
2
  • This doesn't really fit into my bibtex file
    – Janusz
    Commented Nov 18, 2009 at 13:39
  • Use hyperref instead of url package if links don't work due to linebreaks. Commented Feb 9, 2021 at 17:42
54

Depends what BibTeX style you're using. In the ordinary ones I usually use

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

in biblatex (and natbib too, I think), you can just write

url={http://...}
1
19

To use url with a plain bibliography style you can use this format:

@misc{Doe:2009:Online,
author = {author},
title = {Title of Citation},
year = {2010 (accessed December 7, 2014)}, 
howpublished = "\url{http://www.myurl.com}"}

Additionally you need to add the url package

\usepackage{url}

If you want to use the url attribute in you need to use natbib because standard bibstyles (such as plain) will not typeset the url key contents of the individual entries; it is required to use one of natbib's own entries, e.g. plainnat.

For example

@ONLINE{Doe:2009:Online,
author = {Doe, Ringo},
title = {This is a test entry of type {@ONLINE}},
month = jun,
year = {2009},
url = {http://www.test.org/doe/}
}

and the document

\documentclass{article}

\usepackage{biblatex}
\bibliography{test.bib}

\title{BibTeX Website citatations with the \textsf{biblatex}~package}
\date{}

\begin{document}

\maketitle
\nocite{Doe:2009:Online}
\printbibliography

\end{document}

Source: http://nschloe.blogspot.ro/2009/06/bibtex-how-to-cite-website_21.html

3
  • This would be better as a comment on the accepted answer. Post it on gist.github.com (don't forget to add the .tex extension for syntax highlighting) and paste the link as your comment :) Commented Dec 7, 2014 at 22:13
  • 5
    Hi Sean. I really have to disagree with you on that. First Im not really only extending on the accepted answer but providing additional information and second I think it is bad practice to provide essential info in a comment. I think it is better to edit the original answer (if only extending a little when the answer is very popular) or provide a new one. In my case I compiled infos from different answers into a new one bc I think all of them do only tackle part of the question.
    – Patrick
    Commented Dec 7, 2014 at 22:21
  • If the information is truly essentially helpful, then it would do more good as an edit to the vastly popular answer – it simply won't help anyone down here :( Additionally, this answer is self-contradictory – it doesn't use natbib, but rather the separate (and better IMO) BibLaTeX. Commented Dec 7, 2014 at 22:26
7

Correct me if I'm wrong, but I think you are trying to reference websites and not articles in a journal, for instance. And, having placed said references in a misc entry, they don't show up when you reference them. If that is correct, then the problem is your bibliography style (bst file) does not have an entry in it for dealing with a misc type. I would suggest that you use biblatex as it highly customizable and includes an online entry type specifically for your purpose. Alternatively, you could use custom-bib, which will give you a custom bst file that would display a misc entry. However, I think biblatex is still your best bet.

1
  • It would be most unusual for a bibliography style not to recognize the extremely common @misc entry type. In fact, such a style would have to be considered to be broken.
    – Mico
    Commented Nov 9, 2014 at 22:53
7

The TEX FAQ used to have really good answers for TeX related questions: URLs in BibTeX bibliographies:

@misc{...,
  ...,
  howpublished = "\url{http://...}"
}
1

You must log in to answer this question.

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