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;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.