我必须交一份文件,其中第一页的浮动元素只允许放在页面底部(不是t
和不是h
)。
我知道我可以用 禁止页面上的所有浮动\suppressfloats
,也可以用 禁止页面顶部的浮动\suppressfloats[t]
。但是\suppressfloats[h]
不起作用。
我努力了
\usepackage{float}
\usepackage{afterpage}
\floatplacement{figure}{b}
\begin{document}
\afterpage{\floatplacement{figure}{htbp}}
但它不起作用。
我怎样才能抑制和处的浮动,t
同时h
允许它们出现b
在第一页上,并允许它们出现在htbp
文档的其余部分上?
例子:
\documentclass{article}
\usepackage{blindtext}
\usepackage{float}
\floatplacement{figure}{b} % I would like to have `htbp` here
\usepackage{afterpage}
\begin{document}
\suppressfloats[t] % works
\suppressfloats[h] % seems to have no effect
\afterpage{\floatplacement{figure}{htbp}} % seems to have no effect
\blindtext
\begin{figure}
\centering
\rule{.3\linewidth}{2cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{.7\linewidth}{5cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{10cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{.6\linewidth}{8cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{7cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{2cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{4cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{6cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{5cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{11cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{6cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{6cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{9cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{4cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{5cm}
\caption{something black}
\end{figure}
\listoffigures
\end{document}
编辑
大卫·卡莱尔的回答避免在第一页上出现浮动。但只要我基本上允许浮动在内h
,它就不会将浮动放在底部。(但当我将其更改为时,它会被放置在第一页的底部,这是应该的。)可能是因为 LaTeX 首先决定将其放置在外部,然后意识到它实际上不能将其放置在外部,因为太大,然后将其移动到下一页,而不检查是否可以将其放置在底部?b
h
\floatplacement
\floatplacement{figure}{b}
h
h
\intextsep
b
有人可以推荐一份好的文档来解释浮点数的放置究竟是如何进行的吗?
答案1
您可以做这样的事情,以便以后允许 h(例如第 10 页的图 14)
\documentclass{article}
\usepackage{blindtext}
\usepackage{float}
\floatplacement{figure}{htbp} % I would like to have `htbp` here
\usepackage{afterpage}
\newlength\zzz
\setlength\zzz{\intextsep}
\begin{document}
\suppressfloats[t] % works
\intextsep\textheight
\afterpage{\global\intextsep\zzz} % seems to have no effect
\blindtext
\begin{figure}
\centering
\rule{.3\linewidth}{2cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{.7\linewidth}{5cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{10cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{.6\linewidth}{8cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{7cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{2cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{4cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{6cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{5cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{11cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{6cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{6cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{9cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{4cm}
\caption{something black}
\end{figure}
\blindtext
\begin{figure}
\centering
\rule{\linewidth}{5cm}
\caption{something black}
\end{figure}
\listoffigures
\end{document}