Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

multiple underline

Community Beginner ,
Jul 14, 2025 Jul 14, 2025

Hi everyone,
I'm thinking about laying out a book with InDesign, but I wanted to know from you experts if it's possible to do what I need:
The text is a combination of four different texts; to indicate which text it is, I'd need to underline it with four different colors; sometimes just one line, sometimes two, sometimes three, etc.

Is it possible?

TOPICS
Experiment , Feature request , How to , Scripting
1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Community Expert , Jul 18, 2025 Jul 18, 2025

Hi @pino_2179, I have made a proof-of-concept script that may might be a good way for you. So buckle up because I want you to come on a little journey with me... 

 

We cannot do your job the normal way, using Indesign's normal underlining because Indesign cannot assign more than one underline to the same character. Your job requires runs of underlining starting and stopping on their own schedule, overlapping however they like. A corollary of that problem is that there is no convenient user inter

...
Translate
Community Expert , Jul 28, 2025 Jul 28, 2025

Hi @pino_2179 according to ChatGPT, Conditional Text was introduced in Indesign CS4, so my script definitely won't work in CS3. Even in CS4 I have no idea if the script will work as other things in the scripting API may have changed—there have been 17 major versions released since then!

 

Sorry to pass on the bad news. Perhaps you could subscribe for a month or two to finish your project?

- Mark

Translate
Community Expert ,
Jul 14, 2025 Jul 14, 2025

You can add different character styles on the same text via manually, GREP and nested styles. Additional you can use paragraph frames and rulers. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 14, 2025 Jul 14, 2025

Can you show us a sample of what the text will look like?

Does one piece of text potentially get one, two, three, or four underlines?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 14, 2025 Jul 14, 2025

Hi @pino_2179:

 

You can customize color and position of both an underline and a strikethrough so by that covers two of the lines. 

The other lines that Willie referred to (paragraph rules and borders) are added at the paragraph level, which means you can't assign them to individual words within a paragraph. Not sure if you need to. 

A sample or two would be very helpful— even if you just sketch it on paper and then take a picture of it to share with us.

 

~Barb 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 14, 2025 Jul 14, 2025

The text is a combination of four different texts;

 

Just clarify do you want a single underline with different colors, or different colors and multiple strokes?

 

Single lines different colors:

 

Screen Shot 14.png

 

 

Different colors and multiple lines:Screen Shot 16.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 14, 2025 Jul 14, 2025

Hi @pino_2179 here is a screenshot showing the standard underline options available. You can adjust colour, thickness, offset and also choose from some preset line types. Maybe they would help in your case?

- Mark

Screenshot 2025-07-15 at 11.19.12.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 15, 2025 Jul 15, 2025

Thank you so much everyone for your replies, and sorry for the delay 🙂

I'm attaching a screenshot of the hand-drawn underlining on a text...

Screenshot 2025-07-15 230119.png

 

Screenshot 2025-07-15 230242.png

 

I really hope I can complete this project!
I'm not an InDesign expert, but I know for sure that it's the only software that can help me 🙂

Thank you so much

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 15, 2025 Jul 15, 2025

Okay @pino_2179 I don't think any of our options will work because Indesign cannot apply multiple coloured underlines to the same text so where the black and green overlaps is a problem.

 

We are going to have to think outside the box on this one. I have some ideas but they all involve scripting. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 16, 2025 Jul 16, 2025

I don't know how to make a script, I used InDesign many years ago and I'm not a programmer 😞

Can you help me? What I'm asking is very complicated?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 16, 2025 Jul 16, 2025

I *think* it's going to be a bit complicated, but hopefully I'm wrong and someone here will have some better ideas.

Meanwhile I'm going to try something as a proof of concept.

- Mark

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 18, 2025 Jul 18, 2025

Hi @pino_2179, I have made a proof-of-concept script that may might be a good way for you. So buckle up because I want you to come on a little journey with me... 

 

We cannot do your job the normal way, using Indesign's normal underlining because Indesign cannot assign more than one underline to the same character. Your job requires runs of underlining starting and stopping on their own schedule, overlapping however they like. A corollary of that problem is that there is no convenient user interface for managing those wild runs of overlapping characters...

 

Or is there?

 

Well yes! There actually is—Conditional Text. Open the panel at menu Window > Type and Tables > Conditional Text. We can apply Conditions to text and they will overlap and we can see them quite well using either underlines or solid highlights (my preference). Keep reading to see a screenshot of this.

 

So we make a Condition "Underline Black" and "Underline Blue" etc. Then select some underline text and click "Underline Black" in the Conditional Text Panel. That is how—with my approach—you will decide what text gets underlined and in which color.

 

Then we make Object Styles also called "Underline Black" etc to match. These will be applied to the underline, where you can set stroke weight and colour, etc.

 

Once you have set all your underline conditions, then select one or more text frames and run my script below called "Generate Underlining.js". The script creates an underlying group for each text frame which contains the underlines, which are literally just drawn path items.

 

Have a look at these screen shots and also look at the attached .indd document if you like.

 

1. Some sample text.

generate-underlines-1.png

 

2. After you've set the underline conditions. See how they overlap?

generate-underlines-2.png

 

3. After running my script. The underlines are in a group (see layers panel).

generate-underlines-3.png

 

