Threeparttable - 如果使用flushleft選項呼叫包,則將命令附加到\TPTnoteSettings不起作用

Threeparttable - 如果使用flushleft選項呼叫包,則將命令附加到\TPTnoteSettings不起作用

在套件tablenotes定義的環境中threeparttable,我想在整個文件中全域調整筆記的大小。

我找到了有人針對類似問題發布的問題的答案:使用套件\appto中的etoolbox內容附加到\TPTnoteSettings

threeparttable現在事實證明:如果使用諸如 之類的選項呼叫此解決方案,則該解決方案不起作用flushleft,請參閱 MWE。結果如下所示(請注意,表格下方的文字與表格中的文字大小相同): 註腳不變

將此與不帶任何選項或使用 呼叫包進行比較[normal],這也有效:

不帶選項調用套件時的小文字。

\documentclass{scrartcl}

\usepackage{booktabs}
\usepackage[flushleft]{threeparttable}
\usepackage{etoolbox}

\appto\TPTnoteSettings{\footnotesize}

\begin{document}
  \begin{table}
    \begin{threeparttable}[b]
      \caption{A caption}
      \begin{tabular}{llll}
        \toprule
        42& some & text & to have room\\
        \bottomrule
      \end{tabular}
      \begin{tablenotes}
        \item the first note
      \end{tablenotes}
    \end{threeparttable}
  \end{table}
\end{document}

答案1

合作\TPT@defaults(使用\g@addto@macro你不需要的etoolbox):

\documentclass{scrartcl}
\usepackage{booktabs}
\usepackage[flushleft]{threeparttable}

\makeatletter 
\g@addto@macro\TPT@defaults{\footnotesize} 
\makeatother

\begin{document}
  \begin{table}
    \begin{threeparttable}[b]
      \caption{A caption}
      \begin{tabular}{llll}
        \toprule
        42& some & text & to have room\\
        \bottomrule
      \end{tabular}
      \begin{tablenotes}
        \item the first note
      \end{tablenotes}
    \end{threeparttable}
  \end{table}
\end{document}

在此輸入影像描述

相關內容