And of course, the previous patch contains a bug. I should have tested it with multiple latex header blocks. Sorry for the inconvenience. The attached patch should (hopefully) fix that. Best wishes, Sebastian