Tables – Troubleshooting Centering Issues with Threeparttable in LaTeX

tablesthreeparttable

I a using threeparttable and the tablenote doesn't looks aligned with the table. This is a MWE.

\documentclass[12pt,twoside]{report}
\usepackage[headheight=18pt,a4paper, width=150mm, top=25mm, bottom=25mm, bindingoffset=6mm, headsep=18pt]{geometry}
\usepackage[spanish, es-noquoting]{babel}
%interprete de idioma castellano
\usepackage[utf8]{inputenc} %relacionado al input
\usepackage[T1]{fontenc} 
\usepackage{graphicx}
\usepackage{float}
\restylefloat{table}
\usepackage{threeparttable}
\usepackage{caption}

\begin{document}

\begin{center}
\begin{threeparttable}[H]
\centering
\captionof{table}{Convergencia RM1-cluster}\label{table:convergencia_cluster_RM1}
\begin{tabular}{|l|l|l|}
\hline
\textbf{nºconf} & \textbf{$\Delta G^\circ$-SS} & \textbf{$\Delta G^\circ$-Packmol} \\ \hline
5 & -69.9 & -71.1 \\ \hline
10 & -69.5 & -71.7 \\ \hline
80 & -70.4 & -74.7 \\ \hline
90 & -70.8 & -74.1 \\ \hline
100 & -70.6 & -71.8 \\ \hline
120 & -70.2 & -73.9 \\ \hline
140 & -71.2 & -73.1 \\ \hline
180 & -71.9 & -72.7 \\ \hline
250 & -71.4 & -74.6 \\ \hline
\end{tabular}
\begin{tablenotes}
\item \scriptsize {En la tabla se compara $\Delta G^0$ de dos métodos de solvatación (SS y Packmol) con hamiltoniano RM1. Los valores de $\Delta G^0$ se dan en Kcal/mol. La sigla SS significa Solvateshell.}
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{document}

There should be an easier way to do this kind of things. I though about \epigraph but it didn't work.

Best Answer

note that threeparttable is intended to go in a table enviornment (and does not have an [H] option. Floats should never go inside display environments such as center, so..

enter image description here

\documentclass[12pt,twoside]{report}
\usepackage[headheight=18pt,a4paper, width=150mm, top=25mm, bottom=25mm, bindingoffset=6mm, headsep=18pt]{geometry}
\usepackage[spanish, es-noquoting]{babel}
%interprete de idioma castellano
\usepackage[utf8]{inputenc} %relacionado al input
\usepackage[T1]{fontenc} 
\usepackage{graphicx}
\usepackage{float}

\usepackage[flushleft]{threeparttable}
\usepackage{caption}

\begin{document}


\begin{table}[H]
\centering
\begin{threeparttable}
\caption{Convergencia RM1-cluster}\label{table:convergencia_cluster_RM1}
\begin{tabular}{|l|l|l|}
\hline
\textbf{nºconf} & \textbf{$\Delta G^\circ$-SS} & \textbf{$\Delta G^\circ$-Packmol} \\ \hline
5 & -69.9 & -71.1 \\ \hline
10 & -69.5 & -71.7 \\ \hline
80 & -70.4 & -74.7 \\ \hline
90 & -70.8 & -74.1 \\ \hline
100 & -70.6 & -71.8 \\ \hline
120 & -70.2 & -73.9 \\ \hline
140 & -71.2 & -73.1 \\ \hline
180 & -71.9 & -72.7 \\ \hline
250 & -71.4 & -74.6 \\ \hline
\end{tabular}
\begin{tablenotes}
\scriptsize 
\item[1] En la tabla se compara $\Delta G^0$ de dos métodos de solvatación (SS y Packmol) con hamiltoniano RM1. Los valores de $\Delta G^0$ se dan en Kcal/mol. La sigla SS significa Solvateshell.
\end{tablenotes}
\end{threeparttable}
\end{table}

\end{document}
Related Question