How to get a specific variant of the greek symbol tau?

315 vues (au cours des 30 derniers jours)
Salman Khan
Salman Khan le 20 Jan 2020
Commenté : Salman Khan le 20 Jan 2020
Is there a way to get the following form of the tau symbol for matlab?
TpNxY.gif
I want to use this on the axis of a plot and currently I am using the following code to do this
xlabel('{\tau}').
However, this gives the following symbol, without any hook on the bottom
.
  2 commentaires
Sindar
Sindar le 20 Jan 2020
Matlab is kinda a pain when it comes to special characters. I can't figure it out, but someone else might be able to.
char(964) prints this symbol to the command line, but xlabel(char(964)) creates a different one.
The unicode character you want is U+1D70F (https://www.compart.com/en/unicode/U+1D70F) There should be a way to get this in Matlab (I would have thought '\x1D70F', but "Warning: The hex value specified is outside the range of the character set.")
Guillaume
Guillaume le 20 Jan 2020
Modifié(e) : Guillaume le 20 Jan 2020
Matlab is UTF16, so you need to convert that 32-bit unicode to UTF16
char([0xD835 0xDF0F])
Ironically, while matlab uses UTF16 internally, it doesn't officially support writing or reading UTF16. You get a warning if you try (yet it still appears to work).

Connectez-vous pour commenter.

Réponse acceptée

Guillaume
Guillaume le 20 Jan 2020
The latex symbol for this is \uptau, unfortunately matlab latex parser doesn't support it.
As Sindar commented, you can try to get around by using a unicode character instead. Indeed U+1D70F would be the correct symbol and assuming your default font supports it, it would be the way to go. Matlab uses UTF16, U+1D70F is [0xD835 0xDF0F]in UTF16:
xlabel(char([0xD835 0xDF0F])); %Requires R2019b or later. Earlier versions use: char([55349 57103])
Another option would be to find a font installed on your system that renders the normal tau, U+3C4, as you want. On my system, the Times font does the job:
xlabel(char(0x3C4), 'FontName', 'Times');
It's going to be trial and error for finding a suitable font. You can list the fonts available on your system with listfonts.
Note that the font does not affect latex of tex symbols.

Plus de réponses (0)

Catégories

En savoir plus sur Labels and Annotations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by