1

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.

p.s.: I redirected this Question from http://tex.stackexchange.com

  • 1
    Yes, matlab export is totally insane. It renames all the fonts you use to helvetica with a prefix so that its 100% sure that no font can be found. This is totally braindead... You need to edit the file so that the fontname is correct. – joojaa Feb 27 '15 at 11:07
  • @joojaa good to know it is fixable. – Troy Woo Feb 27 '15 at 12:59
2

If anybody in the future encounters the same problem, please read this:

After a lot of trial, I came to the conclusion, that it is probably the best to use matlab2tikz or pgfplots. The link that @Dolphin posted in his comment [in the above linked thread!] leads to a handy extension of Inkscape, which fulfills its purpose. All the text in the matlab figures got recognized. The problem is the export from Inkscape later on. You could use .eps or even the .pdf export, which works as in this video. The problem is, that you have to ajust all the axistiks, labes and legend entries manually. This is ok for figures with less text, but inappropriate for scientific figures with many data (numbers and legends).

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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