4. Just so you can see what I mean—here are the underlines with text frames removed.

generate-underlines-4.png

 

The good things:

  • The underlines each use an object style, so you can make changes to them very easily, such as changing the thickness or the color. (The vertical positioning is set by the configuration in the script, which you can adjust).
  • If the text re-flows, just run the script again—it will remove the outdated underlining and replace it with fresh.

 

And the bad things:

  • The script is somewhat slow—my tiny example above took 2-3 seconds to complete, which makes me think that a massive long story could take many, many minutes. There is some room for optimization though, such as writing the underlining to a snippet file as XML and placing it as a graphic; I'm pretty sure that would be a better way.
  • It is an extra step always to generate the underlines when the text changes. However, if you don't need the underlines, just wait until the last moment.

 

And here's the script. It's a fairly quick one, and there are many possible improvements, but for proof-of-concept I think it is pretty solid. Until someone comes up with a better approach anyway!

 

Let me know what you think. I know it's totally overwhelming if you haven't used Indesign for a long time!

- Mark

 

TO DOWNLOAD SCRIPT: Please see my Scripts for Adobe Indesign github repository and you can read about, and download, it there, but you can also download the script directly.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 28, 2025 Jul 28, 2025

Congratulations!

You were spectacular!

What version of InDesign can I use to do this? I'm embarrassed to write this, but I currently have CS3 😮

How do I upload the script you created?

Thank you for your support; this work is for a good cause, and I'm really happy to be able to complete it with your help!

Pino

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 28, 2025 Jul 28, 2025
quote

How do I upload the script you created?

By @pino_2179

 

Copy the full text of the script, paste it into a simple text editor - Notepad, TextEdit, etc. - and save it out as plain text, with the filename as specified: Generate Underlines.js

 

Move this file into InDesign's Scripts folder (go to the Scripts window in InDesign, select the 'User' folder, then right click and it should offer you the option to view that folder) and it should be ready for use. If not, you should only need to restart InDesign for it to be picked up.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 28, 2025 Jul 28, 2025

Hi @pino_2179 according to ChatGPT, Conditional Text was introduced in Indesign CS4, so my script definitely won't work in CS3. Even in CS4 I have no idea if the script will work as other things in the scripting API may have changed—there have been 17 major versions released since then!

 

Sorry to pass on the bad news. Perhaps you could subscribe for a month or two to finish your project?

- Mark

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 03, 2025 Oct 03, 2025

This looks awesome! When I select object style it creates an outline around the text box, not under each individual line as I want it to look 😞

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 03, 2025 Oct 03, 2025

And sorry, also asks me that I don't have a "Blue underline".

I mainly just want to have a white highlight on a specific set of text and a lavender underline under it. Like the attached. But it would be HELL to do this manually! I have 225 pages lol.
Screenshot 2025-10-03 084852.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 03, 2025 Oct 03, 2025

Hi @Raffi35430004124r  You need to configure the script for your document, such as settings which Object Styles you have set up for your different underlines.

 

However I don't think you need to go to that trouble. Perhaps you can just use Indesign's native underlining to achieve your effect. See the attached .indd.

- Mark

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 03, 2025 Oct 03, 2025

Hi m1b. I think maybe a bit more guidance would be useful because I still don't know how this works.

So, no. That's not what I'm trying to achieve. If you look at the screenshot there's one white underline in the whole text, I'm not looking to create a box around it, I would like the text to be underline to show the illustration under it.

Then, on top of the while underline, I'd like an additional thinner lavender underline.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 03, 2025 Oct 03, 2025

I also don't use object style to create my underlines because they need to be specific to a chunk of text! Not the whole text frame. I use character styles!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 05, 2025 Oct 05, 2025

[Quickly done just for fun!] Apparently, something as simplistic just using 2 char styles ("white" and "purple").

Note I've no idea about the op's layout.

 

Capture d’écran 2025-10-05 à 01.19.23.png

 

(^/)  The Jedi

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 05, 2025 Oct 05, 2025

"Note I've no idea about the op's layout."

 

Hi Michel,

well, the OP's layout is done in InDesign CS3.

FWIW: Back then feature Conditional Text was not there.

 

But:

"Underline" was possible.

"Strike Through" was possible.

 

Both could be combined easily with a character style.

 

"Custom Line Styles" were possible and used with both features from above.

And gaps in striped lines could be filled with color.

 

Should be enough for a mix of features to do what the OP wants to do.

 

Kind regards,
Uwe Laubender
( Adobe Community Expert )

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 17, 2025 Oct 17, 2025

Hi m1b, thanks again. I finally got a new Mac and installed a trial version of InDesign.
I was just starting to understand how to set up all the steps you kindly described.
Now I'd like to ask you an even greater favor, since I'm not an expert: would it be possible for you to record your screen while you perform the entire process? Unfortunately, I'm missing a few steps 😞 .
Thanks again, so much.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 17, 2025 Oct 17, 2025

@m1bI'm waiting 🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 17, 2025 Oct 17, 2025

@pino_2179 

Because you are not very familiar with Indesign, the quickest way is for you to share your document and I will set up the conditionals. Send me a PM (click on my name to access my profile). Don't share your document publicly here if it is sensitive.

- Mark

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 17, 2025 Oct 17, 2025

@m1b  file sent

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines