0

I am looking for a solution how to create a line that automatically spans to the right from the conditional text: Language 1

As you can see above I just solved it at first with a static line. As soon as we change the language this doesn't work as the text is longer and crosses the line: Langiage 2

Does anyone have an idea how to solve it?

Cheers

3

As far as I know there is no completely straightforward way to do this. Some tricks are needed. I have two different suggestions. Each with their own pros and cons.

Use Paragraph Rules

This is an approach where you use a Paragraph Rule Above to create the wanted line and a Paragraph Rule Below to hide the part of the rule that's under the text.

Pro: This can be done entirely in the heading's Paragraph Style.

Con: The heading must always be on the same background color or the rule below will be visible.

Method

Enter the heading's Paragraph Style Options.

Under Paragraph Rules add a Rule Above which is styled like you want it. For example like this:

This creates a rule that spans the entire column:

Now add a Rule Below. We need to set it up so it covers the part of the rule we don't want to see. But for it to display nicely on screen we have to make sure there is an overlap.

Set Weight to for example 2 points more than the rule above.

Set Color to the color of the background.

Set Width to Text.

Set a small negative Left Indent, for example -1 pt.

Set Right Indent to whatever space you want between the text and the rule.

Set Offset to half of the sum of the weights of the two rules. If you have an offset on the rule above, this needs to be subtracted.

In my example I use these settings:

This creates the wanted look:

While setting up the rule below, it might be a good idea to set the color to something visible and zoom in on a header. This is how it looks if I choose cyan for the rule below:

Use a Right Indent Tab with underline

This is a little simpler approach where you insert a Right Indent Tab at the end of each heading and style it with an underline.

Pro: The heading can be on any background.

Con: You have to add characters to the text.

Method

Insert a space and a Right Indent Tab (Shift + Tab) at the end of each heading:

Select the Right Indent Tab and copy it to clipboard for later use.

Create a new Character Style and use Underline Options to style the line like you want it. For example like this:

Enter the heading's Paragraph Style Options.

Under GREP Style, add a new GREP Style.

Set Apply Style to the Character Style you just created.

In the To Text field, paste in the Right Indent Tab you copied earlier.

It should look something like this:

Now any Right Indent Tab in a heading automatically gets an underline.

The result looks similar to the other approach:

Only difference is that the space between the text and the line is given by the white space character you choose to insert.

1
  • 1
    Great, thank you!
    – daniel
    Jul 17 at 11:20

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.