1

I will describe the problem:

Caption and captionof aren't centering table's titles. I provide a MWE and below an image of this problem.

    \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{threeparttable}
\floatstyle{plaintop}
\restylefloat{table}
\usepackage[justification=centering]{caption}

\begin{document}

\begin{table}[H]
\centering
\begin{threeparttable}
\captionof{table}{Convergencia PM6-cluster}\label{table:convergencia_cluster_PM6}
\begin{tabular}{|c|c|c|}
\hline
\textbf{nºconf} & \textbf{$\Delta G^\circ_{SS}$} & \textbf{$\Delta G^\circ_{Packmol}$} \\ \hline
5 & -64.6 & -64.7 \\ \hline
10 & -65.5 & -64.1 \\ \hline
15 & -63.7 & -66.5 \\ \hline
20 & -64.3 & -65.0 \\ \hline
250 & -66.3 & -67.0 \\ \hline
\end{tabular}
\begin{tablenotes}[flushleft]
\item \scriptsize{En la tabla se compara $\Delta G^0$ de dos métodos de solvatación (SS y Packmol) con hamiltoniano PM6. Los valores de $\Delta G^0$ se dan en Kcal/mol. La sigla SS significa Solvateshell.}
\end{tablenotes}
\end{threeparttable}
\end{table}

\begin{table}[H]
\centering
\begin{threeparttable}
\caption{Convergencia PM6-cluster}\label{table:convergencia_cluster_PM6}
\begin{tabular}{|c|c|c|}
\hline
\textbf{nºconf} & \textbf{$\Delta G^\circ_{SS}$} & \textbf{$\Delta G^\circ_{Packmol}$} \\ \hline
5 & -64.6 & -64.7 \\ \hline
10 & -65.5 & -64.1 \\ \hline
15 & -63.7 & -66.5 \\ \hline
20 & -64.3 & -65.0 \\ \hline
250 & -66.3 & -67.0 \\ \hline
\end{tabular}
\begin{tablenotes}[flushleft]
\item \scriptsize{En la tabla se compara $\Delta G^0$ de dos métodos de solvatación (SS y Packmol) con hamiltoniano PM6. Los valores de $\Delta G^0$ se dan en Kcal/mol. La sigla SS significa Solvateshell.}
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}

help!!

As you might see, the titles aren't centered with the tables.

Any help?

  • You are using threeparttable. – Johannes_B Sep 3 '17 at 9:58
  • mm are you saying because of the OP's title? @Johannes_B – user134500 Sep 3 '17 at 10:00
  • Sorry, you are using float. It is not threeparttables fault. – Johannes_B Sep 3 '17 at 10:03
  • 1
    Unrelated: It has to be {\scriptsize small text here} (not the different placement of the opening brace). – Johannes_B Sep 3 '17 at 10:04
  • @Johannes_B great, I will change it. Thanks for the advice. – user134500 Sep 3 '17 at 10:05
3

Remove \restylefloat{table} and this works fine. I suppose whatever modifications \restylefloat does to table isn't compatible with threeparttable.

2

Following the suggestion of Torbjørn T., here is the MWE with a bit of further restyling. You need \par, for example, to get line spacing right. I also used booktabs and siunitx. I also suggest to use microtype and to use \textup for text in mathmode.

\documentclass[]{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{threeparttable}
%\floatstyle{plaintop}
%\restylefloat{table}
\usepackage[justification=centering]{caption}
\usepackage{siunitx}
\usepackage{booktabs}

\begin{document}

\thispagestyle{empty}
%% for presentation in tex.stackov...


\begin{table}[!h]
\centering
\begin{threeparttable}
\captionof{table}{Convergencia PM6-cluster}\label{table:convergencia_cluster_PM6-1}
\begin{tabular}{SSS}
\toprule
{nºconf} & {$\Delta G^\circ_{SS}$} & {$\Delta G^\circ_{Packmol}$} \\ 
\midrule
5 & -64.6 & -64.7 \\ 
10 & -65.5 & -64.1 \\
15 & -63.7 & -66.5 \\ 
20 & -64.3 & -65.0 \\ 
250 & -66.3 & -67.0 \\ 
\bottomrule
\end{tabular}
\begin{tablenotes}[flushleft]
\item {\scriptsize En la tabla se compara $\Delta G^0$ de dos métodos de solvatación (SS y Packmol) con hamiltoniano PM6. Los valores de $\Delta G^0$ se dan en Kcal/mol. La sigla SS significa Solvateshell.\par}
\end{tablenotes}
\end{threeparttable}
\end{table}

\end{document}

enter image description here

  • Why do you suggest to use \tabular{SSS} rather than 'centered'? – user134500 Sep 4 '17 at 22:07
  • 1
    @Hernan Miraola: because it centers along the decimal dot, automatically typesets correct sign symbol ($-$ vs. -), etc. I wish I knew about it earlier! – Oleg Lobachev Sep 5 '17 at 19:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy