vincentdoerig / latex-css

LaTeX.css is a CSS library that makes your website look like a LaTeX document
https://latex.vercel.app
MIT License
2.74k stars 125 forks source link

source code block too long #26

Closed ZhangYet closed 4 years ago

ZhangYet commented 4 years ago

When using latex.css to generate html from my org-mode note, the source code sometimes will be too long and out of

 area as below:
example

ZhangYet commented 4 years ago

I tried to solved this problem in this way: https://github.com/vincentdoerig/latex-css/pull/27

I wonder if you had a better way.

vincentdoerig commented 4 years ago

This should not be happening I think, because the <pre> element is set to overflow when the content is too big. This means that the element should be scrollable when the content exceeds its width. Could you maybe provide the code that caused the issue as well as your browser/OS? Cheers!

ZhangYet commented 4 years ago

Here is the html source code: https://gist.github.com/ZhangYet/13da5cd6041108cb2a95c04c5e680548

I tried it in Google Chrome 81.0.4044.129 and Safari 13.1.1 (14609.2.9.1.3).

My OS is Mac OS 10.14.6.

Thx.

vincentdoerig commented 4 years ago

I found the issue. org (probably) is adding this rule pre.src { position: relative; overflow: visible; padding-top: 1.2em; } here to <pre> which disables the x-overflow. You can fix it by overwriting latex.css using pre { overflow: auto !important; }.

ZhangYet commented 4 years ago

It works! thx!