Graphics, Figures & Tablesbabel package prevents figure positioning?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Simon Kollecker
Posts: 3
Joined: Fri Oct 23, 2020 2:31 pm

babel package prevents figure positioning?

Post by Simon Kollecker »

Hello everyone!
It seems to me that the algorithm for floating environments (like figures or tables) sometimes entirely fails to place the environment anywhere. Here a minimal working example:

Code: Select all

\documentclass[11pt, a4paper, UKenglish]{scrreprt}
\usepackage[UKenglish]{babel}
\usepackage{tikz}
\usepackage{lipsum}
\begin{document}
	\lipsum[1-4]
	\begin{figure}
		\begin{tikzpicture}
		\draw (-1,2) -- (2,-4);
		\draw (-1,-1) -- (2,2);
		\end{tikzpicture}
	\end{figure}
\end{document}
What I would expect from this code:
The algorithm first tries to place the figure on the current page. This does not work, because it is too full already. Thus, it puts it into the queue. Then, the document ends. The article https://www.latex-project.org/publicati ... cement.pdf says:
If the end of the document has been reached or if a \clearpage is encountered, LATEX starts a new page, relaxes all restrictive float conditions, and outputs all floats in the holding queue by placing them on float page(s).
Thus, I would expect a float page with the figure, even though the float page would probably be too empty to be accepted under normal circumstances.

What actually happens:
The figure is not placed at all. Instead, there are two empty pages, one with '' and one with '''' symbols. But what surprised me even more is that not including babel solves the issue!

Is this behavior intended?

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

Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

babel package prevents figure positioning?

Post by Ijon Tichy »

Simon Kollecker wrote:What actually happens:
The figure is not placed at all. Instead, there are two empty pages, one with '' and one with '''' symbols. But what surprised me even more is that not including babel solves the issue!

Is this behavior intended?
I cannot reproduce this with my up-to-date TeX Live 2020 installation. What I get is:

Image

and this is expected and correct.

BTW: 11pt and a4paper are defaults of scrreprt, so you can omit them.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

babel package prevents figure positioning?

Post by Stefan Kottwitz »

Hi Simon,

welcome to the forum!

Can you perhaps show us the .log file? You can post it as attachment here. The Attachments link is below the text edit field, when writing a post.

Stefan
LaTeX.org admin
Simon Kollecker
Posts: 3
Joined: Fri Oct 23, 2020 2:31 pm

babel package prevents figure positioning?

Post by Simon Kollecker »

Hi Ijon, hi Stefan,

thank you very much for your help! I had installed texlive via
sudo apt-get install texlive-full
and it turned out to be version 2019.
Now, I installed TL2020 and I could compile the file using the terminal. This works and produces the expected output. So the problem is solved using TL2020.

Should it work with TL2019 as well?

I attached the log file and the PDF from the TL2019 compilation.

Simon
Attachments
myThesis.pdf
(21.19 KiB) Downloaded 150 times
myThesis.log
(22.04 KiB) Downloaded 124 times
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

babel package prevents figure positioning?

Post by Ijon Tichy »

Simon Kollecker wrote:Should it work with TL2019 as well?
With TL2019 I get the same result I've shown above.

Other differences with my TL2019 installation are: babel version 3.41 (yours is 3.40), expl3 version 2020-02-25 (yours is 2020-02-14), xparse 2020-02-14 (yours is 2020-02-14). All other packages are the same version.

Strange are the warnings: "Missing character: There is no ü in font cmr10!" There are not any ü in your code. So these shouldn't be there.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Simon Kollecker
Posts: 3
Joined: Fri Oct 23, 2020 2:31 pm

babel package prevents figure positioning?

Post by Simon Kollecker »

Perfect! Then it is because of the old packages. Unfortunately I cannot update packages. But everytime the error occurs, I can use TL2020 via the terminal. This is enough for my purposes. Thank you very much for trying out!
Post Reply