PDA

View Full Version : Bookmark-Based Table of Contents



Mavila
10-10-2017, 07:51 PM
Hello, I was wondering if anyone might have an answer or alternative method for a Table of Contents (TOC) question. I have a macro that creates a planning book for the user that contains a given number of chapters depending on the user's needs for a project. Each chapter has a bookmark-based TOC on the first page of the chapter and it works really well.

The question relates to the book's main TOC at the beginning. Each chapter is numbered, 1 through x, and each chapter's pages are numbered 1 through x. So, chapter 2 might have pages 1-5 and chapter 3 might have pages 1-3.

It would be slick if the book's main TOC could be built the same way with the chapter name serving as each line item in the TOC which I'm confident can be done. The problem is the numbering system. For example, if chapter 1 is 5 pages and chapter 2 is 3 pages, then the TOC would look like this:
Chapter 1 Title.....1
Chapter 2 Title.....6

I'd like it to look like this:
Chapter 1 Title.....1
Chapter 2 Title.....2

Right now, I'm using an array to build the TOC in table form after the book has been completed but it takes more time, which is not a huge deal, and also has a slight problem in looks because the ....... borders don't work perfectly.

Anyone have any ideas how to override that page numbering system in the bookmark-based TOC so that one can use the chapter numbers instead of the actual page numbers? Is there another alternative?

Thanks for any ideas you might have.

macropod
10-10-2017, 07:57 PM
What is the logic behind the numbering you want? It doesn't seem to me it has any relation to the page numbering.

If you use Section breaks between the Chapters, you could, of course, set each Chapter's Section to restart the page numbering at 1 (or any other number you'd like).

Mavila
10-10-2017, 08:09 PM
Hi, and thanks.

Yes, I do a section break at the end of each chapter to restart the numbering process. I'm afraid I'm not explaining it well enough.

In a normal book, say a book of 200 pages, you have the page numbering system go from 1-200. Chapter 1 has a starting page #1, Chapter 2 might start on page 20, Chapter 3 might start on page 55, and so on. The main TOC at the start of the book would look like this:
Title.............Pg #
Chapter 1.......1
Chapter 2......20
Chapter 3......55

In my book, the page numbering is reset to 1 at the start of each chapter. Each chapter's bookmark-based TOC works very well. It's the main book TOC at the start of the book that I'm exploring options about.

If I were to use the same 3-chapter example as described above, I would want it to look like this instead:
Title...........Chptr#
Chapter 1.......1
Chapter 2.......2
Chapter 3.......3

Does that describe it better? I'm confident I can get the first result to work but I need the second version and I'm not sure that's possible in an automated TOC method, like the bookmark method.

macropod
10-10-2017, 08:33 PM
In my book, the page numbering is reset to 1 at the start of each chapter. Each chapter's bookmark-based TOC works very well. It's the main book TOC at the start of the book that I'm exploring options about.

If I were to use the same 3-chapter example as described above, I would want it to look like this instead:
Title...........Chptr#
Chapter 1.......1
Chapter 2.......2
Chapter 3.......3
If the page #s are set to restart at 1 for each Chapter, you wouldn't have either of your TOC formats - you'd only ever get:
Title.............Pg #
Chapter 1.......1
Chapter 2.......1
Chapter 3.......1
whatever approach you took.

Mavila
10-10-2017, 08:46 PM
Yes, I know that. I just thought there might be a work-around to get where I wanted to go (each # would be the chapter #).

I think I'll have to do something else. I've been looking at using a tab instead of the bookmark TOC or the table TOC (which I've been using). You can underline the tab space and that works pretty well except for this:

Chapter 1..........1
...
Chapter 10........10

It should look like this:
Chapter 1..........1
...
Chapter 10......10

I'm thinking I've got to either use a 01 number format (rather than simply, 1), or use a font (like courier new) where every character uses the same amount of space.

macropod
10-10-2017, 08:52 PM
Try using right-aligned tab-stops instead of left-aligned tab-stops.

Mavila
10-10-2017, 09:54 PM
OK, thanks for the tip.