Hacker News new | past | comments | ask | show | jobs | submit login

> Want a programming language in the middle? Python, Lua etc can be embedded straight away.

After using templating languages in Python, yes, I always want this when using LaTeX. And as of ~2 years ago when I last tried this, while sure, I could embed Python in the middle, the interface for interacting with LaTeX via the embedded Python was anemic enough to be not useful. Maybe something had changed in the last 2 years, but if so, it's not more mature.

Example: I wanted to have a daily meditation book, where \chapter{Title} would insert the dates in order with the title of the meditation, instead of chapter numbers, also inserting a table of contents entry with the dates. What I didn't want was to have to go through and change dates if I added a meditation in the middle, or swapped the order of meditations. I'm not picky, I would've been happy to use \section{Title} or \meditation{Title}, or script a solution.

What happened was I spent probably 6 hours of research and never found a solution integrated into LaTeX. I did eventually write a script in Python that naively parsed the chapter titles and changed them in-placed in the LaTeX code, but that meant I had to regenerate the dates as a separate task.

Note that this took me about 5 minutes to figure out with Typst's integrated scripting language.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: