• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Right Align Numbers / Left Align Text in Table of Contents

New Here ,
Sep 28, 2020 Sep 28, 2020

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: TOC-Alignment-01.png

 

Seems like there should be a simple solution to this that I'm missing.. Any thoughts?  


Thanks!

TOPICS
How to , Print , Type

Views

6.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 28, 2020 Sep 28, 2020

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:

 

TwoTOCs-One-PageNumbersOnly-Two-NoPageNumbers.PNG

 

TwoTOCs-One-PageNumbersOnly-Two-NoPageNumbers-2.PNG

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

...

Votes

Translate

Translate
Community Expert ,
Sep 28, 2020 Sep 28, 2020

Copy link to clipboard

Copied

Include a tab in front of the page numbers, and set the tab to right-alignment

Screen Shot 2020-09-28 at 11.44.02 AM.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 28, 2020 Sep 28, 2020

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: Screen Shot 2020-09-28 at 11.50.29 AM.png

 

Sorry I am not an InDesign expert, so this is a bit new to me..

 

Thank you!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 28, 2020 Sep 28, 2020

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)

Screen Shot 2020-09-28 at 12.40.33 PM.png Screen Shot 2020-09-28 at 12.40.52 PM.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 28, 2020 Sep 28, 2020

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. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 28, 2020 Sep 28, 2020

Copy link to clipboard

Copied

Thank you for looking into this!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 18, 2022 Nov 18, 2022

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 28, 2020 Sep 28, 2020

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:

TOC-Entries-HideLeadingZerosAtTheBeginning-1.PNG

 

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:

TOC-Entries-HideLeadingZerosAtTheBeginning-2.PNG

 

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 )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 28, 2020 Sep 28, 2020

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 28, 2020 Sep 28, 2020

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:

 

TwoTOCs-One-PageNumbersOnly-Two-NoPageNumbers.PNG

 

TwoTOCs-One-PageNumbersOnly-Two-NoPageNumbers-2.PNG

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:

 

TwoTOCs-One-PageNumbersOnly-Two-NoPageNumbers-4.PNG

 

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:

TwoTOCs-One-PageNumbersOnly-Two-NoPageNumbers-5.PNG

 

TOC style for the right TOC is simply leaving out the page numbers ("Keine Seitenzahl" with my German InDesign):

TwoTOCs-One-PageNumbersOnly-Two-NoPageNumbers-6.PNG

 

FWIW: All the page numbers are done with option: "1,2,3 …"

 

Regards,
Uwe Laubender

( ACP )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 29, 2020 Sep 29, 2020

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! 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 07, 2022 Sep 07, 2022

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 07, 2022 Sep 07, 2022

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.

 


╟ Word & InDesign to Kindle & EPUB: a Guide to Pro Results (Amazon) ╢

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 29, 2020 Sep 29, 2020

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 )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 08, 2023 Feb 08, 2023

Copy link to clipboard

Copied

LATEST

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:

sjardim_2-1675872795557.png

2 - On the ToC title paragraph style;

sjardim_1-1675872726132.png

3 - The ToC settings

sjardim_3-1675872842025.png

I hope that helps 😄

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines