# I have 3 errors running this code with \toprule and \midrule in a table… If include booktabs package in my preamble, I have 9 errors [closed]

\begin{table}[htbp]
\centering
\caption{Zeros e pesos para quadratura de Gauss-Legendre}
\begin{tabular}{cccccc}
\toprule
\multicolumn{2}{c}{n = 5} & \multicolumn{2}{c}{n = 10} & \multicolumn{2}{c}{n = 15} \\
\midrule
$x_{i}$       & $w_{i}$           &  $x_{i}$           &  $w_{i}$          &  $x_{i}$          & $w_{i}$             \\
-0.906179845938664& 0.236926885056189 & -0.973906528517172 & 0.0666713443086882& -0.987992518020485& 0.0307532419961175 \\
-0.538469310105683& 0.478628670499366 & -0.865063366688985 & 0.149451349150581 & -0.937273392400706& 0.0703660474881079 \\
4.143437923020e-17& 0.568888888888889 & -0.679409568299024 & 0.219086362515983 & -0.848206583410427& 0.107159220467172  \\
0.538469310105683 & 0.478628670499367 & -0.433395394129247 & 0.269266719309996 & -0.72441773136017 & 0.139570677926154  \\
0.906179845938664 & 0.236926885056189 & -0.148874338981631 & 0.295524224714753 & -0.570972172608539& 0.166269205816994  \\
-           &       -                 &  0.148874338981631 & 0.295524224714753 & -0.394151347077564& 0.186161000015562  \\
-           &       -                 &  0.433395394129247 & 0.269266719309996 & -0.201194093997434& 0.198431485327111  \\
-           &       -                 &  0.679409568299025 & 0.219086362515982 &  2.99577686686e-17&  0.202578241925561  \\
-           &       -             &  0.865063366688984 & 0.149451349150581 &  0.201194093997435&  0.198431485327112  \\
-           &       -                 &  0.973906528517172 & 0.0666713443086877&  0.394151347077563&  0.186161000015561  \\
-           &       -                 &         -          &        -          &  0.570972172608539&  0.166269205816994  \\
-           &       -                 &         -          &        -          &  0.72441773136017 &  0.139570677926154  \\
-           &       -                 &         -          &        -          &  0.848206583410427&  0.107159220467171  \\
-           &       -                 &         -          &        -          &  0.937273392400706&  0.0703660474881083 \\
-           &       -                 &         -          &        -          &  0.987992518020486&  0.0307532419961175
\bottomrule
\end{tabular}
\label{table:zerosPesosQuad} % is used to refer this table in the text
\end{table}


## closed as unclear what you're asking by doncherry, cmhughes, Jesse, jub0bs, ChrisSDec 12 '13 at 2:50

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Welcome to TeX.SX! You're missing \\ in the final row, before \bottomrule. – egreg Dec 12 '13 at 0:17
• Add \\ before \bottomrule, that should help. As well, please, enclose at least the minus signs of the negative numbers and the equalities in the top rule in $...$ to make it real math, like $-$ and n = 10. – yo' Dec 12 '13 at 0:17