Tuesday, January 10, 2012

Solving the bibtex problem with underscores in DOI

Have you had problem with compiling Latex files when there was an underscore in the DOI number of one of citations. Usually, it ends up with an error similar to this:

! Missing $ inserted.
<inserted text>
                $
l.286   {\path{doi:10.1001/001-1-11-111-1_11}}


The solution is to call the underscore package:

\usepackage[strings]{underscore}

For more inrformation on this package, see its help:

http://ctan.mackichan.com/macros/latex/contrib/underscore/underscore.pdf

4 comments:

  1. That was REALLY helpful, thanks! I couldn't work out why my citation was rendering funny, and googling "bibtex underscore in urls" brought me here. Adding the underscore package solved that problem nicely :)

    ReplyDelete
  2. Thank you! One of the few times that the first solution I found actually worked.

    ReplyDelete
  3. That was a quick solution. Thx.

    ReplyDelete