更改表格内的字体大小

更改表格内的字体大小

我有这个代码:

\documentclass[11pt]{article}
\usepackage[margin=2.5cm, showframe]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{setspace}
\usepackage{lipsum}
\usepackage{booktabs}
\usepackage{rotating}
\usepackage{siunitx}
\usepackage[skip=0.33\baselineskip]{caption}
\captionsetup[table]{
    font=bf,
    size=normalsize,
    justification=centerlast,
    labelsep=newline
    }
\renewcommand\thetable{\Roman{table}}

\begin{document}
\def\arraystretch{1.25}
\begin{sidewaystable}[ht]
\centering
\setlength\tabcolsep{0pt}
\sisetup{table-format=2.2, group-separator={,}, group-minimum-digits=4}
\caption{\large{A Stylish Table Header with Important Knowledge}}
\parbox{\linewidth}{\small\lipsum[1]\vspace{2ex}}
\medskip
%\resizebox{\columnwidth}{!}{
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}
                c
                S[table-format=-2.2]
                *{9}{S}
                }
\toprule
&\multicolumn{3}{c}{Model 1}&\multicolumn{3}{c}{Model 2}&
\multicolumn{3}{c}{Model 3}\\
\cline{2-4}\cline{5-7}\cline{8-10}
{Pct}&{Sim}&{Act}&{Com}&{Sim}&{Act}&{Com}&{Sim}&{Act}&{Com}\\\midrule
\multicolumn{10}{l}{Panel A: Some text}\\\midrule
A   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
B   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
C   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
D   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
E   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
F   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
G   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
H   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
I   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
J   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
K   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
L   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
M   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
N   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
O   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
P   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
Q   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
R   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
S   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
\bottomrule
\multicolumn{10}{r}{\textit{(continued)}}\\
\end{tabular*}
%} % end of resizebox
\end{sidewaystable}
\end{document}

生成以下表格:

桌子

如图所示,标题表I和底部的音符(继续)由于表格尺寸的原因,这些字体被放置在框架之外。是否可以仅在表格内调整字体大小(手动或自动)?

我已经看过了,而且我知道我的问题至少接近重复。

但是,我似乎无法让这些问题的答案适用于我的情况。我尝试使用 手动将字体大小设置为小{\small ...},也尝试使用 的自动方法\resizebox\resizebox无法包含表I框架内的标题,我注意到这个网站上的许多用户都不建议使用这种方法。

答案1

为了仅对表格使用较小的字体大小,您可以在\footnotesize前面插入命令,\begin{tabular}如下面的 MWE 所示。这样,直到所有内容\end{sidewaystable}都将使用较小的字体大小。如果您希望“continued”改为正常大小,您也可以使用\multicolumn{10}{r}{\normalsize\textit{(continued)}}

\documentclass[11pt]{article}
\usepackage[margin=2.5cm, showframe]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{setspace}
\usepackage{lipsum}
\usepackage{booktabs}
\usepackage{rotating}
\usepackage{siunitx}
\usepackage[skip=0.33\baselineskip]{caption}
\captionsetup[table]{
    font=bf,
    size=normalsize,
    justification=centerlast,
    labelsep=newline
    }
\renewcommand\thetable{\Roman{table}}

\begin{document}
\def\arraystretch{1.25}
\begin{sidewaystable}[ht]
\centering
\setlength\tabcolsep{0pt}
\sisetup{table-format=2.2, group-separator={,}, group-minimum-digits=4}
\caption{\large{A Stylish Table Header with Important Knowledge}}
\parbox{\linewidth}{\small\lipsum[1]\vspace{2ex}}
\medskip
\footnotesize
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}
                c
                S[table-format=-2.2]
                *{9}{S}
                }
\toprule
&\multicolumn{3}{c}{Model 1}&\multicolumn{3}{c}{Model 2}&
\multicolumn{3}{c}{Model 3}\\
\cline{2-4}\cline{5-7}\cline{8-10}
{Pct}&{Sim}&{Act}&{Com}&{Sim}&{Act}&{Com}&{Sim}&{Act}&{Com}\\\midrule
\multicolumn{10}{l}{Panel A: Some text}\\\midrule
A   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
B   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
C   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
D   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
E   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
F   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
G   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
H   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
I   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
J   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
K   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
L   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
M   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
N   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
O   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
P   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
Q   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
R   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
S   &11.11  &22.22  &33.33  &44.44  &55.55  &66.66  &77.77  &88.88  &99.99\\
\bottomrule
\multicolumn{10}{r}{\textit{(continued)}}\\
\end{tabular*}
\end{sidewaystable}
\end{document}

相关内容