[texhax] Incorporating TeX into Custom-made Programs
Karl Berry
karl at freefriends.org
Mon Feb 27 02:40:07 CET 2006
Hello Daniel,
How do you suggest that I incorporate TeX symbols
into a graphical C program?
Displaying individual symbols would be doable by simply using the
freetype library to read the TeX math fonts and display characters from
them. However, I imagine you actually need to typeset significant
mathematical equations/formulas, which is a much harder problem.
The other replies mostly suggested creating a (La)TeX document and
processing it into a png/pdf/whatever, and displaying that. That seems
like the most expedient solution to me too.
However, I wanted to mention the (much) more difficult but (much) more
efficient solution of typesetting the math yourself. The algorithm is
described in Appendix G of the TeXbook, and of course the source is in
tex.web. It was also reimplemented in C++ by Luca Padovani for his
GtkMathView project, which applies TeX math typesetting to MathML input.
http://helm.cs.unibo.it/mml-widget/
By the way, we'd certainly welcome an article on your project (or the
others people have mentioned in this thread) for TUGboat, when the time
is appropriate. (http://tug.org/TUGboat)
Happy mathing,
karl
More information about the texhax
mailing list