Skip to content

Space after argument-less macro should be absorbed #56

Description

@Evan-Zhao

Hi @siefkenj, thank you for the library! I'm working with the parser and noticed extraneous whitespaces being given in the following case:

{\em 5 stars}

which in Latex should render as 5 stars without any space before it.
I had to look it up; this SO question confirms that in such positions (macro without arguments and not guarded by a {} empty statement) the following space is absorbed and doesn't render.
Currently the unified-latex parser acts differently and produces that whitespace.

Is this intentional? How should I approach and fix it if I'd like to contribute?

Context: I'm using this Latex parser to "transpile" a small set of Latex into other typesetting languages such as Typst. It's very hard to have great Latex feature coverage, and I don't quite intend to do so. Still, it may prove useful for people to migrate their old latex projects and save some manual work :)

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