matlab乳胶解释器中的粗体希腊字母

Bold Greek letters in matlab latex interpreter

我尝试在 Matlab 中的轴标签中为希腊字母使用粗体,但它们似乎不起作用。

例如:

xlabel('\mathbf{\rho}','Interpreter','latex')

我尝试了其他命令,例如\bf,但仍然无效。

有人知道如何解决这个问题吗?

谢谢!

使用等式符号(在 LaTeX 中需要)$$\boldmath

xlabel('\boldmath$\rho$','Interpreter','latex')

\boldmath 会在它后面的下一个等式中将所有内容加粗,所以如果你只想要部分加粗,那么将等式分开

xlabel('\boldmath$\rho$ $_i$','Interpreter','latex')

如果你想要多个加粗的东西,一样的。分开等式并在每个粗体部分前添加一个 \boldmath

您可以使用 mbox 将所有内容都放在一个方程式中。 Source

xlabel('$\sqrt{\mbox{\boldmath $\rho$}_i}$', 'Interpreter','latex')