Search code examples
matlablatexmatlab-figure

Bold Greek letters in matlab latex interpreter


I tried using bold font for the Greek letters in my axis labels in Matlab but they don't seem to work.

For example:

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

I've tried other commands such as \bf but still it doesn't work.

Does anyone know how to get around this?

Thanks!


Solution

  • Use equation notation (as you would need in LaTeX) $$ and \boldmath

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

    \boldmath will make bold everything in the next equation after it, so if you want only only partly bold, then separate the equation

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

    If you want multiple things bold, the same. Separate the equation and add a \boldmath before each bold section.