Changing font size of superscript characters

Occasional Contributor
Posts: 9

Changing font size of superscript characters


I have some superscripts on a report which I am running in both rtf and pdf formats. The superscripts work just fine, but the problem is that the pdf superscript defaults to a huge font (larger than the heading text). The rtf remains smaller than the heading text, but is actually a bit TOO small and could probably be made larger.

For example:


"Heading^{super a}"





I have searched for a fix but can't find anything. Does anyone know if there is a way to change the font size for superscripts?

Thanks much!

Super User
Posts: 22,017

Re: Changing font size of superscript characters

Try the style options?

ods pdf text= "^{style [just=c fontsize=14pt font_face=arial font_weight=bold] This is my text}";
Occasional Contributor
Posts: 9

Re: Changing font size of superscript characters

Thanks for the reply. Yes, this works for rtf output if I nest it in the superscript code:

  "Heading^{super ^{style [just=c fontsize=10pt font_face=arial] a}}"

But for some reason it doesn't work the same for pdf. When I use the same code in a pdf, it ignores the superscript instruction and makes the whole line change font. Not sure what's going on with that.

Posts: 9,111

Re: Changing font size of superscript characters


  Well, I'm not entirely certain that this is the cause and you might want to open a track with Tech Support. It was my understanding that Adobe did not use or "like" Arial -- which is a Microsoft specific font (read this article for the background info: The Scourge of Arial.) I believe that if you change the font and/or restructure your statement, that the output will look better.

  I tried the code below (in SAS 9.3) and got better results. I think that you can fix most of the issue by setting an explicit font size for the word "Heading" and then a separate (non-Arial font) for the size and the superscript. Personally, I like to keep the ^{super } escapechar function as self-contained -- so I would have done the style change first and then the super invocation.


ods listing close;

ods escapechar='^';

ods pdf file='c:\temp\testsuper.pdf' notoc;

ods rtf file='c:\temp\testsuper.rtf';

ods html file='c:\temp\testsuper.html';


title1 "^{style[just=c font_size=14pt font_face=Courier]Heading}^{style [just=c font_size=12pt font_face=Courier]^{super a}}";

proc print  data=sashelp.class (obs=2);


ods _all_ close;

Occasional Contributor
Posts: 9

Re: Changing font size of superscript characters

Posted in reply to Cynthia_sas

Thanks Cynthia. The font of Arial isn't critical at all; just used it for testing. Smiley Happy  Courier will probably work better, actually.

Your code revision fixed the problem of SAS changing the "Heading" font, which looks much better! But still the superscript won't change size. I tried everything from font_size=6pt to 24pt and it is always the same size (in pdfs, that is). So, yep, maybe this is a tech support issue?

Thanks again,


Occasional Contributor
Posts: 9

Re: Changing font size of superscript characters

Ok, got a reply from the help desk, which I'll re-post in case anyone else has a similar problem. They stated that there isn't a way to size superscripts on a pdf at the moment. As a quick fix, they recommended I try unicode:

     "Heading^{unicode 00AA}";

Which happened to work great for what I needed, which is only a superscript "a". However, it doesn't solve the problem because there is no unicode superscript for any other letters.

Hopefully this will be fixed in future SAS versions!

Occasional Learner
Posts: 1

Re: Changing font size of superscript characters

Has this been addressed in the later versions of Sas. What is the fix now for other superscripts in PDF report?



Ask a Question
Discussion stats
  • 6 replies
  • 4 in conversation