필터 지우기
필터 지우기

Adding additional LaTeX support for plot axis labels

조회 수: 252 (최근 30일)
Oliver Dellar
Oliver Dellar 2016년 1월 18일
답변: Walter Roberson 2016년 1월 19일
Matlab supports a lot of LaTeX for figure axis labels, titles, etc, but not ALL LaTeX commands.
For example when trying to use
xlabel('$\boldsymbol{\mu}$','interpreter','latex')
I get the error:
Warning: Error updating Text. Following is the chain of causes of
the error:
String must have valid interpreter syntax:
$\boldsymbol{\mu}$
because it doesn't support the \boldsymbol{} command. Is there a way of fixing this by adding/installing additional LaTeX command modules or anything?

답변 (2개)

Star Strider
Star Strider 2016년 1월 18일
You can use the 'FontWeight' as a work-around in this instance, since you have only one item you want in bold:
xlabel('${\mu}$','interpreter','latex', 'FontWeight','bold')
  댓글 수: 1
Oliver Dellar
Oliver Dellar 2016년 1월 19일
Thanks for this, and it does help in this instance, but this was just an example, there are other things I'd like to LaTeX format, such as
\xlabel('$\textbf{\textsf{x}}(t)$','interpreter','latex')
but it won't play ball with \textsf{}, etc.

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


Walter Roberson
Walter Roberson 2016년 1월 19일
Some of what you are trying to use is from packages not loaded for MATLAB. See http://uk.mathworks.com/matlabcentral/answers/241784-latex-matrix-when-publishing#answer_191856

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by