为什么 IEEE 表格被推到了纸张边缘之外?

为什么 IEEE 表格被推到了纸张边缘之外?

我正在为 IEEE 出版物完成一张表格,但我有一个问题因为表格被推到了纸张边缘之外,如下所示:

在此处输入图片描述

我不知道为什么会发生这种情况。虽然我注意到“关键字”列可能是导致此行为的原因,因为如果某些关键字由小词组成,则此问题不太明显(但仍然存在)。第二个问题很可能是由“关键字”列的长度引起的,这会导致标题向右错位,而它们应该在中间。

以下是我目前获得的信息:

\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{siunitx}    % v3!
\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}
\usepackage{ragged2e}
\usepackage{caption} 
\usepackage{hyperref}
\usepackage{booktabs}
\usepackage{mwe}
\usepackage{booktabs, makecell, multirow, tabularx}
\setcellgapes{3pt}
\newcolumntype{L}[1]{>{\RaggedRight\hspace{0pt}%
                     \hsize=#1\hsize}X}


% Other paragraphs...


\begin{table*}\centering
\ra{1.3}
\begin{tabular}{@{}rrrrcrrrcrrr@{}}\toprule
& \multicolumn{3}{c}{QUERY-1} & \phantom{abc}& \multicolumn{3}{c}{QUERY-2} &
\phantom{abc} & \multicolumn{3}{c}{QUERY-3}\\
\cmidrule{2-4} \cmidrule{6-8} \cmidrule{10-12}
& Keyword & Occurrence & Strength && Keyword & Occurrence & Strength && Keyword & Occurrence & Strength\\ \midrule
$Top$\\
$1.$ & photoacoustics & 58 & 1047 && photoacoustics & 854 & 23329 && -1.0032 & -1.7104 & -21.7969\\
$2,$ & ultrasonics & 59 & 712 && photo-acoustic imaging & 1063 & 19283 && 4.3590& 34.5809& 76.9167\\
$3.$ & photo-acoustic imaging & 50 & 615 && animals & 568 & 18569 && -121.0518& -137.1210& -220.2500\\
$4.$ & echography & 31 & 611 && human & 556 & 16810 && -121.0518& -137.1210& -220.2500\\
$5.$ & ultrasonic applications & 63 & 600 && mouse & 389 & 13542 && -1.2998& -3.8202& -1.2784\\
$6.$ & procedures & 23 & 552 && procedures & 421 & 13287 && -11.1631& -5.7108& -15.6728\\
$7.$ & ultrasound & 26 & 505 && diagnostic imaging & 350 & 10806 && 52.5745& 10.1098& -140.2130\\
$8.$ & diagnostic imaging & 23 & 460 && chemistry & 286 & 10113 && 52.5745& 10.1098& -140.2130\\
$9.$ & ultrasound imaging & 29 & 430 && female & 250 & 8782 && 52.5745& 10.1098& -140.2130\\
$10.$ & animal experiment & 15 & 417 && animal model & 204 & 7883 && 52.5745& 10.1098& -140.2130\\
$Bottom$\\
$1.$ & non-contact & 8 & 62 && photonics & 15 & 200 && -1.0032 & -1.7104 & -21.7969\\
$2,$ & surface defects & 8 & 62 && cardiovascular system & 7 & 199 && 4.3590& 34.5809& 76.9167\\
$3.$ & fiber reinforced plastic & 6 & 61 && ultrasonography & 6 & 199 && -121.0518& -137.1210& -220.2500\\
$4.$ & damage visualization & 5 & 58 && focused ultrasound & 12 & 197 && -121.0518& -137.1210& -220.2500\\
$5.$ & elastography & 5 & 57 && raman scattering & 9 & 196 && -1.0032 & -1.7104 & -21.7969\\
$6,$ & high spacial resolution & 6 & 56 && prostate cancer & 8 & 195 && 4.3590& 34.5809& 76.9167\\
$7.$ & computerized tomography & 8 & 54 && photoacoustic measurements & 13 & 94 && -121.0518& -137.1210& -220.2500\\
$8.$ & ultrasound propagation & 6 & 53 && excitation wavelength & 13 & 193 && -121.0518& -137.1210& -220.2500\\
$9.$ & laser ultrasonic systems & 6 & 51 && breast imaging & 9 & 190 && 4.3590& 34.5809& 76.9167\\
$10.$ & nondestructive testing & 7 & 49 && fluences & 10 & 1894 && -121.0518& -137.1210& -220.2500\\
\bottomrule
\end{tabular}
\caption{Caption}
\end{table*}

我对这个问题进行了大量研究,并发现了此来源其他来源。它们都有助于了解边距,但它们仍然不能用于解决我的问题。

我进一步研究了这个问题,并发现此来源并且这个。然而,尽管有用,最后这两个来源却无法让我得出正确的结论。

如果有人遇到同样的问题,请指出正确的解决方案。

編輯

感谢一位用户,第三列已更新为“单词”值。然而,正如您在下面看到的,这导致列的行为不正确。

\begin{table*}
\setlength\tabcolsep{0pt}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}
     l lS[table-format=2.0] S[table-format=4.0]
       lS[table-format=4.0] S[table-format=5.0]
       *{3}{S[table-format=-3.4]} }
