Live scripts
A live script (.mlx) mixes formatted text, code and results in one document. It is divided into sections, and each section can be run on its own.
Running code
- Ctrl+Enter: run the current section.
- Ctrl+Shift+Enter: run the current section and move to the next one.
- F5: run the whole script.
- Ctrl+C or the Stop button: stop. A script stops between statements.
Code runs on its own engine thread, so the editor never freezes while a script is running. Results appear below the code or on its right, and figures are drawn inline.
Building a document
Use the Insert menu to add a block:
- Text, Title, Heading and Subheading for the prose.
- Code for a block of code.
- Section break (Ctrl+Alt+Enter) to split a section in two.
- Control for interactive controls (next section).
Saving and exporting
Save (Ctrl+S) and Save as (Ctrl+Shift+S) write a .mlx file. Export as script (.m) writes the code as a plain script. PDF export is not available yet.
Good to know: outputs saved inside an .mlx file are not restored when you open it (run the script to regenerate them) and are not written back. Rich text such as bold runs, links, equations and images is shown as plain text.