A user can efficiently perform a setting operation in an automatic layout
system. An information processing apparatus having an automatic layout
function includes a function for, in editing containers, measuring a
distance between a first container placed on the document and a second
container placed on the document, determining whether or not the distance
is equal to or shorter than a predetermined distance, and if the distance
is determined to be equal to or shorter than the predetermined distance,
automatically setting the link between the first and second containers.