# IEEEtran bibliography: URL containing dash/hyphen causes problem

Whenever there is a URL containing dash/hyphen characters in my bibliography file, I get the following type of error:

LaTeX Warning: Citation wright2006' on page 1 undefined on input line 29.

(./Untitled.bbl ./Untitled.bbl:29: Missing $inserted. $ l.29 ...l{https://doi.org/10.1007/0-387-27925-3_2}


I figured that if I erase the URL field, there is no problem. The thing is that I have a large bib file containing more than 300 entries that will be cited. Most of them contain URL fields with dash/hyphen characters. I tested citations with URL fields that do not contain dash/hyphen characters and they work fine. How can I make this work without having to go through the whole file and erase more than 300 URL fields?

Here is a MWE:

\documentclass[conference]{IEEEtran}
\usepackage{filecontents,lipsum}
\begin{filecontents*}{references.bib}
@inbook{wright2006,
Author = {Wright, Kenneth W.},
Booktitle = {Handbook of Pediatric Strabismus and Amblyopia},
Date-Modified = {2017-09-11 00:08:45 +0000},
Doi = {10.1007/0-387-27925-3_2},
Editor = {Wright, Kenneth W. and Spiegel, Peter H. and Thompson, Lisa S.},
Isbn = {978-0-387-27925-1},
Keywords = {Anatomy;Biology;anatomical data;physiology;Eyes;eye movements;biological data},
Pages = {24--69},
Publisher = {Springer New York},
Title = {Anatomy and Physiology of Eye Movements},
Url = {https://doi.org/10.1007/0-387-27925-3_2},
Year = {2006},
}
\end{filecontents*}
\title{This document}
\author{This author}

\begin{document}

\maketitle

I have cited this document \cite{wright2006}

\bibliographystyle{IEEEtran}
\bibliography{references}
\end{document}


Contrary to what you wrote in the title of your posting, it's not the hyphens in the url and doi fields that are giving you grief. Instead, it's the underscore characters: _. You need to load the url package, preferably with the option hyphens, in the preamble. That way, TeX and BibTeX won't try to interpret _ as the initiator of subscript material in a url or doi string.

A separate issue: it's not correct to use the entry type @inbook for the entry at hand. Use @incollection instead.

Finally, the name of the bibliography style is IEEEtran, not ieeetran.

A full MWE (minimum working example):

\RequirePackage{filecontents}
\begin{filecontents*}{references.bib}
@incollection{wright2006,
Author = {Wright, Kenneth W.},
Title  = {Anatomy and Physiology of Eye Movements},
Editor = {Wright, Kenneth W. and Spiegel, Peter H. and Thompson, Lisa S.},
Booktitle= {Handbook of Pediatric Strabismus and Amblyopia},
Pages    = {24-69},
Publisher= {Springer},
url      = {https://doi.org/10.1007/0-387-27925-3_2},
Year     = {2006},
Date-Modified = {2017-09-11 00:08:45 +0000},
Doi      = {10.1007/0-387-27925-3_2},
Isbn     = {978-0-387-27925-1},
Keywords = {Anatomy;Biology;anatomical data;physiology;Eyes;eye movements;biological data},
}
\end{filecontents*}

\documentclass[conference]{IEEEtran}
`