gtg922r / obsidian-numerals

An obsidian plugin which turns a math code block into a full featured calculator
Other
389 stars 7 forks source link

Font render differs between math and math-tex #74

Closed duxswhatdux closed 3 months ago

duxswhatdux commented 4 months ago

Hi. Thanks for this plugging I really like, simplistic for everyday use.

There are time I might use both styles, noticing the font rendering in math-Tex is Roman numerals when using IOS. I haven’t tried this on desktop yet.

Are there plans to harmonize font rendering between the styles, or is this done by intention? IMG_5435

gtg922r commented 3 months ago

The font difference is intentional.

The -tex block is rendered by Obsidian's built-in mathjax renderer, which styles the text with its own font-family. This is intentional for those who like tex styling and fonts.

The -plaint style uses whatever the default obsidian monospace font is.

You can use a css snippet to change the font for numerals -tex if you like.

.numerals-tex .MJX-TEX {
    font-family: var(--numerals-font);
}

Or you can use a css snippet or the style settings plugin to change the font for -plain and -highlight modes.

.numerals-block {
    --numerals-font: MJXZERO, MJXTEX;
}

Note: I haven't tested either of these extensively so your mileage may vary.