\toprule
& \multicolumn{3}{c}{QUERY 1} 
& \multicolumn{3}{c}{QUERY 2} 
& \multicolumn{3}{c}{QUERY 3 (???)} \\
\cmidrule{2-4} \cmidrule{5-7} \cmidrule{8-10}
& Keyword & {\#} & {Strength} 
& Keyword & {\#} & {Strength}
& {Keyword} & {\#} & {Strength} \\ 
\midrule
\multicolumn{5}{@{}l}{\itshape Top}\\
1. & photoacoustics & 58 & 1047 & photoacoustics & 854 & 23329 & human & 803 & 18692 \\
2. & ultrasonics & 59 & 712 & photo-acoustic imaging & 1063 & 19283  & three dimensional imaging & 606 & 15014 \\
3. & photo-acoustic imaging & 50 & 615 & animals & 568 & 18569 & female & 544 & 13097 \\
4. & echography & 31 & 611 & human & 556 & 16810 & echography & 492 & 12084 \\
5. & ultrasonic applications & 63 & 600 & mouse & 389 & 13542 & ultrasonopgraphy & 271 & 6733\\
6. & procedures & 23 & 552 & procedures & 421 & 13287 & ultrasonics &  289 & 5390 \\
7. & ultrasound & 26 & 505 & diagnostic imaging & 350 & 10806 & pregnancy & 207 & 5075 \\
8. & diagnostic imaging & 23 & 460 & chemistry & 286 & 10113 & algorithms  & 187 & 5039 \\
9. & ultrasound imaging & 29 & 430 & female & 250 & 8782 & 3d ultrasound & 227 & 4569 \\
10. & animal experiment & 15 & 417 & animal model & 204 & 7883 & fetus echography & 150 & 3645 \\
\addlinespace
\multicolumn{5}{@{}l}{\itshape Bottom}\\
1. & non-contact & 8 & 62 & photonics & 15 & 200 & cancer prognosis & 5 & 107 \\
2. & surface defects & 8 & 62 & cardiovascular system & 7 & 199 & image resolution & 9 & 106 \\
3. & fiber reinforced plastic & 6 & 61 & ultrasonography & 6 & 199 & wave propagation & 7 & 105 \\
4. & damage visualization & 5 & 58 & focused ultrasound & 12 & 197 & position sensors & 5 & 104 \\
5. & elastography & 5 & 57 & raman scattering & 9 & 196 & fibers & 6 & 103 \\
6, & high spacial resolution & 6 & 56 & prostate cancer & 8 & 195 & medical robotics & 7 & 103 \\
7. & computerized tomography & 8 & 54 & photoacoustic measurements & 13 & 94 & breast lesion & 5 & 101 \\
8. & ultrasound propagation & 6 & 53 & excitation wavelength & 13 & 193 & segmentation methods & 7 & 100 \\
9. & laser ultrasonic systems & 6 & 51 & breast imaging & 9 & 190 & robotic surgery & 6 & 99 \\
10. & nondestructive testing & 7 & 49 & fluences & 10 & 1894 & transducer elements & 6 & 98 \\
\bottomrule
\addlinespace
\end{tabular*}
\caption{Caption}
\end{table*}

在此处输入图片描述

答案1

以下是关于如何确保您的桌子适合可用空间的两种不同建议:

在此处输入图片描述

\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{siunitx}    % v3!
\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}
\usepackage{ragged2e}

\usepackage{booktabs, tabularx}

\begin{document}


\begin{table*}
\caption{Caption}
\centering
\ra{1.3}
\setlength{\tabcolsep}{4.75pt}
\begin{tabular}{@{}r l S[table-format=2] S[table-format=4] 
                     lS[table-format=4] S[table-format=5]
                     l S[table-format=3]S[table-format=5]@{}}\toprule
& \multicolumn{3}{c}{QUERY-1} &  \multicolumn{3}{c}{QUERY-2} &
  \multicolumn{3}{c}{QUERY-3}\\
\cmidrule(r){2-4} \cmidrule(lr){5-7} \cmidrule(l){8-10}
& Keyword & {Occur.} & {Strength} & Keyword & {Occur.} & {Strength} & {Keyword} & {Occur.} & {Strength}\\ \midrule
\multicolumn{10}{@{}l}{\itshape Top}\\
1. & photoacoustics & 58 & 1047 & photoacoustics & 854 & 23329 & human & 803 & 18692 \\
2. & ultrasonics & 59 & 712 & photo-acoustic imaging & 1063 & 19283  & three dimensional imaging & 606 & 15014 \\
3. & photo-acoustic imaging & 50 & 615 & animals & 568 & 18569 & female & 544 & 13097 \\
4. & echography & 31 & 611 & human & 556 & 16810 & echography & 492 & 12084 \\
5. & ultrasonic applications & 63 & 600 & mouse & 389 & 13542 & ultrasonopgraphy & 271 & 6733\\
6. & procedures & 23 & 552 & procedures & 421 & 13287 & ultrasonics &  289 & 5390 \\
7. & ultrasound & 26 & 505 & diagnostic imaging & 350 & 10806 & pregnancy & 207 & 5075 \\
8. & diagnostic imaging & 23 & 460 & chemistry & 286 & 10113 & algorithms  & 187 & 5039 \\
9. & ultrasound imaging & 29 & 430 & female & 250 & 8782 & 3d ultrasound & 227 & 4569 \\
10. & animal experiment & 15 & 417 & animal model & 204 & 7883 & fetus echography & 150 & 3645 \\
\addlinespace
\multicolumn{10}{@{}l}{\itshape Bottom}\\
1. & non-contact & 8 & 62 & photonics & 15 & 200 & cancer prognosis & 5 & 107 \\
2. & surface defects & 8 & 62 & cardiovascular system & 7 & 199 & image resolution & 9 & 106 \\
3. & fiber reinforced plastic & 6 & 61 & ultrasonography & 6 & 199 & wave propagation & 7 & 105 \\
4. & damage visualization & 5 & 58 & focused ultrasound & 12 & 197 & position sensors & 5 & 104 \\
5. & elastography & 5 & 57 & raman scattering & 9 & 196 & fibers & 6 & 103 \\
6, & high spacial resolution & 6 & 56 & prostate cancer & 8 & 195 & medical robotics & 7 & 103 \\
7. & computerized tomography & 8 & 54 & photoacoustic measurements & 13 & 94 & breast lesion & 5 & 101 \\
8. & ultrasound propagation & 6 & 53 & excitation wavelength & 13 & 193 & segmentation methods & 7 & 100 \\
9. & laser ultrasonic systems & 6 & 51 & breast imaging & 9 & 190 & robotic surgery & 6 & 99 \\
10. & nondestructive testing & 7 & 49 & fluences & 10 & 1894 & transducer elements & 6 & 98 \\
\bottomrule
\end{tabular}
\end{table*}

\newpage


\begin{table*}
\caption{Caption}
\ra{1.3}
\begin{tabularx}{\linewidth}{@{}r >{\raggedright\arraybackslash}X S[table-format=2] S[table-format=4] 
                     >{\raggedright\arraybackslash}XS[table-format=4] S[table-format=5]
                     >{\raggedright\arraybackslash}X S[table-format=3]S[table-format=5]@{}}\toprule
& \multicolumn{3}{c}{QUERY-1} &  \multicolumn{3}{c}{QUERY-2} &
  \multicolumn{3}{c}{QUERY-3}\\
\cmidrule(r){2-4} \cmidrule(lr){5-7} \cmidrule(l){8-10}
& Keyword & {Occur.} & {Strength} & Keyword & {Occur.} & {Strength} & {Keyword} & {Occur.} & {Strength}\\ \midrule
\multicolumn{10}{@{}l}{\itshape Top}\\
1. & photoacoustics & 58 & 1047 & photoacoustics & 854 & 23329 & human & 803 & 18692 \\
2. & ultrasonics & 59 & 712 & photo-acoustic imaging & 1063 & 19283  & three dimensional imaging & 606 & 15014 \\
3. & photo-acoustic imaging & 50 & 615 & animals & 568 & 18569 & female & 544 & 13097 \\
4. & echography & 31 & 611 & human & 556 & 16810 & echography & 492 & 12084 \\
5. & ultrasonic applications & 63 & 600 & mouse & 389 & 13542 & ultrasonopgraphy & 271 & 6733\\
6. & procedures & 23 & 552 & procedures & 421 & 13287 & ultrasonics &  289 & 5390 \\
7. & ultrasound & 26 & 505 & diagnostic imaging & 350 & 10806 & pregnancy & 207 & 5075 \\
8. & diagnostic imaging & 23 & 460 & chemistry & 286 & 10113 & algorithms  & 187 & 5039 \\
9. & ultrasound imaging & 29 & 430 & female & 250 & 8782 & 3d ultrasound & 227 & 4569 \\
10. & animal experiment & 15 & 417 & animal model & 204 & 7883 & fetus echography & 150 & 3645 \\
\addlinespace
\multicolumn{10}{@{}l}{\itshape Bottom}\\
1. & non-contact & 8 & 62 & photonics & 15 & 200 & cancer prognosis & 5 & 107 \\
2. & surface defects & 8 & 62 & cardiovascular system & 7 & 199 & image resolution & 9 & 106 \\
3. & fiber reinforced plastic & 6 & 61 & ultrasonography & 6 & 199 & wave propagation & 7 & 105 \\
4. & damage visualization & 5 & 58 & focused ultrasound & 12 & 197 & position sensors & 5 & 104 \\
5. & elastography & 5 & 57 & raman scattering & 9 & 196 & fibers & 6 & 103 \\
6, & high spacial resolution & 6 & 56 & prostate cancer & 8 & 195 & medical robotics & 7 & 103 \\
7. & computerized tomography & 8 & 54 & photoacoustic measurements & 13 & 94 & breast lesion & 5 & 101 \\
8. & ultrasound propagation & 6 & 53 & excitation wavelength & 13 & 193 & segmentation methods & 7 & 100 \\
9. & laser ultrasonic systems & 6 & 51 & breast imaging & 9 & 190 & robotic surgery & 6 & 99 \\
10. & nondestructive testing & 7 & 49 & fluences & 10 & 1894 & transducer elements & 6 & 98 \\
\bottomrule
\end{tabularx}
\end{table*}

\end{document}

答案2

由于所有单元格似乎都不需要自动换行,我建议您使用tabular*环境并将其整体宽度设置为\textwidth。我还建议删除全空白列。哦,由于该类IEEEtran通常对标题的外观非常讲究(例如,标题编号和标题文本之间的换行符),我不会通过加载包来破坏这些类设置caption

哦,第三个查询似乎与其他两个查询完全不同。不知道那里发生了什么。

在此处输入图片描述

\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{amsmath,amssymb}
\usepackage{siunitx} 
\usepackage{newtxtext,newtxmath}
%\usepackage{caption} 
   % it's not a good idea to use the 'caption' package with the IEEEtran class
\usepackage{hyperref}
\usepackage{booktabs}

\begin{document}

\begin{table*}
\setlength\tabcolsep{0pt}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}
     l lS[table-format=2.0] S[table-format=4.0]
       lS[table-format=4.0] S[table-format=5.0]
       *{3}{S[table-format=-3.4]} }
