latex interpreter - different fonts

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

Walter Roberson
Walter Roberson 2011년 6월 26일
Question: which MATLAB version and which OS are you using?
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일

0 개 추천

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.

카테고리

도움말 센터File Exchange에서 Labels and Annotations에 대해 자세히 알아보기

질문:

2011년 6월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by