Updated 12 Sep 2012 29 Sep 2009 1" /> Updated 12 Sep 2012 29 Sep 2009 1" />

Matlab Code In Latex

10.8K Downloads All time: 10,813" data-original-title="Downloads" aria-describedby="popover506129">

Updated 12 Sep 2012

29 Sep 2009

1. New option "bwc" for code in babsence and also white2. The programm consists aobtain just of one m-file

14 Aug 2009

I corrected all points in respect to the false strings.But I couldn"t resolve the "waitfor" difficulty, tbelow are now 2 m-files: the command-line tool and the GUI.How perform I put the 2 files together in one m-file?Please let me to know.

You watching: Matlab code in latex

6 Aug 2009

I upgraded the input options for specifying a source and also target file, for example (rather of just a filename, you have the right to write tright here the whole path): m2tex("num","input.m","output.tex")

I have actually likewise included a GUI (my initially one).

31 Jul 2009

"if else end" can be tackled currently in one line, which the regimen was currently intended to perform.The requested input choices will follow later.

30 Jul 2009

Corrected a minor error through respect to lines, which contain just area characters reason of a kindly guideline from an user.

21 Jul 2009

Upgraded the distinction between strings, e.g "xyz" and also apostrophs for transpose purpose, e.g. G=P*C"/(C*P*C"+R).

See more: Deep South Book Review - Paul Theroux'S 'Deep South'

20 Jul 2009

Corrected a minor error in respect of one single "second word" string.Added a question dialog window for the alternative of numbered lines, bereason I constantly foracquired to activate it in the command also line.

26 Jun 2009

recognizes currently a linebreak, however just with a leading area character, i.e. " ..." and just when in a line

This file allows you incredibly straightforward INCLUDE COLORED M-CODE in your LaTeX-file.

After you run this m-file "m2tex.m" and inlcude the output tex-file in your LaTeX document, you will certainly endure NO DIFFERENCE IN THE APPEARANCE to the look of the m-code in the Matlab Editor. (other than for the apostrophs)

m2tex("num","C:ProgrammeMATLABwork estfile.m","C:latex_documents estfile.tex")m2tex("testfile.m","testoutputfile.tex", "no_num","bwc")

Tright here are ONLY TWO STEPS important to do to include your code:1. Run "m2tex.m" (through the preferred m-file to include).2. Insert the code into your major LaTeX-record by adding the entirety "filename.tex"-file via includefilename or inputfilename.

For Example:usepackagefancyvrbusepackagecolor...eginsinglespace % just optional % you need usepackagesetspacefootnotesizeinputoutputfile % output from "m2tex.m", but without the extension ".tex"endsinglespace % for changing your linespacing ormalsize

Features: - recognizes all keywords, strings and comments - recognizes all indents and also tabs - recognizes cell titles - writes all known objects correct in a tex-file - offers original Matlab colors - the font looks almost the exact same as in Matlab Editor - tex-file is conserved using fontencoding "UTF-8", so that Germale Umlauts will be created correct - alternative for numbered code lines ("num" or "no_num") - recognizes a linebreak, however only via a leading area character, i.e. " ..." and also only as soon as in a line - choice for input- and also output-file (*.m respectively *.tex-file) - execution through GUI or command also line-----------------------------------------------------------------The conversion of the linebreak functions just, if it is once in a line, because the command "regexprep" (code line: 1385) won"t occupational, if you are trying to find a string via 3 dots: "..."

--> If anyone knows why or a solution approximately the trouble, please tell me! thx

Cite As

Uwe Lelke (2021). m-code to LaTeX converter (https://www.sibbap.org/matlabcentral/fileexchange/24515-m-code-to-latex-converter), MATLAB Central Data Exchange. Retrieved August 23, 2021.