Why is the latex font not selectable in eps export?

15 ビュー (過去 30 日間)
Marius Brinkmann
Marius Brinkmann 2017 年 7 月 18 日
コメント済み: Samuel Estenlund 2024 年 2 月 16 日
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
Dimitrios Piretzidis 2023 年 2 月 25 日
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 Center および File ExchangePrinting and Saving についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by