Open huu4ontocord opened 2 years ago
@ontocord Yes, this kind of functionality is definitely useful for (especially) other tools that want to pretty-print Python pseudo-code as LaTeX. And it can be used in get_latex
too.
I have considered to provide latexify.compile(str)
several days ago, which provides the same functionality with above. Actually my local environment has some implementations. Let me take some time to polish the interface.
Thank you @odashi !
It would be nice to also support ast.Node, because I created a package uneval which generates ast.
Or to even support uneval directly, so I can write:
from uneval import quote as q
to_latex(q.x**2 + 3)
q^2 + 3
It would be nice to also support ast.Node
Yeah this is easier because we can split such subroutine from get_latex
without complex tweaks AFAIK.
Maybe an option to get_latex where you can pass in a string instead: