How to implement new Latex Font in matlab?

56 次查看(过去 30 天)
Dear all,
although this question has been asked in previous forum posts, I have to ask again because I still have problems in implementing a new Latex Font in matlab. I would like to use the font "Gyre Pagella" (font package name: tgpagella; font code: qpl) for the labels of my figures. After I downloaded the font and adjusted folders, matlab still doesn't report Gyre Pagella with the command listfonts.
Does anyone has an idea what I have to do to be able to use this font ?
Many thanks for your help !

采纳的回答

Angelo Yeo
Angelo Yeo 2024-3-20
I don't think MATLAB checks text object's FontName properties. I can only find that MATLAB supports Sans Serif and Roman fonts though.
text(0.5, 0.8, '\textsf{sans serif}','interpreter','latex');
text(0.5, 0.7, '\textrm{roman}','interpreter','latex');
text(0.5, 0.6, '$$\mathsf{math\,\,mode\,\,sans\,\,serif}$$','interpreter','latex');
text(0.5, 0.5, '$$\mathrm{math\,\,mode\,\,roman}$$','interpreter','latex');
You can reach out to Technical Support to request an enhancement on FontName check for LaTeX.

更多回答(1 个)

Walter Roberson
Walter Roberson 2024-3-20
There is no way (documented) to add latex fonts to most of MATLAB. There used to be an obscure way it could be done, but that way disappeared a number of years ago.
If I understand correctly, it is possible to add latex fonts for Report Generator use.

类别

Help CenterFile Exchange 中查找有关 MATLAB Report Generator 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by