shadowfax
shadowfax

Reputation: 135

Writing sub-sections using Matlab publish markup

I want to create a Matlab markup using publish. I am using "showCode = false" because I do not want to print the entire code, only what I write with comments, and all the plots.

One thing that I want to do is have a cover page, sections, and sub-sections. Here are two questions:

(1) Sub-sections: I understand sections start with two percent signs: %% SECTION NAME How can I write sub-sections within this section?

(2) Is it possible to have a document cover page using publish?

Thanks

Monica

Upvotes: 2

Views: 865

Answers (2)

gnovice
gnovice

Reputation: 125854

With regard to sub-sections, you can add them using HTML Markup, but this won't be added to the Contents menu generated from the section titles. For a cover page, you could add an external graphic (note: you'll want to put the image files in the folder with your published output and link to there). Here's a sample script illustrating both of the above:

%% Title
%
% <<C:\Program Files\MATLAB\R2016b\toolbox\matlab\imagesci\peppers.png>>
%
% Description.

%% Section 1
% Some text.

%% Section 2
% Some more text.

%%
% <html><h3>Sub-section</h3></html>
%
% Some subtext.

%% Section 3
% Final text.

And here's the published HTML output:

enter image description here

Upvotes: 3

Adrian
Adrian

Reputation: 3306

Unfortunately MATLAB publishing markup is very basic and I don't think you can do sub-sections easily.

Within the publish markup the only option I can think of is to include <h2> <h3> markup within a <html> block. Which isn't that easy to setup in the code.

Anything more complex eg. for item (2) then I suspect you will have to use the MATLAB report generator. https://uk.mathworks.com/products/ML_reportgenerator.html

Upvotes: 0

Related Questions