我知道这个问题可能之前已经回答过了,但我正在尝试使用那些没有效果的建议。我尝试的解决方案来自上一篇文章:如何调整表格以适合页面和这里:缩小表格以适合页面,或保持原样
我欢迎任何建议。我甚至尝试将纸张方向改为横向。
\begin{table}[]
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{|l|l|l|l|l|l|}
\hline
\textbf{Article Info} & \textbf{Study Size} & \textbf{RV EDV} & \textbf{RV ESV} & \textbf{LV EDV} & \textbf{LV ESV} \\ \hline
ASO Guidelines: Cardiac Chamber Quantification. Citation: "Age-, Body Size-, and Sex-Specific Reference Values for Right Ventricular Volumes and Ejection Fraction by Three-Dimensional Echocardiography" & 540 & \begin{tabular}[c]{@{}l@{}}Men: 35-87 mL/m2\\ Women: 32-74 mL/m2\end{tabular} & \begin{tabular}[c]{@{}l@{}}Men: 10-44 mL/m2\\ Women: 8-36 mL/m2\end{tabular} & \begin{tabular}[c]{@{}l@{}}Men: 34-74 mL/m2\\ Women: 29-61 mL/m2\end{tabular} & \begin{tabular}[c]{@{}l@{}}Men: 11-31 mL/m2\\ Women: 8-24 mL/m2\end{tabular} \\ \hline
Reference right ventricular systolic and diastolic function normalized to age, gender and body surface area from steady-state free precession cardiovascular magnetic resonance. Table 2 and 3. Stratified by age. & 120 & \begin{tabular}[c]{@{}l@{}}Men: a) 20-29 y/o: 91 b) 30 - 39 y/o: 88 c) 40 - 49 y/o: 85 d) 50 - 59 y/o : 82 e) 60 - 69 y/o: 79 f) 70 - 79 y/o: 75\\ \\ Women: a) 20-29 y/o: 84 b) 30 - 39 y/o: 80 c) 40 - 49 y/o: 76 d) 50 - 59 y/o : 72 e) 60 - 69 y/o: 68 f) 70 - 79 y/o: 64\end{tabular} & \begin{tabular}[c]{@{}l@{}}Men: a) 20-29 y/o: 35 b) 30 - 39 y/o: 33 c) 40 - 49 y/o: 30 d) 50 - 59 y/o : 28 e) 60 - 69 y/o: 25 f) 70 - 79 y/o: 23\\ \\ Women: a) 20-29 y/o: 32 b) 30 - 39 y/o: 30 c) 40 - 49 y/o: 27 d) 50 - 59 y/o : 24 e) 60 - 69 y/o: 21 f) 70 - 79 y/o: 19\end{tabular} & Not measured in this study & Not measured in this study \\ \hline
Reference Values for Real Time Three-Dimensional Echocardiography–Derived Left Ventricular Volumes and Ejection Fraction: Review and Meta-Analysis of Currently Available Studies. Table 2 & 2806 & Not measured in this study & Not measured in this study & \begin{tabular}[c]{@{}l@{}}Men: 54.3 mL/m2\\ \\ Women: 49.0 mL/m2\end{tabular} & \begin{tabular}[c]{@{}l@{}}Men: 20.8 mL/m2\\ \\ Women: 17.3 mL/m2\end{tabular} \\ \hline
\end{tabular}
\end{table}
谢谢大家!
答案1
我确信你的问题是重复的。评论中已经有一些提示了。
尽管如此:如果您想要一个表格,其整体宽度扩展到给定的尺寸(比如说\paperwidth
),那么您最好使用tabularx
-package。
l
您可以使用、c
和-columns设置表格r
。所有这些列标识符都有一个共同点,即如果在给定单元格中放入更多文本,则列的宽度将增加。也就是说:单元格的内容不会被换行到几行中。这最终导致表格的宽度越来越宽,最终不再适合纸张。
您可以通过自己计算列宽来防止这种情况。在这种情况下,您需要将 或 -column-identifier 替换l
为-identifier。Width是您自己计算(或猜测)c
的列宽。r
p{width}
如果您想要定义表格的整体宽度,可以使用包tabularx
。在这种情况下,您可以使用\begin{tabularx}{width}
。表格将具有所需的宽度。它还附带一个新的列标识符X
(大写 X)。这与 -identifier 非常相似p{width}
。唯一的区别是,LaTeX 现在计算列的宽度。它将进行调整,以便表格适合您所需的表格宽度。
以下是如何使此表正常工作的示例。我必须承认,我不是生物学家或医学专家。在我看来,您的表似乎仍需要一些润色和额外的工作才能使其完美地工作。例如,我认为,术语
毫升/平方米
代码中是某种单位。也许你必须将其排版为
$\frac{\mbox{ml}}{\mbox{m}^2}
为了得到正确的表述?
另一个提示:查看标有“RV EDV”的第三列。我不知道您在说什么,因为我不是专家(如上所述)。但对我来说,您似乎正在展示某种测量剂量,以 mL/m2 表示。与其在每个值上反复插入单位“ml/m2”,不如在表头指示使用的单位,并在列的其余部分将其保留下来,这样更有意义。
我使用了sidewaystable
-environment 而不是常规的table
-environment,以便旋转您的表格并使其成为横向表格。这样,您的表格内容就获得了更大的“宽度”(实际上是高度)。
来自sidewaystable
包rotating
。它还启用了我使用的命令\rotatebox
,通过将该列的表头旋转 90° 并使该列稍微变小,再次节省第二列上一些宝贵的列宽。
为了节省输入,我定义了一些新列。请参阅数组包手册关于该命令的用法。
如果它误解了您示例中给出的数据,您可以轻松更改我的新环境的定义subtable
,以纠正我的错误。我认为,呈现的数据是年龄范围和测量剂量,对吗?
由于表格是从左到右逐行阅读的,因此不要使用垂直线。表格中有足够的空白,可以清楚地区分一列和下一列。垂直线会阻止您从左到右阅读。避免使用它们!
我启用了包裹booktabs
使用这些好看的水平线。请参阅手册以了解更多说明。这是 WE
\documentclass[a4paper,draft]{article}
\usepackage[utf8]{luainputenc}
\usepackage{booktabs} % for better lines in tables
\usepackage{rotating} % rotating a cell title
\usepackage{tabularx} % for variable p-column widths
\usepackage{ragged2e} % for better line wrappings
%% define new column types. A column type "T" for title usage and a
%% "L" column of variable width but with flush left text.
\newcolumntype{T}{>{\footnotesize} c} % the title line is not the
% major content of the table.
% Therefore, make it smaller and
% center it.
\newcolumntype{L}{>{\RaggedRight\arraybackslash} X} % use a X-column
% but instead of justified text, make
% it ragged right.
\newcolumntype{M}[1]{>{\RaggedRight\arraybackslash} p{#1}} % same as
% above, but this time, define the
% width of the column yourself by #1
%% The following two definitions come in handy, when putting some more
%% tabulars into the main table.
\newcolumntype{N}{@{} >{$}c<{$} c @{}}%
\newenvironment{subtab}[1]{%
#1:\newline%
\begin{tabular}{N}%
\multicolumn{1}{@{}T!{}}{Age}%
& \multicolumn{1}{T@{}}{Dose}\\}{%
\end{tabular}}%
\begin{document}
\begin{sidewaystable}
\centering
\caption{My caption}
\label{my-label}
\begin{tabularx}{\linewidth}{@{} M{4.8cm} M{0.7cm} *{4}{L} @{}}
\toprule
\multicolumn{1}{@{}T}{Article Info}
& \multicolumn{1}{T}{\rotatebox{90}{Study Size}}
& \multicolumn{1}{T}{RV EDV}
& \multicolumn{1}{T}{RV ESV}
& \multicolumn{1}{T}{LV EDV}
& \multicolumn{1}{T@{}}{LV ESV} \\
\midrule
ASO Guidelines: Cardiac Chamber Quantification. Citation: ``Age-,
Body Size-, and Sex-Specific Reference Values for Right
Ventricular Volumes and Ejection Fraction by Three-Dimensional
Echocardiography''
& 540
& Men:\newline
$35 \ldots{} 87$ mL/m2\newline
Women:\newline
$32 \ldots{} 74$ mL/m2
& Men: \newline
$10 \ldots{} 4$4 mL/m2\newline
Women: \newline
$8 \ldots{} 3$6 mL/m2
& Men: \newline
$34 \ldots{} 7$4 mL/m2\newline
Women: \newline
$29 \ldots{} 6$1 mL/m2
& Men: \newline
$11 \ldots{} 3$1 mL/m2\newline
Women: \newline
$8 \ldots{} 2$4 mL/m2 \\
Reference right ventricular systolic and diastolic function
normalized to age, gender and body surface area from steady-state
free precession cardiovascular magnetic resonance. Table 2 and
3. Stratified by age.
& 120
& \begin{subtab}{Men}
20 \ldots{} 29 & 91 \\
30 \ldots{} 39 & 88 \\
40 \ldots{} 49 & 85 \\
50 \ldots{} 59 & 82 \\
60 \ldots{} 69 & 79 \\
70 \ldots{} 79 & 75 \\
\end{subtab}
\begin{subtab}{Women}
20 \ldots{} 29 & 84 \\
30 \ldots{} 39 & 80 \\
40 \ldots{} 49 & 76 \\
50 \ldots{} 59 & 72 \\
60 \ldots{} 69 & 68 \\
70 \ldots{} 79 & 64
\end{subtab}
& \begin{subtab}{Men}
20 \ldots{} 29 & 35 \\
30 \ldots{} 39 & 33 \\
40 \ldots{} 49 & 30 \\
50 \ldots{} 59 & 28 \\
60 \ldots{} 69 & 25 \\
70 \ldots{} 79 & 23
\end{subtab}
\newline
\begin{subtab}{Women}
20 \ldots{} 29 & 32 \\
30 \ldots{} 39 & 30 \\
40 \ldots{} 49 & 27 \\
50 \ldots{} 59 & 24 \\
60 \ldots{} 69 & 21 \\
70 \ldots{} 79 & 19
\end{subtab}
& Not measured in this study
& Not measured in this study \\
Reference Values for Real Time Three-Dimensional
Echocardiography–Derived Left Ventricular Volumes and Ejection
Fraction: Review and Meta-Analysis of Currently Available
Studies. Table 2
& 2806
& Not measured in this study
& Not measured in this study
& Men:\newline
54.3 mL/m2\newline
Women: \newline
49.0 mL/m2
& Men: \newline
20.8 mL/m2\newline
Women: \newline
17.3 mL/m2 \\
\bottomrule
\end{tabularx}
\end{sidewaystable}
\end{document}
结果如下: