How to implement new Latex Font in matlab?

조회 수: 51 (최근 30일)
Amelie
Amelie 2024년 3월 19일
댓글: Amelie 2024년 3월 23일
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