Error in the creation of a Greek letter in a GUI
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Jacopo
el 23 de Mayo de 2014
Comentada: Igor Jasmim
el 12 de Oct. de 2016
Hello. I expose my question. I have tried to insert Greek letters in a static text following the procedure at the link:
I put in the Property Inspector in the entry "Tag" latex_text5 and under "String" \ alpha. However, in the command window I get the following warning:
Warning: Unable to interpret LaTeX string "\ alpha" > In openfig at 135 In gui_mainfcn> local_openfig at 286 In gui_mainfcn at 234 In GUI_prova2 at 42
What should I do to see the Greek letter alpha in the static text?
6 comentarios
Respuesta aceptada
dpb
el 24 de Mayo de 2014
Warning: Unable to interpret LaTeX string "\ alpha"
> In openfig at 135
In gui_mainfcn> local_openfig at 286
In gui_mainfcn at 234
In GUI_prova2 at 42
...What should I do to see the Greek letter alpha in the static text?
Well, I built a new GUI w/ just a single uicontrol and voila! was able to reproduce your error.
The problem is that for LaTeX the string '\alpha' must be in the math environment it turns out (enclosed in '$' signs. Otherwise, it's attempted to be interpreted in text mode and that fails spectacularly. Set the text in the Property Inspector to
This is a Greek alpha: $\alpha$
and joy will ensue...
Whew....learned something about LaTeX...
3 comentarios
dpb
el 25 de Mayo de 2014
Editada: dpb
el 25 de Mayo de 2014
You're welcome...was an experience. I went back and cleaned up the sidebar conversation most of which was owing to my using a complicated sample GUI figure rather than building a single uicontrol. NB: that the script supplied by TMW only works for positioning on a UI that doesn't contain grouping boxes because it doesn't convert the positions for items within from those relative coordinates to absolute so the positioning of elements within them is incorrect. That was what I saw in first testing and presumed it was related to your problem which it wasn't.
Also, note that the problem you had really has no bearing on the GUI but was simply an issue w/ LaTeX syntax--I use LaTeX so infrequently over the default TeX it was new to me, too, so that took a while to discover, as well. The issue can (and actually, is how I finally did resolve it) be seen directly from text w/o the GUI around at all.
To work around any issues going forward, try
text(0.5,0.5,'\alpha','interpreter','latex')
text(0.5,0.5,'\alpha','interpreter','tex')
simply from the command line. Note also that the error from the failure in the 'LaTeX' interpreter doesn't necessarily show up on the command line until later--the actual failure may (and often is initially) just that nothing shows up in the figure.
Más respuestas (0)
Ver también
Categorías
Más información sobre Environment and Settings en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!