필터 지우기
필터 지우기

How to write big fraction in texts

조회 수: 79 (최근 30일)
Marius Hammer
Marius Hammer 2019년 2월 7일
Is it in Matlab possible to plot a fraction in text which keeps the same text size. That is not reducing the text size inside the \frac enviroment?
In LaTeX you have the command \dfrac{a}{b} but this command doesn't work in Matlab using the LaTeX interpreter?
figure (1)
plot(Bq,d);
title('Pore Pressure Ratio');
xlabel('B_q [-]');
ylabel('Depth [m]');
text(0.8,-2.8,'$B_q = \frac{\Delta u}{q_t-\sigma_{v0}}$','interpreter','latex','EdgeColor','k'); % the text within the frac is reduced here :(
set (gca,'Ydir','reverse');
grid on;
  댓글 수: 8
Star Strider
Star Strider 2019년 2월 9일
I am not certain if the text call 'FontSize' name-value pair scales the font or scales the entire text object. It definitely has some effect.
Nevrtheless, there appear to be some problems with the LaTeX interpreter as MATLAB uses it.
Walter Roberson
Walter Roberson 2019년 2월 10일
For example '$\fontsize{50}{60}B_q$' is not rejected by the interpreter, but makes no change to the output -- not even to drop something in that is then clipped. The output is as-if the \fontsize were not present in each case I tested.
This is not the same as the 'FontSize' option to text()

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

답변 (1개)

matt majic
matt majic 2021년 10월 6일
Yes. Simply enclose the latex formula in double dollar signs $$.
  댓글 수: 1
Ricardo Fernández de Aldama
Ricardo Fernández de Aldama 2022년 9월 5일
Could you give an explanation of the differences between enclosing LaTex forumale in single and double dollar signs?

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

카테고리

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

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by