BookmarkSubscribeRSS Feed
chjones
Calcite | Level 5

Hi Everyone,

 

I am creating an rtf document and am trying to write out a mathematical expression using ods rtf text.  I'm trying to generate x-bar, an X with a bar above it.  I figured this could be easily acheived using ODS RTF TEXT and a textdecoration = overline styling option.  When I run this as a RTF, I do not get the overline; however, the PDF does show the overline.  I use many styling options and have not had what appears to be compatibility issues.  Seems like textdecoration works with ODS PDF, but not ODS RTF.  Am I correct?  Is there a workaround for me to create an X-bar (note: I've already tried unicode but was not able to find an x-bar in the character map)?

 

Any suggestions or advice is greatly appreciated.

 

Best,

Chris

 

 

/*RTF creation*/
ODS ESCAPECHAR = '~';
ODS RTF FILE = "Temp.RTF"; 
ODS RTF TEXT="~{style [just=r textdecoration=overline color=red]Here is some random overlined text.}"; 
ODS RTF CLOSE;

/*PDF creation*/
ODS ESCAPECHAR = '~';
ODS PDF FILE = "Temp.PDF" ; 
ODS PDF TEXT="~{style [just=r textdecoration=overline color=red]Here is some random overlined text.}"; 

ODS PDF CLOSE;

 

 

1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi:

  This was what I got when I used the {unicode} function with ODS ESCAPECHAR, but I also needed to use the Arial Unicode MS font for the overline and caret to look correct:

xbar_rtf.png

Using this code:

ods escapechar='^';

ods rtf file='c:\temp\xbar_phat.rtf';
proc report data=sashelp.class(obs=3);
compute before _page_ / style={font_face="Arial Unicode MS"};
  line 'xbar should be: x^{unicode 0304}';
  line ' ';
  line 'phat should be: p^{unicode 0302}';
endcomp;
run;
ods rtf close;

Hope this helps,

Cynthia

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
  • 1 reply
  • 912 views
  • 0 likes
  • 2 in conversation