Monday, 26 August 2013

Bibtex (TexLive 2013) doesn't escape & in url

Bibtex (TexLive 2013) doesn't escape & in url

Bibtex (TexLive 2013 on ubuntu) doesn't escape the & specifically in urls.
The % escapes but not &.
For example I have the following ref:
@article{benson1975,
title = {The Interorganizational Network as a Political Economy},
volume = {20},
issn = {00018392},
url =
{http://www.jstor.org/discover/10.2307/2391696?uid=3737664&uid=2134&uid=2129&uid=2&uid=70&uid=4&sid=21102581457607},
doi = {10.2307/2391696},
number = {2},
urldate = {2013-08-25},
journal = {Administrative Science Quarterly},
author = {Benson, J. Kenneth},
month = jun,
year = {1975},
pages = {229}
}
and when I cite it the bbl files keeps the & intact like this:
\htmladdnormallink{$<$http:\-/\-/www\-.jstor\-.org\-/discover\-/10\-.2307\-/2391696?uid=3737664&uid=2134&uid=2129&uid=2&uid=70&uid=4&sid=21102581457607$>$}{http://www.jstor.org/discover/10.2307/2391696?uid=3737664&uid=2134&uid=2129&uid=2&uid=70&uid=4&sid=21102581457607}.}
When I manual replace the & inside the \htmladdnormallink with \& LaTeX
compiles perfectly so I'm sure that is there is a way to escape the & it
would work like a charm.
Note that escaping the & on BibTeX (\&) doesn't work (works outside of
urls, but not in urls). The bbl result is {\textbackslash} & instead of
\&:
\htmladdnormallink{$<$http:\-/\-/www\-.jstor\-.org\-/discover\-/10\-.2307\-/2391696?uid=3737664{\textbackslash}&uid=2134{\textbackslash}&uid=2129{\textbackslash}&uid=2{\textbackslash}&uid=70{\textbackslash}&uid=4{\textbackslash}&sid=21102581457607$>$}{http://www.jstor.org/discover/10.2307/2391696?uid=3737664\&uid=2134\&uid=2129\&uid=2\&uid=70\&uid=4\&sid=21102581457607}.}
If it makes a difference, I'm using:
\documentclass[
article,
11pt,
oneside,
a4paper,
english,
brazil
]{abntex2}
\usepackage{cmap}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{indentfirst}
\usepackage{nomencl}
\usepackage{color}
\usepackage{graphicx}
\usepackage[brazilian,hyperpageref]{backref}
\usepackage[alf]{abntex2cite}
\hypersetup{
pdftitle={\@title},
pdfauthor={\@author},
pdfcreator={\@author},
colorlinks=true,
linkcolor=blue,
citecolor=blue,
filecolor=magenta,
urlcolor=blue,
bookmarksdepth=4
}

No comments:

Post a Comment