TransWikia.com

Missing $ inserted issue

TeX - LaTeX Asked on March 8, 2021

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

@inproceedings{davis,
 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!

12 Answers

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:

doi:10.1007/978-0-387-68772-8_18

Or as URL:

http://dx.doi.org/10.1007/978-0-387-68772-8_18

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.

Correct answer by Heiko Oberdiek on March 8, 2021

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.

Answered by Frans on March 8, 2021

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.

Answered by Guido on March 8, 2021

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.

Answered by Dietmar Haba on March 8, 2021

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

Answered by Sundeep on March 8, 2021

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.

Answered by Stephen on March 8, 2021

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

Answered by craq on March 8, 2021

usepackage[strings]{underscore}

Answered by Roly on March 8, 2021

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.

Answered by 6005 on March 8, 2021

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

usepackage{hyperref}
usepackage[T1]{fontenc}

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

Credit to Ulrike Fischer and CGFoX

Answered by craq on March 8, 2021

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.

Answered by oceanBT on March 8, 2021

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.

Answered by Khalil Al-rahman Yossefi on March 8, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP