I've been developing GoPDFSuit, a library aiming to simplify PDF document generation by using a JSON schema instead of the traditional HTML-to-PDF methods. The goal is to allow developers to create sophisticated PDF layouts with structured data while using a user-friendly drag-and-drop interface for layout adjustments. Currently, it's capable of generating business reports, invoices, and data sheets. I'm facing a challenge regarding mathematical formula rendering in JSON strings and I'm torn between using LaTeX, which is widely recognized, or Typst, which offers cleaner syntax and easier writing. I'd love to know which option you think is better suited for a Python development environment and whether you believe a JSON-based layout engine could be a strong alternative to traditional headless browsing methods for high-performance PDF creation.
2 Answers
Honestly, I lean towards LaTeX mainly because it’s become a staple in Python communities, especially for scientific and mathematical contexts. If you're already automating data input via Python, it might be beneficial to use LaTeX since it integrates well with tools like matplotlib. Sure, Typst looks nice and might be simpler, but I think LaTeX's familiarity in certain circles trumps the ease of switching to Typst. You can always create a helper function to manage LaTeX string escaping for JSON, which isn’t too hard.
Your JSON-as-layout approach is quite innovative, especially for structured document generation like reports or invoices. For your dilemma between LaTeX and Typst, I think Typst might actually serve your audience better, given that most users might find LaTeX a bit complex and the escaping within JSON could turn into a nightmare. Typst’s cleaner syntax will likely save everyone a lot of headaches. Plus, your drag-and-drop feature is fantastic! Basic tools sometimes overlook that aspect.
Thanks for the input! I agree that a cleaner syntax will be much more user-friendly. I'm excited to see how this all comes together!

Makes total sense! LaTeX really does have the advantage of being well-known in the scientific world. Looking forward to seeing how your library develops!