2010-10-23 33 views
10

tôi muốn làm một cái gì đó như sau trong TeX:Thực hiện một khối không thể phá vỡ trong 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} 

Đây có phải là có thể?

+1

Bạn có thể xem xét yêu cầu qua tại http://tex.stackexchange.com. –

+1

Liên kết chéo để thuận tiện: http://tex.stackexchange.com/questions/4471/unbreakable-block –

Trả lời

19

Bạn có thể thử

\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 ngăn LaTeX từ pagebreaking trong vòng một đoạn, ví dụ: trong samepage envirnment, ngắt trang là duy nhất giữa đoạn văn. Vì vậy, bạn cũng cần nopagebreak để ngăn LaTeX khỏi việc đột phá giữa hai đoạn văn.

6

Kiểm tra nhanh cho thấy rằng minipage cũng có hành vi này.

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

\begin{minipage}{3in} 
Another contiguous chunk. 
\end{minipage} 
Các vấn đề liên quan