The Zero Leading Solution
I recently had to come up with a solution for a problem in a textbook’s table of contents where lesson numbers and titles were in separate paragraphs throughout the book
but in the table of contents, both items had to be on the same line.
I know you can achieve something like this example with numbered paragraphs, where the “Lesson ” is just part of the numbering style. But there are other situations where because of the content of the TOC entry, the numbering scheme, or the formatting requirements, you would need a different solution.
So I said to myself, “Self, why don’t we set up the TOC style to format the paragraphs for each lesson title with a left indent and zero leading? That way, it will just look like the lesson numbers and titles are all in the same paragraph.”
My self liked this very much, and thus, the zero leading solution was born.
In the Table of Contents dialog box, I set up the lesson number entries without page numbers.
And made sure that the entry paragraph style had no space after.
The lesson titles did get page numbers.
And they were set in a paragraph style with zero leading and zero space before.
This made the lesson titles move up to exactly the same line as the lesson numbers.
Then to fix the overlapping text, I added a left indent to the lesson titles.
With Hidden Characters visible, you can see the subterfuge.
But otherwise, the TOC looks exactly as I need it to.
One more thing: It’s usually not a great idea to edit the text in a table of contents since your edits will be wiped out if you update the TOC. But if you do have a reason to edit the TOC, the zero leading solution can make it tricky to select the text you want. Happily, the Story Editor solves this problem because its raison d’être is to disregard formatting like leading.
Very clever Mike! :) Love it!
Cleverness, to trick the TOC! Nicely done.
i dont see this helpfull i think its much easyer to make it with a tab stop
Oh, that’s brilliant. I’ve wanted to do something like this before but couldn’t figure out a good solution. FrameMaker used to let you do run-in paragraphs (I assume they still do, but I haven’t used it in nine years), and I’ve often wondered why they don’t do something similar in InDesign.
you are some kind of sorceror :D keep ’em coming!
Very very clever. Now how would you deal with lines of varying length (say if you wanted to run a chapter title and subtitle together)?
orielwen-
That’s a great question, and I wish I had an equally great answer. Zero leading worked for me because I knew those lesson numbers never went past 9, so they were all the same length. I can’t think of a way to automatically account for variable spacing between the lesson number and the title.
In this instance, I think you could come up with a GREP style that would increase the space between the word “lesson” and the numbers 1-9, in effect right aliging the numbers so you could have the same indent on the titles.
Otherwise, I think you’d have to post-process the TOC with a GREP find/change. Find the paragraph returns after the lesson numbers and change them into whatever you want, spaces, en spaces, tabs, etc. You’d might also have to edit the paragraph style (or apply a new one) to get the formatting right.
@gil: I think you missed the point in the first paragraph: You can’t use a tab stop because the TOC feature is pulling together a bunch of different paragraphs, so they show up in the TOC as multiple paragraphs, too.
But I think this tip has more general appeal, too: I’ve used zero-leading for various difficult workarounds over the years. It’s a good one to keep in the back of your brain!
Great tip Mike, thanks for the nice detailed write-up.
I tend to prefer an alternate solution of using InDesign’s Running Head (Paragraph Style) and/or Running Head (Character Style) Variables (Type ? Text Variables). Simple create a non-printing text frame (Window ? Output ? Attributes), insert the variables into a new TOC-specific paragraph (for simplicity, I often use the same TOC paragraph style for both this non-printing text frame and the generated TOC) along with any punctuation, whitespace, etc.
One of the really nice things about this method is that it overcomes the paragraph-only focus of InDesign’s Table of Contents feature (when using Running Head (Character Style) variables).
The one important caveat is that InDesign has a bug where it horribly munges the generated TOC entries when the source paragraph contains multiple variables so you need to Convert Variables to Text before updating the table of contents (cf. teleportation + bug)
multiple variables within a source paragraph cause the generated TOC paragraph to horribly munge/interleave the content, so you’ll need to Convert Variables to Text prior to updating the Table of Contents.
Caleb, could you please clarify (step by step) what you’re describing? My problem is that the no leading option didn’t work for me as some of my titles run more than 1 line long and then the words just overlap in those instances. I’d like to try your suggestion but I haven’t been able to follow your description successfully. Thanks!
orielwen-, Mike,
I’ve used zero-leading to do inline footnotes (see https://tinyurl.com/78qbawm), and that approach deals with break lines — which I understand as “lines of variable length”. Maybe Caleb’s approach with variables works better in TOCs, but as you can see, zero-leading comes in handy in all kinds of circumstances.
Peter
Very cool, Caleb.
orielwen, if you don’t mind doing the extra setup work, there’s your solution.
Peter, yes! Your inline footnotes are a tremendously cool use of zero leading.
What a great post! I’ve always irked that I had to s/r a generated toc to get chap numbers and chap headings to end up on the same line. I remember the zero leading from another post and always thought that I should remember it, but promptly forgot it.
Way back when Ventura had a paragraph style option of allowing a paragraph to follow on directly after a previous paragraph. Then again, Ventura had some other pretty cool things that have only just reached or still haven’t reached ID, eg inter column vertical rules, one paragraph to follow directly after another as above.
Thanks again for this reminder and technical inspiration.
Damian
This is the sort of thing we’d get a tongue lashing for in college from our typographer and typesetter, a real strict but very informative man. But if we did something like that we’d be tongue lashed.
Didn’t stop us though. Whatever works. I’ve used Zero leading many a time.
You could also do it with a baseline shift.
Which should enable you to use soft returns (haven’t thought this through) and then apply leading throughout the contents, along with using Paragraph spacing.
Just a thought. :)
Curse you Mike! Why didn’t you post this a month ago, when I needed it. To wrestle my TOC into shape, I created a complex combination of GREP and hand edits into a Macro in TextMate to do what you suggest here.
Thanks. I’ve clipped this article to DevonThink for future reference.
This is really helpful, Mike. Ninety percent of the TOCs I generate have the part/chapter number line and part/chapter title lines on separate lines. I have saved a GREP search that takes care of this, but as you point out, the search has to be redone whenever the TOC is regenerated.
I?ll be putting this to use today. Will also check out Eugene?s suggestion.
That’s the thing about a TOC – I generate it once. I sorta flat out refuse to do a TOC unitl the entire book is signed off and correctly paginated. It’s the very last thing I do.
I do of course have a sample TOC in place so the author knows what it will look like, and they sign off on the layout. That also helps me build the TOC styles.
I have found that if I have to generate the TOC more than once – there’s something wrong with the workflow.
What fun this will be to use in a file going to an in-house designer.
I’ve had a lot worse!
The thing about Mike’s workaround is that, if I’m not mistaken, updating the TOC will automatically line things up anyway.
So an inhouse designer wouldn’t have any need to do anything… unless they try change the TOC manually.
And if they are having issues with it, they can recreate it the way they like anyway.
Great post! I didn’t use this for a TOC but had an issue where I needed to have a title then bullets on the same line.
Title ? Bullets
I created a paragraph style with 0 leading then another with bullets, indent, and a space after. I used next style “bullets” to make it so that it automatically went to the second paragraph style upon hitting the enter key.
Eugene Tyson, I think your suggestion of using baseline shift is a good one, because it allows chapter names to take more than one line (which zero-leading doesn’t).
At least en InDesign CS6:
Layout > Numbering and section options > In “style” select: “001, 002, 003, …”
Hi!
One Question! Why “Zero Leading Solution” doesn’t work to create Inline footnote after InDesign CC 2014; Namely: InDesign CC 2015 to 2019.