<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Add Levels to Table of Contents in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Levels-to-Table-of-Contents/m-p/673157#M24305</link>
    <description>&lt;P&gt;I am working on a document that I want to give an extensive ToC. I have used the information at&amp;nbsp;&lt;A href="https://support.sas.com/resources/papers/proceedings/proceedings/forum2007/097-2007.pdf" target="_blank" rel="noopener"&gt;https://support.sas.com/resources/papers/proceedings/proceedings/forum2007/097-2007.pdf&lt;/A&gt;&amp;nbsp;to generate one using ODS RTF and \tc RTF tags. Everything is working fine except I would like to add levels to it (tabbed over). As you can see in my picture below, there are section headings and then subsections. I assume this can be accomplished by altering the template for different heading levels, but I'm not quite sure how to execute that. I'm using PROC ODSTEXT for the actual text in the document and tried to just apply H1 and H2 where I wanted the leveling, but this did not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="toc_ex.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47765iFEA147A5D4BBAF0E/image-size/large?v=v2&amp;amp;px=999" role="button" title="toc_ex.png" alt="toc_ex.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Code sample for style template and first section and subsection:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* define document template */
proc template; 
define style styles.drtf; 
parent= styles.rtf; 
style fonts / 
'TitleFont2' = ("Arial",12pt,bold italic) 
'TitleFont' = ("Arial",13pt,bold italic) 
'StrongFont' = ("Arial",10pt,bold) 
'EmphasisFont' = ("Arial",10pt,italic) 
'FixedEmphasisFont' = ("Arial",9pt,italic) 
'FixedStrongFont' = ("Arial",9pt,bold) 
'FixedHeadingFont' = ("Arial",9pt,bold) 
'BatchFixedFont' = ("Arial",6.7pt) 
'FixedFont' = ("Arial",9pt) 
'headingEmphasisFont' = ("Arial",11pt,bold italic) 
'headingFont' = ("Arial",11pt,bold) 
'docFont' = ("Arial",10pt); 
class GraphFonts / 
'NodeDetailFont' = ("Arial",7pt) 
'NodeInputLabelFont' = ("Arial",9pt) 
'NodeLabelFont' = ("Arial",9pt) 
'NodeTitleFont' = ("Arial",9pt) 
'GraphDataFont' = ("Arial",8pt) 
'GraphUnicodeFont' = ("&amp;lt;MTserif-unicode&amp;gt;",9pt) 
'GraphValueFont' = ("Arial",10pt) 
'GraphLabel2Font' = ("Arial",11pt) 
'GraphLabelFont' = ("Arial",11pt) 
'GraphFootnoteFont' = ("Arial",11pt) 
'GraphTitleFont' = ("Arial",12pt,bold) 
'GraphTitle1Font' = ("Arial",15pt,bold) 
'GraphAnnoFont' = ("Arial",10pt);
style color_list 
"Colors used in the default style" / 
'link' = blue 
'bgH' = grayBB 
'fg' = &amp;amp;DBlack. 
'bg' = _undef_; 
class Heading1 / 
foreground = &amp;amp;DBlack.
fontfamily = "Arial";
style header from header /protectspecialchars=off;
style data from data /protectspecialchars=off;
style rowheader from rowheader / protectspecialchars=off;
style systemtitle from systemtitle /protectspecialchars=off;
style systemfooter from systemfooter /protectspecialchars=off;
style usertext from usertext /protectspecialchars=off OutputWidth = 100%;
style byline from byline /protectspecialchars=off; 
end; 
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods rtf file="&amp;amp;path.\Summary Report\summary_report_1920.rtf" 
	nogtitle nogfootnote style=styles.drtf notoc_data;
goptions reset=all;
ods noresults; 

/* sensitive content removed */

/* page 3 */
proc odstext pagebreak=yes;
	h "{\scaps Contents}" / style={fontfamily='Arial' fontweight=bold font_size=12pt just=c};
run;

ODS RTF TEXT="{\field{\*\fldinst {\\TOC \\f \\h} } }"; RUN; 

/* Section I */
proc odstext pagebreak=yes;
	h1 "^20n {\tc {\scaps I. Introduction &amp;amp; Methodology}}" / style={fontfamily='Arial' fontweight=bold font_size=12pt just=c};
run;

/* Section I Content */
proc odstext pagebreak=yes;
	h2 "{\tc {\scaps 1.1 Project Overview}}" / style={fontfamily='Arial' fontweight=bold font_size=10pt just=l};
	p ;
	p "stuff" / style={fontfamily='Arial' font_size=10pt foreground=&amp;amp;Dblack.};
run;

