About Arbortext Styler > Working with Tables of Contents > Applying Non-Standard Formatting to a Table of Contents
  
Applying Non-Standard Formatting to a Table of Contents
This section contains tips on using Arbortext Styler to format your table of contents in ways that may not be achievable through the properties area of the Table of Contents list alone.
Example: Displaying TOC Numbering to the Left of the Table of Contents Entries
By default, Arbortext Styler does not support the display of TOC numbering to the left of the TOC entries, but this can be achieved by editing the .style file directly once a standard TOC is in place in the document. The steps in the following procedure will produce a TOC with the page numbers right aligned to the left of the TOC entry text.
1. Add a table of contents element to the relevant place in your document and add the basic formatting you require. This step can be skipped if a suitably formatted TOC already exists in your document.
2. In Arbortext Styler, navigate to the Table of Contents list The Table of Contents list icon - horizontal lines of varying widths on a grey background and select the TOC object whose numbering you wish to change.
3. Click the Format... button to open the Table of Contents Format dialog box.
4. Make the following changes:
Select the Show page numbers option
Select the Right align page numbers option
Set the value of Text right indent: to 0pt.
Set the value of Minimum space or leaders before page number: to 0pt
Deselect the Leader dots option.
Deselect the Indent levels option.
This is an image of the Table of Contents Format dialog box with the Show page numbers and Right align page numbers options selected, the Leader dots and Indent levels options deselected, and the values of Text right indent and Minimum space or leaders before page number set to 0pt.
5. Click the Details... button to open the Table of Contents Format Details dialog box.
6. Enter the following settings for each level of the TOC - change the level in the Level to edit: drop down menu:
Select the Not numbered option.
Set the value of the Indent following lines field so that second and subsequent lines of a long TOC entry will start at the required horizontal position in the TOC.
This is an image of the Table of Contents Format Details dialog box with the Not numbered option selected, and the value of Indent following lines set to 10pt.
Click OK to exit the Table of Contents Format Details dialog box.
7. Click OK to exit the Table of Contents Format dialog box.
8. In the Elements list, set your Arbortext Styler interface to include Styler Formatting Elements (SFE) in the Elements list, by selecting the View > Styler Formatting Elements menu option.
9. Select the element _sfe:TocPage_xxx, where xxx is the name of the TOC whose numbering you are editing. In this case, the example TOC is named Document.
10. Elect to edit the FOSI source of the SFE element by selecting Edit > Edit Element Source > FOSI.
11. Insert a usetext element after the suppress sup=”0” element in the source. Set the attributes of the new element as follows:
source=”@xpt,ypt”, where:
xpt is the distance from the left edge of the document at which you want the page numbers to align
ypt is the space that should be drawn between the page number and the TOC entry text
Note that (x+y) should equal the value set for Indent following lines in step 6 above.
placemnt=”after”
This is an image of the usetext element with the attributes source=”@2pt,8pt” and placemnt=”after” set
12. Click File > Apply and Close to save the change and exit the Edited Source Editor. The SFE, and its Description entry for FOSI, are now marked in orange to advise that the element contains source edits. Note the presence of the Edited Source column The Edited Source column icon - an orange square with a white centre in the Elements list - use the View > Configure Columns option to activate the display of the column in your window if required.
This is an image of the element _sfe:TocPage_Book_Table_of_Contents in the Elements list, with the heading of the Description tab displayed in orange, the sentence “Context has source edits” in the description, an orange tick in the Source Edits column and the context icon surrounded by an orange square
13. Close the stylesheet in Arbortext Styler and open the .style file directly in Arbortext Editor
14. Find the TableofContents tag whose tocName attribute matches the name of the table of contents whose numbering you are editing. Note that Arbortext Editor will have replaced any spaces in the name of the table of contents with underscores.
15. Locate the TocTitleContexts element in TableofContents.
16. For each TocTitleContext element in TocTitleContexts, carry out the following actions:
Move the _sfe:TocPage_xxx element and its contents to be the first element inside the _sfe:TocEntryN_xxx element, where N is a number between 1 and 5. There should be one _sfe:TocEntryN_xxx element for each level you have elected to display in your TOC. Note that, again, xxx is the name of the TOC whose numbering you are editing: in the case “Document”.
Ensure the attributes of the Space element are set to:
leaderType=”space”
lenType=”fit”
minLen=0pt
Note that if you did not uncheck the Indent levels box in step 4, these elements may be named LeaderDots - once you have set the leaderType=”space” attribute, however, the name will change.
This is an image of the _sfe_TocPage_Document element as the first child of the _sfe:TocEntry3_Document element, with the attribute values Space leaderType=”space”, lenType=”fit” and minLen=”0.00pc” set
17. Save the changes to your stylesheet and close it.
18. Once you have saved the changes to your stylesheet, choose File > Print Preview in Arbortext Editor.
In the Print Preview window, note that the each entry of the TOC has its page number displayed to the left of the TOC entry text, and that there are no leader dots separating the two.
This is an image showing a table of contents whose entries have the number to the left of the entry text, and a space between the numbers and the entry text