BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,
I have been using ODS to output my PROC REPORT to an RTF file and have been successfully using the ODS ESCAPCHAR to allow me to display subscript values in my titles - eg by using:

ods escapechar='^';
title1 "subscript^{sub 1}";

However, I am now trying to produce RTF graphs using the same method (from a PROC GPLOT), but the subscript does not seem to work.

The only difference is that for the PROC REPORT output I have been using ODS TAGSET.RTF (as I wanted my titles outside the header box in word) whereas for the plots I am using standard ODS RTF.

I dont think this should be the reason the {sub xx} method is not working as the SAS help indicates that the only restriction in using the {sub xx} option is that 'Microsoft Word honors only one level of subscript for RTF, TAGSETS RTF, and PRINTER.'

If anyone can think of a reason why this would work for PROC REPORT output, but not for PROC GPLOT output then that would be very useful, and if anyone has an alternative method of being able to produce subscript numbers within my graph titles and axis labels then this would be very much appreciated.

Thanks in advance,

Paul
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
Normally ODS ESCAPECHAR functions do not work with the SAS/Graph procedures in the same way that they do with ODS "tabular" procedures, like PROC REPORT, PROC MEANS, etc.

Starting in SAS 9.2, you -can- use some of the UNICODE ESCAPECHAR functions, but those mostly work with the "new" SG procedures and with template-based graphics. PROC GPLOT, on the other hand uses device-based graphics, in which an image is created, and when that image is built, ESCAPECHAR functions do not normally work.

However, if you wanted a superscript 1 in the title of the "device-based" procedures in SAS 9.2 you should be able to change fonts in the following manner:
[pre]
ods listing style=listing;
options gstyle;

** Use superscript and subscripts from the Arial Unicode MS font;
goptions reset=all;
** Superscripts in Unicode Font;
title f='Albany AMT' h=20pt 'Superscript zero' f='Arial Unicode MS/unicode' '2070'x;
title2 f='Albany AMT' h=20pt 'Superscript one' f='Arial Unicode MS/unicode' '00B9'x;
title3 f='Albany AMT' h=20pt 'Superscript two' f='Arial Unicode MS/unicode' '00B2'x;
title4 f='Albany AMT' h=20pt 'Superscript three' f='Arial Unicode MS/unicode' '00B3'x;
title5 f='Albany AMT' h=20pt 'Superscript four' f='Arial Unicode MS/unicode' '2074'x;
title6 f='Albany AMT' h=20pt 'Superscript five' f='Arial Unicode MS/unicode' '2075'x;
title7 f='Albany AMT' h=20pt 'Superscript six' f='Arial Unicode MS/unicode' '2076'x;
title8 f='Albany AMT' h=20pt 'Superscript seven' f='Arial Unicode MS/unicode' '2077'x;
title9 f='Albany AMT' h=20pt 'Superscript eight' f='Arial Unicode MS/unicode' '2078'x
f='Albany AMT' ' and Superscript nine' f='Arial Unicode MS/unicode' '2079'x;
title10 f='Albany AMT' h=20pt 'Superscript formula'
f='Arial Unicode MS/unicode' '207D2074207A2075207C2079207E'x;

** Subscripts in Unicode Font;
footnote f='Albany AMT' h=20pt 'Subscript zero' f='Arial Unicode MS/unicode' '2080'x;
footnote2 f='Albany AMT' h=20pt 'Subscript one' f='Arial Unicode MS/unicode' '2081'x;
footnote3 f='Albany AMT' h=20pt 'Subscript two' f='Arial Unicode MS/unicode' '2082'x;
footnote4 f='Albany AMT' h=20pt 'Subscript three' f='Arial Unicode MS/unicode' '2083'x;
footnote5 f='Albany AMT' h=20pt 'Subscript four' f='Arial Unicode MS/unicode' '2084'x;
footnote6 f='Albany AMT' h=20pt 'Subscript five' f='Arial Unicode MS/unicode' '2085'x;
footnote7 f='Albany AMT' h=20pt 'Subscript six' f='Arial Unicode MS/unicode' '2086'x;
footnote8 f='Albany AMT' h=20pt 'Subscript seven' f='Arial Unicode MS/unicode' '2087'x;
footnote9 f='Albany AMT' h=20pt 'Subscript eight' f='Arial Unicode MS/unicode' '2088'x
f='Albany AMT' ' and Subscript nine' f='Arial Unicode MS/unicode' '2089'x;
footnote10 f='Albany AMT' h=20pt 'Subscript formula'
f='Arial Unicode MS/unicode' '208D2084208A2085208C2089208E'x;
proc gslide;
run;
quit;
[/pre]

Otherwise, investigate the MOVE command on the TITLE statement to write super and sub-script numbers...something like this, which writes out the formula for water with a subscripted '2':
[pre]
footnote c=blue h=4 pct 'Note: Water is H'
m=(+0,-1.75) pct h=2.5 pct '2'
m=(+0,+1.75) pct h=4 pct 'O';
[/pre]

cynthia
deleted_user
Not applicable
Cynthia,
This is absolutley fantasitc!
Thanks so much for your help.

Paul

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 2226 views
  • 0 likes
  • 2 in conversation