Skip to main content
March 19, 2010
Question

Defining a background color for a paragraph style

  • March 19, 2010
  • 7 replies
  • 1066 views

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.

    This topic is closed to new replies. Start a new post to keep the conversation going.

    7 replies

    March 22, 2010

    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.

    tlmurray23
    Inspiring
    March 19, 2010

    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.

    March 19, 2010

    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:

    • set the paragraph's language to be "None", so it won't hyphenate.
    • add discretionary hyphens when needed (keyboard shortcuts: Esc hyphen Shift+d, Control+hyphen)
    March 19, 2010

    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.

    Michael_Müller-Hillebrand
    Legend
    March 19, 2010

    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

    RoboColum_n_
    Legend
    March 19, 2010

    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.


    • Read the RoboColum(n) for a tips, tricks and musings on the Technical Communication Suite products.
    • Follow the RoboColum(n) on Twitter
    March 19, 2010

    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.