A method of composing a document is disclosed which comprises defining a
plurality of content portions to be fitted to the document, defining a
content layout for the document, which defines at least two containers
into which content portions are to be fitted, generating a first set of
solutions for a first one of the containers, each comprising a
combination of content, which fit within the container in accordance with
one or more rules, generating a second set of solutions for a second one
of the containers, each comprising a combination of content which fit
within the second container in accordance with one or more rules, and
referencing the first set with the second set to determine an allowable
combination of solutions which fit the first and second containers in
which all of the contents in the solution for the first container differ
from the contents in the solution for the second container.