Skip to content

Accept ast directly #71

@lverweijen

Description

@lverweijen

It would be nice to also support ast.Node directly, because I created a package uneval which can generate ast. It can also generate str (through ast.unparse), but if pytexit supported ast directly it avoids converting back and forth. It would require a change to the preprocessing function that currently works on str-level to remove prefixes, but I think this logic can also be done on ast-level.

Or even accept uneval directly, so this works:

from uneval import quote as q

py2tex(q.x ** 2 + 1)
$$x^2 + 1$$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions