Omni Systems, Inc.

  

Mif2Go User's Guide, Version 55

  

Valid HTML 4.01!

 

Made with Mif2Go

23 Including graphics in HTML > 23.6 Positioning graphics in HTML output > 23.6.3 Indenting images


23.6.3 Indenting images

Best practice is to use CSS to indent images in HTML. The technique described in this section should be used only if you cannot use CSS.

Mif2Go can indent all non-inline graphics to match the indent used in your FrameMaker document. Graphics (and also tables) are indented in HTML output using a technique invented by Chuck Musciano

http://www.drdobbs.com/184411862

This technique consists of placing, at the start of the line that contains the graphic, a one-pixel transparent GIF image, 1p.gif, with a width attribute that produces the required indent in pixels. See §28.2.2 Modifying Mif2Go-supplied macro definitions.

To use the built-in Mif2Go spacer graphic:

[HTMLOptions]

; UseSpacers = No (default)

; or Yes, use to position tables and graphics

UseSpacers = Yes

To use your own graphic as a spacer instead of the built-in graphic:

[HTMLOptions]

; WriteSpacerFile = No (default) or Yes, write file after conversion

WriteSpacerFile = Yes

When WriteSpacerFile=Yes, the default name of the indent spacer image file is 1p.gif; you can specify a different name, or specify a different path:

[HTMLOptions]

; PixelSpacerImage = name of 1-pixel transparent GIF for spacing

PixelSpacerImage = 1p.gif

By default, Mif2Go writes the spacer image file to the project directory, and includes references of the following form in your HTML output:

<img src="1p.gif" . . . >

If you supply a path for PixelSpacerImage (for example, ./graphics/1p.gif), Mif2Go writes the spacer image file to the specified path. Then Mif2Go generates references of the form:

<img src="./graphics/1p.gif" . . . >

This can be important if you place graphics anywhere but the project directory (see §23.3 Locating graphics files for HTML).

Spacer alt attribute

The spacer graphic must have an alt attribute for W3C validation. The default value for the spacer alt attribute is [spacer]; you can change this default:

[HTMLOptions]

; SpacerAlt = text to use for alt attribute for spacer,

;  default [spacer]

SpacerAlt = [spacer]

Left indent

You can specify a custom indent for a single graphic or a graphics group; for example:

[GraphIndents]

; Graphic ID = number of pixels to indent using PixelSpacerImage

;  zero prevents indent, -1 is autoindent (default action)

schematic = 30

See §23.5.1 Assigning properties to sets of graphics.

Right indent

A similar method creates a space to the right of the image, except that the height attribute of the spacer is set to match the height attribute of the image. This is useful for run-in graphics, and for other floating types. For example:

[GraphRightSpacers]

; Graphic ID = number of pixels space on right using PixelSpacerImage

ch00b5d3 = 45

No indent

If you do not want any graphics indented, use a wildcard setting, as follows:

[GraphIndents]

* = 0

See §4.6 Using wildcards in configuration settings.



23 Including graphics in HTML > 23.6 Positioning graphics in HTML output > 23.6.3 Indenting images