You all probably know sm. It is a small tool that takes your input and puts it on your screen in nice, big letters (unless you use -n "comic sans" or something…). So I wanted to do the same for LaTeX. As you probably also know, I don’t know Python or GTK (or practically anything, for that matter), so good old Bash had to come to the rescue.
sx reads your input, puts it into a temporary file with some templaty stuff around it, calls pdflatex and pdfcrop and then a pdf viewer to show you the PDF. As soon as you close the viewer, you can enter another expression. Your old expression will be saved till then. You can also use a fancy configuration file ~/.sx to define the default template or some other things, such as the default PDF viewer, wether or not to show a date, save the history to a file etc.
It doesn’t allow you to ‘scroll’ back in history using the arrow keys. It hopefully doesn’t blow up your computer.
You can download a nice small archive here. You can also do whatever you want with this code (see license inside the archive for further information). If you want to contact me, feel free doing so using the addresses supplied within the archive or one of those found here. I would very much like to hear from you if you reimplemented or packaged this ☺. There is also a screencast (OGV, 100s, 7.1 MiB) available.
It really takes a long time to compile a .tex file, even on modern hardware. So wrt speed, the best improvement to this would be to get rid off pdflatex and pdfcrop and instead maybe use mimetex or something like that. Plain latex together with dvipng might also be suitable, but one would have to display and scale the image then. As I said, feel free to rewrite it :)