Changing font size of superscript characters

Reply
Occasional Contributor
Posts: 9

Changing font size of superscript characters

Hi,

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:

Code:

"Heading^{super a}"

RTF:

rtf.jpg

PDF:

pdf.jpg

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: 17,829

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.

SAS Super FREQ
Posts: 8,743

Re: Changing font size of superscript characters

Hi:

  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.

cynthia

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);

run;

ods _all_ close;

Occasional Contributor
Posts: 9

Re: Changing font size of superscript characters

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,

Matt

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!

Ask a Question
Discussion stats
  • 5 replies
  • 1345 views
  • 6 likes
  • 3 in conversation