Why is the latex font not selectable in eps export?

13 次查看(过去 30 天)
Hello,
I want to import my MATLAB plots in LaTeX. The text is selectable if I use the default interpreter, but the sans serif font doesn't look great in my thesis.
The latex interpreter produces a nice output, but the text isn't selectable. I tried using matlab2tikz, but the output doesn't look great neither.
Are there different functions which export the text in a tex file like Inkscape does it, or is it possible to make the latex font selectable?

回答(4 个)

clvk
clvk 2017-11-1
I have the same issue after changing to a Windows 10 pc, both with MATLAB 2016b and with 2017a.
My scripts have always produced figures with selectable text once saved, exported or printed to EPS or PDF. With windows 10 / 2016b the text has become outlined and can no longer be selected. Also Illustrator does not identify the objects as text.
Manually overriding the renderer to Painters makes no difference. The OpenGL renderer obviously produces a bitmap output.
Does anyone know what has changed in the recent releases, or if some fonts could be missing in my present Windows 10 setup?

Dimitris Iliou
Dimitris Iliou 2017-7-27
If I understand correctly, you are just trying to change the fonts in your plots. To do that, you could try and change them using the axes properties.
Specifically, assuming you have the handle ax of the axes, you could type
ax.FontName = 'Cambria';
That will replace all the fonts of the current axes (ticks, labels, title, etc).
You can find more information on how to modify the Fonts on the axes in the following documentation link:
  2 个评论
Marius Brinkmann
Marius Brinkmann 2017-8-1
Thank you, but I want to export the figure as it looks in MATLAB. The pdf-export looks like desired too, but the text isn't selectable, so I cant use ctrl-f to find text in the figure.
So I want to embedd the latex interpreter font in the export.
José-Luis
José-Luis 2017-8-1
What format are you using to save your figures? If it's a bitmap format, then you can't modify the font afterwards.
If it's vector graphics, depending on the actual format, it might be possible to do so afterwards, although it could be mighty difficult.
I am not really understanding what you are trying to achieve. It's easier to generate your plots as you want them than to try to modify them afterwards. That's just begging for a world of hurt.

请先登录,再进行评论。


Alp Acem
Alp Acem 2018-3-12
You can use 'tex' interpreter instead of 'latex'. It works for me for selectable text in pdf.
  1 个评论
Samuel Estenlund
Samuel Estenlund 2024-2-16
That does make the text selectable, yes. However, one reason for using the latex interpreter is that it enables exporting figures with other fonts and that does not work with the tex interpreter.

请先登录,再进行评论。


Dimitrios Piretzidis
I have the same issue with MATLAB R2020b. As soon as I change the axis and legend interpreter to Latex, the text in the exported eps file is not selectable. export_fig did not help and matlab2tikz heavily changes the figure specs. Has anyone resolved this issue?

类别

Help CenterFile Exchange 中查找有关 Graphics Object Properties 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by