# Missing } inserted error

My equation is giving me an error

Missing } inserted. \end{split} error.

I had imported the code from Mathtype.

$$\begin{split}  - {\delta _{max}} \le \delta (k) \le {\delta _{max}} \\  - {{\dot \delta }_{\max }} \le \delta (k + 1) - \delta (k) \le {{\dot \delta }_{\max }} \\ \end{split}$$

• Please can you complete your code so we can reproduce the error? But try removing the $$ signs which shouldn't be used in LaTeX anyway, but certainly not here. – cfr Oct 4 '16 at 22:10 • Remove the 4 $$ which have nothing to do here. Furthermore, $$…$$ is plain tex syntax, and shouldn't be used for displayed equations in latex documents. – Bernard Oct 4 '16 at 22:12
• Welcome to TeX.SX! You shouldn't really use $$...$$ in LaTeX at all: tex.stackexchange.com/questions/503/why-is-preferable-to. You should never use any $ within an equation environment, equation is a math mode environment, it puts you in math mode. So any $ after takes you out of math mode. (The only exception is if you've deliberately taken yourself out of math mode, e.g. by using \text{}, $$... \text{because a = 1} ..$$ would be fine – Au101 Oct 4 '16 at 22:12
• Excuse me, but why have you completely changed the question? If you have another question, please start a new question. It doesn't seem fair on @cfr that you've asked a question, got an answer from her, and now obliterated the original question and replaced it with a new one that her answer doesn't address – Au101 Oct 4 '16 at 22:30
• In fact, your completely different equation also has $$...$$ in it which is wrong for the reasons previously explained. In addition it has \end{split} but no \begin{split}. However, this should be rolled back to the original version and a new question asked as @Au101 explained. – cfr Oct 4 '16 at 22:38

Note that this answer addresses the original question asked and not the quite different question which replaced it after this answer was posted.

equation already puts you in maths mode, so you don't need to switch into it. Moreover, you don't want to try to fit an unnumbered display environment into split inside equation. Furthermore, $$...$$ ought not be used in LaTeX anyway. Use $...$ instead. But not here, of course:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$$\begin{split} - {\delta _{max}} \le \delta (k) \le {\delta _{max}} \\ - {{\dot \delta }_{\max }} \le \delta (k + 1) - \delta (k) \le {{\dot \delta }_{\max }} \\ \end{split}$$
\end{document}


But did you really want the sequence of variables m, a and x? Or did you mean

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$$\begin{split} - {\delta _{\max}} \le \delta (k) \le {\delta _{\max}} \\ - {{\dot \delta }_{\max }} \le \delta (k + 1) - \delta (k) \le {{\dot \delta }_{\max }} \\ \end{split}$$
\end{document}


I suppose that, for the new version of your equation, you want one of these:

\documentclass{article}
\usepackage{mathtools}
\DeclareMathOperator\obstacle{Obstacle}

\begin{document}

$$\obstacle(k) = \begin{cases} 0 & \text{if}\quad x(k),y(k) \in \bigcup _{q = 1}^Q A(q), \\[1ex] \infty & \text{if}\quad x(k),y(k) \notin \bigcup _{q = 1}^Q A(q) . \end{cases}$$
\bigskip
$$\obstacle(k) = \begin{dcases} 0 & \text{if}\quad x(k),y(k) \in \bigcup _{q = 1}^{\smash{Q}} A(q), \\[-2ex] \infty & \text{otherwise. } \end{dcases}$$

\end{document}


Note that this answer addresses the form of the posting after some major interim edits were rolled back. I believe the current form of the posting is fairly close to its original form.

You obviously have to remove the utterly inappropriate $$ directives: TeX is already in display math mode after ; there is no sense in having $$ inside an equation environment.

In addition, you should rethink the equations' layout so as to maximize the chances that you readers will immediately "get" what this pair of grouped inequalities is about. In particular, you may want to pursue one of the following two layouts. The first uses a simple array environment and doesn't require loading any special LaTeX packages. The second, which uses a split environment (provided by the amsmath package) is a bit more terse but should be able to convey its content even more efficiently.

\documentclass{article}
\usepackage{amsmath}

\begin{document}
$$\renewcommand\arraystretch{1.3} \setlength\arraycolsep{0pt} \begin{array}{r @{{}\le{}} c @{{}\le{}} l} -\delta_{\max} & \delta(k) & \delta_{\max} \\ -\dot{\delta}_{\max} & \delta(k+1)-\delta(k) & \dot{\delta}_{\max} \end{array}$$

$$\begin{split} |\delta(k)| &\le \delta_{\max} \\ |\delta(k+1)-\delta(k)| &\le \dot{\delta}_{\max} \end{split}$$
\end{document}