Handle marimo tex components when exporting to PDF#8062
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dmadisetti
left a comment
There was a problem hiding this comment.
Nice. But we're not converting \[ notation? A little confused, if jupyter doesn't support it, then we should convert right?
| import marimo | ||
|
|
||
| __generated_with = "0.15.5" | ||
| __generated_with = "0.19.6" |
There was a problem hiding this comment.
For a sanity check, can you convert this to our markdown format too?
|
Yeah, I see a natural ask being to include |
They don't support rendering this syntax afaik. And nbconvert doesn't support parsing this syntax either hence raises an error. So, we are altering the code we send to nbconvert to make it work. From my understanding,
I don't really know what the state is now, maybe use jupyter with this extension? https://github.com/jfbercher/jupyter_latex_envs |
|
@dmadisetti I think I'm okay to support it. My worry was false positives but the regex looks right. Also seems like it's the recommended way to write LaTeX now. |
| ("SELECT (", ["syntax", "error"]), | ||
| ("SELECT * FROM", ["syntax", "error"]), | ||
| ("SELECT ,", ["syntax", "error"]), | ||
| ("SELEC * FROM table", ["syntax", "error"]), |
There was a problem hiding this comment.
i assume this syntax error was intentional. but typo is re-writing it? we can create a different syntax error
There was a problem hiding this comment.
addressed in the pre-commit PR, but yeah, that's also possible lol
07c149a to
94b70c4
Compare

📝 Summary
Fix LaTeX rendering in ipynb/PDF exports by converting marimo's internal
<marimo-tex>HTML format back to standard$...$ / $$...$$delimiters.\[...\]→$$...$$conversion is also implemented but disabled. However, it seems nbconvert/jupyter doesn't handle them jupyter/nbconvert#477.Example cell-output
🔍 Description of Changes
We wrap LaTeX in custom tags with ||(...) delimiters (via pymdownx.arithmatex). The frontend renders these with KaTeX, but nbconvert doesn't understand them, causing broken math in exports.
Not included
📋 Checklist