### Who is online

In total there are 9 users online :: 0 registered, 0 hidden and 9 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: No registered users and 9 guests

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

Add tags Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)

### 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:
Code: Select all  •  Open in writeLaTeX
\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:
Code: Select all  •  Open in writeLaTeX
\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_K on Fri May 27th, 2011, edited 1 time in total.
Reason: code markup
Félix

Posts: 3
Joined: Wed May 25th, 2011

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

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

localghost
Site Moderator

Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany

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

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.
Félix

Posts: 3
Joined: Wed May 25th, 2011