# File Exchange Pick of the Week

## TeX interpreter in x tick and y tick labels

Writing a file that solves a problem that gets called into our tech support team is a very good way of becoming Pick Of The Week. This week a MATLAB user wanted to know how to use the TeX interpreter on x and y ticks. This is not supported, but if you download this file, you will be able to.

### 6 Responses to “TeX interpreter in x tick and y tick labels”

1. Roy Goodman replied on :

As much as I want to use Matlab’s built-in TeX interpreters, they tend to increase the file size (in postscript) to an astounding level, which then causes some scientific journals and the arxiv.org preprint server to reject the files as too big. A workaround is to put plain text in my figures, and ten modify the .eps files with the LaTeX package psfragThis gives much smaller .eps files, but is very inconvenient. Obviously I’d like to do everything in Matlab, but at this point, that doesn’t seem like it’s feasible.

2. Doug replied on :

I went to the LaTeX guru here at The MathWorks. He had this to say:

“When MATLAB saves a LaTeX-interpreted string to an .eps file, it embeds Postscript definition files for each Computer Modern font needed to display the string. MATLAB does this because it does not know which Postscript fonts may be defined on a destination machine that may load the .eps file later.

In Example 4 from Doug’s video, MATLAB embeds font definitions for CMR10, CMR7, CMR10, CMR7, CMSY7, in that order, into the .eps file. I think it is unnecessary for MATLAB to embed CMR10 and CMR7 twice — this may be a bug. Also, in some future release, we may want to find a way to integrate with psfrag-like apps more efficiently.”

3. Roy Goodman replied on :

Doug,
Thanks for seeking out an answer for me. This issue has been bugging me for a long time.
Roy

4. cong replied on :

Thank you so much!!
This is what I really want!!!

5. Ariel Balter replied on :

Is there a way to control the font used in LaTeX strings?

6. Doug replied on :

@ariel,

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/text_props.html#String

The /fontname command is what you want.

Doug

Brett & Jiro share their favorite user-contributed submissions from the File Exchange.

These postings are the author's and don't necessarily represent the opinions of MathWorks.