Greek symbols (esp. µ) not italic

295 views (last 30 days)
lee
lee on 30 Oct 2014
Commented: Jiarui Kang on 16 Sep 2022
I want to use the greek "mu" to be displayed non-italic. Example: ylabel('c [\mu mol/l]')
Is there any easy solution to this problem?

Answers (4)

Kenneth
Kenneth on 9 Feb 2017
Simply copy past the mu "µ" in your text like >> ylabel('c [µmol/l]') works perfectly fine in Matlab 2016a

Sean de Wolski
Sean de Wolski on 30 Oct 2014
Use the 'tex' interpreter instead of the latex one:
>> xlabel(['c_{O2} [',char(181),'mol/l]'],'Interpreter','tex');
  1 Comment
lee
lee on 30 Oct 2014
Thank you for your replies, but still it doesn't solve the underlying problem that you can't use the latex interpreter with non italic greek symbols.
From your answers I have implemented this workaround since I wanted the variable to be italic and the rest to be "normal":
ylabel(['\it{c}\rm{_{O2}} [',char(181),'mol/l]']);

Sign in to comment.


Mattias Flygare
Mattias Flygare on 24 Jun 2021
Comments that suggest using unicode mu and tex interpreter do not always offer a good solution. For many reasons, one might have to use latex interpreter, and a solution for upright mu within the latex interpreter is still needed, as the unicode mu is not supported there.
My workaround was to use the latex interpreter to set the text, but with a space instead of the mu, and then insert the mu with tex interpreter "manually" where the space is. Needless to say this solution is not ideal...
  2 Comments
Jérôme
Jérôme on 26 Jul 2022
Could you please detail how you "insert the mu with tex interpreter "manually" where the space is" after having inserted the text with the latex interpreter?
Thanks
Mattias Flygare
Mattias Flygare on 27 Jul 2022
I believe I used the text command together with the tex interpreter and then trial and error to find the correct x and y coordinates to place the mu in the space I previously left for it. Hope it helps!

Sign in to comment.


Star Strider
Star Strider on 30 Oct 2014
See if replacing ‘\mu’ with char(181) does what you want. (This applies to US-ASCII character maps. If you have a different one, you may have to search for it.)
  2 Comments
lee
lee on 30 Oct 2014
This solves the problem stated above, but now I would like to set the Interpreter to 'latex'.
Solution with 'tex': ylabel(['c[',char(181),'mol/l]']) -> works
Solution with latex: ylabel(['$c_{O2}$ [',char(181),'mol/l]'],'Interpreter','latex'); -> doesn't work
The second approach is not working since the latex interpreter can't read the µ.
Is there any other solution to this modified problem?
Star Strider
Star Strider on 30 Oct 2014
I haven’t used LaTeX in years, so I had to go searching. It seems that according to the latest documentation, in LaTeX, \mu also produces an italicised symbol.
My suggestion: Go with Tex and char(181).

Sign in to comment.

Categories

Find more on Labels and Annotations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!