File Exchange Pick of the Week

September 24th, 2007

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

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


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

  • oleg: The author has implemented skewness, kurtosis and checks answering appropriately to the critic.
  • Ashok: how to store 10 or more random number in a loop a loop for i = 1:n mean(i) = input(’enter the mean value...
  • Ben: Doug, Thanks for the very helpful videos! Uitables seem like a convenient way to make a customized property...
  • oleg: Allstats has no checks, no comments and could also be improved (talking about prctile implementatio). Not to...
  • Todd: Additional information and a link to download free MATLAB and Simulink LEGO MINDSTORMS NXT code can be found at...
  • Doug: @Leo, Here is the “English version” of that code. “vec = []” makes an empty variable...
  • leo: Dear Doug I have a question in your code ‘October 9th, 2009 at 13:53′ vec = []; vec = [vec val]; I...
  • Shanker Keshavdas: You sir, are a gentleman and a scholar… No really, helped me out a lot. As to what is...
  • Quan Zheng: how can I get a copy of stepspecs.m?
  • Doug: @Lucy I think this is what you seek to move a line with the mouse in MATLAB. http://blogs.math...

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