Подтвердить что ты не робот

Сделайте небьющийся блок в 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}

Возможно ли это?

4b9b3361

Ответ 1

Вы можете попробовать

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

Ответ 2

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

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

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