MATLAB Answers

Printing .m to pdf on Linux

3 views (last 30 days)
Ave
Ave on 5 Nov 2019
Edited: Daniel M on 5 Nov 2019
Hi there, does anyone know a way to print a .m file to pdf on linux?
On Ubuntu 19.10 with R2019B, selecting print just returns an error for no conigured printers. I don't have any physical printers, but I expected at least an option to print to PDF like other applications have. This doesn't seem to be something I can edit in printopt.m, but perhaps I'm wrong about that? I tried adding a system print to pdf in the GNOME printer settings to no avail as well.
Any tips?
~Ave

  2 Comments

Ave
Ave on 5 Nov 2019
This does exactly what I want, and more! Thanks!

Sign in to comment.

Answers (1)

Daniel M
Daniel M on 5 Nov 2019
Edited: Daniel M on 5 Nov 2019
publish('myscript.m','pdf');
It will publish any figure or anything that prints to the command line as well.

  0 Comments

Sign in to comment.

Products


Release

R2019b

Translated by