[Tex/LaTex] Display URL in natbib and apalike-fr references

apa-stylebibtexnatbib

I have a problem with natbib and apalike-fr when it comes to referencing websites.

The website links don't show up in the references.

This is an example of the LaTeX code :

\documentclass[12pt]{book}
\usepackage[square,sort,comma,numbers]{natbib}
\begin{document}

Hello world! \\

As said \citet{Dong2015} and \citet{Statista2017}, this is a test.

\bibliography{mybib}
\bibliographystyle{apalike-fr}

\end{document}

This is the content of the mybib.bib file :

@misc{Statista2017,
author = {Statista},
title = {{Global mobile data traffic from 2016 to 2021 (in exabytes per month)}},
url = {https://www.statista.com/statistics/271405/global-mobile-data-traffic-forecast/},
year = {2017}
}

@article{Dong2015,
abstract = {abstract},
author = {Dong, Wenqiang and Wang, Fulai and Huang, Yu and Xu, Guangluan and Guo, Zhi and Fu, Xingyu and Fu, Kun},
doi = {10.1016/j.cag.2014.10.001},
file = {fileaddress},
isbn = {1880148536},
issn = {00978493},
journal = {Computers and Graphics (Pergamon)},
keywords = {Force-directed,Graph drawing,Graph visualization,PageRank},
pages = {24--33},
publisher = {Elsevier},
title = {{An advanced pre-positioning method for the force-directed graph visualization based on pagerank algorithm}},
url = {http://dx.doi.org/10.1016/j.cag.2014.10.001},
volume = {47},
year = {2015}
}

This is the result of the compilation :

Text

References

As you can see, both of the references contain URLs but non of them is displayed. It may be OK with the journal article, but not when it comes to the webiste.

What can I do to correct that?

Best Answer

You can use apacite like here:

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@misc{Statista2017,
  author = {Statista},
  title  = {{Global mobile data traffic from 2016 to 2021 (in exabytes per month)}},
  url    = {https://www.statista.com/statistics/271405/global-mobile-data-traffic-forecast/},
  year   = {2017},
}
@article{Dong2015,
  abstract = {abstract},
  author = {Dong, Wenqiang and Wang, Fulai and Huang, Yu and 
            Xu, Guangluan and Guo, Zhi and Fu, Xingyu and Fu, Kun},
  doi = {10.1016/j.cag.2014.10.001},
  file = {fileaddress},
  isbn = {1880148536},
  issn = {00978493},
  journal = {Computers and Graphics (Pergamon)},
  keywords = {Force-directed,Graph drawing,Graph visualization,PageRank},
  pages = {24--33},
  publisher = {Elsevier},
  title = {{An advanced pre-positioning method for the force-directed graph visualization based on pagerank algorithm}},
  url = {http://dx.doi.org/10.1016/j.cag.2014.10.001},
  volume = {47},
  year = {2015},
}
\end{filecontents*}


\documentclass{article}

%\usepackage[square,sort,comma,numbers]{natbib}
\usepackage[%
% numberedbib,
  natbibapa
]{apacite} 
\usepackage[hyphens]{url}


\begin{document}
As said \citet{Dong2015} and \citet{Statista2017}, this is a test.

\bibliographystyle{apacite}
\bibliography{\jobname}
\end{document}

with the result:

apacite result

or you can use biblatex and biber like here:

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@misc{Statista2017,
  author = {Statista},
  title  = {{Global mobile data traffic from 2016 to 2021 (in exabytes per month)}},
  url    = {https://www.statista.com/statistics/271405/global-mobile-data-traffic-forecast/},
  year   = {2017},
}
@article{Dong2015,
  abstract = {abstract},
  author = {Dong, Wenqiang and Wang, Fulai and Huang, Yu and 
            Xu, Guangluan and Guo, Zhi and Fu, Xingyu and Fu, Kun},
  doi = {10.1016/j.cag.2014.10.001},
  file = {fileaddress},
  isbn = {1880148536},
  issn = {00978493},
  journal = {Computers and Graphics (Pergamon)},
  keywords = {Force-directed,Graph drawing,Graph visualization,PageRank},
  pages = {24--33},
  publisher = {Elsevier},
  title = {{An advanced pre-positioning method for the force-directed graph visualization based on pagerank algorithm}},
  url = {http://dx.doi.org/10.1016/j.cag.2014.10.001},
  volume = {47},
  year = {2015},
}
\end{filecontents*}


\documentclass{article}

\usepackage[%
  backend=biber,
  style=apa,
  natbib=true
]{biblatex}
\addbibresource{\jobname.bib}


\begin{document}
As said \citet{Dong2015} and \citet{Statista2017}, this is a test.

\printbibliography
\end{document}

with the result:

biblatex result

Related Question