BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
krm
Obsidian | Level 7 krm
Obsidian | Level 7

I am trying to publish various charts that are created in SAS into powerpoint slides. However when I try to change the title size using 

 

ods powerpoint  layout=twocontent;
title1 height=32pt " CHART TITLE" ;

 

SAS output font is always 42pt. 

 

on the other hand if I use 

 

ods powerpoint layout=_null_;
title height=32pt "CHART TITLE";

 

the font changes. 

 

I figured that I can use proc template to modify existing layouts (such as : twocontent), however I couldn't find an example in the SAS documentation so far that I can use. The examples that I found are mainly for ODS pdf outputs.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tim_SAS
Barite | Level 11

Instead of modifying the layout template (which you can't do), modify the style template. This works for me using SAS 9.4M3:

 

ods path (prepend) work.templat(update);
proc template;
   define style styles.mystyle;
      parent = styles.powerpointlight;
      class SystemTitle /
         fontsize=32pt;
   end;
run;

proc sort data=sashelp.class out=class;
   by sex;
   run;

ods powerpoint file="test.pptx" style=styles.mystyle;
ods powerpoint layout=twocontent(advance=bygroup) nogtitle;
title1 'CHART TITLE';
proc sgplot data=class;
	by sex;
	vbar name /response=height;
run;
ods powerpoint close;

View solution in original post

4 REPLIES 4
Tim_SAS
Barite | Level 11

Instead of modifying the layout template (which you can't do), modify the style template. This works for me using SAS 9.4M3:

 

ods path (prepend) work.templat(update);
proc template;
   define style styles.mystyle;
      parent = styles.powerpointlight;
      class SystemTitle /
         fontsize=32pt;
   end;
run;

proc sort data=sashelp.class out=class;
   by sex;
   run;

ods powerpoint file="test.pptx" style=styles.mystyle;
ods powerpoint layout=twocontent(advance=bygroup) nogtitle;
title1 'CHART TITLE';
proc sgplot data=class;
	by sex;
	vbar name /response=height;
run;
ods powerpoint close;
krm
Obsidian | Level 7 krm
Obsidian | Level 7

@Tim_SAS thank you very much for your response. 

 

It's great to know that I cannot modify the layout template as that's why I have been trying. 

 

Also if I want to modify other title sizes (not the main title but the smaller ones) in the same slide, should I do it under the same class statement? 

Tim_SAS
Barite | Level 11

There are 10 SystemTitle classes, one for each possible title statement. Their names are SystemTitle (for title1) and SystemTitle2-SystemTitle10. If you want to modify the style for title2 use the SystemTitle2 class. When you modify one of the SystemTitle classes, all of the higher-numbered SystemTitle classes automatically get the modification as well. So if you set the fontsize of SystemTitle2 to, say, 24pt, then SystemTitle3-SystemTitle10 get that fontsize. The PowerPointLight and PowerPointDark styles specify that SystemTitle uses fontsize=42pt, SystemTitle2 uses fontsize=24pt, and SystemTitle3-SystemTitle10 uses fontsize=20pt.

 

 

You can read more about ODS styles here.

 

Here's how to view the PowerPointLight and PowerPointDark styles that we supply for the destination for PowerPoint.

 

Good luck!

krm
Obsidian | Level 7 krm
Obsidian | Level 7

Thank you @Tim_SAS great information! 

 

Yes I could get the custom font sizes as you mentioned in your post by using the line below. 

 

proc template;
define style styles.mystyle;
parent = styles.powerpointlight;
class SystemTitle /
fontsize=28pt;
class SystemTitle2 /
fontsize=20pt;
end;
run;

 

 

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 4208 views
  • 1 like
  • 2 in conversation