為什麼我的表格沒有以 Threeparttable 置中?

為什麼我的表格沒有以 Threeparttable 置中?

任何人都可以幫助我解決我的 Threeparttable、TPTMimum 重新定義和居中環境問題嗎?我沒有在任何其他主題中看到我想做的事情。

我有這樣的事情:

\begin{table}
\centering
\begin{threeparttable}
\renewcommand\TPTminimum{\linewidth}
\captionsetup{font=small}

\begin{tabular}{|c|c|c|c|}
\hline\hline
{\scriptsize \textbf{Parameter}} & {\scriptsize \textbf{Value}}    & {\scriptsize \textbf{Unity}}   & {\scriptsize \textbf{Reference/Comment}}\\\hline
$\scriptstyle \tau_1$            & $\scriptstyle 10^{-2}$          & $\scriptstyle\text{dia}^{-1}$  & {\scriptsize \citet{Spratt}}\\\hline
$\scriptstyle \tau_2$            & $\scriptstyle 10^{-3}$          & $\scriptstyle\text{dia}^{-1}$  & $\scriptstyle \tau_2 \; < \; \tau_1$\\\hline
%some more lines...
$\scriptstyle \lambda$           & $\scriptstyle 4.16$             & $\scriptstyle\text{dia}^{-1}$  & {\scriptsize \citet{REF2}\tnote{2}}\\\hline
$\scriptstyle a$                 & $\scriptstyle 2 \times 10^{3}$  & {\scriptsize mg}               & {\scriptsize \citet{REF1}\tnote{1}}\\\hline
$\scriptstyle b$                 & $\scriptstyle 5 \times 10^{6}$  & {\scriptsize mg}               & {\scriptsize \citet{REF1}\tnote{1}}\\
\hline\hline
\end{tabular}
%NOTES:
\begin{tablenotes}[flushleft]\footnotesize
\item[1] I want it that way because my table isn't so big and the footnotes are getting weird the original way...
\item[2] \,Second Note!
\end{tablenotes}
\end{threeparttable}
\caption{Parameters...}
\end{table}

它看起來怎樣: 免疫組化

我怎樣才能集中這張桌子?謝謝!

答案1

將其設置tabular在一個\makebox[\linewidth]盒子內,類似於中的建議將影像居中,忽略邊距

\documentclass{article}
\usepackage{amsmath,caption,threeparttable,booktabs}
\newcommand{\citet}[1]{#1}% Just for this example
\begin{document}
\begin{table}
  \begin{threeparttable}
    \renewcommand\TPTminimum{\linewidth}
    \captionsetup{font=small}
    \makebox[\linewidth]{\scriptsize%
    \begin{tabular}{cccc}
      \toprule
      \textbf{Parameter} & \textbf{Value}    & \textbf{Unity} & \textbf{Reference/Comment} \\
      \midrule
      $\tau_1$            & $10^{-2}$          & $\text{dia}^{-1}$  & \citet{Spratt} \\
      $\tau_2$            & $10^{-3}$          & $\text{dia}^{-1}$  & $\tau_2 \; < \; \tau_1$ \\
      %some more lines...
      $\lambda$           & $4.16$             & $\text{dia}^{-1}$  & \citet{REF2}\tnote{2} \\
      $a$                 & $2 \times 10^{3}$  & mg               & \citet{REF1}\tnote{1} \\
      $b$                 & $5 \times 10^{6}$  & mg               & \citet{REF1}\tnote{1} \\
      \bottomrule
    \end{tabular}}
    %NOTES:
    \begin{tablenotes}[flushleft]\footnotesize
      \item[1] I want it that way because my table isn't so big and the footnotes are getting weird the original way...
      \item[2] \,Second Note!
    \end{tablenotes}
  \end{threeparttable}
  \caption{Parameters...}
\end{table}
\end{document}

在此輸入影像描述

答案2

我對此的看法。也請考慮threeparttablex,除其他功能外,它可以全域設定註釋的字體大小。

我已將標題放在頂部,注意底部的標題只會讓讀者感到困惑。請不要\text在數學中使用垂直設定非文字。它是一個單位,確實應該這樣處理,即(siunitx)。

\documentclass{article}
\usepackage{amsmath,threeparttable}
\usepackage[tableposition=top]{caption}
\usepackage{booktabs}
\captionsetup{font=small}
\newcommand{\citet}[1]{#1}% Just for this example
\begin{document}
\begin{table}
  \centering
  \caption{Parameters...}
  \begin{threeparttable}
    \scriptsize
    \begin{tabular}{
        c l c l c l c
      }
      \toprule
      {\textbf{Parameter}} && {\textbf{Value}}
      && {\textbf{Unity}} && {\textbf{Reference/Comment}}
      \\
      \midrule
      $ \tau_1$            && $ 10^{-2}$
      && $\mathrm{dia}^{-1}$  && {\citet{Spratt}}
      \\
      $ \tau_2$            && $ 10^{-3}$
      && $\mathrm{dia}^{-1}$  && $ \tau_2 < \tau_1$
      \\
      % some more lines...
      $ \lambda$           && $ 4.16$
      && $\mathrm{dia}^{-1}$  && {\citet{REF2}\tnote{2}}
      \\
      $ a$                 && $ 2 \times
      10^{3}$  && {mg}               && {\citet{REF1}\tnote{1}}
      \\
      $ b$                 && $ 5 \times
      10^{6}$  && {mg}               && {\citet{REF1}\tnote{1}}
      \\
      \bottomrule
    \end{tabular}
    %NOTES:
    \begin{tablenotes}%[flushleft]
      \footnotesize
      \item[1] I want it that way because my table isn't so big and the footnotes are getting weird the original way...
      \item[2] Second Note!
    \end{tablenotes}
  \end{threeparttable}
\end{table}
\end{document}

(圖像與代碼 100% 不符)

在此輸入影像描述

相關內容