lzanini / mdbook-katex

A preprocessor for mdBook, rendering LaTex equations to HTML at build time.
MIT License
195 stars 34 forks source link

Scrollable equations #104

Closed lieskjur closed 7 months ago

lieskjur commented 7 months ago

Would it be possible to make equations that are two long "scrollable" without hosting my own css?

One big advantage of mdbook, in comparison to pdf files, is that I can scale the page to the size of my screen. Unfortunately by default mdbook-katex does not do this. The fix is rather simple and even described in the CSS customization section of KaTeX's documentation. All that has to be done is to make a single modification to katex.css

.katex-display { overflow: auto hidden }

I wanted to ask if adding it by default or as an option to mdbook-katex would be worth considering. It's a bit of a hassle, downloading the css and font just for this...

SichangHe commented 7 months ago

I imagine that the easiest way is to have an additional-css file with

.katex-display { overflow: auto hidden !important; }

Could you please try this, and if it doesn't work, research a bit on how to use CSS?

lieskjur commented 7 months ago

Cool, it works.

I have no real experience with css or html but I could have figured, that you can simply add css like this.

Thank you.