Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

this is my code:

\begin{eqnarray}
[A,C]\mid_{dom(x)} = -x^1x^2\frac{\partial}{\partial x^1} + (2(x^1)^2 - (x^2)^2 +2)\frac{\partial}{\partial x^2}  \\
[B,C]\mid_{dom(x)} = ((x^1)^2 - 2) \frac{\partial}{\partial x^1} -5x^1x^2 \frac{\partial}{\partial x^2} 
\end{eqnarray}

and this the error:

54
Missing number, treated as zero.
<to be read again> 
                   B
l.54 [B,C]
          \mid_{dom(x)} = ((x^1)^2 - 2) \frac{\partial}{\partial x^1} -5x^1x...

I would be glad if you help me, I cannot figure out the problem and solve it. I am a new Tex learner :/

I could not write the comment, anyway I like to thank you, these advices of yours solved my little problem!

share|improve this question
1  
Welcome to TeX.SX! It seems you're missing the &, before the = signs. In this case it's better to use align of the amsmath package than eqnarray. See tex.stackexchange.com/q/196/18228 –  Kevin C Nov 23 '13 at 23:02
1  
Since it hasn't been explained, the reason for the error is that \\ of eqnarray has an optional argument which is expected to be a length. So your first \\ takes [B,C] for its argument, and finds no length there, producing the error. The amsmath align environment is better in many ways, and this is just one of the minor ones. –  Dan Nov 24 '13 at 7:01

1 Answer 1

Don't use eqnarray. Use align* from amsmath.

Further, dom(x) looks like an operater, hence you may put \DeclareMathOperator{\dom}{dom} in the preamble and use it as \dom(x). I have also used \bigl and bigr from amsmath to make [ and ] bigger.

\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\dom}{dom}
\begin{document}
 \begin{align*}
[A,C]\mid_{\dom(x)} &= -x^1x^2\frac{\partial}{\partial x^1} + \bigl[2(x^1)^2 - (x^2)^2 +2\bigr]\frac{\partial}{\partial x^2}  \\
[B,C]\mid_{\dom(x)} &= \bigl[(x^1)^2 - 2\bigr] \frac{\partial}{\partial x^1} -5x^1x^2 \frac{\partial}{\partial x^2}
\end{align*}
\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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