Latex expression in Matlab Report Generator
16 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commento
Marc Compere
il 7 Apr 2024
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.
Risposte (1)
Sameer
il 12 Ago 2024
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
0 Commenti
Vedere anche
Categorie
Scopri di più su MATLAB Report Generator in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!