Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
1  
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
show 2 more comments

2 Answers 2

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
add comment

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
add comment

Your Answer

 
discard

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.