Archive for February 9th, 2010

Inkscape + LaTeX? (Textext)

Okay, I’m being really indecisive here… but I finally found one that I think I like (so far).  It’s not perfect, and it’s a bit quirky, but at least I managed to do what I need to do.  Here’s the main website:  http://www.elisanet.fi/ptvirtan/software/textext/. I also found this blog post to be helpful.

I tried making a really simple depiction of Snell’s law, basically showing the relationship between the angles of incidence and refraction and the refractive indices of two layers. In this case, it is sound waves travelling through homogeneous layers of water with different sound speeds. Easy peasy :-) The sketch only took me about 15 minutes to create.

All I had to do was go to Extensions –> textext, set the scale to 2.5, and enter the following text into the box:

\begin{minipage}{5cm}

$\frac{c_{i}}{\sin{\theta_{i}}} = \frac{c_{i+1}}{\sin{\theta_{i+1}}}$

\end{minipage}

Yes, it’s sort of annoying to have to add that \begin{minipage} stuff. I’d much rather have it more behind the scenes, but I suppose that does give you more control. The resulting image looked like this:

So, nothing too special, but it’ll work for now.  I’ll keep an eye out for other options, but I am getting to really like Inkscape, so maybe I’ll stick with it.  There might be other Latex plugins too that work better.  This one is convenient because you can re-edit an equation once it’s been entered.  If it’s a complicated equation, it can be a real pain to re-type the whole thing if there’s only one little mistake.

One more thing I ought to mention: I keep getting this error message. I’ve been basically ignoring it because I’m getting the correct output, but Inkscape is clearly not happy with something:

/home/michelle/.config/inkscape/extensions/textext.py:55: DeprecationWarning: the md5 module is deprecated; use hashlib instead
import os, sys, tempfile, traceback, glob, re, md5, copy

PS: Why did I abandon SketchLatex so quickly, when it seemed so promising this morning? Simply because their website was down. Anyway, the Skencil GUI was a bit old-fashioned Unix-y anyway. That alone would not have stopped me from using it, but combined with other difficulties it becomes a problem. Hence going back to Inkscape
PPS: The only Inkscape drawing I’ve ever done was my little star website icon (see it up there? the purple star on the blue background?)

SketchLatex for equations in Skencil

I’m going to give the SketchLatex plugin a try for adding equations to my diagrams in Skencil. It seems like it’s pretty easy to install and use – the plugin consists of two .py files which just need to go into the Skencil plugin directory.  Once it’s installed, I should be able to go edit –> create –> LaTeX text, and a dialog will come up where I can input the TeX stye equations.