1

I have the following problem. I use threeparttable and tablenotes for my notes. Unfortunately, the note is not aligned with the text width:

note below a table overflowing the page

How do I get this fixed?

\documentclass[a4paper, 12pt, twoside = false,        
    BCOR=10mm, toc=bibliography, listof=totoc]{scrartcl}
\usepackage[left=3cm,right=3.5cm,top=2.5cm,bottom=2.75cm]{geometry} 
\usepackage{multirow}
\usepackage[hang]{footmisc}
\usepackage{float}
\usepackage{lipsum}
\usepackage{placeins}
\usepackage{threeparttable}
\usepackage{multicol}
\usepackage{subcaption}
\usepackage{booktabs}
\usepackage{adjustbox}
\usepackage{tabularx}
\usepackage{amsmath}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}
\begin{table}[H]
    \centering
    \caption{Caption}
        \begin{threeparttable}
            \begin{adjustbox}{width=1\textwidth}
            \begin{tabular}{@{}lccccccccccc@{}}
                \toprule
                & $\alpha=0$ & $\alpha=1.05$ & $\alpha=1.10$ & $\alpha=1.15$ & $\alpha=1.20$ & $\alpha=1.25$ & $\alpha=1.30$ & $\alpha=1.35$ & $\alpha=1.40$ & $\alpha=1.45$ & $\alpha=1.50$  \\ 
                \midrule
                $\mathcal{AA}$  & 0 &0.239& 0.262 &0.379 &0.423 &0.552 &0.591 &0.623 &3.338& 0.127& 0.4339 \\
                $\mathcal{BB}$ & 10 &  33.4 &23.0& 1.5& 2.0 &2.2& 24.8& 26.33 &26.38 &12.63& 8.5 \\
                \bottomrule
            \end{tabular}
                \end{adjustbox}
            \begin{tablenotes}[para, flushleft]
                \footnotesize \emph{Note:} \lipsum[1]           
        \end{tablenotes}
        \end{threeparttable}
\end{table}
\end{document}

5 Answers 5

2

Avoid repeating information: all those useless \alpha= are the main source for your problem.

With the narrow entries in the first column you show, the table fits in the text width.

You might want to set \small or \footnotesize depending on the first column width. But never scale tables.

\documentclass[
  a4paper,
  12pt,
  twoside = false,        
  BCOR=10mm,
  toc=bibliography,
  listof=totoc,
  captions=tableheading,
]{scrartcl}
\usepackage[left=3cm,right=3.5cm,top=2.5cm,bottom=2.75cm]{geometry} 
\usepackage[T1]{fontenc}

\usepackage{threeparttable}
\usepackage{array}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage{caption}
\captionsetup[table]{position=top}

\usepackage{lipsum}

\begin{document}
\begin{table}[htp]

\setlength{\tabcolsep}{0pt}

\begin{threeparttable}
\caption{Caption}

\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}l*{11}{>{$}c<{$}}}
\toprule
& \multicolumn{11}{c}{Values of $\alpha$} \\
\cmidrule{2-12}
& 0 & 1.05 & 1.10 & 1.15 & 1.20 & 1.25 & 1.30 & 1.35 & 1.40 & 1.45 & 1.50  \\ 
\midrule
$\mathcal{AA}$  & 0 &0.239& 0.262 &0.379 &0.423 &0.552 &0.591 &0.623 &3.338& 0.127& 0.4339 \\
$\mathcal{BB}$ & 10 &  33.4 &23.0& 1.5& 2.0 &2.2& 24.8& 26.33 &26.38 &12.63& 8.5 \\
\bottomrule
\end{tabular*}

\begin{tablenotes}[para, flushleft]
\footnotesize \emph{Note:} \lipsum[1]           
\end{tablenotes}
\end{threeparttable}

\end{table}

\end{document}

Note the caption=tableheadings option so the caption is properly spaced from the table.

enter image description here

1

Not sure why it is happening (it is clear that threeparttable sees the original width before scaling). One can save the table in a box and use that:

