BookmarkSubscribeRSS Feed
nirali514
Obsidian | Level 7

Can you underline one word in an ods text =  statement?

 

For example:

 

ods text= "^S={ font_face = 'Times New Roman' just=j fontweight=light fontsize=12pt color=black}Background:For this project, we are looking for..."

 

I would like to ONLY underline the word "Background" above.

 

Thanks!

3 REPLIES 3
lopezr
Obsidian | Level 7

Here are 2 options:

 

Option 1 using inline formatting:

ods text= "^S={ font_face = 'Times New Roman' just=j fontweight=light 
fontsize=12pt color=black textdecoration=underline}Background 
^S={font_face = 'Times New Roman' just=j fontweight=light 
fontsize=12pt color=black}: For this project, we are looking for...";

Option 2 if you are using RTF then you can use RTF control words to control style:

ods rtf file="UnderlineOneWord.rtf";
ods text= "^S={ font_face = 'Times New Roman' just=j fontweight=light fontsize=12pt color=black protectspecialchars=off}
\ul{Background}\ul0 : For this project, we are looking for...";
ods rtf close;
HB
Barite | Level 11 HB
Barite | Level 11

Theoretically, you could use CSS styles and use a pseudo class:

 

p:first-word{text-decoration:underline;}

but I don't think that is supported. 

 

 

I can do this:

ods listing;
ods html file="text.html" style=mystyle;
ods pdf file="text.pdf" startpage=never notoc style=mystyle;
ods rtf file="text_trad.rtf" style=mystyle;
ods escapechar='^';

title "January Orders ";
footnote " For All Employees";

ods text="My text 1";

ods text="^S={textdecoration=underline}My^S={} Text 2"; 

data grades;
   input id grade1 grade2 grade3 grade4;
datalines;
1105 1 2 3 4
1106 2 2 2 2
1107 3 3 4 6
;
run;

proc print data=grades;
run;

ods text="My Text 3"; 

ods pdf close;

ods rtf close;

title;
footnote;

proc template;
   delete mystyle;
   run;

The key statement there is 

 

ods escapechar='^';

 

and then its use with

^S={textdecoration=underline}My^S={}

 

See if that gets you anywhere.

nirali514
Obsidian | Level 7

Thank you, this helps!

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 656 views
  • 0 likes
  • 3 in conversation