/* close rtf */
ods rtf close;
ods html;
ods graphics on / reset;
ods results;
/******** end rtf document ********/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jul 2020 16:03:32 GMT</pubDate>
    <dc:creator>tburus</dc:creator>
    <dc:date>2020-07-29T16:03:32Z</dc:date>
    <item>
      <title>Add Levels to Table of Contents</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Levels-to-Table-of-Contents/m-p/673157#M24305</link>
      <description>&lt;P&gt;I am working on a document that I want to give an extensive ToC. I have used the information at&amp;nbsp;&lt;A href="https://support.sas.com/resources/papers/proceedings/proceedings/forum2007/097-2007.pdf" target="_blank" rel="noopener"&gt;https://support.sas.com/resources/papers/proceedings/proceedings/forum2007/097-2007.pdf&lt;/A&gt;&amp;nbsp;to generate one using ODS RTF and \tc RTF tags. Everything is working fine except I would like to add levels to it (tabbed over). As you can see in my picture below, there are section headings and then subsections. I assume this can be accomplished by altering the template for different heading levels, but I'm not quite sure how to execute that. I'm using PROC ODSTEXT for the actual text in the document and tried to just apply H1 and H2 where I wanted the leveling, but this did not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="toc_ex.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47765iFEA147A5D4BBAF0E/image-size/large?v=v2&amp;amp;px=999" role="button" title="toc_ex.png" alt="toc_ex.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Code sample for style template and first section and subsection:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* define document template */
proc template; 
define style styles.drtf; 
parent= styles.rtf; 
style fonts / 
'TitleFont2' = ("Arial",12pt,bold italic) 
'TitleFont' = ("Arial",13pt,bold italic) 
'StrongFont' = ("Arial",10pt,bold) 
'EmphasisFont' = ("Arial",10pt,italic) 
'FixedEmphasisFont' = ("Arial",9pt,italic) 
'FixedStrongFont' = ("Arial",9pt,bold) 
'FixedHeadingFont' = ("Arial",9pt,bold) 
'BatchFixedFont' = ("Arial",6.7pt) 
'FixedFont' = ("Arial",9pt) 
'headingEmphasisFont' = ("Arial",11pt,bold italic) 
'headingFont' = ("Arial",11pt,bold) 
'docFont' = ("Arial",10pt); 
class GraphFonts / 
'NodeDetailFont' = ("Arial",7pt) 
'NodeInputLabelFont' = ("Arial",9pt) 
'NodeLabelFont' = ("Arial",9pt) 
'NodeTitleFont' = ("Arial",9pt) 
'GraphDataFont' = ("Arial",8pt) 
'GraphUnicodeFont' = ("&amp;lt;MTserif-unicode&amp;gt;",9pt) 
'GraphValueFont' = ("Arial",10pt) 
'GraphLabel2Font' = ("Arial",11pt) 
'GraphLabelFont' = ("Arial",11pt) 
'GraphFootnoteFont' = ("Arial",11pt) 
'GraphTitleFont' = ("Arial",12pt,bold) 
'GraphTitle1Font' = ("Arial",15pt,bold) 
'GraphAnnoFont' = ("Arial",10pt);
style color_list 
"Colors used in the default style" / 
'link' = blue 
'bgH' = grayBB 
'fg' = &amp;amp;DBlack. 
'bg' = _undef_; 
class Heading1 / 
foreground = &amp;amp;DBlack.
fontfamily = "Arial";
style header from header /protectspecialchars=off;
style data from data /protectspecialchars=off;
style rowheader from rowheader / protectspecialchars=off;
style systemtitle from systemtitle /protectspecialchars=off;
style systemfooter from systemfooter /protectspecialchars=off;
style usertext from usertext /protectspecialchars=off OutputWidth = 100%;
style byline from byline /protectspecialchars=off; 
end; 
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods rtf file="&amp;amp;path.\Summary Report\summary_report_1920.rtf" 
	nogtitle nogfootnote style=styles.drtf notoc_data;
goptions reset=all;
ods noresults; 

/* sensitive content removed */

/* page 3 */
proc odstext pagebreak=yes;
	h "{\scaps Contents}" / style={fontfamily='Arial' fontweight=bold font_size=12pt just=c};
run;

ODS RTF TEXT="{\field{\*\fldinst {\\TOC \\f \\h} } }"; RUN; 

/* Section I */
proc odstext pagebreak=yes;
	h1 "^20n {\tc {\scaps I. Introduction &amp;amp; Methodology}}" / style={fontfamily='Arial' fontweight=bold font_size=12pt just=c};
run;

/* Section I Content */
proc odstext pagebreak=yes;
	h2 "{\tc {\scaps 1.1 Project Overview}}" / style={fontfamily='Arial' fontweight=bold font_size=10pt just=l};
	p ;
	p "stuff" / style={fontfamily='Arial' font_size=10pt foreground=&amp;amp;Dblack.};
run;

/* close rtf */
ods rtf close;
ods html;
ods graphics on / reset;
ods results;
/******** end rtf document ********/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 16:03:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Levels-to-Table-of-Contents/m-p/673157#M24305</guid>
      <dc:creator>tburus</dc:creator>
      <dc:date>2020-07-29T16:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Add Levels to Table of Contents</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Levels-to-Table-of-Contents/m-p/673167#M24306</link>
      <description>&lt;P&gt;As a minimum show the code used.&lt;/P&gt;
