How do I adjust font styling on a powerpoint slide using MATLAB Report Generator

import mlreportgen.ppt.*;
pre = Presentation('Test');
slide = add(pre, 'Title and Content');
replace(slide, 'Title','Test title'); % Control this font size

 Accepted Answer

Instead of using the replace function to add the title, create the title using paragraph, perform the proper styling, then use "replace" to add it to the title of the slide.
For example, here we make the slideTitle blue and size 10, and THEN add it to the title section of the slide.
pre = Presentation('Test');
slide = add(pre, 'Title and Content');
slideTitle = Paragraph('Test title');
slideTitle.FontColor = 'blue'
slideTitle.FontSize = '10'
contents = find(slide,'Title');
replace(contents(1),slideTitle);

More Answers (0)

Categories

Products

Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!