Passen Sie die Breite der Minipage-Fußnote an die Tabellenumgebung an, in der sie sich befindet

Passen Sie die Breite der Minipage-Fußnote an die Tabellenumgebung an, in der sie sich befindet

Ich habe Tabellennotizen in einer \minipageUmgebung platziert, innerhalb einer \tableUmgebung. Ich möchte das \minipageBreitenargument so übergeben, dass es jeder beliebigen Breite der Umgebung entspricht, \tablein der es sich befindet.

MWE:

\documentclass[12pt]{article}
\usepackage{booktabs}
\begin{document}
    \begin{table}
        \centering
        \begin{tabular}{l*{4}{c}}
            \toprule
            & (1) & (2) & (3) & (4) \\
            \midrule
            Outcome & 0.057 & 0.066 & 0.054 & 0.051 \\
            & (0.025) & (0.032) & (0.041) & (0.028) \\
            \bottomrule
        \end{tabular}
        \begin{minipage}{\linewidth}
%       \begin{minipage}{\textwidth} -- what should go in this width argument?
            \footnotesize \textit{This is my footnote explaining the table. I would like to substitute something in for minipage's width argument such that this minipage footnote will have the same width as the table in whose environment it sits. }
        \end{minipage}
    \end{table}
Here's some text just to show how wide a paragraph is for comparison. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
\end{document}

Bildschirmfoto:

Screenshot einer Tabelle mit zu breiter Fußnote

Ich habe bereits linewidthund ausprobiert \textwidth, mit identischen Ergebnissen. Wenn es eine bessere Lösung zum Erreichen meines Ziels gibt, die nicht erfordert minipage, würde ich mich freuen, davon zu hören – sie sollte aber tabularnach Möglichkeit mit kompatibel sein.

Meine Tabelle wird durch einen Stata- esttabBefehl erstellt. Ich denke nicht, dass dies die Antwort beeinflussen sollte, erwähne es jedoch für den Fall, dass es anderen Stata-Benutzern hilft, die nach der gleichen Frage suchen.

Antwort1

Mit Hilfe des threeparttablePakets:

Bildbeschreibung hier eingeben

\documentclass[12pt]{article}
\usepackage{booktabs}
\usepackage{threeparttable}
\begin{document}
    \begin{table}
        \centering
        \begin{threeparttable}
            \begin{tabular}{l*{4}{c}}
                \toprule
                  & (1) & (2) & (3) & (4) \\
                \midrule
                Outcome & 0.057 & 0.066 & 0.054 & 0.051 \\
                & (0.025) & (0.032) & (0.041) & (0.028) \\
                \bottomrule
            \end{tabular}
            \begin{tablenotes}[flushleft]
                \setlength\labelsep{0pt}
                \footnotesize 
                \itshape
                \item This is my footnote explaining the table. I would like to substitute something in for minipage's width argument such that this minipage footnote will have the same width as the table in whose environment it sits. 
            \end{tablenotes}
        \end{threeparttable}
    \end{table}
Here's some text just to show how wide a paragraph is for comparison. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
\end{document}

\end{document}

verwandte Informationen