LaTeX forum ⇒ Graphics, Figures & TablesSuppress page break before table

Information and discussion about graphics, figures & tables in LaTeX documents.
dadrivr
Posts: 8
Joined: Sat Sep 11, 2010 3:49 pm

Suppress page break before table

Postby dadrivr » Mon Sep 23, 2013 5:13 am

I have a large, horizontal table that spans multiple pages. LaTeX puts a page break before the table, but I don't want a page break. I want the text to fill the page before the table. I've tried \nopagebreak, but it doesn't work. How can I not allow a page break before the table and fill the page preceding the table with text? Here is a small example:

  1. \documentclass{article}
  2.  
  3. \usepackage{longtable}
  4. \usepackage{threeparttablex}
  5. \usepackage{lscape}
  6. \usepackage{tabu}
  7.  
  8. \begin{document}
  9.  
  10. I do not want a page break here
  11. \nopagebreak
  12.  
  13. \begin{landscape}
  14. \begin{ThreePartTable}
  15. \begin{longtabu}{X[l] X[l] X[l]} \hline
  16. Column1 & Column2 & Column3
  17. \end{longtabu}
  18. \end{ThreePartTable}
  19. \end{landscape}
  20.  
  21. I want this text to go before the table
  22.  
  23. \end{document}

Tags:

User avatar
tom
Posts: 73
Joined: Thu Apr 18, 2013 4:02 am

Postby tom » Thu Sep 26, 2013 12:25 pm

Hi!

The {landscape} environment will always add a page break. You can have sideways content in a portrait page using the rotating package. In that case, however, the table is not automatically broken at the margins. See example below.

  1. \documentclass{article}
  2. \usepackage{blindtext, rotating}
  3. \usepackage{longtable}
  4. \usepackage{tabu}
  5. \begin{document}
  6. I do not want a page break here
  7.  
  8. \begin{sideways}
  9. \begin{minipage}{\linewidth}
  10. \begin{longtabu}{X[l] X[l] X[l]} \hline
  11. \blindtext&\blindtext&\blindtext\\
  12. \end{longtabu}
  13. \end{minipage}
  14. \end{sideways}
  15.  
  16. I want this text to go before the table
  17. \end{document}


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 3 guests