I'm trying to write to a pdf file using proc odstext and getting additional spaces before some of the words I'm applying the inline style to. This seems to occur regardless of the actual style attribute (bold, italic, underline, ...). I noticed an almost identical post (https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-TEXT-produces-uneven-spacing-in-PDF-output-using-inline/td-p/302373) from some years back that wasn't resolved. And another post that mentions some Microsoft specific fonts causing issues.
The issue doesn't occur without the inline style command or with html output to the browser rather than creating a pdf. It also doesn't matter whether the text comes from a macro variable or not.
I'm including code and example output. You can see the additional spaces before some of the bolded numbers in the text. I appreciate anyone's thoughts on this matter. Thanks.
%let school = "Acme U";
goptions reset=all device=SASPRTC;
ods _ALL_ close;
%let folder = M:\Engagement Surveys - 2024\Scratch\;
%let filename = %sysfunc(dequote(&school));
%let extension = .pdf;
options nodate;
ods pdf file="&folder&filename&extension" startpage=no;
data _null_;
set qc_temp1;
call symputx('faculty', f_count);
call symputx('students', s_count);
run;
ods proclabel = "Introduction";
proc odstext pagebreak = YES;
ods escapechar='^';
p
"Nationally, ^{style[font_weight=Bold]134} member institutions responded to the survey. Across those institutions,
^{style[font_weight=Bold]675} individual faculty members and ^{style[font_weight=Bold]1,124}
students responded. At your institution, ^{style[font_weight=Bold]&faculty.} faculty and ^{style[font_weight=Bold]&students.}
students responded." /
style = {font_size=14pt just=l width=100%};
run;
ods pdf close;
ods listing;
... View more