Mobile app version of vmapp.org
Login or Join
Cooney243

: 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

@Cooney243

Posted in: #Fonts #Inkscape #Latex

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 tex.stackexchange.com

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Cooney243

2 Comments

Sorted by latest first Latest Oldest Best

 

@Hamaas979

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.

10% popularity Vote Up Vote Down


 

@Vandalay110

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).

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme