Copy link to clipboard
Copied
Hello and please excuse this very basic question, but I am completely stumped.
How do I simply define a background color for a paragraph style? I cannot use a table etc. because the styles are mapped during an XML conversion. Code lines should receive a gray background box to separate them from the text.
Also, is there a way to force line breaks whithin words for a specific style? The text, formated in Courier, should just fill the space with a fixed width per character and break wherever the line ends.
Copy link to clipboard
Copied
What we have done is to add an object to the master page with the required background colour. There may be a better way to do this. If there is, I'd like to know.
Copy link to clipboard
Copied
Hello Column,
what I have tried is to add a grey object to the reference page and then adjust the paragraph style to display this either above or beneath. I have not succeeded yet in displaying this behind the text though, in the sense of a grey background.
Copy link to clipboard
Copied
Robert,
You can use a table. I remember there was an example in the Structured Application reference (or so) how to set up the Read/Write rules to automatically create a one-cell table to create a shaded heading. This should work equally well for a codeblock element.
I don’t find it at the moment but it was basically using Unwrap commands, which upon opening XML are treated as Wrap commands.
Maybe others remember the example or have the description at hand.
- Michael
Copy link to clipboard
Copied
With some drawbacks it's doable using two paragraph tags.
The first tag, e.g. "Line" is empty (no text), and it has a reference page graphic that's just a rectangle filled 100% with color and set to have a percentage tint so that the text will "show through" it.
"Line" is also set to have a negative space below it, e.g. -12 points.
"Code" paratag has the actual code text in it, and it's set to have a negative space above, e.g. -12 points.
I've done projects where I have multiple Line paratags differing by the number of code lines needing to be shaded, e.g. Line1, Line2, Line3.
Unfortunately there isn't a way to automatically have the line expand to the correct depth of the Code paragraph, although I believe this would probably be something that could be done as a Framescript, to run through a document and create new "line" paratags of the correct depth depending on how many Code paragraphs or lines are in the following paratag.
Copy link to clipboard
Copied
Also, is there a way to force line breaks whithin words for a specific style? The text, formated in Courier, should just fill the space with a fixed width per character and break wherever the line ends.
My strategy for setting code text:
Copy link to clipboard
Copied
I can't tell you whether it will survive XML, but I have some solutions at my Web site. Go to http://www.techknowledgecorp.com/help and look along the left column for the item about creating reversed type. It includes an old Frame 6 sample.
Copy link to clipboard
Copied
Thanks for the help! Probably converting to single-cell tables will solve the problem with some extra work. Its too bad that Adobe puts so much effort in redesigning the UI rather than improving basic functions such as text formatting.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more