How can I get an upright mu in math with latex interpreter?

I want to display where mu is upright and not italic. Matlab renders the mu always in italic but I need it upright as my university requires it this way. Is there any way to do this?

3 件のコメント

John Petersen
John Petersen 2020 年 9 月 10 日
So italic i is okay, but not mu? How can the university require non-italics on a math term? Never heard of that before.
Walter Roberson
Walter Roberson 2020 年 9 月 10 日
If it does not need to be latex interpreter then possibly using 'i̅/μA' with interpreter tex or none would work ? That is
i U+0305 / U+03BC A

サインインしてコメントする。

回答 (1 件)

Robert U
Robert U 2020 年 9 月 11 日
編集済み: Robert U 2020 年 9 月 11 日

0 投票

Hi Philipp Rehlaender,
It seems, there is no straight-forward way to do that in matlab figures. Nonetheless, there are work-arounds that help to create a look-like:
Despite that you can create your text freely using unicode. Helpful is the wikipedia list of Unicode blocks. Signs above characters are known as Combining Diacritical Marks.
Writing your requested line in standard text font as axes label:
textbar = sprintf('\x0304'); % is not the bar but looks better, for correct "bar" use \x0305
textmu = sprintf('\x03BC');
fh = figure;
ah = axes(fh);
ah.XLabel.String = sprintf('%s/%s%s',append('i',textbar),textmu,'A');
Edit: That is, what Walter suggested in short.
Kind regards,
Robert

3 件のコメント

Philipp Rehlaender
Philipp Rehlaender 2020 年 9 月 11 日
Dear Robert U,
thank you for your good support. Your solution makes my text look very much alike. However, I still have one problem when exporting the figure. In the exported PDF File, my text font changes from Times to what looks like Arial. In the Matlab figure, everything looks fine though...
Robert U
Robert U 2020 年 9 月 11 日
Appearently, there is a problem in exporting directly to pdf which has been reported already 2016, and probably earlier: https://de.mathworks.com/matlabcentral/answers/301427-why-does-matlab-2016a-automatically-change-font-size-of-my-figure-when-i-save-it-as-pdf
A work-around is to use a vector graphics format, and convert to PDF later on: http://www.hargaden.com/enda/blog/different-fonts-for-matlab-plots-exported-to-pdf/
Kind regards,
Robert
Walter Roberson
Walter Roberson 2020 年 9 月 11 日
Note: Using unicode will unfortunately not work for Interpreter Latex .

サインインしてコメントする。

カテゴリ

製品

リリース

R2019b

質問済み:

2020 年 9 月 10 日

コメント済み:

2023 年 4 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by