1

I got "Missing }and$ inserted" error and I don`t know where should I add one. Could anybody help, please?

 \begin{equation}\label{3eq}
 A{}^{+}=(a_{i1}\textsuperscript{+},a_{i2}\textsuperscript{+},...,a_{im}{}^{+}),{a_{ij}{\textsuperscript{+}}={$\max$_{1$\leq${i}$\leq${n}}{a_{ij}}}, j=1,2...,m.
  \end{equation}

updated \begin{equation}\label{3eq} A{}^{+}=(a_{i1}{}^{+},a_{i2}{}^{+},...,a_{im}{}^{+}),{a_{ij}{}^{+}}={\max_{1\leq{i}\leq{n}}{a_{ij}}}, j=1,2...,m. \end{equation}

\begin{equation}\label{4eq} A^{-}={(a_{i1}{}^{-},a_{i2}{}^{-},...,a_{im}{}^{-})},{a_{ij}{}^{-}}={\max_{1\leq{i}\leq{n}}{a_{ij}}}, j=1,2...,m. \end{equation}

enter image description here

baran
  • 57
  • please provide an example that can be run to show the problem. (why are you using \textsuperscript in math mode?) and also remove all the $ you are already in math mode from equation – David Carlisle Dec 15 '20 at 17:56
  • @DavidCarlisle,I repost the edited codes.I used $ because of the "missing $ error" – baran Dec 15 '20 at 18:44
  • It would be good if you post one question with all equations which does not compile, instead of editing and changing the equation. – Tanvir Dec 15 '20 at 19:12

2 Answers2

1

The problem is in the second equation where you write a{_{ij} instead of {a_{ij} since a subscript (and a superscript) needs to be attached to something and can't be the first item in a group.

There are a number of other issues here. I'm not sure what you're doing with some of those outer braces in your equations and it's also not clear why you're using \textsuperscript{+} instead of ^{+. If it's to get the plus after the subscript, you could write, e.g.,

a_{ij}{}^{+}

Update Also, I see, for some reason that you have $s inside your math mode. Those don't belong there, along with the enclosing braces.

Don Hosek
  • 14,078
  • ,Thanks for your comment, I edited the codes as you said, but I got the same error. I post the edited codes and a picture of what I want to type. – baran Dec 15 '20 at 18:40
  • @baran see the update to the answer – Don Hosek Dec 15 '20 at 18:42
  • 1
    @baran if you take the equations as in your question and delete every $ it runs without error, although you should also remove many of the {} – David Carlisle Dec 15 '20 at 19:11
1
  • I see that you've replaced all instances of \textsuperscript{.} with {}^{.} in the meantime. I'd suggest you get rid of the {} particles too. Do also tame the impulse to encase things more or less at random in curly braces.

  • The expressions for \min{...} and \max{...} are much too complicated and contain syntax errors. See the code below for a rather simpler and more streamlined alternative.

  • Do please replace all instances of ... with \dots in order to get LaTeX to typeset proper typographic ellipses.

  • Optionally, replace all instances of \leq with \leqslant in order to better replicate the material in the screenshot.

enter image description here

\documentclass{article} % or some other suitable document class
\usepackage[T1]{fontenc}
\usepackage{amsmath} % for 'gather' environment
\usepackage{amssymb} % for '\leqslant' macro

\begin{document}

\begin{gather} \mathbf{A}^{!+}=(a_{i1}^{+},a_{i2}^{+},\dots,a_{im}^{+}), \quad {a_{ij}^{+}} = \max_{1\leqslant i\leqslant n}a_{ij}, \quad j=1,2,\dots,m. \label{3eq} \ \mathbf{A}^{!-}=(a_{i1}^{-},a_{i2}^{-},\dots,a_{im}^{-}), \quad a_{ij}^{-} = \min_{1\leqslant i \leqslant n} a_{ij}, \quad j=1,2,\dots,m. \label{4eq} \end{gather}

\end{document}

Mico
  • 506,678