表注中出現奇怪的換行符號(ThreePartTable)

表注中出現奇怪的換行符號(ThreePartTable)

我正在使用threeparttabletablenotes包為表格建立腳註。我發現要獲得我想要的設計(懸掛符號,而不是上標),我可以簡單地使用該para選項並手動輸入腳註,而不是使用傳統的\item[]語法。然而,這樣做會在符號和文字之間產生一些奇怪的空間(即使我將其用大括號括起來,或使用很短的文字行)。在註釋周圍放置一個mbox註釋可以解決問題,但文字超出了表格寬度。繞過去pbox也解決不了問題。

我很好奇為什麼會發生這種情況,以及可能有什麼簡單的解決方案。請參閱下面的圖片和程式碼以取得解釋。

在此輸入影像描述

微量元素

\documentclass{scrartcl}

\usepackage{booktabs}
\usepackage[para]{threeparttable}
\usepackage{tablefootnote}
\renewcommand{\TPTnoteSettings}{\footnotesize}
\newcommand{\tabfnote}[2]{\llap{#1. }#2}

\begin{document}
\begin{table}[tbph]
    \begin{threeparttable}[t]
        \begin{tabular}{ll} \toprule
            Alpha & Beta \\
            Gamma & Delta \\ \bottomrule
        \end{tabular}
        \begin{tablenotes}
            \tabfnote{a}{Why is there space above?}\\
            \tabfnote{b}{But not above this one...}\\
            \tabfnote{c}{Or this one}
        \end{tablenotes}
    \end{threeparttable}
\end{table}
\end{document}

答案1

vertical mode在 的開頭發生了一些事情tablenotes,我不太明白,但\leavevmode在 的定義開頭加上 a\tabfnote解決了問題:

\documentclass{scrartcl}

\usepackage{booktabs}
\usepackage[para]{threeparttable}
\usepackage{tablefootnote}
\renewcommand{\TPTnoteSettings}{\footnotesize}
\newcommand{\tabfnote}[2]{\leavevmode\llap{#1. }#2}

\begin{document}

\begin{table}[tbph]
    \begin{threeparttable}[t]
        \begin{tabular}{ll} \toprule
            Alpha & Beta \\
            Gamma & Delta \\ \bottomrule
        \end{tabular}
        \begin{tablenotes}
            \tabfnote{a}{Why is there space above?}\\
            \tabfnote{b}{But not above this one...}\\
            \tabfnote{c}{Or this one}
        \end{tablenotes}
    \end{threeparttable}
\end{table}

\end{document} 

在此輸入影像描述

相關內容