\toprule
& \multicolumn{3}{c}{QUERY 1} 
& \multicolumn{3}{c}{QUERY 2} 
& \multicolumn{3}{c}{QUERY 3 (???)} \\
\cmidrule{2-4} \cmidrule{5-7} \cmidrule{8-10}
& Keyword & {\#} & {Strength} 
& Keyword & {\#} & {Strength}
& {Keyword} & {\#} & {Strength} \\ 
\midrule
\multicolumn{5}{@{}l}{\itshape Top}\\
1. & photoacoustics & 58 & 1047 & photoacoustics & 854 & 23329 & -1.0032 & -1.7104 & -21.7969\\
2. & ultrasonics & 59 & 712 & photo-acoustic imaging & 1063 & 19283 & 4.3590& 34.5809& 76.9167\\
3. & photo-acoustic imaging & 50 & 615 & animals & 568 & 18569 & -121.0518& -137.1210& -220.2500\\
4. & echography & 31 & 611 & human & 556 & 16810 & -121.0518& -137.1210& -220.2500\\
5. & ultrasonic applications & 63 & 600 & mouse & 389 & 13542 & -1.2998& -3.8202& -1.2784\\
6. & procedures & 23 & 552 & procedures & 421 & 13287 & -11.1631& -5.7108& -15.6728\\
7. & ultrasound & 26 & 505 & diagnostic imaging & 350 & 10806 & 52.5745& 10.1098& -140.2130\\
8. & diagnostic imaging & 23 & 460 & chemistry & 286 & 10113 & 52.5745& 10.1098& -140.2130\\
9. & ultrasound imaging & 29 & 430 & female & 250 & 8782 & 52.5745& 10.1098& -140.2130\\
10. & animal experiment & 15 & 417 & animal model & 204 & 7883 & 52.5745& 10.1098& -140.2130\\
\addlinespace
\multicolumn{5}{@{}l}{\itshape Bottom}\\
1. & non-contact & 8 & 62 & photonics & 15 & 200 & -1.0032 & -1.7104 & -21.7969\\
2. & surface defects & 8 & 62 & cardiovascular system & 7 & 199 & 4.3590& 34.5809& 76.9167\\
3. & fiber reinforced plastic & 6 & 61 & ultrasonography & 6 & 199 & -121.0518& -137.1210& -220.2500\\
4. & damage visualization & 5 & 58 & focused ultrasound & 12 & 197 & -121.0518& -137.1210& -220.2500\\
5. & elastography & 5 & 57 & raman scattering & 9 & 196 & -1.0032 & -1.7104 & -21.7969\\
6, & high spacial resolution & 6 & 56 & prostate cancer & 8 & 195 & 4.3590& 34.5809& 76.9167\\
7. & computerized tomography & 8 & 54 & photoacoustic measurements & 13 & 94 & -121.0518& -137.1210& -220.2500\\
8. & ultrasound propagation & 6 & 53 & excitation wavelength & 13 & 193 & -121.0518& -137.1210& -220.2500\\
9. & laser ultrasonic systems & 6 & 51 & breast imaging & 9 & 190 & 4.3590& 34.5809& 76.9167\\
10. & nondestructive testing & 7 & 49 & fluences & 10 & 1894 & -121.0518& -137.1210& -220.2500\\
\bottomrule
\addlinespace
\end{tabular*}
\caption{Caption}
\end{table*}
\end{document}

附录回应 OP 的后续评论/编辑:我看到您对“查询 3”下的材料进行了相当大的修改。太好了。实际上,您需要做的就是将列格式从*{3}{S[table-format=-3.4]}(适用于早期版本)更改为l S[table-format=3.0] S[table-format=5.0]

或者,考虑缩短较长的字符串three dimensional imaging3d imaging;这将使文本列变窄,从而允许在所有列之间插入更多的空格。

在此处输入图片描述

\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{amsmath,amssymb}
\usepackage{siunitx} 
\usepackage{newtxtext,newtxmath}
%\usepackage{caption} 
    % it's not a good idea to use the 'caption' package with the IEEEtran class
\usepackage{booktabs}
\usepackage{hyperref}

\begin{document} 

\begin{table*}
\setlength\tabcolsep{0pt} % let LaTeX figure out the required amount of intercolumn whitespace
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}
     l l S[table-format=2.0] S[table-format=4.0]
       l S[table-format=4.0] S[table-format=5.0]
       l S[table-format=3.0] S[table-format=5.0] }
\toprule
& \multicolumn{3}{c}{QUERY 1} & \multicolumn{3}{c}{QUERY 2} & \multicolumn{3}{c}{QUERY 3} \\
\cmidrule{2-4} \cmidrule{5-7} \cmidrule{8-10}
& Keyword & {\#} & {Strength} & Keyword & {\#} & {Strength} & Keyword & {\#} & {Strength} \\ 
\midrule
\multicolumn{5}{l}{\itshape Top}\\
1. & photoacoustics & 58 & 1047 & photoacoustics & 854 & 23329 & human & 803 & 18692 \\
2. & ultrasonics & 59 & 712 & photo-acoustic imaging & 1063 & 19283 & 3d imaging & 606 & 15014 \\
3. & photo-acoustic imaging & 50 & 615 & animals & 568 & 18569 & female & 544 & 13097 \\
4. & echography & 31 & 611 & human & 556 & 16810 & echography & 492 & 12084 \\
5. & ultrasonic applications & 63 & 600 & mouse & 389 & 13542 & ultrasonopgraphy & 271 & 6733\\
6. & procedures & 23 & 552 & procedures & 421 & 13287 & ultrasonics & 289 & 5390 \\
7. & ultrasound & 26 & 505 & diagnostic imaging & 350 & 10806 & pregnancy & 207 & 5075 \\
8. & diagnostic imaging & 23 & 460 & chemistry & 286 & 10113 & algorithms & 187 & 5039 \\
9. & ultrasound imaging & 29 & 430 & female & 250 & 8782 & 3d ultrasound & 227 & 4569 \\
10.& animal experiment & 15 & 417 & animal model & 204 & 7883 & fetus echography & 150 & 3645 \\
\addlinespace
\multicolumn{5}{l}{\itshape Bottom}\\
1. & non-contact & 8 & 62 & photonics & 15 & 200 & cancer prognosis & 5 & 107 \\
2. & surface defects & 8 & 62 & cardiovascular system & 7 & 199 & image resolution & 9 & 106 \\
3. & fiber reinforced plastic & 6 & 61 & ultrasonography & 6 & 199 & wave propagation & 7 & 105 \\
4. & damage visualization & 5 & 58 & focused ultrasound & 12 & 197 & position sensors & 5 & 104 \\
5. & elastography & 5 & 57 & raman scattering & 9 & 196 & fibers & 6 & 103 \\
6, & high spacial resolution & 6 & 56 & prostate cancer & 8 & 195 & medical robotics & 7 & 103 \\
7. & computerized tomography & 8 & 54 & photoacoustic measurements & 13 & 94 & breast lesion & 5 & 101 \\
8. & ultrasound propagation & 6 & 53 & excitation wavelength & 13 & 193 & segmentation methods & 7 & 100 \\
9. & laser ultrasonic systems & 6 & 51 & breast imaging & 9 & 190 & robotic surgery & 6 & 99 \\
10.& nondestructive testing & 7 & 49 & fluences & 10 & 1894 & transducer elements & 6 & 98 \\
\bottomrule
\addlinespace
\end{tabular*}
\caption{Caption}
\end{table*}
\end{document}

相关内容