&lt;P&gt;Sometimes issues just need minor tweaks to code. Sometimes your code may have specified options that prevent something. But to tell which we need to see the code.&lt;/P&gt;
&lt;P&gt;Better would be to post a small example of any data sets used if needed in the form of data step code so we can test code with actual data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Post code in a code box opened on the forum using either the &amp;lt;/&amp;gt; or "running man" icon to prevent the main message windows from reformatting your code and possibly inserting HTML tags that might mean the code posted is not what you have actually attempted.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 15:07:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Levels-to-Table-of-Contents/m-p/673167#M24306</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-29T15:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Add Levels to Table of Contents</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Levels-to-Table-of-Contents/m-p/673168#M24307</link>
      <description>Hi: &lt;BR /&gt;Do you mean PRETEXT, not PROTEXT? That was a user-submitted paper and is 13 years old. It was probably SAS 9.1 or 9.2 version of ODS RTF. This might be a question for either Tech Support, because they can look at ALL of your code and all of your RTF controls and see whether they have a solution or workaround based on what version of SAS you're using or you might try to contact the paper author to see what her suggestions are.&lt;BR /&gt;Cynthia</description>
      <pubDate>Wed, 29 Jul 2020 15:10:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Levels-to-Table-of-Contents/m-p/673168#M24307</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-07-29T15:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: Add Levels to Table of Contents</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Levels-to-Table-of-Contents/m-p/673186#M24309</link>
      <description>Wow! How did I not catch that typo? It should be PROC ODSTEXT (fixed in original now).&lt;BR /&gt;&lt;BR /&gt;I know that's an old paper, but I cannot find anything with differing information for 9.4 or greater, so I figure it's still good. And it works. The author doesn't give any input on how to add levels their self, so it's not an issue of bad code, just one of not knowing how to add further code to get what I want.</description>
      <pubDate>Wed, 29 Jul 2020 15:47:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Levels-to-Table-of-Contents/m-p/673186#M24309</guid>
      <dc:creator>tburus</dc:creator>
      <dc:date>2020-07-29T15:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: Add Levels to Table of Contents</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Levels-to-Table-of-Contents/m-p/673187#M24310</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/329503"&gt;@tburus&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Wow! How did I not catch that typo? It should be PROC ODSTEXT (fixed in original now).&lt;BR /&gt;&lt;BR /&gt;I know that's an old paper, but I cannot find anything with differing information for 9.4 or greater, so I figure it's still good. And it works. The author doesn't give any input on how to add levels their self, so it's not an issue of bad code, just one of not knowing how to add further code to get what I want.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Which is why sharing your current cod is a good idea.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 15:56:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Levels-to-Table-of-Contents/m-p/673187#M24310</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-29T15:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Add Levels to Table of Contents</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Levels-to-Table-of-Contents/m-p/673189#M24311</link>
      <description>I have edited to include relevant code. Thanks.</description>
      <pubDate>Wed, 29 Jul 2020 16:03:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Levels-to-Table-of-Contents/m-p/673189#M24311</guid>
      <dc:creator>tburus</dc:creator>
      <dc:date>2020-07-29T16:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Add Levels to Table of Contents</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Levels-to-Table-of-Contents/m-p/673194#M24312</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; In looking here at the RTF specification:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://ftp.artifax.net/ArtRep/2.0/Help/rtf.htm#Heading45" target="_blank"&gt;http://ftp.artifax.net/ArtRep/2.0/Help/rtf.htm#Heading45&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rtf_tc_spec.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47774i69A43BAD93BBC185/image-size/large?v=v2&amp;amp;px=999" role="button" title="rtf_tc_spec.png" alt="rtf_tc_spec.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like you might have to use a number to control the levels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 16:15:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Levels-to-Table-of-Contents/m-p/673194#M24312</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-07-29T16:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Add Levels to Table of Contents</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Levels-to-Table-of-Contents/m-p/673204#M24313</link>
      <description>That seems to be what I want, but when I apply it as "\tcl1", the "l 1" goes into the document and the "\tc" part gets ignored. Is there possibly something I need to do to let the system know I am using the longer tag? I'm not super familiar with RTF tags or their documentation.</description>
      <pubDate>Wed, 29 Jul 2020 16:33:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Levels-to-Table-of-Contents/m-p/673204#M24313</guid>
      <dc:creator>tburus</dc:creator>
      <dc:date>2020-07-29T16:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Add Levels to Table of Contents</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Levels-to-Table-of-Contents/m-p/673207#M24314</link>
      <description>Nevermind. I have to add both the \tc and the \tcl1 tags. Thanks.</description>
      <pubDate>Wed, 29 Jul 2020 16:37:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Levels-to-Table-of-Contents/m-p/673207#M24314</guid>
      <dc:creator>tburus</dc:creator>
      <dc:date>2020-07-29T16:37:13Z</dc:date>
    </item>
  </channel>
</rss>

