11
line 41: Missing $ inserted. ... of a single electron is -1.6 $\times$ 10^
line 41: Overfull \hbox (155.52795pt too wide) in paragraph

These are the error messages that are displayed and I don't know why. What do these mean?

3
  • so what does that mean?
    – Taylor
    May 3 '17 at 20:31
  • 18
    note that you were lucky the ^ triggered an error: If the input had been -1.6 $\times$ 10 there would be no error but the spacing, and possibly font, would be completely wrong, and you'd get a hyphen instead of a minus sign in front of the 1.6. May 3 '17 at 20:37
  • what I don't get is why it didn't let you insert the character '^'...
    – user64742
    May 5 '17 at 2:50
46

Alternative: Don't worry yourself about such things or risk running in such errors, simply let the siunitx package do it for you:

\documentclass{article}

\usepackage{siunitx}

\begin{document}

the charge of a single electron is \SI{-1.6e-19}{\coulomb} 

\end{document}

enter image description here


EDIT: With this many votes, I feel this answer needs something more creative to deserve the votes. So here an example how flexible siunitx is:

\documentclass{article}

\usepackage{siunitx}
\usepackage{phaistos}
\usepackage{starfont}
\usepackage{wasysym}

\DeclareSIUnit{\water}{\text{\Aquarius}}
\DeclareSIUnit{\duck}{\text{\PHdove}}
\DeclareSIUnit{\cookie}{\text{\PHshield}}
\DeclareSIUnit{\happy}{\smiley}


\begin{document}

A duck with cookies and water is happy: 

\[
\SI{1}{\duck} + \SI{3}{\cookie} + \si{\water} = \SI[parse-numbers=false]{\infty}{\happy} 
\]

\end{document}

enter image description here

5
  • 6
    -1 that's not a real duck, it's a dove impersonating a duck. May 4 '17 at 17:58
  • 4
    @DavidCarlisle It is a duck born in a dove body - the duck will surely be offended if called a dove :) May 4 '17 at 18:12
  • How is the “happy” physical unit defined? $1\happy=...$? :-)
    – GuM
    May 4 '17 at 22:53
  • @GustavoMezzetti happy=-1*sad, of course May 5 '17 at 7:23
  • 3
    @GustavoMezzetti Happy is a relative unit - it equals the caloric content of how much cake (or other sweets) it takes to make you happy :) May 5 '17 at 8:51
29

The $ character toggles math mode on and off, and the ^ in 10^ must be entered in math mode:

of a single electron is $-1.6 \times 10^x$

(Or whatever your exponent is.)

2
  • The error message doesn't show it being inserted that way.
    – HSchmale
    May 3 '17 at 22:55
  • 10
    @HSchmale tex doesn't understand the text so can not go back and correct earlier mistakes that did not generate an error - is legal in text (making a small hyphen) or math (making a minus sign) so there is no error raised at the - even though the text one is wrong, only when it hits the ^ which must be in math does it raise the error and then it inserts $ before that, not because that is the right fix, but because that is the only thing it can do to get itself back on track to process the document further. May 4 '17 at 6:57

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.