我想增加第 3 行和第 4 行的高度,以便有足够的空间放置标题“可调整大小吗?”,这样看起来不错。下面的设置是我的尝试,但第 1 行和第 2 行看起来仍然很丑。
平均能量损失
\documentclass[preview,border=12pt,12pt,varwidth]{standalone}
\usepackage{longtable,array,multirow,graphicx}
\LTpre=0pt\relax% to remove excessive border at the top of longtable.
\let\mc=\multicolumn
\let\mr=\multirow
\let\cl=\cline
\renewcommand\arraystretch{5}
\begin{document}
\topskip=0pt\relax
\begin{longtable}{|*4{c|}}\cl{3-4}
\mc{2}{c|}{\mr{2}{*}{}} & \mc{2}{c|}{A container?}\\\cl{3-4}
\mc{2}{c|}{} & No & Yes \\\hline
\mr{2}{*}{\rotatebox[origin=c]{90}{Adjustable size?}}
& No & \verb|\cnode| & \verb|\circlenode| \\\cl{2-4}
& Yes & \verb|\Cnode| & \verb|\Circlenode|\\\hline
\end{longtable}
\end{document}
问题
如何仅增加第三行和第四行的高度?
答案1
另一种选择是给每条感兴趣的线添加一些垂直空间,以便进行更精细的调整。
\documentclass[preview,border=12pt,12pt,varwidth]{standalone}
\usepackage{longtable,array,multirow,graphicx}
\LTpre=0pt\relax% to remove excessive border at the top of longtable.
\let\mc=\multicolumn
\let\mr=\multirow
\let\cl=\cline
\renewcommand\arraystretch{1.5}
\begin{document}
\topskip=0pt\relax
\begin{longtable}{|*4{c|}}\cl{3-4}
\mc{2}{c|}{\mr{2}{*}{}} & \mc{2}{c|}{A container?} \\\cl{3-4}
\mc{2}{c|}{} & No & Yes \\\hline
\mr{2}{*}{\rotatebox[origin=c]{90}{Adjustable size?~}}
& No & \verb|\cnode| & \verb|\circlenode| \\[2em]\cl{2-4}
& Yes & \verb|\Cnode| & \verb|\Circlenode| \\[2em]\hline
\end{longtable}
\end{document}
答案2
\documentclass[preview,border=12pt,12pt,varwidth]{standalone}
\usepackage{longtable,array,multirow,graphicx}
\LTpre=0pt\relax% to remove excessive border at the top of longtable.
\let\mc=\multicolumn
\let\mr=\multirow
\let\cl=\cline
\renewcommand\arraystretch{1.5}
\begin{document}
\topskip=0pt\relax
\begin{longtable}{|*4{c|}}\cl{3-4}
\mc{2}{c|}{\mr{2}{*}{}} & \mc{2}{c|}{A container?}\\\cl{3-4}
\mc{2}{c|}{} & No & Yes \\\hline
\mr{6}{*}{\rotatebox[origin=c]{90}{Adjustable size?}}
&&&\\
& No & \verb|\cnode| & \verb|\circlenode| \\
&&&\\\cl{2-4}
&&&\\
& Yes & \verb|\Cnode| & \verb|\Circlenode|\\
&&&\\\hline
\end{longtable}
\end{document}