How do I fix broken LaTeX commands where it fails to render '\pm' in MATLAB 7.14 (R2012a)?

5 次查看(过去 30 天)
I am unable to execute latex command properly in MATLAB 7.14 (R2012a).
An example of LaTeX code is as follows:
figure; axis;
title('This is a \pm ± test')
LaTeX command '\pm' fails to render.

采纳的回答

MathWorks Support Team
This issue can be resolved by setting interpreter to TeX.
To find the interpreter settings, execute the GET command as shown in example below:
h = title('This is a \pm ± test');
get(h,'interpreter')
The ouput should show 'latex', 'tex' or none. The output of above command should be ‘tex’ to render properly. If not, use the SET command to change interpreter setting to TeX as shown in example below:
set(h,interpreter,tex)
Note that the output of LaTeX command '\pm' under MacOS environment with UTF-8 setting does not render properly.
As a workaround, execute following code:
pm = char (177);
figure;axes;
h = title (['This is a ' pm ' ± test');

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

产品


版本

R2012a

Community Treasure Hunt

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

Start Hunting!

Translated by