vscode-drawio
vscode-drawio copied to clipboard
Mathematical Typesetting Exporting Issue
When the "Mathematical Typesetting" is enabled, the exported images (both .svg and .png) are not correctly formatted. All the texts are shown in plain text (like "$$f(x)$$") but not the stylized way.
This is the explanation for this:
- You create/update a math-formatted text in Draw.io.
- Draw.io only renders the plain text for now.
- Immediately after that, the Draw.io webview sends the current diagram source to VS Code
- VS Code keeps that diagram source in an internal buffer
- Some time after that, Draw.io renders the text as math-formula.
- If you press save, the internal buffer that still has the plain-text rendering is persisted to disk.
Result: VS Code only persists a diagram where the created/updated text is not rendered yet as plain text.
- If you change something unrelated to the math-formatted text in the diagram, the Draw.io webview will send the current diagram source to VS Code again - this time however, with the formatted text.
Result: The text in the persisted diagram is rendered as math formula.
This seems like a bug in Draw.io when used in embed-mode. I hope this workaround helps.
I'm unsure how to fix this. The Draw.io export command should wait until all images are rendered.
Hello! I am also experiencing this!
I didn't understand the workaround though? I changed something unrelated to the formulas and the exported file is still broken.
BTW this extension is awesome, thank you :)
The workaround is: Change something unrelated in your diagram (like add a node and then remove it). Then save.
@hediet Sorry for my ignorance. What's the meaning of a node? After writing some latex math code, i.e. $$ something$$, I add some elements, e.g. a circle, then save the file, and export to .png or .svg file. I still cannot get the right math output.
Then the workaround no longer works 😞
Then the workaround no longer works 😞
Oh, it's frustrating. Looking forward to other solutions. (☆▽☆)
Any news about this?
+1
no news here, maybe I will have some time to look into it when I have to go to quarantine/isolation, which I guess will happen soon here :D
@hediet Is there an update on this? I have the same problem right now and I wonder if there is a workaround yet?
Not that I know of. I'll try to investigate as soon as I find some time.
So why not consider to release a new version?