调整表格大小以适应文本

调整表格大小以适应文本

我有点困惑,我只是想将文本放入表格中,但乳胶似乎不符合这一点,并将文本放在两行上。

\begin{table}[!h]
\centering
\small
\caption[Atrial segmentation: dataset LA regions score table]{Metrics score table for the different regions of the LA using LA cavity-endocardium labels. Abbreviations: LA, left atrium; MSD, mean surface distance; PV, pulmonary veins.}\label{endo_analysis_table}
\begin{tabular}[h!]{ l c c c c }
\toprule
 Metrics & Overall & Mitral valve region & LA central region & PV region & LA roof\\
 &  & (0-20\%) & (20-65\%) & (65-85\%) & (85-100\%)\\
\midrule
Dice score      & 93.77 $\pm$0.17 & 88.38 $\pm$7.3 & 96.01 $\pm$1.43 & 89.60 $\pm$5.15 & 78.75 $\pm$12.13\\
Jacquard Index  & 88.32 $\pm$0.3  & 80.41 $\pm$10.02 & 92.37 $\pm$2.59 & 81.77 $\pm$7.74 & 66.93 $\pm$14.82\\
MSD             & 0.613 $\pm$0.02 & 1.534 $\pm$1.01 & 0.875 $\pm$0.37 & 1.571 $\pm$1.17 & 1.841 $\pm$1.44\\
Sensibility     & 93.87 $\pm$0.03 & 89 $\pm$11.74 & 95.78 $\pm$2.68 & 90.78 $\pm$7.52 & 83.85 $\pm$15.63\\
Specificity     & 99.70 $\pm$0.002 & 99.61 $\pm$0.44 & 99.59 $\pm$0.27 & 99.36 $\pm$0.49 & 99.65 $\pm$0.41\\
Diameter error  & 3.277 $\pm$1.1 & 11.31 $\pm$9.42 & 2.81 $\pm$2.76 & 9.37 $\pm$9.79 & 22.15 $\pm$24.88\\
Volume error    & 4.285 $\pm$0.6 & 15.75 $\pm$13.67 & 3.51 $\pm$2.74 & 11.96 $\pm$11.03 & 35.65 $\pm$40.28\\
\hline
\end{tabular}
\end{table}

结果是:表格结果

我不明白,因为似乎在第一行上有一些空间可以放置列标题!

有没有办法控制它或者调整它?

谢谢

答案1

只需在定义中添加c代码中缺少的内容即可tabular

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}

\begin{document}

\begin{table}[!h]
\centering
\small
\caption[Atrial segmentation: dataset LA regions score table]{Metrics score table for the different regions of the LA using LA cavity-endocardium labels. Abbreviations: LA, left atrium; MSD, mean surface distance; PV, pulmonary veins.}\label{endo_analysis_table}
\begin{tabular}{lccccc}
\toprule
 Metrics & Overall & Mitral valve region & LA central region & PV region & LA roof\\
 &  & (0-20\%) & (20-65\%) & (65-85\%) & (85-100\%)\\
\midrule
Dice score      & 93.77 $\pm$0.17 & 88.38 $\pm$7.3 & 96.01 $\pm$1.43 & 89.60 $\pm$5.15 & 78.75 $\pm$12.13\\
Jacquard Index  & 88.32 $\pm$0.3  & 80.41 $\pm$10.02 & 92.37 $\pm$2.59 & 81.77 $\pm$7.74 & 66.93 $\pm$14.82\\
MSD             & 0.613 $\pm$0.02 & 1.534 $\pm$1.01 & 0.875 $\pm$0.37 & 1.571 $\pm$1.17 & 1.841 $\pm$1.44\\
Sensibility     & 93.87 $\pm$0.03 & 89 $\pm$11.74 & 95.78 $\pm$2.68 & 90.78 $\pm$7.52 & 83.85 $\pm$15.63\\
Specificity     & 99.70 $\pm$0.002 & 99.61 $\pm$0.44 & 99.59 $\pm$0.27 & 99.36 $\pm$0.49 & 99.65 $\pm$0.41\\
Diameter error  & 3.277 $\pm$1.1 & 11.31 $\pm$9.42 & 2.81 $\pm$2.76 & 9.37 $\pm$9.79 & 22.15 $\pm$24.88\\
Volume error    & 4.285 $\pm$0.6 & 15.75 $\pm$13.67 & 3.51 $\pm$2.74 & 11.96 $\pm$11.03 & 35.65 $\pm$40.28\\
\hline
\end{tabular}
\end{table}
\end{document}

希望它能如您所愿发挥作用!

答案2

除了列数错误和在表格环境中放置浮点选项外,由于每个单元格中的整数和小数个数不均,还请考虑使用siunitx正确的对齐方式:

姆韦

\documentclass{article}
\usepackage{geometry}
\usepackage{booktabs, siunitx}
\sisetup{ table-number-alignment=center,
separate-uncertainty=true,
table-figures-uncertainty=1,
 table-figures-integer = 2,
 table-figures-decimal = 3}
\begin{document}
\begin{table}
\centering
\footnotesize
\caption[Atrial segmentation: dataset LA regions score table]{Metrics score table for the different regions of the LA using LA cavity-endocardium labels. Abbreviations: LA, left atrium; MSD, mean surface distance; PV, pulmonary veins.}\label{endo_analysis_table}

\begin{tabular}{@{}l*{5}{S}@{}}
\toprule
 {Metrics} & {Overall} & {Mitral valve region} & {LA central region} & {PV region} & {LA roof}\\
 & & {(0-20\%)} & {(20-65\%)} & {(65-85\%)} & {(85-100\%)}\\
\midrule
Dice score & 93.77 \pm 0.17 & 88.38 \pm 7.3 & 96.01 \pm 1.43 & 89.60 \pm 5.15 & 78.75 \pm 12.13\\
Jacquard Index & 88.32 \pm 0.3 & 80.41 \pm 10.02 & 92.37 \pm 2.59 & 81.77 \pm 7.74 & 66.93 \pm 14.82\\
MSD & 0.613 \pm 0.02 & 1.534 \pm 1.01 & 0.875 \pm 0.37 & 1.571 \pm 1.17 & 1.841 \pm 1.44\\
Sensibility & 93.87 \pm 0.03 & 89 \pm 11.74 & 95.78 \pm 2.68 & 90.78 \pm 7.52 & 83.85 \pm 15.63\\
Specificity & 99.70 \pm 0.002 & 99.61 \pm 0.44 & 99.59 \pm 0.27 & 99.36 \pm 0.49 & 99.65 \pm 0.41\\
Diameter error & 3.277 \pm 1.1 & 11.31 \pm 9.42 & 2.81 \pm 2.76 & 9.37 \pm 9.79 & 22.15 \pm 24.88\\
Volume error & 4.285 \pm 0.6 & 15.75 \pm 13.67 & 3.51 \pm 2.74 & 11.96 \pm 11.03 & 35.65 \pm 40.28\\
\hline
\end{tabular}
\end{table}
\end{document}

相关内容