Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to use a longtable in landscape. I obtain a compilation error (I use XeLaTex) and I don't know where is the problem. The code is:

\begin{landscape}
\begin{longtable}{ccccccc}
\caption{My table.}
\label{tab:table} \\
\toprule
\multicolumn{1}{c}\textbf{} & \multicolumn{1}{c}\textbf{A} & \multicolumn{1}{c}\textbf{B} & \multicolumn{1}{c}\textbf{C} & \multicolumn{1}{c}\textbf{D} & \multicolumn{1}{c}\textbf{E} & \multicolumn{1}{c}\textbf{F}\\
\midrule
\endfirsthead
\multicolumn{7}{l}{\footnotesize\itshape\tablename~\thetable: continue from previous page} \\ 
\toprule
\multicolumn{1}{c}\textbf{} & \multicolumn{1}{c}\textbf{A} & \multicolumn{1}{c}\textbf{B} & \multicolumn{1}{c}\textbf{C} & \multicolumn{1}{c}\textbf{D} & \multicolumn{1}{c}\textbf{E} & \multicolumn{1}{c}\textbf{F}\\
\midrule
\endhead
\midrule
\multicolumn{7}{r}{\footnotesize\itshape\tablename~\thetable: continue to next page} \\
\endfoot
\bottomrule
\multicolumn{7}{r}{\footnotesize\itshape\tablename~\thetable: end} \\
\endlastfoot
% table body
\textbf{1} & 2 & 3 & 4 & 5 & 6 & 7\\
\midrule
\textbf{1} & 2 & 3 & 4 & 5 & 6 & 7\\
\midrule
\textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\
\midrule
\textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\
\midrule
\textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\
\midrule
\textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\
\midrule
\textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\
\midrule
\textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\
\midrule
\textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\
\midrule
\textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\
\midrule
\textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\
\midrule
\textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\
\midrule
\textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\
\midrule
\textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\
\bottomrule                                 
\end{longtable}
\end{landscape}

The error is:

 Package longtable Error: Column widths have changed in table 2.1 
 See the longtable package documentation for explanation. 
 Type  H <return>  for immediate help. 
 ...                                              

 l.901 \end{longtable}

Any ideas?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

It's not an error. Compile again until the problem goes away: longtable uses previous runs to adjust the column width in order to get them the same size on all pages.

If you load the package longtable with the option pausing, the informative message is indeed changed into an error; omit that option, in case you're using it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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