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).
11
  • 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
    Commented Oct 7, 2021 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
    Commented Oct 7, 2021 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
    Commented Oct 7, 2021 at 13:50
  • 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. github.com/latex3/latex2e/issues/158. So don't use it until you need it. Commented Oct 7, 2021 at 14:58
  • 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
    Commented Oct 7, 2021 at 16:10

0

You must log in to answer this question.

Browse other questions tagged .