Is there a way to make octave interpret strings in static text of uicontrol using TeX (Greek letters, subscripts, superscripts etc.)?


April 2019


5 time


I am writing a GUI in GNU octave (5.1.0). It is supposed to read some input values, make some calculations, plot some graphs and write the results. Everything works well besides the unwanted fact that uicontrol displays the given string uninterpreted (Greek letters, subscripts, superscripts etc.). Is there a way to change this?

I have tried to specify the interpreter inside the uicontrol:

uicontrol ("parent", p, "style",'text', "string", ["\beta Q_v [m^3/s]"],'interpreter','tex']);

But there is no such property listed in the documentation and hence no wonder I get this error:

error: set: unknown uicontrol property interpreter

Meanwhile, I have managed to insert the Greek letters into the displayed text using the UTF-8 ASCII code (in this case the letter beta):

uicontrol ("parent", p, "style",'text', "string", [char([206 178]) " Q_v [m^3/s]"],'interpreter','tex']);

That works fine. However the variable and its units are displayed the same way they are written in the code (no subscripts, no superscripts), which looks kind of silly and on top it is space consuming.

I have been searching all over the internet ever since I started with writing this GUI (2017 or so) but no luck. It seems as if no one has ever ran into this trouble, which seems strange to me. Am I missing something? Any help will be mostly appreciated!

0 answers