[Tex/LaTex] How to break a long URL in bibliography, keeping the URL in plain text font

bibliographiesline-breakingurls

I am preparing a paper for a journal which insists that URLS in bibliography need to be in plain text (and not in the style that \url{long_url_here} provides). A URL that I am using is very long and continues in the same line without breaking to next line. I know that it breaks when I use \url{} command, but not when I just use a note in the bib file such as:

@misc{epl,
title={Premier league clubs in international competition},
author="{Wikipedia}",
year={2016},
note="{Available at: https://en.wikipedia.org/wiki/Premier\_League#Premier\_League\_clubs\_in\_international\_competition, Accessed on December 26, 2016}",
}

My preamble is

\documentclass{risa}
\usepackage{graphicx}
\usepackage{natbib}
\usepackage{epstopdf}
\usepackage{tabularx}
\usepackage[figuresright]{rotating}
\usepackage{amsmath, amssymb}
\newtheorem{prop}{Proposition}
\usepackage{mathtools, cuted}

I am using \bibliographystyle{vancouver} and I use risa document class available from: http://onlinelibrary.wiley.com/journal/10.1111/%28ISSN%291539-6924/homepage/ForAuthors.html. Download link: http://www.blackwellpublishing.com/pdf/risa.zip.

Also, I do not understand why I have to use backslashes before the underscores in the URL, despite using the quotations before and after the opening and closing braces respectively for note={} in the bib file.

Any help on figuring out the problems here is appreciated. Thank you.

Best Answer

URL strings can contain lots of characters that are "special" to TeX. Among them are _ (underscore), # (hash), % (percent), $ (dollar), & (ampersand), etc. The point of encasing URL strings in \url directives is to "neuter" the special meanings that these characters would otherwise possess.

I am preparing a paper for a journal which insists that URLs in bibliography need to be in plain text.

I assume that the ordinary text font (rather than some monospaced font) is meant by "plain text". This requirement does not mean that you mustn't use the url package and \url directives. All you need to do to adhere to the publisher's requirement is issue the instruction \urlstyle{same}. The advantage of not "escaping" the special characters (by prefixing them with \ symbols) is that the URL strings remain untouched and hence can be used to form valid hyperlinks to the underlying documents.

enter image description here

\RequirePackage{filecontents}
\begin{filecontents}{mybib.bib}
@misc{epl,
title={Premier league clubs in international competition},
author="{Wikipedia}",
year={2016},
note="{Available at: \url{https://en.wikipedia.org/wiki/Premier_League#Premier_League_clubs_in_international_competition}, Accessed on December 26, 2016}",
}
\end{filecontents}

\documentclass{risa}
%\usepackage{natbib} %not really needed, is it?
\bibliographystyle{vancouver}
\usepackage{url}
\urlstyle{same} % <-- be sure to provide this instruction
\usepackage[colorlinks,citecolor=blue,urlcolor=black]{hyperref}

\begin{document}
\cite{epl}
\bibliography{mybib}
\end{document}