Trying to get my dissertaion sorted (due in a few hours) and I keep getting this error:

! Missing $ inserted.
<inserted text> 
l.190 ... pp. 225--236, 10.1007/978-0-387-68772-8_
                                                  18. [Online].

Really struggling to sort it out.

I'm fairly new to LaTeX.

Edit: This is 189-204 of the bibtex

 author = {Davis, Alan and Dieste, Oscar and Hickey, Ann and Juristo, Natalia and Moreno, Ana M.},
 title = {Effectiveness of Requirements Elicitation Techniques: Empirical Results Derived from a Systematic Review},
 booktitle = {Proceedings of the 14th IEEE International Requirements Engineering Conference},
 series = {RE '06},
 year = {2006},
 isbn = {0-7695-2555-5},
 pages = {176--185},
 numpages = {10},
 url = {http://dx.doi.org/10.1109/RE.2006.17},
 doi = {10.1109/RE.2006.17},
 acmid = {1174006},
 publisher = {IEEE Computer Society},
 address = {Washington, DC, USA},
 keywords = {Systematic review, software engineering, elicitation techniques, empirical studies},

Please help!

  • 2
    You need to supply more information. What does your code look like around line 190 of the file? Seems like an entry in a bibliography. Edit your question and include that detail (perhaps the entire bibliography?).
    – Werner
    Sep 11 '12 at 23:58
  • 2
    The solution that avoids the error and liberates from having to change the urls is to ``` \usepackage{url} ``` as suggested here. Oct 7 '14 at 8:44
  • I resolved the same error with _ instead of _ at the end of doi Jan 22 at 11:49

12 Answers 12


The line number in the error message is the line of the .bbl file that is generated by bibtex, it is not the line of the .bib file. Therefore the question quotes the wrong lines. The line in the error message contains:

pp. 225--236, 10.1007/978-0-387-68772-8_18. [Online].

Therefore I think the entry in the .bib file contains

doi = {10.1007/978-0-387-68772-8_18},

It seems the DOI numbers are not well supported. The prefix doi: is missing:


Or as URL:


Also special characters like _ are not well supported. The _ causes the trouble. Make a minimal example (MWE) that shows, how the doi entries in the .bib file are handled in your document.

If there are no special macros that handle the doi numbers, then you can try \_ instead of _ in the .bib file.

  • 4
    Why should the prefix doi: be required for the DOI field? A doi number always starts with 10, not with doi:
    – koppor
    Jun 22 '15 at 19:55
  • Another likely possibility that I ran into was simply attempting to use the .bib file as a .bbl. This will explain why the doi was not supported properly (underscore would have been supported in the .bib, but not in .bbl). See my answer.
    – 6005
    Jul 10 '18 at 21:29
  • @6005 The error message shows clearly that it comes from the .bbl file, not by including the .bib file in LaTeX. Jul 10 '18 at 22:49
  • @HeikoOberdiek If you rename the .bib to a .bbl, you get this error. It just happened to me. When submitting to arXiv
    – 6005
    Jul 11 '18 at 3:10
  • @6005 Very likely this can be detected by seeing the key in the error message, e.g. l42. doi = 10.1007/978-0-387-68772-8_. Jul 11 '18 at 5:55


  • 16
    This should be the accepted answer; this completely solves the problem, whereas the currently-accepted answer merely explains the problem.
    – Tom Church
    Jul 26 '16 at 21:15
  • 5
    It did not work for me :(
    – durbachit
    May 18 '17 at 2:57
  • 1
    This didn't work for me. I'm using Overleaf and my bib file is synced from Mendeley. I keep getting a compile error whenever this is added in the preamble.
    – irene
    Aug 17 '18 at 6:51
  • 3
    The doi package doesn't seem to work with the Springer style splncs04.bst which defines its own doi command in the bibliography preamble (\providecommand{\doi}[1]{https://doi.org/#1}). Hence, I favorise the solution with the underscore package.
    – Mario
    Apr 4 '19 at 12:50
  • 1
    This conflicts with some packages like pstricks, but works well if included in the end of preamble.
    – Fractalic
    Sep 2 '19 at 9:39

The problem is the underscore _ in a doi. It occurs in line 190 of the LaTeX file (or in the .bbl) not in the .bib file.

Search for 10.1007/978-0-387-68772-8_18 in your .bib file. You can use the url package and enclose the entry in \url{10.1007/978-0-387-68772-8_18} to avoid the error. Alternatively you can use a bibtex style that knows about dois.

  • 5
    It might also be necessary to delete and remake the .bbl file. (I'm adding that for other readers. Learned it the hard way.)
    – Mars
    Oct 8 '15 at 21:43

Try using in the preamble \usepackage{url}. This should clear the problem.

  • 2
    worked for me! I wonder why it got downvoted? It doesn't have any analysis or explanation of the problem, but it seems like the quickest fix. I am wary of changing my .bib file in case bibtex starts handling underscores correctly (i.e. without needing an escape character) and prints \_ into the bibliography
    – craq
    Apr 13 '16 at 9:44
  • 1
    Didn't work for me...
    – Roly
    Jun 20 '16 at 9:46
  • 2
    This only works, if the error occurs in the URL field, not if it is in any other field (which still makes it a valuable answer!). Jun 24 '17 at 12:18

What Werner and Gonzalo said would indeed be very helpful. From the limited info given however, I guess LaTeX struggles with the _ in the line, since it normally sees that as a subscript indicator and only expects it in math mode.

A very short solution (and impossible to say if that works without taking a look at the offending code) is to escape the underscore ("_"), by placing a backslash before it.

  • Which underscore?
    – Jon
    Sep 12 '12 at 0:15

Another solution could be to drop the whole "_18" as it says just "chapter 18". If you write "10.1007/978-0-387-68772-8" rather than "10.1007/978-0-387-68772-8_18" the reader will still be referred to the right book, but not to chapter 18 within it.


To get rid of the underscore ("_"), you can use shortdoi.org and doi:10/djzjd6 instead of doi:10.1007/978-0-387-68772-8_18, which is also nice when your readers need to type the doi from a printed version of your thesis instead of being able to click at it in an electronic document.


Another future-proof answer, albeit rather tedious, is suggested here:

Change all occurrences of _ in the URL field of your .bib file to their html character code equivalent %5F

  • Why is this better than replacing _ with \_?
    – lucidbrot
    Nov 28 '18 at 9:11

The short way:

  1. open "*.bib" file
  2. Replace:

         "-" >>>> "\_"
         "&" >>>> "\&" (specially check in the links)
         "\" >>>> "\\" (specially check in the links)
  3. Delete all temporary files: In Texmaker:

         Tools -> Clean
         Bibliography -> Clean
  4. You are done! Very Important Note: You do not need any extra package, so do not use them, in order to prevent further problems.

If you are getting this issue when submitting to arXiv, one possible source of the problem may be that you are trying to use a .bib file as a .bbl.

While renaming the .bib to .bbl is pretty silly in retrospect, that's what I did (not understanding that they are different). And then I ran into these errors. You need to submit the .bbl that is generated when you compile on your machine (or, in my case, download the .bbl file produced by ShareLaTeX online). The format of the .bbl is different from the .bib and the references will not show up correctly or be cited correctly.


From a similar question, the answer that worked for me was adding


to the preamble. (Or \usepackage[hidelinks]{hyperref} to avoid the ugly boxes.)

Credit to Ulrike Fischer and CGFoX


In my case there was a problem with the encoding. I used \usepackage[macintosh]{inputenc}.

I solved the problem by switching to \usepackage[utf8]{inputenc} but i also had to update the encoding of my files by using iconv.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.