强制文本继续显示在图片后面

强制文本继续显示在图片后面

我的文档中图形后的间距有问题。这是我使用的代码:

\documentclass[twoside,open=right,12pt,a4paper,abstracton,BCOR=15mm,bibliography=totoc,toc=indentunnumbered]{scrreprt}

\usepackage{lettrine}
\usepackage{lmodern}
\usepackage{tocloft}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[normalem]{ulem}

\makeatletter
\setlength{\@fptop}{0pt}
\setlength{\@fpbot}{0pt}
\makeatother

\begin{document}
some text
\par\rule{1pt}{.95\textheight}\par% needed to reproduce reported behavior
\noindent
some text that goes right till the end of the page
\begin{figure}
    \centering
    \captionsetup{labelfont=bf}
    \includegraphics[]{example-image}
    \caption{The figure appears on the top of the second page, which ist perfect.}\label{fig:FCC}
\end{figure}
\par\bigskip 
\noindent
Some other text that appears on the third page although there is enough space below the figure/caption.

\end{document}

我在示例代码中描述了这个问题。我只有有限的几页用于此报告。我已经用尺子检查过,图的标题下方有足够的空间来放置至少一点空间和 6-7 行文本。但不知何故,LaTeX 的想法不同,那么我该如何说服它呢?

/edit1:抱歉,标题下方的 \vspace 实际上不存在(我从文档的另一部分复制了它)。而且负 \vspace 不起作用。文本要么留在第三页,要么会写在图形上,这当然是不可接受的。它不会从标题下方开始。

/edit2:如果我使用 \begin{figure}[ht],整个图形就会移到文档末尾,这也是不可接受的。另一个问题是“重现问题所需的更改”破坏了我文档的布局,而且我并不需要这些更改。我可以用我原来的代码完全重现错误。我尝试展示文档这一部分的图片来说明问题。我也会上传我代码的完整工作示例,但由于文本太多,它太长了。 我已将 3 页示例的文件上传到这里。包括我得到的输出文件。

答案1

我想展示一个极端的例子。

\documentclass[twoside,open=right,12pt,a4paper,abstraction,BCOR=15mm,bibliography=totoc,toc=indentunnumbered]{scrreprt}

\usepackage{lettrine}
\usepackage{lmodern}
\usepackage{tocloft}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[normalem]{ulem}

\def\topfraction{.95}
\def\textfraction{.05}

\begin{document}
some text
\par\rule{1pt}{.95\textheight}\par
\noindent
some text that goes right till the end of the page
\begin{figure}[tb]
    \centering
    \captionsetup{labelfont=bf}
    \includegraphics[width=\textwidth,height=.85\textheight]{example-image}
    \caption{The figure appears on the top of the second page, which ist perfect.}\label{fig:FCC}
\end{figure}
\par\bigskip 
\noindent
Some other text that appears on the third page although there is enough space below the figure/caption.

\end{document}

完整页面

相关内容