Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

index entries and subscript/superscript

Return to Member Forum

  • Author
    Posts
    • #57677
      Sarah H
      Member

      Is there any way to use subscript/superscript in an index entry? I figured out how to add symbols (e.g. use ^7 for a paragraph symbol), but is there no way to apply formatting? Any work arounds? It's numerous different entries. Such a bummer to have to manually mess with formatting after every time the index is regenerated.

    • #57685

      As with find & change, text variables, and section numbering, you cannot include real formatting in Index entries. There simply is no provision for formatting text that you input in the fields.

      A possible workaround is to add 'formatting codes' into the index entries, and replace this with the correct formatting after generating the index. I would have suggested David's Automatically Format super/subscript trick (Auto Format Superscript and Subscript Numbers using GREP Styles), except … you happen to mention that “^7” yields a paragraph symbol. So his straightforward solution won't work.

      The workaround is slightly more cumbersome to enter, but after that your index ought to be just fine every time you generate it.

      1. Surround each of your superscripts with this: ^{text}, for example, to enter “x²” use “x^{2}”.

      2. Surround each of your subscripts with this: _{text} — like this: “H_{2}O (water)”.

      3. Create three character styles:

      a. “HideMe” — set character color to “None” and horizontal scale to 1%.

      b. “Super” — set character color to “Black”, horizontal scale to 100%, and position to Superscript.

      c. “Sub” — same as Super, but with Subscript.

      4. Add the following GREP styles to your Index Level 1 style (or any other style you are applying to the generated index text):

      [_^]{.+?}

      — apply character style “HideMe”.

      (?<=^{).+?(?=})

      — apply character style”Super”

      (?<=_{).+?(?=})

      — apply character style”Sub”.

      The first character style effectively hides everything formatted with the codes ^{..} and _{..}, including all text in between. The Super and Sub styles make just the inside text visible again, and applies the correct formatting.

      If you also want to include stuff like bold, italics, or underline, you can work out a similar system for these — all you have to do is add another code, and a character style that applies it.

    • #57689
      Sarah H
      Member

      Wow, thanks Jongware! I like your brain. :-)

    • #57691

      Thanks! (Me too!)

    • #57692
      David Blatner
      Keymaster

      Actually, I think the blog post I wrote (which you linked to in your first reply, Theun) would work just fine. But instead of using “^7″ for a paragraph symbol, they would just have to use “option/alt-7″ to type in a real paragraph marker symbol. No? Why use codes when you can type the real character you want?

      Or, just use a different character to indicate superscript, such as a bullet or pretty much any other character you're not ordinarilly going to use.

    • #57695
      Sarah H
      Member

      Lo and behold, I can type a paragraph symbol in the index tag. However, it converts it to ^7. So if I needed 10 to the power of 7 and I entered 10^7, I would get 10¶.

      Anyway, between the two methods, I'll work it out. I like your brain too, David. ;-)

Viewing 5 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads