当图形出现在页面顶部时,它会自动占用~-3 或 -4 个点,我的代码和屏幕截图如下:
代码如下:
\documentclass{book}
\usepackage{showframe,graphicx,stfloats}
\begin{document}
\markboth{Test}{Trial}
First and foremost, \ref{chapter one} I want to thank my amazing colleagues at the
University of Cincinnati for their help with this book, especially
Zvi Biener, Vanessa Carbonell, Anthony Chemero, Valerie
Hardcastle, John McEvoy, Thomas Polger, Robert Richardson, Robert
Skipper, and George Uetz in biology. Guilherme Sanches de Oliveira
provided research assistance and help with indexing. I also
received tremendously helpful feedback from the graduate students
and faculty who participated in my seminar on idealization in the
autumn of 2014, including some of those named above, as well as
Frank Faries, Maurice Lamb, Vicente Raja Galian, Walter
Stepanenko, and Richard Stephenson \ref{section one}.
\newpage
\begin{figure}[t!]
\centering\includegraphics[width=.7\textwidth]{example-image}
%{\centering\includegraphics{V:/530_ucp/67957.tex_black_LIVE/67957_Active/67957_core/67957_art/chi-potochnik-fig01001.eps}}
\caption{Test}
\end{figure}
\end{document}
我需要保留所有页面的空白,即使任何浮动都位于页面顶部,我该如何解决这个问题?请提出建议...
答案1
这个数字和“问题”无关。
页面上的第一行基线\topskip
与文字块的上边框相距一定距离。10pt 大小的文字\topskip
设置为 10pt,这比大写字母的高度还高。
在图中,第一条基线被向下推以容纳大对象,因此最终会触及顶部边距。
你可以做
\AtBeginDocument{\setlength{\topskip}{\fontcharht\font`T}}
在序言中,但我不会。这当然需要改变文本高度,以便它仍然包含整数行数;所以它可以是
\AtBeginDocument{%
\addtolength{\textwidth}{\dimexpr\fontcharht\font`T-\topskip}%
\setlength{\topskip}{\fontcharht\font`T}%
}