Forcing Page Breaks in MATLAB
36 views (last 30 days)
Show older comments
When working in the Live Editor, can I insert command lines that will force the output to start a new page when exporting to PDF?
0 Comments
Answers (1)
Paul Hoffrichter
on 27 Feb 2021
The official 2016 answer is here, and no discernible updates since 2016. It would be great if MathWorks would add that to Live Editor.
If you have the report generator, it is possible, but not directly in Live Scripts.
Conceivably, by dividing your Live Script into separate PDF files, there may be a way to use the report generator to read each PDF file, and append a page break.
Or, you could use the idea from here to insert a "\f" (but you would have to know where to insert it - you could add a known string, but this is all very klugy, and still not guaranteed to work).
I tried the fprintf approach printing out some text and ending it with \f\n. The text came out fine with a single line break, but no form feed. Then I tried ending the text with \f\f\f\f\f\\n\n\n\n\n\n\n\n\n\n, but Live Editor carefully removed all paper feed special chars, and the PDF results were identical.
Looks like you have to purchase their Report Generator Toolbox to get professional reports. I looked at its user manual, which is 1660 pages long. It references Live Editor:
You can use the MATLAB Report Generator to create reports for sharing your MATLAB code
and presenting the results of the code.
In addition, MATLAB provides several methods for presenting MATLAB code and results, including:
• Live Editor (MATLAB)
• MATLAB publish command
The MATLAB Live Editor enables you to create cohesive, shareable documents that include
executable MATLAB code, embedded output, and formatted text.
No further references or integration with Live Editor is mentioned.
2 Comments
Paul Hoffrichter
on 28 Feb 2021
I would not hold my breath waiting. This feature is in their report generator product and it appears that there is intentional suppression of line and page controls in live edit.
See Also
Categories
Find more on Get Started with MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!