MATLAB转tex,m代码转换成LaTeX转换器

m-code to LaTeX converter

This file lets you very easy 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 experience NO DIFFERENCE IN THE APPEARANCE to the look of the m-code in the Matlab Editor. (except for the apostrophs)

There are SEVERAL WAYS TO EXECUTE the program.

1. Run the file by pressing F5 oder click the "Run" button in the Matlab Editor, while the m2tex.m file is open or type "m2tex" in the Command Window.

==> The program will open the GUI and the rest goes from there.

2. Call the program from the Command Window or another m-file with at least one option. The order of the options is not important. For example:

m2tex('num','C:\Programme\MATLAB\work\testfile.m','C:\latex_documents\testfile.tex')

m2tex('testfile.m','testoutputfile.tex', 'no_num','bwc')

There are ONLY TWO STEPS necessary to do to include your code:

1. Run "m2tex.m" (with the desired m-file to include).

2. Insert the code into your main LaTeX-document by adding the whole "filename.tex"-file with \include{filename} or \input{filename}.

For Example:

\usepackage{fancyvrb}

\usepackage{color}

...

\begin{singlespace} % only optional % you need \usepackage{setspace}

\footnotesize

\input{outputfile} % output from "m2tex.m", but without the extension ".tex"

\end{singlespace} % for changing your linespacing

\normalsize

Features:

- recognizes all keywords, strings and comments

- recognizes all indents and tabs

- recognizes cell titles

- writes all recognized objects correct in a tex-file

- uses original Matlab colors

- the font looks almost the same as in Matlab Editor

- tex-file is saved using fontencoding "UTF-8", so that German Umlauts will be written correct

- option for numbered code lines ('num' or 'no_num')

- recognizes a linebreak, but only with a leading space character, i.e. " ..." and only once in a line

- option for input- and output-file (*.m respectively *.tex-file)

- execution via GUI or command line

-----------------------------------------------------------------

The conversion of the linebreak works only, if it is once in a line, because the command "regexprep" (code line: 1385) won't work, if you are looking for a string with three dots: '...'

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值