latex - use package

조회 수: 8 (최근 30일)
Viesturs Veckalns
Viesturs Veckalns 2017년 10월 30일
편집: Walter Roberson 2017년 10월 31일
I want to set label text as
c_f2_3D.Label.String = '\frac{a}{b} \text{[cm]}'
I instruct to use the Latex interpreter
c_f2_3D.Label.Interpreter = 'latex';
\text requires to use the amsmath package. How can I fix the label?
  댓글 수: 1
Rik
Rik 2017년 10월 31일
I believe there is a folder with LaTeX packages buried deep in the installation folder of Matlab. It might be the only way to add packages. I really hope someone know a better way, but Matlab was not really designed for LaTeX package management.

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

답변 (1개)

Walter Roberson
Walter Roberson 2017년 10월 31일
편집: Walter Roberson 2017년 10월 31일
c_f2_3D.Label.String = h.String = '$\frac{a}{b}$ [cm]'
the \frac is not valid outside of math mode, but sometimes it is good enough to just exit math mode. Spacing and weight can be a little different outside math mode, I understand. Perhaps
'$\frac{a}{b} \mbox{[cm]}$'
though I cannot say that I see any difference between that and omitting the \mbox . The material I am finding says that \text is the same as \mbox except that \text will use a smaller font if it is within a subscript.

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by