jektex icon indicating copy to clipboard operation
jektex copied to clipboard

Expose / Document exposition of `trust`

Open Kuixz opened this issue 1 year ago • 1 comments

Most of the context is at this issue, will repeat it here for convenience:

I'm trying to add colorblind-friendly filters to my blog by, as an example, replacing some-class: { color: blue } with some-class: { color: var(--color-palette-blue) } where the --color-palette-blue CSS variable is set at :root level elsewhere. I thought this approach didn't work with KaTeX, because it does not accept var(--color-palette-blue) as an argument to \color. So an equation like $$\textcolor{blue}{\frac{1}{2}}$$ can't be converted into something like $$\textcolor{var(--color-palette-blue)}{\frac{1}{2}}$$.

Well, KaTeX has an \htmlStyle command that adds an HTML style to the proceeding LaTeX, but this isn't enabled by default because injecting HTML is just not a good idea to have enabled by default. So \htmlStyle only takes effect when rendering LaTeX with a trust argument passed in.

It's not clear whether trust is configurable in config.yml or even accessible at all. Knowing how to access it / being able to access it would be very cool.

Kuixz avatar Mar 13 '25 23:03 Kuixz

Yes, this sounds very useful. I am in middle of big rewrite (https://github.com/yagarea/jektex/tree/dev) which this plugin really needs. With this rewrite I will add this option.

If you want to you can join the development to speed things up. :)

yagarea avatar Jul 16 '25 10:07 yagarea