imagedata

- SourceForge
- Home Page
- Samples

- Reference Contents |
- Download & Install |
- User Guides |
- Notes, E-mail & Bugs |
- Q&A

Suggestions
Search:
Next: caption
Previous: imageobject Up: MediaObjects mediaobject.mod.xsl

Reference Section

## Name

imagedata — Process `imagedata` [2.0.9] elements

## Synopsis

    <xsl:template match="imagedata" name="imagedata">
    <xsl:param name="filename">
    			<xsl:choose>
    				<xsl:when test="@entityref">
    					<xsl:value-of select="unparsed-entity-uri(@entityref)"/>
    				</xsl:when>
    				<xsl:otherwise>
    					<xsl:value-of select="@fileref"/>
    				</xsl:otherwise>
    			</xsl:choose>
    		</xsl:param>
    <xsl:param name="is.imageobjectco" select="false()"/>
    <xsl:variable name="width">
    			<xsl:choose>
    				<xsl:when test="contains(@width, '%') and substring-after(@width, '%')=''">
    					<xsl:value-of select="number(substring-before(@width, '%')) div 100"/>
    					<xsl:text>\textwidth</xsl:text>
    				</xsl:when>
    				<xsl:otherwise>
    					<xsl:value-of select="@width"/>
    				</xsl:otherwise>
    			</xsl:choose>
    		</xsl:variable>
      ...
    </xsl:template>

## A. Description

Formats a picture using `\includegraphics`.

## B. Pertinent Variables

There are no configuration variables for this template.

## C. Template Parameters

filename
  The file path to be passsed to `\includegraphics`. By default, the name of the graphics file is gathered from the `entityref` attribute, if it is present, or otherwise from the `fileref` attribute. Often with LaTeX, the `fileref` attribute need not end with any “filename extension” (see graphic.default.extension).

## D. DocBook Compliance and LaTeX Notes

- If both `@width` and `@scale` are given but `@scalefit='0'`, whitespace is added to the left and right in order to match the specified width.

- If `@width` is given and either `@scalefit=1` or no `@scale` is given, then the image is scale to `@width`. Otherwise, `@scale` is used, if it is present.

- If this is not the only `imagedata` within the figure, this will be rendered as a 'subfigure', including the `caption` of its enclosing `mediaobject`.

For widths, those containing a percent symbol (“%”) will be taken relative to the `\textwidth`.

The “PRN” value of the `format` attribute is honoured.

## F. Further Reading

- The DB2LaTeX mapping system latex.mapping.xsl
- content-templates

Prev | Up | Next
imageobject | Home | caption