obsidian-copy-as-html
obsidian-copy-as-html copied to clipboard
Support of Mathjax/Latex
The plugin you made is almost perfect but just this issue that it can parse latex properly.
What I would Like is that it converts latex to image, just like the way you are dealing with excalidraw images. there are many websites out there which deals with that is coverting latex to image.
Thanks For your Plugin. And Please support this feature, as early as possible.
Great suggestion ! I will definitely look into this. I'd prefer to use an offline library for conversion, I'll have to do some research...
Great suggestion ! I will definitely look into this. I'd prefer to use an offline library for conversion, I'll have to do some research...
the excalidraw in obsidian developer has also implemented the latex feature in excalidraw you may also even ask him for suggestions.
@Gaaruda, I could not use the same approach as with Excalidraw, since the MathJax is rendered as HTML elements, not SVG. So I did my own rendering and replace the MathJax HTML nodes.
Some issues:
- in bitmap mode, gmail and google docs don't support the vertical alignment in pixels. This may not be fixable.
- in svg mode, it works with gmail, but the document is duplicated (gmail bug, not related to this feature)
- quality is a bit degraded in bitmap mode (might be possible to improve this)
- sane editors like this one render it fine.
And Please support this feature, as early as possible.
Since you're asking someone who doing this in his free time to hurry, feel free to test the above branch and provide feedback 😉
The .math-inline
and .math-block
can be used for styling.
Since you're asking someone who doing this in his free time to hurry, feel free to test the above branch and provide feedback 😉
How can Test this plugin, as I am unable to see a main.js file.
I assumed you knew how to compile a plugin since you have one in your repositories. I pushed a commit with the main.js
.
The implementation works, but adds 2MB to the plugin because it includes the entire MathJax lib and its fonts, which is kind of redundant because Obsidian should already have them.
If anyone can come up with a better implementation, I'd be glad to merge it :)