20

this LaTeX code:

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

generates this output (reference 3):

enter image description here

How can I fix the code to show the URL?

5
  • Would you mind sharing a complete - but of course minimal - MWE with us? We would certainly need to know what packages you use to create the bibliography (natbib, biblatex, cite) and what style you use.
    – moewe
    Commented Apr 14, 2014 at 15:53
  • Try url = "http://www.test.org/doe/" Commented Apr 14, 2014 at 15:57
  • url = "test.org/doe" still not shows the URL Commented Apr 14, 2014 at 16:06
  • @moewe I am using bibtex Commented Apr 14, 2014 at 16:07
  • I'm afraid that piece of information is not sufficient to help you. Please provide a proper MWE.
    – moewe
    Commented Apr 14, 2014 at 16:41

3 Answers 3

18

As others have written, it is not clear how you are using this. Suppose for example you have that bib entry in a file url.bib and then just

\documentclass{article}

\begin{document}
\bibliographystyle{plain}
\nocite{*}
\bibliography{url}
\end{document}

That will give a result similar to the one you got. Maybe this is how you have done it. In that case you should have noticed that there was a warning when you ran Bibtex:

Warning--entry type for "Doe" isn't style-file defined

That is, this default style doesn't know about the @online entry type. (So it shows the normal fields in some normal way, but really doesn't know about that url field.)

The traditional way of entering entries like this in Bibtex is like

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

Use \usepackage{url} in your document to get the \url command.

There may be other Bibtex styles that define an entry type @online but chances are you've seen this because Biblatex has such an entry field. So this LaTeX file using Biblatex can use a bib file with the entry you cited.

\documentclass{article}
\usepackage{biblatex}
\addbibresource{url.bib}

\begin{document}
\nocite{*}
\printbibliography
\end{document}
1
  • using @Misc{doemisc, author = {Doe, Ringo}, title = {This is a test entry of type {@ONLINE}}, howpublished = {\url{test.org/doe}}, month = jun, year = 2009} works for me thank you! Commented Apr 14, 2014 at 19:34
18

This easy way worked for me:

Use \bibliographystyle{plainurl} instead of just "plain". This solved everything for me. Enter that command after \bibliography{...}.

Remember to put \usepackage{url}.

3
  • best simplest answer, thx !
    – Welgriv
    Commented Nov 15, 2021 at 14:21
  • The only answer working for me! Commented Dec 14, 2021 at 12:56
  • This idea worked for abbrvurl as well.
    – Tot Zam
    Commented Dec 23, 2021 at 6:01
3

If you're using the \bibliographystyle{plain}, then use the below format in your .bib file:

@inproceedings{vqa-url,
    note = {\url{https://visualqa.org}},
}

and then, to cite the URL in the LaTeX document, simply do:

\cite{vqa-url}

which will then give the plain URL as the result in your references section:

https://visualqa.org

and a corresponding number in the actual text section.

Note: Also, there is no need to use \usepackage{url} in the header section. But, if you want the URL in the references section to be clickable then you MUST use \usepackage{hyperref} in the header section of your LaTeX document.

3
  • 2
    This is already covered in pst's answer above. Besides, there's J R's suggestion to use plainurl, which is possibly better. Commented Dec 5, 2019 at 2:34
  • I tried pst's answer but that doesn't work. In addition, I added some more info about how to make the URL clickable
    – kmario23
    Commented Dec 5, 2019 at 3:48
  • 1
    Short answer made for a better read for me. Upvoted
    – ijuneja
    Commented May 19, 2021 at 11:13

You must log in to answer this question.

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