Closed Ra0R closed 1 year ago
Thanks, I can reproduce this for math-tex
. I'll have to give some thought how to handle it.
I can not reproduce this for math-highlight
- are you sure that is affected as well?
Interestingly if you have a long line of mathjax in base obsidian using $$
it overflows the margins too.
Will have to experiment a bit.
It doesn't seem to be as straightforward as I hoped with some simple CSS fixes. Also the underlying Mathjax does not currently support automatic line break which would make this much easier. Will have to keep thinking abou tit
Yes the issue seems to be present also for math-highlight
:
The markdown is used:
```math-highlight
# Points
points = 8pt + 9.8pt + 4pt + 6.6pt + 7.5pt + 5.5pt + 10pt
# Average
avg = points / 7
\`\`\`
I did not look at the plugin code (and don't know much about Obsidian under the hood either). But MathJax seems to support rendering as HTML or SVG, could you not simply force the output to not overlapp the right-hand result pane? (E.g. in HTML by using something like max-width: 70%
.
Ahh, I was checking reader mode. I'm able to repro the math-highlight bug in live preview as well. Thanks, looking in to it
Still broken for TeX, which might be harder to fix
There doesn't seem to be a straightforward solution to getting around the lack of MathJax support in v3 for automatic line breaks (I tried max width, forcing word-break, etc).
It looks like Release MathJax v4.0.0-alpha.1 does incorporate automatic line breaking. Once that gets pushed out, hopefully the devs will incorporate it in Obsidian, which should then fix it for Numerals.
Going to mark this as won't fix. If its still broken if/when MathJax v4 is incorporated and Obsidian supports automatic line breaks natively, then can re-open
For future reference, see this obsidian bug report: Latex math newline line break \ - Bug reports - Obsidian Forum
In "math" format line breaks are done as expected:
For "math-highlight" or "math-tex" we get this:
Should probably be possible to set a width for the other formats aswell.