如何根据 Resizebox 内的字体大小精确缩小 Resizebox 外的字体?

如何根据 Resizebox 内的字体大小精确缩小 Resizebox 外的字体?

以下最小工作示例resizebox将 缩小为tabulartextwidth但 上方的标题和句子tabular并未相应缩小。我想知道是否有办法通过引用 内的字体大小来精确缩小这些标题和句子resizebox,而不是small下面的简单 。谢谢您的帮助!

\documentclass{article}

\usepackage{graphicx}
\usepackage[font=normalsize]{subcaption}

\begin{document}

\begin{table}

% How could one exactly downsize this caption?
\caption{\small This is a caption.}

% How could one exactly downsize these sentences?
{\small This is sentence 1. This is sentence 2. This is sentence 3.
This is sentence 4. This is sentence 5. This is sentence 6.\par}

% based on the font size inside this resizebox
\resizebox{\textwidth}{!}{
\subcaptionbox{This is a subcaption.}{
\begin{tabular}{*{12}c}\hline
1.1111&2.2222&3.3333&4.4444&5.5555&6.6666&
7.7777&8.8888&9.9999&0.0000&1.1111&2.2222\\
1.1111&2.2222&3.3333&4.4444&5.5555&6.6666&
7.7777&8.8888&9.9999&0.0000&1.1111&2.2222\\\hline
\end{tabular}
}
}

\end{table}

\end{document}

答案1

抱歉,但您的例子中有一些不好的想法:

  1. 缩放表格是不好的,因为您无法控制最终结果。

  2. 即使您减小表格中的字体大小以适应格式,标题也应该与所有其他标题一样。

  3. 里面的字体改变命令\caption绝对不能使用。

不过,我并不反对缩放子标题中的字体。

\documentclass{article}
\usepackage[font=normalsize]{subcaption}
\usepackage{booktabs}

\begin{document}

\begin{table}[htp]

\caption{This is a caption.}

\captionsetup[subtable]{font=footnotesize}
\subcaptionbox{This is a subcaption.}{%
  \footnotesize
  \setlength{\tabcolsep}{0pt}%
  \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}*{12}c}
  \toprule
  1.1111 & 2.2222 & 3.3333 & 4.4444 & 5.5555 & 6.6666 &
    7.7777 & 8.8888 & 9.9999 & 0.0000 & 1.1111 & 2.2222 \\
  1.1111 & 2.2222 & 3.3333 & 4.4444 & 5.5555 & 6.6666 &
    7.7777 & 8.8888 & 9.9999 & 0.0000 & 1.1111 & 2.2222 \\
  \bottomrule
\end{tabular*}%
}
\end{table}

\end{document}

在此处输入图片描述

相关内容