# Use Matlab 2014b figures (via Inkscape) in pdfTeX

I know there are many threads related to this topic, but I still could not find a satisfying solution.

Summary Matlab 2014b figures -> export as .eps or .svg -> load into Inkscape (problem is in here: text is not recognized) -> use Inkscpe to save as .pdf_tex -> use in scrreprt document (pdfTeX)

The goal: I want to use different Matlab 2014b plots in a scientific paper. Within those plot I want to use the same LaTeX font as it is used in my scrreprt document.

The problem: When I export or print the Matlab figures as .eps or .svg (possible in 2014b) it is not possible to use the document font (type and size) or access the text (labels, axisticks) Inkscape.

What I've done so far: I used matlab2tikz. This lets me access the plot with the "correct" font. But it does not create the results I want to have. This thread mentions a related problem.

I greated some figures in Inkscape (.svg) and used the export method which provides .pdf_tex files. Then I used \input to include them into the to the document. This works very well ("correct font and nice quality"), so I want to use this method, but in the first place I need to print/export the figures in a way that lets Inkscape read the text as text and notas pixels in a picture.

What is definitely not desired Setting the Matlab figure 'Interpreter' to 'Latex' looks nice in the figure, but is useless when including it into a latex document

I appreciate any help. Thanks in advance.

Edit: Due to a comment, I also posted the question here.

• Have you considered exporting only the data (.csv or something), read this data with tikz and create a nice plot from within latex (tikz)? – Steffen Feb 27 '15 at 8:33
• I've done some pretty complicated pictures with `matlab2tikz`. What's the problem in your case? – Habi Feb 27 '15 at 8:36
• Thanks for your quick replies. The problem is, that I always have to tweak the beginning of the x-axis, because the plotted line is different in tikz. Another problem is, that tikz always draws the box around the legend, what has to be removed manually. @Steffen I did not consider yet. But since I need many figures, I am scared of doing it manually, plus I am really new to tikz – Das Muratorium Feb 27 '15 at 9:03
• pgfplots can have global settings that can be set once and you would have them applied to all plots in your document. See Section 4.3.7 Importing graphics in the pgfplots document. – percusse Feb 27 '15 at 9:13
• The problem of Inkscape not recognizing the text in a Matlab-generated file is, I fear, completely off-topic for this site. – Torbjørn T. Feb 27 '15 at 9:15

After a lot of trial, I came to the conclusion, that it is probably the best to use `matlab2tikz` or `pgfplots`.
Another much easier solution is: don't use LaTeX in Matlab 2014b to label your axis. For example, you cannot have any thing like `x_1^*`. If you use only plain text in Matlab, then when you save the file to SVG, the text will be kept. You can then edit the `.pdf_tex` file generated by Inkscape to show the correct label. This is of course due to the bug of the `figure-to-svg` engine in Matlab 2014b. It simply cannot recognize LaTeX as text.