有时,我们在输入图表的时候,常常发现图表显示在单独的页面,往往是因为我们的图表在论文内容的最后出现,空间不够,导致浮动体无法在当前页浮动,因此会浮动到新的页面,往往浮动体是居中的,有用户希望浮动体能够放在页面的顶部,这样看起来文章更为妥帖,尤其是在不同的章节之间。
我们只需设置\@fptop的值即可改变浮动体到页面顶部的距离,如:
\makeatletter% Set distance from top of page to first float
\setlength{\@fptop}{5pt}
\makeatother
演示代码如下:
\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{lipsum}
\makeatletter% Set distance from top of page to first float
\setlength{\@fptop}{5pt}
\makeatother
\begin{document}
\lipsum[1-5]
\begin{table}[ht]
\caption{Caption} 
\center
\begin{tabular}{c c c}
\hline \hline
A & B & C \\
\hline
1 & a & A \\
2 & b & B \\
3 & c & C \\
4 & d & D \\
5 & e & E \\
6 & f & F \\
7 & g & G \\
\hline
\end{tabular}
\end{table} 
\end{document}
 选自:http://tex.stackexchange.com/questions/40257/table-in-latex-appearing-in-middle-of-next-page
 
选自:http://tex.stackexchange.com/questions/40257/table-in-latex-appearing-in-middle-of-next-page                        
                        
                     
                 
                

发表评论 取消回复