is now part of CreativePro.com!

Significant Limitation in Nested Styles, Variables, and Section Markers

16

A friendly reader wrote with a complaint involving section markers: She wants to use section markers (Type > Insert Special Character > Markers > Section Marker) to pick up the Section field of the Numbering & Section Options dialog box. Great, no problem. It’s a terrific way to build running heads. Unfortunately, she wants to format the result in a special way: The whole thing should be set in one font style except the first character, which should be a large script face.

This sounds like a job for nested styles. After all, it’s easy to use nested styles to apply a special character style to the first character of the paragraph, right? But the result wasn’t even close:

As you can see, the italic face was applied to the whole paragraph instead of just the first character. Why? Well, it’s because the Section Marker is considered a single character. So the nested style is applied to that “single character” and therefore to all the text “in it,” which in this case is the whole word.

You might think that you’d fare better with a running head text variable (Type > Text Variables > Define), but sadly those are also considered single characters to the nested styles feature.

What can be done? I can’t think of a thing, besides using the old, traditional approach: Just type the text on a master page instead of using the “auto” features. Unless someone knows of an “expand appearance” type of script?

David Blatner is the co-founder of the Creative Publishing Network, InDesign Magazine, CreativePro Magazine, and the author or co-author of 15 books, including Real World InDesign. His InDesign videos at LinkedIn Learning (Lynda.com) are among the most watched InDesign training in the world.
You can find more about David at 63p.com

