BookmarkSubscribeRSS Feed
pavansvc
Fluorite | Level 6

Hi All,

 

I want to increase the font size for superscript in ods pdf.

 

I tried different ways but no use. The output am getting is as attached . The superscript looks too small.

 

This is what am using in my code:

 

define vsdtc_dy / 'Visit Date|(Study Day)^S={font_size=80px}^{Super[1]}' order style={cellwidth=1 in just=c} style(header)={textdecoration=underline};

 

Can anyone help me with this please?

 

Thanks!

Capture.JPG

7 REPLIES 7
ballardw
Super User

Getting the nesting right takes some trial and error.

 

Try

 

   define vsdtc_dy  / 'Visit Date|(Study Day)^{Super^{style [font_size=80px][1]}}' 

note the order and position of elements within the {{ }}

 

BTW, you might consider using a more absolute measure of size such as PT or CM then PX. PX is dependent on display device and may render oddly.

pavansvc
Fluorite | Level 6
I tried the same but no use. If I give big value just the font size is increasing but not like a superscript. If I give less value it is printing like a subscript.
ballardw
Super User

@pavansvc wrote:
I tried the same but no use. If I give big value just the font size is increasing but not like a superscript. If I give less value it is printing like a subscript.

Which version of SAS are you running? You maybe should also include your code including the ODS PDF and the proc report options. Just use one variable.

 

Or start with this, change the X:\DATA\ to a path on your system.

ods escapechar='^';
ods pdf file="x:\data\junk.pdf";
Proc report data=sashelp.class;
   column weight;
   define weight / 'Visit Date|(Study Day)^{Super^{style [font_size=80px][1]}}'
   ;
run;

ods pdf close;

I get a very large [1] following a normal sized (Study Day)

Remove all of the other style elements. Then add them carefully as they are likely also affecting the text. Pay close attention to the order of the {{{  }}} with the other elements.

pavansvc
Fluorite | Level 6
ods listing;
ods escapechar='^';
ods pdf file="\\tgenbkup\users\PSanam\Desktop\New folder\junk.pdf";
Proc report data=sashelp.class split='|';
   column weight;
   define weight / 'Visit Date|(Study Day)^{Super^{style [font_size=15px][1]}}'style= {cellwidth=1.75 in just=c};
run;
ods pdf close;
ods listing;

I have tried as above and the output is coming like the following:

 

Capture.JPG

ballardw
Super User

 

I don't normally work with PDF and this appears to be some issue that PDF is not honoring the superscript, though your use of 15PX is apparently awful close to the font size and disguising that behavior.

 

That's about as far as I can take this. Maybe @Cynthia_sas has some ideas.

 

Cynthia_sas
SAS Super FREQ

Hi:

  I don't think the version of SAS has anything to do with it. It was my understanding that PDF really wanted PT sizes, not PX. So I don't know how the 15PX got translated to PTs for PDF file creation.

 

  I usually use PT when I use font_size with PDF. It looks to me like 15PX is translated to too big a point size.

 

  With questions like this, I usually ask myself what is the default? Is the default OK? Do I really need to change the default. To my eye, I don't like the parentheses and then the brackets in the output created by the original code. When I modify the code only slightly. I get these results:

super_size.png

 

If you really want to fiddle with the size of the superscript, then my suggestion is to switch to point sizes, but Superscript is supposed to automatically do that for you. If I explicitly change the font for the header cell, it seems to me that ^{super} adjusts automatically. For example, if I do this:

whole_cell_bigger_font.png

 

Then it looks like the superscript is sized appropriately for 14pt font in the cell. And using the location with the style override, allows me to change the size of the data cell separately from the size of the Header cell.

 

I am not sure that you can actually specify a font size for the superscript. That would be a question for Tech Support. I thought that SUPER carried it's own way to adjust the font_size.

 

Cynthia

 

 

pavansvc
Fluorite | Level 6
Am using SAS 9.4 version

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 1451 views
  • 0 likes
  • 3 in conversation