Latex expression in Matlab Report Generator

21 次查看(过去 30 天)
I am generating a report of my work using the Matlab Report Generator. I would like to insert some LaTeX expressions within a text paragraph, however I cannot find a way to do it. I have already tried to generate an image but it does not look proper. Is there a more direct way to do this? Thank you!
  1 个评论
Marc Compere
Marc Compere 2024-4-7
I'm interested in this as well. The Matlab Report Generator is great, but latex superscript, subscripts, and greek characters would sure make it better.

请先登录,再进行评论。

回答(1 个)

Sameer
Sameer 2024-8-12,17:37
Hi Silvia
From my understanding, you want to insert LaTeX expressions within a text paragraph in your MATLAB report using the “MATLAB Report Generator”.
This can be achieved using the “mlreportgen.report.Equation” class, which allows you to include LaTeX equations directly in the report.
Below is an example implementation:
import mlreportgen.report.*
% Create the report and chapter
% Add an equation as a separate line in the chapter
rpt = Report('equation','docx');
ch = Chapter(Title='Equation');
add(ch,Equation('\int_{0}^{2} x^2\sin(x) dx'));
add(ch,Equation('E = mc^2'));
add(ch,Equation('\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}'));
add(ch,Equation('a^2 + b^2 = c^2'));
add(ch,Equation('\frac{d}{dx} e^x = e^x'));
add(rpt,ch);
% Close and view the report.
close(rpt);
rptview(rpt);
For more information, please refer to the link below:
I hope this helps!
Sameer

类别

Help CenterFile Exchange 中查找有关 MATLAB Report Generator 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by