1

I am trying to make a table where I define my training and validation sets. To do this I want a multicolumn table, written like this:

\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{table}[h!]
\small
\caption{Expert Model Forecasts}
\label{table:5:2}
\begin{tabular*}{\textwidth}{
  @{\extracolsep{\fill}}
  l
  *{5}{S}
  @{}
} 
\toprule
{} &  \multicolumn{2}{c}{Training Set} & \multicolumn{2}{c}{Validation Set}
 \\
\cmidrule(lr){2-3} \cmidrule(lr){4-5} 
{} & {start} & {end} & {start} & {end}  \\
\midrule
(1) & 2020.01.01 & 2021.01 & 45.33 & 22.02\\
(2)  & 2020.0101 &  7.06 & 13.51 &  7.10  \\
\bottomrule
\end{tabular*}
\end{table} \\
\end{document}

My initial question, when I started to write this post, was why the dates do not show in the table. But when I created this example in a empty overleaf project, I realize that the dates DO show. So, my question now is why they show in this example but they don't show in my main project. See examples below.

I realize this question can be hard to answer, but maybe someone knows what can cause this problem.

This is the template I am using for my project.

enter image description here enter image description here

1 Answer 1

1

Two problems:

  • you need to load some package like siunitx which defines the S column

  • your date format with two periods is not really suitable for an S column, I suggest to left or right align it instead.


\documentclass{article}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
\begin{table}[h!]
\small
\caption{Expert Model Forecasts}
\label{table:5:2}
\begin{tabular*}{\textwidth}{
  @{\extracolsep{\fill}}
  ll
  *{4}{S}
  @{}
} 
\toprule
{} &  \multicolumn{2}{c}{Training Set} & \multicolumn{2}{c}{Validation Set}
 \\
\cmidrule(lr){2-3} \cmidrule(lr){4-5} 
{} & {start} & {end} & {start} & {end}  \\
\midrule
(1) & 2020.01.01 & 2021.01 & 45.33 & 22.02\\
(2)  & 2020.0101 &  7.06 & 13.51 &  7.10  \\
\bottomrule
\end{tabular*}
\end{table} 
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .