2010-10-23 4 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. –

+1

Скрещивание для удобства: http://tex.stackexchange.com/questions/4471/unbreakable-block –

ответ

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 предотвращает LaTeX от pagebreaking в пределах одного пункта, то есть в пределах samepage envirnment, pagebreaks только между пунктами. Таким образом, вам нужно также nopagebreak, чтобы предотвратить перехват LaTeX между двумя абзацами.

6

Быстрый тест показывает, что minipage также имеет такое поведение.

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

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

 Смежные вопросы

  • Нет связанных вопросов^_^