\documentclass[a4paper]{scrartcl}
\usepackage{lipsum}
\usepackage{threeparttable}
\usepackage{booktabs}
\usepackage{adjustbox}
\usepackage{tabularx}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\newsavebox{\test}
\begin{document}
\begin{table}
    \centering
    \caption{Caption}
    \begin{lrbox}{\test}
          \begin{adjustbox}{width=1\textwidth}
            \begin{tabular}{@{}lccccccccccc@{}}
                \toprule
                & $\alpha=0$ & $\alpha=1.05$ & $\alpha=1.10$ & $\alpha=1.15$ & $\alpha=1.20$ & $\alpha=1.25$ & $\alpha=1.30$ & $\alpha=1.35$ & $\alpha=1.40$ & $\alpha=1.45$ & $\alpha=1.50$  \\ 
                \midrule
                $\mathcal{AA}$  & 0 &0.239& 0.262 &0.379 &0.423 &0.552 &0.591 &0.623 &3.338& 0.127& 0.4339 \\
                $\mathcal{BB}$ & 10 &  33.4 &23.0& 1.5& 2.0 &2.2& 24.8& 26.33 &26.38 &12.63& 8.5 \\
                \bottomrule
            \end{tabular}
          \end{adjustbox}
          \end{lrbox}
          \begin{threeparttable}
            \usebox{\test}
            \begin{tablenotes}[para, flushleft]
                \footnotesize \emph{Note:} \lipsum[1]           
        \end{tablenotes}
        \end{threeparttable}
\end{table}
\end{document}

(I removed a lot of packages that are not relevant to the question)

1

Scaling tables is not recommended. In your case the table becomes hardly readable. Why not rotating such a wide table:

\documentclass[a4paper,% not needed, because default
12pt,
twoside = false,% not needed, because default
%BCOR=10mm,% Does not make sense, because overwritten by geometry
toc=bibliography, listof=totoc]{scrartcl}
\usepackage[left=3cm,right=3.5cm,top=2.5cm,bottom=2.75cm]{geometry}
\usepackage{lipsum}
\usepackage{float}
\usepackage{threeparttable}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage[utf8]{inputenc}% not needed since LaTeX 2018/04/01
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{caption}
\usepackage{siunitx}
\usepackage{pdflscape}
\usepackage{scrhack}
\usepackage{showframe}% visualize the text area
\begin{document}
\begin{landscape}
\begin{table}[H]
    \caption{Caption}
    \centering
    \begin{threeparttable}
            \begin{tabular}{@{}lS[table-format=2.0]*{9}{S[table-format=2.3]}S[table-format=1.4]@{}}
                \toprule
                & {$\alpha=0$} & {$\alpha=1.05$} & {$\alpha=1.10$} & {$\alpha=1.15$} & {$\alpha=1.20$} & {$\alpha=1.25$} & {$\alpha=1.30$} & {$\alpha=1.35$} & {$\alpha=1.40$} & {$\alpha=1.45$} & {$\alpha=1.50$} \\ 
                \midrule
                $\mathcal{AA}$  & 0 &0.239& 0.262 &0.379 &0.423 &0.552 &0.591 &0.623 &3.338& 0.127& 0.4339 \\
                $\mathcal{BB}$ & 10 &  33.4 &23.0& 1.5& 2.0 &2.2& 24.8& 26.33 &26.38 &12.63& 8.5 \\
                \bottomrule
            \end{tabular}
            \begin{tablenotes}[para, flushleft]
                \footnotesize \emph{Note:} \lipsum[1]           
        \end{tablenotes}
        \end{threeparttable}
\end{table}
\end{landscape}
\end{document}

using landscape table

or at least reduce the width of the table headings by removing the α = from all columns and add it only once at the first column:

\documentclass[a4paper,% not needed, because default
12pt,
twoside = false,% not needed, because default
%BCOR=10mm,% Does not make sense, because overwritten by geometry
toc=bibliography, listof=totoc]{scrartcl}
\usepackage[left=3cm,right=3.5cm,top=2.5cm,bottom=2.75cm]{geometry}
\usepackage{lipsum}
\usepackage{float}
\usepackage{threeparttable}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage[utf8]{inputenc}% not needed since LaTeX 2018/04/01
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{caption}
\usepackage{siunitx}
\usepackage{showframe}% visualize the text area
\begin{document}
\begin{table}[H]
    \caption{Caption}
    \centering
    \begin{threeparttable}
      \scriptsize
            \begin{tabular}{@{}lS[table-format=2.0]*{9}{S[table-format=2.3]}S[table-format=1.4]@{}}
                \toprule
                $\alpha =$  & 0 & 1.05 & 1.10 & 1.15 & 1.20 & 1.25 & 1.30 & 1.35 & 1.40 & 1.45 & 1.50  \\ 
                \midrule
                $\mathcal{AA}$  & 0 &0.239& 0.262 &0.379 &0.423 &0.552 &0.591 &0.623 &3.338& 0.127& 0.4339 \\
                $\mathcal{BB}$ & 10 &  33.4 &23.0& 1.5& 2.0 &2.2& 24.8& 26.33 &26.38 &12.63& 8.5 \\
                \bottomrule
            \end{tabular}
            \begin{tablenotes}[para, flushleft]
                \footnotesize \emph{Note:} \lipsum[1]           
        \end{tablenotes}
        \end{threeparttable}
