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.

Having the following siunitx table code in LyX, for each occurrence of \toprule and \midrule I obtain an error message:

The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

I correctly imported siunitx in the preamble.
TexLive version: 2012.10.20121205_r28449.fc18

LaTeX code:

\centering
\sisetup{output-decimal-marker={,}}

\begin{tabular}{ccS}
\toprule
{Dimensione finestra} & {Perdita} & {Tempo}\\
{} & {} & {(secondi)}\\
\midrule
10                & 0$\%$       & 121\\
\midrule
10                & 10$\%$       & 127\\
\midrule
10                & 20$\%$       & 176\\
\midrule
10                & 30$\%$       & 257\\
\midrule
10                & 40$\%$       & 442\\
\midrule
10                & 50$\%$       & 780\\
\midrule
10                & 60$\%$       & 1226\\
\midrule
10                & 70$\%$       & 1469\\
\midrule
10                & 80$\%$       & 1904 \\
\midrule
10                & 90$\%$       & 3234 \\
\midrule
50                & 0$\%$        & 46 \\
\midrule
50                & 10$\%$       &109 \\
\midrule
50                & 20$\%$       &146 \\
\midrule
50                & 30$\%$       &202 \\
\midrule
50                & 40$\%$       &257 \\
\midrule
50                & 50$\%$       &373 \\
\midrule
50                & 60$\%$       &544 \\
\midrule
50                & 70$\%$       &760 \\
\midrule
50                & 80$\%$       &1356 \\
\midrule
50                & 90$\%$       &6588 \\
\midrule
100                & 0$\%$       &76 \\
\midrule
100                & 10$\%$       &91 \\
\midrule
100                & 20$\%$       &109 \\
\midrule
100                & 30$\%$       &146 \\
\midrule
100                & 40$\%$       &180 \\
\midrule
100                & 50$\%$       &297 \\
\midrule
100                & 60$\%$       &414 \\
\midrule
100                & 70$\%$       &585 \\
\midrule
100                & 80$\%$       &1355 \\
\midrule
100                & 90$\%$       &4326 \\

\bottomrule
\end{tabular}
share|improve this question
2  
Please include your preamble, so other people can try to compile your example. My guess is you need to load the booktabs package as well. –  Psirus Jan 22 '13 at 10:50
    
\usepackage{graphicx} \usepackage{siunitx} –  Caterpillar Jan 22 '13 at 10:53
    
Thank you Psirus, it worked \usepackage{booktabs} If you put an official answer I can give you the mark –  Caterpillar Jan 22 '13 at 10:55
    
Welcome to TeX.SX. –  Claudio Fiandrino Jan 22 '13 at 11:04

2 Answers 2

up vote 13 down vote accepted

\midrule is a command defined by the Booktabs package. Include \usepackage{booktabs} in your preamble to typeset your table.

share|improve this answer

Adding

\usepackage{booktabs}

solved the problem :O

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.