Skip to the content.

exportlivescript - janklab.mlxshake

Export a Matlab Live Script (.mlx) file to Markdown or other formats.

mdFile = janklab.mlxshake.exportlivescript(mlxFile, opts)

Exports a Matlab Live Script .mlx file to Markdown or other presentation file formats. Defaults to Markdown format.

Depending on the output format, this may produce multiple output files.

InFile (string) is the path to the input Live Script .mlx file you want to export. You may omit the '.mlx' extension.

Opts controls various aspects of exportlivescript’s behavior. It is a janklab.mlxshake.MlxExportOptions or a cell vector of name/value pairs (which gets turned in to an MlxExportOptions). See MlxExportOptions’ documentation for the available options and their effects.

Useful options:

Returns the path to the main exported file. There may be other auxiliary files produced; they will be in the folder next to the main output file. What exactly they are and what they are named varies based on the output format.


import janklab.mlxshake.exportlivescript


% Write to an alternate location
exportlivescript('foo.mlx', {'outFile','/path/to/'});

% Export a different format, like PDF
exportlivescript('foo.mlx', {'format', 'pdf'});

% Output format is automatically selected based on file extension
exportlivescript('foo.mlx', {'outFile', 'blah.docx'});

% You can also work with the export options as an object
opts = janklab.mlxshake.MlxExportOptions;
opts.outFile = '/path/to/';
opts.keepIntermediateFiles = true;
exportlivescript('foo.mlx', opts);