LaTeX forum ⇒ Graphics, Figures & TablesLayout differences for different pdflatex versions Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
QX32
Posts: 2
Joined: Sat Oct 05, 2019 11:27 am

Layout differences for different pdflatex versions

Postby QX32 » Sat Oct 05, 2019 12:00 pm

Dear LaTeX friends,

I use different versions of pdflatex from the TeXLive package on different computers:

Old version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian, Ubuntu 16.04.6 LTS)
New version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian, Ubuntu 18.04.3 LTS)

These two pdflatex versions lead to a clearly different layout for this LaTeX code:

  1. \documentclass[]{scrbook}
  2. \usepackage{lipsum}
  3. \author{Author}
  4. \title{Title}
  5. \date{}
  6.  
  7. \begin{document}
  8. \maketitle
  9.  
  10. % table 1
  11. \begin{tabular}{l}
  12. x\\
  13. x\\
  14. x\\
  15. x\\
  16. x\\
  17. x\\
  18. x\\
  19. x\\
  20. x\\
  21. x\\
  22. x\\
  23. x\\
  24. x\\
  25. x\\
  26. x\\
  27. x\\
  28. x\\
  29. x\\
  30. \end{tabular}
  31.  
  32. % text
  33. \lipsum[1]
  34.  
  35. % table 2
  36. \begin{tabular}{l}
  37. y\\
  38. y\\
  39. y\\
  40. y\\
  41. y\\
  42. y\\
  43. y\\
  44. y\\
  45. y\\
  46. y\\
  47. y\\
  48. y\\
  49. y\\
  50. y\\
  51. y\\
  52. y\\
  53. y\\
  54. y\\
  55. y\\
  56. y\\
  57. \end{tabular}
  58.  
  59. \end{document}


The LaTex document is structured like this:
  1. Title page on page 1
  2. Table 1 at top of page 2
  3. Text on page 2 below Table 1
  4. Table 2 on top of page 3

In the old version of pdflatex, the text directly follows table 1 (see old.png). However, the new version inserts a large space between table 1 and text (see new1.png). If table 2 is deleted from the LaTeX code, the new version does not generate a large space between table 1 and text (see new2.png).

How can I get the layout of the old version with the new version of pdflatex, i.e. (i) no large space between table 1 and text and (ii) table 2 must not influence the layout on the previous page?

Embedding the tables in a table environment or replacing scrbook is unfortunately not an option for me, as the code shown only isolates the problem that occurs in a much more complex document. Ideally, a global parameter should be set or commands should be called before or after the tables.
Attachments
old.png
Pages 2 and 3 of the PDF generated with pdflatex Version 3.14159265-2.6-1.40.16.
old.png (58.42 KiB) Viewed 126 times
new1.png
Pages 2 and 3 of the PDF generated with pdflatex version
new1.png (53.61 KiB) Viewed 126 times
new2.png
Page 2 of the PDF generated with pdflatex version 3.14159265-2.6-1.40.18 without table 2 in LaTex code.3.14159265-2.6-1.40.18.
new2.png (45.97 KiB) Viewed 126 times

User avatar
Stefan Kottwitz
Site Admin
Posts: 9445
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sat Oct 05, 2019 1:19 pm

Welcome to the forum!

The pdfLaTex engine should work the same. But there are perhaps different class (or package) default setttings.

Try this setting in the preamble:

\raggedbottom

Stefan
Site admin

User avatar
Ijon Tichy
Posts: 120
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Sat Oct 05, 2019 1:19 pm

I seems that the old version of TeX Live has a KOMA-Script version with the bug, that it does not activate \flushbottom for double-sided documents. So to get back that errorneous behavior just use an explicit \raggedbottom. But I would also recommend to read in the manual, why \flushbottom generally is correct for double sided documents and how to use floating objects like table environments to avoid large empty spaces.

QX32
Posts: 2
Joined: Sat Oct 05, 2019 11:27 am

Postby QX32 » Sat Oct 05, 2019 2:30 pm

Thank you. Adding \raggedbottom to the preamble solves my problem.

  1. \documentclass[]{scrbook}
  2. \raggedbottom
  3. \usepackage{lipsum}
  4. \author{Author}
  5. \title{Title}
  6. \date{}


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 16 guests