Italics in a string

조회 수: 11 (최근 30일)
Isaac Gruver
Isaac Gruver 2019년 5월 1일
답변: Walter Roberson 2019년 5월 1일
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
Isaac Gruver
Isaac Gruver 2019년 5월 1일
Citation Generator.pngMy intention is to have the user choose whether they want to create a single citation, or a bibliography. If they choose the single citation, it will come up in the citation edit field. If they choose a bibliography, then it will save to a file
Rik
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
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')

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by