
다음 코드를 실행하면 다음 그림과 같이 헤드라인 3의 마지막 요소가 PDF 시트 공간에 맞지 않아 해당 요소가 손실되는 테이블이 생성됩니다. 마지막 열도 PDF 시트에 맞는지 어떻게 확인할 수 있나요?
코드는 다음과 같습니다.
\documentclass{article}
\usepackage{amsfonts}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{geometry}
% Set smaller margins for more space
\geometry{margin=1cm}
\begin{document}
\begin{table}
\small % Reduce font size
\begin{tabular}{*{13}{S}}
\toprule
& \multicolumn{3}{c}{\textbf{Headline 1}} & \multicolumn{4}{c}{\textbf{Headline 2}} & \multicolumn{5}{c}{\textbf{Headline 3}} \\ \cmidrule(lr){2-5} \cmidrule(lr){6-9} \cmidrule(lr){10-13}
{$\alpha$} & {$F$} & {$T_n$} & {$B_n$} & {$\bar{B}_n$} &{$F$} & {$T_n$} & {$B_n$} & {$\bar{B}_n$} & {$F$} & {$T_n$} & {$B_n$} & {$\bar{B}_n$} \\ % Corrected column entry here
\midrule
& 16.128 & +8.872 & 16.128 & 1.402 & 1.373 & -146.6 & -137.6 & -137.6 & 1.373 & -146.6 & -137.6 & -17.6 \\
0.99 & 3.442 & -2.509 & 3.442 & 0.299 & 0.343 & 133.2 & 152.4 & -137.6 & 1.373 & -146.6 & -137.6 & -137.6 \\
& 0. & -0.429 & 0.993 & 0.086 & 0.08 & 25.6 & 90 & -137.6 & 1.373 & -146.6 & -137.6 & -137.6 \\
\midrule
& 0.483 & -0.183 & 0.483 & 0.042 & 0.063 & 22.3 & 122.5 & -137.6 & 1.373 & -146.6 & -137.6 & -137.6 \\
0.95 & 0.766 & -0.475 & 0.766 & 0.067 & 0.039 & 141.6 & -122 & -137.6 & 1.373 & -146.6 & -137.6 & -137.6 \\
& 0.624 & +0.365 & 0.624 & 0.054 & 0.04 & -35.7 & 90 & -137.6 & 1.373 & -146.6 & -137.6 & -137.6 \\
\midrule
& 0.766 & -0.475 & 0.766 & 0.067 & 0.039 & 141.6 & -122 & -137.6 & 1.373 & -146.6 & -137.6 & -137.6 \\
0.90 & 0.45 & +0.421 & 0.45 & 0.039 & 0.034 & -69.4 & 110.9 & -137.6 & 1.373 & -146.6 & -137.6 & -137.6 \\
& 0.598 & -0.597 & 0.598 & 0.052 & 0.025 & 92.3 & -109.3 & -137.6 & 1.373 & -146.6 & -137.6 & -137.6 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
답변1
각 열에 적합한 테이블 형식을 정의하면 많은 공간을 절약할 수 있습니다 S
.
\documentclass{article}
\usepackage{amsfonts}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{geometry}
% Set smaller margins for more space
\geometry{margin=1cm}
\begin{document}
\begin{table}
\centering
\small % Reduce font size
\begin{tabular}{
S[table-format=1.2]
S[table-format=2.3]
S[table-format=-1.3]
S[table-format=2.3]
S[table-format=1.3]
S[table-format=1.3]
S[table-format=-3.1]
S[table-format=-3.1]
S[table-format=-3.1]
S[table-format=1.3]
S[table-format=-3.1]
S[table-format=-3.1]
S[table-format=-3.1]
}
\toprule
& \multicolumn{4}{c}{\textbf{Headline 1}} & \multicolumn{4}{c}{\textbf{Headline 2}} & \multicolumn{4}{c}{\textbf{Headline 3}} \\ \cmidrule(lr){2-5} \cmidrule(lr){6-9} \cmidrule(lr){10-13}
{$\alpha$} & {$F$} & {$T_n$} & {$B_n$} & {$\bar{B}_n$} &{$F$} & {$T_n$} & {$B_n$} & {$\bar{B}_n$} & {$F$} & {$T_n$} & {$B_n$} & {$\bar{B}_n$} \\ % Corrected column entry here
\midrule
& 16.128 & +8.872 & 16.128 & 1.402 & 1.373 & -146.6 & -137.6 & -137.6 & 1.373 & -146.6 & -137.6 & -17.6 \\
0.99 & 3.442 & -2.509 & 3.442 & 0.299 & 0.343 & 133.2 & 152.4 & -137.6 & 1.373 & -146.6 & -137.6 & -137.6 \\
& 0. & -0.429 & 0.993 & 0.086 & 0.08 & 25.6 & 90 & -137.6 & 1.373 & -146.6 & -137.6 & -137.6 \\
\midrule
& 0.483 & -0.183 & 0.483 & 0.042 & 0.063 & 22.3 & 122.5 & -137.6 & 1.373 & -146.6 & -137.6 & -137.6 \\
0.95 & 0.766 & -0.475 & 0.766 & 0.067 & 0.039 & 141.6 & -122 & -137.6 & 1.373 & -146.6 & -137.6 & -137.6 \\
& 0.624 & +0.365 & 0.624 & 0.054 & 0.04 & -35.7 & 90 & -137.6 & 1.373 & -146.6 & -137.6 & -137.6 \\
\midrule
& 0.766 & -0.475 & 0.766 & 0.067 & 0.039 & 141.6 & -122 & -137.6 & 1.373 & -146.6 & -137.6 & -137.6 \\
0.90 & 0.45 & +0.421 & 0.45 & 0.039 & 0.034 & -69.4 & 110.9 & -137.6 & 1.373 & -146.6 & -137.6 & -137.6 \\
& 0.598 & -0.597 & 0.598 & 0.052 & 0.025 & 92.3 & -109.3 & -137.6 & 1.373 & -146.6 & -137.6 & -137.6 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}