latex interpreter - different fonts
Show older comments
Hello,
I plot a figure, where the xlabel uses latex interpreter.
e. g.: xlabel('$\frac{1}{pi}dy$','Interpreter','latex','FontName','Times')
Unfortunately the font is not Times in the figure, however, when I do not use latex-interpreter, the FontName option works fine.
Does anybody know how to solve the problem: use the latex interprete and get the Time font in the figure?
Best Regards and thanks in advance for the help
Waldemar
3 Comments
Walter Roberson
on 26 Jun 2011
Question: which MATLAB version and which OS are you using?
Andrew Newell
on 26 Jun 2011
My question too - I can't reproduce this.
Daniel Shub
on 27 Jun 2011
Interesting, I can reproduce it on both 32-bit Windows (r2010a) and 64-bit Linux (r2010b). When the `interpreter` is `tex` or `none` changing the `fontname` has an effect. When the interpreter is `latex`, changing the `fontname` has no effect. I tried it with both an equation and plain text.
Answers (1)
Patrick Kalita
on 27 Jun 2011
0 votes
What you're describing is basically the expected behavior. When you set the Interpreter property to 'latex', MATLAB will hand off the string (e.g. '$\frac{1}{pi}dy$') directly to the LaTeX system, and LaTeX decides what fonts get used. The FontName property gets ignored.
It may be possible to install some kind of custom font alongside the regular LaTeX fonts (they're in %MATLABROOT/sys/fonts/ttf/cm), and then use some kind of LaTeX markup in your string that tells it to switch fonts. I've never done it, and I don't guarantee that would work, but if you're really desperate to make it work you might give it a try.
Categories
Find more on Labels and Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!