Html code used along with Matlab
4 次查看(过去 30 天)
显示 更早的评论
I have recently found that Matlab can use LaTeX character sequences. However, they only can be used by the functions text, title, xlabel, ylabel and zlabel. I have designed a GUI in which has an uitable. Its header is a string that uses HTML code and looks like this:
header = {'<center>Component X<br />(km/s^2)</center>', ...
'<center>Component Y<br />(km/s^2)</center>', ...
'<center>Component Z<br />(km/s^2)</center>'};
My intention is replacing s^2 with s squared. Because of I can not use LaTeX characters inside the string "header" (at least I had tried it and it did not work), I would like to know how I could do it if I use HTML code which I do not know.
0 个评论
采纳的回答
Jan
2011-11-20
Another approach:
header = {'<center>Component X<br />(km/s²)</center>', ...
'<center>Component Y<br />(km/s²)</center>', ...
'<center>Component Z<br />(km/s²)</center>'};
Well, the display of the HTML characters in this forum drives my crazy. Th "²" is written as "& s u p 2 ;" without the spaces.
更多回答(1 个)
Walter Roberson
2011-11-20
header = {'<center>Component X<br>(km/s<sup><font size="-1">2</font></sup>)</center>', ...
'<center>Component Y<br />(km/s<sup><font size="-1">2</font></sup>)</center>', ...
'<center>Component Z<br />(km/s<sup><font size="-1">2</font></sup>)</center>'};
Note: you can leave off the </html> tags in practice.
6 个评论
Walter Roberson
2011-11-20
The implemented HTML is not the full set of HTML and it is often difficult to predict what will work and what will not.
Jan's version works by inserting a particular character that is specifically a raised 2; my version (if it worked) would be the general HTML mechanism to raise text with a lower size.
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!