-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LatexDSL integration #128
Comments
We use Katex mostly for equations, not sure if it supports also other elements like theorems and similar. And I do not know if LatexDSL supports a particular api for stuff that usually ends up in an equation (stuff like \frac{1}{2} or \sin or similar). So on the specific topic of this, not sure what would be the advantages. On the general topic of latex, two evolutions I see are:
|
OK yeah Latex is HUUUGE and Katex is only supporting a small subset of those. It would be hard to list everything it supports and prevent users from using unsupported features. But still, if you keep to the supported features of Katex, using LatexDSL would allow you to get meaningful compile-time errors instead of bad runtime errors as you described. So I still see potential for this, just that we must be very clear that they can only use the Katex-subset of features.
I only really see it useful for inlining Latex here, kinda like
Yeah the best thing would be a Nim Latex compiler similar to nim-markdown, but that seems like a very big undertaking. Duktape does sound really exciting though. Does sound like quite a bit of work as well, the wrapper seems quite low-level. |
Just very quickly (we can discuss in more detail one of these days): Given that KaTeX is very restrictive, that's actually a positive: it allows us to define a custom set of operations in the set of commands (https://github.com/Vindaar/LatexDSL/blob/master/src/latexdsl/valid_tex_commands.nim ; I have a version I still need to push that allows to essentially use a custom enum). Also LatexDSL does not necessarily have to produce a runtime string. It can also generate a CT string! |
Ahh, that rings a bell somewhere back in my head :o It's still a lot of keywords still though 🤣 But I guess we could write a scraper to find them all from their website.
Wow, didn't know :O That should speed-up templates with LatexDSL in them by a few % 😎 |
Inspired by nimiSlide forum post it would be nice if we could somehow allow the user to write latex using LatexDSL instead of writing it in a string. It would allow CT errors among other things. LatexDSL returns a string, so the easiest thing to try would be to just let Katex render it for us and hope it works. I haven't tried it out yet though.
The text was updated successfully, but these errors were encountered: