Display LAtex Equation in gui static text

Hello all,
i wanna display some equations on static text , i just followed https://in.mathworks.com/matlabcentral/answers/213123-how-to-insert-latex-equation-into-static-text-plot-in-gui#answer_176422. to test its running . i have attached the code,
but when i try to generate same output using uicontrol its not working showing' intrepreter properties is not available'
this is my code
h41 = uicontrol(...
'Parent',Test,...
'FontUnits',get(0,'defaultuicontrolFontUnits'),...
'Units','normalized',...
'HorizontalAlignment','left',...
'String','TEST_{Equation}',...
'Style','text',...
'interpreter','latex',...
'Position',[1 0 2 1],...
'Children',[],...
'Tag','text2');
thanks in advance

 Accepted Answer

Walter Roberson
Walter Roberson on 11 Feb 2019
Edited: Walter Roberson on 11 Feb 2019
This is not possible .
uicontrol style text and edit cannot have any kind of interpretation at all, with the exception that the | character might mark the end of a row.
Some of the other kind of uicontrol will render fairly old HTML.
None of the uicontrol support latex or tex.

5 Comments

Hello Walter,
Thanks for your response , but is there any way to display equations in static text, instead of images
No. uicontrol style text is completely unable to do that.
Some of the uicontrol (such as radiobutton) can have CData set, in which case the given image will appear instead of the typical drawing for the control. This would, however, still require that the equation be rendered to array before it could be displayed.
This issue has been accounted for in MATLAB versions later than 2021b.
Check out this related answer: https://www.mathworks.com/matlabcentral/answers/726888-how-to-write-latex-in-gui-s-label
uiedit and uitext support some things that uicontrol never did

Sign in to comment.

More Answers (0)

Categories

Find more on Printing and Saving in Help Center and File Exchange

Products

Release

R2018b

Community Treasure Hunt

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

Start Hunting!