0

Consider this script:

\documentclass{report}
\usepackage{lipsum}
\usepackage{longtable}
\begin{document}
\lipsum[1-3]
\lipsum[4][1-12]

%another paragraph                                                                                                                                                                                          
\begin{longtable}{lr}
  \caption{\lipsum[1][1-3]}\\*
  \label{tab:results}\\*
  \hline
  A&B\\
  c&D\\
  E&F\\
  A&B\\
\endfirsthead
\caption[]{Continued.}
\endhead
  c&D\\
  E&F\\
  A&B\\
  c&D\\
  E&F\\
  A&B\\
  c&D\\
  A&B\\
  c&D\\
  E&F\\
  A&B\\
  c&D\\
  A&B\\
  c&D\\
  E&F\\
  A&B\\
  c&D\\
\end{longtable}
\end{document}

The conjoint implementation of \endfirsthead and \endhead works fine at breaking the table across pages (Putting longtable caption text on subsequent pages):

enter image description here

However when I uncomment %another paragraph% an out of place "Continued" appears:

enter image description here

What is wrong and how to fix the problem?

  • 1
    i cant reproduce your problem. document example works as expected. however your header is unusual. it really need four rows? – Zarko Apr 14 at 13:50
  • 1
    @Zarko I can:-).... – David Carlisle Apr 14 at 14:09
  • 1
    Sorry bad interaction of an automatic page break just at the point longtable is switching the output routine, you could report it at the github issue tracker but an immediate workaround is to use \clearpage just before \begin{longtable} – David Carlisle Apr 14 at 14:11
  • 1
    You can use the patch from tex.stackexchange.com/a/384462/2388 (@DavidCarlisle) – Ulrike Fischer Apr 14 at 14:51

Your Answer

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

Browse other questions tagged or ask your own question.