I want to split a large ordered list into consecutive non-overlapping sub-lists, such that all elements are within an interval from the first member of the sub-list . For example:
list={{1,x},{2,x},{3,x},{4,x},{5,x},{8,x},{13,x},{16,x},{17,x}}
And I want to split it so that all first elements are within an interval of 3. The desired result is this:
result={{{1,x},{2,x},{3,x}},{{4,x},{5,x}},{{8,x}},{{13,x}},{{16,x},{17,x}}}
Notice that the interval is relative to the first member of the sub-list and the final result is non-overlapping. So, for example, {{2,x},{3,x},{4,x}} is not in the result.
Partition
i.e.Partition[list, 3]
$\endgroup$