DITA: Images
Inserting an image
To insert an image, use the image
tag and specify the
placement
attribute to set line wrapping.
You can also choose placement="inline"
if you're inserting an image in the
line of your sentence (such as a button image) or if you want text to flow around your image.
The Open Toolkit renders images with a placement="break"
attribute with two br
tags before and after the image.
You can also choose an align
attribute and select left
,
right
, or center
. The alt
tags in the
middle define the alt text for the image, which is what displays if a user's images are turned
off.
Note that images won't automatically resize or automatically take on a border. However, you can set those properties in your webhelp CSS to accomplish this.
When you're writing a task, you can put images inside the cmd
or the
info
tag.
The caption will actually appear below the image in the Oxygen webhelp output.
Reusing images
conref
element, you must include the
href
attribute because this attribute is required. But the value for href
is
-dita-use-conref-target
.
Referring to specific figures
The output will say "See Oxygen Sample Webhelp for details." With the webhelp, the reference will link to the image. The image itself won't have a figure number below it. With PDF, there will be a figure number below it.
conref
to manually pull in the image title, you can do
so like
this:
Image format
It's recommended that you use the SVG format for images because this format allows you to add callouts that you can later edit and extract for translation.
Other parameters
frame="all"
attribute. If you want your image to be scaled to its container size, use
scalefit
. You can also specify a width
.
However, I think it would be wiser to use max-width
on images in your
webhelp stylesheet.
About Tom Johnson
I'm an API technical writer based in the Seattle area. On this blog, I write about topics related to technical writing and communication — such as software documentation, API documentation, AI, information architecture, content strategy, writing processes, plain language, tech comm careers, and more. Check out my API documentation course if you're looking for more info about documenting APIs. Or see my posts on AI and AI course section for more on the latest in AI and tech comm.
If you're a technical writer and want to keep on top of the latest trends in the tech comm, be sure to subscribe to email updates below. You can also learn more about me or contact me. Finally, note that the opinions I express on my blog are my own points of view, not that of my employer.