I want to emphazise a part of the text in a text box by placing a frame behind the text and add color to the frame. This works fine but when I anchor the frame, it frame be positioned on top of the text and I am not able to move it behind the text. How can I solve this? See screenshots.
Copy link to clipboard
In your case, you could set the yellow anchored object to overprint (Window> Output> Attributes> overprint fill), this should work fine for print, but not necessarily for screen viewing of the PDF, as some viewers will ignore overprinting.
Other options would be to send the yellow box behind the text and group it with the text box, or apply a yellow drop shadow to the anchored object, color the object white, and move it out of the text box, offsetting the shadow to position it where it is needed. Or applying a paragraph style.
As written lots of times on forums: use a double anchoring to do it and keep a total control of the frames placing!
(^/) The Jedi
Can you explain double anchoring?
If time, I should extract from the Script I indicate below the code to play it with just "1 click".
I mean: you draw a no-anchored frame as you showed and, selecting it - "1 click" -, the frame is "double-anchored" in the text behind it … so now anchored behind the text at the same place! 😉
The screenshot shows "Tables" where cells have, after the Script, background effects! The way used to play it is the "double-anchoring"!
yes, I think paragraph shading should work perfectly for this purpose.
The text section with "Case" seems to be reason for highlighting.
Another option, but not so flexible:
Use an Above Line Anchored object in its own paragraph above the paragraph starting with "Case".
To get the right starting point horizontally use a high indent value for the paragraph. Just like that:
EDIT: In my sample above I used a 50 mm indent for the paragraph with the anchor character. So here added another screenshot that is showing the paragraph character selected and the Paragraph panel. Also a new annotation regarding the Alignment option of the Anchored Object dialog:
In the Anchored Object dialog you have to use the alignement option (Text Alignment), in my German screenshots (Textausrichtung), so that the anchored object will follow the value for the indented paragraph.
Note 1: The negative value that pushes the anchored rectangle down and will also render it in stacking order behind the text cannot exceed the height of the anchored object.
Note 2: That limit, the height of the anchored object, can easily be pushed by applying a high negative value of baseline shift to the anchor special character:
( ACP )
// EDITD: Screenshot added with some explanations
And here's a sample of using Paragraph Shading.
Adjust the yellow "faux box" size and position by adjusting the Offsets.
The shading can extend beyond the frame, beyond the paragraph into neighboring paragraphs, or be behind only part of the paragraph. Endless visual designs with this powerful trick. And very simple to do.
Thanks for the example. It is realy am easy way to apply a background color to a paragraph!
Thanks for the reply. Above Line Anchored object works indeed, but I found paragraph shading more flexible as you already mentioned.
Thanks for your help!