# LaTex Table using Multirow and @-expressions

I am encountering problems combining the package multirow with the @-expressions. Basically, my table shall look like the one in the following picture:

Now I want to adjust all plusminus signs so they are straight below each other. Therefore, I use the $c@{ \pm }c$ statement behind the \begin{tabular} command. See:

\documentclass{scrbook}

\begin{table}[htbp]
\begin{minipage}{\textwidth}
\renewcommand{\arraystretch}{1.3}
\caption[...]{...}
\label{...}

\begin{tabular}{c | c@{ $\pm$ }c | c@{ $\pm$ }c }

\multicolumn{1}{c|}{\bf{STATION}}   &  \multicolumn{2}{c}{\bf{SKEW VALUES}} \\ \hline
& \bf{Single Traces [s]} & \bf{Stacked Traces [s]}  \\ \hline

RUM41  &  1.089 & 12.337  &  0.888 & 1.278  \\
RUM42  &  0.193 & 2.626  &  0.074 & 0.580  \\
...

\end{tabular}
\end{minipage}
\end{table}


All I get, the @-expression interprets the multicolumn "&" as something to align (see table2). That makes sense but is not desired. Clearly, I would need a command which does an exception of the @-expression for a specific line I state, in this case the multicolumn line. I couldn't find it. Anyone having an idea?

Furthermore, is there a way of fixing the cell width in:

\begin{tabular}{c | c@{ $\pm$ }c | c@{ $\pm$ }c }


m{4cm} does not work for example.

• You want r@{${}\pm{}$}l Jul 11, 2014 at 17:33
• that didn't make it. Actually, it changed nothing. :( Jul 11, 2014 at 17:37

You may want to use dcolumn; playing with the values (here 6.8 and 6.7) is necessary because of the headers wide than the entries.

\documentclass{scrbook}
\usepackage{dcolumn}
\newcolumntype{P}[1]{D{+}{{}\pm{}}{#1}}

\begin{document}

\begin{table}[htbp]
\renewcommand{\arraystretch}{1.3}
\caption[...]{...}\label{...}

\begin{tabular}{c | P{6.8} | P{6.7} } % play with the values to get centering

\textbf{STATION} & \multicolumn{2}{c}{\textbf{SKEW VALUES}} \\
\hline
& \multicolumn{1}{c|}{\textbf{Single Traces [s]}}
& \multicolumn{1}{c}{\textbf{Stacked Traces [s]}} \\
\hline
RUM41 & 1.089 + 12.337 & 0.888 + 1.278  \\
RUM42 & 0.193 +  2.626 & 0.074 + 0.580  \\

\end{tabular}
\end{table}

\end{document}


Note that \bf has been obsolete for more than twenty years.

• Thanks for your help. But again, this doesn't make it as your picutre shows as well. I want to have it like in the first picture. Jul 11, 2014 at 17:51
• @johngoldenboy I just used your input. I'll fix it soon. Jul 11, 2014 at 19:33

I found it out myself using multirow and creating tables within single cells. I post the code and the result in the following:

\begin{table}[htbp]\centering
\renewcommand{\arraystretch}{1.3}
\caption[..]{..}
\label{..}

\begin{tabular}{c | c | c | c | c }

\textbf{STATION}    &   \multicolumn{4}{c}{\textbf{SKEW VALUE}} \\
\hline

&   \multicolumn{2}{c|}{\textbf{Single Traces [s]}} &  \multicolumn{2}{c}{\textbf{Stacked Traces [s]}}\\
\hline

\multicolumn{1}{c|}{  \begin{tabular}{c}
RUM41 \\
RUM42 \\
RUM43 \\
RUM44 \\
RUM45 \\
RUM46 \\
RUM48 \\
\end{tabular}}      &   \multicolumn{2}{c|}{  \begin{tabular}{r@{${}\pm{}$}l}
1.089   &   12.337  \\
0.193   &   2.626   \\
-0.888  &   2.494   \\
-1.441  &   0.873   \\
-0.889  &   0.030   \\
0.563   &   1.100   \\
-1.142  &   0.287   \\
\end{tabular}}          & \multicolumn{2}{c}{   \begin{tabular}{r@{${}\pm{}$}l}
0.888       &   1.278  \\
0.074       &   0.580  \\
-0.863      &   0.610  \\
-1.336      &   0.720  \\
-0.828      &   0.263  \\
0.601       &   0.189  \\
-0.992      &   0.418  \\
\end{tabular}
}\\

\end{tabular}
\end{table}


I used a lot of tabs to make clear what belongs where.