Is there a way to create subsections using 'publish'?
21 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2014-2-24
编辑: MathWorks Support Team
2021-4-1
Section headings in HTML created using the 'publish' function use the {h2} tags. Is there a way to create subsections that use the {h3} tag and have them included in the table of contents?
采纳的回答
MathWorks Support Team
2021-3-30
编辑:MathWorks Support Team
2021-4-1
There is no special syntax for creating subsections/subheadings using the 'publish' feature, like there is for creating main section headings. However, you can create subsections by specifically including the {h3} tag in your document surrounded by {html} tags. For example:
%% Main Section
% H2 tags are used to denote main sections.
% But you can specifically write H3 tags using HTML, for example:
%
% <html><h3>Sub Section</h3></html>
%
% This text will be in a sub-section.
If you want to change the formatting of the subheading, you can do that by modifying the CSS information included in the XSL stylesheet that does the transformation into HTML. Then you can instruction 'publish' to use the custom stylesheet using the 'stylesheet' input parameter.
publish('fcn.m','stylesheet','mystylesheet.xsl')
The default stylesheet can be found by executing the following command in MATLAB:
which -all mxdom2simplehtml.xsl
The subsection will not be automatically included in the table of contents, but you may be able to add the subsections to the table of contents by modifying the XSL stylesheet.
As an alternative to the 'publish' feature, the MATLAB Report Generator can be used to generate much more complicated and elaborate reports based on your data. You may find that it is better suited for your needs than the 'publish' function. For more information on the MATLAB Report Generator, please visit the following link:
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Report Generator 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!