1

How to create table of contents with fields, so that page number is at beginning of line. For example: PAGE HEADING 1.....HEADING 2
Not HEADING 1......HEADING 2.......PAGE.

Need TOC auto page to be in left column

I simply want the automatic page number to be in the first column on the left hand side of the page - NOT in the right-most column as most TOCs are formatted. Surely this can be done with field codes and switches, no? I haven't been able to figure out how to do that yet, though.

  • I took the liberty of editing your screenshot to show what I believe you meant better. I believe the term you're looking for is "Justified" so I've reflected it in my edit. I hope it will be much clearer that way. – Journeyman Geek Apr 17 '17 at 1:24
  • Thanks, Journeyman Geek. Actually I wasn't looking for justified, and I shouldn't have used the term "flush left". I've reworded my question and uploaded examples to better explain that I'm simply needing to have my page numbers appear in the left-most column - not on the right side of the page as most TOCs are formatted. Thanks again for your interest! – EsDavid Apr 17 '17 at 7:33
  • Well, its your question and I'm glad to be of help, even if I misunderstood the whole question. – Journeyman Geek Apr 17 '17 at 11:52
  • Super. Now I'm just hoping someone has some helpful tip on how to solve this seemingly simple issue. :) – EsDavid Apr 17 '17 at 18:38
1

Here's one relatively easy way to do this by using field codes.

  1. Make paragraph marks visible if they aren't (press Ctrl+*).
  2. Below the Heading 2 paragraph for the first song, press Ctrl+F9. Inside the braces, type TC "" \f C \l "1" to define a manual TOC entry.
  3. Put the cursor inside the empty quotation marks that you typed right after TC, and then press Ctrl+F9. Inside the new braces, type PAGE \* Arabic to grab the page number for the song information. (The assumption here is that all the info for a given song is on the same page – or at least that the song title, the show/film/artist information, and the paragraph containing the TC field are.)
  4. After the closing brace for the PAGE field, press Tab (because you want a tab space between the page number and song title), and then press Ctrl+F9. Inside the new braces, type STYLEREF "Heading 1" to grab the song title from the preceding Heading 1 paragraph.
  5. After the closing brace for the STYLEREF field, press Tab, and then press Ctrl+F9. Inside the new braces, type STYLEREF "Heading 2" to grab the show/film/artist information from the preceding Heading 2 paragraph.

    Your completed TC should look like this:

    { TC "{ PAGE \* Arabic } { STYLEREF "Heading 1" } { STYLEREF "Heading 2" }" \f C \l "1" }

  6. Copy this line, and paste it after the Heading 2 paragraph for every song.

  7. Press Ctrl+A to select all, and then press F9 to update all the fields.
  8. At the location where you want your TOC to appear, press Ctrl+F9. Inside the braces, type TOC \f \n \w to build a TOC from field entries, suppress page numbers (since you've manually added them to your field entries), and preserve tab spaces inside the field entries. If you want the entries to be active links so that you can use them to jump to the info for specific songs, you can also add the \h switch.
  9. Press F9 to update the field and generate the TOC.
  10. Modify the paragraph style that's used for the TOC entries (presumably, TOC 1). As necessary, adjust the Tabs settings. You want one Left tab with leader 1 None just right of the left margin, and then another with leader 2 ... farther to the right.

Here's my finished TOC:

TOC with page numbers on the left

  • Wow! Thank you so much! This is exactly what I was looking for! (I think.) I haven't had a chance to try it out yet, but I trust it will be the perfect solution! – EsDavid Apr 17 '17 at 20:33
  • Well, how disappointing. I didn't come close. I went page by page to be sure each song title line had a Heading 1 and Heading 2. Steps 1 through 5 completed just fine - except my line had a closing brace unlike your screen shot above at the end of step 5. I wasn't able to delete the closing brace, so I accepted that and went on. My problems started in step 6. I was not able to copy/paste the entire bracketed code. When I would paste it, all I would get was { TC " → → " \f C \1 "1"} None of the STYLEREF "Header..." information for either 1 or 2 pasted. 0 characters left. Sorry. – EsDavid Apr 18 '17 at 1:54
  • (cont'd) At any rate, when I pushed on to update fields, the few lines that I had entered for testing pulled information from page 116 or something off the charts like that. Haven't a clue how that happened. And it just repeated the same on each line. I'm amazed how difficult this is. – EsDavid Apr 18 '17 at 2:00
  • @EsDavid, the missing brace was a mistake; sorry about that. I've updated my answer. I'm not sure why it's not working for you. I just started from a blank doc and followed my steps exactly, and it worked fine. Where exactly are you pasting the copied TC field? It has to be in a paragraph after the Heading 2. Can you post a picture of one of your pages of data? With paragraph marks visible, and preferably in Draft view (View tab > Draft) with the style area pane visible (if needed, set a nonzero value at File > Options > Advanced > Display > Style area pane width in Draft and Outline views). – cnread Apr 18 '17 at 4:55

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.