Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to use Markdown as a substitute for LaTex in my documents which do not have Mathematical formulee.

I assume that the number of rows in one A4 is 80.

Problem: to not to have two H1 headings in the same page

If the problem occurs, rows should be added to the beginning of the second H1 such that it starts at the new page.

The program should

  • calculate the number of rows before the second H1
  • divide that number by 80 and take the remainder
  • add enters as much as the remainder to the beginning of the second H1

How can you calculate the number of rows in a document where there is no pictures?

share|improve this question
up vote 2 down vote accepted

There is a perl script here that puts a page break comment before each H1 heading (except the first). The page break comment is then processed when the output is passed through html2ps. This may not be precisely the solution you need but it may lead you in the right direction.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .