I have a heading and paragraph and I dont want to be separated by pagebreak. So when they should be separated, they both should end up on the next page. Is \\* the right command, because it wont work on my text (I am converting some text from MS Word and you have there "Keep With Next" command which does what we want).
|
|
|||||||
|
|
The heading should be input with the help of a sectioning command, such as
In this way no terminating |
||||
|
|
|
You don't mention how long the paragraphs below a "heading" are, so I'll assume that (i) they can be quite long and (ii) it's ok to have a page break anytime after the full second line of the paragraph. If these assumptions apply, you may want to use the needspace package and its eponymous command
The idea is that if there's less space than would be occupied by 4 lines of text, TeX will be instructed to insert a page break before the header line, etc. is typeset. I've chosen the number "4" because I'm assuming (i) you may have a blank line between the header and the first line of corresponding text and (ii) headers always fit on a single line. You should adjust the example code to fit your document's specific needs. |
||||
|
|
