Why is the latex font not selectable in eps export?

조회 수: 18 (최근 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 CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by