From: B. on
"B. " <drastrogeek(a)gmail.com> wrote in message <h6erm0$s0e$1(a)fred.mathworks.com>...
> I'm able to reproduce this problem in any MATLAB installation (R2009, R2008, R2007) running on Linux, RedHat or Ubuntu. The Mathworks has an example anyone can test, it's under http://www.mathworks.com/access/helpdesk/help/techdoc/ref/text_props.html. The example listed is the following. Open up a figure, then type:
>
> text('Interpreter','latex',...
> 'String','$$\int_0^x\!\int_y dF(u,v)$$',...
> 'Position',[.5 .5],...
> 'FontSize',16)
>
> If it works, which it does on Windows computers, you should see a double integral, first from 0 to x, then over y, of dF(u,v). Now, if I try the above command on any Linux installation of MATLAB, that is not what I see. The symbols are either interpreted incorrectly or they don't appear at all on the figure.
>
> Does anyone know if this feature is broken in Matlab for Linux? Or is there some obscure environment setting required to get this to work right?
>
> Help!!!


FYI, last summer I found a fix that worked for me, at least at the time. I had passed that solution on to the Mathworks but I can't seem to find it posted anywhere on the forums. This worked for me on RHEL systems. However, I'm having problems adapting it to Ubuntu 9.10, not sure why. Any ideas?

On RHEL systems:

(1) rpm -ivh type1inst-0.6.1-4.noarch.rpm
(get it from www.rpmfind.net)
(2) mkdir /usr/local/share/fonts
(3) mkdir /usr/local/share/fonts/matlab
(4) cd /usr/local/share/fonts/matlab
(5) cp $MATLAB_HOME/sys/fonts/type1/cm/*.pfb .
(6) type1inst -samples
(7) chkfontpath -a /usr/local/share/fonts/matlab
(8) cd /usr/share/fonts
(9) ln -sf /usr/local/share/fonts/matlab
(10) fc-cache -fv
(11) xset fp rehash
(12) /etc/rc.d/init.d/xfs restart

I managed to install type1inst on Ubuntu in the appropriate folder, but I can't get Matlab to recognize the fonts I installed even though fc-cache -fv seems to recognize the fonts.
From: B. on
"B. " <drastrogeek(a)gmail.com> wrote in message <hl2qsq$5me$1(a)fred.mathworks.com>...
> "B. " <drastrogeek(a)gmail.com> wrote in message <h6erm0$s0e$1(a)fred.mathworks.com>...
> > I'm able to reproduce this problem in any MATLAB installation (R2009, R2008, R2007) running on Linux, RedHat or Ubuntu. The Mathworks has an example anyone can test, it's under http://www.mathworks.com/access/helpdesk/help/techdoc/ref/text_props.html. The example listed is the following. Open up a figure, then type:
> >
> > text('Interpreter','latex',...
> > 'String','$$\int_0^x\!\int_y dF(u,v)$$',...
> > 'Position',[.5 .5],...
> > 'FontSize',16)
> >
> > If it works, which it does on Windows computers, you should see a double integral, first from 0 to x, then over y, of dF(u,v). Now, if I try the above command on any Linux installation of MATLAB, that is not what I see. The symbols are either interpreted incorrectly or they don't appear at all on the figure.
> >
> > Does anyone know if this feature is broken in Matlab for Linux? Or is there some obscure environment setting required to get this to work right?
> >
> > Help!!!
>
>
> FYI, last summer I found a fix that worked for me, at least at the time. I had passed that solution on to the Mathworks but I can't seem to find it posted anywhere on the forums. This worked for me on RHEL systems. However, I'm having problems adapting it to Ubuntu 9.10, not sure why. Any ideas?
>
> On RHEL systems:
>
> (1) rpm -ivh type1inst-0.6.1-4.noarch.rpm
> (get it from www.rpmfind.net)
> (2) mkdir /usr/local/share/fonts
> (3) mkdir /usr/local/share/fonts/matlab
> (4) cd /usr/local/share/fonts/matlab
> (5) cp $MATLAB_HOME/sys/fonts/type1/cm/*.pfb .
> (6) type1inst -samples
> (7) chkfontpath -a /usr/local/share/fonts/matlab
> (8) cd /usr/share/fonts
> (9) ln -sf /usr/local/share/fonts/matlab
> (10) fc-cache -fv
> (11) xset fp rehash
> (12) /etc/rc.d/init.d/xfs restart
>
> I managed to install type1inst on Ubuntu in the appropriate folder, but I can't get Matlab to recognize the fonts I installed even though fc-cache -fv seems to recognize the fonts.




Well, the process above seems to have worked fine, as long as I run the KDE desktop manager instead of the default GNOME desktop manager. Not sure what that's all about. I read somewhere that the latex-xft-fonts package would cause issues, but I uninstalled it and that still didnt' work in GNOME. I can see all the latex symbols on a MATLAB figure fine from KDE now though. Maybe that will help someone else out using Ubuntu.
From: B. on
Well, after my last post (aside from the steps I outlined for RHEL), I

(a) Uninstalled latex-xft-fonts package. Then I started matlab and the problem persisted. I did not, at that time, reboot the system.
(b) Installed the entire KDE system, logged into KDE and the latex fonts were displayed perfectly fine.
(c) I logged out of KDE and back into GNOME and now it all works. So, I have to assume, since I didn't reboot the computer after I uninstalled the latex-xft-fonts package, that I should have done that or somehow restarted the window manager. Logging out and logging back in is not enough. After you uninstall latex-xft-fonts, you have to restart the entire GDM for that the system to take notice. I had done that for the RHEL install steps, but I guess that latex-xft-fonts package really was messing things up after all.

Summary: Somehow the latex-xft-fonts package conflicts with the matlab fonts. You can verify that by looking at the X log file in /var/log.

Hope that helps Ubuntu users.