BookmarkSubscribeRSS Feed
MattR
Calcite | Level 5

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!

6 REPLIES 6
Reeza
Super User

Try the style options?

ods pdf text= "^{style [just=c fontsize=14pt font_face=arial font_weight=bold] This is my text}";
MattR
Calcite | Level 5

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.

Cynthia_sas
SAS Super FREQ

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;

MattR
Calcite | Level 5

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

MattR
Calcite | Level 5

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!

SasUser2004
Calcite | Level 5

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

 

Thanks.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 4237 views
  • 6 likes
  • 4 in conversation