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

31 views (last 30 days)
Andreas
Andreas on 30 Sep 2021
Commented: Andreas on 30 Sep 2021
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:

Answers (1)

dpb
dpb on 30 Sep 2021
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 Comment
Andreas
Andreas on 30 Sep 2021
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.

Sign in to comment.

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!