Volunteer work requires us to convert a large number of LaTeX documents into an ePub file format. This is a series of open source books that so far have only been released on paper through the print-on-demand service. We would like to be able to offer the book to users of book readers (such as Kindle) who require the best results for ePub format.
Fortunately, ePub is a very simple format, however for LaTeX there is no trivial way to get the required XHTML output.
We experimented with alternative LaTeX compilers (e.g. plastex), but in the end we realized that it would be much easier to just write our own compiler, which understands a tiny subset of LaTeX and compiles directly to XHTML / ePub.
I used to use a tool on Windows called GOLD. This allowed me to go directly from BNF grammars to the parser. It also helped me implement the parser in any language that I liked. (I would choose Python).
This product should work on Linux, so I'm wondering if there is an equivalent toolchain that also works in Ubutnu / Eclipse / Python. The idea is that we take TeX grammar and just implement a subset of this teenager, but we don’t want to spend a huge amount of time caring for grammar and parsing. A parser generator will obviously save us a lot of time.
Sal
UPDATE 1: Bonus signs for a solution with excellent documentation or tutorials.
UPDATE 2: An added bonus if you already have a grammar file for TeX, since all I need to do is implement the functions we care about.
source
share