Insert "epsilon dot" in a figure title with tex interpreter (not latex)

조회 수: 17 (최근 30일)
Andreas
Andreas 2021년 9월 30일
댓글: Andreas 2021년 9월 30일
Hi, is it possible to insert "epsilon dot" in the title of a figure and keep the Helvetica bold font?
Alt 1: This produces the text correctly, but not helvetica+bold
figure
title(['Stress vs. Strain @ $\dot{\varepsilon}$ ',num2str(erat),'$s^{-1}$'], 'Interpreter','latex')
Result:
Alt 2: This does not interpreat the text as I want it (but I get the wanted font :) )
figure
title(['Stress vs. Strain @ $\dot{\varepsilon}$ ',num2str(erat),'$s^{-1}$'], 'Interpreter','tex')
Result:

답변 (1개)

dpb
dpb 2021년 9월 30일
No; the MATLAB implementation of TeX uses the defined special characters and the limited modifiers of ^ and _ for super/subscript; it doesn't implement the LaTeX {} notation to allow the modifier to be applied to a selection.
title(['Stress vs. Strain @ \epsilon ',num2str(erat),'s^{-1}'], 'Interpreter','tex')
is as close as it gets, sorry.
As for LaTeX, there's been angst over its use with font packages for 20 years that afaik has never been able to have been resolved; I've given it up as lost cause not knowing much at all about LaTeX, anyways.
You can get a bold font with text as
title(['$ \textbf{Stress vs. Strain}$' ], 'Interpreter','latex')
but I don't know how to or if you can get the math stuff to be interpreted at the same time...good luck, you'll undoubtedly need it and a lot of delving.
  댓글 수: 1
Andreas
Andreas 2021년 9월 30일
Thank you @dpb. That was pretty much what I understood from other realted questions on this forum. But I thought it was worth a chance. I think I can live with the "latex font" :) It does not catch the eye as good as the default, but again, it's not the end of the world.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by