BookmarkSubscribeRSS Feed
Peter_L
Quartz | Level 8

I want a footnote in my output with a left-aligned long text string and a small right-aligned image. I can do this with the following code:

 

ods escapechar='^';
footnote1 "Very long text which wraps half-way across the page because of a design error" justify=right "^{style [postimage='image.png']}";

This works the same in both HTML and PDF. The text wraps half-way across the page. It looks something like this:

 

Very long text which wraps half-way across the page because of a                       [image]
design error

 

On inspecting the HTML I can see that SAS generates a table with two cells in this case. The widths are fixed at 50% each. In my view this is a design error. The widths should adapt to the contents with the auto table layout algorithm of CSS. A better solution would be to implement the separately aligned text strings with HTML SPAN elements and CSS style text-align, which can be left, center and right. Exactly the same applies to a title as it is also a table.

 

I have tried to work around this with no success. In HTML with CSS it is trivially simple to make an image or inline text float right. As I want this to work in HTML and PDF I have to use SAS's complex ODS.

 

Has anyone found a way to make ODS float an image right in a footnote without causing the footnote to be split into two table cells?

 

Version: SAS 9.4M5 64-bit on Windows 10.

2 REPLIES 2
tsap
Pyrite | Level 9

Have you tried putting the image on a separate line below the main footer text? Like this:

 

ods escapechar='^';
footnote1 "Very long text which wraps half-way across the page because of a design error";
footnote2 justify=right "^{style [postimage='image.png']}";

From my own testing, it looks like that should accomplish what you are attempting to achieve.

Peter_L
Quartz | Level 8
Thanks for investigating this. I had realised that the image could go on a separate line. My use case requires it on the same line as the text.


sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 2 replies
  • 482 views
  • 0 likes
  • 2 in conversation