I am wondering how the MATLABs latex interpreter for plot text deals with Unicode characters? This is strangely inconsistent. Which, you know, invalidates the entire Unicode endpoint.
TOY CODE
%*** Setup some text for a plot title
Title_Txt{1} = [char(8734) ,' SNR~~~' , char(10) , '(-)'];
Title_Txt{2} = ['50 SNR~~~' , char(10) , '(-)'];
%*** Plots!
x= 1:1:10
y= rand(size(x))
figure(1)
subplot(211)
plot(x,y)
title(Title_Txt{1} , 'interpreter' , 'latex')
subplot(212)
plot(x,y)
title(Title_Txt{2} , 'interpreter' , 'latex')

The toy code demonstrates that the latex interpreter processes char (10) --- a new line. But it is interrupted by char (8734) --- the symbol of infinity.
Obviously, I can get around this by giving a latex symbol that Matlab knows (another source of frustration, but this is for another discussion), but I'm curious about
- What does MATLAB do under the hood here?
- is there a fix for getting unicode in latex?
source
share