2

This question is connected to another one I asked some days ago: How to do a table with multiple multirows_.

The problem I have is that my text does not fit nicely in the \multirowcell and I haven't been able to find too much information to fix this issue.

enter image description here

This is the real table I'm working with so you can see what I mean. Thanks a lot for input.

% Doc. structure
\documentclass[11pt,a4paper]{report}


% Packages
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[]{graphicx} % Loading graphicx in the preamble it's possible to import pdf images in the document
\usepackage{float}
\usepackage{multicol}
\usepackage[round]{natbib} % For citations
\newcommand{\textsubscript}[1]{$_{\text{#1}}$}
\newcommand{\textdegree}[1]{${^\circ}$}
\usepackage[nomarginpar]{geometry}
\usepackage{array, booktabs, tabularx, makecell, multirow}
\renewcommand{\tabularxcolumn}[1]{>{\raggedright\arraybackslash}m{#1}}
\renewcommand\cellalign{Xc}

\begin{document}

\vspace*{1\baselineskip}
\centering
\begin{tabularx}
\linewidth{ | *{3}{ >{\centering}m{2.8cm}|} X |}
\cline{2-4}
\multicolumn{1}{c|}{}  
& 
Soil required in lab (Sieved \textless 2mm &
Soil collected in the field & 
Notes \\
\hline
\multirow{3}{*}
{Fresh sample} & 
Incubations 60 g (105C dry conversion) x 2 & 
Incubations  about 200 g (moist) x 2 & 
\multirowcell{3}{Big losses during sieving. From here:
    \begin{description}
    \item[-] Long-term incubation
    \item[-] Short-term incubation. From soil solution: DOC, DMN, DMP
    \item[-] Water retention curve \& equivalent 105 
    \item[-] pH
    \end{description}} \\
\cline{2-3}
& 
Water retention curve $\sim$\,150\,g & 
Water retention curve $\sim$\,200\,g & 
\\
\hline
Frozen sample & 
$\sim$\,60\,g (105C dry conversion) & 
$\sim$\,150\,g fresh soil & 
From here, mineral N and P. To compare results of saturation paste with soil solution extract at day 0. \\
\hline
Dry sample &
$\sim$\,60\,g &
$\sim$\,150\,g fresh soil &
From here:
    \begin{description}
    \item[-] Fe, Al
    \item[-] Organic N, P
    \item[-] Organic C
    \item[-] Bulk soil 14C
    \item[-] Carbonates
    \item[-] Clay
    \end{description}\\
\hline
\end{tabularx}

\end{document}
user3262756
  • 155
  • 1
  • 6
  • Edit please make you example complete and compilable! – LaRiFaRi Jul 21 '14 at 14:17
  • It actually works for me... Maybe this helps? \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage[]{graphicx} \usepackage{float} \usepackage{multicol} \usepackage[round]{natbib} % For citations \newcommand{\textsubscript}[1]{$_{\text{#1}}$} \newcommand{\textdegree}[1]{${^\circ}$} \usepackage[nomarginpar]{geometry} \usepackage{array, booktabs, tabularx, makecell, multirow} \renewcommand{\tabularxcolumn}[1]{>{\raggedright\arraybackslash}m{#1}} \renewcommand\cellalign{Xc} – user3262756 Jul 21 '14 at 14:18
  • without packages, documentclass, \begin{document}...? It may seem tedious to you to write all of this, but with out it, we will have to do the work and we will be guessing around. You will always get better (and faster) help with an MWE. – LaRiFaRi Jul 21 '14 at 14:20
  • 1
    Just edited, I think it should work now! Thanks! – user3262756 Jul 21 '14 at 14:26
  • Instead of multirow you could also use nested tabulars: http://tex.stackexchange.com/a/188523/5049 – cgnieder Jul 22 '14 at 07:45
  • @cgnieder, nested tabular looks really interesting for the type of tables I'm working with. I'll definitely will have a look at it. Thanks a lot! – user3262756 Jul 22 '14 at 14:05

1 Answers1

2

Maybe this is not very nice and most certainly not the perfect way to handle that, but I never used \multirowcell before:

It seems like you have to give the number of text-lines as argument to this cell and not (like in \multirow) only the number of vertical cells. Here is my approach which draws right for your case. If you need to modify and want to use the \multirowcell-command further, you should read the documentation of makecell.

% arara: pdflatex

\documentclass[11pt,a4paper]{report}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}
\usepackage[nomarginpar]{geometry} 
\usepackage{tabularx, makecell, multirow} 
\renewcommand{\tabularxcolumn}[1]{>{\raggedright\arraybackslash}m{#1}} \renewcommand\cellalign{Xc}
\usepackage{caption}
\usepackage{siunitx}
\usepackage{enumitem}

\begin{document}
\begin{table}
\caption{Caption}
\centering
\begin{tabularx}
\linewidth{ | *{3}{ >{\centering}m{2.8cm}|} X |}
\cline{2-4}
\multicolumn{1}{c|}{}  
& 
Soil required in lab (Sieved < \SI{2}{\milli\metre} &
Soil collected in the field & 
Notes \\
\hline
\multirow{12}{*}
{Fresh sample} & 
\multirowcell{6}{Incubations \SI{60}{\gram}\\ (105C dry\\ conversion)${}\times 2$} & 
\multirowcell{6}{Incubations\\ about \SI{200}{\gram}\\ (moist)${}\times 2$} & 
\multirowcell{12}{Big losses during sieving. From here:
    \begin{itemize}[leftmargin=2ex]
        \renewcommand\labelitemi{--}
    \item Long-term incubation
    \item Short-term incubation. From soil solution: DOC, DMN, DMP
    \item Water retention curve \& equivalent 105 
    \item pH
    \end{itemize}}\\
&&&\\
&&&\\
&&&\\
&&&\\
&&&\\\cline{2-3}
&\multirowcell{6}{Water retention\\ curve $\sim \SI{150}{\gram}$}&\multirowcell{6}{Water retention\\ curve $\sim \SI{200}{\gram}$}&\\
&&&\\
&&&\\
&&&\\
&&&\\
&&&\\
\hline
Frozen sample & 
$\sim\SI{60}{\gram}$ (105C dry conversion) & 
$\sim\SI{150}{\gram}$ fresh soil & 
From here, mineral N and P. To compare results of saturation paste with soil solution extract at day 0. \\
\hline
Dry sample &
$\sim\SI{60}{\gram}$ &
$\sim\SI{150}{\gram}$ fresh soil &
From here:
    \begin{itemize}[leftmargin=2ex]
        \renewcommand\labelitemi{--}
    \item Fe, Al
    \item Organic N, P
    \item Organic C
    \item Bulk soil 14C
    \item Carbonates
    \item Clay
    \end{itemize}\\
\hline
\end{tabularx}
\end{table}
\end{document}

enter image description here

LaRiFaRi
  • 43,807