# What's wrong with the code of the equation?

I tried this code below but it does not execute and I couldn't find out what is wrong in the equation. What did I do wrong?

$MDAC(t_{i,j}) = max_{ti}\epsilon pred(t_{j})(C_{i,j)$

• I think we're all dying to know what MDAC is? :P Commented Dec 2, 2015 at 20:41

Your primary problem is with (C_{i,j), which should be (C_{i,j}), in other words, you have not paired all your delimeters, you need a closing brace. You should have received the error:

! Missing } inserted.


More generally I would recommend:

$MDAC(t_{j}) = \max_{t_{i} \in pred(t_{j})}(C_{i,j})$


Or perhaps you want?

\newcommand{\pred}{\operatorname{pred}}

$MDAC(t_{j}) = \max_{t_{i} \in \pred(t_{j})}(C_{i,j})$


According to others, MDAC is a single unit. It is probably better, therefore, to treat it as an operator and set it upright, but suppose you want it set in italics, you can have:

$\mathit{MDAC}(t_{j}) = \max_{t_{i} \in \pred(t_{j})}(C_{i,j})$


Which will improve the spacing between the letters, treating MDAC as one unit, rather than the product of four separate variables M, D, A and C. For upright typesetting follow Bernard's advice or what I have done with \pred:

\newcommand{\MDAC}{\operatorname{MDAC}}
\newcommand{\pred}{\operatorname{pred}}

$\MDAC(t_{j}) = \max_{t_{i} \in \pred(t_{j})}(C_{i,j})$


• "MDAC" should be entered either as \mathrm{MDAC} or as \mathit{MDAC}. Entering it as MDAC induces TeX to typeset it as if were a collection of four separate variables named M, D, A, and C.
– Mico
Commented Dec 2, 2015 at 20:34
• @Mico thanks, fair enough, I'm genuinely unfamiliar with MDAC so I left it alone, for all I knew, it is the product of the three variables M, D and A with C(t_{j}). But I'll edit, although it makes my answer functionally indistinguishable from Bernard's ... Commented Dec 2, 2015 at 20:35
• Well, you can choose the \mathit method to make your solution look different from Bernard's. :-)
– Mico
Commented Dec 2, 2015 at 20:37

I don't think MDAC and prec should be typed in italics. I suggest considering them as maths operators, like log, sin, &c., to ensure a correct spacing w. r. t. possible exponents, indices or delimiters.

\documentclass{article}
\usepackage{amsmath}
\usepackage{fourier}
\DeclareMathOperator{\MDAC}{MDAC}
\DeclareMathOperator{\pred}{pred}

\begin{document}

$\MDAC(t_{i,j}) = \max_{t_i\in \pred(t_j)}(C_{i,j})$ %

\end{document}


• Is "MDAC" an operator or the name of a variable? If it's the latter, it's probably better to define \newcommand\MDAC{\mathrm{MDAC}}.
– Mico
Commented Dec 2, 2015 at 20:35
• @Mico: I wondered. I opted for an operator because it was followed by a pair of parentheses. Maybe the O.P. will tell us. Commented Dec 2, 2015 at 20:38