Latex中表格添加底部文本注释并调整对齐

如何实现从第一个表到第三个表的转换,
在这里插入图片描述
其中主要涉及到两点:
(1)底部脚注与表格自动对齐并缩进换行
(2)表格自适应页面宽度

底部脚注的对齐与换行缩进需要用到

\usepackage{threeparttable}
\usepackage{booktabs}

表格自适应页面宽度需要在合适位置添加如下命令:

\resizebox{\linewidth}{!}{ 
....
....
} 

上述三个表格代码如下:

\begin{table}[!ht]
\caption{This is a caption.}\label{tab:tablenotes}
\centering
  \begin{tabular}{*4{c}}\toprule
    Models & Metric1 & Metric2$^{2}$ & Metric3$^{2}$ \\ \midrule
    Method1$^{1}$ & result & result & result \\
    Method2$^{3}$ & result & result & result \\
    Method3 & result & result & result \\
    Method4 & result & result & result \\ \bottomrule
  \end{tabular}
     \begin{minipage}{\linewidth}
    \raggedright
    ${ }^1$ Here to add text. Here to add text. Here to add text. Here to add text. Here to add text. Here to add text. \\
    ${ }^2$ Here to add text. Here to add text.\\
    ${ }^3$ Here to add text. Here to add text.
    \end{minipage}
\end{table}
% 注意第一个表格的实现方式与下面两个并不相同


\begin{table}[!ht]
\caption{This is a caption.}\label{tab:tablenotes}
\centering
\begin{threeparttable}         
  \begin{tabular}{*4{c}}\toprule
    Models & Metric1 & Metric2\tnote{2} & Metric3\tnote{2} \\ \midrule
    Method1\tnote{1} & result & result & result \\
    Method2\tnote{3} & result & result & result \\
    Method3 & result & result & result \\
    Method4 & result & result & result \\ \bottomrule
  \end{tabular}
     \begin{tablenotes}   
    \footnotesize            
    \item[1] Here to add text. Here to add text. Here to add text. Here to add text. Here to add text. Here to add text.        
    \item[2] Here to add text. Here to add text.       
    \item[3] Here to add text. Here to add text.
  \end{tablenotes}            
\end{threeparttable}     
\end{table}



\begin{table}[!ht]
\caption{This is a caption.}\label{tab:tablenotes}
\centering
\resizebox{\linewidth}{!}{ % 注意这行所在的位置
\begin{threeparttable} 
  \begin{tabular}{*4{c}}\toprule
    Models & Metric1 & Metric2\tnote{2} & Metric3\tnote{2} \\ \midrule
    Method1\tnote{1} & result & result & result \\
    Method2\tnote{3} & result & result & result \\
    Method3 & result & result & result \\
    Method4 & result & result & result \\ \bottomrule
  \end{tabular}
     \begin{tablenotes}   
    \footnotesize              
    \item[1] Here to add text. Here to add text. Here to add text. Here to add text.  Here to add text. Here to add text.          
    \item[2] Here to add text. Here to add text.       
    \item[3] Here to add text. Here to add text.
  \end{tablenotes}         
\end{threeparttable}}       
\end{table}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值