4.2

4.2 | 5 ratings Rate this file 145 downloads (last 30 days) File Size: 5.71 KB File ID: #13277

Matlab 2 Latex

by Kevin Mader

 

06 Dec 2006 (Updated 11 Dec 2006)

No BSD License  

A function to convert matlab functions to formatted colored .tex files .

Download Now | Watch this File

File Information
Description

m2tex converts a matlab file into a colored, tabbed .m file will all of the proper symbols converted to be latex compatible.
The latex files it produces can easily be included in other files by using /input{filename}
or /texttt{input{filename}} for more matlab look to the code
Remember latex assumes that the extension for any file used in the input command is .tex so you should not put it on.

There is another program on the site that lets you put .m files in latex that I did not find until I had already written this. This program is different because it is a matlab function that converts your code to .tex. The other is a latex style that lets you import matlab code.

MATLAB release MATLAB 7.3 (R2006b)
Other requirements Latex
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (9)
07 Dec 2006 Barun Mishra

Thats really amazing to know about converting .m file to TeX files. I was looking for this for a long time.

07 Dec 2006 Chris Buc

If you want to include .m file into LaTeX document you can use listings package. Maybe it isn't so full of colors but it gives same functionality and even more as your program.
However program is nice :)

28 Dec 2006 Pierre Bertrand

Great job.
Exactly what I needed :o)

29 Oct 2007 Matthias Hein

works nicely out of the box. Thanks !

01 Dec 2007 emma olsen

How do I get this file to work?? I have save the m2tex-file, but I just get error messages when I try to run it.. Can anyone help me out here?

06 May 2008 benno bernen

m.file is called root.m. I want to converte in a tex.file? But there are so many mistakes. how does it work??

24 Jul 2009 Mehmet Niyazi ÇANKAYA

Sorry this program does not work I take the following error meassage

??? Input argument "filein" is undefined.

Error in ==> m2tex at 22
    fileout=[filein(1:end-1) 'tex'];

05 Dec 2009 Josh Inya

Dear Mehmet Niyazi CANKAYA:

Try the follwing:

>>m2tex('Script.m')

where Script.m is the name of your m-file. and check the same folder where Script.m is stored for a new file titled: Script.tex.

hope this helps!

10 Dec 2009 Chirackel Yoonus  
Please login to add a comment or rating.
Updates
07 Dec 2006

Added the ability to input a string for conversion

11 Dec 2006

Fixed two bugs, one relating to { , } , _ characters. The other about indenting.

Tag Activity for this File
Tag Applied By Date/Time
development environment Kevin Mader 22 Oct 2008 08:51:33
matlab Kevin Mader 22 Oct 2008 08:51:33
latex Kevin Mader 22 Oct 2008 08:51:33
publish Kevin Mader 22 Oct 2008 08:51:33
latex Chetan 08 May 2009 20:22:47
latex Hua 14 Sep 2009 05:56:52
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com