Graphics, Figures & Tablesmultirow, rccol | Empty Cells

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
zoparrat
Posts: 4
Joined: Fri Sep 24, 2010 3:43 pm

multirow, rccol | Empty Cells

Post by zoparrat »

I have a table where i'm using rccol to align decimals. I also have a bunch of empty cells and some multirows. Whenever the empty cells or multirows fall within the columns formatted with rccol, the cells are filled with 0.000's.

Is there a workaround for this?

Here's a simple example that works without rccol (I commented out the rccol line and replaced with regular formatting the line below)
Attached image is how this looks (without rccol, with rccol stuff is all over the place)

Code: Select all

\usepackage{booktabs,multirow,array,rccol}
\begin{table}[htbp]
  \centering
	  \caption{Mean and Standard Deviation of stuff.}    
		\footnotesize
		\resizebox{\textwidth}{!}{%
		%\begin{tabular}{@{}ccR[.][.]{3}{3}R[.][.]{3}{3}R[.][.]{3}{3}R[.][.]{3}{3}@{}}
    \begin{tabular}{@{}cccccc@{}}
    \addlinespace
    \toprule          
          &       &   \multicolumn{2}{c}{} 	& \multicolumn{2}{c}{stats} \\
          &       & \multicolumn{2}{c}{line1} & \multicolumn{2}{c}{method} \\
          &       & \multicolumn{2}{c}{line2} & \multicolumn{2}{c}{length, } \\
          &       &  \multicolumn{2}{c}{(segments)}   & \multicolumn{2}{c}{100 samples)} \\
		\cmidrule(lr{0.75em}){3-4}
		\cmidrule(lr{0.75em}){5-6}
    \multirow{2}[0]{*}{Case} & Distribution of & \multicolumn{1}{c}{$\mu$} & \multicolumn{1}{c}{$\sigma$} & \multicolumn{1}{c}{$\mu$} & \multicolumn{1}{c}{$\sigma$} \\
          & segments & \multicolumn{1}{c}{(unit)} & \multicolumn{1}{c}{(unit)} & \multicolumn{1}{c}{(unit)}& \multicolumn{1}{c}{(unit)} \\
					\midrule
    somestuff & (2 parameter) & 233.476 & 12.232 & 202.953 & 13.300 \\
					\midrule
    stuff1  & \multirow{4}{*}{some shared par.} & \multirow{4}{*}{223.105} & \multirow{4}{*}{1.345} & 234.094 & 1.000 \\
		stuff2  &  	& 	& 	& 259.106 & 1.022 \\
		stuff3 	& 	& 	& 	& 258.662 & 0.895 \\
		stuff4 	&  	& 	& 	& 259.599 & 0.547 \\
    \bottomrule
    \end{tabular}}%
  \label{tab:stuff}%
\end{table}%
Attachments
The table as it looks now without »rccol«.
The table as it looks now without »rccol«.
rccol-table.jpg (34.54 KiB) Viewed 2390 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
ptoche
Posts: 49
Joined: Thu Apr 12, 2007 10:41 am

multirow, rccol | Empty Cells

Post by ptoche »

I know this post is one year old, but there aren't many discussions about the rccol package. I just got interested in its functionalities, tried a few simple cases, but I must say I can replicate the OPs observations, and I have no idea if there might be a workaround.

I know that the siunitx package is often recommended, but I've been totally unable to make it work, despite installing and reinstalling it. So I'm very interested in hearing about a workaround based on rccol and not involving the siunitx package.

A slight editing of the OP's code below:

Code: Select all

\documentclass{article}
\usepackage{booktabs,multirow,array}
\usepackage{graphicx}
\usepackage[point]{rccol}
\newcolumntype{S}{R{3}{3}}



\begin{document}
    \begin{table}[htbp]
      \centering
              \caption{Mean and Standard Deviation of stuff.}
        \begin{tabular*}{\textwidth}{@{}ccSSSS@{}}
%         \begin{tabular}{@{}cccccc@{}}
        \addlinespace
        \toprule          
              &       &   \multicolumn{2}{c}{}      & \multicolumn{2}{c}{stats} \\
              &       & \multicolumn{2}{c}{line1} & \multicolumn{2}{c}{method} \\
              &       & \multicolumn{2}{c}{line2} & \multicolumn{2}{c}{length, } \\
              &       &  \multicolumn{2}{c}{(segments)}   & \multicolumn{2}{c}{100 samples)} \\
                    \cmidrule(lr{0.75em}){3-4}
                    \cmidrule(lr{0.75em}){5-6}
        \multirow{2}[0]{*}{Case} & Distribution of & \multicolumn{1}{c}{$\mu$} & \multicolumn{1}{c}{$\sigma$} & \multicolumn{1}{c}{$\mu$} & \multicolumn{1}{c}{$\sigma$} \\
              & segments & \multicolumn{1}{c}{(unit)} & \multicolumn{1}{c}{(unit)} & \multicolumn{1}{c}{(unit)}& \multicolumn{1}{c}{(unit)} \\
                                            \midrule
        somestuff & (2 parameter) & 233.476 & 12.232 & 202.953 & 13.300 \\
                                            \midrule
        stuff1  & \multirow{4}{*}{some shared par.} & \multirow{4}{*}{223.105} & \multirow{4}{*}{1.345} & 234.094 & 1.000 \\
                    stuff2  &       &       &       & 259.106 & 1.022 \\
                    stuff3  &       &       &       & 258.662 & 0.895 \\
                    stuff4  &       &       &       & 259.599 & 0.547 \\
        \bottomrule
        \end{tabular*}%
      \label{tab:stuff}%
    \end{table}%
    
\end{document}

Post Reply