![多行无法与 longtabu 一起使用](https://linux22.com/image/297938/%E5%A4%9A%E8%A1%8C%E6%97%A0%E6%B3%95%E4%B8%8E%20longtabu%20%E4%B8%80%E8%B5%B7%E4%BD%BF%E7%94%A8.png)
我无法使用multirow
。longtabu
问题是时间列没有像我期望的那样垂直居中multirow
。此外,我想multirow
在活动名称和活动信息列上使用 。这些列中的每一列都应跨越 3 行。任何帮助都非常感谢!
\documentclass{article}
%%%%%%%%%%%%%%%%%%%%%%
% Package Inclusions %
%%%%%%%%%%%%%%%%%%%%%%
\usepackage{tabu}
\usepackage{longtable}
\usepackage{seqsplit}
\usepackage{geometry}
\usepackage{pdflscape}
\usepackage{xparse}
\usepackage{array}
\usepackage{xstring}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{amssymb,amsfonts,textcomp}
\usepackage{multirow}
%used to print Spanish characters in the text
\usepackage[utf8]{inputenc}
\usepackage{amssymb}
\usepackage[english,spanish]{babel}
%%%%%%%%%%%%%%%%%%%%%%
% Configurations %
%%%%%%%%%%%%%%%%%%%%%%
\geometry{
top=0.50in,
inner=0.75in,
outer=0.75in,
bottom=0.50in,
headheight=3ex,
headsep=6ex,
}
\setlength{\LTpre}{1pt} % removes the white space before a long table
\setlength{\LTpost}{1pt} % removes the white space after a long table
\pagestyle{empty} % stops the page number from showing on each page
\tabulinesep=1mm
%%%%%%%%%%%%%%%%%%%%%%
% Start Report %
%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{landscape}
\Large
{\textbf{Test Report}}
\small
\begin{longtabu} to 9.5in {
|X[1.5,l,m]|
X[4,l,m]|
X[2.5,l,m]|
X[2,l,m]|
X[2,l,m]|
X[2,l,m]|
X[2,l,m]|
X[3,l,m]|
X[2,l,m]|
X[8,l,m]|
}
\hline
\multicolumn{4}{|l|}{\textbf{Customer Name:}} &
\multicolumn{5}{l|}{\textbf{Well Name:}} &
\multicolumn{1}{l|}{\textbf{Job Date:}}
\\
\multicolumn{4}{|l|}{test} &
\multicolumn{5}{l|}{test well} &
\multicolumn{1}{l|}{22/08/2014}
\\\hline
\multicolumn{4}{|l|}{\textbf{Customer Representative:}} &
\multicolumn{3}{l|}{\textbf{County/Parish:}} &
\multicolumn{2}{l|}{\textbf{State:}} &
\multicolumn{1}{l|}{\textbf{Job Category:}}
\\\cline{5-9}
\multicolumn{4}{|l|}{Health} &
\multicolumn{3}{c|}{test} &
\multicolumn{2}{c|}{Texas} &
\multicolumn{1}{l|}{Wash Fill/Sand Removal}
\\\hline
\multirow{3}{*}{\centering\textbf{Time}} &
\centering\textbf{Activity Name} &
\centering\textbf{Tubing Depth} &
\multicolumn{2}{c|}{\textbf{Pressure}} &
\centering\textbf{Tubing Weight} &
\centering\textbf{Liquid Rate} &
\centering\textbf{Flow Black Rate / Liquid Type} &
\centering\textbf{N2 Rate} &
\centering\textbf{Activity Info} \\\cline{4-5}
& & &
\centering\scriptsize\textbf{Circulation} &
\centering\scriptsize\textbf{Wellhead} &
& & & & \\\cline{3-9}
& &
\centering\scriptsize\textbf{Start/End} &
\centering\scriptsize\textbf{(psi)} &
\centering\scriptsize\textbf{(psi)} &
\centering\scriptsize\textbf{(lbs)} &
\centering\scriptsize\textbf{(bbl/min)} &
\centering\scriptsize\textbf{(bbl)/Name} &
\centering\scriptsize\textbf{(SCF/min)} &
\\\hline
\endhead
\multicolumn{3}{l}{Continued on next page ...} \\
\endfoot
\endlastfoot
& & & & & & & & &
\\\hline
\end{longtabu}
\begin{longtabu} to 9.5in {
|X[1.5,l,m]|
X[4,l,m]|
}
\hline
\multirow{9}{*}{test}
&1 \\ \cline{2-2}
&2 \\ \cline{2-2}
&3 \\ \cline{2-2}
&4 \\ \cline{2-2}
&5 \\ \cline{2-2}
&6 \\ \cline{2-2}
&7 \\ \cline{2-2}
&8 \\ \cline{2-2}
&9 \\ \cline{1-2}
\end{longtabu}
\end{landscape}
\end{document}
答案1
错误是由于OP 中只有Time
标签被 包裹。同一行中还有其他标签应该被 multirow{2} 包裹,例如、、和应该被 包裹。此外,在这种情况下,文本宽度需要指定其宽度以换行,而不是使用 * 表示自然宽度,如图所示,否则它会打印在一行中并触及边距。\multirow{3}
turbing depth
Turbine weight
Liquid rate
Activity name
Activity info
\multirow{3}
代码
\documentclass{article}
%%%%%%%%%%%%%%%%%%%%%%
% Package Inclusions %
%%%%%%%%%%%%%%%%%%%%%%
\usepackage{tabu}
\usepackage{longtable}
\usepackage{seqsplit}
\usepackage{geometry}
\usepackage{pdflscape}
\usepackage{xparse}
\usepackage{array}
\usepackage{xstring}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{amssymb,amsfonts,textcomp}
\usepackage{multirow}
%used to print Spanish characters in the text
\usepackage[utf8]{inputenc}
\usepackage{amssymb}
\usepackage[english]{babel}
%%%%%%%%%%%%%%%%%%%%%%
% Configurations %
%%%%%%%%%%%%%%%%%%%%%%
\geometry{
top=0.50in,
inner=0.75in,
outer=0.75in,
bottom=0.50in,
headheight=3ex,
headsep=6ex,
}
\setlength{\LTpre}{1pt} % removes the white space before a long table
\setlength{\LTpost}{1pt} % removes the white space after a long table
\pagestyle{empty} % stops the page number from showing on each page
\tabulinesep=1mm
%%%%%%%%%%%%%%%%%%%%%%
% Start Report %
%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{landscape}
\Large
{\textbf{Test Report}}
\small
\begin{longtabu} to 9.5in {
|X[1.5,l,m]|
X[4,l,m]|
X[2.5,l,m]|
X[2,l,m]|
X[2,l,m]|
X[2,l,m]|
X[2,l,m]|
X[3,l,m]|
X[2,l,m]|
X[8,l,m]|
}
\hline
\multicolumn{4}{|l|}{\textbf{Customer Name:}} &
\multicolumn{5}{l|}{\textbf{Well Name:}} &
\multicolumn{1}{l|}{\textbf{Job Date:}}
\\
\multicolumn{4}{|l|}{test} &
\multicolumn{5}{l|}{test well} &
\multicolumn{1}{l|}{22/08/2014}
\\\hline
\multicolumn{4}{|l|}{\textbf{Customer Representative:}} &
\multicolumn{3}{l|}{\textbf{County/Parish:}} &
\multicolumn{2}{l|}{\textbf{State:}} &
\multicolumn{1}{l|}{\textbf{Job Category:}}
\\\cline{5-9}
\multicolumn{4}{|l|}{Health} &
\multicolumn{3}{c|}{test} &
\multicolumn{2}{c|}{Texas} &
\multicolumn{1}{l|}{Wash Fill/Sand Removal} \\ \hline
\multicolumn{1}{|c|}{\multirow{3}{*}{\centering\textbf{Time}}} &
\multicolumn{1}{c|} {\multirow{3}{*}{\centering\textbf{Activity Name}}} &
\multicolumn{1}{c|}{\multirow{2}{1cm}{\centering\textbf{Tubing Depth}}} &
\multicolumn{2}{c|}{\centering\textbf{Pressure}} &
\multicolumn{1}{c|}{\multirow{2}{1cm} {\centering\textbf{Tubing Weight}}} &
\multicolumn{1}{c|}{\multirow{2}{1cm}
{\centering\textbf{Liquid Rate}}}&
\multicolumn{1}{c|}{\multirow{2}{3cm}{\centering\textbf{Flow black Rate / Liquid Type}}} &
\multicolumn{1}{c|}{\multirow{2}{1cm}{\centering\textbf{N2 Rate}}}&
\multicolumn{1}{c|}{\multirow{3}{*}{\centering\textbf{Activity Info}}} \\\cline{4-5}
& & &
\centering\scriptsize\textbf{Circulation} &
\centering\scriptsize\textbf{Wellhead} &
& & & & \\\cline{3-9}
& &
\centering\scriptsize\textbf{Start/End} &
\centering\scriptsize\textbf{(psi)} &
\centering\scriptsize\textbf{(psi)} &
\centering\scriptsize\textbf{(lbs)} &
\centering\scriptsize\textbf{(bbl/min)} &
\centering\scriptsize\textbf{(bbl)/Name} &
\centering\scriptsize\textbf{(SCF/min)} &
\\\hline %cline{3-9}
\endhead
\multicolumn{3}{l}{Continued on next page ...} \\
\endfoot
\endlastfoot
& & & & & & & & &\\\hline
\end{longtabu}
\begin{longtabu} to 9.88 in {
|X[1.5,l,m]|
X[4,l,m]|
}
\hline
\multirow{9}{*}{test}
&1 \\ \cline{2-2}
&2 \\ \cline{2-2}
&3 \\ \cline{2-2}
&4 \\ \cline{2-2}
&5 \\ \cline{2-2}
&6 \\ \cline{2-2}
&7 \\ \cline{2-2}
&8 \\ \cline{2-2}
&9 \\ \cline{1-2}
\end{longtabu}
\end{landscape}
\end{document}