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.

I'm learning using standalone package. I tried to create a page including a table but I got errors:

Error

Something's wrong--perhaps a missing \item. \begin{table}
Something's wrong--perhaps a missing \item. \begin{table}
Something's wrong--perhaps a missing \item. \begin{table}
Missing \endgroup inserted ...l mese per dispositivo in \si{\tera\byte}}
Missing \endgroup inserted ...l mese per dispositivo in \si{\tera\byte}}
Missing } inserted ...l mese per dispositivo in \si{\tera\byte}}
Undefined control sequence ...l mese per dispositivo in \si{\tera\byte}}
Extra \endgroup ...l mese per dispositivo in \si{\tera\byte}}
Something's wrong--perhaps a missing \item. \end{table}
\begin{document} ended by \end{table}. \end{table}
Extra \endgroup \end{table}
Too many }'s \end{document}

Code

\documentclass[12pt,a4paper]{standalone}

\usepackage{booktabs}
\usepackage{multirow}
\usepackage{siunitx}
\sisetup{
    binary-units = true
}

\begin{document}

    \begin{table}[htp]
        \centering
        \sisetup{table-format=7.0}
        \addtolength{\tabcolsep}{-1.0pt}
        \begin{tabular}{lS[table-format=6.0]
                         S[table-format=6.0]
                         S[table-format=6.0]
                         SSS}
            \toprule
            Device & 2011 & 2012 & 2013 & 2014 & 2015 & 2016 \\
            \midrule
            Non-smarthphones & 22686 & 55813 & 108750 & 196262 & 357797 & 615679 \\
            Smarthphones & 104759 & 365550 & 933373 & 1915173 & 3257030 & 5221497 \\
            Laptops e Netbooks & 373831 & 612217 & 917486 & 1340062 & 1963950 & 2617770\\
            Tablets & 17393 & 63181 & 141153 & 300519 & 554326 & 1083895\\
            Home gateways & 55064 & 108073 & 180562 & 267545 & 376494 & 514777 \\
            M2M & 23009 & 47144 & 92150 & 172719 & 302279 & 508022 \\
            Altri devices & 525 & 1460 & 5429 & 22966 & 84204 & 242681\\
            \bottomrule
        \end{tabular}
        \caption{Traffico mobile globale al mese per dispositivo in \si{\tera\byte}}
    \end{table}

\end{document}

Do I forget some package? Where could be the error?

share|improve this question
add comment

1 Answer

up vote 10 down vote accepted

it makes no sense to use the standalone class with a floating environment. Use a simple minipage and the \captionof command:

\documentclass[12pt,a4paper]{standalone}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{siunitx}
\sisetup{binary-units = true,table-format=7.0}
\begin{document}

\minipage{1.08\textwidth}
\addtolength{\tabcolsep}{-1.0pt}
\begin{tabular}{lS[table-format=6.0]
                 S[table-format=6.0]
                 S[table-format=6.0]
                 SSS} \toprule
Device & 2011 & 2012 & 2013 & 2014 & 2015 & 2016 \\\midrule
Non-smarthphones & 22686 & 55813 & 108750 & 196262 & 357797 & 615679 \\
Smarthphones & 104759 & 365550 & 933373 & 1915173 & 3257030 & 5221497 \\
Laptops e Netbooks & 373831 & 612217 & 917486 & 1340062 & 1963950 & 2617770\\
Tablets & 17393 & 63181 & 141153 & 300519 & 554326 & 1083895\\
Home gateways & 55064 & 108073 & 180562 & 267545 & 376494 & 514777 \\
M2M & 23009 & 47144 & 92150 & 172719 & 302279 & 508022 \\
Altri devices & 525 & 1460 & 5429 & 22966 & 84204 & 242681\\ \bottomrule
\end{tabular}
\captionof{table}{Traffico mobile globale al mese per dispositivo in \si{\tera\byte}}
\endminipage

\end{document}

Why do you want to use the class?

share|improve this answer
    
Ok of course.... I'm using this class because I would convert the table in png format –  Mazzy Jan 15 '13 at 10:20
1  
that's ok. And also the reason why the table environment makes no sense. –  Herbert Jan 15 '13 at 10:24
add comment

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.