Matt Huszagh writes: > I've added a few changes to the patch that additionally allow custom the > begin and end document environments. The purpose here is to allow latex > code within the document environment that is ignored by the body > export. For instance, I can set the page color with > {\color{some-color}...} and this doesn't mess up latex exports. I've fixed a minor bug with the previous patch.