Skip to main content
Participant
Dec 12, 2018 11:30 PM UTC
Answered

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

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!!

This topic is closed to new replies. Start a new post to keep the conversation going.
Barb Binder
Barb BinderCorrect answer
Community Expert
Dec 20, 2018 3:42 AM UTC

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:

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

~Barb

~Barb at Rocky Mountain Training

9 replies

Community Expert
Jan 19, 2023 12:58 PM UTC

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:

 

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

 

 

Regards,
Uwe Laubender
( Adobe Community Expert )

Translate
superhiAuthor
Participant
Dec 19, 2018 10:07 PM UTC

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
MW Design
Inspiring
Dec 20, 2018 12:52 AM UTC

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.

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
Community Expert
Dec 13, 2018 6:02 AM UTC

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
-Manan
Barb Binder
Community Expert
Community Expert
Dec 13, 2018 2:55 AM UTC

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
~Barb at Rocky Mountain Training