Package longtabu problem at page break
I do not understand what is your problem. After removing all package in your MWE, which are not relevant to tabu long table, I obtain expected result:
My MWE:
\documentclass[a4paper,12pt,oneside]{book}
\usepackage[left=3cm,right=3cm,top=3cm,bottom=3cm]{geometry}
\usepackage{longtable,tabu}
\usepackage{lipsum}
\begin{document}
\pagestyle{plain}
\begin{longtabu} to \textwidth {l X[1,l]}
\caption{CG box properties}
\label{table:cg_box_prop_types} \\
% -----------------headings----------------------%
\hline
\textbf{Property} & \textbf{Variable type} \\
\hline
\endfirsthead
%headings for next page columns
\hline
\textbf{Property} & \textbf{Variable type} \\
\hline
\endhead
%this is printed before the table is broken into the next page
\multicolumn{2}{|r|}{{Continued on next page}} \\ \hline
\endfoot
\hline
\endlastfoot
% ---------------headings end--------------------%
L, T, R, B, W, H, bg, ANG, AX, AY
& \lipsum[2-3] \\
\hline
img, txt
& \lipsum[4]
\end{longtabu}
\end{document}
Package lispum
is used for generating dummy text in the second column.
Related videos on Youtube
Makmeksum
Updated on November 15, 2020Comments
-
Makmeksum almost 3 years
I am using
longtabu
for a table in a LaTeX document. It gives a wired result at page break. Notice that the 'continue' part of the table is stuck in the page before the break.Page 14 shown in the picture does not have content of the table except the continued from next page. Here is the code I used to create the table. Any suggestion to fix this?
\documentclass[a4paper,12pt, oneside]{book} %enable linespacing commands% \usepackage{setspace} %used to import graphics% \usepackage{graphicx} %used for referencing% \usepackage{harvard} %customise chapter styles% \usepackage{titlesec} \titleformat{\chapter}{}{}{0em}{\bf\LARGE} %set bibliography listing style to agsm% \bibliographystyle{agsm} %set margins% \usepackage[left=3cm,right=3cm,top=3cm,bottom=3cm]{geometry} %keep only the page number% \pagestyle{plain} %allows to create tables with different column widths% \usepackage{tabularx} %allows to create tables that can span accross pages% \usepackage{longtable}%dependency of longtabu \usepackage{tabu}%contains longtabu \begin{document} % begining of the table \begin{longtabu} to \textwidth { l X[1 , l ] } \label{table:cg_box_prop_types}\\ \caption{CG box properties}\\ % -----------------headings----------------------% \hline \textbf{Property} & \textbf{Variable type} \\ \hline \endfirsthead %headings for next page columns \hline \textbf{Property} & \textbf{Variable type} \\ \hline \endhead %this is printed before the table is broken into the next page \multicolumn{2}{|r|}{{Continued on next page}} \\ \hline \endfoot \hline \endlastfoot % ---------------headings end--------------------% L, T, R, B, W, H, bg, ANG, AX, AY & CGuiNumber \\ \hline img, txt & CGuiString \\ \end{longtabu} % end of the table \end{document}
Edit: I didn't post it with the content above the table. (I cannot post them here). I tried to recreate the issue by filling above the table with dump text. but with those text I couldn't recreate the issue.
-
Makmeksum over 8 yearsfixed the example :)
-
David Carlisle over 8 yearsYou say it's fixed, but I just ran it and I get a single page table without this problem, do you get the problem on the example posted? if so perhaps you have an old version of a package?
-
Makmeksum over 8 yearsAgain sorry, I didn't post it with the content above the table. (I cannot post them here). I tried to recreate the issue by filling above the table with dump text. but with those text i couldn't recreate the issue. :(
-
David Carlisle over 8 yearsUnless you can post an example, there is probably nothing that can be done. Start with a copy of your document and delete everything you can while still showing the problem doesn't matter about the text, you can replace every letter by
x
for the example, so you don't have to reveal any data. the problem is most likely not in the table but floating figures or other difficult to place material on the page before
-
-
cfr almost 8 yearsDid you not read the comments on the question :(?
-
Zarko almost 8 years@cfr, yes, I do. Is it something wrong with my answer? If you you estimate so, please erase it. I just try to show to OP that with the table is nothing wrong and to give an example, how to make a MWE at next his/her next question.
-
cfr almost 8 yearsYour answer isn't bad in that it addresses the question. I guess it can't solve the problem the OP has, though, given that the OP can't reproduce the issue without data the OP cannot share here. There's nothing wrong with answering. But probably the question should be closed as unclear.
-
Zarko almost 8 yearsI agree with you. Probably I should in my answer more expose this, what you saying now, however I still learning myself how to write better answers. And till to now no response of OP to it. I vote for close the question as unclear.
-
cfr almost 8 yearsI really think it is the best answer anybody can give to the question. It just isn't clear that the question is clear enough to be effectively answered....