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;
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.
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.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.