# Error: Command \ invalid in math mode

I am getting the following error:

Command \  invalid in math mode.


Why? Compilation ends but no PDF is created because of those errors. This seems to be the problematic piece of code but I don't understand the error I'm getting:

$$\label{eq:e211} I_C = C \dfrac{dv_c}{dt} \xRightarrow{Em regime estacionário} I=I_C=C.0=0$$

-
Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. –  Jubobs Mar 26 at 14:27
That error message is not possible with your code snippet! It must be in another math environment. –  Herbert Mar 26 at 14:29
It is not the cause of your error but the text Em regime estacionário should not be in math mode, it should be \text{Em regime estacionário} –  David Carlisle Mar 26 at 15:40

Please always post complete documents that show the error, and also show the exact error generated by TeX (the format you showed is not a tex error).

\documentclass{article}

\usepackage{amsmath}

\usepackage[utf8]{inputenc}

\begin{document}

$$\label{eq:e211} I_C = C \dfrac{dv_c}{dt} \xRightarrow{Em regime estacionário} I=I_C=C.0=0$$

\end{document}


Produces

! Undefined control sequence.
l.10 I_C = C \dfrac{dv_c}{dt} \xRightarrow


If I change that to \Rightarrow I get

LaTeX Warning: Command \' invalid in math mode on input line 10.

! Please use \mathaccent for accents in math mode.


Which is I assume, the error you got.

Here you get a LaTeX warning (not an error) about \'{a} but then immediately get a lower level TeX error about the same issue. (Even though the text is entered as á inputenc converts this to traditional TeX markup of \'{a} as the rest of the system is not unicode-aware.

So in fact my initial comment on the question is the source of the error. Even without the error over á you should never use the math italic font for natural language words or multi-letter identifiers, it is designed to make adjacent letters not look like a word, but rather as a product of separate 1-letter identifiers.

This runs without error

\documentclass{article}

\usepackage{amsmath}

\usepackage[utf8]{inputenc}

\begin{document}

$$\label{eq:e211} I_C = C \dfrac{dv_c}{dt} \Rightarrow \text{Em regime estacionário} \qquad I=I_C=C.0=0$$

\end{document}


-