10

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.

5
  • Which bibliography style do you employ?
    – Mico
    Commented Dec 26, 2016 at 21:17
  • @Mico Vancouver. Commented Dec 26, 2016 at 21:18
  • @Mico I am including that in the question as well. Commented Dec 26, 2016 at 21:18
  • 2
    The url package provides the \urlstyle declaration to set the style used for printing the URL; for example, \urlstyle{same} “uses the current text font” (documentation of the url package, section 3). You might also want to have a look at the \DeclareUrlCommand declaration (described in section 4) and to section 5 of the same manual.
    – GuM
    Commented Dec 26, 2016 at 21:29
  • 1
    @Mico: Yes, obviously, thanks for noting. :-) But I see that you were already writing an answer along these lines, so I should probably remove my comment.
    – GuM
    Commented Dec 26, 2016 at 21:33

2 Answers 2

11

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}
1
  • 1
    thanks, that worked. I looked into the url package documentation too, for more details. Commented Dec 26, 2016 at 21:36
4

urlstyle{rm} should be enough in most cases. See the example.

\documentclass{article}

\usepackage{url} 
\begin{document}

\section{Introduction}

\begin{thebibliography}{1}
\bibitem{1}
\url{VeryVeryVeryVery.VeryVeryVeryVeryVery.VeryVeryVeryVery.VeryVeryVeryVeryVeryVeryVeryLongUrl}

\urlstyle{rm}
\bibitem{2}
\url{VeryVeryVeryVery.VeryVeryVeryVeryVery.VeryVeryVeryVery.VeryVeryVeryVeryVeryVeryVeryLongUrl}
\end{thebibliography}
\end{document}

enter image description here

Edit: According to Mico's suggestion, one additional explanation. The manual states:

The pre-defined styles are “tt”, “rm”, “sf” and “same” which all allow the same linebreaks but use di.erent fonts — the first three select a specific font and the “same” style uses the current text font.

10
  • Thanks. Isn't same a better choice than rm if the latter is a specific font? Commented Dec 26, 2016 at 21:41
  • 1
    @VineetPayyappalli I understand your "plain text" as roman, not typewriter. Am I wrong? Commented Dec 26, 2016 at 21:46
  • @PrezmyslawScherwentke yes it's plain text. Commented Dec 26, 2016 at 21:47
  • 1
    @VineetPayyappalli See the extended version of my answer. As far as I understand, the only reason of avoiding url package is the policy of a journal, which doesn't want the typewriter font. Commented Dec 26, 2016 at 22:30
  • 2
    @VineetPayyappalli I think, incorporating this information by editing your original question will be enough. Commented Dec 27, 2016 at 1:42

You must log in to answer this question.

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