\end{table}
\end{document}

portrait

0

It's not recommended to scale a table: you will have inconsistencies in the width of the rules.

If you actually want your table on a row, you should use change the font (eg \tiny) and use {tabular*} to have a tabular with the width of surrounding text.

\documentclass[a4paper, 12pt, twoside = false,        
    BCOR=10mm, toc=bibliography, listof=totoc]{scrartcl}
\usepackage[left=3cm,right=3.5cm,top=2.5cm,bottom=2.75cm]{geometry} 
\usepackage[hang]{footmisc}
\usepackage{float}
\usepackage{threeparttable}
\usepackage{booktabs}
\usepackage{adjustbox}
\usepackage{tabularx}
\usepackage{amsmath}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{lipsum}
\begin{document}
\begin{table}[H]
    \centering
    \tiny
    \setlength{\tabcolsep}{0pt}
    \caption{Caption}
        \begin{threeparttable}
            \begin{tabular*}{\linewidth}{@{}@{\extracolsep{\fill}}lccccccccccc@{}}
                \toprule
                & $\alpha=0$ & $\alpha=1.05$ & $\alpha=1.10$ & $\alpha=1.15$ & $\alpha=1.20$ & $\alpha=1.25$ & $\alpha=1.30$ & $\alpha=1.35$ & $\alpha=1.40$ & $\alpha=1.45$ & $\alpha=1.50$  \\ 
                \midrule
                $\mathcal{AA}$  & 0 &0.239& 0.262 &0.379 &0.423 &0.552 &0.591 &0.623 &3.338& 0.127& 0.4339 \\
                $\mathcal{BB}$ & 10 &  33.4 &23.0& 1.5& 2.0 &2.2& 24.8& 26.33 &26.38 &12.63& 8.5 \\
                \bottomrule
            \end{tabular*}
            \begin{tablenotes}[para, flushleft]
                \footnotesize \emph{Note:} \lipsum[1]           
        \end{tablenotes}
        \end{threeparttable}
\end{table}

\lipsum[2]
\end{document}

Output of the above code

0

I would use talltblr of tabularray package, reduce column separations and, in last column round decimal numbers to three digits and a bit reorganize column headers:

\documentclass{scrartcl}
\usepackage[hmargin={3cm,3.5cm}, vmargin={2.5cm,2.75cm}]{geometry}
%--------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%
\usepackage{lipsum}             % for dummy text
%---------------------------------------------------------------%

\usepackage[T1]{fontenc}
\usepackage[english]{babel}

\usepackage{ragged2e}
\usepackage{tabularray}
\UseTblrLibrary{amsmath, booktabs, siunitx}


\begin{document}
    \begin{table}[htb]
    \SetTblrStyle{note}{font=\footnotesize\RaggedRight}
\begin{talltblr}[
caption = {Caption},
  label = {tlltblr},
remark{Note} = {\lipsum[66]}
                ]{colsep  = 3pt,
                  colspec = {@{}   Q[l, mode=math]
                                   Q[c, si={table-format=2.0}]
                              *{9}{X[c, si={table-format=2.3}]}
                                   X[c, si={table-format=1.4}]
                              @{}},
                  row{1}  = {guard, mode=math}
                  } 
%
    \toprule
\SetCell[r=2]{}
                & \SetCell[c=11]{c} \alpha
                                &               &               &               &       
                &               &               &               &               &               &               \\
    \midrule
                & 0      & 1.05   & 1.10   & 1.15   & 1.20
                & 1.25   & 1.30   & 1.35   & 1.40   & 1.45   & 1.50   \\
    \midrule
\mathcal{AA}    &  0            &  0.239        &  0.262        &  0.379        &  0.423         
                &  0.552        &  0.591        &  0.623        &  3.338        &  0.127    & 0.4339            \\
\mathcal{BB}    & 10            & 33.4          & 23.0          &  1.5          &  2.0 
                &  2.2          & 24.8          & 26.33         & 26.38         & 12.63     & 8.5               \\
    \bottomrule
\end{talltblr}
    \end{table}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .