如何使用 \multirowcell?

如何使用 \multirowcell?

这个问题与我几天前提出的另一个问题有关:如何制作包含多个多行的表格_

我遇到的问题是我的文本不能很好地适应 \multirowcell,并且我无法找到太多信息来解决此问题。

在此处输入图片描述

这是我正在使用的真实表格,因此您可以明白我的意思。非常感谢您的意见。

% 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}

答案1

也许这不是很好,而且肯定不是处理该问题的完美方法,但我\multirowcell以前从未使用过:

似乎您必须将文本行数作为参数提供给此单元格,而不是(像 中一样\multirow)仅提供垂直单元格数。这是我的方法,适合您的情况。如果您需要修改并希望\multirowcell进一步使用 -command,您应该阅读记录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}

在此处输入图片描述

相关内容