Behind the page

Why didn't this page work out? How a typesetting engine decides where a page ends

Ariach doesn't lay out one page after another. The engine considers several endings for each page, gives each one a cost (a loose line, a note far from its word, a short column), and chooses the best combination for the whole book at once. A page that still didn't work out is flagged for review, with the reason and what you can do.

Updated October 18, 2026 · 7 min read

In Word, a page ends when it runs out of room

In Word, and in any program that lays out one page after another, the question is simple: how many lines fit. When the room runs out, the page ends. That works well in a book without notes. In a book with notes, and even more with commentaries around the text, the decision on one page sets what is left for the next, and the error adds up: a note that didn't fit pushes the next one along, and at the end of the chapter half a page is left empty.

A professional typesetter solves this by hand: takes out a line here, adds a line there, and after every round of proofreading does it all again.

In Ariach, the whole book is laid out at once

Ariach's engine doesn't lay out one page after another. For each page it considers several possible endings, and gives each ending a cost. Then it chooses the cheapest combination for the whole book at once, so a good decision on one page doesn't cost a bad page three pages later. These are the things that carry a cost:

A loose line
Wide gaps between the words or the letters. In Tzuras HaDaf it is the last resort: the engine prefers almost anything else.
A note far from its word
Every note aims for the page of its word. A note that continues on the next page is an allowed compromise, and it is measured.
A short column
Columns that don't end together at the bottom of the page, in the main text and in the notes.
A widow or orphan
A single line of a paragraph alone at the top or bottom of a page, or at the top or bottom of a column.
A page that isn't full
A gap at the bottom of the page. The engine fills it with vertical spacing and letter width, within the limits set in the design.
Mishnah Berurah, Hilchos Hashkamas HaBoker: six texts on a page, and each one ends on a full line.

When there is no perfect answer, the page tells you why

Some pages have no good ending: a note longer than all the room that is left, a paragraph that doesn't divide well, a heading that falls at the bottom of the page. Instead of fixing it silently, Ariach flags the page for review. The page's card says what happened, and what you can do:

  • A change to a setting that you apply with one click, such as one line less on the previous page or a little more spacing.
  • The place in the text worth shortening, if that is where the fix is.

The typesetter has the last word

When the typesetter knows better, the typesetter decides: end the page before this word, one line less or one line more, start on the next page. And in the page division screen you drag the bottom of each text on the page itself, and see at once what moved to the next page.

These instructions are anchored to words, not to a place on the page. So they stay correct after the proofreader adds a line on page 3. An instruction whose situation has changed (its word was deleted, for example) is switched off and flagged, not applied silently somewhere else.

And what happens when you correct a word

Correcting a word at the start of the book can change every page after it. Ariach lays out again only what the change touches, so the page updates as you type, even in a large book. The result is always identical to a full layout of the whole book from the start: the same book, the same settings, the same pages. And the PDF is identical to the pages on the screen.

Want to see how this looks on a page of Gemara? The guide to typesetting in Tzuras HaDaf shows the same principles when the commentaries wrap around the text.

Frequently asked questions

Have a question? We're glad to help.

About your book, a problem or an idea. We usually answer within a business day.

How does typesetting software decide where a page ends?

In Word, a page ends when it runs out of room. In Ariach the engine considers many possible endings for each page, gives each one a cost (a loose line, a note far from its word, a short column, a widow or orphan), and chooses the cheapest combination for the whole book at once.

What is a flagged page?

A page the engine couldn't lay out without a compromise you should know about: a page that didn't fill, a short column, a note that moved to the next page. It is flagged for review, with the reason and what you can do about it, and nothing is fixed silently.

Can I force a page to end at a certain place?

Yes, with a layout instruction: end the page before this word, one line less or one line more, or start on the next page. The instruction is anchored to the words, so it stays correct after proofreading corrections too.

Why does a small correction at the start of the book change pages at the end?

Because the page breaks depend on one another. Ariach lays out again only what the change touches, and checks that the result is identical to a full layout of the whole book. Whatever you set by hand stays in place.

More from the blog

Found a mistake, or something missing? Write to us: support@ariach.com

Open the sample book, and change something in it

The sample book opens at once, with no sign-up. When you want to typeset a book of your own, open an account and upload the file.

Open a free account

A question before you start? Write to us, and we usually answer within a business day.