Graphics, Figures & TablesLayout differences for different pdflatex versions

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

Layout differences for different pdflatex versions

Post by QX32 »

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:
\documentclass[]{scrbook}
\usepackage{lipsum}
\author{Author}
\title{Title}
\date{}

\begin{document}
\maketitle

% table 1
\begin{tabular}{l}
x\\
x\\
x\\
x\\
x\\
x\\
x\\
x\\
x\\
x\\
x\\
x\\
x\\
x\\
x\\
x\\
x\\
x\\
\end{tabular}

% text
\lipsum[1]

% table 2
\begin{tabular}{l}
y\\
y\\
y\\
y\\
y\\
y\\
y\\
y\\
y\\
y\\
y\\
y\\
y\\
y\\
y\\
y\\
y\\
y\\
y\\
y\\
\end{tabular}

\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
Pages 2 and 3 of the PDF generated with pdflatex Version 3.14159265-2.6-1.40.16.
Pages 2 and 3 of the PDF generated with pdflatex Version 3.14159265-2.6-1.40.16.
old.png (58.42 KiB) Viewed 5446 times
Pages 2 and 3 of the PDF generated with pdflatex version
Pages 2 and 3 of the PDF generated with pdflatex version
new1.png (53.61 KiB) Viewed 5446 times
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.
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 5446 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Layout differences for different pdflatex versions

Post by Stefan Kottwitz »

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
LaTeX.org admin
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Layout differences for different pdflatex versions

Post by Ijon Tichy »

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.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
QX32
Posts: 2
Joined: Sat Oct 05, 2019 11:27 am

Layout differences for different pdflatex versions

Post by QX32 »

Thank you. Adding \raggedbottom to the preamble solves my problem.
\documentclass[]{scrbook}
\raggedbottom
\usepackage{lipsum}
\author{Author}
\title{Title}
\date{}
Post Reply