Chapter 2. Image Formatting

Images 900px wide or less

If the source image is 900px wide or less use the following code

 
    <mediaobject>
        <alt>OPTIONAL DESCRIPTION OF IMAGE</alt>
        <imageobject>
            <imagedata scalefit="0" fileref="media/FILENAME.png"/>
        </imageobject>
    </mediaobject>
    

In HTML output, the image will display at actual size; in PDF it will be scaled down to 75% (scale percentage set in ~/stylesheets/sitka_fo_graphics.xsl).

Images wider than 900px

If the source image is wider than 900px use the following code

 
    <mediaobject>
        <alt>OPTIONAL DESCRIPTION OF IMAGE</alt>
        <imageobject>
            <imagedata width="100%" scalefit="1" fileref="media/FILENAME.png"/>
        </imageobject>
    </mediaobject>
        

In HTML the image will scale down to 900px width (default.image.width setting in ~/stylesheets/sitka_xhtml.xsl). In PDF it will scale down to page width.

Tip

Wrap the mediaobject tag in a para to add a small space between the image and preceding content.

Keeping image and text together

Content wrapped in any formal or informal object (eg informalfigure, formalfigure, informalexample, formalexample) is kept together on the same page in pdf output. Use informalfigure to keep an image with associated text, as in this example of a step:.

 
    <step>   
       <informalfigure>
          <para>STEP TEXT HERE</para>
          <para>
             <mediaobject>
                <alt>OPTIONAL DESCRIPTION OF IMAGE</alt>
                <imageobject>
                   <imagedata width="100%" scalefit="1" fileref="media/FILENAME.png"/>
                </imageobject>
             </mediaobject>
          </para>
       </informalfigure>
    </step>
        

Documentation for Evergreen version 1.6
Copyright © 2010, Evergreen Community