What im trying to do:
First I created a paragraph style that used a rule below with offset to create a colored box behind my text. But my text (which is a headline) sometimes need some sort of linebreak. It also need to be able to be imported into a table of content. ToC doesn’t play well with hard breaks in my headline because it will interferer with the nextstyle, and soft breaks doesn’t work with the “rule below”.
So my hack is: a paragraph style that uses a underline on the text with offset to create a colored box behind the text. Since the underline only will appear where there is text or blank spaces, I will insert blank spaces at the beginning of my paragraph and at the end. That means i cant use spacing, cause i need the colored box to start a bit before the text and after.
Does it make sense? I don’t know if there is any easier way.
Link below shows the effect i want to achieve.
View post on imgur.com