Added latex rendering code so facts and proof texts are rendered correctly.
The most recently rendered image is remembered and not rendered again.