indenting fig in HTML output

In my HTML output (for OmniHelp, in my case), I've applied an indent to most elements, to create an open left margin below the title. But I'm having trouble indenting fig elements to match.

I can indent figures in body text by using a "spacer" macro as described in the DITA2Go User's Guide, or by setting up an img.indent class in css, or maybe by using [GraphIndents]. Unfortunately these methods also indent figures in bulleted or numbered lists. The problem is that these are already indented to match the list indent, and the additional indent destroys their alignment.

The DITA fig element has an expanse="textline" attribute setting that "Aligns the element with the left (for left to right presentation) or right (for right to left presentation) margin of the current text line and takes indention into account." This sounds ideal (what I'm really after, and I'm sure I'm not alone, is an output where all figures just align themselves under the immediately preceding text with no further fuss). But for DITA2GO output, this setting doesn't seem to have an effect.

As an alternative, I'd consider a div approach, which would let me indent everything below the title consistently from one control point; or at the very least, a mini-div approach where, if a fig element is inside a p element (say), both get wrapped in a div that takes the p element's indent. (The latter is how the DITA-OT implements the "textline" alignment, I think.)

In Mif2Go I'm already using a div approach to indents, but in DITA2Go I'm not sure how I'd go about it. For example, how would you enclose everything after a conbody or section title in a div, or trap an element containing a fig and put a div around both of them?

Indenting figs

You said:

I can indent figures in body text by using a "spacer" macro as described in the DITA2Go User's Guide, or by setting up an img.indent class in css, or maybe by using [GraphIndents]. Unfortunately these methods also indent figures in bulleted or numbered lists. The problem is that these are already indented to match the list indent, and the additional indent destroys their alignment.

That's only if you use the same @outputclass for all figs. But if you use a different class for each indent level, you can easily use the CSS indent (preferred) without spacers, or [GraphIndents] with spacers. You'd probably only need about five or six classes to handle a few levels of indent and other indented items like notes.

There are some issues with trying to do this automatically. Consider a sequence of list item, note, and fig. Does the fig align with the list item, with the note, or with the next para which may not even be in the list? Any rules like that will need to handle exceptions, which will require @outputclass anyway.

So it's not clear there would be much real benefit to supporting @expanse, which DITA2Go currently ignores. In fact, we ignore all special fig attributes except for @placement, @width, @height, and @alt. In some ways, it's a little surprising that the TC would add a purely "presentational" attribute like @expanse. Perhaps they are starting to realize that as Marshall McLuhan said in 1964, "The medium is the message." ;-)