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;
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:
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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.