Creating a Popupmenu & UImenu with Interpreter 'Tex'

Hi,
I would like to incorporate 'tex' string in a UIControl popupmenu.
I know that UIControl does not support 'tex' or 'Latex' interpreter, however is there a way to cast a text or annotation object
so it can be used as the string property of my UIcontrol Object?
Otherwise, does anyone has a suggestion about how one might go about creation a popupmenu-like UI object that would be able to interpret my strings as 'tex'.
(I have the same question about UIMenu?)

 Accepted Answer

uicontrol() objects (which are only for "traditional" figures) use Java underneath. The details of what they use depends upon the kind of control. uicontrol 'edit' and 'text' are handled a different way than radio, push, check, popup, and listbox, and all of the second group accept HTML 1.1 (but not later). For example,
h = uicontrol('style','pop','string', {'<HTML>A<sub>B', '<HTML>P&#140;Q'})
Sometimes encoding in HTML is good enough .
In cases where it is not good enough, then you need to go down into the Java objects and change them. http://undocumentedmatlab.com has relevant code.

2 Comments

Hi Walter!
Thank you for your quick response! I'll give that a shot!
Also realized that much of the latex characters that I want to used can be created
in strings using char and the right unicode! Along with the HTML That should be enough for my purpose!
Thanks a ton!
Unfortunately, the HTML 1.1 used underneath uicontrol does not handle a lot of unicode.
I gave an example of coding with HTML character entity number, the &#140; example. You can also use named entities -- but again be aware that it does not support nearly as much as people would like.

Sign in to comment.

More Answers (0)

Categories

Find more on App Building in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!