필터 지우기
필터 지우기

times font with latex interpreter

조회 수: 16 (최근 30일)
Randall
Randall 2011년 12월 30일
댓글: warnerchang 2024년 7월 13일 5:54

Hello,

I have the same problem described in the threads below: I need to control the latex math font, specifically, I need to use the mathptmx package.

http://www.mathworks.com/matlabcentral/answers/10282-latex-interpreter-different-fonts

http://www.mathworks.com/matlabcentral/newsreader/view_thread/283068

In this second thread, Huy Phan describes a way of hacking into the tex.m file and adding \usepackage{whatever} to the standardhead variable in localDecorateInputString. I have made it to Step 3 of Huy Phan's procedure, but have not had luck getting much further, I suspect because the path dependencies are a rabbit hole. It is not clear if it worked out for the others in the thread either.

Here are a couple of simple examples illustrating what I would like to do. First is a .tex file that runs fine with my texlive distribution:

\documentclass{mwarticle} \usepackage{mathptmx} \begin{document} This is a short article for testing fonts. Here is some math stuff: $y = x$. \end{document}

Next is a Matlab figure:

figure(1); text(.5,.5,'$y=x$','interpreter','latex')

I would like to get the y=x in the Matlab figure to use the same Times font produced using texlive.

Is there a way to get Matlab to run latex from texlive? Or does anyone think they can get Huy Phan's method working for mathptmx? I have tried adding all the directories shown in the log file from texlive to the TeXPath in tex.m, but this had not solved the problem.

Many thanks!

Randy

  댓글 수: 3
Randall
Randall 2024년 7월 12일 13:58
Unforutnately, no. Our work around is to use ascii encoding for special characters like degree symbols etc. And then when we absolutely must have latex math we have to fall back on cm10 font. It's ridiculous. We are moving to Python for this an othe reasons.
warnerchang
warnerchang 2024년 7월 13일 5:54
thank you very much

댓글을 달려면 로그인하십시오.

답변 (1개)

Daniel Shub
Daniel Shub 2011년 12월 30일
Do you need this for the on screen display or are you exporting the figure? For the latter, I think http://www.mathworks.com/matlabcentral/fileexchange/4638-laprint might help.

카테고리

Help CenterFile Exchange에서 LaTeX에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by