# LaTeX error: “Missing } inserted” when copying the template code

I tried to adapt this part of a template:

\begin{align}
y=&ax+b&&\text{(definition of a straight line)}\nonumber\\
&f'(a)x+b&&\text{(definition of the derivative)}\nonumber\\
&f'(a)x+f(a)-f'(a)a&&\text{(we know that the line intersects $f$ at $(a,f(a))$}\nonumber
\end{align}


By writing:

\begin{align}
$c^j_{0}$ = &($x_{j}$-30)^4($x_{j}$-32)^4&&\text{(si $x_{j}$ \in [30,32])}\nonumber\\
&0&&\text{(sinon)}\nonumber
\end{align}


But this error message appears no matter what I try do to to fix it:

Missing } inserted.
<inserted text>
}
l.30 \end{align}


## migrated from stackoverflow.comDec 24 '16 at 0:45

This question came from our site for professional and enthusiast programmers.

• Welcome to TeX.SE! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – Werner Dec 24 '16 at 5:17

You are using to go into math mode when LaTeX is already in math mode because the align environment is usually maths. You still need to go into math mode inside your \text bit though, although I expect there's a better way to do it. Reproducible example: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} c^j_{0} = &(x_{j}-30)^4(x_{j}-32)^4&&\text{(six_{j} \in [30,32]\$)}\nonumber\\