Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LaTeX type rendering with pygame

I am trying to read text with LaTeX formatting and render it using pygame. I am a novice to pygame and any help will be appreciated.

I looked into Glyph package. The problem is that I would have to rewrite all my .txt files in Glyph formatting for them to be useful. If I try and define macros I would essentially have to build a LaTeX translator. Both these options don't seem very practical considering the number of text files I have.


2 Answers

You could render LaTeX via matplotlib and use these figures in PyGame as sprites.

http://matplotlib.sourceforge.net/users/usetex.html

like image 78
atomocopter Avatar answered Feb 24 '26 13:02

atomocopter


Check out pylasem (yes, it says MathML rendering library, but it also supports a subset of Latex) or lasem itself via gobject-introspection.

like image 24
plaes Avatar answered Feb 24 '26 13:02

plaes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!