- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to have the hanging footnote, which is properly wrapped according to my requirements. I am using "^R/RTF'\....." commands. I don't have much experience in this area and am looking for suggestions on achieving my requirements.
In the following footnote 1, I want the wrapping of the text to happen after the ":" in the Text "Challenges:" just like how it happens with footnote 2. I don't know what number I have to give there so that it properly aligns. Thank you for your suggestions.
How it generating:
How I want
options orientation = landscape errors = 2 missing = ' ' ls = 175 nofmterr nobyline noquotelenmax;
ods escapechar = '^';
ods results on;
ods listing close;
ods rtf file = "xx\sample.rtf" ;
title "";
PROC REPORT DATA= sashelp.class LS=145 PS=55 SPLIT="?" HEADLINE CENTER MISSING FORMCHAR(2)='_' ;
** titles **;
footnote1 j = l "^R/RTF'\brdrb\brdrs '";
footnote2 j = l "^R/RTF'\li575\fi-575 'Challenges: This is a very long footnote characters greater than 230 which may need proper hanging indentation, it should have enough empty space, second line should align like the second footnote in this document.";
footnote3 j = l "^R/RTF'\li575\fi-575 'Note: NVDIA have a very good quarter this year, which made approximately more than 250 Billion dollars which caused the raise in DOW in stock market.";
ods rtf close;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
This is what I managed to produce -- I got the numbers by reverse-engineering the numbers (see below):
I went into Word and created a document with footnotes and hanging indents (without SAS) and once the hanging indents looked the way I wanted them to look in Word, I saved the document as an RTF file. Since an RTF file is just an ASCII text file, then I opened the RTF file in Notepad. I left the 575 for the 3rd footnote because it seemed to be working, so in the RTF file I just focused on searching for the word "Challenges" (but remember, I had the footnote looking the way I wanted it to look before I saved the RTF file. Here's what Notepad showed me:
Rather than worrying about all of the RTF control strings, I just focused on getting that 1296 number out of the RTF file (that was the reverse engineering) and then because I saw the \pard in the RTF file, I added that to the beginning of the footnotes in my test.
The issue that I see with this technique (reverse-engineering to get the right number of TWIPS for fi and li) is that if you used a different word instead of Challenges, then you'd have to reverse-engineer again to get the new number. So while this technique is probably OK for one report with one footnote, my tendency would be to convince the user to go with a different display instead of hanging indent. For example, if I replace the word "Challenges" with the word "Stuff", this is what I would get (using the same li and fi values as shown in my screen shot):
So, it is a bit too fiddly for me to constantly reverse engineer the right value for TWIPS for the hanging indent.
Cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
1) LS and PS will be ignored by ODS RTF and you've closed the LISTING destination, so you do not need these options. (Also applies to LS= in OPTIONS statement)
2) Also, HEADLINE is ignored by ODS RTF for the same reason.
3) FORMCHAR is also a LISTING option ignored by ODS RTF
4) This paper https://www.lexjansen.com/wuss/2017/53_Final_Paper_PDF.pdf describes the number in the RTF commands \li and \fi to be specified in TWIPS (twentieth of a printers point). So right now, it appears that you are making values the same for both footnotes. However, I think that you might also have to make each footnote a separate paragraph, so that you can indent each footnote separately.
Cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Cynthia,
Thank you for the suggestions; I will correct those you mentioned in 1, 2, and 3. ( I am overusing those options where not needed). I read the article mentioned in the 4 before not able to achieve it,. Unfortunately, I played with the numbers in the 'RTF\li, 'but it did not work the way I wanted.
You made a good point about making them separate footnotes lines ( paragraphs) to indent. However, if you observe the "footnote 3", it was wrapped perfectly with the 'Note:. "I was thinking of achieving the same with "footnote2."
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
This is what I managed to produce -- I got the numbers by reverse-engineering the numbers (see below):
I went into Word and created a document with footnotes and hanging indents (without SAS) and once the hanging indents looked the way I wanted them to look in Word, I saved the document as an RTF file. Since an RTF file is just an ASCII text file, then I opened the RTF file in Notepad. I left the 575 for the 3rd footnote because it seemed to be working, so in the RTF file I just focused on searching for the word "Challenges" (but remember, I had the footnote looking the way I wanted it to look before I saved the RTF file. Here's what Notepad showed me:
Rather than worrying about all of the RTF control strings, I just focused on getting that 1296 number out of the RTF file (that was the reverse engineering) and then because I saw the \pard in the RTF file, I added that to the beginning of the footnotes in my test.
The issue that I see with this technique (reverse-engineering to get the right number of TWIPS for fi and li) is that if you used a different word instead of Challenges, then you'd have to reverse-engineer again to get the new number. So while this technique is probably OK for one report with one footnote, my tendency would be to convince the user to go with a different display instead of hanging indent. For example, if I replace the word "Challenges" with the word "Stuff", this is what I would get (using the same li and fi values as shown in my screen shot):
So, it is a bit too fiddly for me to constantly reverse engineer the right value for TWIPS for the hanging indent.
Cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Oh, Wow💗💗💗💗💗 it. Thank you for taking the time to resolve this for me. Yes, I am learning something completely new today. I tried with different texts, it worked for me. Yes, my reports have different texts, but not more than 10, So I will make it a macro variable.
PS: You are just like "Ben Affleck" in a movie called "Paycheck" ( Reverse Engineering). Thank you again.