latex - use package
8 次查看(过去 30 天)
显示 更早的评论
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
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
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!