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

5 views (last 30 days)
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.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 3 Jan 2013
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');

More Answers (0)

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Products


Release

R2012a

Community Treasure Hunt

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

Start Hunting!