1 <?xml version='1.0' encoding='UTF-8'?>
\r
2 <chapter xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude"
\r
3 xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:id="figures">
\r
4 <title>Figures, Diagrams, Screen Shots, and In-Line Graphics</title>
\r
6 <title>Overview</title>
\r
7 <para>Graphics, such as a diagram or a screen shot of a user interface, make a document more
\r
8 readable. Often, graphics also help clarify abstract concepts.</para>
\r
9 <para>Figures, diagrams, and screen shots contain images stored in external files. They are
\r
10 denoted using one of two elements: <tag class="element">figure</tag> or <tag class="element"
\r
11 >screenshot</tag>. The <tag class="element">figure</tag> element is used to denote a figure
\r
12 or a diagram. The <tag class="element">screenshot</tag> element is used to denote a screen
\r
16 <title>Image Data</title>
\r
17 <para>The preferred data format for images is PNG. However, images can be accepted in the
\r
18 following formats:</para>
\r
27 <para>Images should be placed in an <filename class="directory">images</filename> folder
\r
28 directly under the folder containing the document source. </para>
\r
29 <para>Image size...</para>
\r
32 <title>Image Size</title>
\r
33 <para>Image files should have a maximum width of 900 pixels.</para>
\r
34 <para>Image scaling should be set to 75%. This is ignored for HTML output and ensures images are
\r
35 optimally sized for PDF files. </para>
\r
38 <title>Figures and Diagrams</title>
\r
39 <para>Figures and diagrams are marked up the same way. They are both placed in a <tag
\r
40 class="element">figure</tag> element. The <tag class="element">figure</tag> element is a
\r
41 container for the caption and data that make up the figure or diagram.</para>
\r
42 <para>The caption is specified by a <tag class="element">title</tag> element. The <tag
\r
43 class="element">title</tag> element is the first child element of the<tag class="element"
\r
44 >figure</tag> element. The contents of the <tag class="element">title</tag> element is the
\r
45 caption used for the figure. It is also the default text used when you cross reference the
\r
47 <para>The image data is specified in a <tag class="element">mediaobject</tag> element. The <tag
\r
48 class="element">mediaobject</tag> element is a wrapper for an <tag class="element"
\r
49 >imageobject</tag> element. The <tag class="element">imageobject</tag> element is also a
\r
50 wrapper element. The <tag class="element">imageobject</tag> element wraps an <tag
\r
51 class="element">imagedata</tag> element that specifies the name of the file containing the
\r
53 <para>The <tag class="element">imagedata</tag> element has no content. All of the information is
\r
54 specified using three attributes:</para>
\r
56 <title>Attributes for imagedata Element</title>
\r
60 <entry>Attribute</entry>
\r
61 <entry>Description</entry>
\r
67 <tag class="attribute">align</tag>
\r
69 <entry>Specifies how the image is aligned on the page. Valid values are <tag
\r
70 class="attvalue">left</tag>, <tag class="attvalue">right</tag>, and <tag
\r
71 class="attvalue">center</tag>.</entry>
\r
75 <tag class="attribute">fileref</tag>
\r
77 <entry>Specifies the location of the file containing the image.</entry>
\r
81 <tag class="attribute">format</tag>
\r
83 <entry>Specifies the type of data used to specify the image. Valid values are <tag
\r
84 class="attvalue">GIF</tag>, <tag class="attvalue">JPG</tag>, and <tag
\r
85 class="attvalue">PNG</tag>.</entry>
\r
90 <para><xref linkend="figure_example"/> shows the mark-up for a figure.</para>
\r
91 <example xml:id="figure_example">
\r
92 <title>Mark-up for a Figure</title>
\r
93 <programlisting><figure xml:id="fig_1">
\r
94 <title>CeltiXfire WAR Structure</title>
\r
97 <imagedata align="center"
\r
98 fileref="./images/tomcat_war.gif"
\r
99 format="GIF" />
\r
100 </imageobject>
\r
101 </mediaobject>
\r
103 </figure></programlisting>
\r
107 <title>Screen Shots</title>
\r
108 <para>Screen shots are also marked up using a <tag class="element">figure</tag> element.
\r
109 However, a screen shot uses one additional wrapper element. The <tag class="element"
\r
110 >screenshot</tag> element wraps the <tag class="element">mediaobject</tag> element as shown
\r
111 in <xref linkend="screen_example"/>.</para>
\r
112 <example xml:id="screen_example">
\r
113 <title>Mark-up for a Screen Shot</title>
\r
114 <programlisting><figure xml:id="screen_1">
\r
115 <title>SOA Tools Welcome Screen</title>
\r
117 <mediaobject>
\r
118 <imageobject>
\r
119 <imagedata align="center"
\r
120 fileref="./images/welcome.gif"
\r
121 format="GIF" />
\r
122 </imageobject>
\r
123 </mediaobject>
\r
124 </screenshot>
\r
126 </figure></programlisting>
\r
130 <title>In-Line Graphics</title>
\r
131 <para>Graphical elements that need to be placed in-line with the text of a paragraph are marked
\r
132 up using the <tag class="element">inlinemediaobject</tag> element. Like the <tag
\r
133 class="element">mediaobject</tag> element, the <tag class="element">inlinemediaobject</tag>
\r
134 element is a wrapper for an <tag class="element">imageobject</tag> element. <xref
\r
135 linkend="inline_example"/> shows the mark-up for an in-line graphic.</para>
\r
136 <example xml:id="inline_example">
\r
137 <title>Mark-up for an In-Line Graphic</title>
\r
138 <programlisting><inlinemediaobject>
\r
139 <imageobject>
\r
140 <imagedata align="center" fileref="./images/larrow.gif"
\r
141 format="GIF" />
\r
142 </imageobject>
\r
144 </inlinemediaobject></programlisting>
\r
148 <title>Adding Alternative Text</title>
\r
149 <para>For better accessibility and to comply with federal and local accessibility guidelines,
\r
150 all images in DocBook files should include alternative text.</para>
\r
151 <para>To include alternative text with a graphic, add a <tag class="element">textobject</tag>
\r
152 element after the <tag class="element">imageobject</tag> element. The <tag class="element"
\r
153 >textobject</tag> element has a single <tag class="element">phrase</tag> child element. The
\r
154 value of the <tag class="element">phrase</tag> element is the alternative text used when the
\r
155 documentation is generated to HTML.</para>
\r
156 <example xml:id="alttext_example">
\r
157 <title>Mark-up for Alternative Text</title>
\r
158 <programlisting><mediaobject>
\r
159 <imageobject>
\r
160 <imagedata align="center" fileref="./images/config.gif"
\r
161 format="GIF" />
\r
162 </imageobject>
\r
164 <phrase>Configuration Hierarchy</phrase>
\r
165 </textobject>
\r
166 </mediaobject></programlisting>
\r