LaTeX interpreter but sans-serif font on figures

52 ビュー (過去 30 日間)
LeChat
LeChat 2018 年 11 月 13 日
コメント済み: LeChat 2022 年 8 月 18 日
Hi,
On LaTeX I often use the
\usepackage{cmbright}
font when I want to have a clean, sans-serif font both in the text and in the mathematical formula I write.
In order to have an homogeneous result between my figures and the text, I would like the text in my figures (labels, axis ticks, title, annotations...) to be as well in this font.
Unfortunately so far on Matlab, when using the LaTeX interpreter, only the default font is available. I would like to be able to write both text and mathematical formulas in a sans-serif font (and the same for both text and math) on the figures I plot.
Is it possible?
I am on Mac OS 10.14.1 (Matlab 2018a) and also on Ubuntu 18.10 (Matlab 2018b).
Thank you for your help!

回答 (1 件)

Prakhar Jain
Prakhar Jain 2018 年 11 月 16 日
Hi LeChat,
In order to change font for any text object you just need to set the 'Interpreter' property to 'latex'. As shown below:
xlabel('$$\int_0^x\!\int_y dF(u,v)$$','Interpreter','latex');
If you want to have tick labels also follow link below:
Also, there are files available for the same. This is one of them.
Hope this helps.
Thanks.
  4 件のコメント
Marshall Styczinski
Marshall Styczinski 2020 年 9 月 30 日
編集済み: Marshall Styczinski 2020 年 9 月 30 日
This is Matlab in a nutshell. It does everything, but it does nothing well.
I have the same problem, and I have been researching a solution to this problem for several hours. Add one to the list of reasons I will continue to push my collaborators to move to other languages/platforms. It ends up being easier to mate multiple other languages than to try to get Matlab to do the one thing I need well enough.
LeChat
LeChat 2022 年 8 月 18 日
Hey Marshall, so since your last message, what have you been using (languagewise) instead of Matlab? They recently changed the my to remove outlayer data in the cftool fitting tool (R2022a) so I am thinking of switching to something else too if this does not get corrected in the coming Matlab versions.
In any case I usually "polish" the cosmetic of my graphs in Inkscape so this my workaround regarding LaTeX font issue... as you say, not the best, but so far it does it :) Cheers!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by