I have created a stylesheet, with corresponding tags, etc for the generation of manuals. When creating the table of contents automatically by updating the publication, its lines are never perfectly aligned even though all table-of-content tags have been created correctly (with corresponding space for tabs, etc). E.g. two lines, both tagged with the "Heading 1" tag throughout the manual may appear slightly displaced in the table of contents. This means I always have to correct the alignment line per line manually. How can I solve this problem? Thanks for your help.
How is the alignment off?
Are you making any local formatting adjustments in the text that's being pulled into the TOC? If you apply any local formatting (IOW, anything that enters a red formatting code visible in the Copy Editor view), that local formatting gets pulled into the TOC along with the text.
If you have to modify the formatting on a Heading 1 paragraph, make sure you do it through a tag override using the Paragraph Properties dialog.
You should not have to clean up the TOC if you have it spec'd correctly and you haven't applied any local formatting.
Sometimes, it takes some creative thinking to get things to come out the way you want them to. For example, my Z_TOC LVL 1 paragraphs are often Bold and 1pt larger than the other Z_TOC tags. Unfortunately, defining the Z_TOC LVL 1 tag as 13pt Bold throws off the leader for the page number tab. All the other Z_TOC tags are 12pt normal, so their tab leaders all line up, right down the page. Here's my solution:
To make the leaders and page numbers consistent, define the Z_TOC LVL 1 tag as 12pt normal like the others. Then, point the tag match in TOC Properties not to the Chapter Title tag, but to a tag called "Invisible toc lvl 1".
By every occurrence of the Chapter Title tag in the document, insert a paragraph containing the same text as the Chapter Title and tagged "Invisible toc lvl 1". To make it invisible, set the font color for the tag to No Color (the X in the font color dropdown). You will want to adjust spacing and line breaks in the invisible tag to keep it from affecting the page layout.
Finally, define a character tag that specifies 13pt bold characteristics and apply it to the text in the invisible paragraph. Since the tag has no color, the text will still be invisible where it occurs in the main document. However, when it gets pulled into the TOC, the character tag exercises its power on the text in the Z_TOC LVL 1 paragraphs. The leader and page number continue to be governed by the Z_TOC tag definition (12pt normal) so they line up with the rest of the TOC.
This solution may sound like a lot of extra work, but it's absolutely consistent and much easier to maintain than having to futz with the TOC every time you generate it.
Just thought of something else. It doesn't work well to right justify the page numbers in the TOC if you're using leaders. Ventura aligns the leader dots on a paragraph basis, so the length of the page number affects the leader dot positions. You're better off left justifying the page numbers (IOW, use a left tab before the number) and allowing them to rag on the right.
This is really complicated for me. I am going to try some of your suggestions, see where it gets me. Thanks!
Initially, focus on paragraphs 2 and 3, and the last paragraph.
Leave the rest of it to try later. It is advanced. However, working through the invisible tag/character tag suggestions will open up your thinking and give you access to a lot more of Ventura's power and flexibility.