I want to do something like the following in 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}
Is this possible?
The \nolinebreak command prevents LaTeX from breaking the current line at the point of the command. With the optional argument, number, you can convert the \nolinebreak command from a demand to a request. The number must be a number from 0 to 4. The higher the number, the more insistent the request is.
See the FAQ: Yet another trick by Knuth is useful if you have a sequence of small blocks of text that need, individually, to be kept on their own page. Insert the command \filbreak before each small block, and the effect is achieved.
The correct answer may be to put the two word in an \mbox{keep together} . Then you avoid hyphenation, but not overfull lines. Then, you can write \MSA/ (notice the slash), and LaTeX will not eat a following space. Unfortunately, such commands may be awkward to type keyboards other than US-English.
10.2 \newpage LaTeX's page breaks are optimized so ordinarily you only use this command in a document body to polish the final version, or inside commands. While the commands \clearpage and \cleardoublepage also end the current page, in addition they clear pending floats (see \clearpage & \cleardoublepage ).
You could try:
\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
prevents LaTeX from pagebreaking within one paragraph, i.e. within the samepage
environment, pagebreaks are only between paragraphs. Thus, you need nopagebreak
as well, to prevent LaTeX from pagebreaking between two paragraphs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With