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).

  • 1
    Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. – egreg Oct 27 '11 at 11:16
  • Please add a minimal working example (MWE) that illustrates your problem. – N.N. Oct 27 '11 at 12:54

The heading should be input with the help of a sectioning command, such as \section

\section{A heading}

This text won't be separated from the heading.

In this way no terminating \\* is needed, as the text following a sectional header will never be separated from it.


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 \needspace:

[Header line, blank line (say), and material in paragraph]

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.