From the course: InDesign Secrets

344 Insert a line before and after a heading - InDesign Tutorial

From the course: InDesign Secrets

344 Insert a line before and after a heading

- [Instructor] I'd like to place a line to the left side and the right side of each of these headings, and there are several ways to create this effect, but the traditional easy way is to apply two paragraph rules to the text, one on top of the other. Here, let me show you. To start with I'm going to open the paragraph styles panel, and you can see that I've already created a heading paragraph style here. I'll edit that by right clicking on this, or I control click with a one button mouse, and then choose edit heading. Now, I'll come over here to the paragraph rules pane, and you can see that this is actually two features in one. I have rule above and rule below. In this case, I'm going to turn on both of them. First I'll add a rule above. And I'm going to make this thicker, say two points. And I'll add a little offset here to make it center in the line. Because the preview check box is turned on, I can move this dialogue box out of the way, and you can see that the line goes right through the middle of the text. So now I'll change this to rule below. Now let's go ahead and add another rule. In this case, I want to make it even thicker than the other one, but I only want it to be just as wide as the text itself. So I'll change this with the pop-up menu to text. Maybe I'll make it a little bit wider. I can do that by changing the left and right indent. I'll click inside that field, and now I'm just pressing the down arrow keys on my keyboard. Let's move this out of the way so I can see a little bit more. Here we go. And the right indent is also minus four. Now, I'm going to change my offset to a negative number to move it up until it overlaps the first rule. And finally, and this is the important part, I'll change the color to paper. Or whatever the background color is that it's sitting on top of. Here, I'll click Okay and you can see it looks great. So this method, using two rules, is fast and it's easy to apply with a paragraph style. But it does have one problem. It only works over a solid background. Like look down here. Where the heading goes on top of this blue background, you can see that white rule. That is not good. Now fortunately there is another way to get that effect if you need to get the lines but you don't know what the background is going to be. So I'm going to undo that change to the paragraph style by pressing Command + Z or Control + Z on Windows. That gets rid of all those lines. Now this time I'm going to edit that paragraph style by right clicking or control clicking with the one button mouse. But here I'm going to change these paragraphs to be flush left rather than centered here inside the indents and spacing pane. I'll change center to left. Now, for this trick to work to make my heading centered, I'm going to be adding a tab character. So I'm going to come over here to the tabs pane, and I want to add a tab stop, a centered tab stop right in the middle of the column. I'll click the centered tab stop and I'll come over here, and I'm going to add this at exactly 10 picas nine. I happen to know that that is the center of this column. Now, while this dialogue box is still open, I'm going to add a GREP style that applies a strikethrough character style to any tab characters in the line. I'll click on GREP style. Click on new GREP style here, and then I'm going to add a character style. I don't have one yet, so I'll create a new character style here that I'll call strikethrough. You can call it anything you want really. Then I'll click strikethrough options, turn on this check box and I'll give it a two point strikethrough. Let's make this solid and black. I'll click Okay. And now I want to apply that character style, strikethrough, to either a tab or a right align tab. And the code for that is a little bit geeky, but here's what you need to do. It's backslash t, that means tab, vertical pipe, that means or, and then tilde y. That means a right align tab. I know it looks weird, but again, that's just a regular tab or a right align tab. Okay, we're good to go here. Now, all we need to do is add some tabs and some spaces. So I'll click Okay. To add those tabs and spaces, I'm going to use the find change dialogue box, which I can get by pressing Command + F or Control + F on Windows. But in this case, I want to choose GREP up here at the top of the dialogue box. Now I want to find everything in the heading paragraph style, so I'll type dot plus here in the find what field. That just means find everything. Down here in the find format, I'll click and then choose the paragraph style that I want to target. In this case, heading. This is going to find everything in the heading paragraph style. Now I want to replace that with the same text but with a tab and an en space before it, and an en space and a right align tab after it. So the code you need to type, and again, this is kind of geeky but you can do this. The code is backslash t, that's the tab. Then tilde close angled bracket, that's an en space. Then dollar sign zero, which means just put back in whatever you found. Then another en space, and then a right align tab, which is tilde y. Are you ready? Alright, let's do it. I'm going to click change all, and it tells me it made those replacements. When I click Done to close this dialogue box, you can see all of the lines are in here. Once again, it inserted a tab which got that fixed strikethrough followed by a blank en space, then the heading, then another en space, and then a right align tab, which got the strikethrough. Now of course, this method does take much longer than the simple rule above and below trick. But the great benefit to this is that you can put these headings over any kind of background.

Contents