2

I get the following error in texmaker: enter image description here I have multiple files opened, but I since it doesn't show a file name I dont know where this error should occur. I also went through all my files and the bibliography and checked lines 53 and 55 without spotting any missing $. How do I know which file this error message is for?

This is the part of the logfile:

(09_diskussion.tex
chapter 6.
) [30
] (00_Vorlage Abschlussarbeit.bbl
! Missing $ inserted.
<inserted text>
$
l.53 centres{\ast
}.
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Extra }, or forgotten $.
l.53 centres{\ast}
.
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.
! Missing $ inserted.
<inserted text>
$
l.55
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Missing } inserted.
<inserted text>
}
l.55
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

10
  • if you look at the log you can see which file was last opened before the error Commented Nov 8, 2022 at 9:48
  • you should be looking for \ast not $ Commented Nov 8, 2022 at 9:49
  • 1
    Search for centres{\ast in your files and check if there is an extra $ in the preceding text? By the way how is this question related to biblatex? Commented Nov 8, 2022 at 10:02
  • I looked for centres{\ast and had one entry in my bibliography, but there was no $ in the preceeding text. The discussion file is the last before my bibliography, so could the mistake occur in the bib file (regarding the log file)
    – trynerror
    Commented Nov 8, 2022 at 10:15
  • 1
    see the (badly formatted:-) error you just added, latex reports the error in 00_Vorlage Abschlussarbeit.bbl so it is that bbl file you need to fix Commented Nov 8, 2022 at 10:22

2 Answers 2

3

If your main file is

\documentclass{article}

\begin{document}

aaaaaaa

\input{wibble}


\end{document}

and wibble.tex is

aa

centres{\ast i}

bbb

Then the error in the log is

(./wibble.tex
! Missing $ inserted.
<inserted text> 
                $
l.3 centres{\ast
                 i}
? 

Note the log file is almost always more informative than the "summary" that may be provided by your editor.

Here (./wibble.tex logs wibble.tex being opened, and as there is no matching ) that file is still open at the point of the error, so l.3 refers to line 3 of wibble. As confirmed by the line of context shown.

The actual error is that \ast is a math command, I'm not sure what expression you intended but changing wibble.tex as below fixes the error

aa

centres $\ast i$

bbb
3

The input centres{\ast} is an error, because \ast is a math mode command. So upon finding it,

  1. TeX adds a $ by itself (first error message).
  2. Then TeX finds } which would lead to unbalanced lists: it would be as if you typed centres{$\ast}... which is illegal (second error message).
  3. At line 55 TeX is likely finding a blank line; since math mode has started but is not finished, a $ is added (third error message).
  4. But upon closing math mode, there is still the { after centres that remains unbalanced (fourth error message), because the } that was found before has been removed as part of error recovering in step 2.

The wrong input is in the .bbl file which is generated by BibTeX. You know this because of

chapter 6.
) [30
] (00_Vorlage Abschlussarbeit.bbl
! Missing $ inserted.

which tells you that TeX is reading from 00_Vorlage Abschlussarbeit.bbl (by the way, avoid spaces in names of LaTeX files).

BibTeX knows very little of TeX. If your .bib file has centres{\ast}, then BibTeX will do nothing to it.

It's possible that “smart” bibliography managers such as Mendeley, try to be even smarter and change centres* into centres{\ast} or something similar.

Fix the entry in the bib file and rerun BibTeX (or Biber, depending on whether you're using biblatex).

4
  • the problem is centres{\ast} or \ast doesn't even show up in my bibfile. So I dont know what to change since I am not using Mendeley.
    – trynerror
    Commented Nov 8, 2022 at 10:32
  • 1
    @trynerror You can open the .bbl file and look what bibliography item line 53 is about. Then you can look for it in the bib file and fix the wrong input.
    – egreg
    Commented Nov 8, 2022 at 10:35
  • Ok in the bbl file in line 53 there is centres{\ast}. It was the entry I already suspected, thats why I completely deleted him out of my bib file to see if it works. Should I also delete it in the bbl file ?
    – trynerror
    Commented Nov 8, 2022 at 10:40
  • ok it is working now thank you very much for your efforts!
    – trynerror
    Commented Nov 8, 2022 at 10:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .