0

I'm creating a small dictionary to accompany a new project and in it I have things formatted where the paragraph style is just my generic Body Copy style but the defined term itself is its own character style.

For instance: "Term - Definition of term goes here."

So in that example, the entire line is my Body Copy paragraph style and the word Term is its own character style.

Is there a way to create a table of contents where only the word Term shows up? In the TOC menu I seem to be only able to grab whole paragraph styles, but I can't apply a paragraph style to only one part of a line, which is why I went with the character style.

I hope I'm making sense. Can anyone help?

0

I don't believe there is a simple solution to this. But I'll show you a semi-automated solution which shouldn't be too cumbersome.

  1. Make a duplicate of your "Body Copy" paragraph style (here called "Body Copy with Term") and apply it to every paragraph containing the "Term" character style using this method.

  2. Create a character style for page numbers (here called "Page Number") and a character style for between entry and number (here called "Between").

  3. Enter Layout > Table of Contents. Add the "Body Copy with Term" paragraph style to Styles in Table of Contents > Include Paragraph Styles. Set the Page Number Style to the "Page Number" character style and the Between Entry and Number Style to the "Between" character style. Press OK.

  4. Place the table of contents where you want it.

  5. Select the text frame and enter Edit > Find/Change. Select the GREP tab. Enter [^\r] in the Find what field to search for everything except line breaks. Make sure the Change to field is empty so the found text is removed. Make sure Search is set to Story. Click the Find Format field and set Character Style to [none] to protect the "Term", "Between" and "Page Number" character styles. Press Change All.

Now the table of contents should only contain the terms, the page numbers and the stuff between.

If the table of contents is updated you will have to repeat point 5.

| improve this answer | |
  • What’s the point of the Between style here? Unless there’s something in the Page number style that would make a tab (or other space) character unusable, why not just use that for both the spacers and the page numbers? – Janus Bahs Jacquet Jul 17 at 21:26
  • @JanusBahsJacquet, I'm not sure I understand. Are you suggesting just using the Page Number style for the tab? It would work, but then you would loose the ability to style the tab. I'm just trying to transform the OP's special case to standard TOC behavior. – Wolff Jul 18 at 9:09
  • That’s what I meant, yes. Why would you normally want to style a tab? It’s white space. Unless you specifically wanted to give the tab a yellow background or something like that, standard TOC behaviour would to me be to leave the tab unstyled. The extra character style doesn’t do any harm, of course, but it also doesn’t seem necessary for a standard TOC. – Janus Bahs Jacquet Jul 18 at 9:11
  • @JanusBahsJacquet, I style that tab all the time! If I want to have some sort of line between the entry and the page number. I can use periods as a leader to get a dotted line, and then I mostly want to reduce the font size and add some tracking. I might also instead use an underline on the tab character. – Wolff Jul 18 at 9:20
  • I suppose YMMV on this. Personally I’ve only ever needed to use a leader in a TOC once (and I think I just did it directly in the paragraph style with no further formatting); the vast majority of TOCs I see (and make) do just fine with a simple space, so I’ve pretty much never needed it… – Janus Bahs Jacquet Jul 18 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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