LaTeX prefers numbers on text pages

LaTeX seems to prefer placing images together on the page and placing the surrounding text on a separate page. Can I somehow change this balance, because I prefer the shapes to break the text in order to avoid too black pages with heavy text.

Example:

\section{Some section}

[Half a page of text]

\begin{figure}
    [...]
    \caption{Figure text 1}
\end{figure}

[Half a page of text]

\begin{figure}
    [...]
    \caption{Figure text 2}
\end{figure}

[More text]

So what LaTeX usually does is collect two half pages of text on one page and numbers on the next page. I think this really gives a bad balance and annoys the reader. Can I somehow change this?

I know about postfixing \begin{figure}with help [ht!], but often it doesn't really matter. I would like to set up balancing algorithms in LaTeX, to naturally prefer pages with combined numbers and text.

+3
3

.

\setcounter{topnumber}{2}
\setcounter{bottomnumber}{2}
\setcounter{totalnumber}{4}
\renewcommand{\topfraction}{0.85}
\renewcommand{\bottomfraction}{0.85}
\renewcommand{\textfraction}{0.15}
\renewcommand{\floatpagefraction}{0.7}

, . .

+8

float :

  • \begin{figure}[tb] , (, )
  • \begin{figure}[p] , , .

, "" placeins afterpage.

+1

Try

\makeatletter
\@colnum 1 % Or 2. It is the max of the float insertions at the top of the page.
\makeatother
0
source

Source: https://habr.com/ru/post/1744905/


All Articles