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

247 次查看(过去 30 天)
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 个评论
Sindar
Sindar 2020-1-20
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 2020-1-20
编辑:Guillaume 2020-1-20
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).

请先登录,再进行评论。

采纳的回答

Guillaume
Guillaume 2020-1-20
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Labels and Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by