1

As a follow up to my question here

I tried to change the 5-column table in the question above to a 4 column table. Now, I want to change it to a 3 column table.

Here is my 4 column table:

\begin{table*}
\centering
\caption{ Significance test between top performing models.}
\label{table:sign_tok}
\begin{tabular}{@{}lS[table-format=4] *{2}{S[table-format=2.1]@{\;(}S[table-format=2.1(2)]@{)\;}l} @{}}
  \toprule
 {\thead{Source}}& {\thead{Target}} & \multicolumn{3}{l}{\thead[l]{BLEU $(\mu \pm 0.95 \%)$}}  & \multicolumn{3}{l}{\thead[l]{CHRF2++ $(\mu \pm 0.95 \%)$}}   \\ 
  \midrule
TokA  & TokB   & 29.7 & 29.7(8) &      & 53.1 & 53.1(7)  \\
TokC  & TokW   & 31.6 & 31.6(8) & (p=0.0010)* & 52.2 & 52.2(7) & (p = 0.0010)* \\

\bottomrule \end{tabular} \end{table*}

This is how my 4-column table looks:

My 4 column table

How can I remove the first column of the above table to change it to a 3 column table

I believe changing this line of the latex code will do the job, but I don't quite understand what it does if someone could explain it to me.

\begin{tabular}{@{}lS[table-format=4] *{2}{S[table-format=2.1]@{\;(}S[table-format=2.1(2)]@{)\;}l} @{}}
M.A.G
  • 135
  • 4
  • 2
    table-format define format of numbers in columns: table-format=<number of integer digits>.<number of decimal digits>. Your table is not very clear. What is difference between third and fourth column). What is data in fifth column? etc. Why this columns haven't own headers? – Zarko Jan 19 '22 at 21:48
  • @Zarko I originally has a 5 column table and I tried to change it to 4 and now to 3, I tried to follow the answer here: https://tex.stackexchange.com/questions/625276/content-in-last-two-columns-are-overflowing-each-other – M.A.G Jan 19 '22 at 21:59
  • @Zarko I updated my question with a picture. I hope it's a bit clearer now – M.A.G Jan 19 '22 at 22:13
  • The second column (Target) doesn't need the S-type column specification; using l would suffice (like with Source). – Werner Jan 19 '22 at 22:29

1 Answers1

1

See, if the following solution works for you:

\documentclass[twocolumn]{article}
\usepackage{booktabs, makecell, multirow}
\renewcommand\theadfont{\normalsize\bfseries}
\renewcommand\theadgape{}
\usepackage{siunitx}
\sisetup{
output-open-uncertainty = (,
output-close-uncertainty = ),
uncertainty-mode=separate
}%

\begin{document} \begin{table} \centering \caption{ Significance test between top performing models.} \label{table:sign_tok} \begin{tabular}{@{}lc {2}{S[table-format=2.1] @{;(} S[table-format=2.1(2)] @{,)\quad } l} @{}} \toprule \multicolumn{2}{c}{\thead{Segmentation}} & \multicolumn{6}{c}{} \ \cmidrule(r){1-2} \thead{Source} & \thead{Target} & \multicolumn{3}{l}{\multirow{-2.2}{\thead[l]{BLEU $(\mu \pm 0.95 %)$}}} & \multicolumn{3}{l}{\multirow{-2.2}{\thead[l]{CHRF2++ $(\mu \pm 0.95 %)$}}} \ \midrule SPM & SPM & 29.7 & 29.7(8) & & 53.1 & 53.1(7) & \ ATB & RAW & 31.6 & 31.6(8) & (p=0.0010)* & 52.2 & 52.2(7) & (p = 0.0010)* \ D3 & RAW & 32.9 & 32.9(10) & (p=0.0010)* & 53.4 & 53.4(6) & (p = 0.0909) \ SPM & RAW & 29.7 & 29.7(8) & (p=0.4256) & 50.4 & 50.4(7) & (p = 0.0010)* \ \bottomrule \end{tabular} \end{table*} \end{document}

enter image description here

Addendum To have only three columns (well, I would rather have four):

\documentclass[twocolumn]{article}
\usepackage{booktabs, makecell, multirow}
\renewcommand\theadfont{\normalsize\bfseries}
\renewcommand\theadgape{}
\usepackage{siunitx}
\sisetup{
uncertainty-mode=separate
}%

\begin{document} \begin{table} \centering \caption{ Significance test between top performing models.} \label{table:sign_tok} \begin{tabular}{@{} lll @{}} \toprule \thead{Segmentation of\ Source and Target} & \thead[l]{BLEU $(\mu \pm 0.95 %)$} & \thead[l]{CHRF2++ $(\mu \pm 0.95 %)$} \ \midrule SPM SPM & 29.7 (\num{29.7(8)}) & 53.1 (\num{53.1(7)}) \ ATB RAW & 31.6 (\num{31.6(8)}) (p=0.0010) & 52.2 (\num{52.2(7)}) (p = 0.0010)* \ D3 RAW & 32.9 (\num{32.9(10)}) (p=0.0010)* & 53.4 (\num{53.4(6)}) (p = 0.0909) \ SPM RAW & 29.7 (\num{29.7(8)}) (p=0.4256) & 50.4 (\num{50.4(7)}) (p = 0.0010)* \ \bottomrule \end{tabular} \end{table*} \end{document}

enter image description here

With four columns is much nicer (to my opinion):

\documentclass[twocolumn]{article}
\usepackage{booktabs, makecell, multirow}
\renewcommand\theadfont{\normalsize\bfseries}
\renewcommand\theadgape{}
\usepackage{siunitx}
\sisetup{
uncertainty-mode=separate
}%

\begin{document} \begin{table} \centering \caption{ Significance test between top performing models.} \label{table:sign_tok} \begin{tabular}{@{} ccll @{}} \toprule \multicolumn{2}{c}{\thead{Segmentation}} & \multirow{2.2}{}{\thead[l]{BLEU $(\mu \pm 0.95 %)$}} & \multirow{2.2}{}{\thead[l]{CHRF2++ $(\mu \pm 0.95 %)$}} \ \cmidrule(r){1-2} \thead{Source} & \thead{Target} & & \ \midrule SPM & SPM & 29.7 (\num{29.7(8)}) & 53.1 (\num{53.1(7)}) \ ATB & RAW & 31.6 (\num{31.6(8)}) (p=0.0010) & 52.2 (\num{52.2(7)}) (p = 0.0010)* \ D3 & RAW & 32.9 (\num{32.9(10)}) (p=0.0010)* & 53.4 (\num{53.4(6)}) (p = 0.0909) \ SPM & RAW & 29.7 (\num{29.7(8)}) (p=0.4256) & 50.4 (\num{50.4(7)}) (p = 0.0010)* \ \bottomrule \end{tabular} \end{table*} \end{document}

enter image description here

Zarko
  • 296,517
  • Thank you so much; however, I do not want two columns under segmentation. I do not want anything under segmentation. I just want one value per row for a segmentation column, so my table has in total 3 cols – M.A.G Jan 19 '22 at 22:27
  • at least you should have 4 columns .... apparently you like to drill a hole with square dril bit ... See addendum to answer. – Zarko Jan 19 '22 at 22:44
  • Thank you! Thing is, I won't be combining both Source and Target values together with a space, I am going to replace them with one value, that's why I wanted one column header. But Thank you again! This answers my question now – M.A.G Jan 19 '22 at 22:56