San-serif \mathsf and \textsf are not supported when using interpreter latex (in Matlab R2022a)
25 次查看(过去 30 天)
显示 更早的评论
When I run the following example, in which I use (1) \mathsf (2) \textsf and (3) interpreter latex together,
plot(rand(3,10));
ylabel('$\mathsf{\stackrel {.}{K} / units}$', 'Interpreter', 'latex','fontsize',20);
text(1.5, 0.8, '\textsf{sans serif}','interpreter','latex','FontSize',20)
text(1.5, 0.6, '$$\mathsf{math\,\,mode\,\,sans\,\,serif}$$','interpreter','latex','FontSize',20)
I get these warning/errors, and the san-serif texts are not correctly displayed in my plot:
Warning: Error updating Text.
Font cmss10 is not supported.
Warning: Error updating Text.
Font cmss10 is not supported.
Warning: Error updating Text.
Font cmss10 is not supported.
How can I correclty visualise/display my texts that include \mathsf and \textsf, and remove the warning/errors ?
Note: my Matlab version is R2022a.
6 个评论
dpb
2022-8-29
编辑:dpb
2022-8-29
I understand entirely the publication-ready issues(*) -- unfortunately, MATLAB doesn't always provide sufficient facilities(**) to do that with graphics--it's a recognized shortcoming in the user community that to date doesn't have a totally satisfactory solution. TMW has made some improvements, but it appears (from the outside looking in with no inside knowledge at all) that the difficulties with the HG2 (shorthand for "handle graphics V2", the base graphics rendering package inside MATLAB) are so embedded and deep that there simply aren't resources enough considered expendable to try to start over and build such a system--things that can be patched up or added occasionally make improvments, but to me it appears a whole fresh start would probably be required to be able to have a clean-enough code base to be able to remove many of the deeply-embedded warts.
Again, this is just surmise based on observation of what has transpired over some 30+ years.
(*) I'm such an old fogey that my publications days were from well before having such layout tools; everything still went on the hardcopy mats by typewriter and pen and ink -- no electronic transfer back then! Beyond that, technical presentations and conference proceedings never had such stringent publication rules as did the formal journals or the University "Thesis/Dissertation Scrutinizer Czar" who had the final arbitration over whether the format followed guidelines sufficiently well or not. That was typically more difficult a hurdle by far to pass than were the actual orals or research itself.
(**) There is also a "veritable plethora" of Q? on the forum about exporting graphics to pdf and then trying to finish cleaning up with the pdf file to meet publications' form criteria. That also doesn't always work as users may desire.
采纳的回答
Abhishek Chakram
2023-9-22
Hi Sim,
It is my understanding that you are facing difficulty in setting up San-serif \mathsf and \textsf in y-label of the plot function, you can refer to the following MATLAB answer for the same: https://in.mathworks.com/matlabcentral/answers/546197-how-can-i-apply-font-options-when-using-the-latex-interpreter-in-matlab
Best Regards,
Abhishek Chakram
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Labels and Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!