The SAS Output Delivery System and reporting techniques

Nested inline STYLE command(s) (or {^style[]} within {^style[]}) via ODS PDF TEXT statement

Reply
Contributor
Posts: 26

Nested inline STYLE command(s) (or {^style[]} within {^style[]}) via ODS PDF TEXT statement

Hi guys. When involving the inline {^style[...]...} command within another, it seems to push off anything by 1 space after it no matter what as you can see in the PDF attachment. Does anyone know a workaround or quick fix to eliminate that gap without truncating any character that follows it?

 

Feel free to try my test code below:

%let w_httpa=http://www.testa.com/test.html;
%let w_httpb=http://www.testb.com/;
%let w_httpc=http://www.testc.com;

ods escapechar='^';

ods pdf file="C:\Users\pete\Desktop\SAS ODS PDF test\test.pdf" notoc startpage=Never;

ods pdf text="^{style[font_face='Times New Roman' fontweight=bold fontsize=11pt textdecoration=underline]Test 1}";
ods pdf  text="^{style[font_face='Times New Roman' fontsize=10pt]1. It's Test A ^{style[foreground=blue](&w_httpa)}. Again, Test A.}";
ods pdf  text="^{style[font_face='Times New Roman' fontsize=10pt]2. It's Test B ^{style[foreground=blue](&w_httpb)}. Again, Test B.}";
ods pdf  text="^{style[font_face='Times New Roman' fontsize=10pt]3. It's Test C ^{style[foreground=blue](&w_httpc)}. Again, Test C.}";

ods pdf text='^{newline 1}';
ods pdf text="^{style[font_face='Times New Roman' fontweight=bold fontsize=11pt textdecoration=underline]Test 2}";
ods pdf  text="^{style[font_face='Times New Roman' fontsize=10pt]1. It's Test A ( ^{style[foreground=blue]&w_httpa}). Again, Test A.}";
ods pdf  text="^{style[font_face='Times New Roman' fontsize=10pt]2. It's Test B ( ^{style[foreground=blue]&w_httpb}). Again, Test B.}";
ods pdf  text="^{style[font_face='Times New Roman' fontsize=10pt]3. It's Test C ( ^{style[foreground=blue]&w_httpc}). Again, Test C.}";

ods pdf text='^{newline 1}';
ods pdf text="^{style[font_face='Times New Roman' fontweight=bold fontsize=11pt textdecoration=underline]Test 3}";
ods pdf  text="^{style[font_face='Times New Roman' fontsize=10pt]1. It's Test A ( ^{style[foreground=blue]&w_httpa^{style[foreground=black])}}. Again, Test A.}";
ods pdf  text="^{style[font_face='Times New Roman' fontsize=10pt]2. It's Test B ( ^{style[foreground=blue]&w_httpb^{style[foreground=black])}}. Again, Test B.}";
ods pdf  text="^{style[font_face='Times New Roman' fontsize=10pt]3. It's Test C ( ^{style[foreground=blue]&w_httpc^{style[foreground=black])}}. Again, Test C.}";

ods pdf text='^{newline 1}';
ods pdf text="^{style[font_face='Times New Roman' fontweight=bold fontsize=11pt textdecoration=underline]Test 4}";
ods pdf  text="^{style[font_face='Times New Roman' fontsize=10pt]1. It's Test A (}^{style[font_face='Times New Roman' fontsize=10pt foreground=blue]&w_httpa}^{style[font_face='Times New Roman' fontsize=10pt]). Again, Test A.}";
ods pdf  text="^{style[font_face='Times New Roman' fontsize=10pt]1. It's Test B (}^{style[font_face='Times New Roman' fontsize=10pt foreground=blue]&w_httpb}^{style[font_face='Times New Roman' fontsize=10pt]). Again, Test B.}";
ods pdf  text="^{style[font_face='Times New Roman' fontsize=10pt]1. It's Test C (}^{style[font_face='Times New Roman' fontsize=10pt foreground=blue]&w_httpc}^{style[font_face='Times New Roman' fontsize=10pt]). Again, Test C.}";

ods pdf text='^{newline 1}';
ods pdf text="^{style[font_face='Times New Roman' fontweight=bold fontsize=11pt textdecoration=underline]Test 5}";
ods pdf  text="^{style[font_face='Times New Roman' fontsize=10pt]1. It's Test A (}%cmpres(^{style[font_face='Times New Roman' fontsize=10pt foreground=blue]&w_httpa})^{style[font_face='Times New Roman' fontsize=10pt]). Again, Test A.}";
ods pdf  text="^{style[font_face='Times New Roman' fontsize=10pt]1. It's Test B (}%cmpres(^{style[font_face='Times New Roman' fontsize=10pt foreground=blue]&w_httpb})^{style[font_face='Times New Roman' fontsize=10pt]). Again, Test B.}";
ods pdf  text="^{style[font_face='Times New Roman' fontsize=10pt]1. It's Test C (}%cmpres(^{style[font_face='Times New Roman' fontsize=10pt foreground=blue]&w_httpc})^{style[font_face='Times New Roman' fontsize=10pt]). Again, Test C.}";

ods pdf close;
Super User
Posts: 10,511

Re: Nested inline STYLE command(s) (or {^style[]} within {^style[]}) via ODS PDF TEXT statement

It would probably help to show us what you are trying to generate. I am not sure what your goal is or exactly where your "push off anything by 1 space" is.

You might want to look at Proc ODSTEXT as an alternative if you are generating blocks of text as the syntax for appearance may be easier than that many inline calls.

Contributor
Posts: 26

Re: Nested inline STYLE command(s) (or {^style[]} within {^style[]}) via ODS PDF TEXT statement

To close the gap between the quoted website and closing parenthesis. Instead of seeing "...html )", "...com/ )", or "...com )", trying to achieve the same result as Test 1 except the closing parenthesis not being blue.

Ask a Question
Discussion stats
  • 2 replies
  • 196 views
  • 0 likes
  • 2 in conversation