Irrational-Encoding-Wizardry / guide.encode.moe

A guide for fansubbing
https://guide.encode.moe
Creative Commons Attribution Share Alike 4.0 International
141 stars 20 forks source link

Add gitbook plug-in "katex" #42

Closed OrangeChannel closed 4 years ago

OrangeChannel commented 4 years ago

e1ea810d3b8b153accd46a6f1e927a8bad3e360a has some weird stuff so I'll explain it here. On GitHub, it doesn't change the $$ within back-ticks to the templates, but gitbook always does. That explains the weirdness of me explaining the templates, but there not being any templates in the actual markdown. There's no actual way around this, as you can't escape characters within back-ticks.

FichteFoll commented 4 years ago

You could also format the footnote I added regarding limited 8-bit range in artifacts.md

OrangeChannel commented 4 years ago

Playing around with CSS right now, we have the option of using the current font on the page instead of the TeX font.

tex: image

website serif: image website sans: image

Let me know what you think @FichteFoll .

FichteFoll commented 4 years ago

Using the page's font seems nice as it will be less of a context break than a separate paragraph already is. And using sans-serif on a website should always be preferred (unless the user dislikes that for some reason).

FichteFoll commented 4 years ago

How does this work with katex? Does it generate svg?

OrangeChannel commented 4 years ago

So, I chose to go with the website font theming for generic math font for KaTeX stuff. image It changes to serif if you use the dropdown selector at the top. The block code/TeX also share the same theming now, except for a slightly larger non-mono font. image

OrangeChannel commented 4 years ago

How does this work with katex? Does it generate svg?

No, in fact the benefit of KaTeX over other *tex libraries is that it pre-renders them as HTML at build-time, leaving no shape/svg generation on the user side.

https://katex.org/

In the case of changing font-styles, that’s all it’s actually doing. The dropdown is just a css change, no html/svg differences

FichteFoll commented 4 years ago

Thanks for taking the time to work on this. You're the only person who has touched our CSS so far, so I'll trust your judgement when you say it's easier to edit like this.