The traditional ODS RTF destination does not display PRETEXT= and POSTTEXT= style attributes correctly in output


You can use the PRETEXT= or POSTTEXT= style attributes in the REPORT procedure to generate a text string before or after a table so that the text appears as a TITLE or FOOTNOTE statement.

When this technique is used in the ODS RTF destination with the ODS escape character to resolve inline-style functions or commands, the characters display incorrectly as text, as shown here:

Characters displayed incorrectly

The escape-character functions, such as {^SUB} and {^SUPER}, and the command ^n are interpreted incorrectly as a literal text string.

The syntax that creates the incorrect output is as follows:

proc report style(report)=[posttext=" ^n SuperScript test ^{super 2}"];

Workaround

To work around this issue, use the RTF destination-specific backslash as the escape character, as shown here:

proc report style(report)=[posttext=" \n SuperScript test {\super 2}"];