MATLAB: How to adjust the left indent of the “Table of Contents” Title line using MATLAB Report Generator R2010b (3.9)

contentsgeneratorindentMATLAB Report Generatorofreporttable

I have created a report to be generated in PDF format and I have also created a stylesheet to go with it.
I would like to be able to indent the "Table of Contents" title.
I looked at the "TOC Margin Properties" property set but did not find any attribute to indent the title.
Is there a way to do this?

Best Answer

The indentation of the title of the "table of contents" can be modified using the "start-indent" attribute within the "TOC Margin Properties" set in MATLAB Report Generator R2010b (3.9).
These are the steps to follow to include the "Start-Indent" attribute to the "TOC Margin Properties" property set:
1) Open the stylesheet RGS file using a text editor.
2) Find the following code:
<xsl_code>
3) Include the following lines of code below after the above line
<xsl:template name="table.of.contents.titlepage.recto">
<fo:block xmlns:fo="<http://www.w3.org/1999/XSL/Format http://www.w3.org/1999/XSL/Format"> xsl:use-attribute-sets="table.of.contents.titlepage.recto.style" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em" space-after="0.5em" font-size="17.28pt" font-weight="bold" font-family="{$title.fontset}">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'TableofContents'"/>
</xsl:call-template>
</fo:block>
</xsl:template>
<xsl:attribute-set name="toc.margin.properties">
<xsl:attribute name="start-indent">
<xsl:value-of select="'0in'"/>
</xsl:attribute>
</xsl:attribute-set>
The 0in in the third line can be modified to required indentation of the title.
4) Save the stylesheet file.
5) Execute the following on the MATLAB command prompt:
rptconvert -clearcache
6) Generate the report using this modified stylesheet.
Please refer to the stylesheet attached which illustrates the use of the "start-indent" within the "TOC Margin Properties".