Italics in a string
11 次查看(过去 30 天)
显示 更早的评论
Hello,
I am attempting to create a GUI that will generate a citation for a source given the author, title, date of publication, etc. The title of a source is almost always italicized, and I can't figure out how to make part of a string appear in italics. I can change the settings for the textbox where the title is entered to italics, but not in the given citation itself.
Any help would be great.
3 个评论
Rik
2019-5-1
As far as I'm aware it is not possible to have a tex interpreter for uicontrol elements.
回答(1 个)
Walter Roberson
2019-5-1
Rik is mostly right: uicontrol('style', 'edit') and uicontrol('style', 'text') can only have character style (or color) affected for the entire control at one time, if you stick with supported methods.
uicontrol('style','edit') and uicontrol('style','text') have underlying java objects whose java handle can be found and manipulated.
There are some uicontrols such as style 'radio' for which the String property can start with '<html>' to have the rest of the string interpreted as HTML 1.1, such as '<html>Vinge, Verner, <i>A Fire on the Deep</i>'
text() elements can have Interpreter 'tex' or 'latex' properties, but text() elements must be within an axes. (annotation('text') creates a hidden axes to draw into.)
If you are creating a citation into a uicontrol style 'text' or 'edit', I wonder if the point is to create something that could be copied and pasted into a paper. If it is, then you would want to create something copyable that when pasted would cause the user's editor to create the appropriate result. That might be rather different content then the presentation layer. Potentially it might involve pushing something into the clipboard. You would probably want the opposite of clipboard('pastespecial')
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!