MATLAB: How to insert a page break in an HTML report using PUBLISH in MATLAB 7.6 (R2008a)

MATLABreport

I am generating an HTML report using the PUBLISH function. I want to include a page break to separate my results and code.

Best Answer

In order to include a page break in the HTML report you need to include the appropriate HTML tag in the MATLAB file. The instructions to add HTML tags are listed in the documentation at the following location:
To open the installed documentation, execute:
web([docroot,'/techdoc/matlab_env/f6-30186.html#brgekaq'])
In order to have a page break replace the HTML tag for table with the following tag:
% <p style="page-break-before: always">
This will include a page break in the published HTML report. You can use print preview to confirm that the page break is correctly placed.
Note that the above will not work if you want to place a page break iteratively in a loop since the HTML tag for page break would be evaluated only once irrespective of whether it lies within the loop or not. The functionality of HTML tagging to enable page break in iterative fashion is currently not available in MATLAB.