2

I'm writing a python library to solve various physics equations, and would like to add a method to each equation to display the equation formatted in LaTeX. I thought about using a LaTeX to PNG converter, and then somehow displaying the image in-line with the terminal, which led me to trying to figure out displaying images in the terminal, to no avail. If it makes things simpler, I mainly use IPython, and wouldn't mind if it only worked in that.

If there really is no way to display images in-line, then I could always just display them in a window, but that wouldn't be nearly as clean.

Sotanaht
  • 167
  • 2
  • 8

2 Answers2

4

This excellent ipython talk from PyCon 2012 has a demonstration of converting equations (algebraic) to their graphical representations and displaying them inline and could possibly help you figure out how to do the same for your physics equations.

Burhan Khalid
  • 169,990
  • 18
  • 245
  • 284
  • See also the tutorial from the same conference http://pyvideo.org/video/605/ipython-in-depth-high-productivity-interactive-a – Andrew Walker Mar 18 '12 at 06:02
2

Not exactly a terminal, but the ipython notebook interface is capable of doing this already.

One of the PyCon2012 sprints was on writing notebook converters to and from a number of text formats, so if you can't conveniently do what you're trying to do yet, expect it soon.

Andrew Walker
  • 40,984
  • 8
  • 62
  • 84