Follow on LinkedIn here
  • Eugene says:

    How about using both?

    Change the number and section option to just the first letter of the Section.

    Create a character style for the large script face.

    Create a variable for the rest of the word – have the running head variable pick up character styles.

    Apply a character style to the rest of the world (meant word here but applying a character style to the world is funny).

    Insert a Section Marker for the first letter, then insert a running head variable for the rest of the word.

    Apply a nested style of Script character style you created and then apply a paragraph style.

    You can GREP search single words at the beginning of a sentence without the first letter to apply the character style. Or indeed apply a character style through the nested style.

    None through 1 character
    running head up to a space (or something.

    I have it working here, it’s nifty but awkward with the numbering and section marker. I presume there may be a apple or javascript for this?

  • Eugene says:

    Just dawned on me, just use two variables, picking up the character styles.

    The word in the paragraph will have a nested style. Then apply a running head character style to the first style in the nest, then apply a running head character style to the rest of the word in the nest.

    The 2 running head variables should pick up the nested styles.

    Then you can apply a nested styles to the running header variables that you insert to make the large script first letter and plain text second letter.

    You could probably dump the Section Marker all together.

  • Jennie says:

    How about this…

    Nested style:
    First letter style applied through 2 characters
    Remaining letters style through 1 sentence.

    I’m not good at this stuff yet but it seems like it might work.

  • What about a script that would retrieve part of the section marker and put in in one or more text variables? Not that I’d know how to program that, but in theory that might be doable, no? Then it would be a matter of formating each text variable separately.

  • Eugene says:

    You don’t need a script to do this. You just need to give the paragraph a nested style for the first word. Then the variables can pick up the nested styles and use those, all you need is two variables, and the variables can be styled to your liking.

    I think the problem with the script would be that you’d have to run it every time you made changes to a page, as text pushes on and moves forward and back with edits.

    Using variables and nested styles makes it automatic be in place.

  • Igor Freiberger says:

    I suppose there is a way to convert all variables to text with a simple script. This would be ran at the end of document editing and solve the problem.

  • Harbs says:

    Hi David,

    You want a real solution? ;)

    One of the advantages to our Running Header plugin is exactly this point! Text in headers is preserved as simple text, so nested styles in the headers work exactly as expected…

    Unfortunately it doesn’t currently have the capability of pulling section names, (hmm…) but for regular headers, nested styles work great!

    https://in-tools.com/plugin.php?p=16

  • @ Eugene : I agree that if I were to use text variables from the get-go, a script wouldn’t be needed. But there are perks to using Section Markers over text variables.

    An example I’m currently working on : we’re currently working on a book for a client using the Book features of ID. The layout involves having the current section’s name at the top of every page. Using Section markers, I’m able of doing just that with a single template for the whole book instead of having one for each section.

    As far as I understand how they work, if I were to put text variables in the templates, I’d need not only a different variable for each section, but a different template as well – which defeats the whole “let’s streamline this” thing we tried to set up. Whereas running a script to update this could be done at the same time we synchronize the whole book – it would take a bit of time but wouldn’t make the files themselves heavier.

    Of course, this is a fairly specific example, and we’re lucky that we can apply a single style to the whole section name. I agree that on smaller projects (especially if they aren’t being worked on by several people simultaneously like ours) the text variables / nested styles tip would work fine. Still, one can wish… :-p

  • Eugene says:

    I don’t think you’d need a new text variable for all new sections and new templates.

    Personally I set a 3,200 page book that had changing running heads of 4 different types on the recto and 4 different running head types on the verso. As text is added and the text reflows the running heads change to match as the variables pick out the character styles per page. It was necessary for this book as there are 100’s of sections and chaning section markers and names wasn’t an appealing way of dealing with changes to the publication.

    I had other publications of lesser extent that running head variable tricks worked sensationally, I think about 20 – 30 publications done like this, with different instances of running heads.

    Personally I find the section markers clunky. I wish there was an easier way to set section markers and section names.

    The one problem I have with section markers is that you need to manually change the name of the section. If the section marker worked like a variable, i.e., if you could tell the Numbering and Section that the section marker is the text of a particular style, then that would be good.

    I’m 90% confident that what you want done can be achieved using variables and a combination of paragraph and character styles.

  • Folks, I think Harbs actually has the best solution here. The In-Tools plug-ins are very powerful tools for doing headers and other book-related layouts. There are clearly workarounds (great work, Eugene!) but sometimes it’s easier and cheaper to automate it with a plug-in.

  • Harbs says:

    Hi David,

    Thanks for the kind words.

    Regarding doing headers with section markers:

    I much prefer not creating sections for each new chapter, but it is a workable solution in some situations. (Sometimes it might even be preferred.)

    One of the biggest pains of this approach is naming the sections. I have a couple of scripts which I’ve had around since forever. One names the sections from text of a specific paragraph style. The second one names the sections from text taken from a user selected character style. There’s a third script for removing the sections as well. The scripts should work in all versions from CS through CS4.

    You can download the scripts from here.

    On an interesting aside…

    The paragraph style based one was written by someone (I think) named Paul Mayer. He visited the scripting forums very briefly in the CS days. He wrote this script at my request. This script was one of the impetuses for my learning scripting in InDesign scripting. I since added the character style one and updated the script when CS2 broke the original…

  • Eugene says:

    I suppose the free complex way of setting up variables for running head paragraph character nested styles is a bit heavy for some people :) (Just in general, I know it’s complex so it’s not for everyone).

    I guess I’ll save $60 :) and the info is here for anyone that wants to try the variables route.

  • Actually I’d be VERY interested in learning more about the “Variable Way” of doing this. While it worked on our project, I’m well aware that for anything over a dozen sections, my method would be a pain to update – especially in case of book-wide modifications. And it definitely annoys me to be bared from harnessing the Formating Power of Nested Styles. *dum dum DUUUMMM…*

    I’ll have a look at the scripts Harbs describes, but the problem I have with those is that it’s often impractical (read : impossible) to use them when I work at a client’s due to IT issues. So knowing how to do this manually would come in handy.

    SOOOO… What would it take to bribe someone into expanding on the subject in a full post here? *big hopeful French puppy-dog eyes*

  • ALEX says:

    thanks guys. i’ll quit pulling my hair out trying to get a nested style to function in my running head text variables. sigh. onto troubleshooting my actual problem from another angle. at least i’m moving again!

  • Britta says:

    Hi there, I just wanted to ask if and if so WHEN you`ll publish the next “Real World Indesign CC 2015/ 2016”? It would be so awesome!

    • Britta: Thanks for the kind words! To be honest, I would not hold your breath. We love that book, but for many reasons, it’s unlikely to see a new version anytime soon. Fortunately, we have lots of new content here at InDesignSecrets! :-)

  • >