减小表格中的字体大小但不减小整个文档中的字体大小?

减小表格中的字体大小但不减小整个文档中的字体大小?

代码:

\documentclass[12pt, a4paper]{report}

\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage{amsfonts, graphicx, verbatim, mathtools,amssymb, amsthm, mathrsfs,amsmath}
\usepackage{tabularray} 
\UseTblrLibrary{booktabs}
\begin{document}
\lipsum[1]
\begin{table}[!htb]
\noindent\begin{tblr}{colspec = {| Q[c,$] X[l] |
                                   Q[c,$] X[l] |},
                       row{1} = {mode=text},
                     row{2-Y} = {belowsep+=2pt}
                     }  
    \toprule
Parameter & Description & Parameter & Description\\
    \midrule
b     & Influx rate of the popu\-la\-tion 
            & \sigma  & Progression rate from the asymptomatic compartment to the symptomatic compartment  \\
\mu & Natural death rate 
            & \gamma_A       & Non-treatment recovery rate of asymptomatic individuals \\
\beta_A & Transmission rate of the asymptomatic compartment 
            & \gamma_I       & Non-treatment recovery rate of symptomatic individuals      \\
\beta_I & Transmission rate of the symptomatic compartment 
            & \eta & Treatment rate of symptomatic individuals      \\
\nu       & Vaccination rate of newborns
            & \xi     & Immunity loss rate     \\
\rho       & Vaccination rate of susceptibles 
            & \alpha       & Disease induced death rate                    \\

    \bottomrule
\end{tblr}
\caption{Description of paramters}
\end{table}
\lipsum[1]
\end{document}

我怎样才能将表格中的字体大小减小到 11 号,同时在其他地方“保持”字体大小为 12 号?

答案1

只需添加cells = {font=\fontsize{9}{11}到表格的参数中:

\documentclass[12pt, a4paper]{report}

\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage{amsfonts, graphicx, verbatim, mathtools,amssymb, amsthm, mathrsfs,amsmath}
\usepackage{tabularray} 
\usepackage{lipsum}
\UseTblrLibrary{booktabs}
\begin{document}
\lipsum[1]
\begin{table}[!htb]
\noindent\begin{tblr}{colspec = {| Q[c,$] X[l] |
                                   Q[c,$] X[l] |},
                       row{1} = {mode=text},
                     row{2-Y} = {belowsep+=2pt},
                     cells = {font=\fontsize{9}{11}}
                     }  
    \toprule
Parameter & Description & Parameter & Description\\
    \midrule
b     & Influx rate of the popu\-la\-tion 
            & \sigma  & Progression rate from the asymptomatic compartment to the symptomatic compartment  \\
\mu & Natural death rate 
            & \gamma_A       & Non-treatment recovery rate of asymptomatic individuals \\
\beta_A & Transmission rate of the asymptomatic compartment 
            & \gamma_I       & Non-treatment recovery rate of symptomatic individuals      \\
\beta_I & Transmission rate of the symptomatic compartment 
            & \eta & Treatment rate of symptomatic individuals      \\
\nu       & Vaccination rate of newborns
            & \xi     & Immunity loss rate     \\
\rho       & Vaccination rate of susceptibles 
            & \alpha       & Disease induced death rate                    \\

    \bottomrule
\end{tblr}
\caption{Description of paramters}
\end{table}
\lipsum[1]
\end{document}

结果

答案2

您还可以使用 \tiny 命令,参见下面的最小示例:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}


\title{Article}
\author{Yan}
\date{\today}



\begin{document}

\maketitle
\newpage

\section{Section I}
\lipsum[1]
\begin{table}[h]
    \tiny % tiny font size
    \centering
    \begin{tabular}{|c|c|}
    
    \hline
      Column 1   & Column 2 \\
    \hline
      Column 3   & Column 4\\
    \hline
    \end{tabular}
    \caption{Caption}
    \label{tab:my_label}
\end{table}
\lipsum[1]

\end{document}

相关内容