0

I would like to build upon Heiko Oberdiek's threeparttable solution here and ask if it is possible to keep the indentation for the numbered footnote items while flushing the items without anything in square brackets to the left, like so:

enter image description here

I'm not particular about how deep the indentation is; the superscript a might just as well be aligned with the two lines above it. I tried modifying the alignment with \renewcommand{\TPTnoteSettings} but I am struggling to treat numbered and non-numbered items differently.

In case you'd like to play around with my table here, this is the code that incorporates Heiko Oberdiek's tip but where only the first line of a numbered footnote is indented:

\documentclass{article}

\usepackage{threeparttable}
\usepackage{booktabs}

\begin{document}

\begin{center}
  \begin{threeparttable}
  \caption{flushleft}
    \begin{tabular}{l c c c c}
      \toprule
        type & cyl & disp & hp & drat \\
      \midrule
        Ferrari & 6 & 160 & 110 & 3.9 \\
        VW & 6 & 160 & 110 & 3.9 \\
        Chevrolet & 4\tnote{a} & 108 & 93 & 3.85 \\
        Tesla & 6 & 258 & 110 & 3.08 \\
        Ford & 8 & 360 & 175 & 3.15 \\
      \bottomrule
    \end{tabular}
    \begin{tablenotes}[flushleft]\footnotesize
        \item \leavevmode\kern-\scriptspace\kern-\labelsep Some longer note that may span several rows below the table.
        \item [a] A note that might as well span multiple rows despite being a footnote.
    \end{tablenotes}
  \end{threeparttable}
\end{center}

\end{document}

This incomplete attempt yields the following: incomplete

2
  • 2
    Please, be so kind and show us a code for your table. Help us to help you.
    – Zarko
    Commented Dec 29, 2021 at 1:49
  • Thanks! I just added the code (even though it doesn't yet reflect what I would like to achieve).
    – dufei
    Commented Dec 29, 2021 at 10:29

1 Answer 1

1

It seems that Zarko just gave a solution without being aware of it: My desired layout can be achieved by adding all source notes in between the tabular environment and the tablenotes environment and then leaving the tablenotes environment at its default option (i.e. not using flushleft, online or para).

\documentclass{article}

\usepackage{threeparttable}
\usepackage{booktabs}

\begin{document}

\begin{center}
  \begin{threeparttable}
  \caption{Solved!}
    \begin{tabular}{l c c c c}
      \toprule
        type & cyl & disp & hp & drat \\
      \midrule
        Ferrari & 6 & 160 & 110 & 3.9 \\
        VW & 6 & 160 & 110 & 3.9 \\
        Chevrolet & 4\tnote{a} & 108 & 93 & 3.85 \\
        Tesla & 6 & 258 & 110 & 3.08 \\
        Ford & 8 & 360 & 175\tnote{b} & 3.15 \\
      \bottomrule
    \end{tabular}\footnotesize
    \emph{Note:} Here is some text that is not actually part of the footnotes and might contain source notes.
    \begin{tablenotes}\footnotesize
        \item [a] A note that might as well span multiple rows despite being a footnote.
        \item [b] Another short note.
    \end{tablenotes}
    \emph{Source: } Here is some other stuff outside the tablenotes environment that might span multiple lines.
  \end{threeparttable}
\end{center}

\end{document}

I'm not sure this is how threeparttable was meant to be used but at least it doesn't throw an error during compilation and nothing is wider than the table width.

solved

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .