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

Underline

Community Beginner ,
Dec 04, 2023 Dec 04, 2023

Copy link to clipboard

Copied

How do you underline a textbox (NOT the text itself) like the image below? If this isn't possible, could this be done via a script? Thank you!Screenshot 2023-12-04 at 20.19.11.png

TOPICS
How to , Scripting , Type

Views

638

Translate

Translate

Report

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 4 Correct answers

Community Expert , Dec 04, 2023 Dec 04, 2023

Use Paragraph Shading and a Paragraph rule adjusting the stroke so it only appears at the bottom (not the sidea and the top), set it as a Paragraph style.

 

Votes

Translate

Translate
Community Expert , Dec 04, 2023 Dec 04, 2023

There are a few ways to do this.

Here's just one: You could do it very easily as Text Paragraph Style, where you set Paragraph Shading and Paragraph Border, like so:

Screen Shot 2023-12-04 at 1.55.29 PM.png

 

Screen Shot 2023-12-04 at 1.55.46 PM.png

 

 

 

Votes

Translate

Translate
Community Expert , Dec 04, 2023 Dec 04, 2023

You could use a one-cell table with a border on the bottom.

Votes

Translate

Translate
Community Expert , Dec 07, 2023 Dec 07, 2023

With so many solutions some ordering is useful. But first, here's yet another solution, namely, Typefi's Autofit plug-in (which is free):

 

https://www.typefi.com/autofit/

 

The solutions here are of two different types:

1. If the text frame is always the same height and there's always a single one-line paragraph, then using paragraph borders or paragraph rules are the most straightforward (Derek, Brad)

2. If the text frame's height is variable (because of variable content length), then the most

...

Votes

Translate

Translate
Community Expert ,
Dec 04, 2023 Dec 04, 2023

Copy link to clipboard

Copied

Use Paragraph Shading and a Paragraph rule adjusting the stroke so it only appears at the bottom (not the sidea and the top), set it as a Paragraph style.

 

Votes

Translate

Translate

Report

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 ,
Dec 04, 2023 Dec 04, 2023

Copy link to clipboard

Copied

There are a few ways to do this.

Here's just one: You could do it very easily as Text Paragraph Style, where you set Paragraph Shading and Paragraph Border, like so:

Screen Shot 2023-12-04 at 1.55.29 PM.png

 

Screen Shot 2023-12-04 at 1.55.46 PM.png

 

 

 

Votes

Translate

Translate

Report

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 ,
Dec 04, 2023 Dec 04, 2023

Copy link to clipboard

Copied

You could use a one-cell table with a border on the bottom.

Votes

Translate

Translate

Report

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 ,
Dec 04, 2023 Dec 04, 2023

Copy link to clipboard

Copied

Hi @Rachel28371239g14w:

 

How do you underline a textbox (NOT the text itself) like the image below?

The only way to add the stroke to one side of the frame (and not the text or a cell) is to use a hard drop shadow. This technique adds the stroke to the frame, and you can save it as an object style and reuse it. 

https://www.rockymountaintraining.com/adobe-indesign-add-a-stroke-to-one-side-of-a-frame/

 

~Barb

Votes

Translate

Translate

Report

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 ,
Dec 04, 2023 Dec 04, 2023

Copy link to clipboard

Copied

This is the right solution for a separate text frame. If the element is meant to be a heading or other running/text flow element, styles that apply to the text and not a separate frame would be more... organic. A combination of text shading and a bottom border would achieve the effect without separating the item from the text flow.

 

If the OP really means "text box," though, this, and an Object Style, are the simple solution.


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.1 ┊ (Amazon) ┊┋

Votes

Translate

Translate

Report

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 ,
Dec 06, 2023 Dec 06, 2023

Copy link to clipboard

Copied

Hi @Barb Binder -- Very nice solution. Only I get a thin grey line around the whole box. Any idea how I can get rid of it?

 

PeterKahrel_0-1701862741890.png

 

Votes

Translate

Translate

Report

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 ,
Dec 06, 2023 Dec 06, 2023

Copy link to clipboard

Copied

Ugh! You are absolutely right, @Peter Kahrel. This was an effect I was working through with a client. They wanted a rule around the outside (which effectively hid the overflow issue) but even that likely wouldn't have worked in print. Inspired by your magnification, I checked the top/bottom edges and there's a slight blend. 

 

2023-12-06_08-23-52.png

We went in a different direction for the frames and I didn't write this up until a few months later (and left the stroke off) and the rest is obvious! Thanks for pointing it out.

 

~Barb

Votes

Translate

Translate

Report

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 ,
Dec 04, 2023 Dec 04, 2023

Copy link to clipboard

Copied

This is getting ridiculous, but I can't help it: I'll add *another* way to do this. Draw a line, cut it and paste it into the text, set the anchored object options something like this:

Screenshot 2023-12-05 at 17.12.27.png

And save as an Object Style (very important!). The cons of this approach are (1) anchored objects can be fiddly if you aren't used to them (eg. you may accidentally delete the rule while editing text if you forgot it was there), and (2) changing the width of the frame will not change the width of the line—you have to do that manually, or via the object style.

 

Even having read all the great answers here, there are still some cases where I would do it this way.

- Mark

Votes

Translate

Translate

Report

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 ,
Dec 05, 2023 Dec 05, 2023

Copy link to clipboard

Copied

Thank you everyone! So many ways to do this. I've learned a lot! Appreciate all of your help!

Votes

Translate

Translate

Report

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 ,
Dec 05, 2023 Dec 05, 2023

Copy link to clipboard

Copied

This gives me a line all the way around a text box. What am I missing?


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.1 ┊ (Amazon) ┊┋

Votes

Translate

Translate

Report

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 ,
Dec 06, 2023 Dec 06, 2023

Copy link to clipboard

Copied

Was this directed to me, James? Probably, but I saw Peter's question first this morning, so addressed it up there. 

 

~Barb

Votes

Translate

Translate

Report

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 ,
Dec 06, 2023 Dec 06, 2023

Copy link to clipboard

Copied

No, I was trying @m1b 's approach and reapplying the style gives a line all the way around the box. I'll look at your answer to see if it addresses my issues.

 

I am finding the text-frame solutions a bit complicated given that a simpler, 'auto adjusting, automatic and inline' paragraph style accomplishes the same function. 🙂


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.1 ┊ (Amazon) ┊┋

Votes

Translate

Translate

Report

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 ,
Dec 06, 2023 Dec 06, 2023

Copy link to clipboard

Copied

Ah, @James Gifford—NitroPress, I assumed it was for Barb's technique too. In my approach, the object style is configured for, and applied to, the anchored Graphic Line, not the frame. The object style handles the anchored object options as well as the styling for the line, and possibly the width of the line.

- Mark

Votes

Translate

Translate

Report

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 ,
Dec 06, 2023 Dec 06, 2023

Copy link to clipboard

Copied

You need to anchor extra Graphic Line in the text.

 

Votes

Translate

Translate

Report

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 ,
Dec 07, 2023 Dec 07, 2023

Copy link to clipboard

Copied

With so many solutions some ordering is useful. But first, here's yet another solution, namely, Typefi's Autofit plug-in (which is free):

 

https://www.typefi.com/autofit/

 

The solutions here are of two different types:

1. If the text frame is always the same height and there's always a single one-line paragraph, then using paragraph borders or paragraph rules are the most straightforward (Derek, Brad)

2. If the text frame's height is variable (because of variable content length), then the most convenient approach is a single-cell table (Eugene) or a scripted solution (Mark)

 

Typefi's Autofit solution is in category 2: you can set a relationship between a graphic line (or lines) and a text frame such that when the text frame is moved or resixed, the line travels/sizes with it. A bit like Mark's scripted solution but without the downsides.

Votes

Translate

Translate

Report

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 ,
Dec 07, 2023 Dec 07, 2023

Copy link to clipboard

Copied

I disagree on point 1. Using paragraph shading and bottom border (not rule), I am able to create a single paragraph style that seems to meet all the demands of the OP, all the details suggested by others... and is perfectly adaptable to single line, multi-line and even multi-paragraph content:

JamesGiffordNitroPress_0-1701976855704.png

 

 

Unless the requirement that this apply to a text frame is mandatory, the paragraph-style method is simpler and requires no juggling of object styles or manual adjustment of line length etc. (And even if a text frame is thought mandatory, I believe this option has the advantage of keeping the content in a single text flow, almost always an advantage for flowing layout, accessiblity, export, etc.)

 

As always... am I missing something here that dictates the rather complex solutions instead?


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.1 ┊ (Amazon) ┊┋

Votes

Translate

Translate

Report

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 ,
Dec 07, 2023 Dec 07, 2023

Copy link to clipboard

Copied

LATEST

By the way, Peter, my solution was a simple anchored graphic line—no scripting required! For once, haha!

- Mark

Votes

Translate

Translate

Report

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 ,
Dec 07, 2023 Dec 07, 2023

Copy link to clipboard

Copied

Well, the OP's request is in fact ambiguous. Her example suggests the simple case of a single one-line paragraph, which is easy to handle with a paragraph border. But at the same time she asked for underlining the text box, which some of us (including me) interpreted as 'how do you stroke only the bottom of a text frame'.  That is, if text changes affect the height of the frame, the stroke stays on the bottom of the text frame. With paragraph borders you won't be able to achieve that I don't think.

 

Votes

Translate

Translate

Report

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 ,
Dec 07, 2023 Dec 07, 2023

Copy link to clipboard

Copied

The paragraph style maintains the box proportions and underline perfectly regardless of the content — that's been my point here, that the flexibility of the style has been overlooked or misunderstood.

 

This is one paragraph style, unchanged across the examples:

JamesGiffordNitroPress_0-1701979326530.png

JamesGiffordNitroPress_1-1701979358974.png

JamesGiffordNitroPress_2-1701979409332.png

...and so on. All paragraph side spacing can be adjusted to limit box width if needed. The only limitation is that space above and below may need to be controlled by the adjacent paragraphs if reasonable inter-paragraph spacing in the box is desired. (if the spacing is wide enough to distance the box from other text, it's rather wide inside the box, and vice versa. It can be done, but not with fine gradations.)

 

But all of that is accomplished with no more than a Paragraph Shading and Paragraph Border (bottom only) setup —

JamesGiffordNitroPress_3-1701979641311.png

JamesGiffordNitroPress_4-1701979666328.png

— and is completely flexible and self-adjusting.

 


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.1 ┊ (Amazon) ┊┋

Votes

Translate

Translate

Report

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 ,
Dec 07, 2023 Dec 07, 2023

Copy link to clipboard

Copied

I think we'd all agree that the remaining answers are all correct and applicable, depending on the circumstances. I've used every one at different times (except the plug-in Peter, thanks for that).

- Mark

Votes

Translate

Translate

Report

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