-1

My equation is giving me an error

Missing } inserted. \end{split} error.

I had imported the code from Mathtype.

\begin{equation}
\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{equation}
  • 1
    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
  • 2
    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 \begin{equation} 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{}, \begin{equation} ... \text{because $a = 1$} .. \end{equation} would be fine – Au101 Oct 4 '16 at 22:12
  • 1
    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
  • 1
    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
4

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{equation}
\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{equation}
\end{document}

compiled output

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

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\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{equation}
\end{document}

possible improvement

1

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

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

\begin{document}

\begin{equation}
  \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}
\end{equation}
\bigskip
\begin{equation}
  \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{equation}

\end{document} 

enter image description here

0

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 \begin{equation}; 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.

enter image description here

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{equation}
\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}
\end{equation}

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.