2014-04-18 31 views
0

我對LaTeX中的浮點數有疑問,例如表中的數字。在我的文檔中,我有一段連續的圖像和表格,它們在幾個頁面上運行。我想讓本節免費閱讀以下章節的內容。但是,由於圖像和表格不會填滿整個頁面,因此文本的某些行會放在頁面的底部,這非常刺激,因爲文本與圖像和表格無關。如何防止文字在圖形和表格之間爬行

浮子對象定義是這樣的:

\begin{figure}[!htb] 
    \centering 
    \includegraphics[width=0.80\textwidth]{./img/img1.jpg} 
    \caption{cap1} 
\end{figure} 

\begin{figure}[!htb] 
    \centering 
    \includegraphics[width=0.80\textwidth]{./img/img2.jpg} 
    \caption{cap2} 
\end{figure} 

....

我相信我必須調整在每個浮動部分的第一行中的參數,但我[HTB!]我不知道在哪個方面。 任何想法的人?

回答

1

在這種情況下強制浮動頁面似乎是適當的。此外,也許要將相同浮點數內的多個圖像組合起來,但與不同的\caption s。是的,您可以在單個figure浮點數內有多個\includegraphics\caption

enter image description here

\documentclass{article} 
\usepackage{graphicx,lipsum} 
\begin{document} 

\section{A section}\lipsum[1] 

\clearpage 

\begin{figure}[p] 
    \centering 
    \includegraphics[width=.8\linewidth, height=.3\textheight]{example-image-a} 
    \caption{A caption} 

    \vspace{\floatsep} 

    \includegraphics[width=.8\linewidth, height=.3\textheight]{example-image-b} 
    \caption{Another caption} 
\end{figure} 

\begin{figure}[p] 
    \centering 
    \includegraphics[width=.8\linewidth, height=.3\textheight]{example-image-a} 
    \caption{A caption} 

    \vspace{\floatsep} 

    \includegraphics[width=.8\linewidth, height=.3\textheight]{example-image-b} 
    \caption{Another caption} 
\end{figure} 

\clearpage 

\section{Another section}\lipsum[1-3] 
\end{document} 

在上述例子中,文本將浮體下方被寫入如果使用[!htb]浮子說明符。 \clearpage在開始新的部分內容之前,清除所有待處理的浮動,將其設置在其自己的頁面上。

有關的浮紗和可能影響他們參數的更多信息,請參見layoutsdocumentation(部分6浮法佈局,第21頁;具體圖13:浮動參數)。另外,請閱讀How to influence the position of float environments like figure and table in LaTeX?

+0

這工作得很好;非常感謝,維爾納。 – marw

相關問題