6

Here is a working example:

\documentclass[preprint, 12pt, 3p, twocolumn, sort&compress]{elsarticle}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{threeparttable}
\usepackage{caption}
\usepackage{subcaption}

\begin{document}

\begin{table}[] \begin{threeparttable} \resizebox{\columnwidth}{!}{% \begin{tabular}{@{}ccc@{}} \toprule \begin{tabular}[c]{@{}c@{}}Heating rate\ (\si[per-mode=symbol]{\degreeCelsius\per\minute})\end{tabular} & \begin{tabular}[c]{@{}c@{}}Final temperature\ (\si{\degreeCelsius})\end{tabular} & \begin{tabular}[c]{@{}c@{}}Carbonisation time\ (\si{\minute})\end{tabular} \ \midrule 1.4\tnote{$a$} & 1000 & 708 \ 3.0 & 600 & 192 \ 3.0 & 800 & 258 \ 3.0 & 1000 & 325 \ 3.0 & 1200 & 392 \ 3.0 & 1400 & 458 \ 3.0 & 1600 & 525 \ 10.0 & 1000 & 98 \ 20.0 & 1000 & 49 \ 40.0 & 1000 & 24 \ \bottomrule \end{tabular}% } \begin{tablenotes} \footnotesize \item[$a$]{\SI[per-mode=symbol]{1}{\degreeCelsius\per\minute} to \SI{600}{\degreeCelsius} and then \SI[per-mode=symbol]{3}{\degreeCelsius\per\minute} to \SI{1000}{\degreeCelsius}} \end{tablenotes} \caption{Investigated carbonisation conditions \cite{bengtssonCarbonFibersLignin2020}} \label{tab:conditions} \end{threeparttable} \end{table}

\end{document}

My code produces this output (see image):

Example of tablenote overhanging column width

Any idea how I might stop the footnote overhanging the column?

Much appreciated.

  • 1
    You shouldn't use \resizebox in general; in this particular case, threeparttable is not able to guess the table width. – egreg Apr 10 '21 at 12:28

2 Answers2

4

In order to guess the table width, threeparttable has to “see” the tabular environment, but you hide it inside \resizebox.

In general one should never use \resizebox to make a table fit, because this would create unbalances in font size.

The problem with this table are the wide headers: split them in three rows instead of two.

\documentclass[preprint, 12pt, 3p, twocolumn, sort&compress]{elsarticle}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{threeparttable}
\usepackage{caption}
\usepackage{subcaption}

\begin{document}

\begin{table}[htp]

\newcommand{\splitcell}[1]{{\begin{tabular}[t]{@{}c@{}}#1\end{tabular}}}

\begin{threeparttable}

\begin{tabular}{\columnwidth}{ @{\extracolsep{\fill}} S[table-format=1.1] S[table-format=4.0] S[table-format=3.0] @{} } \toprule \splitcell{Heating \ rate \ (\si[per-mode=symbol]{\degreeCelsius\per\minute})} & \splitcell{Final \ temperature \ (\si{\degreeCelsius})} & \splitcell{Carbonisation \ time \ (\si{\minute})} \ \midrule 1.4\tnote{$a$} & 1000 & 708 \ 3.0 & 600 & 192 \ 3.0 & 800 & 258 \ 3.0 & 1000 & 325 \ 3.0 & 1200 & 392 \ 3.0 & 1400 & 458 \ 3.0 & 1600 & 525 \ 10.0 & 1000 & 98 \ 20.0 & 1000 & 49 \ 40.0 & 1000 & 24 \ \bottomrule \end{tabular}

\begin{tablenotes} \footnotesize\raggedright \item[$a$]{\SI[per-mode=symbol]{1}{\degreeCelsius\per\minute} to \SI{600}{\degreeCelsius} and then \SI[per-mode=symbol]{3}{\degreeCelsius\per\minute} to \SI{1000}{\degreeCelsius}} \end{tablenotes} \caption{Investigated carbonisation conditions \cite{bengtssonCarbonFibersLignin2020}} \label{tab:conditions} \end{threeparttable} \end{table}

\end{document}

enter image description here

egreg
  • 1,121,712
3

enter image description here

\documentclass[preprint, 12pt, 3p, twocolumn, sort&compress]{elsarticle}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{threeparttable}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{makecell}
\renewcommand{\theadfont}{\normalsize}
\begin{document}

\begin{table} \begin{threeparttable} \begin{tabular}{\linewidth}{@{\extracolsep{\fill}}S[table-format=2.1,table-space-text-post=\tnote{a}]S[table-format=4] S[table-format=3]@{}} \toprule {\thead{Heating rate\ (\si[per-mode=symbol]{\degreeCelsius\per\minute})}} & {\thead{Final temp.\ (\si{\degreeCelsius})}} & {\thead{Carbonisation\ time (\si{\minute})}} \ \midrule 1.4\tnote{$a$} & 1000 & 708 \ 3.0 & 600 & 192 \ 3.0 & 800 & 258 \ 3.0 & 1000 & 325 \ 3.0 & 1200 & 392 \ 3.0 & 1400 & 458 \ 3.0 & 1600 & 525 \ 10.0 & 1000 & 98 \ 20.0 & 1000 & 49 \ 40.0 & 1000 & 24 \ \bottomrule \end{tabular}% \begin{tablenotes}[flushleft] \footnotesize \item[$a$]{\SI[per-mode=symbol]{1}{\degreeCelsius\per\minute} to \SI{600}{\degreeCelsius} and then \SI[per-mode=symbol]{3}{\degreeCelsius\per\minute} to \SI{1000}{\degreeCelsius}} \end{tablenotes} \caption{Investigated carbonisation conditions \cite{bengtssonCarbonFibersLignin2020}} \label{tab:conditions} \end{threeparttable} \end{table}

\end{document}

leandriis
  • 62,593