[Tex/LaTex] Spurious percent symbol in bibtex url

bibtexurls

Using pdflatex and bibtex, this code gives me a spurious percent symbol.

\documentclass[twocolumn]{article}
\usepackage{url}

\begin{document}
hello \cite{hello}.

\bibliographystyle{plain}
\bibliography{android}
\end{document}

bib entry:

@misc{hello,
  author={{John Smith}},
  title={My Title},
  note={\url{http://tex.stackexchange.com/questions/4213/how-to-deal-with-bibliography-items-containing-long-urls}},
}

Rendered doc:

enter image description here

Note the '%' at the end of third line. How to fix it?

Best Answer

bibtex limits the line length and inserts line breaks with preceding percent character. Usually the percent is the comment char, but this is not the case in \url, whose argument is read in verbatim manner.

This issue was fixed in:

% ver 1.6 20-Jun-2002`
% [...] ignore trailing %, [...]

Probably you are using a version of package url that is more than ten years old. The current version is ver 3.3 12-Apr-2006.

An update of package url should fix the problem. Also it might be possible that different versions are installed and the outdated version is found first.

Related Question