0

I am trying to compile a longtable with table notes, but I am getting an error with the codes below:

\begin{landscape}
\thispagestyle{empty}
\begin{threeparttable}
   \begin{longtable}{|c|c|c|c|c|c|c|}
 \toprule
 \midrule

some table

    \bottomrule
\begin{tablenotes}[para,flushleft]
     TS: The time span of relevant measurement.
     No: The number of measurements, those are given for the ease to refer the measurement, therefore they are not the arrangement of the measurements.
 \end{tablenotes}
     \end{threeparttable}  
   \end{longtable}  
\end{landscape}

and the error is:

! You can't use `\prevdepth' in restricted horizontal mode.
\TPTdoTablenotes ->\par \prevdepth 
                                   \z@ \TPT@hsize \TPTnoteSettings \parinden...
l.231 \begin{tablenotes}[para,flushleft]

finally my preamble:

\usepackage{epstopdf}
\usepackage{cite}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{siunitx}
\usepackage{booktabs,caption,fixltx2e}
\usepackage{threeparttable}
\usepackage[fleqn]{mathtools}
\usepackage{float}
\usepackage{bigints}
\usepackage{cleveref}
\usepackage{lscape}
\usepackage{longtable}

A MWE:

\documentclass[12pt]{article}
\usepackage{epstopdf}
\usepackage{cite}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{siunitx}
\usepackage{booktabs,caption,fixltx2e}
\usepackage{threeparttable}
\usepackage[fleqn]{mathtools}
\usepackage{float}
\usepackage{bigints}
\usepackage{cleveref}
\usepackage{lscape}
\usepackage{longtable}

\begin{document}


\begin{landscape}
\thispagestyle{empty}
\begin{threeparttable}
   \begin{longtable}{|c|c|c|c|c|c|c|}
   \caption{Adsorption and desorption measurement characteristics of MFU4.Br-1 and MFU4.Br-2.} \label{tab:meacon} \\
   some table
\begin{tablenotes}[para,flushleft]
     TS: The time span of relevant measurement.
     No: The number of measurements, those are given for the ease to refer the measurement, therefore they are not related with the arrangement of the measurements.
 \end{tablenotes}
\end{threeparttable}
   \end{longtable}%
\end{landscape}
\end{document}
ShreevatsaR
  • 45,428
  • 10
  • 117
  • 149

1 Answers1

1

The corrected code should be as given below:

\begin{landscape}
\thispagestyle{empty}
\resizebox{\linewidth}{!}{\begin{threeparttable}
   \begin{longtable}{|c|c|c|c|c|c|c|}
   \caption{Adsorption and desorption measurement characteristics of MFU4.Br-1 and MFU4.Br-2.} \label{tab:meacon}\\
a & b&c&d&e&f&g\\
a & b&c&d&e&f&g\\
   \end{longtable}% The error corrected  here!!!
\begin{tablenotes}[para,flushleft]
     TS: The time span of relevant measurement.
     No: The number of measurements, those are given for the ease to refer the measurement, therefore they are not related with the arrangement of the measurements.
 \end{tablenotes}
\end{threeparttable}}
\end{landscape}

The longtable was not closed before starting tablenotes. This caused the error.

Note: Edited the code with \resizebox command.

ShreevatsaR
  • 45,428
  • 10
  • 117
  • 149
Jagath
  • 4,287
  • now I have different problem that the table takes two pages, and when I use footnote code is trying to fix it in one page that does not fit. – Yirmidokuz Aug 01 '13 at 12:49
  • You can use \resizebox to re-size the table. See this post: http://tex.stackexchange.com/questions/94078/resize-table-and-caption. Please put the \resizebox{}{!}{\begin{threeparttable}{...} ... \end{threeparttable}. – Jagath Aug 01 '13 at 14:04
  • Using resizebox gives: `Runaway definition? ->}\expandafter \def \expandafter @tempc \expandafter {\string !}\ifx \ETC. ! File ended while scanning definition of @tempb. } l.170 \input ch2` – Yirmidokuz Aug 01 '13 at 14:17
  • I've added \resizebox in the sample code above. – Jagath Aug 01 '13 at 16:26
  • ok. I added \resizebox, but now I am getting following error `Runaway argument? {\begin {threeparttable} \begin {longtable}{|c|c|c|c|c|c|c|} \caption \ETC. ! File ended while scanning use of \Gscale@box@dd. \par l.170 \input ch2` – Yirmidokuz Aug 01 '13 at 17:55
  • Can you post the erroneous code which contains resizebox to the bottom of your question or add a new question! – Jagath Aug 02 '13 at 02:25