1

I tried to reduce my MWE to some minimum but this is nevertheless quite large :-/

\documentclass[a4paper,11pt,naustrian]{article}
\usepackage[margin=2.5cm, showframe]{geometry}
\usepackage[tracking=true,factor=1100,stretch=10,shrink=10,final]{microtype}
\usepackage[table]{xcolor} % for highlighting AND background images-color!!!
\usepackage{setspace} 
\onehalfspacing 
\usepackage{xltabular} 
\usepackage{booktabs} 
\usepackage{caption} % config is done for table and image separately
\usepackage{needspace}
\usepackage{placeins} %insert some barriers for floats (e.g. figure)
\usepackage{kantlipsum}
\begin{document}
\begin{xltabular}{\textwidth}{| X X X X X X X X X X X}
\midrule[131564sp]
&2020& 2021& 2020& 2021& 2020& 2021& 2020& 2021& {2020}&  {2021}\\
\midrule
&\multicolumn{2}{ c  }{abc 1 }
&\multicolumn{2}{ c  }{abc 2 }
&\multicolumn{2}{ c  }{abc 3 }
&\multicolumn{2}{ c  }{abc 4 }
&\multicolumn{2}{ c  }{{abc 5} }\\
\midrule
\endhead
Provinz&212&62&195&101&212&62&195&101&{212}&{62}\\
\midrule
Provinz&5&5&8&10&5&5&8&10&{5}&{5}\\
\midrule
Provinz&1&2&0&3&1&2&0&3&{1}&{2}\\
\midrule
Provinz&1&1&1&5&1&1&1&5&{1}&{1}\\
\midrule
Provinz&3&1&1&1&3&1&1&1&{3}&{1}\\
\midrule
Provinz&15&1&5&7&15&1&5&7&{15}&{1}\\
\midrule
Insgesamt&
2&3& 1&1&2&3&1&1&2&3\\
\midrule\end{xltabular}
\needspace{3\baselineskip}
\FloatBarrier
\section{test bilder}

\begin{xltabular}{\textwidth}{!{\vrule width 131564sp} X X X X} \midrule[131564sp] & & & \ \midrule & & & \ \midrule & & & \ \midrule \end{xltabular}

\begin{figure}[!htbp] \rule{10cm}{5cm} \caption{Image1} \rule{11cm}{1cm} \end{figure} \FloatBarrier \begin{figure}[!htbp] \caption{Nextcloud} \end{figure} %\newpage \FloatBarrier \begin{figure}[!htbp] \rule{11cm}{4cm} \caption{Nextcloud Daten} \end{figure} \FloatBarrier \begin{figure}[!htbp] \rule{13cm}{4cm} \caption{Zoneneinteilung ABC} \end{figure} \FloatBarrier \section{MyTest} Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in \begin{xltabular}{\textwidth}{!{\vrule width 131564sp} X X X X X X X} \midrule[131564sp] Vorfälle& 01/21& 02/22& 03/22& 04/22& 05/22& 06/22\ \midrule 10& x& & & & & \ \midrule 20& & x& & & & \ \midrule 30& & & x& x& & \ \midrule 40& & & x& & & \ \midrule 50& & & & & x& xx\ \midrule 60& & & & & & \ \midrule \end{xltabular} \kant \end{document}

It seems like I have a strange combination of figure and tables which causes the last table in a strange calculation of the of the whole page. It finally ends with a

Overfull \vbox (256.12231pt too high) has occurred while \output is active []

which will look like

enter image description here

Introducing a command like \newpage fixes the issue. Since I'm more or less generating the TeX code automatically I need a solution which calculates the space at the end properly.

Any hints what I can to do to achieve a better result?

NOTE: If required I can send a complete package of all the files for this request - since they include some graphics which require a specific size :-/

Running lualatex 1.13.2

NOTE: Update:

  1. Replacing the images with a ruler
  2. Using xltabular since I don't know in advance where the page ends and when not. This should be done automatically by TeX (at least I would expect so).
LeO
  • 1,451
  • 1
    Out of curiosity: Why do you use xltabular for this particular table? As it currently is, it is significantly smaller than a page, meaning mid-table page breaks are unnecessary. A simple tabularx should work just fine for this table. – leandriis Oct 07 '21 at 13:34
  • Regarding the images: probably you can replace the currently used images with dummy images of the respective required heights in order to create a compile mwe. – leandriis Oct 07 '21 at 13:37
  • @leandriis: Thx for the hint with image replacements. I guess that's the general question when to use xltabular and when not. If you do it manually I would agree. If you do automatically its hard to guess when or when not to use each of them. – LeO Oct 07 '21 at 13:50
  • \bgroup{}\bfseries{}\egroup{} ?? this does nothing at all. – David Carlisle Oct 07 '21 at 14:03
  • Yeahhh... I could discuss easily each of the commands and why they are setup the way they are. I'll update the MWE by removing them - nevertheless the problem remains the same. – LeO Oct 07 '21 at 14:10
  • 3
    Your example is way to long. But beside this: xltabular uses longtable, and longtable is a complicated beast and sometimes interacts badly with floats, see e.g. https://github.com/latex3/latex2e/issues/158. So don't use it until you need it. – Ulrike Fischer Oct 07 '21 at 14:58
  • I reduced again the MWE. I would like to follow your advice to not use it until I need - but how to detect it - if I need to do it automatically? Are there some kind of 'rules' when not to use it? Since the content could be quite dynamically... – LeO Oct 07 '21 at 15:11
  • 1
    With your MWE I cant reproduce showed result of compilation. In your MWE also have the following strange construction: \begin{figure}[!htbp] \rule{10cm}{5cm} \caption{Image1} \rule{11cm}{1cm} \end{figure} \FloatBarrier \begin{figure}[!htbp] \caption{Nextcloud} \end{figure}. – Zarko Oct 07 '21 at 16:10
  • Well with the current MWE I still have the effect although not that severe as shown in the image. But still out of the frame... Which Tex did you try? With which version? – LeO Oct 07 '21 at 18:49
  • @LeO, I test with recent version of MiKTeX. BTW, where is defined article option naustrian? – Zarko Oct 07 '21 at 20:02
  • I finally found a solution - Hurray! Thx to @Zarko I figured out that longtable V4.16 fixes the issue. I added a fix thx to Ulrike. Unfortunately this fix blocks the efforts done in V4.16. Additionally I found it quite hard to figure out which version of longtable is included in the current texlive package. Perhaps that's another q. Anyway I'll close this ticket in the next days. – LeO Oct 08 '21 at 09:02

0 Answers0