Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: greek symbols in GUI
Date: Tue, 30 Oct 2007 00:22:23 +0000 (UTC)
Organization: TACT Computer Systems Ltd
Lines: 35
Message-ID: <fg5tfv$7l6$1@fred.mathworks.com>
References: <fg0dqh$lt9$1@fred.mathworks.com> <fg0l33$b7u$1@fred.mathworks.com> <fg1mnr$foh$1@fred.mathworks.com> <see-5CACE8.09253028102007@71-129-133-66.dollamir.com> <fg2lgl$ses$1@fred.mathworks.com> <see-742449.18305228102007@71-129-133-66.dollamir.com> <fg5fia$epv$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1193703743 7846 172.30.248.37 (30 Oct 2007 00:22:23 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 30 Oct 2007 00:22:23 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 642467
Xref: news.mathworks.com comp.soft-sys.matlab:435167



"Jonas " <joslaa02@student.umu.se> wrote in message
<fg5fia$epv$1@fred.mathworks.com>...
> But what about a letter in normal size plus a subscript. 
> For example to get a title for a plot with subscripts one 
> would write
> 
> title('E_\theta');
> 
> So is there any simple way of doing this for a GUI control 
> such as in a static text? Or is this really a limitation in 
> GUI controls?

You can use an undocumented feature of all Matlab
uicontrols, which is the fact that they use underlying Java
Swing controls, and these in turn accept any valid HTML
strings. So you can do the following for example:

uicontrol('string','<html><b>1<sub>2</sub>3<sup>4</sup>5</b></html>')

This is equivalent to the tex string '\bf1_23^45\rm'. You
can set font faces, colors, sizes, bold/italic and any other
valid HTML 3.0 property. It's limited, but should do the
trick in most conceivable cases.

The same is true for tooltips, by the way: try setting
multi-line (<br>) multi-colored (<font color="red"> ...
</font>) tooltip once and you'll never use the standard
boring single-line black tooltip again...

And just in case you were wondering - yes, it also works for
menus, listboxes etc.

Yair Altman
http://ymasoftware.com