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.

The following eqnarray* environment

\begin{eqnarray*}
[v,v] &=&  0\\
[v,v+0] &=& 0\\
[v,v] + [v,0] &=& 0\\
0 + [v,0] &=& 0\\
[v,0] &=& 0\\
[0,v] = -[v,0] = -(0) = 0\\
Maka didapat [v,0] = 0 = [0,v].
\end{eqnarray*}

gives the error

Missing number treated as zero
share|improve this question
3  
You might want to use the align-environment. See also: tug.org/pracjourn/2006-4/madsen –  mcwise Nov 2 '12 at 14:33
    
so if i cant use eqnarray*? –  user46309 Nov 2 '12 at 14:40
    
@sigur, i delete $, and still same error –  user46309 Nov 2 '12 at 14:41

1 Answer 1

up vote 5 down vote accepted

This happens when a line following \\ starts with [ because LaTeX thinks there is an optional argument. To prevent it, you can put an empty group {} before [. Also, I think the last line belongs outside the array, and another dollar sign is needed.

\documentclass{article}
\begin{document}
\begin{eqnarray*} 
[v,v] &=& 0\\    
{}[v,v+0] &=& 0\\  
{}[v,v] + [v,0] &=& 0\\ 
0 + [v,0] &=& 0\\   
{}[v,0] &=& 0\\      
{}[0,v] = -[v,0] = -(0) = 0     
\end{eqnarray*}
Maka didapat $[v,0] = 0 = [0,v]$.
\end{document}

Finally, as @mcwise points out in the comments, use of the eqnarray and eqnarray* environments is not recommended. Primarily, this is because the spacing is inconsistent with all other maths environments, but in fact the problem you encountered is another eqnarray drawback. Instead, you can use the align and align* environments from the amsmath package, and then the only requirement when [ follows \\ is that they appear on separate lines.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}                                                              
[v,v]     &= 0\\     
[v,v+0] &= 0\\    
[v,v] + [v,0] &= 0\\    
0 + [v,0] &= 0\\   
[v,0]   &= 0\\         
[0,v]   &= -[v,0] = -(0) = 0                                              
\end{align*}
Maka didapat $[v,0] = 0 = [0,v]$.
\end{document}
share|improve this answer
    
oke thanks sir for your answer, it's work –  user46309 Nov 2 '12 at 14:42
    
With align or align* there's no need to protect the [ so long as it's in a different input line than \\ –  egreg Nov 2 '12 at 15:04
    
@egreg --- Thanks; I didn't know that. –  Ian Thompson Nov 2 '12 at 15:12
    
my professor just told me the other day about why not to use eqnarray and pointed me to this document :) –  mcwise Nov 3 '12 at 13:22

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.