# How to use a cases environment (in math mode) inside textext/inkscape?

I am using the textext extension to Inkscape to insert LaTeX into my figure. I am trying to insert a mathematical equation in which I need a cases environment, but when I put a:

$$f(x) = \begin{cases} x & x>0, \\ 0 & \textrm{otherwise}, \end{cases}$$


I get a bunch of errors from textext, like ! Misplaced alignment tab character &.. How can I fix this? The example screenshot on the textext website has a cases environment, so it has to work somehow.

• You've probably hit upon this: Problem compiling cases environment Edit the preamble file to include \usepackage{amsmath}, – Torbjørn T. Feb 18 '15 at 15:00
• @TorbjørnT. I saw that textext has a Preamble file option, but I don't know how to use it. Exactly what does this preamble file contain? – becko Feb 18 '15 at 15:15
• By default, maybe nothing, I don't really know. You would put stuff that normally goes in the preamble of a LaTeX document (such as \usepackage{amsmath}) in it. – Torbjørn T. Feb 18 '15 at 15:17