2010-10-23 112 views
10

一個牢不可破的塊我想要做的事就像在TeX的以下內容:請在TeX的

\begin{nobreak} 

Text here will not split over pages, it will remain 
as one continuous chunk. If there isn't enough room 
for it on the current page a pagebreak will happen 
before it and the whole chunk will start on the next 
page. 

\end{nobreak} 

這可能嗎?

+1

您可能想考慮在http://tex.stackexchange.com上詢問。 – 2010-10-23 10:17:53

+1

交叉鏈接爲方便起見:http://tex.stackexchange.com/questions/4471/unbreakable-block – 2010-10-24 19:36:53

回答

19

你可以嘗試

\begin{samepage} 
This is the first paragraph. This is the first paragraph. 
This is the first paragraph. This is the first paragraph. 
\nopagebreak 
This the second. This the second. This the second. 
This the second. This the second. This the second. 
This the second. This the second. 
\end{samepage} 

samepage防止乳膠從samepage envirnment中的一個段落中pagebreaking,即pagebreaks只是段落之間。因此,您還需要nopagebreak,以防止LaTeX在兩段之間分頁。

6

一個快速測試顯示minipage也有這種行爲。

\begin{minipage}{3in} 
One contiguous chunk. 
\end{minipage} 

\begin{minipage}{3in} 
Another contiguous chunk. 
\end{minipage}