>> works for me after moving the `\special{background White}` inside the >> preview environment
For the simple example this is possible but for my actual application I can only give some latex code that is added to the preamble of a template (which comes before the preview environment). Thanks for the suggestion. > The proper way to get it into every output file is by using > > \AtBeginDvi{\special{background White}} Indeed this does the trick. Thanks. As a follow-up, I tried to change the colour of the text instead of the background. When I use `\AtBeginDvi{\special{color Blue}}` something interesting happens. The `stderr` from `dvisvgm` is ``` pre-processing DVI file (format version 2) processing page 1 graphic size: 59.060989pt x 16.642173pt (20.757564mm x 5.849055mm) output written to build/html/_images/math/a2e9efdc082dc472f41adfa3b55cc10fffca955e.svg 1 of 1 page converted in 0.23648 seconds ``` while when I use `\AtBeginDvi{\special{background White}}` the `stderr` is ``` pre-processing DVI file (format version 2) processing page 1 computing extents based on data set by preview package (version 13.1) width=59.060989pt, height=11.814414pt, depth=4.827759pt graphic size: 59.060989pt x 16.642173pt (20.757564mm x 5.849055mm) output written to build/html/_images/math/d5d00c07920b38bf8e74010aca212d30f5cf0e99.svg 1 of 1 page converted in 0.225224 seconds ``` Now, `imgmath` (a Sphinx extension) relies on this `stderr` in order to extract the `depth` value and in the former case it is missing, so vertical correction is not applied (later on) which doesn’t look nice. Clearly this is related to `dvisvgm` however in its documentation (under the dgisvgv/ps section) it is stated that “… the preview package with option tightpage.” is used to get a bounding box. And I wonder whether this has anything to do with the preview package? Thanks, Mitko