When I run

\textit{m}(A)  &=a&, \\
\textit{\bar{A}} &=1-a& \\
\textit{m}(B) &=0&  &\text{for} B \neq A \text{ or} B \neq \bar{A}

I get the following error:

! Package amsmath Error: \bar allowed only in math mode.See the amsmath package documentation for explanation.Type H <return> for immediate help.... \end{align}

Using \overline instead of \bar doesn't help either. What command should I use to get an overline?

2 Answers 2


There is no need to use \textit (actually it's wrong):



m(A)    &= a, \\
\bar{A} &= 1-a,\\
m(B)    &= 0,\quad\text{for $B \neq A$ or $B \neq \bar{A}$}


Notice how math mode is used inside \text to get spacing right without doing strange things. I don't think it's good to move the textual condition much to the right as you seem to want.

enter image description here


\bar is not accepted because you have put it inside a text element with

\textit{\bar{A}} &=1-a& \\

change this to

\mathit{\bar{A}} &=1-a& \\

and it will behave as you wish.

it's not clear to me, though, why you're specifying any type of explicit italic at all, since the default for math is already italic. and after all, the final part of the last line has just \bar{A} which i would have assumed had the same meaning.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .