2
ods escapechar='^';
%let bmi=^S={font_weight=bold} Body Mass Index(Kg/m^{super 2}); 

When i am trying to create pdf o/p my font is changing in output(Superscript appears in different height) O/P

Is there any solution for the above issue

Joe
  • 62,789
  • 6
  • 49
  • 67
user3893852
  • 95
  • 1
  • 8
  • I agree with Joe's answer, but something else you could try is changing `^{super 2}` to `%sysfunc(byte(178))`. – Alex A. Nov 26 '14 at 15:30

1 Answers1

1

I think the problem is that you are overriding the style inline, which SAS handles a bit oddly. I am assuming this is a TITLE element below, but the same rules apply no matter where it's coming from.

<td class="c systemtitle">
  <span class="c" style=" font-weight: bold;"> 
      Body Mass Index(Kg/m<sup>2</sup>)
  </span>
</td>

Notice the class of the span: it's not a systemtitle anymore, it's just a 'c' (which is generic centered text). More than likely your style doesn't properly implement superscripts in generic centered text. I would look at that and see if changing styles works. In general, it is better to do things like the font-weight:bold in styles rather than in inline formatting; you might find you have better luck with that.

I would also add that in the default style in 9.3 for PDF, this isn't a problem, using the default PDF driver in base SAS. If you're running this in EG, it uses a slightly different driver to print PDFs, so that could also be worth trying; options dev=PDF; fixes it.

Joe
  • 62,789
  • 6
  • 49
  • 67