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

How to keep paragraph shading within margins when it's the first thing on the page?

Community Beginner ,
Dec 12, 2018 Dec 12, 2018

Hi everyone,

So I've finally achieved 90% of what I'm trying to do - put a background on all my code snippets using Paragraph Shading on my "code" paragraph style. However, I can't seem to figure out how to keep it within the page margin when it's the first thing on the page. I learned about right click > Text Frame Options but this is a 400+ page book and I can't go in and adjust each code snippet manually. HELP! Please tell me there's a non-manual way... thank you!!

1.6K
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 1 Correct answer

Community Expert , Dec 19, 2018 Dec 19, 2018

You can get the look you want with a combination of paragraph shading and a rule above. In this screen shot they are the same color:

Screen Shot 2018-12-19 at 8.40.17 PM.png

In this one I changed the rule above to pink so that you can see it:

Screen Shot 2018-12-19 at 8.40.56 PM.png

~Barb

Translate
Community Expert ,
Dec 12, 2018 Dec 12, 2018

Hi Superhi:

Enabling the Clip to Frame checkbox for the paragraph style doesn't work?

If not, can you re-share the screen shot with hidden characters showing?

~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 ,
Dec 12, 2018 Dec 12, 2018

Hi Superhi,

As BarbBinder mentioned "Clip to frame" should work. If this is just for the first paragraph(i can't quite guess if this problem is with other paragraphs as well, since they are preceded with white spaces). But it would be worthwhile to check if the "Top Offset" is set to anything other than 0 and also if the "Top Edge" is set to "Leading", this could also cause the shading to extend.

However in any of these cases i have found "Clip to frame" work irrespective.

-Manan

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 ,
Dec 19, 2018 Dec 19, 2018

Hi all, thanks for your replies. Unfortunately, "Clip to Frame" doesn't give the code snippets the space above the text that I'm looking to keep. See screenshot:


So I'm wondering if there is way to keep it within page margins while still maintaining that space above the code text so it's not touching the top of the yellow box.

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
Valorous Hero ,
Dec 19, 2018 Dec 19, 2018

The only way I know of is to use the clip to frame to stop the spill out.

But in your code paragraph style, try setting a negative baseline shift. Screen shot is done in something else as I don't have a current subscription.

capture-002378.png

You could also maybe use a rule above using Paper color, but you would need two code paragraph styles, one for the first paragraph, another for the remainder and hook 'em together to be able to use Apply Next.

Mike

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 ,
Dec 19, 2018 Dec 19, 2018

You can get the look you want with a combination of paragraph shading and a rule above. In this screen shot they are the same color:

Screen Shot 2018-12-19 at 8.40.17 PM.png

In this one I changed the rule above to pink so that you can see it:

Screen Shot 2018-12-19 at 8.40.56 PM.png

~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 Beginner ,
Dec 20, 2018 Dec 20, 2018

YES thank you so much for this clever solution Barb! I've been racking my brain over this. So happy to finally figure it out. Cheers!

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 ,
Dec 20, 2018 Dec 20, 2018

Always happy to help, superhi .

~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
Engaged ,
Jan 18, 2023 Jan 18, 2023

Barb, as always, you come up with the most creative solutions to InDesign's most annoying problems!  Thanks for another one! -- C. Sinclaire

 

 

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 ,
Jan 19, 2023 Jan 19, 2023
LATEST

Thanks so much, Barb!

This is a solution for the top of a text frame.

In case of the bottom I currently see no way for an automated way.

The manual solution would be a text frame inset.

 

Issue at the bottom of the text frame:

TopOfTextFrame-Solution-1.PNG

 

Manual solution using an indent on the text frame at the bottom:

 

BottomOfTextFrame-ManualSolution-1.PNG

 

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