I am a complete beginner in Latex. I wanted to create a table. Unfortunately it was a bit crowded and it did not fit into the page. So, I wanted to decrease font size inside the table and googled it. I found [this][1] answer and applied it. It helped me to fit the table into the page but now, I cannot add caption to my table. Whenever I try to add it I got the following error:
You can't use `\hrule' here except with leaders. \caption@hrule ->\hrule \@height \z@ l.203 \end{tabular}}
Here is the code I use to create the table:
\begin{table}
\resizebox{\textwidth}{!}{%
\centering
\captionsetup{labelformat=empty}
\caption{Data statistics Treebanks. The values on \{Train,Dev,Test\}-Set columns are the number of tokens in the splits. Unique tags column gives the number of distinct sets of tags (pos + morphological features) assigned to words, unique features gives the number of distinct features that exist in the dataset.}
\begin{tabular}{llllll|llllll}
\multicolumn{1}{c}{\textbf{lang}} & \multicolumn{1}{c}{\textbf{train}} & \multicolumn{1}{c}{\textbf{dev}} & \multicolumn{1}{c}{\textbf{test}} & \multicolumn{1}{c}{\textbf{\textbar{}T\textbar{}}} & \multicolumn{1}{c|}{\textbf{\textbar{}F\textbar{}}} & \multicolumn{1}{c}{\textbf{lang}} & \multicolumn{1}{c}{\textbf{train}} & \multicolumn{1}{c}{\textbf{dev}} & \multicolumn{1}{c}{\textbf{test}} & \multicolumn{1}{c}{\textbf{\textbar{}T\textbar{}}} & \multicolumn{1}{c}{\textbf{\textbar{}F\textbar{}}} \\
\hline
ar & 1 & 4 & 2 & 123 & 123123 & es & 123 & 902 & 123 & 234 & 31567 \\
bg & 3425 & 45 & 234 & 5252 & 1231634 & pt & 755 & 234 & 645 & 2464 & 242 \\
cs & 767 & 23 & 86 & 345453 & 23422 & sk & 3453 & 1231 & 235 & 43243 & 34663 \\
en & & & & & & sl & & & & & \\
et & & & & & & ru & & & & & \\
fr & & & & & & hi & & & & & \\
hu & & & & & & lv & & & & & \\
ro & & & & & & nl & & & & & \\
tr & & & & & & pl & & & & & \\
hr & & & & & & de & & & & & \\
it & & & & & & gr & & & & & \\
da & & & & & & la & & & & & \\
ca & & & & & & ko & & & & & \\
fi & & & & & & ir & & & & &
\end{tabular}}
\end{table}
The packages I am using:
\usepackage{booktabs}
\usepackage{float}
\usepackage{breakcites}
\usepackage{svg}
\usepackage{graphics}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{caption}
If I comment the \captionsetup
and \caption
lines, table appears without caption