减小我的文档中所有表格的字体大小:这些表格内有 \begingroup 和 \begin{tabular}

减小我的文档中所有表格的字体大小:这些表格内有 \begingroup 和 \begin{tabular}

我想减小所有表格的字体大小。

理想的做法是将新的宏放在我的 Latex 源的顶部。

我暂时向您展示当前的格式:

we have 4 bins and not 5. Below in \ref{density1} the official IST table of density of galaxies, redshift bins and redshift bin widths :
\begin{table}[h!]
\begin{center}
\begingroup
\setlength{\tabcolsep}{3pt} % Default value: 6pt
\renewcommand{\arraystretch}{1} % Default value: 1
\begin{tabular}{|c|c|c|c|c|}
\hline
\addstackgap{Redshift central bin} & 1.0 & 1.2 & 1.4 & 1.65 \\ \hline
\addstackgap{$\mathrm{d}N / \mathrm{d}\Omega\mathrm{d}z\left[\mathrm{deg}^{-2}\right]$} & 1815.0 & 1701.5 & 1410.0 & 940.97 \\ \hline
\addstackgap{$\Delta z$ : width of bin} & 0.2 & 0.2 & 0.2 & 0.3 \\ \hline
\addstackgap{$\rho_{gal}$\,(gal.arcmin$^{-2}$}) & 0.1008 & 0.0945 & 0.0783 & 0.0784 \\ \hline
\addstackgap{$\rho_{gal,tot}$\,(gal.arcmin$^{-2}$)} & 0.3521 & 
\multicolumn{1}{c}{} &
\multicolumn{1}{c}{} &
\multicolumn{1}{c|}{} \\ \hline
\end{tabular}
\endgroup
\end{center}
\caption{Spectroscopic specifications from \citetalias{IST:paper1} with 4 bins}
\label{density1}
\end{table}
We have adapted the binning and the width of each IST bin table in order to get the same $n(z)$ photometric population.

和渲染:

渲染:字体大小相对于文本来说太大

我尝试使用'\small'和其他命令,但没有成功。

如果有人能告诉我如何减小表格中这种尺寸的字体,那就没问题了。

答案1

table我建议使用在较小字体大小下启动的自定义环境。这里,我将其称为mytable。也可以使用 来默认caption使用标题字体大小\captionsetup

\documentclass{book}
\usepackage{stackengine,caption}

\newenvironment{mytable}[1][tbp]
               {\begin{table}[#1]\captionsetup{font=footnotesize}
                  \centering\footnotesize}
               {\end{table}}
\begin{document}
\begin{mytable}[h!]
\setlength{\tabcolsep}{3pt} % Default value: 6pt
\renewcommand{\arraystretch}{1} % Default value: 1
\begin{tabular}{|c|c|c|c|c|}
\hline
\addstackgap{Redshift central bin} & 1.0 & 1.2 & 1.4 & 1.65 \\ \hline
\addstackgap{$\mathrm{d}N / \mathrm{d}\Omega\mathrm{d}z\left[\mathrm{deg}^{-2}\right]$} & 1815.0 & 1701.5 & 1410.0 & 940.97 \\ \hline
\addstackgap{$\Delta z$ : width of bin} & 0.2 & 0.2 & 0.2 & 0.3 \\ \hline
\addstackgap{$\rho_{gal}$\,(gal.arcmin$^{-2}$}) & 0.1008 & 0.0945 & 0.0783 & 0.0784 \\ \hline
\addstackgap{$\rho_{gal,tot}$\,(gal.arcmin$^{-2}$)} & 0.3521 & 
\multicolumn{1}{c}{} &
\multicolumn{1}{c}{} &
\multicolumn{1}{c|}{} \\ \hline
\end{tabular}
\caption{Spectroscopic specifications from a reference with 4 bins}
\label{density2}
\end{mytable}

The original settings...
\begin{table}[h!]
\begin{center}
\begingroup
\setlength{\tabcolsep}{3pt} % Default value: 6pt
\renewcommand{\arraystretch}{1} % Default value: 1
\begin{tabular}{|c|c|c|c|c|}
\hline
\addstackgap{Redshift central bin} & 1.0 & 1.2 & 1.4 & 1.65 \\ \hline
\addstackgap{$\mathrm{d}N / \mathrm{d}\Omega\mathrm{d}z\left[\mathrm{deg}^{-2}\right]$} & 1815.0 & 1701.5 & 1410.0 & 940.97 \\ \hline
\addstackgap{$\Delta z$ : width of bin} & 0.2 & 0.2 & 0.2 & 0.3 \\ \hline
\addstackgap{$\rho_{gal}$\,(gal.arcmin$^{-2}$}) & 0.1008 & 0.0945 & 0.0783 & 0.0784 \\ \hline
\addstackgap{$\rho_{gal,tot}$\,(gal.arcmin$^{-2}$)} & 0.3521 & 
\multicolumn{1}{c}{} &
\multicolumn{1}{c}{} &
\multicolumn{1}{c|}{} \\ \hline
\end{tabular}
\endgroup
\end{center}
\caption{Spectroscopic specifications from a reference with 4 bins}
\label{density1}
\end{table}
\end{document}

在此处输入图片描述

答案2

如果您的所有表格都包含tabular环境中的表格,那么您可以使用etoolbox并设置它们的\small字体大小:

\documentclass{book}
\usepackage{stackengine,caption}

\usepackage{etoolbox}                % <---
\AtBeginEnvironment{tabular}{\small} % <---

\usepackage{lipsum}

\begin{document}
\lipsum[66]
    \begin{table}[ht!]
    \centering
    \setlength{\tabcolsep}{3pt}
    \renewcommand{\arraystretch}{1.2}
\begin{tabular}{|c|c|c|c|c|}
    \hline
\addstackgap{Redshift central bin} & 1.0 & 1.2 & 1.4 & 1.65 \\ \hline
\addstackgap{$\mathrm{d}N / \mathrm{d}\Omega\mathrm{d}z\left[\mathrm{deg}^{-2}\right]$} & 1815.0 & 1701.5 & 1410.0 & 940.97 \\ \hline
\addstackgap{$\Delta z$ : width of bin} & 0.2 & 0.2 & 0.2 & 0.3 \\ \hline
\addstackgap{$\rho_{gal}$\,(gal.arcmin$^{-2}$}) & 0.1008 & 0.0945 & 0.0783 & 0.0784 \\ \hline
\addstackgap{$\rho_{gal,tot}$\,(gal.arcmin$^{-2}$)} & 0.3521 & \multicolumn{3}{c|}{}            \\  \hline
\end{tabular}   
    \caption{Spectroscopic specifications from a reference with 4 bins}
    \label{density2}
    \end{table}
\lipsum[66]
\end{document}

在此处输入图片描述

相关内容