# Error: Command \" invalid in math mode on input line x

I'm receiving the following error

Command \" invalid in math mode on input line 60.


where my input lines 58-61 are

$$\label{1} \Delta x=x_{efter}-x_{före}$$


The problem doesn't to be the \Delta. The problem seem to come from x_{efter}-x_{före}. I have tried to use $....$ but it doesn't work. I'm new to LaTeX but I think I have imported the correct packages.

• Could it be the character ö that is unrecognized ?
– Claudio
Nov 11, 2013 at 16:32

The ligature ö consists of \"{o}, which can happen in text but not math mode. Here's how it should be used:

\documentclass{article}
\usepackage[utf8]{inputenc}% http://ctan.org/pkg/inputenc
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
$$\Delta x = x_\text{efter} - x_\text{före} \label{eq:difference}$$
\end{document}


amsmath provides \text{<stuff>} which prints <stuff> in text mode. inputenc allows you to specify ligature as-is in your code.

As a side-note, it's best to label things with descriptive names.

• I already had the correct packages so the only thing I changed was \text{före} instead of x_{före}. Thanks for the help!
– user2979859
Nov 13, 2013 at 10:47
• @Christoph the comment was aimed at \label{1} in the question Feb 2, 2016 at 15:57