Copy link to clipboard
Copied
Hello!
I have been trying and failing to create a table of contents that has right aligned numbers (on the left side) and left aligned text. Like this:
Seems like there should be a simple solution to this that I'm missing.. Any thoughts?
Thanks!
1 Correct answer
Hi C5FB2,
ok, here is yet another solution that will work, also with a trick:
Create two TOC styles for two purposes:
1. TOC style with page numbers only for the first TOC.
2. TOC style without page numbers for the second TOC.
You can create two text frames with two TOCs with the two TOC styles.
Arrange the two text frames side by side:
The left TOC contains both, the page numbers and the contents of the headlines as well. However, the headlines are hidden with a GREP style. The alignm
...Copy link to clipboard
Copied
Include a tab in front of the page numbers, and set the tab to right-alignment
Copy link to clipboard
Copied
Sorry is there a way to do this through the Table of Contents dialog? This is what I currently have which is close:
Sorry I am not an InDesign expert, so this is a bit new to me..
Thank you!
Copy link to clipboard
Copied
There is no way I know of in that dialog to add a tab before the number, but after the TOC has been generated, you can use this GREP find/change to add the tab. (It finds the beginning of a paragraph and one digit, and replaces it with a tab followed by the found digit)
Copy link to clipboard
Copied
Interesting, ok. I'll try out the GREP workflow. I'm creating a template for non-graphic designers so I want to just make sure to create as simple a workflow as possible.
Copy link to clipboard
Copied
Thank you for looking into this!
Copy link to clipboard
Copied
Hi, just found a solution to this in case you still need it - change the 'Between Entry and Number:' to the up character and then y. I don't have that character on my keyboard - but the one yours is showing as >f>f change that to >y but an keep the 'up' sign then type y. Hope that helps!
Copy link to clipboard
Copied
Hi C5FB2,
there is a way to do what you want. However, this is a trick that comes at a cost:
You have to use a different scheme of page numbering in the Pages panel.
Do not use: 1,2,3 …
Instead use: 001, 002, 003 … if you expect three-digit page numbers.
You then could use a GREP style to hide the leading zeros in the TOC. I created a character style that applies fill color [None] to one or two leading zeros at the beginning of a paragraph:
The issue with this approach:
That trick is not working with auto page numbers, because a page number is always treated as one unit and the applied GREP style cannot grab any leading zeros:
A workaround could be to use a numbered list for the page numbers on the pages.
So this might be no real solution for your use case.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Yeah the auto-numbering is key on this project unfortunately, but that's a very clever fix I'll keep that one in mind for future projects!
Copy link to clipboard
Copied
Hi C5FB2,
ok, here is yet another solution that will work, also with a trick:
Create two TOC styles for two purposes:
1. TOC style with page numbers only for the first TOC.
2. TOC style without page numbers for the second TOC.
You can create two text frames with two TOCs with the two TOC styles.
Arrange the two text frames side by side:
The left TOC contains both, the page numbers and the contents of the headlines as well. However, the headlines are hidden with a GREP style. The alignment of the paragraphs is Right Aligned.
This time the character style that is hiding the headlines' contents is done a bit different:
Fill color [None], character scaling: 1%, size: 0.1 Pt. That's pretty small and should "condense" the not visible text to such a small amount, that it is hardly visible, that behind every page number there is indeed some white space:
The TOC style is using the special white space character 1/24 of an EM space.
The GREP style is using that delimiter character to identfy the point where all text after this character will be formatted with the character style "Invisible-NoFill".
TOC style for the left TOC where the title of the TOC is just a blank character:
TOC style for the right TOC is simply leaving out the page numbers ("Keine Seitenzahl" with my German InDesign):
FWIW: All the page numbers are done with option: "1,2,3 …"
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Ah yeah I think that makes the most sense, I'll try and set that up! New to GREP so it may take a mintue..
Thank you again for all the help!
Copy link to clipboard
Copied
Nice solution! Just not sure this will work for accessibility. The tab solution might be the better organization for screen readers.
Copy link to clipboard
Copied
Worth noting that you still can't include a tab before any generated numbers (TOC, numbered list, etc.) I have never heard a good technical reason why this is anything but a development/programming choice (that is, not a fundamental technical limitation or otherwise difficult to implement).
Adding tabs after generation only works for TOCs, as well.
—
Copy link to clipboard
Copied
Warning: Be aware, that you can get a bit into trouble if one entry in the right TOC needs two or more lines of text.
The TOC to the left will suck in all that text into one "singularity" after the page number and the entry remains in one line of text.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
To fix the issue when the title spans into 2+ lines, I found a solution that involves adding an invisible character as a bullet and messing with the alignment.
1 - Result:
2 - On the ToC title paragraph style;
3 - The ToC settings
I hope that helps 😄

