# MuPAD (MATLAB symbolic toolbox) export to LaTeX

Is it possible to export a entire MuPAD notebook into LaTeX in the same fashion like Mathematica does? I am familiar with MuPAD latex command but it seems (at least on the first glance) that it is less convenient than export command in Mathematica.

Edit As requested minimal working example of MuPAD notebook.

diff(sin(x), x)
cox(x)
generate::TeX(hold(diff(sin(x),x)))
"\frac{\partial}{\partial x}\sin\!\left(x\right)"
generate::TeX(diff(sin(x),x))
"\cos\!\left(x\right)"


Instead of exporting command and the output separately I would just like to export the entire notebook.

P.S. The MuPAD language has a Pascal-like syntax and allows imperative, functional, and object-oriented programming. Its domains and categories are object-oriented classes that allow overriding and overloading methods and operators, inheritance, and generic algorithms.

-

You may use the publish features of Matlab. This is from matlab documentation

Publishing Results

Publishing to HTML, XML, LaTeX, and Formats for Word and PowerPoint Applications

You can publish M-files to HTML, XML, LaTeX, and to formats for Microsoft Word and Microsoft® PowerPoint® applications. The published documents can include code, formatted comments, and results, such as graphs in Figure windows. Use cells and cell publishing features in the Editor/Debugger. For details, see Overview of Publishing MATLAB Code in the online documentation.

Demo of New Publishing Features. If you are using the Help browser, watch the new Publishing M Code from the Editor video demo for an overview of the major functionality. Notebook

If you currently use Notebook, consider using cell publishing from the Editor instead, which provides more features and flexibility for most applications.

For more details, check demo video and documentation of matlab.

-
very useful answer. Thank you so much! I will need to experiment with it but it seems that your answer implies that publishing works only for M-files. MuPAD uses separate language and interface. Does the same applies for MuPAD code? –  Predrag Punosevac May 1 '12 at 15:34
@PredragPunosevac: Can you provide a minimal mupad code?. Above feature can be applied to any code that runs from matlab. –  Harish Kumar May 1 '12 at 22:46
I apologize for not putting minimal working example earlier. It is added now. –  Predrag Punosevac May 2 '12 at 0:45
Whether Mupad of mackichan is same as this. If so, you can have a try with scientific workplace or scientific notebook (mackichan.com/index.html?products/sw.html~mainFrame) –  Harish Kumar May 2 '12 at 1:07