I am running into a problem while using the following code and I have tried every means to diagnose the problem (ie: commenting the contents out), but I have not been successful at finding the bug.
The code is as follows:
\documentclass{beamer}
\usepackage{booktabs,makecell,multirow,tabularx}
\usepackage{ragged2e}
\renewcommand\theadfont{\normalfont\bfseries}
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}
\newcolumntype{C}{>{\Centering\arraybackslash}X}
\newcommand\mc[1]{\multicolumn{2}{c}{#1}}
\setlength\parindent{0pt}
%\usepackage[justification=centering]{caption}
\usepackage{siunitx}
\usepackage{tikz}
\usepackage{adjustbox}
\begin{document}
\begin{frame}[shrink=30]{Summary Statistics}
\vspace*{2em}
\setlength{\tabcolsep}{4pt}
\begin{tabularx}{\textwidth}{@{} l L *{10}{S[table-format=3.3]} @{}}
\toprule
\thead[lc]{Benchmark} & \thead{(1,1)} & {\thead{(2,1)}} & {\thead{(3,1)}} & {\thead{(4,1)}} & {\thead{(5,1)}} & {\thead{(6,1)}} \
& {\thead{(7,1)}} & \thead{(8,1)} & {\thead{(9,1)}} & {\thead{(10,1)}} & {\thead{(11,1)}} & {\thead{(12,1)}} \\
\midrule
(1,1) & 0.00 & 0.01 & 0.02 & 0.02 & 0.03 & 0.03 & 0.05 & 0.02 & 0.01 & 0.01 & 0.09 & 0.00 \\
\bottomrule
\end{tabularx}
\end{frame}
The message I am getting is: "extra } or $", but I have checked everywhere and I don't see any problems. Hence, I would appreciate any help and advice.
Best Answer
If the objective is to make the width of the table equal to the width of the textblock, using a
tabular*
environment instead of atabularx
environment (with a single X-like column) seems preferable.Incidentally, you may want to rethink using bold lettering for the header row. Sandwiching the header row between
\toprule
and\midrule
is more than enough to give it all the visual prominence it requires; too much bold material quickly risks creating a vulgar look. The second table in the screenshot below demonstrates that (in my opinion) bold lettering is quite unnecessary.