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!