The margin generator
A small tool that proposes page margins from a text block and refuses bad ones.

A small tool that proposes page margins from a stock size, a type size and a binding method, then prints its own reasoning underneath so you can disagree with it.
Margin decisions are the ones juniors get stuck on and seniors do in ninety seconds, mostly by feel. We wanted to find out whether the feel was a rule. It largely is: the gutter is a function of the binding and the paper's stiffness, and the outer margin is a function of where a thumb goes.
It is a hundred lines of code and it has ended more layout meetings than any document we have ever written.
The generator is not meant to be obeyed. Its actual job is to make the argument explicit — it says "22mm outer because perfect-bound, 120gsm, thumb clearance" and then somebody in the room says "no, because this is read on a desk", and that is the conversation that needed to happen.
It is a hundred lines of code and it has ended more layout meetings than any document we have ever written.