Hi - I have seen on various posts (including this one; Determining ods pdf text size) that to change the font size of ODS PDF TEXT, a style template such as in the following code can be used. Unfortunately this does not change the font size of text within PROC ODSTEXT and I do not want to add style modifiers to each occurrence of PROC ODSTEXT.
Proc template;
Define style Style.Custom;
parent=styles.default;
style usertext from usertext /
font_size=18pt
font_weight=bold;
end;
run;
ods pdf file='c:\temp\use_bold.pdf' style=Style.Custom ;
ods escapechar='^';
options nodate;
title 'Using PROC ODSTEXT';
footnote 'The ODS Destination for PDF';
proc odstext;
p 'The following word is styled; ^{style[color=purple fontweight=bold]HERE}^{newline 2}';
p 'You can ^{style[textdecoration=underline]also} format your text.' / style=[color=red];
run;
ods pdf text="Only this font size is 18pt";
ods _all_ close;
This code gives the following:
How can I determine the style element to adjust to change all font sizes for PROC ODSTEXT / how should the template be modified?
Thanks.
Use the Paragraph style element for the PROC ODSTEXT statement and the Usertext for the ODS TEXT=. Try the below and this should give you the desired results.
Proc template;
Define style Style.Custom;
parent=styles.default;
class usertext /
font_size=18pt
font_weight=bold;
style paragraph from usertext;
end;
run;
ods pdf file='c:\temp\use_bold1.pdf' style=Style.Custom ;
ods escapechar='^';
options nodate;
title 'Using PROC ODSTEXT';
footnote 'The ODS Destination for PDF';
proc odstext;
p 'The following word is styled; ^{style[color=purple fontweight=bold]HERE}^{newline 2}';
p 'You can ^{style[textdecoration=underline]also} format your text.' / style=[color=red];
run;
ods pdf text="Only this font size is 18pt";
ods _all_ close;
Use the Paragraph style element for the PROC ODSTEXT statement and the Usertext for the ODS TEXT=. Try the below and this should give you the desired results.
Proc template;
Define style Style.Custom;
parent=styles.default;
class usertext /
font_size=18pt
font_weight=bold;
style paragraph from usertext;
end;
run;
ods pdf file='c:\temp\use_bold1.pdf' style=Style.Custom ;
ods escapechar='^';
options nodate;
title 'Using PROC ODSTEXT';
footnote 'The ODS Destination for PDF';
proc odstext;
p 'The following word is styled; ^{style[color=purple fontweight=bold]HERE}^{newline 2}';
p 'You can ^{style[textdecoration=underline]also} format your text.' / style=[color=red];
run;
ods pdf text="Only this font size is 18pt";
ods _all_ close;
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.
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.