For the mobile use case I created the TeX-- project. Note that it produces DVI files, not PDFs.
A TeX implementation in a single C++11 class.
Based upon version 3.1415926 of tex.web. Minimal changes to the original sources were performed; preferring instead to leverage p2c’s configurability to manipulate the produced C source. The main goal was getting TeX’s massive number of symbols out of the global scope; making it easy to embed.
Creation of the header file is done through the
tex.sh
shell script, so that it can be regenerated at any time. No manual clean-up or restructuring of the code has been done. Some automated transformations of the code are done in the shell script. Primarily to replace certain C constructs with C++ equivalents.
The web/tex.hpp
file should be all you need. Feel free to open Github issues on the project.