Katex: Stretchy elements should inherit current color

Created on 15 Aug 2017  路  7Comments  路  Source: KaTeX/KaTeX

If no color is set explicitly, stretchy elements should still have a mask image with currentColor:

node.style.backgroundColor = 'currentColor';

Otherwise this happens:

$$
\overbrace{x+y}
$$

overbrace

@ronkok

Most helpful comment

Confirmed, it works! Thank you!

All 7 comments

I was also wondering whether any background settings should be marked !important. According to this discussion, it seems to help with printing on most browsers... (-webkit-print-color-adjust: exact; might also be necessary somewhere...)

Sometimes I wish that I had written all of the stretchy element SVG code inline. With what I know today, I no longer have to write it with URL escapes. With just JavaScript no escapes, the code is somehow less hideous to look upon. Colors are easy with inline code. The CSS becomes very straightforward.

Here is the SVG inline code for six different surd characters. There are 36 external SVG files currently in the images folder. Transferring it all to inline would add about 20 KB to the JavaScript.

Any takers?

Oh, and those inline SVG are not background, they are instead <svg> tags written directly into the DOM. All the background printing issues go away.

Another benefit of the SVG being inline is that if you serve it gzip'd a lot of the duplication will get compressed away.

I expect that this issue is now resolved, since stretchy elements are all inline.

@glebm this should be fixed with the release of v0.8.3. Please reopen if the new version doesn't solve this issue.

Confirmed, it works! Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

OisinMoran picture OisinMoran  路  4Comments

mbourne picture mbourne  路  3Comments

yawnoc picture yawnoc  路  3Comments

q2apro picture q2apro  路  3Comments

oddhack picture oddhack  路  3Comments