Text Formattingkeep with next paragraph?

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
páibǎn
Posts: 5
Joined: Sun Sep 12, 2010 3:21 am

keep with next paragraph?

Post by páibǎn »

This is my first posting on this site. After years of stalling, I'm finally transitioning from full-time use of Nisus (which I adore) and HTML to XeTeX. I make heavy use of CJK fonts and regular expressions. I am finishing an English-Chinese dictionary, organized in a PostgreSQL database and prepared for print using Python; I expect XeTeX to make automated typesetting convenient, flexible, reproducible, beautiful, and fun.

Here is my first question: I'm wondering if there is a normal way to ensure that a given paragraph is never separated by a page break from the beginning of the one following it. Nisus has a "keep with next paragraph" command that achieves this. I see a command

Code: Select all

\nopagebreak[number]
and wonder if that is what I should be using. Or is there something else?

Thanks for your patient help.
Last edited by páibǎn on Mon Sep 13, 2010 10:08 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

keep with next paragraph?

Post by localghost »

Use either this \nopagebreak command (without optional argument for highest priority) or put the concerned paragraph into a minipage environment.


Best regards and welcome to the board
Thorsten
páibǎn
Posts: 5
Joined: Sun Sep 12, 2010 3:21 am

Re: keep with next paragraph?

Post by páibǎn »

Thanks. A related question is whether the two solutions you have named also work to keep the first paragraph in the same *column* as the beginning of the second. (I have seen mention of a \nocolumnbreak command, although it generates an error message in my current installation.)
Last edited by páibǎn on Mon Sep 13, 2010 10:08 pm, edited 1 time in total.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

keep with next paragraph?

Post by localghost »

At least the solution with the minipage environment should work. At the moment I don't remember where this \nocolumnbreak command comes from. Perhaps you can give a source where you found that.
páibǎn
Posts: 5
Joined: Sun Sep 12, 2010 3:21 am

keep with next paragraph?

Post by páibǎn »

I hypothesized the existence of a \nocolumnbreak command and then found a few examples on-line, searching Google together with "latex", but none of the ones I examined was very clear about usage, hence my question.

Looking again just now, I see it mentioned in the long list at http://www.math.utah.edu/cgi-bin/man2ht ... tty-0.01.1, associated with LAmSTeX. My hope was to find a command of this kind in the regular LaTeX installation.

Testing \nopagebreak[4] just now, it seems to me that it prevents both page breaks and column breaks. So I think the question is answered.

Thanks for your time.
Post Reply