latex interpreter - different fonts

6 次查看(过去 30 天)
Waldemar Gerok
Waldemar Gerok 2011-6-26
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 个评论
Andrew Newell
Andrew Newell 2011-6-26
My question too - I can't reproduce this.
Daniel Shub
Daniel Shub 2011-6-27
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.

请先登录,再进行评论。

回答(1 个)

Patrick Kalita
Patrick Kalita 2011-6-27
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.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by