"Alan B" <monguin61REM@OVETHIS.yahoo.com> wrote in message <hkc6q4$sg8$1@fred.mathworks.com>...
> "Alan B" <monguin61REM@OVETHIS.yahoo.com> wrote in message <hkbbhp$al5$1@fred.mathworks.com>...
> > I'm getting some strange flaws when trying to display text with the latex interpreter on a figure. For example, using this command:
> >
> > text(0,0,str,'interpreter','latex')
> > str='$\cos \left( a b \right)$' % this looks correct
> > str='$\cos \left( \frac{a}{b} \right)$' % left parenthesis is missing
> > str='$\cos ( \frac{a}{b} )$' % this looks correct, but parens do not scale properly
> > str='$a$' % minus sign is missing
> >
> > Am I missing something obvious? These are very simple examples and I can't imagine what I could change to fix them. This is in R2008a on Ubuntu 9.04.
> >
> > Also, can I force the displayed latex to be antialiased? I recall antialiasing being enabled by default in Windows, is this an OS issue or can I control it?
> >
> > Thanks
>
> I should have searched, I would've found this: http://www.mathworks.de/matlabcentral/newsreader/view_thread/258809 , which provides a working answer, $$ is needed in linux instead of $.
>
> I am still hoping to find a way to enable antialiasing for figure text in linux. Does anyone know how to do this? I would settle for a workaround like drawing the text, saving to an image, reading the image, manually antialiasing.
>
> Any help is appreciated
I've found another related problem, and I can't seem to find any reference to it online.
text(0,0,str,'interpreter','latex')
str='$$\left( a^a \right)$$' % this looks correct
str='$$\left( a^b \right)$$' % left parens missing
str='$$\left( b^a \right)$$' % left parens missing
After experimenting, I concluded that the left parenthesis disappears when it contains a character with a vertical extender in a superscript. However, I'm not sure what to make of the following:
str='$$\left( a_f^f \right)$$' % looks correct
str='$$\left( a^f \right)$$' % left parens missing
str='$$\left( a_f^b \right)$$' % left parens missing
I've found a couple of workarounds:
str='$$\left( {\over} a^b \right)$$' % looks correct
str='$$\left( a^{(b)} \right)$$' % looks correct
But I would prefer a real solution, or at least one that is able to produce the actual desired appearance, instead of adding spaces or extraneous parentheses. Has anyone ever experienced this problem before? Can anyone give me any hints about why this happens or how to fix it?
This happens in R2006b/RHEL5, and R2008a/Ubuntu 9.04, but NOT in 2007a/XP.
