7

I am using the threeparttable environment to make tables. The table notes are always indented. How can I get the notes to start flush with the table?

\documentclass[a4paper,12pt]{article}

\usepackage[flushleft]{threeparttable}

\begin{document}

\begin{table}[ht] \centering
\begin{threeparttable}
\caption{Title For My Table}
\begin{tabular}{l*{3}{c}}
\hline\hline
&\multicolumn{1}{c}{Outcome 1}&\multicolumn{1}{c}{Outcome 2 }&\multicolumn{1}{c}{Outcome 3 }\\

\hline
Independent Variable 1              &      0.0316         &     0.00186         &  0.0001   \\
                    &    (0.0284)         &    (0.0256)         &    (0.0221)          \\
[1em]
Independent Variable 1                &      0.0226 ***&     -0.0154 *  &     -0.0125          \\
                    &   (0.00833)         &   (0.00887)         &    (0.0107)             \\
[1em]
Independent Variable 1                &      0.0180         &    -0.00997         &     -0.0245                \\
                    &    (0.0122)         &   (0.00972)         &    (0.0255)                \\
[1em]
Independent Variable 1               &      0.0270 *  &     -0.0180 *  &     -0.0222                \\
                    &    (0.0141)         &   (0.00915)         &    (0.0153)                 \\
\hline
Observations        &         585         &         585         &         448                 \\
\hline\hline

\end{tabular}



    \begin{tablenotes}
      \tiny
      \item I'm writing the notes down here and I want them to be alligned with the table. However, there is a small indent. 

    \end{tablenotes}
\end{threeparttable}
\end{table}


\end{document}
jub0bs
  • 58,916
Ryan
  • 71
  • 1
  • 2

3 Answers3

8

The syntax intended for items in the tablenotes environment is \item[<some marker>} .... If you're not going to use markers, i.e., if you're going to write \item ..., you should add the instruction

\setlength\labelsep{0pt}

at the start of the tablenotes environment.

A separate issue: Since the numbers in the table look like they may be easier to parse if they're aligned on their decimal markers, you may want to use a package such as dcolumn and its d column type to make the table more readable.

enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage[flushleft]{threeparttable}
\usepackage{dcolumn}
\newcolumntype{d}[1]{D{.}{.}{#1}}
\begin{document}

\begin{table}[ht] \centering
\begin{threeparttable}
\caption{Title For My Table}

\begin{tabular}{ l d{2.7} d{2.6} d{2.5} }
\hline\hline
&\multicolumn{1}{c}{Outcome 1}
&\multicolumn{1}{c}{Outcome 2}
&\multicolumn{1}{c}{Outcome 3}\\
\hline
Independent Variable 1 & 0.0316 & 0.00186 & 0.0001 \\
& (0.0284) & (0.0256) & (0.0221) \\[1em]
Independent Variable 2 & 0.0226^{***} & -0.0154^{*} & -0.0125 \\
& (0.00833) & (0.00887) & (0.0107) \\[1em]
Independent Variable 3 & 0.0180 & -0.00997 & -0.0245 \\
& (0.0122) & (0.00972) & (0.0255) \\[1em]
Independent Variable 4 & 0.0270^{*} & -0.0180^{*} & -0.0222 \\
& (0.0141) & (0.00915) & (0.0153) \\
\hline
Observations 
& \multicolumn{1}{c}{585} 
& \multicolumn{1}{c}{585} 
& \multicolumn{1}{c}{448} \\
\hline\hline
\end{tabular}

\begin{tablenotes}
\setlength\labelsep{0pt}
\footnotesize
\item I'm writing the notes down here and I want them to be aligned with the table. Now, there's no longer small indent.
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document} 
Mico
  • 506,678
0

For those seeing this at a later date, a simple [flushleft] worked for me, whereas Mico's suggestion of \setlength\labelsep{0pt} did nothing in my application.

...
\begin{tablenotes}[flushleft]
    \item Your note text here.
\end{tablenotes}
...
  • you are overlooked option flushleft at loading threeparttable package in the @Mico answer. Setting \labelsep to zero remove small indent in the first line of tablenotes text caused by \item. This indent is present if one use just flushleft option. – Zarko Oct 18 '19 at 00:47
  • Oh, I see, thanks for the comment and improved answer. – Zach S. Oct 19 '19 at 01:05
0

The same result as in @Mico answer you obtain also without setting \labelsep to zero with adding option para to \begin{tablenotes}, i.e. writing \begin{tablenotes}[para] and than omit item label from it:

\documentclass[a4paper,12pt]{article}
\usepackage[flushleft]{threeparttable} % <---
\usepackage{dcolumn}
\newcolumntype{d}[1]{D{.}{.}{#1}}
\begin{document}

\begin{table}[ht] \centering
\begin{threeparttable}
\caption{Title For My Table}

\begin{tabular}{ l d{2.7} d{2.6} d{2.5} }
\hline\hline
&\multicolumn{1}{c}{Outcome 1}
&\multicolumn{1}{c}{Outcome 2}
&\multicolumn{1}{c}{Outcome 3}\\
\hline
Independent Variable 1  
    & 0.0316        & 0.00186       & 0.0001    \\
    & (0.0284)      & (0.0256)      & (0.0221)  \\[1ex]
Independent Variable 2  
    & 0.0226^{***}  & -0.0154^{*}   & -0.0125   \\
    & (0.00833)     & (0.00887)     & (0.0107)  \\[1ex]
Independent Variable 3 
    & 0.0180        & -0.00997      & -0.0245   \\
    & (0.0122)      & (0.00972)     & (0.0255)  \\[1ex]
Independent Variable 4 
    & 0.0270^{*}    & -0.0180^{*}   & -0.0222   \\
    & (0.0141)      & (0.00915)     & (0.0153)  \\
\hline
Observations
& \multicolumn{1}{c}{585}
& \multicolumn{1}{c}{585}
& \multicolumn{1}{c}{448} \\
\hline\hline
\end{tabular}

\begin{tablenotes}[para]    % <---
\footnotesize
I'm writing the notes down here and I want them to be aligned with the table. Now, there's no longer small indent. It is eliminated by adding option `para` to `tablenotes`.
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document} 

enter image description here

Note: option para can be added to options of threeparttable:

\usepackage[flushleft, para]{threeparttable}

but in this case in all three part table notes are in paragraph mode.

Zarko
  • 296,517