2

In some sources a low value of \textfraction=0.07 is recommmended (see https://aty.sdsu.edu/bibliog/latex/floats.html). However, if I apply these values, some of my floats (both images and tables) overlap with the text, even though there would be enough space. Why is that?

Minimal working example see below:

% Document class
\documentclass[ a5paper, % type of paper
                fontsize=9pt, 
                parskip=half, % distance between paragraphs shall be half a line
                usegeometry, % facilitates use of geometry package into scrbook class
                ]{scrbook}
\usepackage[english, ngerman]{babel}

\usepackage{geometry}
\newgeometry{left=5cm, right=1.6cm, top=1.1cm, bottom=1.1cm, % margins from page to body
    includeheadfoot, % header and footer are considered as part of the body, hence are placed within margins
    headsep=0.6cm, % vertical distance from top of textbody to bottom of header
    footskip=0.9cm, % vertical distance from bottom of textbody to top(?) of footer
    footnotesep=0.9cm, % vertical distance from bottom of textbody to top(?) of footnotes
}
\usepackage{showframe}

\renewcommand{\textfraction}{0.07}  % allow minimal text w. figs
\usepackage[draft]{pgf}


\begin{document}

and classified correctly. Then, the linear fit described in step three can be correctly performed (see right hand side of Fig.~\ref{fig:06_FSM_preoptim}).

\begin{figure} [htbp]
    \centering
    \begin{pgfpicture}
        \pgftext{\pgfimage[width=\textwidth,height=12.927cm]{dummy}}
    \end{pgfpicture}
    \caption{Diagram, in which the benefits of the preoptimization before the linear fit are demonstrated}
    \label{fig:06_FSM_preoptim}
\end{figure}

\section{Next section}

In contrast to ...

\end{document}

Result is the following: Screenshot of pdf

4
  • (i) your code contain undefined page styles, (ii) remove emty line before \begin{figure} (iii) welcome to tex.se!
    – Zarko
    Commented Apr 28, 2018 at 1:29
  • @Zarko - During the process of copying and pasting the LaTeX code into the posting, some linebreaks appear to have gotten lost, leading to various error messages. I've taken the liberty of editing the posting to re-introduce the line breaks that had gone AWOL.
    – Mico
    Commented Apr 28, 2018 at 6:20
  • Possible duplicate of parskip=half garbles sometimes pages. See the link in Ulrikes comment below the question there: as a workaround you can use \vspace{\parskip}\pagebreak before \section{Next section}.
    – esdd
    Commented Apr 28, 2018 at 19:55
  • See latex-project.org/cgi-bin/ltxbugs2html?pr=latex/4112
    – esdd
    Commented Apr 29, 2018 at 8:20

2 Answers 2

4

I don't think the text-image overlap issue you're encountering is related -- at least not immediately -- to the directive

\renewcommand{\textfraction}{0.07}

Instead, it looks like there's a hidden conflict between what the \geometry directive does and what some of the other set-up processes associated with the scrbook class are meant to accomplish. For sure, removing the option

includeheadfoot

from the \geometry directive gets rid of the overlap issue.

I'm afraid that not knowing exactly what the page layout is supposed to be, I can't make other suggestions.

3
  • Thank you for pointing me into the right direction. However, I tested several things by now (among others the usegeometry option) and the figure still overlaps the text (see updated minimal working example above). Interestingly, if I remove parskip=half the output is as desired, that is the figure is positioned slightly to the bottom. Do you have any more ideas?
    – gebbissimo
    Commented Apr 28, 2018 at 15:01
  • @gebbissimo - I see you reinstated the option includeheadfoot. As I'm not privy to your document layout needs, I can't tell if it's essential for you to do so. Have you tried not including this option?
    – Mico
    Commented Apr 28, 2018 at 19:15
  • 1
    Thanks again for your response. The geometry is defined by the publisher by the foot including the statement includeheadfoot, so I can't just not include this option. However, I found the underlying issue to the problem, which I will post right now.
    – gebbissimo
    Commented Apr 29, 2018 at 8:37
1

So the issue seems to be a combination of parskip, flushbottom and a significantly underfull vbox. In this case Tex may position elements such that they overlap. This error is known since 2010, but there does not seem to be a general solution instead to manually add a \vspace{\parskip} between the float and the next section heading.

Sources:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .