quartz icon indicating copy to clipboard operation
quartz copied to clipboard

Typst Math Rendering: fail to invert color in dark mode

Open LumenYoung opened this issue 4 months ago • 2 comments

Describe the bug As suggested in the title, the typst math blocks are in black instead of white in dark mode like following picture shows.

Image

To Reproduce Steps to reproduce the behavior:

  1. Set the math engine to typst
  2. write some equations
  3. use dark mode

My repo: https://github.com/LumenYoung/Notes The related page: https://www.lumeny.io/papers/Representation-Alignment-for-diffusion-transformer

  • Quartz Version: 4.5.1

LumenYoung avatar Aug 12 '25 07:08 LumenYoung

I had a patch on my own repo to 1) mark each typst equation 2) invert them in the dark mode. The implementation is this commit. Now the equations on my site is having proper color inversion in the darkmode.

I think it is somewhat a proper way to solve this but different from mathjax and katex. Since katex/mathjax are rendered as html but typst are now implemented as svg. I can try to contribute my code into quartz if considered interesting.

LumenYoung avatar Aug 14 '25 12:08 LumenYoung

I've made a PR for this and hopefully got merged

LumenYoung avatar Aug 19 '25 15:08 LumenYoung