2

The following minimal working example,

\documentclass{article}

\usepackage{booktabs}
\usepackage{siunitx}

\begin{document}

\begin{tabular}{
    >{\em}l
    S[round-mode=places, round-precision=1, table-format= -1.1]
    >{{{(}}}
    S[round-mode=places, round-precision=1, table-format= -1.1,table-space-text-pre={[}] 
    @{,\,}
    S[round-mode=places, round-precision=1, table-format= -1.1,table-space-text-post={]}]
    <{{{)}}}
    S[round-mode=places, round-precision=2, table-format=1.2] 
    S[round-mode=places, round-precision=2, table-format=1.2] 
}

\toprule
{} & \multicolumn{5}{c}{dB re. 40/s conv.} \\
\cmidrule(lr){2-6}
{} & & & & \multicolumn{2}{c}{Probability} \\
 \cmidrule(lr){5-6}
{{}}&\multicolumn{3}{c}{Mean (95\% CI)}&{$<\pm 2.5dB$}&{$<\pm 5dB$} \\
\midrule
oranges  &          0.410188 & -1.791145 &  2.505052 &     0.967500 &   0.999875 \\
bananas   &          0.006144 & -2.185644 &  2.184911 &     0.973375 &   0.999875 \\
\bottomrule
\end{tabular}

\end{document}

Produces

screenshot of PDF output

How do I prevent the >, @ and < operators from adding to certain rows (e.g., the header)?

2
  • 1
    Welcome to TeX SX! What do you mean with adding to certain rows?
    – Bernard
    Dec 17 '19 at 22:07
  • 1
    Enclose the cell in a \multicolumn{1}{<lcr>}{Cell content}
    – Sveinung
    Dec 17 '19 at 22:37
2

Enclose the cell in a \multicolumn{1}{<lcr>}{Cell content}. As you will see from your MWE, I added @{} to the first column to remove the side bearing. The multicolumn command in col 1 row 4 overrides both the @{}-command and the \itshape-command (\em is for LaTex 2.09).

If you are asking how to get rid of ( , ) in the second row, the answer is the same: Use multicolumn that spans the affected columns. See (updated) MWE:

enter image description here

\documentclass{article}

\usepackage{booktabs}
\usepackage{siunitx}

\begin{document}

\begin{tabular}{@{}
    >{\itshape}l
    S[round-mode=places, round-precision=1, table-format= -1.1]
    >{{{(}}}
    S[round-mode=places, round-precision=1, table-format= -1.1,table-space-text-pre={[}] 
    @{,\,}
    S[round-mode=places, round-precision=1, table-format= -1.1,table-space-text-post={]}]
    <{{{)}}}
    S[round-mode=places, round-precision=2, table-format=1.2] 
    S[round-mode=places, round-precision=2, table-format=1.2] 
}

\toprule
{} & \multicolumn{5}{c}{dB re. 40/s conv.} \\
\cmidrule(lr){2-6}
{} & \multicolumn{2}{l}{}& \multicolumn{1}{l}{}& \multicolumn{2}{c}{Probability} \\
 \cmidrule(lr){5-6}
{{}}&\multicolumn{3}{c}{Mean (95\% CI)}&{$<\pm 2.5dB$}&{$<\pm 5dB$} \\
\midrule
\multicolumn{1}{l}{oranges}  &          0.410188 & -1.791145 &  2.505052 &     0.967500 &   0.999875 \\
bananas   &          0.006144 & -2.185644 &  2.184911 &     0.973375 &   0.999875 \\
\bottomrule
\end{tabular}

\end{document}
1

It is not clear what is your problem, but I guessing, that you looking for the following:

enter image description here

\documentclass{article}
\usepackage{booktabs}
\usepackage{siunitx}

\begin{document}
    \begin{table}[ht]
    \sisetup{input-symbols=<,
             round-mode=places, 
             round-precision=1, 
             per-mode=symbol
             }
\begin{tabular}{
    >{\itshape}l
    S[table-format=1.1]
    >{(}
    S[input-open-uncertainty = ,table-format=-1.1,table-space-text-pre={(},]
    @{\,,\,}
    S[input-close-uncertainty= ,table-format= 1.1,table-space-text-post=)]
    <{)}
    S[round-precision=2, table-format=1.2]
    S[round-precision=2, table-format=1.2]
            }
    \toprule
        & \multicolumn{5}{c}{dB re. \SI{40}{\per\second} conv.} \\
    \cmidrule(l){2-6}
        &  \multicolumn{3}{c}{} &   \multicolumn{2}{c}{Probability} \\
    \cmidrule(l){5-6}
        &\multicolumn{3}{c}{Mean (\SI{95}{\%} CI)} 
                                            & {\SI{<\pm 2.5}{dB}}
                                                        & {\SI{<\pm 5}{dB}} \\
\midrule
oranges & 0.410188 & -1.791145 &  2.505052  &  0.967500 &   0.999875 \\
bananas & 0.006144 & -2.185644 &  2.184911  &  0.973375 &   0.999875 \\
\bottomrule
\end{tabular}
    \end{table}
\end{document}

As you can see, I exploit siunitx packages also at writing units.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.