[Tex/LaTex] Adding URL to bibtex

bibliographiesbibtexcitingurls

I reference URLs through bibtex like this :

@incollection{PROV,
  title={PROV-O: The PROV Ontology},
  url = "\url{http://www.w3.org/TR/prov-o/}",
  year={2013},
  publisher={W3C Recommendation}
}

But the URL does not appear in the references. I also tried howpublished, but it also does not work.

I also found this citation here [in this post][1], it cannot be compiled at all.

@misc{urlexample,
  author = {jj},
  title = {{jjk}},
  howpublished = "\url{http://aiweb.techfak.uni-bielefeld.de/content/bworld-robot-control-software/}",
  year = {2008}, 
  note = "[Online; accessed 19-July-2008]"
}

Here the class of document and also bibliography style:

 \documentclass[12pt,a4paper]{report}

\bibliographystyle{plain} 

\bibliography{Masterthesis}

Here also the output of compiling Bibetex:

Process started

This is BibTeX, Version 0.99d (TeX Live 2015/Debian) The top-level auxiliary file: Masterthesis_RDD.aux The style file: plain.bst Database file #1: Masterthesis.bib Warning–I didn't find a database entry for "PRPOV" Warning–to sort, need author, organization, or key in WebIndex2016 Warning–to sort, need author or key in OWL Warning–to sort, need author or key in PROV Warning–empty author in OWL Warning–empty booktitle in OWL Warning–empty booktitle in RDFS Warning–empty booktitle in RDF Warning–empty booktitle in SPARQL11 Warning–empty booktitle in SPIN Warning–empty booktitle in SPARQL Warning–empty booktitle in ICV (There were 12 warnings)

Process exited normally

I add MWE here:

.tex :

\documentclass[12pt,a4paper]{report}
\usepackage{url}
\usepackage{hyperref}


\begin{document}



\cite{OWL}
\cite{PROV}
\cite{urlexample}


\newpage
  %bib%

\bibliographystyle{plain} 



\bibliography{exbib}

\end{document}

exbib.bib:

@incollection{OWL,
  title={OWL 2 Web Ontology Language},
  url = "\url{https://www.w3.org/TR/owl2-overview/}",
  year={2012},
  publisher={W3C Recommendation}
}

@misc{urlexample,
  author = {jj},
  title = {{jjk}},
  howpublished = "\url{http://aiweb.techfak.uni-bielefeld.de/content/bworld-robot-control-software/}",
  year = {2008}, 
  note = "[Online; accessed 19-July-2008]"
}


@misc{PROV,
  title={PROV-O: The PROV Ontology},
  url = {http://www.w3.org/TR/prov-o/},
  year={2013},
  publisher={W3C Recommendation}
}
  [1]: http://tex.stackexchange.com/questions/35977/how-to-add-a-url-to-a-latex-bibtex-file

Best Answer

The plain bibliography style dates back to about 1994 and is thus not programmed to do anything with a field called url. (In the early 1990s, I don't think that too many people were facing the problem of citing electronically published documents that were available online. Recall that the first decent graphical browser, netscape, wasn't released until some time in late 1994.)

You should (a) load the natbib citation management package with the option numbers along with the url package, (b) change the bibliography style from plain to plainnat, and (c) change the contents of the url fields as follows: Instead of

url = "\url{https://www.w3.org/TR/owl2-overview/}",

write

url = "https://www.w3.org/TR/owl2-overview/",

The output of a full MWE:

enter image description here

\RequirePackage{filecontents}
\begin{filecontents}{exbib.bib}
@incollection{OWL,
  title={{OWL 2 Web Ontology Language}},
  url = "https://www.w3.org/TR/owl2-overview/",
  year= {2012},
  publisher={W3C Recommendation}
}
@misc{urlexample,
  author = {jj},
  title  = {jjk},
  url    = "http://aiweb.techfak.uni-bielefeld.de/content/bworld-robot-control-software/",
  year = {2008}, 
  note = "[Online; accessed 19-July-2008]"
}
@misc{PROV,
  title={{PROV-O: The PROV Ontology}},
  url = {http://www.w3.org/TR/prov-o/},
  year={2013},
  publisher={W3C Recommendation}
}
\end{filecontents}

\documentclass[12pt,a4paper]{report}
\usepackage[hyphens,spaces,obeyspaces]{url}
\usepackage[colorlinks,allcolors=blue]{hyperref}
\usepackage[numbers]{natbib}
\bibliographystyle{plainnat} 
\begin{document}

\cite{OWL}
\cite{PROV}
\cite{urlexample}

\newpage
\bibliography{exbib}

\end{document}
Related Question