Hacker News new | ask | show | jobs
by maj0rhn 2753 days ago
I have written three scholarly history books [0] where custom Python code was used to generate TeX files (not LaTeX) that were then typeset into PDF.

Python's main purpose was to enable thousands of cross-references across the books, and to transform a large, every-changing text database into a pleasing output, where different parts of the database had different output formats.

Perhaps a TeX wizard could have done it all in pure TeX, but I never could have. Besides, who wants to learn all the intricacies of TeX/LaTeX when the task in Python is so straightforward? To this day, I can't imagine a different approach.

Joining the Python and TeX pieces together into simple scripts was trivial. The Python code evolved as I got into the books, so I would recommend a rapid-iteration model of code development, rather than building a perfect edifice before starting.

[0] http://www.physical-lincoln.com