Hi rgfactory,
Thanks for the report. I can confirm the class is erroneously removed when the formula is rendered in posts.
I also see the class is added in the editor; but it is added around the entire block in the editor and not just around the rendered formula. This probably causes the breakage you’re experiencing. It makes more sense to add the class only to the rendered formula, in the same way it would show in posts.
I’ll find some time to fix this.
I am testing a new version of the plugin which adds the support for CSS classes you’re looking for. I would be grateful if you could test this version on your site and report back, before this version is pushed to other users. Based on my tests, I think it should be good to go as is.
You can download it at the bottom of the page here, be sure to select “Development Version”:
https://wordpress.org/plugins/katex/advanced/
Note the compatibility notice in the changelog:
Support adding CSS classes to KaTeX Gutenberg Blocks to help with styling. Backwards compatibility note: KaTeX Gutenberg Blocks are now rendered wrapped in a div element on which classes wp-block-katex-display-block and katex-eq are set. You can add more classes to this div through WordPress’s post editor. Previously, KaTeX Gutenberg Blocks were rendered wrapped in an unclassed span. KaTeX shortcodes are still wrapped inside a span with only the class katex-eq set. If you depend on old behavior for styling, you might need to update your styling rules.