LaTeX表格字体远小于12pt正文的问题求助
解决LaTeX表格字体小于正文字体的问题
你的表格字体偏小的核心原因是**\resizebox{1\textwidth}{!}命令强制缩放了整个表格**——哪怕你加了\large设置字体,缩放操作会把已经调整好的字体再按比例缩小,最终导致表格内字体远小于正文12pt的大小。
下面给你几个直接有效的解决方案:
方案1:移除\resizebox,用自适应列宽环境(推荐)
改用tabularx环境让表格自动适配页面宽度,无需手动缩放,字体大小会和正文保持一致。修改后的代码示例:
\usepackage{tabularx} % 先在导言区引入这个包 \begin{table}[htp] \renewcommand{\arraystretch}{1.5} % 适当减小行间距,原2的设置偏大 \large % 保持字体设置,现在不会被缩放抵消 \begin{tabularx}{\textwidth}{|c|c|X|c|c|} % X列自动填充剩余宽度,实现文本自动换行 \hline \textbf{Air pollutant} & \textbf{Detection limit} & \textbf{Concentration range to expect by EPA} & \textbf{Concentration range in Bristol, UK} & \textbf{Range in Bristol, UK} \\[1.5ex] \hline \textbf{Ozone (O$_{3}$)} & \textbf{10 ppb} & \textbf{0--150 ppb} & \textbf{0--100 ppb} & \\[1.5ex] \hline \textbf{Nitrogen dioxide} & \textbf{10 ppb} & \textbf{0--50 ppb} & \textbf{20--55 ppb} & \\[1.5ex] \hline \textbf{PM$_{2.5}$} & \textbf{5} & \textbf{0--40 \SI{}{\micro\gram/m^3}} & \textbf{0--40 \SI{}{\micro\gram/m^3}} & \\[1.5ex] \hline \textbf{PM$_{10}$} & \textbf{10} & \textbf{0--100 \SI{}{\micro\gram/m^3}} & \textbf{0--100 \SI{}{\micro\gram/m^3}} & \\[1.5ex] \hline \textbf{Temperature range} & ----- & ------ & ------ & \textbf{3--$21^\circ C$} \\[1.5ex] \hline \textbf{Humidity} & ----- & ----- & ----- & \textbf{50\%--75\%} \\[1.5ex] \hline \end{tabularx} \end{table}
- 用
tabularx的X列让宽列自动换行,避免因列宽过宽被迫缩放表格; - 减小
\arraystretch到1.5,避免行间距过大导致表格冗余; - 完全移除
\resizebox,字体大小不会被强制压缩。
方案2:手动设置列宽,不用缩放
如果不想用tabularx,可以给每列设置固定宽度(比如p{2cm}格式),让表格总宽度刚好匹配\textwidth,同样不需要缩放:
\begin{table}[htp] \renewcommand{\arraystretch}{1.5} \large \begin{tabular}{|p{2cm}|c|p{3cm}|p{3cm}|p{2cm}|} % 手动设置每列宽度,总和适配页面宽度 \hline \textbf{Air pollutant} & \textbf{Detection limit} & \textbf{Concentration range to expect by EPA} & \textbf{Concentration range in Bristol, UK} & \textbf{Range in Bristol, UK} \\[1.5ex] \hline % 后续表格内容与之前一致,省略重复代码 \end{tabular} \end{table}
额外优化提示
- 原代码里
\SI{}{\micro\gram/m^3}的多余空格要去掉,写成\SI{}{\micro\gram/m^3}更规范; - 温度可以改用
\SI{21}{\celsius}格式(需引入siunitx包),符合LaTeX科学排版规范; - 多张表格都有此问题时,统一移除
\resizebox,套用上述两种方法即可批量解决。
内容的提问来源于stack exchange,提问作者Sedi
相关产品推荐
相关产品推荐

