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;

 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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