Work on the document API: inclusion of figures and lists.