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

22 vues (au cours des 30 derniers jours)
Andreas
Andreas le 30 Sep 2021
Commenté : Andreas le 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:

Réponses (1)

dpb
dpb le 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 commentaire
Andreas
Andreas le 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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Graphics Object Properties dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by