Forcing Page Breaks in MATLAB
38 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Paul Hoffrichter
2021-2-27
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 个评论
Paul Hoffrichter
2021-2-28
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.
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!