TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to use matlab plots in my ConTeXt document, but preprocess them in Inkscape. I wonder if there is some recommended workflow.

So far what I'm doing is this:

  1. save matlab figure as 'fig', so I can reuse the figure in matlab. Just in case
  2. use plot2svg to create a SVG from matlab (actually I've patched the original to gzip the svg.)
  3. edit plot in Inkscape
  4. Here is one of my problems: use edited plot ConTeXt

I'm using MkII (pdfTex), since I have had some problems(with layout, no euler font and others) with MkIV(which actually supports SVG) and I think it is still beta.

I want to import the gzipped SVG directly in my ConTeXt document, but see no way how to import the document. The method mentioned in the wiki does not work either. Is there a way to convert the file automatically with Inkscape to e.g. pdf?

Maybe my workflow is not the best for the task, so I also wonder if there is a better way to create, edit and use figures/plots in my documents.

share|improve this question
What sort of edits do you do with Inkscape? It's difficult to make suggestions without knowing this. – Tomek Jul 12 '11 at 22:45
It depends. Removing lines (e.g. Axes), adding arrows to the end of the axes, adding text, change color/style/line-width of plots, adding arrows with annotations, putting plots together (with additional text, lines, arrows, whatever). – urso Jul 13 '11 at 8:48
Off topic: Euler works seamlessly with MkIV. Just use Neo Euler OpenType Math fonts. – Aditya Jul 19 '11 at 15:24
To use an SVG image in ConTeXt, you have to convert it to pdf. MkIV does the conversion for you (using inkscape). If you want to do the same in MkII, you can tweak the example on the ConTeXt wiki – Aditya Jul 19 '11 at 15:26
Since you are editing the SVG in Inkscape anyway, why you don't just save it as PDF (which is what MkIV is doing behind the scenes), – Khaled Hosny Jul 26 '11 at 18:13

Partial answer: to convert an image from SVG to PDF using Inkscape, you can use this command line:

$ inkscape --export-pdf=<image>.pdf <image>.svg
share|improve this answer

It might improve the pdf generation process if using Ipe and a related tool svg2ipe. I would strip down all the plot details (Axis, legend etc.) and leave only the data and then ship it to Ipe and modify things over there. (A little bit of a personal thing though)

Other than saving my life a few times I think the natural Latex support is quite handy. For the experts of Lua, one can dive right in to the inner core. But how I wish it could read .eps files generated by Matlab or even .fig files.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.