## LaTeX forum ⇒ Text Formatting ⇒ Command \' invalid in math mode on input line with 2^...

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Félix
Posts: 3
Joined: Wed May 25, 2011 3:52 pm

### Command \' invalid in math mode on input line with 2^...

Hello,
I have a compilation problem with a specific command.
First, I have to mention that I do have the ams package.
Second, I also have all the babel french libraries to take punctuation into account.
Third, I use TeXnicCenter.

I first did this:
\item Indiquez que la validité sera vérifiée pour 2^{\operatorname{ Nb. d'éléments } }

then I had the warning: \ ' invalid in math mode on input line ...

So I changed it for:
\item Indiquez que la validité sera vérifiée pour \begin{equation} \text{ 2^{\operatorname{ Nb. d'éléments } } }\end{equation}

But now the told me that I am missing $signs! ! Missing$ inserted. <inserted text> \$
and I still have LaTeX Warning: Command \' invalid in math mode on input line ...

See, this is a never ending problem!

What the trick with these kind of things?
Last edited by Stefan Kottwitz on Fri May 27, 2011 10:53 pm, edited 1 time in total.
Reason: code markup

localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany
Well, the error message is very clear. The „^“ command for superscripts is only allowed in math mode. For text mode you may use \textsuperscript{2}. Due to the lack of a minimal example this is all I can advise.

Best regards and welcome to the board
Thorsten
LaTeX Community Moderator

¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Félix
Posts: 3
Joined: Wed May 25, 2011 3:52 pm
Thank you, it worked perfectly well. But you probably meant that I should write
2\textsuperscript{Nb. d'éléments}. Anyway, thank you again for that.

### Who is online

Users browsing this forum: No registered users and 2 guests