0

I am trying to put a note at the bottom of the following longtable. Unfortunately, this is the result I get.

\documentclass[12pt]{article}
\usepackage{booktabs,amsmath,bm,siunitx}

\begin{document}

{\small\setlength{\tabcolsep}{4.5pt}
    \sisetup{table-format=2.4}
    \begin{longtable}{@{}l*{8}{S}}
        \label{my-label}\\
        \toprule
        \textbf{Descriptive Statistic} &{$rtb_t$} & {$xIG_t$} & {$xHY_t$} & {$xEM_t$} & {$xConv_t$} & {$y_t$}& {$DefRate_t$} & {$spr_t$}\\
        \endfirsthead
        %
        \endhead
        %
        \toprule
        Mean & 0.1658 & 0.0378 & 0.0442 & 0.0502 & 0.0524 & 0.4233 & 0.4996 & 0.2521 \\
        Standard Deviation & 0.0459 & 0.0699 & 0.0928 & 0.0810 & 0.1250 & 0.0439 & 0.0909 & 0.0351 \\
        Variance & 0.0021 & 0.0049 & 0.0086 & 0.0066 & 0.0156 & 0.0019 & 0.0083 & 0.0012\\
        Skewness & 0.1963 & -0.9932 & -1.6310 & -4.7227 & -1.1165 & 0.1730 & 1.2201 & 2.8841\\
        Kurtosis & 2.9890 & 8.4808 & 14.6628 & 50.1189 & 8.5597 & 2.0001 & 3.7574 & 13.6014 \\
        Sharpe Ratio &{–} & 0.5404 & 0.4762 & 0.6192 & 0.4191 & {–} & {–} & {–} \\
        \bottomrule
        \caption{Sample Statistics: Bond Model}
        \begin{tablenotes}
            \textbf{Note:} Here can be the table notes
        \end{tablenotes}

\end{longtable}
\end{document}

enter image description here

Do you know how to overcome this and have notes plus caption well formatted?

Thanks!

  • 2
    If your real table is of the same length as the one you show in your question, there is no need for a longtable. If you indeed need a longtable, you can combine it with threeparttablex in order to add table notes as shown in the answer to this question: converting threeparttable tabular to threeparttablex and longtable Please also add the relevant packages to your code. – leandriis Jul 31 '18 at 19:09
  • to have caption below long table is not smart idea. if it is really long (over two or more pages) than caption (which inform reader about table) is to late. – Zarko Jul 31 '18 at 19:35
  • @Zarko I have already put all images and tables in this format, so I would like to stick to it if possible. That's why I would like to put notes at the bottom. – madrac Jul 31 '18 at 19:45
  • @madrac, notes yes, but not the captions ... however if you like to have caption on the end, put it and table notes in \lastfoot – Zarko Jul 31 '18 at 19:47
  • @Zarko could you please provide your solution? If I apply that, I get the notes in the descriptive statistics line. I do not understand why. – madrac Jul 31 '18 at 19:52
2

Here is a code which fits between margins, but as the document is set in 12pt, you need to use footnotesize in your table, and reduce more the value of \tabcolsep. Note you should not have the caption at the end for a table that spreads over several pages.

For longtables we have to load threeparttablex and declare the tables notes before the table begins, and insert them with \InsertTableNotes in the \endlastfoot section.

\documentclass[12pt]{article}
\usepackage[showframe]{geometry}
\usepackage{longtable, booktabs}
\usepackage[online]{threeparttablex}
\usepackage{siunitx}

\begin{document}

\begin{ThreePartTable}
\footnotesize\setlength{\tabcolsep}{2.6pt}
    \sisetup{table-format=-1.4}
\begin{TableNotes}
  \item[\bfseries Note: ] Here can be the table notes.
\end{TableNotes}
    \begin{longtable}{@{}l@{}*{8}{S}}
        \label{my-label}\\
        \toprule
        \textbf{Descriptive Statistic} &{$rtb_t$} & {$xIG_t$} & {$xHY_t$} & {$xEM_t$} & {$\mathit{xConv_t}$} & {$y_t$}& {$\mathit{DefRate_t}$} & {$spr_t$}\\
        \endfirsthead
        %
        \endhead
        \bottomrule \addlinespace
        \caption{Sample Statistics: Bond Model}\\
        \insertTableNotes
        \endlastfoot
        %
        \toprule
        Mean & 0.1658 & 0.0378 & 0.0442 & 0.0502 & 0.0524 & 0.4233 & 0.4996 & 0.2521 \\
        Standard Deviation & 0.0459 & 0.0699 & 0.0928 & 0.0810 & 0.1250 & 0.0439 & 0.0909 & 0.0351 \\
        Variance & 0.0021 & 0.0049 & 0.0086 & 0.0066 & 0.0156 & 0.0019 & 0.0083 & 0.0012\\
         Skewness & 0.1963 & -0.9932 & -1.6310 & -4.7227 & -1.1165 & 0.1730 & 1.2201 & 2.8841\\
        Kurtosis & 2.9890 & 8.4808 & 14.6628 & 50.1189 & 8.5597 & 2.0001 & 3.7574 & 13.6014 \\
        Sharpe Ratio &{–} & 0.5404 & 0.4762 & 0.6192 & 0.4191 & {–} & {–} & {–}\\
\end{longtable}
\end{ThreePartTable}

\end{document}

enter image description here

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.